def CloseSalesDay(): DaySales = POSModule.GetAllSalesm() SalesAmount = 0 for item in DaySales: SalesAmount += item[3] print("ok") Last30DaysSales = POSModule.GetLast3DaysSales() if len(Last30DaysSales) == 30: POSModule.Last30DaysPOP(len(Last30DaysSales) - 1) POSModule.Last30DaysInsertAtFirstDay(SalesAmount)
def PrepareCRM(): DaySales = POSModule.GetAllSalesm() AllCustomers = POSModule.GetAllCustomersm() CRMDictionary = {} for item in DaySales: if item[1] == 0: if "Anonymous" in CRMDictionary: CRMDictionary[ "Anonymous"] = CRMDictionary["Anonymous"] + item[3] else: CRMDictionary["Anonymous"] = item[3] else: CustomerName = AllCustomers[item[1]] if CustomerName in CRMDictionary: CRMDictionary[ CustomerName] = CRMDictionary[CustomerName] + item[3] else: CRMDictionary[CustomerName] = item[3] return CRMDictionary
def PrepareReport(): DaySales = POSModule.GetAllSalesm() CashAmount = 0 CreditAmount = 0 for item in DaySales: if item[2] == 0: #cash CashAmount += item[3] else: #Credit CreditAmount += item[3] ReportList = [["Cash", CashAmount], ["Credit", CreditAmount]] return ReportList
def IsCommandValid(CheckCommand): if CheckCommand not in POSModule.GetInputCommands(): return 0 #yes its invalide command else: return 1 #Command is valid
def GetAllCustomersc(): return POSModule.GetAllCustomersm()
def GetAllSalesc(): return POSModule.GetAllSalesm()
def AddCustomerc(CustomerList): return POSModule.AddCustomerm(CustomerList)
def AddSKUc(SKUList): return POSModule.AddSKUm(SKUList)
def AddSalesc(SaleList): return POSModule.AddSalesm(SaleList)
def GetCustomerByIDc(CustomerID): return POSModule.GetCustomerByIDm(CustomerID)
def GetArticleByIDc(ArticleID): return POSModule.GetArticleByIDm(ArticleID)
def GetInputCommand(): return POSModule.GetInputCommands()
def GetPaymentTypesc(): return POSModule.GetPaymentTypesm()