예제 #1
0
 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']
예제 #2
0
 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
예제 #3
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]
예제 #4
0
    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 = ''
예제 #5
0
    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
        ]
예제 #6
0
 def dumps(self):
     return {
         'id': BaseModel.check_id(),
         self.model_type: {
             COMMENT: self.__cm,
         }
     }
예제 #7
0
 def dumps(self):
     return {'id': BaseModel.check_id(), self.model_type: self.__data}
예제 #8
0
 def __init__(self, data):
     BaseModel.__init__(self, COMMENT_TYPE)
     if COMMENT in list(data.keys()):
         self.__cm = data[COMMENT]
     else:
         self.__cm = ''
예제 #9
0
 def dumps(self):
     return {
         'id': BaseModel.check_id(),
         self.model_type: [val.dumps() for val in self.__data]
     }