Inuit sync of tax, product accounting, accounts and invoices

This commit is contained in:
Deon George
2023-05-12 20:09:51 +10:00
parent e2d8f8a096
commit ad2f6f3a7f
22 changed files with 707 additions and 144 deletions

View File

@@ -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');
}