[[ 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 '']] VAT: [[ o.vat or removeParentNode('para') ]] Document: Customer account statement Date: [[ time.strftime('%d/%m/%Y') ]] Customer Ref: [[ o.id ]] [[ format(get_text(o,data['form']['followup_id'])) ]] Date Description Ref Maturity date Due Paid Maturity Amount Li. [[repeatIn(getLines(o), 'line') ]] [[ line['date'] ]] [[ line['name'] ]] [[ line['ref'] ]] [[ line['date_maturity'] ]] [[ line['debit'] and '%.2f' % line['debit'] or '' ]] [[ company.currency_id.name]] [[ line['credit'] and '%.2f' % line['credit'] or '0.00' ]] [[ company.currency_id.name]] [[ (line['date_maturity'] < time.strftime('%Y-%m-%d')) and (line['debit'] - line['credit']) or '' ]] [[ company.currency_id.name]] [[ '%.2f' % line['amount_currency'] ]] [[ line['currency_id'] and line['currency_id'][1] or '' ]] [[ line['blocked'] and 'X' or '' ]] Sub-Total: [[ '%.2f' % (reduce(lambda x,y: x+y['debit'], getLines(o), 0)) ]] [[ company.currency_id.name]] [[ '%.2f' % (reduce(lambda x,y: x+y['credit'], getLines(o), 0)) ]] [[ company.currency_id.name]] [[ 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.name]] Balance: [[ '%.2f' % (reduce(lambda x,y: x+(y['debit'] - y['credit']), getLines(o), 0)) ]] [[ company.currency_id.name]]