Cambios en totales
This commit is contained in:
parent
2a5c215f40
commit
c54a0b361f
1 changed files with 6 additions and 7 deletions
|
@ -14,19 +14,18 @@ class SubpedidoResource extends JsonResource
|
||||||
*/
|
*/
|
||||||
public function toArray($request)
|
public function toArray($request)
|
||||||
{
|
{
|
||||||
|
$total = $this->total();
|
||||||
return [
|
return [
|
||||||
'id' => $this->id,
|
'id' => $this->id,
|
||||||
'nombre' => $this->nombre,
|
'nombre' => $this->nombre,
|
||||||
'subtotal_productos' => number_format($this->totalSinBonos(),0),
|
|
||||||
'subtotal_bonos' => number_format($this->getSubtotalBonos(),0),
|
|
||||||
'bonos_de_transporte' => $this->cantidadBDT(),
|
|
||||||
'subtotal_bonos_de_transporte' => number_format($this->getSubtotalBDT(),0),
|
|
||||||
'total' => number_format($this->getTotal(),0),
|
|
||||||
'total_menos_devoluciones' => number_format($this->getTotalMenosDevoluciones(),0),
|
|
||||||
'grupo_de_compra' => $this->grupoDeCompra,
|
'grupo_de_compra' => $this->grupoDeCompra,
|
||||||
'productos' => $this->productos,
|
'productos' => $this->productos,
|
||||||
'aprobado' => (bool) $this->aprobado,
|
'aprobado' => (bool) $this->aprobado,
|
||||||
'devoluciones_total' => (double) $this->devoluciones_total,
|
'total' => $total,
|
||||||
|
'total_transporte' => $this->totalTransporte(),
|
||||||
|
'cantidad_transporte' => number_format($this->cantidadTransporte(),0),
|
||||||
|
'total_menos_devoluciones' => $total - $this->devoluciones_total,
|
||||||
|
'devoluciones_total' => $this->devoluciones_total,
|
||||||
'devoluciones_notas' => $this->devoluciones_notas
|
'devoluciones_notas' => $this->devoluciones_notas
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue