Compare commits

...

2 Commits

2 changed files with 2 additions and 2 deletions

View File

@ -105,7 +105,7 @@ def normalize_header_invoice_fields(fd: Dict[str, Any]) -> Dict[str, Any]:
"operation_date": str(fd['FECHA_FACTURA']),
"description": textwrap.shorten(
f"{str(fd['REFERENCIA'])} - {str(fd.get('NOMBRE')) or ''}", width=50, placeholder=""),
"notes": str(fd["OBSERVACIONES"]),
"notes": fd["OBSERVACIONES"],
# siempre tendrán 2 decimales
'subtotal_amount_value': cents(fd.get('IMPORTE_NETO')),
'discount_amount_value': cents(fd.get('IMPORTE_DESCUENTO')),

View File

@ -40,7 +40,7 @@ INSERT_INVOICE = (
"SELECT "
"%s AS id, "
"%s AS company_id, "
"COALESCE(MAX(invoice_number + 0),0)+1 AS invoice_number, "
"LPAD((COALESCE(MAX(invoice_number), 0) + 1), 3, '0') AS invoice_number,"
"%s AS status, %s AS is_proforma, %s AS series, %s AS reference, %s AS invoice_date, %s AS operation_date, %s AS description, %s AS notes, "
"%s AS subtotal_amount_value, %s AS discount_amount_value, %s AS discount_percentage_value, %s AS taxable_amount_value, %s AS taxes_amount_value, %s AS total_amount_value, "
"%s AS customer_id, %s AS customer_tin, %s AS customer_name, %s AS customer_street, %s AS customer_city, %s AS customer_province, %s AS customer_postal_code, %s AS customer_country, "