Bug résolu pour la table llx_bank de laquelle on n'enlevait pas les lignes quand on [del] un règlement
This commit is contained in:
parent
6cd2605aac
commit
569913d688
@ -1,5 +1,6 @@
|
|||||||
<?PHP
|
<?PHP
|
||||||
/* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
|
* Copyright (C) 2004 Éric Seigne <eric.seigne@ryxeo.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -110,6 +111,7 @@ if ($HTTP_POST_VARS["action"] == 'add')
|
|||||||
{
|
{
|
||||||
for ($i = 0 ; $i < sizeof($prop->lignes) ; $i++)
|
for ($i = 0 ; $i < sizeof($prop->lignes) ; $i++)
|
||||||
{
|
{
|
||||||
|
print "<pre>la propale précédente en ligne " . $prop->lignes[$i]->libelle . " avait comme prix : " . $prop->lignes[$i]->price . " !</pre>\n";
|
||||||
$result = $facture->addline($facid,
|
$result = $facture->addline($facid,
|
||||||
addslashes($prop->lignes[$i]->libelle),
|
addslashes($prop->lignes[$i]->libelle),
|
||||||
$prop->lignes[$i]->subprice,
|
$prop->lignes[$i]->subprice,
|
||||||
@ -185,6 +187,7 @@ if ($action == 'add_paiement')
|
|||||||
$paiement->num_paiement = $HTTP_POST_VARS["num_paiement"];
|
$paiement->num_paiement = $HTTP_POST_VARS["num_paiement"];
|
||||||
$paiement->note = $HTTP_POST_VARS["note"];
|
$paiement->note = $HTTP_POST_VARS["note"];
|
||||||
|
|
||||||
|
//A ne pas mélanger avec paiementid !
|
||||||
$paiement_id = $paiement->create();
|
$paiement_id = $paiement->create();
|
||||||
|
|
||||||
$action = '';
|
$action = '';
|
||||||
@ -193,9 +196,11 @@ if ($action == 'add_paiement')
|
|||||||
$fac->fetch($HTTP_POST_VARS["facid"]);
|
$fac->fetch($HTTP_POST_VARS["facid"]);
|
||||||
$fac->fetch_client();
|
$fac->fetch_client();
|
||||||
|
|
||||||
$label = "Réglement facture ";
|
$label = "Règlement facture " . $fac->ref;
|
||||||
|
|
||||||
|
//On ajoute une ligne dans la table llx_bank pour qu'ensuite on puisse rapprocher le compte !
|
||||||
$acc = new Account($db, $HTTP_POST_VARS["accountid"]);
|
$acc = new Account($db, $HTTP_POST_VARS["accountid"]);
|
||||||
|
//paiementid est correct, il contient "CHQ ou VIR par exemple"
|
||||||
$bank_line_id = $acc->addline($datepaye, $paiementid, $label, $amount, $num_paiement);
|
$bank_line_id = $acc->addline($datepaye, $paiementid, $label, $amount, $num_paiement);
|
||||||
$acc->add_url_line($bank_line_id, $fac->id, DOL_URL_ROOT.'/compta/facture.php?facid=', $fac->ref);
|
$acc->add_url_line($bank_line_id, $fac->id, DOL_URL_ROOT.'/compta/facture.php?facid=', $fac->ref);
|
||||||
$acc->add_url_line($bank_line_id, $fac->client->id, DOL_URL_ROOT.'/compta/fiche.php?socid=', $fac->client->nom);
|
$acc->add_url_line($bank_line_id, $fac->client->id, DOL_URL_ROOT.'/compta/fiche.php?socid=', $fac->client->nom);
|
||||||
@ -210,6 +215,11 @@ if ($action == 'del_paiement' && $user->rights->facture->paiement)
|
|||||||
$paiement->delete();
|
$paiement->delete();
|
||||||
|
|
||||||
$action = '';
|
$action = '';
|
||||||
|
//Attention: bug 18.01.2004 on oublie d'effacer la ligne correspondante dans llx_bank !
|
||||||
|
|
||||||
|
$acc = new Account($db, $HTTP_POST_VARS["accountid"]);
|
||||||
|
//paiementid est correct, il contient "CHQ ou VIR par exemple"
|
||||||
|
$acc->deleteline($paiementid);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user