minor fix
This commit is contained in:
parent
8c18ebc221
commit
e9f99e722e
|
@ -118,12 +118,10 @@ class SupplierCertificate(Workflow, ModelSQL, ModelView):
|
||||||
@ModelView.button
|
@ModelView.button
|
||||||
def create_certificate(cls, certificates):
|
def create_certificate(cls, certificates):
|
||||||
for record in 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")
|
flimexp = date_exp.strftime("%Y-%m-%d")
|
||||||
root = etree.Element("mas", nsmap={"xsi": "http://www.w3.org/2001/XMLSchema-instance"})
|
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")
|
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")
|
cab = etree.SubElement(root, "Cab")
|
||||||
elements_to_add = {
|
elements_to_add = {
|
||||||
"Ano": str(record.start_date.year),
|
"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,
|
'desc': line.product.description if line.product.description else line.product.name,
|
||||||
'cunfi': f"{line.quantity:.6f}",
|
'cunfi': f"{line.quantity:.6f}",
|
||||||
'unfi': harmonized_tariff_schedule.uom.symbol,
|
'unfi': harmonized_tariff_schedule.uom.symbol,
|
||||||
'cunco': line.unit.symbol,
|
'cunco': f"{line.quantity:.6f}",
|
||||||
'unco': 'NAR',
|
'unco': 'NAR',
|
||||||
'vuni': line.unit_price,
|
'vuni': line.unit_price,
|
||||||
'amount': round(float(line.unit_price) * line.quantity, 6),
|
'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("subp", line['subp'])
|
||||||
cphoja2.set("desc", line['desc'])
|
cphoja2.set("desc", line['desc'])
|
||||||
cphoja2.set("cunfi", line['cunfi'])
|
cphoja2.set("cunfi", line['cunfi'])
|
||||||
|
cphoja2.set("unfi", line['unfi'])
|
||||||
|
cphoja2.set("cunco", line['cunco'])
|
||||||
cphoja2.set("unco", 'NAR')
|
cphoja2.set("unco", 'NAR')
|
||||||
cphoja2.set("vuni", f"{line['vuni']:.6f}")
|
cphoja2.set("vuni", f"{line['vuni']:.6f}")
|
||||||
cphoja2.set("vtotal", f"{line['amount']:.6f}")
|
cphoja2.set("vtotal", f"{line['amount']:.6f}")
|
||||||
|
|
Loading…
Reference in New Issue