2022-02-23 19:52:52 -03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Resources;
|
|
|
|
|
|
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
|
|
|
|
class SubpedidoResource extends JsonResource
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Transform the resource into an array.
|
|
|
|
*
|
|
|
|
* @param \Illuminate\Http\Request $request
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function toArray($request)
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'id' => $this->id,
|
|
|
|
'nombre' => $this->nombre,
|
2023-05-24 15:01:31 -03:00
|
|
|
'subtotal_productos' => number_format($this->totalSinBonos(),0),
|
2022-04-11 23:02:54 -03:00
|
|
|
'subtotal_bonos' => number_format($this->getSubtotalBonos(),0),
|
2022-02-23 19:52:52 -03:00
|
|
|
'bonos_de_transporte' => $this->cantidadBDT(),
|
2022-04-11 23:02:54 -03:00
|
|
|
'subtotal_bonos_de_transporte' => number_format($this->getSubtotalBDT(),0),
|
|
|
|
'total' => number_format($this->getTotal(),0),
|
2022-03-16 23:56:51 -03:00
|
|
|
'grupo_de_compra' => $this->grupoDeCompra,
|
2022-06-08 20:32:50 -03:00
|
|
|
'productos' => $this->productos,
|
|
|
|
'aprobado' => (bool) $this->aprobado
|
2022-02-23 19:52:52 -03:00
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|