feature/columna-totales #4

Open
atasistro wants to merge 46 commits from feature/columna-totales into master
2 changed files with 19 additions and 9 deletions
Showing only changes of commit 83dd00858b - Show all commits

View file

@ -1,9 +0,0 @@
<?php
namespace App;
class Constants
{
public const COSTO_TRANSPORTE = 15;
public const DIVISOR_TRANSPORTE = 500;
}

View file

@ -0,0 +1,19 @@
<?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;
}
}