mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 13:04:30 -04:00
commit
538cfcdaa2
@ -1 +1 @@
|
|||||||
5.6.21
|
5.6.22
|
@ -711,6 +711,29 @@ class CreateSingleAccount extends Command
|
|||||||
$cg->save();
|
$cg->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (config('ninja.testvars.paypal_rest') && ($this->gateway == 'all' || $this->gateway == 'paypal_rest')) {
|
||||||
|
$cg = new CompanyGateway;
|
||||||
|
$cg->company_id = $company->id;
|
||||||
|
$cg->user_id = $user->id;
|
||||||
|
$cg->gateway_key = '80af24a6a691230bbec33e930ab40665';
|
||||||
|
$cg->require_cvv = true;
|
||||||
|
$cg->require_billing_address = true;
|
||||||
|
$cg->require_shipping_address = true;
|
||||||
|
$cg->update_details = true;
|
||||||
|
$cg->config = encrypt(config('ninja.testvars.paypal_rest'));
|
||||||
|
$cg->save();
|
||||||
|
|
||||||
|
$gateway_types = $cg->driver()->gatewayTypes();
|
||||||
|
|
||||||
|
$fees_and_limits = new stdClass;
|
||||||
|
$fees_and_limits->{$gateway_types[0]} = new FeesAndLimits;
|
||||||
|
|
||||||
|
$cg->fees_and_limits = $fees_and_limits;
|
||||||
|
$cg->save();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (config('ninja.testvars.checkout') && ($this->gateway == 'all' || $this->gateway == 'checkout')) {
|
if (config('ninja.testvars.checkout') && ($this->gateway == 'all' || $this->gateway == 'checkout')) {
|
||||||
$cg = new CompanyGateway;
|
$cg = new CompanyGateway;
|
||||||
$cg->company_id = $company->id;
|
$cg->company_id = $company->id;
|
||||||
|
@ -37,7 +37,6 @@ class AccountCreated extends GenericCounter
|
|||||||
*
|
*
|
||||||
* date("Y-m-d H:i:s")
|
* date("Y-m-d H:i:s")
|
||||||
*
|
*
|
||||||
* @var \DateTime
|
|
||||||
*/
|
*/
|
||||||
public $datetime;
|
public $datetime;
|
||||||
|
|
||||||
|
@ -37,7 +37,6 @@ class AccountDeleted extends GenericCounter
|
|||||||
*
|
*
|
||||||
* date("Y-m-d H:i:s")
|
* date("Y-m-d H:i:s")
|
||||||
*
|
*
|
||||||
* @var \DateTime
|
|
||||||
*/
|
*/
|
||||||
public $datetime;
|
public $datetime;
|
||||||
|
|
||||||
|
@ -37,7 +37,6 @@ class AccountPlatform extends GenericMixedMetric
|
|||||||
*
|
*
|
||||||
* date("Y-m-d H:i:s")
|
* date("Y-m-d H:i:s")
|
||||||
*
|
*
|
||||||
* @var \DateTime
|
|
||||||
*/
|
*/
|
||||||
public $datetime;
|
public $datetime;
|
||||||
|
|
||||||
|
@ -37,7 +37,6 @@ class AccountSignup extends GenericMixedMetric
|
|||||||
*
|
*
|
||||||
* date("Y-m-d H:i:s")
|
* date("Y-m-d H:i:s")
|
||||||
*
|
*
|
||||||
* @var \DateTime
|
|
||||||
*/
|
*/
|
||||||
public $datetime;
|
public $datetime;
|
||||||
|
|
||||||
@ -61,7 +60,7 @@ class AccountSignup extends GenericMixedMetric
|
|||||||
* The counter
|
* The counter
|
||||||
* set to 1.
|
* set to 1.
|
||||||
*
|
*
|
||||||
* @var string
|
* @var int
|
||||||
*/
|
*/
|
||||||
public $int_metric1 = 1;
|
public $int_metric1 = 1;
|
||||||
|
|
||||||
|
@ -37,7 +37,6 @@ class BankAccountsCreated extends GenericMixedMetric
|
|||||||
*
|
*
|
||||||
* date("Y-m-d H:i:s")
|
* date("Y-m-d H:i:s")
|
||||||
*
|
*
|
||||||
* @var \DateTime
|
|
||||||
*/
|
*/
|
||||||
public $datetime;
|
public $datetime;
|
||||||
|
|
||||||
|
@ -37,7 +37,6 @@ class DbQuery extends GenericMixedMetric
|
|||||||
*
|
*
|
||||||
* date("Y-m-d H:i:s")
|
* date("Y-m-d H:i:s")
|
||||||
*
|
*
|
||||||
* @var \DateTime
|
|
||||||
*/
|
*/
|
||||||
public $datetime;
|
public $datetime;
|
||||||
|
|
||||||
@ -57,7 +56,7 @@ class DbQuery extends GenericMixedMetric
|
|||||||
* The counter
|
* The counter
|
||||||
* set to 1.
|
* set to 1.
|
||||||
*
|
*
|
||||||
* @var string
|
* @var int
|
||||||
*/
|
*/
|
||||||
public $int_metric1 = 1;
|
public $int_metric1 = 1;
|
||||||
|
|
||||||
|
@ -37,7 +37,6 @@ class EmailCount extends GenericMixedMetric
|
|||||||
*
|
*
|
||||||
* date("Y-m-d H:i:s")
|
* date("Y-m-d H:i:s")
|
||||||
*
|
*
|
||||||
* @var \DateTime
|
|
||||||
*/
|
*/
|
||||||
public $datetime;
|
public $datetime;
|
||||||
|
|
||||||
|
@ -37,7 +37,6 @@ class EmailFailure extends GenericMixedMetric
|
|||||||
*
|
*
|
||||||
* date("Y-m-d H:i:s")
|
* date("Y-m-d H:i:s")
|
||||||
*
|
*
|
||||||
* @var \DateTime
|
|
||||||
*/
|
*/
|
||||||
public $datetime;
|
public $datetime;
|
||||||
|
|
||||||
@ -61,7 +60,6 @@ class EmailFailure extends GenericMixedMetric
|
|||||||
* The counter
|
* The counter
|
||||||
* set to 1.
|
* set to 1.
|
||||||
*
|
*
|
||||||
* @var string
|
|
||||||
*/
|
*/
|
||||||
public $int_metric1 = 1;
|
public $int_metric1 = 1;
|
||||||
|
|
||||||
|
@ -37,7 +37,6 @@ class EmailInvoiceFailure extends GenericMixedMetric
|
|||||||
*
|
*
|
||||||
* date("Y-m-d H:i:s")
|
* date("Y-m-d H:i:s")
|
||||||
*
|
*
|
||||||
* @var \DateTime
|
|
||||||
*/
|
*/
|
||||||
public $datetime;
|
public $datetime;
|
||||||
|
|
||||||
|
@ -37,7 +37,6 @@ class EmailSuccess extends GenericMixedMetric
|
|||||||
*
|
*
|
||||||
* date("Y-m-d H:i:s")
|
* date("Y-m-d H:i:s")
|
||||||
*
|
*
|
||||||
* @var \DateTime
|
|
||||||
*/
|
*/
|
||||||
public $datetime;
|
public $datetime;
|
||||||
|
|
||||||
@ -61,7 +60,6 @@ class EmailSuccess extends GenericMixedMetric
|
|||||||
* The counter
|
* The counter
|
||||||
* set to 1.
|
* set to 1.
|
||||||
*
|
*
|
||||||
* @var string
|
|
||||||
*/
|
*/
|
||||||
public $int_metric1 = 1;
|
public $int_metric1 = 1;
|
||||||
|
|
||||||
|
@ -37,7 +37,6 @@ class LivePreview extends GenericCounter
|
|||||||
*
|
*
|
||||||
* date("Y-m-d H:i:s")
|
* date("Y-m-d H:i:s")
|
||||||
*
|
*
|
||||||
* @var \DateTime
|
|
||||||
*/
|
*/
|
||||||
public $datetime;
|
public $datetime;
|
||||||
|
|
||||||
|
@ -37,7 +37,6 @@ class LoginFailure extends GenericCounter
|
|||||||
*
|
*
|
||||||
* date("Y-m-d H:i:s")
|
* date("Y-m-d H:i:s")
|
||||||
*
|
*
|
||||||
* @var \DateTime
|
|
||||||
*/
|
*/
|
||||||
public $datetime;
|
public $datetime;
|
||||||
|
|
||||||
|
@ -37,7 +37,6 @@ class LoginSuccess extends GenericCounter
|
|||||||
*
|
*
|
||||||
* date("Y-m-d H:i:s")
|
* date("Y-m-d H:i:s")
|
||||||
*
|
*
|
||||||
* @var \DateTime
|
|
||||||
*/
|
*/
|
||||||
public $datetime;
|
public $datetime;
|
||||||
|
|
||||||
|
@ -37,7 +37,6 @@ class EmailBounce extends GenericMixedMetric
|
|||||||
*
|
*
|
||||||
* date("Y-m-d H:i:s")
|
* date("Y-m-d H:i:s")
|
||||||
*
|
*
|
||||||
* @var \DateTime
|
|
||||||
*/
|
*/
|
||||||
public $datetime;
|
public $datetime;
|
||||||
|
|
||||||
@ -67,7 +66,6 @@ class EmailBounce extends GenericMixedMetric
|
|||||||
* The counter
|
* The counter
|
||||||
* set to 1.
|
* set to 1.
|
||||||
*
|
*
|
||||||
* @var string
|
|
||||||
*/
|
*/
|
||||||
public $int_metric1 = 1;
|
public $int_metric1 = 1;
|
||||||
|
|
||||||
|
@ -16,13 +16,13 @@ namespace App\DataMapper;
|
|||||||
*/
|
*/
|
||||||
class BaseSettings
|
class BaseSettings
|
||||||
{
|
{
|
||||||
//@deprecated
|
// //@deprecated
|
||||||
public function __construct($obj)
|
// public function __construct($obj)
|
||||||
{
|
// {
|
||||||
// foreach ($obj as $key => $value) {
|
// // foreach ($obj as $key => $value) {
|
||||||
// $obj->{$key} = $value;
|
// // $obj->{$key} = $value;
|
||||||
|
// // }
|
||||||
// }
|
// }
|
||||||
}
|
|
||||||
|
|
||||||
public static function setCasts($obj, $casts)
|
public static function setCasts($obj, $casts)
|
||||||
{
|
{
|
||||||
|
@ -47,17 +47,17 @@ class ClientSettings extends BaseSettings
|
|||||||
'send_reminders' => 'bool',
|
'send_reminders' => 'bool',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* Cast object values and return entire class
|
// * Cast object values and return entire class
|
||||||
* prevents missing properties from not being returned
|
// * prevents missing properties from not being returned
|
||||||
* and always ensure an up to date class is returned.
|
// * and always ensure an up to date class is returned.
|
||||||
*
|
// *
|
||||||
* @param $obj
|
// * @param $obj
|
||||||
*/
|
// */
|
||||||
public function __construct($obj)
|
// public function __construct($obj)
|
||||||
{
|
// {
|
||||||
parent::__construct($obj);
|
// // parent::__construct($obj);
|
||||||
}
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default Client Settings scaffold.
|
* Default Client Settings scaffold.
|
||||||
@ -78,8 +78,8 @@ class ClientSettings extends BaseSettings
|
|||||||
/**
|
/**
|
||||||
* Merges settings from Company to Client.
|
* Merges settings from Company to Client.
|
||||||
*
|
*
|
||||||
* @param stdClass $company_settings
|
* @param $company_settings
|
||||||
* @param stdClass $client_settings
|
* @param $client_settings
|
||||||
* @return stdClass of merged settings
|
* @return stdClass of merged settings
|
||||||
*/
|
*/
|
||||||
public static function buildClientSettings($company_settings, $client_settings)
|
public static function buildClientSettings($company_settings, $client_settings)
|
||||||
|
@ -767,18 +767,18 @@ class CompanySettings extends BaseSettings
|
|||||||
'purchase_order_design_id',
|
'purchase_order_design_id',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* Cast object values and return entire class
|
// * Cast object values and return entire class
|
||||||
* prevents missing properties from not being returned
|
// * prevents missing properties from not being returned
|
||||||
* and always ensure an up to date class is returned.
|
// * and always ensure an up to date class is returned.
|
||||||
*
|
// *
|
||||||
* @param $obj
|
// * @param $obj
|
||||||
* @deprecated
|
// * @deprecated
|
||||||
*/
|
// */
|
||||||
public function __construct()
|
// public function __construct()
|
||||||
{
|
// {
|
||||||
// parent::__construct($obj);
|
// // parent::__construct($obj);
|
||||||
}
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides class defaults on init.
|
* Provides class defaults on init.
|
||||||
|
@ -34,13 +34,4 @@ class DefaultSettings extends BaseSettings
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return stdClass
|
|
||||||
*/
|
|
||||||
private static function userSettingsObject() : stdClass
|
|
||||||
{
|
|
||||||
return (object) [
|
|
||||||
// 'per_page' => self::$per_page,
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -24,92 +24,78 @@ class EmailTemplateDefaults
|
|||||||
|
|
||||||
case 'email_template_invoice':
|
case 'email_template_invoice':
|
||||||
return self::emailInvoiceTemplate();
|
return self::emailInvoiceTemplate();
|
||||||
break;
|
|
||||||
case 'email_template_quote':
|
case 'email_template_quote':
|
||||||
return self::emailQuoteTemplate();
|
return self::emailQuoteTemplate();
|
||||||
break;
|
|
||||||
case 'email_template_credit':
|
case 'email_template_credit':
|
||||||
return self::emailCreditTemplate();
|
return self::emailCreditTemplate();
|
||||||
break;
|
|
||||||
case 'email_template_payment':
|
case 'email_template_payment':
|
||||||
return self::emailPaymentTemplate();
|
return self::emailPaymentTemplate();
|
||||||
break;
|
|
||||||
case 'email_template_payment_partial':
|
case 'email_template_payment_partial':
|
||||||
return self::emailPaymentPartialTemplate();
|
return self::emailPaymentPartialTemplate();
|
||||||
break;
|
|
||||||
case 'email_template_statement':
|
case 'email_template_statement':
|
||||||
return self::emailStatementTemplate();
|
return self::emailStatementTemplate();
|
||||||
break;
|
|
||||||
case 'email_template_reminder1':
|
case 'email_template_reminder1':
|
||||||
return self::emailReminder1Template();
|
return self::emailReminder1Template();
|
||||||
break;
|
|
||||||
case 'email_template_reminder2':
|
case 'email_template_reminder2':
|
||||||
return self::emailReminder2Template();
|
return self::emailReminder2Template();
|
||||||
break;
|
|
||||||
case 'email_template_reminder3':
|
case 'email_template_reminder3':
|
||||||
return self::emailReminder3Template();
|
return self::emailReminder3Template();
|
||||||
break;
|
|
||||||
case 'email_template_reminder_endless':
|
case 'email_template_reminder_endless':
|
||||||
return self::emailReminderEndlessTemplate();
|
return self::emailReminderEndlessTemplate();
|
||||||
break;
|
|
||||||
case 'email_template_custom1':
|
case 'email_template_custom1':
|
||||||
return self::emailInvoiceTemplate();
|
return self::emailInvoiceTemplate();
|
||||||
break;
|
|
||||||
case 'email_template_custom2':
|
case 'email_template_custom2':
|
||||||
return self::emailInvoiceTemplate();
|
return self::emailInvoiceTemplate();
|
||||||
break;
|
|
||||||
case 'email_template_custom3':
|
case 'email_template_custom3':
|
||||||
return self::emailInvoiceTemplate();
|
return self::emailInvoiceTemplate();
|
||||||
case 'email_template_purchase_order':
|
case 'email_template_purchase_order':
|
||||||
return self::emailPurchaseOrderTemplate();
|
return self::emailPurchaseOrderTemplate();
|
||||||
break;
|
|
||||||
|
|
||||||
/* Subject */
|
/* Subject */
|
||||||
case 'email_subject_purchase_order':
|
case 'email_subject_purchase_order':
|
||||||
return self::emailPurchaseOrderSubject();
|
return self::emailPurchaseOrderSubject();
|
||||||
case 'email_subject_invoice':
|
case 'email_subject_invoice':
|
||||||
return self::emailInvoiceSubject();
|
return self::emailInvoiceSubject();
|
||||||
break;
|
|
||||||
case 'email_subject_quote':
|
case 'email_subject_quote':
|
||||||
return self::emailQuoteSubject();
|
return self::emailQuoteSubject();
|
||||||
break;
|
|
||||||
case 'email_subject_credit':
|
case 'email_subject_credit':
|
||||||
return self::emailCreditSubject();
|
return self::emailCreditSubject();
|
||||||
break;
|
|
||||||
case 'email_subject_payment':
|
case 'email_subject_payment':
|
||||||
return self::emailPaymentSubject();
|
return self::emailPaymentSubject();
|
||||||
break;
|
|
||||||
case 'email_subject_payment_partial':
|
case 'email_subject_payment_partial':
|
||||||
return self::emailPaymentPartialSubject();
|
return self::emailPaymentPartialSubject();
|
||||||
break;
|
|
||||||
case 'email_subject_statement':
|
case 'email_subject_statement':
|
||||||
return self::emailStatementSubject();
|
return self::emailStatementSubject();
|
||||||
break;
|
|
||||||
case 'email_subject_reminder1':
|
case 'email_subject_reminder1':
|
||||||
return self::emailReminder1Subject();
|
return self::emailReminder1Subject();
|
||||||
break;
|
|
||||||
case 'email_subject_reminder2':
|
case 'email_subject_reminder2':
|
||||||
return self::emailReminder2Subject();
|
return self::emailReminder2Subject();
|
||||||
break;
|
|
||||||
case 'email_subject_reminder3':
|
case 'email_subject_reminder3':
|
||||||
return self::emailReminder3Subject();
|
return self::emailReminder3Subject();
|
||||||
break;
|
|
||||||
case 'email_subject_reminder_endless':
|
case 'email_subject_reminder_endless':
|
||||||
return self::emailReminderEndlessSubject();
|
return self::emailReminderEndlessSubject();
|
||||||
break;
|
|
||||||
case 'email_subject_custom1':
|
case 'email_subject_custom1':
|
||||||
return self::emailInvoiceSubject();
|
return self::emailInvoiceSubject();
|
||||||
break;
|
|
||||||
case 'email_subject_custom2':
|
case 'email_subject_custom2':
|
||||||
return self::emailInvoiceSubject();
|
return self::emailInvoiceSubject();
|
||||||
break;
|
|
||||||
case 'email_subject_custom3':
|
case 'email_subject_custom3':
|
||||||
return self::emailInvoiceSubject();
|
return self::emailInvoiceSubject();
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return self::emailInvoiceTemplate();
|
return self::emailInvoiceTemplate();
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,7 +141,6 @@ class FreeCompanySettings extends BaseSettings
|
|||||||
|
|
||||||
public static $casts = [
|
public static $casts = [
|
||||||
'portal_design_id' => 'string',
|
'portal_design_id' => 'string',
|
||||||
'currency_id' => 'string',
|
|
||||||
'task_number_pattern' => 'string',
|
'task_number_pattern' => 'string',
|
||||||
'task_number_counter' => 'int',
|
'task_number_counter' => 'int',
|
||||||
'expense_number_pattern' => 'string',
|
'expense_number_pattern' => 'string',
|
||||||
@ -191,16 +190,16 @@ class FreeCompanySettings extends BaseSettings
|
|||||||
'website' => 'string',
|
'website' => 'string',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* Cast object values and return entire class
|
// * Cast object values and return entire class
|
||||||
* prevents missing properties from not being returned
|
// * prevents missing properties from not being returned
|
||||||
* and always ensure an up to date class is returned.
|
// * and always ensure an up to date class is returned.
|
||||||
*
|
// *
|
||||||
* @param $obj
|
// * @param $obj
|
||||||
*/
|
// */
|
||||||
public function __construct($obj)
|
// public function __construct($obj)
|
||||||
{
|
// {
|
||||||
}
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides class defaults on init.
|
* Provides class defaults on init.
|
||||||
@ -223,7 +222,7 @@ class FreeCompanySettings extends BaseSettings
|
|||||||
$data->date_format_id = (string) config('ninja.i18n.date_format_id');
|
$data->date_format_id = (string) config('ninja.i18n.date_format_id');
|
||||||
$data->country_id = (string) config('ninja.i18n.country_id');
|
$data->country_id = (string) config('ninja.i18n.country_id');
|
||||||
$data->translations = (object) [];
|
$data->translations = (object) [];
|
||||||
$data->pdf_variables = (object) self::getEntityVariableDefaults();
|
// $data->pdf_variables = (object) self::getEntityVariableDefaults();
|
||||||
|
|
||||||
return self::setCasts($data, self::$casts);
|
return self::setCasts($data, self::$casts);
|
||||||
}
|
}
|
||||||
|
@ -251,7 +251,7 @@ class Rule extends BaseRule implements RuleInterface
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
$this->tax_rate = $this->client->company->tax_data->regions->AU->subregions->{$this->client->company->country()->iso_3166_2}->tax_rate;
|
$this->tax_rate = $this->client->company->tax_data->regions->AU->subregions->{$this->client->company->country()->iso_3166_2}->tax_rate;
|
||||||
$this->reduced_tax_rate = $this->client->company->tax_data->regions->AU->subregions->{$this->client->company->country()->iso_3166_2}->reduced_tax_rate;
|
$this->reduced_tax_rate = $this->client->company->tax_data->regions->AU->subregions->{$this->client->company->country()->iso_3166_2}->tax_rate;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
|
|
||||||
|
@ -197,7 +197,7 @@ class BaseRule implements RuleInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** If we are in a Origin based state, force the company tax here */
|
/** If we are in a Origin based state, force the company tax here */
|
||||||
if($company->origin_tax_data?->originDestination == 'O' && ($company->tax_data?->seller_subregion == $this->client_subregion)) {
|
if($company->origin_tax_data->originDestination == 'O' && ($company->tax_data?->seller_subregion == $this->client_subregion)) {
|
||||||
|
|
||||||
$tax_data = $company->origin_tax_data;
|
$tax_data = $company->origin_tax_data;
|
||||||
|
|
||||||
|
@ -33859,8 +33859,6 @@ class USStates
|
|||||||
'99926' => 'AK',
|
'99926' => 'AK',
|
||||||
'99927' => 'AK',
|
'99927' => 'AK',
|
||||||
'99929' => 'AK',
|
'99929' => 'AK',
|
||||||
'13021' => 'NY',
|
|
||||||
'13024' => 'NY',
|
|
||||||
];
|
];
|
||||||
|
|
||||||
public static function get(): array
|
public static function get(): array
|
||||||
|
@ -30,7 +30,7 @@ class DesignWasCreated
|
|||||||
/**
|
/**
|
||||||
* Get the channels the event should broadcast on.
|
* Get the channels the event should broadcast on.
|
||||||
*
|
*
|
||||||
* @return PrivateChannel
|
* @return PrivateChannel|array
|
||||||
*/
|
*/
|
||||||
public function broadcastOn()
|
public function broadcastOn()
|
||||||
{
|
{
|
||||||
|
@ -30,7 +30,7 @@ class DesignWasDeleted
|
|||||||
/**
|
/**
|
||||||
* Get the channels the event should broadcast on.
|
* Get the channels the event should broadcast on.
|
||||||
*
|
*
|
||||||
* @return PrivateChannel
|
* @return PrivateChannel|array
|
||||||
*/
|
*/
|
||||||
public function broadcastOn()
|
public function broadcastOn()
|
||||||
{
|
{
|
||||||
|
@ -30,7 +30,7 @@ class DesignWasRestored
|
|||||||
/**
|
/**
|
||||||
* Get the channels the event should broadcast on.
|
* Get the channels the event should broadcast on.
|
||||||
*
|
*
|
||||||
* @return PrivateChannel
|
* @return PrivateChannel|array
|
||||||
*/
|
*/
|
||||||
public function broadcastOn()
|
public function broadcastOn()
|
||||||
{
|
{
|
||||||
|
@ -30,7 +30,7 @@ class DesignWasUpdated
|
|||||||
/**
|
/**
|
||||||
* Get the channels the event should broadcast on.
|
* Get the channels the event should broadcast on.
|
||||||
*
|
*
|
||||||
* @return PrivateChannel
|
* @return PrivateChannel|array
|
||||||
*/
|
*/
|
||||||
public function broadcastOn()
|
public function broadcastOn()
|
||||||
{
|
{
|
||||||
|
@ -17,8 +17,10 @@ use App\Utils\Ninja;
|
|||||||
use Sentry\State\Scope;
|
use Sentry\State\Scope;
|
||||||
use Illuminate\Support\Arr;
|
use Illuminate\Support\Arr;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
use InvalidArgumentException;
|
||||||
use Sentry\Laravel\Integration;
|
use Sentry\Laravel\Integration;
|
||||||
use Illuminate\Support\Facades\Schema;
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
use Aws\Exception\CredentialsException;
|
||||||
use GuzzleHttp\Exception\ConnectException;
|
use GuzzleHttp\Exception\ConnectException;
|
||||||
use Illuminate\Auth\AuthenticationException;
|
use Illuminate\Auth\AuthenticationException;
|
||||||
use League\Flysystem\UnableToCreateDirectory;
|
use League\Flysystem\UnableToCreateDirectory;
|
||||||
@ -34,7 +36,6 @@ use Symfony\Component\Console\Exception\CommandNotFoundException;
|
|||||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||||
use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException;
|
use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException;
|
||||||
use Illuminate\Database\Eloquent\ModelNotFoundException as ModelNotFoundException;
|
use Illuminate\Database\Eloquent\ModelNotFoundException as ModelNotFoundException;
|
||||||
use InvalidArgumentException;
|
|
||||||
|
|
||||||
class Handler extends ExceptionHandler
|
class Handler extends ExceptionHandler
|
||||||
{
|
{
|
||||||
@ -64,7 +65,7 @@ class Handler extends ExceptionHandler
|
|||||||
ConnectException::class,
|
ConnectException::class,
|
||||||
RuntimeException::class,
|
RuntimeException::class,
|
||||||
InvalidArgumentException::class,
|
InvalidArgumentException::class,
|
||||||
Aws\Exception\CredentialsException::class,
|
CredentialsException::class,
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $hostedDontReport = [
|
protected $hostedDontReport = [
|
||||||
|
@ -14,7 +14,7 @@ namespace App\Exceptions;
|
|||||||
|
|
||||||
use Exception;
|
use Exception;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Http\Response;
|
use Illuminate\Http\JsonResponse;
|
||||||
|
|
||||||
class PaymentRefundFailed extends Exception
|
class PaymentRefundFailed extends Exception
|
||||||
{
|
{
|
||||||
@ -32,14 +32,14 @@ class PaymentRefundFailed extends Exception
|
|||||||
* Render the exception into an HTTP response.
|
* Render the exception into an HTTP response.
|
||||||
*
|
*
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @return Response
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function render($request)
|
public function render($request)
|
||||||
{
|
{
|
||||||
// $msg = 'Unable to refund the transaction';
|
// $msg = 'Unable to refund the transaction';
|
||||||
$msg = ctrans('texts.warning_local_refund');
|
$msg = ctrans('texts.warning_local_refund');
|
||||||
|
|
||||||
if ($this->getMessage() && strlen($this->getMessage()) >= 1) {
|
if ($this->getMessage() && strlen($this->getMessage()) > 1) {
|
||||||
$msg = $this->getMessage();
|
$msg = $this->getMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ namespace App\Exceptions;
|
|||||||
|
|
||||||
use Exception;
|
use Exception;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Http\Response;
|
use Illuminate\Http\JsonResponse;
|
||||||
|
|
||||||
class QuoteConversion extends Exception
|
class QuoteConversion extends Exception
|
||||||
{
|
{
|
||||||
@ -32,7 +32,7 @@ class QuoteConversion extends Exception
|
|||||||
* Render the exception into an HTTP response.
|
* Render the exception into an HTTP response.
|
||||||
*
|
*
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @return Response
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function render($request)
|
public function render($request)
|
||||||
{
|
{
|
||||||
|
@ -14,7 +14,7 @@ namespace App\Exceptions;
|
|||||||
|
|
||||||
use Exception;
|
use Exception;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Http\Response;
|
use Illuminate\Http\JsonResponse;
|
||||||
|
|
||||||
class YodleeApiException extends Exception
|
class YodleeApiException extends Exception
|
||||||
{
|
{
|
||||||
@ -32,14 +32,14 @@ class YodleeApiException extends Exception
|
|||||||
* Render the exception into an HTTP response.
|
* Render the exception into an HTTP response.
|
||||||
*
|
*
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @return Response
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function render($request)
|
public function render($request)
|
||||||
{
|
{
|
||||||
// $msg = 'Unable to refund the transaction';
|
// $msg = 'Unable to refund the transaction';
|
||||||
$msg = ctrans('texts.error');
|
$msg = ctrans('texts.error');
|
||||||
|
|
||||||
if ($this->getMessage() && strlen($this->getMessage()) >= 1) {
|
if ($this->getMessage() && strlen($this->getMessage()) > 1) {
|
||||||
$msg = $this->getMessage();
|
$msg = $this->getMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -373,6 +373,8 @@ class BaseExport
|
|||||||
if(!is_array($parts) || count($parts) < 2)
|
if(!is_array($parts) || count($parts) < 2)
|
||||||
return '';
|
return '';
|
||||||
|
|
||||||
|
$value = '';
|
||||||
|
|
||||||
match($parts[0]) {
|
match($parts[0]) {
|
||||||
'contact' => $value = $this->resolveClientContactKey($parts[1], $entity, $transformer),
|
'contact' => $value = $this->resolveClientContactKey($parts[1], $entity, $transformer),
|
||||||
'client' => $value = $this->resolveClientKey($parts[1], $entity, $transformer),
|
'client' => $value = $this->resolveClientKey($parts[1], $entity, $transformer),
|
||||||
@ -385,7 +387,7 @@ class BaseExport
|
|||||||
'purchase_order' => $value = $this->resolvePurchaseOrderKey($parts[1], $entity, $transformer),
|
'purchase_order' => $value = $this->resolvePurchaseOrderKey($parts[1], $entity, $transformer),
|
||||||
'payment' => $value = $this->resolvePaymentKey($parts[1], $entity, $transformer),
|
'payment' => $value = $this->resolvePaymentKey($parts[1], $entity, $transformer),
|
||||||
'task' => $value = $this->resolveTaskKey($parts[1], $entity, $transformer),
|
'task' => $value = $this->resolveTaskKey($parts[1], $entity, $transformer),
|
||||||
default => $value = ''
|
default => $value = '',
|
||||||
};
|
};
|
||||||
|
|
||||||
return $value;
|
return $value;
|
||||||
@ -580,6 +582,7 @@ class BaseExport
|
|||||||
private function resolveInvoiceKey($column, $entity, $transformer)
|
private function resolveInvoiceKey($column, $entity, $transformer)
|
||||||
{
|
{
|
||||||
nlog("searching for {$column}");
|
nlog("searching for {$column}");
|
||||||
|
$transformed_invoice = false;
|
||||||
|
|
||||||
if($transformer instanceof PaymentTransformer) {
|
if($transformer instanceof PaymentTransformer) {
|
||||||
$transformed_invoices = $transformer->includeInvoices($entity);
|
$transformed_invoices = $transformer->includeInvoices($entity);
|
||||||
@ -615,14 +618,14 @@ class BaseExport
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(array_key_exists($column, $transformed_invoice)) {
|
if($transformed_invoice && array_key_exists($column, $transformed_invoice)) {
|
||||||
return $transformed_invoice[$column];
|
return $transformed_invoice[$column];
|
||||||
} elseif (array_key_exists(str_replace("invoice.", "", $column), $transformed_invoice)) {
|
} elseif ($transformed_invoice && array_key_exists(str_replace("invoice.", "", $column), $transformed_invoice)) {
|
||||||
return $transformed_invoice[$column];
|
return $transformed_invoice[$column];
|
||||||
}
|
}
|
||||||
|
|
||||||
if($column == 'status')
|
// if($column == 'status')
|
||||||
return $entity->stringStatus($entity->status_id);
|
// return $entity->stringStatus($entity->status_id);
|
||||||
|
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
@ -163,11 +163,11 @@ class ClientExport extends BaseExport
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (in_array('client.country_id', $this->input['report_keys'])) {
|
if (in_array('client.country_id', $this->input['report_keys'])) {
|
||||||
$entity['country'] = $client->country ? ctrans("texts.country_{$client->country->name}") : '';
|
$entity['client.country_id'] = $client->country ? ctrans("texts.country_{$client->country->name}") : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (in_array('client.shipping_country_id', $this->input['report_keys'])) {
|
if (in_array('client.shipping_country_id', $this->input['report_keys'])) {
|
||||||
$entity['shipping_country'] = $client->shipping_country ? ctrans("texts.country_{$client->shipping_country->name}") : '';
|
$entity['client.shipping_country_id'] = $client->shipping_country ? ctrans("texts.country_{$client->shipping_country->name}") : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (in_array('client.currency_id', $this->input['report_keys'])) {
|
if (in_array('client.currency_id', $this->input['report_keys'])) {
|
||||||
|
@ -28,7 +28,7 @@ class ExpenseFactory
|
|||||||
$expense->tax_rate2 = 0;
|
$expense->tax_rate2 = 0;
|
||||||
$expense->tax_name3 = '';
|
$expense->tax_name3 = '';
|
||||||
$expense->tax_rate3 = 0;
|
$expense->tax_rate3 = 0;
|
||||||
$expense->date = null;
|
$expense->date = now()->format('Y-m-d');
|
||||||
$expense->payment_date = null;
|
$expense->payment_date = null;
|
||||||
$expense->amount = 0;
|
$expense->amount = 0;
|
||||||
$expense->foreign_amount = 0;
|
$expense->foreign_amount = 0;
|
||||||
|
@ -37,7 +37,7 @@ class BankTransactionFilters extends QueryFilters
|
|||||||
/**
|
/**
|
||||||
* Filter based on search text.
|
* Filter based on search text.
|
||||||
*
|
*
|
||||||
* @param string query filter
|
* @param string $filter
|
||||||
* @return Builder
|
* @return Builder
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
@ -118,7 +118,7 @@ class BankTransactionFilters extends QueryFilters
|
|||||||
/**
|
/**
|
||||||
* Sorts the list based on $sort.
|
* Sorts the list based on $sort.
|
||||||
*
|
*
|
||||||
* @param string sort formatted as column|asc
|
* @param string $sort formatted as column|asc
|
||||||
* @return Builder
|
* @return Builder
|
||||||
*/
|
*/
|
||||||
public function sort(string $sort = ''): Builder
|
public function sort(string $sort = ''): Builder
|
||||||
@ -151,7 +151,7 @@ class BankTransactionFilters extends QueryFilters
|
|||||||
/**
|
/**
|
||||||
* Filters the query by the users company ID.
|
* Filters the query by the users company ID.
|
||||||
*
|
*
|
||||||
* @return Illuminate\Database\Query\Builder
|
* @return \Illuminate\Database\Eloquent\Builder
|
||||||
*/
|
*/
|
||||||
public function entityFilter()
|
public function entityFilter()
|
||||||
{
|
{
|
||||||
|
@ -36,7 +36,7 @@ class BankTransactionRuleFilters extends QueryFilters
|
|||||||
/**
|
/**
|
||||||
* Filter based on search text.
|
* Filter based on search text.
|
||||||
*
|
*
|
||||||
* @param string query filter
|
* @param string $filter
|
||||||
* @return Builder
|
* @return Builder
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
@ -54,7 +54,7 @@ class BankTransactionRuleFilters extends QueryFilters
|
|||||||
/**
|
/**
|
||||||
* Sorts the list based on $sort.
|
* Sorts the list based on $sort.
|
||||||
*
|
*
|
||||||
* @param string sort formatted as column|asc
|
* @param string $sort formatted as column|asc
|
||||||
* @return Builder
|
* @return Builder
|
||||||
*/
|
*/
|
||||||
public function sort(string $sort = ''): Builder
|
public function sort(string $sort = ''): Builder
|
||||||
@ -71,7 +71,7 @@ class BankTransactionRuleFilters extends QueryFilters
|
|||||||
/**
|
/**
|
||||||
* Filters the query by the users company ID.
|
* Filters the query by the users company ID.
|
||||||
*
|
*
|
||||||
* @return Illuminate\Database\Query\Builder
|
* @return \Illuminate\Database\Eloquent\Builder
|
||||||
*/
|
*/
|
||||||
public function entityFilter()
|
public function entityFilter()
|
||||||
{
|
{
|
||||||
|
@ -21,7 +21,7 @@ class PaymentTermFilters extends QueryFilters
|
|||||||
/**
|
/**
|
||||||
* Filter based on search text.
|
* Filter based on search text.
|
||||||
*
|
*
|
||||||
* @param string query filter
|
* @param string $filter
|
||||||
* @return Builder
|
* @return Builder
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
@ -39,7 +39,7 @@ class PaymentTermFilters extends QueryFilters
|
|||||||
/**
|
/**
|
||||||
* Sorts the list based on $sort.
|
* Sorts the list based on $sort.
|
||||||
*
|
*
|
||||||
* @param string sort formatted as column|asc
|
* @param string $sort formatted as column|asc
|
||||||
* @return Builder
|
* @return Builder
|
||||||
*/
|
*/
|
||||||
public function sort(string $sort = ''): Builder
|
public function sort(string $sort = ''): Builder
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
|
|
||||||
namespace App\Filters;
|
namespace App\Filters;
|
||||||
|
|
||||||
//use Illuminate\Database\Query\Builder;
|
|
||||||
use App\Utils\Traits\MakesHash;
|
use App\Utils\Traits\MakesHash;
|
||||||
use Illuminate\Database\Eloquent\Builder;
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
@ -22,7 +22,7 @@ class QuoteFilters extends QueryFilters
|
|||||||
/**
|
/**
|
||||||
* Filter based on search text.
|
* Filter based on search text.
|
||||||
*
|
*
|
||||||
* @param string query filter
|
* @param string $filter
|
||||||
* @return Builder
|
* @return Builder
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
@ -124,7 +124,7 @@ class QuoteFilters extends QueryFilters
|
|||||||
/**
|
/**
|
||||||
* Sorts the list based on $sort.
|
* Sorts the list based on $sort.
|
||||||
*
|
*
|
||||||
* @param string sort formatted as column|asc
|
* @param string $sort formatted as column|asc
|
||||||
* @return Builder
|
* @return Builder
|
||||||
*/
|
*/
|
||||||
public function sort(string $sort = ''): Builder
|
public function sort(string $sort = ''): Builder
|
||||||
@ -152,7 +152,7 @@ class QuoteFilters extends QueryFilters
|
|||||||
/**
|
/**
|
||||||
* Filters the query by the users company ID.
|
* Filters the query by the users company ID.
|
||||||
*
|
*
|
||||||
* @return Illuminate\Eloquent\Query\Builder
|
* @return \Illuminate\Database\Eloquent\Builder
|
||||||
*/
|
*/
|
||||||
public function entityFilter(): Builder
|
public function entityFilter(): Builder
|
||||||
{
|
{
|
||||||
|
@ -21,7 +21,7 @@ class RecurringExpenseFilters extends QueryFilters
|
|||||||
/**
|
/**
|
||||||
* Filter based on search text.
|
* Filter based on search text.
|
||||||
*
|
*
|
||||||
* @param string query filter
|
* @param string $filter
|
||||||
* @return Builder
|
* @return Builder
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
@ -52,7 +52,7 @@ class RecurringExpenseFilters extends QueryFilters
|
|||||||
/**
|
/**
|
||||||
* Sorts the list based on $sort.
|
* Sorts the list based on $sort.
|
||||||
*
|
*
|
||||||
* @param string sort formatted as column|asc
|
* @param string $sort formatted as column|asc
|
||||||
* @return Builder
|
* @return Builder
|
||||||
*/
|
*/
|
||||||
public function sort(string $sort = ''): Builder
|
public function sort(string $sort = ''): Builder
|
||||||
@ -69,7 +69,7 @@ class RecurringExpenseFilters extends QueryFilters
|
|||||||
/**
|
/**
|
||||||
* Filters the query by the users company ID.
|
* Filters the query by the users company ID.
|
||||||
*
|
*
|
||||||
* @return Illuminate\Eloquent\Builder
|
* @return \Illuminate\Database\Eloquent\Builder
|
||||||
*/
|
*/
|
||||||
public function entityFilter(): Builder
|
public function entityFilter(): Builder
|
||||||
{
|
{
|
||||||
|
@ -21,7 +21,7 @@ class SubscriptionFilters extends QueryFilters
|
|||||||
/**
|
/**
|
||||||
* Filter based on search text.
|
* Filter based on search text.
|
||||||
*
|
*
|
||||||
* @param string query filter
|
* @param string $filter
|
||||||
* @return Builder
|
* @return Builder
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
@ -39,7 +39,7 @@ class SubscriptionFilters extends QueryFilters
|
|||||||
/**
|
/**
|
||||||
* Sorts the list based on $sort.
|
* Sorts the list based on $sort.
|
||||||
*
|
*
|
||||||
* @param string sort formatted as column|asc
|
* @param string $sort formatted as column|asc
|
||||||
* @return Builder
|
* @return Builder
|
||||||
*/
|
*/
|
||||||
public function sort(string $sort = ''): Builder
|
public function sort(string $sort = ''): Builder
|
||||||
|
@ -48,7 +48,7 @@ class SystemLogFilters extends QueryFilters
|
|||||||
/**
|
/**
|
||||||
* Filter based on search text.
|
* Filter based on search text.
|
||||||
*
|
*
|
||||||
* @param string query filter
|
* @param string $filter
|
||||||
* @return Builder
|
* @return Builder
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
@ -64,7 +64,7 @@ class SystemLogFilters extends QueryFilters
|
|||||||
/**
|
/**
|
||||||
* Sorts the list based on $sort.
|
* Sorts the list based on $sort.
|
||||||
*
|
*
|
||||||
* @param string sort formatted as column|asc
|
* @param string $sort formatted as column|asc
|
||||||
* @return Builder
|
* @return Builder
|
||||||
*/
|
*/
|
||||||
public function sort(string $sort = ''): Builder
|
public function sort(string $sort = ''): Builder
|
||||||
|
@ -24,7 +24,7 @@ class TaskFilters extends QueryFilters
|
|||||||
/**
|
/**
|
||||||
* Filter based on search text.
|
* Filter based on search text.
|
||||||
*
|
*
|
||||||
* @param string query filter
|
* @param string $filter
|
||||||
* @return Builder
|
* @return Builder
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
@ -99,7 +99,7 @@ class TaskFilters extends QueryFilters
|
|||||||
/**
|
/**
|
||||||
* Sorts the list based on $sort.
|
* Sorts the list based on $sort.
|
||||||
*
|
*
|
||||||
* @param string sort formatted as column|asc
|
* @param string $sort formatted as column|asc
|
||||||
* @return Builder
|
* @return Builder
|
||||||
*/
|
*/
|
||||||
public function sort(string $sort = ''): Builder
|
public function sort(string $sort = ''): Builder
|
||||||
@ -131,8 +131,8 @@ class TaskFilters extends QueryFilters
|
|||||||
|
|
||||||
$status_parameters = explode(',', $value);
|
$status_parameters = explode(',', $value);
|
||||||
|
|
||||||
if(count($status_parameters) > 0)
|
if(count($status_parameters) >= 1)
|
||||||
return $this->builder->whereIn('status_id', $this->transformKeys($status_parameters));
|
$this->builder->whereIn('status_id', $this->transformKeys($status_parameters));
|
||||||
|
|
||||||
return $this->builder;
|
return $this->builder;
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ class TaskStatusFilters extends QueryFilters
|
|||||||
/**
|
/**
|
||||||
* Filter based on search text.
|
* Filter based on search text.
|
||||||
*
|
*
|
||||||
* @param string query filter
|
* @param string $filter
|
||||||
* @return Builder
|
* @return Builder
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
@ -39,7 +39,7 @@ class TaskStatusFilters extends QueryFilters
|
|||||||
/**
|
/**
|
||||||
* Sorts the list based on $sort.
|
* Sorts the list based on $sort.
|
||||||
*
|
*
|
||||||
* @param string sort formatted as column|asc
|
* @param string $sort formatted as column|asc
|
||||||
* @return Builder
|
* @return Builder
|
||||||
*/
|
*/
|
||||||
public function sort(string $sort = ''): Builder
|
public function sort(string $sort = ''): Builder
|
||||||
|
@ -21,7 +21,7 @@ class TaxRateFilters extends QueryFilters
|
|||||||
/**
|
/**
|
||||||
* Filter based on search text.
|
* Filter based on search text.
|
||||||
*
|
*
|
||||||
* @param string query filter
|
* @param string $filter
|
||||||
* @return Builder
|
* @return Builder
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
@ -39,7 +39,7 @@ class TaxRateFilters extends QueryFilters
|
|||||||
/**
|
/**
|
||||||
* Sorts the list based on $sort.
|
* Sorts the list based on $sort.
|
||||||
*
|
*
|
||||||
* @param string sort formatted as column|asc
|
* @param string $sort formatted as column|asc
|
||||||
* @return Builder
|
* @return Builder
|
||||||
*/
|
*/
|
||||||
public function sort(string $sort = ''): Builder
|
public function sort(string $sort = ''): Builder
|
||||||
|
@ -21,7 +21,7 @@ class TokenFilters extends QueryFilters
|
|||||||
/**
|
/**
|
||||||
* Filter based on search text.
|
* Filter based on search text.
|
||||||
*
|
*
|
||||||
* @param string query filter
|
* @param string $filter
|
||||||
* @return Builder
|
* @return Builder
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
@ -45,7 +45,7 @@ class TokenFilters extends QueryFilters
|
|||||||
/**
|
/**
|
||||||
* Sorts the list based on $sort.
|
* Sorts the list based on $sort.
|
||||||
*
|
*
|
||||||
* @param string sort formatted as column|asc
|
* @param string $sort formatted as column|asc
|
||||||
* @return Builder
|
* @return Builder
|
||||||
*/
|
*/
|
||||||
public function sort(string $sort = ''): Builder
|
public function sort(string $sort = ''): Builder
|
||||||
|
@ -21,7 +21,7 @@ class UserFilters extends QueryFilters
|
|||||||
/**
|
/**
|
||||||
* Filter based on search text.
|
* Filter based on search text.
|
||||||
*
|
*
|
||||||
* @param string query filter
|
* @param string $filter
|
||||||
* @return Builder
|
* @return Builder
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
@ -43,7 +43,7 @@ class UserFilters extends QueryFilters
|
|||||||
/**
|
/**
|
||||||
* Sorts the list based on $sort.
|
* Sorts the list based on $sort.
|
||||||
*
|
*
|
||||||
* @param string sort formatted as column|asc
|
* @param string $sort formatted as column|asc
|
||||||
* @return Builder
|
* @return Builder
|
||||||
*/
|
*/
|
||||||
public function sort(string $sort = ''): Builder
|
public function sort(string $sort = ''): Builder
|
||||||
@ -69,6 +69,19 @@ class UserFilters extends QueryFilters
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filters users that have been removed from the
|
||||||
|
* company, but not deleted from the system.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function hideRemovedUsers()
|
||||||
|
{
|
||||||
|
return $this->builder->whereHas('company_users', function ($q) {
|
||||||
|
$q->where('company_id', '=', auth()->user()->company()->id)->whereNull('deleted_at');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Overrides the base with() function as no company ID
|
* Overrides the base with() function as no company ID
|
||||||
* exists on the user table
|
* exists on the user table
|
||||||
|
@ -21,7 +21,7 @@ class VendorFilters extends QueryFilters
|
|||||||
/**
|
/**
|
||||||
* Filter based on search text.
|
* Filter based on search text.
|
||||||
*
|
*
|
||||||
* @param string query filter
|
* @param string $filter
|
||||||
* @return Builder
|
* @return Builder
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
@ -58,7 +58,7 @@ class VendorFilters extends QueryFilters
|
|||||||
/**
|
/**
|
||||||
* Sorts the list based on $sort.
|
* Sorts the list based on $sort.
|
||||||
*
|
*
|
||||||
* @param string sort formatted as column|asc
|
* @param string $sort formatted as column|asc
|
||||||
* @return Builder
|
* @return Builder
|
||||||
*/
|
*/
|
||||||
public function sort(string $sort = ''): Builder
|
public function sort(string $sort = ''): Builder
|
||||||
|
@ -21,7 +21,7 @@ class WebhookFilters extends QueryFilters
|
|||||||
/**
|
/**
|
||||||
* Filter based on search text.
|
* Filter based on search text.
|
||||||
*
|
*
|
||||||
* @param string query filter
|
* @param string $filter
|
||||||
* @return Builder
|
* @return Builder
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
@ -39,7 +39,7 @@ class WebhookFilters extends QueryFilters
|
|||||||
/**
|
/**
|
||||||
* Sorts the list based on $sort.
|
* Sorts the list based on $sort.
|
||||||
*
|
*
|
||||||
* @param string sort formatted as column|asc
|
* @param string $sort formatted as column|asc
|
||||||
* @return Builder
|
* @return Builder
|
||||||
*/
|
*/
|
||||||
public function sort(string $sort = ''): Builder
|
public function sort(string $sort = ''): Builder
|
||||||
|
@ -19,7 +19,7 @@ use Illuminate\View\View;
|
|||||||
*
|
*
|
||||||
* @param $page
|
* @param $page
|
||||||
* @param bool $boolean
|
* @param bool $boolean
|
||||||
* @return bool
|
* @return bool | string
|
||||||
*/
|
*/
|
||||||
function isActive($page, bool $boolean = false)
|
function isActive($page, bool $boolean = false)
|
||||||
{
|
{
|
||||||
@ -40,8 +40,6 @@ function isActive($page, bool $boolean = false)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,9 +53,8 @@ class EpcQrGenerator
|
|||||||
$qr = $writer->writeString($this->encodeMessage(), 'utf-8');
|
$qr = $writer->writeString($this->encodeMessage(), 'utf-8');
|
||||||
} catch(\Throwable $e) {
|
} catch(\Throwable $e) {
|
||||||
return '';
|
return '';
|
||||||
} catch(\Exception $e) {
|
|
||||||
return '';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return "<svg viewBox='0 0 200 200' width='200' height='200' x='0' y='0' xmlns='http://www.w3.org/2000/svg'>
|
return "<svg viewBox='0 0 200 200' width='200' height='200' x='0' y='0' xmlns='http://www.w3.org/2000/svg'>
|
||||||
<rect x='0' y='0' width='100%'' height='100%' />{$qr}</svg>";
|
<rect x='0' y='0' width='100%'' height='100%' />{$qr}</svg>";
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Http\Response;
|
||||||
use App\Models\BankIntegration;
|
use App\Models\BankIntegration;
|
||||||
use App\Utils\Traits\MakesHash;
|
use App\Utils\Traits\MakesHash;
|
||||||
use Illuminate\Http\JsonResponse;
|
use Illuminate\Http\JsonResponse;
|
||||||
@ -50,7 +51,7 @@ class BankIntegrationController extends BaseController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param BankIntegrationFilters $filters
|
* @param BankIntegrationFilters $filters
|
||||||
* @return Responsec
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function index(BankIntegrationFilters $filters)
|
public function index(BankIntegrationFilters $filters)
|
||||||
{
|
{
|
||||||
@ -250,7 +251,7 @@ class BankIntegrationController extends BaseController
|
|||||||
* Return the remote list of accounts stored on the third party provider
|
* Return the remote list of accounts stored on the third party provider
|
||||||
* and update our local cache.
|
* and update our local cache.
|
||||||
*
|
*
|
||||||
* @return Response
|
* @return Response | JsonResponse
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ class BankTransactionController extends BaseController
|
|||||||
|
|
||||||
public function create(CreateBankTransactionRequest $request)
|
public function create(CreateBankTransactionRequest $request)
|
||||||
{
|
{
|
||||||
$bank_transaction = BankTransactionFactory::create(auth()->user()->company()->id, auth()->user()->id, auth()->user()->account_id);
|
$bank_transaction = BankTransactionFactory::create(auth()->user()->company()->id, auth()->user()->id);
|
||||||
|
|
||||||
return $this->itemResponse($bank_transaction);
|
return $this->itemResponse($bank_transaction);
|
||||||
}
|
}
|
||||||
@ -79,7 +79,7 @@ class BankTransactionController extends BaseController
|
|||||||
public function store(StoreBankTransactionRequest $request)
|
public function store(StoreBankTransactionRequest $request)
|
||||||
{
|
{
|
||||||
//stub to store the model
|
//stub to store the model
|
||||||
$bank_transaction = $this->bank_transaction_repo->save($request->all(), BankTransactionFactory::create(auth()->user()->company()->id, auth()->user()->id, auth()->user()->account_id));
|
$bank_transaction = $this->bank_transaction_repo->save($request->all(), BankTransactionFactory::create(auth()->user()->company()->id, auth()->user()->id));
|
||||||
|
|
||||||
return $this->itemResponse($bank_transaction);
|
return $this->itemResponse($bank_transaction);
|
||||||
}
|
}
|
||||||
|
@ -11,20 +11,21 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\Factory\BankTransactionRuleFactory;
|
use App\Utils\Traits\MakesHash;
|
||||||
|
use Illuminate\Support\Collection;
|
||||||
|
use App\Models\BankTransactionRule;
|
||||||
use App\Filters\BankTransactionFilters;
|
use App\Filters\BankTransactionFilters;
|
||||||
|
use App\Factory\BankTransactionRuleFactory;
|
||||||
use App\Filters\BankTransactionRuleFilters;
|
use App\Filters\BankTransactionRuleFilters;
|
||||||
|
use App\Repositories\BankTransactionRuleRepository;
|
||||||
|
use App\Transformers\BankTransactionRuleTransformer;
|
||||||
use App\Http\Requests\BankTransactionRule\BulkBankTransactionRuleRequest;
|
use App\Http\Requests\BankTransactionRule\BulkBankTransactionRuleRequest;
|
||||||
use App\Http\Requests\BankTransactionRule\CreateBankTransactionRuleRequest;
|
|
||||||
use App\Http\Requests\BankTransactionRule\DestroyBankTransactionRuleRequest;
|
|
||||||
use App\Http\Requests\BankTransactionRule\EditBankTransactionRuleRequest;
|
use App\Http\Requests\BankTransactionRule\EditBankTransactionRuleRequest;
|
||||||
use App\Http\Requests\BankTransactionRule\ShowBankTransactionRuleRequest;
|
use App\Http\Requests\BankTransactionRule\ShowBankTransactionRuleRequest;
|
||||||
use App\Http\Requests\BankTransactionRule\StoreBankTransactionRuleRequest;
|
use App\Http\Requests\BankTransactionRule\StoreBankTransactionRuleRequest;
|
||||||
|
use App\Http\Requests\BankTransactionRule\CreateBankTransactionRuleRequest;
|
||||||
use App\Http\Requests\BankTransactionRule\UpdateBankTransactionRuleRequest;
|
use App\Http\Requests\BankTransactionRule\UpdateBankTransactionRuleRequest;
|
||||||
use App\Models\BankTransactionRule;
|
use App\Http\Requests\BankTransactionRule\DestroyBankTransactionRuleRequest;
|
||||||
use App\Repositories\BankTransactionRuleRepository;
|
|
||||||
use App\Transformers\BankTransactionRuleTransformer;
|
|
||||||
use App\Utils\Traits\MakesHash;
|
|
||||||
|
|
||||||
class BankTransactionRuleController extends BaseController
|
class BankTransactionRuleController extends BaseController
|
||||||
{
|
{
|
||||||
@ -99,7 +100,7 @@ class BankTransactionRuleController extends BaseController
|
|||||||
*
|
*
|
||||||
* @param ShowBankTransactionRuleRequest $request
|
* @param ShowBankTransactionRuleRequest $request
|
||||||
* @param BankTransactionRule $bank_transaction_rule
|
* @param BankTransactionRule $bank_transaction_rule
|
||||||
* @return Response
|
* @return \Illuminate\Http\JsonResponse
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @OA\Get(
|
* @OA\Get(
|
||||||
@ -154,7 +155,7 @@ class BankTransactionRuleController extends BaseController
|
|||||||
*
|
*
|
||||||
* @param EditBankTransactionRuleRequest $request
|
* @param EditBankTransactionRuleRequest $request
|
||||||
* @param BankTransactionRule $bank_transaction_rule
|
* @param BankTransactionRule $bank_transaction_rule
|
||||||
* @return Response
|
* @return \Illuminate\Http\JsonResponse
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @OA\Get(
|
* @OA\Get(
|
||||||
@ -208,7 +209,7 @@ class BankTransactionRuleController extends BaseController
|
|||||||
*
|
*
|
||||||
* @param UpdateBankTransactionRuleRequest $request
|
* @param UpdateBankTransactionRuleRequest $request
|
||||||
* @param BankTransactionRule $bank_transaction_rule
|
* @param BankTransactionRule $bank_transaction_rule
|
||||||
* @return Response
|
* @return \Illuminate\Http\JsonResponse
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
@ -265,7 +266,7 @@ class BankTransactionRuleController extends BaseController
|
|||||||
* Show the form for creating a new resource.
|
* Show the form for creating a new resource.
|
||||||
*
|
*
|
||||||
* @param CreateBankTransactionRuleRequest $request
|
* @param CreateBankTransactionRuleRequest $request
|
||||||
* @return Response
|
* @return \Illuminate\Http\JsonResponse
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
@ -310,7 +311,7 @@ class BankTransactionRuleController extends BaseController
|
|||||||
* Store a newly created resource in storage.
|
* Store a newly created resource in storage.
|
||||||
*
|
*
|
||||||
* @param StoreBankTransactionRuleRequest $request
|
* @param StoreBankTransactionRuleRequest $request
|
||||||
* @return Response
|
* @return \Illuminate\Http\JsonResponse
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
@ -357,7 +358,7 @@ class BankTransactionRuleController extends BaseController
|
|||||||
*
|
*
|
||||||
* @param DestroyBankTransactionRuleRequest $request
|
* @param DestroyBankTransactionRuleRequest $request
|
||||||
* @param BankTransactionRule $bank_transaction_rule
|
* @param BankTransactionRule $bank_transaction_rule
|
||||||
* @return Response
|
* @return \Illuminate\Http\JsonResponse
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
@ -412,7 +413,7 @@ class BankTransactionRuleController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* Perform bulk actions on the list view.
|
* Perform bulk actions on the list view.
|
||||||
*
|
*
|
||||||
* @return Collection
|
* @return \Illuminate\Support\Collection
|
||||||
*
|
*
|
||||||
* @OA\Post(
|
* @OA\Post(
|
||||||
* path="/api/v1/bank_transation_rules/bulk",
|
* path="/api/v1/bank_transation_rules/bulk",
|
||||||
|
@ -238,7 +238,7 @@ class ClientController extends BaseController
|
|||||||
*
|
*
|
||||||
* @param PurgeClientRequest $request
|
* @param PurgeClientRequest $request
|
||||||
* @param Client $client
|
* @param Client $client
|
||||||
* @return Response
|
* @return \Illuminate\Http\JsonResponse
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function purge(PurgeClientRequest $request, Client $client)
|
public function purge(PurgeClientRequest $request, Client $client)
|
||||||
@ -266,7 +266,7 @@ class ClientController extends BaseController
|
|||||||
* @param PurgeClientRequest $request
|
* @param PurgeClientRequest $request
|
||||||
* @param Client $client
|
* @param Client $client
|
||||||
* @param string $mergeable_client
|
* @param string $mergeable_client
|
||||||
* @return Response
|
* @return \Illuminate\Http\JsonResponse
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -49,10 +49,6 @@ class EntityViewController extends Controller
|
|||||||
->with('contact.client')
|
->with('contact.client')
|
||||||
->firstOrFail();
|
->firstOrFail();
|
||||||
|
|
||||||
// $invitation = $invitation_entity::whereRaw('BINARY `key`= ?', [$invitation_key])
|
|
||||||
// ->with('contact.client')
|
|
||||||
// ->firstOrFail();
|
|
||||||
|
|
||||||
$contact = $invitation->contact;
|
$contact = $invitation->contact;
|
||||||
$client = $contact->client;
|
$client = $contact->client;
|
||||||
$entity = $invitation->{$entity_type};
|
$entity = $invitation->{$entity_type};
|
||||||
|
@ -143,7 +143,7 @@ class PaymentController extends Controller
|
|||||||
* Pay for invoice/s using credits only.
|
* Pay for invoice/s using credits only.
|
||||||
*
|
*
|
||||||
* @param Request $request The request object
|
* @param Request $request The request object
|
||||||
* @return Response The response view
|
* @return \Response The response view
|
||||||
*/
|
*/
|
||||||
public function credit_response(Request $request)
|
public function credit_response(Request $request)
|
||||||
{
|
{
|
||||||
@ -177,7 +177,6 @@ class PaymentController extends Controller
|
|||||||
|
|
||||||
if ($invoices->sum('balance') > 0) {
|
if ($invoices->sum('balance') > 0) {
|
||||||
$invoice = $invoices->first();
|
$invoice = $invoices->first();
|
||||||
$invoice->service()->touchPdf(true);
|
|
||||||
|
|
||||||
return redirect()->route('client.invoice.show', ['invoice' => $invoice->hashed_id, 'hash' => $request->input('hash')]);
|
return redirect()->route('client.invoice.show', ['invoice' => $invoice->hashed_id, 'hash' => $request->input('hash')]);
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,7 @@ class PaymentMethodController extends Controller
|
|||||||
* Show the form for creating a new resource.
|
* Show the form for creating a new resource.
|
||||||
*
|
*
|
||||||
* @param CreatePaymentMethodRequest $request
|
* @param CreatePaymentMethodRequest $request
|
||||||
* @return Response
|
* @return \Illuminate\View\View
|
||||||
*/
|
*/
|
||||||
public function create(CreatePaymentMethodRequest $request)
|
public function create(CreatePaymentMethodRequest $request)
|
||||||
{
|
{
|
||||||
@ -67,7 +67,7 @@ class PaymentMethodController extends Controller
|
|||||||
* Store a newly created resource in storage.
|
* Store a newly created resource in storage.
|
||||||
*
|
*
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @return Response
|
* @return \Illuminate\View\View
|
||||||
*/
|
*/
|
||||||
public function store(Request $request)
|
public function store(Request $request)
|
||||||
{
|
{
|
||||||
|
@ -78,7 +78,6 @@ class QuoteController extends Controller
|
|||||||
public function bulk(ProcessQuotesInBulkRequest $request)
|
public function bulk(ProcessQuotesInBulkRequest $request)
|
||||||
{
|
{
|
||||||
$transformed_ids = $this->transformKeys($request->quotes);
|
$transformed_ids = $this->transformKeys($request->quotes);
|
||||||
nlog(request()->all());
|
|
||||||
|
|
||||||
if ($request->action == 'download') {
|
if ($request->action == 'download') {
|
||||||
return $this->downloadQuotes((array) $transformed_ids);
|
return $this->downloadQuotes((array) $transformed_ids);
|
||||||
@ -185,7 +184,7 @@ class QuoteController extends Controller
|
|||||||
$quote->service()->approve(auth()->user())->save();
|
$quote->service()->approve(auth()->user())->save();
|
||||||
|
|
||||||
if (request()->has('signature') && ! is_null(request()->signature) && ! empty(request()->signature)) {
|
if (request()->has('signature') && ! is_null(request()->signature) && ! empty(request()->signature)) {
|
||||||
InjectSignature::dispatch($quote, request()->signature);
|
InjectSignature::dispatch($quote, auth()->guard('contact')->user()->id, request()->signature, request()->getClientIp());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ class StatementController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Show the statement in the client portal.
|
* Show the statement in the client portal.
|
||||||
*
|
*
|
||||||
* @return View
|
* @return \Illuminate\View\View
|
||||||
*/
|
*/
|
||||||
public function index(): View
|
public function index(): View
|
||||||
{
|
{
|
||||||
|
@ -38,7 +38,7 @@ class ConnectedAccountController extends BaseController
|
|||||||
* Connect an OAuth account to a regular email/password combination account
|
* Connect an OAuth account to a regular email/password combination account
|
||||||
*
|
*
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @return JsonResponse.
|
* @return \Illuminate\Http\JsonResponse
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @OA\Post(
|
* @OA\Post(
|
||||||
|
@ -58,7 +58,7 @@ class LoginController extends BaseController
|
|||||||
*
|
*
|
||||||
* @param Request $request The request
|
* @param Request $request The request
|
||||||
*
|
*
|
||||||
* @return Response|User Process user login.
|
* @return \Illuminate\Http\JsonResponse
|
||||||
* @throws \Illuminate\Validation\ValidationException
|
* @throws \Illuminate\Validation\ValidationException
|
||||||
*/
|
*/
|
||||||
public function apiLogin(Request $request)
|
public function apiLogin(Request $request)
|
||||||
|
@ -447,7 +447,7 @@ class CreditController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* Perform bulk actions on the list view.
|
* Perform bulk actions on the list view.
|
||||||
*
|
*
|
||||||
* @return Collection
|
* @return \Illuminate\Support\Collection
|
||||||
*
|
*
|
||||||
* @OA\Post(
|
* @OA\Post(
|
||||||
* path="/api/v1/credits/bulk",
|
* path="/api/v1/credits/bulk",
|
||||||
|
@ -170,7 +170,13 @@ class ImportController extends Controller
|
|||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function detectDelimiter($csvfile)
|
/**
|
||||||
|
* Returns the best delimiter
|
||||||
|
*
|
||||||
|
* @param string $csvfile
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function detectDelimiter($csvfile): string
|
||||||
{
|
{
|
||||||
$delimiters = [',', '.', ';'];
|
$delimiters = [',', '.', ';'];
|
||||||
$bestDelimiter = ' ';
|
$bestDelimiter = ' ';
|
||||||
@ -179,11 +185,12 @@ class ImportController extends Controller
|
|||||||
foreach ($delimiters as $delimiter) {
|
foreach ($delimiters as $delimiter) {
|
||||||
|
|
||||||
if (substr_count(strstr($csvfile, "\n", true), $delimiter) >= $count) {
|
if (substr_count(strstr($csvfile, "\n", true), $delimiter) >= $count) {
|
||||||
$count = substr_count($csvfile, $delimiter);
|
$count = substr_count(strstr($csvfile, "\n", true), $delimiter);
|
||||||
$bestDelimiter = $delimiter;
|
$bestDelimiter = $delimiter;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $bestDelimiter;
|
return $bestDelimiter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -476,7 +476,7 @@ class InvoiceController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* Perform bulk actions on the list view.
|
* Perform bulk actions on the list view.
|
||||||
*
|
*
|
||||||
* @return Collection
|
* @return \Illuminate\Support\Collection
|
||||||
*
|
*
|
||||||
* @OA\Post(
|
* @OA\Post(
|
||||||
* path="/api/v1/invoices/bulk",
|
* path="/api/v1/invoices/bulk",
|
||||||
@ -683,7 +683,6 @@ class InvoiceController extends BaseController
|
|||||||
|
|
||||||
return $this->itemResponse($quote);
|
return $this->itemResponse($quote);
|
||||||
|
|
||||||
break;
|
|
||||||
case 'history':
|
case 'history':
|
||||||
// code...
|
// code...
|
||||||
break;
|
break;
|
||||||
@ -717,7 +716,6 @@ class InvoiceController extends BaseController
|
|||||||
echo Storage::get($file);
|
echo Storage::get($file);
|
||||||
}, basename($file), ['Content-Type' => 'application/pdf']);
|
}, basename($file), ['Content-Type' => 'application/pdf']);
|
||||||
|
|
||||||
break;
|
|
||||||
case 'restore':
|
case 'restore':
|
||||||
$this->invoice_repo->restore($invoice);
|
$this->invoice_repo->restore($invoice);
|
||||||
|
|
||||||
@ -742,8 +740,6 @@ class InvoiceController extends BaseController
|
|||||||
break;
|
break;
|
||||||
case 'cancel':
|
case 'cancel':
|
||||||
$invoice = $invoice->service()->handleCancellation()->deletePdf()->save();
|
$invoice = $invoice->service()->handleCancellation()->deletePdf()->save();
|
||||||
// $invoice = $invoice->service()->handleCancellation()->touchPdf()->save();
|
|
||||||
|
|
||||||
if (! $bulk) {
|
if (! $bulk) {
|
||||||
$this->itemResponse($invoice);
|
$this->itemResponse($invoice);
|
||||||
}
|
}
|
||||||
@ -765,7 +761,6 @@ class InvoiceController extends BaseController
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
return response()->json(['message' => ctrans('texts.action_unavailable', ['action' => $action])], 400);
|
return response()->json(['message' => ctrans('texts.action_unavailable', ['action' => $action])], 400);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -445,7 +445,7 @@ class PaymentController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* Perform bulk actions on the list view.
|
* Perform bulk actions on the list view.
|
||||||
*
|
*
|
||||||
* @return Collection
|
* @return \Illuminate\Support\Collection
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @OA\Post(
|
* @OA\Post(
|
||||||
|
@ -397,7 +397,7 @@ class PaymentTermController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* Perform bulk actions on the list view.
|
* Perform bulk actions on the list view.
|
||||||
*
|
*
|
||||||
* @return Collection
|
* @return \Illuminate\Support\Collection
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @OA\Post(
|
* @OA\Post(
|
||||||
|
@ -408,7 +408,7 @@ class ProductController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* Perform bulk actions on the list view.
|
* Perform bulk actions on the list view.
|
||||||
*
|
*
|
||||||
* @return Collection
|
* @return \Illuminate\Support\Collection
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @OA\Post(
|
* @OA\Post(
|
||||||
|
@ -427,7 +427,7 @@ class PurchaseOrderController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* Perform bulk actions on the list view.
|
* Perform bulk actions on the list view.
|
||||||
*
|
*
|
||||||
* @return Collection
|
* @return \Illuminate\Support\Collection
|
||||||
*
|
*
|
||||||
* @OA\Post(
|
* @OA\Post(
|
||||||
* path="/api/v1/purchase_orders/bulk",
|
* path="/api/v1/purchase_orders/bulk",
|
||||||
|
@ -459,7 +459,7 @@ class QuoteController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* Perform bulk actions on the list view.
|
* Perform bulk actions on the list view.
|
||||||
*
|
*
|
||||||
* @return Collection
|
* @return \Illuminate\Support\Collection
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @OA\Post(
|
* @OA\Post(
|
||||||
|
@ -429,7 +429,7 @@ class RecurringQuoteController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* Perform bulk actions on the list view.
|
* Perform bulk actions on the list view.
|
||||||
*
|
*
|
||||||
* @return Collection
|
* @return \Illuminate\Support\Collection
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @OA\Post(
|
* @OA\Post(
|
||||||
|
@ -48,7 +48,7 @@ class SubscriptionController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* Show the list of Subscriptions.
|
* Show the list of Subscriptions.
|
||||||
*
|
*
|
||||||
* @return Response
|
* @return \Illuminate\Http\JsonResponse
|
||||||
*
|
*
|
||||||
* @OA\Get(
|
* @OA\Get(
|
||||||
* path="/api/v1/subscriptions",
|
* path="/api/v1/subscriptions",
|
||||||
@ -92,7 +92,7 @@ class SubscriptionController extends BaseController
|
|||||||
*
|
*
|
||||||
* @param CreateSubscriptionRequest $request The request
|
* @param CreateSubscriptionRequest $request The request
|
||||||
*
|
*
|
||||||
* @return Response
|
* @return \Illuminate\Http\JsonResponse
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @OA\Get(
|
* @OA\Get(
|
||||||
@ -137,7 +137,7 @@ class SubscriptionController extends BaseController
|
|||||||
*
|
*
|
||||||
* @param StoreSubscriptionRequest $request The request
|
* @param StoreSubscriptionRequest $request The request
|
||||||
*
|
*
|
||||||
* @return Response
|
* @return \Illuminate\Http\JsonResponse
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @OA\Post(
|
* @OA\Post(
|
||||||
@ -185,7 +185,7 @@ class SubscriptionController extends BaseController
|
|||||||
* @param ShowSubscriptionRequest $request The request
|
* @param ShowSubscriptionRequest $request The request
|
||||||
* @param Invoice $subscription The invoice
|
* @param Invoice $subscription The invoice
|
||||||
*
|
*
|
||||||
* @return Response
|
* @return \Illuminate\Http\JsonResponse
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @OA\Get(
|
* @OA\Get(
|
||||||
@ -240,7 +240,7 @@ class SubscriptionController extends BaseController
|
|||||||
* @param EditSubscriptionRequest $request The request
|
* @param EditSubscriptionRequest $request The request
|
||||||
* @param Invoice $subscription The invoice
|
* @param Invoice $subscription The invoice
|
||||||
*
|
*
|
||||||
* @return Response
|
* @return \Illuminate\Http\JsonResponse
|
||||||
*
|
*
|
||||||
* @OA\Get(
|
* @OA\Get(
|
||||||
* path="/api/v1/subscriptions/{id}/edit",
|
* path="/api/v1/subscriptions/{id}/edit",
|
||||||
@ -294,7 +294,7 @@ class SubscriptionController extends BaseController
|
|||||||
* @param UpdateSubscriptionRequest $request The request
|
* @param UpdateSubscriptionRequest $request The request
|
||||||
* @param Subscription $subscription The invoice
|
* @param Subscription $subscription The invoice
|
||||||
*
|
*
|
||||||
* @return Response
|
* @return \Illuminate\Http\JsonResponse
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @OA\Put(
|
* @OA\Put(
|
||||||
@ -357,7 +357,7 @@ class SubscriptionController extends BaseController
|
|||||||
* @param DestroySubscriptionRequest $request
|
* @param DestroySubscriptionRequest $request
|
||||||
* @param Subscription $invoice
|
* @param Subscription $invoice
|
||||||
*
|
*
|
||||||
* @return Response
|
* @return \Illuminate\Http\JsonResponse
|
||||||
*
|
*
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
* @OA\Delete(
|
* @OA\Delete(
|
||||||
@ -410,7 +410,7 @@ class SubscriptionController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* Perform bulk actions on the list view.
|
* Perform bulk actions on the list view.
|
||||||
*
|
*
|
||||||
* @return Response
|
* @return \Illuminate\Support\Collection
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @OA\Post(
|
* @OA\Post(
|
||||||
|
@ -189,7 +189,7 @@ class UserController extends BaseController
|
|||||||
*
|
*
|
||||||
* @param DestroyUserRequest $request
|
* @param DestroyUserRequest $request
|
||||||
* @param User $user
|
* @param User $user
|
||||||
* @return JsonResponse | Response
|
* @return \Illuminate\Http\JsonResponse
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function destroy(DestroyUserRequest $request, User $user)
|
public function destroy(DestroyUserRequest $request, User $user)
|
||||||
|
@ -186,8 +186,7 @@ class PurchaseOrderController extends Controller
|
|||||||
->save();
|
->save();
|
||||||
|
|
||||||
if (request()->has('signature') && ! is_null(request()->signature) && ! empty(request()->signature)) {
|
if (request()->has('signature') && ! is_null(request()->signature) && ! empty(request()->signature)) {
|
||||||
(new InjectSignature($purchase_order, request()->signature))->handle();
|
(new InjectSignature($purchase_order, auth()->guard('vendor')->user()->id, request()->signature, request()->getClientIp()))->handle();
|
||||||
// InjectSignature::dispatch($purchase_order, request()->signature);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
event(new PurchaseOrderWasAccepted($purchase_order, auth()->guard('vendor')->user(), $purchase_order->company, Ninja::eventVars()));
|
event(new PurchaseOrderWasAccepted($purchase_order, auth()->guard('vendor')->user(), $purchase_order->company, Ninja::eventVars()));
|
||||||
|
@ -23,7 +23,7 @@ class WebCronController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Store a newly created resource in storage.
|
* Store a newly created resource in storage.
|
||||||
*
|
*
|
||||||
* @return Response
|
* @return \Illuminate\Http\JsonResponse
|
||||||
*
|
*
|
||||||
* @OA\Get(
|
* @OA\Get(
|
||||||
* path="/webcron",
|
* path="/webcron",
|
||||||
|
@ -53,6 +53,8 @@ class PdfSlot extends Component
|
|||||||
|
|
||||||
public $route_entity = 'client';
|
public $route_entity = 'client';
|
||||||
|
|
||||||
|
public $is_quote = false;
|
||||||
|
|
||||||
public function mount()
|
public function mount()
|
||||||
{
|
{
|
||||||
MultiDB::setDb($this->db);
|
MultiDB::setDb($this->db);
|
||||||
@ -111,9 +113,9 @@ class PdfSlot extends Component
|
|||||||
$this->show_line_total = in_array('$product.line_total', $this->settings->pdf_variables->product_quote_columns);
|
$this->show_line_total = in_array('$product.line_total', $this->settings->pdf_variables->product_quote_columns);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->html_variables = $this->entity->client ?
|
$this->html_variables = $this->entity_type == 'purchase_order' ?
|
||||||
(new HtmlEngine($this->invitation))->generateLabelsAndValues() :
|
(new VendorHtmlEngine($this->invitation))->generateLabelsAndValues() :
|
||||||
(new VendorHtmlEngine($this->invitation))->generateLabelsAndValues();
|
(new HtmlEngine($this->invitation))->generateLabelsAndValues();
|
||||||
|
|
||||||
return render('components.livewire.pdf-slot', [
|
return render('components.livewire.pdf-slot', [
|
||||||
'invitation' => $this->invitation,
|
'invitation' => $this->invitation,
|
||||||
@ -230,15 +232,16 @@ class PdfSlot extends Component
|
|||||||
private function getProducts()
|
private function getProducts()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$product_items = collect($this->entity->line_items)->filter(function ($item) {
|
$product_items = collect($this->entity->line_items)->filter(function ($item) {
|
||||||
return $item->type_id == 1 || $item->type_id == 6 || $item->type_id == 5;
|
return $item->type_id == 1 || $item->type_id == 6 || $item->type_id == 5;
|
||||||
})->map(function ($item){
|
})->map(function ($item){
|
||||||
|
|
||||||
|
$notes = strlen($item->notes) > 4 ? $item->notes : $item->product_key;
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'quantity' => $item->quantity,
|
'quantity' => $item->quantity,
|
||||||
'cost' => Number::formatMoney($item->cost, $this->entity->client ?: $this->entity->vendor),
|
'cost' => Number::formatMoney($item->cost, $this->entity->client ?: $this->entity->vendor),
|
||||||
'notes' => $this->invitation->company->markdown_enabled ? DesignHelpers::parseMarkdownToHtml($item->notes) : $item->notes,
|
'notes' => $this->invitation->company->markdown_enabled ? DesignHelpers::parseMarkdownToHtml($notes) : $notes,
|
||||||
'line_total' => Number::formatMoney($item->line_total, $this->entity->client ?: $this->entity->vendor),
|
'line_total' => Number::formatMoney($item->line_total, $this->entity->client ?: $this->entity->vendor),
|
||||||
];
|
];
|
||||||
});
|
});
|
||||||
@ -268,6 +271,7 @@ class PdfSlot extends Component
|
|||||||
if ($this->invitation instanceof InvoiceInvitation) {
|
if ($this->invitation instanceof InvoiceInvitation) {
|
||||||
return 'invoice';
|
return 'invoice';
|
||||||
} elseif ($this->invitation instanceof QuoteInvitation) {
|
} elseif ($this->invitation instanceof QuoteInvitation) {
|
||||||
|
$this->is_quote = true;
|
||||||
return 'quote';
|
return 'quote';
|
||||||
} elseif ($this->invitation instanceof CreditInvitation) {
|
} elseif ($this->invitation instanceof CreditInvitation) {
|
||||||
return 'credit';
|
return 'credit';
|
||||||
|
@ -27,6 +27,7 @@ class ProcessQuotesInBulkRequest extends FormRequest
|
|||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'quotes' => ['array'],
|
'quotes' => ['array'],
|
||||||
|
'action' => 'sometimes',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,7 @@ class UpdateGroupSettingRequest extends Request
|
|||||||
* are saveable
|
* are saveable
|
||||||
*
|
*
|
||||||
* @param object $settings
|
* @param object $settings
|
||||||
* @return stdClass $settings
|
* @return array $settings
|
||||||
*/
|
*/
|
||||||
private function filterSaveableSettings($settings)
|
private function filterSaveableSettings($settings)
|
||||||
{
|
{
|
||||||
|
@ -28,9 +28,10 @@ class PreImportRequest extends Request
|
|||||||
public function rules()
|
public function rules()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'files.*' => 'file|mimes:csv,txt',
|
'files.*' => 'file|mimetypes:text/csv,text/plain,application/octet-stream',
|
||||||
'files' => 'required|array|min:1|max:6',
|
'files' => 'required|array|min:1|max:6',
|
||||||
'import_type' => 'required',
|
'import_type' => 'required',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -47,11 +47,11 @@ class MatchBankTransactions implements ShouldQueue
|
|||||||
|
|
||||||
private array $input;
|
private array $input;
|
||||||
|
|
||||||
protected Company $company;
|
protected ?Company $company;
|
||||||
|
|
||||||
public Invoice $invoice;
|
public Invoice $invoice;
|
||||||
|
|
||||||
private BankTransaction $bt;
|
private ?BankTransaction $bt;
|
||||||
|
|
||||||
private $categories;
|
private $categories;
|
||||||
|
|
||||||
@ -78,8 +78,6 @@ class MatchBankTransactions implements ShouldQueue
|
|||||||
/**
|
/**
|
||||||
* Execute the job.
|
* Execute the job.
|
||||||
*
|
*
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
*/
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
|
@ -108,9 +108,11 @@ class ProcessBankTransactions implements ShouldQueue
|
|||||||
$at = new AccountTransformer();
|
$at = new AccountTransformer();
|
||||||
$account = $at->transform($account_summary);
|
$account = $at->transform($account_summary);
|
||||||
|
|
||||||
|
if($account[0]['current_balance']) {
|
||||||
$this->bank_integration->balance = $account['current_balance'];
|
$this->bank_integration->balance = $account['current_balance'];
|
||||||
$this->bank_integration->currency = $account['account_currency'];
|
$this->bank_integration->currency = $account['account_currency'];
|
||||||
$this->bank_integration->save();
|
$this->bank_integration->save();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,7 @@ class CompanyExport implements ShouldQueue
|
|||||||
/**
|
/**
|
||||||
* Execute the job.
|
* Execute the job.
|
||||||
*
|
*
|
||||||
* @return CompanyToken|null
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
|
@ -52,7 +52,7 @@ class CompanyTaxRate implements ShouldQueue
|
|||||||
|
|
||||||
/** State must be calculated else default to the company state for taxes */
|
/** State must be calculated else default to the company state for taxes */
|
||||||
if(array_key_exists($this->company->settings->state, USStates::get())) {
|
if(array_key_exists($this->company->settings->state, USStates::get())) {
|
||||||
$calculated_state = $this->company->setting->state;
|
$calculated_state = $this->company->settings->state;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
|
@ -43,7 +43,9 @@ class UpdateCalculatedFields
|
|||||||
|
|
||||||
if (! config('ninja.db.multi_db_enabled')) {
|
if (! config('ninja.db.multi_db_enabled')) {
|
||||||
|
|
||||||
Project::with('tasks')->where('updated_at', '>', now()->subHours(2))
|
Project::with('tasks')->whereHas('tasks', function ($query){
|
||||||
|
$query->where('updated_at', '>', now()->subHours(2));
|
||||||
|
})
|
||||||
->cursor()
|
->cursor()
|
||||||
->each(function ($project) {
|
->each(function ($project) {
|
||||||
|
|
||||||
@ -59,7 +61,9 @@ class UpdateCalculatedFields
|
|||||||
MultiDB::setDB($db);
|
MultiDB::setDB($db);
|
||||||
|
|
||||||
|
|
||||||
Project::with('tasks')->where('updated_at', '>', now()->subHours(2))
|
Project::with('tasks')->whereHas('tasks', function ($query){
|
||||||
|
$query->where('updated_at', '>', now()->subHours(2));
|
||||||
|
})
|
||||||
->cursor()
|
->cursor()
|
||||||
->each(function ($project) {
|
->each(function ($project) {
|
||||||
$project->current_hours = $this->calculateDuration($project);
|
$project->current_hours = $this->calculateDuration($project);
|
||||||
|
@ -2,21 +2,19 @@
|
|||||||
|
|
||||||
namespace App\Jobs\Invoice;
|
namespace App\Jobs\Invoice;
|
||||||
|
|
||||||
use App\Jobs\Entity\CreateEntityPdf;
|
|
||||||
use App\Jobs\Vendor\CreatePurchaseOrderPdf;
|
|
||||||
use App\Models\PurchaseOrder;
|
use App\Models\PurchaseOrder;
|
||||||
use Illuminate\Bus\Queueable;
|
use Illuminate\Bus\Queueable;
|
||||||
|
use Illuminate\Queue\SerializesModels;
|
||||||
|
use Illuminate\Queue\InteractsWithQueue;
|
||||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||||
use Illuminate\Foundation\Bus\Dispatchable;
|
use Illuminate\Foundation\Bus\Dispatchable;
|
||||||
use Illuminate\Queue\InteractsWithQueue;
|
|
||||||
use Illuminate\Queue\SerializesModels;
|
|
||||||
|
|
||||||
class InjectSignature implements ShouldQueue
|
class InjectSignature implements ShouldQueue
|
||||||
{
|
{
|
||||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var App\Models\Invoice|App\Models\Quote
|
* @var \App\Models\Invoice | \App\Models\Quote | \App\Models\Credit | \App\Models\PurchaseOrder
|
||||||
*/
|
*/
|
||||||
public $entity;
|
public $entity;
|
||||||
|
|
||||||
@ -25,17 +23,26 @@ class InjectSignature implements ShouldQueue
|
|||||||
*/
|
*/
|
||||||
public $signature;
|
public $signature;
|
||||||
|
|
||||||
|
public $contact_id;
|
||||||
|
|
||||||
|
public $ip;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new job instance.
|
* Create a new job instance.
|
||||||
*
|
*
|
||||||
* @param $entity
|
* @param $entity
|
||||||
* @param string $signature
|
* @param string $signature
|
||||||
*/
|
*/
|
||||||
public function __construct($entity, string $signature)
|
public function __construct($entity, $contact_id, string $signature, ?string $ip)
|
||||||
{
|
{
|
||||||
$this->entity = $entity;
|
$this->entity = $entity;
|
||||||
|
|
||||||
|
$this->contact_id = $contact_id;
|
||||||
|
|
||||||
$this->signature = $signature;
|
$this->signature = $signature;
|
||||||
|
|
||||||
|
$this->ip = $ip;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -45,20 +52,31 @@ class InjectSignature implements ShouldQueue
|
|||||||
*/
|
*/
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
$invitation = $this->entity->invitations->whereNotNull('signature_base64')->first();
|
$invitation = false;
|
||||||
|
|
||||||
|
if($this->entity instanceof PurchaseOrder){
|
||||||
|
$invitation = $this->entity->invitations()->where('vendor_contact_id', $this->contact_id)->first();
|
||||||
|
|
||||||
|
if(!$invitation)
|
||||||
|
$invitation = $this->entity->invitations->first();
|
||||||
|
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
|
||||||
|
$invitation = $this->entity->invitations()->where('client_contact_id', $this->contact_id)->first();
|
||||||
|
|
||||||
|
if(!$invitation)
|
||||||
|
$invitation = $this->entity->invitations->first();
|
||||||
|
}
|
||||||
|
|
||||||
if (! $invitation) {
|
if (! $invitation) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$invitation->signature_base64 = $this->signature;
|
$invitation->signature_base64 = $this->signature;
|
||||||
|
$invitation->signature_date = now();
|
||||||
|
$invitation->signature_ip = $this->ip;
|
||||||
$invitation->save();
|
$invitation->save();
|
||||||
|
|
||||||
$this->entity->refresh()->service()->touchPdf(true);
|
|
||||||
|
|
||||||
// if($this->entity instanceof PurchaseOrder)
|
|
||||||
// (new CreatePurchaseOrderPdf($invitation))->handle();
|
|
||||||
// else
|
|
||||||
// (new CreateEntityPdf($invitation))->handle();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -91,9 +91,6 @@ class SendRecurring implements ShouldQueue
|
|||||||
|
|
||||||
$invoice = $this->createRecurringInvitations($invoice);
|
$invoice = $this->createRecurringInvitations($invoice);
|
||||||
|
|
||||||
/* 09-01-2022 ensure we create the PDFs at this point in time! */
|
|
||||||
$invoice->service()->touchPdf(true);
|
|
||||||
|
|
||||||
/* Set next date here to prevent a recurring loop forming */
|
/* Set next date here to prevent a recurring loop forming */
|
||||||
$this->recurring_invoice->next_send_date = $this->recurring_invoice->nextSendDate();
|
$this->recurring_invoice->next_send_date = $this->recurring_invoice->nextSendDate();
|
||||||
$this->recurring_invoice->next_send_date_client = $this->recurring_invoice->nextSendDateClient();
|
$this->recurring_invoice->next_send_date_client = $this->recurring_invoice->nextSendDateClient();
|
||||||
|
@ -205,9 +205,6 @@ class ReminderJob implements ShouldQueue
|
|||||||
->markSent()
|
->markSent()
|
||||||
->save();
|
->save();
|
||||||
|
|
||||||
//30-6-2023 - fix for duplicate touching
|
|
||||||
// $invoice->service()->touchPdf(true);
|
|
||||||
|
|
||||||
$enabled_reminder = 'enable_'.$reminder_template;
|
$enabled_reminder = 'enable_'.$reminder_template;
|
||||||
if ($reminder_template == 'endless_reminder') {
|
if ($reminder_template == 'endless_reminder') {
|
||||||
$enabled_reminder = 'enable_reminder_endless';
|
$enabled_reminder = 'enable_reminder_endless';
|
||||||
@ -308,14 +305,11 @@ class ReminderJob implements ShouldQueue
|
|||||||
|
|
||||||
/**Refresh Invoice values*/
|
/**Refresh Invoice values*/
|
||||||
$invoice = $invoice->calc()->getInvoice();
|
$invoice = $invoice->calc()->getInvoice();
|
||||||
// $invoice->service()->deletePdf(); 24-11-2022 no need to delete here because we regenerate later anyway
|
|
||||||
|
|
||||||
nlog('adjusting client balance and invoice balance by #'.$invoice->number.' '.($invoice->balance - $temp_invoice_balance));
|
nlog('adjusting client balance and invoice balance by #'.$invoice->number.' '.($invoice->balance - $temp_invoice_balance));
|
||||||
$invoice->client->service()->updateBalance($invoice->balance - $temp_invoice_balance);
|
$invoice->client->service()->updateBalance($invoice->balance - $temp_invoice_balance);
|
||||||
$invoice->ledger()->updateInvoiceBalance($invoice->balance - $temp_invoice_balance, "Late Fee Adjustment for invoice {$invoice->number}");
|
$invoice->ledger()->updateInvoiceBalance($invoice->balance - $temp_invoice_balance, "Late Fee Adjustment for invoice {$invoice->number}");
|
||||||
|
|
||||||
$invoice->service()->touchPdf(true);
|
|
||||||
|
|
||||||
return $invoice;
|
return $invoice;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,7 @@ class OAuth
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Socialite $user
|
* @param Socialite $user
|
||||||
* @return bool|\App\Models\User|\App\Libraries\App\Models\User|null
|
* @return bool | \App\Models\User | \App\Models\User | null
|
||||||
*/
|
*/
|
||||||
public static function handleAuth($socialite_user, $provider)
|
public static function handleAuth($socialite_user, $provider)
|
||||||
{
|
{
|
||||||
|
@ -13,6 +13,7 @@ namespace App\Models;
|
|||||||
|
|
||||||
use App\Utils\Number;
|
use App\Utils\Number;
|
||||||
use App\Utils\Traits\MakesHash;
|
use App\Utils\Traits\MakesHash;
|
||||||
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* App\Models\Activity
|
* App\Models\Activity
|
||||||
@ -302,161 +303,120 @@ class Activity extends StaticModel
|
|||||||
'backup',
|
'backup',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
public function getHashedIdAttribute()
|
public function getHashedIdAttribute()
|
||||||
{
|
{
|
||||||
return $this->encodePrimaryKey($this->id);
|
return $this->encodePrimaryKey($this->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
public function getEntityType()
|
public function getEntityType()
|
||||||
{
|
{
|
||||||
return self::class;
|
return self::class;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
public function backup()
|
public function backup()
|
||||||
{
|
{
|
||||||
return $this->hasOne(Backup::class);
|
return $this->hasOne(Backup::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
public function history()
|
public function history()
|
||||||
{
|
{
|
||||||
return $this->hasOne(Backup::class);
|
return $this->hasOne(Backup::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function user() :BelongsTo
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
public function user()
|
|
||||||
{
|
{
|
||||||
return $this->belongsTo(User::class)->withTrashed();
|
return $this->belongsTo(User::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
public function contact()
|
public function contact()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(ClientContact::class, 'client_contact_id', 'id')->withTrashed();
|
return $this->belongsTo(ClientContact::class, 'client_contact_id', 'id')->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
public function client()
|
public function client()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Client::class)->withTrashed();
|
return $this->belongsTo(Client::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
public function invoice()
|
public function invoice()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Invoice::class)->withTrashed();
|
return $this->belongsTo(Invoice::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
public function vendor()
|
public function vendor()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Vendor::class)->withTrashed();
|
return $this->belongsTo(Vendor::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
public function recurring_invoice()
|
public function recurring_invoice()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(RecurringInvoice::class)->withTrashed();
|
return $this->belongsTo(RecurringInvoice::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
public function credit()
|
public function credit()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Credit::class)->withTrashed();
|
return $this->belongsTo(Credit::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
public function quote()
|
public function quote()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Quote::class)->withTrashed();
|
return $this->belongsTo(Quote::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
public function subscription()
|
public function subscription()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Subscription::class)->withTrashed();
|
return $this->belongsTo(Subscription::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
public function payment()
|
public function payment()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Payment::class)->withTrashed();
|
return $this->belongsTo(Payment::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
public function expense()
|
public function expense()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Expense::class)->withTrashed();
|
return $this->belongsTo(Expense::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
public function recurring_expense()
|
public function recurring_expense()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(RecurringExpense::class)->withTrashed();
|
return $this->belongsTo(RecurringExpense::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
public function purchase_order()
|
public function purchase_order()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(PurchaseOrder::class)->withTrashed();
|
return $this->belongsTo(PurchaseOrder::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
public function vendor_contact()
|
public function vendor_contact()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(VendorContact::class)->withTrashed();
|
return $this->belongsTo(VendorContact::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
public function task()
|
public function task()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Task::class)->withTrashed();
|
return $this->belongsTo(Task::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
public function company()
|
public function company()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Company::class);
|
return $this->belongsTo(Company::class);
|
||||||
|
@ -50,12 +50,6 @@ class BankAccount extends BaseModel
|
|||||||
{
|
{
|
||||||
use SoftDeletes;
|
use SoftDeletes;
|
||||||
|
|
||||||
/**
|
|
||||||
* @var array
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* @var array
|
|
||||||
*/
|
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
'bank_id',
|
'bank_id',
|
||||||
'app_version',
|
'app_version',
|
||||||
|
@ -31,30 +31,35 @@ use Illuminate\Database\Eloquent\ModelNotFoundException as ModelNotFoundExceptio
|
|||||||
* @property-read mixed $hashed_id
|
* @property-read mixed $hashed_id
|
||||||
* @property string $number
|
* @property string $number
|
||||||
* @property int $company_id
|
* @property int $company_id
|
||||||
|
* @property int $id
|
||||||
* @property \App\Models\Company $company
|
* @property \App\Models\Company $company
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel|Illuminate\Database\Eloquent\Relations\BelongsTo|\Awobaz\Compoships\Database\Eloquent\Relations\BelongsTo|\App\Models\Company company()
|
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel|Illuminate\Database\Eloquent\Relations\BelongsTo|\Awobaz\Compoships\Database\Eloquent\Relations\BelongsTo|\App\Models\Company company()
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel|Illuminate\Database\Eloquent\Relations\HasMany|BaseModel orderBy()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel exclude($columns)
|
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel exclude($columns)
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel with()
|
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel with($value)
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel newModelQuery()
|
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel newModelQuery($query)
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel newQuery()
|
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel newQuery($query)
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel query()
|
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel query()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel exclude(array $excludeable)
|
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel exclude(array $excludeable)
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel withTrashed()
|
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel withTrashed()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel scopeExclude()
|
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel scopeExclude($query)
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel find()
|
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel find($value)
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel whereIn()
|
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel whereIn($query)
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel where()
|
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel where($query)
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel count()
|
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel count()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel create()
|
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel create($query)
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel insert()
|
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel insert($query)
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel service()
|
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel service()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel whereHas()
|
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel orderBy($column, $direction)
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel withTrashed()
|
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel invitations()
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel createInvitations()
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel whereHas($query)
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\InvoiceInvitation | \App\Models\CreditInvitation | \App\Models\QuoteInvitation | \App\Models\RecurringInvoiceInvitation> $invitations
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\InvoiceInvitation | \App\Models\CreditInvitation | \App\Models\QuoteInvitation | \App\Models\RecurringInvoiceInvitation> $invitations
|
||||||
* @property-read int|null $invitations_count
|
* @property-read int|null $invitations_count
|
||||||
*
|
*
|
||||||
* @method \App\Models\Company company()
|
* @method \App\Models\Company company()
|
||||||
* @method int companyId()
|
* @method int companyId()
|
||||||
|
* @method createInvitations()
|
||||||
* @method Builder|static exclude($columns)
|
* @method Builder|static exclude($columns)
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder exclude(array $columns)
|
* @method static \Illuminate\Database\Eloquent\Builder exclude(array $columns)
|
||||||
* @mixin \Eloquent
|
* @mixin \Eloquent
|
||||||
|
@ -11,21 +11,26 @@
|
|||||||
|
|
||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
|
use App\Models\GatewayType;
|
||||||
|
use App\Utils\Traits\AppSetup;
|
||||||
|
use App\Utils\Traits\MakesHash;
|
||||||
|
use App\Utils\Traits\MakesDates;
|
||||||
|
use App\DataMapper\FeesAndLimits;
|
||||||
|
use App\Models\Traits\Excludable;
|
||||||
use App\DataMapper\ClientSettings;
|
use App\DataMapper\ClientSettings;
|
||||||
use App\DataMapper\CompanySettings;
|
use App\DataMapper\CompanySettings;
|
||||||
use App\DataMapper\FeesAndLimits;
|
|
||||||
use App\Models\Presenters\ClientPresenter;
|
|
||||||
use App\Models\Traits\Excludable;
|
|
||||||
use App\Services\Client\ClientService;
|
|
||||||
use App\Utils\Traits\AppSetup;
|
|
||||||
use App\Utils\Traits\ClientGroupSettingsSaver;
|
|
||||||
use App\Utils\Traits\GeneratesCounter;
|
|
||||||
use App\Utils\Traits\MakesDates;
|
|
||||||
use App\Utils\Traits\MakesHash;
|
|
||||||
use Illuminate\Contracts\Translation\HasLocalePreference;
|
|
||||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
||||||
use Illuminate\Support\Facades\Cache;
|
use Illuminate\Support\Facades\Cache;
|
||||||
|
use App\Services\Client\ClientService;
|
||||||
|
use App\Utils\Traits\GeneratesCounter;
|
||||||
use Laracasts\Presenter\PresentableTrait;
|
use Laracasts\Presenter\PresentableTrait;
|
||||||
|
use App\Models\Presenters\ClientPresenter;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
|
use App\Utils\Traits\ClientGroupSettingsSaver;
|
||||||
|
use App\Libraries\Currency\Conversion\CurrencyApi;
|
||||||
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||||
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
|
use Illuminate\Database\Eloquent\Relations\MorphMany;
|
||||||
|
use Illuminate\Contracts\Translation\HasLocalePreference;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* App\Models\Client
|
* App\Models\Client
|
||||||
@ -65,6 +70,7 @@ use Laracasts\Presenter\PresentableTrait;
|
|||||||
* @property string|null $shipping_postal_code
|
* @property string|null $shipping_postal_code
|
||||||
* @property int|null $shipping_country_id
|
* @property int|null $shipping_country_id
|
||||||
* @property object|null $settings
|
* @property object|null $settings
|
||||||
|
* @property object|null $group_settings
|
||||||
* @property bool $is_deleted
|
* @property bool $is_deleted
|
||||||
* @property int|null $group_settings_id
|
* @property int|null $group_settings_id
|
||||||
* @property string|null $vat_number
|
* @property string|null $vat_number
|
||||||
@ -114,68 +120,12 @@ use Laracasts\Presenter\PresentableTrait;
|
|||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\RecurringInvoice> $recurring_invoices
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\RecurringInvoice> $recurring_invoices
|
||||||
* @property-read int|null $tasks_count
|
* @property-read int|null $tasks_count
|
||||||
* @property-read \App\Models\User $user
|
* @property-read \App\Models\User $user
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel company()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client exclude($columns)
|
* @method static \Illuminate\Database\Eloquent\Builder|Client exclude($columns)
|
||||||
* @method static \Database\Factories\ClientFactory factory($count = null, $state = [])
|
* @method static \Database\Factories\ClientFactory factory($count = null, $state = [])
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client filter(\App\Filters\QueryFilters $filters)
|
* @method static \Illuminate\Database\Eloquent\Builder|Client filter(\App\Filters\QueryFilters $filters)
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client newModelQuery()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client newQuery()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client onlyTrashed()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client query()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client whereAddress1($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client whereAddress2($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client whereAssignedUserId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client whereBalance($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client whereCity($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client whereClientHash($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client whereCompanyId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client whereCountryId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client whereCreatedAt($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client whereCreditBalance($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client whereCustomValue1($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client whereCustomValue2($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client whereCustomValue3($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client whereCustomValue4($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client whereDeletedAt($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client whereGroupSettingsId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client whereId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client whereIdNumber($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client whereIndustryId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client whereIsDeleted($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client whereLastLogin($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client whereLogo($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client whereName($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client whereNumber($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client wherePaidToDate($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client wherePhone($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client wherePostalCode($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client wherePrivateNotes($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client wherePublicNotes($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client whereSettings($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client whereShippingAddress1($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client whereShippingAddress2($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client whereShippingCity($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client whereShippingCountryId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client whereShippingPostalCode($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client whereShippingState($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client whereSizeId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client whereState($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client whereUpdatedAt($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client whereUserId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client whereVatNumber($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client whereWebsite($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client withTrashed()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client withoutTrashed()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client with()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client where()
|
|
||||||
* @property string $payment_balance
|
* @property string $payment_balance
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client wherePaymentBalance($value)
|
|
||||||
* @property mixed $tax_data
|
* @property mixed $tax_data
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client whereTaxData($value)
|
|
||||||
* @property int $is_tax_exempt
|
* @property int $is_tax_exempt
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Client whereIsTaxExempt($value)
|
|
||||||
|
|
||||||
* @property int $has_valid_vat_number
|
* @property int $has_valid_vat_number
|
||||||
* @mixin \Eloquent
|
* @mixin \Eloquent
|
||||||
*/
|
*/
|
||||||
@ -357,62 +307,62 @@ class Client extends BaseModel implements HasLocalePreference
|
|||||||
return $this->hasMany(Activity::class)->take(50)->orderBy('id', 'desc');
|
return $this->hasMany(Activity::class)->take(50)->orderBy('id', 'desc');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function contacts()
|
public function contacts() :HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(ClientContact::class)->orderBy('is_primary', 'desc');
|
return $this->hasMany(ClientContact::class)->orderBy('is_primary', 'desc');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function primary_contact()
|
public function primary_contact():HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(ClientContact::class)->where('is_primary', true);
|
return $this->hasMany(ClientContact::class)->where('is_primary', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function company()
|
public function company() :BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Company::class);
|
return $this->belongsTo(Company::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function user()
|
public function user() :BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(User::class)->withTrashed();
|
return $this->belongsTo(User::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function assigned_user()
|
public function assigned_user() :BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(User::class, 'assigned_user_id', 'id')->withTrashed();
|
return $this->belongsTo(User::class, 'assigned_user_id', 'id')->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function country()
|
public function country() :BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Country::class);
|
return $this->belongsTo(Country::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function invoices()
|
public function invoices() :HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(Invoice::class)->withTrashed();
|
return $this->hasMany(Invoice::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function quotes()
|
public function quotes() :HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(Quote::class)->withTrashed();
|
return $this->hasMany(Quote::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function tasks()
|
public function tasks() :HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(Task::class)->withTrashed();
|
return $this->hasMany(Task::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function payments()
|
public function payments() :HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(Payment::class)->withTrashed();
|
return $this->hasMany(Payment::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function recurring_invoices()
|
public function recurring_invoices() :HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(RecurringInvoice::class)->withTrashed();
|
return $this->hasMany(RecurringInvoice::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function recurring_expenses()
|
public function recurring_expenses() :HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(RecurringExpense::class)->withTrashed();
|
return $this->hasMany(RecurringExpense::class)->withTrashed();
|
||||||
}
|
}
|
||||||
@ -422,12 +372,12 @@ class Client extends BaseModel implements HasLocalePreference
|
|||||||
return $this->belongsTo(Country::class, 'shipping_country_id', 'id');
|
return $this->belongsTo(Country::class, 'shipping_country_id', 'id');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function system_logs()
|
public function system_logs() :HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(SystemLog::class)->take(50)->orderBy('id', 'desc');
|
return $this->hasMany(SystemLog::class)->take(50)->orderBy('id', 'desc');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function timezone()
|
public function timezone() :Timezone
|
||||||
{
|
{
|
||||||
return Timezone::find($this->getSetting('timezone_id'));
|
return Timezone::find($this->getSetting('timezone_id'));
|
||||||
}
|
}
|
||||||
@ -445,17 +395,17 @@ class Client extends BaseModel implements HasLocalePreference
|
|||||||
})->first();
|
})->first();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function industry()
|
public function industry() :BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Industry::class);
|
return $this->belongsTo(Industry::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function size()
|
public function size() :BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Size::class);
|
return $this->belongsTo(Size::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function locale()
|
public function locale() :string
|
||||||
{
|
{
|
||||||
if (! $this->language()) {
|
if (! $this->language()) {
|
||||||
return 'en';
|
return 'en';
|
||||||
@ -526,7 +476,7 @@ class Client extends BaseModel implements HasLocalePreference
|
|||||||
* @param string $setting The Setting parameter
|
* @param string $setting The Setting parameter
|
||||||
* @return mixed The setting requested
|
* @return mixed The setting requested
|
||||||
*/
|
*/
|
||||||
public function getSetting($setting)
|
public function getSetting($setting) :mixed
|
||||||
{
|
{
|
||||||
/*Client Settings*/
|
/*Client Settings*/
|
||||||
if ($this->settings && property_exists($this->settings, $setting) && isset($this->settings->{$setting})) {
|
if ($this->settings && property_exists($this->settings, $setting) && isset($this->settings->{$setting})) {
|
||||||
@ -556,7 +506,6 @@ class Client extends BaseModel implements HasLocalePreference
|
|||||||
|
|
||||||
return '';
|
return '';
|
||||||
|
|
||||||
// throw new \Exception("Settings corrupted", 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getSettingEntity($setting)
|
public function getSettingEntity($setting)
|
||||||
@ -582,12 +531,12 @@ class Client extends BaseModel implements HasLocalePreference
|
|||||||
throw new \Exception('Could not find a settings object', 1);
|
throw new \Exception('Could not find a settings object', 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function documents()
|
public function documents() :MorphMany
|
||||||
{
|
{
|
||||||
return $this->morphMany(Document::class, 'documentable');
|
return $this->morphMany(Document::class, 'documentable');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function group_settings()
|
public function group_settings() :BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(GroupSetting::class);
|
return $this->belongsTo(GroupSetting::class);
|
||||||
}
|
}
|
||||||
@ -710,7 +659,7 @@ class Client extends BaseModel implements HasLocalePreference
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCurrencyCode()
|
public function getCurrencyCode(): string
|
||||||
{
|
{
|
||||||
if ($this->currency()) {
|
if ($this->currency()) {
|
||||||
return $this->currency()->code;
|
return $this->currency()->code;
|
||||||
@ -751,51 +700,51 @@ class Client extends BaseModel implements HasLocalePreference
|
|||||||
})->first()->locale;
|
})->first()->locale;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function backup_path()
|
public function backup_path() :string
|
||||||
{
|
{
|
||||||
return $this->company->company_key.'/'.$this->client_hash.'/backups';
|
return $this->company->company_key.'/'.$this->client_hash.'/backups';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function invoice_filepath($invitation)
|
public function invoice_filepath($invitation) :string
|
||||||
{
|
{
|
||||||
$contact_key = $invitation->contact->contact_key;
|
$contact_key = $invitation->contact->contact_key;
|
||||||
|
|
||||||
return $this->company->company_key.'/'.$this->client_hash.'/'.$contact_key.'/invoices/';
|
return $this->company->company_key.'/'.$this->client_hash.'/'.$contact_key.'/invoices/';
|
||||||
}
|
}
|
||||||
public function e_invoice_filepath($invitation)
|
public function e_invoice_filepath($invitation) :string
|
||||||
{
|
{
|
||||||
$contact_key = $invitation->contact->contact_key;
|
$contact_key = $invitation->contact->contact_key;
|
||||||
|
|
||||||
return $this->company->company_key.'/'.$this->client_hash.'/'.$contact_key.'/e_invoice/';
|
return $this->company->company_key.'/'.$this->client_hash.'/'.$contact_key.'/e_invoice/';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function quote_filepath($invitation)
|
public function quote_filepath($invitation) :string
|
||||||
{
|
{
|
||||||
$contact_key = $invitation->contact->contact_key;
|
$contact_key = $invitation->contact->contact_key;
|
||||||
|
|
||||||
return $this->company->company_key.'/'.$this->client_hash.'/'.$contact_key.'/quotes/';
|
return $this->company->company_key.'/'.$this->client_hash.'/'.$contact_key.'/quotes/';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function credit_filepath($invitation)
|
public function credit_filepath($invitation) :string
|
||||||
{
|
{
|
||||||
$contact_key = $invitation->contact->contact_key;
|
$contact_key = $invitation->contact->contact_key;
|
||||||
|
|
||||||
return $this->company->company_key.'/'.$this->client_hash.'/'.$contact_key.'/credits/';
|
return $this->company->company_key.'/'.$this->client_hash.'/'.$contact_key.'/credits/';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function recurring_invoice_filepath($invitation)
|
public function recurring_invoice_filepath($invitation) :string
|
||||||
{
|
{
|
||||||
$contact_key = $invitation->contact->contact_key;
|
$contact_key = $invitation->contact->contact_key;
|
||||||
|
|
||||||
return $this->company->company_key.'/'.$this->client_hash.'/'.$contact_key.'/recurring_invoices/';
|
return $this->company->company_key.'/'.$this->client_hash.'/'.$contact_key.'/recurring_invoices/';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function company_filepath()
|
public function company_filepath() :string
|
||||||
{
|
{
|
||||||
return $this->company->company_key.'/';
|
return $this->company->company_key.'/';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function document_filepath()
|
public function document_filepath() :string
|
||||||
{
|
{
|
||||||
return $this->company->company_key.'/documents/';
|
return $this->company->company_key.'/documents/';
|
||||||
}
|
}
|
||||||
@ -820,10 +769,13 @@ class Client extends BaseModel implements HasLocalePreference
|
|||||||
$defaults['public_notes'] = $this->public_notes;
|
$defaults['public_notes'] = $this->public_notes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$exchange_rate = new CurrencyApi();
|
||||||
|
$defaults['exchange_rate'] = 1/$exchange_rate->exchangeRate($this->getSetting('currency_id'), $this->company->settings->currency_id);
|
||||||
|
|
||||||
return $defaults;
|
return $defaults;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function timezone_offset()
|
public function timezone_offset() :int
|
||||||
{
|
{
|
||||||
$offset = 0;
|
$offset = 0;
|
||||||
|
|
||||||
@ -853,7 +805,7 @@ class Client extends BaseModel implements HasLocalePreference
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function translate_entity()
|
public function translate_entity() :string
|
||||||
{
|
{
|
||||||
return ctrans('texts.client');
|
return ctrans('texts.client');
|
||||||
}
|
}
|
||||||
|
@ -68,17 +68,12 @@ use Laracasts\Presenter\PresentableTrait;
|
|||||||
* @property int|null $deleted_at
|
* @property int|null $deleted_at
|
||||||
* @property-read \App\Models\Client $client
|
* @property-read \App\Models\Client $client
|
||||||
* @property-read \App\Models\Company $company
|
* @property-read \App\Models\Company $company
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CreditInvitation> $credit_invitations
|
|
||||||
* @property-read int|null $credit_invitations_count
|
* @property-read int|null $credit_invitations_count
|
||||||
* @property-read mixed $contact_id
|
* @property-read mixed $contact_id
|
||||||
* @property-read mixed $hashed_id
|
* @property-read mixed $hashed_id
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\InvoiceInvitation> $invoice_invitations
|
|
||||||
* @property-read int|null $invoice_invitations_count
|
* @property-read int|null $invoice_invitations_count
|
||||||
* @property-read \Illuminate\Notifications\DatabaseNotificationCollection<int, \Illuminate\Notifications\DatabaseNotification> $notifications
|
|
||||||
* @property-read int|null $notifications_count
|
* @property-read int|null $notifications_count
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\QuoteInvitation> $quote_invitations
|
|
||||||
* @property-read int|null $quote_invitations_count
|
* @property-read int|null $quote_invitations_count
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\RecurringInvoiceInvitation> $recurring_invoice_invitations
|
|
||||||
* @property-read int|null $recurring_invoice_invitations_count
|
* @property-read int|null $recurring_invoice_invitations_count
|
||||||
* @property-read \App\Models\User $user
|
* @property-read \App\Models\User $user
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientContact company()
|
* @method static \Illuminate\Database\Eloquent\Builder|ClientContact company()
|
||||||
@ -87,102 +82,13 @@ use Laracasts\Presenter\PresentableTrait;
|
|||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientContact newQuery()
|
* @method static \Illuminate\Database\Eloquent\Builder|ClientContact newQuery()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientContact onlyTrashed()
|
* @method static \Illuminate\Database\Eloquent\Builder|ClientContact onlyTrashed()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientContact query()
|
* @method static \Illuminate\Database\Eloquent\Builder|ClientContact query()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereAcceptedTermsVersion($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereAvatar($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereAvatarSize($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereAvatarType($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereClientId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereCompanyId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereConfirmationCode($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereConfirmed($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereContactKey($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereCreatedAt($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereCustomValue1($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereCustomValue2($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereCustomValue3($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereCustomValue4($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereDeletedAt($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereEmail($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereEmailVerifiedAt($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereFailedLogins($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereFirstName($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereGoogle2faSecret($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereIsLocked($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereIsPrimary($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereLastLogin($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereLastName($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereOauthProviderId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereOauthUserId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientContact wherePassword($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientContact wherePhone($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereRememberToken($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereSendEmail($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereToken($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereUpdatedAt($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereUserId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientContact withTrashed()
|
* @method static \Illuminate\Database\Eloquent\Builder|ClientContact withTrashed()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientContact withoutTrashed()
|
* @method static \Illuminate\Database\Eloquent\Builder|ClientContact withoutTrashed()
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CreditInvitation> $credit_invitations
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\InvoiceInvitation> $invoice_invitations
|
|
||||||
* @property-read \Illuminate\Notifications\DatabaseNotificationCollection<int, \Illuminate\Notifications\DatabaseNotification> $notifications
|
* @property-read \Illuminate\Notifications\DatabaseNotificationCollection<int, \Illuminate\Notifications\DatabaseNotification> $notifications
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\QuoteInvitation> $quote_invitations
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\QuoteInvitation> $quote_invitations
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\RecurringInvoiceInvitation> $recurring_invoice_invitations
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\RecurringInvoiceInvitation> $recurring_invoice_invitations
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CreditInvitation> $credit_invitations
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CreditInvitation> $credit_invitations
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\InvoiceInvitation> $invoice_invitations
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\InvoiceInvitation> $invoice_invitations
|
||||||
* @property-read \Illuminate\Notifications\DatabaseNotificationCollection<int, \Illuminate\Notifications\DatabaseNotification> $notifications
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\QuoteInvitation> $quote_invitations
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\RecurringInvoiceInvitation> $recurring_invoice_invitations
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CreditInvitation> $credit_invitations
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\InvoiceInvitation> $invoice_invitations
|
|
||||||
* @property-read \Illuminate\Notifications\DatabaseNotificationCollection<int, \Illuminate\Notifications\DatabaseNotification> $notifications
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\QuoteInvitation> $quote_invitations
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\RecurringInvoiceInvitation> $recurring_invoice_invitations
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CreditInvitation> $credit_invitations
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\InvoiceInvitation> $invoice_invitations
|
|
||||||
* @property-read \Illuminate\Notifications\DatabaseNotificationCollection<int, \Illuminate\Notifications\DatabaseNotification> $notifications
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\QuoteInvitation> $quote_invitations
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\RecurringInvoiceInvitation> $recurring_invoice_invitations
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CreditInvitation> $credit_invitations
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\InvoiceInvitation> $invoice_invitations
|
|
||||||
* @property-read \Illuminate\Notifications\DatabaseNotificationCollection<int, \Illuminate\Notifications\DatabaseNotification> $notifications
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\QuoteInvitation> $quote_invitations
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\RecurringInvoiceInvitation> $recurring_invoice_invitations
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CreditInvitation> $credit_invitations
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\InvoiceInvitation> $invoice_invitations
|
|
||||||
* @property-read \Illuminate\Notifications\DatabaseNotificationCollection<int, \Illuminate\Notifications\DatabaseNotification> $notifications
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\QuoteInvitation> $quote_invitations
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\RecurringInvoiceInvitation> $recurring_invoice_invitations
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CreditInvitation> $credit_invitations
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\InvoiceInvitation> $invoice_invitations
|
|
||||||
* @property-read \Illuminate\Notifications\DatabaseNotificationCollection<int, \Illuminate\Notifications\DatabaseNotification> $notifications
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\QuoteInvitation> $quote_invitations
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\RecurringInvoiceInvitation> $recurring_invoice_invitations
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CreditInvitation> $credit_invitations
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\InvoiceInvitation> $invoice_invitations
|
|
||||||
* @property-read \Illuminate\Notifications\DatabaseNotificationCollection<int, \Illuminate\Notifications\DatabaseNotification> $notifications
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\QuoteInvitation> $quote_invitations
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\RecurringInvoiceInvitation> $recurring_invoice_invitations
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CreditInvitation> $credit_invitations
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\InvoiceInvitation> $invoice_invitations
|
|
||||||
* @property-read \Illuminate\Notifications\DatabaseNotificationCollection<int, \Illuminate\Notifications\DatabaseNotification> $notifications
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\QuoteInvitation> $quote_invitations
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\RecurringInvoiceInvitation> $recurring_invoice_invitations
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CreditInvitation> $credit_invitations
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\InvoiceInvitation> $invoice_invitations
|
|
||||||
* @property-read \Illuminate\Notifications\DatabaseNotificationCollection<int, \Illuminate\Notifications\DatabaseNotification> $notifications
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\QuoteInvitation> $quote_invitations
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\RecurringInvoiceInvitation> $recurring_invoice_invitations
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CreditInvitation> $credit_invitations
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\InvoiceInvitation> $invoice_invitations
|
|
||||||
* @property-read \Illuminate\Notifications\DatabaseNotificationCollection<int, \Illuminate\Notifications\DatabaseNotification> $notifications
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\QuoteInvitation> $quote_invitations
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\RecurringInvoiceInvitation> $recurring_invoice_invitations
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CreditInvitation> $credit_invitations
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\InvoiceInvitation> $invoice_invitations
|
|
||||||
* @property-read \Illuminate\Notifications\DatabaseNotificationCollection<int, \Illuminate\Notifications\DatabaseNotification> $notifications
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\QuoteInvitation> $quote_invitations
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\RecurringInvoiceInvitation> $recurring_invoice_invitations
|
|
||||||
* @mixin \Eloquent
|
* @mixin \Eloquent
|
||||||
*/
|
*/
|
||||||
class ClientContact extends Authenticatable implements HasLocalePreference
|
class ClientContact extends Authenticatable implements HasLocalePreference
|
||||||
|
@ -37,29 +37,6 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
|||||||
* @property-read \App\Models\GatewayType|null $gateway_type
|
* @property-read \App\Models\GatewayType|null $gateway_type
|
||||||
* @property-read mixed $hashed_id
|
* @property-read mixed $hashed_id
|
||||||
* @property-read \App\Models\User $user
|
* @property-read \App\Models\User $user
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel company()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel exclude($columns)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientGatewayToken newModelQuery()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientGatewayToken newQuery()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientGatewayToken onlyTrashed()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientGatewayToken query()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientGatewayToken whereClientId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientGatewayToken whereCompanyGatewayId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientGatewayToken whereCompanyId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientGatewayToken whereCreatedAt($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientGatewayToken whereDeletedAt($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientGatewayToken whereGatewayCustomerReference($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientGatewayToken whereGatewayTypeId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientGatewayToken whereId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientGatewayToken whereIsDefault($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientGatewayToken whereIsDeleted($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientGatewayToken whereMeta($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientGatewayToken whereRoutingNumber($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientGatewayToken whereToken($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientGatewayToken whereUpdatedAt($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientGatewayToken withTrashed()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ClientGatewayToken withoutTrashed()
|
|
||||||
* @mixin \Eloquent
|
* @mixin \Eloquent
|
||||||
*/
|
*/
|
||||||
class ClientGatewayToken extends BaseModel
|
class ClientGatewayToken extends BaseModel
|
||||||
|
@ -393,17 +393,17 @@ class Company extends BaseModel
|
|||||||
return $this->morphMany(Document::class, 'documentable');
|
return $this->morphMany(Document::class, 'documentable');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function schedulers()
|
public function schedulers() :HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(Scheduler::class);
|
return $this->hasMany(Scheduler::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function task_schedulers() //alias for schedulers
|
public function task_schedulers() :HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(Scheduler::class);
|
return $this->hasMany(Scheduler::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function all_documents()
|
public function all_documents() :HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(Document::class);
|
return $this->hasMany(Document::class);
|
||||||
}
|
}
|
||||||
@ -413,22 +413,22 @@ class Company extends BaseModel
|
|||||||
return self::class;
|
return self::class;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function ledger()
|
public function ledger() :HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(CompanyLedger::class);
|
return $this->hasMany(CompanyLedger::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function bank_integrations()
|
public function bank_integrations() :HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(BankIntegration::class);
|
return $this->hasMany(BankIntegration::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function bank_transactions()
|
public function bank_transactions() :HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(BankTransaction::class);
|
return $this->hasMany(BankTransaction::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function bank_transaction_rules()
|
public function bank_transaction_rules() :HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(BankTransactionRule::class);
|
return $this->hasMany(BankTransactionRule::class);
|
||||||
}
|
}
|
||||||
@ -443,7 +443,7 @@ class Company extends BaseModel
|
|||||||
return $this->belongsTo(Account::class);
|
return $this->belongsTo(Account::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function client_contacts()
|
public function client_contacts() :HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(ClientContact::class)->withTrashed();
|
return $this->hasMany(ClientContact::class)->withTrashed();
|
||||||
}
|
}
|
||||||
@ -453,27 +453,27 @@ class Company extends BaseModel
|
|||||||
return $this->hasManyThrough(User::class, CompanyUser::class, 'company_id', 'id', 'id', 'user_id')->withTrashed();
|
return $this->hasManyThrough(User::class, CompanyUser::class, 'company_id', 'id', 'id', 'user_id')->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function expense_categories()
|
public function expense_categories() :HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(ExpenseCategory::class)->withTrashed();
|
return $this->hasMany(ExpenseCategory::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function subscriptions()
|
public function subscriptions() :HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(Subscription::class)->withTrashed();
|
return $this->hasMany(Subscription::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function purchase_orders()
|
public function purchase_orders() :HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(PurchaseOrder::class)->withTrashed();
|
return $this->hasMany(PurchaseOrder::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function task_statuses()
|
public function task_statuses() :HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(TaskStatus::class)->withTrashed();
|
return $this->hasMany(TaskStatus::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function clients()
|
public function clients() :HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(Client::class)->withTrashed();
|
return $this->hasMany(Client::class)->withTrashed();
|
||||||
}
|
}
|
||||||
@ -481,12 +481,12 @@ class Company extends BaseModel
|
|||||||
/**
|
/**
|
||||||
* @return HasMany
|
* @return HasMany
|
||||||
*/
|
*/
|
||||||
public function tasks()
|
public function tasks() :HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(Task::class)->withTrashed();
|
return $this->hasMany(Task::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function webhooks()
|
public function webhooks() :HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(Webhook::class);
|
return $this->hasMany(Webhook::class);
|
||||||
}
|
}
|
||||||
@ -494,7 +494,7 @@ class Company extends BaseModel
|
|||||||
/**
|
/**
|
||||||
* @return HasMany
|
* @return HasMany
|
||||||
*/
|
*/
|
||||||
public function projects()
|
public function projects() :HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(Project::class)->withTrashed();
|
return $this->hasMany(Project::class)->withTrashed();
|
||||||
}
|
}
|
||||||
@ -502,17 +502,17 @@ class Company extends BaseModel
|
|||||||
/**
|
/**
|
||||||
* @return HasMany
|
* @return HasMany
|
||||||
*/
|
*/
|
||||||
public function vendors()
|
public function vendors() :HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(Vendor::class)->withTrashed();
|
return $this->hasMany(Vendor::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function all_activities()
|
public function all_activities() :HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(Activity::class);
|
return $this->hasMany(Activity::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function activities()
|
public function activities() :HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(Activity::class)->orderBy('id', 'DESC')->take(50);
|
return $this->hasMany(Activity::class)->orderBy('id', 'DESC')->take(50);
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,6 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
|||||||
* @property int $require_custom_value2
|
* @property int $require_custom_value2
|
||||||
* @property int $require_custom_value3
|
* @property int $require_custom_value3
|
||||||
* @property int $require_custom_value4
|
* @property int $require_custom_value4
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\ClientGatewayToken> $client_gateway_tokens
|
|
||||||
* @property-read int|null $client_gateway_tokens_count
|
* @property-read int|null $client_gateway_tokens_count
|
||||||
* @property-read \App\Models\Company $company
|
* @property-read \App\Models\Company $company
|
||||||
* @property-read \App\Models\Gateway $gateway
|
* @property-read \App\Models\Gateway $gateway
|
||||||
@ -60,51 +59,10 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
|||||||
* @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway onlyTrashed()
|
* @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway onlyTrashed()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway query()
|
* @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway query()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope()
|
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereAcceptedCreditCards($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereCompanyId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereConfig($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereCreatedAt($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereCustomValue1($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereCustomValue2($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereCustomValue3($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereCustomValue4($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereDeletedAt($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereFeesAndLimits($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereGatewayKey($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereIsDeleted($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereLabel($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereRequireBillingAddress($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereRequireClientName($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereRequireClientPhone($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereRequireContactEmail($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereRequireContactName($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereRequireCustomValue1($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereRequireCustomValue2($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereRequireCustomValue3($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereRequireCustomValue4($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereRequireCvv($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereRequirePostalCode($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereRequireShippingAddress($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereTokenBilling($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereUpdateDetails($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereUpdatedAt($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereUserId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway withTrashed()
|
* @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway withTrashed()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway withoutTrashed()
|
* @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway withoutTrashed()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway find()
|
* @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway find()
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\ClientGatewayToken> $client_gateway_tokens
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\ClientGatewayToken> $client_gateway_tokens
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\ClientGatewayToken> $client_gateway_tokens
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\ClientGatewayToken> $client_gateway_tokens
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\ClientGatewayToken> $client_gateway_tokens
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\ClientGatewayToken> $client_gateway_tokens
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\ClientGatewayToken> $client_gateway_tokens
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\ClientGatewayToken> $client_gateway_tokens
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\ClientGatewayToken> $client_gateway_tokens
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\ClientGatewayToken> $client_gateway_tokens
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\ClientGatewayToken> $client_gateway_tokens
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\ClientGatewayToken> $client_gateway_tokens
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\ClientGatewayToken> $client_gateway_tokens
|
|
||||||
* @mixin \Eloquent
|
* @mixin \Eloquent
|
||||||
*/
|
*/
|
||||||
class CompanyGateway extends BaseModel
|
class CompanyGateway extends BaseModel
|
||||||
@ -232,7 +190,8 @@ class CompanyGateway extends BaseModel
|
|||||||
/* This is the public entry point into the payment superclass */
|
/* This is the public entry point into the payment superclass */
|
||||||
public function driver(Client $client = null)
|
public function driver(Client $client = null)
|
||||||
{
|
{
|
||||||
$class = static::driver_class();
|
// $class = static::driver_class();
|
||||||
|
$class = self::driver_class();
|
||||||
|
|
||||||
if (!$class) {
|
if (!$class) {
|
||||||
return false;
|
return false;
|
||||||
@ -343,10 +302,10 @@ class CompanyGateway extends BaseModel
|
|||||||
return ! empty($this->getConfigField('enable_pay_pal'));
|
return ! empty($this->getConfigField('enable_pay_pal'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function feesEnabled()
|
// public function feesEnabled()
|
||||||
{
|
// {
|
||||||
return floatval($this->fee_amount) || floatval($this->fee_percent);
|
// return floatval($this->fee_amount) || floatval($this->fee_percent);
|
||||||
}
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the current test mode of the gateway.
|
* Returns the current test mode of the gateway.
|
||||||
|
@ -40,20 +40,8 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
|||||||
* @method static \Illuminate\Database\Eloquent\Builder|CompanyToken onlyTrashed()
|
* @method static \Illuminate\Database\Eloquent\Builder|CompanyToken onlyTrashed()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|CompanyToken query()
|
* @method static \Illuminate\Database\Eloquent\Builder|CompanyToken query()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope()
|
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|CompanyToken whereAccountId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|CompanyToken whereCompanyId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|CompanyToken whereCreatedAt($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|CompanyToken whereDeletedAt($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|CompanyToken whereId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|CompanyToken whereIsDeleted($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|CompanyToken whereIsSystem($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|CompanyToken whereName($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|CompanyToken whereToken($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|CompanyToken whereUpdatedAt($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|CompanyToken whereUserId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|CompanyToken withTrashed()
|
* @method static \Illuminate\Database\Eloquent\Builder|CompanyToken withTrashed()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|CompanyToken withoutTrashed()
|
* @method static \Illuminate\Database\Eloquent\Builder|CompanyToken withoutTrashed()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|CompanyToken with()
|
|
||||||
* @mixin \Eloquent
|
* @mixin \Eloquent
|
||||||
*/
|
*/
|
||||||
class CompanyToken extends BaseModel
|
class CompanyToken extends BaseModel
|
||||||
|
@ -83,66 +83,12 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
|||||||
* @method static \Illuminate\Database\Eloquent\Builder|Expense onlyTrashed()
|
* @method static \Illuminate\Database\Eloquent\Builder|Expense onlyTrashed()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Expense query()
|
* @method static \Illuminate\Database\Eloquent\Builder|Expense query()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope()
|
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Expense whereAmount($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Expense whereAssignedUserId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Expense whereBankId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Expense whereCalculateTaxByAmount($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Expense whereCategoryId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Expense whereClientId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Expense whereCompanyId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Expense whereCreatedAt($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Expense whereCurrencyId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Expense whereCustomValue1($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Expense whereCustomValue2($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Expense whereCustomValue3($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Expense whereCustomValue4($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Expense whereDate($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Expense whereDeletedAt($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Expense whereExchangeRate($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Expense whereForeignAmount($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Expense whereId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Expense whereInvoiceCurrencyId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Expense whereInvoiceDocuments($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Expense whereInvoiceId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Expense whereIsDeleted($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Expense whereNumber($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Expense wherePaymentDate($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Expense wherePaymentTypeId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Expense wherePrivateNotes($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Expense whereProjectId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Expense wherePublicNotes($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Expense whereRecurringExpenseId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Expense whereShouldBeInvoiced($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Expense whereTaxAmount1($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Expense whereTaxAmount2($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Expense whereTaxAmount3($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Expense whereTaxName1($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Expense whereTaxName2($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Expense whereTaxName3($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Expense whereTaxRate1($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Expense whereTaxRate2($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Expense whereTaxRate3($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Expense whereTransactionId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Expense whereTransactionReference($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Expense whereUpdatedAt($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Expense whereUserId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Expense whereUsesInclusiveTaxes($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Expense whereVendorId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Expense withTrashed()
|
* @method static \Illuminate\Database\Eloquent\Builder|Expense withTrashed()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Expense withoutTrashed()
|
* @method static \Illuminate\Database\Eloquent\Builder|Expense withoutTrashed()
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Client> $client
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Invoice> $invoice
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
|
||||||
* @property-read \App\Models\BankTransaction|null $transaction
|
* @property-read \App\Models\BankTransaction|null $transaction
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
|
||||||
* @mixin \Eloquent
|
* @mixin \Eloquent
|
||||||
*/
|
*/
|
||||||
class Expense extends BaseModel
|
class Expense extends BaseModel
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user