|
@@ -203,6 +203,7 @@ if (empty($reshook)) {
|
|
|
$moline->fk_default_workstation = $tmpproduct->fk_default_workstation;
|
|
|
}
|
|
|
$moline->disable_stock_change = ($tmpproduct->type == Product::TYPE_SERVICE ? 1 : 0);
|
|
|
+ if ($conf->global->PRODUCT_USE_UNITS) $moline->fk_unit = $tmpproduct->fk_unit;
|
|
|
}
|
|
|
|
|
|
$resultline = $moline->create($user, false); // Never use triggers here
|
|
@@ -812,6 +813,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|
|
print '<td>'.$langs->trans("Product").'</td>';
|
|
|
// Qty
|
|
|
print '<td class="right">'.$langs->trans("Qty").'</td>';
|
|
|
+ // Unit
|
|
|
+ if ($conf->global->PRODUCT_USE_UNITS) print '<td class="right">' . $langs->trans("Unit") . '</td>';
|
|
|
// Cost price
|
|
|
if ($permissiontoupdatecost && !empty($conf->global->MRP_SHOW_COST_FOR_CONSUMPTION)) {
|
|
|
print '<td class="right">'.$langs->trans("UnitCost").'</td>';
|
|
@@ -977,6 +980,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|
|
print '<td class="right nowraponall">';
|
|
|
print '<input name="qty_lineProduce" type="number" value="'. $line->qty.'" width="25px">';
|
|
|
print '</td>';
|
|
|
+ // Unit
|
|
|
+ if ($conf->global->PRODUCT_USE_UNITS) {
|
|
|
+ print '<td class="right nowraponall">';
|
|
|
+ print measuringUnitString($line->fk_unit, '', '', 1);
|
|
|
+ print '</td>';
|
|
|
+ }
|
|
|
// Qty consumed
|
|
|
print '<td class="right">';
|
|
|
print ' ' . price2num($alreadyconsumed, 'MS');
|
|
@@ -1033,6 +1042,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|
|
}
|
|
|
print price2num($line->qty, 'MS');
|
|
|
print '</td>';
|
|
|
+ // Unit
|
|
|
+ if ($conf->global->PRODUCT_USE_UNITS) {
|
|
|
+ print '<td class="right nowraponall">';
|
|
|
+ print measuringUnitString($line->fk_unit, '', '', 1);
|
|
|
+ print '</td>';
|
|
|
+ }
|
|
|
// Cost price
|
|
|
if ($permissiontoupdatecost && !empty($conf->global->MRP_SHOW_COST_FOR_CONSUMPTION)) {
|
|
|
print '<td class="right nowraponall">';
|
|
@@ -1228,6 +1243,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|
|
// Qty
|
|
|
print '<td class="right"><input type="text" class="width50 right" id="qtytoconsume-' . $line->id . '-' . $i . '" name="qty-' . $line->id . '-' . $i . '" value="' . $preselected . '" ' . $disable . '></td>';
|
|
|
|
|
|
+ // Unit
|
|
|
+ if ($conf->global->PRODUCT_USE_UNITS) print '<td></td>';
|
|
|
+
|
|
|
// Cost
|
|
|
if ($permissiontoupdatecost && !empty($conf->global->MRP_SHOW_COST_FOR_CONSUMPTION)) {
|
|
|
print '<td></td>';
|
|
@@ -1348,6 +1366,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|
|
print '<td>'.$langs->trans("Product").'</td>';
|
|
|
// Qty
|
|
|
print '<td class="right">'.$langs->trans("Qty").'</td>';
|
|
|
+ /// Unit
|
|
|
+ if ($conf->global->PRODUCT_USE_UNITS) print '<td class="right">'.$langs->trans("Unit").'</td>';
|
|
|
// Cost price
|
|
|
if ($permissiontoupdatecost) {
|
|
|
if (empty($bomcostupdated)) {
|
|
@@ -1397,6 +1417,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|
|
print '</td>';
|
|
|
// Qty
|
|
|
print '<td class="right"><input type="text" name="qtytoadd" value="1" class="width50 right"></td>';
|
|
|
+ //Unit
|
|
|
+ if ($conf->global->PRODUCT_USE_UNITS) print '<td></td>';
|
|
|
// Cost price
|
|
|
if ($permissiontoupdatecost) {
|
|
|
print '<td></td>';
|
|
@@ -1460,6 +1482,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|
|
print '</td>';
|
|
|
// Qty
|
|
|
print '<td class="right">'.$line->qty.'</td>';
|
|
|
+ // Unit
|
|
|
+ if ($conf->global->PRODUCT_USE_UNITS) print '<td class="right">'.measuringUnitString($line->fk_unit, '', '', 1).'</td>';
|
|
|
// Cost price
|
|
|
if ($permissiontoupdatecost) {
|
|
|
// Defined $manufacturingcost
|
|
@@ -1555,6 +1579,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|
|
print '</td>';
|
|
|
// Qty
|
|
|
print '<td></td>';
|
|
|
+ // Unit
|
|
|
+ if ($conf->global->PRODUCT_USE_UNITS) print '<td></td>';
|
|
|
// Cost price
|
|
|
if ($permissiontoupdatecost) {
|
|
|
print '<td></td>';
|
|
@@ -1604,6 +1630,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|
|
}
|
|
|
// Qty
|
|
|
print '<td class="right"><input type="text" class="width50 right" id="qtytoproduce-'.$line->id.'-'.$i.'" name="qtytoproduce-'.$line->id.'-'.$i.'" value="'.$preselected.'"></td>';
|
|
|
+ //Unit
|
|
|
+ if ($conf->global->PRODUCT_USE_UNITS) print '<td class="right"></td>';
|
|
|
// Cost
|
|
|
if ($permissiontoupdatecost) {
|
|
|
// Defined $manufacturingcost
|