support document updates DSAZ13 DSAZ14
FossilOrigin-Name: 18a1849b96425974b7e53bc236a9484e7c064e960b90844675eb4fe02cf6ad8a
This commit is contained in:
		| @@ -259,14 +259,14 @@ def generate_invoice(private_key, passphrase, scriptname, generate=False, ssl=Tr | |||||||
|     spec.loader.exec_module(module) |     spec.loader.exec_module(module) | ||||||
|  |  | ||||||
|     import facho.fe.form as form |     import facho.fe.form as form | ||||||
|     from facho.fe.form_xml import DIANInvoiceXML, DIANWriteSigned,DIANWrite |     from facho.fe.form_xml import DIANInvoiceXML, DIANWriteSigned, DIANWrite, DIANSupportDocumentXML | ||||||
|     from facho import fe |     from facho import fe | ||||||
|  |  | ||||||
|     try: |     try: | ||||||
|         invoice_xml = module.document_xml() |         invoice_xml = module.document_xml() | ||||||
|     except AttributeError: |     except AttributeError: | ||||||
|         invoice_xml = DIANInvoiceXML |         #invoice_xml = DIANInvoiceXML | ||||||
|  |         invoice_xml = DIANSupportDocumentXML  | ||||||
|     print("Using document xml:", invoice_xml) |     print("Using document xml:", invoice_xml) | ||||||
|     invoice = module.invoice() |     invoice = module.invoice() | ||||||
|     invoice.calculate() |     invoice.calculate() | ||||||
|   | |||||||
| @@ -163,10 +163,10 @@ class Item: | |||||||
|  |  | ||||||
|  |  | ||||||
| class StandardItem(Item): | class StandardItem(Item): | ||||||
|     def __init__(self, id_: str, description: str = ''): |     def __init__(self, id_: str, description: str = '', name: str = ''): | ||||||
|         super().__init__(id=id_, |         super().__init__(id=id_, | ||||||
|                          description=description, |                          description=description, | ||||||
|                          scheme_name='', |                          scheme_name=name, | ||||||
|                          scheme_id='999', |                          scheme_id='999', | ||||||
|                          scheme_agency_id='') |                          scheme_agency_id='') | ||||||
|  |  | ||||||
|   | |||||||
| @@ -3,9 +3,9 @@ from ..form import * | |||||||
| from datetime import datetime, date | from datetime import datetime, date | ||||||
| from .attached_document import * | from .attached_document import * | ||||||
|  |  | ||||||
| __all__ = ['DIANInvoiceSupportDocumentXML'] | __all__ = ['DIANSupportDocumentXML'] | ||||||
|  |  | ||||||
| class DIANInvoiceSupportDocumentXML(fe.FeXML): | class DIANSupportDocumentXML(fe.FeXML): | ||||||
|     """ |     """ | ||||||
|     DianSupportDocumentXML mapea objeto form.Invoice a XML segun |     DianSupportDocumentXML mapea objeto form.Invoice a XML segun | ||||||
|     lo indicado para él Documento soporte en adquisiciones efectuadas con sujetos no obligados a expedir factura de venta o documento equivalente. |     lo indicado para él Documento soporte en adquisiciones efectuadas con sujetos no obligados a expedir factura de venta o documento equivalente. | ||||||
| @@ -293,25 +293,25 @@ class DIANInvoiceSupportDocumentXML(fe.FeXML): | |||||||
|         if isinstance(reference, InvoiceDocumentReference): |         if isinstance(reference, InvoiceDocumentReference): | ||||||
|             return fexml._set_invoice_document_reference(reference) |             return fexml._set_invoice_document_reference(reference) | ||||||
|  |  | ||||||
|     def set_discrepancy_response(fexml, invoice): |    # def set_discrepancy_response(fexml, invoice): | ||||||
|         reference = invoice.invoice_discrepancy_response |    #     reference = invoice.invoice_discrepancy_response | ||||||
|         if reference is None: |    #     if reference is None: | ||||||
|             return |    #        return | ||||||
|  |  | ||||||
|         if isinstance(reference, DebitNoteDocumentReference): |         # if isinstance(reference, DebitNoteDocumentReference): | ||||||
|             return fexml._set_debit_note_document_reference(reference) |         #     return fexml._set_debit_note_document_reference(reference) | ||||||
|         if isinstance(reference, CreditNoteDocumentReference): |         # if isinstance(reference, CreditNoteDocumentReference): | ||||||
|             return fexml._set_credit_note_document_reference(reference) |         #     return fexml._set_credit_note_document_reference(reference) | ||||||
|  |  | ||||||
|         if isinstance(reference, InvoiceDocumentReference): |         # if isinstance(reference, InvoiceDocumentReference): | ||||||
|             return fexml._set_invoice_document_reference(reference) |         #     return fexml._set_invoice_document_reference(reference) | ||||||
|  |  | ||||||
|         fexml.set_element('./cac:DiscrepancyResponse/cbc:ReferenceID', |         # fexml.set_element('./cac:DiscrepancyResponse/cbc:ReferenceID', | ||||||
|                           reference.ident) |         #                   reference.ident) | ||||||
|         fexml.set_element('./cac:DiscrepancyResponse/cbc:ResponseCode:UUID', |         # fexml.set_element('./cac:DiscrepancyResponse/cbc:ResponseCode:UUID', | ||||||
|                           '1') |         #                   '1') | ||||||
|         fexml.set_element('./cac:DiscrepancyResponse/cbc:Description', |         # fexml.set_element('./cac:DiscrepancyResponse/cbc:Description', | ||||||
|                           'Test')         |         #                   'Test')         | ||||||
|  |  | ||||||
|     def set_invoice_totals(fexml, invoice): |     def set_invoice_totals(fexml, invoice): | ||||||
|         tax_amount_for = defaultdict(lambda: defaultdict(lambda: Amount(0.0))) |         tax_amount_for = defaultdict(lambda: defaultdict(lambda: Amount(0.0))) | ||||||
| @@ -496,10 +496,8 @@ class DIANInvoiceSupportDocumentXML(fe.FeXML): | |||||||
|         fexml.set_invoice_lines(invoice) |         fexml.set_invoice_lines(invoice) | ||||||
|         fexml.set_payment_mean(invoice) |         fexml.set_payment_mean(invoice) | ||||||
|         fexml.set_allowance_charge(invoice) |         fexml.set_allowance_charge(invoice) | ||||||
|         fexml.set_discrepancy_response(invoice)         |         #fexml.set_discrepancy_response(invoice)         | ||||||
|         fexml.set_billing_reference(invoice) |         fexml.set_billing_reference(invoice) | ||||||
|         cosa = AttachedDocument(id=1, xml=fexml) |  | ||||||
|         print(cosa.toFachoXML()) |  | ||||||
|       |       | ||||||
|         return fexml |         return fexml | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user