Fix: Remove depracated property

Qual: Removed pdate
This commit is contained in:
Laurent Destailleur 2010-05-08 19:21:57 +00:00
parent 8d3b5c75c0
commit 89c76d13b2
18 changed files with 92 additions and 106 deletions

View File

@ -241,7 +241,6 @@ if ($_POST['action'] == 'add' && $user->rights->propale->creer)
$propal->datep = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); $propal->datep = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
$propal->date_livraison = dol_mktime(12, 0, 0, $_POST['liv_month'], $_POST['liv_day'], $_POST['liv_year']); $propal->date_livraison = dol_mktime(12, 0, 0, $_POST['liv_month'], $_POST['liv_day'], $_POST['liv_year']);
$propal->fk_delivery_address = $_POST['adresse_livraison_id']; $propal->fk_delivery_address = $_POST['adresse_livraison_id'];
$propal->adresse_livraison_id = $_POST['adresse_livraison_id']; // TODO obsolete
$propal->duree_validite = $_POST['duree_validite']; $propal->duree_validite = $_POST['duree_validite'];
$propal->cond_reglement_id = $_POST['cond_reglement_id']; $propal->cond_reglement_id = $_POST['cond_reglement_id'];
$propal->mode_reglement_id = $_POST['mode_reglement_id']; $propal->mode_reglement_id = $_POST['mode_reglement_id'];
@ -269,7 +268,6 @@ if ($_POST['action'] == 'add' && $user->rights->propale->creer)
$propal->datep = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); $propal->datep = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
$propal->date_livraison = dol_mktime(12, 0, 0, $_POST['liv_month'], $_POST['liv_day'], $_POST['liv_year']); $propal->date_livraison = dol_mktime(12, 0, 0, $_POST['liv_month'], $_POST['liv_day'], $_POST['liv_year']);
$propal->fk_delivery_address = $_POST['fk_delivery_address']; $propal->fk_delivery_address = $_POST['fk_delivery_address'];
$propal->adresse_livraison_id = $_POST['fk_delivery_address']; // TODO obsolete
$propal->duree_validite = $_POST['duree_validite']; $propal->duree_validite = $_POST['duree_validite'];
$propal->cond_reglement_id = $_POST['cond_reglement_id']; $propal->cond_reglement_id = $_POST['cond_reglement_id'];
$propal->mode_reglement_id = $_POST['mode_reglement_id']; $propal->mode_reglement_id = $_POST['mode_reglement_id'];

View File

@ -85,7 +85,6 @@ class Propal extends CommonObject
var $remise_absolue; var $remise_absolue;
var $note; var $note;
var $note_public; var $note_public;
var $adresse_livraison_id;
var $fk_delivery_address; var $fk_delivery_address;
var $adresse; var $adresse;
@ -868,7 +867,6 @@ class Propal extends CommonObject
$this->fin_validite = $this->db->jdate($obj->dfv); $this->fin_validite = $this->db->jdate($obj->dfv);
$this->date_livraison = $this->db->jdate($obj->date_livraison); $this->date_livraison = $this->db->jdate($obj->date_livraison);
$this->fk_delivery_address = $obj->fk_adresse_livraison; $this->fk_delivery_address = $obj->fk_adresse_livraison;
$this->adresse_livraison_id = $obj->fk_adresse_livraison; // TODO obsolete
$this->mode_reglement_id = $obj->fk_mode_reglement; $this->mode_reglement_id = $obj->fk_mode_reglement;
$this->mode_reglement_code = $obj->mode_reglement_code; $this->mode_reglement_code = $obj->mode_reglement_code;

View File

@ -78,7 +78,7 @@ if ($_GET["id"] > 0) {
/* /*
* Commande * Commande
*/ */
$sql = 'SELECT s.nom, s.rowid, c.amount_ht, c.fk_projet, c.remise, c.tva, c.total_ttc, c.ref, c.fk_statut, '.$db->pdate('c.date_commande').' as dp, c.note,'; $sql = 'SELECT s.nom, s.rowid, c.amount_ht, c.fk_projet, c.remise, c.tva, c.total_ttc, c.ref, c.fk_statut, c.date_commande as dp, c.note,';
$sql.= ' c.fk_user_author, c.fk_user_valid, c.fk_user_cloture, c.date_creation, c.date_valid, c.date_cloture'; $sql.= ' c.fk_user_author, c.fk_user_valid, c.fk_user_cloture, c.date_creation, c.date_valid, c.date_cloture';
$sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s'; $sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s';
$sql.= ', '.MAIN_DB_PREFIX.'commande as c'; $sql.= ', '.MAIN_DB_PREFIX.'commande as c';

View File

@ -61,7 +61,6 @@ class Commande extends CommonObject
var $cond_reglement_code; var $cond_reglement_code;
var $mode_reglement_id; var $mode_reglement_id;
var $mode_reglement_code; var $mode_reglement_code;
var $adresse_livraison_id; // TODO obsolete
var $fk_delivery_address; var $fk_delivery_address;
var $adresse; var $adresse;
var $date; // Date commande var $date; // Date commande
@ -149,7 +148,6 @@ class Commande extends CommonObject
$this->mode_reglement_id = $propal->mode_reglement_id; $this->mode_reglement_id = $propal->mode_reglement_id;
$this->date_livraison = $propal->date_livraison; $this->date_livraison = $propal->date_livraison;
$this->fk_delivery_address = $propal->fk_delivery_address; $this->fk_delivery_address = $propal->fk_delivery_address;
$this->adresse_livraison_id = $propal->adresse_livraison_id; // TODO obsolete
$this->contact_id = $propal->contactid; $this->contact_id = $propal->contactid;
$this->ref_client = $propal->ref_client; $this->ref_client = $propal->ref_client;
$this->note = $propal->note; $this->note = $propal->note;
@ -1004,8 +1002,8 @@ class Commande extends CommonObject
$sql = 'SELECT c.rowid, c.date_creation, c.ref, c.fk_soc, c.fk_user_author, c.fk_statut'; $sql = 'SELECT c.rowid, c.date_creation, c.ref, c.fk_soc, c.fk_user_author, c.fk_statut';
$sql.= ', c.amount_ht, c.total_ht, c.total_ttc, c.tva as total_tva, c.fk_cond_reglement, c.fk_mode_reglement'; $sql.= ', c.amount_ht, c.total_ht, c.total_ttc, c.tva as total_tva, c.fk_cond_reglement, c.fk_mode_reglement';
$sql.= ', '.$this->db->pdate('c.date_commande').' as date_commande'; $sql.= ', c.date_commande';
$sql.= ', '.$this->db->pdate('c.date_livraison').' as date_livraison'; $sql.= ', c.date_livraison';
$sql.= ', c.fk_projet, c.remise_percent, c.remise, c.remise_absolue, c.source, c.facture as facturee'; $sql.= ', c.fk_projet, c.remise_percent, c.remise, c.remise_absolue, c.source, c.facture as facturee';
$sql.= ', c.note, c.note_public, c.ref_client, c.model_pdf, c.fk_adresse_livraison'; $sql.= ', c.note, c.note_public, c.ref_client, c.model_pdf, c.fk_adresse_livraison';
$sql.= ', p.code as mode_reglement_code, p.libelle as mode_reglement_libelle'; $sql.= ', p.code as mode_reglement_code, p.libelle as mode_reglement_libelle';
@ -1035,8 +1033,8 @@ class Commande extends CommonObject
$this->total_ht = $obj->total_ht; $this->total_ht = $obj->total_ht;
$this->total_tva = $obj->total_tva; $this->total_tva = $obj->total_tva;
$this->total_ttc = $obj->total_ttc; $this->total_ttc = $obj->total_ttc;
$this->date = $obj->date_commande; $this->date = $this->db->jdate($obj->date_commande);
$this->date_commande = $obj->date_commande; $this->date_commande = $this->db->jdate($obj->date_commande);
$this->remise = $obj->remise; $this->remise = $obj->remise;
$this->remise_percent = $obj->remise_percent; $this->remise_percent = $obj->remise_percent;
$this->remise_absolue = $obj->remise_absolue; $this->remise_absolue = $obj->remise_absolue;
@ -1053,8 +1051,7 @@ class Commande extends CommonObject
$this->cond_reglement_code = $obj->cond_reglement_code; $this->cond_reglement_code = $obj->cond_reglement_code;
$this->cond_reglement = $obj->cond_reglement_libelle; $this->cond_reglement = $obj->cond_reglement_libelle;
$this->cond_reglement_doc = $obj->cond_reglement_libelle_doc; $this->cond_reglement_doc = $obj->cond_reglement_libelle_doc;
$this->date_livraison = $obj->date_livraison; $this->date_livraison = $db->jdate($obj->date_livraison);
$this->adresse_livraison_id = $obj->fk_adresse_livraison; // TODO deprecated
$this->fk_delivery_address = $obj->fk_adresse_livraison; $this->fk_delivery_address = $obj->fk_adresse_livraison;
$this->propale_id = $obj->fk_source; $this->propale_id = $obj->fk_source;
$this->lignes = array(); $this->lignes = array();
@ -1618,7 +1615,6 @@ class Commande extends CommonObject
if ($this->db->query($sql) ) if ($this->db->query($sql) )
{ {
$this->adresse_livraison_id = $fk_delivery_address; // TODO obsolete
$this->fk_delivery_address = $fk_delivery_address; $this->fk_delivery_address = $fk_delivery_address;
return 1; return 1;
} }

View File

@ -197,7 +197,6 @@ if ($_POST['action'] == 'add' && $user->rights->commande->creer)
$commande->mode_reglement_id = $_POST['mode_reglement_id']; $commande->mode_reglement_id = $_POST['mode_reglement_id'];
$commande->date_livraison = $datelivraison; $commande->date_livraison = $datelivraison;
$commande->fk_delivery_address = $_POST['fk_delivery_address']; $commande->fk_delivery_address = $_POST['fk_delivery_address'];
$commande->adresse_livraison_id = $_POST['fk_delivery_address']; // TODO obsolete
$commande->contactid = $_POST['contactidp']; $commande->contactid = $_POST['contactidp'];
$NBLINES=8; $NBLINES=8;

View File

@ -93,8 +93,7 @@ else
$height = 200; $height = 200;
// Calcul de $min et $max // Calcul de $min et $max
$sql = "SELECT MIN(".$db->pdate("b.datev").")"; $sql = "SELECT MIN(b.datev) as min, MAX(b.datev) as max";
$sql.= ", MAX(".$db->pdate("b.datev").")";
$sql.= " FROM ".MAIN_DB_PREFIX."bank as b"; $sql.= " FROM ".MAIN_DB_PREFIX."bank as b";
$sql.= ", ".MAIN_DB_PREFIX."bank_account as ba"; $sql.= ", ".MAIN_DB_PREFIX."bank_account as ba";
$sql.= " WHERE b.fk_account = ba.rowid"; $sql.= " WHERE b.fk_account = ba.rowid";
@ -105,9 +104,9 @@ else
if ($resql) if ($resql)
{ {
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
$row = $db->fetch_row($resql); $obj = $db->fetch_object($resql);
$min = $row[0]; $min = $db->jdate($obj->min);
$max = $row[1]; $max = $db->jdate($obj->max);
} }
else else
{ {

View File

@ -128,7 +128,7 @@ $paymentvatstatic=new TVA($db);
$acct = new Account($db); $acct = new Account($db);
$acct->fetch($_GET["account"]); $acct->fetch($_GET["account"]);
$sql = "SELECT b.rowid,".$db->pdate("b.dateo")." as do, ".$db->pdate("b.datev")." as dv, b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type as type"; $sql = "SELECT b.rowid, b.dateo as do, b.datev as dv, b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type as type";
$sql.= " FROM ".MAIN_DB_PREFIX."bank as b"; $sql.= " FROM ".MAIN_DB_PREFIX."bank as b";
$sql.= " WHERE rappro=0 AND fk_account=".$_GET["account"]; $sql.= " WHERE rappro=0 AND fk_account=".$_GET["account"];
$sql.= " ORDER BY dateo ASC"; $sql.= " ORDER BY dateo ASC";
@ -203,13 +203,13 @@ if ($resql)
print "<input type=\"hidden\" name=\"rowid\" value=\"".$objp->rowid."\">"; print "<input type=\"hidden\" name=\"rowid\" value=\"".$objp->rowid."\">";
// Date op // Date op
print '<td align="center" nowrap="nowrap">'.dol_print_date($objp->do,"day").'</td>'; print '<td align="center" nowrap="nowrap">'.dol_print_date($db->jdate($objp->do),"day").'</td>';
// Date value // Date value
if (! $objp->rappro && ($user->rights->banque->modifier || $user->rights->banque->consolidate)) if (! $objp->rappro && ($user->rights->banque->modifier || $user->rights->banque->consolidate))
{ {
print '<td align="center" nowrap="nowrap">'; print '<td align="center" nowrap="nowrap">';
print dol_print_date($objp->dv,"day"); print dol_print_date($db->jdate($objp->dv),"day");
print ' &nbsp; '; print ' &nbsp; ';
print '<a href="'.$_SERVER['PHP_SELF'].'?action=dvprev&amp;account='.$_GET["account"].'&amp;rowid='.$objp->rowid.'">'; print '<a href="'.$_SERVER['PHP_SELF'].'?action=dvprev&amp;account='.$_GET["account"].'&amp;rowid='.$objp->rowid.'">';
print img_edit_remove() . "</a> "; print img_edit_remove() . "</a> ";
@ -220,7 +220,7 @@ if ($resql)
else else
{ {
print '<td align="center">'; print '<td align="center">';
print dol_print_date($objp->dv,"day"); print dol_print_date($db->jdate($objp->dv),"day");
print '</td>'; print '</td>';
} }
@ -341,7 +341,7 @@ if ($resql)
print img_edit(); print img_edit();
print '</a>&nbsp; '; print '</a>&nbsp; ';
if ($objp->do <= mktime()) { if ($db->jdate($objp->do) <= mktime()) {
print '<a href="'.DOL_URL_ROOT.'/compta/bank/rappro.php?action=del&amp;rowid='.$objp->rowid.'&amp;account='.$acct->id.'">'; print '<a href="'.DOL_URL_ROOT.'/compta/bank/rappro.php?action=del&amp;rowid='.$objp->rowid.'&amp;account='.$acct->id.'">';
print img_delete(); print img_delete();
print '</a>'; print '</a>';
@ -358,8 +358,8 @@ if ($resql)
} }
// Affiche zone saisie relev<EFBFBD> + bouton "Rapprocher" // Affiche zone saisie releve + bouton "Rapprocher"
if ($objp->do <= gmmktime()) if ($db->jdate($objp->do) <= gmmktime())
{ {
print '<td align="center" nowrap="nowrap">'; print '<td align="center" nowrap="nowrap">';
print '<input class="flat" name="num_releve" type="text" value="'.$objp->num_releve.'" size="8">'; print '<input class="flat" name="num_releve" type="text" value="'.$objp->num_releve.'" size="8">';

View File

@ -282,11 +282,11 @@ if ($id > 0 || ! empty($ref))
if ($_GET['action'] == 'editdelivery_adress') if ($_GET['action'] == 'editdelivery_adress')
{ {
$html->form_adresse_livraison($_SERVER['PHP_SELF'].'?id='.$commande->id,$commande->adresse_livraison_id,$_GET['socid'],'adresse_livraison_id','commande',$commande->id); $html->form_adresse_livraison($_SERVER['PHP_SELF'].'?id='.$commande->id,$commande->fk_delivery_address,$_GET['socid'],'adresse_livraison_id','commande',$commande->id);
} }
else else
{ {
$html->form_adresse_livraison($_SERVER['PHP_SELF'].'?id='.$commande->id,$commande->adresse_livraison_id,$_GET['socid'],'none','commande',$commande->id); $html->form_adresse_livraison($_SERVER['PHP_SELF'].'?id='.$commande->id,$commande->fk_delivery_address,$_GET['socid'],'none','commande',$commande->id);
} }
print '</td></tr>'; print '</td></tr>';
} }

View File

@ -2373,7 +2373,7 @@ else
if ($invoice->type != 3) continue; // only deposits if ($invoice->type != 3) continue; // only deposits
// For each deposits, get payments // For each deposits, get payments
$sql = 'SELECT '.$db->pdate('datep').' as dp, pf.amount,'; $sql = 'SELECT datep as dp, pf.amount,';
$sql.= ' c.libelle as paiement_type, p.num_paiement, p.rowid'; $sql.= ' c.libelle as paiement_type, p.num_paiement, p.rowid';
$sql.= ' FROM '.MAIN_DB_PREFIX.'paiement as p, '.MAIN_DB_PREFIX.'c_paiement as c, '.MAIN_DB_PREFIX.'paiement_facture as pf'; $sql.= ' FROM '.MAIN_DB_PREFIX.'paiement as p, '.MAIN_DB_PREFIX.'c_paiement as c, '.MAIN_DB_PREFIX.'paiement_facture as pf';
$sql.= ' WHERE pf.fk_facture = '.$invoice->id.' AND p.fk_paiement = c.id AND pf.fk_paiement = p.rowid'; $sql.= ' WHERE pf.fk_facture = '.$invoice->id.' AND p.fk_paiement = c.id AND pf.fk_paiement = p.rowid';
@ -2391,7 +2391,7 @@ else
print '<tr '.$bc[$var].'><td>'; print '<tr '.$bc[$var].'><td>';
print '<a href="'.DOL_URL_ROOT.'/compta/paiement/fiche.php?id='.$objpayment->rowid.'">'.img_object($langs->trans('ShowPayment'),'payment').' '; print '<a href="'.DOL_URL_ROOT.'/compta/paiement/fiche.php?id='.$objpayment->rowid.'">'.img_object($langs->trans('ShowPayment'),'payment').' ';
print dol_print_date($objpayment->dp,'day').'</a>'; print dol_print_date($db->jdate($objpayment->dp),'day').'</a>';
print ' ('.$langs->trans("Deposit").' '; print ' ('.$langs->trans("Deposit").' ';
print $invoice->getNomUrl(0).')'; print $invoice->getNomUrl(0).')';
@ -2419,7 +2419,7 @@ else
*/ */
// Payments already done (from payment on this invoice) // Payments already done (from payment on this invoice)
$sql = 'SELECT '.$db->pdate('datep').' as dp, pf.amount,'; $sql = 'SELECT datep as dp, pf.amount,';
$sql.= ' c.libelle as paiement_type, p.num_paiement, p.rowid'; $sql.= ' c.libelle as paiement_type, p.num_paiement, p.rowid';
$sql.= ' FROM '.MAIN_DB_PREFIX.'paiement as p, '.MAIN_DB_PREFIX.'c_paiement as c, '.MAIN_DB_PREFIX.'paiement_facture as pf'; $sql.= ' FROM '.MAIN_DB_PREFIX.'paiement as p, '.MAIN_DB_PREFIX.'c_paiement as c, '.MAIN_DB_PREFIX.'paiement_facture as pf';
$sql.= ' WHERE pf.fk_facture = '.$fac->id.' AND p.fk_paiement = c.id AND pf.fk_paiement = p.rowid'; $sql.= ' WHERE pf.fk_facture = '.$fac->id.' AND p.fk_paiement = c.id AND pf.fk_paiement = p.rowid';
@ -2439,7 +2439,7 @@ else
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'><td>'; print '<tr '.$bc[$var].'><td>';
print '<a href="'.DOL_URL_ROOT.'/compta/paiement/fiche.php?id='.$objp->rowid.'">'.img_object($langs->trans('ShowPayment'),'payment').' '; print '<a href="'.DOL_URL_ROOT.'/compta/paiement/fiche.php?id='.$objp->rowid.'">'.img_object($langs->trans('ShowPayment'),'payment').' ';
print dol_print_date($objp->dp,'day').'</a></td>'; print dol_print_date($db->jdate($objp->dp),'day').'</a></td>';
print '<td>'.$objp->paiement_type.' '.$objp->num_paiement.'</td>'; print '<td>'.$objp->paiement_type.' '.$objp->num_paiement.'</td>';
print '<td align="right">'.price($objp->amount).'</td>'; print '<td align="right">'.price($objp->amount).'</td>';
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
@ -2728,8 +2728,8 @@ else
$sql.= ' l.fk_remise_except,'; $sql.= ' l.fk_remise_except,';
$sql.= ' l.remise_percent, l.subprice, l.info_bits,'; $sql.= ' l.remise_percent, l.subprice, l.info_bits,';
$sql.= ' l.total_ht, l.total_tva, l.total_ttc,'; $sql.= ' l.total_ht, l.total_tva, l.total_ttc,';
$sql.= ' '.$db->pdate('l.date_start').' as date_start,'; $sql.= ' l.date_start,';
$sql.= ' '.$db->pdate('l.date_end').' as date_end,'; $sql.= ' l.date_end,';
$sql.= ' l.product_type,'; $sql.= ' l.product_type,';
$sql.= ' p.ref as product_ref, p.fk_product_type, p.label as product_label,'; $sql.= ' p.ref as product_ref, p.fk_product_type, p.label as product_label,';
$sql.= ' p.description as product_desc'; $sql.= ' p.description as product_desc';
@ -2793,7 +2793,7 @@ else
print $html->textwithtooltip($text,$description,3,'','',$i); print $html->textwithtooltip($text,$description,3,'','',$i);
// Show range // 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 // Add description in form
if ($conf->global->PRODUIT_DESC_IN_FORM) print ($objp->description && $objp->description!=$objp->product_label)?'<br>'.dol_htmlentitiesbr($objp->description):''; if ($conf->global->PRODUIT_DESC_IN_FORM) print ($objp->description && $objp->description!=$objp->product_label)?'<br>'.dol_htmlentitiesbr($objp->description):'';
@ -2837,7 +2837,7 @@ else
print $text.' '.nl2br($objp->description); print $text.' '.nl2br($objp->description);
// Show range // 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 "</td>\n"; print "</td>\n";
} }
@ -2992,9 +2992,9 @@ else
{ {
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
print '<td colspan="9">'.$langs->trans('ServiceLimitedDuration').' '.$langs->trans('From').' '; print '<td colspan="9">'.$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 ' '.$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 '</td>'; print '</td>';
print '</tr>'; print '</tr>';
} }

View File

@ -304,7 +304,7 @@ if ($socid > 0)
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
$sql = 'SELECT f.rowid as facid, f.facnumber, f.type, f.amount, f.total, f.total_ttc,'; $sql = 'SELECT f.rowid as facid, f.facnumber, f.type, f.amount, f.total, f.total_ttc,';
$sql.= ' '.$db->pdate("f.datef").' as df, '.$db->pdate("f.datec").' as dc, f.paye as paye, f.fk_statut as statut,'; $sql.= ' f.datef as df, f.datec as dc, f.paye as paye, f.fk_statut as statut,';
$sql.= ' s.nom, s.rowid as socid,'; $sql.= ' s.nom, s.rowid as socid,';
$sql.= ' sum(pf.amount) as am'; $sql.= ' sum(pf.amount) as am';
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
@ -340,7 +340,7 @@ if ($socid > 0)
print '</td>'; print '</td>';
if ($objp->df > 0) if ($objp->df > 0)
{ {
print "<td align=\"right\">".dol_print_date($objp->df)."</td>\n"; print "<td align=\"right\">".dol_print_date($db->jdate($objp->df))."</td>\n";
} }
else else
{ {

View File

@ -86,7 +86,7 @@ if ($socid > 0)
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
$sql = "SELECT s.nom, s.rowid as socid, f.facnumber, f.amount, ".$db->pdate("f.datef")." as df,"; $sql = "SELECT s.nom, s.rowid as socid, f.facnumber, f.amount, f.datef as df,";
$sql.= " f.paye as paye, f.fk_statut as statut, f.rowid as facid,"; $sql.= " f.paye as paye, f.fk_statut as statut, f.rowid as facid,";
$sql.= " u.login, u.rowid as userid"; $sql.= " u.login, u.rowid as userid";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f,".MAIN_DB_PREFIX."user as u"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f,".MAIN_DB_PREFIX."user as u";
@ -150,7 +150,7 @@ if ($socid > 0)
print "</tr>\n"; print "</tr>\n";
// Paiements // Paiements
$sql = "SELECT p.rowid,".$db->pdate("p.datep")." as dp, pf.amount, p.statut,"; $sql = "SELECT p.rowid, p.datep as dp, pf.amount, p.statut,";
$sql.= " p.fk_user_creat, u.login, u.rowid as userid"; $sql.= " p.fk_user_creat, u.login, u.rowid as userid";
$sql.= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf,"; $sql.= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf,";
$sql.= " ".MAIN_DB_PREFIX."paiement as p"; $sql.= " ".MAIN_DB_PREFIX."paiement as p";
@ -169,9 +169,9 @@ if ($socid > 0)
$objp = $db->fetch_object($resqlp); $objp = $db->fetch_object($resqlp);
//$var=!$var; //$var=!$var;
print "<tr $bc[$var]>"; print "<tr $bc[$var]>";
print '<td align="center">'.dol_print_date($objp->dp)."</td>\n"; print '<td align="center">'.dol_print_date($db->jdate($objp->dp))."</td>\n";
print '<td>'; print '<td>';
print '&nbsp; &nbsp; &nbsp; '; // D<EFBFBD>calage print '&nbsp; &nbsp; &nbsp; '; // Decalage
print '<a href="paiement/fiche.php?id='.$objp->rowid.'">'.img_object($langs->trans("ShowPayment"),"payment").' '.$langs->trans("Payment").' '.$objp->rowid.'</td>'; print '<a href="paiement/fiche.php?id='.$objp->rowid.'">'.img_object($langs->trans("ShowPayment"),"payment").' '.$langs->trans("Payment").' '.$objp->rowid.'</td>';
print "<td>&nbsp;</td>\n"; print "<td>&nbsp;</td>\n";
print "<td>&nbsp;</td>\n"; print "<td>&nbsp;</td>\n";

View File

@ -76,10 +76,10 @@ $sql.= " s.rowid as socid, s.nom,";
$sql.= " cd.rowid, cd.description, cd.statut,"; $sql.= " cd.rowid, cd.description, cd.statut,";
$sql.= " p.rowid as pid, p.label as label, p.fk_product_type as ptype,"; $sql.= " p.rowid as pid, p.label as label, p.fk_product_type as ptype,";
if (!$user->rights->societe->client->voir && !$socid) $sql .= " sc.fk_soc, sc.fk_user,"; if (!$user->rights->societe->client->voir && !$socid) $sql .= " sc.fk_soc, sc.fk_user,";
$sql.= " ".$db->pdate("cd.date_ouverture_prevue")." as date_ouverture_prevue,"; $sql.= " cd.date_ouverture_prevue,";
$sql.= " ".$db->pdate("cd.date_ouverture")." as date_ouverture,"; $sql.= " cd.date_ouverture,";
$sql.= " ".$db->pdate("cd.date_fin_validite")." as date_fin_validite,"; $sql.= " cd.date_fin_validite,";
$sql.= " ".$db->pdate("cd.date_cloture")." as date_cloture"; $sql.= " cd.date_cloture";
$sql.= " FROM ".MAIN_DB_PREFIX."contrat as c,"; $sql.= " FROM ".MAIN_DB_PREFIX."contrat as c,";
$sql.= " ".MAIN_DB_PREFIX."societe as s,"; $sql.= " ".MAIN_DB_PREFIX."societe as s,";
if (!$user->rights->societe->client->voir && !$socid) $sql .= " ".MAIN_DB_PREFIX."societe_commerciaux as sc,"; if (!$user->rights->societe->client->voir && !$socid) $sql .= " ".MAIN_DB_PREFIX."societe_commerciaux as sc,";
@ -214,29 +214,29 @@ if ($resql)
// Start date // Start date
if ($mode == "0") { if ($mode == "0") {
print '<td align="center">'; print '<td align="center">';
print ($obj->date_ouverture_prevue?dol_print_date($obj->date_ouverture_prevue):'&nbsp;'); print ($obj->date_ouverture_prevue?dol_print_date($db->jdate($obj->date_ouverture_prevue)):'&nbsp;');
if ($obj->date_ouverture_prevue && ($obj->date_ouverture_prevue < ($now - $conf->contrat->services->inactifs->warning_delay))) if ($db->jdate($obj->date_ouverture_prevue) && ($db->jdate($obj->date_ouverture_prevue) < ($now - $conf->contrat->services->inactifs->warning_delay)))
print img_picto($langs->trans("Late"),"warning"); print img_picto($langs->trans("Late"),"warning");
else print '&nbsp;&nbsp;&nbsp;&nbsp;'; else print '&nbsp;&nbsp;&nbsp;&nbsp;';
print '</td>'; print '</td>';
} }
if ($mode == "" || $mode > 0) print '<td align="center">'.($obj->date_ouverture?dol_print_date($obj->date_ouverture):'&nbsp;').'</td>'; if ($mode == "" || $mode > 0) print '<td align="center">'.($obj->date_ouverture?dol_print_date($db->jdate($obj->date_ouverture)):'&nbsp;').'</td>';
// Date fin // Date fin
if ($mode == "" || $mode < 5) print '<td align="center">'.($obj->date_fin_validite?dol_print_date($obj->date_fin_validite):'&nbsp;'); if ($mode == "" || $mode < 5) print '<td align="center">'.($obj->date_fin_validite?dol_print_date($db->jdate($obj->date_fin_validite)):'&nbsp;');
else print '<td align="center">'.dol_print_date($obj->date_cloture); else print '<td align="center">'.dol_print_date($db->jdate($obj->date_cloture));
// Icone warning // Icone warning
if ($obj->date_fin_validite && $obj->date_fin_validite < ($now - $conf->contrat->services->expires->warning_delay) && $obj->statut < 5) print img_warning($langs->trans("Late")); if ($obj->date_fin_validite && $db->jdate($obj->date_fin_validite) < ($now - $conf->contrat->services->expires->warning_delay) && $obj->statut < 5) print img_warning($langs->trans("Late"));
else print '&nbsp;&nbsp;&nbsp;&nbsp;'; else print '&nbsp;&nbsp;&nbsp;&nbsp;';
print '</td>'; print '</td>';
print '<td align="right" nowrap="nowrap">'; print '<td align="right" nowrap="nowrap">';
if ($obj->cstatut == 0) // If contract is draft, we say line is also draft if ($obj->cstatut == 0) // If contract is draft, we say line is also draft
{ {
print $contractstatic->LibStatut(0,5,($obj->date_fin_validite && $obj->date_fin_validite < $now)); print $contractstatic->LibStatut(0,5,($obj->date_fin_validite && $db->jdate($obj->date_fin_validite) < $now));
} }
else else
{ {
print '<a href="'.DOL_URL_ROOT.'/contrat/fiche.php?id='.$obj->cid.'&line='.$obj->rowid.'">'; print '<a href="'.DOL_URL_ROOT.'/contrat/fiche.php?id='.$obj->cid.'&line='.$obj->rowid.'">';
print $staticcontratligne->LibStatut($obj->statut,5,($obj->date_fin_validite && $obj->date_fin_validite < $now)?1:0); print $staticcontratligne->LibStatut($obj->statut,5,($obj->date_fin_validite && $db->jdate($obj->date_fin_validite) < $now)?1:0);
print '</a>'; print '</a>';
} }
print '</td>'; print '</td>';

View File

@ -261,7 +261,6 @@ class Expedition extends CommonObject
$this->date = $this->db->jdate($obj->date_expedition); // TODO obsolete $this->date = $this->db->jdate($obj->date_expedition); // TODO obsolete
$this->date_shipping = $this->db->jdate($obj->date_expedition); $this->date_shipping = $this->db->jdate($obj->date_expedition);
$this->date_delivery = $this->db->jdate($obj->date_delivery); $this->date_delivery = $this->db->jdate($obj->date_delivery);
$this->adresse_livraison_id = $obj->fk_adresse_livraison; // TODO obsolete
$this->fk_delivery_address = $obj->fk_adresse_livraison; $this->fk_delivery_address = $obj->fk_adresse_livraison;
$this->modelpdf = $obj->model_pdf; $this->modelpdf = $obj->model_pdf;
$this->expedition_method_id = $obj->fk_expedition_methode; $this->expedition_method_id = $obj->fk_expedition_methode;
@ -780,7 +779,6 @@ class Expedition extends CommonObject
} }
$this->date = time(); $this->date = time();
$this->entrepot_id = 0; $this->entrepot_id = 0;
$this->adresse_livraison_id = 0; // TODO obsolete
$this->fk_delivery_address = 0; $this->fk_delivery_address = 0;
$this->socid = $socids[$socid]; $this->socid = $socids[$socid];

View File

@ -65,7 +65,7 @@ if ($_GET["id"] > 0) {
/* /*
* Fiche intervention * Fiche intervention
*/ */
$sql = 'SELECT s.nom, s.rowid, fi.fk_projet, fi.ref, fi.description, fi.fk_statut, '.$db->pdate('fi.datei').' as di,'; $sql = 'SELECT s.nom, s.rowid, fi.fk_projet, fi.ref, fi.description, fi.fk_statut, fi.datei as di,';
$sql.= ' fi.fk_user_author, fi.fk_user_valid, fi.datec, fi.date_valid'; $sql.= ' fi.fk_user_author, fi.fk_user_valid, fi.datec, fi.date_valid';
$sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s, '.MAIN_DB_PREFIX.'fichinter as fi'; $sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s, '.MAIN_DB_PREFIX.'fichinter as fi';
$sql.= ' WHERE fi.fk_soc = s.rowid'; $sql.= ' WHERE fi.fk_soc = s.rowid';

View File

@ -78,7 +78,7 @@ if ($user->rights->fournisseur->facture->lire)
$sql = "SELECT s.nom, s.rowid as socid,"; $sql = "SELECT s.nom, s.rowid as socid,";
$sql.= " f.rowid as ref, f.facnumber, f.total_ht, f.total_ttc,"; $sql.= " f.rowid as ref, f.facnumber, f.total_ht, f.total_ttc,";
$sql.= $db->pdate("f.datef")." as df, ".$db->pdate("f.date_lim_reglement")." as datelimite, "; $sql.= " f.datef as df, f.date_lim_reglement as datelimite, ";
$sql.= " f.paye as paye, f.rowid as facid, f.fk_statut"; $sql.= " f.paye as paye, f.rowid as facid, f.fk_statut";
$sql.= " ,sum(pf.amount) as am"; $sql.= " ,sum(pf.amount) as am";
if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user "; if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user ";
@ -213,9 +213,9 @@ if ($user->rights->fournisseur->facture->lire)
print "<td nowrap>".dol_trunc($objp->facnumber,12)."</td>\n"; print "<td nowrap>".dol_trunc($objp->facnumber,12)."</td>\n";
print "<td nowrap align=\"center\">".dol_print_date($objp->df)."</td>\n"; print "<td nowrap align=\"center\">".dol_print_date($db->jdate($objp->df))."</td>\n";
print "<td nowrap align=\"center\">".dol_print_date($objp->datelimite); print "<td nowrap align=\"center\">".dol_print_date($db->jdate($objp->datelimite));
if ($objp->datelimite < ($now - $conf->facture->fournisseur->warning_delay) && ! $objp->paye && $objp->fk_statut == 1) print img_warning($langs->trans("Late")); if ($db->jdate($objp->datelimite) < ($now - $conf->facture->fournisseur->warning_delay) && ! $objp->paye && $objp->fk_statut == 1) print img_warning($langs->trans("Late"));
print "</td>\n"; print "</td>\n";
print '<td>'; print '<td>';

View File

@ -96,7 +96,7 @@ $html=new Form($db);
llxHeader($langs->trans("SuppliersInovices"),'','EN:Suppliers_Invoices|FR:FactureFournisseur|ES:Facturas_de_proveedores'); llxHeader($langs->trans("SuppliersInovices"),'','EN:Suppliers_Invoices|FR:FactureFournisseur|ES:Facturas_de_proveedores');
$sql = "SELECT s.rowid as socid, s.nom, "; $sql = "SELECT s.rowid as socid, s.nom, ";
$sql.= " fac.rowid as ref, fac.rowid as facid, fac.facnumber, ".$db->pdate("fac.datef")." as datef, ".$db->pdate("fac.date_lim_reglement")." as date_echeance,"; $sql.= " fac.rowid as ref, fac.rowid as facid, fac.facnumber, fac.datef, fac.date_lim_reglement as date_echeance,";
$sql.= " fac.total_ht, fac.total_ttc, fac.paye as paye, fac.fk_statut as fk_statut, fac.libelle"; $sql.= " fac.total_ht, fac.total_ttc, fac.paye as paye, fac.fk_statut as fk_statut, fac.libelle";
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user "; 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."facture_fourn as fac"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as fac";
@ -242,9 +242,9 @@ if ($resql)
print $facturestatic->getNomUrl(1); print $facturestatic->getNomUrl(1);
print "</td>\n"; print "</td>\n";
print '<td nowrap>'.dol_trunc($obj->facnumber,10)."</td>"; print '<td nowrap>'.dol_trunc($obj->facnumber,10)."</td>";
print '<td align="center" nowrap="1">'.dol_print_date($obj->datef,'day').'</td>'; print '<td align="center" nowrap="1">'.dol_print_date($db->jdate($obj->datef),'day').'</td>';
print '<td align="center" nowrap="1">'.dol_print_date($obj->date_echeance,'day'); print '<td align="center" nowrap="1">'.dol_print_date($db->jdate($obj->date_echeance),'day');
if (($obj->paye == 0) && ($obj->fk_statut > 0) && $obj->date_echeance < ($now - $conf->facture->fournisseur->warning_delay)) print img_picto($langs->trans("Late"),"warning"); if (($obj->paye == 0) && ($obj->fk_statut > 0) && $db->jdate($obj->date_echeance) < ($now - $conf->facture->fournisseur->warning_delay)) print img_picto($langs->trans("Late"),"warning");
print '</td>'; print '</td>';
print '<td>'.dol_trunc($obj->libelle,36).'</td>'; print '<td>'.dol_trunc($obj->libelle,36).'</td>';
print '<td>'; print '<td>';

View File

@ -266,7 +266,7 @@ if ($action == 'create' || $action == 'add_paiement')
/* /*
* Autres factures impayees * Autres factures impayees
*/ */
$sql = 'SELECT f.rowid as facid,f.rowid as ref,f.facnumber,f.total_ttc,'.$db->pdate('f.datef').' as df'; $sql = 'SELECT f.rowid as facid,f.rowid as ref,f.facnumber,f.total_ttc, f.datef as df';
$sql .= ', sum(pf.amount) as am'; $sql .= ', sum(pf.amount) as am';
$sql .= ' FROM '.MAIN_DB_PREFIX.'facture_fourn as f'; $sql .= ' FROM '.MAIN_DB_PREFIX.'facture_fourn as f';
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON pf.fk_facturefourn = f.rowid'; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON pf.fk_facturefourn = f.rowid';
@ -309,7 +309,7 @@ if ($action == 'create' || $action == 'add_paiement')
if ($objp->df > 0 ) if ($objp->df > 0 )
{ {
print '<td align="center">'; print '<td align="center">';
print dol_print_date($objp->df).'</td>'; print dol_print_date($db->jdate($objp->df)).'</td>';
} }
else else
{ {

View File

@ -266,7 +266,6 @@ class Livraison extends CommonObject
$this->statut = $obj->fk_statut; $this->statut = $obj->fk_statut;
$this->user_author_id = $obj->fk_user_author; $this->user_author_id = $obj->fk_user_author;
$this->user_valid_id = $obj->fk_user_valid; $this->user_valid_id = $obj->fk_user_valid;
$this->adresse_livraison_id = $obj->fk_adresse_livraison; // TODO obsolete
$this->fk_delivery_address = $obj->fk_adresse_livraison; $this->fk_delivery_address = $obj->fk_adresse_livraison;
$this->note = $obj->note; $this->note = $obj->note;
$this->note_public = $obj->note_public; $this->note_public = $obj->note_public;
@ -513,8 +512,7 @@ class Livraison extends CommonObject
$this->note = $expedition->note; $this->note = $expedition->note;
$this->fk_project = $expedition->fk_project; $this->fk_project = $expedition->fk_project;
$this->date_delivery = $expedition->date_delivery; $this->date_delivery = $expedition->date_delivery;
$this->adresse_livraison_id = $expedition->adresse_livraison_id; // TODO obsolete $this->fk_delivery_address = $expedition->fk_delivery_address;
$this->fk_delivery_address = $expedition->adresse_livraison_id;
$this->socid = $expedition->socid; $this->socid = $expedition->socid;
$this->ref_customer = $expedition->ref_customer; $this->ref_customer = $expedition->ref_customer;