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->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->adresse_livraison_id = $_POST['adresse_livraison_id']; // TODO obsolete
$propal->duree_validite = $_POST['duree_validite'];
$propal->cond_reglement_id = $_POST['cond_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->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->adresse_livraison_id = $_POST['fk_delivery_address']; // TODO obsolete
$propal->duree_validite = $_POST['duree_validite'];
$propal->cond_reglement_id = $_POST['cond_reglement_id'];
$propal->mode_reglement_id = $_POST['mode_reglement_id'];

View File

@ -85,7 +85,6 @@ class Propal extends CommonObject
var $remise_absolue;
var $note;
var $note_public;
var $adresse_livraison_id;
var $fk_delivery_address;
var $adresse;
@ -868,7 +867,6 @@ class Propal extends CommonObject
$this->fin_validite = $this->db->jdate($obj->dfv);
$this->date_livraison = $this->db->jdate($obj->date_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_code = $obj->mode_reglement_code;
@ -1377,7 +1375,7 @@ class Propal extends CommonObject
function liste_array($shortlist=0, $draft=0, $notcurrentuser=0, $socid=0, $limit=0, $offset=0, $sortfield='p.datep', $sortorder='DESC')
{
global $conf,$user;
$ga = array();
$sql = "SELECT s.nom, s.rowid, p.rowid as propalid, p.fk_statut, p.total_ht, p.ref, p.remise, ";
@ -1413,7 +1411,7 @@ class Propal extends CommonObject
$ga[$i]['id'] = $obj->propalid;
$ga[$i]['ref'] = $obj->ref;
}
$i++;
}
}

View File

@ -78,7 +78,7 @@ if ($_GET["id"] > 0) {
/*
* 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.= ' FROM '.MAIN_DB_PREFIX.'societe as s';
$sql.= ', '.MAIN_DB_PREFIX.'commande as c';

View File

@ -61,7 +61,6 @@ class Commande extends CommonObject
var $cond_reglement_code;
var $mode_reglement_id;
var $mode_reglement_code;
var $adresse_livraison_id; // TODO obsolete
var $fk_delivery_address;
var $adresse;
var $date; // Date commande
@ -76,7 +75,7 @@ class Commande extends CommonObject
var $modelpdf;
var $info_bits;
var $source; // Origin of order
var $origin;
var $origin_id;
@ -149,7 +148,6 @@ class Commande extends CommonObject
$this->mode_reglement_id = $propal->mode_reglement_id;
$this->date_livraison = $propal->date_livraison;
$this->fk_delivery_address = $propal->fk_delivery_address;
$this->adresse_livraison_id = $propal->adresse_livraison_id; // TODO obsolete
$this->contact_id = $propal->contactid;
$this->ref_client = $propal->ref_client;
$this->note = $propal->note;
@ -159,7 +157,7 @@ class Commande extends CommonObject
$soc = new Societe($this->db);
$soc->id = $this->socid;
$soc->set_as_client();
$this->origin = $propal->element;
$this->origin_id = $propal->id;
@ -679,16 +677,16 @@ class Commande extends CommonObject
$ret = $this->add_object_linked();
if (! $ret) dol_print_error($this->db);
}
// TODO mutualiser
if ($this->origin == 'propal' && $this->origin_id)
{
// On recupere les differents contact interne et externe
$prop = New Propal($this->db, $this->socid, $this->origin_id);
// On recupere le commercial suivi propale
$this->userid = $prop->getIdcontact('internal', 'SALESREPFOLL');
if ($this->userid)
{
//On passe le commercial suivi propale en commercial suivi commande
@ -697,7 +695,7 @@ class Commande extends CommonObject
// On recupere le contact client suivi propale
$this->contactid = $prop->getIdcontact('external', 'CUSTOMER');
if ($this->contactid)
{
//On passe le contact client suivi propale en contact client suivi commande
@ -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.= ', 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.= ', '.$this->db->pdate('c.date_livraison').' as date_livraison';
$sql.= ', c.date_commande';
$sql.= ', c.date_livraison';
$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.= ', 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_tva = $obj->total_tva;
$this->total_ttc = $obj->total_ttc;
$this->date = $obj->date_commande;
$this->date_commande = $obj->date_commande;
$this->date = $this->db->jdate($obj->date_commande);
$this->date_commande = $this->db->jdate($obj->date_commande);
$this->remise = $obj->remise;
$this->remise_percent = $obj->remise_percent;
$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 = $obj->cond_reglement_libelle;
$this->cond_reglement_doc = $obj->cond_reglement_libelle_doc;
$this->date_livraison = $obj->date_livraison;
$this->adresse_livraison_id = $obj->fk_adresse_livraison; // TODO deprecated
$this->date_livraison = $db->jdate($obj->date_livraison);
$this->fk_delivery_address = $obj->fk_adresse_livraison;
$this->propale_id = $obj->fk_source;
$this->lignes = array();
@ -1618,7 +1615,6 @@ class Commande extends CommonObject
if ($this->db->query($sql) )
{
$this->adresse_livraison_id = $fk_delivery_address; // TODO obsolete
$this->fk_delivery_address = $fk_delivery_address;
return 1;
}
@ -1966,7 +1962,7 @@ class Commande extends CommonObject
dol_syslog("CustomerOrder::delete error", LOG_ERR);
$err++;
}
// Delete linked contacts
$res = $this->delete_linked_contact();
if ($res < 0)
@ -1984,7 +1980,7 @@ class Commande extends CommonObject
if (file_exists($file))
{
commande_delete_preview($this->db, $this->id, $this->ref);
if (!dol_delete_file($file))
{
$this->error=$langs->trans("ErrorCanNotDeleteFile",$file);

View File

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

View File

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

View File

@ -128,7 +128,7 @@ $paymentvatstatic=new TVA($db);
$acct = new Account($db);
$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.= " WHERE rappro=0 AND fk_account=".$_GET["account"];
$sql.= " ORDER BY dateo ASC";
@ -203,13 +203,13 @@ if ($resql)
print "<input type=\"hidden\" name=\"rowid\" value=\"".$objp->rowid."\">";
// 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
if (! $objp->rappro && ($user->rights->banque->modifier || $user->rights->banque->consolidate))
{
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 '<a href="'.$_SERVER['PHP_SELF'].'?action=dvprev&amp;account='.$_GET["account"].'&amp;rowid='.$objp->rowid.'">';
print img_edit_remove() . "</a> ";
@ -220,7 +220,7 @@ if ($resql)
else
{
print '<td align="center">';
print dol_print_date($objp->dv,"day");
print dol_print_date($db->jdate($objp->dv),"day");
print '</td>';
}
@ -341,7 +341,7 @@ if ($resql)
print img_edit();
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 img_delete();
print '</a>';
@ -358,8 +358,8 @@ if ($resql)
}
// Affiche zone saisie relev<EFBFBD> + bouton "Rapprocher"
if ($objp->do <= gmmktime())
// Affiche zone saisie releve + bouton "Rapprocher"
if ($db->jdate($objp->do) <= gmmktime())
{
print '<td align="center" nowrap="nowrap">';
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')
{
$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
{
$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>';
}

View File

@ -2373,7 +2373,7 @@ else
if ($invoice->type != 3) continue; // only deposits
// 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.= ' 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';
@ -2391,7 +2391,7 @@ else
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 dol_print_date($objpayment->dp,'day').'</a>';
print dol_print_date($db->jdate($objpayment->dp),'day').'</a>';
print ' ('.$langs->trans("Deposit").' ';
print $invoice->getNomUrl(0).')';
@ -2419,7 +2419,7 @@ else
*/
// 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.= ' 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';
@ -2439,7 +2439,7 @@ else
$var=!$var;
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 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 align="right">'.price($objp->amount).'</td>';
print '<td>&nbsp;</td>';
@ -2728,8 +2728,8 @@ else
$sql.= ' l.fk_remise_except,';
$sql.= ' 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.= ' l.product_type,';
$sql.= ' p.ref as product_ref, p.fk_product_type, p.label as product_label,';
$sql.= ' p.description as product_desc';
@ -2793,7 +2793,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) print ($objp->description && $objp->description!=$objp->product_label)?'<br>'.dol_htmlentitiesbr($objp->description):'';
@ -2837,7 +2837,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 "</td>\n";
}
@ -2992,9 +2992,9 @@ else
{
print '<tr '.$bc[$var].'>';
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 $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 '</tr>';
}

View File

@ -304,7 +304,7 @@ if ($socid > 0)
print '<table class="noborder" width="100%">';
$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.= ' sum(pf.amount) as am';
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
@ -340,7 +340,7 @@ if ($socid > 0)
print '</td>';
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
{

View File

@ -86,7 +86,7 @@ if ($socid > 0)
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.= " 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";
@ -150,7 +150,7 @@ if ($socid > 0)
print "</tr>\n";
// 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.= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf,";
$sql.= " ".MAIN_DB_PREFIX."paiement as p";
@ -169,9 +169,9 @@ if ($socid > 0)
$objp = $db->fetch_object($resqlp);
//$var=!$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 '&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 "<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.= " 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,";
$sql.= " ".$db->pdate("cd.date_ouverture_prevue")." as date_ouverture_prevue,";
$sql.= " ".$db->pdate("cd.date_ouverture")." as date_ouverture,";
$sql.= " ".$db->pdate("cd.date_fin_validite")." as date_fin_validite,";
$sql.= " ".$db->pdate("cd.date_cloture")." as date_cloture";
$sql.= " cd.date_ouverture_prevue,";
$sql.= " cd.date_ouverture,";
$sql.= " cd.date_fin_validite,";
$sql.= " cd.date_cloture";
$sql.= " FROM ".MAIN_DB_PREFIX."contrat as c,";
$sql.= " ".MAIN_DB_PREFIX."societe as s,";
if (!$user->rights->societe->client->voir && !$socid) $sql .= " ".MAIN_DB_PREFIX."societe_commerciaux as sc,";
@ -214,29 +214,29 @@ if ($resql)
// Start date
if ($mode == "0") {
print '<td align="center">';
print ($obj->date_ouverture_prevue?dol_print_date($obj->date_ouverture_prevue):'&nbsp;');
if ($obj->date_ouverture_prevue && ($obj->date_ouverture_prevue < ($now - $conf->contrat->services->inactifs->warning_delay)))
print ($obj->date_ouverture_prevue?dol_print_date($db->jdate($obj->date_ouverture_prevue)):'&nbsp;');
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");
else print '&nbsp;&nbsp;&nbsp;&nbsp;';
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
if ($mode == "" || $mode < 5) print '<td align="center">'.($obj->date_fin_validite?dol_print_date($obj->date_fin_validite):'&nbsp;');
else print '<td align="center">'.dol_print_date($obj->date_cloture);
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($db->jdate($obj->date_cloture));
// 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;';
print '</td>';
print '<td align="right" nowrap="nowrap">';
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
{
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 '</td>';

View File

@ -52,7 +52,7 @@ class Expedition extends CommonObject
var $origin_id;
var $lignes;
var $meths;
var $date_delivery;
var $date_creation;
var $date_valid;
@ -261,7 +261,6 @@ class Expedition extends CommonObject
$this->date = $this->db->jdate($obj->date_expedition); // TODO obsolete
$this->date_shipping = $this->db->jdate($obj->date_expedition);
$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->modelpdf = $obj->model_pdf;
$this->expedition_method_id = $obj->fk_expedition_methode;
@ -379,7 +378,7 @@ class Expedition extends CommonObject
$sql.= ", ".MAIN_DB_PREFIX."expeditiondet as ed";
$sql.= " WHERE ed.fk_expedition = ".$this->id;
$sql.= " AND cd.rowid = ed.fk_origin_line";
dol_syslog("Expedition::valid select details sql=".$sql);
$resql=$this->db->query($sql);
if ($resql)
@ -530,7 +529,7 @@ class Expedition extends CommonObject
if ($this->db->query($sql) )
{
$this->update_price();
return 1;
}
else
@ -780,7 +779,6 @@ class Expedition extends CommonObject
}
$this->date = time();
$this->entrepot_id = 0;
$this->adresse_livraison_id = 0; // TODO obsolete
$this->fk_delivery_address = 0;
$this->socid = $socids[$socid];

View File

@ -65,7 +65,7 @@ if ($_GET["id"] > 0) {
/*
* 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.= ' FROM '.MAIN_DB_PREFIX.'societe as s, '.MAIN_DB_PREFIX.'fichinter as fi';
$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.= " 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.= " ,sum(pf.amount) as am";
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 align=\"center\">".dol_print_date($objp->df)."</td>\n";
print "<td nowrap align=\"center\">".dol_print_date($objp->datelimite);
if ($objp->datelimite < ($now - $conf->facture->fournisseur->warning_delay) && ! $objp->paye && $objp->fk_statut == 1) print img_warning($langs->trans("Late"));
print "<td nowrap align=\"center\">".dol_print_date($db->jdate($objp->df))."</td>\n";
print "<td nowrap align=\"center\">".dol_print_date($db->jdate($objp->datelimite));
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>';

View File

@ -96,7 +96,7 @@ $html=new Form($db);
llxHeader($langs->trans("SuppliersInovices"),'','EN:Suppliers_Invoices|FR:FactureFournisseur|ES:Facturas_de_proveedores');
$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";
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";
@ -242,9 +242,9 @@ if ($resql)
print $facturestatic->getNomUrl(1);
print "</td>\n";
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($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");
print '<td align="center" nowrap="1">'.dol_print_date($db->jdate($obj->datef),'day').'</td>';
print '<td align="center" nowrap="1">'.dol_print_date($db->jdate($obj->date_echeance),'day');
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>'.dol_trunc($obj->libelle,36).'</td>';
print '<td>';

View File

@ -266,7 +266,7 @@ if ($action == 'create' || $action == 'add_paiement')
/*
* 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 .= ' FROM '.MAIN_DB_PREFIX.'facture_fourn as f';
$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 )
{
print '<td align="center">';
print dol_print_date($objp->df).'</td>';
print dol_print_date($db->jdate($objp->df)).'</td>';
}
else
{

View File

@ -266,7 +266,6 @@ class Livraison extends CommonObject
$this->statut = $obj->fk_statut;
$this->user_author_id = $obj->fk_user_author;
$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->note = $obj->note;
$this->note_public = $obj->note_public;
@ -328,7 +327,7 @@ class Livraison extends CommonObject
{
// Definition du nom de module de numerotation de commande
$modName = $conf->global->LIVRAISON_ADDON;
if (is_readable(DOL_DOCUMENT_ROOT .'/includes/modules/livraison/'.$modName.'.php'))
{
require_once DOL_DOCUMENT_ROOT .'/includes/modules/livraison/'.$modName.'.php';
@ -352,7 +351,7 @@ class Livraison extends CommonObject
$sql.= " WHERE ref = '".$this->ref."'";
$sql.= " AND fk_statut <> 0";
$sql.= " AND entity = ".$conf->entity;
$resql=$this->db->query($sql);
if ($resql)
{
@ -370,7 +369,7 @@ class Livraison extends CommonObject
$sql.= ", fk_user_valid = ".$user->id;
$sql.= " WHERE rowid = ".$this->id;
$sql.= " AND fk_statut = 0";
$resql=$this->db->query($sql);
if ($resql)
{
@ -464,7 +463,7 @@ class Livraison extends CommonObject
dol_syslog("livraison.class.php::valid ".$this->error, LOG_ERR);
return -1;
}
// Appel des triggers
include_once(DOL_DOCUMENT_ROOT.'/core/class/interfaces.class.php');
$interface = new Interfaces($this->db);
@ -480,7 +479,7 @@ class Livraison extends CommonObject
else
{
$this->db->commit();
dol_syslog("livraison.class.php::valid commit");
dol_syslog("livraison.class.php::valid commit");
return 1;
}
}
@ -513,8 +512,7 @@ class Livraison extends CommonObject
$this->note = $expedition->note;
$this->fk_project = $expedition->fk_project;
$this->date_delivery = $expedition->date_delivery;
$this->adresse_livraison_id = $expedition->adresse_livraison_id; // TODO obsolete
$this->fk_delivery_address = $expedition->adresse_livraison_id;
$this->fk_delivery_address = $expedition->fk_delivery_address;
$this->socid = $expedition->socid;
$this->ref_customer = $expedition->ref_customer;
@ -583,7 +581,7 @@ class Livraison extends CommonObject
if ( $this->db->query($sql) )
{
$this->db->commit();
// On efface le repertoire de pdf provisoire
$livref = dol_sanitizeFileName($this->ref);
if ($conf->livraison->dir_output)
@ -607,7 +605,7 @@ class Livraison extends CommonObject
}
}
}
return 1;
}
else
@ -796,7 +794,7 @@ class Livraison extends CommonObject
$ligne->total_ht = 100;
$this->lignes[$i] = $ligne;
}
/**
* \brief Renvoie la quantite de produit restante a livrer pour une commande
* \return array Product remaining to be delivered
@ -804,10 +802,10 @@ class Livraison extends CommonObject
function getRemainingDelivered()
{
global $langs;
// Get the linked object
$this->load_object_linked(-1,-1,$this->id,$this->element);
// Get the product ref and qty in source
$sqlSourceLine = "SELECT st.rowid, st.description, st.qty";
$sqlSourceLine.= ", p.ref, p.label";
@ -816,7 +814,7 @@ class Livraison extends CommonObject
$sqlSourceLine.= " WHERE fk_".$this->linked_object[0]['type']." = ".$this->linked_object[0]['linkid'];
$resultSourceLine = $this->db->query($sqlSourceLine);
if ($resultSourceLine)
if ($resultSourceLine)
{
$num_lines = $this->db->num_rows($resultSourceLine);
$i = 0;
@ -824,7 +822,7 @@ class Livraison extends CommonObject
while ($i < $num_lines)
{
$objSourceLine = $this->db->fetch_object($resultSourceLine);
// Recupere les lignes de la source deja livrees
$sql = "SELECT ld.fk_origin_line, sum(ld.qty) as qty";
$sql.= " FROM ".MAIN_DB_PREFIX."livraisondet as ld, ".MAIN_DB_PREFIX."livraison as l,";
@ -836,11 +834,11 @@ class Livraison extends CommonObject
$sql.= " AND cd.fk_".$this->linked_object[0]['type']." = ".$this->linked_object[0]['linkid'];
$sql.= " AND ld.fk_origin_line = ".$objSourceLine->rowid;
$sql.= " GROUP BY ld.fk_origin_line";
$result = $this->db->query($sql);
$row = $this->db->fetch_row($result);
if ($objSourceLine->qty - $row[1] > 0)
if ($objSourceLine->qty - $row[1] > 0)
{
if ($row[0] == $objSourceLine->rowid)
{
@ -850,7 +848,7 @@ class Livraison extends CommonObject
{
$array[$i]['qty'] = $objSourceLine->qty;
}
$array[$i]['ref'] = $objSourceLine->ref;
$array[$i]['label'] = $objSourceLine->label?$objSourceLine->label:$objSourceLine->description;
}
@ -858,9 +856,9 @@ class Livraison extends CommonObject
{
$array[$i]['qty'] = $objSourceLine->qty - $row[1]. " Erreur livraison !";
$array[$i]['ref'] = $objSourceLine->ref;
$array[$i]['label'] = $objSourceLine->label?$objSourceLine->label:$objSourceLine->description;
$array[$i]['label'] = $objSourceLine->label?$objSourceLine->label:$objSourceLine->description;
}
$i++;
}
return $array;
@ -872,7 +870,7 @@ class Livraison extends CommonObject
return -1;
}
}
/**
* \brief Renvoie un tableau avec les livraisons par ligne
* \param filtre_statut Filtre sur statut
@ -882,7 +880,7 @@ class Livraison extends CommonObject
function livraison_array($filtre_statut=-1)
{
$this->livraisons = array();
$sql = 'SELECT cd.fk_product, SUM(ld.qty)';
$sql.= ' FROM '.MAIN_DB_PREFIX.'livraisondet as ld';
$sql.= ', '.MAIN_DB_PREFIX.'livraison as l';