add billing process
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user