merged from lp:~openerp-dev/openobject-addons/report_dev
bzr revid: apa@tinyerp.com-20101102045314-2rgtl4sqy5q5xg28
This commit is contained in:
@@ -20,12 +20,10 @@
|
||||
##############################################################################
|
||||
|
||||
import time
|
||||
|
||||
import rml_parse
|
||||
from report import report_sxw
|
||||
from common_report_header import common_report_header
|
||||
|
||||
class aged_trial_report(rml_parse.rml_parse, common_report_header):
|
||||
class aged_trial_report(report_sxw.rml_parse, common_report_header):
|
||||
|
||||
def __init__(self, cr, uid, name, context):
|
||||
super(aged_trial_report, self).__init__(cr, uid, name, context=context)
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
##############################################################################
|
||||
|
||||
import time
|
||||
|
||||
from report import report_sxw
|
||||
from common_report_header import common_report_header
|
||||
|
||||
|
||||
@@ -148,11 +148,11 @@
|
||||
<paraStyle name="P7" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P8" fontName="Helvetica"/>
|
||||
<paraStyle name="P9" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P10" fontName="Helvetica-Bold" fontSize="8.0" leading="14" spaceBefore="0.0" spaceAfter="6.0" alignment="RIGHT"/>
|
||||
<paraStyle name="P10" fontName="Helvetica-Bold" fontSize="8.0" leading="10" spaceBefore="0.0" spaceAfter="0.0" alignment="RIGHT"/>
|
||||
<paraStyle name="P11" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P12" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P13" fontName="Helvetica-Bold" fontSize="2.0" leading="3" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0" textColor="#ffffff"/>
|
||||
<paraStyle name="P14" rightIndent="17.0" leftIndent="-0.0" fontName="Helvetica-Bold" fontSize="8.0" leading="10" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P14" rightIndent="17.0" leftIndent="-0.0" fontName="Helvetica-Bold" fontSize="8.0" leading="10" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P15" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P16" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P17" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
@@ -189,7 +189,7 @@
|
||||
<paraStyle name="terp_default_2" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Right_9_Bold" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="Heading 3" fontName="Helvetica-Bold" fontSize="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P12a" fontName="Helvetica-Bold" fontSize="8.0" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P12a" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<images/>
|
||||
</stylesheet>
|
||||
<story>
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
import time
|
||||
import locale
|
||||
from report import report_sxw
|
||||
import rml_parse
|
||||
|
||||
parents = {
|
||||
'tr':1,
|
||||
@@ -31,7 +30,7 @@ parents = {
|
||||
'section': 0
|
||||
}
|
||||
|
||||
class account_balance_landscape(rml_parse.rml_parse):
|
||||
class account_balance_landscape(report_sxw.rml_parse):
|
||||
def __init__(self, cr, uid, name, context):
|
||||
super(account_balance_landscape, self).__init__(cr, uid, name, context=context)
|
||||
self.flag=1
|
||||
|
||||
@@ -22,13 +22,12 @@
|
||||
import time
|
||||
|
||||
import pooler
|
||||
import rml_parse
|
||||
from report import report_sxw
|
||||
from account.report import account_profit_loss
|
||||
from common_report_header import common_report_header
|
||||
from tools.translate import _
|
||||
|
||||
class report_balancesheet_horizontal(rml_parse.rml_parse, common_report_header):
|
||||
class report_balancesheet_horizontal(report_sxw.rml_parse, common_report_header):
|
||||
def __init__(self, cr, uid, name, context=None):
|
||||
super(report_balancesheet_horizontal, self).__init__(cr, uid, name, context=context)
|
||||
self.obj_pl = account_profit_loss.report_pl_account_horizontal(cr, uid, name, context=context)
|
||||
|
||||
@@ -35,19 +35,7 @@
|
||||
<blockTableStyle id="Table_Net_Profit_Loss">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="0,0" stop="0,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="0,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,0" stop="1,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="2,0" stop="2,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="2,0" stop="2,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="3,0" stop="3,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#cccccc" start="3,0" stop="3,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="3,0" stop="3,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,0" stop="-1,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table1">
|
||||
<blockAlignment value="LEFT"/>
|
||||
@@ -230,7 +218,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="426.0,113.0" style="Table3">
|
||||
<blockTable colWidths="426.0,113.0" style="Table_Net_Profit_Loss">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">Balance:</para>
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
##############################################################################
|
||||
|
||||
import time
|
||||
|
||||
from report import report_sxw
|
||||
from common_report_header import common_report_header
|
||||
#
|
||||
|
||||
@@ -274,7 +274,7 @@
|
||||
<para style="P9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="50.0,300.0,70.0,70.0,70.0" style="Table_Account_detail_Title">[[ display_currency(data) == False or removeParentNode('blockTable') ]]
|
||||
<blockTable colWidths="50.0,260.0,80.0,80.0,80.0" style="Table_Account_detail_Title">[[ display_currency(data) == False or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td><para style="terp_tblheader_Details">A/C No.</para></td>
|
||||
<td><para style="terp_tblheader_Details">Account Name</para></td>
|
||||
@@ -283,7 +283,7 @@
|
||||
<td><para style="terp_tblheader_Details_Right">Balance</para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="50.0,220.0,70.0,70.0,70.0,80.0" style="Table_Account_detail_Title_Currency">[[ display_currency(data) or removeParentNode('blockTable') ]]
|
||||
<blockTable colWidths="50.0,180.0,80.0,80.0,80.0,80.0" style="Table_Account_detail_Title_Currency">[[ display_currency(data) or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td><para style="terp_tblheader_Details">A/C No.</para></td>
|
||||
<td><para style="terp_tblheader_Details">Account Name</para></td>
|
||||
@@ -293,7 +293,7 @@
|
||||
<td><para style="terp_tblheader_Details_Right">Currency</para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="50.0,300.0,70.0,70.0,70.0" style="Table_Final_Total">[[ display_currency(data) == False or removeParentNode('blockTable') ]]
|
||||
<blockTable colWidths="50.0,260.0,80.0,80.0,80.0" style="Table_Final_Total">[[ display_currency(data) == False or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td><para style="terp_default_Bold_9">Total:</para></td>
|
||||
<td><para style="terp_default_Bold_9"><font color="white"> </font></para></td>
|
||||
@@ -302,7 +302,7 @@
|
||||
<td><para style="terp_default_Bold_9_Right">[[ formatLang( sum_credit(o.period_id.id, o.journal_id.id)-sum_debit(o.period_id.id, o.journal_id.id) ) ]] [[ company.currency_id.symbol ]]</para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="50.0,220.0,70.0,70.0,70.0,80.0" style="Table_Final_Total_currency">[[ display_currency(data) or removeParentNode('blockTable') ]]
|
||||
<blockTable colWidths="50.0,180.0,80.0,80.0,80.0,80.0" style="Table_Final_Total_currency">[[ display_currency(data) or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td><para style="terp_default_Bold_9">Total:</para></td>
|
||||
<td><para style="terp_default_Bold_9"><font color="white"> </font></para></td>
|
||||
@@ -314,7 +314,7 @@
|
||||
</blockTable>
|
||||
<section>
|
||||
<para style="terp_default_8">[[ repeatIn(lines(o.period_id.id,o.journal_id.id),'line') ]]</para>
|
||||
<blockTable colWidths="50.0,300.0,70.0,70.0,70.0" style="Table_Journal_Line_Content">[[ display_currency(data) == False or removeParentNode('blockTable') ]]
|
||||
<blockTable colWidths="50.0,260.0,80.0,80.0,80.0" style="Table_Journal_Line_Content">[[ display_currency(data) == False or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td><para style="terp_default_9">[[ line['code'] ]]</para></td>
|
||||
<td><para style="terp_default_9">[[ line['name'] ]]</para></td>
|
||||
@@ -323,7 +323,7 @@
|
||||
<td><para style="terp_default_Right_9">[[ formatLang(line['credit']-line['debit']) ]] [[ company.currency_id.symbol ]]</para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="50.0,220.0,70.0,70.0,70.0,80.0" style="Table_Journal_Line_Content_currency">[[ display_currency(data) or removeParentNode('blockTable') ]]
|
||||
<blockTable colWidths="50.0,180.0,80.0,80.0,80.0,80.0" style="Table_Journal_Line_Content_currency">[[ display_currency(data) or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td><para style="terp_default_9">[[ line['code'] ]]</para></td>
|
||||
<td><para style="terp_default_9">[[ line['name'] ]]</para></td>
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
##############################################################################
|
||||
|
||||
import time
|
||||
|
||||
from common_report_header import common_report_header
|
||||
from report import report_sxw
|
||||
|
||||
|
||||
@@ -28,12 +28,10 @@
|
||||
##############################################################################
|
||||
|
||||
import time
|
||||
|
||||
from report import report_sxw
|
||||
from common_report_header import common_report_header
|
||||
import rml_parse
|
||||
|
||||
class general_ledger(rml_parse.rml_parse, common_report_header):
|
||||
class general_ledger(report_sxw.rml_parse, common_report_header):
|
||||
_name = 'report.account.general.ledger'
|
||||
|
||||
def set_context(self, objects, data, ids, report_type=None):
|
||||
@@ -88,9 +86,20 @@ class general_ledger(rml_parse.rml_parse, common_report_header):
|
||||
'get_start_date':self._get_start_date,
|
||||
'get_end_date':self._get_end_date,
|
||||
'get_target_move': self._get_target_move,
|
||||
'strip_name': self._strip_name,
|
||||
})
|
||||
self.context = context
|
||||
|
||||
def _ellipsis(self, orig_str, maxlen=100, ellipsis='...'):
|
||||
maxlen = maxlen - len(ellipsis)
|
||||
if maxlen <= 0:
|
||||
maxlen = 1
|
||||
new_str = orig_str[:maxlen]
|
||||
return new_str
|
||||
|
||||
def _strip_name(self, name, maxlen=50):
|
||||
return self._ellipsis(name, maxlen, ' ...')
|
||||
|
||||
def _sum_currency_amount_account(self, account):
|
||||
self.cr.execute('SELECT sum(l.amount_currency) AS tot_currency \
|
||||
FROM account_move_line l \
|
||||
|
||||
@@ -334,7 +334,7 @@
|
||||
<td><para style="P4">[[ formatLang(line['debit']) ]]</para></td>
|
||||
<td><para style="P4">[[ formatLang(line['credit']) ]]</para></td>
|
||||
<td><para style="P4">[[ formatLang(line['progress']) ]] [[ company.currency_id.symbol ]]</para></td>
|
||||
<td><para style="P4"><font>[[ line['amount_currency']==True or removeParentNode('font') ]] [[ formatLang(line['amount_currency'])]] [[ line['currency_code'] or '']]</font></para></td>
|
||||
<td><para style="P4"><font>[[ (line.has_key('currency_id') and line['currency_id']==None or line['amount_currency']==None) and removeParentNode('font') ]] [[ formatLang(line['amount_currency'])]] [[ line['currency_code'] or '']]</font></para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</section>
|
||||
|
||||
@@ -295,13 +295,13 @@
|
||||
<td><para style="P4_content">[[ formatLang(line['debit'], digits=get_digits(dp='Account')) ]]</para></td>
|
||||
<td><para style="P4_content">[[ formatLang(line['credit'], digits=get_digits(dp='Account')) ]]</para></td>
|
||||
<td><para style="P4_content">[[ formatLang(line['progress'], digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]]</para></td>
|
||||
<td><para style="P4_content"><font>[[ line['amount_currency']==True or removeParentNode('font') ]] [[ formatLang(line['amount_currency'])]] [[ line['currency_code'] or '']]</font></para></td>
|
||||
<td><para style="P4_content"><font>[[ (line.has_key('currency_id') and line['currency_id']==None or line['amount_currency']==None) and removeParentNode('font') ]] [[ formatLang(line['amount_currency'])]] [[ line['currency_code'] or '']]</font></para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
||||
</section>
|
||||
|
||||
<blockTable colWidths="66.0,35.0,166.0,90.0,60.0,280.0,148.0,69.0,72.0,64.0" style="tbl_header" repeatRows="1">[[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]]
|
||||
<blockTable colWidths="66.0,35.0,166.0,90.0,60.0,245.0,148.0,80.0,80.0,80.0" style="tbl_header" repeatRows="1">[[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td><para style="P2">Date</para></td>
|
||||
<td><para style="date">JNRL</para></td>
|
||||
@@ -320,10 +320,10 @@
|
||||
|
||||
<para>[[ repeatIn(get_children_accounts(a), 'o') ]]</para>
|
||||
|
||||
<blockTable colWidths="66.0,35.0,166.0,90.0,60.0,280.0,148.0,69.0,72.0,64.0" style="tbl_content">[[data['form']['amount_currency'] == False or removeParentNode('blockTable')]]
|
||||
<blockTable colWidths="66.0,35.0,166.0,90.0,60.0,245.0,148.0,80.0,80.0,80.0" style="tbl_content">[[data['form']['amount_currency'] == False or removeParentNode('blockTable')]]
|
||||
<tr>
|
||||
<td>
|
||||
<blockTable colWidths="405.0,435.0,69.0,72.0,63.0" style="Table5">
|
||||
<blockTable colWidths="405.0,399.0,80.0,80.0,80.0" style="Table5">
|
||||
<tr>
|
||||
<td><para style="Standard"><font color="white">[[ '..'*(o.level-1) ]]</font>[[ o.code ]] [[ o.name ]]</para></td>
|
||||
<td><para style="Standard"></para></td>
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
##############################################################################
|
||||
|
||||
import time
|
||||
|
||||
from common_report_header import common_report_header
|
||||
from report import report_sxw
|
||||
|
||||
|
||||
@@ -227,7 +227,7 @@
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P12a"></para>
|
||||
<blockTable colWidths="80.0,170.0,70.0,70.0,70.0,80.0" repeatRows="1" style="Table2">
|
||||
<blockTable colWidths="80.0,140.0,80.0,80.0,80.0,80.0" repeatRows="1" style="Table2">
|
||||
<tr>
|
||||
<td><para style="P12a">Code</para></td>
|
||||
<td><para style="P12a">(Account/Partner) Name</para></td>
|
||||
|
||||
@@ -21,12 +21,10 @@
|
||||
|
||||
import time
|
||||
import re
|
||||
|
||||
import rml_parse
|
||||
from report import report_sxw
|
||||
from common_report_header import common_report_header
|
||||
|
||||
class third_party_ledger(rml_parse.rml_parse, common_report_header):
|
||||
class third_party_ledger(report_sxw.rml_parse, common_report_header):
|
||||
|
||||
def __init__(self, cr, uid, name, context=None):
|
||||
super(third_party_ledger, self).__init__(cr, uid, name, context=context)
|
||||
|
||||
@@ -277,7 +277,7 @@
|
||||
<para style="P4">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="55.0,28.0,60.0,81.0,125.0,57.0,58.0,65.0" style="Table_header_1">[[ display_currency(data) == False or removeParentNode('blockTable') ]]
|
||||
<blockTable colWidths="55.0,28.0,60.0,81.0,125.0,57.0,58.0,80.0" style="Table_header_1">[[ display_currency(data) == False or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Date</para>
|
||||
@@ -311,20 +311,20 @@
|
||||
<para style="terp_default_2">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="349.0,57.0,58.0,65.0" style="Table2">[[ display_currency(data) == False or removeParentNode('blockTable') ]]
|
||||
<blockTable colWidths="344.0,60.0,60.0,80.0" style="Table2">[[ display_currency(data) == False or removeParentNode('blockTable') ]]
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P2">[[ p.ref ]] - [[ p.name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P5">[[ formatLang((sum_debit_partner(p))) ]]</para>
|
||||
<para style="P5"><u>[[ formatLang((sum_debit_partner(p))) ]]</u></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P5">[[ formatLang((sum_credit_partner(p))) ]] </para>
|
||||
<para style="P5"><u>[[ formatLang((sum_credit_partner(p))) ]]</u></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P5">[[ formatLang((sum_debit_partner(p) - sum_credit_partner(p))) ]] [[ company.currency_id.symbol ]]</para>
|
||||
<para style="P5"><u>[[ formatLang((sum_debit_partner(p) - sum_credit_partner(p))) ]] [[ company.currency_id.symbol ]]</u></para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -347,7 +347,7 @@
|
||||
</para>
|
||||
<section>
|
||||
<para style="P1">[[ repeatIn(lines(p), 'line') ]]</para>
|
||||
<blockTable colWidths="55.0,28.0,60.0,81.0,125.0,57.0,58.0,65.0" style="Table3">[[ display_currency(data) == False or removeParentNode('blockTable') ]]
|
||||
<blockTable colWidths="55.0,28.0,60.0,80.0,121.0,60.0,60.0,80.0" style="Table3">[[ display_currency(data) == False or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P3">[[ formatLang(line['date'],date=True) ]]</para>
|
||||
|
||||
@@ -432,7 +432,7 @@
|
||||
<para style="P5">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="50.0,28.0,65.0,61.0,145.0,60.0,60.0,60.0" style="Table_header_1">[[ display_currency(data) == False or removeParentNode('blockTable') ]]
|
||||
<blockTable colWidths="50.0,28.0,65.0,61.0,145.0,60.0,60.0,80.0" style="Table_header_1">[[ display_currency(data) == False or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Date</para>
|
||||
@@ -462,7 +462,7 @@
|
||||
</blockTable>
|
||||
<section>
|
||||
<para style="P3">[[ repeatIn(objects, 'p') ]] [[ setLang(p.lang) ]]</para>
|
||||
<blockTable colWidths="349.0,60.0,60.0,60.0" style="Table2">[[ display_currency(data) == False or removeParentNode('blockTable') ]]
|
||||
<blockTable colWidths="349.0,60.0,60.0,80.0" style="Table2">[[ display_currency(data) == False or removeParentNode('blockTable') ]]
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
@@ -495,7 +495,7 @@
|
||||
</blockTable>
|
||||
<section>
|
||||
<para style="P1">[[ repeatIn(lines(p), 'line') ]]</para>
|
||||
<blockTable colWidths="50.0,28.0,65.0,61.0,145.0,60.0,60.0,60.0" style="Table3">[[ display_currency(data) == False or removeParentNode('blockTable') ]]
|
||||
<blockTable colWidths="50.0,28.0,65.0,61.0,145.0,60.0,60.0,80.0" style="Table3">[[ display_currency(data) == False or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P3">[[ formatLang(line['date'],date=True) ]]</para>
|
||||
|
||||
@@ -194,7 +194,7 @@
|
||||
<para style="terp_default_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="219.0,87.0,62.0,56.0,46.0,62.0" style="Table7">
|
||||
<blockTable colWidths="202.0,87.0,71.0,57.0,42.0,71.0" style="Table7">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Description</para>
|
||||
@@ -218,7 +218,7 @@
|
||||
</blockTable>
|
||||
<section>
|
||||
<para style="terp_default_2">[[ repeatIn(o.invoice_line,'l') ]]</para>
|
||||
<blockTable colWidths="218.0,88.0,62.0,55.0,46.0,62.0" style="Table8">
|
||||
<blockTable colWidths="202.0,88.0,71.0,57.0,42.0,71.0" style="Table8">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ l.name ]]</para>
|
||||
@@ -271,7 +271,7 @@
|
||||
</tr>
|
||||
</blockTable>
|
||||
</section>
|
||||
<blockTable colWidths="407.0,54.0,69.0" style="Table10">
|
||||
<blockTable colWidths="391.0,54.0,85.0" style="Table10">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_8">
|
||||
@@ -315,7 +315,7 @@
|
||||
<para style="Text body">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="206.0,51.0,49.0,225.0" style="Table9">
|
||||
<blockTable colWidths="205.0,71.0,71.0,183.0" style="Table9">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Tax [[ o.tax_line==[] and removeParentNode('blockTable') ]]</para>
|
||||
@@ -335,7 +335,7 @@
|
||||
</blockTable>
|
||||
<section>
|
||||
<para style="terp_default_2">[[ repeatIn(o.tax_line,'t') ]]</para>
|
||||
<blockTable colWidths="205.0,52.0,49.0,224.0" style="Table2">
|
||||
<blockTable colWidths="205.0,71.0,71.0,184.0" style="Table2">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_8">[[ t.name ]]</para>
|
||||
|
||||
@@ -19,14 +19,12 @@
|
||||
##############################################################################
|
||||
|
||||
import time
|
||||
|
||||
import pooler
|
||||
import rml_parse
|
||||
from report import report_sxw
|
||||
from common_report_header import common_report_header
|
||||
from tools.translate import _
|
||||
|
||||
class report_pl_account_horizontal(rml_parse.rml_parse, common_report_header):
|
||||
class report_pl_account_horizontal(report_sxw.rml_parse, common_report_header):
|
||||
|
||||
def __init__(self, cr, uid, name, context=None):
|
||||
super(report_pl_account_horizontal, self).__init__(cr, uid, name, context=context)
|
||||
|
||||
@@ -238,7 +238,7 @@
|
||||
<blockTable colWidths="426.0,113.0" style="Table_Net_Profit_Loss">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">Total:([[ get_currency(data) ]])</para>
|
||||
<para style="terp_default_Bold_9">Total:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9_Bold"><u>[[ formatLang(abs(sum_dr())) ]] [[ company.currency_id.symbol ]]</u></para>
|
||||
|
||||
@@ -21,8 +21,6 @@
|
||||
##############################################################################
|
||||
|
||||
import time
|
||||
|
||||
import rml_parse
|
||||
from report import report_sxw
|
||||
|
||||
def _get_country(record):
|
||||
@@ -44,7 +42,7 @@ def _record_to_report_line(record):
|
||||
'country': _get_country(record)
|
||||
}
|
||||
|
||||
class account_tax_code_report(rml_parse.rml_parse):
|
||||
class account_tax_code_report(report_sxw.rml_parse):
|
||||
def __init__(self, cr, uid, name, context):
|
||||
super(account_tax_code_report, self).__init__(cr, uid, name, context=context)
|
||||
self.localcontext.update({
|
||||
|
||||
@@ -21,11 +21,9 @@
|
||||
|
||||
import time
|
||||
|
||||
|
||||
from common_report_header import common_report_header
|
||||
from report import report_sxw
|
||||
|
||||
|
||||
class tax_report(report_sxw.rml_parse, common_report_header):
|
||||
_name = 'report.account.vat.declaration'
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
##############################################################################
|
||||
|
||||
import time
|
||||
|
||||
from report import report_sxw
|
||||
from tools import amount_to_text_en
|
||||
|
||||
|
||||
@@ -1,146 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import re
|
||||
import sys
|
||||
|
||||
from report import report_sxw
|
||||
|
||||
class rml_parse(report_sxw.rml_parse):
|
||||
def __init__(self, cr, uid, name, context):
|
||||
super(rml_parse, self).__init__(cr, uid, name, context=context)
|
||||
self.localcontext.update({
|
||||
'comma_me': self.comma_me,
|
||||
'format_date': self._get_and_change_date_format_for_swiss,
|
||||
'strip_name': self._strip_name,
|
||||
'explode_name': self._explode_name,
|
||||
})
|
||||
|
||||
def comma_me(self,amount):
|
||||
#print "#" + str(amount) + "#"
|
||||
if not amount:
|
||||
amount = 0.0
|
||||
if type(amount) is float:
|
||||
amount = str('%.2f'%amount)
|
||||
else:
|
||||
amount = str(amount)
|
||||
if (amount == '0'):
|
||||
return ' '
|
||||
orig = amount
|
||||
new = re.sub("^(-?\d+)(\d{3})", "\g<1>'\g<2>", amount)
|
||||
if orig == new:
|
||||
return new
|
||||
else:
|
||||
return self.comma_me(new)
|
||||
def _ellipsis(self, string, maxlen=100, ellipsis = '...'):
|
||||
ellipsis = ellipsis or ''
|
||||
try:
|
||||
return string[:maxlen - len(ellipsis) ] + (ellipsis, '')[len(string) < maxlen]
|
||||
except:
|
||||
return False
|
||||
def _strip_name(self, name, maxlen=50):
|
||||
return self._ellipsis(name, maxlen, '...')
|
||||
|
||||
def _get_and_change_date_format_for_swiss(self,date_to_format):
|
||||
date_formatted=''
|
||||
if date_to_format:
|
||||
date_formatted = strptime(date_to_format,'%Y-%m-%d').strftime('%d.%m.%Y')
|
||||
return date_formatted
|
||||
|
||||
def _explode_name(self,chaine,length):
|
||||
# We will test if the size is less then account
|
||||
full_string = ''
|
||||
if (len(str(chaine)) <= length):
|
||||
return chaine
|
||||
#
|
||||
else:
|
||||
chaine = unicode(chaine,'utf8').encode('iso-8859-1')
|
||||
rup = 0
|
||||
for carac in chaine:
|
||||
rup = rup + 1
|
||||
if rup == length:
|
||||
full_string = full_string + '\n'
|
||||
full_string = full_string + carac
|
||||
rup = 0
|
||||
else:
|
||||
full_string = full_string + carac
|
||||
|
||||
return full_string
|
||||
|
||||
def makeAscii(self,str):
|
||||
try:
|
||||
Stringer = str.encode("utf-8")
|
||||
except UnicodeDecodeError:
|
||||
try:
|
||||
Stringer = str.encode("utf-16")
|
||||
except UnicodeDecodeError:
|
||||
print "UTF_16 Error"
|
||||
Stringer = str
|
||||
else:
|
||||
return Stringer
|
||||
else:
|
||||
return Stringer
|
||||
return Stringer
|
||||
def explode_this(self,chaine,length):
|
||||
chaine = rstrip(chaine)
|
||||
ast = list(chaine)
|
||||
i = length
|
||||
while i <= len(ast):
|
||||
ast.insert(i,'\n')
|
||||
i = i + length
|
||||
chaine = str("".join(ast))
|
||||
return chaine
|
||||
def repair_string(self, chaine):
|
||||
ast = list(chaine)
|
||||
UnicodeAst = []
|
||||
i = 0
|
||||
while i < len(ast):
|
||||
elem = ast[i]
|
||||
try:
|
||||
elem.encode("utf-8")
|
||||
except UnicodeDecodeError:
|
||||
to_reencode = elem + ast[i+1]
|
||||
print str(to_reencode)
|
||||
Good_char = to_reencode.decode('utf-8')
|
||||
UnicodeAst.append(Good_char)
|
||||
i += i +2
|
||||
else:
|
||||
UnicodeAst.append(elem)
|
||||
i += i + 1
|
||||
|
||||
|
||||
return "".join(UnicodeAst)
|
||||
|
||||
def ReencodeAscii(self,str):
|
||||
print sys.stdin.encoding
|
||||
try:
|
||||
Stringer = str.decode("ascii")
|
||||
except UnicodeEncodeError:
|
||||
print "REENCODING ERROR"
|
||||
return str.encode("ascii")
|
||||
except UnicodeDecodeError:
|
||||
print "DECODING ERROR"
|
||||
return str.encode("ascii")
|
||||
|
||||
else:
|
||||
return Stringer
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -60,7 +60,6 @@
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="6,-1" stop="6,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table1">
|
||||
<blockAlignment value="LEFT"/>
|
||||
@@ -245,7 +244,7 @@
|
||||
<para style="Standard">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="284.0,64.0,64.0,52.0,75.0" style="Tableau6">
|
||||
<blockTable colWidths="283.0,71.0,57.0,57.0,71.0" style="Tableau6">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Description / Taxes</para>
|
||||
@@ -266,7 +265,7 @@
|
||||
</blockTable>
|
||||
<section>
|
||||
<para style="terp_default_8">[[ repeatIn(invoice_lines(o), 'a') ]]</para>
|
||||
<blockTable colWidths="4.0,280.0,44.0,21.0,66.0,53.0,71.0" style="Table_Invoice_Line_Content">
|
||||
<blockTable colWidths="4.0,280.0,71.0,57.0,57.0,71.0" style="Table_Invoice_Line_Content">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ a['type']=='text' and removeParentNode('blockTable')]]</para>
|
||||
@@ -275,10 +274,7 @@
|
||||
<para style="terp_default_9"><font face="Helvetica">[[ ((a['type']=='title' or a['type']=='subtotal') and ( setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]]</font>[[ a['name'] ]] [[ a['type']=='article' and ('/ (' + a['tax_types'] + ')' ) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9"><font face="Helvetica">[[ (a['type']=='subtotal' and ( setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]]</font>[[ a['quantity'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ a['uos'] ]]</para>
|
||||
<para style="terp_default_Right_9"><font face="Helvetica">[[ (a['type']=='subtotal' and ( setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]]</font>[[ a['quantity'] ]] [[ a['uos'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9"><font face="Helvetica">[[ (a['type']=='subtotal' and ( setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]]</font>[[ a['price_unit'] ]]</para>
|
||||
@@ -322,11 +318,6 @@
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Note">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="4.0,278.0,257.0" style="Table1">
|
||||
@@ -344,8 +335,8 @@
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="terp_default_1">[[ a['type']!='break' and removeParentNode('pageBreak')]]</para>
|
||||
<blockTable colWidths="284.0,64.0,64.0,52.0,75.0" style="Table2">
|
||||
<pageBreak style="terp_default_1">[[ a['type']!='break' and removeParentNode('pageBreak')]]</pageBreak>
|
||||
<blockTable colWidths="283.0,71.0,57.0,57.0,71.0" style="Table2">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Description / Taxes [[ a['type']!='break' and removeParentNode('blockTable')]]</para>
|
||||
@@ -365,7 +356,7 @@
|
||||
</tr>
|
||||
</blockTable>
|
||||
</section>
|
||||
<blockTable colWidths="405.0,59.0,74.0" style="Tableau3">
|
||||
<blockTable colWidths="395.0,59.0,85.0" style="Tableau3">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">
|
||||
@@ -380,7 +371,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="405.0,59.0,74.0" style="Table4">
|
||||
<blockTable colWidths="395.0,59.0,85.0" style="Table4">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">
|
||||
@@ -395,7 +386,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="405.0,59.0,74.0" style="Table6">
|
||||
<blockTable colWidths="395.0,59.0,85.0" style="Table6">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">
|
||||
@@ -416,7 +407,7 @@
|
||||
<para style="terp_default_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="206.0,50.0,52.0,230.0" style="Table7">
|
||||
<blockTable colWidths="205.0,71.0,71.0,191.0" style="Table7">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Tax [[ o.tax_line==[] and removeParentNode('blockTable') ]]</para>
|
||||
@@ -436,7 +427,7 @@
|
||||
</blockTable>
|
||||
<section>
|
||||
<para style="terp_default_8">[[ repeatIn(o.tax_line,'t') ]]</para>
|
||||
<blockTable colWidths="206.0,49.0,52.0,230.0" style="Table8">
|
||||
<blockTable colWidths="206.0,71.0,71.0,191.0" style="Table8">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_8">[[ t.name ]]</para>
|
||||
|
||||
@@ -60,7 +60,6 @@
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="6,-1" stop="6,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table1">
|
||||
<blockAlignment value="LEFT"/>
|
||||
@@ -249,7 +248,7 @@
|
||||
<para style="Standard">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="284.0,64.0,64.0,52.0,75.0" style="Tableau6">
|
||||
<blockTable colWidths="283.0,71.0,57.0,57.0,71.0" style="Tableau6">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Description / Taxes</para>
|
||||
@@ -270,7 +269,7 @@
|
||||
</blockTable>
|
||||
<section>
|
||||
<para style="terp_default_8">[[ repeatIn(invoice_lines(o), 'a') ]]</para>
|
||||
<blockTable colWidths="4.0,280.0,44.0,21.0,66.0,53.0,71.0" style="Table_Invoice_Line_Content">
|
||||
<blockTable colWidths="4.0,280.0,71.0,57.0,57.0,71.0" style="Table_Invoice_Line_Content">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ a['type']=='text' and removeParentNode('blockTable')]]</para>
|
||||
@@ -279,10 +278,7 @@
|
||||
<para style="terp_default_9"><font face="Helvetica">[[ ((a['type']=='title' or a['type']=='subtotal') and ( setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]]</font>[[ a['name'] ]] [[ a['type']=='article' and ('/ (' + a['tax_types'] +' )' ) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9"><font face="Helvetica">[[ (a['type']=='subtotal' and ( setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]]</font>[[ a['quantity'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ a['uos'] ]]</para>
|
||||
<para style="terp_default_Right_9"><font face="Helvetica">[[ (a['type']=='subtotal' and ( setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]]</font>[[ a['quantity'] ]] [[ a['uos'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9"><font face="Helvetica">[[ (a['type']=='subtotal' and ( setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]]</font>[[ a['price_unit'] ]]</para>
|
||||
@@ -326,11 +322,6 @@
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Note">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="4.0,278.0,257.0" style="Table1">
|
||||
@@ -348,8 +339,8 @@
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="terp_default_1">[[ a['type']!='break' and removeParentNode('pageBreak')]]</para>
|
||||
<blockTable colWidths="284.0,64.0,64.0,52.0,75.0" style="Table2">
|
||||
<pageBreak style="terp_default_1">[[ a['type']!='break' and removeParentNode('pageBreak')]]</pageBreak>
|
||||
<blockTable colWidths="283.0,71.0,57.0,57.0,71.0" style="Table2">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Description / Taxes [[ a['type']!='break' and removeParentNode('blockTable')]]</para>
|
||||
@@ -369,7 +360,7 @@
|
||||
</tr>
|
||||
</blockTable>
|
||||
</section>
|
||||
<blockTable colWidths="405.0,59.0,74.0" style="Tableau3">
|
||||
<blockTable colWidths="395.0,59.0,85.0" style="Tableau3">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">
|
||||
@@ -384,7 +375,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="405.0,59.0,74.0" style="Table4">
|
||||
<blockTable colWidths="395.0,59.0,85.0" style="Table4">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">
|
||||
@@ -399,7 +390,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="405.0,59.0,74.0" style="Table6">
|
||||
<blockTable colWidths="395.0,59.0,85.0" style="Table6">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">
|
||||
@@ -420,7 +411,7 @@
|
||||
<para style="terp_default_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="209.0,54.0,46.0,229.0" style="Table7">
|
||||
<blockTable colWidths="209.0,71.0,71.0,188.0" style="Table7">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Tax [[ o.tax_line==[] and removeParentNode('blockTable') ]]</para>
|
||||
@@ -440,7 +431,7 @@
|
||||
</blockTable>
|
||||
<section>
|
||||
<para style="terp_default_1">[[ repeatIn(o.tax_line,'t') ]]</para>
|
||||
<blockTable colWidths="209.0,55.0,46.0,229.0" style="Table8">
|
||||
<blockTable colWidths="209.0,71.0,71.0,188.0" style="Table8">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_8">[[ t.name ]]</para>
|
||||
|
||||
@@ -1,150 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from report import report_sxw
|
||||
|
||||
from datetime import datetime
|
||||
import re
|
||||
|
||||
class rml_parse(report_sxw.rml_parse):
|
||||
def __init__(self, cr, uid, name, context):
|
||||
super(rml_parse, self).__init__(cr, uid, name, context=None)
|
||||
self.localcontext.update({
|
||||
'comma_me': self.comma_me,
|
||||
'format_date': self._get_and_change_date_format_for_swiss,
|
||||
'strip_name': self._strip_name,
|
||||
'explode_name': self._explode_name,
|
||||
})
|
||||
|
||||
def comma_me(self, amount):
|
||||
if not amount:
|
||||
amount = 0.0
|
||||
if type(amount) is float:
|
||||
amount = str('%.2f'%amount)
|
||||
else:
|
||||
amount = str(amount)
|
||||
if (amount == '0'):
|
||||
return ' '
|
||||
orig = amount
|
||||
new = re.sub("^(-?\d+)(\d{3})", "\g<1>'\g<2>", amount)
|
||||
if orig == new:
|
||||
return new
|
||||
else:
|
||||
return self.comma_me(new)
|
||||
|
||||
def _ellipsis(self, string, maxlen=100, ellipsis = '...'):
|
||||
ellipsis = ellipsis or ''
|
||||
try:
|
||||
return string[:maxlen - len(ellipsis) ] + (ellipsis, '')[len(string) < maxlen]
|
||||
except:
|
||||
return False
|
||||
|
||||
def _strip_name(self, name, maxlen=50):
|
||||
return self._ellipsis(name, maxlen, '...')
|
||||
|
||||
def _get_and_change_date_format_for_swiss (self, date_to_format):
|
||||
date_formatted = ''
|
||||
if date_to_format:
|
||||
date_formatted = datetime.strptime(date_to_format,'%Y-%m-%d').strftime('%d.%m.%Y')
|
||||
return date_formatted
|
||||
|
||||
def _explode_name(self, chaine, length):
|
||||
# We will test if the size is less then account
|
||||
full_string = ''
|
||||
if (len(str(chaine)) <= length):
|
||||
return chaine
|
||||
#
|
||||
else:
|
||||
chaine = unicode(chaine,'utf8').encode('iso-8859-1')
|
||||
rup = 0
|
||||
for carac in chaine:
|
||||
rup = rup + 1
|
||||
if rup == length:
|
||||
full_string = full_string + '\n'
|
||||
full_string = full_string + carac
|
||||
rup = 0
|
||||
else:
|
||||
full_string = full_string + carac
|
||||
|
||||
return full_string
|
||||
|
||||
def makeAscii(self, str):
|
||||
try:
|
||||
Stringer = str.encode("utf-8")
|
||||
except UnicodeDecodeError:
|
||||
try:
|
||||
Stringer = str.encode("utf-16")
|
||||
except UnicodeDecodeError:
|
||||
Stringer = str
|
||||
else:
|
||||
return Stringer
|
||||
else:
|
||||
return Stringer
|
||||
return Stringer
|
||||
|
||||
def explode_this(self, chaine, length):
|
||||
chaine = rstrip(chaine)
|
||||
ast = list(chaine)
|
||||
i = length
|
||||
while i <= len(ast):
|
||||
ast.insert(i,'\n')
|
||||
i = i + length
|
||||
chaine = str("".join(ast))
|
||||
return chaine
|
||||
|
||||
def repair_string(self, chaine):
|
||||
ast = list(chaine)
|
||||
UnicodeAst = []
|
||||
_previouslyfound = False
|
||||
i = 0
|
||||
while i < len(ast):
|
||||
elem = ast[i]
|
||||
try:
|
||||
Stringer = elem.encode("utf-8")
|
||||
except UnicodeDecodeError:
|
||||
to_reencode = elem + ast[i+1]
|
||||
Good_char = to_reencode.decode('utf-8')
|
||||
UnicodeAst.append(Good_char)
|
||||
i += i +2
|
||||
else:
|
||||
UnicodeAst.append(elem)
|
||||
i += i + 1
|
||||
return "".join(UnicodeAst)
|
||||
|
||||
def ReencodeAscii(self, str):
|
||||
try:
|
||||
Stringer = str.decode("ascii")
|
||||
except UnicodeEncodeError:
|
||||
return str.encode("ascii")
|
||||
except UnicodeDecodeError:
|
||||
return str.encode("ascii")
|
||||
else:
|
||||
return Stringer
|
||||
|
||||
def _add_header(self, node, header=1):
|
||||
if header == 2:
|
||||
rml_head = self.rml_header2
|
||||
else:
|
||||
rml_head = self.rml_header
|
||||
rml_head = rml_head.replace('<pageGraphics>','''<pageGraphics> <image x="10" y="26cm" height="770.0" width="1120.0" >[[company.logo]] </image> ''')
|
||||
return True
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -28,9 +28,8 @@ import datetime
|
||||
from report import report_sxw
|
||||
import time
|
||||
import pooler
|
||||
import rml_parse
|
||||
|
||||
class employees_salary_report(rml_parse.rml_parse):
|
||||
class employees_salary_report(report_sxw.rml_parse):
|
||||
|
||||
def __init__(self, cr, uid, name, context):
|
||||
super(employees_salary_report, self).__init__(cr, uid, name, context)
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
|
||||
import time
|
||||
from datetime import datetime
|
||||
|
||||
from report import report_sxw
|
||||
from tools import amount_to_text_en
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
##############################################################################
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
from report import report_sxw
|
||||
from tools import amount_to_text_en
|
||||
|
||||
|
||||
@@ -26,9 +26,8 @@ import datetime
|
||||
from report import report_sxw
|
||||
import time
|
||||
import pooler
|
||||
import rml_parse
|
||||
|
||||
class year_salary_report(rml_parse.rml_parse):
|
||||
class year_salary_report(report_sxw.rml_parse):
|
||||
|
||||
def __init__(self, cr, uid, name, context):
|
||||
super(year_salary_report, self).__init__(cr, uid, name, context)
|
||||
|
||||
@@ -1,154 +0,0 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
|
||||
# $Id$
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
from time import strptime
|
||||
|
||||
from report import report_sxw
|
||||
import re
|
||||
from lxml import etree
|
||||
|
||||
|
||||
class rml_parse(report_sxw.rml_parse):
|
||||
def __init__(self, cr, uid, name, context):
|
||||
super(rml_parse, self).__init__(cr, uid, name, context=None)
|
||||
self.localcontext.update({
|
||||
'comma_me': self.comma_me,
|
||||
'format_date': self._get_and_change_date_format_for_swiss,
|
||||
'strip_name' : self._strip_name,
|
||||
'explode_name' : self._explode_name,
|
||||
})
|
||||
|
||||
def comma_me(self,amount):
|
||||
if not amount:
|
||||
amount = 0.0
|
||||
if type(amount) is float :
|
||||
amount = str('%.2f'%amount)
|
||||
else :
|
||||
amount = str(amount)
|
||||
if (amount == '0'):
|
||||
return ' '
|
||||
orig = amount
|
||||
new = re.sub("^(-?\d+)(\d{3})", "\g<1>'\g<2>", amount)
|
||||
if orig == new:
|
||||
return new
|
||||
else:
|
||||
return self.comma_me(new)
|
||||
|
||||
def _ellipsis(self, string, maxlen=100, ellipsis = '...'):
|
||||
ellipsis = ellipsis or ''
|
||||
try:
|
||||
return string[:maxlen - len(ellipsis) ] + (ellipsis, '')[len(string) < maxlen]
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
def _strip_name(self, name, maxlen=50):
|
||||
return self._ellipsis(name, maxlen, '...')
|
||||
|
||||
def _get_and_change_date_format_for_swiss (self,date_to_format):
|
||||
date_formatted=''
|
||||
if date_to_format:
|
||||
date_formatted = strptime(date_to_format,'%Y-%m-%d').strftime('%d.%m.%Y')
|
||||
return date_formatted
|
||||
|
||||
def _explode_name(self,chaine,length):
|
||||
# We will test if the size is less then account
|
||||
full_string = ''
|
||||
if (len(str(chaine)) <= length):
|
||||
return chaine
|
||||
#
|
||||
else:
|
||||
chaine = unicode(chaine,'utf8').encode('iso-8859-1')
|
||||
rup = 0
|
||||
for carac in chaine:
|
||||
rup = rup + 1
|
||||
if rup == length:
|
||||
full_string = full_string + '\n'
|
||||
full_string = full_string + carac
|
||||
rup = 0
|
||||
else:
|
||||
full_string = full_string + carac
|
||||
|
||||
return full_string
|
||||
|
||||
def makeAscii(self,str):
|
||||
try:
|
||||
Stringer = str.encode("utf-8")
|
||||
except UnicodeDecodeError:
|
||||
try:
|
||||
Stringer = str.encode("utf-16")
|
||||
except UnicodeDecodeError:
|
||||
print "UTF_16 Error"
|
||||
Stringer = str
|
||||
else:
|
||||
return Stringer
|
||||
else:
|
||||
return Stringer
|
||||
return Stringer
|
||||
|
||||
def explode_this(self,chaine,length):
|
||||
chaine = chaine.rstrip()
|
||||
ast = list(chaine)
|
||||
i = length
|
||||
while i <= len(ast):
|
||||
ast.insert(i,'\n')
|
||||
i = i + length
|
||||
chaine = str("".join(ast))
|
||||
return chaine
|
||||
|
||||
def repair_string(self,chaine):
|
||||
ast = list(chaine)
|
||||
UnicodeAst = []
|
||||
i = 0
|
||||
while i < len(ast):
|
||||
elem = ast[i]
|
||||
try:
|
||||
Stringer = elem.encode("utf-8")
|
||||
except UnicodeDecodeError:
|
||||
to_reencode = elem + ast[i+1]
|
||||
print str(to_reencode)
|
||||
Good_char = to_reencode.decode('utf-8')
|
||||
UnicodeAst.append(Good_char)
|
||||
i += i +2
|
||||
else:
|
||||
UnicodeAst.append(elem)
|
||||
i += i + 1
|
||||
return "".join(UnicodeAst)
|
||||
|
||||
def _add_header(self, node, header='external'):
|
||||
if header=='internal':
|
||||
rml_head = self.rml_header2
|
||||
elif header=='internal landscape':
|
||||
rml_head = self.rml_header3
|
||||
else:
|
||||
rml_head = self.rml_header
|
||||
rml_head = rml_head.replace('<pageGraphics>','''<pageGraphics> <image x="10" y="26cm" height="770.0" width="1120.0" >[[company.logo]] </image> ''')
|
||||
rml_dom = node
|
||||
head_dom = etree.XML(rml_head)
|
||||
for tag in head_dom:
|
||||
found = rml_dom.find('.//'+tag.tag)
|
||||
if found is not None and len(found):
|
||||
if tag.get('position'):
|
||||
found.append(tag)
|
||||
else :
|
||||
found.getparent().replace(found,tag)
|
||||
return True
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -226,7 +226,7 @@
|
||||
<para style="terp_default_9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="179.0,82.0,73.0,64.0,56.0,79.0" repeatRows="1" style="Table_Header_Pur_ord_Line">
|
||||
<blockTable colWidths="180.0,85.0,71.0,71.0,57.0,71.0" repeatRows="1" style="Table_Header_Pur_ord_Line">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Description</para>
|
||||
@@ -250,7 +250,7 @@
|
||||
</blockTable>
|
||||
<section>
|
||||
<para style="terp_default_8">[[repeatIn(o.order_line,'line')]]</para>
|
||||
<blockTable colWidths="179.0,82.0,73.0,64.0,57.0,79.0" style="Table_Order_Pur_line_Content">
|
||||
<blockTable colWidths="179.0,85.0,71.0,71.0,57.0,71.0" style="Table_Order_Pur_line_Content">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ line.name ]]</para>
|
||||
@@ -265,7 +265,7 @@
|
||||
<para style="terp_default_Right_9">[[ formatLang(line.product_qty ) ]] [[ line.product_uom.name ]] </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="Standard">[[ formatLang(line.price_unit, digits=get_digits(dp='Purchase Price') ) ]]</para>
|
||||
<para style="terp_default_Right_9">[[ formatLang(line.price_unit, digits=get_digits(dp='Purchase Price') ) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang(line.price_subtotal, digits=get_digits(dp='Purchase Price') ) ]] [[ o.pricelist_id.currency_id.symbol ]]</para>
|
||||
@@ -303,7 +303,7 @@
|
||||
</tr>
|
||||
</blockTable>
|
||||
</section>
|
||||
<blockTable colWidths="391.0,55.0,88.0" style="Table_All_Total_Detail">
|
||||
<blockTable colWidths="394.0,55.0,85.0" style="Table_All_Total_Detail">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">
|
||||
|
||||
Reference in New Issue
Block a user