[MERGE] added account_check_writing module
bzr revid: qdp-launchpad@openerp.com-20120130161349-2xvk0p3xnar67gkf
This commit is contained in:
commit
4a94de154b
|
@ -0,0 +1,26 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import account
|
||||
import account_voucher
|
||||
import wizard
|
||||
import report
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
@ -0,0 +1,48 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
{
|
||||
"name" : "Check writing",
|
||||
"version" : "1.1",
|
||||
"author" : "OpenERP SA, NovaPoint Group",
|
||||
"category": "Generic Modules/Accounting",
|
||||
"description": """
|
||||
Module for the Check writing and check printing
|
||||
""",
|
||||
'website': 'http://www.openerp.com',
|
||||
'init_xml': [],
|
||||
"depends" : [
|
||||
"account_voucher",
|
||||
],
|
||||
'update_xml': [
|
||||
'account_check_writing_report.xml',
|
||||
'account_view.xml',
|
||||
'account_voucher_view.xml',
|
||||
'account_check_writing_data.xml',
|
||||
],
|
||||
'demo_xml': [
|
||||
'account_demo.xml',
|
||||
],
|
||||
'test': [
|
||||
],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
@ -0,0 +1,50 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from osv import osv,fields
|
||||
|
||||
class account_journal(osv.osv):
|
||||
_inherit = "account.journal"
|
||||
|
||||
_columns = {
|
||||
'allow_check_writing': fields.boolean('Allow Check writing', help='Check this if the journal is to be used for writing checks.'),
|
||||
'use_preprint_check': fields.boolean('Use Preprinted Check'),
|
||||
}
|
||||
|
||||
account_journal()
|
||||
|
||||
class res_company(osv.osv):
|
||||
_inherit = "res.company"
|
||||
_columns = {
|
||||
'check_layout': fields.selection([
|
||||
('top', 'Check on Top'),
|
||||
('middle', 'Check in middle'),
|
||||
('bottom', 'Check on bottom'),
|
||||
],"Choose Check layout",
|
||||
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" ),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'check_layout' : lambda *a: 'top',
|
||||
}
|
||||
|
||||
res_company()
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data noupdate="1">
|
||||
<record forcecreate="1" id="sequence_type_check_number" model="ir.sequence.type">
|
||||
<field name="name">Check Number</field>
|
||||
<field name="code">check.number</field>
|
||||
</record>
|
||||
|
||||
<record id="sequence_check_number" model="ir.sequence">
|
||||
<field name="name">Check Number</field>
|
||||
<field name="code">check.number</field>
|
||||
<field eval="4" name="padding"/>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
|
@ -0,0 +1,29 @@
|
|||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<report id="account_print_check_top"
|
||||
string="Print Check"
|
||||
model="account.voucher"
|
||||
name="account.print.check.top"
|
||||
rml="account_check_writing/report/check_print_top.rml"
|
||||
menu="False"
|
||||
auto="False"/>
|
||||
|
||||
<report id="account_print_check_middle"
|
||||
string="Print Check"
|
||||
model="account.voucher"
|
||||
name="account.print.check.middle"
|
||||
rml="account_check_writing/report/check_print_middle.rml"
|
||||
menu="False"
|
||||
auto="False"/>
|
||||
|
||||
<report id="account_print_check_bottom"
|
||||
string="Print Check"
|
||||
model="account.voucher"
|
||||
name="account.print.check.bottom"
|
||||
rml="account_check_writing/report/check_print_bottom.rml"
|
||||
menu="False"
|
||||
auto="False"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data noupdate="1">
|
||||
<record id="account.check_journal" model="account.journal">
|
||||
<field name="allow_check_writing" eval="1" />
|
||||
<field name="sequence_id" ref="sequence_check_number"/>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
|
@ -0,0 +1,42 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<!--
|
||||
check option in journal
|
||||
-->
|
||||
|
||||
<record id="view_account_journal_form" model="ir.ui.view">
|
||||
<field name="name">account.journal.form</field>
|
||||
<field name="model">account.journal</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="account.view_account_journal_form" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="type" on_change="onchange_type(type, currency)" />
|
||||
<field name="entry_posted" position="after">
|
||||
<field name="allow_check_writing" attrs="{'readonly':[('type','!=','bank')]}" />
|
||||
<field name="use_preprint_check" attrs="{'readonly':[('type','!=','bank')]}" />
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!--
|
||||
check format option in company
|
||||
-->
|
||||
|
||||
<record id="check_format_company" model="ir.ui.view">
|
||||
<field name="name">res.company.check.format</field>
|
||||
<field name="model">res.company</field>
|
||||
<field name="type">form</field>
|
||||
<field name="priority">17</field>
|
||||
<field name="inherit_id" ref="base.view_company_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<page string="Configuration" position="inside">
|
||||
<separator string="Default Check layout" colspan="4"/>
|
||||
<field name="check_layout"/>
|
||||
<newline/>
|
||||
</page>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
|
@ -0,0 +1,99 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from osv import osv,fields
|
||||
from tools.translate import _
|
||||
from tools.amount_to_text_en import amount_to_text
|
||||
from lxml import etree
|
||||
|
||||
class account_voucher(osv.osv):
|
||||
_inherit = 'account.voucher'
|
||||
|
||||
def _make_journal_search(self, cr, uid, ttype, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
journal_pool = self.pool.get('account.journal')
|
||||
if context.get('write_check',False) :
|
||||
return journal_pool.search(cr, uid, [('allow_check_writing', '=', True)], limit=1)
|
||||
return journal_pool.search(cr, uid, [('type', '=', ttype)], limit=1)
|
||||
|
||||
_columns = {
|
||||
'amount_in_word' : fields.char("Amount in Word" , size=128, readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'allow_check' : fields.related('journal_id', 'allow_check_writing', type='boolean', string='Allow Check Writing'),
|
||||
'number': fields.char('Number', size=32),
|
||||
}
|
||||
|
||||
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):
|
||||
""" Inherited - add amount_in_word and allow_check_writting in returned value dictionary """
|
||||
if not context:
|
||||
context = {}
|
||||
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)
|
||||
if 'value' in default:
|
||||
amount = 'amount' in default['value'] and default['value']['amount'] or amount
|
||||
|
||||
#TODO : generic amount_to_text is not ready yet, otherwise language (and country) and currency can be passed
|
||||
#amount_in_word = amount_to_text(amount, context=context)
|
||||
amount_in_word = amount_to_text(amount)
|
||||
default['value'].update({'amount_in_word':amount_in_word})
|
||||
if journal_id:
|
||||
allow_check_writing = self.pool.get('account.journal').browse(cr, uid, journal_id, context=context).allow_check_writing
|
||||
default['value'].update({'allow_check':allow_check_writing})
|
||||
return default
|
||||
|
||||
def print_check(self, cr, uid, ids, context=None):
|
||||
if not ids:
|
||||
return {}
|
||||
|
||||
check_layout_report = {
|
||||
'top' : 'account.print.check.top',
|
||||
'middle' : 'account.print.check.middle',
|
||||
'bottom' : 'account.print.check.bottom',
|
||||
}
|
||||
|
||||
check_layout = self.browse(cr, uid, ids[0], context=context).company_id.check_layout
|
||||
return {
|
||||
'type': 'ir.actions.report.xml',
|
||||
'report_name':check_layout_report[check_layout],
|
||||
'datas': {
|
||||
'model':'account.voucher',
|
||||
'id': ids and ids[0] or False,
|
||||
'ids': ids and ids or [],
|
||||
'report_type': 'pdf'
|
||||
},
|
||||
'nodestroy': True
|
||||
}
|
||||
|
||||
def fields_view_get(self, cr, uid, view_id=None, view_type=False, context=None, toolbar=False, submenu=False):
|
||||
"""
|
||||
Add domain 'allow_check_writting = True' on journal_id field and remove 'widget = selection' on the same
|
||||
field because the dynamic domain is not allowed on such widget
|
||||
"""
|
||||
res = super(account_voucher, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=submenu)
|
||||
doc = etree.XML(res['arch'])
|
||||
nodes = doc.xpath("//field[@name='journal_id']")
|
||||
if context.get('write_check', False) :
|
||||
for node in nodes:
|
||||
node.set('domain', "[('type', '=', 'bank'), ('allow_check_writing','=',True)]")
|
||||
node.set('widget', '')
|
||||
res['arch'] = etree.tostring(doc)
|
||||
return res
|
||||
|
||||
account_voucher()
|
|
@ -0,0 +1,56 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<!-- Supplier voucher view -->
|
||||
|
||||
<record model="ir.ui.view" id="view_vendor_payment_check_form">
|
||||
<field name="name">account.voucher.payment.check.form</field>
|
||||
<field name="model">account.voucher</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="account_voucher.view_vendor_payment_form" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="journal_id" position="after">
|
||||
<newline/>
|
||||
<field name="allow_check" invisible="1"/>
|
||||
<field name="amount_in_word" attrs="{'invisible':[('allow_check','!=',1)]}" nolabel="1" colspan="6"/>
|
||||
<newline/>
|
||||
</field>
|
||||
<field name="number" position="replace">
|
||||
<field name="number" attrs="{'readonly':[('allow_check','!=',1)]}" />
|
||||
</field>
|
||||
<button name="proforma_voucher" position="after">
|
||||
<button name="print_check" icon="gtk-print" string="Print Check" type="object" attrs="{'invisible':['|',('allow_check','!=',1),('state','!=','posted') ]}"/>
|
||||
</button>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_write_check" model="ir.actions.act_window">
|
||||
<field name="name">Write Checks</field>
|
||||
<field name="res_model">account.voucher</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form,tree</field>
|
||||
<field name="domain">[('journal_id.type', '=', 'bank'), ('type','=','payment'), ('journal_id.allow_check_writing','=',True)]</field>
|
||||
<field name="context">{'type':'payment','write_check':True}</field>
|
||||
<field name="search_view_id" ref="account_voucher.view_voucher_filter"/>
|
||||
<field name="target">current</field>
|
||||
<field name="help">The check payment form allows you to track the payment you do to your suppliers specially by check. When you select a supplier, the payment method and an amount for the payment, OpenERP will propose to reconcile your payment with the open supplier invoices or bills.You can print the check</field>
|
||||
</record>
|
||||
|
||||
<record id="action_write_check_form" model="ir.actions.act_window.view">
|
||||
<field eval="2" name="sequence"/>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="view_vendor_payment_check_form"/>
|
||||
<field name="act_window_id" ref="action_write_check"/>
|
||||
</record>
|
||||
|
||||
<record id="action_write_check_tree" model="ir.actions.act_window.view">
|
||||
<field eval="1" name="sequence"/>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="act_window_id" ref="action_write_check"/>
|
||||
</record>
|
||||
|
||||
<menuitem action="action_write_check" icon="STOCK_JUSTIFY_FILL" sequence="12"
|
||||
id="menu_action_write_check" parent="account.menu_finance_payables"/>
|
||||
</data>
|
||||
</openerp>
|
|
@ -0,0 +1,25 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import check_print
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
@ -0,0 +1,107 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import time
|
||||
from report import report_sxw
|
||||
from tools import amount_to_text_en
|
||||
|
||||
class report_print_check(report_sxw.rml_parse):
|
||||
def __init__(self, cr, uid, name, context):
|
||||
super(report_print_check, self).__init__(cr, uid, name, context)
|
||||
self.number_lines = 0
|
||||
self.number_add = 0
|
||||
self.localcontext.update({
|
||||
'time': time,
|
||||
'get_lines': self.get_lines,
|
||||
'fill_stars' : self.fill_stars,
|
||||
'get_zip_line': self.get_zip_line,
|
||||
})
|
||||
def fill_stars(self, amount):
|
||||
amount = amount.replace('Dollars','')
|
||||
if len(amount) < 100:
|
||||
stars = 100 - len(amount)
|
||||
return ' '.join([amount,'*'*stars])
|
||||
|
||||
else: return amount
|
||||
|
||||
def get_zip_line(self, address):
|
||||
'''
|
||||
Get the address line
|
||||
'''
|
||||
ret = ''
|
||||
if address:
|
||||
if address.city:
|
||||
ret += address.city
|
||||
if address.state_id:
|
||||
if address.state_id.name:
|
||||
if ret:
|
||||
ret += ', '
|
||||
ret += address.state_id.name
|
||||
if address.zip:
|
||||
if ret:
|
||||
ret += ' '
|
||||
ret += address.zip
|
||||
return ret
|
||||
|
||||
def get_lines(self, voucher_lines):
|
||||
result = []
|
||||
self.number_lines = len(voucher_lines)
|
||||
for i in range(0, min(10,self.number_lines)):
|
||||
if i < self.number_lines:
|
||||
res = {
|
||||
'date_due' : voucher_lines[i].date_due,
|
||||
'name' : voucher_lines[i].name,
|
||||
'amount_original' : voucher_lines[i].amount_original and voucher_lines[i].amount_original or False,
|
||||
'amount_unreconciled' : voucher_lines[i].amount_unreconciled and voucher_lines[i].amount_unreconciled or False,
|
||||
'amount' : voucher_lines[i].amount and voucher_lines[i].amount or False,
|
||||
}
|
||||
else :
|
||||
res = {
|
||||
'date_due' : False,
|
||||
'name' : False,
|
||||
'amount_original' : False,
|
||||
'amount_due' : False,
|
||||
'amount' : False,
|
||||
}
|
||||
result.append(res)
|
||||
return result
|
||||
|
||||
report_sxw.report_sxw(
|
||||
'report.account.print.check.top',
|
||||
'account.voucher',
|
||||
'addons/account_check_writing/report/check_print_top.rml',
|
||||
parser=report_print_check,header=False
|
||||
)
|
||||
|
||||
report_sxw.report_sxw(
|
||||
'report.account.print.check.middle',
|
||||
'account.voucher',
|
||||
'addons/account_check_writing/report/check_print_middle.rml',
|
||||
parser=report_print_check,header=False
|
||||
)
|
||||
|
||||
report_sxw.report_sxw(
|
||||
'report.account.print.check.bottom',
|
||||
'account.voucher',
|
||||
'addons/account_check_writing/report/check_print_bottom.rml',
|
||||
parser=report_print_check,header=False
|
||||
)
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
@ -0,0 +1,321 @@
|
|||
<?xml version="1.0"?>
|
||||
<document filename="test.pdf">
|
||||
<template pageSize="(595, 842)" title="Test" author="Martin Simon" allowSplitting="20">
|
||||
<pageTemplate id="first">
|
||||
<frame id="first" x1="13.0" y1="0.0" width="567" height="765"/>
|
||||
</pageTemplate>
|
||||
</template>
|
||||
<stylesheet>
|
||||
<blockTableStyle id="Standard_Outline">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table1">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table4">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table5">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table12">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table2">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table6">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table10">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table11">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table3">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table7">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table8">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table9">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<initialize>
|
||||
<paraStyle name="all" alignment="justify"/>
|
||||
</initialize>
|
||||
<paraStyle name="P1" rightIndent="-1.0" leftIndent="0.0" fontName="Helvetica"/>
|
||||
<paraStyle name="P2" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica"/>
|
||||
<paraStyle name="P3" fontName="Helvetica"/>
|
||||
<paraStyle name="P4" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT"/>
|
||||
<paraStyle name="P5" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="RIGHT"/>
|
||||
<paraStyle name="P6" fontName="Helvetica-Bold" fontSize="9.0" leading="11"/>
|
||||
<paraStyle name="P7" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT"/>
|
||||
<paraStyle name="P8" fontName="Helvetica" fontSize="9.0" leading="11"/>
|
||||
<paraStyle name="P9" fontName="Helvetica" fontSize="10.0" leading="13"/>
|
||||
<paraStyle name="P10" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="RIGHT"/>
|
||||
<paraStyle name="P11" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="LEFT"/>
|
||||
<paraStyle name="P12" fontName="Helvetica" fontSize="12.0" leading="15"/>
|
||||
<paraStyle name="P13" fontName="Helvetica"/>
|
||||
<paraStyle name="P14" fontName="Helvetica" fontSize="10.0" leading="13"/>
|
||||
<paraStyle name="P15" fontName="Helvetica" fontSize="10.0" leading="13"/>
|
||||
<paraStyle name="P16" fontName="Helvetica-Bold" fontSize="9.0" leading="11"/>
|
||||
<paraStyle name="P17" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT"/>
|
||||
<paraStyle name="P18" fontName="Helvetica" fontSize="9.0" leading="11"/>
|
||||
<paraStyle name="P19" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT"/>
|
||||
<paraStyle name="P20" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT"/>
|
||||
<paraStyle name="P21" fontName="Helvetica" fontSize="8.0" leading="10"/>
|
||||
<paraStyle name="P22" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT"/>
|
||||
<paraStyle name="P23" fontName="Helvetica-Bold" fontSize="8.0" leading="10"/>
|
||||
<paraStyle name="P24" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT"/>
|
||||
<paraStyle name="Standard" fontName="Helvetica"/>
|
||||
<paraStyle name="Heading" fontName="Helvetica" fontSize="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Caption" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Index" fontName="Helvetica"/>
|
||||
<paraStyle name="Table Contents" fontName="Helvetica"/>
|
||||
<paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER"/>
|
||||
<images/>
|
||||
</stylesheet>
|
||||
<story>
|
||||
<para style="P1">[[repeatIn(objects,'voucher')]]</para>
|
||||
<blockTable colWidths="568.0" style="Table2" rowHeights="285">
|
||||
<tr>
|
||||
<td>
|
||||
<blockTable colWidths="445.0,117.0" style="Table6">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P16">[[voucher.partner_id.name]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P16">[[ formatLang(voucher.date , date=True) or '' ]] [[ voucher.journal_id.use_preprint_check and voucher.chk_seq or '' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="81.0,186.0,83.0,81.0,54.0,78.0" style="Table10">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P4">Due Date</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">Description</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">Original Amount</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">Balance Due</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">Discount</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">Payment</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P19">[[ repeatIn(get_lines(voucher.line_dr_ids),'l') ]] [[ formatLang(l['date_original'] ,date=True) or '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P19">[[ l['name'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P19">[[formatLang( l['amount_original']) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P19">[[ formatLang( l['amount_due']) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P19">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P19">[[ formatLang (l['amount']) ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="485.0,77.0" style="Table11">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P24">Check Amount</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P23">[[ formatLang (voucher.amount) ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="568.0" style="Table3">
|
||||
<tr>
|
||||
<td>
|
||||
<blockTable colWidths="446.0,116.0" style="Table7">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P16">[[voucher.partner_id.name]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P16">[[ formatLang(voucher.date , date=True) or '' ]] [[ voucher.journal_id.use_preprint_check and voucher.chk_seq or '' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="82.0,185.0,89.0,76.0,52.0,78.0" style="Table8">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P4">Due Date</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">Description</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">Original Amount</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">Balance Due</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">Discount</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">Payment</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P19">[[ repeatIn(get_lines(voucher.line_dr_ids),'l') ]] [[ formatLang(l['date_original'] ,date=True) or '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P19">[[ l['name'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P19">[[ formatLang (l['amount_original']) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P19">[[ formatLang (l['amount_due']) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P19">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P19">[[ formatLang (l['amount']) ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="485.0,77.0" style="Table9" rowHeights="40.5">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P17">Check Amount</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P16">[[ formatLang (voucher.amount) ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="P2">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="568.0" style="Table1">
|
||||
<tr>
|
||||
<td>
|
||||
<blockTable colWidths="370.0,130.0,75.0" rowHeights="65.5,30" style="Table5">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P9"></para>
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P9">[[ voucher.journal_id.use_preprint_check and voucher.chk_seq or '' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P9"></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P9">[[ formatLang(voucher.date , date=True) or '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P9">[[ formatLang (voucher.amount) ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="54.0,500.0" rowHeights="65" style="Table12">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P15">[[ voucher.partner_id.name ]]</para>
|
||||
<para style="P15">[[ voucher.partner_id.address and voucher.partner_id.address[0] and voucher.partner_id.address[0].street or removeParentNode('para') ]]</para>
|
||||
<para style="P15">[[ voucher.partner_id.address and voucher.partner_id.address[0] and voucher.partner_id.address[0].street2 or removeParentNode('para') ]]</para>
|
||||
<para style="P15">[[ get_zip_line(voucher.partner_id.address) ]] </para>
|
||||
<para style="P15">[[ voucher.partner_id.address[0].country_id.name]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="550.0" rowHeights="93" style="Table5">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P9">[[ fill_stars(voucher.amount_in_word) ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
||||
<blockTable colWidths="25.0,500" style="Table12">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<!--para style="P15">[[ voucher.name ]]</para-->
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</story>
|
||||
</document>
|
|
@ -0,0 +1,359 @@
|
|||
<?xml version="1.0"?>
|
||||
<document filename="test.pdf">
|
||||
<template pageSize="(595, 842)" title="Test" author="Martin Simon" allowSplitting="20">
|
||||
<!-- Letter 612.0, 792.0 A4 595, 842 -->
|
||||
<pageTemplate id="first">
|
||||
<frame id="first" x1="13.0" y1="0.0" width="567" height="785"/>
|
||||
</pageTemplate>
|
||||
</template>
|
||||
<stylesheet>
|
||||
<blockTableStyle id="Standard_Outline">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table1">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table4">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table5">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table12">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table2">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table6">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table10">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table11">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table3">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table7">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table8">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table9">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<initialize>
|
||||
<paraStyle name="all" alignment="justify"/>
|
||||
</initialize>
|
||||
<paraStyle name="P1" rightIndent="-1.0" leftIndent="0.0" fontName="Helvetica"/>
|
||||
<paraStyle name="P2" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica"/>
|
||||
<paraStyle name="P3" fontName="Helvetica"/>
|
||||
<paraStyle name="P4" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT"/>
|
||||
<paraStyle name="P5" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="RIGHT"/>
|
||||
<paraStyle name="P6" fontName="Helvetica-Bold" fontSize="9.0" leading="11"/>
|
||||
<paraStyle name="P7" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT"/>
|
||||
<paraStyle name="P8" fontName="Helvetica" fontSize="9.0" leading="11"/>
|
||||
<paraStyle name="P9" fontName="Helvetica" fontSize="10.0" leading="13"/>
|
||||
<paraStyle name="P10" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="RIGHT"/>
|
||||
<paraStyle name="P11" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="LEFT"/>
|
||||
<paraStyle name="P12" fontName="Helvetica" fontSize="12.0" leading="15"/>
|
||||
<paraStyle name="P13" fontName="Helvetica"/>
|
||||
<paraStyle name="P14" fontName="Helvetica" fontSize="10.0" leading="13"/>
|
||||
<paraStyle name="P15" fontName="Helvetica" fontSize="10.0" leading="13"/>
|
||||
<paraStyle name="P16" fontName="Helvetica-Bold" fontSize="9.0" leading="11"/>
|
||||
<paraStyle name="P17" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT"/>
|
||||
<paraStyle name="P18" fontName="Helvetica" fontSize="9.0" leading="11"/>
|
||||
<paraStyle name="P19" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT"/>
|
||||
<paraStyle name="P20" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT"/>
|
||||
<paraStyle name="P21" fontName="Helvetica" fontSize="8.0" leading="10"/>
|
||||
<paraStyle name="P22" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT"/>
|
||||
<paraStyle name="P23" fontName="Helvetica-Bold" fontSize="8.0" leading="10"/>
|
||||
<paraStyle name="P24" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT"/>
|
||||
<paraStyle name="Standard" fontName="Helvetica"/>
|
||||
<paraStyle name="Heading" fontName="Helvetica" fontSize="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Caption" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Index" fontName="Helvetica"/>
|
||||
<paraStyle name="Table Contents" fontName="Helvetica"/>
|
||||
<paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER"/>
|
||||
<images/>
|
||||
</stylesheet>
|
||||
<story>
|
||||
<para style="P1">[[repeatIn(objects,'voucher')]]</para>
|
||||
<blockTable colWidths="568.0" style="Table2" rowHeights="320">
|
||||
<tr>
|
||||
<td>
|
||||
<blockTable colWidths="485.0,67.0" style="Table6">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P16"></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P14">[[ voucher.journal_id.use_preprint_check and voucher.chk_seq or '' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P16">[[voucher.partner_id.name]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P16">[[ formatLang(voucher.date , date=True) or '' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="81.0,186.0,83.0,81.0,54.0,78.0" style="Table10">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P4">Due Date</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">Description</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">Original Amount</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">Balance Due</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">Discount</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">Payment</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P19">[[ repeatIn(get_lines(voucher.line_dr_ids),'l') ]] [[ formatLang(l['date_original'] ,date=True) or '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P19">[[ l['name'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P19">[[formatLang( l['amount_original']) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P19">[[ formatLang( l['amount_due']) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P19">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P19">[[ formatLang (l['amount']) ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="485.0,77.0" style="Table11">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P24">Check Amount</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P23">[[ formatLang (voucher.amount) ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="485.0,77.0" rowHeights="158,10" style="Table11">
|
||||
<tr>
|
||||
<td>
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P14">[[ voucher.journal_id.use_preprint_check and voucher.chk_seq or '' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="550.0" rowHeights="10" style="Table5">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P26">[[ str(fill_stars(voucher.amount_in_word)) ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="568.0" style="Table1">
|
||||
<tr>
|
||||
<td>
|
||||
<blockTable colWidths="370.0,130.0,55.0" rowHeights=".95cm" style="Table5">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P9"></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P9"></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P9"></para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P9"></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P9">[[ formatLang(voucher.date , date=True) or '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P9">[[ formatLang (voucher.amount) ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="54.0,500.0" rowHeights="2.5cm" style="Table12">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P15">[[ voucher.partner_id.name ]]</para>
|
||||
<para style="P15">[[ voucher.partner_id.address and voucher.partner_id.address[0] and voucher.partner_id.address[0].street or removeParentNode('para') ]]</para>
|
||||
<para style="P15">[[ voucher.partner_id.address and voucher.partner_id.address[0] and voucher.partner_id.address[0].street2 or removeParentNode('para') ]]</para>
|
||||
<para style="P15">[[ get_zip_line(voucher.partner_id.address) ]] </para>
|
||||
<para style="P15">[[ voucher.partner_id.address[0].country_id.name]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="25.0,500" rowHeights="30.5" style="Table12">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<!--para style="P15">[[ voucher.name ]]</para-->
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="568.0" style="Table3">
|
||||
<tr>
|
||||
<td>
|
||||
<blockTable colWidths="436.0,76.0,20.0" style="Table7">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P16"></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P14"></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P14"></para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P16">[[voucher.partner_id.name]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P16">[[ formatLang(voucher.date , date=True) or '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P14">[[ voucher.journal_id.use_preprint_check and voucher.chk_seq or '' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="82.0,185.0,89.0,76.0,52.0,78.0" style="Table8">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P4">Due Date</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">Description</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">Original Amount</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">Balance Due</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">Discount</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">Payment</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P19">[[ repeatIn(get_lines(voucher.line_dr_ids),'l') ]] [[ formatLang(l['date_original'] ,date=True) or '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P19">[[ l['name'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P19">[[ formatLang (l['amount_original']) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P19">[[ formatLang (l['amount_due']) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P19">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P19">[[ formatLang (l['amount']) ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="485.0,77.0" style="Table9">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P24">Check Amount</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P23">[[ formatLang (voucher.amount) ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="P2">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</story>
|
||||
</document>
|
|
@ -0,0 +1,338 @@
|
|||
<?xml version="1.0"?>
|
||||
<document filename="test.pdf">
|
||||
<template pageSize="(595, 842)" title="Test" author="Martin Simon" allowSplitting="20">
|
||||
<pageTemplate id="first">
|
||||
<frame id="first" x1="13.0" y1="0.0" width="567" height="841"/>
|
||||
</pageTemplate>
|
||||
</template>
|
||||
<stylesheet>
|
||||
<blockTableStyle id="Standard_Outline">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table1">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table4">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table5">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table12">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table2">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table6">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table10">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table11">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table3">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table7">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table8">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table9">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<initialize>
|
||||
<paraStyle name="all" alignment="justify"/>
|
||||
</initialize>
|
||||
<paraStyle name="P1" rightIndent="-1.0" leftIndent="0.0" fontName="Helvetica"/>
|
||||
<paraStyle name="P2" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica"/>
|
||||
<paraStyle name="P3" fontName="Helvetica"/>
|
||||
<paraStyle name="P4" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT"/>
|
||||
<paraStyle name="P5" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="RIGHT"/>
|
||||
<paraStyle name="P6" fontName="Helvetica-Bold" fontSize="9.0" leading="11"/>
|
||||
<paraStyle name="P7" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT"/>
|
||||
<paraStyle name="P8" fontName="Helvetica" fontSize="9.0" leading="11"/>
|
||||
<paraStyle name="P9" fontName="Helvetica" fontSize="10.0" leading="13"/>
|
||||
<paraStyle name="P10" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="RIGHT"/>
|
||||
<paraStyle name="P11" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="LEFT"/>
|
||||
<paraStyle name="P12" fontName="Helvetica" fontSize="12.0" leading="15"/>
|
||||
<paraStyle name="P13" fontName="Helvetica"/>
|
||||
<paraStyle name="P14" fontName="Helvetica" fontSize="10.0" leading="13"/>
|
||||
<paraStyle name="P15" fontName="Helvetica" fontSize="10.0" leading="13"/>
|
||||
<paraStyle name="P16" fontName="Helvetica-Bold" fontSize="9.0" leading="11"/>
|
||||
<paraStyle name="P17" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT"/>
|
||||
<paraStyle name="P18" fontName="Helvetica" fontSize="9.0" leading="11"/>
|
||||
<paraStyle name="P19" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT"/>
|
||||
<paraStyle name="P20" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT"/>
|
||||
<paraStyle name="P21" fontName="Helvetica" fontSize="8.0" leading="10"/>
|
||||
<paraStyle name="P22" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT"/>
|
||||
<paraStyle name="P23" fontName="Helvetica-Bold" fontSize="8.0" leading="10"/>
|
||||
<paraStyle name="P24" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT"/>
|
||||
<paraStyle name="Standard" fontName="Helvetica"/>
|
||||
<paraStyle name="Heading" fontName="Helvetica" fontSize="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Caption" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Index" fontName="Helvetica"/>
|
||||
<paraStyle name="Table Contents" fontName="Helvetica"/>
|
||||
<paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER"/>
|
||||
<images/>
|
||||
</stylesheet>
|
||||
<story>
|
||||
<para style="P1">[[repeatIn(objects,'voucher')]]</para>
|
||||
<blockTable colWidths="568.0" style="Table1">
|
||||
<tr>
|
||||
<td>
|
||||
<blockTable colWidths="425.0,177.0" rowHeights="107.50,25.5" style="Table4">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P6">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P6">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P6">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P9">[[ formatLang(voucher.date , date=True) or '' ]] [[ voucher.journal_id.use_preprint_check and voucher.chk_seq or '' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="54.0,425.0,85.0" rowHeights="21.5" style="Table4">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P6">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P9">[[ voucher.partner_id.name ]] </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P12">[[ formatLang (voucher.amount) ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="550.0" rowHeights="18" style="Table5">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P9">[[ fill_stars(voucher.amount_in_word) ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="54.0,425.0,85.0" rowHeights="45.5" style="Table4">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P6"></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P9">[[ voucher.partner_id.name ]] </para>
|
||||
<para style="P15">[[ voucher.partner_id.address and voucher.partner_id.address[0] and voucher.partner_id.address[0].street2 or removeParentNode('para') ]]</para>
|
||||
<para style="P15">[[ get_zip_line(voucher.partner_id.address[0]) ]] </para>
|
||||
<para style="P15">[[ voucher.partner_id.address[0].country_id.name]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para/>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="25.0,350,150" rowHeights="10.5" style="Table12">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P15">[[ voucher.name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="568.0" style="Table2" rowHeights="255">
|
||||
<tr>
|
||||
<td>
|
||||
<blockTable colWidths="445.0,117.0" style="Table6">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P16">[[voucher.partner_id.name]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P16">[[ formatLang(voucher.date , date=True) or '' ]] [[ voucher.journal_id.use_preprint_check and voucher.chk_seq or '' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="82.0,185.0,89.0,76.0,52.0,78.0" style="Table10">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P4">Due Date</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">Description</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">Original Amount</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">Open Balance</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">Discount</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">Payment</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P19">[[ repeatIn(get_lines(voucher.line_dr_ids),'l') ]] [[ formatLang(l['date_due'] ,date=True) or '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P19">[[ l['name'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P19">[[formatLang( l['amount_original']) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P19">[[ formatLang( l['amount_unreconciled']) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P19">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P19">[[ formatLang (l['amount']) ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="485.0,77.0" style="Table11">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P24">Check Amount</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P23">[[ formatLang (voucher.amount) ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="568.0" style="Table3">
|
||||
<tr>
|
||||
<td>
|
||||
<blockTable colWidths="446.0,116.0" style="Table7">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P16">[[voucher.partner_id.name]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P16">[[ formatLang(voucher.date , date=True) or '' ]] [[ voucher.journal_id.use_preprint_check and voucher.chk_seq or '' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="82.0,185.0,89.0,76.0,52.0,78.0" style="Table8">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P4">Due Date</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">Description</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">Original Amount</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">Open Balance</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">Discount</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">Payment</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P19">[[ repeatIn(get_lines(voucher.line_dr_ids),'l') ]] [[ formatLang(l['date_due'] ,date=True) or '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P19">[[ l['name'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P19">[[ formatLang (l['amount_original']) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P19">[[ formatLang (l['amount_unreconciled']) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P19">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P19">[[ formatLang (l['amount']) ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="485.0,77.0" style="Table9">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P17">Check Amount</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P16">[[ formatLang (voucher.amount) ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="P2">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</story>
|
||||
</document>
|
|
@ -51,10 +51,14 @@ class account_voucher(osv.osv):
|
|||
periods = self.pool.get('account.period').find(cr, uid)
|
||||
return periods and periods[0] or False
|
||||
|
||||
def _make_journal_search(self, cr, uid, ttype, context=None):
|
||||
journal_pool = self.pool.get('account.journal')
|
||||
return journal_pool.search(cr, uid, [('type', '=', ttype)], limit=1)
|
||||
|
||||
def _get_journal(self, cr, uid, context=None):
|
||||
if context is None: context = {}
|
||||
journal_pool = self.pool.get('account.journal')
|
||||
invoice_pool = self.pool.get('account.invoice')
|
||||
journal_pool = self.pool.get('account.journal')
|
||||
if context.get('invoice_id', False):
|
||||
currency_id = invoice_pool.browse(cr, uid, context['invoice_id'], context=context).currency_id.id
|
||||
journal_id = journal_pool.search(cr, uid, [('currency', '=', currency_id)], limit=1)
|
||||
|
@ -67,7 +71,7 @@ class account_voucher(osv.osv):
|
|||
ttype = context.get('type', 'bank')
|
||||
if ttype in ('payment', 'receipt'):
|
||||
ttype = 'bank'
|
||||
res = journal_pool.search(cr, uid, [('type', '=', ttype)], limit=1)
|
||||
res = self._make_journal_search(cr, uid, ttype, context=context)
|
||||
return res and res[0] or False
|
||||
|
||||
def _get_tax(self, cr, uid, context=None):
|
||||
|
|
Loading…
Reference in New Issue