From 8125291e05d6627d0e3ac006eb44089745c2e083 Mon Sep 17 00:00:00 2001 From: LorenzoC0 Date: Thu, 5 Oct 2023 16:27:10 +0200 Subject: [PATCH] Aggiunta colonna Ref a report Libro Giornale su Reportlab --- .../wizard/print_giornale.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/l10n_it_central_journal_reportlab/wizard/print_giornale.py b/l10n_it_central_journal_reportlab/wizard/print_giornale.py index 8340a85c01cc..ad9b66486ead 100644 --- a/l10n_it_central_journal_reportlab/wizard/print_giornale.py +++ b/l10n_it_central_journal_reportlab/wizard/print_giornale.py @@ -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])) @@ -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] @@ -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), @@ -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), @@ -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) @@ -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( @@ -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),