mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 06:24:30 -04:00
commit
b7e1ffe12f
@ -1 +1 @@
|
|||||||
5.6.24
|
5.6.25
|
@ -723,10 +723,10 @@ class CreateSingleAccount extends Command
|
|||||||
$cg->config = encrypt(config('ninja.testvars.paypal_rest'));
|
$cg->config = encrypt(config('ninja.testvars.paypal_rest'));
|
||||||
$cg->save();
|
$cg->save();
|
||||||
|
|
||||||
$gateway_types = $cg->driver()->gatewayTypes();
|
// $gateway_types = $cg->driver()->gatewayTypes();
|
||||||
|
|
||||||
$fees_and_limits = new stdClass;
|
$fees_and_limits = new stdClass;
|
||||||
$fees_and_limits->{$gateway_types[0]} = new FeesAndLimits;
|
$fees_and_limits->{3} = new FeesAndLimits;
|
||||||
|
|
||||||
$cg->fees_and_limits = $fees_and_limits;
|
$cg->fees_and_limits = $fees_and_limits;
|
||||||
$cg->save();
|
$cg->save();
|
||||||
|
@ -624,9 +624,6 @@ class BaseExport
|
|||||||
return $transformed_invoice[$column];
|
return $transformed_invoice[$column];
|
||||||
}
|
}
|
||||||
|
|
||||||
// if($column == 'status')
|
|
||||||
// return $entity->stringStatus($entity->status_id);
|
|
||||||
|
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,6 +33,7 @@ class ExpenseFilters extends QueryFilters
|
|||||||
|
|
||||||
return $this->builder->where(function ($query) use ($filter) {
|
return $this->builder->where(function ($query) use ($filter) {
|
||||||
$query->where('number', 'like', '%'.$filter.'%')
|
$query->where('number', 'like', '%'.$filter.'%')
|
||||||
|
->orWhere('amount', 'like', '%'.$filter.'%')
|
||||||
->orWhere('public_notes', 'like', '%'.$filter.'%')
|
->orWhere('public_notes', 'like', '%'.$filter.'%')
|
||||||
->orWhere('custom_value1', 'like', '%'.$filter.'%')
|
->orWhere('custom_value1', 'like', '%'.$filter.'%')
|
||||||
->orWhere('custom_value2', 'like', '%'.$filter.'%')
|
->orWhere('custom_value2', 'like', '%'.$filter.'%')
|
||||||
|
@ -53,7 +53,7 @@ class QuoteFilters extends QueryFilters
|
|||||||
* - paused
|
* - paused
|
||||||
* - completed
|
* - completed
|
||||||
*
|
*
|
||||||
* @param string client_status The invoice status as seen by the client
|
* @param string $value The invoice status as seen by the client
|
||||||
* @return Builder
|
* @return Builder
|
||||||
*/
|
*/
|
||||||
public function client_status(string $value = ''): Builder
|
public function client_status(string $value = ''): Builder
|
||||||
|
@ -69,6 +69,7 @@ class ProRata
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @var \App\Models\RecurringInvoice $recurring_invoice **/
|
||||||
$recurring_invoice = RecurringInvoice::find($invoice->recurring_id)->first();
|
$recurring_invoice = RecurringInvoice::find($invoice->recurring_id)->first();
|
||||||
|
|
||||||
if (! $recurring_invoice) {
|
if (! $recurring_invoice) {
|
||||||
|
@ -144,6 +144,8 @@ class EmailController extends BaseController
|
|||||||
|
|
||||||
private function resolveClass(string $entity): string
|
private function resolveClass(string $entity): string
|
||||||
{
|
{
|
||||||
|
$class = '';
|
||||||
|
|
||||||
match ($entity) {
|
match ($entity) {
|
||||||
'invoice' => $class = Invoice::class,
|
'invoice' => $class = Invoice::class,
|
||||||
'App\Models\Invoice' => $class = Invoice::class,
|
'App\Models\Invoice' => $class = Invoice::class,
|
||||||
|
@ -14,7 +14,6 @@ namespace App\Http\Controllers;
|
|||||||
use App\Models\Account;
|
use App\Models\Account;
|
||||||
use App\Utils\CurlUtils;
|
use App\Utils\CurlUtils;
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use Illuminate\Http\Request;
|
|
||||||
use Illuminate\Http\Response;
|
use Illuminate\Http\Response;
|
||||||
use Illuminate\Support\Facades\Http;
|
use Illuminate\Support\Facades\Http;
|
||||||
use stdClass;
|
use stdClass;
|
||||||
@ -137,7 +136,7 @@ class LicenseController extends BaseController
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$error = [
|
$error = [
|
||||||
'message' => trans('texts.white_label_license_error'),
|
'message' => 'There was an issue connecting to the license server. Please check your network.',
|
||||||
'errors' => new stdClass,
|
'errors' => new stdClass,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -22,14 +22,17 @@ class BulkBankTransactionRequest extends Request
|
|||||||
*/
|
*/
|
||||||
public function authorize() : bool
|
public function authorize() : bool
|
||||||
{
|
{
|
||||||
return auth()->user()->isAdmin();
|
/** @var \App\Models\User $user **/
|
||||||
|
$user = auth()->user();
|
||||||
|
|
||||||
|
return $user->isAdmin();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function rules()
|
public function rules(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'ids' => 'required|bail|array',
|
'ids' => 'required|bail|array',
|
||||||
'action' => 'in:archive,restore,delete,convert_matched'
|
'action' => 'in:archive,restore,delete,convert_matched,unlink'
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,9 @@ class UploadMigrationFileRequest extends Request
|
|||||||
*/
|
*/
|
||||||
public function authorize()
|
public function authorize()
|
||||||
{
|
{
|
||||||
return auth()->user()->isAdmin();
|
/** @var \App\Models\User $user */
|
||||||
|
$user = auth()->user();
|
||||||
|
return $user->isAdmin();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -30,7 +32,7 @@ class UploadMigrationFileRequest extends Request
|
|||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function rules()
|
public function rules(): array
|
||||||
{
|
{
|
||||||
$rules = [
|
$rules = [
|
||||||
'migration' => [],
|
'migration' => [],
|
||||||
|
@ -28,7 +28,9 @@ class RefundPaymentRequest extends Request
|
|||||||
*/
|
*/
|
||||||
public function authorize() : bool
|
public function authorize() : bool
|
||||||
{
|
{
|
||||||
return auth()->user()->isAdmin();
|
/** @var \App\Models\User $user */
|
||||||
|
$user = auth()->user();
|
||||||
|
return $user->isAdmin();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function prepareForValidation()
|
public function prepareForValidation()
|
||||||
@ -62,12 +64,12 @@ class RefundPaymentRequest extends Request
|
|||||||
$this->replace($input);
|
$this->replace($input);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function rules()
|
public function rules(): array
|
||||||
{
|
{
|
||||||
$input = $this->all();
|
$input = $this->all();
|
||||||
|
|
||||||
$rules = [
|
$rules = [
|
||||||
'id' => 'bail|required',
|
'id' => 'bail|required', //@phpstan-ignore-line
|
||||||
'id' => new ValidRefundableRequest($input),
|
'id' => new ValidRefundableRequest($input),
|
||||||
'amount' => 'numeric',
|
'amount' => 'numeric',
|
||||||
'date' => 'required',
|
'date' => 'required',
|
||||||
@ -79,7 +81,7 @@ class RefundPaymentRequest extends Request
|
|||||||
return $rules;
|
return $rules;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function payment() :?Payment
|
public function payment(): ?\App\Models\Payment
|
||||||
{
|
{
|
||||||
$input = $this->all();
|
$input = $this->all();
|
||||||
|
|
||||||
|
@ -46,7 +46,8 @@ class ValidRefundableRequest implements Rule
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$payment = Payment::whereId($this->input['id'])->withTrashed()->first();
|
/**@var \App\Models\Payment $payment **/
|
||||||
|
$payment = Payment::where('id', $this->input['id'])->withTrashed()->first();
|
||||||
|
|
||||||
if (! $payment) {
|
if (! $payment) {
|
||||||
$this->error_msg = ctrans('texts.unable_to_retrieve_payment');
|
$this->error_msg = ctrans('texts.unable_to_retrieve_payment');
|
||||||
@ -55,7 +56,6 @@ class ValidRefundableRequest implements Rule
|
|||||||
}
|
}
|
||||||
|
|
||||||
$request_invoices = request()->has('invoices') ? $this->input['invoices'] : [];
|
$request_invoices = request()->has('invoices') ? $this->input['invoices'] : [];
|
||||||
// $request_credits = request()->has('credits') ? $this->input['credits'] : [];
|
|
||||||
|
|
||||||
if ($payment->invoices()->exists()) {
|
if ($payment->invoices()->exists()) {
|
||||||
foreach ($payment->invoices as $paymentable_invoice) {
|
foreach ($payment->invoices as $paymentable_invoice) {
|
||||||
@ -76,7 +76,8 @@ class ValidRefundableRequest implements Rule
|
|||||||
|
|
||||||
private function checkInvoiceIsPaymentable($invoice, $payment)
|
private function checkInvoiceIsPaymentable($invoice, $payment)
|
||||||
{
|
{
|
||||||
$invoice = Invoice::whereId($invoice['invoice_id'])->whereCompanyId($payment->company_id)->withTrashed()->first();
|
/**@var \App\Models\Invoice $invoice **/
|
||||||
|
$invoice = Invoice::where('id', $invoice['invoice_id'])->where('company_id', $payment->company_id)->withTrashed()->first();
|
||||||
|
|
||||||
if (! $invoice) {
|
if (! $invoice) {
|
||||||
$this->error_msg = 'Invoice not found for refund';
|
$this->error_msg = 'Invoice not found for refund';
|
||||||
@ -99,24 +100,25 @@ class ValidRefundableRequest implements Rule
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function checkCreditIsPaymentable($credit, $payment)
|
// private function checkCreditIsPaymentable($credit, $payment)
|
||||||
{
|
// {
|
||||||
$credit = Credit::whereId($credit['credit_id'])->whereCompanyId($payment->company_id)->first();
|
// /** @var \App\Models\Credit $credit */
|
||||||
|
// $credit = Credit::whereId($credit['credit_id'])->whereCompanyId($payment->company_id)->first();
|
||||||
|
|
||||||
if ($payment->credits()->exists()) {
|
// if ($payment->credits()->exists()) {
|
||||||
$paymentable_credit = $payment->credits->where('id', $credit->id)->first();
|
// $paymentable_credit = $payment->credits->where('id', $credit->id)->first();
|
||||||
|
|
||||||
if (! $paymentable_credit) {
|
// if (! $paymentable_credit) {
|
||||||
$this->error_msg = ctrans('texts.credit_not_related_to_payment', ['credit' => $credit->hashed_id]);
|
// $this->error_msg = ctrans('texts.credit_not_related_to_payment', ['credit' => $credit->hashed_id]);
|
||||||
|
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
} else {
|
// } else {
|
||||||
$this->error_msg = ctrans('texts.credit_not_related_to_payment', ['credit' => $credit->hashed_id]);
|
// $this->error_msg = ctrans('texts.credit_not_related_to_payment', ['credit' => $credit->hashed_id]);
|
||||||
|
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
private function checkInvoice($paymentable, $request_invoices)
|
private function checkInvoice($paymentable, $request_invoices)
|
||||||
{
|
{
|
||||||
@ -145,32 +147,32 @@ class ValidRefundableRequest implements Rule
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function checkCredit($paymentable, $request_credits)
|
// private function checkCredit($paymentable, $request_credits)
|
||||||
{
|
// {
|
||||||
$record_found = null;
|
// $record_found = null;
|
||||||
|
|
||||||
foreach ($request_credits as $request_credit) {
|
// foreach ($request_credits as $request_credit) {
|
||||||
if ($request_credit['credit_id'] == $paymentable->pivot->paymentable_id) {
|
// if ($request_credit['credit_id'] == $paymentable->pivot->paymentable_id) {
|
||||||
$record_found = true;
|
// $record_found = true;
|
||||||
|
|
||||||
$refundable_amount = ($paymentable->pivot->amount - $paymentable->pivot->refunded);
|
// $refundable_amount = ($paymentable->pivot->amount - $paymentable->pivot->refunded);
|
||||||
|
|
||||||
if ($request_credit['amount'] > $refundable_amount) {
|
// if ($request_credit['amount'] > $refundable_amount) {
|
||||||
$credit = $paymentable;
|
// $credit = $paymentable;
|
||||||
|
|
||||||
$this->error_msg = ctrans('texts.max_refundable_credit', ['credit' => $credit->hashed_id, 'amount' => $refundable_amount]);
|
// $this->error_msg = ctrans('texts.max_refundable_credit', ['credit' => $credit->hashed_id, 'amount' => $refundable_amount]);
|
||||||
|
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (! $record_found) {
|
// if (! $record_found) {
|
||||||
$this->error_msg = ctrans('texts.refund_without_credits');
|
// $this->error_msg = ctrans('texts.refund_without_credits');
|
||||||
|
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string
|
* @return string
|
||||||
|
@ -45,6 +45,7 @@ class ValidRefundableInvoices implements Rule
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**@var \App\Models\Payment $payment **/
|
||||||
$payment = Payment::whereId($this->input['id'])->first();
|
$payment = Payment::whereId($this->input['id'])->first();
|
||||||
|
|
||||||
if (! $payment) {
|
if (! $payment) {
|
||||||
@ -71,7 +72,6 @@ class ValidRefundableInvoices implements Rule
|
|||||||
|
|
||||||
foreach ($this->input['invoices'] as $val) {
|
foreach ($this->input['invoices'] as $val) {
|
||||||
if ($val['invoice_id'] == $invoice->id) {
|
if ($val['invoice_id'] == $invoice->id) {
|
||||||
//$pivot_record = $invoice->payments->where('id', $invoice->id)->first();
|
|
||||||
$pivot_record = $payment->paymentables->where('paymentable_id', $invoice->id)->first();
|
$pivot_record = $payment->paymentables->where('paymentable_id', $invoice->id)->first();
|
||||||
|
|
||||||
if ($val['amount'] > ($pivot_record->amount - $pivot_record->refunded)) {
|
if ($val['amount'] > ($pivot_record->amount - $pivot_record->refunded)) {
|
||||||
|
@ -243,7 +243,7 @@ class MatchBankTransactions implements ShouldQueue
|
|||||||
private function matchExpense($input) :self
|
private function matchExpense($input) :self
|
||||||
{
|
{
|
||||||
//if there is a category id, pull it from Yodlee and insert - or just reuse!!
|
//if there is a category id, pull it from Yodlee and insert - or just reuse!!
|
||||||
$this->bt = BankTransaction::find($input['id']);
|
$this->bt = BankTransaction::withTrashed()->find($input['id']);
|
||||||
|
|
||||||
if (!$this->bt || $this->bt->status_id == BankTransaction::STATUS_CONVERTED) {
|
if (!$this->bt || $this->bt->status_id == BankTransaction::STATUS_CONVERTED) {
|
||||||
return $this;
|
return $this;
|
||||||
|
@ -24,21 +24,8 @@ class ProfitAndLoss implements ShouldQueue
|
|||||||
{
|
{
|
||||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||||
|
|
||||||
protected Company $company;
|
public function __construct(protected Company $company, protected array $payload)
|
||||||
|
|
||||||
protected array $payload;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a new job instance.
|
|
||||||
*
|
|
||||||
* @param RecurringInvoice $recurring_invoice
|
|
||||||
* @param string $db
|
|
||||||
*/
|
|
||||||
public function __construct(Company $company, array $payload)
|
|
||||||
{
|
{
|
||||||
$this->company = $company;
|
|
||||||
|
|
||||||
$this->payload = $payload;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -75,6 +75,6 @@ class ApplePayDomain implements ShouldQueue
|
|||||||
|
|
||||||
$parsed_url = parse_url($domain);
|
$parsed_url = parse_url($domain);
|
||||||
|
|
||||||
return $parsed_url['host'];
|
return $parsed_url['host'] ?? '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -38,6 +38,7 @@ class VersionCheck implements ShouldQueue
|
|||||||
$version_file = trim(@file_get_contents(config('ninja.version_url')));
|
$version_file = trim(@file_get_contents(config('ninja.version_url')));
|
||||||
|
|
||||||
if (Ninja::isSelfHost() && $version_file) {
|
if (Ninja::isSelfHost() && $version_file) {
|
||||||
|
/** @var \App\Models\Account $account **/
|
||||||
Account::whereNotNull('id')->update(['latest_version' => $version_file]);
|
Account::whereNotNull('id')->update(['latest_version' => $version_file]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,7 +69,6 @@ class CreditEmailEngine extends BaseEmailEngine
|
|||||||
'company' => $this->credit->company->present()->name(),
|
'company' => $this->credit->company->present()->name(),
|
||||||
'amount' => Number::formatMoney($this->credit->balance, $this->client),
|
'amount' => Number::formatMoney($this->credit->balance, $this->client),
|
||||||
],
|
],
|
||||||
null,
|
|
||||||
$this->client->locale()
|
$this->client->locale()
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -89,7 +88,6 @@ class CreditEmailEngine extends BaseEmailEngine
|
|||||||
'number' => $this->credit->number,
|
'number' => $this->credit->number,
|
||||||
'account' => $this->credit->company->present()->name(),
|
'account' => $this->credit->company->present()->name(),
|
||||||
],
|
],
|
||||||
null,
|
|
||||||
$this->client->locale()
|
$this->client->locale()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -101,7 +99,6 @@ class CreditEmailEngine extends BaseEmailEngine
|
|||||||
'company' => $this->credit->company->present()->name(),
|
'company' => $this->credit->company->present()->name(),
|
||||||
'amount' => Number::formatMoney($this->credit->balance, $this->client),
|
'amount' => Number::formatMoney($this->credit->balance, $this->client),
|
||||||
],
|
],
|
||||||
null,
|
|
||||||
$this->client->locale()
|
$this->client->locale()
|
||||||
)."\n\n".$this->invitation->getLink();
|
)."\n\n".$this->invitation->getLink();
|
||||||
|
|
||||||
|
@ -76,7 +76,6 @@ class InvoiceEmailEngine extends BaseEmailEngine
|
|||||||
'company' => $this->invoice->company->present()->name(),
|
'company' => $this->invoice->company->present()->name(),
|
||||||
'amount' => Number::formatMoney($this->invoice->balance, $this->client),
|
'amount' => Number::formatMoney($this->invoice->balance, $this->client),
|
||||||
],
|
],
|
||||||
null,
|
|
||||||
$this->client->locale()
|
$this->client->locale()
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -90,7 +89,6 @@ class InvoiceEmailEngine extends BaseEmailEngine
|
|||||||
'company' => $this->invoice->company->present()->name(),
|
'company' => $this->invoice->company->present()->name(),
|
||||||
'amount' => Number::formatMoney($this->invoice->balance, $this->client),
|
'amount' => Number::formatMoney($this->invoice->balance, $this->client),
|
||||||
],
|
],
|
||||||
null,
|
|
||||||
$this->client->locale()
|
$this->client->locale()
|
||||||
)."\n\n".$this->invitation->getLink();
|
)."\n\n".$this->invitation->getLink();
|
||||||
|
|
||||||
@ -109,7 +107,6 @@ class InvoiceEmailEngine extends BaseEmailEngine
|
|||||||
'number' => $this->invoice->number,
|
'number' => $this->invoice->number,
|
||||||
'account' => $this->invoice->company->present()->name(),
|
'account' => $this->invoice->company->present()->name(),
|
||||||
],
|
],
|
||||||
null,
|
|
||||||
$this->client->locale()
|
$this->client->locale()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,6 @@ class PurchaseOrderEmailEngine extends BaseEmailEngine
|
|||||||
'company' => $this->purchase_order->company->present()->name(),
|
'company' => $this->purchase_order->company->present()->name(),
|
||||||
'amount' => Number::formatMoney($this->purchase_order->balance, $this->vendor),
|
'amount' => Number::formatMoney($this->purchase_order->balance, $this->vendor),
|
||||||
],
|
],
|
||||||
null,
|
|
||||||
$this->vendor->company->locale()
|
$this->vendor->company->locale()
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -86,7 +85,6 @@ class PurchaseOrderEmailEngine extends BaseEmailEngine
|
|||||||
'company' => $this->purchase_order->company->present()->name(),
|
'company' => $this->purchase_order->company->present()->name(),
|
||||||
'amount' => Number::formatMoney($this->purchase_order->balance, $this->vendor),
|
'amount' => Number::formatMoney($this->purchase_order->balance, $this->vendor),
|
||||||
],
|
],
|
||||||
null,
|
|
||||||
$this->vendor->company->locale()
|
$this->vendor->company->locale()
|
||||||
)."\n\n".$this->invitation->getLink();
|
)."\n\n".$this->invitation->getLink();
|
||||||
|
|
||||||
@ -105,7 +103,6 @@ class PurchaseOrderEmailEngine extends BaseEmailEngine
|
|||||||
'number' => $this->purchase_order->number,
|
'number' => $this->purchase_order->number,
|
||||||
'account' => $this->purchase_order->company->present()->name(),
|
'account' => $this->purchase_order->company->present()->name(),
|
||||||
],
|
],
|
||||||
null,
|
|
||||||
$this->vendor->company->locale()
|
$this->vendor->company->locale()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -68,7 +68,6 @@ class QuoteEmailEngine extends BaseEmailEngine
|
|||||||
'company' => $this->quote->company->present()->name(),
|
'company' => $this->quote->company->present()->name(),
|
||||||
'amount' => Number::formatMoney($this->quote->amount, $this->client),
|
'amount' => Number::formatMoney($this->quote->amount, $this->client),
|
||||||
],
|
],
|
||||||
null,
|
|
||||||
$this->client->locale()
|
$this->client->locale()
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -88,7 +87,6 @@ class QuoteEmailEngine extends BaseEmailEngine
|
|||||||
'number' => $this->quote->number,
|
'number' => $this->quote->number,
|
||||||
'account' => $this->quote->company->present()->name(),
|
'account' => $this->quote->company->present()->name(),
|
||||||
],
|
],
|
||||||
null,
|
|
||||||
$this->client->locale()
|
$this->client->locale()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -100,7 +98,6 @@ class QuoteEmailEngine extends BaseEmailEngine
|
|||||||
'company' => $this->quote->company->present()->name(),
|
'company' => $this->quote->company->present()->name(),
|
||||||
'amount' => Number::formatMoney($this->quote->amount, $this->client),
|
'amount' => Number::formatMoney($this->quote->amount, $this->client),
|
||||||
],
|
],
|
||||||
null,
|
|
||||||
$this->client->locale()
|
$this->client->locale()
|
||||||
)."\n\n".$this->invitation->getLink();
|
)."\n\n".$this->invitation->getLink();
|
||||||
|
|
||||||
|
@ -1,36 +1,33 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* Invoice Ninja (https://invoiceninja.com).
|
||||||
|
*
|
||||||
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
|
*
|
||||||
|
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
|
*
|
||||||
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
|
*/
|
||||||
|
|
||||||
namespace App\Mail;
|
namespace App\Mail;
|
||||||
|
|
||||||
use App\Libraries\MultiDB;
|
use App\Libraries\MultiDB;
|
||||||
use App\Models\Company;
|
use App\Models\Company;
|
||||||
use App\Utils\Ninja;
|
use App\Utils\Ninja;
|
||||||
use Illuminate\Bus\Queueable;
|
|
||||||
use Illuminate\Mail\Mailable;
|
use Illuminate\Mail\Mailable;
|
||||||
use Illuminate\Queue\SerializesModels;
|
|
||||||
use Illuminate\Support\Facades\App;
|
use Illuminate\Support\Facades\App;
|
||||||
|
|
||||||
class MigrationCompleted extends Mailable
|
class MigrationCompleted extends Mailable
|
||||||
{
|
{
|
||||||
// use Queueable, SerializesModels;
|
|
||||||
|
|
||||||
public $company_id;
|
public ?Company $company;
|
||||||
|
|
||||||
public $db;
|
|
||||||
|
|
||||||
public $check_data;
|
|
||||||
|
|
||||||
public $company;
|
|
||||||
/**
|
/**
|
||||||
* Create a new message instance.
|
* Create a new message instance.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function __construct(int $company_id, string $db, $check_data = '')
|
public function __construct(public int $company_id, public string $db, public string $check_data = '')
|
||||||
{
|
{
|
||||||
$this->company_id = $company_id;
|
|
||||||
$this->check_data = $check_data;
|
|
||||||
$this->db = $db;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -11,13 +11,16 @@
|
|||||||
|
|
||||||
namespace App\Mail\RecurringInvoice;
|
namespace App\Mail\RecurringInvoice;
|
||||||
|
|
||||||
|
use App\Utils\Ninja;
|
||||||
|
use App\Models\Company;
|
||||||
use App\Models\ClientContact;
|
use App\Models\ClientContact;
|
||||||
use App\Models\RecurringInvoice;
|
use App\Models\RecurringInvoice;
|
||||||
use App\Utils\Ninja;
|
|
||||||
use Illuminate\Support\Facades\App;
|
use Illuminate\Support\Facades\App;
|
||||||
|
|
||||||
class ClientContactRequestCancellationObject
|
class ClientContactRequestCancellationObject
|
||||||
{
|
{
|
||||||
|
public Company $company;
|
||||||
|
|
||||||
public function __construct(public RecurringInvoice $recurring_invoice, public ClientContact $client_contact, private bool $gateway_refund_attempted)
|
public function __construct(public RecurringInvoice $recurring_invoice, public ClientContact $client_contact, private bool $gateway_refund_attempted)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -78,54 +78,12 @@ use Laracasts\Presenter\PresentableTrait;
|
|||||||
* @property-read mixed $hashed_id
|
* @property-read mixed $hashed_id
|
||||||
* @property-read \App\Models\Payment|null $payment
|
* @property-read \App\Models\Payment|null $payment
|
||||||
* @property-read int|null $users_count
|
* @property-read int|null $users_count
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel company()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel exclude($columns)
|
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel exclude($columns)
|
||||||
* @method static \Database\Factories\AccountFactory factory($count = null, $state = [])
|
* @method static \Database\Factories\AccountFactory factory($count = null, $state = [])
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Account newModelQuery()
|
* @method static \Illuminate\Database\Eloquent\Builder|Account newModelQuery()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Account newQuery()
|
* @method static \Illuminate\Database\Eloquent\Builder|Account newQuery()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Account query()
|
* @method static \Illuminate\Database\Eloquent\Builder|Account query()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope()
|
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Account whereAccountSmsVerificationCode($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Account whereAccountSmsVerificationNumber($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Account whereAccountSmsVerified($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Account whereBankIntegrationAccountId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Account whereCreatedAt($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Account whereDefaultCompanyId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Account whereHostedClientCount($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Account whereHostedCompanyCount($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Account whereId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Account whereInappTransactionId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Account whereIsFlagged($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Account whereIsMigrated($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Account whereIsOnboarding($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Account whereIsSchedulerRunning($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Account whereIsTrial($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Account whereIsVerifiedAccount($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Account whereKey($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Account whereLatestVersion($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Account whereNumUsers($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Account whereOnboarding($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Account wherePaymentId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Account wherePlan($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Account wherePlanExpires($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Account wherePlanPaid($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Account wherePlanPrice($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Account wherePlanStarted($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Account wherePlanTerm($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Account wherePlatform($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Account whereReferralCode($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Account whereReportErrors($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Account whereSetReactAsDefaultAp($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Account whereTrialDuration($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Account whereTrialPlan($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Account whereTrialStarted($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Account whereUpdatedAt($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Account whereUserAgent($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Account whereUtmCampaign($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Account whereUtmContent($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Account whereUtmMedium($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Account whereUtmSource($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Account whereUtmTerm($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Account first()
|
* @method static \Illuminate\Database\Eloquent\Builder|Account first()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Account with()
|
* @method static \Illuminate\Database\Eloquent\Builder|Account with()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Account count()
|
* @method static \Illuminate\Database\Eloquent\Builder|Account count()
|
||||||
|
@ -67,37 +67,7 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|||||||
* @property-read \App\Models\VendorContact|null $vendor_contact
|
* @property-read \App\Models\VendorContact|null $vendor_contact
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|StaticModel company()
|
* @method static \Illuminate\Database\Eloquent\Builder|StaticModel company()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|StaticModel exclude($columns)
|
* @method static \Illuminate\Database\Eloquent\Builder|StaticModel exclude($columns)
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Activity newModelQuery()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Activity newQuery()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Activity query()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Activity whereAccountId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Activity whereActivityTypeId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Activity whereClientContactId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Activity whereClientId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Activity whereCompanyId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Activity whereCreatedAt($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Activity whereCreditId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Activity whereExpenseId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Activity whereId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Activity whereInvitationId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Activity whereInvoiceId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Activity whereIp($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Activity whereIsSystem($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Activity whereNotes($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Activity wherePaymentId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Activity whereProjectId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Activity wherePurchaseOrderId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Activity whereQuoteId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Activity whereRecurringExpenseId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Activity whereRecurringInvoiceId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Activity whereRecurringQuoteId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Activity whereSubscriptionId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Activity whereTaskId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Activity whereTokenId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Activity whereUpdatedAt($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Activity whereUserId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Activity whereVendorContactId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Activity whereVendorId($value)
|
|
||||||
* @mixin \Eloquent
|
* @mixin \Eloquent
|
||||||
*/
|
*/
|
||||||
class Activity extends StaticModel
|
class Activity extends StaticModel
|
||||||
@ -475,6 +445,8 @@ class Activity extends StaticModel
|
|||||||
{
|
{
|
||||||
$system = ctrans('texts.system');
|
$system = ctrans('texts.system');
|
||||||
|
|
||||||
|
$translation = '';
|
||||||
|
|
||||||
match($variable) {
|
match($variable) {
|
||||||
':invoice' => $translation = [substr($variable, 1) => [ 'label' => $this?->invoice?->number ?? '', 'hashed_id' => $this->invoice?->hashed_id ?? '']],
|
':invoice' => $translation = [substr($variable, 1) => [ 'label' => $this?->invoice?->number ?? '', 'hashed_id' => $this->invoice?->hashed_id ?? '']],
|
||||||
':user' => $translation = [substr($variable, 1) => [ 'label' => $this?->user?->present()->name() ?? $system, 'hashed_id' => $this->user->hashed_id ?? '']],
|
':user' => $translation = [substr($variable, 1) => [ 'label' => $this?->user?->present()->name() ?? $system, 'hashed_id' => $this->user->hashed_id ?? '']],
|
||||||
|
@ -27,11 +27,11 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
|||||||
* @property string|null $bank_account_number
|
* @property string|null $bank_account_number
|
||||||
* @property string|null $bank_account_status
|
* @property string|null $bank_account_status
|
||||||
* @property string|null $bank_account_type
|
* @property string|null $bank_account_type
|
||||||
* @property string $balance
|
* @property float $balance
|
||||||
* @property string|null $currency
|
* @property int|null $currency
|
||||||
* @property string $nickname
|
* @property string $nickname
|
||||||
* @property string|null $from_date
|
* @property string|null $from_date
|
||||||
* @property int $is_deleted
|
* @property bool $is_deleted
|
||||||
* @property int|null $created_at
|
* @property int|null $created_at
|
||||||
* @property int|null $updated_at
|
* @property int|null $updated_at
|
||||||
* @property int|null $deleted_at
|
* @property int|null $deleted_at
|
||||||
@ -43,7 +43,6 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
|||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\BankTransaction> $transactions
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\BankTransaction> $transactions
|
||||||
* @property-read int|null $transactions_count
|
* @property-read int|null $transactions_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|BaseModel exclude($columns)
|
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel exclude($columns)
|
||||||
* @method static \Database\Factories\BankIntegrationFactory factory($count = null, $state = [])
|
* @method static \Database\Factories\BankIntegrationFactory factory($count = null, $state = [])
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankIntegration filter(\App\Filters\QueryFilters $filters)
|
* @method static \Illuminate\Database\Eloquent\Builder|BankIntegration filter(\App\Filters\QueryFilters $filters)
|
||||||
@ -52,41 +51,9 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
|||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankIntegration onlyTrashed()
|
* @method static \Illuminate\Database\Eloquent\Builder|BankIntegration onlyTrashed()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankIntegration query()
|
* @method static \Illuminate\Database\Eloquent\Builder|BankIntegration query()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope()
|
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankIntegration whereAccountId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankIntegration whereAutoSync($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankIntegration whereBalance($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankIntegration whereBankAccountId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankIntegration whereBankAccountName($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankIntegration whereBankAccountNumber($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankIntegration whereBankAccountStatus($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankIntegration whereBankAccountType($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankIntegration whereCompanyId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankIntegration whereCreatedAt($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankIntegration whereCurrency($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankIntegration whereDeletedAt($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankIntegration whereDisabledUpstream($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankIntegration whereFromDate($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankIntegration whereId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankIntegration whereIsDeleted($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankIntegration whereNickname($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankIntegration whereProviderId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankIntegration whereProviderName($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankIntegration whereUpdatedAt($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankIntegration whereUserId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankIntegration withTrashed()
|
* @method static \Illuminate\Database\Eloquent\Builder|BankIntegration withTrashed()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankIntegration withoutTrashed()
|
* @method static \Illuminate\Database\Eloquent\Builder|BankIntegration withoutTrashed()
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\BankTransaction> $transactions
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\BankTransaction> $transactions
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\BankTransaction> $transactions
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\BankTransaction> $transactions
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\BankTransaction> $transactions
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\BankTransaction> $transactions
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\BankTransaction> $transactions
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\BankTransaction> $transactions
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\BankTransaction> $transactions
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\BankTransaction> $transactions
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\BankTransaction> $transactions
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\BankTransaction> $transactions
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\BankTransaction> $transactions
|
|
||||||
* @mixin \Eloquent
|
* @mixin \Eloquent
|
||||||
*/
|
*/
|
||||||
class BankIntegration extends BaseModel
|
class BankIntegration extends BaseModel
|
||||||
|
@ -34,9 +34,6 @@ class BankSubaccount extends BaseModel
|
|||||||
{
|
{
|
||||||
use SoftDeletes;
|
use SoftDeletes;
|
||||||
|
|
||||||
/**
|
|
||||||
* @var array
|
|
||||||
*/
|
|
||||||
/**
|
/**
|
||||||
* @return BelongsTo
|
* @return BelongsTo
|
||||||
*/
|
*/
|
||||||
|
@ -59,33 +59,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
|||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankTransaction onlyTrashed()
|
* @method static \Illuminate\Database\Eloquent\Builder|BankTransaction onlyTrashed()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankTransaction query()
|
* @method static \Illuminate\Database\Eloquent\Builder|BankTransaction query()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope()
|
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankTransaction whereAccountType($value)
|
* @method static \Illuminate\Database\Eloquent\Account withTrashed()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankTransaction whereAmount($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankTransaction whereBankAccountId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankTransaction whereBankIntegrationId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankTransaction whereBankTransactionRuleId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankTransaction whereBaseType($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankTransaction whereCategoryId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankTransaction whereCategoryType($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankTransaction whereCompanyId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankTransaction whereCreatedAt($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankTransaction whereCurrencyCode($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankTransaction whereCurrencyId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankTransaction whereDate($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankTransaction whereDeletedAt($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankTransaction whereDescription($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankTransaction whereExpenseId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankTransaction whereId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankTransaction whereInvoiceIds($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankTransaction whereIsDeleted($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankTransaction whereNinjaCategoryId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankTransaction wherePaymentId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankTransaction whereStatusId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankTransaction whereTransactionId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankTransaction whereUpdatedAt($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankTransaction whereUserId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankTransaction whereVendorId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankTransaction withTrashed()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BankTransaction withoutTrashed()
|
* @method static \Illuminate\Database\Eloquent\Builder|BankTransaction withoutTrashed()
|
||||||
* @property-read \App\Models\Payment|null $payment
|
* @property-read \App\Models\Payment|null $payment
|
||||||
* @mixin \Eloquent
|
* @mixin \Eloquent
|
||||||
@ -156,32 +130,37 @@ class BankTransaction extends BaseModel
|
|||||||
return self::class;
|
return self::class;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function company()
|
public function company(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Company::class);
|
return $this->belongsTo(Company::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function vendor()
|
public function vendor(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Vendor::class);
|
return $this->belongsTo(Vendor::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function user()
|
public function expense(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
|
{
|
||||||
|
return $this->belongsTo(Expense::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(User::class)->withTrashed();
|
return $this->belongsTo(User::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function bank_integration()
|
public function bank_integration(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(BankIntegration::class)->withTrashed();
|
return $this->belongsTo(BankIntegration::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function account()
|
public function account(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Account::class)->withTrashed();
|
return $this->belongsTo(Account::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function payment()
|
public function payment(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Payment::class)->withTrashed();
|
return $this->belongsTo(Payment::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,7 @@ use Illuminate\Database\Eloquent\ModelNotFoundException as ModelNotFoundExceptio
|
|||||||
* Class BaseModel
|
* Class BaseModel
|
||||||
*
|
*
|
||||||
* @method scope() static
|
* @method scope() static
|
||||||
|
* @method company() static
|
||||||
* @package App\Models
|
* @package App\Models
|
||||||
* @property-read mixed $hashed_id
|
* @property-read mixed $hashed_id
|
||||||
* @property string $number
|
* @property string $number
|
||||||
@ -41,27 +42,25 @@ use Illuminate\Database\Eloquent\ModelNotFoundException as ModelNotFoundExceptio
|
|||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel newQuery($query)
|
* @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|\Illuminate\Database\Query\Builder withTrashed(bool $withTrashed = true)
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel scopeExclude($query)
|
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel scopeExclude($query)
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel find($value)
|
* @method static BaseModel find($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel whereId($query)
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel whereIn($query)
|
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel whereIn($query)
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel where($query)
|
* @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($query)
|
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel create($query)
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel insert($query)
|
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel insert($query)
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel service()
|
* @method BaseModel service()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel orderBy($column, $direction)
|
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel orderBy($column, $direction)
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel invitations()
|
* @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)
|
* @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 static \Illuminate\Database\Eloquent\Builder<static> company()
|
||||||
* @method \App\Models\Company company()
|
|
||||||
* @method int companyId()
|
* @method int companyId()
|
||||||
* @method createInvitations()
|
* @method createInvitations()
|
||||||
* @method Builder|static exclude($columns)
|
* @method Builder scopeCompany(Builder $builder)
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder exclude(array $columns)
|
|
||||||
* @mixin \Eloquent
|
* @mixin \Eloquent
|
||||||
* @mixin \Illuminate\Database\Eloquent\Builder
|
* @mixin \Illuminate\Database\Eloquent\Builder
|
||||||
*/
|
*/
|
||||||
@ -115,10 +114,8 @@ class BaseModel extends Model
|
|||||||
return parent::__call($method, $params);
|
return parent::__call($method, $params);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
V2 type of scope
|
public function scopeCompany($query): \Illuminate\Database\Eloquent\Builder
|
||||||
*/
|
|
||||||
public function scopeCompany($query)
|
|
||||||
{
|
{
|
||||||
/** @var \App\Models\User $user */
|
/** @var \App\Models\User $user */
|
||||||
$user = auth()->user();
|
$user = auth()->user();
|
||||||
@ -128,8 +125,8 @@ class BaseModel extends Model
|
|||||||
return $query;
|
return $query;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
V1 type of scope
|
* @deprecated version
|
||||||
*/
|
*/
|
||||||
public function scopeScope($query)
|
public function scopeScope($query)
|
||||||
{
|
{
|
||||||
|
@ -552,6 +552,7 @@ class Client extends BaseModel implements HasLocalePreference
|
|||||||
|
|
||||||
foreach ($pms as $pm) {
|
foreach ($pms as $pm) {
|
||||||
if ($pm['gateway_type_id'] == GatewayType::CREDIT_CARD) {
|
if ($pm['gateway_type_id'] == GatewayType::CREDIT_CARD) {
|
||||||
|
/**@var \App\Models\CompanyGateway $cg */
|
||||||
$cg = CompanyGateway::find($pm['company_gateway_id']);
|
$cg = CompanyGateway::find($pm['company_gateway_id']);
|
||||||
|
|
||||||
if ($cg && ! property_exists($cg->fees_and_limits, strval(GatewayType::CREDIT_CARD))) {
|
if ($cg && ! property_exists($cg->fees_and_limits, strval(GatewayType::CREDIT_CARD))) {
|
||||||
|
@ -237,6 +237,7 @@ class Company extends BaseModel
|
|||||||
|
|
||||||
// const ENTITY_RECURRING_QUOTE = 'recurring_quote';
|
// const ENTITY_RECURRING_QUOTE = 'recurring_quote';
|
||||||
|
|
||||||
|
/** @var CompanyPresenter */
|
||||||
protected $presenter = CompanyPresenter::class;
|
protected $presenter = CompanyPresenter::class;
|
||||||
|
|
||||||
protected array $tax_coverage_countries = [
|
protected array $tax_coverage_countries = [
|
||||||
@ -732,48 +733,42 @@ class Company extends BaseModel
|
|||||||
return $this->belongsTo(PaymentType::class);
|
return $this->belongsTo(PaymentType::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function expenses(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
public function expenses()
|
|
||||||
{
|
{
|
||||||
return $this->hasMany(Expense::class)->withTrashed();
|
return $this->hasMany(Expense::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function payments(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
public function payments()
|
|
||||||
{
|
{
|
||||||
return $this->hasMany(Payment::class)->withTrashed();
|
return $this->hasMany(Payment::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function tokens()
|
public function tokens(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(CompanyToken::class);
|
return $this->hasMany(CompanyToken::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function client_gateway_tokens()
|
public function client_gateway_tokens(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(ClientGatewayToken::class);
|
return $this->hasMany(ClientGatewayToken::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function system_logs()
|
public function system_logs(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(SystemLog::class)->orderBy('id', 'DESC')->take(100);
|
return $this->hasMany(SystemLog::class)->orderBy('id', 'DESC')->take(100);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function system_log_relation()
|
public function system_log_relation(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(SystemLog::class)->orderBy('id', 'DESC');
|
return $this->hasMany(SystemLog::class)->orderBy('id', 'DESC');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function tokens_hashed()
|
public function tokens_hashed(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(CompanyToken::class);
|
return $this->hasMany(CompanyToken::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function company_users()
|
public function company_users(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(CompanyUser::class)->withTrashed();
|
return $this->hasMany(CompanyUser::class)->withTrashed();
|
||||||
}
|
}
|
||||||
@ -810,7 +805,7 @@ class Company extends BaseModel
|
|||||||
->firstOrFail();
|
->firstOrFail();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function domain()
|
public function domain(): string
|
||||||
{
|
{
|
||||||
if (Ninja::isHosted()) {
|
if (Ninja::isHosted()) {
|
||||||
if ($this->portal_mode == 'domain' && strlen($this->portal_domain) > 3) {
|
if ($this->portal_mode == 'domain' && strlen($this->portal_domain) > 3) {
|
||||||
@ -828,12 +823,12 @@ class Company extends BaseModel
|
|||||||
return new NotificationService($this, $notification);
|
return new NotificationService($this, $notification);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function routeNotificationForSlack($notification)
|
public function routeNotificationForSlack($notification): string
|
||||||
{
|
{
|
||||||
return $this->slack_webhook_url;
|
return $this->slack_webhook_url;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function file_path()
|
public function file_path(): string
|
||||||
{
|
{
|
||||||
return $this->company_key.'/';
|
return $this->company_key.'/';
|
||||||
}
|
}
|
||||||
@ -872,7 +867,7 @@ class Company extends BaseModel
|
|||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function timezone_offset()
|
public function timezone_offset(): int
|
||||||
{
|
{
|
||||||
$offset = 0;
|
$offset = 0;
|
||||||
|
|
||||||
|
@ -21,12 +21,12 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
|||||||
* @property int $company_id
|
* @property int $company_id
|
||||||
* @property int $user_id
|
* @property int $user_id
|
||||||
* @property string $gateway_key
|
* @property string $gateway_key
|
||||||
* @property int $accepted_credit_cards
|
* @property bool $accepted_credit_cards
|
||||||
* @property int $require_cvv
|
* @property bool $require_cvv
|
||||||
* @property int|null $require_billing_address
|
* @property bool $require_billing_address
|
||||||
* @property int|null $require_shipping_address
|
* @property bool $require_shipping_address
|
||||||
* @property int|null $update_details
|
* @property bool $update_details
|
||||||
* @property int $is_deleted
|
* @property bool $is_deleted
|
||||||
* @property string $config
|
* @property string $config
|
||||||
* @property object $fees_and_limits
|
* @property object $fees_and_limits
|
||||||
* @property string|null $custom_value1
|
* @property string|null $custom_value1
|
||||||
@ -38,15 +38,15 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
|||||||
* @property int|null $deleted_at
|
* @property int|null $deleted_at
|
||||||
* @property string $token_billing
|
* @property string $token_billing
|
||||||
* @property string|null $label
|
* @property string|null $label
|
||||||
* @property int $require_client_name
|
* @property bool $require_client_name
|
||||||
* @property int $require_postal_code
|
* @property bool $require_postal_code
|
||||||
* @property int $require_client_phone
|
* @property bool $require_client_phone
|
||||||
* @property int $require_contact_name
|
* @property bool $require_contact_name
|
||||||
* @property int $require_contact_email
|
* @property bool $require_contact_email
|
||||||
* @property int $require_custom_value1
|
* @property bool $require_custom_value1
|
||||||
* @property int $require_custom_value2
|
* @property bool $require_custom_value2
|
||||||
* @property int $require_custom_value3
|
* @property bool $require_custom_value3
|
||||||
* @property int $require_custom_value4
|
* @property bool $require_custom_value4
|
||||||
* @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
|
||||||
@ -61,7 +61,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
|||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope()
|
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope()
|
||||||
* @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 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
|
||||||
* @mixin \Eloquent
|
* @mixin \Eloquent
|
||||||
*/
|
*/
|
||||||
|
@ -66,22 +66,22 @@ class CompanyToken extends BaseModel
|
|||||||
return self::class;
|
return self::class;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function account()
|
public function account(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Account::class);
|
return $this->belongsTo(Account::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function user()
|
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(User::class);
|
return $this->belongsTo(User::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function company()
|
public function company(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Company::class);
|
return $this->belongsTo(Company::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function company_user()
|
public function company_user(): \Illuminate\Database\Eloquent\Relations\HasOne
|
||||||
{
|
{
|
||||||
return $this->hasOne(CompanyUser::class, 'user_id', 'user_id')
|
return $this->hasOne(CompanyUser::class, 'user_id', 'user_id')
|
||||||
->where('company_id', $this->company_id)
|
->where('company_id', $this->company_id)
|
||||||
|
@ -22,6 +22,7 @@ use App\Utils\Traits\MakesDates;
|
|||||||
use App\Utils\Traits\MakesHash;
|
use App\Utils\Traits\MakesHash;
|
||||||
use App\Utils\Traits\MakesInvoiceValues;
|
use App\Utils\Traits\MakesInvoiceValues;
|
||||||
use App\Utils\Traits\MakesReminders;
|
use App\Utils\Traits\MakesReminders;
|
||||||
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
use Illuminate\Support\Carbon;
|
use Illuminate\Support\Carbon;
|
||||||
use Illuminate\Support\Facades\Storage;
|
use Illuminate\Support\Facades\Storage;
|
||||||
@ -112,156 +113,9 @@ use Laracasts\Presenter\PresentableTrait;
|
|||||||
* @property-read int|null $payments_count
|
* @property-read int|null $payments_count
|
||||||
* @property-read \App\Models\Project|null $project
|
* @property-read \App\Models\Project|null $project
|
||||||
* @property-read \App\Models\User $user
|
* @property-read \App\Models\User $user
|
||||||
|
* @property-read \App\Models\Client $client
|
||||||
* @property-read \App\Models\Vendor|null $vendor
|
* @property-read \App\Models\Vendor|null $vendor
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel company()
|
* @property-read mixed $pivot
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel exclude($columns)
|
|
||||||
* @method static \Database\Factories\CreditFactory factory($count = null, $state = [])
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit filter(\App\Filters\QueryFilters $filters)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit newModelQuery()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit newQuery()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit onlyTrashed()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit query()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereAmount($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereAssignedUserId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereBackup($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereBalance($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereClientId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereCompanyId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereCreatedAt($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereCustomSurcharge1($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereCustomSurcharge2($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereCustomSurcharge3($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereCustomSurcharge4($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereCustomSurchargeTax1($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereCustomSurchargeTax2($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereCustomSurchargeTax3($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereCustomSurchargeTax4($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereCustomValue1($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereCustomValue2($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereCustomValue3($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereCustomValue4($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereDate($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereDeletedAt($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereDesignId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereDiscount($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereDueDate($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereExchangeRate($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereFooter($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereInvoiceId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereIsAmountDiscount($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereIsDeleted($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereLastSentDate($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereLastViewed($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereLineItems($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereNextSendDate($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereNumber($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit wherePaidToDate($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit wherePartial($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit wherePartialDueDate($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit wherePoNumber($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit wherePrivateNotes($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereProjectId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit wherePublicNotes($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereRecurringId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereReminder1Sent($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereReminder2Sent($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereReminder3Sent($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereReminderLastSent($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereStatusId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereSubscriptionId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereTaxName1($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereTaxName2($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereTaxName3($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereTaxRate1($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereTaxRate2($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereTaxRate3($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereTerms($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereTotalTaxes($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereUpdatedAt($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereUserId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereUsesInclusiveTaxes($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit whereVendorId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit withTrashed()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Credit withoutTrashed()
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Activity> $activities
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CompanyLedger> $company_ledger
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Backup> $history
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CreditInvitation> $invitations
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Invoice> $invoices
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Payment> $payments
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Activity> $activities
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CompanyLedger> $company_ledger
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Backup> $history
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CreditInvitation> $invitations
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Invoice> $invoices
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Payment> $payments
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Activity> $activities
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CompanyLedger> $company_ledger
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Backup> $history
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CreditInvitation> $invitations
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Invoice> $invoices
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Payment> $payments
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Activity> $activities
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CompanyLedger> $company_ledger
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Backup> $history
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CreditInvitation> $invitations
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Invoice> $invoices
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Payment> $payments
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Activity> $activities
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CompanyLedger> $company_ledger
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Backup> $history
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CreditInvitation> $invitations
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Invoice> $invoices
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Payment> $payments
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Activity> $activities
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CompanyLedger> $company_ledger
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Backup> $history
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CreditInvitation> $invitations
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Invoice> $invoices
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Payment> $payments
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Activity> $activities
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CompanyLedger> $company_ledger
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Backup> $history
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CreditInvitation> $invitations
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Invoice> $invoices
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Payment> $payments
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Activity> $activities
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CompanyLedger> $company_ledger
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Backup> $history
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CreditInvitation> $invitations
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Invoice> $invoices
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Payment> $payments
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Activity> $activities
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CompanyLedger> $company_ledger
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Backup> $history
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CreditInvitation> $invitations
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Invoice> $invoices
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Payment> $payments
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Activity> $activities
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CompanyLedger> $company_ledger
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Backup> $history
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CreditInvitation> $invitations
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Invoice> $invoices
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Payment> $payments
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Activity> $activities
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CompanyLedger> $company_ledger
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Backup> $history
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CreditInvitation> $invitations
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Invoice> $invoices
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Payment> $payments
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Activity> $activities
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Activity> $activities
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CompanyLedger> $company_ledger
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CompanyLedger> $company_ledger
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
||||||
@ -269,6 +123,7 @@ use Laracasts\Presenter\PresentableTrait;
|
|||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CreditInvitation> $invitations
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CreditInvitation> $invitations
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Invoice> $invoices
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Invoice> $invoices
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Payment> $payments
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Payment> $payments
|
||||||
|
*
|
||||||
* @mixin \Eloquent
|
* @mixin \Eloquent
|
||||||
*/
|
*/
|
||||||
class Credit extends BaseModel
|
class Credit extends BaseModel
|
||||||
@ -390,7 +245,7 @@ class Credit extends BaseModel
|
|||||||
return $this->belongsTo(User::class)->withTrashed();
|
return $this->belongsTo(User::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function client()
|
public function client(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Client::class)->withTrashed();
|
return $this->belongsTo(Client::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
@ -86,8 +86,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
|||||||
* @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\Client> $client
|
* @property-read \App\Models\Invoice|null $invoice
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Invoice> $invoice
|
|
||||||
* @property-read \App\Models\BankTransaction|null $transaction
|
* @property-read \App\Models\BankTransaction|null $transaction
|
||||||
* @mixin \Eloquent
|
* @mixin \Eloquent
|
||||||
*/
|
*/
|
||||||
@ -156,12 +155,12 @@ class Expense extends BaseModel
|
|||||||
return $this->morphMany(Document::class, 'documentable');
|
return $this->morphMany(Document::class, 'documentable');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function user()
|
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(User::class)->withTrashed();
|
return $this->belongsTo(User::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function assigned_user()
|
public function assigned_user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(User::class, 'assigned_user_id', 'id')->withTrashed();
|
return $this->belongsTo(User::class, 'assigned_user_id', 'id')->withTrashed();
|
||||||
}
|
}
|
||||||
@ -171,17 +170,17 @@ class Expense extends BaseModel
|
|||||||
return $this->belongsTo(Company::class);
|
return $this->belongsTo(Company::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function invoice()
|
public function invoice(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Invoice::class);
|
return $this->belongsTo(Invoice::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function vendor()
|
public function vendor(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Vendor::class);
|
return $this->belongsTo(Vendor::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function client()
|
public function client(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Client::class);
|
return $this->belongsTo(Client::class);
|
||||||
}
|
}
|
||||||
@ -196,27 +195,27 @@ class Expense extends BaseModel
|
|||||||
return ctrans('texts.expense');
|
return ctrans('texts.expense');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function currency()
|
public function currency(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Currency::class);
|
return $this->belongsTo(Currency::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function category()
|
public function category(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(ExpenseCategory::class)->withTrashed();
|
return $this->belongsTo(ExpenseCategory::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function payment_type()
|
public function payment_type(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(PaymentType::class);
|
return $this->belongsTo(PaymentType::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function project()
|
public function project(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Project::class);
|
return $this->belongsTo(Project::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function transaction()
|
public function transaction(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(BankTransaction::class);
|
return $this->belongsTo(BankTransaction::class);
|
||||||
}
|
}
|
||||||
|
@ -25,6 +25,7 @@ use App\Services\Invoice\InvoiceService;
|
|||||||
use App\Utils\Traits\MakesInvoiceValues;
|
use App\Utils\Traits\MakesInvoiceValues;
|
||||||
use App\Events\Invoice\InvoiceWasEmailed;
|
use App\Events\Invoice\InvoiceWasEmailed;
|
||||||
use Laracasts\Presenter\PresentableTrait;
|
use Laracasts\Presenter\PresentableTrait;
|
||||||
|
use App\Models\Presenters\EntityPresenter;
|
||||||
use App\Models\Presenters\InvoicePresenter;
|
use App\Models\Presenters\InvoicePresenter;
|
||||||
use App\Helpers\Invoice\InvoiceSumInclusive;
|
use App\Helpers\Invoice\InvoiceSumInclusive;
|
||||||
use App\Utils\Traits\Invoice\ActionsInvoice;
|
use App\Utils\Traits\Invoice\ActionsInvoice;
|
||||||
@ -71,10 +72,10 @@ use App\Events\Invoice\InvoiceReminderWasEmailed;
|
|||||||
* @property string|null $custom_value3
|
* @property string|null $custom_value3
|
||||||
* @property string|null $custom_value4
|
* @property string|null $custom_value4
|
||||||
* @property string|null $next_send_date
|
* @property string|null $next_send_date
|
||||||
* @property string|null $custom_surcharge1
|
* @property float|null $custom_surcharge1
|
||||||
* @property string|null $custom_surcharge2
|
* @property float|null $custom_surcharge2
|
||||||
* @property string|null $custom_surcharge3
|
* @property float|null $custom_surcharge3
|
||||||
* @property string|null $custom_surcharge4
|
* @property float|null $custom_surcharge4
|
||||||
* @property bool $custom_surcharge_tax1
|
* @property bool $custom_surcharge_tax1
|
||||||
* @property bool $custom_surcharge_tax2
|
* @property bool $custom_surcharge_tax2
|
||||||
* @property bool $custom_surcharge_tax3
|
* @property bool $custom_surcharge_tax3
|
||||||
@ -99,7 +100,7 @@ use App\Events\Invoice\InvoiceReminderWasEmailed;
|
|||||||
* @property bool $is_proforma
|
* @property bool $is_proforma
|
||||||
* @property-read int|null $activities_count
|
* @property-read int|null $activities_count
|
||||||
* @property-read \App\Models\User|null $assigned_user
|
* @property-read \App\Models\User|null $assigned_user
|
||||||
* @property-read \App\Models\Client $client
|
* @property \App\Models\Client $client
|
||||||
* @property-read \App\Models\Company $company
|
* @property-read \App\Models\Company $company
|
||||||
* @property-read int|null $company_ledger_count
|
* @property-read int|null $company_ledger_count
|
||||||
* @property-read int|null $credits_count
|
* @property-read int|null $credits_count
|
||||||
@ -114,6 +115,7 @@ use App\Events\Invoice\InvoiceReminderWasEmailed;
|
|||||||
* @property-read int|null $history_count
|
* @property-read int|null $history_count
|
||||||
* @property-read int|null $invitations_count
|
* @property-read int|null $invitations_count
|
||||||
* @property-read int|null $payments_count
|
* @property-read int|null $payments_count
|
||||||
|
* @property-read mixed $pivot
|
||||||
* @property-read \App\Models\Project|null $project
|
* @property-read \App\Models\Project|null $project
|
||||||
* @property-read \App\Models\RecurringInvoice|null $recurring_invoice
|
* @property-read \App\Models\RecurringInvoice|null $recurring_invoice
|
||||||
* @property-read \App\Models\Subscription|null $subscription
|
* @property-read \App\Models\Subscription|null $subscription
|
||||||
@ -121,17 +123,6 @@ use App\Events\Invoice\InvoiceReminderWasEmailed;
|
|||||||
* @property-read int|null $tasks_count
|
* @property-read int|null $tasks_count
|
||||||
* @property-read \App\Models\User $user
|
* @property-read \App\Models\User $user
|
||||||
* @property-read \App\Models\Vendor|null $vendor
|
* @property-read \App\Models\Vendor|null $vendor
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel company()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel exclude($columns)
|
|
||||||
* @method static \Database\Factories\InvoiceFactory factory($count = null, $state = [])
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Invoice filter(\App\Filters\QueryFilters $filters)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Invoice newModelQuery()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Invoice newQuery()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Invoice onlyTrashed()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Invoice query()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Invoice withTrashed()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Invoice withoutTrashed()
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Activity> $activities
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Activity> $activities
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CompanyLedger> $company_ledger
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CompanyLedger> $company_ledger
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Credit> $credits
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Credit> $credits
|
||||||
@ -155,7 +146,7 @@ class Invoice extends BaseModel
|
|||||||
use MakesReminders;
|
use MakesReminders;
|
||||||
use ActionsInvoice;
|
use ActionsInvoice;
|
||||||
|
|
||||||
protected $presenter = InvoicePresenter::class;
|
protected $presenter = EntityPresenter::class;
|
||||||
|
|
||||||
protected $touches = [];
|
protected $touches = [];
|
||||||
|
|
||||||
@ -260,67 +251,67 @@ class Invoice extends BaseModel
|
|||||||
return $this->dateMutator($value);
|
return $this->dateMutator($value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function company()
|
public function company(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Company::class);
|
return $this->belongsTo(Company::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function project()
|
public function project(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Project::class);
|
return $this->belongsTo(Project::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function vendor()
|
public function vendor(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Vendor::class);
|
return $this->belongsTo(Vendor::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function design()
|
public function design(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Design::class);
|
return $this->belongsTo(Design::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function user()
|
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(User::class)->withTrashed();
|
return $this->belongsTo(User::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function recurring_invoice()
|
public function recurring_invoice(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(RecurringInvoice::class, 'recurring_id', 'id')->withTrashed();
|
return $this->belongsTo(RecurringInvoice::class, 'recurring_id', 'id')->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function assigned_user()
|
public function assigned_user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(User::class, 'assigned_user_id', 'id')->withTrashed();
|
return $this->belongsTo(User::class, 'assigned_user_id', 'id')->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function invitations()
|
public function invitations(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(InvoiceInvitation::class);
|
return $this->hasMany(InvoiceInvitation::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function client()
|
public function client(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Client::class)->withTrashed();
|
return $this->belongsTo(Client::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function subscription()
|
public function subscription(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Subscription::class)->withTrashed();
|
return $this->belongsTo(Subscription::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function documents()
|
public function documents(): \Illuminate\Database\Eloquent\Relations\MorphMany
|
||||||
{
|
{
|
||||||
return $this->morphMany(Document::class, 'documentable');
|
return $this->morphMany(Document::class, 'documentable');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function payments()
|
public function payments(): \Illuminate\Database\Eloquent\Relations\MorphToMany
|
||||||
{
|
{
|
||||||
return $this->morphToMany(Payment::class, 'paymentable')->withTrashed()->withPivot('amount', 'refunded')->withTimestamps();
|
return $this->morphToMany(Payment::class, 'paymentable')->withTrashed()->withPivot('amount', 'refunded')->withTimestamps();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function company_ledger()
|
public function company_ledger(): \Illuminate\Database\Eloquent\Relations\MorphMany
|
||||||
{
|
{
|
||||||
return $this->morphMany(CompanyLedger::class, 'company_ledgerable');
|
return $this->morphMany(CompanyLedger::class, 'company_ledgerable');
|
||||||
}
|
}
|
||||||
@ -720,6 +711,8 @@ class Invoice extends BaseModel
|
|||||||
|
|
||||||
public function taxTypeString($id)
|
public function taxTypeString($id)
|
||||||
{
|
{
|
||||||
|
$tax_type = false;
|
||||||
|
|
||||||
match(intval($id)){
|
match(intval($id)){
|
||||||
Product::PRODUCT_TYPE_PHYSICAL => $tax_type = ctrans('texts.physical_goods'),
|
Product::PRODUCT_TYPE_PHYSICAL => $tax_type = ctrans('texts.physical_goods'),
|
||||||
Product::PRODUCT_TYPE_SERVICE => $tax_type = ctrans('texts.services'),
|
Product::PRODUCT_TYPE_SERVICE => $tax_type = ctrans('texts.services'),
|
||||||
@ -738,6 +731,7 @@ class Invoice extends BaseModel
|
|||||||
|
|
||||||
public function typeIdString($id)
|
public function typeIdString($id)
|
||||||
{
|
{
|
||||||
|
$type = '';
|
||||||
match($id) {
|
match($id) {
|
||||||
'1' => $type = ctrans('texts.product'),
|
'1' => $type = ctrans('texts.product'),
|
||||||
'2' => $type = ctrans('texts.service'),
|
'2' => $type = ctrans('texts.service'),
|
||||||
|
@ -56,6 +56,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
|||||||
* @property float $exchange_rate
|
* @property float $exchange_rate
|
||||||
* @property int $currency_id
|
* @property int $currency_id
|
||||||
* @property int|null $exchange_currency_id
|
* @property int|null $exchange_currency_id
|
||||||
|
* @property \App\Models\Paymentable $paymentables
|
||||||
* @property object|null $meta
|
* @property object|null $meta
|
||||||
* @property string|null $custom_value1
|
* @property string|null $custom_value1
|
||||||
* @property string|null $custom_value2
|
* @property string|null $custom_value2
|
||||||
@ -67,27 +68,16 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
|||||||
* @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 \App\Models\CompanyGateway|null $company_gateway
|
* @property-read \App\Models\CompanyGateway|null $company_gateway
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CompanyLedger> $company_ledger
|
|
||||||
* @property-read int|null $company_ledger_count
|
|
||||||
* @property-read \App\Models\ClientContact|null $contact
|
* @property-read \App\Models\ClientContact|null $contact
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Credit> $credits
|
|
||||||
* @property-read int|null $credits_count
|
|
||||||
* @property-read \App\Models\Currency|null $currency
|
* @property-read \App\Models\Currency|null $currency
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
|
||||||
* @property-read int|null $documents_count
|
|
||||||
* @property-read \App\Models\Currency|null $exchange_currency
|
* @property-read \App\Models\Currency|null $exchange_currency
|
||||||
* @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 \Illuminate\Database\Eloquent\Collection<int, \App\Models\Invoice> $invoices
|
|
||||||
* @property-read int|null $invoices_count
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Paymentable> $paymentables
|
|
||||||
* @property-read int|null $paymentables_count
|
|
||||||
* @property-read \App\Models\Project|null $project
|
* @property-read \App\Models\Project|null $project
|
||||||
* @property-read \App\Models\PaymentType|null $type
|
* @property-read \App\Models\PaymentType|null $type
|
||||||
* @property-read \App\Models\User|null $user
|
* @property-read \App\Models\User|null $user
|
||||||
* @property-read \App\Models\Vendor|null $vendor
|
* @property-read \App\Models\Vendor|null $vendor
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel company()
|
* @method static \Illuminate\Database\Eloquent\Builder exclude($columns)
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel exclude($columns)
|
|
||||||
* @method static \Database\Factories\PaymentFactory factory($count = null, $state = [])
|
* @method static \Database\Factories\PaymentFactory factory($count = null, $state = [])
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Payment filter(\App\Filters\QueryFilters $filters)
|
* @method static \Illuminate\Database\Eloquent\Builder|Payment filter(\App\Filters\QueryFilters $filters)
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Payment newModelQuery()
|
* @method static \Illuminate\Database\Eloquent\Builder|Payment newModelQuery()
|
||||||
@ -95,13 +85,13 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
|||||||
* @method static \Illuminate\Database\Eloquent\Builder|Payment onlyTrashed()
|
* @method static \Illuminate\Database\Eloquent\Builder|Payment onlyTrashed()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Payment query()
|
* @method static \Illuminate\Database\Eloquent\Builder|Payment query()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope()
|
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Payment withTrashed()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Payment withoutTrashed()
|
* @method static \Illuminate\Database\Eloquent\Builder|Payment withoutTrashed()
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CompanyLedger> $company_ledger
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CompanyLedger> $company_ledger
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Credit> $credits
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Credit> $credits
|
||||||
* @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\Invoice> $invoices
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Invoice> $invoices
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Paymentable> $paymentables
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Paymentable> $paymentables
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Query\Builder withTrashed(bool $withTrashed = true)
|
||||||
* @mixin \Eloquent
|
* @mixin \Eloquent
|
||||||
*/
|
*/
|
||||||
class Payment extends BaseModel
|
class Payment extends BaseModel
|
||||||
@ -237,7 +227,7 @@ class Payment extends BaseModel
|
|||||||
return $this->morphedByMany(Credit::class, 'paymentable')->withTrashed()->withPivot('amount', 'refunded')->withTimestamps();
|
return $this->morphedByMany(Credit::class, 'paymentable')->withTrashed()->withPivot('amount', 'refunded')->withTimestamps();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function company_ledger()
|
public function company_ledger(): \Illuminate\Database\Eloquent\Relations\MorphMany
|
||||||
{
|
{
|
||||||
return $this->morphMany(CompanyLedger::class, 'company_ledgerable');
|
return $this->morphMany(CompanyLedger::class, 'company_ledgerable');
|
||||||
}
|
}
|
||||||
@ -252,7 +242,7 @@ class Payment extends BaseModel
|
|||||||
return $this->belongsTo(Currency::class);
|
return $this->belongsTo(Currency::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function transaction(): BelongsTo
|
public function transaction()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(BankTransaction::class);
|
return $this->belongsTo(BankTransaction::class);
|
||||||
}
|
}
|
||||||
@ -288,7 +278,7 @@ class Payment extends BaseModel
|
|||||||
return $this->belongsTo(GatewayType::class);
|
return $this->belongsTo(GatewayType::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function paymentables()
|
public function paymentables(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(Paymentable::class);
|
return $this->hasMany(Paymentable::class);
|
||||||
}
|
}
|
||||||
|
@ -17,13 +17,16 @@ use Illuminate\Support\Str;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Class CompanyPresenter.
|
* Class CompanyPresenter.
|
||||||
|
* @property \App\DataMapper\CompanySettings $settings
|
||||||
*/
|
*/
|
||||||
class CompanyPresenter extends EntityPresenter
|
class CompanyPresenter extends EntityPresenter
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function name()
|
public function name(): string
|
||||||
{
|
{
|
||||||
return $this->settings->name ?: ctrans('texts.untitled_account');
|
return $this->settings->name ?: ctrans('texts.untitled_account');
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,10 @@ use Laracasts\Presenter\Presenter;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Class EntityPresenter.
|
* Class EntityPresenter.
|
||||||
|
*
|
||||||
|
* @property \App\Models\Company | \App\Models\Client | \App\Models\ClientContact | \App\Models\Vendor | \App\Models\VendorContact $entity
|
||||||
|
* @property \App\Models\Client $client
|
||||||
|
* @property \App\Models\Company $company
|
||||||
*/
|
*/
|
||||||
class EntityPresenter extends Presenter
|
class EntityPresenter extends Presenter
|
||||||
{
|
{
|
||||||
|
@ -23,6 +23,8 @@ use App\Utils\Traits\MakesDates;
|
|||||||
*
|
*
|
||||||
* Shortcuts to other presenters are here to facilitate
|
* Shortcuts to other presenters are here to facilitate
|
||||||
* a clean UI / UX
|
* a clean UI / UX
|
||||||
|
*
|
||||||
|
* @property \App\Models\Invoice $entity
|
||||||
*/
|
*/
|
||||||
class InvoicePresenter extends EntityPresenter
|
class InvoicePresenter extends EntityPresenter
|
||||||
{
|
{
|
||||||
|
@ -50,66 +50,13 @@ use League\CommonMark\CommonMarkConverter;
|
|||||||
* @property string|null $product_image
|
* @property string|null $product_image
|
||||||
* @property-read \App\Models\User|null $assigned_user
|
* @property-read \App\Models\User|null $assigned_user
|
||||||
* @property-read \App\Models\Company $company
|
* @property-read \App\Models\Company $company
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
|
||||||
* @property-read int|null $documents_count
|
* @property-read int|null $documents_count
|
||||||
* @property-read mixed $hashed_id
|
* @property-read mixed $hashed_id
|
||||||
* @property-read \App\Models\User $user
|
* @property-read \App\Models\User $user
|
||||||
* @property-read \App\Models\Vendor|null $vendor
|
* @property-read \App\Models\Vendor|null $vendor
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel company()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel exclude($columns)
|
|
||||||
* @method static \Database\Factories\ProductFactory factory($count = null, $state = [])
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Product filter(\App\Filters\QueryFilters $filters)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Product newModelQuery()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Product newQuery()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Product onlyTrashed()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Product query()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Product whereAssignedUserId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Product whereCompanyId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Product whereCost($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Product whereCreatedAt($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Product whereCustomValue1($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Product whereCustomValue2($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Product whereCustomValue3($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Product whereCustomValue4($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Product whereDeletedAt($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Product whereId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Product whereInStockQuantity($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Product whereIsDeleted($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Product whereMaxQuantity($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Product whereNotes($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Product wherePrice($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Product whereProductImage($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Product whereProductKey($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Product whereProjectId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Product whereQuantity($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Product whereStockNotification($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Product whereStockNotificationThreshold($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Product whereTaxName1($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Product whereTaxName2($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Product whereTaxName3($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Product whereTaxRate1($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Product whereTaxRate2($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Product whereTaxRate3($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Product whereUpdatedAt($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Product whereUserId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Product whereVendorId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Product withTrashed()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Product withoutTrashed()
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
|
||||||
* @property int|null $tax_id
|
* @property int|null $tax_id
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Product whereTaxId($value)
|
* @method static \Illuminate\Database\Eloquent\Builder|Product whereTaxId($value)
|
||||||
* @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 \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
|
|
||||||
* @mixin \Eloquent
|
* @mixin \Eloquent
|
||||||
*/
|
*/
|
||||||
class Product extends BaseModel
|
class Product extends BaseModel
|
||||||
|
@ -116,70 +116,6 @@ use Illuminate\Support\Facades\Storage;
|
|||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder onlyTrashed()
|
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder onlyTrashed()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder query()
|
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder query()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope()
|
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereAmount($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereAssignedUserId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereBackup($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereBalance($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereClientId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereCompanyId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereCreatedAt($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereCurrencyId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereCustomSurcharge1($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereCustomSurcharge2($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereCustomSurcharge3($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereCustomSurcharge4($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereCustomSurchargeTax1($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereCustomSurchargeTax2($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereCustomSurchargeTax3($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereCustomSurchargeTax4($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereCustomValue1($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereCustomValue2($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereCustomValue3($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereCustomValue4($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereDate($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereDeletedAt($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereDesignId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereDiscount($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereDueDate($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereExchangeRate($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereExpenseId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereFooter($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereInvoiceId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereIsAmountDiscount($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereIsDeleted($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereLastSentDate($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereLastViewed($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereLineItems($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereNextSendDate($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereNumber($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder wherePaidToDate($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder wherePartial($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder wherePartialDueDate($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder wherePoNumber($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder wherePrivateNotes($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereProjectId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder wherePublicNotes($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereRecurringId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereReminder1Sent($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereReminder2Sent($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereReminder3Sent($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereReminderLastSent($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereStatusId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereTaxName1($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereTaxName2($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereTaxName3($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereTaxRate1($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereTaxRate2($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereTaxRate3($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereTerms($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereTotalTaxes($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereUpdatedAt($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereUserId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereUsesInclusiveTaxes($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereVendorId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder withTrashed()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder withoutTrashed()
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Activity> $activities
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Activity> $activities
|
||||||
* @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\Backup> $history
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Backup> $history
|
||||||
@ -303,42 +239,42 @@ class PurchaseOrder extends BaseModel
|
|||||||
return self::class;
|
return self::class;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function assigned_user()
|
public function assigned_user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(User::class, 'assigned_user_id', 'id')->withTrashed();
|
return $this->belongsTo(User::class, 'assigned_user_id', 'id')->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function vendor()
|
public function vendor(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Vendor::class)->withTrashed();
|
return $this->belongsTo(Vendor::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function history()
|
public function history(): \Illuminate\Database\Eloquent\Relations\HasManyThrough
|
||||||
{
|
{
|
||||||
return $this->hasManyThrough(Backup::class, Activity::class);
|
return $this->hasManyThrough(Backup::class, Activity::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function activities()
|
public function activities(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(Activity::class)->orderBy('id', 'DESC')->take(50);
|
return $this->hasMany(Activity::class)->orderBy('id', 'DESC')->take(50);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function company()
|
public function company(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Company::class);
|
return $this->belongsTo(Company::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function expense()
|
public function expense(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Expense::class);
|
return $this->belongsTo(Expense::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function user()
|
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(User::class)->withTrashed();
|
return $this->belongsTo(User::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function client()
|
public function client(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Client::class)->withTrashed();
|
return $this->belongsTo(Client::class)->withTrashed();
|
||||||
}
|
}
|
||||||
@ -384,17 +320,17 @@ class PurchaseOrder extends BaseModel
|
|||||||
return Storage::disk('public')->{$type}($file_path);
|
return Storage::disk('public')->{$type}($file_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function invitations()
|
public function invitations(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(PurchaseOrderInvitation::class);
|
return $this->hasMany(PurchaseOrderInvitation::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function project()
|
public function project(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Project::class)->withTrashed();
|
return $this->belongsTo(Project::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function invoice()
|
public function invoice(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Invoice::class);
|
return $this->belongsTo(Invoice::class);
|
||||||
}
|
}
|
||||||
@ -405,17 +341,17 @@ class PurchaseOrder extends BaseModel
|
|||||||
return new PurchaseOrderService($this);
|
return new PurchaseOrderService($this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function invoices()
|
public function invoices(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||||
{
|
{
|
||||||
return $this->belongsToMany(Invoice::class)->using(Paymentable::class);
|
return $this->belongsToMany(Invoice::class)->using(Paymentable::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function payments()
|
public function payments(): \Illuminate\Database\Eloquent\Relations\MorphToMany
|
||||||
{
|
{
|
||||||
return $this->morphToMany(Payment::class, 'paymentable');
|
return $this->morphToMany(Payment::class, 'paymentable');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function documents()
|
public function documents(): \Illuminate\Database\Eloquent\Relations\MorphMany
|
||||||
{
|
{
|
||||||
return $this->morphMany(Document::class, 'documentable');
|
return $this->morphMany(Document::class, 'documentable');
|
||||||
}
|
}
|
||||||
@ -438,7 +374,7 @@ class PurchaseOrder extends BaseModel
|
|||||||
return $purchase_order_calc->build();
|
return $purchase_order_calc->build();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function translate_entity()
|
public function translate_entity(): string
|
||||||
{
|
{
|
||||||
return ctrans('texts.purchase_order');
|
return ctrans('texts.purchase_order');
|
||||||
}
|
}
|
||||||
|
@ -43,6 +43,7 @@ use Laracasts\Presenter\PresentableTrait;
|
|||||||
* @property string|null $number
|
* @property string|null $number
|
||||||
* @property float $discount
|
* @property float $discount
|
||||||
* @property bool $is_amount_discount
|
* @property bool $is_amount_discount
|
||||||
|
* @property bool $auto_bill_enabled
|
||||||
* @property string|null $po_number
|
* @property string|null $po_number
|
||||||
* @property string|null $date
|
* @property string|null $date
|
||||||
* @property string|null $last_sent_date
|
* @property string|null $last_sent_date
|
||||||
@ -90,97 +91,19 @@ use Laracasts\Presenter\PresentableTrait;
|
|||||||
* @property string|null $reminder_last_sent
|
* @property string|null $reminder_last_sent
|
||||||
* @property string $paid_to_date
|
* @property string $paid_to_date
|
||||||
* @property int|null $subscription_id
|
* @property int|null $subscription_id
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Activity> $activities
|
|
||||||
* @property-read int|null $activities_count
|
|
||||||
* @property-read \App\Models\User|null $assigned_user
|
* @property-read \App\Models\User|null $assigned_user
|
||||||
* @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\Document> $documents
|
|
||||||
* @property-read int|null $documents_count
|
|
||||||
* @property-read mixed $balance_due
|
* @property-read mixed $balance_due
|
||||||
* @property-read mixed $hashed_id
|
* @property-read mixed $hashed_id
|
||||||
* @property-read mixed $total
|
* @property-read mixed $total
|
||||||
* @property-read mixed $valid_until
|
* @property-read mixed $valid_until
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Backup> $history
|
|
||||||
* @property-read int|null $history_count
|
|
||||||
* @property-read int|null $invitations_count
|
* @property-read int|null $invitations_count
|
||||||
* @property-read \App\Models\Invoice|null $invoice
|
* @property-read \App\Models\Invoice|null $invoice
|
||||||
* @property-read \App\Models\QuoteInvitation|null $invitations
|
* @property-read \App\Models\QuoteInvitation|null $invitations
|
||||||
* @property-read \App\Models\Project|null $project
|
* @property-read \App\Models\Project|null $project
|
||||||
* @property-read \App\Models\User $user
|
* @property-read \App\Models\User $user
|
||||||
* @property-read \App\Models\Vendor|null $vendor
|
* @property-read \App\Models\Vendor|null $vendor
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel company()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel exclude($columns)
|
|
||||||
* @method static \Database\Factories\QuoteFactory factory($count = null, $state = [])
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote filter(\App\Filters\QueryFilters $filters)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote newModelQuery()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote newQuery()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote onlyTrashed()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote query()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereAmount($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereAssignedUserId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereBackup($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereBalance($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereClientId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereCompanyId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereCreatedAt($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereCustomSurcharge1($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereCustomSurcharge2($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereCustomSurcharge3($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereCustomSurcharge4($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereCustomSurchargeTax1($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereCustomSurchargeTax2($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereCustomSurchargeTax3($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereCustomSurchargeTax4($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereCustomValue1($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereCustomValue2($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereCustomValue3($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereCustomValue4($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereDate($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereDeletedAt($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereDesignId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereDiscount($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereDueDate($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereExchangeRate($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereFooter($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereInvoiceId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereIsAmountDiscount($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereIsDeleted($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereLastSentDate($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereLastViewed($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereLineItems($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereNextSendDate($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereNumber($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote wherePaidToDate($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote wherePartial($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote wherePartialDueDate($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote wherePoNumber($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote wherePrivateNotes($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereProjectId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote wherePublicNotes($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereRecurringId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereReminder1Sent($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereReminder2Sent($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereReminder3Sent($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereReminderLastSent($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereStatusId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereSubscriptionId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereTaxName1($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereTaxName2($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereTaxName3($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereTaxRate1($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereTaxRate2($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereTaxRate3($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereTerms($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereTotalTaxes($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereUpdatedAt($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereUserId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereUsesInclusiveTaxes($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote whereVendorId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote withTrashed()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Quote withoutTrashed()
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Activity> $activities
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Activity> $activities
|
||||||
* @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\Backup> $history
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Backup> $history
|
||||||
@ -291,57 +214,57 @@ class Quote extends BaseModel
|
|||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function company()
|
public function company(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Company::class);
|
return $this->belongsTo(Company::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function vendor()
|
public function vendor(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Vendor::class);
|
return $this->belongsTo(Vendor::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function history()
|
public function history(): \Illuminate\Database\Eloquent\Relations\HasManyThrough
|
||||||
{
|
{
|
||||||
return $this->hasManyThrough(Backup::class, Activity::class);
|
return $this->hasManyThrough(Backup::class, Activity::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function activities()
|
public function activities(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(Activity::class)->orderBy('id', 'DESC')->take(50);
|
return $this->hasMany(Activity::class)->orderBy('id', 'DESC')->take(50);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function user()
|
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(User::class)->withTrashed();
|
return $this->belongsTo(User::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function client()
|
public function client(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Client::class)->withTrashed();
|
return $this->belongsTo(Client::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function invoice()
|
public function invoice(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Invoice::class)->withTrashed();
|
return $this->belongsTo(Invoice::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function assigned_user()
|
public function assigned_user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(User::class, 'assigned_user_id', 'id')->withTrashed();
|
return $this->belongsTo(User::class, 'assigned_user_id', 'id')->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function project()
|
public function project(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Project::class)->withTrashed();
|
return $this->belongsTo(Project::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function invitations()
|
public function invitations(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(QuoteInvitation::class);
|
return $this->hasMany(QuoteInvitation::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function documents()
|
public function documents(): \Illuminate\Database\Eloquent\Relations\MorphMany
|
||||||
{
|
{
|
||||||
return $this->morphMany(Document::class, 'documentable');
|
return $this->morphMany(Document::class, 'documentable');
|
||||||
}
|
}
|
||||||
@ -473,7 +396,7 @@ class Quote extends BaseModel
|
|||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function isApproved()
|
public function isApproved(): bool
|
||||||
{
|
{
|
||||||
if ($this->status_id === $this::STATUS_APPROVED) {
|
if ($this->status_id === $this::STATUS_APPROVED) {
|
||||||
return true;
|
return true;
|
||||||
@ -497,7 +420,7 @@ class Quote extends BaseModel
|
|||||||
return $this->calc()->getTotal();
|
return $this->calc()->getTotal();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function translate_entity()
|
public function translate_entity(): string
|
||||||
{
|
{
|
||||||
return ctrans('texts.quote');
|
return ctrans('texts.quote');
|
||||||
}
|
}
|
||||||
|
@ -278,7 +278,7 @@ class RecurringInvoice extends BaseModel
|
|||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function vendor()
|
public function vendor(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Vendor::class);
|
return $this->belongsTo(Vendor::class);
|
||||||
}
|
}
|
||||||
@ -293,42 +293,42 @@ class RecurringInvoice extends BaseModel
|
|||||||
return $this->hasManyThrough(Backup::class, Activity::class);
|
return $this->hasManyThrough(Backup::class, Activity::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function company()
|
public function company(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Company::class);
|
return $this->belongsTo(Company::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function client()
|
public function client(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Client::class)->withTrashed();
|
return $this->belongsTo(Client::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function project()
|
public function project(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Project::class)->withTrashed();
|
return $this->belongsTo(Project::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function user()
|
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(User::class)->withTrashed();
|
return $this->belongsTo(User::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function assigned_user()
|
public function assigned_user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(User::class, 'assigned_user_id', 'id')->withTrashed();
|
return $this->belongsTo(User::class, 'assigned_user_id', 'id')->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function invoices()
|
public function invoices(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(Invoice::class, 'recurring_id', 'id')->withTrashed();
|
return $this->hasMany(Invoice::class, 'recurring_id', 'id')->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function invitations()
|
public function invitations(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(RecurringInvoiceInvitation::class);
|
return $this->hasMany(RecurringInvoiceInvitation::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function documents()
|
public function documents(): \Illuminate\Database\Eloquent\Relations\MorphMany
|
||||||
{
|
{
|
||||||
return $this->morphMany(Document::class, 'documentable');
|
return $this->morphMany(Document::class, 'documentable');
|
||||||
}
|
}
|
||||||
|
@ -61,6 +61,7 @@ use Laracasts\Presenter\PresentableTrait;
|
|||||||
* @property string $balance
|
* @property string $balance
|
||||||
* @property string|null $last_viewed
|
* @property string|null $last_viewed
|
||||||
* @property int $frequency_id
|
* @property int $frequency_id
|
||||||
|
* @property int $design_id
|
||||||
* @property string|null $last_sent_date
|
* @property string|null $last_sent_date
|
||||||
* @property string|null $next_send_date
|
* @property string|null $next_send_date
|
||||||
* @property int|null $remaining_cycles
|
* @property int|null $remaining_cycles
|
||||||
@ -110,65 +111,6 @@ use Laracasts\Presenter\PresentableTrait;
|
|||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote onlyTrashed()
|
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote onlyTrashed()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote query()
|
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote query()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope()
|
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote whereAmount($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote whereAssignedUserId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote whereAutoBill($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote whereAutoBillEnabled($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote whereBackup($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote whereBalance($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote whereClientId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote whereCompanyId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote whereCreatedAt($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote whereCustomSurcharge1($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote whereCustomSurcharge2($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote whereCustomSurcharge3($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote whereCustomSurcharge4($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote whereCustomSurchargeTax1($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote whereCustomSurchargeTax2($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote whereCustomSurchargeTax3($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote whereCustomSurchargeTax4($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote whereCustomValue1($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote whereCustomValue2($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote whereCustomValue3($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote whereCustomValue4($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote whereDate($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote whereDeletedAt($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote whereDiscount($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote whereDueDate($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote whereDueDateDays($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote whereExchangeRate($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote whereFooter($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote whereFrequencyId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote whereId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote whereIsAmountDiscount($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote whereIsDeleted($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote whereLastSentDate($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote whereLastViewed($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote whereLineItems($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote whereNextSendDate($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote whereNumber($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote wherePaidToDate($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote wherePartial($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote wherePartialDueDate($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote wherePoNumber($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote wherePrivateNotes($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote whereProjectId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote wherePublicNotes($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote whereRemainingCycles($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote whereStatusId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote whereSubscriptionId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote whereTaxName1($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote whereTaxName2($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote whereTaxName3($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote whereTaxRate1($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote whereTaxRate2($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote whereTaxRate3($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote whereTerms($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote whereTotalTaxes($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote whereUpdatedAt($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote whereUserId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote whereUsesInclusiveTaxes($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote whereVendorId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote withTrashed()
|
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote withTrashed()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote withoutTrashed()
|
* @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote withoutTrashed()
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Activity> $activities
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Activity> $activities
|
||||||
@ -176,61 +118,6 @@ use Laracasts\Presenter\PresentableTrait;
|
|||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Backup> $history
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Backup> $history
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\RecurringQuoteInvitation> $invitations
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\RecurringQuoteInvitation> $invitations
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Quote> $quotes
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Quote> $quotes
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Activity> $activities
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Backup> $history
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\RecurringQuoteInvitation> $invitations
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Quote> $quotes
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Activity> $activities
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Backup> $history
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\RecurringQuoteInvitation> $invitations
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Quote> $quotes
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Activity> $activities
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Backup> $history
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\RecurringQuoteInvitation> $invitations
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Quote> $quotes
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Activity> $activities
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Backup> $history
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\RecurringQuoteInvitation> $invitations
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Quote> $quotes
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Activity> $activities
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Backup> $history
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\RecurringQuoteInvitation> $invitations
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Quote> $quotes
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Activity> $activities
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Backup> $history
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\RecurringQuoteInvitation> $invitations
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Quote> $quotes
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Activity> $activities
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Backup> $history
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\RecurringQuoteInvitation> $invitations
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Quote> $quotes
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Activity> $activities
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Backup> $history
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\RecurringQuoteInvitation> $invitations
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Quote> $quotes
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Activity> $activities
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Backup> $history
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\RecurringQuoteInvitation> $invitations
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Quote> $quotes
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Activity> $activities
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Backup> $history
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\RecurringQuoteInvitation> $invitations
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Quote> $quotes
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Activity> $activities
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Backup> $history
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\RecurringQuoteInvitation> $invitations
|
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Quote> $quotes
|
|
||||||
* @mixin \Eloquent
|
* @mixin \Eloquent
|
||||||
*/
|
*/
|
||||||
class RecurringQuote extends BaseModel
|
class RecurringQuote extends BaseModel
|
||||||
|
@ -24,7 +24,7 @@ use Illuminate\Database\Eloquent\ModelNotFoundException as ModelNotFoundExceptio
|
|||||||
* @method static \Illuminate\Database\Eloquent\Builder|StaticModel exclude($columns)
|
* @method static \Illuminate\Database\Eloquent\Builder|StaticModel exclude($columns)
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|StaticModel newModelQuery($value)
|
* @method static \Illuminate\Database\Eloquent\Builder|StaticModel newModelQuery($value)
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|StaticModel newQuery($value)
|
* @method static \Illuminate\Database\Eloquent\Builder|StaticModel newQuery($value)
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|StaticModel query($value)
|
* @method static \Illuminate\Database\Eloquent\Builder|StaticModel query(?$value)
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|StaticModel find($value)
|
* @method static \Illuminate\Database\Eloquent\Builder|StaticModel find($value)
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|StaticModel with($value)
|
* @method static \Illuminate\Database\Eloquent\Builder|StaticModel with($value)
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|StaticModel withTrashed($value)
|
* @method static \Illuminate\Database\Eloquent\Builder|StaticModel withTrashed($value)
|
||||||
|
@ -164,7 +164,7 @@ class Vendor extends BaseModel
|
|||||||
return self::class;
|
return self::class;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function primary_contact()
|
public function primary_contact(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(VendorContact::class)->where('is_primary', true);
|
return $this->hasMany(VendorContact::class)->where('is_primary', true);
|
||||||
}
|
}
|
||||||
@ -179,12 +179,12 @@ class Vendor extends BaseModel
|
|||||||
return $this->belongsTo(User::class, 'assigned_user_id', 'id')->withTrashed();
|
return $this->belongsTo(User::class, 'assigned_user_id', 'id')->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function contacts()
|
public function contacts(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(VendorContact::class)->orderBy('is_primary', 'desc');
|
return $this->hasMany(VendorContact::class)->orderBy('is_primary', 'desc');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function activities()
|
public function activities(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(Activity::class);
|
return $this->hasMany(Activity::class);
|
||||||
}
|
}
|
||||||
|
@ -39,18 +39,6 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
|||||||
* @method static \Illuminate\Database\Eloquent\Builder|Webhook onlyTrashed()
|
* @method static \Illuminate\Database\Eloquent\Builder|Webhook onlyTrashed()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Webhook query()
|
* @method static \Illuminate\Database\Eloquent\Builder|Webhook query()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope()
|
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Webhook whereCompanyId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Webhook whereCreatedAt($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Webhook whereDeletedAt($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Webhook whereEventId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Webhook whereFormat($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Webhook whereHeaders($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Webhook whereId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Webhook whereIsDeleted($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Webhook whereRestMethod($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Webhook whereTargetUrl($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Webhook whereUpdatedAt($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Webhook whereUserId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Webhook withTrashed()
|
* @method static \Illuminate\Database\Eloquent\Builder|Webhook withTrashed()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Webhook withoutTrashed()
|
* @method static \Illuminate\Database\Eloquent\Builder|Webhook withoutTrashed()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|Webhook where()
|
* @method static \Illuminate\Database\Eloquent\Builder|Webhook where()
|
||||||
@ -268,12 +256,12 @@ class Webhook extends BaseModel
|
|||||||
'deleted_at' => 'timestamp',
|
'deleted_at' => 'timestamp',
|
||||||
];
|
];
|
||||||
|
|
||||||
public function user()
|
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(User::class)->withTrashed();
|
return $this->belongsTo(User::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function company()
|
public function company(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Company::class);
|
return $this->belongsTo(Company::class);
|
||||||
}
|
}
|
||||||
|
@ -67,7 +67,7 @@ class EntitySentNotification extends Notification
|
|||||||
* Get the mail representation of the notification.
|
* Get the mail representation of the notification.
|
||||||
*
|
*
|
||||||
* @param mixed $notifiable
|
* @param mixed $notifiable
|
||||||
* @return MailMessage
|
*
|
||||||
*/
|
*/
|
||||||
public function toMail($notifiable)
|
public function toMail($notifiable)
|
||||||
{
|
{
|
||||||
|
@ -67,7 +67,7 @@ class EntityViewedNotification extends Notification
|
|||||||
* Get the mail representation of the notification.
|
* Get the mail representation of the notification.
|
||||||
*
|
*
|
||||||
* @param mixed $notifiable
|
* @param mixed $notifiable
|
||||||
* @return MailMessage
|
*
|
||||||
*/
|
*/
|
||||||
public function toMail($notifiable)
|
public function toMail($notifiable)
|
||||||
{
|
{
|
||||||
@ -103,7 +103,7 @@ class EntityViewedNotification extends Notification
|
|||||||
$this->entity_name => $this->entity->number,
|
$this->entity_name => $this->entity->number,
|
||||||
]
|
]
|
||||||
))
|
))
|
||||||
->attachment(function ($attachment) use ($amount) {
|
->attachment(function ($attachment) {
|
||||||
$attachment->title(ctrans('texts.entity_number_placeholder', ['entity' => ucfirst($this->entity_name), 'entity_number' => $this->entity->number]), $this->invitation->getAdminLink())
|
$attachment->title(ctrans('texts.entity_number_placeholder', ['entity' => ucfirst($this->entity_name), 'entity_number' => $this->entity->number]), $this->invitation->getAdminLink())
|
||||||
->fields([
|
->fields([
|
||||||
ctrans('texts.client') => $this->contact->present()->name(),
|
ctrans('texts.client') => $this->contact->present()->name(),
|
||||||
@ -112,30 +112,30 @@ class EntityViewedNotification extends Notification
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private function buildDataArray()
|
// private function buildDataArray()
|
||||||
{
|
// {
|
||||||
$amount = Number::formatMoney($this->entity->amount, $this->entity->client);
|
// $amount = Number::formatMoney($this->entity->amount, $this->entity->client);
|
||||||
|
|
||||||
$data = [
|
// $data = [
|
||||||
'title' => $this->buildSubject(),
|
// 'title' => $this->buildSubject(),
|
||||||
'message' => ctrans(
|
// 'message' => ctrans(
|
||||||
"texts.notification_{$this->entity_name}_viewed",
|
// "texts.notification_{$this->entity_name}_viewed",
|
||||||
[
|
// [
|
||||||
'amount' => $amount,
|
// 'amount' => $amount,
|
||||||
'client' => $this->contact->present()->name(),
|
// 'client' => $this->contact->present()->name(),
|
||||||
$this->entity_name => $this->entity->number,
|
// $this->entity_name => $this->entity->number,
|
||||||
]
|
// ]
|
||||||
),
|
// ),
|
||||||
'url' => $this->invitation->getAdminLink(),
|
// 'url' => $this->invitation->getAdminLink(),
|
||||||
'button' => ctrans("texts.view_{$this->entity_name}"),
|
// 'button' => ctrans("texts.view_{$this->entity_name}"),
|
||||||
'signature' => $this->settings->email_signature,
|
// 'signature' => $this->settings->email_signature,
|
||||||
'logo' => $this->company->present()->logo(),
|
// 'logo' => $this->company->present()->logo(),
|
||||||
'settings' => $this->settings,
|
// 'settings' => $this->settings,
|
||||||
|
|
||||||
];
|
// ];
|
||||||
|
|
||||||
return $data;
|
// return $data;
|
||||||
}
|
// }
|
||||||
|
|
||||||
private function buildSubject()
|
private function buildSubject()
|
||||||
{
|
{
|
||||||
|
@ -57,7 +57,7 @@ class NewPaymentNotification extends Notification
|
|||||||
* Get the mail representation of the notification.
|
* Get the mail representation of the notification.
|
||||||
*
|
*
|
||||||
* @param mixed $notifiable
|
* @param mixed $notifiable
|
||||||
* @return MailMessage
|
*
|
||||||
*/
|
*/
|
||||||
public function toMail($notifiable)
|
public function toMail($notifiable)
|
||||||
{
|
{
|
||||||
|
@ -63,7 +63,7 @@ class ClientContactRequestCancellation extends Notification
|
|||||||
* Get the mail representation of the notification.
|
* Get the mail representation of the notification.
|
||||||
*
|
*
|
||||||
* @param mixed $notifiable
|
* @param mixed $notifiable
|
||||||
* @return MailMessage
|
*
|
||||||
*/
|
*/
|
||||||
public function toMail($notifiable)
|
public function toMail($notifiable)
|
||||||
{
|
{
|
||||||
|
@ -63,7 +63,7 @@ class ClientContactResetPassword extends Notification
|
|||||||
* Build the mail representation of the notification.
|
* Build the mail representation of the notification.
|
||||||
*
|
*
|
||||||
* @param mixed $notifiable
|
* @param mixed $notifiable
|
||||||
* @return MailMessage
|
*
|
||||||
*/
|
*/
|
||||||
public function toMail($notifiable)
|
public function toMail($notifiable)
|
||||||
{
|
{
|
||||||
|
@ -57,7 +57,7 @@ class NewAccountCreated extends Notification
|
|||||||
* Get the mail representation of the notification.
|
* Get the mail representation of the notification.
|
||||||
*
|
*
|
||||||
* @param mixed $notifiable
|
* @param mixed $notifiable
|
||||||
* @return MailMessage
|
*
|
||||||
*/
|
*/
|
||||||
public function toMail($notifiable)
|
public function toMail($notifiable)
|
||||||
{
|
{
|
||||||
|
@ -42,7 +42,7 @@ class ClientAccountNotFound extends Notification
|
|||||||
* Get the mail representation of the notification.
|
* Get the mail representation of the notification.
|
||||||
*
|
*
|
||||||
* @param mixed $notifiable
|
* @param mixed $notifiable
|
||||||
* @return MailMessage
|
*
|
||||||
*/
|
*/
|
||||||
public function toMail($notifiable)
|
public function toMail($notifiable)
|
||||||
{
|
{
|
||||||
|
@ -45,7 +45,7 @@ class DomainFailureNotification extends Notification
|
|||||||
* Get the mail representation of the notification.
|
* Get the mail representation of the notification.
|
||||||
*
|
*
|
||||||
* @param mixed $notifiable
|
* @param mixed $notifiable
|
||||||
* @return MailMessage
|
*
|
||||||
*/
|
*/
|
||||||
public function toMail($notifiable)
|
public function toMail($notifiable)
|
||||||
{
|
{
|
||||||
|
@ -45,7 +45,7 @@ class DomainRenewalFailureNotification extends Notification
|
|||||||
* Get the mail representation of the notification.
|
* Get the mail representation of the notification.
|
||||||
*
|
*
|
||||||
* @param mixed $notifiable
|
* @param mixed $notifiable
|
||||||
* @return MailMessage
|
*
|
||||||
*/
|
*/
|
||||||
public function toMail($notifiable)
|
public function toMail($notifiable)
|
||||||
{
|
{
|
||||||
|
@ -44,7 +44,7 @@ class EmailBounceNotification extends Notification
|
|||||||
* Get the mail representation of the notification.
|
* Get the mail representation of the notification.
|
||||||
*
|
*
|
||||||
* @param mixed $notifiable
|
* @param mixed $notifiable
|
||||||
* @return MailMessage
|
*
|
||||||
*/
|
*/
|
||||||
public function toMail($notifiable)
|
public function toMail($notifiable)
|
||||||
{
|
{
|
||||||
|
@ -44,7 +44,7 @@ class EmailQuotaNotification extends Notification
|
|||||||
* Get the mail representation of the notification.
|
* Get the mail representation of the notification.
|
||||||
*
|
*
|
||||||
* @param mixed $notifiable
|
* @param mixed $notifiable
|
||||||
* @return MailMessage
|
*
|
||||||
*/
|
*/
|
||||||
public function toMail($notifiable)
|
public function toMail($notifiable)
|
||||||
{
|
{
|
||||||
|
@ -44,7 +44,7 @@ class GmailCredentialNotification extends Notification
|
|||||||
* Get the mail representation of the notification.
|
* Get the mail representation of the notification.
|
||||||
*
|
*
|
||||||
* @param mixed $notifiable
|
* @param mixed $notifiable
|
||||||
* @return MailMessage
|
*
|
||||||
*/
|
*/
|
||||||
public function toMail($notifiable)
|
public function toMail($notifiable)
|
||||||
{
|
{
|
||||||
|
@ -57,7 +57,7 @@ class NewAccountCreated extends Notification
|
|||||||
* Get the mail representation of the notification.
|
* Get the mail representation of the notification.
|
||||||
*
|
*
|
||||||
* @param mixed $notifiable
|
* @param mixed $notifiable
|
||||||
* @return MailMessage
|
*
|
||||||
*/
|
*/
|
||||||
public function toMail($notifiable)
|
public function toMail($notifiable)
|
||||||
{
|
{
|
||||||
|
@ -50,7 +50,7 @@ class NewAccountNotification extends Notification
|
|||||||
* Get the mail representation of the notification.
|
* Get the mail representation of the notification.
|
||||||
*
|
*
|
||||||
* @param mixed $notifiable
|
* @param mixed $notifiable
|
||||||
* @return MailMessage
|
*
|
||||||
*/
|
*/
|
||||||
public function toMail($notifiable)
|
public function toMail($notifiable)
|
||||||
{
|
{
|
||||||
|
@ -42,7 +42,7 @@ class RenewalFailureNotification extends Notification
|
|||||||
* Get the mail representation of the notification.
|
* Get the mail representation of the notification.
|
||||||
*
|
*
|
||||||
* @param mixed $notifiable
|
* @param mixed $notifiable
|
||||||
* @return MailMessage
|
*
|
||||||
*/
|
*/
|
||||||
public function toMail($notifiable)
|
public function toMail($notifiable)
|
||||||
{
|
{
|
||||||
|
@ -45,7 +45,7 @@ class SpamNotification extends Notification
|
|||||||
* Get the mail representation of the notification.
|
* Get the mail representation of the notification.
|
||||||
*
|
*
|
||||||
* @param mixed $notifiable
|
* @param mixed $notifiable
|
||||||
* @return MailMessage
|
*
|
||||||
*/
|
*/
|
||||||
public function toMail($notifiable)
|
public function toMail($notifiable)
|
||||||
{
|
{
|
||||||
|
@ -49,7 +49,7 @@ class UserQualityNotification extends Notification
|
|||||||
* Get the mail representation of the notification.
|
* Get the mail representation of the notification.
|
||||||
*
|
*
|
||||||
* @param mixed $notifiable
|
* @param mixed $notifiable
|
||||||
* @return MailMessage
|
*
|
||||||
*/
|
*/
|
||||||
public function toMail($notifiable)
|
public function toMail($notifiable)
|
||||||
{
|
{
|
||||||
|
@ -1,78 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Invoice Ninja (https://invoiceninja.com).
|
|
||||||
*
|
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
||||||
*
|
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
|
||||||
*
|
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace App\Notifications\Ninja;
|
|
||||||
|
|
||||||
use Illuminate\Bus\Queueable;
|
|
||||||
use Illuminate\Foundation\Bus\Dispatchable;
|
|
||||||
use Illuminate\Notifications\Messages\MailMessage;
|
|
||||||
use Illuminate\Notifications\Notification;
|
|
||||||
use Illuminate\Queue\InteractsWithQueue;
|
|
||||||
use Illuminate\Queue\SerializesModels;
|
|
||||||
|
|
||||||
//@deprecated
|
|
||||||
class VerifyUser extends Notification
|
|
||||||
{
|
|
||||||
// use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a new notification instance.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
protected $user;
|
|
||||||
|
|
||||||
private $company;
|
|
||||||
|
|
||||||
public function __construct($user, $company)
|
|
||||||
{
|
|
||||||
$this->user = $user;
|
|
||||||
$this->company = $company;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the notification's delivery channels.
|
|
||||||
*
|
|
||||||
* @param mixed $notifiable
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public function via($notifiable)
|
|
||||||
{
|
|
||||||
return [''];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the mail representation of the notification.
|
|
||||||
*
|
|
||||||
* @param mixed $notifiable
|
|
||||||
* @return MailMessage
|
|
||||||
*/
|
|
||||||
public function toMail($notifiable)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the array representation of the notification.
|
|
||||||
*
|
|
||||||
* @param mixed $notifiable
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public function toArray($notifiable)
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
//
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
public function toSlack($notifiable)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
@ -44,7 +44,7 @@ class WePayFailureNotification extends Notification
|
|||||||
* Get the mail representation of the notification.
|
* Get the mail representation of the notification.
|
||||||
*
|
*
|
||||||
* @param mixed $notifiable
|
* @param mixed $notifiable
|
||||||
* @return MailMessage
|
*
|
||||||
*/
|
*/
|
||||||
public function toMail($notifiable)
|
public function toMail($notifiable)
|
||||||
{
|
{
|
||||||
|
@ -38,7 +38,7 @@ class ResetPasswordNotification extends Notification
|
|||||||
* Get the mail representation of the notification.
|
* Get the mail representation of the notification.
|
||||||
*
|
*
|
||||||
* @param mixed $notifiable
|
* @param mixed $notifiable
|
||||||
* @return MailMessage
|
*
|
||||||
*/
|
*/
|
||||||
public function toMail($notifiable)
|
public function toMail($notifiable)
|
||||||
{
|
{
|
||||||
|
@ -44,16 +44,16 @@ class PayPalRestPaymentDriver extends BaseDriver
|
|||||||
3 => 'paypal',
|
3 => 'paypal',
|
||||||
1 => 'card',
|
1 => 'card',
|
||||||
25 => 'venmo',
|
25 => 'venmo',
|
||||||
9 => 'sepa',
|
// 9 => 'sepa',
|
||||||
12 => 'bancontact',
|
// 12 => 'bancontact',
|
||||||
17 => 'eps',
|
// 17 => 'eps',
|
||||||
15 => 'giropay',
|
// 15 => 'giropay',
|
||||||
13 => 'ideal',
|
// 13 => 'ideal',
|
||||||
26 => 'mercadopago',
|
// 26 => 'mercadopago',
|
||||||
27 => 'mybank',
|
// 27 => 'mybank',
|
||||||
28 => 'paylater',
|
// 28 => 'paylater',
|
||||||
16 => 'p24',
|
// 16 => 'p24',
|
||||||
7 => 'sofort'
|
// 7 => 'sofort'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
|
@ -41,4 +41,24 @@ class BankTransactionRepository extends BaseRepository
|
|||||||
|
|
||||||
$bts = (new MatchBankTransactions(auth()->user()->company()->id, auth()->user()->company()->db, $data))->handle();
|
$bts = (new MatchBankTransactions(auth()->user()->company()->id, auth()->user()->company()->db, $data))->handle();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function unlink($bt)
|
||||||
|
{
|
||||||
|
if($bt->payment()->exists()){
|
||||||
|
$bt->payment->transaction_id = null;
|
||||||
|
$bt->payment_id = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($bt->expense()->exists()) {
|
||||||
|
$bt->expense->transaction_id = null;
|
||||||
|
$bt->expense_id = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
$bt->vendor_id = null;
|
||||||
|
$bt->status_id = 1;
|
||||||
|
$bt->invoice_ids = null;
|
||||||
|
$bt->ninja_category_id = null;
|
||||||
|
$bt->push();
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -71,6 +71,7 @@ class ClientRepository extends BaseRepository
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (! $client->country_id) {
|
if (! $client->country_id) {
|
||||||
|
/** @var \App\Models\Company $company **/
|
||||||
$company = Company::find($client->company_id);
|
$company = Company::find($client->company_id);
|
||||||
$client->country_id = $company->settings->country_id;
|
$client->country_id = $company->settings->country_id;
|
||||||
}
|
}
|
||||||
|
@ -193,11 +193,12 @@ class PaymentMigrationRepository extends BaseRepository
|
|||||||
/**
|
/**
|
||||||
* If the client is paying in a currency other than
|
* If the client is paying in a currency other than
|
||||||
* the company currency, we need to set a record.
|
* the company currency, we need to set a record.
|
||||||
* @param $data
|
*
|
||||||
* @param $payment
|
* @param array$data
|
||||||
* @return
|
* @param \App\Models\Payment $payment
|
||||||
|
* @return \App\Models\Payment
|
||||||
*/
|
*/
|
||||||
private function processExchangeRates($data, $payment)
|
private function processExchangeRates($data, $payment): \App\Models\Payment
|
||||||
{
|
{
|
||||||
if ($payment->exchange_rate != 1) {
|
if ($payment->exchange_rate != 1) {
|
||||||
return $payment;
|
return $payment;
|
||||||
|
@ -172,11 +172,10 @@ class PaymentRepository extends BaseRepository
|
|||||||
|
|
||||||
$credits = Credit::whereIn('id', array_column($data['credits'], 'credit_id'))->get();
|
$credits = Credit::whereIn('id', array_column($data['credits'], 'credit_id'))->get();
|
||||||
|
|
||||||
// $payment->credits()->saveMany($credits);
|
|
||||||
|
|
||||||
//todo optimize into a single query
|
//todo optimize into a single query
|
||||||
foreach ($data['credits'] as $paid_credit) {
|
foreach ($data['credits'] as $paid_credit) {
|
||||||
|
|
||||||
|
/** @var \App\Models\Credit $credit **/
|
||||||
$credit = $credits->firstWhere('id', $paid_credit['credit_id']);
|
$credit = $credits->firstWhere('id', $paid_credit['credit_id']);
|
||||||
|
|
||||||
if ($credit) {
|
if ($credit) {
|
||||||
|
@ -142,7 +142,7 @@ trait ChartQueries
|
|||||||
"), ['company_currency' => $this->company->settings->currency_id, 'company_id' => $this->company->id, 'start_date' => $start_date, 'end_date' => $end_date]);
|
"), ['company_currency' => $this->company->settings->currency_id, 'company_id' => $this->company->id, 'start_date' => $start_date, 'end_date' => $end_date]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getRevenueQuery($start_date, $end_date)
|
public function getRevenueQueryX($start_date, $end_date)
|
||||||
{
|
{
|
||||||
$user_filter = $this->is_admin ? '' : 'AND clients.user_id = '.$this->user->id;
|
$user_filter = $this->is_admin ? '' : 'AND clients.user_id = '.$this->user->id;
|
||||||
|
|
||||||
@ -164,6 +164,24 @@ trait ChartQueries
|
|||||||
"), ['company_currency' => $this->company->settings->currency_id, 'company_id' => $this->company->id, 'start_date' => $start_date, 'end_date' => $end_date]);
|
"), ['company_currency' => $this->company->settings->currency_id, 'company_id' => $this->company->id, 'start_date' => $start_date, 'end_date' => $end_date]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getRevenueQuery($start_date, $end_date)
|
||||||
|
{
|
||||||
|
$user_filter = $this->is_admin ? '' : 'AND payments.user_id = '.$this->user->id;
|
||||||
|
|
||||||
|
return DB::select(DB::raw("
|
||||||
|
SELECT
|
||||||
|
sum(payments.amount - payments.refunded) as paid_to_date,
|
||||||
|
payments.currency_id AS currency_id
|
||||||
|
FROM payments
|
||||||
|
WHERE payments.company_id = :company_id
|
||||||
|
AND payments.is_deleted = 0
|
||||||
|
{$user_filter}
|
||||||
|
AND payments.status_id IN (1,4,5,6)
|
||||||
|
AND (payments.date BETWEEN :start_date AND :end_date)
|
||||||
|
GROUP BY payments.currency_id
|
||||||
|
"), ['company_id' => $this->company->id, 'start_date' => $start_date, 'end_date' => $end_date]);
|
||||||
|
}
|
||||||
|
|
||||||
public function getInvoicesQuery($start_date, $end_date)
|
public function getInvoicesQuery($start_date, $end_date)
|
||||||
{
|
{
|
||||||
$user_filter = $this->is_admin ? '' : 'AND clients.user_id = '.$this->user->id;
|
$user_filter = $this->is_admin ? '' : 'AND clients.user_id = '.$this->user->id;
|
||||||
|
@ -463,7 +463,7 @@ class FacturaEInvoice extends AbstractService
|
|||||||
$company = $this->invoice->company;
|
$company = $this->invoice->company;
|
||||||
|
|
||||||
$seller = new FacturaeParty([
|
$seller = new FacturaeParty([
|
||||||
"isLegalEntity" => true, // Se asume true si se omite
|
"isLegalEntity" => $company->custom_value1, // Se asume true si se omite
|
||||||
"taxNumber" => $company->settings->vat_number,
|
"taxNumber" => $company->settings->vat_number,
|
||||||
"name" => substr($company->present()->name(), 0, 40),
|
"name" => substr($company->present()->name(), 0, 40),
|
||||||
"address" => substr($company->settings->address1, 0, 80),
|
"address" => substr($company->settings->address1, 0, 80),
|
||||||
|
@ -105,7 +105,7 @@ class RefundPayment
|
|||||||
/**
|
/**
|
||||||
* Create the payment activity.
|
* Create the payment activity.
|
||||||
*
|
*
|
||||||
* @param json $notes gateway_transaction
|
* @param string $notes
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
private function createActivity($notes)
|
private function createActivity($notes)
|
||||||
|
@ -31,7 +31,7 @@ trait ClientGroupSettingsSaver
|
|||||||
* Works for groups|clients|companies
|
* Works for groups|clients|companies
|
||||||
* @param array|object $settings The request input settings array
|
* @param array|object $settings The request input settings array
|
||||||
* @param object $entity The entity which the settings belongs to
|
* @param object $entity The entity which the settings belongs to
|
||||||
* @return void
|
* @return array|object
|
||||||
*/
|
*/
|
||||||
public function saveSettings($settings, $entity)
|
public function saveSettings($settings, $entity)
|
||||||
{
|
{
|
||||||
|
@ -15,8 +15,8 @@ return [
|
|||||||
'require_https' => env('REQUIRE_HTTPS', true),
|
'require_https' => env('REQUIRE_HTTPS', true),
|
||||||
'app_url' => rtrim(env('APP_URL', ''), '/'),
|
'app_url' => rtrim(env('APP_URL', ''), '/'),
|
||||||
'app_domain' => env('APP_DOMAIN', 'invoicing.co'),
|
'app_domain' => env('APP_DOMAIN', 'invoicing.co'),
|
||||||
'app_version' => env('APP_VERSION','5.6.24'),
|
'app_version' => env('APP_VERSION','5.6.25'),
|
||||||
'app_tag' => env('APP_TAG','5.6.24'),
|
'app_tag' => env('APP_TAG','5.6.25'),
|
||||||
'minimum_client_version' => '5.0.16',
|
'minimum_client_version' => '5.0.16',
|
||||||
'terms_version' => '1.0.1',
|
'terms_version' => '1.0.1',
|
||||||
'api_secret' => env('API_SECRET', ''),
|
'api_secret' => env('API_SECRET', ''),
|
||||||
|
@ -4952,7 +4952,7 @@ $LANG = array(
|
|||||||
'sync_from' => 'Sync From',
|
'sync_from' => 'Sync From',
|
||||||
'gateway_payment_text' => 'Invoices: :invoices for :amount for client :client',
|
'gateway_payment_text' => 'Invoices: :invoices for :amount for client :client',
|
||||||
'gateway_payment_text_no_invoice' => 'Payment with no invoice for amount :amount for client :client',
|
'gateway_payment_text_no_invoice' => 'Payment with no invoice for amount :amount for client :client',
|
||||||
'click_to_variables' => 'Client here to see all variables.',
|
'click_to_variables' => 'Click here to see all variables.',
|
||||||
'ship_to' => 'Ship to',
|
'ship_to' => 'Ship to',
|
||||||
'stripe_direct_debit_details' => 'Please transfer into the nominated bank account above.',
|
'stripe_direct_debit_details' => 'Please transfer into the nominated bank account above.',
|
||||||
'branch_name' => 'Branch Name',
|
'branch_name' => 'Branch Name',
|
||||||
@ -5135,9 +5135,13 @@ $LANG = array(
|
|||||||
'activity_10_online' => ':contact entered payment :payment for invoice :invoice for :client',
|
'activity_10_online' => ':contact entered payment :payment for invoice :invoice for :client',
|
||||||
'activity_10_manual' => ':user entered payment :payment for invoice :invoice for :client',
|
'activity_10_manual' => ':user entered payment :payment for invoice :invoice for :client',
|
||||||
'default_payment_type' => 'Default Payment Type',
|
'default_payment_type' => 'Default Payment Type',
|
||||||
|
'number_precision' => 'Number precision',
|
||||||
|
'number_precision_help' => 'Controls the number of decimals supported in the interface',
|
||||||
|
'is_tax_exempt' => 'Tax Exempt',
|
||||||
|
'drop_files_here' => 'Drop files here',
|
||||||
|
'upload_files' => 'Upload Files',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
return $LANG;
|
return $LANG;
|
||||||
|
|
||||||
?>
|
?>
|
@ -369,7 +369,7 @@ $LANG = array(
|
|||||||
'go_back' => 'Retour',
|
'go_back' => 'Retour',
|
||||||
'data_visualizations' => 'Visualisation des données',
|
'data_visualizations' => 'Visualisation des données',
|
||||||
'sample_data' => 'Données fictives présentées',
|
'sample_data' => 'Données fictives présentées',
|
||||||
'hide' => 'Cacher',
|
'hide' => 'Masquer',
|
||||||
'new_version_available' => 'Une nouvelle version de :releases_link est disponible. Vous utilisez v:user_version, la plus récente est v:latest_version',
|
'new_version_available' => 'Une nouvelle version de :releases_link est disponible. Vous utilisez v:user_version, la plus récente est v:latest_version',
|
||||||
'invoice_settings' => 'Paramètres des factures',
|
'invoice_settings' => 'Paramètres des factures',
|
||||||
'invoice_number_prefix' => 'Préfixe du numéro de facture',
|
'invoice_number_prefix' => 'Préfixe du numéro de facture',
|
||||||
@ -1132,7 +1132,7 @@ $LANG = array(
|
|||||||
'document_size' => 'Taille',
|
'document_size' => 'Taille',
|
||||||
|
|
||||||
'enable_client_portal' => 'Portail client',
|
'enable_client_portal' => 'Portail client',
|
||||||
'enable_client_portal_help' => 'Afficher / masquer le portail client.',
|
'enable_client_portal_help' => 'Afficher/masquer le portail client.',
|
||||||
'enable_client_portal_dashboard' => 'Tableau de bord',
|
'enable_client_portal_dashboard' => 'Tableau de bord',
|
||||||
'enable_client_portal_dashboard_help' => 'Afficher/masquer la page du tableau de bord dans le portail client.',
|
'enable_client_portal_dashboard_help' => 'Afficher/masquer la page du tableau de bord dans le portail client.',
|
||||||
|
|
||||||
@ -4281,7 +4281,7 @@ Lorsque les montant apparaîtront sur votre relevé, veuillez revenir sur cette
|
|||||||
'remind_me' => 'Rappel',
|
'remind_me' => 'Rappel',
|
||||||
'instant_bank_pay' => 'Instant Bank Pay',
|
'instant_bank_pay' => 'Instant Bank Pay',
|
||||||
'click_selected' => 'Cliquer sur la sélection',
|
'click_selected' => 'Cliquer sur la sélection',
|
||||||
'hide_preview' => 'Cacher l\'aperçu',
|
'hide_preview' => 'Masquer l\'aperçu',
|
||||||
'edit_record' => 'Modifier l\'enregistrement',
|
'edit_record' => 'Modifier l\'enregistrement',
|
||||||
'credit_is_more_than_invoice' => 'Le montant du crédit ne peut pas être supérieur que le montant de la facture',
|
'credit_is_more_than_invoice' => 'Le montant du crédit ne peut pas être supérieur que le montant de la facture',
|
||||||
'please_set_a_password' => 'Veuillez spécifier un mot de passe',
|
'please_set_a_password' => 'Veuillez spécifier un mot de passe',
|
||||||
@ -5116,6 +5116,17 @@ Lorsque les montant apparaîtront sur votre relevé, veuillez revenir sur cette
|
|||||||
'income' => 'Revenu',
|
'income' => 'Revenu',
|
||||||
'amount_received_help' => 'Saisissez une valeur si le montant total reçu été PLUS élevé que le montant de la facture, ou lors de l\'enregistrement d\'un paiement sans factures. Sinon, ce champ devrait rester vide.',
|
'amount_received_help' => 'Saisissez une valeur si le montant total reçu été PLUS élevé que le montant de la facture, ou lors de l\'enregistrement d\'un paiement sans factures. Sinon, ce champ devrait rester vide.',
|
||||||
'vendor_phone' => 'Téléphone du fournisseur',
|
'vendor_phone' => 'Téléphone du fournisseur',
|
||||||
|
'mercado_pago' => 'Mercado Pago',
|
||||||
|
'mybank' => 'MyBank',
|
||||||
|
'paypal_paylater' => 'Payez en 4',
|
||||||
|
'paid_date' => 'Date de paiement',
|
||||||
|
'district' => 'District',
|
||||||
|
'region' => 'Région',
|
||||||
|
'county' => 'Comté',
|
||||||
|
'tax_details' => 'Détails de taxes',
|
||||||
|
'activity_10_online' => ':contact a saisi un paiement :payment pour la facture :invoice pour :client',
|
||||||
|
'activity_10_manual' => ':user a saisi un paiement :payment pour la facture :invoice pour :client',
|
||||||
|
'default_payment_type' => 'Type de paiement par défaut',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
includes:
|
includes:
|
||||||
- ./vendor/nunomaduro/larastan/extension.neon
|
- ./vendor/nunomaduro/larastan/extension.neon
|
||||||
parameters:
|
parameters:
|
||||||
level: 4
|
level: 2
|
||||||
paths:
|
paths:
|
||||||
- 'app/'
|
- 'app/'
|
||||||
excludePaths:
|
excludePaths:
|
||||||
@ -11,3 +11,10 @@ parameters:
|
|||||||
- 'app/DataMapper/Analytics/*'
|
- 'app/DataMapper/Analytics/*'
|
||||||
universalObjectCratesClasses:
|
universalObjectCratesClasses:
|
||||||
- App\DataMapper\Tax\RuleInterface
|
- App\DataMapper\Tax\RuleInterface
|
||||||
|
- App\DataMapper\FeesAndLimits
|
||||||
|
reportUnmatchedIgnoredErrors: false
|
||||||
|
ignoreErrors:
|
||||||
|
- '#Call to an undefined method [a-zA-Z0-9\\_]+::company\(\)#'
|
||||||
|
- '#Call to an undefined method [a-zA-Z0-9\\_]+::entityFilter\(\)#'
|
||||||
|
- '#Call to an undefined method [a-zA-Z0-9\\_]+::withTrashed()\(\)#'
|
||||||
|
- '#Undefined method#'
|
@ -11,12 +11,14 @@
|
|||||||
|
|
||||||
namespace Tests\Feature;
|
namespace Tests\Feature;
|
||||||
|
|
||||||
|
use Tests\TestCase;
|
||||||
|
use Tests\MockAccountData;
|
||||||
|
use App\Models\BankIntegration;
|
||||||
|
use App\Models\BankTransaction;
|
||||||
use App\Utils\Traits\MakesHash;
|
use App\Utils\Traits\MakesHash;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
|
||||||
use Illuminate\Support\Facades\Session;
|
use Illuminate\Support\Facades\Session;
|
||||||
use Tests\MockAccountData;
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||||
use Tests\TestCase;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @test
|
* @test
|
||||||
@ -109,4 +111,41 @@ class BankTransactionApiTest extends TestCase
|
|||||||
|
|
||||||
$this->assertTrue($arr['data'][0]['is_deleted']);
|
$this->assertTrue($arr['data'][0]['is_deleted']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testBankTransactionUnlink()
|
||||||
|
{
|
||||||
|
BankTransaction::truncate();
|
||||||
|
|
||||||
|
$bi = BankIntegration::factory()->create([
|
||||||
|
'account_id' => $this->account->id,
|
||||||
|
'company_id' => $this->company->id,
|
||||||
|
'user_id' => $this->user->id,
|
||||||
|
]);
|
||||||
|
|
||||||
|
$bank_transaction = BankTransaction::factory()->create([
|
||||||
|
'bank_integration_id' => $bi->id,
|
||||||
|
'user_id' => $this->user->id,
|
||||||
|
'company_id' => $this->company->id,
|
||||||
|
'payment_id' => $this->payment->id,
|
||||||
|
'expense_id' => $this->expense->id,
|
||||||
|
'invoice_ids' => $this->invoice->hashed_id,
|
||||||
|
]);
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'ids' => [$this->encodePrimaryKey($bank_transaction->id)],
|
||||||
|
];
|
||||||
|
|
||||||
|
$response = $this->withHeaders([
|
||||||
|
'X-API-SECRET' => config('ninja.api_secret'),
|
||||||
|
'X-API-TOKEN' => $this->token,
|
||||||
|
])->post('/api/v1/bank_transactions/bulk?action=unlink', $data);
|
||||||
|
|
||||||
|
$arr = $response->json();
|
||||||
|
|
||||||
|
$this->assertEquals(1, $arr['data'][0]['status_id']);
|
||||||
|
$this->assertEquals("", $arr['data'][0]['payment_id']);
|
||||||
|
$this->assertEquals("", $arr['data'][0]['invoice_ids']);
|
||||||
|
$this->assertEquals("", $arr['data'][0]['expense_id']);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -808,6 +808,7 @@ trait MockAccountData
|
|||||||
$cg->fees_and_limits = $data;
|
$cg->fees_and_limits = $data;
|
||||||
$cg->save();
|
$cg->save();
|
||||||
|
|
||||||
|
|
||||||
$cg = new CompanyGateway;
|
$cg = new CompanyGateway;
|
||||||
$cg->company_id = $this->company->id;
|
$cg->company_id = $this->company->id;
|
||||||
$cg->user_id = $user_id;
|
$cg->user_id = $user_id;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user