mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-04 16:12:39 +01:00
Add more filter on list of invoices and payments
This commit is contained in:
@@ -37,6 +37,7 @@ require_once(DOL_DOCUMENT_ROOT.'/core/class/discount.class.php');
|
||||
require_once(DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php');
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT.'/lib/invoice.lib.php');
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/date.lib.php");
|
||||
if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT.'/projet/class/project.class.php');
|
||||
if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT.'/lib/project.lib.php');
|
||||
|
||||
@@ -3548,13 +3549,13 @@ else
|
||||
if ($month > 0)
|
||||
{
|
||||
if ($year > 0)
|
||||
$sql.= " AND date_format(f.datef, '%Y-%m') = '$year-$month'";
|
||||
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($year,$month,false))."' AND '".$db->idate(dol_get_last_day($year,$month,false))."'";
|
||||
else
|
||||
$sql.= " AND date_format(f.datef, '%m') = '$month'";
|
||||
}
|
||||
if ($year > 0)
|
||||
else if ($year > 0)
|
||||
{
|
||||
$sql.= ' AND date_format(f.datef, \'%Y\') = '.$year;
|
||||
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
|
||||
}
|
||||
if ($_POST['sf_ref'])
|
||||
{
|
||||
@@ -3567,10 +3568,8 @@ else
|
||||
|
||||
$sql.= ' ORDER BY ';
|
||||
$listfield=explode(',',$sortfield);
|
||||
foreach ($listfield as $key => $value)
|
||||
$sql.= $listfield[$key].' '.$sortorder.',';
|
||||
foreach ($listfield as $key => $value) $sql.= $listfield[$key].' '.$sortorder.',';
|
||||
$sql.= ' f.rowid DESC ';
|
||||
|
||||
$sql.= $db->plimit($limit+1,$offset);
|
||||
|
||||
$resql = $db->query($sql);
|
||||
@@ -3671,23 +3670,9 @@ else
|
||||
print "</td>\n";
|
||||
|
||||
// Date
|
||||
if ($objp->df > 0)
|
||||
{
|
||||
$y = dol_print_date($db->jdate($objp->df),'%Y');
|
||||
$m = dol_print_date($db->jdate($objp->df),'%m');
|
||||
$mt = dol_print_date($db->jdate($objp->df),'%b');
|
||||
$d = dol_print_date($db->jdate($objp->df),'%d');
|
||||
print '<td align="center" nowrap>';
|
||||
print $d;
|
||||
print ' <a href="'.$_SERVER["PHP_SELF"].'?year='.$y.'&month='.$m.'">';
|
||||
print $mt.'</a>';
|
||||
print ' <a href="'.$_SERVER["PHP_SELF"].'?year='.$y.'">';
|
||||
print $y.'</a></td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td align="center"><b>!!!</b></td>';
|
||||
}
|
||||
print dol_print_date($db->jdate($objp->df),'day');
|
||||
print '</td>';
|
||||
|
||||
// Date limit
|
||||
print '<td align="center" nowrap="1">'.dol_print_date($datelimit,'day');
|
||||
|
||||
@@ -36,18 +36,10 @@ $facid = isset($_GET["facid"])?$_GET["facid"]:'';
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result = restrictedArea($user, 'facture',$facid,'');
|
||||
|
||||
|
||||
$paymentstatic=new Paiement($db);
|
||||
$accountstatic=new Account($db);
|
||||
$companystatic=new Societe($db);
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader('',$langs->trans("ListPayment"));
|
||||
|
||||
$page=$_GET["page"];
|
||||
$sortorder=$_GET["sortorder"];
|
||||
$sortfield=$_GET["sortfield"];
|
||||
@@ -57,7 +49,16 @@ $offset = $limit * $page ;
|
||||
if (! $sortorder) $sortorder="DESC";
|
||||
if (! $sortfield) $sortfield="p.rowid";
|
||||
|
||||
$sql = "SELECT DISTINCT p.rowid,".$db->pdate("p.datep")." as dp, p.amount,";
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader('',$langs->trans("ListPayment"));
|
||||
|
||||
$sql = "SELECT DISTINCT p.rowid, p.datep as dp, p.amount,";
|
||||
$sql.= " p.statut, p.num_paiement,";
|
||||
//$sql.= " c.libelle as paiement_type,";
|
||||
$sql.= " c.code as paiement_code,";
|
||||
@@ -84,15 +85,24 @@ if ($socid)
|
||||
{
|
||||
$sql.= " AND f.fk_soc = ".$socid;
|
||||
}
|
||||
if ($_GET["search_montant"])
|
||||
// Search criteria
|
||||
if ($_REQUEST["search_ref"])
|
||||
{
|
||||
$sql .=" AND p.amount=".price2num($_GET["search_montant"]);
|
||||
$sql .=" AND p.rowid=".$_REQUEST["search_ref"];
|
||||
}
|
||||
if ($_REQUEST["search_amount"])
|
||||
{
|
||||
$sql .=" AND p.amount=".price2num($_REQUEST["search_amount"]);
|
||||
}
|
||||
if ($_REQUEST["search_company"])
|
||||
{
|
||||
$sql .=" AND s.nom like '%".addslashes($_REQUEST["search_company"])."%'";
|
||||
}
|
||||
|
||||
if ($_GET["orphelins"]) // Option for debugging purpose only
|
||||
{
|
||||
// Paiements li<EFBFBD>s <EFBFBD> aucune facture (pour aide au diagnostic)
|
||||
$sql = "SELECT p.rowid,".$db->pdate("p.datep")." as dp, p.amount,";
|
||||
// Paiements lies a aucune facture (pour aide au diagnostic)
|
||||
$sql = "SELECT p.rowid, p.datep as dp, p.amount,";
|
||||
$sql.= " p.statut, p.num_paiement,";
|
||||
//$sql.= " c.libelle as paiement_type";
|
||||
$sql.= " c.code as paiement_code,";
|
||||
@@ -105,8 +115,7 @@ if ($_GET["orphelins"]) // Option for debugging purpose only
|
||||
$sql.= " AND s.entity = ".$conf->entity;
|
||||
$sql.= " AND pf.rowid IS NULL";
|
||||
}
|
||||
$sql.= " ORDER BY ".$sortfield." ".$sortorder;
|
||||
//$sql.= ", facnumber ASC";
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
$sql.= $db->plimit( $limit+1 ,$offset);
|
||||
//print "$sql";
|
||||
|
||||
@@ -117,10 +126,15 @@ if ($resql)
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
$paramlist=($_GET["orphelins"]?"&orphelins=1":"");
|
||||
$paramlist='';
|
||||
$paramlist.=($_REQUEST["orphelins"]?"&orphelins=1":"");
|
||||
$paramlist.=($_REQUEST["search_ref"]?"&search_ref=".$_REQUEST["search_ref"]:"");
|
||||
$paramlist.=($_REQUEST["search_company"]?"&search_company=".$_REQUEST["search_company"]:"");
|
||||
$paramlist.=($_REQUEST["search_amount"]?"&search_amount=".$_REQUEST["search_amount"]:"");
|
||||
|
||||
print_barre_liste($langs->trans("ReceivedCustomersPayments"), $page, "liste.php",$paramlist,$sortfield,$sortorder,'',$num);
|
||||
|
||||
print '<form method="get" action="liste.php">';
|
||||
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("RefPayment"),"liste.php","p.rowid","",$paramlist,"",$sortfield,$sortorder);
|
||||
@@ -136,11 +150,18 @@ if ($resql)
|
||||
}
|
||||
print "</tr>\n";
|
||||
|
||||
// Lignes des champs de filtre
|
||||
// Lines for filters fields
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="5"> </td>';
|
||||
print '<td align="left">';
|
||||
print '<input class="fat" type="text" size="4" name="search_ref" value="'.$_REQUEST["search_ref"].'">';
|
||||
print '</td>';
|
||||
print '<td> </td>';
|
||||
print '<td align="left">';
|
||||
print '<input class="fat" type="text" size="6" name="search_company" value="'.$_REQUEST["search_company"].'">';
|
||||
print '</td>';
|
||||
print '<td colspan="2"> </td>';
|
||||
print '<td align="right">';
|
||||
print '<input class="fat" type="text" size="6" name="search_montant" value="'.$_GET["search_montant"].'">';
|
||||
print '<input class="fat" type="text" size="4" name="search_amount" value="'.$_REQUEST["search_amount"].'">';
|
||||
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>';
|
||||
if ($conf->global->BILL_ADD_PAYMENT_VALIDATION)
|
||||
@@ -163,7 +184,7 @@ if ($resql)
|
||||
print $paymentstatic->getNomUrl(1);
|
||||
print '</td>';
|
||||
|
||||
print '<td align="center">'.dol_print_date($objp->dp,'day').'</td>';
|
||||
print '<td align="center">'.dol_print_date($db->jdate($objp->dp),'day').'</td>';
|
||||
|
||||
// Company
|
||||
print '<td>';
|
||||
|
||||
@@ -105,7 +105,7 @@ class FactureFournisseur extends Facture
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Creation de la facture en base
|
||||
* \brief Create supplier invoice into database
|
||||
* \param user object utilisateur qui cree
|
||||
* \return int id facture si ok, < 0 si erreur
|
||||
*/
|
||||
@@ -147,7 +147,8 @@ class FactureFournisseur extends Facture
|
||||
$sql.= ", '".$this->db->idate($this->date)."'";
|
||||
$sql.= ", '".addslashes($this->note)."'";
|
||||
$sql.= ", '".addslashes($this->note_public)."'";
|
||||
$sql.= ", ".$user->id.",'".$this->db->idate($this->date_echeance)."'";
|
||||
$sql.= ", ".$user->id.",";
|
||||
$sql.= $this->date_echeance!=''?"'".$this->db->idate($this->date_echeance)."'":"null";
|
||||
$sql.= ")";
|
||||
|
||||
dol_syslog("FactureFournisseur::create sql=".$sql, LOG_DEBUG);
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
require("../../main.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/fourn/class/fournisseur.facture.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/fourn/class/fournisseur.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/date.lib.php");
|
||||
|
||||
if (!$user->rights->fournisseur->facture->lire)
|
||||
accessforbidden();
|
||||
@@ -55,6 +56,9 @@ $pagenext = $page + 1;
|
||||
if (! $sortorder) $sortorder="DESC";
|
||||
if (! $sortfield) $sortfield="fac.datef";
|
||||
|
||||
$month =$_GET['month'];
|
||||
$year =$_GET['year'];
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@@ -87,6 +91,7 @@ if ($_POST["mode"] == 'search')
|
||||
*/
|
||||
|
||||
$now=gmmktime();
|
||||
$html=new Form($db);
|
||||
|
||||
llxHeader($langs->trans("SuppliersInovices"),'','EN:Suppliers_Invoices|FR:FactureFournisseur|ES:Facturas_de_proveedores');
|
||||
|
||||
@@ -120,7 +125,17 @@ if ($_REQUEST["search_ref_supplier"])
|
||||
{
|
||||
$sql .= " AND fac.facnumber like '%".addslashes($_REQUEST["search_ref_supplier"])."%'";
|
||||
}
|
||||
|
||||
if ($month > 0)
|
||||
{
|
||||
if ($year > 0)
|
||||
$sql.= " AND fac.datef BETWEEN '".$db->idate(dol_get_first_day($year,$month,false))."' AND '".$db->idate(dol_get_last_day($year,$month,false))."'";
|
||||
else
|
||||
$sql.= " AND date_format(fac.datef, '%m') = '$month'";
|
||||
}
|
||||
else if ($year > 0)
|
||||
{
|
||||
$sql.= " AND fac.datef BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
|
||||
}
|
||||
if ($_GET["search_libelle"])
|
||||
{
|
||||
$sql .= " AND fac.libelle like '%".addslashes($_GET["search_libelle"])."%'";
|
||||
@@ -141,10 +156,10 @@ if ($_GET["search_montant_ttc"])
|
||||
$sql .= " AND fac.total_ttc = '".addslashes($_GET["search_montant_ttc"])."'";
|
||||
}
|
||||
|
||||
$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit( $limit+1, $offset);
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
$sql.= $db->plimit( $limit+1, $offset);
|
||||
|
||||
$resql = $db->query($sql);
|
||||
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
@@ -155,19 +170,25 @@ if ($resql)
|
||||
$soc->fetch($socid);
|
||||
}
|
||||
|
||||
print_barre_liste($langs->trans("BillsSuppliers").($socid?" $soc->nom":""),$page,"index.php","&socid=$socid",$sortfield,$sortorder,'',$num);
|
||||
|
||||
$param='&socid='.$socid;
|
||||
if ($month) $param.='&month='.$month;
|
||||
if ($year) $param.='&year=' .$year;
|
||||
|
||||
|
||||
print_barre_liste($langs->trans("BillsSuppliers").($socid?" $soc->nom":""),$page,"index.php",$param,$sortfield,$sortorder,'',$num);
|
||||
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<table class="liste" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Ref"),"index.php","fac.rowid","&socid=$socid","","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("RefSupplier"),"index.php","facnumber","&socid=$socid","","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Date"),"index.php","fac.datef","&socid=$socid","",'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DateDue"),"index.php","fac.date_lim_reglement","&socid=$socid","",'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Label"),"index.php","fac.libelle","&socid=$socid","","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Company"),"index.php","s.nom","&socid=$socid","","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("AmountHT"),"index.php","fac.total_ht","&socid=$socid","",'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("AmountTTC"),"index.php","fac.total_ttc","&socid=$socid","",'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Status"),"index.php","fk_statut,paye","&socid=$socid","",'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"fac.rowid","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("RefSupplier"),$_SERVER["PHP_SELF"],"facnumber","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"fac.datef","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DateDue"),$_SERVER["PHP_SELF"],"fac.date_lim_reglement","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"fac.libelle","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("AmountHT"),$_SERVER["PHP_SELF"],"fac.total_ht","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("AmountTTC"),$_SERVER["PHP_SELF"],"fac.total_ttc","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"fk_statut,paye","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print "</tr>\n";
|
||||
|
||||
// Lignes des champs de filtre
|
||||
@@ -179,7 +200,14 @@ if ($resql)
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" size="6" type="text" name="search_ref_supplier" value="'.$_REQUEST["search_ref_supplier"].'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre" colspan="1" align="center">';
|
||||
print '<input class="flat" type="text" size="1" maxlength="2" name="month" value="'.$month.'">';
|
||||
//print ' '.$langs->trans('Year').': ';
|
||||
$max_year = date("Y");
|
||||
$syear = $year;
|
||||
//if ($syear == '') $syear = date("Y");
|
||||
$html->select_year($syear,'year',1, '', $max_year);
|
||||
print '</td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" size="16" type="text" name="search_libelle" value="'.$_GET["search_libelle"].'">';
|
||||
|
||||
@@ -43,6 +43,11 @@ $sortfield = isset($_GET['sortfield'])?$_GET['sortfield']:$_POST['sortfield'];
|
||||
$sortorder = isset($_GET['sortorder'])?$_GET['sortorder']:$_POST['sortorder'];
|
||||
$page=isset($_GET['page'])?$_GET['page']:$_POST['page'];
|
||||
|
||||
$limit = $conf->liste_limit;
|
||||
$offset = $limit * $page ;
|
||||
if (! $sortorder) $sortorder="DESC";
|
||||
if (! $sortfield) $sortfield="p.rowid";
|
||||
|
||||
// Security check
|
||||
$socid=0;
|
||||
if ($user->societe_id > 0)
|
||||
@@ -52,6 +57,8 @@ if ($user->societe_id > 0)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
@@ -364,7 +371,7 @@ if (! $_GET['action'] && ! $_POST['action'])
|
||||
if (! $sortorder) $sortorder='DESC';
|
||||
if (! $sortfield) $sortfield='p.datep';
|
||||
|
||||
$sql = 'SELECT p.rowid, p.rowid as pid, '.$db->pdate('p.datep').' as dp, p.amount as pamount,';
|
||||
$sql = 'SELECT p.rowid, p.rowid as pid, p.datep as dp, p.amount as pamount,';
|
||||
$sql.= ' f.rowid as facid, f.rowid as ref, f.facnumber, f.amount,';
|
||||
$sql.= ' s.rowid as socid, s.nom,';
|
||||
$sql.= ' c.libelle as paiement_type, p.num_paiement,';
|
||||
@@ -378,12 +385,26 @@ if (! $_GET['action'] && ! $_POST['action'])
|
||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe AS s ON s.rowid = f.fk_soc';
|
||||
$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 (!$user->rights->societe->client->voir) $sql .= " WHERE s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
$sql.= ' WHERE 1=1';
|
||||
if (!$user->rights->societe->client->voir) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if ($socid)
|
||||
{
|
||||
$sql .= ' WHERE f.fk_soc = '.$socid;
|
||||
$sql .= ' AND f.fk_soc = '.$socid;
|
||||
}
|
||||
$sql .= ' ORDER BY '.$sortfield.' '.$sortorder;
|
||||
// Search criteria
|
||||
if ($_REQUEST["search_ref"])
|
||||
{
|
||||
$sql .=" AND p.rowid=".$_REQUEST["search_ref"];
|
||||
}
|
||||
if ($_REQUEST["search_amount"])
|
||||
{
|
||||
$sql .=" AND p.amount=".price2num($_REQUEST["search_amount"]);
|
||||
}
|
||||
if ($_REQUEST["search_company"])
|
||||
{
|
||||
$sql .=" AND s.nom like '%".addslashes($_REQUEST["search_company"])."%'";
|
||||
}
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
$sql.= $db->plimit($limit + 1 ,$offset);
|
||||
|
||||
$resql = $db->query($sql);
|
||||
@@ -393,16 +414,39 @@ if (! $_GET['action'] && ! $_POST['action'])
|
||||
$i = 0;
|
||||
$var=True;
|
||||
|
||||
print_barre_liste($langs->trans('SupplierPayments'), $page, 'paiement.php','',$sortfield,$sortorder,'',$num);
|
||||
$paramlist='';
|
||||
$paramlist.=($_REQUEST["search_ref"]?"&search_ref=".$_REQUEST["search_ref"]:"");
|
||||
$paramlist.=($_REQUEST["search_company"]?"&search_company=".$_REQUEST["search_company"]:"");
|
||||
$paramlist.=($_REQUEST["search_amount"]?"&search_amount=".$_REQUEST["search_amount"]:"");
|
||||
|
||||
print_barre_liste($langs->trans('SupplierPayments'), $page, 'paiement.php',$paramlist,$sortfield,$sortorder,'',$num);
|
||||
|
||||
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans('RefPayment'),'paiement.php','rowid','','','',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Date'),'paiement.php','dp','','','align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('ThirdParty'),'paiement.php','s.nom','','','',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Type'),'paiement.php','c.libelle','','','',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Account'),'paiement.php','ba.label','','','',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Amount'),'paiement.php','f.amount','','','align="right"',$sortfield,$sortorder);
|
||||
//print_liste_field_titre($langs->trans('Invoice'),'paiement.php','facnumber','','','',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('RefPayment'),'paiement.php','p.rowid','',$paramlist,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Date'),'paiement.php','dp','',$paramlist,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('ThirdParty'),'paiement.php','s.nom','',$paramlist,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Type'),'paiement.php','c.libelle','',$paramlist,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Account'),'paiement.php','ba.label','',$paramlist,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Amount'),'paiement.php','f.amount','',$paramlist,'align="right"',$sortfield,$sortorder);
|
||||
//print_liste_field_titre($langs->trans('Invoice'),'paiement.php','facnumber','',$paramlist,'',$sortfield,$sortorder);
|
||||
print "</tr>\n";
|
||||
|
||||
// Lines for filters fields
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td align="left">';
|
||||
print '<input class="fat" type="text" size="4" name="search_ref" value="'.$_REQUEST["search_ref"].'">';
|
||||
print '</td>';
|
||||
print '<td> </td>';
|
||||
print '<td align="left">';
|
||||
print '<input class="fat" type="text" size="6" name="search_company" value="'.$_REQUEST["search_company"].'">';
|
||||
print '</td>';
|
||||
print '<td colspan="2"> </td>';
|
||||
print '<td align="right">';
|
||||
print '<input class="fat" type="text" size="4" name="search_amount" value="'.$_REQUEST["search_amount"].'">';
|
||||
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";
|
||||
|
||||
while ($i < min($num,$limit))
|
||||
@@ -415,7 +459,7 @@ if (! $_GET['action'] && ! $_POST['action'])
|
||||
print '<td nowrap="nowrap"><a href="'.DOL_URL_ROOT.'/fourn/paiement/fiche.php?id='.$objp->pid.'">'.img_object($langs->trans('ShowPayment'),'payment').' '.$objp->pid.'</a></td>';
|
||||
|
||||
// Date
|
||||
print '<td nowrap="nowrap" align="center">'.dol_print_date($objp->dp,'day')."</td>\n";
|
||||
print '<td nowrap="nowrap" align="center">'.dol_print_date($db->jdate($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').' '.dol_trunc($objp->nom,32).'</a>';
|
||||
@@ -442,6 +486,7 @@ if (! $_GET['action'] && ! $_POST['action'])
|
||||
$i++;
|
||||
}
|
||||
print "</table>";
|
||||
print "</form>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -547,10 +547,10 @@ class DoliDb
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Formatage (par PHP) d'une date vers format texte pour insertion dans champ date.
|
||||
* Fonction a utiliser pour generer les INSERT.
|
||||
* \param param Date TMS a convertir
|
||||
* \return date Date au format texte YYYYMMDDHHMMSS.
|
||||
* \brief Convert (by PHP) a GM Timestamp date into a PHP server TZ to insert into a date field.
|
||||
* Function to use to build INSERT, UPDATE or WHERE predica
|
||||
* \param param Date TMS to convert
|
||||
* \return string Date in a string YYYYMMDDHHMMSS
|
||||
*/
|
||||
function idate($param)
|
||||
{
|
||||
|
||||
@@ -94,13 +94,13 @@ if ($_GET["id"])
|
||||
if ($month > 0)
|
||||
{
|
||||
if ($year > 0)
|
||||
$sql.= " AND m.datem between '".$db->idate(dol_get_first_day($year,$month,false))."' AND '".$db->idate(dol_get_last_day($year,$month,false))."'";
|
||||
$sql.= " AND m.datem BETWEEN '".$db->idate(dol_get_first_day($year,$month,false))."' AND '".$db->idate(dol_get_last_day($year,$month,false))."'";
|
||||
else
|
||||
$sql.= " AND date_format(m.datem, '%m') = '$month'";
|
||||
}
|
||||
else if ($year > 0)
|
||||
{
|
||||
$sql.= " AND m.datem between '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
|
||||
$sql.= " AND m.datem BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
|
||||
}
|
||||
if (! empty($search_movment))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user