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
Show 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
logging
import
getLogger
from
decimal
import
Decimal
from
opensipkd.hitung
import
round_up
from
opensipkd.hitung
import
round_up
from
.base
import
get_db_session
from
.base
import
get_db_session
...
@@ -23,10 +24,10 @@ class Inquiry:
...
@@ -23,10 +24,10 @@ class Inquiry:
self
.
invoice_id
=
invoice_id
self
.
invoice_id
=
invoice_id
self
.
conf
=
conf
self
.
conf
=
conf
self
.
invoice
=
self
.
transaction
(
invoice_id
)
self
.
invoice
=
self
.
transaction
(
invoice_id
)
if
self
.
invoice
[
'hasil'
]
==
'0'
:
if
self
.
invoice
.
get
(
'hasil'
)
==
'0'
:
self
.
invoice
=
None
self
.
invoice
=
None
else
:
else
:
self
.
tagihan
=
self
.
total
=
self
.
invoice
[
'Tagihan'
]
self
.
tagihan
=
self
.
total
=
int
(
self
.
invoice
[
'Tagihan'
])
self
.
denda
=
self
.
invoice
[
'Denda'
]
self
.
denda
=
self
.
invoice
[
'Denda'
]
self
.
total_bayar
=
self
.
discount_denda
=
0
self
.
total_bayar
=
self
.
discount_denda
=
0
self
.
bln_tunggakan
=
None
self
.
bln_tunggakan
=
None
...
@@ -44,8 +45,14 @@ class Inquiry:
...
@@ -44,8 +45,14 @@ class Inquiry:
q
=
db_session
.
execute
(
sql
)
q
=
db_session
.
execute
(
sql
)
inv
=
q
.
fetchone
()
inv
=
q
.
fetchone
()
r
=
dict
(
inv
)
r
=
dict
(
inv
)
log
.
info
(
f
'result {r}'
)
d
=
dict
()
return
r
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
):
def
get_tahun
(
self
):
return
self
.
invoice
[
'MasaAwal'
]
.
strftime
(
'
%
Y'
)
return
self
.
invoice
[
'MasaAwal'
]
.
strftime
(
'
%
Y'
)
...
@@ -54,7 +61,7 @@ class Inquiry:
...
@@ -54,7 +61,7 @@ class Inquiry:
return
self
.
invoice
[
'NPWPD'
]
return
self
.
invoice
[
'NPWPD'
]
def
get_nama
(
self
):
def
get_nama
(
self
):
return
self
.
invoice
[
'NamaWP'
]
return
self
.
invoice
[
'NamaWP'
]
.
upper
()
def
get_alamat_wp
(
self
):
def
get_alamat_wp
(
self
):
pass
pass
...
@@ -63,13 +70,13 @@ class Inquiry:
...
@@ -63,13 +70,13 @@ class Inquiry:
pass
pass
def
get_alamat_1
(
self
):
def
get_alamat_1
(
self
):
return
self
.
invoice
[
'Alamat1'
]
return
self
.
invoice
[
'Alamat1'
]
.
upper
()
def
get_alamat_2
(
self
):
def
get_alamat_2
(
self
):
return
self
.
invoice
[
'Alamat2'
]
return
self
.
invoice
[
'Alamat2'
]
.
upper
()
def
get_alamat_op
(
self
):
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
):
def
get_kelurahan_op
(
self
):
pass
pass
...
@@ -81,13 +88,13 @@ class Inquiry:
...
@@ -81,13 +88,13 @@ class Inquiry:
return
self
.
invoice
[
'KodeRekening'
]
.
replace
(
'.'
,
''
)
return
self
.
invoice
[
'KodeRekening'
]
.
replace
(
'.'
,
''
)
def
get_nama_rekening
(
self
):
def
get_nama_rekening
(
self
):
return
self
.
invoice
[
'Pajak'
]
return
self
.
invoice
[
'Pajak'
]
.
upper
()
def
get_masa_1
(
self
):
def
get_masa_1
(
self
,
fmt
=
'
%
Y
%
m
%
d'
):
return
self
.
invoice
[
'MasaAwal'
]
.
strftime
(
'
%
Y
%
m
%
d'
)
return
self
.
invoice
[
'MasaAwal'
]
.
strftime
(
fmt
)
def
get_masa_2
(
self
):
def
get_masa_2
(
self
,
fmt
=
'
%
Y
%
m
%
d'
):
return
self
.
invoice
[
'MasaAkhir'
]
.
strftime
(
'
%
Y
%
m
%
d'
)
return
self
.
invoice
[
'MasaAkhir'
]
.
strftime
(
fmt
)
def
get_nama_jenis_usaha
(
self
):
def
get_nama_jenis_usaha
(
self
):
pass
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