diff --git a/addons/account_followup/followup_demo.xml b/addons/account_followup/followup_demo.xml index a7ffb50b44a..71ddadb9e10 100644 --- a/addons/account_followup/followup_demo.xml +++ b/addons/account_followup/followup_demo.xml @@ -1,28 +1,24 @@ - + Default follow-up First letter after 15 net days, 30 net days and 45 days end of month levels. - + Level 0 : 15 net days 0 days 15 - Date : %(date)s - -Dear %(partner_name)s, - + Exception made if there was a mistake of ours, it seems that the following amount 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. - -Best regards, +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 department at (+32).10.68.94.39. + @@ -31,16 +27,16 @@ Best regards, days 30 - LEVEL 1: -Date : %(date)s + +We are disappointed to see that despite sending a reminder, that your account is now seriously overdue. -Dear %(partner_name)s, +It is essential that immediate payment is made, otherwise we will have to consider placing a stop on your account which means that we will no longer be able to supply your company with (goods/services). +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 amount staid unpaid. Please, take appropriate measures in order to carry out this payment in the next 8 days. +If there is a problem with paying invoice that we are not aware of, do not hesitate to contact our accounting department at (+32).10.68.94.39. so that we can resolve the matter quickly. -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, +Details of due payments is printed below. + @@ -49,17 +45,16 @@ Best regards, end_of_month 45 - LEVEL 2: -Date : %(date)s + +Despite several reminders, your account is still not settled. -Dear %(partner_name)s, +Unless full payment is made in next 8 days , then legal action for the recovery of the debt, will be taken without further notice. -Exception made if there was a mistake of ours, it seems that the following amount staid unpaid. Please, take appropriate measures in order to carry out this payment in the next 8 days. +I trust that this action will prove unnecessary and details of due payments is printed below. -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, +In case of any queries concerning this matter, do not hesitate to contact our accounting department at (+32).10.68.94.39. + - + diff --git a/addons/account_followup/report/rappel.rml b/addons/account_followup/report/rappel.rml index 5f05a2b9628..ecb733f6449 100644 --- a/addons/account_followup/report/rappel.rml +++ b/addons/account_followup/report/rappel.rml @@ -14,6 +14,10 @@ + + + + @@ -35,26 +39,25 @@ - - - - - - + + + + + + - - - - - - - - + + + + + + + + - - - + + @@ -64,153 +67,156 @@ - [[ repeatIn(ids_to_objects(data['form']['partner_ids']),'o') ]] [[ setLang(o.lang) ]] + [[ repeatIn(ids_to_objects(data['form']['partner_ids']),'o') ]] [[ setLang(o.lang) ]] - + - [[ 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 '']] - + [[ 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.id ]] - + Customer Ref: [[ o.id ]] + - Dear Sir/Madam, - - + Dear [[ a['name'] ]], + + - According to our accounting, the following Invoices are unpaid. Could you please verify on your side, and take appropriate measures to pay the balance due in the next 8 days. - - - - If the payment has been very recently made i.e. as this reminder was issued, consider this reminder as void. Do not hesitate to contact our accounting department for further queries. - - - - Best regards. - - - - + - Date + + + - Description + + [[ format(get_text(o)) ]] + + + + + + + + + Best Regards, + + + + + + + + Date - Ref + Description - Maturity date + Ref - Due + Maturity date - Paid + Due - Maturity + Paid - Li. + Maturity + + + 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)) ]] - - - - - - + @@ -219,17 +225,23 @@ + + + + + - - + + - + 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 2d805aa29a5..d15a42bedae 100644 --- a/addons/account_followup/report/report_followup_print.py +++ b/addons/account_followup/report/report_followup_print.py @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# OpenERP, Open Source Management Solution +# OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved # $Id$ # @@ -34,6 +34,7 @@ class report_rappel(report_sxw.rml_parse): 'ids_to_objects': self._ids_to_objects, 'adr_get' : self._adr_get, 'getLines' : self._lines_get, + 'get_text' : self._get_text }) def _ids_to_objects(self, partners_ids): @@ -60,6 +61,24 @@ class report_rappel(report_sxw.rml_parse): movelines = moveline_obj.read(self.cr, self.uid, movelines) return movelines + def _get_text(self, data): + text = "" + a = {} + partner_line = pooler.get_pool(self.cr.dbname).get('account.move.line').search(self.cr, self.uid, [('partner_id','=',data.id)]) + for i in pooler.get_pool(self.cr.dbname).get('account.move.line').browse(self.cr, self.uid, partner_line): + if i.followup_line_id and str(i.followup_line_id.delay)=='45': + text = i.followup_line_id.description + a['45'] = text + elif i.followup_line_id and str(i.followup_line_id.delay)=='30': + text = i.followup_line_id.description + a['30'] = text + elif i.followup_line_id and str(i.followup_line_id.delay)=='15': + text = i.followup_line_id.description + a['15'] = text + text = (a.has_key('45') and a['45']) or (a.has_key('30') and a['30']) or (a.has_key('15') and a['15']) + return text + + report_sxw.report_sxw('report.account_followup.followup.print', 'res.partner', 'addons/account_followup/report/rappel.rml', parser=report_rappel) diff --git a/addons/account_followup/wizard/wizard_followup_print.py b/addons/account_followup/wizard/wizard_followup_print.py index 05878b3f437..b6c7ae4e6cf 100644 --- a/addons/account_followup/wizard/wizard_followup_print.py +++ b/addons/account_followup/wizard/wizard_followup_print.py @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# OpenERP, Open Source Management Solution +# OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved # $Id$ #