add billing process

This commit is contained in:
2025-11-21 17:57:37 +02:00
parent 8351bdb5d3
commit 65a0d52018
3 changed files with 130 additions and 20 deletions

View File

@@ -82,16 +82,17 @@ class BulkProducts:
return result
return None
def get_product_by_bill_id(self, bill_id):
def get_products_by_bill_id(self, bill_id):
with sqlite3.connect(self.db_path) as conn:
cursor = conn.cursor()
cursor.execute("""
SELECT * FROM bulk_products WHERE bill_id = ?
""",(bill_id, ))
row = cursor.fetchone()
rows = cursor.fetchall()
result = []
if row:
result = {
if rows:
for row in rows:
buffer = {
"id": row[0],
"bill_id": row[1],
"name": row[2],
@@ -101,8 +102,9 @@ class BulkProducts:
"vat": row[6],
"created_at": row[7]
}
result.append(buffer)
return result
return None
return []
def remove(self, id):
with sqlite3.connect(self.db_path) as conn: