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 7e0788cb
authored
Oct 08, 2020
by
Owo Sugiana
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Invoice ID porsi sptno menjadi 6 digit
1 parent
a5748532
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
9 deletions
opensipkd/pad/scripts/inquiry.py
opensipkd/pad/services/default/__init__.py
opensipkd/pad/services/tangsel/__init__.py
opensipkd/pad/scripts/inquiry.py
View file @
7e0788c
...
@@ -24,7 +24,7 @@ def show_rp(label, value):
...
@@ -24,7 +24,7 @@ def show_rp(label, value):
def
show_field
(
t
,
fieldname
):
def
show_field
(
t
,
fieldname
):
label
=
'Field '
+
fieldname
label
=
f
'Field {t.__tablename__}.{fieldname}'
try
:
try
:
value
=
getattr
(
t
,
fieldname
)
value
=
getattr
(
t
,
fieldname
)
except
AttributeError
:
except
AttributeError
:
...
@@ -72,6 +72,10 @@ def show(inq):
...
@@ -72,6 +72,10 @@ 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_field
(
inq
.
invoice
,
'status_pembayaran'
)
show_field
(
inq
.
invoice
,
'status_pembayaran'
)
if
inq
.
total_bayar
:
pay
=
inq
.
get_payment
()
show_field
(
pay
,
'sspdtgl'
)
show_field
(
pay
,
'id'
)
def
show_pkey_values
(
row
):
def
show_pkey_values
(
row
):
...
...
opensipkd/pad/services/default/__init__.py
View file @
7e0788c
...
@@ -36,7 +36,7 @@ from ..base import get_db_session
...
@@ -36,7 +36,7 @@ from ..base import get_db_session
INVOICE_ID
=
[
INVOICE_ID
=
[
(
'Tahun'
,
4
,
'N'
),
(
'Tahun'
,
4
,
'N'
),
(
'SptNo'
,
5
,
'N'
),
(
'SptNo'
,
6
,
'N'
),
]
]
...
@@ -240,6 +240,13 @@ class BaseInquiry:
...
@@ -240,6 +240,13 @@ class BaseInquiry:
k
=
self
.
get_kohir
()
k
=
self
.
get_kohir
()
return
k
and
k
.
kohirtgl
.
date
()
return
k
and
k
.
kohirtgl
.
date
()
def
get_payment
(
self
):
Payment
=
self
.
get_payment_model
()
DBSession
=
get_db_session
()
q
=
DBSession
.
query
(
Payment
)
.
filter_by
(
spt_id
=
self
.
invoice
.
id
)
q
=
q
.
order_by
(
Payment
.
id
.
desc
())
return
q
.
first
()
class
Inquiry
(
BaseInquiry
):
class
Inquiry
(
BaseInquiry
):
def
__init__
(
def
__init__
(
...
@@ -357,13 +364,6 @@ class Reversal(BaseInquiry):
...
@@ -357,13 +364,6 @@ class Reversal(BaseInquiry):
DBSession
.
add
(
self
.
invoice
)
DBSession
.
add
(
self
.
invoice
)
DBSession
.
flush
()
DBSession
.
flush
()
def
get_payment
(
self
):
Payment
=
self
.
get_payment_model
()
DBSession
=
get_db_session
()
q
=
DBSession
.
query
(
Payment
)
.
filter_by
(
spt_id
=
self
.
invoice
.
id
)
q
=
q
.
order_by
(
Payment
.
id
.
desc
())
return
q
.
first
()
def
date_from_str
(
s
):
def
date_from_str
(
s
):
d
,
m
,
y
=
[
int
(
x
)
for
x
in
s
.
split
(
'-'
)]
d
,
m
,
y
=
[
int
(
x
)
for
x
in
s
.
split
(
'-'
)]
...
...
opensipkd/pad/services/tangsel/__init__.py
View file @
7e0788c
...
@@ -53,6 +53,8 @@ def satu_kalimat(notes):
...
@@ -53,6 +53,8 @@ def satu_kalimat(notes):
class
Inquiry
(
BaseInquiry
):
class
Inquiry
(
BaseInquiry
):
def
get_discount_denda
(
self
):
# Override
def
get_discount_denda
(
self
):
# Override
if
self
.
denda
<
1
:
return
0
tgl_bayar
=
to_date
(
self
.
tgl_bayar
)
tgl_bayar
=
to_date
(
self
.
tgl_bayar
)
if
tgl_bayar
>
TGL_BAYAR_MAX
:
if
tgl_bayar
>
TGL_BAYAR_MAX
:
return
0
return
0
...
...
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