From 96b0f3a25cdb907c46fc9dc5df011c62b2c15f22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 26 Feb 2021 16:19:52 +0100 Subject: [PATCH] code syntax directory --- .../core/modules/facture/doc/pdf_crabe.modules.php | 5 ++--- .../core/modules/facture/doc/pdf_sponge.modules.php | 5 ++--- htdocs/core/modules/propale/doc/pdf_cyan.modules.php | 2 +- htdocs/product/card.php | 12 ++++-------- htdocs/product/class/product.class.php | 6 ++---- htdocs/product/list.php | 6 ++---- 6 files changed, 13 insertions(+), 23 deletions(-) diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index d5842b4481f..67e61cb7815 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1053,10 +1053,9 @@ class pdf_crabe extends ModelePDFFactures && empty($conf->global->FACTURE_CHQ_NUMBER) && empty($conf->global->FACTURE_RIB_NUMBER)) { $this->error = $outputlangs->transnoentities("ErrorNoPaiementModeConfigured"); - } - // Avoid having any valid PDF with setup that is not complete - elseif (($object->mode_reglement_code == 'CHQ' && empty($conf->global->FACTURE_CHQ_NUMBER) && empty($object->fk_account) && empty($object->fk_bank)) + } elseif (($object->mode_reglement_code == 'CHQ' && empty($conf->global->FACTURE_CHQ_NUMBER) && empty($object->fk_account) && empty($object->fk_bank)) || ($object->mode_reglement_code == 'VIR' && empty($conf->global->FACTURE_RIB_NUMBER) && empty($object->fk_account) && empty($object->fk_bank))) { + // Avoid having any valid PDF with setup that is not complete $outputlangs->load("errors"); $pdf->SetXY($this->marge_gauche, $posy); diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index a1da1666629..b1072a50008 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -1142,10 +1142,9 @@ class pdf_sponge extends ModelePDFFactures && empty($conf->global->FACTURE_CHQ_NUMBER) && empty($conf->global->FACTURE_RIB_NUMBER)) { $this->error = $outputlangs->transnoentities("ErrorNoPaiementModeConfigured"); - } - // Avoid having any valid PDF with setup that is not complete - elseif (($object->mode_reglement_code == 'CHQ' && empty($conf->global->FACTURE_CHQ_NUMBER) && empty($object->fk_account) && empty($object->fk_bank)) + } elseif (($object->mode_reglement_code == 'CHQ' && empty($conf->global->FACTURE_CHQ_NUMBER) && empty($object->fk_account) && empty($object->fk_bank)) || ($object->mode_reglement_code == 'VIR' && empty($conf->global->FACTURE_RIB_NUMBER) && empty($object->fk_account) && empty($object->fk_bank))) { + // Avoid having any valid PDF with setup that is not complete $outputlangs->load("errors"); $pdf->SetXY($this->marge_gauche, $posy); diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 027b3da46ba..6a550018f7a 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -1719,7 +1719,7 @@ class pdf_cyan extends ModelePDFPropales $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs); $mode = 'target'; - $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact,$mode, $object); + $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, $mode, $object); // Show recipient $widthrecbox = !empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 92 : 100; diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 4d4dd8f8ab3..a50eb7bede2 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1084,11 +1084,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Batch number management if (!empty($conf->productbatch->enabled)) { print ''.$langs->trans("ManageLotSerial").''; - if ( empty($conf->global ->MAIN_ADVANCE_NUMLOT) ) - { + if (empty($conf->global ->MAIN_ADVANCE_NUMLOT)) { $statutarray = array('0' => $langs->trans("ProductStatusNotOnBatch"), '1' => $langs->trans("ProductStatusOnBatch")); - } - else { + } else { $statutarray = array('0' => $langs->trans("ProductStatusNotOnBatch"), '1' => $langs->trans("ProductStatusOnBatch"), '2' => $langs->trans("ProductStatusOnSerial")); } print $form->selectarray('status_batch', $statutarray, GETPOST('status_batch')); @@ -1550,11 +1548,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if ($conf->productbatch->enabled) { if ($object->isProduct() || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { print ''.$langs->trans("ManageLotSerial").''; - if ( empty($conf->global ->MAIN_ADVANCE_NUMLOT) ) - { + if (empty($conf->global ->MAIN_ADVANCE_NUMLOT)) { $statutarray = array('0' => $langs->trans("ProductStatusNotOnBatch"), '1' => $langs->trans("ProductStatusOnBatch")); - } - else { + } else { $statutarray = array('0' => $langs->trans("ProductStatusNotOnBatch"), '1' => $langs->trans("ProductStatusOnBatch"), '2' => $langs->trans("ProductStatusOnSerial")); } print $form->selectarray('status_batch', $statutarray, $object->status_batch); diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 0914a191c22..bea9e1173a7 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -4735,7 +4735,7 @@ class Product extends CommonObject if ($type == 2) { switch ($mode) { case 0: - $label = ($status == 0 ? $langs->trans('ProductStatusNotOnBatch') : ($status == 1 || empty($conf->global->MAIN_ADVANCE_NUMLOT) ? $langs->trans('ProductStatusOnBatch') : $langs->trans('ProductStatusOnSerial'))); + $label = ($status == 0 ? $langs->trans('ProductStatusNotOnBatch') : ($status == 1 || empty($conf->global->MAIN_ADVANCE_NUMLOT) ? $langs->trans('ProductStatusOnBatch') : $langs->trans('ProductStatusOnSerial'))); return dolGetStatus($label); case 1: $label = ($status == 0 ? $langs->trans('ProductStatusNotOnBatchShort') : ($status == 1 || empty($conf->global->MAIN_ADVANCE_NUMLOT) ? $langs->trans('ProductStatusOnBatchShort') : $langs->trans('ProductStatusOnSerialShort'))); @@ -4779,9 +4779,7 @@ class Product extends CommonObject $labelStatus = ($status == 1 || empty($conf->global->MAIN_ADVANCE_NUMLOT) ? $langs->trans('ProductStatusOnBatch') : $langs->trans('ProductStatusOnSerial')); $labelStatusShort = ($status == 1 || empty($conf->global->MAIN_ADVANCE_NUMLOT) ? $langs->trans('ProductStatusOnBatchShort') : $langs->trans('ProductStatusOnSerialShort')); } - } - elseif ( ! empty($conf->global->MAIN_ADVANCE_NUMLOT) && $type == 2 && $status == 2) - { + } elseif (! empty($conf->global->MAIN_ADVANCE_NUMLOT) && $type == 2 && $status == 2) { $labelStatus = $langs->trans('ProductStatusOnSerial'); $labelStatusShort = $langs->trans('ProductStatusOnSerialShort'); } diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 4ea330e5bee..76f81e43243 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -1672,11 +1672,9 @@ if ($resql) { // Lot/Serial if (!empty($arrayfields['p.tobatch']['checked'])) { print ''; - if ( empty($conf->global->MAIN_ADVANCE_NUMLOT) ) - { + if (empty($conf->global->MAIN_ADVANCE_NUMLOT)) { print yn($obj->tobatch); - } - else { + } else { print $product_static->getLibStatut(1, 2); } print '';