Skip to content

Commit ac15a33

Browse files
committed
ejemplo de facturas con precios dinamicos
1 parent 738a804 commit ac15a33

File tree

1 file changed

+75
-0
lines changed

1 file changed

+75
-0
lines changed

examples.py

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ def main ():
1616

1717
client = FiscalApiClient(settings=settings)
1818

19+
20+
1921

2022
# listar api-keys
2123
# api_response = client.api_keys.get_list(1, 10)
@@ -430,6 +432,38 @@ def main ():
430432
# api_response = client.invoices.create(invoice)
431433
# print(api_response)
432434

435+
436+
#Crear factura de ingreso por referencias precios dinamicos
437+
# invoice = Invoice(
438+
# version_code="4.0",
439+
# series="F",
440+
# date=datetime.now().strftime("%Y-%m-%dT%H:%M:%S"), #YYYY-MM-DDThh:mm:ss
441+
# payment_form_code="01",
442+
# payment_conditions="Contado",
443+
# currency_code="MXN",
444+
# type_code="I",
445+
# expedition_zip_code="42501",
446+
# payment_method_code="PUE",
447+
# exchange_rate=1,
448+
# export_code="01",
449+
# issuer=InvoiceIssuer(
450+
# id="78d380fd-1b69-4e3c-8bc0-4f57737f7d5f"
451+
# ),
452+
# recipient=InvoiceRecipient(
453+
# id="bef56254-0892-4558-95c3-f9c8729e4b0e"
454+
# ),
455+
# items=[
456+
# InvoiceItem(
457+
# id="2c6aafcf-8cd2-4fb1-94a8-687adc671380",
458+
# quantity=Decimal("1.5"),
459+
# unit_price=Decimal("100.85"), #Sobre escribe el precio del producto
460+
# discount=Decimal("5.85")
461+
# )
462+
# ]
463+
# )
464+
465+
# api_response = client.invoices.create(invoice)
466+
# print(api_response)
433467

434468

435469
# Crear factura global por valores.
@@ -768,6 +802,43 @@ def main ():
768802
# api_response = client.invoices.create(credit_note)
769803
# print(api_response)
770804

805+
# Crear nota de credito (factura de egreso) con precios dinamicos
806+
# credit_note = Invoice(
807+
# version_code="4.0",
808+
# series="CN",
809+
# date=datetime.now().strftime("%Y-%m-%dT%H:%M:%S"), #YYYY-MM-DDThh:mm:ss
810+
# payment_form_code="03",
811+
# payment_conditions="Contado",
812+
# currency_code="MXN",
813+
# type_code="E",
814+
# expedition_zip_code="01160",
815+
# payment_method_code="PUE",
816+
# exchange_rate=1,
817+
# export_code="01",
818+
# issuer=InvoiceIssuer(
819+
# id="3f3478b4-60fd-459e-8bfc-f8239fc96257"
820+
# ),
821+
# recipient=InvoiceRecipient(
822+
# id="96b46762-d246-4a67-a562-510a25dbafa9"
823+
# ),
824+
# related_invoices=[
825+
# RelatedInvoice(
826+
# uuid="5FB2822E-396D-4725-8521-CDC4BDD20CCF",
827+
# relationship_type_code="01"
828+
# )
829+
# ],
830+
# items=[
831+
# InvoiceItem(
832+
# id="114a4be5-fb65-40b2-a762-ff0c55c6ebfa",
833+
# quantity=Decimal("0.5"),
834+
# unit_price=Decimal("10.00"),
835+
# )
836+
# ]
837+
# )
838+
839+
# api_response = client.invoices.create(credit_note)
840+
# print(api_response)
841+
771842

772843
# Crear complemento pago (factura de pago) por valores (cURL).
773844

@@ -1273,5 +1344,9 @@ def main ():
12731344
# print(api_response)
12741345

12751346

1347+
if __name__ == "__main__":
1348+
main()
1349+
1350+
12761351
if __name__ == "__main__":
12771352
main()

0 commit comments

Comments
 (0)