form.AllowanceChargeAsDiscount nueva clase para descuentos
FossilOrigin-Name: 5b11ff93dff3a301628694c2a6e71940915aea8754a9eab3f35644bc669ddf87
This commit is contained in:
		| @@ -49,8 +49,7 @@ NAMESPACES = { | ||||
| } | ||||
|  | ||||
| def fe_from_string(document: str) -> FachoXML: | ||||
|     xml = LXMLBuilder.from_string(document) | ||||
|     return FachoXML(xml, nsmap=NAMESPACES) | ||||
|     return FeXML.from_string(document) | ||||
|  | ||||
| from contextlib import contextmanager | ||||
| @contextmanager | ||||
| @@ -69,6 +68,7 @@ def mock_xades_policy(): | ||||
|         mock.return_value = UrllibPolicyMock() | ||||
|         yield | ||||
|  | ||||
|          | ||||
| class FeXML(FachoXML): | ||||
|  | ||||
|     def __init__(self, root, namespace): | ||||
| @@ -79,6 +79,10 @@ class FeXML(FachoXML): | ||||
|         self._cn = root.rstrip('/') | ||||
|         #self.find_or_create_element(self._cn) | ||||
|  | ||||
|     @classmethod | ||||
|     def from_string(cls, document: str) -> 'FeXML': | ||||
|         return super().from_string(document, namespaces=NAMESPACES) | ||||
|      | ||||
|     def tostring(self, **kw): | ||||
|         return super().tostring(**kw)\ | ||||
|             .replace("fe:", "")\ | ||||
| @@ -360,6 +364,7 @@ class DianXMLExtensionSigner: | ||||
|         extcontent = fachoxml.builder.xpath(fachoxml.root, './ext:UBLExtensions/ext:UBLExtension[2]/ext:ExtensionContent') | ||||
|         fachoxml.append_element(extcontent, signature) | ||||
|  | ||||
|          | ||||
| class DianXMLExtensionAuthorizationProvider(FachoXMLExtension): | ||||
|     # RESOLUCION 0004: pagina 176 | ||||
|  | ||||
|   | ||||
| @@ -491,6 +491,11 @@ class AllowanceCharge: | ||||
|     def hasReason(self): | ||||
|         return self.reason is not None | ||||
|  | ||||
| class AllowanceChargeAsDiscount(AllowanceCharge): | ||||
|     def __init__(self, amount: Amount = Amount(0.0)): | ||||
|         self.charge_indicator = False | ||||
|         self.amount = amount | ||||
|  | ||||
| class NationalSalesInvoiceDocumentType(str): | ||||
|     def __str__(self): | ||||
|         # 6.1.3 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user