def doTrans2(self, frt, pag, r, c, p, i, w): self.history = w tit = "Transactions for Loan: %s %s - %s" % \ (self.empno, self.name, self.desc) tab = ["wagltf"] col = (("wlt_trdt", "", 0, " Date"), ("wlt_batch", "", 0, "Batch"), ("wlt_type", ("XX", sltrtp), 3, "Typ"), ("wlt_ref", "", 0, "Reference", "Y"), ("wlt_per", "", 0, " Int-%"), ("wlt_amt", "", 0, " Amount"), ("wlt_ded", "", 0, " Deduction"), ("wlt_desc", "", 0, "Remarks")) whr = [ ("wlt_cono", "=", self.opts["conum"]), ("wlt_empno", "=", self.empno), ("wlt_loan", "=", self.loan)] if self.history == "N": whr.append(("wlt_curdt", ">=", int(self.opts["period"] / 100))) odr = "wlt_trdt, wlt_type, wlt_ref" state = self.df.disableButtonsTags() SRec(self.opts["mf"], screen=self.df.nb.Page2, title=tit, tables=tab, cols=col, where=whr, order=odr) self.df.enableButtonsTags(state=state) self.df.focusField("T", 2, 1)
def doTrans2(self, frt, pag, r, c, p, i, w): tit = "Transactions for Account: %s %s - %s" % \ (self.code, self.acno, self.name) tab = ["rtltrn"] col = (("rtt_trdt", "", 0, " Date"), ("rtt_curdt", "", 0, "Curr-Dt"), ("rtt_batch", "", 0, "Batch"), ("rtt_type", ("XX", rttrtp), 3, "Typ"), ("rtt_refno", "", 0, "Reference", "Y"), ("rtt_tramt", "", 0, " Amount"), ("rtt_taxamt", "", 0, " VAT-Amount"), ("rtt_desc", "", 0, "Details")) whr = [("rtt_cono", "=", self.opts["conum"]), ("rtt_code", "=", self.code), ("rtt_acno", "=", self.acno)] if w: whr.append(("rtt_cnum", "=", w)) odr = "rtt_trdt, rtt_type" state = self.df.disableButtonsTags() SRec(self.opts["mf"], screen=self.df.nb.Page2, title=tit, tables=tab, cols=col, where=whr, order=odr) self.df.enableButtonsTags(state=state) self.doTrans1()
def doTrans(self, frt, pag, r, c, p, i, w): self.startt = (((w - 1) * 10000) + 301) if not w % 4: self.endt = ((w * 10000) + 229) else: self.endt = ((w * 10000) + 228) tit = "Transactions for Employee: %s - %s %s" % \ (self.empno, self.fname, self.sname) tab = ["wagtf1"] wcp = (("wt1_date", "", 0, "Date"), ("wt1_page", "", 0, "Number"), ("wt1_nhrs", "", 13.2, "Norm-Hrs"), ("wt1_npay", "", 13.2, "Norm-Pay"), ("wt1_taxbl", "", 13.2, "Tx-Pay"), ("wt1_notax", "", 13.2, "Non-Tx-Pay"), ("wt1_taxdd", "", 13.2, "Tx-Ded"), ("wt1_nondd", "", 13.2, "Non-Tx-Ded")) whr = [("wt1_cono", "=", self.opts["conum"]), ("wt1_empno", "=", self.empno), ("wt1_date", "between", self.startt, self.endt)] odr = "wt1_date" state = self.df.disableButtonsTags() SRec(self.opts["mf"], screen=self.df.nb.Page7, title=tit, tables=tab, cols=wcp, where=whr, order=odr) self.df.enableButtonsTags(state=state) self.doTaxYear()
def doRecipe(self): tit = "Recipe" self.rcp = self.getRecipeItems() state = self.df.disableButtonsTags() SRec(self.opts["mf"], screen=self.opts["mf"].body, title=tit, cols=self.rcp[0], where=self.rcp[1], wtype="D", butt=[("Print", self.printRecipe)]) self.df.enableButtonsTags(state=state)
def doDeposit2(self, frt, pag, r, c, p, i, w): self.depdtw = w self.depdtd = self.df.t_disp[pag][0][p] dat = getDeposit(self.opts["mf"], self.opts["conum"], self.depdtw, self.owner, self.code, self.acno) if dat: tit = "Deposit for Account: %s %s %s - %s as at %s" % (self.owner, self.code, self.acno, self.name, self.depdtd) col = ( ("a", "D1", 10, " Date"), ("b", "SD", 11.2, " Deposits"), ("c", "UI", 5, " Days"), ("d", "UD", 5.2, " Rate"), ("e", "SD", 11.2, " Interest"), ("f", "SD", 11.2, " Balance"), ("g", "SD", 11.2, " Admin")) state = self.df.disableButtonsTags() SRec(self.opts["mf"], screen=self.df.nb.Page4, title=tit, cols=col, where=dat, wtype="D") self.df.enableButtonsTags(state=state) self.doDeposit1()
def doTrans2(self): tit = "Transactions for Account: %s - %s" % (self.acno, self.desc) gtt = ["gentrn"] gtc = (("glt_trdt", "", 0, " Date"), ("glt_refno", "", 0, "Reference", "Y"), ("glt_type", ("XX", gltrtp), 3, "Typ"), ("glt_batch", "", 0, "Batch"), ("glt_tramt", "", 0, " Debit"), ("glt_tramt", "", 0, " Credit"), ("balance", "SD", 13.2, " Balance"), ("glt_desc", "", 0, "Remarks"), ("glt_seq", "", 0, "Sequence")) mthno, acctot = self.getObal() if mthno.work == 0: d = self.opts["period"][1][0] else: d = (self.trnper * 100) + 1 if acctot: if acctot < 0: dr = 0 cr = acctot else: dr = acctot cr = 0 data = [[d, "B/Fwd", 4, "", dr, cr, acctot, "Opening Balance", 0]] else: data = [] trn = self.getTrans() if trn: col = self.sql.gentrn_col for rec in trn: acctot = float(ASD(acctot) + ASD(rec[col.index("glt_tramt")])) if rec[col.index("glt_tramt")] < 0: dr = 0 cr = rec[col.index("glt_tramt")] else: dr = rec[col.index("glt_tramt")] cr = 0 data.append([ rec[col.index("glt_trdt")], rec[col.index("glt_refno")], rec[col.index("glt_type")], rec[col.index("glt_batch")], dr, cr, acctot, rec[col.index("glt_desc")], rec[col.index("glt_seq")] ]) state = self.df.disableButtonsTags() while True: rec = SRec(self.opts["mf"], screen=self.df.nb.Page2, title=tit, tables=gtt, cols=gtc, where=data, wtype="D", sort=False) # Display all transaction details if rec.selection: self.df.setWidget(self.df.mstFrame, state="hide") whr = [("glt_seq", "=", rec.selection[8])] TabPrt(self.opts["mf"], tabs="gentrn", where=whr, pdia=False) self.df.setWidget(self.df.mstFrame, state="show") else: break self.df.enableButtonsTags(state=state) self.doTrans1()
def doTrans2c(self): tit = "Transactions for Item: %s %s - %s" % \ (self.group, self.code, self.desc) tab = ["strtrn"] crt = (("stt_trdt", "", 0, " Date"), ("stt_batch", "", 0, "Batch"), ("stt_type", "NA", 3, "Typ"), ("stt_ref1", "", 0, "Reference", "Y"), ("stt_ref2", "", 0, "Ref-Num-2"), ("stt_qty", "", 0, " Quantity"), ("stt_cost", "", 0, " Cost"), ("stt_sell", "", 0, " Selling"), ("qbal", "SD", 13.2, " Qty-Bal"), ("cbal", "SD", 13.2, " Cost-Bal"), ("stt_desc", "", 0, "Details")) whr = [("stt_cono", "=", self.opts["conum"]), ("stt_group", "=", self.group), ("stt_code", "=", self.code), ("stt_loc", "=", self.loc)] if self.per_from: whr.extend([("stt_curdt", ">=", self.per_from), ("stt_curdt", "<=", self.per_to)]) odr = "stt_trdt, stt_qty desc" recs = self.sql.getRec("strtrn", cols=[ "stt_trdt", "stt_batch", "stt_type", "stt_ref1", "stt_ref2", "stt_qty", "stt_cost", "stt_sell", "stt_desc" ], where=whr, order=odr) data = [] tqty = 0 tcst = 0 for rec in recs: rec[2] = sttrtp[rec[2] - 1][0] tqty = float(ASD(tqty) + ASD(rec[5])) tcst = float(ASD(tcst) + ASD(rec[6])) rec.insert(8, tqty) rec.insert(9, tcst) data.append(rec) state = self.df.disableButtonsTags() while True: rec = SRec(self.opts["mf"], screen=self.df.nb.Page4, title=tit, tables=tab, cols=crt, where=data, wtype="D") if rec.selection: for n, t in enumerate(sttrtp): if t[0] == rec.selection[2]: typ = n + 1 break dte = rec.selection[0] doc = rec.selection[3] if self.itype == "R" and typ in (7, 8): bt = (("Transaction", "T"), ("Recipe", "R")) ask = askChoice( self.df.window, head="Details", mess="Transaction Details or the Recipe Details", butt=bt, default="Transaction") else: ask = "T" if ask == "T": wher = [("stt_cono", "=", self.opts["conum"]), ("stt_group", "=", self.group), ("stt_code", "=", self.code), ("stt_loc", "=", self.loc), ("stt_type", "=", typ), ("stt_trdt", "=", dte), ("stt_ref1", "=", doc)] TabPrt(self.opts["mf"], tabs="strtrn", where=wher, pdia=False) elif typ == 7: rct = "Recipe Details" rcc = (("si3_line", "", 0, ""), ("si3_rgroup", "", 0, ""), ("si3_rcode", "", 0, ""), ("st1_desc", "", 0, ""), ("si3_rqty", "", 0, ""), ("si3_cost", "", 0, "")) rcw = (("si3_cono", "=", self.opts["conum"]), ("si3_rtn", "=", "I"), ("si3_docno", "=", doc), ("st1_cono=si3_cono", ), ("st1_group=si3_rgroup", ), ("st1_code=si3_rcode", )) rco = "si3_line" SRec(self.opts["mf"], title=rct, tables=["slsiv3", "strmf1"], cols=rcc, where=rcw, order=rco) else: rct = "Recipe Details" rcc = (("prp_rowno", "", 0, ""), ("prp_rgroup", "", 0, ""), ("prp_rcode", "", 0, ""), ("st1_desc", "", 0, ""), ("prp_rqty", "", 0, ""), ("prp_cost", "", 0, "")) rcw = (("prp_cono", "=", self.opts["conum"]), ("prp_docno", "=", doc), ("st1_cono=prp_cono", ), ("st1_group=prp_rgroup", ), ("st1_code=prp_rcode", )) rco = "prp_rowno" SRec(self.opts["mf"], title=rct, tables=["posrcp", "strmf1"], cols=rcc, where=rcw, order=rco) else: break self.df.enableButtonsTags(state=state) self.df.focusField("T", 4, 1)