Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
aa.gusti
/
opensipkd-tools
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 4bad55cd
authored
Mar 01, 2026
by
aa.gustiana@gmail.com
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
penambahan kembali nop_to_id
1 parent
3d2826b1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
38 deletions
opensipkd/tools/pbb.py
opensipkd/tools/pbb.py
View file @
4bad55c
...
...
@@ -106,7 +106,7 @@ class BaseFixLength(SetFixLength):
class
FixDati2
(
BaseFixLength
):
def
get_structure
(
self
):
return
DATI2
def
kd_dati2
(
self
):
return
self
[
"kd_propinsi"
]
+
'.'
+
self
[
'kd_dati2'
]
...
...
@@ -114,12 +114,15 @@ class FixDati2(BaseFixLength):
class
FixKecamatan
(
FixDati2
):
def
get_structure
(
self
):
return
KECAMATAN
def
kd_kecamatan
(
self
):
return
super
()
.
kd_dati2
+
'.'
+
self
[
'kd_kecamatan'
]
class
FixKelurahan
(
FixKecamatan
):
def
get_structure
(
self
):
return
KELURAHAN
def
kd_kelurahan
(
self
):
return
super
()
.
kd_kecamatan
+
'.'
+
self
[
'kd_kelurahan'
]
...
...
@@ -127,6 +130,7 @@ class FixKelurahan(FixKecamatan):
class
FixBlok
(
FixKelurahan
):
def
get_structure
(
self
):
return
BLOK
def
kd_blok
(
self
):
return
super
()
.
kd_kelurahan
+
'.'
+
self
[
'kd_blok'
]
...
...
@@ -134,6 +138,7 @@ class FixBlok(FixKelurahan):
class
FixKantor
(
BaseFixLength
):
def
get_structure
(
self
):
return
KANTOR
def
kd_kantor
(
self
):
return
self
[
'kd_kanwil'
]
+
'.'
+
self
[
'kd_kantor'
]
...
...
@@ -141,24 +146,26 @@ class FixKantor(BaseFixLength):
class
FixBank
(
FixKantor
):
def
get_structure
(
self
):
return
BANK
def
kd_bank
(
self
):
return
self
[
'kd_kanwil'
]
+
'.'
+
self
[
'kd_kantor'
]
+
'.'
+
self
[
'kd_tp'
]
class
FixBankSismiop
(
FixKantor
):
def
get_structure
(
self
):
return
BANK_SISMIOP
def
kd_bank
(
self
):
return
self
[
'kd_kanwil_bank'
]
+
'.'
+
self
[
'kd_kppbb_bank'
]
+
'.'
+
self
[
'kd_bank_tunggal'
]
+
'.'
+
self
[
'kd_bank_persepsi'
]
+
'.'
+
self
[
'kd_tp'
]
class
FixNop
(
FixBlok
):
def
get_structure
(
self
):
return
NOP
def
nop
(
self
):
return
"."
.
join
([
self
.
kd_blok
(),
self
[
"no_urut"
],
self
[
"kd_jns_op"
]])
def
get_formatted
(
self
):
s
=
''
for
name
,
size
,
typ
in
self
.
struct
:
...
...
@@ -176,6 +183,7 @@ class FixNop(FixBlok):
class
FixSppt
(
FixNop
):
def
get_structure
(
self
):
return
SPPT
def
sppt
(
self
):
return
self
.
nop
()
+
"."
+
self
[
'thn_pajak_sppt'
]
...
...
@@ -251,7 +259,7 @@ class FixBerkas(BaseFixLength):
def
get_nopel_det
(
self
):
return
get_value
(
self
,
NOPELDET
)
def
get_tahun_pajak
(
self
):
return
self
[
'thn_pajak_sppt'
]
...
...
@@ -319,39 +327,44 @@ def nop_formatted(row):
row
.
kd_kelurahan
,
row
.
kd_blok
,
row
.
no_urut
,
row
.
kd_jns_op
)
# def nop_to_id(row):
# if type(row) in (StringType, UnicodeType):
# row = FixNop(row)
# return "%s%s%s%s%s%s%s" % (row.kd_propinsi, row.kd_dati2, row.kd_kecamatan,
# row.kd_kelurahan, row.kd_blok, row.no_urut,
# row.kd_jns_op)
def
query_nop
(
table
):
#digunakan oleh e2apbb
return
func
.
concat
(
table
.
kd_propinsi
,
func
.
concat
(
'.'
,
func
.
concat
(
table
.
kd_dati2
,
func
.
concat
(
'-'
,
func
.
concat
(
table
.
kd_kecamatan
,
func
.
concat
(
'.'
,
func
.
concat
(
table
.
kd_kelurahan
,
func
.
concat
(
'-'
,
func
.
concat
(
table
.
kd_blok
,
func
.
concat
(
'.'
,
func
.
concat
(
table
.
no_urut
,
func
.
concat
(
'-'
,
table
.
kd_jns_op
))))))))))))
def
nop_to_id
(
row
):
if
type
(
row
)
==
str
:
row
=
FixNop
(
row
)
elif
type
(
row
)
!=
dict
:
row
=
dict
(
row
.
__dict__
)
row
.
pop
(
'_sa_instance_state'
,
None
)
return
"
%
s
%
s
%
s
%
s
%
s
%
s
%
s"
%
(
row
.
get
(
"kd_propinsi"
),
row
.
get
(
"kd_dati2"
),
row
.
get
(
"kd_kecamatan"
),
row
.
get
(
"kd_kelurahan"
),
row
.
get
(
"kd_blok"
),
row
.
get
(
"no_urut"
),
row
.
get
(
"kd_jns_op"
))
def
column_concat
(
*
args
):
cols
=
[]
for
arg
in
args
:
if
type
(
arg
)
==
list
:
# for a in arg:
cols
.
extend
(
arg
)
else
:
cols
.
append
(
arg
)
if
not
cols
:
return
''
elif
len
(
cols
)
==
1
:
return
cols
[
0
]
# saat ini menggunakan recursive spertinya ada syntax pythonic
# func.concat(cols[i], for col in cols)
# lambda_concat = lambda args: func.concat(x, y) for x, y in zip(args[:-1], args[1:])
return
func
.
concat
(
cols
[
0
],
column_concat
(
*
cols
[
1
:]))
# pylint: disable=not-callable
def
query_nop
(
table
):
# digunakan oleh e2apbb
return
column_concat
(
table
.
kd_propinsi
,
'.'
,
table
.
kd_dati2
,
'-'
,
table
.
kd_kecamatan
,
'.'
,
table
.
kd_kelurahan
,
'-'
,
table
.
kd_blok
,
'.'
,
table
.
no_urut
,
'-'
,
table
.
kd_jns_op
)
# JEnis REstitusi Kompensasi
...
...
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