hokky 4 mesiacov pred
rodič
commit
a95b45623d

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

@@ -59,6 +59,7 @@ const slip = (function ($, window, document, undefined) {
 
 
     slip_open = (limit, offset, page = 1) => {
+        console.log('slip_open');
         let html = ''
         let menu_code = (typeof menuCode === 'undefined') ? false : menuCode
         let modal_class_name = $(id).data('class') || ''
@@ -73,6 +74,23 @@ const slip = (function ($, window, document, undefined) {
 
         $(id).find('.slip-save-spinner-btn').show()
         $(id).find('.slip-search-btn').hide()
+        console.log(moealSetFile['General']['PageApi']);
+        console.log('FilterName : ', $(id).find('#filter-name-select').val());
+        console.log('FilterValue : ', $(id).find('#filter-value-txt').val());
+        console.log('SimpleFilter : ', $(id).find('#simple-filter-select').val());
+        console.log('StartDate : ', start_date);
+        console.log('EndDate : ', end_date);
+        console.log('QuerySpeed : ', $(id).find(`input:radio[name=${modal_class_name}query-speed]:checked`).val());
+        console.log('SlipNo : ', $(id).find('.slip-no').val());
+        console.log('CompanyName : ', $(id).find('.company-name').val());
+        console.log('ItemCode : ', $(id).find('.item-code').val());
+        console.log('OrderBy : ', $(id).find('.modal-order-by-select').val());
+
+        console.log('SlipDateField : ', moealSetFile['SlipSearchFields']['SlipDateField']);
+        console.log('SlipNoField : ', moealSetFile['SlipSearchFields']['SlipNoField']);
+
+        console.log('Limit : ', parseInt(limit));
+        console.log('Offset : ', parseInt(offset));
 
         $.when(get_api_data(moealSetFile['General']['PageApi'], {
             QueryVars: {

+ 37 - 7
resources/views/front/dabory/erp/purchase/porder.blade.php

@@ -353,11 +353,14 @@
             Btype.get_storage_name_and_branch_name()
             let data = await Btype.get_slip_form_init()
             // console.log(data)
-            formB['SlipCommonSetup'] = data['SlipCommonSetup']
-            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)
+
+            slipInit = await Btype.get_slip_form_init()
+            // formB['SlipCommonSetup'] = data['SlipCommonSetup']
+            formB['SlipCommonSetup'] = slipInit['SlipCommonSetup']
+            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']) {
@@ -373,7 +376,6 @@
             $('#porder-table-body').on('click', 'tr', function() {
                 // Find the input element with name="bd-cursor-state" within the clicked row
                 const $bdCursorStateInput = $(this).find('input[name="bd-cursor-state"]');
-                console.log('bdCursorStateInput : ', $bdCursorStateInput)
                 if ($bdCursorStateInput.length) {
                     $($bdCursorStateInput).prop('checked', true)
                     Btype.bd_cursor_click($bdCursorStateInput)
@@ -656,6 +658,21 @@
         }
 
         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 (bd_page.length > 0) {
+                const first_porder = bd_page[0]
+                first_item = first_porder['ItemCode'] + '_' + first_porder['ItemName']
+                if (first_porder['SubName']) {
+                    first_item += '_' + first_porder['SubName']
+                }
+                first_item += '(' + bd_page.length + ')'
+            }
+
             let id = parseInt($(`#frm`).find(`input[name="Id"]`).val());
             let parameter = {
                 Id: id,
@@ -682,8 +699,19 @@
                 // Remarks: $('#remarks-preview').html(),
                 Remarks: $('#remarks-txt-area').val(),
                 PayPeriod: '',
-                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']
             }
+
+            console.log('parameter : ', parameter);
             if (id < 0) {
                 parameter = { Id: id }
             } else if (id > 0) {
@@ -750,6 +778,7 @@
         }
 
         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 + '%')
 
@@ -1168,5 +1197,6 @@
         const pickCacheData = {!! json_encode($pickCacheData) !!};
         var formB = {!! json_encode($formB) !!};
         var bd_page = [];
+        let slipInit = null;
     </script>
 @endsection

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

@@ -345,6 +345,7 @@
         }
 
         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']
@@ -455,6 +456,7 @@
         }
 
         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 + '%')
 

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

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

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

@@ -4,7 +4,7 @@
 <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;">
         <div class="modal-content">
-            <div class="modal-header bg-primary test111"><!--p-2-->
+            <div class="modal-header bg-primary"><!--p-2-->
                 <h4 class="modal-title text-white" id="myModalLabel"></h4>
                 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><i class="fas fa-times"></i></button>
             </div>