fix(WIP): Reemplazando OpenSsl.crypto,pkcs12
This commit is contained in:
@@ -127,39 +127,50 @@ def test_invoice_totals(simple_invoice_without_lines):
|
||||
simple_invoice.invoice_supplier.ident = '700085371'
|
||||
simple_invoice.invoice_customer.ident = '800199436'
|
||||
simple_invoice.add_invoice_line(form.InvoiceLine(
|
||||
quantity = form.Quantity(1, '94'),
|
||||
description = 'producto',
|
||||
item = form.StandardItem(9999),
|
||||
price = form.Price(form.Amount(1_500_000), '01', ''),
|
||||
tax = form.TaxTotal(
|
||||
subtotals = [
|
||||
quantity=form.Quantity(1, '94'),
|
||||
description='producto',
|
||||
item=form.StandardItem(9999),
|
||||
price=form.Price(form.Amount(1_500_000), '01', ''),
|
||||
tax=form.TaxTotal(
|
||||
subtotals=[
|
||||
form.TaxSubTotal(
|
||||
scheme = form.TaxScheme('01'),
|
||||
percent = 19.0
|
||||
)])
|
||||
scheme=form.TaxScheme('01'),
|
||||
percent=19.0
|
||||
)]),
|
||||
withholding=form.WithholdingTaxTotal(
|
||||
subtotals=[])
|
||||
))
|
||||
simple_invoice.calculate()
|
||||
assert 1 == len(simple_invoice.invoice_lines)
|
||||
assert form.Amount(1_500_000) == simple_invoice.invoice_legal_monetary_total.line_extension_amount
|
||||
assert form.Amount(1_785_000) == simple_invoice.invoice_legal_monetary_total.payable_amount
|
||||
assert form.Amount(1_500_000) == (
|
||||
simple_invoice.invoice_legal_monetary_total.line_extension_amount)
|
||||
assert form.Amount(1_785_000) == (
|
||||
simple_invoice.invoice_legal_monetary_total.payable_amount)
|
||||
|
||||
|
||||
def test_invoice_cufe(simple_invoice_without_lines):
|
||||
simple_invoice = simple_invoice_without_lines
|
||||
simple_invoice.invoice_ident = '323200000129'
|
||||
simple_invoice.invoice_issue = datetime.strptime('2019-01-16 10:53:10-05:00', '%Y-%m-%d %H:%M:%S%z')
|
||||
simple_invoice.invoice_supplier.ident = form.PartyIdentification('700085371', '5', '31')
|
||||
simple_invoice.invoice_customer.ident = form.PartyIdentification('800199436', '5', '31')
|
||||
simple_invoice.invoice_issue = datetime.strptime(
|
||||
'2019-01-16 10:53:10-05:00', '%Y-%m-%d %H:%M:%S%z')
|
||||
simple_invoice.invoice_supplier.ident = form.PartyIdentification(
|
||||
'700085371', '5', '31')
|
||||
simple_invoice.invoice_customer.ident = form.PartyIdentification(
|
||||
'800199436', '5', '31')
|
||||
simple_invoice.add_invoice_line(form.InvoiceLine(
|
||||
quantity = form.Quantity(1.00, '94'),
|
||||
description = 'producto',
|
||||
item = form.StandardItem(111),
|
||||
price = form.Price(form.Amount(1_500_000), '01', ''),
|
||||
tax = form.TaxTotal(
|
||||
subtotals = [
|
||||
quantity=form.Quantity(
|
||||
1.00, '94'),
|
||||
description='producto',
|
||||
item=form.StandardItem(111),
|
||||
price=form.Price(form.Amount(1_500_000), '01', ''),
|
||||
tax=form.TaxTotal(
|
||||
subtotals=[
|
||||
form.TaxSubTotal(
|
||||
scheme = form.TaxScheme('01'),
|
||||
percent = 19.0
|
||||
)])
|
||||
scheme=form.TaxScheme('01'),
|
||||
percent=19.0
|
||||
)]),
|
||||
withholding=form.WithholdingTaxTotal(
|
||||
subtotals=[])
|
||||
))
|
||||
|
||||
simple_invoice.calculate()
|
||||
@@ -167,39 +178,54 @@ def test_invoice_cufe(simple_invoice_without_lines):
|
||||
|
||||
cufe_extension = fe.DianXMLExtensionCUFE(
|
||||
simple_invoice,
|
||||
tipo_ambiente = fe.AMBIENTE_PRODUCCION,
|
||||
clave_tecnica = '693ff6f2a553c3646a063436fd4dd9ded0311471'
|
||||
tipo_ambiente=fe.AMBIENTE_PRODUCCION,
|
||||
clave_tecnica='693ff6f2a553c3646a063436fd4dd9ded0311471'
|
||||
)
|
||||
formatVars = cufe_extension.formatVars()
|
||||
#NumFac
|
||||
|
||||
# NumFac
|
||||
assert formatVars[0] == '323200000129', "NumFac"
|
||||
#FecFac
|
||||
|
||||
# FecFac
|
||||
assert formatVars[1] == '2019-01-16', "FecFac"
|
||||
#HoraFac
|
||||
|
||||
# HoraFac
|
||||
assert formatVars[2] == '10:53:10-05:00', "HoraFac"
|
||||
#ValorBruto
|
||||
|
||||
# ValorBruto
|
||||
assert formatVars[3] == '1500000.00', "ValorBruto"
|
||||
#CodImpuesto1
|
||||
|
||||
# CodImpuesto1
|
||||
assert formatVars[4] == '01', "CodImpuesto1"
|
||||
#ValorImpuesto1
|
||||
|
||||
# ValorImpuesto1
|
||||
assert formatVars[5] == '285000.00', "ValorImpuesto1"
|
||||
#CodImpuesto2
|
||||
|
||||
# CodImpuesto2
|
||||
assert formatVars[6] == '04', "CodImpuesto2"
|
||||
#ValorImpuesto2
|
||||
|
||||
# ValorImpuesto2
|
||||
assert formatVars[7] == '0.00', "ValorImpuesto2"
|
||||
#CodImpuesto3
|
||||
|
||||
# CodImpuesto3
|
||||
assert formatVars[8] == '03', "CodImpuesto3"
|
||||
#ValorImpuesto3
|
||||
|
||||
# ValorImpuesto3
|
||||
assert formatVars[9] == '0.00', "ValorImpuesto3"
|
||||
#ValTotFac
|
||||
|
||||
# ValTotFac
|
||||
assert formatVars[10] == '1785000.00', "ValTotFac"
|
||||
#NitOFE
|
||||
|
||||
# NitOFE
|
||||
assert formatVars[11] == '700085371', "NitOFE"
|
||||
#NumAdq
|
||||
|
||||
# NumAdq
|
||||
assert formatVars[12] == '800199436', "NumAdq"
|
||||
#ClTec
|
||||
|
||||
# ClTec
|
||||
assert formatVars[13] == '693ff6f2a553c3646a063436fd4dd9ded0311471', "ClTec"
|
||||
#TipoAmbiente
|
||||
|
||||
# TipoAmbiente
|
||||
assert formatVars[14] == '1', "TipoAmbiente"
|
||||
|
||||
xml_invoice.add_extension(cufe_extension)
|
||||
@@ -229,7 +255,9 @@ def test_credit_note_cude(simple_credit_note_without_lines):
|
||||
form.TaxSubTotal(
|
||||
scheme=form.TaxScheme('01'),
|
||||
percent=19.0
|
||||
)])
|
||||
)]),
|
||||
withholding=form.WithholdingTaxTotal(
|
||||
subtotals=[])
|
||||
))
|
||||
|
||||
simple_invoice.calculate()
|
||||
|
||||
@@ -62,6 +62,8 @@ def test_allowance_charge_in_invoice(simple_invoice_without_lines):
|
||||
form.TaxSubTotal(
|
||||
percent=19.0,
|
||||
)]),
|
||||
withholding=form.WithholdingTaxTotal(
|
||||
subtotals=[])
|
||||
))
|
||||
|
||||
inv.add_allowance_charge(form.AllowanceCharge(amount=form.Amount(19.0)))
|
||||
@@ -92,8 +94,9 @@ def test_allowance_charge_in_invoice_line(simple_invoice_without_lines):
|
||||
subtotals=[
|
||||
form.TaxSubTotal(
|
||||
percent=19.0,
|
||||
)]
|
||||
),
|
||||
)]),
|
||||
withholding=form.WithholdingTaxTotal(
|
||||
subtotals=[]),
|
||||
allowance_charge=[
|
||||
form.AllowanceChargeAsDiscount(amount=form.Amount(10.0))
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user