Compare commits
2 Commits
80e88e98a0
...
666c36e6f6
| Author | SHA1 | Date | |
|---|---|---|---|
| 666c36e6f6 | |||
| 3ecf1be181 |
@ -105,7 +105,7 @@ def normalize_header_invoice_fields(fd: Dict[str, Any]) -> Dict[str, Any]:
|
|||||||
"operation_date": str(fd['FECHA_FACTURA']),
|
"operation_date": str(fd['FECHA_FACTURA']),
|
||||||
"description": textwrap.shorten(
|
"description": textwrap.shorten(
|
||||||
f"{str(fd['REFERENCIA'])} - {str(fd.get('NOMBRE')) or ''}", width=50, placeholder="…"),
|
f"{str(fd['REFERENCIA'])} - {str(fd.get('NOMBRE')) or ''}", width=50, placeholder="…"),
|
||||||
"notes": str(fd["OBSERVACIONES"]),
|
"notes": fd["OBSERVACIONES"],
|
||||||
# siempre tendrán 2 decimales
|
# siempre tendrán 2 decimales
|
||||||
'subtotal_amount_value': cents(fd.get('IMPORTE_NETO')),
|
'subtotal_amount_value': cents(fd.get('IMPORTE_NETO')),
|
||||||
'discount_amount_value': cents(fd.get('IMPORTE_DESCUENTO')),
|
'discount_amount_value': cents(fd.get('IMPORTE_DESCUENTO')),
|
||||||
|
|||||||
@ -40,7 +40,7 @@ INSERT_INVOICE = (
|
|||||||
"SELECT "
|
"SELECT "
|
||||||
"%s AS id, "
|
"%s AS id, "
|
||||||
"%s AS company_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 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 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, "
|
"%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, "
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user