Browse Source

Merge remote-tracking branch 'refs/remotes/origin/master'

wngur6076 1 month ago
parent
commit
6f7873090c

+ 3 - 5
dabory/para/erp/ko_KR/form/form-b/point/credit.json

@@ -15,11 +15,6 @@
             "Caption": "추가",
             "Parameter": ""
         },
-        {
-            "Value": "save-and-new",
-            "Caption": "저장 후 추가",
-            "Parameter": ""
-        },
         {
             "Value": "delete",
             "Caption": "삭제",
@@ -82,6 +77,7 @@
     "ListVars": [
         {
             "$Radio": "$Radio",
+            "CompanyNo": "고객번호",
             "CompanyName": "고객명#",
             "DealName": "거래구분",
             "CreditAmt": "충전금액#",
@@ -89,6 +85,7 @@
         },
         {
             "$Radio": "3",
+            "CompanyNo": "5",
             "CompanyName": "10",
             "DealName": "10",
             "CreditAmt": "10",
@@ -97,6 +94,7 @@
         {
 
             "$Radio": "center",
+            "CompanyNo": "center",
             "CompanyName": "left#",
             "DealName": "center",
             "CreditAmt": "decimal('sales_amt')",

+ 3 - 5
dabory/para/erp/ko_KR/form/form-b/point/reward.json

@@ -15,11 +15,6 @@
             "Caption": "추가",
             "Parameter": ""
         },
-        {
-            "Value": "save-and-new",
-            "Caption": "저장 후 추가",
-            "Parameter": ""
-        },
         {
             "Value": "delete",
             "Caption": "삭제",
@@ -82,6 +77,7 @@
     "ListVars": [
         {
             "$Radio": "$Radio",
+            "CompanyNo": "고객번호",
             "CompanyName": "고객명#",
             "DealName": "거래구분",
             "RewardAmt": "적립금액#",
@@ -89,6 +85,7 @@
         },
         {
             "$Radio": "3",
+            "CompanyNo": "5",
             "CompanyName": "10",
             "DealName": "10",
             "RewardAmt": "10",
@@ -97,6 +94,7 @@
         {
 
             "$Radio": "center",
+            "CompanyNo": "center",
             "CompanyName": "left#",
             "DealName": "center",
             "RewardAmt": "decimal('sales_amt')",

+ 3 - 3
resources/views/front/dabory/erp/accounting/acc-slip-form.blade.php

@@ -453,9 +453,9 @@
             $('#acc-slip-form').find('#supplier-txt').prop('readonly',  hd_page.CompanyName != "")
             $('#acc-slip-form').find('.company-modal-btn').prop('disabled',  hd_page.CompanyName != "")
             $('#acc-slip-form').find('#sorder-no-txt').prop('readonly',  hd_page.SorderNo != "")
-            $('#acc-slip-form').find('.sorder-modal-btn').prop('disabled',  hd_page.SorderNo != "")
-            $('#acc-slip-form').find('#porder-no-txt').prop('readonly',  hd_page.PorderNo != "")
-            $('#acc-slip-form').find('.porder-modal-btn').prop('disabled',  hd_page.PorderNo != "")
+            $('#acc-slip-form').find('.sorder-modal-btn').prop('disabled',  hd_page.SorderId != 0)
+            $('#acc-slip-form').find('#porder-no-txt').prop('readonly',  hd_page.PorderId != 0)
+            $('#acc-slip-form').find('.porder-modal-btn').prop('disabled',  hd_page.PorderId != 0)
 
 
             $('#acc-slip-form').find('#deal-type-select').val(hd_page.DealTypeId)

+ 19 - 4
resources/views/front/dabory/erp/coupon-credit/credit.blade.php

@@ -80,7 +80,7 @@
                                                    maxlength="{{ $formB['FormVars']['MaxLength']['ToCustomer'] }}"
                                                 {{ $formB['FormVars']['Required']['ToCustomer'] }}>
                                             <button type="button"
-                                                class="btn-dark rounded btn-open-modal border-0 radius-l0 col-3 customer-modal-btn"
+                                                class="btn-dark rounded btn-open-modal border-0 radius-l0 col-3 to-customer-modal-btn"
                                                 data-target="company"
                                                 data-clicked="get_override_to_customer_id"
                                                 data-variable="customerModal">
@@ -95,7 +95,7 @@
                                                    maxlength="{{ $formB['FormVars']['MaxLength']['FormCustomer'] }}"
                                                 {{ $formB['FormVars']['Required']['FormCustomer'] }}>
                                             <button type="button"
-                                                class="btn-dark rounded btn-open-modal border-0 radius-l0 col-3"
+                                                class="btn-dark rounded btn-open-modal border-0 radius-l0 col-3 form-customer-modal-btn"
                                                 data-target="company"
                                                 data-clicked="get_override_form_customer_id"
                                                 data-variable="customerModal">
@@ -365,8 +365,11 @@
             $('#form-customer-txt').data('id', 0)
             $('.coupon-credit').find('.form-customer-group').removeClass('d-flex');
             $('.coupon-credit').find('.form-customer-group').addClass('d-none');
+
             $('#to-customer-txt').prop('readonly', false);
-            $('.customer-modal-btn').prop('disabled', false);
+            $('#form-customer-txt').prop('readonly', false);
+            $('.to-customer-modal-btn').prop('disabled', false);
+            $('.form-customer-modal-btn').prop('disabled', false);
             $('.credit-act.save-button').prop('disabled', false)
 
             Btype.set_slip_no_btn_abled()
@@ -481,6 +484,9 @@
                         class="text-${formB.ListVars['Align'].$Radio}"
                         onclick="Btype.bd_cursor_click(this)">
                     </td>
+                    <td class="text-${formB.ListVars['Align'].CompanyNo}" ${formB.ListVars['Hidden'].CompanyNo}>
+                        ${format_conver_for(bd.CompanyNo, formB.ListVars['Format'].CompanyNo)}
+                    </td>
                     <td class="text-${formB.ListVars['Align'].Customer}" ${formB.ListVars['Hidden'].Customer}>
                         ${format_conver_for(bd.CompanyName, formB.ListVars['Format'].Customer)}
                     </td>
@@ -521,6 +527,13 @@
             let hd_page = response.data.HdPage[0]
             bd_page = response.data.BdPage ?? []
 
+            bd_page.forEach(bd => {
+                if (hd_page.FromBuyerId === bd.BuyerId) {
+                    bd.RewardAmt = -Math.abs(bd.RewardAmt);
+                    console.log('받는 사람', bd);
+                }
+            });
+
             $('#Id').val(hd_page.Id)
             $('#auto-slip-no-txt').val(hd_page.CreditNo)
             $('#credit-date').val(moment(to_date(hd_page.CreditDate)).format('YYYY-MM-DD'))
@@ -536,7 +549,9 @@
             $('#form-customer-txt').data('id', hd_page.FromBuyerId)
             // 저장된 데이터 불러올 경우 고객업체 비활성화
             $('#to-customer-txt').prop('readonly',  hd_page.ToCompanyName != "")
-            $('.customer-modal-btn').prop('disabled',  hd_page.ToCompanyName != "")
+            $('#form-customer-txt').prop('readonly',  hd_page.FromCompanyName != "")
+            $('.to-customer-modal-btn').prop('disabled',  hd_page.ToCompanyName != "")
+            $('.form-customer-modal-btn').prop('disabled',  hd_page.FromCompanyName != "")
 
             $('#remarks-txt-area').val(remove_tag(hd_page.Remarks))
             $('#remarks-preview').html(hd_page.Remarks)

+ 23 - 6
resources/views/front/dabory/erp/coupon-credit/reward.blade.php

@@ -80,7 +80,7 @@
                                                    maxlength="{{ $formB['FormVars']['MaxLength']['ToCustomer'] }}"
                                                 {{ $formB['FormVars']['Required']['ToCustomer'] }}>
                                             <button type="button"
-                                                class="btn-dark rounded btn-open-modal border-0 radius-l0 col-3 customer-modal-btn"
+                                                class="btn-dark rounded btn-open-modal border-0 radius-l0 col-3 form-customer-modal-btn"
                                                 data-target="company"
                                                 data-clicked="get_override_to_customer_id"
                                                 data-variable="customerModal">
@@ -95,7 +95,7 @@
                                                    maxlength="{{ $formB['FormVars']['MaxLength']['FormCustomer'] }}"
                                                 {{ $formB['FormVars']['Required']['FormCustomer'] }}>
                                             <button type="button"
-                                                class="btn-dark rounded btn-open-modal border-0 radius-l0 col-3"
+                                                class="btn-dark rounded btn-open-modal border-0 radius-l0 col-3 to-customer-modal-btn"
                                                 data-target="company"
                                                 data-clicked="get_override_form_customer_id"
                                                 data-variable="customerModal">
@@ -370,9 +370,11 @@
             $('.coupon-reward').find('.form-customer-group').addClass('d-none');
 
             $('#to-customer-txt').prop('readonly', false);
-            $('.customer-modal-btn').prop('disabled', false);
-            $('.reward-act.save-button').prop('disabled', false)
+            $('#form-customer-txt').prop('readonly', false);
+            $('.to-customer-modal-btn').prop('disabled', false);
+            $('.form-customer-modal-btn').prop('disabled', false);
 
+            $('.reward-act.save-button').prop('disabled', false)
             Btype.set_slip_no_btn_abled()
             $('#reward-date').val(date_to_sting(new Date()))
 
@@ -474,6 +476,7 @@
         function create_bd_page() {
             let html = []
             let sum_total = 0;
+            const reward_amt =
             bd_page.forEach(bd => {
                 sum_total += parseFloat(bd.CreditAmt);
 
@@ -485,6 +488,9 @@
                         class="text-${formB.ListVars['Align'].$Radio}"
                         onclick="Btype.bd_cursor_click(this)">
                     </td>
+                    <td class="text-${formB.ListVars['Align'].CompanyNo}" ${formB.ListVars['Hidden'].CompanyNo}>
+                        ${format_conver_for(bd.CompanyNo, formB.ListVars['Format'].CompanyNo)}
+                    </td>
                     <td class="text-${formB.ListVars['Align'].Customer}" ${formB.ListVars['Hidden'].Customer}>
                         ${format_conver_for(bd.CompanyName, formB.ListVars['Format'].Customer)}
                     </td>
@@ -515,7 +521,7 @@
         }
 
         function update_hd_ui(response) {
-            console.log('update_hd_ui : ', response);
+            console.log(response);
             if (isEmpty(response.data) || response.data.apiStatus) {
                 $('#modal-slip').modal('hide');
                 return;
@@ -523,7 +529,16 @@
 
             let hd_page = response.data.HdPage[0]
             bd_page = response.data.BdPage ?? []
+            // console.log('bd_page : ', bd_page);
+            // console.log('hd_page.id : ', hd_page.Id);
 
+            bd_page.forEach(bd => {
+                if (hd_page.FromBuyerId === bd.BuyerId) {
+                    bd.RewardAmt = -Math.abs(bd.RewardAmt);
+                    console.log('받는 사람', bd);
+                }
+            });
+            $('.save-button').prop('disabled', true);
             $('#Id').val(hd_page.Id)
             $('#auto-slip-no-txt').val(hd_page.RewardNo)
             $('#reward-date').val(moment(to_date(hd_page.RewardDate)).format('YYYY-MM-DD'))
@@ -539,7 +554,9 @@
             $('#form-customer-txt').data('id', hd_page.FromBuyerId)
             // 저장된 데이터 불러올 경우 고객업체 비활성화
             $('#to-customer-txt').prop('readonly',  hd_page.ToCompanyName != "")
-            $('.customer-modal-btn').prop('disabled',  hd_page.ToCompanyName != "")
+            $('#form-customer-txt').prop('readonly',  hd_page.FromCompanyName != "")
+            $('.to-customer-modal-btn').prop('disabled',  hd_page.ToCompanyName != "")
+            $('.form-customer-modal-btn').prop('disabled',  hd_page.FromCompanyName != "")
 
             $('#remarks-txt-area').val(remove_tag(hd_page.Remarks))
             $('#remarks-preview').html(hd_page.Remarks)