Removed deprecated method classer_facturee(). Duplicate of

classifyBilled
This commit is contained in:
Laurent Destailleur 2018-03-16 10:51:12 +01:00
parent a642ac60f6
commit e639f2a91f
9 changed files with 45 additions and 90 deletions

View File

@ -140,7 +140,6 @@ class DolibarrApi
unset($object->class_element_line); unset($object->class_element_line);
unset($object->picto); unset($object->picto);
unset($object->facturee); // Replace with billed
unset($object->fieldsforcombobox); unset($object->fieldsforcombobox);
unset($object->comments); unset($object->comments);

View File

@ -592,7 +592,6 @@ class ActionComm extends CommonObject
$this->label = $obj->label; $this->label = $obj->label;
$this->datep = $this->db->jdate($obj->datep); $this->datep = $this->db->jdate($obj->datep);
$this->datef = $this->db->jdate($obj->datep2); $this->datef = $this->db->jdate($obj->datep2);
// $this->durationp = $this->durationp; // deprecated
$this->datec = $this->db->jdate($obj->datec); $this->datec = $this->db->jdate($obj->datec);
$this->datem = $this->db->jdate($obj->datem); $this->datem = $this->db->jdate($obj->datem);

View File

@ -468,10 +468,8 @@ if ($resql)
$event->datef=$datep2; $event->datef=$datep2;
$event->type_code=$obj->code; $event->type_code=$obj->code;
$event->type_color=$obj->color; $event->type_color=$obj->color;
//$event->libelle=$obj->label; // deprecated
$event->label=$obj->label; $event->label=$obj->label;
$event->percentage=$obj->percent; $event->percentage=$obj->percent;
//$event->author->id=$obj->fk_user_author; // user id of creator
$event->authorid=$obj->fk_user_author; // user id of creator $event->authorid=$obj->fk_user_author; // user id of creator
$event->userownerid=$obj->fk_user_action; // user id of owner $event->userownerid=$obj->fk_user_action; // user id of owner
$event->priority=$obj->priority; $event->priority=$obj->priority;
@ -483,8 +481,6 @@ if ($resql)
$event->socid=$obj->fk_soc; $event->socid=$obj->fk_soc;
$event->contactid=$obj->fk_contact; $event->contactid=$obj->fk_contact;
//$event->societe->id=$obj->fk_soc; // deprecated
//$event->contact->id=$obj->fk_contact; // deprecated
$event->fk_element=$obj->fk_element; $event->fk_element=$obj->fk_element;
$event->elementtype=$obj->elementtype; $event->elementtype=$obj->elementtype;

View File

@ -496,10 +496,8 @@ if ($resql)
$event->datef=$datep2; $event->datef=$datep2;
$event->type_code=$obj->code; $event->type_code=$obj->code;
$event->type_color=$obj->color; $event->type_color=$obj->color;
//$event->libelle=$obj->label; // deprecated
$event->label=$obj->label; $event->label=$obj->label;
$event->percentage=$obj->percent; $event->percentage=$obj->percent;
//$event->author->id=$obj->fk_user_author; // user id of creator
$event->authorid=$obj->fk_user_author; // user id of creator $event->authorid=$obj->fk_user_author; // user id of creator
$event->userownerid=$obj->fk_user_action; // user id of owner $event->userownerid=$obj->fk_user_action; // user id of owner
$event->priority=$obj->priority; $event->priority=$obj->priority;
@ -511,8 +509,6 @@ if ($resql)
$event->socid=$obj->fk_soc; $event->socid=$obj->fk_soc;
$event->contactid=$obj->fk_contact; $event->contactid=$obj->fk_contact;
//$event->societe->id=$obj->fk_soc; // deprecated
//$event->contact->id=$obj->fk_contact; // deprecated
$event->fk_element=$obj->fk_element; $event->fk_element=$obj->fk_element;
$event->elementtype=$obj->elementtype; $event->elementtype=$obj->elementtype;
@ -624,9 +620,9 @@ $currentdaytoshow = $firstdaytoshow;
echo '<div class="div-table-responsive">'; echo '<div class="div-table-responsive">';
while($currentdaytoshow<$lastdaytoshow) { while($currentdaytoshow<$lastdaytoshow) {
echo '<table width="100%" class="noborder nocellnopadd cal_month">'; echo '<table width="100%" class="noborder nocellnopadd cal_month">';
echo '<tr class="liste_titre">'; echo '<tr class="liste_titre">';
echo '<td></td>'; echo '<td></td>';
$i=0; // 0 = sunday, $i=0; // 0 = sunday,
@ -646,7 +642,7 @@ while($currentdaytoshow<$lastdaytoshow) {
$i++; $i++;
} }
echo "</tr>\n"; echo "</tr>\n";
echo '<tr class="liste_titre">'; echo '<tr class="liste_titre">';
echo '<td></td>'; echo '<td></td>';
$i=0; $i=0;
@ -667,8 +663,8 @@ while($currentdaytoshow<$lastdaytoshow) {
$i++; $i++;
} }
echo "</tr>\n"; echo "</tr>\n";
// Define $usernames // Define $usernames
$usernames = array(); //init $usernames = array(); //init
$usernamesid = array(); $usernamesid = array();
@ -722,7 +718,7 @@ while($currentdaytoshow<$lastdaytoshow) {
$result=$tmpuser->fetch($id); $result=$tmpuser->fetch($id);
$usernames[]=$tmpuser; $usernames[]=$tmpuser;
} }
/* /*
if ($filtert > 0) if ($filtert > 0)
{ {
@ -742,7 +738,7 @@ while($currentdaytoshow<$lastdaytoshow) {
//$tmpgroup->fetch($usergroup); No fetch, we want all users for all groups //$tmpgroup->fetch($usergroup); No fetch, we want all users for all groups
$usernames = $tmpgroup->listUsersForGroup(); $usernames = $tmpgroup->listUsersForGroup();
}*/ }*/
// Load array of colors by type // Load array of colors by type
$colorsbytype=array(); $colorsbytype=array();
$labelbytype=array(); $labelbytype=array();
@ -753,7 +749,7 @@ while($currentdaytoshow<$lastdaytoshow) {
$colorsbytype[$obj->code]=$obj->color; $colorsbytype[$obj->code]=$obj->color;
$labelbytype[$obj->code]=$obj->libelle; $labelbytype[$obj->code]=$obj->libelle;
} }
// Loop on each user to show calendar // Loop on each user to show calendar
$todayarray=dol_getdate($now,'fast'); $todayarray=dol_getdate($now,'fast');
$sav = $tmpday; $sav = $tmpday;
@ -767,42 +763,42 @@ while($currentdaytoshow<$lastdaytoshow) {
print $username->getNomUrl(-1,'',0,0,20,1,''); print $username->getNomUrl(-1,'',0,0,20,1,'');
print '</td>'; print '</td>';
$tmpday = $sav; $tmpday = $sav;
// Lopp on each day of week // Lopp on each day of week
$i = 0; $i = 0;
for ($iter_day = 0; $iter_day < 8; $iter_day++) for ($iter_day = 0; $iter_day < 8; $iter_day++)
{ {
if (($i + 1) < $begin_d || ($i + 1) > $end_d) if (($i + 1) < $begin_d || ($i + 1) > $end_d)
{ {
$i++; $i++;
continue; continue;
} }
// Show days of the current week // Show days of the current week
$curtime = dol_time_plus_duree($currentdaytoshow, $iter_day, 'd'); $curtime = dol_time_plus_duree($currentdaytoshow, $iter_day, 'd');
$tmparray = dol_getdate($curtime,'fast'); $tmparray = dol_getdate($curtime,'fast');
$tmpday = $tmparray['mday']; $tmpday = $tmparray['mday'];
$tmpmonth = $tmparray['mon']; $tmpmonth = $tmparray['mon'];
$tmpyear = $tmparray['year']; $tmpyear = $tmparray['year'];
$style='cal_current_month'; $style='cal_current_month';
if ($iter_day == 6) $style.=' cal_other_month'; if ($iter_day == 6) $style.=' cal_other_month';
$today=0; $today=0;
if ($todayarray['mday']==$tmpday && $todayarray['mon']==$tmpmonth && $todayarray['year']==$tmpyear) $today=1; if ($todayarray['mday']==$tmpday && $todayarray['mon']==$tmpmonth && $todayarray['year']==$tmpyear) $today=1;
if ($today) $style='cal_today_peruser'; if ($today) $style='cal_today_peruser';
show_day_events2($username, $tmpday, $tmpmonth, $tmpyear, $monthshown, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, $showheader, $colorsbytype, $var); show_day_events2($username, $tmpday, $tmpmonth, $tmpyear, $monthshown, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, $showheader, $colorsbytype, $var);
$i++; $i++;
} }
echo "</tr>\n"; echo "</tr>\n";
$showheader = false; $showheader = false;
} }
echo "</table>\n"; echo "</table>\n";
echo "<br>"; echo "<br>";
$currentdaytoshow = dol_time_plus_duree($currentdaytoshow, 7, 'd'); $currentdaytoshow = dol_time_plus_duree($currentdaytoshow, 7, 'd');
} }
@ -921,7 +917,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
$colorindexused[$user->id] = 0; // Color index for current user (user->id) is always 0 $colorindexused[$user->id] = 0; // Color index for current user (user->id) is always 0
$nextindextouse=count($colorindexused); // At first run this is 0, so first user has 0, next 1, ... $nextindextouse=count($colorindexused); // At first run this is 0, so first user has 0, next 1, ...
//if ($username->id && $day==1) var_dump($eventarray); //if ($username->id && $day==1) var_dump($eventarray);
// We are in a particular day for $username, now we scan all events // We are in a particular day for $username, now we scan all events
foreach ($eventarray as $daykey => $notused) foreach ($eventarray as $daykey => $notused)
{ {

View File

@ -751,7 +751,7 @@ if ($object->id > 0)
{ {
// Check if there are orders billable // Check if there are orders billable
$sql2 = 'SELECT s.nom, s.rowid as socid, s.client, c.rowid, c.ref, c.total_ht, c.ref_client,'; $sql2 = 'SELECT s.nom, s.rowid as socid, s.client, c.rowid, c.ref, c.total_ht, c.ref_client,';
$sql2.= ' c.date_valid, c.date_commande, c.date_livraison, c.fk_statut, c.facture as facturee'; $sql2.= ' c.date_valid, c.date_commande, c.date_livraison, c.fk_statut, c.facture as billed';
$sql2.= ' FROM '.MAIN_DB_PREFIX.'societe as s'; $sql2.= ' FROM '.MAIN_DB_PREFIX.'societe as s';
$sql2.= ', '.MAIN_DB_PREFIX.'commande as c'; $sql2.= ', '.MAIN_DB_PREFIX.'commande as c';
$sql2.= ' WHERE c.fk_soc = s.rowid'; $sql2.= ' WHERE c.fk_soc = s.rowid';
@ -779,14 +779,16 @@ if ($object->id > 0)
{ {
$objp = $db->fetch_object($resql); $objp = $db->fetch_object($resql);
$commande_static->id = $objp->cid;
$commande_static->ref = $objp->ref;
$commande_static->ref_client=$objp->ref_client;
$commande_static->total_ht = $objp->total_ht;
$commande_static->total_tva = $objp->total_tva;
$commande_static->total_ttc = $objp->total_ttc;
$commande_static->billed = $objp->billed;
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td class="nowrap">'; print '<td class="nowrap">';
$commande_static->id = $objp->cid;
$commande_static->ref = $objp->ref;
$commande_static->ref_client=$objp->ref_client;
$commande_static->total_ht = $objp->total_ht;
$commande_static->total_tva = $objp->total_tva;
$commande_static->total_ttc = $objp->total_ttc;
print $commande_static->getNomUrl(1); print $commande_static->getNomUrl(1);
print '</td><td align="right" width="80px">'.dol_print_date($db->jdate($objp->dc),'day')."</td>\n"; print '</td><td align="right" width="80px">'.dol_print_date($db->jdate($objp->dc),'day')."</td>\n";
print '<td align="right" style="min-width: 60px">'.price($objp->total_ht).'</td>'; print '<td align="right" style="min-width: 60px">'.price($objp->total_ht).'</td>';

View File

@ -2528,21 +2528,6 @@ class Propal extends CommonObject
} }
} }
/**
* Class invoiced the Propal
*
* @return int <0 si ko, >0 si ok
* @deprecated
* @see classifyBilled()
*/
function classer_facturee()
{
global $user;
dol_syslog(__METHOD__ . " is deprecated", LOG_WARNING);
return $this->classifyBilled($user);
}
/** /**
* Set draft status * Set draft status
* *

View File

@ -79,10 +79,9 @@ class Commande extends CommonOrder
*/ */
public $statut; public $statut;
/** /**
* @deprecated * Billed
* @see billed * @var int
*/ */
public $facturee;
public $billed; // billed or not public $billed; // billed or not
public $brouillon; public $brouillon;
@ -545,7 +544,6 @@ class Commande extends CommonOrder
{ {
$this->statut = self::STATUS_VALIDATED; $this->statut = self::STATUS_VALIDATED;
$this->billed = 0; $this->billed = 0;
$this->facturee = 0; // deprecated
$this->db->commit(); $this->db->commit();
return 1; return 1;
@ -1624,7 +1622,6 @@ class Commande extends CommonOrder
$this->remise_percent = $obj->remise_percent; $this->remise_percent = $obj->remise_percent;
$this->remise_absolue = $obj->remise_absolue; $this->remise_absolue = $obj->remise_absolue;
$this->source = $obj->source; $this->source = $obj->source;
$this->facturee = $obj->billed; // deprecated
$this->billed = $obj->billed; $this->billed = $obj->billed;
$this->note = $obj->note_private; // deprecated $this->note = $obj->note_private; // deprecated
$this->note_private = $obj->note_private; $this->note_private = $obj->note_private;
@ -2701,7 +2698,6 @@ class Commande extends CommonOrder
if (! $error) if (! $error)
{ {
$this->oldcopy= clone $this; $this->oldcopy= clone $this;
$this->facturee=1; // deprecated
$this->billed=1; $this->billed=1;
} }
@ -2737,21 +2733,6 @@ class Commande extends CommonOrder
} }
} }
/**
* Classify the order as invoiced
*
* @return int <0 if ko, >0 if ok
* @deprecated
* @see classifyBilled()
*/
function classer_facturee()
{
global $user;
dol_syslog(__METHOD__ . " is deprecated", LOG_WARNING);
return $this->classifyBilled($user);
}
/** /**
* Classify the order as not invoiced * Classify the order as not invoiced
* *
@ -2773,7 +2754,6 @@ class Commande extends CommonOrder
if (! $error) if (! $error)
{ {
$this->oldcopy= clone $this; $this->oldcopy= clone $this;
$this->facturee=1; // deprecated
$this->billed=1; $this->billed=1;
} }
@ -2784,7 +2764,6 @@ class Commande extends CommonOrder
if (! $error) if (! $error)
{ {
$this->facturee=0; // deprecated
$this->billed=0; $this->billed=0;
$this->db->commit(); $this->db->commit();
@ -3319,7 +3298,6 @@ class Commande extends CommonOrder
*/ */
function getLibStatut($mode) function getLibStatut($mode)
{ {
if ($this->facturee && empty($this->billed)) $this->billed=$this->facturee; // For backward compatibility
return $this->LibStatut($this->statut, $this->billed, $mode); return $this->LibStatut($this->statut, $this->billed, $mode);
} }

View File

@ -545,7 +545,7 @@ if (($action != 'create' && $action != 'add') || ($action == 'create' && $error)
<?php <?php
$sql = 'SELECT s.nom, s.rowid as socid, s.client, c.rowid, c.ref, c.total_ht, c.ref_client,'; $sql = 'SELECT s.nom, s.rowid as socid, s.client, c.rowid, c.ref, c.total_ht, c.ref_client,';
$sql.= ' c.date_valid, c.date_commande, c.date_livraison, c.fk_statut, c.facture as facturee'; $sql.= ' c.date_valid, c.date_commande, c.date_livraison, c.fk_statut, c.facture as billed';
$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';
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";
@ -695,7 +695,7 @@ if (($action != 'create' && $action != 'add') || ($action == 'create' && $error)
print '</td>'; print '</td>';
// Statut // Statut
print '<td align="right" class="nowrap">'.$generic_commande->LibStatut($objp->fk_statut,$objp->facturee,5).'</td>'; print '<td align="right" class="nowrap">'.$generic_commande->LibStatut($objp->fk_statut,$objp->billed,5).'</td>';
// Checkbox // Checkbox
print '<td align="center">'; print '<td align="center">';

View File

@ -93,11 +93,11 @@ if ($resql)
while ($i < $num) while ($i < $num)
{ {
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
$shipment->id=$obj->rowid; $shipment->id=$obj->rowid;
$shipment->ref=$obj->ref; $shipment->ref=$obj->ref;
$shipment->ref_customer=$obj->ref_customer; $shipment->ref_customer=$obj->ref_customer;
print '<tr class="oddeven"><td class="nowrap">'; print '<tr class="oddeven"><td class="nowrap">';
print $shipment->getNomUrl(1); print $shipment->getNomUrl(1);
print "</td>"; print "</td>";
@ -148,11 +148,11 @@ if ($resql)
$orderstatic->ref=$obj->ref; $orderstatic->ref=$obj->ref;
$orderstatic->ref_customer=$obj->ref_customer; $orderstatic->ref_customer=$obj->ref_customer;
$orderstatic->statut=$obj->fk_statut; $orderstatic->statut=$obj->fk_statut;
$orderstatic->facturee=0; $orderstatic->billed=0;
$companystatic->name=$obj->name; $companystatic->name=$obj->name;
$companystatic->id=$obj->socid; $companystatic->id=$obj->socid;
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td class="nowrap">'; print '<td class="nowrap">';
print $orderstatic->getNomUrl(1); print $orderstatic->getNomUrl(1);
@ -203,16 +203,16 @@ if ( $resql )
while ($i < $num) while ($i < $num)
{ {
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
$orderstatic->id=$obj->rowid; $orderstatic->id=$obj->rowid;
$orderstatic->ref=$obj->ref; $orderstatic->ref=$obj->ref;
$orderstatic->ref_customer=$obj->ref_customer; $orderstatic->ref_customer=$obj->ref_customer;
$orderstatic->statut=$obj->status; $orderstatic->statut=$obj->status;
$orderstatic->facturee=$obj->billed; $orderstatic->billed=$obj->billed;
$companystatic->name=$obj->name; $companystatic->name=$obj->name;
$companystatic->id=$obj->socid; $companystatic->id=$obj->socid;
print '<tr class="oddeven"><td>'; print '<tr class="oddeven"><td>';
print $orderstatic->getNomUrl(1); print $orderstatic->getNomUrl(1);
print '</td>'; print '</td>';
@ -262,11 +262,11 @@ if ($resql)
while ($i < $num) while ($i < $num)
{ {
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
$shipment->id=$obj->rowid; $shipment->id=$obj->rowid;
$shipment->ref=$obj->ref; $shipment->ref=$obj->ref;
$shipment->ref_customer=$obj->ref_customer; $shipment->ref_customer=$obj->ref_customer;
print '<tr class="oddeven"><td>'; print '<tr class="oddeven"><td>';
print $shipment->getNomUrl(1); print $shipment->getNomUrl(1);
print '</td>'; print '</td>';