Merge lp:~npg-team/openobject-addons/account_check_printing_npg into lp:openobject-addons
- account_check_printing_npg
- Merge into trunk
Proposed by
Novapoint Group
Status: | Rejected |
---|---|
Rejected by: | Fabien (Open ERP) |
Proposed branch: | lp:~npg-team/openobject-addons/account_check_printing_npg |
Merge into: | lp:openobject-addons |
Diff against target: |
3598 lines (+3473/-0) 23 files modified
account_check_writing/Change Log.txt (+36/-0) account_check_writing/__init__.py (+26/-0) account_check_writing/__openerp__.py (+52/-0) account_check_writing/account.py (+139/-0) account_check_writing/account_check_writing_report.xml (+27/-0) account_check_writing/account_demo.xml (+8/-0) account_check_writing/account_view.xml (+108/-0) account_check_writing/account_voucher.py (+189/-0) account_check_writing/account_voucher_view.xml (+194/-0) account_check_writing/amount_to_words.py (+77/-0) account_check_writing/check_sequence.xml (+9/-0) account_check_writing/report/__init__.py (+25/-0) account_check_writing/report/check_print.py (+160/-0) account_check_writing/report/check_print_bottom.rml (+354/-0) account_check_writing/report/check_print_bottom_old.rml (+311/-0) account_check_writing/report/check_print_middle.rml (+377/-0) account_check_writing/report/check_print_middle_old.rml (+311/-0) account_check_writing/report/check_print_top.rml (+342/-0) account_check_writing/report/check_print_top_old.rml (+322/-0) account_check_writing/wizard/__init__.py (+25/-0) account_check_writing/wizard/check_print.py (+307/-0) account_check_writing/wizard/check_print_view.xml (+57/-0) account_check_writing/wizard_view.xml (+17/-0) |
To merge this branch: | bzr merge lp:~npg-team/openobject-addons/account_check_printing_npg |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
OpenERP Core Team | Pending | ||
Review via email: mp+78429@code.launchpad.net |
Commit message
Description of the change
NovaPoint Group has developed this module to provide support for check writing. It supports top voucher, middle voucher, and bottom voucher. Supports both preprinted checks and blank checks.
To post a comment you must log in.
Revision history for this message
Fabien (Open ERP) (fp-tinyerp) wrote : | # |
Revision history for this message
David Mitchell (www.novapointgroup.com) (david-novapointgroup.com) wrote : | # |
My suggestion Fabien would be to do a code compare against your existing check writing code and look for the differences. Without this you will not be able to support the US market for OpenERP online as check writing is a fundamental requirement. Without it I believe your adoption will suffer.
Unmerged revisions
- 5306. By Novapoint Group
-
[Add]: account_
check_printing to provide support for check writing in OpenERP
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === added directory 'account_check_writing' |
2 | === added file 'account_check_writing/Change Log.txt' |
3 | --- account_check_writing/Change Log.txt 1970-01-01 00:00:00 +0000 |
4 | +++ account_check_writing/Change Log.txt 2011-10-06 15:19:26 +0000 |
5 | @@ -0,0 +1,36 @@ |
6 | +=============================================================================== |
7 | + Version Change Log (account_check_writing) |
8 | +=============================================================================== |
9 | + |
10 | +1.82 (2011-07-22) By Jabir |
11 | + * Created a new field Reference Invoice on Invoice which will update when the "Invoice Number" in Receptions is update. This will work only if stock_assigned_picker module is installed |
12 | + * Took the Reference Invoice field instead of Free Reference in printing check. Free Reference is taken only if "Reference Invoice" is not present. |
13 | + |
14 | +1.8 -> 1.81 (2011-07-22) By Jabir |
15 | + * Updated alignment of Original Amount so that it will not group with purhcase order |
16 | + |
17 | +1.6 -> 1.7 (2011-04-08) By Jabir |
18 | + * Updated discount on check |
19 | + |
20 | +1.6 -> 1.7 (2011-04-04) By Jabir |
21 | + * Fixed the wrong next check number displayed on check printing wizard when open the payment voucher using the Pay Invoice button from supplier invoice. |
22 | + |
23 | +1.5 -> 1.6 (2011-03-22) By Jabir |
24 | + * Fixed unable to print check from Accounting/Bank and Cash/Write Checks |
25 | + |
26 | +1.4 -> 1.5 (2011-03-22) By Jabir |
27 | + * Added npg copyright on all py files |
28 | + * Added npg copyright on all py files |
29 | + * Made status on check printing wizard mandatory so that there will not be two check logs active for single payment |
30 | + * checked the copyright in .py files and deleted the print in wizard/check_print.py and given descriptions for functions in wizard/check_print.py |
31 | + * Fixed the issue with commenting, variable naming and log updating |
32 | + |
33 | +1.3 -> 1.4 (2011-03-22) By Jabir |
34 | + * Changed the checkprinting wizard from old type to new one |
35 | + |
36 | +1.2 -> 1.3 (2011-03-07) By Jabir |
37 | + * Added the code send by OpenERP |
38 | + * Created wizard for check printing |
39 | + |
40 | +1.1 -> 1.2 (2011-02-22) By Jabir |
41 | + * Support us format on check printing |
42 | |
43 | === added file 'account_check_writing/CheckWriting_Documentation_v1.pdf' |
44 | Binary files account_check_writing/CheckWriting_Documentation_v1.pdf 1970-01-01 00:00:00 +0000 and account_check_writing/CheckWriting_Documentation_v1.pdf 2011-10-06 15:19:26 +0000 differ |
45 | === added file 'account_check_writing/Sample_OpenERPPrintedCheck.JPG' |
46 | Binary files account_check_writing/Sample_OpenERPPrintedCheck.JPG 1970-01-01 00:00:00 +0000 and account_check_writing/Sample_OpenERPPrintedCheck.JPG 2011-10-06 15:19:26 +0000 differ |
47 | === added file 'account_check_writing/__init__.py' |
48 | --- account_check_writing/__init__.py 1970-01-01 00:00:00 +0000 |
49 | +++ account_check_writing/__init__.py 2011-10-06 15:19:26 +0000 |
50 | @@ -0,0 +1,26 @@ |
51 | +# -*- coding: utf-8 -*- |
52 | +############################################################################## |
53 | +# |
54 | +# OpenERP, Open Source Management Solution |
55 | +# Copyright (C) 2011 NovaPoint Group LLC (<http://www.novapointgroup.com>) |
56 | +# Copyright (C) 2004-2010 OpenERP SA (<http://www.openerp.com>) |
57 | +# |
58 | +# This program is free software: you can redistribute it and/or modify |
59 | +# it under the terms of the GNU General Public License as published by |
60 | +# the Free Software Foundation, either version 3 of the License, or |
61 | +# (at your option) any later version. |
62 | +# |
63 | +# This program is distributed in the hope that it will be useful, |
64 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
65 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
66 | +# GNU General Public License for more details. |
67 | +# |
68 | +# You should have received a copy of the GNU General Public License |
69 | +# along with this program. If not, see <http://www.gnu.org/licenses/> |
70 | +# |
71 | +############################################################################## |
72 | +import account |
73 | +import account_voucher |
74 | +import wizard |
75 | +import report |
76 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
77 | |
78 | === added file 'account_check_writing/__openerp__.py' |
79 | --- account_check_writing/__openerp__.py 1970-01-01 00:00:00 +0000 |
80 | +++ account_check_writing/__openerp__.py 2011-10-06 15:19:26 +0000 |
81 | @@ -0,0 +1,52 @@ |
82 | +# -*- coding: utf-8 -*- |
83 | +############################################################################## |
84 | +# |
85 | +# OpenERP, Open Source Management Solution |
86 | +# Copyright (C) 2011 NovaPoint Group LLC (<http://www.novapointgroup.com>) |
87 | +# Copyright (C) 2004-2010 OpenERP SA (<http://www.openerp.com>) |
88 | +# |
89 | +# This program is free software: you can redistribute it and/or modify |
90 | +# it under the terms of the GNU General Public License as published by |
91 | +# the Free Software Foundation, either version 3 of the License, or |
92 | +# (at your option) any later version. |
93 | +# |
94 | +# This program is distributed in the hope that it will be useful, |
95 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
96 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
97 | +# GNU General Public License for more details. |
98 | +# |
99 | +# You should have received a copy of the GNU General Public License |
100 | +# along with this program. If not, see <http://www.gnu.org/licenses/> |
101 | +# |
102 | +############################################################################## |
103 | +{ |
104 | + "name" : "Check writing", |
105 | + "version" : "1.82", |
106 | + "author" : "OpenERP SA", |
107 | + "category": "Generic Modules/Accounting", |
108 | + "description": """ |
109 | + Module for the Check writing and check printing |
110 | + """, |
111 | + 'website': 'http://www.openerp.com', |
112 | + 'init_xml': [], |
113 | + "depends" : [ |
114 | + "account_voucher", |
115 | + 'account_voucher_credits_us', #To make working onchange_partner_id function |
116 | + 'purchase' #To find the invoice related to purchase for adding invoice reference in reception in check |
117 | + ], |
118 | + 'update_xml': [ |
119 | + 'wizard/check_print_view.xml', |
120 | + 'check_sequence.xml', |
121 | + 'account_check_writing_report.xml', |
122 | + 'account_view.xml', |
123 | + 'account_voucher_view.xml', |
124 | + ], |
125 | + 'demo_xml': [ |
126 | + 'account_demo.xml', |
127 | + ], |
128 | + 'test': [ |
129 | + ], |
130 | + 'installable': True, |
131 | + 'active': False, |
132 | +} |
133 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
134 | |
135 | === added file 'account_check_writing/account.py' |
136 | --- account_check_writing/account.py 1970-01-01 00:00:00 +0000 |
137 | +++ account_check_writing/account.py 2011-10-06 15:19:26 +0000 |
138 | @@ -0,0 +1,139 @@ |
139 | +# -*- coding: utf-8 -*- |
140 | +############################################################################## |
141 | +# |
142 | +# OpenERP, Open Source Management Solution |
143 | +# Copyright (C) 2011 NovaPoint Group LLC (<http://www.novapointgroup.com>) |
144 | +# Copyright (C) 2004-2010 OpenERP SA (<http://www.openerp.com>) |
145 | +# |
146 | +# This program is free software: you can redistribute it and/or modify |
147 | +# it under the terms of the GNU General Public License as published by |
148 | +# the Free Software Foundation, either version 3 of the License, or |
149 | +# (at your option) any later version. |
150 | +# |
151 | +# This program is distributed in the hope that it will be useful, |
152 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
153 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
154 | +# GNU General Public License for more details. |
155 | +# |
156 | +# You should have received a copy of the GNU General Public License |
157 | +# along with this program. If not, see <http://www.gnu.org/licenses/> |
158 | +# |
159 | +############################################################################## |
160 | + |
161 | +from osv import osv,fields |
162 | +import tools |
163 | + |
164 | +class account_journal(osv.osv): |
165 | + _inherit = "account.journal" |
166 | + ''' |
167 | + Add fields Allow Check writing, Use Preprinted Check and Check Sequence on journal |
168 | + ''' |
169 | + _columns = { |
170 | + 'allow_check_writing': fields.boolean('Allow Check writing', help='Fill this if the journal is to be used for writing checks.'), |
171 | + 'use_preprint_check': fields.boolean('Use Preprinted Check'), |
172 | + 'check_sequence': fields.many2one('ir.sequence', 'Check Sequence', help="This field contains the information related to the numbering of the check number."), |
173 | + } |
174 | + |
175 | +account_journal() |
176 | + |
177 | +class res_company(osv.osv): |
178 | + _inherit = "res.company" |
179 | + |
180 | + ''' |
181 | + Add check printing options check_layout, currency_format and check language on company |
182 | + ''' |
183 | + def _get_language(self, cr, uid, context): |
184 | + lang_obj = self.pool.get('res.lang') |
185 | + lang_ids = lang_obj.search(cr, uid, [('translatable', '=', True)],context=context) |
186 | + langs = lang_obj.browse(cr, uid, lang_ids, context=context) |
187 | + res = [(lang.code, lang.name) for lang in langs] |
188 | + for lang_dict in tools.scan_languages(): |
189 | + if lang_dict not in res: |
190 | + res.append(lang_dict) |
191 | + return res |
192 | + |
193 | + _columns = { |
194 | + 'check_layout': fields.selection([ |
195 | + ('top', 'Check on Top'), |
196 | + ('middle', 'Check in middle'), |
197 | + ('bottom', 'Check on bottom'), |
198 | + ],"Choose Check layout", |
199 | + help="Check on top is compatible with Quicken, QuickBooks and Microsoft Money. Check in middle is compatible with Peachtree, ACCPAC and DacEasy. Check on bottom is compatible with Peachtree, ACCPAC and DacEasy only" ), |
200 | + 'currency_format': fields.selection([('us','US Format'), ('euro','Europian Format')],'Check Printing Format'), |
201 | + 'lang': fields.selection(_get_language, string='Check Print Language', size=16), |
202 | + } |
203 | + _defaults = { |
204 | + 'check_layout' : lambda *a: 'top', |
205 | + 'currency_format':'us', |
206 | + } |
207 | +res_company() |
208 | +class check_log(osv.osv): |
209 | + _name = 'check.log' |
210 | + _description = 'Check Log' |
211 | + ''' |
212 | + Check Log model |
213 | + ''' |
214 | + _columns = { |
215 | + 'name':fields.many2one('account.voucher','Reference payment'), |
216 | + 'status': fields.selection([('active','Active'), |
217 | + ('voided', 'Voided'), |
218 | + ('stop_pay', 'Stop Pay Placed'), |
219 | + ('lost', 'Lost'), |
220 | + ('unk', 'Unknown'), |
221 | + ],"Check Status",), |
222 | + 'check_no':fields.char('Check Number',size=64), |
223 | + } |
224 | + _defaults = { |
225 | + 'status' :'blank', |
226 | + } |
227 | +check_log() |
228 | + |
229 | +class account_invoice(osv.osv): |
230 | + """Update inv_reference field. |
231 | + This field will update only if the stock_assigned_picker module is installed.""" |
232 | + |
233 | + _inherit = "account.invoice" |
234 | + |
235 | + def _calc_inv_ref(self, cr, uid, ids, name, args, context=None): |
236 | + res={} |
237 | + for inv in self.browse(cr, uid, ids): |
238 | + cr.execute("SELECT purchase_id FROM purchase_invoice_rel WHERE invoice_id = %s", (inv.id,)) |
239 | + pur_ids = cr.fetchall() or None |
240 | + if pur_ids and pur_ids[0] and pur_ids[0][0]: |
241 | + pick_ids = self.pool.get('stock.picking').search(cr, uid, [('purchase_id','=',pur_ids[0][0])], context=context) |
242 | + if pick_ids: |
243 | + pici_id = self.pool.get('stock.picking').browse(cr, uid, pick_ids[0], context=context) |
244 | + if 'ref_inv_no' in pici_id._columns.keys(): |
245 | + res[inv.id] = pici_id.ref_inv_no |
246 | + return res |
247 | + def _get_invoice_pur(self, cr, uid, ids, context=None): |
248 | + result = {} |
249 | + for purchase_id in self.pool.get('purchase.order').browse(cr, uid, ids, context=context): |
250 | + for invoice_id in purchase_id.invoice_ids: |
251 | + result[invoice_id.id] = True |
252 | + return result.keys() |
253 | + def _get_invoice_pick(self, cr, uid, ids, context=None): |
254 | + result = {} |
255 | + for pick in self.pool.get('stock.picking').browse(cr, uid, ids, context=context): |
256 | + if pick.purchase_id: |
257 | + for invoice_id in pick.purchase_id.invoice_ids: |
258 | + result[invoice_id.id] = True |
259 | + return result.keys() |
260 | + |
261 | + _columns = { |
262 | + |
263 | + 'inv_ref': fields.function(_calc_inv_ref, method=True, string='Reference Invoice',type='char', size=32, |
264 | + store={ |
265 | + 'account.invoice': (lambda self, cr, uid, ids, c={}: ids, ['state'], 10), |
266 | + 'purchase.order': (_get_invoice_pur, ['order_line'], 10), |
267 | + 'stock.picking': (_get_invoice_pick, ['ref_inv_no','purchase_id'], 10), |
268 | + }, multi=False), |
269 | + |
270 | + |
271 | + } |
272 | +account_invoice() |
273 | + |
274 | + |
275 | + |
276 | + |
277 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
278 | |
279 | === added file 'account_check_writing/account_check_writing_report.xml' |
280 | --- account_check_writing/account_check_writing_report.xml 1970-01-01 00:00:00 +0000 |
281 | +++ account_check_writing/account_check_writing_report.xml 2011-10-06 15:19:26 +0000 |
282 | @@ -0,0 +1,27 @@ |
283 | +<?xml version="1.0"?> |
284 | +<openerp> |
285 | + <data> |
286 | + <report id="account_print_check_top" |
287 | + string="Print Check" |
288 | + model="account.voucher" |
289 | + name="account.print.check.top" |
290 | + rml="addons/account_check_writing/report/check_print_top.rml" |
291 | + menu="False" |
292 | + auto="False"/> |
293 | + <report id="account_print_check_middle" |
294 | + string="Print Check" |
295 | + model="account.voucher" |
296 | + name="account.print.check.middle" |
297 | + rml="addons/account_check_writing/report/check_print_middle.rml" |
298 | + menu="False" |
299 | + auto="False"/> |
300 | + <report id="account_print_check_bottom" |
301 | + string="Print Check" |
302 | + model="account.voucher" |
303 | + name="account.print.check.bottom" |
304 | + rml="addons/account_check_writing/report/check_print_bottom.rml" |
305 | + menu="False" |
306 | + auto="False"/> |
307 | + |
308 | + </data> |
309 | +</openerp> |
310 | |
311 | === added file 'account_check_writing/account_demo.xml' |
312 | --- account_check_writing/account_demo.xml 1970-01-01 00:00:00 +0000 |
313 | +++ account_check_writing/account_demo.xml 2011-10-06 15:19:26 +0000 |
314 | @@ -0,0 +1,8 @@ |
315 | +<?xml version="1.0" encoding="utf-8"?> |
316 | +<openerp> |
317 | + <data> |
318 | + <record id="account.check_journal" model="account.journal"> |
319 | + <field name="allow_check_writing">1</field> |
320 | + </record> |
321 | + </data> |
322 | +</openerp> |
323 | |
324 | === added file 'account_check_writing/account_view.xml' |
325 | --- account_check_writing/account_view.xml 1970-01-01 00:00:00 +0000 |
326 | +++ account_check_writing/account_view.xml 2011-10-06 15:19:26 +0000 |
327 | @@ -0,0 +1,108 @@ |
328 | +<?xml version="1.0" encoding="utf-8"?> |
329 | +<openerp> |
330 | + <data> |
331 | + |
332 | + <!-- Check Log --> |
333 | + |
334 | + <record id="check_log_filter" model="ir.ui.view"> |
335 | + <field name="name">check.log.select</field> |
336 | + <field name="model">check.log</field> |
337 | + <field name="type">search</field> |
338 | + <field name="arch" type="xml"> |
339 | + <search string="Search Log"> |
340 | + |
341 | + <group col='15' colspan='4'> |
342 | + <field name="name"/> |
343 | + <field name="status"/> |
344 | + <field name="check_no" /> |
345 | + </group><newline/> |
346 | + <group expand="0" string="Group By..."> |
347 | + <filter string="Supplier Payment" domain="[]" context="{'group_by':'name'}"/> |
348 | + <filter string="Status" icon="terp-partner" domain="[]" context="{'group_by':'status'}"/> |
349 | + </group> |
350 | + </search> |
351 | + </field> |
352 | + </record> |
353 | + |
354 | + |
355 | + <record model="ir.ui.view" id="check_log_form"> |
356 | + <field name="name">check.log.form</field> |
357 | + <field name="model">check.log</field> |
358 | + <field name="type">form</field> |
359 | + <field name="arch" type="xml"> |
360 | + <form string="Check Log"> |
361 | + <field name="name" select="1" readonly="1"></field> |
362 | + <field name="status" select="1" readonly="1"></field> |
363 | + <field name="check_no" select="1" readonly="1"></field> |
364 | + </form> |
365 | + </field> |
366 | + </record> |
367 | + <record model="ir.ui.view" id="check_log_tree"> |
368 | + <field name="name">check.log.tree</field> |
369 | + <field name="model">check.log</field> |
370 | + <field name="type">tree</field> |
371 | + <field name="arch" type="xml"> |
372 | + <tree string='Check Log'> |
373 | + <field name="check_no" readonly="1"></field> |
374 | + <field name="name" readonly="1"></field> |
375 | + <field name="status" readonly="1"></field> |
376 | + </tree> |
377 | + </field> |
378 | + </record> |
379 | + <record id="action_check_log" model="ir.actions.act_window"> |
380 | + <field name="name">Check Log</field> |
381 | + <field name="type">ir.actions.act_window</field> |
382 | + <field name="res_model">check.log</field> |
383 | + <field name="view_type">form</field> |
384 | + <field name="view_mode">tree,form</field> |
385 | + <field name="search_view_id" ref="check_log_filter"/> |
386 | + <field name="view_id" ref="check_log_tree"/> |
387 | + </record> |
388 | + |
389 | + <menuitem name="Check Log" id="menu_check_log" action="action_check_log" parent="account.menu_finance_reporting" sequence="360"/> |
390 | + |
391 | + <!-- |
392 | + check option in journal |
393 | + --> |
394 | + |
395 | + <record id="view_account_journal_form" model="ir.ui.view"> |
396 | + <field name="name">account.journal.form</field> |
397 | + <field name="model">account.journal</field> |
398 | + <field name="type">form</field> |
399 | + <field name="inherit_id" ref="account.view_account_journal_form" /> |
400 | + <field name="arch" type="xml"> |
401 | + <field name="type" on_change="onchange_type(type, currency)" /> |
402 | + <field name="entry_posted" position="after"> |
403 | + <field name="allow_check_writing" attrs="{'readonly':[('type','!=','bank')]}" /> |
404 | + <field name="use_preprint_check" attrs="{'readonly':[('type','!=','bank')]}" /> |
405 | + </field> |
406 | + <field name="sequence_id" required="0" position="after"> |
407 | + <field name="check_sequence" |
408 | + attrs="{'invisible':[('allow_check_writing','=',False)]}" /> |
409 | + </field> |
410 | + </field> |
411 | + </record> |
412 | + |
413 | + <!-- |
414 | + check format option in company |
415 | + --> |
416 | + |
417 | + <record id="check_format_company" model="ir.ui.view"> |
418 | + <field name="name">res.company.check.format |
419 | + </field> |
420 | + <field name="model">res.company</field> |
421 | + <field name="type">form</field> |
422 | + <field name="priority">17</field> |
423 | + <field name="inherit_id" ref="base.view_company_form" /> |
424 | + <field name="arch" type="xml"> |
425 | + <page string="Configuration" position="inside"> |
426 | + <separator string="Default Check layout" colspan="4" /> |
427 | + <field name="check_layout" /> |
428 | + <field name="currency_format" /> |
429 | + <field name="lang" /> |
430 | + <newline /> |
431 | + </page> |
432 | + </field> |
433 | + </record> |
434 | + </data> |
435 | +</openerp> |
436 | |
437 | === added file 'account_check_writing/account_voucher.py' |
438 | --- account_check_writing/account_voucher.py 1970-01-01 00:00:00 +0000 |
439 | +++ account_check_writing/account_voucher.py 2011-10-06 15:19:26 +0000 |
440 | @@ -0,0 +1,189 @@ |
441 | +# -*- coding: utf-8 -*- |
442 | +############################################################################## |
443 | +# |
444 | +# OpenERP, Open Source Management Solution |
445 | +# Copyright (C) 2011 NovaPoint Group LLC (<http://www.novapointgroup.com>) |
446 | +# Copyright (C) 2004-2010 OpenERP SA (<http://www.openerp.com>) |
447 | +# |
448 | +# This program is free software: you can redistribute it and/or modify |
449 | +# it under the terms of the GNU General Public License as published by |
450 | +# the Free Software Foundation, either version 3 of the License, or |
451 | +# (at your option) any later version. |
452 | +# |
453 | +# This program is distributed in the hope that it will be useful, |
454 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
455 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
456 | +# GNU General Public License for more details. |
457 | +# |
458 | +# You should have received a copy of the GNU General Public License |
459 | +# along with this program. If not, see <http://www.gnu.org/licenses/> |
460 | +# |
461 | +############################################################################## |
462 | + |
463 | +from osv import osv,fields |
464 | +from tools.translate import _ |
465 | +from tools.amount_to_text_en import amount_to_text |
466 | +from lxml import etree |
467 | +from amount_to_words import amount_to_words |
468 | + |
469 | +check_layout_report = { |
470 | + 'top' : 'account.print.check.top', |
471 | + 'middle' : 'account.print.check.middle', |
472 | + 'bottom' : 'account.print.check.bottom', |
473 | +} |
474 | + |
475 | +# Check Number : Journal sequence number is generated when we confirm voucher/check.This number is assumed as check number in check writing : Need to keep track right number while printing manually. |
476 | + |
477 | +class account_voucher(osv.osv): |
478 | + _inherit = 'account.voucher' |
479 | + |
480 | + _columns = { |
481 | + 'amount_in_word' : fields.char("Amount in word" , size=128, readonly=True, states={'draft':[('readonly',False)]}), |
482 | + 'allow_check' : fields.boolean('Allow Check Writing'), # attrs does not support '.' format and fields.relates get the value when v save the record |
483 | + 'chk_seq' : fields.char("Check Number" , size=64, readonly=True), |
484 | + 'chk_status' : fields.boolean("Check Status" ), |
485 | + } |
486 | + |
487 | + |
488 | + def _get_journal(self, cr, uid, context=None): |
489 | + ''' |
490 | + Function to initialise the variable journal_id |
491 | + ''' |
492 | + if context is None: context = {} |
493 | + journal_pool = self.pool.get('account.journal') |
494 | + invoice_pool = self.pool.get('account.invoice') |
495 | + if context.get('invoice_id', False): |
496 | + currency_id = invoice_pool.browse(cr, uid, context['invoice_id'], context=context).currency_id.id |
497 | + journal_id = journal_pool.search(cr, uid, [('currency', '=', currency_id)], limit=1) |
498 | + return journal_id and journal_id[0] or False |
499 | + |
500 | + if context.get('journal_id', False): |
501 | + return context.get('journal_id') |
502 | + if not context.get('journal_id', False) and context.get('search_default_journal_id', False): |
503 | + return context.get('search_default_journal_id') |
504 | + |
505 | + ttype = context.get('type', 'bank') |
506 | + |
507 | + if ttype in ('payment', 'receipt'): |
508 | + ttype = 'bank' |
509 | + if context.get('write_check',False) : |
510 | + res = journal_pool.search(cr, uid, [('allow_check_writing', '=', True)], limit=1) |
511 | + else : |
512 | + res = journal_pool.search(cr, uid, [('type', '=', ttype)], limit=1) |
513 | + return res and res[0] or False |
514 | + |
515 | + def onchange_partner_id(self, cr, uid, ids, partner_id, journal_id, price, currency_id, ttype, date, context=None): |
516 | + """ Inherited - add amount_in_word in return value dictionary |
517 | + cr: cursor |
518 | + uid: user id |
519 | + ids: ids of account voucher |
520 | + partner_id: partner's id |
521 | + journal_id: journal's id |
522 | + price: price |
523 | + currency_id: id of currency using |
524 | + date: date |
525 | + context: context |
526 | + """ |
527 | + if not context: |
528 | + context = {} |
529 | + default = super(account_voucher, self).onchange_partner_id(cr, uid, ids, partner_id, journal_id, price, currency_id, ttype, date, context=context) |
530 | + if 'value' in default: |
531 | + amount = 'amount' in default['value'] and default['value']['amount'] or price |
532 | + |
533 | + #TODO : generic amount_to_text is not ready yet, otherwise language and currency can be passed accordingly |
534 | + currency_format = self.pool.get('res.users').browse(cr, uid, uid).company_id.currency_format |
535 | + if currency_format=='us': |
536 | + amount_in_word = amount_to_words(amount) |
537 | + else: |
538 | + amount_in_word = amount_to_text(amount) |
539 | + |
540 | + default['value'].update({'amount_in_word':amount_in_word}) |
541 | + |
542 | + if journal_id: |
543 | + allow_check_writing = self.pool.get('account.journal').browse(cr, uid, journal_id).allow_check_writing |
544 | + default['value'].update({'allow_check':allow_check_writing}) |
545 | + return default |
546 | + |
547 | + def print_check(self, cr, uid, ids, context=None): |
548 | + ''' |
549 | + Function to print check |
550 | + ''' |
551 | + if not ids: return [] |
552 | + |
553 | + check_layout = self.browse(cr, uid, ids[0], context=context).company_id.check_layout |
554 | + |
555 | + return { |
556 | + 'type': 'ir.actions.report.xml', |
557 | + 'report_name':check_layout_report[check_layout], |
558 | + 'datas': { |
559 | + 'model':'account.voucher', |
560 | + 'id': ids and ids[0] or False, |
561 | + 'ids': ids and ids or [], |
562 | + 'report_type': 'pdf' |
563 | + }, |
564 | + 'nodestroy': True |
565 | + } |
566 | + |
567 | + |
568 | + _defaults = { |
569 | + 'journal_id':_get_journal, |
570 | + 'chk_status':False |
571 | + } |
572 | + |
573 | +account_voucher() |
574 | + |
575 | + |
576 | +''' |
577 | +Code provided by openerp |
578 | +''' |
579 | +class account_voucher_line(osv.osv): |
580 | + _inherit = 'account.voucher.line' |
581 | + |
582 | + def write(self, cr, user, ids, vals, context=None): |
583 | + ''' |
584 | + Add invoice and description in payment modification line |
585 | + ''' |
586 | + if type(ids) == type([]): |
587 | + move = self.browse(cr, user,ids[0]).move_line_id |
588 | + else: |
589 | + move = self.browse(cr, user,ids).move_line_id |
590 | + if move: |
591 | + invoice_ids = self.pool.get('account.invoice').search(cr,user,[('move_id','=',move.move_id.id)]) |
592 | + if invoice_ids: |
593 | + invoice = self.pool.get('account.invoice').browse(cr, user,invoice_ids[0]) |
594 | + vals['invoice_id'] = invoice.id |
595 | + vals['name'] = invoice.number |
596 | + return super(account_voucher_line, self).write(cr, user, ids, vals, context) |
597 | + |
598 | + def create(self, cr, user, vals, context=None): |
599 | + ''' |
600 | + Add invoice and description in payment modification line |
601 | + ''' |
602 | + if vals.has_key('move_line_id') and vals['move_line_id']: |
603 | + move = self.pool.get('account.move.line').browse(cr, user,vals['move_line_id']) |
604 | + if move and move.move_id: |
605 | + invoice_ids = self.pool.get('account.invoice').search(cr,user,[('move_id','=',move.move_id.id)]) |
606 | + if invoice_ids: |
607 | + invoice = self.pool.get('account.invoice').browse(cr, user,invoice_ids[0]) |
608 | + vals['invoice_id'] = invoice.id |
609 | + vals['name'] = invoice.number |
610 | + return super(account_voucher_line, self).create(cr, user, vals, context) |
611 | + def _get_due_date(self, cr, uid, ids, context=None): |
612 | + ''' |
613 | + Store function to identify the voucher lines that need recalculation of date_due in the case of any change on account move line |
614 | + Fixme: make sure that it return a list of voucher line id only |
615 | + ''' |
616 | + result = {} |
617 | + for line in self.pool.get('account.move.line').browse(cr, uid, ids, context=context): |
618 | +# result[line.invoice_id.id] = True ##Changed by Jabir to fix error when clicking Post button from Customer Payment form. 2010/11/24 |
619 | + result[line.invoice.id] = True |
620 | + return result.keys() |
621 | + |
622 | + _columns = { |
623 | + 'invoice_id': fields.many2one('account.invoice', 'Invoice'), |
624 | + 'date_due': fields.related('move_line_id','date_maturity', type='date', relation='account.move.line', string='Due Date', readonly=True , store={ |
625 | + 'account.voucher.line': (lambda self, cr, uid, ids, c={}: ids, ['move_line_id'], 20), |
626 | + 'account.move.line': (_get_due_date, ['date_maturity'], 20), |
627 | + }), |
628 | + } |
629 | +account_voucher_line() |
630 | \ No newline at end of file |
631 | |
632 | === added file 'account_check_writing/account_voucher_view.xml' |
633 | --- account_check_writing/account_voucher_view.xml 1970-01-01 00:00:00 +0000 |
634 | +++ account_check_writing/account_voucher_view.xml 2011-10-06 15:19:26 +0000 |
635 | @@ -0,0 +1,194 @@ |
636 | +<?xml version="1.0" encoding="UTF-8"?> |
637 | +<openerp> |
638 | + <data> |
639 | + |
640 | + |
641 | + <record id="view_voucher_filter_vendor_pay_inherit" model="ir.ui.view"> |
642 | + <field name="name">account.voucher.purchase.pay.select.inherit</field> |
643 | + <field name="model">account.voucher</field> |
644 | + <field name="type">search</field> |
645 | + <field name="inherit_id" ref="account_voucher.view_voucher_filter_vendor_pay" /> |
646 | + <field name="arch" type="xml"> |
647 | + <filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}" position="after"> |
648 | + <filter string="Check Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'chk_status'}"/> |
649 | + </filter> |
650 | + |
651 | + </field> |
652 | + </record> |
653 | + |
654 | + |
655 | + |
656 | + |
657 | + |
658 | + <record model="ir.ui.view" id="view_voucher_tree_inherit"> |
659 | + <field name="name">account.voucher.tree.inherit</field> |
660 | + <field name="model">account.voucher</field> |
661 | + <field name="type">tree</field> |
662 | + <field name="inherit_id" ref="account_voucher.view_voucher_tree" /> |
663 | + <field name="arch" type="xml"> |
664 | + <field name="journal_id" position="after"> |
665 | + <field name="chk_seq" /> |
666 | + <field name="chk_status" invisible="1" /> |
667 | + </field> |
668 | + </field> |
669 | + </record> |
670 | + |
671 | + <record model="ir.ui.view" id="view_vendor_payment_check_form"> |
672 | + <field name="name">account.voucher.payment.check.form</field> |
673 | + <field name="model">account.voucher</field> |
674 | + <field name="type">form</field> |
675 | + <field name="inherit_id" ref="account_voucher.view_vendor_payment_form" /> |
676 | + <field name="arch" type="xml"> |
677 | + <field name="partner_id" domain="[('supplier','=',True)]" required="1" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date)" context="{'invoice_currency':currency_id}" string="Supplier"/> |
678 | + <field name="amount" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date)"/> |
679 | + <field name="amount" position="after"> |
680 | + <field name="allow_check" invisible="1"/> |
681 | + <field name="amount_in_word" attrs="{'invisible':[('allow_check','!=',1)]}" nolabel="1" colspan="2"/> |
682 | + <field name="chk_seq" attrs="{'invisible':[('allow_check','!=',1)]}" colspan="1"/> |
683 | + <field name="chk_status" invisible="1" /> |
684 | + </field> |
685 | + <field name="journal_id" |
686 | + domain="[('type','in',['bank', 'cash'])]" |
687 | + widget="selection" select="1" |
688 | + on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date)" |
689 | + string="Payment Method"/> |
690 | + <field name="date" select="1" on_change="onchange_date(partner_id, journal_id, amount, currency_id, type, date)"/> |
691 | + <field name="name" colspan="4"/> |
692 | + <field name="type" invisible="True"/> |
693 | + <field name="currency_id" invisible="True"/> |
694 | + <field name="state"/> |
695 | + <button name="proforma_voucher" position="after"> |
696 | + <button name="%(print_check_act_window)d" string="Print Check" type="action" attrs="{'invisible':['|',('allow_check','!=',1),('state','in',['draft','proforma','cancel'])]}"/> |
697 | + </button> |
698 | + <separator string="Other Information" colspan="2" position="replace"/> |
699 | + <field name="number" position="replace"/> |
700 | + </field> |
701 | + </record> |
702 | + <record model="ir.ui.view" id="view_payment_write_check_form"> |
703 | + <field name="name">account.voucher.payment.write.check.form</field> |
704 | + <field name="model">account.voucher</field> |
705 | + <field name="type">form</field> |
706 | + <field name="arch" type="xml"> |
707 | + <form string="Customer Payment"> |
708 | + <group col="6" colspan="4"> |
709 | + <field name="partner_id" domain="[('supplier','=',True)]" required="1" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date)" string="Pay to the order of"/> |
710 | + <field name="date" select="1" on_change="onchange_date(partner_id, journal_id, amount, currency_id, type, date)"/> |
711 | + <field name="chk_seq" /> |
712 | + <field name="journal_id" |
713 | + domain="[('type','=','bank' ),('allow_check_writing','=',True)]" |
714 | + widget="selection" select="1" |
715 | + on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date)" |
716 | + string="Payment Method"/> |
717 | + <field name="amount" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date)" string="Amount"/> |
718 | + <field name="allow_check" invisible="1"/> |
719 | + <field name="amount_in_word" attrs="{'invisible':[('allow_check','!=',1)]}" nolabel="1" colspan="2"/> |
720 | + <field name="reference" select="1" string="Payment Ref"/> |
721 | + <field name="name" colspan="4"/> |
722 | + <field name="account_id" |
723 | + widget="selection" |
724 | + invisible="True"/> |
725 | + <field name="type" invisible="True"/> |
726 | + <field name="currency_id" invisible="True"/> |
727 | + </group> |
728 | + <notebook colspan="4"> |
729 | + <page string="Payment Information"> |
730 | + |
731 | + <field name="line_dr_ids" on_change="onchange_price(line_dr_ids, tax_id, partner_id)" |
732 | + default_get="{'journal_id':journal_id,'partner_id':partner_id,'type':type}" |
733 | + colspan="4" nolabel="1" height="180"> |
734 | + <tree string="Payment Lines" editable="bottom"> |
735 | + <field name="move_line_id" context="{'journal_id':parent.journal_id, 'partner_id':parent.partner_id}" |
736 | + on_change="onchange_move_line_id(move_line_id)" |
737 | + domain="[('account_id.type','=','payable'), ('reconcile_id','=', False), ('partner_id','=',parent.partner_id)]" |
738 | + /> |
739 | + <!-- check can be used for any payment - should account type be expense ? -/ --> |
740 | + <field name="account_id" widget="selection" domain="[('type','=','payable')]"/> |
741 | + <field name="name"/> |
742 | + <field name="date_original" readonly="1"/> |
743 | + <field name="date_due" readonly="1"/> |
744 | + <field name="amount_original" readonly="1"/> |
745 | + <field name="amount_unreconciled" sum="Open Balance" readonly="1"/> |
746 | + <field name="amount" sum="Payment"/> |
747 | + </tree> |
748 | + </field> |
749 | + <group col="2" colspan="3"> |
750 | + <separator string="Internal Notes" colspan="2"/> |
751 | + <field name="narration" colspan="2" nolabel="1"/> |
752 | + </group> |
753 | + <group col="2" colspan="1"> |
754 | + <group col="2" colspan="1"> |
755 | + <separator string="Payment Terms" colspan="2"/> |
756 | + <field name="date_due"/> |
757 | + </group> |
758 | + <group col="4" colspan="1" name="total"> |
759 | + <separator string="Total" colspan="4"/> |
760 | + <field name="tax_id" on_change="onchange_price(line_dr_ids, tax_id, partner_id)" widget="selection" domain="[('type_tax_use','in',('purchase','all')), ('parent_id', '=', False)]"/><field name="tax_amount" nolabel="1"/><button type="object" icon="terp-stock_format-scientific" name="compute_tax" string="Compute Tax" groups="base.group_extended" attrs="{'invisible': [('state','!=','draft')]}"/> |
761 | + </group> |
762 | + </group> |
763 | + </page> |
764 | + <page string="Journal Items" groups="base.group_extended" attrs="{'invisible': [('state','!=','posted')]}"> |
765 | + <group col="6" colspan="4"> |
766 | + <field name="company_id" select="1" widget="selection" groups="base.group_multi_company"/> |
767 | + <field name="period_id"/> |
768 | + <field name="audit"/> |
769 | + </group> |
770 | + <field name="move_ids" colspan="4" nolabel="1" readonly="1"> |
771 | + <tree string="Journal Items"> |
772 | + <field name="move_id"/> |
773 | + <field name="ref"/> |
774 | + <field name="date"/> |
775 | + <field name="statement_id"/> |
776 | + <field name="partner_id"/> |
777 | + <field name="account_id"/> |
778 | + <field name="name"/> |
779 | + <field name="debit"/> |
780 | + <field name="credit"/> |
781 | + <field name="state"/> |
782 | + <field name="reconcile_id"/> |
783 | + </tree> |
784 | + </field> |
785 | + </page> |
786 | + </notebook> |
787 | + <group col="10" colspan="4"> |
788 | + <field name="state"/> |
789 | + <button name="cancel_voucher" string="Cancel" states="draft,proforma" icon="gtk-cancel"/> |
790 | + <button name="cancel_voucher" string="Cancel" type="object" states="posted" icon="terp-stock_effects-object-colorize" confirm="Are you sure to confirm this record ?"/> |
791 | + <group attrs="{'invisible':[('state','!=','posted')]}"> |
792 | + <button icon="terp-dolar_ok!" name="%(account_voucher.act_pay_bills)d" context="{'narration':narration, 'title':'Bill Payment', 'type':'payment', 'partner_id': partner_id, 'reference':reference}" type="action" string="Pay Bill" attrs="{'invisible':[('pay_now','=','pay_now')]}"/> |
793 | + </group> |
794 | + <button name="action_cancel_draft" type="object" states="cancel" string="Set to Draft" icon="terp-stock_effects-object-colorize"/> |
795 | + <button name="proforma_voucher" string="Validate" states="draft" icon="gtk-go-forward"/> |
796 | + <button name="%(print_check_act_window)d" states='draft' string="Print Check" type="action" attrs="{'invisible':[('allow_check','!=',1)]}"/> |
797 | + </group> |
798 | + </form> |
799 | + </field> |
800 | + </record> |
801 | + <record id="action_write_check" model="ir.actions.act_window"> |
802 | + <field name="name">Write Checks</field> |
803 | + <field name="res_model">account.voucher</field> |
804 | + <field name="view_type">form</field> |
805 | + <field name="view_mode">form,tree</field> |
806 | + <field name="domain">[('journal_id.type', '=', 'bank'), ('type','=','payment'), ('journal_id.allow_check_writing','=',True)]</field> |
807 | + <field name="context">{'type':'payment','write_check':True}</field> |
808 | + <field name="search_view_id" ref="account_voucher.view_voucher_filter"/> |
809 | + <field name="target">current</field> |
810 | + <field name="help">The check payment form allows you to track the payment you do to your suppliers specially by check. When you select a supplier, the payment method and an amount for the payment, OpenERP will propose to reconcile your payment with the open supplier invoices or bills.You can print the check</field> |
811 | + </record> |
812 | + |
813 | + <record id="action_write_check_form" model="ir.actions.act_window.view"> |
814 | + <field eval="2" name="sequence"/> |
815 | + <field name="view_mode">form</field> |
816 | + <field name="view_id" ref="view_payment_write_check_form"/> |
817 | + <field name="act_window_id" ref="action_write_check"/> |
818 | + </record> |
819 | + |
820 | + <record id="action_write_check_tree" model="ir.actions.act_window.view"> |
821 | + <field eval="1" name="sequence"/> |
822 | + <field name="view_mode">tree</field> |
823 | + <field name="act_window_id" ref="action_write_check"/> |
824 | + </record> |
825 | + |
826 | + <menuitem action="action_write_check" icon="STOCK_JUSTIFY_FILL" sequence="12" |
827 | + id="menu_action_write_check" parent="account.menu_finance_bank_and_cash"/> |
828 | + </data> |
829 | +</openerp> |
830 | |
831 | === added file 'account_check_writing/amount_to_words.py' |
832 | --- account_check_writing/amount_to_words.py 1970-01-01 00:00:00 +0000 |
833 | +++ account_check_writing/amount_to_words.py 2011-10-06 15:19:26 +0000 |
834 | @@ -0,0 +1,77 @@ |
835 | + |
836 | +# can be used for numbers as large as 999 vigintillion |
837 | +# (vigintillion --> 10 to the power 60) |
838 | +# tested with Python24 vegaseat 07dec2006 |
839 | + |
840 | +def int2word(n): |
841 | + """ |
842 | + convert an integer number n into a string of English words |
843 | + """ |
844 | + # break the number into groups of 3 digits using slicing |
845 | + # each group representing hundred, thousand, million, billion, ... |
846 | + if not n: |
847 | + return 'Zero ' |
848 | + n3 = [] |
849 | + r1 = "" |
850 | + # create numeric string |
851 | + ns = str(n) |
852 | + for k in range(3, 33, 3): |
853 | + r = ns[-k:] |
854 | + q = len(ns) - k |
855 | + # break if end of ns has been reached |
856 | + if q < -2: |
857 | + break |
858 | + else: |
859 | + if q >= 0: |
860 | + n3.append(int(r[:3])) |
861 | + elif q >= -1: |
862 | + n3.append(int(r[:2])) |
863 | + elif q >= -2: |
864 | + n3.append(int(r[:1])) |
865 | + r1 = r |
866 | + nw = "" |
867 | + for i, x in enumerate(n3): |
868 | + b1 = x % 10 |
869 | + b2 = (x % 100)//10 |
870 | + b3 = (x % 1000)//100 |
871 | + if x == 0: |
872 | + continue # skip |
873 | + else: |
874 | + t = thousands[i] |
875 | + if b2 == 0: |
876 | + nw = ones[b1] + t + nw |
877 | + elif b2 == 1: |
878 | + nw = tens[b1] + t + nw |
879 | + elif b2 > 1: |
880 | + nw = twenties[b2] + ones[b1] + t + nw |
881 | + if b3 > 0: |
882 | + nw = ones[b3] + "hundred " + nw |
883 | + return nw |
884 | + |
885 | +############# globals ################ |
886 | + |
887 | +ones = ["", "One ","Two ","Three ","Four ", "Five ", |
888 | + "Six ","Seven ","Eight ","Nine "] |
889 | + |
890 | +tens = ["Ten ","Eleven ","Twelve ","Thirteen ", "Fourteen ", |
891 | + "Fifteen ","Sixteen ","Seventeen ","Eighteen ","Nineteen "] |
892 | + |
893 | +twenties = ["","","Twenty ","Thirty ","Forty ", |
894 | + "Fifty ","Sixty ","Seventy ","Eighty ","Ninety "] |
895 | + |
896 | +thousands = ["","Thousand ","Million ", "Billion ", "Trillion ", |
897 | + "Quadrillion ", "Quintillion ", "Sextillion ", "Septillion ","Octillion ", |
898 | + "Nonillion ", "Decillion ", "Undecillion ", "Duodecillion ", "Tredecillion ", |
899 | + "Quattuordecillion ", "Sexdecillion ", "Septendecillion ", "Octodecillion ", |
900 | + "Novemdecillion ", "Vigintillion "] |
901 | + |
902 | +def amount_to_words(num): |
903 | + # select an integer number n for testing or get it from user input |
904 | + res="" |
905 | + if num < 0: |
906 | + res="Negative " |
907 | + num=float(str(num)[1:]) |
908 | + if num==0: return 'Zero' |
909 | + else: |
910 | + n=str(num).split('.') |
911 | + return res+int2word(int(n[0]))+'and '+(len(n)>1 and int(n[1]) and str((num - int(num))*100).split('.')[0] or 'no')+'/100s' |
912 | |
913 | === added file 'account_check_writing/check_sequence.xml' |
914 | --- account_check_writing/check_sequence.xml 1970-01-01 00:00:00 +0000 |
915 | +++ account_check_writing/check_sequence.xml 2011-10-06 15:19:26 +0000 |
916 | @@ -0,0 +1,9 @@ |
917 | +<?xml version="1.0" encoding="utf-8"?> |
918 | +<openerp> |
919 | + <data noupdate="0"> |
920 | + <record forcecreate="1" id="seq_type_payment_order" model="ir.sequence.type"> |
921 | + <field name="name">Check Number</field> |
922 | + <field name="code">account.voucher.check</field> |
923 | + </record> |
924 | + </data> |
925 | +</openerp> |
926 | |
927 | === added directory 'account_check_writing/report' |
928 | === added file 'account_check_writing/report/__init__.py' |
929 | --- account_check_writing/report/__init__.py 1970-01-01 00:00:00 +0000 |
930 | +++ account_check_writing/report/__init__.py 2011-10-06 15:19:26 +0000 |
931 | @@ -0,0 +1,25 @@ |
932 | +# -*- coding: utf-8 -*- |
933 | +############################################################################## |
934 | +# |
935 | +# OpenERP, Open Source Management Solution |
936 | +# Copyright (C) 2011 NovaPoint Group LLC (<http://www.novapointgroup.com>) |
937 | +# Copyright (C) 2004-2010 OpenERP SA (<http://www.openerp.com>) |
938 | +# |
939 | +# This program is free software: you can redistribute it and/or modify |
940 | +# it under the terms of the GNU General Public License as published by |
941 | +# the Free Software Foundation, either version 3 of the License, or |
942 | +# (at your option) any later version. |
943 | +# |
944 | +# This program is distributed in the hope that it will be useful, |
945 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
946 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
947 | +# GNU General Public License for more details. |
948 | +# |
949 | +# You should have received a copy of the GNU General Public License |
950 | +# along with this program. If not, see <http://www.gnu.org/licenses/> |
951 | +# |
952 | +############################################################################## |
953 | +import check_print |
954 | + |
955 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
956 | + |
957 | |
958 | === added file 'account_check_writing/report/check_print.py' |
959 | --- account_check_writing/report/check_print.py 1970-01-01 00:00:00 +0000 |
960 | +++ account_check_writing/report/check_print.py 2011-10-06 15:19:26 +0000 |
961 | @@ -0,0 +1,160 @@ |
962 | +# -*- coding: utf-8 -*- |
963 | +############################################################################## |
964 | +# |
965 | +# OpenERP, Open Source Management Solution |
966 | +# Copyright (C) 2011 NovaPoint Group LLC (<http://www.novapointgroup.com>) |
967 | +# Copyright (C) 2004-2010 OpenERP SA (<http://www.openerp.com>) |
968 | +# |
969 | +# This program is free software: you can redistribute it and/or modify |
970 | +# it under the terms of the GNU General Public License as published by |
971 | +# the Free Software Foundation, either version 3 of the License, or |
972 | +# (at your option) any later version. |
973 | +# |
974 | +# This program is distributed in the hope that it will be useful, |
975 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
976 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
977 | +# GNU General Public License for more details. |
978 | +# |
979 | +# You should have received a copy of the GNU General Public License |
980 | +# along with this program. If not, see <http://www.gnu.org/licenses/> |
981 | +# |
982 | +############################################################################## |
983 | +import time |
984 | +from report import report_sxw |
985 | +from tools import amount_to_text_en |
986 | + |
987 | + |
988 | +class report_print_check(report_sxw.rml_parse): |
989 | + ''' |
990 | + Class to parse check report |
991 | + ''' |
992 | + def __init__(self, cr, uid, name, context): |
993 | + super(report_print_check, self).__init__(cr, uid, name, context) |
994 | + self.number_lines = 0 |
995 | + self.number_add = 0 |
996 | + self.localcontext.update({ |
997 | + 'time': time, |
998 | + 'get_lines': self.get_lines, |
999 | + 'fill_stars' : self.fill_stars, |
1000 | + 'find_lang':self.find_lang, |
1001 | + 'get_zip_line':self.get_zip_line, |
1002 | + 'chk_no':self.get_chk_no, |
1003 | + }) |
1004 | + def get_chk_no(self, voucher): |
1005 | + ''' |
1006 | + return the check number |
1007 | + ''' |
1008 | + if voucher.journal_id.use_preprint_check: |
1009 | + ret = ' ' |
1010 | + else: |
1011 | + ret = voucher.chk_seq or ' ' |
1012 | + return ret |
1013 | + def get_zip_line(self, address): |
1014 | + ''' |
1015 | + Get the address line |
1016 | + ''' |
1017 | + ret = '' |
1018 | + if address: |
1019 | + address_obj = address[0] |
1020 | + if 'zip_id' in address_obj._columns.keys(): |
1021 | + if address_obj.city: |
1022 | + ret += address_obj.city |
1023 | + if address_obj.state_id: |
1024 | + if address_obj.state_id.name: |
1025 | + if ret: |
1026 | + ret += ', ' |
1027 | + ret += address_obj.state_id.code |
1028 | + if address_obj.zip_id: |
1029 | + if address_obj.zip_id.zipcode: |
1030 | + if ret: |
1031 | + ret += ' ' |
1032 | + ret += address_obj.zip_id.zipcode |
1033 | + else: |
1034 | + if address_obj.city_id: |
1035 | + if address_obj.city_id.name: |
1036 | + ret += address_obj.city_id.name |
1037 | + if address_obj.city_id.state_id: |
1038 | + if address_obj.city_id.state_id.code: |
1039 | + if ret: |
1040 | + ret += ', ' |
1041 | + ret += address_obj.city_id.state_id.code |
1042 | + if address_obj.zip: |
1043 | + if ret: |
1044 | + ret += ' ' |
1045 | + ret += address_obj.zip |
1046 | + return ret |
1047 | + |
1048 | + def find_lang(self,): |
1049 | + ''' |
1050 | + Find language of user |
1051 | + ''' |
1052 | + return pooler.get_pool(self.cr.dbname).get('res.users').browse(self.cr, self.uid, self.uid).company_id.lang |
1053 | + |
1054 | + def fill_stars(self, amount): |
1055 | + ''' |
1056 | + Fills stars after amount in words |
1057 | + ''' |
1058 | + amount = amount.replace('Dollars','') |
1059 | + if len(amount) < 100: #TODO |
1060 | + stars = 100 - len(amount) |
1061 | + return ' '.join([amount,'*'*stars]) |
1062 | + |
1063 | + else: return amount |
1064 | + |
1065 | + |
1066 | + def get_lines(self, voucher_lines): |
1067 | + ''' |
1068 | + return date_original, name, amount_original, amount, amount_due, invoice and purchase order details of selected voucher lines |
1069 | + ''' |
1070 | + result = [] |
1071 | + self.number_lines = len(voucher_lines) |
1072 | + for num_i in range(0, self.number_lines): |
1073 | + if num_i < self.number_lines: |
1074 | + print 'discount_used' in voucher_lines[num_i]._columns |
1075 | + res = { |
1076 | + 'date_original' : voucher_lines[num_i].date_original, |
1077 | + 'name' : voucher_lines[num_i].name, |
1078 | + 'amount_original' : voucher_lines[num_i].amount_original and voucher_lines[num_i].amount_original or False, |
1079 | + 'amount' : voucher_lines[num_i].amount and voucher_lines[num_i].amount or False, |
1080 | + 'amount_due' : (voucher_lines[num_i].amount and voucher_lines[num_i].amount_unreconciled)and voucher_lines[num_i].amount_unreconciled - voucher_lines[num_i].amount or False, |
1081 | + 'invoice' : voucher_lines[num_i].invoice_id and voucher_lines[num_i].invoice_id.inv_ref or voucher_lines[num_i].invoice_id.reference or ' ', |
1082 | + 'pur_order' : voucher_lines[num_i].invoice_id and voucher_lines[num_i].invoice_id.origin or ' ', |
1083 | + 'discount_used' : 'discount_used' in voucher_lines[num_i]._columns and voucher_lines[num_i].discount_used or ' ', |
1084 | + } |
1085 | + else : |
1086 | + res = { |
1087 | + 'date_original' : False, |
1088 | + 'name' : False, |
1089 | + 'amount_original' : False, |
1090 | + 'amount_due' : False, |
1091 | + 'amount' : False, |
1092 | + 'invoice' : ' ', |
1093 | + 'pur_order' : ' ', |
1094 | + 'discount_used' : ' ', |
1095 | + } |
1096 | + if res.get('amount',False): |
1097 | + result.append(res) |
1098 | + result = result[:10] |
1099 | + return result |
1100 | + |
1101 | +report_sxw.report_sxw( |
1102 | + 'report.account.print.check.top', |
1103 | + 'account.voucher', |
1104 | + 'addons/account_check_writing/report/check_print_top.rml', |
1105 | + parser=report_print_check,header=False |
1106 | +) |
1107 | + |
1108 | +report_sxw.report_sxw( |
1109 | + 'report.account.print.check.middle', |
1110 | + 'account.voucher', |
1111 | + 'addons/account_check_writing/report/check_print_middle.rml', |
1112 | + parser=report_print_check,header=False |
1113 | +) |
1114 | + |
1115 | +report_sxw.report_sxw( |
1116 | + 'report.account.print.check.bottom', |
1117 | + 'account.voucher', |
1118 | + 'addons/account_check_writing/report/check_print_bottom.rml', |
1119 | + parser=report_print_check,header=False |
1120 | +) |
1121 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
1122 | |
1123 | === added file 'account_check_writing/report/check_print.sxw' |
1124 | Binary files account_check_writing/report/check_print.sxw 1970-01-01 00:00:00 +0000 and account_check_writing/report/check_print.sxw 2011-10-06 15:19:26 +0000 differ |
1125 | === added file 'account_check_writing/report/check_print_bottom.rml' |
1126 | --- account_check_writing/report/check_print_bottom.rml 1970-01-01 00:00:00 +0000 |
1127 | +++ account_check_writing/report/check_print_bottom.rml 2011-10-06 15:19:26 +0000 |
1128 | @@ -0,0 +1,354 @@ |
1129 | +<?xml version="1.0"?> |
1130 | +<document filename="test.pdf"> |
1131 | + <template pageSize="(612.0, 792.0)" title="Test" author="Martin Simon" allowSplitting="20"> |
1132 | + <pageTemplate id="first"> |
1133 | + <frame id="first" x1="13.0" y1="0.0" width="567" height="765"/> |
1134 | + </pageTemplate> |
1135 | + </template> |
1136 | + <stylesheet> |
1137 | + <blockTableStyle id="Standard_Outline"> |
1138 | + <blockAlignment value="LEFT"/> |
1139 | + <blockValign value="TOP"/> |
1140 | + </blockTableStyle> |
1141 | + <blockTableStyle id="Table1"> |
1142 | + <blockAlignment value="LEFT"/> |
1143 | + <blockValign value="TOP"/> |
1144 | + </blockTableStyle> |
1145 | + <blockTableStyle id="Table4"> |
1146 | + <blockAlignment value="LEFT"/> |
1147 | + <blockValign value="TOP"/> |
1148 | + </blockTableStyle> |
1149 | + <blockTableStyle id="Table5"> |
1150 | + <blockAlignment value="LEFT"/> |
1151 | + <blockValign value="TOP"/> |
1152 | + </blockTableStyle> |
1153 | + <blockTableStyle id="Table12"> |
1154 | + <blockAlignment value="LEFT"/> |
1155 | + <blockValign value="TOP"/> |
1156 | + </blockTableStyle> |
1157 | + <blockTableStyle id="Table2"> |
1158 | + <blockAlignment value="LEFT"/> |
1159 | + <blockValign value="TOP"/> |
1160 | + </blockTableStyle> |
1161 | + <blockTableStyle id="Table6"> |
1162 | + <blockAlignment value="LEFT"/> |
1163 | + <blockValign value="TOP"/> |
1164 | + </blockTableStyle> |
1165 | + <blockTableStyle id="Table10"> |
1166 | + <blockAlignment value="LEFT"/> |
1167 | + <blockValign value="TOP"/> |
1168 | + </blockTableStyle> |
1169 | + <blockTableStyle id="Table11"> |
1170 | + <blockAlignment value="LEFT"/> |
1171 | + <blockValign value="TOP"/> |
1172 | + </blockTableStyle> |
1173 | + <blockTableStyle id="Table3"> |
1174 | + <blockAlignment value="LEFT"/> |
1175 | + <blockValign value="TOP"/> |
1176 | + </blockTableStyle> |
1177 | + <blockTableStyle id="Table7"> |
1178 | + <blockAlignment value="LEFT"/> |
1179 | + <blockValign value="TOP"/> |
1180 | + </blockTableStyle> |
1181 | + <blockTableStyle id="Table8"> |
1182 | + <blockAlignment value="LEFT"/> |
1183 | + <blockValign value="TOP"/> |
1184 | + </blockTableStyle> |
1185 | + <blockTableStyle id="Table9"> |
1186 | + <blockAlignment value="LEFT"/> |
1187 | + <blockValign value="TOP"/> |
1188 | + </blockTableStyle> |
1189 | + <initialize> |
1190 | + <paraStyle name="all" alignment="justify"/> |
1191 | + </initialize> |
1192 | + <paraStyle name="P1" rightIndent="-1.0" leftIndent="0.0" fontName="Helvetica"/> |
1193 | + <paraStyle name="P2" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica"/> |
1194 | + <paraStyle name="P3" fontName="Helvetica"/> |
1195 | + <paraStyle name="P4" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT"/> |
1196 | + <paraStyle name="P37" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT"/> |
1197 | + <paraStyle name="P5" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="RIGHT"/> |
1198 | + <paraStyle name="P6" fontName="Helvetica-Bold" fontSize="9.0" leading="11"/> |
1199 | + <paraStyle name="P7" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT"/> |
1200 | + <paraStyle name="P8" fontName="Helvetica" fontSize="9.0" leading="11"/> |
1201 | + <paraStyle name="P9" fontName="Helvetica" fontSize="10.0" leading="13"/> |
1202 | + <paraStyle name="P10" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="RIGHT"/> |
1203 | + <paraStyle name="P11" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="LEFT"/> |
1204 | + <paraStyle name="P12" fontName="Helvetica" fontSize="12.0" leading="15"/> |
1205 | + <paraStyle name="P13" fontName="Helvetica"/> |
1206 | + <paraStyle name="P14" fontName="Helvetica" fontSize="10.0" leading="13"/> |
1207 | + <paraStyle name="P15" fontName="Helvetica" fontSize="10.0" leading="13"/> |
1208 | + <paraStyle name="P16" fontName="Helvetica-Bold" fontSize="9.0" leading="11"/> |
1209 | + <paraStyle name="P17" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT"/> |
1210 | + <paraStyle name="P18" fontName="Helvetica" fontSize="9.0" leading="11"/> |
1211 | + <paraStyle name="P19" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT"/> |
1212 | + <paraStyle name="P36" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT"/> |
1213 | + <paraStyle name="P20" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT"/> |
1214 | + <paraStyle name="P21" fontName="Helvetica" fontSize="8.0" leading="10"/> |
1215 | + <paraStyle name="P22" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT"/> |
1216 | + <paraStyle name="P23" fontName="Helvetica-Bold" fontSize="8.0" leading="10"/> |
1217 | + <paraStyle name="P24" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT"/> |
1218 | + <paraStyle name="P26" fontName="Helvetica" fontSize="10.0" leading="13" leftIndent="7.0"/> |
1219 | + <paraStyle name="P35" fontName="Helvetica" fontSize="10.0" leading="13" leftIndent="480.0"/> |
1220 | + <paraStyle name="Standard" fontName="Helvetica"/> |
1221 | + <paraStyle name="Heading" fontName="Helvetica" fontSize="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/> |
1222 | + <paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/> |
1223 | + <paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/> |
1224 | + <paraStyle name="Caption" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="6.0" spaceAfter="6.0"/> |
1225 | + <paraStyle name="Index" fontName="Helvetica"/> |
1226 | + <paraStyle name="Table Contents" fontName="Helvetica"/> |
1227 | + <paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER"/> |
1228 | + <images/> |
1229 | + </stylesheet> |
1230 | + <story> |
1231 | + <para style="P1">[[repeatIn(objects,'voucher')]] [[ setLang(find_lang()) ]]</para> |
1232 | + <blockTable colWidths="568.0" style="Table2" rowHeights="285"> |
1233 | + <tr> |
1234 | + <td> |
1235 | + <blockTable colWidths="445.0,117.0" style="Table6"> |
1236 | + <tr> |
1237 | + <td> |
1238 | + <para style="P16">[[voucher.partner_id.name]]</para> |
1239 | + </td> |
1240 | + <td> |
1241 | + <para style="P16">[[ formatLang(voucher.date , date=True) or '' ]] [[ chk_no(voucher) or ' ']]</para> |
1242 | + </td> |
1243 | + </tr> |
1244 | + </blockTable> |
1245 | + <blockTable colWidths="81.0,100.0,86,83.0,81.0,54.0,78.0" style="Table10"> |
1246 | + <tr> |
1247 | + <td> |
1248 | + <para style="P4">Due Date</para> |
1249 | + </td> |
1250 | + <td> |
1251 | + <para style="P4">Invoice</para> |
1252 | + </td> |
1253 | + <td> |
1254 | + <para style="P4">Purchase Order</para> |
1255 | + </td> |
1256 | + <td> |
1257 | + <para style="P37">Original Amount</para> |
1258 | + </td> |
1259 | + <td> |
1260 | + <para style="P4">Balance Due</para> |
1261 | + </td> |
1262 | + <td> |
1263 | + <para style="P4">Discount</para> |
1264 | + </td> |
1265 | + <td> |
1266 | + <para style="P4">Payment</para> |
1267 | + </td> |
1268 | + </tr> |
1269 | + <tr> |
1270 | + <td> |
1271 | + <para style="P19">[[ repeatIn(get_lines(voucher.line_ids),'l') ]] [[ formatLang(l['date_original'] ,date=True) or '' ]]</para> |
1272 | + </td> |
1273 | + <td> |
1274 | + <para style="P19">[[ l['invoice'] ]]</para> |
1275 | + </td> |
1276 | + <td> |
1277 | + <para style="P19">[[ l['pur_order'] ]]</para> |
1278 | + </td> |
1279 | + <td> |
1280 | + <para style="P36">[[formatLang( l['amount_original']) ]]</para> |
1281 | + </td> |
1282 | + <td> |
1283 | + <para style="P19">[[ formatLang( l['amount_unreconciled']) ]]</para> |
1284 | + </td> |
1285 | + <td> |
1286 | + <para style="P19"> |
1287 | + [[ formatLang( l['discount_used']) ]] |
1288 | + </para> |
1289 | + </td> |
1290 | + <td> |
1291 | + <para style="P19">[[ formatLang (l['amount']) ]]</para> |
1292 | + </td> |
1293 | + </tr> |
1294 | + </blockTable> |
1295 | + <blockTable colWidths="485.0,77.0" style="Table11"> |
1296 | + <tr> |
1297 | + <td> |
1298 | + <para style="P24">Check Amount</para> |
1299 | + </td> |
1300 | + <td> |
1301 | + <para style="P23">[[ formatLang (voucher.amount) ]]</para> |
1302 | + </td> |
1303 | + </tr> |
1304 | + </blockTable> |
1305 | + <para style="P3"> |
1306 | + <font color="white"> </font> |
1307 | + </para> |
1308 | + </td> |
1309 | + </tr> |
1310 | + </blockTable> |
1311 | + <blockTable colWidths="568.0" style="Table3"> |
1312 | + <tr> |
1313 | + <td> |
1314 | + <blockTable colWidths="446.0,116.0" style="Table7"> |
1315 | + <tr> |
1316 | + <td> |
1317 | + <para style="P16">[[voucher.partner_id.name]]</para> |
1318 | + </td> |
1319 | + <td> |
1320 | + <para style="P16">[[ formatLang(voucher.date , date=True) or '' ]] [[ chk_no(voucher) or ' ']]</para> |
1321 | + </td> |
1322 | + </tr> |
1323 | + </blockTable> |
1324 | + <blockTable colWidths="82.0,100.0,85.0,89.0,76.0,52.0,78.0" style="Table8"> |
1325 | + <tr> |
1326 | + <td> |
1327 | + <para style="P4">Due Date</para> |
1328 | + </td> |
1329 | + <td> |
1330 | + <para style="P4">Invoice</para> |
1331 | + </td> |
1332 | + <td> |
1333 | + <para style="P4">Purchase Order</para> |
1334 | + </td> |
1335 | + <td> |
1336 | + <para style="P37">Original Amount</para> |
1337 | + </td> |
1338 | + <td> |
1339 | + <para style="P4">Balance Due</para> |
1340 | + </td> |
1341 | + <td> |
1342 | + <para style="P4">Discount</para> |
1343 | + </td> |
1344 | + <td> |
1345 | + <para style="P4">Payment</para> |
1346 | + </td> |
1347 | + </tr> |
1348 | + <tr> |
1349 | + <td> |
1350 | + <para style="P19">[[ repeatIn(get_lines(voucher.line_ids),'l') ]] [[ formatLang(l['date_original'] ,date=True) or '' ]]</para> |
1351 | + </td> |
1352 | + <td> |
1353 | + <para style="P19">[[ l['invoice'] ]]</para> |
1354 | + </td> |
1355 | + <td> |
1356 | + <para style="P19">[[ l['pur_order'] ]]</para> |
1357 | + </td> |
1358 | + <td> |
1359 | + <para style="P36">[[ formatLang (l['amount_original']) ]]</para> |
1360 | + </td> |
1361 | + <td> |
1362 | + <para style="P19">[[ formatLang (l['amount_unreconciled']) ]]</para> |
1363 | + </td> |
1364 | + <td> |
1365 | + <para style="P19"> |
1366 | + [[ formatLang( l['discount_used']) ]] |
1367 | + </para> |
1368 | + </td> |
1369 | + <td> |
1370 | + <para style="P19">[[ formatLang (l['amount']) ]]</para> |
1371 | + </td> |
1372 | + </tr> |
1373 | + </blockTable> |
1374 | + <blockTable colWidths="485.0,77.0" style="Table9" rowHeights="40.5"> |
1375 | + <tr> |
1376 | + <td> |
1377 | + <para style="P17">Check Amount</para> |
1378 | + </td> |
1379 | + <td> |
1380 | + <para style="P16">[[ formatLang (voucher.amount) ]]</para> |
1381 | + </td> |
1382 | + </tr> |
1383 | + </blockTable> |
1384 | + <para style="P3"> |
1385 | + <font color="white"> </font> |
1386 | + </para> |
1387 | + </td> |
1388 | + </tr> |
1389 | + </blockTable> |
1390 | + <para style="P2"> |
1391 | + <font color="white"> </font> |
1392 | + </para> |
1393 | + <blockTable colWidths="568.0" style="Table1"> |
1394 | + <tr> |
1395 | + <td> |
1396 | + <blockTable colWidths="370.0,110.0,75.0" rowHeights="50.5,15,35" style="Table5"> |
1397 | + <tr> |
1398 | + <td> |
1399 | + <para style="P9"></para> |
1400 | + </td> |
1401 | + <td> |
1402 | + <para style="P9"></para> |
1403 | + </td> |
1404 | + <td> |
1405 | + <para style="P9"></para> |
1406 | + </td> |
1407 | + </tr> |
1408 | + <tr> |
1409 | + <td> |
1410 | + <para style="P9"></para> |
1411 | + </td> |
1412 | + <td> |
1413 | + <para style="P9"></para> |
1414 | + </td> |
1415 | + <td> |
1416 | + <para style="P9">[[ chk_no(voucher) or ' ']]</para> |
1417 | + </td> |
1418 | + </tr> |
1419 | + <tr> |
1420 | + <td> |
1421 | + <para style="P9"></para> |
1422 | + </td> |
1423 | + <td> |
1424 | + <para style="P9">[[ formatLang(voucher.date , date=True) or '' ]]</para> |
1425 | + </td> |
1426 | + <td> |
1427 | + <para style="P9">[[ formatLang (voucher.amount) ]]</para> |
1428 | + </td> |
1429 | + </tr> |
1430 | + </blockTable> |
1431 | + <blockTable colWidths="54.0,500.0" rowHeights="65" style="Table12"> |
1432 | + <tr> |
1433 | + <td> |
1434 | + <para style="P3"> |
1435 | + <font color="white"> </font> |
1436 | + </para> |
1437 | + </td> |
1438 | + <td> |
1439 | + |
1440 | + <para style="P15">[[ voucher.partner_id.name ]]</para> |
1441 | + <para style="P15">[[ voucher.partner_id.address and voucher.partner_id.address[0] and voucher.partner_id.address[0].street or removeParentNode('para') ]]</para> |
1442 | + <para style="P15">[[ voucher.partner_id.address and voucher.partner_id.address[0] and voucher.partner_id.address[0].street2 or removeParentNode('para') ]]</para> |
1443 | + <para style="P15">[[ get_zip_line(voucher.partner_id.address) ]] </para> |
1444 | + <para style="P15">[[ voucher.partner_id.address[0].country_id.name]]</para> |
1445 | + </td> |
1446 | + </tr> |
1447 | + </blockTable> |
1448 | + |
1449 | + |
1450 | + |
1451 | + <blockTable colWidths="550.0" rowHeights="93" style="Table5"> |
1452 | + <tr> |
1453 | + <td> |
1454 | + <para style="P9">[[ fill_stars(voucher.amount_in_word) ]]</para> |
1455 | + </td> |
1456 | + </tr> |
1457 | + </blockTable> |
1458 | + |
1459 | + |
1460 | + <blockTable colWidths="25.0,500" style="Table12"> |
1461 | + <tr> |
1462 | + <td> |
1463 | + <para style="P3"> |
1464 | + <font color="white"> </font> |
1465 | + </para> |
1466 | + </td> |
1467 | + <td> |
1468 | + <para style="P3"> |
1469 | + <font color="white"> </font> |
1470 | + </para> |
1471 | + <!--para style="P15">[[ voucher.name ]]</para--> |
1472 | + </td> |
1473 | + </tr> |
1474 | + </blockTable> |
1475 | + <para style="P3"> |
1476 | + <font color="white"> </font> |
1477 | + </para> |
1478 | + </td> |
1479 | + </tr> |
1480 | + </blockTable> |
1481 | + </story> |
1482 | +</document> |
1483 | |
1484 | === added file 'account_check_writing/report/check_print_bottom_old.rml' |
1485 | --- account_check_writing/report/check_print_bottom_old.rml 1970-01-01 00:00:00 +0000 |
1486 | +++ account_check_writing/report/check_print_bottom_old.rml 2011-10-06 15:19:26 +0000 |
1487 | @@ -0,0 +1,311 @@ |
1488 | +<?xml version="1.0"?> |
1489 | +<document filename="test.pdf"> |
1490 | + <template pageSize="(612.0, 792.0)" title="Test" author="Martin Simon" allowSplitting="20"> |
1491 | + <pageTemplate id="first"> |
1492 | + <frame id="first" x1="13.0" y1="0.0" width="567" height="765"/> |
1493 | + </pageTemplate> |
1494 | + </template> |
1495 | + <stylesheet> |
1496 | + <blockTableStyle id="Standard_Outline"> |
1497 | + <blockAlignment value="LEFT"/> |
1498 | + <blockValign value="TOP"/> |
1499 | + </blockTableStyle> |
1500 | + <blockTableStyle id="Table1"> |
1501 | + <blockAlignment value="LEFT"/> |
1502 | + <blockValign value="TOP"/> |
1503 | + </blockTableStyle> |
1504 | + <blockTableStyle id="Table4"> |
1505 | + <blockAlignment value="LEFT"/> |
1506 | + <blockValign value="TOP"/> |
1507 | + </blockTableStyle> |
1508 | + <blockTableStyle id="Table5"> |
1509 | + <blockAlignment value="LEFT"/> |
1510 | + <blockValign value="TOP"/> |
1511 | + </blockTableStyle> |
1512 | + <blockTableStyle id="Table12"> |
1513 | + <blockAlignment value="LEFT"/> |
1514 | + <blockValign value="TOP"/> |
1515 | + </blockTableStyle> |
1516 | + <blockTableStyle id="Table2"> |
1517 | + <blockAlignment value="LEFT"/> |
1518 | + <blockValign value="TOP"/> |
1519 | + </blockTableStyle> |
1520 | + <blockTableStyle id="Table6"> |
1521 | + <blockAlignment value="LEFT"/> |
1522 | + <blockValign value="TOP"/> |
1523 | + </blockTableStyle> |
1524 | + <blockTableStyle id="Table10"> |
1525 | + <blockAlignment value="LEFT"/> |
1526 | + <blockValign value="TOP"/> |
1527 | + </blockTableStyle> |
1528 | + <blockTableStyle id="Table11"> |
1529 | + <blockAlignment value="LEFT"/> |
1530 | + <blockValign value="TOP"/> |
1531 | + </blockTableStyle> |
1532 | + <blockTableStyle id="Table3"> |
1533 | + <blockAlignment value="LEFT"/> |
1534 | + <blockValign value="TOP"/> |
1535 | + </blockTableStyle> |
1536 | + <blockTableStyle id="Table7"> |
1537 | + <blockAlignment value="LEFT"/> |
1538 | + <blockValign value="TOP"/> |
1539 | + </blockTableStyle> |
1540 | + <blockTableStyle id="Table8"> |
1541 | + <blockAlignment value="LEFT"/> |
1542 | + <blockValign value="TOP"/> |
1543 | + </blockTableStyle> |
1544 | + <blockTableStyle id="Table9"> |
1545 | + <blockAlignment value="LEFT"/> |
1546 | + <blockValign value="TOP"/> |
1547 | + </blockTableStyle> |
1548 | + <initialize> |
1549 | + <paraStyle name="all" alignment="justify"/> |
1550 | + </initialize> |
1551 | + <paraStyle name="P1" rightIndent="-1.0" leftIndent="0.0" fontName="Helvetica"/> |
1552 | + <paraStyle name="P2" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica"/> |
1553 | + <paraStyle name="P3" fontName="Helvetica"/> |
1554 | + <paraStyle name="P4" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT"/> |
1555 | + <paraStyle name="P5" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="RIGHT"/> |
1556 | + <paraStyle name="P6" fontName="Helvetica-Bold" fontSize="9.0" leading="11"/> |
1557 | + <paraStyle name="P7" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT"/> |
1558 | + <paraStyle name="P8" fontName="Helvetica" fontSize="9.0" leading="11"/> |
1559 | + <paraStyle name="P9" fontName="Helvetica" fontSize="10.0" leading="13"/> |
1560 | + <paraStyle name="P10" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="RIGHT"/> |
1561 | + <paraStyle name="P11" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="LEFT"/> |
1562 | + <paraStyle name="P12" fontName="Helvetica" fontSize="12.0" leading="15"/> |
1563 | + <paraStyle name="P13" fontName="Helvetica"/> |
1564 | + <paraStyle name="P14" fontName="Helvetica" fontSize="10.0" leading="13"/> |
1565 | + <paraStyle name="P15" fontName="Helvetica" fontSize="10.0" leading="13"/> |
1566 | + <paraStyle name="P16" fontName="Helvetica-Bold" fontSize="9.0" leading="11"/> |
1567 | + <paraStyle name="P17" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT"/> |
1568 | + <paraStyle name="P18" fontName="Helvetica" fontSize="9.0" leading="11"/> |
1569 | + <paraStyle name="P19" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT"/> |
1570 | + <paraStyle name="P20" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT"/> |
1571 | + <paraStyle name="P21" fontName="Helvetica" fontSize="8.0" leading="10"/> |
1572 | + <paraStyle name="P22" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT"/> |
1573 | + <paraStyle name="P23" fontName="Helvetica-Bold" fontSize="8.0" leading="10"/> |
1574 | + <paraStyle name="P24" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT"/> |
1575 | + <paraStyle name="Standard" fontName="Helvetica"/> |
1576 | + <paraStyle name="Heading" fontName="Helvetica" fontSize="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/> |
1577 | + <paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/> |
1578 | + <paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/> |
1579 | + <paraStyle name="Caption" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="6.0" spaceAfter="6.0"/> |
1580 | + <paraStyle name="Index" fontName="Helvetica"/> |
1581 | + <paraStyle name="Table Contents" fontName="Helvetica"/> |
1582 | + <paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER"/> |
1583 | + <images/> |
1584 | + </stylesheet> |
1585 | + <story> |
1586 | + <para style="P1">[[repeatIn(objects,'voucher')]]</para> |
1587 | + <blockTable colWidths="568.0" style="Table2" rowHeights="285"> |
1588 | + <tr> |
1589 | + <td> |
1590 | + <blockTable colWidths="445.0,117.0" style="Table6"> |
1591 | + <tr> |
1592 | + <td> |
1593 | + <para style="P16">[[voucher.partner_id.name]]</para> |
1594 | + </td> |
1595 | + <td> |
1596 | + <para style="P16">[[ formatLang(voucher.date , date=True) or '' ]]</para> |
1597 | + </td> |
1598 | + </tr> |
1599 | + </blockTable> |
1600 | + <blockTable colWidths="81.0,186.0,83.0,81.0,54.0,78.0" style="Table10"> |
1601 | + <tr> |
1602 | + <td> |
1603 | + <para style="P4">Due Date</para> |
1604 | + </td> |
1605 | + <td> |
1606 | + <para style="P4">Description</para> |
1607 | + </td> |
1608 | + <td> |
1609 | + <para style="P4">Original Amount</para> |
1610 | + </td> |
1611 | + <td> |
1612 | + <para style="P4">Balance Due</para> |
1613 | + </td> |
1614 | + <td> |
1615 | + <para style="P4">Discount</para> |
1616 | + </td> |
1617 | + <td> |
1618 | + <para style="P4">Payment</para> |
1619 | + </td> |
1620 | + </tr> |
1621 | + <tr> |
1622 | + <td> |
1623 | + <para style="P19">[[ repeatIn(get_lines(voucher.line_dr_ids),'l') ]] [[ formatLang(l['date_original'] ,date=True) or '' ]]</para> |
1624 | + </td> |
1625 | + <td> |
1626 | + <para style="P19">[[ l['name'] ]]</para> |
1627 | + </td> |
1628 | + <td> |
1629 | + <para style="P19">[[formatLang( l['amount_original']) ]]</para> |
1630 | + </td> |
1631 | + <td> |
1632 | + <para style="P19">[[ formatLang( l['amount_due']) ]]</para> |
1633 | + </td> |
1634 | + <td> |
1635 | + <para style="P19"> |
1636 | + <font color="white"> </font> |
1637 | + </para> |
1638 | + </td> |
1639 | + <td> |
1640 | + <para style="P19">[[ formatLang (l['amount']) ]]</para> |
1641 | + </td> |
1642 | + </tr> |
1643 | + </blockTable> |
1644 | + <blockTable colWidths="485.0,77.0" style="Table11"> |
1645 | + <tr> |
1646 | + <td> |
1647 | + <para style="P24">Check Amount</para> |
1648 | + </td> |
1649 | + <td> |
1650 | + <para style="P23">[[ formatLang (voucher.amount) ]]</para> |
1651 | + </td> |
1652 | + </tr> |
1653 | + </blockTable> |
1654 | + <para style="P3"> |
1655 | + <font color="white"> </font> |
1656 | + </para> |
1657 | + </td> |
1658 | + </tr> |
1659 | + </blockTable> |
1660 | + <blockTable colWidths="568.0" style="Table3"> |
1661 | + <tr> |
1662 | + <td> |
1663 | + <blockTable colWidths="446.0,116.0" style="Table7"> |
1664 | + <tr> |
1665 | + <td> |
1666 | + <para style="P16">[[voucher.partner_id.name]]</para> |
1667 | + </td> |
1668 | + <td> |
1669 | + <para style="P16">[[ formatLang(voucher.date , date=True) or '' ]]</para> |
1670 | + </td> |
1671 | + </tr> |
1672 | + </blockTable> |
1673 | + <blockTable colWidths="82.0,185.0,89.0,76.0,52.0,78.0" style="Table8"> |
1674 | + <tr> |
1675 | + <td> |
1676 | + <para style="P4">Due Date</para> |
1677 | + </td> |
1678 | + <td> |
1679 | + <para style="P4">Description</para> |
1680 | + </td> |
1681 | + <td> |
1682 | + <para style="P4">Original Amount</para> |
1683 | + </td> |
1684 | + <td> |
1685 | + <para style="P4">Balance Due</para> |
1686 | + </td> |
1687 | + <td> |
1688 | + <para style="P4">Discount</para> |
1689 | + </td> |
1690 | + <td> |
1691 | + <para style="P4">Payment</para> |
1692 | + </td> |
1693 | + </tr> |
1694 | + <tr> |
1695 | + <td> |
1696 | + <para style="P19">[[ repeatIn(get_lines(voucher.line_dr_ids),'l') ]] [[ formatLang(l['date_original'] ,date=True) or '' ]]</para> |
1697 | + </td> |
1698 | + <td> |
1699 | + <para style="P19">[[ l['name'] ]]</para> |
1700 | + </td> |
1701 | + <td> |
1702 | + <para style="P19">[[ formatLang (l['amount_original']) ]]</para> |
1703 | + </td> |
1704 | + <td> |
1705 | + <para style="P19">[[ formatLang (l['amount_due']) ]]</para> |
1706 | + </td> |
1707 | + <td> |
1708 | + <para style="P19"> |
1709 | + <font color="white"> </font> |
1710 | + </para> |
1711 | + </td> |
1712 | + <td> |
1713 | + <para style="P19">[[ formatLang (l['amount']) ]]</para> |
1714 | + </td> |
1715 | + </tr> |
1716 | + </blockTable> |
1717 | + <blockTable colWidths="485.0,77.0" style="Table9" rowHeights="40.5"> |
1718 | + <tr> |
1719 | + <td> |
1720 | + <para style="P17">Check Amount</para> |
1721 | + </td> |
1722 | + <td> |
1723 | + <para style="P16">[[ formatLang (voucher.amount) ]]</para> |
1724 | + </td> |
1725 | + </tr> |
1726 | + </blockTable> |
1727 | + <para style="P3"> |
1728 | + <font color="white"> </font> |
1729 | + </para> |
1730 | + </td> |
1731 | + </tr> |
1732 | + </blockTable> |
1733 | + <para style="P2"> |
1734 | + <font color="white"> </font> |
1735 | + </para> |
1736 | + <blockTable colWidths="568.0" style="Table1"> |
1737 | + <tr> |
1738 | + <td> |
1739 | + <blockTable colWidths="370.0,130.0,55.0" rowHeights="65.5,30" style="Table5"> |
1740 | + <tr> |
1741 | + <td> |
1742 | + <para style="P9"></para> |
1743 | + </td> |
1744 | + <td> |
1745 | + <para style="P9"></para> |
1746 | + </td> |
1747 | + <td> |
1748 | + <para style="P9"></para> |
1749 | + </td> |
1750 | + </tr> |
1751 | + <tr> |
1752 | + <td> |
1753 | + <para style="P9"></para> |
1754 | + </td> |
1755 | + <td> |
1756 | + <para style="P9">[[ formatLang(voucher.date , date=True) or '' ]]</para> |
1757 | + </td> |
1758 | + <td> |
1759 | + <para style="P9">[[ formatLang (voucher.amount) ]]</para> |
1760 | + </td> |
1761 | + </tr> |
1762 | + </blockTable> |
1763 | + <blockTable colWidths="54.0,500.0" rowHeights="55" style="Table12"> |
1764 | + <tr> |
1765 | + <td> |
1766 | + <para style="P3"> |
1767 | + <font color="white"> </font> |
1768 | + </para> |
1769 | + </td> |
1770 | + <td> |
1771 | + |
1772 | + <para style="P15">[[ voucher.partner_id.name ]]</para> |
1773 | + </td> |
1774 | + </tr> |
1775 | + </blockTable> |
1776 | + <blockTable colWidths="25.0,500" style="Table12"> |
1777 | + <tr> |
1778 | + <td> |
1779 | + <para style="P3"> |
1780 | + <font color="white"> </font> |
1781 | + </para> |
1782 | + </td> |
1783 | + <td> |
1784 | + <para style="P3"> |
1785 | + <font color="white"> </font> |
1786 | + </para> |
1787 | + <!--para style="P15">[[ voucher.name ]]</para--> |
1788 | + </td> |
1789 | + </tr> |
1790 | + </blockTable> |
1791 | + <para style="P3"> |
1792 | + <font color="white"> </font> |
1793 | + </para> |
1794 | + </td> |
1795 | + </tr> |
1796 | + </blockTable> |
1797 | + </story> |
1798 | +</document> |
1799 | |
1800 | === added file 'account_check_writing/report/check_print_middle.rml' |
1801 | --- account_check_writing/report/check_print_middle.rml 1970-01-01 00:00:00 +0000 |
1802 | +++ account_check_writing/report/check_print_middle.rml 2011-10-06 15:19:26 +0000 |
1803 | @@ -0,0 +1,377 @@ |
1804 | +<?xml version="1.0"?> |
1805 | +<document filename="test.pdf"> |
1806 | + <template pageSize="(612.0, 792.0)" title="Test" author="Martin Simon" allowSplitting="20"> |
1807 | + <pageTemplate id="first"> |
1808 | + <frame id="first" x1="13.0" y1="0.0" width="567" height="785"/> |
1809 | + </pageTemplate> |
1810 | + </template> |
1811 | + <stylesheet> |
1812 | + <blockTableStyle id="Standard_Outline"> |
1813 | + <blockAlignment value="LEFT"/> |
1814 | + <blockValign value="TOP"/> |
1815 | + </blockTableStyle> |
1816 | + <blockTableStyle id="Table1"> |
1817 | + <blockAlignment value="LEFT"/> |
1818 | + <blockValign value="TOP"/> |
1819 | + </blockTableStyle> |
1820 | + <blockTableStyle id="Table4"> |
1821 | + <blockAlignment value="LEFT"/> |
1822 | + <blockValign value="TOP"/> |
1823 | + </blockTableStyle> |
1824 | + <blockTableStyle id="Table5" > |
1825 | + <blockAlignment value="LEFT"/> |
1826 | + <blockValign value="TOP"/> |
1827 | + <blockValign value="TOP"/> |
1828 | + |
1829 | + </blockTableStyle> |
1830 | + <blockTableStyle id="Table12"> |
1831 | + <blockAlignment value="LEFT"/> |
1832 | + <blockValign value="TOP"/> |
1833 | + </blockTableStyle> |
1834 | + <blockTableStyle id="Table2"> |
1835 | + <blockAlignment value="LEFT"/> |
1836 | + <blockValign value="TOP"/> |
1837 | + </blockTableStyle> |
1838 | + <blockTableStyle id="Table6"> |
1839 | + <blockAlignment value="LEFT"/> |
1840 | + <blockValign value="TOP"/> |
1841 | + </blockTableStyle> |
1842 | + <blockTableStyle id="Table10"> |
1843 | + <blockAlignment value="LEFT"/> |
1844 | + <blockValign value="TOP"/> |
1845 | + </blockTableStyle> |
1846 | + <blockTableStyle id="Table11"> |
1847 | + <blockAlignment value="LEFT"/> |
1848 | + <blockValign value="TOP"/> |
1849 | + </blockTableStyle> |
1850 | + <blockTableStyle id="Table3"> |
1851 | + <blockAlignment value="LEFT"/> |
1852 | + <blockValign value="TOP"/> |
1853 | + </blockTableStyle> |
1854 | + <blockTableStyle id="Table7"> |
1855 | + <blockAlignment value="LEFT"/> |
1856 | + <blockValign value="TOP"/> |
1857 | + </blockTableStyle> |
1858 | + <blockTableStyle id="Table8"> |
1859 | + <blockAlignment value="LEFT"/> |
1860 | + <blockValign value="TOP"/> |
1861 | + </blockTableStyle> |
1862 | + <blockTableStyle id="Table9"> |
1863 | + <blockAlignment value="LEFT"/> |
1864 | + <blockValign value="TOP"/> |
1865 | + </blockTableStyle> |
1866 | + <initialize> |
1867 | + <paraStyle name="all" alignment="justify"/> |
1868 | + </initialize> |
1869 | + <paraStyle name="P1" rightIndent="-1.0" leftIndent="0.0" fontName="Helvetica"/> |
1870 | + <paraStyle name="P2" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica"/> |
1871 | + <paraStyle name="P3" fontName="Helvetica"/> |
1872 | + <paraStyle name="P4" fontName="Helvetica-Bold" fontSize="7.0" leading="11" alignment="LEFT"/> |
1873 | + <paraStyle name="P46" fontName="Helvetica-Bold" fontSize="7.0" leading="11" alignment="RIGHT"/> |
1874 | + <paraStyle name="P5" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="RIGHT"/> |
1875 | + <paraStyle name="P6" fontName="Helvetica-Bold" fontSize="9.0" leading="11"/> |
1876 | + <paraStyle name="P7" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT"/> |
1877 | + <paraStyle name="P8" fontName="Helvetica" fontSize="9.0" leading="11"/> |
1878 | + <paraStyle name="P9" fontName="Helvetica" fontSize="10.0" leading="13" leftIndent="0.0"/> |
1879 | + <paraStyle name="P10" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="RIGHT"/> |
1880 | + <paraStyle name="P11" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="LEFT"/> |
1881 | + <paraStyle name="P12" fontName="Helvetica" fontSize="12.0" leading="15"/> |
1882 | + <paraStyle name="P13" fontName="Helvetica"/> |
1883 | + <paraStyle name="P14" fontName="Helvetica" fontSize="10.0" leading="13"/> |
1884 | + <paraStyle name="P15" fontName="Helvetica" fontSize="10.0" leading="13"/> |
1885 | + <paraStyle name="P16" fontName="Helvetica-Bold" fontSize="7.0" leading="11"/> |
1886 | + <paraStyle name="P17" fontName="Helvetica-Bold" fontSize="7.0" leading="11" alignment="RIGHT"/> |
1887 | + <paraStyle name="P18" fontName="Helvetica" fontSize="9.0" leading="11"/> |
1888 | + <paraStyle name="P19" fontName="Helvetica" fontSize="7.0" leading="11" alignment="LEFT"/> |
1889 | + <paraStyle name="P47" fontName="Helvetica" fontSize="7.0" leading="11" alignment="RIGHT"/> |
1890 | + <paraStyle name="P20" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT"/> |
1891 | + <paraStyle name="P21" fontName="Helvetica" fontSize="8.0" leading="10"/> |
1892 | + <paraStyle name="P22" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT"/> |
1893 | + <paraStyle name="P23" fontName="Helvetica-Bold" fontSize="8.0" leading="10"/> |
1894 | + <paraStyle name="P24" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT"/> |
1895 | + <paraStyle name="P26" fontName="Helvetica" fontSize="10.0" leading="13" leftIndent="7.0"/> |
1896 | + <paraStyle name="P35" fontName="Helvetica" fontSize="10.0" leading="13" leftIndent="480.0"/> |
1897 | + <paraStyle name="P45" fontName="Helvetica" fontSize="10.0" leading="10"/> |
1898 | + <paraStyle name="Standard" fontName="Helvetica"/> |
1899 | + <paraStyle name="Heading" fontName="Helvetica" fontSize="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/> |
1900 | + <paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/> |
1901 | + <paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/> |
1902 | + <paraStyle name="Caption" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="6.0" spaceAfter="6.0"/> |
1903 | + <paraStyle name="Index" fontName="Helvetica"/> |
1904 | + <paraStyle name="Table Contents" fontName="Helvetica"/> |
1905 | + <paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER"/> |
1906 | + <images/> |
1907 | + </stylesheet> |
1908 | + <story> |
1909 | + <para style="P1">[[repeatIn(objects,'voucher')]] [[setLang(find_lang())]]</para> |
1910 | + <blockTable colWidths="568.0" style="Table2" rowHeights="320"> |
1911 | + <tr> |
1912 | + <td> |
1913 | + <blockTable colWidths="485.0,67.0" style="Table6"> |
1914 | + <tr> |
1915 | + <td> |
1916 | + <para style="P16"></para> |
1917 | + </td> |
1918 | + <td> |
1919 | + <para style="P45">[[ chk_no(voucher) or ' ']]</para> |
1920 | + </td> |
1921 | + </tr> |
1922 | + <tr> |
1923 | + <td> |
1924 | + <para style="P16">[[voucher.partner_id.name]]</para> |
1925 | + </td> |
1926 | + <td> |
1927 | + <para style="P16">[[ formatLang(voucher.date , date=True) or '' ]]</para> |
1928 | + </td> |
1929 | + </tr> |
1930 | + </blockTable> |
1931 | + <blockTable colWidths="81.0,100.0,86.0,83.0,81.0,54.0,78.0" style="Table10"> |
1932 | + <tr> |
1933 | + <td> |
1934 | + <para style="P4">Due Date</para> |
1935 | + </td> |
1936 | + <td> |
1937 | + <para style="P4">Invoice</para> |
1938 | + </td> |
1939 | + <td> |
1940 | + <para style="P4">Purchase Order</para> |
1941 | + </td> |
1942 | + <td> |
1943 | + <para style="P46">Original Amount</para> |
1944 | + </td> |
1945 | + <td> |
1946 | + <para style="P4">Balance Due</para> |
1947 | + </td> |
1948 | + <td> |
1949 | + <para style="P4">Discount</para> |
1950 | + </td> |
1951 | + <td> |
1952 | + <para style="P4">Payment</para> |
1953 | + </td> |
1954 | + </tr> |
1955 | + <tr> |
1956 | + <td> |
1957 | + <para style="P19">[[ repeatIn(get_lines(voucher.line_ids),'l') ]] [[ formatLang(l['date_original'] ,date=True) or '' ]]</para> |
1958 | + </td> |
1959 | + <td> |
1960 | + <para style="P19">[[ l['invoice'] or ' ']]</para> |
1961 | + </td> |
1962 | + <td> |
1963 | + <para style="P19">[[ l['pur_order'] or ' ' ]]</para> |
1964 | + </td> |
1965 | + <td> |
1966 | + <para style="P47">[[formatLang( l['amount_original']) ]]</para> |
1967 | + </td> |
1968 | + <td> |
1969 | + <para style="P19">[[ formatLang( l['amount_unreconciled']) ]]</para> |
1970 | + </td> |
1971 | + <td> |
1972 | + <para style="P19"> |
1973 | + [[ formatLang( l['discount_used']) ]] |
1974 | + </para> |
1975 | + </td> |
1976 | + <td> |
1977 | + <para style="P19">[[ formatLang (l['amount']) ]]</para> |
1978 | + </td> |
1979 | + </tr> |
1980 | + </blockTable> |
1981 | + <blockTable colWidths="485.0,77.0" style="Table11"> |
1982 | + <tr> |
1983 | + <td> |
1984 | + <para style="P24">Check Amount</para> |
1985 | + </td> |
1986 | + <td> |
1987 | + <para style="P23">[[ formatLang (voucher.amount) ]]</para> |
1988 | + </td> |
1989 | + </tr> |
1990 | + </blockTable> |
1991 | + <blockTable colWidths="485.0,77.0" rowHeights="158,10" style="Table11"> |
1992 | + <tr> |
1993 | + <td> |
1994 | + </td> |
1995 | + <td> |
1996 | + </td> |
1997 | + </tr> |
1998 | + <tr> |
1999 | + <td> |
2000 | + </td> |
2001 | + <td> |
2002 | + <para style="P45">[[ chk_no(voucher) or ' ' ]]</para> |
2003 | + </td> |
2004 | + </tr> |
2005 | + </blockTable> |
2006 | + <para style="P3"> |
2007 | + <font color="white"> </font> |
2008 | + </para> |
2009 | + </td> |
2010 | + </tr> |
2011 | + </blockTable> |
2012 | + <blockTable colWidths="550.0" rowHeights="10" style="Table5"> |
2013 | + <tr> |
2014 | + <td> |
2015 | + <para style="P26">[[ str(fill_stars(voucher.amount_in_word)) ]]</para> |
2016 | + </td> |
2017 | + </tr> |
2018 | + </blockTable> |
2019 | + <blockTable colWidths="568.0" style="Table1"> |
2020 | + <tr> |
2021 | + <td> |
2022 | + <blockTable colWidths="370.0,130.0,55.0" rowHeights=".95cm" style="Table5"> |
2023 | + <tr> |
2024 | + <td> |
2025 | + <para style="P9"></para> |
2026 | + </td> |
2027 | + <td> |
2028 | + <para style="P9"></para> |
2029 | + </td> |
2030 | + <td> |
2031 | + <para style="P9"></para> |
2032 | + </td> |
2033 | + </tr> |
2034 | + <tr> |
2035 | + <td> |
2036 | + <para style="P9"></para> |
2037 | + </td> |
2038 | + <td> |
2039 | + <para style="P9">[[ formatLang(voucher.date , date=True) or '' ]]</para> |
2040 | + </td> |
2041 | + <td> |
2042 | + <para style="P9">[[ formatLang (voucher.amount) ]]</para> |
2043 | + </td> |
2044 | + </tr> |
2045 | + </blockTable> |
2046 | + <blockTable colWidths="54.0,500.0" rowHeights="2.5cm" style="Table12"> |
2047 | + <tr> |
2048 | + <td> |
2049 | + <para style="P3"> |
2050 | + <font color="white"> </font> |
2051 | + </para> |
2052 | + </td> |
2053 | + <td> |
2054 | + <para style="P15">[[ voucher.partner_id.name ]]</para> |
2055 | + <para style="P15">[[ voucher.partner_id.address and voucher.partner_id.address[0] and voucher.partner_id.address[0].street or removeParentNode('para') ]]</para> |
2056 | + <para style="P15">[[ voucher.partner_id.address and voucher.partner_id.address[0] and voucher.partner_id.address[0].street2 or removeParentNode('para') ]]</para> |
2057 | + <para style="P15">[[ get_zip_line(voucher.partner_id.address) ]] </para> |
2058 | + <para style="P15">[[ voucher.partner_id.address[0].country_id.name]]</para> |
2059 | + </td> |
2060 | + </tr> |
2061 | + </blockTable> |
2062 | + <blockTable colWidths="25.0,500" rowHeights="30.5" style="Table12"> |
2063 | + <tr> |
2064 | + <td> |
2065 | + <para style="P3"> |
2066 | + <font color="white"> </font> |
2067 | + </para> |
2068 | + </td> |
2069 | + <td> |
2070 | + <para style="P3"> |
2071 | + <font color="white"> </font> |
2072 | + </para> |
2073 | + <!--para style="P15">[[ voucher.name ]]</para--> |
2074 | + </td> |
2075 | + </tr> |
2076 | + </blockTable> |
2077 | + <para style="P3"> |
2078 | + <font color="white"> </font> |
2079 | + </para> |
2080 | + </td> |
2081 | + </tr> |
2082 | + </blockTable> |
2083 | + <blockTable colWidths="568.0" style="Table3"> |
2084 | + <tr> |
2085 | + <td> |
2086 | + <blockTable colWidths="436.0,76.0,20.0" style="Table7"> |
2087 | + <tr> |
2088 | + <td> |
2089 | + <para style="P16"></para> |
2090 | + </td> |
2091 | + <td> |
2092 | + <para style="P45"></para> |
2093 | + </td> |
2094 | + <td> |
2095 | + <para style="P45"></para> |
2096 | + </td> |
2097 | + </tr> |
2098 | + <tr> |
2099 | + <td> |
2100 | + <para style="P16">[[voucher.partner_id.name]]</para> |
2101 | + </td> |
2102 | + <td> |
2103 | + <para style="P16">[[ formatLang(voucher.date , date=True) or '' ]]</para> |
2104 | + </td> |
2105 | + <td> |
2106 | + <para style="P45">[[ chk_no(voucher) or ' ']]</para> |
2107 | + </td> |
2108 | + </tr> |
2109 | + </blockTable> |
2110 | + <blockTable colWidths="82.0,100.0,85.0,89.0,76.0,52.0,78.0" style="Table8"> |
2111 | + <tr> |
2112 | + <td> |
2113 | + <para style="P4">Due Date</para> |
2114 | + </td> |
2115 | + <td> |
2116 | + <para style="P4">Invoice</para> |
2117 | + </td> |
2118 | + <td> |
2119 | + <para style="P4">Purchase Order</para> |
2120 | + </td> |
2121 | + <td> |
2122 | + <para style="P46">Original Amount</para> |
2123 | + </td> |
2124 | + <td> |
2125 | + <para style="P4">Balance Due</para> |
2126 | + </td> |
2127 | + <td> |
2128 | + <para style="P4">Discount</para> |
2129 | + </td> |
2130 | + <td> |
2131 | + <para style="P4">Payment</para> |
2132 | + </td> |
2133 | + </tr> |
2134 | + <tr> |
2135 | + <td> |
2136 | + <para style="P19">[[ repeatIn(get_lines(voucher.line_ids),'l') ]] [[ formatLang(l['date_original'] ,date=True) or '' ]]</para> |
2137 | + </td> |
2138 | + <td> |
2139 | + <para style="P19">[[ l['invoice'] or ' ']]</para> |
2140 | + </td> |
2141 | + <td> |
2142 | + <para style="P19">[[ l['pur_order'] or ' ']]</para> |
2143 | + </td> |
2144 | + <td> |
2145 | + <para style="P47">[[ formatLang (l['amount_original']) ]]</para> |
2146 | + </td> |
2147 | + <td> |
2148 | + <para style="P19">[[ formatLang (l['amount_unreconciled']) ]]</para> |
2149 | + </td> |
2150 | + <td> |
2151 | + <para style="P19"> |
2152 | + [[ formatLang( l['discount_used']) ]] |
2153 | + </para> |
2154 | + </td> |
2155 | + <td> |
2156 | + <para style="P19">[[ formatLang (l['amount']) ]]</para> |
2157 | + </td> |
2158 | + </tr> |
2159 | + </blockTable> |
2160 | + <blockTable colWidths="485.0,77.0" style="Table9"> |
2161 | + <tr> |
2162 | + <td> |
2163 | + <para style="P17">Check Amount</para> |
2164 | + </td> |
2165 | + <td> |
2166 | + <para style="P16">[[ formatLang (voucher.amount) ]]</para> |
2167 | + </td> |
2168 | + </tr> |
2169 | + </blockTable> |
2170 | + <para style="P3"> |
2171 | + <font color="white"> </font> |
2172 | + </para> |
2173 | + </td> |
2174 | + </tr> |
2175 | + </blockTable> |
2176 | + <para style="P2"> |
2177 | + <font color="white"> </font> |
2178 | + </para> |
2179 | + </story> |
2180 | +</document> |
2181 | |
2182 | === added file 'account_check_writing/report/check_print_middle_old.rml' |
2183 | --- account_check_writing/report/check_print_middle_old.rml 1970-01-01 00:00:00 +0000 |
2184 | +++ account_check_writing/report/check_print_middle_old.rml 2011-10-06 15:19:26 +0000 |
2185 | @@ -0,0 +1,311 @@ |
2186 | +<?xml version="1.0"?> |
2187 | +<document filename="test.pdf"> |
2188 | + <template pageSize="(612.0, 792.0)" title="Test" author="Martin Simon" allowSplitting="20"> |
2189 | + <pageTemplate id="first"> |
2190 | + <frame id="first" x1="13.0" y1="0.0" width="567" height="785"/> |
2191 | + </pageTemplate> |
2192 | + </template> |
2193 | + <stylesheet> |
2194 | + <blockTableStyle id="Standard_Outline"> |
2195 | + <blockAlignment value="LEFT"/> |
2196 | + <blockValign value="TOP"/> |
2197 | + </blockTableStyle> |
2198 | + <blockTableStyle id="Table1"> |
2199 | + <blockAlignment value="LEFT"/> |
2200 | + <blockValign value="TOP"/> |
2201 | + </blockTableStyle> |
2202 | + <blockTableStyle id="Table4"> |
2203 | + <blockAlignment value="LEFT"/> |
2204 | + <blockValign value="TOP"/> |
2205 | + </blockTableStyle> |
2206 | + <blockTableStyle id="Table5"> |
2207 | + <blockAlignment value="LEFT"/> |
2208 | + <blockValign value="TOP"/> |
2209 | + </blockTableStyle> |
2210 | + <blockTableStyle id="Table12"> |
2211 | + <blockAlignment value="LEFT"/> |
2212 | + <blockValign value="TOP"/> |
2213 | + </blockTableStyle> |
2214 | + <blockTableStyle id="Table2"> |
2215 | + <blockAlignment value="LEFT"/> |
2216 | + <blockValign value="TOP"/> |
2217 | + </blockTableStyle> |
2218 | + <blockTableStyle id="Table6"> |
2219 | + <blockAlignment value="LEFT"/> |
2220 | + <blockValign value="TOP"/> |
2221 | + </blockTableStyle> |
2222 | + <blockTableStyle id="Table10"> |
2223 | + <blockAlignment value="LEFT"/> |
2224 | + <blockValign value="TOP"/> |
2225 | + </blockTableStyle> |
2226 | + <blockTableStyle id="Table11"> |
2227 | + <blockAlignment value="LEFT"/> |
2228 | + <blockValign value="TOP"/> |
2229 | + </blockTableStyle> |
2230 | + <blockTableStyle id="Table3"> |
2231 | + <blockAlignment value="LEFT"/> |
2232 | + <blockValign value="TOP"/> |
2233 | + </blockTableStyle> |
2234 | + <blockTableStyle id="Table7"> |
2235 | + <blockAlignment value="LEFT"/> |
2236 | + <blockValign value="TOP"/> |
2237 | + </blockTableStyle> |
2238 | + <blockTableStyle id="Table8"> |
2239 | + <blockAlignment value="LEFT"/> |
2240 | + <blockValign value="TOP"/> |
2241 | + </blockTableStyle> |
2242 | + <blockTableStyle id="Table9"> |
2243 | + <blockAlignment value="LEFT"/> |
2244 | + <blockValign value="TOP"/> |
2245 | + </blockTableStyle> |
2246 | + <initialize> |
2247 | + <paraStyle name="all" alignment="justify"/> |
2248 | + </initialize> |
2249 | + <paraStyle name="P1" rightIndent="-1.0" leftIndent="0.0" fontName="Helvetica"/> |
2250 | + <paraStyle name="P2" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica"/> |
2251 | + <paraStyle name="P3" fontName="Helvetica"/> |
2252 | + <paraStyle name="P4" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT"/> |
2253 | + <paraStyle name="P5" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="RIGHT"/> |
2254 | + <paraStyle name="P6" fontName="Helvetica-Bold" fontSize="9.0" leading="11"/> |
2255 | + <paraStyle name="P7" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT"/> |
2256 | + <paraStyle name="P8" fontName="Helvetica" fontSize="9.0" leading="11"/> |
2257 | + <paraStyle name="P9" fontName="Helvetica" fontSize="10.0" leading="13"/> |
2258 | + <paraStyle name="P10" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="RIGHT"/> |
2259 | + <paraStyle name="P11" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="LEFT"/> |
2260 | + <paraStyle name="P12" fontName="Helvetica" fontSize="12.0" leading="15"/> |
2261 | + <paraStyle name="P13" fontName="Helvetica"/> |
2262 | + <paraStyle name="P14" fontName="Helvetica" fontSize="10.0" leading="13"/> |
2263 | + <paraStyle name="P15" fontName="Helvetica" fontSize="10.0" leading="13"/> |
2264 | + <paraStyle name="P16" fontName="Helvetica-Bold" fontSize="9.0" leading="11"/> |
2265 | + <paraStyle name="P17" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT"/> |
2266 | + <paraStyle name="P18" fontName="Helvetica" fontSize="9.0" leading="11"/> |
2267 | + <paraStyle name="P19" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT"/> |
2268 | + <paraStyle name="P20" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT"/> |
2269 | + <paraStyle name="P21" fontName="Helvetica" fontSize="8.0" leading="10"/> |
2270 | + <paraStyle name="P22" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT"/> |
2271 | + <paraStyle name="P23" fontName="Helvetica-Bold" fontSize="8.0" leading="10"/> |
2272 | + <paraStyle name="P24" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT"/> |
2273 | + <paraStyle name="Standard" fontName="Helvetica"/> |
2274 | + <paraStyle name="Heading" fontName="Helvetica" fontSize="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/> |
2275 | + <paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/> |
2276 | + <paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/> |
2277 | + <paraStyle name="Caption" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="6.0" spaceAfter="6.0"/> |
2278 | + <paraStyle name="Index" fontName="Helvetica"/> |
2279 | + <paraStyle name="Table Contents" fontName="Helvetica"/> |
2280 | + <paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER"/> |
2281 | + <images/> |
2282 | + </stylesheet> |
2283 | + <story> |
2284 | + <para style="P1">[[repeatIn(objects,'voucher')]]</para> |
2285 | + <blockTable colWidths="568.0" style="Table2" rowHeights="265"> |
2286 | + <tr> |
2287 | + <td> |
2288 | + <blockTable colWidths="445.0,117.0" style="Table6"> |
2289 | + <tr> |
2290 | + <td> |
2291 | + <para style="P16">[[voucher.partner_id.name]]</para> |
2292 | + </td> |
2293 | + <td> |
2294 | + <para style="P16">[[ formatLang(voucher.date , date=True) or '' ]]</para> |
2295 | + </td> |
2296 | + </tr> |
2297 | + </blockTable> |
2298 | + <blockTable colWidths="81.0,186.0,83.0,81.0,54.0,78.0" style="Table10"> |
2299 | + <tr> |
2300 | + <td> |
2301 | + <para style="P4">Due Date</para> |
2302 | + </td> |
2303 | + <td> |
2304 | + <para style="P4">Description</para> |
2305 | + </td> |
2306 | + <td> |
2307 | + <para style="P4">Original Amount</para> |
2308 | + </td> |
2309 | + <td> |
2310 | + <para style="P4">Balance Due</para> |
2311 | + </td> |
2312 | + <td> |
2313 | + <para style="P4">Discount</para> |
2314 | + </td> |
2315 | + <td> |
2316 | + <para style="P4">Payment</para> |
2317 | + </td> |
2318 | + </tr> |
2319 | + <tr> |
2320 | + <td> |
2321 | + <para style="P19">[[ repeatIn(get_lines(voucher.line_dr_ids),'l') ]] [[ formatLang(l['date_original'] ,date=True) or '' ]]</para> |
2322 | + </td> |
2323 | + <td> |
2324 | + <para style="P19">[[ l['name'] ]]</para> |
2325 | + </td> |
2326 | + <td> |
2327 | + <para style="P19">[[formatLang( l['amount_original']) ]]</para> |
2328 | + </td> |
2329 | + <td> |
2330 | + <para style="P19">[[ formatLang( l['amount_due']) ]]</para> |
2331 | + </td> |
2332 | + <td> |
2333 | + <para style="P19"> |
2334 | + <font color="white"> </font> |
2335 | + </para> |
2336 | + </td> |
2337 | + <td> |
2338 | + <para style="P19">[[ formatLang (l['amount']) ]]</para> |
2339 | + </td> |
2340 | + </tr> |
2341 | + </blockTable> |
2342 | + <blockTable colWidths="485.0,77.0" style="Table11"> |
2343 | + <tr> |
2344 | + <td> |
2345 | + <para style="P24">Check Amount</para> |
2346 | + </td> |
2347 | + <td> |
2348 | + <para style="P23">[[ formatLang (voucher.amount) ]]</para> |
2349 | + </td> |
2350 | + </tr> |
2351 | + </blockTable> |
2352 | + <para style="P3"> |
2353 | + <font color="white"> </font> |
2354 | + </para> |
2355 | + </td> |
2356 | + </tr> |
2357 | + </blockTable> |
2358 | + <blockTable colWidths="568.0" style="Table1"> |
2359 | + <tr> |
2360 | + <td> |
2361 | + <blockTable colWidths="370.0,130.0,55.0" rowHeights="91.5,35" style="Table5"> |
2362 | + <tr> |
2363 | + <td> |
2364 | + <para style="P9"></para> |
2365 | + </td> |
2366 | + <td> |
2367 | + <para style="P9"></para> |
2368 | + </td> |
2369 | + <td> |
2370 | + <para style="P9"></para> |
2371 | + </td> |
2372 | + </tr> |
2373 | + <tr> |
2374 | + <td> |
2375 | + <para style="P9"></para> |
2376 | + </td> |
2377 | + <td> |
2378 | + <para style="P9">[[ formatLang(voucher.date , date=True) or '' ]]</para> |
2379 | + </td> |
2380 | + <td> |
2381 | + <para style="P9">[[ formatLang (voucher.amount) ]]</para> |
2382 | + </td> |
2383 | + </tr> |
2384 | + </blockTable> |
2385 | + <blockTable colWidths="54.0,500.0" rowHeights="66" style="Table12"> |
2386 | + <tr> |
2387 | + <td> |
2388 | + <para style="P3"> |
2389 | + <font color="white"> </font> |
2390 | + </para> |
2391 | + </td> |
2392 | + <td> |
2393 | + |
2394 | + <para style="P15">[[ voucher.partner_id.name ]]</para> |
2395 | + </td> |
2396 | + </tr> |
2397 | + </blockTable> |
2398 | + <blockTable colWidths="25.0,500" rowHeights="30.5" style="Table12"> |
2399 | + <tr> |
2400 | + <td> |
2401 | + <para style="P3"> |
2402 | + <font color="white"> </font> |
2403 | + </para> |
2404 | + </td> |
2405 | + <td> |
2406 | + <para style="P3"> |
2407 | + <font color="white"> </font> |
2408 | + </para> |
2409 | + <!--para style="P15">[[ voucher.name ]]</para--> |
2410 | + </td> |
2411 | + </tr> |
2412 | + </blockTable> |
2413 | + <para style="P3"> |
2414 | + <font color="white"> </font> |
2415 | + </para> |
2416 | + </td> |
2417 | + </tr> |
2418 | + </blockTable> |
2419 | + <blockTable colWidths="568.0" style="Table3"> |
2420 | + <tr> |
2421 | + <td> |
2422 | + <blockTable colWidths="446.0,116.0" style="Table7"> |
2423 | + <tr> |
2424 | + <td> |
2425 | + <para style="P16">[[voucher.partner_id.name]]</para> |
2426 | + </td> |
2427 | + <td> |
2428 | + <para style="P16">[[ formatLang(voucher.date , date=True) or '' ]]</para> |
2429 | + </td> |
2430 | + </tr> |
2431 | + </blockTable> |
2432 | + <blockTable colWidths="82.0,185.0,89.0,76.0,52.0,78.0" style="Table8"> |
2433 | + <tr> |
2434 | + <td> |
2435 | + <para style="P4">Due Date</para> |
2436 | + </td> |
2437 | + <td> |
2438 | + <para style="P4">Description</para> |
2439 | + </td> |
2440 | + <td> |
2441 | + <para style="P4">Original Amount</para> |
2442 | + </td> |
2443 | + <td> |
2444 | + <para style="P4">Balance Due</para> |
2445 | + </td> |
2446 | + <td> |
2447 | + <para style="P4">Discount</para> |
2448 | + </td> |
2449 | + <td> |
2450 | + <para style="P4">Payment</para> |
2451 | + </td> |
2452 | + </tr> |
2453 | + <tr> |
2454 | + <td> |
2455 | + <para style="P19">[[ repeatIn(get_lines(voucher.line_dr_ids),'l') ]] [[ formatLang(l['date_original'] ,date=True) or '' ]]</para> |
2456 | + </td> |
2457 | + <td> |
2458 | + <para style="P19">[[ l['name'] ]]</para> |
2459 | + </td> |
2460 | + <td> |
2461 | + <para style="P19">[[ formatLang (l['amount_original']) ]]</para> |
2462 | + </td> |
2463 | + <td> |
2464 | + <para style="P19">[[ formatLang (l['amount_due']) ]]</para> |
2465 | + </td> |
2466 | + <td> |
2467 | + <para style="P19"> |
2468 | + <font color="white"> </font> |
2469 | + </para> |
2470 | + </td> |
2471 | + <td> |
2472 | + <para style="P19">[[ formatLang (l['amount']) ]]</para> |
2473 | + </td> |
2474 | + </tr> |
2475 | + </blockTable> |
2476 | + <blockTable colWidths="485.0,77.0" style="Table9"> |
2477 | + <tr> |
2478 | + <td> |
2479 | + <para style="P17">Check Amount</para> |
2480 | + </td> |
2481 | + <td> |
2482 | + <para style="P16">[[ formatLang (voucher.amount) ]]</para> |
2483 | + </td> |
2484 | + </tr> |
2485 | + </blockTable> |
2486 | + <para style="P3"> |
2487 | + <font color="white"> </font> |
2488 | + </para> |
2489 | + </td> |
2490 | + </tr> |
2491 | + </blockTable> |
2492 | + <para style="P2"> |
2493 | + <font color="white"> </font> |
2494 | + </para> |
2495 | + </story> |
2496 | +</document> |
2497 | |
2498 | === added file 'account_check_writing/report/check_print_top.rml' |
2499 | --- account_check_writing/report/check_print_top.rml 1970-01-01 00:00:00 +0000 |
2500 | +++ account_check_writing/report/check_print_top.rml 2011-10-06 15:19:26 +0000 |
2501 | @@ -0,0 +1,342 @@ |
2502 | +<?xml version="1.0"?> |
2503 | +<document filename="test.pdf"> |
2504 | + <template pageSize="(612.0, 792.0)" title="Test" author="Martin Simon" allowSplitting="20"> |
2505 | + <pageTemplate id="first"> |
2506 | + <frame id="first" x1="13.0" y1="0.0" width="567" height="841"/> |
2507 | + </pageTemplate> |
2508 | + </template> |
2509 | + <stylesheet> |
2510 | + <blockTableStyle id="Standard_Outline"> |
2511 | + <blockAlignment value="LEFT"/> |
2512 | + <blockValign value="TOP"/> |
2513 | + </blockTableStyle> |
2514 | + <blockTableStyle id="Table1"> |
2515 | + <blockAlignment value="LEFT"/> |
2516 | + <blockValign value="TOP"/> |
2517 | + </blockTableStyle> |
2518 | + <blockTableStyle id="Table4"> |
2519 | + <blockAlignment value="LEFT"/> |
2520 | + <blockValign value="TOP"/> |
2521 | + </blockTableStyle> |
2522 | + <blockTableStyle id="Table5"> |
2523 | + <blockAlignment value="LEFT"/> |
2524 | + <blockValign value="TOP"/> |
2525 | + </blockTableStyle> |
2526 | + <blockTableStyle id="Table12"> |
2527 | + <blockAlignment value="LEFT"/> |
2528 | + <blockValign value="TOP"/> |
2529 | + </blockTableStyle> |
2530 | + <blockTableStyle id="Table2"> |
2531 | + <blockAlignment value="LEFT"/> |
2532 | + <blockValign value="TOP"/> |
2533 | + </blockTableStyle> |
2534 | + <blockTableStyle id="Table6"> |
2535 | + <blockAlignment value="LEFT"/> |
2536 | + <blockValign value="TOP"/> |
2537 | + </blockTableStyle> |
2538 | + <blockTableStyle id="Table10"> |
2539 | + <blockAlignment value="LEFT"/> |
2540 | + <blockValign value="TOP"/> |
2541 | + </blockTableStyle> |
2542 | + <blockTableStyle id="Table11"> |
2543 | + <blockAlignment value="LEFT"/> |
2544 | + <blockValign value="TOP"/> |
2545 | + </blockTableStyle> |
2546 | + <blockTableStyle id="Table3"> |
2547 | + <blockAlignment value="LEFT"/> |
2548 | + <blockValign value="TOP"/> |
2549 | + </blockTableStyle> |
2550 | + <blockTableStyle id="Table7"> |
2551 | + <blockAlignment value="LEFT"/> |
2552 | + <blockValign value="TOP"/> |
2553 | + </blockTableStyle> |
2554 | + <blockTableStyle id="Table8"> |
2555 | + <blockAlignment value="LEFT"/> |
2556 | + <blockValign value="TOP"/> |
2557 | + </blockTableStyle> |
2558 | + <blockTableStyle id="Table9"> |
2559 | + <blockAlignment value="LEFT"/> |
2560 | + <blockValign value="TOP"/> |
2561 | + </blockTableStyle> |
2562 | + <initialize> |
2563 | + <paraStyle name="all" alignment="justify"/> |
2564 | + </initialize> |
2565 | + <paraStyle name="P1" rightIndent="-1.0" leftIndent="0.0" fontName="Helvetica"/> |
2566 | + <paraStyle name="P2" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica"/> |
2567 | + <paraStyle name="P3" fontName="Helvetica"/> |
2568 | + <paraStyle name="P4" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT"/> |
2569 | + <paraStyle name="P36" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT"/> |
2570 | + <paraStyle name="P5" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="RIGHT"/> |
2571 | + <paraStyle name="P6" fontName="Helvetica-Bold" fontSize="9.0" leading="11"/> |
2572 | + <paraStyle name="P7" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT"/> |
2573 | + <paraStyle name="P8" fontName="Helvetica" fontSize="9.0" leading="11"/> |
2574 | + <paraStyle name="P9" fontName="Helvetica" fontSize="10.0" leading="13"/> |
2575 | + <paraStyle name="P10" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="RIGHT"/> |
2576 | + <paraStyle name="P11" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="LEFT"/> |
2577 | + <paraStyle name="P12" fontName="Helvetica" fontSize="12.0" leading="15"/> |
2578 | + <paraStyle name="P13" fontName="Helvetica"/> |
2579 | + <paraStyle name="P14" fontName="Helvetica" fontSize="10.0" leading="13"/> |
2580 | + <paraStyle name="P15" fontName="Helvetica" fontSize="10.0" leading="13"/> |
2581 | + <paraStyle name="P16" fontName="Helvetica-Bold" fontSize="9.0" leading="11"/> |
2582 | + <paraStyle name="P17" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT"/> |
2583 | + <paraStyle name="P18" fontName="Helvetica" fontSize="9.0" leading="11"/> |
2584 | + <paraStyle name="P19" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT"/> |
2585 | + <paraStyle name="P37" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT"/> |
2586 | + <paraStyle name="P20" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT"/> |
2587 | + <paraStyle name="P21" fontName="Helvetica" fontSize="8.0" leading="10"/> |
2588 | + <paraStyle name="P22" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT"/> |
2589 | + <paraStyle name="P23" fontName="Helvetica-Bold" fontSize="8.0" leading="10"/> |
2590 | + <paraStyle name="P24" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT"/> |
2591 | + <paraStyle name="P26" fontName="Helvetica" fontSize="10.0" leading="13" leftIndent="7.0"/> |
2592 | + <paraStyle name="P35" fontName="Helvetica" fontSize="10.0" leading="13" leftIndent="480.0"/> |
2593 | + <paraStyle name="Standard" fontName="Helvetica"/> |
2594 | + <paraStyle name="Heading" fontName="Helvetica" fontSize="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/> |
2595 | + <paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/> |
2596 | + <paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/> |
2597 | + <paraStyle name="Caption" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="6.0" spaceAfter="6.0"/> |
2598 | + <paraStyle name="Index" fontName="Helvetica"/> |
2599 | + <paraStyle name="Table Contents" fontName="Helvetica"/> |
2600 | + <paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER"/> |
2601 | + <images/> |
2602 | + </stylesheet> |
2603 | + <story> |
2604 | + <para style="P1">[[repeatIn(objects,'voucher')]] [[setLang(find_lang())]]</para> |
2605 | + <blockTable colWidths="568.0" style="Table1"> |
2606 | + <tr> |
2607 | + <td> |
2608 | + <blockTable colWidths="425.0,177.0" rowHeights="107.50,25.5" style="Table4"> |
2609 | + <tr> |
2610 | + <td> |
2611 | + <para style="P6"> |
2612 | + <font color="white"> </font> |
2613 | + </para> |
2614 | + </td> |
2615 | + <td> |
2616 | + <para style="P6"> |
2617 | + <font color="white"> </font> |
2618 | + </para> |
2619 | + </td> |
2620 | + </tr> |
2621 | + <tr> |
2622 | + <td> |
2623 | + <para style="P6"> |
2624 | + <font color="white"> </font> |
2625 | + </para> |
2626 | + </td> |
2627 | + <td> |
2628 | + <para style="P9">[[ formatLang(voucher.date , date=True) or '' ]] [[ chk_no(voucher) or ' ']]</para> |
2629 | + </td> |
2630 | + </tr> |
2631 | + </blockTable> |
2632 | + <blockTable colWidths="54.0,425.0,85.0" rowHeights="75.5" style="Table4"> |
2633 | + <tr> |
2634 | + <td> |
2635 | + <para style="P6"> |
2636 | + <font color="white"> </font> |
2637 | + </para> |
2638 | + </td> |
2639 | + <td> |
2640 | + <para style="P9">[[ voucher.partner_id.name ]]</para> |
2641 | + <para style="P15">[[ voucher.partner_id.address and voucher.partner_id.address[0] and voucher.partner_id.address[0].street or removeParentNode('para') ]]</para> |
2642 | + <para style="P15">[[ voucher.partner_id.address and voucher.partner_id.address[0] and voucher.partner_id.address[0].street2 or removeParentNode('para') ]]</para> |
2643 | + <para style="P15">[[ get_zip_line(voucher.partner_id.address) ]] </para> |
2644 | + <para style="P15">[[ voucher.partner_id.address[0].country_id.name]]</para> |
2645 | + </td> |
2646 | + <td> |
2647 | + <para style="P12">[[ formatLang (voucher.amount) ]]</para> |
2648 | + </td> |
2649 | + </tr> |
2650 | + </blockTable> |
2651 | + <blockTable colWidths="550.0" rowHeights="73" style="Table5"> |
2652 | + <tr> |
2653 | + <td> |
2654 | + <para style="P9">[[ fill_stars(voucher.amount_in_word) ]]</para> |
2655 | + </td> |
2656 | + </tr> |
2657 | + </blockTable> |
2658 | + <blockTable colWidths="25.0,350,150" rowHeights="60.5" style="Table12"> |
2659 | + <tr> |
2660 | + <td> |
2661 | + <para style="P3"> |
2662 | + <font color="white"> </font> |
2663 | + </para> |
2664 | + </td> |
2665 | + <td> |
2666 | + <para style="P15">[[ voucher.name ]]</para> |
2667 | + </td> |
2668 | + <td> |
2669 | + <para style="P3"> |
2670 | + <font color="white"> </font> |
2671 | + </para> |
2672 | + </td> |
2673 | + </tr> |
2674 | + </blockTable> |
2675 | + <para style="P3"> |
2676 | + <font color="white"> </font> |
2677 | + </para> |
2678 | + </td> |
2679 | + </tr> |
2680 | + </blockTable> |
2681 | + <blockTable colWidths="568.0" style="Table2" rowHeights="255"> |
2682 | + <tr> |
2683 | + <td> |
2684 | + <blockTable colWidths="445.0,117.0" style="Table6"> |
2685 | + <tr> |
2686 | + <td> |
2687 | + <para style="P16">[[voucher.partner_id.name]]</para> |
2688 | + </td> |
2689 | + <td> |
2690 | + <para style="P16">[[ formatLang(voucher.date , date=True) or '' ]] [[ chk_no(voucher) or ' ']]</para> |
2691 | + </td> |
2692 | + </tr> |
2693 | + </blockTable> |
2694 | + <blockTable colWidths="81.0,100.0,86,83.0,81.0,54.0,78.0" style="Table10"> |
2695 | + <tr> |
2696 | + <td> |
2697 | + <para style="P4">Due Date</para> |
2698 | + </td> |
2699 | + <td> |
2700 | + <para style="P4">Invoice</para> |
2701 | + </td> |
2702 | + <td> |
2703 | + <para style="P4">Purchase Order</para> |
2704 | + </td> |
2705 | + <td> |
2706 | + <para style="P36">Original Amount</para> |
2707 | + </td> |
2708 | + <td> |
2709 | + <para style="P4">Balance Due</para> |
2710 | + </td> |
2711 | + <td> |
2712 | + <para style="P4">Discount</para> |
2713 | + </td> |
2714 | + <td> |
2715 | + <para style="P4">Payment</para> |
2716 | + </td> |
2717 | + </tr> |
2718 | + <tr> |
2719 | + <td> |
2720 | + <para style="P19">[[ repeatIn(get_lines(voucher.line_ids),'l') ]] [[ formatLang(l['date_original'] ,date=True) or '' ]]</para> |
2721 | + </td> |
2722 | + <td> |
2723 | + <para style="P19">[[ l['invoice'] ]]</para> |
2724 | + </td> |
2725 | + <td> |
2726 | + <para style="P19">[[ l['pur_order'] ]]</para> |
2727 | + </td> |
2728 | + <td> |
2729 | + <para style="P37">[[formatLang( l['amount_original']) ]]</para> |
2730 | + </td> |
2731 | + <td> |
2732 | + <para style="P19">[[ formatLang( l['amount_unreconciled']) ]]</para> |
2733 | + </td> |
2734 | + <td> |
2735 | + <para style="P19"> |
2736 | + [[ formatLang( l['discount_used']) ]] |
2737 | + </para> |
2738 | + </td> |
2739 | + <td> |
2740 | + <para style="P19">[[ formatLang (l['amount']) ]]</para> |
2741 | + </td> |
2742 | + </tr> |
2743 | + </blockTable> |
2744 | + <blockTable colWidths="485.0,77.0" style="Table11"> |
2745 | + <tr> |
2746 | + <td> |
2747 | + <para style="P24">Check Amount</para> |
2748 | + </td> |
2749 | + <td> |
2750 | + <para style="P23">[[ formatLang (voucher.amount) ]]</para> |
2751 | + </td> |
2752 | + </tr> |
2753 | + </blockTable> |
2754 | + <para style="P3"> |
2755 | + <font color="white"> </font> |
2756 | + </para> |
2757 | + </td> |
2758 | + </tr> |
2759 | + </blockTable> |
2760 | + <blockTable colWidths="568.0" style="Table3"> |
2761 | + <tr> |
2762 | + <td> |
2763 | + <blockTable colWidths="446.0,116.0" style="Table7"> |
2764 | + <tr> |
2765 | + <td> |
2766 | + <para style="P16">[[voucher.partner_id.name]]</para> |
2767 | + </td> |
2768 | + <td> |
2769 | + <para style="P16">[[ formatLang(voucher.date , date=True) or '' ]] [[ chk_no(voucher) or ' ']]</para> |
2770 | + </td> |
2771 | + </tr> |
2772 | + </blockTable> |
2773 | + <blockTable colWidths="82.0,100.0,85.0,89.0,76.0,52.0,78.0" style="Table8"> |
2774 | + <tr> |
2775 | + <td> |
2776 | + <para style="P4">Due Date</para> |
2777 | + </td> |
2778 | + <td> |
2779 | + <para style="P4">Invoice</para> |
2780 | + </td> |
2781 | + <td> |
2782 | + <para style="P4">Purchase Order</para> |
2783 | + </td> |
2784 | + <td> |
2785 | + <para style="P36">Original Amount</para> |
2786 | + </td> |
2787 | + <td> |
2788 | + <para style="P4">Balance Due</para> |
2789 | + </td> |
2790 | + <td> |
2791 | + <para style="P4">Discount</para> |
2792 | + </td> |
2793 | + <td> |
2794 | + <para style="P4">Payment</para> |
2795 | + </td> |
2796 | + </tr> |
2797 | + <tr> |
2798 | + <td> |
2799 | + <para style="P19">[[ repeatIn(get_lines(voucher.line_ids),'l') ]] [[ formatLang(l['date_original'] ,date=True) or '' ]]</para> |
2800 | + </td> |
2801 | + <td> |
2802 | + <para style="P19">[[ l['invoice'] ]]</para> |
2803 | + </td> |
2804 | + <td> |
2805 | + <para style="P19">[[ l['pur_order'] ]]</para> |
2806 | + </td> |
2807 | + <td> |
2808 | + <para style="P37">[[ formatLang (l['amount_original']) ]]</para> |
2809 | + </td> |
2810 | + <td> |
2811 | + <para style="P19">[[ formatLang (l['amount_unreconciled']) ]]</para> |
2812 | + </td> |
2813 | + <td> |
2814 | + <para style="P19"> |
2815 | + [[ formatLang( l['discount_used']) ]] |
2816 | + </para> |
2817 | + </td> |
2818 | + <td> |
2819 | + <para style="P19">[[ formatLang (l['amount']) ]]</para> |
2820 | + </td> |
2821 | + </tr> |
2822 | + </blockTable> |
2823 | + <blockTable colWidths="485.0,77.0" style="Table9"> |
2824 | + <tr> |
2825 | + <td> |
2826 | + <para style="P17">Check Amount</para> |
2827 | + </td> |
2828 | + <td> |
2829 | + <para style="P16">[[ formatLang (voucher.amount) ]]</para> |
2830 | + </td> |
2831 | + </tr> |
2832 | + </blockTable> |
2833 | + <para style="P3"> |
2834 | + <font color="white"> </font> |
2835 | + </para> |
2836 | + </td> |
2837 | + </tr> |
2838 | + </blockTable> |
2839 | + <para style="P2"> |
2840 | + <font color="white"> </font> |
2841 | + </para> |
2842 | + </story> |
2843 | +</document> |
2844 | |
2845 | === added file 'account_check_writing/report/check_print_top_old.rml' |
2846 | --- account_check_writing/report/check_print_top_old.rml 1970-01-01 00:00:00 +0000 |
2847 | +++ account_check_writing/report/check_print_top_old.rml 2011-10-06 15:19:26 +0000 |
2848 | @@ -0,0 +1,322 @@ |
2849 | +<?xml version="1.0"?> |
2850 | +<document filename="test.pdf"> |
2851 | + <template pageSize="(612.0, 792.0)" title="Test" author="Martin Simon" allowSplitting="20"> |
2852 | + <pageTemplate id="first"> |
2853 | + <frame id="first" x1="13.0" y1="0.0" width="567" height="841"/> |
2854 | + </pageTemplate> |
2855 | + </template> |
2856 | + <stylesheet> |
2857 | + <blockTableStyle id="Standard_Outline"> |
2858 | + <blockAlignment value="LEFT"/> |
2859 | + <blockValign value="TOP"/> |
2860 | + </blockTableStyle> |
2861 | + <blockTableStyle id="Table1"> |
2862 | + <blockAlignment value="LEFT"/> |
2863 | + <blockValign value="TOP"/> |
2864 | + </blockTableStyle> |
2865 | + <blockTableStyle id="Table4"> |
2866 | + <blockAlignment value="LEFT"/> |
2867 | + <blockValign value="TOP"/> |
2868 | + </blockTableStyle> |
2869 | + <blockTableStyle id="Table5"> |
2870 | + <blockAlignment value="LEFT"/> |
2871 | + <blockValign value="TOP"/> |
2872 | + </blockTableStyle> |
2873 | + <blockTableStyle id="Table12"> |
2874 | + <blockAlignment value="LEFT"/> |
2875 | + <blockValign value="TOP"/> |
2876 | + </blockTableStyle> |
2877 | + <blockTableStyle id="Table2"> |
2878 | + <blockAlignment value="LEFT"/> |
2879 | + <blockValign value="TOP"/> |
2880 | + </blockTableStyle> |
2881 | + <blockTableStyle id="Table6"> |
2882 | + <blockAlignment value="LEFT"/> |
2883 | + <blockValign value="TOP"/> |
2884 | + </blockTableStyle> |
2885 | + <blockTableStyle id="Table10"> |
2886 | + <blockAlignment value="LEFT"/> |
2887 | + <blockValign value="TOP"/> |
2888 | + </blockTableStyle> |
2889 | + <blockTableStyle id="Table11"> |
2890 | + <blockAlignment value="LEFT"/> |
2891 | + <blockValign value="TOP"/> |
2892 | + </blockTableStyle> |
2893 | + <blockTableStyle id="Table3"> |
2894 | + <blockAlignment value="LEFT"/> |
2895 | + <blockValign value="TOP"/> |
2896 | + </blockTableStyle> |
2897 | + <blockTableStyle id="Table7"> |
2898 | + <blockAlignment value="LEFT"/> |
2899 | + <blockValign value="TOP"/> |
2900 | + </blockTableStyle> |
2901 | + <blockTableStyle id="Table8"> |
2902 | + <blockAlignment value="LEFT"/> |
2903 | + <blockValign value="TOP"/> |
2904 | + </blockTableStyle> |
2905 | + <blockTableStyle id="Table9"> |
2906 | + <blockAlignment value="LEFT"/> |
2907 | + <blockValign value="TOP"/> |
2908 | + </blockTableStyle> |
2909 | + <initialize> |
2910 | + <paraStyle name="all" alignment="justify"/> |
2911 | + </initialize> |
2912 | + <paraStyle name="P1" rightIndent="-1.0" leftIndent="0.0" fontName="Helvetica"/> |
2913 | + <paraStyle name="P2" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica"/> |
2914 | + <paraStyle name="P3" fontName="Helvetica"/> |
2915 | + <paraStyle name="P4" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT"/> |
2916 | + <paraStyle name="P5" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="RIGHT"/> |
2917 | + <paraStyle name="P6" fontName="Helvetica-Bold" fontSize="9.0" leading="11"/> |
2918 | + <paraStyle name="P7" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT"/> |
2919 | + <paraStyle name="P8" fontName="Helvetica" fontSize="9.0" leading="11"/> |
2920 | + <paraStyle name="P9" fontName="Helvetica" fontSize="10.0" leading="13"/> |
2921 | + <paraStyle name="P10" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="RIGHT"/> |
2922 | + <paraStyle name="P11" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="LEFT"/> |
2923 | + <paraStyle name="P12" fontName="Helvetica" fontSize="12.0" leading="15"/> |
2924 | + <paraStyle name="P13" fontName="Helvetica"/> |
2925 | + <paraStyle name="P14" fontName="Helvetica" fontSize="10.0" leading="13"/> |
2926 | + <paraStyle name="P15" fontName="Helvetica" fontSize="10.0" leading="13"/> |
2927 | + <paraStyle name="P16" fontName="Helvetica-Bold" fontSize="9.0" leading="11"/> |
2928 | + <paraStyle name="P17" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT"/> |
2929 | + <paraStyle name="P18" fontName="Helvetica" fontSize="9.0" leading="11"/> |
2930 | + <paraStyle name="P19" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT"/> |
2931 | + <paraStyle name="P20" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT"/> |
2932 | + <paraStyle name="P21" fontName="Helvetica" fontSize="8.0" leading="10"/> |
2933 | + <paraStyle name="P22" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT"/> |
2934 | + <paraStyle name="P23" fontName="Helvetica-Bold" fontSize="8.0" leading="10"/> |
2935 | + <paraStyle name="P24" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT"/> |
2936 | + <paraStyle name="Standard" fontName="Helvetica"/> |
2937 | + <paraStyle name="Heading" fontName="Helvetica" fontSize="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/> |
2938 | + <paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/> |
2939 | + <paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/> |
2940 | + <paraStyle name="Caption" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="6.0" spaceAfter="6.0"/> |
2941 | + <paraStyle name="Index" fontName="Helvetica"/> |
2942 | + <paraStyle name="Table Contents" fontName="Helvetica"/> |
2943 | + <paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER"/> |
2944 | + <images/> |
2945 | + </stylesheet> |
2946 | + <story> |
2947 | + <para style="P1">[[repeatIn(objects,'voucher')]]</para> |
2948 | + <blockTable colWidths="568.0" style="Table1"> |
2949 | + <tr> |
2950 | + <td> |
2951 | + <blockTable colWidths="495.0,67.0" rowHeights="107.50,25.5" style="Table4"> |
2952 | + <tr> |
2953 | + <td> |
2954 | + <para style="P6"> |
2955 | + <font color="white"> </font> |
2956 | + </para> |
2957 | + </td> |
2958 | + <td> |
2959 | + <para style="P6"> |
2960 | + <font color="white"> </font> |
2961 | + </para> |
2962 | + </td> |
2963 | + </tr> |
2964 | + <tr> |
2965 | + <td> |
2966 | + <para style="P6"> |
2967 | + <font color="white"> </font> |
2968 | + </para> |
2969 | + </td> |
2970 | + <td> |
2971 | + <para style="P9">[[ formatLang(voucher.date , date=True) or '' ]]</para> |
2972 | + </td> |
2973 | + </tr> |
2974 | + </blockTable> |
2975 | + <blockTable colWidths="54.0,425.0,85.0" rowHeights="25.5" style="Table4"> |
2976 | + <tr> |
2977 | + <td> |
2978 | + <para style="P6"> |
2979 | + <font color="white"> </font> |
2980 | + </para> |
2981 | + </td> |
2982 | + <td> |
2983 | + <para style="P9">[[ voucher.partner_id.name ]] </para> |
2984 | + </td> |
2985 | + <td> |
2986 | + <para style="P12">[[ formatLang (voucher.amount) ]]</para> |
2987 | + </td> |
2988 | + </tr> |
2989 | + </blockTable> |
2990 | + <blockTable colWidths="550.0" rowHeights="73" style="Table5"> |
2991 | + <tr> |
2992 | + <td> |
2993 | + <para style="P9">[[ fill_stars(voucher.amount_in_word) ]]</para> |
2994 | + </td> |
2995 | + </tr> |
2996 | + </blockTable> |
2997 | + <blockTable colWidths="25.0,350,150" rowHeights="60.5" style="Table12"> |
2998 | + <tr> |
2999 | + <td> |
3000 | + <para style="P3"> |
3001 | + <font color="white"> </font> |
3002 | + </para> |
3003 | + </td> |
3004 | + <td> |
3005 | + <para style="P15">[[ voucher.name ]]</para> |
3006 | + </td> |
3007 | + <td> |
3008 | + <para style="P3"> |
3009 | + <font color="white"> </font> |
3010 | + </para> |
3011 | + </td> |
3012 | + </tr> |
3013 | + </blockTable> |
3014 | + <para style="P3"> |
3015 | + <font color="white"> </font> |
3016 | + </para> |
3017 | + </td> |
3018 | + </tr> |
3019 | + </blockTable> |
3020 | + <blockTable colWidths="568.0" style="Table2" rowHeights="255"> |
3021 | + <tr> |
3022 | + <td> |
3023 | + <blockTable colWidths="445.0,117.0" style="Table6"> |
3024 | + <tr> |
3025 | + <td> |
3026 | + <para style="P16">[[voucher.partner_id.name]]</para> |
3027 | + </td> |
3028 | + <td> |
3029 | + <para style="P16">[[ formatLang(voucher.date , date=True) or '' ]]</para> |
3030 | + </td> |
3031 | + </tr> |
3032 | + </blockTable> |
3033 | + <blockTable colWidths="81.0,186.0,83.0,81.0,54.0,78.0" style="Table10"> |
3034 | + <tr> |
3035 | + <td> |
3036 | + <para style="P4">Due Date</para> |
3037 | + </td> |
3038 | + <td> |
3039 | + <para style="P4">Description</para> |
3040 | + </td> |
3041 | + <td> |
3042 | + <para style="P4">Original Amount</para> |
3043 | + </td> |
3044 | + <td> |
3045 | + <para style="P4">Balance Due</para> |
3046 | + </td> |
3047 | + <td> |
3048 | + <para style="P4">Discount</para> |
3049 | + </td> |
3050 | + <td> |
3051 | + <para style="P4">Payment</para> |
3052 | + </td> |
3053 | + </tr> |
3054 | + <tr> |
3055 | + <td> |
3056 | + <para style="P19">[[ repeatIn(get_lines(voucher.line_dr_ids),'l') ]] [[ formatLang(l['date_original'] ,date=True) or '' ]]</para> |
3057 | + </td> |
3058 | + <td> |
3059 | + <para style="P19">[[ l['name'] ]]</para> |
3060 | + </td> |
3061 | + <td> |
3062 | + <para style="P19">[[formatLang( l['amount_original']) ]]</para> |
3063 | + </td> |
3064 | + <td> |
3065 | + <para style="P19">[[ formatLang( l['amount_due']) ]]</para> |
3066 | + </td> |
3067 | + <td> |
3068 | + <para style="P19"> |
3069 | + <font color="white"> </font> |
3070 | + </para> |
3071 | + </td> |
3072 | + <td> |
3073 | + <para style="P19">[[ formatLang (l['amount']) ]]</para> |
3074 | + </td> |
3075 | + </tr> |
3076 | + </blockTable> |
3077 | + <blockTable colWidths="485.0,77.0" style="Table11"> |
3078 | + <tr> |
3079 | + <td> |
3080 | + <para style="P24">Check Amount</para> |
3081 | + </td> |
3082 | + <td> |
3083 | + <para style="P23">[[ formatLang (voucher.amount) ]]</para> |
3084 | + </td> |
3085 | + </tr> |
3086 | + </blockTable> |
3087 | + <para style="P3"> |
3088 | + <font color="white"> </font> |
3089 | + </para> |
3090 | + </td> |
3091 | + </tr> |
3092 | + </blockTable> |
3093 | + <blockTable colWidths="568.0" style="Table3"> |
3094 | + <tr> |
3095 | + <td> |
3096 | + <blockTable colWidths="446.0,116.0" style="Table7"> |
3097 | + <tr> |
3098 | + <td> |
3099 | + <para style="P16">[[voucher.partner_id.name]]</para> |
3100 | + </td> |
3101 | + <td> |
3102 | + <para style="P16">[[ formatLang(voucher.date , date=True) or '' ]]</para> |
3103 | + </td> |
3104 | + </tr> |
3105 | + </blockTable> |
3106 | + <blockTable colWidths="82.0,185.0,89.0,76.0,52.0,78.0" style="Table8"> |
3107 | + <tr> |
3108 | + <td> |
3109 | + <para style="P4">Due Date</para> |
3110 | + </td> |
3111 | + <td> |
3112 | + <para style="P4">Description</para> |
3113 | + </td> |
3114 | + <td> |
3115 | + <para style="P4">Original Amount</para> |
3116 | + </td> |
3117 | + <td> |
3118 | + <para style="P4">Balance Due</para> |
3119 | + </td> |
3120 | + <td> |
3121 | + <para style="P4">Discount</para> |
3122 | + </td> |
3123 | + <td> |
3124 | + <para style="P4">Payment</para> |
3125 | + </td> |
3126 | + </tr> |
3127 | + <tr> |
3128 | + <td> |
3129 | + <para style="P19">[[ repeatIn(get_lines(voucher.line_dr_ids),'l') ]] [[ formatLang(l['date_original'] ,date=True) or '' ]]</para> |
3130 | + </td> |
3131 | + <td> |
3132 | + <para style="P19">[[ l['name'] ]]</para> |
3133 | + </td> |
3134 | + <td> |
3135 | + <para style="P19">[[ formatLang (l['amount_original']) ]]</para> |
3136 | + </td> |
3137 | + <td> |
3138 | + <para style="P19">[[ formatLang (l['amount_due']) ]]</para> |
3139 | + </td> |
3140 | + <td> |
3141 | + <para style="P19"> |
3142 | + <font color="white"> </font> |
3143 | + </para> |
3144 | + </td> |
3145 | + <td> |
3146 | + <para style="P19">[[ formatLang (l['amount']) ]]</para> |
3147 | + </td> |
3148 | + </tr> |
3149 | + </blockTable> |
3150 | + <blockTable colWidths="485.0,77.0" style="Table9"> |
3151 | + <tr> |
3152 | + <td> |
3153 | + <para style="P17">Check Amount</para> |
3154 | + </td> |
3155 | + <td> |
3156 | + <para style="P16">[[ formatLang (voucher.amount) ]]</para> |
3157 | + </td> |
3158 | + </tr> |
3159 | + </blockTable> |
3160 | + <para style="P3"> |
3161 | + <font color="white"> </font> |
3162 | + </para> |
3163 | + </td> |
3164 | + </tr> |
3165 | + </blockTable> |
3166 | + <para style="P2"> |
3167 | + <font color="white"> </font> |
3168 | + </para> |
3169 | + </story> |
3170 | +</document> |
3171 | |
3172 | === added directory 'account_check_writing/wizard' |
3173 | === added file 'account_check_writing/wizard/__init__.py' |
3174 | --- account_check_writing/wizard/__init__.py 1970-01-01 00:00:00 +0000 |
3175 | +++ account_check_writing/wizard/__init__.py 2011-10-06 15:19:26 +0000 |
3176 | @@ -0,0 +1,25 @@ |
3177 | +# -*- coding: utf-8 -*- |
3178 | +############################################################################## |
3179 | +# |
3180 | +# OpenERP, Open Source Management Solution |
3181 | +# Copyright (C) 2011 NovaPoint Group LLC (<http://www.novapointgroup.com>) |
3182 | +# Copyright (C) 2004-2010 OpenERP SA (<http://www.openerp.com>) |
3183 | +# |
3184 | +# This program is free software: you can redistribute it and/or modify |
3185 | +# it under the terms of the GNU General Public License as published by |
3186 | +# the Free Software Foundation, either version 3 of the License, or |
3187 | +# (at your option) any later version. |
3188 | +# |
3189 | +# This program is distributed in the hope that it will be useful, |
3190 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
3191 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3192 | +# GNU General Public License for more details. |
3193 | +# |
3194 | +# You should have received a copy of the GNU General Public License |
3195 | +# along with this program. If not, see <http://www.gnu.org/licenses/> |
3196 | +# |
3197 | +############################################################################## |
3198 | + |
3199 | + |
3200 | +import check_print |
3201 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
3202 | |
3203 | === added file 'account_check_writing/wizard/check_print.py' |
3204 | --- account_check_writing/wizard/check_print.py 1970-01-01 00:00:00 +0000 |
3205 | +++ account_check_writing/wizard/check_print.py 2011-10-06 15:19:26 +0000 |
3206 | @@ -0,0 +1,307 @@ |
3207 | +# -*- coding: utf-8 -*- |
3208 | +############################################################################## |
3209 | +# |
3210 | +# OpenERP, Open Source Management Solution |
3211 | +# Copyright (C) 2011 NovaPoint Group LLC (<http://www.novapointgroup.com>) |
3212 | +# Copyright (C) 2004-2010 OpenERP SA (<http://www.openerp.com>) |
3213 | +# |
3214 | +# This program is free software: you can redistribute it and/or modify |
3215 | +# it under the terms of the GNU General Public License as published by |
3216 | +# the Free Software Foundation, either version 3 of the License, or |
3217 | +# (at your option) any later version. |
3218 | +# |
3219 | +# This program is distributed in the hope that it will be useful, |
3220 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
3221 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3222 | +# GNU General Public License for more details. |
3223 | +# |
3224 | +# You should have received a copy of the GNU General Public License |
3225 | +# along with this program. If not, see <http://www.gnu.org/licenses/> |
3226 | +# |
3227 | +############################################################################## |
3228 | +from osv import osv,fields |
3229 | +from tools.translate import _ |
3230 | +import netsvc |
3231 | +LOGGER = netsvc.Logger() |
3232 | + |
3233 | + |
3234 | + |
3235 | +class print_check(osv.osv_memory): |
3236 | + _name = "print.check" |
3237 | + _description = "Print Check" |
3238 | + _columns = { |
3239 | + 'name': fields.char('Next Check Number',size=32, help='Next check number'), |
3240 | + 'nxt_seq': fields.char('Next Check Number',size=32, help='Next check number'), |
3241 | + 'new_no': fields.integer('Update Check Number', help= 'Enter new check number here if you wish to update'), |
3242 | + 'preprint_msg': fields.text('Message'), |
3243 | + 'status': fields.selection([ ('voided', 'Voided'), |
3244 | + ('stop_pay', 'Stop Pay Placed'), |
3245 | + ('lost', 'Lost'), |
3246 | + ('unk', 'Unknown')], 'Status'), |
3247 | + 'pre_printed': fields.boolean('Pre Printed'), |
3248 | + 'state':fields.selection([ ('print', 'print'), |
3249 | + ('printed_reprint', 'printed_reprint'), |
3250 | + ('printed', 'printed'), |
3251 | + ('reprint_new', 'reprint_new'), |
3252 | + ('reprint', 'reprint'), |
3253 | + ('update_check_no', 'update_check_no'), |
3254 | + ('do_update', 'do_update'), |
3255 | + ('do_action', 'do_action'), |
3256 | + ('top', 'top'), |
3257 | + ('middle', 'middle'), |
3258 | + ('bottom', 'bottom'),], 'State'), |
3259 | + 'print_new': fields.boolean('Print a New Check'), |
3260 | + 'reprint': fields.boolean('Reprint existing check'), |
3261 | + 'update_check_no': fields.boolean('Update Supplier Payment’s Check No'), |
3262 | + |
3263 | + } |
3264 | + def get_id(self, cr, uid, sequence_id, test='id', context=None): |
3265 | + ''' |
3266 | + Function to find next sequence number |
3267 | + ''' |
3268 | + seq_pool = self.pool.get('ir.sequence') |
3269 | + assert test in ('code','id') |
3270 | + company_id = self.pool.get('res.users').read(cr, uid, uid, ['company_id'], context=context)['company_id'][0] or None |
3271 | + cr.execute('''SELECT id, number_next, prefix, suffix, padding |
3272 | + FROM ir_sequence |
3273 | + WHERE %s=%%s |
3274 | + AND active=true |
3275 | + AND (company_id = %%s or company_id is NULL) |
3276 | + ORDER BY company_id, id |
3277 | + FOR UPDATE NOWAIT''' % test, |
3278 | + (sequence_id, company_id)) |
3279 | + res = cr.dictfetchone() |
3280 | + if res: |
3281 | + if res['number_next']: |
3282 | + return (seq_pool._process(res['prefix']) + '%%0%sd' % res['padding'] % res['number_next'] + seq_pool._process(res['suffix']),res['number_next']) |
3283 | + else: |
3284 | + return (seq_pool._process(res['prefix']) + seq_pool._process(res['suffix']),0) |
3285 | + return False |
3286 | + def _get_nxt_no(self, cr, uid, context=None): |
3287 | + ''' |
3288 | + Function to find next sequence number and update sequence |
3289 | + ''' |
3290 | + pool = self.pool |
3291 | + if context.get('active_ids'): |
3292 | + voucher_id = pool.get('account.voucher').browse(cr, uid, context.get('active_ids'), context=context)[0] |
3293 | + if not voucher_id.journal_id.check_sequence: |
3294 | + raise osv.except_osv(_('Warning!'), _('Please add "Check Sequence" for journal %s.'%str(voucher_id.journal_id.name))) |
3295 | + res = self.get_id(cr, uid,voucher_id.journal_id.check_sequence.id , test='id') |
3296 | + return res and res[0] |
3297 | + else: |
3298 | + return False |
3299 | + def _get_new_no(self, cr, uid, context=None): |
3300 | + ''' |
3301 | + Function to get the next number used to generate sequence |
3302 | + ''' |
3303 | + pool = self.pool |
3304 | + voucher_id = pool.get('account.voucher').browse(cr, uid, context.get('active_ids')[0], context=context) |
3305 | + res = self.get_id(cr, uid,voucher_id.journal_id.check_sequence.id , test='id') |
3306 | + return res and res[1] |
3307 | + |
3308 | + def _get_state(self, cr, uid, context=None): |
3309 | + ''' |
3310 | + Function to initialise state |
3311 | + ''' |
3312 | + pool = self.pool |
3313 | + state = 'print' |
3314 | + if not (context.get('active_model') == 'account.voucher' and context.get('active_ids')): |
3315 | + raise osv.except_osv(_('Warning!'), _('Wrong model or unable to find active ids')) |
3316 | + |
3317 | + for voucher_id in pool.get('account.voucher').browse(cr, uid, context.get('active_ids'), context=context): |
3318 | + if voucher_id.chk_seq and voucher_id.journal_id.use_preprint_check: |
3319 | + state = 'printed' |
3320 | + elif voucher_id.chk_seq and state != 'printed': |
3321 | + state = 'printed_reprint' |
3322 | + if voucher_id.state != 'posted': |
3323 | + raise osv.except_osv(_('Warning!'), _('Payment is not posted. Please Validate Payment First!')) |
3324 | + if not voucher_id.journal_id.check_sequence: |
3325 | + raise osv.except_osv(_('Warning!'), _('Please add "Check Sequence" for journal %s.'%str(voucher_id.journal_id.name))) |
3326 | + return state |
3327 | + def _get_pre_printed(self, cr, uid, context=None): |
3328 | + ''' |
3329 | + Function to check whether the check is pre printed or not |
3330 | + ''' |
3331 | + pool = self.pool |
3332 | + if not (context.get('active_model') == 'account.voucher' and context.get('active_ids')): |
3333 | + raise osv.except_osv(_('Warning!'), _('Wrong model or unable to find active ids')) |
3334 | + for voucher_id in pool.get('account.voucher').browse(cr, uid, context.get('active_ids'), context=context): |
3335 | + if voucher_id.journal_id.use_preprint_check: |
3336 | + return True |
3337 | + return False |
3338 | + def _get_msg(self, cr, uid, context=None): |
3339 | + ''' |
3340 | + Functiont to initialize preprint_msg |
3341 | + ''' |
3342 | + pool = self.pool |
3343 | + msg1='This Payment has already been paid with check:\n' |
3344 | + msg2='These Payments have already been paid with checks:\n' |
3345 | + msg3='Some of these Payments have already been paid with checks:\n' |
3346 | + chk_nos=[] |
3347 | + voucher_ids = pool.get('account.voucher').browse(cr, uid, context.get('active_ids'), context=context) |
3348 | + for voucher in voucher_ids: |
3349 | + if voucher.chk_seq: |
3350 | + chk_nos.append(str(voucher.chk_seq)) |
3351 | + if len(chk_nos)==1: |
3352 | + msg = msg1+str(chk_nos[0]) |
3353 | + elif len(chk_nos) == len(context.get('active_ids')): |
3354 | + msg = msg2+'\n'.join(chk_nos) |
3355 | + else: |
3356 | + msg = msg3+'\n'.join(chk_nos) |
3357 | + if chk_nos: |
3358 | + return msg |
3359 | + else: |
3360 | + return '' |
3361 | + |
3362 | + _defaults = { |
3363 | + 'name':'Check sequence', |
3364 | + 'nxt_seq':_get_nxt_no, |
3365 | + 'new_no':_get_new_no, |
3366 | + 'preprint_msg': _get_msg, |
3367 | + 'pre_printed': _get_pre_printed, |
3368 | + 'state':_get_state |
3369 | + } |
3370 | + def check_option(self, cr, uid, ids, context={}): |
3371 | + ''' |
3372 | + Function to check the option if check is already printed |
3373 | + ''' |
3374 | + data = self.browse(cr,uid,ids[0],context=context) |
3375 | + |
3376 | + if data.print_new: |
3377 | + msg = 'What happened to the existing check no '+str( data.preprint_msg.split(':\n')[1]).replace('\n',', ')+'?' |
3378 | + self.write(cr,uid,ids,{'preprint_msg':msg,'state':'reprint_new'}) |
3379 | + |
3380 | + elif data.reprint: |
3381 | + company_obj = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id |
3382 | + if company_obj.check_layout == 'top': |
3383 | + report_name = 'account.print.check.top' |
3384 | + if company_obj.check_layout == 'middle': |
3385 | + report_name = 'account.print.check.middle' |
3386 | + if company_obj.check_layout == 'bottom': |
3387 | + report_name = 'account.print.check.bottom' |
3388 | + |
3389 | + return { |
3390 | + 'type': 'ir.actions.report.xml', |
3391 | + 'report_name':report_name, |
3392 | + 'datas': { |
3393 | + 'model':'account.voucher', |
3394 | + 'id': context.get('active_ids') and context.get('active_ids')[0] or False, |
3395 | + 'ids': context.get('active_ids') and context.get('active_ids') or [], |
3396 | + 'report_type': 'pdf' |
3397 | + }, |
3398 | + 'nodestroy': False |
3399 | + } |
3400 | + elif data.update_check_no: |
3401 | + print 'updating check no' |
3402 | + msg = 'What happened to the existing check no '+str( data.preprint_msg.split(':\n')[1]).replace('\n',', ')+'?' |
3403 | + self.write(cr,uid,ids,{'preprint_msg':msg,'state':'update_check_no'}) |
3404 | + |
3405 | + |
3406 | + return {'nodestroy':True} |
3407 | + |
3408 | + |
3409 | + |
3410 | + def get_nxt_seq(self, cr, uid, check_sequence_id, test='id', context={}): |
3411 | + ''' |
3412 | + Function to find the next check number without conflict |
3413 | + ''' |
3414 | + next_seq = pool.get('ir.sequence').get_id(cr, uid, voucher.journal_id.check_sequence.id, test='id', context=context) |
3415 | + while(pool.get('check.log').search(cr,uid,[('check_no','=',next_seq)])): |
3416 | + next_seq = pool.get('ir.sequence').get_id(cr, uid, voucher.journal_id.check_sequence.id, test='id', context=context) |
3417 | + return next_seq |
3418 | + |
3419 | + def print_check(self, cr, uid, ids, context={}): |
3420 | + ''' |
3421 | + Function to print check |
3422 | + ''' |
3423 | + if not context.get('active_ids'): return [] |
3424 | + pool = self.pool |
3425 | + seq = {} |
3426 | + voucher_ids = pool.get('account.voucher').browse(cr, uid, context.get('active_ids'), context=context) |
3427 | + data = self.browse(cr,uid,ids[0],context=context) |
3428 | + for voucher in voucher_ids: |
3429 | + if voucher.journal_id.check_sequence: |
3430 | + seq[voucher.journal_id.check_sequence.id] = True |
3431 | + else: |
3432 | + raise wizard.except_wizard(_('Warning'), _('Please add "Check Sequence" for journal %s.'%str(voucher.journal_id.name))) |
3433 | + for seq_id in seq.keys(): |
3434 | + nxt_no = pool.get('ir.sequence').read(cr, uid, seq_id,['number_next'],context=context)['number_next'] |
3435 | + #if nxt_no < data.new_no: |
3436 | + pool.get('ir.sequence').write(cr, uid, [seq_id],{'number_next':data.new_no}, context=context) |
3437 | + |
3438 | + for voucher in voucher_ids: |
3439 | + next_seq = pool.get('ir.sequence').get_id(cr, uid, voucher.journal_id.check_sequence.id, test='id', context=context) |
3440 | +# next_seq = get_nxt_seq(cr, uid, voucher.journal_id.check_sequence.id, test='id', context=context) #Automatically find next possible check number if conflict occures |
3441 | + pool.get('account.voucher').write(cr, uid,[voucher.id],{'chk_seq':next_seq,'chk_status':True}) |
3442 | + pool.get('check.log').create(cr, uid,{'name':voucher.id,'status':'active','check_no':next_seq}) |
3443 | + if data.state == 'print': |
3444 | + |
3445 | + company_obj = pool.get('res.users').browse(cr, uid, uid, context=context).company_id |
3446 | + if company_obj.check_layout == 'top': |
3447 | + report_name = 'account.print.check.top' |
3448 | + if company_obj.check_layout == 'middle': |
3449 | + report_name = 'account.print.check.middle' |
3450 | + if company_obj.check_layout == 'bottom': |
3451 | + report_name = 'account.print.check.bottom' |
3452 | + return { |
3453 | + 'type': 'ir.actions.report.xml', |
3454 | + 'report_name':report_name, |
3455 | + 'datas': { |
3456 | + 'model':'account.voucher', |
3457 | + 'id': context.get('active_ids') and context.get('active_ids')[0] or False, |
3458 | + 'ids': context.get('active_ids') and context.get('active_ids') or [], |
3459 | + 'report_type': 'pdf' |
3460 | + }, |
3461 | + 'nodestroy': False |
3462 | + } |
3463 | + else: |
3464 | + return {} |
3465 | + |
3466 | + def onchange_chkbx(self, cr, uid, ids, value, field, context=None): |
3467 | + ''' |
3468 | + Function to update check box print_new, reprint and update_check_no |
3469 | + ''' |
3470 | + ret={ |
3471 | + 'print_new':False, |
3472 | + 'reprint':False, |
3473 | + 'update_check_no':False, |
3474 | + } |
3475 | + if value: |
3476 | + ret[field] = True |
3477 | + return {'value':ret} |
3478 | + |
3479 | + def update_no(self, cr, uid, ids, context={}): |
3480 | + ''' |
3481 | + Function to update check log status |
3482 | + ''' |
3483 | + data = self.browse(cr,uid,ids[0],context=context) |
3484 | + pool = self.pool |
3485 | + voucher_ids = pool.get('account.voucher').browse(cr, uid, context.get('active_ids'), context=context) |
3486 | + if data.status: |
3487 | + for voucher in voucher_ids: |
3488 | + if voucher.chk_seq: |
3489 | + chk_log_ids = pool.get('check.log').search(cr,uid,[('check_no','=',voucher.chk_seq),('status','=','active')]) |
3490 | + pool.get('check.log').write(cr,uid,chk_log_ids, {'status':data.status or 'unk'}) |
3491 | + |
3492 | + self.write(cr,uid,ids,{'preprint_msg':'','state':'do_update'}) |
3493 | + |
3494 | + |
3495 | + def print_new(self, cr, uid, ids, context={}): |
3496 | + ''' |
3497 | + Function to update check log status |
3498 | + ''' |
3499 | + data = self.browse(cr,uid,ids[0],context=context) |
3500 | + pool = self.pool |
3501 | + voucher_ids = pool.get('account.voucher').browse(cr, uid, context.get('active_ids'), context=context) |
3502 | + if data.status: |
3503 | + for voucher in voucher_ids: |
3504 | + if voucher.chk_seq: |
3505 | + chk_log_ids = pool.get('check.log').search(cr,uid,[('check_no','=',voucher.chk_seq),('status','=','active')]) |
3506 | + pool.get('check.log').write(cr,uid,chk_log_ids, {'status':data.status or 'unk'}) |
3507 | + |
3508 | + self.write(cr,uid,ids,{'preprint_msg':'','state':'print'}) |
3509 | +print_check() |
3510 | + |
3511 | + |
3512 | + |
3513 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
3514 | |
3515 | === added file 'account_check_writing/wizard/check_print_view.xml' |
3516 | --- account_check_writing/wizard/check_print_view.xml 1970-01-01 00:00:00 +0000 |
3517 | +++ account_check_writing/wizard/check_print_view.xml 2011-10-06 15:19:26 +0000 |
3518 | @@ -0,0 +1,57 @@ |
3519 | +<?xml version="1.0"?> |
3520 | +<openerp> |
3521 | + <data> |
3522 | + |
3523 | + <!-- View of wizard to print check --> |
3524 | + <record id="view_print_check" model="ir.ui.view"> |
3525 | + <field name="name">Print Check</field> |
3526 | + <field name="model">print.check</field> |
3527 | + <field name="type">form</field> |
3528 | + <field name="arch" type="xml"> |
3529 | + <form string="Print Checks" > |
3530 | + |
3531 | + <field name="state" invisible="1"/> |
3532 | + <group attrs="{'invisible':[('state','not in',['print', 'do_update'])]}"> |
3533 | + <field name="nxt_seq" readonly="1" colspan="8" /> |
3534 | + <newline/> |
3535 | + <field name="new_no" colspan="8"/> |
3536 | + <newline/> |
3537 | + </group> |
3538 | + <field name="preprint_msg" colspan="12" height="60" nolabel="1" readonly="1" /><newline/> |
3539 | + <group attrs="{'invisible':[('state','not in',['print', 'do_update'])]}"> |
3540 | + <button name="print_check" string="OK" type="object" icon="gtk-ok"/> |
3541 | + <button special="cancel" string="Cancel" icon="gtk-cancel"/> |
3542 | + </group> |
3543 | + |
3544 | + <group attrs="{'invisible':[('state','not in',['printed','printed_reprint'])]}" > |
3545 | + <field name='print_new' on_change="onchange_chkbx(print_new, 'print_new')"/><newline/> |
3546 | + <field name='reprint' on_change="onchange_chkbx(reprint, 'reprint')" attrs="{'invisible':[('state','=','printed')]}"/><newline/> |
3547 | + <field name='update_check_no' on_change="onchange_chkbx(update_check_no, 'update_check_no')"/><newline/> |
3548 | + <button name="check_option" string="OK" type="object" icon="gtk-ok"/> |
3549 | + <button special="cancel" string="Cancel" icon="gtk-cancel"/> |
3550 | + </group> |
3551 | + <group attrs="{'invisible':[('state','not in',['reprint_new','update_check_no'])]}" > |
3552 | + <field name="status" attrs="{'required':[('state','in',['reprint_new','update_check_no'])]}"/><newline/> |
3553 | + <button name="print_new" string="Next" type="object" icon="gtk-ok" attrs="{'invisible':[('state','not in',['reprint_new'])]}"/> |
3554 | + <button name="update_no" string="Update" type="object" icon="gtk-ok" attrs="{'invisible':[('state','not in',['update_check_no'])]}"/> |
3555 | + <button special="cancel" string="Cancel" icon="gtk-cancel"/> |
3556 | + </group> |
3557 | + |
3558 | + </form> |
3559 | + </field> |
3560 | + </record> |
3561 | + |
3562 | + <act_window name="Print Checks in Batch" |
3563 | + res_model="print.check" |
3564 | + src_model="account.voucher" |
3565 | + view_mode="form" |
3566 | + view_id="view_print_check" |
3567 | + key2="client_action_multi" |
3568 | + multi="True" |
3569 | + target="new" |
3570 | + id="print_check_act_window"/> |
3571 | + |
3572 | + |
3573 | + </data> |
3574 | +</openerp> |
3575 | + |
3576 | \ No newline at end of file |
3577 | |
3578 | === added file 'account_check_writing/wizard_view.xml' |
3579 | --- account_check_writing/wizard_view.xml 1970-01-01 00:00:00 +0000 |
3580 | +++ account_check_writing/wizard_view.xml 2011-10-06 15:19:26 +0000 |
3581 | @@ -0,0 +1,17 @@ |
3582 | +<?xml version="1.0" encoding="utf-8"?> |
3583 | +<openerp> |
3584 | + <data> |
3585 | + <wizard |
3586 | + string="Print Checks in Batch" |
3587 | + model="account.voucher" |
3588 | + name="print.check.report" |
3589 | + id="print_check_report" |
3590 | + multi="True" /> |
3591 | + |
3592 | + <!-- menuitem id="summary_report" |
3593 | + parent="shipping_api.shipping_menu" |
3594 | + sequence="20" name="Print Summary Report" |
3595 | + action="print_summary_report" |
3596 | + type="wizard"/--> |
3597 | + </data> |
3598 | +</openerp> |
Hello,
Thank you for this good contribution. I checked your branches and I would suggest to keep them in your own branch for now on, instead of putting them in the official release. Please register them in apps.openerp.com if it's not already done; if people use them in v6.1, we will think about merging them to the official branch.
As these modules have thousands lines of code, we would not have the time to efficiently review the code, check the usability experience and test for v6.1. I propose to review this later on, if we see people using it from apps.
Thanks,