usa Amount en Quantity
FossilOrigin-Name: 0f51683a044925969f6f113710ca9456dfa541a80ec3d7a3b9e5235718cbf0ea
This commit is contained in:
parent
ccb407b86f
commit
67156ec9a6
@ -116,12 +116,12 @@ class Amount:
|
|||||||
class Quantity:
|
class Quantity:
|
||||||
|
|
||||||
def __init__(self, val, code):
|
def __init__(self, val, code):
|
||||||
if not isinstance(val, int):
|
if type(val) not in [float, int]:
|
||||||
raise ValueError('val expected int')
|
raise ValueError('val expected int or float')
|
||||||
if code not in codelist.UnidadesMedida:
|
if code not in codelist.UnidadesMedida:
|
||||||
raise ValueError("code [%s] not found" % (code))
|
raise ValueError("code [%s] not found" % (code))
|
||||||
|
|
||||||
self.value = val
|
self.value = Amount(val)
|
||||||
self.code = code
|
self.code = code
|
||||||
|
|
||||||
def __mul__(self, other):
|
def __mul__(self, other):
|
||||||
|
@ -112,7 +112,7 @@ def test_invoice_cufe(simple_invoice_without_lines):
|
|||||||
simple_invoice.invoice_supplier.ident = form.PartyIdentification('700085371', '5', '31')
|
simple_invoice.invoice_supplier.ident = form.PartyIdentification('700085371', '5', '31')
|
||||||
simple_invoice.invoice_customer.ident = form.PartyIdentification('800199436', '5', '31')
|
simple_invoice.invoice_customer.ident = form.PartyIdentification('800199436', '5', '31')
|
||||||
simple_invoice.add_invoice_line(form.InvoiceLine(
|
simple_invoice.add_invoice_line(form.InvoiceLine(
|
||||||
quantity = form.Quantity(1, '94'),
|
quantity = form.Quantity(1.00, '94'),
|
||||||
description = 'producto',
|
description = 'producto',
|
||||||
item = form.StandardItem(111),
|
item = form.StandardItem(111),
|
||||||
price = form.Price(form.Amount(1_500_000), '01', ''),
|
price = form.Price(form.Amount(1_500_000), '01', ''),
|
||||||
|
Loading…
Reference in New Issue
Block a user