Skip to content
Snippets Groups Projects
Commit d0d2cd7d authored by Regis Houssin's avatar Regis Houssin
Browse files

Amélioration sécurité sur l'édition d'un facture validée

parent 74847f56
Branches
Tags
No related merge requests found
......@@ -167,6 +167,25 @@ if ($_GET['action'] == 'modif' && $user->rights->facture->modifier && $conf->glo
$fac = new Facture($db);
$fac->fetch($_GET['facid']);
// On vrifie si la facture a des paiements
$sql = 'SELECT pf.amount,';
$sql.= ' FROM '.MAIN_DB_PREFIX.'paiement_facture as pf';
$sql.= ' WHERE pf.fk_facture = '.$fac->id;
$result = $db->query($sql);
if ($result)
{
while ($i < $num)
{
$objp = $db->fetch_object($result);
$totalpaye += $objp->amount;
$i++;
}
}
$resteapayer = $fac->total_ttc - $totalpaye;
// On vrifie si les lignes de factures ont t exportes en compta et/ou ventiles
$ventilExportCompta = $fac->getVentilExportCompta();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment