list_sejarah.pt
15.9 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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
<html metal:use-macro="load: ./base.pt">
<div metal:fill-slot="content">
<tal metal:use-macro="load:list_include.pt"/>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">${request.title}</h3>
</div>
<div class="panel-body">
<form method="post" accept-charset="utf-8" id="myform" class="form-horizontal">
<div class="alert alert-danger" tal:condition="form and form.error and True or False">
<div class="error-msg-lbl">Kesalahan Pengisian Form</div>
<p class="error-msg">${form.errormsg}</p>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<div id="item-nop" style="display:block;">
<label for="nop" class="control-label col-md-4 required} " id="req-nop">NOP</label>
<div class="col-md-7">
<div class="input-group">
<input name="nop" value="${nop}" id="nop" class=" form-control " type="text"/>
<span class="input-group-btn">
<button class="btn btn-default" type="submit">Cari</button>
</span>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group" tal:define="f form['nm_wp']">
<div id="item-${f.oid}" style="${f.widget.hidden and 'display:none;' or 'display:block;'}">
<label for="${f.oid}" class="control-label col-md-2 ${f.required and 'required' or ''}" id="req-${f.oid}">
${f.title}</label>
<div class="col-md-7">
${structure:f.serialize()}
<p id="error-${f.oid}" class="help-block" tal:condition="f.error"
tal:repeat="error f.error.messages()">
${error}</p>
</div>
</div>
</div>
<div class="form-group" tal:define="f form['subjek_pajak_id']">
<div id="item-${f.oid}" style="${f.widget.hidden and 'display:none;' or 'display:block;'}">
<label for="${f.oid}" class="control-label col-md-2 ${f.required and 'required' or ''}" id="req-${f.oid}">
${f.title}</label>
<div class="col-md-7">
${structure:f.serialize()}
<p id="error-${f.oid}" class="help-block" tal:condition="f.error"
tal:repeat="error f.error.messages()">
${error}</p>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group" tal:define="f form['jalan_op']">
<div id="item-${f.oid}" style="${f.widget.hidden and 'display:none;' or 'display:block;'}">
<label for="${f.oid}" class="control-label col-md-4 ${f.required and 'required' or ''}" id="req-${f.oid}">
${f.title}</label>
<div class="col-md-7">
${structure:f.serialize()}
<p id="error-${f.oid}" class="help-block" tal:condition="f.error"
tal:repeat="error f.error.messages()">
${error}</p>
</div>
</div>
</div>
<div class="form-group" tal:define="f form['blok_kav_no']">
<div id="item-${f.oid}" style="${f.widget.hidden and 'display:none;' or 'display:block;'}">
<label for="${f.oid}" class="control-label col-md-4 ${f.required and 'required' or ''}" id="req-${f.oid}">
${f.title}</label>
<div class="col-md-7">
${structure:f.serialize()}
<p id="error-${f.oid}" class="help-block" tal:condition="f.error"
tal:repeat="error f.error.messages()">
${error}</p>
</div>
</div>
</div>
<div class="form-group" tal:define="f form['kelurahan']">
<div id="item-${f.oid}" style="${f.widget.hidden and 'display:none;' or 'display:block;'}">
<label for="${f.oid}" class="control-label col-md-4 ${f.required and 'required' or ''}" id="req-${f.oid}">
${f.title}</label>
<div class="col-md-7">
${structure:f.serialize()}
<p id="error-${f.oid}" class="help-block" tal:condition="f.error"
tal:repeat="error f.error.messages()">
${error}</p>
</div>
</div>
</div>
<div class="form-group" tal:define="f form['kecamatan']">
<div id="item-${f.oid}" style="${f.widget.hidden and 'display:none;' or 'display:block;'}">
<label for="${f.oid}" class="control-label col-md-4 ${f.required and 'required' or ''}" id="req-${f.oid}">
${f.title}</label>
<div class="col-md-7">
${structure:f.serialize()}
<p id="error-${f.oid}" class="help-block" tal:condition="f.error"
tal:repeat="error f.error.messages()">
${error}</p>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group" tal:define="f form['jalan_wp']">
<div id="item-${f.oid}" style="${f.widget.hidden and 'display:none;' or 'display:block;'}">
<label for="${f.oid}" class="control-label col-md-2 ${f.required and 'required' or ''}" id="req-${f.oid}">
${f.title}</label>
<div class="col-md-7">
${structure:f.serialize()}
<p id="error-${f.oid}" class="help-block" tal:condition="f.error"
tal:repeat="error f.error.messages()">
${error}</p>
</div>
</div>
</div>
<div class="form-group" tal:define="f form['blok_kav_nowp']">
<div id="item-${f.oid}" style="${f.widget.hidden and 'display:none;' or 'display:block;'}">
<label for="${f.oid}" class="control-label col-md-2 ${f.required and 'required' or ''}" id="req-${f.oid}">
${f.title}</label>
<div class="col-md-7">
${structure:f.serialize()}
<p id="error-${f.oid}" class="help-block" tal:condition="f.error"
tal:repeat="error f.error.messages()">
${error}</p>
</div>
</div>
</div>
<div class="form-group" tal:define="f form['kelurahan_wp']">
<div id="item-${f.oid}" style="${f.widget.hidden and 'display:none;' or 'display:block;'}">
<label for="${f.oid}" class="control-label col-md-2 ${f.required and 'required' or ''}" id="req-${f.oid}">
${f.title}</label>
<div class="col-md-7">
${structure:f.serialize()}
<p id="error-${f.oid}" class="help-block" tal:condition="f.error"
tal:repeat="error f.error.messages()">
${error}</p>
</div>
</div>
</div>
<div class="form-group" tal:define="f form['kota_wp']">
<div id="item-${f.oid}" style="${f.widget.hidden and 'display:none;' or 'display:block;'}">
<label for="${f.oid}" class="control-label col-md-2 ${f.required and 'required' or ''}" id="req-${f.oid}">
${f.title}</label>
<div class="col-md-7">
${structure:f.serialize()}
<p id="error-${f.oid}" class="help-block" tal:condition="f.error"
tal:repeat="error f.error.messages()">
${error}</p>
</div>
</div>
</div>
</div>
</div>
<!-- <hr/> -->
<!-- <div class="form-group"> -->
<!-- <div class="col-md-4 col-md-offset-2"> -->
<!-- <button type="submit" class="btn btn-primary" id="simpan" name="simpan">Simpan</button> -->
<!-- <button type="submit" class="btn btn-warning" id="batal" name="batal">Tutup</button> -->
<!-- </div> -->
<!-- </div> -->
</form>
</div>
</div>
<div class="jarviswidget jarviswidget-color-blueLight"> <!-- jarviswidget -->
<header role="heading">
<h2>
<i class="fa fa-fw fa-table"></i>
Rincian SPPT
</h2>
</header>
<div role="content">
<div class="widget-body"><!-- widget-body -->
<div class="dataTables_wrapper form-inline no-footer">
<table id="table1" class="table table-bordered table-hover table-condensed">
<thead>
<tr>
<th>Tahun</th>
<th>Nama</th>
<th>Alamat</th>
<th>Jatuh Tempo</th>
<th>Ketetapan</th>
<th>Bayar</th>
<th>Denda</th>
<th>Total</th>
<th>Tgl. Bayar</th>
<th>Piutang</th>
</tr>
</thead>
<tbody></tbody>
<tfoot>
<tr>
<th> </th>
<th>Total</th>
<th> </th>
<th> </th>
<th> </th>
<th> </th>
<th> </th>
<th> </th>
<th> </th>
<th> </th>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
</div>
<div metal:fill-slot="scripts">
<script>
var oTableUrl = "${home}/pbbm/sejarah";
var oTableUri = oTableUrl + "/grid/act";
var oTable;
function formatNumber(toFormat) {
return toFormat.toString().replace(
/\B(?=(\d{3})+(?!\d))/g, "."
);
};
$(document).ready(function () {
oTable = $('#table1').DataTable({
ajax: oTableUri + '?nop=${nop}',
dom: '<"row"<"col-md-6"<"toolbar">Bl><"col-md-6"fr>>tip',
processing: true,
serverSide: true,
searching: false,
stateSave: true,
scrollCollapse: true,
sort: true,
info: false,
filter: true,
autoWidth: false,
paginate: true,
paginationType: "full_numbers",
lengthMenu: [
[10, 25, 50, 100],
[10, 25, 50, 100]
],
"language": {
"search": "Cari: ",
"paginate": {
"first": "Awal ",
"last": "Akhir ",
"previous": false,
"next": false,
},
"lengthMenu": " _MENU_ baris "
},
columns: [
{data: "tahun", "class": "text-center"},
{data: "nama"},
{data: "alamat"},
{data: "tgl_jatuhtempo", "class": "text-center"},
{data: "pokok", "class": "text-right", render: $.fn.dataTable.render.number(',', '.', 0, '')},
{data: "bayar", "class": "text-right", render: $.fn.dataTable.render.number(',', '.', 0, '')},
{data: "denda", "class": "text-right", render: $.fn.dataTable.render.number(',', '.', 0, '')},
{
data: null, "class": "text-right",
render: function (data, type, row) {
return formatNumber(parseInt(data["bayar"]) +
parseInt(data["denda"]))
}
},
{data: "tgl_bayar", "class": "text-center"},
{data: "piutang", "class": "text-right", render: $.fn.dataTable.render.number(',', '.', 0, '')},
],
"footerCallback": function (row, data, start, end, display) {
var api = this.api(), data;
// Remove the formatting to get integer data for summation
var intVal = function (i) {
return typeof i === 'string' ?
i.replace(/[\$,]/g, '') * 1 :
typeof i === 'number' ?
i : 0;
};
// Total column pajak
var totalPajak = api
.column(4, {page: 'current'})
.data()
.reduce(function (a, b) {
return intVal(a) + intVal(b);
}, 0);
// Total column bayar
var totalBayar = api
.column(5, {page: 'current'})
.data()
.reduce(function (a, b) {
return intVal(a) + intVal(b);
}, 0);
// Total column denda
var totalDenda = api
.column(6, {page: 'current'})
.data()
.reduce(function (a, b) {
return intVal(a) + intVal(b);
}, 0);
// total colum sisa
var total = totalBayar + totalDenda;
// Total column piutang
var totalPiutang = api
.column(9, {page: 'current'})
.data()
.reduce(function (a, b) {
return intVal(a) + intVal(b);
}, 0);
// Update baris total
$(api.column(4).footer()).html(formatNumber(totalPajak));
$(api.column(5).footer()).html(formatNumber(totalBayar));
$(api.column(6).footer()).html(formatNumber(totalDenda));
$(api.column(7).footer()).html(formatNumber(total));
$(api.column(9).footer()).html(formatNumber(totalPiutang));
}
});
var tb_array = [
'<div class="btn-group pull-left">',
// ' <button id="btn_add" class="btn btn btn-success" type="button"><i class="fa fa-fw fa-plus"></i> Tambah</button>',
// ' <button id="btn_edit" class="btn btn btn-warning" type="button"><i class="fa fa-fw fa-edit"></i> Edit</button>',
// ' <button id="btn_delete" class="btn btn btn-danger" type="button"><i class="fa fa-fw fa-trash-o"></i> Hapus</button>',
// ' <button id="btn_pdf" class="btn btn btn-primary" type="button"><i class="fa fa-fw fa-file"></i> PDF</button>',
//' <button id="btn_close" class="btn btn btn-warning" type="button"><i class="fa fa-fw fa-undo"></i> Tutup</button>',
' ',
'</div>',
];
var tb = tb_array.join(' ');
$("div.toolbar").html(tb);
$("div.toolbar").attr('style', 'display:block; float: left; margin-bottom:6px; line-height:16px;');
$('#table1 tbody').on('click', 'tr', function () {
if ($(this).hasClass('selected')) {
$(this).removeClass('selected');
} else {
var aData = oTable.row(this).data();
oTable.$('tr.selected').removeClass('selected');
$(this).addClass('selected');
mID = aData.id;
console.log(mID);
oTable.$('tr.row_selected').removeClass('row_selected');
$(this).addClass('row_selected');
/*oTable2.fnReloadAjax("egaji/grid2?id=" + mID);*/
}
});
// $('#btn_add').click(function () {
// window.location = oTableUri+'/add';
// });
// $('#btn_edit').click(function () {
// if (mID) window.location = oTableUri+'/'+mID+'/edt';
// else alert('Pilih Baris yang akan di edit');
// });
// $('#btn_delete').click(function () {
// if (mID) window.location = oTableUri+'/'+mID+'/del';
// else alert('Pilih Baris yang akan di hapus');
// });
// $('#btn_csv').click(function () {
// url = oTableUri+"/csv/rpt";
// window.open(url);
// });
// $('#btn_pdf').click(function () {
// url = oTableUri+"/pdf/rpt";
// window.open(url);
// });
$("#btn_close").click(function () {
window.location = '${home}/pbbm';
return false;
});
});
</script>
</div>
</html>