mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
Added modules npg_account_make_deposit, npg_bank_account_reconciliation
This commit is contained in:
5
npg_account_make_deposit/Change Log.txt
Normal file
5
npg_account_make_deposit/Change Log.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
1.0 Rima - Added initial module
|
||||
1.1 Rima - Fixes
|
||||
1.2 Serpent - Added webkit report
|
||||
1.3 Rima - Improvements in the certification information in report/deposit_ticket.py and fix in the report
|
||||
1.4 Rima - Fix
|
||||
27
npg_account_make_deposit/__init__.py
Normal file
27
npg_account_make_deposit/__init__.py
Normal file
@@ -0,0 +1,27 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2011 NovaPoint Group LLC (<http://www.novapointgroup.com>)
|
||||
# Copyright (C) 2004-2010 OpenERP SA (<http://www.openerp.com>)
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
#
|
||||
##############################################################################
|
||||
import wizard
|
||||
import report
|
||||
import npg_account_make_deposit
|
||||
import account_move_line
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
58
npg_account_make_deposit/__openerp__.py
Normal file
58
npg_account_make_deposit/__openerp__.py
Normal file
@@ -0,0 +1,58 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2011 NovaPoint Group LLC (<http://www.novapointgroup.com>)
|
||||
# Copyright (C) 2004-2010 OpenERP SA (<http://www.openerp.com>)
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
#
|
||||
##############################################################################
|
||||
{
|
||||
'name': 'Bank Deposit Ticket',
|
||||
'description': '''
|
||||
This module supports the functionality to prepare and record Bank Deposit Tickets, often found in check centric markets like the US. It allows users to select various customer payments and receipts and bundle them into a Deposit Ticket. This would be used to support the following activities: Depositing multiple Checks into your bank account under one deposit ticket, and Deposit Checks and Cash into your bank account from multiple customer receipts or payments. This module can be used for any “bank transaction” centric process including: Paypal, Bank Accounts, and even credit cards – which tend to deposit funds by bundled transactions versus individual checks. By combining payments and receipts into deposit tickets, and using this module to manage the general ledger entries, it will streamline the bank account statement reconciliation process (defined as: comparing your bank account transactions versus the recorded transactions in OpenERP for audit and financial control purposes).
|
||||
|
||||
This module also tracks who prepared the Deposit Ticket, and the user who verified the deposit ticket. In addition to the following: Method of Deposit (e.g. ATM, Night Drop, Teller, Remote Deposit Capture, Online Deposit Capture); Bank Tracking number (e.g. TLR#3 BC#47331 REF#94849303938); Date of Deposit, Deposit Bag #, etc.
|
||||
|
||||
We recommend users add to their GL Chart of Accounts a new Other Current Account named Undeposited Funds, as well as a new journal to post payments to with the Undeposited Funds on the debit side of the transaction.
|
||||
|
||||
Future enhancements – will also include the ability to track deposits NOT using the Undeposited Funds GL account.
|
||||
|
||||
Why is this module needed? OpenERP by default is designed for more electronic transaction management – driven by its heritage in Europe when EFT (electronic) transactions are more readily used – versus Check centric transactions. In electronic transaction management – bundled deposits don’t typically occur as payment transactions typically are displayed individual on statements.
|
||||
|
||||
This module is seen as a prerequisite to support efficient Bank Account Statement Reconciliation found in the US and other countries.
|
||||
|
||||
''',
|
||||
'category': 'Generic Modules/Accounting',
|
||||
'version': '1.4',
|
||||
'author': 'Novapoint Group LLC',
|
||||
'website': 'www.novapointgroup.com',
|
||||
'depends': ['account_cancel', 'report_webkit'],
|
||||
'init_xml': [],
|
||||
'update_xml': ['security/npg_account_make_deposit_security.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'wizard/add_deposit_items_view.xml',
|
||||
'npg_account_make_deposit_view.xml',
|
||||
'account_move_line_view.xml',
|
||||
'deposit_ticket_report.xml',
|
||||
],
|
||||
'demo_xml': ['demo/npg_account_make_deposit_demo.xml'],
|
||||
'test': [],
|
||||
'active': False,
|
||||
'installable': True,
|
||||
'certificate':''
|
||||
}
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
34
npg_account_make_deposit/account_move_line.py
Normal file
34
npg_account_make_deposit/account_move_line.py
Normal file
@@ -0,0 +1,34 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2011 NovaPoint Group LLC (<http://www.novapointgroup.com>)
|
||||
# Copyright (C) 2004-2010 OpenERP SA (<http://www.openerp.com>)
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
#
|
||||
##############################################################################
|
||||
from osv import osv, fields
|
||||
|
||||
class account_move_line(osv.osv):
|
||||
_inherit = 'account.move.line'
|
||||
_columns = {
|
||||
'draft_assigned': fields.boolean('Draft Assigned', help="This field is checked when the move line is assigned to a draft deposit ticket.\
|
||||
The deposit ticket is not still completely processed"),
|
||||
'deposit_id': fields.many2one('deposit.ticket', 'Deposit Ticket')
|
||||
}
|
||||
|
||||
account_move_line()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
32
npg_account_make_deposit/account_move_line_view.xml
Normal file
32
npg_account_make_deposit/account_move_line_view.xml
Normal file
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<!-- Journal Item -->
|
||||
|
||||
<record id="view_account_move_line_deposit_id" model="ir.ui.view">
|
||||
<field name="name">account.move.line.deposit.id</field>
|
||||
<field name="model">account.move.line</field>
|
||||
<field name="inherit_id" ref="account.view_account_move_line_filter"/>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<field name="period_id" position="after">
|
||||
<field name="deposit_id"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_account_move_line_form_deposit_id" model="ir.ui.view">
|
||||
<field name="name">account.move.line.form.deposit.id</field>
|
||||
<field name="model">account.move.line</field>
|
||||
<field name="inherit_id" ref="account.view_move_line_form"/>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<field name="statement_id" position="after">
|
||||
<field name="deposit_id"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data noupdate="1">
|
||||
|
||||
<record id="deposit_method_teller" model="deposit.method">
|
||||
<field name="name">Teller</field>
|
||||
</record>
|
||||
|
||||
<record id="deposit_method_atm" model="deposit.method">
|
||||
<field name="name">ATM</field>
|
||||
</record>
|
||||
|
||||
<record id="deposit_method_remote_deposit_capture" model="deposit.method">
|
||||
<field name="name">Remote Deposit Capture</field>
|
||||
</record>
|
||||
|
||||
<record id="deposit_method_online_deposit_capture" model="deposit.method">
|
||||
<field name="name">Online Deposit Capture</field>
|
||||
</record>
|
||||
|
||||
<record id="deposit_method_night_drop" model="deposit.method">
|
||||
<field name="name">Night Drop</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
14
npg_account_make_deposit/deposit_ticket_report.xml
Normal file
14
npg_account_make_deposit/deposit_ticket_report.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<report id="report_deposit_ticket"
|
||||
model="deposit.ticket"
|
||||
auto="False"
|
||||
name="deposit.ticket"
|
||||
file="npg_account_make_deposit/report/deposit_ticket.mako"
|
||||
string="Internal Deposit Ticket"
|
||||
report_type="webkit" />
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
291
npg_account_make_deposit/npg_account_make_deposit.py
Normal file
291
npg_account_make_deposit/npg_account_make_deposit.py
Normal file
@@ -0,0 +1,291 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2011 NovaPoint Group LLC (<http://www.novapointgroup.com>)
|
||||
# Copyright (C) 2004-2010 OpenERP SA (<http://www.openerp.com>)
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
#
|
||||
##############################################################################
|
||||
import time
|
||||
|
||||
from osv import fields, osv
|
||||
from tools.translate import _
|
||||
import decimal_precision as dp
|
||||
|
||||
class deposit_method(osv.osv):
|
||||
_name = "deposit.method"
|
||||
_description = "Deposit Method"
|
||||
_columns = {
|
||||
'name': fields.char('Name', size=64, required=True, help='Name of the method used for deposit')
|
||||
}
|
||||
|
||||
deposit_method()
|
||||
|
||||
class deposit_ticket(osv.osv):
|
||||
_name = "deposit.ticket"
|
||||
_description = "Deposit Ticket"
|
||||
|
||||
def check_group(self, cr, uid, ids, context=None):
|
||||
"""Check if following security constraints are implemented for groups:
|
||||
Make Deposits Preparer – they can create, view and delete any of the Deposit Tickets provided the Deposit Ticket is not in the DONE state,
|
||||
or the Ready for Review state.
|
||||
Make Deposits Verifier – they can create, view, edit, and delete any of the Deposits Tickets information at any time.
|
||||
NOTE: DONE Deposit Tickets are only allowed to be deleted by a Make Deposits Verifier."""
|
||||
model_data_obj = self.pool.get('ir.model.data')
|
||||
res_groups_obj = self.pool.get('res.groups')
|
||||
group_verifier_id = model_data_obj._get_id(cr, uid, 'npg_account_make_deposit', 'group_make_deposits_verifier')
|
||||
for deposit in self.browse(cr, uid, ids, context=context):
|
||||
if group_verifier_id:
|
||||
res_id = model_data_obj.read(cr, uid, [group_verifier_id], ['res_id'])[0]['res_id']
|
||||
group_verifier = res_groups_obj.browse(cr, uid, res_id, context=context)
|
||||
group_user_ids = [user.id for user in group_verifier.users]
|
||||
if deposit.state!='draft' and uid not in group_user_ids:
|
||||
raise osv.except_osv(_('User Error !'),
|
||||
_("Only a member of '%s' group may delete/edit deposit tickets when not in draft state!" %(group_verifier.name)))
|
||||
return True
|
||||
|
||||
def unlink(self, cr, uid, ids, context=None):
|
||||
self.check_group(cr, uid, ids, context) # Check if the user is allowed to perform the action
|
||||
self.remove_all(cr, uid, ids, context=context) # Call the method necessary to remove the changes made earlier
|
||||
return super(deposit_ticket, self).unlink(cr, uid, ids, context=context)
|
||||
|
||||
def write(self, cr, uid, ids, vals, context=None):
|
||||
self.check_group(cr, uid, ids, context) # Check if the user is allowed to perform the action
|
||||
return super(deposit_ticket, self).write(cr, uid, ids, vals, context=context)
|
||||
|
||||
def action_cancel(self, cr, uid, ids, context=None):
|
||||
self.remove_all(cr, uid, ids, context=context) # Call the method necessary to remove the changes made earlier
|
||||
self.write(cr, uid, ids, {'state': 'cancel'}, context=context)
|
||||
return True
|
||||
|
||||
def action_review(self, cr, uid, ids, context=None):
|
||||
self.write(cr, uid, ids, {'state': 'to_be_reviewed',
|
||||
'prepared_by_user_id': uid
|
||||
},
|
||||
context=context)
|
||||
return True
|
||||
|
||||
def action_process(self, cr, uid, ids, context=None):
|
||||
""" Do the following:
|
||||
1.The 'Verifier By' field is populated by the name of the Verifier.
|
||||
2.The 'Deposit Ticket #' field is populated.
|
||||
3.The account.move.lines are updated and written with the 'Deposit Ticket #'
|
||||
4.The status field is updated to “Done”
|
||||
5.New GL entries are made."""
|
||||
move_lines = []
|
||||
for deposit in self.browse(cr, uid, ids, context=context):
|
||||
if not deposit.journal_id.sequence_id:
|
||||
raise osv.except_osv(_('Error !'), _('Please define sequence on deposit journal'))
|
||||
if deposit.journal_id.centralisation:
|
||||
raise osv.except_osv(_('UserError'),
|
||||
_('Cannot create move on centralised journal'))
|
||||
# Create the move lines first
|
||||
move_lines.append((0,0, self.get_move_line(cr, uid, deposit, 'src')))
|
||||
move_lines.append((0, 0, self.get_move_line(cr, uid, deposit, 'dest')))
|
||||
# Create the move for the deposit
|
||||
move = {
|
||||
'ref': deposit.deposit_bag_no,
|
||||
'name': '/',
|
||||
'line_id': move_lines,
|
||||
'journal_id': deposit.journal_id.id,
|
||||
'date': deposit.date,
|
||||
'narration': deposit.deposit_bag_no,
|
||||
'deposit_id': deposit.id
|
||||
}
|
||||
move_id = self.pool.get('account.move').create(cr, uid, move, context=context)
|
||||
# Post the account move
|
||||
self.pool.get('account.move').post(cr, uid, [move_id])
|
||||
# Link the move with the deposit and populate other fields
|
||||
self.write(cr, uid, [deposit.id], {'move_id': move_id,
|
||||
'state': 'done',
|
||||
'verified_by_user_id': uid,
|
||||
'verified_date': time.strftime('%Y-%m-%d')
|
||||
},
|
||||
context=context)
|
||||
return True
|
||||
|
||||
def get_move_line(self, cr, uid, deposit, type, context=None):
|
||||
return {
|
||||
'type': type,
|
||||
'name': deposit.name or '/',
|
||||
'debit': type == 'dest' and deposit.amount or 0.0,
|
||||
'credit': type == 'src' and deposit.amount or 0.0,
|
||||
'account_id': type == 'src' and deposit.deposit_from_account_id.id or deposit.deposit_to_account_id.id,
|
||||
'date': deposit.date,
|
||||
'ref': deposit.deposit_bag_no or '',
|
||||
'deposit_id': deposit.id
|
||||
}
|
||||
|
||||
def remove_all(self, cr, uid, ids, context=None):
|
||||
"""Reset the deposit ticket to draft state,
|
||||
and remove the entries associated with the DONE transactions (
|
||||
account moves, updating account.move.lines, resetting preparer and verifier and verified date fields.
|
||||
Reflect all changes necessary."""
|
||||
account_move_line_obj = self.pool.get('account.move.line')
|
||||
account_move_obj = self.pool.get('account.move')
|
||||
move_line_ids = []
|
||||
vals = {
|
||||
'draft_assigned': False,
|
||||
'deposit_id': False
|
||||
}
|
||||
for deposit in self.browse(cr, uid, ids, context=context):
|
||||
move_line_ids = map(lambda x: x.move_line_id.id, deposit.ticket_line_ids)
|
||||
if deposit.move_id:
|
||||
account_move_obj.button_cancel(cr, uid, [deposit.move_id.id], context=context) # Cancel the posted account move
|
||||
account_move_obj.unlink(cr, uid, [deposit.move_id.id], context=context) # Finally, delete the account move
|
||||
vals['draft_assigned'] = True
|
||||
account_move_line_obj.write(cr, uid, move_line_ids, vals, context=context)
|
||||
return True
|
||||
|
||||
def action_cancel_draft(self, cr, uid, ids, context=None):
|
||||
self.remove_all(cr, uid, ids, context=context) # Call the method necessary to remove the changes made earlier
|
||||
self.write(cr, uid, ids, {'state': 'draft',
|
||||
'verified_by_user_id': False,
|
||||
'verified_date': False,
|
||||
'prepared_by_user_id': False
|
||||
},
|
||||
context=context)
|
||||
return True
|
||||
|
||||
def _get_period(self, cr, uid, context=None):
|
||||
periods = self.pool.get('account.period').find(cr, uid)
|
||||
return periods and periods[0] or False
|
||||
|
||||
def _get_amount(self, cr, uid, ids, name, args, context=None):
|
||||
res = {}
|
||||
for deposit in self.browse(cr, uid, ids, context=context):
|
||||
sum = 0.0
|
||||
for line in deposit.ticket_line_ids:
|
||||
sum += line.amount
|
||||
res[deposit.id] = sum
|
||||
return res
|
||||
|
||||
def _get_count_total(self, cr, uid, ids, name, args, context=None):
|
||||
res = {}
|
||||
for deposit in self.browse(cr, uid, ids, context=context):
|
||||
res[deposit.id] = len(deposit.ticket_line_ids)
|
||||
return res
|
||||
|
||||
_columns = {
|
||||
|
||||
'memo': fields.char('Memo', size=64, states={'done':[('readonly', True)]}, help="Memo for the deposit ticket"),
|
||||
'deposit_to_account_id': fields.many2one('account.account', 'Deposit To Acct', required=True,
|
||||
states={'done':[('readonly', True)]}, domain="[('company_id', '=', company_id), ('type', '!=', 'view')]",
|
||||
help="The Bank/Gl Account the Deposit is being made to."),
|
||||
'deposit_from_account_id': fields.many2one('account.account', 'Deposit From Acct', required=True,
|
||||
states={'done':[('readonly', True)]}, domain="[('company_id', '=', company_id), ('type', '!=', 'view')]",
|
||||
help="The Bank/GL Account the Payments are currently found in."),
|
||||
'date': fields.date('Date of Deposit', required=True, states={'done':[('readonly', True)]}, help="The Date of the Deposit Ticket."),
|
||||
'journal_id': fields.many2one('account.journal', 'Journal', required=True, states={'done':[('readonly', True)]},
|
||||
help="The Journal to hold accounting entries."),
|
||||
'company_id': fields.many2one('res.company', 'Company', required=True, readonly=True,
|
||||
help="The Company for which the deposit ticket is made to"),
|
||||
'period_id': fields.many2one('account.period', 'Force Period', required=True,
|
||||
states={'done':[('readonly', True)]},
|
||||
help="Keep empty to use the period of the validation date.",),
|
||||
'deposit_method_id': fields.many2one('deposit.method', 'Deposit Method', states={'done':[('readonly', True)]},
|
||||
help="This is how the deposit was made: Examples: "\
|
||||
"*Teller \n"
|
||||
"*ATM \n"
|
||||
"*Remote Deposit Capture \n"
|
||||
"*Online Deposit Capture \n"
|
||||
"*Night Drop"),
|
||||
'verified_date': fields.date('Verified Date', states={'done':[('readonly', True)]},
|
||||
help="Date in which Deposit Ticket was verified."),
|
||||
'prepared_by_user_id': fields.many2one('res.users', 'Prepared By', states={'done':[('readonly', True)]},
|
||||
help="Entered automatically by the “last user” who saved it. System generated."),
|
||||
'verified_by_user_id': fields.many2one('res.users', 'Verified By', states={'done':[('readonly', True)]},
|
||||
help="Entered automatically by the “last user” who saved it. System generated."),
|
||||
'deposit_bag_no': fields.char('Deposit Bag No', size=64, states={'done':[('readonly', True)]}, help="Deposit Bag number for courier transit."),
|
||||
'bank_tracking_no': fields.char('Deposit Tracking No', size=64,
|
||||
help="This field is used to hold a tracking number provided by the bank/financial institution "\
|
||||
"often used in Remote Deposit Capture on a deposit receipt. Entered after deposit occurs."),
|
||||
'move_id': fields.many2one('account.move', 'Journal Entry', readonly=True, select=1, help="Link to the automatically generated Journal Items."),
|
||||
'name': fields.related('move_id', 'name', type='char', readonly=True, size=64, relation='account.move',
|
||||
string='Deposit Ticket #', help="Each deposit will have a unique sequence ID. System generated."),
|
||||
'ticket_line_ids': fields.one2many('deposit.ticket.line', 'deposit_id', 'Deposit Ticket Line', states={'done':[('readonly', True)]}),
|
||||
'amount': fields.function(_get_amount, method=True, string='Amount', digits_compute=dp.get_precision('Account'),
|
||||
type='float', help="Calculates the Total of All Deposit Lines – This is the Total Amount of Deposit."),
|
||||
'count_total': fields.function(_get_count_total, method=True, type='float', string='Total Items',
|
||||
help="Counts the total # of line items in the deposit ticket."),
|
||||
'state': fields.selection([
|
||||
('draft','Draft'),
|
||||
('to_be_reviewed','Ready for Review'),
|
||||
('done','Done'),
|
||||
('cancel', 'Cancel')
|
||||
],'State', select=True, readonly=True),
|
||||
}
|
||||
_defaults = {
|
||||
'state': 'draft',
|
||||
'period_id': _get_period,
|
||||
'date': time.strftime('%Y-%m-%d'),
|
||||
'company_id': lambda self, cr, uid, c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id,
|
||||
}
|
||||
_order = "date desc" # the most recent deposits displays first
|
||||
|
||||
def add_deposit_items(self, cr, uid, ids, context=None):
|
||||
"""Display the wizard to allow the 'Deposit Preparer' to select payments for deposit."""
|
||||
if context is None: context = {}
|
||||
return {
|
||||
'name':_("Select Payments for Deposit"),
|
||||
'view_mode': 'form',
|
||||
'view_id': False,
|
||||
'view_type': 'form',
|
||||
'res_model': 'add.deposit.items',
|
||||
'type': 'ir.actions.act_window',
|
||||
'nodestroy': True,
|
||||
'target': 'new',
|
||||
'domain': '[]',
|
||||
'context': dict(context, active_ids=ids)
|
||||
}
|
||||
|
||||
deposit_ticket()
|
||||
|
||||
class deposit_ticket_line(osv.osv):
|
||||
_name = "deposit.ticket.line"
|
||||
_description = "Deposit Ticket Line"
|
||||
_columns = {
|
||||
'name': fields.char('Name', size=64, required=True, help="Derived from the related Journal Item."),
|
||||
'ref': fields.char('Reference', size=64, help="Derived from related Journal Item."),
|
||||
'partner_id': fields.many2one('res.partner', string='Partner', help="Derived from related Journal Item."),
|
||||
'amount': fields.float('Amount', digits_compute=dp.get_precision('Account'),
|
||||
help="Derived from the 'debit' amount from related Journal Item."),
|
||||
'date': fields.date('Date', required=True, help="Derived from related Journal Item."),
|
||||
'deposit_id': fields.many2one('deposit.ticket', 'Deposit Ticket', required=True, ondelete='cascade'),
|
||||
'company_id': fields.related('deposit_id', 'company_id', type='many2one', relation='res.company', string='Company', readonly=True,
|
||||
help="Derived from related Journal Item."),
|
||||
'move_line_id': fields.many2one('account.move.line', 'Journal Item', help="Related Journal Item.")
|
||||
}
|
||||
|
||||
def create(self, cr, uid, vals, context=None):
|
||||
# Any Line cannot be manually added. Use the wizard to add lines.
|
||||
if not vals.get('move_line_id', False):
|
||||
raise osv.except_osv(_('Processing Error'),\
|
||||
_('You cannot add any new deposit ticket line manually as of this revision!' \
|
||||
' Please use the button \"Add Deposit Items\" to add deposit ticket line!'))
|
||||
return super(deposit_ticket_line, self).create(cr, uid, vals, context=context)
|
||||
|
||||
def unlink(self, cr, uid, ids, context=None):
|
||||
"""Set the 'draft_assigned' field to False for related account move
|
||||
lines to allow to be entered for another deposit."""
|
||||
account_move_line_obj = self.pool.get('account.move.line')
|
||||
move_line_ids = [line.move_line_id.id for line in self.browse(cr, uid, ids, context=context)]
|
||||
account_move_line_obj.write(cr, uid, move_line_ids, {'draft_assigned': False}, context=context)
|
||||
return super(deposit_ticket_line, self).unlink(cr, uid, ids, context=context)
|
||||
|
||||
deposit_ticket_line()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
165
npg_account_make_deposit/npg_account_make_deposit_view.xml
Normal file
165
npg_account_make_deposit/npg_account_make_deposit_view.xml
Normal file
@@ -0,0 +1,165 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<!-- Deposit Method -->
|
||||
|
||||
<record id="action_deposit_method" model="ir.actions.act_window">
|
||||
<field name="name">Deposit Method</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">deposit.method</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
|
||||
<menuitem id="menu_deposit_methods"
|
||||
name="Deposit Methods"
|
||||
parent="account.menu_configuration_misc"
|
||||
action="action_deposit_method"
|
||||
sequence="8" />
|
||||
|
||||
<!-- Bank Deposit Ticket -->
|
||||
|
||||
<record id="view_deposit_ticket_tree" model="ir.ui.view">
|
||||
<field name="name">deposit.ticket.tree</field>
|
||||
<field name="model">deposit.ticket</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="priority">2</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Deposit Tickets" colors="grey:state=='cancel';blue:state in ('to_be_reviewed')">
|
||||
<field name="name"/>
|
||||
<field name="date"/>
|
||||
<field name="deposit_from_account_id"/>
|
||||
<field name="deposit_to_account_id"/>
|
||||
<field name="amount"/>
|
||||
<field name="count_total"/>
|
||||
<field name="prepared_by_user_id"/>
|
||||
<field name="verified_by_user_id"/>
|
||||
<field name="state"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_deposit_ticket_form" model="ir.ui.view">
|
||||
<field name="name">deposit.ticket.form</field>
|
||||
<field name="model">deposit.ticket</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Deposit Ticket" version="7.0">
|
||||
<header>
|
||||
<button name="action_cancel" type="object" states="draft,to_be_reviewed" string="Cancel" icon="gtk-cancel"/>
|
||||
<button name="action_review" type="object" states="draft" string="Ready for Review" icon="gtk-go-forward"/>
|
||||
<button name="action_process" type="object" states="to_be_reviewed" string="Process" icon="gtk-apply"/>
|
||||
<button name="action_cancel_draft" states="cancel,done" string="Set to Draft" type="object" icon="gtk-convert"/>
|
||||
<field name="state" widget="statusbar" nolabel="1"/>
|
||||
</header>
|
||||
<sheet>
|
||||
<group col="4" colspan="4">
|
||||
<field name="deposit_from_account_id" placeholder="Enter Account Name (from)"/>
|
||||
<field name="deposit_to_account_id" placeholder="Enter Account Name (to)"/>
|
||||
<field name="journal_id" placeholder="Enter journal name"/>
|
||||
<field name="period_id" placeholder="Enter period"/>
|
||||
<field name="date" placeholder="Enter deposite date"/>
|
||||
<field name="name" />
|
||||
<field name="deposit_bag_no" placeholder="Enter deposit bag no."/>
|
||||
<field name="bank_tracking_no" placeholder="Enter deposit tracking no."/>
|
||||
<field name="deposit_method_id" placeholder="Enter deposit method"/>
|
||||
<field name="memo" placeholder="Enter memo"/>
|
||||
<field name="company_id" groups="base.group_multi_company" placeholder="Enter company Name"/>
|
||||
<group col="2" colspan="2">
|
||||
<button name="add_deposit_items" states="draft,to_be_reviewed" string="Add Deposit Items" type="object" icon="gtk-execute"/>
|
||||
</group>
|
||||
</group>
|
||||
<notebook colspan="5">
|
||||
<page string="Deposit Ticket Lines">
|
||||
<field colspan="4" mode="tree" name="ticket_line_ids" widget="one2many_list" nolabel="1">
|
||||
<tree string="Deposit Ticket Lines">
|
||||
<field name="date"/>
|
||||
<field name="name"/>
|
||||
<field name="ref"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="amount"/>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
</tree>
|
||||
<form string="Deposit Ticket Lines" version="7.0">
|
||||
<group>
|
||||
<field name="name"/>
|
||||
<field name="ref"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="amount"/>
|
||||
<field name="date"/>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
<group name="calculation" col="4" colspan="2">
|
||||
<field name="amount"/>
|
||||
<field name="count_total"/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Other Information">
|
||||
<separator string="Tracking Information" colspan="4"/>
|
||||
<group colspan="2" col="2">
|
||||
<field name="verified_by_user_id" placeholder="Enter user name who varified"/>
|
||||
<field name="prepared_by_user_id" placeholder="Enter user name who prepared"/>
|
||||
<field name="verified_date" placeholder="Enter date of varification"/>
|
||||
</group>
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_deposit_ticket_filter" model="ir.ui.view">
|
||||
<field name="name">deposit.ticket.select</field>
|
||||
<field name="model">deposit.ticket</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Deposit Tickets">
|
||||
<filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Deposit Tickets that haven't yet been confirmed"/>
|
||||
<filter icon="terp-dolar" string="To be Reviewed" domain="[('state','=','to_be_reviewed')]" help="Deposit Tickets that are ready for review"/>
|
||||
<filter icon="terp-check" string="Done" domain="[('state','=','done')]" help="Deposit Tickets that have been processed"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name" select="1"/>
|
||||
<field name="date" select="1" string="Order date" />
|
||||
<field name="journal_id" select="1"/>
|
||||
<field name="deposit_from_account_id" select="1"/>
|
||||
<field name="deposit_to_account_id" select="1"/>
|
||||
<field name="prepared_by_user_id" select="1">
|
||||
<filter domain="[('prepared_by_user_id','=',uid)]" help="Prepared by me" icon="terp-personal"/>
|
||||
</field>
|
||||
<field name="verified_by_user_id" select="1">
|
||||
<filter domain="[('verified_by_user_id','=',uid)]" help="Verified by me" icon="terp-personal"/>
|
||||
</field>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By..." colspan="11" col="11" groups="base.group_extended">
|
||||
<filter string="Deposit From Account" icon="terp-personal" domain="[]" context="{'group_by':'deposit_from_account_id'}"/>
|
||||
<filter string="Deposit To Account" icon="terp-personal" domain="[]" context="{'group_by':'deposit_to_account_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_deposit_ticket" model="ir.actions.act_window">
|
||||
<field name="name">Deposit Ticket</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">deposit.ticket</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="search_view_id" ref="view_deposit_ticket_filter"/>
|
||||
<field name="help">With Deposit Tickets you can create new deposit tickets, by selecting and grouping customer payments, supplier refunds, or other payments into a Deposit Ticket. OpenERP automatically posts accounting entries for “Done” deposit tickets. The GL entry for the deposit is posted into the Current Period based on the date range selected.</field>
|
||||
</record>
|
||||
|
||||
|
||||
<menuitem id="menu_make_deposit_tickets"
|
||||
name="Make Deposits"
|
||||
parent="account.menu_finance_bank_and_cash"
|
||||
groups="group_make_deposits_preparer,group_make_deposits_verifier"
|
||||
action="action_deposit_ticket"
|
||||
sequence="8" />
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
25
npg_account_make_deposit/report/__init__.py
Normal file
25
npg_account_make_deposit/report/__init__.py
Normal file
@@ -0,0 +1,25 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2011 NovaPoint Group LLC (<http://www.novapointgroup.com>)
|
||||
# Copyright (C) 2004-2010 OpenERP SA (<http://www.openerp.com>)
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import deposit_ticket
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
134
npg_account_make_deposit/report/deposit_ticket.mako
Normal file
134
npg_account_make_deposit/report/deposit_ticket.mako
Normal file
@@ -0,0 +1,134 @@
|
||||
<html>
|
||||
<head>
|
||||
<style type="text/css">
|
||||
.tablehead
|
||||
{
|
||||
border:1px solid #C0C0C0;
|
||||
font-weight:bold;
|
||||
}
|
||||
td
|
||||
{
|
||||
border:1px solid #C0C0C0;
|
||||
}
|
||||
|
||||
th
|
||||
{
|
||||
font-weight:bold;
|
||||
text-align: left;
|
||||
}
|
||||
#noborder td
|
||||
{
|
||||
border:none;
|
||||
}
|
||||
#amount
|
||||
{
|
||||
text-align: right;
|
||||
}
|
||||
#company
|
||||
{
|
||||
text-align: center;
|
||||
}
|
||||
h3
|
||||
{
|
||||
font-size: 19px;
|
||||
font-weight:200;
|
||||
}
|
||||
${css}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<%page expression_filter="entity"/>
|
||||
<%
|
||||
def carriage_returns(text):
|
||||
return text.replace('\n', '<br />')
|
||||
|
||||
%>
|
||||
|
||||
%for deposit_ticket in objects:
|
||||
<%setLang(user.context_lang)%>
|
||||
|
||||
|
||||
<h1 style="clear:both;">${deposit_ticket.name or ''}</h1>
|
||||
|
||||
<table class="basic_table" width="100%" cellspacing="0">
|
||||
<tr class="tablehead">
|
||||
<td>${_("Deposit From Account")}</td>
|
||||
<td>${_("Deposit To Account")}</td>
|
||||
<td>${_("Deposit Date")}</td>
|
||||
<td>${_("Journal")}</td>
|
||||
<td>${_("Force Period")}</td>
|
||||
<td>${_("Company ID")}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>${deposit_ticket.deposit_from_account_id.name}</td>
|
||||
<td>${deposit_ticket.deposit_to_account_id.name}</td>
|
||||
<td>${formatLang(deposit_ticket.date, date=True)}</td>
|
||||
<td>${deposit_ticket.journal_id and deposit_ticket.journal_id.name}</td>
|
||||
<td>${deposit_ticket.period_id.name}</td>
|
||||
<td>${deposit_ticket.company_id and deposit_ticket.company_id.name or ''}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br/>
|
||||
<table class="basic_table" width="100%" cellspacing="0">
|
||||
<tr class="tablehead">
|
||||
<td>${_("Deposit Method")}</td>
|
||||
<td>${_("Deposit Bag No")}</td>
|
||||
<td>${_("Deposit Tracking No")}</td>
|
||||
<td>${_("Total Items")}</td>
|
||||
<td>${_("Amount")}</td>
|
||||
<td>${_("Memo")}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>${deposit_ticket.deposit_method_id and deposit_ticket.deposit_method_id.name or ''}</td>
|
||||
<td>${deposit_ticket.deposit_bag_no or ''}</td>
|
||||
<td>${deposit_ticket.bank_tracking_no or ''}</td>
|
||||
<td class="amount">${formatLang(deposit_ticket.count_total)}</td>
|
||||
<td class="amount">${formatLang(deposit_ticket.amount)}</td>
|
||||
<td>${deposit_ticket.memo or ''}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br/>
|
||||
<table class="basic_table" width="100%" cellspacing="0">
|
||||
<tr class="tablehead">
|
||||
<td>${_("Prepared By")}</td>
|
||||
<td>${_("Verified By")}</td>
|
||||
<td>${_("Verified Date")}</td>
|
||||
<td>${_("State")}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>${deposit_ticket.prepared_by_user_id and deposit_ticket.prepared_by_user_id.name or ''}</td>
|
||||
<td>${deposit_ticket.verified_by_user_id and deposit_ticket.verified_by_user_id.name or ''}</td>
|
||||
<td>${formatLang(deposit_ticket.verified_date or '',date=True)}</td>
|
||||
<td>${deposit_ticket.state or ''}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br/>
|
||||
|
||||
<h3>Deposit Ticket Line</h3>
|
||||
|
||||
<table class="list_table" width="100%" style="margin-top: 20px;" cellspacing="0" >
|
||||
<tr>
|
||||
<th>${_("Date")}</th>
|
||||
<th>${_("Name")}</th>
|
||||
<th>${_("Ref")}</th>
|
||||
<th>${_("Customer")}</th>
|
||||
<th class="amount">${_("Amount")}</th>
|
||||
<th class="company">${_("Company ID")}</th>
|
||||
</tr>
|
||||
%for line in deposit_ticket.ticket_line_ids:
|
||||
<tr id="noborder">
|
||||
<td> ${formatLang(line.date, date=True)}</td>
|
||||
<td> ${line.name}</td>
|
||||
<td> ${line.ref or ''}</td>
|
||||
<td> ${line.partner_id.name or ''}</td>
|
||||
<td class="amount"> ${formatLang(line.amount or '')}</td>
|
||||
<td class="company"> ${line.company_id.name or ''}</td>
|
||||
</tr>
|
||||
%endfor
|
||||
</table>
|
||||
<br/>
|
||||
%endfor
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
42
npg_account_make_deposit/report/deposit_ticket.py
Normal file
42
npg_account_make_deposit/report/deposit_ticket.py
Normal file
@@ -0,0 +1,42 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2011 NovaPoint Group LLC (<http://www.novapointgroup.com>)
|
||||
# Copyright (C) 2004-2010 OpenERP SA (<http://www.openerp.com>)
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
#
|
||||
##############################################################################
|
||||
import time
|
||||
|
||||
from report import report_sxw
|
||||
from osv import osv
|
||||
|
||||
#Enter Report Class Information Here
|
||||
class deposit_ticket_webkit(report_sxw.rml_parse):
|
||||
def __init__(self, cr, uid, name, context):
|
||||
super(deposit_ticket_webkit, self).__init__(cr, uid, name, context=context)
|
||||
self.localcontext.update({
|
||||
'time': time,
|
||||
'cr':cr,
|
||||
'uid': uid,
|
||||
})
|
||||
|
||||
report_sxw.report_sxw('report.deposit.ticket.webkit',
|
||||
'deposit.ticket',
|
||||
'addons/deposit_ticket_report_webkit/report/deposit_ticket.mako',
|
||||
parser=deposit_ticket_webkit)
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
7
npg_account_make_deposit/security/ir.model.access.csv
Normal file
7
npg_account_make_deposit/security/ir.model.access.csv
Normal file
@@ -0,0 +1,7 @@
|
||||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
||||
"access_deposit_ticket_preparer","access.deposit.ticket.preparer","model_deposit_ticket","group_make_deposits_preparer",1,1,1,1
|
||||
"access_deposit_ticket_verifier","access.deposit.ticket.verifier","model_deposit_ticket","group_make_deposits_verifier",1,1,1,1
|
||||
"access_deposit_ticket_line_preparer","access.deposit.ticket.line.preparer","model_deposit_ticket_line","group_make_deposits_preparer",1,1,1,1
|
||||
"access_deposit_ticket_line_verifier","access.deposit.ticket.line.verifier","model_deposit_ticket_line","group_make_deposits_verifier",1,0,0,0
|
||||
"access_deposit_method_user","access.deposit.method.user","model_deposit_method","account.group_account_user",1,0,0,0
|
||||
"access_deposit_method_manager","access.deposit.method.manager","model_deposit_method","account.group_account_manager",1,1,1,1
|
||||
|
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<!-- Groups - Make Deposits Preparer , Make Deposits Verifier -->
|
||||
|
||||
<record id="group_make_deposits_preparer" model="res.groups">
|
||||
<field name="name">Make Deposits Preparer</field>
|
||||
</record>
|
||||
|
||||
<record id="group_make_deposits_verifier" model="res.groups">
|
||||
<field name="name">Make Deposits Verifier</field>
|
||||
</record>
|
||||
|
||||
<!-- Security Rule for Deposit Tickets -->
|
||||
|
||||
<record id="npg_account_make_deposits_comp_rule" model="ir.rule">
|
||||
<field name="name">Deposit Tickets</field>
|
||||
<field ref="model_deposit_ticket" name="model_id"/>
|
||||
<field eval="True" name="global"/>
|
||||
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
24
npg_account_make_deposit/wizard/__init__.py
Normal file
24
npg_account_make_deposit/wizard/__init__.py
Normal file
@@ -0,0 +1,24 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2011 NovaPoint Group LLC (<http://www.novapointgroup.com>)
|
||||
# Copyright (C) 2004-2010 OpenERP SA (<http://www.openerp.com>)
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
#
|
||||
##############################################################################
|
||||
import add_deposit_items
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
131
npg_account_make_deposit/wizard/add_deposit_items.py
Normal file
131
npg_account_make_deposit/wizard/add_deposit_items.py
Normal file
@@ -0,0 +1,131 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2011 NovaPoint Group LLC (<http://www.novapointgroup.com>)
|
||||
# Copyright (C) 2004-2010 OpenERP SA (<http://www.openerp.com>)
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
#
|
||||
##############################################################################
|
||||
from osv import fields, osv
|
||||
from tools.translate import _
|
||||
import decimal_precision as dp
|
||||
|
||||
class add_deposit_items(osv.osv_memory):
|
||||
_name = "add.deposit.items"
|
||||
_description = "Add Deposit Items"
|
||||
_columns = {
|
||||
'name': fields.char('Name', size=64),
|
||||
'deposit_items_line_ids': fields.one2many('deposit.items.line', 'deposit_items_id', 'Lines')
|
||||
}
|
||||
|
||||
def default_get(self, cr, uid, fields, context=None):
|
||||
deposit_ticket_obj = self.pool.get('deposit.ticket')
|
||||
account_move_line_obj = self.pool.get('account.move.line')
|
||||
account_move = self.pool.get('account.move')
|
||||
result = []
|
||||
res = super(add_deposit_items, self).default_get(cr, uid, fields, context=context)
|
||||
for deposit in deposit_ticket_obj.browse(cr, uid, context.get('active_ids', []), context=context):
|
||||
# Filter all the move lines which are:
|
||||
#1.Account.move.lines that are a member of the Deposit From GL Account and are Debits
|
||||
#2.State of the move_id == Posted
|
||||
#3.The Deposit Ticket # value is blank (null) not assigned
|
||||
#4.The account move line is not a member of another Draft/To Be Review (this is the list (one2many) of
|
||||
#debit transactions displayed on the selected Account (Undeposited Funds Acct) including this account.
|
||||
move_ids = account_move.search(cr, uid, [('state', '=', 'posted')], context=context)
|
||||
line_ids = account_move_line_obj.search(cr, uid, [('account_id', '=', deposit.deposit_from_account_id.id),
|
||||
('debit', '>', 0.0),
|
||||
('move_id', 'in', move_ids),
|
||||
('draft_assigned', '=', False),
|
||||
('deposit_id', '=', False)
|
||||
],
|
||||
context=context)
|
||||
for line in account_move_line_obj.browse(cr, uid, line_ids, context=context):
|
||||
result.append({'name': line.name,
|
||||
'ref': line.ref,
|
||||
'amount': line.debit,
|
||||
'partner_id': line.partner_id.id,
|
||||
'date': line.date,
|
||||
'move_line_id': line.id,
|
||||
'company_id':line.company_id.id
|
||||
})
|
||||
if 'deposit_items_line_ids' in fields:
|
||||
res.update({'deposit_items_line_ids': result})
|
||||
return res
|
||||
|
||||
def select_all(self, cr, uid, ids, context=None):
|
||||
"""Select all the deposit item lines in the wizard."""
|
||||
deposit_items_line_obj = self.pool.get('deposit.items.line')
|
||||
deposit_ticket_item = self.browse(cr, uid, ids[0], context=context)
|
||||
line_ids = deposit_items_line_obj.search(cr, uid, [('deposit_items_id', '=', deposit_ticket_item.id)], context=context)
|
||||
deposit_items_line_obj.write(cr, uid, line_ids, {'draft_assigned': True}, context=context)
|
||||
return True
|
||||
|
||||
def unselect_all(self, cr, uid, ids, context=None):
|
||||
"""Unselect all the deposit item lines in the wizard."""
|
||||
deposit_items_line_obj = self.pool.get('deposit.items.line')
|
||||
deposit_ticket_item = self.browse(cr, uid, ids[0], context=context)
|
||||
line_ids = deposit_items_line_obj.search(cr, uid, [('deposit_items_id', '=', deposit_ticket_item.id)], context=context)
|
||||
deposit_items_line_obj.write(cr, uid, line_ids, {'draft_assigned': False}, context=context)
|
||||
return True
|
||||
|
||||
def add_deposit_lines(self, cr, uid, ids, context=None):
|
||||
"""Add Deposit Items Lines as Deposit Ticket Lines for the deposit."""
|
||||
deposit_ticket_obj = self.pool.get('deposit.ticket')
|
||||
account_move_line_obj = self.pool.get('account.move.line')
|
||||
deposit_ticket_line_obj = self.pool.get('deposit.ticket.line')
|
||||
deposit_ticket_item = self.browse(cr, uid, ids[0], context=context)
|
||||
for deposit in deposit_ticket_obj.browse(cr, uid, context.get('active_ids', []), context=context):
|
||||
# Add the deposit ticket item lines which have 'draft_assigned' checked
|
||||
valid_items_line_ids = [line for line in deposit_ticket_item.deposit_items_line_ids if line.draft_assigned]
|
||||
move_line_ids = []
|
||||
for line in valid_items_line_ids:
|
||||
# Any Line cannot be manually added. Choose only from the selected lines.
|
||||
if not line.move_line_id:
|
||||
raise osv.except_osv(_('Processing Error'),\
|
||||
_ ('You cannot add any new deposit line item manually as of this revision!'))
|
||||
res_id = deposit_ticket_line_obj.create(cr, uid, {'name': line.name,
|
||||
'ref': line.ref,
|
||||
'amount': line.amount,
|
||||
'partner_id': line.partner_id.id,
|
||||
'date': line.date,
|
||||
'move_line_id': line.move_line_id.id,
|
||||
'company_id': line.company_id.id,
|
||||
'deposit_id': deposit.id
|
||||
},
|
||||
context=context)
|
||||
move_line_ids.append(line.move_line_id.id)
|
||||
account_move_line_obj.write(cr, uid, move_line_ids, {'draft_assigned': True}, context=context)
|
||||
return {'type': 'ir.actions.act_window_close'}
|
||||
|
||||
add_deposit_items()
|
||||
|
||||
class deposit_items_line(osv.osv_memory):
|
||||
_name = "deposit.items.line"
|
||||
_description = "Deposit Items Line"
|
||||
_columns = {
|
||||
'name': fields.char('Name', size=64),
|
||||
'ref': fields.char('Reference', size=64),
|
||||
'partner_id': fields.many2one('res.partner', 'Partner'),
|
||||
'date': fields.date('Date', required=True),
|
||||
'amount': fields.float('Amount', digits_compute=dp.get_precision('Account')),
|
||||
'draft_assigned': fields.boolean('Select'),
|
||||
'deposit_items_id': fields.many2one('add.deposit.items', 'Deposit Items ID'),
|
||||
'move_line_id': fields.many2one('account.move.line', 'Journal Item'),
|
||||
'company_id': fields.many2one('res.company', 'Company'),
|
||||
}
|
||||
|
||||
deposit_items_line()
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
55
npg_account_make_deposit/wizard/add_deposit_items_view.xml
Normal file
55
npg_account_make_deposit/wizard/add_deposit_items_view.xml
Normal file
@@ -0,0 +1,55 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<!-- Add Deposit Items -->
|
||||
<record id="view_add_deposit_items" model="ir.ui.view">
|
||||
<field name="name">Add Deposit Items</field>
|
||||
<field name="model">add.deposit.items</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Select Payments for Deposit" version="7.0" >
|
||||
<header>
|
||||
<button name="select_all" string="_Select All" type="object" icon="gtk-apply"/>
|
||||
<button name="unselect_all" string="_Unselect All" type="object" icon="gtk-cancel"/>
|
||||
<button special="cancel" string="_Cancel" icon="gtk-cancel"/>
|
||||
<button name="add_deposit_lines" string="_OK" type="object" icon="gtk-apply"/>
|
||||
</header>
|
||||
<sheet>
|
||||
<field colspan="4" mode="tree" name="deposit_items_line_ids" nolabel="1" widget="one2many_list" width="550">
|
||||
<tree string="Select Payments to Deposit" editable="top">
|
||||
<field name="draft_assigned"/>
|
||||
<field name="date"/>
|
||||
<field name="name"/>
|
||||
<field name="ref"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="amount"/>
|
||||
<field name="move_line_id"/>
|
||||
</tree>
|
||||
<form string="Select Payments to Deposit" version="7.0">
|
||||
<group>
|
||||
<field name="date"/>
|
||||
<field name="name"/>
|
||||
<field name="ref"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="amount"/>
|
||||
<field name="move_line_id"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_view_add_deposit_items" model="ir.actions.act_window">
|
||||
<field name="name">Add Deposit Items</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">add.deposit.items</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="view_add_deposit_items"/>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
1
npg_bank_account_reconciliation/Change Log.txt
Normal file
1
npg_bank_account_reconciliation/Change Log.txt
Normal file
@@ -0,0 +1 @@
|
||||
1.7 Rima - Fixed the rounding on the float fields
|
||||
26
npg_bank_account_reconciliation/__init__.py
Normal file
26
npg_bank_account_reconciliation/__init__.py
Normal file
@@ -0,0 +1,26 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2011 NovaPoint Group LLC (<http://www.novapointgroup.com>)
|
||||
# Copyright (C) 2004-2010 OpenERP SA (<http://www.openerp.com>)
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import npg_bank_account_reconciliation
|
||||
import account_move_line
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
110
npg_bank_account_reconciliation/__openerp__.py
Normal file
110
npg_bank_account_reconciliation/__openerp__.py
Normal file
@@ -0,0 +1,110 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2011 NovaPoint Group LLC (<http://www.novapointgroup.com>)
|
||||
# Copyright (C) 2004-2010 OpenERP SA (<http://www.openerp.com>)
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
#
|
||||
##############################################################################
|
||||
{
|
||||
'name': 'Bank Account Reconciliation',
|
||||
'version': '1.7',
|
||||
'category': 'Accounting and Financial Management',
|
||||
'description': """
|
||||
|
||||
This module is designed to provide an easy method in which OpenERP accounting users can manually reconcile/validate their financial transactions from their financial institution/transaction providers (e.g. Paypal, A financial institution, google wallet, etc) against OpenERP GL Chart of Account bank accounts.
|
||||
|
||||
Users will be able to validate and indicate if a transaction has "Cleared the Bank" using a checkmark on a new Reconcile Financial Account Statement view on each individual financial transaction. Users will also be able to mark transactions on a bank account for future research.
|
||||
|
||||
The idea is that as a first step users will manually look at their paper statement and line-by-line check off which financial transactions have cleared the bank in OpenERP using the new Bank Reconciliation Wizard. These changes will be displayed on the new Reconcile Financial Account Statement tree view screen. This is the process in which many companies reconcile (aka Audit) their bank account statements and accounting system today and represents good segregation of duties
|
||||
|
||||
Users can save their in-process reconciliations.
|
||||
|
||||
BACKGROUND
|
||||
Using the search view filters - users will also be able to effectively sort, filter the transactions on a particular GL Financial Account. This new screen will display the journal items associated with a particular bank account. Several of the field labels have been relabeled to a more common vernacular.
|
||||
|
||||
(Future) Phase II of the project - will extend this module to include a wizard to pre-filter the tree view, and include additional reports for accountants. And include the ability to execute quick entry of common statement related transactions such as recording bank service fees (an Expense), and Interest Income Earned on the bank account (Income), when allowed by law. Often, companies will print their reconciliation, staple it to their bank statement and file the documents for future review and audit.
|
||||
|
||||
(Future) Phase III of the project will extend this module to include more information to add further clarity throughout OpenERP for financial transactions, and include the ability to quickly compare an imported bank statement with a GL Bank Account's recorded transaction, including autoreconciling them - and providing the information available for review
|
||||
|
||||
The need for this module is driven by the following:
|
||||
OpenERP's default functionality doesn't support the typical "BANK" account reconciliation process found in many countries (e.g. the US)
|
||||
Users want to easily record whether bank transactions sent to their bank have "cleared the bank"- definition of "cleared the bank": presented to the bank for payment and paid by the bank - added/subtracted funds on a bank account.
|
||||
Users want the ability to validate if the bank processed the transactions them correctly (e.g. properly encoded transaction - e.g. company sent a payment of $20.20 to the bank. Was it processed for $20.20?). This can be considered "Auditing the bank statement". We don't assume the bank correctly processed any transaction.
|
||||
Users want to understand what payments they've made are still outstanding and have not been paid by the bank.
|
||||
The financial auditing segregation standard of separating the duties of: recording customer payments and making deposits; recording supplier payments and writing checks; and monitoring bank account activity. This segregation of duties is necessary to monitor and help prevent fraud.
|
||||
|
||||
Assumptions:
|
||||
1.Companies using OpenERP have setup a One-to-one relationship between their bank accounts and their OpenERP GL accounts. Each bank account should have a corresponding GL account that is not shared with another account.
|
||||
|
||||
Example:
|
||||
|
||||
OpenERP GL Account # Corresponding Bank Account
|
||||
10100 Bank (AR) Account Checking 5434 (held at Institution A)
|
||||
10200 Master Bank Account 2343 (held at Institution A)
|
||||
10300 Bank Payable Account Checking 5678 (held at Institution A)
|
||||
10400 Bank Payroll Account 6656 (held at Institution B)
|
||||
10500 Paypal Account 3343 (held at Paypal)
|
||||
10600 Google Wallet Account 6788
|
||||
10700 AMEX Corporate Card Account 9989
|
||||
|
||||
|
||||
2.Companies have included a Non-Deposited Funds Account in their GL account (typically in current assets in their bank account areas). This account is used to store payments that have been recorded in OpenERP - but not yet deposited into the financial institution. (NOTE: this account is important to have if the user "batches check deposits"- which is the process of making a large single deposits of customer payment into the bank (e.g. $20,000USD), but it is made up of smaller checks (e.g. 20 checks of $1,000 each). Many banks just record the total deposit amount ($20,000) and don¬タルt provide the breakdown of the individual checks that make up the larger deposit. This setup approach enables users to drill down and see the individual checks that make up a larger deposit.
|
||||
|
||||
Recommendations:
|
||||
From a cash management and financial control perspective it is recommended that users establish the following four(4) bank accounts at their financial institution at a minimum to handle financial transactions. (NOTE: we recommend users place the last 4 digits of their bank account in the GL account name of the account. It helps accountants in their management of the system):
|
||||
|
||||
Bank (AR) Account Checking 5434
|
||||
This is a checking account designated as the account where payments made to the company are deposited (e.g. a customer payment made by check is deposited here, or a customer paying by electronic transaction EFT/ACH is deposited into this GL).
|
||||
|
||||
Master Bank Account 2343
|
||||
This is the master account in which the company keeps the majority of their funds. Often with the most limited access.
|
||||
|
||||
Bank Payable Account Checking 5678
|
||||
This is a checking account designated for the company to pay their expenses from. (e.g. Company writes a check to pay a supplier for their office supplies).
|
||||
|
||||
Bank Payroll Account 6656
|
||||
This is a checking account designated for a company to pay their employees and payroll.
|
||||
|
||||
|
||||
NOTE: There has been common confusion in the OpenERP community about managing bank statements in the base OpenERP system. This module hopes to alleviate this gap and provide users with a sound alternative to maintain fiscal control, be easy to understand, and allow for future growth.
|
||||
|
||||
Why this approach? Users in OpenERP have several options in which to record financial transactions that affect the balances of a bank account (GL Bank Account entries). We believe our approach allows these to work in conjunction with each other: Import Electronic Bank Statements to enter payments (this approach follows the philosophy that you first find out that a transaction has occurred from your bank ¬タモ which is very common in Europe due to the electronic nature of transactions).
|
||||
Payment Order Payments (using the direct Method) - Payments are instantly recorded and financial transactions posted into the GL
|
||||
Voucher Payments - Payments are instantly recorded and financial transactions posted into the GL
|
||||
Sales Receipts/Refunds
|
||||
Transfers between accounts (a new module is being developed to help manage this)
|
||||
Funds moved from the Undeposited Funds GL account to a Bank Account GL account.
|
||||
Direct Journal Entries
|
||||
""",
|
||||
'author': 'NovaPoint Group LLC',
|
||||
'website': ' http://www.novapointgroup.com',
|
||||
'depends': ['account_voucher'],
|
||||
'init_xml': [],
|
||||
'update_xml': ["security/npg_bank_account_reconciliation_security.xml",
|
||||
"security/ir.model.access.csv",
|
||||
"npg_bank_account_reconciliation_view.xml",
|
||||
"account_move_line_view.xml"],
|
||||
'demo_xml': [],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
}
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
||||
|
||||
|
||||
37
npg_bank_account_reconciliation/account_move_line.py
Normal file
37
npg_bank_account_reconciliation/account_move_line.py
Normal file
@@ -0,0 +1,37 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2011 NovaPoint Group LLC (<http://www.novapointgroup.com>)
|
||||
# Copyright (C) 2004-2010 OpenERP SA (<http://www.openerp.com>)
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from osv import fields,osv
|
||||
|
||||
class account_move_line(osv.osv):
|
||||
_inherit='account.move.line'
|
||||
|
||||
_columns = {
|
||||
'cleared_bank_account': fields.boolean('Cleared? ', help='Check if the transaction has cleared from the bank'),
|
||||
'bank_acc_rec_statement_id': fields.many2one('bank.acc.rec.statement', 'Bank Acc Rec Statement', help="The Bank Acc Rec Statement linked with the journal item"),
|
||||
'draft_assigned_to_statement': fields.boolean('Assigned to Statement? ', help='Check if the move line is assigned to statement lines')
|
||||
}
|
||||
|
||||
|
||||
account_move_line()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
40
npg_bank_account_reconciliation/account_move_line_view.xml
Normal file
40
npg_bank_account_reconciliation/account_move_line_view.xml
Normal file
@@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<!--- Journal Items -->
|
||||
|
||||
<record id="view_account_move_line_bank_acc_rec_statement_id" model="ir.ui.view">
|
||||
<field name="name">account.move.line.bank.acc.rec.statement.id</field>
|
||||
<field name="model">account.move.line</field>
|
||||
<field name="inherit_id" ref="account.view_account_move_line_filter"/>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<field name="period_id" position="after">
|
||||
<field name="bank_acc_rec_statement_id"/>
|
||||
</field>
|
||||
<field name="move_id" position="before">
|
||||
<filter icon="terp-document-new" string="Uncleared Bank Account" domain="[('cleared_bank_account','=',False)]" help="Journal Entries not cleared"/>
|
||||
<separator orientation="vertical"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_account_move_line_bank_acc_rec_statement_id_form" model="ir.ui.view">
|
||||
<field name="name">account.move.line.bank.acc.rec.statement.id.form</field>
|
||||
<field name="model">account.move.line</field>
|
||||
<field name="inherit_id" ref="account.view_move_line_form"/>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<field name="statement_id" position="after">
|
||||
<field name="bank_acc_rec_statement_id"/>
|
||||
</field>
|
||||
<field name="blocked" position="after">
|
||||
<field name="cleared_bank_account"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -0,0 +1,320 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2011 NovaPoint Group LLC (<http://www.novapointgroup.com>)
|
||||
# Copyright (C) 2004-2010 OpenERP SA (<http://www.openerp.com>)
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
#
|
||||
##############################################################################
|
||||
import time
|
||||
|
||||
from osv import fields, osv
|
||||
from tools.translate import _
|
||||
import decimal_precision as dp
|
||||
|
||||
class bank_acc_rec_statement(osv.osv):
|
||||
def check_group(self, cr, uid, ids, context=None):
|
||||
"""Check if following security constraints are implemented for groups:
|
||||
Bank Statement Preparer– they can create, view and delete any of the Bank Statements provided the Bank Statement is not in the DONE state,
|
||||
or the Ready for Review state.
|
||||
Bank Statement Verifier – they can create, view, edit, and delete any of the Bank Statements information at any time.
|
||||
NOTE: DONE Bank Statements are only allowed to be deleted by a Bank Statement Verifier."""
|
||||
model_data_obj = self.pool.get('ir.model.data')
|
||||
res_groups_obj = self.pool.get('res.groups')
|
||||
group_verifier_id = model_data_obj._get_id(cr, uid, 'npg_bank_account_reconciliation', 'group_bank_stmt_verifier')
|
||||
for statement in self.browse(cr, uid, ids, context=context):
|
||||
if group_verifier_id:
|
||||
res_id = model_data_obj.read(cr, uid, [group_verifier_id], ['res_id'])[0]['res_id']
|
||||
group_verifier = res_groups_obj.browse(cr, uid, res_id, context=context)
|
||||
group_user_ids = [user.id for user in group_verifier.users]
|
||||
if statement.state!='draft' and uid not in group_user_ids:
|
||||
raise osv.except_osv(_('User Error !'),
|
||||
_("Only a member of '%s' group may delete/edit bank statements when not in draft state!" %(group_verifier.name)))
|
||||
return True
|
||||
|
||||
def copy(self, cr, uid, id, default={}, context=None):
|
||||
default.update({
|
||||
'credit_move_line_ids': [],
|
||||
'debit_move_line_ids': [],
|
||||
'name': '',
|
||||
})
|
||||
return super(bank_acc_rec_statement, self).copy(cr, uid, id, default=default, context=context)
|
||||
|
||||
def write(self, cr, uid, ids, vals, context=None):
|
||||
self.check_group(cr, uid, ids, context) # Check if the user is allowed to perform the action
|
||||
return super(bank_acc_rec_statement, self).write(cr, uid, ids, vals, context=context)
|
||||
|
||||
def unlink(self, cr, uid, ids, context=None):
|
||||
"Reset the related account.move.line to be re-assigned later to statement."
|
||||
statement_line_obj = self.pool.get('bank.acc.rec.statement.line')
|
||||
self.check_group(cr, uid, ids, context) # Check if the user is allowed to perform the action
|
||||
for statement in self.browse(cr, uid, ids, context=context):
|
||||
statement_lines = statement.credit_move_line_ids + statement.debit_move_line_ids
|
||||
statement_line_ids = map(lambda x: x.id, statement_lines)
|
||||
statement_line_obj.unlink(cr, uid, statement_line_ids, context=context) # call unlink method to reset
|
||||
return super(bank_acc_rec_statement, self).unlink(cr, uid, ids, context=context)
|
||||
|
||||
def check_difference_balance(self, cr, uid, ids, context=None):
|
||||
"Check if difference balance is zero or not."
|
||||
for statement in self.browse(cr, uid, ids, context=context):
|
||||
if statement.difference != 0.0:
|
||||
raise osv.except_osv(_('Warning!'),
|
||||
_("Prior to reconciling a statement, all differences must be accounted for and the Difference balance must be zero." \
|
||||
" Please review and make necessary changes."))
|
||||
return True
|
||||
|
||||
def action_cancel(self, cr, uid, ids, context=None):
|
||||
"Cancel the the statement."
|
||||
self.write(cr, uid, ids, {'state': 'cancel'}, context=context)
|
||||
return True
|
||||
|
||||
def action_review(self, cr, uid, ids, context=None):
|
||||
"Change the status of statement from 'draft' to 'to_be_reviewed'."
|
||||
# If difference balance not zero prevent further processing
|
||||
self.check_difference_balance(cr, uid, ids, context=context)
|
||||
self.write(cr, uid, ids, {'state': 'to_be_reviewed'}, context=context)
|
||||
return True
|
||||
|
||||
def action_process(self, cr, uid, ids, context=None):
|
||||
"""Set the account move lines as 'Cleared' and Assign 'Bank Acc Rec Statement ID'
|
||||
for the statement lines which are marked as 'Cleared'."""
|
||||
account_move_line_obj = self.pool.get('account.move.line')
|
||||
statement_line_obj = self.pool.get('bank.acc.rec.statement.line')
|
||||
# If difference balance not zero prevent further processing
|
||||
self.check_difference_balance(cr, uid, ids, context=context)
|
||||
for statement in self.browse(cr, uid, ids, context=context):
|
||||
statement_lines = statement.credit_move_line_ids + statement.debit_move_line_ids
|
||||
for statement_line in statement_lines:
|
||||
#Mark the move lines as 'Cleared'mand assign the 'Bank Acc Rec Statement ID'
|
||||
account_move_line_obj.write(cr, uid, [statement_line.move_line_id.id],
|
||||
{'cleared_bank_account': statement_line.cleared_bank_account,
|
||||
'bank_acc_rec_statement_id': statement_line.cleared_bank_account and statement.id or False
|
||||
}, context=context)
|
||||
|
||||
self.write(cr, uid, [statement.id], {'state': 'done',
|
||||
'verified_by_user_id': uid,
|
||||
'verified_date': time.strftime('%Y-%m-%d')
|
||||
}, context=context)
|
||||
return True
|
||||
|
||||
def action_cancel_draft(self, cr, uid, ids, context=None):
|
||||
"""Reset the statement to draft and perform resetting operations."""
|
||||
account_move_line_obj = self.pool.get('account.move.line')
|
||||
statement_line_obj = self.pool.get('bank.acc.rec.statement.line')
|
||||
for statement in self.browse(cr, uid, ids, context=context):
|
||||
statement_lines = statement.credit_move_line_ids + statement.debit_move_line_ids
|
||||
line_ids = []
|
||||
statement_line_ids = []
|
||||
for statement_line in statement_lines:
|
||||
statement_line_ids.append(statement_line.id)
|
||||
line_ids.append(statement_line.move_line_id.id) # Find move lines related to statement lines
|
||||
|
||||
# Reset 'Cleared' and 'Bank Acc Rec Statement ID' to False
|
||||
account_move_line_obj.write(cr, uid, line_ids, {'cleared_bank_account': False,
|
||||
'bank_acc_rec_statement_id': False,
|
||||
}, context=context)
|
||||
# Reset 'Cleared' in statement lines
|
||||
statement_line_obj.write(cr, uid, statement_line_ids, {'cleared_bank_account': False,
|
||||
'research_required': False
|
||||
}, context=context)
|
||||
# Reset statement
|
||||
self.write(cr, uid, [statement.id], {'state': 'draft',
|
||||
'verified_by_user_id': False,
|
||||
'verified_date': False
|
||||
}, context=context)
|
||||
|
||||
return True
|
||||
|
||||
def action_select_all(self, cr, uid, ids, context=None):
|
||||
"""Mark all the statement lines as 'Cleared'."""
|
||||
statement_line_obj = self.pool.get('bank.acc.rec.statement.line')
|
||||
for statement in self.browse(cr, uid, ids, context=context):
|
||||
statement_lines = statement.credit_move_line_ids + statement.debit_move_line_ids
|
||||
statement_line_ids = map(lambda x: x.id, statement_lines)
|
||||
statement_line_obj.write(cr, uid, statement_line_ids, {'cleared_bank_account': True}, context=context)
|
||||
return True
|
||||
|
||||
def action_unselect_all(self, cr, uid, ids, context=None):
|
||||
"""Reset 'Cleared' in all the statement lines."""
|
||||
statement_line_obj = self.pool.get('bank.acc.rec.statement.line')
|
||||
for statement in self.browse(cr, uid, ids, context=context):
|
||||
statement_lines = statement.credit_move_line_ids + statement.debit_move_line_ids
|
||||
statement_line_ids = map(lambda x: x.id, statement_lines)
|
||||
statement_line_obj.write(cr, uid, statement_line_ids, {'cleared_bank_account': False}, context=context)
|
||||
return True
|
||||
|
||||
def _get_balance(self, cr, uid, ids, name, args, context=None):
|
||||
"""Computed as following:
|
||||
A) Deposits, Credits, and Interest Amount: Total SUM of Amts of lines with Cleared = True
|
||||
Deposits, Credits, and Interest # of Items: Total of number of lines with Cleared = True
|
||||
B) Checks, Withdrawals, Debits, and Service Charges Amount:
|
||||
Checks, Withdrawals, Debits, and Service Charges Amount # of Items:
|
||||
Cleared Balance (Total Sum of the Deposit Amount Cleared (A) – Total Sum of Checks Amount Cleared (B))
|
||||
Difference= (Ending Balance – Beginning Balance) - cleared balance = should be zero.
|
||||
"""
|
||||
res = {}
|
||||
account_precision = self.pool.get('decimal.precision').precision_get(cr, uid, 'Account')
|
||||
for statement in self.browse(cr, uid, ids, context=context):
|
||||
res[statement.id] = {
|
||||
'sum_of_credits': 0.0,
|
||||
'sum_of_debits': 0.0,
|
||||
'cleared_balance': 0.0,
|
||||
'difference': 0.0,
|
||||
'sum_of_credits_lines': 0.0,
|
||||
'sum_of_debits_lines': 0.0
|
||||
}
|
||||
for line in statement.credit_move_line_ids:
|
||||
res[statement.id]['sum_of_credits'] += line.cleared_bank_account and round(line.amount, account_precision) or 0.0
|
||||
res[statement.id]['sum_of_credits_lines'] += line.cleared_bank_account and 1.0 or 0.0
|
||||
for line in statement.debit_move_line_ids:
|
||||
res[statement.id]['sum_of_debits'] += line.cleared_bank_account and round(line.amount, account_precision) or 0.0
|
||||
res[statement.id]['sum_of_debits_lines'] += line.cleared_bank_account and 1.0 or 0.0
|
||||
|
||||
res[statement.id]['cleared_balance'] = round(res[statement.id]['sum_of_debits'] - res[statement.id]['sum_of_credits'], account_precision)
|
||||
res[statement.id]['difference'] = round((statement.ending_balance - statement.starting_balance) - res[statement.id]['cleared_balance'], account_precision)
|
||||
return res
|
||||
|
||||
def onchange_account_id(self, cr, uid, ids, account_id, ending_date, suppress_ending_date_filter, context=None):
|
||||
account_move_line_obj = self.pool.get('account.move.line')
|
||||
statement_line_obj = self.pool.get('bank.acc.rec.statement.line')
|
||||
val = {'value': {'credit_move_line_ids': [], 'debit_move_line_ids': []}}
|
||||
if account_id:
|
||||
for statement in self.browse(cr, uid, ids, context=context):
|
||||
statement_line_ids = statement_line_obj.search(cr, uid, [('statement_id', '=', statement.id)], context=context)
|
||||
# call unlink method to reset and remove existing statement lines and
|
||||
# mark reset field values in related move lines
|
||||
statement_line_obj.unlink(cr, uid, statement_line_ids, context=context)
|
||||
|
||||
# Apply filter on move lines to allow
|
||||
#1. credit and debit side journal items in posted state of the selected GL account
|
||||
#2. Journal items which are not assigned to previous bank statements
|
||||
#3. Date less than or equal to ending date provided the 'Suppress Ending Date Filter' is not checkec
|
||||
domain = [('account_id', '=', account_id), ('move_id.state', '=', 'posted'), ('cleared_bank_account', '=', False), ('draft_assigned_to_statement', '=', False)]
|
||||
if not suppress_ending_date_filter:
|
||||
domain += [('date', '<=', ending_date)]
|
||||
line_ids = account_move_line_obj.search(cr, uid, domain, context=context)
|
||||
for line in account_move_line_obj.browse(cr, uid, line_ids, context=context):
|
||||
res = {
|
||||
'ref': line.ref,
|
||||
'date': line.date,
|
||||
'partner_id': line.partner_id.id,
|
||||
'currency_id': line.currency_id.id,
|
||||
'amount': line.credit or line.debit,
|
||||
'name': line.name,
|
||||
'move_line_id': line.id,
|
||||
'type': line.credit and 'cr' or 'dr'
|
||||
}
|
||||
if res['type'] == 'cr':
|
||||
val['value']['credit_move_line_ids'].append(res)
|
||||
else:
|
||||
val['value']['debit_move_line_ids'].append(res)
|
||||
return val
|
||||
|
||||
_name = "bank.acc.rec.statement"
|
||||
_columns = {
|
||||
'name': fields.char('Name', required=True, size=64, states={'done':[('readonly', True)]}, help="This is a unique name identifying the statement (e.g. Bank X January 2012)."),
|
||||
'account_id': fields.many2one('account.account', 'Account', required=True,
|
||||
states={'done':[('readonly', True)]}, domain="[('company_id', '=', company_id), ('type', '!=', 'view')]",
|
||||
help="The Bank/Gl Account that is being reconciled."),
|
||||
'ending_date': fields.date('Ending Date', required=True, states={'done':[('readonly', True)]}, help="The ending date of your bank statement."),
|
||||
'starting_balance': fields.float('Starting Balance', required=True, digits_compute=dp.get_precision('Account'), help="The Starting Balance on your bank statement.", states={'done':[('readonly', True)]}),
|
||||
'ending_balance': fields.float('Ending Balance', required=True, digits_compute=dp.get_precision('Account'), help="The Ending Balance on your bank statement.", states={'done':[('readonly', True)]}),
|
||||
'company_id': fields.many2one('res.company', 'Company', required=True, readonly=True,
|
||||
help="The Company for which the deposit ticket is made to"),
|
||||
'notes': fields.text('Notes'),
|
||||
'verified_date': fields.date('Verified Date', states={'done':[('readonly', True)]},
|
||||
help="Date in which Deposit Ticket was verified."),
|
||||
'verified_by_user_id': fields.many2one('res.users', 'Verified By', states={'done':[('readonly', True)]},
|
||||
help="Entered automatically by the “last user” who saved it. System generated."),
|
||||
'credit_move_line_ids': fields.one2many('bank.acc.rec.statement.line', 'statement_id', 'Credits',
|
||||
domain=[('type','=','cr')], context={'default_type':'cr'}, states={'done':[('readonly', True)]}),
|
||||
'debit_move_line_ids': fields.one2many('bank.acc.rec.statement.line', 'statement_id', 'Debits',
|
||||
domain=[('type','=','dr')], context={'default_type':'dr'}, states={'done':[('readonly', True)]}),
|
||||
'cleared_balance': fields.function(_get_balance, method=True, string='Cleared Balance', digits_compute=dp.get_precision('Account'),
|
||||
type='float', help="Total Sum of the Deposit Amount Cleared – Total Sum of Checks, Withdrawals, Debits, and Service Charges Amount Cleared",
|
||||
multi="balance"),
|
||||
'difference': fields.function(_get_balance, method=True, type='float', string='Difference', digits_compute=dp.get_precision('Account'),
|
||||
help="(Ending Balance – Beginning Balance) - Cleared Balance.", multi="balance"),
|
||||
'sum_of_credits': fields.function(_get_balance, method=True, string='Checks, Withdrawals, Debits, and Service Charges Amount', digits_compute=dp.get_precision('Account'),
|
||||
type='float', help="Total SUM of Amts of lines with Cleared = True",
|
||||
multi="balance"),
|
||||
'sum_of_debits': fields.function(_get_balance, method=True, type='float', string='Deposits, Credits, and Interest Amount', digits_compute=dp.get_precision('Account'),
|
||||
help="Total SUM of Amts of lines with Cleared = True", multi="balance"),
|
||||
'sum_of_credits_lines': fields.function(_get_balance, method=True, string='Checks, Withdrawals, Debits, and Service Charges # of Items',
|
||||
type='float', help="Total of number of lines with Cleared = True",
|
||||
multi="balance"),
|
||||
'sum_of_debits_lines': fields.function(_get_balance, method=True, type='float', string='Deposits, Credits, and Interest # of Items',
|
||||
help="Total of number of lines with Cleared = True", multi="balance"),
|
||||
'suppress_ending_date_filter': fields.boolean('Remove Ending Date Filter', help="If this is checked then the Statement End Date filter on the transactions below will not occur. All transactions would come over."),
|
||||
'state': fields.selection([
|
||||
('draft','Draft'),
|
||||
('to_be_reviewed','Ready for Review'),
|
||||
('done','Done'),
|
||||
('cancel', 'Cancel')
|
||||
],'State', select=True, readonly=True),
|
||||
}
|
||||
_defaults = {
|
||||
'state': 'draft',
|
||||
'company_id': lambda self, cr, uid, c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id,
|
||||
'ending_date': time.strftime('%Y-%m-%d'),
|
||||
}
|
||||
_order = "ending_date desc"
|
||||
_sql_constraints = [
|
||||
('name_company_uniq', 'unique (name, company_id, account_id)', 'The name of the statement must be unique per company and G/L account!')
|
||||
]
|
||||
bank_acc_rec_statement()
|
||||
|
||||
class bank_acc_rec_statement_line(osv.osv):
|
||||
_name = "bank.acc.rec.statement.line"
|
||||
_description = "Statement Line"
|
||||
_columns = {
|
||||
'name': fields.char('Name', size=64, help="Derived from the related Journal Item.", required=True),
|
||||
'ref': fields.char('Reference', size=64, help="Derived from related Journal Item."),
|
||||
'partner_id': fields.many2one('res.partner', string='Partner', help="Derived from related Journal Item."),
|
||||
'amount': fields.float('Amount', digits_compute=dp.get_precision('Account'),
|
||||
help="Derived from the 'debit' amount from related Journal Item."),
|
||||
'date': fields.date('Date', required=True, help="Derived from related Journal Item."),
|
||||
'statement_id': fields.many2one('bank.acc.rec.statement', 'Statement', required=True, ondelete='cascade'),
|
||||
'move_line_id': fields.many2one('account.move.line', 'Journal Item', help="Related Journal Item."),
|
||||
'cleared_bank_account': fields.boolean('Cleared? ', help='Check if the transaction has cleared from the bank'),
|
||||
'research_required': fields.boolean('Research Required? ', help='Check if the transaction should be researched by Accounting personal'),
|
||||
'currency_id': fields.many2one('res.currency', 'Currency', help="The optional other currency if it is a multi-currency entry."),
|
||||
'type':fields.selection([('dr','Debit'),('cr','Credit')], 'Cr/Dr'),
|
||||
}
|
||||
|
||||
def create(self, cr, uid, vals, context=None):
|
||||
account_move_line_obj = self.pool.get('account.move.line')
|
||||
# Prevent manually adding new statement line.
|
||||
# This would allow only onchange method to pre-populate statement lines based on the filter rules.
|
||||
if not vals.get('move_line_id', False):
|
||||
raise osv.except_osv(_('Processing Error'),\
|
||||
_('You cannot add any new bank statement line manually as of this revision!'))
|
||||
account_move_line_obj.write(cr, uid, [vals['move_line_id']], {'draft_assigned_to_statement': True}, context=context)
|
||||
return super(bank_acc_rec_statement_line, self).create(cr, uid, vals, context=context)
|
||||
|
||||
def unlink(self, cr, uid, ids, context=None):
|
||||
account_move_line_obj = self.pool.get('account.move.line')
|
||||
move_line_ids = map(lambda x: x.move_line_id.id, self.browse(cr, uid, ids, context=context))
|
||||
# Reset field values in move lines to be added later
|
||||
account_move_line_obj.write(cr, uid, move_line_ids, {'draft_assigned_to_statement': False,
|
||||
'cleared_bank_account': False,
|
||||
'bank_acc_rec_statement_id': False,
|
||||
}, context=context)
|
||||
return super(bank_acc_rec_statement_line, self).unlink(cr, uid, ids, context=context)
|
||||
|
||||
bank_acc_rec_statement_line()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -0,0 +1,195 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<!-- Bank Account Reconciliation Statement -->
|
||||
|
||||
<record id="view_bank_acc_rec_statement_tree" model="ir.ui.view">
|
||||
<field name="name">bank.acc.rec.statement.tree</field>
|
||||
<field name="model">bank.acc.rec.statement</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="priority">2</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Bank Account Reconciliation Statements" colors="grey:state=='cancel';blue:state in ('to_be_reviewed')">
|
||||
<field name="name"/>
|
||||
<field name="ending_date"/>
|
||||
<field name="account_id"/>
|
||||
<field name="verified_by_user_id"/>
|
||||
<field name="state"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_bank_acc_rec_statement_form" model="ir.ui.view">
|
||||
<field name="name">bank.acc.rec.statement.form</field>
|
||||
<field name="model">bank.acc.rec.statement</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Bank Account Reconciliation Statement" version="7.0">
|
||||
<header>
|
||||
<button name="action_cancel" type="object" states="draft,to_be_reviewed" string="Cancel" icon="gtk-cancel"/>
|
||||
<button name="action_review" type="object" states="draft" string="Ready for Review" icon="gtk-go-forward"/>
|
||||
<button name="action_process" type="object" states="to_be_reviewed" string="Process" icon="gtk-apply"/>
|
||||
<button name="action_cancel_draft" states="cancel,done" string="Set to Draft" type="object" icon="gtk-convert"/>
|
||||
<field name="state" widget="statusbar" nolabel="1"/>
|
||||
</header>
|
||||
<sheet>
|
||||
<group col="4" colspan="4">
|
||||
<field name="account_id" placeholder="Enter Account Name" on_change="onchange_account_id(account_id, ending_date, suppress_ending_date_filter)"/>
|
||||
<field name="name" placeholder="Enter Name"/>
|
||||
<field name="ending_date" placeholder="Enter ending date" on_change="onchange_account_id(account_id, ending_date, suppress_ending_date_filter)"/>
|
||||
<field name="starting_balance" placeholder="Enter Starting Balance"/>
|
||||
<field name="ending_balance" placeholder="Enter Ending Balance"/>
|
||||
<field name="company_id" groups="base.group_multi_company" placeholder="Enter Company Name"/>
|
||||
<field name="suppress_ending_date_filter" on_change="onchange_account_id(account_id, ending_date, suppress_ending_date_filter)"/>
|
||||
</group>
|
||||
<notebook colspan="5">
|
||||
<page string="Journal Items">
|
||||
<field colspan="4" mode="tree" name="debit_move_line_ids" nolabel="1" widget="one2many_list" height="300">
|
||||
<form string="Deposits, Credits, and Interest" version="7.0">
|
||||
<field name="cleared_bank_account"/>
|
||||
<field name="date"/>
|
||||
<field name="name"/>
|
||||
<field name="ref"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="amount"/>
|
||||
<field name="currency_id"/>
|
||||
<field name="research_required"/>
|
||||
</form>
|
||||
<tree string="Deposits, Credits, and Interest" editable="top">
|
||||
<field name="cleared_bank_account"/>
|
||||
<field name="date"/>
|
||||
<field name="name"/>
|
||||
<field name="ref"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="amount"/>
|
||||
<field name="currency_id"/>
|
||||
<field name="research_required"/>
|
||||
<field name="move_line_id"/>
|
||||
</tree>
|
||||
</field>
|
||||
<field colspan="4" mode="tree" name="credit_move_line_ids" nolabel="1" widget="one2many_list" height="300">
|
||||
<form string="Checks, Withdrawals, Debits, and Service Charges" version="7.0">
|
||||
<field name="cleared_bank_account"/>
|
||||
<field name="date"/>
|
||||
<field name="name"/>
|
||||
<field name="ref"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="amount"/>
|
||||
<field name="currency_id"/>
|
||||
<field name="research_required"/>
|
||||
</form>
|
||||
<tree string="Checks, Withdrawals, Debits, and Service Charges" editable="top">
|
||||
<field name="cleared_bank_account"/>
|
||||
<field name="date"/>
|
||||
<field name="name"/>
|
||||
<field name="ref"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="amount"/>
|
||||
<field name="currency_id"/>
|
||||
<field name="research_required"/>
|
||||
<field name="move_line_id"/>
|
||||
</tree>
|
||||
</field>
|
||||
<group col="2" colspan="1" groups="npg_bank_account_reconciliation.group_bank_stmt_verifier">
|
||||
<button name="action_select_all" type="object" states="draft,to_be_reviewed" string="Select All" icon="gtk-go-forward"/>
|
||||
<button name="action_unselect_all" type="object" states="draft,to_be_reviewed" string="Unselect All" icon="gtk-cancel"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group name="calculation1" col="2" colspan="2">
|
||||
<separator string="Totals Area" colspan="2"/>
|
||||
<field name="sum_of_debits"/>
|
||||
<field name="sum_of_debits_lines"/>
|
||||
<field name="sum_of_credits"/>
|
||||
<field name="sum_of_credits_lines"/>
|
||||
</group>
|
||||
<group name="calculation2" col="1" colspan="2">
|
||||
<separator string="Balance Area"/>
|
||||
<field name="cleared_balance"/>
|
||||
<field name="difference"/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Other Information">
|
||||
<separator string="Tracking Information" colspan="4"/>
|
||||
<group colspan="2" col="2">
|
||||
<field name="verified_by_user_id" placeholder="Enter user whoever varified"/>
|
||||
</group>
|
||||
<group colspan="2" col="2">
|
||||
<field name="verified_date" placeholder="Enter date of varification"/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Notes">
|
||||
<field name="notes" nolabel="1" placeholder="Enter notes about reconciliation"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_bank_acc_rec_statement_filter" model="ir.ui.view">
|
||||
<field name="name">bank.acc.rec.statement.select</field>
|
||||
<field name="model">bank.acc.rec.statement</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Bank Account Reconciliation Statements">
|
||||
<filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Statements that haven't yet been confirmed"/>
|
||||
<filter icon="terp-dolar" string="To be Reviewed" domain="[('state','=','to_be_reviewed')]" help="Statements that are ready for review"/>
|
||||
<filter icon="terp-check" string="Done" domain="[('state','=','done')]" help="Statements that have been processed"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name" select="1"/>
|
||||
<field name="ending_date" select="1" string="Ending Date" />
|
||||
<field name="account_id" select="1"/>
|
||||
<field name="verified_by_user_id" select="1">
|
||||
<filter domain="[('verified_by_user_id','=',uid)]" help="Verified by me" icon="terp-personal"/>
|
||||
</field>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By..." colspan="11" col="11" groups="base.group_extended">
|
||||
<filter string="Account" icon="terp-personal" domain="[]" context="{'group_by':'account_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_bank_acc_rec_statement" model="ir.actions.act_window">
|
||||
<field name="name">Reconcile Bank Account and Statement</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">bank.acc.rec.statement</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="search_view_id" ref="view_bank_acc_rec_statement_filter"/>
|
||||
</record>
|
||||
|
||||
<menuitem
|
||||
icon="STOCK_JUSTIFY_FILL"
|
||||
action="action_bank_acc_rec_statement"
|
||||
id="npg_bank_acc_rec_statement_menu"
|
||||
parent="account.menu_finance_bank_and_cash"
|
||||
sequence="5"/>
|
||||
|
||||
<act_window
|
||||
id="act_account_move_line_to_add"
|
||||
name="Journal Items"
|
||||
res_model="account.move.line"
|
||||
src_model="bank.acc.rec.statement"/>
|
||||
|
||||
<act_window
|
||||
id="act_supplier_payment_to_add"
|
||||
name="Supplier Payment"
|
||||
domain="[('journal_id.type', 'in', ['bank', 'cash']), ('type','=','receipt')]"
|
||||
context="{'type':'payment'}"
|
||||
res_model="account.voucher"
|
||||
src_model="bank.acc.rec.statement"/>
|
||||
|
||||
<act_window
|
||||
id="act_customer_payment_to_add"
|
||||
name="Customer Payment"
|
||||
domain="[('journal_id.type', 'in', ['bank', 'cash']), ('type','=','receipt')]"
|
||||
context="{'type':'receipt'}"
|
||||
res_model="account.voucher"
|
||||
src_model="bank.acc.rec.statement"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -0,0 +1,5 @@
|
||||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
||||
"access_bank_acc_rec_statement_preparer","access.bank.acc.rec.statement.preparer","model_bank_acc_rec_statement","group_bank_stmt_preparer",1,1,1,1
|
||||
"access_bank_acc_rec_statement_verifier","access.bank.acc.rec.statement.verifier","model_bank_acc_rec_statement","group_bank_stmt_verifier",1,1,1,1
|
||||
"access_bank_acc_rec_statement_line_preparer","access.bank.acc.rec.statement.line.preparer","model_bank_acc_rec_statement_line","group_bank_stmt_preparer",1,1,1,1
|
||||
"access_bank_acc_rec_statement_line_verifier","access.bank.acc.rec.statement.line.verifier","model_bank_acc_rec_statement_line","group_bank_stmt_verifier",1,1,1,1
|
||||
|
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<!-- Groups - Bank Stmt Preparer , Bank Stmt Verifier -->
|
||||
|
||||
<record id="group_bank_stmt_preparer" model="res.groups">
|
||||
<field name="name">Bank Statement Preparer</field>
|
||||
</record>
|
||||
|
||||
<record id="group_bank_stmt_verifier" model="res.groups">
|
||||
<field name="name">Bank Statement Verifier</field>
|
||||
</record>
|
||||
|
||||
<!-- Security Rule for Bank Rec Stmts -->
|
||||
|
||||
<record id="npg_bank_account_reconciliation_comp_rule" model="ir.rule">
|
||||
<field name="name">Bank Statements</field>
|
||||
<field ref="model_bank_acc_rec_statement" name="model_id"/>
|
||||
<field eval="True" name="global"/>
|
||||
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
Reference in New Issue
Block a user