hokky 4 bulan lalu
induk
melakukan
7ae5623fac

+ 3 - 3
dabory/para/erp/ko_KR/form/form-b/purch/porder.json

@@ -193,7 +193,7 @@
     "// ListVars": "ListVars[0]-Caption, ListVars[1]-Size(%), ListVars[2]-align",
     "ListVars": [
         {
-            "$Radio": "$Radio",
+            "$Radio": "",
             "$Check": "$Check",
             "ItemCode": "품목코드*",
             "ItemName": "품명*",
@@ -212,7 +212,7 @@
             "PorderMemo": "품목설명(M)"
         },
         {
-            "$Radio": "3",
+            "$Radio": "",
             "$Check": "3",
             "ItemCode": "10",
             "ItemName": "30",
@@ -231,7 +231,7 @@
             "PorderMemo": "10"
         },
         {
-            "$Radio": "center",
+            "$Radio": "",
             "$Check": "center",
             "ItemCode": "left",
             "ItemName": "left",

+ 8 - 47
public/js/modals-controller/b-type/common.js

@@ -129,9 +129,7 @@
 
     Btype.call_act_api = function (data, callback, act_api = undefined, argObj = '#frm', namespace = 'window') {
         let url = eval(namespace).formB.General.ActApi;
-        console.log('call_act_api')
-        console.log('url : ', url)
-        console.log('data : ', data)
+
         if (! isEmpty(act_api)) { url = act_api; }
 
         $('.save-button').prop('disabled', true);
@@ -176,11 +174,11 @@
             }
         })
         // 현재 선택된 input요소의 tr에서 첫번째 td의 input 요소의 name
-        // 원본 : let cursor = $(tr).find('td:eq(0) input').attr('name')
-        let cursor = $(tr).find('td:eq(0) input');
-        if(cursor.is(':hidden')){
-            cursor = $(tr).find('td:eq(1) input').attr('name')
-        }
+        let cursor = $(tr).find('td:eq(0) input').attr('name')
+        // let cursor = $(tr).find('td:eq(0) input');
+        // if(cursor.is(':hidden')){
+        //     cursor = $(tr).find('td:eq(1) input').attr('name')
+        // }
 
         $(table).find(`input[name='${cursor}']`).each(function (i) {
             if (! $(this).is(':checked')) {
@@ -194,36 +192,11 @@
                 })
             }
         })
-        // 현재 선택된 input 요소
-        let currentInput = $this;
 
-        // // 현재 선택된 input 요소의 tr
-        // let currentTr = currentInput.closest('tr');
-        // // tr의 모든 자식들(td)
-        // // let siblingsTd = currentTr.children('td');
-        // let currentTd = currentInput.closest('td');
-        // // 모든 td요소에서 currentInput의 td요소 index
-        // // let tdIndex = currentTd.index(currentInput.closest('td'));
-        // let lastCursor = $(tr).find('td:last textarea');
-        // // let lastTd= $(currentTr).find('td:last');
-
-        // if(currentInput.is(lastCursor)){
-        //     console.log('currentInput is lastInput');
-            // $($($this).closest('tr')).children(`td:eq(${Btype.get_first_required_th_index(table)})`).find('input').focus();
-        // }
-        // console.log('currentInput : ', currentInput.val());
-        // console.log('currentTd : ', currentTd);
-        // console.log('lastCursor : ', lastCursor);
+        let currentInput = $this;
         currentInput.focus();
         currentInput.select();
-
-
-        // $($($this).closest('tr')).children(`td:eq(${Btype.get_first_required_th_index(table)})`).find('input').focus();
-
         // $($($this).closest('tr')).children(`td:eq(${Btype.get_first_required_th_index(table)})`).find('input').focus();
-        let currentElement = $($this);
-        currentElement.focus();
-        currentElement.select();
     };
 
     Btype.table_td_focus = function ($this) {
@@ -289,7 +262,7 @@
                 {Id: item_id }
             ]
         })
-        console.log('response : ', response);
+
         let item = response.data.Page[0];
         let next_input = eval(namespace).set_item_data_to_textbox(item)
 
@@ -542,9 +515,6 @@
 
         let up_or_down_val = (move == 'up' ? -1 : 1);
         let temp_bd_page = Btype.change_array_order(eval(namespace).bd_page, index, up_or_down_val);
-        console.log(eval(namespace).bd_page,)
-        console.log(index)
-        console.log(up_or_down_val)
         if (! temp_bd_page) {
             iziToast.error({
                 title: 'Error',
@@ -651,7 +621,6 @@
     };
 
     Btype.get_name_pick_api = async function (url, id) {
-        console.log('get_name_pick_api');
         const response = await get_api_data(url, { Page: [ { Id:  parseInt(id) } ] })
         return response.data.Page[0]
     };
@@ -665,7 +634,6 @@
     };
 
     Btype.fetch_slip_form_book = async function (slip_no, namespace = 'window', callback = undefined) {
-        console.log('Btype.fetch_slip_form_book')
         let response = await call_slip_form_book(eval(namespace).formB['General']['PickApi'],
             eval(namespace).formB['QueryVars']['QueryName'], slip_no, menuCode);
 
@@ -720,9 +688,6 @@
             return false;
         }
 
-        console.log('namespace : ', namespace)
-        console.log('btn_act_save1')
-        console.log('btn_act_save2 : ', eval(namespace))
         test = Btype.call_act_api(eval(namespace).get_parameter(), function() {
             if (! isEmpty(callback)) { callback(); }
         }, undefined, argObj, namespace);
@@ -744,10 +709,6 @@
             Page: [ eval(namespace).get_parameter() ]
         });
         const page = response.data.Page
-
-        // console.log(eval(namespace).get_parameter())
-        // console.log(response)
-        // console.log(page)
         if (page) {
             set_as_response_id(page[0].Id, argObj)
             return true

+ 44 - 29
resources/views/front/dabory/erp/purchase/porder.blade.php

@@ -53,10 +53,10 @@
                                     <div class="form-group d-flex flex-column mb-2">
                                         <label class="m-0 overflow-hidden text-nowrap">{{ $formB['FormVars']['Title']['AutoSlipNo'] }}</label>
                                         <div class="col-12 d-flex p-0">
-                                            <button id="auto-slip-no-btn" class="btn-dark border-white rounded overflow-hidden col-3 text-center text-white text-nowrap radius-r0"
-                                                onclick="get_last_slip_no(this)">
-                                                <span class="icon-cogs"></span>
-                                            </button>
+                                        {{-- <button id="auto-slip-no-btn" class="btn-dark border-white rounded overflow-hidden col-3 text-center text-white text-nowrap radius-r0" --}}
+                                        {{--         onclick="get_last_slip_no(this)"> --}}
+                                        {{--         <span class="icon-cogs"></span> --}}
+                                        {{--     </button> --}}
                                             <input type="text" id="auto-slip-no-txt" class="rounded w-100 radius-l0" autocomplete="off" disabled
                                                    maxlength="{{ $formB['FormVars']['MaxLength']['AutoSlipNo'] }}"
                                                 {{ $formB['FormVars']['Required']['AutoSlipNo'] }}>
@@ -370,6 +370,16 @@
                 }
             }
 
+            $('#porder-table-body').on('click', 'tr', function() {
+                // Find the input element with name="bd-cursor-state" within the clicked row
+                const $bdCursorStateInput = $(this).find('input[name="bd-cursor-state"]');
+                console.log('bdCursorStateInput : ', $bdCursorStateInput)
+                if ($bdCursorStateInput.length) {
+                    $($bdCursorStateInput).prop('checked', true)
+                    Btype.bd_cursor_click($bdCursorStateInput)
+                }
+            });
+
             $('.porder-act').on('click', function () {
                 // console.log($(this).data('value'))
                 switch( $(this).data('value') ) {
@@ -537,7 +547,9 @@
                     Btype.body_act_success_callback($this, tr);
                     Btype.check_the_checkbox_when_changing($this, false)
                 });
+                console.log('필수데이터 노누락');
             } else {
+                console.log('필수데이터 누락');
                 iziToast.error({
                     title: 'Error',
                     message: @json(_e('(*)Required item(s) omitted')),
@@ -547,8 +559,11 @@
 
         // start body act btn
         async function btn_bd_act_add() {
-            if (parseInt($(`#frm`).find(`input[name="Id"]`).val()) == 0 && formB['SlipCommonSetup']['IsAutoSaveHdByItemButton']) {
+            // if (parseInt($(`#frm`).find(`input[name="Id"]`).val()) == 0 && formB['SlipCommonSetup']['IsAutoSaveHdByItemButton']) {
+            if (parseInt($(`#frm`).find(`input[name="Id"]`).val()) == 0) {
                 if (! await Btype.btn_act_add_chain('#porder-form #frm')) { return }
+            }else{
+                console.log('formb.SlipCommonSetup : ', formB['SlipCommonSetup']);
             }
 
             if (! Btype.last_item_added_check('#porder-table-body')) {
@@ -800,7 +815,7 @@
                 // 품목코드, 수량, 단가, 공급가액, 세액, 합계금액
                 html.push (
                 `<tr>
-                    <td class="text-${formB.ListVars['Align'].$Radio} px-import-0">
+                    <td class="text-${formB.ListVars['Align'].$Radio} px-import-0" ${formB.ListVars['Hidden'].$Radio}>
                         <input name="bd-cursor-state" type="radio" value="1" tabindex="-1"
                         class="text-${formB.ListVars['Align'].$Radio}"
                         onclick="Btype.bd_cursor_click(this)">
@@ -812,13 +827,13 @@
                     <td onkeydown="Btype.enterPressedinCell(event)"
                         class="text-${formB.ListVars['Align'].ItemCode}" ${formB.ListVars['Hidden'].ItemCode}
                         >
-                        <input type="text" class="text-${formB.ListVars['Align'].ItemCode} border-0 bg-white" value="${bd.ItemCode}" disabled
+                        <input type="text" class="text-${formB.ListVars['Align'].ItemCode} border-0 bg-white" value="${bd.ItemCode}" readonly
                         onchange="Btype.check_the_checkbox_when_changing(this)" required>
                     </td>
                     <td onkeydown="Btype.enterPressedinCell(event, 2)"
                         class="text-${formB.ListVars['Align'].ItemName}" ${formB.ListVars['Hidden'].ItemName}
                         >
-                        <input type="text" class="text-${formB.ListVars['Align'].ItemName} border-0 bg-white" value="${bd.ItemName}" disabled
+                        <input type="text" class="text-${formB.ListVars['Align'].ItemName} border-0 bg-white" value="${bd.ItemName}" readonly
                         onchange="Btype.check_the_checkbox_when_changing(this)" required>
                     </td>
                     <td
@@ -830,7 +845,7 @@
                     <td onkeydown="Btype.handleEnterPressedinTabCell(event)"
                         class="text-${formB.ListVars['Align'].PorderQty}" ${formB.ListVars['Hidden'].PorderQty}
                         >
-                        <input type="text" class="text-${formB.ListVars['Align'].PorderQty} border-0 bg-white" value="${format_conver_for(bd.PorderQty, formB.ListVars['Format'].PorderQty)}" disabled
+                        <input type="text" class="text-${formB.ListVars['Align'].PorderQty} border-0 bg-white" value="${format_conver_for(bd.PorderQty, formB.ListVars['Format'].PorderQty)}" readonly
                         onchange="Btype.check_the_checkbox_when_changing(this)"
                         onfocusout="override_amt_calc_txt_is_changed()"
                         required>
@@ -838,7 +853,7 @@
                     <td onkeydown="Btype.handleEnterPressedinTabCell(event)"
                         class="text-${formB.ListVars['Align'].PorderPrc}" ${formB.ListVars['Hidden'].PorderPrc}
                         >
-                        <input type="text" class="text-${formB.ListVars['Align'].PorderPrc} border-0 bg-white" value="${format_conver_for(bd.PorderPrc, formB.ListVars['Format'].PorderPrc)}" disabled
+                        <input type="text" class="text-${formB.ListVars['Align'].PorderPrc} border-0 bg-white" value="${format_conver_for(bd.PorderPrc, formB.ListVars['Format'].PorderPrc)}" readonly
                         onchange="Btype.check_the_checkbox_when_changing(this)"
                         onfocusout="override_amt_calc_txt_is_changed()"
                         required>
@@ -846,7 +861,7 @@
                     <td onkeydown="Btype.handleEnterPressedinTabCell(event)"
                         class="text-${formB.ListVars['Align'].SupplyAmt}" ${formB.ListVars['Hidden'].SupplyAmt}
                         >
-                        <input type="text" class="text-${formB.ListVars['Align'].SupplyAmt} border-0 bg-white" value="${format_conver_for(bd.PorderSupply, formB.ListVars['Format'].SupplyAmt)}" disabled
+                        <input type="text" class="text-${formB.ListVars['Align'].SupplyAmt} border-0 bg-white" value="${format_conver_for(bd.PorderSupply, formB.ListVars['Format'].SupplyAmt)}" readonly
                         onchange="Btype.check_the_checkbox_when_changing(this)"
                         onfocusout="override_custom_supply_amt_or_vat_amt()"
                         required>
@@ -854,7 +869,7 @@
                     <td onkeydown="Btype.handleEnterPressedinTabCell(event)"
                         class="text-${formB.ListVars['Align'].VatAmt}" ${formB.ListVars['Hidden'].VatAmt}
                         >
-                        <input type="text" class="text-${formB.ListVars['Align'].VatAmt} border-0 bg-white" value="${format_conver_for(bd.PorderVat, formB.ListVars['Format'].VatAmt)}" disabled
+                        <input type="text" class="text-${formB.ListVars['Align'].VatAmt} border-0 bg-white" value="${format_conver_for(bd.PorderVat, formB.ListVars['Format'].VatAmt)}" readonly
                         onchange="Btype.check_the_checkbox_when_changing(this)"
                         onfocusout="override_custom_supply_amt_or_vat_amt()"
                         required>
@@ -862,7 +877,7 @@
                     <td onkeydown="Btype.handleEnterPressedinTabCell(event)"
                         class="text-${formB.ListVars['Align'].SumAmt}" ${formB.ListVars['Hidden'].SumAmt}
                         >
-                        <input type="text" class="text-${formB.ListVars['Align'].SumAmt} border-0 bg-white" value="${format_conver_for(bd.PorderSum, formB.ListVars['Format'].SumAmt)}" disabled
+                        <input type="text" class="text-${formB.ListVars['Align'].SumAmt} border-0 bg-white" value="${format_conver_for(bd.PorderSum, formB.ListVars['Format'].SumAmt)}" readonly
                         onchange="Btype.check_the_checkbox_when_changing(this)"
                         onfocusout="override_custom_sum_amt()"
                         required>
@@ -873,7 +888,7 @@
                     <td onkeydown="Btype.handleEnterPressedinTabCell(event)"
                         class="text-${formB.ListVars['Align'].ConfirmDate}" ${formB.ListVars['Hidden'].ConfirmDate}
                         >
-                        <input type="date" class="text-${formB.ListVars['Align'].ConfirmDate} border-0 bg-white" value="${isEmpty(bd.ConfirmDate) ? '' : moment(bd.ConfirmDate).format('YYYY-MM-DD')}" disabled
+                        <input type="date" class="text-${formB.ListVars['Align'].ConfirmDate} border-0 bg-white" value="${isEmpty(bd.ConfirmDate) ? '' : moment(bd.ConfirmDate).format('YYYY-MM-DD')}" readonly
                         onchange="Btype.check_the_checkbox_when_changing(this)"
                         onfocusout="save_data_when_entering_text()">
                     </td>
@@ -881,7 +896,7 @@
                     <td onkeydown="Btype.handleEnterPressedinTabCell(event)"
                         class="text-${formB.ListVars['Align'].DeliDate}" ${formB.ListVars['Hidden'].DeliDate}
                         >
-                        <input type="date" class="text-${formB.ListVars['Align'].DeliDate} border-0 bg-white" value="${isEmpty(bd.DeliDate) ? '' : moment(bd.DeliDate).format('YYYY-MM-DD')}" disabled
+                        <input type="date" class="text-${formB.ListVars['Align'].DeliDate} border-0 bg-white" value="${isEmpty(bd.DeliDate) ? '' : moment(bd.DeliDate).format('YYYY-MM-DD')}" readonly
                         onchange="Btype.check_the_checkbox_when_changing(this)"
                         onfocusout="save_data_when_entering_text()"
                         required>
@@ -889,7 +904,7 @@
                     <td onkeydown="Btype.handleEnterPressedinTabCell(event)"
                         class="text-${formB.ListVars['Align'].Ref1}" ${formB.ListVars['Hidden'].Ref1}
                         >
-                        <input type="text" class="text-${formB.ListVars['Align'].Ref1} border-0 bg-white" value="${bd.Ref1}" disabled
+                        <input type="text" class="text-${formB.ListVars['Align'].Ref1} border-0 bg-white" value="${bd.Ref1}" readonly
                         onchange="Btype.check_the_checkbox_when_changing(this)"
                         onfocusout="save_data_when_entering_text()">
                     </td>
@@ -897,7 +912,7 @@
                         onfocusout="add_td_last_tap_out(this, ${bd.Id})"
                         class="text-${formB.ListVars['Align'].Ref2}" ${formB.ListVars['Hidden'].Ref2}
                         >
-                        <input type="text" class="text-${formB.ListVars['Align'].Ref2} border-0 bg-white" value="${bd.Ref2}" disabled
+                        <input type="text" class="text-${formB.ListVars['Align'].Ref2} border-0 bg-white" value="${bd.Ref2}" readonly
                         onchange="Btype.check_the_checkbox_when_changing(this)"
                         onfocusout="save_data_when_entering_text()">
                     </td>
@@ -926,7 +941,7 @@
 
             let html =
             `<tr>
-                <td class="text-${formB.ListVars['Align'].$Radio} px-import-0">
+                <td class="text-${formB.ListVars['Align'].$Radio} px-import-0" ${formB.ListVars['Hidden'].$Radio}>
                     <input name="bd-cursor-state" type="radio" value="1" tabindex="-1"
                     class="text-${formB.ListVars['Align'].$Radio}"
                     id="bd-cursor-state-${last_bd_id_inc}"
@@ -939,14 +954,14 @@
                 <td onkeydown="Btype.enterPressedinCell(event)"
                     class="text-${formB.ListVars['Align'].ItemCode}" ${formB.ListVars['Hidden'].ItemCode}
                     >
-                    <input type="text" class="text-${formB.ListVars['Align'].ItemCode} border-0 bg-white"
+                    <input type="text" class="text-${formB.ListVars['Align'].ItemCode} border-0 bg-white" readonly
                     onchange="Btype.check_the_checkbox_when_changing(this)"
                     id="item-code-${last_bd_id_inc}" required>
                 </td>
                 <td onkeydown="Btype.enterPressedinCell(event, 2)"
                     class="text-${formB.ListVars['Align'].ItemName}" ${formB.ListVars['Hidden'].ItemName}
                     >
-                    <input type="text" class="text-${formB.ListVars['Align'].ItemName} border-0 bg-white"
+                    <input type="text" class="text-${formB.ListVars['Align'].ItemName} border-0 bg-white" readonly
                     onchange="Btype.check_the_checkbox_when_changing(this)" required>
                 </td>
                 <td
@@ -958,7 +973,7 @@
                 <td onkeydown="Btype.handleEnterPressedinTabCell(event)"
                     class="text-${formB.ListVars['Align'].PorderQty}" ${formB.ListVars['Hidden'].PorderQty}
                     >
-                    <input type="text" class="text-${formB.ListVars['Align'].PorderQty} border-0 bg-white"
+                    <input type="text" class="text-${formB.ListVars['Align'].PorderQty} border-0 bg-white" readonly
                     onchange="Btype.check_the_checkbox_when_changing(this)"
                     onfocusout="override_amt_calc_txt_is_changed()"
                     required>
@@ -966,7 +981,7 @@
                 <td onkeydown="Btype.handleEnterPressedinTabCell(event)"
                     class="text-${formB.ListVars['Align'].PorderPrc}" ${formB.ListVars['Hidden'].PorderPrc}
                     >
-                    <input type="text" class="text-${formB.ListVars['Align'].PorderPrc} border-0 bg-white"
+                    <input type="text" class="text-${formB.ListVars['Align'].PorderPrc} border-0 bg-white" readonly
                     onchange="Btype.check_the_checkbox_when_changing(this)"
                     onfocusout="override_amt_calc_txt_is_changed()"
                     required>
@@ -974,7 +989,7 @@
                 <td onkeydown="Btype.handleEnterPressedinTabCell(event)"
                     class="text-${formB.ListVars['Align'].SupplyAmt}" ${formB.ListVars['Hidden'].SupplyAmt}
                     >
-                    <input type="text" class="text-${formB.ListVars['Align'].SupplyAmt} border-0 bg-white"
+                    <input type="text" class="text-${formB.ListVars['Align'].SupplyAmt} border-0 bg-white" readonly
                     onchange="Btype.check_the_checkbox_when_changing(this)"
                     onfocusout="override_custom_supply_amt_or_vat_amt()"
                     required>
@@ -982,13 +997,13 @@
                 <td onkeydown="Btype.handleEnterPressedinTabCell(event)"
                     class="text-${formB.ListVars['Align'].VatAmt}" ${formB.ListVars['Hidden'].VatAmt}
                     >
-                    <input type="text" class="text-${formB.ListVars['Align'].VatAmt} border-0 bg-white"
+                    <input type="text" class="text-${formB.ListVars['Align'].VatAmt} border-0 bg-white" readonly
                     onchange="Btype.check_the_checkbox_when_changing(this)"
                     onfocusout="override_custom_supply_amt_or_vat_amt()"
                     required>
                 </td>
                 <td onkeydown="Btype.handleEnterPressedinTabCell(event)"
-                    class="text-${formB.ListVars['Align'].SumAmt}" ${formB.ListVars['Hidden'].SumAmt}
+                    class="text-${formB.ListVars['Align'].SumAmt}" ${formB.ListVars['Hidden'].SumAmt} readonly
                     >
                     <input type="text" class="text-${formB.ListVars['Align'].SumAmt} border-0 bg-white"
                     onchange="Btype.check_the_checkbox_when_changing(this)"
@@ -1001,7 +1016,7 @@
                 <td onkeydown="Btype.handleEnterPressedinTabCell(event)"
                     class="text-${formB.ListVars['Align'].ConfirmDate}" ${formB.ListVars['Hidden'].ConfirmDate}
                     >
-                    <input type="date" class="text-${formB.ListVars['Align'].ConfirmDate} border-0 bg-white"
+                    <input type="date" class="text-${formB.ListVars['Align'].ConfirmDate} border-0 bg-white" readonly
                     value="${moment().format('YYYY-MM-DD')}"
                     onchange="Btype.check_the_checkbox_when_changing(this)"
                     onfocusout="save_data_when_entering_text()">
@@ -1010,7 +1025,7 @@
                 <td onkeydown="Btype.handleEnterPressedinTabCell(event)"
                     class="text-${formB.ListVars['Align'].DeliDate}" ${formB.ListVars['Hidden'].DeliDate}
                     >
-                    <input type="date" class="text-${formB.ListVars['Align'].DeliDate} border-0 bg-white"
+                    <input type="date" class="text-${formB.ListVars['Align'].DeliDate} border-0 bg-white" readonly
                     value="${moment().format('YYYY-MM-DD')}"
                     onchange="Btype.check_the_checkbox_when_changing(this)"
                     onfocusout="save_data_when_entering_text()"
@@ -1019,7 +1034,7 @@
                 <td onkeydown="Btype.handleEnterPressedinTabCell(event)"
                     class="text-${formB.ListVars['Align'].Ref1}" ${formB.ListVars['Hidden'].Ref1}
                     >
-                    <input type="text" class="text-${formB.ListVars['Align'].Ref1} border-0 bg-white"
+                    <input type="text" class="text-${formB.ListVars['Align'].Ref1} border-0 bg-white" readonly
                     onchange="Btype.check_the_checkbox_when_changing(this)"
                     onfocusout="save_data_when_entering_text()">
                 </td>
@@ -1027,7 +1042,7 @@
                     data-last=true onfocusout="add_td_last_tap_out(this, ${last_bd_id_inc})"
                     class="text-${formB.ListVars['Align'].Ref2}" ${formB.ListVars['Hidden'].Ref2}
                     >
-                    <input type="text" class="text-${formB.ListVars['Align'].Ref2} border-0 bg-white"
+                    <input type="text" class="text-${formB.ListVars['Align'].Ref2} border-0 bg-white"readonly
                     onchange="Btype.check_the_checkbox_when_changing(this)"
                     onfocusout="save_data_when_entering_text()">
                 </td>

+ 0 - 500
resources/views/front/dabory/erp/stock/genio.blade copy.php

@@ -1,500 +0,0 @@
-@extends('layouts.master')
-@section('title', $formB['General']['Title'])
-@section('content')
-
-<div class="content stock">
-    <div class="row">
-        <div class="col-xl-12">
-            <div class="mb-1 pt-2 text-right">
-                <button type="button"
-                    class="btn btn-success btn-open-modal"
-                    data-target="slip"
-                    data-clicked="Btype.fetch_slip_form_book"
-                    data-variable="genioModal">
-                    <i class="icon-folder-open"></i>
-                </button>
-
-                <button type="button" class="btn btn-sm btn-primary save-spinner-btn">
-                    <span class="save-spinner spinner-border spinner-border-sm text-center" role="status" aria-hidden="true"></span>
-                        Loading...
-                </button>
-                <div class="btn-group" hidden>
-                    <button type="button" class="btn btn-sm btn-primary genio-act save-button" data-value="save" {{ $formB['FormVars']['Hidden']['SaveButton'] }}>
-                        {{ $formB['FormVars']['Title']['SaveButton'] }}
-                    </button>
-                    @include('front.dabory.erp.partial.select-btn-options', [
-                        'selectBtns' => $formB['HeadSelectOptions'],
-                        'eventClassName' => 'genio-act',
-                    ])
-                </div>
-            </div>
-
-            <div class="card" id="genio-form">
-                <div class="card-header" id="frm">
-                    <div class="row">
-                        <div class="col-12 col-md-4 col-lg card-header-item">
-                            <div class="card card card-primary mb-3 mb-md-2 mb-lg-0 border-light" style="height: 250px">
-                                <div class="card-header p-0 mb-2">
-                                    {{-- <p class="card-title p-1 ml-2">주요 정보</p> --}}
-                                </div>
-                                <div class="card-body">
-                                    <input type="hidden" id="Id" name="Id" value="0">
-                                    <div class="form-group d-flex flex-column mb-2">
-                                        <label class="m-0 overflow-hidden text-nowrap">{{ $formB['FormVars']['Title']['AutoSlipNo'] }}(<span class="is-new-rec-auto-slip-no">수동입력</span>)</label>
-{{--                                    <div class="col-12 d-flex p-0">--}}
-{{--                                        <button id="auto-slip-no-btn" class="btn-dark border-white rounded overflow-hidden col-3 text-center text-white text-nowrap radius-r0"--}}
-{{--                                            onclick="get_last_slip_no(this)">--}}
-{{--                                            <span class="icon-cogs"></span>--}}
-{{--                                        </button>--}}
-{{--                                        <input type="text" id="auto-slip-no-txt" class="rounded w-100 radius-l0" autocomplete="off" disabled--}}
-{{--                                            maxlength="{{ $formB['FormVars']['MaxLength']['AutoSlipNo'] }}"--}}
-{{--                                        {{ $formB['FormVars']['Required']['AutoSlipNo'] }}>--}}
-{{--                                    </div>--}}
-                                        <input type="text" id="auto-slip-no-txt" class="rounded w-100" autocomplete="off"
-                                             maxlength="{{ $formB['FormVars']['MaxLength']['AutoSlipNo'] }}"
-                                            {{ $formB['FormVars']['Required']['AutoSlipNo'] }}>
-                                    </div>
-                                    <div class="form-group d-flex flex-column mb-2">
-                                        <label class="m-0">{{ $formB['FormVars']['Title']['GenioDate'] }}</label>
-                                        <input class="rounded w-100" type="date" value="" id="genio-date"
-                                               maxlength="{{ $formB['FormVars']['MaxLength']['GenioDate'] }}"
-                                            {{ $formB['FormVars']['Required']['GenioDate'] }}>
-                                    </div>
-                                    <div class="form-group d-flex flex-column">
-                                        <label class="m-0 ">{{ $formB['FormVars']['Title']['DealType'] }}</label>
-                                        <select class="rounded w-100" id="deal-type-select"
-                                                maxlength="{{ $formB['FormVars']['MaxLength']['DealType'] }}"
-                                            {{ $formB['FormVars']['Required']['DealType'] }}>
-                                        </select>
-                                    </div>
-                                </div>
-                            </div>
-                        </div>
-                        <div class="col-12 col-md-4 col-lg card-header-item">
-                            <div class="card card card-info mb-3 mb-md-2 mb-lg-0 border-light" style="height: 250px">
-                                <div class="card-header p-0 mb-2">
-                                    {{-- <p class="card-title p-1 ml-2">거래구분 / 세율</p> --}}
-                                </div>
-                                <div class="card-body">
-                                    <div class="form-group d-flex flex-column mb-2">
-                                        <label class="m-0 ">{{ $formB['FormVars']['Title']['CompanyName'] }}</label>
-                                        <div class="d-flex">
-                                            <input type="text" id="supplier-txt" data-id="0" class="rounded w-100 radius-r0" autocomplete="off"
-                                            onkeydown="company_model_show_cell_enter_key(event, 'BB')"
-                                                   maxlength="{{ $formB['FormVars']['MaxLength']['CompanyName'] }}"
-                                                {{ $formB['FormVars']['Required']['CompanyName'] }}>
-                                            <button type="button"
-                                                class="btn-dark rounded btn-open-modal border-0 radius-l0 col-3 window company-modal-btn"
-                                                data-target="company"
-                                                data-clicked="get_override_supplier_id"
-                                                data-variable="companyModal">
-                                                <i class="icon-folder-open"></i>
-                                            </button>
-                                        </div>
-                                    </div>
-                                    <div class="form-group d-flex flex-column mb-2">
-                                        <label class="m-0">{{ $formB['FormVars']['Title']['Contact'] }}</label>
-                                        <input class="rounded w-100" id="supplier-contact-txt" type="text"
-                                               maxlength="{{ $formB['FormVars']['MaxLength']['Contact'] }}"
-                                            {{ $formB['FormVars']['Required']['Contact'] }}>
-                                    </div>
-                                    <div class="form-group d-flex flex-column">
-                                        <label class="m-0">{{ $formB['FormVars']['Title']['Status'] }}</label>
-                                        <select class="rounded w-100" data-closed="0" id="status-select" onchange="Btype.set_is_closed_val(this)"
-                                                maxlength="{{ $formB['FormVars']['MaxLength']['Status'] }}"
-                                            {{ $formB['FormVars']['Required']['Status'] }}>
-                                            <option value=""></option>
-                                            <option value="{{ $formB['StatusOptions'][0]['Value'] }}">{{ $formB['StatusOptions'][0]['Caption'] }}</option>
-                                            <option value="{{ $formB['StatusOptions'][1]['Value'] }}">{{ $formB['StatusOptions'][1]['Caption'] }}</option>
-                                        </select>
-                                    </div>
-                                </div>
-                            </div>
-                        </div>
-                        <div class="col-12 col-md-4 col-lg card-header-item">
-                            <div class="card card card-success mb-3 mb-md-2 mb-lg-0 border-light" style="height: 250px"><!--260-->
-                                <div class="card-header p-0 mb-2">
-                                    {{-- <p class="card-title p-1 ml-2">거래 조건</p> --}}
-                                </div>
-                                <div class="card-body">
-                                    <div class="form-group d-flex flex-column mb-2">
-                                        <label class="m-0">{{ $formB['FormVars']['Title']['VatType'] }}</label>
-                                        <select class="rounded w-100" id="vat-type-select" onchange="set_vat_type_rate(this)"
-                                                maxlength="{{ $formB['FormVars']['MaxLength']['VatType'] }}"
-                                            {{ $formB['FormVars']['Required']['VatType'] }}>
-                                        </select>
-                                    </div>
-                                    <div class="form-group d-flex flex-column mb-2">
-                                        <label class="m-0">{{ $formB['FormVars']['Title']['VatTypeRate'] }}</label>
-                                        <input type="text" id="vat-type-rate-text" class="rounded w-100" autocomplete="off" value="" disabled
-                                               maxlength="{{ $formB['FormVars']['MaxLength']['VatTypeRate'] }}"
-                                            {{ $formB['FormVars']['Required']['VatTypeRate'] }}>
-                                    </div>
-                                    <div class="form-group d-flex flex-column">
-                                        <label class="m-0">{{ $formB['FormVars']['Title']['SgroupName'] }}</label>
-                                        <select class="rounded w-100" data-closed="0" id="sgroup-id-select"
-                                                maxlength="{{ $formB['FormVars']['MaxLength']['SgroupName'] }}"
-                                            {{ $formB['FormVars']['Required']['SgroupName'] }}>
-                                        </select>
-                                    </div>
-                                </div>
-                            </div>
-                        </div>
-                        <div class="col-12 col-md-4 col-lg card-header-item">
-                            <div class="card card card-danger mb-3 mb-md-0 border-light" style="height: 250px">
-                                <div class="card-header p-0 mb-2">
-                                    {{-- <p class="card-title p-1 ml-2">기타</p> --}}
-                                </div>
-                                <div class="card-body">
-                                    <div class="form-group d-flex flex-column mb-2">
-                                        <label class="m-0">{{ $formB['FormVars']['Title']['OurContact'] }}</label>
-                                        <select class="rounded w-100" data-closed="0" id="our-contact-select"
-                                                maxlength="{{ $formB['FormVars']['MaxLength']['OurContact'] }}"
-                                            {{ $formB['FormVars']['Required']['OurContact'] }}>
-                                            <option value=""></option>
-                                        </select>
-                                    </div>
-                                    <div class="form-group d-flex flex-column mb-2">
-                                        <label class="m-0">{{ $formB['FormVars']['Title']['Column1'] }}</label>
-                                        <select class="rounded w-100" id="column1-select"
-                                                maxlength="{{ $formB['FormVars']['MaxLength']['Column1'] }}"
-                                            {{ $formB['FormVars']['Required']['Column1'] }}></select>
-                                    </div>
-                                    <div class="form-group d-flex flex-column">
-                                        <label class="m-0">{{ $formB['FormVars']['Title']['Column2'] }}</label>
-                                        <select class="rounded w-100" id="column2-select"
-                                                maxlength="{{ $formB['FormVars']['MaxLength']['Column2'] }}"
-                                            {{ $formB['FormVars']['Required']['Column2'] }}></select>
-                                    </div>
-                                </div>
-                            </div>
-                        </div>
-                        <div class="col-12 col-md-4 col-lg card-header-item">
-                            <div class="card card card-danger mb-0 border-light" style="height: 250px">
-                                <div class="card-header p-0 mb-2">
-                                </div>
-                                <div class="card-body">
-                                    <div class="form-group d-flex flex-column mb-2">
-                                        <label class="m-0">{{ $formB['FormVars']['Title']['UserName'] }}</label>
-                                        <input class="rounded w-100" type="text" id="user-txt" disabled
-                                               maxlength="{{ $formB['FormVars']['MaxLength']['UserName'] }}"
-                                            {{ $formB['FormVars']['Required']['UserName'] }}>
-                                    </div>
-                                    <div class="form-group d-flex flex-column">
-                                        <label class="m-0">{{ $formB['FormVars']['Title']['Remarks'] }}</label>
-                                        <textarea style="height: 85px" class="rounded w-100 bg-white" id="remarks-txt-area" role="button" readonly></textarea>
-                                        <div class="fr-view" id="remarks-preview" hidden></div>
-                                    </div>
-                                </div>
-                            </div>
-                        </div>
-                    </div>
-                </div>
-
-                <div class="card-body p-0 mt-2 mx-2">
-                    <!-- 탭시작 -->
-                    <ul class="nav nav-tabs nav-tabs-solid rounded">
-                        <li class="nav-item correct-tab"><a href="#correct-tab" class="nav-link rounded-left active" data-toggle="tab">{{ $formB['FormVars']['Title']['Genio'] }}</a></li>
-                        <li class="nav-item -tab"><a href="#-tab" class="nav-link" data-toggle="tab">{{ $formB['FormVars']['Title']['Moutio'] }}</a></li>
-                    </ul>
-                    <!--// 탭 끝 -->
-
-                    <!-- 탭내용 시작 -->
-                    <div class="tab-content">
-                        @include('front.dabory.erp.stock.tab.genio-correct')
-                        <div class="tab-pane fade" id="-tab">
-                            자재소모내역
-                        </div>
-                    </div>
-                    <!--// 탭 내용 끝 -->
-
-                </div>
-            </div>
-        </div>
-    </div>
-</div>
-
-@endsection
-
-@section('modal')
-    @include('front.outline.static.slip', ['moealSetFile' => $genioModal])
-    @include('front.outline.static.company', ['moealSetFile' => $companyModal])
-    @include('front.outline.static.item', ['moealSetFile' => $itemModal])
-    @include('front.outline.static.memo2')
-@endsection
-
-@section('js')
-<script src="{{ csset('/js/modals-controller/b-type/common.js') }}"></script>
-    <script>
-        window.onload = async function () {
-
-            $('#genio-date').val(date_to_sting(new Date()))
-            Btype.get_storage_name_and_branch_name()
-            // let data = await Btype.get_slip_form_init()
-            slipInit = @json($slipFormInitCacheData);
-            // console.log('dealType : ', data["DealTypePage"])
-
-            formB['SlipCommonSetup'] = slipInit['SlipCommonSetup']
-
-            // select box 만들기
-            await Btype.create_deal_type_select_box_options(slipInit.DealTypePage)
-            await Btype.create_vat_type_select_box_options(slipInit.VatRatePage)
-            await Btype.create_sgroup_select_box_options(slipInit.SgroupPage)
-            await create_etc_select_box_options(slipInit)
-
-            $('#user-txt').val(window.User['NickName'])
-
-            if (formB['SlipCommonSetup']['IsLastSlipGet']) {
-                Btype.set_slip_cache_data();
-
-                if (! isEmpty(pickCacheData['query'])) {
-                    let query = JSON.parse(pickCacheData['query'])
-                    await Btype.fetch_slip_form_book(query['QueryVars']['FilterValue']);
-                }
-            }
-
-            if (formB['SlipCommonSetup']['IsNewRecAutoSlipNo']) {
-                $('.is-new-rec-auto-slip-no').text('자동채번')
-                $('#auto-slip-no-txt').prop('disabled', true)
-                // get_last_slip_no()
-            }
-
-            $('.genio-act').on('click', function () {
-                console.log('.genio-act click')
-                // console.log($(this).data('value'))
-                switch( $(this).data('value') ) {
-                    case 'save': Btype.btn_act_save('#genio-form #frm'); break;
-                    case 'new': btn_act_new(); break;
-                    case 'save-and-new': Btype.btn_act_save_and_new('#genio-form #frm'); break;
-                    case 'delete': Btype.btn_act_del('#genio-form #frm'); break;
-                }
-            });
-            // 비고
-            $('#remarks-txt-area').on('dblclick', function () {
-                console.log('#remarks-txt-area dbclick')
-                $('#modal-memo2').find('#memo-textarea').val('')
-                $('#modal-memo2').data('txtarea_id', '#remarks-txt-area')
-                // 모달창 textarea에 입력한 값을 넣어줌
-                $('#modal-memo2').find('#memo-textarea').val($('#remarks-txt-area').val())
-                $('#modal-memo2').modal('show');
-            });
-
-            activate_button_group()
-        }
-
-        function set_company_data_to_textbox(company) {
-            console.log('set_company_data_to_textbox')
-            get_override_supplier_id(company.Id)
-            return $('.save-button')
-        }
-
-        function btn_act_new() {
-            console.log('btn_act_new')
-            GenioCorrect.bd_page = [];
-            input_box_reset_for('#frm', ['user-txt'])
-            input_box_reset_for('#total-frm')
-            $('#supplier-txt').data('id', 0)
-            $('#supplier-txt').data('contact', '')
-            $('#vat-type-select').trigger('change');
-            $('#status-select').data('closed', 0)
-
-            $('.genio-act.save-button').prop('disabled', false)
-
-            Btype.set_slip_no_btn_abled()
-            $('#genio-date').val(date_to_sting(new Date()))
-
-            // table body 초기화
-            table_head_check_box_reset('#genio-table-head')
-            $('#genio-table-body').html('');
-
-            if (formB['SlipCommonSetup']['IsNewRecAutoSlipNo']) {
-                get_last_slip_no()
-            }
-        }
-
-        function get_parameter() {
-            console.log('get_parameter')
-            const deal_name = slipInit['DealTypePage'].filter(page => page['Id'] === Number($('#deal-type-select').val()))[0]['DealName']
-            const vat_rate = $('#vat-type-select').find('option:selected').data('vatrate')
-            const vat_name = slipInit['VatRatePage'].filter(page => page['Id'] === Number($('#vat-type-select').val()))[0]['VatName']
-            let first_item = ''
-            if (GenioCorrect.bd_page.length > 0) {
-                const first_genio = GenioCorrect.bd_page[0]
-                first_item = first_genio['ItemCode'] + '_' + first_genio['ItemName']
-                if (first_genio['SubName']) {
-                    first_item += '_' + first_genio['SubName']
-                }
-                first_item += '(' + GenioCorrect.bd_page.length + ')'
-            }else{
-                console.log('no GenioCorrect.bd_page')
-            }
-            const itmtot_amt = GenioCorrect.bd_page.reduce((accumulator, bd) => {
-                console.log('accumulator : ', accumulator)
-                console.log('itmtot_amt.bd : ', bd)
-                return accumulator + parseFloat(bd.GenioSupply)
-            }, 0)
-            let id = parseInt($(`#frm`).find(`input[name="Id"]`).val());
-            let parameter = {
-                Id: id,
-                CreatedOn: get_now_time_stamp(),
-                UpdatedOn: get_now_time_stamp(),
-                GenioNo: $('#auto-slip-no-txt').val(),
-                GenioDate: moment(new Date($('#genio-date').val())).format('YYYYMMDD'),
-                DealTypeId: parseInt($('#deal-type-select').val()),
-                UserId: window.User['UserId'],
-                SgroupId: parseInt($('#sgroup-id-select').val()),
-                BranchId: window.User['BranchId'],
-                StorageId: window.User['StorageId'],
-                CompanyId: parseInt($('#supplier-txt').data('id')),
-                VatRateId: parseInt($('#vat-type-select').val()),
-                CompanyContact: $('#supplier-txt').data('contact'),
-                OurContact: $('#our-contact-select').val(),
-                Status: $('#status-select').val(),
-                Column1: $('#column1-select').val(),
-                Column2: $('#column2-select').val(),
-                Remarks: $('#remarks-txt-area').val(),
-                Ip: window.User['Ip'],
-
-                FirstItem: first_item,
-                ItmtotAmt: String(itmtot_amt),
-                DiscountAmt: '0',
-                TotalAmt: String(Number(itmtot_amt) - 0),
-                DealName: deal_name,
-                VatRate: vat_rate,
-                VatName: vat_name,
-                SgroupName: window.User['SgroupName']
-            }
-            if (id < 0) {
-                parameter = { Id: id }
-            } else if (id > 0) {
-                delete parameter.CreatedOn;
-            } else {
-                delete parameter.UpdatedOn;
-            }
-            console.log('get_parameter.parameter', parameter)
-            return parameter;
-        }
-        // DealTypePage, VatRatePage, SgroupPage과 마찬가지로 reduce를 통해 data 배열을 순회하면서 option 태그를 생성 for create_options()
-        async function create_etc_select_box_options(data) {
-            console.log('create_etc_select_box_options')
-            let column1 = create_options(data.EtcColumn1Page)
-            let column2 = create_options(data.EtcColumn2Page)
-            let our_contact = create_options(data.EtcOurContactPage)
-            // 공란1
-            $('#column1-select').html(column1);
-            // 공란2
-            $('#column2-select').html(column2);
-            // 발주담당자
-            $('#our-contact-select').html(our_contact);
-        }
-
-        function bd_update_due_to_vat_rate_change() {
-            console.log('bd_update_due_to_vat_rate_change.bd', bd)
-            let data = [];
-
-            GenioCorrect.bd_page = GenioCorrect.bd_page.filter(function (bd) {
-                return bd.Id != 0;
-            });
-
-            GenioCorrect.bd_page.forEach(bd => {
-                let supply_amt, vat_amt, sum_amt;
-                [supply_amt, vat_amt, sum_amt] = Btype.amt_calc({ pquote_prc: parseFloat(bd.GenioPrc), pquote_qty: parseFloat(bd.GenioQty) },
-                    parseFloat($('#vat-type-select').find('option:selected').data('vatrate')));
-                bd.GenioSupply = supply_amt;
-                bd.GenioVat = vat_amt;
-                bd.GenioSum = sum_amt;
-
-                data.push({
-                    Id: parseInt(bd.Id),
-                    GenioSupply: String(bd.GenioSupply),
-                    GenioVat: String(bd.GenioVat),
-                    GenioSum: String(bd.GenioSum),
-                    Ip: window.User['Ip']
-                })
-            });
-            return data;
-        }
-
-        function set_vat_type_rate($this, msg = true) {
-            console.log('set_vat_type_rate')
-            let vate_rate = $($this).find('option:selected').data('viewvatrate');
-            $('#vat-type-rate-text').val(vate_rate + '%')
-
-            if (parseInt($(`#frm`).find(`input[name="Id"]`).val()) == 0 || ! msg) return;
-            Btype.call_act_api(get_parameter(), function() { });
-
-            if (isEmpty(GenioCorrect.bd_page)){
-                console.log('set_vat_type_rate.no GenioCorrect.bd_page')
-                return;
-            }else{
-                console.log('set_vat_type_rate.bd_page 있음')
-            }
-
-            let data = bd_update_due_to_vat_rate_change();
-            console.log('set_vat_type_rate.data : ', data)
-            Btype.call_bd_act_api(data, function() {
-                GenioCorrect.create_bd_page();
-            })
-        }
-        // 거래업체 재정의
-        async function get_override_supplier_id(supplier_id) {
-            console.log('get_override_supplier_id')
-            await get_supplier_id(supplier_id);
-            $('#supplier-contact-txt').val($('#supplier-txt').data('contact'))
-        }
-
-        async function get_last_slip_no($this) {
-            console.log('get_last_slip_no')
-            Btype.set_slip_no_btn_disabled()
-            let response = await Btype.get_last_slip_no(formB['QueryVars']['QueryName']);
-            $('#auto-slip-no-txt').val(response.data.LastSlipNo + '-' + response.data.LastSlipNo)
-        }
-
-        function update_hd_ui(response) {
-            console.log('update_hd_ui.response : ', response)
-            if (isEmpty(response.data) || response.data.apiStatus) {
-                $('#modal-slip').modal('hide');
-                return;
-            }
-            Btype.set_slip_no_btn_disabled()
-
-            let hd_page = response.data.HdPage[0]
-            bd_page = response.data.BdPage ?? []
-
-            $('#Id').val(hd_page.Id)
-            $('#auto-slip-no-txt').val(hd_page.GenioNo)
-            $('#genio-date').val(moment(to_date(hd_page.GenioDate)).format('YYYY-MM-DD'))
-            $('#deal-type-select').val(hd_page.DealTypeId)
-
-            $('#supplier-txt').val(hd_page.CompanyName)
-            $('#supplier-txt').data('id', hd_page.CompanyId)
-            $('#supplier-txt').data('contact', hd_page.CompanyContact)
-            $('#supplier-contact-txt').val(hd_page.CompanyContact)
-            $('#status-select').val(hd_page.Status)
-
-            $('#vat-type-select').val(hd_page.VatRateId)
-            set_vat_type_rate('#vat-type-select', false);
-            $('#sgroup-id-select').val(hd_page.SgroupId)
-
-            $('#our-contact-select').val(hd_page.OurContact)
-            $('#column1-select').val(hd_page.Column1)
-            $('#column2-select').val(hd_page.Column2)
-
-            $('#remarks-txt-area').val(hd_page.Remarks)
-            $('#remarks-preview').html(hd_page.Remarks)
-
-            // table body에 데이터 추가
-            GenioCorrect.update_bd_ui(bd_page);
-
-            $('#modal-slip').modal('hide');
-        }
-
-        const genioModal = {!! json_encode($genioModal) !!};
-        const companyModal = {!! json_encode($companyModal) !!};
-        const itemModal = {!! json_encode($itemModal) !!};
-        const slipCacheData = {!! json_encode($slipCacheData) !!};
-        const pickCacheData = {!! json_encode($pickCacheData) !!};
-        var formB = {!! json_encode($formB) !!};
-        let slipInit = null;
-    </script>
-@endsection

+ 0 - 6
resources/views/front/dabory/erp/stock/genio.blade.php

@@ -296,12 +296,7 @@
             }
 
             $('.genio-act').on('click', function () {
-                console.log($(this).data('value'));
-                console.log($(this).data('parameter')); //여기까진 들어옴
-                console.log('여기서 문제? : ', str_replace_hyphen($(this).data('parameter'), '/'));
-                // console.log($(this).data('value'))
                 switch( $(this).data('value') ) {
-
                     case 'save': Btype.btn_act_save('#genio-form #frm'); break;
                     case 'new': btn_act_new(); break;
                     case 'copy-to-another': btn_act_copy_to_another(str_replace_hyphen($(this).data('parameter'), '/')); break;
@@ -313,7 +308,6 @@
             $('#remarks-txt-area').on('dblclick', function () {
                 $('#modal-memo2').find('#memo-textarea').val('')
                 $('#modal-memo2').data('txtarea_id', '#remarks-txt-area')
-                // 모달창 textarea에 입력한 값을 넣어줌
                 $('#modal-memo2').find('#memo-textarea').val($('#remarks-txt-area').val())
                 $('#modal-memo2').modal('show');
             });

+ 0 - 631
resources/views/front/dabory/erp/stock/tab/genio-correct.blade copy.php

@@ -1,631 +0,0 @@
-<div class="tab-pane fade show active" id="correct-tab">
-    <button type="button" hidden
-        class="btn btn-success btn-open-modal GenioCorrect item-modal-btn"
-        data-target="item"
-        data-clicked="GenioCorrect.override_get_item_id"
-        data-variable="itemModal">
-    </button>
-
-    <div class="d-flex justify-content-end">
-        <button class="btn btn-primary mr-1" id="down-btn" onclick="GenioCorrect.override_seq_no_up_down('down')"
-            data-clicked="">▼
-        </button>
-        <button class="btn btn-primary mr-1" id="up-btn" onclick="GenioCorrect.override_seq_no_up_down('up')"
-            data-clicked="">▲
-        </button>
-        <div class="btn-group">
-            <button class="btn btn-sm btn-primary genio-correct-act" data-value="add">
-                    {{ $formB['FormVars']['Title']['AddNewBdButton'] }}
-            </button>
-            @include('front.dabory.erp.partial.select-btn-options', [
-                'selectBtns' => $formB['BodySelectOptions'],
-                'eventClassName' => 'genio-correct-act'
-            ])
-        </div>
-    </div>
-
-    <div class="table-responsive mt-2" style="height:400px;" id="scroll-area">
-        <table class="table-row genio-table">
-            <thead id="genio-table-head">
-                @include('front.dabory.erp.partial.make-thead', [
-                    'listVars' => $formB['ListVars'],
-                    'checkboxName' => 'bd-cud-check'
-                ])
-            </thead>
-            <tbody id="genio-table-body">
-
-            </tbody>
-        </table>
-    </div>
-
-    <div class="table-footer justify-content-between col-12 d-flex flex-column flex-md-row align-items-start align-items-stretch mb-2 p-2 border mt-2 rounded">
-        <div class="d-flex flex-column flex-md-row ml-0 ml-md-4">
-            <div class="d-flex align-items-stretch flex-column  mb-2 mb-md-0 px-2">
-                <label class="w-100 overflow-hidden text-nowrap m-0 p-0" {{ $formB['FooterVars']['Hidden']['StorageName'] }}
-                    rowspan="1" colspan="1">
-                    {{ $formB['FooterVars']['Title']['StorageName'] }}
-                </label>
-                <input type="text" class="w-100 w-md-80 rounded text-left" id="StorageName" disabled>
-            </div>
-            <div class="d-flex align-items-stretch flex-column  mb-2 mb-md-0 px-2">
-                <label class="w-100 overflow-hidden text-nowrap m-0 p-0" {{ $formB['FooterVars']['Hidden']['BranchName'] }}
-                    rowspan="1" colspan="1">
-                    {{ $formB['FooterVars']['Title']['BranchName'] }}
-                </label>
-                <input type="text" class="w-100 w-md-80 rounded text-left" id="BranchName" disabled>
-            </div>
-        </div>
-        <div class="d-flex flex-column flex-md-row" id="total-frm">
-            <div class="d-flex align-items-stretch flex-column  mb-2 mb-md-0 px-2">
-                <label class="w-100 overflow-hidden text-nowrap m-0 p-0" {{ $formB['FooterVars']['Hidden']['QtyTotal'] }}
-                    rowspan="1" colspan="1">
-                    {{ $formB['FooterVars']['Title']['QtyTotal'] }}
-                </label>
-                <input type="text" class="w-100 w-md-80 rounded" id="QtyTotal" disabled>
-            </div>
-            <div class="d-flex align-items-stretch flex-column  mb-2 mb-md-0 px-2">
-                <label class="w-100 overflow-hidden text-nowrap m-0 p-0" {{ $formB['FooterVars']['Hidden']['SupplyTotal'] }}
-                    rowspan="1" colspan="1">
-                    {{ $formB['FooterVars']['Title']['SupplyTotal'] }}
-                </label>
-                <input type="text" class="w-100 w-md-80 rounded" id="SupplyTotal" disabled>
-            </div>
-            <div class="d-flex align-items-stretch flex-column  mb-2 mb-md-0 px-2">
-                <label class="w-100 overflow-hidden text-nowrap m-0 p-0" {{ $formB['FooterVars']['Hidden']['VatTotal'] }}
-                    rowspan="1" colspan="1">
-                    {{ $formB['FooterVars']['Title']['VatTotal'] }}
-                </label>
-                <input type="text" class="w-100 w-md-80 rounded" id="VatTotal" disabled>
-            </div>
-            <div class="d-flex align-items-stretch flex-column  mb-2 mb-md-0 px-2">
-                <label class="w-100 overflow-hidden text-nowrap m-0 p-0" {{ $formB['FooterVars']['Hidden']['SumTotal'] }}
-                    rowspan="1" colspan="1">
-                    {{ $formB['FooterVars']['Title']['SumTotal'] }}
-                </label>
-                <input type="text" class="w-100 w-md-80 rounded" id="SumTotal" disabled>
-            </div>
-        </div>
-    </div>
-
-</div>
-
-@push('js')
-    <script>
-        $(document).ready(async function() {
-            make_dynamic_table_css('#correct-tab .genio-table', make_dynamic_table_px(formB['ListVars']['Size']))
-
-            $('#correct-tab').find('.genio-correct-act').on('click', function () {
-                console.log('.genio-correct-act click')
-                switch( $(this).data('value') ) {
-                    case 'add': GenioCorrect.btn_bd_act_add(); break;
-                    case 'body-copy': GenioCorrect.btn_bd_act_body_copy(str_replace_hyphen($(this).data('parameter'), '/')); break;
-                    case 'multi-delete': GenioCorrect.override_btn_bd_act_multi_delete(); break;
-                    case 'multi-update': GenioCorrect.override_btn_bd_act_multi_update(); break;
-                }
-            });
-
-            $(document).on('complete.memo2', '#modal-memo2', function (e, txtarea_id, id) {
-                if (txtarea_id !== '#remarks-txt-area') {
-                    Btype.call_bd_act_api([ { Id: Number(id), GenioMemo: $(txtarea_id).val() } ], function () {
-                        const index = GenioCorrect.bd_page.findIndex(bd => bd['Id'] === id)
-                        GenioCorrect.bd_page[index].GenioMemo = $(txtarea_id).val()
-
-                        iziToast.success({ title: 'Success',  message: $('#action-completed').text() })
-                    }, 'GenioCorrect')
-                }
-            });
-
-
-        });
-
-        $('#genio-table-body').on('click', 'tr', function() {
-            console.log('#genio-table-body click')
-                // Find the input element with name="bd-cursor-state" within the clicked row
-                const $bdCursorStateInput = $(this).find('input[name="bd-cursor-state"]');
-                console.log('bdCursorStateInput : ', $bdCursorStateInput)
-                if ($bdCursorStateInput.length) {
-                    $($bdCursorStateInput).prop('checked', true)
-                    Btype.bd_cursor_click($bdCursorStateInput)
-                }
-            });
-
-        (function( GenioCorrect, $, undefined ) {
-            GenioCorrect.bd_page = []
-            GenioCorrect.formB = {!! json_encode($formB) !!}
-
-            GenioCorrect.override_seq_no_up_down = async function (move) {
-                console.log('GenioCorrect.override_seq_no_up_down')
-                let tr = $('#correct-tab').find(`input[name='bd-cursor-state']:checked`).closest('tr')
-                let index = $(tr).prevAll().length
-                let bd = GenioCorrect.bd_page[index]
-
-                if (window.isEmpty(bd) || parseInt($(`#frm`).find(`input[name="Id"]`).val()) == 0) {
-                    iziToast.error({
-                        title: 'Error',
-                        message: @json(_e('Can NOT move UP or DOWN in the status')),
-                    });
-                    return;
-                }
-
-                let data = {
-                    BdTableName: 'dbr_genio_bd',
-                    HdIdName: 'genio_id',
-                    HdId: parseInt(bd.GenioId),
-                    CurrId: parseInt(bd.Id),
-                    Move: move,
-                }
-
-                $('#down-btn').prop('disabled', true);
-                $('#up-btn').prop('disabled', true);
-                await Btype.seq_no_up_down(move, data, '#correct-tab #genio-table-body', index, 'GenioCorrect')
-                $('#down-btn').prop('disabled', false);
-                $('#up-btn').prop('disabled', false);
-            };
-
-            // start body act btn
-            GenioCorrect.override_btn_bd_act_multi_update = function () {
-                console.log('GenioCorrect.override_btn_bd_act_multi_update')
-                Btype.btn_bd_act_multi_update('#correct-tab .genio-table', 'GenioCorrect')
-            };
-
-            GenioCorrect.override_btn_bd_act_multi_delete = function () {
-                console.log('GenioCorrect.override_btn_bd_act_multi_delete')
-                Btype.btn_bd_act_multi_delete('#correct-tab .genio-table', 'GenioCorrect')
-            };
-
-            GenioCorrect.btn_bd_act_add = async function () {
-                console.log('GenioCorrect.btn_bd_act_add')
-                if (parseInt($(`#frm`).find(`input[name="Id"]`).val()) == 0) {
-                    if (! await Btype.btn_act_add_chain('#genio-form #frm')) { return }
-                }
-
-                if (! Btype.last_item_added_check('#correct-tab #genio-table-body', 'GenioCorrect')) {
-                    GenioCorrect.add_tr();
-                }
-            };
-            // end body act btn
-
-            GenioCorrect.add_tr = async function () {
-                console.log('GenioCorrect.add_tr')
-                let last_bd_id_inc = 0;
-                if (GenioCorrect.bd_page.length > 0) {
-                    last_bd_id_inc = GenioCorrect.bd_page[GenioCorrect.bd_page.length - 1].cursorId + 1 || 0
-                }
-
-                let html =
-                `<tr>
-                        <td class="text-${formB.ListVars['Align'].$Radio} px-import-0" ${formB.ListVars['Hidden'].$Radio}>
-                            <input name="bd-cursor-state" type="radio" value="1" tabindex="-1"
-                            class="text-${formB.ListVars['Align'].$Radio}"
-                            id="bd-cursor-state-${last_bd_id_inc}"
-                            onclick="Btype.bd_cursor_click(this)">
-                        </td>
-                        <td class="text-${formB.ListVars['Align'].$Check} px-import-0">
-                            <input name="bd-cud-check" type="checkbox" value="1" tabindex="-1"
-                            class="text-${formB.ListVars['Align'].$Check}">
-                        </td>
-                        <td onkeydown="Btype.enterPressedinCell(event, 1, 'GenioCorrect')"
-                            class="text-${formB.ListVars['Align'].ItemCode}" ${formB.ListVars['Hidden'].ItemCode}
-                            >
-                            <input type="text" class="text-${formB.ListVars['Align'].ItemCode} border-0 bg-white" readonly
-                            onchange="Btype.check_the_checkbox_when_changing(this, true, 'GenioCorrect')"
-                            id="item-code-${last_bd_id_inc}" required>
-                        </td>
-                        <td onkeydown="Btype.enterPressedinCell(event, 2, 'GenioCorrect')"
-                            class="text-${formB.ListVars['Align'].ItemName}" ${formB.ListVars['Hidden'].ItemName}
-                            >
-                            <input type="text" class="text-${formB.ListVars['Align'].ItemName} border-0 bg-white" readonly
-                            onchange="Btype.check_the_checkbox_when_changing(this, true, 'GenioCorrect')" required>
-                        </td>
-                        <td
-                            class="text-${formB.ListVars['Align'].SubName}" ${formB.ListVars['Hidden'].SubName}>
-                        </td>
-                        <td
-                            class="text-${formB.ListVars['Align'].CountUnit}" ${formB.ListVars['Hidden'].CountUnit}>
-                        </td>
-                        <td onkeydown="Btype.handleEnterPressedinTabCell(event)"
-                            class="text-${formB.ListVars['Align'].GenioQty}" ${formB.ListVars['Hidden'].GenioQty}
-                            >
-                            <input type="text" class="text-${formB.ListVars['Align'].GenioQty} border-0 bg-white" readonly
-                            onchange="Btype.check_the_checkbox_when_changing(this, true, 'GenioCorrect')"
-                            onfocusout="GenioCorrect.override_amt_calc_txt_is_changed()"
-                            required>
-                        </td>
-                        <td onkeydown="Btype.handleEnterPressedinTabCell(event)"
-                            class="text-${formB.ListVars['Align'].GenioPrc}" ${formB.ListVars['Hidden'].GenioPrc}
-                            >
-                            <input type="text" class="text-${formB.ListVars['Align'].GenioPrc} border-0 bg-white" readonly
-                            onchange="Btype.check_the_checkbox_when_changing(this, true, 'GenioCorrect')"
-                            onfocusout="GenioCorrect.override_amt_calc_txt_is_changed()"
-                            required>
-                        </td>
-                        <td onkeydown="Btype.handleEnterPressedinTabCell(event)"
-                            class="text-${formB.ListVars['Align'].SupplyAmt}" ${formB.ListVars['Hidden'].SupplyAmt}
-                            >
-                            <input type="text" class="text-${formB.ListVars['Align'].SupplyAmt} border-0 bg-white" readonly
-                            onchange="Btype.check_the_checkbox_when_changing(this, true, 'GenioCorrect')"
-                            onfocusout="GenioCorrect.override_custom_supply_amt_or_vat_amt()"
-                            required>
-                        </td>
-                        <td onkeydown="Btype.handleEnterPressedinTabCell(event)"
-                            class="text-${formB.ListVars['Align'].VatAmt}" ${formB.ListVars['Hidden'].VatAmt}
-                            >
-                            <input type="text" class="text-${formB.ListVars['Align'].VatAmt} border-0 bg-white" readonly
-                            onchange="Btype.check_the_checkbox_when_changing(this, true, 'GenioCorrect')"
-                            onfocusout="GenioCorrect.override_custom_supply_amt_or_vat_amt()"
-                            required>
-                        </td>
-                        <td onkeydown="Btype.handleEnterPressedinTabCell(event)"
-                            class="text-${formB.ListVars['Align'].SumAmt}" ${formB.ListVars['Hidden'].SumAmt}
-                            >
-                            <input type="text" class="text-${formB.ListVars['Align'].SumAmt} border-0 bg-white" readonly
-                            onchange="Btype.check_the_checkbox_when_changing(this, true, 'GenioCorrect')"
-                            onfocusout="GenioCorrect.override_custom_sum_amt()"
-                            required>
-                        </td>
-                        <td onkeydown="Btype.handleEnterPressedinTabCell(event)"
-                            class="text-${formB.ListVars['Align'].Ref1}" ${formB.ListVars['Hidden'].Ref1}
-                            >
-                            <input type="text" class="text-${formB.ListVars['Align'].Ref1} border-0 bg-white ref1-txt" readonly
-                            onchange="Btype.check_the_checkbox_when_changing(this, true, 'GenioCorrect')"
-                            onfocusout="GenioCorrect.save_data_when_entering_text()">
-                        </td>
-                        <td onkeydown="Btype.handleEnterPressedinTabCell(event)"
-                            data-last=true onfocusout="GenioCorrect.add_td_last_tap_out(this, ${last_bd_id_inc})"
-                            class="text-${formB.ListVars['Align'].Ref2}" ${formB.ListVars['Hidden'].Ref2}
-                            >
-                            <input type="text" class="text-${formB.ListVars['Align'].Ref2} border-0 bg-white ref2-txt" readonly
-                            onchange="Btype.check_the_checkbox_when_changing(this, true, 'GenioCorrect')"
-                            onfocusout="GenioCorrect.save_data_when_entering_text()">
-                        </td>
-                        <td
-                            class="text-${formB.ListVars['Align'].GenioMemo}" ${formB.ListVars['Hidden'].GenioMemo}>
-                            <textarea style="max-height: 30px;" class="rounded w-100 bg-white memo-textarea"
-                                ondblclick="Btype.dblclick_memo_textarea(this, ${last_bd_id_inc}, 'GenioCorrect')" id="memo-textarea-${last_bd_id_inc}" role="button" readonly></textarea>
-                        </td>
-                    </tr>`;
-
-
-                $('#correct-tab').find('#genio-table-body').append(html)
-
-                await setTimeout( function() {
-                    $('#correct-tab').find(`#bd-cursor-state-${last_bd_id_inc}`).trigger('click')
-                    $('#correct-tab').find(`#item-code-${last_bd_id_inc}`).focus()
-                }, 100);
-
-                GenioCorrect.bd_page.push({
-                    cursorId: last_bd_id_inc,
-                    Id: 0,
-                    ItemId: 0,
-                    ItemCode: '',
-                    ItemName: '',
-                    SubName: '',
-                    CountUnit: '',
-                    SeqNo: 0,
-                    GenioId: parseInt($(`#frm`).find(`input[name="Id"]`).val()),
-                    GenioPrc: 0,
-                    GenioQty: 0,
-                    GenioSupply: 0,
-                    GenioVat: 0,
-                    GenioSum: 0,
-                    Ref1: '',
-                    Ref2: '',
-                    GenioMemo: '',
-                })
-            };
-
-
-            GenioCorrect.create_bd_page = function () {
-                console.log('GenioCorrect.create_bd_page')
-                let html = []
-                let qty_total = 0, supply_total = 0, vat_amt_vat_total = 0, sum_total = 0;
-                GenioCorrect.bd_page.forEach(bd => {
-                    qty_total += parseFloat(bd.GenioQty);
-                    supply_total += parseFloat(bd.GenioSupply);
-                    vat_amt_vat_total += parseFloat(bd.GenioVat);
-                    sum_total += parseFloat(bd.GenioSum);
-
-                    // 품목코드, 수량, 단가, 공급가액, 세액, 합계금액
-                    html.push (
-                    `<tr>
-                        <td class="text-${formB.ListVars['Align'].$Radio} px-import-0" ${formB.ListVars['Hidden'].$Radio}>
-                            <input name="bd-cursor-state" type="radio" value="1" tabindex="-1"
-                            class="text-${formB.ListVars['Align'].$Radio}"
-                            onclick="Btype.bd_cursor_click(this)">
-                        </td>
-                        <td class="text-${formB.ListVars['Align'].$Check} px-import-0">
-                            <input name="bd-cud-check" type="checkbox" value="1" tabindex="-1"
-                            class="text-${formB.ListVars['Align'].$Check}">
-                        </td>
-                        <td onkeydown="Btype.enterPressedinCell(event, 1, 'GenioCorrect')"
-                            class="text-${formB.ListVars['Align'].ItemCode}" ${formB.ListVars['Hidden'].ItemCode}
-                            >
-                            <input type="text" class="text-${formB.ListVars['Align'].ItemCode} border-0 bg-white" value="${bd.ItemCode}" readonly
-                            onchange="Btype.check_the_checkbox_when_changing(this, true, 'GenioCorrect')" required>
-                        </td>
-                        <td onkeydown="Btype.enterPressedinCell(event, 2, 'GenioCorrect')"
-                            class="text-${formB.ListVars['Align'].ItemName}" ${formB.ListVars['Hidden'].ItemName}
-                            >
-                            <input type="text" class="text-${formB.ListVars['Align'].ItemName} border-0 bg-white" value="${bd.ItemName}" readonly
-                            onchange="Btype.check_the_checkbox_when_changing(this, true, 'GenioCorrect')" required>
-                        </td>
-                        <td
-                            class="text-${formB.ListVars['Align'].SubName}" ${formB.ListVars['Hidden'].SubName}>${bd.SubName}
-                        </td>
-                        <td
-                            class="text-${formB.ListVars['Align'].CountUnit}" ${formB.ListVars['Hidden'].CountUnit}>${bd.CountUnit}
-                        </td>
-                        <td onkeydown="Btype.handleEnterPressedinTabCell(event)"
-                            class="text-${formB.ListVars['Align'].GenioQty}" ${formB.ListVars['Hidden'].GenioQty}
-                            >
-                            <input type="text" class="text-${formB.ListVars['Align'].GenioQty} border-0 bg-white" value="${format_conver_for(bd.GenioQty, formB.ListVars['Format'].GenioQty)}" readonly
-                            onchange="Btype.check_the_checkbox_when_changing(this, true, 'GenioCorrect')"
-                            onfocusout="GenioCorrect.override_amt_calc_txt_is_changed()"
-                            required>
-                        </td>
-                        <td onkeydown="Btype.handleEnterPressedinTabCell(event)"
-                            class="text-${formB.ListVars['Align'].GenioPrc}" ${formB.ListVars['Hidden'].GenioPrc}
-                            >
-                            <input type="text" class="text-${formB.ListVars['Align'].GenioPrc} border-0 bg-white" value="${format_conver_for(bd.GenioPrc, formB.ListVars['Format'].GenioPrc)}" readonly
-                            onchange="Btype.check_the_checkbox_when_changing(this, true, 'GenioCorrect')"
-                            onfocusout="GenioCorrect.override_amt_calc_txt_is_changed()"
-                            required>
-                        </td>
-                        <td onkeydown="Btype.handleEnterPressedinTabCell(event)"
-                            class="text-${formB.ListVars['Align'].SupplyAmt}" ${formB.ListVars['Hidden'].SupplyAmt}
-                            >
-                            <input type="text" class="text-${formB.ListVars['Align'].SupplyAmt} border-0 bg-white" value="${format_conver_for(bd.GenioSupply, formB.ListVars['Format'].SupplyAmt)}" readonly
-                            onchange="Btype.check_the_checkbox_when_changing(this, true, 'GenioCorrect')"
-                            onfocusout="GenioCorrect.override_custom_supply_amt_or_vat_amt()"
-                            required>
-                        </td>
-                        <td onkeydown="Btype.handleEnterPressedinTabCell(event)"
-                            class="text-${formB.ListVars['Align'].VatAmt}" ${formB.ListVars['Hidden'].VatAmt}
-                            >
-                            <input type="text" class="text-${formB.ListVars['Align'].VatAmt} border-0 bg-white" value="${format_conver_for(bd.GenioVat, formB.ListVars['Format'].VatAmt)}" readonly
-                            onchange="Btype.check_the_checkbox_when_changing(this, true, 'GenioCorrect')"
-                            onfocusout="GenioCorrect.override_custom_supply_amt_or_vat_amt()"
-                            required>
-                        </td>
-                        <td onkeydown="Btype.handleEnterPressedinTabCell(event)"
-                            class="text-${formB.ListVars['Align'].SumAmt}" ${formB.ListVars['Hidden'].SumAmt}
-                            >
-                            <input type="text" class="text-${formB.ListVars['Align'].SumAmt} border-0 bg-white" value="${format_conver_for(bd.GenioSum, formB.ListVars['Format'].SumAmt)}" readonly
-                            onchange="Btype.check_the_checkbox_when_changing(this, true, 'GenioCorrect')"
-                            onfocusout="GenioCorrect.override_custom_sum_amt()"
-                            required>
-                        </td>
-                        <td onkeydown="Btype.handleEnterPressedinTabCell(event)"
-                            class="text-${formB.ListVars['Align'].Ref1}" ${formB.ListVars['Hidden'].Ref1}
-                            >
-                            <input type="text" class="text-${formB.ListVars['Align'].Ref1} border-0 bg-white ref1-txt" value="${bd.Ref1}" readonly
-                            onchange="Btype.check_the_checkbox_when_changing(this, true, 'GenioCorrect')"
-                            onfocusout="GenioCorrect.save_data_when_entering_text()">
-                        </td>
-                        <td onkeydown="Btype.handleEnterPressedinTabCell(event)"
-                            onfocusout="GenioCorrect.add_td_last_tap_out(this, ${bd.Id})"
-                            class="text-${formB.ListVars['Align'].Ref2}" ${formB.ListVars['Hidden'].Ref2}
-                            >
-                            <input type="text" class="text-${formB.ListVars['Align'].Ref2} border-0 bg-white ref2-txt" value="${bd.Ref2}" readonly
-                            onchange="Btype.check_the_checkbox_when_changing(this, true, 'GenioCorrect')"
-                            onfocusout="GenioCorrect.save_data_when_entering_text()">
-                        </td>
-                        <td
-                            class="text-${formB.ListVars['Align'].GenioMemo}" ${formB.ListVars['Hidden'].GenioMemo}>
-                            <textarea style="max-height: 30px;" class="rounded w-100 bg-white memo-textarea" id="memo-textarea-${bd.Id}"
-                                ondblclick="Btype.dblclick_memo_textarea(this, ${bd.Id}, 'GenioCorrect')" role="button" readonly>${bd.GenioMemo}</textarea>
-                        </td>
-                    </tr>` )
-                });
-
-                $('#QtyTotal').val(format_conver_for(qty_total, formB.ListVars['Format'].PorderQty));
-                $('#SupplyTotal').val(format_conver_for(supply_total, formB.ListVars['Format'].SupplyAmt));
-                $('#VatTotal').val(format_conver_for(vat_amt_vat_total, formB.ListVars['Format'].VatAmt));
-                $('#SumTotal').val(format_conver_for(sum_total, formB.ListVars['Format'].SumAmt));
-
-                document.getElementById('genio-table-body').innerHTML = html.join('');
-                // $('#correct-tab').find('#genio-table-body').html(html);
-            };
-
-            GenioCorrect.override_amt_calc_txt_is_changed = function () {
-                console.log('GenioCorrect.override_amt_calc_txt_is_changed')
-                let tr = $('#correct-tab').find(`input[name='bd-cursor-state']:checked`).closest('tr')
-                let index = $(tr).prevAll().length
-                let supply_amt, vat_amt, sum_amt;
-
-                Btype.amt_calc_txt_is_changed(tr, function (bd) {
-                    console.log('Btype.amt_calc_txt_is_changed.bd', bd)
-                    [supply_amt, vat_amt, sum_amt] = Btype.amt_calc(bd, parseFloat($('#vat-type-select').find('option:selected').data('vatrate')));
-
-                    if (isNaN(bd.pquote_prc)) return;
-
-                    $(tr).children('td:eq(6)').find('input').val(bd.pquote_qty.toFixed(window.User['StockQtyPoint']))
-                    $(tr).children('td:eq(7)').find('input').val(bd.pquote_prc.toFixed(window.User['StockPrcPoint']))
-
-                    $(tr).children('td:eq(8)').find('input').val(supply_amt.toFixed(window.User['StockAmtPoint']))
-                    $(tr).children('td:eq(9)').find('input').val(vat_amt.toFixed(window.User['StockAmtPoint']))
-                    $(tr).children('td:eq(10)').find('input').val(sum_amt.toFixed(window.User['StockAmtPoint']))
-
-                    GenioCorrect.bd_page[index].GenioPrc = bd.pquote_prc
-                    GenioCorrect.bd_page[index].GenioQty = bd.pquote_qty
-                    GenioCorrect.bd_page[index].GenioSupply = supply_amt
-                    GenioCorrect.bd_page[index].GenioVat = vat_amt
-                    GenioCorrect.bd_page[index].GenioSum = sum_amt
-                })
-            }
-
-            GenioCorrect.override_custom_supply_amt_or_vat_amt = function () {
-                console.log('GenioCorrect.override_custom_supply_amt_or_vat_amt')
-                Btype.custom_supply_amt_or_vat_amt(function (supply_amt, vat_amt, sum_amt, index) {
-                    GenioCorrect.bd_page[index].GenioSupply = supply_amt
-                    GenioCorrect.bd_page[index].GenioVat = vat_amt
-                    GenioCorrect.bd_page[index].GenioSum = sum_amt
-                })
-            }
-
-            GenioCorrect.override_custom_sum_amt = function () {
-                console.log('GenioCorrect.override_custom_sum_amt')
-                Btype.custom_sum_amt(function (sum_amt, index) {
-                    GenioCorrect.bd_page[index].GenioSum = sum_amt
-                })
-            }
-
-            GenioCorrect.save_data_when_entering_text = function () {
-                console.log('GenioCorrect.save_data_when_entering_text')
-                let tr = $('#correct-tab').find(`input[name='bd-cursor-state']:checked`).closest('tr')
-                let index = $(tr).prevAll().length
-
-                GenioCorrect.bd_page[index].Ref1 = $(tr).find('.ref1-txt').val()
-                GenioCorrect.bd_page[index].Ref2 = $(tr).find('.ref2-txt').val()
-            }
-
-            GenioCorrect.set_item_data_to_textbox = function (item) {
-                console.log('GenioCorrect.set_item_data_to_textbox')
-                let tr = $('#correct-tab').find(`input[name='bd-cursor-state']:checked`).closest('tr')
-                $(tr).children('td:eq(2)').find('input').val(item.ItemCode)
-                $(tr).children('td:eq(3)').find('input').val(item.ItemName)
-                $(tr).children('td:eq(4)').text(item.SubName)
-                $(tr).children('td:eq(5)').text(item.CountUnit)
-                $(tr).children('td:eq(6)').find('input').val(1)
-                $(tr).children('td:eq(7)').find('input').val(parseFloat(item.PurchPrc).toFixed(window.User['PurchPrcPoint']))
-
-                let index = $(tr).prevAll().length;
-                GenioCorrect.bd_page[index].ItemId = item.Id
-                GenioCorrect.bd_page[index].ItemCode = item.ItemCode
-                GenioCorrect.bd_page[index].ItemName = item.ItemName
-                GenioCorrect.bd_page[index].SubName = item.SubName
-                GenioCorrect.bd_page[index].CountUnit = item.CountUnit
-                GenioCorrect.bd_page[index].GenioPrc = item.PurchPrc
-
-                if (GenioCorrect.bd_page[index].Id === 0) {
-                    $(tr).children('td:eq(13)').find('textarea').val(item.ItemMemo)
-                    GenioCorrect.bd_page[index].GenioMemo = item.ItemMemo
-                }
-
-                return $(tr).children('td:eq(6)').find('input')
-            }
-
-            GenioCorrect.amt_total_calc = function () {
-                console.log('GenioCorrect.amt_total_calc')
-                let qty_total = 0, supply_total = 0, vat_amt_vat_total = 0, sum_total = 0;
-
-                GenioCorrect.bd_page.forEach(bd => {
-                    qty_total += parseFloat(bd.GenioQty);
-                    supply_total += parseFloat(bd.GenioSupply);
-                    vat_amt_vat_total += parseFloat(bd.GenioVat);
-                    sum_total += parseFloat(bd.GenioSum);
-                })
-
-                $('#QtyTotal').val(format_conver_for(qty_total, formB.ListVars['Format'].GenioQty));
-                $('#SupplyTotal').val(format_conver_for(supply_total, formB.ListVars['Format'].SupplyAmt));
-                $('#VatTotal').val(format_conver_for(vat_amt_vat_total, formB.ListVars['Format'].VatAmt));
-                $('#SumTotal').val(format_conver_for(sum_total, formB.ListVars['Format'].SumAmt));
-            }
-
-            GenioCorrect.custom_body_act_success_callback = function ($this, tr) {
-                console.log('GenioCorrect.custom_body_act_success_callback')
-                // 합계 계산
-                GenioCorrect.amt_total_calc();
-
-                let qty = $(tr).children('td:eq(6)').find('input')
-                let prc = $(tr).children('td:eq(7)').find('input')
-                let supply_amt = $(tr).children('td:eq(8)').find('input')
-                let vat_amt = $(tr).children('td:eq(9)').find('input')
-                let sum_amt = $(tr).children('td:eq(10)').find('input')
-
-                $(qty).val( format_conver_for(minusComma($(qty).val()), formB.ListVars['Format'].GenioQty) )
-                $(prc).val( format_conver_for(minusComma($(prc).val()), formB.ListVars['Format'].GenioPrc) )
-                $(supply_amt).val( format_conver_for(minusComma($(supply_amt).val()), formB.ListVars['Format'].SupplyAmt) )
-                $(vat_amt).val( format_conver_for(minusComma($(vat_amt).val()), formB.ListVars['Format'].VatAmt) )
-                $(sum_amt).val( format_conver_for(minusComma($(sum_amt).val()), formB.ListVars['Format'].SumAmt) )
-
-                if ($($this).data('last')) {
-                    GenioCorrect.add_tr();
-                    $($this).data('last', false)
-                }
-                iziToast.success({
-                    title: 'Success',
-                    message: $('#action-completed').text(),
-                });
-            }
-
-            GenioCorrect.add_td_last_tap_out = async function ($this, id) {
-                console.log('add_td_last_tap_out')
-                let tr = $('#correct-tab').find(`input[name='bd-cursor-state']:checked`).closest('tr')
-                let index = $(tr).prevAll().length
-
-                // 필수텍스트가 안비어있으고 fouces out == 다음 tr 추가
-                if (GenioCorrect.bd_page[index].ItemId != 0 && ! window.dom_required_check($(tr).find(`input`))) {
-                    if ($($this).data('last')) {
-                        let seq_no = await Btype.get_last_seq_no('genio', $('#correct-tab').find('.auto-slip-no-txt').val())
-                        GenioCorrect.bd_page[index].SeqNo = seq_no;
-                    }
-
-                    Btype.call_bd_act_api([ GenioCorrect.get_bd_parameter(GenioCorrect.bd_page[index]) ], function (page) {
-                        GenioCorrect.bd_page[index].Id = page[0].Id;
-
-                        GenioCorrect.custom_body_act_success_callback($this, tr);
-                        Btype.check_the_checkbox_when_changing($this, false, 'GenioCorrect')
-                    }, 'GenioCorrect');
-                } else {
-                    iziToast.error({
-                        title: 'Error',
-                        message: @json(_e('(*)Required item(s) omitted')),
-                    });
-                }
-            }
-
-            GenioCorrect.get_bd_parameter = function (bd) {
-                console.log('GenioCorrect.get_bd_parameter : ')
-                console.log('bd. : ', bd)
-                let id = parseInt(bd.Id);
-
-                let parameter = {
-                    Id: id,
-                    CreatedOn: get_now_time_stamp(),
-                    UpdatedOn: get_now_time_stamp(),
-                    GenioId: parseInt(bd.GenioId),
-                    SeqNo: bd.SeqNo,
-                    ItemId: parseInt(bd.ItemId),
-                    GenioQty: String(bd.GenioQty),
-                    GenioPrc: String(bd.GenioPrc),
-                    GenioSupply: String(bd.GenioSupply),
-                    GenioVat: String(bd.GenioVat),
-                    GenioSum: String(bd.GenioSum),
-                    Ref1: bd.Ref1,
-                    Ref2: bd.Ref2,
-                    GenioMemo: bd.GenioMemo,
-                    Ip: window.User['Ip']
-                }
-
-                if (id < 0) {
-                    parameter = { Id: id }
-                } else if (id > 0) {
-                    delete parameter.CreatedOn;
-                } else {
-                    delete parameter.UpdatedOn;
-                }
-
-                // console.log(parameter)
-                return parameter;
-            }
-
-            GenioCorrect.override_get_item_id = function (item_id) {
-                Btype.get_item_id(item_id, 'GenioCorrect')
-            }
-
-            GenioCorrect.update_bd_ui = function (bd_page) {
-                console.log('GenioCorrect.update_bd_ui : ', bd_page)
-                GenioCorrect.bd_page = bd_page;
-                // table body에 데이터 추가
-                GenioCorrect.create_bd_page();
-
-                if (GenioCorrect.bd_page.length > 0) {
-                    let unique = GenioCorrect.bd_page[GenioCorrect.bd_page.length - 1].SeqNo * GenioCorrect.bd_page[GenioCorrect.bd_page.length - 1].Id + rand(1, 999);
-                    GenioCorrect.bd_page[GenioCorrect.bd_page.length - 1].cursorId = unique
-                }
-            }
-
-        }( window.GenioCorrect = window.GenioCorrect || {}, jQuery ));
-    </script>
-@endpush

+ 1 - 1
resources/views/front/dabory/erp/stock/tab/genio-correct.blade.php

@@ -120,7 +120,7 @@
         $('#genio-table-body').on('click', 'tr', function() {
                 // Find the input element with name="bd-cursor-state" within the clicked row
                 const $bdCursorStateInput = $(this).find('input[name="bd-cursor-state"]');
-                // console.log('bdCursorStateInput : ', $bdCursorStateInput)
+                console.log('bdCursorStateInput : ', $bdCursorStateInput)
                 if ($bdCursorStateInput.length) {
                     $($bdCursorStateInput).prop('checked', true)
                     Btype.bd_cursor_click($bdCursorStateInput)