Display delta quantity in inventories.
This commit is contained in:
parent
948f0c32b6
commit
0120608e21
@ -885,6 +885,11 @@ if ($object->id > 0) {
|
|||||||
print '<td class="right">';
|
print '<td class="right">';
|
||||||
print $form->textwithpicto($langs->trans("RealQty"), $langs->trans("InventoryRealQtyHelp"));
|
print $form->textwithpicto($langs->trans("RealQty"), $langs->trans("InventoryRealQtyHelp"));
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
|
print '<td class="right">';
|
||||||
|
print $langs->trans("Delta");
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
if ($object->status == $object::STATUS_DRAFT || $object->status == $object::STATUS_VALIDATED) {
|
if ($object->status == $object::STATUS_DRAFT || $object->status == $object::STATUS_VALIDATED) {
|
||||||
// Actions or link to stock movement
|
// Actions or link to stock movement
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
@ -916,6 +921,7 @@ if ($object->id > 0) {
|
|||||||
print '<input type="text" name="qtytoadd" class="maxwidth75" value="">';
|
print '<input type="text" name="qtytoadd" class="maxwidth75" value="">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
// Actions
|
// Actions
|
||||||
|
print '<td></td>';
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
print '<input type="submit" class="button paddingright" name="addline" value="'.$langs->trans("Add").'">';
|
print '<input type="submit" class="button paddingright" name="addline" value="'.$langs->trans("Add").'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -995,9 +1001,7 @@ if ($object->id > 0) {
|
|||||||
print '<input type="hidden" name="stock_qty_'.$obj->rowid.'" value="'.$valuetoshow.'">';
|
print '<input type="hidden" name="stock_qty_'.$obj->rowid.'" value="'.$valuetoshow.'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Real quantity
|
|
||||||
if ($object->status == $object::STATUS_DRAFT || $object->status == $object::STATUS_VALIDATED) {
|
if ($object->status == $object::STATUS_DRAFT || $object->status == $object::STATUS_VALIDATED) {
|
||||||
print '<td class="right">';
|
|
||||||
$qty_view = GETPOST("id_".$obj->rowid) && price2num(GETPOST("id_".$obj->rowid), 'MS') >= 0 ? GETPOST("id_".$obj->rowid) : $obj->qty_view;
|
$qty_view = GETPOST("id_".$obj->rowid) && price2num(GETPOST("id_".$obj->rowid), 'MS') >= 0 ? GETPOST("id_".$obj->rowid) : $obj->qty_view;
|
||||||
|
|
||||||
//if (!$hasinput && $qty_view !== null && $obj->qty_stock != $qty_view) {
|
//if (!$hasinput && $qty_view !== null && $obj->qty_stock != $qty_view) {
|
||||||
@ -1005,12 +1009,20 @@ if ($object->id > 0) {
|
|||||||
$hasinput = true;
|
$hasinput = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Real quantity
|
||||||
|
print '<td class="right">';
|
||||||
print '<a id="undochangesqty_'.$obj->rowid.'" href="#" class="undochangesqty reposition marginrightonly" title="'.dol_escape_htmltag($langs->trans("Clear")).'">';
|
print '<a id="undochangesqty_'.$obj->rowid.'" href="#" class="undochangesqty reposition marginrightonly" title="'.dol_escape_htmltag($langs->trans("Clear")).'">';
|
||||||
print img_picto('', 'eraser', 'class="opacitymedium"');
|
print img_picto('', 'eraser', 'class="opacitymedium"');
|
||||||
print '</a>';
|
print '</a>';
|
||||||
print '<input type="text" class="maxwidth75 right realqty" name="id_'.$obj->rowid.'" id="id_'.$obj->rowid.'_input" value="'.$qty_view.'">';
|
print '<input type="text" class="maxwidth75 right realqty" name="id_'.$obj->rowid.'" id="id_'.$obj->rowid.'_input" value="'.$qty_view.'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
|
// Delta quantity
|
||||||
|
$dt = $obj->qty_view - $obj->qty_stock;
|
||||||
|
print '<td class="maxwidth75 right deltaqty" id="id_'.$obj->rowid.'">';
|
||||||
|
if($dt != 0) print $dt;
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
// Picto delete line
|
// Picto delete line
|
||||||
print '<td class="right">';
|
print '<td class="right">';
|
||||||
print '<a class="reposition" href="'.DOL_URL_ROOT.'/product/inventory/inventory.php?id='.$object->id.'&lineid='.$obj->rowid.'&action=deleteline&token='.newToken().'">'.img_delete().'</a>';
|
print '<a class="reposition" href="'.DOL_URL_ROOT.'/product/inventory/inventory.php?id='.$object->id.'&lineid='.$obj->rowid.'&action=deleteline&token='.newToken().'">'.img_delete().'</a>';
|
||||||
@ -1018,9 +1030,17 @@ if ($object->id > 0) {
|
|||||||
print '<input type="hidden" class="maxwidth75 right realqty" name="id_'.$obj->rowid.'_input_tmp" id="id_'.$obj->rowid.'_input_tmp" value="'.$qty_tmp.'">';
|
print '<input type="hidden" class="maxwidth75 right realqty" name="id_'.$obj->rowid.'_input_tmp" id="id_'.$obj->rowid.'_input_tmp" value="'.$qty_tmp.'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
} else {
|
} else {
|
||||||
|
// Real quantity
|
||||||
print '<td class="right nowraponall">';
|
print '<td class="right nowraponall">';
|
||||||
print $obj->qty_view; // qty found
|
print $obj->qty_view; // qty found
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
|
// Delta quantity
|
||||||
|
$dt = $obj->qty_view - $obj->qty_stock;
|
||||||
|
print '<td class="right expectedqty" id="id_'.$obj->rowid.'">';
|
||||||
|
if($dt != 0) print $dt;
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
print '<td class="nowraponall right">';
|
print '<td class="nowraponall right">';
|
||||||
if ($obj->fk_movement > 0) {
|
if ($obj->fk_movement > 0) {
|
||||||
$stockmovment = new MouvementStock($db);
|
$stockmovment = new MouvementStock($db);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user