Change to define unit price from timespent data instead from the user hourly rate
This commit is contained in:
parent
ee7e394ebf
commit
811e24fd7c
@ -469,10 +469,15 @@ if ($action == 'confirm_generateinvoice') {
|
||||
$qtyhour = $value['timespent'] / 3600;
|
||||
$qtyhourtext = convertSecondToTime($value['timespent'], 'all', $conf->global->MAIN_DURATION_OF_WORKDAY);
|
||||
|
||||
/*
|
||||
// If no unit price known
|
||||
if (empty($pu_ht)) {
|
||||
$pu_ht = price2num($value['totalvaluetodivideby3600'] / 3600, 'MU');
|
||||
}
|
||||
*/
|
||||
|
||||
//Unit price
|
||||
$pu_ht = price2num(($value['totalvaluetodivideby3600'] / $value['timespent']), 'MU');
|
||||
|
||||
// Add lines
|
||||
$lineid = $tmpinvoice->addline($langs->trans("TimeSpentForInvoice", $username).' : '.$qtyhourtext, $pu_ht, round($qtyhour / $prodDurationHours, 2), $txtva, $localtax1, $localtax2, ($idprod > 0 ? $idprod : 0));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user