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:
1 parent
15e3b5079c
commit
c5210c8a57
1 file changed
+3
-4
+3
-4
@@ -774,12 +774,12 @@ def _procesar_un_correo(email: dict, token: str, email_addr: str, download_folde
|
||||
monto_detraccion = math.ceil(monto_detraccion)
|
||||
neto = total - monto_detraccion
|
||||
installments = [
|
||||
{"DueDate": fecha_emision, "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": monto_detraccion, "InstallmentId": 1, "U_VS_TIPOCUOTA": "D", "U_VS_TIPOSERVICIO": f"{codigo_detraccion}02"},
|
||||
{"DueDate": fecha_vencimiento, "Total": round(neto,2), "InstallmentId": 2, "U_VS_TIPOCUOTA": "N", "U_VS_TIPOSERVICIO": ""},
|
||||
]
|
||||
else:
|
||||
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 = []
|
||||
@@ -800,7 +800,6 @@ def _procesar_un_correo(email: dict, token: str, email_addr: str, download_folde
|
||||
|
||||
doc_lines.append({
|
||||
"ItemCode": item_code,
|
||||
#"ItemDescription": linea.get("descripcion", "TRANSPORTE DE CARGA MERCADERIA")[:200],
|
||||
"Quantity": qty,
|
||||
"PriceAfterVAT": lt_val,
|
||||
"WarehouseCode": item.get("warehouse_code", "A-CENTRA"),
|
||||
|
||||
Reference in new issue
Block a user