From ba09a8ee8485b5c1106e5a9e939e3b7677085d3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 7 Aug 2025 15:54:21 +0200 Subject: [PATCH] add trigger prefix in reception class (#34888) * add trigger prefix in reception class * add trigger prefix in reception class --------- Co-authored-by: Laurent Destailleur --- htdocs/reception/class/reception.class.php | 14 +++++++++++--- .../class/receptionlinebatch.class.php | 17 ++++++++++++----- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index 3bc9a292652..87349b7a924 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -11,8 +11,8 @@ * Copyright (C) 2015 Claudio Aschieri * Copyright (C) 2016-2022 Ferran Marcet * Copyright (C) 2018 Quentin Vial-Gouteyron - * Copyright (C) 2022-2024 Frédéric France - * Copyright (C) 2024-2025 MDW + * Copyright (C) 2022-2025 Frédéric France + * Copyright (C) 2024-2025 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -52,6 +52,12 @@ class Reception extends CommonObject { use CommonIncoterm; + /** + * @var string Prefix to check for any trigger code of any business class to prevent bad value for trigger code. + * @see CommonTrigger::call_trigger() + */ + public $TRIGGER_PREFIX = 'RECEPTION'; // to be overridden in child class implementations, i.e. 'BILL', 'TASK', 'PROPAL', etc. + /** * @var string code */ @@ -243,6 +249,7 @@ class Reception extends CommonObject $obj = new $classname(); '@phan-var-force ModelNumRefReception $obj'; + /** @var ModelNumRefReception $obj */ $numref = $obj->getNextValue($soc, $this); @@ -1188,7 +1195,8 @@ class Reception extends CommonObject $this->fetch_origin(); $origin_object = $this->origin_object; '@phan-var-force CommandeFournisseur $origin_object'; - if ($origin_object->statut == 4) { // If order source of reception is "partially received" + /** @var CommandeFournisseur $origin_object */ + if ($origin_object->status == 4) { // If order source of reception is "partially received" // Check if there is no more reception. If not, we can move back status of order to "validated" instead of "reception in progress" $origin_object->loadReceptions(); //var_dump($this->$origin->receptions);exit; diff --git a/htdocs/reception/class/receptionlinebatch.class.php b/htdocs/reception/class/receptionlinebatch.class.php index db468b220e3..a477bb678f5 100644 --- a/htdocs/reception/class/receptionlinebatch.class.php +++ b/htdocs/reception/class/receptionlinebatch.class.php @@ -1,9 +1,10 @@ - * Copyright (C) 2014 Juanjo Menent - * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 Christophe Battarel - * Copyright (C) 2024 MDW +/* Copyright (C) 2015 Laurent Destailleur + * Copyright (C) 2014 Juanjo Menent + * Copyright (C) 2024-2025 Frédéric France + * Copyright (C) 2024 Christophe Battarel + * Copyright (C) 2024 MDW + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or @@ -35,6 +36,12 @@ require_once DOL_DOCUMENT_ROOT."/reception/class/reception.class.php"; */ class ReceptionLineBatch extends CommonObjectLine { + /** + * @var string Prefix to check for any trigger code of any business class to prevent bad value for trigger code. + * @see CommonTrigger::call_trigger() + */ + public $TRIGGER_PREFIX = 'LINERECEPTION'; // to be overridden in child class implementations, i.e. 'BILL', 'TASK', 'PROPAL', etc. + /** * @var DoliDB Database handler. */