Update SQL queries to use proformas and increment version to 0.3.0
This commit is contained in:
parent
615b309718
commit
f40f58c035
@ -2,9 +2,9 @@
|
||||
# MYSQL (constantes)
|
||||
# =========================
|
||||
|
||||
SELECT_INVOICES_DELETED = (
|
||||
SELECT_PROFORMAS_DELETED = (
|
||||
"SELECT ci.id "
|
||||
"FROM customer_invoices as ci "
|
||||
"FROM proformas as ci "
|
||||
"WHERE "
|
||||
"(ci.deleted_at is not null) "
|
||||
)
|
||||
@ -179,13 +179,13 @@ LIMPIAR_FACTUGES_LINK = (
|
||||
|
||||
# OPCION A SACAMOS EL RESUMEN DE LA TAXES DE LA CABECERA
|
||||
consulta_sql_customer_invoices_issue = (
|
||||
"SELECT ci.id, ci.series, ci.invoice_number, ci.invoice_date, ci.description, ci.customer_tin, ci.customer_name, ci.total_amount_value, ci.total_amount_scale, ci.reference, "
|
||||
"SELECT ci.id, ci.invoice_series_code as series, ci.invoice_number, ci.invoice_date, ci.description, ci.customer_tin, ci.customer_name, ci.total_amount_value, ci.total_amount_scale, ci.reference, "
|
||||
"cit.taxable_amount_scale, cit.taxes_amount_scale, cit.iva_code, cit.taxable_amount_value, cit.taxes_amount_value, "
|
||||
"vr.id as vrId, vr.uuid, vr.estado "
|
||||
"FROM customer_invoices as ci "
|
||||
"LEFT JOIN customer_invoice_taxes cit on (ci.id = cit.invoice_id) "
|
||||
"LEFT JOIN verifactu_records vr on (ci.id = vr.invoice_id) "
|
||||
"WHERE (ci.is_proforma = 0) AND (ci.status= 'issued') "
|
||||
"FROM issued_invoices as ci "
|
||||
"LEFT JOIN issued_invoice_taxes cit on (ci.id = cit.issued_invoice_id) "
|
||||
"LEFT JOIN verifactu_records vr on (ci.id = vr.issued_invoice_id) "
|
||||
"WHERE (ci.status= 'issued') "
|
||||
"AND (company_id = %s) "
|
||||
"AND (vr.estado <> 'Correcto') "
|
||||
"order by reference"
|
||||
@ -206,7 +206,7 @@ update_verifactu_records_with_invoiceId = ("UPDATE verifactu_records "
|
||||
"url = %s, "
|
||||
"qr = %s, "
|
||||
"updated_at = CURRENT_TIMESTAMP "
|
||||
"WHERE invoice_id = %s"
|
||||
"WHERE issued_invoice_id = %s"
|
||||
)
|
||||
|
||||
update_verifactu_records_with_uuid = ("UPDATE verifactu_records "
|
||||
|
||||
@ -13,7 +13,7 @@ def sync_invoices_deleted_factuges(conn_factuges, conn_mysql, last_execution_dat
|
||||
cursor_mysql = None
|
||||
try:
|
||||
cursor_mysql = conn_mysql.cursor()
|
||||
cursor_mysql.execute(SQL.SELECT_INVOICES_DELETED)
|
||||
cursor_mysql.execute(SQL.SELECT_PROFORMAS_DELETED)
|
||||
filas = cursor_mysql.fetchall()
|
||||
cursor_mysql.close()
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user