diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 19612349214..78f6da1702d 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -925,6 +925,12 @@ if (empty($reshook)) foreach($facture_source->lines as $line) { + // Extrafields + if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($line, '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; diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index e626f950a2b..ce985b51738 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -282,8 +282,8 @@ if ($action == 'confirm_delete' && GETPOST('confirm') == 'yes' && $user->rights- $canedit=(($user->id == $object->fk_user && $user->rights->holiday->write) || ($user->id != $object->fk_user && $user->rights->holiday->write_all)); - // If this is a rough draft - if ($object->statut == 1 || $object->statut == 3) + // If this is a rough draft, approved, canceled or refused + if ($object->statut == 1 || $object->statut == 4 || $object->statut == 5) { // Si l'utilisateur à le droit de lire cette demande, il peut la supprimer if ($canedit) @@ -1255,7 +1255,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").''; }