Skip to content

Commit

Permalink
Fix: [ bug #1280 ] service with not end of date was tagged as expired.
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Mar 2, 2014
1 parent 8bd72cc commit 748d769
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Expand Up @@ -39,6 +39,7 @@ Fix: [ bug #1206 ] PMP price is bad calculated.
Fix: [ bug #520 ] Product statistics and detailed lists are wrong.
Fix: [ bug #1240 ] traduction.
Fix: [ bug #1238 ] When creating accompte with a %, free product are used for calculation.
Fix: [ bug #1280 ] service with not end of date was tagged as expired.

***** ChangeLog for 3.5 compared to 3.4.* *****
For users:
Expand Down
6 changes: 3 additions & 3 deletions htdocs/contrat/class/contrat.class.php
Expand Up @@ -569,7 +569,7 @@ function fetch_lines()

if ($line->statut == 0) $this->nbofserviceswait++;
if ($line->statut == 4 && (empty($line->date_fin_prevue) || $line->date_fin_prevue >= $now)) $this->nbofservicesopened++;
if ($line->statut == 4 && $line->date_fin_prevue < $now) $this->nbofservicesexpired++;
if ($line->statut == 4 && (! empty($line->date_fin_prevue) && $line->date_fin_prevue < $now)) $this->nbofservicesexpired++;
if ($line->statut == 5) $this->nbofservicesclosed++;

$total_ttc+=$objp->total_ttc; // TODO Not saved into database
Expand Down Expand Up @@ -654,7 +654,7 @@ function fetch_lines()

if ($line->statut == 0) $this->nbofserviceswait++;
if ($line->statut == 4 && (empty($line->date_fin_prevue) || $line->date_fin_prevue >= $now)) $this->nbofservicesopened++;
if ($line->statut == 4 && $line->date_fin_prevue < $now) $this->nbofservicesexpired++;
if ($line->statut == 4 && (! empty($line->date_fin_prevue) && $line->date_fin_prevue < $now)) $this->nbofservicesexpired++;
if ($line->statut == 5) $this->nbofservicesclosed++;

$this->lines[] = $line;
Expand Down Expand Up @@ -1799,7 +1799,7 @@ function __construct($db)
*/
function getLibStatut($mode)
{
return $this->LibStatut($this->statut,$mode,(isset($this->date_fin_validite)?($this->date_fin_validite < dol_now()?1:0):-1));
return $this->LibStatut($this->statut,$mode,((! empty($this->date_fin_validite))?($this->date_fin_validite < dol_now()?1:0):-1));
}

/**
Expand Down
4 changes: 2 additions & 2 deletions htdocs/contrat/fiche.php
Expand Up @@ -241,7 +241,7 @@
for ($i=0;$i<$num;$i++)
{
$product_type=($lines[$i]->product_type?$lines[$i]->product_type:0);

if ($product_type == 1) { //only services // TODO Exclude also deee
// service prédéfini
if ($lines[$i]->fk_product > 0)
Expand Down Expand Up @@ -929,7 +929,7 @@
{
$result=$object->fetch($id,$ref);
if ($result < 0) dol_print_error($db,$object->error);
$result=$object->fetch_lines();
$result=$object->fetch_lines(); // This also init $this->nbofserviceswait, $this->nbofservicesopened, $this->nbofservicesexpired=, $this->nbofservicesclosed
if ($result < 0) dol_print_error($db,$object->error);
$result=$object->fetch_thirdparty();
if ($result < 0) dol_print_error($db,$object->error);
Expand Down

0 comments on commit 748d769

Please sign in to comment.