23 lines
628 B
PHP
23 lines
628 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\CsvController\CsvCostCalc;
|
|
use App\Utils\utils;
|
|
|
|
class CsvTotalCostCalc
|
|
{
|
|
public function __construct()
|
|
{
|
|
$this->CsvMinuteCostCalc = new CsvMinuteCostCalc();
|
|
}
|
|
|
|
|
|
function total_time_cost(array $array, int $total_time)
|
|
{
|
|
$minute_cost = $this->CsvMinuteCostCalc->select_correct_cost($array['Request By'], $array['Priority']);
|
|
$total_cost = utils::round_up_to_two_decimals($total_time * ($minute_cost / 60));
|
|
$array['Tempo totale'] = gmdate('H:i:s', $total_time);
|
|
$array['Costo totale'] = $total_cost;
|
|
return $array;
|
|
}
|
|
}
|