From 63987fa32e1682704dd269f065c1024e882afde5 Mon Sep 17 00:00:00 2001 From: John Date: Thu, 15 Feb 2018 16:39:47 +0100 Subject: [PATCH 1/4] fix invoice extrafield transmition to credit --- htdocs/compta/facture/card.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 8cf8f64ed09..86e21e1518b 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -852,6 +852,12 @@ if (empty($reshook)) foreach($facture_source->lines as $line) { + // Extrafields + if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) { + // load extrafields + $line->fetch_optionals(); + } + // Reset fk_parent_line for no child products and special product if (($line->product_type != 9 && empty($line->fk_parent_line)) || $line->product_type == 9) { $fk_parent_line = 0; From 49bad95d3128e7a3180f5d10ab232a2ae1a8fbe8 Mon Sep 17 00:00:00 2001 From: John Date: Thu, 15 Feb 2018 17:04:27 +0100 Subject: [PATCH 2/4] fix method exist test --- htdocs/compta/facture/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 86e21e1518b..f31b0be6a38 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -853,7 +853,7 @@ if (empty($reshook)) foreach($facture_source->lines as $line) { // Extrafields - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) { + if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($line, 'fetch_optionals')) { // load extrafields $line->fetch_optionals(); } From ea071b768057993855dcdcccfbd5bdef7a81d6d4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Feb 2018 12:31:26 +0100 Subject: [PATCH 3/4] Fix can't delete holiday refused --- htdocs/holiday/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 39edb577aec..b2dca7ca41b 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -1246,7 +1246,7 @@ else { print ''.$langs->trans("Validate").''; } - if ($user->rights->holiday->delete && $object->statut == 1) // If draft + if ($user->rights->holiday->delete && ($object->statut == 1 || $object->statut == 4 || $object->statut == 5) // If draft or canceled or refused { print ''.$langs->trans("DeleteCP").''; } From 4056b87a74cd8b9cf387b7d9c4622a0e51c909fc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Feb 2018 12:36:03 +0100 Subject: [PATCH 4/4] Fix syntax error --- htdocs/holiday/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 069b5657aa1..be61223d704 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -1246,7 +1246,7 @@ else { print ''.$langs->trans("Validate").''; } - if ($user->rights->holiday->delete && ($object->statut == 1 || $object->statut == 4 || $object->statut == 5) // If draft or canceled or refused + if ($user->rights->holiday->delete && ($object->statut == 1 || $object->statut == 4 || $object->statut == 5)) // If draft or canceled or refused { print ''.$langs->trans("DeleteCP").''; }