Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Owo Sugiana
/
sismiop-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 12faf087
authored
Sep 01, 2020
by
Owo Sugiana
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Hanya is_available() is True yang bisa di-inquiry
1 parent
32ba3dc9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
9 deletions
sismiop/scripts/inquiry.py
sismiop/services/base.py
sismiop/scripts/inquiry.py
View file @
12faf08
...
@@ -142,9 +142,13 @@ def main(argv=sys.argv):
...
@@ -142,9 +142,13 @@ def main(argv=sys.argv):
register
(
sismiop
.
services
.
base
.
DBSession
)
register
(
sismiop
.
services
.
base
.
DBSession
)
persen_denda
=
conf
.
getfloat
(
'main'
,
'persen_denda'
)
persen_denda
=
conf
.
getfloat
(
'main'
,
'persen_denda'
)
with
transaction
.
manager
:
with
transaction
.
manager
:
inq
=
Inquiry
(
invoice_id
,
persen_denda
,
tgl_bayar
=
tgl_bayar
)
inq
=
Inquiry
(
invoice_id
,
persen_denda
,
tgl_bayar
=
tgl_bayar
,
debug
=
True
)
if
not
inq
.
invoice
:
if
not
inq
.
invoice
:
print
(
'Invoice ID {} tidak ada.'
.
format
(
invoice_id
))
print
(
'Invoice ID {} tidak ada.'
.
format
(
invoice_id
))
if
inq
.
debug_invoice
:
print
(
'Ada tapi field status_pembayaran_sppt = '
f
'{inq.debug_invoice.status_pembayaran_sppt}'
)
return
return
show
(
inq
)
show
(
inq
)
if
option
.
payment
:
if
option
.
payment
:
...
...
sismiop/services/base.py
View file @
12faf08
...
@@ -121,7 +121,7 @@ class Query:
...
@@ -121,7 +121,7 @@ class Query:
return
q
.
first
()
return
q
.
first
()
def
is_available
(
self
):
def
is_available
(
self
):
return
self
.
invoice
.
status_pembayaran_sppt
==
'0'
return
self
.
invoice
.
status_pembayaran_sppt
in
(
'0'
,
'1'
)
def
set_faktor_pengurang_sppt
(
self
,
penambah
):
def
set_faktor_pengurang_sppt
(
self
,
penambah
):
not_null
(
self
.
invoice
)
not_null
(
self
.
invoice
)
...
@@ -134,10 +134,15 @@ class Query:
...
@@ -134,10 +134,15 @@ class Query:
class
Inquiry
(
Query
):
class
Inquiry
(
Query
):
def
__init__
(
def
__init__
(
self
,
invoice_id
=
None
,
persen_denda
=
2
,
invoice
=
None
,
self
,
invoice_id
=
None
,
persen_denda
=
2
,
invoice
=
None
,
tgl_bayar
=
None
):
tgl_bayar
=
None
,
debug
=
False
):
Query
.
__init__
(
self
,
invoice_id
,
invoice
)
Query
.
__init__
(
self
,
invoice_id
,
invoice
)
if
not
self
.
invoice
:
if
not
self
.
invoice
:
return
return
if
debug
:
self
.
debug_invoice
=
self
.
invoice
if
not
self
.
is_available
():
self
.
invoice
=
None
return
self
.
persen_denda
=
persen_denda
self
.
persen_denda
=
persen_denda
if
tgl_bayar
:
if
tgl_bayar
:
self
.
tgl_bayar
=
tgl_bayar
self
.
tgl_bayar
=
tgl_bayar
...
@@ -225,10 +230,6 @@ class Inquiry(Query):
...
@@ -225,10 +230,6 @@ class Inquiry(Query):
def
is_paid
(
self
):
def
is_paid
(
self
):
return
self
.
total
<
1
return
self
.
total
<
1
def
is_available
(
self
):
# Override
return
not
self
.
is_paid
()
and
\
self
.
invoice
.
status_pembayaran_sppt
in
(
'0'
,
'1'
)
def
hitung_pokok
(
self
):
def
hitung_pokok
(
self
):
Payment
=
self
.
get_payment_model
()
Payment
=
self
.
get_payment_model
()
q
=
DBSession
.
query
(
q
=
DBSession
.
query
(
...
@@ -307,9 +308,12 @@ class Inquiry(Query):
...
@@ -307,9 +308,12 @@ class Inquiry(Query):
class
Reversal
(
Query
):
class
Reversal
(
Query
):
def
__init__
(
self
,
invoice_id
):
def
__init__
(
self
,
invoice_id
):
Query
.
__init__
(
self
,
invoice_id
)
Query
.
__init__
(
self
,
invoice_id
)
self
.
payment
=
None
if
not
self
.
invoice
:
return
if
self
.
invoice
.
status_pembayaran_sppt
!=
'1'
:
return
self
.
payment
=
self
.
invoice2payment
()
self
.
payment
=
self
.
invoice2payment
()
if
self
.
payment
and
self
.
is_available
():
self
.
payment
=
None
def
do_reversal
(
self
):
def
do_reversal
(
self
):
self
.
payment
.
jml_sppt_yg_dibayar
=
self
.
payment
.
denda_sppt
=
\
self
.
payment
.
jml_sppt_yg_dibayar
=
self
.
payment
.
denda_sppt
=
\
...
...
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