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

[add] report template for union sociale

parent 647f906e
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
"templates/report_scop_bordereau.xml", "templates/report_scop_bordereau.xml",
"templates/report_scop_bordereau_payments.xml", "templates/report_scop_bordereau_payments.xml",
"templates/report_scop_bordereau_refund.xml", "templates/report_scop_bordereau_refund.xml",
"templates/report_union_sociale.xml",
# Views # Views
"views/account_invoice.xml", "views/account_invoice.xml",
"views/res_config_settings.xml", "views/res_config_settings.xml",
......
...@@ -2,3 +2,4 @@ ...@@ -2,3 +2,4 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import main from . import main
from . import union_sociale
# Copyright 2021 Le Filament (<http://www.le-filament.com>)
# License AGPL-3 or later (http://www.gnu.org/licenses/agpl.html).
from werkzeug.exceptions import NotFound
from odoo import http
from odoo.http import request
class UnionSocialeController(http.Controller):
# ------------------------------------------------------
# Routes
# ------------------------------------------------------
@http.route(
['/union-sociale/<adh>',
'/union-sociale/<adh>/<year>'],
type='http', auth="public", method=['GET'], csrf=False, website=False)
def get_union_sociale_pdf(self, adh, year=False):
"""
URL pour générer le PDF de l'Union Sociale à joindre au
bordereau de cotisation
:params : adh -> num adhérent
:params : year -> année du bordereau
@return : PDF
"""
partner_id = request.env['res.partner'].sudo().search([('member_number', '=', adh)])
if partner_id:
ctx = {'year': int(year)} if year else {}
# Get report
report = request.env.ref('cgscop_cotisation_cg.cgscop_union_sociale_report')
# Create PDF
pdf = report.sudo().with_context(ctx).render_qweb_pdf([partner_id.id])[0]
pdfhttpheaders = [('Content-Type', 'application/pdf'),
('Content-Length', len(pdf)), ]
# Return PDF
return request.make_response(pdf, headers=pdfhttpheaders)
else:
raise NotFound()
static/src/img/logo-usscop.png

19,9 ko

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<template id="report_union_sociale_document">
<style>
.input-block-empty {
width: 15px; height: 15px;
display: inline-block;
border: 1px solid #ccc; background: #fafafa;
margin-right: 10px;
}
.input-empty {
width: 100%; height: 25px;
border: 1px solid #ccc; background: #fafafa;
}
.presta {
margin-bottom: 0;
font-size: 9px;
}
</style>
<t t-if="not o" t-set="o" t-value="doc"/>
<div class="page" style="font-size: 10px;">
<t t-foreach="range(1,5)" t-as="quarter">
<div id="union-sociale container" class="mt16 m32" style="page-break-inside: avoid;">
<hr/>
<div class="row">
<div class="col-8">
<p style="margin-bottom: 0; color: #E5074D; font-weight: bold; font-size: 13px;">
COTISATION UNION SOCIALE DES SCOP ET DES SCIC -
<t t-esc="quarter"/>
<t t-if="quarter == 1">er </t>
<t t-else="">ème </t>
Trimestre
<t t-esc="env.context.get('year', datetime.datetime.now().year)"/>
</p>
<p><strong><i>
L’Union Sociale perçoit directement sa cotisation,
merci de lui envoyer un règlement distinct</i></strong></p>
<p class="mt16">
<strong>N° ADHÉRENT : <t t-esc="o.member_number"/></strong>
<br/>
<strong>IDENTITÉ SOCIÉTÉ : <t t-esc="o.name.upper()"/></strong>
</p>
</div>
<div class="col-4">
<div class="text-right" style="font-size: 9px;">
<img src="/cgscop_cotisation_cg/static/src/img/logo-usscop.png" class="img-fluid" style="max-height: 60px;"/>
<br/>
Tel. : 01 43 07 18 08 - Fax: 01 43 41 50 44<br/>
<a href="mailto:contact@union-sociale.coop">contact@union-sociale.coop</a> - <a href="https://www.union-sociale.coop">www.union-sociale.coop</a>
</div>
</div>
</div>
<div class="row mt16">
<div class="col-6">
<div>
<p class="presta"><strong>SALAIRES BRUTS</strong> (non plafonnés du trimestre) :</p>
<p class="input-empty presta"></p>
</div>
<div>
<p class="presta">
- Pour <strong>PRESTABAT</strong> Scop parisiennes du bâtiment et des travaux publics x <strong>0,40</strong> :
</p>
<p class="input-empty presta"></p>
</div>
<div>
<p class="presta">
- Pour <strong>PRESTASUP</strong> Scop sur le plan national adhérentes à la super section x <strong>0,40</strong> :
</p>
<p class="input-empty presta"></p>
</div>
<div>
<p class="presta">
- Pour <strong>PRESTA</strong> les autres Scop x <strong>0,30</strong> :
</p>
<p class="input-empty presta"></p>
</div>
<div>
<p class="presta">
- Nombre de salariés à la fin de la période : :
</p>
<p class="input-empty"></p>
</div>
<div>
<p class="presta" style="margin-top: 10px; margin-bottom: 5px; font-size: 11px;">
<strong>
À retourner à l’Union Sociale avant le :
<t t-if="quarter != 4">
<t t-if="quarter != 3">
15/0<t t-esc="quarter * 3 + 1"/>/<t t-esc="env.context.get('year', datetime.datetime.now().year)"/>
</t>
<t t-else="">
15/<t t-esc="quarter * 3 + 1"/>/<t t-esc="env.context.get('year', datetime.datetime.now().year)"/>
</t>
</t>
<t t-else="">
15/0<t t-esc="quarter - 3"/>/<t t-esc="env.context.get('year', datetime.datetime.now().year) + 1"/>
</t>
</strong>
</p>
<div class="row">
<div class="col-1"><span class="input-block-empty"/></div>
<div class="col-5">Chèque</div>
<div class="col-1"><span class="input-block-empty"/></div>
<div class="col-5">Virement</div>
</div>
<div class="row">
<div class="col-6">Date : </div>
<div class="col-6">Signature : </div>
</div>
</div>
</div>
<div class="col-6">
<div style="padding-top: 70px; ">
<div style="padding: 20px; border: 1px solid #aaa; font-size: 13px;">
Union sociale des Scop et des Scic<br/>
61, boulevard de Picpus<br/>
75012 Paris
</div>
</div>
</div>
</div>
</div>
</t>
</div>
</template>
<template id="report_union_sociale">
<t t-call="web.basic_layout">
<t t-set="docs" t-value="docs.with_context(lang='fr')"/>
<t t-foreach="docs" t-as="o">
<t t-call="cgscop_cotisation_cg.report_union_sociale_document" t-lang="fr"/>
</t>
</t>
</template>
<record id="paperformat_union_sociale" model="report.paperformat">
<field name="name">A4 Union Sociale</field>
<field name="format">A4</field>
<field name="orientation">Portrait</field>
<field name="margin_top">10</field>
<field name="margin_bottom">10</field>
<field name="margin_left">10</field>
<field name="margin_right">10</field>
<field name="header_line" eval="False"/>
<field name="header_spacing">0</field>
<field name="dpi">90</field>
</record>
<!-- QWeb Reports -->
<report
id="cgscop_union_sociale_report"
model="res.partner"
string="Bordereau Union Sociale"
report_type="qweb-pdf"
name="cgscop_cotisation_cg.report_union_sociale"
file="cgscop_cotisation_cg.report_union_sociale"
paperformat="paperformat_union_sociale"
attachment_use="False"
/>
</data>
</odoo>
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