Skip to content

Commit

Permalink
Include more types in traceability
Browse files Browse the repository at this point in the history
Incoming commitment (11) and incoming pledge (13) should also be
included.
  • Loading branch information
andylolz committed Mar 5, 2018
1 parent 45cf340 commit 4b4582f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions stats/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ def is_text_in_element(elementName):
'transaction_commitment': self.element.xpath('transaction[transaction-type/@code="{}" or transaction-type/@code="11"]'.format(self._commitment_code())),
'transaction_spend': self.element.xpath('transaction[transaction-type/@code="{}" or transaction-type/@code="{}"]'.format(self._disbursement_code(), self._expenditure_code())),
'transaction_currency': all_true_and_not_empty(x.xpath('value/@value-date') and x.xpath('../@default-currency|./value/@currency') for x in self.element.findall('transaction')),
'transaction_traceability': all_true_and_not_empty(x.xpath('provider-org/@provider-activity-id') for x in self.element.xpath('transaction[transaction-type/@code="{}"]'.format(self._incoming_funds_code())))
'transaction_traceability': all_true_and_not_empty(x.xpath('provider-org/@provider-activity-id') for x in self.element.xpath('transaction[transaction-type/@code="{}" or transaction-type/@code="11" or transaction-type/@code="13"]'.format(self._incoming_funds_code())))
or self._is_donor_publisher(),
'budget': self.element.findall('budget'),
'contact-info': self.element.findall('contact-info/email'),
Expand Down Expand Up @@ -1194,7 +1194,7 @@ def comprehensiveness_denominators(self):
return {
'recipient_language': 1 if len(self.element.findall('recipient-country')) == 1 else 0,
'transaction_spend': 1 if start_date and start_date < self.today and (self.today - start_date) > datetime.timedelta(days=365) else 0,
'transaction_traceability': 1 if (self.element.xpath('transaction[transaction-type/@code="{}"]'.format(self._incoming_funds_code()))) or self._is_donor_publisher() else 0,
'transaction_traceability': 1 if (self.element.xpath('transaction[transaction-type/@code="{}" or transaction-type/@code="11" or transaction-type/@code="13"]'.format(self._incoming_funds_code()))) or self._is_donor_publisher() else 0,
}
else:
return {
Expand Down

1 comment on commit 4b4582f

@Bjwebb
Copy link
Contributor

@Bjwebb Bjwebb commented on 4b4582f Dec 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.