// Stock : fixed bugs on cover/instant state/warehouse/management

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10150 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
bMancone
2011-11-15 18:19:27 +00:00
parent 03823bc17d
commit 8931216544
11 changed files with 167 additions and 160 deletions
@@ -48,9 +48,9 @@ $id_lang = (int)Context::getContext()->language->id;
$query = new DbQuery();
$query->select('
CONCAT(p.id_product, \'_\', IFNULL(pa.id_product_attribute, \'0\')) as id,
p.reference,
IFNULL(p.ean13, \'\') as ean13,
IFNULL(p.upc, \'\') as upc,
IFNULL(pa.reference, IFNULL(p.reference, \'\')) as reference,
IFNULL(pa.ean13, IFNULL(p.ean13, \'\')) as ean13,
IFNULL(pa.upc, IFNULL(p.upc, \'\')) as upc,
md5(CONCAT(\''._COOKIE_KEY_.'\', p.id_product, \'_\', IFNULL(pa.id_product_attribute, \'0\'))) as checksum,
IFNULL(CONCAT(pl.name, \' : \', GROUP_CONCAT(agl.name, \' - \', al.name SEPARATOR \', \')), pl.name) as name
');
@@ -30,6 +30,7 @@
<p>&nbsp;</p>
<input type="hidden" id="product_ids" name="product_ids" value="{$product_ids}" />
<input type="hidden" id="product_ids_to_delete" name="product_ids_to_delete" value="{$product_ids_to_delete}" />
<input type="hidden" name="updatesupply_order" value="1" />
<fieldset>
@@ -122,6 +123,12 @@
else
product_ids = $('#product_ids').val().split('|');
if ($('#product_ids_to_delete').val() == '')
product_ids_to_delete = [];
else
product_ids_to_delete = $('#product_ids_to_delete').val().split('|');
function addProduct()
{
// check if it's possible to add the product
@@ -134,9 +141,9 @@
// add a new line in the products table
$('#products_in_supply_order > tbody:last').append(
'<tr style="height:50px;">'+
'<td>'+product_infos.reference+'<input type="hidden" name="input_check_'+product_infos.id+'" value="'+product_infos.checksum+'" /><input type="hidden" name="input_name_'+product_infos.id+'" value="'+product_infos.reference+'" /></td>'+
'<td>'+product_infos.reference+'<input type="hidden" name="input_check_'+product_infos.id+'" value="'+product_infos.checksum+'" /><input type="hidden" name="input_reference_'+product_infos.id+'" value="'+product_infos.reference+'" /></td>'+
'<td>'+product_infos.ean13+'<input type="hidden" name="input_ean13_'+product_infos.id+'" value="'+product_infos.ean13+'" /></td>'+
'<td>'+product_infos.upc+'<input type="hidden" name="input_ean13_'+product_infos.id+'" value="'+product_infos.upc+'" /></td>'+
'<td>'+product_infos.upc+'<input type="hidden" name="input_upc_'+product_infos.id+'" value="'+product_infos.upc+'" /></td>'+
'<td>'+product_infos.name+'<input type="hidden" name="input_name_displayed_'+product_infos.id+'" value="'+product_infos.name+'" /></td>'+
'<td class="center">{$currency->prefix}&nbsp;<input type="text" name="input_unit_price_te_'+product_infos.id+'" value="0" size="8" />&nbsp;{$currency->suffix}</td>'+
'<td class="center"><input type="text" name="input_quantity_expected_'+product_infos.id+'" value="0" size="5" /></td>'+
@@ -167,20 +174,22 @@
var id = $(this).attr('id');
var product_id = id.split('|')[1];
//find the position of the product id in product_id array
var position = product_ids.indexOf(product_id);
console.log(product_ids);
console.log(product_id);
console.log(position);
if (position != -1)
{
console.log('test3');
//remove the id from the array
product_ids.splice(position, 1);
var input_id = $('input[name~="input_id_'+product_id+'"]');
if (input_id.length > 0)
product_ids_to_delete.push(product_id);
// update the product_ids hidden field
$('#product_ids').val(product_ids.join('|'));
$('#product_ids_to_delete').val(product_ids_to_delete.join('|'));
//remove the table row
$(this).parents('tr:eq(0)').remove();
@@ -27,7 +27,7 @@
{extends file="helper/view/view.tpl"}
{block name="override_tpl"}
{if isset($warehouse)}
<div style="margin-top: 20px">
<div>
<fieldset>
<legend><img src="/img/t/AdminPreferences.gif" alt="" /> {l s='General informations'}</legend>
<table style="width: 400px;" classe="table">