funcion/refactor-general #45

Open
atasistro wants to merge 111 commits from funcion/refactor-general into master
Showing only changes of commit 8799446e57 - Show all commits

View file

@ -15,11 +15,15 @@ class SubpedidoResource extends JsonResource
*/
public function toArray($request): array
{
$productos = $this->productos;
foreach ($productos as $producto) {
$producto['pivot']['total'] = number_format($producto->pivot->cantidad * $producto->precio, 2);
}
return [
'id' => $this->id,
'nombre' => $this->nombre,
'grupo_de_compra' => $this->grupoDeCompra,
'productos' => $this->productos,
'productos' => $productos,
'aprobado' => (bool) $this->aprobado,
'total' => number_format($this->total(),2),
'total_transporte' => number_format($this->totalTransporte()),