Purnendu Singh (OpenERP) has proposed merging
lp:~openerp-dev/openobject-addons/trunk-overdue_payment_report into
lp:openobject-addons.
Requested reviews:
OpenERP Core Team (openerp)
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-overdue_payment_report/+merge/104727
Hello,
Now due date of invoice will calculate based on date of invoice or today if
empty.
Improve Overdue payment report, if there is no amount due it should not print
overdue message and show something that there is nothing due with this partner.
Fix a small problem in account_followup default assignment.
Thanks,
Purnendu Singh
--
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-overdue_payment_report/+merge/104727
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-addons/trunk-overdue_payment_report.
=== modified file 'account/account_invoice.py'
--- account/account_invoice.py 2012-04-03 10:58:01 +0000
+++ account/account_invoice.py 2012-05-04 12:36:20 +0000
@@ -467,14 +467,17 @@
return result
def onchange_payment_term_date_invoice(self, cr, uid, ids, payment_term_id, date_invoice):
+ res = {}
if not payment_term_id:
- return {}
- res = {}
- pt_obj = self.pool.get('account.payment.term')
+ if date_invoice:
+ res = {'value':{'date_due': date_invoice}}
+ else:
+ res = {'value':{'date_due': time.strftime('%Y-%m-%d')}}
+ return res
if not date_invoice:
date_invoice = time.strftime('%Y-%m-%d')
- pterm_list = pt_obj.compute(cr, uid, payment_term_id, value=1, date_ref=date_invoice)
+ pterm_list = self.pool.get('account.payment.term').compute(cr, uid, payment_term_id, value=1, date_ref=date_invoice)
if pterm_list:
pterm_list = [line[0] for line in pterm_list]
=== modified file 'account/company.py'
--- account/company.py 2012-04-02 07:52:37 +0000
+++ account/company.py 2012-05-04 12:36:20 +0000
@@ -39,10 +39,10 @@
_defaults = {
'expects_chart_of_accounts': True,
- 'overdue_msg': '''Our records indicate that the following payments are still due. If the amount
-has already been paid, please disregard this notice. However, if you have any
-queries regarding your account, please contact us.
-Thank you in advance.
+ 'overdue_msg': '''Our records indicate that the payments on your account are still due. Please find details below.
+ If the amount has already been paid, please disregard this notice. Otherwise, please forward us
+ the total amount stated below. If you have any queries regarding your account, Please contact us.
+ \nThank you in advance for your cooperation.
'''
}
=== modified file 'account/report/account_print_overdue.rml'
--- account/report/account_print_overdue.rml 2011-12-22 15:17:58 +0000
+++ account/report/account_print_overdue.rml 2012-05-04 12:36:20 +0000
@@ -153,25 +153,26 @@
<para style="terp_default_9">
<font color="white"> </font>
</para>
- <para style="terp_default_9">Dear Sir/Madam,</para>
- <para style="terp_default_9">
- <font color="white"> </font>
- </para>
- <para style="terp_default_9">
- <font color="white"> </font>
- </para>
- <para style="terp_default_9">[[ message(o, company) ]]</para>
- <para style="terp_default_9">
- <font color="white"> </font>
- </para>
- <para style="terp_default_9">Best regards.</para>
- <para style="terp_default_9">
- <font color="white"> </font>
- </para>
- <blockTable colWidths="57.0,136.0,51.0,72.0,54.0,56.0,66.0,18.0" style="Table1">
+ <para style="terp_default_9">[[ not getLines(o) and removeParentNode('para') or 'Dear Sir/Madam,']]</para>
+ <para style="terp_default_9">
+ <font color="white"> </font>
+ </para>
+ <para style="terp_default_9">[[ not getLines(o) and removeParentNode('para') or message(o, company) ]]</para>
+ <para style="terp_default_9">
+ <font color="white"> </font>
+ </para>
+ <para style="terp_default_Bold_9">[[ getLines(o) and removeParentNode('para') or 'There is nothing due with this customer.']]</para>
+ <para style="terp_default_9">
+ <font color="white"> </font>
+ </para>
+ <para style="terp_default_9">[[ not getLines(o) and removeParentNode('para') or 'Best regards.']]</para>
+ <para style="terp_default_9">
+ <font color="white"> </font>
+ </para>
+ <blockTable colWidths="56.0,136.0,51.0,72.0,54.0,56.0,66.0,18.0" style="Table1">
<tr>
<td>
- <para style="terp_tblheader_Details">Date</para>
+ <para style="terp_tblheader_Details">Date[[ not getLines(o) and removeParentNode('blockTable') ]]</para>
</td>
<td>
<para style="terp_tblheader_Details">Description</para>
@@ -198,7 +199,7 @@
</blockTable>
<section>
<para style="terp_default_8">[[repeatIn(getLines(o), 'line') ]]</para>
- <blockTable colWidths="57.0,136.0,52.0,71.0,55.0,56.0,66.0,17.0" style="Table3">
+ <blockTable colWidths="56.0,136.0,52.0,71.0,55.0,56.0,66.0,17.0" style="Table3">
<tr>
<td>
<para style="terp_default_9">[[ formatLang(line['date'],date=True) ]]</para>
@@ -219,7 +220,7 @@
<para style="terp_default_Right_9">[[ (line['account_id']['type'] == 'receivable' and formatLang(line['credit']) or 0) or (line['account_id']['type'] == 'payable' and formatLang(line['debit'] * -1) or 0) ]]</para>
</td>
<td>
- <para style="terp_default_Right_9">[[ time.strftime('%Y-%m-%d') > formatLang((line['date_maturity'])) and formatLang(line['debit'] - line['credit']) ]] [[ company.currency_id.symbol ]] </para>
+ <para style="terp_default_Right_9">[[ time.strftime('%Y-%m-%d') > formatLang((line['date_maturity'])) and formatLang(line['debit'] - line['credit']) ]] [[ company.currency_id.symbol ]]</para>
</td>
<td>
<para style="terp_default_Centre_9">[[ line['blocked'] and 'X' or '' ]]</para>
@@ -227,7 +228,7 @@
</tr>
</blockTable>
</section>
- <blockTable colWidths="245.0,71.0,56.0,56.0,66.0,17.0" style="Table2">
+ <blockTable colWidths="244.0,71.0,56.0,56.0,66.0,17.0" style="Table2">
<tr>
<td>
<para style="terp_default_8">
@@ -235,7 +236,7 @@
</para>
</td>
<td>
- <para style="terp_default_Bold_9">Sub-Total : </para>
+ <para style="terp_default_Bold_9">[[ not getLines(o) and removeParentNode('blockTable') or 'Sub-Total :']]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang((reduce(lambda x, y: x + ((y['account_id']['type'] == 'receivable' and y['debit'] or 0) or (y['account_id']['type'] == 'payable' and y['credit'] * -1 or 0)), getLines(o), 0))) ]] </para>
@@ -244,7 +245,7 @@
<para style="terp_default_Right_9">[[ formatLang((reduce(lambda x, y: x + ((y['account_id']['type'] == 'receivable' and y['credit'] or 0) or (y['account_id']['type'] == 'payable' and y['debit'] * -1 or 0)), getLines(o), 0))) ]] </para>
</td>
<td>
- <para style="terp_default_Right_9">[[ formatLang((reduce(lambda x, y: x + (y['debit'] - y['credit']), filter(lambda x: x['date_maturity'] < time.strftime('%Y-%m-%d'), getLines(o)), 0)), currency_obj=company.currency_id) ]]</para>
+ <para style="terp_default_Right_9">[[ formatLang((reduce(lambda x, y: x + (y['debit'] - y['credit']), filter(lambda x: x['date_maturity'] < time.strftime('%Y-%m-%d'), getLines(o)), 0))) ]] [[ company.currency_id.symbol ]]</para>
</td>
<td>
<para style="terp_default_9">
@@ -261,10 +262,10 @@
</para>
</td>
<td>
- <para style="terp_default_Bold_9">Balance : </para>
+ <para style="terp_default_Bold_9">[[ not getLines(o) and removeParentNode('blockTable') or 'Balance :']]</para>
</td>
<td>
- <para style="terp_tblheader_Details_Right">[[ formatLang((reduce(lambda x, y: x +(y['debit'] - y['credit']), getLines(o), 0)), currency_obj=company.currency_id) ]]</para>
+ <para style="terp_tblheader_Details_Right">[[ formatLang((reduce(lambda x, y: x +(y['debit'] - y['credit']), getLines(o), 0))) ]] [[ company.currency_id.symbol ]]</para>
</td>
<td>
<para style="terp_default_8">
@@ -279,7 +280,7 @@
<para style="terp_default_9">
<font color="white"> </font>
</para>
- <para style="terp_default_9">Total amount due: [[ formatLang((reduce(lambda x, y: x + (y['debit'] - y['credit']), getLines(o), 0)), currency_obj=company.currency_id) ]].</para>
+ <para style="terp_default_9">Total amount due: [[ not getLines(o) and removeParentNode('blockTable') or formatLang((reduce(lambda x, y: x + (y['debit'] - y['credit']), getLines(o), 0)), currency_obj=company.currency_id) ]].</para>
<para style="terp_default_8">
<font color="white"> </font>
</para>
=== modified file 'account/report/account_print_overdue.sxw'
Binary files account/report/account_print_overdue.sxw 2011-12-21 09:55:12 +0000 and account/report/account_print_overdue.sxw 2012-05-04 12:36:20 +0000 differ
=== modified file 'account_followup/account_followup.py'
--- account_followup/account_followup.py 2012-02-23 09:24:24 +0000
+++ account_followup/account_followup.py 2012-05-04 12:36:20 +0000
@@ -82,7 +82,7 @@
}
_defaults = {
- 'overdue_msg': '''
+ 'follow_up_msg': '''
Date: %(date)s
Dear %(partner_name)s,
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp