-
Notifications
You must be signed in to change notification settings - Fork 0
/
balanceTable.html
1122 lines (1026 loc) · 38.3 KB
/
balanceTable.html
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
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#{extends 'main.html' /}
#{set title:messages.get('views.dailyaccount.balancetable') /}
%{
REMAINDER_TYPE_TOTAL = messages.get('RemainderType.total')
REMAINDER_TYPE_REAL = messages.get('RemainderType.real')
REMAINDER_TYPE_PARLLET = messages.get('RemainderType.parllet')
REMAINDER_TYPE_NOT_PARLLET = messages.get('RemainderType.not_parllet')
HANDLING_TYPE_CASH = messages.get('HandlingType.cash')
HANDLING_TYPE_BANK = messages.get('HandlingType.bank')
HANDLING_TYPE_EMONEY = messages.get('HandlingType.emoney')
HANDLING_TYPE_CRECA = messages.get('HandlingType.creca')
PRLT_TYPE_PRLT = messages.get('PrltType.prlt')
lngBtIdOut = models.BalanceTypeMst.find("byBalance_type_name", messages.get('BalanceType.out')).first().id
lngBtIdBankIn = models.BalanceTypeMst.find("byBalance_type_name", messages.get('BalanceType.bank_in')).first().id
lngBtIdPrltIn = models.BalanceTypeMst.find("byBalance_type_name", messages.get('BalanceType.parllet_in')).first().id
hU = models.HaUser.find("byEmail", session.username).first()
vBgSizeReal = 2
vBgSizePrlt = 2
intHdlgInvCnt=models.HandlingMst.count("ha_user = ? and handling_type_mst.handling_type_name != ? and invalidity_flg = true", hU, HANDLING_TYPE_CRECA)
intHdlgZeroExist=false
intStrokeWidth=0.5
}%
<style>
<!--
/* 共通のスタイル */
.bt-menu-trigger {
display: none;
}
body {
min-width: 0;
}
#hdContainer, #main, #btHeader, #ftContents {
width: 95%;
}
#hdContainer, #main, #btHeader, #ftContents {
max-width: 980px;
}
#mainInner {
overflow-x: auto;
}
/* スマホのスタイル */
.memberMenu {
display: none;
}
#btHeader {
display: block;
}
#prltMain {
padding-top: 75px;
}
/* タブレットのスタイル */
@media all and (min-width: 480px) {
}
/* PCのスタイル */
@media all and (min-width: 768px) {
.memberMenu {
display: block;
}
#btHeader {
display: none;
}
#prltMain {
padding-top: 45px;
}
}
-->
</style>
<script type="text/javascript">
<!--
var bolDlgFrmUpdMstInsBkem,
bolDlgFrmUpdMstInsPrlt,
bolDlgFrmUpdMstUpdBkem,
bolDlgFrmUpdMstUpdPrlt,
bolDlgFrmUpdRecInsBkem,
strTypeName,
lngUpdId,
strItemNm,
intLwdaRealSize = ${lWDA_R.size},
intLwdaRealSizeDsp = 0,
intLwdaPrltSize = ${lWDA_P.size},
intLwdaPrltSizeDsp = 0,
intDivBtStkdHt,
intDivBtStkdHtReal, //真ん中部分の罫線を除いた高さの合計(実残高)
intDivBtStkdHtPrlt, //真ん中部分の罫線を除いた高さの合計(Parllet残高)
aryLwdar = [],
aryLwdap = [],
intDivBtStkdRealSumAmnt = 0,
intDivBtStkdPrltSumAmnt = 0,
intBgSizeReal = ${vBgSizeReal},
intBgSizePrlt = ${vBgSizePrlt},
intMinHt; // 真ん中部分の最低高さ(=左右端部分のセルの高さ)
/* lWDA系格納用クラス */
function ClsLwda (
strItem,
lngAmount,
strTypeNm,
bolInvFlg,
IntHt,
lngId
) {
this.strItem = strItem;
this.lngAmount = lngAmount;
this.strTypeNm = strTypeNm;
this.bolInvFlg = bolInvFlg;
this.IntHt = IntHt;
this.lngId = lngId;
}
jQuery(function() {
%{vCnt = 0}%
#{list items:lWDA_R, as:'lwdar'}
var clsLwda = new ClsLwda(
"${lwdar.sItem}",
${lwdar.lstWdtd[0].lAmount},
"${lwdar.strTypeNm}",
${lwdar.bolInvFlg},
0,
"${lwdar.lstWdtd[0].lHandlingId}");
aryLwdar[${vCnt}] = clsLwda;
intDivBtStkdRealSumAmnt += Math.abs(${lwdar.lstWdtd[0].lAmount});
%{vCnt++}%
#{if lwdar.sItem!=HANDLING_TYPE_CASH && lwdar.lstWdtd[0].lAmount==0}
%{intHdlgZeroExist = true}%
#{/if}
#{/list}
%{vCnt = 0}%
#{list items:lWDA_P, as:'lwdap'}
var clsLwda = new ClsLwda(
"${lwdap.sItem}",
${lwdap.lstWdtd[0].lAmount},
"${lwdap.strTypeNm}",
${lwdap.bolInvFlg},
0,
"${lwdap.lstWdtd[0].lParlletId}");
aryLwdap[${vCnt}] = clsLwda;
intDivBtStkdPrltSumAmnt += Math.abs(${lwdap.lstWdtd[0].lAmount})
%{vCnt++}%
#{/list}
/* table-cell内の文字列が入りきらない場合の調整 */
// var btCateSmallMaxWidth = parseInt(jQuery('.bt_cate_small').css('max-width').replace("px", "")),
var btCateSmallWidth = ${play.configuration.getProperty('btCateSmall_Width')},
vYear, vMonth, vSelected;
jQuery('.bt_cate_small').width(btCateSmallWidth);
jQuery('.bt_cate_small').each(function() {
var jTh = jQuery(this),
strTh = jTh.text(),
strThOrg = jTh.text(),
strThEllipse;
if (jTh.width()>btCateSmallWidth) {
strTh = strTh.slice(0, strTh.length-1);
while(jTh.width()>btCateSmallWidth) {
strTh = strTh.slice(0, strTh.length-1);
strThEllipse = strTh+"...";
jTh.text(strThEllipse);
}
jTh.append("<span>"+strThOrg+"</span>");
}
});
jQuery('.bt_cate_small span').each(function() {
jQuery(this)
.css('top', jQuery(this).parent().position().top+10)
.css('left', jQuery(this).parent().position().left+10);
});
/* 年コンボボックスのリスト作成 */
%{year = sBasisDate.substring(0,4)}%
vYear = Number("${year}"), vSelected;
for(i=1900; i<3000; i++) {
vSelected = "";
if (vYear===i) vSelected = " selected";
jQuery('#idYear').append("<option value='"+i+"'"+vSelected+">"+i+"</option>");
}
/* 月コンボボックスのリスト作成 */
vMonth = Number("${month}");
for(i=1; i<=12; i++) {
vSelected = "";
if (vMonth===i) vSelected = " selected";
jQuery('#idMonth').append("<option value='"+i+"'"+vSelected+">"+i+"</option>");
}
/* 年月コンボボックス選択変更時はjumpイベントへ */
jQuery('#idYear, #idMonth').change(function() {
jQuery('#idBasisDate').val(jQuery('#idYear').val()+"/"+("0"+jQuery('#idMonth').val()).slice(-2)+"/${sBasisDate.substring(8,10)}");
jQuery('#idMove').click();
jQuery('body').attr("disabled", "disabled");
});
/* 日付移動リンクEnter時はクリックイベントへ */
jQuery('#idPreMonth, #idNextMonth').keypress(function(e) {
if (e.which===13) {
e.preventDefault();
jQuery(this).click();
}
});
/* 日付移動リンククリック時はjumpイベントへ */
jQuery('#idPreMonth, #idNextMonth').click(function() {
//移動種別
jQuery('#idMoveType').val("&{'views.dailyaccount.movetype.month'}");
//移動数
if (this.id==="idPreMonth")
jQuery('#idMoveNum').val('-1');
if (this.id==="idNextMonth")
jQuery('#idMoveNum').val('1');
jQuery('#idMove').click();
jQuery('body').attr("disabled", "disabled");
});
// /* 表示金額を3桁区切りに */
// jQuery('.num3').each(function(i) {
// var numStr = addFigure(jQuery(this).html());
// jQuery(this).html(numStr);
// });
/* 日付選択時にjumpするdatepicker */
jQuery(".datepickerJump").datepicker({
changeMonth: true,
numberOfMonths: 1,
showOtherMonths: true,
selectOtherMonths: true,
showAnim: "drop",
changeMonth: true,
changeYear: true,
yearRange: '1900:2999',
dateFormat: 'yy/mm/dd',
onSelect: function( e_basis_date ) {
// var str_tmp = new String(e_basis_date).replace(/\//g, "");
// var int_basis_date = Number(str_tmp);
jQuery('#idBasisDate').val(e_basis_date);
jQuery('#idMove').click();
jQuery('body').attr("disabled", "disabled");
},
showOn: "button",
buttonImage: "@{'/public/images/calendar_shu.gif'}",
buttonImageOnly: true,
buttonText: "カレンダー",
showButtonPanel: true
});
/* 左クリックか右クリックでメニュー表示 */
jQuery('.menu_cell').mousedown(function(e) {
if (e.which===1 || e.which===3) {
jQuery('#hHandlingId').val('');
jQuery('#idDlRpHdParlletId').val('');
bolDlgFrmUpdMstInsBkem = false;
bolDlgFrmUpdMstInsPrlt = false;
bolDlgFrmUpdMstUpdBkem = false;
bolDlgFrmUpdMstUpdPrlt = false;
bolDlgFrmUpdRecInsBkem = false;
lngUpdId = null;
strItemNm = "";
%{vStrItemNm = ''}%
if (jQuery(this).attr('data-idx')!==undefined) { // ヘッダーセルではない
var intIdx = jQuery(this).attr('data-idx');
if (jQuery(this).parents("#divBtTblRealFlm").size() > 0 ||
jQuery(this).parents("#divBtStkdReal").size() > 0) { // 左半分(実残高)のセルである
var clsLwdar = aryLwdar[intIdx];
if (!jQuery(this).parent("li").hasClass('remBkemInv'))
bolDlgFrmUpdRecInsBkem = true;
jqLwdaSItem = jQuery(this).hasClass('lwdaSItem') ? jQuery(this) : jQuery(this).prev('.lwdaSItem');
if (jqLwdaSItem.children('span').size())
jqLwdaSItem = jqLwdaSItem.children('span');
strItemNm = jQuery.trim(jqLwdaSItem.text());
strTypeName = clsLwdar.strTypeNm;
lngUpdId = clsLwdar.lngId;
if (jQuery(this).parent("li").children('.strTypeName').val()!=="${HANDLING_TYPE_CASH}") {
bolDlgFrmUpdMstUpdBkem = true;
//残高明細(口座系)へジャンプする際の絞込項目セット
jQuery('#hDebitDateFr').val(jQuery('.ToDlDebitDateFr', jQuery(this).parent("li")).val());
jQuery('#hDebitDateTo').val(jQuery('.ToDlDebitDateTo', jQuery(this).parent("li")).val());
jQuery('#hHandlingId').val(jQuery('.lHandlingId', jQuery(this).parent("li")).val());
}
}
if (jQuery(this).parents("#divBtTblPrltFlm").size() > 0 ||
jQuery(this).parents("#divBtStkdPrlt").size() > 0) { // 右半分(Parllet残高)のセルである
var clsLwdap = aryLwdap[intIdx];
bolDlgFrmUpdMstUpdPrlt = true;
jqLwdaSItem = jQuery(this).hasClass('lwdaSItem') ? jQuery(this) : jQuery(this).prev('.lwdaSItem');
if (jqLwdaSItem.children('span').size())
jqLwdaSItem = jqLwdaSItem.children('span');
strItemNm = jQuery.trim(jqLwdaSItem.text());
lngUpdId = clsLwdap.lngId;
//残高明細(Parllet)へジャンプする際の絞込項目セット
jQuery('#idDlRpHdDebitDateFr').val(jQuery('.ToDlDebitDateFr', jQuery(this).parent("li")).val());
jQuery('#idDlRpHdDebitDateTo').val(jQuery('.ToDlDebitDateTo', jQuery(this).parent("li")).val());
jQuery('#idDlRpHdParlletId').val(jQuery('.lParlletId', jQuery(this).parent("li")).val());
}
} else { // ヘッダーセルである
if (jQuery(this).parents("#divBtTblRealFlm").size() > 0 ||
jQuery(this).parents("#divBtStkdReal").size() > 0)
bolDlgFrmUpdMstInsBkem = true;
if (jQuery(this).parents("#divBtTblPrltFlm").size() > 0 ||
jQuery(this).parents("#divBtStkdPrlt").size() > 0)
bolDlgFrmUpdMstInsPrlt = true;
}
e.preventDefault();
jQuery('.menu_cell').contextMenu({x: e.pageX, y: e.pageY});
jQuery('.context-menu-list').width(jQuery('.context-menu-list').width()*1.1);
}
});
jQuery.contextMenu({
selector: '.menu_cell',
trigger: 'none',
build: function($trigger, e) {
var options = {
callback: function(key, options) {
if (key==="dialogFrmInsRecBank") {
var dfurFvPayDate = new DfurFlgVal(false, "${sBasisDate}", false),
dfurFvBType = new DfurFlgVal(true, strTypeName==="${HANDLING_TYPE_CASH}" ? ${lngBtIdOut} : ${lngBtIdBankIn}, true),
dfurFvHdlg = new DfurFlgVal(false, lngUpdId, false),
dfurFvPrlt = new DfurFlgVal(false, 0, true),
dfurFvItem = new DfurFlgVal(false, 0, true),
dfurFvAmnt = new DfurFlgVal(true, "", true),
dfurFvDebDate = new DfurFlgVal(false, "${sBasisDate}", false),
dfurFvCntnt = new DfurFlgVal(false, "", true),
dfurFvStore = new DfurFlgVal(false, "", true),
dfurFvRmrks = new DfurFlgVal(false, "", true),
dfurRec = new DfurRec(
null,
dfurFvPayDate,
dfurFvBType,
dfurFvHdlg,
dfurFvPrlt,
dfurFvItem,
dfurFvAmnt,
dfurFvDebDate,
dfurFvCntnt,
dfurFvStore,
dfurFvRmrks);
//家計簿入力フォームを開く
openDialogFrmUpdRec(dfurRec);
}
if (key==="dialogFrmInsRecPrlt") {
var dfurFvPayDate = new DfurFlgVal(false, "${sBasisDate}", false),
dfurFvBType = new DfurFlgVal(true, ${lngBtIdPrltIn}, true),
dfurFvHdlg = new DfurFlgVal(false, 0, true),
dfurFvPrlt = new DfurFlgVal(false, lngUpdId, false),
dfurFvItem = new DfurFlgVal(false, 0, true),
dfurFvAmnt = new DfurFlgVal(true, "", true),
dfurFvDebDate = new DfurFlgVal(false, "${sBasisDate}", false),
dfurFvCntnt = new DfurFlgVal(false, "", true),
dfurFvStore = new DfurFlgVal(false, "", true),
dfurFvRmrks = new DfurFlgVal(false, "", true),
dfurRec = new DfurRec(
null,
dfurFvPayDate,
dfurFvBType,
dfurFvHdlg,
dfurFvPrlt,
dfurFvItem,
dfurFvAmnt,
dfurFvDebDate,
dfurFvCntnt,
dfurFvStore,
dfurFvRmrks);
//家計簿入力フォームを開く
openDialogFrmUpdRec(dfurRec);
}
if (key==="dialogFrmUpdMstInsBank" || key==="dialogFrmUpdMstUpdBank")
//口座更新フォームを開く
openDialogFrmUpdMstBt("${HANDLING_TYPE_BANK}", lngUpdId);
if (key==="dialogFrmUpdMstInsEmoney" || key==="dialogFrmUpdMstUpdEmoney")
//電子マネー更新フォームを開く
openDialogFrmUpdMstBt("${HANDLING_TYPE_EMONEY}", lngUpdId);
if (key==="dialogFrmUpdMstInsPrlt" || key==="dialogFrmUpdMstUpdPrlt")
//Parllet更新フォームを開く
openDialogFrmUpdMstBt("${PRLT_TYPE_PRLT}", lngUpdId);
if (key==="toDlRemainderBank") {
jQuery('#submitDlRemainderBank').click();
jQuery('body').attr("disabled", "disabled");
}
if (key==="toDlRemainderPrlt") {
jQuery('#submitDlRemainderPrlt').click();
jQuery('body').attr("disabled", "disabled");
}
},
items: {}
};
if (bolDlgFrmUpdMstInsBkem) {
options.items.dialogFrmUpdMstInsBank = {name: "&{'views.contextMenu.add', HANDLING_TYPE_BANK}"};
options.items.dialogFrmUpdMstInsEmoney = {name: "&{'views.contextMenu.add', HANDLING_TYPE_EMONEY}"};
}
if (bolDlgFrmUpdMstInsPrlt)
options.items.dialogFrmUpdMstInsPrlt = {name: "&{'views.contextMenu.add', PRLT_TYPE_PRLT}"};
if (bolDlgFrmUpdRecInsBkem)
options.items.dialogFrmInsRecBank = {name: strItemNm+"&{'views.contextMenu.insRec'}"};
if (bolDlgFrmUpdMstUpdBkem) {
if (strTypeName==="${HANDLING_TYPE_BANK}")
options.items.dialogFrmUpdMstUpdBank = {name: "&{'views.contextMenu.upd', HANDLING_TYPE_BANK}"};
if (strTypeName==="${HANDLING_TYPE_EMONEY}")
options.items.dialogFrmUpdMstUpdEmoney = {name: "&{'views.contextMenu.upd', HANDLING_TYPE_EMONEY}"};
}
if (bolDlgFrmUpdMstUpdPrlt) {
options.items.dialogFrmInsRecPrlt = {name: strItemNm+"&{'views.contextMenu.insRec'}"};
options.items.dialogFrmUpdMstUpdPrlt = {name: "&{'views.contextMenu.upd', PRLT_TYPE_PRLT}"};
}
if (jQuery('#hHandlingId').val()!=='')
options.items.toDlRemainderBank = {name: "&{'views.common.menu.toDlRemainderBank'}"};
if (jQuery('#idDlRpHdParlletId').val()!=='')
options.items.toDlRemainderPrlt = {name: "&{'views.common.menu.toDlRemainderPrlt'}"};
return options;
}
});
function openDialogFrmUpdMstBt(strMst, lngUpdId) {
openDialogFrmUpdMst(strMst, "&{'views.name.balanceTable'}", lngUpdId)
}
/* チェックで隠すもの */
jQuery('#zeroHddnBkem, #zeroHddnPrlt, #invHddnBkem').click(function() {
var strErrMsg = "Common.updateHaUserFlg",
jqxhr,
jqThisChkd = jQuery(this).is(':checked'),
strClm,
jqChgInvisible,
strInvisible;
if (this.id==="zeroHddnBkem") {
strClm = "zero_hidden_bkem";
jqChgInvisible = jQuery('.remBkemZero');
strInvisible = "invisible";
}
if (this.id==="zeroHddnPrlt") {
strClm = "zero_hidden_prlt";
jqChgInvisible = jQuery('.remPrltZero');
strInvisible = "invisible";
}
if (this.id==="invHddnBkem") {
strClm = "inv_hidden_bkem";
jqChgInvisible = jQuery('.remBkemInv');
strInvisible = "invisible2";
}
jqxhr = jQuery.post('@{Common.updateHaUserFlg}', {strHuClm: strClm, bolFlg: jqThisChkd});
jqxhr
.done(function(z) {
switch (z.intRslt) {
case 0:
if (jqThisChkd) {
jqChgInvisible.addClass(strInvisible);
} else {
jqChgInvisible.removeClass(strInvisible);
}
// divBtStkdRealEach , divBtStkdPrltEach の表示
dspBtStkd();
// svgReal , svgPrlt の再表示
dspSvgReal(z.hU.zero_hidden_bkem, z.hU.inv_hidden_bkem);
dspSvgPrlt(z.hU.zero_hidden_prlt);
break;
case 99:
alert(z.strErr);
break;
default:
strErrMsg += " result Error";
alert(strErrMsg);
}
})
.fail(function() {
strErrMsg += " Failed";
alert(strErrMsg);
});
});
// divBtStkdRealEach , divBtStkdPrltEach の表示
dspBtStkd();
// svgReal , svgPrlt の初期表示
dspSvgReal(${hU?.zero_hidden_bkem}, ${hU?.inv_hidden_bkem});
dspSvgPrlt(${hU?.zero_hidden_prlt});
});
/* divBtStkdRealEach , divBtStkdPrltEach の表示処理 */
function dspBtStkd() {
var jqHt,
jqHtReal = jQuery('#divBtTblRealFlm .bt_tbl_each').height()-jQuery('#divBtTblRealFlm .bt_tbl_each li:first-child').height(),
jqHtPrlt = jQuery('#divBtTblPrltFlm .bt_tbl_each').height()-jQuery('#divBtTblPrltFlm .bt_tbl_each li:first-child').height();
jqHt = jqHtReal > jqHtPrlt ? jqHtReal : jqHtPrlt;
intDivBtStkdHt = jqHt*2*100;
intLwdaRealSizeDsp = 0;
for (i=0; i < intLwdaRealSize; i++) {
if (!((jQuery('.remBkemZero').hasClass('invisible') && aryLwdar[i].lngAmount===0) ||
(jQuery('.remBkemInv').hasClass('invisible2') && aryLwdar[i].bolInvFlg))) {
intLwdaRealSizeDsp++;
}
}
intLwdaPrltSizeDsp = 0;
for (i=0; i < intLwdaPrltSize; i++) {
if (!(jQuery('.remPrltZero').hasClass('invisible') && aryLwdap[i].lngAmount===0)) {
intLwdaPrltSizeDsp++;
}
}
// セルの(ボーダーの高さ+最低高さ(=左右端部分のセルの高さ))×セル数を予め引いておく
intMinHt = jQuery('.bt_tbl_each li div').height(); // 真ん中部分の最低高さ(=左右端部分のセルの高さ)
intDivBtStkdHtReal = intDivBtStkdHt-intLwdaRealSizeDsp*(1+intMinHt)*100;
intDivBtStkdHtPrlt = intDivBtStkdHt-intLwdaPrltSizeDsp*(1+intMinHt)*100;
dspDivBtStkdRealEach();
dspDivBtStkdPrltEach();
}
/* divBtStkdRealEach の表示処理 */
function dspDivBtStkdRealEach() {
var aryIntHt = [],
intSumHt = 0,
intMaxHt = 0,
intMaxHtIdx = 0,
anyHtExistFlg = false,
intBgCnt = 0;
for (i=0; i < intLwdaRealSize; i++) {
var intHt = intDivBtStkdRealSumAmnt===0 ? intDivBtStkdHtReal / intLwdaRealSizeDsp
: Math.abs(aryLwdar[i].lngAmount) / intDivBtStkdRealSumAmnt*intDivBtStkdHtReal,
strHt = intHt.toFixed(0);
intHt = parseInt(strHt);
if (intHt!==0) anyHtExistFlg = true;
if (intMaxHt < intHt) {
intMaxHt = intHt;
intMaxHtIdx = i;
}
aryIntHt[i] = intHt;
if (!((jQuery('.remBkemZero').hasClass('invisible') && aryLwdar[i].lngAmount===0) ||
(jQuery('.remBkemInv').hasClass('invisible2') && aryLwdar[i].bolInvFlg))) {
aryIntHt[i] += intMinHt*100; //真ん中部分の最低高さ(=左右端部分のセルの高さ)をここで足す
jQuery("#divBtStkdRealEach_"+i).css('border-bottom', '1px solid #aaa');
} else {
jQuery("#divBtStkdRealEach_"+i).css('border-bottom', '0');
}
intSumHt += intHt;
if (aryLwdar[i].lngAmount < 0) {
jQuery("#divBtStkdRealEach_"+i).css('background', jQuery('.btBgMinus').css('background-color'));
} else {
if (aryLwdar[i].bolInvFlg) {
jQuery("#divBtStkdRealEach_"+i).css('background', jQuery(".remBkemInv").children('.lrb_Line').css('background-color'));
} else {
if (intBgCnt===intBgSizeReal)
intBgCnt = 0;
jQuery("#divBtStkdRealEach_"+i).css('background', jQuery(".btBgReal"+intBgCnt).css('background-color'));
intBgCnt++;
}
}
jQuery("#divBtStkdRealEach_"+i).height(aryIntHt[i] / 100);
jQuery("#divBtStkdRealEach_"+i).children('div').height(aryIntHt[i] / 100);
}
// 誤差を最大幅のセルに寄せる
if (anyHtExistFlg) {
aryIntHt[intMaxHtIdx] += intDivBtStkdHtReal-intSumHt;
jQuery("#divBtStkdRealEach_"+intMaxHtIdx).height(aryIntHt[intMaxHtIdx] / 100);
jQuery("#divBtStkdRealEach_"+intMaxHtIdx).children('div').height(aryIntHt[intMaxHtIdx] / 100);
}
}
/* divBtStkdPrltEach の表示処理 */
function dspDivBtStkdPrltEach() {
var aryIntHt = [],
intSumHt = 0,
intMaxHt = 0,
intMaxHtIdx = 0,
anyHtExistFlg = false,
intBgCnt = 0;
for (i=0; i < intLwdaPrltSize; i++) {
var intHt = intDivBtStkdPrltSumAmnt===0 ? intDivBtStkdHtPrlt / intLwdaPrltSizeDsp
: Math.abs(aryLwdap[i].lngAmount) / intDivBtStkdPrltSumAmnt*intDivBtStkdHtPrlt,
strHt = intHt.toFixed(0);
intHt = parseInt(strHt);
if (intHt!==0) anyHtExistFlg = true;
if (intMaxHt < intHt) {
intMaxHt = intHt;
intMaxHtIdx = i;
}
aryIntHt[i] = intHt;
if (!(jQuery('.remPrltZero').hasClass('invisible') && aryLwdap[i].lngAmount===0)) {
aryIntHt[i] += intMinHt*100; //真ん中部分の最低高さ(=左右端部分のセルの高さ)をここで足す
jQuery("#divBtStkdPrltEach_"+i).css('border-bottom', '1px solid #aaa');
} else {
jQuery("#divBtStkdPrltEach_"+i).css('border-bottom', '0');
}
intSumHt += intHt;
if (aryLwdap[i].lngAmount < 0) {
jQuery("#divBtStkdPrltEach_"+i).css('background', jQuery('.btBgMinus').css('background-color'));
} else {
if (aryLwdap[i].strItem==="&{'RemainderType.not_parllet'}") {
jQuery("#divBtStkdPrltEach_"+i).css('background', jQuery('.btMainInner').css('background-color'));
} else {
if (intBgCnt===intBgSizePrlt)
intBgCnt = 0;
jQuery("#divBtStkdPrltEach_"+i).css('background', jQuery(".btBgPrlt"+intBgCnt).css('background-color'));
intBgCnt++;
}
}
jQuery("#divBtStkdPrltEach_"+i).height(aryIntHt[i] / 100);
jQuery("#divBtStkdPrltEach_"+i).children('div').height(aryIntHt[i] / 100);
}
// 誤差を最大幅のセルに寄せる
if (anyHtExistFlg) {
aryIntHt[intMaxHtIdx] += intDivBtStkdHtPrlt-intSumHt;
jQuery("#divBtStkdPrltEach_"+intMaxHtIdx).height(aryIntHt[intMaxHtIdx] / 100);
jQuery("#divBtStkdPrltEach_"+intMaxHtIdx).children('div').height(aryIntHt[intMaxHtIdx] / 100);
}
}
/* svgRealの(再)表示処理 */
function dspSvgReal(bolZeroHddnBkem, bolInvHddnBkem) {
var btTblEachHt = jQuery('#divBtTblReal_0').position().top-jQuery('#divBtTblReal_ttl').position().top,
yTop1 = jQuery('#divBtTblReal_0').position().top-jQuery('#divBtTblRealFlm').position().top-1,
yBtm1 = yTop1,
yTop2,
yBtm2,
strPoints,
svgRealWid = jQuery('#svgReal').width(),
intBgCnt = 0;
jQuery('#divBtSvgReal').height(jQuery('#bt_tbl_flm').height());
for (i=0; i < intLwdaRealSize; i++) {
var obj = document.getElementById("plgnReal_"+i);
yBtm1 = jQuery("#divBtTblReal_"+i).position().top-jQuery('#divBtTblRealFlm').position().top+btTblEachHt-1;
if ((bolZeroHddnBkem && jQuery('<b></b>').addClass(jQuery("#plgnReal_"+i).attr('class')).hasClass('remBkemZero')) ||
(bolInvHddnBkem && jQuery('<b></b>').addClass(jQuery("#plgnReal_"+i).attr('class')).hasClass('remBkemInv'))) {
yBtm1 = yTop1;
}
yTop2 = jQuery("#divBtStkdRealEach_"+i).position().top-${intStrokeWidth};
if (i==intLwdaRealSize-1) {
yBtm2 = jQuery("#divBtStkdRealEach_"+i).position().top+jQuery("#divBtStkdRealEach_"+i).height()+${intStrokeWidth};
} else {
var j = i+1;
yBtm2 = jQuery("#divBtStkdRealEach_"+j).position().top-${intStrokeWidth};
}
strPoints = "0,"+yTop1+" 0,"+yBtm1+" "+svgRealWid+","+yBtm2+" "+svgRealWid+","+yTop2;
obj.setAttribute("points",strPoints);
yTop1 = yBtm1;
if (aryLwdar[i].lngAmount < 0) {
obj.setAttribute("fill", jQuery('.btBgMinus').css('background-color'));
} else {
if (aryLwdar[i].bolInvFlg) {
obj.setAttribute("fill", jQuery('.remBkemInv').children('.lrb_Line').css('background-color'));
} else {
if (intBgCnt===intBgSizeReal)
intBgCnt = 0;
obj.setAttribute("fill", jQuery(".btBgReal"+intBgCnt).css('background-color'));
intBgCnt++;
}
}
}
}
/* svgPrltの(再)表示処理 */
function dspSvgPrlt(bolZeroHddnPrlt) {
var btTblEachHt = jQuery('#divBtTblPrlt_0').position().top-jQuery('#divBtTblPrlt_ttl').position().top,
btStkdPrltTtlHt = jQuery('#divBtStkdPrlt').children('.title').height(),
yTop1 = jQuery('#divBtTblPrlt_0').position().top-jQuery('#divBtTblPrltFlm').position().top-btStkdPrltTtlHt-1,
yBtm1 = yTop1,
yTop2,
yBtm2,
strPoints,
svgPrltWid = jQuery('#svgPrlt').width(),
intBgCnt = 0;
jQuery('#divBtSvgPrlt').height(jQuery('#bt_tbl_flm').height()-btStkdPrltTtlHt);
for (i=0; i < intLwdaPrltSize; i++) {
var obj = document.getElementById("plgnPrlt_"+i);
yBtm1 = jQuery("#divBtTblPrlt_"+i).position().top-jQuery('#divBtTblPrltFlm').position().top+btTblEachHt-btStkdPrltTtlHt-1;
if (bolZeroHddnPrlt && jQuery('<b></b>').addClass(jQuery("#plgnPrlt_"+i).attr('class')).hasClass('remPrltZero')) {
yBtm1 = yTop1;
}
yTop2 = jQuery("#divBtStkdPrltEach_"+i).position().top-btStkdPrltTtlHt-${intStrokeWidth};
// yBtm2 = jQuery("#divBtStkdPrltEach_"+i).position().top-btStkdPrltTtlHt+jQuery("#divBtStkdPrltEach_"+i).height();
if (i==intLwdaPrltSize-1) {
yBtm2 = jQuery("#divBtStkdPrltEach_"+i).position().top-btStkdPrltTtlHt+jQuery("#divBtStkdPrltEach_"+i).height()+${intStrokeWidth};
} else {
var j = i+1;
yBtm2 = jQuery("#divBtStkdPrltEach_"+j).position().top-btStkdPrltTtlHt-${intStrokeWidth};
}
strPoints = svgPrltWid+","+yTop1+" "+svgPrltWid+","+yBtm1+" 0,"+yBtm2+" 0,"+yTop2;
obj.setAttribute("points",strPoints);
yTop1 = yBtm1;
if (aryLwdap[i].lngAmount < 0) {
obj.setAttribute("fill", jQuery('.btBgMinus').css('background-color'));
} else {
if (aryLwdap[i].strItem==="&{'RemainderType.not_parllet'}") {
obj.setAttribute("fill", jQuery('.btMainInner').css('background-color'));
} else {
if (intBgCnt===intBgSizePrlt)
intBgCnt = 0;
obj.setAttribute("fill", jQuery(".btBgPrlt"+intBgCnt).css('background-color'));
intBgCnt++;
}
}
}
}
/* 文字列を3桁区切りにする関数 */
function addFigure(str) {
var num = new String(str).replace(/,|\n| |\t/g, "");
// while(num !== (num = num.replace(/^(-?\d+)(\d{3})/, "$1,$2")));
num = num.replace(/(\d)(?=(\d{3})+$)/g , '$1,');
return num;
}
// -->
</script>
<script type="text/javascript" src="@{'/public/javascripts/jquery.contextMenu.js'}"></script>
<link rel="stylesheet" type="text/css" href="@{'/public/stylesheets/jquery.contextMenu.css'}" />
<link media="only screen and (max-device-width:480px)" href="@{'/public/stylesheets/smart.jquery.contextMenu.css'}" type="text/css" rel="stylesheet" />
<link media="screen and (min-device-width:481px)" href="@{'/public/stylesheets/jquery.contextMenu.css'}" type="text/css" rel="stylesheet" />
<!--[if IE]>
<link href="@{'/public/stylesheets/jquery.contextMenu.css'}" type="text/css" rel="stylesheet" />
<![endif]-->
<script type="text/javascript">
<!--
/* dialogFrmUpdMstを閉じた時の動作は呼び出し元で行う */
function whenDialogFrmUpdMstClosedBt(intRslt, strType, nameVal, zeroHddnChkd, invFlgChkd, lngId) {
var strErrMsg;
if (lngId===null) lngId=undefined;
if (strType==="${HANDLING_TYPE_BANK}" || strType==="${HANDLING_TYPE_EMONEY}")
strErrMsg = "Common.updateHdlg";
if (strType==="${PRLT_TYPE_PRLT}")
strErrMsg = "Common.updatePrlt";
switch (intRslt) {
case 0:
break;
case 1:
var jqxhrUpdMst;
if (strType==="${HANDLING_TYPE_BANK}" || strType==="${HANDLING_TYPE_EMONEY}") {
jqxhrUpdMst = jQuery.post('@{Common.updateHdlg}', {strHdlgType: strType, strName: nameVal, bolZeroHddn: zeroHddnChkd, bolInvFlg: invFlgChkd, lngHdlgId: lngId});
}
if (strType==="${PRLT_TYPE_PRLT}") {
jqxhrUpdMst = jQuery.post('@{Common.updatePrlt}', {strName: nameVal, bolZeroHddn: zeroHddnChkd, lngPrltId: lngId});
}
jqxhrUpdMst
.done(function(z) {
switch (z.intRslt) {
case 0:
if (strType==="${HANDLING_TYPE_BANK}" ||
strType==="${HANDLING_TYPE_EMONEY}" ||
strType==="${PRLT_TYPE_PRLT}") {
//画面を再表示
window.location.reload(true);
}
break;
case 99:
alert(z.strErr);
break;
default:
strErrMsg += " result Error";
alert(strErrMsg);
}
})
.fail(function() {
strErrMsg += " Failed";
alert(strErrMsg);
});
break;
default:
alert("dialogFrmUpdMst return value error");
}
}
// -->
</script>
#{set 'moreMenu'}
#{include 'headerMenu.html' /}
#{/set}
#{set 'headerTools'}
#{include 'headerTools.html' /}
#{/set}
<!-- 残高明細(口座系)へジャンプ用フォーム(非表示) -->
#{form @DetailList.dl_remainderBank(), class:'invisible'}
<input type="text" name="h_secret_rec_flg" id="hSecretRecFlg" value="0" />
<input type="text" name="h_debit_date_fr" id="hDebitDateFr" />
<input type="text" name="h_debit_date_to" id="hDebitDateTo" />
<input type="text" name="h_handling_id" id="hHandlingId" />
<input type="submit" name="srch" id="submitDlRemainderBank" />
#{/form}
<!-- 残高明細(Parllet)へジャンプ用フォーム(非表示) -->
#{form @DetailList.dl_remainderPrlt(), class:'invisible'}
<input type="text" name="dlRpHdSecretRecFlg" id="idDlRpHdSecretRecFlg" value="0" />
<input type="text" name="dlRpHdDebitDateFr" id="idDlRpHdDebitDateFr" />
<input type="text" name="dlRpHdDebitDateTo" id="idDlRpHdDebitDateTo" />
<input type="text" name="dlRpHdParlletId" id="idDlRpHdParlletId" />
<input type="submit" name="dlRpSrch" id="submitDlRemainderPrlt" />
#{/form}
#{ifErrors}
<p class="crudFlash flashError">
#{errors}
${error}
#{/errors}
</p>
#{/ifErrors}
<!-- 日付移動用フォーム(非表示) -->
#{form @jump(), id:'frmJump', class:'invisible'}
<input type="hidden" value="${strTableType}" name="strTableType" />
<!-- 移動種別 -->
<input type="text" name="strMoveType" id="idMoveType" />
<!-- 移動数 -->
<input type="text" name="intMoveNum" id="idMoveNum" />
<input type="text" name="e_basis_date" id="idBasisDate"
value="${sBasisDate}" />
<input type="submit" name="move" id="idMove" />
#{/form}
<!--
<div id="btChart"></div>
-->
<div id="btHeader">
<ul class="tbMemberMenu">
<li>
<a href="#" id="aLarge_cate">&{'views.dailyaccount.balancetable'}</a>
</li>
</ul>
</div> <!-- btHeader -->
<div id="mainInner">
<div class="btMainInner">
<div id="btBasisDate">
<a id="idPreMonth" class="aBtn fontJura" tabindex="0"><<span>&{'views.dailyaccount.movetype.month.pre'}</span></a>
<span id="daPaddingYearMonth">
<select id="idYear">
</select>
&{'year'}
<select id="idMonth">
</select>
&{'month'}
<span>
${sBasisDate.substring(8,10)}
</span>
&{'views.common.day'}
<div class="inlineVerticalMiddle">
<input type="text" class="datepickerJump invisible dpClImg"
value="${sBasisDate}" />
</div>
</span>
<a id="idNextMonth" class="aBtn fontJura" tabindex="0">><span>&{'views.dailyaccount.movetype.month.next'}</span></a>
</div>
<div id="btRemTotal">
<ul>
<li class="${vRemBkemZero} ${vInvisible} ${vRemBkemInv} ${vInvisible2}">
<div class="t_Line lrb_Line">
${REMAINDER_TYPE_TOTAL}
</div>
<div class="t_Line lrb_Line padR4 numeric">
${lngSumAmnt.format('###,###')}
</div>
</li>
</ul>
</div>
<div id="bt_tbl_flm">
<div id="divBtTblRealFlm">
<div>
<div class="btHddnChkBox">
#{if intHdlgZeroExist}
<input type="checkbox" id="zeroHddnBkem" ${hU?.zero_hidden_bkem ? 'checked' : ''} />&{'views.balancetable.lbl.zero_hidden'}
#{/if}
#{if intHdlgInvCnt!=0}
<input type="checkbox" id="invHddnBkem" ${hU?.inv_hidden_bkem ? 'checked' : ''} />&{'views.balancetable.lbl.invalid_hidden'}
#{/if}
</div>
</div>
<ul class="bt_tbl_each">
<li>
<input type="hidden" class="bolRemReal" value="${REMAINDER_TYPE_REAL}" />
<div class="t_Line lrb_Line bt_cate_large menu_cell">
${REMAINDER_TYPE_REAL}
</div>
<div class="t_Line lrb_Line da_ary_day numeric menu_cell" id="divBtTblReal_ttl">
<span class="padR4">${lngSumAmnt.format('###,###')}</span>
</div>
</li>
%{
vCnt = 0
vBgCnt = 0
}%
#{list items:lWDA_R, as:'lwdar'}
%{
wdtd = lwdar.lstWdtd[0]
vRemBkemZero = (lwdar.sItem!=HANDLING_TYPE_CASH && wdtd.lAmount==0) ? 'remBkemZero' : ''
vInvisible = (hU?.zero_hidden_bkem && wdtd.lAmount==0) ? 'invisible' : ''
vRemBkemInv = (lwdar.sItem!=HANDLING_TYPE_CASH && lwdar.bolInvFlg) ? 'remBkemInv' : ''
vInvisible2 = (hU?.inv_hidden_bkem && lwdar.bolInvFlg) ? 'invisible2' : ''
vMenuCell = lwdar.sItem==HANDLING_TYPE_CASH ? '' : 'menu_cell'
vBtBgReal = ''
}%
#{if lwdar.lstWdtd[0].lAmount < 0}
%{vBtBgReal = 'btBgMinus'}%
#{/if}
#{else}
#{if !lwdar.bolInvFlg}
#{if vBgCnt==vBgSizeReal}
%{vBgCnt = 0}%
#{/if}
%{
vBtBgReal = 'btBgReal'+vBgCnt
vBgCnt++
}%
#{/if}
#{/else}
<li class="${vRemBkemZero} ${vInvisible} ${vRemBkemInv} ${vInvisible2}">
<input type="hidden" class="lHandlingId" value="${wdtd.lHandlingId}" />
<input type="hidden" class="strTypeName" value="${lwdar.strTypeNm}" />
<input type="hidden" class="ToDlDebitDateFr" value="${wdtd?.sDebitDateFr}" />
<input type="hidden" class="ToDlDebitDateTo" value="${wdtd?.sDebitDateTo}" />
<!--
<input type="hidden" class="ToDlHandlingId" value="${wdtd?.lHandlingId}" />
-->
<div class="bt_cate_small_pre"></div>
<div class="lrb_Line bt_cate_small menu_cell lwdaSItem ${vBtBgReal}" data-idx="${vCnt}">
${lwdar.sItem}
</div>
<div class="lrb_Line bt_ary_day numeric menu_cell ${vBtBgReal}" id="divBtTblReal_${vCnt}" data-idx="${vCnt}">
<span class="padR4">${wdtd.lAmount.format('###,###')}</span>
</div>
</li>
%{vCnt++}%
#{/list}
</ul>
</div> <!-- divBtTblRealFlm -->
<div id="divBtSvgReal">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svgReal" width="50">
%{vCnt=0}%
#{list items:lWDA_R, as:'lwdar'}
%{
wdtd = lwdar.lstWdtd[0]
vRemBkemZero = (lwdar.sItem!=HANDLING_TYPE_CASH && wdtd.lAmount==0) ? 'remBkemZero' : ''
vRemBkemInv = (lwdar.sItem!=HANDLING_TYPE_CASH && lwdar.bolInvFlg) ? 'remBkemInv' : ''
}%
<polygon points="0,0" stroke="#aaa" stroke-width="${intStrokeWidth}" id="plgnReal_${vCnt}" class="${vRemBkemZero} ${vRemBkemInv}">
</polygon>
%{vCnt++}%
#{/list}
</svg>
</div> <!-- divBtSvgReal -->
<div id="divBtStkdReal">
<div class="title child menu_cell">
${REMAINDER_TYPE_REAL}
</div>
<div class="child">
%{vCnt=0}%
#{list items:lWDA_R, as:'lwdar'}
<div id="divBtStkdRealEach_${vCnt}" class="menu_cell" data-idx="${vCnt}">
<div>
${lwdar.sItem}