mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Clean up for due date days recurring invoices
This commit is contained in:
parent
682ba68120
commit
fb1e27ba7d
@ -163,7 +163,7 @@ class CreditFilters extends QueryFilters
|
||||
*/
|
||||
public function entityFilter()
|
||||
{
|
||||
if (auth('contact')->user()) {
|
||||
if (auth()->guard('contact')->user()) {
|
||||
return $this->contactViewFilter();
|
||||
} else {
|
||||
return $this->builder->company();
|
||||
@ -181,7 +181,7 @@ class CreditFilters extends QueryFilters
|
||||
private function contactViewFilter() : Builder
|
||||
{
|
||||
return $this->builder
|
||||
->whereCompanyId(auth('contact')->user()->company->id)
|
||||
->whereCompanyId(auth()->guard('contact')->user()->company->id)
|
||||
->whereNotIn('status_id', [Credit::STATUS_DRAFT]);
|
||||
}
|
||||
}
|
||||
|
@ -177,7 +177,7 @@ class InvoiceFilters extends QueryFilters
|
||||
*/
|
||||
public function entityFilter()
|
||||
{
|
||||
if (auth('contact')->user()) {
|
||||
if (auth()->guard('contact')->user()) {
|
||||
return $this->contactViewFilter();
|
||||
} else {
|
||||
return $this->builder->company()->with(['invitations.company'], ['documents.company']);
|
||||
@ -195,7 +195,7 @@ class InvoiceFilters extends QueryFilters
|
||||
private function contactViewFilter() : Builder
|
||||
{
|
||||
return $this->builder
|
||||
->whereCompanyId(auth('contact')->user()->company->id)
|
||||
->whereCompanyId(auth()->guard('contact')->user()->company->id)
|
||||
->whereNotIn('status_id', [Invoice::STATUS_DRAFT, Invoice::STATUS_CANCELLED]);
|
||||
}
|
||||
}
|
||||
|
@ -119,7 +119,7 @@ class PaymentFilters extends QueryFilters
|
||||
*/
|
||||
public function entityFilter()
|
||||
{
|
||||
if (auth('contact')->user()) {
|
||||
if (auth()->guard('contact')->user()) {
|
||||
return $this->contactViewFilter();
|
||||
} else {
|
||||
return $this->builder->company();
|
||||
@ -135,7 +135,7 @@ class PaymentFilters extends QueryFilters
|
||||
private function contactViewFilter() : Builder
|
||||
{
|
||||
return $this->builder
|
||||
->whereCompanyId(auth('contact')->user()->company->id)
|
||||
->whereCompanyId(auth()->guard('contact')->user()->company->id)
|
||||
->whereIsDeleted(false);
|
||||
}
|
||||
}
|
||||
|
@ -161,8 +161,8 @@ abstract class QueryFilters
|
||||
*/
|
||||
public function clientFilter()
|
||||
{
|
||||
if (auth('contact')->user()) {
|
||||
return $this->builder->whereClientId(auth('contact')->user()->client->id);
|
||||
if (auth()->guard('contact')->user()) {
|
||||
return $this->builder->whereClientId(auth()->guard('contact')->user()->client->id);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -71,7 +71,7 @@ class DocumentController extends Controller
|
||||
public function downloadMultiple(DownloadMultipleDocumentsRequest $request)
|
||||
{
|
||||
$documents = Document::whereIn('id', $this->transformKeys($request->file_hash))
|
||||
->where('company_id', auth('contact')->user()->company->id)
|
||||
->where('company_id', auth()->guard('contact')->user()->company->id)
|
||||
->get();
|
||||
|
||||
$documents->map(function ($document) {
|
||||
|
@ -100,7 +100,7 @@ class NinjaPlanController extends Controller
|
||||
}
|
||||
|
||||
$recurring_invoice = RecurringInvoice::on('db-ninja-01')
|
||||
->where('client_id', auth('contact')->user()->client->id)
|
||||
->where('client_id', auth()->guard('contact')->user()->client->id)
|
||||
->where('company_id', Auth::guard('contact')->user()->company->id)
|
||||
->whereNotNull('subscription_id')
|
||||
->where('status_id', RecurringInvoice::STATUS_ACTIVE)
|
||||
|
@ -130,7 +130,7 @@ class PaymentMethodController extends Controller
|
||||
|
||||
try {
|
||||
|
||||
event(new MethodDeleted($payment_method, auth('contact')->user()->company, Ninja::eventVars(auth('contact')->user()->id)));
|
||||
event(new MethodDeleted($payment_method, auth()->guard('contact')->user()->company, Ninja::eventVars(auth()->guard('contact')->user()->id)));
|
||||
|
||||
$payment_method->delete();
|
||||
|
||||
|
@ -160,8 +160,8 @@ class QuoteController extends Controller
|
||||
protected function approve(array $ids, $process = false)
|
||||
{
|
||||
$quotes = Quote::whereIn('id', $ids)
|
||||
->where('client_id', auth('contact')->user()->client->id)
|
||||
->where('company_id', auth('contact')->user()->client->company_id)
|
||||
->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])
|
||||
->withTrashed()
|
||||
->get();
|
||||
@ -175,7 +175,7 @@ class QuoteController extends Controller
|
||||
if ($process) {
|
||||
foreach ($quotes as $quote) {
|
||||
$quote->service()->approve(auth()->user())->save();
|
||||
event(new QuoteWasApproved(auth('contact')->user(), $quote, $quote->company, Ninja::eventVars()));
|
||||
event(new QuoteWasApproved(auth()->guard('contact')->user(), $quote, $quote->company, Ninja::eventVars()));
|
||||
|
||||
if (request()->has('signature') && !is_null(request()->signature) && !empty(request()->signature)) {
|
||||
InjectSignature::dispatch($quote, request()->signature);
|
||||
|
@ -26,8 +26,8 @@ class SubscriptionController extends Controller
|
||||
|
||||
|
||||
$count = RecurringInvoice::query()
|
||||
->where('client_id', auth('contact')->user()->client->id)
|
||||
->where('company_id', auth('contact')->user()->client->company_id)
|
||||
->where('client_id', auth()->guard('contact')->user()->client->id)
|
||||
->where('company_id', auth()->guard('contact')->user()->client->company_id)
|
||||
->where('status_id', RecurringInvoice::STATUS_ACTIVE)
|
||||
->where('is_deleted', 0)
|
||||
->whereNotNull('subscription_id')
|
||||
@ -35,7 +35,7 @@ class SubscriptionController extends Controller
|
||||
->count();
|
||||
|
||||
if($count == 0)
|
||||
return redirect()->route('client.ninja_contact_login', ['contact_key' => auth('contact')->user()->contact_key, 'company_key' => auth('contact')->user()->company->company_key]);
|
||||
return redirect()->route('client.ninja_contact_login', ['contact_key' => auth()->guard('contact')->user()->contact_key, 'company_key' => auth()->guard('contact')->user()->company->company_key]);
|
||||
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,7 @@ class TaskController extends Controller
|
||||
public function index(ShowTasksRequest $request)
|
||||
{
|
||||
\Carbon\Carbon::setLocale(
|
||||
auth('contact')->user()->preferredLocale()
|
||||
auth()->guard('contact')->user()->preferredLocale()
|
||||
);
|
||||
|
||||
return render('tasks.index');
|
||||
|
@ -36,7 +36,7 @@ class CreditsTable extends Component
|
||||
{
|
||||
|
||||
$query = Credit::query()
|
||||
->where('client_id', auth('contact')->user()->client->id)
|
||||
->where('client_id', auth()->guard('contact')->user()->client->id)
|
||||
->where('company_id', $this->company->id)
|
||||
->where('status_id', '<>', Credit::STATUS_DRAFT)
|
||||
->where('is_deleted', 0)
|
||||
|
@ -75,7 +75,7 @@ class InvoicesTable extends Component
|
||||
}
|
||||
|
||||
$query = $query
|
||||
->where('client_id', auth('contact')->user()->client->id)
|
||||
->where('client_id', auth()->guard('contact')->user()->client->id)
|
||||
->where('status_id', '<>', Invoice::STATUS_DRAFT)
|
||||
->where('status_id', '<>', Invoice::STATUS_CANCELLED)
|
||||
->withTrashed()
|
||||
|
@ -43,7 +43,7 @@ class PaymentsTable extends Component
|
||||
->with('type', 'client')
|
||||
->whereIn('status_id', [Payment::STATUS_COMPLETED, Payment::STATUS_PENDING, Payment::STATUS_REFUNDED, Payment::STATUS_PARTIALLY_REFUNDED])
|
||||
->where('company_id', $this->company->id)
|
||||
->where('client_id', auth('contact')->user()->client->id)
|
||||
->where('client_id', auth()->guard('contact')->user()->client->id)
|
||||
->orderBy($this->sort_field, $this->sort_asc ? 'asc' : 'desc')
|
||||
->withTrashed()
|
||||
->paginate($this->per_page);
|
||||
|
@ -75,7 +75,7 @@ class QuotesTable extends Component
|
||||
|
||||
$query = $query
|
||||
->where('company_id', $this->company->id)
|
||||
->where('client_id', auth('contact')->user()->client->id)
|
||||
->where('client_id', auth()->guard('contact')->user()->client->id)
|
||||
->where('status_id', '<>', Quote::STATUS_DRAFT)
|
||||
// ->where(function ($query){
|
||||
// $query->whereDate('due_date', '>=', now())
|
||||
|
@ -40,7 +40,7 @@ class RecurringInvoicesTable extends Component
|
||||
$query = RecurringInvoice::query();
|
||||
|
||||
$query = $query
|
||||
->where('client_id', auth('contact')->user()->client->id)
|
||||
->where('client_id', auth()->guard('contact')->user()->client->id)
|
||||
->where('company_id', $this->company->id)
|
||||
->whereIn('status_id', [RecurringInvoice::STATUS_ACTIVE])
|
||||
->orderBy('status_id', 'asc')
|
||||
|
@ -35,7 +35,7 @@ class SubscriptionRecurringInvoicesTable extends Component
|
||||
public function render()
|
||||
{
|
||||
$query = RecurringInvoice::query()
|
||||
->where('client_id', auth('contact')->user()->client->id)
|
||||
->where('client_id', auth()->guard('contact')->user()->client->id)
|
||||
->where('company_id', $this->company->id)
|
||||
->whereNotNull('subscription_id')
|
||||
->where('is_deleted', false)
|
||||
|
@ -37,7 +37,7 @@ class TasksTable extends Component
|
||||
$query = Task::query()
|
||||
->where('company_id', $this->company->id)
|
||||
->where('is_deleted', false)
|
||||
->where('client_id', auth('contact')->user()->client->id);
|
||||
->where('client_id', auth()->guard('contact')->user()->client->id);
|
||||
|
||||
if ($this->company->getSetting('show_all_tasks_client_portal') === 'invoiced') {
|
||||
$query = $query->whereNotNull('invoice_id');
|
||||
|
@ -31,7 +31,7 @@ class CheckClientExistence
|
||||
|
||||
$multiple_contacts = ClientContact::query()
|
||||
->with('client.gateway_tokens','company')
|
||||
->where('email', auth('contact')->user()->email)
|
||||
->where('email', auth()->guard('contact')->user()->email)
|
||||
->whereNotNull('email')
|
||||
->where('email', '<>', '')
|
||||
// ->whereNull('deleted_at')
|
||||
@ -42,7 +42,7 @@ class CheckClientExistence
|
||||
return $query->where('is_deleted', false);
|
||||
})
|
||||
->whereHas('company', function ($query){
|
||||
return $query->where('id', auth('contact')->user()->client->company_id);
|
||||
return $query->where('id', auth()->guard('contact')->user()->client->company_id);
|
||||
})
|
||||
->get();
|
||||
|
||||
|
@ -32,8 +32,8 @@ class Locale
|
||||
if ($request->has('lang')) {
|
||||
$locale = $request->input('lang');
|
||||
App::setLocale($locale);
|
||||
} elseif (auth('contact')->user()) {
|
||||
App::setLocale(auth('contact')->user()->client->locale());
|
||||
} elseif (auth()->guard('contact')->user()) {
|
||||
App::setLocale(auth()->guard('contact')->user()->client->locale());
|
||||
} elseif (auth()->user()) {
|
||||
|
||||
try{
|
||||
|
@ -15,7 +15,7 @@ class ShowCreditRequest extends FormRequest
|
||||
public function authorize()
|
||||
{
|
||||
return !$this->credit->is_deleted
|
||||
&& auth('contact')->user()->company->enabled_modules & PortalComposer::MODULE_CREDITS;
|
||||
&& auth()->guard('contact')->user()->company->enabled_modules & PortalComposer::MODULE_CREDITS;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -19,7 +19,7 @@ class ShowCreditsRequest extends FormRequest
|
||||
{
|
||||
public function authorize()
|
||||
{
|
||||
return auth('contact')->user()->company->enabled_modules & PortalComposer::MODULE_CREDITS;
|
||||
return auth()->guard('contact')->user()->company->enabled_modules & PortalComposer::MODULE_CREDITS;
|
||||
}
|
||||
|
||||
public function rules()
|
||||
|
@ -19,7 +19,7 @@ class ProcessInvoicesInBulkRequest extends FormRequest
|
||||
{
|
||||
public function authorize()
|
||||
{
|
||||
return auth('contact')->user()->company->enabled_modules & PortalComposer::MODULE_INVOICES;
|
||||
return auth()->guard('contact')->user()->company->enabled_modules & PortalComposer::MODULE_INVOICES;
|
||||
}
|
||||
|
||||
public function rules()
|
||||
|
@ -23,7 +23,7 @@ class ShowInvoiceRequest extends Request
|
||||
*/
|
||||
public function authorize() : bool
|
||||
{
|
||||
return auth('contact')->user()->client->id == $this->invoice->client_id
|
||||
&& auth('contact')->user()->company->enabled_modules & PortalComposer::MODULE_INVOICES;
|
||||
return auth()->guard('contact')->user()->client_id == $this->invoice->client_id
|
||||
&& auth()->guard('contact')->user()->company->enabled_modules & PortalComposer::MODULE_INVOICES;
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ class ShowInvoicesRequest extends FormRequest
|
||||
{
|
||||
public function authorize()
|
||||
{
|
||||
return auth('contact')->user()->company->enabled_modules & PortalComposer::MODULE_INVOICES;
|
||||
return auth()->guard('contact')->user()->company->enabled_modules & PortalComposer::MODULE_INVOICES;
|
||||
}
|
||||
|
||||
public function rules()
|
||||
|
@ -20,7 +20,7 @@ class ProcessQuotesInBulkRequest extends FormRequest
|
||||
{
|
||||
public function authorize()
|
||||
{
|
||||
return auth('contact')->user()->company->enabled_modules & PortalComposer::MODULE_QUOTES;
|
||||
return auth()->guard('contact')->user()->company->enabled_modules & PortalComposer::MODULE_QUOTES;
|
||||
}
|
||||
|
||||
public function rules()
|
||||
|
@ -20,7 +20,7 @@ class ShowQuoteRequest extends FormRequest
|
||||
public function authorize()
|
||||
{
|
||||
return auth()->user()->client->id === $this->quote->client_id
|
||||
&& auth('contact')->user()->company->enabled_modules & PortalComposer::MODULE_QUOTES;
|
||||
&& auth()->guard('contact')->user()->company->enabled_modules & PortalComposer::MODULE_QUOTES;
|
||||
}
|
||||
|
||||
public function rules()
|
||||
|
@ -19,7 +19,7 @@ class ShowQuotesRequest extends FormRequest
|
||||
{
|
||||
public function authorize()
|
||||
{
|
||||
return auth('contact')->user()->company->enabled_modules & PortalComposer::MODULE_QUOTES;
|
||||
return auth()->guard('contact')->user()->company->enabled_modules & PortalComposer::MODULE_QUOTES;
|
||||
}
|
||||
|
||||
public function rules()
|
||||
|
@ -9,7 +9,7 @@ class RequestCancellationRequest extends FormRequest
|
||||
{
|
||||
public function authorize()
|
||||
{
|
||||
return auth('contact')->user()->company->enabled_modules & PortalComposer::MODULE_RECURRING_INVOICES;
|
||||
return auth()->guard('contact')->user()->company->enabled_modules & PortalComposer::MODULE_RECURRING_INVOICES;
|
||||
}
|
||||
|
||||
public function rules()
|
||||
|
@ -18,8 +18,8 @@ class ShowRecurringInvoiceRequest extends Request
|
||||
{
|
||||
public function authorize() : bool
|
||||
{
|
||||
return auth('contact')->user()->client->id === $this->recurring_invoice->client_id
|
||||
&& auth('contact')->user()->company->enabled_modules & PortalComposer::MODULE_RECURRING_INVOICES;
|
||||
return auth()->guard('contact')->user()->client->id === $this->recurring_invoice->client_id
|
||||
&& auth()->guard('contact')->user()->company->enabled_modules & PortalComposer::MODULE_RECURRING_INVOICES;
|
||||
}
|
||||
|
||||
public function rules()
|
||||
|
@ -19,7 +19,7 @@ class ShowRecurringInvoicesRequest extends FormRequest
|
||||
{
|
||||
public function authorize()
|
||||
{
|
||||
return auth('contact')->user()->company->enabled_modules & PortalComposer::MODULE_RECURRING_INVOICES;
|
||||
return auth()->guard('contact')->user()->company->enabled_modules & PortalComposer::MODULE_RECURRING_INVOICES;
|
||||
}
|
||||
|
||||
public function rules()
|
||||
|
@ -44,6 +44,6 @@ class ShowStatementRequest extends FormRequest
|
||||
|
||||
public function client(): Client
|
||||
{
|
||||
return auth('contact')->user()->client;
|
||||
return auth()->guard('contact')->user()->client;
|
||||
}
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ class StoreUploadRequest extends FormRequest
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return (bool) auth('contact')->user()->client->getSetting('client_portal_enable_uploads');
|
||||
return (bool) auth()->guard('contact')->user()->client->getSetting('client_portal_enable_uploads');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -51,10 +51,10 @@ class PortalComposer
|
||||
|
||||
$view->with($this->portalData());
|
||||
|
||||
if (auth('contact')->user()) {
|
||||
if (auth()->guard('contact')->user()) {
|
||||
App::forgetInstance('translator');
|
||||
$t = app('translator');
|
||||
$t->replace(Ninja::transformTranslations(auth('contact')->user()->client->getMergedSettings()));
|
||||
$t->replace(Ninja::transformTranslations(auth()->guard('contact')->user()->client->getMergedSettings()));
|
||||
}
|
||||
}
|
||||
|
||||
@ -63,21 +63,21 @@ class PortalComposer
|
||||
*/
|
||||
private function portalData() :array
|
||||
{
|
||||
if (! auth('contact')->user()) {
|
||||
if (! auth()->guard('contact')->user()) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$this->settings = auth('contact')->user()->client->getMergedSettings();
|
||||
$this->settings = auth()->guard('contact')->user()->client->getMergedSettings();
|
||||
|
||||
$data['sidebar'] = $this->sidebarMenu();
|
||||
$data['header'] = [];
|
||||
$data['footer'] = [];
|
||||
$data['countries'] = TranslationHelper::getCountries();
|
||||
$data['company'] = auth('contact')->user()->company;
|
||||
$data['client'] = auth('contact')->user()->client;
|
||||
$data['company'] = auth()->guard('contact')->user()->company;
|
||||
$data['client'] = auth()->guard('contact')->user()->client;
|
||||
$data['settings'] = $this->settings;
|
||||
$data['currencies'] = TranslationHelper::getCurrencies();
|
||||
$data['contact'] = auth('contact')->user();
|
||||
$data['contact'] = auth()->guard('contact')->user();
|
||||
|
||||
$data['multiple_contacts'] = session()->get('multiple_contacts') ?: collect();
|
||||
|
||||
@ -86,7 +86,7 @@ class PortalComposer
|
||||
|
||||
private function sidebarMenu() :array
|
||||
{
|
||||
$enabled_modules = auth('contact')->user()->company->enabled_modules;
|
||||
$enabled_modules = auth()->guard('contact')->user()->company->enabled_modules;
|
||||
$data = [];
|
||||
|
||||
// TODO: Enable dashboard once it's completed.
|
||||
@ -114,13 +114,13 @@ class PortalComposer
|
||||
$data[] = ['title' => ctrans('texts.payment_methods'), 'url' => 'client.payment_methods.index', 'icon' => 'shield'];
|
||||
$data[] = ['title' => ctrans('texts.documents'), 'url' => 'client.documents.index', 'icon' => 'download'];
|
||||
|
||||
if (auth('contact')->user()->client->getSetting('enable_client_portal_tasks')) {
|
||||
if (auth()->guard('contact')->user()->client->getSetting('enable_client_portal_tasks')) {
|
||||
$data[] = ['title' => ctrans('texts.tasks'), 'url' => 'client.tasks.index', 'icon' => 'clock'];
|
||||
}
|
||||
|
||||
$data[] = ['title' => ctrans('texts.statement'), 'url' => 'client.statement', 'icon' => 'activity'];
|
||||
|
||||
if(Ninja::isHosted() && auth('contact')->user()->company->id == config('ninja.ninja_default_company_id'))
|
||||
if(Ninja::isHosted() && auth()->guard('contact')->user()->company->id == config('ninja.ninja_default_company_id'))
|
||||
$data[] = ['title' => ctrans('texts.plan'), 'url' => 'client.plan', 'icon' => 'credit-card'];
|
||||
else
|
||||
$data[] = ['title' => ctrans('texts.subscriptions'), 'url' => 'client.subscriptions.index', 'icon' => 'calendar'];
|
||||
|
@ -458,14 +458,13 @@ class RecurringInvoice extends BaseModel
|
||||
|
||||
public function calculateDueDate($date)
|
||||
{
|
||||
//if nothing is set, assume we are using terms.
|
||||
if(!$this->due_date_days)
|
||||
return $this->calculateDateFromTerms($date);
|
||||
|
||||
switch ($this->due_date_days) {
|
||||
case 'terms':
|
||||
case '':
|
||||
return $this->calculateDateFromTerms($date);
|
||||
break;
|
||||
|
||||
default:
|
||||
return $this->setDayOfMonth($date, $this->due_date_days);
|
||||
break;
|
||||
|
@ -125,7 +125,7 @@ class AuthorizeCreditCard
|
||||
{
|
||||
$client_gateway_token = ClientGatewayToken::query()
|
||||
->where('id', $this->decodePrimaryKey($request->token))
|
||||
->where('company_id', auth('contact')->user()->client->company->id)
|
||||
->where('company_id', auth()->guard('contact')->user()->client->company->id)
|
||||
->first();
|
||||
|
||||
if (!$client_gateway_token) {
|
||||
|
@ -109,7 +109,7 @@ class ACH implements MethodInterface
|
||||
$customer = $this->braintree->findOrCreateCustomer();
|
||||
|
||||
$token = ClientGatewayToken::query()
|
||||
->where('client_id', auth('contact')->user()->client->id)
|
||||
->where('client_id', auth()->guard('contact')->user()->client->id)
|
||||
->where('id', $this->decodePrimaryKey($request->source))
|
||||
->firstOrFail();
|
||||
|
||||
|
@ -145,7 +145,7 @@ class CreditCard implements MethodInterface
|
||||
{
|
||||
$cgt = ClientGatewayToken::query()
|
||||
->where('id', $this->decodePrimaryKey($request->input('token')))
|
||||
->where('company_id', auth('contact')->user()->client->company->id)
|
||||
->where('company_id', auth()->guard('contact')->user()->client->company->id)
|
||||
->first();
|
||||
|
||||
if (!$cgt) {
|
||||
|
@ -64,12 +64,12 @@ class ACH implements MethodInterface
|
||||
'session_token' => $session_token,
|
||||
]),
|
||||
"prefilled_customer" => [
|
||||
"given_name" => auth('contact')->user()->first_name,
|
||||
"family_name" => auth('contact')->user()->last_name,
|
||||
"email" => auth('contact')->user()->email,
|
||||
"address_line1" => auth('contact')->user()->client->address1,
|
||||
"city" => auth('contact')->user()->client->city,
|
||||
"postal_code" => auth('contact')->user()->client->postal_code,
|
||||
"given_name" => auth()->guard('contact')->user()->first_name,
|
||||
"family_name" => auth()->guard('contact')->user()->last_name,
|
||||
"email" => auth()->guard('contact')->user()->email,
|
||||
"address_line1" => auth()->guard('contact')->user()->client->address1,
|
||||
"city" => auth()->guard('contact')->user()->client->city,
|
||||
"postal_code" => auth()->guard('contact')->user()->client->postal_code,
|
||||
],
|
||||
],
|
||||
]);
|
||||
|
@ -62,12 +62,12 @@ class DirectDebit implements MethodInterface
|
||||
'session_token' => $session_token,
|
||||
]),
|
||||
'prefilled_customer' => [
|
||||
'given_name' => auth('contact')->user()->first_name,
|
||||
'family_name' => auth('contact')->user()->last_name,
|
||||
'email' => auth('contact')->user()->email,
|
||||
'address_line1' => auth('contact')->user()->client->address1,
|
||||
'city' => auth('contact')->user()->client->city,
|
||||
'postal_code' => auth('contact')->user()->client->postal_code,
|
||||
'given_name' => auth()->guard('contact')->user()->first_name,
|
||||
'family_name' => auth()->guard('contact')->user()->last_name,
|
||||
'email' => auth()->guard('contact')->user()->email,
|
||||
'address_line1' => auth()->guard('contact')->user()->client->address1,
|
||||
'city' => auth()->guard('contact')->user()->client->city,
|
||||
'postal_code' => auth()->guard('contact')->user()->client->postal_code,
|
||||
],
|
||||
],
|
||||
]);
|
||||
|
@ -63,12 +63,12 @@ class SEPA implements MethodInterface
|
||||
'session_token' => $session_token,
|
||||
]),
|
||||
'prefilled_customer' => [
|
||||
'given_name' => auth('contact')->user()->first_name,
|
||||
'family_name' => auth('contact')->user()->last_name,
|
||||
'email' => auth('contact')->user()->email,
|
||||
'address_line1' => auth('contact')->user()->client->address1,
|
||||
'city' => auth('contact')->user()->client->city,
|
||||
'postal_code' => auth('contact')->user()->client->postal_code,
|
||||
'given_name' => auth()->guard('contact')->user()->first_name,
|
||||
'family_name' => auth()->guard('contact')->user()->last_name,
|
||||
'email' => auth()->guard('contact')->user()->email,
|
||||
'address_line1' => auth()->guard('contact')->user()->client->address1,
|
||||
'city' => auth()->guard('contact')->user()->client->city,
|
||||
'postal_code' => auth()->guard('contact')->user()->client->postal_code,
|
||||
],
|
||||
],
|
||||
]);
|
||||
|
@ -74,13 +74,13 @@ class ACH
|
||||
$mailer = new NinjaMailerObject();
|
||||
|
||||
$mailer->mailable = new ACHVerificationNotification(
|
||||
auth('contact')->user()->client->company,
|
||||
route('client.contact_login', ['contact_key' => auth('contact')->user()->contact_key, 'next' => $verification])
|
||||
auth()->guard('contact')->user()->client->company,
|
||||
route('client.contact_login', ['contact_key' => auth()->guard('contact')->user()->contact_key, 'next' => $verification])
|
||||
);
|
||||
|
||||
$mailer->company = auth('contact')->user()->client->company;
|
||||
$mailer->settings = auth('contact')->user()->client->company->settings;
|
||||
$mailer->to_user = auth('contact')->user();
|
||||
$mailer->company = auth()->guard('contact')->user()->client->company;
|
||||
$mailer->settings = auth()->guard('contact')->user()->client->company->settings;
|
||||
$mailer->to_user = auth()->guard('contact')->user();
|
||||
|
||||
NinjaMailerJob::dispatch($mailer);
|
||||
|
||||
@ -210,7 +210,7 @@ class ACH
|
||||
|
||||
$source = ClientGatewayToken::query()
|
||||
->where('id', $this->decodePrimaryKey($request->source))
|
||||
->where('company_id', auth('contact')->user()->client->company->id)
|
||||
->where('company_id', auth()->guard('contact')->user()->client->company->id)
|
||||
->first();
|
||||
|
||||
if (!$source) {
|
||||
|
@ -66,13 +66,13 @@ class ACSS
|
||||
$mailer = new NinjaMailerObject();
|
||||
|
||||
$mailer->mailable = new ACHVerificationNotification(
|
||||
auth('contact')->user()->client->company,
|
||||
route('client.contact_login', ['contact_key' => auth('contact')->user()->contact_key, 'next' => $verification])
|
||||
auth()->guard('contact')->user()->client->company,
|
||||
route('client.contact_login', ['contact_key' => auth()->guard('contact')->user()->contact_key, 'next' => $verification])
|
||||
);
|
||||
|
||||
$mailer->company = auth('contact')->user()->client->company;
|
||||
$mailer->settings = auth('contact')->user()->client->company->settings;
|
||||
$mailer->to_user = auth('contact')->user();
|
||||
$mailer->company = auth()->guard('contact')->user()->client->company;
|
||||
$mailer->settings = auth()->guard('contact')->user()->client->company->settings;
|
||||
$mailer->to_user = auth()->guard('contact')->user();
|
||||
|
||||
NinjaMailerJob::dispatch($mailer);
|
||||
|
||||
|
@ -91,7 +91,7 @@ class SubscriptionService
|
||||
'invoice' => $this->encodePrimaryKey($payment_hash->fee_invoice_id),
|
||||
'client' => $recurring_invoice->client->hashed_id,
|
||||
'subscription' => $this->subscription->hashed_id,
|
||||
'contact' => auth('contact')->user() ? auth('contact')->user()->hashed_id : $recurring_invoice->client->contacts()->first()->hashed_id,
|
||||
'contact' => auth()->guard('contact')->user() ? auth()->guard('contact')->user()->hashed_id : $recurring_invoice->client->contacts()->first()->hashed_id,
|
||||
'account_key' => $recurring_invoice->client->custom_value2,
|
||||
];
|
||||
|
||||
@ -452,7 +452,7 @@ class SubscriptionService
|
||||
'credit' => $credit ? $credit->hashed_id : null,
|
||||
'client' => $new_recurring_invoice->client->hashed_id,
|
||||
'subscription' => $target_subscription->hashed_id,
|
||||
'contact' => auth('contact')->user()->hashed_id,
|
||||
'contact' => auth()->guard('contact')->user()->hashed_id,
|
||||
'account_key' => $new_recurring_invoice->client->custom_value2,
|
||||
];
|
||||
|
||||
@ -573,7 +573,7 @@ class SubscriptionService
|
||||
'invoice' => $this->encodePrimaryKey($payment_hash->fee_invoice_id),
|
||||
'client' => $recurring_invoice->client->hashed_id,
|
||||
'subscription' => $this->subscription->hashed_id,
|
||||
'contact' => auth('contact')->user()->hashed_id,
|
||||
'contact' => auth()->guard('contact')->user()->hashed_id,
|
||||
'account_key' => $recurring_invoice->client->custom_value2,
|
||||
];
|
||||
|
||||
@ -921,7 +921,7 @@ class SubscriptionService
|
||||
'subscription' => $this->subscription->hashed_id,
|
||||
'recurring_invoice' => $recurring_invoice->hashed_id,
|
||||
'client' => $recurring_invoice->client->hashed_id,
|
||||
'contact' => auth('contact')->user()->hashed_id,
|
||||
'contact' => auth()->guard('contact')->user()->hashed_id,
|
||||
'account_key' => $recurring_invoice->client->custom_value2,
|
||||
];
|
||||
|
||||
|
@ -71,7 +71,7 @@ class ZeroCostProduct extends AbstractService
|
||||
'invoice' => $invoice->hashed_id,
|
||||
'client' => $recurring_invoice->client->hashed_id,
|
||||
'subscription' => $this->subscription->hashed_id,
|
||||
'contact' => auth('contact')->user()->hashed_id,
|
||||
'contact' => auth()->guard('contact')->user()->hashed_id,
|
||||
'redirect_url' => "/client/recurring_invoices/{$recurring_invoice->hashed_id}",
|
||||
];
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
@section('meta_title', ctrans('texts.purchase'))
|
||||
|
||||
@section('body')
|
||||
@livewire('billing-portal-purchase', ['subscription' => $subscription, 'company' => $subscription->company, 'contact' => auth('contact')->user(), 'hash' => $hash, 'request_data' => $request_data, 'campaign' => request()->query('campaign') ?? null])
|
||||
@livewire('billing-portal-purchase', ['subscription' => $subscription, 'company' => $subscription->company, 'contact' => auth()->guard('contact')->user(), 'hash' => $hash, 'request_data' => $request_data, 'campaign' => request()->query('campaign') ?? null])
|
||||
@stop
|
||||
|
||||
@push('footer')
|
||||
|
@ -1,7 +1,7 @@
|
||||
<footer class="bg-white px-4 py-5 shadow px-4 sm:px-6 md:px-8 flex justify-center border-t border-gray-200 justify-between items-center" x-data="{ privacy: false, tos: false }">
|
||||
<section>
|
||||
@if(auth('contact')->user() && auth('contact')->user()->user->account->isPaid())
|
||||
<span class="text-xs md:text-sm text-gray-700">{{ ctrans('texts.footer_label', ['company' => auth('contact')->user()->company->present()->name(), 'year' => date('Y')]) }}</span>
|
||||
@if(auth()->guard('contact')->user() && auth()->guard('contact')->user()->user->account->isPaid())
|
||||
<span class="text-xs md:text-sm text-gray-700">{{ ctrans('texts.footer_label', ['company' => auth()->guard('contact')->user()->company->present()->name(), 'year' => date('Y')]) }}</span>
|
||||
@else
|
||||
<span href="https://invoiceninja.com" target="_blank" class="text-xs md:text-sm text-gray-700">
|
||||
{{ ctrans('texts.copyright') }} © {{ date('Y') }}
|
||||
@ -26,7 +26,7 @@
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@if(auth('contact')->user()->user && !auth('contact')->user()->user->account->isPaid())
|
||||
@if(auth()->guard('contact')->user()->user && !auth()->guard('contact')->user()->user->account->isPaid())
|
||||
<a href="https://invoiceninja.com" target="_blank">
|
||||
<img class="h-8" src="{{ asset('images/invoiceninja-black-logo-2.png') }}" alt="Invoice Ninja Logo">
|
||||
</a>
|
||||
|
@ -2,8 +2,8 @@
|
||||
<div class="flex flex-col w-64">
|
||||
<div class="flex items-center h-16 flex-shrink-0 px-4 bg-white border-r justify-center z-10">
|
||||
<a href="{{ route('client.dashboard') }}">
|
||||
<img class="h-10 w-auto" src="{!! auth('contact')->user()->company->present()->logo($settings) !!}"
|
||||
alt="{{ auth('contact')->user()->company->present()->name() }} logo"/>
|
||||
<img class="h-10 w-auto" src="{!! auth()->guard('contact')->user()->company->present()->logo($settings) !!}"
|
||||
alt="{{ auth()->guard('contact')->user()->company->present()->name() }} logo"/>
|
||||
</a>
|
||||
</div>
|
||||
<div class="h-0 flex-1 flex flex-col overflow-y-auto z-0 border-r">
|
||||
@ -24,7 +24,7 @@
|
||||
@endforeach
|
||||
</nav>
|
||||
|
||||
@if(!auth('contact')->user()->user->account->isPaid())
|
||||
@if(!auth()->guard('contact')->user()->user->account->isPaid())
|
||||
<div class="flex-shrink-0 flex bg-white p-4 justify-center">
|
||||
<div class="flex items-center">
|
||||
<a target="_blank" href="https://www.facebook.com/invoiceninja/">
|
||||
|
@ -12,7 +12,7 @@
|
||||
<div>
|
||||
<span class="rounded shadow-sm">
|
||||
<button x-on:click="open = !open" x-on:click.away="open = false" type="button" class="inline-flex justify-center w-full rounded-md border border-gray-300 px-4 py-2 bg-white text-sm leading-5 font-medium text-gray-700 hover:text-gray-500 focus:outline-none focus:border-blue-300 focus:ring-blue active:bg-gray-50 active:text-gray-800 transition ease-in-out duration-150">
|
||||
<span class="hidden md:block mr-1">{{ auth('contact')->user()->company->present()->name }}</span>
|
||||
<span class="hidden md:block mr-1">{{ auth()->guard('contact')->user()->company->present()->name }}</span>
|
||||
<svg class="md:-mr-1 md:ml-2 h-5 w-5" fill="currentColor" viewBox="0 0 20 20">
|
||||
<path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd" />
|
||||
</svg>
|
||||
@ -37,8 +37,8 @@
|
||||
<div>
|
||||
<button data-ref="client-profile-dropdown" @click="open = !open"
|
||||
class="max-w-xs flex items-center text-sm rounded-full focus:outline-none focus:ring">
|
||||
<img class="h-8 w-8 rounded-full" src="{{ auth('contact')->user()->avatar() }}" alt=""/>
|
||||
<span class="ml-2 hidden sm:block">{{ auth('contact')->user()->present()->name() }}</span>
|
||||
<img class="h-8 w-8 rounded-full" src="{{ auth()->guard('contact')->user()->avatar() }}" alt=""/>
|
||||
<span class="ml-2 hidden sm:block">{{ auth()->guard('contact')->user()->present()->name() }}</span>
|
||||
</button>
|
||||
</div>
|
||||
<div x-show="open" style="display:none;" x-transition:enter="transition ease-out duration-100"
|
||||
@ -50,7 +50,7 @@
|
||||
class="origin-top-right absolute right-0 mt-2 w-48 rounded-md shadow-lg">
|
||||
<div class="py-1 rounded-md bg-white ring-1 ring-black ring-opacity-5">
|
||||
<a data-ref="client-profile-dropdown-settings"
|
||||
href="{{ route('client.profile.edit', ['client_contact' => auth('contact')->user()->hashed_id]) }}"
|
||||
href="{{ route('client.profile.edit', ['client_contact' => auth()->guard('contact')->user()->hashed_id]) }}"
|
||||
class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 transition ease-in-out duration-150">
|
||||
{{ ctrans('texts.profile') }}
|
||||
</a>
|
||||
|
@ -9,7 +9,7 @@
|
||||
</button>
|
||||
</div>
|
||||
<div class="flex-shrink-0 flex items-center px-4">
|
||||
<img class="h-8 w-auto" src="{!! auth('contact')->user()->company->present()->logo($settings) !!}" alt="{{ auth('contact')->user()->company->present()->name() }} logo" />
|
||||
<img class="h-8 w-auto" src="{!! auth()->guard('contact')->user()->company->present()->logo($settings) !!}" alt="{{ auth()->guard('contact')->user()->company->present()->name() }} logo" />
|
||||
</div>
|
||||
<div class="mt-5 flex-1 h-0 overflow-y-auto">
|
||||
<nav class="flex-1 pb-4 pt-0 bg-white">
|
||||
@ -28,7 +28,7 @@
|
||||
@endforeach
|
||||
</nav>
|
||||
|
||||
@if(!auth('contact')->user()->user->account->isPaid())
|
||||
@if(!auth()->guard('contact')->user()->user->account->isPaid())
|
||||
<div class="flex-shrink-0 flex bg-white p-4 justify-center">
|
||||
<div class="flex items-center">
|
||||
<a target="_blank" href="https://www.facebook.com/invoiceninja/">
|
||||
|
@ -70,7 +70,7 @@
|
||||
|
||||
@component('portal.ninja2020.components.general.card-element-single')
|
||||
<input type="checkbox" class="form-checkbox mr-1" id="accept-terms" required>
|
||||
<label for="accept-terms" class="cursor-pointer">{{ ctrans('texts.ach_authorization', ['company' => auth()->user()->company->present()->name, 'email' => auth('contact')->user()->client->company->settings->email]) }}</label>
|
||||
<label for="accept-terms" class="cursor-pointer">{{ ctrans('texts.ach_authorization', ['company' => auth()->user()->company->present()->name, 'email' => auth()->guard('contact')->user()->client->company->settings->email]) }}</label>
|
||||
@endcomponent
|
||||
|
||||
@component('portal.ninja2020.gateways.includes.pay_now', ['id' => 'save-button'])
|
||||
|
@ -70,7 +70,7 @@
|
||||
|
||||
@component('portal.ninja2020.components.general.card-element-single')
|
||||
<input type="checkbox" class="form-checkbox mr-1" id="accept-terms" required>
|
||||
<label for="accept-terms" class="cursor-pointer">{{ ctrans('texts.ach_authorization', ['company' => auth()->user()->company->present()->name, 'email' => auth('contact')->user()->client->company->settings->email]) }}</label>
|
||||
<label for="accept-terms" class="cursor-pointer">{{ ctrans('texts.ach_authorization', ['company' => auth()->user()->company->present()->name, 'email' => auth()->guard('contact')->user()->client->company->settings->email]) }}</label>
|
||||
@endcomponent
|
||||
|
||||
@component('portal.ninja2020.gateways.includes.pay_now', ['id' => 'save-button'])
|
||||
|
@ -70,7 +70,7 @@
|
||||
|
||||
@component('portal.ninja2020.components.general.card-element-single')
|
||||
<input type="checkbox" class="form-checkbox mr-1" id="accept-terms" required>
|
||||
<label for="accept-terms" class="cursor-pointer">{{ ctrans('texts.ach_authorization', ['company' => auth()->user()->company->present()->name, 'email' => auth('contact')->user()->client->company->settings->email]) }}</label>
|
||||
<label for="accept-terms" class="cursor-pointer">{{ ctrans('texts.ach_authorization', ['company' => auth()->user()->company->present()->name, 'email' => auth()->guard('contact')->user()->client->company->settings->email]) }}</label>
|
||||
@endcomponent
|
||||
|
||||
@component('portal.ninja2020.gateways.includes.pay_now', ['id' => 'save-button'])
|
||||
|
@ -70,7 +70,7 @@
|
||||
|
||||
@component('portal.ninja2020.components.general.card-element-single')
|
||||
<input type="checkbox" class="form-checkbox mr-1" id="accept-terms" required>
|
||||
<label for="accept-terms" class="cursor-pointer">{{ ctrans('texts.ach_authorization', ['company' => auth()->user()->company->present()->name, 'email' => auth('contact')->user()->client->company->settings->email]) }}</label>
|
||||
<label for="accept-terms" class="cursor-pointer">{{ ctrans('texts.ach_authorization', ['company' => auth()->user()->company->present()->name, 'email' => auth()->guard('contact')->user()->client->company->settings->email]) }}</label>
|
||||
@endcomponent
|
||||
|
||||
@component('portal.ninja2020.gateways.includes.pay_now', ['id' => 'save-button'])
|
||||
|
@ -57,7 +57,7 @@
|
||||
<!-- Styles -->
|
||||
<link href="{{ mix('css/app.css') }}" rel="stylesheet">
|
||||
|
||||
@if(!auth('contact')->user()->user->account->isPaid())
|
||||
@if(!auth()->guard('contact')->user()->user->account->isPaid())
|
||||
<link href="{{ asset('favicon.png') }}" rel="shortcut icon" type="image/png">
|
||||
@endif
|
||||
|
||||
|
@ -32,7 +32,7 @@
|
||||
|
||||
<!-- Title -->
|
||||
@auth()
|
||||
<title>@yield('meta_title', '') — {{ auth('contact')->user()->user->account->isPaid() ? auth('contact')->user()->company->present()->name() : 'Invoice Ninja' }}</title>
|
||||
<title>@yield('meta_title', '') — {{ auth()->guard('contact')->user()->user->account->isPaid() ? auth()->guard('contact')->user()->company->present()->name() : 'Invoice Ninja' }}</title>
|
||||
@endauth
|
||||
|
||||
@guest
|
||||
|
@ -11,7 +11,7 @@
|
||||
@endpush
|
||||
|
||||
@section('body')
|
||||
@livewire('required-client-info', ['fields' => method_exists($gateway, 'getClientRequiredFields') ? $gateway->getClientRequiredFields() : [], 'contact' => auth('contact')->user(), 'countries' => $countries, 'company' => $company])
|
||||
@livewire('required-client-info', ['fields' => method_exists($gateway, 'getClientRequiredFields') ? $gateway->getClientRequiredFields() : [], 'contact' => auth()->guard('contact')->user(), 'countries' => $countries, 'company' => $company])
|
||||
|
||||
<div class="container mx-auto grid grid-cols-12 opacity-25 pointer-events-none" data-ref="gateway-container">
|
||||
<div class="col-span-12 lg:col-span-6 lg:col-start-4 overflow-hidden bg-white shadow rounded-lg">
|
||||
|
@ -32,7 +32,7 @@
|
||||
|
||||
<!-- Title -->
|
||||
@auth()
|
||||
<title>@yield('meta_title', '') — {{ auth('contact')->user()->user->account->isPaid() ? auth('contact')->user()->company->present()->name() : 'Invoice Ninja' }}</title>
|
||||
<title>@yield('meta_title', '') — {{ auth()->guard('contact')->user()->user->account->isPaid() ? auth()->guard('contact')->user()->company->present()->name() : 'Invoice Ninja' }}</title>
|
||||
@endauth
|
||||
|
||||
@guest
|
||||
|
Loading…
x
Reference in New Issue
Block a user