mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-03 17:54:38 -04:00
Fixes for preview
This commit is contained in:
parent
564278a6c8
commit
1195838ded
@ -172,8 +172,9 @@ class PreviewController extends BaseController
|
|||||||
$company = auth()->user()->company();
|
$company = auth()->user()->company();
|
||||||
|
|
||||||
MultiDB::setDb($company->db);
|
MultiDB::setDb($company->db);
|
||||||
|
DB::connection($company->db)->reconnect();
|
||||||
info("preview db = ".$company->db);
|
info("preview db = ".$company->db);
|
||||||
|
info(config('database.connections.db-ninja-01.database'));
|
||||||
|
|
||||||
if($request->input('entity') == 'invoice'){
|
if($request->input('entity') == 'invoice'){
|
||||||
$repo = new InvoiceRepository();
|
$repo = new InvoiceRepository();
|
||||||
@ -200,6 +201,7 @@ class PreviewController extends BaseController
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
DB::connection(config('database.default'))->beginTransaction();
|
||||||
|
|
||||||
if($request->has('entity_id')){
|
if($request->has('entity_id')){
|
||||||
|
|
||||||
@ -211,8 +213,6 @@ class PreviewController extends BaseController
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DB::connection(config('database.default'))->beginTransaction();
|
|
||||||
|
|
||||||
$entity_obj = $repo->save($request->all(), $entity_obj);
|
$entity_obj = $repo->save($request->all(), $entity_obj);
|
||||||
|
|
||||||
$entity_obj->load('client');
|
$entity_obj->load('client');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user