feature/columna-totales #4

Open
atasistro wants to merge 46 commits from feature/columna-totales into master
Showing only changes of commit 1da3d6db92 - Show all commits

View file

@ -2,7 +2,7 @@
namespace App\Models;
use App\Constants;
use App\Utils\TransporteUtils;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
@ -85,8 +85,7 @@ class Pedido extends Model
if ($this->productos()->every(fn($prod) => !$prod->pagaTransporte()))
return 0;
$cantidad = 1 + floor($this->total($this->productosConTransporte()) / Constants::DIVISOR_TRANSPORTE);
return $cantidad * Constants::COSTO_TRANSPORTE;
return TransporteUtils::total($this->productosConTransporte());
}
/**