mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Merge pull request #6726 from turbo124/v5-develop
Adjust injection of flutter build
This commit is contained in:
commit
c299a0fdde
@ -765,6 +765,9 @@ class BaseController extends Controller
|
||||
if(request()->has('build')) {
|
||||
$build = request()->input('build');
|
||||
}
|
||||
elseif(Ninja::isHosted()){
|
||||
return 'main.dart.js';
|
||||
}
|
||||
|
||||
switch ($build) {
|
||||
case 'wasm':
|
||||
@ -778,11 +781,8 @@ class BaseController extends Controller
|
||||
case 'profile':
|
||||
return 'main.profile.dart.js';
|
||||
default:
|
||||
return 'main.foss.dart.js';
|
||||
|
||||
if(Ninja::isSelfHost())
|
||||
return 'main.foss.dart.js';
|
||||
|
||||
return 'main.dart.js';
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ namespace App\Http\Controllers;
|
||||
|
||||
use App\Filters\DocumentFilters;
|
||||
use App\Http\Requests\Document\DestroyDocumentRequest;
|
||||
use App\Http\Requests\Document\EditDocumentRequest;
|
||||
use App\Http\Requests\Document\ShowDocumentRequest;
|
||||
use App\Http\Requests\Document\StoreDocumentRequest;
|
||||
use App\Http\Requests\Document\UpdateDocumentRequest;
|
||||
@ -114,9 +115,16 @@ class DocumentController extends BaseController
|
||||
|
||||
public function download(ShowDocumentRequest $request, Document $document)
|
||||
{
|
||||
|
||||
$headers = [];
|
||||
|
||||
if(request()->input('inline') == 'true')
|
||||
$headers = array_merge($headers, ['Content-Disposition' => 'inline']);
|
||||
|
||||
return response()->streamDownload(function () use ($document) {
|
||||
echo file_get_contents($document->generateUrl());
|
||||
}, basename($document->generateUrl()));
|
||||
}, basename($document->generateUrl()), $headers);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -126,7 +134,7 @@ class DocumentController extends BaseController
|
||||
* @param Document $document
|
||||
* @return Response
|
||||
*/
|
||||
public function edit(EditDocumentRegquest $request, Document $document)
|
||||
public function edit(EditDocumentRequest $request, Document $document)
|
||||
{
|
||||
return $this->itemResponse($document);
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ namespace App\Jobs\Util;
|
||||
|
||||
use App\Jobs\Util\SystemLogger;
|
||||
use App\Libraries\MultiDB;
|
||||
use App\Models\Client as ClientModel;
|
||||
use App\Models\SystemLog;
|
||||
use App\Models\Webhook;
|
||||
use App\Transformers\ArraySerializer;
|
||||
@ -147,11 +148,12 @@ class WebhookHandler implements ShouldQueue
|
||||
|
||||
private function resolveClient()
|
||||
{
|
||||
if($this->entity->client()->exists()){
|
||||
//make sure it isn't an instance of the Client Model
|
||||
if((!$this->entity instanceof ClientModel) && $this->entity->client()->exists()){
|
||||
return $this->entity->client;
|
||||
}
|
||||
|
||||
return $this->company->clients->first();
|
||||
return $this->company->clients()->first();
|
||||
}
|
||||
|
||||
public function failed($exception)
|
||||
|
@ -287,7 +287,7 @@ class BaseDriver extends AbstractPaymentDriver
|
||||
|
||||
$invoices->each(function ($invoice) use ($fee_total) {
|
||||
if (collect($invoice->line_items)->contains('type_id', '3')) {
|
||||
$invoice->service()->toggleFeesPaid()->deletePdf()->save();
|
||||
$invoice->service()->toggleFeesPaid()->save();
|
||||
$invoice->client->service()->updateBalance($fee_total)->save();
|
||||
$invoice->ledger()->updateInvoiceBalance($fee_total, "Gateway fee adjustment for invoice {$invoice->number}");
|
||||
}
|
||||
|
@ -47,6 +47,8 @@ class InvoiceService
|
||||
*/
|
||||
public function markPaid()
|
||||
{
|
||||
$this->removeUnpaidGatewayFees();
|
||||
|
||||
$this->invoice = (new MarkPaid($this->invoice))->run();
|
||||
|
||||
return $this;
|
||||
|
@ -27,8 +27,11 @@ class InvoiceHistoryTransformer extends EntityTransformer
|
||||
'activity',
|
||||
];
|
||||
|
||||
public function transform(Backup $backup)
|
||||
public function transform(?Backup $backup)
|
||||
{
|
||||
if(!$backup)
|
||||
return [];
|
||||
|
||||
return [
|
||||
'id' => $this->encodePrimaryKey($backup->id),
|
||||
'activity_id' => $this->encodePrimaryKey($backup->activity_id),
|
||||
|
Loading…
x
Reference in New Issue
Block a user