Fix: La regeneration des factures doit se faire sur la liste des factures du paiement.

This commit is contained in:
Laurent Destailleur 2007-05-16 12:05:44 +00:00
parent e946c8e585
commit a4cff6c063

View File

@ -74,19 +74,23 @@ if ($_POST['action'] == 'confirm_valide' && $_POST['confirm'] == 'yes' && $user-
$paiement = new Paiement($db); $paiement = new Paiement($db);
$paiement->id = $_GET['id']; $paiement->id = $_GET['id'];
if ($paiement->valide() >= 0) if ($paiement->valide() > 0)
{ {
$db->commit(); $db->commit();
// régénère le pdf // \TODO Boucler sur les facture liées à ce paiement et régénèrer le pdf
$factures=array();
foreach($factures as $id)
{
$fac = new Facture($db); $fac = new Facture($db);
$fac->fetch($_GET['facid']); $fac->fetch($id);
if ($_REQUEST['lang_id']) if ($_REQUEST['lang_id'])
{ {
$outputlangs = new Translate(DOL_DOCUMENT_ROOT ."/langs"); $outputlangs = new Translate(DOL_DOCUMENT_ROOT ."/langs");
$outputlangs->setDefaultLang($_REQUEST['lang_id']); $outputlangs->setDefaultLang($_REQUEST['lang_id']);
} }
facture_pdf_create($db, $fac->id, '', $fac->modelpdf, $outputlangs); facture_pdf_create($db, $fac->id, '', $fac->modelpdf, $outputlangs);
}
Header('Location: fiche.php?id='.$paiement->id); Header('Location: fiche.php?id='.$paiement->id);
exit; exit;