def accumulate(self, row): amount = row['Amount'] if self.fieldsHaveChanged(self.fields): self.total = Container.getFloatNoCommas(amount) else: self.total += Container.getFloatNoCommas(amount) return self.get()
def get(self): if self.fieldsWillChange(self.fields): return Container.formatDollars(self.total) else: return Container.formatDollars(self.total) return ' ' return Container.formatDollars(self.total)
def transform(self, essence_col, next_col): derived_col = dict(essence_col) derived_col['Year'] = \ Container.convertStandardDateToYear(essence_col['Date']) derived_col['YearMonth'] = \ Container.convertStandardDateToYearMonth(essence_col['Date']) derived_col['SimplifiedAlias'], \ derived_col['Account'], \ derived_col['Category'], \ derived_col['Subcategory'] = \ self.processAccountAlias(essence_col['AccountAlias']) return True, derived_col
def accumulate(self, row): amount = row['Amount'] money = Container.getFloatNoCommas(amount) if self.fieldsHaveChanged(self.fields): if money < 0.0: self.total = money else: self.total = 0.0 else: if money < 0.0: self.total += money return self.get()
def isSelectedRow(self, row): partial_first_month = Container.convertStandardDateToYearMonth(self.first_row['Date']) ignore_partial_first_month = (partial_first_month == row["YearMonth"]) return ( not (row["Category"] == "Banking" and row["Subcategory"] == "ML Internal Transfer") and not (row["Category"] == "Banking" and row["Subcategory"] == "Wire In") and not (row["Category"] == "Banking" and row["Subcategory"] == "Check Deposit" and row["Amount"] == "123,755.05") and not (row["Category"] == "Charitable Donations" and row["Subcategory"] == "Wire Out" and row["Amount"] == "-200,000.00") and not (row["Category"] == "Credit Card" and row["Subcategory"] == "Pay Credit Card" and row["Account"] == "Capital One") and not (row["Category"] == "Credit Card" and row["Subcategory"] == "Pay Credit Card" and row["Account"] == "Chase" and row["Date"] > "2013-07-19") and not ignore_partial_first_month ) return True
def normalizeAmountField(self, amount_text): as_float = Container.getFloat(amount_text) return Container.formatDollars(as_float)
def normalizeDateField(self, date_text): return Container.convertDateWithSlashes(date_text)
def pages(self, dirpath = Container.temporaryFolder()): #print "pages", dirpath self.htmlPresentation(dirpath) return
def get(self): return Container.formatDollars(self.total)