Ver Fonte

240725-1808-Kim

hokky há 4 meses atrás
pai
commit
06f19aaf8d
1 ficheiros alterados com 37 adições e 12 exclusões
  1. 37 12
      resources/views/front/dabory/erp/revenue/sales.blade.php

+ 37 - 12
resources/views/front/dabory/erp/revenue/sales.blade.php

@@ -89,6 +89,21 @@
                                             </button>
                                         </div>
                                     </div>
+                                    <div class="form-group d-flex flex-column mb-2">
+                                        <label class="m-0">{{ $formB['FormVars']['Title']['SorderNo'] }}</label>
+                                        <div class="d-flex">
+                                            <input type="text" class="rounded w-100 radius-r0" id="sorder-no-txt"
+                                                maxlength="{{ $formB['FormVars']['MaxLength']['SorderNo'] }}"
+                                                {{ $formB['FormVars']['Required']['SorderNo'] }}>
+                                                <button type="button"
+                                                    class="btn-dark rounded btn-open-modal border-0 radius-l0 col-3 window company-modal-btn"
+                                                    data-target="sorder"
+                                                    data-clicked="get_override_supplier_id"
+                                                    data-variable="companyModal">
+                                                    <i class="icon-folder-open"></i>
+                                                </button>
+                                            </div>
+                                    </div>
                                 </div>
                             </div>
                         </div>
@@ -256,7 +271,7 @@
                             @endif
                         </div>
 
-                        <div class="table-responsive mt-2" style="height:400px;" id="scroll-area">
+                        <div class="table-responsive mt-2" style="height:200px;" id="scroll-area">
                             <table class="table-row sales-table">
                                 <thead id="sales-table-head">
                                     @include('front.dabory.erp.partial.make-thead', [
@@ -361,6 +376,7 @@
         window.onload = async function () {
             ThumbArr = [];
             make_dynamic_table_css('.sales-table', make_dynamic_table_px(formB['ListVars']['Size']))
+
             $('#sales-date').val(date_to_sting(new Date()))
             $('#stock-date').val(date_to_sting(new Date()))
             var test = Btype.get_storage_name_and_branch_name()
@@ -486,16 +502,18 @@
         }
 
         async function btn_bd_act_add() {
-            if (parseInt($(`#frm`).find(`input[name="Id"]`).val()) == 0) {
-                iziToast.error({
-                    title: 'Error',
-                    message: @json(_e('Action failed')),
-                });
-                return;
-            }
-            if (! Btype.last_item_added_check('#sales-table-body')) {
-                add_tr();
-            }
+            Btype.btn_act_save('#sales-form #frm', async function () {
+                if (parseInt($(`#frm`).find(`input[name="Id"]`).val()) == 0) {
+                    iziToast.error({
+                        title: 'Error',
+                        message: @json(_e('Action failed')),
+                    });
+                    return;
+                }
+                if (! Btype.last_item_added_check('#sales-table-body')) {
+                    add_tr();
+                }
+            });
         }
 
         function btn_bd_act_body_copy(parameter_name) {
@@ -811,6 +829,7 @@
                     });
                 }
             });
+            scrollToTop();
         }
 
         function body_act_success_callback($this, tr) {
@@ -975,7 +994,7 @@
                         onfocusout="save_data_when_entering_text()">
                     </td>
                     <td
-                        class="text-${formB.ListVars['Align'].SorderMemo}" ${formB.ListVars['Hidden'].SorderMemo}>
+                        class="text-${formB.ListVars['Align'].SalesMemo}" ${formB.ListVars['Hidden'].SorderMemo}>
                         <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})" role="button" readonly>${bd.SorderMemo}</textarea>
                     </td>
@@ -1070,6 +1089,7 @@
                 <td
                     class="text-${formB.ListVars['Align'].StdSalesPrc}" ${formB.ListVars['Hidden'].StdSalesPrc}>
                 </td>
+
                 <td onkeydown="Btype.handleEnterPressedinTabCell(event)"
                     class="text-${formB.ListVars['Align'].Ref1}" ${formB.ListVars['Hidden'].Ref1}
                     >
@@ -1224,6 +1244,11 @@
             $('#modal-slip').modal('hide');
         }
 
+        function scrollToTop() {
+            var scrollArea = document.getElementById("scroll-area");
+            scrollArea.scrollTop = 0;
+        }
+
         const salesModal = {!! json_encode($salesModal) !!};
         const companyModal = {!! json_encode($companyModal) !!};
         const itemModal = {!! json_encode($itemModal) !!};