[MERGE] merged the c2c branch about l10n_ch upgrade
bzr revid: qdp-launchpad@tinyerp.com-20110117160821-gzq49wpf3mqq1uc2
This commit is contained in:
commit
3a92d799a0
|
@ -1,41 +1,30 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# __init__.py
|
||||
# l10n_ch
|
||||
#
|
||||
# Created by Nicolas Bessi based on Credric Krier contribution
|
||||
#
|
||||
# Copyright (c) 2009 CamptoCamp. All rights reserved.
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# WARNING: This program as such is intended to be used by professional
|
||||
# programmers who take the whole responsability of assessing all potential
|
||||
# consequences resulting from its eventual inadequacies and bugs
|
||||
# End users who are looking for a ready-to-use solution with commercial
|
||||
# garantees and support are strongly adviced to contract a Free Software
|
||||
# Service Company
|
||||
# Author: Nicolas Bessi. Copyright Camptocamp SA
|
||||
# Donors: Hasa Sàrl, Open Net Sàrl and Prisme Solutions Informatique SA
|
||||
#
|
||||
# This program is Free Software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
# 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 General Public License for more details.
|
||||
# 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 General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
# 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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
||||
import wizard
|
||||
import account_wizard
|
||||
import invoice
|
||||
import company
|
||||
import partner
|
||||
import company
|
||||
import wizard
|
||||
import payment
|
||||
import report
|
||||
import bank
|
||||
|
|
|
@ -1,52 +1,56 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# __terp__.py
|
||||
# l10n_ch
|
||||
#
|
||||
# Created by Nicolas Bessi based on Credric Krier contribution
|
||||
#
|
||||
# Copyright (c) 2009 CamptoCamp. All rights reserved.
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# WARNING: This program as such is intended to be used by professional
|
||||
# programmers who take the whole responsability of assessing all potential
|
||||
# consequences resulting from its eventual inadequacies and bugs
|
||||
# End users who are looking for a ready-to-use solution with commercial
|
||||
# garantees and support are strongly adviced to contract a Free Software
|
||||
# Service Company
|
||||
# Author: Nicolas Bessi. Copyright Camptocamp SA
|
||||
# Donors: Hasa Sàrl, Open Net Sàrl and Prisme Solutions Informatique SA
|
||||
#
|
||||
# This program is Free Software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
# 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 General Public License for more details.
|
||||
# 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 General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
# 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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
{
|
||||
"name" : "Switzerland localisation corrected by Camptocamp",
|
||||
"name" : "Switzerland localization with 2011 taxes Beta 1",
|
||||
"description" : """
|
||||
Swiss localisation :
|
||||
- DTA generation for a lot of payment types
|
||||
- BVR management (number generation, report, etc..)
|
||||
- Import account move from the bank file (like v11 etc..)
|
||||
- Simplify the way you handle the bank statement for reconciliation
|
||||
- Swiws account chart that add also tax template definition
|
||||
|
||||
You can also add ZIP and bank completion with:
|
||||
- l10n_ch_zip
|
||||
- l10n_ch_bank
|
||||
|
||||
Author: Camptocamp SA
|
||||
Donors: Hasa Sàrl, Open Net Sàrl and Prisme Solutions Informatique SA
|
||||
|
||||
------------------------------------------------------------------------
|
||||
|
||||
Module incluant la localisation Suisse de TinyERP revu et corrigé par Camptocamp. Cette nouvelle version
|
||||
comprend la gestion et l'émissionde BVR, le paiement électronique via DTA (pour les banques, le système postal est en développement),
|
||||
l'import du relevé de compte depuis la banque de manière automatisée, le plan de compte Swiws.
|
||||
comprend la gestion et l'émissionde BVR, le paiement électronique via DTA (pour les banques, le système postal est en développement)
|
||||
et l'import du relevé de compte depuis la banque de manière automatisée.
|
||||
De plus, nous avons intégré la définition de toutes les banques Suisses(adresse, swift et clearing).
|
||||
|
||||
Par ailleurs, conjointement à ce module, nous proposons la complétion NPA:
|
||||
|
||||
Vous pouvez ajouter la completion des banques et des NPA avec with:
|
||||
- l10n_ch_zip
|
||||
- l10n_ch_bank
|
||||
|
||||
Auteur: Camptocamp SA
|
||||
Donateurs: Hasa Sàrl, Open Net Sàrl and Prisme Solutions Informatique SA
|
||||
|
||||
--------------------------------------------------------------------------
|
||||
TODO :
|
||||
- Implement bvr import partial reconciliation
|
||||
|
@ -57,38 +61,40 @@ TODO :
|
|||
|
||||
|
||||
""",
|
||||
"version" : "5.1",
|
||||
"version" : "6.0",
|
||||
"author" : "Camptocamp SA",
|
||||
"category" : "Localisation/Account Charts",
|
||||
"category" : "Localization/Account Charts",
|
||||
"website": "http://www.camptocamp.com",
|
||||
|
||||
"depends" : [
|
||||
"base_vat",
|
||||
"account_cancel",
|
||||
"base_iban",
|
||||
"account_payment",
|
||||
"account_voucher",
|
||||
"account",
|
||||
"account_chart",
|
||||
"report_webkit",
|
||||
],
|
||||
"init_xml" : [
|
||||
"dta_data.xml",
|
||||
"vaudtax_data.xml",
|
||||
'account.xml',
|
||||
'vat.xml',
|
||||
"journal_data.xml",
|
||||
#FR sterchi chart data
|
||||
'sterchi_chart/account.xml',
|
||||
'sterchi_chart/vat.xml', #JUST REMOVE THIS FILE WHEN OBSOLETE. ALL REQUIERED DATA IN VAT2011.XML
|
||||
'sterchi_chart/vat2011.xml',
|
||||
'sterchi_chart/fiscal_position.xml',
|
||||
],
|
||||
"demo_xml" : [
|
||||
"demo/vaudtax_data_demo.xml",
|
||||
"demo/demo.xml",
|
||||
],
|
||||
"update_xml" : [
|
||||
"wizard.xml",
|
||||
"dta_view.xml",
|
||||
"wizard/bvr_import_view.xml",
|
||||
"wizard/bvr_report_view.xml",
|
||||
"wizard/create_dta_view.xml",
|
||||
"company_view.xml",
|
||||
"account_invoice.xml",
|
||||
"bank_view.xml",
|
||||
'wizard.xml',
|
||||
'security/ir.model.access.csv',
|
||||
"security/ir.model.access.csv",
|
||||
"report/report_webkit_html_view.xml",
|
||||
],
|
||||
'test' : [
|
||||
'test/l10n_ch_report.yml',
|
||||
|
|
|
@ -31,7 +31,27 @@
|
|||
#
|
||||
##############################################################################
|
||||
|
||||
from osv import osv
|
||||
from osv import fields, osv
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Author: Nicolas Bessi. Copyright Camptocamp SA
|
||||
# Donors: Hasa Sàrl, Open Net Sàrl and Prisme Solutions Informatique SA
|
||||
#
|
||||
# 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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
class AccountMoveLine(osv.osv):
|
||||
""" Inherit account.move.line in order to add a custom link
|
||||
|
@ -40,13 +60,6 @@ class AccountMoveLine(osv.osv):
|
|||
|
||||
_inherit = 'account.move.line'
|
||||
|
||||
## @param self The object pointer.
|
||||
## @param cr a psycopg cursor
|
||||
## @param uid res.user.id that is currently loged
|
||||
## @param payment_type manual
|
||||
## @parma context a standard dict
|
||||
## @return a dict who has the account move line id as key and the bank id as value
|
||||
|
||||
def line2bank(self, cr, uid, ids, payment_type='manual', context=None):
|
||||
"""add a link to account.move.line in order to link
|
||||
supplier invoice line and bank. The original link
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Author: Nicolas Bessi. Copyright Camptocamp SA
|
||||
# Donors: Hasa Sàrl, Open Net Sàrl and Prisme Solutions Informatique SA
|
||||
#
|
||||
# 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/>.
|
||||
#
|
||||
##############################################################################
|
||||
import tools
|
||||
from osv import osv
|
||||
import addons
|
||||
|
||||
class WizardMultiChartsAccounts(osv.osv_memory):
|
||||
|
||||
_inherit ='wizard.multi.charts.accounts'
|
||||
_defaults = {
|
||||
'bank_accounts_id': False,
|
||||
'code_digits': 0,
|
||||
'sale_tax': False,
|
||||
'purchase_tax':False
|
||||
}
|
||||
|
||||
def execute(self, cr, uid, ids, context=None):
|
||||
"""Override of code in order to be able to link journal with account in XML"""
|
||||
res = super(WizardMultiChartsAccounts, self).execute(cr, uid, ids, context)
|
||||
path = addons.get_module_resource('l10n_ch/sterchi_chart/account_journal_rel.xml')
|
||||
tools.convert_xml_import(cr, 'l10n_ch', path, idref=None, mode='init', noupdate=True, report=None)
|
||||
return res
|
||||
|
||||
WizardMultiChartsAccounts()
|
||||
|
|
@ -1,31 +1,21 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# bank.py
|
||||
# l10n_ch
|
||||
#
|
||||
# Created by Nicolas Bessi based on Credric Krier contribution
|
||||
#
|
||||
# Copyright (c) 2009 CamptoCamp. All rights reserved.
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
# WARNING: This program as such is intended to be used by professional
|
||||
# programmers who take the whole responsability of assessing all potential
|
||||
# consequences resulting from its eventual inadequacies and bugs
|
||||
# End users who are looking for a ready-to-use solution with commercial
|
||||
# garantees and support are strongly adviced to contract a Free Software
|
||||
# Service Company
|
||||
#
|
||||
# This program is Free Software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
# Author: Nicolas Bessi. Copyright Camptocamp SA
|
||||
# Donors: Hasa Sàrl, Open Net Sàrl and Prisme Solutions Informatique SA
|
||||
#
|
||||
# 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 General Public License for more details.
|
||||
# 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.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
# 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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,33 +1,21 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# company.py
|
||||
# l10n_ch
|
||||
#
|
||||
# Created by Nicolas Bessi based on Credric Krier contribution
|
||||
#
|
||||
# Copyright (c) 2009 CamptoCamp. All rights reserved.
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# WARNING: This program as such is intended to be used by professional
|
||||
# programmers who take the whole responsability of assessing all potential
|
||||
# consequences resulting from its eventual inadequacies and bugs
|
||||
# End users who are looking for a ready-to-use solution with commercial
|
||||
# garantees and support are strongly adviced to contract a Free Software
|
||||
# Service Company
|
||||
# Author: Nicolas Bessi. Copyright Camptocamp SA
|
||||
# Donors: Hasa Sàrl, Open Net Sàrl and Prisme Solutions Informatique SA
|
||||
#
|
||||
# This program is Free Software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
# 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 General Public License for more details.
|
||||
# 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 General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
# 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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
@ -45,6 +33,14 @@ class res_company(osv.osv):
|
|||
### vert. delta in mm 1.2 will print the bvz 1.2mm lefter
|
||||
'bvr_delta_vert': fields.float('BVR Vert. Delta (mm)',
|
||||
help='vert. delta in mm 1.2 will print the bvz 1.2mm lefter'),
|
||||
### print bvr background image for standard paper or e-mail
|
||||
'bvr_background': fields.boolean('Insert BVR background ?'),
|
||||
|
||||
'bvr_only': fields.boolean('Separated BVR only ?',
|
||||
help='Print only the BVR separated page'),
|
||||
|
||||
'invoice_only': fields.boolean('Invoice only (Do not use with bvr only)?',
|
||||
help='Print only the invoice without BVR'),
|
||||
}
|
||||
|
||||
res_company()
|
||||
|
|
|
@ -10,6 +10,9 @@
|
|||
<field name="rml_footer2" position="after">
|
||||
<field name="bvr_delta_horz"/>
|
||||
<field name="bvr_delta_vert"/>
|
||||
<field name="bvr_background"/>
|
||||
<field name="bvr_only"/>
|
||||
<field name="invoice_only"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<field name="city">Lausanne</field>
|
||||
<field name="partner_id" ref="bank"/>
|
||||
<field name="country_id" model="res.country" search="[('code','=','ch')]"/>
|
||||
<field name="email">tinyerp@bank.com</field>
|
||||
<field name="email">openerp@bank.com</field>
|
||||
<field name="phone">+41 24 620 10 12</field>
|
||||
<field name="street">PSE-C</field>
|
||||
<field name="active">1</field>
|
||||
|
@ -49,20 +49,20 @@
|
|||
<field name="city">Lausanne</field>
|
||||
<field name="partner_id" ref="camptocamp"/>
|
||||
<field name="country_id" model="res.country" search="[('code','=','ch')]"/>
|
||||
<field name="email">tinyerp@camptocamp.com</field>
|
||||
<field name="email">openerp@camptocamp.com</field>
|
||||
<field name="phone">+41 21 619 10 12</field>
|
||||
<field name="street">PSE-A, EPFL</field>
|
||||
<field name="active">1</field>
|
||||
<field name="type">default</field>
|
||||
</record>
|
||||
<record id="res_partner_address_2" model="res.partner.address">
|
||||
<field name="name">Gilbert Robert</field>
|
||||
<field name="zip">1227</field>
|
||||
<field name="city">Carouge</field>
|
||||
<field name="name">Ferdinand Gassauer</field>
|
||||
<field name="zip">1015</field>
|
||||
<field name="city">Lausanne</field>
|
||||
<field name="partner_id" ref="prolibre"/>
|
||||
<field name="country_id" model="res.country" search="[('code','=','ch')]"/>
|
||||
<field name="email">info@prolibre.com</field>
|
||||
<field name="phone">+41 22 3015383</field>
|
||||
<field name="email">info@camptocamp.com</field>
|
||||
<field name="phone">+41 21 619 10 11</field>
|
||||
<field name="street">18, rue des Moraines </field>
|
||||
<field name="active">1</field>
|
||||
<field name="type">default</field>
|
||||
|
@ -74,7 +74,7 @@
|
|||
<field name="city">Lausanne</field>
|
||||
<field name="partner_id" ref="camptocamp"/>
|
||||
<field name="country_id" model="res.country" search="[('name','=','Switzerland')]"/>
|
||||
<field name="email">tinyerp@camptocamp.com</field>
|
||||
<field name="email">openerp@camptocamp.com</field>
|
||||
<field name="phone">+41 21 619 10 12 </field>
|
||||
<field name="street">PSE-A, EPFL</field>
|
||||
<field name="active">1</field>
|
|
@ -1,65 +1,58 @@
|
|||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record model="res.bank" id="partner_bank">
|
||||
<field name="name">Fortis s.a.</field>
|
||||
<field name="clearing">123456</field>
|
||||
</record>
|
||||
|
||||
<record model="res.partner.bank" id="agro_bank">
|
||||
<field name="name">Fortis account</field>
|
||||
<field name="acc_number">123456</field>
|
||||
<field name="partner_id" ref="base.res_partner_agrolait"/>
|
||||
<field name="state">bvrbank</field>
|
||||
<field name="bvr_number">234567</field>
|
||||
<field name="bank" ref="partner_bank"/>
|
||||
<field name="iban">CH9100767000S00023455</field>
|
||||
</record>
|
||||
|
||||
<record model="res.bank" id="partner_bank">
|
||||
<field name="name">Fortis s.a.</field>
|
||||
<field name="clearing">123456</field>
|
||||
</record>
|
||||
|
||||
<record model="res.partner.bank" id="agro_bank">
|
||||
<field name="name">Fortis account</field>
|
||||
<field name="acc_number">123456</field>
|
||||
<field name="partner_id" ref="base.res_partner_agrolait"/>
|
||||
<field name="state">bvrbank</field>
|
||||
<field name="bvr_number">234567</field>
|
||||
<field name="bank" ref="partner_bank"/>
|
||||
<field name="iban">CH9100767000S00023455</field>
|
||||
</record>
|
||||
|
||||
<record model="res.partner.bank" id="main_bank">
|
||||
<field name="name">My bank</field>
|
||||
<field name="acc_number">123456</field>
|
||||
<field name="iban">123456</field>
|
||||
<field name="partner_id" ref="base.main_partner"/>
|
||||
<field name="state">dta_company</field>
|
||||
<field name="bank" ref="partner_bank"/>
|
||||
<field name="iban">CH9100767000S00023455</field>
|
||||
</record>
|
||||
|
||||
<record model="account.invoice" id="v11_invoice">
|
||||
<field name="name">V11 invoice</field>
|
||||
<field name="amount_total">54150</field>
|
||||
<field name="number">1</field>
|
||||
<field name="partner_id" ref="base.res_partner_agrolait"/>
|
||||
<field name="address_invoice_id" ref="base.res_partner_address_8"/>
|
||||
<field name="account_id" ref="account.a_recv"/>
|
||||
<field name="currency_id" ref="base.EUR"/>
|
||||
<field name="company_id" ref="base.main_partner"/>
|
||||
</record>
|
||||
<record model="account.invoice.line" id="v11_invoice_line">
|
||||
<field name="name">Dummy product</field>
|
||||
<field name="price_unit">54150</field>
|
||||
<field name="quantity">1</field>
|
||||
<field name="account_id" ref="account.a_sale"/>
|
||||
<field name="invoice_id" ref="v11_invoice"/>
|
||||
</record>
|
||||
|
||||
<!--
|
||||
<record model="account.journal" id="account.sales_journal">
|
||||
<field name="default_debit_account_id" ref="account.a_recv"/>
|
||||
</record>
|
||||
-->
|
||||
<record model="res.partner.bank" id="main_bank">
|
||||
<field name="name">My bank</field>
|
||||
<field name="acc_number">123456</field>
|
||||
<field name="iban">123456</field>
|
||||
<field name="partner_id" ref="base.main_partner"/>
|
||||
<field name="state">dta_company</field>
|
||||
<field name="bank" ref="partner_bank"/>
|
||||
<field name="iban">CH9100767000S00023455</field>
|
||||
</record>
|
||||
|
||||
<record model="account.invoice" id="v11_invoice">
|
||||
<field name="name">V11 invoice</field>
|
||||
<field name="amount_total">54150</field>
|
||||
<field name="number">1</field>
|
||||
<field name="partner_id" ref="base.res_partner_agrolait"/>
|
||||
<field name="address_invoice_id" ref="base.res_partner_address_8"/>
|
||||
<field name="account_id" ref="account.a_recv"/>
|
||||
<field name="currency_id" ref="base.EUR"/>
|
||||
<field name="company_id" ref="base.main_partner"/>
|
||||
</record>
|
||||
<record model="account.invoice.line" id="v11_invoice_line">
|
||||
<field name="name">Dummy product</field>
|
||||
<field name="price_unit">54150</field>
|
||||
<field name="quantity">1</field>
|
||||
<field name="account_id" ref="account.a_sale"/>
|
||||
<field name="invoice_id" ref="v11_invoice"/>
|
||||
</record>
|
||||
|
||||
<record model="account.journal" id="account.sales_journal">
|
||||
<field name="default_debit_account_id" ref="account.a_recv"/>
|
||||
</record>
|
||||
|
||||
<!-- Define a payment mode -->
|
||||
|
||||
<record model="payment.mode" id="payment_mode_dta">
|
||||
<field name="name">DTA</field>
|
||||
<field name="bank_id" ref="main_bank"/>
|
||||
<field name="journal" model="account.journal" search="[('type','=','cash')]"/>
|
||||
<field name="name">DTA</field>
|
||||
<field name="bank_id" ref="main_bank"/>
|
||||
<field name="journal" model="account.journal" search="[('type','=','cash')]"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
|
|
|
@ -1,35 +1,25 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# dat.py
|
||||
# l10n_ch
|
||||
#
|
||||
# Created by Nicolas Bessi based on Credric Krier contribution
|
||||
#
|
||||
# Copyright (c) 2009 CamptoCamp. All rights reserved.
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# WARNING: This program as such is intended to be used by professional
|
||||
# programmers who take the whole responsability of assessing all potential
|
||||
# consequences resulting from its eventual inadequacies and bugs
|
||||
# End users who are looking for a ready-to-use solution with commercial
|
||||
# garantees and support are strongly adviced to contract a Free Software
|
||||
# Service Company
|
||||
# Author: Nicolas Bessi. Copyright Camptocamp SA
|
||||
# Donors: Hasa Sàrl, Open Net Sàrl and Prisme Solutions Informatique SA
|
||||
#
|
||||
# This program is Free Software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
# 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 General Public License for more details.
|
||||
# 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 General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
# 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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import time
|
||||
from osv import osv, fields
|
||||
|
||||
class account_dta(osv.osv):
|
||||
|
|
|
@ -1,141 +1,141 @@
|
|||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<data>
|
||||
|
||||
|
||||
<!-- Memo :
|
||||
Mandatory for all kind of dta payment:
|
||||
* for the partner bank:
|
||||
- a bank name
|
||||
* for the company:
|
||||
- iban
|
||||
Mandatory for iban payment:
|
||||
* for the partner:
|
||||
- iban
|
||||
- BIC / iban or a city
|
||||
Mandatory for bvrpost/bvrbank payment:
|
||||
* for the partner:
|
||||
- bvr ref number on the partner bank
|
||||
Mandatory for bvbank payment:
|
||||
* for the partner:
|
||||
- bank number
|
||||
Mandatory for bvpost payment:
|
||||
* for the partner:
|
||||
- post number
|
||||
-->
|
||||
|
||||
<!-- Memo :
|
||||
Mandatory for all kind of dta payment:
|
||||
* for the partner bank:
|
||||
- a bank name
|
||||
* for the company:
|
||||
- iban
|
||||
Mandatory for iban payment:
|
||||
* for the partner:
|
||||
- iban
|
||||
- BIC / iban or a city
|
||||
Mandatory for bvrpost/bvrbank payment:
|
||||
* for the partner:
|
||||
- bvr ref number on the partner bank
|
||||
Mandatory for bvbank payment:
|
||||
* for the partner:
|
||||
- bank number
|
||||
Mandatory for bvpost payment:
|
||||
* for the partner:
|
||||
- post number
|
||||
-->
|
||||
|
||||
<!-- Define new types -->
|
||||
<record model="res.partner.bank.type" id="bank_dta">
|
||||
<field name="name">Ordering party DTA</field>
|
||||
<field name="code">dta_company</field>
|
||||
<field name="name">Ordering party DTA</field>
|
||||
<field name="code">dta_company</field>
|
||||
</record>
|
||||
|
||||
<record model="res.partner.bank.type" id="dta_iban">
|
||||
<field name="name">DTA-IBAN</field>
|
||||
<field name="code">dta_iban</field>
|
||||
<field name="name">DTA-IBAN</field>
|
||||
<field name="code">dta_iban</field>
|
||||
</record>
|
||||
|
||||
<record model="res.partner.bank.type" id="bvrbank">
|
||||
<field name="name">DTA-BVRBANK</field>
|
||||
<field name="code">bvrbank</field>
|
||||
<field name="name">DTA-BVRBANK</field>
|
||||
<field name="code">bvrbank</field>
|
||||
</record>
|
||||
|
||||
<record model="res.partner.bank.type" id="bvrpost">
|
||||
<field name="name">DTA-BVRPOST</field>
|
||||
<field name="code">bvrpost</field>
|
||||
<field name="name">DTA-BVRPOST</field>
|
||||
<field name="code">bvrpost</field>
|
||||
</record>
|
||||
|
||||
<record model="res.partner.bank.type" id="bvpost">
|
||||
<field name="name">DTA-BVPOST</field>
|
||||
<field name="code">bvpost</field>
|
||||
<field name="name">DTA-BVPOST</field>
|
||||
<field name="code">bvpost</field>
|
||||
</record>
|
||||
|
||||
<record model="res.partner.bank.type" id="bvbank">
|
||||
<field name="name">DTA-BVBANK</field>
|
||||
<field name="code">bvbank</field>
|
||||
<field name="name">DTA-BVBANK</field>
|
||||
<field name="code">bvbank</field>
|
||||
</record>
|
||||
|
||||
|
||||
|
||||
<!-- Adjust the fields attributes for dta_company-->
|
||||
<record model="res.partner.bank.type.field" id="iban_field">
|
||||
<field name="name">iban</field>
|
||||
<field name="bank_type_id" ref="bank_dta"/>
|
||||
<field name="required" eval="True"/>
|
||||
<field name="readonly" eval="False"/>
|
||||
<field name="name">iban</field>
|
||||
<field name="bank_type_id" ref="bank_dta"/>
|
||||
<field name="required" eval="True"/>
|
||||
<field name="readonly" eval="False"/>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- Adjust the fields attributes for dta_iban-->
|
||||
<record model="res.partner.bank.type.field" id="iban_field_iban">
|
||||
<field name="name">iban</field>
|
||||
<field name="bank_type_id" ref="dta_iban"/>
|
||||
<field name="required" eval="True"/>
|
||||
<field name="readonly" eval="False"/>
|
||||
<field name="name">iban</field>
|
||||
<field name="bank_type_id" ref="dta_iban"/>
|
||||
<field name="required" eval="True"/>
|
||||
<field name="readonly" eval="False"/>
|
||||
</record>
|
||||
<record model="res.partner.bank.type.field" id="bank_field_iban">
|
||||
<field name="name">bank</field>
|
||||
<field name="bank_type_id" ref="dta_iban"/>
|
||||
<field name="required" eval="True"/>
|
||||
<field name="readonly" eval="False"/>
|
||||
<field name="name">bank</field>
|
||||
<field name="bank_type_id" ref="dta_iban"/>
|
||||
<field name="required" eval="True"/>
|
||||
<field name="readonly" eval="False"/>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- Adjust the fields attributes for bvrbank-->
|
||||
<record model="res.partner.bank.type.field" id="bank_field_bvrbank">
|
||||
<field name="name">bank</field>
|
||||
<field name="bank_type_id" ref="bvrbank"/>
|
||||
<field name="required" eval="True"/>
|
||||
<field name="readonly" eval="False"/>
|
||||
<field name="name">bank</field>
|
||||
<field name="bank_type_id" ref="bvrbank"/>
|
||||
<field name="required" eval="True"/>
|
||||
<field name="readonly" eval="False"/>
|
||||
</record>
|
||||
<record model="res.partner.bank.type.field" id="bvr_num_field_bvrbank">
|
||||
<field name="name">bvr_number</field>
|
||||
<field name="bank_type_id" ref="bvrbank"/>
|
||||
<field name="required" eval="True"/>
|
||||
<field name="readonly" eval="False"/>
|
||||
<field name="name">bvr_number</field>
|
||||
<field name="bank_type_id" ref="bvrbank"/>
|
||||
<field name="required" eval="True"/>
|
||||
<field name="readonly" eval="False"/>
|
||||
</record>
|
||||
|
||||
<!-- Adjust the fields attributes for bvrpost-->
|
||||
<record model="res.partner.bank.type.field" id="bank_field_bvrpost">
|
||||
<field name="name">bank</field>
|
||||
<field name="bank_type_id" ref="bvrpost"/>
|
||||
<field name="required" eval="True"/>
|
||||
<field name="readonly" eval="False"/>
|
||||
<field name="name">bank</field>
|
||||
<field name="bank_type_id" ref="bvrpost"/>
|
||||
<field name="required" eval="True"/>
|
||||
<field name="readonly" eval="False"/>
|
||||
</record>
|
||||
<record model="res.partner.bank.type.field" id="bvr_num_field_bvrpost">
|
||||
<field name="name">bvr_number</field>
|
||||
<field name="bank_type_id" ref="bvrpost"/>
|
||||
<field name="required" eval="True"/>
|
||||
<field name="readonly" eval="False"/>
|
||||
<field name="name">bvr_number</field>
|
||||
<field name="bank_type_id" ref="bvrpost"/>
|
||||
<field name="required" eval="True"/>
|
||||
<field name="readonly" eval="False"/>
|
||||
</record>
|
||||
|
||||
<!-- Adjust the fields attributes for bvpost -->
|
||||
<record model="res.partner.bank.type.field" id="bank_field_bvpost">
|
||||
<field name="name">bank</field>
|
||||
<field name="bank_type_id" ref="bvpost"/>
|
||||
<field name="required" eval="True"/>
|
||||
<field name="readonly" eval="False"/>
|
||||
<field name="name">bank</field>
|
||||
<field name="bank_type_id" ref="bvpost"/>
|
||||
<field name="required" eval="True"/>
|
||||
<field name="readonly" eval="False"/>
|
||||
</record>
|
||||
<record model="res.partner.bank.type.field" id="post_field_bvpost">
|
||||
<field name="name">post_number</field>
|
||||
<field name="bank_type_id" ref="bvpost"/>
|
||||
<field name="required" eval="True"/>
|
||||
<field name="readonly" eval="False"/>
|
||||
<field name="name">post_number</field>
|
||||
<field name="bank_type_id" ref="bvpost"/>
|
||||
<field name="required" eval="True"/>
|
||||
<field name="readonly" eval="False"/>
|
||||
</record>
|
||||
|
||||
<!-- Adjust the fields attributes for bvbank -->
|
||||
<record model="res.partner.bank.type.field" id="bank_field_bvbank">
|
||||
<field name="name">bank</field>
|
||||
<field name="bank_type_id" ref="bvbank"/>
|
||||
<field name="required" eval="True"/>
|
||||
<field name="readonly" eval="False"/>
|
||||
<field name="name">bank</field>
|
||||
<field name="bank_type_id" ref="bvbank"/>
|
||||
<field name="required" eval="True"/>
|
||||
<field name="readonly" eval="False"/>
|
||||
</record>
|
||||
|
||||
<record model="res.partner.bank.type.field" id="acc_num_field_bvbank">
|
||||
<field name="name">acc_number</field>
|
||||
<field name="bank_type_id" ref="bvbank"/>
|
||||
<field name="required" eval="True"/>
|
||||
<field name="readonly" eval="False"/>
|
||||
<field name="name">acc_number</field>
|
||||
<field name="bank_type_id" ref="bvbank"/>
|
||||
<field name="required" eval="True"/>
|
||||
<field name="readonly" eval="False"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
|
||||
<!-- Inherit both bank view -->
|
||||
<record model="ir.ui.view" id="view_partner_bank_form">
|
||||
<field name="name">partner - bank inherit</field>
|
||||
|
@ -18,7 +18,7 @@
|
|||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_partner_bank_form2">
|
||||
<field name="name">partner - bank inherit</field>
|
||||
<field name="model">res.partner.bank</field>
|
||||
|
@ -34,6 +34,6 @@
|
|||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -1,37 +1,25 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# bank.py
|
||||
# invoice.py
|
||||
#
|
||||
# Created by Nicolas Bessi based on Credric Krier contribution
|
||||
#
|
||||
# Copyright (c) 2009 CamptoCamp. All rights reserved.
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
# WARNING: This program as such is intended to be used by professional
|
||||
# programmers who take the whole responsability of assessing all potential
|
||||
# consequences resulting from its eventual inadequacies and bugs
|
||||
# End users who are looking for a ready-to-use solution with commercial
|
||||
# garantees and support are strongly adviced to contract a Free Software
|
||||
# Service Company
|
||||
#
|
||||
# This program is Free Software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
# Author: Nicolas Bessi. Copyright Camptocamp SA
|
||||
# Donors: Hasa Sàrl, Open Net Sàrl and Prisme Solutions Informatique SA
|
||||
#
|
||||
# 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 General Public License for more details.
|
||||
# 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.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
# 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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
from osv import fields, osv
|
||||
from tools import mod10r
|
||||
|
||||
|
@ -72,7 +60,7 @@ class account_invoice(osv.osv):
|
|||
for line in invoice.move_id.line_id:
|
||||
if not line.date_maturity or \
|
||||
datetime.strptime(line.date_maturity, '%Y-%m-%d') \
|
||||
< datetime.today():
|
||||
< datetime.now():
|
||||
res[invoice.id] += line.amount_to_pay
|
||||
return res
|
||||
|
||||
|
@ -96,13 +84,13 @@ class account_invoice(osv.osv):
|
|||
## @param user res.user.id that is currently loged
|
||||
## @parma ids invoices id
|
||||
## @return a boolean True if valid False if invalid
|
||||
def _check_bvr(self, cr, uid, ids, context=None):
|
||||
def _check_bvr(self, cr, uid, ids):
|
||||
"""
|
||||
Function to validate a bvr reference like :
|
||||
0100054150009>132000000000000000000000014+ 1300132412>
|
||||
The validation is based on l10n_ch
|
||||
"""
|
||||
invoices = self.browse(cr,uid,ids, context=context)
|
||||
invoices = self.browse(cr,uid,ids)
|
||||
for invoice in invoices:
|
||||
if invoice.reference_type == 'bvr':
|
||||
if not invoice.reference:
|
||||
|
@ -123,10 +111,10 @@ class account_invoice(osv.osv):
|
|||
## @param user res.user.id that is currently loged
|
||||
## @parma ids invoices id
|
||||
## @return a boolean True if valid False if invalid
|
||||
def _check_reference_type(self, cursor, user, ids, context=None):
|
||||
def _check_reference_type(self, cursor, user, ids):
|
||||
"""Check the customer invoice reference type depending
|
||||
on the BVR reference type and the invoice partner bank type"""
|
||||
for invoice in self.browse(cursor, user, ids, context=context):
|
||||
for invoice in self.browse(cursor, user, ids):
|
||||
if invoice.type in 'in_invoice':
|
||||
if invoice.partner_bank_id and \
|
||||
invoice.partner_bank_id.state in \
|
||||
|
@ -203,7 +191,7 @@ class account_tax_code(osv.osv):
|
|||
_name = 'account.tax.code'
|
||||
_inherit = "account.tax.code"
|
||||
_columns = {
|
||||
### The case code of the taxt code
|
||||
### The case code of the tax code
|
||||
'code': fields.char('Case Code', size=512),
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,71 @@
|
|||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="expenses_journal" model="account.journal">
|
||||
<field name="name">Journal de frais</field>
|
||||
<field name="code">EXPF</field>
|
||||
<field name="type">purchase</field>
|
||||
<field name="view_id" ref="account.account_journal_view"/>
|
||||
<field name="sequence_id" ref="account.sequence_journal"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field name="update_posted" eval="True" />
|
||||
<field name="entry_posted" eval="True" />
|
||||
</record>
|
||||
|
||||
<record id="bank_journal" model="account.journal">
|
||||
<field name="name">Banque CHF</field>
|
||||
<field name="code">BCHF</field>
|
||||
<field name="type">cash</field>
|
||||
<field name="view_id" ref="account.account_journal_bank_view"/>
|
||||
<field name="sequence_id" ref="account.sequence_journal"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field name="update_posted" eval="True" />
|
||||
<field name="entry_posted" eval="True" />
|
||||
</record>
|
||||
|
||||
<record id="bank_euro_journal" model="account.journal">
|
||||
<field name="name">Banque EUR</field>
|
||||
<field name="code">BEUR</field>
|
||||
<field name="type">cash</field>
|
||||
<field name="view_id" ref="account.account_journal_bank_view"/>
|
||||
<field name="sequence_id" ref="account.sequence_journal"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field name="update_posted" eval="True" />
|
||||
<field name="entry_posted" eval="True" />
|
||||
<field name="currency" model="res.currency" search="[('name','=','EUR')]" />
|
||||
</record>
|
||||
|
||||
<record id="petty_cash_journal" model="account.journal">
|
||||
<field name="name">Caisse</field>
|
||||
<field name="code">CAI</field>
|
||||
<field name="type">cash</field>
|
||||
<field name="view_id" ref="account.account_journal_bank_view"/>
|
||||
<field name="sequence_id" ref="account.sequence_journal"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field name="update_posted" eval="True" />
|
||||
<field name="entry_posted" eval="True" />
|
||||
</record>
|
||||
|
||||
<record id="misc_transaction_journal" model="account.journal">
|
||||
<field name="name">Opérations Diverses</field>
|
||||
<field name="code">OD</field>
|
||||
<field name="type">general</field>
|
||||
<field name="view_id" ref="account.account_journal_bank_view"/>
|
||||
<field name="sequence_id" ref="account.sequence_journal"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field name="update_posted" eval="True" />
|
||||
<field name="entry_posted" eval="True" />
|
||||
</record>
|
||||
|
||||
<record model="account.journal" id="bilan_journal">
|
||||
<field name="name">Journal d'ouverture</field>
|
||||
<field name="code">JO</field>
|
||||
<field name="type">situation</field>
|
||||
<field name="centralisation">True</field>
|
||||
<field name="view_id" ref="account.account_journal_view"/>
|
||||
<field name="sequence_id" ref="account.sequence_journal"/>
|
||||
<field name="update_posted" eval="True" />
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
|
@ -1,32 +1,21 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# bank.py
|
||||
# partner.py
|
||||
#
|
||||
# Created by Nicolas Bessi based on Credric Krier contribution
|
||||
#
|
||||
# Copyright (c) 2009 CamptoCamp. All rights reserved.
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
# WARNING: This program as such is intended to be used by professional
|
||||
# programmers who take the whole responsability of assessing all potential
|
||||
# consequences resulting from its eventual inadequacies and bugs
|
||||
# End users who are looking for a ready-to-use solution with commercial
|
||||
# garantees and support are strongly adviced to contract a Free Software
|
||||
# Service Company
|
||||
#
|
||||
# This program is Free Software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
# Author: Nicolas Bessi. Copyright Camptocamp SA
|
||||
# Donors: Hasa Sàrl, Open Net Sàrl and Prisme Solutions Informatique SA
|
||||
#
|
||||
# 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 General Public License for more details.
|
||||
# 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.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
# 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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
|
|
@ -1,32 +1,21 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# payment.py
|
||||
# l10n_ch
|
||||
#
|
||||
# Created by Nicolas Bessi based on Credric Krier contribution
|
||||
#
|
||||
# Copyright (c) 2009 CamptoCamp. All rights reserved.
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
# WARNING: This program as such is intended to be used by professional
|
||||
# programmers who take the whole responsability of assessing all potential
|
||||
# consequences resulting from its eventual inadequacies and bugs
|
||||
# End users who are looking for a ready-to-use solution with commercial
|
||||
# garantees and support are strongly adviced to contract a Free Software
|
||||
# Service Company
|
||||
#
|
||||
# This program is Free Software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
# Author: Nicolas Bessi. Copyright Camptocamp SA
|
||||
# Donors: Hasa Sàrl, Open Net Sàrl and Prisme Solutions Informatique SA
|
||||
#
|
||||
# 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 General Public License for more details.
|
||||
# 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.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
# 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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# __init__.py
|
||||
# l10n_ch
|
||||
#
|
||||
# Created by Nicolas Bessi based on Credric Krier contribution
|
||||
#
|
||||
# Copyright (c) 2009 CamptoCamp. All rights reserved.
|
||||
#-*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Copyright (c) 2010 Camptocamp SA (http://www.camptocamp.com)
|
||||
# All Right Reserved
|
||||
#
|
||||
# Author : Nicolas Bessi (Camptocamp)
|
||||
#
|
||||
# WARNING: This program as such is intended to be used by professional
|
||||
# programmers who take the whole responsability of assessing all potential
|
||||
# consequences resulting from its eventual inadequacies and bugs
|
||||
|
@ -30,6 +29,4 @@
|
|||
#
|
||||
##############################################################################
|
||||
|
||||
import bvr_report
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
import report_webkit_html
|
Binary file not shown.
After Width: | Height: | Size: 82 KiB |
|
@ -0,0 +1,110 @@
|
|||
<html>
|
||||
<head>
|
||||
<style type="text/css">
|
||||
@font-face {
|
||||
font-family: "bvrocrb";
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
src: url(${police_absolute_path('ocrbb.ttf')}) format("truetype");
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body topmargin="0px">
|
||||
<script type="text/javascript">
|
||||
function sortfunction(a, b){
|
||||
return (a.offsetTop - b.offsetTop) ;
|
||||
}
|
||||
function place_element2() {
|
||||
//This script was done to be inserted in any document mono or multi page some rounding problem may appear on mor than 10 page long report
|
||||
try{
|
||||
//height of bvr in mm
|
||||
var xpos = 105 + ${company.bvr_delta_horz or '0'};
|
||||
//height of A4 page in bvr
|
||||
var a4height = 297 ;
|
||||
//should be insert a page
|
||||
var insert_page = false; //will insert a blank page if true
|
||||
// should we insert bvr background
|
||||
var insert_bvrimg = ${str(company.bvr_background).lower()};
|
||||
//horiz decalage
|
||||
var vert_decalage = ${company.bvr_delta_vert or '0'};
|
||||
// height of header
|
||||
var headheight = ${headheight()};
|
||||
//dpi resolution has found in wkhtmltopdf doc if you want to calculate it just create a div with one inch of width and retrieve is with in px
|
||||
var res = 94;
|
||||
//we retriev all the bvr frame on the dom
|
||||
var els_node_list = document.getElementsByName('bvrframe');
|
||||
//we put them on an array
|
||||
var els = [];
|
||||
for(var i=0, len = els_node_list.length; i < len; i++)
|
||||
{
|
||||
els.push(els_node_list[i]);
|
||||
}
|
||||
//we sort on y postiton values
|
||||
els.sort(sortfunction);
|
||||
for (var i=0; i<els.length; i++) {
|
||||
var el = els[i];
|
||||
var el_height_mm = el.offsetTop/(res/25.4);
|
||||
// we insert the white page only if the BVR in not alleready on a separated page
|
||||
//so we insert the white page only if the difference bettween the old posisition and the new posisition is < 297 mm
|
||||
if(insert_page){
|
||||
el_height_mm = el_height_mm + a4height;
|
||||
}
|
||||
|
||||
if(el_height_mm % xpos){
|
||||
var el_xpos = Math.ceil(el_height_mm/a4height)*a4height;
|
||||
//We compute the page position of the a4 page on wich is the element.
|
||||
// we substact the bvr height and the height of header*the number of pages and we add the vertical decalage
|
||||
var ypos = (el_xpos-xpos)-(Math.ceil(el_height_mm/a4height)*headheight);
|
||||
|
||||
el.style.top = (ypos+vert_decalage)+"mm";
|
||||
el.style.position = "absolute";
|
||||
|
||||
}
|
||||
//This will propbely never happen but how knows ?
|
||||
else {
|
||||
var el_height_mm = el.offsetTop/(res/25.4);
|
||||
el.style.top = (el_height_mm+vert_decalage)+"mm";
|
||||
if(insert_page){
|
||||
el.style.top = el.style.top + a4height
|
||||
}
|
||||
}
|
||||
//we place the image if needed
|
||||
if(insert_bvrimg){
|
||||
img = document.getElementById("bvrimg_"+el.id);
|
||||
img.style.top = el.style.top;
|
||||
img.style.position = "absolute";
|
||||
}
|
||||
}
|
||||
} catch(err){
|
||||
//console.log(err)
|
||||
//document.getElementById("debug").textContent = document.getElementById("debug").textContent +"<br/>"+'-ERROR-'+err;
|
||||
}
|
||||
}
|
||||
window.onload=foo
|
||||
function foo() {
|
||||
place_element2();
|
||||
|
||||
}
|
||||
</script>
|
||||
${_check(objects)}
|
||||
%for inv in objects :
|
||||
<% setLang(inv.partner_id.lang) %>
|
||||
<div id="cont_${inv.id}" style="padding-left:20mm;padding-top:0;padding-bottom:10;height:180mm">
|
||||
<!-- Your communication message here -->
|
||||
</div>
|
||||
%if company.bvr_background:
|
||||
<img name="bvrimg" id="bvrimg_${inv.id}" alt="bvr" src="${bvr_absolute_path()}" style="width:210mm;height:106mm;border:0;margin:0;position:absolute;top:0" />
|
||||
%endif
|
||||
<table name="bvrframe" id="${inv.id}" style="width:210mm;height:106mm;border-collapse:collapse;padding-left:3mm;font-family:Helvetica;font-size:8pt;border-width:0px" border="0" CELLPADDING="0" CELLSPACING="0"> <!--border-width:1px;border-style:solid;border-color:black;-->
|
||||
<tr style="height:16.933333mm;vertical-align:bottom;padding-bottom:3mm"><td style="width:60.14mm;padding-bottom:3mm"><div style="padding-left:3mm;">${inv.partner_bank_id and inv.partner_bank_id.print_bank and inv.partner_bank_id.bank and inv.partner_bank_id.bank.name or ''}</div></td><td style="width:60.96mm;padding-bottom:3mm"><div style="padding-left:3mm;">${inv.partner_bank_id and inv.partner_bank_id.print_bank and inv.partner_bank_id.bank and inv.partner_bank_id.bank.name or ''}</div></td><td style="width:88.9mm"></td></tr>
|
||||
<tr style="height:12.7mm;vertical-align:bottom;padding-bottom:3mm"><td style="width:60.14mm;padding-bottom:3mm"><div style="padding-left:3mm;"><b>${user.company_id.partner_id.name}</b></div></td><td style="width:60.96mm;padding-bottom:3mm"><div style="padding-left:3mm;"><b>${user.company_id.partner_id.name}</b></div></td><td style="width:88.9mm"></td></tr>
|
||||
<tr style="height:16.933333mm;vertical-align:bottom;padding-bottom:0"><td><table style="padding-left:3mm;font-family:Helvetica;font-size:8pt" height="100%"><tr style="vertical-align:top;padding-bottom:0"><td>${user.company_id.partner_id.address[0].street}<br/> ${user.company_id.partner_id.address[0].zip} ${user.company_id.partner_id.address[0].city}</td></tr><tr style="vertical-align:bottom;padding-bottom:0"><td><div style="padding-left:30.48mm;">${inv.partner_bank_id.print_account and inv.partner_bank_id.bvr_number or ''}</div></td></tr></table></td><td style="padding-left:3mm"><table style="padding-left:3mm;font-family:Helvetica;font-size:8pt" height="100%"><tr style="vertical-align:top;padding-bottom:0"><td>${user.company_id.partner_id.address[0].street}<br/>${user.company_id.partner_id.address[0].zip} ${user.company_id.partner_id.address[0].city}</td></tr><tr style="vertical-align:bottom;padding-bottom:0"><td><div style="padding-left:30.48mm;">${inv.partner_bank_id.print_account and inv.partner_bank_id.bvr_number or ''}</div></td></tr></table></td><td style="text-align: right;padding-right:4mm;padding-bottom:8mm;font-size:11pt">${_space(_get_ref(inv))}</td></tr>
|
||||
<tr style="height:8.4666667mm;vertical-align:bottom;padding-bottom:0"> <td><table style="width:100%" CELLPADDING="0" CELLSPACING="0"><td style="width:4mm"></td><td style="width:40mm;text-align: right" >${_space(('%.2f' % inv.amount_total)[:-3], 1)}</td><td style="width:6mm"></td><td style="width:10mm;text-align: right">${ _space(('%.2f' % inv.amount_total)[-2:], 1)}</td><td style="width:3mm;text-align: right"></td></table></td><td><table style="width:100%" CELLPADDING="0" CELLSPACING="0"><td style="width:4mm"></td><td style="width:40mm;text-align: right" >${_space(('%.2f' % inv.amount_total)[:-3], 1)}</td><td style="width:6mm"></td><td style="width:10mm;text-align: right">${ _space(('%.2f' % inv.amount_total)[-2:], 1)}</td><td style="width:3mm;text-align: right"></td></table></td><td></td></tr>
|
||||
<tr style="height:21.166667mm"><td></td><td></td><td></td></tr>
|
||||
<tr style="height:8.4666667mm"> <td></td><td></td><td></td></tr>
|
||||
<tr style="height:21.166667mm;vertical-align:top"><td></td><td colspan="2" style="text-align:right;padding-right:0.3in;font-family:bvrocrb;font-size:12pt">${mod10r('01'+str('%.2f' % inv.amount_total).replace('.','').rjust(10,'0'))}>${_get_ref(inv)}+${inv.partner_bank_id.bvr_number.split('-')[0]+(str(inv.partner_bank_id.bvr_number.split('-')[1])).rjust(6,'0')+inv.partner_bank_id.bvr_number.split('-')[2]}></td></tr>
|
||||
</table>
|
||||
%endfor
|
||||
</body>
|
||||
</html>
|
Binary file not shown.
After Width: | Height: | Size: 224 KiB |
|
@ -1,381 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<document filename="test.pdf">
|
||||
<docinit>
|
||||
</docinit>
|
||||
|
||||
<template pageSize="(210.0mm,297.0mm)" title="Invoices BVR" author="OpenERP S.A. (sales@openerp.com)" allowSplitting="20">
|
||||
<pageTemplate id="first">
|
||||
<pageGraphics>
|
||||
<!-- You Logo - Change X,Y,Width and Height -->
|
||||
<image x="1.3cm" y="27.6cm" height="40.0" >[[company.logo or removeParentNode('image')]]</image>
|
||||
<setFont name="Helvetica" size="8"/>
|
||||
<fill color="black"/>
|
||||
<stroke color="black"/>
|
||||
<lines>1.3cm 27.7cm 20cm 27.7cm</lines>
|
||||
|
||||
<drawRightString x="20cm" y="27.8cm">[[ company.rml_header1 ]]</drawRightString>
|
||||
|
||||
|
||||
<drawString x="1.3cm" y="27.2cm">[[ company.partner_id.name ]]</drawString>
|
||||
<drawString x="1.3cm" y="26.8cm">[[ company.partner_id.address and company.partner_id.address[0].street or '' ]]</drawString>
|
||||
<drawString x="1.3cm" y="26.4cm">[[ company.partner_id.address and company.partner_id.address[0].zip or '' ]] [[ company.partner_id.address and company.partner_id.address[0].city or '' ]] - [[ company.partner_id.address and company.partner_id.address[0].country_id and company.partner_id.address[0].country_id.name or '']]</drawString>
|
||||
<drawString x="1.3cm" y="26.0cm">Phone:</drawString>
|
||||
<drawRightString x="7cm" y="26.0cm">[[ company.partner_id.address and company.partner_id.address[0].phone or '' ]]</drawRightString>
|
||||
<drawString x="1.3cm" y="25.6cm">Mail:</drawString>
|
||||
<drawRightString x="7cm" y="25.6cm">[[ company.partner_id.address and company.partner_id.address[0].email or '' ]]</drawRightString>
|
||||
<lines>1.3cm 25.5cm 7cm 25.5cm</lines>
|
||||
<drawCentredString x="10.5cm" y="0.8cm">Contact : [[ user.name ]] - Page: <pageNumber/></drawCentredString>
|
||||
</pageGraphics> <!-- end of header -->
|
||||
<frame id="first" x1="24.0" y1="111.5mm" width="190mm" height="142mm" last="1"/>
|
||||
<frame id="Frame1"
|
||||
expr="{'height':str(111+(company.bvr_delta_vert or 0.0))+'mm', 'x1': str((company.bvr_delta_horz or 0.0))+'mm'}"
|
||||
x1="0mm"
|
||||
y1="-5"
|
||||
width="210mm"
|
||||
height="111mm"/>
|
||||
</pageTemplate>
|
||||
</template>
|
||||
<!-- begin of core -->
|
||||
<stylesheet>
|
||||
<blockTableStyle id="Standard_Outline">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table1">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table2">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="GRID" colorName="black"/>
|
||||
<blockBackground colorName="#e6e6e6" start="0,0" stop="0,0"/>
|
||||
<blockBackground colorName="#e6e6e6" start="1,0" stop="1,0"/>
|
||||
<blockBackground colorName="#e6e6e6" start="2,0" stop="2,0"/>
|
||||
<blockBackground colorName="#e6e6e6" start="3,0" stop="3,0"/>
|
||||
<blockBackground colorName="#e6e6e6" start="4,0" stop="4,0"/>
|
||||
<blockBackground colorName="#e6e6e6" start="5,0" stop="5,0"/>
|
||||
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table3">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table4">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table5">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<blockBackground colorName="#e6e6e6" start="0,1" stop="0,1"/>
|
||||
<blockBackground colorName="#e6e6e6" start="1,1" stop="1,1"/>
|
||||
<blockBackground colorName="#e6e6e6" start="2,1" stop="2,1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table6">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<blockBackground colorName="#e6e6e6" start="0,0" stop="0,0"/>
|
||||
<blockBackground colorName="#e6e6e6" start="1,0" stop="1,0"/>
|
||||
<blockBackground colorName="#e6e6e6" start="2,0" stop="2,0"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table7">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<initialize>
|
||||
<paraStyle name="all" alignment="justify"/>
|
||||
</initialize>
|
||||
<paraStyle name="P1" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P2" fontName="Helvetica-BoldOblique" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P3" fontName="Helvetica" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P4" fontName="Helvetica-BoldOblique" fontSize="11.0" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P5" fontName="Helvetica-BoldOblique" fontSize="11.0" leading="14" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P6" fontName="Helvetica" fontSize="10.0" leading="13" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P7" fontName="Helvetica" fontSize="10.0" leading="13" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P8" fontName="Helvetica" fontSize="10.0" leading="13" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P9" fontName="Helvetica-Oblique" fontSize="8.0" leading="10" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P10" fontName="Helvetica" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P11" fontName="Helvetica" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P12" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P13" fontName="Helvetica" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P14" fontName="Helvetica-Bold" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P15" fontName="Helvetica-Bold" fontSize="5.0" leading="6" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P16" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P17" fontName="Helvetica-Bold" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P18" fontName="Helvetica"/>
|
||||
<paraStyle name="P19" fontName="Helvetica-Bold" fontSize="20.0" leading="25" alignment="LEFT"/>
|
||||
<paraStyle name="P20" fontName="Helvetica-BoldOblique" fontSize="14.0" leading="17" alignment="CENTER"/>
|
||||
<paraStyle name="P21" fontName="Helvetica" fontSize="11.0" leading="14"/>
|
||||
<paraStyle name="P22" fontName="Helvetica-Bold" fontSize="11.0" leading="14"/>
|
||||
<paraStyle name="P23" fontName="Helvetica" fontSize="11.0" leading="14" alignment="LEFT"/>
|
||||
<paraStyle name="P24" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT"/>
|
||||
<paraStyle name="P25" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P26" fontName="Helvetica-BoldOblique" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P27" fontName="Helvetica" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P28" fontName="Helvetica-BoldOblique" fontSize="11.0" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P29" fontName="Helvetica-BoldOblique" fontSize="11.0" leading="14" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P30" fontName="Helvetica" fontSize="10.0" leading="13" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P31" fontName="Helvetica" fontSize="10.0" leading="13" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P32" fontName="Helvetica" fontSize="10.0" leading="13" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P33" fontName="Helvetica-Oblique" fontSize="8.0" leading="10" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P34" fontName="Helvetica" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P35" fontName="Helvetica" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P36" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P37" fontName="Helvetica" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P38" fontName="Helvetica-Bold" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P39" fontName="Helvetica-Bold" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P40" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P41" fontName="Helvetica-Bold" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P42" fontName="Helvetica"/>
|
||||
<paraStyle name="P43" fontName="Helvetica" fontSize="11.0" leading="14" alignment="LEFT"/>
|
||||
<paraStyle name="P44" fontName="Helvetica-Bold" fontSize="20.0" leading="25" alignment="LEFT"/>
|
||||
<paraStyle name="P45" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT"/>
|
||||
<paraStyle name="P46" fontName="Helvetica-BoldOblique" fontSize="14.0" leading="17" alignment="CENTER"/>
|
||||
<paraStyle name="P47" fontName="Helvetica" fontSize="11.0" leading="14"/>
|
||||
<paraStyle name="P48" fontName="Helvetica-Bold" fontSize="11.0" leading="14"/>
|
||||
<paraStyle name="Standard" fontName="Helvetica"/>
|
||||
<paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Table Contents" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Caption" fontName="Helvetica" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Index" fontName="Helvetica"/>
|
||||
</stylesheet>
|
||||
<story>
|
||||
<para style="P2">[[ repeatIn(objects,'o') ]]</para>
|
||||
<para style="P2">[[ setLang(o.partner_id.lang) ]]</para>
|
||||
<blockTable colWidths="295.0,232.0" style="Table1">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P18">[[ o.partner_id.name ]] [[ o.partner_id.title or '' ]]</para>
|
||||
<para style="P18">[[ o.address_invoice_id.title or '' ]] [[ o.address_invoice_id.name ]]</para>
|
||||
<para style="P18">[[ o.address_invoice_id.street ]]</para>
|
||||
<para style="P18">[[ o.address_invoice_id.street2 or '' ]]</para>
|
||||
<para style="P18">[[ o.address_invoice_id.zip or '' ]] [[ o.address_invoice_id.city or '' ]]</para>
|
||||
<para style="P18">[[ o.address_invoice_id.state_id and o.address_invoice_id.state_id.name or '' ]]</para>
|
||||
<para style="P18">[[ o.address_invoice_id.country_id and o.address_invoice_id.country_id.name or '' ]]</para>
|
||||
<para style="P18">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P18">VAT : [[ o.partner_id.vat or removeParentNode('para') ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="P19">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P24">Invoice [[ ((o.type == 'out_invoice' and (o.state == 'open' or o.state == 'paid')) or removeParentNode('para')) and '' ]] [[ o.number ]]</para>
|
||||
<para style="P24">PRO-FORMA [[ ((o.type == 'out_invoice' and o.state == 'proforma') or removeParentNode('para')) and '' ]]</para>
|
||||
<para style="P24">Draft Invoice [[ ((o.type == 'out_invoice' and o.state == 'draft') or removeParentNode('para')) and '' ]]</para>
|
||||
<para style="P24">Canceled Invoice [[ ((o.type == 'out_invoice' and o.state == 'cancel') or removeParentNode('para')) and '' ]]</para>
|
||||
<para style="P24">Refund [[ (o.type=='out_refund' or removeParentNode('para')) and '' ]] [[ o.number ]]</para>
|
||||
<para style="P24">Supplier Refund [[ (o.type=='in_refund' or removeParentNode('para')) and '' ]] [[ o.number ]]</para>
|
||||
<para style="P24">Supplier Invoice [[ (o.type=='in_invoice' or removeParentNode('para')) and '' ]] [[ o.number ]]</para>
|
||||
<para style="P20">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P21">
|
||||
<font face="Helvetica">Concerne:</font>
|
||||
<font face="Helvetica">[[o.name]]</font>
|
||||
</para>
|
||||
<para style="P21">
|
||||
<font face="Helvetica">Invoice Date: </font>
|
||||
<font face="Helvetica">[[ o.date_invoice and format_date(o.date_invoice) or '']]</font>
|
||||
</para>
|
||||
<para style="P21">
|
||||
<font face="Helvetica">Remarque:</font>
|
||||
<font face="Helvetica"> [[o.comment]]</font>
|
||||
</para>
|
||||
<para style="P22">
|
||||
<font face="Helvetica">Condition</font>
|
||||
<font face="Helvetica"> : [[o.payment_term and o.payment_term.name or '']]</font>
|
||||
</para>
|
||||
<para style="P18">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="216.0, 62.0, 62.0, 63.0, 40.0, 84.0" style="Table2">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P4">Description</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P5">TVA (%)</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P5">Quantity</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P5">Unit Price</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P5">Disc. (%)</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P5">Price </para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<section>
|
||||
<para style="P15">[[repeatIn(o.invoice_line,'l') ]]</para>
|
||||
<blockTable colWidths="216.0, 62.0, 62.0, 63.0, 40.0, 84.0" style="Table3">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P6">[[ l.name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P8">[[ ', '.join([str((float(lt.amount) * 100)) for lt in l.invoice_line_tax_id]) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P7">[[ l.quantity ]] </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P7">[[ comma_me( l.price_unit) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P7">[[ round(l.discount) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P7">[[ comma_me(l.price_subtotal) ]] [[o.currency_id.symbol ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="28.0, 499.0" style="Table4">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P9">[[ l.note or removeParentNode('blockTable') ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<xpre style="P16">[[ l.note ]]</xpre>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</section>
|
||||
<para style="P18">
|
||||
</para>
|
||||
<blockTable colWidths="215.0,313.0" style="Table5">
|
||||
<tr>
|
||||
<td>
|
||||
<blockTable colWidths="81.0,73.0,60.0" style="Table6">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P10">Tax</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P11">Base</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P11">Amount</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P12"><font face="Helvetica">[[ repeatIn(o.tax_line,'t') ]]</font> [[ t.name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P14">[[ comma_me( t.base )]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P14">[[ comma_me( t.amount)]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</td>
|
||||
<td>
|
||||
<blockTable colWidths="214.0,95.0" style="Table7">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P13">Total (excl. taxes):</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P13">[[ comma_me(o.amount_untaxed) ]] [[o.currency_id.symbol ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P13">Taxes:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P13">[[ comma_me(o.amount_tax) ]] [[o.currency_id.symbol ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P14">Total <font face="Helvetica">(incl. taxes):</font></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P17">[[ comma_me(o.amount_total) ]] [[o.currency_id.symbol ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<!-- end of core -->
|
||||
<currentFrame name="Frame1"/>
|
||||
<!--
|
||||
Width: 2.3inch, 5.9inch
|
||||
Height: 4*1/6 inch
|
||||
-->
|
||||
<illustration width="210mm" height="106mm">
|
||||
<setFont name="Helvetica" size="11"/>
|
||||
<drawString x="2mm" y="93mm">[[ o.partner_bank_id and o.partner_bank_id.printBank and o.partner_bank_id.bank and o.partner_bank_id.bank.name or '' ]]</drawString>
|
||||
<drawString x="2mm" y="88mm">[[ o.partner_bank_id and o.partner_bank_id.printBank and o.partner_bank_id.bank and o.partner_bank_id.bank.zip or '']] [[ o.partner_bank_id and o.partner_bank_id.printBank and o.partner_bank_id.bank and o.partner_bank_id.bank.city or '']]</drawString>
|
||||
|
||||
<drawString x="62mm" y="93mm">[[ o.partner_bank_id and o.partner_bank_id.printBank and o.partner_bank_id.bank and o.partner_bank_id.bank.name or '' ]]</drawString>
|
||||
<drawString x="62mm" y="88mm">[[ o.partner_bank_id and o.partner_bank_id.printBank and o.partner_bank_id.bank and o.partner_bank_id.bank.zip or '']] [[ o.partner_bank_id and o.partner_bank_id.printBank and o.partner_bank_id.bank and o.partner_bank_id.bank.city or '']]</drawString>
|
||||
<drawString x="2mm" y="78mm"> [[user.company_id.name]]</drawString>
|
||||
<drawString x="2mm" y="73mm"> [[ user.company_id.partner_id.address[0].street ]]</drawString>
|
||||
<drawString x="2mm" y="68mm"> [[ (user.company_id.partner_id.address[0].street2 or '')]]</drawString>
|
||||
<drawString x="2mm" y="63mm"> [[ user.company_id.partner_id.address[0].zip ]] [[ user.company_id.partner_id.address[0].city ]]</drawString>
|
||||
|
||||
<drawString x="62mm" y="78mm">[[user.company_id.name]]</drawString>
|
||||
<drawString x="62mm" y="73mm">[[ user.company_id.partner_id.address[0].street ]]</drawString>
|
||||
<drawString x="62mm" y="68mm">[[ (user.company_id.partner_id.address[0].street2 or '')]]</drawString>
|
||||
<drawString x="62mm" y="63mm">[[ user.company_id.partner_id.address[0].zip ]] [[ user.company_id.partner_id.address[0].city ]]</drawString>
|
||||
|
||||
<setFont name="ocrb" size="9"/>
|
||||
|
||||
<drawString x="2mm" y="35mm"> [[ o.partner_id.name ]]</drawString>
|
||||
<drawString x="2mm" y="30mm"> [[ o.address_invoice_id.street ]]</drawString>
|
||||
<drawString x="2mm" y="25mm"> [[ (o.address_invoice_id.street2 or '')]]</drawString>
|
||||
<drawString x="2mm" y="20mm"> [[ o.address_invoice_id.zip ]] [[ o.address_invoice_id.city ]]</drawString>
|
||||
|
||||
<drawString x="2mm" y="40mm"> [[ _get_ref(o) ]]</drawString>
|
||||
|
||||
<drawString x="126mm" y="50mm">[[ o.partner_id.name ]]</drawString>
|
||||
<drawString x="126mm" y="45mm">[[ o.address_invoice_id.street ]]</drawString>
|
||||
<drawString x="126mm" y="40mm">[[ (o.address_invoice_id.street2 or '')]]</drawString>
|
||||
<drawString x="126mm" y="35mm">[[ o.address_invoice_id.zip ]] [[ o.address_invoice_id.city ]]</drawString>
|
||||
|
||||
|
||||
<setFont name="ocrb" size="11"/>
|
||||
|
||||
<drawString x="124mm" y="67mm">[[ _space(_get_ref(o)) ]]</drawString>
|
||||
|
||||
<setFont name="ocrb" size="12"/>
|
||||
<drawRightString x="52 mm" y="59.3mm">[[ o.partner_bank_id and o.partner_bank_id.printAccount and o.partner_bank_id.bvr_number or '' ]]</drawRightString>
|
||||
<drawRightString x="112mm" y="59.3mm">[[ o.partner_bank_id and o.partner_bank_id.printAccount and o.partner_bank_id.bvr_number or '' ]]</drawRightString>
|
||||
<drawRightString x="42mm" y="50mm">[[ _space(('%.2f' % o.amount_total)[:-3], 1) + ' ' ]]</drawRightString>
|
||||
<drawRightString x="104mm" y="50mm">[[ _space(('%.2f' % o.amount_total)[:-3], 1) + ' ' ]]</drawRightString>
|
||||
|
||||
<drawRightString x="58mm" y="50mm">[[ _space(('%.2f' % o.amount_total)[-2:], 1) + ' ' ]]</drawRightString>
|
||||
<drawRightString x="119mm" y="50mm">[[ _space(('%.2f' % o.amount_total)[-2:], 1) + ' ' ]]</drawRightString>
|
||||
|
||||
|
||||
<!--
|
||||
Exact value: y=17.6mm
|
||||
-->
|
||||
|
||||
<setFont name="ocrb" size="11.5"/>
|
||||
<drawRightString x="195mm" y="15mm">[[mod10r('01'+str('%.2f' % o.amount_total).replace('.','').rjust(10,'0'))]]>[[ _get_ref(o) ]]+ [[o.partner_bank_id.bvr_number.split('-')[0]+(str(o.partner_bank_id.bvr_number.split('-')[1])).rjust(6,'0')+o.partner_bank_id.bvr_number.split('-')[2] ]]></drawRightString>
|
||||
|
||||
</illustration>
|
||||
|
||||
</story>
|
||||
</document>
|
|
@ -1,119 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# bvr.py
|
||||
# l10n_ch
|
||||
#
|
||||
# Created by Nicolas Bessi based on Credric Krier contribution
|
||||
#
|
||||
# Copyright (c) 2009 CamptoCamp. All rights reserved.
|
||||
##############################################################################
|
||||
# WARNING: This program as such is intended to be used by professional
|
||||
# programmers who take the whole responsability of assessing all potential
|
||||
# consequences resulting from its eventual inadequacies and bugs
|
||||
# End users who are looking for a ready-to-use solution with commercial
|
||||
# garantees and support are strongly adviced to contract a Free Software
|
||||
# Service Company
|
||||
#
|
||||
# This program is Free Software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import re
|
||||
import time
|
||||
|
||||
from report import report_sxw
|
||||
from tools import mod10r
|
||||
import logging
|
||||
log = logging.getLogger('init')
|
||||
|
||||
try:
|
||||
this_module = 'l10n_ch'
|
||||
from report.render.rml2pdf import customfonts
|
||||
from addons import get_module_resource
|
||||
ocrb_fname = get_module_resource(this_module, 'report', 'ocrbb.ttf')
|
||||
if not ocrb_fname:
|
||||
raise OSError("Cannot find ocrbb.ttf in %s resources", this_module)
|
||||
customfonts.CustomTTFonts.append( ('ocrb', 'ocrb', ocrb_fname , None ) )
|
||||
log.debug("module: %s registered custom OCR-B font at %s", this_module, ocrb_fname)
|
||||
except ImportError:
|
||||
log.debug("Import error", exc_info=True)
|
||||
pass
|
||||
except Exception, e:
|
||||
log.exception("Cannot register custom font")
|
||||
|
||||
class account_invoice_bvr(report_sxw.rml_parse):
|
||||
"""Report class that Allows to print BVR payement vector"""
|
||||
def __init__(self, cr, uid, name, context):
|
||||
super(account_invoice_bvr, self).__init__(cr, uid, name, context)
|
||||
self.localcontext.update({
|
||||
'time': time,
|
||||
'user':self.pool.get("res.users").browse(cr,uid,uid),
|
||||
'mod10r': mod10r,
|
||||
'_space': self._space,
|
||||
'_get_ref': self._get_ref,
|
||||
'comma_me': self.comma_me,
|
||||
'format_date': self._get_and_change_date_format_for_swiss,
|
||||
})
|
||||
def _get_and_change_date_format_for_swiss (self,date_to_format):
|
||||
date_formatted=''
|
||||
print date_to_format
|
||||
if date_to_format:
|
||||
date_formatted = time.strptime(date_to_format,'%Y-%m-%d').strftime('%d.%m.%Y')
|
||||
return date_formatted
|
||||
|
||||
def comma_me(self,amount):
|
||||
if type(amount) is float :
|
||||
amount = str('%.2f'%amount)
|
||||
else :
|
||||
amount = str(amount)
|
||||
orig = amount
|
||||
new = re.sub("^(-?\d+)(\d{3})", "\g<1>'\g<2>", amount)
|
||||
if orig == new:
|
||||
return new
|
||||
else:
|
||||
return self.comma_me(new)
|
||||
|
||||
def _space(self,nbr, nbrspc=5):
|
||||
res = ''
|
||||
for i in range(len(nbr)):
|
||||
res = res + nbr[i]
|
||||
if not (i-1) % nbrspc:
|
||||
res = res + ' '
|
||||
return res
|
||||
|
||||
def _get_ref(self, o):
|
||||
res = ''
|
||||
if o.partner_bank_id.bvr_adherent_num:
|
||||
res = o.partner_bank_id.bvr_adherent_num
|
||||
invoice_number = ''
|
||||
if o.number:
|
||||
invoice_number = re.sub('[^0-9]', '0', o.number)
|
||||
return mod10r(res + invoice_number.rjust(26-len(res), '0'))
|
||||
|
||||
report_sxw.report_sxw(
|
||||
'report.l10n_ch.bvr',
|
||||
'account.invoice',
|
||||
'addons/l10n_ch/report/bvr_report.rml',
|
||||
parser=account_invoice_bvr,
|
||||
header=False)
|
||||
|
||||
report_sxw.report_sxw(
|
||||
'report.l10n_ch.invoice.bvr',
|
||||
'account.invoice',
|
||||
'addons/l10n_ch/report/bvr_invoice_report.rml',
|
||||
parser=account_invoice_bvr,
|
||||
header=False)
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
@ -1,166 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<document filename="test.pdf">
|
||||
<docinit>
|
||||
</docinit>
|
||||
<template pageSize="(210.0mm,297.0mm)" title="BVR" author="OpenERP S.A. (sales@openerp.com)" allowSplitting="20">
|
||||
<pageTemplate id="first">
|
||||
<pageGraphics>
|
||||
<!-- You Logo - Change X,Y,Width and Height -->
|
||||
<image x="1.3cm" y="27.6cm" height="40.0" >[[company.logo or removeParentNode('image')]]</image>
|
||||
<setFont name="Helvetica" size="8"/>
|
||||
<fill color="black"/>
|
||||
<stroke color="black"/>
|
||||
<lines>1.3cm 27.7cm 20cm 27.7cm</lines>
|
||||
|
||||
<drawRightString x="20cm" y="27.8cm">[[ company.rml_header1 ]] </drawRightString>
|
||||
<drawString x="1.3cm" y="27.2cm">[[ company.partner_id.name ]]</drawString>
|
||||
<drawString x="1.3cm" y="26.8cm">[[ company.partner_id.address and company.partner_id.address[0].street or '' ]]</drawString>
|
||||
<drawString x="1.3cm" y="26.4cm">[[ company.partner_id.address and company.partner_id.address[0].zip or '' ]] [[ company.partner_id.address and company.partner_id.address[0].city or '' ]] - [[ company.partner_id.address and company.partner_id.address[0].country_id and company.partner_id.address[0].country_id.name or '']]</drawString>
|
||||
<drawString x="1.3cm" y="26.0cm">Phone:</drawString>
|
||||
<drawRightString x="7cm" y="26.0cm">[[ company.partner_id.address and company.partner_id.address[0].phone or '' ]]</drawRightString>
|
||||
<drawString x="1.3cm" y="25.6cm">Mail:</drawString>
|
||||
<drawRightString x="7cm" y="25.6cm">[[ company.partner_id.address and company.partner_id.address[0].email or '' ]]</drawRightString>
|
||||
<lines>1.3cm 25.5cm 7cm 25.5cm</lines>
|
||||
</pageGraphics>
|
||||
|
||||
<frame id="first" x1="24.0" y1="111.5mm" width="190mm" height="142mm" last="1"/>
|
||||
<frame id="Frame1"
|
||||
expr="{'height':str(111+(company.bvr_delta_vert or 0.0))+'mm', 'x1': str((company.bvr_delta_horz or 0.0))+'mm'}"
|
||||
x1="0mm"
|
||||
y1="-5"
|
||||
width="210mm"
|
||||
height="111mm"/>
|
||||
</pageTemplate>
|
||||
</template>
|
||||
|
||||
|
||||
<stylesheet>
|
||||
<blockTableStyle id="Standard_Outline">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table1">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table2">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<initialize>
|
||||
<paraStyle name="all" alignment="justify"/>
|
||||
</initialize>
|
||||
<paraStyle name="P1" fontName="Times-Roman" fontSize="11.0" leading="14"/>
|
||||
<paraStyle name="P2" fontName="Times-Roman" fontSize="11.0" leading="14" alignment="LEFT"/>
|
||||
<paraStyle name="PBVR" fontName="ocrb" fontSize="11.0" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P4" fontName="Times-Roman" fontSize="11.0" leading="14" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P5" fontName="Times-Roman" fontSize="11.0" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P6" fontName="ocrb" fontSize="11.0" leading="14" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P7" fontName="Courier-Bold" fontSize="12.0" leading="15" alignment="LEFT"/>
|
||||
<paraStyle name="P8" fontName="Times-Roman" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P9" fontName="Times-Roman" fontSize="12.0" leading="15" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P10" fontName="Times-Roman" fontSize="11.0" leading="14"/>
|
||||
<paraStyle name="P11" fontName="Times-Roman" fontSize="11.0" leading="14" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Standard" fontName="Times-Roman"/>
|
||||
<paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="List" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Table Contents" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Table Heading" fontName="Times-Roman" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Caption" fontName="Times-Roman" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Frame contents" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Index" fontName="Times-Roman"/>
|
||||
</stylesheet>
|
||||
<story>
|
||||
<para style="P8">[[ repeatIn(objects,'o') ]]<font face="Times-Roman">[[ setLang(o.partner_id.lang) ]]</font></para>
|
||||
<blockTable colWidths="264.0,264.0" style="Table2">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P10">[[ o.partner_id.name ]] [[ o.partner_id.title or '' ]]</para>
|
||||
<para style="P10">[[ o.address_invoice_id.title or '' ]] [[ o.address_invoice_id.name ]]</para>
|
||||
<para style="P10">[[ o.address_invoice_id.street ]]</para>
|
||||
<para style="P10">[[ o.address_invoice_id.street2 or '' ]]</para>
|
||||
<para style="P10">[[ o.address_invoice_id.zip or '' ]] [[ o.address_invoice_id.city or '' ]]</para>
|
||||
<para style="P10">[[ o.address_invoice_id.state_id and o.address_invoice_id.state_id.name or '' ]]</para>
|
||||
<para style="P10">[[ o.address_invoice_id.country_id and o.address_invoice_id.country_id.name or '' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="P11">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P11"><font face="Helvetica-Bold">Subject: </font>Invoice - [[ o.number ]]</para>
|
||||
<para style="P11">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P11">Dear customer,</para>
|
||||
<para style="P11">Here is the BVR to allow you to pay the invoice ' <font face="Times-Roman">[[ o.name ]]</font>', reference:<font face="Times-Roman"> [[ o.number ]].</font></para>
|
||||
<para style="P11">Thanks,</para>
|
||||
<para style="P11">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P11">[[ user.signature ]]</para>
|
||||
<currentFrame name="Frame1"/>
|
||||
<!--
|
||||
Width: 2.3inch, 5.9inch
|
||||
Height: 4*1/6 inch
|
||||
-->
|
||||
<illustration width="210mm" height="106mm">
|
||||
<setFont name="Helvetica" size="11"/>
|
||||
<drawString x="2mm" y="93mm">[[ o.partner_bank_id and o.partner_bank_id.printBank and o.partner_bank_id.bank and o.partner_bank_id.bank.name or '' ]]</drawString>
|
||||
<drawString x="2mm" y="88mm">[[ o.partner_bank_id and o.partner_bank_id.printBank and o.partner_bank_id.bank and o.partner_bank_id.bank.zip or '']] [[ o.partner_bank_id and o.partner_bank_id.printBank and o.partner_bank_id.bank and o.partner_bank_id.bank.city or '']]</drawString>
|
||||
|
||||
<drawString x="62mm" y="93mm">[[ o.partner_bank_id and o.partner_bank_id.printBank and o.partner_bank_id.bank and o.partner_bank_id.bank.name or '' ]]</drawString>
|
||||
<drawString x="62mm" y="88mm">[[ o.partner_bank_id and o.partner_bank_id.printBank and o.partner_bank_id.bank and o.partner_bank_id.bank.zip or '']] [[ o.partner_bank_id and o.partner_bank_id.printBank and o.partner_bank_id.bank and o.partner_bank_id.bank.city or '']]</drawString>
|
||||
|
||||
<drawString x="2mm" y="78mm"> [[ user.company_id.partner_id.name ]]</drawString>
|
||||
<drawString x="2mm" y="73mm"> [[ user.company_id.partner_id.address[0].street ]]</drawString>
|
||||
<drawString x="2mm" y="68mm"> [[ (user.company_id.partner_id.address[0].street2 or '')]]</drawString>
|
||||
<drawString x="2mm" y="63mm"> [[ user.company_id.partner_id.address[0].zip ]] [[ user.company_id.partner_id.address[0].city ]]</drawString>
|
||||
|
||||
<drawString x="62mm" y="78mm">[[ user.company_id.partner_id.name ]]</drawString>
|
||||
<drawString x="62mm" y="73mm">[[ user.company_id.partner_id.address[0].street ]]</drawString>
|
||||
<drawString x="62mm" y="68mm">[[ (user.company_id.partner_id.address[0].street2 or '')]]</drawString>
|
||||
<drawString x="62mm" y="63mm">[[ user.company_id.partner_id.address[0].zip ]] [[ user.company_id.partner_id.address[0].city ]]</drawString>
|
||||
|
||||
<setFont name="ocrb" size="9"/>
|
||||
|
||||
<drawString x="2mm" y="35mm"> [[ o.partner_id.name ]]</drawString>
|
||||
<drawString x="2mm" y="30mm"> [[ o.address_invoice_id.street ]]</drawString>
|
||||
<drawString x="2mm" y="25mm"> [[ (o.address_invoice_id.street2 or '')]]</drawString>
|
||||
<drawString x="2mm" y="20mm"> [[ o.address_invoice_id.zip ]] [[ o.address_invoice_id.city ]]</drawString>
|
||||
|
||||
<drawString x="2mm" y="40mm"> [[ _get_ref(o) ]]</drawString>
|
||||
|
||||
<drawString x="126mm" y="50mm">[[ o.partner_id.name ]]</drawString>
|
||||
<drawString x="126mm" y="45mm">[[ o.address_invoice_id.street ]]</drawString>
|
||||
<drawString x="126mm" y="40mm">[[ (o.address_invoice_id.street2 or '')]]</drawString>
|
||||
<drawString x="126mm" y="35mm">[[ o.address_invoice_id.zip ]] [[ o.address_invoice_id.city ]]</drawString>
|
||||
|
||||
|
||||
<setFont name="ocrb" size="11"/>
|
||||
<drawString x="124mm" y="67mm">[[ _space(_get_ref(o)) ]]</drawString>
|
||||
|
||||
<setFont name="ocrb" size="12"/>
|
||||
<drawRightString x="52 mm" y="59.3mm">[[ o.partner_bank_id and o.partner_bank_id.printAccount and o.partner_bank_id.bvr_number or '' ]]</drawRightString>
|
||||
<drawRightString x="112mm" y="59.3mm">[[ o.partner_bank_id and o.partner_bank_id.printAccount and o.partner_bank_id.bvr_number or '' ]]</drawRightString>
|
||||
<drawRightString x="42mm" y="50mm">[[ _space(('%.2f' % o.amount_total)[:-3], 1) + ' ' ]]</drawRightString>
|
||||
<drawRightString x="104mm" y="50mm">[[ _space(('%.2f' % o.amount_total)[:-3], 1) + ' ' ]]</drawRightString>
|
||||
<drawRightString x="114 mm" y="59.3mm">[[ o.partner_bank_id and o.partner_bank_id.printAccount and o.partner_bank_id.bvr_number or '' ]]</drawRightString>
|
||||
<drawRightString x="58mm" y="50mm">[[ _space(('%.2f' % o.amount_total)[-2:], 1) + ' ' ]]</drawRightString>
|
||||
<drawRightString x="119mm" y="50mm">[[ _space(('%.2f' % o.amount_total)[-2:], 1) + ' ' ]]</drawRightString>
|
||||
|
||||
|
||||
<!--
|
||||
Exact value: y=17.6mm
|
||||
-->
|
||||
|
||||
<setFont name="ocrb" size="11.5"/>
|
||||
<drawRightString x="195mm" y="15mm">[[mod10r('01'+str('%.2f' % o.amount_total).replace('.','').rjust(10,'0'))]]>[[ _get_ref(o) ]]+ [[o.partner_bank_id.bvr_number.split('-')[0]+(str(o.partner_bank_id.bvr_number.split('-')[1])).rjust(6,'0')+o.partner_bank_id.bvr_number.split('-')[2] ]]></drawRightString>
|
||||
</illustration>
|
||||
</story>
|
||||
</document>
|
|
@ -1,610 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xsl:stylesheet
|
||||
version="1.0"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:fo="http://www.w3.org/1999/XSL/Format"
|
||||
xmlns:office="http://openoffice.org/2000/office"
|
||||
xmlns:style="http://openoffice.org/2000/style"
|
||||
xmlns:text="http://openoffice.org/2000/text"
|
||||
xmlns:table="http://openoffice.org/2000/table"
|
||||
xmlns:draw="http://openoffice.org/2000/drawing"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:number="http://openoffice.org/2000/datastyle"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns:chart="http://openoffice.org/2000/chart"
|
||||
xmlns:dr3d="http://openoffice.org/2000/dr3d"
|
||||
xmlns:math="http://www.w3.org/1998/Math/MathML"
|
||||
xmlns:form="http://openoffice.org/2000/form"
|
||||
xmlns:script="http://openoffice.org/2000/script"
|
||||
office:class="text" office:version="1.0"
|
||||
exclude-result-prefixes = "xsl fo office style text table draw xlink number svg chart dr3d math form script">
|
||||
|
||||
<!--TODO's: indent, picture cache (trml2pdf) -->
|
||||
|
||||
<xsl:output method="xml" indent="yes" />
|
||||
<xsl:strip-space elements="*"/>
|
||||
|
||||
<xsl:key name="text_style" match="style:style[@style:family='text']" use="@style:name" />
|
||||
<xsl:key name="page_break_before" match="style:style[@style:family='paragraph' and ./style:properties/@fo:break-before='page']" use="@style:name" />
|
||||
<xsl:key name="page_break_after" match="style:style[@style:family='paragraph' and ./style:properties/@fo:break-after='page']" use="@style:name" />
|
||||
<xsl:key name="table_column_style" match="style:style[@style:family='table-column']" use="@style:name" />
|
||||
<xsl:key name="table_cell_style" match="style:style[@style:family='table-cell']" use="@style:name" />
|
||||
<xsl:key name="paragraph_style" match="style:style[@style:family='paragraph']" use="@style:name" />
|
||||
|
||||
<xsl:template match="office:document-content">
|
||||
<document filename="test.pdf">
|
||||
<xsl:apply-templates select="office:automatic-styles" />
|
||||
<xsl:apply-templates select="office:body" />
|
||||
</document>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="page_size">
|
||||
<xsl:attribute name="pageSize">
|
||||
<xsl:text>(</xsl:text>
|
||||
<xsl:value-of select="//transferredfromstylesxml/style:page-master[1]/style:properties/@fo:page-width" />
|
||||
<xsl:text>,</xsl:text>
|
||||
<xsl:value-of select="//transferredfromstylesxml/style:page-master[1]/style:properties/@fo:page-height" />
|
||||
<xsl:text>)</xsl:text>
|
||||
</xsl:attribute>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="margin_sizes">
|
||||
<xsl:variable name="margin_left" select="//transferredfromstylesxml/style:page-master[1]/style:properties/@fo:margin-left" />
|
||||
<xsl:variable name="margin_right" select="//transferredfromstylesxml/style:page-master[1]/style:properties/@fo:margin-right" />
|
||||
<xsl:variable name="margin_top" select="//transferredfromstylesxml/style:page-master[1]/style:properties/@fo:margin-top" />
|
||||
<xsl:variable name="margin_bottom" select="//transferredfromstylesxml/style:page-master[1]/style:properties/@fo:margin-bottom" />
|
||||
<xsl:variable name="page_width" select="//transferredfromstylesxml/style:page-master[1]/style:properties/@fo:page-width" />
|
||||
<xsl:variable name="page_height" select="//transferredfromstylesxml/style:page-master[1]/style:properties/@fo:page-height" />
|
||||
<xsl:attribute name="x1"><xsl:value-of select="$margin_left" /></xsl:attribute>
|
||||
<xsl:attribute name="y1"><xsl:value-of select="$margin_bottom" /></xsl:attribute>
|
||||
<xsl:attribute name="width"><xsl:value-of select="$page_width - $margin_left - $margin_right"/></xsl:attribute>
|
||||
<xsl:attribute name="height"><xsl:value-of select="$page_height - $margin_bottom - $margin_top"/></xsl:attribute>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="text_width">
|
||||
<!-- You need this for the workaround to make primitive outlines-->
|
||||
<xsl:variable name="margin_left" select="//transferredfromstylesxml/style:page-master[1]/style:properties/@fo:margin-left" />
|
||||
<xsl:variable name="margin_right" select="//transferredfromstylesxml/style:page-master[1]/style:properties/@fo:margin-right" />
|
||||
<xsl:variable name="page_width" select="//transferredfromstylesxml/style:page-master[1]/style:properties/@fo:page-width" />
|
||||
<xsl:value-of select="$page_width - $margin_left - $margin_right - 18"/>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
|
||||
<xsl:template match="office:automatic-styles">
|
||||
<!--<template pageSize="(21cm, 29.7cm)" leftMargin="1.0cm" rightMargin="2.0cm" topMargin="1.0cm" bottomMargin="1.0cm" title="Test" author="Martin Simon" allowSplitting="20">-->
|
||||
<template pageSize="(21cm, 29.7cm)" title="Test" author="Martin Simon" allowSplitting="20">
|
||||
<xsl:call-template name="page_size" />
|
||||
<pageTemplate id="first">
|
||||
<frame id="first" x1="2cm" y1="2cm" width="17cm" height="26cm">
|
||||
<xsl:call-template name="margin_sizes" />
|
||||
</frame>
|
||||
</pageTemplate>
|
||||
</template>
|
||||
<stylesheet>
|
||||
<!--A table style to simulate primitive outlines -till the <addOutline> tag is implemented in trml2pdf -->
|
||||
<blockTableStyle id="Standard_Outline">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<!--use two standard table grid styles like PyOpenOffice "Old Way": with and without a grid-->
|
||||
<!--TODO insert table cell colors here, not within the <td> tag - otherwise
|
||||
it will not work with flowables as cell content-->
|
||||
<xsl:call-template name="make_blocktablestyle" />
|
||||
<initialize>
|
||||
<paraStyle name="all" alignment="justify" />
|
||||
</initialize>
|
||||
<xsl:apply-templates select="style:style" />
|
||||
</stylesheet>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="make_blocktablestyle">
|
||||
<xsl:for-each select="//table:table">
|
||||
<xsl:variable name="test">
|
||||
<xsl:value-of select="./@table:name" />
|
||||
</xsl:variable>
|
||||
<xsl:if test="not(boolean(count(preceding-sibling::table:table[@table:name=$test])))">
|
||||
<!--Test if this is the first table with this style, nested tables not counted-->
|
||||
<blockTableStyle id="{@table:name}">
|
||||
<xsl:if test=".//draw:image">
|
||||
<blockTopPadding value="0"/>
|
||||
<blockBottomPadding value="0"/>
|
||||
</xsl:if>
|
||||
<blockAlignment value="LEFT" />
|
||||
<blockValign value="TOP" />
|
||||
<xsl:call-template name="make_tablegrid" />
|
||||
<xsl:call-template name="make_tablebackground" />
|
||||
</blockTableStyle>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="make_tablegrid">
|
||||
<xsl:variable name="test_grid">
|
||||
<xsl:call-template name="test_grid" />
|
||||
</xsl:variable>
|
||||
<xsl:if test="contains($test_grid,'has_grid')">
|
||||
<lineStyle kind="GRID" colorName="black" />
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- Was needed to simulate bulleted lists:
|
||||
<xsl:template match="text:ordered-list|text:unordered-list">
|
||||
<xsl:variable name = "text_width">
|
||||
<xsl:call-template name="text_width" />
|
||||
</xsl:variable>
|
||||
<blockTable style="Standard_Outline" colWidths="18,{$text_width}">
|
||||
<xsl:apply-templates match="text:list-item" />
|
||||
</blockTable>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="text:list-item">
|
||||
<tr>
|
||||
<td><para><font face="Helvetica-Bold" size="10">*</font></para></td>
|
||||
<td>
|
||||
<xsl:apply-templates />
|
||||
</td>
|
||||
</tr>
|
||||
</xsl:template>
|
||||
|
||||
-->
|
||||
|
||||
|
||||
<xsl:template match="office:body">
|
||||
<story>
|
||||
<xsl:apply-templates />
|
||||
</story>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="table:table">
|
||||
<blockTable>
|
||||
<xsl:attribute name="colWidths">
|
||||
<xsl:call-template name="make_columns" />
|
||||
</xsl:attribute>
|
||||
<xsl:call-template name="make_tableheaders" />
|
||||
<xsl:attribute name="style">
|
||||
<xsl:value-of select="@table:name" />
|
||||
</xsl:attribute>
|
||||
<xsl:apply-templates />
|
||||
</blockTable>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="make_tableheaders">
|
||||
<xsl:if test="boolean(count(table:table-header-rows))">
|
||||
<xsl:attribute name="repeatRows">1</xsl:attribute>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="make_tablebackground">
|
||||
<xsl:for-each select=".//table:table-row">
|
||||
<!--Be careful when there are table:table-header-rows as
|
||||
parent node of table:table-row -->
|
||||
<xsl:variable name="row" select="position() - 1" />
|
||||
<xsl:for-each select="./table:table-cell">
|
||||
<xsl:variable name="col" select="position() - 1" />
|
||||
<xsl:variable name="background">
|
||||
<xsl:value-of select="key('table_cell_style',@table:style-name)/style:properties/@fo:background-color" />
|
||||
</xsl:variable>
|
||||
<xsl:if test="not($background='') and boolean(key('table_cell_style',@table:style-name)/style:properties/@fo:background-color) and starts-with($background,'#')">
|
||||
<!--only RGB hexcolors are accepted -->
|
||||
<blockBackground colorName="{$background}" start="{$col},{$row}" stop="{$col},{$row}" />
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
</xsl:for-each>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="test_grid">
|
||||
<!--very primitive: if at last one cell has a border,
|
||||
the whole table style is set to GRID.-->
|
||||
<xsl:for-each select=".//table:table-cell">
|
||||
<xsl:for-each select="key('table_cell_style',@table:style-name)/style:properties" >
|
||||
<!--Test all table cell styles if there is at least one border line -->
|
||||
<xsl:variable name="border">
|
||||
<xsl:value-of select="@fo:border" />
|
||||
</xsl:variable>
|
||||
<xsl:if test="not($border='none') and not($border='') and boolean(@fo:border)">
|
||||
<xsl:text>has_grid</xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
</xsl:for-each>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="make_columns">
|
||||
<xsl:variable name="columns" >
|
||||
<xsl:for-each select="table:table-column">
|
||||
<xsl:value-of select="key('table_column_style',@table:style-name)/style:properties/@style:column-width" />
|
||||
<xsl:text>,</xsl:text>
|
||||
</xsl:for-each>
|
||||
</xsl:variable>
|
||||
<xsl:value-of select="substring($columns,1,string-length($columns) - 1)" />
|
||||
<!--strip the last comma-->
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="table:table-row">
|
||||
<tr>
|
||||
<xsl:apply-templates />
|
||||
</tr>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="table:table-cell">
|
||||
<td>
|
||||
<xsl:apply-templates />
|
||||
</td>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="text:section">
|
||||
<section>
|
||||
<xsl:apply-templates />
|
||||
</section>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="text:span">
|
||||
<font>
|
||||
<xsl:call-template name="make_fontnames_span" />
|
||||
<xsl:call-template name="make_fontsize_span" />
|
||||
<xsl:apply-templates />
|
||||
</font>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="make_fontsize_span">
|
||||
<xsl:variable name ="fontsize">
|
||||
<xsl:value-of select="key('text_style',@text:style-name)/style:properties/@fo:font-size" />
|
||||
</xsl:variable>
|
||||
<xsl:if test="not($fontsize='') and boolean(key('text_style',@text:style-name)/style:properties/@fo:font-size)" >
|
||||
<xsl:attribute name="size">
|
||||
<xsl:value-of select="$fontsize" />
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="make_fontnames_span">
|
||||
<xsl:attribute name="face">
|
||||
<xsl:call-template name="make_fontnames">
|
||||
<xsl:with-param name="fontName" select="key('text_style',@text:style-name)/style:properties/@style:font-name" />
|
||||
<xsl:with-param name="fontWeight" select="key('text_style',@text:style-name)/style:properties/@fo:font-weight" />
|
||||
<xsl:with-param name="fontStyle" select="key('text_style',@text:style-name)/style:properties/@fo:font-style" />
|
||||
</xsl:call-template>
|
||||
</xsl:attribute>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="make_image">
|
||||
<illustration height="{.//draw:image/@svg:height}" width="{.//draw:image/@svg:width}">
|
||||
<image x="0" y="0" file="{substring-after(.//draw:image/@xlink:href,'#Pictures/')}" height="{.//draw:image/@svg:height}" width="{.//draw:image/@svg:width}" />
|
||||
</illustration>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="empty_paragraph">
|
||||
<xsl:if test="not(boolean(count(descendant::node())))">
|
||||
<xsl:call-template name="distance_point">
|
||||
<xsl:with-param name="background" select="key('paragraph_style',@text:style-name)/style:properties/@fo:background-color" />
|
||||
</xsl:call-template>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="distance_point">
|
||||
<xsl:param name="background" />
|
||||
<xsl:param name="tab_stop"></xsl:param>
|
||||
<xsl:variable name="local_back">
|
||||
<xsl:choose>
|
||||
<xsl:when test="not(boolean($background)) or not(contains($background,'#'))">
|
||||
<!-- Do not accept OO colors like "transparent", only hex-colors -->
|
||||
<xsl:text>white</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="$background" />
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<font color="{$local_back}">
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:if test="boolean($tab_stop)">
|
||||
<!-- simulate a tabstop with white/background-color points -->
|
||||
<xsl:text>.........</xsl:text>
|
||||
</xsl:if>
|
||||
</font>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="text:ordered-list">
|
||||
<xsl:apply-templates />
|
||||
<para><seqreset id="ordered_list" /></para>
|
||||
<!-- Reset the counter. seqreset is not a trml2pdf tag, but a Platypus Intra Paragraph Markup,
|
||||
so it needs a dummy paragraph to enclose it -->
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="make_listitem">
|
||||
<xsl:if test="(name(..)='text:list-item')">
|
||||
<xsl:attribute name="leftIndent">15</xsl:attribute>
|
||||
<xsl:attribute name="bulletIndent">0</xsl:attribute>
|
||||
<xsl:choose>
|
||||
<xsl:when test="(name(../..)='text:unordered-list')">
|
||||
<xsl:variable name="fontsize">
|
||||
<xsl:value-of select="number(key('paragraph_style',@text:style-name)/style:properties/@fo:font-size)" />
|
||||
</xsl:variable>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$fontsize='NaN'">
|
||||
<!-- you should exclude non-numerical values for bulletFontSize. <== Sometimes the preprocessing went wrong.-->
|
||||
<!--use a default bullet font size-->
|
||||
<xsl:attribute name="bulletFontSize">6</xsl:attribute>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:attribute name="bulletFontSize"><xsl:value-of select="floor(($fontsize div 2) + 1)" /></xsl:attribute>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:attribute name="bulletFontName">ZapfDingbats</xsl:attribute>
|
||||
<xsl:attribute name="bulletText">l</xsl:attribute>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<!-- Generate the numbers for an ordered list -->
|
||||
<xsl:variable name="size">
|
||||
<xsl:value-of select="key('paragraph_style',@text:style-name)/style:properties/@fo:font-size" />
|
||||
</xsl:variable>
|
||||
<!-- For ordered lists we use the bullet tag from Platypus Intra Paragraph Markup -->
|
||||
<bullet>
|
||||
<xsl:if test="not($size='') and boolean(key('paragraph_style',@text:style-name)/style:properties/@fo:font-size)">
|
||||
<xsl:attribute name="size">
|
||||
<!-- adapt the fontsize to the fontsize of the current paragraph -->
|
||||
<xsl:value-of select="$size" />
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
<seq id="ordered_list" />.</bullet>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="text:p|text:h">
|
||||
<xsl:if test="boolean(key('page_break_before',@text:style-name))" >
|
||||
<pageBreak />
|
||||
</xsl:if>
|
||||
<xsl:choose>
|
||||
<xsl:when test="boolean(.//draw:image)">
|
||||
<xsl:call-template name="make_image" />
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<para>
|
||||
<xsl:attribute name="style">
|
||||
<xsl:value-of select="@text:style-name" />
|
||||
</xsl:attribute>
|
||||
<xsl:call-template name="make_listitem" />
|
||||
<xsl:apply-templates />
|
||||
<xsl:call-template name="empty_paragraph" />
|
||||
</para>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:if test="boolean(key('page_break_after',@text:style-name))" >
|
||||
<pageBreak />
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="text:p/text:tab-stop">
|
||||
<!-- simulate a tabstop -->
|
||||
<xsl:call-template name="distance_point">
|
||||
<xsl:with-param name="background" select="key('paragraph_style',@text:style-name)/style:properties/@fo:background-color" />
|
||||
<xsl:with-param name="tab_stop">yes</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
<!-- experimental - switched off
|
||||
<xsl:template match="text:h">
|
||||
<para>
|
||||
<xsl:attribute name="style">
|
||||
<xsl:value-of select="@text:style-name" />
|
||||
</xsl:attribute>
|
||||
<xsl:call-template name="make_number" />
|
||||
<xsl:apply-templates />
|
||||
<xsl:call-template name="empty_paragraph" />
|
||||
</para>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="make_number">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@text:level='1'">
|
||||
<xsl:number format="1. " />
|
||||
</xsl:when>
|
||||
<xsl:when test="@text:level='2'">
|
||||
<xsl:number count="text:h[@text:level='1']|text:h[text:level='2']" level="any" format="1.1." />
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
-->
|
||||
|
||||
<xsl:template match="style:style[@style:family='paragraph']">
|
||||
<paraStyle>
|
||||
<xsl:attribute name="name">
|
||||
<xsl:value-of select="@style:name" />
|
||||
</xsl:attribute>
|
||||
<xsl:call-template name="make_indent_paragraph" />
|
||||
<xsl:call-template name="make_fontnames_paragraph" />
|
||||
<xsl:call-template name="make_fontsize" />
|
||||
<!--<xsl:call-template name="make_parent" /> not necessary -
|
||||
parent styles processed by PyOpenOffice -->
|
||||
<xsl:call-template name="make_alignment" />
|
||||
<xsl:call-template name="make_background" />
|
||||
<xsl:call-template name="make_space_beforeafter" />
|
||||
</paraStyle>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="make_indent_paragraph">
|
||||
<xsl:variable name="right_indent"><xsl:value-of select="style:properties/@fo:margin-right" /></xsl:variable>
|
||||
<xsl:variable name="left_indent"><xsl:value-of select="style:properties/@fo:margin-left" /></xsl:variable>
|
||||
<xsl:if test="not($right_indent='') and boolean(style:properties/@fo:margin-right)">
|
||||
<xsl:attribute name="rightIndent">
|
||||
<xsl:value-of select="$right_indent" />
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:if test="not($left_indent='') and boolean(style:properties/@fo:margin-left)">
|
||||
<xsl:attribute name="leftIndent">
|
||||
<xsl:value-of select="$left_indent" />
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="make_background">
|
||||
<xsl:variable name="background">
|
||||
<xsl:value-of select="style:properties/@fo:background-color" />
|
||||
</xsl:variable>
|
||||
<xsl:if test="not($background='') and boolean(style:properties/@fo:background-color) and starts-with($background,'#')" >
|
||||
<xsl:attribute name="backColor">
|
||||
<xsl:value-of select="$background" />
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="make_space_beforeafter">
|
||||
<xsl:variable name="before">
|
||||
<xsl:value-of select="style:properties/@fo:margin-top" />
|
||||
</xsl:variable>
|
||||
<xsl:variable name="after">
|
||||
<xsl:value-of select="style:properties/@fo:margin-bottom" />
|
||||
</xsl:variable>
|
||||
<xsl:if test="not($before='') and boolean(style:properties/@fo:margin-top)" >
|
||||
<xsl:attribute name="spaceBefore">
|
||||
<xsl:value-of select="$before" />
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:if test="not($after='') and boolean(style:properties/@fo:margin-bottom)" >
|
||||
<xsl:attribute name="spaceAfter">
|
||||
<xsl:value-of select="$after" />
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="make_fontsize">
|
||||
<xsl:variable name="fontSize">
|
||||
<xsl:value-of select="style:properties/@fo:font-size" />
|
||||
</xsl:variable>
|
||||
<xsl:if test="not($fontSize='') and boolean(style:properties/@fo:font-size)">
|
||||
<xsl:attribute name="fontSize">
|
||||
<xsl:value-of select="$fontSize" />
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="leading">
|
||||
<xsl:value-of select="$fontSize + floor($fontSize div 5) + 1" />
|
||||
<!--use a standard leading related to the font size -->
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<!--this template is not needed anymore for "normalized" sxw files -->
|
||||
<xsl:template name="make_parent">
|
||||
<xsl:variable name="parent">
|
||||
<xsl:value-of select="@style:parent-style-name" />
|
||||
</xsl:variable>
|
||||
<xsl:if test="not($parent='') and boolean(@style:parent-style-name)">
|
||||
<xsl:attribute name="parent">
|
||||
<xsl:value-of select="$parent" />
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="make_alignment">
|
||||
<xsl:variable name="alignment">
|
||||
<xsl:value-of select="style:properties/@fo:text-align" />
|
||||
</xsl:variable>
|
||||
<xsl:if test="not($alignment='') and boolean(style:properties/@fo:text-align)">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$alignment='start'">
|
||||
<xsl:attribute name="alignment">LEFT</xsl:attribute>
|
||||
</xsl:when>
|
||||
<xsl:when test="$alignment='center'">
|
||||
<xsl:attribute name="alignment">CENTER</xsl:attribute>
|
||||
</xsl:when>
|
||||
<xsl:when test="$alignment='end'">
|
||||
<xsl:attribute name="alignment">RIGHT</xsl:attribute>
|
||||
</xsl:when>
|
||||
<xsl:when test="$alignment='justify'">
|
||||
<xsl:attribute name="alignment">JUSTIFY</xsl:attribute>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="make_fontnames_paragraph">
|
||||
<xsl:attribute name="fontName">
|
||||
<xsl:call-template name="make_fontnames">
|
||||
<xsl:with-param name="fontName" select="style:properties/@style:font-name" />
|
||||
<xsl:with-param name="fontWeight" select="style:properties/@fo:font-weight" />
|
||||
<xsl:with-param name="fontStyle" select="style:properties/@fo:font-style" />
|
||||
</xsl:call-template>
|
||||
</xsl:attribute>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="make_fontnames">
|
||||
<!--much too verbose, needs improvement-->
|
||||
<xsl:param name="fontName" />
|
||||
<xsl:param name="fontWeight" />
|
||||
<xsl:param name="fontStyle" />
|
||||
<xsl:choose>
|
||||
<xsl:when test="not($fontName='') and boolean($fontName)">
|
||||
<xsl:choose>
|
||||
<xsl:when test="contains($fontName,'Courier')">
|
||||
<xsl:choose>
|
||||
<xsl:when test="($fontWeight='bold') and ($fontStyle='italic')">
|
||||
<xsl:text>Courier-BoldOblique</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:when test="($fontWeight='bold') and not ($fontStyle='italic')">
|
||||
<xsl:text>Courier-Bold</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:when test="not($fontWeight='bold') and ($fontStyle='italic')">
|
||||
<xsl:text>Courier-Oblique</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:text>Courier</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:when>
|
||||
<xsl:when test="contains($fontName,'Helvetica') or contains($fontName,'Arial') or contains($fontName,'Sans')">
|
||||
<xsl:choose>
|
||||
<xsl:when test="($fontWeight='bold') and ($fontStyle='italic')">
|
||||
<xsl:text>Helvetica-BoldOblique</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:when test="($fontWeight='bold') and not ($fontStyle='italic')">
|
||||
<xsl:text>Helvetica-Bold</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:when test="not($fontWeight='bold') and ($fontStyle='italic')">
|
||||
<xsl:text>Helvetica-Oblique</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:text>Helvetica</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:choose>
|
||||
<xsl:when test="($fontWeight='bold') and ($fontStyle='italic')">
|
||||
<xsl:text>Helvetica-BoldOblique</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:when test="($fontWeight='bold') and not ($fontStyle='italic')">
|
||||
<xsl:text>Helvetica-Bold</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:when test="not($fontWeight='bold') and ($fontStyle='italic')">
|
||||
<xsl:text>Helvetica-Oblique</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:text>Helvetica</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<!--Use this as default -->
|
||||
<xsl:text>Helvetica</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<!--
|
||||
This stylesheet is part of:
|
||||
PyOpenOffice Version 0.4
|
||||
Copyright (C) 2005: Martin Simon
|
||||
Homepage: www.bezirksreiter.de
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999
|
||||
-->
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
<html>
|
||||
<head>
|
||||
<style type="text/css">
|
||||
${css}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
%for inv in objects :
|
||||
<% setLang(inv.partner_id.lang) %>
|
||||
<div id="inv_cont_${inv.id}" style="padding-left:20mm;padding-top:0;padding-bottom:10;border-width:0px;border-style:solid">
|
||||
<table class="dest_address">
|
||||
<tr><td ><b>${inv.partner_id.title or ''|entity} ${inv.partner_id.name |entity}</b></td></tr>
|
||||
<tr><td>${inv.address_invoice_id.street or ''|entity}</td></tr>
|
||||
<tr><td>${inv.address_invoice_id.street2 or ''|entity}</td></tr>
|
||||
<tr><td>${inv.address_invoice_id.zip or ''|entity} ${inv.address_invoice_id.city or ''|entity}</td></tr>
|
||||
%if inv.address_invoice_id.country_id :
|
||||
<tr><td>${inv.address_invoice_id.country_id.name or ''|entity} </td></tr>
|
||||
%endif
|
||||
%if inv.address_invoice_id.phone :
|
||||
<tr><td>${_("Tel")}: ${inv.address_invoice_id.phone|entity}</td></tr>
|
||||
%endif
|
||||
%if inv.address_invoice_id.fax :
|
||||
<tr><td>${_("Fax")}: ${inv.address_invoice_id.fax|entity}</td></tr>
|
||||
%endif
|
||||
%if inv.address_invoice_id.email :
|
||||
<tr><td>${_("E-mail")}: ${inv.address_invoice_id.email|entity}</td></tr>
|
||||
%endif
|
||||
%if inv.partner_id.vat :
|
||||
<tr><td>${_("VAT")}: ${inv.partner_id.vat|entity}</td></tr>
|
||||
%endif
|
||||
</table>
|
||||
<br />
|
||||
%if inv.type == 'out_invoice' :
|
||||
<span class="title">${_("Invoice")} ${inv.number or ''|entity}</span>
|
||||
%elif inv.type == 'in_invoice' :
|
||||
<span class="title">${_("Supplier Invoice")} ${inv.number or ''|entity}</span>
|
||||
%elif inv.type == 'out_refund' :
|
||||
<span class="title">${_("Refund")} ${inv.number or ''|entity}</span>
|
||||
%elif inv.type == 'in_refund' :
|
||||
<span class="title">${_("Supplier Refund")} ${inv.number or ''|entity}</span>
|
||||
%endif
|
||||
<br/>
|
||||
<br/>
|
||||
<table class="basic_table" width="90%">
|
||||
<tr><td>${_("Document")}</td><td>${_("Invoice Date")}</td><td>${_("Partner Ref.")}</td></tr>
|
||||
<tr><td>${inv.name}</td><td>${formatLang(inv.date_invoice, date=True)|entity}</td><td> </td></tr>
|
||||
</table>
|
||||
<h1><br /></h1>
|
||||
<table class="list_table" width="90%">
|
||||
<thead><tr><th>${_("Description")}</th><th class>${_("Taxes")}</th><th class>${_("QTY")}</th><th>${_("Unit Price")}</th><th >${_("Disc.(%)")}</th><th>${_("Price")}</th></tr></thead>
|
||||
%for line in inv.invoice_line :
|
||||
<tbody>
|
||||
<tr><td>${line.name|entity}</td><td>${ ', '.join([ tax.name or '' for tax in line.invoice_line_tax_id ])|entity}</td><td>${line.quantity}</td><td style="text-align:right;">${formatLang(line.price_unit)}</td><td style="text-align:center;">${line.discount or 0.00}</td><td style="text-align:right;">${formatLang(line.price_subtotal)}</td></tr>
|
||||
%if line.note :
|
||||
<tr><td colspan="6" style="border-style:none"><pre style="font-family:Helvetica;padding-left:20px">${line.note |entity}</pre></td></tr>
|
||||
%endif
|
||||
%endfor
|
||||
<tr><td style="border-style:none"/><td style="border-style:none"/><td style="border-style:none"/><td style="border-style:none"/><td style="border-top:2px solid"><b>Net Total:</b></td><td style="border-top:2px solid;text-align:right">${formatLang(inv.amount_untaxed)}</td></tr>
|
||||
<tr><td style="border-style:none"/><td style="border-style:none"/><td style="border-style:none"/><td style="border-style:none"/><td style="border-style:none"><b>Taxes:</b></td><td style="text-align:right">${formatLang(inv.amount_tax)}</td></tr>
|
||||
<tr><td style="border-style:none"/><td style="border-style:none"/><td style="border-style:none"/><td style="border-style:none"/><td style="border-top:2px solid"><b>Total:</b></td><td style="border-top:2px solid;text-align:right">${formatLang(inv.amount_total)}</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<table class="list_table" width="40%">
|
||||
<tr><th>Tax</th><th>${_("Base")}</th><th>${_("Amount")}</th></tr>
|
||||
%if inv.tax_line :
|
||||
%for t in inv.tax_line :
|
||||
<tr>
|
||||
<td>${ t.name|entity } </td>
|
||||
<td>${ t.base|entity}</td>
|
||||
<td>${ formatLang(t.amount) }</td>
|
||||
</tr>
|
||||
%endfor
|
||||
%endif
|
||||
<tr>
|
||||
<td style="border-style:none"/>
|
||||
<td style="border-top:2px solid"><b>${_("Total")}</b></td>
|
||||
<td style="border-top:2px solid">${ formatLang(inv.amount_tax) }</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
%endfor
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,265 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Author: Nicolas Bessi. Copyright Camptocamp SA
|
||||
# Donors: Hasa Sàrl, Open Net Sàrl and Prisme Solutions Informatique SA
|
||||
#
|
||||
# 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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import time
|
||||
from report import report_sxw
|
||||
from report_webkit import webkit_report
|
||||
from report_webkit import report_helper
|
||||
from osv import osv
|
||||
from tools import mod10r
|
||||
import sys
|
||||
import os
|
||||
import re
|
||||
import wizard
|
||||
import addons
|
||||
import pooler
|
||||
from tools.config import config
|
||||
from mako.template import Template
|
||||
|
||||
|
||||
class l10n_ch_report_webkit_html(report_sxw.rml_parse):
|
||||
def __init__(self, cr, uid, name, context):
|
||||
super(l10n_ch_report_webkit_html, self).__init__(cr, uid, name, context=context)
|
||||
self.localcontext.update({
|
||||
'time': time,
|
||||
'cr':cr,
|
||||
'uid': uid,
|
||||
'user':self.pool.get("res.users").browse(cr, uid, uid),
|
||||
'mod10r': mod10r,
|
||||
'_space': self._space,
|
||||
'_get_ref': self._get_ref,
|
||||
'comma_me': self.comma_me,
|
||||
'police_absolute_path' : self.police_absolute_path,
|
||||
'bvr_absolute_path':self.bvr_absolute_path,
|
||||
'_check' : self._check,
|
||||
'headheight': self.headheight
|
||||
})
|
||||
|
||||
#will be fixed in 5.0.10
|
||||
def police_absolute_path(self, inner_path) :
|
||||
"""Will get the ocrb police absolute path"""
|
||||
path = addons.get_module_resource('l10n_ch/report/'+inner_path)
|
||||
return path
|
||||
|
||||
def bvr_absolute_path(self) :
|
||||
"""Will get the ocrb police absolute path"""
|
||||
path = addons.get_module_resource('l10n_ch/report/bvr1.jpg')
|
||||
return path
|
||||
|
||||
def headheight(self):
|
||||
report_id = self.pool.get('ir.actions.report.xml').search(self.cr, self.uid, [('name','=', 'BVR invoice')])[0]
|
||||
report = self.pool.get('ir.actions.report.xml').browse(self.cr, self.uid, report_id)
|
||||
return report.webkit_header.margin_top
|
||||
|
||||
def comma_me(self, amount):
|
||||
"""Fast swiss number formatting"""
|
||||
if type(amount) is float :
|
||||
amount = str('%.2f'%amount)
|
||||
else :
|
||||
amount = str(amount)
|
||||
orig = amount
|
||||
new = re.sub("^(-?\d+)(\d{3})", "\g<1>'\g<2>", amount)
|
||||
if orig == new:
|
||||
return new
|
||||
else:
|
||||
return self.comma_me(new)
|
||||
|
||||
def _space(self, nbr, nbrspc=5):
|
||||
"""Spaces * 5"""
|
||||
res = ''
|
||||
for i in range(len(nbr)):
|
||||
res = res + nbr[i]
|
||||
if not (i-1) % nbrspc:
|
||||
res = res + ' '
|
||||
return res
|
||||
|
||||
def _get_ref(self, inv):
|
||||
"""Retrieve ESR/BVR reference form invoice in order to print it"""
|
||||
res = ''
|
||||
if inv.partner_bank_id.bvr_adherent_num:
|
||||
res = inv.partner_bank_id.bvr_adherent_num
|
||||
invoice_number = ''
|
||||
if inv.number:
|
||||
invoice_number = re.sub('[^0-9]', '', inv.number)
|
||||
return mod10r(res + invoice_number.rjust(26-len(res), '0'))
|
||||
|
||||
def _check(self, invoices):
|
||||
"""Check if the invoice is ready to be printed"""
|
||||
cursor = self.cr
|
||||
pool = self.pool
|
||||
invoice_obj = pool.get('account.invoice')
|
||||
ids = [x.id for x in invoices]
|
||||
for invoice in invoice_obj.browse(cursor, self.uid, ids):
|
||||
if not invoice.partner_bank_id:
|
||||
raise wizard.except_wizard('UserError',
|
||||
'No bank specified on invoice:\n' + \
|
||||
invoice_obj.name_get(cursor, self.uid, [invoice.id],
|
||||
context={})[0][1])
|
||||
if not re.compile('[0-9][0-9]-[0-9]{3,6}-[0-9]').match(
|
||||
invoice.partner_bank_id.bvr_number or ''):
|
||||
raise wizard.except_wizard('UserError',
|
||||
"Your bank BVR number should be of the form 0X-XXX-X! " +
|
||||
'Please check your company ' +
|
||||
'information for the invoice:\n' +
|
||||
invoice_obj.name_get(cursor, self.uid, [invoice.id],
|
||||
context={})[0][1])
|
||||
if invoice.partner_bank_id.bvr_adherent_num \
|
||||
and not re.compile('[0-9]*$').match(
|
||||
invoice.partner_bank_id.bvr_adherent_num):
|
||||
raise wizard.except_wizard('UserError',
|
||||
'Your bank BVR adherent number must contain exactly seven' +
|
||||
'digits!\nPlease check your company ' +
|
||||
'information for the invoice:\n' +
|
||||
invoice_obj.name_get(cursor, self.uid, [invoice.id],
|
||||
context={})[0][1])
|
||||
return ""
|
||||
|
||||
class BVRWebKitParser(webkit_report.WebKitParser):
|
||||
|
||||
def create_single_pdf(self, cursor, uid, ids, data, report_xml, context=None):
|
||||
"""generate the PDF"""
|
||||
self.parser_instance = self.parser(
|
||||
cursor,
|
||||
uid,
|
||||
self.name2,
|
||||
context=context
|
||||
)
|
||||
self.pool = pooler.get_pool(cursor.dbname)
|
||||
objs = self.getObjects(cursor, uid, ids, context)
|
||||
self.parser_instance.set_context(objs, data, ids, report_xml.report_type)
|
||||
template = False
|
||||
if report_xml.report_file :
|
||||
path = addons.get_module_resource(report_xml.report_file)
|
||||
if os.path.exists(path) :
|
||||
template = file(path).read()
|
||||
if not template and report_xml.report_webkit_data :
|
||||
template = report_xml.report_webkit_data
|
||||
if not template :
|
||||
raise except_osv(_('Webkit Report template not found !'), _(''))
|
||||
header = report_xml.webkit_header.html
|
||||
footer = report_xml.webkit_header.footer_html
|
||||
if not header and report_xml.header:
|
||||
raise except_osv(
|
||||
_('No header defined for this Webkit report!'),
|
||||
_('Please set a header in company settings')
|
||||
)
|
||||
if not report_xml.header :
|
||||
#I know it could be cleaner ...
|
||||
header = u"""
|
||||
<html>
|
||||
<head>
|
||||
<style type="text/css">
|
||||
${css}
|
||||
</style>
|
||||
<script>
|
||||
function subst() {
|
||||
var vars={};
|
||||
var x=document.location.search.substring(1).split('&');
|
||||
for(var i in x) {var z=x[i].split('=',2);vars[z[0]] = unescape(z[1]);}
|
||||
var x=['frompage','topage','page','webpage','section','subsection','subsubsection'];
|
||||
for(var i in x) {
|
||||
var y = document.getElementsByClassName(x[i]);
|
||||
for(var j=0; j<y.length; ++j) y[j].textContent = vars[x[i]];
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body style="border:0; margin: 0;" onload="subst()">
|
||||
</body>
|
||||
</html>"""
|
||||
css = report_xml.webkit_header.css
|
||||
if not css :
|
||||
css = ''
|
||||
user = self.pool.get('res.users').browse(cursor, uid, uid)
|
||||
company= user.company_id
|
||||
parse_template = template
|
||||
#default_filters=['unicode', 'entity'] can be used to set global filter
|
||||
body_mako_tpl = Template(parse_template ,input_encoding='utf-8')
|
||||
#BVR specific
|
||||
bvr_path = addons.get_module_resource('l10n_ch/report/bvr.mako')
|
||||
body_bvr_tpl = Template(file(bvr_path).read(), input_encoding='utf-8')
|
||||
|
||||
helper = report_helper.WebKitHelper(cursor, uid, report_xml.id, context)
|
||||
##BVR Specific
|
||||
htmls = []
|
||||
for obj in objs :
|
||||
|
||||
self.parser_instance.localcontext['objects'] = [obj]
|
||||
if not company.bvr_only:
|
||||
html = body_mako_tpl.render(
|
||||
helper=helper,
|
||||
css=css,
|
||||
_=self.translate_call,
|
||||
**self.parser_instance.localcontext
|
||||
)
|
||||
htmls.append(html)
|
||||
if not company.invoice_only:
|
||||
bvr = body_bvr_tpl.render(
|
||||
helper=helper,
|
||||
css=css,
|
||||
_=self.translate_call,
|
||||
**self.parser_instance.localcontext
|
||||
)
|
||||
htmls.append(bvr)
|
||||
head_mako_tpl = Template(header, input_encoding='utf-8')
|
||||
head = head_mako_tpl.render(
|
||||
company=company,
|
||||
time=time,
|
||||
helper=helper,
|
||||
css=css,
|
||||
formatLang=self.parser_instance.formatLang,
|
||||
setLang=self.parser_instance.setLang,
|
||||
_debug=False
|
||||
)
|
||||
foot = False
|
||||
if footer and company.invoice_only :
|
||||
foot_mako_tpl = Template(footer ,input_encoding='utf-8')
|
||||
foot = foot_mako_tpl.render(
|
||||
company=company,
|
||||
time=time,
|
||||
helper=helper,
|
||||
css=css,
|
||||
formatLang=self.parser_instance.formatLang,
|
||||
setLang=self.parser_instance.setLang,
|
||||
_=self.translate_call,
|
||||
|
||||
)
|
||||
if report_xml.webkit_debug :
|
||||
deb = head_mako_tpl.render(
|
||||
company=company,
|
||||
time=time,
|
||||
helper=helper,
|
||||
css=css,
|
||||
_debug=html,
|
||||
formatLang=self.parser_instance.formatLang,
|
||||
setLang=self.parser_instance.setLang,
|
||||
_=self.translate_call,
|
||||
)
|
||||
return (deb, 'html')
|
||||
bin = self.get_lib(cursor, uid, company.id)
|
||||
pdf = self.generate_pdf(bin, report_xml, head, foot, htmls)
|
||||
return (pdf, 'pdf')
|
||||
|
||||
|
||||
BVRWebKitParser('report.invoice_web_bvr',
|
||||
'account.invoice',
|
||||
'addons/l10n_ch/report/report_webkit_html.mako',
|
||||
parser=l10n_ch_report_webkit_html)
|
|
@ -0,0 +1,162 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="ir_header_webkit_bvr_invoice0" model="ir.header_webkit">
|
||||
<field eval=""""Portrait"""" name="orientation"/>
|
||||
<field eval=""""A4"""" name="format"/>
|
||||
<field name="html"><![CDATA[<html>
|
||||
<head>
|
||||
<script>
|
||||
function subst() {
|
||||
var vars={};
|
||||
var x=document.location.search.substring(1).split('&');
|
||||
for(var i in x) {var z=x[i].split('=',2);vars[z[0]] = unescape(z[1]);}
|
||||
var x=['frompage','topage','page','webpage','section','subsection','subsubsection'];
|
||||
for(var i in x) {
|
||||
var y = document.getElementsByClassName(x[i]);
|
||||
for(var j=0; j<y.length; ++j) y[j].textContent = vars[x[i]];
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style type="text/css">
|
||||
${css}
|
||||
</style>
|
||||
</head>
|
||||
<body style="border:0; margin: 0;" onload="subst()">
|
||||
<table class="header" style="border-bottom: 0px solid black; width: 100%;padding-left:20mm">
|
||||
<tr style="vertical-align:top" >
|
||||
<td>${helper.embed_logo_by_name('camptocamp_logo', width=64)}</td>
|
||||
<td style="text-align:right">
|
||||
<table style="border-top: 0px solid black; width: 100%;height:100%">
|
||||
<tr style="vertical-align:top">
|
||||
<td style="text-align:right;font-size:12" width="80%"><span class="page"/></td><td style="text-align:left;font-size:12;"> / <span class="topage"/></td>
|
||||
</tr>
|
||||
</table> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br/></td>
|
||||
<td style="text-align:right"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>${company.partner_id.name |entity}</td>
|
||||
<td/>
|
||||
</tr>
|
||||
<tr>
|
||||
<td >${company.partner_id.address and company.partner_id.address[0].street or ''|entity}</td>
|
||||
<td/>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Phone: ${company.partner_id.address and company.partner_id.address[0].phone or ''|entity} </td>
|
||||
<td/>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Mail: <a href="mailto:${company.partner_id.address and company.partner_id.address[0].email or ''|entity}">${company.partner_id.address and company.partner_id.address[0].email or ''|entity}</a><br/></td>
|
||||
</tr>
|
||||
</table> ${_debug or ''} <br/></body>
|
||||
</html>]]>
|
||||
</field>
|
||||
<field eval="45" name="margin_top"/>
|
||||
<field eval="0.01" name="margin_bottom"/>
|
||||
<field eval="0.01" name="margin_left"/>
|
||||
<field eval="0.01" name="margin_right"/>
|
||||
<field name="css" ><![CDATA[
|
||||
|
||||
body {
|
||||
font-family:helvetica;
|
||||
font-size:12;
|
||||
}
|
||||
|
||||
|
||||
.dest_address {
|
||||
margin-left:60%;
|
||||
font-size:12;
|
||||
}
|
||||
.header {
|
||||
margin-left:0;
|
||||
text-align:left;
|
||||
width:300px;
|
||||
font-size:12;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size:16;
|
||||
font-weight: bold;
|
||||
|
||||
}
|
||||
|
||||
|
||||
.basic_table{
|
||||
text-align:center;
|
||||
border:1px solid lightGrey;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
.basic_table td {
|
||||
border:1px solid lightGrey;
|
||||
font-size:12;
|
||||
|
||||
|
||||
}
|
||||
|
||||
.list_table {
|
||||
border-color:black;
|
||||
text-align:center;
|
||||
border-collapse: collapse;
|
||||
|
||||
}
|
||||
.list_table td {
|
||||
border-color:gray;
|
||||
border-top:1px solid gray;
|
||||
text-align:left;
|
||||
font-size:12;
|
||||
padding-right:3px
|
||||
padding-left:3px
|
||||
padding-top:3px
|
||||
padding-bottom:3px
|
||||
}
|
||||
|
||||
.list_table th {
|
||||
border-bottom:2px solid black;
|
||||
text-align:left;
|
||||
font-size:12;
|
||||
font-weight:bold;
|
||||
padding-right:3px
|
||||
padding-left:3px
|
||||
}
|
||||
|
||||
.list_tabe thead {
|
||||
display:table-header-group;
|
||||
}
|
||||
|
||||
|
||||
.total {
|
||||
width:100%;
|
||||
}
|
||||
.lib {
|
||||
width:10.3%;
|
||||
}
|
||||
.tot {
|
||||
text-align:right;
|
||||
width:15%;
|
||||
}
|
||||
.lefttot {
|
||||
width:74%;
|
||||
}
|
||||
.tax {
|
||||
width:50%;
|
||||
}]]></field>
|
||||
<field eval=""""BVR header"""" name="name"/>
|
||||
</record>
|
||||
|
||||
<report auto="True"
|
||||
id="report_bvr_invoice_html"
|
||||
model="account.invoice"
|
||||
name="invoice_web_bvr"
|
||||
file="l10n_ch/report/report_webkit_html.mako"
|
||||
string="BVR invoice"
|
||||
report_type="webkit"
|
||||
/>
|
||||
<record id="l10n_ch.report_bvr_invoice_html" model="ir.actions.report.xml">
|
||||
<field name="webkit_header" ref="ir_header_webkit_bvr_invoice0" />
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
|
@ -1 +1 @@
|
|||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
||||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
||||
|
|
|
|
@ -4500,10 +4500,10 @@
|
|||
<field name="note"/>
|
||||
<field ref="ch_299_00" name="parent_id"/>
|
||||
</record>
|
||||
<record id="ch_3_8" model="account.account.template">
|
||||
<record id="ch_3_9" model="account.account.template">
|
||||
<field name="type">view</field>
|
||||
<field name="name">Compte de résultat</field>
|
||||
<field name="code">3_8</field>
|
||||
<field name="code">3_9</field>
|
||||
<field name="user_type" ref="account_type_view"/>
|
||||
<field name="note"/>
|
||||
<field ref="ch_minimal_0" name="parent_id"/>
|
||||
|
@ -4514,7 +4514,7 @@
|
|||
<field name="code">3</field>
|
||||
<field name="user_type" ref="account_type_view"/>
|
||||
<field name="note"/>
|
||||
<field ref="ch_3_8" name="parent_id"/>
|
||||
<field ref="ch_3_9" name="parent_id"/>
|
||||
</record>
|
||||
<record id="ch_30" model="account.account.template">
|
||||
<field name="type">view</field>
|
||||
|
@ -5586,7 +5586,7 @@
|
|||
<field name="code">4</field>
|
||||
<field name="user_type" ref="account_type_view"/>
|
||||
<field name="note"/>
|
||||
<field ref="ch_3_8" name="parent_id"/>
|
||||
<field ref="ch_3_9" name="parent_id"/>
|
||||
</record>
|
||||
<record id="ch_40" model="account.account.template">
|
||||
<field name="type">view</field>
|
||||
|
@ -6634,7 +6634,7 @@
|
|||
<field name="code">5</field>
|
||||
<field name="user_type" ref="account_type_view"/>
|
||||
<field name="note"/>
|
||||
<field ref="ch_3_8" name="parent_id"/>
|
||||
<field ref="ch_3_9" name="parent_id"/>
|
||||
</record>
|
||||
<record id="ch_50" model="account.account.template">
|
||||
<field name="type">view</field>
|
||||
|
@ -7826,7 +7826,7 @@
|
|||
<field name="code">6</field>
|
||||
<field name="user_type" ref="account_type_view"/>
|
||||
<field name="note"/>
|
||||
<field ref="ch_3_8" name="parent_id"/>
|
||||
<field ref="ch_3_9" name="parent_id"/>
|
||||
</record>
|
||||
<record id="ch_60" model="account.account.template">
|
||||
<field name="type">view</field>
|
||||
|
@ -10474,7 +10474,7 @@
|
|||
<field name="code">7</field>
|
||||
<field name="user_type" ref="account_type_view"/>
|
||||
<field name="note"/>
|
||||
<field ref="ch_3_8" name="parent_id"/>
|
||||
<field ref="ch_3_9" name="parent_id"/>
|
||||
</record>
|
||||
<record id="ch_70" model="account.account.template">
|
||||
<field name="type">view</field>
|
||||
|
@ -11034,7 +11034,7 @@
|
|||
<field name="code">8</field>
|
||||
<field name="user_type" ref="account_type_view"/>
|
||||
<field name="note"/>
|
||||
<field ref="ch_3_8" name="parent_id"/>
|
||||
<field ref="ch_3_9" name="parent_id"/>
|
||||
</record>
|
||||
<record id="ch_80" model="account.account.template">
|
||||
<field name="type">view</field>
|
||||
|
@ -11604,21 +11604,13 @@
|
|||
<field name="note"/>
|
||||
<field ref="ch_890" name="parent_id"/>
|
||||
</record>
|
||||
<record id="ch_9_9" model="account.account.template">
|
||||
<field name="type">view</field>
|
||||
<field name="name">Clôture</field>
|
||||
<field name="code">9_9</field>
|
||||
<field name="user_type" ref="account_type_view"/>
|
||||
<field name="note"/>
|
||||
<field ref="ch_minimal_0" name="parent_id"/>
|
||||
</record>
|
||||
<record id="ch_9" model="account.account.template">
|
||||
<field name="type">view</field>
|
||||
<field name="name">Clôture</field>
|
||||
<field name="code">9</field>
|
||||
<field name="user_type" ref="account_type_view"/>
|
||||
<field name="note"/>
|
||||
<field ref="ch_9_9" name="parent_id"/>
|
||||
<field ref="ch_3_9" name="parent_id"/>
|
||||
</record>
|
||||
<record id="ch_90" model="account.account.template">
|
||||
<field name="type">view</field>
|
||||
|
@ -11770,5 +11762,37 @@
|
|||
<field name="property_account_expense_categ" ref="ch_4200"/>
|
||||
<field name="property_account_income_categ" ref="ch_1000"/>
|
||||
</record>
|
||||
|
||||
<!-- journal configuration of account -->
|
||||
|
||||
<record id="expenses_journal" model="account.journal">
|
||||
<field name="default_debit_account_id" eval="False"/>
|
||||
<field name="default_debit_account_id" eval="False"/>
|
||||
</record>
|
||||
|
||||
<record id="bank_journal" model="account.journal">
|
||||
<field name="default_debit_account_id" eval="False"/>
|
||||
<field name="default_debit_account_id" eval="False"/>
|
||||
</record>
|
||||
|
||||
<record id="bank_euro_journal" model="account.journal">
|
||||
<field name="default_debit_account_id" eval="False"/>
|
||||
<field name="default_debit_account_id" eval="False"/>
|
||||
</record>
|
||||
|
||||
<record id="petty_cash_journal" model="account.journal">
|
||||
<field name="default_debit_account_id" eval="False"/>
|
||||
<field name="default_debit_account_id" eval="False"/>
|
||||
</record>
|
||||
|
||||
<record id="misc_transaction_journal" model="account.journal">
|
||||
<field name="default_debit_account_id" eval="False"/>
|
||||
<field name="default_debit_account_id" eval="False"/>
|
||||
</record>
|
||||
|
||||
<record model="account.journal" id="bilan_journal">
|
||||
<field name="default_debit_account_id" eval="False"/>
|
||||
<field name="default_debit_account_id" eval="False"/>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
|
@ -0,0 +1,36 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<openerp>
|
||||
<data noupdate="True">
|
||||
<!-- journal configuration of account -->
|
||||
|
||||
<record id="expenses_journal" model="account.journal">
|
||||
<field name="default_debit_account_id" model="account.account" search="[('code','=', '4200')]" />
|
||||
<field name="default_credit_account_id" model="account.account" search="[('code','=', '4200')]" />
|
||||
</record>
|
||||
|
||||
<record id="bank_journal" model="account.journal">
|
||||
<field name="default_debit_account_id" model="account.account" search="[('code','=', '1020')]"/>
|
||||
<field name="default_credit_account_id" model="account.account" search="[('code','=', '1020')]"/>
|
||||
</record>
|
||||
|
||||
<record id="bank_euro_journal" model="account.journal">
|
||||
<field name="default_debit_account_id" model="account.account" search="[('code','=', '1024')]"/>
|
||||
<field name="default_credit_account_id" model="account.account" search="[('code','=', '1024')]"/>
|
||||
</record>
|
||||
|
||||
<record id="petty_cash_journal" model="account.journal">
|
||||
<field name="default_debit_account_id" model="account.account" search="[('code','=', '1000')]"/>
|
||||
<field name="default_credit_account_id" model="account.account" search="[('code','=', '1000')]"/>
|
||||
</record>
|
||||
|
||||
<record id="misc_transaction_journal" model="account.journal">
|
||||
<field name="default_debit_account_id" eval="False"/>
|
||||
<field name="default_credit_account_id" eval="False"/>
|
||||
</record>
|
||||
|
||||
<record model="account.journal" id="bilan_journal">
|
||||
<field name="default_debit_account_id" model="account.account" search="[('code','=', '2991')]"/>
|
||||
<field name="default_credit_account_id" model="account.account" search="[('code','=', '2991')]"/>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
|
@ -0,0 +1,118 @@
|
|||
<openerp>
|
||||
<data>
|
||||
<!-- Fiscal Position Templates -->
|
||||
|
||||
<record id="fiscal_position_template_import" model="account.fiscal.position.template">
|
||||
<field name="name">Import/Export</field>
|
||||
<field name="chart_template_id" ref="l10nch_chart_template"/>
|
||||
</record>
|
||||
|
||||
<record id="fiscal_position_tax_template_1" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_import" />
|
||||
<field name="tax_src_id" ref="vat_24_purchase" />
|
||||
<field name="tax_dest_id" ref="vat_O_import" />
|
||||
</record>
|
||||
<record id="fiscal_position_tax_template_2" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_import" />
|
||||
<field name="tax_src_id" ref="vat_24_invest" />
|
||||
<field name="tax_dest_id" ref="vat_O_import" />
|
||||
</record>
|
||||
|
||||
|
||||
<record id="fiscal_position_tax_template_3" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_import" />
|
||||
<field name="tax_src_id" ref="vat_25_purchase" />
|
||||
<field name="tax_dest_id" ref="vat_O_import" />
|
||||
</record>
|
||||
<record id="fiscal_position_tax_template_4" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_import" />
|
||||
<field name="tax_src_id" ref="vat_25_invest" />
|
||||
<field name="tax_dest_id" ref="vat_O_import" />
|
||||
</record>
|
||||
|
||||
|
||||
<record id="fiscal_position_tax_template_5" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_import" />
|
||||
<field name="tax_src_id" ref="vat_36_purchase" />
|
||||
<field name="tax_dest_id" ref="vat_O_import" />
|
||||
</record>
|
||||
<record id="fiscal_position_tax_template_6" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_import" />
|
||||
<field name="tax_src_id" ref="vat_36_invest" />
|
||||
<field name="tax_dest_id" ref="vat_O_import" />
|
||||
</record>
|
||||
|
||||
|
||||
<record id="fiscal_position_tax_template_7" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_import" />
|
||||
<field name="tax_src_id" ref="vat_38_purchase" />
|
||||
<field name="tax_dest_id" ref="vat_O_import" />
|
||||
</record>
|
||||
<record id="fiscal_position_tax_template_8" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_import" />
|
||||
<field name="tax_src_id" ref="vat_38_invest" />
|
||||
<field name="tax_dest_id" ref="vat_O_import" />
|
||||
</record>
|
||||
|
||||
|
||||
<record id="fiscal_position_tax_template_9" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_import" />
|
||||
<field name="tax_src_id" ref="vat_76_purchase" />
|
||||
<field name="tax_dest_id" ref="vat_O_import" />
|
||||
</record>
|
||||
<record id="fiscal_position_tax_template_10" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_import" />
|
||||
<field name="tax_src_id" ref="vat_76_invest" />
|
||||
<field name="tax_dest_id" ref="vat_O_import" />
|
||||
</record>
|
||||
|
||||
|
||||
<record id="fiscal_position_tax_template_11" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_import" />
|
||||
<field name="tax_src_id" ref="vat_80_purchase" />
|
||||
<field name="tax_dest_id" ref="vat_O_import" />
|
||||
</record>
|
||||
<record id="fiscal_position_tax_template_12" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_import" />
|
||||
<field name="tax_src_id" ref="vat_80_invest" />
|
||||
<field name="tax_dest_id" ref="vat_O_import" />
|
||||
</record>
|
||||
|
||||
|
||||
<record id="fiscal_position_tax_template_13" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_import" />
|
||||
<field name="tax_src_id" ref="vat_24" />
|
||||
<field name="tax_dest_id" ref="vat_XO" />
|
||||
</record>
|
||||
|
||||
<record id="fiscal_position_tax_template_14" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_import" />
|
||||
<field name="tax_src_id" ref="vat_25" />
|
||||
<field name="tax_dest_id" ref="vat_XO" />
|
||||
</record>
|
||||
|
||||
<record id="fiscal_position_tax_template_15" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_import" />
|
||||
<field name="tax_src_id" ref="vat_36" />
|
||||
<field name="tax_dest_id" ref="vat_XO" />
|
||||
</record>
|
||||
|
||||
<record id="fiscal_position_tax_template_16" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_import" />
|
||||
<field name="tax_src_id" ref="vat_38" />
|
||||
<field name="tax_dest_id" ref="vat_XO" />
|
||||
</record>
|
||||
|
||||
<record id="fiscal_position_tax_template_17" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_import" />
|
||||
<field name="tax_src_id" ref="vat_76" />
|
||||
<field name="tax_dest_id" ref="vat_XO" />
|
||||
</record>
|
||||
|
||||
<record id="fiscal_position_tax_template_18" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_import" />
|
||||
<field name="tax_src_id" ref="vat_80" />
|
||||
<field name="tax_dest_id" ref="vat_XO" />
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
|
@ -1,44 +1,45 @@
|
|||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data noupdate="1">
|
||||
<!-- SOME DATA IN THIS FILE ARE DUPLICATED ON VAT2011.XML IT WILL ALLOWS EASY FUTURE REMOVAL OF THIS FILE IN 2012 2013. -->
|
||||
<!-- SOME UNUSED TAX CODE ARE STILL KEPT IN ORDER TO ALLOW MORE EASY MIGRATION FORM V5 -->
|
||||
<record model="account.tax.code.template" id="vat_code_balance_net">
|
||||
<field name="name">Solde de TVA a payer a l'AFC</field>
|
||||
<field name="code">500 Solde de TVA a payer a l'AFC</field>
|
||||
<field name="code">500</field>
|
||||
<field name="parent_id" ref="vat_code_chart_root"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="vat_code_due_tva">
|
||||
<field name="name">TVA Due (TVA a payer)</field>
|
||||
<field name="code">399 TVA Due (TVA a payer)</field>
|
||||
<field name="name">TVA Due </field>
|
||||
<field name="code">399</field>
|
||||
<field name="parent_id" ref="vat_code_balance_net"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="vat_code_due_tva76">
|
||||
<field name="name">TVA due sur base a 7.6%</field>
|
||||
<field name="code">300b TVA due sur base a 7.6%</field>
|
||||
<field name="name">TVA due a 7.6% (TN)</field>
|
||||
<field name="code">300b</field>
|
||||
<field name="parent_id" ref="vat_code_due_tva"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="vat_code_due_tva24">
|
||||
<field name="name">TVA due sur base a 2.4%</field>
|
||||
<field name="code">310b TVA due sur base a 2.4%</field>
|
||||
<field name="name">TVA due a 2.4% (TR)</field>
|
||||
<field name="code">310b</field>
|
||||
<field name="parent_id" ref="vat_code_due_tva"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="vat_code_due_tva36">
|
||||
<field name="name">TVA due sur base a 3.6%</field>
|
||||
<field name="code">340b TVA due sur base a 3.6%</field>
|
||||
<field name="name">TVA due a 3.6% (TS)</field>
|
||||
<field name="code">340b</field>
|
||||
<field name="parent_id" ref="vat_code_due_tva"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="vat_code_payable">
|
||||
<field name="name">Impot préalable sur acquisitions (TVA a récupérer)</field>
|
||||
<field name="code">479 Impot préalable sur acquisitions (TVA a récupérer)</field>
|
||||
<field name="name">TVA préalable sur acquisitions (a récupérer)</field>
|
||||
<field name="code">479</field>
|
||||
<field name="parent_id" ref="vat_code_balance_net"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="vat_code_payable_bs">
|
||||
<field name="name">Impot préalable sur biens et services</field>
|
||||
<field name="code">400 Impot préalable sur biens et services</field>
|
||||
<field name="name">TVA préalable sur biens et services</field>
|
||||
<field name="code">400</field>
|
||||
<field name="parent_id" ref="vat_code_payable"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="vat_code_payable_invest">
|
||||
<field name="name">Impot préalable sur invest. et autres ch.</field>
|
||||
<field name="code">405 Impot préalable sur invest. et autres ch.</field>
|
||||
<field name="name">TVA préalable sur invest. et autres ch.</field>
|
||||
<field name="code">405</field>
|
||||
<field name="parent_id" ref="vat_code_payable"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="vat_code_base_net">
|
||||
|
@ -47,110 +48,110 @@
|
|||
<field name="parent_id" ref="vat_code_chart_root"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="vat_code_base_ca_total">
|
||||
<field name="name">Chiffre d'affaires total</field>
|
||||
<field name="code">200 Chiffre d'affaires total</field>
|
||||
<field name="name">Chiffre d'affaires - total</field>
|
||||
<field name="code">200</field>
|
||||
<field name="parent_id" ref="vat_code_base_net"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="vat_code_base_due">
|
||||
<field name="name">Chiffre d'affaires imposable</field>
|
||||
<field name="code">299 Chiffre d'affaires imposable</field>
|
||||
<field name="code">299</field>
|
||||
<field name="parent_id" ref="vat_code_base_ca_total"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="vat_code_due_76">
|
||||
<field name="name">Chiffre d'affaires imposable a 7.6% (taux normal)</field>
|
||||
<field name="code">300a Chiffre d'affaires imposable a 7.6% (taux normal)</field>
|
||||
<field name="name">Chiffre d'affaires imposable a 7.6% (TN)</field>
|
||||
<field name="code">300a</field>
|
||||
<field name="parent_id" ref="vat_code_base_due"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="vat_code_due_24">
|
||||
<field name="name">Chiffre d'affaires imposable a 2.4% (taux réduit)</field>
|
||||
<field name="code">310a Chiffre d'affaires imposable a 2.4% (taux réduit)</field>
|
||||
<field name="name">Chiffre d'affaires imposable a 2.4% (TR)</field>
|
||||
<field name="code">310a</field>
|
||||
<field name="parent_id" ref="vat_code_base_due"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="vat_code_due_36">
|
||||
<field name="name">Chiffre d'affaires imposable a 3.6% (taux spécial)</field>
|
||||
<field name="code">340a Chiffre d'affaires imposable a 3.6% (taux spécial)</field>
|
||||
<field name="name">Chiffre d'affaires imposable a 3.6% (TS)</field>
|
||||
<field name="code">340a</field>
|
||||
<field name="parent_id" ref="vat_code_base_due"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="vat_code_due_0">
|
||||
<field name="name">Chiffre d'affaires imposable a 0% (exportation)</field>
|
||||
<field name="code">220 Chiffre d'affaires imposable a 0% (exportation)</field>
|
||||
<field name="name">Chiffre d'affaires imposable a 0% (export)</field>
|
||||
<field name="code">200-220</field>
|
||||
<field name="parent_id" ref="vat_code_base_ca_total"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="vat_code_due_0_exclu">
|
||||
<field name="name">Chiffre d'affaires imposable a 0% (exclu)</field>
|
||||
<field name="code">230 Chiffre d'affaires imposable a 0% (exclu)</field>
|
||||
<field name="name">Chiffre d'affaires non-imposable a 0% (exclu)</field>
|
||||
<field name="code">200-230</field>
|
||||
<field name="parent_id" ref="vat_code_base_ca_total"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="vat_code_receivable_net">
|
||||
<field name="name">Acquisition</field>
|
||||
<field name="code">Acquisition</field>
|
||||
<field name="name">Acquisition - total</field>
|
||||
<field name="code"/>
|
||||
<field name="parent_id" ref="vat_code_base_net"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="vat_code_receivable_base">
|
||||
<field name="name">Acquisition de biens et services</field>
|
||||
<field name="code">Acquisition de biens et services</field>
|
||||
<field name="code"/>
|
||||
<field name="parent_id" ref="vat_code_receivable_net"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="vat_code_receivable_base_0">
|
||||
<field name="name">Acquisition de biens et services a 0%</field>
|
||||
<field name="code">Acquisition de biens et services a 0%</field>
|
||||
<field name="code"/>
|
||||
<field name="parent_id" ref="vat_code_receivable_base"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="vat_code_receivable_base_76">
|
||||
<field name="name">Acquisition de biens et services a 7.6%</field>
|
||||
<field name="code">Acquisition de biens et services a 7.6%</field>
|
||||
<field name="name">Acquisition de biens et services a 7.6% (TN)</field>
|
||||
<field name="code"/>
|
||||
<field name="parent_id" ref="vat_code_receivable_base"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="vat_code_receivable_base_24">
|
||||
<field name="name">Acquisition de biens et services a 2.4%</field>
|
||||
<field name="code">Acquisition de biens et services a 2.4%</field>
|
||||
<field name="name">Acquisition de biens et services a 2.4% (TR)</field>
|
||||
<field name="code"/>
|
||||
<field name="parent_id" ref="vat_code_receivable_base"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="vat_code_receivable_base_36">
|
||||
<field name="name">Acquisition de biens et services a 3.6%</field>
|
||||
<field name="code">Acquisition de biens et services a 3.6%</field>
|
||||
<field name="name">Acquisition de biens et services a 3.6% (TS)</field>
|
||||
<field name="code"/>
|
||||
<field name="parent_id" ref="vat_code_receivable_base"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="vat_code_receivable_base_24_50%">
|
||||
<field name="name">Acquisition de biens et services a 2.4% récup. à 50%</field>
|
||||
<field name="code">Acquisition de biens et services a 2.4% récup. à 50%</field>
|
||||
<field name="name">Acquisition de biens et services a 2.4% récup. à 50% (TR)</field>
|
||||
<field name="code"/>
|
||||
<field name="parent_id" ref="vat_code_receivable_base"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="vat_code_receivable_base_76_50%">
|
||||
<field name="name">Acquisition de biens et services a 7.6% récup. à 50%</field>
|
||||
<field name="code">Acquisition de biens et services a 7.6% récup. à 50%</field>
|
||||
<field name="name">Acquisition de biens et services a 7.6% récup. à 50% (TN)</field>
|
||||
<field name="code"/>
|
||||
<field name="parent_id" ref="vat_code_receivable_base"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="vat_code_receivable_base_36_50%">
|
||||
<field name="name">Acquisition de biens et services a 3.6% récup. à 50%</field>
|
||||
<field name="code">Acquisition de biens et services a 3.6% récup. à 50%</field>
|
||||
<field name="name">Acquisition de biens et services a 3.6% récup. à 50% (TS)</field>
|
||||
<field name="code"/>
|
||||
<field name="parent_id" ref="vat_code_receivable_base"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="vat_code_receivable_base_invest">
|
||||
<field name="name">Acquisition de biens d'invest. et autres charges</field>
|
||||
<field name="code">Acquisition de biens d'invest. et autres charges</field>
|
||||
<field name="code"/>
|
||||
<field name="parent_id" ref="vat_code_receivable_net"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="vat_code_receivable_base_invest76">
|
||||
<field name="name">Acquisition de biens d'invest. et autres charges a 7.6%</field>
|
||||
<field name="code">Acquisition de biens d'invest. et autres charges a 7.6%</field>
|
||||
<field name="name">Acquisition de biens d'invest. et autres charges a 7.6% (TN)</field>
|
||||
<field name="code"/>
|
||||
<field name="parent_id" ref="vat_code_receivable_base_invest"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="vat_code_receivable_base_invest24">
|
||||
<field name="name">Acquisition de biens d'invest. et autres charges a 2.4%</field>
|
||||
<field name="code">Acquisition de biens d'invest. et autres charges a 2.4%</field>
|
||||
<field name="name">Acquisition de biens d'invest. et autres charges a 2.4% (TR)</field>
|
||||
<field name="code"/>
|
||||
<field name="parent_id" ref="vat_code_receivable_base_invest"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="vat_code_receivable_base_invest36">
|
||||
<field name="name">Acquisition de biens d'invest. et autres charges a 3.6%</field>
|
||||
<field name="code">Acquisition de biens d'invest. et autres charges a 3.6%</field>
|
||||
<field name="name">Acquisition de biens d'invest. et autres charges a 3.6% (TS)</field>
|
||||
<field name="code"/>
|
||||
<field name="parent_id" ref="vat_code_receivable_base_invest"/>
|
||||
</record>
|
||||
<!--
|
||||
# TVA - Taxe sur la Valeur Ajoutée
|
||||
-->
|
||||
<record model="account.tax.template" id="vat_24">
|
||||
<field name="name">2.4%</field>
|
||||
<field name="name">TVA due a 2.4% (TR)</field>
|
||||
<field name="amount" eval="0.024"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="base_code_id" ref="vat_code_due_24"/>
|
||||
|
@ -162,10 +163,12 @@
|
|||
<field name="ref_base_sign" eval="-1.0"/>
|
||||
<field name="ref_tax_sign" eval="-1.0"/>
|
||||
<field name="chart_template_id" ref="l10nch_chart_template"/>
|
||||
<field name="account_collected_id" ref="ch_1170"/>
|
||||
<field name="account_paid_id" ref="ch_1170"/>
|
||||
<field name="type_tax_use">sale</field>
|
||||
</record>
|
||||
<record model="account.tax.template" id="vat_24_purchase">
|
||||
<field name="name">TVA 2.4% sur achat B&S</field>
|
||||
<field name="name">TVA 2.4% sur achat B&S (TR)</field>
|
||||
<field name="amount" eval="0.024"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="base_code_id" ref="vat_code_receivable_base_24"/>
|
||||
|
@ -173,17 +176,18 @@
|
|||
<field name="ref_base_code_id" ref="vat_code_receivable_base_24"/>
|
||||
<field name="ref_tax_code_id" ref="vat_code_payable_bs"/>
|
||||
<field name="python_compute">result = round((price_unit * 0.024) / 0.05) * 0.05</field>
|
||||
<field name="python_compute_inv">result = round((price_unit * ( 1 - (1 / 1.024))) /
|
||||
0.05) * 0.05</field>
|
||||
<field name="python_compute_inv">result = round((price_unit * ( 1 - (1 / 1.024))) / 0.05) * 0.05</field>
|
||||
<field name="base_sign" eval="-1.0"/>
|
||||
<field name="tax_sign" eval="-1.0"/>
|
||||
<field name="ref_base_sign" eval="1.0"/>
|
||||
<field name="ref_tax_sign" eval="1.0"/>
|
||||
<field name="chart_template_id" ref="l10nch_chart_template"/>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="account_collected_id" ref="ch_1171"/>
|
||||
<field name="account_paid_id" ref="ch_1171"/>
|
||||
</record>
|
||||
<record model="account.tax.template" id="vat_24_invest">
|
||||
<field name="name">TVA 2.4% sur invest. et autres ch.</field>
|
||||
<field name="name">TVA 2.4% sur invest. et autres ch. (TR)</field>
|
||||
<field name="amount" eval="0.024"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="base_code_id" ref="vat_code_receivable_base_invest24"/>
|
||||
|
@ -191,17 +195,19 @@
|
|||
<field name="ref_base_code_id" ref="vat_code_receivable_base_invest24"/>
|
||||
<field name="ref_tax_code_id" ref="vat_code_payable_invest"/>
|
||||
<field name="python_compute">result = round((price_unit * 0.024) / 0.05) * 0.05</field>
|
||||
<field name="python_compute_inv">result = round((price_unit * ( 1 - (1 / 1.024))) /
|
||||
0.05) * 0.05</field>
|
||||
<field name="python_compute_inv">result = round((price_unit * ( 1 - (1 / 1.024))) / 0.05) * 0.05</field>
|
||||
<field name="base_sign" eval="-1.0"/>
|
||||
<field name="tax_sign" eval="-1.0"/>
|
||||
<field name="ref_base_sign" eval="1.0"/>
|
||||
<field name="ref_tax_sign" eval="1.0"/>
|
||||
<field name="chart_template_id" ref="l10nch_chart_template"/>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="account_collected_id" ref="ch_1171"/>
|
||||
<field name="account_paid_id" ref="ch_1171"/>
|
||||
</record>
|
||||
|
||||
<record model="account.tax.template" id="vat_36">
|
||||
<field name="name">3.6%</field>
|
||||
<field name="name">TVA due a 3.6% (TS)</field>
|
||||
<field name="amount" eval="0.036"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="base_code_id" ref="vat_code_due_36"/>
|
||||
|
@ -209,17 +215,18 @@
|
|||
<field name="ref_base_code_id" ref="vat_code_due_36"/>
|
||||
<field name="ref_tax_code_id" ref="vat_code_due_tva36"/>
|
||||
<field name="python_compute">result = round((price_unit * 0.036) / 0.05) * 0.05</field>
|
||||
<field name="python_compute_inv">result = round((price_unit * ( 1 - (1 / 1.036))) /
|
||||
0.05) * 0.05</field>
|
||||
<field name="python_compute_inv">result = round((price_unit * ( 1 - (1 / 1.036))) / 0.05) * 0.05</field>
|
||||
<field name="base_sign" eval="1.0"/>
|
||||
<field name="tax_sign" eval="1.0"/>
|
||||
<field name="ref_base_sign" eval="-1.0"/>
|
||||
<field name="ref_tax_sign" eval="-1.0"/>
|
||||
<field name="chart_template_id" ref="l10nch_chart_template"/>
|
||||
<field name="type_tax_use">sale</field>
|
||||
<field name="account_collected_id" ref="ch_1170"/>
|
||||
<field name="account_paid_id" ref="ch_1170"/>
|
||||
</record>
|
||||
<record model="account.tax.template" id="vat_36_purchase">
|
||||
<field name="name">TVA 3.6% sur achat B&S</field>
|
||||
<field name="name">TVA 3.6% sur achat B&S (TS)</field>
|
||||
<field name="amount" eval="0.036"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="base_code_id" ref="vat_code_receivable_base_36"/>
|
||||
|
@ -227,17 +234,18 @@
|
|||
<field name="ref_base_code_id" ref="vat_code_receivable_base_36"/>
|
||||
<field name="ref_tax_code_id" ref="vat_code_payable_bs"/>
|
||||
<field name="python_compute">result = round((price_unit * 0.036) / 0.05) * 0.05</field>
|
||||
<field name="python_compute_inv">result = round((price_unit * ( 1 - (1 / 1.036))) /
|
||||
0.05) * 0.05</field>
|
||||
<field name="python_compute_inv">result = round((price_unit * ( 1 - (1 / 1.036))) / 0.05) * 0.05</field>
|
||||
<field name="base_sign" eval="-1.0"/>
|
||||
<field name="tax_sign" eval="-1.0"/>
|
||||
<field name="ref_base_sign" eval="1.0"/>
|
||||
<field name="ref_tax_sign" eval="1.0"/>
|
||||
<field name="chart_template_id" ref="l10nch_chart_template"/>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="account_collected_id" ref="ch_1171"/>
|
||||
<field name="account_paid_id" ref="ch_1171"/>
|
||||
</record>
|
||||
<record model="account.tax.template" id="vat_36_invest">
|
||||
<field name="name">TVA 3.6% sur invest. et autres ch.</field>
|
||||
<field name="name">TVA 3.6% sur invest. et autres ch. (TS)</field>
|
||||
<field name="amount" eval="0.036"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="base_code_id" ref="vat_code_receivable_base_invest36"/>
|
||||
|
@ -245,17 +253,18 @@
|
|||
<field name="ref_base_code_id" ref="vat_code_receivable_base_invest36"/>
|
||||
<field name="ref_tax_code_id" ref="vat_code_payable_invest"/>
|
||||
<field name="python_compute">result = round((price_unit * 0.036) / 0.05) * 0.05</field>
|
||||
<field name="python_compute_inv">result = round((price_unit * ( 1 - (1 / 1.036))) /
|
||||
0.05) * 0.05</field>
|
||||
<field name="python_compute_inv">result = round((price_unit * ( 1 - (1 / 1.036))) / 0.05) * 0.05</field>
|
||||
<field name="base_sign" eval="-1.0"/>
|
||||
<field name="tax_sign" eval="-1.0"/>
|
||||
<field name="ref_base_sign" eval="1.0"/>
|
||||
<field name="ref_tax_sign" eval="1.0"/>
|
||||
<field name="chart_template_id" ref="l10nch_chart_template"/>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="account_collected_id" ref="ch_1171"/>
|
||||
<field name="account_paid_id" ref="ch_1171"/>
|
||||
</record>
|
||||
<record model="account.tax.template" id="vat_76">
|
||||
<field name="name">7.6%</field>
|
||||
<field name="name">TVA due a 7.6% (TN)</field>
|
||||
<field name="amount" eval="0.076"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="base_code_id" ref="vat_code_due_76"/>
|
||||
|
@ -263,14 +272,15 @@
|
|||
<field name="ref_base_code_id" ref="vat_code_due_76"/>
|
||||
<field name="ref_tax_code_id" ref="vat_code_due_tva76"/>
|
||||
<field name="python_compute">result = round((price_unit * 0.076) / 0.05) * 0.05</field>
|
||||
<field name="python_compute_inv">result = round((price_unit * ( 1 - (1 / 1.076))) /
|
||||
0.05) * 0.05</field>
|
||||
<field name="python_compute_inv">result = round((price_unit * ( 1 - (1 / 1.076))) / 0.05) * 0.05</field>
|
||||
<field name="base_sign" eval="1.0"/>
|
||||
<field name="tax_sign" eval="1.0"/>
|
||||
<field name="ref_base_sign" eval="-1.0"/>
|
||||
<field name="ref_tax_sign" eval="-1.0"/>
|
||||
<field name="chart_template_id" ref="l10nch_chart_template"/>
|
||||
<field name="type_tax_use">sale</field>
|
||||
<field name="account_collected_id" ref="ch_1170"/>
|
||||
<field name="account_paid_id" ref="ch_1170"/>
|
||||
</record>
|
||||
<record model="account.tax.template" id="vat_76_purchase">
|
||||
<field name="name">TVA 7.6% sur achat B&S</field>
|
||||
|
@ -281,17 +291,18 @@
|
|||
<field name="ref_base_code_id" ref="vat_code_receivable_base_76"/>
|
||||
<field name="ref_tax_code_id" ref="vat_code_payable_bs"/>
|
||||
<field name="python_compute">result = round((price_unit * 0.076) / 0.05) * 0.05</field>
|
||||
<field name="python_compute_inv">result = round((price_unit * ( 1 - (1 / 1.076))) /
|
||||
0.05) * 0.05</field>
|
||||
<field name="python_compute_inv">result = round((price_unit * ( 1 - (1 / 1.076))) / 0.05) * 0.05</field>
|
||||
<field name="base_sign" eval="-1.0"/>
|
||||
<field name="tax_sign" eval="-1.0"/>
|
||||
<field name="ref_base_sign" eval="1.0"/>
|
||||
<field name="ref_tax_sign" eval="1.0"/>
|
||||
<field name="chart_template_id" ref="l10nch_chart_template"/>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="account_collected_id" ref="ch_1171"/>
|
||||
<field name="account_paid_id" ref="ch_1171"/>
|
||||
</record>
|
||||
<record model="account.tax.template" id="vat_76_invest">
|
||||
<field name="name">TVA 7.6% sur invest. et autres ch.</field>
|
||||
<field name="name">TVA 7.6% sur invest. et autres ch. (TN)</field>
|
||||
<field name="amount" eval="0.076"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="base_code_id" ref="vat_code_receivable_base_invest76"/>
|
||||
|
@ -299,73 +310,15 @@
|
|||
<field name="ref_base_code_id" ref="vat_code_receivable_base_invest76"/>
|
||||
<field name="ref_tax_code_id" ref="vat_code_payable_invest"/>
|
||||
<field name="python_compute">result = round((price_unit * 0.076) / 0.05) * 0.05</field>
|
||||
<field name="python_compute_inv">result = round((price_unit * ( 1 - (1 / 1.076))) /
|
||||
0.05) * 0.05</field>
|
||||
<field name="python_compute_inv">result = round((price_unit * ( 1 - (1 / 1.076))) / 0.05) * 0.05</field>
|
||||
<field name="base_sign" eval="-1.0"/>
|
||||
<field name="tax_sign" eval="-1.0"/>
|
||||
<field name="ref_base_sign" eval="1.0"/>
|
||||
<field name="ref_tax_sign" eval="1.0"/>
|
||||
<field name="chart_template_id" ref="l10nch_chart_template"/>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
</record>
|
||||
<record model="account.tax.template" id="vat_XO">
|
||||
<field name="name">TVA 0% Exportations</field>
|
||||
<field name="amount" eval="0.00"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="base_code_id" ref="vat_code_due_0"/>
|
||||
<!-- <field name="tax_code_id" ref="vat_code_due_tva0"/> -->
|
||||
<field name="ref_base_code_id" ref="vat_code_due_0"/>
|
||||
<!-- <field name="ref_tax_code_id" ref="vat_code_due_tva0"/> -->
|
||||
<field name="base_sign" eval="1.0"/>
|
||||
<field name="tax_sign" eval="1.0"/>
|
||||
<field name="ref_base_sign" eval="-1.0"/>
|
||||
<field name="ref_tax_sign" eval="-1.0"/>
|
||||
<field name="chart_template_id" ref="l10nch_chart_template"/>
|
||||
<field name="type_tax_use">sale</field>
|
||||
</record>
|
||||
<record model="account.tax.template" id="vat_O_exclude">
|
||||
<field name="name">TVA 0% exclue</field>
|
||||
<field name="amount" eval="0.00"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="base_code_id" ref="vat_code_due_0_exclu"/>
|
||||
<!-- <field name="tax_code_id" ref="vat_code_due_tva0"/> -->
|
||||
<field name="ref_base_code_id" ref="vat_code_due_0_exclu"/>
|
||||
<!-- <field name="ref_tax_code_id" ref="vat_code_due_tva0"/> -->
|
||||
<field name="base_sign" eval="1.0"/>
|
||||
<field name="tax_sign" eval="1.0"/>
|
||||
<field name="ref_base_sign" eval="-1.0"/>
|
||||
<field name="ref_tax_sign" eval="-1.0"/>
|
||||
<field name="chart_template_id" ref="l10nch_chart_template"/>
|
||||
<field name="type_tax_use">sale</field>
|
||||
</record>
|
||||
<record model="account.tax.template" id="vat_O_import">
|
||||
<field name="name">TVA 0% Importations de biens et services</field>
|
||||
<field name="amount" eval="0.00"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="base_code_id" ref="vat_code_receivable_base_0"/>
|
||||
<field name="tax_code_id" ref="vat_code_payable_bs"/>
|
||||
<field name="ref_base_code_id" ref="vat_code_receivable_base_0"/>
|
||||
<field name="ref_tax_code_id" ref="vat_code_payable_bs"/>
|
||||
<field name="base_sign" eval="-1.0"/>
|
||||
<field name="tax_sign" eval="-1.0"/>
|
||||
<field name="ref_base_sign" eval="1.0"/>
|
||||
<field name="ref_tax_sign" eval="1.0"/>
|
||||
<field name="chart_template_id" ref="l10nch_chart_template"/>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
</record>
|
||||
<!--# 100% omn import !! the tax percentage is 00-->
|
||||
<record model="account.tax.template" id="vat_100_import">
|
||||
<field name="name">100% sur import</field>
|
||||
<field name="amount" eval="0.0"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="base_code_id" ref="vat_code_payable_bs"/>
|
||||
<field name="ref_base_code_id" ref="vat_code_payable_bs"/>
|
||||
<field name="base_sign" eval="1.0"/>
|
||||
<field name="tax_sign" eval="1.0"/>
|
||||
<field name="ref_base_sign" eval="-1.0"/>
|
||||
<field name="ref_tax_sign" eval="-1.0"/>
|
||||
<field name="chart_template_id" ref="l10nch_chart_template"/>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="account_collected_id" ref="ch_1171"/>
|
||||
<field name="account_paid_id" ref="ch_1171"/>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
|
@ -0,0 +1,371 @@
|
|||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data noupdate="1">
|
||||
<record model="account.tax.code.template" id="vat_code_balance_net">
|
||||
<field name="name">Solde de TVA a payer a l'AFC</field>
|
||||
<field name="code">500</field>
|
||||
<field name="parent_id" ref="vat_code_chart_root"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="vat_code_due_tva">
|
||||
<field name="name">TVA Due </field>
|
||||
<field name="code">399</field>
|
||||
<field name="parent_id" ref="vat_code_balance_net"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="vat_code_due_tva80">
|
||||
<field name="name">TVA due a 8.0% (TN)</field>
|
||||
<field name="code">301b</field>
|
||||
<field name="parent_id" ref="vat_code_due_tva"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="vat_code_due_tva25">
|
||||
<field name="name">TVA due a 2.5% (TR)</field>
|
||||
<field name="code">311b</field>
|
||||
<field name="parent_id" ref="vat_code_due_tva"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="vat_code_due_tva38">
|
||||
<field name="name">TVA due a 3.8% (TS)</field>
|
||||
<field name="code">341b</field>
|
||||
<field name="parent_id" ref="vat_code_due_tva"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="vat_code_payable">
|
||||
<field name="name">TVA préalable sur acquisitions (a récupérer)</field>
|
||||
<field name="code">479</field>
|
||||
<field name="parent_id" ref="vat_code_balance_net"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="vat_code_payable_bs">
|
||||
<field name="name">TVA préalable sur biens et services</field>
|
||||
<field name="code">400</field>
|
||||
<field name="parent_id" ref="vat_code_payable"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="vat_code_payable_invest">
|
||||
<field name="name">TVA préalable sur invest. et autres ch.</field>
|
||||
<field name="code">405</field>
|
||||
<field name="parent_id" ref="vat_code_payable"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="vat_code_base_net">
|
||||
<field name="name">Base de calcul de TVA</field>
|
||||
<field name="code"/>
|
||||
<field name="parent_id" ref="vat_code_chart_root"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="vat_code_base_ca_total">
|
||||
<field name="name">Chiffre d'affaires - total</field>
|
||||
<field name="code">200</field>
|
||||
<field name="parent_id" ref="vat_code_base_net"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="vat_code_base_due">
|
||||
<field name="name">Chiffre d'affaires imposable</field>
|
||||
<field name="code">299</field>
|
||||
<field name="parent_id" ref="vat_code_base_ca_total"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="vat_code_due_80">
|
||||
<field name="name">Chiffre d'affaires imposable a 8.0% (TN)</field>
|
||||
<field name="code">301a</field>
|
||||
<field name="parent_id" ref="vat_code_base_due"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="vat_code_due_25">
|
||||
<field name="name">Chiffre d'affaires imposable a 2.5% (TR)</field>
|
||||
<field name="code">311a</field>
|
||||
<field name="parent_id" ref="vat_code_base_due"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="vat_code_due_38">
|
||||
<field name="name">Chiffre d'affaires imposable a 3.8% (TS)</field>
|
||||
<field name="code">341a</field>
|
||||
<field name="parent_id" ref="vat_code_base_due"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="vat_code_due_0">
|
||||
<field name="name">Chiffre d'affaires imposable a 0% (export)</field>
|
||||
<field name="code">200-220</field>
|
||||
<field name="parent_id" ref="vat_code_base_ca_total"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="vat_code_due_0_exclu">
|
||||
<field name="name">Chiffre d'affaires non-imposable a 0% (exclu)</field>
|
||||
<field name="code">200-230</field>
|
||||
<field name="parent_id" ref="vat_code_base_ca_total"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="vat_code_receivable_net">
|
||||
<field name="name">Acquisition - total</field>
|
||||
<field name="code"/>
|
||||
<field name="parent_id" ref="vat_code_base_net"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="vat_code_receivable_base">
|
||||
<field name="name">Acquisition de biens et services</field>
|
||||
<field name="code"/>
|
||||
<field name="parent_id" ref="vat_code_receivable_net"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="vat_code_receivable_base_0">
|
||||
<field name="name">Acquisition de biens et services a 0%</field>
|
||||
<field name="code"/>
|
||||
<field name="parent_id" ref="vat_code_receivable_base"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="vat_code_receivable_base_80">
|
||||
<field name="name">Acquisition de biens et services a 8.0% (TN)</field>
|
||||
<field name="code"/>
|
||||
<field name="parent_id" ref="vat_code_receivable_base"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="vat_code_receivable_base_25">
|
||||
<field name="name">Acquisition de biens et services a 2.5% (TR)</field>
|
||||
<field name="code"/>
|
||||
<field name="parent_id" ref="vat_code_receivable_base"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="vat_code_receivable_base_38">
|
||||
<field name="name">Acquisition de biens et services a 3.8% (TS)</field>
|
||||
<field name="code"/>
|
||||
<field name="parent_id" ref="vat_code_receivable_base"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="vat_code_receivable_base_invest">
|
||||
<field name="name">Acquisition de biens d'invest. et autres charges</field>
|
||||
<field name="code"/>
|
||||
<field name="parent_id" ref="vat_code_receivable_net"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="vat_code_receivable_base_invest80">
|
||||
<field name="name">Acquisition de biens d'invest. et autres charges a 8.0% (TN)</field>
|
||||
<field name="code"/>
|
||||
<field name="parent_id" ref="vat_code_receivable_base_invest"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="vat_code_receivable_base_invest25">
|
||||
<field name="name">Acquisition de biens d'invest. et autres charges a 2.5% (TR)</field>
|
||||
<field name="code"/>
|
||||
<field name="parent_id" ref="vat_code_receivable_base_invest"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="vat_code_receivable_base_invest38">
|
||||
<field name="name">Acquisition de biens d'invest. et autres charges a 3.8% (TS)</field>
|
||||
<field name="code"/>
|
||||
<field name="parent_id" ref="vat_code_receivable_base_invest"/>
|
||||
</record>
|
||||
<!--
|
||||
# TVA - Taxe sur la Valeur Ajoutée
|
||||
-->
|
||||
<record model="account.tax.template" id="vat_25">
|
||||
<field name="name">TVA due a 2.5% (TR)</field>
|
||||
<field name="amount" eval="0.025"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="base_code_id" ref="vat_code_due_25"/>
|
||||
<field name="tax_code_id" ref="vat_code_due_tva25"/>
|
||||
<field name="ref_base_code_id" ref="vat_code_due_25"/>
|
||||
<field name="ref_tax_code_id" ref="vat_code_due_tva25"/>
|
||||
<field name="base_sign" eval="1.0"/>
|
||||
<field name="tax_sign" eval="1.0"/>
|
||||
<field name="ref_base_sign" eval="-1.0"/>
|
||||
<field name="ref_tax_sign" eval="-1.0"/>
|
||||
<field name="chart_template_id" ref="l10nch_chart_template"/>
|
||||
<field name="account_collected_id" ref="ch_1170"/>
|
||||
<field name="account_paid_id" ref="ch_1170"/>
|
||||
<field name="type_tax_use">sale</field>
|
||||
</record>
|
||||
<record model="account.tax.template" id="vat_25_purchase">
|
||||
<field name="name">TVA 2.5% sur achat B&S (TR)</field>
|
||||
<field name="amount" eval="0.025"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="base_code_id" ref="vat_code_receivable_base_25"/>
|
||||
<field name="tax_code_id" ref="vat_code_payable_bs"/>
|
||||
<field name="ref_base_code_id" ref="vat_code_receivable_base_25"/>
|
||||
<field name="ref_tax_code_id" ref="vat_code_payable_bs"/>
|
||||
<field name="python_compute">result = round((price_unit * 0.025) / 0.05) * 0.05</field>
|
||||
<field name="python_compute_inv">result = round((price_unit * ( 1 - (1 / 1.025))) /0.05) * 0.05</field>
|
||||
<field name="base_sign" eval="-1.0"/>
|
||||
<field name="tax_sign" eval="-1.0"/>
|
||||
<field name="ref_base_sign" eval="1.0"/>
|
||||
<field name="ref_tax_sign" eval="1.0"/>
|
||||
<field name="chart_template_id" ref="l10nch_chart_template"/>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="account_collected_id" ref="ch_1171"/>
|
||||
<field name="account_paid_id" ref="ch_1171"/>
|
||||
</record>
|
||||
<record model="account.tax.template" id="vat_25_invest">
|
||||
<field name="name">TVA 2.5% sur invest. et autres ch. (TR)</field>
|
||||
<field name="amount" eval="0.025"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="base_code_id" ref="vat_code_receivable_base_invest25"/>
|
||||
<field name="tax_code_id" ref="vat_code_payable_invest"/>
|
||||
<field name="ref_base_code_id" ref="vat_code_receivable_base_invest25"/>
|
||||
<field name="ref_tax_code_id" ref="vat_code_payable_invest"/>
|
||||
<field name="python_compute">result = round((price_unit * 0.025) / 0.05) * 0.05</field>
|
||||
<field name="python_compute_inv">result = round((price_unit * ( 1 - (1 / 1.025))) /0.05) * 0.05</field>
|
||||
<field name="base_sign" eval="-1.0"/>
|
||||
<field name="tax_sign" eval="-1.0"/>
|
||||
<field name="ref_base_sign" eval="1.0"/>
|
||||
<field name="ref_tax_sign" eval="1.0"/>
|
||||
<field name="chart_template_id" ref="l10nch_chart_template"/>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="account_collected_id" ref="ch_1171"/>
|
||||
<field name="account_paid_id" ref="ch_1171"/>
|
||||
</record>
|
||||
|
||||
<record model="account.tax.template" id="vat_38">
|
||||
<field name="name">TVA due a 3.8% (TS)</field>
|
||||
<field name="amount" eval="0.038"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="base_code_id" ref="vat_code_due_38"/>
|
||||
<field name="tax_code_id" ref="vat_code_due_tva38"/>
|
||||
<field name="ref_base_code_id" ref="vat_code_due_38"/>
|
||||
<field name="ref_tax_code_id" ref="vat_code_due_tva38"/>
|
||||
<field name="python_compute">result = round((price_unit * 0.038) / 0.05) * 0.05</field>
|
||||
<field name="python_compute_inv">result = round((price_unit * ( 1 - (1 / 1.038))) /0.05) * 0.05</field>
|
||||
<field name="base_sign" eval="1.0"/>
|
||||
<field name="tax_sign" eval="1.0"/>
|
||||
<field name="ref_base_sign" eval="-1.0"/>
|
||||
<field name="ref_tax_sign" eval="-1.0"/>
|
||||
<field name="chart_template_id" ref="l10nch_chart_template"/>
|
||||
<field name="type_tax_use">sale</field>
|
||||
<field name="account_collected_id" ref="ch_1170"/>
|
||||
<field name="account_paid_id" ref="ch_1170"/>
|
||||
</record>
|
||||
<record model="account.tax.template" id="vat_38_purchase">
|
||||
<field name="name">TVA 3.8% sur achat B&S (TS)</field>
|
||||
<field name="amount" eval="0.038"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="base_code_id" ref="vat_code_receivable_base_38"/>
|
||||
<field name="tax_code_id" ref="vat_code_payable_bs"/>
|
||||
<field name="ref_base_code_id" ref="vat_code_receivable_base_38"/>
|
||||
<field name="ref_tax_code_id" ref="vat_code_payable_bs"/>
|
||||
<field name="python_compute">result = round((price_unit * 0.038) / 0.05) * 0.05</field>
|
||||
<field name="python_compute_inv">result = round((price_unit * ( 1 - (1 / 1.038))) /0.05) * 0.05</field>
|
||||
<field name="base_sign" eval="-1.0"/>
|
||||
<field name="tax_sign" eval="-1.0"/>
|
||||
<field name="ref_base_sign" eval="1.0"/>
|
||||
<field name="ref_tax_sign" eval="1.0"/>
|
||||
<field name="chart_template_id" ref="l10nch_chart_template"/>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="account_collected_id" ref="ch_1171"/>
|
||||
<field name="account_paid_id" ref="ch_1171"/>
|
||||
</record>
|
||||
<record model="account.tax.template" id="vat_38_invest">
|
||||
<field name="name">TVA 3.8% sur invest. et autres ch. (TS)</field>
|
||||
<field name="amount" eval="0.038"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="base_code_id" ref="vat_code_receivable_base_invest38"/>
|
||||
<field name="tax_code_id" ref="vat_code_payable_invest"/>
|
||||
<field name="ref_base_code_id" ref="vat_code_receivable_base_invest38"/>
|
||||
<field name="ref_tax_code_id" ref="vat_code_payable_invest"/>
|
||||
<field name="python_compute">result = round((price_unit * 0.038) / 0.05) * 0.05</field>
|
||||
<field name="python_compute_inv">result = round((price_unit * ( 1 - (1 / 1.038))) /0.05) * 0.05</field>
|
||||
<field name="base_sign" eval="-1.0"/>
|
||||
<field name="tax_sign" eval="-1.0"/>
|
||||
<field name="ref_base_sign" eval="1.0"/>
|
||||
<field name="ref_tax_sign" eval="1.0"/>
|
||||
<field name="chart_template_id" ref="l10nch_chart_template"/>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="account_collected_id" ref="ch_1171"/>
|
||||
<field name="account_paid_id" ref="ch_1171"/>
|
||||
</record>
|
||||
<record model="account.tax.template" id="vat_80">
|
||||
<field name="name">TVA due a 8.0% (TN)</field>
|
||||
<field name="amount" eval="0.080"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="base_code_id" ref="vat_code_due_80"/>
|
||||
<field name="tax_code_id" ref="vat_code_due_tva80"/>
|
||||
<field name="ref_base_code_id" ref="vat_code_due_80"/>
|
||||
<field name="ref_tax_code_id" ref="vat_code_due_tva80"/>
|
||||
<field name="python_compute">result = round((price_unit * 0.080) / 0.05) * 0.05</field>
|
||||
<field name="python_compute_inv">result = round((price_unit * ( 1 - (1 / 1.080))) /0.05) * 0.05</field>
|
||||
<field name="base_sign" eval="1.0"/>
|
||||
<field name="tax_sign" eval="1.0"/>
|
||||
<field name="ref_base_sign" eval="-1.0"/>
|
||||
<field name="ref_tax_sign" eval="-1.0"/>
|
||||
<field name="chart_template_id" ref="l10nch_chart_template"/>
|
||||
<field name="type_tax_use">sale</field>
|
||||
<field name="account_collected_id" ref="ch_1170"/>
|
||||
<field name="account_paid_id" ref="ch_1170"/>
|
||||
</record>
|
||||
<record model="account.tax.template" id="vat_80_purchase">
|
||||
<field name="name">TVA 8.0% sur achat B&S (TN)</field>
|
||||
<field name="amount" eval="0.080"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="base_code_id" ref="vat_code_receivable_base_80"/>
|
||||
<field name="tax_code_id" ref="vat_code_payable_bs"/>
|
||||
<field name="ref_base_code_id" ref="vat_code_receivable_base_80"/>
|
||||
<field name="ref_tax_code_id" ref="vat_code_payable_bs"/>
|
||||
<field name="python_compute">result = round((price_unit * 0.080) / 0.05) * 0.05</field>
|
||||
<field name="python_compute_inv">result = round((price_unit * ( 1 - (1 / 1.080))) /0.05) * 0.05</field>
|
||||
<field name="base_sign" eval="-1.0"/>
|
||||
<field name="tax_sign" eval="-1.0"/>
|
||||
<field name="ref_base_sign" eval="1.0"/>
|
||||
<field name="ref_tax_sign" eval="1.0"/>
|
||||
<field name="chart_template_id" ref="l10nch_chart_template"/>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="account_collected_id" ref="ch_1171"/>
|
||||
<field name="account_paid_id" ref="ch_1171"/>
|
||||
</record>
|
||||
<record model="account.tax.template" id="vat_80_invest">
|
||||
<field name="name">TVA 8.0% sur invest. et autres ch. (TN)</field>
|
||||
<field name="amount" eval="0.080"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="base_code_id" ref="vat_code_receivable_base_invest80"/>
|
||||
<field name="tax_code_id" ref="vat_code_payable_invest"/>
|
||||
<field name="ref_base_code_id" ref="vat_code_receivable_base_invest80"/>
|
||||
<field name="ref_tax_code_id" ref="vat_code_payable_invest"/>
|
||||
<field name="python_compute">result = round((price_unit * 0.080) / 0.05) * 0.05</field>
|
||||
<field name="python_compute_inv">result = round((price_unit * ( 1 - (1 / 1.080))) /0.05) * 0.05</field>
|
||||
<field name="base_sign" eval="-1.0"/>
|
||||
<field name="tax_sign" eval="-1.0"/>
|
||||
<field name="ref_base_sign" eval="1.0"/>
|
||||
<field name="ref_tax_sign" eval="1.0"/>
|
||||
<field name="chart_template_id" ref="l10nch_chart_template"/>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="account_collected_id" ref="ch_1171"/>
|
||||
<field name="account_paid_id" ref="ch_1171"/>
|
||||
</record>
|
||||
<record model="account.tax.template" id="vat_XO">
|
||||
<field name="name">TVA due a 0% (Exportations)</field>
|
||||
<field name="amount" eval="0.00"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="base_code_id" ref="vat_code_due_0"/>
|
||||
<!-- <field name="tax_code_id" ref="vat_code_due_tva0"/> -->
|
||||
<field name="ref_base_code_id" ref="vat_code_due_0"/>
|
||||
<!-- <field name="ref_tax_code_id" ref="vat_code_due_tva0"/> -->
|
||||
<field name="base_sign" eval="1.0"/>
|
||||
<field name="tax_sign" eval="1.0"/>
|
||||
<field name="ref_base_sign" eval="-1.0"/>
|
||||
<field name="ref_tax_sign" eval="-1.0"/>
|
||||
<field name="chart_template_id" ref="l10nch_chart_template"/>
|
||||
<field name="type_tax_use">sale</field>
|
||||
<field name="account_collected_id" ref="ch_1170"/>
|
||||
<field name="account_paid_id" ref="ch_1170"/>
|
||||
</record>
|
||||
<record model="account.tax.template" id="vat_O_exclude">
|
||||
<field name="name">TVA 0% exclue</field>
|
||||
<field name="amount" eval="0.00"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="base_code_id" ref="vat_code_due_0_exclu"/>
|
||||
<!-- <field name="tax_code_id" ref="vat_code_due_tva0"/> -->
|
||||
<field name="ref_base_code_id" ref="vat_code_due_0_exclu"/>
|
||||
<!-- <field name="ref_tax_code_id" ref="vat_code_due_tva0"/> -->
|
||||
<field name="base_sign" eval="1.0"/>
|
||||
<field name="tax_sign" eval="1.0"/>
|
||||
<field name="ref_base_sign" eval="-1.0"/>
|
||||
<field name="ref_tax_sign" eval="-1.0"/>
|
||||
<field name="chart_template_id" ref="l10nch_chart_template"/>
|
||||
<field name="type_tax_use">sale</field>
|
||||
</record>
|
||||
<record model="account.tax.template" id="vat_O_import">
|
||||
<field name="name">TVA 0% Importations de biens et services</field>
|
||||
<field name="amount" eval="0.00"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="base_code_id" ref="vat_code_receivable_base_0"/>
|
||||
<field name="tax_code_id" ref="vat_code_payable_bs"/>
|
||||
<field name="ref_base_code_id" ref="vat_code_receivable_base_0"/>
|
||||
<field name="ref_tax_code_id" ref="vat_code_payable_bs"/>
|
||||
<field name="base_sign" eval="-1.0"/>
|
||||
<field name="tax_sign" eval="-1.0"/>
|
||||
<field name="ref_base_sign" eval="1.0"/>
|
||||
<field name="ref_tax_sign" eval="1.0"/>
|
||||
<field name="chart_template_id" ref="l10nch_chart_template"/>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
</record>
|
||||
<!--# 100% on import !! the tax percentage is 00-->
|
||||
<record model="account.tax.template" id="vat_100_import">
|
||||
<field name="name">100% sur import</field>
|
||||
<field name="amount" eval="0.0"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="base_code_id" ref="vat_code_payable_bs"/>
|
||||
<field name="ref_base_code_id" ref="vat_code_payable_bs"/>
|
||||
<field name="base_sign" eval="1.0"/>
|
||||
<field name="tax_sign" eval="1.0"/>
|
||||
<field name="ref_base_sign" eval="-1.0"/>
|
||||
<field name="ref_tax_sign" eval="-1.0"/>
|
||||
<field name="chart_template_id" ref="l10nch_chart_template"/>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="account_collected_id" ref="ch_1171"/>
|
||||
<field name="account_paid_id" ref="ch_1171"/>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
|
@ -1,27 +1,8 @@
|
|||
-
|
||||
In order to test the PDF reports defined on a l10n_ch, we will create a Invoice Record
|
||||
-
|
||||
!record {model: account.invoice, id: test_invoice_1}:
|
||||
currency_id: base.EUR
|
||||
company_id: base.main_company
|
||||
address_invoice_id: base.res_partner_address_tang
|
||||
partner_id: base.res_partner_asus
|
||||
state: draft
|
||||
type: out_invoice
|
||||
account_id: account.a_recv
|
||||
name: Test invoice 1
|
||||
address_contact_id: base.res_partner_address_tang
|
||||
|
||||
-
|
||||
In order to test the PDF reports defined on a l10n_ch, we will print BVR Report
|
||||
-
|
||||
!python {model: account.invoice}: |
|
||||
from tools.test_reports import try_report
|
||||
try_report(cr, uid, 'report.l10n_ch.bvr', [ref('test_invoice_1')])
|
||||
|
||||
-
|
||||
In order to test the PDF reports defined on a l10n_ch, we will print a BVR Invoice Report
|
||||
-
|
||||
!python {model: account.invoice}: |
|
||||
from tools.test_reports import try_report
|
||||
try_report(cr, uid, 'report.l10n_ch.invoice.bvr', [ref('test_invoice_1')])
|
||||
import netsvc, tools, os
|
||||
(data, format) = netsvc.LocalService('webkitaccount.invoice_bvr').create(cr, uid, [ref('account.test_invoice_1')], {}, {})
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'l10ch-bvr_report.'+format), 'wb+').write(data)
|
||||
|
|
|
@ -1,105 +0,0 @@
|
|||
<openerp>
|
||||
<data>
|
||||
<!--
|
||||
Title contact
|
||||
-->
|
||||
<record id="res_c_partner_title_madame" model="res.partner.title">
|
||||
<field name="domain">contact</field>
|
||||
<field name="name">Madame</field>
|
||||
<field name="shortcut">Mme.</field>
|
||||
</record>
|
||||
<record id="res_c_partner_title_sir" model="res.partner.title">
|
||||
<field name="domain">contact</field>
|
||||
<field name="name">Monsieur</field>
|
||||
<field name="shortcut">M. </field>
|
||||
</record>
|
||||
<record id="res_c_partner_title_societe" model="res.partner.title">
|
||||
<field name="domain">contact</field>
|
||||
<field name="name">Société</field>
|
||||
<field name="shortcut">sc</field>
|
||||
</record>
|
||||
<record id="res_c_partner_title_mlle" model="res.partner.title">
|
||||
<field name="domain">contact</field>
|
||||
<field name="name">Mademoiselle</field>
|
||||
<field name="shortcut">Mlle</field>
|
||||
</record>
|
||||
<record id="res_c_partner_title_mme_m" model="res.partner.title">
|
||||
<field name="domain">contact</field>
|
||||
<field name="name">Madame, Monsieur,</field>
|
||||
<field name="shortcut">Mme,m</field>
|
||||
</record>
|
||||
<!--
|
||||
Title partner
|
||||
-->
|
||||
<record id="res_partner_title_madame" model="res.partner.title">
|
||||
<field name="domain">partner</field>
|
||||
<field name="name">Madame</field>
|
||||
<field name="shortcut">Mme.</field>
|
||||
</record>
|
||||
<record id="res_partner_title_sir" model="res.partner.title">
|
||||
<field name="domain">partner</field>
|
||||
<field name="name">Monsieur</field>
|
||||
<field name="shortcut">M. </field>
|
||||
</record>
|
||||
<record id="res_partner_title_societe" model="res.partner.title">
|
||||
<field name="domain">partner</field>
|
||||
<field name="name">Société</field>
|
||||
<field name="shortcut">sc</field>
|
||||
</record>
|
||||
<record id="res_partner_title_mlle" model="res.partner.title">
|
||||
<field name="domain">partner</field>
|
||||
<field name="name">Mademoiselle</field>
|
||||
<field name="shortcut">Mlle</field>
|
||||
</record>
|
||||
<record id="res_partner_title_mme_m" model="res.partner.title">
|
||||
<field name="domain">partner</field>
|
||||
<field name="name">Madame, Monsieur,</field>
|
||||
<field name="shortcut">Mme,m</field>
|
||||
</record>
|
||||
<!--
|
||||
Account Journal we define the swiss base journal
|
||||
-->
|
||||
<!--
|
||||
<record id="account.sales_journal" model="account.journal">
|
||||
<field name="name">Journal de vente</field>
|
||||
<field name="code">JV</field>
|
||||
<field name="type">sale</field>
|
||||
<field name="view_id" ref="account.account_journal_view"/>
|
||||
<field name="sequence_id" ref="account.sequence_journal"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
</record>
|
||||
<record id="account.refund_sales_journal" model="account.journal">
|
||||
<field name="name">Journal d'extourne</field>
|
||||
<field name="code">JVE</field>
|
||||
<field name="type">sale</field>
|
||||
<field name="view_id" ref="account.account_journal_view"/>
|
||||
<field name="sequence_id" ref="account.sequence_journal"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
</record>
|
||||
<record id="account.expenses_journal" model="account.journal">
|
||||
<field name="name">Journal de frais</field>
|
||||
<field name="code">EXJ</field>
|
||||
<field name="type">purchase</field>
|
||||
<field name="view_id" ref="account.account_journal_view"/>
|
||||
<field name="sequence_id" ref="account.sequence_journal"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
</record>
|
||||
<record id="account.bank_journal" model="account.journal">
|
||||
<field name="name">Journal de Banque CHF</field>
|
||||
<field name="code">BNK</field>
|
||||
<field name="type">cash</field>
|
||||
<field name="view_id" ref="account.account_journal_bank_view"/>
|
||||
<field name="sequence_id" ref="account.sequence_journal"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
</record>
|
||||
<record model="account.journal" id="account.bilan_journal">
|
||||
<field name="name">Journal d'ouverture</field>
|
||||
<field name="code">JO</field>
|
||||
<field name="type">situation</field>
|
||||
<field name="centralisation">True</field>
|
||||
<field name="view_id" ref="account.account_journal_view"/>
|
||||
<field name="sequence_id" ref="account.sequence_journal"/>
|
||||
</record>
|
||||
-->
|
||||
</data>
|
||||
</openerp>
|
|
@ -1,16 +1,12 @@
|
|||
<openerp>
|
||||
<data>
|
||||
<record id="config_call_account_template_l10n_ch" model="ir.actions.todo">
|
||||
<field name="name">Generate Chart of Accounts from the L10n_ch_c2c_pcg Chart
|
||||
Template</field>
|
||||
<field name="note">Generate Chart of Accounts from a Chart Template. You will be asked
|
||||
to pass the name of the company, the chart template to follow, the no. of digits to
|
||||
generate the code for your accounts and Bank account, currency to create Journals.
|
||||
Thus,the pure copy of chart Template is generated. This is the same wizard that runs
|
||||
from Financial Management/Configuration/Financial Accounting/Financial
|
||||
<field name="name">Generate Chart of Accounts for l10n_ch</field>
|
||||
<field name="note">Generate Chart of Accounts from a Chart Template. Please let the nuber to 0 for Swiss charts.
|
||||
This is the same wizard that runs from Financial Management/Configuration/Financial Accounting/Financial
|
||||
Accounts/Generate Chart of Accounts from a Chart Template.</field>
|
||||
<field name="action_id" ref="account.action_wizard_multi_chart"/>
|
||||
<field name="sequence">4</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
</openerp>
|
|
@ -1,37 +1,25 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# __init__.py
|
||||
# l10n_ch
|
||||
#
|
||||
# Created by Nicolas Bessi based on Credric Krier contribution
|
||||
#
|
||||
# Copyright (c) 2009 CamptoCamp. All rights reserved.
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
# WARNING: This program as such is intended to be used by professional
|
||||
# programmers who take the whole responsability of assessing all potential
|
||||
# consequences resulting from its eventual inadequacies and bugs
|
||||
# End users who are looking for a ready-to-use solution with commercial
|
||||
# garantees and support are strongly adviced to contract a Free Software
|
||||
# Service Company
|
||||
#
|
||||
# This program is Free Software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
# Author: Nicolas Bessi. Copyright Camptocamp SA
|
||||
# Donors: Hasa Sàrl, Open Net Sàrl and Prisme Solutions Informatique SA
|
||||
#
|
||||
# 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 General Public License for more details.
|
||||
# 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.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
# 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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import create_dta
|
||||
import bvr_report
|
||||
import bvr_import
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -1,35 +1,23 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# bvr_import.py
|
||||
# l10n_ch
|
||||
#
|
||||
# Created by Nicolas Bessi based on Credric Krier contribution
|
||||
#
|
||||
# Copyright (c) 2009 CamptoCamp. All rights reserved.
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
# WARNING: This program as such is intended to be used by professional
|
||||
# programmers who take the whole responsability of assessing all potential
|
||||
# consequences resulting from its eventual inadequacies and bugs
|
||||
# End users who are looking for a ready-to-use solution with commercial
|
||||
# garantees and support are strongly adviced to contract a Free Software
|
||||
# Service Company
|
||||
#
|
||||
# This program is Free Software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
# Author: Nicolas Bessi. Copyright Camptocamp SA
|
||||
# Donors: Hasa Sàrl, Open Net Sàrl and Prisme Solutions Informatique SA
|
||||
#
|
||||
# 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 General Public License for more details.
|
||||
# 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.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
# 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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import base64
|
||||
import time
|
||||
import re
|
||||
|
@ -72,10 +60,12 @@ def _reconstruct_invoice_ref(cursor, user, reference, context=None):
|
|||
def _import(self, cursor, user, data, context=None):
|
||||
|
||||
statement_line_obj = self.pool.get('account.bank.statement.line')
|
||||
statement_obj = self.pool.get('account.bank.statement')
|
||||
# statement_reconcile_obj = pool.get('account.bank.statement.reconcile')
|
||||
voucher_obj = self.pool.get('account.voucher')
|
||||
voucher_line_obj = self.pool.get('account.voucher.line')
|
||||
move_line_obj = self.pool.get('account.move.line')
|
||||
property_obj = self.pool.get('ir.property')
|
||||
model_fields_obj = self.pool.get('ir.model.fields')
|
||||
attachment_obj = self.pool.get('ir.attachment')
|
||||
file = data['form']['file']
|
||||
statement_id = data['id']
|
||||
|
@ -202,13 +192,13 @@ def _import(self, cursor, user, data, context=None):
|
|||
values['voucher_id'] = voucher_id
|
||||
voucher_line_dict = False
|
||||
if result['value']['line_ids']:
|
||||
for line_dict in result['value']['line_ids']:
|
||||
move_line = move_line_obj.browse(cursor, user, line_dict['move_line_id'], context)
|
||||
if move_id == move_line.move_id.id:
|
||||
voucher_line_dict = line_dict
|
||||
for line_dict in result['value']['line_ids']:
|
||||
move_line = move_line_obj.browse(cursor, user, line_dict['move_line_id'], context)
|
||||
if move_id == move_line.move_id.id:
|
||||
voucher_line_dict = line_dict
|
||||
if voucher_line_dict:
|
||||
voucher_line_dict.update({'voucher_id':voucher_id})
|
||||
voucher_line_obj.create(cursor, user, voucher_line_dict, context=context)
|
||||
voucher_line_dict.update({'voucher_id':voucher_id})
|
||||
voucher_line_obj.create(cursor, user, voucher_line_dict, context=context)
|
||||
|
||||
if not account_id:
|
||||
if record['amount'] >= 0:
|
||||
|
@ -256,7 +246,7 @@ class bvr_import_wizard(osv.osv_memory):
|
|||
if res:
|
||||
data['form']['file'] = res['file']
|
||||
_import(self, cr, uid, data, context=context)
|
||||
return {'type': 'ir.actions.act_window_close'}
|
||||
return {}
|
||||
|
||||
bvr_import_wizard()
|
||||
|
||||
|
|
|
@ -1,26 +1,25 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<openerp>
|
||||
<data>
|
||||
<!-- Import BVR Wizard -->
|
||||
<record id="bvr_import_view" model="ir.ui.view">
|
||||
<!-- Import BVR Wizard -->
|
||||
<record id="bvr_import_view" model="ir.ui.view">
|
||||
<field name="name">BVR Import Wizard</field>
|
||||
<field name="model">bvr.import.wizard</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="BVR Import">
|
||||
<group width="525" colspan="4">
|
||||
<field name="file"/>
|
||||
<newline/>
|
||||
<group colspan="4">
|
||||
<button special="cancel" string="Cancel" icon="gtk-cancel" colspan="2"/>
|
||||
<button name="import_bvr" string="Import" type="object" icon="gtk-ok" colspan="2"/>
|
||||
</group>
|
||||
<form string="BVR Import">
|
||||
<group width="525" colspan="4">
|
||||
<field name="file"/>
|
||||
<newline/>
|
||||
<group colspan="4">
|
||||
<button special="cancel" string="Cancel" icon="gtk-cancel" colspan="2"/>
|
||||
<button name="import_bvr" string="Import" type="object" icon="gtk-ok" colspan="2"/>
|
||||
</group>
|
||||
</group>
|
||||
</form>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="wizard_bvr_import" model="ir.actions.act_window">
|
||||
<field name="name">BVR Import</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
|
@ -30,7 +29,7 @@
|
|||
<field name="view_id" ref="bvr_import_view"/>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_bank_statement_form">
|
||||
<field name="name">account.bank.statement.form.inherit</field>
|
||||
<field name="model">account.bank.statement</field>
|
||||
|
@ -41,7 +40,6 @@
|
|||
<button name="%(wizard_bvr_import)d" icon="gtk-execute" string="Import BVR" type="action" colspan="2"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
|
@ -1,122 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# wizzard_bvr.py
|
||||
# l10n_ch
|
||||
#
|
||||
# Created by Nicolas Bessi based on Credric Krier contribution
|
||||
#
|
||||
# Copyright (c) 2009 CamptoCamp. All rights reserved.
|
||||
##############################################################################
|
||||
# WARNING: This program as such is intended to be used by professional
|
||||
# programmers who take the whole responsability of assessing all potential
|
||||
# consequences resulting from its eventual inadequacies and bugs
|
||||
# End users who are looking for a ready-to-use solution with commercial
|
||||
# garantees and support are strongly adviced to contract a Free Software
|
||||
# Service Company
|
||||
#
|
||||
# This program is Free Software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import re
|
||||
|
||||
import pooler
|
||||
from osv import osv, fields
|
||||
from tools.translate import _
|
||||
|
||||
def _validate_bank_values(self, cr, uid, data, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
pool = pooler.get_pool(cr.dbname)
|
||||
invoice_obj = pool.get('account.invoice')
|
||||
for invoice in invoice_obj.browse(cr, uid, data['ids'], context=context):
|
||||
if not invoice.partner_bank_id:
|
||||
raise osv.except_osv(_('UserError'),
|
||||
_('No bank specified on invoice:\n%s') % \
|
||||
invoice_obj.name_get(cr, uid, [invoice.id], context=context)[0][1])
|
||||
|
||||
if not re.compile('[0-9][0-9]-[0-9]{3,6}-[0-9]').match(
|
||||
invoice.partner_bank_id.bvr_number or ''):
|
||||
raise osv.except_osv(_('UserError'),
|
||||
_('Your bank BVR number should be of the form 0X-XXX-X!\n' \
|
||||
'Please check your company ' \
|
||||
'information for the invoice:\n%s') % \
|
||||
invoice_obj.name_get(cr, uid, [invoice.id], context=context)[0][1])
|
||||
|
||||
if invoice.partner_bank_id.bvr_adherent_num \
|
||||
and not re.compile('[0-9]*$').match(
|
||||
invoice.partner_bank_id.bvr_adherent_num):
|
||||
raise osv.except_osv(_('UserError'),
|
||||
_('Your bank BVR adherent number must contain exactly seven ' \
|
||||
'digits!\nPlease check your company ' \
|
||||
'information for the invoice:\n%s') % \
|
||||
invoice_obj.name_get(cr, uid, [invoice.id], context=context)[0][1])
|
||||
return {}
|
||||
|
||||
class bvr_report(osv.osv_memory):
|
||||
_name = "bvr.report"
|
||||
_columns = {
|
||||
'name':fields.char('Name', size=16)
|
||||
}
|
||||
|
||||
def view_init(self, cr, uid, fields_list, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
data = {}
|
||||
active_ids = context.get('active_ids', [])
|
||||
data['form'] = {}
|
||||
data['ids'] = active_ids
|
||||
_validate_bank_values(self, cr, uid, data, context)
|
||||
pass
|
||||
|
||||
def print_bvr_report(self, cr, uid, ids, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
data = {}
|
||||
active_ids = context.get('active_ids', [])
|
||||
data['form'] = {}
|
||||
data['ids'] = active_ids
|
||||
return {'type': 'ir.actions.report.xml', 'report_name': 'l10n_ch.bvr', 'datas': data}
|
||||
|
||||
bvr_report()
|
||||
|
||||
class bvr_invoices_report(osv.osv_memory):
|
||||
_name = "bvr.invoices.report"
|
||||
_columns = {
|
||||
'name':fields.char('Name', size=16)
|
||||
}
|
||||
|
||||
def view_init(self, cr, uid, fields_list, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
data={}
|
||||
active_ids = context.get('active_ids', [])
|
||||
data['form'] = {}
|
||||
data['ids'] = active_ids
|
||||
_validate_bank_values(self, cr, uid, data, context)
|
||||
pass
|
||||
|
||||
def print_bvr_invoices_report(self, cr, uid, ids, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
data = {}
|
||||
active_ids = context.get('active_ids', [])
|
||||
data['form'] = {}
|
||||
data['ids'] = active_ids
|
||||
return {'type': 'ir.actions.report.xml', 'report_name': 'l10n_ch.invoice.bvr', 'datas': data}
|
||||
|
||||
bvr_invoices_report()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
@ -1,78 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<openerp>
|
||||
<data>
|
||||
<!-- BVR Report -->
|
||||
<record id="bvr_report_view" model="ir.ui.view">
|
||||
<field name="name">bvr Report</field>
|
||||
<field name="model">bvr.report</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="BVR Report">
|
||||
<group width="130">
|
||||
<separator string="Print BVR Report" colspan="4"/>
|
||||
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
|
||||
<button name="print_bvr_report" string="Print" type="object" icon="gtk-ok"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_account_bvr_report" model="ir.actions.act_window">
|
||||
<field name="name">BVR</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">bvr.report</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="bvr_report_view"/>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.values" id="action_account_bvr_report_values">
|
||||
<field name="model_id" ref="model_bvr_report" />
|
||||
<field name="object" eval="1" />
|
||||
<field name="name">BVR</field>
|
||||
<field name="key2">client_print_multi</field>
|
||||
<field name="value" eval="'ir.actions.act_window,' +str(ref('action_account_bvr_report'))" />
|
||||
<field name="key">action</field>
|
||||
<field name="model">account.invoice</field>
|
||||
</record>
|
||||
|
||||
<!-- Invoices BVR Report -->
|
||||
<record id="bvr_invoices_report_view" model="ir.ui.view">
|
||||
<field name="name">BVR Invoices Report</field>
|
||||
<field name="model">bvr.invoices.report</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="BVR Invoices Report">
|
||||
<group width="160">
|
||||
<separator string="Print BVR Invoice Report" colspan="4"/>
|
||||
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
|
||||
<button name="print_bvr_invoices_report" string="Print" type="object" icon="gtk-ok"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_account_bvr_invoices_report" model="ir.actions.act_window">
|
||||
<field name="name">Invoices BVR</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">bvr.invoices.report</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="bvr_invoices_report_view"/>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.values" id="action_account_bvr_invoices_report_values">
|
||||
<field name="model_id" ref="model_bvr_invoices_report" />
|
||||
<field name="object" eval="1" />
|
||||
<field name="name">Invoices BVR</field>
|
||||
<field name="key2">client_print_multi</field>
|
||||
<field name="value" eval="'ir.actions.act_window,' +str(ref('action_account_bvr_invoices_report'))" />
|
||||
<field name="key">action</field>
|
||||
<field name="model">account.invoice</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
|
@ -1,32 +1,21 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# dta_wizard.py
|
||||
# l10n_ch
|
||||
#
|
||||
# Created by Nicolas Bessi based on Credric Krier contribution
|
||||
#
|
||||
# Copyright (c) 2009 CamptoCamp. All rights reserved.
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
# WARNING: This program as such is intended to be used by professional
|
||||
# programmers who take the whole responsability of assessing all potential
|
||||
# consequences resulting from its eventual inadequacies and bugs
|
||||
# End users who are looking for a ready-to-use solution with commercial
|
||||
# garantees and support are strongly adviced to contract a Free Software
|
||||
# Service Company
|
||||
#
|
||||
# This program is Free Software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
# Author: Nicolas Bessi. Copyright Camptocamp SA
|
||||
# Donors: Hasa Sàrl, Open Net Sàrl and Prisme Solutions Informatique SA
|
||||
#
|
||||
# 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 General Public License for more details.
|
||||
# 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.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
# 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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
@ -385,6 +374,7 @@ def _create_dta(obj, cr, uid, data, context=None):
|
|||
raise osv.except_osv(_('Error'),
|
||||
_('No IBAN for the company bank account.'))
|
||||
|
||||
dta_line_obj = pool.get('account.dta.line')
|
||||
res_partner_bank_obj = pool.get('res.partner.bank')
|
||||
|
||||
seq = 1
|
||||
|
@ -404,7 +394,7 @@ def _create_dta(obj, cr, uid, data, context=None):
|
|||
v['sequence'] = str(seq).rjust(5).replace(' ', '0')
|
||||
v['amount_to_pay']= str(pline.amount_currency).replace('.', ',')
|
||||
v['number'] = pline.name
|
||||
v['currency'] = pline.currency.symbol
|
||||
v['currency'] = pline.currency.name
|
||||
|
||||
v['partner_bank_name'] = pline.bank_id.bank.name or False
|
||||
v['partner_bank_clearing'] = pline.bank_id.bank.clearing or False
|
||||
|
@ -463,9 +453,9 @@ def _create_dta(obj, cr, uid, data, context=None):
|
|||
v['partner_city']= ''
|
||||
v['partner_zip']= ''
|
||||
v['partner_country']= ''
|
||||
raise osv.except_osv(_('Error'), _('No address defined \n' \
|
||||
'for the partner: %s \n' \
|
||||
'on line: %s') % (pline.partner_id.name,pline.name))
|
||||
raise osv.except_osv('Error', 'No address defined \n' \
|
||||
'for the partner: ' + pline.partner_id.name + '\n' \
|
||||
'on line: ' + pline.name)
|
||||
|
||||
if pline.order_id.date_scheduled:
|
||||
date_value = datetime.strptime(pline.order_id.date_scheduled, '%Y-%m-%d')
|
||||
|
@ -581,7 +571,7 @@ class create_dta_wizard(osv.osv_memory):
|
|||
'dta_file':fields.binary('DTA File', readonly=True)
|
||||
}
|
||||
def create_dta(self, cr, uid, ids, context=None):
|
||||
if context is None:
|
||||
if not context:
|
||||
context = {}
|
||||
data = {}
|
||||
active_ids = context.get('active_ids', [])
|
||||
|
@ -612,4 +602,4 @@ class create_dta_wizard(osv.osv_memory):
|
|||
|
||||
create_dta_wizard()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
@ -1,24 +1,24 @@
|
|||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<!-- Create DTA -->
|
||||
<record id="dta_create_view" model="ir.ui.view">
|
||||
<data>
|
||||
<!-- Create DTA -->
|
||||
<record id="dta_create_view" model="ir.ui.view">
|
||||
<field name="name">Create DTA</field>
|
||||
<field name="model">create.dta.wizard</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="DTA file creation - Results">
|
||||
<group width="300" colspan="4">
|
||||
<separator string="Create DTA" colspan="4"/>
|
||||
<group colspan="4">
|
||||
<button special="cancel" string="Cancel" icon="gtk-cancel" colspan="2"/>
|
||||
<button name="create_dta" string="Create DTA" type="object" icon="gtk-ok" colspan="2"/>
|
||||
</group>
|
||||
<form string="DTA file creation - Results">
|
||||
<group width="300" colspan="4">
|
||||
<separator string="Create DTA" colspan="4"/>
|
||||
<group colspan="4">
|
||||
<button special="cancel" string="Cancel" icon="gtk-cancel" colspan="2"/>
|
||||
<button name="create_dta" string="Create DTA" type="object" icon="gtk-ok" colspan="2"/>
|
||||
</group>
|
||||
</group>
|
||||
</form>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="action_dta_create" model="ir.actions.act_window">
|
||||
<field name="name">Create DTA</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
|
@ -28,7 +28,7 @@
|
|||
<field name="view_id" ref="dta_create_view"/>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.values" id="action_account_dtr_create_values">
|
||||
<field name="model_id" ref="model_create_dta_wizard" />
|
||||
<field name="object" eval="1" />
|
||||
|
@ -38,21 +38,21 @@
|
|||
<field name="key">action</field>
|
||||
<field name="model">payment.order</field>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- Save DTA -->
|
||||
<record id="dta_save_view" model="ir.ui.view">
|
||||
<field name="name">Save DTA</field>
|
||||
<field name="model">create.dta.wizard</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="DTA file creation - Results">
|
||||
<group width="500" colspan="4">
|
||||
<separator colspan="4" string="Click on 'Save as' to save the DTA file :" />
|
||||
<field name="dta_file"/>
|
||||
<form string="DTA file creation - Results">
|
||||
<group width="500" colspan="4">
|
||||
<separator colspan="4" string="Click on 'Save as' to save the DTA file :" />
|
||||
<field name="dta_file"/>
|
||||
</group>
|
||||
</form>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue