diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index c93fc9a7c81..a99f75d99ed 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -1690,11 +1690,11 @@ class pdf_cyan extends ModelePDFPropales /** * Define Array Column Field * - * @param object $object common object - * @param outputlangs $outputlangs langs - * @param int $hidedetails Do not show line details - * @param int $hidedesc Do not show desc - * @param int $hideref Do not show ref + * @param object $object common object + * @param Translate $outputlangs langs + * @param int $hidedetails Do not show line details + * @param int $hidedesc Do not show desc + * @param int $hideref Do not show ref * @return null */ function defineColumnField($object,$outputlangs,$hidedetails=0,$hidedesc=0,$hideref=0) diff --git a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php index 4a19d82e449..7f6fd99bd67 100644 --- a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php +++ b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php @@ -173,6 +173,7 @@ class doc_generic_reception_odt extends ModelePdfReception return $texte; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to build a document on disk using the generic odt module. * @@ -186,6 +187,7 @@ class doc_generic_reception_odt extends ModelePdfReception */ function write_file($object,$outputlangs,$srctemplatepath,$hidedetails=0,$hidedesc=0,$hideref=0) { + // phpcs:enable global $user,$langs,$conf,$mysoc,$hookmanager; if (empty($srctemplatepath)) @@ -517,6 +519,4 @@ class doc_generic_reception_odt extends ModelePdfReception return -1; } - -} - +} \ No newline at end of file diff --git a/htdocs/core/modules/reception/doc/pdf_squille.modules.php b/htdocs/core/modules/reception/doc/pdf_squille.modules.php index ed885643a66..17d7b353538 100644 --- a/htdocs/core/modules/reception/doc/pdf_squille.modules.php +++ b/htdocs/core/modules/reception/doc/pdf_squille.modules.php @@ -406,7 +406,7 @@ class pdf_squille extends ModelePdfReception $pageposafter=$pageposbefore; //print $pageposafter.'-'.$pageposbefore;exit; $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. - + pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxpicture-$curX,3,$curX,$curY,$hideref,$hidedesc); $pageposafter=$pdf->getPage(); @@ -585,6 +585,7 @@ class pdf_squille extends ModelePdfReception } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Show total to pay * @@ -597,6 +598,7 @@ class pdf_squille extends ModelePdfReception */ function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs,$totalOrdered) { + // phpcs:enable global $conf,$mysoc; $sign=1; @@ -627,23 +629,23 @@ class pdf_squille extends ModelePdfReception $totalWeight=$tmparray['weight']; $totalVolume=$tmparray['volume']; $totalToShip=$tmparray['toship']; - - - - + + + + // Set trueVolume and volume_units not currently stored into database if ($object->trueWidth && $object->trueHeight && $object->trueDepth) { $object->trueVolume= ($object->trueWidth * $object->trueHeight * $object->trueDepth); $object->volume_units=$object->size_units * 3; - + } - + if ($totalWeight!='') $totalWeighttoshow=showDimensionInBestUnit($totalWeight, 0, "weight", $outputlangs); if ($totalVolume!='') $totalVolumetoshow=showDimensionInBestUnit($totalVolume, 0, "volume", $outputlangs); if ($object->trueWeight) $totalWeighttoshow=showDimensionInBestUnit($object->trueWeight, $object->weight_units, "weight", $outputlangs); if ($object->trueVolume) $totalVolumetoshow=showDimensionInBestUnit($object->trueVolume, $object->volume_units, "volume", $outputlangs); - + $pdf->SetFillColor(255,255,255); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("Total"), 0, 'L', 1); @@ -962,7 +964,7 @@ class pdf_squille extends ModelePdfReception // If RECEPTION contact defined, we use it $usecontact=false; $arrayidcontact=$object->$origin->getIdContact('external','SHIPPING'); - + if (count($arrayidcontact) > 0) { $usecontact=true; @@ -992,7 +994,7 @@ class pdf_squille extends ModelePdfReception $pdf->SetFont('','', $default_font_size - 1); $pdf->SetXY($posx+2,$posy); $pdf->MultiCell($widthrecbox-2, 4, $carac_client, 0, 'L'); - + // Show recipient $widthrecbox=!empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 92 : 100; if ($this->page_largeur < 210) $widthrecbox=84; // To work with US executive format @@ -1007,8 +1009,8 @@ class pdf_squille extends ModelePdfReception $pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("Recipient").":", 0, 'L'); $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre); - - + + // Show sender name $pdf->SetXY($posx+2,$posy+3); $pdf->SetFont('','B',$default_font_size); @@ -1027,7 +1029,7 @@ class pdf_squille extends ModelePdfReception /** * Show footer of page. Need this->emetteur object * - * @param PDF $pdf PDF + * @param PDF $pdf PDF * @param Object $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text @@ -1039,6 +1041,4 @@ class pdf_squille extends ModelePdfReception $showdetails=$conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS; return pdf_pagefoot($pdf,$outputlangs,'RECEPTION_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,$showdetails,$hidefreetext); } - } - diff --git a/htdocs/core/modules/reception/mod_reception_beryl.php b/htdocs/core/modules/reception/mod_reception_beryl.php index 49369f91c87..4471637b41f 100644 --- a/htdocs/core/modules/reception/mod_reception_beryl.php +++ b/htdocs/core/modules/reception/mod_reception_beryl.php @@ -106,7 +106,7 @@ class mod_reception_beryl extends ModelNumRefReception $sql.= " FROM ".MAIN_DB_PREFIX."reception"; $sql.= " WHERE ref like '".$this->prefix."____-%'"; $sql.= " AND entity = ".$conf->entity; - + $resql=$db->query($sql); if ($resql) { @@ -141,5 +141,4 @@ class mod_reception_beryl extends ModelNumRefReception { return $this->getNextValue($objsoc,$objforref); } - -} +} \ No newline at end of file diff --git a/htdocs/core/modules/reception/mod_reception_moonstone.php b/htdocs/core/modules/reception/mod_reception_moonstone.php index 0c661e12cbe..3c0af25ffa3 100644 --- a/htdocs/core/modules/reception/mod_reception_moonstone.php +++ b/htdocs/core/modules/reception/mod_reception_moonstone.php @@ -128,10 +128,8 @@ class mod_reception_moonstone extends ModelNumRefReception * @param Object $objforref Reception object * @return string Next free value */ - function reception_get_num($objsoc,$objforref) - { - return $this->getNextValue($objsoc,$objforref); - } - -} - + function reception_get_num($objsoc,$objforref) + { + return $this->getNextValue($objsoc,$objforref); + } +} \ No newline at end of file diff --git a/htdocs/core/modules/reception/modules_reception.php b/htdocs/core/modules/reception/modules_reception.php index 609e5e315ad..57965e1b462 100644 --- a/htdocs/core/modules/reception/modules_reception.php +++ b/htdocs/core/modules/reception/modules_reception.php @@ -32,7 +32,8 @@ abstract class ModelePdfReception extends CommonDocGenerator var $error=''; - /** + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + /** * Return list of active generation modules * * @param DoliDB $db Database handler @@ -41,6 +42,7 @@ abstract class ModelePdfReception extends CommonDocGenerator */ static function liste_modeles($db,$maxfilenamelength=0) { + // phpcs:enable global $conf; $type='reception'; diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index ffbb5dbd765..5225931e835 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -46,7 +46,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/productlot.class.php'; if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; -if (! empty($conf->fournisseur->enabled)){ +if (! empty($conf->fournisseur->enabled)){ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.dispatch.class.php'; } @@ -140,7 +140,7 @@ if (empty($reshook)) $object->fetch($id); $result = $object->reOpen(); } - + // Confirm back to draft status if ($action == 'modif' && $user->rights->reception->creer) { @@ -220,7 +220,7 @@ if (empty($reshook)) // Create reception if ($action == 'add' && $user->rights->reception->creer) { - + $error = 0; $predef = ''; @@ -250,7 +250,7 @@ if (empty($reshook)) $objectsrc->fetch($object->origin_id); - + $object->socid = $objectsrc->socid; $object->ref_supplier = GETPOST('ref_supplier', 'alpha'); $object->model_pdf = GETPOST('model'); @@ -293,23 +293,23 @@ if (empty($reshook)) $stockLocation = "ent1".$i."_0"; $qty = "qtyl".$i; - - + + //var_dump(GETPOST($qty,'int')); var_dump($_POST); var_dump($batch);exit; //reception line for product with no batch management and no multiple stock location if (GETPOST($qty, 'int') > 0) $totalqty += GETPOST($qty, 'int'); - + // Extrafields $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); $array_options[$i] = $extrafieldsline->getOptionalsFromPost($extralabelsline, $i); - - + + } - + if ($totalqty > 0) // There is at least one thing to ship { @@ -325,19 +325,19 @@ if (empty($reshook)) $eatby = "dlc".$i; $sellby = "dluo".$i; $batch = "batch".$i; - - + + $timeFormat = '%d/%m/%Y'; if (GETPOST($qty, 'int') > 0 || (GETPOST($qty, 'int') == 0 && $conf->global->RECEPTION_GETS_ALL_ORDER_PRODUCTS)) { $ent = "entl".$i; - + $idl = "idl".$i; - + $entrepot_id = is_numeric(GETPOST($ent, 'int')) ? GETPOST($ent, 'int') : GETPOST('entrepot_id', 'int'); - + if ($entrepot_id < 0) $entrepot_id = ''; if (!($linesrc->fk_product > 0) && empty($conf->global->STOCK_SUPPORTS_SERVICES)) @@ -346,9 +346,9 @@ if (empty($reshook)) $sellby = GETPOST($sellby, 'alpha'); $eatbydate = str_replace('/','-',$eatby); $sellbydate = str_replace('/','-',$sellby); - - - $ret = $object->addline($entrepot_id, GETPOST($idl, 'int'), GETPOST($qty, 'int'), $array_options[$i], GETPOST($comment, 'alpha'), strtotime($eatbydate),strtotime($sellbydate), GETPOST($batch, 'alpha')); + + + $ret = $object->addline($entrepot_id, GETPOST($idl, 'int'), GETPOST($qty, 'int'), $array_options[$i], GETPOST($comment, 'alpha'), strtotime($eatbydate),strtotime($sellbydate), GETPOST($batch, 'alpha')); if ($ret < 0) { setEventMessages($object->error, $object->errors, 'errors'); @@ -356,15 +356,15 @@ if (empty($reshook)) } } } - - + + // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost($extralabels, $object); if ($ret < 0) $error++; if (! $error) { $ret=$object->create($user); // This create reception (like Odoo picking) and line of receptions. Stock movement will when validating reception. - + if ($ret <= 0) { setEventMessages($object->error, $object->errors, 'errors'); @@ -572,14 +572,14 @@ if (empty($reshook)) { if ($lines[$i]->id == $line_id) { - + // delete single warehouse line $line->id = $line_id; if (! $error && $line->delete($user) < 0) { $error++; } - + } unset($_POST["lineid"]); } @@ -620,23 +620,23 @@ if (empty($reshook)) $line->fk_product = $lines[$i]->fk_product; - + if ($lines[$i]->fk_product > 0) { - + // single warehouse reception line $stockLocation = "entl".$line_id; $qty = "qtyl".$line_id; $comment = "comment".$line_id; - - + + $line->id = $line_id; $line->fk_entrepot = GETPOST($stockLocation, 'int'); $line->qty = GETPOST($qty, 'int'); $line->comment = GETPOST($comment, 'alpha'); - + if(!empty($conf->productbatch->enabled)){ $batch = "batch".$line_id; $dlc = "dlc".$line_id; @@ -649,17 +649,17 @@ if (empty($reshook)) $line->eatby = strtotime($eatbydate); $line->sellby = strtotime($sellbydate); } - - - + + + if ($line->update($user) < 0) { setEventMessages($line->error, $line->errors, 'errors'); $error++; } - - - + + + } else // Product no predefined { @@ -759,7 +759,7 @@ if ($action == 'create') { if($origin == 'supplierorder')$classname = 'CommandeFournisseur'; else $classname = ucfirst($origin); - + $object = new $classname($db); if ($object->fetch($origin_id)) // This include the fetch_lines { @@ -949,13 +949,13 @@ if ($action == 'create') $pu = "pu_".$reg[1].'_'.$reg[2]; // This is unit price including discount $fk_commandefourndet = "fk_commandefourndet_".$reg[1].'_'.$reg[2]; $dispatchLines[$numAsked]=array('prod' => GETPOST($prod, 'int'), 'qty' =>GETPOST($qty), 'ent' =>GETPOST($ent, 'int'), 'pu' =>GETPOST($pu), 'comment' =>GETPOST('comment'),'fk_commandefourndet' => GETPOST($fk_commandefourndet, 'int')); - - + + } // with batch module enabled if (preg_match('/^product_batch_([0-9]+)_([0-9]+)$/i', $key, $reg)) { - + $numAsked ++; // eat-by date dispatch // $numline=$reg[2] + 1; // line of product @@ -969,10 +969,10 @@ $numAsked ++; $dDLC = dol_mktime(12, 0, 0, $_POST['dlc_'.$reg[1].'_'.$reg[2].'month'], $_POST['dlc_'.$reg[1].'_'.$reg[2].'day'], $_POST['dlc_'.$reg[1].'_'.$reg[2].'year']); $fk_commandefourndet = 'fk_commandefourndet_'.$reg[1].'_'.$reg[2]; $dispatchLines[$numAsked]=array('prod' => GETPOST($prod, 'int'), 'qty' =>GETPOST($qty), 'ent' =>GETPOST($ent, 'int'), 'pu' =>GETPOST($pu), 'comment' =>GETPOST('comment'),'fk_commandefourndet' => GETPOST($fk_commandefourndet, 'int'),'DLC'=> $dDLC,'DLUO'=> $dDLUO,'lot'=> GETPOST($lot, 'alpha')); - + } } - + print '