Skip to content
Extraits de code Groupes Projets
Valider d2401de5 rédigé par Benjamin - Le Filament's avatar Benjamin - Le Filament
Parcourir les fichiers

[add] report cotisation

parent 7484d7b7
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion!212.0 dev
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
# © 2022 Le Filament (<http://www.le-filament.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import controllers
from . import models
from . import report
from . import wizard
# © 2022 Le Filament (<http://www.le-filament.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "CG SCOP - Cotisations CG",
"summary": "CG SCOP - Cotisations CG Scop",
......@@ -23,9 +25,9 @@
"datas/queue_job_data.xml",
"datas/ir_sequence_data.xml",
# Reports
"report/report_scop_bordereau.xml",
"report/report_scop_bordereau_payments.xml",
"report/report_scop_bordereau_refund.xml",
"templates/report_scop_bordereau.xml",
"templates/report_scop_bordereau_payments.xml",
"templates/report_scop_bordereau_refund.xml",
# Views
"views/account_invoice.xml",
"views/res_config_settings.xml",
......
# © 2021 Le Filament (<http://www.le-filament.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from datetime import timedelta
from odoo import fields, models, api
......
# © 2022 Le Filament (<http://www.le-filament.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import scop_contribution_report
# © 2022 Le Filament (<http://www.le-filament.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models
class ScopContributionReport(models.Model):
_inherit = "scop.contribution.report"
def _select_invoice(self):
select_str = super(ScopContributionReport, self)._select_invoice()
select_str = """
SELECT
CAST(i.year AS VARCHAR),
i.type_contribution_id,
i.partner_id,
SUM(i.amount_total_signed) AS amount_called,
SUM(i.amount_total_signed - i.residual_company_signed) AS amount_paid,
SUM(i.residual_company_signed) AS amount_due,
(
CASE WHEN max(refund.id) IS NOT NULL THEN true ELSE FALSE END OR
CASE WHEN max(refund_b.id) IS NOT NULL THEN true ELSE FALSE END
) AS is_loss
"""
return select_str
def _from_invoice(self):
from_str = super(ScopContributionReport, self)._from_invoice()
from_str += """
LEFT JOIN
scop_bordereau b ON i.bordereau_id = b.id
LEFT JOIN
scop_bordereau refund_b ON b.id = refund_b.refund_id
"""
return from_str
def _where_invoice(self):
where_str = super(ScopContributionReport, self)._where_invoice()
where_str += "AND (i.bordereau_id IS NULL OR b.is_regul = false OR b.is_regul IS NULL)"
return where_str
# ------------------------------------------------------
# Computed fields
# ------------------------------------------------------
Fichier déplacé
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter