2
0
forked from Wavyzz/dolibarr

add trigger prefix in reception class (#34888)

* add trigger prefix in reception class

* add trigger prefix in reception class

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
Frédéric FRANCE
2025-08-07 15:54:21 +02:00
committed by GitHub
parent 267871e805
commit ba09a8ee84
2 changed files with 23 additions and 8 deletions

View File

@@ -11,8 +11,8 @@
* Copyright (C) 2015 Claudio Aschieri <c.aschieri@19.coop> * Copyright (C) 2015 Claudio Aschieri <c.aschieri@19.coop>
* Copyright (C) 2016-2022 Ferran Marcet <fmarcet@2byte.es> * Copyright (C) 2016-2022 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018 Quentin Vial-Gouteyron <quentin.vial-gouteyron@atm-consulting.fr> * Copyright (C) 2018 Quentin Vial-Gouteyron <quentin.vial-gouteyron@atm-consulting.fr>
* Copyright (C) 2022-2024 Frédéric France <frederic.france@free.fr> * Copyright (C) 2022-2025 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com> * Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@@ -52,6 +52,12 @@ class Reception extends CommonObject
{ {
use CommonIncoterm; 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 * @var string code
*/ */
@@ -243,6 +249,7 @@ class Reception extends CommonObject
$obj = new $classname(); $obj = new $classname();
'@phan-var-force ModelNumRefReception $obj'; '@phan-var-force ModelNumRefReception $obj';
/** @var ModelNumRefReception $obj */
$numref = $obj->getNextValue($soc, $this); $numref = $obj->getNextValue($soc, $this);
@@ -1188,7 +1195,8 @@ class Reception extends CommonObject
$this->fetch_origin(); $this->fetch_origin();
$origin_object = $this->origin_object; $origin_object = $this->origin_object;
'@phan-var-force CommandeFournisseur $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" // 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(); $origin_object->loadReceptions();
//var_dump($this->$origin->receptions);exit; //var_dump($this->$origin->receptions);exit;

View File

@@ -1,9 +1,10 @@
<?php <?php
/* Copyright (C) 2015 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr> * Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 Christophe Battarel <christophe@altairis.fr> * Copyright (C) 2024 Christophe Battarel <christophe@altairis.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com> * Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * 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 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. * @var DoliDB Database handler.
*/ */