add: more tests
This commit is contained in:
parent
ce7f620984
commit
fcd76cf130
11 changed files with 232 additions and 15 deletions
|
@ -1,11 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\CsvController\CsvCostCalc;
|
||||
use function Utils\round_up_to_two_decimals;
|
||||
use App\Utils\utils;
|
||||
|
||||
class CsvTotalCostCalc
|
||||
{
|
||||
private $CsvMinuteCostCalc;
|
||||
public function __construct()
|
||||
{
|
||||
$this->CsvMinuteCostCalc = new CsvMinuteCostCalc();
|
||||
|
@ -15,7 +14,7 @@ class CsvTotalCostCalc
|
|||
function total_time_cost(array $array, int $total_time)
|
||||
{
|
||||
$minute_cost = $this->CsvMinuteCostCalc->select_correct_cost($array['Request By'], $array['Priority']);
|
||||
$total_cost = round_up_to_two_decimals($total_time / 60 * $minute_cost);
|
||||
$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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue