def __init__(self, **kwargs): super().__init__(**kwargs) self.conn = dbconn.con() self.page_title = self.ids.page_title self.info = self.ids.info_label #Global Shop Data self.get_capital_sales_expenses() self.shop_name = '' self.Owner_name = '' self.shop_address = '' self.shop_init_capital = str(4500) self.email = '' self.owner_phone = '' self.total_sellings_cost = 0 self.total_unit_cost = 0 self.current_income = 0 self.current_profit = 0 # ALL Stock Display Screen screen_all_products = self.ids.scrn_all_stock products = self.get_products() productstable = DataTable(table=products) screen_all_products.add_widget(productstable) # ALL Customers Display Screen screen_all_customers = self.ids.scrn_all_customers customers = self.get_customer() customertable = DataTable(table=customers) screen_all_customers.add_widget(customertable) # Manage User Display Screen Screen_user = self.ids.scrn_manage_users users = self.get_saleRep() usertable = DataTable(table=users) Screen_user.add_widget(usertable) #Manage All Expenses Display expenses_screen = self.ids.scrn_expense_output expenses = self.get_expenses() expenstable = DataTable(table=expenses) expenses_screen.add_widget(expenstable) # Manage Products Display Screen Screen_products_manage = self.ids.scrn_manage_products products_manage = self.get_products() productstable_manage = DataTable(table=products_manage) Screen_products_manage.add_widget(productstable_manage) # ALL Sold Products Display Screen screen_all_solds = self.ids.scrn_all_sales sold_products = self.get_sold_products() sold_products_table = DataTable(table=sold_products) screen_all_solds.add_widget(sold_products_table)
def __init__(self, **kwargs): super().__init__(**kwargs) self.conn = dbconn.con() self.page_title = self.ids.page_title self.product_quantity = '' self.crud_product_name = '' self.crud_product_quantity = '' self.order_product_cost = '' self.old_stock = '' self.sms_username = '******' self.sms_password = '******' # Save all Shopping Cart for Current User self.cart = [] self.qty = [] self.total = 0.00 self.product_total_cost = [] self.customerid = '' self.productid = [] self.get_sold_products() # ALL Stock Display Screen screen_all_products = self.ids.scrn_all_stock products = self.get_products() productstable = DataTable(table=products) screen_all_products.add_widget(productstable) # # ALL Sold Products Display Screen screen_all_solds = self.ids.scrn_all_sales sold_products = self.get_sold_products() sold_products_table = DataTable(table=sold_products) screen_all_solds.add_widget(sold_products_table) # Order Page products_screen = self.ids.view_available_products product = self.get_available_products() producttable = DataTable(table=product) self.ids.view_available_products.add_widget(producttable)
from DbUtils import dbconn conn = dbconn.con() def admin_login(): for_navigate = conn.cursor() for_navigate.execute('''CREATE TABLE IF NOT EXISTS Admin_login (ID INTEGER PRIMARY KEY AUTOINCREMENT, username VARCHAR, pin INTEGER, security_question TEXT)''' ) # this function creates table that stores reps login details def rep_login(): for_navigate = conn.cursor() for_navigate.execute('''CREATE TABLE IF NOT EXISTS Rep_login (ID INTEGER PRIMARY KEY AUTOINCREMENT, username VARCHAR, pin INTEGER)''' ) # this function creates table that stores information about the admin def admin_reg(): for_navigate = conn.cursor() for_navigate.execute('''CREATE TABLE IF NOT EXISTS Admin_Details (ID INTEGER PRIMARY KEY AUTOINCREMENT, adminID INTEGER REFERENCES Admin_login(ID) ON UPDATE CASCADE,surname TEXT, first_name TEXT, mobile no VARCHAR, address VARCHAR, next_of_kin_name VARCHAR)''') # this function creates table that stores information about the rep def reps_reg(): for_navigate = conn.cursor() for_navigate.execute('''CREATE TABLE IF NOT EXISTS Rep_Details
def __init__(self, **kwargs): super().__init__(**kwargs) self.StartTable() self.conn = dbconn.con()