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 33a45a1e
authored
Mar 01, 2022
by
Owo Sugiana
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Bug fixed saat struktur Invoice ID bukan default
1 parent
34f1dbed
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletions
opensipkd/pad/services/default.py
opensipkd/pad/services/default.py
View file @
33a45a1
...
...
@@ -52,7 +52,7 @@ class BaseInquiry:
def
__init__
(
self
,
invoice_id
,
conf
=
dict
()):
self
.
invoice
=
None
real_inv_id
=
self
.
get_invoice_id
(
invoice_id
)
if
len
(
real_inv_id
)
!=
INVOICE_ID_LENGTH
:
if
len
(
real_inv_id
)
!=
self
.
get_invoice_id_length
()
:
return
self
.
invoice_id
=
FixLength
(
self
.
invoice_id_structure
)
self
.
invoice_id
.
set_raw
(
real_inv_id
)
...
...
@@ -64,9 +64,17 @@ class BaseInquiry:
q
=
DBSession
.
query
(
Invoice
)
.
filter_by
(
tahun
=
self
.
invoice_id
[
'Tahun'
],
sptno
=
self
.
invoice_id
[
'SptNo'
])
self
.
invoice
=
q
.
first
()
if
not
self
.
invoice
:
return
if
not
self
.
is_available
():
self
.
invoice
=
None
def
get_invoice_id_length
(
self
):
length
=
0
for
name
,
size
,
typ
in
self
.
invoice_id_structure
:
length
+=
size
return
length
def
get_invoice_id
(
self
,
raw
):
return
raw
...
...
@@ -560,6 +568,8 @@ class AvailableInvoice:
invoice_id
=
self
.
get_invoice_id
(
row
)
Inquiry
=
self
.
get_inquiry_class
()
inq
=
Inquiry
(
invoice_id
.
get_raw
(),
self
.
conf
)
if
not
inq
.
invoice
:
return
if
not
inq
.
total
:
return
total
=
thousand
(
inq
.
total
)
...
...
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