[FIX] Account_Payment : payment order report corrected.
bzr revid: jvo@tinyerp.com-20100820061103-wztz1npc6mz0aqd0
This commit is contained in:
parent
bd16462c71
commit
1bea8f3f1f
|
@ -14,6 +14,10 @@
|
|||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table1">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table2">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
|
@ -22,6 +26,7 @@
|
|||
<lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table4">
|
||||
<blockAlignment value="LEFT"/>
|
||||
|
@ -31,11 +36,23 @@
|
|||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,-1" stop="4,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="5,-1" stop="5,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table5">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
|
||||
</blockTableStyle>
|
||||
<initialize>
|
||||
<paraStyle name="all" alignment="justify"/>
|
||||
</initialize>
|
||||
<paraStyle name="P1" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P1" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P2" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="Standard" fontName="Times-Roman"/>
|
||||
<paraStyle name="Heading" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
|
@ -68,8 +85,8 @@
|
|||
<paraStyle name="terp_default_Space" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="9.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_space_0.2" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_2" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<images/>
|
||||
</stylesheet>
|
||||
<images/>
|
||||
<story>
|
||||
<para style="terp_default_8">[[ repeatIn(objects, 'o') ]]</para>
|
||||
<para style="terp_default_8">
|
||||
|
@ -98,16 +115,82 @@
|
|||
<para style="Standard">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="terp_header">[[ o.mode and o.mode.name ]]</para>
|
||||
<para style="terp_header">Payment Order / Payment</para>
|
||||
<para style="terp_default_9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="94.0,434.0" style="Table1">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">Payment Type</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P1">[[ o.mode and o.mode.name or '-' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">Reference</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P1">[[ o.reference or '-' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">Used Account </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P1">[[ o.mode.bank_id.name or '-' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">Execution Type</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P1">[[ o.date_prefered == 'now' and 'Now' or removeParentNode('para') ]]</para>
|
||||
<para style="P1">[[ o.date_prefered == 'due' and 'Due date' or removeParentNode('para') ]]</para>
|
||||
<para style="P1">[[ o.date_prefered == 'fixed' and 'Fixed date' or removeParentNode('para') ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">Company Currency</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P1">[[ get_company_currency() ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P1">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="terp_default_2">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="terp_default_9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="terp_default_space_0.2">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="terp_default_9">Reference: [[ o.reference ]]</para>
|
||||
<para style="terp_default_9">Execution date: [[ o.date_done or '/']]</para>
|
||||
<para style="terp_default_9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="terp_default_space_0.2">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="83.0,98.0,190.0,70.0,85.0" style="Table2">
|
||||
<blockTable colWidths="72.0,85.0,111.0,83.0,62.0,115.0" style="Table2">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Partner</para>
|
||||
|
@ -116,14 +199,17 @@
|
|||
<para style="terp_tblheader_Details">Bank account</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Reference</para>
|
||||
<para style="terp_tblheader_Details">Invoice reference</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Date</para>
|
||||
<para style="terp_tblheader_Details_Right">Value date</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Amount</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Amount in currency</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="terp_default_2">
|
||||
|
@ -131,19 +217,22 @@
|
|||
</para>
|
||||
<section>
|
||||
<para style="terp_default_9">[[repeatIn(o.line_ids, 'line') ]]</para>
|
||||
<blockTable colWidths="83.0,98.0,190.0,70.0,85.0" style="Table4">
|
||||
<blockTable colWidths="72.0,85.0,111.0,84.0,62.0,114.0" style="Table4">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ line.partner_id and line.partner_id.name or '' ]]</para>
|
||||
<para style="terp_default_9">[[line.partner_id and line.partner_id.name or '-' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ line.bank_id and line.bank_id.name ]]</para>
|
||||
<para style="terp_default_9">[[ line.bank_id and line.bank_id.name or '-' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ line.name ]]</para>
|
||||
<para style="terp_default_9">[[ get_invoice_name(line.ml_inv_ref.id) or '-' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ line.date ]]</para>
|
||||
<para style="terp_default_Right_9">[[line.date=='False' and '-' or line.date ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[formatLang(line.amount) or '-' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang(line.amount_currency) ]] [[ line.currency.name ]]</para>
|
||||
|
@ -154,7 +243,36 @@
|
|||
<font color="white"> </font>
|
||||
</para>
|
||||
</section>
|
||||
<para style="terp_default_9">
|
||||
<para style="Standard">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="72.0,85.0,111.0,84.0,62.0,114.0" style="Table5">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9"/>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P2">Total:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang(get_amount_total(o)) or '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang(get_amount_total_in_currency(o)) or '' ]] [[ get_amount_total_in_currency(o) and line.currency.name ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="Standard">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</story>
|
||||
|
|
|
@ -21,15 +21,55 @@
|
|||
|
||||
import time
|
||||
import datetime
|
||||
import pooler
|
||||
from report import report_sxw
|
||||
|
||||
class payment_order(report_sxw.rml_parse):
|
||||
|
||||
def __init__(self, cr, uid, name, context):
|
||||
super(payment_order, self).__init__(cr, uid, name, context=context)
|
||||
self.localcontext.update( {
|
||||
'time': time,
|
||||
'get_invoice_name': self._get_invoice_name,
|
||||
'get_company_currency' : self._get_company_currency,
|
||||
'get_amount_total_in_currency' : self._get_amount_total_in_currency,
|
||||
'get_amount_total' : self._get_amount_total,
|
||||
|
||||
})
|
||||
def _get_invoice_name(self,invoice_id):
|
||||
if invoice_id:
|
||||
pool = pooler.get_pool(self.cr.dbname)
|
||||
value_name = pool.get('account.invoice').name_get(self.cr, self.uid, [invoice_id])
|
||||
if value_name:
|
||||
return value_name[0][1]
|
||||
return False
|
||||
|
||||
def _get_amount_total_in_currency(self,payment):
|
||||
total = 0.0
|
||||
if payment.line_ids:
|
||||
currency_cmp = payment.line_ids[0].currency.id
|
||||
else:
|
||||
return False
|
||||
for line in payment.line_ids:
|
||||
if currency_cmp == line.currency.id:
|
||||
total += line.amount_currency
|
||||
else:
|
||||
return False
|
||||
return total
|
||||
|
||||
def _get_amount_total(self,payment):
|
||||
total = 0.0
|
||||
if not payment.line_ids:
|
||||
return False
|
||||
for line in payment.line_ids:
|
||||
total += line.amount
|
||||
return total
|
||||
|
||||
def _get_company_currency(self):
|
||||
pool = pooler.get_pool(self.cr.dbname)
|
||||
user = pool.get('res.users').browse(self.cr, self.uid, self.uid)
|
||||
return user.company_id and user.company_id.currency_id and user.company_id.currency_id.name or False
|
||||
|
||||
report_sxw.report_sxw('report.payment.order', 'payment.order', 'addons/account_payment/report/payment_order.rml', parser=payment_order,header=False)
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
Loading…
Reference in New Issue