Ajout option pour faciliter diagnostique problemes sur les paiements
This commit is contained in:
parent
b568c67225
commit
2a480075b9
@ -22,23 +22,22 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\file htdocs/compta/paiement/liste.php
|
\file htdocs/compta/paiement/liste.php
|
||||||
\ingroup compta
|
\ingroup compta
|
||||||
\brief Page liste des paiements des factures clients
|
\brief Page liste des paiements des factures clients
|
||||||
\version $Revision$
|
\version $Revision$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require("./pre.inc.php");
|
require("./pre.inc.php");
|
||||||
|
|
||||||
/*
|
// Sécurité accés client
|
||||||
* Sécurité accés client
|
|
||||||
*/
|
|
||||||
if ($user->societe_id > 0)
|
if ($user->societe_id > 0)
|
||||||
{
|
{
|
||||||
$action = '';
|
$action = '';
|
||||||
$socidp = $user->societe_id;
|
$socidp = $user->societe_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Affichage
|
* Affichage
|
||||||
*/
|
*/
|
||||||
@ -51,19 +50,29 @@ $sortfield=$_GET["sortfield"];
|
|||||||
|
|
||||||
$limit = $conf->liste_limit;
|
$limit = $conf->liste_limit;
|
||||||
$offset = $limit * $page ;
|
$offset = $limit * $page ;
|
||||||
|
|
||||||
if (! $sortorder) $sortorder="DESC";
|
if (! $sortorder) $sortorder="DESC";
|
||||||
if (! $sortfield) $sortfield="p.rowid";
|
if (! $sortfield) $sortfield="p.rowid";
|
||||||
|
|
||||||
$sql = "SELECT p.rowid,".$db->pdate("p.datep")." as dp, p.amount";
|
$sql = "SELECT p.rowid,".$db->pdate("p.datep")." as dp, p.amount,";
|
||||||
$sql .=", p.statut, p.num_paiement";
|
$sql.= " p.statut, p.num_paiement,";
|
||||||
$sql .=", c.libelle as paiement_type";
|
$sql.= " c.libelle as paiement_type";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."paiement as p";
|
$sql.= " FROM ".MAIN_DB_PREFIX."paiement as p,";
|
||||||
$sql .= " , ".MAIN_DB_PREFIX."c_paiement as c";
|
$sql.= " ".MAIN_DB_PREFIX."c_paiement as c";
|
||||||
$sql .= " WHERE p.fk_paiement = c.id";
|
$sql.= " WHERE p.fk_paiement = c.id";
|
||||||
|
if ($_GET["orphelins"]) { // Options qui ne sert qu'au debuggage
|
||||||
|
// Paiements liés à aucune facture (pour aide au diagnostique)
|
||||||
|
$sql = "SELECT p.rowid,".$db->pdate("p.datep")." as dp, p.amount,";
|
||||||
|
$sql.= " p.statut, p.num_paiement,";
|
||||||
|
$sql.= " c.libelle as paiement_type";
|
||||||
|
$sql.= " FROM ".MAIN_DB_PREFIX."paiement as p,";
|
||||||
|
$sql.= " ".MAIN_DB_PREFIX."c_paiement as c";
|
||||||
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf";
|
||||||
|
$sql.= " ON p.rowid = pf.fk_paiement";
|
||||||
|
$sql.= " WHERE p.fk_paiement = c.id AND pf.rowid IS NULL";
|
||||||
|
}
|
||||||
$sql .= " ORDER BY $sortfield $sortorder";
|
$sql .= " ORDER BY $sortfield $sortorder";
|
||||||
$sql .= $db->plimit( $limit +1 ,$offset);
|
$sql .= $db->plimit( $limit+1 ,$offset);
|
||||||
|
//print "$sql";
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
|
|
||||||
@ -73,15 +82,16 @@ if ($resql)
|
|||||||
$i = 0;
|
$i = 0;
|
||||||
$var=True;
|
$var=True;
|
||||||
|
|
||||||
print_barre_liste("Paiements reçus", $page, "liste.php","",$sortfield,$sortorder,'',$num);
|
$paramlist=($_GET["orphelins"]?"&orphelins=1":"");
|
||||||
|
print_barre_liste($langs->trans("ReceivedPayments"), $page, "liste.php",$paramlist,$sortfield,$sortorder,'',$num);
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print_liste_field_titre($langs->trans("Ref"),"liste.php","p.rowid","","","",$sortfield);
|
print_liste_field_titre($langs->trans("Ref"),"liste.php","p.rowid","",$paramlist,"",$sortfield);
|
||||||
print_liste_field_titre($langs->trans("Date"),"liste.php","dp","","","",$sortfield);
|
print_liste_field_titre($langs->trans("Date"),"liste.php","dp","",$paramlist,"",$sortfield);
|
||||||
print_liste_field_titre($langs->trans("Type"),"liste.php","c.libelle","","","",$sortfield);
|
print_liste_field_titre($langs->trans("Type"),"liste.php","c.libelle","",$paramlist,"",$sortfield);
|
||||||
print '<td align="right">'.$langs->trans("AmountTTC").'</td>';
|
print_liste_field_titre($langs->trans("AmountTTC"),"liste.php","p.amount","",$paramlist,'align="right"',$sortfield);
|
||||||
print "<td> </td>";
|
print_liste_field_titre($langs->trans("Status"),"liste.php","p.statut","",$paramlist,'align="center"',$sortfield);
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
while ($i < min($num,$limit))
|
while ($i < min($num,$limit))
|
||||||
@ -109,6 +119,9 @@ if ($resql)
|
|||||||
}
|
}
|
||||||
print "</table>";
|
print "</table>";
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
dolibarr_print_error($db);
|
||||||
|
}
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user