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
Show 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
--------------
- 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, '\
def
show_val
(
label
,
value
):
print
(
'{}: {}'
.
format
(
label
,
value
or
''
))
if
value
is
None
:
value
=
''
print
(
'{}: {}'
.
format
(
label
,
value
))
def
show_rp
(
label
,
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
):
pars
=
ArgumentParser
()
pars
.
add_argument
(
'conf'
)
...
...
@@ -49,6 +63,7 @@ def show(inq):
show_rp
(
'Total Bayar'
,
inq
.
total_bayar
)
show_rp
(
'Total Tagihan'
,
inq
.
total
)
show_val
(
'Is Available'
,
inq
.
is_available
())
show_field
(
inq
.
invoice
,
'status_pembayaran'
)
def
show_pkey_values
(
row
):
...
...
@@ -96,6 +111,7 @@ def main(argv=sys.argv):
with
transaction
.
manager
:
pay
=
inq
.
do_payment
(
ntb
)
show_pkey_values
(
pay
)
show_field
(
pay
,
'is_valid'
)
print
(
'Berhasil dibayar'
)
if
option
.
reversal
:
rev
=
services
.
Reversal
(
invoice_id
)
...
...
@@ -107,4 +123,5 @@ def main(argv=sys.argv):
with
transaction
.
manager
:
rev
.
do_reversal
()
show_pkey_values
(
pay
)
show_field
(
pay
,
'is_valid'
)
print
(
'Berhasil dibatalkan'
)
opensipkd/pad/services/default/__init__.py
View file @
c0c637e
...
...
@@ -238,15 +238,20 @@ class Inquiry(BaseInquiry):
def
do_payment
(
self
,
ntb
):
Payment
=
self
.
get_payment_model
()
sspdno
=
self
.
get_pay_seq
()
pay
=
Payment
()
pay
.
tahun
=
self
.
invoice
.
tahun
pay
.
spt_id
=
self
.
invoice
.
id
pay
.
sspdno
=
sspdno
pay
.
denda
=
pay
.
bunga
=
self
.
denda
pay
.
jml_bayar
=
self
.
total
pay
.
create_date
=
pay
.
write_date
=
datetime
.
now
()
pay
.
sspdtgl
=
self
.
tgl_bayar
pay
.
printed
=
pay
.
enabled
=
1
kini
=
datetime
.
now
()
pay
=
Payment
(
tahun
=
self
.
invoice
.
tahun
,
spt_id
=
self
.
invoice
.
id
,
sspdno
=
sspdno
,
denda
=
self
.
denda
,
bunga
=
self
.
denda
,
jml_bayar
=
self
.
total
,
create_date
=
kini
,
write_date
=
kini
,
sspdtgl
=
self
.
tgl_bayar
,
printed
=
1
,
enabled
=
1
,
is_valid
=
1
)
self
.
invoice
.
status_pembayaran
=
1
DBSession
=
get_db_session
()
DBSession
.
add
(
pay
)
...
...
@@ -266,7 +271,7 @@ class Reversal(BaseInquiry):
if
self
.
payment
:
self
.
payment
.
jml_bayar
=
self
.
payment
.
denda
=
\
self
.
payment
.
bunga
=
0
self
.
payment
.
enabled
=
0
self
.
payment
.
enabled
=
self
.
payment
.
is_valid
=
0
DBSession
.
add
(
self
.
payment
)
self
.
invoice
.
status_pembayaran
=
0
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