quand il reste à payer 0,000001 EUR on condidère qu'on peut classer la facture

This commit is contained in:
erics 2004-02-24 23:34:15 +00:00
parent f6f3fef79e
commit eeb36388d7
2 changed files with 21 additions and 12 deletions

View File

@ -24,10 +24,15 @@
require("./pre.inc.php"); require("./pre.inc.php");
if(isset($_GET["account"]))
$HTTP_POST_VARS["account"] = $_GET["account"];
if(isset($_GET["vline"]))
$HTTP_POST_VARS["vline"] = $_GET["vline"];
if (!$user->rights->banque->lire) if (!$user->rights->banque->lire)
accessforbidden(); accessforbidden();
if ($HTTP_POST_VARS["action"] == 'add' && $_GET["account"]) if ($HTTP_POST_VARS["action"] == 'add' && $HTTP_POST_VARS["account"])
{ {
if ($credit > 0) if ($credit > 0)
{ {
@ -39,7 +44,7 @@ if ($HTTP_POST_VARS["action"] == 'add' && $_GET["account"])
} }
$dateop = "$dateoy" . "$dateo"; $dateop = "$dateoy" . "$dateo";
$acct=new Account($db,$_GET["account"]); $acct=new Account($db,$HTTP_POST_VARS["account"]);
$insertid = $acct->addline($dateop, $operation, $label, $amount, $num_chq,$cat1); $insertid = $acct->addline($dateop, $operation, $label, $amount, $num_chq,$cat1);
@ -49,7 +54,7 @@ if ($HTTP_POST_VARS["action"] == 'add' && $_GET["account"])
} }
else else
{ {
Header("Location: $PHP_SELF?account=$acct->id"); Header("Location: $PHP_SELF?account=" . $acct->id);
} }
/* /*
if ($num_chq) if ($num_chq)
@ -95,8 +100,9 @@ if ($action == 'del' && $account && $user->rights->banque->modifier)
*/ */
llxHeader(); llxHeader();
print "<p>Account: " . $HTTP_POST_VARS["account"] . "o" . $HTTP_POST_VARS["account"] . "</p>\n";
if ($_GET["account"] > 0) if ($HTTP_POST_VARS["account"] > 0)
{ {
if ($vline) if ($vline)
{ {
@ -107,7 +113,7 @@ if ($_GET["account"] > 0)
$viewline = 20; $viewline = 20;
} }
$acct = new Account($db); $acct = new Account($db);
$acct->fetch($_GET["account"]); $acct->fetch($HTTP_POST_VARS["account"]);
$sql = "SELECT rowid, label FROM ".MAIN_DB_PREFIX."bank_categ;"; $sql = "SELECT rowid, label FROM ".MAIN_DB_PREFIX."bank_categ;";
$result = $db->query($sql); $result = $db->query($sql);
@ -198,8 +204,9 @@ if ($_GET["account"] > 0)
* Formulaire de recherche * Formulaire de recherche
* *
*/ */
print '<form method="post" action="'.$PHP_SELF.'?account='.$acct->id.'">'; print '<form method="post" action="'.$PHP_SELF.'">';
print '<input type="hidden" name="action" value="search">'; print '<input type="hidden" name="action" value="search">';
print '<input type="hidden" name="account" value="' . $acct->id . '">';
print '<table class="border" width="100%" cellspacing="0" cellpadding="2">'; print '<table class="border" width="100%" cellspacing="0" cellpadding="2">';
print "<TR>"; print "<TR>";
print '<td>'; print '<td>';
@ -234,8 +241,10 @@ if ($_GET["account"] > 0)
*/ */
if ($user->rights->banque->modifier) if ($user->rights->banque->modifier)
{ {
print '<form method="post" action="'.$PHP_SELF.'?vline='.$vline.'&amp;account='.$acct->id.'">'; print '<form method="post" action="'.$PHP_SELF.'">';
print '<input type="hidden" name="action" value="add">'; print '<input type="hidden" name="action" value="add">';
print '<input type="hidden" name="vline" value="' . $vline . '">';
print '<input type="hidden" name="account" value="' . $acct->id . '">';
} }
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>Date</td><td>Type</td><td>Description</td>'; print '<td>Date</td><td>Type</td><td>Description</td>';
@ -322,7 +331,7 @@ if ($_GET["account"] > 0)
} }
else else
{ {
print "Erreur : numéro ce compte inexistant"; print "Erreur : numéro de compte inexistant";
} }
$db->close(); $db->close();

View File

@ -974,25 +974,25 @@ else
} }
// Envoyer // Envoyer
if ($fac->statut == 1 && $resteapayer > 0 && $user->rights->facture->envoyer) if ($fac->statut == 1 && price($resteapayer) > 0 && $user->rights->facture->envoyer)
{ {
print "<a class=\"tabAction\" href=\"$PHP_SELF?facid=$fac->id&amp;action=presend\">Envoyer</a>"; print "<a class=\"tabAction\" href=\"$PHP_SELF?facid=$fac->id&amp;action=presend\">Envoyer</a>";
} }
// Envoyer une relance // Envoyer une relance
if ($fac->statut == 1 && $resteapayer > 0 && $user->rights->facture->envoyer) if ($fac->statut == 1 && price($resteapayer) > 0 && $user->rights->facture->envoyer)
{ {
print "<a class=\"tabAction\" href=\"$PHP_SELF?facid=$fac->id&amp;action=prerelance\">Envoyer une relance</a>"; print "<a class=\"tabAction\" href=\"$PHP_SELF?facid=$fac->id&amp;action=prerelance\">Envoyer une relance</a>";
} }
// Emettre paiement // Emettre paiement
if ($fac->statut == 1 && $resteapayer > 0 && $user->rights->facture->paiement) if ($fac->statut == 1 && price($resteapayer) > 0 && $user->rights->facture->paiement)
{ {
print "<a class=\"tabAction\" href=\"paiement.php?facid=".$fac->id."&amp;action=create\">Emettre un paiement</a>"; print "<a class=\"tabAction\" href=\"paiement.php?facid=".$fac->id."&amp;action=create\">Emettre un paiement</a>";
} }
// Classer 'payé' // Classer 'payé'
if ($fac->statut == 1 && $resteapayer <= 0 if ($fac->statut == 1 && price($resteapayer) <= 0
&& $fac->paye == 0 && $user->rights->facture->paiement) && $fac->paye == 0 && $user->rights->facture->paiement)
{ {
print "<a class=\"tabAction\" href=\"$PHP_SELF?facid=$fac->id&amp;action=payed\">Classer 'Payée'</a>"; print "<a class=\"tabAction\" href=\"$PHP_SELF?facid=$fac->id&amp;action=payed\">Classer 'Payée'</a>";