Fix: Formateado PEP8 se elimina responsabilidad O-07 segun anexo 1.9

This commit is contained in:
2024-08-06 14:02:40 -05:00
parent 028cf8b687
commit de99633211
5 changed files with 165 additions and 135 deletions

View File

@@ -4,30 +4,32 @@ from datetime import datetime
@pytest.fixture
def simple_debit_note_without_lines():
inv = form.DebitNote(form.InvoiceDocumentReference('1234', 'xx', datetime.now()))
inv = form.DebitNote(form.InvoiceDocumentReference(
'1234', 'xx', datetime.now()))
inv.set_period(datetime.now(), datetime.now())
inv.set_issue(datetime.now())
inv.set_ident('ABC123')
inv.set_operation_type('30')
inv.set_payment_mean(form.PaymentMean(form.PaymentMean.DEBIT, '41', datetime.now(), '1234'))
inv.set_payment_mean(form.PaymentMean(
form.PaymentMean.DEBIT, '41', datetime.now(), '1234'))
inv.set_supplier(form.Party(
name = 'facho-supplier',
ident = form.PartyIdentification('123','', '31'),
responsability_code = form.Responsability(['O-07']),
responsability_regime_code = '48',
organization_code = '1',
address = form.Address(
name='facho-supplier',
ident=form.PartyIdentification('123', '', '31'),
responsability_code = form.Responsability(['ZZ']),
responsability_regime_code='48',
organization_code='1',
address=form.Address(
'', '', form.City('05001', 'Medellín'),
form.Country('CO', 'Colombia'),
form.CountrySubentity('05', 'Antioquia'))
))
inv.set_customer(form.Party(
name = 'facho-customer',
ident = form.PartyIdentification('321', '', '31'),
responsability_code = form.Responsability(['O-07']),
responsability_regime_code = '48',
organization_code = '1',
address = form.Address(
name='facho-customer',
ident=form.PartyIdentification('321', '', '31'),
responsability_code=form.Responsability(['ZZ']),
responsability_regime_code='48',
organization_code='1',
address=form.Address(
'', '', form.City('05001', 'Medellín'),
form.Country('CO', 'Colombia'),
form.CountrySubentity('05', 'Antioquia'))
@@ -45,7 +47,7 @@ def simple_credit_note_without_lines():
inv.set_supplier(form.Party(
name = 'facho-supplier',
ident = form.PartyIdentification('123','', '31'),
responsability_code = form.Responsability(['O-07']),
responsability_code = form.Responsability(['ZZ']),
responsability_regime_code = '48',
organization_code = '1',
address = form.Address(
@@ -56,7 +58,7 @@ def simple_credit_note_without_lines():
inv.set_customer(form.Party(
name = 'facho-customer',
ident = form.PartyIdentification('321', '', '31'),
responsability_code = form.Responsability(['O-07']),
responsability_code = form.Responsability(['ZZ']),
responsability_regime_code = '48',
organization_code = '1',
address = form.Address(
@@ -77,7 +79,7 @@ def simple_invoice_without_lines():
inv.set_supplier(form.Party(
name = 'facho-supplier',
ident = form.PartyIdentification('123','', '31'),
responsability_code = form.Responsability(['O-07']),
responsability_code = form.Responsability(['ZZ']),
responsability_regime_code = '48',
organization_code = '1',
address = form.Address(
@@ -88,7 +90,7 @@ def simple_invoice_without_lines():
inv.set_customer(form.Party(
name = 'facho-customer',
ident = form.PartyIdentification('321', '', '31'),
responsability_code = form.Responsability(['O-07']),
responsability_code = form.Responsability(['ZZ']),
responsability_regime_code = '48',
organization_code = '1',
address = form.Address(
@@ -109,7 +111,7 @@ def simple_invoice():
inv.set_supplier(form.Party(
name = 'facho-supplier',
ident = form.PartyIdentification('123','', '31'),
responsability_code = form.Responsability(['O-07']),
responsability_code = form.Responsability(['ZZ']),
responsability_regime_code = '48',
organization_code = '1',
address = form.Address(
@@ -120,7 +122,7 @@ def simple_invoice():
inv.set_customer(form.Party(
name = 'facho-customer',
ident = form.PartyIdentification('321','', '31'),
responsability_code = form.Responsability(['O-07']),
responsability_code = form.Responsability(['ZZ']),
responsability_regime_code = '48',
organization_code = '1',
address = form.Address(

View File

@@ -6,42 +6,49 @@
"""Tests for `facho` package."""
import pytest
from datetime import datetime
import io
import zipfile
# from datetime import datetime
# import io
# import zipfile
import facho.fe.form as form
from facho import fe
# from facho import fe
def test_invoice_legalmonetary():
inv = form.NationalSalesInvoice()
inv.add_invoice_line(form.InvoiceLine(
quantity = form.Quantity(1, '94'),
description = 'producto facho',
item = form.StandardItem(9999),
price = form.Price(
amount = form.Amount(100.0),
type_code = '01',
type = 'x'
quantity=form.Quantity(1, '94'),
description='producto facho',
item=form.StandardItem(9999),
price=form.Price(
amount=form.Amount(100.0),
type_code='01',
type='x'
),
tax = form.TaxTotal(
subtotals = [
tax=form.TaxTotal(
subtotals=[
form.TaxSubTotal(
percent = 19.0,
)
]
percent=19.0,
)]
)
))
inv.calculate()
assert inv.invoice_legal_monetary_total.line_extension_amount == form.Amount(100.0)
assert inv.invoice_legal_monetary_total.tax_exclusive_amount == form.Amount(100.0)
assert inv.invoice_legal_monetary_total.tax_inclusive_amount == form.Amount(119.0)
assert inv.invoice_legal_monetary_total.charge_total_amount == form.Amount(0.0)
assert inv.invoice_legal_monetary_total.line_extension_amount == (
form.Amount(100.0))
assert inv.invoice_legal_monetary_total.tax_exclusive_amount == (
form.Amount(100.0))
assert inv.invoice_legal_monetary_total.tax_inclusive_amount == (
form.Amount(119.0))
assert inv.invoice_legal_monetary_total.charge_total_amount == (
form.Amount(0.0))
def test_allowancecharge_as_discount():
discount = form.AllowanceChargeAsDiscount(amount=form.Amount(1000.0))
assert discount.isDiscount() == True
def test_FAU10():
inv = form.NationalSalesInvoice()
inv.add_invoice_line(form.InvoiceLine(