// stock management : Bugs fix after rename and historization modifications

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10131 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
dSevere
2011-11-15 14:05:57 +00:00
parent b9ee33bdcb
commit ac8177b68c
5 changed files with 416 additions and 85 deletions
@@ -30,17 +30,17 @@
<p>&nbsp;</p>
<input type="hidden" id="product_ids" name="product_ids" value="{$product_ids}" />
<input type="hidden" name="updatesupplier_order" value="1" />
<input type="hidden" name="updatesupply_order" value="1" />
<fieldset>
<legend>
<img alt="Supplier Order Management" src="../img/admin/edit.gif">
<img alt="Supply Order Management" src="../img/admin/edit.gif">
{l s='Manage the products you want to order from your supplier'}
</legend>
<p class="clear">{l s='To add a product to the order, type the first letters of the product name, then select the it from the drop-down list:'}</p>
<input type="text" size="100" id="cur_product_name" />
<span onclick="addProduct();" style="cursor: pointer;"><img src="../img/admin/add.gif" alt="{l s='Add a product to the supplier order'}" title="{l s='Add a product to the supplier order'}" /></span>
<span onclick="addProduct();" style="cursor: pointer;"><img src="../img/admin/add.gif" alt="{l s='Add a product to the supply order'}" title="{l s='Add a product to the supply order'}" /></span>
<p>&nbsp;</p>
@@ -48,7 +48,7 @@
<tr>
<td>
<table
id="products_in_supplier_order"
id="products_in_supply_order"
class="table"
cellpadding="0" cellspacing="0"
style="width: 100%; margin-bottom:10px;"
@@ -73,7 +73,7 @@
{$product.reference}
<input type="hidden" name="input_check_{$product.id_product}_{$product.id_product_attribute}" value="{$product.checksum}" />
<input type="hidden" name="input_reference_{$product.id_product}_{$product.id_product_attribute}" value="{$product.reference}" />
<input type="hidden" name="input_id_{$product.id_product}_{$product.id_product_attribute}" value="{$product.id_supplier_order_detail}" />
<input type="hidden" name="input_id_{$product.id_product}_{$product.id_product_attribute}" value="{$product.id_supply_order_detail}" />
</td>
<td>
{$product.ean13}
@@ -100,7 +100,7 @@
<input type="text" name="input_tax_rate_{$product.id_product}_{$product.id_product_attribute}" value="{round($product.tax_rate, 4)}" size="5" />%
</td>
<td class="center">
<a href="#" id="deletelink|{$product.id_product}_{$product.id_product_attribute}" class="removeProductFromSupplierOrderLink">
<a href="#" id="deletelink|{$product.id_product}_{$product.id_product_attribute}" class="removeProductFromSupplyOrderLink">
<img src="../img/admin/delete.gif" alt="{l s='Remove this product from the order'}" title="{l s='Remove this product from the order'}" />
</a>
</td>
@@ -132,7 +132,7 @@
}
// add a new line in the products table
$('#products_in_supplier_order > tbody:last').append(
$('#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.ean13+'<input type="hidden" name="input_ean13_'+product_infos.id+'" value="'+product_infos.ean13+'" /></td>'+
@@ -142,7 +142,7 @@
'<td class="center"><input type="text" name="input_quantity_expected_'+product_infos.id+'" value="0" size="5" /></td>'+
'<td class="center"><input type="text" name="input_discount_rate_'+product_infos.id+'" value="0" size="5" />%</td>'+
'<td class="center"><input type="text" name="input_tax_rate_'+product_infos.id+'" value="0" size="5" />%</td>'+
'<td class="center"><a href="#" class="removeProductFromSupplierOrderLink" id="deletelink|'+product_infos.id+'">'+
'<td class="center"><a href="#" class="removeProductFromSupplyOrderLink" id="deletelink|'+product_infos.id+'">'+
'<img src="../img/admin/delete.gif" alt="{l s="Remove this product from the order"}" title="{l s="Remove this product from the order"}" />'+
'</a></td></tr>'
);
@@ -163,7 +163,7 @@
/* function autocomplete */
$(function() {
// add click event on just created delete item link
$('a.removeProductFromSupplierOrderLink').live('click', function() {
$('a.removeProductFromSupplyOrderLink').live('click', function() {
var id = $(this).attr('id');
var product_id = id.split('|')[1];
@@ -192,7 +192,7 @@
btn_save = $('span[class~="process-icon-save"]').parent();
btn_save.click(function() {
$('#supplier_order_form').submit();
$('#supply_order_form').submit();
});
// bind enter key event on search field
@@ -0,0 +1,125 @@
{*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2011 PrestaShop SA
* @version Release: $Revision$
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<script type="text/javascript">
$(document).ready(function() {
$('#details_{$id}').click(function() {
if (typeof(this.dataMaped) == 'undefined') {
$.ajax({
url: 'index.php',
data: {
id_supply_order_detail: '{$id}',
controller: '{$controller}',
token: '{$token}',
action: '{$action}',
ajax: true
},
context: document.body,
dataType: 'json',
context: this,
async: false,
success: function(data) {
if (typeof(data.use_parent_structure) == 'undefined' || (data.use_parent_structure == true))
{
if ($('#details_{$id}').parent().parent().hasClass('alt_row'))
var alt_row = true;
else
var alt_row = false;
$('#details_{$id}').parent().parent().after($('<tr class="details_{$id} small '+(alt_row ? 'alt_row' : '')+'"></tr>')
.append($('<td style="border:none!important;" class="empty"></td>')
.attr('colspan', $('#details_{$id}').parent().parent().find('td').length)));
$.each(data.data, function(it, row)
{
var content = $('<tr class="action_details details_{$id} '+(alt_row ? 'alt_row' : '')+'"></tr>');
content.append($('<td class="empty"></td>'));
var first = true;
var count = 0; // Number of non-empty collum
$.each(row, function(it)
{
if(typeof(data.fields_display[it]) != 'undefined')
count++;
});
$.each(data.fields_display, function(it, line)
{
if (typeof(row[it]) == 'undefined')
{
if (first || count == 0)
content.append($('<td class="'+this.align+' empty"></td>'));
else
content.append($('<td class="'+this.align+'"></td>'));
}
else
{
count--;
if (first)
{
first = false;
content.append($('<td class="'+this.align+' first">'+row[it]+'</td>'));
}
else if (count == 0)
content.append($('<td class="'+this.align+' last">'+row[it]+'</td>'));
else
content.append($('<td class="'+this.align+' '+count+'">'+row[it]+'</td>'));
}
});
content.append($('<td class="empty"></td>'));
$('#details_{$id}').parent().parent().after(content);
});
}
else
{
if ($('#details_{$id}').parent().parent().hasClass('alt_row'))
var content = $('<tr class="details_{$id} alt_row"></tr>');
else
var content = $('<tr class="details_{$id}"></tr>');
content.append($('<td style="border:none!important;">'+data.data+'</td>').attr('colspan', $('#details_{$id}').parent().parent().find('td').length));
$('#details_{$id}').parent().parent().after(content);
}
this.dataMaped = true;
this.opened = false;
initTableDnD('.details_{$id} table.tableDnD');
}
});
}
if (this.opened)
{
$(this).find('img').attr('src', '../img/admin/more.png');
$(this).parent().parent().parent().find('.details_{$id}').hide();
this.opened = false
}
else
{
$(this).find('img').attr('src', '../img/admin/less.png');
$(this).parent().parent().parent().find('.details_{$id}').show();
this.opened = true;
}
return false;
});
});
</script>
<a href="#" id="details_{$id}">
<img src="../img/admin/more.png" alt="{$action}" title="{$action}" />
</a>