gitea_issues_exporter/app/Http/Controllers/CsvController/CsvCostCalc/CsvTotalCostCalc.php

23 lines
628 B
PHP
Raw Normal View History

2024-07-22 14:17:00 +02:00
<?php
namespace App\Http\Controllers\CsvController\CsvCostCalc;
2024-08-14 12:46:25 +02:00
use App\Utils\utils;
2024-07-22 14:17:00 +02:00
class CsvTotalCostCalc
{
public function __construct()
{
$this->CsvMinuteCostCalc = new CsvMinuteCostCalc();
}
2024-08-12 15:55:03 +02:00
2024-07-22 14:17:00 +02:00
function total_time_cost(array $array, int $total_time)
{
$minute_cost = $this->CsvMinuteCostCalc->select_correct_cost($array['Request By'], $array['Priority']);
2024-08-14 12:46:25 +02:00
$total_cost = utils::round_up_to_two_decimals($total_time * ($minute_cost / 60));
2024-07-22 14:17:00 +02:00
$array['Tempo totale'] = gmdate('H:i:s', $total_time);
$array['Costo totale'] = $total_cost;
return $array;
}
}