Merge pull request 'endpoint devuelve lista de productos en el subpedido, con su cantidad y subtotal' (#3) from lista-chismosa into master
Reviewed-on: #3
This commit is contained in:
		
						commit
						763fd3f646
					
				
					 2 changed files with 3 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -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
 | 
			
		||||
        ];
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue