| Server IP : 162.214.74.102 / Your IP : 216.73.216.192 Web Server : Apache System : Linux dedi-4363141.lrsys.com.br 3.10.0-1160.119.1.el7.tuxcare.els25.x86_64 #1 SMP Wed Oct 1 17:37:27 UTC 2025 x86_64 User : lrsys ( 1015) PHP Version : 5.6.40 Disable Function : exec,passthru,shell_exec,system MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/lrsys/www/lrsys_apps/erp/application/plugins/module_stock/assets/js/ |
Upload File : |
//lpillon - 23/01/2017
$(function(){
var pbar = $('#progressbar');
var $modal = $('#ajax-modal');
var sysrender = $('#application_ajaxrender');
pbar.hide();
findDataSelect("#crm_accounts_id", 'contacts/ajax-listbygroup/Associated', '');
pbar.progressbar({
warningMarker: 100,
dangerMarker: 100,
maximum: 100,
step: 15
});
$("#application_ajaxrender").hide();
$('#crm_accounts_id').on('change', function(event) {
event.preventDefault();
updateDiv($("#stock_search").val());
});
$('.filter-apply').on('change', function(event) {
event.preventDefault();
updateDiv($("#stock_search").val());
});
function updateDiv(search=null){
$('#ibox_form').block({ message: null });
$('#progressbar').show();
var timer = setInterval(function () {
pbar.progressbar('stepIt');
}, 100);
var btnsearch = $("#search");
$('.progress').show();
$('.progress .progress-bar').progressbar();
var _url = $("#_url").val();
$.post(_url + 'module_stock/stock/load_list', {
txtsearch: $('#txtsearch').val(),
stype: 'Product',
search: search,
crm_accounts_id:$('#crm_accounts_id').val()
})
.done(function (data) {
var obj = JSON.parse(data);
setTimeout(function () {
var sbutton = $("#search");
var result = $("#tbody");
$('.progress').hide();
$('#ibox_form').unblock();
result.html(obj.table);
$("#bottom_bar_0").html(obj.value);
$("#bottom_bar_1").html(obj.total_type);
$("#application_ajaxrender").show();
}, 100);
});
}
updateDiv();
arr = ["any_prod","any_dep","adv"];
$('.list').on("click", function(){
len = 0;
while(len < arr.length){
if(arr[len] == this.id)
$("."+arr[len]).show();
else
$("."+arr[len]).hide();
len++;
}
clearTimeout();
});
$(".lst").on("mouseleave", function(){
setTimeout(function(){
len = 0;
while(len < arr.length){
$("."+arr[len]).hide();
len++;
}
}, 100);
});
$(".lst").on("mouseenter", function(){
clearTimeout();
});
$(".stock_search").on("click", function(){
updateDiv($("#stock_search").val());
});
$("#stock_search").on("keyup", function(){
if(event.keyCode == 13)
updateDiv($("#stock_search").val());
});
loadProductCategory();
});
function goItem(val){
location.href=$("#_url").val()+"module_stock/stock/item/"+val;
//bootbox.alert("Em desenvolvimento..");
}
$(".inventario").on("click", function(){
bootbox.alert("Aguardando tela de relatórios!");
});
function etiqueta(){
bootbox.alert("Configuração inexistente na app, validar novamente esta implementação!");
}
function loadProductCategory() {
//carrega os grupos;
$.getJSON($("#_url").val() + 'product_category/ajax-list', function (j) {
var options = '';
options += '<option value="">' + _L['Select'] + '</option>';
for (var i = 0; i < j.length; i++) {
if (j[i].name_parent === null) {
options += '<option value="' + j[i].id + '">' + j[i].name + '</option>';
} else {
options += '<option value="' + j[i].id + '">' + j[i].name_parent + " > " + j[i].name + '</option>';
}
}
$('#category_id').html(options);
});
}