예제 #1
0
            print("\t remove [item] - Removes item from selected bill")
            print("\t print - Prints selected bill")
            print("\t printall - Prints all bills")
            print("order help: ")
            print("\t new - Creates new order and selects it")
            print("\t select - Selects order")
            print("\t delete [id] - Deletes order")
            print("\t remove [item] - Removes item from selected order")
            print("\t print - Prints selected order")
            print("\t printall - Prints all orders")
            print("quit - Exits and saves")
            print("write - Substracts all sales from stock, writes and exits")
        else:
            print("Wrong input!")
            continue
    except Exception as e:
        print(e)
    if i is not None:
        if sqlite_mode:
            Reader_Writer.write_item(i)
    if b is not None:
        if sqlite_mode:
            Reader_Writer.write_bill(b)
    if o is not None:
        if sqlite_mode:
            Reader_Writer.write_order(o)
if sqlite_mode:
    Reader_Writer.write_all_and_clear(stock, bills, orders, users)
    Reader_Writer.close_connection()
else:
    Reader_Writer_json.write_all_and_clear(stock, bills, orders, users)
예제 #2
0
 def bill_add_item(self):
     self.b.add_item(self.i, int(self.bills_widget.bill_item_count.text()))
     if sqlite_mode:
         Reader_Writer.write_bill(self.b)
     self.get_bill_items_list()