20 lines
398 B
PHP
20 lines
398 B
PHP
<?php
|
|
|
|
namespace App;
|
|
|
|
class TransporteUtils
|
|
{
|
|
public const COSTO_TRANSPORTE = 15;
|
|
public const DIVISOR_TRANSPORTE = 500;
|
|
|
|
static function cantidad(float $total) : int {
|
|
if ($total)
|
|
return 1 + floor($total / DIVISOR_TRANSPORTE);
|
|
return 0;
|
|
}
|
|
|
|
static function total(float $total) : int {
|
|
return cantidad($total) * COSTO_TRANSPORTE;
|
|
}
|
|
}
|