Fix #60 se extendiente tipo de operacion a otros documentos.
FossilOrigin-Name: 299c70b2dc438aa24b00bdd015144404be425b6bb0afecf8d31ba68d48928e78
This commit is contained in:
@@ -20,7 +20,7 @@ def simple_debit_note_without_lines():
|
||||
inv.set_period(datetime.now(), datetime.now())
|
||||
inv.set_issue(datetime.now())
|
||||
inv.set_ident('ABC123')
|
||||
inv.set_operation_type('10')
|
||||
inv.set_operation_type('30')
|
||||
inv.set_payment_mean(form.PaymentMean(form.PaymentMean.DEBIT, '41', datetime.now(), '1234'))
|
||||
inv.set_supplier(form.Party(
|
||||
name = 'facho-supplier',
|
||||
@@ -52,7 +52,7 @@ def simple_credit_note_without_lines():
|
||||
inv.set_period(datetime.now(), datetime.now())
|
||||
inv.set_issue(datetime.now())
|
||||
inv.set_ident('ABC123')
|
||||
inv.set_operation_type('10')
|
||||
inv.set_operation_type('20')
|
||||
inv.set_payment_mean(form.PaymentMean(form.PaymentMean.DEBIT, '41', datetime.now(), '1234'))
|
||||
inv.set_supplier(form.Party(
|
||||
name = 'facho-supplier',
|
||||
|
||||
@@ -93,3 +93,42 @@ def test_FAU14():
|
||||
wants = form.Amount(119.0 + 19.0 - 50.0)
|
||||
|
||||
assert inv.invoice_legal_monetary_total.payable_amount == wants, "got %s want %s" % (inv.invoice_legal_monetary_total.payable_amount, wants)
|
||||
|
||||
|
||||
def test_invalid_tipo_operacion_nota_debito():
|
||||
reference = form.InvoiceDocumentReference(
|
||||
ident = '11111',
|
||||
uuid = '21312312',
|
||||
date = '2020-05-05'
|
||||
)
|
||||
inv = form.DebitNote(reference)
|
||||
with pytest.raises(ValueError):
|
||||
inv.set_operation_type(22)
|
||||
|
||||
def test_valid_tipo_operacion_nota_debito():
|
||||
reference = form.InvoiceDocumentReference(
|
||||
ident = '11111',
|
||||
uuid = '21312312',
|
||||
date = '2020-05-05'
|
||||
)
|
||||
inv = form.DebitNote(reference)
|
||||
inv.set_operation_type('30')
|
||||
|
||||
def test_invalid_tipo_operacion_nota_credito():
|
||||
reference = form.InvoiceDocumentReference(
|
||||
ident = '11111',
|
||||
uuid = '21312312',
|
||||
date = '2020-05-05'
|
||||
)
|
||||
inv = form.DebitNote(reference)
|
||||
with pytest.raises(ValueError):
|
||||
inv.set_operation_type('990')
|
||||
|
||||
def test_valid_tipo_operacion_nota_credito():
|
||||
reference = form.InvoiceDocumentReference(
|
||||
ident = '11111',
|
||||
uuid = '21312312',
|
||||
date = '2020-05-05'
|
||||
)
|
||||
inv = form.CreditNote(reference)
|
||||
inv.set_operation_type('20')
|
||||
|
||||
Reference in New Issue
Block a user