bzr revid: solanki.priyesh@gmail.com-20081107063421-rzxx6fzyodmryum6
This commit is contained in:
Priyesh 2008-11-07 12:04:21 +05:30
commit 9466a80681
931 changed files with 41758 additions and 32704 deletions

View File

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>pso-newaddons</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.python.pydev.PyDevBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.python.pydev.pythonNature</nature>
</natures>
</projectDescription>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?eclipse-pydev version="1.0"?>
<pydev_project>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.4</pydev_property>
</pydev_project>

View File

@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# $Id$
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

View File

@ -1,31 +1,24 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 Tiny SPRL (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# $Id$
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
###############################################################################
##############################################################################
{
"name" : "Accounting and financial management",
"version" : "1.0",
@ -50,9 +43,9 @@
"account_unit_test.xml",
],
"update_xml" : [
"account_menuitem.xml",
"security/account_security.xml",
"security/ir.model.access.csv",
"account_menuitem.xml",
"account_wizard.xml",
"account_view.xml",
"account_end_fy.xml",

View File

@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# $Id$
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import time
@ -42,7 +34,7 @@ class account_payment_term(osv.osv):
_name = "account.payment.term"
_description = "Payment Term"
_columns = {
'name': fields.char('Payment Term', size=32, translate=True),
'name': fields.char('Payment Term', size=32, translate=True, required=True),
'active': fields.boolean('Active'),
'note': fields.text('Description', translate=True),
'line_ids': fields.one2many('account.payment.term.line', 'payment_id', 'Terms'),
@ -86,7 +78,7 @@ class account_payment_term_line(osv.osv):
'value': fields.selection([('procent','Percent'),('balance','Balance'),('fixed','Fixed Amount')], 'Value',required=True),
'value_amount': fields.float('Value Amount'),
'days': fields.integer('Number of Days',required=True, help="Number of days to add before computation of the day of month."),
'days2': fields.integer('Day of the Month',required=True, help="Day of the month, set -1 for the last day of the current month. If it's positive, it gives the day of the next month."),
'days2': fields.integer('Day of the Month',required=True, help="Day of the month, set -1 for the last day of the current month. If it's positive, it gives the day of the next month. Set 0 for net days (otherwise it's based on the end of the month)."),
'payment_id': fields.many2one('account.payment.term','Payment Term', required=True, select=True),
}
_defaults = {
@ -281,7 +273,18 @@ class account_account(osv.osv):
'parent_left': fields.integer('Parent Left', select=1),
'parent_right': fields.integer('Parent Right', select=1),
'check_history': fields.boolean('Display History', help="Check this box if you want to print all entries when printing the General Ledger, otherwise it will only print its balance.")
'currency_mode': fields.selection([('current','At Date'),('average','Average Rate')], 'Outgoing Currencies Rate',
help=
'This will select how is computed the current currency rate for outgoing transactions. '\
'In most countries the legal method is "average" but only a few softwares are able to '\
'manage this. So if you import from another software, you may have to use the rate at date. ' \
'Incoming transactions, always use the rate at date.', \
required=True),
'check_history': fields.boolean('Display History',
help="Check this box if you want to print all entries when printing the General Ledger, "\
"otherwise it will only print its balance."),
'merge_invoice': fields.boolean('Merge Invoice Entries',help="Check this box if you want that all lines of "\
"a customer or supplier invoice using this account are created in one line only"),
}
def _default_company(self, cr, uid, context={}):
@ -296,6 +299,7 @@ class account_account(osv.osv):
'company_id': _default_company,
'active': lambda *a: True,
'check_history': lambda *a: True,
'currency_mode': lambda *a: 'current'
}
def _check_recursion(self, cr, uid, ids):
@ -446,7 +450,9 @@ class account_journal(osv.osv):
'groups_id': fields.many2many('res.groups', 'account_journal_group_rel', 'journal_id', 'group_id', 'Groups'),
'currency': fields.many2one('res.currency', 'Currency', help='The currency used to enter statement'),
'entry_posted': fields.boolean('Skip \'Draft\' State for Created Entries', help='Check this box if you don\'t want that new account moves pass through the \'draft\' state and goes direclty to the \'posted state\' without any manual validation.'),
'company_id': fields.related('default_credit_account_id','company_id',type='many2one', relation="res.company", string="Company"),
}
_defaults = {
'active': lambda *a: 1,
'user_id': lambda self,cr,uid,context: uid,
@ -552,6 +558,17 @@ class account_period(osv.osv):
if not ids:
raise osv.except_osv(_('Error !'), _('No period defined for this date !\nPlease create a fiscal year.'))
return ids
def action_draft(self, cr, uid, ids, *args):
users_roles = self.pool.get('res.users').browse(cr, uid, uid).roles_id
for role in users_roles:
if role.name=='Period':
mode = 'draft'
for id in ids:
cr.execute('update account_journal_period set state=%s where period_id=%d', (mode, id))
cr.execute('update account_period set state=%s where id=%d', (mode, id))
return True
account_period()
class account_journal_period(osv.osv):
@ -631,7 +648,7 @@ class account_move(osv.osv):
data_move = self.pool.get('account.move').browse(cursor,user,ids)
for move in data_move:
if move.state=='draft':
name = '*' + move.name
name = '*' + str(move.id)
else:
name = move.name
res.append((move.id, name))
@ -644,18 +661,41 @@ class account_move(osv.osv):
return periods[0]
else:
return False
def _amount_compute(self, cr, uid, ids, name, args, context, where =''):
if not ids: return {}
cr.execute('select move_id,sum(debit) from account_move_line where move_id in ('+','.join(map(str,ids))+') group by move_id')
result = dict(cr.fetchall())
for id in ids:
result.setdefault(id, 0.0)
return result
_columns = {
'name': fields.char('Entry Name', size=64, required=True),
'name': fields.char('Entry Number', size=64, required=True),
'ref': fields.char('Ref', size=64),
'period_id': fields.many2one('account.period', 'Period', required=True, states={'posted':[('readonly',True)]}),
'journal_id': fields.many2one('account.journal', 'Journal', required=True, states={'posted':[('readonly',True)]}),
'state': fields.selection([('draft','Draft'), ('posted','Posted')], 'Status', required=True, readonly=True),
'line_id': fields.one2many('account.move.line', 'move_id', 'Entries', states={'posted':[('readonly',True)]}),
'to_check': fields.boolean('To Be Verified'),
'partner_id': fields.related('line_id', 'partner_id', type="many2one", relation="res.partner", string="Partner", store=True),
'amount': fields.function(_amount_compute, method=True, string='Amount', digits=(16,2), store=True),
'type': fields.selection([
('pay_voucher','Cash Payment'),
('bank_pay_voucher','Bank Payment'),
('rec_voucher','Cash Receipt'),
('bank_rec_voucher','Bank Receipt'),
('cont_voucher','Contra'),
('journal_sale_vou','Journal Sale'),
('journal_pur_voucher','Journal Purchase'),
('journal_voucher','Journal Voucher'),
],'Type', readonly=True, select=True, states={'draft':[('readonly',False)]}),
}
_defaults = {
'name': lambda *a: '/',
'state': lambda *a: 'draft',
'period_id': _get_period,
'type' : lambda *a : 'journal_voucher',
}
def _check_centralisation(self, cursor, user, ids):
@ -688,6 +728,17 @@ class account_move(osv.osv):
]
def post(self, cr, uid, ids, context=None):
if self.validate(cr, uid, ids, context) and len(ids):
for move in self.browse(cr, uid, ids):
if move.name =='/':
new_name = False
journal = move.journal_id
if journal.sequence_id:
new_name = self.pool.get('ir.sequence').get_id(cr, uid, journal.sequence_id.id)
else:
raise osv.except_osv(_('Error'), _('No sequence defined in the journal !'))
if new_name:
self.write(cr, uid, [move.id], {'name':new_name})
cr.execute('update account_move set state=%s where id in ('+','.join(map(str,ids))+')', ('posted',))
else:
raise osv.except_osv(_('Integrity Error !'), _('You can not validate a non balanced entry !'))
@ -733,12 +784,6 @@ class account_move(osv.osv):
l[2]['period_id'] = default_period
context['period_id'] = default_period
if not 'name' in vals:
journal = self.pool.get('account.journal').browse(cr, uid, context.get('journal_id', vals.get('journal_id', False)))
if journal.sequence_id:
vals['name'] = self.pool.get('ir.sequence').get_id(cr, uid, journal.sequence_id.id)
else:
raise osv.except_osv(_('Error'), _('No sequence defined in the journal !'))
accnt_journal = self.pool.get('account.journal').browse(cr, uid, vals['journal_id'])
if 'line_id' in vals:
c = context.copy()
@ -749,6 +794,13 @@ class account_move(osv.osv):
result = super(account_move, self).create(cr, uid, vals, context)
return result
def copy(self, cr, uid, id, default=None, context=None):
if default is None:
default = {}
default = default.copy()
default.update({'state':'draft', 'name':'/',})
return super(account_move, self).copy(cr, uid, id, default, context)
def unlink(self, cr, uid, ids, context={}, check=True):
toremove = []
for move in self.browse(cr, uid, ids, context):
@ -1032,9 +1084,10 @@ class account_tax_code(osv.osv):
_name = 'account.tax.code'
_description = 'Tax Code'
_rec_name = 'code'
_columns = {
'name': fields.char('Tax Case Name', size=64, required=True),
'code': fields.char('Case Code', size=16),
'code': fields.char('Case Code', size=64),
'info': fields.text('Description'),
'sum': fields.function(_sum, method=True, string="Year Sum"),
'sum_period': fields.function(_sum_period, method=True, string="Period Sum"),
@ -1543,7 +1596,6 @@ class account_config_wizard(osv.osv_memory):
'date1': lambda *a: time.strftime('%Y-01-01'),
'date2': lambda *a: time.strftime('%Y-12-31'),
'period':lambda *a:'month',
'charts': lambda *a: -1,
}
def action_cancel(self,cr,uid,ids,conect=None):
return {
@ -1681,9 +1733,10 @@ class account_tax_code_template(osv.osv):
_name = 'account.tax.code.template'
_description = 'Tax Code Template'
_order = 'code'
_rec_name = 'code'
_columns = {
'name': fields.char('Tax Case Name', size=64, required=True),
'code': fields.char('Case Code', size=16),
'code': fields.char('Case Code', size=64),
'info': fields.text('Description'),
'parent_id': fields.many2one('account.tax.code.template', 'Parent Code', select=True),
'child_ids': fields.one2many('account.tax.code.template', 'parent_id', 'Childs Codes'),
@ -1838,8 +1891,14 @@ class wizard_multi_charts_accounts(osv.osv_memory):
'code_digits':fields.integer('# of Digits',required=True,help="No. of Digits to use for account code"),
}
def _get_chart(self, cr, uid, context={}):
ids = self.pool.get('account.chart.template').search(cr, uid, [], context=context)
if ids:
return ids[0]
return False
_defaults = {
'company_id': lambda self, cr, uid, c: self.pool.get('res.users').browse(cr,uid,[uid],c)[0].company_id.id,
'chart_template_id': _get_chart,
'code_digits': lambda *a:6,
}
@ -1916,6 +1975,7 @@ class wizard_multi_charts_accounts(osv.osv_memory):
self.pool._init = True
children_acc_template = obj_acc_template.search(cr, uid, [('parent_id','child_of',[obj_acc_root.id])])
children_acc_template.sort()
for account_template in obj_acc_template.browse(cr, uid, children_acc_template):
tax_ids = []
for tax in account_template.tax_ids:
@ -1927,7 +1987,6 @@ class wizard_multi_charts_accounts(osv.osv_memory):
code_acc = account_template.code
if code_main<=dig and account_template.type != 'view':
code_acc=str(code_acc) + (str('0'*(dig-code_main)))
vals={
'name': (obj_acc_root.id == account_template.id) and obj_multi.company_id.name or account_template.name,
#'sign': account_template.sign,
@ -1944,7 +2003,6 @@ class wizard_multi_charts_accounts(osv.osv_memory):
}
new_account = obj_acc.create(cr,uid,vals)
acc_template_ref[account_template.id] = new_account
#reactivate the parent_store functionnality on account_account
self.pool._init = False
self.pool.get('account.account')._parent_store_compute(cr)

View File

@ -1,31 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# $Id$
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

View File

@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# $Id$
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import time
@ -191,8 +183,14 @@ class account_bank_statement(osv.osv):
continue
torec = []
if move.amount >= 0:
account_id = st.journal_id.default_credit_account_id.id
else:
account_id = st.journal_id.default_debit_account_id.id
acc_cur = ((move.amount<=0) and st.journal_id.default_debit_account_id) or move.account_id
amount = res_currency_obj.compute(cr, uid, st.currency.id,
company_currency_id, move.amount, context=context)
company_currency_id, move.amount, context=context,
account=acc_cur)
if move.reconcile_id and move.reconcile_id.line_new_ids:
for newline in move.reconcile_id.line_new_ids:
amount += newline.amount
@ -213,7 +211,8 @@ class account_bank_statement(osv.osv):
}
amount = res_currency_obj.compute(cr, uid, st.currency.id,
company_currency_id, move.amount, context=context)
company_currency_id, move.amount, context=context,
account=acc_cur)
if move.account_id and move.account_id.currency_id:
val['currency_id'] = move.account_id.currency_id.id
@ -221,7 +220,8 @@ class account_bank_statement(osv.osv):
amount_cur = move.amount
else:
amount_cur = res_currency_obj.compute(cr, uid, company_currency_id,
move.account_id.currency_id.id, amount, context=context)
move.account_id.currency_id.id, amount, context=context,
account=acc_cur)
val['amount_currency'] = amount_cur
torec.append(account_move_line_obj.create(cr, uid, val , context=context))
@ -242,11 +242,6 @@ class account_bank_statement(osv.osv):
'period_id': st.period_id.id,
}, context=context)
if amount >= 0:
account_id = st.journal_id.default_credit_account_id.id
else:
account_id = st.journal_id.default_debit_account_id.id
# Fill the secondary amount/currency
# if currency is not the same than the company
amount_currency = False
@ -370,10 +365,16 @@ class account_bank_statement_reconcile(osv.osv):
context=context).company_id.currency_id.id
currency_id = context.get('currency_id', company_currency_id)
acc_cur = None
if context.get('journal_id', False) and context.get('account_id',False):
st =self.pool.get('account.journal').browse(cursor, user, context['journal_id'])
acc = self.pool.get('account.account').browse(cursor, user, context['account_id'])
acc_cur = (( context.get('amount',0.0)<=0) and st.default_debit_account_id) or acc
for reconcile_id in ids:
res[reconcile_id] = res_currency_obj.compute(cursor, user,
currency_id, company_currency_id,
context.get('amount', 0.0), context=context)
context.get('amount', 0.0), context=context, account=acc_cur)
return res
def _default_amount(self, cursor, user, context=None):
@ -386,9 +387,15 @@ class account_bank_statement_reconcile(osv.osv):
context=context).company_id.currency_id.id
currency_id = context.get('currency_id', company_currency_id)
acc_cur = None
if context.get('journal_id', False) and context.get('account_id',False):
st =self.pool.get('account.journal').browse(cursor, user, context['journal_id'])
acc = self.pool.get('account.account').browse(cursor, user, context['account_id'])
acc_cur = (( context.get('amount',0.0)<=0) and st.default_debit_account_id) or acc
return res_currency_obj.compute(cursor, user,
currency_id, company_currency_id,
context.get('amount', 0.0), context=context)
context.get('amount', 0.0), context=context, account=acc_cur)
def _total_currency(self, cursor, user, ids, name, attrs, context=None):
res = {}
@ -423,25 +430,11 @@ class account_bank_statement_reconcile(osv.osv):
def name_get(self, cursor, user, ids, context=None):
res= []
res_currency_obj = self.pool.get('res.currency')
res_users_obj = self.pool.get('res.users')
company_currency_id = res_users_obj.browse(cursor, user, user,
context=context).company_id.currency_id.id
for o in self.browse(cursor, user, ids, context=context):
td = ''
if o.statement_line:
currency_id = o.statement_line[0].statement_id.currency.id
if abs(o.statement_line[0].amount - (o.total_entry - o.total_new))>0.01:
td = 'P '
else:
currency_id = company_currency_id
res.append((o.id, '%s[%.2f-%.2f]' % (td,
res_currency_obj.compute(cursor, user, company_currency_id,
currency_id, o.total_entry, context=context),
res_currency_obj.compute(cursor, user, company_currency_id,
currency_id, o.total_new, context=context))))
if o.total_amount:
td = 'P '
res.append((o.id, '%s[%.2f]' % (td, o.total_amount)))
return res
_columns = {

View File

@ -150,7 +150,7 @@
<field name="check_total" required="2"/>
<field name="currency_id" on_change="onchange_currency_id(currency_id)" select="2"/>
<field colspan="4" default_get="{'check_total': check_total, 'invoice_line': invoice_line, 'address_invoice_id': address_invoice_id, 'partner_id': partner_id, 'price_type': 'price_type' in dir() and price_type or False}" name="invoice_line" nolabel="1">
<tree string="Invoice lines">
<tree string="Invoice lines" editable="top">
<field name="product_id" on_change="product_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, price_unit, parent.address_invoice_id)"/>
<field domain="[('company_id', '=', parent.company_id), ('journal_id', '=', parent.journal_id), ('type', '&lt;&gt;', 'view')]" name="account_id" on_change="onchange_account_id(parent.partner_id,account_id)"/>
<field name="invoice_line_tax_id" view_mode="2"/>
@ -239,6 +239,9 @@
<field name="partner_id" on_change="onchange_partner_id(type,partner_id,date_invoice,payment_term)" select="1"/>
<field domain="[('partner_id','=',partner_id)]" name="address_invoice_id"/>
<field name="currency_id" on_change="onchange_currency_id(currency_id)" select="2"/>
<field name="date_invoice" on_change="onchange_payment_term_date_invoice(payment_term, date_invoice)" select="1"/>
<field name="period_id"/>
<label align="0.0" colspan="2" string="(keep empty to use the current period)"/>
</group>
<notebook colspan="4">
<page string="Invoice">
@ -284,9 +287,6 @@
<field name="origin" select="2"/>
<field colspan="4" domain="[('partner_id','=',partner_id)]" name="address_contact_id"/>
<field name="move_id"/>
<field name="date_invoice" on_change="onchange_payment_term_date_invoice(payment_term, date_invoice)" select="1"/>
<field name="period_id"/>
<label align="0.0" colspan="2" string="(keep empty to use the current period)"/>
<separator colspan="4" string="Additionnal Information"/>
<field colspan="4" name="comment" nolabel="1"/>
</page>

View File

@ -12,10 +12,13 @@
<menuitem id="menu_finance_legal_statement" name="Legal Statements" parent="account.menu_finance" sequence="8"/>
<menuitem id="menu_generic_report" name="Generic Reports" parent="account.menu_finance_legal_statement" sequence="8"/>
<menuitem id="menu_finance_entries" name="Entries Encoding" parent="account.menu_finance" sequence="2"/>
<menuitem id="menu_finance_entries" name="Entries Encoding" parent="account.menu_finance" sequence="2"
groups="group_account_user"/>
<menuitem id="account.menu_finance_recurrent_entries" name="Recurrent Entries" parent="account.menu_finance_entries" sequence="15"/>
<menuitem id="menu_finance_periodical_processing" name="Periodical Processing" parent="account.menu_finance" sequence="3"/>
<menuitem id="menu_finance_periodical_processing" name="Periodical Processing" parent="account.menu_finance"
sequence="3"
groups="group_account_user"/>
<menuitem id="menu_account_end_year_treatments" name="End of Year Treatments" parent="account.menu_finance_periodical_processing" sequence="20"/>
</data>

View File

@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# $Id$
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
@ -145,7 +137,9 @@ class account_move_line(osv.osv):
ref_id = False
move = self.pool.get('account.move').browse(cr, uid, move_id, context)
acc1 = False
for l in move.line_id:
acc1 = l.account_id
partner_id = partner_id or l.partner_id.id
ref_id = ref_id or l.ref
total += (l.debit or 0.0) - (l.credit or 0.0)
@ -175,6 +169,17 @@ class account_move_line(osv.osv):
s = -total
data['debit'] = s>0 and s or 0.0
data['credit'] = s<0 and -s or 0.0
if account.currency_id:
data['currency_id'] = account.currency_id.id
acc = account
if s>0:
acc = acc1
v = self.pool.get('res.currency').compute(cr, uid,
account.company_id.currency_id.id,
data['currency_id'],
s, account=acc, account_invert=True)
data['amount_currency'] = v
return data
def _on_create_write(self, cr, uid, id, context={}):
@ -272,7 +277,7 @@ class account_move_line(osv.osv):
_columns = {
'name': fields.char('Name', size=64, required=True),
'quantity': fields.float('Quantity', digits=(16,2), help="The optionnal quantity expressed by this line, eg: number of product sold. The quantity is not a legal requirement but is very usefull for some reports."),
'quantity': fields.float('Quantity', digits=(16,2), help="The optional quantity expressed by this line, eg: number of product sold. The quantity is not a legal requirement but is very usefull for some reports."),
'debit': fields.float('Debit', digits=(16,2)),
'credit': fields.float('Credit', digits=(16,2)),
'account_id': fields.many2one('account.account', 'Account', required=True, ondelete="cascade", domain=[('type','<>','view'), ('type', '<>', 'closed')], select=2),
@ -325,12 +330,19 @@ class account_move_line(osv.osv):
context=context)
dt = period.date_start
return dt
def _get_currency(self, cr, uid, context={}):
if not context.get('journal_id', False):
return False
cur = self.pool.get('account.journal').browse(cr, uid, context['journal_id']).currency
return cur and cur.id or False
_defaults = {
'blocked': lambda *a: False,
'centralisation': lambda *a: 'normal',
'date': _get_date,
'date_created': lambda *a: time.strftime('%Y-%m-%d'),
'state': lambda *a: 'draft',
'currency_id': _get_currency,
'journal_id': lambda self, cr, uid, c: c.get('journal_id', False),
'period_id': lambda self, cr, uid, c: c.get('period_id', False),
}
@ -368,6 +380,21 @@ class account_move_line(osv.osv):
#TODO: ONCHANGE_ACCOUNT_ID: set account_tax_id
def onchange_currency(self, cr, uid, ids, account_id, amount, currency_id, date=False, journal=False):
if (not currency_id) or (not account_id):
return {}
result = {}
acc =self.pool.get('account.account').browse(cr, uid, account_id)
if (amount>0) and journal:
x = self.pool.get('account.journal').browse(cr, uid, journal).default_credit_account_id
if x: acc = x
v = self.pool.get('res.currency').compute(cr, uid, currency_id,acc.company_id.currency_id.id, amount, account=acc)
result['value'] = {
'debit': v>0 and v or 0.0,
'credit': v<0 and -v or 0.0
}
return result
def onchange_partner_id(self, cr, uid, ids, move_id, partner_id, account_id=None, debit=0, credit=0, date=False, journal=False):
val = {}
val['date_maturity'] = False
@ -603,6 +630,8 @@ class account_move_line(osv.osv):
attrs.append('required="1"')
else:
attrs.append('required="0"')
if field.field in ('amount_currency','currency_id'):
attrs.append('on_change="onchange_currency(account_id,amount_currency,currency_id,date,((\'journal_id\' in context) and context[\'journal_id\']) or {})"')
if field.field == 'partner_id':
attrs.append('on_change="onchange_partner_id(move_id,partner_id,account_id,debit,credit,((\'journal_id\' in context) and context[\'journal_id\']) or {})"')
if field.field in widths:
@ -749,7 +778,9 @@ class account_move_line(osv.osv):
ctx = {}
if 'date' in vals:
ctx['date'] = vals['date']
vals['amount_currency'] = cur_obj.compute(cr, uid, account.company_id.currency_id.id, account.currency_id.id, vals.get('debit', 0.0)-vals.get('credit', 0.0), context=ctx)
vals['amount_currency'] = cur_obj.compute(cr, uid, account.company_id.currency_id.id,
account.currency_id.id, vals.get('debit', 0.0)-vals.get('credit', 0.0),
context=ctx)
if not ok:
raise osv.except_osv(_('Bad account !'), _('You can not use this general account in this journal !'))

View File

@ -2,38 +2,38 @@
<openerp>
<data>
<report auto="False" id="account_general_ledger" menu="False" model="account.account" name="account.general.ledger" rml="account/report/general_ledger.rml" string="General Ledger"/>
<report auto="False" id="account_3rdparty_ledger" menu="False" model="res.partner" name="account.third_party_ledger" rml="account/report/third_party_ledger.rml" string="Partner ledger"/>
<report auto="False" id="account_account_balance" menu="False" model="account.account" name="account.account.balance" rml="account/report/account_balance.rml" string="Account balance"/>
<report auto="False" id="account_3rdparty_account_balance" menu="False" model="account.account" name="account.partner.balance" rml="account/report/partner_balance.rml" string="Partner balance"/>
<report auto="False" id="account_central_journal" model="account.journal.period" name="account.central.journal" rml="account/report/central_journal.rml" string="Print Central Journal"/>
<report auto="False" id="account_general_journal" model="account.journal.period" name="account.general.journal" rml="account/report/general_journal.rml" string="Print General Journal"/>
<report auto="False" id="account_journal" model="account.journal.period" name="account.journal.period.print" rml="account/report/account_journal.rml" string="Print Journal"/>
<report auto="False" id="account_overdue" model="res.partner" name="account.overdue" rml="account/report/overdue.rml" string="Overdue payments"/>
<report auto="False" id="account_3rdparty_ledger" menu="False" model="res.partner" name="account.third_party_ledger" rml="account/report/third_party_ledger.rml" string="Partner Ledger"/>
<report auto="False" id="account_account_balance" menu="False" model="account.account" name="account.account.balance" rml="account/report/account_balance.rml" string="Account Balance"/>
<report auto="False" id="account_3rdparty_account_balance" menu="False" model="account.account" name="account.partner.balance" rml="account/report/partner_balance.rml" string="Partner Balance"/>
<report auto="False" id="account_central_journal" model="account.journal.period" name="account.central.journal" rml="account/report/central_journal.rml" string="Central Journal"/>
<report auto="False" id="account_general_journal" model="account.journal.period" name="account.general.journal" rml="account/report/general_journal.rml" string="General Journal"/>
<report auto="False" id="account_journal" model="account.journal.period" name="account.journal.period.print" rml="account/report/account_journal.rml" string="Journal"/>
<report auto="False" id="account_overdue" model="res.partner" name="account.overdue" rml="account/report/overdue.rml" string="Overdue Payments"/>
<report auto="False" id="account_invoices" model="account.invoice" name="account.invoice" rml="account/report/invoice.rml" string="Invoices" attachment="print-"/>
<report id="account_transfers" model="account.transfer" name="account.transfer" string="Transfers" xml="account/report/transfer.xml" xsl="account/report/transfer.xsl"/>
<report auto="False" id="account_intracom" menu="False" model="account.move.line" name="account.intracom" string="IntraCom"/>
<report id="account_move_line_list" model="account.tax.code" name="account.tax.code.entries" rml="account/report/account_tax_code.rml" string="All Entries"/>
<report auto="False" id="account_vat_declaration" menu="False" model="account.tax.code" name="account.vat.declaration" rml="account/report/tax_report.rml" string="Taxes report"/>
<report auto="False" id="account_vat_declaration" menu="False" model="account.tax.code" name="account.vat.declaration" rml="account/report/tax_report.rml" string="Taxes Report"/>
<menuitem
id="menu_tax_report"
name="Taxes Reports"
parent="account.menu_finance_reporting"/>
<menuitem
id="menu_tax_report"
name="Taxes Reports"
parent="account.menu_finance_reporting"/>
<wizard
id="wizard_vat_declaration"
menu="False"
model="account.tax.code"
name="account.vat.declaration"
string="Print Taxes Report"/>
id="wizard_vat_declaration"
menu="False"
model="account.tax.code"
name="account.vat.declaration"
string="Print Taxes Report"/>
<menuitem
icon="STOCK_PRINT"
action="wizard_vat_declaration"
id="menu_wizard_vat_declaration"
parent="menu_tax_report"
type="wizard"/>
action="wizard_vat_declaration"
id="menu_wizard_vat_declaration"
parent="menu_tax_report"
type="wizard"/>
<record id="action_tax_code_tree" model="ir.actions.act_window">
@ -43,20 +43,20 @@
<field name="view_type">tree</field>
<field name="view_id" ref="view_tax_code_tree"/>
</record>
<menuitem
action="action_tax_code_tree"
id="menu_action_tax_code_tree"
parent="menu_tax_report"
sequence="12"/>
<menuitem
action="action_tax_code_tree"
id="menu_action_tax_code_tree"
parent="menu_tax_report"
sequence="12"/>
<!--
<report id="analytic_journal"
string="Analytic journal"
model="account.analytic.account"
name="account.analytic.journal"
xml="account/report/analytic_journal.rml"
auto="False" />
-->
<report id="analytic_journal"
string="Analytic journal"
model="account.analytic.account"
name="account.analytic.journal"
xml="account/report/analytic_journal.rml"
auto="False" />
-->
</data>
</openerp>

View File

@ -60,6 +60,9 @@
<!--
Period
-->
<record id="res_role_period" model="res.roles">
<field eval="&quot;&quot;&quot;Period&quot;&quot;&quot;" name="name"/>
</record>
<record id="view_account_period_form" model="ir.ui.view">
<field name="name">account.period.form</field>
@ -74,6 +77,7 @@
<field name="fiscalyear_id"/>
<separator colspan="4" string="States"/>
<field name="state" select="1"/>
<button name="action_draft" states="done" string="Set to Draft" type="object"/>
</form>
</field>
</record>
@ -122,9 +126,11 @@
<page string="General Information">
<newline/>
<field name="currency_id" select="2"/>
<field name="active" select="2"/>
<field name="currency_mode" select="2"/>
<field name="reconcile"/>
<field name="active" select="2"/>
<field name="check_history"/>
<field name="merge_invoice" select="2"/>
<newline/>
<newline/>
<field colspan="4" name="tax_ids" domain="[('parent_id','=',False)]"/>
@ -231,6 +237,7 @@
<tree string="Account Journal">
<field name="code"/>
<field name="name"/>
<field name="company_id"/>
</tree>
</field>
</record>
@ -323,7 +330,7 @@
<field name="partner_id" on_change="onchange_partner_id(partner_id, type, parent.currency)"/>
<field domain="[('journal_id','=',parent.journal_id)]" name="account_id"/>
<field name="amount"/>
<field context="{'partner_id': partner_id, 'amount': amount, 'account_id': account_id, 'currency_id': parent.currency}" name="reconcile_id"/>
<field context="{'partner_id': partner_id, 'amount': amount, 'account_id': account_id, 'currency_id': parent.currency, 'journal_id': parent.journal_id}" name="reconcile_id"/>
<field invisible="1" name="reconcile_amount"/>
</tree>
<form string="Statement lines">
@ -333,7 +340,7 @@
<field name="partner_id" on_change="onchange_partner_id(partner_id, type, parent.currency)"/>
<field domain="[('journal_id', '=', parent.journal_id), ('type', '&lt;&gt;', 'view')]" name="account_id"/>
<field name="amount"/>
<field context="{'partner_id':partner_id,'amount':amount,'account_id':account_id}" name="reconcile_id"/>
<field context="{'partner_id':partner_id,'amount':amount,'account_id':account_id,'journal_id':parent.journal_id}" name="reconcile_id"/>
<field name="ref"/>
<separator colspan="4" string="Notes"/>
<field colspan="4" name="note" nolabel="1"/>
@ -460,6 +467,8 @@
<field name="name"/>
<field name="period_id"/>
<field name="journal_id"/>
<field name="partner_id"/>
<field name="amount"/>
<field name="state"/>
</tree>
</field>
@ -605,6 +614,7 @@
<field name="res_model">account.tax</field>
<field name="view_type">form</field>
<field name="view_id" ref="view_tax_tree"/>
<field name="domain">[('parent_id','=',False)]</field>
</record>
<menuitem action="action_tax_form" id="menu_action_tax_form" parent="next_id_27"/>
@ -708,9 +718,9 @@
<field colspan="4" name="analytic_lines" nolabel="1"/>
</page>
<page string="Move Lines">
<field colspan="4" name="reconcile_implicit"/>
<field colspan="4" name="reconcile_implicit"/>
<field colspan="4" name="parent_move_lines" nolabel="0"/>
</page>
</page>
</notebook>
</form>
</field>
@ -750,7 +760,7 @@
<newline/>
<field name="account_tax_id" domain="[('parent_id','=',False)]"/>
<field name="analytic_account_id"/>
<field colspan="4" name="reconcile_implicit"/>
<field colspan="4" name="reconcile_implicit"/>
<separator colspan="4" string="State"/>
<newline/>
<field name="reconcile_id"/>
@ -787,7 +797,8 @@
<field name="name"/>
<field name="period_id"/>
<field name="journal_id"/>
<field name="partner_id"/>
<field name="amount"/>
<field name="line_id"/>
<field name="state"/>
</tree>
@ -801,11 +812,14 @@
<field name="arch" type="xml">
<form string="Account Entry">
<separator colspan="4" string="General Information"/>
<field name="name" select="1"/>
<field name="ref" select="1"/>
<group colspan="4" col="6">
<field name="name" select="1" readonly="True"/>
<field name="period_id" select="2"/>
<field name="journal_id" select="1"/>
<field name="to_check" select="2"/>
<field name="ref" select="1" groups="base.group_extended"/>
<field name="to_check" select="2" groups="base.group_extended"/>
<field name="type" select="1" groups="base.group_extended"/>
</group>
<separator colspan="4" string="Entry Lines"/>
<field colspan="4" name="line_id" nolabel="1" widget="one2many_list" default_get="{'lines':line_id ,'journal':journal_id }">
@ -840,8 +854,8 @@
<field name="account_id"/>
<field name="date_maturity"/>
<field name="ref"/>
<field name="debit"/>
<field name="credit"/>
<field name="debit" sum="Total Debit"/>
<field name="credit" sum="Total Credit"/>
<field name="state"/>
</tree>
</field>
@ -865,7 +879,7 @@
<menuitem id="next_id_29" name="Search Entries" parent="account.menu_finance_accounting"/>
<menuitem action="action_move_line_form" id="menu_action_move_line_form" parent="next_id_29"/>
<record id="action_move_line_form_encode_by_move" model="ir.actions.act_window">
<record id="action_move_line_form_encode_by_move" model="ir.actions.act_window">
<field name="name">Entries Encoding by Move</field>
<field name="res_model">account.move</field>
<field name="view_type">form</field>
@ -963,13 +977,31 @@
<field name="view_mode">form,tree</field>
<field name="view_id" ref="view_bank_statement_reconcile_form"/>
</record>
<menuitem id="next_id_30" name="Bank Reconciliation" parent="account.menu_finance_periodical_processing"/><menuitem action="action_bank_statement_reconciliation_form" id="menu_action_account_bank_reconcile_tree" parent="next_id_30"/>
<menuitem
id="next_id_30"
name="Bank Reconciliation"
parent="account.menu_finance_periodical_processing"
groups="group_account_user"/>
<menuitem action="action_bank_statement_reconciliation_form" id="menu_action_account_bank_reconcile_tree" parent="next_id_30"/>
<wizard id="action_account_bank_reconcile_tree" menu="False" model="account.move.line" name="account.move.bank.reconcile" string="Bank reconciliation"/>
<menuitem action="action_account_bank_reconcile_tree" id="menu_action_account_bank_reconcile_check_tree" parent="account.next_id_30" type="wizard"/>
<act_window domain="[('account_id', '=', active_id)]" id="act_account_acount_move_line_open" name="Entries" res_model="account.move.line" src_model="account.account"/>
<act_window
domain="[('account_id', '=', active_id)]"
id="act_account_acount_move_line_open"
name=""
context="{'account_id': active_id}"
res_model="account.move.line"
src_model="account.account"/>
<act_window domain="[('account_id', '=', active_id),('reconcile_id','=',False)]" id="act_account_acount_move_line_open_unreconciled" name="Unreconciled entries" res_model="account.move.line" src_model="account.account"/>
<act_window
domain="[('account_id', '=', active_id),('reconcile_id','=',False)]"
id="act_account_acount_move_line_open_unreconciled"
name="Unreconciled entries"
res_model="account.move.line"
context="{'account_id': active_id}"
src_model="account.account"/>
<act_window domain="[('reconcile_id', '=', active_id)]" id="act_account_acount_move_line_reconcile_open" name="Reconciled entries" res_model="account.move.line" src_model="account.move.reconcile"/>
@ -1255,7 +1287,7 @@
</record>
<record id="action_move_line_tree1" model="ir.actions.act_window">
<field name="name">Entries</field>
<field name="name" eval="False"/>
<field name="res_model">account.move.line</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
@ -1341,13 +1373,13 @@
<field name="code"/>
<field name="date1"/>
<field name="date2"/>
<field name="period" colspan="4"/>
<separator col="4" colspan="4" string="Select Chart of Accounts"/>
<field name="charts"/>
<field name="period" colspan="4"/>
<separator col="4" colspan="4" string="Select Chart of Accounts"/>
<field name="charts"/>
<separator string="" colspan="4"/>
<label string="" colspan="2"/>
<group col="2" colspan="2">
<button icon="gtk-cancel" special="cancel" string="Don't Continue" name="action_cancel" type="object"/>
<button icon="gtk-cancel" special="cancel" string="Skip" name="action_cancel" type="object"/>
<button icon="gtk-ok" name="action_create" string="Continue" type="object"/>
</group>
</form>
@ -1408,17 +1440,17 @@
</field>
</record>
<record id="view_account_template_tree" model="ir.ui.view">
<field name="name">account.account.template.tree</field>
<field name="model">account.account.template</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Account Template">
<field name="code"/>
<field name="name"/>
</tree>
</field>
</record>
<record id="view_account_template_tree" model="ir.ui.view">
<field name="name">account.account.template.tree</field>
<field name="model">account.account.template</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Account Template">
<field name="code"/>
<field name="name"/>
</tree>
</field>
</record>
<record id="action_account_template_form" model="ir.actions.act_window">
<field name="name">Account Templates</field>
@ -1518,8 +1550,8 @@
<page groups="base.group_extended" string="Special Computation">
<separator colspan="4" string="Compute Code (if type=code)"/>
<field colspan="4" name="python_compute" nolabel="1" attrs="{'readonly':[('type','!=','code')]}"/>
<separator colspan="4" string="Compute Code for Taxes included prices"/>
<field colspan="4" name="python_compute_inv" nolabel="1"/>
<separator colspan="4" string="Compute Code for Taxes included prices"/>
<field colspan="4" name="python_compute_inv" nolabel="1"/>
<separator colspan="4" string="Applicable Code (if type=code)"/>
<field colspan="4" name="python_applicable" nolabel="1" attrs="{'readonly':[('applicable_type','=','true')]}"/>
</page>
@ -1547,8 +1579,8 @@
<menuitem action="action_account_tax_template_form" id="menu_action_account_tax_template_form" parent="next_id_27" sequence="13"/>
<!-- Account Tax Code Templates -->
<record id="view_tax_code_template_tree" model="ir.ui.view">
<!-- Account Tax Code Templates -->
<record id="view_tax_code_template_tree" model="ir.ui.view">
<field name="name">account.tax.code.template.tree</field>
<field name="model">account.tax.code.template</field>
<field name="type">tree</field>
@ -1586,50 +1618,51 @@
<menuitem action="action_account_tax_code_template_form" id="menu_action_account_tax_code_template_form" parent="next_id_27" sequence="14"/>
<!-- Wizard for Multi Charts of Accounts -->
<!-- Wizard for Multi Charts of Accounts -->
<record id="view_wizard_multi_chart" model="ir.ui.view">
<field name="name">Generate Chart of Accounts from a Chart Template</field>
<field name="model">wizard.multi.charts.accounts</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Generate Chart of Accounts from a Chart Template">
<separator col="4" colspan="4" string="Generate Chart of Accounts from a Chart Template"/>
<field name="company_id" />
<field name="name">Generate Chart of Accounts from a Chart Template</field>
<field name="model">wizard.multi.charts.accounts</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Generate Chart of Accounts from a Chart Template">
<separator col="4" colspan="4" string="Generate Chart of Accounts from a Chart Template"/>
<label align="0.0" string="This will automatically configure your chart of accounts, bank accounts, taxes and journals according to the selected template" colspan="4"/>
<field name="company_id" />
<field name ="code_digits" />
<field name="chart_template_id" colspan="4"/>
<field colspan="4" mode="tree" name="bank_accounts_id" nolabel="1" widget="one2many_list">
<form string="Bank Information">
<field name="acc_no"/>
<field name="currency_id"/>
</form>
<tree editable="bottom" string="Bank Information">
<field name="acc_no"/>
<field name="currency_id"/>
</tree>
</field>
<field name="chart_template_id" colspan="4"/>
<field colspan="4" mode="tree" name="bank_accounts_id" nolabel="1" widget="one2many_list">
<form string="Bank Information">
<field name="acc_no"/>
<field name="currency_id"/>
</form>
<tree editable="bottom" string="Bank Information">
<field name="acc_no"/>
<field name="currency_id"/>
</tree>
</field>
<separator string="" colspan="4"/>
<label string="" colspan="2"/>
<group col="2" colspan="2">
<button icon="gtk-cancel" special="cancel" type="object" name="action_cancel" string="Cancel"/>
<button icon="gtk-ok" name="action_create" string="Create" type="object"/>
</group>
</form>
</field>
</record>
<label string="" colspan="2"/>
<group col="2" colspan="2">
<button icon="gtk-cancel" special="cancel" type="object" name="action_cancel" string="Cancel"/>
<button icon="gtk-ok" name="action_create" string="Create" type="object"/>
</group>
</form>
</field>
</record>
<record id="action_wizard_multi_chart" model="ir.actions.act_window">
<field name="name">Generate Chart of Accounts from a Chart Template</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">wizard.multi.charts.accounts</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
<record id="action_wizard_multi_chart" model="ir.actions.act_window">
<field name="name">Generate Chart of Accounts from a Chart Template</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">wizard.multi.charts.accounts</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
<menuitem parent="account.account_account_menu" action="action_wizard_multi_chart" id="menu_wizard"/>
<menuitem parent="account.account_account_menu" action="action_wizard_multi_chart" id="menu_wizard"/>
<record id="account_account_graph" model="ir.ui.view">
<record id="account_account_graph" model="ir.ui.view">
<field name="name">account.account.graph</field>
<field name="model">account.account</field>
<field name="type">graph</field>

View File

@ -76,16 +76,26 @@
<wizard string="Create Entries From Models" model="account.model" name="account_use_models" menu="False" id="wizard_account_use_model"/>
<menuitem action="wizard_account_use_model" type="wizard" parent="account.menu_finance_recurrent_entries" id="menu_account_use_model"/>
<wizard string="Create Entries From Models" model="account.move.line" name="account_use_models" menu="True" id="wizard_line_account_use_model"/>
<!-- account.invoice -->
<wizard string="Open State" model="account.invoice" name="account.wizard_paid_open" menu="False" id="wizard_paid_open"/>
<!-- generic report wizard -->
<wizard id="wizard_account_balance_report" menu="False" model="account.account" name="account.account.balance.report" string="Account balance"/>
<wizard id="wizard_account_balance_report" menu="False" model="account.account" name="account.account.balance.report" string="Account Balance"/>
<menuitem icon="STOCK_PRINT" action="wizard_account_balance_report" id="menu_account_balance_report" parent="account.menu_generic_report" type="wizard"/>
<wizard id="wizard_general_ledger" menu="False" model="account.account" name="account.general.ledger.report" string="General ledger"/>
<wizard id="wizard_general_ledger" menu="False" model="account.account" name="account.general.ledger.report" string="General Ledger"/>
<menuitem icon="STOCK_PRINT" action="wizard_general_ledger" id="menu_general_ledger" parent="account.menu_generic_report" type="wizard"/>
<wizard id="wizard_print_journal" menu="False" model="account.journal.period" name="account.print.journal.report" string="Print Journal" />
<menuitem icon="STOCK_PRINT" action="wizard_print_journal" id="menu_print_journal" parent="account.menu_generic_report" type="wizard" />
<wizard id="wizard_central_journal" menu="False" model="account.journal.period" name="account.central.journal.report" string="Print Central journal" />
<menuitem icon="STOCK_PRINT" action="wizard_central_journal" id="menu_central_journal" parent="account.menu_generic_report" type="wizard" />
<wizard id="wizard_general_journal" menu="False" model="account.journal.period" name="account.general.journal.report" string="Print General journal" />
<menuitem icon="STOCK_PRINT" action="wizard_general_journal" id="menu_general_journal" parent="account.menu_generic_report" type="wizard" />
</data>
</openerp>

View File

@ -142,6 +142,18 @@
<field eval="True" name="required"/>
<field eval="6" name="sequence"/>
</record>
<record id="bank_col17_multi" model="account.journal.column">
<field name="view_id" ref="account_journal_bank_view_multi"/>
<field name="name">Currency Amt.</field>
<field name="field">amount_currency</field>
<field eval="8" name="sequence"/>
</record>
<record id="bank_col18_multi" model="account.journal.column">
<field name="view_id" ref="account_journal_bank_view_multi"/>
<field name="name">Currency</field>
<field name="field">currency_id</field>
<field eval="9" name="sequence"/>
</record>
<record id="bank_col9_multi" model="account.journal.column">
<field name="view_id" ref="account_journal_bank_view_multi"/>
<field name="name">Debit</field>
@ -154,30 +166,6 @@
<field name="field">credit</field>
<field eval="11" name="sequence"/>
</record>
<record id="bank_col11_multi" model="account.journal.column">
<field name="view_id" ref="account_journal_bank_view_multi"/>
<field name="name">Tax</field>
<field name="field">account_tax_id</field>
<field eval="12" name="sequence"/>
</record>
<record id="bank_col12_multi" model="account.journal.column">
<field name="view_id" ref="account_journal_bank_view_multi"/>
<field name="name">Analytic Account</field>
<field name="field">analytic_account_id</field>
<field eval="13" name="sequence"/>
</record>
<record id="bank_col17_multi" model="account.journal.column">
<field name="view_id" ref="account_journal_bank_view_multi"/>
<field name="name">Currency Amt.</field>
<field name="field">amount_currency</field>
<field eval="14" name="sequence"/>
</record>
<record id="bank_col18_multi" model="account.journal.column">
<field name="view_id" ref="account_journal_bank_view_multi"/>
<field name="name">Currency</field>
<field name="field">currency_id</field>
<field eval="15" name="sequence"/>
</record>
<record id="bank_col3_multi" model="account.journal.column">
<field name="view_id" ref="account_journal_bank_view_multi"/>
<field name="name">Ref</field>
@ -298,6 +286,16 @@
<field name="code">account.journal</field>
<field name="prefix"/>
</record>
<record id="sequence_sale_journal" model="ir.sequence">
<field name="name">Sale Journal</field>
<field name="code">account.journal</field>
<field name="prefix"/>
</record>
<record id="sequence_purchase_journal" model="ir.sequence">
<field name="name">Purchase Journal</field>
<field name="code">account.journal</field>
<field name="prefix"/>
</record>
<!--
Account Statement Sequences

View File

@ -162,28 +162,28 @@ your own chart of account.
-->
<record id="sales_journal" model="account.journal">
<field name="name">Sales Journal</field>
<field name="name">x Sales Journal</field>
<field name="code">SAJ</field>
<field name="type">sale</field>
<field name="view_id" ref="account_journal_view"/>
<field name="sequence_id" ref="sequence_journal"/>
<field name="sequence_id" ref="sequence_sale_journal"/>
<field model="account.account" name="default_credit_account_id" search="[('type','=','receivable')]"/>
<field model="account.account" name="default_debit_account_id" search="[('type','=','receivable')]"/>
<field name="user_id" ref="base.user_root"/>
</record>
<record id="expenses_journal" model="account.journal">
<field name="name">Expenses Journal</field>
<field name="name">x Expenses Journal</field>
<field name="code">EXJ</field>
<field name="type">purchase</field>
<field name="view_id" ref="account_journal_view"/>
<field name="sequence_id" ref="sequence_journal"/>
<field name="sequence_id" ref="sequence_purchase_journal"/>
<field model="account.account" name="default_debit_account_id" search="[('type','=','payable')]"/>
<field model="account.account" name="default_credit_account_id" search="[('type','=','payable')]"/>
<field name="user_id" ref="base.user_root"/>
</record>
<record id="bank_journal" model="account.journal">
<field name="name">Bank Journal</field>
<field name="name">x Bank Journal</field>
<field name="code">BNK</field>
<field name="type">cash</field>
<field name="view_id" ref="account_journal_bank_view"/>

File diff suppressed because it is too large Load Diff

View File

@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# $Id$
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
@ -79,8 +71,7 @@ class account_invoice(osv.osv):
def _get_journal_analytic(self, cr, uid, type_inv, context={}):
type2journal = {'out_invoice': 'sale', 'in_invoice': 'purchase', 'out_refund': 'sale', 'in_refund': 'purchase'}
tt = type2journal.get(type_inv, 'sale')
cr.execute("select id from account_analytic_journal where type=%s limit 1", (tt,))
result = cr.fetchone()
result = self.pool.get('account.analytic.journal').search(cr, uid, [('type','=',tt)], context=context)
if not result:
raise osv.except_osv(_('No Analytic Journal !'),("You have to define an analytic journal of type '%s' !") % (tt,))
return result[0]
@ -194,12 +185,13 @@ class account_invoice(osv.osv):
'journal_id': fields.many2one('account.journal', 'Journal', required=True,readonly=True, states={'draft':[('readonly',False)]}),
'company_id': fields.many2one('res.company', 'Company', required=True),
'check_total': fields.float('Total', digits=(16,2), states={'open':[('readonly',True)],'close':[('readonly',True)]}),
'reconciled': fields.function(_reconciled, method=True, string='Paid/Reconciled', type='boolean', help="The account moves of the invoice have been reconciled with account moves of the payment(s)."),
'reconciled': fields.function(_reconciled, method=True, string='Paid/Reconciled', type='boolean', store=True, help="The account moves of the invoice have been reconciled with account moves of the payment(s)."),
'partner_bank': fields.many2one('res.partner.bank', 'Bank Account',
help='The bank account to pay to or to be paid from'),
'move_lines':fields.function(_get_lines , method=True,type='many2many' , relation='account.move.line',string='Move Lines'),
'residual': fields.function(_amount_residual, method=True, digits=(16,2),string='Residual', store=True, help="Remaining amount due."),
'payment_ids': fields.function(_compute_lines, method=True, relation='account.move.line', type="many2many", string='Payments'),
'move_name': fields.char('Account Move', size=64),
}
_defaults = {
'type': _get_type,
@ -287,7 +279,7 @@ class account_invoice(osv.osv):
pt_obj= self.pool.get('account.payment.term')
if not date_invoice :
date_invoice = self._defaults["date_invoice"](cr,uid,{})
date_invoice = time.strftime('%Y-%m-%d')
pterm_list= pt_obj.compute(cr, uid, payment_term_id, value=1, date_ref=date_invoice)
@ -332,7 +324,7 @@ class account_invoice(osv.osv):
if default is None:
default = {}
default = default.copy()
default.update({'state':'draft', 'number':False, 'move_id':False})
default.update({'state':'draft', 'number':False, 'move_id':False, 'move_name':False,})
if 'date_invoice' not in default:
default['date_invoice'] = False
if 'date_due' not in default:
@ -423,6 +415,7 @@ class account_invoice(osv.osv):
def action_move_create(self, cr, uid, ids, *args):
ait_obj = self.pool.get('account.invoice.tax')
cur_obj = self.pool.get('res.currency')
acc_obj = self.pool.get('account.account')
for inv in self.browse(cr, uid, ids):
if inv.move_id:
continue
@ -469,7 +462,11 @@ class account_invoice(osv.osv):
# create one move line for the total and possibly adjust the other lines amount
total = 0
total_currency = 0
key_line=[]
for i in iml:
if i.has_key('account_id') and i.has_key('taxes'):
if not (i['account_id'],i['taxes']) in key_line:
key_line.append((i['account_id'],i['taxes']))
if inv.currency_id.id != company_currency:
i['currency_id'] = inv.currency_id.id
i['amount_currency'] = i['price']
@ -490,6 +487,36 @@ class account_invoice(osv.osv):
acc_id = inv.account_id.id
name = inv['name'] or '/'
iml_temp=[]
move_list=[]
for item in key_line:
move_temp={}
if acc_obj.browse(cr,uid,item[0]).merge_invoice:
repeat=False
for move_line in iml:
if (move_line.has_key('account_id') and move_line['account_id']==item[0]) and (move_line.has_key('taxes') and move_line['taxes']==item[1]):
move_list.append(move_line)
if repeat:
for key in move_line:
if key in ['name','amount_currency','price_unit','price','quantity']:
if key=='name':
move_temp[key]=move_temp[key] + "," +move_line[key]
else:
move_temp[key] +=move_line[key]
else:
for key in move_line:
move_temp[key]=move_line[key]
repeat=True
if move_temp:
iml_temp.append(move_temp)
if len(iml_temp)<len(move_list):
for old_elem in move_list:
iml.remove(old_elem)
for new_elem in iml_temp:
iml.append(new_elem)
totlines = False
if inv.payment_term:
totlines = self.pool.get('account.payment.term').compute(cr,
@ -542,8 +569,10 @@ class account_invoice(osv.osv):
journal_id = inv.journal_id.id #self._get_journal(cr, uid, {'type': inv['type']})
journal = self.pool.get('account.journal').browse(cr, uid, journal_id)
if journal.sequence_id:
if journal.sequence_id and not inv.move_name:
name = self.pool.get('ir.sequence').get_id(cr, uid, journal.sequence_id.id)
else:
name = inv.move_name
if journal.centralisation:
raise osv.except_osv(_('UserError'),
_('Can not create invoice move on centralized journal'))
@ -559,8 +588,9 @@ class account_invoice(osv.osv):
for i in line:
i[2]['period_id'] = period_id
move_id = self.pool.get('account.move').create(cr, uid, move)
new_move_name = self.pool.get('account.move').browse(cr, uid, move_id).name
# make the invoice point to that move
self.write(cr, uid, [inv.id], {'move_id': move_id,'period_id':period_id})
self.write(cr, uid, [inv.id], {'move_id': move_id,'period_id':period_id, 'move_name':new_move_name})
self.pool.get('account.move').post(cr, uid, [move_id])
self._log_event(cr, uid, ids)
return True
@ -579,7 +609,8 @@ class account_invoice(osv.osv):
'currency_id':x.get('currency_id', False),
'tax_code_id': x.get('tax_code_id', False),
'tax_amount': x.get('tax_amount', False),
'ref':x.get('ref',False)
'ref':x.get('ref',False),
'quantity':x.get('quantity',1.00),
}
def action_number(self, cr, uid, ids, *args):
@ -851,32 +882,16 @@ class account_invoice_line(osv.osv):
return {'domain':{'product_uom':[]}}
else:
return {'value': {'price_unit': 0.0}, 'domain':{'product_uom':[]}}
lang=False
part = self.pool.get('res.partner').browse(cr, uid, partner_id)
lang=part.lang
context.update({'lang': lang})
res = self.pool.get('product.product').browse(cr, uid, product, context=context)
taxep=None
lang=self.pool.get('res.partner').read(cr, uid, [partner_id])[0]['lang']
tax_obj = self.pool.get('account.tax')
if type in ('out_invoice', 'out_refund'):
part = self.pool.get('res.partner').browse(cr, uid, partner_id)
taxep = part.property_account_position and part.property_account_position.account_tax
if not taxep or not taxep.id:
tax_id = map(lambda x: x.id, res.taxes_id)
else:
tax_id = [taxep.id]
for t in res.taxes_id:
if not t.tax_group==taxep.tax_group:
tax_id.append(t.id)
tax_id = self.pool.get('account.fiscal.position').map_tax(cr, uid, part, res.taxes_id)
else:
part = self.pool.get('res.partner').browse(cr, uid, partner_id)
taxep = part.property_account_position and part.property_account_position.account_supplier_tax
if not taxep or not taxep.id:
tax_id = map(lambda x: x.id, res.supplier_taxes_id)
else:
tax_id = [taxep.id]
for t in res.supplier_taxes_id:
if not t.tax_group==taxep.tax_group:
tax_id.append(t.id)
tax_id = self.pool.get('account.fiscal.position').map_tax(cr, uid, part, res.supplier_taxes_id)
if type in ('in_invoice', 'in_refund'):
result = self.product_id_change_unit_price_inv(cr, uid, tax_id, price_unit, qty, address_invoice_id, product, partner_id, context=context)
else:
@ -959,6 +974,7 @@ class account_invoice_line(osv.osv):
'product_id':line.product_id.id,
'uos_id':line.uos_id.id,
'account_analytic_id':line.account_analytic_id.id,
'taxes':line.invoice_line_tax_id,
}
#
# Set the tax field according to the account and the partner
@ -968,13 +984,8 @@ class account_invoice_line(osv.osv):
return {}
taxes = self.pool.get('account.account').browse(cr, uid, account_id).tax_ids
part = self.pool.get('res.partner').browse(cr, uid, partner_id)
taxep = partner.property_account_position and partner.property_account_position.account_tax
if not taxep.id:
return {'value': {'invoice_line_tax_id': map(lambda x: x.id, taxes or []) }}
res = [taxep.id]
for t in taxes:
if not t.tax_group==taxep.tax_group:
res.append(t.id)
res = self.pool.get('account.fiscal.position').map_tax(cr, uid, part, taxes)
r = {'value':{'invoice_line_tax_id': res}}
return r
account_invoice_line()

View File

@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# $Id$
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
@ -37,16 +29,24 @@ class account_fiscal_position(osv.osv):
_columns = {
'name': fields.char('Fiscal Position', size=64, translate=True, required=True),
'company_id': fields.many2one('res.company', 'Company'),
'account_tax': fields.many2one(
'account.tax', 'Customer Tax',
help="This account will be used as the receivable account for partners in this position",
),
'account_supplier_tax': fields.many2one(
'account.tax', 'Supplier Tax',
help="This account will be used as the payable account for partners in this position",
),
'account_ids': fields.one2many('account.fiscal.position.account', 'position_id', 'Accounts Mapping')
'account_ids': fields.one2many('account.fiscal.position.account', 'position_id', 'Accounts Mapping'),
'tax_ids': fields.one2many('account.fiscal.position.tax', 'position_id', 'Taxes Mapping')
}
def map_tax(self, cr, uid, partner, taxes, context={}):
if (not partner) or (not partner.property_account_position) :
return map(lambda x: x.id, taxes)
result = []
for t in taxes:
ok = False
for tax in partner.property_account_position.tax_ids:
if tax.tax_src_id.id==t.id:
if tax.tax_dest_id:
result.append(tax.tax_dest_id.id)
ok=True
if not ok:
result.append(t.id)
return result
def map_account(self, cr, uid, partner, account_id, context={}):
if (not partner) or (not partner.property_account_position) :
return account_id
@ -58,6 +58,18 @@ class account_fiscal_position(osv.osv):
account_fiscal_position()
class account_fiscal_position_tax(osv.osv):
_name = 'account.fiscal.position.tax'
_description = 'Fiscal Position Taxes Mapping'
_rec_name = 'position_id'
_columns = {
'position_id': fields.many2one('account.fiscal.position', 'Fiscal Position', required=True, ondelete='cascade'),
'tax_src_id': fields.many2one('account.tax', 'Tax Source', required=True),
'tax_dest_id': fields.many2one('account.tax', 'Replacement Tax')
}
account_fiscal_position_tax()
class account_fiscal_position_account(osv.osv):
_name = 'account.fiscal.position.account'
_description = 'Fiscal Position Accounts Mapping'

View File

@ -11,8 +11,16 @@
<field name="name" select="1"/>
<field name="company_id"/>
<newline/>
<field name="account_tax" select="2"/>
<field name="account_supplier_tax" select="2"/>
<field name="tax_ids" colspan="4">
<tree string="Taxes Mapping" editable="bottom">
<field name="tax_src_id" domain="[('parent_id','=',False)]"/>
<field name="tax_dest_id" domain="[('parent_id','=',False)]"/>
</tree>
<form string="Taxes Mapping">
<field name="tax_src_id" domain="[('parent_id','=',False)]"/>
<field name="tax_dest_id" domain="[('parent_id','=',False)]"/>
</form>
</field>
<field name="account_ids" colspan="4">
<tree string="Accounts Mapping" editable="bottom">
<field name="account_src_id"/>
@ -34,8 +42,6 @@
<tree string="Fiscal Position">
<field name="name"/>
<field name="company_id"/>
<field name="account_tax"/>
<field name="account_supplier_tax"/>
</tree>
</field>
</record>

View File

@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# $Id$
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

View File

@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# $Id$
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

View File

@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# $Id$
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
@ -166,7 +158,9 @@ class account_analytic_account(osv.osv):
'type' : lambda *a : 'normal',
'company_id': _default_company,
'state' : lambda *a : 'draft',
'user_id' : lambda self,cr,uid,ctx : uid
'user_id' : lambda self,cr,uid,ctx : uid,
'partner_id': lambda self,cr, uid, ctx: ctx.get('partner_id', False),
'contact_id': lambda self,cr, uid, ctx: ctx.get('contact_id', False),
}
def check_recursion(self, cr, uid, ids, parent=None):

View File

@ -60,7 +60,8 @@
<newline/>
<field name="quantity_max"/>
<field name="user_id"/>
<separator colspan="4" string="Note"/>
</page>
<page string="Description">
<field colspan="4" name="description" nolabel="1"/>
</page>
</notebook>
@ -73,7 +74,7 @@
<field name="type">ir.actions.act_window</field>
<field name="res_model">account.analytic.account</field>
<field name="view_type">form</field>
<field name="view_mode">tree,graph</field>
<field name="view_mode">tree,graph,form</field>
<field name="view_id" ref="view_account_analytic_account_tree"/>
</record>
<!--<menuitem id="menu_analytic_account" name="Analytic Accounts" parent="account.menu_analytic_accounting"/>-->

View File

@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# $Id$
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

View File

@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# $Id$
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

View File

@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# $Id$
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting FROM its eventual inadequacies AND bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees AND support are strongly adviced to contract a Free Software
# Service Company
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is Free Software; you can redistribute it AND/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

View File

@ -17,7 +17,7 @@
<!--COL 1-->
<drawString x="1.0cm" y="28.1cm">[[ company.name ]]</drawString>
<drawRightString x="20cm" y="28.1cm">Analytic Balance</drawRightString>
<drawRightString x="20cm" y="28.1cm">Analytic Balance - [[ company.currency_id.name ]]</drawRightString>
<!-- Header -->

View File

@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# $Id$
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting FROM its eventual inadequacies AND bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees AND support are strongly adviced to contract a Free Software
# Service Company
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is Free Software; you can redistribute it AND/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

View File

@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# $Id$
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import time

View File

@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# $Id$
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting FROM its eventual inadequacies AND bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees AND support are strongly adviced to contract a Free Software
# Service Company
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is Free Software; you can redistribute it AND/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

View File

@ -10,7 +10,7 @@
<!--COL 1-->
<drawString x="1.0cm" y="28.1cm">[[ company.name ]]</drawString>
<drawRightString x="20cm" y="28.1cm">Cost Ledger-[[ company.currency_id.name ]]</drawRightString>
<drawRightString x="20cm" y="28.1cm">Cost Ledger - [[ company.currency_id.name ]]</drawRightString>
<!-- Header -->
@ -113,13 +113,13 @@
<paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="RIGHT" spaceBefore="12.0" spaceAfter="6.0"/>
@ -181,13 +181,13 @@
<blockTable colWidths="178.0,178.0,178.0" style="Table_Sub_Content">
<tr>
<td>
<para style="terp_tblheader_General_Centre">[[ data['form']['date1'] ]]</para>
<para style="terp_default_Centre_8">[[ data['form']['date1'] ]]</para>
</td>
<td>
<para style="terp_tblheader_General_Centre">[[ data['form']['date2'] ]]</para>
<para style="terp_default_Centre_8">[[ data['form']['date2'] ]]</para>
</td>
<td>
<para style="terp_tblheader_General_Centre">[[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]]</para>
<para style="terp_default_Centre_8">[[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]]</para>
</td>
</tr>
</blockTable>

View File

@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# $Id$
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting FROM its eventual inadequacies AND bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees AND support are strongly adviced to contract a Free Software
# Service Company
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is Free Software; you can redistribute it AND/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

View File

@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# $Id$
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting FROM its eventual inadequacies AND bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees AND support are strongly adviced to contract a Free Software
# Service Company
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is Free Software; you can redistribute it AND/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

View File

@ -10,7 +10,7 @@
<!--COL 1-->
<drawString x="1.0cm" y="28.1cm">[[ company.name ]]</drawString>
<drawRightString x="20cm" y="28.1cm">Cost Ledger-[[ company.currency_id.name ]]</drawRightString>
<drawRightString x="20cm" y="28.1cm">Cost Ledger - [[ company.currency_id.name ]]</drawRightString>
<!-- Header -->
@ -114,13 +114,13 @@
<paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="RIGHT" spaceBefore="12.0" spaceAfter="6.0"/>
@ -181,13 +181,13 @@
<blockTable colWidths="161.0,161.0,161.0" style="Table_Date_Content">
<tr>
<td>
<para style="terp_tblheader_General_Centre">[[ data['form']['date1'] ]]</para>
<para style="terp_default_Centre_8">[[ data['form']['date1'] ]]</para>
</td>
<td>
<para style="terp_tblheader_General_Centre">[[ data['form']['date2'] ]]</para>
<para style="terp_default_Centre_8">[[ data['form']['date2'] ]]</para>
</td>
<td>
<para style="terp_tblheader_General_Centre">[[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]]</para>
<para style="terp_default_Centre_8">[[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]]</para>
</td>
</tr>
</blockTable>

View File

@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# $Id$
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

View File

@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# $Id$
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

View File

@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# $Id$
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

View File

@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# $Id$
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

View File

@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# $Id$
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

View File

@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# $Id$
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

View File

@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# $Id$
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

View File

@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# $Id$
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

View File

@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# $Id$
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

View File

@ -1,29 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# $Id$
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
@ -46,7 +39,6 @@ class account_balance(report_sxw.rml_parse):
self.localcontext.update({
'time': time,
'lines': self.lines,
'moveline':self.moveline,
'sum_debit': self._sum_debit,
'sum_credit': self._sum_credit,
'get_fiscalyear':self.get_fiscalyear,
@ -77,6 +69,47 @@ class account_balance(report_sxw.rml_parse):
result+=r[0]+", "
return str(result and result[:-1]) or ''
def transform_both_into_date_array(self,data):
if not data['periods'][0][2] :
periods_id = self.pool.get('account.period').search(self.cr, self.uid, [('fiscalyear_id','=',data['form']['fiscalyear'])])
else:
periods_id = data['periods'][0][2]
date_array = []
for period_id in periods_id:
period_obj = self.pool.get('account.period').browse(self.cr, self.uid, period_id)
date_array = date_array + self.date_range(period_obj.date_start,period_obj.date_stop)
period_start_date = date_array[0]
date_start_date = data['date_from']
period_stop_date = date_array[-1]
date_stop_date = data['date_to']
if period_start_date<date_start_date:
start_date = period_start_date
else :
start_date = date_start_date
if date_stop_date<period_stop_date:
stop_date = period_stop_date
else :
stop_date = date_stop_date
final_date_array = []
final_date_array = final_date_array + self.date_range(start_date, stop_date)
self.date_lst = final_date_array
self.date_lst.sort()
def transform_none_into_date_array(self,data):
sql = "SELECT min(date) as start_date from account_move_line"
self.cr.execute(sql)
start_date = self.cr.fetchone()[0]
sql = "SELECT max(date) as start_date from account_move_line"
self.cr.execute(sql)
stop_date = self.cr.fetchone()[0]
array= []
array = array + self.date_range(start_date, stop_date)
self.date_lst = array
self.date_lst.sort()
def lines(self, form, ids={}, done=None, level=1):
if not ids:
ids = self.ids
@ -90,14 +123,16 @@ class account_balance(report_sxw.rml_parse):
res={}
result_acc=[]
ctx = self.context.copy()
if form.has_key('fiscalyear'):
if form['state']=='byperiod' :
self.transform_period_into_date_array(form)
ctx['fiscalyear'] = form['fiscalyear']
ctx['periods'] = form['periods'][0][2]
else:
elif form['state']== 'bydate':
self.transform_date_into_date_array(form)
ctx['date_from'] = form['date_from']
ctx['date_to'] = form['date_to']
elif form['state'] == 'all' :
self.transform_both_into_date_array(form)
elif form['state'] == 'none' :
self.transform_none_into_date_array(form)
accounts = self.pool.get('account.account').browse(self.cr, self.uid, ids, ctx)
def cmp_code(x, y):
@ -108,15 +143,8 @@ class account_balance(report_sxw.rml_parse):
continue
done[account.id] = 1
res = {
'lid' :'',
'date':'',
'jname':'',
'ref':'',
'lname':'',
'debit1':'',
'credit1':'',
'balance1' :'',
'id' : account.id,
'type' : account.type,
'code': account.code,
'name': account.name,
'level': level,
@ -128,68 +156,38 @@ class account_balance(report_sxw.rml_parse):
}
self.sum_debit += account.debit
self.sum_credit += account.credit
if not (res['credit'] or res['debit']) and not account.child_id:
continue
if account.child_id:
def _check_rec(account):
if not account.child_id:
return bool(account.credit or account.debit)
for c in account.child_id:
if _check_rec(c):
if not _check_rec(c) or _check_rec(c):
return True
return False
if not _check_rec(account):
if not _check_rec(account) :
continue
if form['display_account'] == 'bal_mouvement':
if res['credit'] <> 0 or res['debit'] <> 0 or res['balance'] <> 0:
if res['credit'] > 0 or res['debit'] > 0 or res['balance'] > 0 :
result_acc.append(res)
elif form['display_account'] == 'bal_solde':
if res['balance'] <> 0:
if res['balance'] > 0:
result_acc.append(res)
else:
result_acc.append(res)
res1 = self.moveline(form, account.id,res['level'])
if res1:
for r in res1:
result_acc.append(r)
if account.code=='0':
result_acc.pop(-1)
if account.child_id:
ids2 = [(x.code,x.id) for x in account.child_id]
ids2.sort()
result_acc += self.lines(form, [x[1] for x in ids2], done, level+1)
acc_id = [acc.id for acc in account.child_id]
lst_string = ''
lst_string = '\'' + '\',\''.join(map(str,acc_id)) + '\''
self.cr.execute("select code,id from account_account where id IN (%s)"%(lst_string))
a_id = self.cr.fetchall()
a_id.sort()
ids2 = [x[1] for x in a_id]
result_acc += self.lines(form, ids2, done, level+1)
return result_acc
def moveline(self,form,ids,level):
res={}
self.date_lst_string = '\'' + '\',\''.join(map(str,self.date_lst)) + '\''
self.cr.execute(
"SELECT l.id as lid,l.date,j.code as jname, l.ref, l.name as lname, l.debit as debit1, l.credit as credit1 " \
"FROM account_move_line l " \
"LEFT JOIN account_journal j " \
"ON (l.journal_id = j.id) " \
"WHERE l.account_id = '"+str(ids)+"' " \
"AND l.date IN (" + self.date_lst_string + ") " \
"ORDER BY l.id")
res = self.cr.dictfetchall()
sum = 0.0
for r in res:
sum = r['debit1'] - r['credit1']
r['balance1'] = sum
r['id'] =''
r['code']= ''
r['name']=''
r['level']=level
r['debit']=''
r['credit']=''
r['balance']=''
r['leef']=''
if sum > 0.0:
r['bal_type']=" Dr."
else:
r['bal_type']=" Cr."
return res or ''
def date_range(self,start,end):
start = datetime.date.fromtimestamp(time.mktime(time.strptime(start,"%Y-%m-%d")))
end = datetime.date.fromtimestamp(time.mktime(time.strptime(end,"%Y-%m-%d")))
@ -227,5 +225,5 @@ class account_balance(report_sxw.rml_parse):
def _sum_debit(self):
return self.sum_debit
report_sxw.report_sxw('report.account.account.balance', 'account.account', 'addons/account/report/account_balance.rml', parser=account_balance, header=False)
report_sxw.report_sxw('report.account.account.balance', 'account.account', 'addons/account/report/account_balance.rml', parser=account_balance, header=False)

View File

@ -2,7 +2,7 @@
<document filename="test.pdf">
<template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
<pageTemplate id="first">
<frame id="first" x1="57.0" y1="57.0" width="481" height="700"/>
<frame id="first" x1="57.0" y1="57.0" width="481" height="728"/>
<pageGraphics>
<setFont name="Helvetica-Bold" size="9"/>
@ -15,244 +15,181 @@
<setFont name="Helvetica" size="9"/>
<drawString x="1.0cm" y="1cm"> [[ time.strftime("%m-%d-%y %H:%M", time.localtime()) ]]</drawString>
<drawString x="19.0cm" y="1cm">Page <pageNumber/></drawString>
<lineMode width="0.7"/>
<lines>1cm 27.7cm 20cm 27.7cm</lines>
<setFont name="Helvetica" size="8"/>
</pageGraphics>
</pageTemplate>
</template>
<stylesheet>
<blockTableStyle id="Standard_Outline">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Table1">
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
<blockLeftPadding length="0" start="0,0" stop="1,0"/>
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<blockBackground colorName="#e6e6e6" start="0,0" stop="0,-1"/>
<blockBackground colorName="#e6e6e6" start="1,0" stop="1,-1"/>
<blockBackground colorName="#e6e6e6" start="2,0" stop="2,-1"/>
<blockBackground colorName="#e6e6e6" start="0,1" stop="0,-1"/>
<blockBackground colorName="#e6e6e6" start="1,1" stop="1,-1"/>
<blockBackground colorName="#e6e6e6" start="2,1" stop="2,-1"/>
</blockTableStyle>
<blockTableStyle id="Table6">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBEFORE" colorName="#000000" start="0,0" stop="0,-1"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="0,0" stop="0,0"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#000000" start="1,0" stop="1,-1"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,0"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#000000" start="2,0" stop="2,-1"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="2,0" stop="2,0"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#000000" start="3,0" stop="3,-1"/>
<lineStyle kind="LINEAFTER" colorName="#000000" start="3,0" stop="3,-1"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="3,0" stop="3,0"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
</blockTableStyle>
<blockTableStyle id="Table2">
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,0" stop="-1,0"/>
</blockTableStyle>
<blockTableStyle id="Table3">
<blockLeftPadding length="0" start="0,0" stop="-1,0"/>
</blockTableStyle>
<blockTableStyle id="Table4">
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
<blockValign value="TOP"/>
<blockAlignment value="RIGHT" start="2,1" stop="-1,-1"/>
</blockTableStyle>
<blockTableStyle id="Table3">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Table4">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBEFORE" colorName="#FFFFFF" start="0,0" stop="0,-1"/>
<lineStyle kind="LINEABOVE" colorName="#FFFFFF" start="0,0" stop="0,0"/>
<lineStyle kind="LINEBELOW" colorName="#FFFFFF" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#FFFFFF" start="1,0" stop="1,-1"/>
<lineStyle kind="LINEABOVE" colorName="#FFFFFF" start="1,0" stop="1,0"/>
<lineStyle kind="LINEBELOW" colorName="#FFFFFF" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#FFFFFF" start="2,0" stop="2,-1"/>
<lineStyle kind="LINEABOVE" colorName="#FFFFFF" start="2,0" stop="2,0"/>
<lineStyle kind="LINEBELOW" colorName="#FFFFFF" start="2,-1" stop="2,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#FFFFFF" start="3,0" stop="3,-1"/>
<lineStyle kind="LINEAFTER" colorName="#FFFFFF" start="3,0" stop="3,-1"/>
<lineStyle kind="LINEABOVE" colorName="#FFFFFF" start="3,0" stop="3,0"/>
<lineStyle kind="LINEBELOW" colorName="#FFFFFF" start="3,-1" stop="3,-1"/>
</blockTableStyle>
<initialize>
<paraStyle name="all" alignment="justify"/>
</initialize>
<paraStyle name="P2" fontName="Helvetica" fontSize="2.0" leading="0" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P3" fontName="Helvetica" fontSize="8.0" leading="5" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P3a" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P10" fontName="Helvetica" fontSize="9.0" leading="14" spaceBefore="0.0" spaceAfter="6.0" alignment="RIGHT"/>
<paraStyle name="P9" fontName="Helvetica-Bold" alignment="CENTER" fontSize="12" leftIndent="-5.0"/>
<paraStyle name="P9b" fontName="Helvetica" fontSize="9" leftIndent="0.0" alignment="LEFT"/>
<paraStyle name="P1" fontName="Helvetica" fontSize="20.0" leading="25" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P2" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P3" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P10" fontName="Helvetica" fontSize="8.0" leading="14" spaceBefore="0.0" spaceAfter="6.0" alignment="RIGHT"/>
<paraStyle name="P9" fontName="Helvetica-Bold" alignment="CENTER" fontSize="14.5" leftIndent="-5.0"/>
<paraStyle name="P9a" fontName="Helvetica-Bold" fontSize="9" leftIndent="0.0" alignment="LEFT"/>
<paraStyle name="P12" fontName="Helvetica" fontSize="9.0" leading="14" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P12a" fontName="Helvetica" fontSize="9.0" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P14" fontName="Helvetica" fontSize="8.0" leading="5" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P9b" fontName="Helvetica" fontSize="9" leftIndent="0.0" alignment="LEFT"/>
<paraStyle name="P9b" fontName="Helvetica" fontSize="8" leftIndent="-5.0" alignment="LEFT"/>
<paraStyle name="P12" fontName="Helvetica" fontSize="8.0" leading="14" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P12a" fontName="Helvetica" fontSize="8.0" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P14" rightIndent="17.0" leftIndent="-0.0" fontName="Helvetica" fontSize="8.0" leading="10" spaceBefore="0.0" spaceAfter="6.0"/>
<blockTableStyle id="TrLevel8">
<blockLeftPadding length="0" start="0,0" stop="-1,0"/>
</blockTableStyle>
<blockTableStyle id="TrLevel7">
<blockLeftPadding length="0" start="0,0" stop="-1,0"/>
</blockTableStyle>
<blockTableStyle id="TrLevel6">
<blockLeftPadding length="0" start="0,0" stop="-1,0"/>
</blockTableStyle>
<blockTableStyle id="TrLevel5">
<blockLeftPadding length="0" start="0,0" stop="-1,0"/>
</blockTableStyle>
<blockTableStyle id="TrLevel4">
<blockLeftPadding length="0" start="0,0" stop="-1,0"/>
</blockTableStyle>
<blockTableStyle id="TrLevel3">
<lineStyle kind="LINEBELOW" colorName="#777777" start="1,0" stop="1,0"/>
<blockLeftPadding length="0" start="0,0" stop="-1,0"/>
</blockTableStyle>
<blockTableStyle id="TrLevel2">
<lineStyle kind="LINEBELOW" colorName="#777777" start="1,0" stop="-1,0"/>
<blockLeftPadding length="0" start="0,0" stop="1,0"/>
</blockTableStyle>
<blockTableStyle id="TrLevel1">
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
<blockLeftPadding length="0" start="0,0" stop="1,0"/>
</blockTableStyle>
<blockTableStyle id="TrLevel_Name8">
<blockLeftPadding length="100" start="1,0" stop="1,0"/>
</blockTableStyle>
<blockTableStyle id="TrLevel_Name7">
<blockTableStyle id="TrLevel7">
<blockLeftPadding length="80" start="1,0" stop="1,0"/>
</blockTableStyle>
<blockTableStyle id="TrLevel_Name6">
<blockTableStyle id="TrLevel6">
<blockLeftPadding length="60" start="1,0" stop="1,0"/>
</blockTableStyle>
<blockTableStyle id="TrLevel_Name5">
</blockTableStyle>
<blockTableStyle id="TrLevel5">
<blockLeftPadding length="40" start="1,0" stop="1,0"/>
</blockTableStyle>
<blockTableStyle id="TrLevel_Name4">
<blockLeftPadding length="20" start="1,0" stop="1,0"/>
<blockTableStyle id="TrLevel4">
<blockLeftPadding length="20" start="1,0" stop="1,0"/>
</blockTableStyle>
<blockTableStyle id="TrLevel_Name3">
<blockTableStyle id="TrLevel3">
<blockLeftPadding length="0" start="1,0" stop="1,0"/>
</blockTableStyle>
<blockTableStyle id="TrLevel_Name2">
<blockTableStyle id="TrLevel2">
<blockLeftPadding length="0" start="1,0" stop="1,0"/>
<lineStyle kind="LINEBELOW" colorName="#777777" start="1,0" stop="1,0"/>
<blockTopPadding length="13" start="0,0" stop="-1,0"/>
<blockBottomPadding length="2" start="0,0" stop="-1,0"/>
<blockFont name="Times-Bold" start="0,0" stop="-1,-1"/>
</blockTableStyle>
<blockTableStyle id="TrLevel_Name1">
<blockTableStyle id="TrLevel1">
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
<blockLeftPadding length="0" start="1,0" stop="1,0"/>
<blockTopPadding length="26" start="0,0" stop="-1,0"/>
<blockBottomPadding length="2" start="0,0" stop="-1,0"/>
<blockFont name="Times-Bold" start="0,0" stop="-1,-1"/>
</blockTableStyle>
<paraStyle
name="Level8"
fontName="Helvetica-Bold"
fontSize="8.0" />
<paraStyle
name="Level7"
fontName="Helvetica-Bold"
fontSize="8.0" />
<paraStyle
name="Level6"
fontName="Helvetica-Bold"
name="Level8"
fontName="Helvetica"
fontSize="8.0" />
<paraStyle
name="Level5"
fontName="Helvetica-Bold"
name="Level7"
fontName="Helvetica"
fontSize="8.0" />
<paraStyle
name="Level4"
fontName="Helvetica-Bold"
name="Level6"
fontName="Helvetica"
fontSize="8.0" />
<paraStyle
name="Level3"
fontName="Helvetica-Bold"
name="Level5"
fontName="Helvetica"
fontSize="8.0" />
<paraStyle name="Level2"
<paraStyle
name="Level4"
fontName="Helvetica"
fontSize="8.0" />
<paraStyle
name="Level3"
fontName="Helvetica"
fontSize="8.0" />
<paraStyle
name="Level2"
firstLineIndent="-0.03cm"
fontName="Helvetica-Bold"
fontSize="8.0" />
<paraStyle name="Level1"
fontSize="8.0"
fontName="Helvetica-Bold"
fontName="Helvetica-Bold"
/>
<paraStyle name="Level1"
fontSize="8.0"
fontName="Helvetica-Bold"
/>
<paraStyle
name="Amt_Level8"
fontName="Helvetica-Bold"
fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle
name="Amt_Level7"
fontName="Helvetica-Bold"
fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle
name="Amt_Level6"
fontName="Helvetica-Bold"
fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle
name="Amt_Level5"
fontName="Helvetica-Bold"
fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle
name="Amt_Level4"
fontName="Helvetica-Bold"
fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle
name="Amt_Level3"
fontName="Helvetica-Bold"
fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Amt_Level2"
fontSize="8.0"
fontName="Helvetica-Bold" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"
/>
<paraStyle name="Amt_Level1"
fontSize="8.0"
fontName="Helvetica-Bold" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"
/>
<paraStyle
name="Det_Level8"
fontName="Times-Italic"
fontSize="8.0" leading="5"/>
<paraStyle
name="Det_Level7"
fontName="Times-Italic"
fontSize="8.0" leading="5"/>
<paraStyle
name="Det_Level6"
fontName="Times-Italic"
fontSize="8.0" leading="5"/>
<paraStyle
name="Det_Level5"
fontName="Times-Italic"
fontSize="8.0" leading="5"/>
<paraStyle
name="Det_Level4"
fontName="Times-Italic"
fontSize="8.0" leading="5"/>
<paraStyle
name="Det_Level3"
fontName="Times-Italic"
fontSize="8.0" leading="5"/>
<paraStyle name="Det_Level2"
fontSize="8.0" leading="5"
fontName="Times-Italic"
/>
<paraStyle name="Det_Level1"
fontSize="8.0" leading="5"
fontName="Times-Italic"
/>
<paraStyle
name="Det_Amt_Level8"
fontName="Times-Italic"
fontSize="8.0" leading="5" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle
name="Det_Amt_Level7"
fontName="Times-Italic"
fontSize="8.0" leading="5" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle
name="Det_Amt_Level6"
fontName="Times-Italic"
fontSize="8.0" leading="5" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle
name="Det_Amt_Level5"
fontName="Times-Italic"
fontSize="8.0" leading="5" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle
name="Det_Amt_Level4"
fontName="Times-Italic"
fontSize="8.0" leading="5" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle
name="Det_Amt_Level3"
fontName="Times-Italic"
fontSize="8.0" leading="5" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Det_Amt_Level2"
fontSize="8.0"
fontName="Times-Italic" leading="5" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"
/>
<paraStyle name="Det_Amt_Level1"
fontSize="8.0"
fontName="Times-Italic" leading="5" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"
/>
<paraStyle name="Caption" fontName="Helvetica" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="Index" fontName="Helvetica"/>
</stylesheet>
<images/>
<story>
<blockTable colWidths="527.00" style="Table4" repeatRows="1">
<tr>
<td>
<para style="P9a">[[ get_fiscalyear(data['form']) or removeParentNode('tr') ]]:</para>
<para style="P9b"><i> [[ get_periods(data['form']) or removeParentNode('tr') ]]</i></para>
</td>
</tr>
</blockTable>
<para style="P2">
<font color="white"> </font>
</para>
<blockTable colWidths="50.0,248.0,73.0,72.0,87.0" style="Table1" repeatRows="1">
<para style="P2">
<font color="white"> </font>
</para>
<blockTable colWidths="527.00" style="Table4" repeatRows="1">
<tr>
<td>
<para style="P9a">[[ get_fiscalyear(data['form']) or removeParentNode('para') ]]:</para>
<para style="P9b"><i> [[ get_periods(data['form']) or removeParentNode('para') ]]</i></para>
</td>
</tr>
</blockTable>
<para style="P2">
<font color="white"> </font>
</para>
<blockTable colWidths="46,278.0,73.0,72.0,82.0" style="Table2" repeatRows="1">
<tr noRowsplits="1">
<td>
<para style="P12a">Code</para>
</td>
@ -269,36 +206,26 @@
<para style="P10">Balance</para>
</td>
</tr>
<tr>
<td>
<blockTable colWidths="50.0,248.0,73.0,72.0,82.0" style="Table3">
<para style="P2">[[ repeatIn(lines(data['form']), 'a') ]]</para>
<tr>
<td><para style="P14">[[ setTag('para','para',{'style':('Level'+str(a['level']))}) ]]<i>[[ a['code'] or removeParentNode('tr') ]]</i></para></td>
<td><para style="P14">[[ setTag('para','para',{'style':('Level'+str(a['level']))}) ]][[ setTag('blockTable','blockTable',{'style':'TrLevel'+str(a['level'])}) ]][[ a['name'] ]]</para></td>
<td>
<para style="P3"><font><u>[[ a['level']&gt;3 and removeParentNode('font') ]][[ setTag('para','para',{'style':('Amt_Level'+str(a['level']))}) ]][[ formatLang(a['debit']) and '%.2f'%a['debit'] or '0.00' ]]</u></font>
<font>[[ a['level']&lt;4 and removeParentNode('font') ]][[ setTag('para','para',{'style':('Amt_Level'+str(a['level']))}) ]][[ formatLang(a['debit']) and '%.2f'%a['debit'] or '0.00' ]]</font></para>
</td>
<td>
<para style="P3"><font><u>[[ a['level']&gt;3 and removeParentNode('font') ]][[ setTag('para','para',{'style':('Amt_Level'+str(a['level']))}) ]][[ formatLang(a['credit']) and '%.2f'%a['credit'] or '0.00' ]]</u></font>
<font>[[ a['level']&lt;4 and removeParentNode('font') ]][[ setTag('para','para',{'style':('Amt_Level'+str(a['level']))}) ]][[ formatLang(a['credit']) and '%.2f'%a['credit'] or '0.00' ]]</font></para>
</td>
<td>
<para style="P3"><font><u>[[ a['level']&gt;3 and removeParentNode('font') ]][[ setTag('para','para',{'style':('Amt_Level'+str(a['level']))}) ]][[ formatLang(a['balance']) and '%.2f'%a['balance'] or '0.00' ]]</u></font>
<font>[[ a['level']&lt;4 and removeParentNode('font') ]][[ setTag('para','para',{'style':('Amt_Level'+str(a['level']))}) ]][[ formatLang(a['balance']) and '%.2f'%a['balance'] or '0.00' ]]</font></para>
</td>
</tr>
<tr>
<td><para style="P14">[[ setTag('para','para',{'style':('Det_Level'+str(a['level']))}) ]][[ a['jname'] or removeParentNode('tr') ]]</para></td>
<td><para style="P14">[[ setTag('para','para',{'style':('Det_Level'+str(a['level']))}) ]] [[ setTag('tr','tr',{'style':('TrLevel_Name'+str(a['level']))}) ]]<font>[ref: [[ a['ref'] or removeParentNode('font') ]] ]</font> [[ a['lname'] ]]</para></td>
<td><para style="P3">[[ setTag('para','para',{'style':('Det_Amt_Level'+str(a['level']))}) ]][[ formatLang(a['debit1']) and '%.2f'%a['debit1'] or '0.00']]</para></td>
<td><para style="P3">[[ setTag('para','para',{'style':('Det_Amt_Level'+str(a['level']))}) ]][[ formatLang(a['credit1']) and '%.2f'%a['credit1'] or '0.00']]</para></td>
<td><para style="P3">[[ setTag('para','para',{'style':('Det_Amt_Level'+str(a['level']))}) ]][[ formatLang(a['balance1']) and '%.2f'%a['balance1'] or '0.00' ]]</para></td>
</tr>
</blockTable>
</td>
</tr>
</blockTable>
</story>
<tr>
<td><para style="P14">[[ repeatIn(lines(data['form']), 'a') ]]<i>[[ a['code'] or removeParentNode('tr') ]]</i></para></td>
<td>
<para style="P14">[[ setTag('tr','tr',{'style':'TrLevel'+str(a['level']), 'paraStyle':('Level'+str(a['level']))}) ]]<font></font>
[[ a['name'] ]]</para>
</td>
<td>
<para style="P3"><font>[[ a['type']=='view' and removeParentNode('font') ]][[ a['debit'] and formatLang(a['debit']) or '0.00' ]]</font>
<font>[[ a['type']&lt;&gt;'view' and removeParentNode('font') ]] [[a['debit'] and formatLang(a['debit']) or '0.00' ]]</font></para>
</td>
<td>
<para style="P3"><font>[[ a['type']=='view' and removeParentNode('font') ]][[ a['credit'] and formatLang(a['credit']) or '0.00' ]]</font>
<font>[[ a['type']&lt;&gt;'view' and removeParentNode('font') ]] [[a['credit'] and formatLang(a['credit']) or '0.00' ]]</font></para>
</td>
<td>
<para style="P3"><font>[[ a['type']=='view' and removeParentNode('font') ]][[ a['balance'] and formatLang(a['balance']) or '0.00' ]]</font>
<font>[[ a['type']&lt;&gt;'view' and removeParentNode('font') ]] [[a['balance'] and formatLang(a['balance']) or '0.00' ]]</font></para>
</td>
</tr>
</blockTable>
</story>
</document>

View File

@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# $Id$
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
@ -45,12 +37,28 @@ class journal_print(report_sxw.rml_parse):
'sum_credit': self._sum_credit
})
def lines(self, period_id, journal_id, *args):
def lines(self, period_id, journal_id, sort_selection='date', *args):
if type(period_id)==type([]):
ids_final = []
for journal in journal_id:
for period in period_id:
ids_journal_period = self.pool.get('account.journal.period').search(self.cr,self.uid, [('journal_id','=',journal),('period_id','=',period)])
if ids_journal_period:
self.cr.execute('update account_journal_period set state=%s where journal_id=%d and period_id=%d and state=%s', ('printed',journal,period,'draft'))
self.cr.commit()
self.cr.execute('select id from account_move_line where period_id=%d and journal_id=%d and state<>\'draft\' order by ('+ sort_selection +'),id', (period, journal))
ids = map(lambda x: x[0], self.cr.fetchall())
ids_final.append(ids)
line_ids = []
for line_id in ids_final:
a = self.pool.get('account.move.line').browse(self.cr, self.uid, line_id )
line_ids.append(a)
return line_ids
self.cr.execute('update account_journal_period set state=%s where journal_id=%d and period_id=%d and state=%s', ('printed',journal_id,period_id,'draft'))
self.cr.commit()
self.cr.execute('select id from account_move_line where period_id=%d and journal_id=%d and state<>\'draft\' order by date,id', (period_id, journal_id))
ids = map(lambda x: x[0], self.cr.fetchall())
return self.pool.get('account.move.line').browse(self.cr, self.uid, ids)
return self.pool.get('account.move.line').browse(self.cr, self.uid, ids )
def _sum_debit(self, period_id, journal_id):
self.cr.execute('select sum(debit) from account_move_line where period_id=%d and journal_id=%d and state<>\'draft\'', (period_id, journal_id))
@ -60,7 +68,7 @@ class journal_print(report_sxw.rml_parse):
self.cr.execute('select sum(credit) from account_move_line where period_id=%d and journal_id=%d and state<>\'draft\'', (period_id, journal_id))
return self.cr.fetchone()[0] or 0.0
report_sxw.report_sxw('report.account.journal.period.print', 'account.journal.period', 'addons/account/report/account_journal.rml', parser=journal_print,header=False)
report_sxw.report_sxw('report.account.journal.period.print.wiz', 'account.journal.period', 'addons/account/report/wizard_account_journal.rml', parser=journal_print,header=False)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,3 +1,24 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import time
import pooler
import rml_parse

View File

@ -1,27 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2006 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
@ -31,13 +26,13 @@ import rml_parse
from report import report_sxw
class aged_trial_report(rml_parse.rml_parse):
def __init__(self, cr, uid, name, context):
super(aged_trial_report, self).__init__(cr, uid, name, context)
self.line_query = ''
self.total_account = []
self.localcontext.update({
'time': time,
'get_lines': self._get_lines,
@ -46,19 +41,19 @@ class aged_trial_report(rml_parse.rml_parse):
'get_for_period': self._get_for_period,
'get_company': self._get_company,
'get_currency': self._get_currency,
})
def _get_lines(self, form):
if (form['result_selection'] == 'customer' ):
self.ACCOUNT_TYPE = "('receivable')"
elif (form['result_selection'] == 'supplier'):
self.ACCOUNT_TYPE = "('payable')"
else:
self.ACCOUNT_TYPE = "('payable','receivable')"
res = []
account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line')
@ -78,7 +73,7 @@ class aged_trial_report(rml_parse.rml_parse):
for i in range(7):
self.total_account.append(0)
#
for partner in partners:
values = {}
## If choise selection is in the future
@ -94,7 +89,7 @@ class aged_trial_report(rml_parse.rml_parse):
"AND account_account.active",
(form['date1'], partner['id'],form['date1'], form['company_id']))
before = self.cr.fetchone()
self.total_account[6] = self.total_account[6] + (before and before[0] or 0.0)
values['direction'] = before and before[0] or 0.0
@ -112,7 +107,6 @@ class aged_trial_report(rml_parse.rml_parse):
after = self.cr.fetchone()
self.total_account[6] = self.total_account[6] + (after and after[0] or 0.0)
values['direction'] = after and after[0] or ""
#print str(values['direction'])
for i in range(5):
self.cr.execute("SELECT SUM(debit-credit) " \
"FROM account_move_line AS line, account_account " \
@ -128,8 +122,6 @@ class aged_trial_report(rml_parse.rml_parse):
during = self.cr.fetchone()
# Ajout du compteur
self.total_account[(i)] = self.total_account[(i)] + (during and during[0] or 0)
#print str(during)
values[str(i)] = during and during[0] or ""
self.cr.execute("SELECT SUM(debit-credit) " \
"FROM account_move_line AS line, account_account " \
@ -145,19 +137,16 @@ class aged_trial_report(rml_parse.rml_parse):
values['total'] = total and total[0] or 0.0
## Add for total
self.total_account[(i+1)] = self.total_account[(i+1)] + (total and total[0] or 0.0)
print self.total_account,">>>>>>>>>>>>>Total>>>>>>>>>>>>>>>>"
values['name'] = partner['name']
#t = 0.0
#for i in range(5)+['direction']:
# t+= float(values.get(str(i), 0.0) or 0.0)
#values['total'] = t
if values['total']:
res.append(values)
total = 0.0
totals = {}
for r in res:
total += float(r['total'] or 0.0)
@ -166,24 +155,17 @@ class aged_trial_report(rml_parse.rml_parse):
totals[str(i)] += float(r[str(i)] or 0.0)
return res
def _get_total(self,pos):
print self.total_account,"========_get_total========"
period = self.total_account[int(pos)]
return period
return period
def _get_direction(self,pos):
period = self.total_account[int(pos)]
return period
return period
def _get_for_period(self,pos):
period = self.total_account[int(pos)]
return period
return period
def _get_company(self, form):
return pooler.get_pool(self.cr.dbname).get('res.company').browse(self.cr, self.uid, form['company_id']).name
@ -194,5 +176,5 @@ class aged_trial_report(rml_parse.rml_parse):
report_sxw.report_sxw('report.account.aged_trial_balance', 'res.partner',
'addons/account/report/aged_trial_balance.rml',parser=aged_trial_report,header=False)

View File

@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# $Id$
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
@ -43,20 +35,33 @@ class journal_print(report_sxw.rml_parse):
'sum_debit': self._sum_debit,
'sum_credit': self._sum_credit
})
def lines(self, period_id, journal_id, *args):
if type(period_id)==type([]):
ids_final = []
for journal in journal_id:
for period in period_id:
ids_journal_period = self.pool.get('account.journal.period').search(self.cr,self.uid, [('journal_id','=',journal),('period_id','=',period)])
if ids_journal_period:
self.cr.execute('select a.code, a.name, sum(debit) as debit, sum(credit) as credit from account_move_line l left join account_account a on (l.account_id=a.id) where l.period_id=%d and l.journal_id=%d and l.state<>\'draft\' group by a.id, a.code, a.name, l.journal_id, l.period_id', (period, journal))
res = self.cr.dictfetchall()
a = {'journal':self.pool.get('account.journal').browse(self.cr, self.uid, journal),'period':self.pool.get('account.period').browse(self.cr, self.uid, period)}
res[0].update(a)
ids_final.append(res)
return ids_final
self.cr.execute('select a.code, a.name, sum(debit) as debit, sum(credit) as credit from account_move_line l left join account_account a on (l.account_id=a.id) where l.period_id=%d and l.journal_id=%d and l.state<>\'draft\' group by a.id, a.code, a.name', (period_id, journal_id))
return self.cr.dictfetchall()
res = self.cr.dictfetchall()
return res
def _sum_debit(self, period_id, journal_id):
self.cr.execute('select sum(debit) from account_move_line where period_id=%d and journal_id=%d and state<>\'draft\'', (period_id, journal_id))
return self.cr.fetchone()[0] or 0.0
def _sum_credit(self, period_id, journal_id):
self.cr.execute('select sum(credit) from account_move_line where period_id=%d and journal_id=%d and state<>\'draft\'', (period_id, journal_id))
return self.cr.fetchone()[0] or 0.0
report_sxw.report_sxw('report.account.central.journal', 'account.journal.period', 'addons/account/report/central_journal.rml',parser=journal_print, header=False)
report_sxw.report_sxw('report.account.central.journal.wiz', 'account.journal.period', 'addons/account/report/wizard_central_journal.rml',parser=journal_print, header=False)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -10,7 +10,7 @@
<!--COL 1-->
<drawString x="1.0cm" y="28.1cm">[[ company.name ]]</drawString>
<drawRightString x="20cm" y="28.1cm">Central Journal-[[ company.currency_id.name ]]</drawRightString>
<drawRightString x="20cm" y="28.1cm">Central Journal - [[ company.currency_id.name ]]</drawRightString>
<!-- Header -->
@ -103,13 +103,13 @@
<paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
@ -162,13 +162,13 @@
<blockTable colWidths="180.0,180.0,180.0" style="Table_Subheader_Content_detail">
<tr>
<td>
<para style="terp_tblheader_General_Centre">[[ o.journal_id.code or '' ]]</para>
<para style="terp_default_Centre_8">[[ o.journal_id.code or '' ]]</para>
</td>
<td>
<para style="terp_tblheader_General_Centre">[[ o.journal_id.name ]]</para>
<para style="terp_default_Centre_8">[[ o.journal_id.name ]]</para>
</td>
<td>
<para style="terp_tblheader_General_Centre">[[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]]</para>
<para style="terp_default_Centre_8">[[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]]</para>
</td>
</tr>
</blockTable>

View File

@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# $Id$
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
@ -66,38 +58,73 @@ class journal_print(report_sxw.rml_parse):
return not res
filtered_objs = filter(filter_unique, journal_period_objs)
return map(lambda x: x.period_id, filtered_objs)
def lines(self, period_id):
def lines(self, period_id, journal_id=[]):
if type(period_id)==type([]):
ids_final = []
for journal in journal_id:
for period in period_id:
ids_journal_period = self.pool.get('account.journal.period').search(self.cr,self.uid, [('journal_id','=',journal),('period_id','=',period)])
if ids_journal_period:
ids_final.append(ids_journal_period[0])
data_jour_period = self.pool.get('account.journal.period').browse(self.cr, self.uid, ids_final)
lines_data = []
periods = []
for data in data_jour_period:
if not data.period_id.id in periods:
periods.append(data.period_id.id)
for period in periods:
period_data = self.pool.get('account.period').browse(self.cr, self.uid, period)
self.cr.execute('select j.code, j.name, sum(l.debit) as debit, sum(l.credit) as credit from account_move_line l left join account_journal j on (l.journal_id=j.id) where period_id=%d and journal_id in (' + ','.join(map(str, journal_id)) + ') and l.state<>\'draft\' group by j.id, j.code, j.name', (period,))
res = self.cr.dictfetchall()
res[0].update({'period_name':period_data.name})
res[0].update({'pid':period})
lines_data.append(res)
return lines_data
if not self.journal_ids:
return []
self.cr.execute('select j.code, j.name, sum(l.debit) as debit, sum(l.credit) as credit from account_move_line l left join account_journal j on (l.journal_id=j.id) where period_id=%d and journal_id in (' + self.journal_ids + ') and l.state<>\'draft\' group by j.id, j.code, j.name', (period_id,))
return self.cr.dictfetchall()
def _sum_debit_period(self, period_id):
res = self.cr.dictfetchall()
return res
def _sum_debit_period(self, period_id,journal_id=None):
if type(journal_id)==type([]):
self.cr.execute('select sum(debit) from account_move_line where period_id=%d and journal_id in (' + ','.join(map(str, journal_id)) + ') and state<>\'draft\'', (period_id,))
return self.cr.fetchone()[0] or 0.0
if not self.journal_ids:
return 0.0
self.cr.execute('select sum(debit) from account_move_line where period_id=%d and journal_id in (' + self.journal_ids + ') and state<>\'draft\'', (period_id,))
return self.cr.fetchone()[0] or 0.0
def _sum_credit_period(self, period_id):
def _sum_credit_period(self, period_id,journal_id=None):
if type(journal_id)==type([]):
self.cr.execute('select sum(credit) from account_move_line where period_id=%d and journal_id in (' + ','.join(map(str, journal_id)) + ') and state<>\'draft\'', (period_id,))
return self.cr.fetchone()[0] or 0.0
if not self.journal_ids:
return 0.0
self.cr.execute('select sum(credit) from account_move_line where period_id=%d and journal_id in (' + self.journal_ids + ') and state<>\'draft\'', (period_id,))
return self.cr.fetchone()[0] or 0.0
def _sum_debit(self):
def _sum_debit(self,period_id=None,journal_id=None):
if type(period_id)==type([]):
self.cr.execute('select sum(debit) from account_move_line where period_id in (' + ','.join(map(str, period_id)) + ') and journal_id in (' + ','.join(map(str, journal_id)) + ') and state<>\'draft\'')
return self.cr.fetchone()[0] or 0.0
if not self.journal_ids or not self.period_ids:
return 0.0
self.cr.execute('select sum(debit) from account_move_line where period_id in (' + self.period_ids + ') and journal_id in (' + self.journal_ids + ') and state<>\'draft\'')
return self.cr.fetchone()[0] or 0.0
def _sum_credit(self):
def _sum_credit(self,period_id=None,journal_id=None):
if type(period_id)==type([]):
self.cr.execute('select sum(credit) from account_move_line where period_id in (' + ','.join(map(str, period_id)) + ') and journal_id in (' + ','.join(map(str, journal_id)) + ') and state<>\'draft\'')
return self.cr.fetchone()[0] or 0.0
if not self.journal_ids or not self.period_ids:
return 0.0
self.cr.execute('select sum(credit) from account_move_line where period_id in (' + self.period_ids + ') and journal_id in (' + self.journal_ids + ') and state<>\'draft\'')
return self.cr.fetchone()[0] or 0.0
report_sxw.report_sxw('report.account.general.journal', 'account.journal.period', 'addons/account/report/general_journal.rml',parser=journal_print, header=False)
report_sxw.report_sxw('report.account.general.journal.wiz', 'account.journal.period', 'addons/account/report/wizard_general_journal.rml',parser=journal_print, header=False)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -82,13 +82,13 @@
<paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
@ -130,7 +130,7 @@
<para style="terp_default_Bold_9">Printing Date :</para>
</td>
<td>
<para style="terp_default_Bold_9">[[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]]</para>
<para style="terp_default_9">[[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]]</para>
</td>
</tr>
</blockTable>

View File

@ -32,6 +32,7 @@ from report import report_sxw
import xml
import rml_parse
import pooler
from osv import osv
class general_ledger(rml_parse.rml_parse):
_name = 'report.account.general.ledger'
@ -40,7 +41,11 @@ class general_ledger(rml_parse.rml_parse):
def preprocess(self, objects, data, ids):
##
self.borne_date = self.get_min_date(data['form'])
##
new_ids = []
if (data['model'] == 'account.account'):
@ -54,6 +59,7 @@ class general_ledger(rml_parse.rml_parse):
def __init__(self, cr, uid, name, context):
super(general_ledger, self).__init__(cr, uid, name, context)
self.date_borne = {}
self.query = ""
self.child_ids = ""
self.tot_currency = 0.0
@ -109,28 +115,35 @@ class general_ledger(rml_parse.rml_parse):
return result
def get_children_accounts(self, account, form):
self.child_ids = self.pool.get('account.account').search(self.cr, self.uid,
[('parent_id', 'child_of', self.ids)])
res = []
ctx = self.context.copy()
## We will make the test for period or date
## We will now make the test
#
if form.has_key('fiscalyear'):
if form.has_key('fiscalyear'):
ctx['fiscalyear'] = form['fiscalyear']
ctx['periods'] = form['periods'][0][2]
else:
ctx['date_from'] = form['date_from']
ctx['date_to'] = form['date_to']
##
#
#
self.query = self.pool.get('account.move.line')._query_get(self.cr, self.uid, context=ctx)
for child_id in self.pool.get('account.account').search(self.cr, self.uid,
[('parent_id', 'child_of', [account.id])]):
child_account = self.pool.get('account.account').browse(self.cr, self.uid, child_id)
sold_account = self._sum_solde_account(child_account,form)
self.sold_accounts[child_account.id] = sold_account
if form['display_account'] == 'bal_mouvement':
if child_account.type != 'view' \
and len(self.pool.get('account.move.line').search(self.cr, self.uid,
@ -148,21 +161,30 @@ class general_ledger(rml_parse.rml_parse):
else:
if child_account.type != 'view' \
and len(self.pool.get('account.move.line').search(self.cr, self.uid,
[('account_id','=',child_account.id)],
[('account_id','>=',child_account.id)],
context=ctx)) <> 0 :
res.append(child_account)
##
if form['soldeinit']:
## We will now compute solde initiaux
## We will now compute solde initiaux
if not len(res):
return[account]
else:
for move in res:
SOLDEINIT = "SELECT sum(l.debit) AS sum_debit, sum(l.credit) AS sum_credit FROM account_move_line l WHERE l.account_id = " + str(move.id) + " AND l.date < '" + self.borne_date['max_date'] + "'" + " AND l.date > '" + self.borne_date['min_date'] + "'"
SOLDEINIT = "SELECT sum(l.debit) AS sum_debit, sum(l.credit) AS sum_credit FROM account_move_line l WHERE l.account_id = " + str(move.id) + " AND l.date <= '" + self.borne_date['max_date'] + "'" + " AND l.date >= '" + self.borne_date['min_date'] + "'"
self.cr.execute(SOLDEINIT)
resultat = self.cr.dictfetchall()
resultat = self.cr.dictfetchall()
if resultat[0] :
if resultat[0]['sum_debit'] == None:
sum_debit = 0
else:
sum_debit = resultat[0]['sum_debit']
if resultat[0]['sum_credit'] == None:
sum_credit = 0
@ -175,43 +197,78 @@ class general_ledger(rml_parse.rml_parse):
else:
move.init_credit = 0
move.init_debit = 0
##
return res
def get_min_date(self,form):
## Get max born from account_fiscal year
#
sql = """ select min(fy.date_start) from account_fiscalyear
sql = """ select min(fy.date_start) as start_date,max(fy.date_stop) as stop_date from account_fiscalyear
As fy where fy.state <> 'close'
"""
self.cr.execute(sql)
res = self.cr.dictfetchall()
borne_min = res[0]['min']
#
##
if form.has_key('fiscalyear'):
borne_min = res[0]['start_date']
borne_max = res[0]['stop_date']
if form['state'] == 'byperiod':
## This function will return the most aged date
periods = form['periods'][0][2]
if not periods:
sql = """
Select min(p.date_start) from account_period as p where p.fiscalyear_id = """ + str(form['fiscalyear']) + """
Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.fiscalyear_id = """ + str(form['fiscalyear']) + """
"""
else:
periods_id = ','.join(map(str, periods))
sql = """
Select min(p.date_start) from account_period as p where p.id in ( """ + periods_id + """)
Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.id in ( """ + periods_id + """)
"""
self.cr.execute(sql)
res = self.cr.dictfetchall()
borne_max = res[0]['min']
else:
borne_max = form['date_from']
date_borne = {
borne_min = res[0]['start_date']
borne_max = res[0]['stop_date']
elif form['state'] == 'bydate':
borne_min = form['date_from']
borne_max = form['date_to']
elif form['state'] == 'all':
periods = form['periods'][0][2]
if not periods:
sql = """
Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.fiscalyear_id = """ + str(form['fiscalyear']) + """
"""
else:
periods_id = ','.join(map(str, periods))
sql = """
Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.id in ( """ + periods_id + """)
"""
self.cr.execute(sql)
res = self.cr.dictfetchall()
period_min = res[0]['start_date']
period_max = res[0]['stop_date']
date_min = form['date_from']
date_max = form['date_to']
if period_min<date_min:
borne_min = period_min
else :
borne_min = date_min
if date_max<period_max:
borne_max = period_max
else :
borne_max = date_max
elif form['state'] == 'none':
sql = """
SELECT min(date) as start_date,max(date) as stop_date FROM account_move_line """
self.cr.execute(sql)
res = self.cr.dictfetchall()
borne_min = res[0]['start_date']
borne_max = res[0]['stop_date']
self.date_borne = {
'min_date': borne_min,
'max_date': borne_max,
}
return date_borne
return self.date_borne
@ -223,18 +280,27 @@ class general_ledger(rml_parse.rml_parse):
'in_refund': 'SR: ',
}
### We will now compute solde initaux
if form['sortbydate'] == 'sort_date':
sorttag = 'l.date'
else:
sorttag = 'j.code'
sql = """
SELECT l.id, l.date, j.code,c.code AS currency_code,l.amount_currency,l.ref, l.name , l.debit, l.credit, l.period_id
FROM account_move_line l LEFT JOIN res_currency c on (l.currency_id=c.id) JOIN account_journal j on (l.journal_id=j.id)
AND account_id = %d AND %s
ORDER by %s"""%(account.id,self.query,sorttag)
SELECT l.id, l.date, j.code,c.code AS currency_code,l.amount_currency,l.ref, l.name , l.debit, l.credit, l.period_id
FROM account_move_line as l
LEFT JOIN res_currency c on (l.currency_id=c.id)
JOIN account_journal j on (l.journal_id=j.id)
AND account_id = %d
AND %s
WHERE l.date<='%s'
AND l.date>='%s'
ORDER by %s"""%(account.id,self.query,self.date_borne['max_date'],self.date_borne['min_date'],sorttag)
self.cr.execute(sql)
res = self.cr.dictfetchall()
res = self.cr.dictfetchall()
sum = 0.0
account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line')
for l in res:
@ -249,7 +315,7 @@ class general_ledger(rml_parse.rml_parse):
l['partner'] = line.partner_id.name
else :
l['partner'] = ''
sum += l['debit'] - l ['credit']
sum = l['debit'] - l ['credit']
c = time.strptime(l['date'],"%Y-%m-%d")
l['date'] = time.strftime("%d-%m-%Y",c)
l['progress'] = sum

View File

@ -35,16 +35,15 @@
<blockTableStyle id="tbl_header">
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
<blockValign value="TOP"/>
<blockAlignment value="RIGHT" start="2,1" stop="-1,-1"/>
</blockTableStyle>
<blockTableStyle id="tbl_content">
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,1" stop="-1,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,0" stop="-1,-1"/>
<blockValign value="TOP"/>
<blockAlignment value="RIGHT" start="2,1" stop="-1,-1"/>
</blockTableStyle>
@ -91,247 +90,105 @@
<paraStyle name="Index" fontName="Helvetica"/>
</stylesheet>
<story>
<blockTable colWidths="54.0,135.0,70.0,40.0,80.0,59.0,52.0,54.0" style="tbl_header" repeatRows="1">[[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]]
<blockTable colWidths="66.0,124.0,70.0,40.0,80.0,59.0,52.0,54.0" style="tbl_header" repeatRows="1">[[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]]
<tr>
<td>
<para style="P3_centre">Date</para>
</td>
<td>
<para style="P3">Partner</para>
</td>
<td>
<para style="P3">Ref</para>
</td>
<td>
<para style="P3">Mvt</para>
</td>
<td>
<para style="P3">Entry Label</para>
</td>
<td>
<para style="P4">Debit</para>
</td>
<td>
<para style="P4">Crebit</para>
</td>
<td>
<para style="P9">Balance</para>
</td>
<td><para style="date">Date</para></td>
<td><para style="P3">Partner</para></td>
<td><para style="P3">Ref</para></td>
<td><para style="P3">Mvt</para></td>
<td><para style="P3">Entry Label</para></td>
<td><para style="P4">Debit</para></td>
<td><para style="P4">Crebit</para></td>
<td><para style="P9">Balance</para></td>
</tr>
<tr>
<para>[[ repeatIn(objects, 'a') ]]</para>
<para>[[ repeatIn(get_children_accounts(a,data['form']), 'o') ]]</para>
<td>
<blockTable colWidths="48.0,135.0,70.0,40.0,80.0,59.0,52.0,54.0" style="tbl_content">
<tr>
<td>
<blockTable colWidths="273.00,100.0,52.5,52.5,52.5" style="Table5">
<tr>
<td><para style="Standard">[[ o.code ]] [[ o.name ]]</para></td>
<td><para style="Standard"></para></td>
<td alignment="right">
<para style="P9b"><u>[[ sum_debit_account(o, data['form']) or '0.0' ]]</u></para>
</td>
<td alignment="right">
<para style="P9b"><u>[[sum_credit_account(o, data['form']) or '0.0' ]]</u></para>
</td>
<td>
<para style="P9b"><u>[[sum_solde_account(o, data['form']) or '0.0' ]]</u></para>
</td>
<para>[[ repeatIn(objects, 'a') ]]</para>
<para>[[ repeatIn(get_children_accounts(a,data['form']), 'o') ]]</para>
<td>
<blockTable colWidths="280.0,100.0,52.5,52.5,52.5" style="Table5">
<tr>
<td><para style="Standard">[[ o.code or '']] [[ o.name or '']]</para></td>
<td><para style="Standard"></para></td>
<td alignment="right"><para style="P9b"><u>[[ sum_debit_account(o, data['form']) or '0.0' ]]</u></para></td>
<td alignment="right"><para style="P9b"><u>[[sum_credit_account(o, data['form']) or '0.0' ]]</u></para></td>
<td><para style="P9b"><u>[[sum_solde_account(o, data['form']) or '0.0' ]]</u></para></td>
</tr>
<tr>
<td>[[ repeatIn(lines(o, data['form']), 'line') ]]
<blockTable colWidths="54.0,123.0,70.0,40.0,80.0,59.0,52.0,54.0" style="tbl_content">
<tr>
<td><para style="P3">[[ line['date'] or '' ]]</para></td>
<td><para style="P3">[[ line['partner'] or '']]</para></td>
<td><para style="P3">[[ line['ref'] or '']]</para></td>
<td><para style="P3">[[ line['move'] or '']]</para></td>
<td><para style="P3">[[ line['name'] or '' ]]</para></td>
<td><para style="P4">[[ line['debit'] or '0.0' ]]</para></td>
<td><para style="P4">[[ line['credit'] or '0.0' ]]</para></td>
<td><para style="P4">[[ line['progress'] or '0.0' ]]</para></td>
</tr>
</blockTable>
</td>
</tr>
<tr>
[[ data['form']['soldeinit'] == True or removeParentNode('tr') ]]
<td>
<para style="P16"></para>
</td>
<td>
<para style="P3">Balance Initial</para>
</td>
<td>
<para style="P3"></para>
</td>
<td>
<para style="P3"></para>
</td>
<td>
<para style="P3"></para>
</td>
<td>
<para style="P4">[[ o.init_debit or '0.0' ]]</para>
</td>
<td>
<para style="P4">[[ o.init_credit or '0.0' ]]</para>
</td>
<td>
<para style="P4">[[ (o.init_debit - o.init_credit) or '0.0' ]]</para>
</td>
</tr>
<tr>[[ repeatIn(lines(o, data['form']), 'line') ]]
<td>
<para style="P3">[[ line['date'] ]]</para>
</td>
<td>
<para style="P3">[[ line['partner'] ]]</para>
</td>
<td>
<para style="P3">[[ line['ref'] ]]</para>
</td>
<td>
<para style="P3">[[ line['move'] ]]</para>
</td>
<td>
<para style="P3">[[ line['name'] ]]</para>
</td>
<td>
<para style="P4">[[ line['debit'] and line['debit'] or '0.0' ]]</para>
</td>
<td>
<para style="P4">[[ line['credit'] and line['credit'] or '0.0' ]]</para>
</td>
<td>
<para style="P4">[[ line['progress'] and line['progress'] or '0.0' ]]</para>
</td>
</tr>
</blockTable>
</td>
</tr>
</blockTable>
</td>
</tr>
</blockTable>
</td>
</tr>
</blockTable>
<blockTable colWidths="59.0,105.0,66.0,40.0,100.0,50.0,50.0,50.0,40.0" style="tbl_header" repeatRows="1">[[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]]
<tr>
<td>
<para style="P3_centre">Date</para>
</td>
<td>
<para style="P3">Partner</para>
</td>
<td>
<para style="P3">Ref</para>
</td>
<td>
<para style="P3">Mvt</para>
</td>
<td>
<para style="P3">Entry Label</para>
</td>
<td>
<para style="P4">Debit</para>
</td>
<td>
<para style="P4">Crebit</para>
</td>
<td>
<para style="P4">Balance</para>
</td>
<td>
<para style="P4">Currency</para>
</td>
<blockTable colWidths="72.0,93.0,66.0,40.0,100.0,50.0,50.0,50.0,40.0" style="tbl_header" repeatRows="1">[[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]]
<tr>
<td><para style="date">Date</para></td>
<td><para style="P3">Partner</para></td>
<td><para style="P3">Ref</para></td>
<td><para style="P3">Mvt</para></td>
<td><para style="P3">Entry Label</para></td>
<td><para style="P4">Debit</para></td>
<td><para style="P4">Crebit</para></td>
<td><para style="P4">Balance</para></td>
<td><para style="P4">Currency</para></td>
</tr>
<tr>
<para>[[ repeatIn(objects, 'a') ]]</para>
<para>[[ repeatIn(get_children_accounts(a,data['form']), 'o') ]]</para>
<td>
<blockTable colWidths="54.0,105.0,66.0,40.0,100.0,50.0,50.0,50.0,40.0" style="tbl_content" >
<tr>
<td>
<blockTable colWidths="259.00,100.0,50.0,50.0,49.0,40.00" style="Table5">
<tr>
<td><para style="Standard">[[ o.code ]] [[ o.name ]]</para></td>
<td><para style="Standard"></para></td>
<td alignment="right">
<para style="P9b"><u>[[ sum_debit_account(o, data['form']) or '0.0' ]]</u></para>
</td>
<td alignment="right">
<para style="P9b"><u>[[sum_credit_account(o, data['form']) or '0.0' ]]</u></para>
</td>
<td>
<para style="P9b"><u>[[sum_solde_account(o, data['form']) or '0.0' ]]</u></para>
</td>
<td>
<para style="P9b"><u> [[ sum_currency_amount_account(a, data['form']) or '0.0' ]]</u></para>
</td>
</tr>
</blockTable>
</td>
</tr>
<tr>[[ data['form']['soldeinit'] == True or removeParentNode('tr') ]]
<td>
<para style="P16"></para>
</td>
<td>
<para style="P3">Balance Initial</para>
</td>
<td>
<para style="P3"></para>
</td>
<td>
<para style="P3"></para>
</td>
<td>
<para style="P3"></para>
</td>
<td>
<para style="P4">[[ o.init_debit or '0.0' ]]</para>
</td>
<td>
<para style="P4">[[ o.init_credit or '0.0' ]]</para>
</td>
<td>
<para style="P4">[[ (o.init_debit - o.init_credit) or '0.0' ]]</para>
</td>
<td>
<para style="P4"> </para>
</td>
<para>[[ repeatIn(get_children_accounts(a,data['form']), 'o') ]]</para>
<td>
<blockTable colWidths="264.00,100.0,50.0,50.0,49.0,40.00" style="Table5">
<tr>
<td><para style="Standard">[[ o.code or '' ]] [[ o.name or '' ]]</para></td>
<td><para style="Standard"></para></td>
<td alignment="right"><para style="P9b"><u>[[ sum_debit_account(o, data['form']) or '0.0' ]]</u></para></td>
<td alignment="right"><para style="P9b"><u>[[sum_credit_account(o, data['form']) or '0.0' ]]</u></para></td>
<td><para style="P9b"><u>[[sum_solde_account(o, data['form']) or '0.0' ]]</u></para></td>
<td><para style="P9b"><u> [[ sum_currency_amount_account(a, data['form']) or '0.0' ]]</u></para></td>
</tr>
<tr>
<td>[[ repeatIn(lines(o, data['form']), 'line') ]]
<blockTable colWidths="59.0,93.0,66.0,40.0,100.0,50.0,50.0,50.0,40.0" style="tbl_content">
<tr>
<td><para style="P3">[[ line['date'] or '' ]]</para></td>
<td><para style="P3">[[ line['partner'] or '' ]]</para></td>
<td><para style="P3">[[ line['ref'] or '']]</para></td>
<td><para style="P3">[[ line['move'] or '' ]]</para></td>
<td><para style="P3">[[ line['name'] or '' ]]</para></td>
<td><para style="P4">[[ line['debit'] and line['debit'] or '0.0' ]]</para></td>
<td><para style="P4">[[ line['credit'] and line['credit'] or '0.0' ]]</para></td>
<td><para style="P4">[[ line['progress'] and line['progress'] or '0.0' ]]</para></td>
<td><para style="P4">[[ line['amount_currency'] or '0.0' ]] [[ line['currency_code'] or '']]</para></td>
</tr>
</blockTable>
</td>
</tr>
</blockTable>
</td>
</tr>
<tr>[[ repeatIn(lines(o, data['form']), 'line') ]]
<td>
<para style="P3">[[ line['date'] ]]</para>
</td>
<td>
<para style="P3">[[ line['partner'] ]]</para>
</td>
<td>
<para style="P3">[[ line['ref'] ]]</para>
</td>
<td>
<para style="P3">[[ line['move'] ]]</para>
</td>
<td>
<para style="P3">[[ line['name'] ]]</para>
</td>
<td>
<para style="P4">[[ line['debit'] and line['debit'] or '0.0' ]]</para>
</td>
<td>
<para style="P4">[[ line['credit'] and line['credit'] or '0.0' ]]</para>
</td>
<td>
<para style="P4">[[ line['progress'] and line['progress'] or '0.0' ]]</para>
</td>
<td>
<para style="P4">[[ line['amount_currency'] or '0.0' ]] [[ line['currency_code'] ]]</para>
</td>
</tr>
</blockTable>
</td>
</tr>
</blockTable>
</blockTable>
</story>
</document>
</document>

View File

@ -35,8 +35,8 @@ import pooler
class general_ledger_landscape(rml_parse.rml_parse):
_name = 'report.account.general.ledger_landscape'
def preprocess(self, objects, data, ids):
##
self.borne_date = self.get_min_date(data['form'])
@ -46,18 +46,19 @@ class general_ledger_landscape(rml_parse.rml_parse):
new_ids = ids
else:
new_ids.append(data['form']['Account_list'])
objects = self.pool.get('account.account').browse(self.cr, self.uid, new_ids)
super(general_ledger_landscape, self).preprocess(objects, data, new_ids)
super(general_ledger_landscape, self).preprocess(objects, data, new_ids)
def __init__(self, cr, uid, name, context):
super(general_ledger_landscape, self).__init__(cr, uid, name, context)
self.date_borne = {}
self.query = ""
self.child_ids = ""
self.tot_currency = 0.0
self.period_sql = ""
self.sold_accounts = {}
self.sold_accounts = {}
self.localcontext.update( {
'time': time,
'lines': self.lines,
@ -66,7 +67,7 @@ class general_ledger_landscape(rml_parse.rml_parse):
'sum_solde_account': self._sum_solde_account,
'sum_debit': self._sum_debit,
'sum_credit': self._sum_credit,
'sum_solde': self._sum_solde,
'sum_solde': self._sum_solde,
'get_children_accounts': self.get_children_accounts,
'sum_currency_amount_account': self._sum_currency_amount_account
})
@ -75,7 +76,7 @@ class general_ledger_landscape(rml_parse.rml_parse):
result = {}
#for id in ids:
# result.setdefault(id, False)
for account_line in self.pool.get('account.move.line').browse(cr, uid, ids, context):
# For avoid long text in the field we will limit it to 5 lines
#
@ -85,7 +86,7 @@ class general_ledger_landscape(rml_parse.rml_parse):
num_id_move = str(account_line.move_id.id)
num_id_line = str(account_line.id)
account_id = str(account_line.account_id.id)
# search the basic account
# search the basic account
# We have the account ID we will search all account move line from now until this time
# We are in the case of we are on the top of the account move Line
cr.execute('SELECT distinct(ac.code) as code_rest,ac.name as name_rest from account_account AS ac, account_move_line mv\
@ -103,68 +104,102 @@ class general_ledger_landscape(rml_parse.rml_parse):
result[account_line.id] = concat + '...'
break
rup_id+=1
#print str(result)
return result
def get_min_date(self,form):
## Get max born from account_fiscal year
#
sql = """ select min(fy.date_start) from account_fiscalyear
sql = """ select min(fy.date_start) as start_date,max(fy.date_stop) as stop_date from account_fiscalyear
As fy where fy.state <> 'close'
"""
self.cr.execute(sql)
res = self.cr.dictfetchall()
borne_min = res[0]['min']
#
##
if form.has_key('fiscalyear'):
borne_min = res[0]['start_date']
borne_max = res[0]['stop_date']
if form['state'] == 'byperiod':
## This function will return the most aged date
periods = form['periods'][0][2]
if not periods:
sql = """
Select min(p.date_start) from account_period as p where p.fiscalyear_id = """ + str(form['fiscalyear']) + """
Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.fiscalyear_id = """ + str(form['fiscalyear']) + """
"""
else:
else:
periods_id = ','.join(map(str, periods))
sql = """
Select min(p.date_start) from account_period as p where p.id in ( """ + periods_id + """)
Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.id in ( """ + periods_id + """)
"""
self.cr.execute(sql)
res = self.cr.dictfetchall()
borne_max = res[0]['min']
else:
borne_max = form['date_from']
date_borne = {
borne_min = res[0]['start_date']
borne_max = res[0]['stop_date']
elif form['state'] == 'bydate':
borne_min = form['date_from']
borne_max = form['date_to']
elif form['state'] == 'all':
periods = form['periods'][0][2]
if not periods:
sql = """
Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.fiscalyear_id = """ + str(form['fiscalyear']) + """
"""
else:
periods_id = ','.join(map(str, periods))
sql = """
Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.id in ( """ + periods_id + """)
"""
self.cr.execute(sql)
res = self.cr.dictfetchall()
period_min = res[0]['start_date']
period_max = res[0]['stop_date']
date_min = form['date_from']
date_max = form['date_to']
if period_min<date_min:
borne_min = period_min
else :
borne_min = date_min
if date_max<period_max:
borne_max = period_max
else :
borne_max = date_max
elif form['state'] == 'none':
sql = """
SELECT min(date) as start_date,max(date) as stop_date FROM account_move_line """
self.cr.execute(sql)
res = self.cr.dictfetchall()
borne_min = res[0]['start_date']
borne_max = res[0]['stop_date']
self.date_borne = {
'min_date': borne_min,
'max_date': borne_max,
}
return date_borne
return self.date_borne
def get_children_accounts(self, account, form):
self.child_ids = self.pool.get('account.account').search(self.cr, self.uid,
[('parent_id', 'child_of', self.ids)])
#
#
res = []
ctx = self.context.copy()
## We will make the test for period or date
## We will now make the test
#
if form.has_key('fiscalyear'):
if form.has_key('fiscalyear'):
ctx['fiscalyear'] = form['fiscalyear']
ctx['periods'] = form['periods'][0][2]
else:
ctx['date_from'] = form['date_from']
ctx['date_to'] = form['date_to']
##
#
self.query = self.pool.get('account.move.line')._query_get(self.cr, self.uid, context=ctx)
for child_id in self.pool.get('account.account').search(self.cr, self.uid,[('parent_id', 'child_of', [account.id])]):
child_account = self.pool.get('account.account').browse(self.cr, self.uid, child_id)
sold_account = self._sum_solde_account(child_account,form)
@ -175,7 +210,6 @@ class general_ledger_landscape(rml_parse.rml_parse):
[('account_id','=',child_account.id)],
context=ctx)) <> 0 :
res.append(child_account)
#print "Type de vue :" + form['display_account']
elif form['display_account'] == 'bal_solde':
if child_account.type != 'view' \
and len(self.pool.get('account.move.line').search(self.cr, self.uid,
@ -183,14 +217,17 @@ class general_ledger_landscape(rml_parse.rml_parse):
context=ctx)) <> 0 :
if ( sold_account <> 0.0):
res.append(child_account)
else:
else:
if child_account.type != 'view' \
and len(self.pool.get('account.move.line').search(self.cr, self.uid,
[('account_id','=',child_account.id)],
[('account_id','>=',child_account.id)],
context=ctx)) <> 0 :
res.append(child_account)
##
if form['soldeinit']:
if not len(res):
return [account]
else:
## We will now compute solde initiaux
for move in res:
SOLDEINIT = "SELECT sum(l.debit) AS sum_debit, sum(l.credit) AS sum_credit FROM account_move_line l WHERE l.account_id = " + str(move.id) + " AND l.date < '" + self.borne_date['max_date'] + "'" + " AND l.date > '" + self.borne_date['min_date'] + "'"
@ -205,17 +242,17 @@ class general_ledger_landscape(rml_parse.rml_parse):
sum_credit = 0
else:
sum_credit = resultat[0]['sum_credit']
move.init_credit = sum_credit
move.init_debit = sum_debit
else:
move.init_credit = 0
move.init_debit = 0
##
return res
def lines(self, account, form):
inv_types = {
'out_invoice': 'CI: ',
@ -229,11 +266,18 @@ class general_ledger_landscape(rml_parse.rml_parse):
else:
sorttag = 'j.code'
sql = """
SELECT l.id, l.date, j.code,c.code AS currency_code,l.amount_currency,l.ref, l.name, l.debit, l.credit, l.period_id
FROM account_move_line l LEFT JOIN res_currency c on (l.currency_id=c.id) JOIN account_journal j on (l.journal_id=j.id)
AND account_id = %d AND %s
ORDER by %s"""%(account.id,self.query,sorttag)
SELECT l.id, l.date, j.code,c.code AS currency_code,l.amount_currency,l.ref, l.name , l.debit, l.credit, l.period_id
FROM account_move_line as l
LEFT JOIN res_currency c on (l.currency_id=c.id)
JOIN account_journal j on (l.journal_id=j.id)
AND account_id = %d
AND %s
WHERE l.date<='%s'
AND l.date>='%s'
ORDER by %s"""%(account.id,self.query,self.date_borne['max_date'],self.date_borne['min_date'],sorttag)
self.cr.execute(sql)
res = self.cr.dictfetchall()
sum = 0.0
account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line')
@ -249,7 +293,10 @@ class general_ledger_landscape(rml_parse.rml_parse):
l['partner'] = line.partner_id.name
else :
l['partner'] = ''
sum += l['debit'] - l ['credit']
sum = l['debit'] - l ['credit']
c = time.strptime(l['date'],"%Y-%m-%d")
l['date'] = time.strftime("%d-%m-%Y",c)
l['progress'] = sum
@ -258,11 +305,11 @@ class general_ledger_landscape(rml_parse.rml_parse):
if (l['credit'] > 0):
if l['amount_currency'] != None:
l['amount_currency'] = abs(l['amount_currency']) * -1
#
if l['amount_currency'] != None:
self.tot_currency = self.tot_currency + l['amount_currency']
self.tot_currency = self.tot_currency + l['amount_currency']
return res
def _sum_debit_account(self, account, form):
@ -291,7 +338,7 @@ class general_ledger_landscape(rml_parse.rml_parse):
sum_credit += account.init_credit
#
##
return sum_credit
def _sum_solde_account(self, account, form):
@ -301,7 +348,7 @@ class general_ledger_landscape(rml_parse.rml_parse):
sum_solde = self.cr.fetchone()[0] or 0.0
if form['soldeinit']:
sum_solde += account.init_debit - account.init_credit
return sum_solde
def _sum_debit(self, form):
@ -330,31 +377,24 @@ class general_ledger_landscape(rml_parse.rml_parse):
self.cr.execute("SELECT (sum(debit) - sum(credit)) as tot_solde "\
"FROM account_move_line l "\
"WHERE l.account_id in ("+','.join(map(str, self.child_ids))+") AND "+self.query)
# print ("SELECT (sum(debit) - sum(credit)) as Test "\
# "FROM account_move_line l "\
# "WHERE l.account_id in ("+','.join(map(str, child_ids))+") AND "+query+period_sql)
sum_solde = self.cr.fetchone()[0] or 0.0
return sum_solde
def _set_get_account_currency_code(self, account_id):
print"====account_id=====",account_id
self.cr.execute("SELECT c.code as code "\
"FROM res_currency c,account_account as ac "\
"WHERE ac.id = %s AND ac.currency_id = c.id"%(account_id))
result = self.cr.fetchone()
print"====result====",result
if result:
self.account_currency = result[0]
else:
self.account_currency = False
def _sum_currency_amount_account(self, account, form):
self._set_get_account_currency_code(account.id)
self.cr.execute("SELECT sum(aml.amount_currency) FROM account_move_line as aml,res_currency as rc WHERE aml.currency_id = rc.id AND aml.account_id= %d "%account.id)
total = self.cr.fetchone()
if self.account_currency:
return_field = str(total[0]) + self.account_currency
return return_field

432
addons/account/report/general_ledger_landscape.rml Executable file → Normal file
View File

@ -37,14 +37,13 @@
<blockTableStyle id="tbl_header">
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
<blockValign value="TOP"/>
<blockAlignment value="RIGHT" start="2,1" stop="-1,-1"/>
</blockTableStyle>
<blockTableStyle id="tbl_content">
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,1" stop="-1,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,0" stop="-1,-1"/>
<blockValign value="TOP"/>
<blockAlignment value="RIGHT" start="2,1" stop="-1,-1"/>
</blockTableStyle>
@ -92,335 +91,110 @@
<paraStyle name="Index" fontName="Helvetica"/>
</stylesheet>
<story>
<blockTable colWidths="55.0,35.0,150.0, 90.0,60.0,345.0,50.0,69.0,72.0,64.0,58.0" style="tbl_header" repeatRows="1">[[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]]
<blockTable colWidths="66.0,35.0,150.0, 90.0,60.0,335.0,50.0,69.0,72.0,64.0,58.0" style="tbl_header" repeatRows="1">[[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]]
<tr>
<td><para style="P12"><font color="white"> </font></para><para style="date">Date</para></td>
<td><para style="P12"><font color="white"> </font></para><para style="P2">JNRL</para></td>
<td><para style="P12"><font color="white"> </font></para><para style="P2">Partner</para></td>
<td><para style="P12"><font color="white"> </font></para><para style="P2">Ref</para></td>
<td><para style="P12"><font color="white"> </font></para><para style="P2">Mvt</para></td>
<td><para style="P12"><font color="white"> </font></para><para style="P3">Entry Label</para></td>
<td><para style="P12"><font color="white"> </font> </para><para style="P3">Counterpart</para></td>
<td><para style="P12"><font color="white"> </font></para><para style="P4">Debit</para></td>
<td><para style="P12"><font color="white"> </font></para><para style="P4">Credit</para></td>
<td><para style="P12"><font color="white"> </font></para><para style="P4">Balance</para></td>
<td><para style="P12"><font color="white"> </font></para><para style="P4">Currency</para></td>
</tr>
<tr>
<para>[[ repeatIn(objects, 'a') ]]</para>
<para>[[ repeatIn(get_children_accounts(a,data['form']), 'o') ]]</para>
<td>
<blockTable colWidths="404.0,375.0,69.0,72.0,64.0,59.00" style="Table5">
<tr>
<td><para style="Standard">[[ o.code ]] [[ o.name ]]</para></td>
<td><para style="Standard"></para></td>
<td alignment="right"><para style="P9b"><u>[[ sum_debit_account(o, data['form']) or '0.0' ]]</u></para></td>
<td alignment="right"><para style="P9b"><u>[[ sum_credit_account(o, data['form']) or '0.0' ]]</u></para></td>
<td><para style="P9b"><u>[[ sum_solde_account(o, data['form']) or '0.0' ]]</u></para></td>
<td><para style="P9b"><u> [[ sum_currency_amount_account(o, data['form']) or '0.0' ]]</u></para></td>
</tr>
<tr>
<td> [[ repeatIn(lines(o, data['form']), 'line') ]]
<blockTable colWidths="55.0,35.0,150.0, 90.0,60.0,333.0,50.0,69.0,72.0,64.0,58.0" style="tbl_content" >
<tr>
<td><para style="P2_content">[[ line['date'] ]]</para></td>
<td><para style="P2_content">[[ line['code'] ]]</para></td>
<td><para style="P2_content">[[ line['partner'] ]]</para></td>
<td><para style="P2_content">[[ line['ref'] ]]</para></td>
<td><para style="P2_content">[[ line['move'] ]]</para></td>
<td><para style="P3_content">[[ line['name'] ]]</para></td>
<td><para style="P3_content">[[ strip_name(line['line_corresp'],55) ]]</para></td>
<td><para style="P4_content">[[ line['debit'] and line['debit'] or '0.0' ]]</para></td>
<td><para style="P4_content">[[ line['credit'] and line['credit'] or '0.0' ]]</para></td>
<td><para style="P4_content">[[ line['progress'] and line['progress'] or '0.0' ]]</para></td>
<td><para style="P4_content">[[ line['amount_currency'] or '0.0' ]] [[ line['currency_code'] ]]</para></td>
</tr>
</blockTable>
</td>
</tr>
</blockTable>
</td>
</tr>
</blockTable>
<blockTable colWidths="66.0,35.0,166.0,90.0,60.0,378.0,50.0,69.0,72.0,64.0" style="tbl_header" repeatRows="1">[[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]]
<tr>
<td>
<para style="P12"><font color="white"> </font></para>
<para style="date">Date</para>
</td>
<td>
<para style="P12"><font color="white"> </font></para>
<para style="date">JNRL</para>
</td>
<td>
<para style="P12"><font color="white"> </font></para>
<para style="P2">Partner</para>
</td>
<td>
<para style="P12"><font color="white"> </font></para>
<para style="P2">Ref</para>
</td>
<td>
<para style="P12"><font color="white"> </font></para>
<para style="P2">Mvt</para>
</td>
<td>
<para style="P12"><font color="white"> </font></para>
<para style="P3">Entry Label</para>
</td>
<td>
<para style="P12"><font color="white"> </font> </para>
<para style="P3">Counterpart</para>
</td>
<td>
<para style="P12"><font color="white"> </font></para>
<para style="P4">Debit</para>
</td>
<td>
<para style="P12"><font color="white"> </font></para>
<para style="P4">Credit</para>
</td>
<td>
<para style="P12"><font color="white"> </font></para>
<para style="P4">Balance</para>
</td>
<td>
<para style="P12"><font color="white"> </font></para>
<para style="P4">Currency</para>
</td>
<td><para style="P12"><font color="white"> </font></para><para style="date">Date</para></td>
<td><para style="P12"><font color="white"> </font></para><para style="P2">JNRL</para></td>
<td><para style="P12"><font color="white"> </font></para><para style="P2">Partner</para></td>
<td><para style="P12"><font color="white"> </font></para><para style="P2">Ref</para></td>
<td><para style="P12"><font color="white"> </font></para><para style="P2">Mvt</para></td>
<td><para style="P12"><font color="white"> </font></para><para style="P3">Entry Label</para></td>
<td><para style="P12"><font color="white"> </font></para><para style="P3">Counterpart</para></td>
<td><para style="P12"><font color="white"> </font></para><para style="P4">Debit</para></td>
<td><para style="P12"><font color="white"> </font></para><para style="P4">Credit</para></td>
<td><para style="P12"><font color="white"> </font></para><para style="P4">Balance</para></td>
</tr>
<tr>
<para>[[ repeatIn(objects, 'a') ]]</para>
<para>[[ repeatIn(get_children_accounts(a,data['form']), 'o') ]]</para>
<td>
<blockTable colWidths="50.0,35.0,150.0, 90.0,60.0,345.0,50.0,69.0,72.0,64.0,58.0" style="tbl_content" >
<tr>
<td>
<blockTable colWidths="400.0,374.0,69.0,72.0,64.0,59.00" style="Table5">
<tr>
<td><para style="Standard">[[ o.code ]] [[ o.name ]]</para></td>
<td><para style="Standard"></para></td>
<td alignment="right">
<para style="P9b"><u>[[ sum_debit_account(o, data['form']) or '0.0' ]]</u></para>
</td>
<td alignment="right">
<para style="P9b"><u>[[ sum_credit_account(o, data['form']) or '0.0' ]]</u></para>
</td>
<td>
<para style="P9b"><u>[[ sum_solde_account(o, data['form']) or '0.0' ]]</u></para>
</td>
<td>
<para style="P9b"><u> [[ sum_currency_amount_account(o, data['form']) or '0.0' ]]</u></para>
</td>
</tr>
</blockTable>
</td>
</tr>
<tr>[[ data['form']['soldeinit'] == True or removeParentNode('tr') ]]
<para>[[ repeatIn(objects, 'a') ]]</para>
<para>[[ repeatIn(get_children_accounts(a,data['form']), 'o') ]]</para>
<td>
<para style="P3_content">Balance Initial</para>
</td>
<td>
<para style="P3_content"></para>
</td>
<td>
<para style="P3_content"></para>
</td>
<td>
<para style="P3_content"></para>
</td>
<td>
<para style="P3_content"></para>
</td>
<td>
<para style="P3_content"></para>
</td>
<td>
<para style="P3_content"></para>
</td>
<td>
<para style="P4_content">[[ o.init_debit or '0.0' ]]</para>
</td>
<td>
<para style="P4_content">[[ o.init_credit or '0.0' ]]</para>
</td>
<td>
<para style="P4_content">[[ (o.init_debit - o.init_credit) or '0.0' ]]</para>
</td>
<td>
<para style="P4_content"> </para>
</td>
<blockTable colWidths="405.0,435.0,69.0,72.0,64.0" style="Table5">
<tr>
<td><para style="Standard">[[ o.code ]] [[ o.name ]]</para></td>
<td><para style="Standard"></para></td>
<td alignment="right"><para style="P9b"><u>[[ sum_debit_account(o, data['form']) or '0.0']]</u></para></td>
<td alignment="right"><para style="P9b"><u>[[sum_credit_account(o, data['form']) or '0.0']]</u></para></td>
<td><para style="P9b"><u>[[sum_solde_account(o, data['form']) or '0.0' ]]</u></para></td>
</tr>
<tr>
<td> [[ repeatIn(lines(o, data['form']), 'line') ]]
<blockTable colWidths="55.0,35.0,166.0,90.0,60.0,378.0,50.0,69.0,72.0,64.0" style="tbl_content">
<tr>
<td><para style="P2_content">[[ line['date'] ]]</para></td>
<td><para style="P2_content">[[ line['code'] ]]</para></td>
<td><para style="P2_content">[[ line['partner'] ]]</para></td>
<td><para style="P2_content">[[ line['ref'] ]]</para></td>
<td><para style="P2_content">[[ line['move'] ]]</para></td>
<td><para style="P3_content">[[ line['name'] ]]</para></td>
<td><para style="P3_content">[[ strip_name(line['line_corresp'],55) ]]</para></td>
<td><para style="P4_content">[[ line['debit'] and line['debit'] or '0.0' ]]</para></td>
<td><para style="P4_content">[[ line['credit'] and line['credit'] or '0.0' ]]</para></td>
<td><para style="P4_content">[[ line['progress'] and line['progress'] or '0.0' ]]</para></td>
</tr>
</blockTable>
</td>
</tr>
</blockTable>
</td>
</tr>
<tr>
[[ repeatIn(lines(o, data['form']), 'line') ]]
<td>
<para style="P2_content">[[ line['date'] ]]</para>
</td>
<td>
<para style="P2_content">[[ line['code'] ]]</para>
</td>
<td>
<para style="P2_content">[[ line['partner'] ]]</para>
</td>
<td>
<para style="P2_content">[[ line['ref'] ]]</para>
</td>
<td>
<para style="P2_content">[[ line['move'] ]]</para>
</td>
<td>
<para style="P3_content">[[ line['name'] ]]</para>
</td>
<td>
<para style="P3_content">[[ strip_name(line['line_corresp'],55) ]]</para>
</td>
<td>
<para style="P4_content">[[ line['debit'] and line['debit'] or '0.0' ]]</para>
</td>
<td>
<para style="P4_content">[[ line['credit'] and line['credit'] or '0.0' ]]</para>
</td>
<td>
<para style="P4_content">[[ line['progress'] and line['progress'] or '0.0' ]]</para>
</td>
<td>
<para style="P4_content">[[ line['amount_currency'] or '0.0' ]] [[ line['currency_code'] ]]</para>
</td>
</tr>
</blockTable>
</td>
</tr>
</blockTable>
<blockTable colWidths="55.0,35.0,166.0,90.0,60.0,390.0,50.0,69.0,72.0,64.0" style="tbl_header" repeatRows="1">[[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]]
<tr>
<td>
<para style="P12">
<font color="white"> </font>
</para>
<para style="date">Date</para>
</td>
<td>
<para style="P12">
<font color="white"> </font>
</para>
<para style="date">JNRL</para>
</td>
<td>
<para style="P12">
<font color="white"> </font>
</para>
<para style="P2">Partner</para>
</td>
<td>
<para style="P12">
<font color="white"> </font>
</para>
<para style="P2">Ref</para>
</td>
<td>
<para style="P12">
<font color="white"> </font>
</para>
<para style="P2">Mvt</para>
</td>
<td>
<para style="P12">
<font color="white"> </font>
</para>
<para style="P3">Entry Label</para>
</td>
<td>
<para style="P12">
<font color="white"> </font>
</para>
<para style="P3">Counterpart</para>
</td>
<td>
<para style="P12">
<font color="white"> </font>
</para>
<para style="P4">Debit</para>
</td>
<td>
<para style="P12">
<font color="white"> </font>
</para>
<para style="P4">Credit</para>
</td>
<td>
<para style="P12">
<font color="white"> </font>
</para>
<para style="P4">Balance</para>
</td>
</tr>
<tr>
<td>
<para>[[ repeatIn(objects, 'a') ]]</para>
<para>[[ repeatIn(get_children_accounts(a,data['form']), 'o') ]]</para>
<blockTable colWidths="50.0,35.0,196.0, 90.0,30.0,390.0,50.0,69.0,72.0,64.0" style="tbl_content" >[[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]]
<tr>
<td>
<blockTable colWidths="400.0,435.0,69.0,72.0,64.0" style="Table5">
<tr>
<td><para style="Standard">[[ o.code ]] [[ o.name ]]</para></td>
<td><para style="Standard"></para></td>
<td alignment="right">
<para style="P9b"><u>[[ sum_debit_account(o, data['form']) or '0.0']]</u></para>
</td>
<td alignment="right">
<para style="P9b"><u>[[sum_credit_account(o, data['form']) or '0.0']]</u></para>
</td>
<td>
<para style="P9b"><u>[[sum_solde_account(o, data['form']) or '0.0' ]]</u></para>
</td>
</tr>
</blockTable>
</td>
</tr>
<tr>[[ data['form']['soldeinit'] == True or removeParentNode('tr') ]]
<td>
<para style="P3_content"></para>
</td>
<td>
<para style="P3_content">Solde Initial</para>
</td>
<td>
<para style="P3_content"></para>
</td>
<td>
<para style="P3_content"></para>
</td>
<td>
<para style="P3_content"></para>
</td>
<td>
<para style="P3_content"></para>
</td>
<td>
<para style="P3_content"></para>
</td>
<td>
<para style="P4_content">[[ o.init_debit or '0.0' ]]</para>
</td>
<td>
<para style="P4_content">[[ o.init_credit or '0.0' ]]</para>
</td>
<td>
<para style="P4_content">[[ o.init_debit - o.init_credit or '0.0' ]]</para>
</td>
</tr>
<tr>[[ repeatIn(lines(o, data['form']), 'line') ]]
<td>
<para style="P2_content">[[ line['date'] ]]</para>
</td>
<td>
<para style="P2_content">[[ line['code'] ]]</para>
</td>
<td>
<para style="P2_content">[[ line['partner'] ]]</para>
</td>
<td>
<para style="P2_content">[[ line['ref'] ]]</para>
</td>
<td>
<para style="P2_content">[[ line['move'] ]]</para>
</td>
<td>
<para style="P3_content">[[ line['name'] ]]</para>
</td>
<td>
<para style="P3_content">[[ strip_name(line['line_corresp'],55) ]]</para>
</td>
<td>
<para style="P4_content">[[ line['debit'] and line['debit'] or '0.0' ]]</para>
</td>
<td>
<para style="P4_content">[[ line['credit'] and line['credit'] or '0.0' ]]</para>
</td>
<td>
<para style="P4_content">[[ line['progress'] and line['progress'] or '0.0' ]]</para>
</td>
</tr>
</blockTable>
</td>
</tr>
</blockTable>
<para style="P12">
<font color="white"> </font>
</para>
</story>
</blockTable>
</story>
</document>

View File

@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# $Id$
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

View File

@ -203,7 +203,7 @@
<paraStyle name="Caption" fontName="Times-Roman" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="Index" fontName="Times-Roman"/>
<paraStyle name="Heading" fontName="Helvetica" fontSize="15.0" leading="19" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="15.0" leading="15" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_default_8" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="Footer" fontName="Times-Roman"/>
<paraStyle name="Horizontal Line" fontName="Times-Roman" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
@ -259,7 +259,7 @@
</blockTable>
<para style="terp_header">Invoice [[ ((o.type == 'out_invoice' and (o.state == 'open' or o.state == 'paid')) or removeParentNode('para')) and '' ]] [[ o.number ]]</para>
<para style="terp_header">PRO-FORMA [[ ((o.type == 'out_invoice' and o.state == 'proforma') or removeParentNode('para')) and '' ]]</para>
<para style="terp_header">Draft Invoice [[ ((o.type == 'out_invoice' and o.state == 'draft') or removeParentNode('para')) and '' ]]</para>
<para style="terp_header">PRO-FORMA [[ ((o.type == 'out_invoice' and o.state == 'draft') or removeParentNode('para')) and '' ]]</para>
<para style="terp_header">Canceled Invoice [[ ((o.type == 'out_invoice' and o.state == 'cancel') or removeParentNode('para')) and '' ]]</para>
<para style="terp_header">Refund [[ (o.type=='out_refund' or removeParentNode('para')) and '' ]] [[ o.number ]]</para>
<para style="terp_header">Supplier Refund [[ (o.type=='in_refund' or removeParentNode('para')) and '' ]] [[ o.number ]]</para>
@ -276,7 +276,7 @@
<para style="terp_tblheader_General_Centre">Invoice Date</para>
</td>
<td>
<para style="terp_tblheader_General_Centre">Partner Ref.</para>
<para style="terp_tblheader_General_Centre">Partner Code</para>
</td>
</tr>
</blockTable>
@ -314,7 +314,7 @@
<para style="terp_tblheader_Details_Right">Disc. (%)</para>
</td>
<td>
<para style="terp_tblheader_Details_Centre">Price</para>
<para style="terp_tblheader_Details_Right">Price</para>
</td>
</tr>
</blockTable>
@ -411,7 +411,7 @@
<blockTable colWidths="120.0,91.0,29.0" style="Table_eclu_Taxes_Total">
<tr>
<td>
<para style="terp_default_Bold_9">Total (excl. taxes):</para>
<para style="terp_default_Bold_9">Net Total:</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(o.amount_untaxed) ]]</para>
@ -443,7 +443,7 @@
<blockTable colWidths="119.0,93.0,28.0" style="Table_Total_Include_Taxes">
<tr>
<td>
<para style="terp_default_Bold_9">Total (inclu. taxes):</para>
<para style="terp_default_Bold_9">Total:</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(o.amount_total) ]]</para>

View File

@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# $Id$
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

View File

@ -1,27 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2005-2006 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
@ -36,6 +31,7 @@ class partner_balance(report_sxw.rml_parse):
super(partner_balance, self).__init__(cr, uid, name, context)
self.date_lst = []
self.date_lst_string = ''
self.account_ids = ''
self.localcontext.update( {
'time': time,
'lines': self.lines,
@ -65,81 +61,81 @@ class partner_balance(report_sxw.rml_parse):
for date in date_array:
full_str_date.append(str(date))
return full_str_date
#
def transform_period_into_date_array(self,data):
## Get All Period Date
#
# If we have no period we will take all perdio in the FiscalYear.
print"data['form']['periods'][0][2]",data['form']['periods'][0][2]
if not data['form']['periods'][0][2] :
periods_id = self.pool.get('account.period').search(self.cr, self.uid, [('fiscalyear_id','=',data['form']['fiscalyear'])])
else:
periods_id = data['form']['periods'][0][2]
date_array = []
date_array = []
for period_id in periods_id:
period_obj = self.pool.get('account.period').browse(self.cr, self.uid, period_id)
date_array = date_array + self.date_range(period_obj.date_start,period_obj.date_stop)
self.date_lst = date_array
self.date_lst.sort()
def transform_date_into_date_array(self,data):
return_array = self.date_range(data['form']['date1'],data['form']['date2'])
self.date_lst = return_array
self.date_lst.sort()
def transform_both_into_date_array(self,data):
if not data['form']['periods'][0][2] :
periods_id = self.pool.get('account.period').search(self.cr, self.uid, [('fiscalyear_id','=',data['form']['fiscalyear'])])
else:
periods_id = data['form']['periods'][0][2]
date_array = []
date_array = []
for period_id in periods_id:
period_obj = self.pool.get('account.period').browse(self.cr, self.uid, period_id)
date_array = date_array + self.date_range(period_obj.date_start,period_obj.date_stop)
period_start_date = date_array[0]
date_start_date = data['form']['date1']
period_stop_date = date_array[-1]
date_stop_date = data['form']['date2']
if period_start_date<date_start_date:
start_date = period_start_date
else :
start_date = date_start_date
if date_stop_date<period_stop_date:
stop_date = period_stop_date
else :
stop_date = date_stop_date
print"===start_date===",start_date
print"===stop_date===",stop_date
final_date_array = []
final_date_array = final_date_array + self.date_range(start_date,stop_date)
self.date_lst = final_date_array
self.date_lst.sort()
def transform_none_into_date_array(self,data):
print"======transform_none_into_date_array====="
sql = "SELECT min(date) as start_date from account_move_line"
self.cr.execute(sql)
start_date = self.cr.fetchone()[0]
sql = "SELECT max(date) as start_date from account_move_line"
self.cr.execute(sql)
stop_date = self.cr.fetchone()[0]
print"stop_date",stop_date
array = []
array = array + self.date_range(start_date,stop_date)
self.date_lst = array
self.date_lst.sort()
def comma_me(self,amount):
if type(amount) is float :
amount = str('%.2f'%amount)
@ -153,27 +149,27 @@ class partner_balance(report_sxw.rml_parse):
return new
else:
return self.comma_me(new)
def preprocess(self, objects, data, ids):
# Transformation des date
#
#
if data['form']['state'] == 'none':
print"========none=========="
self.transform_none_into_date_array(data)
elif data['form']['state'] == 'bydate':
print"========bydate=========="
self.transform_date_into_date_array(data)
elif data['form']['state'] == 'byperiod':
print"========byperiod=========="
self.transform_period_into_date_array(data)
elif data['form']['state'] == 'all':
print"========both=========="
self.transform_both_into_date_array(data)
# if data['form']['fiscalyear']:
self.transform_both_into_date_array(data)
# if data['form']['fiscalyear']:
# print"data['form']['fiscalyear']=True"
# self.transform_period_into_date_array(data)
# else:
@ -191,16 +187,15 @@ class partner_balance(report_sxw.rml_parse):
else:
self.ACCOUNT_TYPE = "('payable','receivable')"
#
self.cr.execute('SELECT a.id ' \
'FROM account_account a ' \
'LEFT JOIN account_account_type t ' \
'ON (a.type = t.code) ' \
'WHERE t.partner_account = TRUE ' \
'AND a.company_id = %d ' \
'AND a.type IN ' + self.ACCOUNT_TYPE + " " \
'AND a.active', (data['form']['company_id'],))
self.cr.execute("SELECT a.id " \
"FROM account_account a " \
"LEFT JOIN account_account_type t " \
"ON (a.type = t.code) " \
"WHERE a.company_id = %d " \
"AND a.type IN " + self.ACCOUNT_TYPE + " " \
"AND a.active", (data['form']['company_id'],))
self.account_ids = ','.join([str(a) for (a,) in self.cr.fetchall()])
super(partner_balance, self).preprocess(objects, data, ids)
def lines(self,data):
@ -213,7 +208,8 @@ class partner_balance(report_sxw.rml_parse):
#
#
if data['form']['soldeinit'] :
print"=====self.date_lst[0]=====",self.date_lst[0]
self.cr.execute(
"SELECT p.ref, p.name,l.account_id,ac.name as account_name,ac.code as code , sum(debit) as debit, sum(credit) as credit, " \
"CASE WHEN sum(debit) > sum(credit) " \
@ -232,20 +228,19 @@ class partner_balance(report_sxw.rml_parse):
") AS enlitige " \
"FROM account_move_line l LEFT JOIN res_partner p ON (l.partner_id=p.id) " \
"JOIN account_account ac ON (l.account_id = ac.id)" \
"WHERE " \
# " account_id IN (" + self.account_ids + ") " \
"l.date < %s AND l.reconcile_id IS NULL " \
"WHERE ac.type IN " + self.ACCOUNT_TYPE + " " \
"AND l.date < %s AND l.reconcile_id IS NULL " \
"GROUP BY p.id, p.ref, p.name,l.account_id,ac.name,ac.code " \
"ORDER BY l.account_id,p.name",
(self.date_lst[0],self.date_lst[0]))
res = self.cr.dictfetchall()
for r in res:
full_account.append(r)
#
#
#
#
self.cr.execute(
"SELECT p.ref,l.account_id,ac.name as account_name,ac.code as code ,p.name, sum(debit) as debit, sum(credit) as credit, " \
"CASE WHEN sum(debit) > sum(credit) " \
@ -264,16 +259,15 @@ class partner_balance(report_sxw.rml_parse):
") AS enlitige " \
"FROM account_move_line l LEFT JOIN res_partner p ON (l.partner_id=p.id) " \
"JOIN account_account ac ON (l.account_id = ac.id)" \
"WHERE " \
# " account_id IN (" + self.account_ids + ") " \
" l.date IN (" + self.date_lst_string + ") " \
"WHERE ac.type IN " + self.ACCOUNT_TYPE + " " \
"AND l.date IN (" + self.date_lst_string + ") " \
"GROUP BY p.id, p.ref, p.name,l.account_id,ac.name,ac.code " \
"ORDER BY l.account_id,p.name")
res = self.cr.dictfetchall()
print "============ res",res
for r in res:
full_account.append(r)
## We will now compute Total
return self._add_subtotal(full_account)
@ -309,7 +303,7 @@ class partner_balance(report_sxw.rml_parse):
#
r['type'] = 1
r['balance'] = float(r['sdebit']) - float(r['scredit'])
completearray.append(r)
#
tot_debit = r['debit']
@ -325,7 +319,7 @@ class partner_balance(report_sxw.rml_parse):
# new_tot['ref'] = 'Total'
# new_tot['name'] = cleanarray[i-1]['account_name']
# new_tot['code'] = cleanarray[i-1]['code']
#
#
# new_tot['debit'] = tot_debit
# new_tot['credit'] = tot_credit
# new_tot['scredit'] = tot_scredit
@ -335,6 +329,9 @@ class partner_balance(report_sxw.rml_parse):
# new_tot['type'] = 3
# ##
# completearray.append(new_tot)
new_header['debit'] = tot_debit
new_header['credit'] = tot_credit
new_header['scredit'] = tot_scredit
@ -342,7 +339,7 @@ class partner_balance(report_sxw.rml_parse):
new_header['enlitige'] = tot_enlitige
new_header['balance'] = float(tot_sdebit) - float(tot_scredit)
new_header['type'] = 3
# we reset the counter
# we reset the counter
tot_debit = r['debit']
tot_credit = r['credit']
tot_scredit = r['scredit']
@ -363,33 +360,52 @@ class partner_balance(report_sxw.rml_parse):
new_header['type'] = 3
##
##
completearray.append(new_header)
##
##
#
r['type'] = 1
#
r['balance'] = float(r['sdebit']) - float(r['scredit'])
#
print "=========r",r
completearray.append(r)
if cleanarray[i]['account_id'] == cleanarray[i-1]['account_id']:
# we reset the counter
# we reset the counter
new_header['debit'] = tot_debit
new_header['credit'] = tot_credit
new_header['scredit'] = tot_scredit
new_header['sdebit'] = tot_sdebit
new_header['enlitige'] = tot_enlitige
new_header['balance'] = float(tot_sdebit) - float(tot_scredit)
new_header['type'] = 3
tot_debit = tot_debit + r['debit']
tot_credit = tot_credit + r['credit']
tot_scredit = tot_scredit + r['scredit']
tot_sdebit = tot_sdebit + r['sdebit']
tot_enlitige = tot_enlitige + (r['enlitige'] or 0.0)
new_header['debit'] = tot_debit
new_header['credit'] = tot_credit
new_header['scredit'] = tot_scredit
new_header['sdebit'] = tot_sdebit
new_header['enlitige'] = tot_enlitige
new_header['balance'] = float(tot_sdebit) - float(tot_scredit)
#
r['type'] = 2
#
r['balance'] = float(r['sdebit']) - float(r['scredit'])
#
completearray.append(r)
i = i + 1
return completearray
@ -400,58 +416,54 @@ class partner_balance(report_sxw.rml_parse):
result_tmp = 0.0
#
#
if data['form']['soldeinit'] :
self.cr.execute(
'SELECT sum(debit) ' \
'FROM account_move_line AS l ' \
'WHERE ' \
# ' account_id IN (' + self.account_ids + ') ' \
' l.reconcile_id IS NULL ' \
'AND date < %s ',
"SELECT sum(debit) " \
"FROM account_move_line AS l " \
"WHERE l.account_id IN (" + self.account_ids + ") " \
"AND l.reconcile_id IS NULL " \
"AND date < %s ",
(self.date_lst[0],))
result_tmp = float(self.cr.fetchone()[0] or 0.0)
#
#
self.cr.execute(
'SELECT sum(debit) ' \
'FROM account_move_line AS l ' \
'WHERE ' \
# ' account_id IN (' + self.account_ids + ') ' \
' l.date IN (' + self.date_lst_string + ') ' )
"SELECT sum(debit) " \
"FROM account_move_line AS l " \
"WHERE l.account_id IN (" + self.account_ids + ") " \
"AND l.date IN (" + self.date_lst_string + ") " )
result_tmp = result_tmp + float(self.cr.fetchone()[0] or 0.0)
return result_tmp
def _sum_credit(self,data):
if not self.ids:
return 0.0
account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line')
result_tmp = 0.0
#
#
if data['form']['soldeinit'] :
self.cr.execute(
'SELECT sum(credit) ' \
'FROM account_move_line AS l ' \
'WHERE ' \
# ' account_id IN (' + self.account_ids + ') ' \
' l.reconcile_id IS NULL ' \
'AND date < %s ' ,
"SELECT sum(credit) " \
"FROM account_move_line AS l " \
"WHERE l.account_id IN (" + self.account_ids + ") " \
"AND l.reconcile_id IS NULL " \
"AND l.date < %s " ,
(self.date_lst[0],))
result_tmp = float(self.cr.fetchone()[0] or 0.0)
#
#
self.cr.execute(
'SELECT sum(credit) ' \
'FROM account_move_line AS l ' \
'WHERE ' \
# ' account_id IN (' + self.account_ids + ') ' \
' l.date IN (' + self.date_lst_string + ') ' )
"SELECT sum(credit) " \
"FROM account_move_line AS l " \
"WHERE l.account_id IN (" + self.account_ids + ") " \
"AND l.date IN (" + self.date_lst_string + ") " )
result_tmp = result_tmp + float(self.cr.fetchone()[0] or 0.0)
return result_tmp
def _sum_litige(self,data):
@ -459,31 +471,29 @@ class partner_balance(report_sxw.rml_parse):
return 0.0
account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line')
result_tmp = 0.0
#
#
if data['form']['soldeinit'] :
self.cr.execute(
'SELECT sum(debit-credit) ' \
'FROM account_move_line AS l ' \
'WHERE ' \
# ' account_id IN (' + self.account_ids + ') ' \
' l.reconcile_id IS NULL ' \
'AND date < %s ' \
'AND blocked=TRUE ' ,
"SELECT sum(debit-credit) " \
"FROM account_move_line AS l " \
"WHERE l.account_id IN (" + self.account_ids + ") " \
"AND l.reconcile_id IS NULL " \
"AND l.date < %s " \
"AND l.blocked=TRUE " ,
(self.date_lst[0],))
result_tmp = float(self.cr.fetchone()[0] or 0.0)
#
#
self.cr.execute(
'SELECT sum(debit-credit) ' \
'FROM account_move_line AS l ' \
'WHERE ' \
# ' account_id IN (' + self.account_ids + ') ' \
' l.date IN (' + self.date_lst_string + ') ' \
'AND blocked=TRUE ' )
"SELECT sum(debit-credit) " \
"FROM account_move_line AS l " \
"WHERE l.account_id IN (" + self.account_ids + ") " \
"AND l.date IN (" + self.date_lst_string + ") " \
"AND l.blocked=TRUE " )
result_tmp = result_tmp + float(self.cr.fetchone()[0] or 0.0)
return result_tmp
def _sum_sdebit(self,data):
@ -491,23 +501,22 @@ class partner_balance(report_sxw.rml_parse):
return 0.0
account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line')
result_tmp = 0.0
#
#
if data['form']['soldeinit'] :
self.cr.execute(
'SELECT CASE WHEN sum(debit) > sum(credit) ' \
'THEN sum(debit) - sum(credit) ' \
'ELSE 0 ' \
'END ' \
'FROM account_move_line AS l ' \
'WHERE ' \
# ' account_id IN (' + self.account_ids + ') ' \
' date < %s ' \
'AND reconcile_id IS NULL ' \
'GROUP BY partner_id',
"SELECT CASE WHEN sum(debit) > sum(credit) " \
"THEN sum(debit) - sum(credit) " \
"ELSE 0 " \
"END " \
"FROM account_move_line AS l " \
"WHERE l.account_id IN (" + self.account_ids + ") " \
"AND l.date < %s " \
"AND l.reconcile_id IS NULL " \
"GROUP BY l.partner_id",
(self.date_lst[0],))
if self.cr.fetchone() != None:
result_tmp = float(self.cr.fetchone()[0])
else:
@ -515,47 +524,45 @@ class partner_balance(report_sxw.rml_parse):
#
#
self.cr.execute(
'SELECT CASE WHEN sum(debit) > sum(credit) ' \
'THEN sum(debit) - sum(credit) ' \
'ELSE 0 ' \
'END ' \
'FROM account_move_line AS l ' \
'WHERE ' \
# ' account_id IN (' + self.account_ids + ') ' \
'l.date IN (' + self.date_lst_string + ') ' \
'GROUP BY partner_id')
"SELECT CASE WHEN sum(debit) > sum(credit) " \
"THEN sum(debit) - sum(credit) " \
"ELSE 0 " \
"END " \
"FROM account_move_line AS l " \
"WHERE l.account_id IN (" + self.account_ids + ") " \
"AND l.date IN (" + self.date_lst_string + ") " \
"GROUP BY l.partner_id")
a = self.cr.fetchone()[0]
print"====self.cr.fetchone()====",a
if self.cr.fetchone() != None:
result_tmp = result_tmp + (a or 0.0)
else:
result_tmp = 0.0
return result_tmp
return result_tmp
def _sum_scredit(self,data):
if not self.ids:
return 0.0
account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line')
result_tmp = 0.0
#
#
if data['form']['soldeinit'] :
self.cr.execute(
'SELECT CASE WHEN sum(debit) < sum(credit) ' \
'THEN sum(credit) - sum(debit) ' \
'ELSE 0 ' \
'END ' \
'FROM account_move_line AS l ' \
'WHERE ' \
# ' account_id IN (' + self.account_ids + ') ' \
' date <= %s ' \
'AND l.reconcile_id IS NULL ' \
'GROUP BY partner_id',
"SELECT CASE WHEN sum(debit) < sum(credit) " \
"THEN sum(credit) - sum(debit) " \
"ELSE 0 " \
"END " \
"FROM account_move_line AS l " \
"WHERE l.account_id IN (" + self.account_ids + ") " \
"AND l.date <= %s " \
"AND l.reconcile_id IS NULL " \
"GROUP BY l.partner_id",
(self.date_lst[0],))
print"self.cr.fetchone()[0]",self.cr.fetchone()
if self.cr.fetchone() != None:
result_tmp = float(self.cr.fetchone()[0]) or 0.0
else:
@ -563,28 +570,27 @@ class partner_balance(report_sxw.rml_parse):
#
#
self.cr.execute(
'SELECT CASE WHEN sum(debit) < sum(credit) ' \
'THEN sum(credit) - sum(debit) ' \
'ELSE 0 ' \
'END ' \
'FROM account_move_line AS l ' \
'WHERE ' \
# ' account_id IN (' + self.account_ids + ') ' \
'l.date IN (' + self.date_lst_string + ') ' \
'GROUP BY partner_id')
a = self.cr.fetchone()[0]
"SELECT CASE WHEN sum(debit) < sum(credit) " \
"THEN sum(credit) - sum(debit) " \
"ELSE 0 " \
"END " \
"FROM account_move_line AS l " \
"WHERE l.account_id IN (" + self.account_ids + ") " \
"AND l.date IN (" + self.date_lst_string + ") " \
"GROUP BY l.partner_id")
a = self.cr.fetchone()[0] or 0.0
if self.cr.fetchone() != None:
result_tmp = result_tmp + (a or 0.0)
else:
result_tmp = 0.0
return result_tmp
def _solde_balance_debit(self,data):
debit, credit = self._sum_debit(data), self._sum_credit(data)
return debit > credit and debit - credit
def _solde_balance_credit(self,data):
debit, credit = self._sum_debit(data), self._sum_credit(data)
return credit > debit and credit - debit

View File

@ -17,7 +17,7 @@
<!--COL 1-->
<drawString x="1.0cm" y="28.1cm">[[ company.name ]]</drawString>
<drawRightString x="20cm" y="28.1cm">Partnar Balance [[ data['form']['result_selection'] == 'customer' and '/ Débiteur' ]] [[ data['form']['result_selection'] == 'supplier' and '/ Créancier' ]] [[ data['form']['result_selection'] == 'all' and '/ Créancier et Débiteur' ]] [[ company.currency_id.name ]]</drawRightString>
<drawRightString x="20cm" y="28.1cm">Partner Balance [[ data['form']['result_selection'] == 'customer' and '/ Débiteur' ]] [[ data['form']['result_selection'] == 'supplier' and '/ Créancier' ]] [[ data['form']['result_selection'] == 'all' and '/ Créancier et Débiteur' ]] [[ company.currency_id.name ]]</drawRightString>
<!-- Header -->
@ -327,13 +327,13 @@
<para style="P8"><u>[[ sum_credit(data) or '0.0' ]]</u></para>
</td>
<td>
<para style="P8"><u>[[ (sum_scredit(data)-sum_sdebit(data)) or '0.0' ]]</u></para>
<para style="P8"><u>[[ (solde_debit(data)-solde_credit(data)) or '0.0' ]]</u></para>
</td>
<td>
<para style="P8"><u>[[ sum_litige(data) or '0.0' ]]</u></para>
</td>
</tr>
<!--<tr>
<!-- <tr>
<td>
<para style="P7">Balance</para>
</td><td>

View File

@ -1,3 +1,24 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from report import report_sxw
import xml.dom.minidom
import os, time

View File

@ -1,27 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2006 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

View File

@ -102,6 +102,30 @@
<paraStyle name="Caption" fontName="Helvetica" fontSize="1.0" leading="1" spaceBefore="0" spaceAfter="0"/>
<paraStyle name="Index" fontName="Helvetica"/>
<blockTableStyle id="TrLevelaaaaaaaaaaaaaaaaaa">
<blockLeftPadding length="300" start="1,0" stop="1,0"/>
</blockTableStyle>
<blockTableStyle id="TrLevelaaaaaaaaaaaaaaaaa">
<blockLeftPadding length="280" start="1,0" stop="1,0"/>
</blockTableStyle>
<blockTableStyle id="TrLevelaaaaaaaaaaaaaaaa">
<blockLeftPadding length="260" start="1,0" stop="1,0"/>
</blockTableStyle>
<blockTableStyle id="TrLevelaaaaaaaaaaaaaaa">
<blockLeftPadding length="240" start="1,0" stop="1,0"/>
</blockTableStyle>
<blockTableStyle id="TrLevelaaaaaaaaaaaaaa">
<blockLeftPadding length="220" start="1,0" stop="1,0"/>
</blockTableStyle>
<blockTableStyle id="TrLevelaaaaaaaaaaaaa">
<blockLeftPadding length="200" start="1,0" stop="1,0"/>
</blockTableStyle>
<blockTableStyle id="TrLevelaaaaaaaaaaaa">
<blockLeftPadding length="180" start="1,0" stop="1,0"/>
</blockTableStyle>
<blockTableStyle id="TrLevelaaaaaaaaaaa">
<blockLeftPadding length="160" start="1,0" stop="1,0"/>
</blockTableStyle>
<blockTableStyle id="TrLevelaaaaaaaaaa">
<blockLeftPadding length="140" start="1,0" stop="1,0"/>
</blockTableStyle>
@ -135,6 +159,39 @@
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
</blockTableStyle>
<paraStyle
name="Levelaaaaaaaaaaaaaaaaaa"
fontName="Helvetica"
fontSize="8.0" />
<paraStyle
name="Levelaaaaaaaaaaaaaaaaa"
fontName="Helvetica"
fontSize="8.0" />
<paraStyle
name="Levelaaaaaaaaaaaaaaaa"
fontName="Helvetica"
fontSize="8.0" />
<paraStyle
name="Levelaaaaaaaaaaaaaaa"
fontName="Helvetica"
fontSize="8.0" />
<paraStyle
name="Levelaaaaaaaaaaaaaa"
fontName="Helvetica"
fontSize="8.0" />
<paraStyle
name="Levelaaaaaaaaaaaaa"
fontName="Helvetica"
fontSize="8.0" />
<paraStyle
name="Levelaaaaaaaaaaaa"
fontName="Helvetica"
fontSize="8.0" />
<paraStyle
name="Levelaaaaaaaaaaa"
fontName="Helvetica"
fontSize="8.0" />
<paraStyle
name="Levelaaaaaaaaaa"
fontName="Helvetica"

View File

@ -1,27 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2005-2006 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
@ -59,7 +54,7 @@ class third_party_ledger(rml_parse.rml_parse):
for date in date_array:
full_str_date.append(str(date))
return full_str_date
#
def transform_period_into_date_array(self,data):
## Get All Period Date
@ -67,66 +62,61 @@ class third_party_ledger(rml_parse.rml_parse):
periods_id = self.pool.get('account.period').search(self.cr, self.uid, [('fiscalyear_id','=',data['form']['fiscalyear'])])
else:
periods_id = data['form']['periods'][0][2]
date_array = []
date_array = []
for period_id in periods_id:
period_obj = self.pool.get('account.period').browse(self.cr, self.uid, period_id)
date_array = date_array + self.date_range(period_obj.date_start,period_obj.date_stop)
self.date_lst = date_array
self.date_lst.sort()
def transform_date_into_date_array(self,data):
return_array = self.date_range(data['form']['date1'],data['form']['date2'])
self.date_lst = return_array
self.date_lst.sort()
def transform_both_into_date_array(self,data):
if not data['form']['periods'][0][2] :
periods_id = self.pool.get('account.period').search(self.cr, self.uid, [('fiscalyear_id','=',data['form']['fiscalyear'])])
else:
periods_id = data['form']['periods'][0][2]
date_array = []
date_array = []
for period_id in periods_id:
period_obj = self.pool.get('account.period').browse(self.cr, self.uid, period_id)
date_array = date_array + self.date_range(period_obj.date_start,period_obj.date_stop)
period_start_date = date_array[0]
date_start_date = data['form']['date1']
period_stop_date = date_array[-1]
date_stop_date = data['form']['date2']
if period_start_date<date_start_date:
start_date = period_start_date
else :
start_date = date_start_date
if date_stop_date<period_stop_date:
stop_date = period_stop_date
else :
stop_date = date_stop_date
print"start_date",start_date
print"stop_date",stop_date
final_date_array = []
final_date_array = final_date_array + self.date_range(start_date, stop_date)
self.date_lst = final_date_array
self.date_lst.sort()
def transform_none_into_date_array(self,data):
sql = "SELECT min(date) as start_date from account_move_line"
self.cr.execute(sql)
start_date = self.cr.fetchone()[0]
print"start_date",start_date
sql = "SELECT max(date) as start_date from account_move_line"
self.cr.execute(sql)
stop_date = self.cr.fetchone()[0]
print"stop_date",stop_date
array= []
array = array + self.date_range(start_date, stop_date)
self.date_lst = array
self.date_lst.sort()
def comma_me(self,amount):
if type(amount) is float :
amount = str('%.2f'%amount)
@ -145,92 +135,89 @@ class third_party_ledger(rml_parse.rml_parse):
for date_string in self.date_lst:
string_map = date_string + ','
return string_map
def preprocess(self, objects, data, ids):
PARTNER_REQUEST = ''
if (data['model'] == 'res.partner'):
print"data['model']",data['model']
## Si on imprime depuis les partenaires
if ids:
PARTNER_REQUEST = "AND line.partner_id IN (" + ','.join(map(str, ids)) + ")"
# Transformation des date
#
#
# if data['form']['fiscalyear']:
# if data['form']['fiscalyear']:
# self.transform_period_into_date_array(data)
# else:
# self.transform_date_into_date_array(data)
##
if data['form']['state'] == 'none':
print"-----none-----"
self.transform_none_into_date_array(data)
elif data['form']['state'] == 'bydate':
print"-----bydate-------"
self.transform_date_into_date_array(data)
elif data['form']['state'] == 'byperiod':
print"-----byperiod-------"
self.transform_period_into_date_array(data)
elif data['form']['state'] == 'all':
print"-----all-------"
self.transform_both_into_date_array(data)
self.date_lst_string = '\'' + '\',\''.join(map(str,self.date_lst)) + '\''
#
#new_ids = [id for (id,) in self.cr.fetchall()]
if data['form']['result_selection'] == 'supplier':
ACCOUNT_TYPE = "AND a.type='payable' "
self.ACCOUNT_TYPE = "('receivable')"
elif data['form']['result_selection'] == 'customer':
ACCOUNT_TYPE = "AND a.type='receivable' "
self.ACCOUNT_TYPE = "('payable')"
elif data['form']['result_selection'] == 'all':
ACCOUNT_TYPE = "AND (a.type='receivable' OR a.type='payable') "
self.ACCOUNT_TYPE = "('payable','receivable')"
self.cr.execute(
"SELECT a.id " \
"FROM account_account a " \
"LEFT JOIN account_account_type t " \
"ON (a.type=t.code) " \
"WHERE t.partner_account=TRUE " \
"AND a.company_id = %d " \
" " + ACCOUNT_TYPE + " " \
"WHERE a.company_id = %d " \
'AND a.type IN ' + self.ACCOUNT_TYPE + " " \
"AND a.active", (data['form']['company_id'],))
self.account_ids = ','.join([str(a) for (a,) in self.cr.fetchall()])
account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line')
partner_to_use = []
if data['form']['soldeinit'] :
self.cr.execute(
"SELECT DISTINCT line.partner_id " \
"FROM account_move_line AS line, account_account AS account " \
"WHERE line.partner_id IS NOT NULL " \
"AND line.account_id = account.id " \
"AND line.date >= %s " \
"AND line.date <= %s " \
"AND line.reconcile_id IS NULL " \
# "AND line.account_id IN (" + self.account_ids + ") " \
"AND line.account_id IN (" + self.account_ids + ") " \
" " + PARTNER_REQUEST + " " \
"AND account.company_id = %d " \
"AND account.active " ,
(self.date_lst[len(self.date_lst)-1],data['form']['company_id']))
else:
self.cr.execute(
"SELECT DISTINCT line.partner_id " \
"FROM account_move_line AS line, account_account AS account " \
"WHERE line.partner_id IS NOT NULL " \
"AND line.account_id = account.id " \
"AND line.date IN (" + self.date_lst_string + ") " \
(self.date_lst[0],self.date_lst[len(self.date_lst)-1],data['form']['company_id']))
# else:
#
# self.cr.execute(
# "SELECT DISTINCT line.partner_id " \
# "FROM account_move_line AS line, account_account AS account " \
# "WHERE line.partner_id IS NOT NULL " \
# "AND line.account_id = account.id " \
# "AND line.date IN (" + self.date_lst_string + ") " \
# "AND line.account_id IN (" + self.account_ids + ") " \
" " + PARTNER_REQUEST + " " \
"AND account.company_id = %d " \
"AND account.active " ,
(data['form']['company_id']))
res = self.cr.dictfetchall()
for res_line in res:
partner_to_use.append(res_line['partner_id'])
# " " + PARTNER_REQUEST + " " \
# "AND account.company_id = %d " \
# "AND account.active " ,
# (data['form']['company_id']))
res = self.cr.dictfetchall()
for res_line in res:
partner_to_use.append(res_line['partner_id'])
new_ids = partner_to_use
self.partner_ids = ','.join(map(str, new_ids))
objects = self.pool.get('res.partner').browse(self.cr, self.uid, new_ids)
super(third_party_ledger, self).preprocess(objects, data, new_ids)
@ -242,47 +229,50 @@ class third_party_ledger(rml_parse.rml_parse):
RECONCILE_TAG = " "
else:
RECONCILE_TAG = "AND l.reconcile_id IS NULL"
if data['form']['soldeinit'] :
self.cr.execute(
"SELECT l.id,l.date,j.code, l.ref, l.name, l.debit, l.credit " \
"FROM account_move_line l " \
"LEFT JOIN account_journal j " \
"ON (l.journal_id = j.id) " \
"WHERE l.partner_id = %d " \
# if data['form']['soldeinit'] :
#
# self.cr.execute(
# "SELECT l.id,l.date,j.code, l.ref, l.name, l.debit, l.credit " \
# "FROM account_move_line l " \
# "LEFT JOIN account_journal j " \
# "ON (l.journal_id = j.id) " \
# "WHERE l.partner_id = %d " \
# "AND l.account_id IN (" + self.account_ids + ") " \
"AND l.date < %s " \
"AND l.reconcile_id IS NULL "
"ORDER BY l.id",
(partner.id, self.date_lst[0]))
res = self.cr.dictfetchall()
sum = 0.0
for r in res:
sum = r['debit'] - r['credit']
r['progress'] = sum
full_account.append(r)
# "AND l.date <= %s " \
# "AND l.reconcile_id IS NULL "
# "ORDER BY l.id",
# (partner.id, self.date_lst[0]))
# res = self.cr.dictfetchall()
# print"----res----",res
# sum = 0.0
# for r in res:
# sum = r['debit'] - r['credit']
# r['progress'] = sum
# full_account.append(r)
self.cr.execute(
"SELECT l.id,l.date,j.code, l.ref, l.name, l.debit, l.credit " \
"FROM account_move_line l " \
"LEFT JOIN account_journal j " \
"ON (l.journal_id = j.id) " \
"WHERE l.partner_id = %d " \
# "AND l.account_id IN (" + self.account_ids + ") " \
"AND l.account_id IN (" + self.account_ids + ") " \
"AND l.date IN (" + self.date_lst_string + ") " \
" " + RECONCILE_TAG + " "\
"ORDER BY l.id",
(partner.id,))
res = self.cr.dictfetchall()
sum = 0.0
for r in res:
sum = r['debit'] - r['credit']
r['progress'] = sum
full_account.append(r)
return full_account
def _sum_debit_partner(self, partner,data):
account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line')
result_tmp = 0.0
if data['form']['reconcil'] :
@ -294,7 +284,7 @@ class third_party_ledger(rml_parse.rml_parse):
"SELECT sum(debit) " \
"FROM account_move_line " \
"WHERE partner_id = %d " \
# "AND account_id IN (" + self.account_ids + ") " \
"AND account_id IN (" + self.account_ids + ") " \
"AND reconcile_id IS NULL " \
"AND date < %s " ,
(partner.id, self.date_lst[0],))
@ -303,24 +293,24 @@ class third_party_ledger(rml_parse.rml_parse):
result_tmp = contemp[0] or 0.0
else:
result_tmp = result_tmp + 0.0
self.cr.execute(
"SELECT sum(debit) " \
"FROM account_move_line " \
"WHERE partner_id = %d " \
# "AND account_id IN (" + self.account_ids + ") " \
"AND account_id IN (" + self.account_ids + ") " \
" " + RECONCILE_TAG + " " \
"AND date IN (" + self.date_lst_string + ") " ,
(partner.id,))
contemp = self.cr.fetchone()
contemp = self.cr.fetchone()
if contemp != None:
result_tmp = contemp[0] or 0.0
else:
result_tmp = result_tmp + 0.0
return result_tmp
def _sum_credit_partner(self, partner,data):
account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line')
result_tmp = 0.0
@ -333,7 +323,7 @@ class third_party_ledger(rml_parse.rml_parse):
"SELECT sum(credit) " \
"FROM account_move_line " \
"WHERE partner_id=%d " \
# "AND account_id IN (" + self.account_ids + ") " \
"AND account_id IN (" + self.account_ids + ") " \
"AND reconcile_id IS NULL " \
"AND date < %s " ,
(partner.id,self.date_lst[0],))
@ -342,23 +332,23 @@ class third_party_ledger(rml_parse.rml_parse):
result_tmp = contemp[0] or 0.0
else:
result_tmp = result_tmp + 0.0
self.cr.execute(
"SELECT sum(credit) " \
"FROM account_move_line " \
"WHERE partner_id=%d " \
# "AND account_id IN (" + self.account_ids + ") " \
"AND account_id IN (" + self.account_ids + ") " \
" " + RECONCILE_TAG + " " \
"AND date IN (" + self.date_lst_string + ") " ,
(partner.id,))
contemp = self.cr.fetchone()
contemp = self.cr.fetchone()
if contemp != None:
result_tmp = contemp[0] or 0.0
else:
result_tmp = result_tmp + 0.0
return result_tmp
def _sum_debit(self,data):
if not self.ids:
return 0.0
@ -373,7 +363,7 @@ class third_party_ledger(rml_parse.rml_parse):
"SELECT sum(debit) " \
"FROM account_move_line " \
"WHERE partner_id IN (" + self.partner_ids + ") " \
# "AND account_id IN (" + self.account_ids + ") " \
"AND account_id IN (" + self.account_ids + ") " \
"AND reconcile_id IS NULL " \
"AND date < %s " ,
(self.date_lst[0],))
@ -387,20 +377,20 @@ class third_party_ledger(rml_parse.rml_parse):
"SELECT sum(debit) " \
"FROM account_move_line " \
"WHERE partner_id IN (" + self.partner_ids + ") " \
# "AND account_id IN (" + self.account_ids + ") " \
"AND account_id IN (" + self.account_ids + ") " \
" " + RECONCILE_TAG + " " \
"AND date IN (" + self.date_lst_string + ") "
"AND date IN (" + self.date_lst_string + ") "
)
contemp = self.cr.fetchone()
contemp = self.cr.fetchone()
if contemp != None:
result_tmp = contemp[0] or 0.0
else:
result_tmp = result_tmp + 0.0
return result_tmp
def _sum_credit(self,data):
if not self.ids:
return 0.0
@ -415,7 +405,7 @@ class third_party_ledger(rml_parse.rml_parse):
"SELECT sum(credit) " \
"FROM account_move_line " \
"WHERE partner_id IN (" + self.partner_ids + ") " \
# "AND account_id IN (" + self.account_ids + ") " \
"AND account_id IN (" + self.account_ids + ") " \
"AND reconcile_id IS NULL " \
"AND date < %s " ,
(self.date_lst[0],))
@ -428,16 +418,16 @@ class third_party_ledger(rml_parse.rml_parse):
"SELECT sum(credit) " \
"FROM account_move_line " \
"WHERE partner_id IN (" + self.partner_ids + ") " \
# "AND account_id IN (" + self.account_ids + ") " \
"AND account_id IN (" + self.account_ids + ") " \
" " + RECONCILE_TAG + " " \
"AND date IN (" + self.date_lst_string + ") "
"AND date IN (" + self.date_lst_string + ") "
)
contemp = self.cr.fetchone()
contemp = self.cr.fetchone()
if contemp != None:
result_tmp = contemp[0] or 0.0
else:
result_tmp = result_tmp + 0.0
return result_tmp
def _get_company(self, form):
@ -445,7 +435,7 @@ class third_party_ledger(rml_parse.rml_parse):
def _get_currency(self, form):
return pooler.get_pool(self.cr.dbname).get('res.company').browse(self.cr, self.uid, form['company_id']).currency_id.name
report_sxw.report_sxw('report.account.third_party_ledger', 'res.partner',
'addons/account/report/third_party_ledger.rml',parser=third_party_ledger,
header=False)

View File

@ -217,13 +217,13 @@
<para style="P4"></para>
</td>
<td>
<para style="P5">[[ (line['debit']) or '' ]]</para>
<para style="P5">[[ (line['debit']) or '0.0' ]]</para>
</td>
<td>
<para style="P5">[[ (line['credit']) or '' ]]</para>
<para style="P5">[[ (line['credit']) or '0.0' ]]</para>
</td>
<td>
<para style="P5">[[ (line['progress']) or '' ]]</para>
<para style="P5">[[ (line['progress']) or '0.0' ]]</para>
</td>
</tr>
</blockTable>

View File

@ -0,0 +1,191 @@
<?xml version="1.0"?>
<document filename="test.pdf">
<template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
<pageTemplate id="first">
<frame id="first" x1="57.0" y1="57.0" width="481" height="728"/>
<header>
<pageGraphics>
<!--logo-->
<!--<fill color="darkblue"/>-->
<!--<stroke color="darkblue"/>-->
<!--TITLE COMPANY-->
<!-- <drawString x="4.6cm" y="28.7cm">[[ company.partner_id.name ]]</drawString> -->
<setFont name="Helvetica-Bold" size="9"/>
<!--COL 1-->
<drawString x="1.0cm" y="28.1cm">[[ company.name ]]</drawString>
<drawRightString x="20cm" y="28.1cm">Print Journal - [[ company.currency_id.name ]]</drawRightString>
<!-- Header -->
<setFont name="Helvetica" size="9"/>
<drawString x="1.0cm" y="1cm"> [[ time.strftime("%Y-%m-%d %H:%M", time.localtime()) ]]</drawString>
<drawString x="19.0cm" y="1cm">Page <pageNumber/></drawString>
<!--<drawRightString x="19.8cm" y="28cm">[[ company.rml_header1 ]]</drawRightString>-->
<lineMode width="0.7"/>
<lines>1cm 27.7cm 20cm 27.7cm</lines>
<setFont name="Helvetica" size="8"/>
</pageGraphics>
</header>
</pageTemplate>
</template>
<stylesheet>
<blockTableStyle id="Standard_Outline">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Table1">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,1" stop="-1,1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,2" stop="-1,-1"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,1" stop="-1,1"/>
</blockTableStyle>
<blockTableStyle id="Table2">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
</blockTableStyle>
<blockTableStyle id="Table3">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<initialize>
<paraStyle name="all" alignment="justify"/>
</initialize>
<paraStyle name="P1" fontName="Times-Roman" fontSize="20.0" leading="25" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P2" fontName="Times-Roman" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P3" fontName="Times-Roman" fontSize="10.0" leading="13" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P4" fontName="Times-Roman" fontSize="11.0" leading="14" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P5" fontName="Times-Roman" fontSize="11.0" leading="14" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P6" fontName="Times-Roman" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P7" fontName="Times-Roman" fontSize="11.0" leading="14" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P9" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P10" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P10a" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P10b" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P11" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P11a" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P12" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P13" fontName="Times-Roman" fontSize="11.0" leading="14" alignment="CENTER"/>
<paraStyle name="Standard" fontName="Times-Roman"/>
<paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="List" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Table Contents" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Table Heading" fontName="Times-Roman" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Caption" fontName="Times-Roman" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="Index" fontName="Times-Roman"/>
<paraStyle name="Heading" fontName="Helvetica" fontSize="8.0" leading="10" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="Footer" fontName="Times-Roman"/>
<paraStyle name="Horizontal Line" fontName="Times-Roman" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
<paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_1" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Right_9_Bold" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_8_Italic" fontName="Helvetica-Oblique" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
</stylesheet>
<images/>
<story>
<para style="Table Contents">[[ repeatIn(objects, 'o') ]]</para>
<blockTable colWidths="65.0,62.0,58.0,62.0,174.0,57.0,61.0" style="Table1" repeatRows="1">
<para style="terp_default_8">[[repeatIn(lines(data['form']['period_id'][0][2],data['form']['journal_id'][0][2],data['form']['sort_selection']), 'line') ]]</para>
<tr>
<td>
<para style="P10a">Date</para>
</td>
<td>
<para style="P10">Voucher No</para>
</td>
<td>
<para style="P10">A/c No.</para>
</td>
<td>
<para style="P10a">Third party</para>
</td>
<td>
<para style="P10a">Entry label</para>
</td>
<td>
<para style="P10b">Debit</para>
</td>
<td>
<para style="P10b">Credit</para>
</td>
</tr>
<tr>
<td>
<para style="P11">[[line[0].period_id.name ]]</para>
</td>
<td>
<para style="P11a">[[line[0].journal_id.code ]]</para></td>
<td></td>
<td></td>
<td></td>
<td>
<para style="P12"><u>[[ '%.2f' % sum_debit(line[0].period_id.id, line[0].journal_id.id) or '0.00' ]]</u></para>
</td>
<td>
<para style="P12"><u>[[ '%.2f' % sum_credit(line[0].period_id.id, line[0].journal_id.id) or '0.00' ]]</u></para>
</td>
</tr >
<tr>
<para style="terp_default_8">[[repeatIn(line,'l')]]</para>
<td>
<para style="terp_default_8">[[ l.date ]]</para>
</td>
<td>
<para style="terp_default_Centre_8">[[ l.ref ]]</para>
</td>
<td>
<para style="terp_default_Centre_8">[[ l.account_id.code ]]</para>
</td>
<td>
<para style="terp_default_8">[[ l.partner_id and l.partner_id.name ]]</para>
</td>
<td>
<para style="terp_default_8">[[ l.name ]]</para>
</td>
<td>
<para style="P8">[[ l.debit and '%.2f' % l.debit or '0.00' ]]</para>
</td>
<td>
<para style="P8">[[ l.credit and '%.2f' % l.credit or '0.00' ]]</para>
</td>
<para style="Standard">
<font color="white"> </font>
</para>
</tr>
</blockTable>
</story>
</document>

View File

@ -0,0 +1,247 @@
<?xml version="1.0"?>
<document filename="test.pdf">
<template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
<pageTemplate id="first">
<frame id="first" x1="57.0" y1="57.0" width="481" height="728"/>
<header>
<pageGraphics>
<setFont name="Helvetica-Bold" size="9"/>
<!--COL 1-->
<drawString x="1.0cm" y="28.1cm">[[ company.name ]]</drawString>
<drawRightString x="20cm" y="28.1cm">Central Journal-[[ company.currency_id.name ]]</drawRightString>
<!-- Header -->
<setFont name="Helvetica" size="9"/>
<drawString x="1.0cm" y="1cm"> [[ time.strftime("%Y-%m-%d %H:%M", time.localtime()) ]]</drawString>
<drawString x="19.0cm" y="1cm">Page <pageNumber/></drawString>
<!--<drawRightString x="19.8cm" y="28cm">[[ company.rml_header1 ]]</drawRightString>-->
<lineMode width="0.7"/>
<lines>1cm 27.7cm 20cm 27.7cm</lines>
<setFont name="Helvetica" size="8"/>
</pageGraphics>
</header>
</pageTemplate>
</template>
<stylesheet>
<blockTableStyle id="Standard_Outline">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Table_header_Content">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Table_Sub_Header_Content">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="0,0" stop="0,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="0,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,0" stop="1,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="2,0" stop="2,-1"/>
<lineStyle kind="LINEAFTER" colorName="#cccccc" start="2,0" stop="2,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="2,0" stop="2,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
</blockTableStyle>
<blockTableStyle id="Table_Subheader_Content_detail">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="0,0" stop="0,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="0,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,0" stop="1,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="2,0" stop="2,-1"/>
<lineStyle kind="LINEAFTER" colorName="#cccccc" start="2,0" stop="2,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="2,0" stop="2,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
</blockTableStyle>
<blockTableStyle id="Table_Account_detail_Title">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
</blockTableStyle>
<blockTableStyle id="Table_Final_Total">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
</blockTableStyle>
<blockTableStyle id="Table_Journal_Line_Content">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
</blockTableStyle>
<initialize>
<paraStyle name="all" alignment="justify"/>
</initialize>
<paraStyle name="Standard" fontName="Times-Roman"/>
<paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="List" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Table Contents" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Table Heading" fontName="Times-Roman" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Caption" fontName="Times-Roman" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="Index" fontName="Times-Roman"/>
<paraStyle name="Heading" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="Footer" fontName="Times-Roman"/>
<paraStyle name="Horizontal Line" fontName="Times-Roman" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
<paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_2" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Bold_9_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
</stylesheet>
<images/>
<story>
<!--blockTable colWidths="180.0,180.0,180.0" style="Table_header_Content">
<tr>
<td>
<para style="terp_header">[[ company.name ]]</para>
</td>
<td>
<para style="terp_header">
<font color="white"> </font>
</para>
</td>
<td>
<para style="terp_header">Central Journal-[[ company.currency_id.name ]]</para>
</td>
</tr>
</blockTable-->
<para style="terp_default_8">
<font color="white"> </font>
</para>
<para style="terp_default_8">
<font color="white"> </font>
</para>
<para style="terp_default_8">[[ repeatIn(objects, 'o') ]]</para>
<para style="terp_default_8">[[ repeatIn(lines(data['form']['period_id'][0][2],data['form']['journal_id'][0][2]), 'line') ]]</para>
<blockTable colWidths="180.0,180.0,180.0" style="Table_Sub_Header_Content">
<tr>
<td>
<para style="terp_tblheader_General_Centre">Journal Code</para>
</td>
<td>
<para style="terp_tblheader_General_Centre">Journal Name</para>
</td>
<td>
<para style="terp_tblheader_General_Centre">Printing Date</para>
</td>
</tr>
</blockTable>
<blockTable colWidths="180.0,180.0,180.0" style="Table_Subheader_Content_detail">
<tr>
<td>
<para style="terp_tblheader_General_Centre">[[ line[0]['journal'].code or '' ]]</para>
</td>
<td>
<para style="terp_tblheader_General_Centre">[[ line[0]['journal'].name ]]</para>
</td>
<td>
<para style="terp_tblheader_General_Centre">[[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]]</para>
</td>
</tr>
</blockTable>
<para style="terp_default_8">
<font color="white"> </font>
</para>
<para style="terp_default_8">
<font color="white"> </font>
</para>
<blockTable colWidths="83.0,272.0,95.0,89.0" style="Table_Account_detail_Title" repeatRows="1">
<tr>
<td>
<para style="terp_tblheader_Details_Centre">Account Num.</para>
</td>
<td>
<para style="terp_tblheader_Details">Account Name</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Debit</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Credit</para>
</td>
</tr>
<tr>
<td>
<blockTable colWidths="80.0,272.0,94.0,87.0" style="Table_Final_Total">
<tr>
<td>
<para style="terp_default_Bold_9">Total:</para>
</td>
<td>
<para style="terp_default_Bold_9">
<font color="white"> </font>
</para>
</td>
<td>
<para style="terp_default_Bold_9_Right">[[ '%.2f' % sum_debit(line[0]['period'].id, line[0]['journal'].id) ]]</para>
</td>
<td>
<para style="terp_default_Bold_9_Right">[[ '%.2f' % sum_credit(line[0]['period'].id, line[0]['journal'].id) ]]</para>
</td>
</tr>
</blockTable>
</td>
</tr>
<tr>
<td>
<blockTable colWidths="80.0,272.0,94.0,87.0" style="Table_Journal_Line_Content">
<para style="terp_default_8">[[repeatIn(line,'l')]]</para>
<tr>
<td>
<para style="terp_default_9">[[ l['code'] ]]</para>
</td>
<td>
<para style="terp_default_9">[[ l['name'] ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(l['debit']) and '%.2f' % l['debit'] or '0.00' ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(l['credit']) and '%.2f' % l['credit'] or '0.00' ]]</para>
</td>
</tr>
</blockTable>
</td>
</tr>
</blockTable>
<para style="terp_default_8">
<font color="white"> </font>
</para>
</story>
</document>

View File

@ -0,0 +1,250 @@
<?xml version="1.0"?>
<document filename="test.pdf">
<template pageSize="(596.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
<pageTemplate id="first">
<frame id="first" x1="57.0" y1="57.0" width="481" height="728"/>
<header>
<pageGraphics>
<setFont name="Helvetica-Bold" size="9"/>
<!--COL 1-->
<drawString x="1.0cm" y="28.1cm">[[ company.name ]]</drawString>
<drawRightString x="20cm" y="28.1cm">General Journal - [[ company.currency_id.name ]]</drawRightString>
<!-- Header -->
<setFont name="Helvetica" size="9"/>
<drawString x="1.0cm" y="1cm"> [[ time.strftime("%Y-%m-%d %H:%M", time.localtime()) ]]</drawString>
<drawString x="19.0cm" y="1cm">Page <pageNumber/></drawString>
<!--<drawRightString x="19.8cm" y="28cm">[[ company.rml_header1 ]]</drawRightString>-->
<lineMode width="0.7"/>
<lines>1cm 27.7cm 20cm 27.7cm</lines>
<setFont name="Helvetica" size="8"/>
</pageGraphics>
</header>
</pageTemplate>
</template>
<stylesheet>
<blockTableStyle id="Standard_Outline">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Table_Header_Title">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Table_Print_Current_datetime">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Table_Journal_Title">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
</blockTableStyle>
<blockTableStyle id="Table_Final_Total">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
</blockTableStyle>
<blockTableStyle id="Table_Sub_Total">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="0,0" stop="2,2"/>
<lineStyle kind="LINEBELOW" colorName="white" start="0,1" stop="-1,1"/>
</blockTableStyle>
<blockTableStyle id="Table_Journal_Detail">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<initialize>
<paraStyle name="all" alignment="justify"/>
</initialize>
<paraStyle name="Standard" fontName="Times-Roman"/>
<paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Table Contents" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Table Heading" fontName="Times-Roman" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Heading" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Caption" fontName="Helvetica-Oblique" fontSize="9.0" leading="11" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="Index" fontName="Helvetica"/>
<paraStyle name="Footer" fontName="Times-Roman"/>
<paraStyle name="Horizontal Line" fontName="Times-Roman" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
<paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_2" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Bold_9_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
</stylesheet>
<images/>
<story>
<para style="terp_default_8">
<font color="white"> </font>
</para>
<!--blockTable colWidths="180.0,180.0,180.0" style="Table_Header_Title">
<tr>
<td>
<para style="terp_header">[[ company.name ]]</para>
</td>
<td>
<para style="terp_header">
<font color="white"> </font>
</para>
</td>
<td>
<para style="terp_header">General Journal - [[ company.currency_id.name ]]</para>
</td>
</tr>
</blockTable-->
<para style="terp_default_8">
<font color="white"> </font>
</para>
<blockTable colWidths="75.0,465.0" style="Table_Print_Current_datetime">
<tr>
<td>
<para style="terp_default_Bold_9">Printing Date :</para>
</td>
<td>
<para style="terp_default_Bold_9">[[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]]</para>
</td>
</tr>
</blockTable>
<para style="terp_default_8">
<font color="white"> </font>
</para>
<para style="terp_default_8">
<font color="white"> </font>
</para>
<section>
<blockTable colWidths="61.0,228.0,95.0,80.0,73.0" style="Table_Journal_Title" repeatRows="1">
<tr>
<td>
<para style="terp_tblheader_Details">Jrl Code</para>
</td>
<td>
<para style="terp_tblheader_Details">Journal Name</para>
</td>
<td>
<para style="terp_tblheader_Details">Period</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Debit Trans.</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Credit Trans.</para>
</td>
</tr>
<tr>
<td>
<blockTable colWidths="64.0,226.0,82.0,82.0,76.0" style="Table_Final_Total">
<tr>
<td>
<para style="terp_default_Bold_9">Total:</para>
</td>
<td>
<para style="terp_default_Bold_9">
<font color="white"> </font>
</para>
</td>
<td>
<para style="terp_default_Bold_9">
<font color="white"> </font>
</para>
</td>
<td>
<para style="terp_default_Bold_9_Right"><u>[[ '%.2f' % sum_debit(data['form']['period_id'][0][2],data['form']['journal_id'][0][2]) ]]</u></para>
</td>
<td>
<para style="terp_default_Bold_9_Right"><u>[[ '%.2f' % sum_credit(data['form']['period_id'][0][2],data['form']['journal_id'][0][2]) ]]</u></para>
</td>
</tr>
</blockTable>
</td>
</tr>
<tr>
<td>
<para style="terp_default_9"><font>[[ repeatIn( lines( data['form']['period_id'][0][2], data['form']['journal_id'][0][2] ),'line')]]</font></para>
<blockTable colWidths="175.0,115.0,82.0,82.0,75.0" style="Table_Sub_Total">
<tr>
<td>
<para style="terp_default_Bold_9">[[ line[0]['period_name'] ]] :</para>
</td>
<td>
<para style="terp_default_Bold_9">
<font color="white"> </font>
</para>
</td>
<td>
<para style="terp_default_Bold_9">
<font color="white"> </font>
</para>
</td>
<td>
<para style="terp_default_Bold_9_Right"><u>[[ '%.2f' % sum_debit_period( line[0]['pid'],data['form']['journal_id'][0][2]) ]]</u></para>
</td>
<td>
<para style="terp_default_Bold_9_Right"><u>[[ '%.2f' % sum_credit_period(line[0]['pid'],data['form']['journal_id'][0][2]) ]]</u></para>
</td>
</tr>
<tr>
<td>
<blockTable colWidths="60.0,219.0,88.0,80.0,76.0" style="Table_Journal_Detail">
<tr>
<td>
<para style="terp_default_9">[[ repeatIn(line,'l') ]]</para>
<para style="terp_default_9">[[ l['code'] ]]</para>
</td>
<td>
<para style="terp_default_9">[[ l['name'] ]]</para>
</td>
<td>
<para style="terp_default_9">[[ line[0]['period_name'] ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ l['debit'] and ('%.2f' % l['debit']) or '' ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ l['credit'] and ('%.2f' % l['credit']) or '' ]]</para>
</td>
</tr>
</blockTable>
</td>
</tr>
</blockTable>
</td>
</tr>
</blockTable>
</section>
<para style="terp_default_8">
<font color="white"> </font>
</para>
</story>
</document>

View File

@ -4,7 +4,8 @@
"access_account_account_type","account.account.type","model_account_account_type","account.group_account_user",1,0,0,0
"access_account_tax","account.tax","model_account_tax","account.group_account_user",1,0,0,0
"access_account_account","account.account","model_account_account","account.group_account_user",1,0,0,0
"access_account_account_partner_manager","account.account partner manager","model_account_account","base.group_user",1,0,0,0
"access_account_account_user","account.account user","model_account_account","base.group_user",1,0,0,0
"access_account_account_partner_manager","account.account partner manager","model_account_account","base.group_partner_manager",1,0,0,0
"access_account_journal_view","account.journal.view","model_account_journal_view","account.group_account_user",1,0,0,0
"access_account_journal_column","account.journal.column","model_account_journal_column","account.group_account_user",1,0,0,0
"access_account_journal","account.journal","model_account_journal","account.group_account_user",1,0,0,0
@ -12,6 +13,7 @@
"access_account_journal_period_manager","account.journal.period manager","model_account_journal_period","account.group_account_manager",1,1,1,1
"access_account_journal_period","account.journal.period","model_account_journal_period","account.group_account_user",1,1,1,1
"access_account_move","account.move","model_account_move","account.group_account_user",1,1,1,1
"access_account_move_line","account.move.line","model_account_move_line","account.group_account_user",1,1,1,1
"access_account_move_reconcile","account.move.reconcile","model_account_move_reconcile","account.group_account_user",1,1,1,1
"access_account_tax_code","account.tax.code","model_account_tax_code",,1,0,0,0
"access_account_tax","account.tax","model_account_tax",,1,0,0,0
@ -26,7 +28,6 @@
"access_account_tax_template","account.tax.template","model_account_tax_template","account.group_account_manager",1,1,1,1
"access_wizard_multi_charts_accounts","wizard.multi.charts.accounts","model_wizard_multi_charts_accounts","account.group_account_manager",1,1,1,1
"access_account_bank_accounts_wizard","account.bank.accounts.wizard","model_account_bank_accounts_wizard","account.group_account_manager",1,1,1,1
"access_account_move_line","account.move.line invoice","model_account_move_line","account.group_account_invoice",1,1,1,1
"access_account_bank_statement","account.bank.statement","model_account_bank_statement","account.group_account_user",1,1,1,1
"access_account_bank_statement_reconcile","account.bank.statement.reconcile","model_account_bank_statement_reconcile","account.group_account_user",1,1,1,1
"access_account_bank_statement_reconcile_line","account.bank.statement.reconcile.line","model_account_bank_statement_reconcile_line","account.group_account_user",1,1,1,1
@ -40,6 +41,7 @@
"access_account_invoice_tax_uinvoice","account.invoice.tax","model_account_invoice_tax","account.group_account_invoice",1,1,1,1
"access_account_analytic_line_uinvoice","account.analytic.line","model_account_analytic_line","account.group_account_user",1,1,1,1
"access_account_move_uinvoice","account.move","model_account_move","account.group_account_invoice",1,1,1,1
"access_account_move_line_uinvoice","account.move.line invoice","model_account_move_line","account.group_account_invoice",1,1,1,1
"access_account_move_reconcile_uinvoice","account.move.reconcile","model_account_move_reconcile","account.group_account_invoice",1,1,1,1
"access_account_journal_period_uinvoice","account.journal.period","model_account_journal_period","account.group_account_invoice",1,1,1,1
"access_account_payment_term_manager","account.payment.term","model_account_payment_term","account.group_account_manager",1,1,1,1
@ -56,9 +58,6 @@
"access_account_tax_code_manager","account.tax.code","model_account_tax_code","account.group_account_manager",1,1,1,1
"access_account_tax_manager","account.tax","model_account_tax","account.group_account_manager",1,1,1,1
"access_account_invoice_group_invoice","account.invoice group invoice","model_account_invoice","account.group_account_invoice",1,1,1,1
"access_account_invoice_manager","account.invoice","model_account_invoice","account.group_account_manager",1,1,1,1
"access_account_invoice_line_manager","account.invoice.line","model_account_invoice_line","account.group_account_manager",1,1,1,1
"access_account_invoice_tax_manager","account.invoice.tax","model_account_invoice_tax","account.group_account_manager",1,1,1,1
"access_account_analytic_account_manager","account.analytic.account","model_account_analytic_account","account.group_account_manager",1,1,1,1
"access_account_analytic_journal_manager","account.analytic.journal","model_account_analytic_journal","account.group_account_manager",1,1,1,1
"access_account_fiscalyear","account.fiscalyear","model_account_fiscalyear","account.group_account_manager",1,1,1,1
@ -68,14 +67,16 @@
"access_res_currency_rate_account_manager","res.currency.rate account manager","base.model_res_currency_rate","group_account_manager",1,1,1,1
"access_account_config_wizard_account_manager","account.config.wizard account manager","model_account_config_wizard","group_account_manager",1,1,1,1
"access_account_config_wizard_system_manager","account.config.wizard system manager","model_account_config_wizard","base.group_system",1,1,1,1
"access_account_invoice_partner_manager","account.invoice partner manager","model_account_invoice","base.group_partner_manager",1,0,0,0
"access_account_invoice_line_partner_manager","account.invoice.line partner manager","model_account_invoice_line","base.group_partner_manager",1,0,0,0
"access_account_invoice_tax_partner_manager","account.invoice.tax partner manager","model_account_invoice_tax","base.group_partner_manager",1,0,0,0
"access_account_invoice_user","account.invoice user","model_account_invoice","base.group_user",1,0,0,0
"access_account_invoice_user","account.invoice.line user","model_account_invoice_line","base.group_user",1,0,0,0
"access_account_invoice_user","account.invoice.tax user","model_account_invoice_tax","base.group_user",1,0,0,0
"access_account_payment_term_partner_manager","account.payment.term partner manager","model_account_payment_term","base.group_user",1,0,0,0
"access_account_payment_term_line_partner_manager","account.payment.term.line partner manager","model_account_payment_term_line","base.group_user",1,0,0,0
"access_account_account_product_manager","account.account product manager","model_account_account","product.group_product_manager",1,0,0,0
"access_account_journal_product_manager","account.journal product manager","model_account_journal","product.group_product_manager",1,0,0,0
"access_account_fiscal_position_product_manager","account.fiscal.position account.manager","model_account_fiscal_position","account.group_account_manager",1,1,1,1
"access_account_fiscal_position_tax_product_manager","account.fiscal.position.tax account.manager","model_account_fiscal_position_tax","account.group_account_manager",1,1,1,1
"access_account_fiscal_position_account_product_manager","account.fiscal.position account.manager","model_account_fiscal_position_account","account.group_account_manager",1,1,1,1
"access_account_fiscal_position","account.fiscal.position all","model_account_fiscal_position","base.group_user",1,0,0,0
"access_account_fiscal_position_tax","account.fiscal.position.tax all","model_account_fiscal_position_tax","base.group_user",1,0,0,0
"access_account_fiscal_position_account","account.fiscal.position all","model_account_fiscal_position_account","base.group_user",1,0,0,0

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
4 access_account_account_type account.account.type model_account_account_type account.group_account_user 1 0 0 0
5 access_account_tax account.tax model_account_tax account.group_account_user 1 0 0 0
6 access_account_account account.account model_account_account account.group_account_user 1 0 0 0
7 access_account_account_partner_manager access_account_account_user account.account partner manager account.account user model_account_account base.group_user 1 0 0 0
8 access_account_account_partner_manager account.account partner manager model_account_account base.group_partner_manager 1 0 0 0
9 access_account_journal_view account.journal.view model_account_journal_view account.group_account_user 1 0 0 0
10 access_account_journal_column account.journal.column model_account_journal_column account.group_account_user 1 0 0 0
11 access_account_journal account.journal model_account_journal account.group_account_user 1 0 0 0
13 access_account_journal_period_manager account.journal.period manager model_account_journal_period account.group_account_manager 1 1 1 1
14 access_account_journal_period account.journal.period model_account_journal_period account.group_account_user 1 1 1 1
15 access_account_move account.move model_account_move account.group_account_user 1 1 1 1
16 access_account_move_line account.move.line model_account_move_line account.group_account_user 1 1 1 1
17 access_account_move_reconcile account.move.reconcile model_account_move_reconcile account.group_account_user 1 1 1 1
18 access_account_tax_code account.tax.code model_account_tax_code 1 0 0 0
19 access_account_tax account.tax model_account_tax 1 0 0 0
28 access_account_tax_template account.tax.template model_account_tax_template account.group_account_manager 1 1 1 1
29 access_wizard_multi_charts_accounts wizard.multi.charts.accounts model_wizard_multi_charts_accounts account.group_account_manager 1 1 1 1
30 access_account_bank_accounts_wizard account.bank.accounts.wizard model_account_bank_accounts_wizard account.group_account_manager 1 1 1 1
access_account_move_line account.move.line invoice model_account_move_line account.group_account_invoice 1 1 1 1
31 access_account_bank_statement account.bank.statement model_account_bank_statement account.group_account_user 1 1 1 1
32 access_account_bank_statement_reconcile account.bank.statement.reconcile model_account_bank_statement_reconcile account.group_account_user 1 1 1 1
33 access_account_bank_statement_reconcile_line account.bank.statement.reconcile.line model_account_bank_statement_reconcile_line account.group_account_user 1 1 1 1
41 access_account_invoice_tax_uinvoice account.invoice.tax model_account_invoice_tax account.group_account_invoice 1 1 1 1
42 access_account_analytic_line_uinvoice account.analytic.line model_account_analytic_line account.group_account_user 1 1 1 1
43 access_account_move_uinvoice account.move model_account_move account.group_account_invoice 1 1 1 1
44 access_account_move_line_uinvoice account.move.line invoice model_account_move_line account.group_account_invoice 1 1 1 1
45 access_account_move_reconcile_uinvoice account.move.reconcile model_account_move_reconcile account.group_account_invoice 1 1 1 1
46 access_account_journal_period_uinvoice account.journal.period model_account_journal_period account.group_account_invoice 1 1 1 1
47 access_account_payment_term_manager account.payment.term model_account_payment_term account.group_account_manager 1 1 1 1
58 access_account_tax_code_manager account.tax.code model_account_tax_code account.group_account_manager 1 1 1 1
59 access_account_tax_manager account.tax model_account_tax account.group_account_manager 1 1 1 1
60 access_account_invoice_group_invoice account.invoice group invoice model_account_invoice account.group_account_invoice 1 1 1 1
access_account_invoice_manager account.invoice model_account_invoice account.group_account_manager 1 1 1 1
access_account_invoice_line_manager account.invoice.line model_account_invoice_line account.group_account_manager 1 1 1 1
access_account_invoice_tax_manager account.invoice.tax model_account_invoice_tax account.group_account_manager 1 1 1 1
61 access_account_analytic_account_manager account.analytic.account model_account_analytic_account account.group_account_manager 1 1 1 1
62 access_account_analytic_journal_manager account.analytic.journal model_account_analytic_journal account.group_account_manager 1 1 1 1
63 access_account_fiscalyear account.fiscalyear model_account_fiscalyear account.group_account_manager 1 1 1 1
67 access_res_currency_rate_account_manager res.currency.rate account manager base.model_res_currency_rate group_account_manager 1 1 1 1
68 access_account_config_wizard_account_manager account.config.wizard account manager model_account_config_wizard group_account_manager 1 1 1 1
69 access_account_config_wizard_system_manager account.config.wizard system manager model_account_config_wizard base.group_system 1 1 1 1
70 access_account_invoice_partner_manager access_account_invoice_user account.invoice partner manager account.invoice user model_account_invoice base.group_partner_manager base.group_user 1 0 0 0
71 access_account_invoice_line_partner_manager access_account_invoice_user account.invoice.line partner manager account.invoice.line user model_account_invoice_line base.group_partner_manager base.group_user 1 0 0 0
72 access_account_invoice_tax_partner_manager access_account_invoice_user account.invoice.tax partner manager account.invoice.tax user model_account_invoice_tax base.group_partner_manager base.group_user 1 0 0 0
73 access_account_payment_term_partner_manager account.payment.term partner manager model_account_payment_term base.group_user 1 0 0 0
74 access_account_payment_term_line_partner_manager account.payment.term.line partner manager model_account_payment_term_line base.group_user 1 0 0 0
75 access_account_account_product_manager account.account product manager model_account_account product.group_product_manager 1 0 0 0
76 access_account_journal_product_manager account.journal product manager model_account_journal product.group_product_manager 1 0 0 0
77 access_account_fiscal_position_product_manager account.fiscal.position account.manager model_account_fiscal_position account.group_account_manager 1 1 1 1
78 access_account_fiscal_position_tax_product_manager account.fiscal.position.tax account.manager model_account_fiscal_position_tax account.group_account_manager 1 1 1 1
79 access_account_fiscal_position_account_product_manager account.fiscal.position account.manager model_account_fiscal_position_account account.group_account_manager 1 1 1 1
80 access_account_fiscal_position account.fiscal.position all model_account_fiscal_position base.group_user 1 0 0 0
81 access_account_fiscal_position_tax account.fiscal.position.tax all model_account_fiscal_position_tax base.group_user 1 0 0 0
82 access_account_fiscal_position_account account.fiscal.position all model_account_fiscal_position_account base.group_user 1 0 0 0

View File

@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# $Id$
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
@ -64,6 +56,9 @@ import wizard_use_model
import wizard_state_open
import wizard_statement_from_invoice
import wizard_print_journal
import wizard_central_journal
import wizard_general_journal
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,28 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2005-2006 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
@ -30,37 +24,38 @@ import wizard
import pooler
import time
report_type = '''<?xml version="1.0"?>
<form string="Select Report Type">
</form>'''
dates_form = '''<?xml version="1.0"?>
<form string="Select period">
<field name="date_from" colspan="4"/>
<field name="date_to" colspan="4"/>
<field name="display_account" colspan="4"/>
</form>'''
dates_fields = {
'date_from': {'string':"Start date",'type':'date','required':True ,'default': lambda *a: time.strftime('%Y-01-01')},
'date_to': {'string':"End date",'type':'date','required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
'display_account':{'string':"Filter on Accounts",'type':'selection','selection':[('bal_mouvement','With Entries'),('bal_all','All Accounts'),('bal_solde','With Balance Different Than 0')]}
}
period_form = '''<?xml version="1.0"?>
<form string="Select period">
<field name="fiscalyear" colspan="4"/>
<field name="periods" colspan="4"/>
<field name="display_account" colspan="4"/>
<field name="company_id"/>
<field name="display_account" required = "True"/>
<newline/>
<field name="fiscalyear"/>
<label colspan="2" string="(Keep empty for all open fiscal years)" align="0.0"/>
<newline/>
<separator string="Filters" colspan="4"/>
<field name="state" required="True"/>
<newline/>
<group attrs="{'invisible':[('state','=','byperiod'),('state','=','none')]}" colspan="4">
<separator string="Date Filter" colspan="4"/>
<field name="date_from"/>
<field name="date_to"/>
</group>
<group attrs="{'invisible':[('state','=','bydate'),('state','=','none')]}" colspan="4">
<separator string="Filter on Periods" colspan="4"/>
<field name="periods" colspan="4" nolabel="1"/>
</group>
</form>'''
period_fields = {
'company_id': {'string': 'Company', 'type': 'many2one', 'relation': 'res.company', 'required': True},
'state':{
'string':"Date/Period Filter",
'type':'selection',
'selection':[('bydate','By Date'),('byperiod','By Period'),('all','By Date and Period'),('none','No Filter')],
'default': lambda *a:'none'
},
'fiscalyear': {
'string':'Fiscal year',
'type':'many2one',
@ -68,7 +63,9 @@ period_fields = {
'help':'Keep empty for all open fiscal year'
},
'periods': {'string': 'Periods', 'type': 'many2many', 'relation': 'account.period', 'help': 'All periods if empty'},
'display_account':{'string':"Display accounts ",'type':'selection','selection':[('bal_mouvement','With movements'),('bal_all','All'),('bal_solde','With balance is not equal to 0')]}
'display_account':{'string':"Display accounts ",'type':'selection','selection':[('bal_mouvement','With movements'),('bal_all','All'),('bal_solde','With balance is not equal to 0')]},
'date_from': {'string':"Start date",'type':'date','required':True ,'default': lambda *a: time.strftime('%Y-01-01')},
'date_to': {'string':"End date",'type':'date','required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
}
account_form = '''<?xml version="1.0"?>
@ -80,27 +77,36 @@ account_fields = {
'Account_list': {'string':'Account', 'type':'many2one', 'relation':'account.account', 'required':True ,'domain':[('parent_id','=',False)]},
}
class wizard_report(wizard.interface):
def _get_defaults(self, cr, uid, data, context):
user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid, context=context)
if user.company_id:
company_id = user.company_id.id
else:
company_id = pooler.get_pool(cr.dbname).get('res.company').search(cr, uid, [('parent_id', '=', False)])[0]
data['form']['company_id'] = company_id
fiscalyear_obj = pooler.get_pool(cr.dbname).get('account.fiscalyear')
periods_obj=pooler.get_pool(cr.dbname).get('account.period')
data['form']['fiscalyear'] = fiscalyear_obj.find(cr, uid)
data['form']['periods'] =periods_obj.search(cr, uid, [('fiscalyear_id','=',data['form']['fiscalyear'])])
data['form']['fiscalyear'] = False
data['form']['display_account']='bal_all'
return data['form']
def _get_defaults_fordate(self, cr, uid, data, context):
data['form']['display_account']='bal_all'
def _check_state(self, cr, uid, data, context):
if data['form']['state'] == 'bydate':
self._check_date(cr, uid, data, context)
data['form']['fiscalyear'] = 0
else :
data['form']['fiscalyear'] = 1
return data['form']
def _check_path(self, cr, uid, data, context):
if data['model'] == 'account.account':
return 'checktype'
return 'checktype'
else:
return 'account_selection'
return 'account_selection'
def _check_date(self, cr, uid, data, context):
sql = """
@ -112,7 +118,6 @@ class wizard_report(wizard.interface):
raise wizard.except_wizard('UserError','Date to must be set between ' + res[0]['date_start'] + " and " + res[0]['date_stop'])
else:
return 'report'
else:
raise wizard.except_wizard('UserError','Date not in a defined fiscal year')
@ -124,30 +129,15 @@ class wizard_report(wizard.interface):
},
'account_selection': {
'actions': [],
'result': {'type':'form', 'arch':account_form,'fields':account_fields, 'state':[('end','Cancel'),('checktype','Print')]}
'result': {'type':'form', 'arch':account_form,'fields':account_fields, 'state':[('end','Cancel','gtk-cancel'),('checktype','Next','gtk-go-forward')]}
},
'checktype': {
'actions': [],
'result': {'type':'form', 'arch':report_type,'fields':{}, 'state':[('with_period','Use with Period'),('with_date','Use with Date')]}
},
'with_period': {
'actions': [_get_defaults],
'result': {'type':'form', 'arch':period_form, 'fields':period_fields, 'state':[('end','Cancel'),('report','Print')]}
'result': {'type':'form', 'arch':period_form, 'fields':period_fields, 'state':[('end','Cancel','gtk-cancel'),('report','Print','gtk-print')]}
},
'with_date': {
'actions': [_get_defaults_fordate],
'result': {'type':'form', 'arch':dates_form, 'fields':dates_fields, 'state':[('end','Cancel'),('checkdate','Print')]}
},
'checkdate': {
'actions': [],
'result': {'type':'choice','next_state':_check_date}
},
'report': {
'actions': [],
'actions': [_check_state],
'result': {'type':'print', 'report':'account.account.balance', 'state':'end'}
}
}
wizard_report('account.account.balance.report')

View File

@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# $Id$
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

View File

@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# $Id$
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

View File

@ -1,28 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2005-2006 TINY SPRL. (http://tiny.be) All Rights Reserved.
# Fabien Pinckaers <fp@tiny.Be>
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
@ -52,9 +46,9 @@ _aged_trial_fields = {
'result_selection':{
'string':"Filter on Partners",
'type':'selection',
'selection':[('customer','Customer'),('supplier','Supplier'),('all','All')],
'selection':[('customer','Receivable'),('supplier','Payable'),('all','Receivable and Payable')],
'required':True,
'default': lambda *a: 'customer',
'default': lambda *a: 'all',
},
'direction_selection':{
'string':"Analysis Direction",

View File

@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# $Id$
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

View File

@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# $Id$
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

View File

@ -0,0 +1,52 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import wizard
import pooler
form = '''<?xml version="1.0"?>
<form string="Print Central Journal">
<field name="journal_id"/>
<field name="period_id"/>
</form>'''
fields = {
'journal_id': {'string': 'Journal', 'type': 'many2many', 'relation': 'account.journal', 'required': True},
'period_id': {'string': 'Period', 'type': 'many2many', 'relation': 'account.period', 'required': True},
}
class wizard_print_journal(wizard.interface):
states = {
'init': {
'actions': [],
'result': {'type': 'form', 'arch': form, 'fields': fields, 'state': (('end', 'Cancel'), ('print', 'Print'))},
},
'print': {
'actions': [],
'result': {'type':'print', 'report':'account.central.journal.wiz', 'state':'end'},
},
}
wizard_print_journal('account.central.journal.report')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# $Id$
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

View File

@ -0,0 +1,52 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import wizard
import pooler
form = '''<?xml version="1.0"?>
<form string="Print General Journal">
<field name="journal_id"/>
<field name="period_id"/>
</form>'''
fields = {
'journal_id': {'string': 'Journal', 'type': 'many2many', 'relation': 'account.journal', 'required': True},
'period_id': {'string': 'Period', 'type': 'many2many', 'relation': 'account.period', 'required': True},
}
class wizard_print_journal(wizard.interface):
states = {
'init': {
'actions': [],
'result': {'type': 'form', 'arch': form, 'fields': fields, 'state': (('end', 'Cancel'), ('print', 'Print'))},
},
'print': {
'actions': [],
'result': {'type':'print', 'report':'account.general.journal.wiz', 'state':'end'},
},
}
wizard_print_journal('account.general.journal.report')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,26 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 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 General Public License for more details.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
@ -29,64 +25,94 @@ import pooler
import locale
import time
report_type = '''<?xml version="1.0"?>
<form string="Select Report Type">
</form>'''
dates_form = '''<?xml version="1.0"?>
<form string="Select period ">
<field name="date_from" colspan="4"/>
<field name="date_to" colspan="4"/>
<field name="sortbydate" colspan="4"/>
<field name="display_account" colspan="4"/>
<field name="landscape" colspan="4"/>
<field name="soldeinit"/>
<field name="amount_currency" colspan="4"/>
</form>'''
dates_fields = {
'date_from': {'string':"Start date",'type':'date','required':True ,'default': lambda *a: time.strftime('%Y-01-01')},
'date_to': {'string':"End date",'type':'date','required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
'sortbydate':{'string':"Sort by",'type':'selection','selection':[('sort_date','Date'),('sort_mvt','Mouvement')]},
'display_account':{'string':"Display accounts ",'type':'selection','selection':[('bal_mouvement','With movements'),('bal_all','All'),('bal_solde','With balance is not equal to 0')]},
'landscape':{'string':"Print in Landscape Mode",'type':'boolean'},
'soldeinit':{'string':"Inclure les soldes initiaux",'type':'boolean'},
'amount_currency':{'string':"with amount in currency",'type':'boolean'}
}
#report_type = '''<?xml version="1.0"?>
#<form string="Select Report Type">
#</form>'''
#
#dates_form = '''<?xml version="1.0"?>
#<form string="Select period ">
# <field name="date_from" colspan="4"/>
# <field name="date_to" colspan="4"/>
# <field name="sortbydate" colspan="4"/>
# <field name="display_account" colspan="4"/>
# <field name="landscape" colspan="4"/>
# <field name="soldeinit"/>
# <field name="amount_currency" colspan="4"/>
#</form>'''
#
#dates_fields = {
# 'date_from': {'string':"Start date",'type':'date','required':True ,'default': lambda *a: time.strftime('%Y-01-01')},
# 'date_to': {'string':"End date",'type':'date','required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
# 'sortbydate':{'string':"Sort by",'type':'selection','selection':[('sort_date','Date'),('sort_mvt','Mouvement')]},
# 'display_account':{'string':"Display accounts ",'type':'selection','selection':[('bal_mouvement','With movements'),('bal_all','All'),('bal_solde','With balance is not equal to 0')]},
# 'landscape':{'string':"Print in Landscape Mode",'type':'boolean'},
# 'soldeinit':{'string':"Inclure les soldes initiaux",'type':'boolean'},
# 'amount_currency':{'string':"with amount in currency",'type':'boolean'}
#
#}
account_form = '''<?xml version="1.0"?>
<form string="Select parent account">
<form string="Select Chart">
<field name="Account_list" colspan="4"/>
</form>'''
account_fields = {
'Account_list': {'string':'Account', 'type':'many2one', 'relation':'account.account', 'required':True ,'domain':[('parent_id','=',False)]},
'Account_list': {'string':'Chart of Accounts', 'type':'many2one', 'relation':'account.account', 'required':True ,'domain':[('parent_id','=',False)]},
}
period_form = '''<?xml version="1.0"?>
<form string="Select period ">
<field name="fiscalyear" colspan="4"/>
<field name="periods" colspan="4"/>
<field name="sortbydate" colspan="4"/>
<field name="display_account" colspan="4"/>
<field name="landscape" colspan="4"/>
<field name="soldeinit"/>
<field name="amount_currency" colspan="4"/>
<form string="Select Date-Period">
<field name="company_id" colspan="4"/>
<newline/>
<field name="fiscalyear"/>
<label colspan="2" string="(Keep empty for all open fiscal years)" align="0.0"/>
<newline/>
<field name="display_account" required="True"/>
<field name="sortbydate" required="True"/>
<field name="landscape"/>
<field name="amount_currency"/>
<newline/>
<separator string="Filters" colspan="4"/>
<field name="state" required="True"/>
<newline/>
<group attrs="{'invisible':[('state','=','byperiod'),('state','=','none')]}" colspan="4">
<separator string="Date Filter" colspan="4"/>
<field name="date_from"/>
<field name="date_to"/>
</group>
<group attrs="{'invisible':[('state','=','bydate'),('state','=','none')]}" colspan="4">
<separator string="Filter on Periods" colspan="4"/>
<field name="periods" colspan="4" nolabel="1"/>
</group>
</form>'''
period_fields = {
'company_id': {'string': 'Company', 'type': 'many2one', 'relation': 'res.company', 'required': True},
'state':{
'string':"Date/Period Filter",
'type':'selection',
'selection':[('bydate','By Date'),('byperiod','By Period'),('all','By Date and Period'),('none','No Filter')],
'default': lambda *a:'none'
},
'fiscalyear': {'string': 'Fiscal year', 'type': 'many2one', 'relation': 'account.fiscalyear',
'help': 'Keep empty for all open fiscal year'},
'periods': {'string': 'Periods', 'type': 'many2many', 'relation': 'account.period', 'help': 'All periods if empty'},
'sortbydate':{'string':"Sort by:",'type':'selection','selection':[('sort_date','Date'),('sort_mvt','Mouvement')]},
'sortbydate':{'string':"Sort by:",'type':'selection','selection':[('sort_date','Date'),('sort_mvt','Movement')]},
'display_account':{'string':"Display accounts ",'type':'selection','selection':[('bal_mouvement','With movements'),('bal_all','All'),('bal_solde','With balance is not equal to 0')]},
'landscape':{'string':"Print in Landscape Mode",'type':'boolean'},
'landscape':{'string':"Landscape Mode",'type':'boolean'},
'soldeinit':{'string':"Inclure les soldes initiaux",'type':'boolean'},
'amount_currency':{'string':"with amount in currency",'type':'boolean'}
'amount_currency':{'string':"With Currency",'type':'boolean'},
'date_from': {'string':" Start date",'type':'date','required':True ,'default': lambda *a: time.strftime('%Y-01-01')},
'date_to': {'string':"End date",'type':'date','required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
}
def _check_path(self, cr, uid, data, context):
if data['model'] == 'account.account':
@ -101,6 +127,7 @@ def _check(self, cr, uid, data, context):
return 'report'
def _check_date(self, cr, uid, data, context):
sql = """
SELECT f.id, f.date_start, f.date_stop FROM account_fiscalyear f Where '%s' between f.date_start and f.date_stop """%(data['form']['date_from'])
cr.execute(sql)
@ -113,24 +140,37 @@ def _check_date(self, cr, uid, data, context):
else:
raise wizard.except_wizard('UserError','Date not in a defined fiscal year')
def _check_state(self, cr, uid, data, context):
if data['form']['state'] == 'bydate':
_check_date(self, cr, uid, data, context)
data['form']['fiscalyear'] = 0
else :
data['form']['fiscalyear'] = 1
return data['form']
class wizard_report(wizard.interface):
def _get_defaults(self, cr, uid, data, context):
user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid, context=context)
if user.company_id:
company_id = user.company_id.id
else:
company_id = pooler.get_pool(cr.dbname).get('res.company').search(cr, uid, [('parent_id', '=', False)])[0]
data['form']['company_id'] = company_id
fiscalyear_obj = pooler.get_pool(cr.dbname).get('account.fiscalyear')
data['form']['fiscalyear'] = fiscalyear_obj.find(cr, uid)
periods_obj=pooler.get_pool(cr.dbname).get('account.period')
data['form']['periods'] =periods_obj.search(cr, uid, [('fiscalyear_id','=',data['form']['fiscalyear'])])
data['form']['sortbydate'] = 'sort_date'
data['form']['display_account']='bal_all'
data['form']['landscape']=True
data['form']['fiscalyear'] = False
data['form']['amount_currency'] = True
return data['form']
def _get_defaults_fordate(self, cr, uid, data, context):
data['form']['sortbydate'] = 'sort_date'
data['form']['display_account']='bal_all'
data['form']['landscape']=True
data['form']['amount_currency'] = True
return data['form']
states = {
'init': {
@ -139,34 +179,22 @@ class wizard_report(wizard.interface):
},
'account_selection': {
'actions': [],
'result': {'type':'form', 'arch':account_form,'fields':account_fields, 'state':[('end','Cancel'),('checktype','Print')]}
'result': {'type':'form', 'arch':account_form,'fields':account_fields, 'state':[('end','Cancel','gtk-cancel'),('checktype','Next','gtk-go-forward')]}
},
'checktype': {
'actions': [],
'result': {'type':'form', 'arch':report_type,'fields':{}, 'state':[('with_period','Use with Period'),('with_date','Use with Date')]}
},
'with_period': {
'actions': [_get_defaults],
'result': {'type':'form', 'arch':period_form, 'fields':period_fields, 'state':[('end','Cancel'),('checkreport','Print')]}
},
'with_date': {
'actions': [_get_defaults_fordate],
'result': {'type':'form', 'arch':dates_form, 'fields':dates_fields, 'state':[('end','Cancel'),('checkdate','Print')]}
},
'checkdate': {
'actions': [],
'result': {'type':'choice','next_state':_check_date}
'result': {'type':'form', 'arch':period_form, 'fields':period_fields, 'state':[('end','Cancel','gtk-cancel'),('checkreport','Print','gtk-print')]}
},
'checkreport': {
'actions': [],
'result': {'type':'choice','next_state':_check}
},
'report_landscape': {
'actions': [],
'actions': [_check_state],
'result': {'type':'print', 'report':'account.general.ledger_landscape', 'state':'end'}
},
'report': {
'actions': [],
'actions': [_check_state],
'result': {'type':'print', 'report':'account.general.ledger', 'state':'end'}
}
}

View File

@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# $Id$
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

View File

@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# $Id$
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

View File

@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# $Id$
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

View File

@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# $Id$
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

View File

@ -1,31 +1,24 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 Tiny SPRL (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# $Id$
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
###############################################################################
##############################################################################
import wizard
import netsvc
import pooler

View File

@ -1,27 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2005-2006 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
@ -30,7 +25,7 @@ import wizard
import pooler
period_form = '''<?xml version="1.0"?>
<form string="Select period" colspan="4">
<form string="Select Date-Period">
<field name="company_id"/>
<field name="result_selection"/>
<newline/>
@ -59,10 +54,11 @@ period_fields = {
'string':"Date/Period Filter",
'type':'selection',
'selection':[('bydate','By Date'),('byperiod','By Period'),('all','By Date and Period'),('none','No Filter')],
'default': lambda *a:'bydate'
'default': lambda *a:'none'
},
'fiscalyear': {
'string':'Fiscal year', 'type': 'many2one', 'relation': 'account.fiscalyear',
'default': lambda *a:False,
'help': 'Keep empty for all open fiscal year'
},
'periods': {'string': 'Periods', 'type': 'many2many', 'relation': 'account.period', 'help': 'All periods if empty','states':{'none':[('readonly',True)],'bydate':[('readonly',True)]}},
@ -92,6 +88,7 @@ class wizard_report(wizard.interface):
data['form']['periods'] =periods_obj.search(cr, uid, [('fiscalyear_id','=',data['form']['fiscalyear'])])
data['form']['company_id'] = company_id
data['form']['soldeinit'] = True
data['form']['fiscalyear'] = False
data['form']['result_selection'] = 'all'
return data['form']
@ -119,7 +116,7 @@ class wizard_report(wizard.interface):
states = {
'init': {
'actions': [_get_defaults],
'result': {'type':'form', 'arch':period_form, 'fields':period_fields, 'state':[('end','Cancel'),('report','Print')]}
'result': {'type':'form', 'arch':period_form, 'fields':period_fields, 'state':[('end','Cancel','gtk-cancel'),('report','Print','gtk-print')]}
},
'report': {

View File

@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# $Id$
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

View File

@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# $Id$
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

View File

@ -0,0 +1,60 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import wizard
import pooler
form = '''<?xml version="1.0"?>
<form string="Print Journal">
<field name="journal_id"/>
<field name="period_id"/>
<field name="sort_selection"/>
</form>'''
fields = {
'journal_id': {'string': 'Journal', 'type': 'many2many', 'relation': 'account.journal', 'required': True},
'period_id': {'string': 'Period', 'type': 'many2many', 'relation': 'account.period', 'required': True},
'sort_selection':{
'string':"Entries Sorted By",
'type':'selection',
'selection':[('date','By date'),('ref','Reference Number')],
'required':True,
'default': lambda *a: 'date',
},
}
class wizard_print_journal(wizard.interface):
states = {
'init': {
'actions': [],
'result': {'type': 'form', 'arch': form, 'fields': fields, 'state': (('end', 'Cancel'), ('print', 'Print'))},
},
'print': {
'actions': [],
'result': {'type':'print', 'report':'account.journal.period.print.wiz', 'state':'end'},
},
}
wizard_print_journal('account.print.journal.report')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# $Id$
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

View File

@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# $Id$
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

View File

@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# $Id$
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

View File

@ -1,28 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# #
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

View File

@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# $Id$
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

View File

@ -1,27 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2005-2006 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
@ -31,17 +26,17 @@ import pooler
period_form = '''<?xml version="1.0"?>
<form string="Select period">
<field name="company_id"/>
<form string="Select Date-Period">
<field name="company_id"/>
<field name="result_selection"/>
<newline/>
<field name="fiscalyear"/>
<label colspan="2" string="(Keep empty for all open fiscal years)" align="0.0"/>
<group colspan = "4" >
<field name="reconcil"/>
<field name="page_split"/>
</group>
<field name="reconcil"/>
<field name="page_split"/>
</group>
<newline/>
<separator string="Filters" colspan="4"/>
<field name="state" required="True"/>
@ -60,16 +55,17 @@ period_form = '''<?xml version="1.0"?>
</form>'''
period_fields = {
'company_id': {'string': 'Company', 'type': 'many2one', 'relation': 'res.company', 'required': True},
'company_id': {'string': 'Company', 'type': 'many2one', 'relation': 'res.company', 'required': True},
'state':{
'string':"Date/Period Filter",
'type':'selection',
'selection':[('bydate','By Date'),('byperiod','By Period'),('all','By Date and Period'),('none','No Filter')],
'default': lambda *a:'bydate'
'default': lambda *a:'none'
},
'fiscalyear': {
'string':'Fiscal year', 'type': 'many2one', 'relation': 'account.fiscalyear',
'help': 'Keep empty for all open fiscal year'
'help': 'Keep empty for all open fiscal year',
'default': lambda *a:False,
},
'periods': {'string': 'Periods', 'type': 'many2many', 'relation': 'account.period', 'help': 'All periods if empty','states':{'none':[('readonly',True)],'bydate':[('readonly',True)]}},
'result_selection':{
@ -78,70 +74,70 @@ period_fields = {
'selection':[('customer','Receivable Accounts'),('supplier','Payable Accounts'),('all','Receivable and Payable Accounts')],
'required':True
},
'soldeinit':{'string':"Inclure les soldes initiaux",'type':'boolean'},
'reconcil':{'string':" Include Reconciled Entries",'type':'boolean'},
'page_split':{'string':"One Partner Per Page",'type':'boolean'},
'date1': {'string':' Start date', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-01-01')},
'date2': {'string':'End date', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
'soldeinit':{'string':"Inclure les soldes initiaux",'type':'boolean'},
'reconcil':{'string':" Include Reconciled Entries",'type':'boolean'},
'page_split':{'string':"One Partner Per Page",'type':'boolean'},
'date1': {'string':' Start date', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-01-01')},
'date2': {'string':'End date', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
}
class wizard_report(wizard.interface):
def _get_defaults(self, cr, uid, data, context):
fiscalyear_obj = pooler.get_pool(cr.dbname).get('account.fiscalyear')
data['form']['fiscalyear'] = fiscalyear_obj.find(cr, uid)
data['form']['display_account']='bal_all'
data['form']['result_selection'] = 'all'
user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid, context=context)
if user.company_id:
company_id = user.company_id.id
else:
company_id = pooler.get_pool(cr.dbname).get('res.company').search(cr, uid, [('parent_id', '=', False)])[0]
data['form']['company_id'] = company_id
periods_obj=pooler.get_pool(cr.dbname).get('account.period')
data['form']['periods'] =periods_obj.search(cr, uid, [('fiscalyear_id','=',data['form']['fiscalyear'])])
data['form']['page_split'] = False
data['form']['reconcil'] = False
data['form']['soldeinit'] = True
return data['form']
def _check_date(self, cr, uid, data, context):
sql = """
SELECT f.id, f.date_start, f.date_stop FROM account_fiscalyear f Where '%s' between f.date_start and f.date_stop """%(data['form']['date1'])
cr.execute(sql)
res = cr.dictfetchall()
if res:
if (data['form']['date2'] > res[0]['date_stop'] or data['form']['date2'] < res[0]['date_start']):
raise wizard.except_wizard('UserError','Date to must be set between ' + res[0]['date_start'] + " and " + res[0]['date_stop'])
else:
return 'report'
else:
raise wizard.except_wizard('UserError','Date not in a defined fiscal year')
def _check_state(self, cr, uid, data, context):
if data['form']['state'] == 'byperiod':
data['form']['fiscalyear'] = True
else :
self._check_date(cr, uid, data, context)
data['form']['fiscalyear'] = False
return data['form']
def _get_defaults(self, cr, uid, data, context):
fiscalyear_obj = pooler.get_pool(cr.dbname).get('account.fiscalyear')
data['form']['fiscalyear'] = fiscalyear_obj.find(cr, uid)
data['form']['display_account']='bal_all'
data['form']['result_selection'] = 'all'
user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid, context=context)
if user.company_id:
company_id = user.company_id.id
else:
company_id = pooler.get_pool(cr.dbname).get('res.company').search(cr, uid, [('parent_id', '=', False)])[0]
data['form']['company_id'] = company_id
periods_obj=pooler.get_pool(cr.dbname).get('account.period')
data['form']['periods'] =periods_obj.search(cr, uid, [('fiscalyear_id','=',data['form']['fiscalyear'])])
data['form']['fiscalyear'] =False
data['form']['page_split'] = False
data['form']['reconcil'] = False
data['form']['soldeinit'] = True
return data['form']
def _check_date(self, cr, uid, data, context):
sql = """
SELECT f.id, f.date_start, f.date_stop FROM account_fiscalyear f Where '%s' between f.date_start and f.date_stop """%(data['form']['date1'])
cr.execute(sql)
res = cr.dictfetchall()
if res:
if (data['form']['date2'] > res[0]['date_stop'] or data['form']['date2'] < res[0]['date_start']):
raise wizard.except_wizard('UserError','Date to must be set between ' + res[0]['date_start'] + " and " + res[0]['date_stop'])
else:
return 'report'
else:
raise wizard.except_wizard('UserError','Date not in a defined fiscal year')
def _check_state(self, cr, uid, data, context):
if data['form']['state'] == 'bydate' or data['form']['state'] == 'all':
data['form']['fiscalyear'] = False
else :
data['form']['fiscalyear'] = True
self._check_date(cr, uid, data, context)
return data['form']
states = {
'init': {
'actions': [_get_defaults],
'result': {'type':'form', 'arch':period_form, 'fields':period_fields, 'state':[('end','Cancel'),('report','Print')]}
},
'report': {
'actions': [_check_state],
'result': {'type':'print', 'report':'account.third_party_ledger', 'state':'end'}
}
}
states = {
'init': {
'actions': [_get_defaults],
'result': {'type':'form', 'arch':period_form, 'fields':period_fields, 'state':[('end','Cancel','gtk-cancel'),('report','Print','gtk-print')]}
},
'report': {
'actions': [_check_state],
'result': {'type':'print', 'report':'account.third_party_ledger', 'state':'end'}
}
}
wizard_report('account.third_party_ledger.report')

View File

@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# $Id$
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

View File

@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# $Id$
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

View File

@ -1,4 +1,24 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import wizard
import time
import datetime
@ -22,7 +42,7 @@ fields = {
}
def _create_entries(self, cr, uid, data, context):
pool_obj = pooler.get_pool(cr.dbname)
if data['model']=='ir.ui.menu':
if data['model']=='ir.ui.menu' or data['model']=='account.move.line':
model_ids = data['form']['model'][0][2]
data_model = pool_obj.get('account.model').browse(cr,uid,model_ids)
else:
@ -95,7 +115,7 @@ class use_model(wizard.interface):
}
def _check(self, cr, uid, data, context):
if data['model']=='ir.ui.menu':
if data['model']=='ir.ui.menu' or data['model']=='account.move.line':
return 'init_form'
return 'create'

View File

@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# $Id$
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

Some files were not shown because too many files have changed in this diff Show More