facho/fe/form.py(Amount): solo permite positivos.

FossilOrigin-Name: 220d676ea89de7c4562375be0d71d0b8b410d146a828969d56fc30d1e4532835
This commit is contained in:
2020-11-01 02:25:23 +00:00
parent 22ced94163
commit d97ff79137
2 changed files with 8 additions and 0 deletions

View File

@@ -55,6 +55,10 @@ class AmountCollection(Collection):
class Amount:
def __init__(self, amount: int or float or Amount, currency: Currency = Currency('COP')):
#DIAN 1.7.-2020: 1.2.3.1
if amount < 0:
raise ValueError('amount must be positive >= 0')
if isinstance(amount, Amount):
self.amount = amount.amount
self.currency = amount.currency