def __init__(self, data): BaseModel.__init__(self, CHECK_LINE) self.__qty = data['qty'] self.__price = data['price'] self.__name = data['name'] self.__code = data['code'] self.__tax = data['tax']
def __init__(self, data): BaseModel.__init__(self, DISCOUNT) self.__sum = data['sum'] if 'prc' in list(data.keys()): self.__prc = data['prc'] else: self.__prc = 0
def __init__(self, data): if CASH_RECIEPT in list(data.keys()): BaseModel.__init__(self, CASH_RECIEPT) else: raise KeyError('Unknown check key error.') self.__data = data[CASH_RECIEPT]
def __init__(self, data): BaseModel.__init__(self, PAYMENT) self.__sum = data['sum'] self.__no = data['no'] if 'rrn' in data.keys(): self.__rrn = data['rrn'] else: self.__rrn = '' if 'card' in data.keys(): self.__card = data['card'] else: self.__card = ''
def __init__(self, data): keys = list(data.keys()) if SALES_RECIEPT in keys: BaseModel.__init__(self, SALES_RECIEPT) elif RETURN_RECIEPT in keys: BaseModel.__init__(self, RETURN_RECIEPT) else: raise KeyError('Unknown check key error') fabric = ModelFabric() self.__data = [ fabric.get_model(val) for val in data[self.model_type] if fabric.get_model(val) is not None ]
def dumps(self): return { 'id': BaseModel.check_id(), self.model_type: { COMMENT: self.__cm, } }
def dumps(self): return {'id': BaseModel.check_id(), self.model_type: self.__data}
def __init__(self, data): BaseModel.__init__(self, COMMENT_TYPE) if COMMENT in list(data.keys()): self.__cm = data[COMMENT] else: self.__cm = ''
def dumps(self): return { 'id': BaseModel.check_id(), self.model_type: [val.dumps() for val in self.__data] }