Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Owo Sugiana
/
opensipkd-bphtb-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 61663a90
authored
Dec 22, 2022
by
Owo Sugiana
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
bin/inquiry tambah --ntb
1 parent
8bb345d5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
2 deletions
CHANGES.txt
opensipkd/bphtb/scripts/inquiry.py
CHANGES.txt
View file @
61663a9
0.4.4 2022-12-22
----------------
- bin/inquiry tambah --ntp dan --tgl-bayar bisa ada jam
0.4.3 2022-03-12
----------------
- Kota Tangerang Selatan kini bisa menerima Invoice ID 12 digit maupun 16
...
...
opensipkd/bphtb/scripts/inquiry.py
View file @
61663a9
...
...
@@ -42,6 +42,7 @@ def get_option(argv):
pars
.
add_argument
(
'--invoice-id'
,
required
=
True
)
pars
.
add_argument
(
'--tgl-bayar'
,
help
=
help_tgl_bayar
)
pars
.
add_argument
(
'--payment'
,
action
=
'store_true'
)
pars
.
add_argument
(
'--ntb'
)
pars
.
add_argument
(
'--reversal'
,
action
=
'store_true'
)
pars
.
add_argument
(
'--debug'
,
action
=
'store_true'
)
return
pars
.
parse_args
(
argv
)
...
...
@@ -107,12 +108,18 @@ def error(s):
sys
.
exit
()
def
to_date
(
s
):
if
s
.
find
(
' '
)
>
-
1
:
return
datetime
.
strptime
(
s
,
'
%
d-
%
m-
%
Y
%
H:
%
M:
%
S'
)
return
datetime
.
strptime
(
s
,
'
%
d-
%
m-
%
Y'
)
def
main
(
argv
=
sys
.
argv
):
option
=
get_option
(
argv
[
1
:])
log_config
(
option
.
debug
and
'DEBUG'
or
'INFO'
)
conf
,
services
=
init
(
option
)
invoice_id
=
option
.
invoice_id
tgl_bayar
=
option
.
tgl_bayar
and
date_from_str
(
option
.
tgl_bayar
)
tgl_bayar
=
option
.
tgl_bayar
and
to_date
(
option
.
tgl_bayar
)
inq
=
services
.
Inquiry
(
invoice_id
,
conf
,
tgl_bayar
)
if
not
inq
.
invoice
:
error
(
f
'Invoice ID {invoice_id} tidak ada.'
)
...
...
@@ -122,7 +129,7 @@ def main(argv=sys.argv):
error
(
'Tidak ada tagihan, tidak ada yang perlu dibayar.'
)
if
not
inq
.
is_available
():
error
(
'Tagihan ini tidak bisa dibayarkan.'
)
ntb
=
datetime
.
now
()
.
strftime
(
'
%
y
%
m
%
d
%
H
%
M
%
S'
)
ntb
=
option
.
ntb
or
datetime
.
now
()
.
strftime
(
'
%
y
%
m
%
d
%
H
%
M
%
S'
)
with
transaction
.
manager
:
pay
=
inq
.
do_payment
(
ntb
)
show_payment
(
pay
)
...
...
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