3 * @link https://datagram.co.jp/source/bksj for the canonical source repository
4 * @copyright Copyright (c) 2006-2019 Datagram Ltd. (https://datagram.co.jp)
5 * @license https://datagram.co.jp/source/bksj/license.txt
10 $basic = $ctrl->basic;
12 $section = $ctrl->section;
13 $settled = $ctrl->settled;
14 $begin = $ctrl->begin;
16 $cnd = $ctrl->dat['cnd'];
17 $list = $ctrl->dat['list'];
18 $limit = $ctrl->dat['limit'];
20 <script type="text/javascript">
48 gotoNext: function(func) {
56 if (this.chk_slip == 'NG') {
57 alert("入力伝票の最大明細数: " + this.max_slip);
60 this.func.val('UserJournal');
61 this.act.val('create');
70 if (!confirm("伝票番号[" + dno + "] を削除しますか?")) {
79 'func': 'UserJournal',
86 eval("this.ans = " + data);
89 this.ans = {"sts": "NG", "err": "ajax error"};
92 if (this.ans.sts == 'NG') {
97 this.gotoNext('UserJournal', 'remember');
103 this.func.val('UserJournal');
104 this.act.val('edit');
110 duplicate: function(id) {
111 if (this.chk_slip == 'NG') {
112 alert("入力伝票の最大明細数: " + this.max_slip);
115 this.func.val('UserJournal');
116 this.act.val('duplicate');
122 move: function(dlt) {
124 var curr = this.v_page_curr.val() * 1;
125 var last = this.v_page_last.val() * 1;
129 case -9: next = 1; break;
130 case 9: next = last; break;
131 default: next = curr + dlt; break;
142 this.v_page_curr.val(next);
150 if (this.v_page_curr.val() < 1) {
151 this.v_page_curr.val(1);
154 this.func.val('UserJournal');
155 this.act.val('search');
156 this.cnd_scd.val(this.v_cnd_scd.val());
157 this.cnd_begin.val(this.v_cnd_begin.val());
158 this.cnd_end.val(this.v_cnd_end.val());
159 this.cnd_denpyo.val(this.v_cnd_denpyo.val());
160 this.cnd_kcd.val(this.v_cnd_kcd.val());
161 this.cnd_remark.val(this.v_cnd_remark.val());
162 this.cnd_stflg.val(this.v_cnd_stflg.val());
163 this.cnd_nuflg.val(this.v_cnd_nuflg.val());
165 this.page_curr.val(this.v_page_curr.val());
171 this.v_cnd_scd.val('-1');
172 this.v_cnd_begin.val('<?= $begin ?>');
173 this.v_cnd_end.val('<?= $end ?>');
174 this.v_cnd_denpyo.val('');
175 this.v_cnd_kcd.val('-1');
176 this.v_cnd_remark.val('');
177 this.v_cnd_stflg.val('-2');
178 this.v_cnd_nuflg.val('-1');
179 this.v_page_curr.val(1);
184 this.chk_slip = '<?= $limit['chk_slip'] ?>';
185 this.max_slip = '<?= $limit['max_slip'] ?>';
186 this.next = $('#next');
187 this.func = $('#func');
188 this.act = $('#act');
190 this.cnd_scd = $('#cnd_scd');
191 this.cnd_begin = $('#cnd_begin');
192 this.cnd_end = $('#cnd_end');
193 this.cnd_denpyo = $('#cnd_denpyo');
194 this.cnd_kcd = $('#cnd_kcd');
195 this.cnd_remark = $('#cnd_remark');
196 this.cnd_stflg = $('#cnd_stflg');
197 this.cnd_nuflg = $('#cnd_nuflg');
198 this.page_curr = $('#page_curr');
199 this.v_cnd_scd = $('#v_cnd_scd');
200 this.v_cnd_begin = $('#v_cnd_begin');
201 this.v_cnd_end = $('#v_cnd_end');
202 this.v_cnd_denpyo = $('#v_cnd_denpyo');
203 this.v_cnd_kcd = $('#v_cnd_kcd');
204 this.v_cnd_remark = $('#v_cnd_remark');
205 this.v_cnd_stflg = $('#v_cnd_stflg');
206 this.v_cnd_nuflg = $('#v_cnd_nuflg');
207 this.v_page_curr = $('#v_page_curr');
208 this.v_page_last = $('#v_page_last');
210 this.v_cnd_begin.datepicker();
211 this.v_cnd_end.datepicker();
212 this.v_cnd_begin.val('<?= $cnd['cnd_begin'] ?>');
213 this.v_cnd_end.val('<?= $cnd['cnd_end'] ?>');
223 <form method="post" name="next" id="next" action="<?= $base ?>">
224 <input type="hidden" name="func" id="func">
225 <input type="hidden" name="act" id="act">
226 <input type="hidden" name="cnd_scd" id="cnd_scd">
227 <input type="hidden" name="cnd_begin" id="cnd_begin">
228 <input type="hidden" name="cnd_end" id="cnd_end">
229 <input type="hidden" name="cnd_denpyo" id="cnd_denpyo">
230 <input type="hidden" name="cnd_kcd" id="cnd_kcd">
231 <input type="hidden" name="cnd_remark" id="cnd_remark">
232 <input type="hidden" name="cnd_stflg" id="cnd_stflg">
233 <input type="hidden" name="cnd_nuflg" id="cnd_nuflg">
234 <input type="hidden" name="page_curr" id="page_curr">
235 <input type="hidden" name="id" id="id">
236 <input type="hidden" name="bid" id="bid" value="<?= $bid ?>">
239 <table id="my_header" width="100%">
242 <a onclick="return my.gotoNext('UserMenu');">メニュー</a>
245 <td style="text-align: right;">
246 <button type="button" class="my_magenta" style="width: 120px;" onclick="return my.gotoNext('Login');">ログアウト</button>
250 <td colspan="2" style="text-align: center;">
251 <?= $view->strBasic($basic) ?>
256 <div style="height: 5px;"> </div>
261 <table class="my_table" width="100%">
263 <th class="my_border">仕訳帳</th>
267 <div style="height: 1px;"> </div><hr>
269 <table class="my_table" width="100%">
271 <th colspan="11" class="my_border">絞込み検索</th>
274 <td class="my_border" style="text-align: center; width: 110px;" rowspan="2">
275 <table class="my_table" cellpadding="0" cellspacing="2">
278 <button type="button" class="my_cyan" style="width: 100px;" onclick="return my.search();">検索</button>
283 <button type="button" class="my_magenta" style="width: 100px;" onclick="return my.reset();">検索リセット</button>
288 <th class="my_border">部門</th>
289 <td class="my_border">
290 <select id="v_cnd_scd">
292 $s = ($cnd['cnd_scd'] < 0) ? ' selected' : '';
294 <option value="-1"<?= $s ?>> </option>
296 foreach ($section as $key => $dat) {
297 $k = $view->str($key);
298 $d = $view->str($dat);
299 $s = ($cnd['cnd_scd'] == $k) ? ' selected' : '';
301 <option value="<?= $k ?>"<?= $s ?>><?= $d ?></option>
307 <th class="my_border" style="width: 100px;">期間</th>
308 <td class="my_border" colspan="3">
309 <input id="v_cnd_begin" type="text">
311 <input id="v_cnd_end" type="text">
313 <th class="my_border" style="width: 100px;">伝票番号</th>
314 <td class="my_border">
315 <input id="v_cnd_denpyo" type="text" value="<?= $view->str($cnd['cnd_denpyo']) ?>">
319 <th class="my_border">科目</th>
320 <td class="my_border">
321 <select id="v_cnd_kcd">
323 $s = ($cnd['cnd_kcd'] < 0) ? ' selected' : '';
325 <option value="-1"<?= $s ?>> </option>
328 foreach ($kcd as $key => $dat) {
329 $k = $view->str($key);
330 $d = $view->str($dat['name']);
331 $s = ($cnd['cnd_kcd'] == $k) ? ' selected' : '';
332 $p = mb_substr($dat['kana'], 0, 1);
337 echo '<optgroup label="' . $p . '">';
341 <option value="<?= $k ?>"<?= $s ?>><?= $d ?></option>
350 <th class="my_border">摘要</th>
351 <td class="my_border">
352 <input id="v_cnd_remark" type="text" value="<?= $view->str($cnd['cnd_remark']) ?>">
354 <th class="my_border">通常/決算</th>
355 <td class="my_border">
356 <select id="v_cnd_stflg">
358 $s = ($cnd['cnd_stflg'] < 0) ? ' selected' : '';
360 <option value="-2"<?= $s ?>> </option>
362 foreach ($settled as $k => $d) {
363 $s = ($k == $cnd['cnd_stflg']) ? ' selected' : '';
364 echo '<option value="' . $view->str($k) . '"' . $s . '>' . $view->str($d) . '</option>';
369 <th class="my_border">使用/不使用</th>
370 <td class="my_border">
371 <select id="v_cnd_nuflg">
373 $nu = ['-1' => '', '0' => '使用伝票', '1' => '不使用伝票'];
374 foreach ($nu as $k => $d) {
375 $s = ($k == $cnd['cnd_nuflg']) ? ' selected' : '';
376 echo '<option value="' . $view->str($k) . '"' . $s . '>' . $view->str($d) . '</option>';
384 <div style="height: 1px;"> </div><hr>
386 <table class="my_table" width="100%">
388 <td class="my_border" id="my_create">
389 <button type="button" class="my_cyan" style="width: 150px;" onclick="return my.create();">新規伝票作成</button>
394 <div style="height: 2px;"> </div>
398 <td style="text-align: left; width: 20%;">全件数:<?= $list['cnt'] ?>[件]</td>
400 if ($list['cnt'] < 1) {
402 <td style="visibility: hidden;">
406 <td style="text-align: center;">
410 <button type="button" class="my_blue" style="width: 40px;" onclick="return my.move(-9);">|<</button>
411 <button type="button" class="my_blue" style="width: 40px;" onclick="return my.move(-1);"><</button>
412 <input id="v_page_last" type="hidden" value="<?= $list['last'] ?>">
413 <input id="v_page_curr" style="text-align: right;" type="text" size="4" value="<?= $list['page'] ?>">/<?= $list['last'] ?>[ページ]
414 <button type="button" class="my_blue" style="width: 40px;" onclick="return my.move(1);">></button>
415 <button type="button" class="my_blue" style="width: 40px;" onclick="return my.move(9);">>|</button>
417 <td style="text-align: right; width: 20%;">
418 表示数:<?= $list['rpp'] ?>[件/ページ]
423 <div style="height: 2px;"> </div>
425 <table class="my_list">
439 if ($list['cnt'] < 1) {
442 <td colspan="7">データなし</td>
446 $i = ($list['page'] - 1) * $list['rpp'];
447 foreach ($list['rec']['journal'] as $jod) {
452 $dno = $view->str($jid);
453 $ymd = $view->strDate($jod['ymd']);
454 $week = $view->week($jod['ymd']);
455 $sflg = $view->settledFlag($jod['settled_flg'], $settled);
456 $nflg = $view->checkFlag($jod['not_use_flg']);
457 $scd = $view->str($section[$jod['scd']]);
460 <td style="text-align: center;" rowspan="2">
461 <button type="button" class="my_cyan" onclick="return my.duplicate(<?= $dno ?>);">複製</button>
463 <button type="button" class="my_green" onclick="return my.edit(<?= $dno ?>);">編集</button>
465 <button type="button" class="my_magenta" onclick="return my.drop(<?= $dno ?>);">削除</button>
467 <td style="text-align: right;" rowspan="2"><?= $i ?></td>
468 <td style="text-align: center;"><?= $dno ?></td>
469 <td style="text-align: center;"><?= $ymd ?>(<?= $week ?>)</td>
470 <td style="text-align: center;"><?= $sflg ?></td>
471 <td style="text-align: center;"><?= $nflg ?></td>
472 <td style="text-align: center;"><?= $scd ?></td>
475 <td colspan="5" style="background-color: #77c;">
487 foreach ($list['rec']['slip'][$jid] as $jsd) {
488 $damount = ($jsd['debit'] == 0) ? '' : number_format((int)$jsd['amount']);
489 $camount = ($jsd['credit'] == 0) ? '' : number_format((int)$jsd['amount']);
491 if (empty($kcd[$jsd['debit']]['name'])) {
492 $dname = $view->str($jsd['debit']);
494 $dname = $view->str($kcd[$jsd['debit']]['name']);
497 if (empty($kcd[$jsd['credit']]['name'])) {
498 $cname = $view->str($jsd['credit']);
500 $cname = $view->str($kcd[$jsd['credit']]['name']);
503 $remark = $view->str($jsd['remark']);
505 $dsum += ($jsd['debit'] == 0) ? 0 : (int)$jsd['amount'];
506 $csum += ($jsd['credit'] == 0) ? 0 : (int)$jsd['amount'];
509 <td style="text-align: right;"><?= $damount ?></td>
510 <td style="text-align: center;"><?= $dname ?></td>
511 <td style="text-align: center;"><?= $remark ?></td>
512 <td style="text-align: center;"><?= $cname ?></td>
513 <td style="text-align: right;"><?= $camount ?></td>
517 $dtotal = number_format($dsum);
518 $ctotal = number_format($csum);
521 <th><?= $dtotal ?></th>
522 <th colspan="3">合計</th>
523 <th><?= $ctotal ?></th>