Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Owo Sugiana
/
opensipkd-bphtb-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 2c1eaf82
authored
Oct 01, 2020
by
Owo Sugiana
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Akhiri dependency URL dengan .git agar dipahami git client lama
1 parent
754ea334
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
43 additions
and
35 deletions
opensipkd/bphtb/cilegon/scripts/available_invoice.py
opensipkd/bphtb/cilegon/scripts/inquiry.py
opensipkd/bphtb/cilegon/services.py
opensipkd/bphtb/scripts/inquiry.py
opensipkd/bphtb/tangerang_kabupaten/services.py
opensipkd/bphtb/tangerang_kabupaten/structure.py
opensipkd/bphtb/tangsel/services.py
opensipkd/bphtb/tasik_kabupaten/services.py
setup.py
opensipkd/bphtb/cilegon/scripts/available_invoice.py
View file @
2c1eaf8
...
...
@@ -24,13 +24,13 @@ def thousand(n):
class
AvailableInvoice
:
def
__init__
(
self
,
count
=
10
):
self
.
count
=
count
self
.
count
=
count
def
run
(
self
):
q_pay
=
DBSession
.
query
(
Pembayaran
)
.
\
filter
(
Pembayaran
.
t_statusbayarspt
==
None
)
.
\
filter
(
Pembayaran
.
t_statusbayarspt
is
None
)
.
\
order_by
(
Pembayaran
.
t_idpembayaranspt
.
desc
())
offset
=
-
1
offset
=
-
1
self
.
no
=
0
awal
=
time
()
while
True
:
...
...
opensipkd/bphtb/cilegon/scripts/inquiry.py
View file @
2c1eaf8
...
...
@@ -22,7 +22,7 @@ from opensipkd.bphtb.cilegon.services import (
)
opensipkd
.
bphtb
.
cilegon
.
services
.
DBSession
=
DBSession
opensipkd
.
bphtb
.
cilegon
.
services
.
DBSession
=
DBSession
locale
.
setlocale
(
locale
.
LC_ALL
,
'id_ID.utf8'
)
...
...
@@ -71,7 +71,7 @@ def show(inq):
show_val
(
'RW Wajib Pajak'
,
inq
.
get_rw_wp
())
show_val
(
'Kode Pos Wajib Pajak'
,
inq
.
get_kode_pos_wp
())
show_val
(
'Tahun Pajak'
,
inq
.
get_tahun
())
def
main
(
argv
=
sys
.
argv
):
option
,
remain
=
get_option
(
argv
[
1
:])
...
...
@@ -101,7 +101,9 @@ def main(argv=sys.argv):
rev
=
Reversal
(
invoice_id
)
pay
=
rev
.
payment
if
not
pay
:
print
(
'Pembayaran tidak ditemukan, tidak ada yang perlu dibatalkan.'
)
print
(
'Pembayaran tidak ditemukan, '
'tidak ada yang perlu dibatalkan.'
)
return
rev
.
do_reversal
()
print
(
...
...
opensipkd/bphtb/cilegon/services.py
View file @
2c1eaf8
...
...
@@ -48,7 +48,7 @@ class Inquiry:
q
=
DBSession
.
query
(
Pemeriksaan
)
.
filter_by
(
p_idpembayaranspt
=
self
.
payment
.
t_idpembayaranspt
)
self
.
pemeriksaan
=
q
.
first
()
self
.
profile
=
self
.
get_profile
()
self
.
profile
=
self
.
get_profile
()
self
.
notaris
=
self
.
get_notaris
()
self
.
hitung
()
...
...
@@ -177,12 +177,12 @@ class Inquiry:
return
not
self
.
payment
.
t_statusbayarspt
def
do_payment
(
self
,
ntb
):
self
.
payment
.
t_tanggalpembayaran
=
self
.
tgl_bayar
self
.
payment
.
t_tanggalpembayaran
=
self
.
tgl_bayar
self
.
payment
.
t_nilaipembayaranspt
=
self
.
total
self
.
payment
.
t_statusbayarspt
=
True
DBSession
.
add
(
self
.
payment
)
return
self
.
payment
return
self
.
payment
class
Reversal
:
def
__init__
(
self
,
invoice_id
):
...
...
@@ -209,13 +209,13 @@ class AvailableInvoice(BaseAvailableInvoice):
q
=
DBSession
.
query
(
Pembayaran
.
t_kodebayarbanksppt
,
Spt
.
t_tgljatuhtempospt
)
.
\
filter
(
Pembayaran
.
t_idspt
==
Spt
.
t_idspt
,
or_
(
Pembayaran
.
t_statusbayarspt
==
None
,
Pembayaran
.
t_statusbayarspt
==
False
))
Pembayaran
.
t_idspt
==
Spt
.
t_idspt
,
or_
(
Pembayaran
.
t_statusbayarspt
is
None
,
Pembayaran
.
t_statusbayarspt
is
False
))
if
self
.
option
.
tahun
:
q
=
q
.
filter
(
Spt
.
t_periodespt
==
self
.
option
.
tahun
)
q
=
q
.
filter
(
Spt
.
t_periodespt
==
self
.
option
.
tahun
)
if
self
.
option
.
belum_jatuh_tempo
or
self
.
option
.
lewat_jatuh_tempo
:
q
=
q
.
filter
(
Spt
.
t_tgljatuhtempospt
!=
None
)
q
=
q
.
filter
(
Spt
.
t_tgljatuhtempospt
is
not
None
)
kini
=
date
.
today
()
if
self
.
option
.
belum_jatuh_tempo
:
q
=
q
.
filter
(
Spt
.
t_tgljatuhtempospt
>=
kini
)
...
...
opensipkd/bphtb/scripts/inquiry.py
View file @
2c1eaf8
...
...
@@ -53,7 +53,7 @@ def show(inq):
show_val
(
'Kota Wajib Pajak'
,
inq
.
get_kota_wp
())
show_val
(
'Tahun Pajak'
,
inq
.
get_tahun
())
show_val
(
'Is Available'
,
inq
.
is_available
())
def
show_pkey_values
(
row
):
print
(
'Primary key tabel {}:'
.
format
(
row
.
__table__
.
name
))
...
...
@@ -65,7 +65,7 @@ def show_pkey_values(row):
def
main
(
argv
=
sys
.
argv
):
option
=
get_option
(
argv
[
1
:])
conf_file
=
option
.
conf
conf_file
=
option
.
conf
invoice_id
=
option
.
invoice_id
conf
=
ConfigParser
()
conf
.
read
(
conf_file
)
...
...
@@ -97,7 +97,8 @@ def main(argv=sys.argv):
rev
=
services_module
.
Reversal
(
invoice_id
)
pay
=
rev
.
payment
if
not
pay
:
print
(
'Pembayaran tidak ditemukan, tidak ada yang perlu dibatalkan.'
)
print
(
'Pembayaran tidak ditemukan, tidak ada yang perlu dibatalkan.'
)
return
with
transaction
.
manager
:
rev
.
do_reversal
()
...
...
opensipkd/bphtb/tangerang_kabupaten/services.py
View file @
2c1eaf8
...
...
@@ -61,14 +61,15 @@ class Common:
def
get_db_session
(
self
):
return
DBSession
def
query_invoice
(
self
):
kode
=
int
(
self
.
invoice_struct
[
'Kode'
])
kode
=
str
(
kode
)
DBSession
=
self
.
get_db_session
()
Invoice
=
self
.
get_invoice_model
()
return
DBSession
.
query
(
Invoice
)
.
filter_by
(
tahun
=
self
.
tahun
,
kode
=
kode
,
no_sspd
=
self
.
invoice_struct
[
'SSPD No'
])
tahun
=
self
.
tahun
,
kode
=
kode
,
no_sspd
=
self
.
invoice_struct
[
'SSPD No'
])
def
is_paid
(
self
):
return
self
.
invoice
.
status_pembayaran
==
1
...
...
@@ -241,8 +242,9 @@ class Inquiry(Common):
def
get_payment_amount
(
self
):
DBSession
=
self
.
get_db_session
()
q
=
DBSession
.
query
(
func
.
sum
(
Payment
.
bayar
)
.
label
(
'total_bayar'
))
.
\
filter_by
(
sspd_id
=
self
.
invoice
.
id
)
q
=
DBSession
.
query
(
func
.
sum
(
Payment
.
bayar
)
.
label
(
'total_bayar'
))
.
filter_by
(
sspd_id
=
self
.
invoice
.
id
)
row
=
q
.
first
()
return
row
.
total_bayar
or
0
...
...
@@ -303,8 +305,8 @@ class Reversal(Common):
def
get_last_payment
(
self
):
DBSession
=
self
.
get_db_session
()
q
=
DBSession
.
query
(
Payment
)
.
filter_by
(
sspd_id
=
self
.
invoice
.
id
)
.
\
order_by
(
Payment
.
id
.
desc
())
q
=
DBSession
.
query
(
Payment
)
.
filter_by
(
sspd_id
=
self
.
invoice
.
id
)
.
order_by
(
Payment
.
id
.
desc
())
return
q
.
first
()
def
do_reversal
(
self
):
# Override
...
...
@@ -332,7 +334,7 @@ class AvailableInvoice(BaseAvailableInvoice):
if
self
.
option
.
tahun
:
q
=
q
.
filter_by
(
tahun
=
self
.
option
.
tahun
)
if
self
.
option
.
belum_jatuh_tempo
or
self
.
option
.
lewat_jatuh_tempo
:
q
=
q
.
filter
(
Invoice
.
tgl_jatuh_tempo
!=
None
)
q
=
q
.
filter
(
Invoice
.
tgl_jatuh_tempo
is
not
None
)
kini
=
date
.
today
()
if
self
.
option
.
belum_jatuh_tempo
:
q
=
q
.
filter
(
Invoice
.
tgl_jatuh_tempo
>=
kini
)
...
...
opensipkd/bphtb/tangerang_kabupaten/structure.py
View file @
2c1eaf8
INVOICE_ID
=
[
INVOICE_ID
=
[
[
'Tahun'
,
4
,
'N'
],
[
'Kode'
,
2
,
'N'
],
[
'SSPD No'
,
6
,
'N'
],
...
...
opensipkd/bphtb/tangsel/services.py
View file @
2c1eaf8
...
...
@@ -36,12 +36,12 @@ class Inquiry(BaseInquiry):
return
Customer
def
get_db_session
(
self
):
# Override
return
DBSession
return
DBSession
class
Reversal
(
BaseReversal
):
def
get_db_session
(
self
):
# Override
return
DBSession
return
DBSession
def
get_invoice_model
(
self
):
# Override
return
Invoice
...
...
@@ -52,7 +52,7 @@ class Reversal(BaseReversal):
class
AvailableInvoice
(
BaseAvailableInvoice
):
def
get_db_session
(
self
):
# Override
return
DBSession
return
DBSession
def
get_inquiry_class
(
self
):
# Override
return
Inquiry
...
...
opensipkd/bphtb/tasik_kabupaten/services.py
View file @
2c1eaf8
...
...
@@ -18,7 +18,7 @@ def get_db_session():
class
Inquiry
(
BaseInquiry
):
def
get_db_session
(
self
):
return
DBSession
return
DBSession
def
get_kecamatan
(
self
):
q
=
DBSession
.
query
(
Kecamatan
)
.
filter_by
(
...
...
@@ -38,12 +38,12 @@ class Inquiry(BaseInquiry):
class
Reversal
(
BaseReversal
):
def
get_db_session
(
self
):
return
DBSession
return
DBSession
class
AvailableInvoice
(
BaseAvailableInvoice
):
def
get_db_session
(
self
):
return
DBSession
return
DBSession
def
get_inquiry_class
(
self
):
return
Inquiry
setup.py
View file @
2c1eaf8
...
...
@@ -12,8 +12,10 @@ version = line.split()[0]
requires
=
[
'sqlalchemy'
,
'opensipkd-base @ git+https://git.opensipkd.com/sugiana/opensipkd-base'
,
'opensipkd-hitung @ git+https://git.opensipkd.com/sugiana/opensipkd-hitung'
,
'opensipkd-base @ '
'git+https://git.opensipkd.com/sugiana/opensipkd-base.git'
,
'opensipkd-hitung @ '
'git+https://git.opensipkd.com/sugiana/opensipkd-hitung.git'
,
]
setuptools
.
setup
(
...
...
@@ -33,7 +35,8 @@ setuptools.setup(
],
entry_points
=
{
'console_scripts'
:
[
'bphtb_available_invoice = opensipkd.bphtb.scripts.available_invoice:main'
,
'bphtb_available_invoice = '
'opensipkd.bphtb.scripts.available_invoice:main'
,
'bphtb_inquiry = opensipkd.bphtb.scripts.inquiry:main'
,
]
},
...
...
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