def getLastJancode(self): result = DaoBase().fetchAll('mst_item', {'no_code_flag': 1}) if result: maxValue = 0 for key, values in result.items(): jan_code = int(values['jan_code']) if jan_code > maxValue: maxValue = jan_code maxValue = str(maxValue+1) else: maxValue = "1" return maxValue
def getLastJancode(self): result = DaoBase().fetchAll('mst_item', {'no_code_flag': 1}) if result: maxValue = 0 for key, values in result.items(): jan_code = int(values['jan_code']) if jan_code > maxValue: maxValue = jan_code maxValue = str(maxValue + 1) else: maxValue = "1" return maxValue
def __init__(self, email=None): self.staff_name = None self.pw_hash = "" if email is not None: staff_data = DaoBase().fetchOne('mst_staff', {'email': email}) if staff_data: self.staff_id = staff_data['id'] self.staff_name = staff_data['name'] self.email = staff_data['email'] self.pw_hash = staff_data['password'] self.authority = staff_data['authority']
def getLastJancode(self): result = DaoBase().fetchAll('mst_item', {'no_code_flag': 1}) if result: maxValue = 0 for key, values in result.items(): jan_code = int(values['jan_code']) if jan_code > maxValue: maxValue = jan_code maxValue = str(maxValue + 1) count = 13 - maxValue.count("") + 1 zeroCount = "" while count: zeroCount += "0" count -= 1 maxValue = zeroCount + maxValue else: maxValue = "0000000000001" return maxValue
def update_staff(self, editData, id): data = { 'staff_cd': editData['staff_cd'], 'name': editData['name'], 'telphone': editData['telphone'], 'email': editData['email'], } if editData['password'] != "": pw_hash = generate_password_hash(editData['password']) data['password'] = pw_hash result = DaoBase().updateRecord('mst_staff', data, id) return result
def saveInboxData(self, id, data): result = DaoBase().updateRecord('mst_in_box', data, id) return result
def addInbox(self, datas): tableName = 'mst_in_box' result = DaoBase().insertRecord(tableName, datas) return result
def getInboxData(self, where): inboxData = DaoBase().fetchOne('mst_in_box', where) return inboxData
def saveOutboxData(self, id, datas): result = DaoBase().updateRecord('mst_out_box', datas, id) return result
def getOutboxesByCustomerId(self, id): outboxDatas = DaoBase().fetchAll('mst_out_box', {'customer_id': id}) return outboxDatas
def getCustomer(self, id): customerRecord = DaoBase().fetchOne('mst_customer', id) return customerRecord
def insertCustomer(self, data): result = DaoBase().insertRecord('mst_customer', data) return result
def saveItem(self, id, data): result = DaoBase().updateRecord('mst_item', data, id) return result
def addItem(self, data): tableName = 'mst_item' result = DaoBase().insertRecord(tableName, data) return result
def getItem(self, where): item = DaoBase().fetchOne('mst_item', where) return item
def getCustomers(self): customerRecords = DaoBase().fetchAll('mst_customer') return customerRecords
def getRelOutItems(self, where): relOutItems = DaoBase().fetchAll('rel_out_item', where) return relOutItems
def updateCustomer(self, data, id): result = DaoBase().updateRecord('mst_customer', data, id) return result
def getRelOutItem(self, where): relOutItem = DaoBase().fetchOne('rel_out_item', where) return relOutItem
def getOutboxDatas(self, where): outboxDatas = DaoBase().fetchAll('mst_out_box', where) return outboxDatas
def addRelOutItem(self, data): tableName = 'rel_out_item' result = DaoBase().insertRecord(tableName, data) return result
def getOutboxData(self, where): outboxData = DaoBase().fetchOne('mst_out_box', where) return outboxData
def saveRelOutItem(self, id, data): result = DaoBase().updateRecord('rel_out_item', data, id) return result
def getInboxDatas(self, where): inboxDatas = DaoBase().fetchAll('mst_in_box', where) return inboxDatas
def getMadeInInfos(self, where): madeInInfos = DaoBase().fetchAll('mst_made_in', where) return madeInInfos
def getInboxesByCustomerId(self, id): inboxDatas = DaoBase().fetchAll('mst_in_box', {'customer_id': id}) return inboxDatas
def getMadeInInfo(self, where): madeInInfo = DaoBase().fetchOne('mst_made_in', where) return madeInInfo
def getInboxDataWithEdit(self, id): inboxData = DaoBase().fetchOne('mst_in_box', id) return inboxData
def addMadeInInfo(self, data): tableName = 'mst_made_in' result = DaoBase().insertRecord(tableName, data) return result
def getInboxDataBySearch(self, where): result = DaoBase().fetchAllBySearch('mst_in_box', where) return result
def saveMadeInInfo(self, id, data): result = DaoBase().updateRecord('mst_made_in', data, id) return result