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:
...
@@ -52,7 +52,7 @@ class BaseInquiry:
def
__init__
(
self
,
invoice_id
,
conf
=
dict
()):
def
__init__
(
self
,
invoice_id
,
conf
=
dict
()):
self
.
invoice
=
None
self
.
invoice
=
None
real_inv_id
=
self
.
get_invoice_id
(
invoice_id
)
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
return
self
.
invoice_id
=
FixLength
(
self
.
invoice_id_structure
)
self
.
invoice_id
=
FixLength
(
self
.
invoice_id_structure
)
self
.
invoice_id
.
set_raw
(
real_inv_id
)
self
.
invoice_id
.
set_raw
(
real_inv_id
)
...
@@ -64,9 +64,17 @@ class BaseInquiry:
...
@@ -64,9 +64,17 @@ class BaseInquiry:
q
=
DBSession
.
query
(
Invoice
)
.
filter_by
(
q
=
DBSession
.
query
(
Invoice
)
.
filter_by
(
tahun
=
self
.
invoice_id
[
'Tahun'
],
sptno
=
self
.
invoice_id
[
'SptNo'
])
tahun
=
self
.
invoice_id
[
'Tahun'
],
sptno
=
self
.
invoice_id
[
'SptNo'
])
self
.
invoice
=
q
.
first
()
self
.
invoice
=
q
.
first
()
if
not
self
.
invoice
:
return
if
not
self
.
is_available
():
if
not
self
.
is_available
():
self
.
invoice
=
None
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
):
def
get_invoice_id
(
self
,
raw
):
return
raw
return
raw
...
@@ -560,6 +568,8 @@ class AvailableInvoice:
...
@@ -560,6 +568,8 @@ class AvailableInvoice:
invoice_id
=
self
.
get_invoice_id
(
row
)
invoice_id
=
self
.
get_invoice_id
(
row
)
Inquiry
=
self
.
get_inquiry_class
()
Inquiry
=
self
.
get_inquiry_class
()
inq
=
Inquiry
(
invoice_id
.
get_raw
(),
self
.
conf
)
inq
=
Inquiry
(
invoice_id
.
get_raw
(),
self
.
conf
)
if
not
inq
.
invoice
:
return
if
not
inq
.
total
:
if
not
inq
.
total
:
return
return
total
=
thousand
(
inq
.
total
)
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