williamagyapong commited on
Commit
e6ff214
·
verified ·
1 Parent(s): 53b9009

Update utility.py

Browse files
Files changed (1) hide show
  1. utility.py +3 -1
utility.py CHANGED
@@ -236,8 +236,10 @@ def create_sale(user_phone, transaction_data):
236
  for transaction in transaction_data:
237
  item_name = transaction['details']['item'] # assumes item names are unique per transactions
238
  # fetch the inventory
239
- inventory = fetch_transaction(user_phone, item_name)
240
  print(inventory)
 
 
241
  # Do the sales calculations
242
  new_stock_level = inventory['details']['quantity'] - transaction['details']['quantity']
243
  inventory['details']['quantity'] = new_stock_level
 
236
  for transaction in transaction_data:
237
  item_name = transaction['details']['item'] # assumes item names are unique per transactions
238
  # fetch the inventory
239
+ print(item_name, '\n')
240
  print(inventory)
241
+ inventory = fetch_transaction(user_phone, item_name)
242
+
243
  # Do the sales calculations
244
  new_stock_level = inventory['details']['quantity'] - transaction['details']['quantity']
245
  inventory['details']['quantity'] = new_stock_level