Beispiel #1
0
 def printSetup(self):
     pth = self.opts["mf"].rcdic["wrkdir"]
     if self.df.repeml[1] == "Y":
         key = "%s_%s" % (self.com, self.emp)
         self.pdfnam = getModName(pth,
                                  self.__class__.__name__,
                                  key,
                                  ext="pdf")
     elif not self.pdfnam:
         self.pdfnam = getModName(pth,
                                  self.__class__.__name__,
                                  self.opts["conum"],
                                  ext="pdf")
     self.fpdf = MyFpdf(name=self.__class__.__name__, head=90)
Beispiel #2
0
 def printReport(self, recs):
     p = ProgressBar(self.opts["mf"].body, mxs=len(recs), esc=True)
     self.head = "%03u %-138s" % (self.opts["conum"], self.opts["conam"])
     self.fpdf = MyFpdf(name=self.__class__.__name__, head=self.head)
     self.stot = [0] * 3
     self.gtot = [0] * 3
     old_rep = ""
     self.pglin = 999
     for num, dat in enumerate(recs):
         p.displayProgress(num)
         if p.quit:
             break
         self.rep = CCD(dat[0], "Na", 3)
         grp = CCD(dat[1], "NA", 3)
         cod = CCD(dat[2], "NA", 20)
         rf1 = CCD(dat[5], "Na", 9)
         rf2 = CCD(dat[6], "Na", 9)
         drs = CCD(dat[9], "NA", 7)
         qty = CCD(float(ASD(0) - ASD(dat[10])), "SD", 11.2)
         cst = CCD(float(ASD(0) - ASD(dat[11])), "SD", 11.2)
         sll = CCD(float(ASD(0) - ASD(dat[12])), "SD", 11.2)
         des = CCD(dat[13], "NA", 30)
         prf = float(ASD(sll.work) - ASD(cst.work))
         prf = CCD(prf, "SD", 11.2)
         if sll.work == 0:
             pcn = 0
         else:
             pcn = round((prf.work * 100.0 / sll.work), 2)
         pcn = CCD(pcn, "SD", 7.2)
         if old_rep and old_rep != self.rep.work:
             self.repTotal()
             self.pglin = 999
         if self.pglin > self.fpdf.lpp:
             self.pageHeading()
         self.fpdf.drawText("%s %s %s %s %s %s %s %s %s %s %s %s" % \
             (rf1.disp, "Sls", drs.disp, rf2.disp, grp.disp, cod.disp,
             des.disp, qty.disp, sll.disp, cst.disp, prf.disp, pcn.disp))
         self.pglin += 1
         self.stot[0] = float(ASD(self.stot[0]) + ASD(sll.work))
         self.stot[1] = float(ASD(self.stot[1]) + ASD(cst.work))
         self.gtot[0] = float(ASD(self.gtot[0]) + ASD(sll.work))
         self.gtot[1] = float(ASD(self.gtot[1]) + ASD(cst.work))
         old_rep = self.rep.work
     p.closeProgress()
     if self.fpdf.page and not p.quit:
         self.repTotal()
         self.grandTotal()
         if "args" not in self.opts or "noprint" not in self.opts["args"]:
             pdfnam = getModName(self.opts["mf"].rcdic["wrkdir"],
                                 self.__class__.__name__,
                                 self.opts["conum"],
                                 ext="pdf")
             self.fpdf.output(pdfnam, "F")
             doPrinter(mf=self.opts["mf"],
                       conum=self.opts["conum"],
                       pdfnam=pdfnam,
                       header=self.tit,
                       repprt=self.df.repprt,
                       fromad=self.fromad,
                       repeml=self.df.repeml)
Beispiel #3
0
 def printReport(self, recs):
     p = ProgressBar(self.opts["mf"].body, mxs=len(recs), esc=True)
     self.head = "%03u %-89s" % (self.opts["conum"], self.opts["conam"])
     self.fpdf = MyFpdf(name=self.__class__.__name__, head=self.head)
     old_grp = ""
     self.pglin = 999
     for num, dat in enumerate(recs):
         p.displayProgress(num)
         if p.quit:
             break
         grp, code, itype, desc, uoi, umd = self.getValues(dat)
         self.groupd = grp.disp
         if old_grp and old_grp != grp.work:
             self.pglin = 999
         if self.pglin > self.fpdf.lpp:
             self.pageHeading()
         self.fpdf.drawText(
             "%s %s %s %s %s" %
             (code.disp, itype.disp, desc.disp, uoi.disp, umd.disp))
         self.pglin += 1
         old_grp = grp.work
     p.closeProgress()
     if self.fpdf.page and not p.quit:
         pdfnam = getModName(self.opts["mf"].rcdic["wrkdir"],
                             self.__class__.__name__,
                             self.opts["conum"],
                             ext="pdf")
         self.fpdf.output(pdfnam, "F")
         doPrinter(mf=self.opts["mf"],
                   conum=self.opts["conum"],
                   pdfnam=pdfnam,
                   header=self.tit,
                   repprt=self.df.repprt,
                   fromad=self.fromad,
                   repeml=self.df.repeml)
Beispiel #4
0
 def exportReport(self, recs):
     p = ProgressBar(self.opts["mf"].body, mxs=len(recs), esc=True)
     expnam = getModName(self.opts["mf"].rcdic["wrkdir"],
         self.__class__.__name__, self.opts["conum"])
     self.expheads = [self.head + " %s" % self.sysdttm]
     self.expheads.append("Creditor's Purchase History for the 12 Months "\
         "Period to %s" % self.coffd)
     self.expheads.append("Options: Ignore-Zeros %s" % self.zer)
     self.expcolsh = [self.colsh]
     self.expforms = self.forms
     self.expdatas = []
     for num, dat in enumerate(recs):
         p.displayProgress(num)
         if p.quit:
             p.closeProgress()
             return
         vals = self.getValues(dat)
         if not vals:
             continue
         line = ["BODY", [vals[0].work, vals[1].work]]
         for val in vals[3]:
             line[1].append(val)
         self.expdatas.append(line)
     p.closeProgress()
     self.grandTotal()
     doWriteExport(xtype=self.df.repprt[1], name=expnam,
         heads=self.expheads, colsh=self.expcolsh, forms=self.expforms,
         datas=self.expdatas, rcdic=self.opts["mf"].rcdic)
Beispiel #5
0
 def exportReport(self, recs):
     p = ProgressBar(self.opts["mf"].body, mxs=len(recs), esc=True)
     expnam = getModName(self.opts["mf"].rcdic["wrkdir"],
         self.__class__.__name__, self.opts["conum"])
     self.expheads = [self.head + " %s" % self.sysdttm]
     self.expheads.append("Loans's Ledger Audit Trail for Period "\
         "%s to %s" % (self.sdatd, self.edatd))
     self.expcolsh = [self.colsh]
     self.expforms = self.forms
     self.expdatas = []
     self.gdrs = 0
     self.gcrs = 0
     for num, dat in enumerate(recs):
         p.displayProgress(num)
         if p.quit:
             p.closeProgress()
             return
         vals = self.getValues(dat)
         if not vals:
             continue
         acno, loan, batch, trtp, trdt, ref, drs, crs, desc = vals
         line = ["BODY", [trtp.work, batch.work, acno.work, loan.work,
             ref.work, trdt.work, desc.work, drs.work, crs.work]]
         self.expdatas.append(line)
         self.gdrs = float(ASD(self.gdrs) + ASD(drs.work))
         self.gcrs = float(ASD(self.gcrs) + ASD(crs.work))
     p.closeProgress()
     self.grandTotal()
     doWriteExport(xtype=self.df.repprt[1], name=expnam,
         heads=self.expheads, colsh=self.expcolsh, forms=self.expforms,
         datas=self.expdatas, rcdic=self.opts["mf"].rcdic)
Beispiel #6
0
 def exportReport(self, recs):
     p = ProgressBar(self.opts["mf"].body, mxs=len(recs), esc=True)
     expnam = getModName(self.opts["mf"].rcdic["wrkdir"],
         self.__class__.__name__, self.opts["conum"])
     self.expheads = [self.head + " %s" % self.sysdttm]
     self.expheads.append("Booking's Balances up to %s" % self.period)
     self.expheads.append("Booking Status: %s" % self.statusd)
     self.expcolsh = [self.colsh]
     self.expforms = self.forms
     self.expdatas = []
     for num, dat in enumerate(recs):
         p.displayProgress(num)
         if p.quit:
             p.closeProgress()
             return
         vals = self.getValues(dat)
         if not vals:
             continue
         line = ["BODY", [vals[0].work, vals[1].work, vals[2].work,
             vals[3].work, vals[4].work]]
         for val in vals[5:]:
             line[1].append(val.work)
         self.expdatas.append(line)
     p.closeProgress()
     self.grandTotal()
     doWriteExport(xtype=self.df.repprt[1], name=expnam,
         heads=self.expheads, colsh=self.expcolsh, forms=self.expforms,
         datas=self.expdatas, rcdic=self.opts["mf"].rcdic)
Beispiel #7
0
 def exportReport(self, recs):
     p = ProgressBar(self.opts["mf"].body, mxs=len(recs), esc=True)
     expnam = getModName(self.opts["mf"].rcdic["wrkdir"],
                         self.__class__.__name__, self.opts["conum"])
     self.expheads = [
         "%03u %-30s %s" %
         (self.opts["conum"], self.opts["conam"], self.sysdttm)
     ]
     self.expheads.append("Stores Sales History for the 12 Month Period "\
         "to %s" % self.coffd)
     self.expcolsh = [self.colsh]
     self.expforms = self.forms
     self.expdatas = []
     for num, dat in enumerate(recs):
         p.displayProgress(num)
         if p.quit:
             p.closeProgress()
             return
         vals = self.getValues(dat)
         if not vals:
             continue
         cod, dsc, uoi, amt, purchd, purchw = vals
         line = ["BODY", [self.grp.work, cod.work, dsc.work, uoi.work]]
         line[1].extend(purchw)
         self.expdatas.append(line)
     p.closeProgress()
     self.grandTotal()
     doWriteExport(xtype=self.df.repprt[1],
                   name=expnam,
                   heads=self.expheads,
                   colsh=self.expcolsh,
                   forms=self.expforms,
                   datas=self.expdatas,
                   rcdic=self.opts["mf"].rcdic)
Beispiel #8
0
 def doPrint(self):
     if self.repeml[1] == "Y" and not self.emadd:
         key = "%s_%s_%s_%s" % (self.opts["conum"], self.own, self.prm,
                                self.acc)
     else:
         key = "%s_all_all_all" % self.opts["conum"]
     pdfnam = getModName(self.opts["mf"].rcdic["wrkdir"],
                         self.__class__.__name__,
                         key,
                         ext="pdf")
     self.form.output(pdfnam, "F")
     doPrinter(mf=self.opts["mf"],
               conum=self.opts["conum"],
               pdfnam=pdfnam,
               header="%s Statement at %s" %
               (self.opts["conam"], self.dated),
               fromad=self.fromad,
               repprt=self.repprt,
               repeml=self.repeml)
     if self.repeml[1] == "Y":
         self.form = DrawForm(self.opts["mf"].dbm,
                              self.tname,
                              wrkdir=self.opts["mf"].rcdic["wrkdir"])
         self.doLoadStatic()
         self.form.doNewDetail()
Beispiel #9
0
 def printReport(self, recs):
     p = ProgressBar(self.opts["mf"].body, mxs=len(recs), esc=True)
     self.head = "%03u %-77s" % (self.opts["conum"], self.opts["conam"])
     self.fpdf = MyFpdf(name=self.__class__.__name__, head=self.head)
     self.btot = [0, 0]
     self.pglin = 999
     bc = self.sql.ctlbat_col
     tc = self.sql.wagltf_col
     for num, dat in enumerate(recs):
         p.displayProgress(num)
         if p.quit:
             break
         self.rtyp = CCD(dat[bc.index("btm_rtyp")], "UI", 1)
         self.batno = CCD(dat[bc.index("btm_batno")], "Na", 7)
         self.curdt = CCD(dat[bc.index("btm_curdt")], "D2", 7)
         self.multi = CCD(dat[bc.index("btm_multi")], "UA", 1)
         self.trno = CCD(dat[bc.index("btm_trno")], "UI", 7)
         self.trval = CCD(dat[bc.index("btm_trval")], "SD", 13.2)
         whr = [
             ("wlt_cono", "=", self.opts["conum"]),
             ("wlt_type", "=", self.rtyp.work),
             ("wlt_batch", "=", self.batno.work),
             ("wlt_batind", "=", "N")]
         odr = "wlt_seq"
         trndat = self.sql.getRec("wagltf", where=whr, order=odr)
         if not trndat:
             continue
         if self.pglin > self.fpdf.lpp:
             self.pageHeading()
         else:
             self.batchHeading()
         for trn in trndat:
             empno = CCD(trn[tc.index("wlt_empno")], "UI", 5)
             loan = CCD(trn[tc.index("wlt_loan")], "UI", 2)
             trdt = CCD(trn[tc.index("wlt_trdt")], "D1", 10)
             ref = CCD(trn[tc.index("wlt_ref")], "Na", 9)
             amt = CCD(trn[tc.index("wlt_amt")], "SD", 13.2)
             ded = CCD(trn[tc.index("wlt_ded")], "SD", 13.2)
             per = CCD(trn[tc.index("wlt_per")], "UD", 6.2)
             desc = CCD(trn[tc.index("wlt_desc")], "NA", 15)
             if self.pglin > self.fpdf.lpp:
                 self.pageHeading()
             self.fpdf.drawText("%s %s %s %s %s %s %s %s" %
                 (empno.disp, loan.disp, trdt.disp, ref.disp,
                 per.disp, amt.disp, ded.disp, desc.disp))
             self.btot[0] = self.btot[0] + 1
             self.btot[1] = float(ASD(self.btot[1]) + ASD(amt.work))
             self.pglin += 1
         self.batchTotal()
     p.closeProgress()
     if self.fpdf.page and not p.quit:
         pdfnam = getModName(self.opts["mf"].rcdic["wrkdir"],
             self.__class__.__name__, self.opts["conum"], ext="pdf")
         self.fpdf.output(pdfnam, "F")
         doPrinter(mf=self.opts["mf"], conum=self.opts["conum"],
             pdfnam=pdfnam, header=self.tit, repprt=self.df.repprt,
             fromad=self.fromad, repeml=self.df.repeml)
     else:
         showError(self.opts["mf"].body, "Batch Errors",
             "No Batch Transactions")
Beispiel #10
0
 def doEnd(self):
     self.df.closeProcess()
     col = ["scm_scod", "scm_surname", "scm_names", "scm_gender",
         "scc_name", "scm_phone"]
     whr = [
         ("sce_cono", "=", self.opts["conum"]),
         ("sce_ccod", "=", self.ccod),
         ("scm_cono=sce_cono",),
         ("scm_scod=sce_scod",),
         ("scc_club=scm_club",)]
     recs = self.sql.getRec(tables=["scpent", "scpmem", "scpclb"], cols=col,
         where=whr, order="scm_surname")
     if recs:
         self.fpdf = MyFpdf(auto=True, name="sc3010", head=90)
         self.fpdf.header = self.doHead
         self.fpdf.add_page()
         cwth = self.fpdf.cwth
         for num, rec in enumerate(recs):
             self.fpdf.drawText(txt="%6s" % rec[0], w=cwth*7, h=5, ln=0)
             nm = rec[1].strip() + ", %s" % rec[2].split()[0]
             self.fpdf.drawText(txt=nm, w=cwth*31, h=5, ln=0)
             self.fpdf.drawText(txt=rec[3], w=cwth*2, h=5, ln=0)
             self.fpdf.drawText(txt=rec[4], w=cwth*31, h=5, ln=0)
             ph = rec[5].replace(" ", "").strip()
             self.fpdf.drawText(txt=ph, w=cwth*16, h=5, ln=1)
         pdfnam = getModName(self.opts["mf"].rcdic["wrkdir"],
             self.__class__.__name__, self.opts["conum"], ext="pdf")
         self.fpdf.output(pdfnam, "F")
         doPrinter(mf=self.opts["mf"], pdfnam=pdfnam,
             repprt=self.df.repprt,
             repeml=self.df.repeml)
     self.opts["mf"].closeLoop()
Beispiel #11
0
 def exportReport(self, recs):
     p = ProgressBar(self.opts["mf"].body, mxs=len(recs), esc=True)
     expnam = getModName(self.opts["mf"].rcdic["wrkdir"],
                         self.__class__.__name__, self.opts["conum"])
     self.expheads = [self.head + " %s" % self.sysdttm]
     self.expheads.append("Debtor's Age Analaysis up to %s" %
                          self.opts["period"])
     self.expheads.append("Options: Activity %s Type %s Low-Bal %s "\
         "Cr-Bals %s Ignore-Zeros %s" % (self.drsact, self.drstyp,
         self.limit, self.credit, self.zero))
     self.expcolsh = [self.colsh]
     self.expforms = self.forms
     self.expdatas = []
     for num, dat in enumerate(recs):
         p.displayProgress(num)
         if p.quit:
             p.closeProgress()
             return
         vals = self.getValues(dat)
         if not vals:
             continue
         line = ["BODY", [vals[0].work, vals[1].work, vals[2].work]]
         for val in vals[3:]:
             line[1].append(val.work)
         self.expdatas.append(line)
     p.closeProgress()
     self.grandTotal()
     doWriteExport(xtype=self.df.repprt[1],
                   name=expnam,
                   heads=self.expheads,
                   colsh=self.expcolsh,
                   forms=self.expforms,
                   datas=self.expdatas,
                   rcdic=self.opts["mf"].rcdic)
Beispiel #12
0
 def printReport(self, recs):
     self.pglin = 999
     p = ProgressBar(self.opts["mf"].body, mxs=len(recs), esc=True)
     self.head = "%03u %-101s" % (self.opts["conum"], self.opts["conam"])
     self.fpdf = MyFpdf(name=self.__class__.__name__, head=self.head)
     for seq, dat in enumerate(recs):
         p.displayProgress(seq)
         if p.quit:
             break
         self.acno, self.desc, acctot = self.getAccValues(dat)
         trn = self.sql.getRec("gentrn", where=[("glt_cono", "=",
             dat[0]), ("glt_acno", "=", dat[1]), ("glt_curdt", ">=",
             self.sdate.work), ("glt_curdt", "<=", self.edate.work)],
             order="glt_acno, glt_curdt, glt_trdt, glt_type, glt_refno, "\
             "glt_batch")
         if acctot or trn:
             if self.pglin == 999 or self.pages == "Y":
                 self.pageHeading()
             else:
                 self.newAccount()
         if acctot:
             w1 = CCD(acctot, "SD", 13.2)
             self.fpdf.drawText("%-10s %-9s %-3s %-7s %-30s %-13s %-13s "\
                 "%-13s" % (self.sdate.disp + "-01", "", "", "",
                 "Opening Balance", "", "", w1.disp))
             self.pglin += 1
         for acc in trn:
             trdt, refno, trtp, batch, amt, dbt, crt, detail, curdt, \
                 curmth = self.getTrnValues(acc)
             if self.pglin > self.fpdf.lpp:
                 self.pageHeading()
                 bf = CCD(acctot, "SD", 13.2)
                 if bf.work:
                     self.fpdf.drawText(
                         "%32s %-30s %27s %13s" %
                         ("", "Brought Forward", "", bf.disp))
                     self.pglin += 1
             acctot = float(ASD(acctot) + ASD(amt.work))
             w1 = CCD(acctot, "SD", 13.2)
             self.fpdf.drawText("%-10s %-9s %-3s %-7s %-30s %13s %13s %13s"\
                 % (trdt.disp, refno.disp, gltrtp[(trtp.work - 1)][0],
                 batch.disp, detail.disp, dbt.disp, crt.disp, w1.disp))
             self.pglin += 1
         if self.pages == "Y" and (acctot or trn):
             self.pglin = 999
     p.closeProgress()
     if p.quit or not self.fpdf.page:
         return
     if "args" not in self.opts or "noprint" not in self.opts["args"]:
         pdfnam = getModName(self.opts["mf"].rcdic["wrkdir"],
                             self.__class__.__name__,
                             self.opts["conum"],
                             ext="pdf")
         self.fpdf.output(pdfnam, "F")
         doPrinter(mf=self.opts["mf"],
                   conum=self.opts["conum"],
                   pdfnam=pdfnam,
                   header=self.tit,
                   repprt=self.df.repprt,
                   repeml=self.df.repeml)
Beispiel #13
0
 def exportReport(self, recs):
     p = ProgressBar(self.opts["mf"].body, mxs=len(recs), esc=True)
     expnam = getModName(self.opts["mf"].rcdic["wrkdir"],
                         self.__class__.__name__, self.opts["conum"])
     self.expheads = [self.head + " %s" % self.sysdttm]
     self.expheads.append("Stock to Order Report as at %s" % self.sysdtd)
     self.expheads.append("(Options: Report Date %s)" % self.repdtd)
     self.expheads.append("Location %s  %s" % (self.loc, self.locd))
     self.expcolsh = [self.colsh]
     self.expforms = self.forms
     self.expdatas = []
     for num, dat in enumerate(recs):
         p.displayProgress(num)
         if p.quit:
             p.closeProgress()
             return
         vals = self.getValues(dat)
         if not vals:
             continue
         self.expdatas.append([
             "BODY",
             [
                 vals[0].work, vals[1].work, vals[2].work, vals[3].work,
                 vals[4].work, vals[5].work, vals[6].work, vals[7].work
             ]
         ])
     p.closeProgress()
     doWriteExport(xtype=self.df.repprt[1],
                   name=expnam,
                   heads=self.expheads,
                   colsh=self.expcolsh,
                   forms=self.expforms,
                   datas=self.expdatas,
                   rcdic=self.opts["mf"].rcdic)
Beispiel #14
0
 def setVariables(self):
     self.sql = Sql(self.opts["mf"].dbm, [
         "ctlvrf", "strloc", "strgrp", "strgmu", "strcmu", "strprc",
         "strmf1", "strmf2", "strtrn"
     ],
                    prog=self.__class__.__name__)
     if self.sql.error:
         return
     gc = GetCtl(self.opts["mf"])
     strctl = gc.getCtl("strctl", self.opts["conum"])
     if not strctl:
         return
     self.locs = strctl["cts_locs"]
     self.plevs = strctl["cts_plevs"]
     self.fromad = strctl["cts_emadd"]
     t = time.localtime()
     self.sysdtw = (t[0] * 10000) + (t[1] * 100) + t[2]
     self.sysdtd = "%i/%02i/%02i" % (t[0], t[1], t[2])
     self.sysdttm = "(Printed on: %i/%02i/%02i at %02i:%02i) %6s" % (
         t[0], t[1], t[2], t[3], t[4], self.__class__.__name__)
     self.stot = [0] * 6
     self.gtot = [0] * 6
     self.pdfnam = getModName(self.opts["mf"].rcdic["wrkdir"],
                              self.__class__.__name__,
                              self.opts["conum"],
                              ext="pdf")
     return True
Beispiel #15
0
 def exportReport(self, recs):
     p = ProgressBar(self.opts["mf"].body, mxs=len(recs), esc=True)
     expnam = getModName(self.opts["mf"].rcdic["wrkdir"],
                         self.__class__.__name__, self.opts["conum"])
     expheads = [
         "%03u %-30s %s %6s" % (self.opts["conum"], self.opts["conam"],
                                self.sysdttm, self.__class__.__name__)
     ]
     expheads.append("Debtors Master Code List as at %s" % self.sysdtd)
     expcolsh = [self.colsh]
     expforms = self.forms
     expdatas = []
     for num, dat in enumerate(recs):
         p.displayProgress(num)
         if p.quit:
             p.closeProgress()
             return
         vals = self.getValues(dat)
         expdatas.append([
             "BODY",
             [
                 vals[0].work, vals[1].work, vals[2].work, vals[3].work,
                 vals[4].work, vals[5].work, vals[6].work, vals[7].work,
                 vals[8].work, vals[9].work, vals[10].work, vals[11].work,
                 vals[12].work, vals[13].work, vals[14].work, vals[15].work
             ]
         ])
     p.closeProgress()
     doWriteExport(xtype=self.df.repprt[1],
                   name=expnam,
                   heads=expheads,
                   colsh=expcolsh,
                   forms=expforms,
                   datas=expdatas,
                   rcdic=self.opts["mf"].rcdic)
Beispiel #16
0
 def printReport(self, recs):
     p = ProgressBar(self.opts["mf"].body, mxs=len(recs), esc=True)
     self.head = "%03u %-95s" % (self.opts["conum"], self.opts["conam"])
     self.fpdf = MyFpdf(name=self.__class__.__name__, head=self.head)
     self.tots = [0, 0]
     self.pglin = 999
     for num, dat in enumerate(recs):
         p.displayProgress(num)
         if p.quit:
             break
         chn = CCD(dat[self.col.index("drm_chain")], "UI", 3)
         acno = CCD(dat[self.col.index("drm_acno")], "NA", 7)
         name = CCD(dat[self.col.index("drm_name")], "NA", 30)
         rft = CCD(dat[self.col.index("drm_rfterms")], "UI", 3)
         per = CCD(dat[self.col.index("drm_int_per")], "UD", 5.2)
         if not per.work:
             if not self.defrte:
                 continue
             per = CCD(self.defrte, "UD", 5.2)
         bals = Balances(self.opts["mf"], "DRS", self.opts["conum"],
                         int(self.cutoff / 100), (chn.work, acno.work))
         obal, tbal, ages = bals.doAllBals()
         if tbal <= 0:
             continue
         bal = CCD(tbal, "SD", 13.2)
         tm = int(rft.work / 30)
         if tm > 4:
             tm = 4
         od = 0
         for x in range(tm, 5):
             od = float(ASD(od) + ASD(ages[x]))
         odu = CCD(od, "SD", 13.2)
         if odu.work <= 0 or (self.minbal and odu.work < self.minbal):
             continue
         b = round((odu.work * per.work / 1200), 2)
         amt = CCD(b, "SD", 13.2)
         if self.pglin > self.fpdf.lpp:
             self.pageHeading()
         self.fpdf.drawText("%s %s %s %s %s %s       %s %s" % \
             (chn.disp, acno.disp, name.disp, rft.disp, bal.disp,
             odu.disp, per.disp, amt.disp))
         self.pglin += 1
         self.tots[0] = float(ASD(self.tots[0]) + ASD(odu.work))
         self.tots[1] = float(ASD(self.tots[1]) + ASD(amt.work))
     p.closeProgress()
     if self.fpdf.page and not p.quit:
         self.grandTotal()
         pdfnam = getModName(self.opts["mf"].rcdic["wrkdir"],
                             self.__class__.__name__,
                             self.opts["conum"],
                             ext="pdf")
         self.fpdf.output(pdfnam, "F")
         doPrinter(mf=self.opts["mf"],
                   conum=self.opts["conum"],
                   pdfnam=pdfnam,
                   header=self.tit,
                   repprt=self.df.repprt,
                   fromad=self.fromad,
                   repeml=self.df.repeml)
Beispiel #17
0
 def doEnd(self):
     self.df.closeProcess()
     self.prnt = False
     whr = [("mlm_cono", "=", self.opts["conum"])]
     if self.state != "Z":
         if self.state == "R" and self.cat:
             whr.append(("mlm_state", "in", ("A", "R")))
         else:
             whr.append(("mlm_state", "=", self.state))
     tab = ["memmst"]
     if self.cat:
         tab.append("memcat")
         whr.append(("mlc_cono=mlm_cono", ))
         whr.append(("mlc_memno=mlm_memno", ))
         whr.append(("mlc_type", "=", self.cat))
         if self.cod:
             whr.append(("mlc_code", "=", self.cod))
         if self.state == "A":
             whr.append(("mlc_end", "=", 0))
         grp = self.sql.memmst_col[0]
         for c in self.sql.memmst_col[1:]:
             grp = "%s, %s" % (grp, c)
     else:
         grp = None
     if self.sort == "N":
         odr = "mlm_memno"
     elif self.sort == "M":
         odr = "mlm_name"
     else:
         odr = "mlm_pcod"
     rec = self.sql.getRec(tables=tab,
                           cols=self.sql.memmst_col,
                           where=whr,
                           group=grp,
                           order=odr)
     if not rec:
         showError(self.opts["mf"].body, "Error", "No Accounts Selected")
     else:
         self.fpdf = TartanLabel(self.label, posY=self.srow, posX=self.scol)
         self.fpdf.add_page()
         p = ProgressBar(self.opts["mf"].body, mxs=len(rec), esc=True)
         for num, dat in enumerate(rec):
             p.displayProgress(num)
             if p.quit:
                 break
             self.doProcess(dat)
         p.closeProgress()
         if self.fpdf.page and not p.quit:
             pdfnam = getModName(self.opts["mf"].rcdic["wrkdir"],
                                 self.__class__.__name__,
                                 self.opts["conum"],
                                 ext="pdf")
             self.fpdf.output(pdfnam, "F")
             doPrinter(mf=self.opts["mf"],
                       conum=self.opts["conum"],
                       pdfnam=pdfnam,
                       header=self.tit,
                       repprt=self.df.repprt)
     self.closeProcess()
Beispiel #18
0
 def printReport(self, recs):
     p = ProgressBar(self.opts["mf"].body, mxs=len(recs), esc=True)
     self.head = "%03u %-86s" % (self.opts["conum"], self.opts["conam"])
     self.fpdf = MyFpdf(name=self.__class__.__name__, head=self.head)
     self.bqty = 0
     self.bdrs = 0
     self.bcrs = 0
     self.tqty = 0
     self.tdrs = 0
     self.tcrs = 0
     self.trtp = 0
     self.pglin = 999
     for num, dat in enumerate(recs):
         p.displayProgress(num)
         if p.quit:
             break
         vals = self.getValues(dat)
         if not vals:
             continue
         acno, loan, batch, trtp, trdt, ref, drs, crs, desc = vals
         if not self.trtp:
             self.trtp = trtp.work
             self.batch = batch.work
         if trtp.work != self.trtp and self.trtp < 4:
             self.batchTotal()
             self.typeTotal()
             self.trtp = trtp.work
             self.batch = batch.work
             self.pglin = 999
         if batch.work != self.batch:
             self.batchTotal()
             self.batch = batch.work
             if self.totsonly == "N":
                 self.typeHeading()
         if self.pglin > self.fpdf.lpp:
             self.pageHeading()
         if self.totsonly == "N":
             self.fpdf.drawText("%s %s %s %s %s %s %s" % (acno.disp,
                 loan.disp, ref.disp, trdt.disp, desc.disp, drs.disp,
                 crs.disp))
             self.pglin += 1
         self.bqty = self.bqty + 1
         self.bdrs = float(ASD(self.bdrs) + ASD(drs.work))
         self.bcrs = float(ASD(self.bcrs) + ASD(crs.work))
         self.tqty = self.tqty + 1
         self.tdrs = float(ASD(self.tdrs) + ASD(drs.work))
         self.tcrs = float(ASD(self.tcrs) + ASD(crs.work))
     p.closeProgress()
     if self.fpdf.page and not p.quit:
         self.batchTotal()
         self.typeTotal()
         self.grandTotal()
         pdfnam = getModName(self.opts["mf"].rcdic["wrkdir"],
             self.__class__.__name__, self.opts["conum"], ext="pdf")
         self.fpdf.output(pdfnam, "F")
         doPrinter(mf=self.opts["mf"], conum=self.opts["conum"],
             pdfnam=pdfnam, header=self.tit, repprt=self.df.repprt,
             fromad=self.fromad, repeml=self.df.repeml)
Beispiel #19
0
 def exportReport(self, recs):
     p = ProgressBar(self.opts["mf"].body, mxs=len(recs), esc=True)
     expnam = getModName(self.opts["mf"].rcdic["wrkdir"],
                         self.__class__.__name__, self.opts["conum"])
     self.expheads = [self.head + " %s" % self.sysdttm]
     self.expheads.append("Asset Register Report as at %s" % self.sysdtd)
     self.expheads.append("Options: Report Period: %s Report Type: %s" % \
         (self.df.t_disp[0][0][0], self.typ))
     self.expcolsh = [self.colsh]
     self.expforms = self.forms
     self.expdatas = []
     for seq, dat in enumerate(recs):
         p.displayProgress(seq)
         if p.quit:
             p.closeProgress()
             return
         if not seq:
             desc = self.groupDesc(dat[0])
             self.expdatas.append(
                 ["HEAD", ["", "Group %s %s" % (dat[0], desc)]])
             self.expdatas.append(["BLANK"])
         vals = self.getValues(dat)
         if not vals:
             continue
         pdte = self.sql.getRec("asstrn",
                                cols=["min(ast_date)"],
                                where=[("ast_cono", "=",
                                        self.opts["conum"]),
                                       ("ast_group", "=", dat[0]),
                                       ("ast_code", "=", dat[1]),
                                       ("ast_mtyp", "=", 1)],
                                limit=1)
         pdte = CCD(pdte[0], "d1", 10).work
         if self.oldgrp and self.oldgrp != dat[0]:
             self.groupTotal()
             self.expdatas.append(["BLANK"])
             desc = self.groupDesc(dat[0])
             self.expdatas.append(
                 ["HEAD", ["", "Group %s %s" % (dat[0], desc)]])
             self.expdatas.append(["BLANK"])
         line = ["BODY", [dat[1], dat[2], pdte]]
         for num, val in enumerate(vals):
             line[1].append(val)
             self.stot[num] = float(ASD(self.stot[num]) + ASD(val))
             self.gtot[num] = float(ASD(self.gtot[num]) + ASD(val))
         self.expdatas.append(line)
         self.oldgrp = dat[0]
     p.closeProgress()
     self.groupTotal()
     self.grandTotal()
     doWriteExport(xtype=self.df.repprt[1],
                   name=expnam,
                   heads=self.expheads,
                   colsh=self.expcolsh,
                   forms=self.expforms,
                   datas=self.expdatas,
                   rcdic=self.opts["mf"].rcdic)
Beispiel #20
0
 def exportReport(self, recs):
     p = ProgressBar(self.opts["mf"].body, mxs=len(recs), esc=True)
     expnam = getModName(self.opts["mf"].rcdic["wrkdir"],
                         self.__class__.__name__, self.opts["conum"])
     self.expheads = [self.head + " %s" % self.sysdttm]
     self.expheads.append("General Ledger Account Statements for Period "\
         "%s to %s" % (self.sdate.disp, self.edate.disp))
     self.expcolsh = [self.colsh]
     self.expforms = self.forms
     self.expdatas = []
     for num, dat in enumerate(recs):
         p.displayProgress(num)
         if p.quit:
             p.closeProgress()
             return
         self.acno, self.desc, acctot = self.getAccValues(dat)
         trn = self.sql.getRec("gentrn", where=[("glt_cono", "=",
             dat[0]), ("glt_acno", "=", dat[1]), ("glt_curdt", ">=",
             self.sdate.work), ("glt_curdt", "<=", self.edate.work)],
             order="glt_acno, glt_curdt, glt_trdt, glt_type, glt_refno, "\
             "glt_batch")
         if self.pages == "Y" and (acctot or trn):
             self.expdatas.append(["PAGE", [self.expheads, self.expcolsh]])
         prt = False
         if acctot:
             prt = True
             self.expdatas.append([
                 "BODY",
                 [
                     self.opts["conum"], self.acno.work, self.desc.work,
                     ((self.sdate.work * 100) + 1), "", "", "",
                     "Opening Balance", "", "", acctot
                 ]
             ])
         for acc in trn:
             prt = True
             trdt, refno, trtp, batch, amt, dbt, crt, detail, curdt, \
                 curmth = self.getTrnValues(acc)
             acctot = float(ASD(acctot) + ASD(amt.work))
             self.expdatas.append([
                 "BODY",
                 [
                     self.opts["conum"], self.acno.work, self.desc.work,
                     trdt.work, refno.work, gltrtp[(trtp.work - 1)][0],
                     batch.work, detail.work, dbt.work, crt.work, acctot
                 ]
             ])
         if self.pages == "N" and prt:
             self.expdatas.append(["BLANK"])
     p.closeProgress()
     doWriteExport(xtype=self.df.repprt[1],
                   name=expnam,
                   heads=self.expheads,
                   colsh=self.expcolsh,
                   forms=self.expforms,
                   datas=self.expdatas,
                   rcdic=self.opts["mf"].rcdic)
Beispiel #21
0
 def printReport(self, recs):
     p = ProgressBar(self.opts["mf"].body, mxs=len(recs), esc=True)
     self.head = "%03u %-91s" % (self.opts["conum"], self.opts["conam"])
     self.fpdf = MyFpdf(name=self.__class__.__name__, head=self.head)
     self.btot = [0, 0]
     self.pglin = 999
     bc = self.sql.ctlbat_col
     tc = self.sql.asstrn_col
     for num, dat in enumerate(recs):
         p.displayProgress(num)
         if p.quit:
             break
         self.rtyp = CCD(dat[bc.index("btm_rtyp")], "UI", 1)
         self.batno = CCD(dat[bc.index("btm_batno")], "Na", 7)
         self.curdt = CCD(dat[bc.index("btm_curdt")], "D2", 7)
         self.multi = CCD(dat[bc.index("btm_multi")], "UA", 1)
         self.trno = CCD(dat[bc.index("btm_trno")], "UI", 7)
         self.trval = CCD(dat[bc.index("btm_trval")], "SD", 13.2)
         whr = [
             ("ast_cono", "=", self.opts["conum"]),
             ("ast_type", "=", self.rtyp.work),
             ("ast_batch", "=", self.batno.work),
             ("ast_batind", "=", "N")]
         odr = "ast_seq"
         trndat = self.sql.getRec("asstrn", where=whr, order=odr)
         if not trndat:
             continue
         if self.pglin > self.fpdf.lpp:
             self.pageHeading()
         else:
             self.batchHeading()
         for trn in trndat:
             grp = CCD(trn[tc.index("ast_group")], "UA", 3)
             code = CCD(trn[tc.index("ast_code")], "Na", 7)
             refno = CCD(trn[tc.index("ast_refno")], "Na", 9)
             mtyp = CCD(trn[tc.index("ast_mtyp")], "UI", 1)
             trdt = CCD(trn[tc.index("ast_date")], "D1", 10)
             desc = CCD(trn[tc.index("ast_desc")], "NA", 30)
             amt1 = CCD(trn[tc.index("ast_amt1")], "SD", 13.2)
             vat = CCD(trn[tc.index("ast_vat")], "SD", 13.2)
             taxind = CCD(trn[tc.index("ast_taxind")], "NA", 1)
             if self.pglin > self.fpdf.lpp:
                 self.pageHeading()
             self.fpdf.drawText("%s %s %s %s %s %s %s %s %s" % (grp.disp,
                 code.disp, refno.disp, trdt.disp, desc.disp, mtyp.disp,
                 amt1.disp, vat.disp, taxind.disp))
             self.btot[0] += 1
             self.btot[1] = float(ASD(self.btot[1]) + ASD(amt1.work))
             self.pglin += 1
         self.batchTotal()
     p.closeProgress()
     if self.fpdf.page and not p.quit:
         pdfnam = getModName(self.opts["mf"].rcdic["wrkdir"],
             self.__class__.__name__, self.opts["conum"], ext="pdf")
         self.fpdf.output(pdfnam, "F")
         doPrinter(mf=self.opts["mf"], conum=self.opts["conum"],
             pdfnam=pdfnam, header=self.tit, repprt=self.df.repprt)
Beispiel #22
0
 def printReport(self):
     p = ProgressBar(self.opts["mf"].body,
         mxs=(len(self.pays) + len(self.recs) + len(self.imps)))
     self.head = "%03u %-30s" % (self.opts["conum"], self.opts["conam"])
     self.fpdf = MyFpdf(name=self.__class__.__name__, head=90)
     self.pglin = 999
     self.tot_chq = 0
     self.tot_dep = 0
     self.tot_imp = 0
     self.pageHeading()
     bal = CCD(self.bal, "SD", 13.2)
     self.fpdf.drawText("%-71s %-13s" % ("Balance as per Cash Book",
         bal.disp))
     if self.pays:
         self.fpdf.drawText()
         self.fpdf.drawText("%-70s" % ("Add: Cheques Not Presented",))
         self.fpdf.drawText()
         self.pglin += 4
         mxs = len(self.pays) - 1
         for num, pay in enumerate(self.pays):
             p.displayProgress(num)
             self.printLine(num, mxs, pay, "C")
         self.pglin += 1
     if self.recs:
         self.fpdf.drawText()
         self.fpdf.drawText("%-70s" % ("Less: Deposits Not Presented",))
         self.fpdf.drawText()
         self.pglin += 3
         mxs = len(self.recs) - 1
         for num, rec in enumerate(self.recs):
             p.displayProgress(len(self.pays) + num)
             self.printLine(num, mxs, rec, "D")
     # Bank Imports
     if self.imps:
         self.fpdf.drawText()
         self.fpdf.drawText("%-70s" % ("+-: Imports Not Captured",))
         self.fpdf.drawText()
         self.pglin += 3
         mxs = len(self.imps) - 1
         for num, rec in enumerate(self.imps):
             p.displayProgress(len(self.pays) + len(self.imps) + num)
             self.printLine(num, mxs, rec, "I")
     p.closeProgress()
     self.fpdf.underLine(txt="%72s%12s" % ("", 12 * self.fpdf.suc))
     b = float(ASD(self.bal) + ASD(self.tot_chq) - ASD(self.tot_dep) + \
         ASD(self.tot_imp))
     bal = CCD(b, "SD", 13.2)
     self.fpdf.drawText("%-71s %-13s" % ("Balance as per Bank Statement",
         bal.disp))
     pdfnam = getModName(self.opts["mf"].rcdic["wrkdir"],
         self.__class__.__name__, self.opts["conum"], ext="pdf")
     self.fpdf.output(pdfnam, "F")
     doPrinter(mf=self.opts["mf"], conum=self.opts["conum"],
         pdfnam=pdfnam, header=self.tit, repprt=self.df.repprt,
         repeml=self.df.repeml)
Beispiel #23
0
 def doPrintOption(self, opt):
     if opt == "N":
         return
     pdfnam = getModName(self.opts["mf"].rcdic["wrkdir"],
                         self.__class__.__name__,
                         self.opts["conum"],
                         ext="pdf")
     if self.rordp == "Y":
         self.head = "%03u %-93s" % (self.opts["conum"], self.opts["conam"])
     else:
         self.head = "%03u %-77s" % (self.opts["conum"], self.opts["conam"])
     self.fpdf = MyFpdf(name=self.__class__.__name__, head=self.head)
     self.pglin = 999
     if opt != "T":
         self.pageHeading()
         self.printInfo()
     if opt == "B":
         self.fpdf.output(pdfnam, "F")
         doPrinter(mf=self.opts["mf"],
                   conum=self.opts["conum"],
                   pdfnam=pdfnam,
                   header=self.tit,
                   repprt=["N", "V", "view"])
     elif opt == "A":
         dat, atc, col = self.getTrans()
         if not dat:
             self.fpdf.output(pdfnam, "F")
             doPrinter(mf=self.opts["mf"],
                       conum=self.opts["conum"],
                       pdfnam=pdfnam,
                       header=self.tit,
                       repprt=["N", "V", "view"])
         else:
             self.pageHeading()
             self.pageHeadingTrans()
             self.printTrans(dat, atc)
             self.fpdf.output(pdfnam, "F")
             doPrinter(mf=self.opts["mf"],
                       conum=self.opts["conum"],
                       pdfnam=pdfnam,
                       header=self.tit,
                       repprt=["N", "V", "view"])
     elif opt == "T":
         dat, atc, col = self.getTrans()
         if dat:
             self.pageHeading()
             self.pageHeadingTrans()
             self.printTrans(dat, atc)
             self.fpdf.output(pdfnam, "F")
             doPrinter(mf=self.opts["mf"],
                       conum=self.opts["conum"],
                       pdfnam=pdfnam,
                       header=self.tit,
                       repprt=["N", "V", "view"])
Beispiel #24
0
 def printReport(self, recs):
     p = ProgressBar(self.opts["mf"].body, mxs=len(recs), esc=True)
     self.head = "%03u %-71s" % (self.opts["conum"], self.opts["conam"])
     self.fpdf = MyFpdf(name=self.__class__.__name__, head=self.head)
     oldrec = ""
     self.pglin = 999
     st1 = self.sql.strmf1_col
     srr = self.sql.strrcp_col
     for num, dat in enumerate(recs):
         p.displayProgress(num)
         if p.quit:
             break
         grp = CCD(dat[st1.index("st1_group")], "UA", 3)
         cod = CCD(dat[st1.index("st1_code")], "NA", 20)
         dsc = CCD(dat[st1.index("st1_desc")], "NA", 30)
         whr = [
             ("srr_cono", "=", self.opts["conum"]),
             ("srr_group", "=", grp.work),
             ("srr_code", "=", cod.work)]
         if self.locs == "Y":
             whr.append(("srr_loc", "=", self.loc))
         odr = "srr_rgroup, srr_rcode"
         rec = self.sql.getRec("strrcp", where=whr, order=odr)
         if not rec:
             continue
         newrec = "%s%s" % (grp.work, cod.work)
         if oldrec and newrec != oldrec:
             self.pageHeading(grp, cod, dsc, chg=True)
         for z in rec:
             if self.pglin > self.fpdf.lpp:
                 self.pageHeading(grp, cod, dsc)
             gp = CCD(z[srr.index("srr_rgroup")], "UA", 3)
             cd = CCD(z[srr.index("srr_rcode")],  "NA", 20)
             qt = CCD(z[srr.index("srr_rqty")], "UD", 11.2)
             dd = self.sql.getRec("strmf1", cols=["st1_desc"],
                 where=[("st1_cono", "=", self.opts["conum"]), ("st1_group",
                 "=", gp.work), ("st1_code", "=", cd.work)], limit=1)
             if dd:
                 dc = dd[0]
             else:
                 dc = ""
             self.fpdf.drawText("%s %s %-38s %s" % (gp.disp, cd.disp, dc,
                 qt.disp))
             self.pglin += 1
             oldrec = newrec
     p.closeProgress()
     if self.fpdf.page and not p.quit:
         pdfnam = getModName(self.opts["mf"].rcdic["wrkdir"],
             self.__class__.__name__, self.opts["conum"], ext="pdf")
         self.fpdf.output(pdfnam, "F")
         doPrinter(mf=self.opts["mf"], conum=self.opts["conum"],
             pdfnam=pdfnam, header=self.tit, repprt=self.df.repprt,
             fromad=self.fromad, repeml=self.df.repeml)
Beispiel #25
0
 def printReport(self, recs):
     p = ProgressBar(self.opts["mf"].body, mxs=len(recs), esc=True)
     chrs = len(self.colsh)
     for f in self.forms:
         chrs += int(f[1])
     if f[0][0].lower() == "s":
         chrs -= 2
     else:
         chrs -= 1
     self.head1 = self.head
     self.head2 = "Debtor's Age Analysis up to %s" % self.opts["period"]
     pad = chrs - len(self.head2)
     self.head2 = self.head2 + (" " * pad)
     pdfnam = getModName(self.opts["mf"].rcdic["wrkdir"],
                         self.__class__.__name__,
                         self.opts["conum"],
                         ext="pdf")
     self.fpdf = MyFpdf(name=self.__class__.__name__, head=self.head2)
     self.pglin = 999
     for num, dat in enumerate(recs):
         p.displayProgress(num)
         if p.quit:
             if self.fpdf.page:
                 self.fpdf.drawText()
                 self.fpdf.drawText("Print Job ABORTED")
             break
         vals = self.getValues(dat)
         if not vals:
             continue
         if self.totsonly != "Y":
             if self.pglin > self.fpdf.lpp:
                 self.pageHeading()
             self.fpdf.drawText("%s %s %s %s %s %s %s %s %s %s" % \
                 (vals[0].disp, vals[1].disp, vals[2].disp, vals[3].disp,
                 vals[4].disp, vals[5].disp, vals[6].disp, vals[7].disp,
                 vals[8].disp, vals[9].disp))
             self.pglin += 1
     p.closeProgress()
     if p.quit:
         return
     if self.totsonly == "Y":
         self.pageHeading()
     if self.fpdf.page:
         self.grandTotal()
         if "args" not in self.opts or "noprint" not in self.opts["args"]:
             self.fpdf.output(pdfnam, "F")
             doPrinter(mf=self.opts["mf"],
                       conum=self.opts["conum"],
                       pdfnam=pdfnam,
                       header=self.tit,
                       repprt=self.df.repprt,
                       fromad=self.fromad,
                       repeml=self.df.repeml)
Beispiel #26
0
 def doPrintOption(self, opt):
     if opt == "N":
         return
     self.head = "%03u %-110s" % (self.opts["conum"], self.opts["conam"])
     self.fpdf = MyFpdf(name=self.__class__.__name__, head=self.head)
     self.pglin = 999
     if opt != "T":
         self.pageHeading()
         self.printInfo()
     pdfnam = getModName(self.opts["mf"].rcdic["wrkdir"],
                         self.__class__.__name__,
                         self.opts["conum"],
                         ext="pdf")
     if opt == "I":
         self.fpdf.output(pdfnam, "F")
         doPrinter(mf=self.opts["mf"],
                   conum=self.opts["conum"],
                   pdfnam=pdfnam,
                   header=self.tit,
                   repprt=["N", "V", "view"])
     elif opt == "B":
         self.wagtrn = self.doGetTrans()
         if not self.wagtrn:
             self.fpdf.output(pdfnam, "F")
             doPrinter(mf=self.opts["mf"],
                       conum=self.opts["conum"],
                       pdfnam=pdfnam,
                       header=self.tit,
                       repprt=["N", "V", "view"])
         else:
             self.pageHeading()
             self.pageHeadingTrans()
             self.printTrans()
             self.fpdf.output(pdfnam, "F")
             doPrinter(mf=self.opts["mf"],
                       conum=self.opts["conum"],
                       pdfnam=pdfnam,
                       header=self.tit,
                       repprt=["N", "V", "view"])
     elif opt == "T":
         self.wagtrn = self.doGetTrans()
         if self.wagtrn:
             self.pageHeading()
             self.pageHeadingTrans()
             self.printTrans()
             self.fpdf.output(pdfnam, "F")
             doPrinter(mf=self.opts["mf"],
                       conum=self.opts["conum"],
                       pdfnam=pdfnam,
                       header=self.tit,
                       repprt=["N", "V", "view"])
Beispiel #27
0
 def doPrint(self):
     pdfnam = getModName(self.opts["mf"].rcdic["wrkdir"],
                         self.__class__.__name__,
                         self.opts["conum"],
                         ext="pdf")
     self.fpdf.output(pdfnam, "F")
     doPrinter(mf=self.opts["mf"],
               conum=self.opts["conum"],
               pdfnam=pdfnam,
               header="%s Loan Statement at %s" %
               (self.opts["conam"], self.dated),
               fromad=self.fromad,
               repprt=self.df.repprt,
               repeml=self.df.repeml)
Beispiel #28
0
 def doPrint(self):
     if not self.fpdf.page:
         return
     if self.df.repeml[1] == "Y":
         self.df.repeml[2] = self.emadd.work
         key = "%s_%s_%s" % (self.opts["conum"], self.chain, self.acno)
     else:
         key = "%s_all_all" % self.opts["conum"]
     pdfnam = getModName(self.opts["mf"].rcdic["wrkdir"],
         self.__class__.__name__, key, ext="pdf")
     self.fpdf.output(pdfnam, "F")
     doPrinter(mf=self.opts["mf"], conum=self.opts["conum"], pdfnam=pdfnam,
         header="%s Invoice" % self.opts["conam"], repprt=self.df.repprt,
         fromad=self.fromad, repeml=self.df.repeml)
Beispiel #29
0
 def exportReport(self, recs):
     p = ProgressBar(self.opts["mf"].body, mxs=len(recs), esc=True)
     expnam = getModName(self.opts["mf"].rcdic["wrkdir"],
                         self.__class__.__name__, self.opts["conum"])
     self.expheads = [
         "%03u %-30s %s" %
         (self.opts["conum"], self.opts["conam"], self.sysdttm)
     ]
     self.expheads.append("Outstanding Sales Orders Report as at %s" % \
         self.sysdtd)
     self.expcolsh = [[
         "Order-Num", "Order-Date", "Chn", "Acc-Num", "Name", "Rep",
         "Rep-Name", "Job-Num", "Taxable", "Non-Taxable", "Total-Tax",
         "Total-Value"
     ]]
     if self.rtype == "L" and self.content == "D":
         self.expcolsh[0][6] = "Delivery-Address"
     self.expforms = [("Na", 9), ("D1", 10), ("UI", 3), ("NA", 7),
                      ("NA", 30), ("Na", 3), ("NA", 30), ("Na", 7),
                      ("SD", 13.2), ("SD", 13.2), ("SD", 13.2),
                      ("SD", 13.2)]
     self.expdatas = []
     for num, dat in enumerate(recs):
         p.displayProgress(num)
         if p.quit:
             p.closeProgress()
             return
         if not self.getValues(dat):
             continue
         self.getOrdTot()
         self.expdatas.append([
             "BODY",
             [
                 self.odr.work, self.dte.work, self.chn.work, self.drs.work,
                 self.drsnam, self.rep.work, self.context, self.job.work,
                 self.total_taxable, self.total_nontaxable, self.total_tax,
                 self.total_value
             ]
         ])
     self.expdatas.append(["BLANK"])
     self.expdatas.append(["TOTAL", [""] * 8 + self.slstot])
     p.closeProgress()
     doWriteExport(xtype=self.df.repprt[1],
                   name=expnam,
                   heads=self.expheads,
                   colsh=self.expcolsh,
                   forms=self.expforms,
                   datas=self.expdatas,
                   rcdic=self.opts["mf"].rcdic)
Beispiel #30
0
 def printReport(self, recs):
     p = ProgressBar(self.opts["mf"].body, mxs=len(recs), esc=True)
     self.head = "%03u %-182s" % (self.opts["conum"], self.opts["conam"])
     self.fpdf = MyFpdf(name=self.__class__.__name__, head=self.head)
     self.pglin = 999
     self.lstgrp = ""
     for num, dat in enumerate(recs):
         p.displayProgress(num)
         if p.quit:
             break
         vals = self.getValues(dat)
         if not vals:
             continue
         cod, dsc, uoi, amt, purchd, purchw = vals
         if self.pglin > self.fpdf.lpp:
             self.pageHeading()
         self.fpdf.drawText(
             "%s %s %s %s %s" %
             (self.grp.disp, cod.disp, dsc.disp, uoi.disp, purchd))
         self.pglin += 1
         self.lstgrp = self.grp.work
     p.closeProgress()
     if not self.fpdf.page or p.quit:
         return
     self.groupTotal()
     self.grandTotal()
     if "args" in self.opts and "noprint" in self.opts["args"]:
         return
     pdfnam = getModName(self.opts["mf"].rcdic["wrkdir"],
                         self.__class__.__name__,
                         self.opts["conum"],
                         ext="pdf")
     self.fpdf.output(pdfnam, "F")
     doPrinter(mf=self.opts["mf"],
               conum=self.opts["conum"],
               pdfnam=pdfnam,
               header=self.tit,
               repprt=self.df.repprt,
               fromad=self.fromad,
               repeml=self.df.repeml)
     if self.df.repprt[1] == "X" or not self.tipe:
         return
     CreateChart(self.opts["mf"],
                 self.opts["conum"],
                 self.opts["conam"], [self.start, self.coffw],
                 [[self.opts["conam"], "Product Sales History"], self.tipe],
                 None,
                 self.mchart,
                 ylab=self.tipe)