Beispiel #1
0
 def loadBalances(self):
     bals = Balances(self.opts["mf"], "DRS", self.opts["conum"],
                     int(self.sysdtw / 100), (self.chain, self.acno))
     obal, tbal, ages = bals.doAllBals()
     this, hist = bals.doCrsDrsHist()
     self.sale = hist[0]
     self.pays = hist[1]
     last = self.sql.getRec("drstrn",
                            cols=["max(drt_trdt)"],
                            where=[("drt_cono", "=", self.opts["conum"]),
                                   ("drt_chain", "=", self.chain),
                                   ("drt_acno", "=", self.acno),
                                   ("drt_type", "=", 1)],
                            limit=1)
     if not last or not last[0]:
         lastsald = 0
     else:
         lastsald = last[0]
     last = self.sql.getRec("drstrn",
                            cols=["max(drt_trdt)"],
                            where=[("drt_cono", "=", self.opts["conum"]),
                                   ("drt_chain", "=", self.chain),
                                   ("drt_acno", "=", self.acno),
                                   ("drt_type", "=", 5)],
                            limit=1)
     if not last or not last[0]:
         lastpayd = 0
     else:
         lastpayd = last[0]
     for x in range(0, 8):
         if x == 0:
             data = lastsald
         elif x == 1:
             data = lastpayd
         elif x == 2:
             data = tbal
         else:
             data = ages[x - 3]
         self.df.loadEntry("T", 3, x, data=data)
     p = 0
     for x in range(0, 13):
         i = 0
         self.df.loadEntry("C", 4, p, data=self.sale[x])
         p = p + 1
         i = i + 1
         pay = float(ASD(0) - ASD(self.pays[x]))
         self.df.loadEntry("C", 4, p, data=pay)
         p = p + 1
         i = i + 1
Beispiel #2
0
 def getValues(self, data):
     acc = CCD(data[0], "NA", 7)
     name = CCD(data[1], "NA", 30)
     bals = Balances(self.opts["mf"], "CRS", self.opts["conum"], self.coffw,
         (acc.work,))
     this, hist = bals.doCrsDrsHist()
     if not this:
         return
     purchd = ""
     purchw = []
     purtot = 0
     for x in range(11, -1, -1):
         amt = CCD(round(hist[0][x], 0), "SI", 10)
         self.gtots[x] = self.gtots[x] + amt.work
         purtot = purtot + amt.work
         if purchd:
             purchd = "%s %9s" % (purchd, amt.disp)
         else:
             purchd = "%9s" % amt.disp
         purchw.append(amt.work)
     if self.zer == "Y" and purtot == 0:
         return
     return acc, name, purchd, purchw