HEX
Server: Apache
System: Linux p3plzcpnl506847.prod.phx3.secureserver.net 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: slfopp7cb1df (5698090)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //proc/thread-self/cwd/pm/plugins/Purchase/assets/js/vendor_items/vendor_items_js.php
<script>
$(document).ready(function () {
	$(".select2").select2();
});

(function($) {
  "use strict";

  group_it_change();
})(jQuery);

function group_it_change() {
"use strict";
var group = $('select[name="group_item"]').val();
if(group != ''){
  requestGet("<?php echo get_uri('purchase/group_it_change/') ;?>"+group).done(function(response){
    response = JSON.parse(response);
    if(response.html != ''){
      $('select[id="items"]').html('');
      $('select[id="items"]').append(response.html);
      $('.select2').select2('destroy');
      $(".select2").select2();
    }else{
      init_ajax_search('items','#items.ajax-search',undefined, "<?php echo get_uri('purchase/pur_commodity_code_search_vendor_item/purchase_price/can_be_purchased/'); ?>" +group);
      $('select[id="items"]').html('');
      $('.select2').select2('destroy');
      $(".select2").select2();
    }
  });
}else{
  init_ajax_search('items','#items.ajax-search',undefined, "<?php echo get_uri('purchase/pur_commodity_code_search'); ?>" );
  requestGet("<?php echo get_uri('purchase/group_it_change/'); ?>" +group).done(function(response){
    response = JSON.parse(response);
    if(response.html != ''){
      $('select[id="items"]').html('');
      $('select[id="items"]').append(response.html);
      $('.select2').select2('destroy');
      $(".select2").select2();
    }else{
      $('select[id="items"]').html('');
      $('.select2').select2('destroy');
      $(".select2").select2();
    }
  });
}
}

</script>