diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index b56bb0e132c..ee504d658ae 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -1092,7 +1092,7 @@ class AccountLine */ function info($rowid) { - $sql = 'SELECT b.rowid, '.$this->db->pdate('b.datec').' as datec,'; + $sql = 'SELECT b.rowid, b.datec,'; $sql.= ' b.fk_user_author, b.fk_user_rappro'; $sql.= ' FROM '.MAIN_DB_PREFIX.'bank as b'; $sql.= ' WHERE b.rowid = '.$rowid; @@ -1118,7 +1118,7 @@ class AccountLine $this->user_rappro = $ruser; } - $this->date_creation = $obj->datec; + $this->date_creation = $this->db->jdate($obj->datec); //$this->date_rappro = $obj->daterappro; // \todo pas encore g�r�e } $this->db->free($result); diff --git a/htdocs/compta/deplacement/index.php b/htdocs/compta/deplacement/index.php index a4090b72237..e4184dddf0b 100644 --- a/htdocs/compta/deplacement/index.php +++ b/htdocs/compta/deplacement/index.php @@ -57,7 +57,7 @@ $pagenext = $page + 1; $sql = "SELECT s.nom, s.rowid as socid,"; // Ou -$sql.= " d.rowid, d.type, ".$db->pdate("d.dated")." as dd, d.km, "; // Comment +$sql.= " d.rowid, d.type, d.dated as dd, d.km, "; // Comment $sql.= " u.name, u.firstname"; // Qui $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; $sql.= ", ".MAIN_DB_PREFIX."deplacement as d"; @@ -100,7 +100,7 @@ if ($resql) print ""; print ''.img_object($langs->trans("ShowTrip"),"trip").' '.$objp->rowid.''; print ''.$langs->trans($objp->type).''; - print ''.dol_print_date($objp->dd,'day').''; + print ''.dol_print_date($db->jdate($objp->dd),'day').''; if ($objp->socid) print ''.$soc->getNomUrl(1).''; else print ' '; print ''.img_object($langs->trans("ShowUser"),"user").' '.$objp->firstname.' '.$objp->name.''; diff --git a/htdocs/compta/dons/liste.php b/htdocs/compta/dons/liste.php index d7fae6b29f7..a0ff260403e 100644 --- a/htdocs/compta/dons/liste.php +++ b/htdocs/compta/dons/liste.php @@ -53,7 +53,7 @@ llxHeader('',$langs->trans("Donations"),'EN:Module_Donations|FR:Module_Dons|ES:M $donationstatic=new Don($db); // Genere requete de liste des dons -$sql = "SELECT d.rowid, ".$db->pdate("d.datedon")." as datedon, d.prenom, d.nom, d.societe,"; +$sql = "SELECT d.rowid, d.datedon, d.prenom, d.nom, d.societe,"; $sql.= " d.amount, d.fk_statut as statut, "; $sql.= " p.title as projet"; $sql.= " FROM ".MAIN_DB_PREFIX."don as d LEFT JOIN ".MAIN_DB_PREFIX."projet AS p"; @@ -108,7 +108,7 @@ if ($result) print "".stripslashes($objp->prenom)."\n"; print "".stripslashes($objp->nom)."\n"; print "".stripslashes($objp->societe)."\n"; - print ''.dol_print_date($objp->datedon).''; + print ''.dol_print_date($db->jdate($objp->datedon)).''; if ($conf->projet->enabled) { print "$objp->projet\n"; } diff --git a/htdocs/compta/export/liste.php b/htdocs/compta/export/liste.php index 88566ab2d70..032a3847c91 100644 --- a/htdocs/compta/export/liste.php +++ b/htdocs/compta/export/liste.php @@ -56,7 +56,7 @@ if ($sortfield == "") $sortfield="ec.date_export"; llxHeader('','Compta - Export'); -$sql = "SELECT ec.rowid,".$db->pdate("ec.date_export")." as date_export, ec.ref"; +$sql = "SELECT ec.rowid, ec.date_export as date_export, ec.ref"; $sql .= " FROM ".MAIN_DB_PREFIX."export_compta as ec"; $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset); @@ -88,7 +88,7 @@ if ($result) print ""; print ''.$obj->ref.''; - print ''.dol_print_date($obj->date_export,"dayhour").''; + print ''.dol_print_date($db->jdate($obj->date_export),"dayhour").''; print ''.$langs->trans("ReBuild").''; print "\n"; $i++; diff --git a/htdocs/compta/export/modules/compta.export.class.php b/htdocs/compta/export/modules/compta.export.class.php index 7260b84524a..fc8483f7691 100644 --- a/htdocs/compta/export/modules/compta.export.class.php +++ b/htdocs/compta/export/modules/compta.export.class.php @@ -62,7 +62,7 @@ class ComptaExport $error = 0; - $sql = "SELECT f.rowid as facid, f.facnumber, ".$this->db->pdate("f.datef")." as datef"; + $sql = "SELECT f.rowid as facid, f.facnumber, f.datef"; $sql .= " , f.total_ttc, f.tva "; $sql .= " ,s.nom, s.rowid as socid, s.code_compta"; $sql .= " , l.price, l.tva_tx"; @@ -99,7 +99,7 @@ class ComptaExport { $obj = $this->db->fetch_object($resql); - $this->linec[$i][0] = $obj->datef; + $this->linec[$i][0] = $this->db->jdate($obj->datef); $this->linec[$i][1] = $obj->facid; $this->linec[$i][2] = $obj->code_compta; $this->linec[$i][3] = $obj->nom; @@ -138,7 +138,7 @@ class ComptaExport $error = 0; $sql = "SELECT p.rowid as paymentid, f.facnumber"; - $sql .= " ,".$this->db->pdate("p.datep")." as datep"; + $sql .= " , p.datep"; $sql .= " , pf.amount"; $sql .= " , s.nom, s.code_compta"; $sql .= " , cp.libelle, f.increment"; @@ -170,7 +170,7 @@ class ComptaExport { $obj = $this->db->fetch_object($resql); - $this->linep[$i][0] = $obj->datep; + $this->linep[$i][0] = $this->db->jdate($obj->datep); $this->linep[$i][1] = $obj->paymentid; $this->linep[$i][2] = $obj->code_compta; $this->linep[$i][3] = $obj->nom; diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index ab444d9df45..571d6a008d7 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -470,7 +470,7 @@ if ($conf->societe->enabled && $user->rights->societe->lire) $langs->load("boxes"); - $sql = "SELECT s.nom, s.rowid, ".$db->pdate("s.datec")." as dc"; + $sql = "SELECT s.nom, s.rowid, s.datec as dc"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE s.client IN (1, 3)"; @@ -508,7 +508,7 @@ if ($conf->societe->enabled && $user->rights->societe->lire) $var=!$var; print ''; print ''.$customerstatic->getNomUrl(1).''; - print ''.dol_print_date($objp->dc,'day').''; + print ''.dol_print_date($db->jdate($objp->dc),'day').''; print ''; $i++; diff --git a/htdocs/compta/param/comptes/liste.php b/htdocs/compta/param/comptes/liste.php index 12fdbe8d117..52b2364c833 100644 --- a/htdocs/compta/param/comptes/liste.php +++ b/htdocs/compta/param/comptes/liste.php @@ -46,7 +46,7 @@ $offset = $conf->liste_limit * $page ; * */ -$sql = "SELECT cg.rowid, cg.numero, cg.intitule, ".$db->pdate("cg.date_creation")." as dc"; +$sql = "SELECT cg.rowid, cg.numero, cg.intitule, cg.date_creation as dc"; $sql .= " FROM ".MAIN_DB_PREFIX."compta_compte_generaux as cg"; @@ -109,7 +109,7 @@ if ($resql) print ''.$obj->numero.''."\n"; print ''.$obj->intitule.''; print ''; - print dol_print_date($obj->dc); + print dol_print_date($db->jdate($obj->dc)); print ''; print "\n"; diff --git a/htdocs/compta/propal.php b/htdocs/compta/propal.php index e9a17f92b4a..0a0f7420264 100644 --- a/htdocs/compta/propal.php +++ b/htdocs/compta/propal.php @@ -197,7 +197,7 @@ if ($id > 0 || ! empty($ref)) print ''; if ($conf->projet->enabled) $rowspan++; - + //Local taxes if ($mysoc->pays_code=='ES' && $conf->global->MAIN_FEATURES_LEVEL >= 1) { @@ -327,9 +327,9 @@ if ($id > 0 || ! empty($ref)) print ''.price($propal->total_localtax2).''; print ''.$langs->trans("Currency".$conf->monnaie).''; } - } - - + } + + print ''.$langs->trans('AmountTTC').''.price($propal->total_ttc).''; print ''.$langs->trans("Currency".$conf->monnaie).''; @@ -575,8 +575,8 @@ else $sql = "SELECT s.nom, s.rowid as socid, s.client,"; $sql.= " p.rowid as propalid, p.ref, p.fk_statut,"; $sql.= " p.total_ht, p.tva, p.total,"; - $sql.= $db->pdate("p.datep")." as dp, "; - $sql.= $db->pdate("p.fin_validite")." as dfin"; + $sql.= " p.datep as dp,"; + $sql.= " p.fin_validite as dfin"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."propal as p"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -676,7 +676,7 @@ else print ''; print ''; - if ($objp->fk_statut == 1 && $objp->dfin < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late")); + if ($objp->fk_statut == 1 && $db->jdate($objp->dfin) < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late")); print ''; print ''; @@ -700,10 +700,10 @@ else // Date print ""; - $y = dol_print_date($objp->dp,"%Y"); - $m = dol_print_date($objp->dp,"%m"); - $mt = dol_print_date($objp->dp,"%b"); - $d = dol_print_date($objp->dp,"%d"); + $y = dol_print_date($db->jdate($objp->dp),"%Y"); + $m = dol_print_date($db->jdate($objp->dp),"%m"); + $mt = dol_print_date($db->jdate($objp->dp),"%b"); + $d = dol_print_date($db->jdate($objp->dp),"%d"); print $d."\n"; print " "; print $mt."\n"; diff --git a/htdocs/compta/stats/comp.php b/htdocs/compta/stats/comp.php index 8fbcfa88f93..ca4225bc47d 100644 --- a/htdocs/compta/stats/comp.php +++ b/htdocs/compta/stats/comp.php @@ -40,7 +40,7 @@ function propals ($db, $year, $month) { global $bc,$langs,$conf; - $sql = "SELECT s.nom, s.rowid as socid, p.rowid as propalid, p.price, p.ref,".$db->pdate("p.datep")." as dp, c.label as statut, c.id as statutid"; + $sql = "SELECT s.nom, s.rowid as socid, p.rowid as propalid, p.price, p.ref, p.datep as dp, c.label as statut, c.id as statutid"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."propal as p"; $sql.= ", ".MAIN_DB_PREFIX."c_propalst as c"; @@ -91,7 +91,7 @@ function propals ($db, $year, $month) print "propalid."\">".$objp->ref."\n"; - print "".dol_print_date($objp->dp)."\n"; + print "".dol_print_date($db->jdate($objp->dp))."\n"; print "".price($objp->price)."\n"; print "".$objp->statut."\n"; diff --git a/htdocs/compta/tva/reglement.php b/htdocs/compta/tva/reglement.php index 6253ff3be13..03d9734b1c3 100644 --- a/htdocs/compta/tva/reglement.php +++ b/htdocs/compta/tva/reglement.php @@ -48,7 +48,7 @@ $tva_static = new Tva($db); print_fiche_titre($langs->trans("VATPayments")); -$sql = "SELECT rowid, amount, label, ".$db->pdate("f.datev")." as dm"; +$sql = "SELECT rowid, amount, label, f.datev as dm"; $sql.= " FROM ".MAIN_DB_PREFIX."tva as f "; $sql.= " WHERE f.entity = ".$conf->entity; $sql.= " ORDER BY dm DESC"; @@ -78,7 +78,7 @@ if ($result) $tva_static->ref=$obj->rowid; print "".$tva_static->getNomUrl(1)."\n"; print "".dol_trunc($obj->label,40)."\n"; - print ''.dol_print_date($obj->dm,'day')."\n"; + print ''.dol_print_date($db->jdate($obj->dm),'day')."\n"; $total = $total + $obj->amount; print "".price($obj->amount).""; diff --git a/htdocs/compta/ventilation/fiche.php b/htdocs/compta/ventilation/fiche.php index f8c0a116464..719950e68f8 100644 --- a/htdocs/compta/ventilation/fiche.php +++ b/htdocs/compta/ventilation/fiche.php @@ -89,14 +89,13 @@ if($_GET["id"]) { $sql = "SELECT f.facnumber, f.rowid as facid, l.fk_product, l.description, l.price,"; $sql .= " l.qty, l.rowid, l.tva_tx, l.remise_percent, l.subprice,"; - $sql .= " ".$db->pdate("l.date_start")." as date_start, ".$db->pdate("l.date_end")." as date_end,"; + $sql .= " l.date_start as date_start, l.date_end as date_end,"; $sql .= " l.fk_code_ventilation "; $sql .= " FROM ".MAIN_DB_PREFIX."facturedet as l"; $sql .= " , ".MAIN_DB_PREFIX."facture as f"; $sql .= " WHERE f.rowid = l.fk_facture AND f.fk_statut = 1 AND l.rowid = ".$_GET["id"]; $result = $db->query($sql); - if ($result) { $num_lignes = $db->num_rows($result); diff --git a/htdocs/fichinter/fiche.php b/htdocs/fichinter/fiche.php index 5b9e59b8686..90faa61de4f 100644 --- a/htdocs/fichinter/fiche.php +++ b/htdocs/fichinter/fiche.php @@ -667,8 +667,8 @@ elseif ($fichinterid) /* * Lignes d'intervention */ - $sql = 'SELECT ft.rowid, ft.description, ft.fk_fichinter, ft.duree, ft.rang'; - $sql.= ', '.$db->pdate('ft.date').' as date_intervention'; + $sql = 'SELECT ft.rowid, ft.description, ft.fk_fichinter, ft.duree, ft.rang,'; + $sql.= ' ft.date as date_intervention'; $sql.= ' FROM '.MAIN_DB_PREFIX.'fichinterdet as ft'; $sql.= ' WHERE ft.fk_fichinter = '.$fichinterid; $sql.= ' ORDER BY ft.rang ASC, ft.rowid'; @@ -705,7 +705,7 @@ elseif ($fichinterid) print nl2br($objp->description); // Date - print ''.dol_print_date($objp->date_intervention,'dayhour').''; + print ''.dol_print_date($db->jdate($objp->date_intervention),'dayhour').''; // Duration print ''.ConvertSecondToTime($objp->duree).''; @@ -778,7 +778,7 @@ elseif ($fichinterid) // Date d'intervention print ''; - $html->select_date($objp->date_intervention,'di',1,1,0,"date_intervention"); + $html->select_date($db->jdate($objp->date_intervention),'di',1,1,0,"date_intervention"); print ''; // Duration diff --git a/htdocs/fichinter/index.php b/htdocs/fichinter/index.php index 02f59f52581..da00914a3a9 100644 --- a/htdocs/fichinter/index.php +++ b/htdocs/fichinter/index.php @@ -66,7 +66,7 @@ llxHeader(); $sql = "SELECT"; $sql.= " f.ref, f.rowid as fichid, f.fk_statut, f.description,"; -$sql.= " fd.description as descriptiondetail, ".$db->pdate("fd.date")." as dp, fd.duree,"; +$sql.= " fd.description as descriptiondetail, fd.date as dp, fd.duree,"; $sql.= " s.nom, s.rowid as socid"; $sql.= " FROM (".MAIN_DB_PREFIX."societe as s"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -135,7 +135,7 @@ if ($result) print ''.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($objp->nom,44)."\n"; print ''.dol_htmlentitiesbr(dol_trunc($objp->description,20)).''; print ''.dol_htmlentitiesbr(dol_trunc($objp->descriptiondetail,20)).''; - print ''.dol_print_date($objp->dp,'dayhour')."\n"; + print ''.dol_print_date($db->jdate($objp->dp),'dayhour')."\n"; print ''.ConvertSecondToTime($objp->duree).''; print ''.$interventionstatic->LibStatut($objp->fk_statut,5).''; diff --git a/htdocs/fichinter/rapport.php b/htdocs/fichinter/rapport.php index 34d5ba7cd82..7008470ca15 100644 --- a/htdocs/fichinter/rapport.php +++ b/htdocs/fichinter/rapport.php @@ -51,7 +51,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; $sql = "SELECT s.nom, s.rowid as socid, f.description, f.ref"; -$sql.= ", ".$db->pdate("f.datei")." as dp, f.rowid as fichid, f.fk_statut, f.duree"; +$sql.= ", f.datei as dp, f.rowid as fichid, f.fk_statut, f.duree"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."fichinter as f "; $sql.= " WHERE f.fk_soc = s.rowid"; @@ -124,7 +124,7 @@ if ( $db->query($sql) ) print "rowid.$filter."\">".$objp->nom."\n"; } print ''.nl2br($objp->description).''; - print "".dol_print_date($objp->dp,"%d %B %Y")."\n"; + print "".dol_print_date($db->jdate($objp->dp),"day")."\n"; print ''.sprintf("%.1f",$objp->duree).''; $DureeTotal += $objp->duree; print "\n"; diff --git a/htdocs/fourn/commande/liste.php b/htdocs/fourn/commande/liste.php index ad991347a3d..a4240548c55 100644 --- a/htdocs/fourn/commande/liste.php +++ b/htdocs/fourn/commande/liste.php @@ -73,7 +73,7 @@ $offset = $conf->liste_limit * $page ; * Mode Liste */ -$sql = "SELECT s.rowid as socid, s.nom, ".$db->pdate("cf.date_commande")." as dc,"; +$sql = "SELECT s.rowid as socid, s.nom, cf.date_commande as dc,"; $sql.= " cf.rowid,cf.ref, cf.fk_statut, cf.total_ttc, cf.fk_user_author,"; $sql.= " u.login"; $sql.= " FROM (".MAIN_DB_PREFIX."societe as s,"; @@ -177,7 +177,7 @@ if ($resql) print ""; if ($obj->dc) { - print dol_print_date($obj->dc,"day"); + print dol_print_date($db->jdate($obj->dc),"day"); } else { diff --git a/htdocs/fourn/fiche.php b/htdocs/fourn/fiche.php index c5e19b9b933..c1128e415b3 100644 --- a/htdocs/fourn/fiche.php +++ b/htdocs/fourn/fiche.php @@ -139,7 +139,7 @@ if ( $societe->fetch($socid) ) print ''; } } - + print ''; print ''; @@ -178,7 +178,7 @@ if ( $societe->fetch($socid) ) if ($user->rights->fournisseur->commande->lire) { - $sql = "SELECT p.rowid,p.ref,".$db->pdate("p.date_commande")." as dc, p.fk_statut"; + $sql = "SELECT p.rowid,p.ref, p.date_commande as dc, p.fk_statut"; $sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as p "; $sql.= " WHERE p.fk_soc =".$societe->id; $sql.= " ORDER BY p.date_commande DESC"; @@ -204,7 +204,7 @@ if ( $societe->fetch($socid) ) print ''; if ($obj->dc) { - print dol_print_date($obj->dc,'day'); + print dol_print_date($db->jdate($obj->dc),'day'); } else { @@ -234,7 +234,7 @@ if ( $societe->fetch($socid) ) if ($user->rights->fournisseur->facture->lire) { - $sql = 'SELECT p.rowid,p.libelle,p.facnumber,p.fk_statut,'.$db->pdate('p.datef').' as df, total_ttc as amount, paye'; + $sql = 'SELECT p.rowid,p.libelle,p.facnumber,p.fk_statut, p.datef as df, total_ttc as amount, paye'; $sql.= ' FROM '.MAIN_DB_PREFIX.'facture_fourn as p'; $sql.= ' WHERE p.fk_soc = '.$societe->id; $sql.= ' ORDER BY p.datef DESC'; @@ -256,7 +256,7 @@ if ( $societe->fetch($socid) ) print ''; print ''; print img_object($langs->trans('ShowBill'),'bill').' '.$obj->facnumber.' '.dol_trunc($obj->libelle,14).''; - print ''.dol_print_date($obj->df,'day').''; + print ''.dol_print_date($db->jdate($obj->df),'day').''; print ''.price($obj->amount).''; print ''.$facturestatic->LibStatut($obj->paye,$obj->fk_statut,5).''; print ''; diff --git a/htdocs/fourn/liste.php b/htdocs/fourn/liste.php index 39c4c9011bd..d5e81e3829b 100644 --- a/htdocs/fourn/liste.php +++ b/htdocs/fourn/liste.php @@ -67,7 +67,7 @@ $htmlother=new FormOther($db); llxHeader(); -$sql = "SELECT s.rowid as socid, s.nom, s.ville,".$db->pdate("s.datec")." as datec, ".$db->pdate("s.datea")." as datea, st.libelle as stcomm, s.prefix_comm"; +$sql = "SELECT s.rowid as socid, s.nom, s.ville, s.datec, s.datea, st.libelle as stcomm, s.prefix_comm"; $sql.= " , code_fournisseur, code_compta_fournisseur"; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user "; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."c_stcomm as st"; @@ -177,7 +177,7 @@ if ($resql) print "".$obj->ville."\n"; print ''.$obj->code_fournisseur.' '; print ''.$obj->code_compta_fournisseur.' '; - print ''.dol_print_date($obj->datec).''; + print ''.dol_print_date($db->jdate($obj->datec)).''; print " \n"; print "\n"; $i++; diff --git a/htdocs/fourn/product/fourn.php b/htdocs/fourn/product/fourn.php index d5dbded4068..b93dbbd1696 100644 --- a/htdocs/fourn/product/fourn.php +++ b/htdocs/fourn/product/fourn.php @@ -132,7 +132,7 @@ if ($_GET["id"]) * Prix */ - $sql = "SELECT p.price, p.quantity,".$db->pdate("tms") ." as date_releve"; + $sql = "SELECT p.price, p.quantity, tms as date_releve"; $sql .= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as p"; $sql .=" WHERE p.fk_soc = ".$product->fourn->id; $sql .= " AND p.fk_product = ".$product->id; @@ -148,7 +148,7 @@ if ($_GET["id"]) $objp = $db->fetch_object($resql); $var=!$var; print ""; - print ''.dol_print_date($objp->date_releve).''; + print ''.dol_print_date($db->datej($objp->date_releve)).''; print ''.price($objp->price).''; print ''.$objp->quantity.'';