FIX Retours

This commit is contained in:
atm-lena 2022-07-08 16:02:31 +02:00
parent 7c82fc5da6
commit d42d910c08
4 changed files with 9 additions and 6 deletions

View File

@ -160,7 +160,7 @@ if (empty($reshook)) {
$idprod = $bom_child->fk_product;
}
} else {
$idprod = (int) GETPOST('idprod', 'int');
$idprod = (!empty(GETPOST('idprodservice', 'int')) ? GETPOST('idprodservice', 'int') : (int) GETPOST('idprod', 'int'));
}
$qty = price2num(GETPOST('qty', 'alpha'), 'MS');
@ -205,6 +205,7 @@ if (empty($reshook)) {
$action = '';
} else {
unset($_POST['idprod']);
unset($_POST['idprodservice']);
unset($_POST['qty']);
unset($_POST['qty_frozen']);
unset($_POST['disable_stock_change']);
@ -247,6 +248,7 @@ if (empty($reshook)) {
$action = '';
} else {
unset($_POST['idprod']);
unset($_POST['idprodservice']);
unset($_POST['qty']);
unset($_POST['qty_frozen']);
unset($_POST['disable_stock_change']);

View File

@ -1157,7 +1157,7 @@ class BOM extends CommonObject
$workstation = new Workstation($this->db);
$res = $workstation->fetch($tmpproduct->fk_default_workstation);
if($res > 0) $line->total_cost = price2num($qty * $workstation->thm_operator_estimated, 'MT');
if($res > 0) $line->total_cost = price2num($qty * ($workstation->thm_operator_estimated + $workstation->thm_machine_estimated), 'MT');
else {
$this->error = $workstation->error;
return -3;

View File

@ -117,9 +117,10 @@ if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) {
$statustoshow = -1;
if (!empty($conf->global->ENTREPOT_EXTRA_STATUS)) {
// hide products in closed warehouse, but show products for internal transfer
$form->select_produits(GETPOST('idprod', 'int'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, 'warehouseopen,warehouseinternal', GETPOST('combinations', 'array'));
} else {
$form->select_produits(GETPOST('idprod', 'int'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, '', GETPOST('combinations', 'array'));
$form->select_produits(GETPOST('idprod', 'int'), (($filtertype == 1) ? 'idprodservice' : 'idprod'), $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, 'warehouseopen,warehouseinternal', GETPOST('combinations', 'array'));
}
else {
$form->select_produits(GETPOST('idprod', 'int'), (($filtertype == 1) ? 'idprodservice' : 'idprod'), $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, '', GETPOST('combinations', 'array'));
}
echo '</span>';

View File

@ -87,7 +87,7 @@ if($filtertype != 1) {
print '<td class="linecolunit right">' . $form->textwithpicto($langs->trans('Unit'), '').'</td>';
if($conf->workstation->enabled) print '<td class="linecolworkstation right">' . $form->textwithpicto($langs->trans('Workstation'), '') . '</td>';
if($conf->workstation->enabled) print '<td class="linecolworkstation right">' . $form->textwithpicto($langs->trans('DefaultWorkstation'), '') . '</td>';
// Cost
print '<td class="linecolcost right">'.$form->textwithpicto($langs->trans("TotalCost"), $langs->trans("BOMTotalCostService")).'</td>';