1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-14 07:02:34 +01:00

Merge pull request #9640 from turbo124/v5-develop

v5.9.6
This commit is contained in:
David Bomba 2024-06-16 08:31:35 +10:00 committed by GitHub
commit b4ab9a2e1c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
380 changed files with 2868 additions and 2135 deletions

View File

@ -1 +1 @@
5.9.5
5.9.6

View File

@ -478,10 +478,9 @@ class CheckData extends Command
} else {
$this->logMessage("No contact present, so cannot add invitation for {$entity_key} - {$entity->id}");
try{
try {
$entity->service()->createInvitations()->save();
}
catch(\Exception $e){
} catch(\Exception $e) {
}
@ -949,12 +948,12 @@ class CheckData extends Command
});
Company::whereDoesntHave('company_users', function ($query){
Company::whereDoesntHave('company_users', function ($query) {
$query->where('is_owner', 1);
})
->cursor()
->when(Ninja::isHosted())
->each(function ($c){
->each(function ($c) {
$this->logMessage("Orphan Account # {$c->account_id}");
@ -963,7 +962,7 @@ class CheckData extends Command
CompanyUser::whereDoesntHave('tokens')
->cursor()
->when(Ninja::isHosted())
->each(function ($cu){
->each(function ($cu) {
$this->logMessage("Missing tokens for Company User # {$cu->id}");

View File

@ -0,0 +1,61 @@
<?php
/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/
namespace App\DataMapper\Analytics;
use Turbo124\Beacon\ExampleMetric\GenericMixedMetric;
class LoginMeta extends GenericMixedMetric
{
/**
* The type of Sample.
*
* Monotonically incrementing counter
*
* - counter
*
* @var string
*/
public $type = 'mixed_metric';
/**
* The name of the counter.
* @var string
*/
public $name = 'login.meta';
/**
* The datetime of the counter measurement.
*
* date("Y-m-d H:i:s")
*
*/
public $datetime;
/**
* The Class failure name
* set to 0.
*
* @var string
*/
public $string_metric5 = 'email';
public $string_metric6 = 'ip';
public $string_metric7 = 'result';
public $int_metric1 = 1;
public function __construct($string_metric5, $string_metric6, $string_metric7)
{
$this->string_metric7 = $string_metric7;
$this->string_metric6 = $string_metric6;
$this->string_metric5 = $string_metric5;
}
}

View File

@ -15,7 +15,6 @@ use App\DataMapper\InvoiceItem;
class PayPalBalanceAffecting
{
private array $key_map = [
'Date' => 'date',
'Time' => 'time',
@ -106,7 +105,9 @@ class PayPalBalanceAffecting
public $creditTransactionalFee;
public $originalInvoiceId;
public function __construct(private array $import_row){}
public function __construct(private array $import_row)
{
}
public function run(): self
{
@ -116,7 +117,7 @@ class PayPalBalanceAffecting
$prop = $this->key_map[$key] ?? false;
if($prop){
if($prop) {
echo "Setting {$prop} to {$value}".PHP_EOL;
$this->{$prop} = $value;
@ -130,7 +131,7 @@ class PayPalBalanceAffecting
private function cleanUp(): self
{
foreach($this->key_map as $value){
foreach($this->key_map as $value) {
echo "Setting {$value} to null".PHP_EOL;
$this->{$value} = null;
}
@ -154,7 +155,7 @@ class PayPalBalanceAffecting
public function getInvoice(): array
{
$item = new InvoiceItem;
$item = new InvoiceItem();
$item->cost = $this->gross ?? 0;
$item->product_key = $this->itemId ?? '';
$item->notes = $this->subject ?? $this->itemDetails;
@ -162,7 +163,7 @@ class PayPalBalanceAffecting
return [
'number' => trim($this->invoiceNumber ?? $this->transactionId),
'date' => str_replace('/','-', $this->date ?? ''),
'date' => str_replace('/', '-', $this->date ?? ''),
'line_items' => [$item],
'name' => $this->name ?? '',
'email' => $this->fromEmailAddress ?? '',
@ -174,12 +175,10 @@ class PayPalBalanceAffecting
{
$name_parts = explode(" ", $this->name ?? '');
if(count($name_parts) == 2)
{
if(count($name_parts) == 2) {
$contact['first_name'] = $name_parts[0];
$contact['last_name'] = $name_parts[1];
}
else {
} else {
$contact['first_name'] = $this->name ?? '';
}
@ -203,13 +202,15 @@ class PayPalBalanceAffecting
private function returnShippingAddress(): array
{
if(strlen($this->shippingAddress ?? '') <3)
if(strlen($this->shippingAddress ?? '') < 3) {
return [];
}
$ship_parts = explode(",", $this->shippingAddress);
if(count($ship_parts) != 7)
if(count($ship_parts) != 7) {
return [];
}
return [
'shipping_address1' => $ship_parts[2],

View File

@ -1030,7 +1030,7 @@ class BaseExport
$status_parameters = explode(',', $status);
if (in_array('all', $status_parameters) || count($status_parameters) == 0){
if (in_array('all', $status_parameters) || count($status_parameters) == 0) {
return $query;
}

View File

@ -127,8 +127,9 @@ class ClientExport extends BaseExport
->withTrashed()
->where('company_id', $this->company->id);
if(!$this->input['include_deleted'] ?? false)
if(!$this->input['include_deleted'] ?? false) {
$query->where('is_deleted', 0);
}
$query = $this->addDateRange($query);

View File

@ -59,7 +59,7 @@ class ContactExport extends BaseExport
$query = ClientContact::query()
->where('company_id', $this->company->id)
->whereHas('client', function ($q){
->whereHas('client', function ($q) {
$q->where('is_deleted', false);
});

View File

@ -102,7 +102,7 @@ class CreditExport extends BaseExport
$query = Credit::query()
->withTrashed()
->with('client')
->whereHas('client', function ($q){
->whereHas('client', function ($q) {
$q->where('is_deleted', false);
})
->where('company_id', $this->company->id)

View File

@ -85,7 +85,7 @@ class ExpenseExport extends BaseExport
->where('company_id', $this->company->id);
if(!$this->input['include_deleted'] ?? false){
if(!$this->input['include_deleted'] ?? false) {
$query->where('is_deleted', 0);
}

View File

@ -57,13 +57,13 @@ class InvoiceExport extends BaseExport
$query = Invoice::query()
->withTrashed()
->with('client')
->whereHas('client', function ($q){
->whereHas('client', function ($q) {
$q->where('is_deleted', false);
})
->where('company_id', $this->company->id);
if(!$this->input['include_deleted'] ?? false){
if(!$this->input['include_deleted'] ?? false) {
$query->where('is_deleted', 0);
}

View File

@ -70,12 +70,12 @@ class InvoiceItemExport extends BaseExport
$query = Invoice::query()
->withTrashed()
->with('client')
->whereHas('client', function ($q){
->whereHas('client', function ($q) {
$q->where('is_deleted', false);
})
->where('company_id', $this->company->id);
if(!$this->input['include_deleted'] ?? false){
if(!$this->input['include_deleted'] ?? false) {
$query->where('is_deleted', 0);
}

View File

@ -56,7 +56,7 @@ class PaymentExport extends BaseExport
$query = Payment::query()
->withTrashed()
->whereHas('client', function ($q){
->whereHas('client', function ($q) {
$q->where('is_deleted', false);
})
->where('company_id', $this->company->id)

View File

@ -76,7 +76,7 @@ class ProductExport extends BaseExport
->where('company_id', $this->company->id);
if(!$this->input['include_deleted'] ?? false){
if(!$this->input['include_deleted'] ?? false) {
$query->where('is_deleted', 0);
}

View File

@ -25,6 +25,7 @@ class ProductSalesExport extends BaseExport
{
public string $date_key = 'created_at';
/** @var Collection<\App\Models\Product> $products*/
protected Collection $products;
public Writer $csv;
@ -86,7 +87,7 @@ class ProductSalesExport extends BaseExport
if ($product_keys && !empty($this->input['product_key'])) {
$keys = explode(",", $product_keys);
$query->where(function ($q) use ($keys){
$query->where(function ($q) use ($keys) {
foreach($keys as $key) {
$q->orWhereJsonContains('line_items', ['product_key' => $key]);
@ -121,7 +122,7 @@ class ProductSalesExport extends BaseExport
//insert the header
$query = Invoice::query()
->withTrashed()
->whereHas('client', function ($q){
->whereHas('client', function ($q) {
$q->where('is_deleted', false);
})
->where('company_id', $this->company->id)
@ -138,20 +139,19 @@ class ProductSalesExport extends BaseExport
$product_keys = &$this->input['product_key'];
if($product_keys){
if($product_keys) {
$product_keys = explode(",", $product_keys);
}
$query->cursor()
->each(function ($invoice) use($product_keys) {
->each(function ($invoice) use ($product_keys) {
foreach ($invoice->line_items as $item) {
if($product_keys)
{
if(in_array($item->product_key, $product_keys))
if($product_keys) {
if(in_array($item->product_key, $product_keys)) {
$this->csv->insertOne($this->buildRow($invoice, $item));
}
else {
} else {
$this->csv->insertOne($this->buildRow($invoice, $item));
}
@ -159,9 +159,9 @@ class ProductSalesExport extends BaseExport
});
$grouped = $this->sales->groupBy('product_key')->map(function ($key, $value) use($product_keys){
$grouped = $this->sales->groupBy('product_key')->map(function ($key, $value) use ($product_keys) {
if($product_keys && !in_array($value, $product_keys)){
if($product_keys && !in_array($value, $product_keys)) {
return false;
}
@ -185,7 +185,8 @@ class ProductSalesExport extends BaseExport
})->reject(function ($value) {
return $value === false;
});;
});
;
$this->csv->insertOne([]);
$this->csv->insertOne([]);
@ -327,9 +328,9 @@ class ProductSalesExport extends BaseExport
* getProduct
*
* @param string $product_key
* @return Product
* @return ?\Illuminate\Database\Eloquent\Model
*/
private function getProduct(string $product_key): ?Product
private function getProduct(string $product_key)
{
return $this->products->firstWhere('product_key', $product_key);
}

View File

@ -58,12 +58,12 @@ class PurchaseOrderExport extends BaseExport
$query = PurchaseOrder::query()
->withTrashed()
->with('vendor')
->whereHas('vendor', function ($q){
->whereHas('vendor', function ($q) {
$q->where('is_deleted', false);
})
->where('company_id', $this->company->id);
if(!$this->input['include_deleted'] ?? false){
if(!$this->input['include_deleted'] ?? false) {
$query->where('is_deleted', 0);
}
@ -72,8 +72,9 @@ class PurchaseOrderExport extends BaseExport
$clients = &$this->input['client_id'];
if($clients)
if($clients) {
$query = $this->addClientFilter($query, $clients);
}
$query = $this->addPurchaseOrderStatusFilter($query, $this->input['status'] ?? '');

View File

@ -62,12 +62,12 @@ class PurchaseOrderItemExport extends BaseExport
$query = PurchaseOrder::query()
->withTrashed()
->whereHas('vendor', function ($q){
->whereHas('vendor', function ($q) {
$q->where('is_deleted', false);
})
->with('vendor')->where('company_id', $this->company->id);
if(!$this->input['include_deleted'] ?? false){
if(!$this->input['include_deleted'] ?? false) {
$query->where('is_deleted', 0);
}

View File

@ -64,12 +64,12 @@ class QuoteExport extends BaseExport
$query = Quote::query()
->withTrashed()
->with('client')
->whereHas('client', function ($q){
->whereHas('client', function ($q) {
$q->where('is_deleted', false);
})
->where('company_id', $this->company->id);
if(!$this->input['include_deleted'] ?? false){
if(!$this->input['include_deleted'] ?? false) {
$query->where('is_deleted', 0);
}

View File

@ -65,12 +65,12 @@ class QuoteItemExport extends BaseExport
$query = Quote::query()
->withTrashed()
->whereHas('client', function ($q){
->whereHas('client', function ($q) {
$q->where('is_deleted', false);
})
->with('client')->where('company_id', $this->company->id);
if(!$this->input['include_deleted'] ?? false){
if(!$this->input['include_deleted'] ?? false) {
$query->where('is_deleted', 0);
}

View File

@ -56,12 +56,12 @@ class RecurringInvoiceExport extends BaseExport
$query = RecurringInvoice::query()
->withTrashed()
->with('client')
->whereHas('client', function ($q){
->whereHas('client', function ($q) {
$q->where('is_deleted', false);
})
->where('company_id', $this->company->id);
if(!$this->input['include_deleted'] ?? false){
if(!$this->input['include_deleted'] ?? false) {
$query->where('is_deleted', 0);
}

View File

@ -70,7 +70,7 @@ class TaskExport extends BaseExport
->withTrashed()
->where('company_id', $this->company->id);
if(!$this->input['include_deleted'] ?? false){
if(!$this->input['include_deleted'] ?? false) {
$query->where('is_deleted', 0);
}
@ -78,13 +78,15 @@ class TaskExport extends BaseExport
$clients = &$this->input['client_id'];
if($clients)
if($clients) {
$query = $this->addClientFilter($query, $clients);
}
$document_attachments = &$this->input['document_email_attachment'];
if($document_attachments)
if($document_attachments) {
$this->queueDocuments($query);
}
return $query;

View File

@ -64,7 +64,7 @@ class VendorExport extends BaseExport
->withTrashed()
->where('company_id', $this->company->id);
if(!$this->input['include_deleted'] ?? false){
if(!$this->input['include_deleted'] ?? false) {
$query->where('is_deleted', 0);
}

View File

@ -23,14 +23,13 @@ class BankIntegrationFactory
$bank_integration->company_id = $company_id;
$bank_integration->provider_name = '';
$bank_integration->bank_account_id = '';
$bank_integration->bank_account_name = '';
$bank_integration->bank_account_number = '';
$bank_integration->bank_account_status = '';
$bank_integration->bank_account_type = '';
$bank_integration->balance = 0;
$bank_integration->currency = '';
$bank_integration->auto_sync = 1;
$bank_integration->auto_sync = true;
return $bank_integration;
}

View File

@ -29,7 +29,7 @@ class ClientFactory
$client->balance = 0;
$client->paid_to_date = 0;
$client->country_id = null;
$client->is_deleted = 0;
$client->is_deleted = false;
$client->client_hash = Str::random(40);
$client->settings = ClientSettings::defaults();
$client->classification = '';

View File

@ -33,7 +33,7 @@ class CloneQuoteToProjectFactory
$project->custom_value2 = '';
$project->custom_value3 = '';
$project->custom_value4 = '';
$project->is_deleted = 0;
$project->is_deleted = false;
return $project;
}

View File

@ -48,7 +48,7 @@ class CompanyFactory
$company->markdown_email_enabled = true;
$company->markdown_enabled = false;
$company->tax_data = new TaxModel();
$company->first_month_of_year = 1;
$company->first_month_of_year = '1';
$company->smtp_encryption = 'tls';
$company->smtp_host = '';
$company->smtp_local_domain = '';

View File

@ -23,7 +23,7 @@ class SubscriptionFactory
$billing_subscription->company_id = $company_id;
$billing_subscription->user_id = $user_id;
$billing_subscription->steps = collect(Purchase::defaultSteps())
->map(fn($step) => StepService::mapClassNameToString($step))
->map(fn ($step) => StepService::mapClassNameToString($step))
->implode(',');
return $billing_subscription;

View File

@ -20,7 +20,7 @@ class TaxRateFactory
$tax_rate = new TaxRate();
$tax_rate->name = '';
$tax_rate->rate = '';
$tax_rate->rate = 0;
$tax_rate->company_id = $company_id;
$tax_rate->user_id = $user_id;

View File

@ -26,7 +26,7 @@ class VendorFactory
$vendor->private_notes = '';
$vendor->public_notes = '';
$vendor->country_id = 4;
$vendor->is_deleted = 0;
$vendor->is_deleted = false;
$vendor->vendor_hash = Str::random(40);
// $vendor->classification = '';

View File

@ -115,6 +115,29 @@ class BankTransactionFilters extends QueryFilters
return $this->builder;
}
/**
* Filters the list based on Bank Accounts.
*
* @param string $ids Comma Separated List of bank account ids
* @return Builder
*/
public function bank_integration_ids(string $ids = ''): Builder
{
if(strlen($ids) == 0) {
return $this->builder;
}
$ids = $this->transformKeys(explode(",", $ids));
$this->builder->where(function ($query) use ($ids) {
$query->whereIn('bank_integration_id', $ids);
});
return $this->builder;
}
/**
* Sorts the list based on $sort.
*

View File

@ -160,8 +160,9 @@ class ClientFilters extends QueryFilters
return $this->builder;
}
if($sort_col[0] == 'documents')
if($sort_col[0] == 'documents') {
return $this->builder;
}
if ($sort_col[0] == 'display_name') {
$sort_col[0] = 'name';

View File

@ -59,8 +59,9 @@ class DesignFilters extends QueryFilters
public function entities(string $entities = ''): Builder
{
if(stripos($entities, 'statement') !== false)
if(stripos($entities, 'statement') !== false) {
$entities = 'client';
}
if (strlen($entities) == 0 || str_contains($entities, ',')) {
return $this->builder;

View File

@ -74,8 +74,7 @@ class DocumentFilters extends QueryFilters
{
$types = explode(',', $types);
foreach ($types as $type)
{
foreach ($types as $type) {
match($type) {
'private' => $this->builder->where('is_public', 0),
'public' => $this->builder->where('is_public', 1),

View File

@ -111,8 +111,8 @@ class ExpenseFilters extends QueryFilters
});
}
if(in_array('uncategorized', $status_parameters)){
$query->orWhere(function ($query){
if(in_array('uncategorized', $status_parameters)) {
$query->orWhere(function ($query) {
$query->whereNull('category_id');
});
}

View File

@ -228,10 +228,9 @@ class InvoiceFilters extends QueryFilters
$date = Carbon::createFromTimestamp((int)$date);
} else {
try{
try {
$date = Carbon::parse($date);
}
catch(\Exception $e){
} catch(\Exception $e) {
return $this->builder;
}
}

View File

@ -133,7 +133,7 @@ class RecurringInvoiceFilters extends QueryFilters
return $this->builder->orderByRaw("REGEXP_REPLACE(number,'[^0-9]+','')+0 " . $dir);
}
if($sort_col[0] == 'next_send_datetime'){
if($sort_col[0] == 'next_send_datetime') {
$sort_col[0] = 'next_send_date';
}

View File

@ -152,8 +152,9 @@ class Nordigen
{
$cache_key = "email_quota:{$bank_integration->company->company_key}:{$bank_integration->id}";
if(Cache::has($cache_key))
if(Cache::has($cache_key)) {
return;
}
App::setLocale($bank_integration->company->getLocale());

View File

@ -71,7 +71,7 @@ class TransactionTransformer implements BankRevenueInterface
private Company $company;
function __construct(Company $company)
public function __construct(Company $company)
{
$this->company = $company;
}

View File

@ -35,7 +35,8 @@ trait CustomValuer
return 0;
}
public function multiInclusiveTax($custom_value, $has_custom_invoice_taxes) {
public function multiInclusiveTax($custom_value, $has_custom_invoice_taxes)
{
if (isset($custom_value) && is_numeric($custom_value) && $has_custom_invoice_taxes !== false) {
@ -45,7 +46,7 @@ trait CustomValuer
$tax += $this->formatValue($custom_value - ($custom_value / (1 + ($this->invoice->tax_rate2 / 100))), 2);
$tax += $this->formatValue($custom_value - ($custom_value / (1 + ($this->invoice->tax_rate3 / 100))), 2);
return round($tax,2);
return round($tax, 2);
}
return 0;

View File

@ -245,10 +245,9 @@ class InvoiceSum
*/
private function setCalculatedAttributes(): self
{
if($this->invoice->status_id == Invoice::STATUS_CANCELLED){
if($this->invoice->status_id == Invoice::STATUS_CANCELLED) {
$this->invoice->balance = 0;
}
elseif ($this->invoice->status_id != Invoice::STATUS_DRAFT) {
} elseif ($this->invoice->status_id != Invoice::STATUS_DRAFT) {
if ($this->invoice->amount != $this->invoice->balance) {
$this->invoice->balance = Number::roundValue($this->getTotal(), $this->precision) - $this->invoice->paid_to_date; //21-02-2024 cannot use the calculated $paid_to_date here as it could send the balance backward.
} else {
@ -258,7 +257,7 @@ class InvoiceSum
/* Set new calculated total */
$this->invoice->amount = $this->formatValue($this->getTotal(), $this->precision);
if($this->rappen_rounding){
if($this->rappen_rounding) {
$this->invoice->amount = $this->roundRappen($this->invoice->amount);
$this->invoice->balance = $this->roundRappen($this->invoice->balance);
}
@ -269,7 +268,7 @@ class InvoiceSum
}
function roundRappen($value): float
public function roundRappen($value): float
{
return round($value / .05, 0) * .05;
}

View File

@ -279,10 +279,9 @@ class InvoiceSumInclusive
private function setCalculatedAttributes()
{
/* If amount != balance then some money has been paid on the invoice, need to subtract this difference from the total to set the new balance */
if($this->invoice->status_id == Invoice::STATUS_CANCELLED){
if($this->invoice->status_id == Invoice::STATUS_CANCELLED) {
$this->invoice->balance = 0;
}
elseif ($this->invoice->status_id != Invoice::STATUS_DRAFT) {
} elseif ($this->invoice->status_id != Invoice::STATUS_DRAFT) {
if ($this->invoice->amount != $this->invoice->balance) {
$this->invoice->balance = $this->formatValue($this->getTotal(), $this->precision) - $this->invoice->paid_to_date;
} else {
@ -303,7 +302,7 @@ class InvoiceSumInclusive
return $this;
}
function roundRappen($value): float
public function roundRappen($value): float
{
return round($value / .05, 0) * .05;
}

View File

@ -34,7 +34,7 @@ class GmailTransport extends AbstractTransport
$message = MessageConverter::toEmail($message->getOriginalMessage());
/** @phpstan-ignore-next-line **/
$token = $message->getHeaders()->get('gmailtoken')->getValue();
$token = $message->getHeaders()->get('gmailtoken')->getValue(); // @phpstan-ignore-line
$message->getHeaders()->remove('gmailtoken');
$client = new Client();
@ -53,9 +53,8 @@ class GmailTransport extends AbstractTransport
if ($bccs) {
$bcc_list = 'Bcc: ';
/** @phpstan-ignore-next-line **/
foreach ($bccs->getAddresses() as $address) {
$bcc_list .= $address->getAddress() .',';
}

View File

@ -55,7 +55,7 @@ class Office365MailTransport extends AbstractTransport
->execute();
} catch (\Exception $e) {
sleep(rand(5,10));
sleep(rand(5, 10));
try {
$graphMessage = $graph->createRequest('POST', '/users/'.$symfony_message->getFrom()[0]->getAddress().'/sendmail')

View File

@ -61,7 +61,7 @@ class AccountController extends BaseController
* Store a newly created resource in storage.
*
* @param CreateAccountRequest $request
* @return Response
* @return \Illuminate\Http\JsonResponse|\Illuminate\Http\Response
*
*/
public function store(CreateAccountRequest $request)

View File

@ -105,6 +105,14 @@ class ActivityController extends BaseController
}
/**
* downloadHistoricalEntity
*
* @param DownloadHistoricalEntityRequest $request
* @param Activity $activity
* @return \Symfony\Component\HttpFoundation\StreamedResponse | \Illuminate\Http\JsonResponse
*/
public function downloadHistoricalEntity(DownloadHistoricalEntityRequest $request, Activity $activity)
{
$backup = $activity->backup;

View File

@ -46,7 +46,7 @@ class ForgotPasswordController extends Controller
/**
* @param Request $request
* @return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse
* @return \Illuminate\Http\JsonResponse|\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
* @throws \Illuminate\Validation\ValidationException
*/
public function sendResetLinkEmail(Request $request)

View File

@ -13,6 +13,7 @@
namespace App\Http\Controllers\Auth;
use App\DataMapper\Analytics\LoginFailure;
use App\DataMapper\Analytics\LoginMeta;
use App\DataMapper\Analytics\LoginSuccess;
use App\Events\User\UserLoggedIn;
use App\Http\Controllers\BaseController;
@ -111,6 +112,9 @@ class LoginController extends BaseController
->increment()
->batch();
LightLogs::create(new LoginMeta($request->email, $request->ip, 'success'))
->batch();
/** @var \App\Models\User $user */
$user = $this->guard()->user();
@ -159,6 +163,9 @@ class LoginController extends BaseController
->increment()
->batch();
LightLogs::create(new LoginMeta($request->email, $request->ip, 'failure'))
->batch();
$this->incrementLoginAttempts($request);
return response()
@ -172,7 +179,7 @@ class LoginController extends BaseController
* Refreshes the data feed with the current Company User.
*
* @param Request $request
* @return Response|JsonResponse
* @return \Illuminate\Http\Response|JsonResponse
*/
public function refresh(Request $request)
{
@ -391,8 +398,8 @@ class LoginController extends BaseController
$truth->setCompany($set_company);
//21-03-2024
$cu->each(function ($cu){
if(CompanyToken::where('company_id', $cu->company_id)->where('user_id', $cu->user_id)->where('is_system', true)->doesntExist()){
$cu->each(function ($cu) {
if(CompanyToken::where('company_id', $cu->company_id)->where('user_id', $cu->user_id)->where('is_system', true)->doesntExist()) {
(new CreateCompanyToken($cu->company, $cu->user, request()->server('HTTP_USER_AGENT')))->handle();
}
});
@ -481,7 +488,7 @@ class LoginController extends BaseController
* send login response to oauthed users
*
* @param \App\Models\User $existing_user
* @return Response | JsonResponse
* @return Response| \Illuminate\Http\JsonResponse | JsonResponse
*/
private function existingOauthUser($existing_user)
{
@ -651,7 +658,9 @@ class LoginController extends BaseController
}
if(request()->hasHeader('X-REACT') || request()->query('react')) {
Cache::put("react_redir:".auth()->user()?->account->key, 'true', 300);
/**@var \App\Models\User $user */
$user = auth()->user();
Cache::put("react_redir:".$user?->account->key, 'true', 300);
}
if (request()->has('code')) {

View File

@ -78,7 +78,7 @@ class ResetPasswordController extends Controller
* Reset the given user's password.
*
* @param Request $request
* @return RedirectResponse|JsonResponse
* @return \Illuminate\Http\RedirectResponse | \Illuminate\Http\RedirectResponse|JsonResponse
* @throws \Illuminate\Validation\ValidationException
*/
public function reset(Request $request)

View File

@ -310,7 +310,7 @@ class YodleeController extends BaseController
private function transformSummary($summary): array
{
$dto = new \stdClass;
$dto = new \stdClass();
$dto->id = $summary['id'] ?? 0;
$dto->account_type = $summary['CONTAINER'] ?? '';

View File

@ -55,7 +55,7 @@ class BankIntegrationController extends BaseController
/**
* @param BankIntegrationFilters $filters
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*/
public function index(BankIntegrationFilters $filters)
{
@ -69,7 +69,7 @@ class BankIntegrationController extends BaseController
*
* @param ShowBankIntegrationRequest $request
* @param BankIntegration $bank_integration
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*/
public function show(ShowBankIntegrationRequest $request, BankIntegration $bank_integration)
@ -83,7 +83,7 @@ class BankIntegrationController extends BaseController
*
* @param EditBankIntegrationRequest $request
* @param BankIntegration $bank_integration
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*/
public function edit(EditBankIntegrationRequest $request, BankIntegration $bank_integration)
@ -96,7 +96,7 @@ class BankIntegrationController extends BaseController
*
* @param UpdateBankIntegrationRequest $request
* @param BankIntegration $bank_integration
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*/
public function update(UpdateBankIntegrationRequest $request, BankIntegration $bank_integration)
@ -111,7 +111,7 @@ class BankIntegrationController extends BaseController
* Show the form for creating a new resource.
*
* @param CreateBankIntegrationRequest $request
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
*/
@ -130,7 +130,7 @@ class BankIntegrationController extends BaseController
* Store a newly created resource in storage.
*
* @param StoreBankIntegrationRequest $request
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*/
public function store(StoreBankIntegrationRequest $request)
@ -150,7 +150,7 @@ class BankIntegrationController extends BaseController
*
* @param DestroyBankIntegrationRequest $request
* @param BankIntegration $bank_integration
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
* @throws \Exception
*/
@ -165,7 +165,7 @@ class BankIntegrationController extends BaseController
/**
* Perform bulk actions on the list view.
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*/
public function bulk(BulkBankIntegrationRequest $request)
@ -295,7 +295,7 @@ class BankIntegrationController extends BaseController
* Return the remote list of accounts stored on the third party provider
* and update our local cache.
*
* @return Response | JsonResponse
* @return Response| \Illuminate\Http\JsonResponse | JsonResponse
*
*/

View File

@ -85,7 +85,7 @@ class BankTransactionRuleController extends BaseController
* ),
* )
* @param BankTransactionRuleFilters $filters
* @return Response|mixed
* @return Response| \Illuminate\Http\JsonResponse|mixed
*/
public function index(BankTransactionRuleFilters $filters)
{
@ -99,7 +99,7 @@ class BankTransactionRuleController extends BaseController
*
* @param ShowBankTransactionRuleRequest $request
* @param BankTransactionRule $bank_transaction_rule
* @return \Illuminate\Http\JsonResponse
* @return \Illuminate\Http\JsonResponse|\Illuminate\Http\Response|\Illuminate\Http\Response
*
*
* @OA\Get(
@ -154,7 +154,7 @@ class BankTransactionRuleController extends BaseController
*
* @param EditBankTransactionRuleRequest $request
* @param BankTransactionRule $bank_transaction_rule
* @return \Illuminate\Http\JsonResponse
* @return \Illuminate\Http\JsonResponse|\Illuminate\Http\Response
*
*
* @OA\Get(
@ -208,7 +208,7 @@ class BankTransactionRuleController extends BaseController
*
* @param UpdateBankTransactionRuleRequest $request
* @param BankTransactionRule $bank_transaction_rule
* @return \Illuminate\Http\JsonResponse
* @return \Illuminate\Http\JsonResponse|\Illuminate\Http\Response
*
*
*
@ -269,7 +269,7 @@ class BankTransactionRuleController extends BaseController
* Show the form for creating a new resource.
*
* @param CreateBankTransactionRuleRequest $request
* @return \Illuminate\Http\JsonResponse
* @return \Illuminate\Http\JsonResponse|\Illuminate\Http\Response
*
*
*
@ -317,7 +317,7 @@ class BankTransactionRuleController extends BaseController
* Store a newly created resource in storage.
*
* @param StoreBankTransactionRuleRequest $request
* @return \Illuminate\Http\JsonResponse
* @return \Illuminate\Http\JsonResponse|\Illuminate\Http\Response
*
*
*
@ -369,7 +369,7 @@ class BankTransactionRuleController extends BaseController
*
* @param DestroyBankTransactionRuleRequest $request
* @param BankTransactionRule $bank_transaction_rule
* @return \Illuminate\Http\JsonResponse
* @return \Illuminate\Http\JsonResponse|\Illuminate\Http\Response
*
*
* @throws \Exception
@ -424,7 +424,7 @@ class BankTransactionRuleController extends BaseController
/**
* Perform bulk actions on the list view.
*
* @return \Illuminate\Support\Collection
* @return \Illuminate\Http\Response|\Illuminate\Http\JsonResponse
*
* @OA\Post(
* path="/api/v1/bank_transation_rules/bulk",

View File

@ -262,7 +262,7 @@ class BaseController extends Controller
/**
* 404 for the client portal.
* @return Response 404 response
* @return Response| \Illuminate\Http\JsonResponse 404 response
*/
public function notFoundClient()
{
@ -279,7 +279,7 @@ class BaseController extends Controller
*
* @param string|array $message The return error message
* @param int $httpErrorCode 404/401/403 etc
* @return Response The JSON response
* @return Response| \Illuminate\Http\JsonResponse The JSON response
* @throws BindingResolutionException
*/
protected function errorResponse($message, $httpErrorCode = 400)
@ -297,7 +297,7 @@ class BaseController extends Controller
* Refresh API response with latest cahnges
*
* @param Builder $query
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*/
protected function refreshResponse($query)
{
@ -460,7 +460,7 @@ class BaseController extends Controller
}
},
'company.tasks' => function ($query) use ($updated_at, $user) {
$query->where('updated_at', '>=', $updated_at)->with('project','documents');
$query->where('updated_at', '>=', $updated_at)->with('project', 'documents');
if (! $user->hasPermission('view_task')) {
$query->whereNested(function ($query) use ($user) {
@ -798,7 +798,7 @@ class BaseController extends Controller
}
},
'company.tasks' => function ($query) use ($created_at, $user) {
$query->where('created_at', '>=', $created_at)->with('project.documents','documents');
$query->where('created_at', '>=', $created_at)->with('project.documents', 'documents');
if (! $user->hasPermission('view_task')) {
$query->whereNested(function ($query) use ($user) {
@ -969,7 +969,7 @@ class BaseController extends Controller
* Sorts the response by keys
*
* @param mixed $response
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*/
protected function response($response)
{
@ -995,7 +995,7 @@ class BaseController extends Controller
$response_data = Statics::company($user->getCompany()->getLocale());
if(request()->has('einvoice')){
if(request()->has('einvoice')) {
$ro = new Schema();
$response_data['einvoice_schema'] = $ro('Peppol');
@ -1020,7 +1020,7 @@ class BaseController extends Controller
* Item Response
*
* @param mixed $item
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*/
protected function itemResponse($item)
{

View File

@ -89,7 +89,7 @@ class ClientController extends BaseController
/**
*
* @param ClientFilters $filters
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*/
public function index(ClientFilters $filters)
@ -106,7 +106,7 @@ class ClientController extends BaseController
*
* @param ShowClientRequest $request
* @param Client $client
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*/
public function show(ShowClientRequest $request, Client $client)
@ -119,7 +119,7 @@ class ClientController extends BaseController
*
* @param EditClientRequest $request
* @param Client $client
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*/
public function edit(EditClientRequest $request, Client $client)
@ -132,7 +132,7 @@ class ClientController extends BaseController
*
* @param UpdateClientRequest $request
* @param Client $client
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*/
public function update(UpdateClientRequest $request, Client $client)
@ -157,7 +157,7 @@ class ClientController extends BaseController
* Show the form for creating a new resource.
*
* @param CreateClientRequest $request
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*/
public function create(CreateClientRequest $request)
@ -174,7 +174,7 @@ class ClientController extends BaseController
* Store a newly created resource in storage.
*
* @param StoreClientRequest $request
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*/
public function store(StoreClientRequest $request)
@ -203,7 +203,7 @@ class ClientController extends BaseController
*
* @param DestroyClientRequest $request
* @param Client $client
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
* @throws \Exception
*/
@ -217,7 +217,7 @@ class ClientController extends BaseController
/**
* Perform bulk actions on the list view.
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*/
public function bulk(BulkClientRequest $request)
@ -250,7 +250,7 @@ class ClientController extends BaseController
return response()->json(['message' => $hash_or_response], 200);
}
if($action == 'assign_group' && $user->can('edit', $clients->first())){
if($action == 'assign_group' && $user->can('edit', $clients->first())) {
$this->client_repo->assignGroup($clients, $request->group_settings_id);
@ -258,7 +258,7 @@ class ClientController extends BaseController
}
if($action == 'bulk_update' && $user->can('edit', $clients->first())){
if($action == 'bulk_update' && $user->can('edit', $clients->first())) {
$clients = Client::withTrashed()
->company()
@ -284,7 +284,7 @@ class ClientController extends BaseController
*
* @param UploadClientRequest $request
* @param Client $client
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*/
public function upload(UploadClientRequest $request, Client $client)
@ -305,7 +305,7 @@ class ClientController extends BaseController
*
* @param PurgeClientRequest $request
* @param Client $client
* @return \Illuminate\Http\JsonResponse
* @return \Illuminate\Http\JsonResponse|\Illuminate\Http\Response
*
*/
public function purge(PurgeClientRequest $request, Client $client)
@ -333,7 +333,7 @@ class ClientController extends BaseController
* @param PurgeClientRequest $request
* @param Client $client
* @param string $mergeable_client
* @return \Illuminate\Http\JsonResponse
* @return \Illuminate\Http\JsonResponse|\Illuminate\Http\Response
*
*/
@ -351,8 +351,9 @@ class ClientController extends BaseController
return response()->json(['message' => "Client not found"], 400);
}
if($m_client->id == $client->id)
if($m_client->id == $client->id) {
return response()->json(['message' => "Attempting to merge the same client is not possible."], 400);
}
$merged_client = $client->service()->merge($m_client)->save();
@ -364,7 +365,7 @@ class ClientController extends BaseController
*
* @param PurgeClientRequest $request
* @param Client $client
* @return \Illuminate\Http\JsonResponse
* @return \Illuminate\Http\JsonResponse|\Illuminate\Http\Response
*/
public function updateTaxData(PurgeClientRequest $request, Client $client)
{
@ -380,7 +381,7 @@ class ClientController extends BaseController
*
* @param ReactivateClientEmailRequest $request
* @param string $bounce_id //could also be the invitationId
* @return \Illuminate\Http\JsonResponse
* @return \Illuminate\Http\JsonResponse|\Illuminate\Http\Response
*/
public function reactivateEmail(ReactivateClientEmailRequest $request, string $bounce_id)
{

View File

@ -89,7 +89,7 @@ class ClientGatewayTokenController extends BaseController
* ),
* )
* @param ListClientGatewayTokenRequest $request
* @return Response|mixed
* @return Response| \Illuminate\Http\JsonResponse|mixed
*/
public function index(ListClientGatewayTokenRequest $request)
{
@ -103,7 +103,7 @@ class ClientGatewayTokenController extends BaseController
*
* @param ShowClientGatewayTokenRequest $request
* @param ClientGatewayToken $client_gateway_token
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Get(
@ -157,7 +157,7 @@ class ClientGatewayTokenController extends BaseController
*
* @param EditClientGatewayTokenRequest $request
* @param ClientGatewayToken $client_gateway_token
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Get(
@ -211,7 +211,7 @@ class ClientGatewayTokenController extends BaseController
*
* @param UpdateClientGatewayTokenRequest $request
* @param ClientGatewayToken $client_gateway_token
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
*
@ -267,7 +267,7 @@ class ClientGatewayTokenController extends BaseController
* Show the form for creating a new resource.
*
* @param CreateClientGatewayTokenRequest $request
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
*
@ -317,7 +317,7 @@ class ClientGatewayTokenController extends BaseController
* Store a newly created resource in storage.
*
* @param StoreClientGatewayTokenRequest $request
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
*
@ -369,7 +369,7 @@ class ClientGatewayTokenController extends BaseController
*
* @param DestroyClientGatewayTokenRequest $request
* @param ClientGatewayToken $client_gateway_token
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @throws \Exception

View File

@ -21,7 +21,7 @@ class ContactHashLoginController extends Controller
/**
* Logs a user into the client portal using their contact_key
* @param string $contact_key The contact key
* @return Redirect
* @return \Illuminate\Http\RedirectResponse
*/
public function login(string $contact_key)
{
@ -50,7 +50,7 @@ class ContactHashLoginController extends Controller
/**
* Generic error page for client portal.
*
* @return void
* @return \Illuminate\View\View
*/
public function errorPage()
{

View File

@ -103,7 +103,7 @@ class PaymentController extends Controller
* and invoice ids for reference.
*
* @param Request $request
* @return RedirectResponse|mixed
* @return \Illuminate\Http\RedirectResponse|mixed
*/
public function process(Request $request)
{
@ -157,7 +157,7 @@ class PaymentController extends Controller
* Pay for invoice/s using credits only.
*
* @param Request $request The request object
* @return \Response The response view
* @return \Illuminate\Http\RedirectResponse The response view
*/
public function credit_response(Request $request)
{

View File

@ -127,7 +127,7 @@ class PaymentMethodController extends Controller
* Remove the specified resource from storage.
*
* @param ClientGatewayToken $payment_method
* @return RedirectResponse
* @return \Illuminate\Http\RedirectResponse
*/
public function destroy(ClientGatewayToken $payment_method)
{

View File

@ -38,7 +38,7 @@ class ProfileController extends Controller
*
* @param UpdateContactRequest $request
* @param ClientContact $client_contact
* @return RedirectResponse
* @return \Illuminate\Http\RedirectResponse
*/
public function update(UpdateContactRequest $request, ClientContact $client_contact)
{

View File

@ -178,7 +178,7 @@ class QuoteController extends Controller
->where('client_id', auth()->guard('contact')->user()->client->id)
->where('company_id', auth()->guard('contact')->user()->client->company_id)
->whereIn('status_id', [Quote::STATUS_DRAFT, Quote::STATUS_SENT])
->where(function ($q){
->where(function ($q) {
$q->whereNull('due_date')->orWhere('due_date', '>=', now());
})
->withTrashed()

View File

@ -66,7 +66,7 @@ class RecurringInvoiceController extends Controller
* @param RequestCancellationRequest $request [description]
* @param RecurringInvoice $recurring_invoice [description]
*
* @return \Illuminate\Routing\Redirector|\Illuminate\Http\RedirectResponse
* @return \Illuminate\Http\RedirectResponse|\Illuminate\View\View
*/
public function requestCancellation(RequestCancellationRequest $request, RecurringInvoice $recurring_invoice)
{

View File

@ -13,14 +13,13 @@ namespace App\Http\Controllers\ClientPortal;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Redirect;
class TempRouteController extends Controller
{
/**
* Logs a user into the client portal using their contact_key
* @param string $hash The hash
* @return Redirect
* @return \Illuminate\View\View
*/
public function index(string $hash)
{

View File

@ -26,7 +26,7 @@ class UploadController extends Controller
* Main logic behind uploading the files.
*
* @param StoreUploadRequest $request
* @return Response|ResponseFactory
* @return Response| \Illuminate\Http\JsonResponse|ResponseFactory
*/
public function __invoke(StoreUploadRequest $request)
{

View File

@ -33,7 +33,7 @@ class ClientStatementController extends BaseController
* Update the specified resource in storage.
*
* @param CreateStatementRequest $request
* @return Response
* @return \Symfony\Component\HttpFoundation\StreamedResponse | \Illuminate\Http\JsonResponse
*/
public function statement(CreateStatementRequest $request)
{

View File

@ -78,7 +78,7 @@ class CompanyController extends BaseController
/**
* Display a listing of the resource.
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
* @OA\Get(
* path="/api/v1/companies",
@ -136,7 +136,7 @@ class CompanyController extends BaseController
* Show the form for creating a new resource.
*
* @param CreateCompanyRequest $request
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
*
@ -186,7 +186,7 @@ class CompanyController extends BaseController
* Store a newly created resource in storage.
*
* @param StoreCompanyRequest $request
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Post(
@ -272,7 +272,7 @@ class CompanyController extends BaseController
*
* @param ShowCompanyRequest $request
* @param Company $company
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Get(
@ -326,7 +326,7 @@ class CompanyController extends BaseController
*
* @param EditCompanyRequest $request
* @param Company $company
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Get(
@ -380,7 +380,7 @@ class CompanyController extends BaseController
*
* @param UpdateCompanyRequest $request
* @param Company $company
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Put(
@ -457,7 +457,7 @@ class CompanyController extends BaseController
*
* @param DestroyCompanyRequest $request
* @param Company $company
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @throws \Exception
@ -573,7 +573,7 @@ class CompanyController extends BaseController
*
* @param UploadCompanyRequest $request
* @param Company $company
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
*
@ -636,7 +636,7 @@ class CompanyController extends BaseController
*
* @param DefaultCompanyRequest $request
* @param Company $company
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
*
@ -706,6 +706,11 @@ class CompanyController extends BaseController
return $this->itemResponse($company->fresh());
}
/**
*
*
* @return \Symfony\Component\HttpFoundation\StreamedResponse | \Illuminate\Http\JsonResponse
*/
public function logo()
{
@ -715,18 +720,16 @@ class CompanyController extends BaseController
$logo = strlen($company->settings->company_logo) > 5 ? $company->settings->company_logo : 'https://pdf.invoicing.co/favicon-v2.png';
$headers = ['Content-Disposition' => 'inline'];
try{
try {
$response = \Illuminate\Support\Facades\Http::get($logo);
if ($response->successful()) {
$logo = $response->body();
}
else {
} else {
$logo = base64_decode('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=');
}
}
catch(\Exception $e){
} catch(\Exception $e) {
$logo = base64_decode('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=');

View File

@ -72,7 +72,7 @@ class CompanyGatewayController extends BaseController
/**
* Display a listing of the resource.
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
*
@ -119,7 +119,7 @@ class CompanyGatewayController extends BaseController
* Show the form for creating a new resource.
*
* @param CreateCompanyGatewayRequest $request
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
*
@ -168,7 +168,7 @@ class CompanyGatewayController extends BaseController
* Store a newly created resource in storage.
*
* @param StoreCompanyGatewayRequest $request
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
*
@ -248,7 +248,7 @@ class CompanyGatewayController extends BaseController
*
* @param ShowCompanyGatewayRequest $request
* @param CompanyGateway $company_gateway
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Get(
@ -302,7 +302,7 @@ class CompanyGatewayController extends BaseController
*
* @param EditCompanyGatewayRequest $request
* @param CompanyGateway $company_gateway
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Get(
@ -356,7 +356,7 @@ class CompanyGatewayController extends BaseController
*
* @param UpdateCompanyGatewayRequest $request
* @param CompanyGateway $company_gateway
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Put(
@ -420,7 +420,7 @@ class CompanyGatewayController extends BaseController
if($company_gateway->gateway_key == $this->checkout_key) {
CheckoutSetupWebhook::dispatch($company_gateway->company->company_key, $company_gateway->fresh()->id);
}elseif($company_gateway->gateway_key == $this->forte_key){
} elseif($company_gateway->gateway_key == $this->forte_key) {
dispatch(function () use ($company_gateway) {
MultiDB::setDb($company_gateway->company->db);
@ -437,7 +437,7 @@ class CompanyGatewayController extends BaseController
*
* @param DestroyCompanyGatewayRequest $request
* @param CompanyGateway $company_gateway
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @throws \Exception
@ -494,7 +494,7 @@ class CompanyGatewayController extends BaseController
/**
* Perform bulk actions on the list view.
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Post(
@ -567,10 +567,11 @@ class CompanyGatewayController extends BaseController
{
//Throttle here
if (Cache::has("throttle_polling:import_customers:{$company_gateway->company->company_key}:{$company_gateway->hashed_id}"))
if (Cache::has("throttle_polling:import_customers:{$company_gateway->company->company_key}:{$company_gateway->hashed_id}")) {
return response()->json(['message' => 'Please wait whilst your previous attempts complete.'], 200);
}
dispatch(function () use($company_gateway) {
dispatch(function () use ($company_gateway) {
MultiDB::setDb($company_gateway->company->db);
$company_gateway->driver()->importCustomers();
})->afterResponse();

View File

@ -31,7 +31,7 @@ class CompanyLedgerController extends BaseController
* Store a newly created resource in storage.
*
* @param ShowCompanyLedgerRequest $request
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
* @OA\Get(
* path="/api/v1/company_ledger",

View File

@ -107,7 +107,7 @@ class CompanyUserController extends BaseController
* )
* @param UpdateCompanyUserRequest $request
* @param User $user
* @return Response|mixed|void
* @return Response| \Illuminate\Http\JsonResponse|mixed|void
*/
public function update(UpdateCompanyUserRequest $request, User $user)
{

View File

@ -38,7 +38,7 @@ class ConnectedAccountController extends BaseController
* Connect an OAuth account to a regular email/password combination account
*
* @param Request $request
* @return \Illuminate\Http\JsonResponse
* @return \Illuminate\Http\JsonResponse|\Illuminate\Http\Response
*
*
* @OA\Post(

View File

@ -36,7 +36,7 @@ class InvoiceController extends BaseController
*
* @param InvoiceFilters $filters The filters
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*/
public function index(InvoiceFilters $filters)
{

View File

@ -58,7 +58,7 @@ class LoginController extends BaseController
*
* @param Request $request The request
*
* @return \Illuminate\Http\JsonResponse
* @return \Illuminate\Http\JsonResponse|\Illuminate\Http\Response
* @throws \Illuminate\Validation\ValidationException
*/
public function apiLogin(Request $request)
@ -86,7 +86,7 @@ class LoginController extends BaseController
* Redirect the user to the provider authentication page.
*
* @param string $provider
* @return void
* @return mixed
*/
public function redirectToProvider(string $provider)
{

View File

@ -69,7 +69,7 @@ class CreditController extends BaseController
*
* @param CreditFilters $filters The filters
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
* @OA\Get(
* path="/api/v1/credits",
@ -115,7 +115,7 @@ class CreditController extends BaseController
*
* @param CreateCreditRequest $request The request
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Get(
@ -164,7 +164,7 @@ class CreditController extends BaseController
*
* @param StoreCreditRequest $request The request
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Post(
@ -226,7 +226,7 @@ class CreditController extends BaseController
* @param ShowCreditRequest $request The request
* @param Credit $credit The credit
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Get(
@ -281,7 +281,7 @@ class CreditController extends BaseController
* @param EditCreditRequest $request The request
* @param Credit $credit The credit
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
* @OA\Get(
* path="/api/v1/credits/{id}/edit",
@ -334,7 +334,7 @@ class CreditController extends BaseController
*
* @param UpdateCreditRequest $request The request
* @param Credit $credit
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @throws \ReflectionException
@ -458,7 +458,7 @@ class CreditController extends BaseController
/**
* Perform bulk actions on the list view.
*
* @return \Illuminate\Support\Collection
* @return \Symfony\Component\HttpFoundation\StreamedResponse | \Illuminate\Http\JsonResponse
*
* @OA\Post(
* path="/api/v1/credits/bulk",
@ -700,7 +700,7 @@ class CreditController extends BaseController
* ),
* )
* @param $invitation_key
* @return \Symfony\Component\HttpFoundation\BinaryFileResponse
* @return \Symfony\Component\HttpFoundation\StreamedResponse
*/
public function downloadPdf($invitation_key)
{
@ -801,7 +801,7 @@ class CreditController extends BaseController
*
* @param UploadCreditRequest $request
* @param Credit $credit
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
*

View File

@ -82,7 +82,7 @@ class DesignController extends BaseController
* ),
* )
* @param DesignFilters $filters
* @return Response|mixed
* @return Response| \Illuminate\Http\JsonResponse|mixed
*/
public function index(DesignFilters $filters)
{
@ -96,7 +96,7 @@ class DesignController extends BaseController
*
* @param ShowDesignRequest $request
* @param Design $design
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Get(
@ -150,7 +150,7 @@ class DesignController extends BaseController
*
* @param EditDesignRequest $request
* @param Design $design
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Get(
@ -204,7 +204,7 @@ class DesignController extends BaseController
*
* @param UpdateDesignRequest $request
* @param Design $design
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
*
@ -265,7 +265,7 @@ class DesignController extends BaseController
* Show the form for creating a new resource.
*
* @param CreateDesignRequest $request
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
*
@ -313,7 +313,7 @@ class DesignController extends BaseController
* Store a newly created resource in storage.
*
* @param StoreDesignRequest $request
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
*
@ -415,7 +415,7 @@ class DesignController extends BaseController
*
* @param DestroyDesignRequest $request
* @param Design $design
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @throws \Exception
@ -473,7 +473,7 @@ class DesignController extends BaseController
/**
* Perform bulk actions on the list view.
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Post(

View File

@ -70,7 +70,7 @@ class DocumentController extends BaseController
* ),
* )
* @param DocumentFilters $filters
* @return Response|mixed
* @return Response| \Illuminate\Http\JsonResponse|mixed
*/
public function index(DocumentFilters $filters)
{
@ -105,7 +105,7 @@ class DocumentController extends BaseController
*
* @param ShowDocumentRequest $request
* @param Document $document
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*/
public function show(ShowDocumentRequest $request, Document $document)
{
@ -131,7 +131,7 @@ class DocumentController extends BaseController
*
* @param EditDocumentRequest $request
* @param Document $document
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*/
public function edit(EditDocumentRequest $request, Document $document)
{
@ -143,7 +143,7 @@ class DocumentController extends BaseController
*
* @param UpdateDocumentRequest $request
* @param Document $document
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*/
public function update(UpdateDocumentRequest $request, Document $document)
{
@ -158,7 +158,7 @@ class DocumentController extends BaseController
*
* @param DestroyDocumentRequest $request
* @param Document $document
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*/
public function destroy(DestroyDocumentRequest $request, Document $document)
{

View File

@ -78,7 +78,7 @@ class ExpenseCategoryController extends BaseController
*
* Display a listing of the resource.
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*/
public function index(ExpenseCategoryFilters $filters)
{
@ -93,7 +93,7 @@ class ExpenseCategoryController extends BaseController
* Show the form for creating a new resource.
*
* @param CreateExpenseCategoryRequest $request
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
*
@ -142,7 +142,7 @@ class ExpenseCategoryController extends BaseController
* Store a newly created resource in storage.
*
* @param StoreExpenseCategoryRequest $request
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Post(
@ -192,7 +192,7 @@ class ExpenseCategoryController extends BaseController
*
* @param ShowExpenseCategoryRequest $request
* @param ExpenseCategory $expense_category
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Get(
@ -245,7 +245,7 @@ class ExpenseCategoryController extends BaseController
*
* @param EditExpenseCategoryRequest $request
* @param ExpenseCategory $expense_category
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Get(
@ -298,7 +298,7 @@ class ExpenseCategoryController extends BaseController
*
* @param UpdateExpenseCategoryRequest $request
* @param ExpenseCategory $expense_category
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
*
@ -355,7 +355,7 @@ class ExpenseCategoryController extends BaseController
*
* @param DestroyExpenseCategoryRequest $request
* @param ExpenseCategory $expense_category
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @throws \Exception
@ -410,7 +410,7 @@ class ExpenseCategoryController extends BaseController
/**
* Perform bulk actions on the list view.
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Post(

View File

@ -98,7 +98,7 @@ class ExpenseController extends BaseController
* ),
* )
* @param ExpenseFilters $filters
* @return Response|mixed
* @return Response| \Illuminate\Http\JsonResponse|mixed
*/
public function index(ExpenseFilters $filters)
{
@ -112,7 +112,7 @@ class ExpenseController extends BaseController
*
* @param ShowExpenseRequest $request
* @param Expense $expense
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Get(
@ -166,7 +166,7 @@ class ExpenseController extends BaseController
*
* @param EditExpenseRequest $request
* @param Expense $expense
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Get(
@ -220,7 +220,7 @@ class ExpenseController extends BaseController
*
* @param UpdateExpenseRequest $request
* @param Expense $expense
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
*
@ -286,7 +286,7 @@ class ExpenseController extends BaseController
* Show the form for creating a new resource.
*
* @param CreateExpenseRequest $request
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
*
@ -334,7 +334,7 @@ class ExpenseController extends BaseController
* Store a newly created resource in storage.
*
* @param StoreExpenseRequest $request
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
*
@ -387,7 +387,7 @@ class ExpenseController extends BaseController
*
* @param DestroyExpenseRequest $request
* @param Expense $expense
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @throws \Exception
@ -441,7 +441,7 @@ class ExpenseController extends BaseController
/**
* Perform bulk actions on the list view.
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Post(
@ -524,7 +524,7 @@ class ExpenseController extends BaseController
*
* @param UploadExpenseRequest $request
* @param Expense $expense
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
*

View File

@ -55,7 +55,7 @@ class GroupSettingController extends BaseController
* Show the form for creating a new resource.
*
* @param GroupSettingFilters $filters
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*/
public function index(GroupSettingFilters $filters)
@ -69,7 +69,7 @@ class GroupSettingController extends BaseController
* Show the form for creating a new resource.
*
* @param CreateGroupSettingRequest $request
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*/
public function create(CreateGroupSettingRequest $request)
@ -86,7 +86,7 @@ class GroupSettingController extends BaseController
* Store a newly created resource in storage.
*
* @param StoreGroupSettingRequest $request
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*/
public function store(StoreGroupSettingRequest $request)
@ -108,7 +108,7 @@ class GroupSettingController extends BaseController
*
* @param ShowGroupSettingRequest $request
* @param GroupSetting $group_setting
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*/
public function show(ShowGroupSettingRequest $request, GroupSetting $group_setting)
@ -121,7 +121,7 @@ class GroupSettingController extends BaseController
*
* @param EditGroupSettingRequest $request
* @param GroupSetting $group_setting
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*/
public function edit(EditGroupSettingRequest $request, GroupSetting $group_setting)
@ -134,7 +134,7 @@ class GroupSettingController extends BaseController
*
* @param UpdateGroupSettingRequest $request
* @param GroupSetting $group_setting
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*/
public function update(UpdateGroupSettingRequest $request, GroupSetting $group_setting)
@ -158,7 +158,7 @@ class GroupSettingController extends BaseController
*
* @param DestroyGroupSettingRequest $request
* @param GroupSetting $group_setting
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @throws \Exception
@ -173,7 +173,7 @@ class GroupSettingController extends BaseController
/**
* Perform bulk actions on the list view.
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*/
public function bulk()
@ -210,7 +210,7 @@ class GroupSettingController extends BaseController
*
* @param UploadGroupSettingRequest $request
* @param GroupSetting $group_setting
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*/
public function upload(UploadGroupSettingRequest $request, GroupSetting $group_setting)

View File

@ -27,7 +27,7 @@ class ImportController extends Controller
*
* @param PreImportRequest $request
*
* @return \Illuminate\Http\JsonResponse
* @return \Illuminate\Http\JsonResponse|\Illuminate\Http\Response
*
* @OA\Post(
* path="/api/v1/preimport",

View File

@ -81,7 +81,7 @@ class InvoiceController extends BaseController
*
* @param InvoiceFilters $filters The filters
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
* @OA\Get(
* path="/api/v1/invoices",
@ -128,7 +128,7 @@ class InvoiceController extends BaseController
*
* @param CreateInvoiceRequest $request The request
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Get(
@ -176,7 +176,7 @@ class InvoiceController extends BaseController
*
* @param StoreInvoiceRequest $request The request
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Post(
@ -248,7 +248,7 @@ class InvoiceController extends BaseController
* @param ShowInvoiceRequest $request The request
* @param Invoice $invoice The invoice
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Get(
@ -303,7 +303,7 @@ class InvoiceController extends BaseController
* @param EditInvoiceRequest $request The request
* @param Invoice $invoice The invoice
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
* @OA\Get(
* path="/api/v1/invoices/{id}/edit",
@ -357,7 +357,7 @@ class InvoiceController extends BaseController
* @param UpdateInvoiceRequest $request The request
* @param Invoice $invoice The invoice
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Put(
@ -954,7 +954,7 @@ class InvoiceController extends BaseController
*
* @param UploadInvoiceRequest $request
* @param Invoice $invoice
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
*

View File

@ -28,7 +28,7 @@ class LicenseController extends BaseController
/**
* Claim a white label license.
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
* @OA\Get(
* path="/api/v1/claim_license",

View File

@ -52,7 +52,7 @@ class LogoutController extends BaseController
* ),
* )
* @param Request $request
* @return Response|mixed
* @return Response| \Illuminate\Http\JsonResponse|mixed
*/
public function index(Request $request)
{
@ -64,7 +64,7 @@ class LogoutController extends BaseController
->tokens()
->where('is_system', true)
->cursor()
->each(function ($ct){
->each(function ($ct) {
$ct->token = \Illuminate\Support\Str::random(64);
$ct->save();
});

View File

@ -80,7 +80,7 @@ class MigrationController extends BaseController
* ),
* )
* @param Company $company
* @return \Illuminate\Http\JsonResponse
* @return \Illuminate\Http\JsonResponse|\Illuminate\Http\Response
* @throws \Exception
*/
public function purgeCompany(Company $company)
@ -171,7 +171,7 @@ class MigrationController extends BaseController
* )
* @param Request $request
* @param Company $company
* @return \Illuminate\Http\JsonResponse
* @return \Illuminate\Http\JsonResponse|\Illuminate\Http\Response
*/
public function purgeCompanySaveSettings(Request $request, Company $company)
{
@ -255,7 +255,7 @@ class MigrationController extends BaseController
* ),
* )
* @param Request $request
* @return \Illuminate\Http\JsonResponse|void
* @return \Illuminate\Http\JsonResponse|\Illuminate\Http\Response|void
*/
public function startMigration(Request $request)
{

View File

@ -34,7 +34,7 @@ class OneTimeTokenController extends BaseController
* Store a newly created resource in storage.
*
* @param OneTimeTokenRequest $request
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
* @OA\Post(
* path="/api/v1/one_time_token",

View File

@ -67,7 +67,7 @@ class PaymentController extends BaseController
*
* @param PaymentFilters $filters The filters
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
*
@ -115,7 +115,7 @@ class PaymentController extends BaseController
*
* @param CreatePaymentRequest $request The request
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
*
@ -165,7 +165,7 @@ class PaymentController extends BaseController
*
* @param StorePaymentRequest $request The request
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
*
@ -222,7 +222,7 @@ class PaymentController extends BaseController
* @param ShowPaymentRequest $request The request
* @param Payment $payment The invoice
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Get(
@ -277,7 +277,7 @@ class PaymentController extends BaseController
* @param EditPaymentRequest $request The request
* @param Payment $payment The invoice
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Get(
@ -332,7 +332,7 @@ class PaymentController extends BaseController
* @param UpdatePaymentRequest $request The request
* @param Payment $payment The invoice
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Put(
@ -454,7 +454,7 @@ class PaymentController extends BaseController
/**
* Perform bulk actions on the list view.
*
* @return \Illuminate\Support\Collection
* @return \Illuminate\Http\Response|\Illuminate\Http\JsonResponse
*
*
* @OA\Post(
@ -667,7 +667,7 @@ class PaymentController extends BaseController
*
* @param RefundPaymentRequest $request The request
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
*
@ -720,7 +720,7 @@ class PaymentController extends BaseController
*
* @param UploadPaymentRequest $request
* @param Payment $payment
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
*

View File

@ -94,7 +94,7 @@ class PaymentTermController extends BaseController
*
* @param CreatePaymentTermRequest $request The request
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
*
@ -142,7 +142,7 @@ class PaymentTermController extends BaseController
*
* @param StorePaymentTermRequest $request The request
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
*
@ -236,7 +236,7 @@ class PaymentTermController extends BaseController
* )
* @param ShowPaymentTermRequest $request
* @param PaymentTerm $payment_term
* @return Response|mixed
* @return Response| \Illuminate\Http\JsonResponse|mixed
*/
public function show(ShowPaymentTermRequest $request, PaymentTerm $payment_term)
{
@ -286,7 +286,7 @@ class PaymentTermController extends BaseController
* )
* @param EditPaymentTermRequest $request
* @param PaymentTerm $payment_term
* @return Response|mixed
* @return Response| \Illuminate\Http\JsonResponse|mixed
*/
public function edit(EditPaymentTermRequest $request, PaymentTerm $payment_term)
{
@ -299,7 +299,7 @@ class PaymentTermController extends BaseController
* @param UpdatePaymentTermRequest $request The request
* @param PaymentTerm $payment_term The payment term
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Put(
@ -411,7 +411,7 @@ class PaymentTermController extends BaseController
/**
* Perform bulk actions on the list view.
*
* @return \Illuminate\Support\Collection
* @return \Illuminate\Http\Response|\Illuminate\Http\JsonResponse
*
*
* @OA\Post(

View File

@ -20,7 +20,7 @@ class PingController extends BaseController
/**
* Get a ping response from the system.
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
* @OA\Get(
* path="/api/v1/ping",
@ -55,7 +55,7 @@ class PingController extends BaseController
/**
* Get a health check of the system.
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
* @OA\Get(
* path="/api/v1/health_check",

View File

@ -146,8 +146,7 @@ class PreviewController extends BaseController
if (request()->has('entity') &&
request()->has('entity_id') &&
! empty(request()->input('entity')) &&
! empty(request()->input('entity_id')))
{
! empty(request()->input('entity_id'))) {
$design_object = json_decode(json_encode(request()->input('design')));
@ -172,10 +171,9 @@ class PreviewController extends BaseController
App::setLocale($entity_obj->client->preferredLocale());
$t->replace(Ninja::transformTranslations($entity_obj->client->getMergedSettings()));
if($entity_obj->client){
if($entity_obj->client) {
$html = new HtmlEngine($entity_obj->invitations()->first());
}
else {
} else {
$html = new VendorHtmlEngine($entity_obj->invitations()->first());
}

View File

@ -83,7 +83,7 @@ class ProductController extends BaseController
* ),
* )
* @param ProductFilters $filters
* @return Response|mixed
* @return Response| \Illuminate\Http\JsonResponse|mixed
*/
public function index(ProductFilters $filters)
{
@ -96,7 +96,7 @@ class ProductController extends BaseController
* Show the form for creating a new resource.
*
* @param CreateProductRequest $request
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
*
@ -145,7 +145,7 @@ class ProductController extends BaseController
* Store a newly created resource in storage.
*
* @param StoreProductRequest $request
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
*
@ -195,7 +195,7 @@ class ProductController extends BaseController
*
* @param ShowProductRequest $request
* @param Product $product
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Get(
@ -249,7 +249,7 @@ class ProductController extends BaseController
*
* @param EditProductRequest $request
* @param Product $product
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
* @OA\Get(
* path="/api/v1/products/{id}/edit",
@ -302,7 +302,7 @@ class ProductController extends BaseController
*
* @param UpdateProductRequest $request
* @param Product $product
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Put(
@ -362,7 +362,7 @@ class ProductController extends BaseController
*
* @param DestroyProductRequest $request
* @param Product $product
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @throws \Exception
@ -416,7 +416,7 @@ class ProductController extends BaseController
/**
* Perform bulk actions on the list view.
*
* @return \Illuminate\Support\Collection
* @return \Illuminate\Http\Response|\Illuminate\Http\JsonResponse
*
*
* @OA\Post(
@ -498,7 +498,7 @@ class ProductController extends BaseController
*
* @param UploadProductRequest $request
* @param Product $product
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
*

View File

@ -88,7 +88,7 @@ class ProjectController extends BaseController
* ),
* )
* @param ProjectFilters $filters
* @return Response|mixed
* @return Response| \Illuminate\Http\JsonResponse|mixed
*/
public function index(ProjectFilters $filters)
{
@ -102,7 +102,7 @@ class ProjectController extends BaseController
*
* @param ShowProjectRequest $request
* @param Project $project
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Get(
@ -156,7 +156,7 @@ class ProjectController extends BaseController
*
* @param EditProjectRequest $request
* @param Project $project
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Get(
@ -210,7 +210,7 @@ class ProjectController extends BaseController
*
* @param UpdateProjectRequest $request
* @param Project $project
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
*
@ -278,7 +278,7 @@ class ProjectController extends BaseController
* Show the form for creating a new resource.
*
* @param CreateProjectRequest $request
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
*
@ -326,7 +326,7 @@ class ProjectController extends BaseController
* Store a newly created resource in storage.
*
* @param StoreProjectRequest $request
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
*
@ -388,7 +388,7 @@ class ProjectController extends BaseController
*
* @param DestroyProjectRequest $request
* @param Project $project
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @throws \Exception
@ -445,7 +445,7 @@ class ProjectController extends BaseController
/**
* Perform bulk actions on the list view.
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Post(
@ -535,7 +535,7 @@ class ProjectController extends BaseController
*
* @param UploadProjectRequest $request
* @param Project $project
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
* @OA\Put(
* path="/api/v1/projects/{id}/upload",

View File

@ -60,7 +60,7 @@ class PurchaseOrderController extends BaseController
*
* @param \App\Filters\PurchaseOrderFilters $filters The filters
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
* @OA\Get(
* path="/api/v1/purchase_orders",
@ -105,7 +105,7 @@ class PurchaseOrderController extends BaseController
*
* @param CreatePurchaseOrderRequest $request The request
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Get(
@ -153,7 +153,7 @@ class PurchaseOrderController extends BaseController
*
* @param StorePurchaseOrderRequest $request The request
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Post(
@ -208,7 +208,7 @@ class PurchaseOrderController extends BaseController
* @param ShowPurchaseOrderRequest $request The request
* @param PurchaseOrder $purchase_order The purchase order
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Get(
@ -262,7 +262,7 @@ class PurchaseOrderController extends BaseController
* @param EditPurchaseOrderRequest $request The request
* @param PurchaseOrder $purchase_order The purchase order
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
* @OA\Get(
* path="/api/v1/purchase_orders/{id}/edit",
@ -314,7 +314,7 @@ class PurchaseOrderController extends BaseController
*
* @param UpdatePurchaseOrderRequest $request The request
* @param PurchaseOrder $purchase_order
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @throws \ReflectionException
@ -434,7 +434,7 @@ class PurchaseOrderController extends BaseController
/**
* Perform bulk actions on the list view.
*
* @return \Illuminate\Support\Collection
* @return \Illuminate\Http\Response|\Illuminate\Http\JsonResponse
*
* @OA\Post(
* path="/api/v1/purchase_orders/bulk",
@ -726,7 +726,7 @@ class PurchaseOrderController extends BaseController
*
* @param UploadPurchaseOrderRequest $request
* @param PurchaseOrder $purchase_order
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
*

View File

@ -83,7 +83,7 @@ class QuoteController extends BaseController
* Display a listing of the resource.
*
* @param QuoteFilters $filters
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Get(
@ -128,7 +128,7 @@ class QuoteController extends BaseController
* Show the form for creating a new resource.
*
* @param CreateQuoteRequest $request
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
*
@ -178,7 +178,7 @@ class QuoteController extends BaseController
*
* @param StoreQuoteRequest $request The request
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
*
@ -235,7 +235,7 @@ class QuoteController extends BaseController
* @param ShowQuoteRequest $request The request
* @param Quote $quote The quote
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Get(
@ -290,7 +290,7 @@ class QuoteController extends BaseController
* @param EditQuoteRequest $request The request
* @param Quote $quote The quote
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Get(
@ -345,7 +345,7 @@ class QuoteController extends BaseController
* @param UpdateQuoteRequest $request The request
* @param Quote $quote The quote
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Put(
@ -465,7 +465,7 @@ class QuoteController extends BaseController
/**
* Perform bulk actions on the list view.
*
* @return \Illuminate\Support\Collection
* @return \Illuminate\Http\Response|\Illuminate\Http\JsonResponse
*
*
* @OA\Post(
@ -692,7 +692,7 @@ class QuoteController extends BaseController
* @param ActionQuoteRequest $request
* @param Quote $quote
* @param $action
* @return \Illuminate\Http\JsonResponse|Response|mixed|\Symfony\Component\HttpFoundation\StreamedResponse
* @return \Illuminate\Http\JsonResponse|\Illuminate\Http\Response|Response|mixed|\Symfony\Component\HttpFoundation\StreamedResponse
*/
public function action(ActionQuoteRequest $request, Quote $quote, $action)
{
@ -901,7 +901,7 @@ class QuoteController extends BaseController
* ),
* )
* @param $invitation_key
* @return \Symfony\Component\HttpFoundation\BinaryFileResponse
* @return \Symfony\Component\HttpFoundation\StreamedResponse|\Illuminate\Http\JsonResponse
*/
public function downloadEQuote($invitation_key)
{
@ -934,7 +934,7 @@ class QuoteController extends BaseController
*
* @param UploadQuoteRequest $request
* @param Quote $quote
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
*

View File

@ -97,7 +97,7 @@ class RecurringExpenseController extends BaseController
* ),
* )
* @param RecurringExpenseFilters $filters
* @return Response|mixed
* @return Response| \Illuminate\Http\JsonResponse|mixed
*/
public function index(RecurringExpenseFilters $filters)
{
@ -111,7 +111,7 @@ class RecurringExpenseController extends BaseController
*
* @param ShowRecurringExpenseRequest $request
* @param RecurringExpense $recurring_expense
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Get(
@ -165,7 +165,7 @@ class RecurringExpenseController extends BaseController
*
* @param EditRecurringExpenseRequest $request
* @param RecurringExpense $recurring_expense
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Get(
@ -219,7 +219,7 @@ class RecurringExpenseController extends BaseController
*
* @param UpdateRecurringExpenseRequest $request
* @param RecurringExpense $recurring_expense
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
*
@ -284,7 +284,7 @@ class RecurringExpenseController extends BaseController
* Show the form for creating a new resource.
*
* @param CreateRecurringExpenseRequest $request
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
*
@ -332,7 +332,7 @@ class RecurringExpenseController extends BaseController
* Store a newly created resource in storage.
*
* @param StoreRecurringExpenseRequest $request
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
*
@ -384,7 +384,7 @@ class RecurringExpenseController extends BaseController
*
* @param DestroyRecurringExpenseRequest $request
* @param RecurringExpense $recurring_expense
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @throws \Exception
@ -438,7 +438,7 @@ class RecurringExpenseController extends BaseController
/**
* Perform bulk actions on the list view.
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Post(
@ -557,7 +557,7 @@ class RecurringExpenseController extends BaseController
*
* @param UploadRecurringExpenseRequest $request
* @param RecurringExpense $recurring_expense
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
*

View File

@ -70,7 +70,7 @@ class RecurringInvoiceController extends BaseController
*
* @param RecurringInvoiceFilters $filters The filters
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Get(
@ -117,7 +117,7 @@ class RecurringInvoiceController extends BaseController
*
* @param CreateRecurringInvoiceRequest $request The request
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
*
@ -167,7 +167,7 @@ class RecurringInvoiceController extends BaseController
*
* @param StoreRecurringInvoiceRequest $request The request
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
*
@ -223,7 +223,7 @@ class RecurringInvoiceController extends BaseController
* @param ShowRecurringInvoiceRequest $request The request
* @param RecurringInvoice $recurring_invoice The RecurringInvoice
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Get(
@ -278,7 +278,7 @@ class RecurringInvoiceController extends BaseController
* @param EditRecurringInvoiceRequest $request The request
* @param RecurringInvoice $recurring_invoice The RecurringInvoice
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Get(
@ -333,7 +333,7 @@ class RecurringInvoiceController extends BaseController
* @param UpdateRecurringInvoiceRequest $request The request
* @param RecurringInvoice $recurring_invoice The RecurringInvoice
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Put(
@ -451,7 +451,7 @@ class RecurringInvoiceController extends BaseController
* @param ActionRecurringInvoiceRequest $request
* @param RecurringInvoice $recurring_invoice
* @param $action
* @return Response|mixed
* @return Response| \Illuminate\Http\JsonResponse|mixed
*/
public function action(ActionRecurringInvoiceRequest $request, RecurringInvoice $recurring_invoice, $action)
{
@ -520,7 +520,7 @@ class RecurringInvoiceController extends BaseController
*
* @param UploadRecurringInvoiceRequest $request
* @param RecurringInvoice $recurring_invoice
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
*

View File

@ -66,7 +66,7 @@ class RecurringQuoteController extends BaseController
*
* @param RecurringQuoteFilters $filters The filters
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Get(
@ -113,7 +113,7 @@ class RecurringQuoteController extends BaseController
*
* @param CreateRecurringQuoteRequest $request The request
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Get(
@ -161,7 +161,7 @@ class RecurringQuoteController extends BaseController
*
* @param StoreRecurringQuoteRequest $request The request
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Post(
@ -210,7 +210,7 @@ class RecurringQuoteController extends BaseController
* @param ShowRecurringQuoteRequest $request The request
* @param RecurringQuote $recurring_quote The RecurringQuote
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Get(
@ -265,7 +265,7 @@ class RecurringQuoteController extends BaseController
* @param EditRecurringQuoteRequest $request The request
* @param RecurringQuote $recurring_quote The RecurringQuote
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Get(
@ -320,7 +320,7 @@ class RecurringQuoteController extends BaseController
* @param UpdateRecurringQuoteRequest $request The request
* @param RecurringQuote $recurring_quote The RecurringQuote
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
*
* @OA\Put(
@ -435,7 +435,7 @@ class RecurringQuoteController extends BaseController
/**
* Perform bulk actions on the list view.
*
* @return \Illuminate\Support\Collection
* @return \Illuminate\Http\Response|\Illuminate\Http\JsonResponse
*
*
* @OA\Post(

View File

@ -66,8 +66,7 @@ class TaskReportController extends BaseController
/** @var \App\Models\User $user */
$user = auth()->user();
if ($request->has('send_email') && $request->get('send_email') && $request->missing('output'))
{
if ($request->has('send_email') && $request->get('send_email') && $request->missing('output')) {
SendToAdmin::dispatch($user->company(), $request->all(), TaskExport::class, $this->filename);
return response()->json(['message' => 'working...'], 200);

View File

@ -62,8 +62,9 @@ class SelfUpdateController extends BaseController
$file_headers = @get_headers($this->getDownloadUrl());
if(!is_array($file_headers))
if(!is_array($file_headers)) {
return response()->json(['message' => 'There was a problem reaching the update server, please try again in a little while.'], 410);
}
if (stripos($file_headers[0], "404 Not Found") > 0 || (stripos($file_headers[0], "302 Found") > 0 && stripos($file_headers[7], "404 Not Found") > 0)) {
return response()->json(['message' => 'Download not yet available. Please try again shortly.'], 410);
@ -100,8 +101,9 @@ class SelfUpdateController extends BaseController
}
}
if(Storage::disk('base')->directoryExists('resources/lang'))
if(Storage::disk('base')->directoryExists('resources/lang')) {
Storage::disk('base')->deleteDirectory('resources/lang');
}
nlog('Removing cache files');

View File

@ -32,7 +32,7 @@ class ProductController extends BaseController
* Display a listing of the resource.
*
* @param Request $request
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*/
public function index(Request $request)
{

View File

@ -18,7 +18,6 @@ use Illuminate\Support\Facades\Mail;
class SmtpController extends BaseController
{
public function __construct()
{
parent::__construct();
@ -60,7 +59,7 @@ class SmtpController extends BaseController
$sending_user = (isset($company->settings->email_from_name) && strlen($company->settings->email_from_name) > 2) ? $company->settings->email_from_name : $user->name();
$mailable = new TestMailServer('Email Server Works!', $sending_email);
$mailable->from($sending_email,$sending_user);
$mailable->from($sending_email, $sending_user);
Mail::mailer('smtp')
->to($user->email, $user->present()->name())

View File

@ -20,7 +20,7 @@ class StaticController extends BaseController
/**
* Show the list of Invoices.
*
* @return Response
* @return Response| \Illuminate\Http\JsonResponse
*
* @OA\Get(
* path="/api/v1/statics",
@ -59,7 +59,7 @@ class StaticController extends BaseController
$response_data = Statics::company($user->getLocale() ?? $user->company()->getLocale());
if(request()->has('einvoice')){
if(request()->has('einvoice')) {
$schema = new Schema();
$response_data['einvoice_schema'] = $schema('Peppol');

View File

@ -420,7 +420,7 @@ class SubscriptionController extends BaseController
/**
* Perform bulk actions on the list view.
*
* @return \Illuminate\Support\Collection
* @return \Illuminate\Http\Response|\Illuminate\Http\JsonResponse
*
*
* @OA\Post(

View File

@ -21,10 +21,10 @@ class SubscriptionStepsController extends BaseController
public function index(): JsonResponse
{
$dependencies = collect(Purchase::$dependencies)
->map(fn($dependency) => [
->map(fn ($dependency) => [
'id' => $dependency['id'],
'dependencies' => collect($dependency['dependencies'])
->map(fn($dependency) => Purchase::$dependencies[$dependency]['id'])
->map(fn ($dependency) => Purchase::$dependencies[$dependency]['id'])
->toArray(),
])
->toArray();

View File

@ -60,7 +60,7 @@ class SendingController extends Controller
* ),
* )
* @param Request $request
* @return \Illuminate\Http\JsonResponse
* @return \Illuminate\Http\JsonResponse|\Illuminate\Http\Response
*/
public function __invoke(Request $request)
{

Some files were not shown because too many files have changed in this diff Show More