diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index d7ab8521697..09c55733bcf 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -10074,7 +10074,7 @@ class Form
* @param string $projectsListId ''=Automatic filter on project allowed. List of id=Filter on project ids.
* @param string $showproject 'all' = Show project info, ''=Hide project info
* @param User $usertofilter User object to use for filtering
- * @return int Nbr of project if OK, <0 if KO
+ * @return string HTML Select Invoice
*/
public function selectInvoice($socid = -1, $selected = '', $htmlname = 'invoiceid', $maxlength = 24, $option_only = 0, $show_empty = '1', $discard_closed = 0, $forcefocus = 0, $disabled = 0, $morecss = 'maxwidth500', $projectsListId = '', $showproject = 'all', $usertofilter = null)
{
@@ -10206,6 +10206,7 @@ class Form
$this->db->free($resql);
} else {
dol_print_error($this->db);
+ return '';
}
}
diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php
index 1eeb55db969..e2f0e984ab1 100644
--- a/htdocs/core/class/html.formprojet.class.php
+++ b/htdocs/core/class/html.formprojet.class.php
@@ -762,7 +762,7 @@ class FormProjets
* @param string $morecss More css added to the select component
* @param array $filters Array of filters
* @param int $lineOnly return only option for line
- * @return int Nbr of project if OK, <0 if KO
+ * @return string HTML Select
*/
public function selectInvoiceAndLine($selectedInvoiceId = 0, $selectedLineId = 0, $htmlNameInvoice = 'invoiceid', $htmlNameInvoiceLine = 'invoicelineid', $morecss = 'maxwidth500', $filters = array(), $lineOnly = 0)
{
@@ -820,6 +820,7 @@ class FormProjets
$out .= '';
} else {
dol_print_error($this->db->lasterror);
+ return '';
}
}
@@ -871,6 +872,7 @@ class FormProjets
}
} else {
dol_print_error($this->db->lasterror);
+ return '';
}
return $out;
diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php
index aa90a44ce1d..9755e633f05 100644
--- a/htdocs/projet/tasks/time.php
+++ b/htdocs/projet/tasks/time.php
@@ -309,7 +309,8 @@ if (($action == 'updateline' || $action == 'updatesplitline') && !$cancel && $us
}
$object->timespent_fk_user = GETPOST("userid_line", 'int');
$object->timespent_fk_product = GETPOST("fk_product", 'int');
- $object->timespent_fk_product = GETPOST("fk_product", 'int');
+ $object->timespent_invoiceid = GETPOST("invoiceid", 'int');
+ $object->timespent_invoicelineid = GETPOST("invoicelineid", 'int');
$result = 0;
if (in_array($object->timespent_fk_user, $childids) || $user->rights->projet->all->creer) {