Exemple #1
0
 def fill_part_of_grid(self, current_filter, query_budget, index_begin, title, sign_value=None):
     data_line, total1, total2, totalb = convert_query_to_account(self.filter & current_filter, self.lastfilter & current_filter, query_budget=query_budget, sign_value=sign_value)
     add_cell_in_grid(self.grid, index_begin, 'design', get_spaces(5) + '{[u]}%s{[/u]}' % title)
     line_idx = index_begin + 1
     for data_item in data_line:
         add_cell_in_grid(self.grid, line_idx, 'design', data_item[0])
         add_cell_in_grid(self.grid, line_idx, 'year_n', data_item[1])
         add_cell_in_grid(self.grid, line_idx, 'budget_n', data_item[3])
         if self.next_year is not None:
             add_cell_in_grid(self.grid, line_idx, 'budget_n1', data_item[4])
         if self.next_year_again is not None:
             add_cell_in_grid(self.grid, line_idx, 'budget_n2', data_item[5])
         if self.item.last_fiscalyear is not None:
             add_cell_in_grid(self.grid, line_idx, 'year_n_1', data_item[2])
         line_idx += 1
     add_cell_in_grid(self.grid, line_idx, 'design', '')
     line_idx += 1
     add_cell_in_grid(self.grid, line_idx, 'design', get_spaces(5) + "{[u]}%s{[/u]}" % _('total'))
     add_cell_in_grid(self.grid, line_idx, 'year_n', total1, "{[u]}%s{[/u]}")
     add_cell_in_grid(self.grid, line_idx, 'budget_n', totalb[0], "{[u]}%s{[/u]}")
     if self.next_year is not None:
         add_cell_in_grid(self.grid, line_idx, 'budget_n1', totalb[1], "{[u]}%s{[/u]}")
     if self.next_year_again is not None:
         add_cell_in_grid(self.grid, line_idx, 'budget_n2', totalb[2], "{[u]}%s{[/u]}")
     if self.item.last_fiscalyear is not None:
         add_cell_in_grid(self.grid, line_idx, 'year_n_1', total2, "{[u]}%s{[/u]}")
     line_idx += 1
     add_cell_in_grid(self.grid, line_idx, 'design', '')
     return line_idx, total1, total2, totalb
Exemple #2
0
 def fill_part_of_grid(self, side, current_filter, index_begin, title, sign_value=None, with_third=False):
     data_line, total1, total2, _totalb = convert_query_to_account(self.filter & current_filter, self.lastfilter & current_filter, sign_value=sign_value, with_third=with_third)
     add_cell_in_grid(self.grid, index_begin, side, get_spaces(5) + '{[u]}%s{[/u]}' % title)
     line_idx = index_begin + 1
     line_idx = fill_grid(self.grid, line_idx, side, data_line)
     add_cell_in_grid(self.grid, line_idx, side, '')
     line_idx += 1
     return line_idx, total1, total2