';
// get prices info
var params = {
job : 'getPricesInfo',
product_id : product_id,
pricebook_id : $("#pricebook_id :selected").val(),
account_id : $("#parent_id").val(),
};
$.ajax({
type : "POST",
url : ajax_url,
dataType : "json",
async : false,
success : function(data) {
html += 'Ceny ';
$.each(data, function(key, value) {
if (value.name == 'pricebook')
html += $("#pricebook_id :selected").html() + ': '
+ FormatNumber(value.price) + ' ';
if (value.name == $("#ecmprice_name").val())
html += '' + value.name + ': '
+ FormatNumber(value.price) + ' ';
else
html += value.name + ': ' + FormatNumber(value.price)
+ ' ';
});
},
data : params
});
html += ' |
| ';
var params = {
job : 'getStockArray',
product_id : product_id,
};
$.ajax({
type : "POST",
url : ajax_url,
dataType : "json",
async : false,
success : function(data) {
html += 'Stany ';
$.each(data, function(key, value) {
html += key + ': ' + FormatNumber(value)
+ ' ';
});
},
data : params
});
html += ' |
| ';
var show_purchase_prices = false;
if (show_purchase_prices) {
html+='| ';
var params = {
job : 'getPurchaseArray',
product_id : product_id,
};
$.ajax({
type : "POST",
url : ajax_url,
dataType : "json",
async : false,
success : function(data) {
console.log(data);
},
data : params
});
html+=' |
| ';
}
html+='