Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Owo Sugiana
/
opensipkd-pad-models
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 52a8ee93
authored
Dec 19, 2022
by
Owo Sugiana
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Pastikan output huruf besar
1 parent
4dbce716
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
13 deletions
opensipkd/pad/services/cimahi.py
opensipkd/pad/services/cimahi.py
View file @
52a8ee9
from
logging
import
getLogger
from
decimal
import
Decimal
from
opensipkd.hitung
import
round_up
from
.base
import
get_db_session
...
...
@@ -23,10 +24,10 @@ class Inquiry:
self
.
invoice_id
=
invoice_id
self
.
conf
=
conf
self
.
invoice
=
self
.
transaction
(
invoice_id
)
if
self
.
invoice
[
'hasil'
]
==
'0'
:
if
self
.
invoice
.
get
(
'hasil'
)
==
'0'
:
self
.
invoice
=
None
else
:
self
.
tagihan
=
self
.
total
=
self
.
invoice
[
'Tagihan'
]
self
.
tagihan
=
self
.
total
=
int
(
self
.
invoice
[
'Tagihan'
])
self
.
denda
=
self
.
invoice
[
'Denda'
]
self
.
total_bayar
=
self
.
discount_denda
=
0
self
.
bln_tunggakan
=
None
...
...
@@ -44,8 +45,14 @@ class Inquiry:
q
=
db_session
.
execute
(
sql
)
inv
=
q
.
fetchone
()
r
=
dict
(
inv
)
log
.
info
(
f
'result {r}'
)
return
r
d
=
dict
()
for
key
in
r
:
val
=
r
[
key
]
if
isinstance
(
val
,
Decimal
):
val
=
float
(
val
)
d
[
key
]
=
val
log
.
info
(
f
'result {d}'
)
return
d
def
get_tahun
(
self
):
return
self
.
invoice
[
'MasaAwal'
]
.
strftime
(
'
%
Y'
)
...
...
@@ -54,7 +61,7 @@ class Inquiry:
return
self
.
invoice
[
'NPWPD'
]
def
get_nama
(
self
):
return
self
.
invoice
[
'NamaWP'
]
return
self
.
invoice
[
'NamaWP'
]
.
upper
()
def
get_alamat_wp
(
self
):
pass
...
...
@@ -63,13 +70,13 @@ class Inquiry:
pass
def
get_alamat_1
(
self
):
return
self
.
invoice
[
'Alamat1'
]
return
self
.
invoice
[
'Alamat1'
]
.
upper
()
def
get_alamat_2
(
self
):
return
self
.
invoice
[
'Alamat2'
]
return
self
.
invoice
[
'Alamat2'
]
.
upper
()
def
get_alamat_op
(
self
):
return
', '
.
join
([
self
.
invoice
[
'Alamat1'
],
self
.
invoice
[
'Alamat2'
]
])
return
', '
.
join
([
self
.
get_alamat_1
(),
self
.
get_alamat_2
()
])
def
get_kelurahan_op
(
self
):
pass
...
...
@@ -81,13 +88,13 @@ class Inquiry:
return
self
.
invoice
[
'KodeRekening'
]
.
replace
(
'.'
,
''
)
def
get_nama_rekening
(
self
):
return
self
.
invoice
[
'Pajak'
]
return
self
.
invoice
[
'Pajak'
]
.
upper
()
def
get_masa_1
(
self
):
return
self
.
invoice
[
'MasaAwal'
]
.
strftime
(
'
%
Y
%
m
%
d'
)
def
get_masa_1
(
self
,
fmt
=
'
%
Y
%
m
%
d'
):
return
self
.
invoice
[
'MasaAwal'
]
.
strftime
(
fmt
)
def
get_masa_2
(
self
):
return
self
.
invoice
[
'MasaAkhir'
]
.
strftime
(
'
%
Y
%
m
%
d'
)
def
get_masa_2
(
self
,
fmt
=
'
%
Y
%
m
%
d'
):
return
self
.
invoice
[
'MasaAkhir'
]
.
strftime
(
fmt
)
def
get_nama_jenis_usaha
(
self
):
pass
...
...
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