diff --git a/htdocs/compta/facture.php3 b/htdocs/compta/facture.php3 index e496b01b605..b166350dd39 100644 --- a/htdocs/compta/facture.php3 +++ b/htdocs/compta/facture.php3 @@ -76,7 +76,7 @@ if ($action == 'add_paiement') /* * */ -if ($action == 'del_paiement') +if ($action == 'del_paiement' && $user->rights->facture->paiement) { $paiement = new Paiement($db); $paiement->id = $paiementid; @@ -88,7 +88,7 @@ if ($action == 'del_paiement') * */ -if ($action == 'valid') +if ($action == 'valid' && $user->rights->facture->valider) { $fac = new Facture($db); $fac->fetch($facid); @@ -99,7 +99,7 @@ if ($action == 'valid') } } -if ($action == 'payed') +if ($action == 'payed' && $user->rights->facture->paiement) { $fac = new Facture($db); $result = $fac->set_payed($facid); @@ -527,7 +527,7 @@ else print "".strftime("%d %B %Y",$objp->dp)."\n"; print "$objp->paiement_type $objp->num_paiement\n"; print ''.price($objp->amount)."$_MONNAIE\n"; - if (! $obj->paye) + if (! $obj->paye && $user->rights->facture->paiement) { print 'Del'; } @@ -687,7 +687,7 @@ else { print "[Supprimer]"; } - elseif ($obj->statut == 1 && abs($resteapayer) > 0) + elseif ($obj->statut == 1 && abs($resteapayer) > 0 && $user->rights->facture->envoyer) { print "[Envoyer]"; } @@ -696,7 +696,7 @@ else print "-"; } - if ($obj->statut == 1 && $resteapayer > 0) + if ($obj->statut == 1 && $resteapayer > 0 && $user->rights->facture->paiement) { print "[Emettre un paiement]"; } @@ -707,28 +707,49 @@ else if ($obj->statut == 1 && abs($resteapayer) == 0 && $obj->paye == 0) { - print "[Classer 'Payée']"; + if ($user->rights->facture->paiement) + { + print "[Classer 'Payée']"; + } + else + { + print '-'; + } } - elseif ($obj->statut == 1 && $resteapayer > 0) + elseif ($obj->statut == 1 && $resteapayer > 0 && $user->rights->facture->envoyer) { print "[Envoyer une relance]"; } else { - print "-"; + print '-'; } if ($obj->statut == 0 && $obj->total > 0) { - print "[Valider]"; + if ($user->rights->facture->valider) + { + print "[Valider]"; + } + else + { + print '-'; + } } elseif ($obj->statut == 1 && $obj->paye == 0) { - print "Générer la facture"; + if ($user->rights->facture->creer) + { + print "Générer la facture"; + } + else + { + print '-'; + } } else { - print "-"; + print '-'; } print ""; }