updated correct label and collumns in te database for label
This commit is contained in:
@@ -34,7 +34,7 @@ def get_unprinted_orders_data(limit=100):
|
||||
# Use printed_labels column
|
||||
cursor.execute("""
|
||||
SELECT id, comanda_productie, cod_articol, descr_com_prod, cantitate,
|
||||
com_achiz_client, nr_linie_com_client, customer_name,
|
||||
data_livrare, dimensiune, com_achiz_client, nr_linie_com_client, customer_name,
|
||||
customer_article_number, open_for_order, line_number,
|
||||
printed_labels, created_at, updated_at
|
||||
FROM order_for_labels
|
||||
@@ -46,7 +46,7 @@ def get_unprinted_orders_data(limit=100):
|
||||
# Fallback: get all orders if no printed_labels column
|
||||
cursor.execute("""
|
||||
SELECT id, comanda_productie, cod_articol, descr_com_prod, cantitate,
|
||||
com_achiz_client, nr_linie_com_client, customer_name,
|
||||
data_livrare, dimensiune, com_achiz_client, nr_linie_com_client, customer_name,
|
||||
customer_article_number, open_for_order, line_number,
|
||||
created_at, updated_at
|
||||
FROM order_for_labels
|
||||
@@ -63,15 +63,17 @@ def get_unprinted_orders_data(limit=100):
|
||||
'cod_articol': row[2],
|
||||
'descr_com_prod': row[3],
|
||||
'cantitate': row[4],
|
||||
'com_achiz_client': row[5],
|
||||
'nr_linie_com_client': row[6],
|
||||
'customer_name': row[7],
|
||||
'customer_article_number': row[8],
|
||||
'open_for_order': row[9],
|
||||
'line_number': row[10],
|
||||
'printed_labels': row[11],
|
||||
'created_at': row[12],
|
||||
'updated_at': row[13]
|
||||
'data_livrare': row[5],
|
||||
'dimensiune': row[6],
|
||||
'com_achiz_client': row[7],
|
||||
'nr_linie_com_client': row[8],
|
||||
'customer_name': row[9],
|
||||
'customer_article_number': row[10],
|
||||
'open_for_order': row[11],
|
||||
'line_number': row[12],
|
||||
'printed_labels': row[13],
|
||||
'created_at': row[14],
|
||||
'updated_at': row[15]
|
||||
})
|
||||
else:
|
||||
orders.append({
|
||||
@@ -80,15 +82,17 @@ def get_unprinted_orders_data(limit=100):
|
||||
'cod_articol': row[2],
|
||||
'descr_com_prod': row[3],
|
||||
'cantitate': row[4],
|
||||
'com_achiz_client': row[5],
|
||||
'nr_linie_com_client': row[6],
|
||||
'customer_name': row[7],
|
||||
'customer_article_number': row[8],
|
||||
'open_for_order': row[9],
|
||||
'line_number': row[10],
|
||||
'data_livrare': row[5],
|
||||
'dimensiune': row[6],
|
||||
'com_achiz_client': row[7],
|
||||
'nr_linie_com_client': row[8],
|
||||
'customer_name': row[9],
|
||||
'customer_article_number': row[10],
|
||||
'open_for_order': row[11],
|
||||
'line_number': row[12],
|
||||
'printed_labels': 0, # Default to not printed
|
||||
'created_at': row[11],
|
||||
'updated_at': row[12]
|
||||
'created_at': row[13],
|
||||
'updated_at': row[14]
|
||||
})
|
||||
|
||||
conn.close()
|
||||
|
||||
Reference in New Issue
Block a user