174
176
return self.sum_debit
176
178
report_sxw.report_sxw('report.account.account.balance', 'account.account', 'addons/account/report/account_balance.rml', parser=account_balance, header=False)
180
class account_balance_report_xls(report_xls):
181
def generate_xls_report(self, parser, data, obj, wb):
182
c = parser.localcontext['company']
183
ws = wb.add_sheet(('Account Balance - %s - %s' % (c.partner_id.ref, c.currency_id.name))[:31])
184
ws.panes_frozen = True
185
ws.remove_splits = True
186
ws.portrait = 0 # Landscape
187
ws.fit_width_to_pages = 1
191
('Fiscal Year', 3, 0, 'text',
192
lambda x, d, p: p.get_fiscalyear(d['form'])),
193
('Create Date', 2, 0, 'text',
194
lambda x, d, p: 'Create date: ' + p.formatLang(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()),date_time = True)),
195
('Periods', 5, 0, 'text',
196
lambda x, d, p: p.get_periods(d['form'])),
198
('Code', 1, 67, 'text',
199
lambda x, d, p: x['code']),
200
('Account', 1, 270, 'text',
201
lambda x, d, p: ' '*x['level'] + x['name']),
202
('Debit', 1, 70, 'number',
203
lambda x, d, p: x['debit']),
204
('Credit', 1, 70, 'number',
205
lambda x, d, p: x['credit']),
206
('Balance', 1, 80, 'number',
207
lambda x, d, p: x['balance']),
210
row_hdr1 = self.xls_row_template(cols_specs, ['Fiscal Year', 'Create Date'])
211
row_hdr2 = self.xls_row_template(cols_specs, ['Periods'])
212
row_balance = self.xls_row_template(cols_specs,
213
['Code','Account','Debit','Credit','Balance'])
215
hdr_style = xlwt.easyxf('pattern: pattern solid, fore_color gray25;')
216
row_normal_style= xlwt.easyxf()
217
row_bold_style = xlwt.easyxf('font: bold on;')
220
self.xls_write_row(ws, None, data, parser,
221
0, row_hdr1, hdr_style)
222
self.xls_write_row(ws, None, data, parser,
223
1, row_hdr2, hdr_style)
224
self.xls_write_row_header(ws, 2, row_balance, hdr_style, set_column_size=True)
227
ws.horz_split_pos = row_count
229
for l in parser.lines(data['form']):
231
style = row_normal_style
233
style = row_bold_style
235
self.xls_write_row(ws, l, data, parser,
236
row_count, row_balance, style)
241
account_balance_report_xls(
242
'report.account.account.balance.xls',
244
'addons/account/report/account_balance.rml',
245
parser=account_balance,
177
248
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: