Fixing style errors.

This commit is contained in:
stickler-ci 2022-08-24 10:20:16 +00:00
parent ab2b445b53
commit 8f336b1e50
2 changed files with 361 additions and 363 deletions

View File

@ -147,7 +147,7 @@ if (empty($reshook)) {
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
// Add line // Add line
if ($action == 'addline' && $user->rights->bom->write) { if ($action == 'addline' && $user->rights->bom->write) {
$langs->load('errors'); $langs->load('errors');
$error = 0; $error = 0;
@ -194,17 +194,16 @@ if ($action == 'addline' && $user->rights->bom->write) {
unset($_POST['qty']); unset($_POST['qty']);
unset($_POST['qty_frozen']); unset($_POST['qty_frozen']);
unset($_POST['disable_stock_change']); unset($_POST['disable_stock_change']);
} }
$object->fetchLines(); $object->fetchLines();
$object->calculateCosts(); $object->calculateCosts();
} }
} }
// Update line // Update line
if ($action == 'updateline' && $user->rights->bom->write) { if ($action == 'updateline' && $user->rights->bom->write) {
$langs->load('errors'); $langs->load('errors');
$error = 0; $error = 0;
@ -235,31 +234,30 @@ if ($action == 'updateline' && $user->rights->bom->write) {
unset($_POST['qty']); unset($_POST['qty']);
unset($_POST['qty_frozen']); unset($_POST['qty_frozen']);
unset($_POST['disable_stock_change']); unset($_POST['disable_stock_change']);
} }
$object->fetchLines(); $object->fetchLines();
$object->calculateCosts(); $object->calculateCosts();
} }
} }
/* /*
* View * View
*/ */
$form = new Form($db); $form = new Form($db);
$formfile = new FormFile($db); $formfile = new FormFile($db);
$title = $langs->trans('BOM'); $title = $langs->trans('BOM');
$help_url ='EN:Module_BOM'; $help_url ='EN:Module_BOM';
llxHeader('', $title, $help_url); llxHeader('', $title, $help_url);
// Part to create // Part to create
if ($action == 'create') { if ($action == 'create') {
print load_fiche_titre($langs->trans("NewBOM"), '', 'bom'); print load_fiche_titre($langs->trans("NewBOM"), '', 'bom');
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
@ -284,10 +282,10 @@ if ($action == 'create') {
print $form->buttonsSaveCancel("Create"); print $form->buttonsSaveCancel("Create");
print '</form>'; print '</form>';
} }
// Part to edit record // Part to edit record
if (($id || $ref) && $action == 'edit') { if (($id || $ref) && $action == 'edit') {
print load_fiche_titre($langs->trans("BillOfMaterials"), '', 'cubes'); print load_fiche_titre($langs->trans("BillOfMaterials"), '', 'cubes');
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
@ -315,10 +313,10 @@ if (($id || $ref) && $action == 'edit') {
print $form->buttonsSaveCancel("Create"); print $form->buttonsSaveCancel("Create");
print '</form>'; print '</form>';
} }
// Part to show record // Part to show record
if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) { if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) {
$head = bomPrepareHead($object); $head = bomPrepareHead($object);
print dol_get_fiche_head($head, 'card', $langs->trans("BillOfMaterials"), -1, 'bom'); print dol_get_fiche_head($head, 'card', $langs->trans("BillOfMaterials"), -1, 'bom');

View File

@ -569,7 +569,7 @@ class BOM extends CommonObject
* @param string $import_key Import Key * @param string $import_key Import Key
* @return int <0 if KO, Id of created object if OK * @return int <0 if KO, Id of created object if OK
*/ */
public function addLine($fk_product, $qty, $qty_frozen = 0, $disable_stock_change = 0, $efficiency = 1.0, $position = -1, $fk_bom_child = null, $import_key = null, $fk_unit='') public function addLine($fk_product, $qty, $qty_frozen = 0, $disable_stock_change = 0, $efficiency = 1.0, $position = -1, $fk_bom_child = null, $import_key = null, $fk_unit = '')
{ {
global $mysoc, $conf, $langs, $user; global $mysoc, $conf, $langs, $user;