mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Minor fixes
This commit is contained in:
parent
2fd807f213
commit
60452278b5
@ -164,15 +164,15 @@ class PreviewController extends BaseController
|
||||
|
||||
$entity = ucfirst(request()->input('entity'));
|
||||
|
||||
$class = "App\Models\\$entity";
|
||||
// $class = "App\Models\\$entity";
|
||||
|
||||
$entity_obj = $class::whereId($this->decodePrimaryKey(request()->input('entity_id')))->company()->first();
|
||||
// $entity_obj = $class::whereId($this->decodePrimaryKey(request()->input('entity_id')))->company()->first();
|
||||
|
||||
if (! $entity_obj) {
|
||||
// if (! $entity_obj) {
|
||||
|
||||
$entity_obj = $repo->save(request()->all(), $factory);
|
||||
|
||||
}
|
||||
// }
|
||||
|
||||
$entity_obj->load('client');
|
||||
|
||||
|
@ -300,7 +300,7 @@ class BaseRepository
|
||||
$model->partial = min($model->amount, $model->balance);
|
||||
|
||||
/* Update product details if necessary */
|
||||
if ($model->company->update_products)
|
||||
if ($model->company->update_products && $model->id)
|
||||
UpdateOrCreateProduct::dispatch($model->line_items, $model, $model->company);
|
||||
|
||||
/* Perform model specific tasks */
|
||||
|
Loading…
x
Reference in New Issue
Block a user