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 7662cd4b
authored
Dec 13, 2022
by
Owo Sugiana
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Di Tangsel wajib ada kohir saat inquiry
1 parent
35836760
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
7 deletions
CHANGES.txt
opensipkd/pad/services/default.py
opensipkd/pad/services/tangsel.py
CHANGES.txt
View file @
7662cd4
0.4.6 2022-12-13
----------------
- Tangerang Selatan mewajibkan keberadaan Kohir saat inquiry. Kalau tidak ada
record-nya maka invoice juga dianggap tidak ada.
0.4.5 2022-10-20
----------------
- Models khusus untuk Kabupaten Tangerang karena tabel kohir berbeda.
...
...
opensipkd/pad/services/default.py
View file @
7662cd4
...
...
@@ -50,6 +50,7 @@ class BaseInquiry:
invoice_id_structure
=
INVOICE_ID
def
__init__
(
self
,
invoice_id
,
conf
=
dict
()):
self
.
conf
=
conf
self
.
invoice
=
None
real_inv_id
=
self
.
get_invoice_id
(
invoice_id
)
if
len
(
real_inv_id
)
!=
self
.
get_invoice_id_length
():
...
...
@@ -58,17 +59,19 @@ class BaseInquiry:
self
.
invoice_id
.
set_raw
(
real_inv_id
)
if
not
self
.
invoice_id
[
'SptNo'
]:
return
self
.
conf
=
conf
Invoice
=
self
.
get_invoice_model
()
DBSession
=
get_db_session
()
q
=
DBSession
.
query
(
Invoice
)
.
filter_by
(
tahun
=
self
.
invoice_id
[
'Tahun'
],
sptno
=
self
.
invoice_id
[
'SptNo'
])
self
.
invoice
=
q
.
first
()
self
.
invoice
=
self
.
get_invoice
()
if
not
self
.
invoice
:
return
if
not
self
.
is_available
():
self
.
invoice
=
None
def
get_invoice
(
self
):
Invoice
=
self
.
get_invoice_model
()
DBSession
=
get_db_session
()
q
=
DBSession
.
query
(
Invoice
)
.
filter_by
(
tahun
=
self
.
invoice_id
[
'Tahun'
],
sptno
=
self
.
invoice_id
[
'SptNo'
])
return
q
.
first
()
def
get_invoice_id_length
(
self
):
length
=
0
for
name
,
size
,
typ
in
self
.
invoice_id_structure
:
...
...
opensipkd/pad/services/tangsel.py
View file @
7662cd4
...
...
@@ -21,7 +21,10 @@ from ..models.tangsel import (
SptType
,
Kohir
,
)
from
.base
import
satu_kalimat
from
.base
import
(
get_db_session
,
satu_kalimat
,
)
AWAL_DISC
=
date
(
2022
,
8
,
1
)
...
...
@@ -31,6 +34,13 @@ MASA_PAJAK = date(2022, 6, 30)
class
Inquiry
(
BaseInquiry
):
def
get_invoice
(
self
):
# Override
DBSession
=
get_db_session
()
q
=
DBSession
.
query
(
Invoice
)
.
filter_by
(
tahun
=
self
.
invoice_id
[
'Tahun'
],
sptno
=
self
.
invoice_id
[
'SptNo'
])
q
=
q
.
filter
(
Kohir
.
spt_id
==
Invoice
.
id
)
return
q
.
first
()
def
get_invoice_id
(
self
,
raw
):
# Override
if
raw
.
find
(
'367602'
)
==
0
:
# 3676: Tangsel, 02: PAD
return
raw
[
6
:]
...
...
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