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 bca89630
authored
Aug 21, 2024
by
aa.gusti
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
iWan Mampir, Penyesuaian Keterangan Target/Realisasi/Persentase
1 parent
146d69f3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
4 deletions
views/eis.py
views/templates/dashboard.pt
views/eis.py
View file @
bca8963
...
...
@@ -114,7 +114,7 @@ class eis(BaseView):
elif
req
.
matchdict
[
'act'
]
==
'dasboard'
:
# max_tahun = EisDBSession.query(func.max(Eis.tahun)).scalar()
max_tahun
=
ses
[
'tahun'
]
subq
=
EisDBSession
.
query
(
subq
x
=
EisDBSession
.
query
(
func
.
max
(
Eis
.
nama
)
.
label
(
'nama'
),
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
+
\
...
...
@@ -133,6 +133,20 @@ class eis(BaseView):
join
(
Chart
,
and_
(
Chart
.
id
==
ChartItem
.
chart_id
,
Chart
.
chart_type
==
'line'
))
.
\
filter
(
Eis
.
tahun
==
max_tahun
)
.
\
group_by
(
Eis
.
kode
,
Eis
.
nama
,
Eis
.
tahun
)
.
order_by
(
Eis
.
kode
)
.
subquery
()
subq
=
EisDBSession
.
query
(
(
Eis
.
nama
)
.
label
(
'nama'
),
(
ChartItem
.
value_1
*
12
)
.
label
(
'target'
),
(
Eis
.
amt_bulan
)
.
label
(
'amt_bulan'
),
(
Eis
.
amt_tahun
)
.
label
(
'amt_tahun'
),
((
ChartItem
.
value_1
*
12
)
-
Eis
.
amt_tahun
)
.
label
(
'sisa_target'
),
cast
(
func
.
round
(((
Eis
.
amt_tahun
)
/
(
ChartItem
.
value_1
*
12
))
*
100
,
2
),
String
)
.
label
(
'persen'
))
.
\
join
(
ChartItem
,
and_
(
func
.
trim
(
ChartItem
.
rekening_kd
)
==
func
.
trim
(
Eis
.
kode
),
ChartItem
.
source_type
==
'target'
))
.
\
join
(
Chart
,
and_
(
Chart
.
id
==
ChartItem
.
chart_id
,
Chart
.
chart_type
==
'line'
))
.
\
filter
(
Eis
.
tahun
==
max_tahun
)
.
\
order_by
(
Eis
.
kode
)
.
subquery
()
query
=
EisDBSession
.
query
()
.
select_from
(
subq
)
columns
=
[
ColumnDT
(
subq
.
c
.
nama
,
mData
=
"jenis_pajak"
),
...
...
views/templates/dashboard.pt
View file @
bca8963
...
...
@@ -287,19 +287,34 @@
});
legend
(
document
.
getElementById
(
'legend_${dat.id}'
),
lineChartData_$
{
dat
.
id
});
/* iWan Mampir Remark
var total_target = 0;
for (var i = 0; i < (html.target).length; i++) {
total_target += html.target[i];
// console.log('--> '+html.label[i]);
// console.log('--> '+html.target[i]);
}
// console.log('Ini adalah data target : '+html.target);
// console.log('Ini adalah total target : '+total_target);
console.log('Ini adalah data target : '+html.target);
console.log('Ini adalah total target : '+total_target);
var total_realisasi = 0;
for (var i = 0; i < (html.realisasi).length; i++) {
total_realisasi += html.realisasi[i];
}
*/
var
total_target
=
0
;
for
(
i
=
0
;
i
<
bulan
+
1
;
i
++
)
{
total_target
=
html
.
target
[
i
];
}
console
.
log
(
'Ini adalah total target : '
+
total_target
);
var
persentase
=
(
Math
.
round
((
total_realisasi
/
total_target
)
*
100
))
var
total_realisasi
=
0
;
for
(
i
=
0
;
i
<
bulan
+
1
;
i
++
)
{
total_realisasi
=
html
.
realisasi
[
i
];
}
var
persentase
=
(
Math
.
round
((
total_realisasi
/
total_target
)
*
100
))
$
(
"#ket_target${dat.id}"
).
html
(
total_target
.
toString
().
replace
(
/
\B(?=(\d{3})
+
(?!\d))
/g
,
"."
));
$
(
"#ket_realisasi${dat.id}"
).
html
(
total_realisasi
.
toString
().
replace
(
/
\B(?=(\d{3})
+
(?!\d))
/g
,
"."
));
...
...
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