Commit a4a7b322 by aa.gusti

portal dashboard

1 parent c82770b1
......@@ -68,12 +68,7 @@ class IdgBoardWebsite(Website):
# , date_begin=None, date_end=None, sortby=None, filterby=None, **kw):
values = self._prepare_portal_layout_values()
domain = [('level', '=', 6)]
# domain = []
searchbar_sortings = {}
# if not sortby:
# sortby = 'code_prefix_start'
# sortby = 'id'
# order = searchbar_sortings[sortby]['order']
IdgTaxSum = request.env['idg.region.tax.potency.sum'].sudo()
tax_count = IdgTaxSum.search_count(domain)
if not filterby:
......@@ -82,28 +77,32 @@ class IdgBoardWebsite(Website):
pager = portal_pager(
url="/idg/board",
url_args={
# 'sortby': sortby,
'filterby': filterby
},
total=tax_count,
page=page,
step=self._items_per_page
)
taxs = IdgTaxSum.search(
domain,
# order=order,
province_domain = ['&', ('level', '=', 6),
('district_id', '=', None)]
province_taxs = IdgTaxSum.search(
province_domain,
limit=self._items_per_page,
offset=pager['offset']
)
district_domain = ['&', ('level', '=', 6),
('district_id', '!=', None)]
district_taxs = IdgTaxSum.search(
district_domain,
limit=self._items_per_page,
offset=pager['offset']
)
values.update({
'taxs': taxs,
'province_taxs': province_taxs,
'district_taxs': district_taxs,
'page_name': 'idgtax',
'pager': pager,
# 'searchbar_sortings': searchbar_sortings,
# 'sortby': sortby,
# 'searchbar_filters': OrderedDict(sorted(searchbar_filters.items())),
'filterby': filterby,
'default_url': '/idg/board',
})
return request.render("idg_board.portal_idg_boards", values)
......@@ -4,7 +4,9 @@
<template id="portal_idg_boards">
<t t-call="website.layout">
<t t-set="title">IDG Tax Dashboard</t>
<h2>IDG Region Tax Dashboard #</h2>
<div class="row">
<div class="col-sm-6">
<h2>IDG Province Potency#</h2>
<t t-call="portal.portal_table">
<thead>
<tr class="active">
......@@ -14,7 +16,7 @@
</tr>
</thead>
<tbody>
<t t-foreach="taxs" t-as="tax">
<t t-foreach="province_taxs" t-as="tax">
<tr>
<td>
<a t-att-href="tax.get_portal_url()">
......@@ -31,8 +33,39 @@
</t>
</tbody>
</t>
</div>
<div class="col-sm-6">
<h2>IDG District Potency #</h2>
<t t-call="portal.portal_table">
<thead>
<tr class="active">
<th class="text-left">Tax Category</th>
<th class="text-right">Qty</th>
<th class="text-right">Amount</th>
</tr>
</thead>
<tbody>
<t t-foreach="district_taxs" t-as="tax">
<tr>
<td>
<a t-att-href="tax.get_portal_url()">
<t t-esc="tax.account_group_id.name"/>
</a>
</td>
<td class="text-right">
<span t-field="tax.qty"/>
</td>
<td class="text-right">
<span t-field="tax.amount"/>
</td>
</tr>
</t>
</tbody>
</t>
</div>
</div>
</t>
</template>
</data>
</openerp>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!