From a4800f7b9bab4994026a6b3901a9bf244a35ee61 Mon Sep 17 00:00:00 2001 From: kamel Date: Fri, 29 May 2020 16:18:27 +0200 Subject: [PATCH] FIX: Fix link of the button to create a credit note and fix the awareness of a error happen when to create a credit note --- htdocs/compta/facture/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 2f4faf93c13..bf9080c9860 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1182,7 +1182,7 @@ if (empty($reshook)) } // Add link between credit note and origin - if (!empty($object->fk_facture_source)) { + if (!empty($object->fk_facture_source) && $id > 0) { $facture_source->fetch($object->fk_facture_source); $facture_source->fetchObjectLinked(); @@ -5130,7 +5130,7 @@ if ($action == 'create') { if (!$objectidnext) { - print ''.$langs->trans("CreateCreditNote").''; + print ''.$langs->trans("CreateCreditNote").''; } }