From 7367769ec36f96be619cc950cc3e5d6c14c64b61 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio Date: Fri, 16 Feb 2018 11:59:51 +0100 Subject: [PATCH] FIX: supplier credit notes: use correct rights in supplier invoice card --- htdocs/fourn/facture/card.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 3ab9e4e684c..ace7ce0b1b7 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -268,7 +268,7 @@ if (empty($reshook)) } // Delete link of credit note to invoice - else if ($action == 'unlinkdiscount' && $user->rights->facture->creer) + else if ($action == 'unlinkdiscount' && $user->rights->fournisseur->facture->creer) { $discount = new DiscountAbsolute($db); $result = $discount->fetch(GETPOST("discountid")); @@ -326,12 +326,12 @@ if (empty($reshook)) } // Multicurrency Code - else if ($action == 'setmulticurrencycode' && $user->rights->facture->creer) { + else if ($action == 'setmulticurrencycode' && $user->rights->fournisseur->facture->creer) { $result = $object->setMulticurrencyCode(GETPOST('multicurrency_code', 'alpha')); } // Multicurrency rate - else if ($action == 'setmulticurrencyrate' && $user->rights->facture->creer) { + else if ($action == 'setmulticurrencyrate' && $user->rights->fournisseur->facture->creer) { $result = $object->setMulticurrencyRate(price2num(GETPOST('multicurrency_tx', 'alpha'))); } @@ -385,7 +385,7 @@ if (empty($reshook)) $result=$object->update($user); if ($result < 0) dol_print_error($db,$object->error); } - elseif ($action == "setabsolutediscount" && $user->rights->facture->creer) + elseif ($action == "setabsolutediscount" && $user->rights->fournisseur->facture->creer) { // POST[remise_id] or POST[remise_id_for_payment] @@ -443,7 +443,7 @@ if (empty($reshook)) } } // Convertir en reduc - else if ($action == 'confirm_converttoreduc' && $confirm == 'yes' && $user->rights->facture->creer) + else if ($action == 'confirm_converttoreduc' && $confirm == 'yes' && $user->rights->fournisseur->facture->creer) { $object->fetch($id); $object->fetch_thirdparty(); @@ -3108,7 +3108,7 @@ else } // For standard invoice with excess paid - if ($object->type == FactureFournisseur::TYPE_STANDARD && empty($object->paye) && ($object->total_ttc - $totalpaye - $totalcreditnotes - $totaldeposits) < 0 && $user->rights->facture->creer && empty($discount->id)) + if ($object->type == FactureFournisseur::TYPE_STANDARD && empty($object->paye) && ($object->total_ttc - $totalpaye - $totalcreditnotes - $totaldeposits) < 0 && $user->rights->fournisseur->facture->creer && empty($discount->id)) { print '
'.$langs->trans('ConvertExcessReceivedToReduc').'
'; // TODO translation : trop-perçu => trop payé }