From b67274ad60342231ddc7acfe294ecc57f5a2b7ff Mon Sep 17 00:00:00 2001 From: qdp <> Date: Mon, 2 Jun 2008 13:19:37 +0000 Subject: [PATCH] *bugfixed: the partners displayed on the report wasn't good (tiny at work were written every where) *when the wizard is run, all the invoices receive now a value for latest followup date and followup level (accordingly to the level of the account_move_line) *the email sending is implemented. The email is structured as the report *added a column for maturity date, in Financial Mngt\Periodical Processing\send followup\all receivable *in the many2many of the wizard in Financial Mngt\Periodical Processing\send followup, added a filter per account type == receivable bzr revid: qdp-f86c47df2d708c074e43717eb3f7441fe0247fac --- addons/account_followup/followup_view.xml | 25 +-- addons/account_followup/report/rappel.rml | 141 ++++++++-------- .../report/report_followup_print.py | 10 +- .../wizard/wizard_followup_print.py | 158 +++++++++++++++--- 4 files changed, 227 insertions(+), 107 deletions(-) diff --git a/addons/account_followup/followup_view.xml b/addons/account_followup/followup_view.xml index 827ddfa512c..0dcb563c53b 100644 --- a/addons/account_followup/followup_view.xml +++ b/addons/account_followup/followup_view.xml @@ -37,8 +37,8 @@ account_followup.followup form - @@ -54,9 +54,9 @@ Send followups account_followup.followup.print.all - @@ -79,6 +79,7 @@ + @@ -107,7 +108,7 @@ - + - - diff --git a/addons/account_followup/report/rappel.rml b/addons/account_followup/report/rappel.rml index c7a6d1e038e..328e9645e5b 100644 --- a/addons/account_followup/report/rappel.rml +++ b/addons/account_followup/report/rappel.rml @@ -14,7 +14,7 @@ - + @@ -27,7 +27,7 @@ - + @@ -35,26 +35,26 @@ - - - - - + + + + + - - - - - - - + + + + + + + - - + + - + @@ -64,156 +64,158 @@ - [[ repeatIn(ids_to_objects(data['form']['partner_ids'][0][2]),'o') ]] [[ setLang(o.lang) ]] + [[ repeatIn(ids_to_objects(data['form']['partner_ids']),'o') ]] [[ setLang(o.lang) ]] - + - [[ o.name ]] - [[ adr_get(o, 'invoice')['name'] ]] - [[ adr_get(o, 'invoice')['street'] ]] - [[ adr_get(o, 'invoice')['zip'] ]] [[ adr_get(o, 'invoice')['city'] ]] - [[ adr_get(o, 'invoice')['country_id'][1] ]] - + [[ o.name ]] + [[ repeatIn(adr_get(o,'invoice'),'a' )]] + [[ a['name'] ]] + [[ a['street'] ]] + [[ a['zip'] ]] + [[ a['city'] ]] + [[( a['country_id'] and a['country_id'][1]) or '']] + - VAT: [[ o.vat or removeParentNode('para') ]] + VAT: [[ o.vat or removeParentNode('para') ]] - + - + - Document: Customer account statement - + Document: Customer account statement + Date: [[ time.strftime('%d/%m/%Y') ]] - Customer Ref: [[ o.ref ]] - + Customer Ref: [[ o.id ]] + - Dear Sir/Madam, - + Dear Sir/Madam, + - Exception made if there was a mistake of ours, it seems that the following bills staid unpaid. Please, take appropriate measures in order to carry out this payment in the next 8 days. - + Exception made if there was a mistake of ours, it seems that the following bills staid unpaid. Please, take appropriate measures in order to carry out this payment in the next 8 days. + - Would your payment have been carried out after this mail was sent, please consider the present one as void. Do not hesitate to contact our accounting departement at (+32).10.68.94.39. - + Would your payment have been carried out after this mail was sent, please consider the present one as void. Do not hesitate to contact our accounting departement at (+32).10.68.94.39. + - Best regards. + Best regards. - + - Date + Date - Description + Description - Ref + Ref - Maturity date + Maturity date - Due + Due - Paid + Paid - Maturity + Maturity - Li. + Li. - + [[repeatIn(getLines(o), 'line') ]] [[ line['date'] ]] - [[ line['name'] ]] + [[ line['name'] ]] - [[ line['ref'] ]] + [[ line['ref'] ]] - [[ line['date_maturity'] ]] + [[ line['date_maturity'] ]] - [[ line['debit'] and '%.2f' % line['debit'] or '' ]] + [[ line['debit'] and '%.2f' % line['debit'] or '' ]] - [[ line['credit'] and '%.2f' % line['credit'] or '' ]] + [[ line['credit'] and '%.2f' % line['credit'] or '' ]] - [[ (line['date_maturity'] < time.strftime('%Y-%m-%d')) and (line['debit'] - line['credit']) or '' ]] + [[ (line['date_maturity'] < time.strftime('%Y-%m-%d')) and (line['debit'] - line['credit']) or '' ]] - [[ line['blocked'] and 'X' or '' ]] + [[ line['blocked'] and 'X' or '' ]] - + - Sub-Total: + Sub-Total: - [[ '%.2f' % (reduce(lambda x,y: x+y['debit'], getLines(o), 0)) ]] + [[ '%.2f' % (reduce(lambda x,y: x+y['debit'], getLines(o), 0)) ]] - + [[ '%.2f' % (reduce(lambda x,y: x+y['credit'], getLines(o), 0)) ]] - [[ reduce(lambda x,y: x+(y['debit'] - y['credit']), filter(lambda x: x['date_maturity'] < time.strftime('%Y-%m-%d'), getLines(o)), 0) ]] + [[ reduce(lambda x,y: x+(y['debit'] - y['credit']), filter(lambda x: x['date_maturity'] < time.strftime('%Y-%m-%d'), getLines(o)), 0) ]] - + - Balance: + Balance: - [[ '%.2f' % (reduce(lambda x,y: x+(y['debit'] - y['credit']), getLines(o), 0)) ]] + [[ '%.2f' % (reduce(lambda x,y: x+(y['debit'] - y['credit']), getLines(o), 0)) ]] - + - + - + @@ -222,13 +224,12 @@ - + Total amount due: [[ '%.2f' % (reduce(lambda x,y: x+(y['debit']-y['credit']), getLines(o), 0)) ]] [[ company.currency_id.name]]. - + - diff --git a/addons/account_followup/report/report_followup_print.py b/addons/account_followup/report/report_followup_print.py index a5f199047ff..1384cfa6eb6 100644 --- a/addons/account_followup/report/report_followup_print.py +++ b/addons/account_followup/report/report_followup_print.py @@ -45,14 +45,18 @@ class report_rappel(report_sxw.rml_parse): def _ids_to_objects(self, partners_ids): pool = pooler.get_pool(self.cr.dbname) - partners = pool.get('res.partner').browse(self.cr, self.uid, partners_ids) - return partners + all_partners = [] + for partner in partners_ids: + partners = pool.get('account_followup.stat').browse(self.cr, self.uid, partner[2]) + for par in partners: + all_partners.append(par.name) + return all_partners def _adr_get(self, partner, type): res_partner = pooler.get_pool(self.cr.dbname).get('res.partner') res_partner_address = pooler.get_pool(self.cr.dbname).get('res.partner.address') adr = res_partner.address_get(self.cr, self.uid, [partner.id], [type])[type] - return res_partner_address.read(self.cr, self.uid, [adr])[0] + return res_partner_address.read(self.cr, self.uid, [adr]) def _lines_get(self, partner): moveline_obj = pooler.get_pool(self.cr.dbname).get('account.move.line') diff --git a/addons/account_followup/wizard/wizard_followup_print.py b/addons/account_followup/wizard/wizard_followup_print.py index 317d41415c2..9b96b5b8d67 100644 --- a/addons/account_followup/wizard/wizard_followup_print.py +++ b/addons/account_followup/wizard/wizard_followup_print.py @@ -30,6 +30,9 @@ import datetime import pooler import time +import tools +from osv import fields, osv + _followup_wizard_date_form = """
@@ -39,6 +42,20 @@ _followup_wizard_date_fields = { 'date': {'string': 'Date', 'type': 'date', 'required': True}, } +form = """ + + + + +