def setVariables(self): self.sql = Sql( self.opts["mf"].dbm, ["genmst", "gentrn", "wagedc", "wagmst", "waglmf", "wagltf"], prog=self.__class__.__name__) if self.sql.error: return self.gc = GetCtl(self.opts["mf"]) wagctl = self.gc.getCtl("wagctl", self.opts["conum"]) if not wagctl: return self.glint = wagctl["ctw_glint"] if self.glint == "Y": ctlctl = self.gc.getCtl("ctlctl", self.opts["conum"]) if not ctlctl: return if self.gc.chkRec(self.opts["conum"], ctlctl, ["wag_slc"]): return self.slnctl = ctlctl["wag_slc"] self.bh = Batches(self.opts["mf"], self.opts["conum"], self.opts["conam"], self.opts["period"], "SLN", 2, glint=self.glint) self.bh.doBatchHeader() if not self.bh.batno: return t = time.localtime() self.sysdtw = (t[0] * 10000) + (t[1] * 100) + t[2] return True
def batchHeader(self): self.bh = Batches(self.opts["mf"], self.opts["conum"], self.opts["conam"], self.opts["period"], "DRS", self.opts["rtn"], multi="N", glint=self.glint) self.bh.doBatchHeader() if not self.bh.batno: return
def setVariables(self): tabs = [ "ctlmst", "ctlvmf", "ctlvrf", "ctlvtf", "genint", "genmst", "gentrn", "rtlprm", "rtlmst", "rtlcon", "rtltrn" ] self.sql = Sql(self.opts["mf"].dbm, tabs, prog=self.__class__.__name__) if self.sql.error: return if self.opts["rtn"] not in (2, 3, 4): mes = "Invalid Routine %s" % str(self.opts["rtn"]) showError(self.opts["mf"].body, "Control Error", mes) return self.gc = GetCtl(self.opts["mf"]) rtlctl = self.gc.getCtl("rtlctl", self.opts["conum"]) if not rtlctl: return self.glint = rtlctl["ctr_glint"] if self.glint == "Y": # Check All Premises Control Records errs = ("Premises %s Has An Invalid", "Rental Control Account (%s)", "Rental Income Account (%s)") ass = self.sql.getRec( "rtlprm", cols=["rtp_code", "rtp_rtlacc", "rtp_incacc"], where=[("rtp_cono", "=", self.opts["conum"])]) for acc in ass: for x in range(1, 3): chk = self.sql.getRec("genmst", where=[("glm_cono", "=", self.opts["conum"]), ("glm_acno", "=", acc[x])], limit=1) if not chk: mess = "%s %s" % (errs[0] % acc[0], errs[x] % acc[x]) showError(self.opts["mf"].body, "Control Error", mess) return # Check for VAT Control ctlctl = self.gc.getCtl("ctlctl", self.opts["conum"]) if not ctlctl: return if self.gc.chkRec(self.opts["conum"], ctlctl, ["vat_ctl"]): return self.convat = ctlctl["vat_ctl"] t = time.localtime() self.sysdtw = (t[0] * 10000) + (t[1] * 100) + t[2] self.bh = Batches(self.opts["mf"], self.opts["conum"], self.opts["conam"], self.opts["period"], "RTL", self.opts["rtn"], glint=self.glint) self.bh.doBatchHeader() if not self.bh.batno: return if self.opts["rtn"] == 2: self.bh.batval = float(ASD(0) - ASD(self.bh.batval)) return True
def batchHeader(self): self.bh = Batches(self.opts["mf"], self.opts["conum"], self.opts["conam"], self.opts["period"], "DRS", self.opts["rtn"], glint=self.glint) self.bh.doBatchHeader() if not self.bh.batno: return self.bh.batval = float(ASD(0) - ASD(self.bh.batval))
def setVariables(self): # Check for Valid Posting Routine if self.opts["rtn"] not in (1, 2, 3, 4): showError(self.opts["mf"].body, "Control Error", "Invalid Routine %s, Only 1-4 Are Allowed" % \ str(self.opts["rtn"])) return tabs = ["ctlvmf", "ctlvrf", "ctlvtf", "memmst", "memtrn"] self.gc = GetCtl(self.opts["mf"]) memctl = self.gc.getCtl("memctl", self.opts["conum"]) if not memctl: return self.glint = memctl["mcm_glint"] if self.glint == "Y": ctlctl = self.gc.getCtl("ctlctl", self.opts["conum"]) if not ctlctl: return ctls = ["mem_ctl", "vat_ctl", "dis_all"] if self.gc.chkRec(self.opts["conum"], ctlctl, ctls): return self.memctl = ctlctl["mem_ctl"] self.dis_all = ctlctl["dis_all"] tabs.extend(["gentrn", "genmst"]) # Create SQL Object self.sql = Sql(self.opts["mf"].dbm, tabs, prog=self.__class__.__name__) if self.sql.error: return self.bh = Batches(self.opts["mf"], self.opts["conum"], self.opts["conam"], self.opts["period"], "MEM", self.opts["rtn"], glint=self.glint) self.bh.doBatchHeader() if not self.bh.batno: return t = time.localtime() self.sysdtw = (t[0] * 10000) + (t[1] * 100) + t[2] ctlmst = self.gc.getCtl("ctlmst", self.opts["conum"]) if not ctlmst: return self.taxdf = ctlmst["ctm_taxdf"] if self.opts["rtn"] == 1: self.glt = 1 elif self.opts["rtn"] == 2: self.glt = 2 elif self.opts["rtn"] == 3: self.glt = 4 elif self.opts["rtn"] == 4: self.glt = 1 self.agevar = tk.BooleanVar() self.agevar.set(False) return True
def batchHeader(self): self.bh = Batches(self.opts["mf"], self.opts["conum"], self.opts["conam"], self.opts["period"], "SLN", 5, glint=self.glint) self.bh.doBatchHeader() if not self.bh.batno: return
def setVariables(self): # Check for Valid Posting Routine if self.opts["rtn"] != 5: mes = "Invalid Routine %s" % str(self.opts["rtn"]) showError(self.opts["mf"].body, "Control Error", mes) return tabs = ["ctlvmf", "memmst", "memtrn"] self.gc = GetCtl(self.opts["mf"]) memctl = self.gc.getCtl("memctl", self.opts["conum"]) if not memctl: return self.glint = memctl["mcm_glint"] if self.glint == "Y": ctlctl = self.gc.getCtl("ctlctl", self.opts["conum"]) if not ctlctl: return ctls = ["mem_ctl", "vat_ctl", "dis_all"] if self.gc.chkRec(self.opts["conum"], ctlctl, ctls): return self.memctl = ctlctl["mem_ctl"] self.dis_all = ctlctl["dis_all"] tabs.extend(["genmst", "gentrn"]) # Setup SQL Object self.sql = Sql(self.opts["mf"].dbm, tabs, prog=self.__class__.__name__) if self.sql.error: return self.bh = Batches(self.opts["mf"], self.opts["conum"], self.opts["conam"], self.opts["period"], "MEM", self.opts["rtn"], glint=self.glint) self.bh.doBatchHeader() if not self.bh.batno: return self.bh.batval = float(ASD(0) - ASD(self.bh.batval)) t = time.localtime() self.sysdtw = (t[0] * 10000) + (t[1] * 100) + t[2] ctlmst = self.gc.getCtl("ctlmst", self.opts["conum"]) if not ctlmst: return self.taxdf = ctlmst["ctm_taxdf"] self.glt = 4 self.agevar = tk.BooleanVar() self.agevar.set(False) return True
def setVariables(self): # Check for Company Record self.gc = GetCtl(self.opts["mf"]) ctlmst = self.gc.getCtl("ctlmst", self.opts["conum"]) if not ctlmst: return # Check and Load VAT Control self.ctlctl = self.gc.getCtl("ctlctl", self.opts["conum"]) if not self.ctlctl: return if self.gc.chkRec(self.opts["conum"], self.ctlctl, ["vat_ctl"]): return self.convat = self.ctlctl["vat_ctl"] # Set Batch Indicator self.batind = "Y" # Create SQL Object tabs = [ "ctlctl", "ctlmst", "ctlvmf", "ctlvrf", "ctlvtf", "genint", "genjlm", "genjlt", "genmst", "gentrn", "assgrp", "rtlprm" ] self.sql = Sql(self.opts["mf"].dbm, tabs, prog=self.__class__.__name__) if self.sql.error: return self.bh = Batches(self.opts["mf"], self.opts["conum"], self.opts["conam"], self.opts["period"], "GEN", self.opts["rtn"], multi="Y") self.bh.doBatchHeader() if not self.bh.batno: return t = time.localtime() self.sysdtw = ((t[0] * 10000) + (t[1] * 100) + t[2]) self.s_per = int(self.opts["period"][1][0] / 100) self.e_per = int(self.opts["period"][1][0] / 100) return True