usa Amount en Quantity

FossilOrigin-Name: 0f51683a044925969f6f113710ca9456dfa541a80ec3d7a3b9e5235718cbf0ea
This commit is contained in:
bit4bit
2020-11-10 23:17:25 +00:00
parent ccb407b86f
commit 67156ec9a6
2 changed files with 4 additions and 4 deletions

View File

@@ -116,12 +116,12 @@ class Amount:
class Quantity:
def __init__(self, val, code):
if not isinstance(val, int):
raise ValueError('val expected int')
if type(val) not in [float, int]:
raise ValueError('val expected int or float')
if code not in codelist.UnidadesMedida:
raise ValueError("code [%s] not found" % (code))
self.value = val
self.value = Amount(val)
self.code = code
def __mul__(self, other):