diff --git a/app/Http/Resources/SubpedidoResource.php b/app/Http/Resources/SubpedidoResource.php index f659379..e83492f 100644 --- a/app/Http/Resources/SubpedidoResource.php +++ b/app/Http/Resources/SubpedidoResource.php @@ -22,7 +22,8 @@ class SubpedidoResource extends JsonResource 'bonos_de_transporte' => $this->cantidadBDT(), 'subtotal_bonos_de_transporte' => number_format($this->getSubtotalBDT(),2), 'total' => number_format($this->getTotal(),2), - 'grupo_de_compra' => $this->grupoDeCompra + 'grupo_de_compra' => $this->grupoDeCompra, + 'productos' => $this->productos ]; } } diff --git a/app/Subpedido.php b/app/Subpedido.php index 0cfb039..b7a9489 100644 --- a/app/Subpedido.php +++ b/app/Subpedido.php @@ -15,7 +15,7 @@ class Subpedido extends Model public function productos() { - return $this->belongsToMany('App\Producto')->withPivot(["cantidad"]); + return $this->belongsToMany('App\Producto')->withPivot(["cantidad","total"]); } //Bonos del MPS, Sororo, etc. NO devuelve bonos de transporte