Merge lp:~openerp/openobject-addons/5.0-certified-addons into lp:openobject-addons
- 5.0-certified-addons
- Merge into trunk
Status: | Rejected |
---|---|
Rejected by: | Fabien (Open ERP) |
Proposed branch: | lp:~openerp/openobject-addons/5.0-certified-addons |
Merge into: | lp:openobject-addons |
Diff against target: |
32674 lines (+31330/-0) (has conflicts) 249 files modified
.bzrignore (+2/-0) account_invoice_cash_discount/__init__.py (+27/-0) account_invoice_cash_discount/__terp__.py (+48/-0) account_invoice_cash_discount/account_invoice_cash_discount.py (+1179/-0) account_invoice_cash_discount/account_invoice_cash_discount_view.xml (+268/-0) account_invoice_cash_discount/account_invoice_cash_discount_wizard.xml (+30/-0) account_invoice_cash_discount/i18n/account_invoice_cash_discount.pot (+673/-0) account_invoice_cash_discount/i18n/de_DE.po (+675/-0) account_invoice_cash_discount/security/ir.model.access.csv (+22/-0) account_invoice_cash_discount/wizard/__init__.py (+29/-0) account_invoice_cash_discount/wizard/account_pay_invoice.py (+651/-0) account_invoice_cash_discount/wizard/account_pay_invoice_view.xml (+135/-0) account_invoice_cash_discount/wizard/invoice_statement_payment.py (+288/-0) account_invoice_cash_discount/wizard/wizard_discount_reconcile.py (+291/-0) account_invoice_cash_discount/wizard/wizard_write_period_entry_calculation.py (+188/-0) account_payment_discount_extension/__init__.py (+24/-0) account_payment_discount_extension/__terp__.py (+44/-0) account_payment_discount_extension/account_payment_discount.py (+115/-0) account_payment_discount_extension/account_payment_discount_data.xml (+15/-0) account_payment_discount_extension/account_payment_discount_view.xml (+138/-0) account_payment_discount_extension/account_payment_disocunt_wizard.xml (+27/-0) account_payment_discount_extension/i18n/account_payment_discount_extension.pot (+176/-0) account_payment_discount_extension/i18n/de_DE.po (+176/-0) account_payment_discount_extension/wizard/__init__.py (+28/-0) account_payment_discount_extension/wizard/wizard_discount_pay.py (+84/-0) account_payment_discount_extension/wizard/wizard_next_payment_date.py (+82/-0) account_payment_discount_extension/wizard/wizard_payment_discount_order.py (+249/-0) account_payment_extension/__init__.py (+34/-0) account_payment_extension/__terp__.py (+37/-0) account_payment_extension/account_invoice.py (+83/-0) account_payment_extension/account_move_line.py (+136/-0) account_payment_extension/i18n/account_payment_extension.pot (+201/-0) account_payment_extension/i18n/ca_ES.po (+201/-0) account_payment_extension/i18n/es_ES.po (+201/-0) account_payment_extension/payment.py (+144/-0) account_payment_extension/payment_sequence.xml (+16/-0) account_payment_extension/payment_view.xml (+428/-0) account_payment_extension/payment_wizard.xml (+6/-0) account_payment_extension/wizard/__init__.py (+26/-0) account_payment_extension/wizard/wizard_payment_order.py (+157/-0) base_external_referentials/__init__.py (+2/-0) base_external_referentials/__terp__.py (+56/-0) base_external_referentials/base_external_referentials.py (+238/-0) base_external_referentials/base_external_referentials_view.xml (+92/-0) base_external_referentials/external_osv.py (+349/-0) base_external_referentials/i18n/base_external_referentials.pot (+337/-0) base_external_referentials/i18n/ca_ES.po (+350/-0) base_external_referentials/i18n/es_ES.po (+350/-0) base_sale_multichannels/__init__.py (+1/-0) base_sale_multichannels/__terp__.py (+59/-0) base_sale_multichannels/i18n/base_sale_multichannels.pot (+306/-0) base_sale_multichannels/i18n/ca.po (+378/-0) base_sale_multichannels/i18n/ca_ES.po (+333/-0) base_sale_multichannels/i18n/es.po (+379/-0) base_sale_multichannels/i18n/es_ES.po (+334/-0) base_sale_multichannels/sale.py (+267/-0) base_sale_multichannels/sale_view.xml (+79/-0) bom_search_product/__init__.py (+20/-0) bom_search_product/__terp__.py (+40/-0) bom_search_product/wizard.xml (+16/-0) bom_search_product/wizard/__init__.py (+20/-0) bom_search_product/wizard/bom_search_product.py (+84/-0) magentoerpconnect/__init__.py (+27/-0) magentoerpconnect/__terp__.py (+56/-0) magentoerpconnect/delivery.py (+41/-0) magentoerpconnect/delivery_view.xml (+21/-0) magentoerpconnect/i18n/ca_ES.po (+1606/-0) magentoerpconnect/i18n/es_ES.po (+1609/-0) magentoerpconnect/i18n/magentoerpconnect.pot (+1606/-0) magentoerpconnect/i18n/x_magaerp.pot (+201/-0) magentoerpconnect/invoice.py (+32/-0) magentoerpconnect/magerp_core.py (+202/-0) magentoerpconnect/magerp_core_view.xml (+144/-0) magentoerpconnect/magerp_data.xml (+110/-0) magentoerpconnect/magerp_menu.xml (+19/-0) magentoerpconnect/magerp_osv.py (+267/-0) magentoerpconnect/partner.py (+62/-0) magentoerpconnect/partner_view.xml (+49/-0) magentoerpconnect/product.py (+921/-0) magentoerpconnect/product_images.py (+116/-0) magentoerpconnect/product_images_view.xml (+25/-0) magentoerpconnect/product_view.xml (+281/-0) magentoerpconnect/sale.py (+419/-0) magentoerpconnect/sale_view.xml (+69/-0) magentoerpconnect/security/ir.model.access.csv (+8/-0) magentoerpconnect/settings/external.mapping.template.csv (+14/-0) magentoerpconnect/settings/external.mappinglines.template.csv (+229/-0) magentoerpconnect/settings/external.referential.type.csv (+2/-0) magentoerpconnect/settings/magerp_product_product_type.xml (+29/-0) magentoerpconnect/stock.py (+95/-0) mrp_prodlot_autosplit/__init__.py (+2/-0) mrp_prodlot_autosplit/__terp__.py (+47/-0) mrp_prodlot_autosplit/product.py (+14/-0) mrp_prodlot_autosplit/product_view.xml (+18/-0) mrp_prodlot_autosplit/stock.py (+88/-0) mrp_prodlot_autosplit/stock_view.xml (+49/-0) multi_dealers/__init__.py (+20/-0) multi_dealers/__terp__.py (+46/-0) multi_dealers/multi_dealers.py (+409/-0) multi_dealers/multi_dealers_view.xml (+126/-0) multi_dealers/multi_dealers_workflow.xml (+32/-0) multi_dealers/security/multi_dealers_security.xml (+24/-0) packing_barcode_check/__init__.py (+26/-0) packing_barcode_check/__terp__.py (+51/-0) packing_barcode_check/i18n/de_DE.po (+265/-0) packing_barcode_check/i18n/packing_barcode_check.pot (+261/-0) packing_barcode_check/packing_barcode_check.py (+173/-0) packing_barcode_check/packing_barcode_check_report.xml (+13/-0) packing_barcode_check/packing_barcode_check_view.xml (+89/-0) packing_barcode_check/packing_barcode_check_wizard.xml (+11/-0) packing_barcode_check/packing_barcode_check_workflow.xml (+30/-0) packing_barcode_check/report/__init__.py (+26/-0) packing_barcode_check/report/bar_code_check.py (+35/-0) packing_barcode_check/report/bar_code_check.rml (+127/-0) packing_barcode_check/security/ir.model.access.csv (+5/-0) packing_barcode_check/wizard/__init__.py (+27/-0) packing_barcode_check/wizard/scan_product.py (+174/-0) packing_barcode_check/wizard/select_picking.py (+82/-0) pos_tax_include/__init__.py (+1/-0) pos_tax_include/__terp__.py (+20/-0) pos_tax_include/pos.py (+136/-0) pos_tax_include/pos.xml (+25/-0) product_ean13_generator/__init__.py (+27/-0) product_ean13_generator/__terp__.py (+51/-0) product_ean13_generator/i18n/de_DE.po (+124/-0) product_ean13_generator/i18n/product_ean13_generator.pot (+118/-0) product_ean13_generator/product_ean13_generator.py (+59/-0) product_ean13_generator/product_ean13_generator_report.xml (+12/-0) product_ean13_generator/product_ean13_generator_sequence.xml (+48/-0) product_ean13_generator/product_ean13_generator_wizard.xml (+11/-0) product_ean13_generator/report/__init__.py (+25/-0) product_ean13_generator/report/product_ean_generator_report.rml (+120/-0) product_ean13_generator/report/report_product_ean_sequencer.py (+35/-0) product_ean13_generator/security/ir.model.access.csv (+1/-0) product_ean13_generator/wizard/__init__.py (+25/-0) product_ean13_generator/wizard/generator_ean13.py (+84/-0) product_images_olbs/__init__.py (+19/-0) product_images_olbs/__terp__.py (+42/-0) product_images_olbs/product.py (+28/-0) product_images_olbs/product_images.py (+56/-0) product_images_olbs/security/ir.model.access.csv (+2/-0) product_images_olbs/views/product_images_view.xml (+58/-0) product_m2mcategories/__init__.py (+18/-0) product_m2mcategories/__terp__.py (+40/-0) product_m2mcategories/i18n/ca.po (+65/-0) product_m2mcategories/i18n/ca_ES.po (+58/-0) product_m2mcategories/i18n/es.po (+64/-0) product_m2mcategories/i18n/es_ES.po (+58/-0) product_m2mcategories/i18n/product_m2mcategories.pot (+52/-0) product_m2mcategories/product.py (+25/-0) product_m2mcategories/product_view.xml (+21/-0) product_price_information/__init__.py (+27/-0) product_price_information/__terp__.py (+45/-0) product_price_information/i18n/de_DE.po (+245/-0) product_price_information/i18n/product_price_information.pot (+244/-0) product_price_information/product_price_info.py (+188/-0) product_price_information/product_price_info_view.xml (+113/-0) product_price_information/security/ir.model.access.csv (+3/-0) product_price_information/wizard/__init__.py (+26/-0) product_price_information/wizard/sale_prize_information.py (+99/-0) product_price_information/wizard/sale_prize_information_view.xml (+60/-0) product_tax_include/.license (+21/-0) product_tax_include/__init__.py (+28/-0) product_tax_include/__terp__.py (+52/-0) product_tax_include/i18n/ca.po (+78/-0) product_tax_include/i18n/de_DE.po (+72/-0) product_tax_include/i18n/es.po (+79/-0) product_tax_include/i18n/fr.po (+71/-0) product_tax_include/i18n/fr_FR.po (+66/-0) product_tax_include/i18n/product_tax_include.pot (+66/-0) product_tax_include/i18n/pt.po (+77/-0) product_tax_include/object/__init__.py (+27/-0) product_tax_include/object/company.py (+40/-0) product_tax_include/object/product.py (+74/-0) product_tax_include/view/company.xml (+41/-0) product_tax_include/view/product.xml (+38/-0) profile_artdeceau/__init__.py (+4/-0) profile_artdeceau/__terp__.py (+60/-0) profile_artdeceau/artdeceau.xml (+52/-0) profile_artdeceau/report/invoice.rml (+200/-0) profile_artdeceau/report/invoice_pos.rml (+128/-0) profile_artdeceau/report/pos_lines.rml (+286/-0) profile_artdeceau/report/pos_receipt.rml (+181/-0) profile_artdeceau/report/purchase.rml (+228/-0) profile_artdeceau/sale_crm.py (+9/-0) profile_artdeceau/screens.py (+106/-0) profile_artdeceau/screens_view.xml (+141/-0) sale_invoice_collector/__init__.py (+1/-0) sale_invoice_collector/__terp__.py (+28/-0) sale_invoice_collector/sale.py (+288/-0) sale_invoice_collector/sale.xml (+71/-0) sale_order_report_extended/__init__.py (+20/-0) sale_order_report_extended/__terp__.py (+45/-0) sale_order_report_extended/report/sale.rml (+327/-0) sale_order_report_extended/sale_order_report_extended.py (+76/-0) sale_order_report_extended/sale_order_report_extended.xml (+13/-0) sale_order_report_extended/sale_order_report_extended_view.xml (+68/-0) sale_order_template/__init__.py (+2/-0) sale_order_template/__terp__.py (+41/-0) sale_order_template/sale.py (+66/-0) sale_order_template/sale.xml (+46/-0) sale_order_template/wizard.xml (+10/-0) sale_order_template/wizard/__init__.py (+20/-0) sale_order_template/wizard/import_template.py (+76/-0) sale_tax_include/__init__.py (+25/-0) sale_tax_include/__terp__.py (+42/-0) sale_tax_include/i18n/de_DE.po (+65/-0) sale_tax_include/i18n/fr.po (+60/-0) sale_tax_include/i18n/fr_BE.po (+56/-0) sale_tax_include/i18n/fr_FR.po (+60/-0) sale_tax_include/i18n/sale_tax_include.pot (+61/-0) sale_tax_include/sale_tax_incl.py (+132/-0) sale_tax_include/sale_tax_incl.xml (+30/-0) sale_tender/__init__.py (+24/-0) sale_tender/__terp__.py (+40/-0) sale_tender/sale_tender.py (+42/-0) sale_tender/sale_tender_view.xml (+4/-0) sales_shop_stock_availability/__init__.py (+27/-0) sales_shop_stock_availability/__terp__.py (+46/-0) sales_shop_stock_availability/i18n/de_DE.po (+156/-0) sales_shop_stock_availability/i18n/sales_shop_stock_availability.pot (+151/-0) sales_shop_stock_availability/sales_shop_stock_availability.py (+81/-0) sales_shop_stock_availability/sales_shop_stock_availability_view.xml (+58/-0) sales_shop_stock_availability/security/ir.model.access.csv (+3/-0) sales_shop_stock_availability/wizard/__init__.py (+25/-0) sales_shop_stock_availability/wizard/stock_shop_availability.py (+72/-0) sales_shop_stock_availability/wizard/stock_shop_availability_view.xml (+48/-0) seasonal_orderpoint/__init__.py (+1/-0) seasonal_orderpoint/__terp__.py (+23/-0) seasonal_orderpoint/i18n/fr_FR.po (+303/-0) seasonal_orderpoint/orderpoint.py (+62/-0) seasonal_orderpoint/seasonal_orderpoint_view.xml (+31/-0) stock_minimum_calculator/__init__.py (+27/-0) stock_minimum_calculator/__terp__.py (+45/-0) stock_minimum_calculator/i18n/de_DE.po (+309/-0) stock_minimum_calculator/i18n/stock_minimum_calculator.pot (+307/-0) stock_minimum_calculator/security/ir.model.access.csv (+9/-0) stock_minimum_calculator/stock_minimum_calculator.py (+77/-0) stock_minimum_calculator/stock_minimum_calculator_demo.xml (+15/-0) stock_minimum_calculator/stock_minimum_calculator_sequence.xml (+17/-0) stock_minimum_calculator/stock_minimum_calculator_view.xml (+119/-0) stock_minimum_calculator/stock_minimum_calculator_wizard.xml (+17/-0) stock_minimum_calculator/supplier_cost_optimated_leadtimes.py (+69/-0) stock_minimum_calculator/supplier_cost_optimated_leadtimes_view.xml (+46/-0) stock_minimum_calculator/supplier_cost_optimized_leadtimes.py (+67/-0) stock_minimum_calculator/supplier_cost_optimized_leadtimes_view.xml (+43/-0) stock_minimum_calculator/wizard/__init__.py (+27/-0) stock_minimum_calculator/wizard/seasonal_trend_set.py (+79/-0) stock_minimum_calculator/wizard/stock_order_point_calculator.py (+374/-0) Conflict adding file .bzrignore. Moved existing file to .bzrignore.moved. |
To merge this branch: | bzr merge lp:~openerp/openobject-addons/5.0-certified-addons |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
OpenERP Core Team | Pending | ||
Review via email: mp+69732@code.launchpad.net |
Commit message
Description of the change
Fabien (Open ERP) (fp-tinyerp) wrote : | # |
Unmerged revisions
- 13. By Olivier Laurent (Open ERP)
-
[CERT] added certificate numbers to artdeceau modules
- 12. By Olivier Laurent (Open ERP)
-
[ADD] added artdeceau modules
- 11. By Olivier Laurent (Open ERP)
-
[CERT] added certificates
- 10. By Olivier Laurent (Open ERP)
-
[CERT] new certified modules
- 9. By Stephane Wirtel (OpenERP)
-
[CERTIFICATION] Add the mrp_prodlot_
autosplit module from lp:~openerp-commiter/openobject-addons/stable_5.0-extra-addons - 8. By Stephane Wirtel (OpenERP)
-
[CERTIFICATION] Add the product_
m2mcategories module from lp:~openerp-commiter/openobject-addons/stable_5.0-extra-addons - 7. By Stephane Wirtel (OpenERP)
-
[CERTIFICATION] Add the base_external_
referentials module from lp:~openerp-commiter/openobject-addons/stable_5.0-extra-addons - 6. By Stephane Wirtel (OpenERP)
-
[CERTIFICATION] Add the account_
payment_ extension module from lp:~openerp-commiter/openobject-addons/stable_5.0-extra-addons - 5. By Stephane Wirtel (OpenERP)
-
[CERTIFICATION] Add the base_sale_
multichannels module from lp:~openerp-commiter/openobject-addons/stable_5.0-extra-addons - 4. By Stephane Wirtel (OpenERP)
-
[CERTIFICATION] Add the product_images_olbs module from lp:~openerp-commiter/openobject-addons/stable_5.0-extra-addons
Preview Diff
1 | === added file '.bzrignore' |
2 | --- .bzrignore 1970-01-01 00:00:00 +0000 |
3 | +++ .bzrignore 2011-07-29 01:35:58 +0000 |
4 | @@ -0,0 +1,2 @@ |
5 | +.project |
6 | +.pydevproject |
7 | |
8 | === renamed file '.bzrignore' => '.bzrignore.moved' |
9 | === added file 'README' |
10 | === added directory 'account_invoice_cash_discount' |
11 | === added file 'account_invoice_cash_discount/__init__.py' |
12 | --- account_invoice_cash_discount/__init__.py 1970-01-01 00:00:00 +0000 |
13 | +++ account_invoice_cash_discount/__init__.py 2011-07-29 01:35:58 +0000 |
14 | @@ -0,0 +1,27 @@ |
15 | +# -*- encoding: utf-8 -*- |
16 | +############################################################################## |
17 | +# |
18 | +# OpenERP, Open Source Management Solution |
19 | +# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved |
20 | +# $Id$ |
21 | +# |
22 | +# This program is free software: you can redistribute it and/or modify |
23 | +# it under the terms of the GNU General Public License as published by |
24 | +# the Free Software Foundation, either version 3 of the License, or |
25 | +# (at your option) any later version. |
26 | +# |
27 | +# This program is distributed in the hope that it will be useful, |
28 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
29 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
30 | +# GNU General Public License for more details. |
31 | +# |
32 | +# You should have received a copy of the GNU General Public License |
33 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
34 | +# |
35 | +############################################################################## |
36 | + |
37 | +import wizard |
38 | +import account_invoice_cash_discount |
39 | + |
40 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
41 | + |
42 | |
43 | === added file 'account_invoice_cash_discount/__terp__.py' |
44 | --- account_invoice_cash_discount/__terp__.py 1970-01-01 00:00:00 +0000 |
45 | +++ account_invoice_cash_discount/__terp__.py 2011-07-29 01:35:58 +0000 |
46 | @@ -0,0 +1,48 @@ |
47 | +# -*- encoding: utf-8 -*- |
48 | +############################################################################## |
49 | +# |
50 | +# OpenERP, Open Source Management Solution |
51 | +# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved |
52 | +# $Id$ |
53 | +# |
54 | +# This program is free software: you can redistribute it and/or modify |
55 | +# it under the terms of the GNU General Public License as published by |
56 | +# the Free Software Foundation, either version 3 of the License, or |
57 | +# (at your option) any later version. |
58 | +# |
59 | +# This program is distributed in the hope that it will be useful, |
60 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
61 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
62 | +# GNU General Public License for more details. |
63 | +# |
64 | +# You should have received a copy of the GNU General Public License |
65 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
66 | +# |
67 | +############################################################################## |
68 | +{ |
69 | + "name" : "Payment Term with Cash Discount", |
70 | + "version" : "1.0", |
71 | + "depends" : ["account","account_payment_discount_extension"], |
72 | + "author" : "Big Consulting", |
73 | + "website" : "http://www.openbig.org", |
74 | + "category" : "", |
75 | + "description": """ |
76 | + Module to add account move lines in case of payment with cash discount conditions in reconcilation form. |
77 | + """, |
78 | + "init_xml" : [ |
79 | + ], |
80 | + "demo_xml" : [ |
81 | + ], |
82 | + "update_xml" : [ |
83 | + "security/ir.model.access.csv", |
84 | + 'wizard/account_pay_invoice_view.xml', |
85 | + "account_invoice_cash_discount_wizard.xml", |
86 | + "account_invoice_cash_discount_view.xml", |
87 | + ], |
88 | + "active": False, |
89 | + "installable": True, |
90 | + 'certificate': '001146321429795267965', |
91 | + |
92 | +} |
93 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
94 | + |
95 | |
96 | === added file 'account_invoice_cash_discount/account_invoice_cash_discount.py' |
97 | --- account_invoice_cash_discount/account_invoice_cash_discount.py 1970-01-01 00:00:00 +0000 |
98 | +++ account_invoice_cash_discount/account_invoice_cash_discount.py 2011-07-29 01:35:58 +0000 |
99 | @@ -0,0 +1,1179 @@ |
100 | +# -*- encoding: utf-8 -*- |
101 | +############################################################################## |
102 | +# |
103 | +# OpenERP, Open Source Management Solution |
104 | +# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved |
105 | +# $Id$ |
106 | +# |
107 | +# This program is free software: you can redistribute it and/or modify |
108 | +# it under the terms of the GNU General Public License as published by |
109 | +# the Free Software Foundation, either version 3 of the License, or |
110 | +# (at your option) any later version. |
111 | +# |
112 | +# This program is distributed in the hope that it will be useful, |
113 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
114 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
115 | +# GNU General Public License for more details. |
116 | +# |
117 | +# You should have received a copy of the GNU General Public License |
118 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
119 | +# |
120 | +############################################################################## |
121 | + |
122 | +from osv import fields, osv |
123 | +from tools import config |
124 | +import time |
125 | +from tools.translate import _ |
126 | +import netsvc |
127 | + |
128 | +class account_payment_term(osv.osv): |
129 | + _name = "account.payment.term" |
130 | + _inherit = "account.payment.term" |
131 | + _columns = { |
132 | + 'cash_discount_ids': fields.one2many('account.cash.discount', 'payment_id', 'Cash Discount Terms'), |
133 | + } |
134 | +account_payment_term() |
135 | + |
136 | +class account_cash_discount(osv.osv): |
137 | + _name = "account.cash.discount" |
138 | + _description = "Cash Discount" |
139 | + _order ="delay" |
140 | + _columns = { |
141 | + 'name': fields.char('Name', size=32), |
142 | + 'delay': fields.integer('Number of Days', required=True), |
143 | + 'discount': fields.float('Discount (%)', digits=(16,2), required=True), |
144 | + 'discount_account_id': fields.many2one('account.account', 'Customer Discount Account', required=True), |
145 | + 'sup_discount_account_id': fields.many2one('account.account', 'Supplier Discount Account', required=True), |
146 | + 'payment_id': fields.many2one('account.payment.term', 'Related Payment Term'), |
147 | + } |
148 | +account_cash_discount() |
149 | + |
150 | +class account_payment_term_line(osv.osv): |
151 | + _inherit = "account.payment.term.line" |
152 | + _columns = { |
153 | + 'day_tolerance': fields.integer('Tolerance (Days)', digits=(16,0)), |
154 | + 'payment_id': fields.many2one('account.payment.term', 'Payment Term', required=False, select=True), |
155 | + 'compl_cash_discount': fields.boolean('Use Complete Cash Discount'), |
156 | + } |
157 | + _defaults = { |
158 | + 'day_tolerance': lambda *a: 0, |
159 | + } |
160 | +account_payment_term_line() |
161 | + |
162 | +class account_invoice(osv.osv): |
163 | + _inherit = "account.invoice" |
164 | + |
165 | + def _get_amount(self, cr, uid, ids, residual_amount, payment_term, context=None): |
166 | + """ |
167 | + This function returns the amount to be paid according to the cash discount payment term for the corresponding payment term |
168 | + """ |
169 | + if context is None: |
170 | + context = {} |
171 | + tax_obj = self.pool.get('account.tax') |
172 | + invoice = self.browse(cr, uid, ids[0], context=context) |
173 | + |
174 | + date1 = invoice.date_invoice or time.strftime('%Y-%m-%d') |
175 | + date2 = 'date_p' in context and context['date_p'] or time.strftime('%Y-%m-%d') |
176 | + from_dt = time.mktime(time.strptime(date1, '%Y-%m-%d')) |
177 | + to_dt = time.mktime(time.strptime(date2, '%Y-%m-%d')) |
178 | + diff_day = abs(from_dt - to_dt) / (3600 * 24) |
179 | + |
180 | + discount = amount = tol_days = 0.0 |
181 | + payment_line_found = False |
182 | + |
183 | + if payment_term: |
184 | + payment_term_lines = self.pool.get('account.payment.term').browse(cr, uid, payment_term, context=context) |
185 | + if payment_term_lines.line_ids: |
186 | + res = dis = 0.0 |
187 | + for payment_line in payment_term_lines.line_ids: |
188 | + if diff_day >= dis and diff_day <= payment_line.days: |
189 | + if residual_amount: |
190 | + payment_line_found = True |
191 | + tol_days = payment_line.day_tolerance |
192 | + if payment_line.value == 'procent': |
193 | + res = round((residual_amount * payment_line.value_amount), int(config['price_accuracy'])) |
194 | + elif payment_line.value == 'fixed': |
195 | + res = payment_line.value_amount |
196 | + else: |
197 | + res = residual_amount |
198 | + amount = res |
199 | + dis = payment_line.days |
200 | + else: |
201 | + amount = residual_amount |
202 | + |
203 | + return {'amount': amount, 'tol_days': tol_days, 'found': payment_line_found} |
204 | + |
205 | + def _get_payment(self, cr, uid, ids, residual_amount, payment_term, context=None): |
206 | + """ |
207 | + This function returns the cash discount according to the cash discount payment term for the corresponding payment term |
208 | + """ |
209 | + if context is None: |
210 | + context = {} |
211 | + |
212 | + tax_obj = self.pool.get('account.tax') |
213 | + invoice = self.browse(cr, uid, ids[0], context=context) |
214 | + |
215 | + date1 = invoice.date_invoice or time.strftime('%Y-%m-%d') |
216 | + date2 = 'date_p' in context and context['date_p'] or time.strftime('%Y-%m-%d') |
217 | + from_dt = time.mktime(time.strptime(date1, '%Y-%m-%d')) |
218 | + to_dt = time.mktime(time.strptime(date2, '%Y-%m-%d')) |
219 | + diff_day = abs(from_dt - to_dt) / (3600 * 24) |
220 | + tolerance = self._get_amount(cr, uid, ids, residual_amount, payment_term, context) |
221 | + tolerance_days = tolerance['tol_days'] |
222 | + |
223 | + discount = 0.0 |
224 | + if payment_term: |
225 | + payment_term_lines = self.pool.get('account.payment.term').browse(cr, uid, payment_term, context=context) |
226 | + if payment_term_lines.cash_discount_ids: |
227 | + res = dis = 0.0 |
228 | + for discount_line in payment_term_lines.cash_discount_ids: |
229 | + if diff_day >= dis and diff_day <= discount_line.delay + tolerance_days: |
230 | + if residual_amount: |
231 | + res = round((residual_amount * discount_line.discount / 100), int(config['price_accuracy'])) |
232 | + discount = res |
233 | + dis = discount_line.delay + tolerance_days |
234 | + return discount |
235 | + |
236 | + def _get_account(self, cr, uid, ids, residual_amount, payment_term, context=None): |
237 | + """ |
238 | + This function returns the account according to the cash discount payment term for the corresponding payment term |
239 | + """ |
240 | + if context is None: |
241 | + context = {} |
242 | + |
243 | + account_id = False |
244 | + |
245 | + tax_obj = self.pool.get('account.tax') |
246 | + invoice = self.browse(cr, uid, ids[0], context=context) |
247 | + |
248 | + date1 = invoice.date_invoice or time.strftime('%Y-%m-%d') |
249 | + date2 = 'date_p' in context and context['date_p'] or time.strftime('%Y-%m-%d') |
250 | + from_dt = time.mktime(time.strptime(date1, '%Y-%m-%d')) |
251 | + to_dt = time.mktime(time.strptime(date2, '%Y-%m-%d')) |
252 | + diff_day = abs(from_dt - to_dt) / (3600 * 24) |
253 | + tolerance = self._get_amount(cr, uid, ids, residual_amount, payment_term, context) |
254 | + tolerance_days = tolerance['tol_days'] |
255 | + |
256 | + if payment_term: |
257 | + payment_term_lines = self.pool.get('account.payment.term').browse(cr, uid, payment_term, context=context) |
258 | + if payment_term_lines.cash_discount_ids: |
259 | + res = dis = 0.0 |
260 | + for discount_line in payment_term_lines.cash_discount_ids: |
261 | + if diff_day >= dis and diff_day <= discount_line.delay + tolerance_days: |
262 | + if invoice.type in ('in_invoice', 'in_refund'): |
263 | + account_id = discount_line.sup_discount_account_id.id |
264 | + else: |
265 | + account_id = discount_line.discount_account_id.id |
266 | + dis = discount_line.delay + tolerance_days |
267 | + return account_id |
268 | + |
269 | + def pay_and_reconcile(self, cr, uid, ids, pay_amount, pay_account_id, period_id, pay_journal_id, writeoff_acc_id, writeoff_period_id, writeoff_journal_id, context=None, name=''): |
270 | + if context is None: |
271 | + context = {} |
272 | + #TODO check if we can use different period for payment and the writeoff line |
273 | + assert len(ids) == 1, _("Can only pay one invoice at a time!") |
274 | + invoice = self.browse(cr, uid, ids[0]) |
275 | + |
276 | + invoice_tax_obj = self.pool.get("account.invoice.tax") |
277 | + journal_obj = self.pool.get('account.journal') |
278 | + move_obj = self.pool.get('account.move') |
279 | + move_line_obj = self.pool.get('account.move.line') |
280 | + move_line_obj_memory = self.pool.get('account.move.line.memory') |
281 | + tax_obj = self.pool.get('account.tax') |
282 | + cur_obj = self.pool.get('res.currency') |
283 | + res_users_obj = self.pool.get('res.user') |
284 | + |
285 | + # get discount from payment term if any |
286 | + amount_discount = invoice.payment_term and self._get_payment(cr, uid, ids, pay_amount, invoice.payment_term.id, context=context) or 0.0 |
287 | + journal_currency = journal_obj.browse(cr, uid, pay_journal_id, context=context).currency.id |
288 | + |
289 | + if not name: |
290 | + name = invoice.invoice_line and invoice.invoice_line[0].name or invoice.number |
291 | + src_account_id = invoice.account_id.id |
292 | + # Take the seq as name for move |
293 | + types = {'out_invoice': -1, 'in_invoice': 1, 'out_refund': 1, 'in_refund': -1} |
294 | + direction = types[invoice.type] |
295 | + #take the choosen date |
296 | + date = 'date_p' in context and context['date_p'] or time.strftime('%Y-%m-%d') |
297 | + |
298 | + # Take the amount in currency and the currency of the payment |
299 | + if 'amount_currency' in context and context['amount_currency'] and 'currency_id' in context and context['currency_id']: |
300 | + amount_currency = context['amount_currency'] |
301 | + currency_id = context['currency_id'] |
302 | + else: |
303 | + amount_currency = False |
304 | + currency_id = False |
305 | + |
306 | + if invoice.type in ('in_invoice', 'in_refund'): |
307 | + ref = invoice.reference |
308 | + else: |
309 | + ref = self._convert_ref(cr, uid, invoice.number) |
310 | + |
311 | + discount_amount = tax_total_amount = 0.0 |
312 | + if 'cash_amount' in context and context['cash_amount']: |
313 | + discount_amount = context['cash_amount'] |
314 | + elif 'pay_cash_discount' in context and context['pay_cash_discount']: |
315 | + discount_amount = context['pay_cash_discount'] |
316 | + |
317 | + # Pay attention to the sign for both debit/credit AND amount_currency |
318 | + l1 = { |
319 | + 'debit': direction * pay_amount > 0 and abs(pay_amount) or 0.0, |
320 | + 'credit': direction * pay_amount < 0 and abs(pay_amount) or 0.0, |
321 | + 'account_id': src_account_id, |
322 | + 'partner_id': invoice.partner_id.id, |
323 | + 'ref': ref, |
324 | + 'date': date, |
325 | + 'currency_id': currency_id, |
326 | + 'amount_currency': amount_currency and direction * amount_currency or 0.0, |
327 | + 'name': name, |
328 | + } |
329 | + |
330 | + ### if we change the amount paid and in the disocunt then it used the changes discount |
331 | + if amount_discount != discount_amount and discount_amount > 0.0: |
332 | + amount_discount = discount_amount |
333 | + l2 = { |
334 | + 'debit': direction * (pay_amount - amount_discount) < 0 and abs(pay_amount - amount_discount) or 0.0, |
335 | + 'credit': direction * (pay_amount - amount_discount) > 0 and abs(pay_amount - amount_discount) or 0.0, |
336 | + 'account_id': pay_account_id, |
337 | + 'partner_id': invoice.partner_id.id, |
338 | + 'ref': ref, |
339 | + 'date': date, |
340 | + 'currency_id': currency_id, |
341 | + 'amount_currency': amount_currency and -direction * amount_currency or 0.0, |
342 | + 'name': name, |
343 | + } |
344 | + |
345 | + lines = [(0, 0, l1), (0, 0, l2)] |
346 | + |
347 | + ### When we make payment by pay invoice wizard and if found the taxes move then directly take the entry from the wizard |
348 | + if 'tax_move_ids' in context and context['tax_move_ids']: |
349 | + move_line = context['tax_move_ids'] |
350 | + for move_line_id in move_line: |
351 | + move_line_data = move_line_obj_memory.browse(cr, uid,move_line_id) |
352 | + l3 = { |
353 | + 'debit': move_line_data.debit, |
354 | + 'credit': move_line_data.credit, |
355 | + 'account_id': move_line_data.account_id.id, |
356 | + 'partner_id': invoice.partner_id.id, |
357 | + 'ref': ref, |
358 | + 'date': move_line_data.date, |
359 | + 'currency_id': move_line_data.currency_id.id, |
360 | + 'amount_currency': move_line_data.amount_currency and direction * move_line_data.amount_currency or 0.0, |
361 | + 'name': move_line_data.name, |
362 | + 'tax_code_id': move_line_data.tax_code_id.id, |
363 | + 'tax_amount': move_line_data.tax_amount, |
364 | + } |
365 | + lines.append((0, 0, l3)) |
366 | + else: |
367 | + if amount_discount > 0.0: |
368 | + for line in invoice.invoice_line: |
369 | + line_tax_amount = 0.0 |
370 | + tax_account_id = tax_code_id = tax_base = tax_code = False |
371 | + |
372 | + for tax in tax_obj.compute(cr, uid, line.invoice_line_tax_id, line.price_subtotal / line.quantity, line.quantity, invoice.address_invoice_id.id, line.product_id, invoice.partner_id): |
373 | + line_tax_amount += tax['amount'] |
374 | + line_total = line.price_subtotal + line_tax_amount |
375 | + invoice_res_amount = invoice.amount_total |
376 | + line_ratio = line_total / invoice_res_amount |
377 | + |
378 | + if line.invoice_line_tax_id: |
379 | + total_tax_amount = tax_amount_currency = 0.0 |
380 | + for tax_id in line.invoice_line_tax_id: |
381 | + tax_data = tax_obj.browse(cr, uid, tax_id.id, context=context) |
382 | + discount_ratio = amount_discount * line_ratio |
383 | + tax_amt = round((discount_ratio * tax_data.amount), int(config['price_accuracy'])) |
384 | + tax_real_amt = round((tax_amt / (1 + tax_data.amount)), int(config['price_accuracy'])) |
385 | + total_tax_amount += tax_real_amt |
386 | + |
387 | + tax_base = tax_data.base_code_id.id |
388 | + tax_code = tax_data.tax_code_id.id |
389 | + tax_invoice_id = invoice_tax_obj.search(cr, uid, [('invoice_id', '=', invoice.id), ('tax_code_id', '=', tax_code), ('base_code_id', '=', tax_base)]) |
390 | + |
391 | + for tax_id2 in tax_invoice_id: |
392 | + tax_value = invoice_tax_obj.browse(cr, uid, tax_id2) |
393 | + tax_account_id = tax_value.account_id.id |
394 | + tax_code_id = tax_value.tax_code_id.id |
395 | + |
396 | + if invoice.company_id.currency_id.id <> invoice.currency_id.id: |
397 | + tax_amount_currency = cur_obj.compute(cr, uid, invoice.currency_id.id, invoice.company_id.currency_id.id, tax_real_amt, context=context) |
398 | + l3 = { |
399 | + 'debit': direction * tax_real_amt < 0 and abs(tax_real_amt) or 0.0, |
400 | + 'credit': direction * tax_real_amt > 0 and abs(tax_real_amt) or 0.0, |
401 | + 'account_id': tax_account_id, |
402 | + 'partner_id': invoice.partner_id.id, |
403 | + 'ref': ref, |
404 | + 'date': date, |
405 | + 'currency_id': currency_id, |
406 | + 'amount_currency': tax_amount_currency and direction * tax_amount_currency or 0.0, |
407 | + 'tax_code_id': tax_code_id, |
408 | + 'tax_amount': -tax_real_amt, |
409 | + 'name': name, |
410 | + } |
411 | + lines.append((0, 0, l3)) |
412 | + ### When we make payment by pay invoice wizard and if found the discount moves in wizard discount move then directly take the entry from the wizard |
413 | + if 'discount_move_ids' in context and context['discount_move_ids']: |
414 | + move_line = context['discount_move_ids'] |
415 | + for move_line_id in move_line: |
416 | + move_line_data = move_line_obj_memory.browse(cr, uid, move_line_id) |
417 | + l4 = { |
418 | + 'debit': move_line_data.debit, |
419 | + 'credit':move_line_data.credit, |
420 | + 'account_id': move_line_data.account_id.id, |
421 | + 'partner_id': invoice.partner_id.id, |
422 | + 'ref':ref, |
423 | + 'date': move_line_data.date, |
424 | + 'currency_id': move_line_data.currency_id.id, |
425 | + 'amount_currency': move_line_data.amount_currency and direction * move_line_data.amount_currency or 0.0, |
426 | + 'name': move_line_data.name, |
427 | + 'tax_code_id': move_line_data.tax_code_id.id, |
428 | + 'tax_amount': -move_line_data.tax_amount, |
429 | + } |
430 | + lines.append((0, 0, l4)) |
431 | + else: |
432 | + if amount_discount > 0: |
433 | + account_id = False |
434 | + if 'account_id' in context and context['account_id']: |
435 | + account_id = context['account_id'] |
436 | + elif 'pay_cash_dis_acc' in context and context['pay_cash_dis_acc']: |
437 | + account_id = context['pay_cash_dis_acc'] |
438 | + else: |
439 | + account_id = self._get_account(cr, uid, ids , pay_amount, invoice.payment_term.id, context=context) |
440 | + |
441 | + fpos = invoice.fiscal_position or False |
442 | + if account_id: |
443 | + account_id = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, account_id) |
444 | + |
445 | + for line in invoice.invoice_line: |
446 | + tax_account_id = base_code_id = False |
447 | + tax_base = tax_code = False |
448 | + |
449 | + discount_amount_currency = line_tax_amount = total_tax_amount = 0.0 |
450 | + for tax in tax_obj.compute(cr, uid, line.invoice_line_tax_id, line.price_subtotal/line.quantity, line.quantity, invoice.address_invoice_id.id, line.product_id, invoice.partner_id): |
451 | + line_tax_amount += tax['amount'] |
452 | + line_total = line.price_subtotal + line_tax_amount |
453 | + invoice_res_amount = invoice.amount_total |
454 | + line_ratio = line_total / invoice_res_amount |
455 | + |
456 | + discount_ratio = amount_discount * line_ratio |
457 | + |
458 | + for tax_id in line.invoice_line_tax_id: |
459 | + tax_data = tax_obj.browse(cr, uid, tax_id.id, context=context) |
460 | + tax_amt = round((discount_ratio * tax_data.amount), int(config['price_accuracy'])) |
461 | + tax_real_amt = round((tax_amt / (1 + tax_data.amount)), int(config['price_accuracy'])) |
462 | + total_tax_amount += tax_real_amt |
463 | + |
464 | + tax_base = tax_data.base_code_id.id |
465 | + tax_code = tax_data.tax_code_id.id |
466 | + tax_invoice_id = invoice_tax_obj.search(cr, uid, [('invoice_id', '=', invoice.id), ('tax_code_id', '=', tax_code), ('base_code_id', '=', tax_base)]) |
467 | + |
468 | + for tax_id2 in tax_invoice_id: |
469 | + tax_value = invoice_tax_obj.browse(cr, uid, tax_id2) |
470 | + tax_account_id = tax_value.account_id.id |
471 | + base_code_id = tax_value.base_code_id.id |
472 | + |
473 | + if invoice.company_id.currency_id.id <> invoice.currency_id.id: |
474 | + discount_amount = discount_ratio - total_tax_amount |
475 | + discount_amount_currency = cur_obj.compute(cr, uid, invoice.currency_id.id, invoice.company_id.currency_id.id, discount_amount, context=context) |
476 | + l4 = { |
477 | + 'debit': direction * (discount_ratio - total_tax_amount) < 0 and abs(discount_ratio - total_tax_amount) or 0.0, |
478 | + 'credit': direction * (discount_ratio - total_tax_amount) > 0 and abs(discount_ratio - total_tax_amount) or 0.0, |
479 | + 'account_id': account_id, |
480 | + 'partner_id': invoice.partner_id.id, |
481 | + 'ref': ref, |
482 | + 'date': date, |
483 | + 'currency_id': currency_id, |
484 | + 'amount_currency': discount_amount_currency and direction * discount_amount_currency or 0.0, |
485 | + 'tax_code_id': base_code_id, |
486 | + 'tax_amount': -(discount_ratio - total_tax_amount), |
487 | + 'name': name, |
488 | + } |
489 | + lines.append((0, 0, l4)) |
490 | + |
491 | + ########################### for currency difference################# |
492 | + currency_diff = invoice_amount = payment_line_amount = 0.0 |
493 | + |
494 | + for line in invoice.move_id.line_id: |
495 | + move_line_data = move_line_obj.browse(cr, uid, line.id, context=context) |
496 | + invoice_amount += line.debit |
497 | + |
498 | + for payment_line in invoice.payment_ids: |
499 | + if payment_line.debit > 0.0: |
500 | + payment_line_amount += payment_line.debit |
501 | + elif payment_line.credit > 0.0: |
502 | + payment_line_amount += payment_line.credit |
503 | + |
504 | + payment_line_amount += pay_amount |
505 | + |
506 | + if journal_currency != invoice.currency_id.id or invoice.currency_id.id != invoice.company_id.currency_id.id: |
507 | + currency_diff = invoice_amount - payment_line_amount |
508 | + expense_acc = invoice.company_id.expense_account_id |
509 | + revenue_acc = invoice.company_id.revenue_account_id |
510 | + partner_acc_id = curr_diff_account_id = False |
511 | + ## Account selection############ |
512 | + if currency_diff < 0.00: |
513 | + curr_diff_account_id = expense_acc.id |
514 | + elif currency_diff > 0.00: |
515 | + curr_diff_account_id = revenue_acc.id |
516 | + ###### set fiscal position for the currency_diff account |
517 | + fpos = invoice.fiscal_position or False |
518 | + if curr_diff_account_id: |
519 | + curr_diff_account_id = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, curr_diff_account_id) |
520 | + |
521 | + if currency_diff < 0.00 and invoice.type in ['in_invoice','out_refund'] or currency_diff > 0.00 and invoice.type in ['out_invoice','in_refund']: |
522 | + l5 = { |
523 | + 'ref': ref, |
524 | + 'date': date, |
525 | + 'partner_id': invoice.partner_id.id, |
526 | + 'account_id': invoice.account_id.id, |
527 | + 'credit': abs(currency_diff), |
528 | + 'debit': 0.0, |
529 | + 'amount_currency': 0.0, |
530 | + 'name': name, |
531 | + } |
532 | + lines.append((0, 0, l5)) |
533 | + |
534 | + l6 = { |
535 | + 'ref': ref, |
536 | + 'date': date, |
537 | + 'partner_id': invoice.partner_id.id, |
538 | + 'account_id': curr_diff_account_id, |
539 | + 'credit': 0.0, |
540 | + 'debit': abs(currency_diff), |
541 | + 'amount_currency': 0.0, |
542 | + 'name': name, |
543 | + } |
544 | + lines.append((0, 0, l6)) |
545 | + |
546 | + if currency_diff > 0.00 and invoice.type in ['in_invoice','out_refund'] or currency_diff < 0.00 and invoice.type in ['out_invoice','in_refund']: |
547 | + l5 = { |
548 | + 'ref': ref, |
549 | + 'date': date, |
550 | + 'partner_id': invoice.partner_id.id, |
551 | + 'account_id': invoice.account_id.id, |
552 | + 'credit': 0.0, |
553 | + 'debit': abs(currency_diff), |
554 | + 'amount_currency': 0.0, |
555 | + 'name': name, |
556 | + } |
557 | + lines.append((0, 0, l5)) |
558 | + |
559 | + l6 = { |
560 | + 'ref': ref, |
561 | + 'date': date, |
562 | + 'partner_id': invoice.partner_id.id, |
563 | + 'account_id': curr_diff_account_id, |
564 | + 'credit': abs(currency_diff), |
565 | + 'debit': 0.0, |
566 | + 'amount_currency': 0.0, |
567 | + 'name': name, |
568 | + } |
569 | + lines.append((0, 0, l6)) |
570 | + |
571 | + move = {'ref': ref, 'line_id': lines, 'journal_id': pay_journal_id, 'period_id': period_id, 'date': date} |
572 | + move_id = move_obj.create(cr, uid, move, context=context) |
573 | + |
574 | + line_ids = [] |
575 | + total = 0.0 |
576 | + line = self.pool.get('account.move.line') |
577 | + cr.execute('SELECT id FROM account_move_line WHERE move_id IN (%s, %s)', (move_id, invoice.move_id.id,)) |
578 | + |
579 | + lines = line.browse(cr, uid, map(lambda x: x[0], cr.fetchall()) ) |
580 | + for l in lines + invoice.payment_ids: |
581 | + if l.account_id.id == src_account_id: |
582 | + line_ids.append(l.id) |
583 | + total += (l.debit or 0.0) - (l.credit or 0.0) |
584 | + if (not round(total, int(config['price_accuracy']))) or writeoff_acc_id: |
585 | + self.pool.get('account.move.line').reconcile(cr, uid, line_ids, 'manual', writeoff_acc_id, writeoff_period_id, writeoff_journal_id, context) |
586 | + else: |
587 | + self.pool.get('account.move.line').reconcile_partial(cr, uid, line_ids, 'manual', context) |
588 | + |
589 | + # Update the stored value (fields.function), so we write to trigger recompute |
590 | + self.pool.get('account.invoice').write(cr, uid, ids, {}, context=context) |
591 | + return True |
592 | + |
593 | +account_invoice() |
594 | + |
595 | +class account_bank_statement_reconcile(osv.osv): |
596 | + _inherit='account.bank.statement.reconcile' |
597 | + def name_get(self, cursor, user, ids, context=None): |
598 | + res = [] |
599 | + res = super(account_bank_statement_reconcile, self).name_get(cursor, user, ids, context) |
600 | + for o in self.browse(cursor, user, ids, context=context): |
601 | + data = res[0][1] + o.name |
602 | + res.append((o.id, data)) |
603 | + return res |
604 | +account_bank_statement_reconcile() |
605 | + |
606 | +class account_bank_statement_reconcile_line(osv.osv): |
607 | + _inherit='account.bank.statement.reconcile.line' |
608 | + _columns = { |
609 | + 'tax_code_id': fields.many2one('account.tax.code', 'Tax Account'), |
610 | + } |
611 | +account_bank_statement_reconcile_line() |
612 | + |
613 | +class res_company(osv.osv): |
614 | + _inherit = "res.company" |
615 | + _columns = { |
616 | + 'expense_account_id': fields.many2one('account.account', 'Account for Expense from Exchange Rate Difference', required=True), |
617 | + 'revenue_account_id': fields.many2one('account.account', 'Account for Revenue from Exchange Rate Difference', required=True), |
618 | + } |
619 | +res_company() |
620 | + |
621 | +class res_company_wizard(osv.osv_memory): |
622 | + _name = 'res.company.wizard' |
623 | + |
624 | + _columns = { |
625 | + 'expense_account_id': fields.many2one('account.account', 'Account for Expense from Exchange Rate Difference', required=True), |
626 | + 'revenue_account_id': fields.many2one('account.account', 'Account for Revenue from Exchange Rate Difference', required=True), |
627 | + } |
628 | + |
629 | + def set_default(self, cr, uid, ids, context=None): |
630 | + company_id = self.pool.get('res.users').browse(cr,uid,[uid],context)[0].company_id |
631 | + for o in self.browse(cr, uid, ids, context=context): |
632 | + self.pool.get('res.company').write(cr, uid, [company_id.id], {'expense_account_id': o.expense_account_id.id, 'revenue_account_id': o.revenue_account_id.id}) |
633 | + return { |
634 | + 'view_type': 'form', |
635 | + 'view_mode': 'form', |
636 | + 'res_model': 'ir.actions.configuration.wizard', |
637 | + 'type': 'ir.actions.act_window', |
638 | + 'target': 'new', |
639 | + } |
640 | + |
641 | + def action_cancel(self, cr, uid, ids, context=None): |
642 | + return { |
643 | + 'view_type': 'form', |
644 | + 'view_mode': 'form', |
645 | + 'res_model': 'ir.actions.configuration.wizard', |
646 | + 'type': 'ir.actions.act_window', |
647 | + 'target': 'new', |
648 | + } |
649 | + |
650 | +res_company_wizard() |
651 | + |
652 | +class account_bank_statement(osv.osv): |
653 | + _inherit="account.bank.statement" |
654 | + |
655 | + def _end_balance(self, cr, uid, ids, name, attr, context=None): |
656 | + res_currency_obj = self.pool.get('res.currency') |
657 | + res_users_obj = self.pool.get('res.users') |
658 | + tax_obj = self.pool.get('account.tax') |
659 | + res = {} |
660 | + |
661 | + statements = self.browse(cr, uid, ids, context=context) |
662 | + for statement in statements: |
663 | + res[statement.id] = statement.balance_start |
664 | + currency_id = statement.currency.id |
665 | + for line in statement.move_line_ids: |
666 | + if line.debit > 0 and line.account_id.id == statement.journal_id.default_debit_account_id.id: |
667 | + res[statement.id] += line.amount_currency or line.debit |
668 | + elif line.credit > 0 and line.account_id.id == statement.journal_id.default_credit_account_id.id: |
669 | + res[statement.id] += line.amount_currency or -line.credit |
670 | + |
671 | + if statement.state == 'draft': |
672 | + for line in statement.line_ids: |
673 | + tax = 1 |
674 | + if line.type == 'general' and line.tax_type == 'tax_excluded' and line.tax_id: |
675 | + tax = 1 + tax_obj.browse(cr, uid, line.tax_id.id, context=context).amount |
676 | + res[statement.id] += line.amount * tax - line.cash_discount * tax |
677 | + |
678 | + for r in res: |
679 | + res[r] = round(res[r], int(config['price_accuracy'])) |
680 | + return res |
681 | + |
682 | + _columns = { |
683 | + 'balance_end': fields.function(_end_balance, method=True, string = 'Balance'), |
684 | + } |
685 | + |
686 | + def button_confirm(self, cr, uid, ids, context={}): |
687 | + done = [] |
688 | + account_bank_statement_line_obj = self.pool.get('account.bank.statement.line') |
689 | + account_move_obj = self.pool.get('account.move') |
690 | + account_move_line_obj = self.pool.get('account.move.line') |
691 | + tax_obj = self.pool.get('account.tax') |
692 | + res_currency_obj = self.pool.get('res.currency') |
693 | + res_users_obj = self.pool.get('res.users') |
694 | + |
695 | + company_currency_id = res_users_obj.browse(cr, uid, uid, context=context).company_id.currency_id.id |
696 | + expense_acc = res_users_obj.browse(cr, uid, uid, context=context).company_id.expense_account_id.id |
697 | + revenue_acc = res_users_obj.browse(cr, uid, uid, context=context).company_id.revenue_account_id.id |
698 | + |
699 | + for st in self.browse(cr, uid, ids, context): |
700 | + if not st.state == 'draft': |
701 | + continue |
702 | + if not (abs(st.balance_end - st.balance_end_real) < 0.0001): |
703 | + raise osv.except_osv(_('Error!'), |
704 | + _('The statement balance is incorrect!\n') + |
705 | + _('The expected balance (%.2f) is different than the computed one. (%.2f)') % (st.balance_end_real, st.balance_end)) |
706 | + if (not st.journal_id.default_credit_account_id) or (not st.journal_id.default_debit_account_id): |
707 | + raise osv.except_osv(_('Configuration Error!'), |
708 | + _('Please verify that an account is defined in the journal.')) |
709 | + currency_id = st.currency.id <> company_currency_id and st.currency.id |
710 | + |
711 | + for line in st.move_line_ids: |
712 | + if line.state <> 'valid': |
713 | + raise osv.except_osv(_('Error!'), |
714 | + _('The account entry lines are not in valid state.')) |
715 | + # for bank.statement.lines |
716 | + # In line we get reconcile_id on bank.ste.rec. |
717 | + # in bank stat.rec we get line_new_ids on bank.stat.rec.line |
718 | + new_end_value = 0.0 |
719 | + for move in st.line_ids: |
720 | + context.update({'date': move.date,}) |
721 | + move_id = account_move_obj.create(cr, uid, { |
722 | + 'journal_id': st.journal_id.id, |
723 | + 'period_id': st.period_id.id, |
724 | + 'date': move.date, |
725 | + }, context=context) |
726 | + account_bank_statement_line_obj.write(cr, uid, [move.id], { |
727 | + 'move_ids': [(4, move_id, False)] |
728 | + }) |
729 | + if not move.amount: |
730 | + continue |
731 | + torec = [] |
732 | + account_id = move.amount >= 0 and st.journal_id.default_credit_account_id.id or st.journal_id.default_debit_account_id.id |
733 | + acc_cur = move.amount <= 0 and st.journal_id.default_debit_account_id or move.account_id |
734 | + amount = res_currency_obj.compute(cr, uid, st.currency.id, |
735 | + company_currency_id, move.amount, context=context, |
736 | + account = acc_cur) |
737 | + |
738 | + st_tax_amount = move_tax_amount = tax_real_amt = 0.0 |
739 | + st_base_code_id = curr_diff_account_id = False |
740 | + |
741 | + if move.type == 'general' and move.tax_type <> 'untaxed': |
742 | + if move.tax_type == 'tax_included': |
743 | + st_tax_data = tax_obj.browse(cr, uid, move.tax_id.id, context=context) |
744 | + st_tax_amt = move.amount * st_tax_data.amount |
745 | + st_tax_amount = st_tax_amt / (1 + st_tax_data.amount) |
746 | + st_base_code_id = st_tax_data.base_code_id.id |
747 | + amount = amount - st_tax_amount |
748 | + tax_pay = st_tax_amount |
749 | + st_tax_amount = 0.0 |
750 | + else: |
751 | + st_tax_data = tax_obj.browse(cr, uid, move.tax_id.id, context=context) |
752 | + st_tax_amt = move.amount * st_tax_data.amount |
753 | + st_tax_amount = st_tax_amt |
754 | + tax_pay = st_tax_amount |
755 | + st_base_code_id = st_tax_data.base_code_id.id |
756 | + |
757 | + if not st_tax_data.tax_code_id.id: |
758 | + tax_val = { |
759 | + 'name': move.name, |
760 | + 'date': move.date, |
761 | + 'ref': move.ref, |
762 | + 'move_id': move_id, |
763 | + 'partner_id': move.partner_id and move.partner_id.id, |
764 | + 'account_id': move.account_id and move.account_id.id, |
765 | + 'credit': tax_pay > 0 and abs(tax_pay) or 0.0, |
766 | + 'debit': tax_pay < 0 and abs(tax_pay) or 0.0, |
767 | + 'statement_id': st.id, |
768 | + 'journal_id': st.journal_id.id, |
769 | + 'period_id': st.period_id.id, |
770 | + 'currency_id': currency_id, |
771 | + 'tax_code_id': st_base_code_id, |
772 | + 'tax_amount': move_tax_amount, |
773 | + } |
774 | + torec.append(account_move_line_obj.create(cr, uid, tax_val, context=context)) |
775 | + |
776 | + val = { |
777 | + 'name': move.name, |
778 | + 'date': move.date, |
779 | + 'ref': move.ref, |
780 | + 'move_id': move_id, |
781 | + 'partner_id': move.partner_id and move.partner_id.id, |
782 | + 'account_id': move.account_id and move.account_id.id, |
783 | + 'credit': amount > 0 and abs(amount) or 0.0, |
784 | + 'debit': amount < 0 and abs(amount) or 0.0, |
785 | + 'statement_id': st.id, |
786 | + 'journal_id': st.journal_id.id, |
787 | + 'period_id': st.period_id.id, |
788 | + 'currency_id': currency_id, |
789 | + 'tax_code_id': st_base_code_id, |
790 | + 'account_tax_id': move.tax_id.id, |
791 | + 'tax_amount': move_tax_amount, |
792 | + } |
793 | + amount = res_currency_obj.compute(cr, uid, st.currency.id, |
794 | + company_currency_id, move.amount, context=context, |
795 | + account=acc_cur) |
796 | + val['amount_currency'] = currency_id and -move.amount or 0.00 |
797 | + |
798 | + if move.account_id.currency_id and \ |
799 | + st.currency.id <> company_currency_id <> move.account_id.currency_id.id <> st.currency_id: |
800 | + |
801 | + val['currency_id'] = move.account_id.currency_id.id |
802 | + val['amount_currency'] = res_currency_obj.compute(cr, uid, company_currency_id, |
803 | + move.account_id.currency_id.id, -amount, context=context, account = acc_cur) |
804 | + |
805 | + torec.append(account_move_line_obj.create(cr, uid, val, context=context)) |
806 | + |
807 | + newline_sum = 0.0 |
808 | + if move.reconcile_id and move.reconcile_id.line_new_ids: |
809 | + newline_amount_currency = 0.0 |
810 | + for newline in move.reconcile_id.line_new_ids: |
811 | + newline_amount_currency = res_currency_obj.compute(cr, uid, st.currency.id, |
812 | + company_currency_id, newline.amount, context=context) |
813 | + newline_amount_currency = round(newline_amount_currency, int(config['price_accuracy'])) |
814 | + newline_sum += newline_amount_currency |
815 | + |
816 | + account_move_line_obj.create(cr, uid, { |
817 | + 'name': newline.name or move.name, |
818 | + 'date': move.date, |
819 | + 'ref': move.ref, |
820 | + 'move_id': move_id, |
821 | + 'partner_id': move.partner_id and move.partner_id.id, |
822 | + 'account_id': newline.account_id and newline.account_id.id, |
823 | + 'debit': newline_amount_currency > 0 and abs(newline_amount_currency) or 0.0, |
824 | + 'credit': newline_amount_currency < 0 and abs(newline_amount_currency) or 0.0, |
825 | + 'statement_id': st.id, |
826 | + 'tax_code_id': newline.tax_code_id.id, |
827 | + 'tax_amount': -newline_amount_currency, |
828 | + 'amount_currency': newline.amount, |
829 | + 'currency_id': currency_id, |
830 | + 'journal_id': st.journal_id.id, |
831 | + 'period_id': st.period_id.id, |
832 | + }, context=context) |
833 | + |
834 | + amount_currency = False |
835 | + if move.reconcile_id and move.reconcile_id.line_ids: |
836 | + for line in move.reconcile_id.line_ids: |
837 | + move_line_data = self.pool.get('account.move.line').browse(cr, uid, line.id, context=context) |
838 | + if st.currency.id <> company_currency_id: |
839 | + balance = reconcile_sum = 0.0 |
840 | + context.update({'amount': move_line_data.amount_currency, 'currency_id': move_line_data.currency_id.id or company_currency_id}) |
841 | + reconcile_data = self.pool.get("account.bank.statement.reconcile").browse(cr, uid, move.reconcile_id.id, context=context) |
842 | + balance_sum = reconcile_data.total_balance |
843 | + for line_reconcile in reconcile_data.line_new_ids: |
844 | + reconcile_sum += line_reconcile.amount |
845 | + balance = round((balance_sum - reconcile_sum), int(config['price_accuracy'])) |
846 | + |
847 | + if st.currency.id <> move_line_data.currency_id.id: |
848 | + invoice_cret_balance = 0.0 |
849 | + payment_balance = 0.0 |
850 | + context.update({'date': move_line_data.date}) |
851 | + inv_create_balance = res_currency_obj.compute(cr, uid, company_currency_id, |
852 | + st.currency.id, amount, context=context) |
853 | + currenct_date = time.strftime('%Y-%m-%d') |
854 | + context.update({'date': currenct_date}) |
855 | + payment_balance = res_currency_obj.compute(cr, uid, company_currency_id, |
856 | + st.currency.id, amount, context=context) |
857 | + balance = round(inv_create_balance - payment_balance, int(config['price_accuracy'])) |
858 | + |
859 | + ## Account selection############ |
860 | + if balance < 0.00: |
861 | + curr_diff_account_id = expense_acc |
862 | + elif balance > 0.00: |
863 | + curr_diff_account_id = revenue_acc |
864 | + ####################################### |
865 | + |
866 | + ###### set fiscal position for the currency_diff account |
867 | + fpos = move_line_data.invoice.fiscal_position or False |
868 | + if curr_diff_account_id: |
869 | + curr_diff_account_id = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, curr_diff_account_id) |
870 | + if balance <> 0.0: |
871 | + currency_diff1 = account_move_line_obj.create(cr, uid, { |
872 | + 'name': move.name, |
873 | + 'date': move.date, |
874 | + 'ref': move.ref, |
875 | + 'move_id': move_id, |
876 | + 'partner_id': move.partner_id and move.partner_id.id, |
877 | + 'account_id': move.account_id.id, |
878 | + 'credit': balance < 0.0 and abs(balance) or 0.0, |
879 | + 'debit': balance > 0.0 and abs(balance) or 0.0, |
880 | + 'statement_id': st.id, |
881 | + 'journal_id': st.journal_id.id, |
882 | + 'period_id': st.period_id.id, |
883 | + 'amount_currency': 0.0, |
884 | + 'currency_id': currency_id, |
885 | + }, context=context) |
886 | + |
887 | + currency_diff2 = account_move_line_obj.create(cr, uid, { |
888 | + 'name': move.name, |
889 | + 'date': move.date, |
890 | + 'ref': move.ref, |
891 | + 'move_id': move_id, |
892 | + 'partner_id': move.partner_id and move.partner_id.id, |
893 | + 'account_id': curr_diff_account_id, |
894 | + 'credit': balance > 0.0 and abs(balance) or 0.0, |
895 | + 'debit': balance < 0.0 and abs(balance) or 0.0, |
896 | + 'statement_id': st.id, |
897 | + 'journal_id': st.journal_id.id, |
898 | + 'period_id': st.period_id.id, |
899 | + 'amount_currency': 0.0, |
900 | + 'currency_id': currency_id, |
901 | + }, context=context) |
902 | + |
903 | + if move_line_data.invoice.currency_id.id != company_currency_id: |
904 | + torec.append(currency_diff1) |
905 | + |
906 | + if currency_id: |
907 | + amount_currency = res_currency_obj.compute(cr, uid, company_currency_id, st.currency.id, |
908 | + (amount + st_tax_amount - newline_sum), context=context, account = acc_cur) |
909 | + |
910 | + account_move_line_obj.create(cr, uid, { |
911 | + 'name': move.name, |
912 | + 'date': move.date, |
913 | + 'ref': move.ref, |
914 | + 'move_id': move_id, |
915 | + 'partner_id': move.partner_id and move.partner_id.id, |
916 | + 'account_id': account_id, |
917 | + 'credit': (amount + st_tax_amount - newline_sum) < 0 and abs(amount + st_tax_amount - newline_sum) or 0.0, |
918 | + 'debit': (amount + st_tax_amount - newline_sum) > 0 and abs(amount + st_tax_amount - newline_sum) or 0.0, |
919 | + 'statement_id': st.id, |
920 | + 'journal_id': st.journal_id.id, |
921 | + 'period_id': st.period_id.id, |
922 | + 'amount_currency': amount_currency, |
923 | + 'currency_id': currency_id, |
924 | + }, context=context) |
925 | + |
926 | + account_move_line_obj.write(cr, uid, [x.id for x in |
927 | + account_move_obj.browse(cr, uid, move_id, context=context).line_id], {'statement_id': st.id,}) |
928 | + for line in account_move_line_obj.browse(cr, uid, [x.id for x in |
929 | + account_move_obj.browse(cr, uid, move_id, context=context).line_id], context=context): |
930 | + if line.state <> 'valid': |
931 | + raise osv.except_osv(_('Error!'), |
932 | + _('Account move line "%s" is not valid') % line.name) |
933 | + if move.reconcile_id and move.reconcile_id.line_ids: |
934 | + torec += map(lambda x: x.id, move.reconcile_id.line_ids) |
935 | + #try: |
936 | + if abs(move.reconcile_amount - move.amount) < 0.0001: |
937 | + writeoff_acc_id = False |
938 | + #There should only be one write-off account! |
939 | + for entry in move.reconcile_id.line_new_ids: |
940 | + writeoff_acc_id = entry.account_id.id |
941 | + break |
942 | + account_move_line_obj.reconcile(cr, uid, torec, 'statement', writeoff_acc_id=writeoff_acc_id, writeoff_period_id=st.period_id.id, writeoff_journal_id=st.journal_id.id, context=context) |
943 | + else: |
944 | + account_move_line_obj.reconcile_partial(cr, uid, torec, 'statement', context) |
945 | + #except: |
946 | + # raise osv.except_osv(_('Error!'), _('Unable to reconcile entry "%s": %.2f') % (move.name, move.amount)) |
947 | + |
948 | + if st.journal_id.entry_posted: |
949 | + account_move_obj.write(cr, uid, [move_id], {'state': 'posted'}) |
950 | + done.append(st.id) |
951 | + |
952 | + self.write(cr, uid, done, {'state': 'confirm'}, context=context) |
953 | + return True |
954 | + |
955 | +account_bank_statement() |
956 | + |
957 | +class account_bank_statement_line(osv.osv): |
958 | + _inherit="account.bank.statement.line" |
959 | + _columns = { |
960 | + 'tax_id': fields.many2one('account.tax', 'Tax'), |
961 | + 'tax_type': fields.selection([ |
962 | + ('untaxed', 'Untaxed'), |
963 | + ('tax_included', 'Tax included'), |
964 | + ('tax_excluded', 'Tax excluded')], 'Tax method', required=True,), |
965 | + 'cash_discount': fields.float('Cash Discount'), |
966 | + 'transferred_amount': fields.float('Transferred'), |
967 | + } |
968 | + |
969 | + def onchange_account_id(self, cr, uid, ids, account_id, context=None): |
970 | + result = {} |
971 | + tax = False |
972 | + taxes = self.pool.get('account.account').browse(cr, uid, account_id, context=context).tax_ids |
973 | + for tax_id in taxes: |
974 | + tax = tax_id.id |
975 | + result['tax_id'] = tax |
976 | + return {'value': result} |
977 | + |
978 | + def onchange_cash_discount(self, cr, uid, ids, amount, cash_discount, context=None): |
979 | + return {'value': {'transferred_amount': amount - cash_discount}} |
980 | + |
981 | + def onchange_transferred_amount(self, cr, uid, ids, amount, transferred_amount, context=None): |
982 | + return {'value': {'cash_discount': amount - transferred_amount}} |
983 | + |
984 | + def onchange_type(self, cr, uid, ids, type, context=None): |
985 | + result={} |
986 | + tax_id = self.pool.get('account.tax').search(cr, uid, []) |
987 | + |
988 | + if type == 'general' and tax_id: |
989 | + result['tax_id'] = tax_id[0] |
990 | + else: |
991 | + result['tax_id'] = False |
992 | + return {'value': result} |
993 | + |
994 | + _defaults = { |
995 | + 'tax_type':lambda *a: 'untaxed', |
996 | + } |
997 | +account_bank_statement_line() |
998 | + |
999 | + |
1000 | +class account_move_line(osv.osv): |
1001 | + _inherit="account.move.line" |
1002 | + |
1003 | + def reconcile_discount(self, cr, uid, ids, type='auto', discount_acc_id=False, discount_period_id=False, discount_journal_id=False, context={}): |
1004 | + tax_obj = self.pool.get('account.tax') |
1005 | + cur_obj = self.pool.get('res.currency') |
1006 | + partner_obj = self.pool.get('res.partner') |
1007 | + res_users_obj = self.pool.get('res.users') |
1008 | + |
1009 | + id_set = ','.join(map(str, ids)) |
1010 | + reconcile_lines = [] |
1011 | + credit = debit = currency = 0.0 |
1012 | + currency_id = account_id = partner_id = invoice = ref = False |
1013 | + discount_account = curr_diff_account = False |
1014 | + if discount_acc_id: |
1015 | + discount_account = self.pool.get('account.account').browse(cr, uid, discount_acc_id, context=context) |
1016 | + lines = self.browse(cr, uid, ids, context=context) |
1017 | + unrec_lines = filter(lambda x: not x['reconcile_id'], lines) |
1018 | + |
1019 | + for line in unrec_lines: |
1020 | + if line.invoice: |
1021 | + invoice = line.invoice |
1022 | + if line.state <> 'valid': |
1023 | + raise osv.except_osv(_('Error!'), |
1024 | + _('Entry "%s" is not valid !') % line.name) |
1025 | + credit += line['credit'] |
1026 | + debit += line['debit'] |
1027 | + currency += line['amount_currency'] or 0.0 |
1028 | + currency_id = currency_id or line['currency_id'] |
1029 | + account_id = line['account_id']['id'] |
1030 | + account_type = line['account_id']['type'] |
1031 | + partner_id = line['partner_id'] and line['partner_id']['id'] |
1032 | + ref = ref or line['ref'] |
1033 | + |
1034 | + # simple rules for (full) reconciliation w/ cash discount: |
1035 | + # if there's foreign currency involved: |
1036 | + # - difference in foreign currency is cash discount |
1037 | + # - difference in company currency is currency exchange rate difference |
1038 | + # - negative difference is expense, positive difference is revenue |
1039 | + # if there's no foreign currency: |
1040 | + # - difference in foreign currency is 0.00 |
1041 | + # - difference in company currency is cash discount |
1042 | + balance = credit - debit |
1043 | + # take fiscal position from invoice, from partner as fallback |
1044 | + fpos = invoice and invoice.fiscal_position |
1045 | + if not fpos and partner_id: |
1046 | + fpos = partner_obj.browse(cr, uid, partner_id, context=context).property_account_position |
1047 | + date = context.has_key('date_p') and context['date_p'] or time.strftime('%Y-%m-%d') |
1048 | + |
1049 | + cr.execute('SELECT account_id, reconcile_id '\ |
1050 | + 'FROM account_move_line '\ |
1051 | + 'WHERE id IN %s '\ |
1052 | + 'GROUP BY account_id,reconcile_id', |
1053 | + (tuple(ids),)) |
1054 | + r = cr.fetchall() |
1055 | +#TODO: move this check to a constraint in the account_move_reconcile object |
1056 | + if (len(r) != 1) and not context.get('fy_closing', False): |
1057 | + raise osv.except_osv(_('Error!'), _('Entries are not of the same account or already reconciled!')) |
1058 | + if not unrec_lines: |
1059 | + raise osv.except_osv(_('Error!'), _('Entry is already reconciled!')) |
1060 | + account = self.pool.get('account.account').browse(cr, uid, account_id, context=context) |
1061 | + if not context.get('fy_closing', False) and not account.reconcile: |
1062 | + raise osv.except_osv(_('Error!'), _('The account is not configured to be reconciled!')) |
1063 | + if r[0][1] != None: |
1064 | + raise osv.except_osv(_('Error!'), _('Some entries are already reconciled!')) |
1065 | + |
1066 | + # foreign currency |
1067 | + if currency_id: |
1068 | + # cash discount |
1069 | + if not cur_obj.is_zero(cr, uid, currency_id, currency): |
1070 | + if currency > 0: |
1071 | + osv.except_osv(_('Error!'), _('There seems to be a surcharge, not a cash discount. Can\'t reconcile this!')) |
1072 | + if not discount_acc_id: |
1073 | + raise osv.except_osv(_('Error!'), _('You have to provide a cash discount account!')) |
1074 | + if fpos: |
1075 | + discount_acc_id = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, discount_acc_id) |
1076 | + # TODO: Check if cash discount amount in company currency should be computed with current date |
1077 | + # or date of last payment or date of invoice |
1078 | + company_amount = round(cur_obj.compute(cr, uid, currency_id.id, account.company_id.currency_id.id, currency), |
1079 | + int(config['price_accuracy'])) |
1080 | + reconcile_lines.append( |
1081 | + (0, 0, { |
1082 | + 'name': invoice and invoice.number or 'comment' in context and context['comment'] or _('Cash Discount'), |
1083 | + 'ref': ref, |
1084 | + 'debit': abs(company_amount), |
1085 | + 'credit': 0.0, |
1086 | + 'account_id': account_id, |
1087 | + 'date': date, |
1088 | + 'partner_id': partner_id, |
1089 | + 'currency_id': currency_id.id, |
1090 | + 'amount_currency': -currency, |
1091 | + }) |
1092 | + ) |
1093 | + reconcile_lines.append( |
1094 | + (0, 0, { |
1095 | + 'name': invoice and invoice.number or 'comment' in context and context['comment'] or _('Cash Discount'), |
1096 | + 'ref': ref, |
1097 | + 'debit': 0.0, |
1098 | + 'credit': abs(company_amount), |
1099 | + 'account_id': discount_acc_id, |
1100 | + 'analytic_account_id': context.get('analytic_id', False), |
1101 | + 'date': date, |
1102 | + 'partner_id': partner_id, |
1103 | + 'currency_id': currency_id.id, |
1104 | + 'amount_currency': currency, |
1105 | + }) |
1106 | + ) |
1107 | + # now the company currency difference needs to be corrected by the cash discount amount |
1108 | + balance += company_amount |
1109 | + |
1110 | + # currency difference |
1111 | + if not cur_obj.is_zero(cr, uid, account.company_id.currency_id, balance): |
1112 | + if balance < 0.0: |
1113 | + curr_diff_account = res_users_obj.browse(cr, uid, uid, context=context).company_id.expense_account_id.id |
1114 | + elif balance > 0.0: |
1115 | + curr_diff_account = res_users_obj.browse(cr, uid, uid, context=context).company_id.revenue_account_id.id |
1116 | + if fpos: |
1117 | + curr_diff_account = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, curr_diff_account) |
1118 | + reconcile_lines.append( |
1119 | + (0, 0, { |
1120 | + 'name': invoice and invoice.number or balance < 0.0 and _('Currency Expense') or _('Currency Revenue'), |
1121 | + 'ref': ref, |
1122 | + 'debit': balance < 0.0 and abs(balance) or 0.0, |
1123 | + 'credit': balance > 0.0 and abs(balance) or 0.0, |
1124 | + 'account_id': curr_diff_account, |
1125 | + 'analytic_account_id': context.get('analytic_id', False), |
1126 | + 'date': date, |
1127 | + 'partner_id': partner_id, |
1128 | + 'currency_id': currency_id.id, |
1129 | + 'amount_currency': 0.0, |
1130 | + }) |
1131 | + ) |
1132 | + reconcile_lines.append( |
1133 | + (0, 0, { |
1134 | + 'name': invoice and invoice.number or balance < 0.0 and _('Currency Expense') or _('Currency Revenue'), |
1135 | + 'ref': ref, |
1136 | + 'debit': balance > 0.0 and abs(balance) or 0.0, |
1137 | + 'credit': balance < 0.0 and abs(balance) or 0.0, |
1138 | + 'account_id': account_id, |
1139 | + 'date': date, |
1140 | + 'partner_id': partner_id, |
1141 | + 'currency_id': currency_id.id, |
1142 | + 'amount_currency': 0.0, |
1143 | + }) |
1144 | + ) |
1145 | + # no foreign currency |
1146 | + else: |
1147 | + # cash discount |
1148 | + if not cur_obj.is_zero(cr, uid, account.company_id.currency_id, balance): |
1149 | + if balance > 0: |
1150 | + osv.except_osv(_('Error!'), _('There seems to be a surcharge, not a cash discount. Can\'t reconcile this!')) |
1151 | + if not discount_acc_id: |
1152 | + raise osv.except_osv(_('Error!'), _('You have to provide a cash discount account!')) |
1153 | + if fpos: |
1154 | + discount_acc_id = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, discount_acc_id) |
1155 | + reconcile_lines.append( |
1156 | + (0, 0, { |
1157 | + 'name': invoice and invoice.number or 'comment' in context and context['comment'] or _('Cash Discount'), |
1158 | + 'ref': ref, |
1159 | + 'debit': balance > 0.0 and abs(balance) or 0.0, |
1160 | + 'credit': balance < 0.0 and abs(balance) or 0.0, |
1161 | + 'account_id': account_id, |
1162 | + 'date': date, |
1163 | + 'partner_id': partner_id, |
1164 | + }) |
1165 | + ) |
1166 | + # take care of taxes for the cash discount |
1167 | + # cash discount -> base code |
1168 | + # tax amount -> tax code |
1169 | + taxed_balance = balance |
1170 | + tax_amount = 0.0 |
1171 | + type = False |
1172 | + # guess the type of payment |
1173 | + if account.type == 'receivable': |
1174 | + type = balance > 0.0 and 'invoice' or balance < 0.0 and 'refund' |
1175 | + elif account.type == 'payable': |
1176 | + type = balance < 0.0 and 'invoice' or balance > 0.0 and 'refund' |
1177 | + if discount_account.tax_ids: |
1178 | + for tax in discount_account.tax_ids: |
1179 | + if tax.child_depend: |
1180 | + for ctax in tax.child_ids: |
1181 | + if not type or type == 'invoice': |
1182 | + tax_amount = round(ctax.tax_sign * ctax.amount * balance, |
1183 | + int(config['price_accuracy'])) |
1184 | + else: |
1185 | + tax_amount = round(ctax.ref_tax_sign * ctax.amount * balance, |
1186 | + int(config['price_accuracy'])) |
1187 | + reconcile_lines.append( |
1188 | + (0, 0, { |
1189 | + 'name': invoice and invoice.number or 'comment' in context and context['comment'] or _('Cash Discount'), |
1190 | + 'ref': ref, |
1191 | + 'debit': balance < 0.0 and abs(tax_amount) or 0.0, |
1192 | + 'credit': balance > 0.0 and abs(tax_amount) or 0.0, |
1193 | + 'account_id': type == 'invoice' and ctax.account_collected_id.id or type == 'refund' and ctax.account_paid_id.id, |
1194 | + 'date': date, |
1195 | + 'partner_id': partner_id, |
1196 | + 'tax_code_id': type == 'invoice' and ctax.tax_code_id.id or type == 'refund' and ctax.ref_tax_code_id.id, |
1197 | + 'tax_amount': tax_amount, |
1198 | + }) |
1199 | + ) |
1200 | + else: |
1201 | + if not type or type == 'invoice': |
1202 | + tax_amount = round(tax.tax_sign * tax.amount * balance, int(config['price_accuracy'])) |
1203 | + else: |
1204 | + tax_amount = round(tax.ref_tax_sign * tax.amount * balance, int(config['price_accuracy'])) |
1205 | + reconcile_lines.append( |
1206 | + (0, 0, { |
1207 | + 'name': invoice and invoice.number or 'comment' in context and context['comment'] or _('Cash Discount'), |
1208 | + 'ref': ref, |
1209 | + 'debit': balance < 0.0 and abs(tax_amount) or 0.0, |
1210 | + 'credit': balance > 0.0 and abs(tax_amount) or 0.0, |
1211 | + 'account_id': type == 'invoice' and tax.account_collected_id.id or type == 'refund' and tax.account_paid_id.id, |
1212 | + 'date': date, |
1213 | + 'partner_id': partner_id, |
1214 | + 'tax_code_id': type == 'invoice' and tax.tax_code_id.id or type == 'refund' and tax.ref_tax_code_id.id, |
1215 | + 'tax_amount': tax_amount, |
1216 | + }) |
1217 | + ) |
1218 | + taxed_balance -= tax_amount |
1219 | + # only post with debit/credit on the first tax. The other rows would be needed for |
1220 | + # tax reports but need to have debit/credit of 0.0. We just need to have an entry |
1221 | + # for the base tax amount. |
1222 | + first_tax = True |
1223 | + for tax in discount_account.tax_ids: |
1224 | + reconcile_lines.append( |
1225 | + (0, 0, { |
1226 | + 'name': invoice and invoice.number or 'comment' in context and context['comment'] or _('Cash Discount'), |
1227 | + 'ref': ref, |
1228 | + 'debit': first_tax and balance < 0.0 and abs(taxed_balance) or 0.0, |
1229 | + 'credit': first_tax and balance > 0.0 and abs(taxed_balance) or 0.0, |
1230 | + 'account_id': discount_acc_id, |
1231 | + 'analytic_account_id': context.get('analytic_id', False), |
1232 | + 'date': date, |
1233 | + 'partner_id': partner_id, |
1234 | + 'tax_code_id': type == 'invoice' and tax.base_code_id.id \ |
1235 | + or type == 'refund' and tax.ref_base_code_id.id, |
1236 | + 'tax_amount': taxed_balance, |
1237 | + }) |
1238 | + ) |
1239 | + first_tax = False |
1240 | + else: |
1241 | + reconcile_lines.append( |
1242 | + (0, 0, { |
1243 | + 'name': invoice and invoice.number or 'comment' in context and context['comment'] or _('Cash Discount'), |
1244 | + 'ref': ref, |
1245 | + 'debit': balance < 0.0 and abs(taxed_balance) or 0.0, |
1246 | + 'credit': balance > 0.0 and abs(taxed_balance) or 0.0, |
1247 | + 'account_id': discount_acc_id, |
1248 | + 'analytic_account_id': context.get('analytic_id', False), |
1249 | + 'date': date, |
1250 | + 'partner_id': partner_id, |
1251 | + }) |
1252 | + ) |
1253 | + if len(reconcile_lines): |
1254 | + reconcile_move_id = self.pool.get('account.move').create(cr, uid, { |
1255 | + 'period_id': discount_period_id, |
1256 | + 'journal_id': discount_journal_id, |
1257 | + 'date': date, |
1258 | + 'state': 'draft', |
1259 | + 'line_id': reconcile_lines, |
1260 | + }) |
1261 | + reconcile_line_ids = self.search(cr, uid, [('move_id', '=', reconcile_move_id), ('account_id', '=', account_id)]) |
1262 | + ids += reconcile_line_ids |
1263 | + |
1264 | + r_id = self.pool.get('account.move.reconcile').create(cr, uid, { |
1265 | + 'type': type, |
1266 | + 'line_id': map(lambda x: (4, x, False), ids), |
1267 | + 'line_partial_ids': map(lambda x: (3, x, False), ids) |
1268 | + }) |
1269 | + wf_service = netsvc.LocalService("workflow") |
1270 | + # the id of the move.reconcile is written in the move.line (self) by the create method above |
1271 | + # because of the way the line_id are defined: (4, x, False) |
1272 | + for id in ids: |
1273 | + wf_service.trg_trigger(uid, 'account.move.line', id, cr) |
1274 | + return r_id |
1275 | + |
1276 | +account_move_line() |
1277 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
1278 | + |
1279 | |
1280 | === added file 'account_invoice_cash_discount/account_invoice_cash_discount_view.xml' |
1281 | --- account_invoice_cash_discount/account_invoice_cash_discount_view.xml 1970-01-01 00:00:00 +0000 |
1282 | +++ account_invoice_cash_discount/account_invoice_cash_discount_view.xml 2011-07-29 01:35:58 +0000 |
1283 | @@ -0,0 +1,268 @@ |
1284 | +<?xml version="1.0"?> |
1285 | +<openerp> |
1286 | + <data> |
1287 | + |
1288 | + <!-- cash discount --> |
1289 | + <record model="ir.ui.view" id="view_cash_discount_form"> |
1290 | + <field name="name">account.cash.discount.form</field> |
1291 | + <field name="model">account.cash.discount</field> |
1292 | + <field name="type">form</field> |
1293 | + <field name="arch" type="xml"> |
1294 | + <form string="Cash Discount"> |
1295 | + <field name="name" select="1"/> |
1296 | + <field name="delay" select="1"/> |
1297 | + <field name="discount" select="1"/> |
1298 | + <separator string="Cash Discount Account for Supplier and Customer" colspan="4"/> |
1299 | + <field name="discount_account_id" /> |
1300 | + <field name="sup_discount_account_id"/> |
1301 | + </form> |
1302 | + </field> |
1303 | + </record> |
1304 | + |
1305 | + <record model="ir.ui.view" id="view_cash_discount_tree"> |
1306 | + <field name="name">account.cash.discount.tree</field> |
1307 | + <field name="model">account.cash.discount</field> |
1308 | + <field name="type">tree</field> |
1309 | + <field name="arch" type="xml"> |
1310 | + <tree string="Cash Discount" editable="bottom"> |
1311 | + <field name="name" select="1"/> |
1312 | + <field name="delay" select="1"/> |
1313 | + <field name="discount" select="1"/> |
1314 | + <field name="discount_account_id" /> |
1315 | + <field name="sup_discount_account_id"/> |
1316 | + </tree> |
1317 | + </field> |
1318 | + </record> |
1319 | + |
1320 | + <record model="ir.ui.view" id="view_payment_term_form"> |
1321 | + <field name="name">account.payment.term.form</field> |
1322 | + <field name="model">account.payment.term</field> |
1323 | + <field name="inherit_id" ref="account.view_payment_term_form"/> |
1324 | + <field name="arch" type="xml"> |
1325 | + <field name="line_ids" position="after"> |
1326 | + <separator string="Cash Discount" colspan="4"/> |
1327 | + <field name="cash_discount_ids" colspan="4"/> |
1328 | + </field> |
1329 | + </field> |
1330 | + </record> |
1331 | + |
1332 | + <record id="bank_statement_form_view1" model="ir.ui.view"> |
1333 | + <field name="name">account.bank.statement.form</field> |
1334 | + <field name="model">account.bank.statement</field> |
1335 | + <field name="type">form</field> |
1336 | + <field name="inherit_id" ref="account.view_bank_statement_form"/> |
1337 | + <field name="arch" type="xml"> |
1338 | + <xpath expr="//button[@string='Import Invoice']" position="replace"> |
1339 | + <button name="%(wizard_populate_statement_from_inv1)d" type="action" string="Import Invoice" attrs="{'invisible': [('state', '=', 'confirm')]}"/> |
1340 | + </xpath> |
1341 | + </field> |
1342 | + </record> |
1343 | + |
1344 | + <record id="bank_statement_reconcile_form_view1" model="ir.ui.view"> |
1345 | + <field name="name">account.bank.statement.reconcile.form</field> |
1346 | + <field name="model">account.bank.statement.reconcile</field> |
1347 | + <field name="type">form</field> |
1348 | + <field name="inherit_id" ref="account.view_bank_statement_reconcile"/> |
1349 | + <field name="arch" type="xml"> |
1350 | + <field name="total_new" position="replace"> |
1351 | + <field name="total_new" string="Total Write-Off/Cash Discount"/> |
1352 | + </field> |
1353 | + </field> |
1354 | + </record> |
1355 | + |
1356 | + <record id="view_bank_statement_reconcile_tree" model="ir.ui.view"> |
1357 | + <field name="name">account.bank.statement.reconcile.tree</field> |
1358 | + <field name="model">account.bank.statement.reconcile</field> |
1359 | + <field name="type">tree</field> |
1360 | + <field name="arch" type="xml"> |
1361 | + <tree string="Reconcile"> |
1362 | + <field name="name" select="1"/> |
1363 | + <field name="total_amount"/> |
1364 | + <field name="total_currency"/> |
1365 | + <field name="total_entry"/> |
1366 | + <field name="total_new"/> |
1367 | + <field name="total_balance"/> |
1368 | + </tree> |
1369 | + </field> |
1370 | + </record> |
1371 | + |
1372 | + <record id="bank_statement_reconcile_form_view2" model="ir.ui.view"> |
1373 | + <field name="name">account.bank.statement.reconcile.form</field> |
1374 | + <field name="model">account.bank.statement.reconcile</field> |
1375 | + <field name="type">form</field> |
1376 | + <field name="inherit_id" ref="account.view_bank_statement_reconcile"/> |
1377 | + <field name="arch" type="xml"> |
1378 | + <xpath expr="//tree[@string='Write-Off']" position="replace"> |
1379 | + <tree editable="bottom" string="Write-Off and Cash Discount"> |
1380 | + <field name="account_id" domain="[('type', '<>', 'view'), ('type', '<>', 'consolidation')]"/> |
1381 | + <field name="amount"/> |
1382 | + <field name="name"/> |
1383 | + </tree> |
1384 | + </xpath> |
1385 | + </field> |
1386 | + </record> |
1387 | + |
1388 | + <record id="account_payment_term_line_view1" model="ir.ui.view"> |
1389 | + <field name="name">account.payment.term.line.form</field> |
1390 | + <field name="model">account.payment.term.line</field> |
1391 | + <field name="type">form</field> |
1392 | + <field name="inherit_id" ref="account.view_payment_term_line_form"/> |
1393 | + <field name="arch" type="xml"> |
1394 | + <field name="days2" position="after"> |
1395 | + <field name="compl_cash_discount"/> |
1396 | + <field name="day_tolerance" required="1"/> |
1397 | + </field> |
1398 | + </field> |
1399 | + </record> |
1400 | + |
1401 | + <record id="view_res_company_inherit_form" model="ir.ui.view"> |
1402 | + <field name="name">res.company.inherit.form</field> |
1403 | + <field name="model">res.company</field> |
1404 | + <field name="type">form</field> |
1405 | + <field name="inherit_id" ref="base.view_company_form"/> |
1406 | + <field name="arch" type="xml"> |
1407 | + <field name="currency_id" position="after"> |
1408 | + <field name="expense_account_id" string="Acc for Exp from Curr Diff"/> |
1409 | + <field name="revenue_account_id" string="Acc for Rev from Curr Diff"/> |
1410 | + </field> |
1411 | + </field> |
1412 | + </record> |
1413 | + |
1414 | + <record id="view_res_company_wizard" model="ir.ui.view"> |
1415 | + <field name="name">Company Exchage Rate Difference Accounts</field> |
1416 | + <field name="model">res.company.wizard</field> |
1417 | + <field name="type">form</field> |
1418 | + <field name="arch" type="xml"> |
1419 | + <form string="Currency Difference Account Configuration"> |
1420 | + <field name="expense_account_id"/> |
1421 | + <newline/> |
1422 | + <field name="revenue_account_id"/> |
1423 | + <newline/> |
1424 | + <group col="4" colspan="4"> |
1425 | + <button icon="gtk-cancel" name="action_cancel" type="object" special="cancel" string="Cancel"/> |
1426 | + <button icon="gtk-ok" name="set_default" string="Set Default" type="object"/> |
1427 | + </group> |
1428 | + </form> |
1429 | + </field> |
1430 | + </record> |
1431 | + |
1432 | + <record id="action_res_company_wizard" model="ir.actions.act_window"> |
1433 | + <field name="name">Company Currency Difference Accounts</field> |
1434 | + <field name="type">ir.actions.act_window</field> |
1435 | + <field name="res_model">res.company.wizard</field> |
1436 | + <field name="view_type">form</field> |
1437 | + <field name="view_mode">form</field> |
1438 | + <field name="target">new</field> |
1439 | + </record> |
1440 | + |
1441 | + <record id="config_wizard_res_company_wizard" model="ir.actions.todo"> |
1442 | + <field name="name">Company Currency Difference Accounts</field> |
1443 | + <field name="note">This configuration step sets the default accounts for expense and revenue generated by exchange rate differences</field> |
1444 | + <field name="action_id" ref="action_res_company_wizard"/> |
1445 | + </record> |
1446 | + |
1447 | + |
1448 | + <record model="ir.ui.view" id="view_bank_statement_reconcile_view122"> |
1449 | + <field name="name">account.bank.statement.reconcile.form</field> |
1450 | + <field name="model">account.bank.statement.reconcile</field> |
1451 | + <field name="inherit_id" ref="account.view_bank_statement_reconcile" /> |
1452 | + <field name="type">form</field> |
1453 | + <field name="arch" type="xml"> |
1454 | + <xpath expr="//field[@name='line_new_ids']/tree/field[@name='name']" position="after"> |
1455 | + <field name="tax_code_id"/> |
1456 | + </xpath> |
1457 | + </field> |
1458 | + </record> |
1459 | + |
1460 | + <record id="view_move_line_tree1" model="ir.ui.view"> |
1461 | + <field name="name">account.move.line.tree</field> |
1462 | + <field name="model">account.move.line</field> |
1463 | + <field name="type">tree</field> |
1464 | + <field eval="1" name="priority"/> |
1465 | + <field name="inherit_id" ref="account.view_move_line_tree"/> |
1466 | + <field name="arch" type="xml"> |
1467 | + <field name="account_tax_id" position="after"> |
1468 | + <field name="tax_code_id"/> |
1469 | + <field name="tax_amount"/> |
1470 | + </field> |
1471 | + </field> |
1472 | + </record> |
1473 | + |
1474 | + <record model="ir.ui.view" id="view_bank_statement_acc_on_change_form"> |
1475 | + <field name="name">account.bank.statement.form1</field> |
1476 | + <field name="model">account.bank.statement</field> |
1477 | + <field name="inherit_id" ref="account.view_bank_statement_form" /> |
1478 | + <field name="type">form</field> |
1479 | + <field name="arch" type="xml"> |
1480 | + <field name="account_id" position="replace"> |
1481 | + <field name="account_id" on_change="onchange_account_id(account_id)"/> |
1482 | + </field> |
1483 | + </field> |
1484 | + </record> |
1485 | + |
1486 | + <record model="ir.ui.view" id="view_bank_statement_tax_tree"> |
1487 | + <field name="name">account.bank.statement.tree1</field> |
1488 | + <field name="model">account.bank.statement</field> |
1489 | + <field name="inherit_id" ref="account.view_bank_statement_form"/> |
1490 | + <field name="type">form</field> |
1491 | + <field name="arch" type="xml"> |
1492 | + <xpath expr="//field[@name='line_ids']/tree/field[@name='reconcile_amount']" position="after"> |
1493 | + <field name="tax_id"/> |
1494 | + <field name="tax_type"/> |
1495 | + </xpath> |
1496 | + </field> |
1497 | + </record> |
1498 | + |
1499 | + <record model="ir.ui.view" id="view_bank_statement_tax_form"> |
1500 | + <field name="name">account.bank.statement.form1</field> |
1501 | + <field name="model">account.bank.statement</field> |
1502 | + <field name="inherit_id" ref="account.view_bank_statement_form" /> |
1503 | + <field name="type">form</field> |
1504 | + <field name="arch" type="xml"> |
1505 | + <xpath expr="//field[@name='line_ids']/form/field[@name='ref']" position="after"> |
1506 | + <field name="tax_id"/> |
1507 | + <field name="tax_type"/> |
1508 | + </xpath> |
1509 | + </field> |
1510 | + </record> |
1511 | + |
1512 | + <record model="ir.ui.view" id="view_bank_statement_type_on_change_form"> |
1513 | + <field name="name">account.bank.statement.form1</field> |
1514 | + <field name="model">account.bank.statement</field> |
1515 | + <field name="inherit_id" ref="account.view_bank_statement_form" /> |
1516 | + <field name="type">form</field> |
1517 | + <field name="arch" type="xml"> |
1518 | + <field name="type" position="replace"> |
1519 | + <field name="type" on_change="onchange_type(type)"/> |
1520 | + </field> |
1521 | + </field> |
1522 | + </record> |
1523 | + |
1524 | + <record model="ir.ui.view" id="view_bank_statement_tax_tree1"> |
1525 | + <field name="name">account.bank.statement.tree1</field> |
1526 | + <field name="model">account.bank.statement</field> |
1527 | + <field name="inherit_id" ref="account.view_bank_statement_form"/> |
1528 | + <field name="type">form</field> |
1529 | + <field name="arch" type="xml"> |
1530 | + <xpath expr="//field[@name='line_ids']/tree/field[@name='amount']" position="after"> |
1531 | + <field name="cash_discount" on_change="onchange_cash_discount(amount, cash_discount)"/> |
1532 | + <field name="transferred_amount" on_change="onchange_transferred_amount(amount, transferred_amount)"/> |
1533 | + </xpath> |
1534 | + </field> |
1535 | + </record> |
1536 | + |
1537 | + <record model="ir.ui.view" id="view_bank_statement_tax_form1"> |
1538 | + <field name="name">account.bank.statement.form1</field> |
1539 | + <field name="model">account.bank.statement</field> |
1540 | + <field name="inherit_id" ref="account.view_bank_statement_form"/> |
1541 | + <field name="type">form</field> |
1542 | + <field name="arch" type="xml"> |
1543 | + <xpath expr="//field[@name='line_ids']/form/field[@name='amount']" position="after"> |
1544 | + <field name="cash_discount" on_change="onchange_cash_discount(amount, cash_discount)"/> |
1545 | + <field name="transferred_amount" on_change="onchange_transferred_amount(amount, transferred_amount)"/> |
1546 | + </xpath> |
1547 | + </field> |
1548 | + </record> |
1549 | + |
1550 | + </data> |
1551 | +</openerp> |
1552 | |
1553 | === added file 'account_invoice_cash_discount/account_invoice_cash_discount_wizard.xml' |
1554 | --- account_invoice_cash_discount/account_invoice_cash_discount_wizard.xml 1970-01-01 00:00:00 +0000 |
1555 | +++ account_invoice_cash_discount/account_invoice_cash_discount_wizard.xml 2011-07-29 01:35:58 +0000 |
1556 | @@ -0,0 +1,30 @@ |
1557 | +<?xml version="1.0"?> |
1558 | +<openerp> |
1559 | + <data> |
1560 | + <wizard |
1561 | + string="Import invoices" |
1562 | + model="account.bank.statement" |
1563 | + name="populate_statement_from_inv1" |
1564 | + menu="False" |
1565 | + id="wizard_populate_statement_from_inv1"/> |
1566 | + |
1567 | + <wizard |
1568 | + string="Reconcile Entries" |
1569 | + model="account.move.line" |
1570 | + name="account.move.line.discount.reconcile" |
1571 | + menu="True" |
1572 | + id="account.wizard_reconcile"/> |
1573 | + <wizard |
1574 | + string="Compute Period Wise Write-off Entry" |
1575 | + model="account.move.line" |
1576 | + name="account_period_write_calculation" |
1577 | + menu="True" |
1578 | + id="wizard_period_writeoff_calculation"/> |
1579 | + |
1580 | + <menuitem |
1581 | + action="wizard_period_writeoff_calculation" |
1582 | + id="menu_period_writeoff_calculation" |
1583 | + parent="account_payment.menu_main" |
1584 | + type="wizard"/> |
1585 | + </data> |
1586 | +</openerp> |
1587 | |
1588 | === added directory 'account_invoice_cash_discount/i18n' |
1589 | === added file 'account_invoice_cash_discount/i18n/account_invoice_cash_discount.pot' |
1590 | --- account_invoice_cash_discount/i18n/account_invoice_cash_discount.pot 1970-01-01 00:00:00 +0000 |
1591 | +++ account_invoice_cash_discount/i18n/account_invoice_cash_discount.pot 2011-07-29 01:35:58 +0000 |
1592 | @@ -0,0 +1,673 @@ |
1593 | +# Translation of OpenERP Server. |
1594 | +# This file contains the translation of the following modules: |
1595 | +# * account_invoice_cash_discount |
1596 | +# |
1597 | +msgid "" |
1598 | +msgstr "" |
1599 | +"Project-Id-Version: OpenERP Server 5.0.14\n" |
1600 | +"Report-Msgid-Bugs-To: support@openerp.com\n" |
1601 | +"POT-Creation-Date: 2010-10-07 16:33:48+0000\n" |
1602 | +"PO-Revision-Date: 2010-10-07 16:33:48+0000\n" |
1603 | +"Last-Translator: Thomas Dreiling <thomas.dreiling@global-distribution.de>\n" |
1604 | +"Language-Team: \n" |
1605 | +"MIME-Version: 1.0\n" |
1606 | +"Content-Type: text/plain; charset=UTF-8\n" |
1607 | +"Content-Transfer-Encoding: \n" |
1608 | +"Plural-Forms: \n" |
1609 | + |
1610 | +#. module: account_invoice_cash_discount |
1611 | +#: code:addons/account_invoice_cash_discount/wizard/wizard_discount_reconcile.py:0 |
1612 | +#, python-format |
1613 | +msgid "Write-Off" |
1614 | +msgstr "" |
1615 | + |
1616 | +#. module: account_invoice_cash_discount |
1617 | +#: field:account.invoice.pay,discount_move_ids:0 |
1618 | +msgid "Account Discount Moves" |
1619 | +msgstr "" |
1620 | + |
1621 | +#. module: account_invoice_cash_discount |
1622 | +#: selection:account.invoice.pay,cal_method_selection:0 |
1623 | +msgid "Calculate Discount with Gross Methodology" |
1624 | +msgstr "" |
1625 | + |
1626 | +#. module: account_invoice_cash_discount |
1627 | +#: constraint:ir.actions.act_window:0 |
1628 | +msgid "Invalid model name in the action definition." |
1629 | +msgstr "" |
1630 | + |
1631 | +#. module: account_invoice_cash_discount |
1632 | +#: field:account.bank.statement.reconcile.line,tax_code_id:0 |
1633 | +#: field:account.move.line.memory,tax_code_id:0 |
1634 | +msgid "Tax Account" |
1635 | +msgstr "" |
1636 | + |
1637 | +#. module: account_invoice_cash_discount |
1638 | +#: code:addons/account_invoice_cash_discount/account_invoice_cash_discount.py:0 |
1639 | +#, python-format |
1640 | +msgid "Entries are not of the same account or already reconciled!" |
1641 | +msgstr "" |
1642 | + |
1643 | +#. module: account_invoice_cash_discount |
1644 | +#: code:addons/account_invoice_cash_discount/account_invoice_cash_discount.py:0 |
1645 | +#, python-format |
1646 | +msgid "Account move line \"%s\" is not valid" |
1647 | +msgstr "" |
1648 | + |
1649 | +#. module: account_invoice_cash_discount |
1650 | +#: model:ir.model,name:account_invoice_cash_discount.model_res_company_wizard |
1651 | +msgid "res.company.wizard" |
1652 | +msgstr "" |
1653 | + |
1654 | +#. module: account_invoice_cash_discount |
1655 | +#: field:account.invoice.pay,cash_amount:0 |
1656 | +msgid "Cash Discount Amount" |
1657 | +msgstr "" |
1658 | + |
1659 | +#. module: account_invoice_cash_discount |
1660 | +#: field:account.move.line.memory,account_id:0 |
1661 | +msgid "Account" |
1662 | +msgstr "" |
1663 | + |
1664 | +#. module: account_invoice_cash_discount |
1665 | +#: field:account.invoice.pay,journal_id:0 |
1666 | +msgid "Journal/Payment Mode" |
1667 | +msgstr "" |
1668 | + |
1669 | +#. module: account_invoice_cash_discount |
1670 | +#: view:account.message:0 |
1671 | +#: view:account.partial.message:0 |
1672 | +msgid "Messages" |
1673 | +msgstr "" |
1674 | + |
1675 | +#. module: account_invoice_cash_discount |
1676 | +#: wizard_field:account_period_write_calculation,init,tax_id:0 |
1677 | +msgid "Taxes" |
1678 | +msgstr "" |
1679 | + |
1680 | +#. module: account_invoice_cash_discount |
1681 | +#: code:addons/account_invoice_cash_discount/account_invoice_cash_discount.py:0 |
1682 | +#: code:addons/account_invoice_cash_discount/wizard/account_pay_invoice.py:0 |
1683 | +#, python-format |
1684 | +msgid "Error!" |
1685 | +msgstr "" |
1686 | + |
1687 | +#. module: account_invoice_cash_discount |
1688 | +#: code:addons/account_invoice_cash_discount/account_invoice_cash_discount.py:0 |
1689 | +#, python-format |
1690 | +msgid "The statement balance is incorrect!\n" |
1691 | +msgstr "" |
1692 | + |
1693 | +#. module: account_invoice_cash_discount |
1694 | +#: view:account.message:0 |
1695 | +#: view:account.partial.message:0 |
1696 | +msgid "OK" |
1697 | +msgstr "" |
1698 | + |
1699 | +#. module: account_invoice_cash_discount |
1700 | +#: view:account.bank.statement.reconcile:0 |
1701 | +msgid "Reconcile" |
1702 | +msgstr "" |
1703 | + |
1704 | +#. module: account_invoice_cash_discount |
1705 | +#: wizard_view:account_period_write_calculation,init:0 |
1706 | +msgid "Calculation" |
1707 | +msgstr "" |
1708 | + |
1709 | +#. module: account_invoice_cash_discount |
1710 | +#: code:addons/account_invoice_cash_discount/account_invoice_cash_discount.py:0 |
1711 | +#, python-format |
1712 | +msgid "Currency Expense" |
1713 | +msgstr "" |
1714 | + |
1715 | +#. module: account_invoice_cash_discount |
1716 | +#: field:account.bank.statement.line,tax_id:0 |
1717 | +msgid "Tax" |
1718 | +msgstr "" |
1719 | + |
1720 | +#. module: account_invoice_cash_discount |
1721 | +#: field:account.move.line.memory,date:0 |
1722 | +msgid "Effective Date" |
1723 | +msgstr "" |
1724 | + |
1725 | +#. module: account_invoice_cash_discount |
1726 | +#: field:account.invoice.pay.writeoff,analytic_id:0 |
1727 | +#: field:account.move.line.memory,analytic_account_id:0 |
1728 | +msgid "Analytic Account" |
1729 | +msgstr "" |
1730 | + |
1731 | +#. module: account_invoice_cash_discount |
1732 | +#: field:account.cash.discount,discount_account_id:0 |
1733 | +msgid "Customer Discount Account" |
1734 | +msgstr "" |
1735 | + |
1736 | +#. module: account_invoice_cash_discount |
1737 | +#: code:addons/account_invoice_cash_discount/account_invoice_cash_discount.py:0 |
1738 | +#, python-format |
1739 | +msgid "Entry \"%s\" is not valid !" |
1740 | +msgstr "" |
1741 | + |
1742 | +#. module: account_invoice_cash_discount |
1743 | +#: wizard_button:populate_statement_from_inv1,go,end:0 |
1744 | +#: wizard_button:populate_statement_from_inv1,init,end:0 |
1745 | +msgid "_Cancel" |
1746 | +msgstr "" |
1747 | + |
1748 | +#. module: account_invoice_cash_discount |
1749 | +#: view:account.cash.discount:0 |
1750 | +#: view:account.payment.term:0 |
1751 | +#: code:addons/account_invoice_cash_discount/account_invoice_cash_discount.py:0 |
1752 | +#: code:addons/account_invoice_cash_discount/wizard/wizard_discount_reconcile.py:0 |
1753 | +#: model:ir.model,name:account_invoice_cash_discount.model_account_cash_discount |
1754 | +#, python-format |
1755 | +msgid "Cash Discount" |
1756 | +msgstr "" |
1757 | + |
1758 | +#. module: account_invoice_cash_discount |
1759 | +#: view:account.invoice.pay.writeoff:0 |
1760 | +msgid "Pay and Reconcile" |
1761 | +msgstr "" |
1762 | + |
1763 | +#. module: account_invoice_cash_discount |
1764 | +#: view:account.invoice.pay:0 |
1765 | +msgid "Method For Calculation" |
1766 | +msgstr "" |
1767 | + |
1768 | +#. module: account_invoice_cash_discount |
1769 | +#: view:account.invoice.pay.writeoff:0 |
1770 | +msgid "Write-Off Move" |
1771 | +msgstr "" |
1772 | + |
1773 | +#. module: account_invoice_cash_discount |
1774 | +#: selection:account.invoice.pay,cal_method_selection:0 |
1775 | +msgid "Calculate Discount with Net Methodology" |
1776 | +msgstr "" |
1777 | + |
1778 | +#. module: account_invoice_cash_discount |
1779 | +#: code:addons/account_invoice_cash_discount/account_invoice_cash_discount.py:0 |
1780 | +#, python-format |
1781 | +msgid "Please verify that an account is defined in the journal." |
1782 | +msgstr "" |
1783 | + |
1784 | +#. module: account_invoice_cash_discount |
1785 | +#: field:account.move.line.memory,debit:0 |
1786 | +msgid "Debit" |
1787 | +msgstr "" |
1788 | + |
1789 | +#. module: account_invoice_cash_discount |
1790 | +#: model:ir.actions.act_window,name:account_invoice_cash_discount.action_res_company_wizard |
1791 | +msgid "Company Currency Difference Accounts" |
1792 | +msgstr "" |
1793 | + |
1794 | +#. module: account_invoice_cash_discount |
1795 | +#: wizard_view:account_period_write_calculation,init:0 |
1796 | +msgid "Calculation of period-wise Write-Off Amount" |
1797 | +msgstr "" |
1798 | + |
1799 | +#. module: account_invoice_cash_discount |
1800 | +#: field:account.payment.term.line,day_tolerance:0 |
1801 | +msgid "Tolerance (Days)" |
1802 | +msgstr "" |
1803 | + |
1804 | +#. module: account_invoice_cash_discount |
1805 | +#: wizard_button:populate_statement_from_inv1,init,go:0 |
1806 | +msgid "_Go" |
1807 | +msgstr "" |
1808 | + |
1809 | +#. module: account_invoice_cash_discount |
1810 | +#: field:account.cash.discount,delay:0 |
1811 | +msgid "Number of Days" |
1812 | +msgstr "" |
1813 | + |
1814 | +#. module: account_invoice_cash_discount |
1815 | +#: code:addons/account_invoice_cash_discount/wizard/wizard_write_period_entry_calculation.py:0 |
1816 | +#, python-format |
1817 | +msgid "Computed Entries" |
1818 | +msgstr "" |
1819 | + |
1820 | +#. module: account_invoice_cash_discount |
1821 | +#: code:addons/account_invoice_cash_discount/account_invoice_cash_discount.py:0 |
1822 | +#, python-format |
1823 | +msgid "Entry is already reconciled!" |
1824 | +msgstr "" |
1825 | + |
1826 | +#. module: account_invoice_cash_discount |
1827 | +#: code:addons/account_invoice_cash_discount/account_invoice_cash_discount.py:0 |
1828 | +#, python-format |
1829 | +msgid "Configuration Error!" |
1830 | +msgstr "" |
1831 | + |
1832 | +#. module: account_invoice_cash_discount |
1833 | +#: field:account.bank.statement.line,tax_type:0 |
1834 | +msgid "Tax method" |
1835 | +msgstr "" |
1836 | + |
1837 | +#. module: account_invoice_cash_discount |
1838 | +#: constraint:ir.ui.view:0 |
1839 | +msgid "Invalid XML for View Architecture!" |
1840 | +msgstr "" |
1841 | + |
1842 | +#. module: account_invoice_cash_discount |
1843 | +#: view:account.invoice.pay:0 |
1844 | +#: model:ir.actions.act_window,name:account_invoice_cash_discount.action_view_account_invoice_pay |
1845 | +msgid "Pay Invoice" |
1846 | +msgstr "" |
1847 | + |
1848 | +#. module: account_invoice_cash_discount |
1849 | +#: code:addons/account_invoice_cash_discount/account_invoice_cash_discount.py:0 |
1850 | +#, python-format |
1851 | +msgid "Currency Revenue" |
1852 | +msgstr "" |
1853 | + |
1854 | +#. module: account_invoice_cash_discount |
1855 | +#: view:account.invoice.pay:0 |
1856 | +#: view:account.partial.message:0 |
1857 | +msgid "Partial Payment" |
1858 | +msgstr "" |
1859 | + |
1860 | +#. module: account_invoice_cash_discount |
1861 | +#: field:account.cash.discount,discount:0 |
1862 | +msgid "Discount (%)" |
1863 | +msgstr "" |
1864 | + |
1865 | +#. module: account_invoice_cash_discount |
1866 | +#: field:account.invoice.pay.writeoff,comment:0 |
1867 | +msgid "Comment" |
1868 | +msgstr "" |
1869 | + |
1870 | +#. module: account_invoice_cash_discount |
1871 | +#: wizard_field:populate_statement_from_inv1,go,lines:0 |
1872 | +msgid "Invoices" |
1873 | +msgstr "" |
1874 | + |
1875 | +#. module: account_invoice_cash_discount |
1876 | +#: field:account.cash.discount,sup_discount_account_id:0 |
1877 | +msgid "Supplier Discount Account" |
1878 | +msgstr "" |
1879 | + |
1880 | +#. module: account_invoice_cash_discount |
1881 | +#: field:account.move.line.memory,currency_id:0 |
1882 | +msgid "Currency" |
1883 | +msgstr "" |
1884 | + |
1885 | +#. module: account_invoice_cash_discount |
1886 | +#: view:account.invoice.pay:0 |
1887 | +#: view:account.message:0 |
1888 | +msgid "Full Payment" |
1889 | +msgstr "" |
1890 | + |
1891 | +#. module: account_invoice_cash_discount |
1892 | +#: code:addons/account_invoice_cash_discount/wizard/account_pay_invoice.py:0 |
1893 | +#, python-format |
1894 | +msgid "Message" |
1895 | +msgstr "" |
1896 | + |
1897 | +#. module: account_invoice_cash_discount |
1898 | +#: view:res.company:0 |
1899 | +msgid "Acc for Rev from Curr Diff" |
1900 | +msgstr "" |
1901 | + |
1902 | +#. module: account_invoice_cash_discount |
1903 | +#: view:account.invoice.pay:0 |
1904 | +msgid "Calculate" |
1905 | +msgstr "" |
1906 | + |
1907 | +#. module: account_invoice_cash_discount |
1908 | +#: view:account.invoice.pay.writeoff:0 |
1909 | +#: code:addons/account_invoice_cash_discount/wizard/account_pay_invoice.py:0 |
1910 | +#, python-format |
1911 | +msgid "Information Addendum" |
1912 | +msgstr "" |
1913 | + |
1914 | +#. module: account_invoice_cash_discount |
1915 | +#: model:ir.module.module,shortdesc:account_invoice_cash_discount.module_meta_information |
1916 | +msgid "Payment Term with Cash Discount" |
1917 | +msgstr "" |
1918 | + |
1919 | +#. module: account_invoice_cash_discount |
1920 | +#: wizard_view:populate_statement_from_inv1,init:0 |
1921 | +msgid "Choose Journal and Payment Date" |
1922 | +msgstr "" |
1923 | + |
1924 | +#. module: account_invoice_cash_discount |
1925 | +#: help:populate_statement_from_inv1,init,journal_id:0 |
1926 | +msgid "This field allows you to choose the accounting journals you want to search invoices in. If you leave this field empty all sale, purchase and cash journals will be searched." |
1927 | +msgstr "" |
1928 | + |
1929 | +#. module: account_invoice_cash_discount |
1930 | +#: field:account.invoice.pay,account_id:0 |
1931 | +#: wizard_field:account_period_write_calculation,init,cash_discount_id:0 |
1932 | +msgid "Cash Discount Account" |
1933 | +msgstr "" |
1934 | + |
1935 | +#. module: account_invoice_cash_discount |
1936 | +#: constraint:ir.model:0 |
1937 | +msgid "The Object name must start with x_ and not contain any special character !" |
1938 | +msgstr "" |
1939 | + |
1940 | +#. module: account_invoice_cash_discount |
1941 | +#: model:ir.actions.wizard,name:account_invoice_cash_discount.wizard_populate_statement_from_inv1 |
1942 | +msgid "Import invoices" |
1943 | +msgstr "" |
1944 | + |
1945 | +#. module: account_invoice_cash_discount |
1946 | +#: view:account.bank.statement.reconcile:0 |
1947 | +msgid "Write-Off and Cash Discount" |
1948 | +msgstr "" |
1949 | + |
1950 | +#. module: account_invoice_cash_discount |
1951 | +#: view:res.company:0 |
1952 | +msgid "Acc for Exp from Curr Diff" |
1953 | +msgstr "" |
1954 | + |
1955 | +#. module: account_invoice_cash_discount |
1956 | +#: model:ir.model,name:account_invoice_cash_discount.model_account_message |
1957 | +msgid "account.message" |
1958 | +msgstr "" |
1959 | + |
1960 | +#. module: account_invoice_cash_discount |
1961 | +#: code:addons/account_invoice_cash_discount/account_invoice_cash_discount.py:0 |
1962 | +#, python-format |
1963 | +msgid "The expected balance (%.2f) is different than the computed one. (%.2f)" |
1964 | +msgstr "" |
1965 | + |
1966 | +#. module: account_invoice_cash_discount |
1967 | +#: code:addons/account_invoice_cash_discount/wizard/account_pay_invoice.py:0 |
1968 | +#, python-format |
1969 | +msgid "Your journal must have a default credit and debit account." |
1970 | +msgstr "" |
1971 | + |
1972 | +#. module: account_invoice_cash_discount |
1973 | +#: field:res.company,revenue_account_id:0 |
1974 | +#: field:res.company.wizard,revenue_account_id:0 |
1975 | +msgid "Account for Revenue from Exchange Rate Difference" |
1976 | +msgstr "" |
1977 | + |
1978 | +#. module: account_invoice_cash_discount |
1979 | +#: field:account.invoice.pay,date:0 |
1980 | +#: wizard_field:populate_statement_from_inv1,init,date:0 |
1981 | +msgid "Payment Date" |
1982 | +msgstr "" |
1983 | + |
1984 | +#. module: account_invoice_cash_discount |
1985 | +#: selection:account.bank.statement.line,tax_type:0 |
1986 | +msgid "Untaxed" |
1987 | +msgstr "" |
1988 | + |
1989 | +#. module: account_invoice_cash_discount |
1990 | +#: wizard_button:account_period_write_calculation,init,calculate:0 |
1991 | +msgid "Compute" |
1992 | +msgstr "" |
1993 | + |
1994 | +#. module: account_invoice_cash_discount |
1995 | +#: view:account.bank.statement:0 |
1996 | +msgid "Import Invoice" |
1997 | +msgstr "" |
1998 | + |
1999 | +#. module: account_invoice_cash_discount |
2000 | +#: selection:account.bank.statement.line,tax_type:0 |
2001 | +msgid "Tax included" |
2002 | +msgstr "" |
2003 | + |
2004 | +#. module: account_invoice_cash_discount |
2005 | +#: field:account.invoice.pay.writeoff,writeoff_journal_id:0 |
2006 | +msgid "Write-Off Journal" |
2007 | +msgstr "" |
2008 | + |
2009 | +#. module: account_invoice_cash_discount |
2010 | +#: field:account.move.line.memory,credit:0 |
2011 | +msgid "Credit" |
2012 | +msgstr "" |
2013 | + |
2014 | +#. module: account_invoice_cash_discount |
2015 | +#: field:account.move.line.memory,amount_currency:0 |
2016 | +msgid "Amount Currency" |
2017 | +msgstr "" |
2018 | + |
2019 | +#. module: account_invoice_cash_discount |
2020 | +#: field:account.invoice.pay,tax_move_ids:0 |
2021 | +msgid "Account Taxes Moves" |
2022 | +msgstr "" |
2023 | + |
2024 | +#. module: account_invoice_cash_discount |
2025 | +#: model:ir.model,name:account_invoice_cash_discount.model_account_move_line_memory |
2026 | +msgid "Account move line memory " |
2027 | +msgstr "" |
2028 | + |
2029 | +#. module: account_invoice_cash_discount |
2030 | +#: field:account.invoice.pay,name:0 |
2031 | +msgid "Entry Name" |
2032 | +msgstr "" |
2033 | + |
2034 | +#. module: account_invoice_cash_discount |
2035 | +#: help:account.move.line.memory,amount_currency:0 |
2036 | +msgid "The amount in the optional foreign currency if it is a multi-currency entry." |
2037 | +msgstr "" |
2038 | + |
2039 | +#. module: account_invoice_cash_discount |
2040 | +#: code:addons/account_invoice_cash_discount/account_invoice_cash_discount.py:0 |
2041 | +#, python-format |
2042 | +msgid "Unable to reconcile entry \"%s\": %.2f" |
2043 | +msgstr "" |
2044 | + |
2045 | +#. module: account_invoice_cash_discount |
2046 | +#: field:account.invoice.pay,cash_residual_amount:0 |
2047 | +msgid "Residual Amount" |
2048 | +msgstr "" |
2049 | + |
2050 | +#. module: account_invoice_cash_discount |
2051 | +#: code:addons/account_invoice_cash_discount/account_invoice_cash_discount.py:0 |
2052 | +#, python-format |
2053 | +msgid "The account entry lines are not in valid state." |
2054 | +msgstr "" |
2055 | + |
2056 | +#. module: account_invoice_cash_discount |
2057 | +#: code:addons/account_invoice_cash_discount/account_invoice_cash_discount.py:0 |
2058 | +#, python-format |
2059 | +msgid "You have to provide a cash discount account!" |
2060 | +msgstr "" |
2061 | + |
2062 | +#. module: account_invoice_cash_discount |
2063 | +#: view:account.message:0 |
2064 | +msgid "Do you really want to reconcile this invoice? The proposed payment does not completely balance the invoiced amount. Please check the payment term lines. Usually, one would use Partial Payment to avoid the ready/paid state for this invoice." |
2065 | +msgstr "" |
2066 | + |
2067 | +#. module: account_invoice_cash_discount |
2068 | +#: field:account.invoice.pay,period_id:0 |
2069 | +#: wizard_field:account_period_write_calculation,init,period_id:0 |
2070 | +msgid "Period" |
2071 | +msgstr "" |
2072 | + |
2073 | +#. module: account_invoice_cash_discount |
2074 | +#: model:ir.module.module,description:account_invoice_cash_discount.module_meta_information |
2075 | +msgid "\n" |
2076 | +" Module to add account move lines in case of payment with cash discount conditions in reconcilation form.\n" |
2077 | +" " |
2078 | +msgstr "" |
2079 | + |
2080 | +#. module: account_invoice_cash_discount |
2081 | +#: field:account.payment.term.line,compl_cash_discount:0 |
2082 | +msgid "Use Complete Cash Discount" |
2083 | +msgstr "" |
2084 | + |
2085 | +#. module: account_invoice_cash_discount |
2086 | +#: selection:account.bank.statement.line,tax_type:0 |
2087 | +msgid "Tax excluded" |
2088 | +msgstr "" |
2089 | + |
2090 | +#. module: account_invoice_cash_discount |
2091 | +#: view:account.invoice.pay:0 |
2092 | +#: view:account.invoice.pay.writeoff:0 |
2093 | +#: view:account.message:0 |
2094 | +#: view:account.partial.message:0 |
2095 | +#: wizard_button:account_period_write_calculation,init,end:0 |
2096 | +#: view:res.company.wizard:0 |
2097 | +msgid "Cancel" |
2098 | +msgstr "" |
2099 | + |
2100 | +#. module: account_invoice_cash_discount |
2101 | +#: code:addons/account_invoice_cash_discount/wizard/account_pay_invoice.py:0 |
2102 | +#, python-format |
2103 | +msgid "Cannot pay invoices in draft/proforma/cancel/done state." |
2104 | +msgstr "" |
2105 | + |
2106 | +#. module: account_invoice_cash_discount |
2107 | +#: field:account.payment.term,cash_discount_ids:0 |
2108 | +msgid "Cash Discount Terms" |
2109 | +msgstr "" |
2110 | + |
2111 | +#. module: account_invoice_cash_discount |
2112 | +#: wizard_view:populate_statement_from_inv1,init:0 |
2113 | +msgid "Import Invoices in Statement" |
2114 | +msgstr "" |
2115 | + |
2116 | +#. module: account_invoice_cash_discount |
2117 | +#: code:addons/account_invoice_cash_discount/account_invoice_cash_discount.py:0 |
2118 | +#, python-format |
2119 | +msgid "Can only pay one invoice at a time!" |
2120 | +msgstr "" |
2121 | + |
2122 | +#. module: account_invoice_cash_discount |
2123 | +#: field:res.company,expense_account_id:0 |
2124 | +#: field:res.company.wizard,expense_account_id:0 |
2125 | +msgid "Account for Expense from Exchange Rate Difference" |
2126 | +msgstr "" |
2127 | + |
2128 | +#. module: account_invoice_cash_discount |
2129 | +#: view:account.partial.message:0 |
2130 | +msgid "Do you really want to NOT reconcile this invoice? The proposed payment completely balances the invoiced amount. Please check the payment term lines. Usually, one would use Full Payment to receive ready/paid state for this invoice." |
2131 | +msgstr "" |
2132 | + |
2133 | +#. module: account_invoice_cash_discount |
2134 | +#: view:account.invoice.pay.writeoff:0 |
2135 | +msgid "Analytic" |
2136 | +msgstr "" |
2137 | + |
2138 | +#. module: account_invoice_cash_discount |
2139 | +#: view:account.move.line.memory:0 |
2140 | +msgid "Account Move Line" |
2141 | +msgstr "" |
2142 | + |
2143 | +#. module: account_invoice_cash_discount |
2144 | +#: model:ir.model,name:account_invoice_cash_discount.model_account_invoice_pay |
2145 | +#: model:ir.model,name:account_invoice_cash_discount.model_account_invoice_pay_writeoff |
2146 | +msgid "Pay Invoice " |
2147 | +msgstr "" |
2148 | + |
2149 | +#. module: account_invoice_cash_discount |
2150 | +#: view:res.company.wizard:0 |
2151 | +msgid "Set Default" |
2152 | +msgstr "" |
2153 | + |
2154 | +#. module: account_invoice_cash_discount |
2155 | +#: code:addons/account_invoice_cash_discount/account_invoice_cash_discount.py:0 |
2156 | +#, python-format |
2157 | +msgid "The account is not configured to be reconciled!" |
2158 | +msgstr "" |
2159 | + |
2160 | +#. module: account_invoice_cash_discount |
2161 | +#: field:account.move.line.memory,tax_amount:0 |
2162 | +msgid "Tax/Base Amount" |
2163 | +msgstr "" |
2164 | + |
2165 | +#. module: account_invoice_cash_discount |
2166 | +#: field:account.cash.discount,payment_id:0 |
2167 | +msgid "Related Payment Term" |
2168 | +msgstr "" |
2169 | + |
2170 | +#. module: account_invoice_cash_discount |
2171 | +#: view:account.invoice.pay:0 |
2172 | +msgid "Account Cash Discount Moves" |
2173 | +msgstr "" |
2174 | + |
2175 | +#. module: account_invoice_cash_discount |
2176 | +#: view:account.cash.discount:0 |
2177 | +msgid "Cash Discount Account for Supplier and Customer" |
2178 | +msgstr "" |
2179 | + |
2180 | +#. module: account_invoice_cash_discount |
2181 | +#: wizard_button:populate_statement_from_inv1,go,finish:0 |
2182 | +msgid "O_k" |
2183 | +msgstr "" |
2184 | + |
2185 | +#. module: account_invoice_cash_discount |
2186 | +#: code:addons/account_invoice_cash_discount/account_invoice_cash_discount.py:0 |
2187 | +#, python-format |
2188 | +msgid "Some entries are already reconciled!" |
2189 | +msgstr "" |
2190 | + |
2191 | +#. module: account_invoice_cash_discount |
2192 | +#: code:addons/account_invoice_cash_discount/account_invoice_cash_discount.py:0 |
2193 | +#, python-format |
2194 | +msgid "There seems to be a surcharge, not a cash discount. Can\'t reconcile this!" |
2195 | +msgstr "" |
2196 | + |
2197 | +#. module: account_invoice_cash_discount |
2198 | +#: field:account.cash.discount,name:0 |
2199 | +#: field:account.move.line.memory,name:0 |
2200 | +msgid "Name" |
2201 | +msgstr "" |
2202 | + |
2203 | +#. module: account_invoice_cash_discount |
2204 | +#: view:account.bank.statement.reconcile:0 |
2205 | +msgid "Total Write-Off/Cash Discount" |
2206 | +msgstr "" |
2207 | + |
2208 | +#. module: account_invoice_cash_discount |
2209 | +#: model:ir.actions.wizard,name:account_invoice_cash_discount.wizard_period_writeoff_calculation |
2210 | +#: model:ir.ui.menu,name:account_invoice_cash_discount.menu_period_writeoff_calculation |
2211 | +msgid "Compute Period Wise Write-off Entry" |
2212 | +msgstr "" |
2213 | + |
2214 | +#. module: account_invoice_cash_discount |
2215 | +#: view:res.company.wizard:0 |
2216 | +msgid "Currency Difference Account Configuration" |
2217 | +msgstr "" |
2218 | + |
2219 | +#. module: account_invoice_cash_discount |
2220 | +#: field:account.invoice.pay,cal_method_selection:0 |
2221 | +msgid "Method for Calculation" |
2222 | +msgstr "" |
2223 | + |
2224 | +#. module: account_invoice_cash_discount |
2225 | +#: field:account.invoice.pay,amount:0 |
2226 | +msgid "Amount Paid" |
2227 | +msgstr "" |
2228 | + |
2229 | +#. module: account_invoice_cash_discount |
2230 | +#: view:account.invoice.pay:0 |
2231 | +msgid "Tax Account Moves" |
2232 | +msgstr "" |
2233 | + |
2234 | +#. module: account_invoice_cash_discount |
2235 | +#: model:ir.model,name:account_invoice_cash_discount.model_account_partial_message |
2236 | +msgid "account.partial.message" |
2237 | +msgstr "" |
2238 | + |
2239 | +#. module: account_invoice_cash_discount |
2240 | +#: help:account.move.line.memory,currency_id:0 |
2241 | +msgid "The optional foreign currency if it is a multi-currency entry." |
2242 | +msgstr "" |
2243 | + |
2244 | +#. module: account_invoice_cash_discount |
2245 | +#: help:account.move.line.memory,tax_code_id:0 |
2246 | +msgid "The account can either be a base tax code or tax code account." |
2247 | +msgstr "" |
2248 | + |
2249 | +#. module: account_invoice_cash_discount |
2250 | +#: field:account.invoice.pay.writeoff,writeoff_acc_id:0 |
2251 | +msgid "Write-Off Account" |
2252 | +msgstr "" |
2253 | + |
2254 | +#. module: account_invoice_cash_discount |
2255 | +#: field:account.move.line.memory,journal_id:0 |
2256 | +#: wizard_field:account_period_write_calculation,init,journal_id:0 |
2257 | +#: wizard_field:populate_statement_from_inv1,init,journal_id:0 |
2258 | +msgid "Journal" |
2259 | +msgstr "" |
2260 | + |
2261 | +#. module: account_invoice_cash_discount |
2262 | +#: model:ir.actions.todo,note:account_invoice_cash_discount.config_wizard_res_company_wizard |
2263 | +msgid "This configuration step sets the default accounts for expense and revenue generated by exchange rate differences" |
2264 | +msgstr "" |
2265 | + |
2266 | |
2267 | === added file 'account_invoice_cash_discount/i18n/de_DE.po' |
2268 | --- account_invoice_cash_discount/i18n/de_DE.po 1970-01-01 00:00:00 +0000 |
2269 | +++ account_invoice_cash_discount/i18n/de_DE.po 2011-07-29 01:35:58 +0000 |
2270 | @@ -0,0 +1,675 @@ |
2271 | +# Translation of OpenERP Server. |
2272 | +# This file contains the translation of the following modules: |
2273 | +# * account_invoice_cash_discount |
2274 | +# |
2275 | +msgid "" |
2276 | +msgstr "" |
2277 | +"Project-Id-Version: OpenERP Server 5.0.14\n" |
2278 | +"Report-Msgid-Bugs-To: support@openerp.com\n" |
2279 | +"POT-Creation-Date: 2010-10-07 16:33:48+0000\n" |
2280 | +"PO-Revision-Date: 2010-10-07 16:33:48+0000\n" |
2281 | +"Last-Translator: Thomas Dreiling <thomas.dreiling@global-distribution.de>\n" |
2282 | +"Language-Team: \n" |
2283 | +"MIME-Version: 1.0\n" |
2284 | +"Content-Type: text/plain; charset=UTF-8\n" |
2285 | +"Content-Transfer-Encoding: \n" |
2286 | +"Plural-Forms: \n" |
2287 | + |
2288 | +#. module: account_invoice_cash_discount |
2289 | +#: code:addons/account_invoice_cash_discount/wizard/wizard_discount_reconcile.py:0 |
2290 | +#, python-format |
2291 | +msgid "Write-Off" |
2292 | +msgstr "Abschreibung" |
2293 | + |
2294 | +#. module: account_invoice_cash_discount |
2295 | +#: field:account.invoice.pay,discount_move_ids:0 |
2296 | +msgid "Account Discount Moves" |
2297 | +msgstr "Skontobuchungen" |
2298 | + |
2299 | +#. module: account_invoice_cash_discount |
2300 | +#: selection:account.invoice.pay,cal_method_selection:0 |
2301 | +msgid "Calculate Discount with Gross Methodology" |
2302 | +msgstr "Berechne Skonto mit Bruttomethode" |
2303 | + |
2304 | +#. module: account_invoice_cash_discount |
2305 | +#: constraint:ir.actions.act_window:0 |
2306 | +msgid "Invalid model name in the action definition." |
2307 | +msgstr "Ungültiger Modellname in der Aktionsdefinition." |
2308 | + |
2309 | +#. module: account_invoice_cash_discount |
2310 | +#: field:account.bank.statement.reconcile.line,tax_code_id:0 |
2311 | +#: field:account.move.line.memory,tax_code_id:0 |
2312 | +msgid "Tax Account" |
2313 | +msgstr "Steuerkonto" |
2314 | + |
2315 | +#. module: account_invoice_cash_discount |
2316 | +#: code:addons/account_invoice_cash_discount/account_invoice_cash_discount.py:0 |
2317 | +#, python-format |
2318 | +msgid "Entries are not of the same account or already reconciled!" |
2319 | +msgstr "Buchungen gehören nicht zum selben Konto oder sind bereits ausgeglichen!" |
2320 | + |
2321 | +#. module: account_invoice_cash_discount |
2322 | +#: code:addons/account_invoice_cash_discount/account_invoice_cash_discount.py:0 |
2323 | +#, python-format |
2324 | +msgid "Account move line \"%s\" is not valid" |
2325 | +msgstr "Buchungszeile \"%s\" ist ungültig" |
2326 | + |
2327 | +#. module: account_invoice_cash_discount |
2328 | +#: model:ir.model,name:account_invoice_cash_discount.model_res_company_wizard |
2329 | +msgid "res.company.wizard" |
2330 | +msgstr "res.company.wizard" |
2331 | + |
2332 | +#. module: account_invoice_cash_discount |
2333 | +#: field:account.invoice.pay,cash_amount:0 |
2334 | +msgid "Cash Discount Amount" |
2335 | +msgstr "Skontobetrag" |
2336 | + |
2337 | +#. module: account_invoice_cash_discount |
2338 | +#: field:account.move.line.memory,account_id:0 |
2339 | +msgid "Account" |
2340 | +msgstr "Konto" |
2341 | + |
2342 | +#. module: account_invoice_cash_discount |
2343 | +#: field:account.invoice.pay,journal_id:0 |
2344 | +msgid "Journal/Payment Mode" |
2345 | +msgstr "Journal/Zahlungsweise" |
2346 | + |
2347 | +#. module: account_invoice_cash_discount |
2348 | +#: view:account.message:0 |
2349 | +#: view:account.partial.message:0 |
2350 | +msgid "Messages" |
2351 | +msgstr "Nachrichten" |
2352 | + |
2353 | +#. module: account_invoice_cash_discount |
2354 | +#: wizard_field:account_period_write_calculation,init,tax_id:0 |
2355 | +msgid "Taxes" |
2356 | +msgstr "Steuern" |
2357 | + |
2358 | +#. module: account_invoice_cash_discount |
2359 | +#: code:addons/account_invoice_cash_discount/account_invoice_cash_discount.py:0 |
2360 | +#: code:addons/account_invoice_cash_discount/wizard/account_pay_invoice.py:0 |
2361 | +#, python-format |
2362 | +msgid "Error!" |
2363 | +msgstr "Fehler!" |
2364 | + |
2365 | +#. module: account_invoice_cash_discount |
2366 | +#: code:addons/account_invoice_cash_discount/account_invoice_cash_discount.py:0 |
2367 | +#, python-format |
2368 | +msgid "The statement balance is incorrect!\n" |
2369 | +msgstr "Das Saldo des Kontoauszugs stimmt nicht!\n" |
2370 | + |
2371 | +#. module: account_invoice_cash_discount |
2372 | +#: view:account.message:0 |
2373 | +#: view:account.partial.message:0 |
2374 | +msgid "OK" |
2375 | +msgstr "OK" |
2376 | + |
2377 | +#. module: account_invoice_cash_discount |
2378 | +#: view:account.bank.statement.reconcile:0 |
2379 | +msgid "Reconcile" |
2380 | +msgstr "OP-Ausgleich" |
2381 | + |
2382 | +#. module: account_invoice_cash_discount |
2383 | +#: wizard_view:account_period_write_calculation,init:0 |
2384 | +msgid "Calculation" |
2385 | +msgstr "Berechnung" |
2386 | + |
2387 | +#. module: account_invoice_cash_discount |
2388 | +#: code:addons/account_invoice_cash_discount/account_invoice_cash_discount.py:0 |
2389 | +#, python-format |
2390 | +msgid "Currency Expense" |
2391 | +msgstr "Kursaufwand" |
2392 | + |
2393 | +#. module: account_invoice_cash_discount |
2394 | +#: field:account.bank.statement.line,tax_id:0 |
2395 | +msgid "Tax" |
2396 | +msgstr "Steuer" |
2397 | + |
2398 | +#. module: account_invoice_cash_discount |
2399 | +#: field:account.move.line.memory,date:0 |
2400 | +msgid "Effective Date" |
2401 | +msgstr "Stichtag" |
2402 | + |
2403 | +#. module: account_invoice_cash_discount |
2404 | +#: field:account.invoice.pay.writeoff,analytic_id:0 |
2405 | +#: field:account.move.line.memory,analytic_account_id:0 |
2406 | +msgid "Analytic Account" |
2407 | +msgstr "Analytisches Konto" |
2408 | + |
2409 | +#. module: account_invoice_cash_discount |
2410 | +#: field:account.cash.discount,discount_account_id:0 |
2411 | +msgid "Customer Discount Account" |
2412 | +msgstr "Skontokonto Debitor" |
2413 | + |
2414 | +#. module: account_invoice_cash_discount |
2415 | +#: code:addons/account_invoice_cash_discount/account_invoice_cash_discount.py:0 |
2416 | +#, python-format |
2417 | +msgid "Entry \"%s\" is not valid !" |
2418 | +msgstr "Buchung \"%s\" ist ungültig!" |
2419 | + |
2420 | +#. module: account_invoice_cash_discount |
2421 | +#: wizard_button:populate_statement_from_inv1,go,end:0 |
2422 | +#: wizard_button:populate_statement_from_inv1,init,end:0 |
2423 | +msgid "_Cancel" |
2424 | +msgstr "_Cancel" |
2425 | + |
2426 | +#. module: account_invoice_cash_discount |
2427 | +#: view:account.cash.discount:0 |
2428 | +#: view:account.payment.term:0 |
2429 | +#: code:addons/account_invoice_cash_discount/account_invoice_cash_discount.py:0 |
2430 | +#: code:addons/account_invoice_cash_discount/wizard/wizard_discount_reconcile.py:0 |
2431 | +#: model:ir.model,name:account_invoice_cash_discount.model_account_cash_discount |
2432 | +#, python-format |
2433 | +msgid "Cash Discount" |
2434 | +msgstr "Skonto" |
2435 | + |
2436 | +#. module: account_invoice_cash_discount |
2437 | +#: view:account.invoice.pay.writeoff:0 |
2438 | +msgid "Pay and Reconcile" |
2439 | +msgstr "Zahlung und OP-Ausgleich" |
2440 | + |
2441 | +#. module: account_invoice_cash_discount |
2442 | +#: view:account.invoice.pay:0 |
2443 | +msgid "Method For Calculation" |
2444 | +msgstr "Berechnungsmethode" |
2445 | + |
2446 | +#. module: account_invoice_cash_discount |
2447 | +#: view:account.invoice.pay.writeoff:0 |
2448 | +msgid "Write-Off Move" |
2449 | +msgstr "Abschreibungsbuchung" |
2450 | + |
2451 | +#. module: account_invoice_cash_discount |
2452 | +#: selection:account.invoice.pay,cal_method_selection:0 |
2453 | +msgid "Calculate Discount with Net Methodology" |
2454 | +msgstr "Berechne Skonto mit Nettomethode" |
2455 | + |
2456 | +#. module: account_invoice_cash_discount |
2457 | +#: code:addons/account_invoice_cash_discount/account_invoice_cash_discount.py:0 |
2458 | +#, python-format |
2459 | +msgid "Please verify that an account is defined in the journal." |
2460 | +msgstr "Bitte prüfen, ob im Journal ein Konto hinterlegt ist." |
2461 | + |
2462 | +#. module: account_invoice_cash_discount |
2463 | +#: field:account.move.line.memory,debit:0 |
2464 | +msgid "Debit" |
2465 | +msgstr "Soll" |
2466 | + |
2467 | +#. module: account_invoice_cash_discount |
2468 | +#: model:ir.actions.act_window,name:account_invoice_cash_discount.action_res_company_wizard |
2469 | +msgid "Company Currency Difference Accounts" |
2470 | +msgstr "Kursdifferenzkonten der Firma" |
2471 | + |
2472 | +#. module: account_invoice_cash_discount |
2473 | +#: wizard_view:account_period_write_calculation,init:0 |
2474 | +msgid "Calculation of period-wise Write-Off Amount" |
2475 | +msgstr "Berechnung des periodenweisen Abschreibungsbetrags" |
2476 | + |
2477 | +#. module: account_invoice_cash_discount |
2478 | +#: field:account.payment.term.line,day_tolerance:0 |
2479 | +msgid "Tolerance (Days)" |
2480 | +msgstr "Toleranz (Tage)" |
2481 | + |
2482 | +#. module: account_invoice_cash_discount |
2483 | +#: wizard_button:populate_statement_from_inv1,init,go:0 |
2484 | +msgid "_Go" |
2485 | +msgstr "_Go" |
2486 | + |
2487 | +#. module: account_invoice_cash_discount |
2488 | +#: field:account.cash.discount,delay:0 |
2489 | +msgid "Number of Days" |
2490 | +msgstr "Anzahl Tage" |
2491 | + |
2492 | +#. module: account_invoice_cash_discount |
2493 | +#: code:addons/account_invoice_cash_discount/wizard/wizard_write_period_entry_calculation.py:0 |
2494 | +#, python-format |
2495 | +msgid "Computed Entries" |
2496 | +msgstr "Berechnete Buchungen" |
2497 | + |
2498 | +#. module: account_invoice_cash_discount |
2499 | +#: code:addons/account_invoice_cash_discount/account_invoice_cash_discount.py:0 |
2500 | +#, python-format |
2501 | +msgid "Entry is already reconciled!" |
2502 | +msgstr "Buchung ist bereits ausgeglichen!" |
2503 | + |
2504 | +#. module: account_invoice_cash_discount |
2505 | +#: code:addons/account_invoice_cash_discount/account_invoice_cash_discount.py:0 |
2506 | +#, python-format |
2507 | +msgid "Configuration Error!" |
2508 | +msgstr "Konfigurationsfehler!" |
2509 | + |
2510 | +#. module: account_invoice_cash_discount |
2511 | +#: field:account.bank.statement.line,tax_type:0 |
2512 | +msgid "Tax method" |
2513 | +msgstr "Steuerberechnung" |
2514 | + |
2515 | +#. module: account_invoice_cash_discount |
2516 | +#: constraint:ir.ui.view:0 |
2517 | +msgid "Invalid XML for View Architecture!" |
2518 | +msgstr "Fehlerhafter XML-Code für diese Ansicht!" |
2519 | + |
2520 | +#. module: account_invoice_cash_discount |
2521 | +#: view:account.invoice.pay:0 |
2522 | +#: model:ir.actions.act_window,name:account_invoice_cash_discount.action_view_account_invoice_pay |
2523 | +msgid "Pay Invoice" |
2524 | +msgstr "Bezahle Rechnung" |
2525 | + |
2526 | +#. module: account_invoice_cash_discount |
2527 | +#: code:addons/account_invoice_cash_discount/account_invoice_cash_discount.py:0 |
2528 | +#, python-format |
2529 | +msgid "Currency Revenue" |
2530 | +msgstr "Kursertrag" |
2531 | + |
2532 | +#. module: account_invoice_cash_discount |
2533 | +#: view:account.invoice.pay:0 |
2534 | +#: view:account.partial.message:0 |
2535 | +msgid "Partial Payment" |
2536 | +msgstr "Teilzahlung" |
2537 | + |
2538 | +#. module: account_invoice_cash_discount |
2539 | +#: field:account.cash.discount,discount:0 |
2540 | +msgid "Discount (%)" |
2541 | +msgstr "Skonto (%)" |
2542 | + |
2543 | +#. module: account_invoice_cash_discount |
2544 | +#: field:account.invoice.pay.writeoff,comment:0 |
2545 | +msgid "Comment" |
2546 | +msgstr "Hinweis" |
2547 | + |
2548 | +#. module: account_invoice_cash_discount |
2549 | +#: wizard_field:populate_statement_from_inv1,go,lines:0 |
2550 | +msgid "Invoices" |
2551 | +msgstr "Rechnungen" |
2552 | + |
2553 | +#. module: account_invoice_cash_discount |
2554 | +#: field:account.cash.discount,sup_discount_account_id:0 |
2555 | +msgid "Supplier Discount Account" |
2556 | +msgstr "Skontokonto Kreditor" |
2557 | + |
2558 | +#. module: account_invoice_cash_discount |
2559 | +#: field:account.move.line.memory,currency_id:0 |
2560 | +msgid "Currency" |
2561 | +msgstr "Währung" |
2562 | + |
2563 | +#. module: account_invoice_cash_discount |
2564 | +#: view:account.invoice.pay:0 |
2565 | +#: view:account.message:0 |
2566 | +msgid "Full Payment" |
2567 | +msgstr "Vollständige Bezahlung" |
2568 | + |
2569 | +#. module: account_invoice_cash_discount |
2570 | +#: code:addons/account_invoice_cash_discount/wizard/account_pay_invoice.py:0 |
2571 | +#, python-format |
2572 | +msgid "Message" |
2573 | +msgstr "Nachricht" |
2574 | + |
2575 | +#. module: account_invoice_cash_discount |
2576 | +#: view:res.company:0 |
2577 | +msgid "Acc for Rev from Curr Diff" |
2578 | +msgstr "Konto Kurserträge" |
2579 | + |
2580 | +#. module: account_invoice_cash_discount |
2581 | +#: view:account.invoice.pay:0 |
2582 | +msgid "Calculate" |
2583 | +msgstr "Berechne" |
2584 | + |
2585 | +#. module: account_invoice_cash_discount |
2586 | +#: view:account.invoice.pay.writeoff:0 |
2587 | +#: code:addons/account_invoice_cash_discount/wizard/account_pay_invoice.py:0 |
2588 | +#, python-format |
2589 | +msgid "Information Addendum" |
2590 | +msgstr "Zusatzinformationen" |
2591 | + |
2592 | +#. module: account_invoice_cash_discount |
2593 | +#: model:ir.module.module,shortdesc:account_invoice_cash_discount.module_meta_information |
2594 | +msgid "Payment Term with Cash Discount" |
2595 | +msgstr "Zahlungsbedingung mit Skonto" |
2596 | + |
2597 | +#. module: account_invoice_cash_discount |
2598 | +#: wizard_view:populate_statement_from_inv1,init:0 |
2599 | +msgid "Choose Journal and Payment Date" |
2600 | +msgstr "Wähle Journal und Zahlungsdatum" |
2601 | + |
2602 | +#. module: account_invoice_cash_discount |
2603 | +#: help:populate_statement_from_inv1,init,journal_id:0 |
2604 | +msgid "This field allows you to choose the accounting journals you want to search invoices in. If you leave this field empty all sale, purchase and cash journals will be searched." |
2605 | +msgstr "Mit diesem Feld können die Journale gewählt werden, in denen nach Rechnungen gesucht werden. Bleibt das Feld leer, werden alle Verkaufs-, Einkaufs- und Kassenjournale durchsucht." |
2606 | + |
2607 | +#. module: account_invoice_cash_discount |
2608 | +#: field:account.invoice.pay,account_id:0 |
2609 | +#: wizard_field:account_period_write_calculation,init,cash_discount_id:0 |
2610 | +msgid "Cash Discount Account" |
2611 | +msgstr "Skontokonto" |
2612 | + |
2613 | +#. module: account_invoice_cash_discount |
2614 | +#: constraint:ir.model:0 |
2615 | +msgid "The Object name must start with x_ and not contain any special character !" |
2616 | +msgstr "Der Objektname muss mit x_ beginnen und darf keine Sonderzeichen beinhalten!" |
2617 | + |
2618 | +#. module: account_invoice_cash_discount |
2619 | +#: model:ir.actions.wizard,name:account_invoice_cash_discount.wizard_populate_statement_from_inv1 |
2620 | +msgid "Import invoices" |
2621 | +msgstr "Importiere Rechnungen" |
2622 | + |
2623 | +#. module: account_invoice_cash_discount |
2624 | +#: view:account.bank.statement.reconcile:0 |
2625 | +msgid "Write-Off and Cash Discount" |
2626 | +msgstr "Abschreibung und Skonto" |
2627 | + |
2628 | +#. module: account_invoice_cash_discount |
2629 | +#: view:res.company:0 |
2630 | +msgid "Acc for Exp from Curr Diff" |
2631 | +msgstr "Konto Kursaufwendungen" |
2632 | + |
2633 | +#. module: account_invoice_cash_discount |
2634 | +#: model:ir.model,name:account_invoice_cash_discount.model_account_message |
2635 | +msgid "account.message" |
2636 | +msgstr "account.message" |
2637 | + |
2638 | +#. module: account_invoice_cash_discount |
2639 | +#: code:addons/account_invoice_cash_discount/account_invoice_cash_discount.py:0 |
2640 | +#, python-format |
2641 | +msgid "The expected balance (%.2f) is different than the computed one. (%.2f)" |
2642 | +msgstr "Der eingetragene Saldo (%.2f) stimmt nicht mit dem berechneten überein. (%.2f)" |
2643 | + |
2644 | +#. module: account_invoice_cash_discount |
2645 | +#: code:addons/account_invoice_cash_discount/wizard/account_pay_invoice.py:0 |
2646 | +#, python-format |
2647 | +msgid "Your journal must have a default credit and debit account." |
2648 | +msgstr "Im Journal müssen Standardkonten für Soll und Haben konfiguriert sein." |
2649 | + |
2650 | +#. module: account_invoice_cash_discount |
2651 | +#: field:res.company,revenue_account_id:0 |
2652 | +#: field:res.company.wizard,revenue_account_id:0 |
2653 | +msgid "Account for Revenue from Exchange Rate Difference" |
2654 | +msgstr "Konto für Kurserträge" |
2655 | + |
2656 | +#. module: account_invoice_cash_discount |
2657 | +#: field:account.invoice.pay,date:0 |
2658 | +#: wizard_field:populate_statement_from_inv1,init,date:0 |
2659 | +msgid "Payment Date" |
2660 | +msgstr "Zahlungsdatum" |
2661 | + |
2662 | +#. module: account_invoice_cash_discount |
2663 | +#: selection:account.bank.statement.line,tax_type:0 |
2664 | +msgid "Untaxed" |
2665 | +msgstr "Unversteuert" |
2666 | + |
2667 | +#. module: account_invoice_cash_discount |
2668 | +#: wizard_button:account_period_write_calculation,init,calculate:0 |
2669 | +msgid "Compute" |
2670 | +msgstr "Berechne" |
2671 | + |
2672 | +#. module: account_invoice_cash_discount |
2673 | +#: view:account.bank.statement:0 |
2674 | +msgid "Import Invoice" |
2675 | +msgstr "Importiere Rechnungen" |
2676 | + |
2677 | +#. module: account_invoice_cash_discount |
2678 | +#: selection:account.bank.statement.line,tax_type:0 |
2679 | +msgid "Tax included" |
2680 | +msgstr "Inklusive Steuer" |
2681 | + |
2682 | +#. module: account_invoice_cash_discount |
2683 | +#: field:account.invoice.pay.writeoff,writeoff_journal_id:0 |
2684 | +msgid "Write-Off Journal" |
2685 | +msgstr "Abschreibungsjournal" |
2686 | + |
2687 | +#. module: account_invoice_cash_discount |
2688 | +#: field:account.move.line.memory,credit:0 |
2689 | +msgid "Credit" |
2690 | +msgstr "Haben" |
2691 | + |
2692 | +#. module: account_invoice_cash_discount |
2693 | +#: field:account.move.line.memory,amount_currency:0 |
2694 | +msgid "Amount Currency" |
2695 | +msgstr "Währungsbetrag" |
2696 | + |
2697 | +#. module: account_invoice_cash_discount |
2698 | +#: field:account.invoice.pay,tax_move_ids:0 |
2699 | +msgid "Account Taxes Moves" |
2700 | +msgstr "Steuerbuchung" |
2701 | + |
2702 | +#. module: account_invoice_cash_discount |
2703 | +#: model:ir.model,name:account_invoice_cash_discount.model_account_move_line_memory |
2704 | +msgid "Account move line memory " |
2705 | +msgstr "Buchungshistorie" |
2706 | + |
2707 | +#. module: account_invoice_cash_discount |
2708 | +#: field:account.invoice.pay,name:0 |
2709 | +msgid "Entry Name" |
2710 | +msgstr "Buchungstext" |
2711 | + |
2712 | +#. module: account_invoice_cash_discount |
2713 | +#: help:account.move.line.memory,amount_currency:0 |
2714 | +msgid "The amount in the optional foreign currency if it is a multi-currency entry." |
2715 | +msgstr "Der Fremdwährungsbetrag bei einer Fremdwährungsbuchung." |
2716 | + |
2717 | +#. module: account_invoice_cash_discount |
2718 | +#: code:addons/account_invoice_cash_discount/account_invoice_cash_discount.py:0 |
2719 | +#, python-format |
2720 | +msgid "Unable to reconcile entry \"%s\": %.2f" |
2721 | +msgstr "Kann Rechnung \"%s\": %.2f nicht ausgleichen" |
2722 | + |
2723 | +#. module: account_invoice_cash_discount |
2724 | +#: field:account.invoice.pay,cash_residual_amount:0 |
2725 | +msgid "Residual Amount" |
2726 | +msgstr "Offener Betrag" |
2727 | + |
2728 | +#. module: account_invoice_cash_discount |
2729 | +#: code:addons/account_invoice_cash_discount/account_invoice_cash_discount.py:0 |
2730 | +#, python-format |
2731 | +msgid "The account entry lines are not in valid state." |
2732 | +msgstr "Die Buchungszeilen sind nicht im Status Gültig." |
2733 | + |
2734 | +#. module: account_invoice_cash_discount |
2735 | +#: code:addons/account_invoice_cash_discount/account_invoice_cash_discount.py:0 |
2736 | +#, python-format |
2737 | +msgid "You have to provide a cash discount account!" |
2738 | +msgstr "Es muss ein Skontokonto angegeben werden!" |
2739 | + |
2740 | +#. module: account_invoice_cash_discount |
2741 | +#: view:account.message:0 |
2742 | +msgid "Do you really want to reconcile this invoice? The proposed payment does not completely balance the invoiced amount. Please check the payment term lines. Usually, one would use Partial Payment to avoid the ready/paid state for this invoice." |
2743 | +msgstr "Soll die Rechnung wirklich ausgeglichen werden? Die vorgeschlagene Zahlung deckt den Rechnungsbetrag nicht vollständig. Überprüfen sie die Zahlungsbedingung. In der Regel sollte hier eine Teilzahlung vorgenommen werden, um die Rechnung nicht als bezahlt zu kennzeichnen." |
2744 | + |
2745 | +#. module: account_invoice_cash_discount |
2746 | +#: field:account.invoice.pay,period_id:0 |
2747 | +#: wizard_field:account_period_write_calculation,init,period_id:0 |
2748 | +msgid "Period" |
2749 | +msgstr "Periode" |
2750 | + |
2751 | +#. module: account_invoice_cash_discount |
2752 | +#: model:ir.module.module,description:account_invoice_cash_discount.module_meta_information |
2753 | +msgid "\n" |
2754 | +" Module to add account move lines in case of payment with cash discount conditions in reconcilation form.\n" |
2755 | +" " |
2756 | +msgstr "\n" |
2757 | +" Modul für die Buchung von Zahlungen mit Skonto im Bankauszug.\n" |
2758 | +" " |
2759 | + |
2760 | +#. module: account_invoice_cash_discount |
2761 | +#: field:account.payment.term.line,compl_cash_discount:0 |
2762 | +msgid "Use Complete Cash Discount" |
2763 | +msgstr "Verwende gesamtes Skonto" |
2764 | + |
2765 | +#. module: account_invoice_cash_discount |
2766 | +#: selection:account.bank.statement.line,tax_type:0 |
2767 | +msgid "Tax excluded" |
2768 | +msgstr "Exklusive Steuer" |
2769 | + |
2770 | +#. module: account_invoice_cash_discount |
2771 | +#: view:account.invoice.pay:0 |
2772 | +#: view:account.invoice.pay.writeoff:0 |
2773 | +#: view:account.message:0 |
2774 | +#: view:account.partial.message:0 |
2775 | +#: wizard_button:account_period_write_calculation,init,end:0 |
2776 | +#: view:res.company.wizard:0 |
2777 | +msgid "Cancel" |
2778 | +msgstr "Abbrechen" |
2779 | + |
2780 | +#. module: account_invoice_cash_discount |
2781 | +#: code:addons/account_invoice_cash_discount/wizard/account_pay_invoice.py:0 |
2782 | +#, python-format |
2783 | +msgid "Cannot pay invoices in draft/proforma/cancel/done state." |
2784 | +msgstr "Rechnungen im Status Entwurf/Proforma/Abgebrochen/Erledigt können nicht bezahlt werden." |
2785 | + |
2786 | +#. module: account_invoice_cash_discount |
2787 | +#: field:account.payment.term,cash_discount_ids:0 |
2788 | +msgid "Cash Discount Terms" |
2789 | +msgstr "Skontobedingungen" |
2790 | + |
2791 | +#. module: account_invoice_cash_discount |
2792 | +#: wizard_view:populate_statement_from_inv1,init:0 |
2793 | +msgid "Import Invoices in Statement" |
2794 | +msgstr "Importiere Rechnungen" |
2795 | + |
2796 | +#. module: account_invoice_cash_discount |
2797 | +#: code:addons/account_invoice_cash_discount/account_invoice_cash_discount.py:0 |
2798 | +#, python-format |
2799 | +msgid "Can only pay one invoice at a time!" |
2800 | +msgstr "Es kann immer nur eine einzelne Rechnung bezahlt werden!" |
2801 | + |
2802 | +#. module: account_invoice_cash_discount |
2803 | +#: field:res.company,expense_account_id:0 |
2804 | +#: field:res.company.wizard,expense_account_id:0 |
2805 | +msgid "Account for Expense from Exchange Rate Difference" |
2806 | +msgstr "Konto für Kursaufwendungen" |
2807 | + |
2808 | +#. module: account_invoice_cash_discount |
2809 | +#: view:account.partial.message:0 |
2810 | +msgid "Do you really want to NOT reconcile this invoice? The proposed payment completely balances the invoiced amount. Please check the payment term lines. Usually, one would use Full Payment to receive ready/paid state for this invoice." |
2811 | +msgstr "Soll die Rechnung wirklich NICHT ausgeglichen werden? Die vorgeschlagene Zahlung deckt den Rechnungsbetrag vollständig. Überprüfen sie die Zahlungsbedingung. In der Regel sollte hier eine vollständige Zahlung vorgenommen werden, um die Rechnung als bezahlt zu kennzeichnen." |
2812 | + |
2813 | +#. module: account_invoice_cash_discount |
2814 | +#: view:account.invoice.pay.writeoff:0 |
2815 | +msgid "Analytic" |
2816 | +msgstr "Analytisch" |
2817 | + |
2818 | +#. module: account_invoice_cash_discount |
2819 | +#: view:account.move.line.memory:0 |
2820 | +msgid "Account Move Line" |
2821 | +msgstr "Buchungssatz" |
2822 | + |
2823 | +#. module: account_invoice_cash_discount |
2824 | +#: model:ir.model,name:account_invoice_cash_discount.model_account_invoice_pay |
2825 | +#: model:ir.model,name:account_invoice_cash_discount.model_account_invoice_pay_writeoff |
2826 | +msgid "Pay Invoice " |
2827 | +msgstr "Zahle Rechnung" |
2828 | + |
2829 | +#. module: account_invoice_cash_discount |
2830 | +#: view:res.company.wizard:0 |
2831 | +msgid "Set Default" |
2832 | +msgstr "Standard setzen" |
2833 | + |
2834 | +#. module: account_invoice_cash_discount |
2835 | +#: code:addons/account_invoice_cash_discount/account_invoice_cash_discount.py:0 |
2836 | +#, python-format |
2837 | +msgid "The account is not configured to be reconciled!" |
2838 | +msgstr "Dieses Konto ist nicht für den OP-Ausgleich konfiguriert!" |
2839 | + |
2840 | +#. module: account_invoice_cash_discount |
2841 | +#: field:account.move.line.memory,tax_amount:0 |
2842 | +msgid "Tax/Base Amount" |
2843 | +msgstr "Steuer-/Steuermessbetrag" |
2844 | + |
2845 | +#. module: account_invoice_cash_discount |
2846 | +#: field:account.cash.discount,payment_id:0 |
2847 | +msgid "Related Payment Term" |
2848 | +msgstr "Zugehörige Zahlungsbedingung" |
2849 | + |
2850 | +#. module: account_invoice_cash_discount |
2851 | +#: view:account.invoice.pay:0 |
2852 | +msgid "Account Cash Discount Moves" |
2853 | +msgstr "Skontobuchungen" |
2854 | + |
2855 | +#. module: account_invoice_cash_discount |
2856 | +#: view:account.cash.discount:0 |
2857 | +msgid "Cash Discount Account for Supplier and Customer" |
2858 | +msgstr "Skontokonto für Kreditoren und Debitoren" |
2859 | + |
2860 | +#. module: account_invoice_cash_discount |
2861 | +#: wizard_button:populate_statement_from_inv1,go,finish:0 |
2862 | +msgid "O_k" |
2863 | +msgstr "O_k" |
2864 | + |
2865 | +#. module: account_invoice_cash_discount |
2866 | +#: code:addons/account_invoice_cash_discount/account_invoice_cash_discount.py:0 |
2867 | +#, python-format |
2868 | +msgid "Some entries are already reconciled!" |
2869 | +msgstr "Einige Buchungen sind bereits ausgeglichen!" |
2870 | + |
2871 | +#. module: account_invoice_cash_discount |
2872 | +#: code:addons/account_invoice_cash_discount/account_invoice_cash_discount.py:0 |
2873 | +#, python-format |
2874 | +msgid "There seems to be a surcharge, not a cash discount. Can\'t reconcile this!" |
2875 | +msgstr "Es scheint hier einen Zuschlag zu geben, kein Skonto. Dies kann hiermit nicht ausgeglichen werden!" |
2876 | + |
2877 | +#. module: account_invoice_cash_discount |
2878 | +#: field:account.cash.discount,name:0 |
2879 | +#: field:account.move.line.memory,name:0 |
2880 | +msgid "Name" |
2881 | +msgstr "Bezeichnung" |
2882 | + |
2883 | +#. module: account_invoice_cash_discount |
2884 | +#: view:account.bank.statement.reconcile:0 |
2885 | +msgid "Total Write-Off/Cash Discount" |
2886 | +msgstr "Summe Abschreibungen/Skonto" |
2887 | + |
2888 | +#. module: account_invoice_cash_discount |
2889 | +#: model:ir.actions.wizard,name:account_invoice_cash_discount.wizard_period_writeoff_calculation |
2890 | +#: model:ir.ui.menu,name:account_invoice_cash_discount.menu_period_writeoff_calculation |
2891 | +msgid "Compute Period Wise Write-off Entry" |
2892 | +msgstr "Periodenweise Abschreibungen berechnen" |
2893 | + |
2894 | +#. module: account_invoice_cash_discount |
2895 | +#: view:res.company.wizard:0 |
2896 | +msgid "Currency Difference Account Configuration" |
2897 | +msgstr "Konfiguration der Kursdifferenzenkonten" |
2898 | + |
2899 | +#. module: account_invoice_cash_discount |
2900 | +#: field:account.invoice.pay,cal_method_selection:0 |
2901 | +msgid "Method for Calculation" |
2902 | +msgstr "Berechnungsmethode" |
2903 | + |
2904 | +#. module: account_invoice_cash_discount |
2905 | +#: field:account.invoice.pay,amount:0 |
2906 | +msgid "Amount Paid" |
2907 | +msgstr "Gezahlter Betrag" |
2908 | + |
2909 | +#. module: account_invoice_cash_discount |
2910 | +#: view:account.invoice.pay:0 |
2911 | +msgid "Tax Account Moves" |
2912 | +msgstr "Steuerkontobewegungen" |
2913 | + |
2914 | +#. module: account_invoice_cash_discount |
2915 | +#: model:ir.model,name:account_invoice_cash_discount.model_account_partial_message |
2916 | +msgid "account.partial.message" |
2917 | +msgstr "account.partial.message" |
2918 | + |
2919 | +#. module: account_invoice_cash_discount |
2920 | +#: help:account.move.line.memory,currency_id:0 |
2921 | +msgid "The optional foreign currency if it is a multi-currency entry." |
2922 | +msgstr "Die optionale Fremdwährung bei einer Fremdwährungsbuchung." |
2923 | + |
2924 | +#. module: account_invoice_cash_discount |
2925 | +#: help:account.move.line.memory,tax_code_id:0 |
2926 | +msgid "The account can either be a base tax code or tax code account." |
2927 | +msgstr "Das Konto kann entweder ein Steuerbemessungs- oder ein Steuerkonto sein" |
2928 | + |
2929 | +#. module: account_invoice_cash_discount |
2930 | +#: field:account.invoice.pay.writeoff,writeoff_acc_id:0 |
2931 | +msgid "Write-Off Account" |
2932 | +msgstr "Abschreibungskonto" |
2933 | + |
2934 | +#. module: account_invoice_cash_discount |
2935 | +#: field:account.move.line.memory,journal_id:0 |
2936 | +#: wizard_field:account_period_write_calculation,init,journal_id:0 |
2937 | +#: wizard_field:populate_statement_from_inv1,init,journal_id:0 |
2938 | +msgid "Journal" |
2939 | +msgstr "Journal" |
2940 | + |
2941 | +#. module: account_invoice_cash_discount |
2942 | +#: model:ir.actions.todo,note:account_invoice_cash_discount.config_wizard_res_company_wizard |
2943 | +msgid "This configuration step sets the default accounts for expense and revenue generated by exchange rate differences" |
2944 | +msgstr "Dieser Konfigurationsschritt setzt die Standardkonten für Aufwendungen und Erträge aus Kursdifferenzen" |
2945 | + |
2946 | |
2947 | === added directory 'account_invoice_cash_discount/security' |
2948 | === added file 'account_invoice_cash_discount/security/ir.model.access.csv' |
2949 | --- account_invoice_cash_discount/security/ir.model.access.csv 1970-01-01 00:00:00 +0000 |
2950 | +++ account_invoice_cash_discount/security/ir.model.access.csv 2011-07-29 01:35:58 +0000 |
2951 | @@ -0,0 +1,22 @@ |
2952 | +"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" |
2953 | +"access_account_cash_discount_manager","account.cash.discount","model_account_cash_discount","account.group_account_manager",1,1,1,1 |
2954 | +"access_account_cash_discount_invoice","account.cash.discount","model_account_cash_discount","account.group_account_invoice",1,0,0,0 |
2955 | +"access_account_cash_discount_accountant","account.cash.discount","model_account_cash_discount","account.group_account_user",1,0,0,0 |
2956 | +"access_account_invoice_pay_writeoff_manager","account.invoice.pay.writeoff","model_account_invoice_pay_writeoff","account.group_account_manager",1,1,1,1 |
2957 | +"access_account_invoice_pay_writeoff_invoive","account.invoice.pay.writeoff","model_account_invoice_pay_writeoff","account.group_account_invoice",1,0,0,0 |
2958 | +"access_account_invoice_pay_writeoff_accountant","account.invoice.pay.writeoff","model_account_invoice_pay_writeoff","account.group_account_user",1,0,0,0 |
2959 | +"access_account_invoice_pay_manager","account.invoice.pay","model_account_invoice_pay","account.group_account_manager",1,1,1,1 |
2960 | +"access_account_invoice_pay_invoice","account.invoice.pay","model_account_invoice_pay","account.group_account_invoice",1,0,0,0 |
2961 | +"access_account_invoice_pay_accountant","account.invoice.pay","model_account_invoice_pay","account.group_account_user",1,0,0,0 |
2962 | +"access_res_company_wizard_manager","res.company.wizard","model_res_company_wizard","account.group_account_manager",1,1,1,1 |
2963 | +"access_res_company_wizard_invoice","res.company.wizard","model_res_company_wizard","account.group_account_invoice",1,0,0,0 |
2964 | +"access_res_company_wizard_accountant","res.company.wizard","model_res_company_wizard","account.group_account_user",1,0,0,0 |
2965 | +"access_account_move_line_memory_manager","account.move.line.memory","model_account_move_line_memory","account.group_account_manager",1,1,1,1 |
2966 | +"access_account_move_line_memory_invoice","account.move.line.memory","model_account_move_line_memory","account.group_account_invoice",1,0,0,0 |
2967 | +"access_account_move_line_memory_accountant","account.move.line.memory","model_account_move_line_memory","account.group_account_user",1,0,0,0 |
2968 | +"access_account_message_manager","account.message","model_account_message","account.group_account_manager",1,1,1,1 |
2969 | +"access_account_message_invoice","account.message","model_account_message","account.group_account_invoice",1,0,0,0 |
2970 | +"access_account_message_accountant","account.message","model_account_message","account.group_account_user",1,0,0,0 |
2971 | +"access_account_partial_message_manager","account.partial.message","model_account_partial_message","account.group_account_manager",1,1,1,1 |
2972 | +"access_account_partial_message_invoice","account.partial.message","model_account_partial_message","account.group_account_invoice",1,0,0,0 |
2973 | +"access_account_partial_message_accountant","account.partial.message","model_account_partial_message","account.group_account_user",1,0,0,0 |
2974 | |
2975 | === added directory 'account_invoice_cash_discount/wizard' |
2976 | === added file 'account_invoice_cash_discount/wizard/__init__.py' |
2977 | --- account_invoice_cash_discount/wizard/__init__.py 1970-01-01 00:00:00 +0000 |
2978 | +++ account_invoice_cash_discount/wizard/__init__.py 2011-07-29 01:35:58 +0000 |
2979 | @@ -0,0 +1,29 @@ |
2980 | +# -*- encoding: utf-8 -*- |
2981 | +############################################################################## |
2982 | +# |
2983 | +# OpenERP, Open Source Management Solution |
2984 | +# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved |
2985 | +# $Id$ |
2986 | +# |
2987 | +# This program is free software: you can redistribute it and/or modify |
2988 | +# it under the terms of the GNU General Public License as published by |
2989 | +# the Free Software Foundation, either version 3 of the License, or |
2990 | +# (at your option) any later version. |
2991 | +# |
2992 | +# This program is distributed in the hope that it will be useful, |
2993 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
2994 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2995 | +# GNU General Public License for more details. |
2996 | +# |
2997 | +# You should have received a copy of the GNU General Public License |
2998 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
2999 | +# |
3000 | +############################################################################## |
3001 | + |
3002 | +import account_pay_invoice |
3003 | +import invoice_statement_payment |
3004 | +import wizard_discount_reconcile |
3005 | +import wizard_write_period_entry_calculation |
3006 | + |
3007 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
3008 | + |
3009 | |
3010 | === added file 'account_invoice_cash_discount/wizard/account_pay_invoice.py' |
3011 | --- account_invoice_cash_discount/wizard/account_pay_invoice.py 1970-01-01 00:00:00 +0000 |
3012 | +++ account_invoice_cash_discount/wizard/account_pay_invoice.py 2011-07-29 01:35:58 +0000 |
3013 | @@ -0,0 +1,651 @@ |
3014 | +# -*- coding: utf-8 -*- |
3015 | +############################################################################## |
3016 | +# |
3017 | +# OpenERP, Open Source Management Solution |
3018 | +# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). |
3019 | +# |
3020 | +# This program is free software: you can redistribute it and/or modify |
3021 | +# it under the terms of the GNU Affero General Public License as |
3022 | +# published by the Free Software Foundation, either version 3 of the |
3023 | +# License, or (at your option) any later version. |
3024 | +# |
3025 | +# This program is distributed in the hope that it will be useful, |
3026 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
3027 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3028 | +# GNU Affero General Public License for more details. |
3029 | +# |
3030 | +# You should have received a copy of the GNU Affero General Public License |
3031 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
3032 | +# |
3033 | +############################################################################## |
3034 | +import time |
3035 | +from lxml import etree |
3036 | +from osv import fields, osv |
3037 | +from tools.translate import _ |
3038 | +from tools import config |
3039 | + |
3040 | +class account_invoice_pay_writeoff(osv.osv_memory): |
3041 | + """ |
3042 | + Opens the write-off amount pay form. |
3043 | + """ |
3044 | + _name = "account.invoice.pay.writeoff" |
3045 | + _description = "Pay Invoice" |
3046 | + _columns = { |
3047 | + 'writeoff_acc_id': fields.many2one('account.account', 'Write-Off Account', required=True), |
3048 | + 'writeoff_journal_id': fields.many2one('account.journal', 'Write-Off Journal', required=True), |
3049 | + 'comment': fields.char('Comment', size=64, required=True), |
3050 | + 'analytic_id': fields.many2one('account.analytic.account', 'Analytic Account'), |
3051 | + } |
3052 | + _defaults = { |
3053 | + 'comment':lambda *a: 'Write-Off', |
3054 | + } |
3055 | + |
3056 | + def pay_and_reconcile_writeoff(self, cr, uid, ids, context=None): |
3057 | + pay_invoice = self.pool.get('account.invoice.pay') |
3058 | + data = self.read(cr, uid, ids, context=context)[0] |
3059 | + context.update({'write_off': data}) |
3060 | + self.pool.get('account.invoice.pay').pay_and_reconcile(cr, uid, ids, context=context) |
3061 | + return {} |
3062 | + |
3063 | +account_invoice_pay_writeoff() |
3064 | + |
3065 | +class account_invoice_pay(osv.osv_memory): |
3066 | + """ |
3067 | + Generate pay invoice wizard. The user can make partial or full payment of invoices. |
3068 | + """ |
3069 | + _name = "account.invoice.pay" |
3070 | + _description = "Pay Invoice" |
3071 | + _columns = { |
3072 | + 'amount': fields.float('Amount Paid', required=True), |
3073 | + 'name': fields.char('Entry Name', size=64, required=True), |
3074 | + 'date': fields.date('Payment Date', required=True), |
3075 | + 'cash_residual_amount': fields.float('Residual Amount'), |
3076 | + 'journal_id': fields.many2one('account.journal', 'Journal/Payment Mode', required=True), |
3077 | + 'period_id': fields.many2one('account.period', 'Period', required=True), |
3078 | + 'cash_amount': fields.float('Cash Discount Amount',), |
3079 | + 'account_id': fields.many2one('account.account', 'Cash Discount Account',), |
3080 | + 'cal_method_selection': fields.selection([('method_gross_methodology', 'Calculate Discount with Gross Methodology'), |
3081 | + ('method_net_methodology', 'Calculate Discount with Net Methodology'),], |
3082 | + 'Method for Calculation'), |
3083 | + 'discount_move_ids': fields.many2many('account.move.line.memory', 'account_discount_move_rel', 'discount_account_id', 'discount_move_id', 'Account Discount Moves'), |
3084 | + 'tax_move_ids': fields.many2many('account.move.line.memory', 'account_tax_move_rel', 'tax_account_id', 'tax_move_id', 'Account Taxes Moves'), |
3085 | + } |
3086 | + |
3087 | + def _get_period(self, cr, uid, context=None): |
3088 | + ids = self.pool.get('account.period').find(cr, uid, context=context) |
3089 | + period_id = False |
3090 | + if len(ids): |
3091 | + period_id = ids[0] |
3092 | + return period_id |
3093 | + |
3094 | + def _get_amount(self, cr, uid, context=None): |
3095 | + obj_inv = self.pool.get('account.invoice') |
3096 | + tax_obj = self.pool.get('account.tax') |
3097 | + invoice = obj_inv.browse(cr, uid, context['id'], context=context) |
3098 | + total_tax_amount = total_amount = 0.0 |
3099 | + amount = obj_inv._get_amount(cr, uid, [context['id']], invoice.residual, invoice.payment_term.id, context=context) |
3100 | + amount = amount['amount'] |
3101 | + context.update({'found': amount}) |
3102 | + discount = obj_inv._get_payment(cr, uid, [context['id']], amount, invoice.payment_term.id, context=context) |
3103 | + residual_amount = amount - discount |
3104 | + return residual_amount |
3105 | + |
3106 | + def _get_discount(self, cr, uid, context=None): |
3107 | + obj_inv = self.pool.get('account.invoice') |
3108 | + tax_obj = self.pool.get('account.tax') |
3109 | + invoice = obj_inv.browse(cr, uid, context['id'], context=context) |
3110 | + amount = obj_inv._get_amount(cr, uid, [context['id']], invoice.residual, invoice.payment_term.id, context=context) |
3111 | + amount = amount['amount'] |
3112 | + discount = obj_inv._get_payment(cr, uid, [context['id']], amount, invoice.payment_term.id, context=context) |
3113 | + return discount |
3114 | + |
3115 | + def _get_account(self, cr, uid, context=None): |
3116 | + """ |
3117 | + This function returns the account according to the cash discount payment term and maps the account with fiscal position |
3118 | + """ |
3119 | + obj_inv = self.pool.get('account.invoice') |
3120 | + invoice = obj_inv.browse(cr, uid, context['id'], context=context) |
3121 | + account = obj_inv._get_account(cr, uid, [context['id']], invoice.residual, invoice.payment_term.id, context=context) |
3122 | + if account and invoice.fiscal_position: |
3123 | + account = self.pool.get('account.fiscal.position').map_account(cr, uid, invoice.fiscal_position, account) |
3124 | + return account |
3125 | + |
3126 | + def _get_discount_move(self, cr, uid, context=None): |
3127 | + invoice_obj = self.pool.get('account.invoice') |
3128 | + invoice_tax_obj = self.pool.get("account.invoice.tax") |
3129 | + move_line_obj_memory = self.pool.get('account.move.line.memory') |
3130 | + tax_obj = self.pool.get('account.tax') |
3131 | + cur_obj = self.pool.get('res.currency') |
3132 | + |
3133 | + invoice = self.pool.get('account.invoice').browse(cr, uid, context['id'], context=context) |
3134 | + |
3135 | + #### to get direction |
3136 | + types = {'out_invoice': -1, 'in_invoice': 1, 'out_refund': 1, 'in_refund': -1} |
3137 | + direction = types[invoice.type] |
3138 | + date = time.strftime('%Y-%m-%d') |
3139 | + |
3140 | + #### to get name |
3141 | + name = invoice.invoice_line and invoice.invoice_line[0].name or invoice.number |
3142 | + ##### Entry in the discount account moves and entry in the tax account moves |
3143 | + |
3144 | + amount = discount = 0.0 |
3145 | + discount_line_ids = [] |
3146 | + discount_account_id = base_code_id = False |
3147 | + |
3148 | + discount = self._get_discount(cr, uid, context=context) |
3149 | + discount_account_id = self._get_account(cr, uid, context=context) |
3150 | + if discount > 0.0: |
3151 | + for line in invoice.invoice_line: |
3152 | + total_tax_amount = line_tax_amount = 0.0 |
3153 | + tax_base = tax_code = False |
3154 | + |
3155 | + for tax in tax_obj.compute(cr, uid, line.invoice_line_tax_id, line.price_subtotal / line.quantity, line.quantity, invoice.address_invoice_id.id, line.product_id, invoice.partner_id): |
3156 | + line_tax_amount += tax['amount'] |
3157 | + line_total = line.price_subtotal + line_tax_amount |
3158 | + invoice_res_amount = invoice.amount_total |
3159 | + line_ratio = line_total / invoice_res_amount |
3160 | + ##################################################### |
3161 | + discount_pay = discount * line_ratio |
3162 | + tax_real_amt = 0.0 |
3163 | + if line.invoice_line_tax_id: |
3164 | + for tax_id in line.invoice_line_tax_id: |
3165 | + tax_data = tax_obj.browse(cr, uid, tax_id.id, context=context) |
3166 | + tax_amt = round((discount_pay * tax_data.amount), int(config['price_accuracy'])) |
3167 | + tax_real_amt = round((tax_amt / (1 + tax_data.amount)), int(config['price_accuracy'])) |
3168 | + total_tax_amount += tax_real_amt |
3169 | + |
3170 | + tax_base = tax_data.base_code_id.id |
3171 | + tax_code = tax_data.tax_code_id.id |
3172 | + |
3173 | + tax_invoice_id = invoice_tax_obj.search(cr, uid, [('invoice_id', '=', invoice.id), ('tax_code_id', '=', tax_code), ('base_code_id', '=', tax_base)]) |
3174 | + for tax_id in tax_invoice_id: |
3175 | + tax_value = invoice_tax_obj.browse(cr, uid, tax_id) |
3176 | + base_code_id = tax_value.base_code_id.id |
3177 | + |
3178 | + if invoice.company_id.currency_id.id <> invoice.currency_id.id: |
3179 | + discount_amount = discount - tax_real_amt |
3180 | + amount = cur_obj.compute(cr, uid, invoice.currency_id.id, invoice.company_id.currency_id.id, discount_amount, context=context) |
3181 | + |
3182 | + l4 = { |
3183 | + 'debit': direction * (discount_pay - total_tax_amount) < 0 and abs(discount_pay - total_tax_amount) or 0.0, |
3184 | + 'credit': direction * (discount_pay - total_tax_amount) > 0 and abs(discount_pay - total_tax_amount) or 0.0, |
3185 | + 'account_id': discount_account_id, |
3186 | + 'date': date, |
3187 | + 'name': name, |
3188 | + 'currency_id': invoice.currency_id and invoice.currency_id.id, |
3189 | + 'journal_id': invoice.journal_id and invoice.journal_id.id, |
3190 | + 'tax_code_id': base_code_id, |
3191 | + 'tax_amount': -(discount_pay - total_tax_amount), |
3192 | + 'amount_currency': amount and direction * amount or 0.0, |
3193 | + 'analytic_account_id': line.account_analytic_id.id, |
3194 | + } |
3195 | + |
3196 | + discount_line_id = move_line_obj_memory.create(cr, uid, l4, context=context) |
3197 | + discount_line_ids.append(l4) |
3198 | + return discount_line_ids |
3199 | + |
3200 | + def _get_taxes_move(self, cr, uid, context=None): |
3201 | + invoice_obj = self.pool.get('account.invoice') |
3202 | + invoice_tax_obj = self.pool.get("account.invoice.tax") |
3203 | + move_line_obj_memory = self.pool.get('account.move.line.memory') |
3204 | + tax_obj = self.pool.get('account.tax') |
3205 | + cur_obj = self.pool.get('res.currency') |
3206 | + |
3207 | + invoice = self.pool.get('account.invoice').browse(cr, uid, context['id'], context=context) |
3208 | + |
3209 | + #### to get direction |
3210 | + types = {'out_invoice': -1, 'in_invoice': 1, 'out_refund': 1, 'in_refund': -1} |
3211 | + direction = types[invoice.type] |
3212 | + date = time.strftime('%Y-%m-%d') |
3213 | + |
3214 | + #### to get name |
3215 | + name = invoice.invoice_line and invoice.invoice_line[0].name or invoice.number |
3216 | + ##### Entry in the discount account moves and entry in the tax account moves |
3217 | + amount = discount = 0.0 |
3218 | + line_ids = [] |
3219 | + tax_code_id = tax_account_id = tax_base = tax_code = False |
3220 | + |
3221 | + discount = self._get_discount(cr, uid, context=context) |
3222 | + if discount > 0.0: |
3223 | + for line in invoice.invoice_line: |
3224 | + line_tax_amount = total_tax_amount = 0.0 |
3225 | + ############# Ratio##### |
3226 | + for tax in tax_obj.compute(cr, uid, line.invoice_line_tax_id, line.price_subtotal / line.quantity, line.quantity, invoice.address_invoice_id.id, line.product_id, invoice.partner_id): |
3227 | + line_tax_amount += tax['amount'] |
3228 | + line_total = line.price_subtotal + line_tax_amount |
3229 | + invoice_res_amount = invoice.amount_total |
3230 | + line_ratio = line_total / invoice_res_amount |
3231 | + ############# |
3232 | + ### discount for the invoice line |
3233 | + discount_pay = discount * line_ratio |
3234 | + if line.invoice_line_tax_id: |
3235 | + for tax_id in line.invoice_line_tax_id: |
3236 | + tax_data = tax_obj.browse(cr, uid, tax_id.id, context=context) |
3237 | + tax_amt = round((discount_pay * tax_data.amount), int(config['price_accuracy'])) |
3238 | + tax_real_amt = round((tax_amt / (1 + tax_data.amount)), int(config['price_accuracy'])) |
3239 | + total_tax_amount += tax_real_amt |
3240 | + |
3241 | + tax_base = tax_data.base_code_id.id |
3242 | + tax_code = tax_data.tax_code_id.id |
3243 | + |
3244 | + tax_invoice_id = invoice_tax_obj.search(cr, uid, [('invoice_id', '=', invoice.id), ('tax_code_id', '=', tax_code), ('base_code_id', '=', tax_base)]) |
3245 | + |
3246 | + for tax_id in tax_invoice_id: |
3247 | + tax_value = invoice_tax_obj.browse(cr, uid, tax_id) |
3248 | + tax_account_id = tax_value.account_id.id |
3249 | + tax_code_id = tax_value.tax_code_id.id |
3250 | + |
3251 | + if invoice.company_id.currency_id.id <> invoice.currency_id.id: |
3252 | + amount = cur_obj.compute(cr, uid, invoice.currency_id.id, invoice.company_id.currency_id.id, tax_real_amt, context=context) |
3253 | + |
3254 | + l3 = { |
3255 | + 'debit': direction * tax_real_amt < 0 and abs(tax_real_amt) or 0.0, |
3256 | + 'credit': direction * tax_real_amt > 0 and abs(tax_real_amt) or 0.0, |
3257 | + 'account_id': tax_account_id, |
3258 | + 'date': date, |
3259 | + 'journal_id': invoice.journal_id and invoice.journal_id.id, |
3260 | + 'name': name, |
3261 | + 'currency_id': invoice.currency_id and invoice.currency_id.id, |
3262 | + 'tax_code_id': tax_code_id, |
3263 | + 'tax_amount': -tax_real_amt, |
3264 | + 'amount_currency': amount and direction * amount or 0.0, |
3265 | + 'analytic_account_id': line.account_analytic_id.id, |
3266 | + } |
3267 | + line_id = move_line_obj_memory.create(cr, uid, l3, context=context) |
3268 | + line_ids.append(l3) |
3269 | + return line_ids |
3270 | + |
3271 | + _defaults = { |
3272 | + 'date': lambda *a: time.strftime('%Y-%m-%d'), |
3273 | + 'period_id': _get_period, |
3274 | + 'amount': _get_amount, |
3275 | + 'cash_amount': _get_discount, |
3276 | + 'account_id': _get_account, |
3277 | + 'cash_residual_amount': lambda *a: 0.0, |
3278 | + 'cal_method_selection': lambda *a: 'method_gross_methodology', |
3279 | + 'discount_move_ids': _get_discount_move, |
3280 | + 'tax_move_ids': _get_taxes_move, |
3281 | + } |
3282 | + |
3283 | + def on_change_ammount(self, cr, uid, ids, amount, cash_amount, context=None): |
3284 | + """ |
3285 | + This function returns the cash discount according to the Amount Paid and Cash Discount Payment Term |
3286 | + """ |
3287 | + res = {} |
3288 | + obj_inv = self.pool.get('account.invoice') |
3289 | + invoice = obj_inv.browse(cr, uid, context['id'], context=context) |
3290 | + cal_amount = obj_inv._get_amount(cr, uid, [context['id']], invoice.residual, invoice.payment_term.id, context=context) |
3291 | + old_cal_amount = old_amount = cal_amount['amount'] |
3292 | + diff_amount = round(old_amount - amount + cash_amount, int(config['price_accuracy'])) |
3293 | + |
3294 | + return {'value': {'cash_residual_amount': diff_amount}} |
3295 | + |
3296 | + def on_change_cash_discount_amount(self, cr, uid, ids, discount_amount, amount, context=None): |
3297 | + ### Return discount amount |
3298 | + res = {} |
3299 | + obj_inv = self.pool.get('account.invoice') |
3300 | + invoice = obj_inv.browse(cr, uid, context['id'], context=context) |
3301 | + cal_amount = obj_inv._get_amount(cr, uid, [context['id']] ,invoice.residual, invoice.payment_term.id, context=context) |
3302 | + old_cal_amount = old_amount = cal_amount['amount'] |
3303 | + discount = obj_inv._get_payment(cr, uid, [context['id']] , amount, invoice.payment_term.id, context=context) |
3304 | + diff_amount = round(old_amount - amount + discount_amount, int(config['price_accuracy'])) |
3305 | + |
3306 | + return {'value' : {'cash_amount':discount_amount,'cash_residual_amount':diff_amount}} |
3307 | + |
3308 | + def _calculation(self, cr, uid, ids, context=None): |
3309 | + invoice_obj = self.pool.get('account.invoice') |
3310 | + invoice_tax_obj = self.pool.get("account.invoice.tax") |
3311 | + move_line_obj_memory = self.pool.get('account.move.line.memory') |
3312 | + tax_obj = self.pool.get('account.tax') |
3313 | + cur_obj = self.pool.get('res.currency') |
3314 | + |
3315 | + data = self.read(cr, uid, ids, context=context)[0] |
3316 | + invoice = self.pool.get('account.invoice').browse(cr, uid, context['id'], context=context) |
3317 | + #### to get direction |
3318 | + types = {'out_invoice': -1, 'in_invoice': 1, 'out_refund': 1, 'in_refund': -1} |
3319 | + direction = types[invoice.type] |
3320 | + date = time.strftime('%Y-%m-%d') |
3321 | + |
3322 | + #### to get name |
3323 | + name = invoice.invoice_line and invoice.invoice_line[0].name or invoice.number |
3324 | + ##### Entry in the discount account moves and entry in the tax account moves |
3325 | + |
3326 | + if data.get('cash_amount', 0.0) <= 0.0: |
3327 | + return True |
3328 | + |
3329 | + tax_total_amount = amount = discount = 0.0 |
3330 | + line_ids = discount_line_ids = [] |
3331 | + discount_account_id = tax_account_id = False |
3332 | + tax_code_id = base_code_id = tax_base = tax_code = False |
3333 | + |
3334 | + for line in invoice.invoice_line: |
3335 | + line_tax_amount = total_tax_amount = tax_real_amt = 0.0 |
3336 | + #####get the ratio of the line in the total invoice amount |
3337 | + for tax in tax_obj.compute(cr, uid, line.invoice_line_tax_id, line.price_subtotal / line.quantity, line.quantity, invoice.address_invoice_id.id, line.product_id, invoice.partner_id): |
3338 | + line_tax_amount += tax['amount'] |
3339 | + line_total = line.price_subtotal + line_tax_amount |
3340 | + invoice_res_amount = invoice.amount_total |
3341 | + line_ratio = line_total / invoice_res_amount |
3342 | + ########################### |
3343 | + discount_pay = data['cash_amount'] * line_ratio |
3344 | + if line.invoice_line_tax_id: |
3345 | + for tax_id in line.invoice_line_tax_id: |
3346 | + tax_data = tax_obj.browse(cr, uid, tax_id.id, context=context) |
3347 | + tax_amt = round(discount_pay * tax_data.amount, int(config['price_accuracy'])) |
3348 | + tax_real_amt = round(tax_amt / (1 + tax_data.amount), int(config['price_accuracy'])) |
3349 | + total_tax_amount += tax_real_amt |
3350 | + |
3351 | + tax_base = tax_data.base_code_id.id |
3352 | + tax_code = tax_data.tax_code_id.id |
3353 | + |
3354 | + tax_invoice_id = invoice_tax_obj.search(cr, uid, [('invoice_id', '=', invoice.id), ('tax_code_id', '=', tax_code), ('base_code_id', '=', tax_base)]) |
3355 | + for tax_id in tax_invoice_id: |
3356 | + tax_value = invoice_tax_obj.browse(cr, uid, tax_id) |
3357 | + tax_account_id = tax_value.account_id.id |
3358 | + tax_code_id = tax_value.tax_code_id.id |
3359 | + base_code_id = tax_value.base_code_id.id |
3360 | + |
3361 | + if invoice.company_id.currency_id.id <> invoice.currency_id.id: |
3362 | + amount = cur_obj.compute(cr, uid, invoice.currency_id.id, invoice.company_id.currency_id.id, tax_real_amt, context=context) |
3363 | + |
3364 | + l3 = { |
3365 | + 'debit': direction * tax_real_amt < 0 and abs(tax_real_amt) or 0.0, |
3366 | + 'credit': direction * tax_real_amt > 0 and abs(tax_real_amt) or 0.0, |
3367 | + 'account_id': tax_account_id, |
3368 | + 'date': date, |
3369 | + 'journal_id': data.get('journal_id', False), |
3370 | + 'name': name, |
3371 | + 'currency_id': invoice.currency_id and invoice.currency_id.id, |
3372 | + 'tax_code_id': tax_code_id, |
3373 | + 'tax_amount': -tax_real_amt, |
3374 | + 'amount_currency': amount and direction * amount or 0.0, |
3375 | + 'analytic_account_id': line.account_analytic_id.id, |
3376 | + } |
3377 | + line_id = move_line_obj_memory.create(cr, uid, l3, context=context) |
3378 | + line_ids.append(line_id) |
3379 | + |
3380 | + ### if calculation on the Net Methology then in discount field it will take product income account or product category income account |
3381 | + if data['cal_method_selection'] == 'method_net_methodology': |
3382 | + if invoice.type == 'in_invoice': |
3383 | + if line.product_id.property_account_income: |
3384 | + discount_account_id = line.product_id.property_account_income.id |
3385 | + else: |
3386 | + discount_account_id = line.product_id.categ_id.property_account_income_categ.id |
3387 | + else: |
3388 | + if line.product_id.property_account_income: |
3389 | + discount_account_id = line.product_id.property_account_expense.id |
3390 | + else: |
3391 | + discount_account_id = line.product_id.categ_id.property_account_expense_categ.id |
3392 | + |
3393 | + else: |
3394 | + discount_account_id = data['account_id'] |
3395 | + |
3396 | + if invoice.company_id.currency_id.id <> invoice.currency_id.id: |
3397 | + discount_amount = discount_pay - tax_real_amt |
3398 | + amount = cur_obj.compute(cr, uid, invoice.currency_id.id, invoice.company_id.currency_id.id, discount_amount, context=context) |
3399 | + |
3400 | + l4 = { |
3401 | + 'debit': direction * (discount_pay - total_tax_amount) < 0 and abs(discount_pay - total_tax_amount) or 0.0, |
3402 | + 'credit': direction * (discount_pay - total_tax_amount) > 0 and abs(discount_pay - total_tax_amount) or 0.0, |
3403 | + 'account_id': discount_account_id, |
3404 | + 'date': date, |
3405 | + 'name': name, |
3406 | + 'currency_id': invoice.currency_id and invoice.currency_id.id, |
3407 | + 'journal_id': data.get('journal_id', False), |
3408 | + 'tax_code_id': base_code_id, |
3409 | + 'tax_amount': -(discount_pay - total_tax_amount), |
3410 | + 'amount_currency': amount and direction * amount or 0.0, |
3411 | + 'analytic_account_id': line.account_analytic_id.id, |
3412 | + } |
3413 | + |
3414 | + discount_line_id = move_line_obj_memory.create(cr, uid, l4, context=context) |
3415 | + discount_line_ids.append(discount_line_id) |
3416 | + |
3417 | + self.write(cr, uid, ids, |
3418 | + {'tax_move_ids': [(6, 0, line_ids)], |
3419 | + 'discount_move_ids' : [(6, 0, discount_line_ids)], |
3420 | + }, context=context) |
3421 | + |
3422 | + return True |
3423 | + |
3424 | + def default_get(self, cr, uid, fields, context=None): |
3425 | + res = super(account_invoice_pay, self).default_get(cr, uid, fields, context=context) |
3426 | + invoice = self.pool.get('account.invoice').browse(cr, uid, context['id'], context=context) |
3427 | + if invoice.state in ['draft', 'proforma2', 'cancel', 'paid']: |
3428 | + raise osv.except_osv(_('Error!'), _('Cannot pay invoices in draft/proforma/cancel/done state.')) |
3429 | + return res |
3430 | + |
3431 | + def _message(self, cr, uid, ids, context=None): |
3432 | + mod_obj = self.pool.get('ir.model.data') |
3433 | + data = self.read(cr, uid, ids, context=context)[0] |
3434 | + invoice = self.pool.get('account.invoice').browse(cr, uid, context['id'], context) |
3435 | + |
3436 | + if data.get('discount_move_ids', False): |
3437 | + context.update({'discount_move_ids': data['discount_move_ids']}) |
3438 | + if data.get('tax_move_ids', False): |
3439 | + context.update({'tax_move_ids': data['tax_move_ids']}) |
3440 | + if data.get('amount', False): |
3441 | + context.update({'amount': data['amount']}) |
3442 | + if data.get('cash_amount', False): |
3443 | + context.update({'cash_amount': data['cash_amount']}) |
3444 | + |
3445 | + total_data_amount = total_invoice_amount = 0.0 |
3446 | + total_data_amount = data['amount'] + data['cash_amount'] |
3447 | + total_invoice_amount = invoice.residual |
3448 | + |
3449 | + model_data_ids = mod_obj.search(cr, uid,[('model', '=', 'ir.ui.view'), ('name', '=', 'view_account_message')], context=context) |
3450 | + resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id'] |
3451 | + if self.pool.get('res.currency').is_zero(cr, uid, invoice.company_id.currency_id, (total_invoice_amount - total_data_amount)): |
3452 | + self.pool.get('account.invoice.pay').pay_and_reconcile(cr, uid, ids, context=context) |
3453 | + return {} |
3454 | + else: |
3455 | + return { |
3456 | + 'name': _('Message'), |
3457 | + 'context': context, |
3458 | + 'view_type': 'form', |
3459 | + 'view_mode': 'form', |
3460 | + 'res_model': 'account.message', |
3461 | + 'views': [(resource_id, 'form')], |
3462 | + 'type': 'ir.actions.act_window', |
3463 | + 'target': 'new', |
3464 | + } |
3465 | + |
3466 | + def _message_partial(self, cr, uid, ids, context=None): |
3467 | + mod_obj = self.pool.get('ir.model.data') |
3468 | + data = self.read(cr, uid, ids, context=context)[0] |
3469 | + invoice = self.pool.get('account.invoice').browse(cr, uid, context['id'], context) |
3470 | + |
3471 | + total_data_amount = total_invoice_amount = 0.0 |
3472 | + |
3473 | + if data.get('discount_move_ids', False): |
3474 | + context.update({'discount_move_ids': data['discount_move_ids']}) |
3475 | + if data.get('tax_move_ids', False): |
3476 | + context.update({'tax_move_ids': data['tax_move_ids']}) |
3477 | + if data.get('amount', False): |
3478 | + context.update({'amount': data['amount']}) |
3479 | + if data.get('cash_amount', False): |
3480 | + context.update({'cash_amount': data['cash_amount']}) |
3481 | + |
3482 | + total_data_amount = data['amount'] + data['cash_amount'] |
3483 | + total_invoice_amount = invoice.residual |
3484 | + |
3485 | + if self.pool.get('res.currency').is_zero(cr, uid, invoice.company_id.currency_id, (total_invoice_amount - total_data_amount)): |
3486 | + model_data_ids = mod_obj.search(cr, uid, [('model', '=', 'ir.ui.view'), ('name', '=', 'view_account_partial_message')], context=context) |
3487 | + resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id'] |
3488 | + return { |
3489 | + 'name': _('Message'), |
3490 | + 'context': context, |
3491 | + 'view_type': 'form', |
3492 | + 'view_mode': 'form', |
3493 | + 'res_model': 'account.partial.message', |
3494 | + 'views': [(resource_id, 'form')], |
3495 | + 'type': 'ir.actions.act_window', |
3496 | + 'target': 'new', |
3497 | + } |
3498 | + else: |
3499 | + self.pool.get('account.invoice.pay').pay_and_reconcile(cr, uid, ids, context=context) |
3500 | + return {} |
3501 | + |
3502 | + def wo_check(self, cr, uid, ids, context=None): |
3503 | + cur_obj = self.pool.get('res.currency') |
3504 | + mod_obj = self.pool.get('ir.model.data') |
3505 | + obj_inv = self.pool.get('account.invoice') |
3506 | + |
3507 | + if context is None: |
3508 | + context = {} |
3509 | + data = self.read(cr, uid, ids, context=context)[0] |
3510 | + invoice = self.pool.get('account.invoice').browse(cr, uid, context['id'], context) |
3511 | + journal = self.pool.get('account.journal').browse(cr, uid, data['journal_id'], context) |
3512 | + # Here we need that: |
3513 | + # The invoice total amount in company's currency <> paid amount in company currency |
3514 | + # (according to the correct day rate, invoicing rate and payment rate are may be different) |
3515 | + # => Ask to a write-off of the difference. This could happen even if both amount are equal, |
3516 | + # because if the currency rate |
3517 | + # Get the amount in company currency for the invoice (according to move lines) |
3518 | + inv_amount_company_currency = 0 |
3519 | + for aml in invoice.move_id.line_id: |
3520 | + if aml.account_id.id == invoice.account_id.id or aml.account_id.type in ('receivable', 'payable'): |
3521 | + inv_amount_company_currency += aml.debit |
3522 | + inv_amount_company_currency -= aml.credit |
3523 | + inv_amount_company_currency = abs(inv_amount_company_currency) |
3524 | + # Get the current amount paid in company currency |
3525 | + if journal.currency and invoice.company_id.currency_id.id <> journal.currency.id: |
3526 | + ctx = {'date': data['date']} |
3527 | + amount_paid = cur_obj.compute(cr, uid, journal.currency.id, invoice.company_id.currency_id.id, data['amount'], round=True, context=ctx) |
3528 | + else: |
3529 | + amount_paid = data['amount'] + data['cash_amount'] |
3530 | + |
3531 | + # Get the old payment if there are some |
3532 | + if invoice.payment_ids: |
3533 | + debit = credit = 0.0 |
3534 | + for payment in invoice.payment_ids: |
3535 | + debit += payment.debit |
3536 | + credit += payment.credit |
3537 | + amount_paid += abs(debit - credit) |
3538 | + |
3539 | + if data['cash_residual_amount'] == 0.0 or self.pool.get('res.currency').is_zero(cr, uid, invoice.company_id.currency_id, |
3540 | + (amount_paid - inv_amount_company_currency)): |
3541 | + return self.pay_and_reconcile(cr, uid, ids, context=context) |
3542 | + else: |
3543 | + model_data_ids = mod_obj.search(cr, uid,[('model', '=', 'ir.ui.view'), ('name', '=', 'view_account_invoice_pay_writeoff')], context=context) |
3544 | + resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id'] |
3545 | + return { |
3546 | + 'name': _('Information Addendum'), |
3547 | + 'context': context, |
3548 | + 'view_type': 'form', |
3549 | + 'view_mode': 'form', |
3550 | + 'res_model': 'account.invoice.pay.writeoff', |
3551 | + 'views': [(resource_id, 'form')], |
3552 | + 'type': 'ir.actions.act_window', |
3553 | + 'target': 'new', |
3554 | + } |
3555 | + |
3556 | + def pay_and_reconcile(self, cr, uid, ids, context=None): |
3557 | + cur_obj = self.pool.get('res.currency') |
3558 | + if context is None: |
3559 | + context = {} |
3560 | + |
3561 | + data = self.read(cr, uid, ids, context=context)[0] |
3562 | + writeoff_account_id = writeoff_journal_id = comment = False |
3563 | + |
3564 | + if 'write_off' in context and context['write_off'] : |
3565 | + writeoff_account_id = context['write_off']['writeoff_acc_id'] |
3566 | + writeoff_journal_id = context['write_off']['writeoff_journal_id'] |
3567 | + comment = context['write_off']['comment'] |
3568 | + |
3569 | + if context.get('amount', False): |
3570 | + amount = context['amount'] + context.get('cash_amount', 0.0) |
3571 | + else: |
3572 | + amount = data['amount'] + data['cash_amount'] |
3573 | + |
3574 | + invoice = self.pool.get('account.invoice').browse(cr, uid, context['id'], context=context) |
3575 | + journal = self.pool.get('account.journal').browse(cr, uid, data['journal_id'], context=context) |
3576 | + # Compute the amount in company's currency, with the journal currency (which is equal to payment currency) |
3577 | + # when it is needed : If payment currency (according to selected journal.currency) is <> from company currency |
3578 | + curr_diff = False |
3579 | + if journal.currency and invoice.company_id.currency_id.id <> journal.currency.id: |
3580 | + ctx = {'date': data['date']} |
3581 | + amount = cur_obj.compute(cr, uid, journal.currency.id, invoice.company_id.currency_id.id, amount, context=ctx) |
3582 | + currency_id = journal.currency.id |
3583 | + # Put the paid amount in currency, and the currency, in the context if currency is different from company's currency |
3584 | + if context.get('amount', False): |
3585 | + context.update({'amount_currency': context['amount'] + context.get('cash_amount', 0.0),'currency_id': currency_id}) |
3586 | + else: |
3587 | + context.update({'amount_currency': data['amount'] + data['cash_amount'], 'currency_id': currency_id}) |
3588 | + curr_diff = True |
3589 | + |
3590 | + if not journal.currency and invoice.company_id.currency_id.id <> invoice.currency_id.id and not curr_diff: |
3591 | + ctx = {'date': data['date']} |
3592 | + amount = cur_obj.compute(cr, uid, invoice.currency_id.id, invoice.company_id.currency_id.id, amount, context=ctx) |
3593 | + currency_id = invoice.currency_id.id |
3594 | + # Put the paid amount in currency, and the currency, in the context if currency is different from company's currency |
3595 | + if context.get('amount', False): |
3596 | + context.update({'amount_currency': context['amount'] + context.get('cash_amount', 0.0), 'currency_id': currency_id}) |
3597 | + else: |
3598 | + context.update({'amount_currency': data['amount'] + data['cash_amount'], 'currency_id': currency_id}) |
3599 | + |
3600 | + context.update({'account_id': data['account_id'], 'date_p': data['date'],'comment': comment or False}) |
3601 | + |
3602 | + if context.get('discount_move_ids', False): |
3603 | + context.update({'discount_move_ids': context['discount_move_ids']}) |
3604 | + else: |
3605 | + context.update({'discount_move_ids': data['discount_move_ids']}) |
3606 | + |
3607 | + if context.get('tax_move_ids', False): |
3608 | + context.update({'tax_move_ids': context['tax_move_ids']}) |
3609 | + else: |
3610 | + context.update({'tax_move_ids': data['tax_move_ids']}) |
3611 | + |
3612 | + if context.get('cash_amount', False): |
3613 | + context.update({'cash_amount': context['cash_amount']}) |
3614 | + else: |
3615 | + context.update({'cash_amount': data['cash_amount']}) |
3616 | + |
3617 | + acc_id = journal.default_credit_account_id and journal.default_credit_account_id.id |
3618 | + if not acc_id: |
3619 | + raise osv.except_osv(_('Error!'), _('Your journal must have a default credit and debit account.')) |
3620 | + |
3621 | + self.pool.get('account.invoice').pay_and_reconcile(cr, uid, [context['id']], |
3622 | + amount, acc_id, data['period_id'], data['journal_id'], writeoff_account_id, |
3623 | + data['period_id'], writeoff_journal_id, context, data['name']) |
3624 | + return {} |
3625 | + |
3626 | +account_invoice_pay() |
3627 | + |
3628 | +class account_move_line_memory(osv.osv_memory): |
3629 | + _name= "account.move.line.memory" |
3630 | + _description = "Account Move Line Memory " |
3631 | + _columns = { |
3632 | + 'date': fields.date('Effective Date', required=True), |
3633 | + 'name': fields.char('Name', size=64, required=True), |
3634 | + 'account_id': fields.many2one('account.account', 'Account',), |
3635 | + 'journal_id': fields.many2one('account.journal', 'Journal', required=True, select=1), |
3636 | + 'debit': fields.float('Debit', digits=(16,2)), |
3637 | + 'credit': fields.float('Credit', digits=(16,2)), |
3638 | + 'tax_code_id': fields.many2one('account.tax.code', 'Tax Account', help="The account can either be a base tax code or tax code account."), |
3639 | + 'tax_amount': fields.float('Tax/Base Amount', digits=(16,2), select=True), |
3640 | + 'currency_id': fields.many2one('res.currency', 'Currency', help="The optional foreign currency if it is a multi-currency entry."), |
3641 | + 'amount_currency': fields.float('Amount Currency', help="The amount in the optional foreign currency if it is a multi-currency entry."), |
3642 | + 'analytic_account_id' : fields.many2one('account.analytic.account', 'Analytic Account'), |
3643 | + } |
3644 | +account_move_line_memory() |
3645 | + |
3646 | +class account_message(osv.osv_memory): |
3647 | + _name = "account.message" |
3648 | + def _check(self, cr, uid, ids, context=None): |
3649 | + data = self.read(cr, uid, ids,context=context)[0] |
3650 | + result = self.pool.get('account.invoice.pay').wo_check(cr, uid, ids, context=context) |
3651 | + return result |
3652 | + |
3653 | +account_message() |
3654 | + |
3655 | +class account_partial_message(osv.osv_memory): |
3656 | + _name = "account.partial.message" |
3657 | + def _check_partial(self, cr, uid, ids, context=None): |
3658 | + data = self.read(cr, uid, ids,context=context)[0] |
3659 | + result = self.pool.get('account.invoice.pay').pay_and_reconcile(cr, uid, ids, context=context) |
3660 | + return result |
3661 | + |
3662 | +account_partial_message() |
3663 | + |
3664 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
3665 | \ No newline at end of file |
3666 | |
3667 | === added file 'account_invoice_cash_discount/wizard/account_pay_invoice_view.xml' |
3668 | --- account_invoice_cash_discount/wizard/account_pay_invoice_view.xml 1970-01-01 00:00:00 +0000 |
3669 | +++ account_invoice_cash_discount/wizard/account_pay_invoice_view.xml 2011-07-29 01:35:58 +0000 |
3670 | @@ -0,0 +1,135 @@ |
3671 | +<?xml version="1.0" encoding="utf-8"?> |
3672 | +<openerp> |
3673 | + <data> |
3674 | + <record id="view_account_invoice_pay" model="ir.ui.view"> |
3675 | + <field name="name">account.invoice.pay.form</field> |
3676 | + <field name="model">account.invoice.pay</field> |
3677 | + <field name="type">form</field> |
3678 | + <field name="arch" type="xml"> |
3679 | + <form string="Pay Invoice"> |
3680 | + <group colspan="4"> |
3681 | + <field name="amount" on_change="on_change_ammount(amount, cash_amount, context)"/> |
3682 | + <field name="cash_residual_amount"/> |
3683 | + <field name="name"/> |
3684 | + <field name="date"/> |
3685 | + <field name="journal_id" domain="[('type', '=', 'cash')]"/> |
3686 | + <field name="period_id"/> |
3687 | + <field name="cash_amount" on_change="on_change_cash_discount_amount(cash_amount, amount, context)" attrs="{'required': [('cash_amount', '>', 0)]}"/> |
3688 | + <field name="account_id" attrs="{'required':[('cash_amount', '>', 0)]}"/> |
3689 | + </group> |
3690 | + <group> |
3691 | + <separator string="Method For Calculation" colspan="4"/> |
3692 | + <field name="cal_method_selection" colspan="2" nolabel="1"/> |
3693 | + <button icon="gtk-execute" string="Calculate" name="_calculation" type="object"/> |
3694 | + </group> |
3695 | + <group colspan="4"> |
3696 | + <separator string="Account Cash Discount Moves" colspan="4"/> |
3697 | + <field name="discount_move_ids" widget="one2many_list" nolabel="1"/> |
3698 | + </group> |
3699 | + <group colspan="4"> |
3700 | + <separator string="Tax Account Moves" colspan="4"/> |
3701 | + <field name="tax_move_ids" widget="one2many_list" nolabel="1"/> |
3702 | + </group> |
3703 | + <group colspan="4" col="6"> |
3704 | + <label string="" colspan="2"/> |
3705 | + <button icon="gtk-cancel" special="cancel" string="Cancel"/> |
3706 | + <button icon="gtk-execute" string="Partial Payment" name="_message_partial" type="object"/> |
3707 | + <button icon="gtk-execute" string="Full Payment" name="_message" type="object"/> |
3708 | + </group> |
3709 | + </form> |
3710 | + </field> |
3711 | + </record> |
3712 | + |
3713 | + <act_window name="Pay Invoice" |
3714 | + res_model="account.invoice.pay" |
3715 | + src_model="account.invoice" |
3716 | + view_mode="form" |
3717 | + target="new" |
3718 | + context="{'id': active_id}" |
3719 | + id="action_view_account_invoice_pay"/> |
3720 | + |
3721 | + <record id="view_account_invoice_pay_writeoff" model="ir.ui.view"> |
3722 | + <field name="name">account.invoice.pay.writeoff.form</field> |
3723 | + <field name="model">account.invoice.pay.writeoff</field> |
3724 | + <field name="type">form</field> |
3725 | + <field name="arch" type="xml"> |
3726 | + <form string="Information Addendum"> |
3727 | + <group colspan="4"> |
3728 | + <separator string="Write-Off Move" colspan="4"/> |
3729 | + <field name="writeoff_journal_id"/> |
3730 | + <field name="writeoff_acc_id" domain="[('type', '<>', 'view'), ('type', '<>', 'consolidation')]"/> |
3731 | + <field name="comment"/> |
3732 | + <separator string="Analytic" colspan="4"/> |
3733 | + <field name="analytic_id"/> |
3734 | + </group> |
3735 | + <group colspan="4" col="6"> |
3736 | + <label string="" colspan="2"/> |
3737 | + <button icon="gtk-cancel" special="cancel" string="Cancel"/> |
3738 | + <button icon="gtk-execute" string="Pay and Reconcile" name="pay_and_reconcile_writeoff" type="object"/> |
3739 | + </group> |
3740 | + </form> |
3741 | + </field> |
3742 | + </record> |
3743 | + |
3744 | + <record id="view_account_move_line_memory" model="ir.ui.view"> |
3745 | + <field name="name">account.move.line.memory.form</field> |
3746 | + <field name="model">account.move.line.memory</field> |
3747 | + <field name="type">tree</field> |
3748 | + <field name="arch" type="xml"> |
3749 | + <tree string="Account Move Line" editable="bottom"> |
3750 | + <field name="date"/> |
3751 | + <field name="name"/> |
3752 | + <field name="account_id"/> |
3753 | + <field name="journal_id"/> |
3754 | + <field name="debit"/> |
3755 | + <field name="credit"/> |
3756 | + <field name="tax_code_id"/> |
3757 | + <field name="tax_amount"/> |
3758 | + <field name="currency_id"/> |
3759 | + <field name="amount_currency"/> |
3760 | + <field name="analytic_account_id"/> |
3761 | + </tree> |
3762 | + </field> |
3763 | + </record> |
3764 | + |
3765 | + <record id="view_account_message" model="ir.ui.view"> |
3766 | + <field name="name">account.message.form</field> |
3767 | + <field name="model">account.message</field> |
3768 | + <field name="type">form</field> |
3769 | + <field name="arch" type="xml"> |
3770 | + <form string="Messages"> |
3771 | + <group> |
3772 | + <separator string="Full Payment" colspan="4"/> |
3773 | + <label string ="Do you really want to reconcile this invoice? |
3774 | +The proposed payment does not completely balance the invoiced amount. |
3775 | +Please check the payment term lines. Usually, one would use Partial |
3776 | +Payment to avoid the ready/paid state for this invoice." colspan="2"/> |
3777 | + <newline/> |
3778 | + <button icon="gtk-cancel" special="cancel" string="Cancel" colspan="1"/> |
3779 | + <button icon="gtk-execute" string="OK" name="_check" type="object" colspan="1"/> |
3780 | + </group> |
3781 | + </form> |
3782 | + </field> |
3783 | + </record> |
3784 | + |
3785 | + <record id="view_account_partial_message" model="ir.ui.view"> |
3786 | + <field name="name">account.partial.message.form</field> |
3787 | + <field name="model">account.partial.message</field> |
3788 | + <field name="type">form</field> |
3789 | + <field name="arch" type="xml"> |
3790 | + <form string="Messages"> |
3791 | + <group> |
3792 | + <separator string="Partial Payment" colspan="4"/> |
3793 | + <label string ="Do you really want to NOT reconcile this invoice? |
3794 | +The proposed payment completely balances the invoiced amount. |
3795 | +Please check the payment term lines. Usually, one would use Full Payment |
3796 | +to receive ready/paid state for this invoice." colspan="2"/> |
3797 | + <newline/> |
3798 | + <button icon="gtk-cancel" special="cancel" string="Cancel" colspan="1"/> |
3799 | + <button icon="gtk-execute" string="OK" name="_check_partial" type="object" colspan="1"/> |
3800 | + </group> |
3801 | + </form> |
3802 | + </field> |
3803 | + </record> |
3804 | + </data> |
3805 | +</openerp> |
3806 | \ No newline at end of file |
3807 | |
3808 | === added file 'account_invoice_cash_discount/wizard/invoice_statement_payment.py' |
3809 | --- account_invoice_cash_discount/wizard/invoice_statement_payment.py 1970-01-01 00:00:00 +0000 |
3810 | +++ account_invoice_cash_discount/wizard/invoice_statement_payment.py 2011-07-29 01:35:58 +0000 |
3811 | @@ -0,0 +1,288 @@ |
3812 | +# -*- encoding: utf-8 -*- |
3813 | +############################################################################## |
3814 | +# |
3815 | +# Copyright (c) 2008 Camptocamp SA All Rights Reserved. (JGG) |
3816 | +# |
3817 | +# WARNING: This program as such is intended to be used by professional |
3818 | +# programmers who take the whole responsability of assessing all potential |
3819 | +# consequences resulting from its eventual inadequacies and bugs |
3820 | +# End users who are looking for a ready-to-use solution with commercial |
3821 | +# garantees and support are strongly adviced to contract a Free Software |
3822 | +# Service Company |
3823 | +# |
3824 | +# This program is Free Software; you can redistribute it and/or |
3825 | +# modify it under the terms of the GNU General Public License |
3826 | +# as published by the Free Software Foundation; either version 2 |
3827 | +# of the License, or (at your option) any later version. |
3828 | +# |
3829 | +# This program is distributed in the hope that it will be useful, |
3830 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
3831 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3832 | +# GNU General Public License for more details. |
3833 | +# |
3834 | +# You should have received a copy of the GNU General Public License |
3835 | +# along with this program; if not, write to the Free Software |
3836 | +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
3837 | +# |
3838 | +############################################################################## |
3839 | + |
3840 | +import wizard |
3841 | +import pooler |
3842 | +from tools.misc import UpdateableStr |
3843 | +import time |
3844 | + |
3845 | +FORM = UpdateableStr() |
3846 | + |
3847 | +FIELDS = { |
3848 | + 'lines': { |
3849 | + 'string': 'Invoices', |
3850 | + 'type': 'many2many', |
3851 | + 'relation': 'account.move.line', |
3852 | + }, |
3853 | +} |
3854 | + |
3855 | +START_FIELD = { |
3856 | + 'date': { |
3857 | + 'string': 'Payment Date', |
3858 | + 'type': 'date', |
3859 | + 'required': True, |
3860 | + 'default': lambda *a: time.strftime('%Y-%m-%d'), |
3861 | + }, |
3862 | + 'journal_id': { |
3863 | + 'string': 'Journal', |
3864 | + 'type': 'many2many', |
3865 | + 'relation': 'account.journal', |
3866 | + 'domain': '[("type", "in", ["sale", "purchase", "cash"])]', |
3867 | + 'help': 'This field allows you to choose the accounting journals you want to search invoices in. If you leave this field empty all sale, purchase and cash journals will be searched.', |
3868 | + }, |
3869 | +} |
3870 | + |
3871 | +START_FORM = '''<?xml version="1.0"?> |
3872 | +<form string="Import Invoices in Statement"> |
3873 | + <label string="Choose Journal and Payment Date" colspan="4"/> |
3874 | + <field name="date"/> |
3875 | + <field name="journal_id" colspan="4"/> |
3876 | +</form>''' |
3877 | + |
3878 | +def _search_invoices(obj, cr, uid, data, context): |
3879 | + pool = pooler.get_pool(cr.dbname) |
3880 | + statement_obj = pool.get('account.bank.statement') |
3881 | + journal_obj = pool.get('account.journal') |
3882 | + line_obj = pool.get('account.move.line') |
3883 | + |
3884 | + statement = statement_obj.browse(cr, uid, data['id'], context=context) |
3885 | + args_move_line = [] |
3886 | + repeated_move_line_ids = [] |
3887 | + # Creating a group that is unique for importing move lines (move lines, once imported into statement lines, should not appear again) |
3888 | + for st_line in statement.line_ids: |
3889 | + args_move_line = [] |
3890 | + args_move_line.append(('name', '=', st_line.name)) |
3891 | + args_move_line.append(('ref', '=', st_line.ref)) |
3892 | + if st_line.partner_id: |
3893 | + args_move_line.append(('partner_id', '=', st_line.partner_id.id)) |
3894 | + args_move_line.append(('account_id', '=', st_line.account_id.id)) |
3895 | + |
3896 | + move_line_id = line_obj.search(cr, uid, args_move_line, context=context) |
3897 | + if move_line_id: |
3898 | + repeated_move_line_ids += move_line_id |
3899 | + |
3900 | + journal_ids = data['form']['journal_id'][0][2] |
3901 | + |
3902 | + if journal_ids == []: |
3903 | + journal_ids = journal_obj.search(cr, uid, [('type', 'in', ('sale', 'cash', 'purchase'))], context=context) |
3904 | + |
3905 | + args = [ |
3906 | + ('reconcile_id', '=', False), |
3907 | + ('journal_id', 'in', journal_ids), |
3908 | + ('account_id.reconcile', '=', True)] |
3909 | + |
3910 | + if repeated_move_line_ids: |
3911 | + args.append(('id', 'not in', repeated_move_line_ids)) |
3912 | + |
3913 | + line_ids = line_obj.search(cr, uid, args, |
3914 | + #order='date DESC, id DESC', #doesn't work |
3915 | + context=context) |
3916 | + |
3917 | + FORM.string = '''<?xml version="1.0"?> |
3918 | +<form string="Import Entries"> |
3919 | + <field name="lines" colspan="4" height="300" width="800" nolabel="1" |
3920 | + domain="[('id', 'in', [%s])]"/> |
3921 | +</form>''' % (','.join([str(x) for x in line_ids])) |
3922 | + return {} |
3923 | + |
3924 | +def _populate_statement(obj, cursor, user, data, context): |
3925 | + |
3926 | + line_ids = data['form']['lines'][0][2] |
3927 | + line_date=data['form']['date'] |
3928 | + if not line_ids: |
3929 | + return {} |
3930 | + |
3931 | + pool = pooler.get_pool(cursor.dbname) |
3932 | + statement_obj = pool.get('account.bank.statement') |
3933 | + statement_line_obj = pool.get('account.bank.statement.line') |
3934 | + statement_reconcile_obj = pool.get('account.bank.statement.reconcile') |
3935 | + statement_reconcile_line_obj = pool.get('account.bank.statement.reconcile.line') |
3936 | + obj_inv = pool.get('account.invoice') |
3937 | + invoice_tax_obj = pool.get("account.invoice.tax") |
3938 | + line_obj = pool.get('account.move.line') |
3939 | + currency_obj = pool.get('res.currency') |
3940 | + tax_obj = pool.get('account.tax') |
3941 | + |
3942 | + discount = 0.0 |
3943 | + |
3944 | + statement = statement_obj.browse(cursor, user, data['id'], context=context) |
3945 | + # for each selected move lines |
3946 | + for line in line_obj.browse(cursor, user, line_ids, context=context): |
3947 | + ctx = context.copy() |
3948 | + # take the date for computation of currency => use payment date |
3949 | + # if line.date_maturity: |
3950 | + # ctx['date'] = line.date_maturity |
3951 | + # else: |
3952 | + ctx['date'] = line_date |
3953 | + invoice_amount = cal_invoice_amount = 0.0 |
3954 | + if line.debit > 0: |
3955 | + invoice_amount = line.debit |
3956 | + elif line.credit > 0: |
3957 | + invoice_amount = -line.credit |
3958 | + |
3959 | + reconcile_id = statement_reconcile_obj.create(cursor, user, { |
3960 | + 'line_ids': [(6, 0, [line.id])] |
3961 | + }, context=context) |
3962 | + |
3963 | + ######################################### Calculation for discount and taxes###### |
3964 | + if line.invoice.id: |
3965 | + discount = 0.0 |
3966 | + account = False |
3967 | + invoice = obj_inv.browse(cursor, user, line.invoice.id, context=context) |
3968 | + for invoice_line in invoice.invoice_line: |
3969 | + line_tax_amount = total_tax_amount = 0.0 |
3970 | + tax_account_id = tax_code_id = tax_base_id = False |
3971 | + #####get the ratio of the line in the total invoice amount |
3972 | + for tax in tax_obj.compute(cursor, user, invoice_line.invoice_line_tax_id, invoice_line.price_subtotal / invoice_line.quantity, invoice_line.quantity, invoice.address_invoice_id.id, invoice_line.product_id, invoice.partner_id): |
3973 | + line_tax_amount += tax['amount'] |
3974 | + line_total = invoice_line.price_subtotal + line_tax_amount |
3975 | + invoice_res_amount = invoice.amount_total |
3976 | + line_ratio = line_total / invoice_res_amount |
3977 | + ########################### |
3978 | + if line.amount_currency: |
3979 | + invoice_amount = currency_obj.compute(cursor, user, line.currency_id.id, statement.currency.id, line.amount_currency, context=ctx) |
3980 | + elif line.invoice and line.invoice.currency_id.id <> statement.currency.id: |
3981 | + invoice_amount = currency_obj.compute(cursor, user, line.invoice.currency_id.id, statement.currency.id, invoice_amount, context=ctx) |
3982 | + |
3983 | + amount = obj_inv._get_amount(cursor, user, [invoice.id], invoice_amount, invoice.payment_term.id, context=context) |
3984 | + cal_invoice_amount = amount['amount'] |
3985 | + discount = obj_inv._get_payment(cursor, user, [invoice.id], cal_invoice_amount, invoice.payment_term.id, context=context) |
3986 | + account = obj_inv._get_account(cursor, user, [invoice.id], cal_invoice_amount, invoice.payment_term.id, context=context) |
3987 | + |
3988 | + ### set fiscal positon for the discount account |
3989 | + if account and invoice.fiscal_position: |
3990 | + account = pool.get('account.fiscal.position').map_account(cursor, user, invoice.fiscal_position, account) |
3991 | + |
3992 | + #### discount for the invoice line |
3993 | + discount_pay = discount * line_ratio |
3994 | + if invoice_line.invoice_line_tax_id: |
3995 | + tax_real_amt = 0.0 |
3996 | + for tax_id in invoice_line.invoice_line_tax_id: |
3997 | + tax_data = tax_obj.browse(cursor, user, tax_id.id, context=context) |
3998 | + tax_amt = discount_pay * tax_data.amount |
3999 | + tax_real_amt = tax_amt / (1 + tax_data.amount) |
4000 | + total_tax_amount += tax_real_amt |
4001 | + |
4002 | + tax_base = tax_data.base_code_id.id |
4003 | + tax_code = tax_data.tax_code_id.id |
4004 | + |
4005 | + tax_invoice_id = invoice_tax_obj.search(cursor, user, [('invoice_id', '=', invoice.id), ('tax_code_id', '=', tax_code), ('base_code_id', '=', tax_base)]) |
4006 | + for inv_tax_id in tax_invoice_id: |
4007 | + tax_value = invoice_tax_obj.browse(cursor, user, inv_tax_id) |
4008 | + tax_account_id = tax_value.account_id.id |
4009 | + tax_code_id = tax_value.tax_code_id.id |
4010 | + tax_base_id = tax_value.base_code_id.id |
4011 | + |
4012 | + ### set fisical positon for the tax account |
4013 | + if tax_account_id and invoice.fiscal_position: |
4014 | + tax_account_id = pool.get('account.fiscal.position').map_account(cursor, user, invoice.fiscal_position, tax_account_id) |
4015 | + |
4016 | + if tax_real_amt: |
4017 | + statement_reconcile_line_obj.create(cursor, user, { |
4018 | + 'name': line.name, |
4019 | + 'amount': tax_real_amt, |
4020 | + 'account_id': tax_account_id, |
4021 | + 'line_id': reconcile_id, |
4022 | + 'tax_code_id': tax_code_id |
4023 | + }, context=context) |
4024 | + |
4025 | + if discount: |
4026 | + discount = discount * line_ratio |
4027 | + statement_reconcile_line_obj.create(cursor, user, { |
4028 | + 'name': line.name, |
4029 | + 'amount': discount - total_tax_amount, |
4030 | + 'account_id': account, |
4031 | + 'line_id': reconcile_id, |
4032 | + 'tax_code_id': tax_base_id |
4033 | + }, context=context) |
4034 | + ########################################################################## |
4035 | + |
4036 | + if line.journal_id.type == 'sale': |
4037 | + type = 'customer' |
4038 | + elif line.journal_id.type == 'purchase': |
4039 | + type = 'supplier' |
4040 | + else: |
4041 | + type = 'general' |
4042 | + |
4043 | + statement_line_obj.create(cursor, user, { |
4044 | + 'name': line.name or '?', |
4045 | + 'amount': cal_invoice_amount, |
4046 | + 'type': type, |
4047 | + 'partner_id': line.partner_id.id, |
4048 | + 'account_id': line.account_id.id, |
4049 | + 'statement_id': statement.id, |
4050 | + 'ref': line.ref, |
4051 | + 'reconcile_id': reconcile_id, |
4052 | + 'date': line_date, #time.strftime('%Y-%m-%d'), #line.date_maturity or, |
4053 | + 'cash_discount': discount, |
4054 | + 'transferred_amount': cal_invoice_amount - discount, |
4055 | + }, context=context) |
4056 | + return {} |
4057 | + |
4058 | + |
4059 | +class PopulateStatementFromInv(wizard.interface): |
4060 | + """ |
4061 | + Populate the current statement with selected invoices |
4062 | + """ |
4063 | + states = { |
4064 | + 'init': { |
4065 | + 'actions': [], |
4066 | + 'result': { |
4067 | + 'type': 'form', |
4068 | + 'arch': START_FORM, |
4069 | + 'fields':START_FIELD, |
4070 | + 'state': [ |
4071 | + ('end', '_Cancel'), |
4072 | + ('go', '_Go', '', True), |
4073 | + ] |
4074 | + }, |
4075 | + }, |
4076 | + 'go': { |
4077 | + 'actions': [_search_invoices], |
4078 | + 'result': { |
4079 | + 'type': 'form', |
4080 | + 'arch': FORM, |
4081 | + 'fields': FIELDS, |
4082 | + 'state': [ |
4083 | + ('end', '_Cancel','', True), |
4084 | + ('finish', 'O_k','', True) |
4085 | + ] |
4086 | + }, |
4087 | + }, |
4088 | + |
4089 | + 'finish': { |
4090 | + 'actions': [], |
4091 | + 'result': { |
4092 | + 'type': 'action', |
4093 | + 'action': _populate_statement, |
4094 | + 'state': 'end' |
4095 | + }, |
4096 | + }, |
4097 | + } |
4098 | +PopulateStatementFromInv('populate_statement_from_inv1') |
4099 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
4100 | |
4101 | === added file 'account_invoice_cash_discount/wizard/wizard_discount_reconcile.py' |
4102 | --- account_invoice_cash_discount/wizard/wizard_discount_reconcile.py 1970-01-01 00:00:00 +0000 |
4103 | +++ account_invoice_cash_discount/wizard/wizard_discount_reconcile.py 2011-07-29 01:35:58 +0000 |
4104 | @@ -0,0 +1,291 @@ |
4105 | +# -*- encoding: utf-8 -*- |
4106 | +############################################################################## |
4107 | +# |
4108 | +# OpenERP, Open Source Management Solution |
4109 | +# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved |
4110 | +# $Id$ |
4111 | +# |
4112 | +# This program is free software: you can redistribute it and/or modify |
4113 | +# it under the terms of the GNU General Public License as published by |
4114 | +# the Free Software Foundation, either version 3 of the License, or |
4115 | +# (at your option) any later version. |
4116 | +# |
4117 | +# This program is distributed in the hope that it will be useful, |
4118 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
4119 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4120 | +# GNU General Public License for more details. |
4121 | +# |
4122 | +# You should have received a copy of the GNU General Public License |
4123 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
4124 | +# |
4125 | +############################################################################## |
4126 | + |
4127 | +import wizard |
4128 | +import netsvc |
4129 | +import time |
4130 | +import osv |
4131 | +import pooler |
4132 | +from mx import DateTime as datetime |
4133 | +from tools.translate import _ |
4134 | + |
4135 | +_transaction_form = '''<?xml version="1.0"?> |
4136 | +<form string="Reconciliation"> |
4137 | + <separator string="Reconciliation Transactions" colspan="4"/> |
4138 | + <field name="trans_nbr"/> |
4139 | + <newline/> |
4140 | + <field name="credit"/> |
4141 | + <field name="debit"/> |
4142 | + <separator string="Write-Off" colspan="4"/> |
4143 | + <field name="writeoff"/> |
4144 | +</form>''' |
4145 | + |
4146 | +_transaction_fields = { |
4147 | + 'trans_nbr': { |
4148 | + 'string': '# of Transaction', |
4149 | + 'type': 'integer', |
4150 | + 'readonly': True, |
4151 | + }, |
4152 | + 'credit': { |
4153 | + 'string': 'Credit Amount', |
4154 | + 'type': 'float', |
4155 | + 'readonly': True, |
4156 | + }, |
4157 | + 'debit': { |
4158 | + 'string': 'Debit Amount', |
4159 | + 'type': 'float', |
4160 | + 'readonly': True, |
4161 | + }, |
4162 | + 'writeoff': { |
4163 | + 'string': 'Write-Off Amount', |
4164 | + 'type': 'float', |
4165 | + 'readonly': True, |
4166 | + }, |
4167 | +} |
4168 | + |
4169 | +def _trans_rec_get(self, cr, uid, data, context=None): |
4170 | + pool = pooler.get_pool(cr.dbname) |
4171 | + account_move_line_obj = pool.get('account.move.line') |
4172 | + credit = debit = 0.0 |
4173 | + account_id = False |
4174 | + count = 0 |
4175 | + for line in account_move_line_obj.browse(cr, uid, data['ids'], context=context): |
4176 | + if not line.reconcile_id and not line.reconcile_id.id: |
4177 | + count += 1 |
4178 | + credit += line.credit |
4179 | + debit += line.debit |
4180 | + account_id = line.account_id.id |
4181 | + return {'trans_nbr': count, 'account_id': account_id, 'credit': credit, 'debit': debit, 'writeoff': debit - credit} |
4182 | + |
4183 | +def _trans_rec_reconcile_partial(self, cr, uid, data, context=None): |
4184 | + pool = pooler.get_pool(cr.dbname) |
4185 | + account_move_line_obj = pool.get('account.move.line') |
4186 | + account_move_line_obj.reconcile_partial(cr, uid, data['ids'], 'manual', context=context) |
4187 | + return {} |
4188 | + |
4189 | +def _trans_rec_reconcile(self, cr, uid, data, context=None): |
4190 | + pool = pooler.get_pool(cr.dbname) |
4191 | + account_move_line_obj = pool.get('account.move.line') |
4192 | + |
4193 | + form = data['form'] |
4194 | + account_id = form.get('writeoff_acc_id', False) |
4195 | + context['date_p'] = form.get('date_p', False) |
4196 | + date = False |
4197 | + if context['date_p']: |
4198 | + date = datetime.strptime(context['date_p'], '%Y-%m-%d') |
4199 | + ids = pool.get('account.period').find(cr, uid, dt=date, context=context) |
4200 | + period_id = False |
4201 | + if len(ids): |
4202 | + period_id = ids[0] |
4203 | + |
4204 | + journal_id = form.get('journal_id', False) |
4205 | + context['comment'] = form.get('comment', False) |
4206 | + context['analytic_id'] = form.get('analytic_id', False) |
4207 | + account_move_line_obj.reconcile(cr, uid, data['ids'], 'manual', account_id, |
4208 | + period_id, journal_id, context=context) |
4209 | + return {} |
4210 | + |
4211 | +def _trans_rec_reconcile_discount(self, cr, uid, data, context=None): |
4212 | + pool = pooler.get_pool(cr.dbname) |
4213 | + account_move_line_obj = pool.get('account.move.line') |
4214 | + |
4215 | + form = data['form'] |
4216 | + account_id = form.get('discount_acc_id', False) |
4217 | + context['date_p'] = form.get('date_p', False) |
4218 | + date = context['date_p'] and datetime.strptime(context['date_p'], '%Y-%m-%d') |
4219 | + ids = pool.get('account.period').find(cr, uid, dt=date, context=context) |
4220 | + period_id = False |
4221 | + if len(ids): |
4222 | + period_id = ids[0] |
4223 | + |
4224 | + journal_id = form.get('journal_id', False) |
4225 | + context['comment'] = form.get('comment', False) |
4226 | + context['analytic_id'] = form.get('analytic_id', False) |
4227 | + account_move_line_obj.reconcile_discount(cr, uid, data['ids'], 'manual', account_id, |
4228 | + period_id, journal_id, context=context) |
4229 | + return {} |
4230 | + |
4231 | +def _partial_check(self, cr, uid, data, context): |
4232 | + if _trans_rec_get(self,cr,uid, data, context)['writeoff'] == 0: |
4233 | + return 'init_full' |
4234 | + return 'init_partial' |
4235 | + |
4236 | +_transaction_add_form = '''<?xml version="1.0"?> |
4237 | +<form string="Information Addendum"> |
4238 | + <separator string="Write-Off Move" colspan="4"/> |
4239 | + <field name="journal_id"/> |
4240 | + <field name="writeoff_acc_id" domain="[('type', '<>', 'view')]"/> |
4241 | + <field name="date_p"/> |
4242 | + <field name="comment"/> |
4243 | + <separator string="Analytic" colspan="4"/> |
4244 | + <field name="analytic_id"/> |
4245 | +</form>''' |
4246 | + |
4247 | +_transaction_add_fields = { |
4248 | + 'journal_id': { |
4249 | + 'string': 'Write-Off Journal', |
4250 | + 'type': 'many2one', |
4251 | + 'relation': 'account.journal', |
4252 | + 'required': True, |
4253 | + }, |
4254 | + 'writeoff_acc_id': { |
4255 | + 'string': 'Write-Off account', |
4256 | + 'type': 'many2one', |
4257 | + 'relation': 'account.account', |
4258 | + 'required': True, |
4259 | + }, |
4260 | + 'date_p': { |
4261 | + 'string': 'Date', |
4262 | + 'type': 'date', |
4263 | + }, |
4264 | + 'comment': { |
4265 | + 'string': 'Comment', |
4266 | + 'type': 'char', |
4267 | + 'size': 64, |
4268 | + 'required': True, |
4269 | + }, |
4270 | + 'analytic_id': { |
4271 | + 'string': 'Analytic Account', |
4272 | + 'type': 'many2one', |
4273 | + 'relation': 'account.analytic.account', |
4274 | + }, |
4275 | +} |
4276 | + |
4277 | +def _trans_rec_addendum(self, cr, uid, data, context={}): |
4278 | + date_p = time.strftime('%Y-%m-%d') |
4279 | + return {'date_p': date_p, 'comment': _('Write-Off')} |
4280 | + |
4281 | +_transaction_discount_form = '''<?xml version="1.0"?> |
4282 | +<form string="Cash Discount Information"> |
4283 | + <separator string="Cash Discount Move" colspan="4"/> |
4284 | + <field name="journal_id"/> |
4285 | + <field name="discount_acc_id" domain="[('type', '<>', 'view')]"/> |
4286 | + <field name="date_p"/> |
4287 | + <field name="comment"/> |
4288 | + <separator string="Analytic" colspan="4"/> |
4289 | + <field name="analytic_id"/> |
4290 | +</form>''' |
4291 | + |
4292 | +_transaction_discount_fields = { |
4293 | + 'journal_id': { |
4294 | + 'string': 'Cash Discount Journal', |
4295 | + 'type': 'many2one', |
4296 | + 'relation': 'account.journal', |
4297 | + 'required': True, |
4298 | + }, |
4299 | + 'discount_acc_id': { |
4300 | + 'string': 'Cash Discount account', |
4301 | + 'type': 'many2one', |
4302 | + 'relation': 'account.account', |
4303 | + 'required': True, |
4304 | + }, |
4305 | + 'date_p': { |
4306 | + 'string': 'Date', |
4307 | + 'type': 'date', |
4308 | + }, |
4309 | + 'comment': { |
4310 | + 'string': 'Comment', |
4311 | + 'type': 'char', |
4312 | + 'size': 64, |
4313 | + 'required': True, |
4314 | + }, |
4315 | + 'analytic_id': { |
4316 | + 'string': 'Analytic Account', |
4317 | + 'type': 'many2one', |
4318 | + 'relation': 'account.analytic.account', |
4319 | + }, |
4320 | +} |
4321 | + |
4322 | +def _trans_rec_discount(self, cr, uid, data, context={}): |
4323 | + date_p = time.strftime('%Y-%m-%d') |
4324 | + return {'date_p': date_p, 'comment': _('Cash Discount')} |
4325 | + |
4326 | +class wiz_reconcile(wizard.interface): |
4327 | + states = { |
4328 | + 'init': { |
4329 | + 'actions': [], |
4330 | + 'result': { |
4331 | + 'type': 'choice', |
4332 | + 'next_state': _partial_check, |
4333 | + } |
4334 | + }, |
4335 | + 'init_full': { |
4336 | + 'actions': [_trans_rec_get], |
4337 | + 'result': { |
4338 | + 'type': 'form', |
4339 | + 'arch': _transaction_form, |
4340 | + 'fields': _transaction_fields, |
4341 | + 'state': [('end', 'Cancel'), ('reconcile', 'Reconcile')], |
4342 | + } |
4343 | + }, |
4344 | + 'init_partial': { |
4345 | + 'actions': [_trans_rec_get], |
4346 | + 'result': { |
4347 | + 'type': 'form', |
4348 | + 'arch': _transaction_form, |
4349 | + 'fields': _transaction_fields, |
4350 | + 'state': [('end', 'Cancel'), ('addendum', 'Reconcile with Write-Off'), ('discount', 'Reconcile with Cash Discount'), ('partial', 'Partial Reconcile')], |
4351 | + } |
4352 | + }, |
4353 | + 'addendum': { |
4354 | + 'actions': [_trans_rec_addendum], |
4355 | + 'result': { |
4356 | + 'type': 'form', |
4357 | + 'arch': _transaction_add_form, |
4358 | + 'fields': _transaction_add_fields, |
4359 | + 'state': [('end', 'Cancel'), ('reconcile', 'Reconcile')], |
4360 | + } |
4361 | + }, |
4362 | + 'discount': { |
4363 | + 'actions': [_trans_rec_discount], |
4364 | + 'result': { |
4365 | + 'type': 'form', |
4366 | + 'arch': _transaction_discount_form, |
4367 | + 'fields': _transaction_discount_fields, |
4368 | + 'state': [('end', 'Cancel'), ('reconcile_discount', 'Reconcile')], |
4369 | + } |
4370 | + }, |
4371 | + 'reconcile': { |
4372 | + 'actions': [_trans_rec_reconcile], |
4373 | + 'result': { |
4374 | + 'type': 'state', |
4375 | + 'state': 'end', |
4376 | + } |
4377 | + }, |
4378 | + 'reconcile_discount': { |
4379 | + 'actions': [_trans_rec_reconcile_discount], |
4380 | + 'result': { |
4381 | + 'type': 'state', |
4382 | + 'state': 'end', |
4383 | + } |
4384 | + }, |
4385 | + 'partial': { |
4386 | + 'actions': [_trans_rec_reconcile_partial], |
4387 | + 'result': { |
4388 | + 'type': 'state', |
4389 | + 'state': 'end', |
4390 | + } |
4391 | + } |
4392 | + } |
4393 | +wiz_reconcile('account.move.line.discount.reconcile') |
4394 | + |
4395 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
4396 | |
4397 | === added file 'account_invoice_cash_discount/wizard/wizard_write_period_entry_calculation.py' |
4398 | --- account_invoice_cash_discount/wizard/wizard_write_period_entry_calculation.py 1970-01-01 00:00:00 +0000 |
4399 | +++ account_invoice_cash_discount/wizard/wizard_write_period_entry_calculation.py 2011-07-29 01:35:58 +0000 |
4400 | @@ -0,0 +1,188 @@ |
4401 | +# -*- encoding: utf-8 -*- |
4402 | +############################################################################## |
4403 | +# |
4404 | +# OpenERP, Open Source Management Solution |
4405 | +# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved |
4406 | +# $Id$ |
4407 | +# |
4408 | +# This program is free software: you can redistribute it and/or modify |
4409 | +# it under the terms of the GNU General Public License as published by |
4410 | +# the Free Software Foundation, either version 3 of the License, or |
4411 | +# (at your option) any later version. |
4412 | +# |
4413 | +# This program is distributed in the hope that it will be useful, |
4414 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
4415 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4416 | +# GNU General Public License for more details. |
4417 | +# |
4418 | +# You should have received a copy of the GNU General Public License |
4419 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
4420 | +# |
4421 | +############################################################################## |
4422 | + |
4423 | +import wizard |
4424 | +import pooler |
4425 | +import time |
4426 | +from datetime import datetime |
4427 | +from dateutil.relativedelta import relativedelta |
4428 | +from mx import DateTime |
4429 | +from tools.translate import _ |
4430 | + |
4431 | +_writeoff_entry_calculation_form = '''<?xml version="1.0"?> |
4432 | +<form string="Calculation"> |
4433 | + <separator string="Calculation of period-wise Write-Off Amount" colspan="4"/> |
4434 | + <field name="cash_discount_id"/> |
4435 | + <field name="tax_id"/> |
4436 | + <field name="period_id"/> |
4437 | + <field name="journal_id"/> |
4438 | +</form>''' |
4439 | + |
4440 | +_writeoff_entry_calculation_fields = { |
4441 | + 'cash_discount_id': { |
4442 | + 'string': 'Cash Discount Account', |
4443 | + 'type': 'many2one', |
4444 | + 'relation': 'account.account', |
4445 | + 'required': True, |
4446 | + }, |
4447 | + 'tax_id': { |
4448 | + 'string': 'Taxes', |
4449 | + 'type': 'many2one', |
4450 | + 'relation': 'account.tax', |
4451 | + 'required': True, |
4452 | + }, |
4453 | + 'period_id': { |
4454 | + 'string': 'Period', |
4455 | + 'type': 'many2one', |
4456 | + 'relation': 'account.period', |
4457 | + 'required': True, |
4458 | + }, |
4459 | + 'journal_id': { |
4460 | + 'string': 'Journal', |
4461 | + 'type': 'many2one', |
4462 | + 'relation': 'account.journal', |
4463 | + 'required': True, |
4464 | + }, |
4465 | +} |
4466 | + |
4467 | +def _compute(self, cr, uid, data, context): |
4468 | + |
4469 | + pool = pooler.get_pool(cr.dbname) |
4470 | + invoice_obj = pool.get('account.invoice') |
4471 | + account_move_obj= pool.get('account.move') |
4472 | + account_move_line_obj = pool.get('account.move.line') |
4473 | + payment_term_obj = pool.get('account.payment.term') |
4474 | + tax_obj = pool.get('account.tax') |
4475 | + |
4476 | + period_id = data['form']['period_id'] |
4477 | + tax_id = data['form']['tax_id'] |
4478 | + journal_id = data['form']['journal_id'] |
4479 | + cash_discount_id = data['form']['cash_discount_id'] |
4480 | + |
4481 | + account_move_line_ids = account_move_line_obj.search(cr, uid, [('period_id', '=', period_id), ('account_id', '=', cash_discount_id)]) |
4482 | + date = time.strftime('%Y-%m-%d') |
4483 | + |
4484 | + discount_lines = [] |
4485 | + |
4486 | + tax_account_id = dis_tax_code_id = discount_code_id = False |
4487 | + |
4488 | + for line in account_move_line_obj.browse(cr, uid, account_move_line_ids, context=context): |
4489 | + tax_discount_amt = 0.0 |
4490 | + tax_discount_data = tax_obj.browse(cr, uid, tax_id, context=context) |
4491 | + tax_account_id = tax_discount_data.account_collected_id and tax_discount_data.account_collected_id.id or tax_discount_data.tax_code_id.id |
4492 | + discount_code_id = tax_discount_data.base_code_id.id |
4493 | + dis_tax_code_id = tax_discount_data.tax_code_id.id |
4494 | + |
4495 | + if line.debit > 0.0: |
4496 | + tax_discount_amt = 0.0 |
4497 | + tax_discount_amt = line.debit * tax_discount_data.amount |
4498 | + |
4499 | + discount_lines.append( |
4500 | + (0, 0, { |
4501 | + 'name': line.name, |
4502 | + 'debit': 0.0, |
4503 | + 'credit': tax_discount_amt, |
4504 | + 'account_id': cash_discount_id, |
4505 | + 'date': date, |
4506 | + 'partner_id': line.partner_id.id, |
4507 | + 'tax_amount': -tax_discount_amt, |
4508 | + 'tax_code_id': discount_code_id, |
4509 | + })), |
4510 | + discount_lines.append( |
4511 | + (0, 0, { |
4512 | + 'name': line.name, |
4513 | + 'debit': tax_discount_amt, |
4514 | + 'credit': 0.0, |
4515 | + 'account_id': tax_account_id, |
4516 | + 'date': date, |
4517 | + 'partner_id': line.partner_id.id, |
4518 | + 'tax_amount': -tax_discount_amt, |
4519 | + 'tax_code_id': dis_tax_code_id, |
4520 | + })) |
4521 | + elif line.credit > 0.0: |
4522 | + tax_discount_amt = 0.0 |
4523 | + tax_discount_amt = line.credit * tax_discount_data.amount |
4524 | + |
4525 | + discount_lines.append( |
4526 | + (0, 0, { |
4527 | + 'name': line.name, |
4528 | + 'debit': 0.0, |
4529 | + 'credit': tax_discount_amt, |
4530 | + 'account_id': tax_account_id, |
4531 | + 'date': date, |
4532 | + 'partner_id': line.partner_id.id, |
4533 | + 'tax_amount': -tax_discount_amt, |
4534 | + 'tax_code_id': dis_tax_code_id, |
4535 | + })) |
4536 | + discount_lines.append( |
4537 | + (0, 0, { |
4538 | + 'name': line.name, |
4539 | + 'debit': tax_discount_amt, |
4540 | + 'credit': 0.0, |
4541 | + 'account_id': cash_discount_id, |
4542 | + 'date': date, |
4543 | + 'partner_id': line.partner_id.id, |
4544 | + 'tax_amount': -tax_discount_amt, |
4545 | + 'tax_code_id': discount_code_id, |
4546 | + })), |
4547 | + |
4548 | + discount_move_line = account_move_obj.create(cr, uid, |
4549 | + { |
4550 | + 'period_id': period_id, |
4551 | + 'journal_id': journal_id, |
4552 | + 'date': date, |
4553 | + 'line_id': discount_lines, |
4554 | + }) |
4555 | + |
4556 | + return { |
4557 | + 'domain': [('id', '=', discount_move_line)], |
4558 | + 'name': _('Computed Entries'), |
4559 | + 'view_type': 'form', |
4560 | + 'view_mode': 'tree,form', |
4561 | + 'view_id': False, |
4562 | + 'res_model': 'account.move', |
4563 | + 'type': 'ir.actions.act_window', |
4564 | + } |
4565 | + |
4566 | +class wiz_period_writeoff_calculation(wizard.interface): |
4567 | + states = { |
4568 | + 'init': { |
4569 | + 'actions': [], |
4570 | + 'result': { |
4571 | + 'type': 'form', |
4572 | + 'arch': _writeoff_entry_calculation_form, |
4573 | + 'fields': _writeoff_entry_calculation_fields, |
4574 | + 'state': [('calculate', 'Compute'), ('end', 'Cancel')], |
4575 | + } |
4576 | + }, |
4577 | + 'calculate': { |
4578 | + 'actions': [], |
4579 | + 'result': { |
4580 | + 'type': 'action', |
4581 | + 'action': _compute, |
4582 | + 'state': 'end', |
4583 | + } |
4584 | + } |
4585 | + } |
4586 | +wiz_period_writeoff_calculation('account_period_write_calculation') |
4587 | + |
4588 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
4589 | |
4590 | === added directory 'account_payment_discount_extension' |
4591 | === added file 'account_payment_discount_extension/__init__.py' |
4592 | --- account_payment_discount_extension/__init__.py 1970-01-01 00:00:00 +0000 |
4593 | +++ account_payment_discount_extension/__init__.py 2011-07-29 01:35:58 +0000 |
4594 | @@ -0,0 +1,24 @@ |
4595 | +# -*- encoding: utf-8 -*- |
4596 | +############################################################################## |
4597 | +# |
4598 | +# OpenERP, Open Source Management Solution |
4599 | +# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved |
4600 | +# $Id$ |
4601 | +# |
4602 | +# This program is free software: you can redistribute it and/or modify |
4603 | +# it under the terms of the GNU General Public License as published by |
4604 | +# the Free Software Foundation, either version 3 of the License, or |
4605 | +# (at your option) any later version. |
4606 | +# |
4607 | +# This program is distributed in the hope that it will be useful, |
4608 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
4609 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4610 | +# GNU General Public License for more details. |
4611 | +# |
4612 | +# You should have received a copy of the GNU General Public License |
4613 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
4614 | +# |
4615 | +############################################################################## |
4616 | + |
4617 | +import account_payment_discount |
4618 | +import wizard |
4619 | \ No newline at end of file |
4620 | |
4621 | === added file 'account_payment_discount_extension/__terp__.py' |
4622 | --- account_payment_discount_extension/__terp__.py 1970-01-01 00:00:00 +0000 |
4623 | +++ account_payment_discount_extension/__terp__.py 2011-07-29 01:35:58 +0000 |
4624 | @@ -0,0 +1,44 @@ |
4625 | +# -*- encoding: utf-8 -*- |
4626 | +############################################################################## |
4627 | +# |
4628 | +# OpenERP, Open Source Management Solution |
4629 | +# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved |
4630 | +# $Id$ |
4631 | +# |
4632 | +# This program is free software: you can redistribute it and/or modify |
4633 | +# it under the terms of the GNU General Public License as published by |
4634 | +# the Free Software Foundation, either version 3 of the License, or |
4635 | +# (at your option) any later version. |
4636 | +# |
4637 | +# This program is distributed in the hope that it will be useful, |
4638 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
4639 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4640 | +# GNU General Public License for more details. |
4641 | +# |
4642 | +# You should have received a copy of the GNU General Public License |
4643 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
4644 | +# |
4645 | +############################################################################## |
4646 | + |
4647 | +{ |
4648 | + "name" : "Account Payment Discount Extension", |
4649 | + "version" : "1.1", |
4650 | + "author" : "Big Consulting", |
4651 | + "website" : "http://www.openbig.org", |
4652 | + "category" : "Generic Modules/Accounting", |
4653 | + "license" : "GPL-3", |
4654 | + "depends" : ["base","account_payment_extension",], |
4655 | + "init_xml" : [ |
4656 | + ], |
4657 | + "demo_xml" : [ |
4658 | + ], |
4659 | + "update_xml" : [ |
4660 | + "account_payment_disocunt_wizard.xml", |
4661 | + "account_payment_discount_view.xml", |
4662 | + "account_payment_discount_data.xml", |
4663 | + ], |
4664 | + "active": False, |
4665 | + "installable": True, |
4666 | + 'certificate': '001057921598129524157', |
4667 | +} |
4668 | + |
4669 | |
4670 | === added file 'account_payment_discount_extension/account_payment_discount.py' |
4671 | --- account_payment_discount_extension/account_payment_discount.py 1970-01-01 00:00:00 +0000 |
4672 | +++ account_payment_discount_extension/account_payment_discount.py 2011-07-29 01:35:58 +0000 |
4673 | @@ -0,0 +1,115 @@ |
4674 | +# -*- encoding: utf-8 -*- |
4675 | +############################################################################## |
4676 | +# |
4677 | +# OpenERP, Open Source Management Solution |
4678 | +# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved |
4679 | +# $Id$ |
4680 | +# |
4681 | +# This program is free software: you can redistribute it and/or modify |
4682 | +# it under the terms of the GNU General Public License as published by |
4683 | +# the Free Software Foundation, either version 3 of the License, or |
4684 | +# (at your option) any later version. |
4685 | +# |
4686 | +# This program is distributed in the hope that it will be useful, |
4687 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
4688 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4689 | +# GNU General Public License for more details. |
4690 | +# |
4691 | +# You should have received a copy of the GNU General Public License |
4692 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
4693 | +# |
4694 | +############################################################################## |
4695 | + |
4696 | +import netsvc |
4697 | +from osv import fields, osv |
4698 | +import time |
4699 | +from mx import DateTime |
4700 | + |
4701 | +class payment_order(osv.osv): |
4702 | + _inherit='payment.order' |
4703 | + _columns={ |
4704 | + 'inter_bank_journal': fields.many2one('account.journal', 'Intermediate Bank Journal', required=False), |
4705 | + } |
4706 | +payment_order() |
4707 | + |
4708 | +class account_invoice(osv.osv): |
4709 | + _inherit='account.invoice' |
4710 | + _columns={ |
4711 | + 'next_payment_date': fields.date('Next Payment Date', states={'open': [('readonly', True)], 'close': [('readonly', True)]},), |
4712 | + } |
4713 | + |
4714 | + def action_date_assign(self, cr, uid, ids, *args): |
4715 | + data = super(account_invoice, self).action_date_assign(cr, uid, ids, *args) |
4716 | + for inv in self.browse(cr, uid, ids): |
4717 | + if inv.payment_term.id: |
4718 | + payment_data = self.pool.get('account.payment.term').browse(cr, uid, inv.payment_term.id).cash_discount_ids |
4719 | + if payment_data: |
4720 | + delay = payment_data[0].delay |
4721 | + if inv.date_invoice: |
4722 | + date_invoice = inv.date_invoice |
4723 | + else: |
4724 | + date_invoice = time.strftime('%Y-%m-%d') |
4725 | + self.write(cr, uid, [inv.id], {'next_payment_date': (DateTime.strptime(date_invoice, '%Y-%m-%d') + DateTime.RelativeDateTime(days = delay)).strftime('%Y-%m-%d')}) |
4726 | + return data |
4727 | + |
4728 | + def _next_date(self, cr, uid, ids, context=None): |
4729 | + payment_term_obj = self.pool.get('account.payment.term') |
4730 | + current_date = time.strftime('%Y-%m-%d') |
4731 | + ids = self.search(cr, uid, [('state', '=', 'open')]) |
4732 | + for id in ids: |
4733 | + invoice_data = self.browse(cr, uid, id, context=context) |
4734 | + next_pay_date = invoice_data.next_payment_date |
4735 | + if invoice_data.payment_term: |
4736 | + payment_data = payment_term_obj.browse(cr, uid, invoice_data.payment_term.id) |
4737 | + if next_pay_date: |
4738 | + if next_pay_date < current_date: |
4739 | + for dis_line in payment_data.cash_discount_ids: |
4740 | + discount_date = (DateTime.strptime(invoice_data.date_invoice, '%Y-%m-%d') + DateTime.RelativeDateTime(days=dis_line.delay)).strftime('%Y-%m-%d') |
4741 | + if discount_date > current_date: |
4742 | + self.write(cr, uid, [id], {'next_payment_date': discount_date}) |
4743 | + break |
4744 | + return True |
4745 | + |
4746 | + def check_next_date(self, cr, uid, ids=[], context=None): |
4747 | + self._next_date(cr, uid, ids, context=context) |
4748 | + |
4749 | + def copy(self, cr, uid, id, default=None, context=None): |
4750 | + if default is None: |
4751 | + default = {} |
4752 | + default = default.copy() |
4753 | + default.update({'next_payment_date': False}) |
4754 | + return super(account_invoice, self).copy(cr, uid, id, default, context) |
4755 | + |
4756 | +account_invoice() |
4757 | + |
4758 | +class payment_line(osv.osv): |
4759 | + _name = 'payment.line' |
4760 | + _inherit = 'payment.line' |
4761 | + _columns = { |
4762 | + 'cash_discount': fields.float('Cash Discount'), |
4763 | + 'discount_date': fields.date('Discount Date'), |
4764 | + 'pay_amount': fields.float('Pay Amount'), |
4765 | + } |
4766 | +payment_line() |
4767 | + |
4768 | +class res_partner(osv.osv): |
4769 | + _inherit = 'res.partner' |
4770 | + _columns = { |
4771 | + 'property_customer_cash_discount_account': fields.property( |
4772 | + 'account.account', |
4773 | + type = 'many2one', |
4774 | + relation = 'account.account', |
4775 | + string = "Customer Cash Discount Account", |
4776 | + method = True, |
4777 | + view_load = True, |
4778 | + required = True), |
4779 | + 'property_supplier_cash_discount_account': fields.property( |
4780 | + 'account.account', |
4781 | + type = 'many2one', |
4782 | + relation = 'account.account', |
4783 | + string = "Supplier Cash Discount Account", |
4784 | + method = True, |
4785 | + view_load = True, |
4786 | + required = True), |
4787 | + } |
4788 | +res_partner() |
4789 | |
4790 | === added file 'account_payment_discount_extension/account_payment_discount_data.xml' |
4791 | --- account_payment_discount_extension/account_payment_discount_data.xml 1970-01-01 00:00:00 +0000 |
4792 | +++ account_payment_discount_extension/account_payment_discount_data.xml 2011-07-29 01:35:58 +0000 |
4793 | @@ -0,0 +1,15 @@ |
4794 | +<?xml version="1.0" encoding="utf-8"?> |
4795 | +<openerp> |
4796 | + <data noupdate="1"> |
4797 | + <record forcecreate="True" id="ir_cron_discount_action" model="ir.cron"> |
4798 | + <field name="name">Next Payment Date</field> |
4799 | + <field name="interval_number">1</field> |
4800 | + <field name="interval_type">days</field> |
4801 | + <field name="numbercall">-1</field> |
4802 | + <field eval="False" name="doall"/> |
4803 | + <field eval="'account.invoice'" name="model"/> |
4804 | + <field eval="'check_next_date'" name="function"/> |
4805 | + <field eval="'(False,)'" name="args"/> |
4806 | + </record> |
4807 | + </data> |
4808 | +</openerp> |
4809 | |
4810 | === added file 'account_payment_discount_extension/account_payment_discount_view.xml' |
4811 | --- account_payment_discount_extension/account_payment_discount_view.xml 1970-01-01 00:00:00 +0000 |
4812 | +++ account_payment_discount_extension/account_payment_discount_view.xml 2011-07-29 01:35:58 +0000 |
4813 | @@ -0,0 +1,138 @@ |
4814 | +<?xml version="1.0" encoding="utf-8"?> |
4815 | +<openerp> |
4816 | + <data> |
4817 | + <record model="ir.ui.view" id="invoice_customer_form_inherit11"> |
4818 | + <field name="name">account.invoice.customer.form.inherit</field> |
4819 | + <field name="model">account.invoice</field> |
4820 | + <field name="type">form</field> |
4821 | + <field name="inherit_id" ref="account.invoice_form"/> |
4822 | + <field name="arch" type="xml"> |
4823 | + <field name="date_due" position="after"> |
4824 | + <field name="next_payment_date"/> |
4825 | + </field> |
4826 | + </field> |
4827 | + </record> |
4828 | + |
4829 | + <record model="ir.ui.view" id="invoice_supplier_form_inherit11"> |
4830 | + <field name="name">account.invoice.supplier.form.inherit</field> |
4831 | + <field name="model">account.invoice</field> |
4832 | + <field name="type">form</field> |
4833 | + <field name="inherit_id" ref="account.invoice_supplier_form"/> |
4834 | + <field name="priority">2</field> |
4835 | + <field name="arch" type="xml"> |
4836 | + <field name="number" position="before"> |
4837 | + <field name="next_payment_date"/> |
4838 | + </field> |
4839 | + </field> |
4840 | + </record> |
4841 | + |
4842 | + <record id="view_payment_order_form_wizard_ext" model="ir.ui.view"> |
4843 | + <field name="name">payment.order.form.ext11</field> |
4844 | + <field name="model">payment.order</field> |
4845 | + <field name="type">form</field> |
4846 | + <field name="inherit_id" ref="account_payment_extension.view_payment_order_form_ext1"/> |
4847 | + <field name="arch" type="xml"> |
4848 | + <xpath expr="//button[@string='Select invoices to pay/receive payment']" position="replace"> |
4849 | + <label string=""/> |
4850 | + <button name="%(wizard_populate_payment_discount_ext)d" string="Select invoices to pay/receive payment" type="action" attrs="{'invisible': [('state', '=', 'done')]}"/> |
4851 | + </xpath> |
4852 | + </field> |
4853 | + </record> |
4854 | + |
4855 | + <record model="ir.ui.view" id="view_payment_order_form1"> |
4856 | + <field name="name">payment.order.form1</field> |
4857 | + <field name="model">payment.order</field> |
4858 | + <field name="inherit_id" ref="account_payment.view_payment_order_form"/> |
4859 | + <field name="type">form</field> |
4860 | + <field name="arch" type="xml"> |
4861 | + <xpath expr="//field[@name='partner_id']" position="before"> |
4862 | + <field name="cash_discount"/> |
4863 | + <field name="discount_date"/> |
4864 | + <field name="pay_amount"/> |
4865 | + <label string=""/> |
4866 | + </xpath> |
4867 | + </field> |
4868 | + </record> |
4869 | + |
4870 | + <record model="ir.ui.view" id="view_payment_order_tree1"> |
4871 | + <field name="name">payment.order.form1</field> |
4872 | + <field name="model">payment.order</field> |
4873 | + <field name="inherit_id" ref="account_payment.view_payment_order_form"/> |
4874 | + <field name="type">tree</field> |
4875 | + <field name="arch" type="xml"> |
4876 | + <xpath expr="//tree/field[@name='amount']" position="after"> |
4877 | + <field name="cash_discount"/> |
4878 | + <field name="discount_date"/> |
4879 | + <field name="pay_amount"/> |
4880 | + </xpath> |
4881 | + </field> |
4882 | + </record> |
4883 | + |
4884 | + <record model="ir.ui.view" id="view_payment_order_bank_form1"> |
4885 | + <field name="name">payment.order.form1</field> |
4886 | + <field name="model">payment.order</field> |
4887 | + <field name="inherit_id" ref="account_payment.view_payment_order_form"/> |
4888 | + <field name="type">form</field> |
4889 | + <field name="arch" type="xml"> |
4890 | + <field name="user_id" position="after"> |
4891 | + <field name="inter_bank_journal" required="True"/> |
4892 | + </field> |
4893 | + </field> |
4894 | + </record> |
4895 | + |
4896 | + <record id="view_payment_order_wizard_form" model="ir.ui.view"> |
4897 | + <field name="name">payment.order.form1</field> |
4898 | + <field name="model">payment.order</field> |
4899 | + <field name="type">form</field> |
4900 | + <field name="inherit_id" ref="account_payment.view_payment_order_form"/> |
4901 | + <field name="arch" type="xml"> |
4902 | + <xpath expr="//button[@string='Make Payments']" position="replace"> |
4903 | + <button name="%(wizard_pay_discount_payment)d" states="open" string="Make Payments" type="action" /> |
4904 | + </xpath> |
4905 | + </field> |
4906 | + </record> |
4907 | + |
4908 | + <record id="view_partner_customer_discount_property_form" model="ir.ui.view"> |
4909 | + <field name="name">res.partner.property.cus_discount.form.inherit</field> |
4910 | + <field name="model">res.partner</field> |
4911 | + <field name="type">form</field> |
4912 | + <field name="priority">2</field> |
4913 | + <field name="inherit_id" ref="account.view_partner_property_form"/> |
4914 | + <field name="arch" type="xml"> |
4915 | + <field name="property_account_receivable" position="after"> |
4916 | + <field name="property_customer_cash_discount_account"/> |
4917 | + </field> |
4918 | + </field> |
4919 | + </record> |
4920 | + |
4921 | + <record id="view_partner_supplier_discount_property_form" model="ir.ui.view"> |
4922 | + <field name="name">res.partner.property.sup_discount.form.inherit</field> |
4923 | + <field name="model">res.partner</field> |
4924 | + <field name="type">form</field> |
4925 | + <field name="priority">2</field> |
4926 | + <field name="inherit_id" ref="account.view_partner_property_form"/> |
4927 | + <field name="arch" type="xml"> |
4928 | + <field name="property_account_payable" position="after"> |
4929 | + <field name="property_supplier_cash_discount_account"/> |
4930 | + </field> |
4931 | + </field> |
4932 | + </record> |
4933 | + |
4934 | + <!--**************************** Customer Invoice Refunds *******************************--> |
4935 | + <menuitem id="menu_customer_invoice_refund" |
4936 | + name="Customer Invoice Refunds" |
4937 | + parent="account_payment.menu_main"/> |
4938 | + |
4939 | + <record id="action_menu_customer_invoice_refund" model="ir.actions.act_window"> |
4940 | + <field name="name">Customer Invoice Refunds</field> |
4941 | + <field name="res_model">payment.order</field> |
4942 | + <field name="view_type">form</field> |
4943 | + <field name="view_mode">tree,form</field> |
4944 | + <field name="context">{'payment_type_customer': 'customer_refund'}</field> |
4945 | + <field name="domain">[('type', '=', 'payable')]</field> |
4946 | + </record> |
4947 | + <menuitem action="action_menu_customer_invoice_refund" |
4948 | + id="menu_action_menu_customer_invoice_refund" |
4949 | + parent="menu_customer_invoice_refund" /> |
4950 | + </data> |
4951 | +</openerp> |
4952 | |
4953 | === added file 'account_payment_discount_extension/account_payment_disocunt_wizard.xml' |
4954 | --- account_payment_discount_extension/account_payment_disocunt_wizard.xml 1970-01-01 00:00:00 +0000 |
4955 | +++ account_payment_discount_extension/account_payment_disocunt_wizard.xml 2011-07-29 01:35:58 +0000 |
4956 | @@ -0,0 +1,27 @@ |
4957 | +<?xml version="1.0" encoding="utf-8"?> |
4958 | +<openerp> |
4959 | + <data> |
4960 | + <wizard id="wizard_populate_payment_discount_ext" |
4961 | + menu="False" |
4962 | + model="payment.order" |
4963 | + name="populate_payment_discount_ext" |
4964 | + string="Populate Payment to Pay"/> |
4965 | + |
4966 | + <wizard id="wizard_pay_discount_payment" |
4967 | + menu="False" |
4968 | + model="payment.order" |
4969 | + name="pay_discount_payment" |
4970 | + string="Pay"/> |
4971 | + |
4972 | + <wizard id="wizard_calculate_next_payment_date" |
4973 | + menu="True" |
4974 | + model="payment.order" |
4975 | + name="cal_next_payment_date" |
4976 | + string="Recompute Next Payment Date"/> |
4977 | + |
4978 | + <menuitem action="wizard_calculate_next_payment_date" |
4979 | + id="menu_calculate_next_payment_date" |
4980 | + parent="account_payment.menu_main" |
4981 | + type="wizard"/> |
4982 | + </data> |
4983 | +</openerp> |
4984 | |
4985 | === added directory 'account_payment_discount_extension/i18n' |
4986 | === added file 'account_payment_discount_extension/i18n/account_payment_discount_extension.pot' |
4987 | --- account_payment_discount_extension/i18n/account_payment_discount_extension.pot 1970-01-01 00:00:00 +0000 |
4988 | +++ account_payment_discount_extension/i18n/account_payment_discount_extension.pot 2011-07-29 01:35:58 +0000 |
4989 | @@ -0,0 +1,176 @@ |
4990 | +# Translation of OpenERP Server. |
4991 | +# This file contains the translation of the following modules: |
4992 | +# * account_payment_discount_extension |
4993 | +# |
4994 | +msgid "" |
4995 | +msgstr "" |
4996 | +"Project-Id-Version: OpenERP Server 5.0.14\n" |
4997 | +"Report-Msgid-Bugs-To: support@openerp.com\n" |
4998 | +"POT-Creation-Date: 2010-10-08 10:04:15+0000\n" |
4999 | +"PO-Revision-Date: 2010-10-08 10:04:15+0000\n" |
5000 | +"Last-Translator: Thomas Dreiling <thomas.dreiling@global-distribution.de>\n" |
Hello,
I think it's better to keep these modules in a separate branch.