Fix #60 se extendiente tipo de operacion a otros documentos.
FossilOrigin-Name: 299c70b2dc438aa24b00bdd015144404be425b6bb0afecf8d31ba68d48928e78
This commit is contained in:
		| @@ -89,6 +89,8 @@ TipoImpuesto = CodeList(path_for_codelist('TipoImpuesto-2.1.gc'), 'code', 'name' | ||||
| CodigoPrecioReferencia = CodeList(path_for_codelist('CodigoPrecioReferencia-2.1.gc'), 'code', 'name') | ||||
| MediosPago = CodeList(path_for_codelist('MediosPago-2.1.gc'), 'code', 'name') | ||||
| RegimenFiscal = CodeList(path_for_codelist('RegimenFiscal-2.1.custom.gc'), 'code', 'name') | ||||
| TipoOperacionNC = CodeList(path_for_codelist('TipoOperacionNC-2.1.gc'), 'code', 'name') | ||||
| TipoOperacionND = CodeList(path_for_codelist('TipoOperacionND-2.1 - copia.gc'), 'code', 'name') | ||||
| TipoOperacionF = CodeList(path_for_codelist('TipoOperacionF-2.1.gc'), 'code', 'name')\ | ||||
|     .update(CodeList(path_for_codelist('TipoOperacionF-2.1.custom.gc'), 'code', 'name')) | ||||
| Municipio = CodeList(path_for_codelist('Municipio-2.1.gc'), 'code', 'name') | ||||
|   | ||||
| @@ -436,8 +436,11 @@ class Invoice: | ||||
|     def set_payment_mean(self, payment_mean: PaymentMean): | ||||
|         self.invoice_payment_mean = payment_mean | ||||
|  | ||||
|     def _get_codelist_tipo_operacion(self): | ||||
|         return codelist.TipoOperacionF | ||||
|      | ||||
|     def set_operation_type(self, operation): | ||||
|         if operation not in codelist.TipoOperacionF: | ||||
|         if operation not in self._get_codelist_tipo_operacion(): | ||||
|             raise ValueError("operation not found") | ||||
|  | ||||
|         self.invoice_operation_type = operation | ||||
| @@ -514,6 +517,9 @@ class CreditNote(Invoice): | ||||
|             raise TypeError('invoice_document_reference invalid type') | ||||
|         self.invoice_billing_reference = invoice_document_reference | ||||
|  | ||||
|     def _get_codelist_tipo_operacion(self): | ||||
|         return codelist.TipoOperacionNC | ||||
|      | ||||
|  | ||||
| class DebitNote(Invoice): | ||||
|     def __init__(self, invoice_document_reference: BillingReference): | ||||
| @@ -522,3 +528,6 @@ class DebitNote(Invoice): | ||||
|         if not isinstance(invoice_document_reference, BillingReference): | ||||
|             raise TypeError('invoice_document_reference invalid type') | ||||
|         self.invoice_billing_reference = invoice_document_reference | ||||
|  | ||||
|     def _get_codelist_tipo_operacion(self): | ||||
|         return codelist.TipoOperacionND | ||||
|   | ||||
		Reference in New Issue
	
	Block a user