wngur6076 há 4 meses atrás
pai
commit
d9aadb7d10

+ 7 - 3
resources/views/front/dabory/erp/revenue/sorder.blade.php

@@ -73,7 +73,7 @@
                                         <div class="d-flex">
                                             <input type="hidden" id="seller-id-txt" value="1">
                                             <input type="text" id="buyer-txt" data-id="0" class="rounded w-100 radius-r0" autocomplete="off"
-                                            onkeydown="company_model_show_cell_enter_key(event)"
+                                            onkeydown="company_model_show_cell_enter_key(event, '')"
                                                    maxlength="{{ $formB['FormVars']['MaxLength']['Buyer'] }}"
                                                 {{ $formB['FormVars']['Required']['Buyer'] }}>
                                             <button type="button"
@@ -748,14 +748,18 @@
             $('#auto-slip-no-txt').val(moment(new Date()).format('YYMMDD') + '-' + response.data.LastSlipNo)
         }
 
-        async function get_override_supplier_id(supplier_id, dom_val = '#supplier-txt') {
+
+        async function get_override_supplier_id(company_id) {
+            await get_local_supplier_id(company_id, '#buyer-txt');
+        }
+
+        async function get_local_supplier_id(supplier_id, dom_val = '#supplier-txt') {
             let response = await get_api_data('company-pick', {
                 Page : [
                     {Id: Number(supplier_id) }
                 ]
             })
 
-            // console.log(response)
             if (response.data.Page) {
                 const company = response.data.Page[0];
                 $(dom_val).data('id', company.Id);