mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-05 18:52:44 +01:00
Fixes for defaults
This commit is contained in:
parent
d0e7c018e0
commit
40f336c469
@ -55,10 +55,13 @@ class InvitationController extends Controller
|
||||
/* Return early if we have the correct client_hash embedded */
|
||||
|
||||
if (request()->has('client_hash') && request()->input('client_hash') == $invitation->contact->client->client_hash) {
|
||||
nlog("scenario 1");
|
||||
auth()->guard('contact')->login($invitation->contact, true);
|
||||
} elseif ((bool) $invitation->contact->client->getSetting('enable_client_portal_password') !== false) {
|
||||
nlog("scenario 2");
|
||||
$this->middleware('auth:contact');
|
||||
} else {
|
||||
nlog("scenario 3");
|
||||
auth()->guard('contact')->login($invitation->contact, true);
|
||||
}
|
||||
|
||||
|
@ -202,10 +202,6 @@ class BaseRepository
|
||||
|
||||
/* Model now persisted, now lets do some child tasks */
|
||||
|
||||
/* If client currency differs from the company default currency, then insert the client exchange rate on the model.*/
|
||||
if($client->currency()->id != (int) $model->company->settings->currency_id)
|
||||
$model->exchange_rate = $client->currency()->exchange_rate;
|
||||
|
||||
/* Save any documents */
|
||||
if (array_key_exists('documents', $data))
|
||||
$this->saveDocuments($data['documents'], $model);
|
||||
|
@ -102,18 +102,18 @@ class CreditService
|
||||
{
|
||||
$settings = $this->credit->client->getMergedSettings();
|
||||
|
||||
if (! $this->credit->design_id) {
|
||||
if (! $this->credit->design_id)
|
||||
$this->credit->design_id = $this->decodePrimaryKey($settings->credit_design_id);
|
||||
}
|
||||
|
||||
if (!isset($this->credit->footer)) {
|
||||
|
||||
if (!isset($this->credit->footer))
|
||||
$this->credit->footer = $settings->credit_footer;
|
||||
}
|
||||
|
||||
if (!isset($this->credit->terms)) {
|
||||
if (!isset($this->credit->terms))
|
||||
$this->credit->terms = $settings->credit_terms;
|
||||
}
|
||||
|
||||
/* If client currency differs from the company default currency, then insert the client exchange rate on the model.*/
|
||||
if(!isset($this->credit->exchange_rate) && $this->credit->client->currency()->id != (int) $this->credit->company->settings->currency_id)
|
||||
$this->credit->exchange_rate = $this->credit->client->currency()->exchange_rate;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
@ -364,18 +364,19 @@ class InvoiceService
|
||||
{
|
||||
$settings = $this->invoice->client->getMergedSettings();
|
||||
|
||||
if (! $this->invoice->design_id) {
|
||||
if (! $this->invoice->design_id)
|
||||
$this->invoice->design_id = $this->decodePrimaryKey($settings->invoice_design_id);
|
||||
}
|
||||
|
||||
if (!isset($this->invoice->footer)) {
|
||||
$this->invoice->footer = $settings->invoice_footer;
|
||||
}
|
||||
|
||||
if (!isset($this->invoice->terms)) {
|
||||
$this->invoice->terms = $settings->invoice_terms;
|
||||
}
|
||||
|
||||
if (!isset($this->invoice->footer))
|
||||
$this->invoice->footer = $settings->invoice_footer;
|
||||
|
||||
if (!isset($this->invoice->terms))
|
||||
$this->invoice->terms = $settings->invoice_terms;
|
||||
|
||||
/* If client currency differs from the company default currency, then insert the client exchange rate on the model.*/
|
||||
if(!isset($this->invoice->exchange_rate) && $this->invoice->client->currency()->id != (int) $this->invoice->company->settings->currency_id)
|
||||
$this->invoice->exchange_rate = $this->invoice->client->currency()->exchange_rate;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -159,18 +159,18 @@ class QuoteService
|
||||
{
|
||||
$settings = $this->quote->client->getMergedSettings();
|
||||
|
||||
if (! $this->quote->design_id) {
|
||||
if (! $this->quote->design_id)
|
||||
$this->quote->design_id = $this->decodePrimaryKey($settings->quote_design_id);
|
||||
}
|
||||
|
||||
if (!isset($this->quote->footer)) {
|
||||
if (!isset($this->quote->footer))
|
||||
$this->quote->footer = $settings->quote_footer;
|
||||
}
|
||||
|
||||
if (!isset($this->quote->terms)) {
|
||||
|
||||
if (!isset($this->quote->terms))
|
||||
$this->quote->terms = $settings->quote_terms;
|
||||
}
|
||||
|
||||
|
||||
/* If client currency differs from the company default currency, then insert the client exchange rate on the model.*/
|
||||
if(!isset($this->quote->exchange_rate) && $this->quote->client->currency()->id != (int) $this->quote->company->settings->currency_id)
|
||||
$this->quote->exchange_rate = $this->quote->client->currency()->exchange_rate;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user