Skip to content

Commit

Permalink
Merge PR OCA#3641 into 14.0
Browse files Browse the repository at this point in the history
Signed-off-by eLBati
  • Loading branch information
OCA-git-bot committed Oct 5, 2023
2 parents 4f7d8e5 + 8125291 commit b84812a
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions l10n_it_central_journal_reportlab/wizard/print_giornale.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,6 @@ def get_line_reportlab_ids(self):
move_line_ids = flatten(res)
return move_line_ids

def _get_move_name_reportlab(self, line):
return " - ".join(filter(None, [line.move_id.ref, line.move_id.name]))

def _get_account_name_reportlab(self, line):
return " - ".join(filter(None, [line.account_id.code, line.account_id.name]))

Expand Down Expand Up @@ -270,7 +267,7 @@ def get_styles_report_giornale_line(self):
}

def get_colwidths_report_giornale(self, width_available):
colwidths = [32, 35, 130, 130, 130, 50, 50]
colwidths = [32, 40, 50, 120, 130, 100, 50, 50]
total = sum(colwidths)
return [c / total * width_available for c in colwidths]

Expand All @@ -284,7 +281,8 @@ def get_data_header_report_giornale(self):
[
Paragraph(_("Row"), style_header),
Paragraph(_("Date"), style_header),
Paragraph(_("Account Move"), style_header),
Paragraph(_("Ref"), style_header),
Paragraph(_("Number"), style_header),
Paragraph(_("Account"), style_header),
Paragraph(_("Name"), style_header),
Paragraph(_("Debit"), style_header_number),
Expand All @@ -303,6 +301,7 @@ def get_initial_balance_data_report_giornale(self):
"",
"",
"",
"",
Paragraph(_("Initial Balance"), style_name),
Paragraph(formatLang(self.env, self.progressive_debit2), style_number),
Paragraph(formatLang(self.env, self.progressive_credit), style_number),
Expand Down Expand Up @@ -386,7 +385,8 @@ def get_final_tables_report_giornale(
start_row += 1
row = Paragraph(str(start_row), style_name)
date = Paragraph(format_date(self.env, line.date), style_name)
move_name = self._get_move_name_reportlab(line)
ref = Paragraph(str(line.ref or ""), style_name)
move_name = line.move_id.name or ""
move = Paragraph(move_name, style_name)
account_name = self._get_account_name_reportlab(line)
account = Paragraph(account_name, style_name)
Expand All @@ -397,7 +397,7 @@ def get_final_tables_report_giornale(
debit = Paragraph(formatLang(self.env, line.debit), style_number)
credit = Paragraph(formatLang(self.env, line.credit), style_number)
list_balance.append((line.debit, line.credit))
line_data = [[row, date, move, account, name, debit, credit]]
line_data = [[row, date, ref, move, account, name, debit, credit]]
if previous_move_name != move_name:
previous_move_name = move_name
tables.append(
Expand All @@ -422,6 +422,7 @@ def get_balance_data_report_giornale(self, tot_debit, tot_credit, final=False):
"",
"",
"",
"",
name,
Paragraph(formatLang(self.env, tot_debit), style_number),
Paragraph(formatLang(self.env, tot_credit), style_number),
Expand Down

0 comments on commit b84812a

Please sign in to comment.