Display delta quantity in inventories.
This commit is contained in:
parent
fc850609e8
commit
02ad8b8858
@ -564,6 +564,11 @@ if ($object->id > 0) {
|
|||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
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 $form->textwithpicto($langs->trans("Delta"), $langs->trans("InventoryRealQtyHelp"));
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
if ($object->status == $object::STATUS_VALIDATED) {
|
if ($object->status == $object::STATUS_VALIDATED) {
|
||||||
// Actions
|
// Actions
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
@ -590,6 +595,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>';
|
||||||
@ -657,13 +663,20 @@ if ($object->id > 0) {
|
|||||||
print $obj->qty_stock;
|
print $obj->qty_stock;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Real quantity
|
// Delta quantity
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
if ($object->status == $object::STATUS_VALIDATED) {
|
if ($object->status == $object::STATUS_VALIDATED) {
|
||||||
$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;
|
||||||
$totalfound += price2num($qty_view, 'MS');
|
$totalfound += price2num($qty_view, 'MS');
|
||||||
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>';
|
||||||
|
|
||||||
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>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -671,7 +684,16 @@ if ($object->id > 0) {
|
|||||||
print $obj->qty_view;
|
print $obj->qty_view;
|
||||||
$totalfound += $obj->qty_view;
|
$totalfound += $obj->qty_view;
|
||||||
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 '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user