From 96c2f3a0c4be2138308502f7259ef0dfeffb199b Mon Sep 17 00:00:00 2001 From: Delli Chafique Date: Thu, 21 Feb 2013 12:37:06 +0100 Subject: [PATCH] [IMP]account_check_deposit: add the print option webkit --- account_check_deposit/__openerp__.py | 6 +- account_check_deposit/account_deposit.py | 60 +++- .../account_deposit_view.xml | 34 ++- .../i18n/account_check_deposit.pot | 236 +++++++++++++++ account_check_deposit/i18n/fr.po | 236 +++++++++++++++ account_check_deposit/report/.directory | 6 + account_check_deposit/report/.mako | 275 ++++++++++++++++++ account_check_deposit/report/__init__.py | 32 ++ .../report/check_deposit.mako | 112 +++++++ .../report/report_webkit_html.py | 40 +++ 10 files changed, 1010 insertions(+), 27 deletions(-) create mode 100644 account_check_deposit/i18n/account_check_deposit.pot create mode 100644 account_check_deposit/i18n/fr.po create mode 100644 account_check_deposit/report/.directory create mode 100644 account_check_deposit/report/.mako create mode 100644 account_check_deposit/report/__init__.py create mode 100644 account_check_deposit/report/check_deposit.mako create mode 100644 account_check_deposit/report/report_webkit_html.py diff --git a/account_check_deposit/__openerp__.py b/account_check_deposit/__openerp__.py index ffbee2c21..5fdfa4610 100644 --- a/account_check_deposit/__openerp__.py +++ b/account_check_deposit/__openerp__.py @@ -3,6 +3,7 @@ # # # account_check_deposit for OpenERP # # Copyright (C) 2012 Akretion Benoît GUILLOT # +# Copyright (C) 2013 Akretion Chafique DELLI # # # # This program is free software: you can redistribute it and/or modify # # it under the terms of the GNU Affero General Public License as # @@ -32,9 +33,9 @@ You may have to create an account for recieved checks and a journal for payment by checks.""", 'author': 'Akretion', 'website': 'http://www.akretion.com/', - 'depends': ['account_accountant'], + 'depends': ['account_accountant','report_webkit','sale_quick_payment'], 'init_xml': [], - 'update_xml': [ + 'update_xml': [ 'account_deposit_view.xml', 'account_deposit_sequence.xml', 'account_type_data.xml', @@ -43,4 +44,3 @@ 'installable': True, 'active': False, } - diff --git a/account_check_deposit/account_deposit.py b/account_check_deposit/account_deposit.py index 3e2b21100..81dfdb72e 100644 --- a/account_check_deposit/account_deposit.py +++ b/account_check_deposit/account_deposit.py @@ -3,6 +3,7 @@ # # # account_check_deposit for OpenERP # # Copyright (C) 2012 Akretion Benoît GUILLOT # +# Copyright (C) 2013 Akretion Chafique DELLI # # # # This program is free software: you can redistribute it and/or modify # # it under the terms of the GNU Affero General Public License as # @@ -27,6 +28,16 @@ class account_check_deposit(Model): _name = "account.check.deposit" _description = "Account Check Deposit" + def sum_amount(self, cr, uid, ids, name, args, context=None): + res = {} + total = 0 + for deposit in self.browse(cr, uid, ids, context=context): + for line in deposit.check_payment_ids: + total += line.debit + res[deposit.id]= total + return res + + _columns = { 'name': fields.char('Name', size=64, required=True, readonly=True, states={'draft':[('readonly',False)]}), 'check_payment_ids': fields.many2many('account.move.line', 'account_move_line_deposit_rel', @@ -42,14 +53,23 @@ class account_check_deposit(Model): ],'Status', readonly=True), 'move_id': fields.many2one('account.move', 'Journal Entry', readonly=True, states={'draft':[('readonly',False)]}), + 'bank_id': fields.many2one('res.partner.bank', 'Bank', required=True, readonly=True, + domain="[('partner_id', '=', partner_id)]", + states={'draft':[('readonly',False)]}), + 'partner_id':fields.related('company_id', 'partner_id', type="many2one", relation="res.partner", string="Partner", readonly=True), + 'company_id': fields.many2one('res.company', 'Company', required=True, change_default=True, readonly=True, states={'draft':[('readonly',False)]}), + 'total_amount': fields.function(sum_amount, string ="total amount"), } - + _defaults = { 'name': lambda self, cr, uid, context: '/', 'deposit_date': fields.date.context_today, 'state':'draft', + 'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.check.deposit', context=c), } - + + + def cancel(self, cr, uid, ids, context=None): for deposit in self.browse(cr, uid, ids, context=context): if not deposit.journal_id.update_posted: @@ -59,23 +79,23 @@ class account_check_deposit(Model): deposit.move_id.button_cancel() deposit.move_id.unlink() return True - + def create(self, cr, uid, vals, context=None): if vals.get('name','/')=='/': vals['name'] = self.pool.get('ir.sequence').get(cr, uid, 'account.check.deposit') or '/' return super(account_check_deposit, self).create(cr, uid, vals, context=context) - + def _prepare_account_move_vals(self, cr, uid, deposit, context=None): move_vals = {} move_lines = [[0, 0, self._prepare_sum_move_line_vals(cr, uid, deposit, move_vals, context=context)]] for line in deposit.check_payment_ids: - move_lines.append([0, 0, self._prepare_move_line_vals(cr, uid, line, move_vals, context=context)]) + move_lines.append([0, 0, self._prepare_move_line_vals(cr, uid, line, move_vals, context=context)]) move_vals.update({ 'journal_id': deposit.journal_id.id, 'line_id': move_lines, }) return move_vals - + def _prepare_move_line_vals(self, cr, uid, line, move_vals, context=None): move_line_vals = self.pool.get('account.move.line').default_get(cr, uid, ['centralisation', 'date','date_created', @@ -83,20 +103,21 @@ class account_check_deposit(Model): 'account_id', 'period_id', 'company_id'], context=context) move_line_vals.update({ - 'name': line.ref, #name ? + 'name': line.name, 'credit': line.debit, 'account_id': line.account_id.id, 'partner_id': line.partner_id.id, 'ref': line.ref, }) return move_line_vals - + def _prepare_sum_move_line_vals(self, cr, uid, deposit, move_vals, context=None): move_line_vals = self.pool.get('account.move.line').default_get(cr, uid, ['centralisation', 'date','date_created', 'currency_id', 'journal_id', 'amount_currency', 'account_id', 'period_id', 'company_id', 'state'], context=context) + debit = 0.0 for line in deposit.check_payment_ids: debit += line.debit @@ -105,9 +126,9 @@ class account_check_deposit(Model): 'debit': debit, 'ref': deposit.name, }) - + return move_line_vals - + def _reconcile_checks(self, cr, uid, deposit, move_id, context=None): move_line_obj = self.pool.get('account.move.line') for line in deposit.check_payment_ids: @@ -117,7 +138,18 @@ class account_check_deposit(Model): if move_line_ids: move_line_obj.reconcile(cr, uid, [line.id, move_line_ids[0]], context=context) return True - + + + + def onchange_company_id(self, cr, uid, ids, company_id, context=None): + vals={} + if company_id: + company=self.pool.get('res.company').browse(cr, uid, company_id, context=context) + vals['partner_id']=company.partner_id.id + return {'value':vals} + + + def validate_deposit(self, cr, uid, ids, context=None): move_obj = self.pool.get('account.move') if context is None: @@ -125,15 +157,17 @@ class account_check_deposit(Model): for deposit in self.browse(cr, uid, ids, context=context): context['journal_id'] = deposit.journal_id.id move_vals = self._prepare_account_move_vals(cr, uid, deposit, context=context) + print "move_vals ====>", move_vals move_id = move_obj.create(cr, uid, move_vals, context=context) move_obj.post(cr, uid, [move_id], context=context) self._reconcile_checks(cr, uid, deposit, move_id, context=context) deposit.write({'state':'done', 'move_id': move_id}) return True - + + class account_move_line(Model): _inherit = "account.move.line" - + _columns = { 'check_deposit_id': fields.many2many('account.check.deposit', 'account_move_line_deposit_rel', 'check_deposit_id', 'move_line_id', 'Check Deposit'), diff --git a/account_check_deposit/account_deposit_view.xml b/account_check_deposit/account_deposit_view.xml index 10cc6cdd4..856dbbd5b 100644 --- a/account_check_deposit/account_deposit_view.xml +++ b/account_check_deposit/account_deposit_view.xml @@ -2,12 +2,21 @@ - + + @@ -15,7 +24,7 @@ account.check.deposit form -
+

-

+ + + - + @@ -61,7 +73,7 @@ account.check.deposit tree - + @@ -69,13 +81,13 @@ - + account.check.deposit.search account.check.deposit - - + + @@ -84,9 +96,9 @@ - + - Check Deposits + Checks Deposit account.check.deposit form tree,form,graph @@ -96,7 +108,7 @@ - + diff --git a/account_check_deposit/i18n/account_check_deposit.pot b/account_check_deposit/i18n/account_check_deposit.pot new file mode 100644 index 000000000..f54d138c7 --- /dev/null +++ b/account_check_deposit/i18n/account_check_deposit.pot @@ -0,0 +1,236 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * account_check_deposit +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2013-02-21 10:01+0000\n" +"PO-Revision-Date: 2013-02-21 10:01+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: account_check_deposit +#: code:addons/account_check_deposit/account_deposit.py:76 +#, python-format +msgid "You cannot modify a posted entry of this journal.\n" +"First you should set the journal to allow cancelling entries." +msgstr "" + +#. module: account_check_deposit +#: report:addons/account_check_deposit/report/check_deposit.mako:58 +msgid "Beneficiary" +msgstr "" + +#. module: account_check_deposit +#: view:account.check.deposit:0 +msgid "Group By..." +msgstr "" + +#. module: account_check_deposit +#: model:ir.actions.report.xml,name:account_check_deposit.check_deposit_webkit +msgid "WebKit Checks Deposit" +msgstr "" + +#. module: account_check_deposit +#: report:addons/account_check_deposit/report/check_deposit.mako:79 +msgid "Designation" +msgstr "" + +#. module: account_check_deposit +#: field:account.check.deposit,state:0 +msgid "Status" +msgstr "" + +#. module: account_check_deposit +#: report:addons/account_check_deposit/report/check_deposit.mako:78 +msgid "Description" +msgstr "" + +#. module: account_check_deposit +#: field:account.move.line,check_deposit_id:0 +msgid "Check Deposit" +msgstr "" + +#. module: account_check_deposit +#: field:account.check.deposit,company_id:0 +msgid "Company" +msgstr "" + +#. module: account_check_deposit +#: report:addons/account_check_deposit/report/check_deposit.mako:65 +msgid "RIB Key" +msgstr "" + +#. module: account_check_deposit +#: field:account.check.deposit,deposit_date:0 +#: report:addons/account_check_deposit/report/check_deposit.mako:53 +msgid "Deposit Date" +msgstr "" + +#. module: account_check_deposit +#: report:addons/account_check_deposit/report/check_deposit.mako:63 +msgid "Account to crediting" +msgstr "" + +#. module: account_check_deposit +#: report:addons/account_check_deposit/report/check_deposit.mako:76 +msgid "Payment Date" +msgstr "" + +#. module: account_check_deposit +#: view:account.check.deposit:0 +msgid "Date" +msgstr "" + +#. module: account_check_deposit +#: view:account.check.deposit:0 +msgid "Total Credit" +msgstr "" + +#. module: account_check_deposit +#: field:account.check.deposit,bank_id:0 +msgid "Bank" +msgstr "" + +#. module: account_check_deposit +#: field:account.check.deposit,name:0 +msgid "Name" +msgstr "" + +#. module: account_check_deposit +#: view:account.check.deposit:0 +msgid "Checks Deposit Search" +msgstr "" + +#. module: account_check_deposit +#: model:account.account.type,name:account_check_deposit.data_account_type_received_check +msgid "Recieved Checks" +msgstr "" + +#. module: account_check_deposit +#: view:account.check.deposit:0 +#: report:addons/account_check_deposit/report/check_deposit.mako:49 +msgid "Deposit N°" +msgstr "" + +#. module: account_check_deposit +#: view:account.check.deposit:0 +msgid "Total Debit" +msgstr "" + +#. module: account_check_deposit +#: code:addons/account_check_deposit/account_deposit.py:76 +#, python-format +msgid "Error!" +msgstr "" + +#. module: account_check_deposit +#: report:addons/account_check_deposit/report/check_deposit.mako:80 +msgid "Amount" +msgstr "" + +#. module: account_check_deposit +#: view:account.check.deposit:0 +#: model:ir.actions.act_window,name:account_check_deposit.action_check_deposit_tree +#: model:ir.ui.menu,name:account_check_deposit.menu_check_deposit_tree +msgid "Checks Deposit" +msgstr "" + +#. module: account_check_deposit +#: field:account.check.deposit,total_amount:0 +msgid "total amount" +msgstr "" + +#. module: account_check_deposit +#: field:account.check.deposit,partner_id:0 +msgid "Partner" +msgstr "" + +#. module: account_check_deposit +#: selection:account.check.deposit,state:0 +msgid "Cancelled" +msgstr "" + +#. module: account_check_deposit +#: view:account.check.deposit:0 +msgid "Validate Deposit" +msgstr "" + +#. module: account_check_deposit +#: view:account.check.deposit:0 +#: field:account.check.deposit,check_payment_ids:0 +#: report:addons/account_check_deposit/report/check_deposit.mako:70 +msgid "Check Payments" +msgstr "" + +#. module: account_check_deposit +#: report:addons/account_check_deposit/report/check_deposit.mako:41 +msgid "Deposit Slip of Checks(\\u20acuros)" +msgstr "" + +#. module: account_check_deposit +#: report:addons/account_check_deposit/report/check_deposit.mako:55 +msgid "Bank Code" +msgstr "" + +#. module: account_check_deposit +#: report:addons/account_check_deposit/report/check_deposit.mako:77 +msgid "Reference" +msgstr "" + +#. module: account_check_deposit +#: model:ir.model,name:account_check_deposit.model_account_check_deposit +msgid "Account Check Deposit" +msgstr "" + +#. module: account_check_deposit +#: report:addons/account_check_deposit/report/check_deposit.mako:60 +msgid "Office Code" +msgstr "" + +#. module: account_check_deposit +#: view:account.check.deposit:0 +msgid "Check Payment" +msgstr "" + +#. module: account_check_deposit +#: selection:account.check.deposit,state:0 +msgid "Done" +msgstr "" + +#. module: account_check_deposit +#: view:account.check.deposit:0 +msgid "Cancel" +msgstr "" + +#. module: account_check_deposit +#: selection:account.check.deposit,state:0 +msgid "Draft" +msgstr "" + +#. module: account_check_deposit +#: report:addons/account_check_deposit/report/check_deposit.mako:99 +msgid "Total:" +msgstr "" + +#. module: account_check_deposit +#: field:account.check.deposit,move_id:0 +msgid "Journal Entry" +msgstr "" + +#. module: account_check_deposit +#: field:account.check.deposit,journal_id:0 +msgid "Journal" +msgstr "" + +#. module: account_check_deposit +#: model:ir.model,name:account_check_deposit.model_account_move_line +msgid "Journal Items" +msgstr "" + diff --git a/account_check_deposit/i18n/fr.po b/account_check_deposit/i18n/fr.po new file mode 100644 index 000000000..5df143428 --- /dev/null +++ b/account_check_deposit/i18n/fr.po @@ -0,0 +1,236 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * account_check_deposit +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2013-02-21 10:01+0000\n" +"PO-Revision-Date: 2013-02-21 10:01+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: account_check_deposit +#: code:addons/account_check_deposit/account_deposit.py:76 +#, python-format +msgid "You cannot modify a posted entry of this journal.\n" +"First you should set the journal to allow cancelling entries." +msgstr "" + +#. module: account_check_deposit +#: report:addons/account_check_deposit/report/check_deposit.mako:58 +msgid "Beneficiary" +msgstr "Bénéficiaire" + +#. module: account_check_deposit +#: view:account.check.deposit:0 +msgid "Group By..." +msgstr "Regrouper par..." + +#. module: account_check_deposit +#: model:ir.actions.report.xml,name:account_check_deposit.check_deposit_webkit +msgid "WebKit Checks Deposit" +msgstr "WebKit pour Remise de Chèques" + +#. module: account_check_deposit +#: report:addons/account_check_deposit/report/check_deposit.mako:79 +msgid "Designation" +msgstr "Désignation" + +#. module: account_check_deposit +#: field:account.check.deposit,state:0 +msgid "Status" +msgstr "Etat" + +#. module: account_check_deposit +#: report:addons/account_check_deposit/report/check_deposit.mako:78 +msgid "Description" +msgstr "Description" + +#. module: account_check_deposit +#: field:account.move.line,check_deposit_id:0 +msgid "Check Deposit" +msgstr "Remise de Chèque" + +#. module: account_check_deposit +#: field:account.check.deposit,company_id:0 +msgid "Company" +msgstr "Société" + +#. module: account_check_deposit +#: report:addons/account_check_deposit/report/check_deposit.mako:65 +msgid "BIS Key" +msgstr "Clé RIB" + +#. module: account_check_deposit +#: field:account.check.deposit,deposit_date:0 +#: report:addons/account_check_deposit/report/check_deposit.mako:53 +msgid "Deposit Date" +msgstr "Date du Versement" + +#. module: account_check_deposit +#: report:addons/account_check_deposit/report/check_deposit.mako:63 +msgid "Account to crediting" +msgstr "Compte à Créditer" + +#. module: account_check_deposit +#: report:addons/account_check_deposit/report/check_deposit.mako:76 +msgid "Payment Date" +msgstr "Date de Paiement" + +#. module: account_check_deposit +#: view:account.check.deposit:0 +msgid "Date" +msgstr "Date" + +#. module: account_check_deposit +#: view:account.check.deposit:0 +msgid "Total Credit" +msgstr "Crédit Total" + +#. module: account_check_deposit +#: field:account.check.deposit,bank_id:0 +msgid "Bank" +msgstr "Banque" + +#. module: account_check_deposit +#: field:account.check.deposit,name:0 +msgid "Name" +msgstr "Nom" + +#. module: account_check_deposit +#: view:account.check.deposit:0 +msgid "Checks Deposit Search" +msgstr "Rechercher une Remise de Chèques" + +#. module: account_check_deposit +#: model:account.account.type,name:account_check_deposit.data_account_type_received_check +msgid "Recieved Checks" +msgstr "Chèques Reçus" + +#. module: account_check_deposit +#: view:account.check.deposit:0 +#: report:addons/account_check_deposit/report/check_deposit.mako:49 +msgid "Deposit N°" +msgstr "Versement N°" + +#. module: account_check_deposit +#: view:account.check.deposit:0 +msgid "Total Debit" +msgstr "Débit Total" + +#. module: account_check_deposit +#: code:addons/account_check_deposit/account_deposit.py:76 +#, python-format +msgid "Error!" +msgstr "Erreur!" + +#. module: account_check_deposit +#: report:addons/account_check_deposit/report/check_deposit.mako:80 +msgid "Amount" +msgstr "Montant" + +#. module: account_check_deposit +#: view:account.check.deposit:0 +#: model:ir.actions.act_window,name:account_check_deposit.action_check_deposit_tree +#: model:ir.ui.menu,name:account_check_deposit.menu_check_deposit_tree +msgid "Checks Deposit" +msgstr "Remise de Chèques" + +#. module: account_check_deposit +#: field:account.check.deposit,total_amount:0 +msgid "total amount" +msgstr "montant total" + +#. module: account_check_deposit +#: field:account.check.deposit,partner_id:0 +msgid "Partner" +msgstr "Partenaire" + +#. module: account_check_deposit +#: selection:account.check.deposit,state:0 +msgid "Cancelled" +msgstr "Annulé" + +#. module: account_check_deposit +#: view:account.check.deposit:0 +msgid "Validate Deposit" +msgstr "Valider Versement" + +#. module: account_check_deposit +#: view:account.check.deposit:0 +#: field:account.check.deposit,check_payment_ids:0 +#: report:addons/account_check_deposit/report/check_deposit.mako:70 +msgid "Check Payments" +msgstr "Paiements par Chèque" + +#. module: account_check_deposit +#: report:addons/account_check_deposit/report/check_deposit.mako:41 +msgid "Deposit Slip of Checks(Euros)" +msgstr "Bordereau de Remise de Chèques(Euros)" + +#. module: account_check_deposit +#: report:addons/account_check_deposit/report/check_deposit.mako:55 +msgid "Bank Code" +msgstr "Code Banque" + +#. module: account_check_deposit +#: report:addons/account_check_deposit/report/check_deposit.mako:77 +msgid "Reference" +msgstr "Référence" + +#. module: account_check_deposit +#: model:ir.model,name:account_check_deposit.model_account_check_deposit +msgid "Account Check Deposit" +msgstr "Compte Remise de Chèque" + +#. module: account_check_deposit +#: report:addons/account_check_deposit/report/check_deposit.mako:60 +msgid "Office Code" +msgstr "Code Guichet" + +#. module: account_check_deposit +#: view:account.check.deposit:0 +msgid "Check Payment" +msgstr "Paiement par Chèque" + +#. module: account_check_deposit +#: selection:account.check.deposit,state:0 +msgid "Done" +msgstr "Terminé" + +#. module: account_check_deposit +#: view:account.check.deposit:0 +msgid "Cancel" +msgstr "Annuler" + +#. module: account_check_deposit +#: selection:account.check.deposit,state:0 +msgid "Draft" +msgstr "Brouillon" + +#. module: account_check_deposit +#: report:addons/account_check_deposit/report/check_deposit.mako:99 +msgid "Total:" +msgstr "Total:" + +#. module: account_check_deposit +#: field:account.check.deposit,move_id:0 +msgid "Journal Entry" +msgstr "Pièce Comptable" + +#. module: account_check_deposit +#: field:account.check.deposit,journal_id:0 +msgid "Journal" +msgstr "Journal" + +#. module: account_check_deposit +#: model:ir.model,name:account_check_deposit.model_account_move_line +msgid "Journal Items" +msgstr "Écritures comptables" + diff --git a/account_check_deposit/report/.directory b/account_check_deposit/report/.directory new file mode 100644 index 000000000..616766eae --- /dev/null +++ b/account_check_deposit/report/.directory @@ -0,0 +1,6 @@ +[Dolphin] +AdditionalInfoV2=Details_Size,Details_Date,CustomizedDetails +Sorting=2 +Timestamp=2012,3,5,14,27,49 +Version=2 +ViewMode=1 diff --git a/account_check_deposit/report/.mako b/account_check_deposit/report/.mako new file mode 100644 index 000000000..63e5128f9 --- /dev/null +++ b/account_check_deposit/report/.mako @@ -0,0 +1,275 @@ + + + + + + + + <% + def carriage_returns(text): + return text.replace('\n', '
') + %> + + %for order in objects : +
+ <% setLang(order.partner_id.lang) %> + + %if order.company_id.address_label_position == 'left': + + + + + + %endif + + %if order.company_id.address_label_position == 'right' or not order.company_id.address_label_position: + + + + + %endif +
+${_("Shipping Address")} +
+
+${order.partner_shipping_id.address_label}
+           
+         
+ %if order.partner_id.address_label != order.partner_shipping_id.address_label: +${_("Ordering Contact")}
+${order.partner_id.address_label|carriage_returns} + %endif + %if order.partner_id.phone : +${_("Phone")}: ${order.partner_id.phone|entity}
+ %endif + %if order.partner_id.fax : +${_("Fax")}: ${order.partner_id.fax|entity}
+ %endif + %if order.partner_id.email : +${_("Mail")}: ${order.partner_id.email|entity}
+ %endif + %if order.partner_invoice_id.address_label != order.partner_shipping_id.address_label: +
+${_("Invoice Address")}
+${order.partner_invoice_id.address_label|carriage_returns} + %endif + %if order.partner_invoice_id.partner_id.vat : +${_("VAT")}: ${order.partner_invoice_id.partner_id.vat|entity}
+ %endif + +
+ %if order.partner_id.address_label != order.partner_shipping_id.address_label: +${_("Ordering Contact")}
+
+${order.partner_id.address_label|carriage_returns} + %endif + %if order.partner_id.phone : +${_("Tel")}: ${order.partner_id.phone|entity}
+ %endif + %if order.partner_id.fax : +${_("Fax")}: ${order.partner_id.fax|entity}
+ %endif + %if order.partner_id.email : +${_("E-mail")}: ${order.partner_id.email|entity}
+ %endif + %if order.partner_invoice_id.address_label != order.partner_shipping_id.address_label: +
+
+${_("Invoice Address")}
+
+${order.partner_invoice_id.address_label|carriage_returns} + %endif + %if order.partner_invoice_id.vat : +${_("VAT")}: ${order.partner_invoice_id.vat|entity}
+ %endif + +
+${_("Shipping Address")}
+
+
+${order.partner_shipping_id.address_label}
+           
+         
+ +
+
+ + %if order.state == 'draft' : + ${_("Quotation N°")} ${order.name or ''|entity} + %elif order.state == 'cancel' : + ${_("Sale Order Canceled")} ${order.name or ''|entity} + %else : + ${_("Order N°")} ${order.name or ''|entity} + %endif +
+ + + %if order.client_order_ref: + + %endif + %if order.project_id: + + %endif + + %if order.carrier_id: + + %endif + %if order.user_id: + + %endif + %if order.payment_term : + + %endif + %if order.incoterm: + + %endif + + + + + %if order.client_order_ref: + + %endif + %if order.project_id: + + %endif + %if order.date_order: + + %endif + %if order.carrier_id: + + %endif + %if order.user_id : + + %endif + %if order.payment_term : + + %endif + %if order.incoterm: + + %endif + + +
${_("Reference")}${_("Projekt")}${_("Order Date")}${_("Carrier")}${_("Salesman")}${_("Payment Term")}${_("Incoterm")}${_("Curr")}
+ ${order.client_order_ref} + ${order.project_id.name} + ${order.date_order or ''} + ${order.carrier_id.name } + ${order.user_id.name or ''}${order.payment_term.name}${order.incoterm.name}${order.pricelist_id.currency_id.name}
+


+ + + +%if order.print_code: + + +%else: + +%endif + +%if order.print_uom: + +%endif +%if order.print_uos: + +%endif +%if order.print_ean: + +%endif +%if order.print_packing: + + +%endif + +%if order.print_discount: + +%endif + + + + %for line in order.order_line_sorted : + + +%if order.print_code: + + +%else: + ${ ', '.join([tax.name or '' for tax in line.tax_id]) } +%if order.print_uom: + + +%endif +%if order.print_uos: + + +%endif +%if order.print_ean: + +%endif +%if order.print_packing: + + +%endif + +%if order.print_discount: + + + %endfor + + + + + + + + + + + + + + + + +
${_("Code")}${_("Description")}${_("Description")}${_("Tax")}${_("Quantity")}${_("UoM")}${_("UoS Qty")}${_("UoS")}${_("EAN")}${_("Pack")}${_("Packaging")}${_("Price Unit")}${_("Discount")}${_("Sub Total")}
${line.product_id.default_code or ''|entity} +${line.product_id.name or line.name|entity} + + +${line.name|entity} + + ${str(line.product_uom_qty).replace(',000','') or '0'}${line.product_uom.name or ''}${str(line.product_uos_qty).replace(',000','') or '0'}${line.product_uos.name or ''}${line.product_packaging.ean or line.product_id.ean13 or ''}${line.product_packaging.qty and line.product_uom_qty/line.product_packaging.qty or ''}${line.product_packaging and line.product_packaging.ul.name or ''} ${line.product_packaging and _(" / " or '')} ${line.product_packaging and line.product_packaging.qty or ''} ${line.product_packaging and line.product_id.uom_id.name or ''}${line.price_unit or ''}${line.discount} +%endif + ${line.price_subtotal or ''}
+ ${_("Net Total:")}${formatLang(order.amount_untaxed, get_digits(dp='Sale Price'))}
+ ${_("Taxes:")}${formatLang(order.amount_tax, get_digits(dp='Sale Price'))}
+ ${_("Total:")}${formatLang(order.amount_total, get_digits(dp='Sale Price'))}
+ +%if order.note and 'note_print' not in order._columns: +
+
${order.note}
+%endif: +%if 'note_print' in order._columns and order.note_print: +
+
${order.note_print}
+%endif: + + +

+ %endfor + + diff --git a/account_check_deposit/report/__init__.py b/account_check_deposit/report/__init__.py new file mode 100644 index 000000000..285cd87c3 --- /dev/null +++ b/account_check_deposit/report/__init__.py @@ -0,0 +1,32 @@ + #-*- coding: utf-8 -*- +############################################################################## +# +# Copyright (c) 2010 Camptocamp SA (http://www.camptocamp.com) +# All Right Reserved +# +# Author : Ferdinand Gassauer (Camptocamp Austria) +# +# 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 report_webkit_html diff --git a/account_check_deposit/report/check_deposit.mako b/account_check_deposit/report/check_deposit.mako new file mode 100644 index 000000000..f2b5afe19 --- /dev/null +++ b/account_check_deposit/report/check_deposit.mako @@ -0,0 +1,112 @@ +# -*- coding: utf-8 -*- + + + + + +%for deposit in objects : +<% setLang(deposit.partner_id.lang) %> +${_("Deposit Slip of Checks(Euros)")} +
+
+
+
+
+
+

+${_("Deposit N°")} ${deposit.name} +

+ +

+${_("Deposit Date")}${_("|")} + ${deposit.deposit_date} +${_("Bank Code")} +${_("|")} ${deposit.bank_id.bank_code} +
+${_("Beneficiary")}${_("|")} + ${company.partner_id.name} +${_("Office Code")} +${_("|")} ${deposit.bank_id.office} +
+${_("Account to crediting")}${_("|")} + ${deposit.bank_id.rib_acc_number} +${_("BIS Key")}${_("|")} + ${deposit.bank_id.key} +

+
+

+${_("Check Payments")} +

+ + + + + + + + + + + + +
+ %for move_line in deposit.check_payment_ids : + + + + + + + + + + %endfor + %endfor + + + + + + +
${_("Payment Date")}${_("Reference")}${_("Description")}${_("Designation")}${_("Amount")}
${move_line.date or ''}${move_line.ref or ''}${move_line.name or ''}${move_line.partner_id.name or ''}${move_line.debit or '0'}
${_("Total:")}${deposit.total_amount or '0'}
+ + + + + + + + + diff --git a/account_check_deposit/report/report_webkit_html.py b/account_check_deposit/report/report_webkit_html.py new file mode 100644 index 000000000..459915868 --- /dev/null +++ b/account_check_deposit/report/report_webkit_html.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# Copyright (C) 2010-2012 Camptocamp Austria () +# Copyright (C) 2013 AKRETION () +# +# 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 . +# +############################################################################## + +import time +from report import report_sxw +from osv import osv + +class report_webkit_html(report_sxw.rml_parse): + def __init__(self, cr, uid, name, context): + super(report_webkit_html, self).__init__(cr, uid, name, context=context) + self.localcontext.update({ + 'time': time, + 'cr':cr, + 'uid': uid, + }) + +report_sxw.report_sxw('report.account.check.deposit', + 'account.check.deposit', + 'addons/account_check_deposit/report/check_deposit.mako', + parser=report_webkit_html)