SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit 79e1cbb8 authored by Jean-Sébastien Caux's avatar Jean-Sébastien Caux
Browse files

Improve presentation of financial data

parent f1a5534f
No related branches found
No related tags found
No related merge requests found
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
<td>Number of Associated Publications, compiled (depending on context) for a given year or over many years, for a specific Journal or for many, etc.</td> <td>Number of Associated Publications, compiled (depending on context) for a given year or over many years, for a specific Journal or for many, etc.</td>
</tr> </tr>
<tr> <tr>
<th>Publication Fraction</th>
<th>PubFrac</th> <th>PubFrac</th>
<th></th>
<td>A fraction of a unit representing an Organization's "weight" for a given Publication.<br>The weight is given by the following simple algorithm: <td>A fraction of a unit representing an Organization's "weight" for a given Publication.<br>The weight is given by the following simple algorithm:
<ul> <ul>
<li>First, the unit is split equally among each of the authors.</li> <li>First, the unit is split equally among each of the authors.</li>
...@@ -58,16 +58,17 @@ ...@@ -58,16 +58,17 @@
<td>Sum of the values of all Subsidies relevant to a given context (for example: from a given Organization in a given year).</td> <td>Sum of the values of all Subsidies relevant to a given context (for example: from a given Organization in a given year).</td>
</tr> </tr>
<tr> <tr>
<th>Balance</th> <th>Impact on reserves</th>
<th></th> <th></th>
<td>Difference between incoming and outgoing financial resources (again defined depending on context).<br>A positive balance means that our initiative is sustainable (and perhaps even able to grow).<br>A negative balance means that these activities are depleting our financial reserves.</td> <td>Difference between incoming and outgoing financial resources for the activities under consideration (again defined depending on context).<br>A positive impact on reserves means that our initiative is sustainable (and perhaps even able to grow).<br>A negative impact on reserves means that these activities are effectively depleting our available resources and threatening our sustainability.</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
{% if 'finadmin' in user_roles %} {% if 'finadmin' in user_roles %}
<table class="table table-danger bg-opacity-10 m-4 p-4 caption-top"> <div class="border border-danger bg-danger bg-opacity-10 m-4">
<caption class="text-danger bg-danger bg-opacity-25 p-2">[FinAdmin]</caption> <p><strong class="text-danger">[FinAdmin]</strong></p>
<table class="table m-4 p-4">
<tbody> <tbody>
<tr> <tr>
<th>Compensations</th> <th>Compensations</th>
...@@ -114,6 +115,7 @@ ...@@ -114,6 +115,7 @@
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div>
{% endif %} {% endif %}
</details> </details>
...@@ -478,7 +478,7 @@ class Organization(models.Model): ...@@ -478,7 +478,7 @@ class Organization(models.Model):
cumulative_associated_uncompensated = 0 cumulative_associated_uncompensated = 0
cumulative_subsidy_income = 0 cumulative_subsidy_income = 0
cumulative_reserved = 0 cumulative_reserved = 0
cumulative_balance = 0 cumulative_impact_on_reserves = 0
pf = self.pubfracs.all() pf = self.pubfracs.all()
publications_all = self.get_publications() publications_all = self.get_publications()
for year in pubyears: for year in pubyears:
...@@ -603,7 +603,7 @@ class Organization(models.Model): ...@@ -603,7 +603,7 @@ class Organization(models.Model):
), ),
} }
rep[str(year)]["reserved"] = subsidy_income - year_self_compensated rep[str(year)]["reserved"] = subsidy_income - year_self_compensated
rep[str(year)]["balance"] = subsidy_income - year_expenditures rep[str(year)]["impact_on_reserves"] = subsidy_income - year_expenditures
cumulative_nap += year_nap cumulative_nap += year_nap
cumulative_pubfracs += year_pubfracs cumulative_pubfracs += year_pubfracs
cumulative_expenditures += year_expenditures cumulative_expenditures += year_expenditures
...@@ -614,7 +614,7 @@ class Organization(models.Model): ...@@ -614,7 +614,7 @@ class Organization(models.Model):
cumulative_associated_compensated += year_associated_compensated cumulative_associated_compensated += year_associated_compensated
cumulative_associated_uncompensated += year_associated_uncompensated cumulative_associated_uncompensated += year_associated_uncompensated
cumulative_subsidy_income += subsidy_income cumulative_subsidy_income += subsidy_income
cumulative_balance += subsidy_income - year_expenditures cumulative_impact_on_reserves += subsidy_income - year_expenditures
cumulative_reserved += subsidy_income - year_self_compensated cumulative_reserved += subsidy_income - year_self_compensated
rep["cumulative"] = { rep["cumulative"] = {
"nap": cumulative_nap, "nap": cumulative_nap,
...@@ -637,7 +637,7 @@ class Organization(models.Model): ...@@ -637,7 +637,7 @@ class Organization(models.Model):
), ),
"subsidy_income": cumulative_subsidy_income, "subsidy_income": cumulative_subsidy_income,
"reserved": cumulative_reserved, "reserved": cumulative_reserved,
"balance": cumulative_balance, "impact_on_reserves": cumulative_impact_on_reserves,
} }
return rep return rep
......
...@@ -118,7 +118,7 @@ ...@@ -118,7 +118,7 @@
<p>Are you a representative of this Organization? We advise you to:</p> <p>Are you a representative of this Organization? We advise you to:</p>
<ul> <ul>
<li> <li>
Make sure your Organization gets included in Make sure your Organization gets included in
<a href="https://www.crossref.org/services/funder-registry/" target="_blank" rel="noopener">Crossref's Funder Registry</a>; <a href="https://www.crossref.org/services/funder-registry/" target="_blank" rel="noopener">Crossref's Funder Registry</a>;
</li> </li>
<li> <li>
...@@ -416,7 +416,7 @@ ...@@ -416,7 +416,7 @@
</p> </p>
{% if 'finadmin' in user_roles %} {% if 'finadmin' in user_roles %}
<p class="bg-danger bg-opacity-10"> <p class="border border-danger bg-danger bg-opacity-10 p-1">
<strong class="text-danger">[FinAdmin]</strong> <strong class="text-danger">[FinAdmin]</strong>
<br /> <br />
The next columns detail the compensations (through Subsidies) obtained from this Organization, or from other (ally) Organizations on its behalf. Any negative balance hits SciPost's reserve budget. The next columns detail the compensations (through Subsidies) obtained from this Organization, or from other (ally) Organizations on its behalf. Any negative balance hits SciPost's reserve budget.
...@@ -431,13 +431,13 @@ ...@@ -431,13 +431,13 @@
{% if 'finadmin' in user_roles %} {% if 'finadmin' in user_roles %}
<tr> <tr>
<td colspan="3"></td> <td colspan="3"></td>
<td colspan="3" class="bg-danger bg-opacity-10 text-center"> <td colspan="3" class="border border-danger bg-danger bg-opacity-10 text-center">
<strong>FinAdmin</strong> <strong>FinAdmin</strong>
</td> </td>
<td colspan="2"></td> <td colspan="2"></td>
{% if organization.has_pubfracs %} {% if organization.has_pubfracs %}
<td colspan="3" class="bg-danger bg-opacity-10 text-center"> <td colspan="3" class="border border-danger bg-danger bg-opacity-10 text-center">
<strong>FinAdmin</strong> <strong>FinAdmin</strong>
</td> </td>
{% endif %} {% endif %}
...@@ -457,25 +457,25 @@ ...@@ -457,25 +457,25 @@
<th class="text-end text-wrap">Total associated expenditures</th> <th class="text-end text-wrap">Total associated expenditures</th>
{% if 'finadmin' in user_roles %} {% if 'finadmin' in user_roles %}
<th class="text-end text-wrap">Total associated compensations</th> <th class="border border-danger bg-danger bg-opacity-10 text-end text-wrap">Total associated compensations</th>
<th class="text-end text-wrap">Total associated uncompensated</th> <th class="border border-danger bg-danger bg-opacity-10 text-end text-wrap">Total associated uncompensated</th>
<th class="text-end text-wrap">Bystander percentage</th> <th class="border border-danger bg-danger bg-opacity-10 text-end text-wrap">Bystander percentage</th>
{% endif %} {% endif %}
{% if organization.has_pubfracs %} {% if organization.has_pubfracs %}
<th class="text-end text-wrap">PubFrac share</th> <th class="text-end text-wrap">PubFrac<br>share</th>
{% endif %} {% endif %}
<th class="text-end text-wrap">Subsidy support</th> <th class="text-end text-wrap">Subsidy<br>support</th>
{% if organization.has_pubfracs %} {% if organization.has_pubfracs %}
{% if 'finadmin' in user_roles %} {% if 'finadmin' in user_roles %}
<th class="text-end text-wrap">Compensations (self)</th> <th class="border border-danger bg-danger bg-opacity-10 text-end text-wrap">Compensations (self)</th>
<th class="text-end text-wrap">Reserved</th> <th class="border border-danger bg-danger bg-opacity-10 text-end text-wrap">Reserved</th>
<th class="text-end text-wrap">Compensations (Allies)</th> <th class="border border-danger bg-danger bg-opacity-10 text-end text-wrap">Compensations (Allies)</th>
{% endif %} {% endif %}
<th class="text-end text-wrap">Balance</th> <th class="text-end text-wrap">Impact on<br>reserves</th>
{% endif %} {% endif %}
</tr> </tr>
...@@ -487,15 +487,15 @@ ...@@ -487,15 +487,15 @@
<td class="text-end">&euro;{{ balance.cumulative.associated_expenditures }}</td> <td class="text-end">&euro;{{ balance.cumulative.associated_expenditures }}</td>
{% if 'finadmin' in user_roles %} {% if 'finadmin' in user_roles %}
<td class="text-end">&euro;{{ balance.cumulative.associated_compensated }}</td> <td class="border border-danger bg-danger bg-opacity-10 text-end">&euro;{{ balance.cumulative.associated_compensated }}</td>
{% if balance.cumulative.associated_uncompensated > 0 %} {% if balance.cumulative.associated_uncompensated > 0 %}
<td class="text-end bg-danger bg-opacity-25">&euro;{{ balance.cumulative.associated_uncompensated }}</td> <td class="border border-danger text-end bg-danger bg-opacity-25">&euro;{{ balance.cumulative.associated_uncompensated }}</td>
{% else %} {% else %}
<td class="text-end bg-success bg-opacity-25">&euro;{{ balance.cumulative.associated_uncompensated }}</td> <td class="border border-danger text-end bg-success bg-opacity-25">&euro;{{ balance.cumulative.associated_uncompensated }}</td>
{% endif %} {% endif %}
<td class="text-end">{{ balance.cumulative.bystander_percentage }}</td> <td class="border border-danger bg-danger bg-opacity-10 text-end">{{ balance.cumulative.bystander_percentage }}</td>
{% endif %} {% endif %}
{% if organization.has_pubfracs %}<td class="text-end">&euro;{{ balance.cumulative.expenditures }}</td>{% endif %} {% if organization.has_pubfracs %}<td class="text-end">&euro;{{ balance.cumulative.expenditures }}</td>{% endif %}
...@@ -504,17 +504,18 @@ ...@@ -504,17 +504,18 @@
{% if organization.has_pubfracs %} {% if organization.has_pubfracs %}
{% if 'finadmin' in user_roles %} {% if 'finadmin' in user_roles %}
<td class="text-end">&euro;{{ balance.cumulative.self_compensated }}</td> <td class="border border-danger bg-danger bg-opacity-10 text-end">&euro;{{ balance.cumulative.self_compensated }}</td>
<td class="text-end">&euro;{{ balance.cumulative.reserved }}</td> <td class="border border-danger bg-danger bg-opacity-10 text-end">&euro;{{ balance.cumulative.reserved }}</td>
<td class="text-end">&euro;{{ balance.cumulative.ally_compensated }}</td> <td class="border border-danger bg-danger bg-opacity-10 text-end">&euro;{{ balance.cumulative.ally_compensated }}</td>
{% endif %} {% endif %}
<td class="text-end bg- <td class="text-end">&euro;{{ balance.cumulative.impact_on_reserves }}</td>
{% if balance.cumulative.balance < 0 %}danger{% else %}success{% endif %}
bg-opacity-25">&euro;{{ balance.cumulative.balance }}</td>
{% endif %} {% endif %}
</tr> </tr>
<tr>
<td>Per year:</td>
</tr>
{% now "Y" as current_year %} {% now "Y" as current_year %}
{% for year in publishing_years %} {% for year in publishing_years %}
...@@ -538,15 +539,15 @@ ...@@ -538,15 +539,15 @@
<td class="text-end">&euro;{{ val.expenditures.total.associated_expenditures }}</td> <td class="text-end">&euro;{{ val.expenditures.total.associated_expenditures }}</td>
{% if 'finadmin' in user_roles %} {% if 'finadmin' in user_roles %}
<td class="text-end">&euro;{{ val.expenditures.total.associated_compensated }}</td> <td class="border border-danger bg-danger bg-opacity-10 text-end">&euro;{{ val.expenditures.total.associated_compensated }}</td>
{% if val.expenditures.total.associated_uncompensated > 0 %} {% if val.expenditures.total.associated_uncompensated > 0 %}
<td class="text-end bg-danger bg-opacity-25">&euro;{{ val.expenditures.total.associated_uncompensated }}</td> <td class="border border-danger text-end bg-danger bg-opacity-25">&euro;{{ val.expenditures.total.associated_uncompensated }}</td>
{% else %} {% else %}
<td class="text-end bg-success bg-opacity-25">&euro;{{ val.expenditures.total.associated_uncompensated }}</td> <td class="border border-danger text-end bg-success bg-opacity-25">&euro;{{ val.expenditures.total.associated_uncompensated }}</td>
{% endif %} {% endif %}
<td class="text-end">{{ val.expenditures.total.bystander_percentage }}</td> <td class="border border-danger bg-danger bg-opacity-10 text-end">{{ val.expenditures.total.bystander_percentage }}</td>
{% endif %} {% endif %}
{% if organization.has_pubfracs %}<td class="text-end">&euro;{{ val.expenditures.total.expenditures }}</td>{% endif %} {% if organization.has_pubfracs %}<td class="text-end">&euro;{{ val.expenditures.total.expenditures }}</td>{% endif %}
...@@ -555,14 +556,12 @@ ...@@ -555,14 +556,12 @@
{% if organization.has_pubfracs %} {% if organization.has_pubfracs %}
{% if 'finadmin' in user_roles %} {% if 'finadmin' in user_roles %}
<td class="text-end">&euro;{{ val.expenditures.total.self_compensated }}</td> <td class="border border-danger bg-danger bg-opacity-10 text-end">&euro;{{ val.expenditures.total.self_compensated }}</td>
<td class="text-end">&euro;{{ val.reserved }}</td> <td class="border border-danger bg-danger bg-opacity-10 text-end">&euro;{{ val.reserved }}</td>
<td class="text-end">&euro;{{ val.expenditures.total.ally_compensated }}</td> <td class="border border-danger bg-danger bg-opacity-10 text-end">&euro;{{ val.expenditures.total.ally_compensated }}</td>
{% endif %} {% endif %}
<td class="text-end bg- <td class="text-end bg-{% if val.impact_on_reserves < 0 %}danger{% else %}success{% endif %} bg-opacity-25">&euro;{{ val.impact_on_reserves }}</td>
{% if val.balance < 0 %}danger{% else %}success{% endif %}
bg-opacity-25">&euro;{{ val.balance }}</td>
{% endif %} {% endif %}
</tr> </tr>
...@@ -570,7 +569,7 @@ ...@@ -570,7 +569,7 @@
<td class="pe-0" colspan=" <td class="pe-0" colspan="
{% if 'finadmin' in user_roles %}12{% else %}6{% endif %} {% if 'finadmin' in user_roles %}12{% else %}6{% endif %}
"> ">
<div class="my-2 ms-4 me-0 p-2 border border-secondary"> <div class="my-2 ms-4 me-2 p-2 border border-secondary">
<p> <p>
The following table give an overview of expenditures The following table give an overview of expenditures
...@@ -612,9 +611,9 @@ ...@@ -612,9 +611,9 @@
<th class="text-end text-wrap">Total associated expenditures</th> <th class="text-end text-wrap">Total associated expenditures</th>
{% if 'finadmin' in user_roles %} {% if 'finadmin' in user_roles %}
<th class="text-end text-wrap">Total associated compensations</th> <th class="border border-danger bg-danger bg-opacity-10 text-end text-wrap">Total associated compensations</th>
<th class="text-end text-wrap">Total associated uncompensated</th> <th class="border border-danger bg-danger bg-opacity-10 text-end text-wrap">Total associated uncompensated</th>
<th class="text-end text-wrap">Bystander percentage</th> <th class="border border-danger bg-danger bg-opacity-10 text-end text-wrap">Bystander percentage</th>
{% endif %} {% endif %}
{% if organization.has_pubfracs %} {% if organization.has_pubfracs %}
...@@ -622,9 +621,9 @@ ...@@ -622,9 +621,9 @@
<th class="text-end text-wrap">PubFracs expenditures share</th> <th class="text-end text-wrap">PubFracs expenditures share</th>
{% if 'finadmin' in user_roles %} {% if 'finadmin' in user_roles %}
<th class="text-end text-wrap">Compensations (Organization)</th> <th class="border border-danger bg-danger bg-opacity-10 text-end text-wrap">Compensations (Organization)</th>
<th class="text-end text-wrap">Compensations (Allies)</th> <th class="border border-danger bg-danger bg-opacity-10 text-end text-wrap">Compensations (Allies)</th>
<th class="text-end text-wrap">Balance (uncompensated)</th> <th class="border border-danger bg-danger bg-opacity-10 text-end text-wrap">Balance (uncompensated)</th>
{% endif %} {% endif %}
{% endif %} {% endif %}
...@@ -640,15 +639,15 @@ ...@@ -640,15 +639,15 @@
<td class="text-end">&euro;{{ journaldata.associated_expenditures }}</td> <td class="text-end">&euro;{{ journaldata.associated_expenditures }}</td>
{% if 'finadmin' in user_roles %} {% if 'finadmin' in user_roles %}
<td class="text-end">&euro;{{ journaldata.associated_compensated }}</td> <td class="border border-danger bg-danger bg-opacity-10 text-end">&euro;{{ journaldata.associated_compensated }}</td>
{% if journaldata.associated_uncompensated > 0 %} {% if journaldata.associated_uncompensated > 0 %}
<td class="bg-danger bg-opacity-25 text-end">&euro;{{ journaldata.associated_uncompensated }}</td> <td class="border border-danger bg-danger bg-opacity-25 text-end">&euro;{{ journaldata.associated_uncompensated }}</td>
{% else %} {% else %}
<td class="bg-success bg-opacity-25 text-end">&euro;{{ journaldata.associated_uncompensated }}</td> <td class="border border-danger bg-success bg-opacity-25 text-end">&euro;{{ journaldata.associated_uncompensated }}</td>
{% endif %} {% endif %}
<td class="text-end">{{ journaldata.bystander_percentage }}</td> <td class="border border-danger bg-danger bg-opacity-10 text-end">{{ journaldata.bystander_percentage }}</td>
{% endif %} {% endif %}
{% if organization.has_pubfracs %} {% if organization.has_pubfracs %}
...@@ -656,13 +655,13 @@ ...@@ -656,13 +655,13 @@
<td class="text-end">&euro;{{ journaldata.expenditures }}</td> <td class="text-end">&euro;{{ journaldata.expenditures }}</td>
{% if 'finadmin' in user_roles %} {% if 'finadmin' in user_roles %}
<td class="text-end">&euro;{{ journaldata.self_compensated }}</td> <td class="border border-danger bg-danger bg-opacity-10 text-end">&euro;{{ journaldata.self_compensated }}</td>
<td class="text-end">&euro;{{ journaldata.ally_compensated }}</td> <td class="border border-danger bg-danger bg-opacity-10 text-end">&euro;{{ journaldata.ally_compensated }}</td>
{% if journaldata.uncompensated > 0 %} {% if journaldata.uncompensated > 0 %}
<td class="bg-danger bg-opacity-25 text-end">&euro;{{ journaldata.uncompensated }}</td> <td class="border border-danger bg-danger bg-opacity-25 text-end">&euro;{{ journaldata.uncompensated }}</td>
{% else %} {% else %}
<td class="bg-success bg-opacity-25 text-end">&euro;{{ journaldata.uncompensated }}</td> <td class="border border-danger bg-success bg-opacity-25 text-end">&euro;{{ journaldata.uncompensated }}</td>
{% endif %} {% endif %}
{% endif %} {% endif %}
{% endif %} {% endif %}
...@@ -799,7 +798,7 @@ ...@@ -799,7 +798,7 @@
aria-labelledby="events-{{ org.id }}-tab"> aria-labelledby="events-{{ org.id }}-tab">
<h3>Events</h3> <h3>Events</h3>
<ul><li><a href="{% url 'organizations:organizationevent_create' pk=org.id %}">Add an event</a></li></ul> <ul><li><a href="{% url 'organizations:organizationevent_create' pk=org.id %}">Add an event</a></li></ul>
<ul> <ul>
{% for event in org.organizationevent_set.all %} {% for event in org.organizationevent_set.all %}
{% include 'organizations/_organization_event_li.html' with event=event %} {% include 'organizations/_organization_event_li.html' with event=event %}
......
...@@ -124,7 +124,7 @@ ...@@ -124,7 +124,7 @@
</th> </th>
<th>SciPost sponsor?</th> <th>SciPost sponsor?</th>
{% if 'finadmin' in user_roles %} {% if 'finadmin' in user_roles %}
<th class="bg-danger bg-opacity-10"><span class="text-danger">FinAdmin</span><br>Support balance</th> <th class="border border-danger bg-danger bg-opacity-10"><span class="text-danger">FinAdmin</span><br>Support balance<br></th>
{% endif %} {% endif %}
</tr> </tr>
</thead> </thead>
...@@ -160,24 +160,7 @@ ...@@ -160,24 +160,7 @@
<td class="bg-warning">Not yet</td> <td class="bg-warning">Not yet</td>
{% endif %} {% endif %}
{% if 'finadmin' in user_roles %} {% if 'finadmin' in user_roles %}
<td> <td class="border border-danger bg-danger bg-opacity-10 text-end">&euro;{{ org.cf_balance_info.cumulative.balance }}</td>
<table>
<tr>
<td class="py-0">cumul.:</td>
<td class="py-0 text-end">&euro;{{ org.cf_balance_info.cumulative.balance }}</td>
</tr>
{% for year in publishing_years|slice:"0:5" %}
{% for key, val in org.cf_balance_info.items %}
{% if year == key|add:"0" %}
<tr>
<td class="py-0">{{ year }}:</td>
<td class="py-0 text-end">&euro;{{ val.balance }}</td>
</tr>
{% endif %}
{% endfor %}
{% endfor %}
</table>
</td>
{% endif %} {% endif %}
</tr> </tr>
{% empty %} {% empty %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment