Esempio n. 1
0
 def readAllByTransaction(self, e):
     l = []
     sql = ("SELECT name, raw_material_id, product_id, transaction_id, account_class_id, stock_id, "
            "unit, quantity, value_net, tax_rate, value_gross, remark "
            "FROM " + TransactionItem.MY_TABLE_NAME + " " 
            'WHERE transaction_id = %s ORDER BY weight asc')
   
     self.execute(sql, (e.id,))
     res = self._cursor.fetchall()
     
     for (id, name, raw_material_id, product_id, transaction_id, account_class_id, stock_id,
          unit, quantity, value_net, tax_rate, value_gross, remark, weight) in res:
         e = TransactionItem()
         e.id = id 
         e.name = name
         e.raw_material = RawMaterialManager.getInstance().read(raw_material_id)
         e.product = ProductManager.getInstance().read(product_id)
         e.transaction = TransactionManager.getInstance().read(transaction_id)
         e.account_class = AccountClassManager.getInstance().read(account_class_id)
         e.stock = None #StockManager.getInstance().read(stock_id)
         e.unit = unit
         e.quantity = quantity
         e.value_net = value_net
         e.tax_rate = tax_rate
         e.value_gross = value_gross            
         e.remark = remark
         e.weight = weight
         
         l.append(e)
     
     return l
Esempio n. 2
0
 def unserialize(self, data, e=None):
     if e == None:
         e = TransactionItem()  
         
     e.weight = data[0]
     e.id = data[1]
     e.raw_material = RawMaterialManager.getInstance().read(data[2])
     e.product = ProductManager.getInstance().read(data[3])
     e.transaction = TransactionManager.getInstance().read(data[4])
     e.account_class = AccountClassManager.getInstance().read(data[5])
     e.stock = None #StockManager.getInstance().read(data[6])
     e.unit = data[7]
     e.quantity = data[8]
     e.value_net = data[9]
     e.tax_rate = data[10]
     e.value_gross = data[11]
     e.remark = data[12]
     
     return e
Esempio n. 3
0
 def delete(partner):
     return AccountClassManager.getInstance().delete(partner)
Esempio n. 4
0
 def update(partner):
     return AccountClassManager.getInstance().update(partner)
Esempio n. 5
0
 def create(partner):
     return AccountClassManager.getInstance().create(partner)
Esempio n. 6
0
 def get(elementId):
     return AccountClassManager.getInstance().read(elementId)
Esempio n. 7
0
 def new():
     return AccountClassManager.getInstance().new()
Esempio n. 8
0
 def delete(partner):
     return AccountClassManager.getInstance().delete(partner)
Esempio n. 9
0
 def getListItems():
     return AccountClassManager.getInstance().readAllNameIdPairs()
Esempio n. 10
0
 def create(partner):
     return AccountClassManager.getInstance().create(partner)
Esempio n. 11
0
 def update(partner):
     return AccountClassManager.getInstance().update(partner)
Esempio n. 12
0
 def new():
     return AccountClassManager.getInstance().new()
Esempio n. 13
0
 def get(elementId):
     return AccountClassManager.getInstance().read(elementId)
Esempio n. 14
0
 def getListItems():
     return AccountClassManager.getInstance().readAllNameIdPairs()