Esempio n. 1
0
 def __init__(self,
              parent,
              in_dateFormat="",
              in_payType="",
              in_refDate="",
              in_netpay="",
              in_payDepositAcct="none"):
     self.parent = parent
     super(PropertyForm, self).__init__(parent)
     self.assetFrame = self.GetGrandParent()
     self.dateFormats = ['%m/%d/%Y', "%Y/%m/%d"]
     if in_dateFormat != "":
         try:
             self.dateFormatChoice = self.dateFormats.index(in_dateFormat)
             self.dateSep = "/"
         except:
             self.dateFormatChoice = -1
         if self.dateFormatChoice == -1:
             today = Date.get_global_curr_date(self)["str"]
             if today.index("/") == 4:
                 self.dateFormatChoice = 1
                 self.dateSep = "/"
             else:
                 self.dateFormatChoice = 0
                 self.dateSep = "/"
             defaultDateFormat = self.dateFormats[
                 self.dateFormatChoice].replace("%m", "mm").replace(
                     "%d", "dd").replace("%y", "yy").replace("%Y", "yyyy")
             self.MsgBox("Unknown date format %s ignored - default to %s" %
                         (in_dateFormat, defaultDateFormat))
     else:
         self.dateFormatChoice = 0
     self.dateFormat = self.dateFormats[self.dateFormatChoice]
     self.inDateFormat = self.dateFormats[self.dateFormatChoice]
     self.payTypes = ['every week', 'every 2 weeks', 'monthly']
     if in_payType != "":
         try:
             self.payType = self.payTypes.index(in_payType)
         except:
             self.payType = -1
         if self.payType == -1:
             self.payType = 1
             self.MsgBox(
                 "Unknown pay frequency %s ignored - default to %s" %
                 (in_payType, self.payTypes[self.payType]))
     else:
         self.payType = 1
     self.ref_date = in_refDate
     self.netpay = in_netpay
     self.payDepositAcct = in_payDepositAcct
     self.createControls()
     self.setControlInitValues()
     self.bindEvents()
     self.doLayout()