facho/fe/form.py(AllowanceChargeReason): nueva clase.

FossilOrigin-Name: 881f04165931e442524f575efcbf25c2b8a03a0e55f1bba757d9fe590fa34c85
This commit is contained in:
bit4bit@riseup.net 2020-10-31 02:29:20 +00:00
parent ee1052ce78
commit b024533934
2 changed files with 15 additions and 0 deletions

View File

@ -95,3 +95,4 @@ Municipio = CodeList(path_for_codelist('Municipio-2.1.gc'), 'code', 'name')
Departamento = CodeList(path_for_codelist('Departamentos-2.1.gc'), 'code', 'name')
Paises = CodeList(path_for_codelist('Paises-2.1.gc'), 'code', 'name')
TipoIdFiscal = CodeList(path_for_codelist('TipoIdFiscal-2.1.gc'), 'code', 'name')
CodigoDescuento = CodeList(path_for_codelist('CodigoDescuento-2.1.gc'), 'code', 'name')

View File

@ -344,11 +344,23 @@ class LegalMonetaryTotal:
payable_amount: Amount = Amount(0.0)
prepaid_amount: Amount = Amount(0.0)
@dataclass
class AllowanceChargeReason:
code: str
reason: str
def __post_init__(self):
if self.code not in codelist.CodigoDescuento:
raise ValueError("code [%s] not found" % (self.code))
@dataclass
class AllowanceCharge:
#DIAN 1.7.-2020: FAQ03
charge_indicator: bool = True
amount: Amount = Amount(0.0)
reason: AllowanceChargeReason = None
def isCharge(self):
return self.charge_indicator == True
@ -362,6 +374,8 @@ class AllowanceCharge:
def asDiscount(self):
self.charge_indicator = False
def hasReason(self):
return self.reason is not None
class NationalSalesInvoiceDocumentType(str):
def __str__(self):