minor fix

This commit is contained in:
Elvis 2023-11-10 11:49:49 -05:00
parent 8c18ebc221
commit e9f99e722e
1 changed files with 4 additions and 4 deletions

View File

@ -118,12 +118,10 @@ class SupplierCertificate(Workflow, ModelSQL, ModelView):
@ModelView.button
def create_certificate(cls, certificates):
for record in certificates:
date_exp = record.start_date + timedelta(days=6)
date_exp = record.start_date + timedelta(days=180)
flimexp = date_exp.strftime("%Y-%m-%d")
root = etree.Element("mas", nsmap={"xsi": "http://www.w3.org/2001/XMLSchema-instance"})
root.set("{http://www.w3.org/2001/XMLSchema-instance}noNamespaceSchemaLocation", "../xsd/640.xsd")
cantreg = etree.SubElement(root, "CantReg")
cantreg.text = str(len(record.invoice_lines))
cab = etree.SubElement(root, "Cab")
elements_to_add = {
"Ano": str(record.start_date.year),
@ -166,7 +164,7 @@ class SupplierCertificate(Workflow, ModelSQL, ModelView):
'desc': line.product.description if line.product.description else line.product.name,
'cunfi': f"{line.quantity:.6f}",
'unfi': harmonized_tariff_schedule.uom.symbol,
'cunco': line.unit.symbol,
'cunco': f"{line.quantity:.6f}",
'unco': 'NAR',
'vuni': line.unit_price,
'amount': round(float(line.unit_price) * line.quantity, 6),
@ -203,6 +201,8 @@ class SupplierCertificate(Workflow, ModelSQL, ModelView):
cphoja2.set("subp", line['subp'])
cphoja2.set("desc", line['desc'])
cphoja2.set("cunfi", line['cunfi'])
cphoja2.set("unfi", line['unfi'])
cphoja2.set("cunco", line['cunco'])
cphoja2.set("unco", 'NAR')
cphoja2.set("vuni", f"{line['vuni']:.6f}")
cphoja2.set("vtotal", f"{line['amount']:.6f}")