From 8c376fda2499e37ea19248daafcbe642156fe781 Mon Sep 17 00:00:00 2001 From: benjamin <benjamin@le-filament.com> Date: Wed, 16 Feb 2022 16:16:36 +0100 Subject: [PATCH] [fix] refund export PCA --- wizard/pca_fae_export_wizard.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/wizard/pca_fae_export_wizard.py b/wizard/pca_fae_export_wizard.py index 1ec4da3..defaae1 100644 --- a/wizard/pca_fae_export_wizard.py +++ b/wizard/pca_fae_export_wizard.py @@ -167,22 +167,22 @@ class PCAExportController(http.Controller): if pca.year > invoice.fiscal_year: lignes_export.append({ 'date': invoice.date_invoice, - 'journal': 'OD', + 'journal': 'CH', 'compte': line.account_id.code, - 'debit': line.price_subtotal_signed * pca.year_percent * 0.01, - 'credit': 0.0, - 'libelle': invoice.partner_id.name + ' - Facture ' + invoice.number + ' - ' + line.name, + 'debit': line.price_subtotal_signed * pca.year_percent * 0.01 if line.price_subtotal_signed > 0 else 0.0, + 'credit': line.price_subtotal_signed * pca.year_percent * 0.01 if line.price_subtotal_signed < 0 else 0.0, + 'libelle': 'PCA-' + invoice.partner_id.name + ' - Facture ' + invoice.number + ' - ' + line.name, 'piece': invoice.number, 'echeance': invoice.date_due, 'ref_piece': invoice.number }) lignes_export.append({ 'date': invoice.date_invoice, - 'journal': 'OD', + 'journal': 'CH', 'compte': '487000', - 'debit': 0.0, - 'credit': line.price_subtotal_signed * pca.year_percent * 0.01, - 'libelle': invoice.partner_id.name + ' - Facture ' + invoice.number + ' - ' + line.name, + 'debit': line.price_subtotal_signed * pca.year_percent * 0.01 if line.price_subtotal_signed < 0 else 0.0, + 'credit': line.price_subtotal_signed * pca.year_percent * 0.01 if line.price_subtotal_signed > 0 else 0.0, + 'libelle': 'PCA-' + invoice.partner_id.name + ' - Facture ' + invoice.number + ' - ' + line.name, 'piece': invoice.number, 'echeance': invoice.date_due, 'ref_piece': invoice.number -- GitLab