2
0
forked from Wavyzz/dolibarr

Maxi debug and enhancement of module batch.

This commit is contained in:
Laurent Destailleur
2015-02-11 22:54:06 +01:00
parent 7869bc0d7f
commit 179cbbd187
17 changed files with 412 additions and 243 deletions

View File

@@ -19,11 +19,15 @@
// \brief File that include javascript functions used when dispatching batch-enabled product
//
function AddLineBatch(index) {
/**
* @param index int number of produt. 0 = first product line
*/
function addLineBatch(index)
{
var nme = 'dluo_0_'+index;
$row=$("tr[name='"+nme+"']").clone(true);
$row.find("input[name^='qty']").val('');
var trs = $("tr[name^='dluo_'][name$='_"+index+"']");
var trs = $("tr[name^='dluo_'][name$='_"+index+"']"); /* trs.length = position of line for batch */
var newrow=$row.html().replace(/_0_/g,"_"+(trs.length)+"_");
$row.html(newrow);
//clear value
@@ -31,4 +35,13 @@ function AddLineBatch(index) {
//change name of row
$row.attr('name','dluo_'+trs.length+'_'+index);
$("tr[name^='dluo_'][name$='_"+index+"']:last").after($row);
}
/* Suffix of lines are: _ trs.length _ index */
jQuery("#lot_number_"+trs.length+"_"+index).focus();
nb = jQuery("#qty_"+(trs.length - 1)+"_"+index).val();
if (nb > 0)
{
jQuery("#qty_"+(trs.length - 1)+"_"+index).val(1);
jQuery("#qty_"+trs.length+"_"+index).val(nb - 1);
}
}