small changes in third_party_ledger...
bzr revid: patelamit2003@gmail.com-20080917133237-tvau3aww9yumu867
This commit is contained in:
parent
ccd168a55d
commit
44f3f10d5c
|
@ -63,28 +63,20 @@ class third_party_ledger(report_sxw.rml_parse):
|
|||
#
|
||||
def transform_period_into_date_array(self,data):
|
||||
## Get All Period Date
|
||||
|
||||
if not data['form']['periods'][0][2] :
|
||||
periods_id = self.pool.get('account.period').search(self.cr, self.uid, [('fiscalyear_id','=',data['form']['fiscalyear'])])
|
||||
|
||||
else:
|
||||
periods_id = data['form']['periods'][0][2]
|
||||
|
||||
date_array = []
|
||||
for period_id in periods_id:
|
||||
period_obj = self.pool.get('account.period').browse(self.cr, self.uid, period_id)
|
||||
date_array = date_array + self.date_range(period_obj.date_start,period_obj.date_stop)
|
||||
|
||||
self.date_lst = date_array
|
||||
print"self.date_lst[len(self.date_lst)-1]",self.date_lst[len(self.date_lst)-1]
|
||||
self.date_lst.sort()
|
||||
|
||||
|
||||
def transform_date_into_date_array(self,data):
|
||||
|
||||
return_array = self.date_range(data['form']['date1'],data['form']['date2'])
|
||||
self.date_lst = return_array
|
||||
|
||||
self.date_lst.sort()
|
||||
|
||||
def comma_me(self,amount):
|
||||
|
@ -96,7 +88,6 @@ class third_party_ledger(report_sxw.rml_parse):
|
|||
return ' '
|
||||
orig = amount
|
||||
new = re.sub("^(-?\d+)(\d{3})", "\g<1>'\g<2>", amount)
|
||||
|
||||
if orig == new:
|
||||
return new
|
||||
else:
|
||||
|
@ -108,17 +99,12 @@ class third_party_ledger(report_sxw.rml_parse):
|
|||
return string_map
|
||||
|
||||
def preprocess(self, objects, data, ids):
|
||||
print"====objects====",objects
|
||||
for o in objects:
|
||||
print o.id
|
||||
PARTNER_REQUEST = ''
|
||||
if (data['model'] == 'res.partner'):
|
||||
print"data['model']",data['model']
|
||||
## Si on imprime depuis les partenaires
|
||||
if ids:
|
||||
print"ids",ids
|
||||
PARTNER_REQUEST = "AND line.partner_id IN (" + ','.join(map(str, ids)) + ")"
|
||||
print"PARTNER_REQUEST",PARTNER_REQUEST
|
||||
# Transformation des date
|
||||
#
|
||||
#
|
||||
|
@ -147,11 +133,8 @@ class third_party_ledger(report_sxw.rml_parse):
|
|||
" " + ACCOUNT_TYPE + " " \
|
||||
"AND a.active", (data['form']['company_id'],))
|
||||
self.account_ids = ','.join([str(a) for (a,) in self.cr.fetchall()])
|
||||
|
||||
account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line')
|
||||
partner_to_use = []
|
||||
print"self.account_ids",self.account_ids
|
||||
|
||||
if data['form']['soldeinit'] :
|
||||
self.cr.execute(
|
||||
"SELECT DISTINCT line.partner_id " \
|
||||
|
@ -178,26 +161,18 @@ class third_party_ledger(report_sxw.rml_parse):
|
|||
"AND account.active " ,
|
||||
(data['form']['company_id']))
|
||||
res = self.cr.dictfetchall()
|
||||
print"===res===",res
|
||||
for res_line in res:
|
||||
partner_to_use.append(res_line['partner_id'])
|
||||
print"====partner_to_use====",partner_to_use
|
||||
res = self.cr.dictfetchall()
|
||||
|
||||
for res_line in res:
|
||||
partner_to_use.append(res_line['partner_id'])
|
||||
print"====partner_to_use====",partner_to_use
|
||||
|
||||
|
||||
new_ids = partner_to_use
|
||||
print"new_ids",new_ids
|
||||
self.partner_ids = ','.join(map(str, new_ids))
|
||||
objects = self.pool.get('res.partner').browse(self.cr, self.uid, new_ids)
|
||||
print"objects",objects
|
||||
super(third_party_ledger, self).preprocess(objects, data, new_ids)
|
||||
|
||||
def lines(self, partner,data):
|
||||
print"====partner====",partner
|
||||
account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line')
|
||||
full_account = []
|
||||
if data['form']['reconcil'] :
|
||||
|
|
|
@ -86,13 +86,13 @@
|
|||
</initialize>
|
||||
<paraStyle name="P1" fontName="Helvetica" fontSize="20.0" leading="25" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P2" fontName="Helvetica" fontSize="10.0" leading="13" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P3" fontName="Helvetica" fontSize="7.0" leading="10" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P4" fontName="Helvetica" fontSize="7.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P5" fontName="Helvetica" fontSize="7.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P3" fontName="Helvetica" fontSize="7.5" leading="10" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P4" fontName="Helvetica" fontSize="7.5" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P5" fontName="Helvetica" fontSize="7.5" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P6" fontName="Helvetica" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P7" fontName="Helvetica" fontSize="8.0" leading="14" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Balance" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P8" fontName="Helvetica-Bold" fontSize="8.5" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Balance" fontName="Helvetica-Bold" fontSize="8.5" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P9" fontName="Helvetica-Bold" alignment="CENTER" fontSize="14.5" leftIndent="-5.0"/>
|
||||
<paraStyle name="P9a" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P9c" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
|
@ -103,7 +103,7 @@
|
|||
<paraStyle name="P12" fontName="Helvetica" fontSize="8.0" leading="12" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P13" fontName="Helvetica" fontSize="8.0" leading="10" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P14" fontName="Helvetica-Bold" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P15" rightIndent="17.0" leftIndent="-0.0" fontName="Helvetica" fontSize="7.0" leading="10" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P15" rightIndent="17.0" leftIndent="-0.0" fontName="Helvetica" fontSize="7.5" leading="10" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P16" fontName="Helvetica" fontSize="8.0" leading="12" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Standard" fontName="Helvetica"/>
|
||||
<paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
|
@ -120,7 +120,7 @@
|
|||
</para>
|
||||
<para>
|
||||
<font color="white">[[ data['form']['page_split'] == True or removeParentNode('para') ]] </font>
|
||||
<font color="white">[[ repeatIn(objects, 'p') ]]</font>
|
||||
<font color="white">[[ repeatIn(objects, 'p') ]] [[ setLang(p.partner_id.lang) ]]</font>
|
||||
</para>
|
||||
<blockTable colWidths="45.0,37.0,120.0,135.0,69.0,72.0,63.0" style="tbl_heading">
|
||||
<tr>
|
||||
|
@ -169,7 +169,7 @@
|
|||
|
||||
<para >
|
||||
|
||||
<font color="white">[[ repeatIn(objects, 'p') ]]</font>
|
||||
<font color="white">[[ repeatIn(objects, 'p') ]] </font>
|
||||
</para>
|
||||
|
||||
<blockTable colWidths="200.0,137.0,69.0,72.0,63.0" repeatRows="1" style="Table5">
|
||||
|
|
Loading…
Reference in New Issue