Inuit sync of tax, product accounting, accounts and invoices
This commit is contained in:
@@ -92,7 +92,7 @@ class ProductController extends Controller
|
||||
|
||||
public function details_addedit(ProductAddEdit $request,Product $o)
|
||||
{
|
||||
foreach ($request->except(['_token','submit','translate']) as $key => $item)
|
||||
foreach ($request->except(['_token','submit','translate','accounting']) as $key => $item)
|
||||
$o->{$key} = $item;
|
||||
|
||||
$o->active = (bool)$request->active;
|
||||
@@ -122,6 +122,15 @@ class ProductController extends Controller
|
||||
|
||||
$o->translate()->save($oo);
|
||||
|
||||
if ($request->accounting)
|
||||
foreach ($request->accounting as $k=>$v)
|
||||
$o->providers()->syncWithoutDetaching([
|
||||
$k => [
|
||||
'ref' => $v,
|
||||
'site_id'=>$o->site_id,
|
||||
],
|
||||
]);
|
||||
|
||||
return redirect()->back()
|
||||
->with('success','Product saved');
|
||||
}
|
||||
|
Reference in New Issue
Block a user