示例#1
0
 def setVariables(self):
     # Check for Valid Posting Routine
     if self.opts["rtn"] != 2:
         mes = "Invalid Routine %s" % str(self.opts["rtn"])
         showError(self.opts["mf"].body, "Control Error", mes)
         return
     # Setup SQL Object
     self.sql = Sql(self.opts["mf"].dbm, ["ctlmst", "ctlvmf", "drschn",
         "drsmst", "drstrn", "genint", "genmst", "gentrn"],
             prog=self.__class__.__name__)
     if self.sql.error:
         return
     # Check for Intercompany Facility
     if not self.sql.getRec("ctlmst", cols=["count(*)"],
             where=[("ctm_cono", "<>", self.opts["conum"])], limit=1)[0]:
         self.incoac = False
     else:
         itg = self.sql.getRec("genint", cols=["cti_inco"],
             where=[("cti_cono", "=", self.opts["conum"])])
         if itg:
             self.incoac = [self.opts["conum"]]
             [self.incoac.append(coy[0]) for coy in itg]
         else:
             self.incoac = False
     #
     self.gc = GetCtl(self.opts["mf"])
     drsctl = self.gc.getCtl("drsctl", self.opts["conum"])
     if not drsctl:
         return
     self.glint = drsctl["ctd_glint"]
     self.chains = drsctl["ctd_chain"]
     if self.glint == "Y":
         ctlctl = self.gc.getCtl("ctlctl", self.opts["conum"])
         if not ctlctl:
             return
         ctls = ["drs_ctl", "vat_ctl", "dis_all"]
         if self.gc.chkRec(self.opts["conum"], ctlctl, ctls):
             return
         self.drsctl = ctlctl["drs_ctl"]
         self.dis_all = ctlctl["dis_all"]
     self.batchHeader()
     if not self.bh.batno:
         return
     t = time.localtime()
     self.sysdtw = (t[0] * 10000) + (t[1] * 100) + t[2]
     self.allcoy = self.opts["conum"]
     ctlmst = self.gc.getCtl("ctlmst", self.opts["conum"])
     if not ctlmst:
         return
     self.taxdf = ctlmst["ctm_taxdf"]
     if self.chains == "N":
         self.chain = 0
     self.glt = 6
     self.agevar = tk.BooleanVar()
     self.agevar.set(False)
     return True
示例#2
0
 def setVariables(self):
     self.sql = Sql(self.opts["mf"].dbm, ["memmst", "memtrn", "memage"],
                    prog=self.__class__.__name__)
     if self.sql.error:
         return
     t = time.localtime()
     self.sysdtw = (t[0] * 10000) + (t[1] * 100) + t[2]
     self.curdt = int(self.sysdtw / 100)
     self.agevar = tk.BooleanVar()
     self.agevar.set(False)
     return True
示例#3
0
 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
示例#4
0
 def setVariables(self):
     self.sql = Sql(self.opts["mf"].dbm, ["crsmst", "crstrn", "crsage"],
         prog=self.__class__.__name__)
     if self.sql.error:
         return
     gc = GetCtl(self.opts["mf"])
     crsctl = gc.getCtl("crsctl", self.opts["conum"])
     if not crsctl:
         return
     t = time.localtime()
     self.sysdtw = (t[0] * 10000) + (t[1] * 100) + t[2]
     self.curdt = int(self.sysdtw / 100)
     if "args" not in self.opts:
         self.agevar = tk.BooleanVar()
         self.agevar.set(False)
     return True
示例#5
0
 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
示例#6
0
 def setVariables(self):
     # Check for Valid Posting Routine
     if self.opts["rtn"] not in (1, 2, 3, 4, 5):
         showError(self.opts["mf"].body, "Control Error",
             "Invalid Routine %s, Only 1 - 5 Are Allowed" % \
             str(self.opts["rtn"]))
         return
     # Create SQL Object
     self.sql = Sql(self.opts["mf"].dbm, [
         "ctlmst", "ctlvmf", "ctlvrf", "ctlvtf", "crsmst", "crstrn",
         "genint", "genmst", "gentrn", "lonmf1", "lonmf2", "lonrte",
         "lontrn", "wagedc", "wagmst", "waglmf", "wagltf"
     ],
                    prog=self.__class__.__name__)
     if self.sql.error:
         return
     # Check for Company record
     self.gc = GetCtl(self.opts["mf"])
     self.allcoy = self.opts["conum"]
     self.allnam = self.opts["conam"]
     ctlmst = self.gc.getCtl("ctlmst", self.allcoy)
     if not ctlmst:
         return
     self.taxdf = ctlmst["ctm_taxdf"]
     # Check for Intercompany Facility
     if not self.sql.getRec("ctlmst",
                            cols=["count(*)"],
                            where=[("ctm_cono", "<>", self.opts["conum"])],
                            limit=1)[0]:
         self.incoac = False
     else:
         rec = self.sql.getRec("genint",
                               cols=["cti_inco"],
                               where=[("cti_cono", "=", self.opts["conum"])
                                      ])
         if rec:
             self.incoac = [self.opts["conum"]]
             [self.incoac.append(coy[0]) for coy in rec]
         else:
             self.incoac = False
     # Get Enabled Modules
     self.lonmod = False
     self.lonpag = None
     self.slnmod = False
     self.slnpag = None
     for x in range(0, len(ctlmst["ctm_modules"].rstrip()), 2):
         if ctlmst["ctm_modules"][x:x + 2] == "LN":
             self.lonmod = True
         elif ctlmst["ctm_modules"][x:x + 2] == "SL":
             self.slnmod = True
     # Rest of Controls
     crsctl = self.gc.getCtl("crsctl", self.opts["conum"])
     if not crsctl:
         return
     self.glint = crsctl["ctc_glint"]
     self.glinp = crsctl["ctc_glinp"]
     if self.glint == "Y":
         self.ctlctl = self.gc.getCtl("ctlctl", self.opts["conum"])
         if not self.ctlctl:
             return
         ctls = ["crs_ctl", "vat_ctl", "dis_rec"]
         if self.gc.chkRec(self.opts["conum"], self.ctlctl, ctls):
             return
         self.crsctl = self.ctlctl["crs_ctl"]
         self.disrec = self.ctlctl["dis_rec"]
     # Batch Header
     self.batchHeader()
     if not self.bh.batno:
         return
     t = time.localtime()
     self.sysdtw = (t[0] * 10000) + (t[1] * 100) + t[2]
     if self.opts["rtn"] == 1:
         self.glt = 5
     elif self.opts["rtn"] == 2:
         self.glt = 6
     elif self.opts["rtn"] == 3:
         self.glt = 4
     elif self.opts["rtn"] == 4:
         self.glt = 5
     elif self.opts["rtn"] == 5:
         self.glt = 2
     self.agevar = tk.BooleanVar()
     self.othvar = tk.BooleanVar()
     self.agevar.set(False)
     self.othvar.set(False)
     return True