def render(self): # Note: this method has no tests!!!! sheet = "{}\nIncome Statement\n{}\n\n".format( self.name, output_format(self.from_date) + " to " + output_format(self.date)) sheet += "{}\n\n".format(REVENUE) block, total_rev = self.format_block(REVENUE, list_accounts(REVENUE), 1) sheet += block sheet += "\n" total_exp = 0 sheet += "{}\n\n".format(EXPENSES.strip("%")) for exp in [ LEGIT_EXPENSES, OPT_EXPENSES, RETARDED_EXPENSES, MISC_EXPENSES ]: block, amount = self.format_block(exp, list_accounts(exp), 0) sheet += block total_exp += amount sheet += self.format_line( "Total {}".format(EXPENSES.strip("%").lower()), total_exp, 2) + "\n\n" sheet += self.format_line("Net income", total_rev - total_exp, 2) return sheet
def render(self): # Note: this method has no tests!!!! sheet = "{}\nIncome Statement\n{}\n\n".format( self.name, output_format(self.from_date) + " to " + output_format(self.date) ) sheet += "{}\n\n".format(REVENUE) block, total_rev = self.format_block(REVENUE, list_accounts(REVENUE), 1) sheet += block sheet += "\n" total_exp = 0 sheet += "{}\n\n".format(EXPENSES.strip("%")) for exp in [LEGIT_EXPENSES, OPT_EXPENSES, RETARDED_EXPENSES, MISC_EXPENSES]: block, amount = self.format_block(exp, list_accounts(exp), 0) sheet += block total_exp += amount sheet += self.format_line("Total {}".format(EXPENSES.strip("%").lower()), total_exp, 2) + "\n\n" sheet += self.format_line("Net income", total_rev - total_exp, 2) return sheet
def render(self): # Note: this method has no tests!!!! sheet = "{}\nBalance sheet\n{}\n\n".format(self.name, output_format(self.date)) total_assets = 0 sheet += "{}\n\n".format(ASSETS) block, cur_assets_amount = self.format_block(CURRENT_ASSETS, list_accounts(CURRENT_ASSETS), 0) sheet += block total_assets += cur_assets_amount block, long_assets_amount = self.format_block(LONG_TERM_ASSETS, list_accounts(LONG_TERM_ASSETS), 0) sheet += block total_assets += long_assets_amount sheet += self.format_line("Total {}".format(ASSETS.lower()), total_assets, 2) sheet += "\n" total_liabs = 0 sheet += "{}\n".format(LIABILITIES) block, cur_liabs_amount = self.format_block(CURRENT_LIABILITIES, list_accounts(CURRENT_LIABILITIES), 0) sheet += block total_liabs += cur_liabs_amount block, long_liabs_amount = self.format_block(LONG_TERM_LIABILITIES, list_accounts(LONG_TERM_LIABILITIES), 0) sheet += block total_liabs += long_liabs_amount sheet += self.format_line("Total {}".format(LIABILITIES.lower()), total_liabs, 2) + "\n" sheet += self.format_line("Net worth", total_assets - total_liabs, 2) return sheet
def render(self): # Note: this method has no tests!!!! sheet = "{}\nBalance sheet\n{}\n\n".format(self.name, output_format(self.date)) total_assets = 0 sheet += "{}\n\n".format(ASSETS) block, cur_assets_amount = self.format_block( CURRENT_ASSETS, list_accounts(CURRENT_ASSETS), 0) sheet += block total_assets += cur_assets_amount block, long_assets_amount = self.format_block( LONG_TERM_ASSETS, list_accounts(LONG_TERM_ASSETS), 0) sheet += block total_assets += long_assets_amount sheet += self.format_line("Total {}".format(ASSETS.lower()), total_assets, 2) sheet += "\n" total_liabs = 0 sheet += "{}\n".format(LIABILITIES) block, cur_liabs_amount = self.format_block( CURRENT_LIABILITIES, list_accounts(CURRENT_LIABILITIES), 0) sheet += block total_liabs += cur_liabs_amount block, long_liabs_amount = self.format_block( LONG_TERM_LIABILITIES, list_accounts(LONG_TERM_LIABILITIES), 0) sheet += block total_liabs += long_liabs_amount sheet += self.format_line("Total {}".format(LIABILITIES.lower()), total_liabs, 2) + "\n" sheet += self.format_line("Net worth", total_assets - total_liabs, 2) return sheet