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 c0c637eb
authored
Jul 26, 2020
by
Owo Sugiana
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Pengisian field is_valid
1 parent
b97d4cf4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
11 deletions
CHANGES.txt
opensipkd/pad/scripts/inquiry.py
opensipkd/pad/services/default/__init__.py
CHANGES.txt
View file @
c0c637e
0.2.1 2020-07-24
----------------
- Modul tangsel ada pengisian field is_valid
0.2 2020-07-15
0.2 2020-07-15
--------------
--------------
- File konfigurasi wajib ada baris module
- File konfigurasi wajib ada baris module
...
...
opensipkd/pad/scripts/inquiry.py
View file @
c0c637e
...
@@ -14,13 +14,27 @@ ERR_PAYMENT_NOT_FOUND = 'Pembayaran tidak ditemukan, '\
...
@@ -14,13 +14,27 @@ ERR_PAYMENT_NOT_FOUND = 'Pembayaran tidak ditemukan, '\
def
show_val
(
label
,
value
):
def
show_val
(
label
,
value
):
print
(
'{}: {}'
.
format
(
label
,
value
or
''
))
if
value
is
None
:
value
=
''
print
(
'{}: {}'
.
format
(
label
,
value
))
def
show_rp
(
label
,
value
):
def
show_rp
(
label
,
value
):
show_val
(
label
,
'Rp {}'
.
format
(
thousand
(
value
)))
show_val
(
label
,
'Rp {}'
.
format
(
thousand
(
value
)))
def
show_field
(
t
,
fieldname
):
label
=
'Field '
+
fieldname
try
:
value
=
getattr
(
t
,
fieldname
)
except
AttributeError
:
return
if
isinstance
(
value
,
float
):
show_rp
(
label
,
value
)
else
:
show_val
(
label
,
value
)
def
get_option
(
argv
):
def
get_option
(
argv
):
pars
=
ArgumentParser
()
pars
=
ArgumentParser
()
pars
.
add_argument
(
'conf'
)
pars
.
add_argument
(
'conf'
)
...
@@ -49,6 +63,7 @@ def show(inq):
...
@@ -49,6 +63,7 @@ def show(inq):
show_rp
(
'Total Bayar'
,
inq
.
total_bayar
)
show_rp
(
'Total Bayar'
,
inq
.
total_bayar
)
show_rp
(
'Total Tagihan'
,
inq
.
total
)
show_rp
(
'Total Tagihan'
,
inq
.
total
)
show_val
(
'Is Available'
,
inq
.
is_available
())
show_val
(
'Is Available'
,
inq
.
is_available
())
show_field
(
inq
.
invoice
,
'status_pembayaran'
)
def
show_pkey_values
(
row
):
def
show_pkey_values
(
row
):
...
@@ -96,6 +111,7 @@ def main(argv=sys.argv):
...
@@ -96,6 +111,7 @@ def main(argv=sys.argv):
with
transaction
.
manager
:
with
transaction
.
manager
:
pay
=
inq
.
do_payment
(
ntb
)
pay
=
inq
.
do_payment
(
ntb
)
show_pkey_values
(
pay
)
show_pkey_values
(
pay
)
show_field
(
pay
,
'is_valid'
)
print
(
'Berhasil dibayar'
)
print
(
'Berhasil dibayar'
)
if
option
.
reversal
:
if
option
.
reversal
:
rev
=
services
.
Reversal
(
invoice_id
)
rev
=
services
.
Reversal
(
invoice_id
)
...
@@ -107,4 +123,5 @@ def main(argv=sys.argv):
...
@@ -107,4 +123,5 @@ def main(argv=sys.argv):
with
transaction
.
manager
:
with
transaction
.
manager
:
rev
.
do_reversal
()
rev
.
do_reversal
()
show_pkey_values
(
pay
)
show_pkey_values
(
pay
)
show_field
(
pay
,
'is_valid'
)
print
(
'Berhasil dibatalkan'
)
print
(
'Berhasil dibatalkan'
)
opensipkd/pad/services/default/__init__.py
View file @
c0c637e
...
@@ -238,15 +238,20 @@ class Inquiry(BaseInquiry):
...
@@ -238,15 +238,20 @@ class Inquiry(BaseInquiry):
def
do_payment
(
self
,
ntb
):
def
do_payment
(
self
,
ntb
):
Payment
=
self
.
get_payment_model
()
Payment
=
self
.
get_payment_model
()
sspdno
=
self
.
get_pay_seq
()
sspdno
=
self
.
get_pay_seq
()
pay
=
Payment
()
kini
=
datetime
.
now
()
pay
.
tahun
=
self
.
invoice
.
tahun
pay
=
Payment
(
pay
.
spt_id
=
self
.
invoice
.
id
tahun
=
self
.
invoice
.
tahun
,
pay
.
sspdno
=
sspdno
spt_id
=
self
.
invoice
.
id
,
pay
.
denda
=
pay
.
bunga
=
self
.
denda
sspdno
=
sspdno
,
pay
.
jml_bayar
=
self
.
total
denda
=
self
.
denda
,
pay
.
create_date
=
pay
.
write_date
=
datetime
.
now
()
bunga
=
self
.
denda
,
pay
.
sspdtgl
=
self
.
tgl_bayar
jml_bayar
=
self
.
total
,
pay
.
printed
=
pay
.
enabled
=
1
create_date
=
kini
,
write_date
=
kini
,
sspdtgl
=
self
.
tgl_bayar
,
printed
=
1
,
enabled
=
1
,
is_valid
=
1
)
self
.
invoice
.
status_pembayaran
=
1
self
.
invoice
.
status_pembayaran
=
1
DBSession
=
get_db_session
()
DBSession
=
get_db_session
()
DBSession
.
add
(
pay
)
DBSession
.
add
(
pay
)
...
@@ -266,7 +271,7 @@ class Reversal(BaseInquiry):
...
@@ -266,7 +271,7 @@ class Reversal(BaseInquiry):
if
self
.
payment
:
if
self
.
payment
:
self
.
payment
.
jml_bayar
=
self
.
payment
.
denda
=
\
self
.
payment
.
jml_bayar
=
self
.
payment
.
denda
=
\
self
.
payment
.
bunga
=
0
self
.
payment
.
bunga
=
0
self
.
payment
.
enabled
=
0
self
.
payment
.
enabled
=
self
.
payment
.
is_valid
=
0
DBSession
.
add
(
self
.
payment
)
DBSession
.
add
(
self
.
payment
)
self
.
invoice
.
status_pembayaran
=
0
self
.
invoice
.
status_pembayaran
=
0
DBSession
.
add
(
self
.
invoice
)
DBSession
.
add
(
self
.
invoice
)
...
...
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