Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Project
/
eis
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
1
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit cf3511d1
authored
Nov 15, 2022
by
taufikyu
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
perbaikan negatif eis
1 parent
e02375b0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
views/eis.py
views/eis.py
View file @
cf3511d
...
@@ -9,7 +9,7 @@ from ..views import BaseView
...
@@ -9,7 +9,7 @@ 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
datatables
import
ColumnDT
,
DataTables
from
sqlalchemy
import
not_
,
func
,
literal_column
,
and_
,
or_
,
String
from
sqlalchemy
import
not_
,
func
,
literal_column
,
and_
,
or_
,
String
,
Float
from
sqlalchemy.sql.expression
import
cast
from
sqlalchemy.sql.expression
import
cast
#from ..tools import row2dict
#from ..tools import row2dict
########
########
...
@@ -114,19 +114,20 @@ class eis(BaseView):
...
@@ -114,19 +114,20 @@ class eis(BaseView):
max_tahun
=
EisDBSession
.
query
(
func
.
max
(
Eis
.
tahun
))
.
scalar
()
max_tahun
=
EisDBSession
.
query
(
func
.
max
(
Eis
.
tahun
))
.
scalar
()
subq
=
EisDBSession
.
query
(
subq
=
EisDBSession
.
query
(
func
.
max
(
Eis
.
nama
)
.
label
(
'nama'
),
func
.
max
(
Eis
.
nama
)
.
label
(
'nama'
),
func
.
coalesce
(
func
.
sum
(
ChartItem
.
value_1
+
ChartItem
.
value_2
+
ChartItem
.
value_3
+
ChartItem
.
value_4
+
\
func
.
sum
(
ChartItem
.
value_1
+
ChartItem
.
value_2
+
ChartItem
.
value_3
+
ChartItem
.
value_4
+
\
ChartItem
.
value_5
+
ChartItem
.
value_6
+
ChartItem
.
value_7
+
ChartItem
.
value_8
+
ChartItem
.
value_9
+
\
ChartItem
.
value_5
+
ChartItem
.
value_6
+
ChartItem
.
value_7
+
ChartItem
.
value_8
+
ChartItem
.
value_9
+
\
ChartItem
.
value10
+
ChartItem
.
value11
+
ChartItem
.
value12
)
,
0
)
.
label
(
'target'
),
ChartItem
.
value10
+
ChartItem
.
value11
+
ChartItem
.
value12
)
.
label
(
'target'
),
func
.
coalesce
(
func
.
sum
(
Eis
.
amt_bulan
),
0
)
.
label
(
'amt_bulan'
),
func
.
sum
(
Eis
.
amt_bulan
)
.
label
(
'amt_bulan'
),
func
.
coalesce
(
func
.
sum
(
Eis
.
amt_tahun
),
0
)
.
label
(
'amt_tahun'
),
func
.
sum
(
Eis
.
amt_tahun
)
.
label
(
'amt_tahun'
),
func
.
coalesce
(
func
.
sum
(
Eis
.
amt_tahun
-
func
.
sum
(
(
ChartItem
.
value_1
+
ChartItem
.
value_2
+
ChartItem
.
value_3
+
ChartItem
.
value_4
+
ChartItem
.
value_5
+
\
(
ChartItem
.
value_1
+
ChartItem
.
value_2
+
ChartItem
.
value_3
+
ChartItem
.
value_4
+
ChartItem
.
value_5
+
\
ChartItem
.
value_6
+
ChartItem
.
value_7
+
ChartItem
.
value_8
+
ChartItem
.
value_9
+
ChartItem
.
value10
+
\
ChartItem
.
value_6
+
ChartItem
.
value_7
+
ChartItem
.
value_8
+
ChartItem
.
value_9
+
ChartItem
.
value10
+
\
ChartItem
.
value11
+
ChartItem
.
value12
)
),
0
)
.
label
(
'sisa_target'
),
ChartItem
.
value11
+
ChartItem
.
value12
)
-
Eis
.
amt_tahun
)
.
label
(
'sisa_target'
),
func
.
coalesce
((
func
.
sum
((
Eis
.
amt_tahun
-
cast
((
func
.
sum
((
(
ChartItem
.
value_1
+
ChartItem
.
value_2
+
ChartItem
.
value_3
+
ChartItem
.
value_4
+
ChartItem
.
value_5
+
\
(
ChartItem
.
value_1
+
ChartItem
.
value_2
+
ChartItem
.
value_3
+
ChartItem
.
value_4
+
ChartItem
.
value_5
+
\
ChartItem
.
value_6
+
ChartItem
.
value_7
+
ChartItem
.
value_8
+
ChartItem
.
value_9
+
ChartItem
.
value10
+
\
ChartItem
.
value_6
+
ChartItem
.
value_7
+
ChartItem
.
value_8
+
ChartItem
.
value_9
+
ChartItem
.
value10
+
\
ChartItem
.
value11
+
ChartItem
.
value12
))
/
Eis
.
amt_tahun
)
*
100
),
0
)
.
label
(
'persen'
))
.
\
ChartItem
.
value11
+
ChartItem
.
value12
)
-
Eis
.
amt_tahun
)
/
Eis
.
amt_tahun
)
*
100
),
Float
)
.
label
(
'persen'
))
.
\
join
(
ChartItem
,
func
.
trim
(
ChartItem
.
rekening_kd
)
==
func
.
trim
(
Eis
.
kode
))
.
\
join
(
ChartItem
,
func
.
trim
(
ChartItem
.
rekening_kd
)
==
func
.
trim
(
Eis
.
kode
))
.
\
join
(
Chart
,
Chart
.
id
==
ChartItem
.
chart_id
)
.
\
join
(
Chart
,
Chart
.
id
==
ChartItem
.
chart_id
)
.
\
filter
(
Eis
.
tahun
==
max_tahun
,
Chart
.
chart_type
==
'line'
)
.
\
filter
(
Eis
.
tahun
==
max_tahun
,
Chart
.
chart_type
==
'line'
)
.
\
...
...
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