funcion/pedido-ollas #47

Merged
rho merged 92 commits from funcion/pedido-ollas into master 2025-07-15 11:27:30 -03:00
Showing only changes of commit b68d22380e - Show all commits

View file

@ -20,7 +20,6 @@ class SubpedidoResource extends JsonResource
foreach ($productos as $producto) { foreach ($productos as $producto) {
$producto['pivot']['total'] = number_format($producto->pivot->cantidad * $producto->precio, 2); $producto['pivot']['total'] = number_format($producto->pivot->cantidad * $producto->precio, 2);
} }
$tipo = TipoPedido::find($this->tipo_pedido_id);
return [ return [
'id' => $this->id, 'id' => $this->id,
'nombre' => $this->nombre, 'nombre' => $this->nombre,
@ -32,7 +31,10 @@ class SubpedidoResource extends JsonResource
'total_sin_devoluciones' => number_format($this->totalSinDevoluciones(),2), 'total_sin_devoluciones' => number_format($this->totalSinDevoluciones(),2),
'devoluciones_total' => number_format($this->devoluciones_total,2), 'devoluciones_total' => number_format($this->devoluciones_total,2),
'devoluciones_notas' => $this->devoluciones_notas, 'devoluciones_notas' => $this->devoluciones_notas,
'tipo' => ['id' => $tipo->id, 'nombre' => $tipo->nombre], 'tipo' => [
'id' => $this->tipo_pedido_id,
'nombre' => TipoPedido::find($this->tipo_pedido_id)->nombre
],
]; ];
} }
} }