From 97b4093d22b3a435cfbd8676cdeb2c03391d0425 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Tue, 16 Jul 2024 21:54:04 +0200 Subject: [PATCH] FIX : allow setDraft on cancelled orders if ORDER_REOPEN_TO_DRAFT is set (#30396) * Fix missing loading trans file * FIX : allow setDraft on cancelled orders if ORDER_REOPEN_TO_DRAFT is set --------- Co-authored-by: Laurent Destailleur Co-authored-by: Christophe Battarel --- htdocs/commande/class/commande.class.php | 2 +- htdocs/contrat/card.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 95f87030648..ffd5df5c357 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -643,7 +643,7 @@ class Commande extends CommonOrder $error = 0; // Protection - if ($this->statut <= self::STATUS_DRAFT) { + if ($this->statut <= self::STATUS_DRAFT && !getDolGlobalInt('ORDER_REOPEN_TO_DRAFT')) { return 0; } diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 260b22cecef..4f3df755a96 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -2197,6 +2197,7 @@ if ($action == 'create') { ); } if (isModEnabled('supplier_invoice') && $object->status > 0 && $soc->fournisseur == 1) { + $langs->load("suppliers"); $arrayofcreatebutton[] = array( 'url' => '/fourn/facture/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->thirdparty->id, 'label' => $langs->trans('AddSupplierInvoice'),