Quitado total de pivot y de sync subpedido
This commit is contained in:
parent
0b445ee1c5
commit
44465c2783
1 changed files with 1 additions and 2 deletions
|
@ -16,7 +16,7 @@ class Subpedido extends Model
|
||||||
|
|
||||||
public function productos(): BelongsToMany
|
public function productos(): BelongsToMany
|
||||||
{
|
{
|
||||||
return $this->belongsToMany('App\Producto')->withPivot(["cantidad", "total", "notas"]);
|
return $this->belongsToMany('App\Producto')->withPivot(["cantidad", "notas"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function grupoDeCompra(): BelongsTo
|
public function grupoDeCompra(): BelongsTo
|
||||||
|
@ -99,7 +99,6 @@ class Subpedido extends Model
|
||||||
$this->productos()->syncWithoutDetaching([
|
$this->productos()->syncWithoutDetaching([
|
||||||
$producto->id => [
|
$producto->id => [
|
||||||
'cantidad' => $cantidad,
|
'cantidad' => $cantidad,
|
||||||
'total' => $cantidad * $producto->precio,
|
|
||||||
'notas' => $notas,
|
'notas' => $notas,
|
||||||
]
|
]
|
||||||
]);
|
]);
|
||||||
|
|
Loading…
Add table
Reference in a new issue