Loading muffin/payment_order/PaymentOrderCollection.py +7 −0 Original line number Diff line number Diff line Loading @@ -19,3 +19,10 @@ class PaymentOrderCollection(Iterable[PaymentOrder]): @property def by_budgetary_item_id(self): return group_by(self, lambda payment_order: payment_order.budgetary_item_id) @property def sums_by_budgetary_item_id(self): return { budgetary_item_id: sum(po.amount for po in payment_orders) for budgetary_item_id, payment_orders in self.by_budgetary_item_id } Loading
muffin/payment_order/PaymentOrderCollection.py +7 −0 Original line number Diff line number Diff line Loading @@ -19,3 +19,10 @@ class PaymentOrderCollection(Iterable[PaymentOrder]): @property def by_budgetary_item_id(self): return group_by(self, lambda payment_order: payment_order.budgetary_item_id) @property def sums_by_budgetary_item_id(self): return { budgetary_item_id: sum(po.amount for po in payment_orders) for budgetary_item_id, payment_orders in self.by_budgetary_item_id }