On ajoute client sur tableau des paiements
This commit is contained in:
parent
65f70ca87e
commit
65ac6ebb43
@ -48,6 +48,7 @@ if ($user->societe_id > 0)
|
||||
|
||||
$paymentstatic=new Paiement($db);
|
||||
$accountstatic=new Account($db);
|
||||
$companystatic=new Societe($db);
|
||||
|
||||
|
||||
/*
|
||||
@ -68,16 +69,14 @@ $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.= " c.code as paiement_code,";
|
||||
$sql.= " ba.rowid as bid, ba.label";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_paiement as c,";
|
||||
$sql.= " ".MAIN_DB_PREFIX."paiement as p";
|
||||
$sql.= " ba.rowid as bid, ba.label,";
|
||||
$sql.= " s.rowid as socid, s.nom";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_paiement as c, ".MAIN_DB_PREFIX."paiement as p";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON p.fk_bank = b.rowid";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid";
|
||||
if ($socid)
|
||||
{
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON p.rowid = pf.fk_paiement";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON pf.fk_facture = f.rowid";
|
||||
}
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON p.rowid = pf.fk_paiement";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON pf.fk_facture = f.rowid";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON f.fk_soc = s.rowid";
|
||||
$sql.= " WHERE p.fk_paiement = c.id";
|
||||
if ($socid)
|
||||
{
|
||||
@ -94,11 +93,12 @@ if ($_GET["orphelins"]) // Option qui ne sert qu'au debogage
|
||||
$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.= " c.code as paiement_code";
|
||||
$sql.= " c.code as paiement_code,";
|
||||
$sql.= " s.rowid as socid, s.nom";
|
||||
$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.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON p.rowid = pf.fk_paiement";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON f.fk_soc = s.rowid";
|
||||
$sql.= " WHERE p.fk_paiement = c.id AND pf.rowid IS NULL";
|
||||
}
|
||||
$sql .= " ORDER BY $sortfield $sortorder";
|
||||
@ -120,19 +120,19 @@ if ($resql)
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Ref"),"liste.php","p.rowid","",$paramlist,"",$sortfield);
|
||||
print_liste_field_titre($langs->trans("Date"),"liste.php","dp","",$paramlist,'align="center"',$sortfield);
|
||||
print_liste_field_titre($langs->trans("ThirdParty"),"liste.php","c.libelle","",$paramlist,"",$sortfield);
|
||||
print_liste_field_titre($langs->trans("Type"),"liste.php","c.libelle","",$paramlist,"",$sortfield);
|
||||
print_liste_field_titre($langs->trans("Account"),"liste.php","ba.label","",$paramlist,"",$sortfield);
|
||||
print_liste_field_titre($langs->trans("Amount"),"liste.php","p.amount","",$paramlist,'align="right"',$sortfield);
|
||||
print_liste_field_titre($langs->trans("AmountTTC"),"liste.php","p.amount","",$paramlist,'align="right"',$sortfield);
|
||||
print_liste_field_titre($langs->trans("Status"),"liste.php","p.statut","",$paramlist,'align="right"',$sortfield);
|
||||
print '<td> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// Lignes des champs de filtre
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="4"> </td>';
|
||||
print '<td colspan="5"> </td>';
|
||||
print '<td align="right">';
|
||||
print '<input class="fat" type="text" size="6" name="search_montant" value="'.$_GET["search_montant"].'">';
|
||||
print '</td><td align="right" colspan="2">';
|
||||
print '</td><td align="right">';
|
||||
print '<input type="image" class="liste_titre" name="button_search" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" alt="'.$langs->trans("Search").'">';
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
@ -149,7 +149,19 @@ if ($resql)
|
||||
print $paymentstatic->getNomUrl(1);
|
||||
print '</td>';
|
||||
|
||||
print '<td align="center">'.dolibarr_print_date($objp->dp).'</td>';
|
||||
print '<td align="center">'.dolibarr_print_date($objp->dp,'day').'</td>';
|
||||
|
||||
// Company
|
||||
print '<td>';
|
||||
if ($objp->socid)
|
||||
{
|
||||
$companystatic->id=$objp->socid;
|
||||
$companystatic->nom=$objp->nom;
|
||||
print $companystatic->getNomUrl(1,'',24);
|
||||
}
|
||||
else print ' ';
|
||||
print '</td>';
|
||||
|
||||
print '<td>'.$langs->trans("PaymentTypeShort".$objp->paiement_code).' '.$objp->num_paiement.'</td>';
|
||||
print '<td>';
|
||||
if ($objp->bid)
|
||||
@ -162,15 +174,9 @@ if ($resql)
|
||||
print '</td>';
|
||||
print '<td align="right">'.price($objp->amount).'</td>';
|
||||
print '<td align="right">';
|
||||
if ($objp->statut == 0) print '<a href="fiche.php?id='.$objp->rowid.'&action=valide">';
|
||||
print $paymentstatic->LibStatut($objp->statut,5);
|
||||
print '</td>';
|
||||
|
||||
print '<td align="right">';
|
||||
if ($objp->statut == 0)
|
||||
{
|
||||
print '<a href="fiche.php?id='.$objp->rowid.'&action=valide">'.$langs->trans("Validate").'</a>';
|
||||
}
|
||||
else print ' ';
|
||||
if ($objp->statut == 0) print '</a>';
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004 Éric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
|
||||
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||
*
|
||||
@ -385,10 +385,9 @@ if (! $_GET['action'] && ! $_POST['action'])
|
||||
print_barre_liste($langs->trans('Payments'), $page, 'paiement.php','',$sortfield,$sortorder,'',$num);
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans('Ref').'</td>';
|
||||
print_liste_field_titre($langs->trans('Bill'),'paiement.php','facnumber','','','',$sortfield);
|
||||
print_liste_field_titre($langs->trans('Company'),'paiement.php','s.nom','','','',$sortfield);
|
||||
print_liste_field_titre($langs->trans('Ref'),'paiement.php','rowid','','','',$sortfield);
|
||||
print_liste_field_titre($langs->trans('Date'),'paiement.php','dp','','','',$sortfield);
|
||||
print_liste_field_titre($langs->trans('ThirdParty'),'paiement.php','s.nom','','','',$sortfield);
|
||||
print_liste_field_titre($langs->trans('Type'),'paiement.php','c.libelle','','','',$sortfield);
|
||||
print_liste_field_titre($langs->trans('Account'),'paiement.php','ba.label','','','',$sortfield);
|
||||
print_liste_field_titre($langs->trans('AmountTTC'),'paiement.php','f.amount','','','align="right"',$sortfield);
|
||||
@ -400,16 +399,17 @@ if (! $_GET['action'] && ! $_POST['action'])
|
||||
$objp = $db->fetch_object($resql);
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
|
||||
// Ref
|
||||
print '<td nowrap="nowrap"><a href="'.DOL_URL_ROOT.'/fourn/paiement/fiche.php?id='.$objp->rowid.'">'.img_object($langs->trans('ShowPayment'),'payment').' '.$objp->rowid.'</a></td>';
|
||||
print '<td nowrap="nowrap">';
|
||||
if ($objp->facid) print '<a href="'.DOL_URL_ROOT.'/fourn/facture/fiche.php?facid='.$objp->facid.'">'.img_object($langs->trans('ShowBill'),'bill').' '.dolibarr_trunc($objp->facnumber,16).'</a>';
|
||||
else print ' ';
|
||||
print '</td>';
|
||||
|
||||
// Date
|
||||
print '<td nowrap="nowrap" align="center">'.dolibarr_print_date($objp->dp,'day')."</td>\n";
|
||||
|
||||
print '<td>';
|
||||
if ($objp->socid) print '<a href="'.DOL_URL_ROOT.'/soc.php?socid='.$objp->socid.'">'.img_object($langs->trans('ShowCompany'),'company').' '.dolibarr_trunc($objp->nom,32).'</a>';
|
||||
else print ' ';
|
||||
print '</td>';
|
||||
print '<td nowrap="nowrap" align="center">'.dolibarr_print_date($objp->dp)."</td>\n";
|
||||
print '<td>'.dolibarr_trunc($objp->paiement_type.' '.$objp->num_paiement,32)."</td>\n";
|
||||
print '<td>';
|
||||
if ($objp->bid) print '<a href="'.DOL_URL_ROOT.'/compta/bank/account.php?account='.$objp->bid.'">'.img_object($langs->trans("ShowAccount"),'account').' '.dolibarr_trunc($objp->label,24).'</a>';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user