Browse Source

[FIX] Open Invoices - Minor improvment

[FIX] Wrong css classes in CSS
pull/196/head
Francesco Apruzzese 9 years ago
committed by Leonardo Pistone
parent
commit
104006447d
  1. 29
      account_financial_report_qweb/report/templates/open_invoice_report.xml
  2. 5
      account_financial_report_qweb/static/src/css/report.css
  3. 17
      account_financial_report_qweb/wizard/open_invoice_wizard.py

29
account_financial_report_qweb/report/templates/open_invoice_report.xml

@ -36,11 +36,10 @@
<div class="page">
<!-- Generic information -->
<div class="act_as_table data_table" style="width: 100%">
<div class="act_as_table data_table">
<div class="act_as_thead">
<div class="act_as_row labels">
<div class="act_as_cell first_column">Company</div>
<div class="act_as_cell">Fiscal Year</div>
<div class="act_as_cell">At Date</div>
<div class="act_as_cell">Accounts Filter</div>
<div class="act_as_cell">Target Moves</div>
@ -49,7 +48,6 @@
<div class="act_as_tbody">
<div class="act_as_row">
<div class="act_as_cell first_column"><span t-esc="general['company']"/></div>
<div class="act_as_cell"><span t-esc="general['fiscal_year']"/></div>
<div class="act_as_cell"><span t-esc="general['at_date']"/></div>
<div class="act_as_cell"><span t-esc="general['account_filters']"/></div>
<div class="act_as_cell"><span t-esc="general['target_moves']"/></div>
@ -73,11 +71,10 @@
<div class="act_as_caption account_title">
<span t-esc="partner"/>
</div>
<div class="act_as_table data_table" style="width:100%;">
<div class="act_as_table data_table">
<div class="act_as_thead">
<div class="act_as_row labels">
<div class="act_as_cell first_column">Date</div>
<div class="act_as_cell">Period</div>
<div class="act_as_cell">Entry</div>
<div class="act_as_cell">Journal</div>
<div class="act_as_cell">Partner</div>
@ -94,7 +91,6 @@
<t t-foreach="data[account][partner]" t-as="move">
<div class="act_as_row">
<div class="act_as_cell first_column"><span t-esc="move['date']"/></div>
<div class="act_as_cell"><span t-esc="move['period']"/></div>
<div class="act_as_cell"><span t-esc="move['entry']"/></div>
<div class="act_as_cell"><span t-esc="move['journal']"/></div>
<div class="act_as_cell"><span t-esc="partner"/></div>
@ -108,9 +104,9 @@
<t t-set="partner_debit" t-value="partner_debit + move['debit']" />
<t t-set="partner_credit" t-value="partner_credit + move['credit']" />
<t t-set="partner_balance" t-value="partner_balance - move['credit'] + move['debit']" />
<div class="act_as_cell"><span t-esc="move['debit']"/></div>
<div class="act_as_cell"><span t-esc="move['credit']"/></div>
<div class="act_as_cell"><span t-esc="partner_balance" /></div>
<div class="act_as_cell amount"><span t-esc="move['debit']"/></div>
<div class="act_as_cell amount"><span t-esc="move['credit']"/></div>
<div class="act_as_cell amount"><span t-esc="partner_balance" /></div>
</div>
</t>
<div class="act_as_row">
@ -121,22 +117,21 @@
<div class="act_as_cell"></div>
<div class="act_as_cell"></div>
<div class="act_as_cell"></div>
<div class="act_as_cell"></div>
<div class="act_as_cell">Comulate Balance on Partner</div>
<div class="act_as_cell"><span t-esc="partner_debit" /></div>
<div class="act_as_cell"><span t-esc="partner_credit" /></div>
<div class="act_as_cell"><span t-esc="partner_balance" /></div>
<div class="act_as_cell amount"><span t-esc="partner_debit" /></div>
<div class="act_as_cell amount"><span t-esc="partner_credit" /></div>
<div class="act_as_cell amount"><span t-esc="partner_balance" /></div>
</div>
</div>
</div>
</t>
<div class="act_as_table data_table" style="width: 1205px">
<div class="act_as_table data_table">
<div class="act_as_tbody">
<div class="act_as_row">
<div class="act_as_cell first_column"><strong><span t-esc="account"/> Comulate Balance</strong></div>
<div class="act_as_cell"><span t-esc="account_debit" /></div>
<div class="act_as_cell"><span t-esc="account_credit" /></div>
<div class="act_as_cell"><span t-esc="account_balance" /></div>
<div class="act_as_cell amount"><span t-esc="account_debit" /></div>
<div class="act_as_cell amount"><span t-esc="account_credit" /></div>
<div class="act_as_cell amount"><span t-esc="account_balance" /></div>
</div>
</div>
</div>

5
account_financial_report_qweb/static/src/css/report.css

@ -18,11 +18,8 @@ body, table, td, span, div {
.act_as_tbody {
display: table-row-group !important;
}
.act_as_caption {
display: table-caption !important;
}
.list_table, .data_table {
width: 690px !important;
width: 100% !important;
table-layout: fixed !important;
}
.act_as_row.labels {

17
account_financial_report_qweb/wizard/open_invoice_wizard.py

@ -87,7 +87,6 @@ class OpenInvoiceWizard(models.TransientModel):
label=label, inv_nummber=move.invoice_id.number)
return {
'date': move.date,
'period': '',
'entry': move.move_id.name,
'journal': move.move_id.journal_id.code,
'reference': move.ref,
@ -106,11 +105,15 @@ class OpenInvoiceWizard(models.TransientModel):
return True # ----- Show a message here
datas = {}
for move in moves:
if move.account_id.name not in datas:
datas[move.account_id.name] = {}
if move.partner_id.name not in datas[move.account_id.name]:
datas[move.account_id.name][move.partner_id.name] = []
datas[move.account_id.name][move.partner_id.name].append(
account = '{code} - {name}'.format(
code=move.account_id.code,
name=move.account_id.name)
partner = move.partner_id.name
if account not in datas:
datas[account] = {}
if partner not in datas[account]:
datas[account][partner] = []
datas[account][partner].append(
self._get_move_line_data(move))
generals = {
'company': self.company_id.name,
@ -122,6 +125,6 @@ class OpenInvoiceWizard(models.TransientModel):
'target_moves': dict(
self._columns['target_move'].selection)[self.target_move],
}
return self.env['report'].with_context(landscape=True).get_action(
return self.env['report'].get_action(
self, 'account_financial_report_qweb.open_invoice_report_qweb',
data={'data': datas, 'general': generals})
Loading…
Cancel
Save