';
- $sql = "SELECT s.nom, s.rowid, c.rowid as id, c.ref as ref, c.statut, ".$db->pdate("c.datec")." as dc";
+ $sql = "SELECT s.nom, s.rowid, c.rowid as id, c.ref as ref, c.statut, c.datec as dc";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as c";
$sql .= " WHERE c.fk_soc = s.rowid ";
$sql .= " AND s.rowid = ".$objsoc->id;
@@ -527,7 +527,7 @@ if ($socid > 0)
$contrat->ref=$objp->ref?$objp->ref:$objp->id;
print $contrat->getNomUrl(1,12);
print "\n";
- print ''.dol_print_date($objp->dc,'day')." \n";
+ print ''.dol_print_date($db->jdate($objp->dc),'day')." \n";
print ' ';
print '';
$contrat->fetch_lignes();
@@ -552,7 +552,7 @@ if ($socid > 0)
{
print '';
- $sql = "SELECT s.nom, s.rowid, f.rowid as id, f.ref, ".$db->pdate("f.datei")." as di";
+ $sql = "SELECT s.nom, s.rowid, f.rowid as id, f.ref, f.datei as di";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."fichinter as f";
$sql .= " WHERE f.fk_soc = s.rowid";
$sql .= " AND s.rowid = ".$objsoc->id;
@@ -576,7 +576,7 @@ if ($socid > 0)
$objp = $db->fetch_object($resql);
print "";
print ''.img_object($langs->trans("ShowPropal"),"propal").' '.$objp->ref.' '."\n";
- print ''.dol_print_date($objp->di,"day").' '."\n";
+ print ''.dol_print_date($db->jdate($objp->di),"day").' '."\n";
print ' ';
$var=!$var;
$i++;
@@ -598,7 +598,7 @@ if ($socid > 0)
{
print '';
- $sql = "SELECT p.rowid,p.title,p.ref,p.public,".$db->pdate("p.dateo")." as do";
+ $sql = "SELECT p.rowid,p.title,p.ref,p.public, p.dateo as do";
$sql .= " FROM ".MAIN_DB_PREFIX."projet as p";
$sql .= " WHERE p.fk_soc = $objsoc->id";
$sql .= " ORDER BY p.dateo DESC";
@@ -637,7 +637,7 @@ if ($socid > 0)
// Label
print ''.$obj->title.' ';
// Date
- print ''.dol_print_date($obj->do,"day").' ';
+ print ''.dol_print_date($db->jdate($obj->do),"day").' ';
print '';
}
@@ -669,19 +669,21 @@ if ($socid > 0)
//$num = sizeOf($result);
$num=$chronodocs_static->get_nb_chronodocs($objsoc->id);
- if ($num > 0) {
+ if ($num > 0)
+ {
print '';
print ' ';
print ' ';
}
- while ($i < $num && $i < $MAXLIST) {
+ while ($i < $num && $i < $MAXLIST)
+ {
$obj = array_shift($result);
$var = !$var;
print "";
print ''.img_object($langs->trans("ShowChronodocs"),"generic")." ".$obj->ref.' ';
print "".dol_trunc($obj->title,30) ." ";
- print "".dol_print_date($obj->dp,'day')." \n";
+ print "".dol_print_date($db->jdate($obj->dp),'day')." \n";
print " ";
$i++;
diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php
index 7022e42aea4..c482c20c0e1 100644
--- a/htdocs/comm/index.php
+++ b/htdocs/comm/index.php
@@ -277,7 +277,7 @@ $max=3;
if ($conf->propal->enabled && $user->rights->propale->lire)
{
- $sql = "SELECT s.nom, s.rowid, p.rowid as propalid, p.total_ht, p.ref, p.fk_statut, ".$db->pdate("p.datep")." as dp";
+ $sql = "SELECT s.nom, s.rowid, p.rowid as propalid, p.total_ht, p.ref, p.fk_statut, p.datep as dp";
$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";
@@ -407,7 +407,7 @@ if ($conf->fournisseur->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.fournisseur = 1";
@@ -438,7 +438,7 @@ if ($conf->fournisseur->enabled && $user->rights->societe->lire)
$company->nom=$objp->nom;
print '';
print ''.$company->getNomUrl(1,'supplier',48).' ';
- print ''.dol_print_date($objp->dc,'day').' ';
+ print ''.dol_print_date($db->jdate($objp->dc),'day').' ';
print ' ';
$var=!$var;
$i++;
@@ -533,7 +533,7 @@ if ($conf->propal->enabled && $user->rights->propale->lire)
{
$langs->load("propal");
- $sql = "SELECT s.nom, s.rowid, p.rowid as propalid, p.total as total_ttc, p.total_ht, p.ref, p.fk_statut, ".$db->pdate("p.datep")." as dp";
+ $sql = "SELECT s.nom, s.rowid, p.rowid as propalid, p.total as total_ttc, p.total_ht, p.ref, p.fk_statut, p.datep as dp";
$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";
@@ -573,7 +573,7 @@ if ($conf->propal->enabled && $user->rights->propale->lire)
print $propalstatic->getNomUrl(1);
print '';
print '';
- if ($obj->dp < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late"));
+ if ($db->jdate($obj->dp) < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late"));
print ' ';
print '';
$filename=dol_sanitizeFileName($obj->ref);
@@ -586,7 +586,7 @@ if ($conf->propal->enabled && $user->rights->propale->lire)
print " rowid."\">".img_object($langs->trans("ShowCompany"),"company")." ".dol_trunc($obj->nom,44)." \n";
print "";
- print dol_print_date($obj->dp,'day')." \n";
+ print dol_print_date($db->jdate($obj->dp),'day')."\n";
print "".price($obj->total_ttc)." ";
print "".$propalstatic->LibStatut($obj->fk_statut,3)." \n";
print "\n";
diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php
index cbf32d6e5f0..acfe240a462 100644
--- a/htdocs/comm/propal.php
+++ b/htdocs/comm/propal.php
@@ -1407,8 +1407,8 @@ if ($id > 0 || ! empty($ref))
$sql = 'SELECT pt.rowid, pt.description, pt.fk_product, pt.fk_remise_except,';
$sql.= ' pt.qty, pt.tva_tx, pt.remise_percent, pt.subprice, pt.info_bits,';
$sql.= ' pt.total_ht, pt.total_tva, pt.total_ttc, pt.marge_tx, pt.marque_tx, pt.pa_ht, pt.special_code,';
- $sql.= ' '.$db->pdate('pt.date_start').' as date_start,';
- $sql.= ' '.$db->pdate('pt.date_end').' as date_end,';
+ $sql.= ' pt.date_start,';
+ $sql.= ' pt.date_end,';
$sql.= ' pt.product_type,';
$sql.= ' p.label as product_label, p.ref, p.fk_product_type, p.rowid as prodid,';
$sql.= ' p.description as product_desc';
@@ -1473,7 +1473,7 @@ if ($id > 0 || ! empty($ref))
print $html->textwithtooltip($text,$description,3,'','',$i);
// Show range
- print_date_range($objp->date_start,$objp->date_end);
+ print_date_range($db->jdate($objp->date_start),$db->jdate($objp->date_end));
// Add description in form
if ($conf->global->PRODUIT_DESC_IN_FORM)
@@ -1513,7 +1513,7 @@ if ($id > 0 || ! empty($ref))
print $text.' '.nl2br($objp->description);
// Show range
- print_date_range($objp->date_start,$objp->date_end);
+ print_date_range($db->jdate($objp->date_start),$db->jdate($objp->date_end));
}
print "\n";
}
@@ -1716,18 +1716,7 @@ if ($id > 0 || ! empty($ref))
print ' ';
print ' ';
print '' . "\n";
- /*
- if ($conf->service->enabled)
- {
- print "";
- print 'Si produit de type service a duree limitee: Du ';
- print $html->select_date($objp->date_start,"date_start",0,0,$objp->date_start?0:1);
- print ' au ';
- print $html->select_date($objp->date_end,"date_end",0,0,$objp->date_end?0:1);
- print ' ';
- print ' ' . "\n";
- }
- */
+
print "\n";
}
diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php
index 8267289f558..c5cbd23a51b 100644
--- a/htdocs/comm/remx.php
+++ b/htdocs/comm/remx.php
@@ -38,7 +38,7 @@ $langs->load("companies");
$_socid = $_GET["id"];
if ($user->societe_id > 0)
{
- $_socid = $user->societe_id;
+ $_socid = $user->societe_id;
}
@@ -210,112 +210,112 @@ if ($_socid > 0)
dol_fiche_head($head, 'absolutediscount', $langs->trans("ThirdParty"),0,'company');
- print '";
- print "\n";
+ print "\n";
- print ' ';
+ print ' ';
- if ($_GET['action'] == 'remove')
- {
+ if ($_GET['action'] == 'remove')
+ {
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$objsoc->id.'&remid='.$_GET["remid"], $langs->trans('RemoveDiscount'), $langs->trans('ConfirmRemoveDiscount'), 'confirm_remove', '', 0, 1);
- }
+ }
- /*
- * Liste remises fixes restant en cours (= liees a acune facture ni ligne de facture)
- */
- $sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx,";
- $sql.= $db->pdate("rc.datec")." as dc, rc.description,";
- $sql.= " rc.fk_facture_source,";
- $sql.= " u.login, u.rowid as user_id,";
+ /*
+ * Liste remises fixes restant en cours (= liees a acune facture ni ligne de facture)
+ */
+ $sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx,";
+ $sql.= " rc.datec as dc, rc.description,";
+ $sql.= " rc.fk_facture_source,";
+ $sql.= " u.login, u.rowid as user_id,";
$sql.= " fa.facnumber as ref, fa.type as type";
- $sql.= " FROM ".MAIN_DB_PREFIX."user as u, ".MAIN_DB_PREFIX."societe_remise_except as rc";
- $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as fa ON rc.fk_facture_source = fa.rowid";
+ $sql.= " FROM ".MAIN_DB_PREFIX."user as u, ".MAIN_DB_PREFIX."societe_remise_except as rc";
+ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as fa ON rc.fk_facture_source = fa.rowid";
$sql.= " WHERE rc.fk_soc =". $objsoc->id;
- $sql.= " AND u.rowid = rc.fk_user";
+ $sql.= " AND u.rowid = rc.fk_user";
$sql.= " AND (rc.fk_facture_line IS NULL AND rc.fk_facture IS NULL)";
- $sql.= " ORDER BY rc.datec DESC";
+ $sql.= " ORDER BY rc.datec DESC";
- $resql=$db->query($sql);
- if ($resql)
- {
- print_titre($langs->trans("DiscountStillRemaining"));
- print '';
- print '';
- print ''.$langs->trans("Date").' '; // Need 120+ for format with AM/PM
- print ''.$langs->trans("ReasonDiscount").' ';
- print ''.$langs->trans("ConsumedBy").' ';
- print ''.$langs->trans("AmountHT").' ';
- print ''.$langs->trans("VATRate").' ';
- print ''.$langs->trans("AmountTTC").' ';
- print ''.$langs->trans("DiscountOfferedBy").' ';
- print ' ';
- print ' ';
+ $resql=$db->query($sql);
+ if ($resql)
+ {
+ print_titre($langs->trans("DiscountStillRemaining"));
+ print '';
+ print '';
+ print ''.$langs->trans("Date").' '; // Need 120+ for format with AM/PM
+ print ''.$langs->trans("ReasonDiscount").' ';
+ print ''.$langs->trans("ConsumedBy").' ';
+ print ''.$langs->trans("AmountHT").' ';
+ print ''.$langs->trans("VATRate").' ';
+ print ''.$langs->trans("AmountTTC").' ';
+ print ''.$langs->trans("DiscountOfferedBy").' ';
+ print ' ';
+ print ' ';
- $var = true;
- $i = 0 ;
- $num = $db->num_rows($resql);
- while ($i < $num)
- {
- $obj = $db->fetch_object($resql);
- $var = !$var;
- print "";
- print ''.dol_print_date($obj->dc,'dayhour').' ';
+ $var = true;
+ $i = 0 ;
+ $num = $db->num_rows($resql);
+ while ($i < $num)
+ {
+ $obj = $db->fetch_object($resql);
+ $var = !$var;
+ print " ";
+ print ''.dol_print_date($db->jdate($obj->dc),'dayhour').' ';
if ($obj->description == '(CREDIT_NOTE)')
{
- print '';
+ print ' ';
$facturestatic->id=$obj->fk_facture_source;
$facturestatic->ref=$obj->ref;
$facturestatic->type=$obj->type;
@@ -324,7 +324,7 @@ if ($_socid > 0)
}
elseif ($obj->description == '(DEPOSIT)')
{
- print ' ';
+ print ' ';
$facturestatic->id=$obj->fk_facture_source;
$facturestatic->ref=$obj->ref;
$facturestatic->type=$obj->type;
@@ -333,15 +333,15 @@ if ($_socid > 0)
}
else
{
- print ' ';
+ print ' ';
print $obj->description;
print ' ';
}
- print ''.$langs->trans("NotConsumed").' ';
+ print ''.$langs->trans("NotConsumed").' ';
print ''.price($obj->amount_ht).' ';
- print ''.price2num($obj->tva_tx,'MU').'% ';
- print ''.price($obj->amount_ttc).' ';
- print '';
+ print ' '.price2num($obj->tva_tx,'MU').'% ';
+ print ''.price($obj->amount_ttc).' ';
+ print '';
print ''.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.' ';
print ' ';
if ($user->rights->societe->creer || $user->rights->facture->creer)
@@ -352,11 +352,11 @@ if ($_socid > 0)
print 'id.'&action=remove&remid='.$obj->rowid.'">'.img_delete($langs->trans("RemoveDiscount")).' ';
print '';
}
- else print ' ';
- print ' ';
+ else print ' ';
+ print '';
- if ($_GET["action"]=='split' && $_GET['remid'] == $obj->rowid)
- {
+ if ($_GET["action"]=='split' && $_GET['remid'] == $obj->rowid)
+ {
print "";
print '';
$amount1=price2num($obj->amount_ttc/2,'MT');
@@ -370,109 +370,109 @@ if ($_socid > 0)
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$objsoc->id.'&remid='.$obj->rowid, $langs->trans('SplitDiscount'), $langs->trans('ConfirmSplitDiscount',price($obj->amount_ttc),$langs->transnoentities("Currency".$conf->monnaie)), 'confirm_split', $formquestion, 0, 0);
print ' ';
print ' ';
- }
- $i++;
- }
- $db->free($resql);
- print "
";
- }
- else
- {
- dol_print_error($db);
- }
+ }
+ $i++;
+ }
+ $db->free($resql);
+ print "
";
+ }
+ else
+ {
+ dol_print_error($db);
+ }
- print ' ';
+ print ' ';
- /*
- * Liste ristournes appliquees (=liees a une ligne de facture ou facture)
- */
+ /*
+ * Liste ristournes appliquees (=liees a une ligne de facture ou facture)
+ */
- // Remises liees a lignes de factures
- $sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx,";
- $sql.= $db->pdate("rc.datec")." as dc, rc.description, rc.fk_facture_line, rc.fk_facture,";
- $sql.= " rc.fk_facture_source,";
+ // Remises liees a lignes de factures
+ $sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx,";
+ $sql.= " rc.datec as dc, rc.description, rc.fk_facture_line, rc.fk_facture,";
+ $sql.= " rc.fk_facture_source,";
$sql.= " u.login, u.rowid as user_id,";
- $sql.= " f.rowid, f.facnumber,";
+ $sql.= " f.rowid, f.facnumber,";
$sql.= " fa.facnumber as ref, fa.type as type";
- $sql.= " FROM ".MAIN_DB_PREFIX."facture as f";
- $sql.= " , ".MAIN_DB_PREFIX."user as u";
- $sql.= " , ".MAIN_DB_PREFIX."facturedet as fc";
- $sql.= " , ".MAIN_DB_PREFIX."societe_remise_except as rc";
- $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as fa ON rc.fk_facture_source = fa.rowid";
- $sql.= " WHERE rc.fk_soc =". $objsoc->id;
- $sql.= " AND rc.fk_facture_line = fc.rowid";
- $sql.= " AND fc.fk_facture = f.rowid";
- $sql.= " AND rc.fk_user = u.rowid";
+ $sql.= " FROM ".MAIN_DB_PREFIX."facture as f";
+ $sql.= " , ".MAIN_DB_PREFIX."user as u";
+ $sql.= " , ".MAIN_DB_PREFIX."facturedet as fc";
+ $sql.= " , ".MAIN_DB_PREFIX."societe_remise_except as rc";
+ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as fa ON rc.fk_facture_source = fa.rowid";
+ $sql.= " WHERE rc.fk_soc =". $objsoc->id;
+ $sql.= " AND rc.fk_facture_line = fc.rowid";
+ $sql.= " AND fc.fk_facture = f.rowid";
+ $sql.= " AND rc.fk_user = u.rowid";
$sql.= " ORDER BY dc DESC";
//$sql.= " UNION ";
- // Remises liees a factures
- $sql2= "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx,";
- $sql2.= $db->pdate("rc.datec")." as dc, rc.description, rc.fk_facture_line, rc.fk_facture,";
- $sql2.= " rc.fk_facture_source,";
+ // Remises liees a factures
+ $sql2 = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx,";
+ $sql2.= " rc.datec as dc, rc.description, rc.fk_facture_line, rc.fk_facture,";
+ $sql2.= " rc.fk_facture_source,";
$sql2.= " u.login, u.rowid as user_id,";
- $sql2.= " f.rowid, f.facnumber,";
+ $sql2.= " f.rowid, f.facnumber,";
$sql2.= " fa.facnumber as ref, fa.type as type";
- $sql2.= " FROM ".MAIN_DB_PREFIX."facture as f";
- $sql2.= " , ".MAIN_DB_PREFIX."user as u";
- $sql2.= " , ".MAIN_DB_PREFIX."societe_remise_except as rc";
- $sql2.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as fa ON rc.fk_facture_source = fa.rowid";
- $sql2.= " WHERE rc.fk_soc =". $objsoc->id;
- $sql2.= " AND rc.fk_facture = f.rowid";
- $sql2.= " AND rc.fk_user = u.rowid";
+ $sql2.= " FROM ".MAIN_DB_PREFIX."facture as f";
+ $sql2.= " , ".MAIN_DB_PREFIX."user as u";
+ $sql2.= " , ".MAIN_DB_PREFIX."societe_remise_except as rc";
+ $sql2.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as fa ON rc.fk_facture_source = fa.rowid";
+ $sql2.= " WHERE rc.fk_soc =". $objsoc->id;
+ $sql2.= " AND rc.fk_facture = f.rowid";
+ $sql2.= " AND rc.fk_user = u.rowid";
$sql2.= " ORDER BY dc DESC";
- $resql=$db->query($sql);
+ $resql=$db->query($sql);
$resql2=null;
- if ($resql) $resql2=$db->query($sql2);
+ if ($resql) $resql2=$db->query($sql2);
if ($resql2)
- {
- print_titre($langs->trans("DiscountAlreadyCounted"));
- print '';
- print '';
- print ''.$langs->trans("Date").' '; // Need 120+ for format with AM/PM
- print ''.$langs->trans("ReasonDiscount").' ';
- print ''.$langs->trans("ConsumedBy").' ';
- print ''.$langs->trans("AmountHT").' ';
- print ''.$langs->trans("VATRate").' ';
- print ''.$langs->trans("AmountTTC").' ';
- print ''.$langs->trans("Author").' ';
- print ' ';
- print ' ';
+ {
+ print_titre($langs->trans("DiscountAlreadyCounted"));
+ print '';
+ print '';
+ print ''.$langs->trans("Date").' '; // Need 120+ for format with AM/PM
+ print ''.$langs->trans("ReasonDiscount").' ';
+ print ''.$langs->trans("ConsumedBy").' ';
+ print ''.$langs->trans("AmountHT").' ';
+ print ''.$langs->trans("VATRate").' ';
+ print ''.$langs->trans("AmountTTC").' ';
+ print ''.$langs->trans("Author").' ';
+ print ' ';
+ print ' ';
- $var = true;
+ $var = true;
$tab_sqlobj=array();
$tab_sqlobjOrder=array();
- $num = $db->num_rows($resql);
+ $num = $db->num_rows($resql);
for ($i = 0;$i < $num;$i++)
- {
+ {
$sqlobj = $db->fetch_object($resql);
$tab_sqlobj[] = $sqlobj;
- $tab_sqlobjOrder[]=$sqlobj->dc;
- }
+ $tab_sqlobjOrder[]=$db->jdate($sqlobj->dc);
+ }
$db->free($resql);
$num = $db->num_rows($resql2);
for ($i = 0;$i < $num;$i++)
- {
+ {
$sqlobj = $db->fetch_object($resql2);
$tab_sqlobj[] = $sqlobj;
- $tab_sqlobjOrder[]= $sqlobj->dc;
- }
+ $tab_sqlobjOrder[]= $db->jdate($sqlobj->dc);
+ }
$db->free($resql2);
array_multisort ($tab_sqlobjOrder,SORT_DESC,$tab_sqlobj);
$num = sizeOf($tab_sqlobj);
$i = 0 ;
- while ($i < $num )
- {
- $obj = array_shift($tab_sqlobj);
- $var = !$var;
- print "";
- print ''.dol_print_date($obj->dc,'dayhour').' ';
+ while ($i < $num )
+ {
+ $obj = array_shift($tab_sqlobj);
+ $var = !$var;
+ print " ";
+ print ''.dol_print_date($db->jdate($obj->dc),'dayhour').' ';
if ($obj->description == '(CREDIT_NOTE)')
{
- print '';
+ print ' ';
$facturestatic->id=$obj->fk_facture_source;
$facturestatic->ref=$obj->ref;
$facturestatic->type=$obj->type;
@@ -481,7 +481,7 @@ if ($_socid > 0)
}
elseif ($obj->description == '(DEPOSIT)')
{
- print ' ';
+ print ' ';
$facturestatic->id=$obj->fk_facture_source;
$facturestatic->ref=$obj->ref;
$facturestatic->type=$obj->type;
@@ -490,27 +490,27 @@ if ($_socid > 0)
}
else
{
- print ' ';
+ print ' ';
print $obj->description;
print ' ';
}
- print ''.img_object($langs->trans("ShowBill"),'bill').' '.$obj->facnumber.' ';
- print ''.price($obj->amount_ht).' ';
- print ''.price2num($obj->tva_tx,'MU').'% ';
- print ''.price($obj->amount_ttc).' ';
- print '';
+ print ' '.img_object($langs->trans("ShowBill"),'bill').' '.$obj->facnumber.' ';
+ print ''.price($obj->amount_ht).' ';
+ print ''.price2num($obj->tva_tx,'MU').'% ';
+ print ''.price($obj->amount_ttc).' ';
+ print '';
print ''.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.' ';
print ' ';
- print ' ';
- print ' ';
- $i++;
- }
- print "
";
- }
- else
- {
- print dol_print_error($db);
- }
+ print ' ';
+ print '';
+ $i++;
+ }
+ print "
";
+ }
+ else
+ {
+ print dol_print_error($db);
+ }
}
diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php
index 4f294cf9913..79506be4a65 100644
--- a/htdocs/commande/fiche.php
+++ b/htdocs/commande/fiche.php
@@ -1033,7 +1033,7 @@ if ($_GET['action'] == 'create' && $user->rights->commande->creer)
{
$sql = 'SELECT s.nom, s.prefix_comm, s.rowid';
$sql.= ', p.price, p.remise, p.remise_percent, p.tva, p.total, p.ref, p.fk_cond_reglement, p.fk_mode_reglement';
- $sql.= ', '.$db->pdate('p.datep').' as dp';
+ $sql.= ', p.datep as dp';
$sql.= ', c.id as statut, c.label as lst';
$sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s, '.MAIN_DB_PREFIX.'propal as p, '.MAIN_DB_PREFIX.'c_propalst as c';
$sql .= ' WHERE p.fk_soc = s.rowid AND p.fk_statut = c.id';
@@ -1693,8 +1693,8 @@ else
$sql = 'SELECT l.rowid, l.fk_product, l.product_type, l.description, l.price, l.qty, l.tva_tx, ';
$sql.= ' l.fk_remise_except, l.remise_percent, l.subprice, l.info_bits,';
$sql.= ' l.total_ht, l.total_tva, l.total_ttc,';
- $sql.= ' '.$db->pdate('l.date_start').' as date_start,';
- $sql.= ' '.$db->pdate('l.date_end').' as date_end,';
+ $sql.= ' l.date_start,';
+ $sql.= ' l.date_end,';
$sql.= ' p.label as product_label, p.ref, p.fk_product_type, p.rowid as prodid, ';
$sql.= ' p.description as product_desc';
$sql.= ' FROM '.MAIN_DB_PREFIX.'commandedet as l';
@@ -1754,7 +1754,7 @@ else
print $html->textwithtooltip($text,$description,3,'','',$i);
// Show range
- print_date_range($objp->date_start,$objp->date_end);
+ print_date_range($db->jdate($objp->date_start),$db->jdate($objp->date_end));
// Add description in form
if ($conf->global->PRODUIT_DESC_IN_FORM)
@@ -1795,7 +1795,7 @@ else
print $text.' '.nl2br($objp->description);
// Show range
- print_date_range($objp->date_start,$objp->date_end);
+ print_date_range($db->jdate($objp->date_start),$db->jdate($objp->date_end));
}
print '';
}
@@ -1944,9 +1944,9 @@ else
// Start and end dates selector
print '';
print ''.$langs->trans('ServiceLimitedDuration').' '.$langs->trans('From').' ';
- print $html->select_date($objp->date_start,'date_start',$usehm,$usehm,$objp->date_start?0:1,"updateligne");
+ print $html->select_date($db->jdate($objp->date_start),'date_start',$usehm,$usehm,$objp->date_start?0:1,"updateligne");
print ' '.$langs->trans('to').' ';
- print $html->select_date($objp->date_end,'date_end',$usehm,$usehm,$objp->date_end?0:1,"updateligne");
+ print $html->select_date($db->jdate($objp->date_end),'date_end',$usehm,$usehm,$objp->date_end?0:1,"updateligne");
print ' ';
print ' ';
diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php
index b5a6fbb6128..d4dd8445e12 100644
--- a/htdocs/compta/bank/releve.php
+++ b/htdocs/compta/bank/releve.php
@@ -254,7 +254,7 @@ else
}
// Recherche les ecritures pour le releve
- $sql = "SELECT b.rowid,".$db->pdate("b.dateo")." as do,".$db->pdate("b.datev")." as dv";
+ $sql = "SELECT b.rowid, b.dateo as do, b.datev as dv";
$sql.= ", b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type";
$sql.= " FROM ".MAIN_DB_PREFIX."bank as b";
$sql.= " WHERE b.num_releve='".$num."'";
@@ -283,13 +283,13 @@ else
print "";
// Date operation
- print ''.dol_print_date($objp->do,"day").' ';
+ print ''.dol_print_date($db->jdate($objp->do),"day").' ';
// Date de valeur
print '';
print 'rowid.'">';
print img_previous().' ';
- print dol_print_date($objp->dv,"day") .' ';
+ print dol_print_date($db->jdate($objp->dv),"day") .' ';
print 'rowid.'">';
print img_next().' ';
print " \n";
diff --git a/htdocs/compta/bank/treso.php b/htdocs/compta/bank/treso.php
index f0c761126ae..875cfcbabe8 100644
--- a/htdocs/compta/bank/treso.php
+++ b/htdocs/compta/bank/treso.php
@@ -152,7 +152,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
// Remainder to pay in future
// Customer invoices
- $sql = "SELECT 'invoice' as family, f.rowid as objid, f.facnumber as ref, f.total_ttc, f.type, ".$db->pdate("f.date_lim_reglement")." as dlr,";
+ $sql = "SELECT 'invoice' as family, f.rowid as objid, f.facnumber as ref, f.total_ttc, f.type, f.date_lim_reglement as dlr,";
$sql.= " s.rowid as socid, s.nom, s.fournisseur";
$sql.= " FROM ".MAIN_DB_PREFIX."facture as f";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON f.fk_soc = s.rowid";
@@ -161,7 +161,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
$sql.= " ORDER BY dlr ASC";
// Supplier invoices
- $sql2= " SELECT 'supplier_invoice' as family, ff.rowid as objid, ff.facnumber as ref, (-1*ff.total_ttc) as total_ttc, ff.type, ".$db->pdate("ff.date_lim_reglement")." as dlr,";
+ $sql2= " SELECT 'supplier_invoice' as family, ff.rowid as objid, ff.facnumber as ref, (-1*ff.total_ttc) as total_ttc, ff.type, ff.date_lim_reglement as dlr,";
$sql2.= " s.rowid as socid, s.nom, s.fournisseur";
$sql2.= " FROM ".MAIN_DB_PREFIX."facture_fourn as ff";
$sql2.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON ff.fk_soc = s.rowid";
@@ -170,7 +170,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
$sql2.= " ORDER BY dlr ASC";
// Social contributions
- $sql3= " SELECT 'social_contribution' as family, cs.rowid as objid, cs.libelle as ref, (-1*cs.amount) as total_ttc, ccs.libelle as type, ".$db->pdate("cs.date_ech")." as dlr";
+ $sql3= " SELECT 'social_contribution' as family, cs.rowid as objid, cs.libelle as ref, (-1*cs.amount) as total_ttc, ccs.libelle as type, cs.date_ech as dlr";
$sql3.= " FROM ".MAIN_DB_PREFIX."chargesociales as cs";
$sql3.= " LEFT JOIN ".MAIN_DB_PREFIX."c_chargesociales as ccs ON cs.fk_type = ccs.id";
$sql3.= " WHERE cs.entity = ".$conf->entity;
@@ -190,7 +190,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
{
$sqlobj = $db->fetch_object($result);
$tab_sqlobj[] = $sqlobj;
- $tab_sqlobjOrder[]= $sqlobj->dlr;
+ $tab_sqlobjOrder[]= $db->jdate($sqlobj->dlr);
}
$db->free($result);
}
@@ -205,7 +205,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
{
$sqlobj = $db->fetch_object($result2);
$tab_sqlobj[] = $sqlobj;
- $tab_sqlobjOrder[]= $sqlobj->dlr;
+ $tab_sqlobjOrder[]= $db->jdate($sqlobj->dlr);
}
$db->free($result2);
}
@@ -221,7 +221,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
{
$sqlobj = $db->fetch_object($result3);
$tab_sqlobj[] = $sqlobj;
- $tab_sqlobjOrder[]= $sqlobj->dlr;
+ $tab_sqlobjOrder[]= $db->jdate($sqlobj->dlr);
}
$db->free($result3);
}
@@ -303,7 +303,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
$solde += $total_ttc;
print " ";
- print ''.dol_print_date($obj->dlr,"day")." ";
+ print ''.dol_print_date($db->jdate($obj->dlr),"day")." ";
print "".$ref." ";
print "".$refcomp." ";
if ($obj->total_ttc < 0) { print "".price($total_ttc)." "; };
diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php
index 0411f05bfa3..93ecf2e38d6 100644
--- a/htdocs/compta/facture/prelevement.php
+++ b/htdocs/compta/facture/prelevement.php
@@ -167,8 +167,8 @@ if ($_GET["facid"] > 0)
*
*/
- $sql = "SELECT pfd.rowid, pfd.traite,".$db->pdate("pfd.date_demande")." as date_demande";
- $sql .= " ,".$db->pdate("pfd.date_traite")." as date_traite";
+ $sql = "SELECT pfd.rowid, pfd.traite, pfd.date_demande as date_demande";
+ $sql .= " , pfd.date_traite as date_traite";
$sql .= " , pfd.amount";
$sql .= " , u.rowid as user_id, u.name, u.firstname, u.login";
$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd";
@@ -222,7 +222,7 @@ if ($_GET["facid"] > 0)
$var=!$var;
print " ";
- print ''.dol_print_date($obj->date_demande,'day')." \n";
+ print ''.dol_print_date($db->jdate($obj->date_demande),'day')." \n";
print 'En attente de traitement ';
print ''.price($obj->amount).' ';
print '- ';
@@ -243,8 +243,8 @@ if ($_GET["facid"] > 0)
dol_print_error($db);
}
- $sql = "SELECT pfd.rowid, pfd.traite,".$db->pdate("pfd.date_demande")." as date_demande";
- $sql .= " ,".$db->pdate("pfd.date_traite")." as date_traite";
+ $sql = "SELECT pfd.rowid, pfd.traite, pfd.date_demande";
+ $sql .= " , pfd.date_traite";
$sql .= " , pfd.fk_prelevement_bons, pfd.amount";
$sql .= " , u.rowid as user_id, u.name, u.firstname, u.login";
$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd";
@@ -267,9 +267,9 @@ if ($_GET["facid"] > 0)
print " ";
- print ''.dol_print_date($obj->date_demande)." \n";
+ print ''.dol_print_date($db->jdate($obj->date_demande))." \n";
- print ''.dol_print_date($obj->date_traite)." \n";
+ print ''.dol_print_date($db->jdate($obj->date_traite))." \n";
print ''.price($obj->amount).' ';
diff --git a/htdocs/compta/paiement/cheque/fiche.php b/htdocs/compta/paiement/cheque/fiche.php
index ae4235bba98..d50d11d9f82 100644
--- a/htdocs/compta/paiement/cheque/fiche.php
+++ b/htdocs/compta/paiement/cheque/fiche.php
@@ -348,7 +348,7 @@ else
// Liste des cheques
$sql = "SELECT b.rowid, b.amount, b.num_chq, b.emetteur,";
- $sql.= " ".$db->pdate("b.dateo")." as date,".$db->pdate("b.datec")." as datec, b.banque,";
+ $sql.= " b.dateo as date, b.datec as datec, b.banque,";
$sql.= " p.rowid as pid";
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account as ba";
$sql.= ", ".MAIN_DB_PREFIX."bank as b";