email digest fixes

This commit is contained in:
Anand Doshi 2012-05-03 12:37:26 +05:30
parent 3d0c9ba22d
commit e5982c0399

View File

@ -502,126 +502,141 @@ class DocType:
body_dict = { body_dict = {
'invoiced_amount': { 'invoiced_amount': {
'table': 'invoiced_amount' in result and table({ 'table': result.get('invoiced_amount') and \
'head': 'Invoiced Amount', table({
'body': currency_amount_str \ 'head': 'Invoiced Amount',
% (currency, fmt_money(result['invoiced_amount']['debit'])) 'body': currency_amount_str \
}), % (currency, fmt_money(result['invoiced_amount'].get('debit')))
}),
'idx': 300 'idx': 300
}, },
'payables': { 'payables': {
'table': 'payables' in result and table({ 'table': result.get('payables') and \
'head': 'Payables', table({
'body': currency_amount_str \ 'head': 'Payables',
% (currency, fmt_money(result['payables']['credit'])) 'body': currency_amount_str \
}), % (currency, fmt_money(result['payables'].get('credit')))
}),
'idx': 200 'idx': 200
}, },
'collections': { 'collections': {
'table': 'collections' in result and table({ 'table': result.get('collections') and \
'head': 'Collections', table({
'body': currency_amount_str \ 'head': 'Collections',
% (currency, fmt_money(result['collections']['credit'])) 'body': currency_amount_str \
}), % (currency, fmt_money(result['collections'].get('credit')))
}),
'idx': 301 'idx': 301
}, },
'payments': { 'payments': {
'table': 'payments' in result and table({ 'table': result.get('payments') and \
'head': 'Payments', table({
'body': currency_amount_str \ 'head': 'Payments',
% (currency, fmt_money(result['payments']['debit'])) 'body': currency_amount_str \
}), % (currency, fmt_money(result['payments'].get('debit')))
}),
'idx': 201 'idx': 201
}, },
'income': { 'income': {
'table': 'income' in result and table({ 'table': result.get('income') and \
'head': 'Income', table({
'body': currency_amount_str \ 'head': 'Income',
% (currency, fmt_money(result['income']['value'])) 'body': currency_amount_str \
}), % (currency, fmt_money(result['income'].get('value')))
}),
'idx': 302 'idx': 302
}, },
'income_year_to_date': { 'income_year_to_date': {
'table': 'income_year_to_date' in result and table({ 'table': result.get('income_year_to_date') and \
'head': 'Income Year To Date', table({
'body': currency_amount_str \ 'head': 'Income Year To Date',
% (currency, fmt_money(result['income_year_to_date']['value'])) 'body': currency_amount_str \
}), % (currency, fmt_money(result['income_year_to_date'].get('value')))
}),
'idx': 303 'idx': 303
}, },
'expenses_booked': { 'expenses_booked': {
'table': 'expenses_booked' in result and table({ 'table': result.get('expenses_booked') and \
'head': 'Expenses Booked', table({
'body': currency_amount_str \ 'head': 'Expenses Booked',
% (currency, fmt_money(result['expenses_booked']['value'])) 'body': currency_amount_str \
}), % (currency, fmt_money(result['expenses_booked'].get('value')))
}),
'idx': 202 'idx': 202
}, },
'bank_balance': { 'bank_balance': {
'table': 'bank_balance' in result and result['bank_balance'] and table({ 'table': result.get('bank_balance') and \
'head': 'Bank Balance', table({
'body': [ 'head': 'Bank Balance',
[ 'body': [
"<span style='font-size: 16px; font-weight: normal'>%s</span>" % bank['name'], [
currency_amount_str % (currency, fmt_money(bank['value'])) "<span style='font-size: 16px; font-weight: normal'>%s</span>" \
] for bank in result.get('bank_balance', []) % bank['name'],
] currency_amount_str % (currency, fmt_money(bank.get('value')))
}), ] for bank in result['bank_balance']
]
}),
'idx': 400 'idx': 400
}, },
'new_leads': { 'new_leads': {
'table': 'new_leads' in result and table({ 'table': result.get('new_leads') and \
'head': 'New Leads', table({
'body': '%s' % result['new_leads']['count'] 'head': 'New Leads',
}), 'body': '%s' % result['new_leads'].get('count')
}),
'idx': 100 'idx': 100
}, },
'new_enquiries': { 'new_enquiries': {
'table': 'new_enquiries' in result and table({ 'table': result.get('new_enquiries') and \
'head': 'New Enquiries', table({
'body': '%s' % result['new_enquiries']['count'] 'head': 'New Enquiries',
}), 'body': '%s' % result['new_enquiries'].get('count')
}),
'idx': 101 'idx': 101
}, },
'new_quotations': { 'new_quotations': {
'table': 'new_quotations' in result and table({ 'table': result.get('new_quotations') and \
'head': 'New Quotations', table({
'body': '%s' % result['new_quotations']['count'] 'head': 'New Quotations',
}), 'body': '%s' % result['new_quotations'].get('count')
}),
'idx': 102 'idx': 102
}, },
'new_sales_orders': { 'new_sales_orders': {
'table': 'new_sales_orders' in result and table({ 'table': result.get('new_sales_orders') and \
'head': 'New Sales Orders', table({
'body': '%s' % result['new_sales_orders']['count'] 'head': 'New Sales Orders',
}), 'body': '%s' % result['new_sales_orders'].get('count')
}),
'idx': 103 'idx': 103
}, },
'new_purchase_orders': { 'new_purchase_orders': {
'table': 'new_purchase_orders' in result and table({ 'table': result.get('new_purchase_orders') and \
'head': 'New Purchase Orders', table({
'body': '%s' % result['new_purchase_orders']['count'] 'head': 'New Purchase Orders',
}), 'body': '%s' % result['new_purchase_orders'].get('count')
}),
'idx': 104 'idx': 104
}, },
'new_transactions': { 'new_transactions': {
'table': 'new_transactions' in result and table({ 'table': result.get('new_transactions') and \
'head': 'New Transactions', table({
'body': '%s' % result['new_transactions']['count'] 'head': 'New Transactions',
}), 'body': '%s' % result['new_transactions'].get('count')
}),
'idx': 105 'idx': 105
} }