Merge lp:~openerp-dev/openobject-addons/trunk-account_check_writing_jam into lp:openobject-addons

Proposed by qdp (OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-account_check_writing_jam
Merge into: lp:openobject-addons
Diff against target: 3583 lines (+2134/-894)
21 files modified
account_check_writing/__init__.py (+3/-1)
account_check_writing/__openerp__.py (+26/-7)
account_check_writing/account.py (+69/-22)
account_check_writing/account_check_writing_data.xml (+9/-1)
account_check_writing/account_check_writing_demo.xml (+10/-0)
account_check_writing/account_check_writing_demo.yml (+40/-0)
account_check_writing/account_check_writing_report.xml (+0/-29)
account_check_writing/account_demo.xml (+0/-9)
account_check_writing/account_view.xml (+7/-1)
account_check_writing/account_voucher.py (+122/-46)
account_check_writing/account_voucher_view.xml (+158/-17)
account_check_writing/amount_to_text_en.py (+61/-0)
account_check_writing/report/check_print.py (+130/-42)
account_check_writing/report/check_print_bottom.rml (+446/-219)
account_check_writing/report/check_print_middle.rml (+446/-252)
account_check_writing/report/check_print_top.rml (+342/-194)
account_check_writing/res_company.py (+45/-0)
account_check_writing/res_company_view.xml (+26/-0)
account_check_writing/test/account_check_writing_report.yml (+79/-0)
account_check_writing/wizard/account_check_batch_printing.py (+92/-45)
account_check_writing/wizard/account_check_batch_printing_view.xml (+23/-9)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-account_check_writing_jam
Reviewer Review Type Date Requested Status
Thibault Delavallée (OpenERP) (community) technical Needs Fixing
Brendan Clune (Logic Supply) (community) Approve
alex kwak (community) Approve
Dave Burkholder (community) Approve
Review via email: mp+140838@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Dave Burkholder (akxws32zf-dave-j0p9h616h) wrote :

This is an excellent module according to the tests that I've done and I'm very eager for it to be merged into trunk. I want to wait till it's officially merged before deploying it in my company workflow. How much longer will the merge take?

Thanks!

review: Approve
Revision history for this message
Ray Carnes (rcarnes) wrote :

I am offering to do any further testing to speed this up - we have several clients on their way through 7.0 migration that will be looking for this module.

Ray.

Revision history for this message
alex kwak (cinnamongg) wrote :

I ran this on runbot to test this module. It was successful and it worked it out. Thank you so much for fitting our needs just right. I think it should be merged soon.
Thanks,

Alex

review: Approve
Revision history for this message
Dave Burkholder (akxws32zf-dave-j0p9h616h) wrote :

Is there an ETA on this module? Back in 12/29/12 Fabrice mentioned this module on stackoverflow, saying they hoped to merge into core soon. 8 months is not soon. Is there any way I could sponsor this project to speed it up?

http://stackoverflow.com/questions/14076413/how-can-the-check-printing-report-be-modified-to-include-a-suppliers-invoice-nu

Revision history for this message
Brendan Clune (Logic Supply) (brendan-clune) wrote :

We have been running this module backported to 7.0 with minimal issues. It would be nice to see it hit trunk, though, just to keep code workflows a bit cleaner.

review: Approve
8341. By Jigar A.

[MERGE] Sync with trunk

8342. By Jigar A.

[FIX] Commnets and Removed not needed field

8343. By Jigar A.

[Merge] lp:openobject-addons

8344. By Jigar A.

[FIX] Check_Writing: Replaced the Module image to right folder.
Renamed the Report and Report Titles Names

8345. By Jigar A.

[FIX] impoved the multui currecy options payment view section

8346. By Jigar A.

[FIX] View Imp

8347. By Jigar A.

[FIX] account_check_writing: Improved the Config File MOdule Help text

8348. By Jigar A.

[MERGE] lp:openobject-addons

8349. By Jigar A.

[IMP] account_check_writing: - added the demo record for the check.
- added the yaml test cases to vlidate, assign check number using batch print wizard, and print top, middle and top report

8350. By Jigar A.

 merge lp:openobject-addons

8351. By Jigar A.

[MERGE] lp:~openerp-dev/openobject-addons/trunk-account_check_writing_jam-improvement-sgo

8352. By Jigar A.

[FIX] Added the Demo yaml file and impoved the rest demo records

8353. By Jigar A.

[REF] refectored the action names and fucntion call ref

8354. By Jigar A.

[MERGE] lp:openobject-addons

8355. By Jigar A.

[FIX] Impoved the print report code and vie of the batch print wizards

8356. By Jigar A.

[FIX] Added the translate fucntions

8357. By Jigar A.

[IMP] Impoved The OE Copyright License text as suggested

8358. By Jigar A.

[MERGE] lp:openobject-addons

8359. By Jigar A.

[merge] lp:openobject-addons

8360. By Jigar A.

[MERGE] lp:openobject-addons

8361. By Jigar A.

[MERGE] account_check_writing: Creating the Check Journal on installing COA
lp:~openerp-dev/openobject-addons/trunk-account_check_writing_jam-config-journal-sgo

8362. By Jigar A.

[FIX] Setting the back account for the check

8363. By Jigar A.

[FIX]context check fix

8364. By Jigar A.

[MERGE] lp:openobject-addons

8365. By Jigar A.

[FIX] Set allow_check_writing for bank type journal to enable bank journal to enable to be used as check payment

8366. By Jigar A.

[MERGE] lp:openobject-addons

8367. By Jigar A.

[IMP] Added the help tooltip for Payment Method on Check

8368. By Jigar A.

[MERGE] lp:openobject-addons

8369. By Jigar A.

[FIX] removed no needed old code for journal creation

8370. By Jigar A.

[MERGE] If journal type is bank when installed account_check_writing set allow_check_writing as true. and if type is equal to bank allow_check_writing set as true on onchange of type.
lp:~openerp-dev/openobject-addons/trunk-account_check_writing_jam-journal-fix-sgo

8371. By Jigar A.

[MERGE] lp:openobject-addons

8372. By Jigar A.

[TYPO] fixed the tooptip typo

8373. By Jigar A.

[MERGE] lp:openobject-addons

8374. By Jigar A.

[merge] lp:openobject-addons

8375. By Jigar A.

[merge] lp:openobject-addons

8376. By Thibault Delavallée (OpenERP)

[MERGE] Sync with addons-trunk

Revision history for this message
Thibault Delavallée (OpenERP) (tde-openerp) wrote :

Hello,

I have some remarks:

account_check_writing/__openerp__.py:
- why did you change the author, or at least removed NovaPoint ? By the way you did the same thing in another __opener__ file.

account_check_writing/account.py:
- group multiple imports from same module (from openerp.osv import osv, fields)
- tiny remark: from openerp import SUPERUSER_ID should be above from openerp.osv ... because of alphabetical order :)
- columns declaration: use line returns; 80 characters length is not a hard limit, but your lines are quite long; put the help at the next line
- 'implementation':'no_gap', -> space forgotten (use a linter)
- allow_check_writing = type == "bank" and True or False -> "and True or False" is not necessary, type == 'bank' already returns a boolean

account_check_writing/amount_to_text_en.py: I don't see the point with the whole file. Is the purpose do display '5 and 3/4' instead of '5 and 75 cents' ? Why ? If this is standard, please update the server file with comments, doc and explanations instead of re-defining everything twice for a custom addon. If this is not standard, maybe you should consider dropping this feature.

account_check_writing/account_voucher.py:
- _get_currency: no need to declare a variable user_pool that is used only once -> write a single statement
- columns :
-- check_number -> if this is the same columns as 'number', please add the 'oldname' argument to ease migration
- def get_lang(self, cr, uid, ids, context=None):
-- 1/ not sure this method is necessary and seems more like a hack than everything else; if it is necessary, please move it with other language-related methods, in tools
-- 2/ if you keep it, please avoid obfuscated code; just a language = context and context.get('lang', 'en')[0:2] seems sufficient
- def copy:
-- override default only if None, not if void
-- use update if you have multiple values to change; otherwise default[key] = value is sufficient
- def print_check: various indentation issues, please use a linter

account_check_writing/report/check_print.py
- general for this file: please add in comments the type and expected value of your various parameters; using dedicated methods for each part of the process is a good thing, but this requires some explanations of what you do and on which parameters yhou are working
- def _getchunk_line(self, defaults={}): I would put defaults=None as parameter to avoid issues with immutable dict

Best regards,

Thibault.

review: Needs Fixing ((technical))
8377. By Jigar A.

[IMP] account_checkl_writing: added the mutiple PEP std improvments suggest on MP technical review

8378. By Jigar A.

[MERGE] trunk sync

8379. By Jigar A.

[IMP] account_checkl_writing: added the mutiple PEP8 Standard improvments suggest on MP technical review

8380. By Jigar A.

[FIX] account_check_writing: column -> , this is the same columns as , added the 'oldname' argument to ease migration.

8381. By Jigar A.

[FIX] refector the code and added the docstring for function

8382. By Jigar A.

[FIX]Added the doc string for the file amount to text

8383. By Jigar A.

[MERGE] trunk sync

8384. By Jigar A.

[REVERT] reverted the Commit 8380 as numner anf check_number are not same field, both field has sigificent meaning and check_number is newly added field to preservethe check number while number is the lalgecy field from voucher object so store the voucher entry number.

8385. By Jigar A.

[MERGE] lp:openobject-addons

Revision history for this message
Thibault Delavallée (OpenERP) (tde-openerp) wrote :
Download full text (3.4 KiB)

Hello,

Some more remarks about the updated code.

account_voucher.py:
- lint remark: your imports should separate standard lib imports from openerp imports (and each category should be ordered), like
from lxml import etree
// intended void line
from openerp.addons.account_check_writing.amount_to_text_en import amount_to_text
from openerp.osv import osv, fields
- _make_journal docstring: seacrh -> search :)
- _get_currency: in account_voucher/account_voucher.py, it already returns self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.currency_id.id, the same line that you added in account_check_writing. Your override does not seem necessary to me.
- _get_amount_in_word:
-- do not lowerize currency.id.name; instead, in amount_to_text do a currency.upper() == 'USD' (I think uppercase is more standard)
-- the following code is not correct:
language = 'en'
if context.get('lang'):
    language = context.get('lang')[0:2]
it fails if context is not defined. Please add an "if context is None: context = {}" at the beginning of the function. You could also simplify the line using the 'get' default value: language = context.get('lang', 'en')[0:2]
- I think you could improve the columns name to ease readability / understandability:
-- rename allow_check to allow_check_writing, because it is a related field and having the same name ease the code readability
-- rename check_done into 'printed', not necessary to add a prefix, and if the column meaning is to tell that the check has been printed, then the variable name should be printed
-- minor remark: put 'journal_id' column definition above 'allow_check_writing' to have a consistent columns order
-- I saw you added and then removed check_number being a "new field" based on number, using oldname, as I asked you in the first review. Why? Has the number field any meaning when having account_check_writing installed ? Should'nt check_number be number; basically ? Do you have any use of the two fields at the same time ?
- onchange_amount:
-- same remark about language = context.get(...)
-- same remark about currency.name.lower()
- onchange_journal: shouldn't the reset of currency_id also be applied if vals is void ?
- fields_view_get: if context == None -> if context is None
- print_check:
-- same remark about if context and None
-- the management of ids is not clean.
--- you browse on ids[0]
--- in value, you add a protection about ids: for example 'id': ids and ids[0] or False
---> at the beginning of the method, if ids is void, return {}, the set check_id to ids[0] and use this variable through the whole method

account.py
- Why are you using SUPERUSER_ID when calling create_check_sequence? If you have some access rights issues, shouldn't they be solved by regular access rights ?

check_print.py
- N, STARS, LINEKEYS -> should be class variables with a trailing underscore, not global variables (call to N will therefore become self._N)
- if defaults == None -> if defaults is None
- You added docstrings, it is a good practice. However could you also tell the type of the variables ? For example, :param list lines: a list of my.object.lines to be added on the check to print

res_company.py
- ...

Read more...

review: Needs Fixing (technical)
8386. By Jigar A.

[MERGE] trunk Sync

Unmerged revisions

8386. By Jigar A.

[MERGE] trunk Sync

8385. By Jigar A.

[MERGE] lp:openobject-addons

8384. By Jigar A.

[REVERT] reverted the Commit 8380 as numner anf check_number are not same field, both field has sigificent meaning and check_number is newly added field to preservethe check number while number is the lalgecy field from voucher object so store the voucher entry number.

8383. By Jigar A.

[MERGE] trunk sync

8382. By Jigar A.

[FIX]Added the doc string for the file amount to text

8381. By Jigar A.

[FIX] refector the code and added the docstring for function

8380. By Jigar A.

[FIX] account_check_writing: column -> , this is the same columns as , added the 'oldname' argument to ease migration.

8379. By Jigar A.

[IMP] account_checkl_writing: added the mutiple PEP8 Standard improvments suggest on MP technical review

8378. By Jigar A.

[MERGE] trunk sync

8377. By Jigar A.

[IMP] account_checkl_writing: added the mutiple PEP std improvments suggest on MP technical review

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account_check_writing/__init__.py'
2--- account_check_writing/__init__.py 2011-10-13 21:11:47 +0000
3+++ account_check_writing/__init__.py 2013-11-19 00:05:44 +0000
4@@ -18,9 +18,11 @@
5 # along with this program. If not, see <http://www.gnu.org/licenses/>.
6 #
7 ##############################################################################
8-
9+import amount_to_text_en
10+import res_company
11 import account
12 import account_voucher
13 import wizard
14 import report
15+
16 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
17
18=== modified file 'account_check_writing/__openerp__.py'
19--- account_check_writing/__openerp__.py 2012-12-07 18:30:24 +0000
20+++ account_check_writing/__openerp__.py 2013-11-19 00:05:44 +0000
21@@ -21,23 +21,42 @@
22 {
23 'name': 'Check Writing',
24 'version': '1.1',
25- 'author': 'OpenERP SA, NovaPoint Group',
26+ 'author': 'OpenERP SA, Ursa Information Systems',
27 'category': 'Generic Modules/Accounting',
28 'description': """
29-Module for the Check Writing and Check Printing.
30-================================================
31+With this module, you will be able to write checks to your vendors in OpenERP.
32+==============================================================================
33+
34+This module supports the following:
35+-----------------------------------
36+ * Multiple currencies: it is possible to write checks in different currencies.
37+ * Multiple journals: each check can use a different payment method.
38+ * Multiple formats: checks can be printed on top, in the middle or at the bottom to fit Quickbooks/Peachtree/... templates.
39+ * Batch check number assignation.
40+ * Batch printing of checks.
41+ * Complete check number sequence management: number auto-suggestion, sequence recalibration, optional overwrite if already specified, duplicates detection.
42+ * Optional printing of check number: if the paper checks of your bank already include numbers, you can use these numbers instead of OpenERP’s check numbers.
43+ * Optional spill-over on multiple stubs: when the check includes more than 10 invoice lines, they will be printed on several pages.
44+ * Optional printing of credits.
45+ * Integration with payments workflow: checks are an integrated part of the payment workflow in OpenERP.
46+ * Comprehensive and accurate information displayed on stub: supplier's invoice number, void status, memo, suppresses invoices that are not paid with this check.
47 """,
48 'website': 'http://www.openerp.com',
49- 'depends' : ['account_voucher'],
50+ 'depends': ['account_voucher'],
51 'data': [
52 'wizard/account_check_batch_printing_view.xml',
53- 'account_check_writing_report.xml',
54 'account_view.xml',
55 'account_voucher_view.xml',
56+ 'res_company_view.xml',
57 'account_check_writing_data.xml',
58 ],
59- 'demo': ['account_demo.xml'],
60- 'test': [],
61+ 'demo': [
62+ 'account_check_writing_demo.xml',
63+ 'account_check_writing_demo.yml',
64+ ],
65+ 'test': [
66+ 'test/account_check_writing_report.yml'
67+ ],
68 'installable': True,
69 'active': False,
70 }
71
72=== modified file 'account_check_writing/account.py'
73--- account_check_writing/account.py 2013-04-15 10:23:49 +0000
74+++ account_check_writing/account.py 2013-11-19 00:05:44 +0000
75@@ -2,7 +2,7 @@
76 ##############################################################################
77 #
78 # OpenERP, Open Source Management Solution
79-# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
80+# Copyright (C) 2004-Today OpenERP S.A. (<http://www.openerp.com>).
81 #
82 # This program is free software: you can redistribute it and/or modify
83 # it under the terms of the GNU Affero General Public License as
84@@ -19,30 +19,77 @@
85 #
86 ##############################################################################
87
88-from openerp.osv import osv,fields
89+from openerp import SUPERUSER_ID
90+from openerp.osv import osv, fields
91+from openerp.tools.translate import _
92+
93
94 class account_journal(osv.osv):
95 _inherit = "account.journal"
96
97 _columns = {
98- 'allow_check_writing': fields.boolean('Allow Check writing', help='Check this if the journal is to be used for writing checks.'),
99- 'use_preprint_check': fields.boolean('Use Preprinted Check'),
100- }
101-
102-
103-class res_company(osv.osv):
104- _inherit = "res.company"
105- _columns = {
106- 'check_layout': fields.selection([
107- ('top', 'Check on Top'),
108- ('middle', 'Check in middle'),
109- ('bottom', 'Check on bottom'),
110- ],"Check Layout",
111- 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" ),
112- }
113-
114- _defaults = {
115- 'check_layout' : lambda *a: 'top',
116- }
117-
118+ 'allow_check_writing': fields.boolean('Allow Check Writing',
119+ help='Check this to be able to write checks using this journal.'),
120+ 'use_preprint_check': fields.boolean('Use Preprinted Checks',
121+ help="Check this if your checks already have a number preprinted on them. Otherwise check numbers will be printed on paper."),
122+ 'check_sequence_id': fields.many2one('ir.sequence', 'Check Sequence',
123+ help="This field contains the information related to the numbering of the Check of this journal."),
124+ }
125+
126+ def configure_check_journal(self, cr, uid, context=None):
127+ '''
128+ This function set up bank journal to be used on check payment by
129+ setting allow check writing on bank type journals this function will
130+ be triggered while installing module.
131+ '''
132+ journal_ids = self.search(cr, uid, [('type', '=', 'bank')], context=context)
133+ if journal_ids:
134+ self.write(cr, uid, journal_ids, {'allow_check_writing': True}, context=context)
135+ return True
136+
137+ def onchange_journal_type(self, cr, uid, ids, type, context=None):
138+ """
139+ on change journal type enable the allow_check_writing flag to allow
140+ configuration of check journal.
141+ """
142+ return {'value': {'allow_check_writing': type == "bank"}}
143+
144+ def create_check_sequence(self, cr, uid, vals, context=None):
145+ """
146+ Create new no_gap entry sequence for check Journal using given vals.
147+ """
148+ val = {
149+ 'name': vals['name'] + _(" : Check Number Sequence"),
150+ 'implementation': 'no_gap',
151+ 'padding': 4,
152+ 'number_increment': 1
153+ }
154+ if 'company_id' in vals:
155+ val['company_id'] = vals['company_id']
156+ return self.pool.get('ir.sequence').create(cr, uid, val, context)
157+
158+ def create(self, cr, uid, vals, context=None):
159+ if not 'check_sequence_id' in vals or not vals['check_sequence_id'] and vals.get('allow_check_writing'):
160+ # if we have the right to create a journal, we should be able to
161+ # create it's check number sequence.
162+ vals.update({'check_sequence_id': self.create_check_sequence(cr, SUPERUSER_ID, vals, context)})
163+ return super(account_journal, self).create(cr, uid, vals, context)
164+
165+
166+class tmodel_multi_charts_accounts(osv.TransientModel):
167+
168+ _inherit = 'wizard.multi.charts.accounts'
169+
170+ def _prepare_bank_journal(self, cr, uid, line, current_num, default_account_id, company_id, context=None):
171+ '''
172+ This function prepares the value to use for the creation of a bank and
173+ addes the allow_check_writing flag value for Bank Type journal
174+ :rtype: dict
175+ '''
176+ vals = super(tmodel_multi_charts_accounts, self)._prepare_bank_journal(cr, uid, line, current_num, default_account_id, company_id, context=context)
177+ if line['account_type'] == "bank":
178+ vals.update({'allow_check_writing': True})
179+ return vals
180+
181+
182 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
183
184=== modified file 'account_check_writing/account_check_writing_data.xml'
185--- account_check_writing/account_check_writing_data.xml 2011-10-13 21:11:47 +0000
186+++ account_check_writing/account_check_writing_data.xml 2013-11-19 00:05:44 +0000
187@@ -7,9 +7,17 @@
188 </record>
189
190 <record id="sequence_check_number" model="ir.sequence">
191+ <field name="name">Check Journal Number</field>
192+ <field name="code">check.number</field>
193+ <field name="prefix">CHK/%(year)s/</field>
194+ <field eval="4" name="padding"/>
195+ </record>
196+
197+ <record id="seq_check_number" model="ir.sequence">
198 <field name="name">Check Number</field>
199 <field name="code">check.number</field>
200 <field eval="4" name="padding"/>
201- </record>
202+ </record>
203+ <function model="account.journal" name="configure_check_journal"/>
204 </data>
205 </openerp>
206
207=== added file 'account_check_writing/account_check_writing_demo.xml'
208--- account_check_writing/account_check_writing_demo.xml 1970-01-01 00:00:00 +0000
209+++ account_check_writing/account_check_writing_demo.xml 2013-11-19 00:05:44 +0000
210@@ -0,0 +1,10 @@
211+<?xml version="1.0" encoding="utf-8"?>
212+<openerp>
213+ <data>
214+ <record id="account.check_journal" model="account.journal">
215+ <field name="allow_check_writing" eval="1" />
216+ <field name="sequence_id" ref="sequence_check_number"/>
217+ <field name="check_sequence_id" ref="seq_check_number"/>
218+ </record>
219+ </data>
220+</openerp>
221
222=== added file 'account_check_writing/account_check_writing_demo.yml'
223--- account_check_writing/account_check_writing_demo.yml 1970-01-01 00:00:00 +0000
224+++ account_check_writing/account_check_writing_demo.yml 2013-11-19 00:05:44 +0000
225@@ -0,0 +1,40 @@
226+-
227+ I set the context as would do the action in supplier invoice.
228+-
229+ !context
230+ 'default_type': 'in_invoice'
231+-
232+ I create a customer invoice
233+-
234+ !record {model: account.invoice, id: account_checkinvoice_0}:
235+ account_id: account.a_pay
236+ company_id: base.main_company
237+ journal_id: account.expenses_journal
238+ partner_id: base.res_partner_6
239+ name: Supplier Invoice
240+ invoice_line:
241+ - account_id: account.a_expense
242+ name: '[UDC] USD Datacard'
243+ quantity: 10.0
244+ price_unit: 450.0
245+ quantity: 10.0
246+ uos_id: product.product_uom_unit
247+-
248+ I validate invoice by clicking on Validate button
249+-
250+ !workflow {model: account.invoice, action: invoice_open, ref: account_checkinvoice_0}
251+-
252+ I set the context that will be used for the encoding of all the vouchers of this file
253+-
254+ !context
255+ 'type': 'payment'
256+-
257+ I create account voucher with check journal for supplier invoice
258+-
259+ !record {model: account.voucher, id: account_checkvoucher_01, view: view_vendor_payment_check_form}:
260+ type: payment
261+ company_id: base.main_company
262+ account_id: account.cash
263+ amount: 4500.0
264+ journal_id: account.check_journal
265+ partner_id: base.res_partner_6
266
267=== removed file 'account_check_writing/account_check_writing_report.xml'
268--- account_check_writing/account_check_writing_report.xml 2012-02-10 09:33:15 +0000
269+++ account_check_writing/account_check_writing_report.xml 1970-01-01 00:00:00 +0000
270@@ -1,29 +0,0 @@
271-<?xml version="1.0"?>
272-<openerp>
273- <data>
274- <report id="account_print_check_top"
275- string="Print Check (Top)"
276- model="account.voucher"
277- name="account.print.check.top"
278- rml="account_check_writing/report/check_print_top.rml"
279- multi="True"
280- auto="False"/>
281-
282- <report id="account_print_check_middle"
283- string="Print Check (Middle)"
284- model="account.voucher"
285- name="account.print.check.middle"
286- rml="account_check_writing/report/check_print_middle.rml"
287- multi="True"
288- auto="False"/>
289-
290- <report id="account_print_check_bottom"
291- string="Print Check (Bottom)"
292- model="account.voucher"
293- name="account.print.check.bottom"
294- rml="account_check_writing/report/check_print_bottom.rml"
295- multi="True"
296- auto="False"/>
297-
298- </data>
299-</openerp>
300
301=== removed file 'account_check_writing/account_demo.xml'
302--- account_check_writing/account_demo.xml 2011-10-13 21:11:47 +0000
303+++ account_check_writing/account_demo.xml 1970-01-01 00:00:00 +0000
304@@ -1,9 +0,0 @@
305-<?xml version="1.0" encoding="utf-8"?>
306-<openerp>
307- <data noupdate="1">
308- <record id="account.check_journal" model="account.journal">
309- <field name="allow_check_writing" eval="1" />
310- <field name="sequence_id" ref="sequence_check_number"/>
311- </record>
312- </data>
313-</openerp>
314
315=== modified file 'account_check_writing/account_view.xml'
316--- account_check_writing/account_view.xml 2012-11-29 22:26:45 +0000
317+++ account_check_writing/account_view.xml 2013-11-19 00:05:44 +0000
318@@ -11,7 +11,13 @@
319 <field name="model">account.journal</field>
320 <field name="inherit_id" ref="account.view_account_journal_form" />
321 <field name="arch" type="xml">
322- <field name="type" />
323+ <field name="type"/>
324+ <field name="sequence_id" position="after">
325+ <field name="check_sequence_id" attrs="{'invisible': [('allow_check_writing', '!=', True)]}"/>
326+ </field>
327+ <field name="type" position="attributes">
328+ <attribute name="on_change">onchange_journal_type(type)</attribute>
329+ </field>
330 <field name="entry_posted" position="after">
331 <field name="allow_check_writing" attrs="{'readonly':[('type','!=','bank')]}" />
332 <field name="use_preprint_check" attrs="{'readonly':[('type','!=','bank')]}" />
333
334=== modified file 'account_check_writing/account_voucher.py'
335--- account_check_writing/account_voucher.py 2013-04-15 10:23:49 +0000
336+++ account_check_writing/account_voucher.py 2013-11-19 00:05:44 +0000
337@@ -2,7 +2,7 @@
338 ##############################################################################
339 #
340 # OpenERP, Open Source Management Solution
341-# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
342+# Copyright (C) 2004-Today OpenERP S.A. (<http://www.openerp.com>).
343 #
344 # This program is free software: you can redistribute it and/or modify
345 # it under the terms of the GNU Affero General Public License as
346@@ -19,81 +19,157 @@
347 #
348 ##############################################################################
349
350-from openerp.osv import osv,fields
351+from lxml import etree
352+from openerp.osv import osv, fields
353 from openerp.tools.translate import _
354-from openerp.tools.amount_to_text_en import amount_to_text
355-from lxml import etree
356-
357-class account_voucher(osv.osv):
358+from openerp.addons.account_check_writing.amount_to_text_en import amount_to_text
359+
360+
361+class account_voucher(osv.Model):
362 _inherit = 'account.voucher'
363
364+ def _get_currency(self, cr, uid, context=None):
365+ res = super(account_voucher, self)._get_currency(cr, uid, context)
366+ if not res:
367+ res = self.pool.get("res.users").browse(cr, uid, uid).company_id.currency_id.id
368+ return res
369+
370 def _make_journal_search(self, cr, uid, ttype, context=None):
371- if context is None:
372+ """
373+ Inherited: Add only check writing journal seacrh behaviour for Checks action view.
374+ """
375+ if context is None:
376 context = {}
377 journal_pool = self.pool.get('account.journal')
378- if context.get('write_check',False) :
379- return journal_pool.search(cr, uid, [('allow_check_writing', '=', True)], limit=1)
380- return journal_pool.search(cr, uid, [('type', '=', ttype)], limit=1)
381+ if context.get('write_check'):
382+ return journal_pool.search(cr, uid, [('allow_check_writing', '=', True)], limit=1, context=context)
383+ return journal_pool.search(cr, uid, [('type', '=', ttype)], limit=1, context=context)
384+
385+ def _get_amount_in_word(self, cr, uid, ids, field_name, arg, context=None):
386+ """
387+ fields.function method to generate the textual representation of the
388+ float amount, to be printed on check later.
389+ """
390+ res = {}
391+ for check in self.browse(cr, uid, ids, context=context):
392+ language = 'en'
393+ if context.get('lang'):
394+ language = context.get('lang')[0:2]
395+ currency = check.currency_id.name.lower()
396+ res.update({check.id: amount_to_text(check.amount, lang=language, currency=currency)})
397+ return res
398
399 _columns = {
400- 'amount_in_word' : fields.char("Amount in Word" , size=128, readonly=True, states={'draft':[('readonly',False)]}),
401- 'allow_check' : fields.related('journal_id', 'allow_check_writing', type='boolean', string='Allow Check Writing'),
402- 'number': fields.char('Number', size=32),
403+ 'amount_in_word': fields.function(_get_amount_in_word, type='char', readonly=True, store=True),
404+ 'allow_check': fields.related('journal_id', 'allow_check_writing', type='boolean', string='Allow Check Writing'),
405+ 'check_number': fields.char('Check Number', size=32),
406+ 'journal_id': fields.many2one('account.journal', 'Journal', required=True, readonly=True, states={'draft': [('readonly', False)]}),
407+ 'check_done': fields.boolean("Check Printed")
408 }
409
410+ _sql_constraints = [
411+ ('check_per_journal_uniq', 'unique(check_number, journal_id)', 'Check Number Must be Unique Per Journal!'),
412+ ]
413+
414 def onchange_amount(self, cr, uid, ids, amount, rate, partner_id, journal_id, currency_id, ttype, date, payment_rate_currency_id, company_id, context=None):
415- """ Inherited - add amount_in_word and allow_check_writting in returned value dictionary """
416+ """
417+ Inherited: add amount_in_word and allow_check_writing in @returned value dictionary
418+ """
419 if not context:
420 context = {}
421 default = super(account_voucher, self).onchange_amount(cr, uid, ids, amount, rate, partner_id, journal_id, currency_id, ttype, date, payment_rate_currency_id, company_id, context=context)
422 if 'value' in default:
423 amount = 'amount' in default['value'] and default['value']['amount'] or amount
424-
425- #TODO : generic amount_to_text is not ready yet, otherwise language (and country) and currency can be passed
426- #amount_in_word = amount_to_text(amount, context=context)
427- amount_in_word = amount_to_text(amount)
428- default['value'].update({'amount_in_word':amount_in_word})
429+ currency = self.pool.get('res.currency').browse(cr, uid, currency_id, context=context)
430+ language = 'en'
431+ if context.get('lang'):
432+ language = context.get('lang')[0:2]
433+ currency = currency.name.lower()
434+ amount_in_word = amount_to_text(amount, lang=language, currency=currency)
435+ default['value'].update({'amount_in_word': amount_in_word})
436 if journal_id:
437 allow_check_writing = self.pool.get('account.journal').browse(cr, uid, journal_id, context=context).allow_check_writing
438- default['value'].update({'allow_check':allow_check_writing})
439+ default['value'].update({'allow_check': allow_check_writing})
440 return default
441
442- def print_check(self, cr, uid, ids, context=None):
443- if not ids:
444- return {}
445-
446- check_layout_report = {
447- 'top' : 'account.print.check.top',
448- 'middle' : 'account.print.check.middle',
449- 'bottom' : 'account.print.check.bottom',
450- }
451-
452- check_layout = self.browse(cr, uid, ids[0], context=context).company_id.check_layout
453- return {
454- 'type': 'ir.actions.report.xml',
455- 'report_name':check_layout_report[check_layout],
456- 'datas': {
457- 'model':'account.voucher',
458- 'id': ids and ids[0] or False,
459- 'ids': ids and ids or [],
460- 'report_type': 'pdf'
461- },
462- 'nodestroy': True
463- }
464+ def onchange_journal(self, cr, uid, ids, journal_id, line_ids, tax_id, partner_id, date, amount, ttype, company_id, context=None):
465+ """
466+ Inherited: add currency_id @returned value dictionary
467+ """
468+ vals = super(account_voucher, self).onchange_journal(cr, uid, ids, journal_id, line_ids, tax_id, partner_id, date, amount, ttype, company_id, context=context)
469+ if vals and not vals.get('value', {})['currency_id']:
470+ vals['value']['currency_id'] = self.pool.get("res.users").browse(cr, uid, uid).company_id.currency_id.id
471+ return vals
472+
473+ def copy(self, cr, uid, ids, default=None, context=None):
474+ if default is None:
475+ default = {}
476+ default['check_number'] = False
477+ return super(account_voucher, self).copy(cr, uid, ids, default=default, context=context)
478
479 def fields_view_get(self, cr, uid, view_id=None, view_type=False, context=None, toolbar=False, submenu=False):
480 """
481- Add domain 'allow_check_writting = True' on journal_id field and remove 'widget = selection' on the same
482- field because the dynamic domain is not allowed on such widget
483+ Inherited: Add domain 'allow_check_writing = True' on journal_id
484+ field and remove 'widget = selection' on the same field
485+ because the dynamic domain is not allowed on such widget.
486 """
487- if not context: context = {}
488+ if context == None:
489+ context = {}
490 res = super(account_voucher, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=submenu)
491 doc = etree.XML(res['arch'])
492 nodes = doc.xpath("//field[@name='journal_id']")
493- if context.get('write_check', False) :
494+ if context.get('write_check', False):
495 for node in nodes:
496 node.set('domain', "[('type', '=', 'bank'), ('allow_check_writing','=',True)]")
497 node.set('widget', '')
498 res['arch'] = etree.tostring(doc)
499 return res
500
501+ def print_check(self, cr, uid, ids, context=None):
502+ """
503+ Method will either print the report or will call the Print check wizard.
504+ This button will appear in from view only so, If check is assigned with
505+ check number then it will print the check directly or else it will call
506+ the betch check batch printing wizard to assign check number first and
507+ thenprint the check.
508+
509+ @return: return the action (either report action or act_window action)
510+ """
511+ if context == None:
512+ context = {}
513+ value = {}
514+ model_data = self.pool.get('ir.model.data')
515+ check_layout_report = {
516+ 'top': 'account.print.check.top',
517+ 'middle': 'account.print.check.middle',
518+ 'bottom': 'account.print.check.bottom',
519+ }
520+ check = self.browse(cr, uid, ids[0], context=context)
521+ if check.check_number or check.journal_id.use_preprint_check:
522+ check_layout = check.company_id.check_layout
523+ value = {
524+ 'type': 'ir.actions.report.xml',
525+ 'report_name': check_layout_report[check_layout],
526+ 'datas': {
527+ 'model': 'account.voucher',
528+ 'id': ids and ids[0] or False,
529+ 'ids': ids and ids or [],
530+ 'report_type': 'pdf'
531+ },
532+ 'nodestroy': True
533+ }
534+ else:
535+ form_view = model_data.get_object_reference(cr, uid, 'account_check_writing', 'view_account_check_write')
536+ value = {
537+ 'name': _('Print Check'),
538+ 'view_type': 'form',
539+ 'view_mode': 'tree,form',
540+ 'res_model': 'account.check.write',
541+ 'views': [(form_view and form_view[1] or False, 'form'), (False, 'tree')],
542+ 'type': 'ir.actions.act_window',
543+ 'target': 'new',
544+ 'context': context,
545+ }
546+ return value
547+
548+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
549
550=== modified file 'account_check_writing/account_voucher_view.xml'
551--- account_check_writing/account_voucher_view.xml 2012-12-08 10:33:38 +0000
552+++ account_check_writing/account_voucher_view.xml 2013-11-19 00:05:44 +0000
553@@ -2,30 +2,171 @@
554 <openerp>
555 <data>
556
557- <!-- Supplier write check view -->
558-
559 <record model="ir.ui.view" id="view_vendor_payment_check_form">
560- <field name="name">account.voucher.payment.check.form</field>
561- <field name="model">account.voucher</field>
562- <field name="inherit_id" ref="account_voucher.view_vendor_payment_form" />
563- <field name="arch" type="xml">
564- <field name="amount" position="after">
565- <newline/>
566- <field name="allow_check" invisible="1"/>
567- <field name="amount_in_word" attrs="{'invisible':[('allow_check','!=',1)]}" nolabel="1" colspan="6"/>
568- <newline/>
569- </field>
570+ <field name="name">Account Voucher Check Payment Form</field>
571+ <field name="model">account.voucher</field>
572+ <field name="arch" type="xml">
573+ <form string="Voucher Payment" version="7.0">
574+ <header>
575+ <button name="proforma_voucher" string="Validate" states="draft" invisible="context.get('line_type', False)" class="oe_highlight"/>
576+ <button name="cancel_voucher" string="Cancel" states="draft,proforma" invisible="context.get('line_type', False)"/>
577+ <button name="print_check" string="Print Check" type="object" attrs="{'invisible':['|',('allow_check','!=',True),('state','!=','posted')]}" class="oe_highlight"/>
578+ <button name="action_cancel_draft" type="object" states="cancel" string="Set to Draft" invisible="context.get('line_type', False)"/>
579+ <button name="cancel_voucher" string="Void" type="object" states="posted" invattrs="{'invisible':[('allow_check','!=',True)]}" confirm="Are you sure to unreconcile and cancel this record ?"/>
580+ <field name="state" widget="statusbar" statusbar_visible="draft,posted" statusbar_colors='{"proforma":"blue"}'/>
581+ </header>
582+ <sheet>
583+ <field name="account_id" invisible="True"/>
584+ <field name="pre_line" invisible="True"/>
585+ <field name="type" invisible="True"/>
586+ <field name="allow_check" invisible="True"/>
587+ <field name="currency_id" invisible="True"/>
588+ <group col="10" colspan="4">
589+ <group colspan="6"/>
590+ <group colspan="2">
591+ <field name="check_number" attrs="{'invisible':[('allow_check','!=',True)]}"/>
592+ <field name="date" invisible="context.get('line_type', False)" on_change="onchange_date(date, currency_id, payment_rate_currency_id, amount, company_id, context)"/>
593+ </group>
594+ </group>
595+ <group colspan="4">
596+ <field name="partner_id" required="1" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)" context="{'default_customer': 0, 'search_default_supplier': 1, 'default_supplier': 1, 'invoice_currency': currency_id}" string="Pay to the order of:"/>
597+ </group>
598+ <group col="10" colspan="4">
599+ <field name="amount_in_word" attrs="{'invisible':[('allow_check','!=',True)]}" nolabel="1" colspan="8"/>
600+ <h2>
601+ <field name="amount" invisible="context.get('line_type', False)" on_change="onchange_amount(amount, payment_rate, partner_id, journal_id, currency_id, type, date, payment_rate_currency_id, company_id, context)" class="oe_inline" widget='monetary' options='{"currency_field": "currency_id"}' nolabel="1" colspan="2"/>
602+ </h2>
603+ </group>
604+ <group col="10" colspan="4">
605+ <group colspan="6">
606+ <field name="name" colspan="2" invisible="context.get('line_type', False)" placeholder="e.g. Invoice SAJ/0042"/>
607+ <field name="journal_id"
608+ domain="[('type','in',['bank', 'cash'])]"
609+ widget="selection"
610+ on_change="onchange_journal(journal_id, line_dr_ids, False, partner_id, date, amount, type, company_id, context)"
611+ invisible="context.get('line_type', False)"
612+ string="Payment Method"
613+ context="{'default_type': 'bank', 'default_allow_check_writing':1}"
614+ help="Only journals with 'Allow Check Writing' checked can be used as a payment method on checks. To configure this, go to Accounting > Configuration > Journals > Journals."/>
615+ </group>
616+ <group colspan="2">
617+ <field name="reference" invisible="context.get('line_type', False)" string="Payment Ref" placeholder="e.g. 003/10"/>
618+ <field name="company_id" widget="selection" groups="base.group_multi_company"/>
619+ </group>
620+ </group>
621+ <notebook>
622+ <page string="Payment Information">
623+ <label for="line_dr_ids"/>
624+ <field name="line_dr_ids" context="{'journal_id':journal_id, 'type':type, 'partner_id':partner_id}" on_change="onchange_line_ids(line_dr_ids, line_cr_ids, amount, currency_id, type, context)">
625+ <tree string="Supplier Invoices and Outstanding transactions" editable="bottom" colors="gray:amount==0">
626+ <field name="move_line_id" context="{'journal_id':parent.journal_id, 'partner_id':parent.partner_id}"
627+ on_change="onchange_move_line_id(move_line_id)"
628+ domain="[('account_id.type','=','payable'), ('reconcile_id','=', False), ('partner_id','=',parent.partner_id)]"
629+ required="1"/>
630+ <field name="account_id" groups="base.group_no_one" domain="[('type','=','payable')]"/>
631+ <field name="date_original" readonly="1"/>
632+ <field name="date_due" readonly="1"/>
633+ <field name="amount_original" readonly="1"/>
634+ <field name="amount_unreconciled" readonly="1" groups="account.group_account_user"/>
635+ <field name="reconcile" on_change="onchange_reconcile(reconcile, amount, amount_unreconciled, context)" groups="account.group_account_user"/>
636+ <field name="amount" sum="Total Allocation" on_change="onchange_amount(amount, amount_unreconciled, context)"/>
637+ </tree>
638+ </field>
639+ <label for="line_cr_ids" attrs="{'invisible': [('pre_line','=',False)]}"/>
640+ <field name="line_cr_ids" attrs="{'invisible': [('pre_line','=',False)]}" context="{'journal_id':journal_id, 'partner_id':partner_id}" on_change="onchange_line_ids(line_dr_ids, line_cr_ids, amount, currency_id, type, context)">
641+ <tree string="Credits" editable="bottom" colors="gray:amount==0">
642+ <field name="move_line_id" context="{'journal_id':parent.journal_id, 'partner_id':parent.partner_id}"
643+ on_change="onchange_move_line_id(move_line_id)"
644+ domain="[('account_id.type','=','payable'), ('reconcile_id','=', False), ('partner_id','=',parent.partner_id)]"
645+ required="1"/>
646+ <field name="account_id" groups="base.group_no_one" domain="[('type','=','payable')]"/>
647+ <field name="date_original" readonly="1"/>
648+ <field name="date_due" readonly="1"/>
649+ <field name="amount_original" readonly="1"/>
650+ <field name="amount_unreconciled" readonly="1" groups="account.group_account_user"/>
651+ <field name="reconcile" on_change="onchange_reconcile(reconcile, amount, amount_unreconciled, context)" groups="account.group_account_user"/>
652+ <field name="amount" sum="Total Allocation" on_change="onchange_amount(amount, amount_unreconciled, context)"/>
653+ </tree>
654+ </field>
655+ <group>
656+ <group string="Internal Notes">
657+ <field name="narration" colspan="2" nolabel="1"/>
658+ </group>
659+ <group>
660+ <field name="is_multi_currency" invisible="True"/>
661+ <group col="2" attrs="{'invisible':[('is_multi_currency','=',False)]}">
662+ <separator string="Currency Options" colspan="2"/>
663+ <label for="payment_rate" colspan="1"/>
664+ <div>
665+ <field name="payment_rate" required="1" class="oe_inline" on_change="onchange_amount(amount, payment_rate, partner_id, journal_id, currency_id, type, date, payment_rate_currency_id, company_id, context)"/>
666+ <field name="payment_rate_currency_id" class="oe_inline" on_change="onchange_payment_rate_currency(currency_id, payment_rate, payment_rate_currency_id, date, amount, company_id, context)" groups="base.group_multi_currency"/>
667+ </div>
668+ <field name="currency_help_label" colspan="2" nolabel="1" class="oe_grey"/>
669+ <field name="paid_amount_in_company_currency" colspan="2" invisible="1"/>
670+ </group>
671+ <group col="2">
672+ <separator string="Payment Options" colspan="2"/>
673+ <field name="writeoff_amount" widget='monetary' options='{"currency_field": "currency_id"}'/>
674+ <field name="payment_option" required="1"/>
675+ <field name="writeoff_acc_id"
676+ attrs="{'invisible':[('payment_option','!=','with_writeoff')], 'required':[('payment_option','=','with_writeoff')]}"
677+ domain="[('type','=','other')]"/>
678+ <field name="comment"
679+ attrs="{'invisible':[('payment_option','!=','with_writeoff')]}"/>
680+ <field name="analytic_id"
681+ groups="analytic.group_analytic_accounting"/>
682+ </group>
683+ </group>
684+ </group>
685+ </page>
686+ <page string="Journal Items" attrs="{'invisible': [('state','!=','posted')]}">
687+ <group col="4">
688+ <field name="period_id"/>
689+ <field name="audit"/>
690+ <field name="number"/>
691+ </group>
692+ <field name="move_ids" readonly="1">
693+ <tree string="Journal Items">
694+ <field name="move_id"/>
695+ <field name="ref"/>
696+ <field name="date"/>
697+ <field name="statement_id"/>
698+ <field name="partner_id"/>
699+ <field name="account_id"/>
700+ <field name="name"/>
701+ <field name="debit"/>
702+ <field name="credit"/>
703+ <field name="state"/>
704+ <field name="reconcile_id"/>
705+ <field name="amount_currency" groups="base.group_multi_currency"/>
706+ <field name="currency_id" groups="base.group_multi_currency"/>
707+ </tree>
708+ </field>
709+ </page>
710+ </notebook>
711+ </sheet>
712+ <div class="oe_chatter">
713+ <field name="message_follower_ids" widget="mail_followers"/>
714+ <field name="message_ids" widget="mail_thread"/>
715+ </div>
716+ </form>
717+ </field>
718+ </record>
719+
720+ <record model="ir.ui.view" id="view_voucher_tree_inheirt">
721+ <field name="name">account.voucher.tree.inherit</field>
722+ <field name="model">account.voucher</field>
723+ <field name="inherit_id" ref="account_voucher.view_voucher_tree"/>
724+ <field name="arch" type="xml">
725 <field name="number" position="replace">
726- <field name="number" attrs="{'readonly':[('allow_check','!=',1)]}" />
727+ <field name="number" invisible="context.get('write_check', False)"/>
728+ <field name="check_number" invisible="not context.get('write_check', False)"/>
729 </field>
730- <button name="proforma_voucher" position="after">
731- <button name="print_check" icon="gtk-print" string="Print Check" type="object" attrs="{'invisible':['|',('allow_check','!=',1),('state','!=','posted') ]}" class="oe_highlight"/>
732- </button>
733 </field>
734 </record>
735
736 <record id="action_write_check" model="ir.actions.act_window">
737- <field name="name">Write Checks</field>
738+ <field name="name">Checks</field>
739 <field name="res_model">account.voucher</field>
740 <field name="view_type">form</field>
741 <field name="view_mode">form,tree</field>
742
743=== added file 'account_check_writing/amount_to_text_en.py'
744--- account_check_writing/amount_to_text_en.py 1970-01-01 00:00:00 +0000
745+++ account_check_writing/amount_to_text_en.py 2013-11-19 00:05:44 +0000
746@@ -0,0 +1,61 @@
747+# -*- coding: utf-8 -*-
748+##############################################################################
749+#
750+# OpenERP, Open Source Management Solution
751+# Copyright (C) 2004-Today OpenERP S.A. (<http://www.openerp.com>).
752+#
753+# This program is free software: you can redistribute it and/or modify
754+# it under the terms of the GNU Affero General Public License as
755+# published by the Free Software Foundation, either version 3 of the
756+# License, or (at your option) any later version.
757+#
758+# This program is distributed in the hope that it will be useful,
759+# but WITHOUT ANY WARRANTY; without even the implied warranty of
760+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
761+# GNU Affero General Public License for more details.
762+#
763+# You should have received a copy of the GNU Affero General Public License
764+# along with this program. If not, see <http://www.gnu.org/licenses/>.
765+#
766+##############################################################################
767+
768+import logging
769+from openerp.tools.translate import _
770+from openerp.tools import amount_to_text_en
771+
772+_logger = logging.getLogger(__name__)
773+
774+#This will file methods will facilitates the US specific check amount to text
775+#conversion. When we convert the amount to text using server tools api it
776+#produces following output for amount 4500.00:
777+# Four Thousand, Five Hundred euro and Zero Cent
778+#but when it comes to USd check expected output should is:
779+# Four Thousand, Five Hundred and 0/100
780+#So this method below will generate the above output for the USD currency for
781+#the places where we have this specific function called.
782+
783+
784+def amount_to_text(number, currency):
785+ if currency == "usd":
786+ number = '%.2f' % number
787+ list = str(number).split('.')
788+ start_word = amount_to_text_en.english_number(int(list[0]))
789+ end_word = "%d/%d"%(int(list[1]),100)
790+ return ' '.join(filter(None, [start_word, 'and', end_word]))
791+ else:
792+ return amount_to_text_en.amount_to_text(number, currency)
793+
794+
795+_translate_funcs = {'en' : amount_to_text}
796+
797+def amount_to_text(nbr, lang='en', currency='euro'):
798+ """
799+ Converts an integer to its textual representation, using the
800+ language set in the context if any.
801+ """
802+ if lang not in _translate_funcs:
803+ _logger.warning(_("no translation function found for lang: '%s'"), lang)
804+ lang = 'en'
805+ return _translate_funcs[lang](abs(nbr), currency)
806+
807+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
808
809=== modified file 'account_check_writing/report/check_print.py'
810--- account_check_writing/report/check_print.py 2012-12-06 14:56:32 +0000
811+++ account_check_writing/report/check_print.py 2013-11-19 00:05:44 +0000
812@@ -2,7 +2,8 @@
813 ##############################################################################
814 #
815 # OpenERP, Open Source Management Solution
816-# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
817+# Copyright (C) 2012-Today Ursa Information Systems
818+# <http://www.ursainfosystems.com>.
819 #
820 # This program is free software: you can redistribute it and/or modify
821 # it under the terms of the GNU Affero General Public License as
822@@ -20,68 +21,155 @@
823 ##############################################################################
824
825 import time
826+from operator import itemgetter
827 from openerp.report import report_sxw
828-from openerp.tools import amount_to_text_en
829+from openerp.tools.translate import _
830+
831+N = 9
832+STARS = 70
833+LINEKEYS = ['date_due', 'date_original', 'name', 'amount_original', 'amount_due', 'amount']
834
835 class report_print_check(report_sxw.rml_parse):
836+
837 def __init__(self, cr, uid, name, context):
838 super(report_print_check, self).__init__(cr, uid, name, context)
839- self.number_lines = 0
840- self.number_add = 0
841 self.localcontext.update({
842 'time': time,
843- 'get_lines': self.get_lines,
844- 'fill_stars' : self.fill_stars,
845+ 'get_data': self.get_vouchers,
846 })
847- def fill_stars(self, amount):
848- amount = amount.replace('Dollars','')
849- if len(amount) < 100:
850- stars = 100 - len(amount)
851- return ' '.join([amount,'*'*stars])
852-
853- else: return amount
854-
855- def get_lines(self, voucher_lines):
856- result = []
857- self.number_lines = len(voucher_lines)
858- for i in range(0, min(10,self.number_lines)):
859- if i < self.number_lines:
860- res = {
861- 'date_due' : voucher_lines[i].date_due,
862- 'name' : voucher_lines[i].name,
863- 'amount_original' : voucher_lines[i].amount_original and voucher_lines[i].amount_original or False,
864- 'amount_unreconciled' : voucher_lines[i].amount_unreconciled and voucher_lines[i].amount_unreconciled or False,
865- 'amount' : voucher_lines[i].amount and voucher_lines[i].amount or False,
866- }
867- else :
868- res = {
869- 'date_due' : False,
870- 'name' : False,
871- 'amount_original' : False,
872- 'amount_due' : False,
873- 'amount' : False,
874- }
875- result.append(res)
876- return result
877+
878+ def _getchunk_line(self, defaults=None):
879+ """
880+ Method Prepares a speical line to be printed on check description setion
881+ with given defaults values.
882+ @param defaults: dict with default values to be added on lines.
883+ @return: a dict speical lines to be printed on check.
884+ """
885+ if defaults == None:
886+ defaults = {}
887+ line = dict.fromkeys(LINEKEYS, "")
888+ line.update(defaults)
889+ return line
890+
891+ def _prepare_line(self, line, credit=False):
892+ sign = credit and -1 or 1
893+ return {
894+ 'date_due': line.date_due,
895+ 'date_original': line.date_original,
896+ 'name': line.move_line_id and line.move_line_id.ref or line.name,
897+ 'amount_original': line.amount_original and sign * line.amount_original or False,
898+ 'amount_due': line.amount_unreconciled and sign * line.amount_unreconciled or False,
899+ 'amount': line.amount and sign * line.amount or False,
900+ }
901+
902+ def _prepare_pages(self, voucher, lines, n):
903+ '''
904+ Prepare page info for check. Adds the empty lines on description section
905+ to keep check well fromatted
906+ @param voucher: voucher browse object to be printed.
907+ @param lines: total payment lines to be added on check.
908+ @param n: max line to be printed on description section for page stub.
909+ '''
910+ check_lines = [lines[i:i + n] for i in range(0, len(lines), n)]
911+ return [{'lines': chunk,
912+ 'amount': voucher.amount,
913+ 'amount_words': False,
914+ 'number': self._get_check_number(voucher),
915+ 'name': voucher.name,
916+ 'use_preprint_check': voucher.journal_id.use_preprint_check,
917+ 'date': voucher.date,
918+ 'partner': voucher.partner_id.name,
919+ 'address': voucher.partner_id}
920+ for chunk in check_lines]
921+
922+ def _get_check_number(self, voucher):
923+ '''
924+ Wrapper function for special case where customisation may require
925+ getting check number else where in child parser
926+ '''
927+ return voucher.journal_id.use_preprint_check and '' or voucher.check_number
928+
929+ def _prepare_first_page(self, voucher, stars):
930+ '''
931+ Change amounts on first page of check, can be inherited or overridden.
932+
933+ '''
934+ return {
935+ 'chk_amount': voucher.amount,
936+ 'amount_words': voucher.amount_in_word and
937+ voucher.amount_in_word.ljust(stars, '*') or ''.ljust(stars, '*')
938+ }
939+
940+ def get_vouchers(self, objects, n=N, stars=STARS):
941+ '''
942+ Wrapper function to get record to be printed on rml. It will add the
943+ pages and correction section to be printed.
944+ @param: objects - a list of objects
945+ @param: n - number of max line in description section.
946+ @param: stars - max number of start to be added after amount fo words to
947+ fill the line.
948+ @returns a list of pages as a dict.
949+ '''
950+ res = []
951+ for voucher in objects:
952+ res.extend(self._get_data(voucher, n, stars))
953+ return res
954+
955+ def _get_data(self, voucher, n=N, stars=STARS):
956+ '''
957+ Parses the voucher and chunks it in to a dictionary for the report.
958+ - It arranges the items section for credit and debit section to be printed.
959+ - Pad the extra lines on stub description section to be printed as empty spaces.
960+ - Finally, Add the check amounts to first page and prepare the final value.
961+ '''
962+ credit_section = voucher.company_id.credit_section
963+ suppress_unpaid = voucher.company_id.suppress_unpaid
964+ #first chunk up the lines
965+ dr_lines = [self._prepare_line(line) for line in voucher.line_dr_ids
966+ if line.amount or not suppress_unpaid]
967+ cr_lines = [self._prepare_line(line, 1) for line in voucher.line_cr_ids
968+ if line.amount or not suppress_unpaid]
969+ #This section just arranges the items
970+ if credit_section:
971+ dr_lines.sort(key=itemgetter('date_original'))
972+ cr_lines.sort(key=itemgetter('date_original'))
973+ #credits to next page if needed
974+ lines = ([self._getchunk_line({'name': _('Invoices')})] + dr_lines +
975+ (cr_lines and [self._getchunk_line({'name': _('Credits')})] + cr_lines or []))
976+ else:
977+ lines = dr_lines + cr_lines
978+ lines.sort(key=itemgetter('date_original'))
979+ #just pad up the lines -
980+ #only 1 field really necessary RML will handle rest
981+ lines.extend([self._getchunk_line() for i in range(n - len(lines) % n)])
982+ pages = self._prepare_pages(voucher, lines, n)
983+ #now add the check amounts to first page
984+ pages[0].update(self._prepare_first_page(voucher, stars))
985+ if not voucher.company_id.multi_stub:
986+ return [pages[0]]
987+ return pages
988
989 report_sxw.report_sxw(
990- 'report.account.print.check.top',
991- 'account.voucher',
992- 'addons/account_check_writing/report/check_print_top.rml',
993- parser=report_print_check,header=False
994+ 'report.account.print.check.top',
995+ 'account.voucher',
996+ 'addons/account_check_writing/report/check_print_top.rml',
997+ parser=report_print_check,
998+ header=False
999 )
1000
1001 report_sxw.report_sxw(
1002 'report.account.print.check.middle',
1003 'account.voucher',
1004 'addons/account_check_writing/report/check_print_middle.rml',
1005- parser=report_print_check,header=False
1006+ parser=report_print_check,
1007+ header=False
1008 )
1009
1010 report_sxw.report_sxw(
1011 'report.account.print.check.bottom',
1012 'account.voucher',
1013 'addons/account_check_writing/report/check_print_bottom.rml',
1014- parser=report_print_check,header=False
1015+ parser=report_print_check,
1016+ header=False
1017 )
1018 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
1019
1020=== modified file 'account_check_writing/report/check_print_bottom.rml'
1021--- account_check_writing/report/check_print_bottom.rml 2012-11-29 22:26:45 +0000
1022+++ account_check_writing/report/check_print_bottom.rml 2013-11-19 00:05:44 +0000
1023@@ -1,8 +1,8 @@
1024 <?xml version="1.0"?>
1025-<document filename="test.pdf">
1026- <template pageSize="(595, 842)" title="Test" author="Martin Simon" allowSplitting="20">
1027+<document filename="Check (Bottom).pdf">
1028+ <template pageSize="(612.0,792.0)" title="Check (Bottom)" author="Martin Simon" allowSplitting="20">
1029 <pageTemplate id="first">
1030- <frame id="first" x1="13.0" y1="0.0" width="567" height="765"/>
1031+ <frame id="first" x1="13.0" y1="0.0" width="567" height="785"/>
1032 </pageTemplate>
1033 </template>
1034 <stylesheet>
1035@@ -14,18 +14,6 @@
1036 <blockAlignment value="LEFT"/>
1037 <blockValign value="TOP"/>
1038 </blockTableStyle>
1039- <blockTableStyle id="Table4">
1040- <blockAlignment value="LEFT"/>
1041- <blockValign value="TOP"/>
1042- </blockTableStyle>
1043- <blockTableStyle id="Table5">
1044- <blockAlignment value="LEFT"/>
1045- <blockValign value="TOP"/>
1046- </blockTableStyle>
1047- <blockTableStyle id="Table12">
1048- <blockAlignment value="LEFT"/>
1049- <blockValign value="TOP"/>
1050- </blockTableStyle>
1051 <blockTableStyle id="Table2">
1052 <blockAlignment value="LEFT"/>
1053 <blockValign value="TOP"/>
1054@@ -46,10 +34,22 @@
1055 <blockAlignment value="LEFT"/>
1056 <blockValign value="TOP"/>
1057 </blockTableStyle>
1058+ <blockTableStyle id="Table4">
1059+ <blockAlignment value="LEFT"/>
1060+ <blockValign value="TOP"/>
1061+ </blockTableStyle>
1062+ <blockTableStyle id="Table5">
1063+ <blockAlignment value="LEFT"/>
1064+ <blockValign value="TOP"/>
1065+ </blockTableStyle>
1066 <blockTableStyle id="Table7">
1067 <blockAlignment value="LEFT"/>
1068 <blockValign value="TOP"/>
1069 </blockTableStyle>
1070+ <blockTableStyle id="Table13">
1071+ <blockAlignment value="LEFT"/>
1072+ <blockValign value="TOP"/>
1073+ </blockTableStyle>
1074 <blockTableStyle id="Table8">
1075 <blockAlignment value="LEFT"/>
1076 <blockValign value="TOP"/>
1077@@ -61,30 +61,43 @@
1078 <initialize>
1079 <paraStyle name="all" alignment="justify"/>
1080 </initialize>
1081- <paraStyle name="P1" rightIndent="-1.0" leftIndent="0.0" fontName="Helvetica"/>
1082- <paraStyle name="P2" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica"/>
1083- <paraStyle name="P3" fontName="Helvetica"/>
1084- <paraStyle name="P4" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT"/>
1085- <paraStyle name="P5" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="RIGHT"/>
1086- <paraStyle name="P6" fontName="Helvetica-Bold" fontSize="9.0" leading="11"/>
1087- <paraStyle name="P7" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT"/>
1088- <paraStyle name="P8" fontName="Helvetica" fontSize="9.0" leading="11"/>
1089- <paraStyle name="P9" fontName="Helvetica" fontSize="10.0" leading="13"/>
1090- <paraStyle name="P10" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="RIGHT"/>
1091- <paraStyle name="P11" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="LEFT"/>
1092- <paraStyle name="P12" fontName="Helvetica" fontSize="12.0" leading="15"/>
1093- <paraStyle name="P13" fontName="Helvetica"/>
1094- <paraStyle name="P14" fontName="Helvetica" fontSize="10.0" leading="13"/>
1095- <paraStyle name="P15" fontName="Helvetica" fontSize="10.0" leading="13"/>
1096- <paraStyle name="P16" fontName="Helvetica-Bold" fontSize="9.0" leading="11"/>
1097- <paraStyle name="P17" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT"/>
1098- <paraStyle name="P18" fontName="Helvetica" fontSize="9.0" leading="11"/>
1099- <paraStyle name="P19" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT"/>
1100- <paraStyle name="P20" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT"/>
1101- <paraStyle name="P21" fontName="Helvetica" fontSize="8.0" leading="10"/>
1102- <paraStyle name="P22" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT"/>
1103- <paraStyle name="P23" fontName="Helvetica-Bold" fontSize="8.0" leading="10"/>
1104- <paraStyle name="P24" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT"/>
1105+ <paraStyle name="P1" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica"/>
1106+ <paraStyle name="P2" fontName="Helvetica"/>
1107+ <paraStyle name="P3" fontName="Helvetica-Bold" fontSize="8.0" leading="10"/>
1108+ <paraStyle name="P4" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT"/>
1109+ <paraStyle name="P5" fontName="Helvetica" fontSize="8.0" leading="10"/>
1110+ <paraStyle name="P6" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT"/>
1111+ <paraStyle name="P7" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT"/>
1112+ <paraStyle name="P8" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT"/>
1113+ <paraStyle name="P9" rightIndent="-1.0" leftIndent="0.0" fontName="Helvetica" fontSize="6.0" leading="8"/>
1114+ <paraStyle name="P10" fontName="Helvetica"/>
1115+ <paraStyle name="P11" fontName="Helvetica-Bold" fontSize="8.0" leading="10"/>
1116+ <paraStyle name="P12" fontName="Helvetica-Bold" fontSize="8.0" leading="10"/>
1117+ <paraStyle name="P13" fontName="Helvetica-Bold" fontSize="8.0" leading="10"/>
1118+ <paraStyle name="P14" fontName="Helvetica-Bold" fontSize="10.0" leading="10" alignment="RIGHT"/>
1119+ <paraStyle name="P15" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT"/>
1120+ <paraStyle name="P16" fontName="Helvetica-Bold" fontSize="8.0" leading="10"/>
1121+ <paraStyle name="P17" fontName="Helvetica-Bold" fontSize="10.0" leading="10" alignment="RIGHT"/>
1122+ <paraStyle name="P18" fontName="Helvetica-Bold" fontSize="8.0" leading="10"/>
1123+ <paraStyle name="P19" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT"/>
1124+ <paraStyle name="P20" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT"/>
1125+ <paraStyle name="P21" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT"/>
1126+ <paraStyle name="P22" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT"/>
1127+ <paraStyle name="P23" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT"/>
1128+ <paraStyle name="P24" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT"/>
1129+ <paraStyle name="P25" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT"/>
1130+ <paraStyle name="P26" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT"/>
1131+ <paraStyle name="P27" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT"/>
1132+ <paraStyle name="P28" fontName="Helvetica-Bold" fontSize="10.0" leading="11" alignment="RIGHT"/>
1133+ <paraStyle name="P29" fontName="Helvetica-Bold" fontSize="10.0" leading="13"/>
1134+ <paraStyle name="P30" fontName="Helvetica" fontSize="7.0" leading="9"/>
1135+ <paraStyle name="P31" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT"/>
1136+ <paraStyle name="P32" fontName="Helvetica" fontSize="10.0" leading="11" alignment="RIGHT"/>
1137+ <paraStyle name="P33" fontName="Helvetica" fontSize="9.0" leading="11"/>
1138+ <paraStyle name="P34" fontName="Helvetica" fontSize="9.0" leading="11"/>
1139+ <paraStyle name="P35" fontName="Helvetica" fontSize="11.0" leading="14"/>
1140+ <paraStyle name="P36" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT"/>
1141+ <paraStyle name="P38" fontName="Helvetica" fontSize="11.0" leading="10"/>
1142 <paraStyle name="Standard" fontName="Helvetica"/>
1143 <paraStyle name="Heading" fontName="Helvetica" fontSize="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/>
1144 <paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
1145@@ -96,75 +109,133 @@
1146 <images/>
1147 </stylesheet>
1148 <story>
1149- <para style="P1">[[repeatIn(objects,'voucher')]]</para>
1150- <blockTable colWidths="568.0" style="Table2" rowHeights="285">
1151- <tr>
1152- <td>
1153- <blockTable colWidths="445.0,117.0" style="Table6">
1154+ <para style="P14">[[repeatIn(get_data(objects),'page')]]</para>
1155+ <blockTable colWidths="568.0" style="Table1">
1156+ <tr>
1157+ <td>
1158+ <para style="P2">
1159+ <font color="white"> </font>
1160+ </para>
1161+ </td>
1162+ </tr>
1163+ <tr>
1164+ <td>
1165+ <para style="P2">
1166+ <font color="white"> </font>
1167+ </para>
1168+ </td>
1169+ </tr>
1170+ </blockTable>
1171+ <blockTable colWidths="568.0" style="Table2">
1172+ <tr>
1173+ <td>
1174+ <blockTable colWidths="369.0,97.0,97.0" style="Table6">
1175 <tr>
1176 <td>
1177- <para style="P16">[[voucher.partner_id.name]]</para>
1178- </td>
1179- <td>
1180- <para style="P16">[[ formatLang(voucher.date , date=True) or '' ]] [[ voucher.journal_id.use_preprint_check and voucher.chk_seq or '' ]]</para>
1181+ <para style="P3">[[ page['partner'] ]]</para>
1182+ </td>
1183+ <td>
1184+ <para style="P3">[[ formatLang(page['date'], date=True) or '' ]]</para>
1185+ </td>
1186+ <td>
1187+ <para style="P3">[[ not page['use_preprint_check'] and page['number'] or '' ]]</para>
1188 </td>
1189 </tr>
1190 </blockTable>
1191 <blockTable colWidths="81.0,186.0,83.0,81.0,54.0,78.0" style="Table10">
1192 <tr>
1193 <td>
1194- <para style="P4">Due Date</para>
1195- </td>
1196- <td>
1197- <para style="P4">Description</para>
1198- </td>
1199- <td>
1200- <para style="P4">Original Amount</para>
1201- </td>
1202- <td>
1203- <para style="P4">Balance Due</para>
1204- </td>
1205- <td>
1206- <para style="P4">Discount</para>
1207- </td>
1208- <td>
1209- <para style="P4">Payment</para>
1210+ <para style="P9">Due Date</para>
1211+ </td>
1212+ <td>
1213+ <para style="P9">Description</para>
1214+ </td>
1215+ <td>
1216+ <para style="P9">Original Amount</para>
1217+ </td>
1218+ <td>
1219+ <para style="P9">Balance Due</para>
1220+ </td>
1221+ <td>
1222+ <para style="P9">Discount</para>
1223+ </td>
1224+ <td>
1225+ <para style="P9">Payment</para>
1226 </td>
1227 </tr>
1228 <tr>
1229 <td>
1230- <para style="P19">[[ repeatIn(get_lines(voucher.line_dr_ids),'l') ]] [[ formatLang(l['date_original'] ,date=True) or '' ]]</para>
1231- </td>
1232- <td>
1233- <para style="P19">[[ l['name'] ]]</para>
1234- </td>
1235- <td>
1236- <para style="P19">[[formatLang( l['amount_original']) ]]</para>
1237- </td>
1238- <td>
1239- <para style="P19">[[ formatLang( l['amount_due']) ]]</para>
1240- </td>
1241- <td>
1242- <para style="P19">
1243+ <para style="P7">
1244+ <font face="Helvetica" size="2.0">[[ repeatIn(page['lines'],'l') ]]</font>
1245+ <font face="Helvetica"> [[ formatLang(l['date_original'] ,date=True) or '' ]]</font>
1246+ </para>
1247+ </td>
1248+ <td>
1249+ <para style="P7">[[ l['name'] ]]</para>
1250+ </td>
1251+ <td>
1252+ <para style="P7">[[formatLang(l['amount_original']) ]]</para>
1253+ </td>
1254+ <td>
1255+ <para style="P7">[[ formatLang(l['amount_due']) ]]</para>
1256+ </td>
1257+ <td>
1258+ <para style="P7">
1259 <font color="white"> </font>
1260 </para>
1261 </td>
1262 <td>
1263- <para style="P19">[[ formatLang (l['amount']) ]]</para>
1264+ <para style="P5">[[ formatLang(l['amount']) ]]</para>
1265 </td>
1266 </tr>
1267 </blockTable>
1268 <blockTable colWidths="485.0,77.0" style="Table11">
1269 <tr>
1270 <td>
1271- <para style="P24">Check Amount</para>
1272- </td>
1273- <td>
1274- <para style="P23">[[ formatLang (voucher.amount) ]]</para>
1275+ <para style="P4">Check Amount</para>
1276+ </td>
1277+ <td>
1278+ <para style="P3">[[ formatLang(page['amount']) or 'VOID' ]]</para>
1279+ </td>
1280+ </tr>
1281+ <tr>
1282+ <td>
1283+ <para style="P4">
1284+ <font color="white"> </font>
1285+ </para>
1286+ </td>
1287+ <td>
1288+ <para style="P3">
1289+ <font color="white"> </font>
1290+ </para>
1291+ </td>
1292+ </tr>
1293+ <tr>
1294+ <td>
1295+ <para style="P4">
1296+ <font color="white"> </font>
1297+ </para>
1298+ </td>
1299+ <td>
1300+ <para style="P3">
1301+ <font color="white"> </font>
1302+ </para>
1303+ </td>
1304+ </tr>
1305+ <tr>
1306+ <td>
1307+ <para style="P4">
1308+ <font color="white"> </font>
1309+ </para>
1310+ </td>
1311+ <td>
1312+ <para style="P3">
1313+ <font color="white"> </font>
1314+ </para>
1315 </td>
1316 </tr>
1317 </blockTable>
1318- <para style="P3">
1319+ <para style="P2">
1320 <font color="white"> </font>
1321 </para>
1322 </td>
1323@@ -173,146 +244,302 @@
1324 <blockTable colWidths="568.0" style="Table3">
1325 <tr>
1326 <td>
1327- <blockTable colWidths="446.0,116.0" style="Table7">
1328- <tr>
1329- <td>
1330- <para style="P16">[[voucher.partner_id.name]]</para>
1331- </td>
1332- <td>
1333- <para style="P16">[[ formatLang(voucher.date , date=True) or '' ]] [[ voucher.journal_id.use_preprint_check and voucher.chk_seq or '' ]]</para>
1334- </td>
1335- </tr>
1336- </blockTable>
1337- <blockTable colWidths="82.0,185.0,89.0,76.0,52.0,78.0" style="Table8">
1338- <tr>
1339- <td>
1340- <para style="P4">Due Date</para>
1341- </td>
1342- <td>
1343- <para style="P4">Description</para>
1344- </td>
1345- <td>
1346- <para style="P4">Original Amount</para>
1347- </td>
1348- <td>
1349- <para style="P4">Balance Due</para>
1350- </td>
1351- <td>
1352- <para style="P4">Discount</para>
1353- </td>
1354- <td>
1355- <para style="P4">Payment</para>
1356- </td>
1357- </tr>
1358- <tr>
1359- <td>
1360- <para style="P19">[[ repeatIn(get_lines(voucher.line_dr_ids),'l') ]] [[ formatLang(l['date_original'] ,date=True) or '' ]]</para>
1361- </td>
1362- <td>
1363- <para style="P19">[[ l['name'] ]]</para>
1364- </td>
1365- <td>
1366- <para style="P19">[[ formatLang (l['amount_original']) ]]</para>
1367- </td>
1368- <td>
1369- <para style="P19">[[ formatLang (l['amount_due']) ]]</para>
1370- </td>
1371- <td>
1372- <para style="P19">
1373- <font color="white"> </font>
1374- </para>
1375- </td>
1376- <td>
1377- <para style="P19">[[ formatLang (l['amount']) ]]</para>
1378- </td>
1379- </tr>
1380- </blockTable>
1381- <blockTable colWidths="485.0,77.0" style="Table9" rowHeights="40.5">
1382- <tr>
1383- <td>
1384- <para style="P17">Check Amount</para>
1385- </td>
1386- <td>
1387- <para style="P16">[[ formatLang (voucher.amount) ]]</para>
1388- </td>
1389- </tr>
1390- </blockTable>
1391- <para style="P3">
1392- <font color="white"> </font>
1393- </para>
1394+ <blockTable colWidths="370.0,96.0,96.0" style="Table4">
1395+ <tr>
1396+ <td>
1397+ <para style="P3">[[ page['partner'] ]]</para>
1398+ </td>
1399+ <td>
1400+ <para style="P3">[[ formatLang(page['date'], date=True) or '' ]]</para>
1401+ </td>
1402+ <td>
1403+ <para style="P3">[[ not page['use_preprint_check'] and page['number'] or '' ]]</para>
1404+ </td>
1405+ </tr>
1406+ </blockTable>
1407+ <blockTable colWidths="82.0,185.0,89.0,76.0,52.0,78.0" style="Table5">
1408+ <tr>
1409+ <td>
1410+ <para style="P9">Due Date</para>
1411+ </td>
1412+ <td>
1413+ <para style="P9">Description</para>
1414+ </td>
1415+ <td>
1416+ <para style="P9">Original Amount</para>
1417+ </td>
1418+ <td>
1419+ <para style="P9">Balance Due</para>
1420+ </td>
1421+ <td>
1422+ <para style="P9">Discount</para>
1423+ </td>
1424+ <td>
1425+ <para style="P9">Payment</para>
1426+ </td>
1427+ </tr>
1428+ <tr>
1429+ <td>
1430+ <para style="P7">
1431+ <font face="Helvetica" size="2.0">[[ repeatIn(page['lines'],'l') ]]</font>
1432+ <font face="Helvetica"> [[ formatLang(l['date_original'] ,date=True) or '' ]]</font>
1433+ </para>
1434+ </td>
1435+ <td>
1436+ <para style="P7">[[ l['name'] ]]</para>
1437+ </td>
1438+ <td>
1439+ <para style="P7">[[formatLang(l['amount_original']) ]]</para>
1440+ </td>
1441+ <td>
1442+ <para style="P7">[[ formatLang(l['amount_due']) ]]</para>
1443+ </td>
1444+ <td>
1445+ <para style="P7">
1446+ <font color="white"> </font>
1447+ </para>
1448+ </td>
1449+ <td>
1450+ <para style="P5">[[ formatLang(l['amount']) ]]</para>
1451+ </td>
1452+ </tr>
1453+ </blockTable>
1454+ <blockTable colWidths="485.0,77.0" style="Table7">
1455+ <tr>
1456+ <td>
1457+ <para style="P4">Check Amount</para>
1458+ </td>
1459+ <td>
1460+ <para style="P3">[[ formatLang(page['amount']) or 'VOID' ]]</para>
1461+ </td>
1462+ </tr>
1463+ <tr>
1464+ <td>
1465+ <para style="P8">
1466+ <font color="white"> </font>
1467+ </para>
1468+ </td>
1469+ <td>
1470+ <para style="P6">
1471+ <font color="white"> </font>
1472+ </para>
1473+ </td>
1474+ </tr>
1475+ <tr>
1476+ <td>
1477+ <para style="P8">
1478+ <font color="white"> </font>
1479+ </para>
1480+ </td>
1481+ <td>
1482+ <para style="P6">
1483+ <font color="white"> </font>
1484+ </para>
1485+ </td>
1486+ </tr>
1487+ <tr>
1488+ <td>
1489+ <para style="P8">
1490+ <font color="white"> </font>
1491+ </para>
1492+ </td>
1493+ <td>
1494+ <para style="P6">
1495+ <font color="white"> </font>
1496+ </para>
1497+ </td>
1498+ </tr>
1499+ <tr>
1500+ <td>
1501+ <para style="P8">
1502+ <font color="white"> </font>
1503+ </para>
1504+ </td>
1505+ <td>
1506+ <para style="P6">
1507+ <font color="white"> </font>
1508+ </para>
1509+ </td>
1510+ </tr>
1511+ </blockTable>
1512+
1513+ <blockTable colWidths="56.0,420.0,86.0" style="Table4">
1514+ <tr>
1515+ <td>
1516+ <para style="P3">
1517+ <font color="white"> </font>
1518+ </para>
1519+ </td>
1520+ <td>
1521+ <para style="P3">
1522+ <font color="white"> </font>
1523+ </para>
1524+ </td>
1525+ <td>
1526+ <para style="P28">
1527+ <font face="Helvetica">[[ not page['use_preprint_check'] and page['number'] or '' ]]</font>
1528+ </para>
1529+ </td>
1530+ </tr>
1531+ <tr>
1532+ <td>
1533+ <para style="P3">
1534+ <font color="white"> </font>
1535+ </para>
1536+ </td>
1537+ <td>
1538+ <para style="P3">
1539+ <font color="white"> </font>
1540+ </para>
1541+ </td>
1542+ <td>
1543+ <para style="P3">
1544+ <font color="white"> </font>
1545+ </para>
1546+ </td>
1547+ </tr>
1548+ <tr>
1549+ <td>
1550+ <para style="P38">
1551+ <font color="white"> </font>
1552+ </para>
1553+ </td>
1554+ <td>
1555+ <para style="P38">
1556+ <font color="white"></font>
1557+ </para>
1558+ </td>
1559+ <td>
1560+ <para style="P38">
1561+ <font color="white"> </font>
1562+ </para>
1563+ </td>
1564+ </tr>
1565+ <tr>
1566+ <td>
1567+ <para style="P3">
1568+ <font color="white"> </font>
1569+ </para>
1570+ </td>
1571+ <td>
1572+ <para style="P29">
1573+ <font face="Helvetica">[[ page['amount_words'] or 'VOID'.ljust(70, '*') ]]</font>
1574+ </para>
1575+ </td>
1576+ <td>
1577+ <para style="P28">
1578+ <font color="white"> </font>
1579+ </para>
1580+ </td>
1581+ </tr>
1582+ <tr>
1583+ <td>
1584+ <para style="P2">
1585+ <font color="white"> </font>
1586+ </para>
1587+ </td>
1588+ <td>
1589+ <para style="P35">
1590+ <font color="white"> </font>
1591+ </para>
1592+ </td>
1593+ <td>
1594+ <para style="P3">
1595+ <font color="white"> </font>
1596+ </para>
1597+ </td>
1598+ </tr>
1599+ <tr>
1600+ <td>
1601+ <para style="P3">
1602+ <font color="white"> </font>
1603+ </para>
1604+ </td>
1605+ <td>
1606+ <para style="P36">
1607+ <font face="Helvetica">[[ formatLang(page['date'] , date=True) or '' ]]</font>
1608+ </para>
1609+ </td>
1610+ <td>
1611+ <para style="P32">
1612+ <font face="Helvetica">[[ 'chk_amount' in page and formatLang(page['chk_amount']) or 'VOID' ]]</font>
1613+ </para>
1614+ </td>
1615+ </tr>
1616+ <tr>
1617+ <td>
1618+ <para style="P3">
1619+ <font color="white"> </font>
1620+ </para>
1621+ </td>
1622+ <td>
1623+ <para style="P3">
1624+ <font color="white"></font>
1625+ </para>
1626+ </td>
1627+ <td>
1628+ <para style="P3">
1629+ <font color="white"> </font>
1630+ </para>
1631+ </td>
1632+ </tr>
1633+ <tr>
1634+ <td>
1635+ <para style="P3">
1636+ <font color="white"> </font>
1637+ </para>
1638+ </td>
1639+ <td>
1640+ <para style="P3">
1641+ <font face="Helvetica" size="9.0">[[ page['partner'] ]]</font>
1642+ </para>
1643+ </td>
1644+ <td>
1645+ <para style="P3">
1646+ <font color="white"> </font>
1647+ </para>
1648+ </td>
1649+ </tr>
1650+ <tr>
1651+ <td>
1652+ <para style="P3">
1653+ <font color="white"> </font>
1654+ </para>
1655+ </td>
1656+ <td>
1657+ <para style="P3">
1658+ <font color="white"></font>
1659+ </para>
1660+ </td>
1661+ <td>
1662+ <para style="P3">
1663+ <font color="white"> </font>
1664+ </para>
1665+ </td>
1666+ </tr>
1667+ <tr>
1668+ <td>
1669+ <para style="P3">
1670+ <font color="white"> </font>
1671+ </para>
1672+ </td>
1673+ <td>
1674+ <para style="P3">
1675+ <font color="white"></font>
1676+ </para>
1677+ </td>
1678+ <td>
1679+ <para style="P3">
1680+ <font color="white"> </font>
1681+ </para>
1682+ </td>
1683+ </tr>
1684+ </blockTable>
1685 </td>
1686 </tr>
1687 </blockTable>
1688- <para style="P2">
1689+ <para style="P1">
1690 <font color="white"> </font>
1691 </para>
1692- <blockTable colWidths="568.0" style="Table1">
1693- <tr>
1694- <td>
1695- <blockTable colWidths="370.0,130.0,75.0" rowHeights="65.5,30" style="Table5">
1696- <tr>
1697- <td>
1698- <para style="P9"></para>
1699- </td>
1700- <td>
1701- </td>
1702- <td>
1703- <para style="P9">[[ voucher.journal_id.use_preprint_check and voucher.chk_seq or '' ]]</para>
1704- </td>
1705- </tr>
1706- <tr>
1707- <td>
1708- <para style="P9"></para>
1709- </td>
1710- <td>
1711- <para style="P9">[[ formatLang(voucher.date , date=True) or '' ]]</para>
1712- </td>
1713- <td>
1714- <para style="P9">[[ formatLang (voucher.amount) ]]</para>
1715- </td>
1716- </tr>
1717- </blockTable>
1718- <blockTable colWidths="54.0,500.0" rowHeights="65" style="Table12">
1719- <tr>
1720- <td>
1721- <para style="P3">
1722- <font color="white"> </font>
1723- </para>
1724- </td>
1725- <td>
1726- <para style="P15">[[ voucher.partner_id.name ]]</para>
1727- <para style="P15">[[ display_address(voucher.partner_id) or removeParentNode('para') ]]</para>
1728- </td>
1729- </tr>
1730- </blockTable>
1731- <blockTable colWidths="550.0" rowHeights="93" style="Table5">
1732- <tr>
1733- <td>
1734- <para style="P9">[[ fill_stars(voucher.amount_in_word) ]]</para>
1735- </td>
1736- </tr>
1737- </blockTable>
1738-
1739- <blockTable colWidths="25.0,500" style="Table12">
1740- <tr>
1741- <td>
1742- <para style="P3">
1743- <font color="white"> </font>
1744- </para>
1745- </td>
1746- <td>
1747- <para style="P3">
1748- <font color="white"> </font>
1749- </para>
1750- <!--para style="P15">[[ voucher.name ]]</para-->
1751- </td>
1752- </tr>
1753- </blockTable>
1754- <para style="P3">
1755- <font color="white"> </font>
1756- </para>
1757- </td>
1758- </tr>
1759- </blockTable>
1760 </story>
1761 </document>
1762
1763=== modified file 'account_check_writing/report/check_print_bottom.sxw'
1764Binary files account_check_writing/report/check_print_bottom.sxw 2012-11-01 07:32:01 +0000 and account_check_writing/report/check_print_bottom.sxw 2013-11-19 00:05:44 +0000 differ
1765=== modified file 'account_check_writing/report/check_print_middle.rml'
1766--- account_check_writing/report/check_print_middle.rml 2012-11-29 22:26:45 +0000
1767+++ account_check_writing/report/check_print_middle.rml 2013-11-19 00:05:44 +0000
1768@@ -1,7 +1,6 @@
1769 <?xml version="1.0"?>
1770-<document filename="test.pdf">
1771- <template pageSize="(595, 842)" title="Test" author="Martin Simon" allowSplitting="20">
1772- <!-- Letter 612.0, 792.0 A4 595, 842 -->
1773+<document filename="Check (Middle).pdf">
1774+ <template pageSize="(612.0,792.0)" title="Check (Middle)" author="Martin Simon" allowSplitting="20">
1775 <pageTemplate id="first">
1776 <frame id="first" x1="13.0" y1="0.0" width="567" height="785"/>
1777 </pageTemplate>
1778@@ -11,22 +10,6 @@
1779 <blockAlignment value="LEFT"/>
1780 <blockValign value="TOP"/>
1781 </blockTableStyle>
1782- <blockTableStyle id="Table1">
1783- <blockAlignment value="LEFT"/>
1784- <blockValign value="TOP"/>
1785- </blockTableStyle>
1786- <blockTableStyle id="Table4">
1787- <blockAlignment value="LEFT"/>
1788- <blockValign value="TOP"/>
1789- </blockTableStyle>
1790- <blockTableStyle id="Table5">
1791- <blockAlignment value="LEFT"/>
1792- <blockValign value="TOP"/>
1793- </blockTableStyle>
1794- <blockTableStyle id="Table12">
1795- <blockAlignment value="LEFT"/>
1796- <blockValign value="TOP"/>
1797- </blockTableStyle>
1798 <blockTableStyle id="Table2">
1799 <blockAlignment value="LEFT"/>
1800 <blockValign value="TOP"/>
1801@@ -43,6 +26,14 @@
1802 <blockAlignment value="LEFT"/>
1803 <blockValign value="TOP"/>
1804 </blockTableStyle>
1805+ <blockTableStyle id="Table1">
1806+ <blockAlignment value="LEFT"/>
1807+ <blockValign value="TOP"/>
1808+ </blockTableStyle>
1809+ <blockTableStyle id="Table4">
1810+ <blockAlignment value="LEFT"/>
1811+ <blockValign value="TOP"/>
1812+ </blockTableStyle>
1813 <blockTableStyle id="Table3">
1814 <blockAlignment value="LEFT"/>
1815 <blockValign value="TOP"/>
1816@@ -62,30 +53,43 @@
1817 <initialize>
1818 <paraStyle name="all" alignment="justify"/>
1819 </initialize>
1820- <paraStyle name="P1" rightIndent="-1.0" leftIndent="0.0" fontName="Helvetica"/>
1821- <paraStyle name="P2" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica"/>
1822- <paraStyle name="P3" fontName="Helvetica"/>
1823- <paraStyle name="P4" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT"/>
1824- <paraStyle name="P5" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="RIGHT"/>
1825- <paraStyle name="P6" fontName="Helvetica-Bold" fontSize="9.0" leading="11"/>
1826- <paraStyle name="P7" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT"/>
1827- <paraStyle name="P8" fontName="Helvetica" fontSize="9.0" leading="11"/>
1828- <paraStyle name="P9" fontName="Helvetica" fontSize="10.0" leading="13"/>
1829- <paraStyle name="P10" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="RIGHT"/>
1830- <paraStyle name="P11" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="LEFT"/>
1831- <paraStyle name="P12" fontName="Helvetica" fontSize="12.0" leading="15"/>
1832- <paraStyle name="P13" fontName="Helvetica"/>
1833- <paraStyle name="P14" fontName="Helvetica" fontSize="10.0" leading="13"/>
1834- <paraStyle name="P15" fontName="Helvetica" fontSize="10.0" leading="13"/>
1835- <paraStyle name="P16" fontName="Helvetica-Bold" fontSize="9.0" leading="11"/>
1836- <paraStyle name="P17" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT"/>
1837- <paraStyle name="P18" fontName="Helvetica" fontSize="9.0" leading="11"/>
1838- <paraStyle name="P19" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT"/>
1839- <paraStyle name="P20" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT"/>
1840- <paraStyle name="P21" fontName="Helvetica" fontSize="8.0" leading="10"/>
1841- <paraStyle name="P22" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT"/>
1842- <paraStyle name="P23" fontName="Helvetica-Bold" fontSize="8.0" leading="10"/>
1843- <paraStyle name="P24" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT"/>
1844+ <paraStyle name="P1" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica"/>
1845+ <paraStyle name="P2" fontName="Helvetica"/>
1846+ <paraStyle name="P3" fontName="Helvetica-Bold" fontSize="8.0" leading="10"/>
1847+ <paraStyle name="P4" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT"/>
1848+ <paraStyle name="P5" fontName="Helvetica" fontSize="8.0" leading="10"/>
1849+ <paraStyle name="P6" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT"/>
1850+ <paraStyle name="P7" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT"/>
1851+ <paraStyle name="P8" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT"/>
1852+ <paraStyle name="P9" rightIndent="-1.0" leftIndent="0.0" fontName="Helvetica" fontSize="6.0" leading="8"/>
1853+ <paraStyle name="P10" fontName="Helvetica"/>
1854+ <paraStyle name="P11" fontName="Helvetica-Bold" fontSize="8.0" leading="10"/>
1855+ <paraStyle name="P12" fontName="Helvetica-Bold" fontSize="8.0" leading="10"/>
1856+ <paraStyle name="P13" fontName="Helvetica-Bold" fontSize="8.0" leading="10"/>
1857+ <paraStyle name="P14" fontName="Helvetica-Bold" fontSize="10.0" leading="10" alignment="RIGHT"/>
1858+ <paraStyle name="P15" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT"/>
1859+ <paraStyle name="P16" fontName="Helvetica-Bold" fontSize="8.0" leading="10"/>
1860+ <paraStyle name="P17" fontName="Helvetica-Bold" fontSize="10.0" leading="10" alignment="RIGHT"/>
1861+ <paraStyle name="P18" fontName="Helvetica-Bold" fontSize="8.0" leading="10"/>
1862+ <paraStyle name="P19" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT"/>
1863+ <paraStyle name="P20" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT"/>
1864+ <paraStyle name="P21" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT"/>
1865+ <paraStyle name="P22" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT"/>
1866+ <paraStyle name="P23" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT"/>
1867+ <paraStyle name="P24" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT"/>
1868+ <paraStyle name="P25" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT"/>
1869+ <paraStyle name="P26" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT"/>
1870+ <paraStyle name="P27" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT"/>
1871+ <paraStyle name="P28" fontName="Helvetica-Bold" fontSize="10.0" leading="11" alignment="RIGHT"/>
1872+ <paraStyle name="P29" fontName="Helvetica-Bold" fontSize="10.0" leading="13"/>
1873+ <paraStyle name="P30" fontName="Helvetica" fontSize="7.0" leading="9"/>
1874+ <paraStyle name="P31" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT"/>
1875+ <paraStyle name="P32" fontName="Helvetica" fontSize="10.0" leading="11" alignment="RIGHT"/>
1876+ <paraStyle name="P33" fontName="Helvetica" fontSize="9.0" leading="11"/>
1877+ <paraStyle name="P34" fontName="Helvetica" fontSize="9.0" leading="11"/>
1878+ <paraStyle name="P35" fontName="Helvetica" fontSize="11.0" leading="14"/>
1879+ <paraStyle name="P36" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT"/>
1880+ <paraStyle name="P37" fontName="Helvetica" fontSize="13.0" leading="10"/>
1881 <paraStyle name="Standard" fontName="Helvetica"/>
1882 <paraStyle name="Heading" fontName="Helvetica" fontSize="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/>
1883 <paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
1884@@ -97,166 +101,317 @@
1885 <images/>
1886 </stylesheet>
1887 <story>
1888- <para style="P1">[[repeatIn(objects,'voucher')]]</para>
1889- <blockTable colWidths="568.0" style="Table2" rowHeights="320">
1890+ <para style="P9">
1891+ <font face="Helvetica">[[repeatIn(get_data(objects),'page')]]</font>
1892+ </para>
1893+ <blockTable colWidths="568.0" style="Table2">
1894 <tr>
1895 <td>
1896- <blockTable colWidths="485.0,67.0" style="Table6">
1897- <tr>
1898- <td>
1899- <para style="P16"></para>
1900- </td>
1901- <td>
1902- <para style="P14">[[ voucher.journal_id.use_preprint_check and voucher.chk_seq or '' ]]</para>
1903- </td>
1904- </tr>
1905- <tr>
1906- <td>
1907- <para style="P16">[[voucher.partner_id.name]]</para>
1908- </td>
1909- <td>
1910- <para style="P16">[[ formatLang(voucher.date , date=True) or '' ]]</para>
1911+ <blockTable colWidths="369.0,97.0,97.0" style="Table6">
1912+ <tr>
1913+ <td>
1914+ <para style="P12">
1915+ <font face="Helvetica">[[ page['partner'] ]]</font>
1916+ </para>
1917+ </td>
1918+ <td>
1919+ <para style="P12">
1920+ <font face="Helvetica">[[ formatLang(page['date'], date=True) or '' ]]</font>
1921+ </para>
1922+ </td>
1923+ <td>
1924+ <para style="P14">
1925+ <font face="Helvetica">[[ not page['use_preprint_check'] and page['number'] or '' ]]</font>
1926+ </para>
1927 </td>
1928 </tr>
1929 </blockTable>
1930 <blockTable colWidths="81.0,186.0,83.0,81.0,54.0,78.0" style="Table10">
1931 <tr>
1932 <td>
1933- <para style="P4">Due Date</para>
1934- </td>
1935- <td>
1936- <para style="P4">Description</para>
1937- </td>
1938- <td>
1939- <para style="P4">Original Amount</para>
1940- </td>
1941- <td>
1942- <para style="P4">Balance Due</para>
1943- </td>
1944- <td>
1945- <para style="P4">Discount</para>
1946- </td>
1947- <td>
1948- <para style="P4">Payment</para>
1949- </td>
1950- </tr>
1951- <tr>
1952- <td>
1953- <para style="P19">[[ repeatIn(get_lines(voucher.line_dr_ids),'l') ]] [[ formatLang(l['date_original'] ,date=True) or '' ]]</para>
1954- </td>
1955- <td>
1956- <para style="P19">[[ l['name'] ]]</para>
1957- </td>
1958- <td>
1959- <para style="P19">[[formatLang( l['amount_original']) ]]</para>
1960- </td>
1961- <td>
1962- <para style="P19">[[ formatLang( l['amount_due']) ]]</para>
1963- </td>
1964- <td>
1965- <para style="P19">
1966- <font color="white"> </font>
1967- </para>
1968- </td>
1969- <td>
1970- <para style="P19">[[ formatLang (l['amount']) ]]</para>
1971- </td>
1972- </tr>
1973- </blockTable>
1974- <blockTable colWidths="485.0,77.0" style="Table11">
1975- <tr>
1976- <td>
1977- <para style="P24">Check Amount</para>
1978- </td>
1979- <td>
1980- <para style="P23">[[ formatLang (voucher.amount) ]]</para>
1981- </td>
1982- </tr>
1983- </blockTable>
1984- <blockTable colWidths="485.0,77.0" rowHeights="158,10" style="Table11">
1985- <tr>
1986- <td>
1987- </td>
1988- <td>
1989- </td>
1990- </tr>
1991- <tr>
1992- <td>
1993- </td>
1994- <td>
1995- <para style="P14">[[ voucher.journal_id.use_preprint_check and voucher.chk_seq or '' ]]</para>
1996- </td>
1997- </tr>
1998- </blockTable>
1999- <para style="P3">
2000- <font color="white"> </font>
2001- </para>
2002- </td>
2003- </tr>
2004- </blockTable>
2005- <blockTable colWidths="550.0" rowHeights="10" style="Table5">
2006- <tr>
2007- <td>
2008- <para style="P26">[[ str(fill_stars(voucher.amount_in_word)) ]]</para>
2009- </td>
2010- </tr>
2011- </blockTable>
2012- <blockTable colWidths="568.0" style="Table1">
2013- <tr>
2014- <td>
2015- <blockTable colWidths="370.0,130.0,55.0" rowHeights=".95cm" style="Table5">
2016- <tr>
2017- <td>
2018- <para style="P9"></para>
2019- </td>
2020- <td>
2021- <para style="P9"></para>
2022- </td>
2023- <td>
2024- <para style="P9"></para>
2025- </td>
2026- </tr>
2027- <tr>
2028- <td>
2029- <para style="P9"></para>
2030- </td>
2031- <td>
2032- <para style="P9">[[ formatLang(voucher.date , date=True) or '' ]]</para>
2033- </td>
2034- <td>
2035- <para style="P9">[[ formatLang (voucher.amount) ]]</para>
2036- </td>
2037- </tr>
2038- </blockTable>
2039- <blockTable colWidths="54.0,500.0" rowHeights="2.5cm" style="Table12">
2040- <tr>
2041- <td>
2042- <para style="P3">
2043- <font color="white"> </font>
2044- </para>
2045- </td>
2046- <td>
2047- <para style="P15">[[ voucher.partner_id.name ]]</para>
2048- <para style="P15">[[ display_address(voucher.partner_id) or removeParentNode('para') ]]</para>
2049- </td>
2050- </tr>
2051- </blockTable>
2052- <blockTable colWidths="25.0,500" rowHeights="30.5" style="Table12">
2053- <tr>
2054- <td>
2055- <para style="P3">
2056- <font color="white"> </font>
2057- </para>
2058- </td>
2059- <td>
2060- <para style="P3">
2061- <font color="white"> </font>
2062- </para>
2063- <!--para style="P15">[[ voucher.name ]]</para-->
2064- </td>
2065- </tr>
2066- </blockTable>
2067- <para style="P3">
2068+ <para style="P26">Due Date</para>
2069+ </td>
2070+ <td>
2071+ <para style="P8">Description</para>
2072+ </td>
2073+ <td>
2074+ <para style="P8">Original Amount</para>
2075+ </td>
2076+ <td>
2077+ <para style="P8">Balance Due</para>
2078+ </td>
2079+ <td>
2080+ <para style="P8">Discount</para>
2081+ </td>
2082+ <td>
2083+ <para style="P8">Payment</para>
2084+ </td>
2085+ </tr>
2086+ <tr>
2087+ <td>
2088+ <para style="P20">
2089+ <font face="Helvetica" size="2.0">[[ repeatIn(page['lines'],'l') ]]</font>
2090+ <font face="Helvetica"> [[ formatLang(l['date_original'] ,date=True) or '' ]]</font>
2091+ </para>
2092+ </td>
2093+ <td>
2094+ <para style="P20">
2095+ <font face="Helvetica">[[ l['name'] ]]</font>
2096+ </para>
2097+ </td>
2098+ <td>
2099+ <para style="P20">
2100+ <font face="Helvetica">[[formatLang(l['amount_original']) ]]</font>
2101+ </para>
2102+ </td>
2103+ <td>
2104+ <para style="P20">
2105+ <font face="Helvetica">[[ formatLang(l['amount_due']) ]]</font>
2106+ </para>
2107+ </td>
2108+ <td>
2109+ <para style="Standard">
2110+ <font color="white"> </font>
2111+ </para>
2112+ </td>
2113+ <td>
2114+ <para style="P7">
2115+ <font face="Helvetica">[[ formatLang(l['amount']) ]]</font>
2116+ </para>
2117+ </td>
2118+ </tr>
2119+ </blockTable>
2120+ <blockTable colWidths="485.0,78.0" style="Table11">
2121+ <tr>
2122+ <td>
2123+ <para style="P4">Check Amount</para>
2124+ </td>
2125+ <td>
2126+ <para style="P13">
2127+ <font face="Helvetica">[[ formatLang(page['amount']) or 'VOID' ]]</font>
2128+ </para>
2129+ </td>
2130+ </tr>
2131+ <tr>
2132+ <td>
2133+ <para style="Standard">
2134+ <font color="white"> </font>
2135+ </para>
2136+ </td>
2137+ <td>
2138+ <para style="Standard">
2139+ <font color="white"> </font>
2140+ </para>
2141+ </td>
2142+ </tr>
2143+ </blockTable>
2144+ <blockTable colWidths="56.0,420.0,86.0" style="Table4">
2145+ <tr>
2146+ <td>
2147+ <para style="Standard">
2148+ <font color="white"> </font>
2149+ </para>
2150+ </td>
2151+ <td>
2152+ <para style="Standard">
2153+ <font color="white"> </font>
2154+ </para>
2155+ </td>
2156+ <td>
2157+ <para style="Standard">
2158+ <font color="white"> </font>
2159+ </para>
2160+ </td>
2161+ </tr>
2162+ <tr>
2163+ <td>
2164+ <para style="Standard">
2165+ <font color="white"> </font>
2166+ </para>
2167+ </td>
2168+ <td>
2169+ <para style="Standard">
2170+ <font color="white"> </font>
2171+ </para>
2172+ </td>
2173+ <td>
2174+ <para style="P28">
2175+ <font face="Helvetica">[[ not page['use_preprint_check'] and page['number'] or '' ]]</font>
2176+ </para>
2177+ </td>
2178+ </tr>
2179+ <tr>
2180+ <td>
2181+ <para style="Standard">
2182+ <font color="white"> </font>
2183+ </para>
2184+ </td>
2185+ <td>
2186+ <para style="Standard">
2187+ <font color="white"> </font>
2188+ </para>
2189+ </td>
2190+ <td>
2191+ <para style="Standard">
2192+ <font color="white"> </font>
2193+ </para>
2194+ </td>
2195+ </tr>
2196+ <tr>
2197+ <td>
2198+ <para style="Standard">
2199+ <font color="white"> </font>
2200+ </para>
2201+ </td>
2202+ <td>
2203+ <para style="Standard">
2204+ <font color="white"> </font>
2205+ </para>
2206+ </td>
2207+ <td>
2208+ <para style="Standard">
2209+ <font color="white"> </font>
2210+ </para>
2211+ </td>
2212+ </tr>
2213+ <tr>
2214+ <td>
2215+ <para style="Standard">
2216+ <font color="white"> </font>
2217+ </para>
2218+ </td>
2219+ <td>
2220+ <para style="P29">
2221+ <font face="Helvetica">[[ page['amount_words'] or 'VOID'.ljust(70, '*') ]]</font>
2222+ </para>
2223+ </td>
2224+ <td>
2225+ <para style="Standard">
2226+ <font color="white"> </font>
2227+ </para>
2228+ </td>
2229+ </tr>
2230+ <tr>
2231+ <td>
2232+ <para style="Standard">
2233+ <font color="white"> </font>
2234+ </para>
2235+ </td>
2236+ <td>
2237+ <para style="Standard">
2238+ <font color="white"> </font>
2239+ </para>
2240+ </td>
2241+ <td>
2242+ <para style="Standard">
2243+ <font color="white"> </font>
2244+ </para>
2245+ </td>
2246+ </tr>
2247+ <tr>
2248+ <td>
2249+ <para style="Standard">
2250+ <font color="white"> </font>
2251+ </para>
2252+ </td>
2253+ <td>
2254+ <para style="P36">
2255+ <font face="Helvetica">[[ formatLang(page['date'] , date=True) or '' ]]</font>
2256+ </para>
2257+ </td>
2258+ <td>
2259+ <para style="P32">
2260+ <font face="Helvetica">[[ 'chk_amount' in page and formatLang(page['chk_amount']) or 'VOID' ]]</font>
2261+ </para>
2262+ </td>
2263+ </tr>
2264+ <tr>
2265+ <td>
2266+ <para style="P37">
2267+ <font color="white"> </font>
2268+ </para>
2269+ </td>
2270+ <td>
2271+ <para style="P37">
2272+ <font color="white"> </font>
2273+ </para>
2274+ </td>
2275+ <td>
2276+ <para style="P37">
2277+ <font color="white"> </font>
2278+ </para>
2279+ </td>
2280+ </tr>
2281+ <tr>
2282+ <td>
2283+ <para style="Standard">
2284+ <font color="white"> </font>
2285+ </para>
2286+ </td>
2287+ <td>
2288+ <para style="P3">
2289+ <font face="Helvetica" size="9.0">[[ page['partner'] ]]</font>
2290+ </para>
2291+ </td>
2292+ <td>
2293+ <para style="Standard">
2294+ <font color="white"> </font>
2295+ </para>
2296+ </td>
2297+ </tr>
2298+ <tr>
2299+ <td>
2300+ <para style="Standard">
2301+ <font color="white"> </font>
2302+ </para>
2303+ </td>
2304+ <td>
2305+ <para style="Standard">
2306+ <font color="white"> </font>
2307+ </para>
2308+ </td>
2309+ <td>
2310+ <para style="Standard">
2311+ <font color="white"> </font>
2312+ </para>
2313+ </td>
2314+ </tr>
2315+ <tr>
2316+ <td>
2317+ <para style="Standard">
2318+ <font color="white"> </font>
2319+ </para>
2320+ </td>
2321+ <td>
2322+ <para style="Standard">
2323+ <font color="white"> </font>
2324+ </para>
2325+ </td>
2326+ <td>
2327+ <para style="Standard">
2328+ <font color="white"> </font>
2329+ </para>
2330+ </td>
2331+ </tr>
2332+ <tr>
2333+ <td>
2334+ <para style="Standard">
2335+ <font color="white"> </font>
2336+ </para>
2337+ </td>
2338+ <td>
2339+ <para style="Standard">
2340+ <font color="white"> </font>
2341+ </para>
2342+ </td>
2343+ <td>
2344+ <para style="Standard">
2345+ <font color="white"> </font>
2346+ </para>
2347+ </td>
2348+ </tr>
2349+ </blockTable>
2350+ <para style="P30">
2351 <font color="white"> </font>
2352 </para>
2353 </td>
2354@@ -265,91 +420,130 @@
2355 <blockTable colWidths="568.0" style="Table3">
2356 <tr>
2357 <td>
2358- <blockTable colWidths="436.0,76.0,20.0" style="Table7">
2359- <tr>
2360- <td>
2361- <para style="P16"></para>
2362- </td>
2363- <td>
2364- <para style="P14"></para>
2365- </td>
2366- <td>
2367- <para style="P14"></para>
2368- </td>
2369- </tr>
2370- <tr>
2371- <td>
2372- <para style="P16">[[voucher.partner_id.name]]</para>
2373- </td>
2374- <td>
2375- <para style="P16">[[ formatLang(voucher.date , date=True) or '' ]]</para>
2376- </td>
2377- <td>
2378- <para style="P14">[[ voucher.journal_id.use_preprint_check and voucher.chk_seq or '' ]]</para>
2379+ <blockTable colWidths="370.0,96.0,96.0" style="Table7">
2380+ <tr>
2381+ <td>
2382+ <para style="Standard">
2383+ <font color="white"> </font>
2384+ </para>
2385+ </td>
2386+ <td>
2387+ <para style="Standard">
2388+ <font color="white"> </font>
2389+ </para>
2390+ </td>
2391+ <td>
2392+ <para style="Standard">
2393+ <font color="white"> </font>
2394+ </para>
2395+ </td>
2396+ </tr>
2397+ <tr>
2398+ <td>
2399+ <para style="Standard">
2400+ <font color="white"> </font>
2401+ </para>
2402+ </td>
2403+ <td>
2404+ <para style="Standard">
2405+ <font color="white"> </font>
2406+ </para>
2407+ </td>
2408+ <td>
2409+ <para style="Standard">
2410+ <font color="white"> </font>
2411+ </para>
2412+ </td>
2413+ </tr>
2414+ <tr>
2415+ <td>
2416+ <para style="P16">
2417+ <font face="Helvetica">[[ page['partner'] or '' ]]</font>
2418+ </para>
2419+ </td>
2420+ <td>
2421+ <para style="P16">
2422+ <font face="Helvetica">[[ formatLang(page['date'] , date=True) or '' ]]</font>
2423+ </para>
2424+ </td>
2425+ <td>
2426+ <para style="P17">
2427+ <font face="Helvetica">[[ not page['use_preprint_check'] and page['number'] or '' ]]</font>
2428+ </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+ <para style="P8">Due Date</para>
2452+ </td>
2453+ <td>
2454+ <para style="P8">Description</para>
2455+ </td>
2456+ <td>
2457+ <para style="P8">Original Amount</para>
2458+ </td>
2459+ <td>
2460+ <para style="P8">Balance Due</para>
2461+ </td>
2462+ <td>
2463+ <para style="P8">Discount</para>
2464+ </td>
2465+ <td>
2466+ <para style="P8">Payment</para>
2467 </td>
2468 </tr>
2469 <tr>
2470 <td>
2471- <para style="P19">[[ repeatIn(get_lines(voucher.line_dr_ids),'l') ]] [[ formatLang(l['date_original'] ,date=True) or '' ]]</para>
2472- </td>
2473- <td>
2474- <para style="P19">[[ l['name'] ]]</para>
2475- </td>
2476- <td>
2477- <para style="P19">[[ formatLang (l['amount_original']) ]]</para>
2478- </td>
2479- <td>
2480- <para style="P19">[[ formatLang (l['amount_due']) ]]</para>
2481- </td>
2482- <td>
2483- <para style="P19">
2484+ <para style="P21">
2485+ <font face="Helvetica" size="2.0">[[ repeatIn(page['lines'],'l') ]]</font>
2486+ <font face="Helvetica"> [[ formatLang(l['date_original'] ,date=True) or '' ]]</font>
2487+ </para>
2488+ </td>
2489+ <td>
2490+ <para style="P22">
2491+ <font face="Helvetica">[[ l['name'] ]]</font>
2492+ </para>
2493+ </td>
2494+ <td>
2495+ <para style="P23">
2496+ <font face="Helvetica">[[formatLang(l['amount_original']) ]]</font>
2497+ </para>
2498+ </td>
2499+ <td>
2500+ <para style="P24">
2501+ <font face="Helvetica">[[ formatLang(l['amount_due']) ]]</font>
2502+ </para>
2503+ </td>
2504+ <td>
2505+ <para style="Standard">
2506 <font color="white"> </font>
2507 </para>
2508 </td>
2509 <td>
2510- <para style="P19">[[ formatLang (l['amount']) ]]</para>
2511+ <para style="P25">
2512+ <font face="Helvetica">[[ formatLang(l['amount']) ]]</font>
2513+ </para>
2514 </td>
2515 </tr>
2516 </blockTable>
2517 <blockTable colWidths="485.0,77.0" style="Table9">
2518 <tr>
2519 <td>
2520- <para style="P24">Check Amount</para>
2521+ <para style="P4">Check Amount</para>
2522 </td>
2523 <td>
2524- <para style="P23">[[ formatLang (voucher.amount) ]]</para>
2525+ <para style="P18">
2526+ <font face="Helvetica">[[ formatLang (page['amount']) or 'VOID' ]]</font>
2527+ </para>
2528 </td>
2529 </tr>
2530 </blockTable>
2531- <para style="P3">
2532- <font color="white"> </font>
2533- </para>
2534 </td>
2535 </tr>
2536 </blockTable>
2537- <para style="P2">
2538+ <para style="Standard">
2539 <font color="white"> </font>
2540 </para>
2541 </story>
2542
2543=== modified file 'account_check_writing/report/check_print_middle.sxw'
2544Binary files account_check_writing/report/check_print_middle.sxw 2012-11-01 07:32:01 +0000 and account_check_writing/report/check_print_middle.sxw 2013-11-19 00:05:44 +0000 differ
2545=== modified file 'account_check_writing/report/check_print_top.rml'
2546--- account_check_writing/report/check_print_top.rml 2012-11-29 22:26:45 +0000
2547+++ account_check_writing/report/check_print_top.rml 2013-11-19 00:05:44 +0000
2548@@ -1,8 +1,8 @@
2549 <?xml version="1.0"?>
2550-<document filename="test.pdf">
2551- <template pageSize="(595, 842)" title="Test" author="Martin Simon" allowSplitting="20">
2552+<document filename="Check (Top).pdf">
2553+ <template pageSize="(612.0,792.0)" title="Check (Top)" author="Martin Simon" allowSplitting="20">
2554 <pageTemplate id="first">
2555- <frame id="first" x1="13.0" y1="0.0" width="567" height="841"/>
2556+ <frame id="first" x1="13.0" y1="0.0" width="567" height="785"/>
2557 </pageTemplate>
2558 </template>
2559 <stylesheet>
2560@@ -22,10 +22,6 @@
2561 <blockAlignment value="LEFT"/>
2562 <blockValign value="TOP"/>
2563 </blockTableStyle>
2564- <blockTableStyle id="Table12">
2565- <blockAlignment value="LEFT"/>
2566- <blockValign value="TOP"/>
2567- </blockTableStyle>
2568 <blockTableStyle id="Table2">
2569 <blockAlignment value="LEFT"/>
2570 <blockValign value="TOP"/>
2571@@ -61,31 +57,26 @@
2572 <initialize>
2573 <paraStyle name="all" alignment="justify"/>
2574 </initialize>
2575- <paraStyle name="P1" rightIndent="-1.0" leftIndent="0.0" fontName="Helvetica"/>
2576- <paraStyle name="P2" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica"/>
2577- <paraStyle name="P3" fontName="Helvetica"/>
2578- <paraStyle name="P4" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT"/>
2579- <paraStyle name="P5" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="RIGHT"/>
2580- <paraStyle name="P6" fontName="Helvetica-Bold" fontSize="9.0" leading="11"/>
2581- <paraStyle name="P7" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT"/>
2582- <paraStyle name="P8" fontName="Helvetica" fontSize="9.0" leading="11"/>
2583- <paraStyle name="P9" fontName="Helvetica" fontSize="10.0" leading="13"/>
2584- <paraStyle name="P10" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="RIGHT"/>
2585- <paraStyle name="P11" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="LEFT"/>
2586- <paraStyle name="P12" fontName="Helvetica" fontSize="12.0" leading="15"/>
2587- <paraStyle name="P13" fontName="Helvetica"/>
2588- <paraStyle name="P14" fontName="Helvetica" fontSize="10.0" leading="13"/>
2589- <paraStyle name="P15" fontName="Helvetica" fontSize="10.0" leading="13"/>
2590- <paraStyle name="P16" fontName="Helvetica-Bold" fontSize="9.0" leading="11"/>
2591- <paraStyle name="P17" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT"/>
2592- <paraStyle name="P18" fontName="Helvetica" fontSize="9.0" leading="11"/>
2593- <paraStyle name="P19" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT"/>
2594- <paraStyle name="P20" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT"/>
2595- <paraStyle name="P21" fontName="Helvetica" fontSize="8.0" leading="10"/>
2596- <paraStyle name="P22" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT"/>
2597- <paraStyle name="P23" fontName="Helvetica-Bold" fontSize="8.0" leading="10"/>
2598- <paraStyle name="P24" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT"/>
2599+ <paraStyle name="P1" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica"/>
2600+ <paraStyle name="P2" fontName="Helvetica"/>
2601+ <paraStyle name="P3" fontName="Helvetica-Bold" fontSize="8.0" leading="10"/>
2602+ <paraStyle name="P4" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT"/>
2603+ <paraStyle name="P5" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT"/>
2604+ <paraStyle name="P6" fontName="Helvetica" fontSize="8.0" leading="10"/>
2605+ <paraStyle name="P7" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT"/>
2606+ <paraStyle name="P8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT"/>
2607+ <paraStyle name="P9" fontName="Helvetica-Bold" fontSize="9.0" leading="11"/>
2608+ <paraStyle name="P10" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT"/>
2609+ <paraStyle name="P11" rightIndent="-1.0" leftIndent="0.0" fontName="Helvetica" fontSize="6.0" leading="8"/>
2610+ <paraStyle name="P12" fontName="Helvetica" fontSize="9.0" leading="11"/>
2611+ <paraStyle name="P13" fontName="Helvetica" fontSize="9.0" leading="11"/>
2612+ <paraStyle name="P14" fontName="Helvetica" fontSize="9.0" leading="11"/>
2613+ <paraStyle name="P15" fontName="Helvetica-Bold" fontSize="9.0" leading="11"/>
2614+ <paraStyle name="P16" fontName="Helvetica-Bold" fontSize="10.0" leading="11" alignment="RIGHT"/>
2615+ <paraStyle name="P16" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER"/>
2616 <paraStyle name="Standard" fontName="Helvetica"/>
2617+ <paraStyle name="P17" fontName="Helvetica" fontSize="9.0" leading="11"/>
2618+ <paraStyle name="P18" fontName="Helvetica" fontSize="14.0" leading="11"/>
2619 <paraStyle name="Heading" fontName="Helvetica" fontSize="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/>
2620 <paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
2621 <paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
2622@@ -96,161 +87,295 @@
2623 <images/>
2624 </stylesheet>
2625 <story>
2626- <para style="P1">[[repeatIn(objects,'voucher')]]</para>
2627- <blockTable colWidths="568.0" style="Table1">
2628+ <para style="P11">[[repeatIn(get_data(objects),'page')]]</para>
2629+ <blockTable colWidths="568.0" style="Table1">
2630 <tr>
2631 <td>
2632- <blockTable colWidths="425.0,177.0" rowHeights="107.50,25.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="P6">
2641- <font color="white"> </font>
2642- </para>
2643- </td>
2644- </tr>
2645- <tr>
2646- <td>
2647- <para style="P6">
2648- <font color="white"> </font>
2649- </para>
2650- </td>
2651- <td>
2652- <para style="P9">[[ formatLang(voucher.date , date=True) or '' ]] [[ voucher.journal_id.use_preprint_check and voucher.chk_seq or '' ]]</para>
2653- </td>
2654- </tr>
2655- </blockTable>
2656- <blockTable colWidths="54.0,425.0,85.0" rowHeights="21.5" style="Table4">
2657- <tr>
2658- <td>
2659- <para style="P6">
2660- <font color="white"> </font>
2661- </para>
2662- </td>
2663- <td>
2664- <para style="P9">[[ voucher.partner_id.name ]] </para>
2665- </td>
2666- <td>
2667- <para style="P12">[[ formatLang (voucher.amount) ]]</para>
2668- </td>
2669- </tr>
2670- </blockTable>
2671- <blockTable colWidths="550.0" rowHeights="18" style="Table5">
2672- <tr>
2673- <td>
2674- <para style="P9">[[ fill_stars(voucher.amount_in_word) ]]</para>
2675- </td>
2676- </tr>
2677- </blockTable>
2678- <blockTable colWidths="54.0,425.0,85.0" rowHeights="45.5" style="Table4">
2679- <tr>
2680- <td>
2681- <para style="P6"></para>
2682- </td>
2683- <td>
2684- <para style="P9">[[ voucher.partner_id.name ]] </para>
2685- <para style="P15">[[ display_address(voucher.partner_id) or removeParentNode('para') ]]</para>
2686- </td>
2687- <td>
2688- <para/>
2689- </td>
2690- </tr>
2691- </blockTable>
2692- <blockTable colWidths="25.0,350,150" rowHeights="10.5" style="Table12">
2693- <tr>
2694- <td>
2695- <para style="P3">
2696- <font color="white"> </font>
2697- </para>
2698- </td>
2699- <td>
2700- <para style="P15">[[ voucher.name ]]</para>
2701- </td>
2702- <td>
2703- <para style="P3">
2704- <font color="white"> </font>
2705- </para>
2706- </td>
2707- </tr>
2708- </blockTable>
2709- <para style="P3">
2710+ <blockTable colWidths="56.0,428.0,78.0" style="Table4">
2711+ <tr>
2712+ <td>
2713+ <para style="Table Contents">
2714+ <font color="white"> </font>
2715+ </para>
2716+ </td>
2717+ <td>
2718+ <para style="Table Contents">
2719+ <font color="white"> </font>
2720+ </para>
2721+ </td>
2722+ <td>
2723+ <para style="P16">[[ not page['use_preprint_check'] and page['number'] or '' ]]</para>
2724+ </td>
2725+ </tr>
2726+ <tr>
2727+ <td>
2728+ <para style="P18">
2729+ <font color="white"> </font>
2730+ </para>
2731+ </td>
2732+ <td>
2733+ <para style="P18">
2734+ <font color="white"> </font>
2735+ </para>
2736+ </td>
2737+ <td>
2738+ <para style="P18">
2739+ <font color="white"> </font>
2740+ </para>
2741+ </td>
2742+ </tr>
2743+ <tr>
2744+ <td>
2745+ <para style="Standard">
2746+ <font color="white"> </font>
2747+ </para>
2748+ </td>
2749+ <td>
2750+ <para style="Standard">
2751+ <font color="white"> </font>
2752+ </para>
2753+ </td>
2754+ <td>
2755+ <para style="P14">[[ formatLang(page['date'] , date=True) or '' ]]</para>
2756+ </td>
2757+ </tr>
2758+ <tr>
2759+ <td>
2760+ <para style="Standard">
2761+ <font color="white"> </font>
2762+ </para>
2763+ </td>
2764+ <td>
2765+ <para style="Standard">
2766+ <font color="white"> </font>
2767+ </para>
2768+ </td>
2769+ <td>
2770+ <para style="Standard">
2771+ <font color="white"> </font>
2772+ </para>
2773+ </td>
2774+ </tr>
2775+ <tr>
2776+ <td>
2777+ <para style="Standard">
2778+ <font color="white"> </font>
2779+ </para>
2780+ </td>
2781+ <td>
2782+ <para style="P12">[[ page['partner'] ]]</para>
2783+ </td>
2784+ <td>
2785+ <para style="P13">[[ 'chk_amount' in page and formatLang(page['chk_amount']) or 'VOID' ]]</para>
2786+ </td>
2787+ </tr>
2788+ </blockTable>
2789+ <blockTable colWidths="20.0,465.0,77.0" style="Table5">
2790+ <tr>
2791+ <td>
2792+ <para style="Standard">
2793+ <font color="white"> </font>
2794+ </para>
2795+ </td>
2796+ <td>
2797+ <para style="Standard">
2798+ <font color="white"> </font>
2799+ </para>
2800+ </td>
2801+ <td>
2802+ <para style="Standard">
2803+ <font color="white"> </font>
2804+ </para>
2805+ </td>
2806+ </tr>
2807+ <tr>
2808+ <td>
2809+ <para style="Standard">
2810+ <font color="white"> </font>
2811+ </para>
2812+ </td>
2813+ <td>
2814+ <para style="P15">[[ page['amount_words'] or 'VOID'.ljust(70, '*') ]]</para>
2815+ </td>
2816+ <td>
2817+ <para style="P10">
2818+ <font color="white"> </font>
2819+ </para>
2820+ </td>
2821+ </tr>
2822+ <tr>
2823+ <td>
2824+ <para style="Standard">
2825+ <font color="white"> </font>
2826+ </para>
2827+ </td>
2828+ <td>
2829+ <para style="Standard">
2830+ <font color="white"> </font>
2831+ </para>
2832+ </td>
2833+ <td>
2834+ <para style="Standard">
2835+ <font color="white"> </font>
2836+ </para>
2837+ </td>
2838+ </tr>
2839+ <tr>
2840+ <td>
2841+ <para style="Standard">
2842+ <font color="white"> </font>
2843+ </para>
2844+ </td>
2845+ <td>
2846+ <para style="Standard">
2847+ <font color="white"> </font>
2848+ </para>
2849+ </td>
2850+ <td>
2851+ <para style="Standard">
2852+ <font color="white"> </font>
2853+ </para>
2854+ </td>
2855+ </tr>
2856+ <tr>
2857+ <td>
2858+ <para style="Standard">
2859+ <font color="white"> </font>
2860+ </para>
2861+ </td>
2862+ <td>
2863+ <para style="Standard">
2864+ <font color="white"> </font>
2865+ </para>
2866+ </td>
2867+ <td>
2868+ <para style="Standard">
2869+ <font color="white"> </font>
2870+ </para>
2871+ </td>
2872+ </tr>
2873+ <tr>
2874+ <td>
2875+ <para style="Standard">
2876+ <font color="white"> </font>
2877+ </para>
2878+ </td>
2879+ <td>
2880+ <para style="P17">[[ page['name'] or "" ]]</para>
2881+ </td>
2882+ <td>
2883+ <para style="Standard">
2884+ <font color="white"> </font>
2885+ </para>
2886+ </td>
2887+ </tr>
2888+ </blockTable>
2889+ <para style="Standard">
2890+ <font color="white"> </font>
2891+ </para>
2892+ <para style="Standard">
2893+ <font color="white"> </font>
2894+ </para>
2895+ <para style="Standard">
2896+ <font color="white"> </font>
2897+ </para>
2898+ <para style="Standard">
2899 <font color="white"> </font>
2900 </para>
2901 </td>
2902 </tr>
2903 </blockTable>
2904- <blockTable colWidths="568.0" style="Table2" rowHeights="255">
2905+ <blockTable colWidths="568.0" style="Table2">
2906 <tr>
2907 <td>
2908- <blockTable colWidths="445.0,117.0" style="Table6">
2909- <tr>
2910- <td>
2911- <para style="P16">[[voucher.partner_id.name]]</para>
2912- </td>
2913- <td>
2914- <para style="P16">[[ formatLang(voucher.date , date=True) or '' ]] [[ voucher.journal_id.use_preprint_check and voucher.chk_seq or '' ]]</para>
2915+ <blockTable colWidths="369.0,97.0,97.0" style="Table6">
2916+ <tr>
2917+ <td>
2918+ <para style="Standard">
2919+ <font color="white"> </font>
2920+ </para>
2921+ </td>
2922+ <td>
2923+ <para style="Standard">
2924+ <font color="white"> </font>
2925+ </para>
2926+ </td>
2927+ <td>
2928+ <para style="Standard">
2929+ <font color="white"> </font>
2930+ </para>
2931+ </td>
2932+ </tr>
2933+ <tr>
2934+ <td>
2935+ <para style="P3">[[ page['partner'] ]]</para>
2936+ </td>
2937+ <td>
2938+ <para style="P3">[[ formatLang(page['date'], date=True) or '' ]]</para>
2939+ </td>
2940+ <td>
2941+ <para style="P16">[[ not page['use_preprint_check'] and page['number'] or '' ]]</para>
2942 </td>
2943 </tr>
2944 </blockTable>
2945- <blockTable colWidths="82.0,185.0,89.0,76.0,52.0,78.0" style="Table10">
2946+ <blockTable colWidths="81.0,186.0,83.0,81.0,54.0,78.0" style="Table10">
2947 <tr>
2948 <td>
2949- <para style="P4">Due Date</para>
2950- </td>
2951- <td>
2952- <para style="P4">Description</para>
2953- </td>
2954- <td>
2955- <para style="P4">Original Amount</para>
2956- </td>
2957- <td>
2958- <para style="P4">Open Balance</para>
2959- </td>
2960- <td>
2961- <para style="P4">Discount</para>
2962- </td>
2963- <td>
2964- <para style="P4">Payment</para>
2965+ <para style="P10">Due Date</para>
2966+ </td>
2967+ <td>
2968+ <para style="P10">Description</para>
2969+ </td>
2970+ <td>
2971+ <para style="P10">Original Amount</para>
2972+ </td>
2973+ <td>
2974+ <para style="P10">Balance Due</para>
2975+ </td>
2976+ <td>
2977+ <para style="P10">Discount</para>
2978+ </td>
2979+ <td>
2980+ <para style="P10">Payment</para>
2981 </td>
2982 </tr>
2983 <tr>
2984 <td>
2985- <para style="P19">[[ repeatIn(get_lines(voucher.line_dr_ids),'l') ]] [[ formatLang(l['date_due'] ,date=True) or '' ]]</para>
2986- </td>
2987- <td>
2988- <para style="P19">[[ l['name'] ]]</para>
2989- </td>
2990- <td>
2991- <para style="P19">[[formatLang( l['amount_original']) ]]</para>
2992- </td>
2993- <td>
2994- <para style="P19">[[ formatLang( l['amount_unreconciled']) ]]</para>
2995- </td>
2996- <td>
2997- <para style="P19">
2998+ <para style="P8">
2999+ <font face="Helvetica" size="2.0">[[ repeatIn(page['lines'],'l') ]]</font>
3000+ <font face="Helvetica"> [[ formatLang(l['date_original'] ,date=True) or '' ]]</font>
3001+ </para>
3002+ </td>
3003+ <td>
3004+ <para style="P8">[[ l['name'] ]]</para>
3005+ </td>
3006+ <td>
3007+ <para style="P8">[[formatLang(l['amount_original']) ]]</para>
3008+ </td>
3009+ <td>
3010+ <para style="P8">[[ formatLang(l['amount_due']) ]]</para>
3011+ </td>
3012+ <td>
3013+ <para style="P8">
3014 <font color="white"> </font>
3015 </para>
3016 </td>
3017 <td>
3018- <para style="P19">[[ formatLang (l['amount']) ]]</para>
3019+ <para style="P5">[[ formatLang(l['amount']) ]]</para>
3020 </td>
3021 </tr>
3022 </blockTable>
3023 <blockTable colWidths="485.0,77.0" style="Table11">
3024 <tr>
3025 <td>
3026- <para style="P24">Check Amount</para>
3027+ <para style="P4">Check Amount</para>
3028 </td>
3029 <td>
3030- <para style="P23">[[ formatLang (voucher.amount) ]]</para>
3031+ <para style="P3">[[ formatLang(page['amount']) or 'VOID' ]]</para>
3032 </td>
3033 </tr>
3034 </blockTable>
3035- <para style="P3">
3036+ <para style="P2">
3037 <font color="white"> </font>
3038 </para>
3039 </td>
3040@@ -259,77 +384,100 @@
3041 <blockTable colWidths="568.0" style="Table3">
3042 <tr>
3043 <td>
3044- <blockTable colWidths="446.0,116.0" style="Table7">
3045- <tr>
3046- <td>
3047- <para style="P16">[[voucher.partner_id.name]]</para>
3048- </td>
3049- <td>
3050- <para style="P16">[[ formatLang(voucher.date , date=True) or '' ]] [[ voucher.journal_id.use_preprint_check and voucher.chk_seq or '' ]]</para>
3051+ <blockTable colWidths="370.0,96.0,96.0" style="Table7">
3052+ <tr>
3053+ <td>
3054+ <para style="Standard">
3055+ <font color="white"> </font>
3056+ </para>
3057+ </td>
3058+ <td>
3059+ <para style="Standard">
3060+ <font color="white"> </font>
3061+ </para>
3062+ </td>
3063+ <td>
3064+ <para style="Standard">
3065+ <font color="white"> </font>
3066+ </para>
3067+ </td>
3068+ </tr>
3069+ <tr>
3070+ <td>
3071+ <para style="P3">[[ page['partner'] or '' ]]</para>
3072+ </td>
3073+ <td>
3074+ <para style="P3">[[ formatLang(page['date'] , date=True) or '' ]]</para>
3075+ </td>
3076+ <td>
3077+ <para style="P16">[[ not page['use_preprint_check'] and page['number'] or '' ]]</para>
3078 </td>
3079 </tr>
3080 </blockTable>
3081 <blockTable colWidths="82.0,185.0,89.0,76.0,52.0,78.0" style="Table8">
3082 <tr>
3083 <td>
3084- <para style="P4">Due Date</para>
3085- </td>
3086- <td>
3087- <para style="P4">Description</para>
3088- </td>
3089- <td>
3090- <para style="P4">Original Amount</para>
3091- </td>
3092- <td>
3093- <para style="P4">Open Balance</para>
3094- </td>
3095- <td>
3096- <para style="P4">Discount</para>
3097- </td>
3098- <td>
3099- <para style="P4">Payment</para>
3100+ <para style="P10">Due Date</para>
3101+ </td>
3102+ <td>
3103+ <para style="P10">Description</para>
3104+ </td>
3105+ <td>
3106+ <para style="P10">Original Amount</para>
3107+ </td>
3108+ <td>
3109+ <para style="P10">Balance Due</para>
3110+ </td>
3111+ <td>
3112+ <para style="P10">Discount</para>
3113+ </td>
3114+ <td>
3115+ <para style="P10">Payment</para>
3116 </td>
3117 </tr>
3118 <tr>
3119 <td>
3120- <para style="P19">[[ repeatIn(get_lines(voucher.line_dr_ids),'l') ]] [[ formatLang(l['date_due'] ,date=True) or '' ]]</para>
3121- </td>
3122- <td>
3123- <para style="P19">[[ l['name'] ]]</para>
3124- </td>
3125- <td>
3126- <para style="P19">[[ formatLang (l['amount_original']) ]]</para>
3127- </td>
3128- <td>
3129- <para style="P19">[[ formatLang (l['amount_unreconciled']) ]]</para>
3130- </td>
3131- <td>
3132- <para style="P19">
3133+ <para style="P8">
3134+ <font face="Helvetica" size="2.0">[[ repeatIn(page['lines'],'l') ]]</font>
3135+ <font face="Helvetica"> [[ formatLang(l['date_original'] ,date=True) or '' ]]</font>
3136+ </para>
3137+ </td>
3138+ <td>
3139+ <para style="P8">[[ l['name'] ]]</para>
3140+ </td>
3141+ <td>
3142+ <para style="P8">[[formatLang(l['amount_original']) ]]</para>
3143+ </td>
3144+ <td>
3145+ <para style="P8">[[ formatLang(l['amount_due']) ]]</para>
3146+ </td>
3147+ <td>
3148+ <para style="Standard">
3149 <font color="white"> </font>
3150 </para>
3151 </td>
3152 <td>
3153- <para style="P19">[[ formatLang (l['amount']) ]]</para>
3154+ <para style="P8">[[ formatLang(l['amount']) ]]</para>
3155 </td>
3156 </tr>
3157 </blockTable>
3158 <blockTable colWidths="485.0,77.0" style="Table9">
3159 <tr>
3160 <td>
3161- <para style="P17">Check Amount</para>
3162+ <para style="P4">Check Amount</para>
3163 </td>
3164 <td>
3165- <para style="P16">[[ formatLang (voucher.amount) ]]</para>
3166+ <para style="P3">[[ formatLang (page['amount']) or 'VOID' ]]</para>
3167 </td>
3168 </tr>
3169 </blockTable>
3170- <para style="P3">
3171+ <para style="Standard">
3172 <font color="white"> </font>
3173 </para>
3174 </td>
3175 </tr>
3176 </blockTable>
3177- <para style="P2">
3178+ <para style="Standard">
3179 <font color="white"> </font>
3180 </para>
3181 </story>
3182
3183=== modified file 'account_check_writing/report/check_print_top.sxw'
3184Binary files account_check_writing/report/check_print_top.sxw 2012-11-01 07:32:01 +0000 and account_check_writing/report/check_print_top.sxw 2013-11-19 00:05:44 +0000 differ
3185=== added file 'account_check_writing/res_company.py'
3186--- account_check_writing/res_company.py 1970-01-01 00:00:00 +0000
3187+++ account_check_writing/res_company.py 2013-11-19 00:05:44 +0000
3188@@ -0,0 +1,45 @@
3189+# -*- coding: utf-8 -*-
3190+##############################################################################
3191+#
3192+# OpenERP, Open Source Management Solution
3193+# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
3194+#
3195+# This program is free software: you can redistribute it and/or modify
3196+# it under the terms of the GNU Affero General Public License as
3197+# published by the Free Software Foundation, either version 3 of the
3198+# License, or (at your option) any later version.
3199+#
3200+# This program is distributed in the hope that it will be useful,
3201+# but WITHOUT ANY WARRANTY; without even the implied warranty of
3202+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3203+# GNU Affero General Public License for more details.
3204+#
3205+# You should have received a copy of the GNU Affero General Public License
3206+# along with this program. If not, see <http://www.gnu.org/licenses/>.
3207+#
3208+##############################################################################
3209+
3210+from openerp.osv import osv, fields
3211+
3212+
3213+class res_company(osv.Model):
3214+
3215+ _inherit = "res.company"
3216+
3217+ _columns = {
3218+ 'check_layout': fields.selection([
3219+ ('top', 'Check on Top'),
3220+ ('middle', 'Check in middle'),
3221+ ('bottom', 'Check on bottom'),
3222+ ], "Choose Check layout",
3223+ 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"),
3224+ 'credit_section': fields.boolean('Display Credits Separately', help="Invoices and credits will be displayed in their respective section on the check stubs."),
3225+ 'suppress_unpaid': fields.boolean('Suppress Unpaid Items', help="Do not print unpaid items on the check stubs."),
3226+ 'multi_stub': fields.boolean('Multi-Pages Check Stub', help="This option allows you to print check details (stub) on multiple pages."),
3227+ }
3228+
3229+ _defaults = {
3230+ 'check_layout': lambda *a: 'top',
3231+ }
3232+
3233+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3234
3235=== added file 'account_check_writing/res_company_view.xml'
3236--- account_check_writing/res_company_view.xml 1970-01-01 00:00:00 +0000
3237+++ account_check_writing/res_company_view.xml 2013-11-19 00:05:44 +0000
3238@@ -0,0 +1,26 @@
3239+<?xml version="1.0" encoding="utf-8"?>
3240+<openerp>
3241+ <data>
3242+ <!--
3243+ check format option in company
3244+ -->
3245+
3246+ <record id="check_format_company" model="ir.ui.view">
3247+ <field name="name">res.company.check.format</field>
3248+ <field name="model">res.company</field>
3249+ <field name="priority">17</field>
3250+ <field name="inherit_id" ref="base.view_company_form"/>
3251+ <field name="arch" type="xml">
3252+ <xpath expr="//group[@name='account_grp']" position="after">
3253+ <group name="write_check" string="Checks">
3254+ <field name="check_layout"/>
3255+ <field name="multi_stub"/>
3256+ <field name="credit_section" />
3257+ <field name="suppress_unpaid" />
3258+ </group>
3259+ </xpath>
3260+ </field>
3261+ </record>
3262+
3263+ </data>
3264+</openerp>
3265
3266=== added directory 'account_check_writing/static'
3267=== added directory 'account_check_writing/static/description'
3268=== added file 'account_check_writing/static/description/icon.png'
3269Binary files account_check_writing/static/description/icon.png 1970-01-01 00:00:00 +0000 and account_check_writing/static/description/icon.png 2013-11-19 00:05:44 +0000 differ
3270=== added directory 'account_check_writing/static/src'
3271=== added directory 'account_check_writing/test'
3272=== added file 'account_check_writing/test/account_check_writing_report.yml'
3273--- account_check_writing/test/account_check_writing_report.yml 1970-01-01 00:00:00 +0000
3274+++ account_check_writing/test/account_check_writing_report.yml 2013-11-19 00:05:44 +0000
3275@@ -0,0 +1,79 @@
3276+-
3277+ In order to test the PDF reports defined on an invoice, we will validate the check first.
3278+-
3279+ I Validate checkl by clicking on Validate button
3280+-
3281+ !workflow {model: account.voucher, action: proforma_voucher, ref: account_checkvoucher_01}
3282+-
3283+ I check that check has been posted and in posted state.
3284+-
3285+ !assert {model: account.voucher, id: account_checkvoucher_01}:
3286+ - state == 'posted'
3287+-
3288+ I create a check printing wizard with next default check number.
3289+-
3290+ !record {model: account.check.write, id: account_check_write_top_01}:
3291+ check_number: 1
3292+ force_number: False
3293+ force_overwrite: False
3294+-
3295+ I execute the print check wizrd to assign nunber to the check and will pirnt the default(top) report return by the wizard action.
3296+-
3297+ !python {model: account.check.write}: |
3298+ context.update({'active_model': 'account.voucher', 'active_id':ref('account_checkvoucher_01'), 'active_ids': [ref('account_checkvoucher_01')]})
3299+ report = self.print_check_write(cr, uid, [ref('account_check_write_top_01')], context=context)
3300+ import os
3301+ import openerp.report
3302+ from openerp import tools
3303+ assert report.get('report_name') == "account.print.check.top", 'expected check has to be Top check(account.print.check.top).'
3304+ data, format = openerp.report.render_report(cr, uid, [ref('account_checkvoucher_01')], report.get('report_name'), {}, {})
3305+ if tools.config['test_report_directory']:
3306+ file(os.path.join(tools.config['test_report_directory'], 'account-report_check_top.'+format), 'wb+').write(data)
3307+-
3308+ I verify that check has been assigned a number.
3309+-
3310+ !assert {model: account.voucher, id: account_checkvoucher_01}:
3311+ - check_number != False
3312+-
3313+ In order to test the print top check report, I call Print Check Button of the check, which returns the report action using which will pirnt the default(top) report.
3314+-
3315+ !python {model: account.voucher}: |
3316+ context.update({'active_model': 'account.voucher', 'active_id':ref('account_checkvoucher_01'), 'active_ids': [ref('account_checkvoucher_01')]})
3317+ report = self.print_check(cr, uid, [ref("account_checkvoucher_01")], context)
3318+ assert report.get('report_name') == "account.print.check.top", 'expected check has to be Top check(account.print.check.top).'
3319+ from openerp import tools
3320+ data, format = openerp.report.render_report(cr, uid, [ref('account_checkvoucher_01')], report.get('report_name'), {}, {})
3321+ if tools.config['test_report_directory']:
3322+ file(os.path.join(tools.config['test_report_directory'], 'account-report_check_top.'+format), 'wb+').write(data)
3323+-
3324+ I set the default company check layput to Check on middle.
3325+-
3326+ !python {model: res.company}: |
3327+ self.write(cr, uid, [ref("base.main_company")], {'check_layout': 'middle'})
3328+-
3329+ In order to test the print middle check report, I call Print Check Button of the check, which returns the report action using which will pirnt the default(middle) report.
3330+-
3331+ !python {model: account.voucher}: |
3332+ context.update({'active_model': 'account.voucher', 'active_id':ref('account_checkvoucher_01'), 'active_ids': [ref('account_checkvoucher_01')]})
3333+ report = self.print_check(cr, uid, [ref("account_checkvoucher_01")], context)
3334+ assert report.get('report_name') == "account.print.check.middle", 'expected check has to be Middle check(account.print.check.middle).'
3335+ from openerp import tools
3336+ data, format = openerp.report.render_report(cr, uid, [ref('account_checkvoucher_01')], report.get('report_name'), {}, {})
3337+ if tools.config['test_report_directory']:
3338+ file(os.path.join(tools.config['test_report_directory'], 'account-report_check_middle.'+format), 'wb+').write(data)
3339+-
3340+ I set the default company check layput to Check on bottom'.
3341+-
3342+ !python {model: res.company}: |
3343+ self.write(cr, uid, [ref("base.main_company")], {'check_layout': 'bottom'})
3344+-
3345+ In order to test the print bottom check report, I call Print Check Button of the check, which returns the report action using which will pirnt the default(bottom) report.
3346+-
3347+ !python {model: account.voucher}: |
3348+ context.update({'active_model': 'account.voucher', 'active_id':ref('account_checkvoucher_01'), 'active_ids': [ref('account_checkvoucher_01')]})
3349+ report = self.print_check(cr, uid, [ref("account_checkvoucher_01")], context)
3350+ assert report.get('report_name') == "account.print.check.bottom", 'expected check has to be Bottom check(account.print.check.bottom).'
3351+ from openerp import tools
3352+ data, format = openerp.report.render_report(cr, uid, [ref('account_checkvoucher_01')], report.get('report_name'), {}, {})
3353+ if tools.config['test_report_directory']:
3354+ file(os.path.join(tools.config['test_report_directory'], 'account-report_check_bottom.'+format), 'wb+').write(data)
3355
3356=== modified file 'account_check_writing/wizard/account_check_batch_printing.py'
3357--- account_check_writing/wizard/account_check_batch_printing.py 2013-04-15 10:23:49 +0000
3358+++ account_check_writing/wizard/account_check_batch_printing.py 2013-11-19 00:05:44 +0000
3359@@ -2,7 +2,7 @@
3360 ##############################################################################
3361 #
3362 # OpenERP, Open Source Management Solution
3363-# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
3364+# Copyright (C) 2004-Today OpenERP S.A. (<http://www.openerp.com>).
3365 #
3366 # This program is free software: you can redistribute it and/or modify
3367 # it under the terms of the GNU Affero General Public License as
3368@@ -19,68 +19,115 @@
3369 #
3370 ##############################################################################
3371
3372+from openerp.osv import osv, fields
3373 from openerp.tools.translate import _
3374
3375-from openerp.osv import fields, osv
3376-
3377-class account_check_write(osv.osv_memory):
3378+CHECK_LAYOUT = {
3379+ 'top': 'account.print.check.top',
3380+ 'middle': 'account.print.check.middle',
3381+ 'bottom': 'account.print.check.bottom',
3382+}
3383+
3384+
3385+class account_check_write(osv.TransientModel):
3386+
3387 _name = 'account.check.write'
3388- _description = 'Prin Check in Batch'
3389+ _description = 'Print Check in Batch'
3390
3391 _columns = {
3392- 'check_number': fields.integer('Next Check Number', required=True, help="The number of the next check number to be printed."),
3393+ 'check_number': fields.integer('Check Sequence Number', required=True,
3394+ help="This is the number of the first check in the batch-print."),
3395+ 'force_number': fields.boolean('Overwrite Check Numbers',
3396+ help="If checked, it will reassign a new check number from given sequence to the check(s) even if check(s) already have a number."),
3397+ 'force_overwrite': fields.boolean('Adjust Sequence',
3398+ help="Use this if the default check number above is different than the next paper check number.\n- If checked, it will consider the check number above as the new default sequence.\n- Uncheck this if you are printing an exceptional batch."),
3399 }
3400
3401+ def _get_sequence(self, cr, uid, ids, tolerate_noid=False, context=None):
3402+ """
3403+ Generic Method to fetch ir.sequence from voucher journal.
3404+ also tolerate the no seuquence condition, if needed e.g. default_get
3405+ """
3406+ voucher_pool = self.pool.get('account.voucher')
3407+ sequence_id = False
3408+ journal_id = voucher_pool.browse(cr, uid, context['active_id'], context=context).journal_id
3409+ if journal_id.check_sequence_id:
3410+ sequence_id = journal_id.check_sequence_id.id
3411+ elif not journal_id and tolerate_noid:
3412+ #if journal has no sequence we can use generic check sequence.
3413+ ref, sequence_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'account_check_writing', 'seq_check_number')
3414+ else:
3415+ raise osv.except_osv(_('Error!'), _("No check number sequence defined for the journal : %s") % (journal_id.name))
3416+ return sequence_id
3417+
3418 def _get_next_number(self, cr, uid, context=None):
3419- dummy, sequence_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'account_check_writing', 'sequence_check_number')
3420- return self.pool.get('ir.sequence').read(cr, uid, sequence_id, ['number_next'])['number_next']
3421+ """
3422+ Method will generate new sequence form active_id journal sequence.
3423+ @return: next sequence number to be used.
3424+ """
3425+ num_next = False
3426+ if context == None:
3427+ context = {}
3428+ if context.get('active_id') and context.get('active_model'):
3429+ sequence_id = self._get_sequence(cr, uid, context.get('active_id'), tolerate_noid=True, context=context)
3430+ num_next = self.pool.get('ir.sequence').read(cr, uid, sequence_id, ['number_next'])['number_next']
3431+ return num_next
3432
3433 _defaults = {
3434 'check_number': _get_next_number,
3435- }
3436+ 'force_overwrite': True,
3437+ }
3438+
3439+ def _check_journal(self, cr, uid, checks, context=None):
3440+ journals = [check.journal_id.id for check in checks]
3441+ for check in checks:
3442+ if check.journal_id.type != "bank":
3443+ raise osv.except_osv(_("Warning"), _("Cannot perform operation. Voucher Journal type has to be Bank and Cheques."))
3444+ if len(set(journals)) > 1:
3445+ raise osv.except_osv(_("Warning"), _("You cannot batch-print checks from different journals in order to respect each journals sequence."))
3446+ states = [check.state for check in checks]
3447+ if "draft" in states:
3448+ raise osv.except_osv(_("Warning"), _("You cannot print draft checks. You have to validate them first."))
3449+ return True
3450
3451 def print_check_write(self, cr, uid, ids, context=None):
3452 if context is None:
3453 context = {}
3454- voucher_obj = self.pool.get('account.voucher')
3455- ir_sequence_obj = self.pool.get('ir.sequence')
3456-
3457- #update the sequence to number the checks from the value encoded in the wizard
3458- dummy, sequence_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'account_check_writing', 'sequence_check_number')
3459- increment = ir_sequence_obj.read(cr, uid, sequence_id, ['number_increment'])['number_increment']
3460- new_value = self.browse(cr, uid, ids[0], context=context).check_number
3461- ir_sequence_obj.write(cr, uid, sequence_id, {'number_next': new_value})
3462-
3463- #validate the checks so that they get a number
3464+ voucher_pool = self.pool.get('account.voucher')
3465+ sequence_pool = self.pool.get('ir.sequence')
3466+ transient_record = self.browse(cr, uid, ids[0], context=context)
3467+ new_value = transient_record.check_number
3468 voucher_ids = context.get('active_ids', [])
3469- for check in voucher_obj.browse(cr, uid, voucher_ids, context=context):
3470- new_value += increment
3471- if check.number:
3472- raise osv.except_osv(_('Error!'),_("One of the printed check already got a number."))
3473- voucher_obj.proforma_voucher(cr, uid, voucher_ids, context=context)
3474-
3475- #update the sequence again (because the assignation using next_val was made during the same transaction of
3476- #the first update of sequence)
3477- ir_sequence_obj.write(cr, uid, sequence_id, {'number_next': new_value})
3478-
3479- #print the checks
3480- check_layout_report = {
3481- 'top' : 'account.print.check.top',
3482- 'middle' : 'account.print.check.middle',
3483- 'bottom' : 'account.print.check.bottom',
3484- }
3485- check_layout = voucher_obj.browse(cr, uid, voucher_ids[0], context=context).company_id.check_layout
3486- if not check_layout:
3487- check_layout = 'top'
3488+ checks = voucher_pool.browse(cr, uid, voucher_ids, context=context)
3489+ self._check_journal(cr, uid, checks, context)
3490+ sequence = self._get_sequence(cr, uid, checks[0].id, context=context)
3491+ #save the current start of the squence needed in case of force number
3492+ #and update back later when job is done, this to be consistant.
3493+ old_next_start = sequence_pool.read(cr, uid, sequence, ['number_next'], context)['number_next']
3494+ #update sequence with force number for consistant numbering.
3495+ sequence_pool.write(cr, uid, sequence, {'number_next': new_value}, context=context)
3496+ #again fetch the increment and next number to be used in check number assigment.
3497+ requence_rec = sequence_pool.read(cr, uid, sequence, ['number_next', 'number_increment'], context=context)
3498+ new_next_start, increment = requence_rec['number_next'], requence_rec['number_increment']
3499+ for check in checks:
3500+ new_value = sequence_pool.next_by_id(cr, uid, sequence, context)
3501+ if check.check_number and not transient_record.force_number:
3502+ raise osv.except_osv(_('Error!'), _("At least one of the checks in the batch already has a check number. If you want to overwrite their number in this batch-print, select the corresponding checkbox."))
3503+ else:
3504+ voucher_pool.write(cr, uid, [check.id], {"check_number": new_value, "check_done": True}, context=context)
3505+ new_next_start += increment
3506+ up_number = new_next_start if transient_record.force_overwrite else old_next_start
3507+ sequence_pool.write(cr, uid, sequence, {'number_next': up_number}, context=context)
3508+ check_layout = voucher_pool.browse(cr, uid, voucher_ids[0], context=context).company_id.check_layout or 'top'
3509 return {
3510- 'type': 'ir.actions.report.xml',
3511- 'report_name':check_layout_report[check_layout],
3512+ 'type': 'ir.actions.report.xml',
3513+ 'report_name': CHECK_LAYOUT[check_layout],
3514 'datas': {
3515- 'model':'account.voucher',
3516+ 'model': 'account.voucher',
3517 'ids': voucher_ids,
3518 'report_type': 'pdf'
3519- },
3520+ },
3521 'nodestroy': True
3522- }
3523-
3524-
3525+ }
3526+
3527+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3528
3529=== modified file 'account_check_writing/wizard/account_check_batch_printing_view.xml'
3530--- account_check_writing/wizard/account_check_batch_printing_view.xml 2012-12-06 11:18:25 +0000
3531+++ account_check_writing/wizard/account_check_batch_printing_view.xml 2013-11-19 00:05:44 +0000
3532@@ -1,28 +1,42 @@
3533 <?xml version="1.0" encoding="utf-8"?>
3534 <openerp>
3535- <data noupdate="0">
3536-
3537+ <data>
3538 <record id="view_account_check_write" model="ir.ui.view">
3539- <field name="name">account.check.form</field>
3540+ <field name="name">Print Check(s) in Batch Form</field>
3541 <field name="model">account.check.write</field>
3542 <field name="arch" type="xml">
3543 <form string="Check" version="7.0">
3544- <group col="4">
3545+ <group>
3546 <field name="check_number"/>
3547+ <field name="force_number"/>
3548+ <field name="force_overwrite"/>
3549 </group>
3550 <footer>
3551- <button name="print_check_write" string="Print Check" type="object" class="oe_highlight"/> or
3552+ <button name="print_check_write" string="Print Check(s)" type="object" class="oe_highlight"/> or
3553 <button string="Cancel" class="oe_link" special="cancel"/>
3554 </footer>
3555 </form>
3556 </field>
3557 </record>
3558
3559+ <record id="action_view_account_check_write" model="ir.actions.act_window">
3560+ <field name="name">Print Check(s) in Batch</field>
3561+ <field name="type">ir.actions.act_window</field>
3562+ <field name="res_model">account.check.write</field>
3563+ <field name="view_type">form</field>
3564+ <field name="view_id" ref="view_account_check_write"/>
3565+ <field name="context">{"print_single":True}</field>
3566+ <field name="target">new</field>
3567+ </record>
3568+
3569 <act_window id="action_account_check_write"
3570- multi="True"
3571- name="Print Check in Batch"
3572- res_model="account.check.write" src_model="account.voucher"
3573- view_mode="form" target="new" view_type="form" />
3574+ name="Print Check(s) in Batch"
3575+ res_model="account.check.write"
3576+ src_model="account.voucher"
3577+ view_mode="form"
3578+ target="new"
3579+ view_type="form"
3580+ key2="client_print_multi"/>
3581
3582 </data>
3583 </openerp>

Subscribers

People subscribed via source and target branches

to all changes: