Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
iwan
/
eis
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 059f81a7
authored
Sep 19, 2022
by
suri
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
eis tasik act dasboard
1 parent
18e626e8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
views/eis.py
views/eis.py
View file @
059f81a
...
@@ -8,6 +8,9 @@ from pyramid.httpexceptions import (
...
@@ -8,6 +8,9 @@ from pyramid.httpexceptions import (
from
..views
import
BaseView
from
..views
import
BaseView
from
..models
import
EisDBSession
from
..models
import
EisDBSession
from
..models.eis
import
Eis
,
Chart
,
ChartItem
,
Slide
from
..models.eis
import
Eis
,
Chart
,
ChartItem
,
Slide
from
datatables
import
ColumnDT
,
DataTables
from
sqlalchemy
import
not_
,
func
,
literal_column
,
and_
,
or_
,
String
from
sqlalchemy.sql.expression
import
cast
#from ..tools import row2dict
#from ..tools import row2dict
########
########
# APP Home #
# APP Home #
...
@@ -106,4 +109,24 @@ class eis(BaseView):
...
@@ -106,4 +109,24 @@ class eis(BaseView):
json_data
[
'success'
]
=
True
json_data
[
'success'
]
=
True
return
json_data
return
json_data
elif
req
.
matchdict
[
'act'
]
==
'dasboard'
:
columns
=
[
ColumnDT
(
Eis
.
nama
,
mData
=
"jenis_pajak"
),
ColumnDT
(
literal_column
(
"'0'"
),
mData
=
"target"
),
ColumnDT
(
Eis
.
amt_bulan
,
mData
=
"realisasi_bulan_ini"
),
ColumnDT
(
Eis
.
amt_tahun
,
mData
=
"realisasi_sampai_dengan"
),
ColumnDT
(
Eis
.
amt_tahun
,
mData
=
"sisa_target"
),
ColumnDT
((
Eis
.
amt_bulan
/
Eis
.
amt_tahun
)
*
100
,
mData
=
"persen"
),
]
max_tahun
=
EisDBSession
.
query
(
func
.
max
(
Eis
.
tahun
))
.
scalar
()
query
=
EisDBSession
.
query
()
.
select_from
(
Eis
)
.
\
outerjoin
(
Slide
,
Slide
.
source_id
==
cast
(
Eis
.
id
,
String
))
.
\
outerjoin
(
ChartItem
,
and_
(
cast
(
ChartItem
.
id
,
String
)
==
Slide
.
source_id
,
Slide
.
id
==
Slide
.
id
+
1
))
.
\
filter
(
Eis
.
tahun
==
max_tahun
,
Eis
.
nama
!=
'PAJAK DAERAH'
)
.
order_by
(
Eis
.
order_id
)
rowTable
=
DataTables
(
req
.
GET
,
query
,
columns
)
return
rowTable
.
output_result
()
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment