Commit bf37dd26 authored by Jérome Perrin's avatar Jérome Perrin

Support Cancellation Amount in Budget Cell

parent f0529181
...@@ -143,23 +143,23 @@ class BudgetCell(Predicate, MetaNode, Movement): ...@@ -143,23 +143,23 @@ class BudgetCell(Predicate, MetaNode, Movement):
'setSourceCredit') 'setSourceCredit')
def setSourceCredit(self, source_credit): def setSourceCredit(self, source_credit):
"""Set the quantity. """Set the quantity.
Overloaded from movement, we always set the quantity, if not passed Overloaded from movement, we always set the quantity, even if not passed
""" """
try: try:
source_credit = float(source_credit) source_credit = float(source_credit)
except TypeError: except TypeError:
source_credit = 0.0 source_credit = 0.0
self.setQuantity(source_credit) Movement.setSourceCredit(self, source_credit)
def setSourceDebit(self, source_debit): def setSourceDebit(self, source_debit):
"""Set the quantity. """Set the quantity.
Overloaded from movement, we always set the quantity, if not passed Overloaded from movement, we always set the quantity, even if not passed
""" """
try: try:
source_debit = float(source_debit) source_debit = float(source_debit)
except TypeError: except TypeError:
source_debit = 0.0 source_debit = 0.0
self.setQuantity(-source_debit) Movement.setSourceDebit(self, source_debit)
security.declareProtected( Permissions.ModifyPortalContent, security.declareProtected( Permissions.ModifyPortalContent,
'setDestinationDebit', 'setDestinationCredit' ) 'setDestinationDebit', 'setDestinationCredit' )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment