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

[add] bordereau regul

parent eca9b41e
Branches
Étiquettes
Aucune requête de fusion associée trouvée
...@@ -35,6 +35,44 @@ class ScopAccountInvoiceCG(models.Model): ...@@ -35,6 +35,44 @@ class ScopAccountInvoiceCG(models.Model):
round_to_closest_multiple( round_to_closest_multiple(
i.amount_cg_calculated * prorata, i.nb_quarter) i.amount_cg_calculated * prorata, i.nb_quarter)
# ------------------------------------------------------
# Override parent
# ------------------------------------------------------
@api.multi
def set_scop_contribution(self):
contrib_id = super(ScopAccountInvoiceCG, self).set_scop_contribution()
if self.cotisation_cg_id:
i = 4 - self.nb_quarter
schedule = {
'quarter_1': self.cotisation_cg_id.trimester_1,
'quarter_2': self.cotisation_cg_id.trimester_2,
'quarter_3': self.cotisation_cg_id.trimester_3,
'quarter_4': self.cotisation_cg_id.trimester_4,
}
while i != 0:
key = 'quarter_' + str(i)
schedule.pop(key, None)
i -= 1
contrib_id.update(schedule)
return contrib_id
def set_scop_contribution_hook(self, contrib_id):
"""
Compute contribution line amount if bordereau regul
:param contrib_id:
:return:
"""
super(ScopAccountInvoiceCG, self).set_scop_contribution_hook(contrib_id)
if self.bordereau_id:
invoice_ids = self.bordereau_id.invoice_ids.filtered(
lambda i: i.type_contribution_id == contrib_id.type_id
)
contrib_id.update({
'amount_calculated': sum(invoice_ids.mapped('amount_total_signed')),
'amount_called': sum(invoice_ids.mapped('amount_total_signed')),
})
return contrib_id
# ------------------------------------------------------ # ------------------------------------------------------
# Global functions # Global functions
# ------------------------------------------------------ # ------------------------------------------------------
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<p> <p>
N° adhérent : <t t-esc="str(o.partner_id.member_number_int)"/><br/> N° adhérent : <t t-esc="str(o.partner_id.member_number_int)"/><br/>
Union régionale : <span t-field="o.partner_ur_id.name"/><br/> Union régionale : <span t-field="o.partner_ur_id.name"/><br/>
N° Bordereau : <span t-field="o.name"/> N° Bordereau : <span t-field="o.name"/><t t-if="o.is_regul">-<span t-field="o.version"/></t>
</p> </p>
</div> </div>
</div> </div>
...@@ -35,6 +35,14 @@ ...@@ -35,6 +35,14 @@
<t t-if="o.partner_id.cedex"> <span t-field="o.partner_id.cedex"/></t> <t t-if="o.partner_id.cedex"> <span t-field="o.partner_id.cedex"/></t>
</div> </div>
</div> </div>
<t t-if="o.is_regul">
<div class="row">
<div class="col-12" style="test-align: justify;">
Une régularisation du bordereau initial a été effectuée pour le motif suivant : <span t-field="o.comment_regul"/><br/>
Date de régularisation : <span t-field="o.date_regul"/>
</div>
</div>
</t>
<div class="row mb16"> <div class="row mb16">
<div class="col-12" style="font-style: italic; test-align: justify;"> <div class="col-12" style="font-style: italic; test-align: justify;">
Les cotisations sont calculées annuellement en début d’année sur la base du dernier exercice connu. Le versement se fait par quart tous les trimestres. Merci de retourner ce bordereau à la CG Scop avec le règlement correspondant Les cotisations sont calculées annuellement en début d’année sur la base du dernier exercice connu. Le versement se fait par quart tous les trimestres. Merci de retourner ce bordereau à la CG Scop avec le règlement correspondant
...@@ -52,8 +60,8 @@ ...@@ -52,8 +60,8 @@
<t t-set="amount_line" t-value="o.get_contribution_type()" /> <t t-set="amount_line" t-value="o.get_contribution_type()" />
<table class="table table-sm" style="border: none;"> <table class="table table-sm" style="border: none;">
<tr t-foreach="amount_line" t-as="line" style="border-bottom: 1px solid #ccc;"> <tr t-foreach="amount_line" t-as="line" style="border-bottom: 1px solid #ccc;">
<td style="border: none; background: inherit; color: inherit;"><t t-esc="line.get('type_contribution')"/></td> <td style="border: none; background: inherit; color: inherit;"><t t-esc="line.get('type_contribution_id')[1]"/></td>
<td class="text-right" style="border: none; background: inherit; color: inherit;"><t t-esc="line.get('amount')" t-options="{'widget': 'monetary', 'display_currency': o.company_id.currency_id}"/></td> <td class="text-right" style="border: none; background: inherit; color: inherit;"><t t-esc="line.get('amount_total_signed')" t-options="{'widget': 'monetary', 'display_currency': o.company_id.currency_id}"/></td>
</tr> </tr>
</table> </table>
</p> </p>
......
...@@ -16,17 +16,31 @@ ...@@ -16,17 +16,31 @@
<button name="print_bordereau" string="Imprimer" type="object" states="validated,paid"/> <button name="print_bordereau" string="Imprimer" type="object" states="validated,paid"/>
<button name="action_send_email" string="Envoyer par mail" type="object" states="validated"/> <button name="action_send_email" string="Envoyer par mail" type="object" states="validated"/>
<button name="update_cotiz_and_lines" class="btn-info" string="Mettre à jour les cotisations" type="object" states="new"/> <button name="update_cotiz_and_lines" class="btn-info" string="Mettre à jour les cotisations" type="object" states="new"/>
<button name="%(cgscop_cotisation_cg.scop_cotisation_regul_wizard_act_window)d"
class="btn-warning"
string="Effectuer une Régularisation"
type="action"
states="validated,paid"/>
</header> </header>
<sheet> <sheet>
<div class="oe_title"> <div class="oe_title">
<h1> <h1>
<field name="name" placeholder="Title"/> <field name="name"/>
<span class="o_field_char o_field_widget" attrs="{'invisible': [('version', '=', 1)]}">-</span>
<field name="version" attrs="{'invisible': [('version', '=', 1)]}"/>
</h1> </h1>
</div> </div>
<h4> <h4>
Adhérent : <field name="partner_id"/> <br/> Adhérent : <field name="partner_id"/> <br/>
UR : <field name="partner_ur_id" readonly="True" options="{'no_open': True}"/> UR : <field name="partner_ur_id" readonly="True" options="{'no_open': True}"/>
</h4> </h4>
<field name="is_regul" invisible="1"/>
<div class="alert alert-warning" role="alert" attrs="{'invisible': [('is_regul', '!=', True)]}">
<group>
<field name="date_regul"/>
<field name="comment_regul"/>
</group>
</div>
<group> <group>
<group> <group>
<field name="base_cotisation_cg"/> <field name="base_cotisation_cg"/>
...@@ -47,18 +61,21 @@ ...@@ -47,18 +61,21 @@
<field name="invoice_ids" widget="one2many"> <field name="invoice_ids" widget="one2many">
<tree edit="false" create="false" delete="false"> <tree edit="false" create="false" delete="false">
<field name="type_contribution_id"/> <field name="type_contribution_id"/>
<field name="date_due"/> <field name="date_invoice"/>
<field name="name"/>
<field name="amount_total_signed" string="Montant total" sum="Total"/> <field name="amount_total_signed" string="Montant total" sum="Total"/>
<field name="residual" string="Montant dû" sum="Total"/> <field name="residual_signed" string="Montant dû" sum="Total"/>
<field name="state"/> <field name="state"/>
<button name="view_cotiz" string="Afficher" type="object" icon="fa-pencil-square-o"/> <button name="view_cotiz" string="Afficher" type="object" icon="fa-pencil-square-o"/>
</tree> </tree>
<form> <form>
<group> <group>
<field name="type_contribution_id"/> <field name="type_contribution_id"/>
<field name="date_due"/> <field name="date_invoice"/>
<field name="name"/>
<field name="amount_cg_calculated"/> <field name="amount_cg_calculated"/>
<field name="amount_total_signed"/> <field name="amount_total_signed"/>
<field name="residual_signed"/>
<field name="nb_quarter" /> <field name="nb_quarter" />
<field name="state"/> <field name="state"/>
</group> </group>
...@@ -124,7 +141,9 @@ ...@@ -124,7 +141,9 @@
<field name="model">scop.bordereau</field> <field name="model">scop.bordereau</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<tree decoration-info="state == 'new'" create="false" string="Bordereaux"> <tree decoration-info="state == 'new'" create="false" string="Bordereaux">
<field name="member_number"/>
<field name="partner_id"/> <field name="partner_id"/>
<field name="partner_ur_id"/>
<field name="year"/> <field name="year"/>
<field name="state"/> <field name="state"/>
<field name="type_assiette_retenu"/> <field name="type_assiette_retenu"/>
......
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