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 a96769b0
authored
Dec 23, 2022
by
Owo Sugiana
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Kabupaten Serang tambah kurang bayar
1 parent
80c7a59e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
408 additions
and
174 deletions
opensipkd/bphtb/models/serang_kab.py
opensipkd/bphtb/scripts/available_invoice.py
opensipkd/bphtb/services/serang_kab/__init__.py
opensipkd/bphtb/models/serang_kab.py
View file @
a96769b
...
@@ -77,6 +77,57 @@ class Subjek(Base):
...
@@ -77,6 +77,57 @@ class Subjek(Base):
class
Invoice
(
Base
):
class
Invoice
(
Base
):
__tablename__
=
'dat_lap_ppat'
kd_propinsi
=
Column
(
String
(
2
),
primary_key
=
True
)
kd_dati2
=
Column
(
String
(
2
),
primary_key
=
True
)
thn_bphtb
=
Column
(
String
(
4
),
primary_key
=
True
)
bln_bphtb
=
Column
(
String
(
2
),
primary_key
=
True
)
tgl_bphtb
=
Column
(
String
(
2
),
primary_key
=
True
)
no_urut_bphtb
=
Column
(
String
(
4
),
primary_key
=
True
)
indeks_bphtb
=
Column
(
String
(
3
),
primary_key
=
True
)
kd_pejabat
=
Column
(
String
(
4
),
nullable
=
False
)
id_wp_bphtb
=
Column
(
String
(
30
),
ForeignKey
(
Subjek
.
id_wp_bphtb
),
nullable
=
False
)
# id_penjual_bphtb = Column(String(30),
# ForeignKey('iprotaxbphtb.dat_wp_bphtb.id_wp_bphtb'))
kd_kecamatan_op
=
Column
(
String
(
3
))
kd_kelurahan_op
=
Column
(
String
(
3
))
kd_blok_op
=
Column
(
String
(
3
))
no_urut_op
=
Column
(
String
(
4
))
kd_jns_op
=
Column
(
String
(
1
))
jalan_op
=
Column
(
String
(
50
))
blok_kav_no_op
=
Column
(
String
(
15
))
rw_op
=
Column
(
String
(
50
))
rt_op
=
Column
(
String
(
3
))
tgl_setor_ssp
=
Column
(
DateTime
)
ssp_disetor
=
Column
(
Float
)
luas_bumi
=
Column
(
Float
,
nullable
=
False
)
luas_bng
=
Column
(
Float
,
nullable
=
False
)
njop_bumi_m2
=
Column
(
Float
,
nullable
=
False
)
njop_bng_m2
=
Column
(
Float
,
nullable
=
False
)
# kd_perolehan = Column(String(2),
# ForeignKey('iprotaxbphtb.ref_jns_perolehan.kd_perolehan'),
# nullable=False)
kd_jns_hak
=
Column
(
String
(
2
))
# kd_jns_hak = Column(String(2),
# ForeignKey('iprotaxbphtb.ref_jns_hak.kd_jns_hak'))
no_sertifikat
=
Column
(
String
(
30
))
hrg_transaksi
=
Column
(
Float
,
nullable
=
False
)
tgl_ssb_ppat
=
Column
(
DateTime
,
nullable
=
False
)
bphtb_disetor
=
Column
(
Float
,
nullable
=
False
)
no_akta
=
Column
(
String
(
20
))
tgl_akta
=
Column
(
DateTime
)
tgl_rekam
=
Column
(
DateTime
,
nullable
=
False
)
keterangan_ppat
=
Column
(
String
(
255
))
user_rekam
=
Column
(
String
(
50
))
__table_args__
=
(
ForeignKeyConstraint
([
kd_propinsi
,
kd_dati2
,
kd_pejabat
],
[
Customer
.
kd_propinsi
,
Customer
.
kd_dati2
,
Customer
.
kd_pejabat
]),
dict
(
schema
=
'iprotaxbphtb'
))
class
SsbPpat
(
Base
):
__tablename__
=
'dat_ssb_ppat'
__tablename__
=
'dat_ssb_ppat'
kd_propinsi
=
Column
(
String
(
2
),
primary_key
=
True
)
kd_propinsi
=
Column
(
String
(
2
),
primary_key
=
True
)
kd_dati2
=
Column
(
String
(
2
),
primary_key
=
True
)
kd_dati2
=
Column
(
String
(
2
),
primary_key
=
True
)
...
@@ -134,57 +185,6 @@ class Invoice(Base):
...
@@ -134,57 +185,6 @@ class Invoice(Base):
dict
(
schema
=
'iprotaxbphtb'
))
dict
(
schema
=
'iprotaxbphtb'
))
class
Objek
(
Base
):
__tablename__
=
'dat_op_ssb_ppat'
kd_propinsi
=
Column
(
String
(
2
),
primary_key
=
True
)
kd_dati2
=
Column
(
String
(
2
),
primary_key
=
True
)
thn_bphtb
=
Column
(
String
(
4
),
primary_key
=
True
)
bln_bphtb
=
Column
(
String
(
2
),
primary_key
=
True
)
tgl_bphtb
=
Column
(
String
(
2
),
primary_key
=
True
)
no_urut_bphtb
=
Column
(
String
(
4
),
primary_key
=
True
)
indeks_bphtb
=
Column
(
String
(
3
),
primary_key
=
True
)
kd_kecamatan_op
=
Column
(
String
(
3
),
primary_key
=
True
)
kd_kelurahan_op
=
Column
(
String
(
3
),
primary_key
=
True
)
kd_blok_op
=
Column
(
String
(
3
),
primary_key
=
True
)
no_urut_op
=
Column
(
String
(
4
),
primary_key
=
True
)
kd_jns_op
=
Column
(
String
(
1
),
primary_key
=
True
)
kd_blok_baru
=
Column
(
String
(
3
))
no_urut_baru
=
Column
(
String
(
4
))
kd_jns_op_baru
=
Column
(
String
(
1
))
jalan_op
=
Column
(
String
(
50
))
blok_kav_no_op
=
Column
(
String
(
15
))
rt_op
=
Column
(
String
(
3
))
rw_op
=
Column
(
String
(
50
))
kd_pos_op
=
Column
(
String
(
5
))
luas_tanah
=
Column
(
Float
,
nullable
=
False
)
luas_bangunan
=
Column
(
Float
,
nullable
=
False
)
njop_tanah_m2
=
Column
(
Float
,
nullable
=
False
)
njop_bng_m2
=
Column
(
Float
,
nullable
=
False
)
njop_tanah
=
Column
(
Float
,
nullable
=
False
)
njop_bangunan
=
Column
(
Float
,
nullable
=
False
)
njop_total
=
Column
(
Float
,
nullable
=
False
)
# kd_jns_hak = Column(String(2),
# ForeignKey('iprotaxbphtb.ref_jns_hak.kd_jns_hak'))
kd_jns_hak
=
Column
(
String
(
2
))
kd_kecamatan
=
Column
(
String
(
3
))
kd_kelurahan
=
Column
(
String
(
3
))
no_sertifikat
=
Column
(
String
(
30
))
persen_pengurang_njop
=
Column
(
Float
)
faktor_pengurang_njop
=
Column
(
Float
)
__table_args__
=
(
ForeignKeyConstraint
([
kd_propinsi
,
kd_dati2
,
kd_kecamatan
,
kd_kelurahan
],
[
Kelurahan
.
kd_propinsi
,
Kelurahan
.
kd_dati2
,
Kelurahan
.
kd_kecamatan
,
Kelurahan
.
kd_kelurahan
]),
ForeignKeyConstraint
([
kd_propinsi
,
kd_dati2
,
thn_bphtb
,
bln_bphtb
,
tgl_bphtb
,
no_urut_bphtb
,
indeks_bphtb
],
[
Invoice
.
kd_propinsi
,
Invoice
.
kd_dati2
,
Invoice
.
thn_bphtb
,
Invoice
.
bln_bphtb
,
Invoice
.
tgl_bphtb
,
Invoice
.
no_urut_bphtb
,
Invoice
.
indeks_bphtb
]),
dict
(
schema
=
'iprotaxbphtb'
))
class
Payment
(
Base
):
class
Payment
(
Base
):
__tablename__
=
'pembayaran_bphtb'
__tablename__
=
'pembayaran_bphtb'
kd_propinsi
=
Column
(
String
(
2
),
primary_key
=
True
)
kd_propinsi
=
Column
(
String
(
2
),
primary_key
=
True
)
...
@@ -217,12 +217,11 @@ class Payment(Base):
...
@@ -217,12 +217,11 @@ class Payment(Base):
tgl_rekon_bayar
=
Column
(
DateTime
)
tgl_rekon_bayar
=
Column
(
DateTime
)
no_transaksi_byr
=
Column
(
String
(
20
))
no_transaksi_byr
=
Column
(
String
(
20
))
tgl_rekam_byr
=
Column
(
DateTime
)
tgl_rekam_byr
=
Column
(
DateTime
)
__table_args__
=
(
__table_args__
=
dict
(
schema
=
'iprotaxbphtb'
)
dict
(
schema
=
'iprotaxbphtb'
))
class
LapPpat
(
Base
):
class
Skbkb
(
Base
):
__tablename__
=
'dat_
lap_ppat
'
__tablename__
=
'dat_
skbkb
'
kd_propinsi
=
Column
(
String
(
2
),
primary_key
=
True
)
kd_propinsi
=
Column
(
String
(
2
),
primary_key
=
True
)
kd_dati2
=
Column
(
String
(
2
),
primary_key
=
True
)
kd_dati2
=
Column
(
String
(
2
),
primary_key
=
True
)
thn_bphtb
=
Column
(
String
(
4
),
primary_key
=
True
)
thn_bphtb
=
Column
(
String
(
4
),
primary_key
=
True
)
...
@@ -230,49 +229,33 @@ class LapPpat(Base):
...
@@ -230,49 +229,33 @@ class LapPpat(Base):
tgl_bphtb
=
Column
(
String
(
2
),
primary_key
=
True
)
tgl_bphtb
=
Column
(
String
(
2
),
primary_key
=
True
)
no_urut_bphtb
=
Column
(
String
(
4
),
primary_key
=
True
)
no_urut_bphtb
=
Column
(
String
(
4
),
primary_key
=
True
)
indeks_bphtb
=
Column
(
String
(
3
),
primary_key
=
True
)
indeks_bphtb
=
Column
(
String
(
3
),
primary_key
=
True
)
kd_pejabat
=
Column
(
String
(
4
),
nullable
=
False
)
no_skbkb
=
Column
(
String
(
30
),
nullable
=
False
)
# id_wp_bphtb = Column(String(30),
tgl_skbkb
=
Column
(
DateTime
,
nullable
=
False
)
# ForeignKey('iprotaxbphtb.dat_wp_bphtb.id_wp_bphtb'), nullable=False)
tgl_jth_tempo
=
Column
(
DateTime
)
# id_penjual_bphtb = Column(String(30),
pokok_stb
=
Column
(
Float
)
# ForeignKey('iprotaxbphtb.dat_wp_bphtb.id_wp_bphtb'))
pengurangan
=
Column
(
Float
)
kd_kecamatan_op
=
Column
(
String
(
3
))
pokok_skblb_skpkb
=
Column
(
Float
)
kd_kelurahan_op
=
Column
(
String
(
3
))
bphtb_total
=
Column
(
Float
)
kd_blok_op
=
Column
(
String
(
3
))
bphtb_krg_bayar
=
Column
(
Float
)
no_urut_op
=
Column
(
String
(
4
))
jml_bln_bunga
=
Column
(
Float
)
kd_jns_op
=
Column
(
String
(
1
))
jml_bunga
=
Column
(
Float
)
jalan_op
=
Column
(
String
(
50
))
jml_bphtb_krg_bayar
=
Column
(
Float
)
blok_kav_no_op
=
Column
(
String
(
15
))
rw_op
=
Column
(
String
(
50
))
rt_op
=
Column
(
String
(
3
))
tgl_setor_ssp
=
Column
(
DateTime
)
ssp_disetor
=
Column
(
Float
)
luas_bumi
=
Column
(
Float
,
nullable
=
False
)
luas_bng
=
Column
(
Float
,
nullable
=
False
)
njop_bumi_m2
=
Column
(
Float
,
nullable
=
False
)
njop_bng_m2
=
Column
(
Float
,
nullable
=
False
)
# kd_perolehan = Column(String(2),
# ForeignKey('iprotaxbphtb.ref_jns_perolehan.kd_perolehan'),
# nullable=False)
# kd_jns_hak = Column(String(2),
# ForeignKey('iprotaxbphtb.ref_jns_hak.kd_jns_hak'))
no_sertifikat
=
Column
(
String
(
30
))
hrg_transaksi
=
Column
(
Float
,
nullable
=
False
)
tgl_ssb_ppat
=
Column
(
DateTime
,
nullable
=
False
)
bphtb_disetor
=
Column
(
Float
,
nullable
=
False
)
no_akta
=
Column
(
String
(
20
))
tgl_akta
=
Column
(
DateTime
)
tgl_rekam
=
Column
(
DateTime
,
nullable
=
False
)
tgl_rekam
=
Column
(
DateTime
,
nullable
=
False
)
keterangan_ppat
=
Column
(
String
(
255
))
# nip_perekam = Column(String(9), ForeignKey('iprotaxref.pegawai.nip'),
user_rekam
=
Column
(
String
(
50
))
# nullable=False)
__table_args__
=
(
thn_bphtb_terbit
=
Column
(
String
(
4
))
ForeignKeyConstraint
([
bln_bphtb_terbit
=
Column
(
String
(
2
))
kd_propinsi
,
kd_dati2
,
kd_pejabat
],
tgl_bphtb_terbit
=
Column
(
String
(
2
))
[
Customer
.
kd_propinsi
,
Customer
.
kd_dati2
,
Customer
.
kd_pejabat
]),
no_urut_bphtb_terbit
=
Column
(
String
(
4
))
dict
(
schema
=
'iprotaxbphtb'
))
indeks_bphtb_terbit
=
Column
(
String
(
3
))
status_pembayaran
=
Column
(
String
(
1
))
status_pembatalan
=
Column
(
Float
)
no_pelayanan_pembatalan
=
Column
(
String
(
11
))
__table_args__
=
dict
(
schema
=
'iprotaxbphtb'
)
class
Skbkb
(
Base
):
class
Skbkb
T
(
Base
):
__tablename__
=
'dat_skbkb'
__tablename__
=
'dat_skbkb
t
'
kd_propinsi
=
Column
(
String
(
2
),
primary_key
=
True
)
kd_propinsi
=
Column
(
String
(
2
),
primary_key
=
True
)
kd_dati2
=
Column
(
String
(
2
),
primary_key
=
True
)
kd_dati2
=
Column
(
String
(
2
),
primary_key
=
True
)
thn_bphtb
=
Column
(
String
(
4
),
primary_key
=
True
)
thn_bphtb
=
Column
(
String
(
4
),
primary_key
=
True
)
...
@@ -280,8 +263,8 @@ class Skbkb(Base):
...
@@ -280,8 +263,8 @@ class Skbkb(Base):
tgl_bphtb
=
Column
(
String
(
2
),
primary_key
=
True
)
tgl_bphtb
=
Column
(
String
(
2
),
primary_key
=
True
)
no_urut_bphtb
=
Column
(
String
(
4
),
primary_key
=
True
)
no_urut_bphtb
=
Column
(
String
(
4
),
primary_key
=
True
)
indeks_bphtb
=
Column
(
String
(
3
),
primary_key
=
True
)
indeks_bphtb
=
Column
(
String
(
3
),
primary_key
=
True
)
no_skbkb
=
Column
(
String
(
30
),
nullable
=
False
)
no_skbkb
t
=
Column
(
String
(
30
),
nullable
=
False
)
tgl_skbkb
=
Column
(
DateTime
,
nullable
=
False
)
tgl_skbkb
t
=
Column
(
DateTime
,
nullable
=
False
)
tgl_jth_tempo
=
Column
(
DateTime
)
tgl_jth_tempo
=
Column
(
DateTime
)
pokok_stb
=
Column
(
Float
)
pokok_stb
=
Column
(
Float
)
pengurangan
=
Column
(
Float
)
pengurangan
=
Column
(
Float
)
...
@@ -300,10 +283,11 @@ class Skbkb(Base):
...
@@ -300,10 +283,11 @@ class Skbkb(Base):
no_urut_bphtb_terbit
=
Column
(
String
(
4
))
no_urut_bphtb_terbit
=
Column
(
String
(
4
))
indeks_bphtb_terbit
=
Column
(
String
(
3
))
indeks_bphtb_terbit
=
Column
(
String
(
3
))
status_pembayaran
=
Column
(
String
(
1
))
status_pembayaran
=
Column
(
String
(
1
))
atas_lapor_wp
=
Column
(
Float
)
keterangan
=
Column
(
String
(
255
))
status_pembatalan
=
Column
(
Float
)
status_pembatalan
=
Column
(
Float
)
no_pelayanan_pembatalan
=
Column
(
String
(
11
))
no_pelayanan_pembatalan
=
Column
(
String
(
11
))
__table_args__
=
(
__table_args__
=
dict
(
schema
=
'iprotaxbphtb'
)
dict
(
schema
=
'iprotaxbphtb'
))
class
SsbWp
(
Base
):
class
SsbWp
(
Base
):
...
@@ -358,5 +342,142 @@ class SsbWp(Base):
...
@@ -358,5 +342,142 @@ class SsbWp(Base):
no_urut_bphtb_induk
=
Column
(
String
(
4
))
no_urut_bphtb_induk
=
Column
(
String
(
4
))
indeks_bphtb_induk
=
Column
(
String
(
3
))
indeks_bphtb_induk
=
Column
(
String
(
3
))
tarif_bphtb
=
Column
(
Float
)
tarif_bphtb
=
Column
(
Float
)
__table_args__
=
dict
(
schema
=
'iprotaxbphtb'
)
class
TelitiSsb
(
Base
):
__tablename__
=
'daftar_teliti_ssb'
kd_propinsi
=
Column
(
String
(
2
),
primary_key
=
True
)
kd_dati2
=
Column
(
String
(
2
),
primary_key
=
True
)
kd_dinas
=
Column
(
String
(
2
),
primary_key
=
True
)
kd_kppd
=
Column
(
String
(
2
),
primary_key
=
True
)
no_pendaftaran
=
Column
(
String
(
21
),
primary_key
=
True
)
thn_bphtb
=
Column
(
String
(
4
))
bln_bphtb
=
Column
(
String
(
2
))
tgl_bphtb
=
Column
(
String
(
2
))
no_urut_bphtb
=
Column
(
String
(
4
))
indeks_bphtb
=
Column
(
String
(
3
))
tgl_daftar
=
Column
(
DateTime
,
nullable
=
False
)
# id_wp_bphtb = Column(String(30),
# ForeignKey('iprotaxbphtb.dat_wp_bphtb.id_wp_bphtb'), nullable=False)
kd_kecamatan_op
=
Column
(
String
(
3
))
kd_kelurahan_op
=
Column
(
String
(
3
))
kd_blok_op
=
Column
(
String
(
3
))
no_urut_op
=
Column
(
String
(
4
))
kd_jns_op
=
Column
(
String
(
1
))
alm_op
=
Column
(
String
(
100
))
lamp_sspd
=
Column
(
Float
)
lamp_tunggakan_pbb
=
Column
(
Float
)
lamp_sppt
=
Column
(
Float
)
lamp_ktp_wp
=
Column
(
Float
)
lamp_ssp
=
Column
(
Float
)
lamp_surat_kuasa
=
Column
(
Float
)
lamp_akte_risalah
=
Column
(
Float
)
lamp_foto_objek_pajak
=
Column
(
Float
)
lamp_kartu_keluarga
=
Column
(
Float
)
lamp_ktp_kuasa
=
Column
(
Float
)
lamp_silsilah_waris
=
Column
(
Float
)
lamp_kwitansi
=
Column
(
Float
)
lamp_surat_pernyataan
=
Column
(
Float
)
kd_pejabat
=
Column
(
String
(
4
))
diteruskan_ke
=
Column
(
String
(
1
))
nip_perekam
=
Column
(
String
(
50
),
nullable
=
False
)
tgl_rekam
=
Column
(
DateTime
,
nullable
=
False
)
status_dokumen
=
Column
(
String
(
2
),
nullable
=
False
)
catatan_pendaftaran
=
Column
(
String
(
255
))
kd_sumber_data
=
Column
(
String
(
1
),
nullable
=
False
)
lamp_risalah_lelang
=
Column
(
Float
)
lamp_spop_lspop
=
Column
(
Float
)
lamp_lain_lain
=
Column
(
Float
)
status_bpn
=
Column
(
String
(
1
))
jenis_mutasi
=
Column
(
String
(
1
))
id_penjual_bphtb
=
Column
(
String
(
30
))
lamp_bphtb_01
=
Column
(
Float
)
lamp_bphtb_02
=
Column
(
Float
)
lamp_bphtb_03
=
Column
(
Float
)
lamp_bphtb_04
=
Column
(
Float
)
lamp_bphtb_05
=
Column
(
Float
)
lamp_bphtb_06
=
Column
(
Float
)
lamp_bphtb_07
=
Column
(
Float
)
lamp_bphtb_08
=
Column
(
Float
)
lamp_bphtb_09
=
Column
(
Float
)
lamp_bphtb_10
=
Column
(
Float
)
lamp_bphtb_11
=
Column
(
Float
)
lamp_bphtb_12
=
Column
(
Float
)
lamp_bphtb_13
=
Column
(
Float
)
lamp_bphtb_14
=
Column
(
Float
)
lamp_bphtb_15
=
Column
(
Float
)
lamp_bphtb_16
=
Column
(
Float
)
jml_anggota_aphb
=
Column
(
Float
)
is_citigov
=
Column
(
Float
,
nullable
=
False
)
__table_args__
=
(
__table_args__
=
(
UniqueConstraint
(
kd_propinsi
,
kd_dati2
,
thn_bphtb
,
bln_bphtb
,
tgl_bphtb
,
no_urut_bphtb
,
indeks_bphtb
),
dict
(
schema
=
'iprotaxbphtb'
))
dict
(
schema
=
'iprotaxbphtb'
))
class
TelitiSsbDetail
(
Base
):
__tablename__
=
'daftar_teliti_ssb_detail'
kd_propinsi
=
Column
(
String
(
2
),
primary_key
=
True
)
kd_dati2
=
Column
(
String
(
2
),
primary_key
=
True
)
kd_dinas
=
Column
(
String
(
2
),
primary_key
=
True
)
kd_kppd
=
Column
(
String
(
2
),
primary_key
=
True
)
no_pendaftaran
=
Column
(
String
(
21
),
primary_key
=
True
)
# kd_perolehan = Column(String(2),
# ForeignKey('iprotaxbphtb.ref_jns_perolehan.kd_perolehan'))
# kd_jns_hak = Column(String(2),
# ForeignKey('iprotaxbphtb.ref_jns_hak.kd_jns_hak'))
dsr_pengenaan
=
Column
(
String
(
2
))
luas_tanah
=
Column
(
Float
,
nullable
=
False
)
luas_bangunan
=
Column
(
Float
,
nullable
=
False
)
njop_total
=
Column
(
Float
,
nullable
=
False
)
hrg_transaksi
=
Column
(
Float
,
nullable
=
False
)
npoptkp
=
Column
(
Float
,
nullable
=
False
)
bphtb_hrs_dibayar
=
Column
(
Float
,
nullable
=
False
)
njop_tanah_m2
=
Column
(
Float
,
nullable
=
False
)
njop_bng_m2
=
Column
(
Float
,
nullable
=
False
)
pengenaan
=
Column
(
Float
)
tarif_bphtb
=
Column
(
Float
)
persen_pengurang_njop
=
Column
(
Float
)
faktor_pengurang_njop
=
Column
(
Float
)
__table_args__
=
dict
(
schema
=
'iprotaxbphtb'
)
class
Verifikasi
(
Base
):
__tablename__
=
'dat_verifikasi_bphtb'
kd_propinsi
=
Column
(
String
(
2
),
primary_key
=
True
)
kd_dati2
=
Column
(
String
(
2
),
primary_key
=
True
)
thn_bphtb
=
Column
(
String
(
4
),
primary_key
=
True
)
bln_bphtb
=
Column
(
String
(
2
),
primary_key
=
True
)
tgl_bphtb
=
Column
(
String
(
2
),
primary_key
=
True
)
no_urut_bphtb
=
Column
(
String
(
4
),
primary_key
=
True
)
indeks_bphtb
=
Column
(
String
(
3
),
primary_key
=
True
)
tgl_bayar_ssb
=
Column
(
DateTime
,
nullable
=
False
)
tgl_terbit_ssb
=
Column
(
DateTime
)
id_wp_bphtb
=
Column
(
String
(
30
))
luas_tanah
=
Column
(
Float
)
luas_bangunan
=
Column
(
Float
)
njop_tanah_m2
=
Column
(
Float
)
njop_bng_m2
=
Column
(
Float
)
njop_tanah
=
Column
(
Float
)
njop_bangunan
=
Column
(
Float
)
njop_total
=
Column
(
Float
)
hrg_transaksi
=
Column
(
Float
)
akumulasi_npop_sblm
=
Column
(
Float
)
npop
=
Column
(
Float
)
npoptkp
=
Column
(
Float
,
nullable
=
False
)
npopkp
=
Column
(
Float
)
bphtb_terutang
=
Column
(
Float
,
nullable
=
False
)
dsr_pengenaan
=
Column
(
String
(
2
))
pengenaan
=
Column
(
Float
)
bphtb_hrs_dibayar
=
Column
(
Float
)
pengurangan_sendiri
=
Column
(
Float
)
bphtb_disetor
=
Column
(
Float
,
nullable
=
False
)
status_verifikasi
=
Column
(
Float
)
bphtb_verifikasi
=
Column
(
Float
,
nullable
=
False
)
tgl_rekam
=
Column
(
DateTime
,
nullable
=
False
)
nip_perekam
=
Column
(
String
(
9
),
nullable
=
False
)
nop_pbb
=
Column
(
String
(
18
))
kd_pejabat
=
Column
(
String
(
4
),
nullable
=
False
)
__table_args__
=
dict
(
schema
=
'iprotaxbphtb'
)
opensipkd/bphtb/scripts/available_invoice.py
View file @
a96769b
...
@@ -4,6 +4,7 @@ from .common import init
...
@@ -4,6 +4,7 @@ from .common import init
help_skpdkb
=
'Tampilkan kode bayar SKPDKB'
help_skpdkb
=
'Tampilkan kode bayar SKPDKB'
help_skpdkb_t
=
'Tampilkan kode bayar SKPDKB Tambahan'
def
get_option
(
argv
):
def
get_option
(
argv
):
...
@@ -15,6 +16,8 @@ def get_option(argv):
...
@@ -15,6 +16,8 @@ def get_option(argv):
pars
.
add_argument
(
'--max-nominal'
,
type
=
int
)
pars
.
add_argument
(
'--max-nominal'
,
type
=
int
)
pars
.
add_argument
(
'--tahun'
,
type
=
int
)
pars
.
add_argument
(
'--tahun'
,
type
=
int
)
pars
.
add_argument
(
'--skpdkb'
,
action
=
'store_true'
,
help
=
help_skpdkb
)
pars
.
add_argument
(
'--skpdkb'
,
action
=
'store_true'
,
help
=
help_skpdkb
)
pars
.
add_argument
(
'--skpdkb-tambahan'
,
action
=
'store_true'
,
help
=
help_skpdkb_t
)
pars
.
add_argument
(
'--belum-jatuh-tempo'
,
action
=
'store_true'
)
pars
.
add_argument
(
'--belum-jatuh-tempo'
,
action
=
'store_true'
)
pars
.
add_argument
(
'--lewat-jatuh-tempo'
,
action
=
'store_true'
)
pars
.
add_argument
(
'--lewat-jatuh-tempo'
,
action
=
'store_true'
)
pars
.
add_argument
(
pars
.
add_argument
(
...
...
opensipkd/bphtb/services/serang_kab/__init__.py
View file @
a96769b
...
@@ -12,13 +12,16 @@ from opensipkd.bphtb.models.serang_kab import (
...
@@ -12,13 +12,16 @@ from opensipkd.bphtb.models.serang_kab import (
Kecamatan
,
Kecamatan
,
Kelurahan
,
Kelurahan
,
Subjek
,
Subjek
,
Objek
,
Invoice
,
Invoice
,
Payment
,
Payment
,
Customer
,
Customer
,
Lap
Ppat
,
Ssb
Ppat
,
Skbkb
,
Skbkb
,
SkbkbT
,
SsbWp
,
SsbWp
,
TelitiSsb
,
TelitiSsbDetail
,
Verifikasi
,
)
)
from
..base
import
(
from
..base
import
(
AvailableInvoice
as
BaseAvailableInvoice
,
AvailableInvoice
as
BaseAvailableInvoice
,
...
@@ -46,6 +49,19 @@ class Common:
...
@@ -46,6 +49,19 @@ class Common:
self
.
invoice_struct
=
FixLength
(
INVOICE_ID
)
self
.
invoice_struct
=
FixLength
(
INVOICE_ID
)
self
.
invoice_struct
.
set_raw
(
self
.
invoice_id
)
self
.
invoice_struct
.
set_raw
(
self
.
invoice_id
)
self
.
invoice
=
self
.
get_invoice
()
self
.
invoice
=
self
.
get_invoice
()
self
.
invoice_kb
=
None
if
self
.
invoice
:
self
.
jenis_tagihan
=
'NB'
# Normal Bayar
return
self
.
invoice_kb
=
self
.
get_invoice_kb
()
if
self
.
invoice_kb
:
self
.
jenis_tagihan
=
'KB'
# Kurang Bayar
else
:
self
.
invoice_kb
=
self
.
get_invoice_kb
(
SkbkbT
)
self
.
jenis_tagihan
=
'KBT'
# Kurang Bayar Tambahan
if
self
.
invoice_kb
:
self
.
invoice
=
self
.
get_first_invoice
()
self
.
verifikasi
=
self
.
get_verifikasi
()
def
validate_invoice_id
(
self
):
def
validate_invoice_id
(
self
):
return
len
(
self
.
invoice_id
)
==
INVOICE_ID_LENGTH
return
len
(
self
.
invoice_id
)
==
INVOICE_ID_LENGTH
...
@@ -57,34 +73,78 @@ class Common:
...
@@ -57,34 +73,78 @@ class Common:
tgl_bphtb
=
self
.
invoice_struct
[
'tgl'
],
tgl_bphtb
=
self
.
invoice_struct
[
'tgl'
],
no_urut_bphtb
=
self
.
invoice_struct
[
'no_urut'
])
no_urut_bphtb
=
self
.
invoice_struct
[
'no_urut'
])
def
filter_invoice_kb
(
self
,
q
):
return
q
.
filter_by
(
thn_bphtb_terbit
=
self
.
invoice_struct
[
'thn'
],
bln_bphtb_terbit
=
self
.
invoice_struct
[
'bln'
],
tgl_bphtb_terbit
=
self
.
invoice_struct
[
'tgl'
],
no_urut_bphtb_terbit
=
self
.
invoice_struct
[
'no_urut'
])
def
get_dict_kb
(
self
):
return
dict
(
thn_bphtb
=
self
.
invoice_kb
.
thn_bphtb_terbit
,
bln_bphtb
=
self
.
invoice_kb
.
bln_bphtb_terbit
,
tgl_bphtb
=
self
.
invoice_kb
.
tgl_bphtb_terbit
,
no_urut_bphtb
=
self
.
invoice_kb
.
no_urut_bphtb_terbit
)
def
filter_payment_kb
(
self
,
q
):
d
=
self
.
get_dict_kb
()
return
q
.
filter_by
(
**
d
)
def
query_invoice
(
self
,
orm
=
Invoice
):
def
query_invoice
(
self
,
orm
=
Invoice
):
db_session
=
get_db_session
()
db_session
=
get_db_session
()
q
=
db_session
.
query
(
orm
)
q
=
db_session
.
query
(
orm
)
return
self
.
filter_invoice
(
q
)
return
self
.
filter_invoice
(
q
)
def
query_invoice_kb
(
self
,
orm
=
Skbkb
):
db_session
=
get_db_session
()
q
=
db_session
.
query
(
orm
)
return
self
.
filter_invoice_kb
(
q
)
def
get_invoice
(
self
,
orm
=
Invoice
):
def
get_invoice
(
self
,
orm
=
Invoice
):
q
=
self
.
query_invoice
(
orm
)
q
=
self
.
query_invoice
(
orm
)
return
q
.
first
()
return
q
.
first
()
def
get_invoice_kb
(
self
,
orm
=
Skbkb
):
q
=
self
.
query_invoice_kb
(
orm
)
return
q
.
first
()
def
get_first_invoice
(
self
,
orm
=
Invoice
):
db_session
=
get_db_session
()
q
=
db_session
.
query
(
orm
)
.
filter_by
(
thn_bphtb
=
self
.
invoice_kb
.
thn_bphtb
,
bln_bphtb
=
self
.
invoice_kb
.
bln_bphtb
,
tgl_bphtb
=
self
.
invoice_kb
.
tgl_bphtb
,
no_urut_bphtb
=
self
.
invoice_kb
.
no_urut_bphtb
)
return
q
.
first
()
def
get_verifikasi
(
self
):
return
self
.
get_first_invoice
(
Verifikasi
)
def
get_payment
(
self
):
def
get_payment
(
self
):
if
self
.
invoice_kb
:
db_session
=
get_db_session
()
q
=
db_session
.
query
(
Payment
)
q
=
self
.
filter_payment_kb
(
q
)
return
q
.
first
()
return
self
.
get_invoice
(
Payment
)
return
self
.
get_invoice
(
Payment
)
def
update_status
(
self
,
tgl_bayar
):
def
update_status
(
self
,
tgl_bayar
):
db_session
=
get_db_session
()
db_session
=
get_db_session
()
self
.
invoice
.
tgl_bayar_ssb_wp
=
tgl_bayar
if
self
.
invoice_kb
:
db_session
.
add
(
self
.
invoice
)
self
.
invoice_kb
.
status_pembayaran
=
tgl_bayar
and
'1'
or
'0'
lap_ppat
=
self
.
get_invoice
(
LapPpat
)
db_session
.
add
(
self
.
invoice_kb
)
if
lap_ppat
:
else
:
lap_ppat
.
tgl_setor_ssp
=
tgl_bayar
self
.
invoice
.
tgl_setor_ssp
=
tgl_bayar
db_session
.
add
(
lap_ppat
)
db_session
.
add
(
self
.
invoice
)
skbkb
=
self
.
get_invoice
(
Skbkb
)
ssb_ppat
=
self
.
get_invoice
(
SsbPpat
)
if
skbkb
:
if
ssb_ppat
:
skbkb
.
status_pembayaran
=
tgl_bayar
and
'1'
or
'0'
ssb_ppat
.
tgl_bayar_ssb_wp
=
tgl_bayar
db_session
.
add
(
skbkb
)
db_session
.
add
(
ssb_ppat
)
ssb_wp
=
self
.
get_invoice
(
SsbWp
)
ssb_wp
=
self
.
get_invoice
(
SsbWp
)
if
ssb_wp
:
if
ssb_wp
:
ssb_wp
.
tgl_bayar_ssb_wp
=
tgl_bayar
ssb_wp
.
tgl_bayar_ssb_wp
=
tgl_bayar
db_session
.
add
(
ssb_wp
)
db_session
.
add
(
ssb_wp
)
class
Inquiry
(
Common
):
class
Inquiry
(
Common
):
...
@@ -95,25 +155,28 @@ class Inquiry(Common):
...
@@ -95,25 +155,28 @@ class Inquiry(Common):
self
.
conf
=
conf
self
.
conf
=
conf
self
.
tgl_bayar
=
tgl_bayar
or
datetime
.
now
()
self
.
tgl_bayar
=
tgl_bayar
or
datetime
.
now
()
self
.
subjek
=
self
.
get_subjek
()
self
.
subjek
=
self
.
get_subjek
()
self
.
objek
=
self
.
get_objek
()
self
.
notaris
=
self
.
get_notaris
()
self
.
notaris
=
self
.
get_notaris
()
self
.
kelurahan
=
self
.
get_kelurahan
()
self
.
kelurahan
=
self
.
get_kelurahan
()
self
.
kecamatan
=
self
.
get_kecamatan
()
self
.
kecamatan
=
self
.
get_kecamatan
()
self
.
nop_struct
=
FixLength
(
NOP
)
self
.
nop_struct
=
FixLength
(
NOP
)
self
.
nop_struct
.
from_dict
({
self
.
nop_struct
.
from_dict
({
'Propinsi'
:
self
.
objek
.
kd_propinsi
,
'Propinsi'
:
self
.
invoice
.
kd_propinsi
,
'Kabupaten'
:
self
.
objek
.
kd_dati2
,
'Kabupaten'
:
self
.
invoice
.
kd_dati2
,
'Kecamatan'
:
self
.
objek
.
kd_kecamatan_op
,
'Kecamatan'
:
self
.
invoice
.
kd_kecamatan_op
,
'Kelurahan'
:
self
.
objek
.
kd_kelurahan_op
,
'Kelurahan'
:
self
.
invoice
.
kd_kelurahan_op
,
'Blok'
:
self
.
objek
.
kd_blok_op
,
'Blok'
:
self
.
invoice
.
kd_blok_op
,
'Urut'
:
self
.
objek
.
no_urut_op
,
'Urut'
:
self
.
invoice
.
no_urut_op
,
'Jenis'
:
self
.
objek
.
kd_jns_op
,
'Jenis'
:
self
.
invoice
.
kd_jns_op
,
})
})
self
.
hitung
()
self
.
hitung
()
def
hitung
(
self
):
def
hitung
(
self
):
if
self
.
invoice_kb
:
self
.
tagihan
=
self
.
invoice_kb
.
bphtb_krg_bayar
else
:
self
.
tagihan
=
self
.
invoice
.
bphtb_disetor
self
.
total_bayar
=
self
.
get_payment_amount
()
self
.
total_bayar
=
self
.
get_payment_amount
()
self
.
tagihan
=
self
.
invoice
.
bphtb_hrs_dibayar
-
self
.
total_bayar
self
.
tagihan
-=
self
.
total_bayar
self
.
total
=
self
.
denda
=
self
.
discount
=
0
self
.
total
=
self
.
denda
=
self
.
discount
=
0
if
self
.
tagihan
<
1
:
if
self
.
tagihan
<
1
:
self
.
tagihan
=
self
.
total
=
0
self
.
tagihan
=
self
.
total
=
0
...
@@ -123,16 +186,7 @@ class Inquiry(Common):
...
@@ -123,16 +186,7 @@ class Inquiry(Common):
def
get_subjek
(
self
):
def
get_subjek
(
self
):
db_session
=
get_db_session
()
db_session
=
get_db_session
()
q
=
db_session
.
query
(
Subjek
)
.
filter_by
(
q
=
db_session
.
query
(
Subjek
)
.
filter_by
(
id_wp_bphtb
=
self
.
invoice
.
id_pembeli_bphtb
)
id_wp_bphtb
=
self
.
invoice
.
id_wp_bphtb
)
return
q
.
first
()
def
get_objek
(
self
):
db_session
=
get_db_session
()
q
=
db_session
.
query
(
Objek
)
.
filter_by
(
thn_bphtb
=
self
.
invoice
.
thn_bphtb
,
bln_bphtb
=
self
.
invoice
.
bln_bphtb
,
tgl_bphtb
=
self
.
invoice
.
tgl_bphtb
,
no_urut_bphtb
=
self
.
invoice
.
no_urut_bphtb
)
return
q
.
first
()
return
q
.
first
()
def
get_nop
(
self
):
def
get_nop
(
self
):
...
@@ -146,18 +200,18 @@ class Inquiry(Common):
...
@@ -146,18 +200,18 @@ class Inquiry(Common):
def
get_kecamatan
(
self
):
def
get_kecamatan
(
self
):
db_session
=
get_db_session
()
db_session
=
get_db_session
()
q
=
db_session
.
query
(
Kecamatan
)
.
filter_by
(
q
=
db_session
.
query
(
Kecamatan
)
.
filter_by
(
kd_propinsi
=
self
.
objek
.
kd_propinsi
,
kd_propinsi
=
self
.
invoice
.
kd_propinsi
,
kd_dati2
=
self
.
objek
.
kd_dati2
,
kd_dati2
=
self
.
invoice
.
kd_dati2
,
kd_kecamatan
=
self
.
objek
.
kd_kecamatan_op
)
kd_kecamatan
=
self
.
invoice
.
kd_kecamatan_op
)
return
q
.
first
()
return
q
.
first
()
def
get_kelurahan
(
self
):
def
get_kelurahan
(
self
):
db_session
=
get_db_session
()
db_session
=
get_db_session
()
q
=
db_session
.
query
(
Kelurahan
)
.
filter_by
(
q
=
db_session
.
query
(
Kelurahan
)
.
filter_by
(
kd_propinsi
=
self
.
objek
.
kd_propinsi
,
kd_propinsi
=
self
.
invoice
.
kd_propinsi
,
kd_dati2
=
self
.
objek
.
kd_dati2
,
kd_dati2
=
self
.
invoice
.
kd_dati2
,
kd_kecamatan
=
self
.
objek
.
kd_kecamatan_op
,
kd_kecamatan
=
self
.
invoice
.
kd_kecamatan_op
,
kd_kelurahan
=
self
.
objek
.
kd_kelurahan_op
)
kd_kelurahan
=
self
.
invoice
.
kd_kelurahan_op
)
return
q
.
first
()
return
q
.
first
()
def
get_notaris
(
self
):
def
get_notaris
(
self
):
...
@@ -167,16 +221,40 @@ class Inquiry(Common):
...
@@ -167,16 +221,40 @@ class Inquiry(Common):
return
q
.
first
()
return
q
.
first
()
def
get_luas_tanah
(
self
):
def
get_luas_tanah
(
self
):
return
int
(
self
.
objek
.
luas_tanah
)
if
self
.
invoice_kb
:
return
int
(
self
.
verifikasi
.
luas_tanah
)
return
int
(
self
.
invoice
.
luas_bumi
)
def
get_luas_bangunan
(
self
):
def
get_luas_bangunan
(
self
):
return
int
(
self
.
objek
.
luas_bangunan
)
if
self
.
invoice_kb
:
return
int
(
self
.
verifikasi
.
luas_bangunan
)
return
int
(
self
.
invoice
.
luas_bng
)
def
get_njop
(
self
):
db_session
=
get_db_session
()
dts
=
self
.
get_invoice
(
TelitiSsb
)
if
not
dts
:
return
0
q
=
db_session
.
query
(
func
.
sum
(
TelitiSsbDetail
.
njop_total
))
q
=
q
.
filter_by
(
kd_propinsi
=
dts
.
kd_propinsi
,
kd_dati2
=
dts
.
kd_dati2
,
kd_dinas
=
dts
.
kd_dinas
,
kd_kppd
=
dts
.
kd_kppd
,
no_pendaftaran
=
dts
.
no_pendaftaran
)
return
q
.
scalar
()
or
0
def
get_npop
(
self
):
def
get_npop
(
self
):
return
self
.
invoice
.
npop
if
self
.
invoice_kb
:
n
=
self
.
verifikasi
.
npop
else
:
npop
=
self
.
invoice
.
hrg_transaksi
or
0
njop
=
self
.
get_njop
()
n
=
njop
>
npop
and
njop
or
npop
return
int
(
n
)
def
get_jenis_perolehan_hak
(
self
):
def
get_jenis_perolehan_hak
(
self
):
return
self
.
objek
.
kd_jns_hak
return
self
.
invoice
.
kd_jns_hak
def
get_nama_notaris
(
self
):
def
get_nama_notaris
(
self
):
if
self
.
notaris
:
if
self
.
notaris
:
...
@@ -192,7 +270,7 @@ class Inquiry(Common):
...
@@ -192,7 +270,7 @@ class Inquiry(Common):
return
self
.
subjek
.
jalan_wp
return
self
.
subjek
.
jalan_wp
def
get_alamat_op
(
self
):
def
get_alamat_op
(
self
):
return
self
.
objek
.
jalan_op
return
self
.
invoice
.
jalan_op
def
get_kota_op
(
self
):
def
get_kota_op
(
self
):
pass
pass
...
@@ -235,7 +313,10 @@ class Inquiry(Common):
...
@@ -235,7 +313,10 @@ class Inquiry(Common):
q
=
db_session
.
query
(
q
=
db_session
.
query
(
func
.
sum
(
Payment
.
bphtb_sdh_dibayar
)
.
func
.
sum
(
Payment
.
bphtb_sdh_dibayar
)
.
label
(
'total_bayar'
))
label
(
'total_bayar'
))
q
=
self
.
filter_invoice
(
q
)
if
self
.
invoice_kb
:
q
=
self
.
filter_payment_kb
(
q
)
else
:
q
=
self
.
filter_invoice
(
q
)
row
=
q
.
first
()
row
=
q
.
first
()
return
row
.
total_bayar
or
0
return
row
.
total_bayar
or
0
...
@@ -244,13 +325,17 @@ class Inquiry(Common):
...
@@ -244,13 +325,17 @@ class Inquiry(Common):
ntp_generator
=
NTP
()
ntp_generator
=
NTP
()
ntp
=
ntp_generator
.
create
()
ntp
=
ntp_generator
.
create
()
self
.
update_status
(
self
.
tgl_bayar
)
self
.
update_status
(
self
.
tgl_bayar
)
pay
=
Payment
(
if
self
.
invoice_kb
:
d
=
self
.
get_dict_kb
()
else
:
d
=
dict
(
thn_bphtb
=
self
.
invoice
.
thn_bphtb
,
bln_bphtb
=
self
.
invoice
.
bln_bphtb
,
tgl_bphtb
=
self
.
invoice
.
tgl_bphtb
,
no_urut_bphtb
=
self
.
invoice
.
no_urut_bphtb
)
d
.
update
(
dict
(
kd_propinsi
=
self
.
invoice
.
kd_propinsi
,
kd_propinsi
=
self
.
invoice
.
kd_propinsi
,
kd_dati2
=
self
.
invoice
.
kd_dati2
,
kd_dati2
=
self
.
invoice
.
kd_dati2
,
thn_bphtb
=
self
.
invoice
.
thn_bphtb
,
bln_bphtb
=
self
.
invoice
.
bln_bphtb
,
tgl_bphtb
=
self
.
invoice
.
tgl_bphtb
,
no_urut_bphtb
=
self
.
invoice
.
no_urut_bphtb
,
indeks_bphtb
=
self
.
invoice
.
indeks_bphtb
,
indeks_bphtb
=
self
.
invoice
.
indeks_bphtb
,
# kd_pejabat = Column(String(4))
# kd_pejabat = Column(String(4))
kd_bank_tunggal
=
self
.
conf
[
'kd_bank_tunggal'
],
kd_bank_tunggal
=
self
.
conf
[
'kd_bank_tunggal'
],
...
@@ -261,11 +346,11 @@ class Inquiry(Common):
...
@@ -261,11 +346,11 @@ class Inquiry(Common):
nama_wp
=
self
.
get_nama
(),
nama_wp
=
self
.
get_nama
(),
bphtb_kurang_bayar
=
0
,
bphtb_kurang_bayar
=
0
,
bphtb_sdh_dibayar
=
self
.
total
,
bphtb_sdh_dibayar
=
self
.
total
,
kd_kecamatan_op
=
self
.
objek
.
kd_kecamatan_op
,
kd_kecamatan_op
=
self
.
invoice
.
kd_kecamatan_op
,
kd_kelurahan_op
=
self
.
objek
.
kd_kelurahan_op
,
kd_kelurahan_op
=
self
.
invoice
.
kd_kelurahan_op
,
kd_blok_op
=
self
.
objek
.
kd_blok_op
,
kd_blok_op
=
self
.
invoice
.
kd_blok_op
,
no_urut_op
=
self
.
objek
.
no_urut_op
,
no_urut_op
=
self
.
invoice
.
no_urut_op
,
kd_jns_op
=
self
.
objek
.
kd_jns_op
,
kd_jns_op
=
self
.
invoice
.
kd_jns_op
,
user_bank_rekam
=
user_bank
,
user_bank_rekam
=
user_bank
,
nm_penyetor
=
'ISOUSER01'
,
nm_penyetor
=
'ISOUSER01'
,
kd_sumber_data
=
'4'
,
kd_sumber_data
=
'4'
,
...
@@ -273,8 +358,9 @@ class Inquiry(Common):
...
@@ -273,8 +358,9 @@ class Inquiry(Common):
# iso_message_id = Column(Float,
# iso_message_id = Column(Float,
# ForeignKey('iprotaxiso.iprotax_iso_msg_log.id_message_log'))
# ForeignKey('iprotaxiso.iprotax_iso_msg_log.id_message_log'))
# tgl_rekon_bayar = Column(DateTime)
# tgl_rekon_bayar = Column(DateTime)
# no_transaksi_byr = Column(String(20))
no_transaksi_byr
=
self
.
jenis_tagihan
,
tgl_rekam_byr
=
self
.
tgl_bayar
)
tgl_rekam_byr
=
self
.
tgl_bayar
))
pay
=
Payment
(
**
d
)
db_session
.
add
(
pay
)
db_session
.
add
(
pay
)
db_session
.
flush
()
db_session
.
flush
()
return
pay
return
pay
...
@@ -294,34 +380,58 @@ class Reversal(Common):
...
@@ -294,34 +380,58 @@ class Reversal(Common):
def
do_reversal
(
self
):
# Override
def
do_reversal
(
self
):
# Override
db_session
=
get_db_session
()
db_session
=
get_db_session
()
self
.
update_status
(
None
)
self
.
update_status
(
None
)
q
=
self
.
query_invoice
(
Payment
)
if
self
.
invoice_kb
:
q
=
db_session
.
query
(
Payment
)
q
=
self
.
filter_payment_kb
(
q
)
else
:
q
=
self
.
query_invoice
(
Payment
)
q
.
delete
()
q
.
delete
()
db_session
.
flush
()
db_session
.
flush
()
class
AvailableInvoice
(
BaseAvailableInvoice
):
class
AvailableInvoice
(
BaseAvailableInvoice
):
def
is_kb
(
self
):
return
self
.
option
.
skpdkb
or
self
.
option
.
skpdkb_tambahan
def
get_query
(
self
):
def
get_query
(
self
):
db_session
=
get_db_session
()
db_session
=
get_db_session
()
q
=
db_session
.
query
(
Invoice
)
.
filter
(
kb
=
self
.
is_kb
()
Invoice
.
thn_bphtb
==
Objek
.
thn_bphtb
,
if
kb
:
Invoice
.
bln_bphtb
==
Objek
.
bln_bphtb
,
orm
=
self
.
option
.
skpdkb
and
Skbkb
or
SkbkbT
Invoice
.
tgl_bphtb
==
Objek
.
tgl_bphtb
,
q
=
db_session
.
query
(
orm
)
.
filter
(
orm
.
status_pembayaran
==
'0'
)
Invoice
.
no_urut_bphtb
==
Objek
.
no_urut_bphtb
,
else
:
Invoice
.
tgl_bayar_ssb_wp
.
__eq__
(
None
))
orm
=
Invoice
q
=
db_session
.
query
(
Invoice
)
.
filter
(
orm
.
tgl_setor_ssp
.
__eq__
(
None
))
if
self
.
option
.
tahun
:
if
self
.
option
.
tahun
:
q
=
q
.
filter_by
(
thn_bphtb
=
self
.
option
.
tahun
)
if
kb
:
q
=
q
.
filter_by
(
thn_bphtb_terbit
=
self
.
option
.
tahun
)
else
:
q
=
q
.
filter_by
(
thn_bphtb
=
self
.
option
.
tahun
)
if
self
.
option
.
max_nominal
:
if
self
.
option
.
max_nominal
:
q
=
q
.
filter
(
Invoice
.
bphtb_hrs_dibayar
<=
self
.
option
.
max_nominal
)
if
kb
:
q
=
q
.
filter
(
orm
.
bphtb_krg_bayar
<=
self
.
option
.
max_nominal
)
else
:
q
=
q
.
filter
(
orm
.
bphtb_hrs_dibayar
<=
self
.
option
.
max_nominal
)
if
self
.
option
.
min_nominal
:
if
self
.
option
.
min_nominal
:
q
=
q
.
filter
(
Invoice
.
bphtb_hrs_dibayar
>=
self
.
option
.
min_nominal
)
if
kb
:
return
q
.
order_by
(
Invoice
.
tgl_rekam
.
desc
())
q
=
q
.
filter
(
orm
.
bphtb_krg_bayar
>=
self
.
option
.
min_nominal
)
else
:
q
=
q
.
filter
(
orm
.
bphtb_hrs_dibayar
>=
self
.
option
.
min_nominal
)
return
q
.
order_by
(
orm
.
tgl_rekam
.
desc
())
def
get_message
(
self
,
row
):
def
get_message
(
self
,
row
):
invoice_id_struct
=
FixLength
(
INVOICE_ID
)
invoice_id_struct
=
FixLength
(
INVOICE_ID
)
invoice_id_struct
[
'thn'
]
=
row
.
thn_bphtb
if
self
.
is_kb
():
invoice_id_struct
[
'bln'
]
=
row
.
bln_bphtb
invoice_id_struct
[
'thn'
]
=
row
.
thn_bphtb_terbit
invoice_id_struct
[
'tgl'
]
=
row
.
tgl_bphtb
invoice_id_struct
[
'bln'
]
=
row
.
bln_bphtb_terbit
invoice_id_struct
[
'no_urut'
]
=
row
.
no_urut_bphtb
invoice_id_struct
[
'tgl'
]
=
row
.
tgl_bphtb_terbit
invoice_id_struct
[
'no_urut'
]
=
row
.
no_urut_bphtb_terbit
else
:
invoice_id_struct
[
'thn'
]
=
row
.
thn_bphtb
invoice_id_struct
[
'bln'
]
=
row
.
bln_bphtb
invoice_id_struct
[
'tgl'
]
=
row
.
tgl_bphtb
invoice_id_struct
[
'no_urut'
]
=
row
.
no_urut_bphtb
invoice_id
=
invoice_id_struct
.
get_raw
()
invoice_id
=
invoice_id_struct
.
get_raw
()
inq
=
Inquiry
(
invoice_id
,
self
.
conf
)
inq
=
Inquiry
(
invoice_id
,
self
.
conf
)
if
inq
.
total
<
1
:
if
inq
.
total
<
1
:
...
...
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