From 895924a40e19d9065b3ecd943ed73ea46ff07d93 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Sat, 14 Feb 2004 14:50:04 +0000 Subject: [PATCH] Modif look --- htdocs/compta/facture.php | 125 ++++++++++++++------------------------ 1 file changed, 47 insertions(+), 78 deletions(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index dde8d32a49f..4ed3a3ad801 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -812,11 +812,11 @@ else $result = $db->query($sql); if ($result) { - $num = $db->num_rows(); + $num_lignes = $db->num_rows(); $i = 0; $total = 0; echo ''; - if ($num) + if ($num_lignes) { print ""; print ''; @@ -828,7 +828,7 @@ else print "\n"; } $var=True; - while ($i < $num) + while ($i < $num_lignes) { $objp = $db->fetch_object( $i); $var=!$var; @@ -930,110 +930,78 @@ else * Fin Ajout ligne * */ - if ($user->societe_id == 0) - { - print '

Description
'; - - // Supprimer - if ($fac->statut == 0 && $user->rights->facture->supprimer) - { - print ""; - } - // Valider - if ($fac->statut == 0 && $fac->total_ht > 0) + if ($user->societe_id == 0 && $_GET["action"] <> 'valid') + { + print "
\n"; + + // Valider + if ($fac->statut == 0 && $num_lignes > 0) { if ($user->rights->facture->valider) { - print "
"; - } - else - { - print ''; + print "id&action=valid\">Valider"; } } - else { + else + { // Générer - if ($fac->statut == 1 && ($fac->paye == 0 || $user->admin)) - { - if ($user->rights->facture->creer) + if ($fac->statut == 1 && ($fac->paye == 0 || $user->admin) && $user->rights->facture->creer) { - if ($fac->paye == 0) { - print ""; - } - else { - print ""; - } - } - else - { - print ''; + if ($fac->paye == 0) + { + print "id&action=pdf\">Générer la facture"; + } + else + { + print "id&action=pdf\">Regénérer la facture"; + } } } - else - { - print ''; - } - } - // Envoyer - if ($fac->statut == 1 && abs($resteapayer) > 0 && $user->rights->facture->envoyer) + // Supprimer + if ($fac->statut == 0 && $user->rights->facture->supprimer) { - print ""; - } - else - { - print ""; + print "id&action=delete\">Supprimer"; } - // Envoyer une relance + // Envoyer + if ($fac->statut == 1 && abs($resteapayer) > 0 && $user->rights->facture->envoyer) + { + print "id&action=presend\">Envoyer"; + } + + // Envoyer une relance if ($fac->statut == 1 && $resteapayer > 0 && $user->rights->facture->envoyer) { - print ""; - } - else - { - print ''; + print "id&action=prerelance\">Envoyer une relance"; } - // Emettre paiement + // Emettre paiement if ($fac->statut == 1 && $resteapayer > 0 && $user->rights->facture->paiement) { - print ''; + print 'Emettre un paiement'; } - else + + // Classer 'payé' + if ($fac->statut == 1 && abs($resteapayer) == 0 + && $fac->paye == 0 && $user->rights->facture->paiement) { - print ''; + print "id&action=payed\">Classer 'Payée'"; } - - // Classer 'payé' - if ($fac->statut == 1 && abs($resteapayer) == 0 && $fac->paye == 0) - { - if ($user->rights->facture->paiement) - { - print ""; - } - else - { - print ''; - } - } + - // Récurrente + // Récurrente if (! defined("FACTURE_DISABLE_RECUR")) // Possibilité de désactiver les factures récurrentes { if ($fac->statut > 0) { - print ''; - } - else - { - print ''; + print 'Récurrente'; } } - - print "
id&action=delete\">Supprimerid&action=valid\">Valider-id&action=pdf\">Générer la factureid&action=pdf\">Regénérer la facture--id&action=presend\">Envoyer-id&action=prerelance\">Envoyer une relance-'; - print 'Emettre un paiement-id&action=payed\">Classer 'Payée'-Récurrente-
"; + + print ""; + } print "

\n"; @@ -1057,7 +1025,6 @@ else print "\n"; print ''; - print_titre("Actions"); /* * Liste des actions * @@ -1071,6 +1038,8 @@ else $num = $db->num_rows(); if ($num) { + print_titre("Actions"); + $i = 0; $total = 0; print ''; print "\n";
DateAction