Skip to content
Snippets Groups Projects
Commit 6da5a6b8 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

FIX #7359

Conflicts:
	htdocs/fichinter/class/fichinter.class.php
parent 029f1c41
No related branches found
No related tags found
No related merge requests found
......@@ -39,7 +39,7 @@ class Fichinter extends CommonObject
public $fk_element='fk_fichinter';
public $table_element_line='fichinterdet';
public $picto = 'intervention';
/**
* {@inheritdoc}
*/
......@@ -361,7 +361,7 @@ class Fichinter extends CommonObject
$this->fk_contrat = $obj->fk_contrat;
$this->user_creation= $obj->fk_user_author;
$this->extraparams = (array) json_decode($obj->extraparams, true);
if ($this->statut == 0) $this->brouillon = 1;
......@@ -542,27 +542,26 @@ class Fichinter extends CommonObject
/**
* Returns amount based on user thm
*
* @return float amount
* @return float Amount
*/
function getAmount() {
function getAmount()
{
global $db;
$amount = 0;
$this->author = new User($db);
$this->author->fetch($this->user_creation);
$thm = $this->author->thm;
foreach($this->lines as &$line) {
$amount+=$line->qty * $thm;
foreach($this->lines as $line) {
$amount += ($line->duration / 60 / 60 * $thm);
}
return $amount;
return price2num($amount, 'MT');
}
/**
* Returns the label status
*
......@@ -599,7 +598,7 @@ class Fichinter extends CommonObject
return '<span class="hideonsmartphone">'.$langs->trans($this->statuts_short[$statut]).' </span>'.img_picto($langs->trans($this->statuts[$statut]),$this->statuts_logo[$statut]);
if ($mode == 6)
return '<span class="hideonsmartphone">'.$langs->trans($this->statuts[$statut]).' </span>'.img_picto($langs->trans($this->statuts[$statut]),$this->statuts_logo[$statut]);
return '';
}
......@@ -949,7 +948,7 @@ class Fichinter extends CommonObject
return -2;
}
/**
* Load an object from its id and create a new one in database
......@@ -1001,7 +1000,7 @@ class Fichinter extends CommonObject
$this->date_creation = '';
$this->date_validation = '';
$this->ref_client = '';
// Create clone
$result=$this->create($user);
if ($result < 0) $error++;
......@@ -1013,7 +1012,7 @@ class Fichinter extends CommonObject
{
$this->addline($user, $this->id, $line->desc, $line->datei, $line->duration);
}
// Hook of thirdparty module
if (is_object($hookmanager))
{
......@@ -1043,8 +1042,8 @@ class Fichinter extends CommonObject
return -1;
}
}
/**
* Adding a line of intervention into data base
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment