diff --git a/htdocs/admin/order.php b/htdocs/admin/order.php index c6ad34ebbe5..bd45aaa68d2 100644 --- a/htdocs/admin/order.php +++ b/htdocs/admin/order.php @@ -104,6 +104,7 @@ if ($action == 'updateMask') { $module = new $classname($db); '@phan-var-force ModelePDFCommandes $module'; + /** @var ModelePDFCommandes $module */ if ($module->write_file($commande, $langs) > 0) { header("Location: ".DOL_URL_ROOT."/document.php?modulepart=commande&file=SPECIMEN.pdf"); return; diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index f4103e2609e..85a591fbdac 100644 --- a/htdocs/admin/propal.php +++ b/htdocs/admin/propal.php @@ -99,6 +99,7 @@ if ($action == 'updateMask') { $module = new $classname($db); '@phan-var-force ModelePDFPropales $module'; + /** @var ModelePDFPropales $module */ if ($module->write_file($propal, $langs) > 0) { header("Location: ".DOL_URL_ROOT."/document.php?modulepart=propal&file=SPECIMEN.pdf"); return; diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 5b3caa20bd9..8c8d11e966d 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -12,7 +12,7 @@ * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2018 Ferran Marcet - * Copyright (C) 2018-2022 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2022-2023 George Gkantinas * Copyright (C) 2023 Nick Fragoulis * Copyright (C) 2023 Alexandre Janniaux @@ -856,7 +856,6 @@ if (empty($reshook)) { $clone->fournisseur = 0; $clone->client = 0; - $db->begin(); $clone->context['createfromclone'] = 'createfromclone'; @@ -864,16 +863,7 @@ if (empty($reshook)) { if ($id > 0) { $clone->id = $id; } else { - if ($clone->error == 'ErrorProductAlreadyExists') { - $refalreadyexists++; - $action = ""; - - $mesg = $langs->trans("ErrorProductAlreadyExists", $clone->ref); - $mesg .= ' ' . $langs->trans("ShowCardHere") . '.'; - setEventMessages($mesg, null, 'errors'); - } else { - setEventMessages(empty($clone->error) ? '' : $langs->trans($clone->error), $clone->errors, 'errors'); - } + setEventMessages($clone->error, $clone->errors, 'errors'); $error++; }