Ejemplo n.º 1
0
 def test_get_month_interval_for_year(self):
     months = list(get_month_intervals_for_year(2012))
     self.assertTrue(len(months), 12)
     self.assertTrue(months[0], (datetime.datetime(2012, 1, 1),
                                 datetime.datetime(2012, 1, 31)))
     self.assertTrue(months[11], (datetime.datetime(2012, 12, 1),
                                  datetime.datetime(2012, 12, 31)))
Ejemplo n.º 2
0
    def get_data(self):
        sheets = {}
        for account in Account.get_children_for(self.store, parent=None):
            if sysparam.compare_object('IMBALANCE_ACCOUNT', account):
                continue

            columns = []
            for start, end in get_month_intervals_for_year(self.year):
                column = []
                self._prepare_items(column, account, start, end)
                columns.append(column)

            # Skip empty sheets
            if sum(item[1] for c in columns for item in c) == 0:
                continue

            sheets[account.description] = columns

        return sheets
Ejemplo n.º 3
0
    def get_data(self):
        sysparam_ = sysparam(self.store)

        sheets = {}
        for account in Account.get_children_for(self.store, parent=None):
            if account.id == sysparam_.IMBALANCE_ACCOUNT.id:
                continue

            columns = []
            for start, end in get_month_intervals_for_year(self.year):
                column = []
                self._prepare_items(column, account, start, end)
                columns.append(column)

            # Skip empty sheets
            if sum(item[1] for c in columns for item in c) == 0:
                continue

            sheets[account.description] = columns

        return sheets