Commit a4a7b322 by aa.gusti

portal dashboard

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