se usa fecha_vencimiento en DueDate de las cuotas del draft

Las cuotas (DocumentInstallments) ahora usan la misma fecha_vencimiento
calculada para DocDueDate, en vez de fecha_emision del XML.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
georgeandClaude Sonnet 5 committed 2026-09-19 09:32:11 -05:00
1 parent 15e3b5079c
commit c5210c8a57
1 file changed
+3 -4
+3 -4
View File
@@ -774,12 +774,12 @@ def _procesar_un_correo(email: dict, token: str, email_addr: str, download_folde
monto_detraccion = math.ceil(monto_detraccion) monto_detraccion = math.ceil(monto_detraccion)
neto = total - monto_detraccion neto = total - monto_detraccion
installments = [ installments = [
{"DueDate": fecha_emision, "Total": monto_detraccion, "InstallmentId": 1, "U_VS_TIPOCUOTA": "D", "U_VS_TIPOSERVICIO": f"{codigo_detraccion}02"}, {"DueDate": fecha_vencimiento, "Total": monto_detraccion, "InstallmentId": 1, "U_VS_TIPOCUOTA": "D", "U_VS_TIPOSERVICIO": f"{codigo_detraccion}02"},
{"DueDate": fecha_emision, "Total": round(neto,2), "InstallmentId": 2, "U_VS_TIPOCUOTA": "N", "U_VS_TIPOSERVICIO": ""}, {"DueDate": fecha_vencimiento, "Total": round(neto,2), "InstallmentId": 2, "U_VS_TIPOCUOTA": "N", "U_VS_TIPOSERVICIO": ""},
] ]
else: else:
installments = [ installments = [
{"DueDate": fecha_emision, "Total": round(total, 2), "InstallmentId": 1, "U_VS_TIPOCUOTA": "N", "U_VS_TIPOSERVICIO": ""}, {"DueDate": fecha_vencimiento, "Total": round(total, 2), "InstallmentId": 1, "U_VS_TIPOCUOTA": "N", "U_VS_TIPOSERVICIO": ""},
] ]
doc_lines = [] doc_lines = []
@@ -800,7 +800,6 @@ def _procesar_un_correo(email: dict, token: str, email_addr: str, download_folde
doc_lines.append({ doc_lines.append({
"ItemCode": item_code, "ItemCode": item_code,
#"ItemDescription": linea.get("descripcion", "TRANSPORTE DE CARGA MERCADERIA")[:200],
"Quantity": qty, "Quantity": qty,
"PriceAfterVAT": lt_val, "PriceAfterVAT": lt_val,
"WarehouseCode": item.get("warehouse_code", "A-CENTRA"), "WarehouseCode": item.get("warehouse_code", "A-CENTRA"),