models.py
5.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
from sqlalchemy import (
Column,
Integer,
BigInteger,
Float,
String,
Date,
Time,
DateTime,
UniqueConstraint,
)
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class Common:
def from_dict(self, values):
for column in self.__table__.columns:
if column.name in values:
setattr(self, column.name, values[column.name])
class Pad(Base, Common):
__tablename__ = 'pad_report'
id = Column(Integer, primary_key=True)
# Bit 11
stan = Column(String(6), nullable=False)
# Bit 48
ntb = Column(String(32), nullable=False)
# pad.pad_sspd.create_date
tgl = Column(Date, nullable=False)
# pad.pad_sspd.sspdjam
jam = Column(Time, nullable=False)
# pad.pad_sspd.id
sspd_id = Column(Integer, nullable=False)
# Bit 61
nomor_bayar = Column(String(16), nullable=False)
# pad.pad_pajak.masapajak
masa_pajak = Column(Integer, nullable=False)
# pad.pad_customer
npwpd = Column(String(17), nullable=False)
# pad.pad_customer.customernm
nama_wp = Column(String(150), nullable=False)
# pad.pad_sspd.jml_bayar - pad.pad_sspd.denda
pokok = Column(Float, nullable=False)
# pad.pad_sspd.denda
denda = Column(Float, nullable=False)
# pad.pad_sspd.jml_bayar
jml_bayar = Column(Float, nullable=False)
# Bit 18
channel_id = Column(String(4), nullable=False)
# Bit 41 / 42 / 43
channel_name = Column(String(32), nullable=False)
# pad_reversal.tgl
tgl_batal = Column(DateTime(timezone=True))
__table_args__ = (
UniqueConstraint('stan', 'ntb'),
)
class Bphtb(Base, Common):
__tablename__ = 'bphtb_report'
id = Column(Integer, primary_key=True)
# Bit 11
stan = Column(String(6), nullable=False)
# Bit 58
ntb = Column(String(32), nullable=False)
# bphtb.bphtb_bank.tanggal
tgl = Column(Date, nullable=False)
# bphtb.bphtb_bank.jam
jam = Column(Time, nullable=False)
# Bit 62
invoice_id = Column(String(16), nullable=False)
# Bit 61
nop = Column(String(22), nullable=False)
# bphtb.bphtb_bank.wp_nama
wp_nama = Column(String(50), nullable=False)
# bphtb.bphtb_bank.wp_alamat
wp_alamat = Column(String(100), nullable=False)
# bphtb.bphtb_sspd.op_alamat
op_alamat = Column(String(100), nullable=False)
# bphtb.bphtb_bank.npop
npop = Column(Float, nullable=False)
# bphtb.bphtb_bank.bumi_luas
bumi_luas = Column(Integer, nullable=False)
# bphtb.bphtb_bank.bng_luas
bng_luas = Column(Integer, nullable=False)
# Bit 4
nilai_bphtb = Column(Float, nullable=False)
# bphtb.bphtb_perolehan.nama
jenis_perolehan = Column(String(100), nullable=False)
# bphtb.bphtb_ppat.nama
ppat = Column(String(50), nullable=False)
# Bit 18
channel_id = Column(String(4), nullable=False)
# Bit 41 / 42 / 43
channel_nama = Column(String(32), nullable=False)
# bphtb.bphtb_reversal.tgl
tgl_batal = Column(DateTime(timezone=True))
__table_args__ = (
UniqueConstraint('stan', 'ntb'),
)
class Pbb(Base, Common):
__tablename__ = 'pbb_report'
id = Column(Integer, primary_key=True)
# Bit 11
stan = Column(String(6), nullable=False)
# Bit 48
ntb = Column(String(32), nullable=False)
# Bit 62 / Invoice ID
kd_propinsi = Column(String(2), nullable=False)
# Bit 62 / Invoice ID
kd_dati2 = Column(String(2), nullable=False)
# Bit 62 / Invoice ID
kd_kecamatan = Column(String(3), nullable=False)
# Bit 62 / Invoice ID
kd_kelurahan = Column(String(3), nullable=False)
# Bit 62 / Invoice ID
kd_blok = Column(String(3), nullable=False)
# Bit 62 / Invoice ID
no_urut = Column(String(4), nullable=False)
# Bit 62 / Invoice ID
kd_jns_op = Column(String(1), nullable=False)
# Bit 62 / Invoice ID
thn_pajak_sppt = Column(String(4), nullable=False)
# Field sppt.pbb_yg_harus_dibayar_sppt
pbb_yg_harus_dibayar_sppt = Column(Float, nullable=False)
# Field pembayaran_sppt.pembayaran_sppt_ke
pembayaran_sppt_ke = Column(Integer, nullable=False)
# Bit 4
jml_sppt_yg_dibayar = Column(BigInteger, nullable=False)
# Field pembayaran_sppt.denda_sppt
denda_sppt = Column(BigInteger, nullable=False)
# Field pembayaran_sppt.discount
discount = Column(BigInteger, nullable=False)
# Bit 7 / Transmission Date Inquiry
tgl_inquiry = Column(DateTime(timezone=True), nullable=False)
# Bit 7 / Transmission Date
tgl_pembayaran_sppt = Column(Date, nullable=False)
# Bit 7 / Transmission DateTime
tgl_rekam_byr_sppt = Column(DateTime(timezone=True), nullable=False)
# Bit 62 / Invoice Profile
nm_wp_sppt = Column(String(30), nullable=False)
# Bit 18
channel_kode = Column(String(4), nullable=False)
# Bit 41 / 42 / 43
channel_nama = Column(String(32), nullable=False)
# Bit 107
user_id = Column(String(16))
# Bit 32
bank_id = Column(String(4))
tgl_batal = Column(DateTime(timezone=True))
__table_args__ = dict(
UniqueConstraint('stan', 'ntb'),
)