Explorar o código

240721-2133-Kim

hokky hai 4 meses
pai
achega
e0b7eb8d23

+ 46 - 43
resources/views/front/dabory/erp/purchase/porder.blade.php

@@ -126,9 +126,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']['porder'] as $key => $status)
+                                                <option value="{{ $status['Code'] }}">
+                                                    {{ $status['Title'] }}
+                                                </option>
+                                            @endforeach
                                         </select>
                                     </div>
                                 </div>
@@ -348,7 +350,7 @@
 <script src="{{ csset('/js/modals-controller/b-type/common.js') }}"></script>
     <script>
         window.onload = async function () {
-            hdPage = [];
+            ThumbArr = [];
             make_dynamic_table_css('.porder-table', make_dynamic_table_px(formB['ListVars']['Size']))
 
             $('#porder-date').val(date_to_sting(new Date()))
@@ -491,7 +493,7 @@
                 SeqNo: bd.SeqNo,
                 ItemId: parseInt(bd.ItemId),
                 PorderQty: String(bd.PorderQty),
-                PurchBalQty: String(bd.PorderQty),
+                PurchBalQty : String(bd.PorderQty),
                 PorderPrc: String(bd.PorderPrc),
                 PorderSupply: String(bd.PorderSupply),
                 PorderVat: String(bd.PorderVat),
@@ -506,7 +508,6 @@
                 IsEnd: parseInt(bd.IsEnd),
                 Ip: window.User['Ip']
             }
-
             if (id < 0) {
                 parameter = { Id: id }
             } else if (id > 0) {
@@ -534,37 +535,31 @@
         }
 
         async function add_td_last_tap_out($this, id) {
-            let tr = $(`input[name='bd-cursor-state']:checked`).closest('tr')
-            let index = $(tr).prevAll().length
-
-            // 필수텍스트가 안비어있으고 fouces out == 다음 tr 추가
-            if (bd_page[index].ItemId != 0 && ! dom_required_check($(tr).find(`input`))) {
-                if ($($this).data('last')) {
-                    let seq_no = await Btype.get_last_seq_no('porder', $('#auto-slip-no-txt').val())
-                    bd_page[index].SeqNo = seq_no;
+            Btype.btn_act_save('#porder-form #frm', async function () {
+                let tr = $(`input[name='bd-cursor-state']:checked`).closest('tr')
+                let index = $(tr).prevAll().length
+
+                // 필수텍스트가 안비어있으고 fouces out == 다음 tr 추가
+                if (bd_page[index].ItemId != 0 && ! dom_required_check($(tr).find(`input`))) {
+                    if ($($this).data('last')) {
+                        let seq_no = await Btype.get_last_seq_no('porder', $('#auto-slip-no-txt').val())
+                        bd_page[index].SeqNo = seq_no;
+                    }
+
+                    Btype.call_bd_act_api([ get_bd_parameter(bd_page[index]) ], function (page) {
+                        bd_page[index].Id = page[0].Id;
+
+                        Btype.body_act_success_callback($this, tr);
+                        Btype.check_the_checkbox_when_changing($this, false)
+                        // Btype.btn_act_save('#porder-form #frm');
+                    });
+                } else {
+                    iziToast.error({
+                        title: 'Error',
+                        message: @json(_e('(*)Required item(s) omitted')),
+                    });
                 }
-
-                Btype.call_bd_act_api([ get_bd_parameter(bd_page[index]) ], function (page) {
-                    bd_page[index].Id = page[0].Id;
-
-                    Btype.body_act_success_callback($this, tr);
-                    Btype.check_the_checkbox_when_changing($this, false)
-                    Btype.btn_act_save('#porder-form #frm');
-                });
-                let itemCodeInput = $(tr).find(`input[type="text"]`).first();
-                let itemNameInput = $(tr).find(`input[type="text"]`).eq(1);
-                if (itemCodeInput.length > 0) {
-                    Btype.set_slip_no_btn_disabled(itemCodeInput)
-                    Btype.set_slip_no_btn_disabled(itemNameInput)
-                    // $(firstTextInput).addClass('border-0 bg-white')
-                    // $(firstTextInput).prop('readonly', true)
-                }
-            } else {
-                iziToast.error({
-                    title: 'Error',
-                    message: @json(_e('(*)Required item(s) omitted')),
-                });
-            }
+            });
         }
 
         // start body act btn
@@ -676,8 +671,10 @@
                     first_item += '_' + first_porder['SubName']
                 }
                 first_item += '(' + bd_page.length + ')'
-                first_thumb = first_porder['TurboThumb']
 
+                if(first_porder['TurboThumb']){
+                    first_thumb = first_porder['TurboThumb']
+                }
             }
             const itmtot_amt = bd_page.reduce((accumulator, bd) => {
                 return accumulator + parseFloat(bd.PorderSupply) + parseFloat(bd.PorderVat) // 합계금액 (공급가액 + 세액)
@@ -723,8 +720,7 @@
                 VatRate: vat_rate,
                 VatName: vat_name,
                 SgroupName: window.User['SgroupName'],
-                TotalQty : String(Number(total_qty) - 0),
-                // FirstThumb : first_thumb
+                TotalQty : String(Number(total_qty) - 0)
             }
 
             if (typeof first_thumb !== 'undefined') {
@@ -1088,14 +1084,14 @@
                     data-last=true onfocusout="add_td_last_tap_out(this, ${last_bd_id_inc})"
                     class="text-${formB.ListVars['Align'].Ref2}" ${formB.ListVars['Hidden'].Ref2}
                     >
-                    <input type="text" class="text-${formB.ListVars['Align'].Ref2} border-0 bg-white"readonly
+                    <input type="text" class="text-${formB.ListVars['Align'].Ref2} border-0 bg-white" readonly
                     onchange="Btype.check_the_checkbox_when_changing(this)"
                     onfocusout="save_data_when_entering_text()">
                 </td>
                 <td
                     class="text-${formB.ListVars['Align'].PorderMemo}" ${formB.ListVars['Hidden'].PorderMemo}>
                     <textarea style="max-height: 30px;" class="rounded w-100 bg-white memo-textarea"
-                        ondblclick="Btype.dblclick_memo_textarea(this, ${last_bd_id_inc})" id="memo-textarea-${last_bd_id_inc}" role="button" readonly></textarea>
+                        ondblclick="Btype.dblclick_memo_textarea(this, ${last_bd_id_inc})" id="memo-textarea-${last_bd_id_inc}" role="button"></textarea>
                 </td>
             </tr>`;
 
@@ -1148,7 +1144,9 @@
             bd_page[index].CountUnit = item.CountUnit
             bd_page[index].PorderPrc = item.PurchPrc
             bd_page[index].StdPurchPrc = item.PurchPrc// override_amt_calc_txt_is_changed();
-            if (hdPage['FirstThumb'] == '') {
+            bd_page[index].TurboThumb = item.TurboThumb
+
+            if (!ThumbArr) { // item 받아왔을 때만 bd_page에 TurboThumb 저장
                 bd_page[index].TurboThumb = item.TurboThumb
             }
 
@@ -1169,9 +1167,14 @@
             Btype.set_slip_no_btn_disabled()
 
             let hd_page = response.data.HdPage[0]
-            hdPage = hd_page;
             bd_page = response.data.BdPage ?? []
 
+            let thumb = response.data.HdPage[0]['FirstThumb']
+
+            if(!thumb){
+                ThumbArr = thumb;
+            }
+
             $('#Id').val(hd_page.Id)
             $('#auto-slip-no-txt').val(hd_page.PorderNo)
             $('#porder-date').val(moment(to_date(hd_page.PorderDate)).format('YYYY-MM-DD'))

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 403 - 226
resources/views/front/dabory/erp/revenue/sales.blade.php


+ 36 - 38
resources/views/front/dabory/erp/revenue/sorder.blade.php

@@ -56,7 +56,7 @@
                                         {{-- <button id="auto-slip-no-btn" class="btn-dark border-white rounded overflow-hidden col-3 text-center text-white text-nowrap radius-r0"--}}
                                         {{-- onclick="get_last_slip_no(this)">--}}
                                         {{--  <span class="icon-cogs"></span>--}}
-                                            </button>
+                                        {{--    </button>--}}
                                             <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'] }}>
@@ -327,7 +327,8 @@
 <script src="{{ csset('/js/modals-controller/b-type/common.js') }}"></script>
     <script>
         window.onload = async function () {
-            hdPage = [];
+            ThumbArr = [];
+            //await Btype.fetch_slip_form_book(query['QueryVars']['FilterValue']);
             make_dynamic_table_css('.sorder-table', make_dynamic_table_px(formB['ListVars']['Size']))
 
             $('#sorder-date').val(date_to_sting(new Date()))
@@ -511,38 +512,29 @@
         }
 
         async function add_td_last_tap_out($this, id) {
-            let tr = $(`input[name='bd-cursor-state']:checked`).closest('tr')
-            let index = $(tr).prevAll().length
-
-            // 필수텍스트가 안비어있으고 fouces out == 다음 tr 추가
-            if (bd_page[index].ItemId != 0 && ! dom_required_check($(tr).find(`input`))) {
-                if ($($this).data('last')) {
-                    let seq_no = await Btype.get_last_seq_no('sorder', $('#auto-slip-no-txt').val())
-                    bd_page[index].SeqNo = seq_no;
-                }
-
-                Btype.call_bd_act_api([ get_bd_parameter(bd_page[index]) ], function (page) {
-                    bd_page[index].Id = page[0].Id;
-                    body_act_success_callback($this, tr);
-                    Btype.check_the_checkbox_when_changing($this, false)
-                    Btype.btn_act_save('#sorder-form #frm');
-                });
-
-                let itemCodeInput = $(tr).find(`input[type="text"]`).first();
-                let itemNameInput = $(tr).find(`input[type="text"]`).eq(1);
-                if (itemCodeInput.length > 0) {
-                    Btype.set_slip_no_btn_disabled(itemCodeInput)
-                    Btype.set_slip_no_btn_disabled(itemNameInput)
-                    // $(firstTextInput).addClass('border-0 bg-white')
-                    // $(firstTextInput).prop('readonly', true)
+            Btype.btn_act_save('#sorder-form #frm', async function () {
+                let tr = $(`input[name='bd-cursor-state']:checked`).closest('tr')
+                let index = $(tr).prevAll().length
+
+                // 필수텍스트가 안비어있으고 fouces out == 다음 tr 추가
+                if (bd_page[index].ItemId != 0 && ! dom_required_check($(tr).find(`input`))) {
+                    if ($($this).data('last')) {
+                        let seq_no = await Btype.get_last_seq_no('sorder', $('#auto-slip-no-txt').val())
+                        bd_page[index].SeqNo = seq_no;
+                    }
+
+                    Btype.call_bd_act_api([ get_bd_parameter(bd_page[index]) ], function (page) {
+                        bd_page[index].Id = page[0].Id;
+                        body_act_success_callback($this, tr);
+                        Btype.check_the_checkbox_when_changing($this, false)
+                    });
+                } else {
+                    iziToast.error({
+                        title: 'Error',
+                        message: @json(_e('(*)Required item(s) omitted')),
+                    });
                 }
-
-            } else {
-                iziToast.error({
-                    title: 'Error',
-                    message: @json(_e('(*)Required item(s) omitted')),
-                });
-            }
+            });
         }
 
         function body_act_success_callback($this, tr) {
@@ -685,10 +677,13 @@
                     first_item += '_' + first_sorder['SubName']
                 }
                 first_item += '(' + bd_page.length + ')'
-                first_thumb = first_sorder['TurboThumb']
+
+                if(first_sorder['TurboThumb']){
+                    first_thumb = first_sorder['TurboThumb']
+                }
             }
             const itmtot_amt = bd_page.reduce((accumulator, bd) => {
-                return accumulator + parseFloat(bd.SorderSupply) + parseFloat(bd.SorderSupply) // 합계금액 (공급가액 + 세액)
+                return accumulator + parseFloat(bd.SorderSupply) + parseFloat(bd.SorderVat) // 합계금액 (공급가액 + 세액)
             }, 0)
 
             const total_qty = bd_page.reduce((accumulator, bd) => {
@@ -742,7 +737,6 @@
                 delete parameter.UpdatedOn;
             }
 
-            // console.log(parameter)
             return parameter;
         }
 
@@ -1150,7 +1144,7 @@
             bd_page[index].CurrPurchPrc = item.PurchPrc
             bd_page[index].CurrSalesPrc = item.SalesPrc// override_amt_calc_txt_is_changed();
 
-            if (hdPage['FirstThumb'] == '') {
+            if (!ThumbArr) { // item 받아왔을 때만 bd_page에 TurboThumb 저장
                 bd_page[index].TurboThumb = item.TurboThumb
             }
 
@@ -1170,8 +1164,12 @@
             Btype.set_slip_no_btn_disabled()
 
             let hd_page = response.data.HdPage[0]
-            hdPage = hd_page;
             bd_page = response.data.BdPage ?? []
+            let thumb = response.data.HdPage[0]['FirstThumb']
+
+            if(!thumb){
+                ThumbArr = thumb;
+            }
 
             $('#Id').val(hd_page.Id)
             $('#auto-slip-no-txt').val(hd_page.SorderNo)

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

@@ -856,7 +856,7 @@
             $(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(6)').find('input').val()
             $(tr).children('td:eq(7)').find('input').val(parseFloat(item.PurchPrc).toFixed(window.User['PurchPrcPoint']))
             $(tr).children('td:eq(11)').text(parseFloat(item.SalesPrc).toFixed(window.User['PurchPrcPoint']))
 

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

@@ -113,8 +113,6 @@
                     }, 'GenioCorrect')
                 }
             });
-
-
         });
 
         $('#genio-table-body').on('click', 'tr', function() {
@@ -553,7 +551,7 @@
             }
 
             GenioCorrect.add_td_last_tap_out = async function ($this, id) {
-                Btype.btn_act_save('#squote-form #frm', async function () {
+                Btype.btn_act_save('#genio-form #frm', async function () {
                     let tr = $('#correct-tab').find(`input[name='bd-cursor-state']:checked`).closest('tr')
                     let index = $(tr).prevAll().length
                     // 필수텍스트가 안비어있으고 fouces out == 다음 tr 추가
@@ -568,15 +566,6 @@
                             GenioCorrect.custom_body_act_success_callback($this, tr);
                             Btype.check_the_checkbox_when_changing($this, false, 'GenioCorrect')
                         }, 'GenioCorrect');
-
-                        let itemCodeInput = $(tr).find(`input[type="text"]`).first();
-                        let itemNameInput = $(tr).find(`input[type="text"]`).eq(1);
-                        if (itemCodeInput.length > 0) {
-                            Btype.set_slip_no_btn_disabled(itemCodeInput)
-                            Btype.set_slip_no_btn_disabled(itemNameInput)
-                            // $(firstTextInput).addClass('border-0 bg-white')
-                            // $(firstTextInput).prop('readonly', true)
-                        }
                     } else {
                         iziToast.error({
                             title: 'Error',

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio