[MERGE]: Merge with lp:openobject-trunk-dev-addons2

bzr revid: ksa@tinyerp.co.in-20100928045605-8ah6996a6k447sjp
This commit is contained in:
ksa (Open ERP) 2010-09-28 10:26:05 +05:30
commit fe7e284a31
272 changed files with 3980 additions and 4236 deletions

View File

@ -49,7 +49,6 @@ module named account_voucher.
'security/ir.model.access.csv',
'account_menuitem.xml',
'account_wizard.xml',
'wizard/account_statement_from_invoice_view.xml',
'wizard/account_move_bank_reconcile_view.xml',
'wizard/account_use_model_view.xml',
'account_installer.xml',
@ -81,7 +80,6 @@ module named account_voucher.
'wizard/account_report_partner_balance_view.xml',
'wizard/account_report_account_balance_view.xml',
'wizard/account_report_aged_partner_balance_view.xml',
'wizard/account_compare_account_balance_report_view.xml',
'wizard/account_report_partner_ledger_view.xml',
'wizard/account_reconcile_view.xml',
'wizard/account_reconcile_partner_process_view.xml',

View File

@ -65,10 +65,10 @@ class account_payment_term(osv.osv):
}
_order = "name"
def compute(self, cr, uid, id, value, date_ref=False, context={}):
def compute(self, cr, uid, id, value, date_ref=False, context=None):
if not date_ref:
date_ref = datetime.now().strftime('%Y-%m-%d')
pt = self.browse(cr, uid, id, context)
pt = self.browse(cr, uid, id, context=context)
amount = value
result = []
for line in pt.line_ids:
@ -125,7 +125,7 @@ class account_payment_term_line(osv.osv):
}
_order = "sequence"
def _check_percent(self, cr, uid, ids, context={}):
def _check_percent(self, cr, uid, ids, context=None):
obj = self.browse(cr, uid, ids[0])
if obj.value == 'procent' and ( obj.value_amount < 0.0 or obj.value_amount > 1.0):
return False
@ -156,21 +156,22 @@ class account_account_type(osv.osv):
('expense','Profit & Loss (Expense Accounts)'),
('asset','Balance Sheet (Assets Accounts)'),
('liability','Balance Sheet (Liability Accounts)')
],'Type Heads', select=True, readonly=False, help="According value related accounts will be display on respective reports (Balance Sheet Profit & Loss Account)"),
],'Type Heads', select=True, readonly=False, help="According value related accounts will be display on respective reports (Balance Sheet Profit & Loss Account)", required=True),
'note': fields.text('Description'),
}
_defaults = {
'close_method': 'none',
'sign': 1,
'report_type': 'none',
}
_order = "code"
account_account_type()
def _code_get(self, cr, uid, context={}):
def _code_get(self, cr, uid, context=None):
acc_type_obj = self.pool.get('account.account.type')
ids = acc_type_obj.search(cr, uid, [])
res = acc_type_obj.read(cr, uid, ids, ['code', 'name'], context)
res = acc_type_obj.read(cr, uid, ids, ['code', 'name'], context=context)
return [(r['code'], r['name']) for r in res]
#----------------------------------------------------------
@ -463,10 +464,10 @@ class account_account(osv.osv):
ids = self.search(cr, user, args, context=context, limit=limit)
return self.name_get(cr, user, ids, context=context)
def name_get(self, cr, uid, ids, context={}):
def name_get(self, cr, uid, ids, context=None):
if not len(ids):
return []
reads = self.read(cr, uid, ids, ['name', 'code'], context)
reads = self.read(cr, uid, ids, ['name', 'code'], context=context)
res = []
for record in reads:
name = record['name']
@ -475,7 +476,7 @@ class account_account(osv.osv):
res.append((record['id'], name))
return res
def copy(self, cr, uid, id, default={}, context={}, done_list=[], local=False):
def copy(self, cr, uid, id, default={}, context=None, done_list=[], local=False):
account = self.browse(cr, uid, id, context=context)
new_child_ids = []
if not default:
@ -562,7 +563,8 @@ account_journal_view()
class account_journal_column(osv.osv):
def _col_get(self, cr, user, context={}):
def _col_get(self, cr, user, context=None):
result = []
cols = self.pool.get('account.move.line')._columns
for col in cols:
@ -571,6 +573,7 @@ class account_journal_column(osv.osv):
result.append( (col, cols[col].string) )
result.sort()
return result
_name = "account.journal.column"
_description = "Journal Column"
_columns = {
@ -628,7 +631,7 @@ class account_journal(osv.osv):
raise osv.except_osv(_('Warning !'), _('You cannot modify company of this journal as its related record exist in Entry Lines'))
return super(account_journal, self).write(cr, uid, ids, vals, context=context)
def create_sequence(self, cr, uid, vals, context={}):
def create_sequence(self, cr, uid, vals, context=None):
"""
Create new entry sequence for every new Joural
@param cr: cursor to database
@ -669,12 +672,12 @@ class account_journal(osv.osv):
}
return seq_pool.create(cr, uid, seq)
def create(self, cr, uid, vals, context={}):
def create(self, cr, uid, vals, context=None):
if not 'sequence_id' in vals or not vals['sequence_id']:
vals.update({'sequence_id' : self.create_sequence(cr, uid, vals, context)})
return super(account_journal, self).create(cr, uid, vals, context)
def name_get(self, cr, user, ids, context={}):
def name_get(self, cr, user, ids, context=None):
"""
Returns a list of tupples containing id, name.
result format : {[(id, name), (id, name), ...]}
@ -1699,6 +1702,11 @@ class account_tax(osv.osv):
ids = self.search(cr, user, args, limit=limit, context=context)
return self.name_get(cr, user, ids, context=context)
def write(self, cr, uid, ids, vals, context=None):
if vals.get('type', False) and vals['type'] in ('none', 'code'):
vals.update({'amount': 0.0})
return super(account_tax, self).write(cr, uid, ids, vals, context=context)
def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False):
journal_pool = self.pool.get('account.journal')
@ -1994,32 +2002,34 @@ class account_model(osv.osv):
_columns = {
'name': fields.char('Model Name', size=64, required=True, help="This is a model for recurring accounting entries"),
'journal_id': fields.many2one('account.journal', 'Journal', required=True),
'company_id': fields.many2one('res.company', 'Company', required=True),
'company_id': fields.related('journal_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True),
'lines_id': fields.one2many('account.model.line', 'model_id', 'Model Entries'),
'legend' :fields.text('Legend', readonly=True, size=100),
}
_defaults = {
'legend': lambda self, cr, uid, context:_('You can specify year, month and date in the name of the model using the following labels:\n\n%(year)s : To Specify Year \n%(month)s : To Specify Month \n%(date)s : Current Date\n\ne.g. My model on %(date)s'),
'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id,
}
def generate(self, cr, uid, ids, datas={}, context={}):
def generate(self, cr, uid, ids, datas={}, context=None):
move_ids = []
entry = {}
account_move_obj = self.pool.get('account.move')
account_move_line_obj = self.pool.get('account.move.line')
pt_obj = self.pool.get('account.payment.term')
if datas.get('date', False):
context.update({'date':datas['date']})
period_id = self.pool.get('account.period').find(cr, uid, dt=context.get('date', False))
if context is None:
context = {}
if datas.get('date', False):
context.update({'date': datas['date']})
period_id = self.pool.get('account.period').find(cr, uid, dt=context.get('date', False))
if not period_id:
raise osv.except_osv(_('No period found !'), _('Unable to find a valid period !'))
period_id = period_id[0]
for model in self.browse(cr, uid, ids, context):
entry['name'] = model.name%{'year':time.strftime('%Y'), 'month':time.strftime('%m'), 'date':time.strftime('%d')}
entry['name'] = model.name%{'year':time.strftime('%Y'), 'month':time.strftime('%m'), 'date':time.strftime('%Y-%m')}
move_id = account_move_obj.create(cr, uid, {
'ref': entry['name'],
'period_id': period_id,
@ -2067,7 +2077,9 @@ class account_model(osv.osv):
c = context.copy()
c.update({'journal_id': model.journal_id.id,'period_id': period_id})
account_move_line_obj.create(cr, uid, val, context=c)
return move_ids
account_model()
class account_model_line(osv.osv):
@ -2539,6 +2551,7 @@ class wizard_multi_charts_accounts(osv.osv_memory):
obj_fiscal_position_template = self.pool.get('account.fiscal.position.template')
obj_fiscal_position = self.pool.get('account.fiscal.position')
data_pool = self.pool.get('ir.model.data')
analytic_journal_obj = self.pool.get('account.analytic.journal')
# Creating Account
obj_acc_root = obj_multi.chart_template_id.account_root_id
@ -2664,11 +2677,15 @@ class wizard_multi_charts_accounts(osv.osv_memory):
vals_journal['view_id'] = view_id
#Sales Journal
analitical_sale_ids = analytic_journal_obj.search(cr,uid,[('type','=','sale')])
analitical_journal_sale = analitical_sale_ids and analitical_sale_ids[0] or False
vals_journal['name'] = _('Sales Journal')
vals_journal['type'] = 'sale'
vals_journal['code'] = _('SAJ')
vals_journal['sequence_id'] = seq_id_sale
vals_journal['company_id'] = company_id
vals_journal['analytic_journal_id'] = analitical_journal_sale
if obj_multi.chart_template_id.property_account_receivable:
vals_journal['default_credit_account_id'] = acc_template_ref[obj_multi.chart_template_id.property_account_income_categ.id]
@ -2677,12 +2694,16 @@ class wizard_multi_charts_accounts(osv.osv_memory):
obj_journal.create(cr,uid,vals_journal)
# Purchase Journal
analitical_purchase_ids = analytic_journal_obj.search(cr,uid,[('type','=','purchase')])
analitical_journal_purchase = analitical_purchase_ids and analitical_purchase_ids[0] or False
vals_journal['name'] = _('Purchase Journal')
vals_journal['type'] = 'purchase'
vals_journal['code'] = _('EXJ')
vals_journal['sequence_id'] = seq_id_purchase
vals_journal['view_id'] = view_id
vals_journal['company_id'] = company_id
vals_journal['analytic_journal_id'] = analitical_journal_purchase
if obj_multi.chart_template_id.property_account_payable:
vals_journal['default_credit_account_id'] = acc_template_ref[obj_multi.chart_template_id.property_account_expense_categ.id]
@ -2730,11 +2751,15 @@ class wizard_multi_charts_accounts(osv.osv_memory):
seq_id = obj_sequence.create(cr,uid,vals_seq)
#create the bank journal
analitical_bank_ids = analytic_journal_obj.search(cr,uid,[('type','=','situation')])
analitical_journal_bank = analitical_bank_ids and analitical_bank_ids[0] or False
vals_journal['name']= vals['name']
vals_journal['code']= _('BNK') + str(current_num)
vals_journal['sequence_id'] = seq_id
vals_journal['type'] = 'cash'
vals_journal['company_id'] = company_id
vals_journal['analytic_journal_id'] = analitical_journal_bank
if line.currency_id:
vals_journal['view_id'] = view_id_cur
@ -2743,8 +2768,7 @@ class wizard_multi_charts_accounts(osv.osv_memory):
vals_journal['view_id'] = view_id_cash
vals_journal['default_credit_account_id'] = acc_cash_id
vals_journal['default_debit_account_id'] = acc_cash_id
obj_journal.create(cr,uid,vals_journal)
obj_journal.create(cr, uid, vals_journal)
current_num += 1
#create the properties
@ -2809,14 +2833,6 @@ class wizard_multi_charts_accounts(osv.osv_memory):
}
obj_ac_fp.create(cr, uid, vals_acc)
#fially inactive the demo chart of accounts
data_id = data_pool.search(cr, uid, [('model','=','account.account'), ('name','=','chart0')])
if data_id:
data = data_pool.browse(cr, uid, data_id[0])
account_id = data.res_id
acc_ids = obj_acc._get_children_and_consol(cr, uid, [account_id])
if acc_ids:
cr.execute("update account_account set active='f' where id in " + str(tuple(acc_ids)))
wizard_multi_charts_accounts()
class account_bank_accounts_wizard(osv.osv_memory):

View File

@ -71,18 +71,22 @@ class account_analytic_line(osv.osv):
# Compute the cost based on the price type define into company
# property_valuation_price_type property
def on_change_unit_amount(self, cr, uid, id, prod_id, unit_amount,company_id,
def on_change_unit_amount(self, cr, uid, id, prod_id, quantity, company_id,
unit=False, journal_id=False, context=None):
if context==None:
context={}
uom_obj = self.pool.get('product.uom')
if not journal_id or not prod_id:
return {}
product_obj = self.pool.get('product.product')
company_obj=self.pool.get('res.company')
analytic_journal_obj=self.pool.get('account.analytic.journal')
product_price_type_obj = self.pool.get('product.price.type')
if prod_id:
result = 0.0
prod = product_obj.browse(cr, uid, prod_id)
analytic_journal_obj =self.pool.get('account.analytic.journal')
j_id = analytic_journal_obj.browse(cr, uid, journal_id, context=context)
prod = product_obj.browse(cr, uid, prod_id)
if not company_id:
company_id = j_id.company_id.id
result = 0.0
is_purchase = False
if j_id.type == 'purchase':
a = prod.product_tmpl_id.property_account_expense.id
if not a:
a = prod.categ_id.property_account_expense_categ.id
@ -91,32 +95,31 @@ class account_analytic_line(osv.osv):
_('There is no expense account defined ' \
'for this product: "%s" (id:%d)') % \
(prod.name, prod.id,))
if not company_id:
company_id=company_obj._company_default_get(cr, uid, 'account.analytic.line', context)
flag = False
# Compute based on pricetype
pricetype=product_price_type_obj.browse(cr, uid, company_obj.browse(cr,uid,company_id).property_valuation_price_type.id)
if journal_id:
journal = analytic_journal_obj.browse(cr, uid, journal_id)
if journal.type == 'sale':
product_price_type_ids = product_price_type_obj.search(cr, uid, [('field','=','list_price')], context)
if product_price_type_ids:
pricetype = product_price_type_obj.browse(cr, uid, product_price_type_ids, context)[0]
# Take the company currency as the reference one
if pricetype.field == 'list_price':
flag = True
amount_unit = prod.price_get(pricetype.field, context)[prod.id]
amount = amount_unit*unit_amount or 1.0
prec = self.pool.get('decimal.precision').precision_get(cr, uid, 'Account')
amount = amount_unit*unit_amount or 1.0
result = round(amount, prec)
if not flag:
result *= -1
return {'value': {
amount_unit = prod.price_get('standard_price', context)[prod.id]
is_purchase = True
else:
a = prod.product_tmpl_id.property_account_income.id
if not a:
a = prod.categ_id.property_account_income_categ.id
if not a:
raise osv.except_osv(_('Error !'),
_('There is no income account defined ' \
'for this product: "%s" (id:%d)') % \
(prod.name, prod_id,))
amount_unit = prod.price_get('list_price', context)[prod_id]
prec = self.pool.get('decimal.precision').precision_get(cr, uid, 'Account')
amount = amount_unit * quantity or 1.0
result = round(amount, prec)
if is_purchase:
result *= -1
return {
'value': {
'amount': result,
'general_account_id': a,
}}
return {}
}
}
def view_header_get(self, cr, user, view_id, view_type, context):
if context.get('account_id', False):

View File

@ -71,12 +71,10 @@ class account_bank_statement(osv.osv):
journal_pool = self.pool.get('account.journal')
journal_type = context.get('journal_type', False)
journal_id = False
if journal_type:
ids = journal_pool.search(cr, uid, [('type', '=', journal_type)])
if ids:
journal_id = ids[0]
return journal_id
def _default_balance_start(self, cr, uid, context={}):
@ -152,7 +150,7 @@ class account_bank_statement(osv.osv):
'name': fields.char('Name', size=64, required=True, help='if you give the Name other then /, its created Accounting Entries Move will be with same name as statement name. This allows the statement entries to have the same references than the statement itself', states={'confirm': [('readonly', True)]}),
'date': fields.date('Date', required=True, states={'confirm': [('readonly', True)]}),
'journal_id': fields.many2one('account.journal', 'Journal', required=True,
states={'confirm': [('readonly', True)]}, domain=[('type', '=', 'bank')]),
readonly=True, states={'draft':[('readonly',False)]}),
'period_id': fields.many2one('account.period', 'Period', required=True,
states={'confirm':[('readonly', True)]}),
'balance_start': fields.float('Starting Balance', digits_compute=dp.get_precision('Account'),
@ -176,15 +174,15 @@ class account_bank_statement(osv.osv):
}
_defaults = {
'name': lambda *a: "/",
'date': lambda *a: time.strftime('%Y-%m-%d'),
'state': lambda *a: 'draft',
'name': "/",
'date': time.strftime('%Y-%m-%d'),
'state': 'draft',
'balance_start': _default_balance_start,
'journal_id': _default_journal_id,
'period_id': _get_period,
}
def onchange_date(self, cr, user, ids, date, context={}):
def onchange_date(self, cr, user, ids, date, context=None):
"""
Returns a dict that contains new values and context
@param cr: A database cursor
@ -196,6 +194,10 @@ class account_bank_statement(osv.osv):
"""
res = {}
period_pool = self.pool.get('account.period')
if context is None:
context = {}
pids = period_pool.search(cr, user, [('date_start','<=',date), ('date_stop','>=',date)])
if pids:
res.update({
@ -210,10 +212,8 @@ class account_bank_statement(osv.osv):
'context':context,
}
def button_dummy(self, cr, uid, ids, context={}):
self.write(cr, uid, ids, {}, context)
return True
def button_dummy(self, cr, uid, ids, context=None):
return self.write(cr, uid, ids, {}, context=context)
def create_move_from_st_line(self, cr, uid, st_line_id, company_currency_id, st_line_number, context=None):
res_currency_obj = self.pool.get('res.currency')
@ -222,10 +222,10 @@ class account_bank_statement(osv.osv):
account_move_line_obj = self.pool.get('account.move.line')
account_analytic_line_obj = self.pool.get('account.analytic.line')
account_bank_statement_line_obj = self.pool.get('account.bank.statement.line')
st_line = account_bank_statement_line_obj.browse(cr, uid, st_line_id, context)
st = st_line.statement_id
context.update({'date': st_line.date})
move_id = account_move_obj.create(cr, uid, {
'journal_id': st.journal_id.id,
@ -284,7 +284,7 @@ class account_bank_statement(osv.osv):
move_line_id = account_move_line_obj.create(cr, uid, val , context=context)
torec.append(move_line_id)
# Fill the secondary amount/currency
# if currency is not the same than the company
amount_currency = False
@ -323,22 +323,33 @@ class account_bank_statement(osv.osv):
def get_next_st_line_number(self, cr, uid, st_number, st_line, context=None):
return st_number + ' - ' + str(st_line.sequence)
def balance_check(self, cr, uid, st_id, journal_type='bank', context=None):
st = self.browse(cr, uid, st_id, context)
if not (abs((st.balance_end or 0.0) - st.balance_end_real) < 0.0001):
raise osv.except_osv(_('Error !'),
_('The statement balance is incorrect !\n') +
_('The expected balance (%.2f) is different than the computed one. (%.2f)') % (st.balance_end_real, st.balance_end))
return True
def statement_close(self, cr, uid, ids, journal_type='bank', context=None):
return self.write(cr, uid, ids, {'state':'confirm'}, context=context)
def check_status_condition(self, cr, uid, state, journal_type='bank'):
return state=='draft'
def button_confirm_bank(self, cr, uid, ids, context=None):
done = []
obj_seq = self.pool.get('ir.sequence')
if context is None:
context = {}
for st in self.browse(cr, uid, ids, context):
j_type = st.journal_id.type
company_currency_id = st.journal_id.company_id.currency_id.id
if not st.state=='draft':
if not self.check_status_condition(cr, uid, st.state, journal_type=j_type):
continue
if not (abs((st.balance_end or 0.0) - st.balance_end_real) < 0.0001):
raise osv.except_osv(_('Error !'),
_('The statement balance is incorrect !\n') +
_('The expected balance (%.2f) is different than the computed one. (%.2f)') % (st.balance_end_real, st.balance_end))
self.balance_check(cr, uid, st.id, journal_type=j_type, context=context)
if (not st.journal_id.default_credit_account_id) \
or (not st.journal_id.default_debit_account_id):
raise osv.except_osv(_('Configuration Error !'),
@ -369,11 +380,9 @@ class account_bank_statement(osv.osv):
self.write(cr, uid, [st.id], {'name': st_number}, context=context)
self.log(cr, uid, st.id, 'Statement %s is confirmed and entries are created.' % st_number)
done.append(st.id)
return self.write(cr, uid, ids, {'state':'confirm'}, context=context)
self.write(cr, uid, done, {'state':'confirm'}, context=context)
return True
def button_cancel(self, cr, uid, ids, context={}):
def button_cancel(self, cr, uid, ids, context=None):
done = []
for st in self.browse(cr, uid, ids, context):
if st.state=='draft':
@ -383,8 +392,7 @@ class account_bank_statement(osv.osv):
ids += [x.id for x in line.move_ids]
self.pool.get('account.move').unlink(cr, uid, ids, context)
done.append(st.id)
self.write(cr, uid, done, {'state':'draft'}, context=context)
return True
return self.write(cr, uid, done, {'state':'draft'}, context=context)
def onchange_journal_id(self, cursor, user, statement_id, journal_id, context=None):
account_journal_obj = self.pool.get('account.journal')
@ -404,7 +412,7 @@ class account_bank_statement(osv.osv):
if t['state'] in ('draft'):
unlink_ids.append(t['id'])
else:
raise osv.except_osv(_('Invalid action !'), _('Cannot delete bank statement which are already confirmed !'))
raise osv.except_osv(_('Invalid action !'), _('Cannot delete bank statement(s) which are already confirmed !'))
osv.osv.unlink(self, cr, uid, unlink_ids, context=context)
return True
@ -415,7 +423,7 @@ class account_bank_statement(osv.osv):
context = {}
default = default.copy()
default['move_line_ids'] = []
return super(account_bank_statement, self).copy(cr, uid, id, default, context)
return super(account_bank_statement, self).copy(cr, uid, id, default, context=context)
account_bank_statement()
@ -487,8 +495,8 @@ class account_bank_statement_line(osv.osv):
}
_defaults = {
'name': lambda self,cr,uid,context={}: self.pool.get('ir.sequence').get(cr, uid, 'account.bank.statement.line'),
'date': lambda *a: time.strftime('%Y-%m-%d'),
'type': lambda *a: 'general',
'date': time.strftime('%Y-%m-%d'),
'type': 'general',
}
account_bank_statement_line()

View File

@ -20,9 +20,10 @@
#
##############################################################################
from osv import osv, fields
import time
from mx import DateTime
from osv import osv, fields
from decimal import Decimal
from tools.translate import _
import decimal_precision as dp
@ -204,7 +205,6 @@ class account_cash_statement(osv.osv):
return res
_columns = {
'journal_id': fields.many2one('account.journal', 'Journal', required=True, states={'draft': [('readonly', False)]}, readonly=True, domain=[('type', '=', 'cash')]),
'balance_end_real': fields.float('Closing Balance', digits_compute=dp.get_precision('Account'), states={'confirm':[('readonly', True)]}, help="closing balance entered by the cashbox verifier"),
'state': fields.selection(
[('draft', 'Draft'),
@ -291,7 +291,10 @@ class account_cash_statement(osv.osv):
res = super(account_cash_statement, self).onchange_journal_id(cr, uid, statement_id, journal_id, context=context)
return res
def _equal_balance(self, cr, uid, ids, statement, context={}):
def _equal_balance(self, cr, uid, cash_id, context=None):
statement = self.browse(cr, uid, cash_id, context=context)
self.write(cr, uid, [cash_id], {'balance_end_real': statement.balance_end})
statement.balance_end_real = statement.balance_end
if statement.balance_end != statement.balance_end_cash:
return False
else:
@ -320,26 +323,6 @@ class account_cash_statement(osv.osv):
'name': number
})
# cr.execute("select id from account_bank_statement where journal_id=%s and user_id=%s and state=%s order by id desc limit 1", (statement.journal_id.id, uid, 'confirm'))
# rs = cr.fetchone()
# rs = rs and rs[0] or None
# if rs:
# if len(statement.starting_details_ids) > 0:
# sid = []
# for line in statement.starting_details_ids:
# sid.append(line.id)
# cash_pool.unlink(cr, uid, sid)
#
# statement = statement_pool.browse(cr, uid, rs)
# balance_start = statement.balance_end_real or 0.0
# open_ids = cash_pool.search(cr, uid, [('ending_id','=',statement.id)])
# for sid in open_ids:
# default = {
# 'ending_id': False,
# 'starting_id':ids[0]
# }
# cash_pool.copy(cr, uid, sid, default)
vals.update({
'date':time.strftime("%Y-%m-%d %H:%M:%S"),
'state':'open',
@ -349,204 +332,31 @@ class account_cash_statement(osv.osv):
self.write(cr, uid, ids, vals)
return True
def button_confirm_cash(self, cr, uid, ids, context={}):
""" Check the starting and ending detail of statement
@return: True
"""
done = []
res_currency_obj = self.pool.get('res.currency')
res_users_obj = self.pool.get('res.users')
account_move_obj = self.pool.get('account.move')
account_move_line_obj = self.pool.get('account.move.line')
account_analytic_line_obj = self.pool.get('account.analytic.line')
account_bank_statement_line_obj = self.pool.get('account.bank.statement.line')
company_currency_id = res_users_obj.browse(cr, uid, uid, context=context).company_id.currency_id.id
for st in self.browse(cr, uid, ids, context):
self.write(cr, uid, [st.id], {'balance_end_real':st.balance_end})
st.balance_end_real = st.balance_end
if not st.state == 'open':
continue
if not self._equal_balance(cr, uid, ids, st, context):
raise osv.except_osv(_('Error !'), _('CashBox Balance is not matching with Calculated Balance !'))
if (not st.journal_id.default_credit_account_id) \
or (not st.journal_id.default_debit_account_id):
raise osv.except_osv(_('Configuration Error !'),
_('Please verify that an account is defined in the journal.'))
for line in st.move_line_ids:
if line.state <> 'valid':
raise osv.except_osv(_('Error !'),
_('The account entries lines are not in valid state.'))
# for bank.statement.lines
# In line we get reconcile_id on bank.ste.rec.
# in bank stat.rec we get line_new_ids on bank.stat.rec.line
for move in st.line_ids:
if move.analytic_account_id:
if not st.journal_id.analytic_journal_id:
raise osv.except_osv(_('No Analytic Journal !'),_("You have to define an analytic journal on the '%s' journal!") % (st.journal_id.name,))
context.update({'date':move.date})
move_id = account_move_obj.create(cr, uid, {
'journal_id': st.journal_id.id,
'period_id': st.period_id.id,
'date': move.date,
}, context=context)
account_bank_statement_line_obj.write(cr, uid, [move.id], {
'move_ids': [(4,move_id, False)]
})
if not move.amount:
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,
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
val = {
'name': move.name,
'date': move.date,
'ref': move.ref,
'move_id': move_id,
'partner_id': ((move.partner_id) and move.partner_id.id) or False,
'account_id': (move.account_id) and move.account_id.id,
'credit': ((amount>0) and amount) or 0.0,
'debit': ((amount<0) and -amount) or 0.0,
'statement_id': st.id,
'journal_id': st.journal_id.id,
'period_id': st.period_id.id,
'currency_id': st.currency.id,
'analytic_account_id': move.analytic_account_id and move.analytic_account_id.id or False
}
amount = res_currency_obj.compute(cr, uid, st.currency.id,
company_currency_id, move.amount, context=context,
account=acc_cur)
if st.currency.id <> company_currency_id:
amount_cur = res_currency_obj.compute(cr, uid, company_currency_id,
st.currency.id, amount, context=context,
account=acc_cur)
val['amount_currency'] = -amount_cur
if move.account_id and move.account_id.currency_id and move.account_id.currency_id.id <> company_currency_id:
val['currency_id'] = move.account_id.currency_id.id
if company_currency_id==move.account_id.currency_id.id:
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,
account=acc_cur)
val['amount_currency'] = amount_cur
move_line_id = account_move_line_obj.create(cr, uid, val , context=context)
torec.append(move_line_id)
# if move.analytic_account_id:
# anal_val = {}
# amt = (val['credit'] or 0.0) - (val['debit'] or 0.0)
# anal_val = {
# 'name': val['name'],
# 'ref': val['ref'],
# 'date': val['date'],
# 'amount': amt,
# 'account_id': val['analytic_account_id'],
# 'currency_id': val['currency_id'],
# 'general_account_id': val['account_id'],
# 'journal_id': st.journal_id.analytic_journal_id.id,
# 'period_id': val['period_id'],
# 'user_id': uid,
# 'move_id': move_line_id
# }
# if val.get('amount_currency', False):
# anal_val['amount_currency'] = val['amount_currency']
# account_analytic_line_obj.create(cr, uid, anal_val, context=context)
if move.reconcile_id and move.reconcile_id.line_new_ids:
for newline in move.reconcile_id.line_new_ids:
account_move_line_obj.create(cr, uid, {
'name': newline.name or move.name,
'date': move.date,
'ref': move.ref,
'move_id': move_id,
'partner_id': ((move.partner_id) and move.partner_id.id) or False,
'account_id': (newline.account_id) and newline.account_id.id,
'debit': newline.amount>0 and newline.amount or 0.0,
'credit': newline.amount<0 and -newline.amount or 0.0,
'statement_id': st.id,
'journal_id': st.journal_id.id,
'period_id': st.period_id.id,
'analytic_account_id':newline.analytic_id and newline.analytic_id.id or False,
}, context=context)
# Fill the secondary amount/currency
# if currency is not the same than the company
amount_currency = False
currency_id = False
if st.currency.id <> company_currency_id:
amount_currency = move.amount
currency_id = st.currency.id
account_move_line_obj.create(cr, uid, {
'name': move.name,
'date': move.date,
'ref': move.ref,
'move_id': move_id,
'partner_id': ((move.partner_id) and move.partner_id.id) or False,
'account_id': account_id,
'credit': ((amount < 0) and -amount) or 0.0,
'debit': ((amount > 0) and amount) or 0.0,
'statement_id': st.id,
'journal_id': st.journal_id.id,
'period_id': st.period_id.id,
'amount_currency': amount_currency,
'currency_id': currency_id,
}, context=context)
for line in account_move_line_obj.browse(cr, uid, [x.id for x in
account_move_obj.browse(cr, uid, move_id,
context=context).line_id],
context=context):
if line.state <> 'valid':
raise osv.except_osv(_('Error !'),
_('Journal Item "%s" is not valid') % line.name)
if move.reconcile_id and move.reconcile_id.line_ids:
torec += map(lambda x: x.id, move.reconcile_id.line_ids)
if abs(move.reconcile_amount-move.amount)<0.0001:
writeoff_acc_id = False
#There should only be one write-off account!
for entry in move.reconcile_id.line_new_ids:
writeoff_acc_id = entry.account_id.id
break
account_move_line_obj.reconcile(cr, uid, torec, 'statement', writeoff_acc_id=writeoff_acc_id, writeoff_period_id=st.period_id.id, writeoff_journal_id=st.journal_id.id, context=context)
else:
account_move_line_obj.reconcile_partial(cr, uid, torec, 'statement', context)
move_name = st.name + ' - ' + str(move.sequence)
account_move_obj.write(cr, uid, [move_id], {'state':'posted', 'name': move_name})
done.append(st.id)
def balance_check(self, cr, uid, cash_id, journal_type='bank', context=None):
if journal_type == 'bank':
return super(account_cash_statement, self).balance_check(cr, uid, cash_id, journal_type, context)
if not self._equal_balance(cr, uid, cash_id, context):
raise osv.except_osv(_('Error !'), _('CashBox Balance is not matching with Calculated Balance !'))
return True
def statement_close(self, cr, uid, ids, journal_type='bank', context=None):
if journal_type == 'bank':
return super(account_cash_statement, self).statement_close(cr, uid, ids, journal_type, context)
vals = {
'state':'confirm',
'closing_date':time.strftime("%Y-%m-%d %H:%M:%S")
}
self.write(cr, uid, done, vals, context=context)
return True
return self.write(cr, uid, ids, vals, context=context)
def check_status_condition(self, cr, uid, state, journal_type='bank'):
if journal_type == 'bank':
return super(account_cash_statement, self).check_status_condition(cr, uid, state, journal_type)
return state=='open'
def button_confirm_cash(self, cr, uid, ids, context=None):
super(account_cash_statement, self).button_confirm_bank(cr, uid, ids, context=context)
return self.write(cr, uid, ids, {'closing_date':time.strftime("%Y-%m-%d %H:%M:%S")}, context=context)
def button_cancel(self, cr, uid, ids, context={}):
done = []
@ -560,4 +370,3 @@ class account_cash_statement(osv.osv):
return True
account_cash_statement()

View File

@ -62,7 +62,7 @@
<field colspan="4" name="name"/>
<field colspan="4" name="origin" groups="base.group_extended"/>
<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.fiscal_position,account_id)" groups="base.group_user"/>
<field domain="[('type','&lt;&gt;','view'), ('company_id', '=', parent.company_id), ('parent_id', '!=', False)]" name="account_analytic_id" groups="base.group_extended"/>
<field domain="[('type','&lt;&gt;','view'), ('company_id', '=', parent.company_id), ('parent_id', '!=', False)]" name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
<newline/>
<field name="price_subtotal"/>
<field name="company_id" groups="base.group_multi_company" readonly="1"/>
@ -178,7 +178,7 @@
<field name="product_id" on_change="product_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.address_invoice_id, parent.currency_id, {'company_id': parent.company_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.fiscal_position,account_id)"/>
<field name="invoice_line_tax_id" view_mode="2" context="{'type':parent.type}" domain="[('parent_id','=',False)]"/>
<field domain="[('type','&lt;&gt;','view'), ('company_id', '=', parent.company_id), ('parent_id', '!=', False)]" name="account_analytic_id" groups="base.group_extended"/>
<field domain="[('type','&lt;&gt;','view'), ('company_id', '=', parent.company_id), ('parent_id', '!=', False)]" name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
<field name="quantity"/>
<field name="price_unit"/>
<!-- Removed if subtotal is set -->
@ -357,7 +357,7 @@
<group col="10" colspan="4">
<filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Invoices"/>
<filter icon="terp-gtk-media-pause" string="Proforma" domain="[('state','=','proforma2')]" help="Proforma Invoices"/>
<filter icon="terp-camera_test" string="Invoices" domain="[('state','not in',['draft','cancel'])]" help="Invoices"/>
<filter icon="terp-camera_test" string="Invoices" domain="[('state','not in',['draft','cancel'])]" help="Proforma/Open/Paid Invoices"/>
<separator orientation="vertical"/>
<filter name="unpaid" icon="terp-dolar_ok!" string="Unpaid" domain="[('state','=','open')]" help="Unpaid Invoices"/>
<separator orientation="vertical"/>

View File

@ -8,8 +8,7 @@
<menuitem id="menu_finance_bank_and_cash" name="Bank and Cash" parent="menu_finance" sequence="3"/>
<menuitem id="menu_finance_periodical_processing" name="Periodical Processing" parent="menu_finance" sequence="8" groups="group_account_user,group_account_manager,base.group_system,group_account_invoice"/>
<!-- This menu is used in account_code module -->
<menuitem id="menu_account_coda" name="Statements" parent="menu_finance_periodical_processing" sequence="12"/>
<menuitem id="menu_finance_periodical_processing_bank" name="Bank Reconciliation" parent="menu_finance_periodical_processing" sequence="8" groups="group_account_user,group_account_manager,base.group_system,group_account_invoice"/>
<menuitem id="menu_account_pp_statements" name="Statements" parent="menu_finance_periodical_processing" sequence="12"/>
<menuitem id="periodical_processing_journal_entries_validation" name="Draft Entries" parent="menu_finance_periodical_processing" groups="group_account_user,group_account_manager,base.group_system"/>
<menuitem id="periodical_processing_reconciliation" name="Reconciliation" parent="menu_finance_periodical_processing"/>
<menuitem id="periodical_processing_invoicing" name="Invoicing" parent="menu_finance_periodical_processing"/>
@ -19,11 +18,11 @@
<menuitem id="menu_finance_legal_statement" name="Legal Reports" parent="menu_finance_reporting"/>
<menuitem id="menu_finance_management_belgian_reports" name="Belgian Reports" parent="menu_finance_reporting"/>
<menuitem id="menu_finance_configuration" name="Configuration" parent="menu_finance" sequence="13" groups="base.group_system"/>
<menuitem id="menu_finance_accounting" name="Financial Accounting" parent="menu_finance_configuration"/>
<menuitem id="menu_analytic_accounting" name="Analytic Accounting" parent="menu_finance_configuration" groups="analytic.group_analytic_accounting"/>
<menuitem id="menu_analytic" parent="menu_analytic_accounting" name="Accounts" groups="base.group_extended"/>
<menuitem id="menu_finance_accounting" name="Financial Accounting" parent="menu_finance_configuration" groups="base.group_system"/>
<menuitem id="menu_analytic_accounting" name="Analytic Accounting" parent="menu_finance_configuration" groups="base.group_system"/>
<menuitem id="menu_analytic" parent="menu_analytic_accounting" name="Accounts" groups="analytic.group_analytic_accounting"/>
<menuitem id="menu_low_level" name="Low Level" parent="menu_finance_accounting" groups="base.group_extended"/>
<menuitem id="menu_configuration_misc" name="Miscellaneous" parent="menu_finance_configuration" sequence="30"/>
<menuitem id="menu_configuration_misc" name="Miscellaneous" parent="menu_finance_configuration" sequence="30" groups="base.group_system"/>
<menuitem id="base.menu_action_currency_form" parent="menu_configuration_misc" sequence="20"/>
<menuitem id="menu_finance_generic_reporting" name="Generic Reporting" parent="menu_finance_reporting" sequence="100" groups="base.group_system,group_account_manager"/>
<menuitem id="menu_finance_entries" name="Accounting" parent="menu_finance" sequence="4"

View File

@ -639,6 +639,7 @@ class account_move_line(osv.osv):
AND l.state <> 'draft'
GROUP BY l.partner_id
) AS s ON (p.id = s.partner_id)
WHERE debit > 0 AND credit > 0
ORDER BY p.last_reconciliation_date LIMIT 1 OFFSET %s""", (offset,)
)
return cr.fetchone()
@ -799,8 +800,8 @@ class account_move_line(osv.osv):
wf_service.trg_trigger(uid, 'account.move.line', id, cr)
if lines and lines[0]:
partner_id = lines[0].partner_id.id
if context and context.get('stop_reconcile', False):
partner_id = lines[0].partner_id and lines[0].partner_id.id or False
if partner_id and context and context.get('stop_reconcile', False):
self.pool.get('res.partner').write(cr, uid, [partner_id], {'last_reconciliation_date': time.strftime('%Y-%m-%d %H:%M:%S')})
return r_id
@ -943,7 +944,7 @@ class account_move_line(osv.osv):
if field in ('amount_currency', 'currency_id'):
attrs.append('on_change="onchange_currency(account_id, amount_currency,currency_id, date, journal_id)"')
attrs.append("attrs='{'readonly':[('state','=','valid')]}'")
attrs.append('''attrs="{'readonly':[('state','=','valid')]}"''')
if field in widths:
attrs.append('width="'+str(widths[field])+'"')

View File

@ -47,14 +47,6 @@
name="Taxes"
parent="account.menu_finance_generic_reporting" sequence="3"/>
<report id="account_account_balance_compare"
string="Account balance"
model="account.account"
name="account.balance.account.balance"
rml="account/report/compare_account_balance.rml"
auto="False"
menu="False"/>
<report id="account_account_balance_landscape"
string="Account balance"
model="account.account"

View File

@ -95,8 +95,8 @@
<field name="code"/>
<field name="date_start"/>
<field name="date_stop"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="fiscalyear_id"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
<field name="fiscalyear_id" widget="selection"/>
<field name="special"/>
<separator colspan="4" string="States"/>
<field name="state"/>
@ -508,15 +508,12 @@
<group col="7" colspan="4">
<field name="name" select="1"/>
<field name="date" select="1" on_change="onchange_date(date)"/>
<field name="journal_id" domain="[('type', '=', 'bank')]" on_change="onchange_journal_id(journal_id)" select="1"/>
<field name="journal_id" domain="[('type', '=', 'bank')]" on_change="onchange_journal_id(journal_id)" select="1" widget="selection"/>
<newline/>
<field name="period_id"/>
<field name="balance_start"/>
<field name="balance_end_real"/>
<field name="currency" invisible="1"/>
<button name="%(action_view_account_statement_from_invoice_lines)d"
string="Import Invoices" type="action" icon="gtk-execute"
attrs="{'invisible':[('state','=','confirm')]}"/>
</group>
<notebook colspan="4">
<page string="Transaction" name="statement_line_ids">
@ -529,7 +526,7 @@
<field name="type"/>
<field name="partner_id" on_change="onchange_partner_id(partner_id, type, parent.currency, {'amount': amount})"/>
<field domain="[('journal_id','=',parent.journal_id)]" name="account_id"/>
<field name="analytic_account_id" groups="base.group_extended"/>
<field name="analytic_account_id" groups="analytic.group_analytic_accounting" domain="[('company_id', '=', parent.company_id), ('type', '&lt;&gt;', 'view')]"/>
<field name="amount"/>
</tree>
<form string="Statement lines">
@ -538,7 +535,7 @@
<field name="type"/>
<field name="partner_id" on_change="onchange_partner_id(partner_id, type, parent.currency, {'amount': amount})"/>
<field domain="[('journal_id', '=', parent.journal_id), ('type', '&lt;&gt;', 'view')]" name="account_id"/>
<field name="analytic_account_id" groups="base.group_extended" />
<field name="analytic_account_id" groups="analytic.group_analytic_accounting" domain="[('company_id', '=', parent.company_id), ('type', '&lt;&gt;', 'view')]"/>
<field name="amount"/>
<field name="ref"/>
<field name="sequence" readonly="0"/>
@ -577,9 +574,6 @@
<field name="balance_start"/>
<field name="balance_end_real"/>
<field name="currency" invisible="1"/>
<button name="%(action_view_account_statement_from_invoice_lines)d"
string="Import Invoices" type="action" icon="gtk-execute"
attrs="{'invisible':[('state','=','confirm')]}"/>
</group>
<notebook colspan="4">
<page string="Journal Entries">
@ -640,7 +634,7 @@
</record>
<menuitem string="Bank Statements" action="action_bank_statement_tree" id="menu_bank_statement_tree" parent="menu_finance_bank_and_cash" sequence="7"/>
<menuitem name="Statements Reconciliation" action="action_bank_statement_periodic_tree" id="menu_menu_Bank_process" parent="menu_finance_periodical_processing_bank" sequence="7"/>
<menuitem name="Statements Reconciliation" action="action_bank_statement_periodic_tree" id="menu_menu_Bank_process" parent="account.menu_account_pp_statements" sequence="7"/>
<record id="action_bank_statement_draft_tree" model="ir.actions.act_window">
@ -844,28 +838,33 @@
<form string="Account Tax">
<group colspan="4" col="6">
<field name="name" select="1"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
<field name="description" select="1"/>
<field name="active"/>
<field name="tax_group" select="1"/>
<field name="type"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
<field name="active"/>
</group>
<notebook colspan="4">
<page string="Tax Definition">
<field name="applicable_type"/>
<field name="amount" attrs="{'readonly':[('type','=','none'),('type','=','code')]}"/>
<field groups="base.group_extended" name="include_base_amount"/>
<field groups="base.group_extended" name="domain"/>
<newline/>
<page string="Tax Definition" >
<group col="2" colspan="2">
<separator colspan="2" string=""/>
<field name="applicable_type"/>
<field name="type_tax_use"/>
<field groups="base.group_extended" name="domain"/>
<field groups="base.group_extended" name="sequence"/>
</group>
<group col="2" colspan="2">
<separator colspan="2" string=""/>
<field name="amount" attrs="{'readonly':[('type','in',('none', 'code'))]}"/>
<field groups="base.group_extended" name="child_depend"/>
<field groups="base.group_extended" name="price_include"/>
<field groups="base.group_extended" name="include_base_amount"/>
</group>
<field name="account_collected_id" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
<label colspan="2" nolabel="1" string="Keep empty to use the income account"/>
<field name="account_paid_id" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
<label colspan="2" nolabel="1" string="Keep empty to use the expense account"/>
<field groups="base.group_extended" name="child_depend"/>
<field groups="base.group_extended" name="sequence"/>
<field groups="base.group_extended" name="price_include"/>
<field name="type_tax_use"/>
<newline/>
<separator colspan="4" string="Child Taxes"/>
<field colspan="4" groups="base.group_extended" name="child_ids" nolabel="1"/>
</page>
<page string="Tax Declaration">
@ -888,8 +887,8 @@
<field colspan="4" name="python_applicable" nolabel="1" attrs="{'readonly':[('applicable_type','=','true')], 'required':[('applicable_type','=','code')]}"/>
</page>
</notebook>
</form>
</field>
</form>
</field>
</record>
<record id="action_tax_form" model="ir.actions.act_window">
<field name="name">Taxes</field>
@ -2489,7 +2488,7 @@
<group col="6" colspan="4">
<field name="name" select="1"/>
<field name="company_id" select="1" groups="base.group_multi_company"/>
<field name="journal_id" on_change="onchange_journal_id(journal_id)" domain="[('type','=','cash')]" select="1" />
<field name="journal_id" on_change="onchange_journal_id(journal_id)" domain="[('type','=','cash')]" select="1" widget="selection"/>
<field name="user_id" select="1" readonly="1"/>
<field name="period_id" select="1"/>
<field name="currency" invisible="1"/>

View File

@ -348,6 +348,7 @@
<field name="sequence_id" ref="sequence_sale_journal"/>
<field model="account.account" name="default_credit_account_id" ref="a_sale"/>
<field model="account.account" name="default_debit_account_id" ref="a_sale"/>
<field name="analytic_journal_id" ref="cose_journal_sale"/>
<field name="user_id" ref="base.user_root"/>
</record>
<record id="refund_sales_journal" model="account.journal">
@ -359,6 +360,7 @@
<field name="sequence_id" ref="sequence_sale_journal"/>
<field model="account.account" name="default_credit_account_id" ref="a_sale"/>
<field model="account.account" name="default_debit_account_id" ref="a_sale"/>
<field name="analytic_journal_id" ref="cose_journal_sale"/>
<field name="user_id" ref="base.user_root"/>
</record>
@ -370,6 +372,7 @@
<field name="sequence_id" ref="sequence_purchase_journal"/>
<field model="account.account" name="default_debit_account_id" ref="a_expense"/>
<field model="account.account" name="default_credit_account_id" ref="a_expense"/>
<field name="analytic_journal_id" ref="exp"/>
<field name="user_id" ref="base.user_root"/>
</record>
<record id="refund_expenses_journal" model="account.journal">
@ -381,6 +384,7 @@
<field name="sequence_id" ref="sequence_purchase_journal"/>
<field model="account.account" name="default_debit_account_id" ref="a_expense"/>
<field model="account.account" name="default_credit_account_id" ref="a_expense"/>
<field name="analytic_journal_id" ref="exp"/>
<field name="user_id" ref="base.user_root"/>
</record>
@ -392,6 +396,7 @@
<field name="sequence_id" ref="sequence_journal"/>
<field model="account.account" name="default_debit_account_id" ref="cash"/>
<field model="account.account" name="default_credit_account_id" ref="cash"/>
<field name="analytic_journal_id" ref="sit"/>
<field name="user_id" ref="base.user_root"/>
</record>
<record id="check_journal" model="account.journal">
@ -402,6 +407,7 @@
<field name="sequence_id" ref="sequence_journal"/>
<field model="account.account" name="default_debit_account_id" ref="cash"/>
<field model="account.account" name="default_credit_account_id" ref="cash"/>
<field name="analytic_journal_id" ref="sit"/>
<field name="user_id" ref="base.user_root"/>
</record>
<record id="cash_journal" model="account.journal">
@ -412,6 +418,7 @@
<field name="sequence_id" ref="sequence_journal"/>
<field model="account.account" name="default_debit_account_id" ref="cash"/>
<field model="account.account" name="default_credit_account_id" ref="cash"/>
<field name="analytic_journal_id" ref="sit"/>
<field name="user_id" ref="base.user_root"/>
</record>

View File

@ -67,13 +67,13 @@ class account_installer(osv.osv_memory):
'company_id': fields.many2one('res.company', 'Company'),
}
def _default_company(self, cr, uid, context={}):
def _default_company(self, cr, uid, context=None):
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
if user.company_id:
return user.company_id.id
return False
def _get_default_charts(self, cr, uid, context={}):
def _get_default_charts(self, cr, uid, context=None):
module_name = False
company_id = self._default_company(cr, uid, context=context)
company = self.pool.get('res.company').browse(cr, uid, company_id)
@ -91,18 +91,18 @@ class account_installer(osv.osv_memory):
_defaults = {
'date_start': lambda *a: time.strftime('%Y-01-01'),
'date_stop': lambda *a: time.strftime('%Y-12-31'),
'period':lambda *a:'month',
'sale_tax':lambda *a:0.0,
'purchase_tax':lambda *a:0.0,
'period': lambda *a:'month',
'sale_tax': lambda *a:0.0,
'purchase_tax': lambda *a:0.0,
'company_id': _default_company,
'bank_accounts_id':_get_default_accounts,
'bank_accounts_id': _get_default_accounts,
'charts': _get_default_charts
}
def on_change_tax(self, cr, uid, id, tax):
return {'value':{'purchase_tax':tax}}
def on_change_start_date(self, cr, uid, id, start_date):
def on_change_start_date(self, cr, uid, id, start_date=False):
if start_date:
start_date = datetime.datetime.strptime(start_date, "%Y-%m-%d")
end_date = (start_date + relativedelta(months=12)) - relativedelta(days=1)
@ -117,8 +117,8 @@ class account_installer(osv.osv_memory):
obj_acc_template = self.pool.get('account.account.template')
obj_fiscal_position_template = self.pool.get('account.fiscal.position.template')
obj_fiscal_position = self.pool.get('account.fiscal.position')
data_pool = self.pool.get('ir.model.data')
mod_obj = self.pool.get('ir.model.data')
analytic_journal_obj = self.pool.get('account.analytic.journal')
result = mod_obj._get_id(cr, uid, 'account', 'configurable_chart_template')
id = mod_obj.read(cr, uid, [result], ['res_id'])[0]['res_id']
@ -126,7 +126,7 @@ class account_installer(osv.osv_memory):
if context is None:
context = {}
company_id = self.pool.get('res.users').browse(cr, uid, [uid], context)[0].company_id
company_id = self.browse(cr, uid, ids, context)[0].company_id
seq_journal = True
# Creating Account
@ -211,7 +211,7 @@ class account_installer(osv.osv_memory):
vals={
'name': (obj_acc_root.id == account_template.id) and company_id.name or account_template.name,
#'sign': account_template.sign,
#'currency_id': account_template.currency_id and account_template.currency_id.id or False,
'currency_id': account_template.currency_id and account_template.currency_id.id or False,
'code': code_acc,
'type': account_template.type,
'user_type': account_template.user_type and account_template.user_type.id or False,
@ -237,7 +237,7 @@ class account_installer(osv.osv_memory):
'company_id': company_id.id,
}
bank_account = obj_acc.create(cr, uid, b_vals)
view_id_cash = self.pool.get('account.journal.view').search(cr,uid,[('name','=','Bank/Cash Journal View')])[0] #why fixed name here?
view_id_cur = self.pool.get('account.journal.view').search(cr,uid,[('name','=','Bank/Cash Journal (Multi-Currency) View')])[0] #Why Fixed name here?
ref_acc_bank = obj_multi.bank_account_view_id
@ -262,11 +262,14 @@ class account_installer(osv.osv_memory):
seq_id = obj_sequence.create(cr,uid,vals_seq)
#create the bank journals
analitical_bank_ids = analytic_journal_obj.search(cr,uid,[('type','=','situation')])
analitical_journal_bank = analitical_bank_ids and analitical_bank_ids[0] or False
vals_journal = {}
vals_journal['name']= _('Bank Journal ')
vals_journal['code']= _('BNK')
vals_journal['sequence_id'] = seq_id
vals_journal['type'] = 'cash'
vals_journal['analytic_journal_id'] = analitical_journal_bank
if vals.get('currency_id', False):
vals_journal['view_id'] = view_id_cur
vals_journal['currency'] = vals.get('currency_id', False)
@ -321,6 +324,7 @@ class account_installer(osv.osv_memory):
vals_journal['view_id'] = view_id_cash
vals_journal['default_credit_account_id'] = child_bnk_acc
vals_journal['default_debit_account_id'] = child_bnk_acc
vals_journal['analytic_journal_id'] = analitical_journal_bank
obj_journal.create(cr,uid,vals_journal)
code_cnt += 1
@ -366,10 +370,15 @@ class account_installer(osv.osv_memory):
vals_journal['view_id'] = view_id
#Sales Journal
analitical_sale_ids = analytic_journal_obj.search(cr,uid,[('type','=','sale')])
analitical_journal_sale = analitical_sale_ids and analitical_sale_ids[0] or False
vals_journal['name'] = _('Sales Journal')
vals_journal['type'] = 'sale'
vals_journal['code'] = _('SAJ')
vals_journal['sequence_id'] = seq_id_sale
vals_journal['analytic_journal_id'] = analitical_journal_sale
if obj_multi.property_account_receivable:
vals_journal['default_credit_account_id'] = acc_template_ref[obj_multi.property_account_income_categ.id]
@ -378,10 +387,14 @@ class account_installer(osv.osv_memory):
obj_journal.create(cr,uid,vals_journal)
# Purchase Journal
analitical_purchase_ids = analytic_journal_obj.search(cr,uid,[('type','=','purchase')])
analitical_journal_purchase = analitical_purchase_ids and analitical_purchase_ids[0] or False
vals_journal['name'] = _('Purchase Journal')
vals_journal['type'] = 'purchase'
vals_journal['code'] = _('EXJ')
vals_journal['sequence_id'] = seq_id_purchase
vals_journal['analytic_journal_id'] = analitical_journal_purchase
if obj_multi.property_account_payable:
vals_journal['default_credit_account_id'] = acc_template_ref[obj_multi.property_account_expense_categ.id]
@ -406,6 +419,7 @@ class account_installer(osv.osv_memory):
vals_journal['refund_journal'] = True
vals_journal['code'] = _('SCNJ')
vals_journal['sequence_id'] = seq_id_sale_refund
vals_journal['analytic_journal_id'] = analitical_journal_sale
if obj_multi.property_account_receivable:
vals_journal['default_credit_account_id'] = acc_template_ref[obj_multi.property_account_income_categ.id]
@ -419,6 +433,7 @@ class account_installer(osv.osv_memory):
vals_journal['refund_journal'] = True
vals_journal['code'] = _('ECNJ')
vals_journal['sequence_id'] = seq_id_purchase_refund
vals_journal['analytic_journal_id'] = analitical_journal_purchase
if obj_multi.property_account_payable:
vals_journal['default_credit_account_id'] = acc_template_ref[obj_multi.property_account_expense_categ.id]
@ -499,14 +514,15 @@ class account_installer(osv.osv_memory):
if context is None:
context = {}
fy_obj = self.pool.get('account.fiscalyear')
data_pool = self.pool.get('ir.model.data')
mod_obj = self.pool.get('ir.model.data')
obj_acc = self.pool.get('account.account')
obj_tax_code = self.pool.get('account.tax.code')
obj_temp_tax_code = self.pool.get('account.tax.code.template')
super(account_installer, self).execute(cr, uid, ids, context=context)
record = self.browse(cr, uid, ids, context=context)[0]
company_id = self.pool.get('res.users').browse(cr, uid, [uid], context)[0].company_id
company_id = record.company_id
for res in self.read(cr, uid, ids):
if record.charts == 'configurable':
mod_obj = self.pool.get('ir.model.data')
fp = tools.file_open(opj('account','configurable_account_chart.xml'))
tools.convert_xml_import(cr, 'account', fp, {}, 'init',True, None)
fp.close()
@ -519,11 +535,45 @@ class account_installer(osv.osv_memory):
tax_val = {}
default_tax = []
pur_tax_parent = mod_obj._get_id(cr, uid, 'account', 'tax_code_base_purchases')
pur_tax_parent_id = mod_obj.read(cr, uid, [pur_tax_parent], ['res_id'])[0]['res_id']
pur_temp_tax = mod_obj._get_id(cr, uid, 'account', 'tax_code_base_purchases')
pur_temp_tax_id = mod_obj.read(cr, uid, [pur_temp_tax], ['res_id'])[0]['res_id']
pur_temp_tax_names = obj_temp_tax_code.read(cr, uid, [pur_temp_tax_id], ['name'])
pur_tax_parent_name = pur_temp_tax_names and pur_temp_tax_names[0]['name'] or False
pur_taxcode_parent_id = obj_tax_code.search(cr, uid, [('name', 'ilike', pur_tax_parent_name)])
if pur_taxcode_parent_id:
pur_taxcode_parent_id = pur_taxcode_parent_id[0]
else:
pur_taxcode_parent_id = False
sal_tax_parent = mod_obj._get_id(cr, uid, 'account', 'tax_code_base_sales')
sal_tax_parent_id = mod_obj.read(cr, uid, [sal_tax_parent], ['res_id'])[0]['res_id']
pur_temp_tax_paid = mod_obj._get_id(cr, uid, 'account', 'tax_code_input')
pur_temp_tax_paid_id = mod_obj.read(cr, uid, [pur_temp_tax_paid], ['res_id'])[0]['res_id']
pur_temp_tax_paid_names = obj_temp_tax_code.read(cr, uid, [pur_temp_tax_paid_id], ['name'])
pur_tax_paid_parent_name = pur_temp_tax_names and pur_temp_tax_paid_names[0]['name'] or False
pur_taxcode_paid_parent_id = obj_tax_code.search(cr, uid, [('name', 'ilike', pur_tax_paid_parent_name)])
if pur_taxcode_paid_parent_id:
pur_taxcode_paid_parent_id = pur_taxcode_paid_parent_id[0]
else:
pur_taxcode_paid_parent_id = False
sale_temp_tax = mod_obj._get_id(cr, uid, 'account', 'tax_code_base_sales')
sale_temp_tax_id = mod_obj.read(cr, uid, [sale_temp_tax], ['res_id'])[0]['res_id']
sale_temp_tax_names = obj_temp_tax_code.read(cr, uid, [sale_temp_tax_id], ['name'])
sale_tax_parent_name = sale_temp_tax_names and sale_temp_tax_names[0]['name'] or False
sale_taxcode_parent_id = obj_tax_code.search(cr, uid, [('name', 'ilike', sale_tax_parent_name)])
if sale_taxcode_parent_id:
sale_taxcode_parent_id = sale_taxcode_parent_id[0]
else:
sale_taxcode_parent_id = False
sale_temp_tax_paid = mod_obj._get_id(cr, uid, 'account', 'tax_code_output')
sale_temp_tax_paid_id = mod_obj.read(cr, uid, [sale_temp_tax_paid], ['res_id'])[0]['res_id']
sale_temp_tax_paid_names = obj_temp_tax_code.read(cr, uid, [sale_temp_tax_paid_id], ['name'])
sale_tax_paid_parent_name = sale_temp_tax_paid_names and sale_temp_tax_paid_names[0]['name'] or False
sale_taxcode_paid_parent_id = obj_tax_code.search(cr, uid, [('name', 'ilike', sale_tax_paid_parent_name)])
if sale_taxcode_paid_parent_id:
sale_taxcode_paid_parent_id = sale_taxcode_paid_parent_id[0]
else:
sale_taxcode_paid_parent_id = False
if s_tax*100 > 0.0:
tax_account_ids = obj_acc.search(cr, uid, [('name','=','Tax Received')], context=context)
@ -533,15 +583,25 @@ class account_installer(osv.osv_memory):
'code': 'TAX%s%%'%(s_tax*100),
'company_id': company_id.id,
'sign': 1,
'parent_id':sal_tax_parent_id
'parent_id': sale_taxcode_parent_id
}
new_tax_code = self.pool.get('account.tax.code').create(cr, uid, vals_tax_code)
vals_paid_tax_code = {
'name': 'TAX Received %s%%'%(s_tax*100),
'code': 'TAX Received %s%%'%(s_tax*100),
'company_id': company_id.id,
'sign': 1,
'parent_id': sale_taxcode_paid_parent_id
}
new_paid_tax_code = self.pool.get('account.tax.code').create(cr, uid, vals_paid_tax_code)
sales_tax = obj_tax.create(cr, uid,
{'name':'TAX%s%%'%(s_tax*100),
'description':'TAX%s%%'%(s_tax*100),
'amount':s_tax,
'base_code_id':new_tax_code,
'tax_code_id':new_tax_code,
'tax_code_id':new_paid_tax_code,
'type_tax_use':'sale',
'account_collected_id':sales_tax_account_id,
'account_paid_id':sales_tax_account_id
@ -559,15 +619,25 @@ class account_installer(osv.osv_memory):
'code': 'TAX%s%%'%(p_tax*100),
'company_id': company_id.id,
'sign': 1,
'parent_id':pur_tax_parent_id
'parent_id': pur_taxcode_parent_id
}
new_tax_code = self.pool.get('account.tax.code').create(cr, uid, vals_tax_code)
vals_paid_tax_code = {
'name': 'TAX Paid %s%%'%(p_tax*100),
'code': 'TAX Paid %s%%'%(p_tax*100),
'company_id': company_id.id,
'sign': 1,
'parent_id': pur_taxcode_paid_parent_id
}
new_paid_tax_code = self.pool.get('account.tax.code').create(cr, uid, vals_paid_tax_code)
purchase_tax = obj_tax.create(cr, uid,
{'name':'TAX%s%%'%(p_tax*100),
'description':'TAX%s%%'%(p_tax*100),
'amount':p_tax,
'base_code_id':new_tax_code,
'tax_code_id':new_tax_code,
'tax_code_id':new_paid_tax_code,
'type_tax_use':'purchase',
'account_collected_id':purchase_tax_account_id,
'account_paid_id':purchase_tax_account_id
@ -603,14 +673,6 @@ class account_installer(osv.osv_memory):
elif res['period'] == '3months':
fy_obj.create_period3(cr, uid, [fiscal_id])
# #fially inactive the demo chart of accounts
# data_id = data_pool.search(cr, uid, [('model','=','account.account'), ('name','=','chart0')])
# if data_id:
# data = data_pool.browse(cr, uid, data_id[0])
# account_id = data.res_id
# acc_ids = obj_acc._get_children_and_consol(cr, uid, [account_id])
# if acc_ids:
# cr.execute("update account_account set active='f' where id in " + str(tuple(acc_ids)))
def modules_to_install(self, cr, uid, ids, context=None):
modules = super(account_installer, self).modules_to_install(
@ -633,9 +695,9 @@ class account_bank_accounts_wizard(osv.osv_memory):
'currency_id': fields.many2one('res.currency', 'Secondary Currency', help="Forces all moves for this account to have this secondary currency."),
'account_type': fields.selection([('cash','Cash'),('check','Check'),('bank','Bank')], 'Account Type', size=32),
}
_defaults = {
'currency_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.currency_id.id,
}
# _defaults = {
# 'currency_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.currency_id.id,
# }
account_bank_accounts_wizard()
@ -663,11 +725,12 @@ class account_installer_modules(osv.osv_memory):
# 'account_voucher_payment':fields.boolean('Voucher and Reconcile Management',
# help="Extension Account Voucher module includes allows to link payment / receipt "
# "entries with voucher, also automatically reconcile during the payment and receipt entries."),
}
}
_defaults = {
'account_voucher': True,
}
}
account_installer_modules()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -332,6 +332,7 @@ class account_invoice(osv.osv):
}
def fields_view_get(self, cr, uid, view_id=None, view_type=False, context=None, toolbar=False, submenu=False):
journal_obj = self.pool.get('account.journal')
if context.get('active_model','') in ['res.partner']:
partner = self.pool.get(context['active_model']).read(cr,uid,context['active_ids'],['supplier','customer'])[0]
if not view_type:
@ -343,10 +344,10 @@ class account_invoice(osv.osv):
else:
view_id = self.pool.get('ir.ui.view').search(cr,uid,[('name','=','account.invoice.form')])[0]
res = super(account_invoice,self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=submenu)
type = context.get('journal_type', 'sale')
for field in res['fields']:
type = context.get('journal_type', 'sale')
if field == 'journal_id':
journal_select = self.pool.get('account.journal')._name_search(cr, uid, '', [('type', '=', type)], context=context, limit=None, name_get_uid=1)
journal_select = journal_obj._name_search(cr, uid, '', [('type', '=', type)], context=context, limit=None, name_get_uid=1)
res['fields'][field]['selection'] = journal_select
return res
@ -836,7 +837,7 @@ class account_invoice(osv.osv):
total_percent += line.value_amount
total_fixed = (total_fixed * 100) / inv.amount_total
if (total_fixed + total_percent) > 100:
raise osv.except_osv(_('Error !'), _("You cannot create an invoice !\nAs you have defined payment term and so the total of invoice should be greater than the computed amount for journal entries using payment term"))
raise osv.except_osv(_('Error !'), _("Cannot create the invoice !\nThe payment term defined gives a computed amount greater than the total invoiced amount."))
# one move line per tax line
iml += ait_obj.move_line_get(cr, uid, inv.id)

View File

@ -13,7 +13,7 @@
</record>
<record id="sit" model="account.analytic.journal">
<field name="code">START</field>
<field name="name">Starting Balance</field>
<field name="name">Miscellaneous Operation</field>
<field name="type">situation</field>
</record>
</data>

View File

@ -8,7 +8,7 @@
<field name="type">tree</field>
<field eval="8" name="priority"/>
<field name="arch" type="xml">
<tree toolbar="1" colors="red:(date&lt;current_date);black:(date&gt;=current_date);black:(date==False)" string="Analytic account">
<tree toolbar="1" colors="red:(date&lt;current_date);black:(date&gt;=current_date);black:(date==False)" string="Analytic Accounts">
<field name="code"/>
<field name="complete_name"/>
<field name="quantity"/>
@ -25,10 +25,11 @@
<field name="arch" type="xml">
<search string="Analytic Account">
<group col="8" colspan="4">
<filter icon="terp-go-today" string="Overpassed Account" domain="[('date','&lt;',time.strftime('%%Y-%%m-%%d'))]" help="Overpassed Account"/>
<filter icon="terp-gtk-media-pause" string="Pending" domain="[('state','=','pending')]" help="Pending Accounts"/>
<filter icon="terp-camera_test" string="Current" domain="[('state','=','open')]" help="Current Accounts"/>
<separator orientation="vertical"/>
<filter icon="terp-go-today" string="Overdue Account" domain="[('date','&lt;',time.strftime('%%Y-%%m-%%d'))]" help="Analytic Accounts with a past deadline."/>
<separator orientation="vertical"/>
<field name="name" select="1"/>
<field name="code" select="1"/>
<field name="partner_id" select="1"/>
@ -36,11 +37,10 @@
</group>
<newline/>
<group expand="0" string="Group By...">
<filter string="Parent" icon="terp-folder-orange" domain="[]" context="{'group_by':'parent_id'}"/>
<filter string="Type" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'type'}"/>
<separator orientation="vertical"/>
<filter string="Associated Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
<filter string="Manager" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
<filter string="Associated Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
<separator orientation="vertical"/>
<filter string="Parent" icon="terp-folder-orange" domain="[]" context="{'group_by':'parent_id'}"/>
</group>
</search>
</field>
@ -60,8 +60,11 @@
<field name="debit"/>
<field name="credit"/>
<field name="balance"/>
<field name="currency_id"/>
<field name="currency_id" groups="base.group_extended"/>
<field name="date" invisible="1"/>
<field name="user_id" invisible="1"/>
<field name="partner_id" invisible="1"/>
<field name="parent_id" invisible="1"/>
</tree>
</field>
</record>
@ -192,13 +195,14 @@
<field name="arch" type="xml">
<search string="Search Analytic Lines">
<group col='6' colspan='4'>
<filter string="Sale" domain="[('journal_id.type','=','sale')]" icon="terp-sale"/>
<filter string="Purchase" domain="[('journal_id.type','=','purchase')]" icon="terp-purchase"/>
<filter string="Sales" domain="[('journal_id.type','=','sale')]" icon="terp-sale" help="Analytic Journal Items related to a sale journal."/>
<filter string="Purchases" domain="[('journal_id.type','=','purchase')]" icon="terp-purchase" help="Analytic Journal Items related to a purchase journal."/>
<separator orientation="vertical"/>
<filter icon="terp-go-today" string="Overdue Accounts" domain="[('account_id.date','&lt;',time.strftime('%%Y-%%m-%%d'))]" help="Analytic Journal Items related to accounts having a past deadline."/>
<separator orientation="vertical"/>
<field name="date" select="1"/>
<field name="name" select="1"/>
<field name="account_id" select="1" groups="base.group_extended"/>
<field name="account_id" select="1"/>
<field name="user_id" widget="selection"/>
</group>
<newline/>

View File

@ -19,7 +19,6 @@
#
##############################################################################
import pooler
import time
from report import report_sxw
@ -43,7 +42,6 @@ class account_analytic_balance(report_sxw.rml_parse):
self.acc_sum_list = []# maintains a list of all ids
def get_children(self, ids):
ids2 = []
read_data = self.pool.get('account.analytic.account').read(self.cr, self.uid, ids,['child_ids','code','complete_name','balance'])
for data in read_data:
if (data['id'] not in self.acc_ids):
@ -54,7 +52,7 @@ class account_analytic_balance(report_sxw.rml_parse):
self.acc_ids.append(data['id'])
self.read_data.append(data)
if data['child_ids']:
res = self.get_children(data['child_ids'])
self.get_children(data['child_ids'])
return True
@ -64,7 +62,6 @@ class account_analytic_balance(report_sxw.rml_parse):
self.empty_acc = empty_acc
self.read_data = []
self.get_children(self.ids)
return self.read_data
def _lines_g(self, account_id, date1, date2):
@ -104,14 +101,14 @@ class account_analytic_balance(report_sxw.rml_parse):
query_params = (tuple(ids), date1, date2)
if option == "credit" :
self.cr.execute("SELECT -sum(amount) FROM account_analytic_line \
self.cr.execute("SELECT COALESCE(-sum(amount),0.0) FROM account_analytic_line \
WHERE account_id IN %s AND date>=%s AND date<=%s AND amount<0",query_params)
elif option == "debit" :
self.cr.execute("SELECT sum(amount) FROM account_analytic_line \
self.cr.execute("SELECT COALESCE(sum(amount),0.0) FROM account_analytic_line \
WHERE account_id IN %s\
AND date>=%s AND date<=%s AND amount>0",query_params)
elif option == "quantity" :
self.cr.execute("SELECT sum(unit_amount) FROM account_analytic_line \
self.cr.execute("SELECT COALESCE(sum(unit_amount),0.0) FROM account_analytic_line \
WHERE account_id IN %s\
AND date>=%s AND date<=%s",query_params)
return self.cr.fetchone()[0] or 0.0
@ -132,15 +129,16 @@ class account_analytic_balance(report_sxw.rml_parse):
self.acc_sum_list = ids2
else:
ids2 = self.acc_sum_list
query_params = (tuple(ids2), date1, date2)
query_params = (tuple(ids2), date1, date2)
if option == "debit" :
self.cr.execute("SELECT sum(amount) FROM account_analytic_line \
self.cr.execute("SELECT COALESCE(sum(amount),0.0) FROM account_analytic_line \
WHERE account_id IN %s AND date>=%s AND date<=%s AND amount>0",query_params)
elif option == "credit" :
self.cr.execute("SELECT -sum(amount) FROM account_analytic_line \
self.cr.execute("SELECT COALESCE(-sum(amount),0.0) FROM account_analytic_line \
WHERE account_id IN %s AND date>=%s AND date<=%s AND amount<0",query_params)
elif option == "quantity" :
self.cr.execute("SELECT sum(unit_amount) FROM account_analytic_line \
self.cr.execute("SELECT COALESCE(sum(unit_amount),0.0) FROM account_analytic_line \
WHERE account_id IN %s AND date>=%s AND date<=%s",query_params)
return self.cr.fetchone()[0] or 0.0

View File

@ -107,13 +107,13 @@
<para style="terp_tblheader_Details">Account Name</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Debit<font face="Helvetica" size="8.0">([[ company.currency_id.name]])</font></para>
<para style="terp_tblheader_Details_Right">Debit</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Credit(<font face="Helvetica" size="8.0">[[ company.currency_id.name]])</font></para>
<para style="terp_tblheader_Details_Right">Credit</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Balance<font face="Helvetica" size="8.0">([[ company.currency_id.name]])</font></para>
<para style="terp_tblheader_Details_Right">Balance</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Quantity</para>
@ -130,14 +130,14 @@
</td>
<td>
<para style="terp_tblheader_Details">
<font color="white"> </font>
<font color="white"></font>
</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">[[ formatLang(sum_all(get_objects(data['form']['empty_acc']),data['form']['date1'],data['form']['date2'],'debit')) ]] [[ company.currency_id.symbol ]]</para>
<para style="terp_tblheader_Details_Right">[[ formatLang(sum_all(get_objects(data['form']['empty_acc']),data['form']['date1'],data['form']['date2'],'debit')) ]]</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">[[ formatLang(sum_all(get_objects(data['form']['empty_acc']),data['form']['date1'],data['form']['date2'],'credit')) ]] [[ company.currency_id.symbol]]</para>
<para style="terp_tblheader_Details_Right">[[ formatLang(sum_all(get_objects(data['form']['empty_acc']),data['form']['date1'],data['form']['date2'],'credit')) ]]</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">[[ formatLang(sum_balance(get_objects(data['form']['empty_acc']),data['form']['date1'],data['form']['date2'])) ]] [[ company.currency_id.symbol]]</para>
@ -147,9 +147,6 @@
</td>
</tr>
</blockTable>
<para style="terp_default_2">
<font color="white"> </font>
</para>
<section>
<para style="terp_default_8">[[ repeatIn(get_objects(data['form']['empty_acc']),'o') ]]</para>
<blockTable colWidths="55.0,221.0,56.0,50.0,62.0,38.0" style="Table3">
@ -161,10 +158,10 @@
<para style="terp_default_Bold_9">[[ o['complete_name'] ]]</para>
</td>
<td>
<para style="terp_default_Right_9_Bold">[[ formatLang(move_sum(o['id'],data['form']['date1'],data['form']['date2'],'debit')) ]] [[ company.currency_id.symbol]]</para>
<para style="terp_default_Right_9_Bold">[[ formatLang(move_sum(o['id'],data['form']['date1'],data['form']['date2'],'debit')) ]]</para>
</td>
<td>
<para style="terp_default_Right_9_Bold">[[ formatLang(move_sum(o['id'],data['form']['date1'],data['form']['date2'],'credit')) ]] [[ company.currency_id.symbol]]</para>
<para style="terp_default_Right_9_Bold">[[ formatLang(move_sum(o['id'],data['form']['date1'],data['form']['date2'],'credit')) ]]</para>
</td>
<td>
<para style="terp_default_Right_9_Bold">[[ formatLang(move_sum_balance(o['id'],data['form']['date1'],data['form']['date2'])) ]] [[ company.currency_id.symbol]]</para>
@ -188,10 +185,10 @@
<para style="terp_default_9">[[ move_g['name'] ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(move_g['debit'])]] [[ company.currency_id.symbol ]]</para>
<para style="terp_default_Right_9">[[ formatLang(move_g['debit'])]] </para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(move_g['credit']) ]] [[ company.currency_id.symbol ]]</para>
<para style="terp_default_Right_9">[[ formatLang(move_g['credit']) ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(move_g['balance'])]] [[ company.currency_id.symbol ]]</para>

View File

@ -175,13 +175,13 @@
<para style="terp_tblheader_Details">J.C. /Move name</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Debit([[ company.currency_id.code]])</para>
<para style="terp_tblheader_Details_Right">Debit</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Credit([[ company.currency_id.code]])</para>
<para style="terp_tblheader_Details_Right">Credit</para>
</td>
<td>
<para style="terp_tblheader_Details_Centre">Balance([[ company.currency_id.code]])</para>
<para style="terp_tblheader_Details_Centre">Balance</para>
</td>
</tr>
</blockTable>
@ -199,10 +199,10 @@
</para>
</td>
<td>
<para style="terp_Default_Bold_Right_9_U">[[ formatLang (sum_debit(objects,data['form']['date1'],data['form']['date2'])) ]] [[ company.currency_id.symbol ]]</para>
<para style="terp_Default_Bold_Right_9_U">[[ formatLang (sum_debit(objects,data['form']['date1'],data['form']['date2'])) ]]</para>
</td>
<td>
<para style="terp_Default_Bold_Right_9_U">[[ formatLang (sum_credit(objects,data['form']['date1'],data['form']['date2'])) ]] [[ company.currency_id.symbol ]]</para>
<para style="terp_Default_Bold_Right_9_U">[[ formatLang (sum_credit(objects,data['form']['date1'],data['form']['date2'])) ]]</para>
</td>
<td>
<para style="terp_Default_Bold_Right_9_U">[[ formatLang (sum_balance(objects,data['form']['date1'],data['form']['date2'])) ]] [[ company.currency_id.symbol ]]</para>
@ -223,10 +223,10 @@
<para style="terp_default_Bold_9">[[ o.complete_name ]]</para>
</td>
<td>
<para style="terp_Default_Bold_Right_9_U">[[ formatLang (account_sum_debit(o.id,data['form']['date1'],data['form']['date2'])) ]] [[ company.currency_id.symbol ]]</para>
<para style="terp_Default_Bold_Right_9_U">[[ formatLang (account_sum_debit(o.id,data['form']['date1'],data['form']['date2'])) ]]</para>
</td>
<td>
<para style="terp_Default_Bold_Right_9_U">[[ formatLang (account_sum_credit(o.id,data['form']['date1'],data['form']['date2'])) ]] [[ company.currency_id.symbol ]]</para>
<para style="terp_Default_Bold_Right_9_U">[[ formatLang (account_sum_credit(o.id,data['form']['date1'],data['form']['date2'])) ]]</para>
</td>
<td>
<para style="terp_Default_Bold_Right_9_U">[[ formatLang (account_sum_balance(o.id,data['form']['date1'],data['form']['date2']))]] [[ company.currency_id.symbol ]]</para>
@ -247,10 +247,10 @@
<para style="terp_default_Bold_9">[[ move_g['name'] ]]</para>
</td>
<td>
<para style="terp_Default_Bold_Right_9_U">[[ formatLang( move_g['debit']) ]] [[ company.currency_id.symbol ]]</para>
<para style="terp_Default_Bold_Right_9_U">[[ formatLang( move_g['debit']) ]]</para>
</td>
<td>
<para style="terp_Default_Bold_Right_9_U">[[ formatLang( move_g['credit']) ]] [[ company.currency_id.symbol ]]</para>
<para style="terp_Default_Bold_Right_9_U">[[ formatLang( move_g['credit']) ]]</para>
</td>
<td>
<para style="terp_Default_Bold_Right_9_U">[[ formatLang( move_g['balance']) ]] [[ company.currency_id.symbol ]]</para>
@ -274,13 +274,13 @@
<para style="terp_default_9_Italic">[[ move_a['name'] ]]</para>
</td>
<td>
<para style="terp_default_9_italic_Rignt">[[ formatLang( move_a['debit'] )]] [[ company.currency_id.symbol]]</para>
<para style="terp_default_9_italic_Rignt">[[ formatLang( move_a['debit'] )]]</para>
</td>
<td>
<para style="terp_default_9_italic_Rignt">[[ formatLang( move_a['credit']) ]] [[ company.currency_id.symbol]]</para>
<para style="terp_default_9_italic_Rignt">[[ formatLang( move_a['credit']) ]]</para>
</td>
<td>
<para style="terp_default_9_italic_Rignt">[[ formatLang( move_a['balance']) ]] [[ company.currency_id.symbol]]</para>
<para style="terp_default_9_italic_Rignt">[[ formatLang( move_a['balance']) ]]</para>
</td>
</tr>
</blockTable>

View File

@ -106,13 +106,13 @@
<para style="terp_tblheader_Details">Name</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Debit<font face="Helvetica" size="8.0">([[ company.currency_id.code]])</font></para>
<para style="terp_tblheader_Details_Right">Debit</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Credit<font face="Helvetica" size="8.0">([[ company.currency_id.code]])</font></para>
<para style="terp_tblheader_Details_Right">Credit</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Balance<font face="Helvetica" size="8.0">([[ company.currency_id.code]])</font></para>
<para style="terp_tblheader_Details_Right">Balance</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Quantity</para>
@ -133,10 +133,10 @@
</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">[[ formatLang(sum_debit(objects,data['form']['date1'],data['form']['date2'])) ]] [[ company.currency_id.symbol]]</para>
<para style="terp_tblheader_Details_Right">[[ formatLang(sum_debit(objects,data['form']['date1'],data['form']['date2'])) ]]</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">[[ formatLang(sum_credit(objects,data['form']['date1'],data['form']['date2']))]] [[ company.currency_id.symbol]]</para>
<para style="terp_tblheader_Details_Right">[[ formatLang(sum_credit(objects,data['form']['date1'],data['form']['date2']))]]</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">[[ formatLang(sum_balance(objects,data['form']['date1'],data['form']['date2']))]] [[ company.currency_id.symbol]]</para>
@ -157,10 +157,10 @@
<para style="terp_default_Bold_9">[[ move_g['name'] ]]</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">[[ formatLang(move_g['debit'])]] [[ company.currency_id.symbol]]</para>
<para style="terp_tblheader_Details_Right">[[ formatLang(move_g['debit'])]]</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">[[formatLang(move_g['credit'])]] [[ company.currency_id.symbol]]</para>
<para style="terp_tblheader_Details_Right">[[formatLang(move_g['credit'])]]</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">[[ formatLang(move_g['balance'])]] [[ company.currency_id.symbol]]</para>
@ -181,10 +181,10 @@
<para style="terp_default_9">[[ move_a['complete_name'] ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(move_a['debit']) ]] [[ company.currency_id.symbol]]</para>
<para style="terp_default_Right_9">[[ formatLang(move_a['debit']) ]] </para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(move_a['credit']) ]] [[ company.currency_id.symbol]]</para>
<para style="terp_default_Right_9">[[ formatLang(move_a['credit']) ]] </para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(move_a['balance']) ]] [[ company.currency_id.symbol]]</para>

View File

@ -32,7 +32,6 @@ import account_aged_partner_balance
import tax_report
import account_tax_code
import account_balance_landscape
import compare_account_balance
import account_invoice_report
import account_report
import account_entries_report

View File

@ -186,7 +186,7 @@
<para style="terp_tblheader_Details_Right">[[ data['form']['0']['name'] ]]<font size="8.0">([[ company.currency_id.code ]])</font></para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Total<font size="8.0">([[ company.currency_id.code ]])</font></para>
<para style="terp_tblheader_Details_Right">Total</para>
</td>
</tr>

View File

@ -35,6 +35,7 @@ class analytic_entries_report(osv.osv):
('10','October'), ('11','November'), ('12','December')], 'Month',readonly=True),
'user_id' : fields.many2one('res.users', 'User',readonly=True),
'name': fields.char('Description', size=64, readonly=True),
'partner_id': fields.many2one('res.partner', 'Partner'),
'company_id': fields.many2one('res.company', 'Company', required=True),
'currency_id': fields.many2one('res.currency', 'Currency', required=True),
'account_id': fields.many2one('account.analytic.account', 'Account', required=True),
@ -44,8 +45,7 @@ class analytic_entries_report(osv.osv):
'product_id': fields.many2one('product.product', 'Product', required=True),
'product_uom_id': fields.many2one('product.uom', 'Product UOM', required=True),
'amount': fields.float('Amount', readonly=True),
'unit_amount': fields.float('Unit Amount', readonly=True),
'amount_currency': fields.float('Amount Currency', readonly=True),
'unit_amount': fields.float('Quantity', readonly=True),
'nbr': fields.integer('#Entries', readonly=True),
}
def init(self, cr):
@ -61,6 +61,7 @@ class analytic_entries_report(osv.osv):
to_char(a.create_date, 'YYYY-MM-DD') as day,
a.user_id as user_id,
a.name as name,
analytic.partner_id as partner_id,
a.company_id as company_id,
a.currency_id as currency_id,
a.account_id as account_id,
@ -70,12 +71,12 @@ class analytic_entries_report(osv.osv):
a.product_id as product_id,
a.product_uom_id as product_uom_id,
sum(a.amount) as amount,
sum(a.unit_amount) as unit_amount,
sum(a.amount_currency) as amount_currency
sum(a.unit_amount) as unit_amount
from
account_analytic_line a
account_analytic_line a, account_analytic_account analytic
where analytic.id = a.account_id
group by
a.create_date, a.user_id,a.name,company_id,a.currency_id,
a.create_date, a.user_id,a.name,analytic.partner_id,a.company_id,a.currency_id,
a.account_id,a.general_account_id,a.journal_id,
a.move_id,a.product_id,a.product_uom_id
)

View File

@ -13,6 +13,7 @@
<field name="month" invisible="1"/>
<field name="user_id" invisible="1"/>
<field name="name" invisible="1"/>
<field name="partner_id" invisible="1"/>
<field name="company_id" invisible="1" groups="base.group_multi_company"/>
<field name="currency_id" invisible="1"/>
<field name="account_id" invisible="1"/>
@ -21,9 +22,8 @@
<field name="product_id" invisible="1"/>
<field name="product_uom_id" invisible="1"/>
<field name="nbr" sum="Entries"/>
<field name="unit_amount" sum="Quantity"/>
<field name="amount" sum="Amount"/>
<field name="unit_amount" sum="Unit Amount"/>
<field name="amount_currency" sum="Amount Currency"/>
</tree>
</field>
</record>
@ -48,29 +48,14 @@
domain="[('day','&lt;=', time.strftime('%%Y-%%m-%%d')), ('day','&gt;',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
help="Analytic Entries during last 7 days"/>
<separator orientation="vertical"/>
<field name="date" />
<field name="account_id" />
<field name="product_id" />
<field name="user_id" widget="selection">
<field name="user_id">
<filter icon="terp-personal" domain="[('user_id','=',uid)]" help="My Entries"/>
</field>
</group>
<newline/>
<group expand="1" string="Group By...">
<filter string="User" name="User" icon="terp-personal" context="{'group_by':'user_id'}"/>
<filter string="Currency" icon="terp-dolar" context="{'group_by':'currency_id'}"/>
<filter string="Company" icon="terp-go-home" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
<separator orientation="vertical"/>
<filter string="Account" icon="terp-folder-orange" context="{'group_by':'account_id'}"/>
<filter string="General Account" icon="terp-folder-orange" context="{'group_by':'general_account_id'}"/>
<filter string="Journal" icon="terp-folder-orange" context="{'group_by':'journal_id'}"/>
<separator orientation="vertical"/>
<filter string="Product" icon="terp-accessories-archiver" context="{'group_by':'product_id'}"/>
<filter string="Product UOM" icon="terp-mrp" context="{'group_by':'product_uom_id'}"/>
<separator orientation="vertical"/>
<filter string="Day" icon="terp-go-today" context="{'group_by':'day'}"/>
<filter string="Month" icon="terp-go-month" context="{'group_by':'month'}"/>
<filter string="Year" icon="terp-go-year" context="{'group_by':'year'}"/>
</group>
<newline/>
<group expand="0" string="Extended Filters..." groups="base.group_extended">
<field name="currency_id" widget="selection"/>
<field name="general_account_id" widget="selection"/>
@ -81,6 +66,23 @@
<field name="account_id"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
</group>
<newline/>
<group expand="1" string="Group By...">
<filter string="User" name="User" icon="terp-personal" context="{'group_by':'user_id'}"/>
<filter string="Partner" icon="terp-personal" context="{'group_by':'partner_id'}"/>
<filter string="Company" icon="terp-go-home" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
<separator orientation="vertical"/>
<filter string="Account" name="Account" icon="terp-folder-green" context="{'group_by':'account_id'}"/>
<filter string="General Account" icon="terp-folder-green" context="{'group_by':'general_account_id'}"/>
<filter string="Journal" icon="terp-folder-orange" context="{'group_by':'journal_id'}"/>
<separator orientation="vertical"/>
<filter string="Product" icon="terp-accessories-archiver" context="{'group_by':'product_id'}"/>
<filter string="Product UOM" icon="terp-mrp" context="{'group_by':'product_uom_id'}"/>
<separator orientation="vertical"/>
<filter string="Day" icon="terp-go-today" context="{'group_by':'day'}"/>
<filter string="Month" name="Month" icon="terp-go-month" context="{'group_by':'month'}"/>
<filter string="Year" icon="terp-go-year" context="{'group_by':'year'}"/>
</group>
</search>
</field>
</record>
@ -91,9 +93,8 @@
<field name="arch" type="xml">
<graph string="Analytic Entries Analysis" type="bar">
<field name="user_id"/>
<field name="amount" operator="+"/>
<field name="unit_amount" operator="+"/>
<field name="amount_currency" operator="+"/>
<field name="amount" operator="+"/>
</graph>
</field>
</record>
@ -102,7 +103,7 @@
<field name="res_model">analytic.entries.report</field>
<field name="view_type">form</field>
<field name="view_mode">tree,graph</field>
<field name="context">{'search_default_month':1,'search_default_User':1,'group_by_no_leaf':1,'group_by':[]}</field>
<field name="context">{'search_default_month':1, 'group_by_no_leaf':1, 'search_default_Account':1, 'search_default_Month':1, 'group_by':[]}</field>
<field name="search_view_id" ref="view_analytic_entries_report_search"/>
<field name="help">A tool search lets you know statistics on your analytics records that match your needs.</field>
</record>

View File

@ -287,15 +287,15 @@
<tr noRowsplits="1">
<td><para style="P12a">Code</para></td>
<td><para style="P12a">Account</para></td>
<td><para style="P10">Debit([[ company.currency_id.code]])</para></td>
<td><para style="P10">Credit([[ company.currency_id.code]])</para></td>
<td><para style="P10">Balance([[ company.currency_id.code]])</para></td>
<td><para style="P10">Debit</para></td>
<td><para style="P10">Credit</para></td>
<td><para style="P10">Balance</para></td>
</tr>
<tr>
<td><para style="P14">[[ repeatIn(lines(data['form']), 'a') ]]<font>[[ (a['type']&lt;&gt;'view' and setTag('para','para',{'fontName':"Helvetica"})) or removeParentNode('font') ]]</font><i>[[ a['code'] or removeParentNode('tr') ]]</i></para></td>
<td><para style="P14"><font>[[ (a['type']&lt;&gt;'view' and setTag('para','para',{'fontName':"Helvetica"})) or removeParentNode('font') ]]</font><font color="white">[[ '..'*(a['level']-1) ]]</font><font>[[ a['name'] ]]</font> </para></td>
<td><para style="P3"><font>[[ (a['type']&lt;&gt;'view' and setTag('para','para',{'fontName':"Helvetica"})) or removeParentNode('font') ]]</font><font>[[ a['type']=='view' and removeParentNode('font') ]][[ formatLang(a['debit']) ]] [[ company.currency_id.symbol ]]</font><font>[[ a['type']&lt;&gt;'view' and removeParentNode('font') ]] [[formatLang(a['debit']) ]] [[ company.currency_id.symbol ]]</font></para></td>
<td><para style="P3"><font>[[ (a['type']&lt;&gt;'view' and setTag('para','para',{'fontName':"Helvetica"})) or removeParentNode('font')]]</font><font>[[ a['type']=='view' and removeParentNode('font') ]][[ formatLang(a['credit']) ]] [[ company.currency_id.symbol ]]</font><font>[[ a['type']&lt;&gt;'view' and removeParentNode('font') ]] [[ formatLang(a['credit']) ]] [[ company.currency_id.symbol ]]</font> </para></td>
<td><para style="P3"><font>[[ (a['type']&lt;&gt;'view' and setTag('para','para',{'fontName':"Helvetica"})) or removeParentNode('font') ]]</font><font>[[ a['type']=='view' and removeParentNode('font') ]][[ formatLang(a['debit']) ]]</font><font>[[ a['type']&lt;&gt;'view' and removeParentNode('font') ]] [[formatLang(a['debit']) ]] </font></para></td>
<td><para style="P3"><font>[[ (a['type']&lt;&gt;'view' and setTag('para','para',{'fontName':"Helvetica"})) or removeParentNode('font')]]</font><font>[[ a['type']=='view' and removeParentNode('font') ]][[ formatLang(a['credit']) ]]</font><font>[[ a['type']&lt;&gt;'view' and removeParentNode('font') ]] [[ formatLang(a['credit']) ]]</font> </para></td>
<td><para style="P3"><font>[[ (a['type']&lt;&gt;'view' and setTag('para','para',{'fontName':"Helvetica"})) or removeParentNode('font') ]]</font><font>[[ a['type']=='view' and removeParentNode('font') ]][[ formatLang(a['balance']) ]] [[ company.currency_id.symbol ]]</font><font>[[ a['type']&lt;&gt;'view' and removeParentNode('font') ]] [[ formatLang(a['balance']) ]] [[ company.currency_id.symbol ]]</font> </para></td>
</tr>
</blockTable>

View File

@ -25,19 +25,8 @@
<blockTableStyle id="Table_Account_Line_Title">
<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,0" 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,0" stop="1,-1"/>
<lineStyle kind="LINEBEFORE" 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,0" stop="2,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="3,0" stop="3,-1"/>
<lineStyle kind="LINEAFTER" colorName="#cccccc" start="3,0" stop="3,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="3,0" stop="3,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,0" stop="3,-1"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,1" stop="-1,-1"/>
</blockTableStyle>
<blockTableStyle id="Table5">
<blockAlignment value="LEFT"/>
@ -63,19 +52,8 @@
<blockTableStyle id="Table1">
<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,0" stop="-1,-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,0" stop="1,-1"/>
<lineStyle kind="LINEBEFORE" 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,0" stop="2,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="3,0" stop="3,-1"/>
<lineStyle kind="LINEAFTER" colorName="#cccccc" start="3,0" stop="3,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="3,0" stop="3,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,0" stop="3,-1"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,1" stop="-1,-1"/>
</blockTableStyle>
<blockTableStyle id="Table2_header">
<blockAlignment value="LEFT"/>
@ -215,9 +193,16 @@
<para style="Standard">
<font color="white"> </font>
</para>
<para style="Standard">
<para style="Standard">
<font color="white"> </font>
</para>
<blockTable colWidths="539.0" style="Table_Company_Name">
<tr>
<td>
<para style="terp_header_Centre">Assets</para>
</td>
</tr>
</blockTable>
<para style="terp_default_9">
<font color="white"> </font>
</para>
@ -230,7 +215,7 @@
<para style="terp_default_Bold_9">Assets</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Total Amount([[ get_currency(data) ]])</para>
<para style="terp_tblheader_Details_Right">Balance</para>
</td>
</tr>
<tr>
@ -248,7 +233,7 @@
<blockTable colWidths="426.0,113.0" style="Table3">
<tr>
<td>
<para style="terp_default_Bold_9">Balance:([[ get_currency(data) ]])</para>
<para style="terp_default_Bold_9">Balance:</para>
</td>
<td>
<para style="terp_default_Right_9_Bold"><u>[[ formatLang(abs(sum_cr())) ]] [[ company.currency_id.symbol ]]</u></para>
@ -259,6 +244,13 @@
<para style="terp_default_9">
<font color="white"> </font>
</para>
<blockTable colWidths="539.0" style="Table_Company_Name">
<tr>
<td>
<para style="terp_header_Centre">Liabilities</para>
</td>
</tr>
</blockTable>
<blockTable colWidths="100.0,326.0,113.0" style="Table_Account_Line_Title" repeatRows="1">
<tr>
<td>
@ -268,7 +260,7 @@
<para style="terp_default_Bold_9">Liabilities</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Total Amount([[ get_currency(data) ]])</para>
<para style="terp_tblheader_Details_Right">Balance</para>
</td>
</tr>
<tr>
@ -286,7 +278,7 @@
<blockTable colWidths="426.0,113.0" style="Table_Net_Profit_Loss">
<tr>
<td>
<para style="terp_default_Bold_9">Balance:([[ get_currency(data) ]])</para>
<para style="terp_default_Bold_9">Balance:</para>
</td>
<td>
<para style="terp_default_Right_9_Bold"><u>[[ formatLang(abs(sum_dr())) ]] [[ company.currency_id.symbol ]]</u></para>

View File

@ -26,31 +26,8 @@
<blockTableStyle id="Table_Account_Line_Title">
<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,0" 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,0" stop="1,-1"/>
<lineStyle kind="LINEBEFORE" 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,0" stop="2,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="3,0" stop="3,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="3,0" stop="3,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,0" stop="3,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="4,0" stop="4,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="4,0" stop="4,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,0" stop="4,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="5,0" stop="5,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="5,0" stop="5,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="5,0" stop="5,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="6,0" stop="6,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="6,0" stop="6,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="6,0" stop="6,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="7,0" stop="7,-1"/>
<lineStyle kind="LINEAFTER" colorName="#cccccc" start="7,0" stop="7,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="7,0" stop="7,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="7,0" stop="7,-1"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,1" stop="-1,-1"/>
</blockTableStyle>
<blockTableStyle id="Table_Main_Content">
<blockAlignment value="LEFT"/>
@ -67,31 +44,7 @@
<blockTableStyle id="Table_Net_Profit_Loss">
<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="LINEABOVE" colorName="#cccccc" start="2,0" stop="2,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="3,0" stop="3,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="3,0" stop="3,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="4,0" stop="4,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="4,0" stop="4,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,-1" stop="4,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="5,0" stop="5,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="5,0" stop="5,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="5,-1" stop="5,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="6,0" stop="6,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="6,0" stop="6,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="6,-1" stop="6,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="7,0" stop="7,-1"/>
<lineStyle kind="LINEAFTER" colorName="#cccccc" start="7,0" stop="7,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="7,0" stop="7,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="7,-1" stop="7,-1"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,0" stop="-1,-1"/>
</blockTableStyle>
<blockTableStyle id="Table2_header">
<blockAlignment value="LEFT"/>
@ -251,7 +204,7 @@
<para style="terp_default_Bold_9">Assets</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Total Amount([[ get_currency(data) ]]) </para>
<para style="terp_tblheader_Details_Right">Balance</para>
</td>
<td>
<para style="terp_default_Bold_9">Code</para>
@ -260,7 +213,7 @@
<para style="terp_default_Bold_9">Liabilities</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Total Amount([[ get_currency(data) ]])</para>
<para style="terp_tblheader_Details_Right">Balance</para>
</td>
</tr>
<tr>
@ -287,13 +240,13 @@
<blockTable colWidths="408.16,116.32,408.16,116.32" style="Table_Net_Profit_Loss">
<tr>
<td>
<para style="terp_default_Bold_9">Balance:([[ get_currency(data) ]])</para>
<para style="terp_default_Bold_9">Balance:</para>
</td>
<td>
<para style="terp_default_Right_9_Bold"><u>[[ formatLang(abs(sum_cr())) ]] [[ company.currency_id.symbol ]]</u></para>
</td>
<td>
<para style="terp_default_Bold_9">Balance:([[ get_currency(data) ]]) </para>
<para style="terp_default_Bold_9">Balance:</para>
</td>
<td>
<para style="terp_default_Right_9_Bold"><u>[[ formatLang(abs(sum_dr())) ]] [[ company.currency_id.symbol ]]</u></para>

View File

@ -278,18 +278,18 @@
<tr>
<td><para style="terp_tblheader_Details">A/C No.</para></td>
<td><para style="terp_tblheader_Details">Account Name</para></td>
<td><para style="terp_tblheader_Details_Right">Debit<font size="8.0">([[ company.currency_id.code]])</font></para></td>
<td><para style="terp_tblheader_Details_Right">Credit<font size="8.0">([[ company.currency_id.code]])</font></para></td>
<td><para style="terp_tblheader_Details_Right">Balance<font size="8.0">([[ company.currency_id.code]])</font></para></td>
<td><para style="terp_tblheader_Details_Right">Debit</para></td>
<td><para style="terp_tblheader_Details_Right">Credit</para></td>
<td><para style="terp_tblheader_Details_Right">Balance</para></td>
</tr>
</blockTable>
<blockTable colWidths="50.0,250.0,70.0,70.0,70.0,50.0" style="Table_Account_detail_Title_Currency">[[ display_currency(data) or removeParentNode('blockTable') ]]
<tr>
<td><para style="terp_tblheader_Details">A/C No.</para></td>
<td><para style="terp_tblheader_Details">Account Name</para></td>
<td><para style="terp_tblheader_Details_Right">Debit<font size="8.0">([[ company.currency_id.code]])</font></para></td>
<td><para style="terp_tblheader_Details_Right">Credit<font size="8.0">([[ company.currency_id.code]])</font></para></td>
<td><para style="terp_tblheader_Details_Right">Balance<font size="8.0">([[ company.currency_id.code]])</font></para></td>
<td><para style="terp_tblheader_Details_Right">Debit</para></td>
<td><para style="terp_tblheader_Details_Right">Credit</para></td>
<td><para style="terp_tblheader_Details_Right">Balance</para></td>
<td><para style="terp_tblheader_Details_Right">Currency</para></td>
</tr>
</blockTable>
@ -297,8 +297,8 @@
<tr>
<td><para style="terp_default_Bold_9">Total<font size="8.0">([[ company.currency_id.code]])</font>:</para></td>
<td><para style="terp_default_Bold_9"><font color="white"> </font></para></td>
<td><para style="terp_default_Bold_9_Right">[[ formatLang( sum_debit(o.period_id.id, o.journal_id.id)) ]] [[ company.currency_id.symbol ]]</para></td>
<td><para style="terp_default_Bold_9_Right">[[ formatLang( sum_credit(o.period_id.id, o.journal_id.id)) ]] [[ company.currency_id.symbol ]]</para></td>
<td><para style="terp_default_Bold_9_Right">[[ formatLang( sum_debit(o.period_id.id, o.journal_id.id)) ]] </para></td>
<td><para style="terp_default_Bold_9_Right">[[ formatLang( sum_credit(o.period_id.id, o.journal_id.id)) ]] </para></td>
<td><para style="terp_default_Bold_9_Right">[[ formatLang( sum_credit(o.period_id.id, o.journal_id.id)-sum_debit(o.period_id.id, o.journal_id.id) ) ]] [[ company.currency_id.symbol ]]</para></td>
</tr>
</blockTable>
@ -306,8 +306,8 @@
<tr>
<td><para style="terp_default_Bold_9">Total:([[ company.currency_id.code]])</para></td>
<td><para style="terp_default_Bold_9"><font color="white"> </font></para></td>
<td><para style="terp_default_Bold_9_Right">[[ formatLang( sum_debit(o.period_id.id, o.journal_id.id)) ]] [[ company.currency_id.symbol ]]</para></td>
<td><para style="terp_default_Bold_9_Right">[[ formatLang( sum_credit(o.period_id.id, o.journal_id.id)) ]] [[ company.currency_id.symbol ]]</para></td>
<td><para style="terp_default_Bold_9_Right">[[ formatLang( sum_debit(o.period_id.id, o.journal_id.id)) ]]</para></td>
<td><para style="terp_default_Bold_9_Right">[[ formatLang( sum_credit(o.period_id.id, o.journal_id.id)) ]]</para></td>
<td><para style="terp_default_Bold_9_Right">[[ formatLang( sum_credit(o.period_id.id, o.journal_id.id)-sum_debit(o.period_id.id, o.journal_id.id) ) ]] [[ company.currency_id.symbol ]]</para></td>
<td><para style="terp_default_Bold_9"><font color="white"> </font></para></td>
</tr>
@ -318,8 +318,8 @@
<tr>
<td><para style="terp_default_9">[[ line['code'] ]]</para></td>
<td><para style="terp_default_9">[[ line['name'] ]]</para></td>
<td><para style="terp_default_Right_9">[[ formatLang(line['debit']) ]] [[ company.currency_id.symbol ]]</para></td>
<td><para style="terp_default_Right_9">[[ formatLang(line['credit'])]] [[ company.currency_id.symbol ]]</para></td>
<td><para style="terp_default_Right_9">[[ formatLang(line['debit']) ]]</para></td>
<td><para style="terp_default_Right_9">[[ formatLang(line['credit'])]]</para></td>
<td><para style="terp_default_Right_9">[[ formatLang(line['credit']-line['debit']) ]] [[ company.currency_id.symbol ]]</para></td>
</tr>
</blockTable>
@ -327,8 +327,8 @@
<tr>
<td><para style="terp_default_9">[[ line['code'] ]]</para></td>
<td><para style="terp_default_9">[[ line['name'] ]]</para></td>
<td><para style="terp_default_Right_9">[[ formatLang(line['debit']) ]] [[ company.currency_id.symbol ]]</para></td>
<td><para style="terp_default_Right_9">[[ formatLang(line['credit'])]] [[ company.currency_id.symbol ]]</para></td>
<td><para style="terp_default_Right_9">[[ formatLang(line['debit']) ]]</para></td>
<td><para style="terp_default_Right_9">[[ formatLang(line['credit'])]]</para></td>
<td><para style="terp_default_Right_9">[[ formatLang(line['credit']-line['debit']) ]] [[ company.currency_id.symbol ]]</para></td>
<td><para style="terp_default_Right_9">[[ line['currency_id'] and formatLang(line['amount_currency'] or '') ]] [[ line['currency_id'] and line['currency_code'] or '']]</para></td>
</tr>

View File

@ -50,6 +50,7 @@ class account_entries_report(osv.osv):
'journal_id': fields.many2one('account.journal', 'Journal', readonly=True),
'fiscalyear_id': fields.many2one('account.fiscalyear', 'Fiscal Year', readonly=True),
'product_id': fields.many2one('product.product', 'Product', readonly=True),
'product_uom_id': fields.many2one('product.uom', 'Product UOM', readonly=True),
'move_state': fields.selection([('draft','Unposted'), ('posted','Posted')], 'State', readonly=True),
'move_line_state': fields.selection([('draft','Unbalanced'), ('valid','Valid')], 'State of Move Line', readonly=True),
'reconcile_id': fields.many2one('account.move.reconcile', readonly=True),
@ -73,7 +74,7 @@ class account_entries_report(osv.osv):
}
_order = 'date desc'
def search(self, cr, uid, args, offset=0, limit=None, order=None,
context=None, count=False):
for arg in args:
@ -90,7 +91,7 @@ class account_entries_report(osv.osv):
args.remove(a)
return super(account_entries_report, self).search(cr, uid, args=args, offset=offset, limit=limit, order=order,
context=context, count=count)
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None):
todel=[]
for arg in domain:
@ -108,7 +109,7 @@ class account_entries_report(osv.osv):
if a in domain:
domain.remove(a)
return super(account_entries_report, self).read_group(cr, uid, domain, fields, groupby, offset, limit, context)
def init(self, cr):
tools.drop_view_if_exists(cr, 'account_entries_report')
cr.execute("""
@ -127,6 +128,7 @@ class account_entries_report(osv.osv):
to_char(am.date, 'YYYY-MM-DD') as day,
l.partner_id as partner_id,
l.product_id as product_id,
l.product_uom_id as product_uom_id,
am.company_id as company_id,
am.journal_id as journal_id,
p.fiscalyear_id as fiscalyear_id,

View File

@ -12,7 +12,7 @@
<field name="date_maturity" invisible="1"/>
<field name="ref" invisible="1"/>
<field name="nbr" sum="# of Entries "/>
<field name="quantity" sum="# of Products Qty "/>
<field name="quantity" sum="# of Products Qty " invisible="not context.get('quantity_visible', False)"/>
<field name="amount_currency" invisible="not context.get('amount_currency_visible', False)"/>
<field name="currency_id" invisible="not context.get('currency_id_visible', False)"/>
<field name="debit"/>
@ -24,6 +24,7 @@
<field name="year" invisible="1"/>
<field name="partner_id" invisible="1"/>
<field name="product_id" invisible="1"/>
<field name="product_uom_id" invisible="1"/>
<field name="company_id" invisible="1" groups="base.group_multi_company"/>
<field name="journal_id" invisible="1"/>
<field name="account_id" invisible="1"/>
@ -56,7 +57,7 @@
<group colspan="10" col="12">
<filter icon="terp-go-year" string="This F.Year"
name="thisyear"
domain="[('period_id','in','current_year')]"
domain="[('period_id','in','current_year')]"
help="Journal Entries with period in current year"/>
<filter icon="terp-go-month" string="This Period"
name="period"
@ -73,11 +74,24 @@
<field name="journal_id" widget="selection"/>
<field name="period_id"/>
</group>
<newline/>
<group expand="0" string="Extended Filters..." groups="base.group_extended">
<field name="fiscalyear_id"/>
<separator orientation="vertical"/>
<field name="product_id"/>
<field name="partner_id"/>
<separator orientation="vertical" groups="base.group_multi_company"/>
<field name="company_id" groups="base.group_multi_company"/>
<newline/>
<field name="date_created"/>
<field name="date"/>
<field name="date_maturity"/>
</group>
<newline/>
<group expand="1" string="Group By...">
<filter string="Partner" icon="terp-partner" context="{'group_by':'partner_id'}"/>
<separator orientation="vertical"/>
<filter string="Product" icon="terp-accessories-archiver" context="{'group_by':'product_id'}"/>
<filter string="Product" icon="terp-accessories-archiver" context="{'group_by':['product_id','product_uom_id'], 'quantity_visible':1}"/>
<separator orientation="vertical"/>
<filter string="Currency" name="group_currency" icon="terp-dolar" context="{'group_by':'currency_id', 'currency_id_visible':1, 'amount_currency_visible':1}"/>
<filter string="Journal" name="group_journal" icon="terp-folder-orange" context="{'group_by':'journal_id'}"/>
@ -92,19 +106,6 @@
<filter string="Period" icon="terp-go-month" name="group_period" context="{'group_by':'period_id'}"/>
<filter string="Fiscal Year" icon="terp-go-year" context="{'group_by':'fiscalyear_id'}"/>
</group>
<newline/>
<group expand="0" string="Extended Filters..." groups="base.group_extended">
<field name="fiscalyear_id"/>
<separator orientation="vertical"/>
<field name="product_id"/>
<field name="partner_id"/>
<separator orientation="vertical" groups="base.group_multi_company"/>
<field name="company_id" groups="base.group_multi_company"/>
<newline/>
<field name="date_created"/>
<field name="date"/>
<field name="date_maturity"/>
</group>
</search>
</field>
</record>
@ -113,7 +114,7 @@
<field name="res_model">account.entries.report</field>
<field name="view_type">form</field>
<field name="view_mode">tree,graph</field>
<field name="context">{'group_by':[],'search_default_usertype':1, 'search_default_thisyear':1, 'group_by_no_leaf':1,}</field>
<field name="context">{'group_by':[], 'search_default_usertype':1, 'search_default_thisyear':1, 'group_by_no_leaf':1}</field>
<field name="help">A tool search lets you know statistics on your different financial accounts that match your needs.</field>
</record>
<menuitem action="action_account_entries_report_all" id="menu_action_account_entries_report_all" parent="account.menu_finance_statistic_report_statement" sequence="2"/>

View File

@ -265,15 +265,15 @@
<tr>
<td><para style="terp_tblheader_Details">Code</para></td>
<td><para style="terp_tblheader_Details">Journal Name</para></td>
<td><para style="terp_tblheader_Details_Right">Debit<font size="8.0">([[ company.currency_id.code]])</font></para></td>
<td><para style="terp_tblheader_Details_Right">Credit<font size="8.0">([[ company.currency_id.code]])</font></para></td>
<td><para style="terp_tblheader_Details_Right">Balance<font size="8.0">([[ company.currency_id.code]])</font></para></td>
<td><para style="terp_tblheader_Details_Right">Debit</para></td>
<td><para style="terp_tblheader_Details_Right">Credit</para></td>
<td><para style="terp_tblheader_Details_Right">Balance</para></td>
</tr>
<tr>
<td><para style="terp_default_Bold_9">Total:([[ company.currency_id.code]])</para></td>
<td><para style="terp_default_Bold_9"><font color="white"> </font></para></td>
<td><para style="terp_default_Bold_9_Right">[[ formatLang(sum_debit()) ]] [[ company.currency_id.symbol ]]</para></td>
<td><para style="terp_default_Bold_9_Right">[[ formatLang( sum_credit()) ]] [[ company.currency_id.symbol ]]</para></td>
<td><para style="terp_default_Bold_9_Right">[[ formatLang(sum_debit()) ]] </para></td>
<td><para style="terp_default_Bold_9_Right">[[ formatLang( sum_credit()) ]]</para></td>
<td><para style="terp_default_Bold_9_Right">[[ formatLang( sum_debit()- sum_credit()) ]] [[ company.currency_id.symbol ]]</para></td>
</tr>
</blockTable>
@ -281,16 +281,16 @@
<tr>
<td><para style="terp_tblheader_Details">Code</para></td>
<td><para style="terp_tblheader_Details">Journal Name</para></td>
<td><para style="terp_tblheader_Details_Right">Debit<font size="8.0">([[ company.currency_id.code]])</font></para></td>
<td><para style="terp_tblheader_Details_Right">Credit<font size="8.0">([[ company.currency_id.code]])</font></para></td>
<td><para style="terp_tblheader_Details_Right">Balance<font size="8.0">([[ company.currency_id.code]])</font></para></td>
<td><para style="terp_tblheader_Details_Right">Debit</para></td>
<td><para style="terp_tblheader_Details_Right">Credit</para></td>
<td><para style="terp_tblheader_Details_Right">Balance</para></td>
<td><para style="terp_tblheader_Details_Right">Currency</para></td>
</tr>
<tr>
<td><para style="terp_default_Bold_9">Total:([[ company.currency_id.code]])</para></td>
<td><para style="terp_default_Bold_9"><font color="white"> </font></para></td>
<td><para style="terp_default_Bold_9_Right">[[ formatLang(sum_debit()) ]] [[ company.currency_id.symbol ]]</para></td>
<td><para style="terp_default_Bold_9_Right">[[ formatLang( sum_credit()) ]] [[ company.currency_id.symbol ]]</para></td>
<td><para style="terp_default_Bold_9_Right">[[ formatLang(sum_debit()) ]]</para></td>
<td><para style="terp_default_Bold_9_Right">[[ formatLang( sum_credit()) ]]</para></td>
<td><para style="terp_default_Bold_9_Right">[[ formatLang( sum_credit()- sum_debit()) ]] [[ company.currency_id.symbol ]]</para></td>
</tr>
</blockTable>
@ -306,10 +306,10 @@
</para>
</td>
<td>
<para style="terp_default_Bold_9_Right">[[ formatLang(sum_debit_period(o.id)) ]] [[ company.currency_id.symbol ]]</para>
<para style="terp_default_Bold_9_Right">[[ formatLang(sum_debit_period(o.id)) ]]</para>
</td>
<td>
<para style="terp_default_Bold_9_Right">[[ formatLang(sum_credit_period(o.id)) ]] [[ company.currency_id.symbol ]]</para>
<para style="terp_default_Bold_9_Right">[[ formatLang(sum_credit_period(o.id)) ]]</para>
</td>
<td>
<para style="terp_default_Bold_9_Right">[[ formatLang(sum_credit_period(o.id)-sum_debit_period(o.id)) ]] [[ company.currency_id.symbol ]]</para>
@ -332,10 +332,10 @@
</para>
</td>
<td>
<para style="terp_default_Bold_9_Right">[[ formatLang(sum_debit_period(o.id)) ]] [[ company.currency_id.symbol ]]</para>
<para style="terp_default_Bold_9_Right">[[ formatLang(sum_debit_period(o.id)) ]] </para>
</td>
<td>
<para style="terp_default_Bold_9_Right">[[ formatLang(sum_credit_period(o.id)) ]] [[ company.currency_id.symbol ]]</para>
<para style="terp_default_Bold_9_Right">[[ formatLang(sum_credit_period(o.id)) ]] </para>
</td>
<td>
<para style="terp_default_Bold_9_Right">[[ formatLang(sum_credit_period(o.id)-sum_debit_period(o.id)) ]] [[ company.currency_id.symbol ]]</para>
@ -353,10 +353,10 @@
<para style="terp_default_9">[[ line['name'] ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(line['debit'] )]] [[ company.currency_id.symbol ]]</para>
<para style="terp_default_Right_9">[[ formatLang(line['debit'] )]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(line['credit']) ]] [[ company.currency_id.symbol ]]</para>
<para style="terp_default_Right_9">[[ formatLang(line['credit']) ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(line['credit']-line['debit'] ) ]] [[ company.currency_id.symbol ]]</para>
@ -370,8 +370,8 @@
<tr>
<td><para style="terp_default_9"><font>[[ repeatIn(lines(o.id),'line')]]</font> [[ line['code'] ]]</para></td>
<td><para style="terp_default_9">[[ line['name'] ]]</para></td>
<td><para style="terp_default_Right_9">[[ formatLang(line['debit'] )]] [[ company.currency_id.symbol ]]</para></td>
<td><para style="terp_default_Right_9">[[ formatLang(line['credit']) ]] [[ company.currency_id.symbol ]]</para></td>
<td><para style="terp_default_Right_9">[[ formatLang(line['debit'] )]]</para></td>
<td><para style="terp_default_Right_9">[[ formatLang(line['credit']) ]]</para></td>
<td><para style="terp_default_Right_9">[[ formatLang(line['credit']-line['debit'] ) ]] [[ company.currency_id.symbol ]]</para></td>
<td><para style="terp_default_Right_9">[[ line['currency_id'] and formatLang(line['amount_currency'] ) ]] [[ line['currency_code'] or '' ]]</para></td>
</tr>

View File

@ -44,6 +44,15 @@ class general_ledger(rml_parse.rml_parse, common_report_header):
self.init_balance = data['form']['initial_balance']
self.display_account = data['form']['display_account']
self.target_move = data['form'].get('target_move', 'all')
ctx = self.context.copy()
ctx['fiscalyear'] = data['form']['fiscalyear_id']
if data['form']['filter'] == 'filter_period':
ctx['periods'] = data['form']['periods']
elif data['form']['filter'] == 'filter_date':
ctx['date_from'] = data['form']['date_from']
ctx['date_to'] = data['form']['date_to']
ctx['state'] = data['form']['target_move']
self.context.update(ctx)
if (data['model'] == 'ir.ui.menu'):
new_ids = [data['form']['chart_account_id']]
objects = self.pool.get('account.account').browse(self.cr, self.uid, new_ids)
@ -93,7 +102,7 @@ class general_ledger(rml_parse.rml_parse, common_report_header):
def get_children_accounts(self, account):
res = []
ids_acc = self.pool.get('account.account')._get_children_and_consol(self.cr, self.uid, account.id)
for child_account in self.pool.get('account.account').browse(self.cr, self.uid, ids_acc):
for child_account in self.pool.get('account.account').browse(self.cr, self.uid, ids_acc, context=self.context):
sql = """
SELECT count(id)
FROM account_move_line AS l
@ -203,6 +212,8 @@ class general_ledger(rml_parse.rml_parse, common_report_header):
return res
def _sum_debit_account(self, account):
if account.type == 'view':
return account.debit
move_state = ['draft','posted']
if self.target_move == 'posted':
move_state = ['posted','']
@ -227,6 +238,8 @@ class general_ledger(rml_parse.rml_parse, common_report_header):
return sum_debit
def _sum_credit_account(self, account):
if account.type == 'view':
return account.credit
move_state = ['draft','posted']
if self.target_move == 'posted':
move_state = ['posted','']
@ -251,6 +264,8 @@ class general_ledger(rml_parse.rml_parse, common_report_header):
return sum_credit
def _sum_balance_account(self, account):
if account.type == 'view':
return account.balance
move_state = ['draft','posted']
if self.target_move == 'posted':
move_state = ['posted','']

View File

@ -244,9 +244,9 @@
<td><para style="P3b">Ref</para></td>
<td><para style="P3b">Move</para></td>
<td><para style="P3b">Entry Label</para></td>
<td><para style="P9b">Debit<font size="7.0">([[ company.currency_id.code]])</font></para></td>
<td><para style="P9b">Crebit<font size="7.0">([[ company.currency_id.code]])</font></para></td>
<td><para style="P9b">Balance<font size="7.0">([[ company.currency_id.code]])</font></para></td>
<td><para style="P9b">Debit</para></td>
<td><para style="P9b">Crebit</para></td>
<td><para style="P9b">Balance</para></td>
</tr>
</blockTable>
<section>
@ -256,10 +256,10 @@
<td>
<blockTable colWidths="245.0,92.5,66.5,64.5,71.5" style="Table5">
<tr>
<td><para style="Standard">[[ o.code or '']] [[ o.name or '']]</para></td>
<td><para style="Standard"><font color="white">[[ '..'*(o.level-1) ]]</font>[[ o.code or '']] [[ o.name or '']]</para></td>
<td><para style="Standard"></para></td>
<td alignment="right"><para style="P9b"><u>[[formatLang(sum_debit_account(o)) ]] [[ company.currency_id.symbol ]]</u></para></td>
<td alignment="right"><para style="P9b"><u>[[formatLang(sum_credit_account(o)) ]] [[ company.currency_id.symbol ]]</u></para></td>
<td alignment="right"><para style="P9b"><u>[[formatLang(sum_debit_account(o)) ]]</u></para></td>
<td alignment="right"><para style="P9b"><u>[[formatLang(sum_credit_account(o)) ]] </u></para></td>
<td><para style="P9b"><u>[[ formatLang(sum_balance_account(o)) ]] [[ company.currency_id.symbol ]]</u></para></td>
</tr>
</blockTable>
@ -278,8 +278,8 @@
<td><para style="P3">[[ line['lref'] or '']]</para></td>
<td><para style="P3">[[ line['move'] or '']]</para></td>
<td><para style="P3">[[ line['lname'] or '' ]]</para></td>
<td><para style="P4">[[ formatLang(line['debit']) ]] [[ company.currency_id.symbol ]]</para></td>
<td><para style="P4">[[ formatLang(line['credit']) ]] [[ company.currency_id.symbol ]]</para></td>
<td><para style="P4">[[ formatLang(line['debit']) ]]</para></td>
<td><para style="P4">[[ formatLang(line['credit']) ]]</para></td>
<td><para style="P4">[[ formatLang(line['progress']) ]] [[ company.currency_id.symbol ]]</para></td>
</tr>
</blockTable>
@ -294,9 +294,9 @@
<td><para style="P3b">Ref</para></td>
<td><para style="P3b">Move</para></td>
<td><para style="P3b">Entry Label</para></td>
<td><para style="P9b">Debit<font size="7.0">([[ company.currency_id.code]])</font></para></td>
<td><para style="P9b">Credit<font size="7.0">([[ company.currency_id.code]])</font></para></td>
<td><para style="P9b">Balance<font size="7.0">([[ company.currency_id.code]])</font></para></td>
<td><para style="P9b">Debit</para></td>
<td><para style="P9b">Credit</para></td>
<td><para style="P9b">Balance</para></td>
<td><para style="P9b">Currency</para></td>
</tr>
</blockTable>
@ -307,10 +307,10 @@
<td>
<blockTable colWidths="230.00,74.0,55.5,60.5,60.5,65.5" style="Table5">
<tr>
<td><para style="Standard">[[ o.code or '' ]] [[ o.name or '' ]]</para></td>
<td><para style="Standard"><font color="white">[[ '..'*(o.level-1) ]]</font>[[ o.code or '' ]] [[ o.name or '' ]]</para></td>
<td><para style="Standard"></para></td>
<td alignment="right"><para style="P9b"><u>[[formatLang(sum_debit_account(o)) ]] [[ company.currency_id.symbol ]]</u></para></td>
<td alignment="right"><para style="P9b"><u>[[formatLang(sum_credit_account(o)) ]] [[ company.currency_id.symbol ]]</u></para></td>
<td alignment="right"><para style="P9b"><u>[[formatLang(sum_debit_account(o)) ]]</u></para></td>
<td alignment="right"><para style="P9b"><u>[[formatLang(sum_credit_account(o)) ]]</u></para></td>
<td><para style="P9b"><u>[[formatLang(sum_balance_account(o)) ]] [[ company.currency_id.symbol ]]</u></para></td>
<td><para style="P9b"><u>[[ o.currency_id and sum_currency_amount_account(o) +o.currency_id.symbol or '' ]]</u></para></td>
</tr>
@ -331,8 +331,8 @@
<td><para style="P3">[[ line['lref'] or '']]</para></td>
<td><para style="P3">[[ line['move'] or '' ]]</para></td>
<td><para style="P3">[[ line['lname'] or '' ]]</para></td>
<td><para style="P4">[[ formatLang(line['debit']) ]] [[ company.currency_id.symbol ]]</para></td>
<td><para style="P4">[[ formatLang(line['credit']) ]] [[ company.currency_id.symbol ]]</para></td>
<td><para style="P4">[[ formatLang(line['debit']) ]]</para></td>
<td><para style="P4">[[ formatLang(line['credit']) ]]</para></td>
<td><para style="P4">[[ formatLang(line['progress']) ]] [[ company.currency_id.symbol ]]</para></td>
<td><para style="P4">[[ formatLang(line['amount_currency'] or '') ]] [[ line['currency_code'] or '']]</para></td>
</tr>

View File

@ -240,7 +240,7 @@
<font color="white"> </font>
</para>
<blockTable colWidths="66.0,35.0,120.0,90.0,60.0,230.0,150.0,73.0,73.0,73.0,85.00" style="tbl_header" repeatRows="1">[[data['form']['amount_currency'] == True or removeParentNode('blockTable')]]
<blockTable colWidths="66.0,35.0,120.0,90.0,60.0,200.0,180.0,73.0,73.0,73.0,85.00" style="tbl_header" repeatRows="1">[[data['form']['amount_currency'] == True or removeParentNode('blockTable')]]
<tr>
<td><para style="date">Date</para></td>
<td><para style="P2">JNRL</para></td>
@ -249,9 +249,9 @@
<td><para style="P2">Move</para></td>
<td><para style="P3">Entry Label</para></td>
<td><para style="P3_center">Counterpart</para></td>
<td><para style="P4">Debit([[ company.currency_id.code]])</para></td>
<td><para style="P4">Credit([[ company.currency_id.code]])</para></td>
<td><para style="P4">Balance([[ company.currency_id.code]])</para></td>
<td><para style="P4">Debit</para></td>
<td><para style="P4">Credit</para></td>
<td><para style="P4">Balance</para></td>
<td><para style="P4">Currency</para></td>
</tr>
</blockTable>
@ -259,15 +259,15 @@
<para>[[ repeatIn(get_children_accounts(a), 'o') ]]</para>
<blockTable colWidths="66.0,35.0,120.0,90.0,60.0,230.0,150.0,73.0,73.0,73.0,85.00" style="tbl_content">[[data['form']['amount_currency'] == True or removeParentNode('blockTable')]]
<blockTable colWidths="66.0,35.0,120.0,90.0,60.0,200.0,180.0,73.0,73.0,73.0,85.00" style="tbl_content">[[data['form']['amount_currency'] == True or removeParentNode('blockTable')]]
<tr>
<td>
<blockTable colWidths="404.0,335.0,75.0,75.0,75.0,79.00" style="Table5">
<tr>
<td><para style="Standard">[[ o.code ]] [[ o.name ]]</para></td>
<td><para style="Standard"><font color="white">[[ '..'*(o.level-1) ]]</font>[[ o.code ]] [[ o.name ]]</para></td>
<td><para style="Standard"></para></td>
<td alignment="right"><para style="P9b"><u>[[formatLang(sum_debit_account(o)) ]] [[ company.currency_id.symbol ]]</u></para></td>
<td alignment="right"><para style="P9b"><u>[[formatLang(sum_credit_account(o)) ]] [[ company.currency_id.symbol ]]</u></para></td>
<td alignment="right"><para style="P9b"><u>[[formatLang(sum_debit_account(o)) ]]</u></para></td>
<td alignment="right"><para style="P9b"><u>[[formatLang(sum_credit_account(o)) ]]</u></para></td>
<td><para style="P9b"><u>[[formatLang(sum_balance_account(o)) ]] [[ company.currency_id.symbol ]]</u></para></td>
<td><para style="P9b"><u>[[ o.currency_id and sum_currency_amount_account(o) +o.currency_id.code or '' ]]</u></para></td>
</tr>
@ -292,8 +292,8 @@
<td><para style="P2_content">[[ line['move'] ]]</para></td>
<td><para style="P3_content">[[ line['lname'] ]]</para></td>
<td><para style="P3_content_center">[[ strip_name(line['line_corresp'].replace(', ',','),40) ]]</para></td>
<td><para style="P4_content">[[ formatLang(line['debit']) ]] [[ company.currency_id.symbol ]]</para></td>
<td><para style="P4_content">[[ formatLang(line['credit']) ]] [[ company.currency_id.symbol ]]</para></td>
<td><para style="P4_content">[[ formatLang(line['debit']) ]]</para></td>
<td><para style="P4_content">[[ formatLang(line['credit']) ]]</para></td>
<td><para style="P4_content">[[ formatLang(line['progress']) ]] [[ company.currency_id.symbol ]]</para></td>
<td><para style="P4_content">[[ formatLang(line['amount_currency'] or '')]] [[ line['currency_code'] or '' ]]</para></td>
</tr>
@ -301,7 +301,7 @@
</section>
<blockTable colWidths="66.0,35.0,166.0,90.0,60.0,348.0,80.0,69.0,72.0,64.0" style="tbl_header" repeatRows="1">[[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]]
<blockTable colWidths="66.0,35.0,166.0,90.0,60.0,280.0,148.0,69.0,72.0,64.0" style="tbl_header" repeatRows="1">[[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]]
<tr>
<td><para style="P2">Date</para></td>
<td><para style="date">JNRL</para></td>
@ -310,9 +310,9 @@
<td><para style="P2">Move</para></td>
<td><para style="P3">Entry Label</para></td>
<td><para style="P3_center">Counterpart</para></td>
<td><para style="P4">Debit([[ company.currency_id.code]])</para></td>
<td><para style="P4">Credit([[ company.currency_id.code]])</para></td>
<td><para style="P4">Balance([[ company.currency_id.code]])</para></td>
<td><para style="P4">Debit</para></td>
<td><para style="P4">Credit</para></td>
<td><para style="P4">Balance</para></td>
</tr>
</blockTable>
@ -320,15 +320,15 @@
<para>[[ repeatIn(get_children_accounts(a), 'o') ]]</para>
<blockTable colWidths="66.0,35.0,166.0,90.0,60.0,348.0,80.0,69.0,72.0,64.0" style="tbl_content">[[data['form']['amount_currency'] == False or removeParentNode('blockTable')]]
<blockTable colWidths="66.0,35.0,166.0,90.0,60.0,280.0,148.0,69.0,72.0,64.0" style="tbl_content">[[data['form']['amount_currency'] == False or removeParentNode('blockTable')]]
<tr>
<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"><font color="white">[[ '..'*(o.level-1) ]]</font>[[ o.code ]] [[ o.name ]]</para></td>
<td><para style="Standard"></para></td>
<td alignment="right"><para style="P9b"><u>[[formatLang(sum_debit_account(o)) ]] [[ company.currency_id.symbol ]]</u></para></td>
<td alignment="right"><para style="P9b"><u>[[formatLang(sum_credit_account(o)) ]] [[ company.currency_id.symbol ]]</u></para></td>
<td alignment="right"><para style="P9b"><u>[[formatLang(sum_debit_account(o)) ]]</u></para></td>
<td alignment="right"><para style="P9b"><u>[[formatLang(sum_credit_account(o)) ]]</u></para></td>
<td><para style="P9b"><u>[[formatLang(sum_balance_account(o)) ]] [[ company.currency_id.symbol ]]</u></para></td>
</tr>
</blockTable>
@ -352,8 +352,8 @@
<td><para style="P2_content">[[ line['move'] ]]</para></td>
<td><para style="P3_content">[[ line['lname'] ]]</para></td>
<td><para style="P3_content_center">[[ strip_name(line['line_corresp'],15) ]]</para></td>
<td><para style="P4_content">[[ formatLang(line['debit']) ]] [[ company.currency_id.symbol ]]</para></td>
<td><para style="P4_content">[[ formatLang(line['credit']) ]] [[ company.currency_id.symbol ]]</para></td>
<td><para style="P4_content">[[ formatLang(line['debit']) ]] </para></td>
<td><para style="P4_content">[[ formatLang(line['credit']) ]]</para></td>
<td><para style="P4_content">[[ formatLang(line['progress']) ]] [[ company.currency_id.symbol ]]</para></td>
</tr>
</blockTable>

View File

@ -72,6 +72,7 @@ class account_invoice_report(osv.osv):
'partner_bank_id': fields.many2one('res.partner.bank', 'Bank Account',readonly=True),
'residual': fields.float('Total Residual', readonly=True),
'delay_to_pay': fields.float('Avg. Delay To Pay', readonly=True, group_operator="avg"),
'due_delay': fields.float('Avg. Due Delay', readonly=True, group_operator="avg"),
}
_order = 'date desc'
def init(self, cr):
@ -134,6 +135,11 @@ class account_invoice_report(osv.osv):
left join account_invoice as a ON (a.move_id=aml.move_id)
left join account_invoice_line as l ON (a.id=l.invoice_id)
where a.id=ai.id)) as delay_to_pay,
sum((select extract(epoch from avg(date_trunc('day',a.date_due)-date_trunc('day',a.date_invoice)))/(24*60*60)::decimal(16,2)
from account_move_line as aml
left join account_invoice as a ON (a.move_id=aml.move_id)
left join account_invoice_line as l ON (a.id=l.invoice_id)
where a.id=ai.id)) as due_delay,
(case when ai.type in ('out_refund','in_invoice') then
ai.residual * -1
else
@ -145,7 +151,7 @@ class account_invoice_report(osv.osv):
left join account_invoice as ai ON (ai.id=ail.invoice_id)
left join product_template pt on (pt.id=ail.product_id)
left join product_uom u on (u.id=ail.uos_id),
res_currency_rate cr
res_currency_rate cr
where cr.id in (select id from res_currency_rate cr2 where (cr2.currency_id = ai.currency_id)
and ((ai.date_invoice is not null and cr.name <= ai.date_invoice) or (ai.date_invoice is null and cr.name <= NOW())) limit 1)
group by ail.product_id,

View File

@ -34,6 +34,7 @@
<field name="price_total" sum="Total Without Tax"/>
<field name="price_total_tax" sum="Total With Tax"/>
<field name="residual" sum="Total Residual" invisible="context.get('residual_invisible',False)"/>
<field name="due_delay" sum="Avg. Due Delay" invisible="context.get('residual_invisible',False)"/>
<field name="delay_to_pay" sum="Avg. Delay To Pay" invisible="context.get('residual_invisible',False)"/>
</tree>
</field>
@ -97,6 +98,17 @@
<field name="categ_id" />
</group>
<newline/>
<group expand="0" string="Extended Filters..." groups="base.group_extended">
<field name="product_id"/>
<separator orientation="vertical"/>
<field name="journal_id" widget="selection"/>
<field name="account_id"/>
<separator orientation="vertical"/>
<field name="date_due"/>
<separator orientation="vertical" groups="base.group_multi_company"/>
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
</group>
<newline/>
<group expand="1" string="Group By...">
<filter string="Partner" icon="terp-partner" context="{'group_by':'partner_id','residual_visible':True}"/>
<filter string="Salesman" name='user' icon="terp-personal" context="{'group_by':'user_id'}"/>
@ -118,17 +130,6 @@
<filter string="Month" name="month" icon="terp-go-month" context="{'group_by':'month'}" help="Group by month of Invoice Date"/>
<filter string="Year" name="year" icon="terp-go-year" context="{'group_by':'year'}" help="Group by year of Invoice Date"/>
</group>
<newline/>
<group expand="0" string="Extended Filters..." groups="base.group_extended">
<field name="product_id"/>
<separator orientation="vertical"/>
<field name="journal_id" widget="selection"/>
<field name="account_id"/>
<separator orientation="vertical"/>
<field name="date_due"/>
<separator orientation="vertical" groups="base.group_multi_company"/>
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
</group>
</search>
</field>
</record>

View File

@ -253,9 +253,9 @@
<td><para style="P10">A/c No.</para></td>
<td><para style="P10a">Partner</para></td>
<td><para style="P10a">Move - Entry label</para></td>
<td><para style="P10b">Debit([[ company.currency_id.code]])</para></td>
<td><para style="P10b">Credit([[ company.currency_id.code]])</para></td>
<td><para style="P10b">Balance([[ company.currency_id.code]])</para></td>
<td><para style="P10b">Debit</para></td>
<td><para style="P10b">Credit</para></td>
<td><para style="P10b">Balance</para></td>
</tr>
<tr>
<td><para style="P11">[[o.period_id.name ]]</para></td>
@ -263,8 +263,8 @@
<td><para style="P11"><font color="white"></font></para></td>
<td><para style="P11"><font color="white"></font></para></td>
<td><para style="P11"><font color="white"></font></para></td>
<td><para style="P12"><u>[[ formatLang(sum_debit(o.period_id.id, o.journal_id.id)) ]] [[ company.currency_id.symbol ]]</u></para></td>
<td><para style="P12"><u>[[ formatLang(sum_credit(o.period_id.id, o.journal_id.id)) ]] [[ company.currency_id.symbol ]]</u></para></td>
<td><para style="P12"><u>[[ formatLang(sum_debit(o.period_id.id, o.journal_id.id)) ]]</u></para></td>
<td><para style="P12"><u>[[ formatLang(sum_credit(o.period_id.id, o.journal_id.id)) ]] </u></para></td>
<td> <para style="P12"><u>[[ formatLang((sum_credit(o.period_id.id, o.journal_id.id) - sum_debit(o.period_id.id, o.journal_id.id))) ]] [[ company.currency_id.symbol ]]</u></para></td>
</tr>
<para style="Standard"><font color="white">[[lines(o.period_id.id, o.journal_id.id) or removeParentNode('story') ]]</font></para>
@ -274,8 +274,8 @@
<td><para style="terp_default_Centre_8">[[ line.account_id.code ]]</para></td>
<td><para style="terp_default_8">[[ line.partner_id and line.partner_id.name ]]</para></td>
<td><para style="terp_default_8">[[ line.move_id.name ]] - [[ line.name ]]</para></td>
<td><para style="P8">[[ formatLang(line.debit) ]] [[ company.currency_id.symbol ]]</para></td>
<td><para style="P8">[[ formatLang(line.credit) ]] [[ company.currency_id.symbol ]]</para></td>
<td><para style="P8">[[ formatLang(line.debit) ]]</para></td>
<td><para style="P8">[[ formatLang(line.credit) ]]</para></td>
<td><para style="P8">[[ formatLang(line.credit - line.debit) ]] [[ company.currency_id.symbol ]]</para></td>
</tr>
</blockTable>
@ -288,9 +288,9 @@
<td><para style="P10">A/c No.</para></td>
<td><para style="P10a">Partner</para></td>
<td><para style="P10a">Move - Entry label</para></td>
<td><para style="P10b">Debit<font size="8.0">([[ company.currency_id.code]])</font></para></td>
<td><para style="P10b">Credit<font size="8.0">([[ company.currency_id.code]])</font></para></td>
<td><para style="P10b">Balance<font size="8.0">([[ company.currency_id.code]])</font></para></td>
<td><para style="P10b">Debit</para></td>
<td><para style="P10b">Credit</para></td>
<td><para style="P10b">Balance</para></td>
<td><para style="P10b">Currency</para></td>
</tr>
<tr>
@ -299,8 +299,8 @@
<td><para style="P11"><font color="white"></font></para></td>
<td><para style="P11"><font color="white"></font></para></td>
<td><para style="P11"><font color="white"></font></para></td>
<td><para style="P12"><u>[[ formatLang(sum_debit(o.period_id.id, o.journal_id.id)) ]] [[ company.currency_id.symbol ]]</u></para></td>
<td><para style="P12"><u>[[ formatLang(sum_credit(o.period_id.id, o.journal_id.id)) ]] [[ company.currency_id.symbol ]]</u></para></td>
<td><para style="P12"><u>[[ formatLang(sum_debit(o.period_id.id, o.journal_id.id)) ]]</u></para></td>
<td><para style="P12"><u>[[ formatLang(sum_credit(o.period_id.id, o.journal_id.id)) ]]</u></para></td>
<td> <para style="P12"><u>[[ formatLang((sum_debit(o.period_id.id, o.journal_id.id) - sum_credit(o.period_id.id, o.journal_id.id))) ]] [[ company.currency_id.symbol ]]</u></para></td>
</tr>
<para style="Standard"><font color="white">[[lines(o.period_id.id, o.journal_id.id) or removeParentNode('story') ]]</font></para>
@ -310,8 +310,8 @@
<td><para style="terp_default_Centre_8">[[ line.account_id.code ]]</para></td>
<td><para style="terp_default_8">[[ line.partner_id and line.partner_id.name ]]</para></td>
<td><para style="terp_default_8">[[ line.move_id.name ]] - [[ line.name ]]</para></td>
<td><para style="P8">[[ formatLang(line.debit) ]] [[ company.currency_id.symbol ]]</para></td>
<td><para style="P8">[[ formatLang(line.credit) ]] [[ company.currency_id.symbol ]]</para></td>
<td><para style="P8">[[ formatLang(line.debit) ]]</para></td>
<td><para style="P8">[[ formatLang(line.credit) ]]</para></td>
<td><para style="P8">[[ formatLang(line.credit - line.debit) ]] [[ company.currency_id.symbol ]]</para></td>
<td><para style="P8">[[ line.currency_id and formatLang(line.amount_currency) or '' ]] [[ line.currency_id.symbol or '']]</para></td>

View File

@ -231,24 +231,24 @@
<tr>
<td><para style="P12a">Code</para></td>
<td><para style="P12a">(Account/Partner) Name</para></td>
<td><para style="P12b">Debit<font size="8.0">([[ company.currency_id.code]])</font></para></td>
<td><para style="P12b">Credit<font size="8.0">([[ company.currency_id.code]])</font></para></td>
<td><para style="P12b">Balance<font size="8.0">([[ company.currency_id.code]])</font></para></td>
<td><para style="P12a">In dispute<font size="8.0">([[ company.currency_id.code]])</font></para></td>
<td><para style="P12b">Debit</para></td>
<td><para style="P12b">Credit</para></td>
<td><para style="P12b">Balance</para></td>
<td><para style="P12a">In dispute</para></td>
</tr>
<tr>
<td><para style="P7">Total<font size="8.0">([[ company.currency_id.code]]) :</font></para></td>
<td><para style="P7">Total:</para></td>
<td><para style="P8"></para></td>
<td><para style="P8"><u>[[ formatLang(sum_debit()) ]] [[ company.currency_id.symbol ]]</u></para></td>
<td><para style="P8"><u>[[ formatLang(sum_credit()) ]] [[ company.currency_id.symbol ]]</u></para></td>
<td><para style="P8"><u>[[ formatLang(sum_debit()) ]] </u></para></td>
<td><para style="P8"><u>[[ formatLang(sum_credit()) ]]</u></para></td>
<td><para style="P8"><u>[[ formatLang((solde_debit()-solde_credit())) ]] [[ company.currency_id.symbol ]]</u></para></td>
<td><para style="P8"><u>[[ formatLang(sum_litige()) ]] [[ company.currency_id.symbol ]]</u></para></td>
</tr>
<tr>
<td><para style="P3">[[ repeatIn(lines(), 'a') ]]<font>[[ (a['type']==3 and setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]]</font><font>[[ a['ref'] ]] [[ a['type']==3 and a['code'] ]]</font></para></td>
<td><para style="P3"><font>[[ (a['type']==3 and setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]]</font>[[ a['name'] ]]</para></td>
<td><para style="P4"><font>[[ (a['type']==3 and setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]]</font>[[ formatLang(a['debit']) ]] [[ company.currency_id.symbol ]]</para></td>
<td><para style="P4"><font>[[ (a['type']==3 and setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]]</font>[[ formatLang(a['credit']) ]] [[ company.currency_id.symbol ]]</para></td>
<td><para style="P4"><font>[[ (a['type']==3 and setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]]</font>[[ formatLang(a['debit']) ]]</para></td>
<td><para style="P4"><font>[[ (a['type']==3 and setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]]</font>[[ formatLang(a['credit']) ]]</para></td>
<td><para style="P4"><font>[[ (a['type']==3 and setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]]</font>[[ formatLang(a['balance']) ]] [[ company.currency_id.symbol ]]</para></td>
<td><para style="P4"><font>[[ (a['type']==3 and setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]]</font>[[ formatLang(a['enlitige'] or 0.0) ]] [[ company.currency_id.symbol ]]</para></td>
</tr>

View File

@ -295,13 +295,13 @@
<para style="terp_tblheader_Details">Entry Label</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Debit([[ get_currency(data) ]])</para>
<para style="terp_tblheader_Details_Right">Debit</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Credit([[ get_currency(data) ]])</para>
<para style="terp_tblheader_Details_Right">Credit</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Balance([[ get_currency(data) ]])</para>
<para style="terp_tblheader_Details_Right">Balance</para>
</td>
</tr>
</blockTable>
@ -318,10 +318,10 @@
<para style="P2">[[ p.ref ]] - [[ p.name ]]</para>
</td>
<td>
<para style="P5">[[ formatLang((sum_debit_partner(p))) ]] [[ company.currency_id.symbol ]]</para>
<para style="P5">[[ formatLang((sum_debit_partner(p))) ]]</para>
</td>
<td>
<para style="P5">[[ formatLang((sum_credit_partner(p))) ]] [[ company.currency_id.symbol ]]</para>
<para style="P5">[[ formatLang((sum_credit_partner(p))) ]] </para>
</td>
<td>
<para style="P5">[[ formatLang((sum_debit_partner(p) - sum_credit_partner(p))) ]] [[ company.currency_id.symbol ]]</para>
@ -332,10 +332,10 @@
<para style="P2">Initial Balance</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(get_intial_balance(p)[0][0])]] [[ company.currency_id.symbol ]]</para>
<para style="terp_default_Right_9">[[ formatLang(get_intial_balance(p)[0][0])]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(get_intial_balance(p)[0][1]) ]] [[ company.currency_id.symbol ]]</para>
<para style="terp_default_Right_9">[[ formatLang(get_intial_balance(p)[0][1]) ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(get_intial_balance(p)[0][2]) ]] [[ company.currency_id.symbol ]]</para>
@ -365,10 +365,10 @@
<para style="P3">[[ line['ref'] ]] - [[ line['name'] ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang((line['debit'])) ]] [[ company.currency_id.symbol ]]</para>
<para style="terp_default_Right_9">[[ formatLang((line['debit'])) ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang((line['credit'])) ]] [[ company.currency_id.symbol ]]</para>
<para style="terp_default_Right_9">[[ formatLang((line['credit'])) ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang((line['progress'])) ]] [[ company.currency_id.symbol ]]</para>
@ -397,13 +397,13 @@
<para style="terp_tblheader_Details">Entry Label</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Debit([[ get_currency(data) ]])</para>
<para style="terp_tblheader_Details_Right">Debit</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Credit([[ get_currency(data) ]])</para>
<para style="terp_tblheader_Details_Right">Credit</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Balance([[ get_currency(data) ]])</para>
<para style="terp_tblheader_Details_Right">Balance</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Currency</para>
@ -423,10 +423,10 @@
<para style="P2">[[ p.ref ]] - [[ p.name ]]</para>
</td>
<td>
<para style="P5">[[ formatLang((sum_debit_partner(p))) ]] [[ company.currency_id.symbol ]]</para>
<para style="P5">[[ formatLang((sum_debit_partner(p))) ]]</para>
</td>
<td>
<para style="P5">[[ formatLang((sum_credit_partner(p))) ]] [[ company.currency_id.symbol ]]</para>
<para style="P5">[[ formatLang((sum_credit_partner(p))) ]]</para>
</td>
<td>
<para style="P5">[[ formatLang((sum_debit_partner(p) - sum_credit_partner(p))) ]] [[ company.currency_id.symbol ]]</para>
@ -442,10 +442,10 @@
<para style="P2">Initial Balance</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(get_intial_balance(p)[0][0]) ]] [[ company.currency_id.symbol ]]</para>
<para style="terp_default_Right_9">[[ formatLang(get_intial_balance(p)[0][0]) ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(get_intial_balance(p)[0][1]) ]] [[ company.currency_id.symbol ]]</para>
<para style="terp_default_Right_9">[[ formatLang(get_intial_balance(p)[0][1]) ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(get_intial_balance(p)[0][2]) ]] [[ company.currency_id.symbol ]]</para>
@ -478,10 +478,10 @@
<para style="P3">[[ (line['ref'] or '') + ' ' + line['name'] ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang((line['debit'])) ]] [[ company.currency_id.symbol ]]</para>
<para style="terp_default_Right_9">[[ formatLang((line['debit'])) ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang((line['credit'])) ]] [[ company.currency_id.symbol ]]</para>
<para style="terp_default_Right_9">[[ formatLang((line['credit'])) ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang((line['progress'])) ]] [[ company.currency_id.symbol ]]</para>

View File

@ -449,13 +449,13 @@
<para style="terp_tblheader_Details">Entry Label</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Debit([[ get_currency(data) ]])</para>
<para style="terp_tblheader_Details_Right">Debit</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Credit([[ get_currency(data) ]])</para>
<para style="terp_tblheader_Details_Right">Credit</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Balance([[ get_currency(data) ]])</para>
<para style="terp_tblheader_Details_Right">Balance</para>
</td>
</tr>
</blockTable>
@ -468,10 +468,10 @@
<para style="P2">[[ p.ref ]] - [[ p.name ]]</para>
</td>
<td>
<para style="P5">[[ formatLang((sum_debit_partner(p))) ]] [[ company.currency_id.symbol ]]</para>
<para style="P5">[[ formatLang((sum_debit_partner(p))) ]]</para>
</td>
<td>
<para style="P5">[[ formatLang((sum_credit_partner(p))) ]] [[ company.currency_id.symbol ]]</para>
<para style="P5">[[ formatLang((sum_credit_partner(p))) ]]</para>
</td>
<td>
<para style="P5">[[ formatLang((sum_debit_partner(p) - sum_credit_partner(p))) ]] [[ company.currency_id.symbol ]]</para>
@ -482,10 +482,10 @@
<para style="P2">Initial Balance</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(get_intial_balance(p)[0][0])]] [[ company.currency_id.symbol ]]</para>
<para style="terp_default_Right_9">[[ formatLang(get_intial_balance(p)[0][0])]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(get_intial_balance(p)[0][1]) ]] [[ company.currency_id.symbol ]]</para>
<para style="terp_default_Right_9">[[ formatLang(get_intial_balance(p)[0][1]) ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(get_intial_balance(p)[0][2]) ]] [[ company.currency_id.symbol ]]</para>
@ -512,10 +512,10 @@
<para style="P3">[[ (line['ref'] or '') + ' ' + line['name'] ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang((line['debit'])) ]] [[ company.currency_id.symbol ]]</para>
<para style="terp_default_Right_9">[[ formatLang((line['debit'])) ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang((line['credit'])) ]] [[ company.currency_id.symbol ]]</para>
<para style="terp_default_Right_9">[[ formatLang((line['credit'])) ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang((line['progress'])) ]] [[ company.currency_id.symbol ]]</para>
@ -542,13 +542,13 @@
<para style="terp_tblheader_Details">Entry Label</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Debit([[ get_currency(data) ]])</para>
<para style="terp_tblheader_Details_Right">Debit</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Credit([[ get_currency(data) ]])</para>
<para style="terp_tblheader_Details_Right">Credit</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Balance([[ get_currency(data) ]])</para>
<para style="terp_tblheader_Details_Right">Balance</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Currency</para>
@ -565,10 +565,10 @@
<para style="P2">[[ p.ref ]] - [[ p.name ]]</para>
</td>
<td>
<para style="P5">[[ formatLang((sum_debit_partner(p))) ]] [[ company.currency_id.symbol ]]</para>
<para style="P5">[[ formatLang((sum_debit_partner(p))) ]]</para>
</td>
<td>
<para style="P5">[[ formatLang((sum_credit_partner(p))) ]] [[ company.currency_id.symbol ]]</para>
<para style="P5">[[ formatLang((sum_credit_partner(p))) ]]</para>
</td>
<td>
<para style="P5">[[ formatLang((sum_debit_partner(p) - sum_credit_partner(p))) ]] [[ company.currency_id.symbol ]]</para>
@ -584,10 +584,10 @@
<para style="P2">Initial Balance</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(get_intial_balance(p)[0][0]) ]] [[ company.currency_id.symbol ]]</para>
<para style="terp_default_Right_9">[[ formatLang(get_intial_balance(p)[0][0]) ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(get_intial_balance(p)[0][1]) ]] [[ company.currency_id.symbol ]]</para>
<para style="terp_default_Right_9">[[ formatLang(get_intial_balance(p)[0][1]) ]] </para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(get_intial_balance(p)[0][2]) ]] [[ company.currency_id.symbol ]]</para>
@ -617,10 +617,10 @@
<para style="P3">[[ (line['ref'] or '') + ' ' + line['name'] ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang((line['debit'])) ]] [[ company.currency_id.symbol ]]</para>
<para style="terp_default_Right_9">[[ formatLang((line['debit'])) ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang((line['credit'])) ]] [[ company.currency_id.symbol ]]</para>
<para style="terp_default_Right_9">[[ formatLang((line['credit'])) ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang((line['progress'])) ]] [[ company.currency_id.symbol ]]</para>

View File

@ -29,31 +29,8 @@
<blockTableStyle id="Table_Account_Line_Title">
<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,0" 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,0" stop="1,-1"/>
<lineStyle kind="LINEBEFORE" 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,0" stop="2,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="3,0" stop="3,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="3,0" stop="3,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,0" stop="3,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="4,0" stop="4,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="4,0" stop="4,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,0" stop="4,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="5,0" stop="5,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="5,0" stop="5,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="5,0" stop="5,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="6,0" stop="6,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="6,0" stop="6,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="6,0" stop="6,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="7,0" stop="7,-1"/>
<lineStyle kind="LINEAFTER" colorName="#cccccc" start="7,0" stop="7,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="7,0" stop="7,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="7,0" stop="7,-1"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,1" stop="-1,-1"/>
</blockTableStyle>
<blockTableStyle id="Table_Main_Content">
<blockAlignment value="LEFT"/>
@ -74,31 +51,7 @@
<blockTableStyle id="Table_Net_Profit_Loss">
<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="LINEABOVE" colorName="#cccccc" start="2,0" stop="2,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="3,0" stop="3,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="3,0" stop="3,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="4,0" stop="4,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="4,0" stop="4,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,-1" stop="4,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="5,0" stop="5,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="5,0" stop="5,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="5,-1" stop="5,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="6,0" stop="6,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="6,0" stop="6,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="6,-1" stop="6,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="7,0" stop="7,-1"/>
<lineStyle kind="LINEAFTER" colorName="#cccccc" start="7,0" stop="7,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="7,0" stop="7,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="7,-1" stop="7,-1"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,0" stop="-1,-1"/>
</blockTableStyle>
<blockTableStyle id="Table_Final_Result">
<blockAlignment value="LEFT"/>
@ -249,7 +202,7 @@
<para style="terp_default_Bold_9">Perticular</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Total Amount([[ get_currency(data) ]])</para>
<para style="terp_tblheader_Details_Right">Balance</para>
</td>
<td>
<para style="terp_default_Bold_9">Code</para>
@ -258,7 +211,7 @@
<para style="terp_default_Bold_9">Perticular</para>
</td>
<td>
<para style="P1">Total Amount([[ get_currency(data) ]])</para>
<para style="P1">Balance</para>
</td>
</tr>
<tr>
@ -317,13 +270,13 @@
<blockTable colWidths="408.16,116.32,408.16,116.32" style="Table_Net_Profit_Loss">
<tr>
<td>
<para style="terp_default_Bold_9">Total:([[ get_currency(data['form']) ]] [[ company.currency_id.code]] )</para>
<para style="terp_default_Bold_9">Total:</para>
</td>
<td>
<para style="terp_default_Right_9_Bold"><u>[[ formatLang(abs(sum_dr())) ]] [[ company.currency_id.symbol ]]</u></para>
</td>
<td>
<para style="terp_default_Bold_9">Total:([[ get_currency(data['form']) ]] [[ company.currency_id.code]])</para>
<para style="terp_default_Bold_9">Total:</para>
</td>
<td>
<para style="terp_default_Right_9_Bold"><u>[[ formatLang(abs(sum_cr())) ]] [[ company.currency_id.symbol ]]</u></para>

View File

@ -25,19 +25,8 @@
<blockTableStyle id="Table_Account_Line_Title">
<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,0" 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,0" stop="1,-1"/>
<lineStyle kind="LINEBEFORE" 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,0" stop="2,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="3,0" stop="3,-1"/>
<lineStyle kind="LINEAFTER" colorName="#cccccc" start="3,0" stop="3,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="3,0" stop="3,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,0" stop="3,-1"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,1" stop="-1,-1"/>
</blockTableStyle>
<blockTableStyle id="Table3">
<blockAlignment value="LEFT"/>
@ -50,36 +39,13 @@
<blockTableStyle id="Table_Net_Profit_Loss">
<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="LINEABOVE" colorName="#cccccc" start="2,0" stop="2,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="3,0" stop="3,-1"/>
<lineStyle kind="LINEAFTER" colorName="#cccccc" start="3,0" stop="3,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="3,0" stop="3,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,0" stop="-1,-1"/>
</blockTableStyle>
<blockTableStyle id="Table2">
<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,0" 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,0" stop="1,-1"/>
<lineStyle kind="LINEBEFORE" 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,0" stop="2,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="3,0" stop="3,-1"/>
<lineStyle kind="LINEAFTER" colorName="#cccccc" start="3,0" stop="3,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="3,0" stop="3,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,0" stop="3,-1"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,1" stop="-1,-1"/>
</blockTableStyle>
<blockTableStyle id="Table3">
<blockAlignment value="LEFT"/>
@ -89,19 +55,7 @@
<blockTableStyle id="Table4">
<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="LINEABOVE" colorName="#cccccc" start="2,0" stop="2,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="3,0" stop="3,-1"/>
<lineStyle kind="LINEAFTER" colorName="#cccccc" start="3,0" stop="3,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="3,0" stop="3,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,0" stop="-1,-1"/>
</blockTableStyle>
<blockTableStyle id="Table_Final_Result">
<blockAlignment value="LEFT"/>
@ -249,7 +203,7 @@
<para style="terp_default_Bold_9">Expenses</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Total Amount([[ get_currency(data) ]])</para>
<para style="terp_tblheader_Details_Right">Balance</para>
</td>
</tr>
<tr>
@ -304,7 +258,7 @@
<para style="terp_default_Bold_9">Incomes</para>
</td>
<td>
<para style="P1">Total Amount([[ get_currency(data) ]])</para>
<para style="P1">Balance</para>
</td>
</tr>
<tr>
@ -339,7 +293,7 @@
<blockTable colWidths="426.0,113.0" style="Table4">
<tr>
<td>
<para style="terp_default_Bold_9">Total:([[ get_currency(data) ]])</para>
<para style="terp_default_Bold_9">Total:</para>
</td>
<td>
<para style="terp_default_Right_9_Bold"><u>[[ formatLang(abs(sum_cr())) ]] [[ company.currency_id.symbol ]]</u></para>

View File

@ -102,10 +102,10 @@
<para style="terp_tblheader_Details">Entry Label</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Debit<font face="Helvetica" size="8.0">([[ company.currency_id.name ]])</font></para>
<para style="terp_tblheader_Details_Right">Debit</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Credit<font face="Helvetica" size="8.0">([[ company.currency_id.name ]])</font></para>
<para style="terp_tblheader_Details_Right">Credit</para>
</td>
</tr>
</blockTable>

View File

@ -1,397 +0,0 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import time
import locale
from report import report_sxw
#from addons.account.wizard import wizard_account_balance_report
parents = {
'tr':1,
'li':1,
'story': 0,
'section': 0
}
class account_balance(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(account_balance, self).__init__(cr, uid, name, context=context)
self.flag=1
self.dr_total= 0.00
self.cr_total= 0.00
self.parent_bal=0
self.status=0
self.done_total=0
self.baldiv={}
self.empty_parent=0
self.result_total = {}
self.total_for_perc=[]
self.localcontext.update({
'time': time,
'lines': self.lines,
'get_lines':self.get_lines,
'linesForTotal': self.linesForTotal,
'linesForYear': self.linesForYear,
'get_years':self.get_years,
'cal_total':self.cal_total,
'total_dr':self.total_dr,
'total_cr':self.total_cr
})
self.context = context
def linesForYear(self, form):
temp=0
years={}
global pattern
global show
global perc
global bal_zero
global ref_bal
pattern=form['compare_pattern']
if form['show_columns']!=1:
show=0
else:
show=form['show_columns']
if form['format_perc']!=1:
perc=0
else:
perc=form['format_perc']
if form['account_choice']=='bal_zero':
bal_zero=0
else:
bal_zero=1
ctx = self.context.copy()
if perc==1:
if form['select_account']!=False:
ref_ac=self.pool.get('account.account').browse(self.cr, self.uid, form['select_account'], ctx.copy())
if ref_ac.balance<>0.00:
ref_bal=ref_ac.balance
else:
ref_bal=1.00
else:
ref_bal='nothing'
else:
ref_bal='nothing'
total_for_perc=[]
self.done_total=1
self.total_for_perc=self.linesForTotal(form, ids={}, doneAccount={}, level=1)
self.done_total=0
for t1 in range(0,len(form['fiscalyear'])):
locale.setlocale(locale.LC_ALL, '')
self.result_total["sum_credit" + str(t1)]=locale.format("%.2f", self.result_total["sum_credit" + str(t1)], grouping=True)
self.result_total["sum_debit" + str(t1)]=locale.format("%.2f", self.result_total["sum_debit" + str(t1)], grouping=True)
for temp in range(0,len(form['fiscalyear'])):
fy=self.pool.get('account.fiscalyear').name_get(self.cr, self.uid, form['fiscalyear'][temp])
years["year"+str(temp)]=fy[0][1][12:16]
return [years]
def linesForTotal(self, form, ids={}, doneAccount={}, level=1):
if self.done_total==1:
self.done_total==1
else:
return [self.result_total]
accounts=[]
if not ids:
ids = self.ids
if not ids:
return []
ctx = self.context.copy()
result_total_parent=[]
for id in form['fiscalyear']:
tmp=[]
ctx['fiscalyear'] = id
ctx['periods'] = form['periods']
ctx['period_manner'] = form['period_manner']
ctx['state'] = form['context'].get('state','all')
tmp = self.pool.get('account.account').browse(self.cr, self.uid, ids, ctx.copy())
if len(tmp):
accounts.append(tmp)
merged_accounts=zip(*accounts)
# used to check for the frst record so all sum_credit and sum_debit r set to 0.00
if level==1:
doneAccount={}
for entry in merged_accounts:
if entry[0].id in doneAccount:
continue
doneAccount[entry[0].id] = 1
for k in range(0,len(entry)):
temp_credit=0.00
temp_debit=0.00
if entry[0].type <> 'view':
temp_credit+=entry[k].credit
temp_debit+=entry[k].debit
if self.flag==1:
self.result_total["sum_credit" + str(k)]=0.00
self.result_total["sum_debit" + str(k)]=0.00
if form['account_choice']=='bal_zero':
if temp_credit<>temp_debit:
self.result_total["sum_credit" + str(k)]+=temp_credit
self.result_total["sum_debit" + str(k)]+=temp_debit
else:
self.result_total["sum_credit" + str(k)]+=temp_credit
self.result_total["sum_debit" + str(k)]+=temp_debit
self.flag=2
if entry[0].child_id:
ids2 = [(x.code,x.id) for x in entry[0].child_id]
ids2.sort()
result_total_parent = self.linesForTotal(form, [x[1] for x in ids2], doneAccount, level+1)
return [self.result_total]
def lines(self, form, ids={}, done={}, level=1):
accounts=[]
if not ids:
ids = self.ids
if not ids:
return []
result = []
ctx = self.context.copy()
tmp1=[]
for id in form['fiscalyear']:
ctx['fiscalyear'] = id
ctx['periods'] = form['periods']
ctx['period_manner']=form['period_manner']
ctx['state'] = form['context'].get('state','all')
tmp1 = self.pool.get('account.account').browse(self.cr, self.uid, ids, ctx.copy())
if len(tmp1):
accounts.append(tmp1)
if level==1: #if parent is called,done is not empty when called again.
done={}
def cmp_code(x, y):
return cmp(x.code, y.code)
for n in range(0,len(accounts)):
accounts[n].sort(cmp_code)
common={}
merged_accounts=zip(*accounts)
for entry in merged_accounts:
j=0
checked=1
if form['account_choice']!='all': # if checked,include empty a/c;not otherwise
checked=0
if entry[0].id in done:
continue
done[entry[0].id] = 1
if entry[0].child_id: # this is for parent account,dont check 0 for it
checked=4
self.status=1 # for displaying it Bold
else:
self.status=0
if checked==0:
i=0
for i in range(0,len(entry)):
if bal_zero==0:
if entry[i].balance<>0.0:
checked=4
break
else:
checked=3
i=i+1
else:
if entry[i].credit <> 0.0 or entry[i].debit <> 0.0:
checked=4
break
else:
checked=3
i=i+1
if checked==3:
# this is the point where we skip those accounts which are encountered as empty ones
continue
self.empty_parent=0
else:
self.empty_parent=1
res = {
'code': entry[0].code,
'name': entry[0].name,
'level': level,
'status': self.status,
}
for j in range(0,len(entry)):
locale.setlocale(locale.LC_ALL, '')
res["debit"+str(j)]=locale.format("%.2f", entry[j].debit, grouping=True)
res["credit"+str(j)]=locale.format("%.2f", entry[j].credit, grouping=True)
res["balance"+str(j)]=locale.format("%.2f", entry[j].balance, grouping=True)
if j==0:
res["bal_cash"+str(j)]="0.00"
res["bal_perc"+str(j)]="0.00%"
else:
temp_cash=entry[j].balance - entry[j-1].balance
res["bal_cash"+str(j)]=locale.format("%.2f", temp_cash, grouping=True)
if entry[j-1].balance<>0.00:
temp_perc=(entry[j].balance - entry[j-1].balance )*100/entry[j-1].balance
else:
temp_perc=(entry[j].balance) *100
res["bal_perc"+str(j)]=locale.format("%.2f", temp_perc) + "%"
if ref_bal=='nothing':
if level==1:
self.parent_bal=1
else:
self.parent_bal=0
if self.parent_bal==1:
res["balance_perc"+str(j)]="/"
else:
if entry[j].balance==0.00:
if self.baldiv["baldiv"+str(level-1)+str(j)]<>0.00:
res["balance_perc"+str(j)]="0.00%"
else:
res["balance_perc"+str(j)]="/"
else:
if self.baldiv["baldiv"+str(level-1)+str(j)]<>0.00:
temp=self.baldiv["baldiv"+str(level-1)+str(j)]
temp1=(entry[j].balance * 100 )/ float(temp)
temp1=round(temp1,2)
res["balance_perc" + str(j)]=str(temp1)+"%"
else:
res["balance_perc"+str(j)]="/"
else:
res["balance_perc"+str(j)]=str( (entry[j].balance * 100 )/ float(ref_bal)) + "%"
result.append(res)
if entry[0].child_id:
for q in range(0,len(form['fiscalyear'])):
self.baldiv["baldiv"+str(level)+str(q)]=entry[q].balance
ids2 = [(x.code,x.id) for x in entry[0].child_id]
ids2.sort()
dir=[]
dir += self.lines(form, [x[1] for x in ids2], done, level+1)
if dir==[]:
for w in range(0,len(form['fiscalyear'])):
if entry[w].credit <> 0.0 or entry[w].debit <> 0.0 or entry[w].balance<>0.00:
dont_pop=1
break
else:
dont_pop=0
if dont_pop==1:
result +=dir
else:
result.pop(-1) # here we pop up the parent having its children as emprty accounts
else:
result +=dir
return result
def get_years(self, form):
result =[]
res={}
for temp in range(0,len(form['fiscalyear'])):
res={}
fy=self.pool.get('account.fiscalyear').name_get(self.cr, self.uid, form['fiscalyear'][temp])
res['year']=fy[0][1]
res['last_str']=temp
result.append(res)
self.linesForYear(form)
return result
def get_lines(self, year_dict, form):
final_result = []
line_l =[]
res = {}
line_l = self.lines(form)
self.cal_total(year_dict)
if line_l:
for l in line_l:
res = {}
res['code'] = l['code']
res['name'] = l['name']
res['level'] = l['level']
for k,v in l.items():
if k.startswith('debit'+str(year_dict['last_str'])):
res['debit'] = v
if k.startswith('credit'+str(year_dict['last_str'])):
res['credit'] = v
if k.startswith('balance'+str(year_dict['last_str'])) and not k.startswith('balance_perc'+str(year_dict['last_str'])):
res['balance'] =v
if k.startswith('balance_perc'+str(year_dict['last_str'])) and not k.startswith('balance'+str(year_dict['last_str'])):
res['balance_perc'] = v
if form['compare_pattern'] == 'bal_perc':
if k.startswith('bal_perc'+str(year_dict['last_str'])):
res['pattern'] = v
elif form['compare_pattern'] == 'bal_cash':
if k.startswith('bal_cash'+str(year_dict['last_str'])):
res['pattern'] = v
else:
res['pattern'] = ''
final_result.append(res)
return final_result
def cal_total(self, year_dict):
total_l = self.result_total
if total_l:
for k,v in total_l.items():
if k.startswith('sum_debit'+str(year_dict['last_str'])):
self.dr_total = v
elif k.startswith('sum_credit'+str(year_dict['last_str'])):
self.cr_total = v
else:
continue
return True
def total_dr(self):
return self.dr_total
def total_cr(self):
return self.cr_total
report_sxw.report_sxw('report.account.balance.account.balance', 'account.account', 'addons/account/report/account_balance.rml', parser=account_balance, header="internal")
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,287 +0,0 @@
<?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"/>
</pageTemplate>
</template>
<stylesheet>
<blockTableStyle id="Standard_Outline">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Table_Tiltle">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Table_header_account">
<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"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
<blockBackground colorName="#ffffff" start="0,0" stop="0,-1"/>
<blockBackground colorName="#ffffff" start="1,0" stop="1,-1"/>
<blockBackground colorName="#ffffff" start="2,0" stop="2,-1"/>
<blockBackground colorName="#ffffff" start="3,0" stop="3,-1"/>
<blockBackground colorName="#ffffff" start="4,0" stop="4,-1"/>
<blockBackground colorName="#ffffff" start="5,0" stop="5,-1"/>
</blockTableStyle>
<blockTableStyle id="Table1">
<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"/>
<blockBackground colorName="#ffffff" start="0,0" stop="0,-1"/>
<blockBackground colorName="#ffffff" start="1,0" stop="1,-1"/>
<blockBackground colorName="#ffffff" start="2,0" stop="2,-1"/>
<blockBackground colorName="#ffffff" start="3,0" stop="3,-1"/>
</blockTableStyle>
<blockTableStyle id="Table4">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,-1" stop="4,-1"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="5,-1" stop="5,-1"/>
</blockTableStyle>
<blockTableStyle id="Table2">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,-1" stop="4,-1"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="5,-1" stop="5,-1"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="6,-1" stop="6,-1"/>
</blockTableStyle>
<blockTableStyle id="Table6">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
</blockTableStyle>
<blockTableStyle id="Table5">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,-1" stop="4,-1"/>
</blockTableStyle>
<blockTableStyle id="Table3">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="0,0" stop="0,0"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-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="LINEABOVE" colorName="#000000" start="2,0" stop="2,0"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="3,0" stop="3,0"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="4,0" stop="4,0"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
<blockBackground colorName="#ffffff" start="0,0" stop="0,-1"/>
<blockBackground colorName="#ffffff" start="1,0" stop="1,-1"/>
<blockBackground colorName="#ffffff" start="2,0" stop="2,-1"/>
<blockBackground colorName="#ffffff" start="3,0" stop="3,-1"/>
<blockBackground colorName="#ffffff" start="4,0" stop="4,-1"/>
</blockTableStyle>
<initialize>
<paraStyle name="all" alignment="justify"/>
</initialize>
<paraStyle name="Standard" fontName="Helvetica"/>
<paraStyle name="Heading" fontName="Helvetica" fontSize="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Caption" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="Index" fontName="Helvetica"/>
<paraStyle name="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_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" 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_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.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_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_space" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<images/>
</stylesheet>
<story>
<para style="terp_default_8">[[ repeatIn(get_years(data['form']), 'y') ]]</para>
<blockTable colWidths="482.0" style="Table_Tiltle">
<tr>
<td>
<para style="terp_header_Centre">Account Balance - [[ company.currency_id.name ]]</para>
</td>
</tr>
</blockTable>
<para style="terp_header">Year : [[ y['year'] ]]</para>
<blockTable colWidths="57.0,214.0,54.0,46.0,57.0,52.0" style="Table_header_account">
<tr>
<td>
<para style="terp_tblheader_Details">[[ data['form']['show_columns'] and 'Code' or removeParentNode('blockTable') ]]</para>
</td>
<td>
<para style="terp_tblheader_Details">Account Name </para>
</td>
<td>
<para style="terp_tblheader_Details">[[ data['form']['compare_pattern']!='none' and 'C.S.Y.T.(C./P)' or removeParentNode('para') ]]</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Debit</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Credit</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Balance</para>
</td>
</tr>
</blockTable>
<blockTable colWidths="56.0,315.0,56.0,53.0" style="Table1">
<tr>
<td>
<para style="terp_tblheader_Details">[[ (data['form']['show_columns'] and removeParentNode('blockTable')) or 'Code' ]]</para>
</td>
<td>
<para style="terp_tblheader_Details">Account Name </para>
</td>
<td>
<para style="terp_tblheader_Details">[[ data['form']['compare_pattern']!='none' and 'C.S.Y.T.(C./P)' or removeParentNode('para') ]]</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Balance</para>
</td>
</tr>
</blockTable>
<section>
<para style="terp_default_8">[[ repeatIn(get_lines(y,data['form']), 'a') ]]</para>
<blockTable colWidths="56.0,208.0,58.0,49.0,55.0,54.0" style="Table4">
<tr>
<td>
<para style="terp_default_9">[[ (data['form']['format_perc'] or not data['form']['show_columns']) and removeParentNode('blockTable') ]] <font>[[ a['level']&lt;4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font')]]</font>[[ a['code'] ]]</para>
</td>
<td>
<para style="terp_default_9"><font face="Helvetica" color="white">[['...'*(a['level']-1) ]]</font> <font>[[ a['level']&lt;4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font')]]</font>[[ a['name'] ]]</para>
</td>
<td>
<para style="terp_default_9"><font>[[ a['level']&lt;4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font')]]</font>[[ a['pattern'] ]]</para>
</td>
<td>
<para style="terp_default_Right_9"><font>[[ a['level']&lt;4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font')]]</font>[[ a['debit'] ]]</para>
</td>
<td>
<para style="terp_default_Right_9"><font>[[ a['level']&lt;4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font')]]</font>[[ a['credit'] ]]</para>
</td>
<td>
<para style="terp_default_Right_9"><font>[[ a['level']&lt;4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font')]]</font>[[ a['balance'] ]]</para>
</td>
</tr>
</blockTable>
<blockTable colWidths="56.0,153.0,55.0,54.0,54.0,56.0,54.0" style="Table2">
<tr>
<td>
<para style="terp_default_9">[[ (not data['form']['format_perc'] or not data['form']['show_columns']) and removeParentNode('blockTable') ]] <font>[[ a['level']&lt;4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font')]]</font>[[ a['code'] ]]</para>
</td>
<td>
<para style="terp_default_9"><font face="Helvetica" color="white">[['...'*(a['level']-1) ]]</font> <font>[[ a['level']&lt;4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font')]]</font>[[ a['name'] ]]</para>
</td>
<td>
<para style="terp_default_9"><font>[[ a['level']&lt;4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font')]]</font>[[ a['pattern'] ]]</para>
</td>
<td>
<para style="terp_default_Right_9"><font>[[ a['level']&lt;4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font')]]</font>[[ a['debit'] ]]</para>
</td>
<td>
<para style="terp_default_Right_9"><font>[[ a['level']&lt;4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font')]]</font>[[ a['credit'] ]]</para>
</td>
<td>
<para style="terp_default_Right_9"><font>[[ a['level']&lt;4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font')]]</font>[[ a['balance'] ]]</para>
</td>
<td>
<para style="terp_default_Right_9"><font>[[ a['level']&lt;4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font')]]</font>[[ a['balance_perc'] ]]</para>
</td>
</tr>
</blockTable>
<blockTable colWidths="55.0,154.0,218.0,54.0" style="Table6">
<tr>
<td>
<para style="terp_default_9">[[ (data['form']['format_perc'] or data['form']['show_columns']) and removeParentNode('blockTable') ]] <font>[[ a['level']&lt;4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font')]]</font>[[ a['code'] ]]</para>
</td>
<td>
<para style="terp_default_9"><font face="Helvetica" color="white">[['...'*(a['level']-1) ]]</font> <font>[[ a['level']&lt;4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font')]]</font>[[ a['name'] ]]</para>
</td>
<td>
<para style="terp_default_9"><font>[[ a['level']&lt;4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font')]]</font>[[ a['pattern'] ]]</para>
</td>
<td>
<para style="terp_default_Right_9"><font>[[ a['level']&lt;4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font')]]</font>[[ a['balance'] ]]</para>
</td>
</tr>
</blockTable>
<blockTable colWidths="54.0,135.0,113.0,130.0,49.0" style="Table5">
<tr>
<td>
<para style="terp_default_9">[[ (not data['form']['format_perc'] or data['form']['show_columns']) and removeParentNode('blockTable') ]]<font>[[ a['level']&lt;4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font')]]</font> [[ a['code'] ]]</para>
</td>
<td>
<para style="terp_default_9"><font face="Helvetica" color="white">[['...'*(a['level']-1) ]]</font> <font>[[ a['level']&lt;4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font')]]</font>[[ a['name'] ]]</para>
</td>
<td>
<para style="terp_default_9"><font>[[ a['level']&lt;4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font')]]</font>[[ a['pattern'] ]]</para>
</td>
<td>
<para style="terp_default_Right_9"><font>[[ a['level']&lt;4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font')]]</font>[[ a['balance'] ]]</para>
</td>
<td>
<para style="terp_default_Right_9"><font>[[ a['level']&lt;4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font')]]</font>[[ a['balance_perc'] ]]</para>
</td>
</tr>
</blockTable>
<para style="terp_default_2">
<font color="white"> </font>
</para>
</section>
<blockTable colWidths="54.0,135.0,113.0,130.0,49.0" style="Table3">
<tr>
<td>
<para style="terp_default_9">[[ not data['form']['show_columns'] and removeParentNode('blockTable') ]] </para>
</td>
<td>
<para style="terp_tblheader_Details">Total :</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">[[ total_dr() ]]</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">[[ total_cr() ]]</para>
</td>
<td>
<para style="terp_default_Right_9">
<font color="white"> </font>
</para>
</td>
</tr>
</blockTable>
<para style="terp_default_space">
<font color="white"> </font>
</para>
<para style="terp_tblheader_Details">[[ data['form']['compare_pattern']!='none' and "C.S.Y.T.(C./P) : Compare Selected Years In Terms of Cash/Perc" or removeParentNode('font') ]]</para>
</story>
</document>

View File

@ -180,7 +180,7 @@
<blockTable colWidths="177.0,177.0,177.0" style="Table_General_Detail_Content">
<tr>
<td>
<para style="terp_default_Centre_9">[[ o.name or ' ' ]]<font color="white"> </font></para>
<para style="terp_default_Centre_9">[[ o.name or ' ' ]]</para>
</td>
<td>
<para style="terp_default_Centre_9">[[ formatLang(o.date_invoice,date=True) ]]</para>
@ -211,7 +211,7 @@
<para style="terp_tblheader_Details_Right">Disc.(%)</para>
</td>
<td>
<para style="terp_tblheader_Details_Centre">Price([[ o.currency_id.code ]])</para>
<para style="terp_tblheader_Details_Centre">Price</para>
</td>
</tr>
</blockTable>
@ -229,7 +229,7 @@
<para style="terp_default_Right_9">[[ formatLang(l.quantity)]] [[ (l.uos_id and l.uos_id.name) or '' ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(l.price_unit) ]]</para>
<para style="terp_default_Right_9">[[ formatLang(l.price_unit) ]][[ o.currency_id.symbol ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(l.discount) ]] </para>
@ -338,10 +338,10 @@
<para style="terp_default_8">[[ t.name ]]</para>
</td>
<td>
<para style="terp_default_Right_8">[[ formatLang(t.base) ]]</para>
<para style="terp_default_Right_8">[[ formatLang(t.base) ]] [[ o.currency_id.symbol ]]</para>
</td>
<td>
<para style="terp_default_Right_8">[[ (t.tax_code_id and t.tax_code_id.notprintable) and removeParentNode('blockTable') or '' ]] [[ formatLang(t.amount) ]]</para>
<para style="terp_default_Right_8">[[ (t.tax_code_id and t.tax_code_id.notprintable) and removeParentNode('blockTable') or '' ]] [[ formatLang(t.amount) ]] [[ o.currency_id.symbol ]]</para>
</td>
<td>
<para style="terp_default_8">

View File

@ -151,13 +151,13 @@
<para style="terp_tblheader_Details_Centre">Maturity date</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Due<font face="Helvetica" size="8.0">([[ company.currency_id.name ]])</font></para>
<para style="terp_tblheader_Details_Right">Due</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Paid<font face="Helvetica" size="8.0">([[ company.currency_id.name ]])</font></para>
<para style="terp_tblheader_Details_Right">Paid</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Maturity<font face="Helvetica" size="8.0">([[ company.currency_id.name ]])</font></para>
<para style="terp_tblheader_Details_Right">Maturity</para>
</td>
<td>
<para style="terp_tblheader_Details_Centre">Li.</para>
@ -181,10 +181,10 @@
<para style="terp_default_Centre_9">[[ line['date_maturity'] and formatLang(line['date_maturity'],date=True) or '' ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ (line['account_id']['type'] == 'receivable' and formatLang(line['debit']) or 0) or (line['account_id']['type'] == 'payable' and formatLang(line['credit'] * -1) or ' ') ]] [[ company.currency_id.symbol ]]</para>
<para style="terp_default_Right_9">[[ (line['account_id']['type'] == 'receivable' and formatLang(line['debit']) or 0) or (line['account_id']['type'] == 'payable' and formatLang(line['credit'] * -1) or ' ') ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ (line['account_id']['type'] == 'receivable' and formatLang(line['credit']) or 0) or (line['account_id']['type'] == 'payable' and formatLang(line['debit'] * -1) or 0) ]] [[ company.currency_id.symbol ]]</para>
<para style="terp_default_Right_9">[[ (line['account_id']['type'] == 'receivable' and formatLang(line['credit']) or 0) or (line['account_id']['type'] == 'payable' and formatLang(line['debit'] * -1) or 0) ]] </para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang((line['date_maturity'] &lt; time.strftime('%Y-%m-%d'))) and formatLang(line['debit'] - line['credit']) ]] [[ company.currency_id.symbol ]]</para>
@ -206,10 +206,10 @@
<para style="terp_default_Bold_9">Sub-Total : </para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang((reduce(lambda x, y: x + ((y['account_id']['type'] == 'receivable' and y['debit'] or 0) or (y['account_id']['type'] == 'payable' and y['credit'] * -1 or 0)), getLines(o), 0))) ]] [[ company.currency_id.symbol ]]</para>
<para style="terp_default_Right_9">[[ formatLang((reduce(lambda x, y: x + ((y['account_id']['type'] == 'receivable' and y['debit'] or 0) or (y['account_id']['type'] == 'payable' and y['credit'] * -1 or 0)), getLines(o), 0))) ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang((reduce(lambda x, y: x + ((y['account_id']['type'] == 'receivable' and y['credit'] or 0) or (y['account_id']['type'] == 'payable' and y['debit'] * -1 or 0)), getLines(o), 0))) ]] [[ company.currency_id.symbol ]] </para>
<para style="terp_default_Right_9">[[ formatLang((reduce(lambda x, y: x + ((y['account_id']['type'] == 'receivable' and y['credit'] or 0) or (y['account_id']['type'] == 'payable' and y['debit'] * -1 or 0)), getLines(o), 0))) ]] </para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang((reduce(lambda x, y: x + (y['debit'] - y['credit']), filter(lambda x: x['date_maturity'] &lt; time.strftime('%Y-%m-%d'), getLines(o)), 0))) ]] [[ company.currency_id.symbol ]]</para>

View File

@ -108,14 +108,14 @@
<blockTable colWidths="340.0,55.0,55.0,90.0" style="Table2" repeatRows="1">
<tr>
<td><para style="P12">Tax Name</para></td>
<td><para style="P12a">Debit<font size="7.0">([[ company.currency_id.code]])</font></para></td>
<td><para style="P12a">Credit<font size="7.0">([[ company.currency_id.code]])</font></para></td>
<td><para style="P12a">Tax Amount<font size="7.0">([[ company.currency_id.code]])</font></para></td>
<td><para style="P12a">Debit</para></td>
<td><para style="P12a">Credit</para></td>
<td><para style="P12a">Tax Amount</para></td>
</tr>
<tr>
<td><para style="P5"><font>[[ repeatIn(get_lines(data['form']['based_on'],data['form']['periods'],data['form']['company_id']), 'o') ]]</font><font color="white">[[ (o['level']) ]]</font> <font>[[ (len(o['level'])&lt;5 and setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]]</font><font>[[ o['code'] ]] [[ o['name'] ]] </font></para></td>
<td><para style="P6"><font>[[ len(o['level'])&lt;5 and setTag('para','para',{'fontName':"Helvetica-Bold"}) or removeParentNode('font')]]</font><font>[[ o['type']=='view' and removeParentNode('font') ]][[ formatLang(o['debit']) ]] [[ company.currency_id.symbol ]]</font><font>[[ o['type']&lt;&gt;'view' and removeParentNode('font') ]][[ formatLang(o['debit']) ]] [[ company.currency_id.symbol ]]</font></para></td>
<td><para style="P6"><font>[[ len(o['level'])&lt;5 and setTag('para','para',{'fontName':"Helvetica-Bold"}) or removeParentNode('font')]]</font><font>[[ o['type']=='view' and removeParentNode('font') ]][[ formatLang(o['credit']) ]] [[ company.currency_id.symbol ]]</font><font>[[ o['type']&lt;&gt;'view' and removeParentNode('font') ]][[ formatLang(o['credit'])]] [[ company.currency_id.symbol ]]</font></para></td>
<td><para style="P6"><font>[[ len(o['level'])&lt;5 and setTag('para','para',{'fontName':"Helvetica-Bold"}) or removeParentNode('font')]]</font><font>[[ o['type']=='view' and removeParentNode('font') ]][[ formatLang(o['debit']) ]]</font><font>[[ o['type']&lt;&gt;'view' and removeParentNode('font') ]][[ formatLang(o['debit']) ]]</font></para></td>
<td><para style="P6"><font>[[ len(o['level'])&lt;5 and setTag('para','para',{'fontName':"Helvetica-Bold"}) or removeParentNode('font')]]</font><font>[[ o['type']=='view' and removeParentNode('font') ]][[ formatLang(o['credit']) ]]</font><font>[[ o['type']&lt;&gt;'view' and removeParentNode('font') ]][[ formatLang(o['credit'])]]</font></para></td>
<td><para style="P6"><font>[[ len(o['level'])&lt;5 and setTag('para','para',{'fontName':"Helvetica-Bold"}) or removeParentNode('font')]]</font><font>[[ o['type']=='view' and removeParentNode('font') ]][[ formatLang(o['tax_amount']) ]] [[ company.currency_id.symbol ]]</font><font>[[ o['type']&lt;&gt;'view' and removeParentNode('font') ]][[ formatLang(o['tax_amount']) ]] [[ company.currency_id.symbol ]]</font> </para></td>
</tr>
</blockTable>

View File

@ -19,7 +19,7 @@
<record id="menu_finance_reporting" model="ir.ui.menu">
<field eval="[(6,0,[ref('group_account_manager')])]" name="groups_id"/>
<field eval="[(6,0,[ref('group_account_manager'), ref('analytic.group_analytic_accounting')])]" name="groups_id"/>
</record>
<record id="menu_finance_legal_statement" model="ir.ui.menu">
@ -35,7 +35,7 @@
</record>
<record id="menu_finance_charts" model="ir.ui.menu">
<field eval="[(6,0,[ref('group_account_user'), ref('group_account_manager')])]" name="groups_id"/>
<field eval="[(6,0,[ref('group_account_user'), ref('group_account_manager'), ref('analytic.group_analytic_accounting')])]" name="groups_id"/>
</record>
<record id="menu_eaction_account_moves_sale" model="ir.ui.menu">
@ -87,7 +87,7 @@
</record>
<record id="final_accounting_reports" model="ir.ui.menu">
<field eval="[(6,0,[ref('group_account_manager'),ref('base.group_system')])]" name="groups_id"/>
<field eval="[(6,0,[ref('group_account_manager'),ref('base.group_system'), ref('analytic.group_analytic_accounting')])]" name="groups_id"/>
</record>
<record id="menu_journals_report" model="ir.ui.menu">
@ -138,6 +138,22 @@
<field eval="[(6,0,[ref('group_account_manager')])]" name="groups_id"/>
</record>
<record id="menu_finance_generic_reporting" model="ir.ui.menu">
<field eval="[(6,0,[ref('analytic.group_analytic_accounting')])]" name="groups_id"/>
</record>
<record id="menu_finance_configuration" model="ir.ui.menu">
<field eval="[(6,0,[ref('analytic.group_analytic_accounting')])]" name="groups_id"/>
</record>
<record id="menu_finance_entries" model="ir.ui.menu">
<field eval="[(6,0,[ref('analytic.group_analytic_accounting')])]" name="groups_id"/>
</record>
<record id="menu_analytic_accounting" model="ir.ui.menu">
<field eval="[(6,0,[ref('analytic.group_analytic_accounting')])]" name="groups_id"/>
</record>
<record id="account_move_comp_rule" model="ir.rule">
<field name="name">Account Entry</field>
<field ref="model_account_move" name="model_id"/>

View File

@ -1,21 +1,21 @@
-
In order to test Generate Fiscalyear Opening Entries wizard of OpenERP I first create a fiscalyear "Fiscal Year 2011" to which the entries will move
In order to test Generate Fiscalyear Opening Entries wizard of OpenERP I first create a fiscalyear to which the entries will move
-
!record {model: account.fiscalyear, id: account_fiscalyear_fiscalyear0}:
code: FY2011
code: !eval "'FY%s'% (datetime.now().year+1)"
company_id: base.main_company
date_start: '2011-01-01'
date_stop: '2011-12-31'
name: Fiscal Year 2011
date_start: !eval "'%s-01-01' %(datetime.now().year+1)"
date_stop: !eval "'%s-12-31' %(datetime.now().year+1)"
name: !eval "'Fiscal Year %s' %(datetime.now().year+1)"
-
I create a period "Jan2011" for the new fiscalyear
I create a period for the month of january for the new fiscalyear
-
!record {model: account.period, id: account_period_jan11}:
company_id: base.main_company
date_start: '2011-01-01'
date_stop: '2011-12-31'
date_start: !eval "'%s-01-01'% (datetime.now().year+1)"
date_stop: !eval "'%s-12-31'% (datetime.now().year+1)"
fiscalyear_id: account_fiscalyear_fiscalyear0
name: Jan2011
name: !eval "'Jan%s' %(datetime.now().year+1)"
special: 1
-
@ -25,6 +25,7 @@
name: End of Year
code: NEW
type: situation
analytic_journal_id: sit
sequence_id: sequence_journal
default_debit_account_id: cash
default_credit_account_id: cash
@ -90,7 +91,4 @@
# self.action_open_window(cr, uid, [ref("account_move_journal_2")], {"lang": 'en_US',
# "active_model": "ir.ui.menu", "active_ids": [ref("account.menu_action_move_journal_line_form")],
# "tz": False, "active_id": ref("account.menu_action_move_journal_line_form"),
# })
# })

View File

@ -3,11 +3,11 @@
In order to check the Close a Fiscal Year wizard in OpenERP I first create a Fiscalyear
-
!record {model: account.fiscalyear, id: account_fiscalyear_fiscalyear0}:
code: FY2011
code: !eval "'FY%s'% (datetime.now().year+1)"
company_id: base.main_company
date_start: '2011-01-01'
date_stop: '2011-12-31'
name: Fiscal Year 2011
date_start: !eval "'%s-01-01' %(datetime.now().year+1)"
date_stop: !eval "'%s-12-31' %(datetime.now().year+1)"
name: !eval "'Fiscal Year %s' %(datetime.now().year+1)"
-
I create monthly Periods for this fiscalyear
-

View File

@ -93,27 +93,6 @@
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'account-aged_partner_balance.'+format), 'wb+').write(data)
-
Print the Compare Account Balance Report in Normal mode
-
!python {model: account.account}: |
import netsvc, tools, os, time
data_dict = {'model': 'account.account', 'form': {'id':ref('account.bal'),'chart_account_id':ref('account.chart0'),'select_account': False,'format_perc':0,'show_columns' :0, 'compare_pattern': 'none','account_choice': 'moves','landscape':0,'period_manner': 'actual','fiscalyear': [ref('account.data_fiscalyear')] ,'target_move': 'all','periods': [],'context':{'state':'all'}}}
(data, format) = netsvc.LocalService('report.account.balance.account.balance').create(cr, uid, [ref('account.bal'),ref('account.gpf')], data_dict, {'periods': []})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'account-compare-account_balance.'+format), 'wb+').write(data)
-
Print the Compare Account Balance Report in Landscape mode
-
!python {model: account.account}: |
import netsvc, tools, os, time
data_dict = {'model': 'account.account', 'form': {'id':ref('account.bal'),'chart_account_id':ref('account.chart0'),'select_account': False,'format_perc':0,'show_columns' :0, 'compare_pattern': 'none','account_choice': 'moves','landscape':1,'period_manner': 'actual','fiscalyear': [ref('account.data_fiscalyear')] ,'target_move': 'all','periods': [],'context':{'state':'all'}}}
(data, format) = netsvc.LocalService('report.account.account.balance.landscape').create(cr, uid, [ref('account.bal'),ref('account.gpf')], data_dict, {'periods': []})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'account-compare-account_balance-landscape.'+format), 'wb+').write(data)
-
Print the Account Balance Sheet in Horizontal mode
-

View File

@ -44,7 +44,6 @@ import account_fiscalyear_close_state
import account_vat
import account_open_closed_fiscalyear
import account_compare_account_balance_report
import account_invoice_state
import account_chart
import account_tax_chart
@ -56,8 +55,6 @@ import account_use_model
import account_state_open
import account_statement_from_invoice
import account_report_print_journal
import account_report_central_journal
import account_report_general_journal

View File

@ -30,8 +30,7 @@ class account_automatic_reconcile(osv.osv_memory):
_description = 'Automatic Reconcile'
_columns = {
'account_ids': fields.many2many('account.account', 'reconcile_account_rel', 'reconcile_id', 'account_id', 'Accounts to Reconcile', domain = [('reconcile','=',1)], \
help = 'If no account is specified, the reconciliation will be made using every accounts that can be reconcilied'),
'account_ids': fields.many2many('account.account', 'reconcile_account_rel', 'reconcile_id', 'account_id', 'Accounts to Reconcile', domain = [('reconcile','=',1)],),
'writeoff_acc_id': fields.many2one('account.account', 'Account'),
'journal_id': fields.many2one('account.journal', 'Journal'),
'period_id': fields.many2one('account.period', 'Period'),
@ -142,25 +141,25 @@ class account_automatic_reconcile(osv.osv_memory):
if context is None:
context = {}
form = self.read(cr, uid, ids, [])[0]
max_amount = form.get('max_amount', 0.0)
max_amount = form.get('max_amount', False) and form.get('max_amount') or 0.0
power = form['power']
allow_write_off = form['allow_write_off']
reconciled = unreconciled = 0
if not form['account_ids']:
raise osv.except_osv(_('UserError'), _('You must select accounts to reconcile'))
for account_id in form['account_ids']:
params = (account_id,)
if not allow_write_off:
query = "SELECT partner_id FROM account_move_line WHERE account_id=%s AND reconcile_id IS NULL \
AND state <> 'draft' GROUP BY partner_id \
HAVING ABS(SUM(debit-credit)) = %s AND count(*)>0"%(account_id, 0.0)
# HAVING ABS(SUM(debit-credit)) <> %s AND count(*)>0"%(account_id, 0.0)
# HAVING count(*)>0"%(account_id,)
query = """SELECT partner_id FROM account_move_line WHERE account_id=%s AND reconcile_id IS NULL
AND state <> 'draft' GROUP BY partner_id
HAVING ABS(SUM(debit-credit)) = 0.0 AND count(*)>0"""
else:
query = "SELECT partner_id FROM account_move_line WHERE account_id=%s AND reconcile_id IS NULL \
AND state <> 'draft' GROUP BY partner_id \
HAVING ABS(SUM(debit-credit)) < %s AND count(*)>0"%(account_id, max_amount or 0.0)
query = """SELECT partner_id FROM account_move_line WHERE account_id=%s AND reconcile_id IS NULL
AND state <> 'draft' GROUP BY partner_id
HAVING ABS(SUM(debit-credit)) < %s AND count(*)>0"""
params += (max_amount,)
# reconcile automatically all transactions from partners whose balance is 0
cr.execute(query)
cr.execute(query, params)
partner_ids = [id for (id,) in cr.fetchall()]
for partner_id in partner_ids:
cr.execute(
@ -176,65 +175,63 @@ class account_automatic_reconcile(osv.osv_memory):
reconciled += len(line_ids)
if allow_write_off:
move_line_obj.reconcile(cr, uid, line_ids, 'auto', form['writeoff_acc_id'], form['period_id'], form['journal_id'], context)
# move_line_obj.reconcile_partial(cr, uid, line_ids, 'manual', context={})
else:
move_line_obj.reconcile_partial(cr, uid, line_ids, 'manual', context={})
# move_line_obj.reconcile(cr, uid, line_ids, 'auto', form['writeoff_acc_id'], form['period_id'], form['journal_id'], context)
# get the list of partners who have more than one unreconciled transaction
cr.execute(
"SELECT partner_id " \
"FROM account_move_line " \
"WHERE account_id=%s " \
"AND reconcile_id IS NULL " \
"AND state <> 'draft' " \
"AND partner_id IS NOT NULL " \
"GROUP BY partner_id " \
"HAVING count(*)>1",
(account_id,))
partner_ids = [id for (id,) in cr.fetchall()]
#filter?
for partner_id in partner_ids:
# get the list of unreconciled 'debit transactions' for this partner
cr.execute(
"SELECT id, debit " \
"FROM account_move_line " \
"WHERE account_id=%s " \
"AND partner_id=%s " \
"AND reconcile_id IS NULL " \
"AND state <> 'draft' " \
"AND debit > 0",
(account_id, partner_id))
debits = cr.fetchall()
# get the list of partners who have more than one unreconciled transaction
cr.execute(
"SELECT partner_id " \
"FROM account_move_line " \
"WHERE account_id=%s " \
"AND reconcile_id IS NULL " \
"AND state <> 'draft' " \
"AND partner_id IS NOT NULL " \
"GROUP BY partner_id " \
"HAVING count(*)>1",
(account_id,))
partner_ids = [id for (id,) in cr.fetchall()]
#filter?
for partner_id in partner_ids:
# get the list of unreconciled 'debit transactions' for this partner
cr.execute(
"SELECT id, debit " \
"FROM account_move_line " \
"WHERE account_id=%s " \
"AND partner_id=%s " \
"AND reconcile_id IS NULL " \
"AND state <> 'draft' " \
"AND debit > 0",
(account_id, partner_id))
debits = cr.fetchall()
# get the list of unreconciled 'credit transactions' for this partner
cr.execute(
"SELECT id, credit " \
"FROM account_move_line " \
"WHERE account_id=%s " \
"AND partner_id=%s " \
"AND reconcile_id IS NULL " \
"AND state <> 'draft' " \
"AND credit > 0",
(account_id, partner_id))
credits = cr.fetchall()
# get the list of unreconciled 'credit transactions' for this partner
cr.execute(
"SELECT id, credit " \
"FROM account_move_line " \
"WHERE account_id=%s " \
"AND partner_id=%s " \
"AND reconcile_id IS NULL " \
"AND state <> 'draft' " \
"AND credit > 0",
(account_id, partner_id))
credits = cr.fetchall()
(rec, unrec) = self.do_reconcile(cr, uid, credits, debits, max_amount, power, form['writeoff_acc_id'], form['period_id'], form['journal_id'], context)
reconciled += rec
unreconciled += unrec
(rec, unrec) = self.do_reconcile(cr, uid, credits, debits, max_amount, power, form['writeoff_acc_id'], form['period_id'], form['journal_id'], context)
reconciled += rec
unreconciled += unrec
# add the number of transactions for partners who have only one
# unreconciled transactions to the unreconciled count
partner_filter = partner_ids and 'AND partner_id not in (%s)' % ','.join(map(str, filter(None, partner_ids))) or ''
cr.execute(
"SELECT count(*) " \
"FROM account_move_line " \
"WHERE account_id=%s " \
"AND reconcile_id IS NULL " \
"AND state <> 'draft' " + partner_filter,
(account_id,))
additional_unrec = cr.fetchone()[0]
unreconciled = unreconciled + additional_unrec
# add the number of transactions for partners who have only one
# unreconciled transactions to the unreconciled count
partner_filter = partner_ids and 'AND partner_id not in (%s)' % ','.join(map(str, filter(None, partner_ids))) or ''
cr.execute(
"SELECT count(*) " \
"FROM account_move_line " \
"WHERE account_id=%s " \
"AND reconcile_id IS NULL " \
"AND state <> 'draft' " + partner_filter,
(account_id,))
additional_unrec = cr.fetchone()[0]
unreconciled = unreconciled + additional_unrec
context.update({'reconciled': reconciled, 'unreconciled': unreconciled})
model_data_ids = obj_model.search(cr,uid,[('model','=','ir.ui.view'),('name','=','account_automatic_reconcile_view1')])
resource_id = obj_model.read(cr, uid, model_data_ids, fields=['res_id'])[0]['res_id']
@ -250,4 +247,4 @@ class account_automatic_reconcile(osv.osv_memory):
account_automatic_reconcile()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,135 +0,0 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import time
from osv import osv, fields
from tools.translate import _
class account_compare_account_balance_report(osv.osv_memory):
"""
This wizard will provide the account balance comparision report by fiscal years.
"""
_name = 'account.compare.account.balance.report'
_description = 'Account Balance Report'
_columns = {
'fiscalyear': fields.many2many('account.fiscalyear', 'account_fiscalyear_rel','account_id','fiscalyear_id','Fiscal year', help='Keep empty for all open fiscal year'),
'select_account': fields.many2one('account.account','Select Reference Account(for % comparision)',help='Keep empty for comparison to its parent'),
'account_choice': fields.selection([('all','All accounts'),
('bal_zero','With balance is not equal to 0'),
('moves','With movements')],'Show Accounts'),
'show_columns': fields.boolean('Show Debit/Credit Information'),
'landscape': fields.boolean('Show Report in Landscape Form'),
'format_perc': fields.boolean('Show Comparision in %'),
'compare_pattern': fields.selection([('bal_cash','Cash'),
('bal_perc','Percentage'),
('none','Don'+ "'" +'t Compare')],'Compare Selected Years In Terms Of'),
'period_manner': fields.selection([('actual','Financial Period'),('created','Creation Date')],'Entries Selection Based on'),
'periods': fields.many2many('account.period', 'period_account_balance_rel',
'report_id', 'period_id', 'Periods',
help='Keep empty for all open fiscal year'),
}
_defaults={
'compare_pattern': 'none',
'account_choice': 'moves',
'period_manner': 'actual',
}
def check(self, cr, uid, ids, context=None):
data={}
if context is None:
context = {}
data = {
'ids':context['active_ids'],
'form': self.read(cr, uid, ids, ['fiscalyear', 'select_account', 'account_choice', 'periods', 'show_columns', 'landscape', 'format_perc','compare_pattern','period_manner'])[0],
}
data['form']['context'] = context
if (len(data['form']['fiscalyear'])==0) or (len(data['form']['fiscalyear'])>1 and (data['form']['compare_pattern']!='none') and (data['form']['format_perc']==1) and (data['form']['show_columns']==1) and (data['form']['landscape']!=1)):
raise osv.except_osv(_('Warning !'), _('You have to select at least 1 Fiscal Year. \nYou may have selected the compare options with more than 1 year with credit/debit columns and % option.This can lead contents to be printed out of the paper.Please try again.'))
if ((len(data['form']['fiscalyear'])==3) and (data['form']['format_perc']!=1) and (data['form']['show_columns']!=1)):
if data['form']['landscape']==1:
return {
'type': 'ir.actions.report.xml',
'report_name': 'account.account.balance.landscape',
'datas': data,
}
else:
return {
'type': 'ir.actions.report.xml',
'report_name': 'account.balance.account.balance',
'datas': data,
}
if data['form']['format_perc']==1:
if len(data['form']['fiscalyear'])<=2:
if data['form']['landscape']==1:
return {
'type': 'ir.actions.report.xml',
'report_name': 'account.account.balance.landscape',
'datas': data,
}
else:
return {
'type': 'ir.actions.report.xml',
'report_name': 'account.balance.account.balance',
'datas': data,
}
else:
if len(data['form']['fiscalyear'])==3:
if data['form']['landscape']==1:
return {
'type': 'ir.actions.report.xml',
'report_name': 'account.account.balance.landscape',
'datas': data,
}
else:
raise osv.except_osv(_('Warning !'), _('You might have done following mistakes. Please correct them and try again. \n 1. You have selected more than 3 years in any case. \n 2. You have not selected Percentage option, but you have selected more than 2 years. \n You can select maximum 3 years. Please check again. \n 3. You have selected Percentage option with more than 2 years, but you have not selected landscape format. You have to select Landscape option. Please Check it.'))
else:
raise osv.except_osv(_('Warning !'), _('You might have done following mistakes. Please correct them and try again. \n 1. You have selected more than 3 years in any case. \n 2. You have not selected Percentage option, but you have selected more than 2 years. \n You can select maximum 3 years. Please check again. \n 3. You have selected Percentage option with more than 2 years, but you have not selected landscape format. You have to select Landscape option. Please Check it.'))
else:
if len(data['form']['fiscalyear'])>2:
if data['form']['landscape']==1:
return {
'type': 'ir.actions.report.xml',
'report_name': 'account.account.balance.landscape',
'datas': data,
}
else:
raise osv.except_osv(_('Warning !'), _('You might have done following mistakes. Please correct them and try again. \n 1. You have selected more than 3 years in any case. \n 2. You have not selected Percentage option, but you have selected more than 2 years. \n You can select maximum 3 years. Please check again. \n 3. You have selected Percentage option with more than 2 years, but you have not selected landscape format. You have to select Landscape option. Please Check it.'))
else:
if data['form']['landscape']==1:
return {
'type': 'ir.actions.report.xml',
'report_name': 'account.account.balance.landscape',
'datas': data,
}
else:
return {
'type': 'ir.actions.report.xml',
'report_name': 'account.balance.account.balance',
'datas': data,
}
account_compare_account_balance_report()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,47 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="account_compare_account_balance_report_view" model="ir.ui.view">
<field name="name">account.compare.account.balance.report.form</field>
<field name="model">account.compare.account.balance.report</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Customize Report">
<notebook tabpos="up">
<page string="Report Options">
<separator string="Select Fiscal Year(s)(Maximum Three Years)" colspan="4"/>
<label align="0.7" colspan="6" string="(If you do not select Fiscal year it will take all open fiscal years)"/>
<field name="fiscalyear" colspan="5" nolabel="1"/>
<field name="landscape" colspan="4"/>
<field name="show_columns" colspan="4"/>
<field name="format_perc" colspan="4"/>
<field name="select_account" colspan="4"/>
<field name="account_choice" colspan="4"/>
<field name="compare_pattern" colspan="4"/>
</page>
<page string="Select Period">
<field name="period_manner" colspan="4"/>
<separator string="Select Period(s)" colspan="4"/>
<field name="periods" colspan="4" nolabel="1"/>
</page>
</notebook>
<newline/>
<group colspan="4" col="6">
<label string ="" colspan="2"/>
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
<button name="check" string="Print" type="object" icon="gtk-print" default_focus="1"/>
</group>
</form>
</field>
</record>
<act_window name="Account balance-Compare Years"
res_model="account.compare.account.balance.report"
src_model="account.account"
view_mode="form"
target="new"
key2="client_print_multi"
id="action_view_account_compare_account_balance_report"/>
</data>
</openerp>

View File

@ -45,7 +45,7 @@ class account_invoice_refund(osv.osv_memory):
context = {}
journal = obj_journal.search(cr, uid, [('type', '=', 'sale_refund')])
if context.get('type', False):
if context['type'] == 'in_invoice':
if context['type'] in ('in_invoice', 'in_refund'):
journal = obj_journal.search(cr, uid, [('type', '=', 'purchase_refund')])
return journal and journal[0] or False
@ -55,6 +55,20 @@ class account_invoice_refund(osv.osv_memory):
'filter_refund': 'modify',
}
def fields_view_get(self, cr, uid, view_id=None, view_type=False, context=None, toolbar=False, submenu=False):
journal_obj = self.pool.get('account.journal')
res = super(account_invoice_refund,self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=submenu)
type = context.get('journal_type', 'sale_refund')
if type in ('sale', 'sale_refund'):
type = 'sale_refund'
else:
type = 'purchase_refund'
for field in res['fields']:
if field == 'journal_id':
journal_select = journal_obj._name_search(cr, uid, '', [('type', '=', type)], context=context, limit=None, name_get_uid=1)
res['fields'][field]['selection'] = journal_select
return res
def compute_refund(self, cr, uid, ids, mode='refund', context=None):
"""
@param cr: the current row, from the database cursor,

View File

@ -11,7 +11,7 @@
<separator string="Refund Invoice Options" colspan="4"/>
<group colspan="4" >
<field name="description"/>
<field name="journal_id"/>
<field name="journal_id" widget='selection'/>
<field name="date"/>
<field name="period"/>
<field name="filter_refund"/>

View File

@ -85,7 +85,19 @@ class account_move_line_reconcile(osv.osv_memory):
ids = self.pool.get('account.period').find(cr, uid, dt=date, context=context)
if len(ids):
period_id = ids[0]
context.update({'stop_reconcile': True})
#stop the reconciliation process by partner (manual reconciliation) only if there is nothing more to reconcile for this partner
if 'active_ids' in context and context['active_ids']:
tmp_ml_id = account_move_line_obj.browse(cr, uid, context['active_ids'], context)[0]
partner_id = tmp_ml_id.partner_id and tmp_ml_id.partner_id.id or False
debit_ml_ids = account_move_line_obj.search(cr, uid, [('partner_id', '=', partner_id), ('account_id.reconcile', '=', True), ('reconcile_id', '=', False), ('debit', '>', 0)], context=context)
credit_ml_ids = account_move_line_obj.search(cr, uid, [('partner_id', '=', partner_id), ('account_id.reconcile', '=', True), ('reconcile_id', '=', False), ('credit', '>', 0)], context=context)
for ml_id in context['active_ids']:
if ml_id in debit_ml_ids:
debit_ml_ids.remove(ml_id)
if ml_id in credit_ml_ids:
credit_ml_ids.remove(ml_id)
if not (len(debit_ml_ids) and len(credit_ml_ids)):
context.update({'stop_reconcile': True})
account_move_line_obj.reconcile(cr, uid, context['active_ids'], 'manual', account_id,
period_id, journal_id, context=context)
return {}

View File

@ -28,14 +28,18 @@ class account_partner_reconcile_process(osv.osv_memory):
_description = 'Reconcilation Process partner by partner'
def _get_to_reconcile(self, cr, uid, context=None):
cr.execute(
"SELECT l.partner_id " \
"FROM account_move_line AS l LEFT JOIN res_partner p ON (p.id = l.partner_id) " \
"WHERE l.reconcile_id IS NULL " \
"AND (%s > to_char(p.last_reconciliation_date, 'YYYY-MM-DD') " \
"OR p.last_reconciliation_date IS NULL ) " \
"AND l.state <> 'draft' " \
"GROUP BY l.partner_id ",(time.strftime('%Y-%m-%d'),)
cr.execute("""
SELECT p_id FROM (SELECT l.partner_id as p_id, SUM(l.debit) AS debit, SUM(l.credit) AS credit
FROM account_move_line AS l LEFT JOIN account_account a ON (l.account_id = a.id)
LEFT JOIN res_partner p ON (p.id = l.partner_id)
WHERE a.reconcile = 't'
AND l.reconcile_id IS NULL
AND (%s > to_char(p.last_reconciliation_date, 'YYYY-MM-DD') OR p.last_reconciliation_date IS NULL )
AND l.state <> 'draft'
GROUP BY l.partner_id) AS tmp
WHERE debit > 0
AND credit > 0
""",(time.strftime('%Y-%m-%d'),)
)
return len(map(lambda x: x[0], cr.fetchall())) - 1
@ -57,7 +61,7 @@ class account_partner_reconcile_process(osv.osv_memory):
return partner[0]
def data_get(self, cr, uid, to_reconcile, today_reconciled, context=None):
return {'progress': (100 / float(to_reconcile + today_reconciled)) * today_reconciled}
return {'progress': (100 / (float(to_reconcile + today_reconciled) or 1.0)) * today_reconciled}
def default_get(self, cr, uid, fields, context=None):
res = super(account_partner_reconcile_process, self).default_get(cr, uid, fields, context=context)

View File

@ -126,8 +126,8 @@ class account_analytic_account(osv.osv):
where account_analytic_line.account_id IN %s \
and account_analytic_line.invoice_id is not null \
GROUP BY account_analytic_line.account_id",(parent_ids,))
for account_id, sum in cr.fetchall():
res[account_id] = sum
for account_id, lid in cr.fetchall():
res[account_id][f] = lid
for account in accounts:
for child in account.child_ids:
if res[account.id][f] < res.get(child.id, {}).get(f, ''):
@ -141,8 +141,8 @@ class account_analytic_account(osv.osv):
where account_id IN %s \
and invoice_id is null \
GROUP BY account_analytic_line.account_id" ,(parent_ids,))
for account_id, sum in cr.fetchall():
res[account_id][f] = sum
for account_id, lwd in cr.fetchall():
res[account_id][f] = lwd
for account in accounts:
for child in account.child_ids:
if res[account.id][f] < res.get(child.id, {}).get(f, ''):
@ -160,8 +160,8 @@ class account_analytic_account(osv.osv):
and invoice_id is null \
AND to_invoice IS NOT NULL \
GROUP BY account_analytic_line.account_id;",(parent_ids,))
for account_id, sum in cr.fetchall():
res[account_id][f] = round(sum, dp)
for account_id, sua in cr.fetchall():
res[account_id][f] = round(sua, dp)
for account in accounts:
for child in account.child_ids:
if account.id != child.id:
@ -180,8 +180,8 @@ class account_analytic_account(osv.osv):
and account_analytic_journal.type='general' \
GROUP BY account_analytic_line.account_id",(parent_ids,))
ff = cr.fetchall()
for account_id, sum in ff:
res[account_id][f] = round(sum, dp)
for account_id, hq in ff:
res[account_id][f] = round(hq, dp)
for account in accounts:
for child in account.child_ids:
if account.id != child.id:

View File

@ -197,7 +197,7 @@
<para style="terp_tblheader_Details_Right">Quantity</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Amount([[ company.currency_id.code]]) </para>
<para style="terp_tblheader_Details_Right">Amount</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Percentage</para>
@ -245,7 +245,7 @@
<para style="terp_tblheader_Details_Right">Quantity</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Amount([[ company.currency_id.code]])</para>
<para style="terp_tblheader_Details_Right">Amount</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Percentage</para>

View File

@ -20,7 +20,7 @@
##############################################################################
import datetime
from osv import osv,fields
from osv import osv, fields
from tools.translate import _
def strToDate(dt):
@ -113,12 +113,14 @@ class crossovered_budget(osv.osv):
'date_from': fields.date('Start Date', required=True, states={'done':[('readonly',True)]}),
'date_to': fields.date('End Date', required=True, states={'done':[('readonly',True)]}),
'state' : fields.selection([('draft','Draft'),('confirm','Confirmed'),('validate','Validated'),('done','Done'),('cancel', 'Cancelled')], 'Status', select=True, required=True, readonly=True),
'crossovered_budget_line': fields.one2many('crossovered.budget.lines', 'crossovered_budget_id', 'Budget Lines', states={'done':[('readonly',True)]} ),
'crossovered_budget_line': fields.one2many('crossovered.budget.lines', 'crossovered_budget_id', 'Budget Lines', states={'done':[('readonly',True)]}),
'company_id': fields.many2one('res.company', 'Company', required=True),
}
_defaults = {
'state': 'draft',
'creating_user_id': lambda self,cr,uid,context: uid,
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.budget.post', context=c)
}
def budget_confirm(self, cr, uid, ids, *args):
@ -244,7 +246,9 @@ class crossovered_budget_lines(osv.osv):
'practical_amount':fields.function(_prac, method=True, string='Practical Amount', type='float', digits=(16,2)),
'theoritical_amount':fields.function(_theo, method=True, string='Theoritical Amount', type='float', digits=(16,2)),
'percentage':fields.function(_perc, method=True, string='Percentage', type='float'),
'company_id': fields.related('crossovered_budget_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True)
}
crossovered_budget_lines()
class account_analytic_account(osv.osv):
@ -257,5 +261,4 @@ class account_analytic_account(osv.osv):
account_analytic_account()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -21,7 +21,7 @@
<tree string="Budgetary Position">
<field name="code"/>
<field name="name"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
</tree>
</field>
</record>
@ -69,7 +69,7 @@
<form string="Budgetary Position">
<field name="name" select="1"/>
<field name="code" select="1"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
<notebook colspan="4">
<page string="Accounts">
<field name="account_ids" colspan="4" nolabel="1"/>
@ -122,6 +122,7 @@
<field name="validating_user_id" readonly="True" attrs="{'readonly':[('state','!=','draft')]}"/>
<field name="date_from" attrs="{'readonly':[('state','!=','draft')]}"/>
<field name="date_to" attrs="{'readonly':[('state','!=','draft')]}"/>
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
<field name="crossovered_budget_line" colspan="4" nolabel="1" attrs="{'readonly':[('state','!=','draft')]}">
<tree string="Budget Lines">
<field name="analytic_account_id" groups="base.group_extended"/>
@ -141,6 +142,7 @@
<field name="date_to"/>
<field name="paid_date" select="1"/>
<field name="planned_amount" select="1"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
</form>
</field>
<field name="state" select="1"/>
@ -166,6 +168,7 @@
<field name="code" colspan="1"/>
<field name="date_from"/>
<field name="date_to"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
<field name="creating_user_id"/>
<field name="state"/>
</tree>
@ -238,6 +241,7 @@
<field name="practical_amount" select="1"/>
<field name="theoritical_amount"/>
<field name="percentage"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
</form>
</field>
</record>

View File

@ -128,13 +128,13 @@
<para style="terp_tblheader_Details">Description</para>
</td>
<td>
<para style="terp_tblheader_Details_Centre">Theoretical Amount ([[ company.currency_id.code ]])</para>
<para style="terp_tblheader_Details_Centre">Theoretical Amount </para>
</td>
<td>
<para style="terp_tblheader_Details_Centre">Planned Amount([[ company.currency_id.code ]])</para>
<para style="terp_tblheader_Details_Centre">Planned Amount</para>
</td>
<td>
<para style="terp_tblheader_Details_Centre">Practical Amount([[ company.currency_id.code ]])</para>
<para style="terp_tblheader_Details_Centre">Practical Amount</para>
</td>
<td>
<para style="terp_tblheader_Details_Centre">Perc(%)</para>

View File

@ -127,13 +127,13 @@
<para style="terp_tblheader_Details">Description</para>
</td>
<td>
<para style="terp_tblheader_Details_Centre">Theoretical Amount([[ company.currency_id.code]])</para>
<para style="terp_tblheader_Details_Centre">Theoretical Amount</para>
</td>
<td>
<para style="terp_tblheader_Details_Centre">Planned Amount([[ company.currency_id.code]])</para>
<para style="terp_tblheader_Details_Centre">Planned Amount</para>
</td>
<td>
<para style="terp_tblheader_Details_Centre">Practical Amount([[ company.currency_id.code]])</para>
<para style="terp_tblheader_Details_Centre">Practical Amount</para>
</td>
<td>
<para style="terp_tblheader_Details_Centre">Perc(%)</para>
@ -165,7 +165,7 @@
<blockTable colWidths="185.0,82.0,80.0,81.0,60.0" style="Table5">
<tr>
<td>
<para style="terp_default_Bold_9"><font face="Helvetica">[[ repeatIn(funct_total(data['form']),'b') ]]</font><font face="Helvetica">Total ([[ company.currency_id.code]]) </font>:</para>
<para style="terp_default_Bold_9"><font face="Helvetica">[[ repeatIn(funct_total(data['form']),'b') ]]</font>Total:</para>
</td>
<td>
<para style="terp_default_Bold_right_9">[[ formatLang(b['tot_theo']) ]] [[ company.currency_id.symbol ]]</para>

View File

@ -1,10 +1,27 @@
<?xml version="1.0" encoding="utf-8"?><openerp><data noupdate="0">
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="0">
<record id="budget_post_comp_rule" model="ir.rule">
<field name="name">Budget post multi-company</field>
<field name="model_id" ref="model_account_budget_post"/>
<field eval="True" name="global"/>
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
</record>
<record id="budget_post_comp_rule" model="ir.rule">
<field name="name">Budget post multi-company</field>
<field name="model_id" ref="model_account_budget_post"/>
<field eval="True" name="global"/>
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
</record>
</data></openerp>
<record id="budget_comp_rule" model="ir.rule">
<field name="name">Budget multi-company</field>
<field name="model_id" ref="model_crossovered_budget"/>
<field eval="True" name="global"/>
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
</record>
<record id="budget_lines_comp_rule" model="ir.rule">
<field name="name">Budget lines multi-company</field>
<field name="model_id" ref="model_crossovered_budget_lines"/>
<field eval="True" name="global"/>
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
</record>
</data>
</openerp>

View File

@ -9,7 +9,7 @@
<field name="arch" type="xml">
<form string="Coda import">
<field name="name" />
<field name="journal_id" />
<field name="journal_id" widget="selection"/>
<field name="date" />
<field name="user_id" />
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
@ -30,8 +30,8 @@
<field name="model">account.coda</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Coda import">
<field name="journal_id" />
<tree string="Coda Import">
<field name="journal_id" widget="selection"/>
<field name="date" />
<field name="user_id" />
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
@ -46,25 +46,26 @@
<field name="arch" type="xml">
<search string="Search Coda">
<group col="10" colspan="4">
<field name="journal_id"/>
<field name="journal_id" widget='selection'/>
<field name="date"/>
<field name="user_id" default="uid"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
</group>
<newline/>
<group expand="0" string="Group By...">
<filter string="User" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
<separator orientation="vertical"/>
<filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/>
<filter string="Date" icon="terp-go-month" domain="[]" context="{'group_by':'date'}"/>
<separator orientation="vertical"/>
<filter string="User" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
<filter string="Company" icon="terp-personal" domain="[]" context="{'group_by':'company_id'}"/>
<filter string="Company" icon="terp-go-home" domain="[]" groups="base.group_multi_company" context="{'group_by':'company_id'}"/>
</group>
</search>
</field>
</record>
<record model="ir.actions.act_window" id="action_account_coda">
<field name="name">Statements</field>
<field name="name">Coda Logs</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">account.coda</field>
<field name="view_type">form</field>
@ -75,7 +76,7 @@
<menuitem name="Coda Import Logs" parent="account.menu_finance_bank_and_cash" id="menu_account_coda_statement" action="action_account_coda" groups="base.group_extended" sequence="32"/>
<menuitem name="Import Coda Statements" action="action_account_coda_import" parent="account.menu_account_coda"
<menuitem name="Import Coda Statements" action="action_account_coda_import" parent="account.menu_account_pp_statements"
id="menu_account_coda_import" sequence="20"/>
<act_window name="Coda File"

View File

@ -144,7 +144,7 @@
src_model=""
view="account_move_line_partner_tree"/>
<menuitem action="act_account_partner_account_move_all" id="menu_account_move_open_unreconcile" parent="account_followup.menu_action_followup_stat"/>
<!--<menuitem action="act_account_partner_account_move_all" id="menu_account_move_open_unreconcile" parent="account_followup.menu_action_followup_stat"/> -->
<act_window
domain="[('reconcile_id', '=', False), ('account_id.type','=','payable')]"
@ -154,7 +154,7 @@
src_model=""
view="account_move_line_partner_tree"/>
<menuitem action="act_account_partner_account_move_payable_all" id="menu_account_move_open_unreconcile_payable" parent="account_followup.menu_action_followup_stat"/>
<!-- <menuitem action="act_account_partner_account_move_payable_all" id="menu_account_move_open_unreconcile_payable" parent="account_followup.menu_action_followup_stat"/> -->
<record model="ir.ui.view" id="view_company_inherit_followup_form">
<field name="name">res.company.followup.form.inherit</field>

View File

@ -1,27 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_account_followup_stat_form" model="ir.ui.view">
<field name="name">account_followup.stat.form</field>
<field name="model">account_followup.stat</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Follow-Up lines">
<field name="name" select="1"/>
<field name="account_type"/>
<field name="date_move" select="1"/>
<field name="date_move_last" select="1"/>
<field name="date_followup"/>
<field name="followup_id"/>
<field name="balance"/>
<field name="debit"/>
<field name="credit"/>
</form>
</field>
</record>
<record id="view_account_followup_stat_tree" model="ir.ui.view">
<field name="name">account_followup.stat.tree</field>
<field name="model">account_followup.stat</field>
@ -29,27 +9,38 @@
<field name="arch" type="xml">
<tree string="Follow-Up lines">
<field name="name"/>
<field name="account_type"/>
<field name="date_move"/>
<field name="date_move_last"/>
<field name="date_followup"/>
<field name="followup_id"/>
<field name="balance"/>
<field name="balance" sum="Balance"/>
<field name="debit"/>
<field name="credit"/>
</tree>
</field>
</record>
<record id="view_account_followup_stat_graph" model="ir.ui.view">
<field name="name">account_followup.stat.graph</field>
<field name="model">account_followup.stat</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Follow-Up lines" type="bar">
<field name="name"/>
<field name="balance" operator="+"/>
</graph>
</field>
</record>
<record id="action_followup_stat" model="ir.actions.act_window">
<field name="name">Latest Reminders</field>
<field name="name">Follow-ups Sent</field>
<field name="res_model">account_followup.stat</field>
<field name="view_type">form</field>
<field name="view_mode">tree,graph</field>
</record>
<menuitem name="Partners Follow-Ups" id="menu_action_followup_stat" parent="account.menu_finance_generic_reporting"/>
<!-- <menuitem name="Partners Follow-Ups" id="menu_action_followup_stat" parent="account.menu_finance_generic_reporting"/> -->
<menuitem action="action_followup_stat" id="menu_action_followup_stat_follow" parent="menu_action_followup_stat"/>
<menuitem action="action_followup_stat" id="menu_action_followup_stat_follow" parent="account.next_id_22"/>
</data>
</openerp>

View File

@ -142,13 +142,13 @@
<para style="terp_tblheader_Details_Right">Currency</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Due<font face="Helvetica" size="8.0">([[ company.currency_id.code ]])</font></para>
<para style="terp_tblheader_Details_Right">Due</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Paid<font face="Helvetica" size="8.0">([[ company.currency_id.code ]])</font></para>
<para style="terp_tblheader_Details_Right">Paid</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Maturity<font face="Helvetica" size="8.0">([[ company.currency_id.code ]])</font></para>
<para style="terp_tblheader_Details_Right">Maturity</para>
</td>
<td>
<para style="terp_tblheader_Details_Centre">Li.</para>
@ -175,10 +175,10 @@
<para style="terp_default_Right_9">[[ formatLang(line['amount_currency'] )]] [[ line['amount_currency'] and line['currency_id'][1] or '' ]] </para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(line['debit']) ]] [[ company.currency_id.symbol ]] </para>
<para style="terp_default_Right_9">[[ formatLang(line['debit']) ]] </para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(line['credit']) ]] [[ company.currency_id.symbol ]] </para>
<para style="terp_default_Right_9">[[ formatLang(line['credit']) ]] </para>
</td>
<td>
<para style="terp_default_Right_9">[[ (line['date_maturity'] &lt; time.strftime('%Y-%m-%d')) and formatLang(line['debit'] -line['credit']) or formatLang(0.0) ]] [[ company.currency_id.symbol ]]</para>
@ -197,13 +197,13 @@
</para>
</td>
<td>
<para style="terp_tblheader_Details">Sub-Total<font face="Helvetica" size="8.0">([[ company.currency_id.code ]])</font>: </para>
<para style="terp_tblheader_Details">Sub-Total: </para>
</td>
<td>
<para style="terp_default_Right_9">[[formatLang(reduce(lambda x,y: x+y['debit'], getLines(o), 0.00)) ]] [[ company.currency_id.symbol ]] </para>
<para style="terp_default_Right_9">[[formatLang(reduce(lambda x,y: x+y['debit'], getLines(o), 0.00)) ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[formatLang(reduce(lambda x,y: x+y['credit'], getLines(o), 0.00)) ]] [[ company.currency_id.symbol ]] </para>
<para style="terp_default_Right_9">[[formatLang(reduce(lambda x,y: x+y['credit'], getLines(o), 0.00)) ]]/para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(reduce(lambda x,y: x+(y['debit'] - y['credit']), filter(lambda x: x['date_maturity'] &lt; time.strftime('%Y-%m-%d'), getLines(o)), 0)) ]] [[ company.currency_id.symbol ]]</para>
@ -221,7 +221,7 @@
</para>
</td>
<td>
<para style="terp_tblheader_Details">Balance<font face="Helvetica" size="8.0">([[ company.currency_id.code ]])</font>: </para>
<para style="terp_tblheader_Details">Balance: </para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang((reduce(lambda x,y: x+(y['debit'] - y['credit']), getLines(o), 0.00))) ]] [[ company.currency_id.symbol]] </para>

View File

@ -116,6 +116,7 @@ class account_followup_print_all(osv.osv_memory):
"AND (l.state<>'draft') "\
"AND (l.partner_id is NOT NULL) "\
"AND (a.active) "\
"AND (l.debit > 0) "\
"ORDER BY l.date")
move_lines = cr.fetchall()
old = None
@ -294,4 +295,4 @@ class account_followup_print_all(osv.osv_memory):
account_followup_print_all()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -260,7 +260,7 @@
<para style="terp_tblheader_Details_Right">Disc. (%)</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Price([[ o.currency_id.code ]])</para>
<para style="terp_tblheader_Details_Right">Price</para>
</td>
</tr>
</blockTable>
@ -360,7 +360,7 @@
<para style="terp_tblheader_Details_Right">Disc. (%)</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Price([[ o.currency_id.code ]])</para>
<para style="terp_tblheader_Details_Right">Price</para>
</td>
</tr>
</blockTable>

View File

@ -264,7 +264,7 @@
<para style="terp_tblheader_Details_Right">Disc. (%)</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Price([[ o.currency_id.code ]])</para>
<para style="terp_tblheader_Details_Right">Price</para>
</td>
</tr>
</blockTable>
@ -364,7 +364,7 @@
<para style="terp_tblheader_Details_Right">Disc. (%)</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Price([[ o.currency_id.code ]])</para>
<para style="terp_tblheader_Details_Right">Price</para>
</td>
</tr>
</blockTable>

View File

@ -268,6 +268,18 @@ class payment_line(osv.osv):
else:
return self.pool.get('res.currency').search(cr, uid, [('rate','=',1.0)])[0]
def _get_date(self, cr, uid, context=None):
if context is None:
context = {}
date = False
if context.get('order_id') and context['order_id']:
order = self.pool.get('payment.order').browse(cr, uid, context['order_id'], context)
if order.date_prefered == 'fixed':
date = order.date_scheduled
else:
date = time.strftime('%Y-%m-%d')
return date
def _get_ml_inv_ref(self, cr, uid, ids, *a):
res={}
for id in self.browse(cr, uid, ids):
@ -328,6 +340,7 @@ class payment_line(osv.osv):
'state': lambda *args: 'normal',
'currency': _get_currency,
'company_currency': _get_currency,
'date': _get_date,
}
_sql_constraints = [
('name_uniq', 'UNIQUE(name)', 'The payment line name must be unique!'),

View File

@ -5,7 +5,7 @@
<field name="name">Reserve Bank</field>
<field name="acc_number">00987654321</field>
<field name="partner_id" ref="base.res_partner_agrolait"></field>
<field name="state" eval="bank"/>
<field name="state">bank</field>
</record>
<record id="payment_mode_1" model="payment.mode">
<field name="name">Direct Payment</field>

View File

@ -38,7 +38,7 @@
</field>
</record>
<menuitem id="menu_main" name="Payment" parent="account.menu_finance" sequence="6"/>
<menuitem id="menu_main_payment" name="Payment" parent="account.menu_finance" sequence="6"/>
<record id="view_payment_mode_tree" model="ir.ui.view">
<field name="name">payment.mode.tree</field>
@ -88,7 +88,7 @@
<field name="date_scheduled" select="1" attrs="{'readonly':[('date_prefered','!=','fixed')]}" />
<button colspan="2" name="%(action_create_payment_order)d" string="Select Invoices to Pay" type="action" attrs="{'invisible':[('state','=','done')]}" icon="gtk-find"/>
</group>
<field name="line_ids" colspan="4" widget="one2many_list" nolabel="1">
<field name="line_ids" colspan="4" widget="one2many_list" nolabel="1" default_get="{'order_id': active_id}" >
<form string="Payment Line">
<notebook>
<page string="Payment">
@ -203,7 +203,7 @@
<field name="search_view_id" ref="view_payment_order_search"/>
</record>
<menuitem action="action_payment_order_tree" id="menu_action_payment_order_form" parent="account_payment.menu_main" sequence="3"/>
<menuitem action="action_payment_order_tree" id="menu_action_payment_order_form" parent="menu_main_payment" sequence="3"/>
<record id="action_payment_order_tree_new" model="ir.actions.act_window">
<field name="name">New Payment Order</field>

View File

@ -207,7 +207,7 @@
<para style="terp_tblheader_Details_Centre">Value Date</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Amount([[ get_company_currency() ]])</para>
<para style="terp_tblheader_Details_Right">Amount</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Currency</para>
@ -250,7 +250,7 @@
</para>
</td>
<td>
<para style="terp_default_Bold_9">Total:([[ get_company_currency() ]])</para>
<para style="terp_default_Bold_9">Total:</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(get_amount_total(o)) or '' ]] [[get_company_currency_symbol()]] </para>

View File

@ -174,7 +174,7 @@
<para style="P12a">Account Name</para>
</td>
<td>
<para style="P12b">Balance([[company.currency_id.code]])</para>
<para style="P12b">Balance</para>
</td>
</tr>
<tr>

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@ -15,10 +15,12 @@
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import voucher
import report
import wizard
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -42,6 +42,7 @@
"voucher_workflow.xml",
"voucher_report.xml",
"wizard/account_voucher_unreconcile_view.xml",
"wizard/account_statement_from_invoice_view.xml",
"voucher_view.xml",
"voucher_payment_receipt_view.xml",
"voucher_sales_purchase_view.xml",
@ -50,8 +51,8 @@
],
"test" : [
# "test/account_voucher.yml",
# "test/sales_receipt.yml",
# "test/sales_payment.yml",
"test/sales_receipt.yml",
"test/sales_payment.yml",
"test/account_voucher_report.yml"
],
'certificate': '0037580727101',

View File

@ -1,24 +1,5 @@
-
In order to test account voucher i will create an invoice and pay it through account voucher.
-
I create a new Partner
-
!record {model: res.partner, id: res_partner_micropc0}:
address:
- country_id: base.be
name: Jenifer
street: 69 rue de Chimay
type: default
zip: '5478'
category_id:
- base.res_partner_category_8
credit_limit: 0.0
name: Micro PC
property_account_payable: account.a_pay
property_account_receivable: account.a_recv
-
Create an invoice for the partner
Create an invoice for the partner Seagate with amount 450.0
-
!record {model: account.invoice, id: account_invoice_0}:
account_id: account.a_recv
@ -34,7 +15,7 @@
product_id: product.product_product_pc1
uos_id: product.product_uom_unit
journal_id: account.sales_journal
partner_id: res_partner_micropc0
partner_id: base.res_partner_seagate
-
I check that the customer invoice is in draft state
@ -55,20 +36,20 @@
assert(acc_id.move_id)
-
I will create and post an account voucher for the partner.
I will create and post an account voucher of amount 450.0 for the partner Seagate.
-
!python {model: account.voucher}: |
import netsvc
vals = {}
journal_id = self.default_get(cr, uid, ['journal_id']).get('journal_id',None)
res = self.onchange_partner_id(cr, uid, [], ref("res_partner_micropc0"), journal_id, price=0.0, ttype='receipt')
res = self.onchange_partner_id(cr, uid, [], ref("base.res_partner_seagate"), journal_id, 0.0, 1, ttype='receipt')
vals = {
'account_id': ref('account.cash'),
'amount': 450.0,
'company_id': ref('base.main_company'),
'currency_id': ref('base.EUR'),
'journal_id': ref('account.bank_journal'),
'partner_id': ref('res_partner_micropc0'),
'partner_id': ref('base.res_partner_seagate'),
'period_id': ref('account.period_8'),
'type': 'receipt',
}

View File

@ -1,74 +1,91 @@
-
In order to test sales receipt i will create a sale receipt and pay it through sales payment
-
First of all I create a voucher
-
!record {model: account.voucher, id: account_voucher_chinaexport_0}:
-
Creating a Voucher Receipt for partner Seagate with amount 30000.0
-
!record {model: account.voucher, id: account_voucher_seagate_0}:
account_id: account.a_recv
amount: 30000.0
amount: 0.0
company_id: base.main_company
currency_id: base.EUR
journal_id: account.sales_journal
line_cr_ids:
- account_id: account.a_sale
amount: 30000.0
partner_id: base.res_partner_3
period_id: account.period_8
type: cr
partner_id: base.res_partner_seagate
period_id: account.period_9
tax_amount: 0.0
type: sale
-
I check that the voucher state is Draft
-
!assert {model: account.voucher, id: account_voucher_chinaexport_0}:
!assert {model: account.voucher, id: account_voucher_seagate_0}:
- state == 'draft'
-
I clicked on post button to post the voucher
I click on post button to post the voucher
-
!workflow {model: account.voucher, action: proforma_voucher, ref: account_voucher_chinaexport_0}
!workflow {model: account.voucher, action: proforma_voucher, ref: account_voucher_seagate_0}
-
Check the voucher state is Posted
Check that the voucher state is Posted
-
!assert {model: account.voucher, id: account_voucher_chinaexport_0}:
!assert {model: account.voucher, id: account_voucher_seagate_0}:
- state == 'posted'
-
I check that move lines are validated but not reconciled
-
!python {model: account.voucher}: |
reconciled = False
for l in self.browse(cr, uid, [ref("account_voucher_seagate_0")])[0].move_ids:
if l.reconcile_id:
reconciled = True
break
if not reconciled:
print "Info: Voucher is not paid"
else:
print "Info: Voucher is paid"
-
I create a voucher record for the same partner
I create and post a voucher payment of amount 30000.0 for the partner Seagate
-
!record {model: account.voucher, id: account_voucher_chinaexport_1}:
account_id: account.cash
amount: 30000.0
company_id: base.main_company
currency_id: base.EUR
journal_id: account.bank_journal
line_cr_ids:
- account_id: account.a_recv
amount: 0.0
name: 2010/003
type: cr
- account_id: account.a_recv
amount: 30000.0
name: 2010/003
type: cr
partner_id: base.res_partner_3
period_id: account.period_8
type: receipt
!python {model: account.voucher}: |
import netsvc
vals = {}
journal_id = self.default_get(cr, uid, ['journal_id']).get('journal_id',None)
res = self.onchange_partner_id(cr, uid, [], ref("base.res_partner_seagate"), journal_id, 0.0, 1, ttype='receipt')
vals = {
'account_id': ref('account.cash'),
'amount': 30000.0,
'company_id': ref('base.main_company'),
'currency_id': ref('base.EUR'),
'journal_id': ref('account.bank_journal'),
'partner_id': ref('base.res_partner_seagate'),
'period_id': ref('account.period_8'),
'type': 'receipt',
}
if not res['value']['line_cr_ids']:
res['value']['line_cr_ids'] = [{'type': 'cr', 'account_id': ref('account.a_recv'),}]
res['value']['line_cr_ids'][0]['amount'] = 30000.0
vals['line_cr_ids'] = [(0,0,i) for i in res['value']['line_cr_ids']]
id = self.create(cr, uid, vals)
voucher_id = self.browse(cr, uid, id)
assert (voucher_id.state=='draft'), "Voucher is not in draft state"
wf_service = netsvc.LocalService("workflow")
wf_service.trg_validate(uid, 'account.voucher', voucher_id.id, 'proforma_voucher', cr)
-
Check the voucher state is draft
I check that move lines are reconciled meaning voucher is paid
-
!assert {model: account.voucher, id: account_voucher_chinaexport_1}:
- state == 'draft'
-
I clicked on Post button to post the voucher
-
!workflow {model: account.voucher, action: proforma_voucher, ref: account_voucher_chinaexport_1}
-
Check the voucher state is Posted
-
!assert {model: account.voucher, id: account_voucher_chinaexport_1}:
- state == 'posted'
!python {model: account.voucher}: |
reconciled = False
for l in self.browse(cr, uid, [ref("account_voucher_seagate_0")])[0].move_ids:
if l.reconcile_id:
reconciled = True
break
if not reconciled:
print "Info: Voucher is not paid"
else:
print "Info: Voucher is paid"

View File

@ -20,6 +20,8 @@
##############################################################################
import time
from lxml import etree
import netsvc
from osv import fields
from osv import osv
@ -61,6 +63,8 @@ class account_voucher(osv.osv):
return context.get('search_default_journal_id')
ttype = context.get('type', 'bank')
if ttype in ('payment', 'receipt'):
ttype = 'bank'
res = journal_pool.search(cr, uid, [('type', '=', ttype)], limit=1)
return res and res[0] or False
@ -92,21 +96,35 @@ class account_voucher(osv.osv):
if journal.currency:
currency_id = journal.currency.id
return False
def _get_partner(self, cr, uid, context={}):
return context.get('partner_id', False)
def _get_reference(self, cr, uid, context={}):
return context.get('reference', False)
def _get_narration(self, cr, uid, context={}):
return context.get('narration', False)
def name_get(self, cr, uid, ids, context=None):
if not len(ids):
return []
return [(r['id'], (str(r['amount']) or '')) for r in self.read(cr, uid, ids, ['amount'], context, load='_classic_write')]
def fields_view_get(self, cr, uid, view_id=None, view_type=False, context=None, toolbar=False, submenu=False):
res = super(account_voucher,self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=submenu)
doc = etree.XML(res['arch'])
nodes = doc.xpath("//field[@name='partner_id']")
if context.get('type', 'sale') in ('purchase', 'payment'):
for node in nodes:
node.set('domain', "[('supplier', '=', True)]")
res['arch'] = etree.tostring(doc)
return res
_name = 'account.voucher'
_description = 'Accounting Voucher'
_order = "date desc, id desc"
_rec_name = 'number'
# _rec_name = 'number'
_columns = {
'type':fields.selection([
('sale','Sale'),
@ -141,7 +159,7 @@ class account_voucher(osv.osv):
'amount': fields.float('Total', digits=(16, 2), required=True, readonly=True, states={'draft':[('readonly',False)]}),
'tax_amount':fields.float('Tax Amount', digits=(14,2), readonly=True, states={'draft':[('readonly',False)]}),
'reference': fields.char('Ref #', size=64, readonly=True, states={'draft':[('readonly',False)]}, help="Transaction reference number."),
'number': fields.related('move_id', 'name', type="char", readonly=True, string='Number'),
'number': fields.char('Number', size=32, readonly=True,),
'move_id':fields.many2one('account.move', 'Account Entry'),
'move_ids': fields.related('move_id','line_id', type='one2many', relation='account.move.line', string='Journal Items', readonly=True),
'partner_id':fields.many2one('res.partner', 'Partner', change_default=1, readonly=True, states={'draft':[('readonly',False)]}),
@ -162,10 +180,10 @@ class account_voucher(osv.osv):
'reference': _get_reference,
'narration':_get_narration,
'type':_get_type,
'state': lambda *a: 'draft',
'pay_now':lambda *a: 'pay_later',
'name': lambda *a: '',
'date' : lambda *a: time.strftime('%Y-%m-%d'),
'state': 'draft',
'pay_now': 'pay_later',
'name': '',
'date' : time.strftime('%Y-%m-%d'),
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.voucher',context=c),
'tax_id': _get_tax,
}
@ -529,7 +547,7 @@ class account_voucher(osv.osv):
return {'value':res}
def action_move_line_create(self, cr, uid, ids, context=None):
def _get_payment_term_lines(term_id, amount):
term_pool = self.pool.get('account.payment.term')
if term_id and amount:
@ -546,9 +564,8 @@ class account_voucher(osv.osv):
for inv in self.browse(cr, uid, ids):
if inv.move_id:
continue
if 'force_name' in context and context['force_name']:
name = context['force_name']
if inv.number:
name = inv.number
elif inv.journal_id.sequence_id:
name = self.pool.get('ir.sequence').get_id(cr, uid, inv.journal_id.sequence_id.id)
else:
@ -648,7 +665,7 @@ class account_voucher(osv.osv):
if line.move_line_id.id:
rec_ids = [master_line, line.move_line_id.id]
rec_list_ids.append(rec_ids)
if not self.pool.get('res.currency').is_zero(cr, uid, inv.currency_id, line_total):
diff = line_total
move_line = {
@ -671,7 +688,8 @@ class account_voucher(osv.osv):
self.write(cr, uid, [inv.id], {
'move_id': move_id,
'state':'posted'
'state': 'posted',
'number': name,
})
move_pool.post(cr, uid, [move_id], context={})
for rec_ids in rec_list_ids:
@ -819,10 +837,9 @@ class account_bank_statement(osv.osv):
def create_move_from_st_line(self, cr, uid, st_line_id, company_currency_id, next_number, context=None):
st_line = self.pool.get('account.bank.statement.line').browse(cr, uid, st_line_id, context=context)
if st_line.voucher_id:
res = self.pool.get('account.voucher').proforma_voucher(cr, uid, [st_line.voucher_id.id], context={'force_name': next_number})
#force refresh of the cache
#st_line = self.pool.get('account.bank.statement.line').browse(cr, uid, st_line.id, context=context)
self.pool.get('account.voucher').write(cr, uid, [st_line.voucher_id.id], {'number': next_number}, context=context)
wf_service = netsvc.LocalService("workflow")
wf_service.trg_validate(uid, 'account.voucher', st_line.voucher_id.id, 'proforma_voucher', cr)
return self.pool.get('account.move.line').write(cr, uid, [x.id for x in st_line.voucher_id.move_ids], {'statement_id': st_line.statement_id.id}, context=context)
return super(account_bank_statement, self).create_move_from_st_line(cr, uid, st_line, company_currency_id, next_number, context=context)
@ -856,4 +873,12 @@ class account_bank_statement_line(osv.osv):
}
def unlink(self, cr, uid, ids, context=None):
statement_line = self.browse(cr, uid, ids, context)
unlink_ids = []
for st_line in statement_line:
unlink_ids.append(st_line.voucher_id.id)
self.pool.get('account.voucher').unlink(cr, uid, unlink_ids, context=context)
return super(account_bank_statement_line, self).unlink(cr, uid, ids, context=context)
account_bank_statement_line()

View File

@ -23,13 +23,6 @@
<field name="journal_id" widget="selection" context="{'journal_id': self, 'set_visible':False}" domain="[('type','in',('bank','cash'))]"/>
<field name="period_id" groups="base.group_extended"/>
</group>
<newline/>
<group expand="0" string="Extended options..." col='8' colspan='4'>
<field name="reference"/>
<field name="name"/>
<field name="narration"/>
<field name="amount"/>
</group>
<newline/>
<group expand="0" string="Group By..." colspan="4" col="10">
<filter string="Customer" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
@ -37,6 +30,13 @@
<filter string="Period" icon="terp-go-month" domain="[]" context="{'group_by':'period_id','visible':True}"/>
<filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
</group>
<newline/>
<group expand="0" string="Extended options..." col='8' colspan='4'>
<field name="reference"/>
<field name="name"/>
<field name="narration"/>
<field name="amount"/>
</group>
</search>
</field>
</record>
@ -63,13 +63,6 @@
<field name="journal_id" widget="selection" context="{'journal_id': self, 'set_visible':False}" domain="[('type','in',('bank','cash'))]"/>
<field name="period_id" groups="base.group_extended"/>
</group>
<newline/>
<group expand="0" string="Extended options..." col='8' colspan='4'>
<field name="reference"/>
<field name="name"/>
<field name="narration"/>
<field name="amount"/>
</group>
<newline/>
<group expand="0" string="Group By..." colspan="4" col="10">
<filter string="Supplier" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
@ -77,6 +70,13 @@
<filter string="Period" icon="terp-go-month" domain="[]" context="{'group_by':'period_id','visible':True}"/>
<filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
</group>
<newline/>
<group expand="0" string="Extended options..." col='8' colspan='4'>
<field name="reference"/>
<field name="name"/>
<field name="narration"/>
<field name="amount"/>
</group>
</search>
</field>
</record>
@ -151,7 +151,7 @@
<field name="arch" type="xml">
<form string="Bill Payment">
<group col="6" colspan="4">
<field name="partner_id" required="1" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type)" context="{'invoice_currency':currency_id}" string="Vendor"/>
<field name="partner_id" domain="[('supplier','=',True)]" required="1" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type)" context="{'invoice_currency':currency_id}" string="Vendor"/>
<field name="journal_id"
domain="[('type','in',['bank', 'cash'])]"
widget="selection" select="1"
@ -225,7 +225,7 @@
</form>
</field>
</record>
<record id="action_vendor_payment" model="ir.actions.act_window">
<field name="name">Vendor Payment</field>
<field name="res_model">account.voucher</field>
@ -331,7 +331,7 @@
</form>
</field>
</record>
<record id="action_vendor_receipt" model="ir.actions.act_window">
<field name="name">Sales Payment</field>
<field name="res_model">account.voucher</field>

View File

@ -22,13 +22,6 @@
<field name="journal_id" widget="selection" context="{'journal_id': self, 'set_visible':False}" domain="[('type','in',('purchase','purchase_refund'))]"/>
<field name="period_id" groups="base.group_extended"/>
</group>
<newline/>
<group expand="0" string="Extended options..." col='8' colspan='4'>
<field name="reference"/>
<field name="name"/>
<field name="narration"/>
<field name="amount"/>
</group>
<newline/>
<group expand="0" string="Group By..." colspan="4" col="10">
<filter string="Supplier" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
@ -36,6 +29,13 @@
<filter string="Period" icon="terp-go-month" domain="[]" context="{'group_by':'period_id','visible':True}"/>
<filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
</group>
<newline/>
<group expand="0" string="Extended options..." col='8' colspan='4'>
<field name="reference"/>
<field name="name"/>
<field name="narration"/>
<field name="amount"/>
</group>
</search>
</field>
</record>
@ -61,13 +61,6 @@
<field name="journal_id" widget="selection" context="{'journal_id': self, 'set_visible':False}" domain="[('type','in',('sale','sale_refund'))]"/>
<field name="period_id" groups="base.group_extended"/>
</group>
<newline/>
<group expand="0" string="Extended options..." col='8' colspan='4'>
<field name="reference"/>
<field name="name"/>
<field name="narration"/>
<field name="amount"/>
</group>
<newline/>
<group expand="0" string="Group By..." colspan="4" col="10">
<filter string="Customer" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
@ -75,6 +68,13 @@
<filter string="Period" icon="terp-go-month" domain="[]" context="{'group_by':'period_id','visible':True}"/>
<filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
</group>
<newline/>
<group expand="0" string="Extended options..." col='8' colspan='4'>
<field name="reference"/>
<field name="name"/>
<field name="narration"/>
<field name="amount"/>
</group>
</search>
</field>
</record>
@ -122,7 +122,7 @@
<group col="2" colspan="1">
<separator string="Payment Options" colspan="2"/>
<field name="pay_now" on_change="onchange_payment(pay_now, journal_id, partner_id)" required="1"/>
<field name="account_id"
<field name="account_id"
attrs="{'invisible':[('pay_now','!=','pay_now')]}"
domain="[('type','=','liquidity')]"/>
<!-- should select income accounts only. Or use the journal for this ? -->
@ -159,7 +159,7 @@
</form>
</field>
</record>
<!-- Sales Voucher -->
<record id="action_sale_receipt" model="ir.actions.act_window">
<field name="name">Sales Receipt</field>
@ -205,7 +205,7 @@
<field name="arch" type="xml">
<form string="Vendor Bills">
<group col="6" colspan="4">
<field name="partner_id" required="1" string="Vendor" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type)"/>
<field name="partner_id" domain="[('supplier','=',True)]" required="1" string="Vendor" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type)"/>
<field name="journal_id" domain="[('type','in',['purchase','purchase_refund'])]" widget="selection" select="1" on_change="onchange_journal(journal_id, line_dr_ids, tax_id, partner_id)"/>
<field name="number"/>
<field name="name" colspan="4"/>
@ -284,8 +284,8 @@
<field name="act_window_id" ref="action_purchase_receipt"/>
</record>
<menuitem id="menu_action_purchase_receipt" icon="STOCK_JUSTIFY_FILL"
action="action_purchase_receipt" parent="account.menu_finance_payables" sequence="10"/>
<menuitem id="menu_action_purchase_receipt" icon="STOCK_JUSTIFY_FILL"
action="action_purchase_receipt" parent="account.menu_finance_payables" sequence="10"/>
</data>
</openerp>

View File

@ -43,7 +43,7 @@
<field name="name"/>
<field name="amount" sum="Total Amount"/>
<field name="type"/>
<field name="account_analytic_id" groups="base.group_extended"/>
<field name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
</tree>
</field>
<group col="2" colspan="3">
@ -107,13 +107,6 @@
<field name="journal_id" widget="selection" context="{'journal_id': self, 'set_visible':False}" />
<field name="period_id" groups="base.group_extended"/>
</group>
<newline/>
<group expand="0" string="Extended options..." col='8' colspan='4'>
<field name="reference"/>
<field name="name"/>
<field name="narration"/>
<field name="amount"/>
</group>
<newline/>
<group expand="0" string="Group By..." colspan="4" col="10">
<filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
@ -121,6 +114,13 @@
<filter string="Period" icon="terp-go-month" domain="[]" context="{'group_by':'period_id','visible':True}"/>
<filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
</group>
<newline/>
<group expand="0" string="Extended options..." col='8' colspan='4'>
<field name="reference"/>
<field name="name"/>
<field name="narration"/>
<field name="amount"/>
</group>
</search>
</field>
</record>
@ -179,6 +179,20 @@
<field name="search_view_id" ref="view_voucher_filter"/>
</record>
<record id="view_bank_statement_form_invoice" model="ir.ui.view">
<field name="name">account.bank.statement.invoice.form.inherit</field>
<field name="model">account.bank.statement</field>
<field name="type">form</field>
<field name="inherit_id" ref="account.view_bank_statement_form"/>
<field name="arch" type="xml">
<field name="currency" invisible="1" position="after">
<button name="%(action_view_account_statement_from_invoice_lines)d"
string="Import Invoices" type="action" icon="gtk-execute"
attrs="{'invisible':[('state','=','confirm')]}"/>
</field>
</field>
</record>
<record id="view_bank_statement_form_voucher" model="ir.ui.view">
<field name="name">account.bank.statement.voucher.form.inherit</field>

View File

@ -20,3 +20,6 @@
##############################################################################
import account_voucher_unreconcile
import account_statement_from_invoice
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -47,12 +47,14 @@ class account_statement_from_invoice_lines(osv.osv_memory):
statement_obj = self.pool.get('account.bank.statement')
statement_line_obj = self.pool.get('account.bank.statement.line')
currency_obj = self.pool.get('res.currency')
statement_reconcile_obj = self.pool.get('account.bank.statement.reconcile')
voucher_obj = self.pool.get('account.voucher')
voucher_line_obj = self.pool.get('account.voucher.line')
line_date = time.strftime('%Y-%m-%d')
statement = statement_obj.browse(cr, uid, statement_id, context=context)
# for each selected move lines
for line in line_obj.browse(cr, uid, line_ids, context=context):
voucher_res = {}
ctx = context.copy()
# take the date for computation of currency => use payment date
ctx['date'] = line_date
@ -69,10 +71,29 @@ class account_statement_from_invoice_lines(osv.osv_memory):
elif (line.invoice and line.invoice.currency_id.id <> statement.currency.id):
amount = currency_obj.compute(cr, uid, line.invoice.currency_id.id,
statement.currency.id, amount, context=ctx)
voucher_res = { 'type':(amount < 0 and 'payment' or 'receipt') ,
'name': line.name,
'partner_id': line.partner_id.id,
'journal_id': statement.journal_id.id,
'account_id': line.account_id.id,
'company_id':statement.company_id.id,
'currency_id':statement.currency.id,
'date':line.date,
'amount':abs(amount),
'period_id':statement.period_id.id}
voucher_id = voucher_obj.create(cr, uid, voucher_res, context=context)
result = voucher_obj.onchange_partner_id(cr, uid, [], partner_id=line.partner_id.id, journal_id=statement.journal_id.id, price=abs(amount), currency_id= statement.currency.id, ttype=(amount < 0 and 'payment' or 'receipt'))
voucher_line_dict = False
if result['value']['line_ids']:
for line_dict in result['value']['line_ids']:
move_line = line_obj.browse(cr, uid, line_dict['move_line_id'], context)
if line.move_id.id == move_line.move_id.id:
voucher_line_dict = line_dict
reconcile_id = statement_reconcile_obj.create(cr, uid, {
'line_ids': [(6, 0, [line.id])]
}, context=context)
if voucher_line_dict:
voucher_line_dict.update({'voucher_id':voucher_id})
voucher_line_obj.create(cr, uid, voucher_line_dict, context=context)
if line.journal_id.type == 'sale':
type = 'customer'
elif line.journal_id.type == 'purchase':
@ -87,7 +108,7 @@ class account_statement_from_invoice_lines(osv.osv_memory):
'account_id': line.account_id.id,
'statement_id': statement_id,
'ref': line.ref,
'reconcile_id': reconcile_id,
'voucher_id': voucher_id,
'date': time.strftime('%Y-%m-%d'), #time.strftime('%Y-%m-%d'), #line.date_maturity or,
}, context=context)
return {}

View File

@ -282,6 +282,7 @@ class account_analytic_line(osv.osv):
_defaults = {
'date': time.strftime('%Y-%m-%d'),
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.analytic.line', context=c),
'amount' : 0.00
}
_order = 'date desc'

View File

@ -20,7 +20,6 @@
##############################################################################
from osv import fields, osv
import pooler
class profile_association_config_install_modules_wizard(osv.osv_memory):
_name='profile.association.config.install_modules_wizard'

View File

@ -18,15 +18,10 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from mx import DateTime
from osv import fields, osv, orm
from tools import config
from tools.translate import _
import ir
import netsvc
import os
import time
import tools
#----------------------------------------------------------
# Auction Artists
@ -37,7 +32,7 @@ class auction_artists(osv.osv):
_columns = {
'name': fields.char('Artist/Author Name', size=64, required=True),
'pseudo': fields.char('Pseudo', size=64),
'birth_death_dates':fields.char('Birth / Death dates', size=64),
'birth_death_dates':fields.char('Lifespan', size=64),
'biography': fields.text('Biography'),
}
auction_artists()
@ -69,23 +64,45 @@ class auction_dates(osv.osv):
reads = self.read(cr, uid, ids, ['name', 'auction1'], context)
name = [(r['id'], '['+r['auction1']+'] '+ r['name']) for r in reads]
return name
def _get_invoice(self, cr, uid, ids, name, arg, context={}):
lots_obj = self.pool.get('auction.lots')
result = {}
for data in self.browse(cr, uid, ids):
buyer_inv_ids = []
seller_inv_ids = []
result[data.id] = {
'seller_invoice_history': buyer_inv_ids,
'buyer_invoice_history': seller_inv_ids,
}
lots_ids = lots_obj.search(cr, uid, [('auction_id','=',data.id)])
for lot in lots_obj.browse(cr, uid, lots_ids):
if lot.ach_inv_id:
buyer_inv_ids.append(lot.ach_inv_id.id)
if lot.sel_inv_id:
seller_inv_ids.append(lot.sel_inv_id.id)
result[data.id]['seller_invoice_history'] = seller_inv_ids
result[data.id]['buyer_invoice_history'] = buyer_inv_ids
return result
_columns = {
'name': fields.char('Auction Name', size=64, required=True),
'expo1': fields.date('First Exposition Day', required=True, help="Beginning Exposition Date For Auction"),
'expo2': fields.date('Last Exposition Day', required=True, help="Last Exposition Date For Auction"),
'auction1': fields.date('First Auction Day', required=True, help="Start Date Of Auction"),
'auction2': fields.date('Last Auction Day', required=True, help="End Date Of Auction"),
'journal_id': fields.many2one('account.journal', 'Buyer Journal', required=True, help="Account Journal For Buyer"),
'journal_seller_id': fields.many2one('account.journal', 'Seller Journal', required=True, help="Account Journal For Seller"),
'buyer_costs': fields.many2many('account.tax', 'auction_buyer_taxes_rel', 'auction_id', 'tax_id', 'Buyer Costs', help="Account Tax For Buyer"),
'seller_costs': fields.many2many('account.tax', 'auction_seller_taxes_rel', 'auction_id', 'tax_id', 'Seller Costs', help="Account Tax For Seller"),
'expo1': fields.date('First Exposition Day', required=True, help="Beginning exposition date for auction"),
'expo2': fields.date('Last Exposition Day', required=True, help="Last exposition date for auction"),
'auction1': fields.date('First Auction Day', required=True, help="Start date of auction"),
'auction2': fields.date('Last Auction Day', required=True, help="End date of auction"),
'journal_id': fields.many2one('account.journal', 'Buyer Journal', required=True, help="Account journal for buyer"),
'journal_seller_id': fields.many2one('account.journal', 'Seller Journal', required=True, help="Account journal for seller"),
'buyer_costs': fields.many2many('account.tax', 'auction_buyer_taxes_rel', 'auction_id', 'tax_id', 'Buyer Costs', help="Account tax for buyer"),
'seller_costs': fields.many2many('account.tax', 'auction_seller_taxes_rel', 'auction_id', 'tax_id', 'Seller Costs', help="Account tax for seller"),
'acc_income': fields.many2one('account.account', 'Income Account', required=True),
'acc_expense': fields.many2one('account.account', 'Expense Account', required=True),
'adj_total': fields.function(_adjudication_get, method=True, string='Total Adjudication', store=True),
'state': fields.selection((('draft', 'Draft'), ('closed', 'Closed')), 'State', select=1, readonly=True,
help='When auction starts the state is \'Draft\'.\n At the end of auction, the state becomes \'Closed\'.'),
'account_analytic_id': fields.many2one('account.analytic.account', 'Analytic Account', required=True),
'buyer_invoice_history': fields.function(_get_invoice, relation='account.invoice', method=True, string="Buyer Invoice", type='many2many', multi=True),
'seller_invoice_history': fields.function(_get_invoice, relation='account.invoice', method=True, string="Seller Invoice", type='many2many', multi=True),
}
_defaults = {
@ -107,9 +124,9 @@ class auction_dates(osv.osv):
context={}
lots_obj = self.pool.get('auction.lots')
lots_ids = lots_obj.search(cr, uid, [('auction_id', 'in', ids), ('state', '=', 'draft'), ('obj_price', '>', 0)])
new_buyer_invoice = lots_obj.lots_invoice(cr, uid, lots_ids, {}, None)
lots_obj.lots_invoice(cr, uid, lots_ids, {}, None)
lots_ids2 = lots_obj.search(cr, uid, [('auction_id', 'in', ids), ('obj_price', '>', 0)])
new_seller_invoice = lots_obj.seller_trans_create(cr, uid, lots_ids2, {})
lots_obj.seller_trans_create(cr, uid, lots_ids2, {})
self.write(cr, uid, ids, {'state': 'closed'}) #close the auction
return True
@ -262,7 +279,6 @@ class auction_lots(osv.osv):
lots = self.browse(cr, uid, ids, context)
pt_tax = self.pool.get('account.tax')
for lot in lots:
total_tax = 0.0
taxes = []
for name in fields:
res[lot.id] = {name: False}
@ -323,7 +339,6 @@ class auction_lots(osv.osv):
('account_id', '=', lot.auction_id.account_analytic_id.id),
('journal_id', '<>', lot.auction_id.journal_id.id),
('journal_id', '<>', lot.auction_id.journal_seller_id.id)])
indir_cost = lot.bord_vnd_id.specific_cost_ids
for r in lot.bord_vnd_id.specific_cost_ids:
som += r.amount
for line in account_analytic_line_obj.browse(cr, uid, line_ids, context=context):
@ -355,15 +370,15 @@ class auction_lots(osv.osv):
_columns = {
'bid_lines':fields.one2many('auction.bid_line', 'lot_id', 'Bids'),
'auction_id': fields.many2one('auction.dates', 'Auction', select=1, help="Auction For Object"),
'bord_vnd_id': fields.many2one('auction.deposit', 'Depositer Inventory', required=True, help="Provide Deposit Information: seller, Withdrawned Method, Object, Deposit Costs"),
'name': fields.char('Title', size=64, required=True, help='Auction Object Name'),
'auction_id': fields.many2one('auction.dates', 'Auction', select=1, help="Auction for object"),
'bord_vnd_id': fields.many2one('auction.deposit', 'Depositer Inventory', required=True, help="Provide deposit information: seller, Withdrawned Method, Object, Deposit Costs"),
'name': fields.char('Title', size=64, required=True, help='Auction object name'),
'name2': fields.char('Short Description (2)', size=64),
'lot_type': fields.selection(_type_get, 'Object category', size=64),
'author_right': fields.many2one('account.tax', 'Author rights', help="Account Tax For Author Commission"),
'author_right': fields.many2one('account.tax', 'Author rights', help="Account tax for author commission"),
'lot_est1': fields.float('Minimum Estimation', help="Minimum Estimate Price"),
'lot_est2': fields.float('Maximum Estimation', help="Maximum Estimate Price"),
'lot_num': fields.integer('List Number', required=True, select=1, help="List Number In Depositer Inventory"),
'lot_num': fields.integer('List Number', required=True, select=1, help="List number in depositer inventory"),
'create_uid': fields.many2one('res.users', 'Created by', readonly=True),
'history_ids':fields.one2many('auction.lot.history', 'lot_id', 'Auction history'),
'lot_local':fields.char('Location', size=64, help="Auction Location"),
@ -380,15 +395,15 @@ class auction_lots(osv.osv):
'ach_login': fields.char('Buyer Username', size=64),
'ach_uid': fields.many2one('res.partner', 'Buyer'),
'seller_id': fields.related('bord_vnd_id','partner_id', type='many2one', relation='res.partner', string='Seller', readonly=True),
'ach_emp': fields.boolean('Taken Away', readonly=True, help="When state is Taken Away, This field is Marked as True"),
'is_ok': fields.boolean('Buyer\'s payment', help="When Buyer Pay For Bank statement', This field is Marked"),
'ach_emp': fields.boolean('Taken Away', readonly=True, help="When state is Taken Away, this field is marked as True"),
'is_ok': fields.boolean('Buyer\'s payment', help="When buyer pay for bank statement', this field is marked"),
'ach_inv_id': fields.many2one('account.invoice', 'Buyer Invoice', readonly=True, states={'draft':[('readonly', False)]}),
'sel_inv_id': fields.many2one('account.invoice', 'Seller Invoice', readonly=True, states={'draft':[('readonly', False)]}),
'vnd_lim': fields.float('Seller limit'),
'vnd_lim_net': fields.boolean('Net limit ?', readonly=True),
'image': fields.binary('Image', help="Object Image"),
'paid_vnd':fields.function(_getprice, string='Seller Paid', method=True, type='boolean', store=True, multi="paid_vnd", help="When state of Seller Invoice is 'Paid', This field is selected as True."),
'paid_ach':fields.function(_getprice, string='Buyer Invoice Reconciled', method=True, type='boolean', store=True, multi="paid_ach", help="When state of Buyer Invoice is 'Paid', This field is selected as True."),
'paid_vnd':fields.function(_getprice, string='Seller Paid', method=True, type='boolean', store=True, multi="paid_vnd", help="When state of Seller Invoice is 'Paid', this field is selected as True."),
'paid_ach':fields.function(_getprice, string='Buyer Invoice Reconciled', method=True, type='boolean', store=True, multi="paid_ach", help="When state of Buyer Invoice is 'Paid', this field is selected as True."),
'state': fields.selection((
('draft', 'Draft'),
('unsold', 'Unsold'),
@ -404,7 +419,7 @@ class auction_lots(osv.osv):
'gross_revenue':fields.function(_getprice, method=True, string='Gross revenue', store=True, multi="gross_revenue", help="Buyer Price - Seller Price"),
'gross_margin':fields.function(_getprice, method=True, string='Gross Margin (%)', store=True, multi="gross_margin", help="(Gross Revenue*100.0)/ Object Price"),
'costs':fields.function(_getprice, method=True, string='Indirect costs', store=True, multi="costs", help="Deposit cost"),
'statement_id': fields.many2many('account.bank.statement.line', 'auction_statement_line_rel', 'auction_id', 'statement', 'Payment', help="Bank statement Line For Given Buyer"),
'statement_id': fields.many2many('account.bank.statement.line', 'auction_statement_line_rel', 'auction_id', 'statement', 'Payment', help="Bank statement line for given buyer"),
'net_revenue':fields.function(_getprice, method=True, string='Net revenue', store=True, multi="net_revenue", help="Buyer Price - Seller Price - Indirect Cost"),
'net_margin':fields.function(_getprice, method=True, string='Net Margin (%)', store=True, multi="net_margin", help="(Net Revenue * 100)/ Object Price"),
}
@ -582,7 +597,6 @@ class auction_lots(osv.osv):
raise orm.except_orm(_('Missed buyer !'), _('The object "%s" has no buyer assigned.') % (lot.name,))
else:
partner_ref =lot.ach_uid.id
lot_name = lot.obj_num
res = res_obj.address_get(cr, uid, [partner_ref], ['contact', 'invoice'])
contact_addr_id = res['contact']
invoice_addr_id = res['invoice']
@ -632,20 +646,14 @@ class auction_lots(osv.osv):
if not context:
context={}
inv_ref=self.pool.get('account.invoice')
partner_obj = self.pool.get('res.partner')
inv_line_obj = self.pool.get('account.invoice.line')
wf_service = netsvc.LocalService('workflow')
for lot in self.browse(cr, uid, ids, context):
partner_id = lot.bord_vnd_id.partner_id.id
if not lot.auction_id.id:
continue
lot_name = lot.obj_num
if lot.bord_vnd_id.id in invoices:
inv_id = invoices[lot.bord_vnd_id.id]
else:
res = partner_obj.address_get(cr, uid, [lot.bord_vnd_id.partner_id.id], ['contact', 'invoice'])
contact_addr_id = res['contact']
invoice_addr_id = res['invoice']
inv = {
'name': 'Auction:' +lot.name,
'journal_id': lot.auction_id.journal_seller_id.id,
@ -694,7 +702,6 @@ class auction_lots(osv.osv):
RETURN: id of generated invoice
"""
dt = time.strftime('%Y-%m-%d')
inv_ref = self.pool.get('account.invoice')
res_obj = self.pool.get('res.partner')
inv_line_obj = self.pool.get('account.invoice.line')
@ -711,8 +718,6 @@ class auction_lots(osv.osv):
add = res_obj.read(cr, uid, [lot.ach_uid.id], ['address'])[0]['address']
if not len(add):
raise orm.except_orm(_('Missed Address !'), _('The Buyer has no Invoice Address.'))
price = lot.obj_price or 0.0
lot_name =lot.obj_num
inv = {
'name':lot.auction_id.name or '',
'reference': lot.ach_login,
@ -761,7 +766,7 @@ class auction_bid(osv.osv):
_order = 'id desc'
_columns = {
'partner_id': fields.many2one('res.partner', 'Buyer Name', required=True),
'contact_tel':fields.char('Contact', size=64),
'contact_tel':fields.char('Contact Number', size=64),
'name': fields.char('Bid ID', size=64, required=True),
'auction_id': fields.many2one('auction.dates', 'Auction Date', required=True),
'bid_lines': fields.one2many('auction.bid_line', 'bid_id', 'Bid'),

View File

@ -1,7 +1,7 @@
<?xml version="1.0"?>
<openerp>
<data>
<menuitem name="Auction Management" id="auction_menu_root" icon="terp-purchase" sequence="26" groups="base.group_system"/>
<menuitem name="Auction" id="auction_menu_root" icon="terp-purchase" sequence="26" groups="base.group_system"/>
<menuitem name="Configuration" parent="auction_menu_root" id="auction_config_menu" sequence="7"/>
<menuitem name="Tools Bar Codes" id="auction_outils_menu" parent="auction_menu_root" sequence="5" />
<menuitem name="Deliveries Management" action="action_auction_taken" id="menu_wizard_emporte" parent="auction_outils_menu"/>
@ -14,9 +14,8 @@
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Artists">
<field name="name"/>
<field name="birth_death_dates"/>
<field name="biography"/>
<field name="name"/>
<field name="birth_death_dates"/>
</tree>
</field>
</record>
@ -26,12 +25,15 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Artists">
<field colspan="4" name="name" select="1"/>
<field colspan="4" name="pseudo" select="1"/>
<newline/>
<field colspan="4" name="birth_death_dates"/>
<newline/>
<field colspan="4" name="biography"/>
<separator string="Author/Artist" colspan="4"/>
<group colspan="4" col="6">
<field name="name" colspan="4" string="Name"/>
<newline/>
<field name="pseudo"/>
<field name="birth_death_dates"/>
</group>
<separator string="Biography" colspan="4"/>
<field name="biography" nolabel="1" colspan="4"/>
</form>
</field>
</record>
@ -105,27 +107,39 @@
<field name="name" colspan="2" select="1"/>
<notebook colspan="4">
<page string="Auction Dates">
<separator string="Exposition Dates" colspan="4"/>
<field name="expo1"/>
<field name="expo2"/>
<separator string="Auction Dates" colspan="4"/>
<field name="auction1" select="1"/>
<field name="auction2" select="1"/>
<group colspan="4" col="4">
<group colspan="2" col="2">
<separator string="Exposition Dates" colspan="4"/>
<field name="expo1"/>
<field name="expo2"/>
</group>
<group colspan="2" col="2">
<separator string="Auction Dates" colspan="4"/>
<field name="auction1" select="1"/>
<field name="auction2" select="1"/>
</group>
</group>
<separator string="" colspan="4"/>
<field name="state"/>
<button name="close" states="draft" string="Create Invoices" type="object" colspan="2" icon="gtk-yes"/>
</page>
<page string="Accounting" >
<separator string="Accounting" colspan="4"/>
<field name="acc_expense" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
<field name="acc_income" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
<separator string="Analytic" colspan="4"/>
<field name="journal_id"/>
<field name="journal_seller_id"/>
<field name="account_analytic_id" groups="base.group_extended"/>
<group colspan="4" col="4">
<group colspan="2" col="2">
<separator string="Accounting" colspan="4"/>
<field name="acc_expense" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
<field name="acc_income" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
</group>
<group colspan="2" col="2">
<separator string="Analytic" colspan="4"/>
<field name="journal_id"/>
<field name="journal_seller_id"/>
<field name="account_analytic_id" groups="base.group_extended"/>
</group>
</group>
</page>
<page string="Commissions">
<group col="4" colspan="4">
<group col="4" colspan="4" expand="1">
<group col="2" colspan="4">
<separator string="Buyer Commissions" colspan="4"/>
<field name="buyer_costs" domain="[('parent_id','=',False),('domain','=','auction'),('type_tax_use','&lt;&gt;','sale')]" nolabel="1" colspan="4"/>
@ -136,6 +150,44 @@
</group>
</group>
</page>
<page string="History">
<group colspan="4" col="4">
<group colspan="2" col="2">
<separator string="Buyer Invoices" colspan="2"/>
<field name="buyer_invoice_history" nolabel="1" widget="one2many_list"
height="400">
<tree colors="blue:state in ('draft');black:state in ('proforma','proforma2','open');gray:state in ('cancel')" string="Invoice">
<field name="date_invoice"/>
<field name="number"/>
<field name="partner_id" groups="base.group_user"/>
<field name="name"/>
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
<field name="user_id"/>
<field name="date_due"/>
<field name="origin"/>
<field name="state"/>
</tree>
</field>
</group>
<group colspan="2" col="2">
<separator string="Seller Invoices" colspan="2"/>
<field name="seller_invoice_history" nolabel="1" widget="one2many_list"
height="400">
<tree colors="blue:state in ('draft');black:state in ('proforma','proforma2','open');gray:state in ('cancel')" string="Invoice">
<field name="date_invoice"/>
<field name="number"/>
<field name="partner_id" groups="base.group_user"/>
<field name="name"/>
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
<field name="user_id"/>
<field name="date_due"/>
<field name="origin"/>
<field name="state"/>
</tree>
</field>
</group>
</group>
</page>
</notebook>
</form>
</field>
@ -332,13 +384,10 @@
</form>
</field>
</page>
<page string="Note">
<field name="obj_desc" colspan="4" nolabel="1"/>
</page>
<page string="History" groups="base.group_extended">
<group colspan="2" col="2">
<field name="statement_id" domain="[('state','=','draft')]" colspan="4" nolabel="1"
widget="one2many_list">
height="575" width="285" widget="one2many_list">
<tree string="Buyer's Payment History">
<field name="statement_id"/>
<field name="amount"/>
@ -352,14 +401,12 @@
<field name="account_id"/>
<field name="type"/>
<field name="statement_id"/>
<field name="reconcile_id"/>
<field name="amount"/>
<field name="reconcile_amount"/>
</form>
</field>
</group>
<group colspan="2" col="2">
<field name="history_ids" colspan="4" readonly="1" nolabel="1">
<field name="history_ids" colspan="4" readonly="1" nolabel="1" height="575">
<tree string="History">
<field name="name"/>
<field name="lot_id"/>
@ -369,6 +416,9 @@
</field>
</group>
</page>
<page string="Notes">
<field name="obj_desc" colspan="4" nolabel="1"/>
</page>
</notebook>
</form>
</field>
@ -450,8 +500,7 @@
src_model="auction.lots"
id="act_auction_lot_open_bid"/>
<menuitem name="Objects" parent="auction_menu_root" id="auction_objects_menu" sequence="2"/>
<menuitem name="Objects" action="action_all_objects" parent="auction_objects_menu" id="auction_all_objects_menu"/>
<menuitem name="Objects" action="action_all_objects" parent="auction_date_menu" id="auction_all_objects_menu"/>
<record model="ir.ui.view" id="view_deposit_border_form">
<field name="name">auction.deposit.form</field>
@ -459,14 +508,15 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Deposit Border Form">
<field name="name" select="1"/>
<field name="date_dep" select="1"/>
<field name="partner_id" select="1"/>
<field name="method"/>
<newline/>
<field name="tax_id" domain="[('domain','=','auction'),('parent_id','=',False),('type_tax_use','&lt;&gt;','purchase')]"/>
<field name="transfer"/>
<newline/>
<group colspan="4" col="6">
<field name="name" string="Reference"/>
<field name="date_dep"/>
<field name="partner_id"/>
<newline/>
<field name="method"/>
<field name="tax_id" domain="[('domain','=','auction'),('parent_id','=',False),('type_tax_use','&lt;&gt;','purchase')]"/>
<field name="transfer"/>
</group>
<notebook colspan="4">
<page string="General Information">
<field name="lot_id" colspan="4" mode="tree,graph" nolabel="1">
@ -640,11 +690,13 @@
<field name="model">auction.bid</field>
<field name="arch" type="xml">
<form string="Bids">
<field name="name" select="1"/>
<field name="auction_id" select="1"/>
<newline/>
<field name="partner_id" select="1" on_change="onchange_contact(partner_id)"/>
<field name="contact_tel"/>
<group colspan="4" col="6">
<field name="name"/>
<field name="auction_id"/>
<field name="contact_tel"/>
<newline/>
<field name="partner_id" on_change="onchange_contact(partner_id)" colspan="4"/>
</group>
<field name="bid_lines" colspan="4" nolabel="1">
<tree string="Bids Lines" editable="bottom">
<field name="lot_id" domain="[('auction_id','=',parent.auction_id)]"/>

View File

@ -111,7 +111,7 @@
sequence="1"
id="menu_board_auction_open" icon="terp-graph" parent="menu_board_auction"/>
<menuitem name="Auction Management" id="auction.auction_menu_root" icon="terp-purchase" sequence="26" groups="base.group_system" action="open_board_auction"/>
<menuitem name="Auction" id="auction.auction_menu_root" icon="terp-purchase" sequence="26" groups="base.group_system" action="open_board_auction"/>
</data>
</openerp>

View File

@ -62,7 +62,7 @@
</para>
<para style="P6">[[o.artist2_id and 'Artist2: '+o.artist2_id.name or False]]</para>
<para style="P8">
<font face="Courier">[[o.artist_id2 and 'Biography: '+o.artist_id2.biography or False]]</font>
<font face="Courier">[[o.artist2_id and 'Biography: '+o.artist2_id.biography or False]]</font>
</para>
</td>
</tr>

View File

@ -9,72 +9,69 @@
<blockTableStyle id="Standard_Outline">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Table3">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<blockAlignment value="RIGHT" start="-1,0" stop="-1,-1"/>
<blockFont name="Helvetica-BoldOblique" size="12" start="0,0" stop="-1,0"/>
<blockBackground colorName="grey" start="0,0" stop="-1,0"/>
<blockTextColor colorName="white" start="0,0" stop="-1,0"/>
<lineStyle kind="LINEBELOW" start="0,0" stop="-1,0"/>
<blockBackground colorName="#ffffff" start="0,0" stop="0,-1"/>
<blockBackground colorName="#ffffff" start="1,0" stop="1,-1"/>
<blockBackground colorName="#ffffff" start="2,0" stop="2,-1"/>
</blockTableStyle>
<initialize>
<paraStyle name="all" alignment="justify"/>
</initialize>
<paraStyle name="P1" fontName="Times-Roman" alignment="RIGHT"/>
<paraStyle name="P2" fontName="Times-Roman" fontSize="8.0" leading="10" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P3" fontName="Times-Roman" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P4" fontName="Times-Roman" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P5" rightIndent="17.0" leftIndent="0.0" fontName="Times-Roman" fontSize="6.0" leading="8" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P6" rightIndent="17.0" leftIndent="0.0" fontName="Courier" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P7" rightIndent="17.0" leftIndent="0.0" fontName="Courier" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<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="P1" fontName="Helvetica" alignment="RIGHT"/>
<paraStyle name="P2" fontName="Helvetica" fontSize="16.0" leading="20" alignment="CENTER"/>
<paraStyle name="P3" rightIndent="17.0" leftIndent="0.0" fontName="Helvetica" fontSize="6.0" leading="8" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P4" rightIndent="17.0" leftIndent="0.0" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P5" rightIndent="17.0" leftIndent="0.0" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P6" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P7" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Standard" fontName="Helvetica"/>
<paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Table Contents" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER" 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"/>
<images/>
</stylesheet>
<story>
<para style="Standard">
<font color="white"> </font>
</para>
<para style="P1">[[ time.strftime('%Y-%m-%d') ]] </para>
<para style="P2">Catelog</para>
<para style="P1">
<font color="white"> </font>
</para>
<para style="P2">
<para style="P1">
<font color="white"> </font>
</para>
<para style="Standard">
<para style="P1"><font face="Helvetica">Date</font>: [[ formatLang(time.strftime('%Y-%m-%d'),date=True) ]] </para>
<para style="P1">
<font color="white"> </font>
</para>
<blockTable colWidths="65.0,398.0,94.0" style="Table3">
<tr>
<td>
<para style="P3">Cat.N</para>
<para style="P6">Cat.N</para>
</td>
<td>
<para style="P3">Description</para>
<para style="P6">Description</para>
</td>
<td>
<para style="P4">Estimate</para>
<para style="P7">Estimate</para>
</td>
</tr>
<tr>
<td>
<para style="P5">[[ repeatIn(objects,'o') ]] <font face="Courier" size="9.0">[[o. obj_num ]]</font></para>
<para style="P3">[[ repeatIn(objects,'o') ]] <font face="Helvetica" size="9.0">[[o. obj_num ]]</font></para>
</td>
<td>
<para style="P6">[[o. name]]</para>
<para style="P4">[[o. name]]</para>
</td>
<td>
<para style="P7">[[o. lot_est1 ]]-[[o.lot_est2]]</para>
<para style="P5">[[formatLang(o. lot_est1) ]][[ company.currency_id.symbol ]]-[[formatLang(o.lot_est2)]][[ company.currency_id.symbol ]]</para>
</td>
</tr>
</blockTable>
@ -82,5 +79,4 @@
<font color="white"> </font>
</para>
</story>
</document>
</document>

View File

@ -74,10 +74,10 @@
<para style="P4">[[ o.ach_uid and o.ach_uid.name or False]]</para>
</td>
<td>
<para style="P5"><font>[[o.bid_lines[0] and o.bid_lines[0].bid_id.name or removeParentNode('font')]]</font></para>
<para style="P5"><font>[[ o.bid_lines and o.bid_lines[0] and o.bid_lines[0].bid_id.name or removeParentNode('font')]]</font></para>
</td>
<td>
<para style="P6"><font>[[o.bid_lines[0] and o.bid_lines[0].bid_id.contact_tel or removeParentNode('font')]]</font></para>
<para style="P6"><font>[[o.bid_lines and o.bid_lines[0] and o.bid_lines[0].bid_id.contact_tel or removeParentNode('font')]]</font></para>
</td>
</tr>
</blockTable>

View File

@ -88,7 +88,7 @@
<para style="P8">[[o.lot_est1]]-[[o.lot_est2]]</para>
</td>
<td>
<para style="P7"><font>[[o.bid_lines[0] and o.bid_lines[0].bid_id.contact_tel or removeParentNode('font')]]</font></para>
<para style="P7"><font>[[o.bid_lines and o.bid_lines[0] and o.bid_lines[0].bid_id.contact_tel or removeParentNode('font')]]</font></para>
</td>
</tr>
</blockTable>

View File

@ -12,85 +12,93 @@
</blockTableStyle>
<blockTableStyle id="Table2">
<blockAlignment value="LEFT"/>
<lineStyle kind="LINEBELOW" colorName="red" start="0,0" stop="-1,0"/>
<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="Tableau1">
<blockTableStyle id="Table1">
<blockAlignment value="LEFT"/>
<lineStyle kind="LINEABOVE" colorName="red" start="0,0" stop="-1,0"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="0,0" stop="0,0"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,0"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="2,0" stop="2,0"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="3,0" stop="3,0"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="4,0" stop="4,0"/>
</blockTableStyle>
<initialize>
<paraStyle name="all" alignment="justify"/>
</initialize>
<paraStyle name="P1" fontName="Courier-BoldOblique" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P2" fontName="Times-Roman" fontSize="7.0" leading="9"/>
<paraStyle name="P3" fontName="Times-Bold" fontSize="7.0" leading="9" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P4" fontName="Times-Bold" fontSize="11.0" leading="14" alignment="center" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P5" fontName="Times-Bold" fontSize="11.0" leading="14" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P6" fontName="Times-Bold" fontSize="11.0" leading="14" alignment="center" spaceBefore="0.0" spaceAfter="6.0"/>
<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="Addressee" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="3.0"/>
<paraStyle name="Index" fontName="Times-Roman"/>
<paraStyle name="P61" fontName="Times-Bold" fontSize="11.0" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P1" fontName="Helvetica" fontSize="7.0" leading="9"/>
<paraStyle name="P2" fontName="Helvetica-Bold" fontSize="7.0" leading="9" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P3" fontName="Helvetica-Bold" fontSize="11.0" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P4" fontName="Helvetica-Bold" fontSize="11.0" leading="14" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P5" fontName="Helvetica-Bold" fontSize="11.0" leading="14" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P6" fontName="Helvetica-Bold" fontSize="11.0" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P7" fontName="Helvetica-Bold" fontSize="11.0" leading="14" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P8" fontName="Courier-BoldOblique" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Standard" fontName="Helvetica"/>
<paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Table Contents" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Caption" fontName="Helvetica" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="Addressee" fontName="Helvetica" spaceBefore="0.0" spaceAfter="3.0"/>
<paraStyle name="Index" fontName="Helvetica"/>
</stylesheet>
<story>
<para style="P3">
<font color="white"> </font>
</para>
<para style="P5">[[ time.strftime('%d/%m/%Y')]]</para>
<para style="P4">[[ repeatIn(lines_lots_from_auction(objects),'o') ]]</para>
<para style="P4">
<font color="white"> </font>
</para>
<para style="P6">[[o['name'] or False]]</para>
<para style="P2">
<font color="white"> </font>
</para>
<para style="P4">Date: [[ formatLang(time.strftime('%Y-%m-%d'),date=True)]]</para>
<para style="P3">[[ repeatIn(lines_lots_from_auction(objects),'o') ]]</para>
<para style="P3">
<font color="white"> </font>
</para>
<para style="P5">[[o['name'] or False]]</para>
<para style="P1">
<font color="white"> </font>
</para>
<section>
<para style="P2">
<para style="P1">
<font color="white"> </font>
</para>
<blockTable colWidths="131.0,39.0,89.0,121.0,140.0" style="Table2">
<tr>
<td>
<para style="P6">Buyer </para>
<para style="P5">Buyer </para>
</td>
<td>
<para style="P6">#</para>
<para style="P5">Lot</para>
</td>
<td>
<para style="P6">Adj(EUR)</para>
<para style="P5">Adj.([[ company.currency_id.code ]])</para>
</td>
<td>
<para style="P6">Buyer costs([[ o['amount' ]*100 ]]%)</para>
<para style="P5">Buyer costs([[ o['amount' ]*100 ]]%)</para>
</td>
<td>
<para style="P6">To pay</para>
<para style="P5">To pay ([[ company.currency_id.code ]])</para>
</td>
</tr>
<tr>
<td>
<para style="P61">[[ repeatIn(lines_lots_auct_lot(o),'a') ]] </para>
<para style="P61">[[ a['ach_uid'] ]]</para>
<para style="P5">[[ repeatIn(lines_lots_auct_lot(o),'a') ]][[ a['ach_uid'] ]]</para>
</td>
<td>
<para style="P4">[[ a['no_lot'] or '0.0' ]]</para>
<para style="P3">[[ a['no_lot'] or '0.0' ]]</para>
</td>
<td>
<para style="P4">[[ a['adj_price'] or '0.0' ]]</para>
<para style="P5">[[ a['adj_price']) or '0.0' ]][[ company.currency_id.symbol ]]</para>
</td>
<td>
<para style="P4">[[ a['buyer_cost'] or '0.0' ]]</para>
<para style="P5">[[ a['buyer_cost'] or '0.0' ]][[ company.currency_id.symbol ]]</para>
</td>
<td>
<para style="P4">[[a['to_pay'] or '0.0' ]]</para>
<para style="P5">[[a['to_pay'] or '0.0' ]][[ company.currency_id.symbol ]]</para>
</td>
</tr>
</blockTable>
@ -100,28 +108,27 @@
<font color="white"> .........</font>
</para>
</section>
<blockTable colWidths="127.0,43.0,87.0,122.0,140.0" style="Tableau1">
<blockTable colWidths="127.0,43.0,87.0,122.0,140.0" style="Table1">
<tr>
<td>
<para style="P6">Total:</para>
<para style="P5">Total:</para>
</td>
<td>
<para style="P4">[[ '%.0f' % (sum_lots() or 0.0) ]]</para>
<para style="P3">[[ '%.0f' % (sum_lots() or 0.0) ]]</para>
</td>
<td>
<para style="P6">[[ '%.2f' % (sum_adj_price() or 0.0) ]]</para>
<para style="P5">[[ '%.2f' % (sum_adj_price() or 0.0 )]][[ company.currency_id.symbol ]]</para>
</td>
<td>
<para style="P6">[[ '%.2f' % (sum_buyer_obj_price() or 0.0) ]]</para>
<para style="P5">[[ '%.2f' % (sum_buyer_obj_price() or 0.0) ]][[ company.currency_id.symbol ]]</para>
</td>
<td>
<para style="P6">[[ '%.2f' % (sum_buyer_price() or 0.0) ]]</para>
<para style="P5">[[ '%.2f' % (sum_buyer_price() or 0.0) ]][[ company.currency_id.symbol ]]</para>
</td>
</tr>
</blockTable>
<para style="P1">
<para style="P8">
<font color="white"> </font>
</para>
</story>
</document>
</document>

View File

@ -15,7 +15,8 @@
<label string="(Keep empty for automatic number)" colspan="2"/>
</group>
<separator string="" colspan="4"/>
<group colspan="4" col="6">
<group colspan="2" col="2"/>
<group colspan="2" col="2">
<button icon="gtk-close" special="cancel" string="Close"/>
<button icon="gtk-yes" string="Create invoices" name="makeInvoices" type="object"/>
</group>

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