diff --git a/scipost_django/finances/templates/finances/_definitions_details.html b/scipost_django/finances/templates/finances/_definitions_details.html index a8e8ea4c710488bedf97d9fa6fbb09f0196fba6c..48dc246db92f00bbcaae8921ec7cdb833cc585e5 100644 --- a/scipost_django/finances/templates/finances/_definitions_details.html +++ b/scipost_django/finances/templates/finances/_definitions_details.html @@ -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> </tr> <tr> + <th>Publication Fraction</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: <ul> <li>First, the unit is split equally among each of the authors.</li> @@ -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> </tr> <tr> - <th>Balance</th> + <th>Impact on reserves</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> </tbody> </table> {% if 'finadmin' in user_roles %} - <table class="table table-danger bg-opacity-10 m-4 p-4 caption-top"> - <caption class="text-danger bg-danger bg-opacity-25 p-2">[FinAdmin]</caption> + <div class="border border-danger bg-danger bg-opacity-10 m-4"> + <p><strong class="text-danger">[FinAdmin]</strong></p> + <table class="table m-4 p-4"> <tbody> <tr> <th>Compensations</th> @@ -114,6 +115,7 @@ </tr> </tbody> </table> + </div> {% endif %} </details> diff --git a/scipost_django/organizations/models.py b/scipost_django/organizations/models.py index 7dc4b0bc7adad79967114faeb4176a266188b2d6..5bab3ea05f2685639318d69f4fdb1617efabcca5 100644 --- a/scipost_django/organizations/models.py +++ b/scipost_django/organizations/models.py @@ -478,7 +478,7 @@ class Organization(models.Model): cumulative_associated_uncompensated = 0 cumulative_subsidy_income = 0 cumulative_reserved = 0 - cumulative_balance = 0 + cumulative_impact_on_reserves = 0 pf = self.pubfracs.all() publications_all = self.get_publications() for year in pubyears: @@ -603,7 +603,7 @@ class Organization(models.Model): ), } 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_pubfracs += year_pubfracs cumulative_expenditures += year_expenditures @@ -614,7 +614,7 @@ class Organization(models.Model): cumulative_associated_compensated += year_associated_compensated cumulative_associated_uncompensated += year_associated_uncompensated 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 rep["cumulative"] = { "nap": cumulative_nap, @@ -637,7 +637,7 @@ class Organization(models.Model): ), "subsidy_income": cumulative_subsidy_income, "reserved": cumulative_reserved, - "balance": cumulative_balance, + "impact_on_reserves": cumulative_impact_on_reserves, } return rep diff --git a/scipost_django/organizations/templates/organizations/_organization_card.html b/scipost_django/organizations/templates/organizations/_organization_card.html index 3113050923eb06deb2f0bdc934a5ccb50f50aada..08907217de8d74a2c4ae09d6e456e9a4074b8b06 100644 --- a/scipost_django/organizations/templates/organizations/_organization_card.html +++ b/scipost_django/organizations/templates/organizations/_organization_card.html @@ -118,7 +118,7 @@ <p>Are you a representative of this Organization? We advise you to:</p> <ul> <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>; </li> <li> @@ -416,7 +416,7 @@ </p> {% 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> <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. @@ -431,13 +431,13 @@ {% if 'finadmin' in user_roles %} <tr> <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> </td> <td colspan="2"></td> {% 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> </td> {% endif %} @@ -457,25 +457,25 @@ <th class="text-end text-wrap">Total associated expenditures</th> {% if 'finadmin' in user_roles %} - <th class="text-end text-wrap">Total associated compensations</th> - <th class="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">Total associated compensations</th> + <th class="border border-danger bg-danger bg-opacity-10 text-end text-wrap">Total associated uncompensated</th> + <th class="border border-danger bg-danger bg-opacity-10 text-end text-wrap">Bystander percentage</th> {% endif %} {% if organization.has_pubfracs %} - <th class="text-end text-wrap">PubFrac share</th> + <th class="text-end text-wrap">PubFrac<br>share</th> {% 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 'finadmin' in user_roles %} - <th class="text-end text-wrap">Compensations (self)</th> - <th class="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 (self)</th> + <th class="border border-danger bg-danger bg-opacity-10 text-end text-wrap">Reserved</th> + <th class="border border-danger bg-danger bg-opacity-10 text-end text-wrap">Compensations (Allies)</th> {% endif %} - <th class="text-end text-wrap">Balance</th> + <th class="text-end text-wrap">Impact on<br>reserves</th> {% endif %} </tr> @@ -487,15 +487,15 @@ <td class="text-end">€{{ balance.cumulative.associated_expenditures }}</td> {% if 'finadmin' in user_roles %} - <td class="text-end">€{{ balance.cumulative.associated_compensated }}</td> + <td class="border border-danger bg-danger bg-opacity-10 text-end">€{{ balance.cumulative.associated_compensated }}</td> {% if balance.cumulative.associated_uncompensated > 0 %} - <td class="text-end bg-danger bg-opacity-25">€{{ balance.cumulative.associated_uncompensated }}</td> + <td class="border border-danger text-end bg-danger bg-opacity-25">€{{ balance.cumulative.associated_uncompensated }}</td> {% else %} - <td class="text-end bg-success bg-opacity-25">€{{ balance.cumulative.associated_uncompensated }}</td> + <td class="border border-danger text-end bg-success bg-opacity-25">€{{ balance.cumulative.associated_uncompensated }}</td> {% 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 %} {% if organization.has_pubfracs %}<td class="text-end">€{{ balance.cumulative.expenditures }}</td>{% endif %} @@ -504,17 +504,18 @@ {% if organization.has_pubfracs %} {% if 'finadmin' in user_roles %} - <td class="text-end">€{{ balance.cumulative.self_compensated }}</td> - <td class="text-end">€{{ balance.cumulative.reserved }}</td> - <td class="text-end">€{{ balance.cumulative.ally_compensated }}</td> + <td class="border border-danger bg-danger bg-opacity-10 text-end">€{{ balance.cumulative.self_compensated }}</td> + <td class="border border-danger bg-danger bg-opacity-10 text-end">€{{ balance.cumulative.reserved }}</td> + <td class="border border-danger bg-danger bg-opacity-10 text-end">€{{ balance.cumulative.ally_compensated }}</td> {% endif %} - <td class="text-end bg- - {% if balance.cumulative.balance < 0 %}danger{% else %}success{% endif %} - bg-opacity-25">€{{ balance.cumulative.balance }}</td> + <td class="text-end">€{{ balance.cumulative.impact_on_reserves }}</td> {% endif %} </tr> + <tr> + <td>Per year:</td> + </tr> {% now "Y" as current_year %} {% for year in publishing_years %} @@ -538,15 +539,15 @@ <td class="text-end">€{{ val.expenditures.total.associated_expenditures }}</td> {% if 'finadmin' in user_roles %} - <td class="text-end">€{{ val.expenditures.total.associated_compensated }}</td> + <td class="border border-danger bg-danger bg-opacity-10 text-end">€{{ val.expenditures.total.associated_compensated }}</td> {% if val.expenditures.total.associated_uncompensated > 0 %} - <td class="text-end bg-danger bg-opacity-25">€{{ val.expenditures.total.associated_uncompensated }}</td> + <td class="border border-danger text-end bg-danger bg-opacity-25">€{{ val.expenditures.total.associated_uncompensated }}</td> {% else %} - <td class="text-end bg-success bg-opacity-25">€{{ val.expenditures.total.associated_uncompensated }}</td> + <td class="border border-danger text-end bg-success bg-opacity-25">€{{ val.expenditures.total.associated_uncompensated }}</td> {% 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 %} {% if organization.has_pubfracs %}<td class="text-end">€{{ val.expenditures.total.expenditures }}</td>{% endif %} @@ -555,14 +556,12 @@ {% if organization.has_pubfracs %} {% if 'finadmin' in user_roles %} - <td class="text-end">€{{ val.expenditures.total.self_compensated }}</td> - <td class="text-end">€{{ val.reserved }}</td> - <td class="text-end">€{{ val.expenditures.total.ally_compensated }}</td> + <td class="border border-danger bg-danger bg-opacity-10 text-end">€{{ val.expenditures.total.self_compensated }}</td> + <td class="border border-danger bg-danger bg-opacity-10 text-end">€{{ val.reserved }}</td> + <td class="border border-danger bg-danger bg-opacity-10 text-end">€{{ val.expenditures.total.ally_compensated }}</td> {% endif %} - <td class="text-end bg- - {% if val.balance < 0 %}danger{% else %}success{% endif %} - bg-opacity-25">€{{ val.balance }}</td> + <td class="text-end bg-{% if val.impact_on_reserves < 0 %}danger{% else %}success{% endif %} bg-opacity-25">€{{ val.impact_on_reserves }}</td> {% endif %} </tr> @@ -570,7 +569,7 @@ <td class="pe-0" colspan=" {% 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> The following table give an overview of expenditures @@ -612,9 +611,9 @@ <th class="text-end text-wrap">Total associated expenditures</th> {% if 'finadmin' in user_roles %} - <th class="text-end text-wrap">Total associated compensations</th> - <th class="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">Total associated compensations</th> + <th class="border border-danger bg-danger bg-opacity-10 text-end text-wrap">Total associated uncompensated</th> + <th class="border border-danger bg-danger bg-opacity-10 text-end text-wrap">Bystander percentage</th> {% endif %} {% if organization.has_pubfracs %} @@ -622,9 +621,9 @@ <th class="text-end text-wrap">PubFracs expenditures share</th> {% if 'finadmin' in user_roles %} - <th class="text-end text-wrap">Compensations (Organization)</th> - <th class="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">Compensations (Organization)</th> + <th class="border border-danger bg-danger bg-opacity-10 text-end text-wrap">Compensations (Allies)</th> + <th class="border border-danger bg-danger bg-opacity-10 text-end text-wrap">Balance (uncompensated)</th> {% endif %} {% endif %} @@ -640,15 +639,15 @@ <td class="text-end">€{{ journaldata.associated_expenditures }}</td> {% if 'finadmin' in user_roles %} - <td class="text-end">€{{ journaldata.associated_compensated }}</td> + <td class="border border-danger bg-danger bg-opacity-10 text-end">€{{ journaldata.associated_compensated }}</td> {% if journaldata.associated_uncompensated > 0 %} - <td class="bg-danger bg-opacity-25 text-end">€{{ journaldata.associated_uncompensated }}</td> + <td class="border border-danger bg-danger bg-opacity-25 text-end">€{{ journaldata.associated_uncompensated }}</td> {% else %} - <td class="bg-success bg-opacity-25 text-end">€{{ journaldata.associated_uncompensated }}</td> + <td class="border border-danger bg-success bg-opacity-25 text-end">€{{ journaldata.associated_uncompensated }}</td> {% 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 %} {% if organization.has_pubfracs %} @@ -656,13 +655,13 @@ <td class="text-end">€{{ journaldata.expenditures }}</td> {% if 'finadmin' in user_roles %} - <td class="text-end">€{{ journaldata.self_compensated }}</td> - <td class="text-end">€{{ journaldata.ally_compensated }}</td> + <td class="border border-danger bg-danger bg-opacity-10 text-end">€{{ journaldata.self_compensated }}</td> + <td class="border border-danger bg-danger bg-opacity-10 text-end">€{{ journaldata.ally_compensated }}</td> {% if journaldata.uncompensated > 0 %} - <td class="bg-danger bg-opacity-25 text-end">€{{ journaldata.uncompensated }}</td> + <td class="border border-danger bg-danger bg-opacity-25 text-end">€{{ journaldata.uncompensated }}</td> {% else %} - <td class="bg-success bg-opacity-25 text-end">€{{ journaldata.uncompensated }}</td> + <td class="border border-danger bg-success bg-opacity-25 text-end">€{{ journaldata.uncompensated }}</td> {% endif %} {% endif %} {% endif %} @@ -799,7 +798,7 @@ aria-labelledby="events-{{ org.id }}-tab"> <h3>Events</h3> <ul><li><a href="{% url 'organizations:organizationevent_create' pk=org.id %}">Add an event</a></li></ul> - + <ul> {% for event in org.organizationevent_set.all %} {% include 'organizations/_organization_event_li.html' with event=event %} diff --git a/scipost_django/organizations/templates/organizations/organization_list.html b/scipost_django/organizations/templates/organizations/organization_list.html index d66e2285ee833b19f67eef7405c31454c8fb3efe..295a0ed7d4ec0c811b7d9553aaec0476f7b2f458 100644 --- a/scipost_django/organizations/templates/organizations/organization_list.html +++ b/scipost_django/organizations/templates/organizations/organization_list.html @@ -124,7 +124,7 @@ </th> <th>SciPost sponsor?</th> {% 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 %} </tr> </thead> @@ -160,24 +160,7 @@ <td class="bg-warning">Not yet</td> {% endif %} {% if 'finadmin' in user_roles %} - <td> - <table> - <tr> - <td class="py-0">cumul.:</td> - <td class="py-0 text-end">€{{ 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">€{{ val.balance }}</td> - </tr> - {% endif %} - {% endfor %} - {% endfor %} - </table> - </td> + <td class="border border-danger bg-danger bg-opacity-10 text-end">€{{ org.cf_balance_info.cumulative.balance }}</td> {% endif %} </tr> {% empty %}