hokky 4 months ago
parent
commit
28f07768dc
28 changed files with 1632 additions and 318 deletions
  1. 1 0
      app/Http/Controllers/Front/Dabory/Erp/Sales/SquoteController.php
  2. 6 2
      app/Http/Controllers/Front/Dabory/Erp/Stock/GenioController.php
  3. 1 0
      app/Http/Middleware/Shop/HeaderData.php
  4. 1 0
      app/Models/Cache/ProApiCache.php
  5. 0 11
      bootstrap/cache/packages.php
  6. 23 25
      bootstrap/cache/services.php
  7. 248 171
      composer.lock
  8. 14 0
      dabory/para/erp/ko_KR/etc/code-title/status/genio.json
  9. 1 8
      dabory/para/erp/ko_KR/form/form-b/etc.json
  10. 7 7
      dabory/para/erp/ko_KR/form/form-b/genio.json
  11. 2 2
      dabory/para/erp/ko_KR/form/form-b/sales/squote.json
  12. 2 2
      dabory/para/erp/ko_KR/search/slip-search/stock/genio.json
  13. 1 1
      dabory/para/erp/ko_KR/search/slip-search/user-perm.json
  14. 0 5
      dabory/para/pro/ko_KR/popup/popup-form1/form-a/ssh-app.json--
  15. 3 0
      dcon
  16. 0 8
      index.html
  17. 1 8
      public/chat-ui/build/index-d3.js
  18. 45 7
      public/js/modals-controller/b-type/common.js
  19. 1 0
      public/js/modals-controller/b-type/slip.js
  20. 0 1
      public/js/utils/check-dom.js
  21. 1 0
      public/js/utils/lib.js
  22. 2 1
      resources/views/front/dabory/erp/sales/squote.blade.php
  23. 500 0
      resources/views/front/dabory/erp/stock/genio.blade copy.php
  24. 66 36
      resources/views/front/dabory/erp/stock/genio.blade.php
  25. 631 0
      resources/views/front/dabory/erp/stock/tab/genio-correct.blade copy.php
  26. 33 21
      resources/views/front/dabory/erp/stock/tab/genio-correct.blade.php
  27. 4 2
      resources/views/front/outline/static/slip.blade.php
  28. 38 0
      settings_erp.sh

+ 1 - 0
app/Http/Controllers/Front/Dabory/Erp/Sales/SquoteController.php

@@ -16,6 +16,7 @@ class SquoteController extends Controller
         // dump(session('GateToken'));
         try {
             $formB = new FormB(request('bpa'));
+            // dd($formB);
             $squoteModal = (new Modal('/search/slip-search/sales/squote'))->getData();
             $companyModal = (new Modal('/search/company-search/all'))->getData();
             $itemModal = (new Modal('/search/item-search/supplier'))->getData();

+ 6 - 2
app/Http/Controllers/Front/Dabory/Erp/Stock/GenioController.php

@@ -28,6 +28,10 @@ class GenioController extends Controller
 
         $menuCode = Utils::bpaDecoding(request('bpa'))['menu_code'];
 
+        $slipFormInitCacheData = Utils::getSlipFormInitCache(
+            $formB->getData()['formB']['QueryVars']['QueryName']
+        );
+
         $pickCacheData = Utils::getParamCache($menuCode,
             $formB->getData()['formB']['General']['PickApi'],
             $formB->getData()['formB']['QueryVars']['QueryName']);
@@ -43,8 +47,8 @@ class GenioController extends Controller
                 compact('menuCode'),
                 $formB->getData(),
                 compact('genioModal', 'companyModal', 'itemModal'),
-                compact('pickCacheData', 'slipCacheData'),
+                compact('pickCacheData', 'slipCacheData', 'slipFormInitCacheData'),
             )
-        )->with('codeTitle', [ "deal_type('deal-type')" ]);
+        )->with('codeTitle', [ "deal_type('deal-type')", "status('genio')" ]);
     }
 }

+ 1 - 0
app/Http/Middleware/Shop/HeaderData.php

@@ -28,6 +28,7 @@ class HeaderData
         })->toArray();
         $mainMenuList = Utils::formatMenuList($mainMenuPermPage, 'MenuCode');
         $topMenuList = Utils::formatMenuList($topMenuPermPage, 'MenuCode');
+        dd($topMenuList);
 
         $headerPart = app(CallApiService::class)->callApi([
             'url' => 'list-type1-book',

+ 1 - 0
app/Models/Cache/ProApiCache.php

@@ -10,6 +10,7 @@ class ProApiCache
     public function getCachedResponse($url, $filePath)
     {
         $responseFilePath = $this->getFullFilePath($filePath, 'response');
+        echo "getCachedResponse() : ".$responseFilePath;
         // 1. $filePath reponse를 먼저 읽어온다.
         if (Storage::disk('dabory')->exists($responseFilePath)) {
             return json_decode(Storage::disk('dabory')->get($responseFilePath), true);

+ 0 - 11
bootstrap/cache/packages.php

@@ -201,15 +201,4 @@
       0 => 'SocialiteProviders\\Manager\\ServiceProvider',
     ),
   ),
-  'stevebauman/location' => 
-  array (
-    'providers' => 
-    array (
-      0 => 'Stevebauman\\Location\\LocationServiceProvider',
-    ),
-    'aliases' => 
-    array (
-      'Location' => 'Stevebauman\\Location\\Facades\\Location',
-    ),
-  ),
 );

+ 23 - 25
bootstrap/cache/services.php

@@ -46,19 +46,18 @@
     42 => 'NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider',
     43 => 'SimpleSoftwareIO\\QrCode\\QrCodeServiceProvider',
     44 => 'SocialiteProviders\\Manager\\ServiceProvider',
-    45 => 'Stevebauman\\Location\\LocationServiceProvider',
-    46 => 'App\\Providers\\AppServiceProvider',
-    47 => 'App\\Providers\\AuthServiceProvider',
-    48 => 'App\\Providers\\EventServiceProvider',
-    49 => 'App\\Providers\\RouteServiceProvider',
-    50 => 'App\\Providers\\GettextServiceProvider',
-    51 => 'App\\Providers\\ThirdPartyApiServiceServiceProvider',
-    52 => 'Maatwebsite\\Excel\\ExcelServiceProvider',
-    53 => 'SimpleSoftwareIO\\QrCode\\QrCodeServiceProvider',
-    54 => 'SocialiteProviders\\Manager\\ServiceProvider',
-    55 => 'Eusonlito\\LaravelMeta\\MetaServiceProvider',
-    56 => 'Jenssegers\\Agent\\AgentServiceProvider',
-    57 => 'Mews\\Captcha\\CaptchaServiceProvider',
+    45 => 'App\\Providers\\AppServiceProvider',
+    46 => 'App\\Providers\\AuthServiceProvider',
+    47 => 'App\\Providers\\EventServiceProvider',
+    48 => 'App\\Providers\\RouteServiceProvider',
+    49 => 'App\\Providers\\GettextServiceProvider',
+    50 => 'App\\Providers\\ThirdPartyApiServiceServiceProvider',
+    51 => 'Maatwebsite\\Excel\\ExcelServiceProvider',
+    52 => 'SimpleSoftwareIO\\QrCode\\QrCodeServiceProvider',
+    53 => 'SocialiteProviders\\Manager\\ServiceProvider',
+    54 => 'Eusonlito\\LaravelMeta\\MetaServiceProvider',
+    55 => 'Jenssegers\\Agent\\AgentServiceProvider',
+    56 => 'Mews\\Captcha\\CaptchaServiceProvider',
   ),
   'eager' => 
   array (
@@ -91,18 +90,17 @@
     26 => 'Carbon\\Laravel\\ServiceProvider',
     27 => 'NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider',
     28 => 'SimpleSoftwareIO\\QrCode\\QrCodeServiceProvider',
-    29 => 'Stevebauman\\Location\\LocationServiceProvider',
-    30 => 'App\\Providers\\AppServiceProvider',
-    31 => 'App\\Providers\\AuthServiceProvider',
-    32 => 'App\\Providers\\EventServiceProvider',
-    33 => 'App\\Providers\\RouteServiceProvider',
-    34 => 'App\\Providers\\GettextServiceProvider',
-    35 => 'App\\Providers\\ThirdPartyApiServiceServiceProvider',
-    36 => 'Maatwebsite\\Excel\\ExcelServiceProvider',
-    37 => 'SimpleSoftwareIO\\QrCode\\QrCodeServiceProvider',
-    38 => 'Eusonlito\\LaravelMeta\\MetaServiceProvider',
-    39 => 'Jenssegers\\Agent\\AgentServiceProvider',
-    40 => 'Mews\\Captcha\\CaptchaServiceProvider',
+    29 => 'App\\Providers\\AppServiceProvider',
+    30 => 'App\\Providers\\AuthServiceProvider',
+    31 => 'App\\Providers\\EventServiceProvider',
+    32 => 'App\\Providers\\RouteServiceProvider',
+    33 => 'App\\Providers\\GettextServiceProvider',
+    34 => 'App\\Providers\\ThirdPartyApiServiceServiceProvider',
+    35 => 'Maatwebsite\\Excel\\ExcelServiceProvider',
+    36 => 'SimpleSoftwareIO\\QrCode\\QrCodeServiceProvider',
+    37 => 'Eusonlito\\LaravelMeta\\MetaServiceProvider',
+    38 => 'Jenssegers\\Agent\\AgentServiceProvider',
+    39 => 'Mews\\Captcha\\CaptchaServiceProvider',
   ),
   'deferred' => 
   array (

File diff suppressed because it is too large
+ 248 - 171
composer.lock


+ 14 - 0
dabory/para/erp/ko_KR/etc/code-title/status/genio.json

@@ -0,0 +1,14 @@
+[
+    {
+        "Code": "",
+        "Title": "상태값 없음"
+    },
+    {
+        "Code": "0",
+        "Title": "확정"
+    },
+    {
+        "Code": "1",
+        "Title": "취소"
+    }
+]

+ 1 - 8
dabory/para/erp/ko_KR/form/form-b/etc.json

@@ -1,14 +1,7 @@
 {
     "General": {
-<<<<<<< HEAD
+
         "Title": "상용구 등록",
-=======
-<<<<<<< HEAD
-        "Title": "견적서 입력22",
-=======
-        "Title": "상용구 등록 수정",
->>>>>>> de268b261c1026ed4d343adc12455de4af8455c9
->>>>>>> 5493cdb8ebc6657b16a07ce5e5dcda085bc8ae46
         "PickApi": "slip-form-book",
         "ActApi": "squote-act"
     },

+ 7 - 7
dabory/para/erp/ko_KR/form/form-b/genio.json

@@ -56,11 +56,11 @@
         {
             "SaveButton": "저장",
             "AddNewBdButton": "품목 추가",
-            "AutoSlipNo": "수불번호(자동채번)*",
+            "AutoSlipNo": "수불번호*",
             "GenioDate": "수불일자*",
             "DealType": "거래구분*",
             "CompanyName": "거래업체*",
-            "Contact": "업체담당자*",
+            "Contact": "업체담당자",
             "Status": "상황",
             "VatType": "부가세*",
             "VatTypeRate": "부가세율",
@@ -120,7 +120,7 @@
             "GenioDate": "required",
             "DealType": "required",
             "CompanyName": "required",
-            "Contact": "required",
+            "Contact": "",
             "Status": "",
             "VatType": "required",
             "VatTypeRate": "",
@@ -138,7 +138,7 @@
     "// ListVars": "ListVars[0]-Caption, ListVars[1]-Size(%), ListVars[2]-align",
     "ListVars": [
         {
-            "$Radio": "$Radio",
+            "$Radio": "",
             "$Check": "$Check",
             "ItemCode": "품목코드*",
             "ItemName": "품명*",
@@ -154,7 +154,7 @@
             "GenioMemo": "품목설명(M)"
         },
         {
-            "$Radio": "3",
+            "$Radio": "",
             "$Check": "3",
             "ItemCode": "8",
             "ItemName": "30",
@@ -170,9 +170,9 @@
             "GenioMemo": "10"
         },
         {
-            "$Radio": "center",
+            "$Radio": "",
             "$Check": "center",
-            "ItemCode": "center",
+            "ItemCode": "left",
             "ItemName": "left",
             "SubName": "left",
             "CountUnit": "center",

+ 2 - 2
dabory/para/erp/ko_KR/form/form-b/sales/squote.json

@@ -100,7 +100,7 @@
             "AutoSlipNo": "견적서 번호*",
             "Date": "일자*",
             "Supplier": "고객업체*",
-            "Input1": "견적제목*",
+            "Input1": "견적제목",
             "DealType": "거래구분*",
             "VatType": "부가세*",
             "VatTypeRate": "부가세율",
@@ -154,7 +154,7 @@
             "AutoSlipNo": "required",
             "Date": "required",
             "Supplier": "required",
-            "Input1": "required",
+            "Input1": "",
             "DealType": "required",
             "VatType": "required",
             "VaildPeriod": "",

+ 2 - 2
dabory/para/erp/ko_KR/search/slip-search/stock/genio.json

@@ -108,7 +108,7 @@
             "SetGroup": "담당부서",
             "Item": "대표품목",
             "Amt": "합계 금액",
-            "Status": "거래구분",
+            "Status": "상황",
             "Ref": "관련정보"
         },
         {
@@ -130,7 +130,7 @@
             "SetGroup": "left",
             "Item": "left",
             "Amt": "decimal('purch_amt')",
-            "Status": "deal_type('deal-type')",
+            "Status": "status('genio')",
             "Ref": "center"
         }
     ]

+ 1 - 1
dabory/para/erp/ko_KR/search/slip-search/user-perm.json

@@ -35,7 +35,7 @@
 
     "QuerySpeedOptions": [
         {
-            "Value": "normal",
+            "Value": "quick",
             "Caption": "빠른 검색"
         }
     ],

+ 0 - 5
dabory/para/pro/ko_KR/popup/popup-form1/form-a/ssh-app.json--

@@ -48,13 +48,8 @@
             "Keypair": "Keypair",
 
             "SecondCardTitle": "Information to create .env.dabory",
-<<<<<<< HEAD:dabory/para/pro/ko_KR/popup/popup-form1/form-a/ssh-app.json
-            "ApiHost": "API Host:Port* ex:34.56.78.99:18080",
-            "DbHost": "DB Host:Port* ex:34.56.78.99:3360 ㅋㅋㅋ",
-=======
             "ApiHost": "API Host:Port* ex)34.56.78.99:18080",
             "DbHost": "DB Host:Port* ex)34.56.78.99:3306",
->>>>>>> 6bc0fdc1685984cde84aab46da3a5a255491a645:public/para/dabory/pro/ko_KR/popup/popup-form1/form-a/ssh-app.json
             "DbUser": "DB User*",
             "DbPassword": "DB Password*",
             "DbName": "DB Name*",

+ 3 - 0
dcon

@@ -0,0 +1,3 @@
+
+docker_id="$1"
+winpty docker exec -it "${docker_id}" sh

+ 0 - 8
index.html

@@ -71,11 +71,7 @@ table.content_title td {
 		<td>
 			<table class="content">
 				<tr>
-<<<<<<< HEAD
-					<td><a href="http://mratwork.com/" title="Go to Kloxo-MR website"><img style="margin:5px; padding:5px; height:50px" class="logo" src="./images/kloxo-mr.png" alt="kloxo-mr-logo"></a></td>
-=======
 					<td><a href="http://kloxong.org" title="Go to Kloxo Next Generation website"><img style="margin:5px; padding:5px; height:50px" class="logo" src="./images/kloxong.png" alt="kloxong-logo"></a></td>
->>>>>>> 6b84ce84b666ed214c1f13b31200465c9e512481
 				</tr>
 
 			</table>
@@ -91,11 +87,7 @@ table.content_title td {
 			<tr>
 				<td><br>
 				<br>
-<<<<<<< HEAD
-				<b>Kloxo-MR Default Page for newerp.daboryhost.com</b> </td>
-=======
 				<b>Kloxo Next Generation Default Page for solution.dabory.com</b> </td>
->>>>>>> 6b84ce84b666ed214c1f13b31200465c9e512481
 			</tr>
 		</table>
 		<br>

+ 1 - 8
public/chat-ui/build/index-d3.js

@@ -442,15 +442,8 @@ var chatUI = (function (container) {
                 .attr('class', 'cb-waiting')
                 .html(animatedCircles);
 
-<<<<<<< HEAD
             d3.request('http://34.64.58.79:8080/chatgpt-ask2')
-=======
-<<<<<<< HEAD
-            d3.request('http://34.64.39.68:8080/chatgpt-ask2')
-=======
-            d3.request('http://34.64.58.79:8080/chatgpt-ask2')
->>>>>>> f7f231e84c7f03aa2980c405b9fe59fe6415b59b
->>>>>>> 789ae14e80d3e495d9874e82edd7d27ac1b48aa3
+
                 .header("Content-Type", "application/json")
                 .post(JSON.stringify({
                     message: message

+ 45 - 7
public/js/modals-controller/b-type/common.js

@@ -47,11 +47,8 @@
     };
     // 배열의 각 요소들을 순환하면서 option태그를 생성해줌
     Btype.create_deal_type_select_box_options = async function (page, dom_val = '#deal-type-select') {
-        console.log('page : ', page)
         // let page = await get_select_box_options_data('deal-type-page', 'deal_category="purch"')
         let html =  page.reduce(function (accumulator, item) {
-            console.log('accumulator : ', accumulator)
-            console.log('item : ', item)
             return accumulator + `<option value="${item.Id}">${item.DealName}</option>`;
         }, '');
         $(dom_val).append(html);
@@ -132,6 +129,9 @@
 
     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);
@@ -162,19 +162,26 @@
         });
     };
 
+    // input 요소를 통해 상위 요소 제어
     Btype.bd_cursor_click = function ($this) {
         let table = $($this).closest('table');
         let th = $(table).find('thead th');
         let tr = $($this).closest('tr');
 
+        // th 순회하며 #이 붙지 않은 요소들 활성/비활성화
         $(th).each(function (index) {
             if (! trim($(this).text()).includes('#')) {
                 Btype.able_or_disable_txt_box($(tr).children(`td:eq(${index})`).find('input'));
                 Btype.able_or_disable_txt_box($(tr).children(`td:eq(${index})`).find('select'));
             }
         })
+        // 현재 선택된 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')
         $(table).find(`input[name='${cursor}']`).each(function (i) {
             if (! $(this).is(':checked')) {
                 let tr = $(this).closest('tr');
@@ -187,8 +194,32 @@
                 })
             }
         })
+        // 현재 선택된 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);
+        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();
     };
 
     Btype.table_td_focus = function ($this) {
@@ -261,6 +292,7 @@
         next_input.focus();
     };
 
+    // 첫번째 필수항목(th) 찾기
     Btype.get_first_required_th_index = function (table, start_index) {
         let th = $(table).find('thead th')
         let first_index = start_index
@@ -614,8 +646,8 @@
     };
 
     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) } ] })
-        console.log('response : ', response);
         return response.data.Page[0]
     };
 
@@ -628,6 +660,7 @@
     };
 
     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);
 
@@ -673,6 +706,7 @@
     };
 
     Btype.btn_act_save = function (argObj = '#frm', callback = undefined, namespace = 'window') {
+        // argObj 입력창 필수요소 체크
         if (dom_required_check(`${argObj} input`) || dom_required_check(`${argObj} select`)) {
             iziToast.warning({
                 title: 'Warning',
@@ -681,9 +715,13 @@
             return false;
         }
 
-        Btype.call_act_api(eval(namespace).get_parameter(), function() {
+        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);
+
         return true;
     };
     // end head act btn

+ 1 - 0
public/js/modals-controller/b-type/slip.js

@@ -105,6 +105,7 @@ const slip = (function ($, window, document, undefined) {
                 make_pagination('slip', d.PageVars.QueryCnt, page, modal_class_name);
                 let no = get_table_no(d.PageVars.QueryCnt, page, limit);
                 for (let i in d.Page) {
+
                     const onclick = `${$this.data('clicked')}('${d.Page[i].SlipNo}')`;
                     html +=
                     `<tr>

+ 0 - 1
public/js/utils/check-dom.js

@@ -18,7 +18,6 @@ function dom_required_check(dom_val) {
     let msg = false;
 
     $(dom_val).each(function() {
-        // console.log($(this).val())
         let this_val = $(this).val() || ''
         if($(this).prop('required') && !this_val.co_trim()) {
             const label_txt = $(this).closest('.form-group').find('label').text()

+ 1 - 0
public/js/utils/lib.js

@@ -275,6 +275,7 @@ function format_result(data, format, display_vars = undefined) {
 }
 
 function format_conver_for(data, format, display_vars = undefined, is_split_column = false) {
+    console.log('format_conver_for');
     if (is_split_column) {
         if (format.includes('|')) {
             let data_list = data.split('|||');

+ 2 - 1
resources/views/front/dabory/erp/sales/squote.blade.php

@@ -282,8 +282,9 @@
 <script src="{{ csset('/js/modals-controller/b-type/common.js') }}"></script>
     <script>
         window.onload = async function () {
+            console.log('bd_page : ', bd_page)
             make_dynamic_table_css('.squote-table', make_dynamic_table_px(formB['ListVars']['Size']))
-
+            console.log('vat_name : ', $('#vat-type-select'))
             $('#squote-date').val(date_to_sting(new Date()))
 
             let sgroup_pick = await get_api_data('sgroup-pick', { Page: [ { Id:  parseInt(window.User['SgroupId']) } ] });

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

@@ -0,0 +1,500 @@
+@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

+ 66 - 36
resources/views/front/dabory/erp/stock/genio.blade.php

@@ -40,16 +40,19 @@
                                 <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'] }}</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>
+                                        <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>
@@ -100,9 +103,11 @@
                                         <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>
+                                            @foreach ($codeTitle['status']['genio'] as $key => $status)
+                                                <option value="{{ $status['Code'] }}">
+                                                    {{ $status['Title'] }}
+                                                </option>
+                                            @endforeach
                                         </select>
                                     </div>
                                 </div>
@@ -225,21 +230,19 @@
     <script>
         window.onload = async function () {
             $('#genio-date').val(date_to_sting(new Date()))
-            // api 통신해서 footer에 값 넣어줌
+
+            let sgroup_pick = await get_api_data('sgroup-pick', { Page: [ { Id:  parseInt(window.User['SgroupId']) } ] });
+            window.User['SgroupName'] = sgroup_pick['data']['Page'][0]['SgroupName']
             Btype.get_storage_name_and_branch_name()
-            // slip_form에 있는 테이블 데이터를 싹다 가져옴
-            let data = await Btype.get_slip_form_init()
-            console.log('data : ', data)
-            // 가져온 데이터를 기반으로
-            formB['SlipCommonSetup'] = data['SlipCommonSetup']
-            // 거래구분 select box 만들기 (DealTypePage 모든 행을 그대로 넣어줌)
-            await Btype.create_deal_type_select_box_options(data.DealTypePage)
-            //
-            await Btype.create_vat_type_select_box_options(data.VatRatePage)
-            //
-            await Btype.create_sgroup_select_box_options(data.SgroupPage)
-            //
-            await create_etc_select_box_options(data)
+            // let data = await Btype.get_slip_form_init()
+
+            slipInit = @json($slipFormInitCacheData);
+            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'])
 
@@ -248,15 +251,17 @@
 
                 if (! isEmpty(pickCacheData['query'])) {
                     let query = JSON.parse(pickCacheData['query'])
-                    if(query){
-                        console.log('query 있음');
-                        await Btype.fetch_slip_form_book(query['QueryVars']['FilterValue']);
-                    }else{
-                        console.log('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($(this).data('value'))
                 switch( $(this).data('value') ) {
@@ -277,7 +282,7 @@
 
             activate_button_group()
         }
-        // 여기까지 봄
+
         function set_company_data_to_textbox(company) {
             get_override_supplier_id(company.Id)
             return $('.save-button')
@@ -285,7 +290,6 @@
 
         function btn_act_new() {
             GenioCorrect.bd_page = [];
-
             input_box_reset_for('#frm', ['user-txt'])
             input_box_reset_for('#total-frm')
             $('#supplier-txt').data('id', 0)
@@ -308,6 +312,21 @@
         }
 
         function 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 + ')'
+            }
+            const itmtot_amt = GenioCorrect.bd_page.reduce((accumulator, bd) => {
+                return accumulator + parseFloat(bd.GenioSupply)
+            }, 0)
             let id = parseInt($(`#frm`).find(`input[name="Id"]`).val());
             let parameter = {
                 Id: id,
@@ -328,7 +347,16 @@
                 Column1: $('#column1-select').val(),
                 Column2: $('#column2-select').val(),
                 Remarks: $('#remarks-txt-area').val(),
-                Ip: window.User['Ip']
+                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 }
@@ -449,5 +477,7 @@
         const slipCacheData = {!! json_encode($slipCacheData) !!};
         const pickCacheData = {!! json_encode($pickCacheData) !!};
         var formB = {!! json_encode($formB) !!};
+        let slipInit = null;
+
     </script>
 @endsection

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

@@ -0,0 +1,631 @@
+<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

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

@@ -113,8 +113,20 @@
                     }, 'GenioCorrect')
                 }
             });
+
+
         });
 
+        $('#genio-table-body').on('click', 'tr', function() {
+            console.log('genio-table-body click'); //20240627 추가1
+                // Find the input element with name="bd-cursor-state" within the clicked row
+                const $bdCursorStateInput = $(this).find('input[name="bd-cursor-state"]');
+                if ($bdCursorStateInput.length) {
+                    $($bdCursorStateInput).prop('checked', true)
+                    Btype.bd_cursor_click($bdCursorStateInput)
+                }
+            });
+
         (function( GenioCorrect, $, undefined ) {
             GenioCorrect.bd_page = []
             GenioCorrect.formB = {!! json_encode($formB) !!}
@@ -157,7 +169,7 @@
             };
 
             GenioCorrect.btn_bd_act_add = async function () {
-                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('#genio-form #frm')) { return }
                 }
 
@@ -175,7 +187,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}"
@@ -188,14 +200,14 @@
                         <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" disabled
+                            <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" disabled
+                            <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
@@ -207,7 +219,7 @@
                         <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" disabled
+                            <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>
@@ -215,7 +227,7 @@
                         <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" disabled
+                            <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>
@@ -223,7 +235,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" disabled
+                            <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>
@@ -231,7 +243,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" disabled
+                            <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>
@@ -239,7 +251,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" disabled
+                            <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>
@@ -247,7 +259,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 ref1-txt" disabled
+                            <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>
@@ -255,7 +267,7 @@
                             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" disabled
+                            <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>
@@ -308,7 +320,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)">
@@ -320,13 +332,13 @@
                         <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}" 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, 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}" 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, true, 'GenioCorrect')" required>
                         </td>
                         <td
@@ -338,7 +350,7 @@
                         <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)}" disabled
+                            <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>
@@ -346,7 +358,7 @@
                         <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)}" disabled
+                            <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>
@@ -354,7 +366,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.GenioSupply, formB.ListVars['Format'].SupplyAmt)}" disabled
+                            <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>
@@ -362,7 +374,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.GenioVat, formB.ListVars['Format'].VatAmt)}" disabled
+                            <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>
@@ -370,7 +382,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.GenioSum, formB.ListVars['Format'].SumAmt)}" disabled
+                            <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>
@@ -378,7 +390,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 ref1-txt" value="${bd.Ref1}" disabled
+                            <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>
@@ -386,7 +398,7 @@
                             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}" disabled
+                            <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>

+ 4 - 2
resources/views/front/outline/static/slip.blade.php

@@ -1,5 +1,7 @@
 <!--- slip-search --->
-@php $modalClassName = $modalClassName ?? ''; @endphp
+@php $modalClassName = $modalClassName ?? '';
+//var_dump($moealSetFile);
+@endphp
 
 <div class="modal fade modal-brown {{ $modalClassName }}" id="modal-slip" aria-hidden="true" data-backdrop="static" style="display: none; z-index: 1060;">
     <div class="modal-dialog m-auto pt-4" style="max-width: 1250px !important;">
@@ -67,7 +69,7 @@
                             <div class="d-flex align-items-center" style="height: 28px;">
                                 @foreach($moealSetFile['QuerySpeedOptions'] as $index => $option)
                                     <input name="{{ $modalClassName }}query-speed" type="radio" value="{{ $option['Value'] }}" id="{{ $modalClassName.'query-speed-'.$index }}"
-                                        {{ $option['Value'] == 'normal' ? 'checked' : '' }} onchange="change_slip_query_speed()">
+                                        {{ $index == 0 ? 'checked' : '' }} onchange="change_slip_query_speed()">
                                     <label class="w-100 rounded overflow-hidden mr-0 text-nowrap" for="{{ $modalClassName.'query-speed-'.$index }}">{{ $option['Caption'] }}</label>
                                 @endforeach
                             </div>

+ 38 - 0
settings_erp.sh

@@ -0,0 +1,38 @@
+#!/bin/bash
+theme_file="erponly"
+main_dir="/var/www/html"
+del_vendor_dir="/var/www/html/vendor"
+s_vendor_dir="/home/vendor"
+
+# vendor 디렉토리 삭제
+rm -rf "$del_vendor_dir"
+
+# home 경로에 vendor 디렉토리 생성
+mkdir -p "$s_vendor_dir"
+
+# /var/www/html 경로 이동
+cd "$main_dir"
+
+# vendor 심볼릭 링크 생성
+ln -s "$s_vendor_dir" vendor
+
+# resources 심볼릭 링크 생성
+# resources_link="$main_dir/public/themes/$theme_file/pro/resources"
+# if [ -d "$main_dir/public/themes/$theme_file/pro" ]; then
+#     cd "$main_dir/public/themes/$theme_file/pro"
+# else
+#     mkdir -p "$main_dir/public/themes/$theme_file/pro"
+#     cd "$main_dir/public/themes/$theme_file/pro"
+# fi
+
+# # 기존의 resources 심볼릭 링크나 디렉토리가 있으면 삭제
+# if [ -e "$resources_link" ]; then
+#     rm -rf "$resources_link"
+# fi
+
+# 새로운 resources 심볼릭 링크 생성
+# ln -s "$main_dir/dabory/themes/$theme_file/pro/resources" resources
+
+cd "$main_dir"
+# composer update 실행
+composer update

Some files were not shown because too many files changed in this diff