def ownerMails(self): mails = excel_utils.ExtractCellValueByColumn(self, 'מייל שוכר') try: return mails.split() #probably an integer, therfore could not be splitted, so str it except: return str(mails) return excel_utils.ExtractCellValueByColumn(self, 'מייל שוכר').split()
def renterPhones(self): phones = excel_utils.ExtractCellValueByColumn(self, 'טלפון שוכרים') try: return phones.split() # probably a phone which was written without a leading zero therefore is treated as a number in the excel except: return ['0' + str(phones)]
def monthlyData(self, year, excelCellInfoPerDate=None): #find columns in this sheet which represent months allMonths = sorted([k for k in self.__dict__ if dates.datify(k, year)], key=(lambda dateColumn: dates.datify(dateColumn))) #build monthly expected payments table monthlyExpectedPaymentOf = {} #if there are different expected payment throughtout this sheet, then monthlyColumns gets updated #ar the c'tor of the excel record if len(self.monthlyColumns): currExpectedPayment = self.payment for m in allMonths: if int(m) in self.monthlyColumns: currExpectedPayment = utils.Intify( excel_utils.ExtractCellValueByColumn( self, 'ת.חודשי_%d' % int(m))) monthlyExpectedPaymentOf[m] = currExpectedPayment else: for m in allMonths: monthlyExpectedPaymentOf[m] = utils.Intify(self.payment) for month in allMonths: cell_info = excelCellInfoPerDate[dates.datify(month, year)] expected_payment = monthlyExpectedPaymentOf[month] actual_payment = utils.Intify(self.monthlyPayment(month)) cell_info.payment_details.actual_payment = actual_payment cell_info.payment_details.expected_payment = expected_payment
def renterMails(self): mails = excel_utils.ExtractCellValueByColumn(self, 'דואר אלקטרוני שוכרים') try: return mails.split() #probably an integer, therfore could not be splitted, so str it except: return str(mails)
def debt(self): return utils.Intify(excel_utils.ExtractCellValueByColumn(self, 'יתרה'))
def tenant(self): return excel_utils.ExtractCellValueByColumn(self, 'שם דיירים')
def appartment(self): app = excel_utils.ExtractCellValueByColumn(self, 'דירה') try: return int(app) except: return app.strip()
def ownerMails(self): return excel_utils.ExtractCellValueByColumn(self, 'מייל בעלים').split()
def owner(self): return excel_utils.ExtractCellValueByColumn(self, 'שם בעלים')
def special_debt(self): # if payment does not exist, treat as 0 as it is defined integer in the data base return utils.Intify( excel_utils.ExtractCellValueByColumn(self, 'יתרה לתשלום'))
def paid(self): paid = excel_utils.ExtractCellValueByColumn(self, 'תשלום בהוראת קבע') if type(paid) == int or type(paid) == float or len(paid): return True
def tenantPhones(self): return excel_utils.ExtractCellValueByColumn(self, 'טלפון דיירים').split()
def ownerPhones(self): return excel_utils.ExtractCellValueByColumn(self, 'טלפון בעלים').split()
def tenantMails(self): return excel_utils.ExtractCellValueByColumn(self, 'מייל דיירים').split()
def building(self): return excel_utils.ExtractCellValueByColumn(self, 'בנין')
def building_code(self): return utils.Intify( excel_utils.ExtractCellValueByColumn(self, 'קוד בניין'))
def monthlyPayment(self, month): return excel_utils.ExtractCellValueByColumn(self, str(month))
def appartment(self): try: app = excel_utils.ExtractCellValueByColumn(self, 'כרטיס') return int(str(int(app))[3:]) - 5000 except ValueError: return app
def payment(self): #if payment does not exist, treat as 0 as it is defined integer in the data base return utils.Intify( excel_utils.ExtractCellValueByColumn(self, 'ת.חודשי'))
def renter(self): return excel_utils.ExtractCellValueByColumn(self, 'שם שוכרים')
def focal_point(self): return excel_utils.ExtractCellValueByColumn(self, 'נציגי בניין')