[IMP] l10n_ch new version with 2011 taxes and with fixes disscussed with qdp

bzr revid: nicolas.bessi@camptocamp.com-20110114124154-zrqoqof5etn9i42r
This commit is contained in:
nicolas.bessi@camptocamp.com 2011-01-14 13:41:54 +01:00
parent 2af2dbefd5
commit 315242ab0c
36 changed files with 420 additions and 115364 deletions

View File

@ -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

View File

@ -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',

File diff suppressed because it is too large Load Diff

View File

@ -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

View File

@ -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

View File

@ -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()

View File

@ -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>

View File

@ -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>

View File

@ -1,84 +0,0 @@
<openerp>
<data noupdate="1">
<record id="bank" model="res.partner">
<field name="comment">My bank !</field>
<field name="ref">banq</field>
<field name="name">Banque</field>
<field name="category_id" model="res.partner.category" search="[('name','=','Partenaire')]"/>
</record>
<record id="res_partner_address_bank1" model="res.partner.address">
<field name="fax">+41 31 622 13 00</field>
<field name="name">Marc Dufour</field>
<field name="zip">1015</field>
<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="phone">+41 24 620 10 12</field>
<field name="street">PSE-C</field>
<field name="active">1</field>
<field name="type">default</field>
</record>
<record id="prolibre" model="res.partner">
<field name="comment">Very good company!
They provides a very high quality service.</field>
<field name="ref">ProL</field>
<field name="website">http://camptocamp.com</field>
<field name="name">ProLibre</field>
<field name="category_id" model="res.partner.category" search="[('name','=','Partenaire')]"/>
</record>
<record id="camptocamp" model="res.partner">
<field name="comment">Very good company!
They provides a very high quality service.</field>
<field name="ref">c2c</field>
<field name="website">http://camptocamp.com</field>
<field name="name">camptocamp SA</field>
<field name="category_id" model="res.partner.category" search="[('name','=','Partenaire')]"/>
</record>
<!--
Resource: res.partner.address
-->
<record id="res_partner_address_1" model="res.partner.address">
<field name="fax">+41 21 619 10 00</field>
<field name="name">Luc Maurer</field>
<field name="zip">1015</field>
<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="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="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="street">18, rue des Moraines </field>
<field name="active">1</field>
<field name="type">default</field>
</record>
<record id="res_partner_address_3" model="res.partner.address">
<field name="fax">+41 21 619 10 00</field>
<field name="name">Claude Philipona</field>
<field name="zip">1015</field>
<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="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>
</data>
</openerp>

View File

@ -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):

View File

@ -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>

View File

@ -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>

View File

@ -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),
}

View File

@ -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/>.
#
##############################################################################

View File

@ -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/>.
#
##############################################################################

0
addons/l10n_ch/readme.txt Normal file → Executable file
View File

View File

@ -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

View File

@ -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'))]]&gt;[[ _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] ]]&gt;</drawRightString>
</illustration>
</story>
</document>

View File

@ -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:

View File

@ -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'))]]&gt;[[ _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] ]]&gt;</drawRightString>
</illustration>
</story>
</document>

View File

@ -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
addons/l10n_ch/report/ocrbb.ttf Normal file → Executable file
View File

View File

@ -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"

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink

View File

@ -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)

View File

@ -1,371 +0,0 @@
<?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 Solde de TVA a payer a l'AFC</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="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="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="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="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="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="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="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 Chiffre d'affaires total</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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="amount" eval="0.024"/>
<field name="type">percent</field>
<field name="base_code_id" ref="vat_code_due_24"/>
<field name="tax_code_id" ref="vat_code_due_tva24"/>
<field name="ref_base_code_id" ref="vat_code_due_24"/>
<field name="ref_tax_code_id" ref="vat_code_due_tva24"/>
<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_24_purchase">
<field name="name">TVA 2.4% sur achat B&amp;S</field>
<field name="amount" eval="0.024"/>
<field name="type">percent</field>
<field name="base_code_id" ref="vat_code_receivable_base_24"/>
<field name="tax_code_id" ref="vat_code_payable_bs"/>
<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="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_24_invest">
<field name="name">TVA 2.4% sur invest. et autres ch.</field>
<field name="amount" eval="0.024"/>
<field name="type">percent</field>
<field name="base_code_id" ref="vat_code_receivable_base_invest24"/>
<field name="tax_code_id" ref="vat_code_payable_invest"/>
<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="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_36">
<field name="name">3.6%</field>
<field name="amount" eval="0.036"/>
<field name="type">percent</field>
<field name="base_code_id" ref="vat_code_due_36"/>
<field name="tax_code_id" ref="vat_code_due_tva36"/>
<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="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_36_purchase">
<field name="name">TVA 3.6% sur achat B&amp;S</field>
<field name="amount" eval="0.036"/>
<field name="type">percent</field>
<field name="base_code_id" ref="vat_code_receivable_base_36"/>
<field name="tax_code_id" ref="vat_code_payable_bs"/>
<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="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_36_invest">
<field name="name">TVA 3.6% sur invest. et autres ch.</field>
<field name="amount" eval="0.036"/>
<field name="type">percent</field>
<field name="base_code_id" ref="vat_code_receivable_base_invest36"/>
<field name="tax_code_id" ref="vat_code_payable_invest"/>
<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="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_76">
<field name="name">7.6%</field>
<field name="amount" eval="0.076"/>
<field name="type">percent</field>
<field name="base_code_id" ref="vat_code_due_76"/>
<field name="tax_code_id" ref="vat_code_due_tva76"/>
<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="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_76_purchase">
<field name="name">TVA 7.6% sur achat B&amp;S</field>
<field name="amount" eval="0.076"/>
<field name="type">percent</field>
<field name="base_code_id" ref="vat_code_receivable_base_76"/>
<field name="tax_code_id" ref="vat_code_payable_bs"/>
<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="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_76_invest">
<field name="name">TVA 7.6% sur invest. et autres ch.</field>
<field name="amount" eval="0.076"/>
<field name="type">percent</field>
<field name="base_code_id" ref="vat_code_receivable_base_invest76"/>
<field name="tax_code_id" ref="vat_code_payable_invest"/>
<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="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>
</record>
</data>
</openerp>

View File

@ -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>

View File

@ -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>

View File

@ -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:

View File

@ -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()

View File

@ -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>

View File

@ -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:

View File

@ -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>

View File

@ -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:

View File

@ -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