Browse Source

Merge pull request #68 from coopiteasy/12.0-mig-easy_my_coop_taxshelter_report

12.0 mig easy my coop taxshelter report
pull/74/head 12.0-2020-03-12.00
Manuel Claeys Bouuaert 4 years ago
committed by GitHub
parent
commit
7a16528ba5
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      easy_my_coop_taxshelter_report/__init__.py
  2. 33
      easy_my_coop_taxshelter_report/__manifest__.py
  3. 44
      easy_my_coop_taxshelter_report/__openerp__.py
  4. 113
      easy_my_coop_taxshelter_report/data/mail_template_data.xml
  5. 31
      easy_my_coop_taxshelter_report/data/scheduler_data.xml
  6. 40
      easy_my_coop_taxshelter_report/demo/tax_shelter_demo.xml
  7. 6
      easy_my_coop_taxshelter_report/i18n/fr_BE.po
  8. 4
      easy_my_coop_taxshelter_report/models/__init__.py
  9. 116
      easy_my_coop_taxshelter_report/models/mail_template.py
  10. 826
      easy_my_coop_taxshelter_report/models/tax_shelter_declaration.py
  11. 47
      easy_my_coop_taxshelter_report/reports/tax_shelter_report.xml
  12. 208
      easy_my_coop_taxshelter_report/reports/tax_shelter_resold_report.xml
  13. 310
      easy_my_coop_taxshelter_report/reports/tax_shelter_shares_report.xml
  14. 268
      easy_my_coop_taxshelter_report/reports/tax_shelter_subscription_report.xml
  15. 14
      easy_my_coop_taxshelter_report/security/ir.model.access.csv
  16. 19
      easy_my_coop_taxshelter_report/static/src/css/coop_report.css
  17. 400
      easy_my_coop_taxshelter_report/views/tax_shelter_declaration_view.xml

2
easy_my_coop_taxshelter_report/__init__.py

@ -1 +1 @@
from . import models
from . import models

33
easy_my_coop_taxshelter_report/__manifest__.py

@ -0,0 +1,33 @@
# Copyright 2013-2018 Open Architects Consulting SPRL.
# Copyright 2018 Coop IT Easy SCRLfs (<http://www.coopiteasy.be>)
# - Houssine Bakkali <houssine@coopiteasy.be>
# - Elouan Le Bars <elouan@coopiteasy.be>
# - Rémy Taymans <remy@coopiteasy.be>
# - Manuel Claeys Bouuaert <manuel@coopiteasy.be>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
# todo check ir model access
"name": "Easy My Coop tax shelter report",
"version": "12.0.1.0.1",
"depends": ["easy_my_coop"],
"author": "Houssine BAKKALI <houssine@coopiteasy.be>",
"category": "Cooperative management",
"website": "www.coopiteasy.be",
"license": "AGPL-3",
"description": """
This module allows you to create a fiscal declaration year and to print
tax shelter declaration for each cooperator.
""",
"data": [
"security/ir.model.access.csv",
"reports/tax_shelter_report.xml",
"reports/tax_shelter_subscription_report.xml",
"reports/tax_shelter_shares_report.xml",
"views/tax_shelter_declaration_view.xml",
"data/mail_template_data.xml",
"data/scheduler_data.xml",
],
"demo": ["demo/tax_shelter_demo.xml"],
"installable": True,
}

44
easy_my_coop_taxshelter_report/__openerp__.py

@ -1,44 +0,0 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2013-2017 Open Architects Consulting SPRL.
# Copyright (C) 2018- Coop IT Easy SCRLfs.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
{
# todo check ir model access
"name": "Easy My Coop tax shelter report",
"version": "1.0",
"depends": ["easy_my_coop"],
"author": "Houssine BAKKALI <houssine@coopiteasy.be>",
"category": "Cooperative management",
'website': "www.coopiteasy.be",
"license": "AGPL-3",
"description": """
This module allows to create a fiscal declaration year and to print
tax shelter declaration each cooperator
""",
'data': [
'security/ir.model.access.csv',
'reports/tax_shelter_report.xml',
'reports/tax_shelter_subscription_report.xml',
'reports/tax_shelter_shares_report.xml',
'views/tax_shelter_declaration_view.xml',
'data/mail_template_data.xml',
'data/scheduler_data.xml',
],
'installable': True,
}

113
easy_my_coop_taxshelter_report/data/mail_template_data.xml

@ -1,56 +1,57 @@
<odoo>
<!-- Mail template are declared in a NOUPDATE block
so users can freely customize/delete them -->
<data noupdate="1">
<record id="email_template_tax_shelter_certificate" model="mail.template">
<field name="name">Tax Shelter Certificate - Send By Email</field>
<field name="email_from">${(object.company_id.coop_email_contact or object.user_id.email)|safe}</field>
<field name="subject">Tax Shelter Certificate</field>
<field name="partner_to">${object.partner_id.id}</field>
<field name="reply_to">${(object.company_id.coop_email_contact or object.user_id.email)|safe}</field>
<field name="model_id" ref="model_tax_shelter_certificate"/>
<field name="auto_delete" eval="True"/>
<field name="lang">${object.partner_id.lang}</field>
<field name="easy_my_coop" eval="True"/>
<field name="body_html"><![CDATA[
<div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; ">
<p>Hello ${object.partner_id.name},</p>
<p>You have subscribed to some shares of ${object.company_id.name} on ${object.declaration_id.fiscal_year}.
You can benefit from the tax shelter, it means a tax reduction of ${object.declaration_id.tax_shelter_percentage} percent on the invested amount.
For this you will find in attachments the documents certifying that you've suscribed to ${object.company_id.name} shares</p>
<p>A dedicated FAQ is coming soon on ${object.company_id.website}.</p>
<p>For any additional questions, please contact ${object.company_id.coop_email_contact}</p>
<p>Sustainably your,</p>
<p>${object.company_id.name}.</p>
% if object.company_id.street:
${object.company_id.street}
% endif
% if object.company_id.street2:
${object.company_id.street2}<br/>
% endif
% if object.company_id.city or object.company_id.zip:
${object.company_id.zip} ${object.company_id.city}<br/>
% endif
% if object.company_id.country_id:
${object.company_id.state_id and ('%s, ' % object.company_id.state_id.name) or ''} ${object.company_id.country_id.name or ''}<br/>
% endif
% if object.company_id.phone:
Phone:&nbsp; ${object.company_id.phone}
% endif
% if object.company_id.website:
<div>
Web :&nbsp;<a href="${object.company_id.website}">${object.company_id.website}</a>
</div>
%endif
<div>
<img src=${object.company_id.logo_web}>
</div>
</div>
]]></field>
</record>
</data>
</odoo>
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Mail template are declared in a NOUPDATE block
so users can freely customize/delete them -->
<data noupdate="1">
<record id="email_template_tax_shelter_certificate" model="mail.template">
<field name="name">Tax Shelter Certificate - Send By Email</field>
<field name="email_from">${(object.company_id.coop_email_contact or object.user_id.email)|safe}</field>
<field name="subject">Tax Shelter Certificate</field>
<field name="partner_to">${object.partner_id.id}</field>
<field name="reply_to">${(object.company_id.coop_email_contact or object.user_id.email)|safe}</field>
<field name="model_id" ref="model_tax_shelter_certificate"/>
<field name="auto_delete" eval="True"/>
<field name="lang">${object.partner_id.lang}</field>
<field name="easy_my_coop" eval="True"/>
<field name="body_html"><![CDATA[
<div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; ">
<p>Hello ${object.partner_id.name},</p>
<p>You have subscribed to some shares of ${object.company_id.name} on ${object.declaration_id.fiscal_year}.
You can benefit from the tax shelter, it means a tax reduction of ${object.declaration_id.tax_shelter_percentage} percent on the invested amount.
For this you will find in attachments the documents certifying that you've suscribed to ${object.company_id.name} shares</p>
<p>A dedicated FAQ is coming soon on ${object.company_id.website}.</p>
<p>For any additional questions, please contact ${object.company_id.coop_email_contact}</p>
<p>Sustainably your,</p>
<p>${object.company_id.name}.</p>
% if object.company_id.street:
${object.company_id.street}
% endif
% if object.company_id.street2:
${object.company_id.street2}<br/>
% endif
% if object.company_id.city or object.company_id.zip:
${object.company_id.zip} ${object.company_id.city}<br/>
% endif
% if object.company_id.country_id:
${object.company_id.state_id and ('%s, ' % object.company_id.state_id.name) or ''} ${object.company_id.country_id.name or ''}<br/>
% endif
% if object.company_id.phone:
Phone:&nbsp; ${object.company_id.phone}
% endif
% if object.company_id.website:
<div>
Web :&nbsp;<a href="${object.company_id.website}">${object.company_id.website}</a>
</div>
%endif
<div>
<img src=${object.company_id.logo_web}>
</div>
</div>
]]></field>
</record>
</data>
</odoo>

31
easy_my_coop_taxshelter_report/data/scheduler_data.xml

@ -1,16 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<record forcecreate="True" id="ir_cron_mail_tax_shelter_action" model="ir.cron">
<field name="name">Tax shelter mail batch mail</field>
<field name="user_id" ref="base.user_root"/>
<field name="interval_number">1</field>
<field name="interval_type">hours</field>
<field name="numbercall">-1</field>
<field eval="False" name="doall"/>
<field eval="'tax.shelter.certificate'" name="model"/>
<field eval="'batch_send_tax_shelter_certificate'" name="function"/>
<field eval="'()'" name="args"/>
</record>
</data>
</odoo>
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<record forcecreate="True" id="ir_cron_mail_tax_shelter_action" model="ir.cron">
<field name="name">Tax shelter mail batch mail</field>
<field name="model_id" ref="model_tax_shelter_certificate"/>
<field name="state">code</field>
<field name="code">model.batch_send_tax_shelter_certificate()</field>
<field name="interval_number">1</field>
<field name="interval_type">hours</field>
<field name="numbercall">-1</field>
<field name="doall" eval="False"/>
</record>
</data>
</odoo>

40
easy_my_coop_taxshelter_report/demo/tax_shelter_demo.xml

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2019 Coop IT Easy
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo>
<record id="tax_shelter_declaration_1_demo" model="tax.shelter.declaration">
<field name="name">2019</field>
<field name="fiscal_year">2018</field>
<field name="date_from">2018-01-01</field>
<field name="date_to">2018-12-31</field>
<field name="month_from">January</field>
<field name="month_to">December</field>
<field name="tax_shelter_percentage">45</field>
<field name="state">validated</field>
<field name="tax_shelter_capital_limit">143875.00</field>
<field name="previously_subscribed_capital">0.00</field>
</record>
<record id="tax_shelter_certificate_1_demo" model="tax.shelter.certificate">
<field name="cooperator_number">1</field>
<field name="partner_id" ref="easy_my_coop.res_partner_cooperator_1_demo"/>
<field name="declaration_id" ref="easy_my_coop_taxshelter_report.tax_shelter_declaration_1_demo"/>
<field name="state">sent</field>
</record>
<record id="certificate_line_1_demo" model="certificate.line">
<field name="tax_shelter_certificate" ref="easy_my_coop_taxshelter_report.tax_shelter_certificate_1_demo"/>
<field name="share_type" model="product.template" eval="obj(ref('easy_my_coop.product_template_share_type_1_demo')).product_variant_id.id"/>
<field name="share_unit_price">25</field>
<field name="quantity">12</field>
<field name="transaction_date" eval="datetime.now() - timedelta(days=45)"/>
<field name="tax_shelter" eval="True" />
<field name="type">subscribed</field>
</record>
<record id="tax_shelter_certificate_1_demo" model="tax.shelter.certificate">
<field name="lines" eval="[(4, ref('certificate_line_1_demo'))]"/>
</record>
</odoo>

6
easy_my_coop_taxshelter_report/i18n/fr_BE.po

@ -572,12 +572,12 @@ msgid "Tax shelter eligible"
msgstr "Eligible au Tax Shelter"
#. module: easy_my_coop_taxshelter_report
#: model:ir.actions.report.xml,name:easy_my_coop_taxshelter_report.action_tax_shelter_shares_report
#: model:ir.actions.report,name:easy_my_coop_taxshelter_report.action_tax_shelter_shares_report
msgid "Tax shelter shares report"
msgstr "Attestation de parts Tax Shelter"
#. module: easy_my_coop_taxshelter_report
#: model:ir.actions.report.xml,name:easy_my_coop_taxshelter_report.action_tax_shelter_subscription_report
#: model:ir.actions.report,name:easy_my_coop_taxshelter_report.action_tax_shelter_subscription_report
msgid "Tax shelter subscription report"
msgstr "Attestation de souscription Tax Shelter"
@ -593,7 +593,7 @@ msgstr "Montant total"
#. module: easy_my_coop_taxshelter_report
#: model:ir.model.fields,field_description:easy_my_coop_taxshelter_report.field_tax_shelter_certificate_total_amount_eligible
msgid "Total amount eligible To Tax shelter"
msgid "Total eligible amount"
msgstr "Montant total éligible au Tax Shelter"
#. module: easy_my_coop_taxshelter_report

4
easy_my_coop_taxshelter_report/models/__init__.py

@ -1,2 +1,2 @@
from . import tax_shelter_declaration
from . import mail_template
from . import tax_shelter_declaration
from . import mail_template

116
easy_my_coop_taxshelter_report/models/mail_template.py

@ -1,60 +1,56 @@
from odoo import api, models
class MailTemplate(models.Model):
_inherit = "mail.template"
# def init(self):
# for template_id in EMAIL_TEMPLATE_IDS:
# mail_template = self.env.ref(template_id)
# mail_template.easy_my_coop = True
@api.multi
def send_mail_with_multiple_attachments(self, res_id,
additional_attachments,
force_send=False,
raise_exception=False):
"""Generates a new mail message for the given template and record,
and schedules it for delivery through the ``mail``
module's scheduler.
:param int res_id: id of the record to render the template with
(model is taken from the template)
:param bool force_send: if True, the generated mail.message is
immediately sent after being created, as if the scheduler
was executed for this message only.
:returns: id of the mail.message that was created
"""
self.ensure_one()
Mail = self.env['mail.mail']
# TDE FIXME: should remove dfeault_type from context
Attachment = self.env['ir.attachment']
# create a mail_mail based on values, without attachments
values = self.generate_email(res_id)
values['recipient_ids'] = [(4, pid) for pid in values.get('partner_ids', list())]
attachment_ids = values.pop('attachment_ids', [])
attachments = values.pop('attachments', [])
# add a protection against void email_from
if 'email_from' in values and not values.get('email_from'):
values.pop('email_from')
mail = Mail.create(values)
# manage attachments
attachments.extend(additional_attachments)
for attachment in attachments:
attachment_data = {
'name': attachment[0],
'datas_fname': attachment[0],
'datas': attachment[1],
'res_model': 'mail.message',
'res_id': mail.mail_message_id.id,
}
attachment_ids.append(Attachment.create(attachment_data).id)
if attachment_ids:
values['attachment_ids'] = [(6, 0, attachment_ids)]
mail.write({'attachment_ids': [(6, 0, attachment_ids)]})
if force_send:
mail.send(raise_exception=raise_exception)
return mail.id # TDE CLEANME: return mail + api.returns ?
from odoo import api, models
class MailTemplate(models.Model):
_inherit = "mail.template"
@api.multi
def send_mail_with_multiple_attachments(
self, res_id, additional_attachments, force_send=False, raise_exception=False
):
"""Generates a new mail message for the given template and record,
and schedules it for delivery through the ``mail``
module's scheduler.
:param int res_id: id of the record to render the template with
(model is taken from the template)
:param bool force_send: if True, the generated mail.message is
immediately sent after being created, as if the scheduler
was executed for this message only.
:returns: id of the mail.message that was created
"""
self.ensure_one()
Mail = self.env["mail.mail"]
# TDE FIXME: should remove dfeault_type from context
Attachment = self.env["ir.attachment"]
# create a mail_mail based on values, without attachments
values = self.generate_email(res_id)
values["recipient_ids"] = [
(4, pid) for pid in values.get("partner_ids", list())
]
attachment_ids = values.pop("attachment_ids", [])
attachments = values.pop("attachments", [])
# add a protection against void email_from
if "email_from" in values and not values.get("email_from"):
values.pop("email_from")
mail = Mail.create(values)
# manage attachments
attachments.extend(additional_attachments)
for attachment in attachments:
attachment_data = {
"name": attachment[0],
"datas_fname": attachment[0],
"datas": attachment[1],
"res_model": "mail.message",
"res_id": mail.mail_message_id.id,
}
attachment_ids.append(Attachment.create(attachment_data).id)
if attachment_ids:
values["attachment_ids"] = [(6, 0, attachment_ids)]
mail.write({"attachment_ids": [(6, 0, attachment_ids)]})
if force_send:
mail.send(raise_exception=raise_exception)
return mail.id # TDE CLEANME: return mail + api.returns ?

826
easy_my_coop_taxshelter_report/models/tax_shelter_declaration.py

@ -1,363 +1,463 @@
# -*- coding: utf-8 -*-
import base64
from openerp import api, fields, models
TYPE_MAP = {
'subscription': 'subscribed',
'transfer': 'transfered',
'sell_back': 'resold'
}
REPORT_DIC = {
'subscription': (
'easy_my_coop_taxshelter_report.tax_shelter_subscription_report',
'Tax Shelter Subscription'
),
'shares': (
'easy_my_coop_taxshelter_report.tax_shelter_shares_report',
'Tax Shelter Shares'
)
}
class TaxShelterDeclaration(models.Model):
_name = "tax.shelter.declaration"
name = fields.Char(string='Declaration year', required=True)
fiscal_year = fields.Char(String="Fiscal year", required=True)
tax_shelter_certificates = fields.One2many('tax.shelter.certificate',
'declaration_id',
string='Tax shelter certificates',
readonly=True)
date_from = fields.Date(string='Date from', required=True)
date_to = fields.Date(string='Date to', required=True)
month_from = fields.Char(String='Month from', required=True)
month_to = fields.Char(String='Month to', required=True)
tax_shelter_percentage = fields.Selection([('30', '30%'),
('45', '45%')],
string='Tax Shelter percentage',
required=True)
state = fields.Selection([('draft', 'Draft'),
('computed', 'Computed'),
('validated', 'Validated')],
string='State', required=True, default="draft")
company_id = fields.Many2one('res.company', string='Company',
required=True,
change_default=True, readonly=True,
default=lambda self: self.env['res.company']._company_default_get())
tax_shelter_capital_limit = fields.Float(string="Tax shelter capital limit",
required=True)
previously_subscribed_capital = fields.Float(String="Capital previously subscribed",
readonly=True)
excluded_cooperator = fields.Many2many('res.partner',
string="Excluded cooperator",
domain=[('cooperator', '=', True)],
help="If these cooperator have"
" subscribed share during the time"
" frame of this Tax Shelter "
"Declaration. They will be marked "
"as non eligible")
def _excluded_from_declaration(self, entry):
if entry.date >= self.date_from and entry.date <= self.date_to:
declaration = self
else:
declaration = self.search([('date_from', '<=', entry.date),
('date_to', '>=', entry.date)])
if entry.partner_id.id in declaration.excluded_cooperator.ids:
return True
return False
def _prepare_line(self, certificate, entry, ongoing_capital_sub, excluded):
line_vals = {}
line_vals['tax_shelter_certificate'] = certificate.id
line_vals['share_type'] = entry.share_product_id.id
line_vals['share_short_name'] = entry.share_short_name
line_vals['share_unit_price'] = entry.share_unit_price
line_vals['quantity'] = entry.quantity
line_vals['transaction_date'] = entry.date
line_vals['type'] = TYPE_MAP[entry.type]
if entry.type == 'subscription':
if not excluded:
capital_after_sub = ongoing_capital_sub + entry.total_amount_line
else:
capital_after_sub = ongoing_capital_sub
line_vals['capital_before_sub'] = ongoing_capital_sub
line_vals['capital_after_sub'] = capital_after_sub
line_vals['capital_limit'] = self.tax_shelter_capital_limit
if ongoing_capital_sub < self.tax_shelter_capital_limit and not excluded:
line_vals['tax_shelter'] = True
return line_vals
def _compute_certificates(self, entries, partner_certificate):
ongoing_capital_sub = 0.0
for entry in entries:
certificate = partner_certificate.get(entry.partner_id.id, False)
if not certificate:
# create a certificate for this cooperator
cert_vals = {}
cert_vals['declaration_id'] = self.id
cert_vals['partner_id'] = entry.partner_id.id
cert_vals['cooperator_number'] = entry.partner_id.cooperator_register_number
certificate = self.env['tax.shelter.certificate'].create(cert_vals)
partner_certificate[entry.partner_id.id] = certificate
excluded = self._excluded_from_declaration(entry)
line_vals = self._prepare_line(certificate, entry, ongoing_capital_sub, excluded)
certificate.write({'lines': [(0, 0, line_vals)]})
if entry.type == 'subscription' and not excluded:
ongoing_capital_sub += entry.total_amount_line
return partner_certificate
@api.one
def compute_declaration(self):
entries = self.env['subscription.register'].search([
('partner_id.is_company', '=', False),
('date', '<=', self.date_to),
('type', 'in', ['subscription',
'sell_back',
'transfer'])
])
subscriptions = entries.filtered((lambda r: r.type == 'subscription' and r.date < self.date_from)) #noqa
cap_prev_sub = 0.0
for subscription in subscriptions:
cap_prev_sub += subscription.total_amount_line
self.previously_subscribed_capital = cap_prev_sub
partner_cert = {}
partner_cert = self._compute_certificates(entries, partner_cert)
self.state = 'computed'
@api.one
def validate_declaration(self):
self.tax_shelter_certificates.write({'state': 'validated'})
self.state = 'validated'
@api.one
def reset_declaration(self):
if not self.state == 'validated':
self.tax_shelter_certificates.unlink()
self.state = 'draft'
class TaxShelterCertificate(models.Model):
_name = "tax.shelter.certificate"
_order = "cooperator_number asc"
cooperator_number = fields.Integer(string='Cooperator number',
required=True,
readonly=True)
partner_id = fields.Many2one('res.partner', string='Cooperator',
required=True, readonly=True)
state = fields.Selection([('draft', 'Draft'),
('validated', 'Validated'),
('no_eligible', 'No eligible'),
('sent', 'Sent')],
string='State', required=True, default="draft")
declaration_id = fields.Many2one('tax.shelter.declaration',
string='Declaration', required=True,
readonly=True)
lines = fields.One2many('certificate.line',
'tax_shelter_certificate',
string='Certificate lines', readonly=True)
previously_subscribed_lines = fields.One2many(compute='_compute_certificate_lines',
comodel_name='certificate.line',
string='Previously Subscribed lines',
readonly=True)
previously_subscribed_eligible_lines = fields.One2many(
compute='_compute_certificate_lines',
comodel_name='certificate.line',
string='Previously Subscribed eligible lines',
readonly=True)
subscribed_lines = fields.One2many(compute='_compute_certificate_lines',
comodel_name='certificate.line',
string='Shares subscribed',
readonly=True)
resold_lines = fields.One2many(compute='_compute_certificate_lines',
comodel_name='certificate.line',
string='Shares resold',
readonly=True)
transfered_lines = fields.One2many(compute='_compute_certificate_lines',
comodel_name='certificate.line',
string='Shares transfered',
readonly=True)
total_amount_previously_subscribed = fields.Float(compute='_compute_amounts',
string='Total previously subscribed')
total_amount_eligible_previously_subscribed = fields.Float(compute='_compute_amounts',
string='Total eligible previously subscribed')
total_amount_subscribed = fields.Float(compute='_compute_amounts',
string='Total subscribed')
total_amount_eligible = fields.Float(compute='_compute_amounts',
string='Total amount eligible To Tax shelter')
total_amount_resold = fields.Float(compute='_compute_amounts',
string='Total resold')
total_amount_transfered = fields.Float(compute='_compute_amounts',
string='Total transfered')
total_amount = fields.Float(compute='_compute_amounts',
string='Total', readonly=True)
company_id = fields.Many2one(related="declaration_id.company_id",
string="Company")
def generate_pdf_report(self, report_type):
report_action, name = REPORT_DIC[report_type]
report = self.env['report'].get_pdf(self, report_action)
report = base64.b64encode(report)
report_name = self.partner_id.name + ' ' + name + ' ' + self.declaration_id.name + '.pdf'
return (report_name, report)
def generate_certificates_report(self):
attachments = []
if self.total_amount_eligible > 0:
attachments.append(self.generate_pdf_report('subscription'))
if self.partner_id.total_value > 0:
attachments.append(self.generate_pdf_report('shares'))
# if self.total_amount_resold > 0 or self.total_amount_transfered > 0:
# TODO
return attachments
@api.multi
def send_certificates(self):
tax_shelter_mail_template = self.env.ref('easy_my_coop_taxshelter_report.email_template_tax_shelter_certificate', False)
for certificate in self:
if certificate.total_amount_eligible + certificate.total_amount_eligible_previously_subscribed > 0:
attachments = certificate.generate_certificates_report()
if len(attachments) > 0:
tax_shelter_mail_template.send_mail_with_multiple_attachments(certificate.id, attachments,True)
certificate.state = 'sent'
else:
certificate.state = 'no_eligible'
self.env.cr.commit()
@api.multi
def print_subscription_certificate(self):
self.ensure_one()
return self.env['report'].get_action(self, 'easy_my_coop_taxshelter_report.tax_shelter_subscription_report')
@api.multi
def print_shares_certificate(self):
self.ensure_one()
return self.env['report'].get_action(self, 'easy_my_coop_taxshelter_report.tax_shelter_shares_report')
@api.multi
def _compute_amounts(self):
for certificate in self:
total_amount_previously_subscribed = 0
total_amount_previously_eligible = 0
total_amount_subscribed = 0
total_amount_elligible = 0
total_amount_transfered = 0
total_amount_resold = 0
for line in certificate.subscribed_lines:
total_amount_subscribed += line.amount_subscribed
total_amount_elligible += line.amount_subscribed_eligible
certificate.total_amount_subscribed = total_amount_subscribed
certificate.total_amount_eligible = total_amount_elligible
for line in certificate.previously_subscribed_eligible_lines:
total_amount_previously_eligible += line.amount_subscribed_eligible
certificate.total_amount_eligible_previously_subscribed = total_amount_previously_eligible
for line in certificate.previously_subscribed_lines:
total_amount_previously_subscribed += line.amount_subscribed
certificate.total_amount_previously_subscribed = total_amount_previously_subscribed
for line in certificate.transfered_lines:
total_amount_transfered += line.amount_transfered
certificate.total_amount_transfered = total_amount_transfered
for line in certificate.resold_lines:
total_amount_resold += line.amount_resold
certificate.total_amount_resold = total_amount_resold
certificate.total_amount = certificate.total_amount_previously_subscribed + certificate.total_amount_subscribed + certificate.total_amount_resold + certificate.total_amount_transfered
@api.multi
def _compute_certificate_lines(self):
for certificate in self:
certificate.previously_subscribed_lines = certificate.lines.filtered(lambda r: r.type == 'subscribed' and r.transaction_date < certificate.declaration_id.date_from)
certificate.previously_subscribed_eligible_lines = certificate.lines.filtered(lambda r: r.type == 'subscribed' and r.transaction_date < certificate.declaration_id.date_from and r.tax_shelter)
certificate.subscribed_lines = certificate.lines.filtered(lambda r: r.type == 'subscribed' and r.transaction_date >= certificate.declaration_id.date_from and r.transaction_date <= certificate.declaration_id.date_to)
certificate.resold_lines = certificate.lines.filtered(lambda r: r.type == 'resold' and r.transaction_date >= certificate.declaration_id.date_from and r.transaction_date <= certificate.declaration_id.date_to)
certificate.transfered_lines = certificate.lines.filtered(lambda r: r.type == 'transfered' and r.transaction_date >= certificate.declaration_id.date_from and r.transaction_date <= certificate.declaration_id.date_to)
@api.model
def batch_send_tax_shelter_certificate(self):
certificates = self.search([('state', '=', 'validated')], limit=80)
certificates.send_certificates()
class TaxShelterCertificateLine(models.Model):
_name = "certificate.line"
declaration_id = fields.Many2one(related='tax_shelter_certificate.declaration_id',
string="Declaration")
tax_shelter_certificate = fields.Many2one('tax.shelter.certificate',
string="Tax shelter certificate",
ondelete='cascade',
required=True)
share_type = fields.Many2one('product.product',
string='Share type',
required=True,
readonly=True)
share_unit_price = fields.Float(string='Share price',
required=True,
readonly=True)
quantity = fields.Integer(string='Number of shares',
required=True,
readonly=True)
transaction_date = fields.Date(string="Transaction date")
tax_shelter = fields.Boolean(string="Tax shelter eligible", readonly=True)
type = fields.Selection([('subscribed', 'Subscribed'),
('resold', 'Resold'),
('transfered', 'Transfered'),
('kept', 'Kept')],
required=True, readonly=True)
amount_subscribed = fields.Float(compute='_compute_totals',
string='Amount subscribed',
store=True)
amount_subscribed_eligible = fields.Float(compute='_compute_totals',
string='Amount subscribed eligible',
store=True)
amount_resold = fields.Float(compute='_compute_totals',
string='Amount resold',
store=True)
amount_transfered = fields.Float(compute='_compute_totals',
string='Amount transfered',
store=True)
share_short_name = fields.Char(string='Share type name', readonly=True)
capital_before_sub = fields.Float(string="Capital before subscription",
readonly=True)
capital_after_sub = fields.Float(string="Capital after subscription",
readonly=True)
capital_limit = fields.Float(string="Capital limit", readonly=True)
@api.multi
@api.depends('quantity', 'share_unit_price')
def _compute_totals(self):
for line in self:
if line.type == 'subscribed':
line.amount_subscribed = line.share_unit_price * line.quantity
if line.type == 'subscribed' and line.tax_shelter:
if (line.capital_before_sub < line.capital_limit
and line.capital_after_sub >= line.capital_limit):
line.amount_subscribed_eligible = line.capital_limit - line.capital_before_sub #noqa
elif (line.capital_before_sub < line.capital_limit
and line.capital_after_sub <= line.capital_limit):
line.amount_subscribed_eligible = line.share_unit_price * line.quantity #noqa
elif line.capital_before_sub >= line.capital_limit:
line.amount_subscribed_eligible = 0
if line.type == 'resold':
line.amount_resold = line.share_unit_price * -(line.quantity)
if line.type == 'transfered':
line.amount_transfered = line.share_unit_price * -(line.quantity) #noqa
import base64
from odoo import api, fields, models
TYPE_MAP = {
"subscription": "subscribed",
"transfer": "transfered",
"sell_back": "resold",
}
REPORT_DIC = {
"subscription": (
"easy_my_coop_taxshelter_report.action_tax_shelter_subscription_report",
"Tax Shelter Subscription",
),
"shares": (
"easy_my_coop_taxshelter_report.action_tax_shelter_shares_report",
"Tax Shelter Shares",
),
}
class TaxShelterDeclaration(models.Model):
_name = "tax.shelter.declaration"
_description = "Tax Shelter Declaration"
name = fields.Char(string="Declaration year", required=True)
fiscal_year = fields.Char(String="Fiscal year", required=True)
tax_shelter_certificates = fields.One2many(
"tax.shelter.certificate",
"declaration_id",
string="Tax shelter certificates",
readonly=True,
)
date_from = fields.Date(string="Date from", required=True)
date_to = fields.Date(string="Date to", required=True)
month_from = fields.Char(String="Month from", required=True)
month_to = fields.Char(String="Month to", required=True)
tax_shelter_percentage = fields.Selection(
[("30", "30%"), ("45", "45%")], string="Tax Shelter percentage", required=True
)
state = fields.Selection(
[("draft", "Draft"), ("computed", "Computed"), ("validated", "Validated")],
string="State",
required=True,
default="draft",
)
company_id = fields.Many2one(
"res.company",
string="Company",
required=True,
change_default=True,
readonly=True,
default=lambda self: self.env["res.company"]._company_default_get(),
)
tax_shelter_capital_limit = fields.Float(
string="Tax shelter capital limit", required=True
)
previously_subscribed_capital = fields.Float(
String="Capital previously subscribed", readonly=True
)
excluded_cooperator = fields.Many2many(
"res.partner",
string="Excluded cooperator",
domain=[("cooperator", "=", True)],
help="If these cooperator have"
" subscribed share during the time"
" frame of this Tax Shelter "
"Declaration. They will be marked "
"as non eligible",
)
def _excluded_from_declaration(self, entry):
if entry.date >= self.date_from and entry.date <= self.date_to:
declaration = self
else:
declaration = self.search(
[("date_from", "<=", entry.date), ("date_to", ">=", entry.date)]
)
if entry.partner_id.id in declaration.excluded_cooperator.ids:
return True
return False
def _prepare_line(self, certificate, entry, ongoing_capital_sub, excluded):
line_vals = {}
line_vals["tax_shelter_certificate"] = certificate.id
line_vals["share_type"] = entry.share_product_id.id
line_vals["share_short_name"] = entry.share_short_name
line_vals["share_unit_price"] = entry.share_unit_price
line_vals["quantity"] = entry.quantity
line_vals["transaction_date"] = entry.date
line_vals["type"] = TYPE_MAP[entry.type]
if entry.type == "subscription":
if not excluded:
capital_after_sub = ongoing_capital_sub + entry.total_amount_line
else:
capital_after_sub = ongoing_capital_sub
line_vals["capital_before_sub"] = ongoing_capital_sub
line_vals["capital_after_sub"] = capital_after_sub
line_vals["capital_limit"] = self.tax_shelter_capital_limit
if ongoing_capital_sub < self.tax_shelter_capital_limit and not excluded:
line_vals["tax_shelter"] = True
return line_vals
def _compute_certificates(self, entries, partner_certificate):
ongoing_capital_sub = 0.0
for entry in entries:
certificate = partner_certificate.get(entry.partner_id.id, False)
if not certificate:
# create a certificate for this cooperator
cert_vals = {}
cert_vals["declaration_id"] = self.id
cert_vals["partner_id"] = entry.partner_id.id
cert_vals[
"cooperator_number"
] = entry.partner_id.cooperator_register_number
certificate = self.env["tax.shelter.certificate"].create(cert_vals)
partner_certificate[entry.partner_id.id] = certificate
excluded = self._excluded_from_declaration(entry)
line_vals = self._prepare_line(
certificate, entry, ongoing_capital_sub, excluded
)
certificate.write({"lines": [(0, 0, line_vals)]})
if entry.type == "subscription" and not excluded:
ongoing_capital_sub += entry.total_amount_line
return partner_certificate
@api.one
def compute_declaration(self):
entries = self.env["subscription.register"].search(
[
("partner_id.is_company", "=", False),
("date", "<=", self.date_to),
("type", "in", ["subscription", "sell_back", "transfer"]),
]
)
subscriptions = entries.filtered(
(lambda r: r.type == "subscription" and r.date < self.date_from)
) # noqa
cap_prev_sub = 0.0
for subscription in subscriptions:
cap_prev_sub += subscription.total_amount_line
self.previously_subscribed_capital = cap_prev_sub
partner_cert = {}
partner_cert = self._compute_certificates(entries, partner_cert)
self.state = "computed"
@api.one
def validate_declaration(self):
self.tax_shelter_certificates.write({"state": "validated"})
self.state = "validated"
@api.one
def reset_declaration(self):
if not self.state == "validated":
self.tax_shelter_certificates.unlink()
self.state = "draft"
class TaxShelterCertificate(models.Model):
_name = "tax.shelter.certificate"
_description = "Tax Shelter Certificate"
_order = "cooperator_number asc"
cooperator_number = fields.Integer(
string="Cooperator number", required=True, readonly=True
)
partner_id = fields.Many2one(
"res.partner", string="Cooperator", required=True, readonly=True
)
state = fields.Selection(
[
("draft", "Draft"),
("validated", "Validated"),
("no_eligible", "No eligible"),
("sent", "Sent"),
],
string="State",
required=True,
default="draft",
)
declaration_id = fields.Many2one(
"tax.shelter.declaration",
string="Declaration",
required=True,
readonly=True,
ondelete="restrict",
)
lines = fields.One2many(
"certificate.line",
"tax_shelter_certificate",
string="Certificate lines",
readonly=True,
)
previously_subscribed_lines = fields.One2many(
compute="_compute_certificate_lines",
comodel_name="certificate.line",
string="Previously Subscribed lines",
readonly=True,
)
previously_subscribed_eligible_lines = fields.One2many(
compute="_compute_certificate_lines",
comodel_name="certificate.line",
string="Previously Subscribed eligible lines",
readonly=True,
)
subscribed_lines = fields.One2many(
compute="_compute_certificate_lines",
comodel_name="certificate.line",
string="Shares subscribed",
readonly=True,
)
resold_lines = fields.One2many(
compute="_compute_certificate_lines",
comodel_name="certificate.line",
string="Shares resold",
readonly=True,
)
transfered_lines = fields.One2many(
compute="_compute_certificate_lines",
comodel_name="certificate.line",
string="Shares transfered",
readonly=True,
)
total_amount_previously_subscribed = fields.Float(
compute="_compute_amounts", string="Total previously subscribed"
)
total_amount_eligible_previously_subscribed = fields.Float(
compute="_compute_amounts", string="Total eligible previously subscribed"
)
total_amount_subscribed = fields.Float(
compute="_compute_amounts", string="Total subscribed"
)
total_amount_eligible = fields.Float(
compute="_compute_amounts", string="Total amount eligible To Tax shelter"
)
total_amount_resold = fields.Float(
compute="_compute_amounts", string="Total resold"
)
total_amount_transfered = fields.Float(
compute="_compute_amounts", string="Total transfered"
)
total_amount = fields.Float(
compute="_compute_amounts", string="Total", readonly=True
)
company_id = fields.Many2one(related="declaration_id.company_id", string="Company")
def generate_pdf_report(self, report_type):
report, name = REPORT_DIC[report_type]
report = self.env.ref(report).render_qweb_pdf(self)
report = base64.b64encode(report)
report_name = (
self.partner_id.name + " " + name + " " + self.declaration_id.name + ".pdf"
)
return (report_name, report)
def generate_certificates_report(self):
attachments = []
if self.total_amount_eligible > 0:
attachments.append(self.generate_pdf_report("subscription"))
if self.partner_id.total_value > 0:
attachments.append(self.generate_pdf_report("shares"))
# if self.total_amount_resold > 0 or self.total_amount_transfered > 0:
# TODO
return attachments
@api.multi
def send_certificates(self):
tax_shelter_mail_template = self.env.ref(
"easy_my_coop_taxshelter_report.email_template_tax_shelter_certificate",
False,
)
for certificate in self:
if (
certificate.total_amount_eligible
+ certificate.total_amount_eligible_previously_subscribed
> 0
):
attachments = certificate.generate_certificates_report()
if len(attachments) > 0:
tax_shelter_mail_template.send_mail_with_multiple_attachments(
certificate.id, attachments, True
)
certificate.state = "sent"
else:
certificate.state = "no_eligible"
self.env.cr.commit()
@api.multi
def print_subscription_certificate(self):
self.ensure_one()
report, name = REPORT_DIC["subscription"]
return self.env.ref(report).report_action(self)
@api.multi
def print_shares_certificate(self):
self.ensure_one()
report, name = REPORT_DIC["shares"]
return self.env.ref(report).report_action(self)
@api.multi
def _compute_amounts(self):
for certificate in self:
total_amount_previously_subscribed = 0
total_amount_previously_eligible = 0
total_amount_subscribed = 0
total_amount_elligible = 0
total_amount_transfered = 0
total_amount_resold = 0
for line in certificate.subscribed_lines:
total_amount_subscribed += line.amount_subscribed
total_amount_elligible += line.amount_subscribed_eligible
certificate.total_amount_subscribed = total_amount_subscribed
certificate.total_amount_eligible = total_amount_elligible
for line in certificate.previously_subscribed_eligible_lines:
total_amount_previously_eligible += line.amount_subscribed_eligible
certificate.total_amount_eligible_previously_subscribed = (
total_amount_previously_eligible
)
for line in certificate.previously_subscribed_lines:
total_amount_previously_subscribed += line.amount_subscribed
certificate.total_amount_previously_subscribed = (
total_amount_previously_subscribed
)
for line in certificate.transfered_lines:
total_amount_transfered += line.amount_transfered
certificate.total_amount_transfered = total_amount_transfered
for line in certificate.resold_lines:
total_amount_resold += line.amount_resold
certificate.total_amount_resold = total_amount_resold
certificate.total_amount = (
certificate.total_amount_previously_subscribed
+ certificate.total_amount_subscribed
+ certificate.total_amount_resold
+ certificate.total_amount_transfered
)
@api.depends("lines")
def _compute_certificate_lines(self):
for certificate in self:
certificate.previously_subscribed_lines = certificate.lines.filtered(
lambda r: r.type == "subscribed"
and r.transaction_date < certificate.declaration_id.date_from
)
certificate.previously_subscribed_eligible_lines = certificate.lines.filtered(
lambda r: r.type == "subscribed"
and r.transaction_date < certificate.declaration_id.date_from
and r.tax_shelter
)
certificate.subscribed_lines = certificate.lines.filtered(
lambda r: r.type == "subscribed"
and r.transaction_date >= certificate.declaration_id.date_from
and r.transaction_date <= certificate.declaration_id.date_to
)
certificate.resold_lines = certificate.lines.filtered(
lambda r: r.type == "resold"
and r.transaction_date >= certificate.declaration_id.date_from
and r.transaction_date <= certificate.declaration_id.date_to
)
certificate.transfered_lines = certificate.lines.filtered(
lambda r: r.type == "transfered"
and r.transaction_date >= certificate.declaration_id.date_from
and r.transaction_date <= certificate.declaration_id.date_to
)
@api.model
def batch_send_tax_shelter_certificate(self):
certificates = self.search([("state", "=", "validated")], limit=80)
certificates.send_certificates()
class TaxShelterCertificateLine(models.Model):
_name = "certificate.line"
_description = "Tax Shelter Certificate Line"
declaration_id = fields.Many2one(
related="tax_shelter_certificate.declaration_id", string="Declaration"
)
tax_shelter_certificate = fields.Many2one(
"tax.shelter.certificate",
string="Tax shelter certificate",
ondelete="cascade",
required=True,
)
share_type = fields.Many2one(
"product.product", string="Share type", required=True, readonly=True
)
share_unit_price = fields.Float(string="Share price", required=True, readonly=True)
quantity = fields.Integer(string="Number of shares", required=True, readonly=True)
transaction_date = fields.Date(string="Transaction date")
tax_shelter = fields.Boolean(string="Tax shelter eligible", readonly=True)
type = fields.Selection(
[
("subscribed", "Subscribed"),
("resold", "Resold"),
("transfered", "Transfered"),
("kept", "Kept"),
],
required=True,
readonly=True,
)
amount_subscribed = fields.Float(
compute="_compute_totals", string="Amount subscribed", store=True
)
amount_subscribed_eligible = fields.Float(
compute="_compute_totals", string="Amount subscribed eligible", store=True
)
amount_resold = fields.Float(
compute="_compute_totals", string="Amount resold", store=True
)
amount_transfered = fields.Float(
compute="_compute_totals", string="Amount transfered", store=True
)
share_short_name = fields.Char(string="Share type name", readonly=True)
capital_before_sub = fields.Float(
string="Capital before subscription", readonly=True
)
capital_after_sub = fields.Float(string="Capital after subscription", readonly=True)
capital_limit = fields.Float(string="Capital limit", readonly=True)
@api.multi
@api.depends("quantity", "share_unit_price")
def _compute_totals(self):
for line in self:
if line.type == "subscribed":
line.amount_subscribed = line.share_unit_price * line.quantity
if line.type == "subscribed" and line.tax_shelter:
if (
line.capital_before_sub < line.capital_limit
and line.capital_after_sub >= line.capital_limit
):
line.amount_subscribed_eligible = (
line.capital_limit - line.capital_before_sub
)
elif (
line.capital_before_sub < line.capital_limit
and line.capital_after_sub <= line.capital_limit
):
line.amount_subscribed_eligible = (
line.share_unit_price * line.quantity
)
elif line.capital_before_sub >= line.capital_limit:
line.amount_subscribed_eligible = 0
if line.type == "resold":
line.amount_resold = line.share_unit_price * -(line.quantity)
if line.type == "transfered":
line.amount_transfered = line.share_unit_price * -(line.quantity)

47
easy_my_coop_taxshelter_report/reports/tax_shelter_report.xml

@ -1,24 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="0">
<report
id="action_tax_shelter_subscription_report"
model="tax.shelter.certificate"
string="Tax shelter subscription report"
report_type="qweb-pdf"
name="easy_my_coop_taxshelter_report.tax_shelter_subscription_report"
file="easy_my_coop_taxshelter_report.tax_shelter_subscription_report.xml"
multi="True"
menu="True"/>
<report
id="action_tax_shelter_shares_report"
model="tax.shelter.certificate"
string="Tax shelter shares report"
report_type="qweb-pdf"
name="easy_my_coop_taxshelter_report.tax_shelter_shares_report"
file="easy_my_coop_taxshelter_report.tax_shelter_shares_report.xml"
multi="True"
menu="True"/>
</data>
</odoo>
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="0">
<report
id="action_tax_shelter_subscription_report"
model="tax.shelter.certificate"
string="Tax shelter subscription report"
report_type="qweb-pdf"
name="easy_my_coop_taxshelter_report.tax_shelter_subscription_report"
file="easy_my_coop_taxshelter_report.tax_shelter_subscription_report.xml"
multi="True"
menu="True"/>
<report
id="action_tax_shelter_shares_report"
model="tax.shelter.certificate"
string="Tax shelter shares report"
report_type="qweb-pdf"
name="easy_my_coop_taxshelter_report.tax_shelter_shares_report"
file="easy_my_coop_taxshelter_report.tax_shelter_shares_report.xml"
multi="True"
menu="True"/>
</data>
</odoo>

208
easy_my_coop_taxshelter_report/reports/tax_shelter_resold_report.xml

@ -1,127 +1,81 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<template id="tax_shelter_report_shares_document">
<t t-call="theme_light.invoice_layout">
<div class="page">
<head>
<link href="/easy_my_coop_taxshelter_report/static/src/css/coop_report.css" rel="stylesheet"/>
<style type="text/css">
/* Montserrat */
@font-face {
font-family: 'Montserrat-Regular';
font-style: normal;
src: local('Montserrat Regular'), url('/theme_light/static/font/Montserrat-Regular.ttf') format('truetype');
}
/* Roboto Regular */
@font-face {
font-family: 'Roboto-Regular';
font-style: normal;
src: local('Roboto Regular'), url('/theme_light/static/font/Roboto-Regular.ttf') format('truetype');
}
/* Roboto Bold */
@font-face {
font-family: 'Roboto-Bold';
font-style: normal;
src: local('Roboto Bold'), url('/theme_light/static/font/Roboto-Bold.ttf') format('truetype');
}
/* BEBASNEUE Bold */
@font-face {
font-family: 'Bebasneue-Bold';
font-style: normal;
src: local('Bebasneue-Bold'), url('/theme_light/static/font/BEBASNEUE_BOLD.ttf') format('truetype');
}
</style>
</head>
<t t-call="theme_light.invoice_header"/>
<div class="row">
<div class="col-xs-5 col-xs-offset-7 easymy-coop-address" style="top:15px;">
<strong><span t-field="o.partner_id.name" /><br/></strong>
<span> numéro de coopérateur </span>
<span t-field="o.partner_id.cooperator_register_number"></span><br/><br/>
<span t-field="o.partner_id.street" /><br/>
<span>
<span t-field="o.partner_id.zip"/>
<span t-field="o.partner_id.city"/>
</span><br/>
<span t-field="o.partner_id.country_id.name" /><br/>
</div>
</div>
<div style="position:absolute; top:240px">
<h2 style="font-family:Bebasneue-Bold;font-size:16pt;">
<div>
<span>Déclaration Tax Shelter - Attestation concernant une des quatre années suivant l’acquisition de parts</span>
</div>
<div style="width:125px;position:relative;top:10px;border-bottom: 4pt solid #fcc300;"/>
</h2>
<div class="row">
<div class="col-xs-12 pull-left" style="position:relative;top:15px;font-size:16;color:black;font-family:Roboto-Regular;">
<div>
Cher membre,
</div>
<div style="position:relative;top:10px;">
A la date du <span t-field="o.partner_id.effective_date"/>, vous êtes devenu coopérateur de <span t-field="o.company_id.name"/>.<br/>
<br/>
Cette lettre confirme qu’en date du <span t-field="o.declaration_id.date_to"/>, vous êtes toujours en possession de parts de <span t-field="o.company_id.name"/>
pour un montant total de <span t-field="o.partner_id.total_value" t-field-options='{"widget": "monetary", "display_currency": "res_company.currency_id"}'/> euros et que la condition prévue à l’article 145(26), $3, alinéa 2, CIR92 est remplie.
</div>
<div style="position:relative;top:20px;">
L' Article 145/26, CIR 92 sur les revenus <span t-field="o.declaration_id.fiscal_year"/>, connu aussi comme normative Tax Shelter, donnent droit à une réduction d’impôt à hauteur de &#160; <span t-field="o.declaration_id.tax_shelter_percentage"/> du montant de la valeur des parts souscrites depuis <span t-field="o.declaration_id.month_from"/> (et avant <span t-field="o.declaration_id.month_to"/> pour la déclaration des revenus <span t-field="o.declaration_id.fiscal_year"/>).<br/>
<br/>
Cette lettre vaut donc comme certificat que <span t-field="o.company_id.name"/> remplit en effet tous les critères permettant un tel avantage fiscal. Dans les grandes lignes : <br/>
<br/>
être une micro-entreprise qui répond à au moins deux des trois critères suivants : <br/><br/>
- le total du bilan est inférieur ou égal à 350.000 euros ; <br/>
- le chiffre d’affaires, hors taxe sur la valeur ajoutée, est inférieur ou égal à 700.000 euros ; <br/>
- la moyenne des travailleurs occupés pendant l’année est inférieure ou égale à 10. <br/>
<br/>
être une entreprise n’ayant encore jamais distribué de dividende et qui n'est pas issue d’une fusion ou scission de sociétés.<br/><br/>
Le maintien de la réduction d’impôt n’est possible que si l'investisseur conserve les parts de la coopérative pendant 4 ans au minimum, sauf si la sortie est imposée par des conditions extérieures (telles que la faillite, par exemple). En cas de sortie volontaire avant la période de 4 ans, l’avantage fiscal devra être remboursé au prorata du nombre de mois entre la sortie et les 4 ans. La coopérative s’engage à fournir pour chacune des quatre années suivant l’année d’acquisition une attestation certifiant que ces parts sont toujours en possession du souscripteur.<br/><br/>
L’apport de capitaux par le chef d’entreprise lui-même ou par des administrateurs existants de la société ne permet pas de bénéficier du tax shelter.<br/>
<br/>
Pour bénéficier de la réduction d’impôts, vous pouvez joindre cette lettre à votre déclaration fiscale pour les revenus <span t-field="o.declaration_id.fiscal_year"/>.<br/>
<br/>
<![CDATA[
Pour toute information complémentaire, consultez le texte de <a href="http://ccff02.minfin.fgov.be/KMWeb/document.do?method=view&id=e5996d67-4f3e-4465-b21e-7e59d968a55d">l’Arrêté Royale en ligne</a>.<br/>
]]>
<br/>
Cordialement,
</div>
</div>
<div class="row">
<div class="col-xs-6 pull-left" style="position:relative;top:100px;font-size:16;color:black;font-family:Roboto-Regular;">
<div style="position:relative;top:10px;">
Pour le Conseil d'administration de <span t-field="o.company_id.name"/>.
</div>
<div style="position:relative;top:20px;">
<strong><span t-field="o.company_id.board_representative"/></strong>
</div>
<div style="position:relative;top:25px;">
<img t-if="o.company_id.signature_scan" t-att-src="'data:image/png;base64,%s' % o.company_id.signature_scan" style="width:140px;height:100px;padding-bottom:5px;"/>
</div>
</div>
</div>
</div>
</div>
</div>
</t>
</template>
<template id="tax_shelter_shares_report">
<t t-call="theme_light.html_container">
<t t-set="data_report_margin_top" t-value="10"/>
<t t-set="data_report_header_spacing" t-value="5"/>
<t t-set="data_report_dpi" t-value="110"/>
<t t-foreach="docs" t-as="o">
<t t-call="easy_my_coop_taxshelter_report.tax_shelter_report_shares_document" t-lang="o.partner_id.lang"/>
</t>
</t>
</template>
</data>
</odoo>
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="tax_shelter_report_resold_document">
<t t-call="web.external_layout">
<t t-set="address">
<address t-field="o.partner_id" t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}' />
<div t-if="o.partner_id.cooperator_register_number">
Numéro de coopérateur : <span t-field="o.partner_id.cooperator_register_number"/>
</div>
</t>
<div class="page mt32" style="font-size: 10px !important;">
<h2 style="font-size: 3em;">
<span>Déclaration Tax Shelter</span><br/>
<small>Attestation concernant une des quatre années suivant l’acquisition de parts</small>
</h2>
<p>
Cher membre,
</p>
<p>
A la date du <span t-field="o.partner_id.effective_date"/>, vous êtes devenu coopérateur de <span t-field="o.company_id.name"/>.
</p>
<p>
Cette lettre confirme qu’en date du <span t-field="o.declaration_id.date_to"/>, vous êtes toujours en possession de parts de <span t-field="o.company_id.name"/>
pour un montant total de <span t-field="o.partner_id.total_value" t-field-options='{"widget": "monetary", "display_currency": "res_company.currency_id"}'/> euros et que la condition prévue à l’article 145(26), $3, alinéa 2, CIR92 est remplie.
</p>
<p>
L' Article 145/26, CIR 92 sur les revenus <span t-field="o.declaration_id.fiscal_year"/>, connu aussi comme normative Tax Shelter, donnent droit à une réduction d’impôt à hauteur de &#160;<span t-field="o.declaration_id.tax_shelter_percentage"/> du montant de la valeur des parts souscrites depuis <span t-field="o.declaration_id.month_from"/> (et avant <span t-field="o.declaration_id.month_to"/> pour la déclaration des revenus &#160;<span t-field="o.declaration_id.fiscal_year"/>).
</p>
<p>
Cette lettre vaut donc comme certificat que <span t-field="o.company_id.name"/> remplit en effet tous les critères permettant un tel avantage fiscal. Dans les grandes lignes il faut être une micro-entreprise n’ayant encore jamais distribué de dividende et qui n'est pas issue d’une fusion ou scission de sociétés et qui répond à au moins deux des trois critères suivants :
<ul>
<li>le total du bilan est inférieur ou égal à 350.000 euros ;</li>
<li>le chiffre d’affaires, hors taxe sur la valeur ajoutée, est inférieur ou égal à 700.000 euros ;</li>
<li>la moyenne des travailleurs occupés pendant l’année est inférieure ou égale à 10.</li>
</ul>
</p>
<p>
Le maintien de la réduction d’impôt n’est possible que si l'investisseur conserve les parts de la coopérative pendant 4 ans au minimum, sauf si la sortie est imposée par des conditions extérieures (telles que la faillite, par exemple). En cas de sortie volontaire avant la période de 4 ans, l’avantage fiscal devra être remboursé au prorata du nombre de mois entre la sortie et les 4 ans. La coopérative s’engage à fournir pour chacune des quatre années suivant l’année d’acquisition une attestation certifiant que ces parts sont toujours en possession du souscripteur.
</p>
<p>
L’apport de capitaux par le chef d’entreprise lui-même ou par des administrateurs existants de la société ne permet pas de bénéficier du tax shelter.
</p>
<p>
Pour bénéficier de la réduction d’impôts, vous pouvez joindre cette lettre à votre déclaration fiscale pour les revenus <span t-field="o.declaration_id.fiscal_year"/>.
</p>
<p>
Pour toute information complémentaire, consultez le texte de l’Arrêté Royale.
</p>
<p>
Pour le Conseil d'administration de <span t-field="o.company_id.name"/>,<br/>
<strong t-field="o.company_id.board_representative"/><br/>
<img t-if="o.company_id.signature_scan"
t-attf-class="mt16"
t-attf-style="{{ 'min-height: 50px; max-height: 100px' if report_type == 'pdf' else '' }}"
t-att-src="'data:image/png;base64,%s' % o.company_id.signature_scan.decode()"
/>
</p>
</div>
</t>
</template>
<template id="tax_shelter_resold_report">
<t t-call="web.html_container">
<t t-foreach="docs" t-as="o">
<t t-call="easy_my_coop_taxshelter_report.tax_shelter_report_shares_document" t-lang="o.partner_id.lang"/>
</t>
</t>
</template>
</odoo>

310
easy_my_coop_taxshelter_report/reports/tax_shelter_shares_report.xml

@ -1,177 +1,133 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<template id="tax_shelter_report_shares_document">
<t t-call="theme_light.invoice_layout">
<div class="page">
<head>
<link href="/easy_my_coop_taxshelter_report/static/src/css/coop_report.css" rel="stylesheet"/>
<style type="text/css">
/* Montserrat */
@font-face {
font-family: 'Montserrat-Regular';
font-style: normal;
src: local('Montserrat Regular'), url('/theme_light/static/font/Montserrat-Regular.ttf') format('truetype');
}
/* Roboto Regular */
@font-face {
font-family: 'Roboto-Regular';
font-style: normal;
src: local('Roboto Regular'), url('/theme_light/static/font/Roboto-Regular.ttf') format('truetype');
}
/* Roboto Bold */
@font-face {
font-family: 'Roboto-Bold';
font-style: normal;
src: local('Roboto Bold'), url('/theme_light/static/font/Roboto-Bold.ttf') format('truetype');
}
/* BEBASNEUE Bold */
@font-face {
font-family: 'Bebasneue-Bold';
font-style: normal;
src: local('Bebasneue-Bold'), url('/theme_light/static/font/BEBASNEUE_BOLD.ttf') format('truetype');
}
</style>
</head>
<t t-call="theme_light.invoice_header"/>
<div class="row">
<div class="col-xs-5 col-xs-offset-7 easymy-coop-address" style="top:15px;">
<strong><span t-field="o.partner_id.name" /><br/></strong>
<span> numéro de coopérateur </span>
<span t-field="o.partner_id.cooperator_register_number"></span><br/><br/>
<span t-field="o.partner_id.street" /><br/>
<span>
<span t-field="o.partner_id.zip"/>
<span t-field="o.partner_id.city"/>
</span><br/>
<span t-field="o.partner_id.country_id.name" /><br/>
</div>
</div>
<div style="position:absolute; top:240px">
<h2 style="font-family:Bebasneue-Bold;font-size:14pt;">
<div>
<span>Déclaration Tax Shelter - Attestation concernant une des quatre années suivant l’acquisition de parts</span>
</div>
<div style="width:125px;position:relative;top:10px;border-bottom: 4pt solid #fcc300;"/>
</h2>
<div class="row">
<div class="col-xs-12 pull-left" style="position:relative;top:15px;font-size:16;color:black;font-family:Roboto-Regular;">
<div>
Cher membre,
</div>
<div style="position:relative;top:10px;">
A la date du <span t-field="o.partner_id.effective_date"/>, vous êtes devenu coopérateur de <span t-field="o.company_id.name"/>.<br/>
<br/>
Cette lettre confirme qu’en date du <span t-field="o.declaration_id.date_to"/>, vous êtes toujours en possession de parts de <span t-field="o.company_id.name"/>
pour un montant total de <span t-field="o.partner_id.total_value" t-field-options='{"widget": "monetary", "display_currency": "res_company.currency_id"}'/> euros et que la condition prévue à l’article 145(26), $3, alinéa 2, CIR92 est remplie.
</div>
<div style="position:relative;top:30px;">
<table class="table border-easymy-coop" style="width:90%;align:center;">
<thead class="invoice_tbody easymy-coop-normal">
<tr>
<th>Type</th>
<th>Capital before</th>
<th>Capital after</th>
<th>Tax shelter eligible</th>
<th>Date</th>
<th>Amount</th>
<th>Amount ligible</th>
</tr>
</thead>
<tbody class="invoice_tbody easymy-coop-normal">
<tr t-foreach="o.previously_subscribed_lines" t-as="l">
<td><span t-field="l.type"/></td>
<td><span t-field="l.capital_before_sub"/></td>
<td><span t-field="l.capital_after_sub"/></td>
<td><span t-field="l.tax_shelter"/></td>
<td><span t-field="l.transaction_date"/></td>
<td><span t-field="l.amount_subscribed"/></td>
<td><span t-field="l.amount_subscribed_eligible"/></td>
</tr>
<tr t-foreach="o.subscribed_lines" t-as="l">
<td><span t-field="l.type"/></td>
<td><span t-field="l.capital_before_sub"/></td>
<td><span t-field="l.capital_after_sub"/></td>
<td><span t-field="l.tax_shelter"/></td>
<td><span t-field="l.transaction_date"/></td>
<td><span t-field="l.amount_subscribed"/></td>
<td><span t-field="l.amount_subscribed_eligible"/></td>
</tr>
<tr t-foreach="o.resold_lines" t-as="l">
<td><span t-field="l.type"/></td>
<td></td>
<td></td>
<td></td>
<td><span t-field="l.transaction_date"/></td>
<td><span t-field="l.amount_resold"/></td>
<td></td>
</tr>
<tr t-foreach="o.transfered_lines" t-as="l">
<td><span t-field="l.type"/></td>
<td></td>
<td></td>
<td></td>
<td><span t-field="l.transaction_date"/></td>
<td><span t-field="l.amount_transfered"/></td>
<td></td>
</tr>
</tbody>
</table>
<div style="position:relative;top:0px;">
L' Article 145/26, CIR 92 sur les revenus <span t-field="o.declaration_id.fiscal_year"/>, connu aussi comme normative Tax Shelter, donnent droit à une réduction d’impôt à hauteur de &#160;<span t-field="o.declaration_id.tax_shelter_percentage"/> du montant de la valeur des parts souscrites depuis <span t-field="o.declaration_id.month_from"/> (et avant <span t-field="o.declaration_id.month_to"/> pour la déclaration des revenus &#160;<span t-field="o.declaration_id.fiscal_year"/>).<br/>
<br/>
Cette lettre vaut donc comme certificat que <span t-field="o.company_id.name"/> remplit en effet tous les critères permettant un tel avantage fiscal. Dans les grandes lignes : <br/>
<br/>
être une micro-entreprise qui répond à au moins deux des trois critères suivants : <br/><br/>
- le total du bilan est inférieur ou égal à 350.000 euros ; <br/>
- le chiffre d’affaires, hors taxe sur la valeur ajoutée, est inférieur ou égal à 700.000 euros ; <br/>
- la moyenne des travailleurs occupés pendant l’année est inférieure ou égale à 10. <br/>
<br/>
être une entreprise n’ayant encore jamais distribué de dividende et qui n'est pas issue d’une fusion ou scission de sociétés.<br/><br/>
Le maintien de la réduction d’impôt n’est possible que si l'investisseur conserve les parts de la coopérative pendant 4 ans au minimum, sauf si la sortie est imposée par des conditions extérieures (telles que la faillite, par exemple). En cas de sortie volontaire avant la période de 4 ans, l’avantage fiscal devra être remboursé au prorata du nombre de mois entre la sortie et les 4 ans. La coopérative s’engage à fournir pour chacune des quatre années suivant l’année d’acquisition une attestation certifiant que ces parts sont toujours en possession du souscripteur.<br/><br/>
L’apport de capitaux par le chef d’entreprise lui-même ou par des administrateurs existants de la société ne permet pas de bénéficier du tax shelter.<br/>
<br/>
Pour bénéficier de la réduction d’impôts, vous pouvez joindre cette lettre à votre déclaration fiscale pour les revenus <span t-field="o.declaration_id.fiscal_year"/>.<br/>
<br/>
<![CDATA[
Pour toute information complémentaire, consultez le texte de <a href="http://ccff02.minfin.fgov.be/KMWeb/document.do?method=view&id=e5996d67-4f3e-4465-b21e-7e59d968a55d">l’Arrêté Royale en ligne</a>.<br/>
]]>
<br/>
Cordialement,
</div>
</div>
<div class="col-xs-6 pull-left" style="position:relative;top:40px;font-size:16;color:black;font-family:Roboto-Regular;">
<div style="position:relative;top:10px;">
Pour le Conseil d'administration de <span t-field="o.company_id.name"/>.
</div>
<div style="position:relative;top:20px;">
<strong><span t-field="o.company_id.board_representative"/></strong>
</div>
<div style="position:relative;top:25px;">
<img t-if="o.company_id.signature_scan" t-att-src="'data:image/png;base64,%s' % o.company_id.signature_scan" style="width:140px;height:100px;padding-bottom:5px;"/>
</div>
</div>
</div>
</div>
</div>
</div>
</t>
</template>
<template id="tax_shelter_shares_report">
<t t-call="theme_light.html_container">
<t t-set="data_report_margin_top" t-value="10"/>
<t t-set="data_report_header_spacing" t-value="5"/>
<t t-set="data_report_dpi" t-value="110"/>
<t t-foreach="docs" t-as="o">
<t t-call="easy_my_coop_taxshelter_report.tax_shelter_report_shares_document" t-lang="o.partner_id.lang"/>
</t>
</t>
</template>
</data>
</odoo>
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="tax_shelter_report_shares_document">
<t t-call="web.external_layout">
<t t-set="address">
<address t-field="o.partner_id" t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}' />
<div t-if="o.partner_id.cooperator_register_number">
Numéro de coopérateur : <span t-field="o.partner_id.cooperator_register_number"/>
</div>
</t>
<div class="page mt32" style="font-size: 10px !important;">
<h2 style="font-size: 3em;">
<span>Déclaration Tax Shelter</span><br/>
<small>Attestation concernant une des quatre années suivant l’acquisition de parts</small>
</h2>
<p>
Cher membre,
</p>
<p>
A la date du <span t-field="o.partner_id.effective_date"/>, vous êtes devenu coopérateur de <span t-field="o.company_id.name"/>.
</p>
<p>
Cette lettre confirme qu’en date du <span t-field="o.declaration_id.date_to"/>, vous êtes toujours en possession de parts de <span t-field="o.company_id.name"/>
pour un montant total de <span t-field="o.partner_id.total_value" t-field-options='{"widget": "monetary", "display_currency": "res_company.currency_id"}'/> euros et que la condition prévue à l’article 145(26), $3, alinéa 2, CIR92 est remplie.
</p>
<table class="table table-sm o_main_table" name="taxshelter_line_table">
<thead>
<tr>
<th>Type</th>
<th>Capital before</th>
<th>Capital after</th>
<th>Tax shelter eligible</th>
<th>Date</th>
<th>Amount</th>
<th>Amount ligible</th>
</tr>
</thead>
<tbody class="invoice_tbody">
<tr t-foreach="o.previously_subscribed_lines" t-as="l">
<td><span t-field="l.type"/></td>
<td><span t-field="l.capital_before_sub"/></td>
<td><span t-field="l.capital_after_sub"/></td>
<td><span t-if="l.tax_shelter">Oui</span><span t-else="">Non</span></td>
<td><span t-field="l.transaction_date"/></td>
<td><span t-field="l.amount_subscribed"/></td>
<td><span t-field="l.amount_subscribed_eligible"/></td>
</tr>
<tr t-foreach="o.subscribed_lines" t-as="l">
<td><span t-field="l.type"/></td>
<td><span t-field="l.capital_before_sub"/></td>
<td><span t-field="l.capital_after_sub"/></td>
<td><span t-if="l.tax_shelter">Oui</span><span t-else="">Non</span></td>
<td><span t-field="l.transaction_date"/></td>
<td><span t-field="l.amount_subscribed"/></td>
<td><span t-field="l.amount_subscribed_eligible"/></td>
</tr>
<tr t-foreach="o.resold_lines" t-as="l">
<td><span t-field="l.type"/></td>
<td></td>
<td></td>
<td></td>
<td><span t-field="l.transaction_date"/></td>
<td><span t-field="l.amount_resold"/></td>
<td></td>
</tr>
<tr t-foreach="o.transfered_lines" t-as="l">
<td><span t-field="l.type"/></td>
<td></td>
<td></td>
<td></td>
<td><span t-field="l.transaction_date"/></td>
<td><span t-field="l.amount_transfered"/></td>
<td></td>
</tr>
</tbody>
</table>
<p>
L' Article 145/26, CIR 92 sur les revenus <span t-field="o.declaration_id.fiscal_year"/>, connu aussi comme normative Tax Shelter, donnent droit à une réduction d’impôt à hauteur de &#160;<span t-field="o.declaration_id.tax_shelter_percentage"/> du montant de la valeur des parts souscrites depuis <span t-field="o.declaration_id.month_from"/> (et avant <span t-field="o.declaration_id.month_to"/> pour la déclaration des revenus &#160;<span t-field="o.declaration_id.fiscal_year"/>).
</p>
<p>
Cette lettre vaut donc comme certificat que <span t-field="o.company_id.name"/> remplit en effet tous les critères permettant un tel avantage fiscal. Dans les grandes lignes il faut être une micro-entreprise n’ayant encore jamais distribué de dividende et qui n'est pas issue d’une fusion ou scission de sociétés et qui répond à au moins deux des trois critères suivants :
<ul>
<li>le total du bilan est inférieur ou égal à 350.000 euros ;</li>
<li>le chiffre d’affaires, hors taxe sur la valeur ajoutée, est inférieur ou égal à 700.000 euros ;</li>
<li>la moyenne des travailleurs occupés pendant l’année est inférieure ou égale à 10.</li>
</ul>
</p>
<p>
Le maintien de la réduction d’impôt n’est possible que si l'investisseur conserve les parts de la coopérative pendant 4 ans au minimum, sauf si la sortie est imposée par des conditions extérieures (telles que la faillite, par exemple). En cas de sortie volontaire avant la période de 4 ans, l’avantage fiscal devra être remboursé au prorata du nombre de mois entre la sortie et les 4 ans. La coopérative s’engage à fournir pour chacune des quatre années suivant l’année d’acquisition une attestation certifiant que ces parts sont toujours en possession du souscripteur.
</p>
<p>
L’apport de capitaux par le chef d’entreprise lui-même ou par des administrateurs existants de la société ne permet pas de bénéficier du tax shelter.
</p>
<p>
Pour bénéficier de la réduction d’impôts, vous pouvez joindre cette lettre à votre déclaration fiscale pour les revenus <span t-field="o.declaration_id.fiscal_year"/>.
</p>
<p>
Pour toute information complémentaire, consultez le texte de l’Arrêté Royale.
</p>
<p>
Pour le Conseil d'administration de <span t-field="o.company_id.name"/>,<br/>
<strong t-field="o.company_id.board_representative"/><br/>
<img t-if="o.company_id.signature_scan"
t-attf-class="mt16"
t-attf-style="{{ 'min-height: 50px; max-height: 100px' if report_type == 'pdf' else '' }}"
t-att-src="'data:image/png;base64,%s' % o.company_id.signature_scan.decode()"
/>
</p>
</div>
</t>
</template>
<template id="tax_shelter_shares_report">
<t t-call="web.html_container">
<t t-foreach="docs" t-as="o">
<t t-call="easy_my_coop_taxshelter_report.tax_shelter_report_shares_document" t-lang="o.partner_id.lang"/>
</t>
</t>
</template>
</odoo>

268
easy_my_coop_taxshelter_report/reports/tax_shelter_subscription_report.xml

@ -1,158 +1,110 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<template id="tax_shelter_report_subscription_document">
<t t-call="theme_light.invoice_layout">
<div class="page">
<head>
<link href="/easy_my_coop_taxshelter_report/static/src/css/coop_report.css" rel="stylesheet"/>
<style type="text/css">
/* Montserrat */
@font-face {
font-family: 'Montserrat-Regular';
font-style: normal;
src: local('Montserrat Regular'), url('/theme_light/static/font/Montserrat-Regular.ttf') format('truetype');
}
/* Roboto Regular */
@font-face {
font-family: 'Roboto-Regular';
font-style: normal;
src: local('Roboto Regular'), url('/theme_light/static/font/Roboto-Regular.ttf') format('truetype');
}
/* Roboto Bold */
@font-face {
font-family: 'Roboto-Bold';
font-style: normal;
src: local('Roboto Bold'), url('/theme_light/static/font/Roboto-Bold.ttf') format('truetype');
}
/* BEBASNEUE Bold */
@font-face {
font-family: 'Bebasneue-Bold';
font-style: normal;
src: local('Bebasneue-Bold'), url('/theme_light/static/font/BEBASNEUE_BOLD.ttf') format('truetype');
}
</style>
</head>
<t t-call="theme_light.invoice_header"/>
<div class="row">
<div class="col-xs-5 col-xs-offset-7 easymy-coop-address" style="top:15px;">
<strong><span t-field="o.partner_id.name" /><br/></strong>
<span> numéro de coopérateur </span>
<span t-field="o.partner_id.cooperator_register_number"></span><br/><br/>
<span t-field="o.partner_id.street" /><br/>
<span>
<span t-field="o.partner_id.zip"/>
<span t-field="o.partner_id.city"/>
</span><br/>
<span t-field="o.partner_id.country_id.name" /><br/>
</div>
</div>
<div style="position:absolute; top:240px">
<h2 style="font-family:Bebasneue-Bold;font-size:16pt;">
<div>
<span>Déclaration Tax Shelter</span>
</div>
<div style="width:125px;position:relative;top:10px;border-bottom: 4pt solid #fcc300;"/>
</h2>
<div class="row">
<div class="col-xs-12 pull-left" style="position:relative;top:15px;font-size:16;color:black;font-family:Roboto-Regular;">
<div>
Cher membre,
</div>
<div style="position:relative;top:10px;">
Durant l'année <span t-field="o.declaration_id.fiscal_year"/> vous avez souscrit des parts de la <span t-field="o.company_id.name"/>. pour un montant total de
<span t-field="o.total_amount_subscribed" t-field-options='{"widget": "monetary", "display_currency": "res_company.currency_id"}'/> euros.<br/>
Le montant éligible pour le Tax shelter est de <span t-field="o.total_amount_eligible" t-field-options='{"widget": "monetary", "display_currency": "res_company.currency_id"}'/> euros.<br/>
</div>
<div style="position:relative;top:30px;">
<table class="table border-easymy-coop" style="width:90%;align:center;">
<thead class="invoice_tbody easymy-coop-normal">
<tr>
<th>Type</th>
<th>Capital before</th>
<th>Capital after</th>
<th>Tax shelter eligible</th>
<th>Date</th>
<th>Amount</th>
<th>Amount ligible</th>
</tr>
</thead>
<tbody class="invoice_tbody easymy-coop-normal">
<tr t-foreach="o.previously_subscribed_lines" t-as="l">
<td><span t-field="l.type"/></td>
<td><span t-field="l.capital_before_sub"/></td>
<td><span t-field="l.capital_after_sub"/></td>
<td><span t-field="l.tax_shelter"/></td>
<td><span t-field="l.transaction_date"/></td>
<td><span t-field="l.amount_subscribed"/></td>
<td><span t-field="l.amount_subscribed_eligible"/></td>
</tr>
<tr t-foreach="o.subscribed_lines" t-as="l">
<td><span t-field="l.type"/></td>
<td><span t-field="l.capital_before_sub"/></td>
<td><span t-field="l.capital_after_sub"/></td>
<td><span t-field="l.tax_shelter"/></td>
<td><span t-field="l.transaction_date"/></td>
<td><span t-field="l.amount_subscribed"/></td>
<td><span t-field="l.amount_subscribed_eligible"/></td>
</tr>
</tbody>
</table>
<div style="position:relative;top:0px;">
L' Article 145/26, CIR 92 sur les revenus <span t-field="o.declaration_id.fiscal_year"/>, connu aussi comme normative Tax Shelter, donnent droit à une réduction d’impôt à hauteur de &#160; <span t-field="o.declaration_id.tax_shelter_percentage"/> du montant de la valeur des parts souscrites depuis <span t-field="o.declaration_id.month_from"/> (et avant <span t-field="o.declaration_id.month_to"/> pour la déclaration des revenus &#160;<span t-field="o.declaration_id.name"/>).<br/>
<br/>
Cette lettre vaut donc comme certificat que <span t-field="o.company_id.name"/> remplit en effet tous les critères permettant un tel avantage fiscal. Dans les grandes lignes : <br/>
<br/>
être une micro-entreprise qui répond à au moins deux des trois critères suivants : <br/><br/>
- le total du bilan est inférieur ou égal à 350.000 euros ; <br/>
- le chiffre d’affaires, hors taxe sur la valeur ajoutée, est inférieur ou égal à 700.000 euros ; <br/>
- la moyenne des travailleurs occupés pendant l’année est inférieure ou égale à 10. <br/>
<br/>
être une entreprise n’ayant encore jamais distribué de dividende et qui n'est pas issue d’une fusion ou scission de sociétés.<br/><br/>
Le maintien de la réduction d’impôt n’est possible que si l'investisseur conserve les parts de la coopérative pendant 4 ans au minimum, sauf si la sortie est imposée par des conditions extérieures (telles que la faillite, par exemple). En cas de sortie volontaire avant la période de 4 ans, l’avantage fiscal devra être remboursé au prorata du nombre de mois entre la sortie et les 4 ans. La coopérative s’engage à fournir pour chacune des quatre années suivant l’année d’acquisition une attestation certifiant que ces parts sont toujours en possession du souscripteur.<br/><br/>
L’apport de capitaux par le chef d’entreprise lui-même ou par des administrateurs existants de la société ne permet pas de bénéficier du tax shelter.<br/>
<br/>
Pour bénéficier de la réduction d’impôts, vous pouvez joindre cette lettre à votre déclaration fiscale pour les revenus <span t-field="o.declaration_id.fiscal_year"/>.<br/>
<br/>
<![CDATA[
Pour toute information complémentaire, consultez le texte de <a href="http://ccff02.minfin.fgov.be/KMWeb/document.do?method=view&id=e5996d67-4f3e-4465-b21e-7e59d968a55d">l’Arrêté Royale en ligne</a>.<br/>
]]>
<br/>
Cordialement,
</div>
</div>
<div class="col-xs-10 pull-left" style="position:relative;top:60px;font-size:16;color:black;font-family:Roboto-Regular;">
<div style="position:relative;top:10px;">
Pour le Conseil d'administration de <span t-field="o.company_id.name"/>.
</div>
<div style="position:relative;top:20px;">
<strong><span t-field="o.company_id.board_representative"/></strong>
</div>
<div style="position:relative;top:25px;">
<img t-if="o.company_id.signature_scan" t-att-src="'data:image/png;base64,%s' % o.company_id.signature_scan" style="width:140px;height:100px;padding-bottom:5px;"/>
</div>
</div>
</div>
</div>
</div>
</div>
</t>
</template>
<template id="tax_shelter_subscription_report">
<t t-call="theme_light.html_container">
<t t-set="data_report_margin_top" t-value="10"/>
<t t-set="data_report_header_spacing" t-value="5"/>
<t t-set="data_report_dpi" t-value="110"/>
<t t-foreach="docs" t-as="o">
<t t-call="easy_my_coop_taxshelter_report.tax_shelter_report_subscription_document" t-lang="o.partner_id.lang"/>
</t>
</t>
</template>
</data>
</odoo>
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="tax_shelter_report_subscription_document">
<t t-call="web.external_layout">
<t t-set="address">
<address t-field="o.partner_id" t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}' />
<div t-if="o.partner_id.cooperator_register_number">
Numéro de coopérateur : <span t-field="o.partner_id.cooperator_register_number"/>
</div>
</t>
<div class="page mt32" style="font-size: 10px !important;">
<h2 style="font-size: 3em;">
<span>Déclaration Tax Shelter</span>
</h2>
<p>
Cher membre,
</p>
<p>
Durant l'année <span t-field="o.declaration_id.fiscal_year"/> vous avez souscrit des parts de <span t-field="o.company_id.name"/> pour un montant total de
<span t-field="o.total_amount_subscribed" t-field-options='{"widget": "monetary", "display_currency": "res_company.currency_id"}'/> euros.<br/>
Le montant éligible pour le Tax shelter est de <span t-field="o.total_amount_eligible" t-field-options='{"widget": "monetary", "display_currency": "res_company.currency_id"}'/> euros.<br/>
</p>
<table class="table table-sm o_main_table" name="taxshelter_line_table">
<thead>
<tr>
<th>Type</th>
<th>Capital before</th>
<th>Capital after</th>
<th>Tax shelter eligible</th>
<th>Date</th>
<th>Amount</th>
<th>Amount ligible</th>
</tr>
</thead>
<tbody class="invoice_tbody">
<tr t-foreach="o.previously_subscribed_lines" t-as="l">
<td><span t-field="l.type"/></td>
<td><span t-field="l.capital_before_sub"/></td>
<td><span t-field="l.capital_after_sub"/></td>
<td><span t-if="l.tax_shelter">Oui</span><span t-else="">Non</span></td>
<td><span t-field="l.transaction_date"/></td>
<td><span t-field="l.amount_subscribed"/></td>
<td><span t-field="l.amount_subscribed_eligible"/></td>
</tr>
<tr t-foreach="o.subscribed_lines" t-as="l">
<td><span t-field="l.type"/></td>
<td><span t-field="l.capital_before_sub"/></td>
<td><span t-field="l.capital_after_sub"/></td>
<td><span t-if="l.tax_shelter">Oui</span><span t-else="">Non</span></td>
<td><span t-field="l.transaction_date"/></td>
<td><span t-field="l.amount_subscribed"/></td>
<td><span t-field="l.amount_subscribed_eligible"/></td>
</tr>
</tbody>
</table>
<p>
L' Article 145/26, CIR 92 sur les revenus <span t-field="o.declaration_id.fiscal_year"/>, connu aussi comme normative Tax Shelter, donnent droit à une réduction d’impôt à hauteur de &#160;<span t-field="o.declaration_id.tax_shelter_percentage"/> du montant de la valeur des parts souscrites depuis <span t-field="o.declaration_id.month_from"/> (et avant <span t-field="o.declaration_id.month_to"/> pour la déclaration des revenus &#160;<span t-field="o.declaration_id.fiscal_year"/>).
</p>
<p>
Cette lettre vaut donc comme certificat que <span t-field="o.company_id.name"/> remplit en effet tous les critères permettant un tel avantage fiscal. Dans les grandes lignes il faut être une micro-entreprise n’ayant encore jamais distribué de dividende et qui n'est pas issue d’une fusion ou scission de sociétés et qui répond à au moins deux des trois critères suivants :
<ul>
<li>le total du bilan est inférieur ou égal à 350.000 euros ;</li>
<li>le chiffre d’affaires, hors taxe sur la valeur ajoutée, est inférieur ou égal à 700.000 euros ;</li>
<li>la moyenne des travailleurs occupés pendant l’année est inférieure ou égale à 10.</li>
</ul>
</p>
<p>
Le maintien de la réduction d’impôt n’est possible que si l'investisseur conserve les parts de la coopérative pendant 4 ans au minimum, sauf si la sortie est imposée par des conditions extérieures (telles que la faillite, par exemple). En cas de sortie volontaire avant la période de 4 ans, l’avantage fiscal devra être remboursé au prorata du nombre de mois entre la sortie et les 4 ans. La coopérative s’engage à fournir pour chacune des quatre années suivant l’année d’acquisition une attestation certifiant que ces parts sont toujours en possession du souscripteur.
</p>
<p>
L’apport de capitaux par le chef d’entreprise lui-même ou par des administrateurs existants de la société ne permet pas de bénéficier du tax shelter.
</p>
<p>
Pour bénéficier de la réduction d’impôts, vous pouvez joindre cette lettre à votre déclaration fiscale pour les revenus <span t-field="o.declaration_id.fiscal_year"/>.
</p>
<p>
Pour toute information complémentaire, consultez le texte de l’Arrêté Royale.
</p>
<p>
Pour le Conseil d'administration de <span t-field="o.company_id.name"/>,<br/>
<strong t-field="o.company_id.board_representative"/><br/>
<img t-if="o.company_id.signature_scan"
t-attf-class="mt16"
t-attf-style="{{ 'min-height: 50px; max-height: 100px' if report_type == 'pdf' else '' }}"
t-att-src="'data:image/png;base64,%s' % o.company_id.signature_scan.decode()"
/>
</p>
</div>
</t>
</template>
<template id="tax_shelter_subscription_report">
<t t-call="web.html_container">
<t t-foreach="docs" t-as="o">
<t t-call="easy_my_coop_taxshelter_report.tax_shelter_report_subscription_document" t-lang="o.partner_id.lang"/>
</t>
</t>
</template>
</odoo>

14
easy_my_coop_taxshelter_report/security/ir.model.access.csv

@ -1,7 +1,7 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_tax_shelter_declaration,tax.shelter.declaration,model_tax_shelter_declaration,easy_my_coop.group_energiris_user,1,0,0,0
access_tax_shelter_declaration,tax.shelter.declaration,model_tax_shelter_declaration,easy_my_coop.group_energiris_manager,1,1,1,1
access_tax_shelter_certificate,tax.shelter.certificate,model_tax_shelter_certificate,easy_my_coop.group_energiris_user,1,0,0,0
access_tax_shelter_certificate,tax.shelter.certificate,model_tax_shelter_certificate,easy_my_coop.group_energiris_manager,1,1,1,1
access_certificate_line,certificate.line,model_certificate_line,easy_my_coop.group_energiris_user,1,0,0,0
access_certificate_line,certificate.line,model_certificate_line,easy_my_coop.group_energiris_manager,1,1,1,1
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_tax_shelter_declaration,tax.shelter.declaration,model_tax_shelter_declaration,easy_my_coop.group_easy_my_coop_user,1,0,0,0
access_tax_shelter_declaration,tax.shelter.declaration,model_tax_shelter_declaration,easy_my_coop.group_easy_my_coop_manager,1,1,1,1
access_tax_shelter_certificate,tax.shelter.certificate,model_tax_shelter_certificate,easy_my_coop.group_easy_my_coop_user,1,0,0,0
access_tax_shelter_certificate,tax.shelter.certificate,model_tax_shelter_certificate,easy_my_coop.group_easy_my_coop_manager,1,1,1,1
access_certificate_line,certificate.line,model_certificate_line,easy_my_coop.group_easy_my_coop_user,1,0,0,0
access_certificate_line,certificate.line,model_certificate_line,easy_my_coop.group_easy_my_coop_manager,1,1,1,1

19
easy_my_coop_taxshelter_report/static/src/css/coop_report.css

@ -1,19 +0,0 @@
.border-top-easymy-coop td {
border-top: 1pt solid #e7511e !important;
}
.border-easymy-coop th {
border-bottom: 1pt solid #e7511e !important;
}
.easymy-coop-normal {
font-family:Roboto-Bold;
font-size:12px;
line-height:14pt;
}
.easymy-coop-info-title {
font-family:Roboto-Bold;
font-size:12px;
line-height:14pt;
}

400
easy_my_coop_taxshelter_report/views/tax_shelter_declaration_view.xml

@ -1,201 +1,199 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<menuitem name="Declaration" id="menu_easy_my_coop_main_declaration" parent="easy_my_coop.menu_main_easy_my_coop" sequence="10"/>
<record id="tax_shelter_declaration_form" model="ir.ui.view">
<field name="name">tax.shelter.declaration.form</field>
<field name="model">tax.shelter.declaration</field>
<field name="arch" type="xml">
<form string="Tax shelter declaration">
<header>
<button name="compute_declaration" string="Process Declaration" type="object" states="draft" class="oe_highlight" groups="easy_my_coop.group_easy_my_coop_user"/>
<button name="validate_declaration" string="Validate Declaration" type="object" states="computed" groups="easy_my_coop.group_easy_my_coop_user"/>
<button name="reset_declaration" string="Reset Declaration" type="object" states="computed" groups="easy_my_coop.group_easy_my_coop_user"/>
<field name="state" widget="statusbar"/>
</header>
<sheet>
<group>
<group>
<field name="name"/>
<field name="fiscal_year"/>
<field name="tax_shelter_percentage"/>
<field name="tax_shelter_capital_limit"/>
<field name="previously_subscribed_capital"/>
</group>
<group>
<field name="date_from"/>
<field name="date_to"/>
<field name="month_from"/>
<field name="month_to"/>
</group>
</group>
<notebook>
<page string="Tax shelter certificates">
<field name="tax_shelter_certificates">
<tree>
<field name="partner_id"/>
<field name="cooperator_number"/>
<field name="total_amount" sum="Total amount"/>
<field name="state"/>
<button type="object" name="send_certificates" icon="STOCK_MEDIA_PLAY" string="Send Certificates"/>
</tree>
</field>
</page>
<page string="Excluded from Tax shelter">
<field name="excluded_cooperator"/>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<record id="tax_shelter_declaration_tree" model="ir.ui.view">
<field name="name">tax.shelter.declaration.tree</field>
<field name="model">tax.shelter.declaration</field>
<field name="arch" type="xml">
<tree string="Tax shelter declaration">
<field name="name"/>
<field name="date_from"/>
<field name="date_to"/>
<field name="tax_shelter_percentage"/>
<field name="state"/>
</tree>
</field>
</record>
<record id="tax_shelter_declaration_action" model="ir.actions.act_window">
<field name="name">Tax Shelter Declarations</field>
<field name="res_model">tax.shelter.declaration</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="tax_shelter_declaration_tree"/>
</record>
<menuitem action="tax_shelter_declaration_action" name="Tax Shelter Declaration" id="menu_tax_shelter_declaration" parent="menu_easy_my_coop_main_declaration" sequence="10" groups="easy_my_coop.group_easy_my_coop_user"/>
<record id="tax_shelter_certificate_form" model="ir.ui.view">
<field name="name">tax.shelter.certificate.form</field>
<field name="model">tax.shelter.certificate</field>
<field name="arch" type="xml">
<form string="Tax shelter certificate">
<header>
<button type="object" name="print_subscription_certificate" string="Print Subscription Certificate" />
<button type="object" name="print_shares_certificate" string="Print Shares Certificate" />
<button type="object" name="send_certificates" string="Send Certificates"/>
<field name="state" widget="statusbar"/>
</header>
<sheet>
<group>
<group>
<field name="cooperator_number"/>
<field name="partner_id"/>
<field name="declaration_id"/>
</group>
<group>
<field name="total_amount_previously_subscribed"/>
<field name="total_amount_eligible_previously_subscribed"/>
<field name="total_amount_subscribed"/>
<field name="total_amount_eligible"/>
<field name="total_amount_resold"/>
<field name="total_amount_transfered"/>
<field name="total_amount"/>
</group>
</group>
<notebook>
<page string="Subscription">
<field name="subscribed_lines">
<tree>
<field name="capital_before_sub"/>
<field name="capital_after_sub"/>
<field name="tax_shelter"/>
<field name="transaction_date"/>
<field name="share_type"/>
<field name="share_short_name"/>
<field name="quantity"/>
<field name="share_unit_price"/>
<field name="type"/>
<field name="amount_subscribed"/>
<field name="amount_subscribed_eligible"/>
</tree>
</field>
</page>
<page string="Sell back">
<field name="resold_lines">
<tree>
<field name="transaction_date"/>
<field name="share_type"/>
<field name="share_short_name"/>
<field name="quantity"/>
<field name="share_unit_price"/>
<field name="type"/>
<field name="amount_resold"/>
</tree>
</field>
</page>
<page string="Transfered">
<field name="transfered_lines">
<tree>
<field name="transaction_date"/>
<field name="share_type"/>
<field name="share_short_name"/>
<field name="quantity"/>
<field name="share_unit_price"/>
<field name="type"/>
<field name="amount_transfered"/>
</tree>
</field>
</page>
<page string="Previously subscribed">
<field name="previously_subscribed_lines">
<tree>
<field name="capital_before_sub"/>
<field name="capital_after_sub"/>
<field name="tax_shelter"/>
<field name="transaction_date"/>
<field name="share_type"/>
<field name="share_short_name"/>
<field name="quantity"/>
<field name="share_unit_price"/>
<field name="type"/>
<field name="amount_subscribed"/>
<field name="amount_subscribed_eligible"/>
</tree>
</field>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<record id="tax_shelter_certificate_tree" model="ir.ui.view">
<field name="name">tax.shelter.certificate.tree</field>
<field name="model">tax.shelter.certificate</field>
<field name="arch" type="xml">
<tree string="Tax shelter certificates">
<field name="declaration_id"/>
<field name="partner_id"/>
<field name="cooperator_number"/>
<field name="total_amount_subscribed"/>
<field name="total_amount_eligible"/>
<field name="total_amount_resold"/>
<field name="total_amount_transfered"/>
<field name="total_amount"/>
<field name="state"/>
</tree>
</field>
</record>
<record id="tax_shelter_certificate_action" model="ir.actions.act_window">
<field name="name">Tax Shelter Certificates</field>
<field name="res_model">tax.shelter.certificate</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="tax_shelter_certificate_tree"/>
</record>
<menuitem action="tax_shelter_certificate_action" name="Tax Shelter Certificates" id="menu_tax_shelter_certificate" parent="menu_easy_my_coop_main_declaration" sequence="20" groups="easy_my_coop.group_easy_my_coop_user"/>
</data>
</odoo>
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<menuitem name="Declaration" id="menu_easy_my_coop_main_declaration" parent="easy_my_coop.menu_main_easy_my_coop" sequence="10"/>
<record id="tax_shelter_declaration_form" model="ir.ui.view">
<field name="name">tax.shelter.declaration.form</field>
<field name="model">tax.shelter.declaration</field>
<field name="arch" type="xml">
<form string="Tax shelter declaration">
<header>
<button name="compute_declaration" string="Process Declaration" type="object" states="draft" class="oe_highlight" groups="easy_my_coop.group_easy_my_coop_user"/>
<button name="validate_declaration" string="Validate Declaration" type="object" states="computed" groups="easy_my_coop.group_easy_my_coop_user"/>
<button name="reset_declaration" string="Reset Declaration" type="object" states="computed" groups="easy_my_coop.group_easy_my_coop_user"/>
<field name="state" widget="statusbar"/>
</header>
<sheet>
<group>
<group>
<field name="name"/>
<field name="fiscal_year"/>
<field name="tax_shelter_percentage"/>
<field name="tax_shelter_capital_limit"/>
<field name="previously_subscribed_capital"/>
</group>
<group>
<field name="date_from"/>
<field name="date_to"/>
<field name="month_from"/>
<field name="month_to"/>
</group>
</group>
<notebook>
<page string="Tax shelter certificates">
<field name="tax_shelter_certificates">
<tree>
<field name="partner_id"/>
<field name="cooperator_number"/>
<field name="total_amount" sum="Total amount"/>
<field name="state"/>
<button type="object" name="send_certificates" icon="STOCK_MEDIA_PLAY" string="Send Certificates"/>
</tree>
</field>
</page>
<page string="Excluded from Tax shelter">
<field name="excluded_cooperator"/>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<record id="tax_shelter_declaration_tree" model="ir.ui.view">
<field name="name">tax.shelter.declaration.tree</field>
<field name="model">tax.shelter.declaration</field>
<field name="arch" type="xml">
<tree string="Tax shelter declaration">
<field name="name"/>
<field name="date_from"/>
<field name="date_to"/>
<field name="tax_shelter_percentage"/>
<field name="state"/>
</tree>
</field>
</record>
<record id="tax_shelter_declaration_action" model="ir.actions.act_window">
<field name="name">Tax Shelter Declarations</field>
<field name="res_model">tax.shelter.declaration</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="tax_shelter_declaration_tree"/>
</record>
<menuitem action="tax_shelter_declaration_action" name="Tax Shelter Declaration" id="menu_tax_shelter_declaration" parent="menu_easy_my_coop_main_declaration" sequence="10" groups="easy_my_coop.group_easy_my_coop_user"/>
<record id="tax_shelter_certificate_form" model="ir.ui.view">
<field name="name">tax.shelter.certificate.form</field>
<field name="model">tax.shelter.certificate</field>
<field name="arch" type="xml">
<form string="Tax shelter certificate">
<header>
<button type="object" name="print_subscription_certificate" string="Print Subscription Certificate" />
<button type="object" name="print_shares_certificate" string="Print Shares Certificate" />
<button type="object" name="send_certificates" string="Send Certificates"/>
<field name="state" widget="statusbar"/>
</header>
<sheet>
<group>
<group>
<field name="cooperator_number"/>
<field name="partner_id"/>
<field name="declaration_id"/>
</group>
<group>
<field name="total_amount_previously_subscribed"/>
<field name="total_amount_eligible_previously_subscribed"/>
<field name="total_amount_subscribed"/>
<field name="total_amount_eligible"/>
<field name="total_amount_resold"/>
<field name="total_amount_transfered"/>
<field name="total_amount"/>
</group>
</group>
<notebook>
<page string="Subscription">
<field name="subscribed_lines">
<tree>
<field name="capital_before_sub"/>
<field name="capital_after_sub"/>
<field name="tax_shelter"/>
<field name="transaction_date"/>
<field name="share_type"/>
<field name="share_short_name"/>
<field name="quantity"/>
<field name="share_unit_price"/>
<field name="type"/>
<field name="amount_subscribed"/>
<field name="amount_subscribed_eligible"/>
</tree>
</field>
</page>
<page string="Sell back">
<field name="resold_lines">
<tree>
<field name="transaction_date"/>
<field name="share_type"/>
<field name="share_short_name"/>
<field name="quantity"/>
<field name="share_unit_price"/>
<field name="type"/>
<field name="amount_resold"/>
</tree>
</field>
</page>
<page string="Transfered">
<field name="transfered_lines">
<tree>
<field name="transaction_date"/>
<field name="share_type"/>
<field name="share_short_name"/>
<field name="quantity"/>
<field name="share_unit_price"/>
<field name="type"/>
<field name="amount_transfered"/>
</tree>
</field>
</page>
<page string="Previously subscribed">
<field name="previously_subscribed_lines">
<tree>
<field name="capital_before_sub"/>
<field name="capital_after_sub"/>
<field name="tax_shelter"/>
<field name="transaction_date"/>
<field name="share_type"/>
<field name="share_short_name"/>
<field name="quantity"/>
<field name="share_unit_price"/>
<field name="type"/>
<field name="amount_subscribed"/>
<field name="amount_subscribed_eligible"/>
</tree>
</field>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<record id="tax_shelter_certificate_tree" model="ir.ui.view">
<field name="name">tax.shelter.certificate.tree</field>
<field name="model">tax.shelter.certificate</field>
<field name="arch" type="xml">
<tree string="Tax shelter certificates">
<field name="declaration_id"/>
<field name="partner_id"/>
<field name="cooperator_number"/>
<field name="total_amount_subscribed"/>
<field name="total_amount_eligible"/>
<field name="total_amount_resold"/>
<field name="total_amount_transfered"/>
<field name="total_amount"/>
<field name="state"/>
</tree>
</field>
</record>
<record id="tax_shelter_certificate_action" model="ir.actions.act_window">
<field name="name">Tax Shelter Certificates</field>
<field name="res_model">tax.shelter.certificate</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="tax_shelter_certificate_tree"/>
</record>
<menuitem action="tax_shelter_certificate_action" name="Tax Shelter Certificates" id="menu_tax_shelter_certificate" parent="menu_easy_my_coop_main_declaration" sequence="20" groups="easy_my_coop.group_easy_my_coop_user"/>
</odoo>
Loading…
Cancel
Save