From 0eb8eab7f0d382055ad29291b85233a09cfffcdf Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Mon, 21 Feb 2022 14:51:57 +0000 Subject: [PATCH] Fixing style errors. --- htdocs/product/inventory/inventory.php | 150 ++++++++++++------------- 1 file changed, 75 insertions(+), 75 deletions(-) diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php index b593fc1b414..536aaf7d354 100644 --- a/htdocs/product/inventory/inventory.php +++ b/htdocs/product/inventory/inventory.php @@ -176,8 +176,8 @@ if (empty($reshook)) { $datemovement = ''; //$inventorycode = 'INV'.$object->id; $inventorycode = 'INV-'.$object->ref; - $price = 0; - if(!empty($line->pmp_real) && !empty($conf->global->INVENTORY_MANAGE_REAL_PMP)) $price = $line->pmp_real; + $price = 0; + if (!empty($line->pmp_real) && !empty($conf->global->INVENTORY_MANAGE_REAL_PMP)) $price = $line->pmp_real; $idstockmove = $stockmovment->_create($user, $line->fk_product, $line->fk_warehouse, $stock_movement_qty, $movement_type, $price, $langs->trans('LabelOfInventoryMovemement', $object->ref), $inventorycode, $datemovement, '', '', $line->batch); if ($idstockmove < 0) { @@ -186,15 +186,15 @@ if (empty($reshook)) { break; } - if(!empty($line->pmp_real) && !empty($conf->global->INVENTORY_MANAGE_REAL_PMP)) { - $sqlpmp = 'UPDATE '.MAIN_DB_PREFIX.'product SET pmp = '.((float) $line->pmp_real).' WHERE rowid = '.((int) $line->fk_product); - $resqlpmp = $db->query($sqlpmp); - if(! $resqlpmp) { + if (!empty($line->pmp_real) && !empty($conf->global->INVENTORY_MANAGE_REAL_PMP)) { + $sqlpmp = 'UPDATE '.MAIN_DB_PREFIX.'product SET pmp = '.((float) $line->pmp_real).' WHERE rowid = '.((int) $line->fk_product); + $resqlpmp = $db->query($sqlpmp); + if (! $resqlpmp) { $error++; setEventMessages($db->lasterror(), null, 'errors'); break; } - } + } // Update line with id of stock movement (and the start quantity if it has changed this last recording) $sqlupdate = "UPDATE ".MAIN_DB_PREFIX."inventorydet"; @@ -259,8 +259,8 @@ if (empty($reshook)) { if ($result > 0) { $inventoryline->qty_stock = price2num(GETPOST('stock_qty_'.$lineid, 'alpha'), 'MS'); // The new value that was set in as hidden field $inventoryline->qty_view = $qtytoupdate; // The new value we want - $inventoryline->pmp_real = price2num(GETPOST('realpmp_'.$lineid, 'alpha'), 'MS'); - $inventoryline->pmp_expected = price2num(GETPOST('expectedpmp_'.$lineid, 'alpha'), 'MS'); + $inventoryline->pmp_real = price2num(GETPOST('realpmp_'.$lineid, 'alpha'), 'MS'); + $inventoryline->pmp_expected = price2num(GETPOST('expectedpmp_'.$lineid, 'alpha'), 'MS'); $resultupdate = $inventoryline->update($user); } } else { @@ -880,7 +880,7 @@ if ($object->id > 0) { print ''; print $form->textwithpicto($langs->trans("RealQty"), $langs->trans("InventoryRealQtyHelp")); print ''; - if(!empty($conf->global->INVENTORY_MANAGE_REAL_PMP)) { + if (!empty($conf->global->INVENTORY_MANAGE_REAL_PMP)) { print ''.$langs->trans('PMPExpected').''; print ''.$langs->trans('ExpectedValuation').''; print ''.$langs->trans('PMPReal').''; @@ -916,7 +916,7 @@ if ($object->id > 0) { print ''; print ''; print ''; - if(!empty($conf->global->INVENTORY_MANAGE_REAL_PMP)) { + if (!empty($conf->global->INVENTORY_MANAGE_REAL_PMP)) { print ''; print ''; print ''; @@ -1021,9 +1021,9 @@ if ($object->id > 0) { print ''; print ''; print ''; - if(! empty($conf->global->INVENTORY_MANAGE_REAL_PMP)) { + if (! empty($conf->global->INVENTORY_MANAGE_REAL_PMP)) { //PMP Expected - if(! empty($obj->pmp_expected)) $pmp_expected = $obj->pmp_expected; + if (! empty($obj->pmp_expected)) $pmp_expected = $obj->pmp_expected; else $pmp_expected = $product_static->pmp; $pmp_valuation = $pmp_expected * $valuetoshow; print ''; @@ -1037,7 +1037,7 @@ if ($object->id > 0) { print ''; - if(! empty($obj->pmp_real)) $pmp_real = $obj->pmp_real; + if (! empty($obj->pmp_real)) $pmp_real = $obj->pmp_real; else $pmp_real = $product_static->pmp; $pmp_valuation_real = $pmp_real * $qty_view; print ''; @@ -1060,9 +1060,9 @@ if ($object->id > 0) { print ''; print $obj->qty_view; // qty found print ''; - if(!empty($conf->global->INVENTORY_MANAGE_REAL_PMP)) { + if (!empty($conf->global->INVENTORY_MANAGE_REAL_PMP)) { //PMP Expected - if(! empty($obj->pmp_expected)) $pmp_expected = $obj->pmp_expected; + if (! empty($obj->pmp_expected)) $pmp_expected = $obj->pmp_expected; else $pmp_expected = $product_static->pmp; $pmp_valuation = $pmp_expected * $valuetoshow; print ''; @@ -1074,9 +1074,9 @@ if ($object->id > 0) { //PMP Real print ''; - if(! empty($obj->pmp_real)) $pmp_real = $obj->pmp_real; + if (! empty($obj->pmp_real)) $pmp_real = $obj->pmp_real; else $pmp_real = $product_static->pmp; - $pmp_valuation_real = $pmp_real * $obj->qty_view; + $pmp_valuation_real = $pmp_real * $obj->qty_view; print price($pmp_real); print ''; print ''; @@ -1101,7 +1101,7 @@ if ($object->id > 0) { } else { dol_print_error($db); } - if(!empty($conf->global->INVENTORY_MANAGE_REAL_PMP)) { + if (!empty($conf->global->INVENTORY_MANAGE_REAL_PMP)) { print ''; print ''.$langs->trans("Total").''; print ''.price($totalExpectedValuation).''; @@ -1133,68 +1133,68 @@ if ($object->id > 0) { print ''; - if(! empty($conf->global->INVENTORY_MANAGE_REAL_PMP)) { + if (! empty($conf->global->INVENTORY_MANAGE_REAL_PMP)) { ?>