productosPedidos(); foreach ($productos_pedidos as $productoPedido) { $productos_cantidades[] = [ "id" => $productoPedido->producto_id, "cantidad" => $productoPedido->cantidad_pedida ]; } return [ 'id' => $this->id, 'nombre' => $this->nombre, 'devoluciones_habilitadas' => $this->devoluciones_habilitadas, 'pedidos' => SubpedidoResource::collection($this->pedidosHogares()), 'total_a_recaudar' => number_format($this->totalARecaudar(),2), 'saldo' => number_format($this->saldo, 2, ".", ""), 'total_sin_devoluciones' => number_format($this->totalSinDevoluciones(),2), 'total_barrial' => number_format($this->totalBarrial(),2), 'total_devoluciones' => number_format($this->totalDevoluciones(),2), 'total_de_pedido' => number_format($this->totalDePedido(),2), 'total_a_transferir' => number_format($this->totalATransferir(),2), 'total_transporte' => number_format($this->totalTransporte()), 'cantidad_transporte' => number_format($this->cantidadTransporte()), 'productos_cantidades' => $productos_cantidades, ]; } }