// Updated OrderHistory / StockManager. Added feature to StockCover: it is now possible to display the number of sales per product / and highlight products which coverage is less than a given threshold

This commit is contained in:
bMancone
2011-12-13 09:48:52 +00:00
parent 133de02a11
commit 4180588c40
7 changed files with 132 additions and 36 deletions

View File

@@ -222,7 +222,7 @@ form#product_form h4 { font-size:18px; font-weight:normal;}
.filter-module .button-filter { float:right;}
/*FILTER STOCK*/
.filter-stock { background-color:#ebedf4; border:1px solid #c2c4d9; margin-bottom:15px; padding:10px; display:block; min-height:25px;}
.filter-stock { background-color:#ebedf4; border:1px solid #c2c4d9; margin-bottom:15px; padding:10px; display:block; min-height:65px;}
.filter-stock #stock_cover {float:left; margin-right:30px;}
.filter-stock #stock_instant_state {float:left; margin-right:30px;}
.filter-stock #supply_orders {float:left; margin-right:30px;}

View File

@@ -55,6 +55,10 @@ $(document).ready(function() {
.attr('colspan', $('#details_{$id}').parent().parent().find('td').length)));
$.each(data.data, function(it, row)
{
var bg_color = ''; // Color
if (row.color)
bg_color = 'style="background:' + row.color +';"';
var content = $('<tr class="action_details details_{$id} '+(alt_row ? 'alt_row' : '')+'"></tr>');
content.append($('<td class="empty"></td>'));
var first = true;
@@ -69,9 +73,9 @@ $(document).ready(function() {
if (typeof(row[it]) == 'undefined')
{
if (first || count == 0)
content.append($('<td class="'+this.align+' empty"></td>'));
content.append($('<td class="'+this.align+' empty"' + bg_color + '></td>'));
else
content.append($('<td class="'+this.align+'"></td>'));
content.append($('<td class="'+this.align+'"' + bg_color + '></td>'));
}
else
{
@@ -79,12 +83,12 @@ $(document).ready(function() {
if (first)
{
first = false;
content.append($('<td class="'+this.align+' first">'+row[it]+'</td>'));
content.append($('<td class="'+this.align+' first"' + bg_color + '>'+row[it]+'</td>'));
}
else if (count == 0)
content.append($('<td class="'+this.align+' last">'+row[it]+'</td>'));
content.append($('<td class="'+this.align+' last"' + bg_color + '>'+row[it]+'</td>'));
else
content.append($('<td class="'+this.align+' '+count+'">'+row[it]+'</td>'));
content.append($('<td class="'+this.align+' '+count+'"' + bg_color + '>'+row[it]+'</td>'));
}
});
content.append($('<td class="empty"></td>'));

View File

@@ -30,20 +30,31 @@
<input type="hidden" name="controller" value="AdminStockCover" />
<input type="hidden" name="token" value="{$token}" />
{if count($stock_cover_periods) > 1}
<label for="coverage_period">{l s='Filter by period/warehouse:'}</label>
<select name="coverage_period" onChange="$(this).parent().submit();">
<div>
<label for="coverage_period">{l s='Filter by period:'}</label>
<select name="coverage_period" onChange="$(this).parent().parent().submit();">
{foreach from=$stock_cover_periods key=k item=i}
<option {if $i == $stock_cover_cur_period} selected="selected"{/if} value="{$i}">{$k}</option>
{/foreach}
</select>
</div>
{/if}
{if count($stock_cover_warehouses) > 0}
<select name="id_warehouse" onChange="$(this).parent().submit();">
<div>
<label for="id_warehouse">{l s='Filter by warehouse:'}</label>
<select name="id_warehouse" onChange="$(this).parent().parent().submit();"">
{foreach from=$stock_cover_warehouses key=k item=i}
<option {if $i.id_warehouse == $stock_cover_cur_warehouse} selected="selected"{/if} value="{$i.id_warehouse}">{$i.name}</option>
{/foreach}
</select>
</div>
{/if}
<div>
<label for="warn_days">{l s='Highlight when coverage is less than:'}</label>
<input name="warn_days" type="text" size="3" onChange="$(this).parent().parent().submit();"
value="{if isset($stock_cover_warn_days)}{$stock_cover_warn_days}{/if}">
</input>
</div>
</form>
</div>
{/block}

View File

@@ -30,13 +30,18 @@
<form id="supply_orders" type="get">
<input type="hidden" name="controller" value="AdminSupplyOrders" />
<input type="hidden" name="token" value="{$token}" />
<label for="filter_status">{l s='Choose not to display completed/canceled orders and filter by warehouse:'}</label>
<input type="checkbox" name="filter_status" class="noborder" onChange="$(this).parent().submit();" {if $filter_status == 1}value="on" checked{/if}></input>
<select name="id_warehouse" onChange="$(this).parent().submit();">
<div>
<label for="id_warehouse">{l s='Filter by warehouse:'}</label>
<select name="id_warehouse" onChange="$(this).parent().parent().submit();">
{foreach from=$warehouses key=k item=i}
<option {if $i.id_warehouse == $current_warehouse} selected="selected"{/if} value="{$i.id_warehouse}">{$i.name}</option>
{/foreach}
</select>
</select>
</div>
<div style="margin-top: 5px;">
<label for="filter_status">{l s='Choose not to display completed/canceled orders:'}</label>
<input type="checkbox" name="filter_status" class="noborder" onChange="$(this).parent().parent().submit();" {if $filter_status == 1}value="on" checked{/if}></input>
</div>
</form>
</div>
{/if}