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 766663fb
authored
Mar 10, 2022
by
Owo Sugiana
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Field discount tidak NULL lagi meski nol
1 parent
92422bc3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
sismiop/scripts/init_db.py
sismiop/services/base.py
sismiop/scripts/init_db.py
View file @
766663f
...
@@ -8,6 +8,9 @@ def main(argv=sys.argv):
...
@@ -8,6 +8,9 @@ def main(argv=sys.argv):
config_uri
=
argv
[
1
]
config_uri
=
argv
[
1
]
conf
=
ConfigParser
()
conf
=
ConfigParser
()
conf
.
read
(
config_uri
)
conf
.
read
(
config_uri
)
module_name
=
conf
.
get
(
'main'
,
'module'
)
__import__
(
'sismiop.services.'
+
module_name
)
db_url
=
conf
.
get
(
'main'
,
'db_url'
)
db_url
=
conf
.
get
(
'main'
,
'db_url'
)
engine
=
create_engine
(
db_url
)
engine
=
create_engine
(
db_url
)
engine
.
echo
=
True
Base
.
metadata
.
create_all
(
engine
)
Base
.
metadata
.
create_all
(
engine
)
sismiop/services/base.py
View file @
766663f
...
@@ -283,14 +283,13 @@ class Inquiry(Query):
...
@@ -283,14 +283,13 @@ class Inquiry(Query):
self
.
total
-=
self
.
discount
self
.
total
-=
self
.
discount
def
do_payment
(
self
,
bank_fields
,
nip_pencatat
):
def
do_payment
(
self
,
bank_fields
,
nip_pencatat
):
Payment
=
self
.
get_payment_model
()
bayar
=
self
.
invoice2payment
()
bayar
=
self
.
invoice2payment
()
if
bayar
:
if
bayar
:
ke
=
bayar
.
pembayaran_sppt_ke
+
1
ke
=
bayar
.
pembayaran_sppt_ke
+
1
else
:
else
:
ke
=
1
ke
=
1
inv
=
self
.
invoice
inv
=
self
.
invoice
bayar
=
Paymen
t
(
d
=
dic
t
(
kd_propinsi
=
inv
.
kd_propinsi
,
kd_dati2
=
inv
.
kd_dati2
,
kd_propinsi
=
inv
.
kd_propinsi
,
kd_dati2
=
inv
.
kd_dati2
,
kd_kecamatan
=
inv
.
kd_kecamatan
,
kd_kelurahan
=
inv
.
kd_kelurahan
,
kd_kecamatan
=
inv
.
kd_kecamatan
,
kd_kelurahan
=
inv
.
kd_kelurahan
,
kd_blok
=
inv
.
kd_blok
,
no_urut
=
inv
.
no_urut
,
kd_blok
=
inv
.
kd_blok
,
no_urut
=
inv
.
no_urut
,
...
@@ -300,10 +299,14 @@ class Inquiry(Query):
...
@@ -300,10 +299,14 @@ class Inquiry(Query):
nip_rekam_byr_sppt
=
nip_pencatat
,
nip_rekam_byr_sppt
=
nip_pencatat
,
jml_sppt_yg_dibayar
=
self
.
total
,
jml_sppt_yg_dibayar
=
self
.
total
,
denda_sppt
=
self
.
denda
)
denda_sppt
=
self
.
denda
)
if
self
.
discount
:
Payment
=
self
.
get_payment_model
()
bayar
.
discount
=
self
.
discount
for
c
in
Payment
.
__table__
.
columns
:
if
c
.
name
==
'discount'
:
d
[
'discount'
]
=
self
.
discount
break
for
key
,
value
in
bank_fields
.
items
():
for
key
,
value
in
bank_fields
.
items
():
setattr
(
bayar
,
key
,
value
)
d
[
key
]
=
value
bayar
=
Payment
(
**
d
)
self
.
before_save
(
bayar
)
self
.
before_save
(
bayar
)
DBSession
.
add
(
bayar
)
DBSession
.
add
(
bayar
)
self
.
invoice
.
status_pembayaran_sppt
=
'1'
# Lunas
self
.
invoice
.
status_pembayaran_sppt
=
'1'
# Lunas
...
...
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