diff --git a/app/DataMapper/ClientSettings.php b/app/DataMapper/ClientSettings.php index 33ccfbea026a..de723d6f1967 100644 --- a/app/DataMapper/ClientSettings.php +++ b/app/DataMapper/ClientSettings.php @@ -84,6 +84,7 @@ class ClientSettings extends BaseSettings */ public static function buildClientSettings($company_settings, $client_settings) { + if (! $client_settings) { return $company_settings; } diff --git a/app/Export/CSV/ClientExport.php b/app/Export/CSV/ClientExport.php index d34daea11413..43cfa9ab7b2c 100644 --- a/app/Export/CSV/ClientExport.php +++ b/app/Export/CSV/ClientExport.php @@ -28,6 +28,8 @@ class ClientExport extends BaseExport private $contact_transformer; + public Writer $csv; + public string $date_key = 'created_at'; public array $entity_keys = [ diff --git a/app/Export/CSV/ContactExport.php b/app/Export/CSV/ContactExport.php index b5fe8f3e9627..e960a572fa05 100644 --- a/app/Export/CSV/ContactExport.php +++ b/app/Export/CSV/ContactExport.php @@ -29,6 +29,8 @@ class ContactExport extends BaseExport private ClientContactTransformer $contact_transformer; + public Writer $csv; + public string $date_key = 'created_at'; public array $entity_keys = [ diff --git a/app/Export/CSV/CreditExport.php b/app/Export/CSV/CreditExport.php index 718fac44f8ae..e21ec1f5ec60 100644 --- a/app/Export/CSV/CreditExport.php +++ b/app/Export/CSV/CreditExport.php @@ -27,6 +27,8 @@ class CreditExport extends BaseExport public string $date_key = 'created_at'; + public Writer $csv; + public array $entity_keys = [ 'amount' => 'amount', 'balance' => 'balance', diff --git a/app/Export/CSV/DocumentExport.php b/app/Export/CSV/DocumentExport.php index 9748e5e1137f..3b7d06ede415 100644 --- a/app/Export/CSV/DocumentExport.php +++ b/app/Export/CSV/DocumentExport.php @@ -25,7 +25,9 @@ class DocumentExport extends BaseExport private $entity_transformer; - public $date_key = 'created_at'; + public string $date_key = 'created_at'; + + public Writer $csv; public array $entity_keys = [ 'record_type' => 'record_type', diff --git a/app/Export/CSV/ExpenseExport.php b/app/Export/CSV/ExpenseExport.php index b1ac4bee85fe..a1d9411ea5af 100644 --- a/app/Export/CSV/ExpenseExport.php +++ b/app/Export/CSV/ExpenseExport.php @@ -25,7 +25,9 @@ class ExpenseExport extends BaseExport private $expense_transformer; - public $date_key = 'date'; + public string $date_key = 'date'; + + public Writer $csv; public array $entity_keys = [ 'amount' => 'amount', diff --git a/app/Export/CSV/InvoiceExport.php b/app/Export/CSV/InvoiceExport.php index c3e8ac1e1f12..750cbd5f60e8 100644 --- a/app/Export/CSV/InvoiceExport.php +++ b/app/Export/CSV/InvoiceExport.php @@ -27,6 +27,8 @@ class InvoiceExport extends BaseExport public string $date_key = 'date'; + public Writer $csv; + public array $entity_keys = [ 'amount' => 'amount', 'balance' => 'balance', diff --git a/app/Export/CSV/InvoiceItemExport.php b/app/Export/CSV/InvoiceItemExport.php index 2b0ecf809b55..5a58f78ab356 100644 --- a/app/Export/CSV/InvoiceItemExport.php +++ b/app/Export/CSV/InvoiceItemExport.php @@ -28,6 +28,8 @@ class InvoiceItemExport extends BaseExport public string $date_key = 'date'; + public Writer $csv; + public array $entity_keys = [ 'amount' => 'amount', 'balance' => 'balance', diff --git a/app/Export/CSV/PaymentExport.php b/app/Export/CSV/PaymentExport.php index 3e112ad05011..41e090f520f0 100644 --- a/app/Export/CSV/PaymentExport.php +++ b/app/Export/CSV/PaymentExport.php @@ -27,6 +27,8 @@ class PaymentExport extends BaseExport public string $date_key = 'date'; + public Writer $csv; + public array $entity_keys = [ 'amount' => 'amount', 'applied' => 'applied', diff --git a/app/Export/CSV/ProductExport.php b/app/Export/CSV/ProductExport.php index ec8e03ea8bff..2b1a6d698f3d 100644 --- a/app/Export/CSV/ProductExport.php +++ b/app/Export/CSV/ProductExport.php @@ -26,7 +26,9 @@ class ProductExport extends BaseExport private $entity_transformer; - public $date_key = 'created_at'; + public string $date_key = 'created_at'; + + public Writer $csv; public array $entity_keys = [ 'project' => 'project_id', diff --git a/app/Export/CSV/QuoteExport.php b/app/Export/CSV/QuoteExport.php index e76b68a0e25e..8031f01f05e2 100644 --- a/app/Export/CSV/QuoteExport.php +++ b/app/Export/CSV/QuoteExport.php @@ -27,6 +27,8 @@ class QuoteExport extends BaseExport public string $date_key = 'date'; + public Writer $csv; + public array $entity_keys = [ 'amount' => 'amount', 'balance' => 'balance', diff --git a/app/Export/CSV/QuoteItemExport.php b/app/Export/CSV/QuoteItemExport.php index ccd3538f192c..4059174a8af8 100644 --- a/app/Export/CSV/QuoteItemExport.php +++ b/app/Export/CSV/QuoteItemExport.php @@ -27,6 +27,8 @@ class QuoteItemExport extends BaseExport public string $date_key = 'date'; + public Writer $csv; + public array $entity_keys = [ 'amount' => 'amount', 'balance' => 'balance', diff --git a/app/Export/CSV/RecurringInvoiceExport.php b/app/Export/CSV/RecurringInvoiceExport.php index 43e96ee4d932..dfce445df17b 100644 --- a/app/Export/CSV/RecurringInvoiceExport.php +++ b/app/Export/CSV/RecurringInvoiceExport.php @@ -27,6 +27,8 @@ class RecurringInvoiceExport extends BaseExport public string $date_key = 'date'; + public Writer $csv; + public array $entity_keys = [ 'amount' => 'amount', 'balance' => 'balance', diff --git a/app/Export/CSV/TaskExport.php b/app/Export/CSV/TaskExport.php index d7a8e537613f..3f51da154851 100644 --- a/app/Export/CSV/TaskExport.php +++ b/app/Export/CSV/TaskExport.php @@ -28,10 +28,12 @@ class TaskExport extends BaseExport private $entity_transformer; - public $date_key = 'created_at'; + public string $date_key = 'created_at'; private string $date_format = 'YYYY-MM-DD'; + public Writer $csv; + public array $entity_keys = [ 'start_date' => 'start_date', 'end_date' => 'end_date', diff --git a/app/Http/Controllers/EmailController.php b/app/Http/Controllers/EmailController.php index 69be30768391..56d76a4c79d8 100644 --- a/app/Http/Controllers/EmailController.php +++ b/app/Http/Controllers/EmailController.php @@ -11,26 +11,26 @@ namespace App\Http\Controllers; -use App\Events\Credit\CreditWasEmailed; -use App\Events\Quote\QuoteWasEmailed; -use App\Http\Requests\Email\SendEmailRequest; -use App\Jobs\Entity\EmailEntity; -use App\Jobs\PurchaseOrder\PurchaseOrderEmail; +use App\Utils\Ninja; +use App\Models\Quote; use App\Models\Credit; use App\Models\Invoice; use App\Models\PurchaseOrder; -use App\Models\Quote; +use App\Services\Email\Email; +use Illuminate\Http\Response; +use App\Utils\Traits\MakesHash; +use App\Jobs\Entity\EmailEntity; use App\Models\RecurringInvoice; -use App\Services\Email\MailEntity; -use App\Services\Email\MailObject; +use App\Services\Email\EmailObject; +use App\Events\Quote\QuoteWasEmailed; +use App\Transformers\QuoteTransformer; +use App\Events\Credit\CreditWasEmailed; use App\Transformers\CreditTransformer; use App\Transformers\InvoiceTransformer; +use App\Http\Requests\Email\SendEmailRequest; +use App\Jobs\PurchaseOrder\PurchaseOrderEmail; use App\Transformers\PurchaseOrderTransformer; -use App\Transformers\QuoteTransformer; use App\Transformers\RecurringInvoiceTransformer; -use App\Utils\Ninja; -use App\Utils\Traits\MakesHash; -use Illuminate\Http\Response; class EmailController extends BaseController { @@ -119,7 +119,6 @@ class EmailController extends BaseController $entity_obj = $entity::withTrashed()->with('invitations')->find($request->input('entity_id')); $subject = $request->has('subject') ? $request->input('subject') : ''; $body = $request->has('body') ? $request->input('body') : ''; - $entity_string = strtolower(class_basename($entity_obj)); $template = str_replace('email_template_', '', $request->input('template')); $data = [ @@ -127,27 +126,30 @@ class EmailController extends BaseController 'body' => $body, ]; - $mo = new MailObject; - $mo->subject = empty($subject) ? null : $subject; - $mo->body = empty($body) ? null : $body; - $mo->entity_string = $entity; - $mo->email_template = $template; + $mo = new EmailObject; + $mo->subject = strlen($subject) > 3 ? $subject : null; + $mo->body = strlen($body) > 3 ? $body : null; + $mo->entity_id = $request->input('entity_id'); + $mo->template = $request->input('template'); //full template name in use + $mo->entity_class = $this->resolveClass($entity); + $mo->email_template_body = $request->input('template'); + $mo->email_template_subject = str_replace("template", "subject", $request->input('template')); - if (Ninja::isHosted() && !$entity_obj->company->account->account_sms_verified) { - return response(['message' => 'Please verify your account to send emails.'], 400); - } - - if ($entity == 'purchaseOrder' || $entity == 'purchase_order' || $template == 'purchase_order' || $entity == 'App\Models\PurchaseOrder') { - return $this->sendPurchaseOrder($entity_obj, $data, $template); - } - $entity_obj->invitations->each(function ($invitation) use ($data, $entity_string, $entity_obj, $template, $mo) { + // if ($entity == 'purchaseOrder' || $entity == 'purchase_order' || $template == 'purchase_order' || $entity == 'App\Models\PurchaseOrder') { + // return $this->sendPurchaseOrder($entity_obj, $data, $template); + // } + + $entity_obj->invitations->each(function ($invitation) use ($data, $entity_obj, $template, $mo) { if (! $invitation->contact->trashed() && $invitation->contact->email) { $entity_obj->service()->markSent()->save(); - EmailEntity::dispatch($invitation->fresh(), $invitation->company, $template, $data); + // EmailEntity::dispatch($invitation->fresh(), $invitation->company, $template, $data); + + $mo->invitation_id = $invitation->id; + + Email::dispatch($mo, $invitation->company); - // MailEntity::dispatch($invitation, $invitation->company->db, $mo); } }); @@ -188,6 +190,12 @@ class EmailController extends BaseController $this->entity_transformer = RecurringInvoiceTransformer::class; } + if($entity_obj instanceof PurchaseOrder){ + $this->entity_type = PurchaseOrder::class; + $this->entity_transformer = PurchaseOrderTransformer::class; + } + + // @phpstan-ignore-next-line return $this->itemResponse($entity_obj->fresh()); } @@ -203,4 +211,24 @@ class EmailController extends BaseController return $this->itemResponse($entity_obj); } + + private function resolveClass(string $entity): string + { + + match($entity){ + 'invoice' => $class = Invoice::class, + 'App\Models\Invoice' => $class = Invoice::class, + 'credit' => $class = Credit::class, + 'App\Models\Credit' => $class = Credit::class, + 'quote' => $class = Quote::class, + 'App\Models\Quote' => $class = Quote::class, + 'purchase_order' => $class = PurchaseOrder::class, + 'purchaseOrder' => $class = PurchaseOrder::class, + 'App\Models\PurchaseOrder' => $class = PurchaseOrder::class, + default => $class = Invoice::class, + }; + + return $class; + + } } diff --git a/app/Http/Controllers/VendorPortal/InvitationController.php b/app/Http/Controllers/VendorPortal/InvitationController.php index fcf88380d5e0..80bc02e5d5df 100644 --- a/app/Http/Controllers/VendorPortal/InvitationController.php +++ b/app/Http/Controllers/VendorPortal/InvitationController.php @@ -91,7 +91,7 @@ class InvitationController extends Controller $file_name = $invitation->purchase_order->numberFormatter().'.pdf'; - $file = (new CreatePurchaseOrderPdf($invitation))->handle(); + $file = (new CreatePurchaseOrderPdf($invitation))->rawPdf(); $headers = ['Content-Type' => 'application/pdf']; diff --git a/app/Http/Livewire/SubscriptionPlanSwitch.php b/app/Http/Livewire/SubscriptionPlanSwitch.php index 484493179b42..e00ff08da5c7 100644 --- a/app/Http/Livewire/SubscriptionPlanSwitch.php +++ b/app/Http/Livewire/SubscriptionPlanSwitch.php @@ -22,7 +22,7 @@ use Livewire\Component; class SubscriptionPlanSwitch extends Component { /** - * @var RecurringInvoice + * @var \App\Models\RecurringInvoice */ public $recurring_invoice; diff --git a/app/Http/Requests/Email/SendEmailRequest.php b/app/Http/Requests/Email/SendEmailRequest.php index bc5ec63d6ef0..36cd4d2e9854 100644 --- a/app/Http/Requests/Email/SendEmailRequest.php +++ b/app/Http/Requests/Email/SendEmailRequest.php @@ -12,13 +12,16 @@ namespace App\Http\Requests\Email; use App\Http\Requests\Request; +use App\Utils\Ninja; use App\Utils\Traits\MakesHash; +use Illuminate\Auth\Access\AuthorizationException; use Illuminate\Support\Str; class SendEmailRequest extends Request { use MakesHash; + private string $error_message = ''; /** * Determine if the user is authorized to make this request. * @@ -78,7 +81,14 @@ class SendEmailRequest extends Request private function checkUserAbleToSend() { $input = $this->all(); + + + if (Ninja::isHosted() && !auth()->user()->account->account_sms_verified) { + $this->error_message = ctrans('texts.authorization_sms_failure'); + return false; + } + /*Make sure we have all the require ingredients to send a template*/ if (array_key_exists('entity', $input) && array_key_exists('entity_id', $input) && is_string($input['entity']) && $input['entity_id']) { $company = auth()->user()->company(); @@ -96,4 +106,9 @@ class SendEmailRequest extends Request return false; } + + protected function failedAuthorization() + { + throw new AuthorizationException($this->error_message); + } } diff --git a/app/Http/Requests/Report/GenericReportRequest.php b/app/Http/Requests/Report/GenericReportRequest.php index 0789ec649476..826ef00a5156 100644 --- a/app/Http/Requests/Report/GenericReportRequest.php +++ b/app/Http/Requests/Report/GenericReportRequest.php @@ -56,8 +56,8 @@ class GenericReportRequest extends Request $input['start_date'] = null; $input['end_date'] = null; } - nlog($input); $this->replace($input); + } } diff --git a/app/Jobs/Invoice/CreateUbl.php b/app/Jobs/Invoice/CreateUbl.php index 0087e98fd8d0..441726583507 100644 --- a/app/Jobs/Invoice/CreateUbl.php +++ b/app/Jobs/Invoice/CreateUbl.php @@ -48,10 +48,8 @@ class CreateUbl implements ShouldQueue } /** - * Execute the job. - * - * - * @return void + * Execute the job + * @return ?string */ public function handle() { diff --git a/app/Models/Account.php b/app/Models/Account.php index ff66c29599c4..d57a3225c6b3 100644 --- a/app/Models/Account.php +++ b/app/Models/Account.php @@ -27,6 +27,111 @@ use Illuminate\Support\Facades\App; use Illuminate\Support\Facades\Cache; use Laracasts\Presenter\PresentableTrait; +/** + * App\Models\Account + * + * @property int $id + * @property string|null $plan + * @property string|null $plan_term + * @property string|null $plan_started + * @property string|null $plan_paid + * @property string|null $plan_expires + * @property string|null $user_agent + * @property string|null $key + * @property int|null $payment_id + * @property int $default_company_id + * @property string|null $trial_started + * @property string|null $trial_plan + * @property string|null $plan_price + * @property int $num_users + * @property string|null $utm_source + * @property string|null $utm_medium + * @property string|null $utm_campaign + * @property string|null $utm_term + * @property string|null $utm_content + * @property string $latest_version + * @property int $report_errors + * @property string|null $referral_code + * @property int|null $created_at + * @property int|null $updated_at + * @property int $is_scheduler_running + * @property int|null $trial_duration + * @property int $is_onboarding + * @property object|null $onboarding + * @property int $is_migrated + * @property string|null $platform + * @property int|null $hosted_client_count + * @property int|null $hosted_company_count + * @property string|null $inapp_transaction_id + * @property bool $set_react_as_default_ap + * @property int $is_flagged + * @property int $is_verified_account + * @property string|null $account_sms_verification_code + * @property string|null $account_sms_verification_number + * @property int $account_sms_verified + * @property string|null $bank_integration_account_id + * @property int $is_trial + * @property-read \Illuminate\Database\Eloquent\Collection $bank_integrations + * @property-read int|null $bank_integrations_count + * @property-read \Illuminate\Database\Eloquent\Collection $companies + * @property-read int|null $companies_count + * @property-read \Illuminate\Database\Eloquent\Collection $company_users + * @property-read int|null $company_users_count + * @property-read \App\Models\Company|null $default_company + * @property-read mixed $hashed_id + * @property-read \App\Models\Payment|null $payment + * @property-read \Illuminate\Database\Eloquent\Collection $users + * @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 \Database\Factories\AccountFactory factory($count = null, $state = []) + * @method static \Illuminate\Database\Eloquent\Builder|Account newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Account newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Account query() + * @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) + * @mixin \Eloquent + */ class Account extends BaseModel { use PresentableTrait; diff --git a/app/Models/Activity.php b/app/Models/Activity.php index aa8107cfc4ad..3d84f724cbf8 100644 --- a/app/Models/Activity.php +++ b/app/Models/Activity.php @@ -13,6 +13,91 @@ namespace App\Models; use App\Utils\Traits\MakesHash; +/** + * App\Models\Activity + * + * @property int $id + * @property int|null $user_id + * @property int $company_id + * @property int|null $client_id + * @property int|null $client_contact_id + * @property int|null $account_id + * @property int|null $project_id + * @property int|null $vendor_id + * @property int|null $payment_id + * @property int|null $invoice_id + * @property int|null $credit_id + * @property int|null $invitation_id + * @property int|null $task_id + * @property int|null $expense_id + * @property int|null $activity_type_id + * @property string $ip + * @property bool $is_system + * @property string $notes + * @property int|null $created_at + * @property int|null $updated_at + * @property int|null $token_id + * @property int|null $quote_id + * @property int|null $subscription_id + * @property int|null $recurring_invoice_id + * @property int|null $recurring_expense_id + * @property int|null $recurring_quote_id + * @property int|null $purchase_order_id + * @property int|null $vendor_contact_id + * @property-read \App\Models\Backup|null $backup + * @property-read \App\Models\Client|null $client + * @property-read \App\Models\Company $company + * @property-read \App\Models\ClientContact|null $contact + * @property-read \App\Models\Credit|null $credit + * @property-read \App\Models\Expense|null $expense + * @property-read mixed $hashed_id + * @property-read \App\Models\Backup|null $history + * @property-read \App\Models\Invoice|null $invoice + * @property-read \App\Models\Payment|null $payment + * @property-read \App\Models\PurchaseOrder|null $purchase_order + * @property-read \App\Models\Quote|null $quote + * @property-read \App\Models\RecurringExpense|null $recurring_expense + * @property-read \App\Models\RecurringInvoice|null $recurring_invoice + * @property-read \App\Models\Subscription|null $subscription + * @property-read \App\Models\Task|null $task + * @property-read \App\Models\User|null $user + * @property-read \App\Models\Vendor|null $vendor + * @property-read \App\Models\VendorContact|null $vendor_contact + * @method static \Illuminate\Database\Eloquent\Builder|StaticModel company() + * @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 + */ class Activity extends StaticModel { use MakesHash; diff --git a/app/Models/Backup.php b/app/Models/Backup.php index c4920e64adf5..c0fd324fdf3c 100644 --- a/app/Models/Backup.php +++ b/app/Models/Backup.php @@ -13,6 +13,35 @@ namespace App\Models; use Illuminate\Support\Facades\Storage; +/** + * App\Models\Backup + * + * @property int $id + * @property int $activity_id + * @property string|null $json_backup + * @property int|null $created_at + * @property int|null $updated_at + * @property string $amount + * @property string|null $filename + * @property string|null $disk + * @property-read \App\Models\Activity $activity + * @property-read mixed $hashed_id + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel company() + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel exclude($columns) + * @method static \Illuminate\Database\Eloquent\Builder|Backup newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Backup newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Backup query() + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope() + * @method static \Illuminate\Database\Eloquent\Builder|Backup whereActivityId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Backup whereAmount($value) + * @method static \Illuminate\Database\Eloquent\Builder|Backup whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Backup whereDisk($value) + * @method static \Illuminate\Database\Eloquent\Builder|Backup whereFilename($value) + * @method static \Illuminate\Database\Eloquent\Builder|Backup whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Backup whereJsonBackup($value) + * @method static \Illuminate\Database\Eloquent\Builder|Backup whereUpdatedAt($value) + * @mixin \Eloquent + */ class Backup extends BaseModel { public function getEntityType() diff --git a/app/Models/Bank.php b/app/Models/Bank.php index 36f226fe24a9..6e0e6f2e8dbd 100644 --- a/app/Models/Bank.php +++ b/app/Models/Bank.php @@ -13,6 +13,23 @@ namespace App\Models; /** * Class Bank. + * + * @property int $id + * @property string|null $name + * @property string|null $remote_id + * @property int $bank_library_id + * @property string|null $config + * @method static \Illuminate\Database\Eloquent\Builder|StaticModel company() + * @method static \Illuminate\Database\Eloquent\Builder|StaticModel exclude($columns) + * @method static \Illuminate\Database\Eloquent\Builder|Bank newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Bank newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Bank query() + * @method static \Illuminate\Database\Eloquent\Builder|Bank whereBankLibraryId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Bank whereConfig($value) + * @method static \Illuminate\Database\Eloquent\Builder|Bank whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Bank whereName($value) + * @method static \Illuminate\Database\Eloquent\Builder|Bank whereRemoteId($value) + * @mixin \Eloquent */ class Bank extends StaticModel { diff --git a/app/Models/BankAccount.php b/app/Models/BankAccount.php index 8419e4401c50..7c0ebebdff5a 100644 --- a/app/Models/BankAccount.php +++ b/app/Models/BankAccount.php @@ -18,6 +18,21 @@ use Illuminate\Database\Eloquent\SoftDeletes; /** * Class BankAccount. + * + * @property-read \App\Models\Bank|null $bank + * @property-read \Illuminate\Database\Eloquent\Collection $bank_subaccounts + * @property-read int|null $bank_subaccounts_count + * @property-read mixed $hashed_id + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel company() + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel exclude($columns) + * @method static \Illuminate\Database\Eloquent\Builder|BankAccount newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|BankAccount newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|BankAccount onlyTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|BankAccount query() + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope() + * @method static \Illuminate\Database\Eloquent\Builder|BankAccount withTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|BankAccount withoutTrashed() + * @mixin \Eloquent */ class BankAccount extends BaseModel { diff --git a/app/Models/BankIntegration.php b/app/Models/BankIntegration.php index 8ed73e81053f..4c54136ebd1a 100644 --- a/app/Models/BankIntegration.php +++ b/app/Models/BankIntegration.php @@ -13,6 +13,70 @@ namespace App\Models; use Illuminate\Database\Eloquent\SoftDeletes; +/** + * App\Models\BankIntegration + * + * @property int $id + * @property int $account_id + * @property int $company_id + * @property int $user_id + * @property string $provider_name + * @property int $provider_id + * @property int $bank_account_id + * @property string|null $bank_account_name + * @property string|null $bank_account_number + * @property string|null $bank_account_status + * @property string|null $bank_account_type + * @property string $balance + * @property string|null $currency + * @property string $nickname + * @property string|null $from_date + * @property int $is_deleted + * @property int|null $created_at + * @property int|null $updated_at + * @property int|null $deleted_at + * @property int $disabled_upstream + * @property int $auto_sync + * @property-read \App\Models\Account $account + * @property-read \App\Models\Company $company + * @property-read mixed $hashed_id + * @property-read \Illuminate\Database\Eloquent\Collection $transactions + * @property-read int|null $transactions_count + * @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 \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 newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|BankIntegration newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|BankIntegration onlyTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|BankIntegration query() + * @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 withoutTrashed() + * @mixin \Eloquent + */ class BankIntegration extends BaseModel { use SoftDeletes; diff --git a/app/Models/BankSubaccount.php b/app/Models/BankSubaccount.php index 2b80d1ef7dd6..29cd4a0de5de 100644 --- a/app/Models/BankSubaccount.php +++ b/app/Models/BankSubaccount.php @@ -16,6 +16,19 @@ use Illuminate\Database\Eloquent\SoftDeletes; /** * Class BankSubaccount. + * + * @property-read \App\Models\BankAccount|null $bank_account + * @property-read mixed $hashed_id + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel company() + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel exclude($columns) + * @method static \Illuminate\Database\Eloquent\Builder|BankSubaccount newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|BankSubaccount newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|BankSubaccount onlyTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|BankSubaccount query() + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope() + * @method static \Illuminate\Database\Eloquent\Builder|BankSubaccount withTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|BankSubaccount withoutTrashed() + * @mixin \Eloquent */ class BankSubaccount extends BaseModel { diff --git a/app/Models/BankTransaction.php b/app/Models/BankTransaction.php index 0cf098a6f866..b38ca5f52f46 100644 --- a/app/Models/BankTransaction.php +++ b/app/Models/BankTransaction.php @@ -15,6 +15,80 @@ use App\Services\Bank\BankService; use App\Utils\Traits\MakesHash; use Illuminate\Database\Eloquent\SoftDeletes; +/** + * App\Models\BankTransaction + * + * @property int $id + * @property int $company_id + * @property int $user_id + * @property int $bank_integration_id + * @property int $transaction_id + * @property string $amount + * @property string|null $currency_code + * @property int|null $currency_id + * @property string|null $account_type + * @property int|null $category_id + * @property int|null $ninja_category_id + * @property string $category_type + * @property string $base_type + * @property string|null $date + * @property int $bank_account_id + * @property string|null $description + * @property string $invoice_ids + * @property int|null $expense_id + * @property int|null $vendor_id + * @property int $status_id + * @property int $is_deleted + * @property int|null $created_at + * @property int|null $updated_at + * @property int|null $deleted_at + * @property int|null $bank_transaction_rule_id + * @property int|null $payment_id + * @property-read \App\Models\BankIntegration $bank_integration + * @property-read \App\Models\Company $company + * @property-read \App\Models\Expense|null $expense + * @property-read mixed $hashed_id + * @property-read \App\Models\User $user + * @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\BankTransactionFactory factory($count = null, $state = []) + * @method static \Illuminate\Database\Eloquent\Builder|BankTransaction filter(\App\Filters\QueryFilters $filters) + * @method static \Illuminate\Database\Eloquent\Builder|BankTransaction newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|BankTransaction newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|BankTransaction onlyTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|BankTransaction query() + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope() + * @method static \Illuminate\Database\Eloquent\Builder|BankTransaction whereAccountType($value) + * @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() + * @mixin \Eloquent + */ class BankTransaction extends BaseModel { use SoftDeletes; diff --git a/app/Models/BankTransactionRule.php b/app/Models/BankTransactionRule.php index 817e4495cefd..78fe94fe5026 100644 --- a/app/Models/BankTransactionRule.php +++ b/app/Models/BankTransactionRule.php @@ -13,6 +13,58 @@ namespace App\Models; use Illuminate\Database\Eloquent\SoftDeletes; +/** + * App\Models\BankTransactionRule + * + * @property int $id + * @property int $company_id + * @property int $user_id + * @property string $name + * @property array|null $rules + * @property int $auto_convert + * @property int $matches_on_all + * @property string $applies_to + * @property int|null $client_id + * @property int|null $vendor_id + * @property int|null $category_id + * @property int $is_deleted + * @property int|null $created_at + * @property int|null $updated_at + * @property int|null $deleted_at + * @property-read \App\Models\Client|null $client + * @property-read \App\Models\Company $company + * @property-read \App\Models\ExpenseCategory|null $expense_category + * @property-read mixed $hashed_id + * @property-read \App\Models\User $user + * @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\BankTransactionRuleFactory factory($count = null, $state = []) + * @method static \Illuminate\Database\Eloquent\Builder|BankTransactionRule filter(\App\Filters\QueryFilters $filters) + * @method static \Illuminate\Database\Eloquent\Builder|BankTransactionRule newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|BankTransactionRule newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|BankTransactionRule onlyTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|BankTransactionRule query() + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope() + * @method static \Illuminate\Database\Eloquent\Builder|BankTransactionRule whereAppliesTo($value) + * @method static \Illuminate\Database\Eloquent\Builder|BankTransactionRule whereAutoConvert($value) + * @method static \Illuminate\Database\Eloquent\Builder|BankTransactionRule whereCategoryId($value) + * @method static \Illuminate\Database\Eloquent\Builder|BankTransactionRule whereClientId($value) + * @method static \Illuminate\Database\Eloquent\Builder|BankTransactionRule whereCompanyId($value) + * @method static \Illuminate\Database\Eloquent\Builder|BankTransactionRule whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|BankTransactionRule whereDeletedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|BankTransactionRule whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|BankTransactionRule whereIsDeleted($value) + * @method static \Illuminate\Database\Eloquent\Builder|BankTransactionRule whereMatchesOnAll($value) + * @method static \Illuminate\Database\Eloquent\Builder|BankTransactionRule whereName($value) + * @method static \Illuminate\Database\Eloquent\Builder|BankTransactionRule whereRules($value) + * @method static \Illuminate\Database\Eloquent\Builder|BankTransactionRule whereUpdatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|BankTransactionRule whereUserId($value) + * @method static \Illuminate\Database\Eloquent\Builder|BankTransactionRule whereVendorId($value) + * @method static \Illuminate\Database\Eloquent\Builder|BankTransactionRule withTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|BankTransactionRule withoutTrashed() + * @mixin \Eloquent + */ class BankTransactionRule extends BaseModel { use SoftDeletes; diff --git a/app/Models/BaseModel.php b/app/Models/BaseModel.php index db9e5e9d7f1a..4f618cfb431f 100644 --- a/app/Models/BaseModel.php +++ b/app/Models/BaseModel.php @@ -26,8 +26,14 @@ use Illuminate\Support\Str; * Class BaseModel * * @method scope() static - * * @package App\Models + * @property-read mixed $hashed_id + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel company() + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel exclude($columns) + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel query() + * @mixin \Eloquent */ class BaseModel extends Model { diff --git a/app/Models/Client.php b/app/Models/Client.php index f83d4fe0f24c..b31965025f91 100644 --- a/app/Models/Client.php +++ b/app/Models/Client.php @@ -27,6 +27,147 @@ use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Support\Facades\Cache; use Laracasts\Presenter\PresentableTrait; +/** + * App\Models\Client + * + * @property int $id + * @property int $company_id + * @property int $user_id + * @property int|null $assigned_user_id + * @property string|null $name + * @property string|null $website + * @property string|null $private_notes + * @property string|null $public_notes + * @property string|null $client_hash + * @property string|null $logo + * @property string|null $phone + * @property string $balance + * @property string $paid_to_date + * @property string $credit_balance + * @property int|null $last_login + * @property int|null $industry_id + * @property int|null $size_id + * @property string|null $address1 + * @property string|null $address2 + * @property string|null $city + * @property string|null $state + * @property string|null $postal_code + * @property string|null $country_id + * @property string|null $custom_value1 + * @property string|null $custom_value2 + * @property string|null $custom_value3 + * @property string|null $custom_value4 + * @property string|null $shipping_address1 + * @property string|null $shipping_address2 + * @property string|null $shipping_city + * @property string|null $shipping_state + * @property string|null $shipping_postal_code + * @property int|null $shipping_country_id + * @property object|null $settings + * @property bool $is_deleted + * @property int|null $group_settings_id + * @property string|null $vat_number + * @property string|null $number + * @property int|null $created_at + * @property int|null $updated_at + * @property int|null $deleted_at + * @property string|null $id_number + * @property-read \Illuminate\Database\Eloquent\Collection $activities + * @property-read int|null $activities_count + * @property-read \App\Models\User|null $assigned_user + * @property-read \App\Models\Company $company + * @property-read \Illuminate\Database\Eloquent\Collection $company_ledger + * @property-read int|null $company_ledger_count + * @property-read \Illuminate\Database\Eloquent\Collection $contacts + * @property-read int|null $contacts_count + * @property-read \App\Models\Country|null $country + * @property-read \Illuminate\Database\Eloquent\Collection $credits + * @property-read int|null $credits_count + * @property-read \Illuminate\Database\Eloquent\Collection $documents + * @property-read int|null $documents_count + * @property-read \Illuminate\Database\Eloquent\Collection $expenses + * @property-read int|null $expenses_count + * @property-read \Illuminate\Database\Eloquent\Collection $gateway_tokens + * @property-read int|null $gateway_tokens_count + * @property-read mixed $hashed_id + * @property-read \App\Models\GroupSetting|null $group_settings + * @property-read \Illuminate\Database\Eloquent\Collection $invoices + * @property-read int|null $invoices_count + * @property-read \Illuminate\Database\Eloquent\Collection $ledger + * @property-read int|null $ledger_count + * @property-read \Illuminate\Database\Eloquent\Collection $payments + * @property-read int|null $payments_count + * @property-read \Illuminate\Database\Eloquent\Collection $primary_contact + * @property-read int|null $primary_contact_count + * @property-read \Illuminate\Database\Eloquent\Collection $projects + * @property-read int|null $projects_count + * @property-read \Illuminate\Database\Eloquent\Collection $quotes + * @property-read int|null $quotes_count + * @property-read \Illuminate\Database\Eloquent\Collection $recurring_expenses + * @property-read int|null $recurring_expenses_count + * @property-read \Illuminate\Database\Eloquent\Collection $recurring_invoices + * @property-read int|null $recurring_invoices_count + * @property-read \App\Models\Country|null $shipping_country + * @property-read \Illuminate\Database\Eloquent\Collection $system_logs + * @property-read int|null $system_logs_count + * @property-read \Illuminate\Database\Eloquent\Collection $tasks + * @property-read int|null $tasks_count + * @property-read \App\Models\User $user + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel company() + * @method static \Illuminate\Database\Eloquent\Builder|Client exclude($columns) + * @method static \Database\Factories\ClientFactory factory($count = null, $state = []) + * @method static \Illuminate\Database\Eloquent\Builder|Client filter(\App\Filters\QueryFilters $filters) + * @method static \Illuminate\Database\Eloquent\Builder|Client newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Client newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Client onlyTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|Client query() + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope() + * @method static \Illuminate\Database\Eloquent\Builder|Client whereAddress1($value) + * @method static \Illuminate\Database\Eloquent\Builder|Client whereAddress2($value) + * @method static \Illuminate\Database\Eloquent\Builder|Client whereAssignedUserId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Client whereBalance($value) + * @method static \Illuminate\Database\Eloquent\Builder|Client whereCity($value) + * @method static \Illuminate\Database\Eloquent\Builder|Client whereClientHash($value) + * @method static \Illuminate\Database\Eloquent\Builder|Client whereCompanyId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Client whereCountryId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Client whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Client whereCreditBalance($value) + * @method static \Illuminate\Database\Eloquent\Builder|Client whereCustomValue1($value) + * @method static \Illuminate\Database\Eloquent\Builder|Client whereCustomValue2($value) + * @method static \Illuminate\Database\Eloquent\Builder|Client whereCustomValue3($value) + * @method static \Illuminate\Database\Eloquent\Builder|Client whereCustomValue4($value) + * @method static \Illuminate\Database\Eloquent\Builder|Client whereDeletedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Client whereGroupSettingsId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Client whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Client whereIdNumber($value) + * @method static \Illuminate\Database\Eloquent\Builder|Client whereIndustryId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Client whereIsDeleted($value) + * @method static \Illuminate\Database\Eloquent\Builder|Client whereLastLogin($value) + * @method static \Illuminate\Database\Eloquent\Builder|Client whereLogo($value) + * @method static \Illuminate\Database\Eloquent\Builder|Client whereName($value) + * @method static \Illuminate\Database\Eloquent\Builder|Client whereNumber($value) + * @method static \Illuminate\Database\Eloquent\Builder|Client wherePaidToDate($value) + * @method static \Illuminate\Database\Eloquent\Builder|Client wherePhone($value) + * @method static \Illuminate\Database\Eloquent\Builder|Client wherePostalCode($value) + * @method static \Illuminate\Database\Eloquent\Builder|Client wherePrivateNotes($value) + * @method static \Illuminate\Database\Eloquent\Builder|Client wherePublicNotes($value) + * @method static \Illuminate\Database\Eloquent\Builder|Client whereSettings($value) + * @method static \Illuminate\Database\Eloquent\Builder|Client whereShippingAddress1($value) + * @method static \Illuminate\Database\Eloquent\Builder|Client whereShippingAddress2($value) + * @method static \Illuminate\Database\Eloquent\Builder|Client whereShippingCity($value) + * @method static \Illuminate\Database\Eloquent\Builder|Client whereShippingCountryId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Client whereShippingPostalCode($value) + * @method static \Illuminate\Database\Eloquent\Builder|Client whereShippingState($value) + * @method static \Illuminate\Database\Eloquent\Builder|Client whereSizeId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Client whereState($value) + * @method static \Illuminate\Database\Eloquent\Builder|Client whereUpdatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Client whereUserId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Client whereVatNumber($value) + * @method static \Illuminate\Database\Eloquent\Builder|Client whereWebsite($value) + * @method static \Illuminate\Database\Eloquent\Builder|Client withTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|Client withoutTrashed() + * @mixin \Eloquent + */ class Client extends BaseModel implements HasLocalePreference { use PresentableTrait; diff --git a/app/Models/ClientContact.php b/app/Models/ClientContact.php index a4f6320f4856..c473116f80f3 100644 --- a/app/Models/ClientContact.php +++ b/app/Models/ClientContact.php @@ -32,6 +32,98 @@ use Laracasts\Presenter\PresentableTrait; * Class ClientContact * * @method scope() static + * @property int $id + * @property int $company_id + * @property int $client_id + * @property int $user_id + * @property string|null $first_name + * @property string|null $last_name + * @property string|null $phone + * @property string|null $custom_value1 + * @property string|null $custom_value2 + * @property string|null $custom_value3 + * @property string|null $custom_value4 + * @property string|null $email + * @property string|null $email_verified_at + * @property string|null $confirmation_code + * @property int $is_primary + * @property int $confirmed + * @property int|null $last_login + * @property int|null $failed_logins + * @property string|null $oauth_user_id + * @property int|null $oauth_provider_id + * @property string|null $google_2fa_secret + * @property string|null $accepted_terms_version + * @property string|null $avatar + * @property string|null $avatar_type + * @property string|null $avatar_size + * @property string $password + * @property string|null $token + * @property int $is_locked + * @property int $send_email + * @property string|null $contact_key + * @property string|null $remember_token + * @property int|null $created_at + * @property int|null $updated_at + * @property int|null $deleted_at + * @property-read \App\Models\Client $client + * @property-read \App\Models\Company $company + * @property-read \Illuminate\Database\Eloquent\Collection $credit_invitations + * @property-read int|null $credit_invitations_count + * @property-read mixed $contact_id + * @property-read mixed $hashed_id + * @property-read \Illuminate\Database\Eloquent\Collection $invoice_invitations + * @property-read int|null $invoice_invitations_count + * @property-read \Illuminate\Notifications\DatabaseNotificationCollection $notifications + * @property-read int|null $notifications_count + * @property-read \Illuminate\Database\Eloquent\Collection $quote_invitations + * @property-read int|null $quote_invitations_count + * @property-read \Illuminate\Database\Eloquent\Collection $recurring_invoice_invitations + * @property-read int|null $recurring_invoice_invitations_count + * @property-read \App\Models\User $user + * @method static \Illuminate\Database\Eloquent\Builder|ClientContact company() + * @method static \Database\Factories\ClientContactFactory factory($count = null, $state = []) + * @method static \Illuminate\Database\Eloquent\Builder|ClientContact newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|ClientContact newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|ClientContact onlyTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|ClientContact query() + * @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereAcceptedTermsVersion($value) + * @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereAvatar($value) + * @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereAvatarSize($value) + * @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereAvatarType($value) + * @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereClientId($value) + * @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereCompanyId($value) + * @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereConfirmationCode($value) + * @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereConfirmed($value) + * @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereContactKey($value) + * @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereCustomValue1($value) + * @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereCustomValue2($value) + * @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereCustomValue3($value) + * @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereCustomValue4($value) + * @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereDeletedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereEmail($value) + * @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereEmailVerifiedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereFailedLogins($value) + * @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereFirstName($value) + * @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereGoogle2faSecret($value) + * @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereIsLocked($value) + * @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereIsPrimary($value) + * @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereLastLogin($value) + * @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereLastName($value) + * @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereOauthProviderId($value) + * @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereOauthUserId($value) + * @method static \Illuminate\Database\Eloquent\Builder|ClientContact wherePassword($value) + * @method static \Illuminate\Database\Eloquent\Builder|ClientContact wherePhone($value) + * @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereRememberToken($value) + * @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereSendEmail($value) + * @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereToken($value) + * @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereUpdatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|ClientContact whereUserId($value) + * @method static \Illuminate\Database\Eloquent\Builder|ClientContact withTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|ClientContact withoutTrashed() + * @mixin \Eloquent */ class ClientContact extends Authenticatable implements HasLocalePreference { diff --git a/app/Models/ClientGatewayToken.php b/app/Models/ClientGatewayToken.php index 8b41d65508a8..cf5c6d324759 100644 --- a/app/Models/ClientGatewayToken.php +++ b/app/Models/ClientGatewayToken.php @@ -14,6 +14,54 @@ namespace App\Models; use App\Utils\Traits\MakesDates; use Illuminate\Database\Eloquent\SoftDeletes; +/** + * App\Models\ClientGatewayToken + * + * @property int $id + * @property int $company_id + * @property int|null $client_id + * @property string|null $token + * @property string|null $routing_number + * @property int $company_gateway_id + * @property string|null $gateway_customer_reference + * @property int $gateway_type_id + * @property int $is_default + * @property object|null $meta + * @property int|null $deleted_at + * @property int|null $created_at + * @property int|null $updated_at + * @property int $is_deleted + * @property-read \App\Models\Client|null $client + * @property-read \App\Models\Company $company + * @property-read \App\Models\CompanyGateway|null $gateway + * @property-read \App\Models\GatewayType|null $gateway_type + * @property-read mixed $hashed_id + * @property-read \App\Models\User $user + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel company() + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel exclude($columns) + * @method static \Illuminate\Database\Eloquent\Builder|ClientGatewayToken newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|ClientGatewayToken newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|ClientGatewayToken onlyTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|ClientGatewayToken query() + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope() + * @method static \Illuminate\Database\Eloquent\Builder|ClientGatewayToken whereClientId($value) + * @method static \Illuminate\Database\Eloquent\Builder|ClientGatewayToken whereCompanyGatewayId($value) + * @method static \Illuminate\Database\Eloquent\Builder|ClientGatewayToken whereCompanyId($value) + * @method static \Illuminate\Database\Eloquent\Builder|ClientGatewayToken whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|ClientGatewayToken whereDeletedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|ClientGatewayToken whereGatewayCustomerReference($value) + * @method static \Illuminate\Database\Eloquent\Builder|ClientGatewayToken whereGatewayTypeId($value) + * @method static \Illuminate\Database\Eloquent\Builder|ClientGatewayToken whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|ClientGatewayToken whereIsDefault($value) + * @method static \Illuminate\Database\Eloquent\Builder|ClientGatewayToken whereIsDeleted($value) + * @method static \Illuminate\Database\Eloquent\Builder|ClientGatewayToken whereMeta($value) + * @method static \Illuminate\Database\Eloquent\Builder|ClientGatewayToken whereRoutingNumber($value) + * @method static \Illuminate\Database\Eloquent\Builder|ClientGatewayToken whereToken($value) + * @method static \Illuminate\Database\Eloquent\Builder|ClientGatewayToken whereUpdatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|ClientGatewayToken withTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|ClientGatewayToken withoutTrashed() + * @mixin \Eloquent + */ class ClientGatewayToken extends BaseModel { use MakesDates; diff --git a/app/Models/Company.php b/app/Models/Company.php index ccb8514a6592..49531af286ce 100644 --- a/app/Models/Company.php +++ b/app/Models/Company.php @@ -25,6 +25,265 @@ use Illuminate\Notifications\Notification; use Illuminate\Support\Facades\Cache; use Laracasts\Presenter\PresentableTrait; +/** + * App\Models\Company + * + * @property int $id + * @property int $account_id + * @property int|null $industry_id + * @property string|null $ip + * @property string $company_key + * @property int $convert_products + * @property int $fill_products + * @property int $update_products + * @property int $show_product_details + * @property int $client_can_register + * @property int $custom_surcharge_taxes1 + * @property int $custom_surcharge_taxes2 + * @property int $custom_surcharge_taxes3 + * @property int $custom_surcharge_taxes4 + * @property int $show_product_cost + * @property int $enabled_tax_rates + * @property int $enabled_modules + * @property int $enable_product_cost + * @property int $enable_product_quantity + * @property int $default_quantity + * @property string|null $subdomain + * @property string|null $db + * @property int|null $size_id + * @property string|null $first_day_of_week + * @property string|null $first_month_of_year + * @property string $portal_mode + * @property string|null $portal_domain + * @property int $enable_modules + * @property object $custom_fields + * @property object $settings + * @property string $slack_webhook_url + * @property string $google_analytics_key + * @property int|null $created_at + * @property int|null $updated_at + * @property int $enabled_item_tax_rates + * @property int $is_large + * @property int $enable_shop_api + * @property string $default_auto_bill + * @property int $mark_expenses_invoiceable + * @property int $mark_expenses_paid + * @property int $invoice_expense_documents + * @property int $auto_start_tasks + * @property int $invoice_task_timelog + * @property int $invoice_task_documents + * @property int $show_tasks_table + * @property int $is_disabled + * @property int $default_task_is_date_based + * @property int $enable_product_discount + * @property int $calculate_expense_tax_by_amount + * @property int $expense_inclusive_taxes + * @property int $session_timeout + * @property int $oauth_password_required + * @property int $invoice_task_datelog + * @property int $default_password_timeout + * @property int $show_task_end_date + * @property int $markdown_enabled + * @property int $use_comma_as_decimal_place + * @property int $report_include_drafts + * @property array|null $client_registration_fields + * @property int $convert_rate_to_client + * @property int $markdown_email_enabled + * @property int $stop_on_unpaid_recurring + * @property int $use_quote_terms_on_conversion + * @property int $enable_applying_payments + * @property int $track_inventory + * @property int $inventory_notification_threshold + * @property int $stock_notification + * @property string|null $matomo_url + * @property int|null $matomo_id + * @property int $enabled_expense_tax_rates + * @property int $invoice_task_project + * @property int $report_include_deleted + * @property int $invoice_task_lock + * @property int $convert_payment_currency + * @property int $convert_expense_currency + * @property int $notify_vendor_when_paid + * @property int $invoice_task_hours + * @property-read \App\Models\Account $account + * @property-read \Illuminate\Database\Eloquent\Collection $activities + * @property-read int|null $activities_count + * @property-read \Illuminate\Database\Eloquent\Collection $all_activities + * @property-read int|null $all_activities_count + * @property-read \Illuminate\Database\Eloquent\Collection $all_documents + * @property-read int|null $all_documents_count + * @property-read \Illuminate\Database\Eloquent\Collection $bank_integrations + * @property-read int|null $bank_integrations_count + * @property-read \Illuminate\Database\Eloquent\Collection $bank_transaction_rules + * @property-read int|null $bank_transaction_rules_count + * @property-read \Illuminate\Database\Eloquent\Collection $bank_transactions + * @property-read int|null $bank_transactions_count + * @property-read \Illuminate\Database\Eloquent\Collection $client_contacts + * @property-read int|null $client_contacts_count + * @property-read \Illuminate\Database\Eloquent\Collection $client_gateway_tokens + * @property-read int|null $client_gateway_tokens_count + * @property-read \Illuminate\Database\Eloquent\Collection $clients + * @property-read int|null $clients_count + * @property-read \Illuminate\Database\Eloquent\Collection $company_gateways + * @property-read int|null $company_gateways_count + * @property-read \Illuminate\Database\Eloquent\Collection $company_users + * @property-read int|null $company_users_count + * @property-read \Illuminate\Database\Eloquent\Collection $contacts + * @property-read int|null $contacts_count + * @property-read \Illuminate\Database\Eloquent\Collection $credits + * @property-read int|null $credits_count + * @property-read \Illuminate\Database\Eloquent\Collection $designs + * @property-read int|null $designs_count + * @property-read \Illuminate\Database\Eloquent\Collection $documents + * @property-read int|null $documents_count + * @property-read \Illuminate\Database\Eloquent\Collection $expense_categories + * @property-read int|null $expense_categories_count + * @property-read \Illuminate\Database\Eloquent\Collection $expenses + * @property-read int|null $expenses_count + * @property-read mixed $company_id + * @property-read mixed $hashed_id + * @property-read \Illuminate\Database\Eloquent\Collection $group_settings + * @property-read int|null $group_settings_count + * @property-read \Illuminate\Database\Eloquent\Collection $groups + * @property-read int|null $groups_count + * @property-read \App\Models\Industry|null $industry + * @property-read \Illuminate\Database\Eloquent\Collection $invoices + * @property-read int|null $invoices_count + * @property-read \Illuminate\Database\Eloquent\Collection $ledger + * @property-read int|null $ledger_count + * @property-read \Illuminate\Database\Eloquent\Collection $payment_terms + * @property-read int|null $payment_terms_count + * @property-read \App\Models\PaymentType|null $payment_type + * @property-read \Illuminate\Database\Eloquent\Collection $payments + * @property-read int|null $payments_count + * @property-read \Illuminate\Database\Eloquent\Collection $products + * @property-read int|null $products_count + * @property-read \Illuminate\Database\Eloquent\Collection $projects + * @property-read int|null $projects_count + * @property-read \Illuminate\Database\Eloquent\Collection $purchase_orders + * @property-read int|null $purchase_orders_count + * @property-read \Illuminate\Database\Eloquent\Collection $quotes + * @property-read int|null $quotes_count + * @property-read \Illuminate\Database\Eloquent\Collection $recurring_expenses + * @property-read int|null $recurring_expenses_count + * @property-read \Illuminate\Database\Eloquent\Collection $recurring_invoices + * @property-read int|null $recurring_invoices_count + * @property-read \Illuminate\Database\Eloquent\Collection $schedulers + * @property-read int|null $schedulers_count + * @property-read \Illuminate\Database\Eloquent\Collection $subscriptions + * @property-read int|null $subscriptions_count + * @property-read \Illuminate\Database\Eloquent\Collection $system_log_relation + * @property-read int|null $system_log_relation_count + * @property-read \Illuminate\Database\Eloquent\Collection $system_logs + * @property-read int|null $system_logs_count + * @property-read \Illuminate\Database\Eloquent\Collection $task_schedulers + * @property-read int|null $task_schedulers_count + * @property-read \Illuminate\Database\Eloquent\Collection $task_statuses + * @property-read int|null $task_statuses_count + * @property-read \Illuminate\Database\Eloquent\Collection $tasks + * @property-read int|null $tasks_count + * @property-read \Illuminate\Database\Eloquent\Collection $tax_rates + * @property-read int|null $tax_rates_count + * @property-read \Illuminate\Database\Eloquent\Collection $tokens + * @property-read int|null $tokens_count + * @property-read \Illuminate\Database\Eloquent\Collection $tokens_hashed + * @property-read int|null $tokens_hashed_count + * @property-read \Illuminate\Database\Eloquent\Collection $user_designs + * @property-read int|null $user_designs_count + * @property-read \Illuminate\Database\Eloquent\Collection $user_payment_terms + * @property-read int|null $user_payment_terms_count + * @property-read \Illuminate\Database\Eloquent\Collection $users + * @property-read int|null $users_count + * @property-read \Illuminate\Database\Eloquent\Collection $vendors + * @property-read int|null $vendors_count + * @property-read \Illuminate\Database\Eloquent\Collection $webhooks + * @property-read int|null $webhooks_count + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel company() + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel exclude($columns) + * @method static \Database\Factories\CompanyFactory factory($count = null, $state = []) + * @method static \Illuminate\Database\Eloquent\Builder|Company newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Company newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Company query() + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope() + * @method static \Illuminate\Database\Eloquent\Builder|Company whereAccountId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereAutoStartTasks($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereCalculateExpenseTaxByAmount($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereClientCanRegister($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereClientRegistrationFields($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereCompanyKey($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereConvertExpenseCurrency($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereConvertPaymentCurrency($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereConvertProducts($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereConvertRateToClient($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereCustomFields($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereCustomSurchargeTaxes1($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereCustomSurchargeTaxes2($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereCustomSurchargeTaxes3($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereCustomSurchargeTaxes4($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereDb($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereDefaultAutoBill($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereDefaultPasswordTimeout($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereDefaultQuantity($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereDefaultTaskIsDateBased($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereEnableApplyingPayments($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereEnableModules($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereEnableProductCost($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereEnableProductDiscount($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereEnableProductQuantity($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereEnableShopApi($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereEnabledExpenseTaxRates($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereEnabledItemTaxRates($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereEnabledModules($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereEnabledTaxRates($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereExpenseInclusiveTaxes($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereFillProducts($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereFirstDayOfWeek($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereFirstMonthOfYear($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereGoogleAnalyticsKey($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereIndustryId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereInventoryNotificationThreshold($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereInvoiceExpenseDocuments($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereInvoiceTaskDatelog($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereInvoiceTaskDocuments($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereInvoiceTaskHours($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereInvoiceTaskLock($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereInvoiceTaskProject($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereInvoiceTaskTimelog($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereIp($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereIsDisabled($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereIsLarge($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereMarkExpensesInvoiceable($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereMarkExpensesPaid($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereMarkdownEmailEnabled($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereMarkdownEnabled($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereMatomoId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereMatomoUrl($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereNotifyVendorWhenPaid($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereOauthPasswordRequired($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company wherePortalDomain($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company wherePortalMode($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereReportIncludeDeleted($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereReportIncludeDrafts($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereSessionTimeout($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereSettings($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereShowProductCost($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereShowProductDetails($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereShowTaskEndDate($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereShowTasksTable($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereSizeId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereSlackWebhookUrl($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereStockNotification($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereStopOnUnpaidRecurring($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereSubdomain($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereTrackInventory($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereUpdateProducts($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereUpdatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereUseCommaAsDecimalPlace($value) + * @method static \Illuminate\Database\Eloquent\Builder|Company whereUseQuoteTermsOnConversion($value) + * @mixin \Eloquent + */ class Company extends BaseModel { use PresentableTrait; @@ -151,6 +410,7 @@ class Company extends BaseModel self::ENTITY_RECURRING_INVOICE => 1, self::ENTITY_CREDIT => 2, self::ENTITY_QUOTE => 4, + // @phpstan-ignore-next-line self::ENTITY_TASK => 8, self::ENTITY_EXPENSE => 16, self::ENTITY_PROJECT => 32, @@ -368,9 +628,6 @@ class Company extends BaseModel return $this->hasMany(Product::class)->withTrashed(); } - /** - * @return BelongsTo - */ public function country() { $companies = Cache::get('countries'); @@ -429,9 +686,6 @@ class Company extends BaseModel return $this->hasMany(PaymentTerm::class); } - /** - * @return BelongsTo - */ public function language() { $languages = Cache::get('languages'); diff --git a/app/Models/CompanyGateway.php b/app/Models/CompanyGateway.php index d93615ec4bce..edaaa02e0968 100644 --- a/app/Models/CompanyGateway.php +++ b/app/Models/CompanyGateway.php @@ -14,6 +14,86 @@ namespace App\Models; use App\Utils\Number; use Illuminate\Database\Eloquent\SoftDeletes; +/** + * App\Models\CompanyGateway + * + * @property int $id + * @property int $company_id + * @property int $user_id + * @property string $gateway_key + * @property int $accepted_credit_cards + * @property int $require_cvv + * @property int|null $require_billing_address + * @property int|null $require_shipping_address + * @property int|null $update_details + * @property int $is_deleted + * @property string $config + * @property object $fees_and_limits + * @property string|null $custom_value1 + * @property string|null $custom_value2 + * @property string|null $custom_value3 + * @property string|null $custom_value4 + * @property int|null $created_at + * @property int|null $updated_at + * @property int|null $deleted_at + * @property string $token_billing + * @property string|null $label + * @property int $require_client_name + * @property int $require_postal_code + * @property int $require_client_phone + * @property int $require_contact_name + * @property int $require_contact_email + * @property int $require_custom_value1 + * @property int $require_custom_value2 + * @property int $require_custom_value3 + * @property int $require_custom_value4 + * @property-read \Illuminate\Database\Eloquent\Collection $client_gateway_tokens + * @property-read int|null $client_gateway_tokens_count + * @property-read \App\Models\Company $company + * @property-read \App\Models\Gateway $gateway + * @property-read mixed $hashed_id + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel company() + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel exclude($columns) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway filter(\App\Filters\QueryFilters $filters) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway onlyTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway query() + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope() + * @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereAcceptedCreditCards($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereCompanyId($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereConfig($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereCustomValue1($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereCustomValue2($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereCustomValue3($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereCustomValue4($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereDeletedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereFeesAndLimits($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereGatewayKey($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereIsDeleted($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereLabel($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereRequireBillingAddress($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereRequireClientName($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereRequireClientPhone($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereRequireContactEmail($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereRequireContactName($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereRequireCustomValue1($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereRequireCustomValue2($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereRequireCustomValue3($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereRequireCustomValue4($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereRequireCvv($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereRequirePostalCode($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereRequireShippingAddress($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereTokenBilling($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereUpdateDetails($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereUpdatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway whereUserId($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway withTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|CompanyGateway withoutTrashed() + * @mixin \Eloquent + */ class CompanyGateway extends BaseModel { use SoftDeletes; diff --git a/app/Models/CompanyLedger.php b/app/Models/CompanyLedger.php index 0d37bd3bfab6..5b624e4a7903 100644 --- a/app/Models/CompanyLedger.php +++ b/app/Models/CompanyLedger.php @@ -13,6 +13,44 @@ namespace App\Models; use Illuminate\Database\Eloquent\Model; +/** + * App\Models\CompanyLedger + * + * @property int $id + * @property int $company_id + * @property int|null $client_id + * @property int|null $user_id + * @property int|null $activity_id + * @property string|null $adjustment + * @property string|null $balance + * @property string|null $notes + * @property string|null $hash + * @property int $company_ledgerable_id + * @property string $company_ledgerable_type + * @property int|null $created_at + * @property int|null $updated_at + * @property-read \App\Models\Client|null $client + * @property-read \App\Models\Company $company + * @property-read Model|\Eloquent $company_ledgerable + * @property-read \App\Models\User|null $user + * @method static \Illuminate\Database\Eloquent\Builder|CompanyLedger newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|CompanyLedger newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|CompanyLedger query() + * @method static \Illuminate\Database\Eloquent\Builder|CompanyLedger whereActivityId($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyLedger whereAdjustment($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyLedger whereBalance($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyLedger whereClientId($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyLedger whereCompanyId($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyLedger whereCompanyLedgerableId($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyLedger whereCompanyLedgerableType($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyLedger whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyLedger whereHash($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyLedger whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyLedger whereNotes($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyLedger whereUpdatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyLedger whereUserId($value) + * @mixin \Eloquent + */ class CompanyLedger extends Model { protected $dateFormat = 'Y-m-d H:i:s.u'; diff --git a/app/Models/CompanyToken.php b/app/Models/CompanyToken.php index 3371bcfc4a43..545758f058a7 100644 --- a/app/Models/CompanyToken.php +++ b/app/Models/CompanyToken.php @@ -13,6 +13,49 @@ namespace App\Models; use Illuminate\Database\Eloquent\SoftDeletes; +/** + * App\Models\CompanyToken + * + * @property int $id + * @property int $company_id + * @property int $account_id + * @property int $user_id + * @property string|null $token + * @property string|null $name + * @property int|null $created_at + * @property int|null $updated_at + * @property int|null $deleted_at + * @property int $is_deleted + * @property int $is_system + * @property-read \App\Models\Account $account + * @property-read \App\Models\Company $company + * @property-read \App\Models\CompanyUser|null $company_user + * @property-read \App\Models\CompanyUser|null $cu + * @property-read mixed $hashed_id + * @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|CompanyToken filter(\App\Filters\QueryFilters $filters) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyToken newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|CompanyToken newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|CompanyToken onlyTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|CompanyToken query() + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope() + * @method static \Illuminate\Database\Eloquent\Builder|CompanyToken whereAccountId($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyToken whereCompanyId($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyToken whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyToken whereDeletedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyToken whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyToken whereIsDeleted($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyToken whereIsSystem($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyToken whereName($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyToken whereToken($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyToken whereUpdatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyToken whereUserId($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyToken withTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|CompanyToken withoutTrashed() + * @mixin \Eloquent + */ class CompanyToken extends BaseModel { use SoftDeletes; diff --git a/app/Models/CompanyUser.php b/app/Models/CompanyUser.php index 24e4935a705a..0a18f541245d 100644 --- a/app/Models/CompanyUser.php +++ b/app/Models/CompanyUser.php @@ -14,6 +14,61 @@ namespace App\Models; use Illuminate\Database\Eloquent\Relations\Pivot; use Illuminate\Database\Eloquent\SoftDeletes; +/** + * App\Models\CompanyUser + * + * @property int $id + * @property int $company_id + * @property int $account_id + * @property int $user_id + * @property string|null $permissions + * @property object|null $notifications + * @property object|null $settings + * @property string $slack_webhook_url + * @property int $is_owner + * @property int $is_admin + * @property int $is_locked + * @property int|null $deleted_at + * @property int|null $created_at + * @property int|null $updated_at + * @property int $permissions_updated_at + * @property string $ninja_portal_url + * @property string|null $react_settings + * @property-read \App\Models\Account $account + * @property-read \App\Models\Company $company + * @property-read \Illuminate\Database\Eloquent\Collection $token + * @property-read int|null $token_count + * @property-read \Illuminate\Database\Eloquent\Collection $tokens + * @property-read int|null $tokens_count + * @property-read \App\Models\User $user + * @property-read \Illuminate\Database\Eloquent\Collection $users + * @property-read int|null $users_count + * @method static \Illuminate\Database\Eloquent\Builder|CompanyUser authCompany() + * @method static \Illuminate\Database\Eloquent\Builder|CompanyUser newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|CompanyUser newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|CompanyUser onlyTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|CompanyUser query() + * @method static \Illuminate\Database\Eloquent\Builder|CompanyUser whereAccountId($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyUser whereCompanyId($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyUser whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyUser whereDeletedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyUser whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyUser whereIsAdmin($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyUser whereIsLocked($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyUser whereIsOwner($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyUser whereNinjaPortalUrl($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyUser whereNotifications($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyUser wherePermissions($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyUser wherePermissionsUpdatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyUser whereReactSettings($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyUser whereSettings($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyUser whereSlackWebhookUrl($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyUser whereUpdatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyUser whereUserId($value) + * @method static \Illuminate\Database\Eloquent\Builder|CompanyUser withTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|CompanyUser withoutTrashed() + * @mixin \Eloquent + */ class CompanyUser extends Pivot { use SoftDeletes; @@ -74,7 +129,7 @@ class CompanyUser extends Pivot { return $this->hasOne(User::class)->withPivot('permissions', 'settings', 'react_settings', 'is_admin', 'is_owner', 'is_locked', 'slack_webhook_url', 'migrating'); } - + public function company_pivot() { return $this->hasOne(Company::class)->withPivot('permissions', 'settings', 'react_settings', 'is_admin', 'is_owner', 'is_locked', 'slack_webhook_url', 'migrating'); diff --git a/app/Models/Country.php b/app/Models/Country.php index 7e6c467b7098..97efa4375f6e 100644 --- a/app/Models/Country.php +++ b/app/Models/Country.php @@ -11,6 +11,52 @@ namespace App\Models; +/** + * App\Models\Country + * + * @property int $id + * @property string|null $capital + * @property string|null $citizenship + * @property string|null $country_code + * @property string|null $currency + * @property string|null $currency_code + * @property string|null $currency_sub_unit + * @property string|null $full_name + * @property string|null $iso_3166_2 + * @property string|null $iso_3166_3 + * @property string|null $name + * @property string|null $region_code + * @property string|null $sub_region_code + * @property bool $eea + * @property bool $swap_postal_code + * @property bool $swap_currency_symbol + * @property string|null $thousand_separator + * @property string|null $decimal_separator + * @method static \Illuminate\Database\Eloquent\Builder|StaticModel company() + * @method static \Illuminate\Database\Eloquent\Builder|StaticModel exclude($columns) + * @method static \Illuminate\Database\Eloquent\Builder|Country newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Country newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Country query() + * @method static \Illuminate\Database\Eloquent\Builder|Country whereCapital($value) + * @method static \Illuminate\Database\Eloquent\Builder|Country whereCitizenship($value) + * @method static \Illuminate\Database\Eloquent\Builder|Country whereCountryCode($value) + * @method static \Illuminate\Database\Eloquent\Builder|Country whereCurrency($value) + * @method static \Illuminate\Database\Eloquent\Builder|Country whereCurrencyCode($value) + * @method static \Illuminate\Database\Eloquent\Builder|Country whereCurrencySubUnit($value) + * @method static \Illuminate\Database\Eloquent\Builder|Country whereDecimalSeparator($value) + * @method static \Illuminate\Database\Eloquent\Builder|Country whereEea($value) + * @method static \Illuminate\Database\Eloquent\Builder|Country whereFullName($value) + * @method static \Illuminate\Database\Eloquent\Builder|Country whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Country whereIso31662($value) + * @method static \Illuminate\Database\Eloquent\Builder|Country whereIso31663($value) + * @method static \Illuminate\Database\Eloquent\Builder|Country whereName($value) + * @method static \Illuminate\Database\Eloquent\Builder|Country whereRegionCode($value) + * @method static \Illuminate\Database\Eloquent\Builder|Country whereSubRegionCode($value) + * @method static \Illuminate\Database\Eloquent\Builder|Country whereSwapCurrencySymbol($value) + * @method static \Illuminate\Database\Eloquent\Builder|Country whereSwapPostalCode($value) + * @method static \Illuminate\Database\Eloquent\Builder|Country whereThousandSeparator($value) + * @mixin \Eloquent + */ class Country extends StaticModel { public $timestamps = false; diff --git a/app/Models/Credit.php b/app/Models/Credit.php index 577501ee9c28..c8c9fc5f0252 100644 --- a/app/Models/Credit.php +++ b/app/Models/Credit.php @@ -27,6 +27,166 @@ use Illuminate\Support\Carbon; use Illuminate\Support\Facades\Storage; use Laracasts\Presenter\PresentableTrait; +/** + * App\Models\Credit + * + * @property int $id + * @property int $client_id + * @property int $user_id + * @property int|null $assigned_user_id + * @property int $company_id + * @property int $status_id + * @property int|null $project_id + * @property int|null $vendor_id + * @property int|null $recurring_id + * @property int|null $design_id + * @property int|null $invoice_id + * @property string|null $number + * @property float $discount + * @property bool $is_amount_discount + * @property string|null $po_number + * @property string|null $date + * @property string|null $last_sent_date + * @property string|null $due_date + * @property int $is_deleted + * @property object|null $line_items + * @property object|null $backup + * @property string|null $footer + * @property string|null $public_notes + * @property string|null $private_notes + * @property string|null $terms + * @property string|null $tax_name1 + * @property string $tax_rate1 + * @property string|null $tax_name2 + * @property string $tax_rate2 + * @property string|null $tax_name3 + * @property string $tax_rate3 + * @property string $total_taxes + * @property int $uses_inclusive_taxes + * @property string|null $custom_value1 + * @property string|null $custom_value2 + * @property string|null $custom_value3 + * @property string|null $custom_value4 + * @property string|null $next_send_date + * @property string|null $custom_surcharge1 + * @property string|null $custom_surcharge2 + * @property string|null $custom_surcharge3 + * @property string|null $custom_surcharge4 + * @property int $custom_surcharge_tax1 + * @property int $custom_surcharge_tax2 + * @property int $custom_surcharge_tax3 + * @property int $custom_surcharge_tax4 + * @property string $exchange_rate + * @property string $amount + * @property string $balance + * @property string|null $partial + * @property string|null $partial_due_date + * @property string|null $last_viewed + * @property int|null $created_at + * @property int|null $updated_at + * @property int|null $deleted_at + * @property string|null $reminder1_sent + * @property string|null $reminder2_sent + * @property string|null $reminder3_sent + * @property string|null $reminder_last_sent + * @property string $paid_to_date + * @property int|null $subscription_id + * @property-read \Illuminate\Database\Eloquent\Collection $activities + * @property-read int|null $activities_count + * @property-read \App\Models\User|null $assigned_user + * @property-read \App\Models\Client $client + * @property-read \App\Models\Company $company + * @property-read \Illuminate\Database\Eloquent\Collection $company_ledger + * @property-read int|null $company_ledger_count + * @property-read \Illuminate\Database\Eloquent\Collection $documents + * @property-read int|null $documents_count + * @property-read mixed $hashed_id + * @property-read \Illuminate\Database\Eloquent\Collection $history + * @property-read int|null $history_count + * @property-read \Illuminate\Database\Eloquent\Collection $invitations + * @property-read int|null $invitations_count + * @property-read \App\Models\Invoice|null $invoice + * @property-read \Illuminate\Database\Eloquent\Collection $invoices + * @property-read int|null $invoices_count + * @property-read \Illuminate\Database\Eloquent\Collection $payments + * @property-read int|null $payments_count + * @property-read \App\Models\Project|null $project + * @property-read \App\Models\User $user + * @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\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() + * @mixin \Eloquent + */ class Credit extends BaseModel { use MakesHash; diff --git a/app/Models/CreditInvitation.php b/app/Models/CreditInvitation.php index 035f6f4193a0..1c5709221688 100644 --- a/app/Models/CreditInvitation.php +++ b/app/Models/CreditInvitation.php @@ -19,6 +19,64 @@ use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Support\Carbon; use Illuminate\Support\Facades\Storage; +/** + * App\Models\CreditInvitation + * + * @property int $id + * @property int $company_id + * @property int $user_id + * @property int $client_contact_id + * @property int $credit_id + * @property string $key + * @property string|null $transaction_reference + * @property string|null $message_id + * @property string|null $email_error + * @property string|null $signature_base64 + * @property string|null $signature_date + * @property string|null $sent_date + * @property string|null $viewed_date + * @property string|null $opened_date + * @property int|null $created_at + * @property int|null $updated_at + * @property int|null $deleted_at + * @property string|null $signature_ip + * @property string|null $email_status + * @property-read \App\Models\Company $company + * @property-read \App\Models\ClientContact $contact + * @property-read \App\Models\Credit $credit + * @property-read mixed $hashed_id + * @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 \Database\Factories\CreditInvitationFactory factory($count = null, $state = []) + * @method static \Illuminate\Database\Eloquent\Builder|CreditInvitation newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|CreditInvitation newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|CreditInvitation onlyTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|CreditInvitation query() + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope() + * @method static \Illuminate\Database\Eloquent\Builder|CreditInvitation whereClientContactId($value) + * @method static \Illuminate\Database\Eloquent\Builder|CreditInvitation whereCompanyId($value) + * @method static \Illuminate\Database\Eloquent\Builder|CreditInvitation whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|CreditInvitation whereCreditId($value) + * @method static \Illuminate\Database\Eloquent\Builder|CreditInvitation whereDeletedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|CreditInvitation whereEmailError($value) + * @method static \Illuminate\Database\Eloquent\Builder|CreditInvitation whereEmailStatus($value) + * @method static \Illuminate\Database\Eloquent\Builder|CreditInvitation whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|CreditInvitation whereKey($value) + * @method static \Illuminate\Database\Eloquent\Builder|CreditInvitation whereMessageId($value) + * @method static \Illuminate\Database\Eloquent\Builder|CreditInvitation whereOpenedDate($value) + * @method static \Illuminate\Database\Eloquent\Builder|CreditInvitation whereSentDate($value) + * @method static \Illuminate\Database\Eloquent\Builder|CreditInvitation whereSignatureBase64($value) + * @method static \Illuminate\Database\Eloquent\Builder|CreditInvitation whereSignatureDate($value) + * @method static \Illuminate\Database\Eloquent\Builder|CreditInvitation whereSignatureIp($value) + * @method static \Illuminate\Database\Eloquent\Builder|CreditInvitation whereTransactionReference($value) + * @method static \Illuminate\Database\Eloquent\Builder|CreditInvitation whereUpdatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|CreditInvitation whereUserId($value) + * @method static \Illuminate\Database\Eloquent\Builder|CreditInvitation whereViewedDate($value) + * @method static \Illuminate\Database\Eloquent\Builder|CreditInvitation withTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|CreditInvitation withoutTrashed() + * @mixin \Eloquent + */ class CreditInvitation extends BaseModel { use MakesDates; diff --git a/app/Models/Currency.php b/app/Models/Currency.php index 2da76e6541e0..1e188ea53762 100644 --- a/app/Models/Currency.php +++ b/app/Models/Currency.php @@ -11,6 +11,34 @@ namespace App\Models; +/** + * App\Models\Currency + * + * @property int $id + * @property string $name + * @property string $symbol + * @property int $precision + * @property string $thousand_separator + * @property string $decimal_separator + * @property string $code + * @property bool $swap_currency_symbol + * @property float $exchange_rate + * @method static \Illuminate\Database\Eloquent\Builder|StaticModel company() + * @method static \Illuminate\Database\Eloquent\Builder|StaticModel exclude($columns) + * @method static \Illuminate\Database\Eloquent\Builder|Currency newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Currency newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Currency query() + * @method static \Illuminate\Database\Eloquent\Builder|Currency whereCode($value) + * @method static \Illuminate\Database\Eloquent\Builder|Currency whereDecimalSeparator($value) + * @method static \Illuminate\Database\Eloquent\Builder|Currency whereExchangeRate($value) + * @method static \Illuminate\Database\Eloquent\Builder|Currency whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Currency whereName($value) + * @method static \Illuminate\Database\Eloquent\Builder|Currency wherePrecision($value) + * @method static \Illuminate\Database\Eloquent\Builder|Currency whereSwapCurrencySymbol($value) + * @method static \Illuminate\Database\Eloquent\Builder|Currency whereSymbol($value) + * @method static \Illuminate\Database\Eloquent\Builder|Currency whereThousandSeparator($value) + * @mixin \Eloquent + */ class Currency extends StaticModel { public $timestamps = false; diff --git a/app/Models/DateFormat.php b/app/Models/DateFormat.php index ec261fb3a8b5..3801e1146a97 100644 --- a/app/Models/DateFormat.php +++ b/app/Models/DateFormat.php @@ -4,6 +4,21 @@ namespace App\Models; /** * Class DateFormat. + * + * @property int $id + * @property string $format + * @property string $format_moment + * @property string $format_dart + * @method static \Illuminate\Database\Eloquent\Builder|StaticModel company() + * @method static \Illuminate\Database\Eloquent\Builder|StaticModel exclude($columns) + * @method static \Illuminate\Database\Eloquent\Builder|DateFormat newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|DateFormat newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|DateFormat query() + * @method static \Illuminate\Database\Eloquent\Builder|DateFormat whereFormat($value) + * @method static \Illuminate\Database\Eloquent\Builder|DateFormat whereFormatDart($value) + * @method static \Illuminate\Database\Eloquent\Builder|DateFormat whereFormatMoment($value) + * @method static \Illuminate\Database\Eloquent\Builder|DateFormat whereId($value) + * @mixin \Eloquent */ class DateFormat extends StaticModel { diff --git a/app/Models/DatetimeFormat.php b/app/Models/DatetimeFormat.php index 53c728ed38d5..0c9e88c2238a 100644 --- a/app/Models/DatetimeFormat.php +++ b/app/Models/DatetimeFormat.php @@ -4,6 +4,21 @@ namespace App\Models; /** * Class DatetimeFormat. + * + * @property int $id + * @property string $format + * @property string $format_moment + * @property string $format_dart + * @method static \Illuminate\Database\Eloquent\Builder|StaticModel company() + * @method static \Illuminate\Database\Eloquent\Builder|StaticModel exclude($columns) + * @method static \Illuminate\Database\Eloquent\Builder|DatetimeFormat newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|DatetimeFormat newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|DatetimeFormat query() + * @method static \Illuminate\Database\Eloquent\Builder|DatetimeFormat whereFormat($value) + * @method static \Illuminate\Database\Eloquent\Builder|DatetimeFormat whereFormatDart($value) + * @method static \Illuminate\Database\Eloquent\Builder|DatetimeFormat whereFormatMoment($value) + * @method static \Illuminate\Database\Eloquent\Builder|DatetimeFormat whereId($value) + * @mixin \Eloquent */ class DatetimeFormat extends StaticModel { diff --git a/app/Models/Design.php b/app/Models/Design.php index 7adc93e6b67d..fbb6915135c4 100644 --- a/app/Models/Design.php +++ b/app/Models/Design.php @@ -13,6 +13,45 @@ namespace App\Models; use Illuminate\Database\Eloquent\SoftDeletes; +/** + * App\Models\Design + * + * @property int $id + * @property int|null $user_id + * @property int|null $company_id + * @property string $name + * @property int $is_custom + * @property int $is_active + * @property object|null $design + * @property int $is_deleted + * @property int|null $created_at + * @property int|null $updated_at + * @property int|null $deleted_at + * @property-read \App\Models\Company|null $company + * @property-read mixed $hashed_id + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel company() + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel exclude($columns) + * @method static \Illuminate\Database\Eloquent\Builder|Design filter(\App\Filters\QueryFilters $filters) + * @method static \Illuminate\Database\Eloquent\Builder|Design newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Design newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Design onlyTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|Design query() + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope() + * @method static \Illuminate\Database\Eloquent\Builder|Design whereCompanyId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Design whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Design whereDeletedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Design whereDesign($value) + * @method static \Illuminate\Database\Eloquent\Builder|Design whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Design whereIsActive($value) + * @method static \Illuminate\Database\Eloquent\Builder|Design whereIsCustom($value) + * @method static \Illuminate\Database\Eloquent\Builder|Design whereIsDeleted($value) + * @method static \Illuminate\Database\Eloquent\Builder|Design whereName($value) + * @method static \Illuminate\Database\Eloquent\Builder|Design whereUpdatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Design whereUserId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Design withTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|Design withoutTrashed() + * @mixin \Eloquent + */ class Design extends BaseModel { use Filterable; diff --git a/app/Models/Document.php b/app/Models/Document.php index 27de8d36514f..e2be3a232fef 100644 --- a/app/Models/Document.php +++ b/app/Models/Document.php @@ -15,6 +15,77 @@ use App\Helpers\Document\WithTypeHelpers; use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Support\Facades\Storage; +/** + * App\Models\Document + * + * @property int $id + * @property int $user_id + * @property int|null $assigned_user_id + * @property int $company_id + * @property int|null $project_id + * @property int|null $vendor_id + * @property string|null $url + * @property string|null $preview + * @property string|null $name + * @property string|null $type + * @property string|null $disk + * @property string|null $hash + * @property int|null $size + * @property int|null $width + * @property int|null $height + * @property int $is_default + * @property string|null $custom_value1 + * @property string|null $custom_value2 + * @property string|null $custom_value3 + * @property string|null $custom_value4 + * @property int|null $deleted_at + * @property int $documentable_id + * @property string $documentable_type + * @property int|null $created_at + * @property int|null $updated_at + * @property int $is_public + * @property-read \Illuminate\Database\Eloquent\Model|\Eloquent $documentable + * @property-read mixed $hashed_id + * @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 \Database\Factories\DocumentFactory factory($count = null, $state = []) + * @method static \Illuminate\Database\Eloquent\Builder|Document filter(\App\Filters\QueryFilters $filters) + * @method static \Illuminate\Database\Eloquent\Builder|Document newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Document newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Document onlyTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|Document query() + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope() + * @method static \Illuminate\Database\Eloquent\Builder|Document whereAssignedUserId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Document whereCompanyId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Document whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Document whereCustomValue1($value) + * @method static \Illuminate\Database\Eloquent\Builder|Document whereCustomValue2($value) + * @method static \Illuminate\Database\Eloquent\Builder|Document whereCustomValue3($value) + * @method static \Illuminate\Database\Eloquent\Builder|Document whereCustomValue4($value) + * @method static \Illuminate\Database\Eloquent\Builder|Document whereDeletedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Document whereDisk($value) + * @method static \Illuminate\Database\Eloquent\Builder|Document whereDocumentableId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Document whereDocumentableType($value) + * @method static \Illuminate\Database\Eloquent\Builder|Document whereHash($value) + * @method static \Illuminate\Database\Eloquent\Builder|Document whereHeight($value) + * @method static \Illuminate\Database\Eloquent\Builder|Document whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Document whereIsDefault($value) + * @method static \Illuminate\Database\Eloquent\Builder|Document whereIsPublic($value) + * @method static \Illuminate\Database\Eloquent\Builder|Document whereName($value) + * @method static \Illuminate\Database\Eloquent\Builder|Document wherePreview($value) + * @method static \Illuminate\Database\Eloquent\Builder|Document whereProjectId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Document whereSize($value) + * @method static \Illuminate\Database\Eloquent\Builder|Document whereType($value) + * @method static \Illuminate\Database\Eloquent\Builder|Document whereUpdatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Document whereUrl($value) + * @method static \Illuminate\Database\Eloquent\Builder|Document whereUserId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Document whereVendorId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Document whereWidth($value) + * @method static \Illuminate\Database\Eloquent\Builder|Document withTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|Document withoutTrashed() + * @mixin \Eloquent + */ class Document extends BaseModel { use SoftDeletes; diff --git a/app/Models/Expense.php b/app/Models/Expense.php index f54a28645702..3ec8f0b5780c 100644 --- a/app/Models/Expense.php +++ b/app/Models/Expense.php @@ -13,6 +13,125 @@ namespace App\Models; use Illuminate\Database\Eloquent\SoftDeletes; +/** + * App\Models\Expense + * + * @property int $id + * @property int|null $created_at + * @property int|null $updated_at + * @property int|null $deleted_at + * @property int $company_id + * @property int|null $vendor_id + * @property int $user_id + * @property int|null $assigned_user_id + * @property int|null $invoice_id + * @property int|null $client_id + * @property int|null $bank_id + * @property int|null $invoice_currency_id + * @property int|null $currency_id + * @property int|null $category_id + * @property int|null $payment_type_id + * @property int|null $recurring_expense_id + * @property bool $is_deleted + * @property string $amount + * @property string $foreign_amount + * @property string $exchange_rate + * @property string|null $tax_name1 + * @property string $tax_rate1 + * @property string|null $tax_name2 + * @property string $tax_rate2 + * @property string|null $tax_name3 + * @property string $tax_rate3 + * @property string|null $date + * @property string|null $payment_date + * @property string|null $private_notes + * @property string|null $public_notes + * @property string|null $transaction_reference + * @property int $should_be_invoiced + * @property int $invoice_documents + * @property int|null $transaction_id + * @property string|null $custom_value1 + * @property string|null $custom_value2 + * @property string|null $custom_value3 + * @property string|null $custom_value4 + * @property string|null $number + * @property int|null $project_id + * @property string $tax_amount1 + * @property string $tax_amount2 + * @property string $tax_amount3 + * @property int $uses_inclusive_taxes + * @property int $calculate_tax_by_amount + * @property-read \App\Models\User|null $assigned_user + * @property-read \App\Models\ExpenseCategory|null $category + * @property-read \App\Models\Client|null $client + * @property-read \App\Models\Company $company + * @property-read \App\Models\Currency|null $currency + * @property-read \Illuminate\Database\Eloquent\Collection $documents + * @property-read int|null $documents_count + * @property-read mixed $hashed_id + * @property-read \App\Models\PaymentType|null $payment_type + * @property-read \App\Models\Project|null $project + * @property-read \App\Models\PurchaseOrder|null $purchase_order + * @property-read \App\Models\User $user + * @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\ExpenseFactory factory($count = null, $state = []) + * @method static \Illuminate\Database\Eloquent\Builder|Expense filter(\App\Filters\QueryFilters $filters) + * @method static \Illuminate\Database\Eloquent\Builder|Expense newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Expense newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Expense onlyTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|Expense query() + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope() + * @method static \Illuminate\Database\Eloquent\Builder|Expense whereAmount($value) + * @method static \Illuminate\Database\Eloquent\Builder|Expense whereAssignedUserId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Expense whereBankId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Expense whereCalculateTaxByAmount($value) + * @method static \Illuminate\Database\Eloquent\Builder|Expense whereCategoryId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Expense whereClientId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Expense whereCompanyId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Expense whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Expense whereCurrencyId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Expense whereCustomValue1($value) + * @method static \Illuminate\Database\Eloquent\Builder|Expense whereCustomValue2($value) + * @method static \Illuminate\Database\Eloquent\Builder|Expense whereCustomValue3($value) + * @method static \Illuminate\Database\Eloquent\Builder|Expense whereCustomValue4($value) + * @method static \Illuminate\Database\Eloquent\Builder|Expense whereDate($value) + * @method static \Illuminate\Database\Eloquent\Builder|Expense whereDeletedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Expense whereExchangeRate($value) + * @method static \Illuminate\Database\Eloquent\Builder|Expense whereForeignAmount($value) + * @method static \Illuminate\Database\Eloquent\Builder|Expense whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Expense whereInvoiceCurrencyId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Expense whereInvoiceDocuments($value) + * @method static \Illuminate\Database\Eloquent\Builder|Expense whereInvoiceId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Expense whereIsDeleted($value) + * @method static \Illuminate\Database\Eloquent\Builder|Expense whereNumber($value) + * @method static \Illuminate\Database\Eloquent\Builder|Expense wherePaymentDate($value) + * @method static \Illuminate\Database\Eloquent\Builder|Expense wherePaymentTypeId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Expense wherePrivateNotes($value) + * @method static \Illuminate\Database\Eloquent\Builder|Expense whereProjectId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Expense wherePublicNotes($value) + * @method static \Illuminate\Database\Eloquent\Builder|Expense whereRecurringExpenseId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Expense whereShouldBeInvoiced($value) + * @method static \Illuminate\Database\Eloquent\Builder|Expense whereTaxAmount1($value) + * @method static \Illuminate\Database\Eloquent\Builder|Expense whereTaxAmount2($value) + * @method static \Illuminate\Database\Eloquent\Builder|Expense whereTaxAmount3($value) + * @method static \Illuminate\Database\Eloquent\Builder|Expense whereTaxName1($value) + * @method static \Illuminate\Database\Eloquent\Builder|Expense whereTaxName2($value) + * @method static \Illuminate\Database\Eloquent\Builder|Expense whereTaxName3($value) + * @method static \Illuminate\Database\Eloquent\Builder|Expense whereTaxRate1($value) + * @method static \Illuminate\Database\Eloquent\Builder|Expense whereTaxRate2($value) + * @method static \Illuminate\Database\Eloquent\Builder|Expense whereTaxRate3($value) + * @method static \Illuminate\Database\Eloquent\Builder|Expense whereTransactionId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Expense whereTransactionReference($value) + * @method static \Illuminate\Database\Eloquent\Builder|Expense whereUpdatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Expense whereUserId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Expense whereUsesInclusiveTaxes($value) + * @method static \Illuminate\Database\Eloquent\Builder|Expense whereVendorId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Expense withTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|Expense withoutTrashed() + * @mixin \Eloquent + */ class Expense extends BaseModel { use SoftDeletes; diff --git a/app/Models/ExpenseCategory.php b/app/Models/ExpenseCategory.php index 92f07ac0f0e0..517abfbf3b2c 100644 --- a/app/Models/ExpenseCategory.php +++ b/app/Models/ExpenseCategory.php @@ -14,6 +14,44 @@ namespace App\Models; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\SoftDeletes; +/** + * App\Models\ExpenseCategory + * + * @property int $id + * @property int $user_id + * @property int $company_id + * @property string|null $name + * @property int|null $created_at + * @property int|null $updated_at + * @property int|null $deleted_at + * @property int $is_deleted + * @property string $color + * @property int|null $bank_category_id + * @property-read \App\Models\Expense|null $expense + * @property-read mixed $hashed_id + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel company() + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel exclude($columns) + * @method static \Database\Factories\ExpenseCategoryFactory factory($count = null, $state = []) + * @method static \Illuminate\Database\Eloquent\Builder|ExpenseCategory filter(\App\Filters\QueryFilters $filters) + * @method static \Illuminate\Database\Eloquent\Builder|ExpenseCategory newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|ExpenseCategory newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|ExpenseCategory onlyTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|ExpenseCategory query() + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope() + * @method static \Illuminate\Database\Eloquent\Builder|ExpenseCategory whereBankCategoryId($value) + * @method static \Illuminate\Database\Eloquent\Builder|ExpenseCategory whereColor($value) + * @method static \Illuminate\Database\Eloquent\Builder|ExpenseCategory whereCompanyId($value) + * @method static \Illuminate\Database\Eloquent\Builder|ExpenseCategory whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|ExpenseCategory whereDeletedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|ExpenseCategory whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|ExpenseCategory whereIsDeleted($value) + * @method static \Illuminate\Database\Eloquent\Builder|ExpenseCategory whereName($value) + * @method static \Illuminate\Database\Eloquent\Builder|ExpenseCategory whereUpdatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|ExpenseCategory whereUserId($value) + * @method static \Illuminate\Database\Eloquent\Builder|ExpenseCategory withTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|ExpenseCategory withoutTrashed() + * @mixin \Eloquent + */ class ExpenseCategory extends BaseModel { use SoftDeletes; diff --git a/app/Models/Gateway.php b/app/Models/Gateway.php index 87b5d2bb33f8..be06d4a9372c 100644 --- a/app/Models/Gateway.php +++ b/app/Models/Gateway.php @@ -11,6 +11,43 @@ namespace App\Models; +/** + * App\Models\Gateway + * + * @property int $id + * @property string $name + * @property string $key + * @property string $provider + * @property bool $visible + * @property int $sort_order + * @property string|null $site_url + * @property bool $is_offsite + * @property bool $is_secure + * @property object|null $fields + * @property string $default_gateway_type_id + * @property int|null $created_at + * @property int|null $updated_at + * @property-read mixed $options + * @method static \Illuminate\Database\Eloquent\Builder|StaticModel company() + * @method static \Illuminate\Database\Eloquent\Builder|StaticModel exclude($columns) + * @method static \Illuminate\Database\Eloquent\Builder|Gateway newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Gateway newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Gateway query() + * @method static \Illuminate\Database\Eloquent\Builder|Gateway whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Gateway whereDefaultGatewayTypeId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Gateway whereFields($value) + * @method static \Illuminate\Database\Eloquent\Builder|Gateway whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Gateway whereIsOffsite($value) + * @method static \Illuminate\Database\Eloquent\Builder|Gateway whereIsSecure($value) + * @method static \Illuminate\Database\Eloquent\Builder|Gateway whereKey($value) + * @method static \Illuminate\Database\Eloquent\Builder|Gateway whereName($value) + * @method static \Illuminate\Database\Eloquent\Builder|Gateway whereProvider($value) + * @method static \Illuminate\Database\Eloquent\Builder|Gateway whereSiteUrl($value) + * @method static \Illuminate\Database\Eloquent\Builder|Gateway whereSortOrder($value) + * @method static \Illuminate\Database\Eloquent\Builder|Gateway whereUpdatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Gateway whereVisible($value) + * @mixin \Eloquent + */ class Gateway extends StaticModel { protected $casts = [ diff --git a/app/Models/GatewayType.php b/app/Models/GatewayType.php index eb419261304d..70d91d5a5a8c 100644 --- a/app/Models/GatewayType.php +++ b/app/Models/GatewayType.php @@ -11,6 +11,25 @@ namespace App\Models; +/** + * App\Models\GatewayType + * + * @property int $id + * @property string|null $alias + * @property string|null $name + * @property-read \App\Models\Gateway|null $gateway + * @property-read \Illuminate\Database\Eloquent\Collection $payment_methods + * @property-read int|null $payment_methods_count + * @method static \Illuminate\Database\Eloquent\Builder|StaticModel company() + * @method static \Illuminate\Database\Eloquent\Builder|StaticModel exclude($columns) + * @method static \Illuminate\Database\Eloquent\Builder|GatewayType newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|GatewayType newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|GatewayType query() + * @method static \Illuminate\Database\Eloquent\Builder|GatewayType whereAlias($value) + * @method static \Illuminate\Database\Eloquent\Builder|GatewayType whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|GatewayType whereName($value) + * @mixin \Eloquent + */ class GatewayType extends StaticModel { public $timestamps = false; diff --git a/app/Models/GroupSetting.php b/app/Models/GroupSetting.php index f8ac3bc1e959..fb8de1203187 100644 --- a/app/Models/GroupSetting.php +++ b/app/Models/GroupSetting.php @@ -16,6 +16,46 @@ use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\ModelNotFoundException as ModelNotFoundException; use Illuminate\Database\Eloquent\SoftDeletes; +/** + * App\Models\GroupSetting + * + * @property int $id + * @property int $company_id + * @property int|null $user_id + * @property string|null $name + * @property object|null $settings + * @property int $is_default + * @property int|null $deleted_at + * @property int|null $created_at + * @property int|null $updated_at + * @property int $is_deleted + * @property-read \Illuminate\Database\Eloquent\Collection $clients + * @property-read int|null $clients_count + * @property-read \App\Models\Company $company + * @property-read \Illuminate\Database\Eloquent\Collection $documents + * @property-read int|null $documents_count + * @property-read mixed $hashed_id + * @property-read \App\Models\User|null $user + * @method static \Illuminate\Database\Eloquent\Builder|StaticModel company() + * @method static \Illuminate\Database\Eloquent\Builder|StaticModel exclude($columns) + * @method static \Illuminate\Database\Eloquent\Builder|GroupSetting newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|GroupSetting newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|GroupSetting onlyTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|GroupSetting query() + * @method static \Illuminate\Database\Eloquent\Builder|GroupSetting whereCompanyId($value) + * @method static \Illuminate\Database\Eloquent\Builder|GroupSetting whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|GroupSetting whereDeletedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|GroupSetting whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|GroupSetting whereIsDefault($value) + * @method static \Illuminate\Database\Eloquent\Builder|GroupSetting whereIsDeleted($value) + * @method static \Illuminate\Database\Eloquent\Builder|GroupSetting whereName($value) + * @method static \Illuminate\Database\Eloquent\Builder|GroupSetting whereSettings($value) + * @method static \Illuminate\Database\Eloquent\Builder|GroupSetting whereUpdatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|GroupSetting whereUserId($value) + * @method static \Illuminate\Database\Eloquent\Builder|GroupSetting withTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|GroupSetting withoutTrashed() + * @mixin \Eloquent + */ class GroupSetting extends StaticModel { use MakesHash; diff --git a/app/Models/Industry.php b/app/Models/Industry.php index 09e6061d2b0f..967910c00972 100644 --- a/app/Models/Industry.php +++ b/app/Models/Industry.php @@ -11,6 +11,20 @@ namespace App\Models; +/** + * App\Models\Industry + * + * @property int $id + * @property string $name + * @method static \Illuminate\Database\Eloquent\Builder|StaticModel company() + * @method static \Illuminate\Database\Eloquent\Builder|StaticModel exclude($columns) + * @method static \Illuminate\Database\Eloquent\Builder|Industry newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Industry newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Industry query() + * @method static \Illuminate\Database\Eloquent\Builder|Industry whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Industry whereName($value) + * @mixin \Eloquent + */ class Industry extends StaticModel { public $timestamps = false; diff --git a/app/Models/Invoice.php b/app/Models/Invoice.php index c3a6bf966536..84cb253604fa 100644 --- a/app/Models/Invoice.php +++ b/app/Models/Invoice.php @@ -30,6 +30,181 @@ use Illuminate\Support\Carbon; use Illuminate\Support\Facades\Storage; use Laracasts\Presenter\PresentableTrait; +/** + * App\Models\Invoice + * + * @property int $id + * @property int $client_id + * @property int $user_id + * @property int|null $assigned_user_id + * @property int $company_id + * @property int $status_id + * @property int|null $project_id + * @property int|null $vendor_id + * @property int|null $recurring_id + * @property int|null $design_id + * @property string|null $number + * @property float $discount + * @property bool $is_amount_discount + * @property string|null $po_number + * @property string|null $date + * @property string|null $last_sent_date + * @property string|null $due_date + * @property bool $is_deleted + * @property object|null $line_items + * @property object|null $backup + * @property string|null $footer + * @property string|null $public_notes + * @property string|null $private_notes + * @property string|null $terms + * @property string|null $tax_name1 + * @property string $tax_rate1 + * @property string|null $tax_name2 + * @property string $tax_rate2 + * @property string|null $tax_name3 + * @property string $tax_rate3 + * @property string $total_taxes + * @property int $uses_inclusive_taxes + * @property string|null $custom_value1 + * @property string|null $custom_value2 + * @property string|null $custom_value3 + * @property string|null $custom_value4 + * @property string|null $next_send_date + * @property string|null $custom_surcharge1 + * @property string|null $custom_surcharge2 + * @property string|null $custom_surcharge3 + * @property string|null $custom_surcharge4 + * @property int $custom_surcharge_tax1 + * @property int $custom_surcharge_tax2 + * @property int $custom_surcharge_tax3 + * @property int $custom_surcharge_tax4 + * @property string $exchange_rate + * @property string $amount + * @property string $balance + * @property string|null $partial + * @property string|null $partial_due_date + * @property string|null $last_viewed + * @property int|null $created_at + * @property int|null $updated_at + * @property int|null $deleted_at + * @property string|null $reminder1_sent + * @property string|null $reminder2_sent + * @property string|null $reminder3_sent + * @property string|null $reminder_last_sent + * @property int $auto_bill_enabled + * @property string $paid_to_date + * @property int|null $subscription_id + * @property int $auto_bill_tries + * @property int $is_proforma + * @property-read \Illuminate\Database\Eloquent\Collection $activities + * @property-read int|null $activities_count + * @property-read \App\Models\User|null $assigned_user + * @property-read \App\Models\Client $client + * @property-read \App\Models\Company $company + * @property-read \Illuminate\Database\Eloquent\Collection $company_ledger + * @property-read int|null $company_ledger_count + * @property-read \Illuminate\Database\Eloquent\Collection $credits + * @property-read int|null $credits_count + * @property-read \App\Models\Design|null $design + * @property-read \Illuminate\Database\Eloquent\Collection $documents + * @property-read int|null $documents_count + * @property-read \App\Models\Expense|null $expense + * @property-read \Illuminate\Database\Eloquent\Collection $expenses + * @property-read int|null $expenses_count + * @property-read mixed $balance_due + * @property-read mixed $hashed_id + * @property-read mixed $status + * @property-read mixed $total + * @property-read \Illuminate\Database\Eloquent\Collection $history + * @property-read int|null $history_count + * @property-read \Illuminate\Database\Eloquent\Collection $invitations + * @property-read int|null $invitations_count + * @property-read \Illuminate\Database\Eloquent\Collection $payments + * @property-read int|null $payments_count + * @property-read \App\Models\Project|null $project + * @property-read \App\Models\RecurringInvoice|null $recurring_invoice + * @property-read \App\Models\Subscription|null $subscription + * @property-read \App\Models\Task|null $task + * @property-read \Illuminate\Database\Eloquent\Collection $tasks + * @property-read int|null $tasks_count + * @property-read \App\Models\User $user + * @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 whereAmount($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereAssignedUserId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereAutoBillEnabled($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereAutoBillTries($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereBackup($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereBalance($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereClientId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereCompanyId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereCustomSurcharge1($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereCustomSurcharge2($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereCustomSurcharge3($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereCustomSurcharge4($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereCustomSurchargeTax1($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereCustomSurchargeTax2($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereCustomSurchargeTax3($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereCustomSurchargeTax4($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereCustomValue1($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereCustomValue2($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereCustomValue3($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereCustomValue4($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereDate($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereDeletedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereDesignId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereDiscount($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereDueDate($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereExchangeRate($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereFooter($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereIsAmountDiscount($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereIsDeleted($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereIsProforma($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereLastSentDate($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereLastViewed($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereLineItems($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereNextSendDate($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereNumber($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice wherePaidToDate($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice wherePartial($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice wherePartialDueDate($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice wherePoNumber($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice wherePrivateNotes($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereProjectId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice wherePublicNotes($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereRecurringId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereReminder1Sent($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereReminder2Sent($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereReminder3Sent($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereReminderLastSent($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereStatusId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereSubscriptionId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereTaxName1($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereTaxName2($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereTaxName3($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereTaxRate1($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereTaxRate2($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereTaxRate3($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereTerms($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereTotalTaxes($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereUpdatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereUserId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereUsesInclusiveTaxes($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice whereVendorId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Invoice withTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|Invoice withoutTrashed() + * @mixin \Eloquent + */ class Invoice extends BaseModel { use SoftDeletes; diff --git a/app/Models/InvoiceInvitation.php b/app/Models/InvoiceInvitation.php index 9e0d20c7e4ba..43c41d91cf95 100644 --- a/app/Models/InvoiceInvitation.php +++ b/app/Models/InvoiceInvitation.php @@ -21,6 +21,64 @@ use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Support\Carbon; use Illuminate\Support\Facades\Storage; +/** + * App\Models\InvoiceInvitation + * + * @property int $id + * @property int $company_id + * @property int $user_id + * @property int $client_contact_id + * @property int $invoice_id + * @property string $key + * @property string|null $transaction_reference + * @property string|null $message_id + * @property string|null $email_error + * @property string|null $signature_base64 + * @property string|null $signature_date + * @property string|null $sent_date + * @property string|null $viewed_date + * @property string|null $opened_date + * @property int|null $created_at + * @property int|null $updated_at + * @property int|null $deleted_at + * @property string|null $signature_ip + * @property string|null $email_status + * @property-read \App\Models\Company $company + * @property-read \App\Models\ClientContact $contact + * @property-read mixed $hashed_id + * @property-read \App\Models\Invoice $invoice + * @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 \Database\Factories\InvoiceInvitationFactory factory($count = null, $state = []) + * @method static \Illuminate\Database\Eloquent\Builder|InvoiceInvitation newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|InvoiceInvitation newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|InvoiceInvitation onlyTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|InvoiceInvitation query() + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope() + * @method static \Illuminate\Database\Eloquent\Builder|InvoiceInvitation whereClientContactId($value) + * @method static \Illuminate\Database\Eloquent\Builder|InvoiceInvitation whereCompanyId($value) + * @method static \Illuminate\Database\Eloquent\Builder|InvoiceInvitation whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|InvoiceInvitation whereDeletedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|InvoiceInvitation whereEmailError($value) + * @method static \Illuminate\Database\Eloquent\Builder|InvoiceInvitation whereEmailStatus($value) + * @method static \Illuminate\Database\Eloquent\Builder|InvoiceInvitation whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|InvoiceInvitation whereInvoiceId($value) + * @method static \Illuminate\Database\Eloquent\Builder|InvoiceInvitation whereKey($value) + * @method static \Illuminate\Database\Eloquent\Builder|InvoiceInvitation whereMessageId($value) + * @method static \Illuminate\Database\Eloquent\Builder|InvoiceInvitation whereOpenedDate($value) + * @method static \Illuminate\Database\Eloquent\Builder|InvoiceInvitation whereSentDate($value) + * @method static \Illuminate\Database\Eloquent\Builder|InvoiceInvitation whereSignatureBase64($value) + * @method static \Illuminate\Database\Eloquent\Builder|InvoiceInvitation whereSignatureDate($value) + * @method static \Illuminate\Database\Eloquent\Builder|InvoiceInvitation whereSignatureIp($value) + * @method static \Illuminate\Database\Eloquent\Builder|InvoiceInvitation whereTransactionReference($value) + * @method static \Illuminate\Database\Eloquent\Builder|InvoiceInvitation whereUpdatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|InvoiceInvitation whereUserId($value) + * @method static \Illuminate\Database\Eloquent\Builder|InvoiceInvitation whereViewedDate($value) + * @method static \Illuminate\Database\Eloquent\Builder|InvoiceInvitation withTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|InvoiceInvitation withoutTrashed() + * @mixin \Eloquent + */ class InvoiceInvitation extends BaseModel { use MakesDates; diff --git a/app/Models/Language.php b/app/Models/Language.php index 18930f3c300f..1d2448293635 100644 --- a/app/Models/Language.php +++ b/app/Models/Language.php @@ -11,6 +11,22 @@ namespace App\Models; +/** + * App\Models\Language + * + * @property int $id + * @property string $name + * @property string $locale + * @method static \Illuminate\Database\Eloquent\Builder|StaticModel company() + * @method static \Illuminate\Database\Eloquent\Builder|StaticModel exclude($columns) + * @method static \Illuminate\Database\Eloquent\Builder|Language newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Language newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Language query() + * @method static \Illuminate\Database\Eloquent\Builder|Language whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Language whereLocale($value) + * @method static \Illuminate\Database\Eloquent\Builder|Language whereName($value) + * @mixin \Eloquent + */ class Language extends StaticModel { public $timestamps = false; diff --git a/app/Models/Payment.php b/app/Models/Payment.php index 88d936dc1360..1a6e79830707 100644 --- a/app/Models/Payment.php +++ b/app/Models/Payment.php @@ -23,6 +23,117 @@ use App\Utils\Traits\MakesHash; use App\Utils\Traits\Payment\Refundable; use Illuminate\Database\Eloquent\SoftDeletes; +/** + * App\Models\Payment + * + * @property int $id + * @property int $company_id + * @property int $client_id + * @property int|null $project_id + * @property int|null $vendor_id + * @property int|null $user_id + * @property int|null $assigned_user_id + * @property int|null $client_contact_id + * @property int|null $invitation_id + * @property int|null $company_gateway_id + * @property int|null $gateway_type_id + * @property int|null $type_id + * @property int $status_id + * @property string $amount + * @property string $refunded + * @property string $applied + * @property string|null $date + * @property string|null $transaction_reference + * @property string|null $payer_id + * @property string|null $number + * @property string|null $private_notes + * @property int|null $created_at + * @property int|null $updated_at + * @property int|null $deleted_at + * @property bool $is_deleted + * @property int $is_manual + * @property float $exchange_rate + * @property int $currency_id + * @property int|null $exchange_currency_id + * @property object|null $meta + * @property string|null $custom_value1 + * @property string|null $custom_value2 + * @property string|null $custom_value3 + * @property string|null $custom_value4 + * @property int|null $transaction_id + * @property string|null $idempotency_key + * @property-read \App\Models\User|null $assigned_user + * @property-read \App\Models\Client $client + * @property-read \App\Models\Company $company + * @property-read \App\Models\CompanyGateway|null $company_gateway + * @property-read \Illuminate\Database\Eloquent\Collection $company_ledger + * @property-read int|null $company_ledger_count + * @property-read \App\Models\ClientContact|null $contact + * @property-read \Illuminate\Database\Eloquent\Collection $credits + * @property-read int|null $credits_count + * @property-read \App\Models\Currency|null $currency + * @property-read \Illuminate\Database\Eloquent\Collection $documents + * @property-read int|null $documents_count + * @property-read \App\Models\Currency|null $exchange_currency + * @property-read \App\Models\GatewayType|null $gateway_type + * @property-read mixed $hashed_id + * @property-read \Illuminate\Database\Eloquent\Collection $invoices + * @property-read int|null $invoices_count + * @property-read \Illuminate\Database\Eloquent\Collection $paymentables + * @property-read int|null $paymentables_count + * @property-read \App\Models\Project|null $project + * @property-read \App\Models\PaymentType|null $type + * @property-read \App\Models\User|null $user + * @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\PaymentFactory factory($count = null, $state = []) + * @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 newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Payment onlyTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|Payment query() + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope() + * @method static \Illuminate\Database\Eloquent\Builder|Payment whereAmount($value) + * @method static \Illuminate\Database\Eloquent\Builder|Payment whereApplied($value) + * @method static \Illuminate\Database\Eloquent\Builder|Payment whereAssignedUserId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Payment whereClientContactId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Payment whereClientId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Payment whereCompanyGatewayId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Payment whereCompanyId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Payment whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Payment whereCurrencyId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Payment whereCustomValue1($value) + * @method static \Illuminate\Database\Eloquent\Builder|Payment whereCustomValue2($value) + * @method static \Illuminate\Database\Eloquent\Builder|Payment whereCustomValue3($value) + * @method static \Illuminate\Database\Eloquent\Builder|Payment whereCustomValue4($value) + * @method static \Illuminate\Database\Eloquent\Builder|Payment whereDate($value) + * @method static \Illuminate\Database\Eloquent\Builder|Payment whereDeletedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Payment whereExchangeCurrencyId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Payment whereExchangeRate($value) + * @method static \Illuminate\Database\Eloquent\Builder|Payment whereGatewayTypeId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Payment whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Payment whereIdempotencyKey($value) + * @method static \Illuminate\Database\Eloquent\Builder|Payment whereInvitationId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Payment whereIsDeleted($value) + * @method static \Illuminate\Database\Eloquent\Builder|Payment whereIsManual($value) + * @method static \Illuminate\Database\Eloquent\Builder|Payment whereMeta($value) + * @method static \Illuminate\Database\Eloquent\Builder|Payment whereNumber($value) + * @method static \Illuminate\Database\Eloquent\Builder|Payment wherePayerId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Payment wherePrivateNotes($value) + * @method static \Illuminate\Database\Eloquent\Builder|Payment whereProjectId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Payment whereRefunded($value) + * @method static \Illuminate\Database\Eloquent\Builder|Payment whereStatusId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Payment whereTransactionId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Payment whereTransactionReference($value) + * @method static \Illuminate\Database\Eloquent\Builder|Payment whereTypeId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Payment whereUpdatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Payment whereUserId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Payment whereVendorId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Payment withTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|Payment withoutTrashed() + * @mixin \Eloquent + */ class Payment extends BaseModel { use MakesHash; diff --git a/app/Models/PaymentHash.php b/app/Models/PaymentHash.php index 96396a65379f..555eae5e6558 100644 --- a/app/Models/PaymentHash.php +++ b/app/Models/PaymentHash.php @@ -13,6 +13,32 @@ namespace App\Models; use Illuminate\Database\Eloquent\Model; +/** + * App\Models\PaymentHash + * + * @property int $id + * @property string $hash + * @property string $fee_total + * @property int|null $fee_invoice_id + * @property object $data + * @property int|null $payment_id + * @property \Illuminate\Support\Carbon|null $created_at + * @property \Illuminate\Support\Carbon|null $updated_at + * @property-read \App\Models\Invoice|null $fee_invoice + * @property-read \App\Models\Payment|null $payment + * @method static \Illuminate\Database\Eloquent\Builder|PaymentHash newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|PaymentHash newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|PaymentHash query() + * @method static \Illuminate\Database\Eloquent\Builder|PaymentHash whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|PaymentHash whereData($value) + * @method static \Illuminate\Database\Eloquent\Builder|PaymentHash whereFeeInvoiceId($value) + * @method static \Illuminate\Database\Eloquent\Builder|PaymentHash whereFeeTotal($value) + * @method static \Illuminate\Database\Eloquent\Builder|PaymentHash whereHash($value) + * @method static \Illuminate\Database\Eloquent\Builder|PaymentHash whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|PaymentHash wherePaymentId($value) + * @method static \Illuminate\Database\Eloquent\Builder|PaymentHash whereUpdatedAt($value) + * @mixin \Eloquent + */ class PaymentHash extends Model { protected $guarded = ['id']; diff --git a/app/Models/PaymentLibrary.php b/app/Models/PaymentLibrary.php index 45d38858b22a..cd135e5c900d 100644 --- a/app/Models/PaymentLibrary.php +++ b/app/Models/PaymentLibrary.php @@ -13,6 +13,25 @@ namespace App\Models; /** * Class PaymentLibrary. + * + * @property int $id + * @property int|null $created_at + * @property int|null $updated_at + * @property string|null $name + * @property bool $visible + * @property-read mixed $hashed_id + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel company() + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel exclude($columns) + * @method static \Illuminate\Database\Eloquent\Builder|PaymentLibrary newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|PaymentLibrary newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|PaymentLibrary query() + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope() + * @method static \Illuminate\Database\Eloquent\Builder|PaymentLibrary whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|PaymentLibrary whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|PaymentLibrary whereName($value) + * @method static \Illuminate\Database\Eloquent\Builder|PaymentLibrary whereUpdatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|PaymentLibrary whereVisible($value) + * @mixin \Eloquent */ class PaymentLibrary extends BaseModel { diff --git a/app/Models/PaymentTerm.php b/app/Models/PaymentTerm.php index 28240282d320..d7edf3fa4a27 100644 --- a/app/Models/PaymentTerm.php +++ b/app/Models/PaymentTerm.php @@ -15,6 +15,37 @@ use Illuminate\Database\Eloquent\SoftDeletes; /** * Class PaymentTerm. + * + * @property int $id + * @property int|null $num_days + * @property string|null $name + * @property int|null $company_id + * @property int|null $user_id + * @property int $is_deleted + * @property int|null $created_at + * @property int|null $updated_at + * @property int|null $deleted_at + * @property-read mixed $hashed_id + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel company() + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel exclude($columns) + * @method static \Illuminate\Database\Eloquent\Builder|PaymentTerm filter(\App\Filters\QueryFilters $filters) + * @method static \Illuminate\Database\Eloquent\Builder|PaymentTerm newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|PaymentTerm newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|PaymentTerm onlyTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|PaymentTerm query() + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope() + * @method static \Illuminate\Database\Eloquent\Builder|PaymentTerm whereCompanyId($value) + * @method static \Illuminate\Database\Eloquent\Builder|PaymentTerm whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|PaymentTerm whereDeletedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|PaymentTerm whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|PaymentTerm whereIsDeleted($value) + * @method static \Illuminate\Database\Eloquent\Builder|PaymentTerm whereName($value) + * @method static \Illuminate\Database\Eloquent\Builder|PaymentTerm whereNumDays($value) + * @method static \Illuminate\Database\Eloquent\Builder|PaymentTerm whereUpdatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|PaymentTerm whereUserId($value) + * @method static \Illuminate\Database\Eloquent\Builder|PaymentTerm withTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|PaymentTerm withoutTrashed() + * @mixin \Eloquent */ class PaymentTerm extends BaseModel { diff --git a/app/Models/PaymentType.php b/app/Models/PaymentType.php index 9c2359981ea5..298d17e53e33 100644 --- a/app/Models/PaymentType.php +++ b/app/Models/PaymentType.php @@ -11,6 +11,22 @@ namespace App\Models; +/** + * App\Models\PaymentType + * + * @property int $id + * @property string $name + * @property int|null $gateway_type_id + * @method static \Illuminate\Database\Eloquent\Builder|StaticModel company() + * @method static \Illuminate\Database\Eloquent\Builder|StaticModel exclude($columns) + * @method static \Illuminate\Database\Eloquent\Builder|PaymentType newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|PaymentType newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|PaymentType query() + * @method static \Illuminate\Database\Eloquent\Builder|PaymentType whereGatewayTypeId($value) + * @method static \Illuminate\Database\Eloquent\Builder|PaymentType whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|PaymentType whereName($value) + * @mixin \Eloquent + */ class PaymentType extends StaticModel { /** diff --git a/app/Models/Paymentable.php b/app/Models/Paymentable.php index 0a6df1e8fbd2..81aaf23fb413 100644 --- a/app/Models/Paymentable.php +++ b/app/Models/Paymentable.php @@ -14,6 +14,37 @@ namespace App\Models; use Illuminate\Database\Eloquent\Relations\Pivot; use Illuminate\Database\Eloquent\SoftDeletes; +/** + * App\Models\Paymentable + * + * @property int $id + * @property int $payment_id + * @property int $paymentable_id + * @property string $amount + * @property string $refunded + * @property string $paymentable_type + * @property int|null $created_at + * @property int|null $updated_at + * @property int|null $deleted_at + * @property-read \App\Models\Payment $payment + * @property-read \Illuminate\Database\Eloquent\Model|\Eloquent $paymentable + * @method static \Illuminate\Database\Eloquent\Builder|Paymentable newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Paymentable newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Paymentable onlyTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|Paymentable query() + * @method static \Illuminate\Database\Eloquent\Builder|Paymentable whereAmount($value) + * @method static \Illuminate\Database\Eloquent\Builder|Paymentable whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Paymentable whereDeletedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Paymentable whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Paymentable wherePaymentId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Paymentable wherePaymentableId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Paymentable wherePaymentableType($value) + * @method static \Illuminate\Database\Eloquent\Builder|Paymentable whereRefunded($value) + * @method static \Illuminate\Database\Eloquent\Builder|Paymentable whereUpdatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Paymentable withTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|Paymentable withoutTrashed() + * @mixin \Eloquent + */ class Paymentable extends Pivot { use SoftDeletes; diff --git a/app/Models/Product.php b/app/Models/Product.php index 6e42030223c7..80e64f57d0d5 100644 --- a/app/Models/Product.php +++ b/app/Models/Product.php @@ -15,6 +15,89 @@ use App\Utils\Traits\MakesHash; use League\CommonMark\CommonMarkConverter; use Illuminate\Database\Eloquent\SoftDeletes; +/** + * App\Models\Product + * + * @property int $id + * @property int $company_id + * @property int $user_id + * @property int|null $assigned_user_id + * @property int|null $project_id + * @property int|null $vendor_id + * @property string|null $custom_value1 + * @property string|null $custom_value2 + * @property string|null $custom_value3 + * @property string|null $custom_value4 + * @property string|null $product_key + * @property string|null $notes + * @property string $cost + * @property string $price + * @property string $quantity + * @property string|null $tax_name1 + * @property string $tax_rate1 + * @property string|null $tax_name2 + * @property string $tax_rate2 + * @property string|null $tax_name3 + * @property string $tax_rate3 + * @property int|null $deleted_at + * @property int|null $created_at + * @property int|null $updated_at + * @property int $is_deleted + * @property int $in_stock_quantity + * @property int $stock_notification + * @property int $stock_notification_threshold + * @property int|null $max_quantity + * @property string|null $product_image + * @property-read \App\Models\User|null $assigned_user + * @property-read \App\Models\Company $company + * @property-read \Illuminate\Database\Eloquent\Collection $documents + * @property-read int|null $documents_count + * @property-read mixed $hashed_id + * @property-read \App\Models\User $user + * @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() + * @mixin \Eloquent + */ class Product extends BaseModel { use MakesHash; diff --git a/app/Models/Project.php b/app/Models/Project.php index 99691cf5531b..30b3e82f5677 100644 --- a/app/Models/Project.php +++ b/app/Models/Project.php @@ -8,6 +8,71 @@ use Laracasts\Presenter\PresentableTrait; /** * Class Project. + * + * @property int $id + * @property int $user_id + * @property int|null $assigned_user_id + * @property int $company_id + * @property int|null $client_id + * @property string $name + * @property string $task_rate + * @property string|null $due_date + * @property string|null $private_notes + * @property string $budgeted_hours + * @property string|null $custom_value1 + * @property string|null $custom_value2 + * @property string|null $custom_value3 + * @property string|null $custom_value4 + * @property int|null $created_at + * @property int|null $updated_at + * @property int|null $deleted_at + * @property string|null $public_notes + * @property int $is_deleted + * @property string|null $number + * @property string $color + * @property-read \App\Models\Client|null $client + * @property-read \App\Models\Company $company + * @property-read \Illuminate\Database\Eloquent\Collection $documents + * @property-read int|null $documents_count + * @property-read mixed $hashed_id + * @property-read Project|null $project + * @property-read \Illuminate\Database\Eloquent\Collection $tasks + * @property-read int|null $tasks_count + * @property-read \App\Models\User $user + * @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\ProjectFactory factory($count = null, $state = []) + * @method static \Illuminate\Database\Eloquent\Builder|Project filter(\App\Filters\QueryFilters $filters) + * @method static \Illuminate\Database\Eloquent\Builder|Project newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Project newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Project onlyTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|Project query() + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope() + * @method static \Illuminate\Database\Eloquent\Builder|Project whereAssignedUserId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Project whereBudgetedHours($value) + * @method static \Illuminate\Database\Eloquent\Builder|Project whereClientId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Project whereColor($value) + * @method static \Illuminate\Database\Eloquent\Builder|Project whereCompanyId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Project whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Project whereCustomValue1($value) + * @method static \Illuminate\Database\Eloquent\Builder|Project whereCustomValue2($value) + * @method static \Illuminate\Database\Eloquent\Builder|Project whereCustomValue3($value) + * @method static \Illuminate\Database\Eloquent\Builder|Project whereCustomValue4($value) + * @method static \Illuminate\Database\Eloquent\Builder|Project whereDeletedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Project whereDueDate($value) + * @method static \Illuminate\Database\Eloquent\Builder|Project whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Project whereIsDeleted($value) + * @method static \Illuminate\Database\Eloquent\Builder|Project whereName($value) + * @method static \Illuminate\Database\Eloquent\Builder|Project whereNumber($value) + * @method static \Illuminate\Database\Eloquent\Builder|Project wherePrivateNotes($value) + * @method static \Illuminate\Database\Eloquent\Builder|Project wherePublicNotes($value) + * @method static \Illuminate\Database\Eloquent\Builder|Project whereTaskRate($value) + * @method static \Illuminate\Database\Eloquent\Builder|Project whereUpdatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Project whereUserId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Project withTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|Project withoutTrashed() + * @mixin \Eloquent */ class Project extends BaseModel { diff --git a/app/Models/Proposal.php b/app/Models/Proposal.php index e0b73498e3d2..041d907d56db 100644 --- a/app/Models/Proposal.php +++ b/app/Models/Proposal.php @@ -13,6 +13,23 @@ namespace App\Models; use App\Utils\Traits\MakesHash; +/** + * App\Models\Proposal + * + * @property-read \App\Models\User|null $assigned_user + * @property-read \Illuminate\Database\Eloquent\Collection $documents + * @property-read int|null $documents_count + * @property-read mixed $hashed_id + * @property-read mixed $proposal_id + * @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|Proposal newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Proposal newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Proposal query() + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope() + * @mixin \Eloquent + */ class Proposal extends BaseModel { use MakesHash; diff --git a/app/Models/PurchaseOrder.php b/app/Models/PurchaseOrder.php index ec01acec204e..8d9551541055 100644 --- a/app/Models/PurchaseOrder.php +++ b/app/Models/PurchaseOrder.php @@ -21,6 +21,167 @@ use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Support\Carbon; use Illuminate\Support\Facades\Storage; +/** + * App\Models\PurchaseOrder + * + * @property int $id + * @property int|null $client_id + * @property int $user_id + * @property int|null $assigned_user_id + * @property int $company_id + * @property int $status_id + * @property int|null $project_id + * @property int|null $vendor_id + * @property int|null $recurring_id + * @property int|null $design_id + * @property int|null $invoice_id + * @property string|null $number + * @property float $discount + * @property bool $is_amount_discount + * @property string|null $po_number + * @property string|null $date + * @property string|null $last_sent_date + * @property string|null $due_date + * @property int $is_deleted + * @property object|null $line_items + * @property object|null $backup + * @property string|null $footer + * @property string|null $public_notes + * @property string|null $private_notes + * @property string|null $terms + * @property string|null $tax_name1 + * @property string $tax_rate1 + * @property string|null $tax_name2 + * @property string $tax_rate2 + * @property string|null $tax_name3 + * @property string $tax_rate3 + * @property string $total_taxes + * @property int $uses_inclusive_taxes + * @property string|null $reminder1_sent + * @property string|null $reminder2_sent + * @property string|null $reminder3_sent + * @property string|null $reminder_last_sent + * @property string|null $custom_value1 + * @property string|null $custom_value2 + * @property string|null $custom_value3 + * @property string|null $custom_value4 + * @property string|null $next_send_date + * @property string|null $custom_surcharge1 + * @property string|null $custom_surcharge2 + * @property string|null $custom_surcharge3 + * @property string|null $custom_surcharge4 + * @property int $custom_surcharge_tax1 + * @property int $custom_surcharge_tax2 + * @property int $custom_surcharge_tax3 + * @property int $custom_surcharge_tax4 + * @property string $exchange_rate + * @property string $balance + * @property string|null $partial + * @property string $amount + * @property string $paid_to_date + * @property string|null $partial_due_date + * @property string|null $last_viewed + * @property int|null $deleted_at + * @property int|null $created_at + * @property int|null $updated_at + * @property int|null $expense_id + * @property int|null $currency_id + * @property-read \Illuminate\Database\Eloquent\Collection $activities + * @property-read int|null $activities_count + * @property-read \App\Models\User|null $assigned_user + * @property-read \App\Models\Client|null $client + * @property-read \App\Models\Company $company + * @property-read \Illuminate\Database\Eloquent\Collection $documents + * @property-read int|null $documents_count + * @property-read \App\Models\Expense|null $expense + * @property-read mixed $hashed_id + * @property-read \Illuminate\Database\Eloquent\Collection $history + * @property-read int|null $history_count + * @property-read \Illuminate\Database\Eloquent\Collection $invitations + * @property-read int|null $invitations_count + * @property-read \App\Models\Invoice|null $invoice + * @property-read \Illuminate\Database\Eloquent\Collection $invoices + * @property-read int|null $invoices_count + * @property-read \Illuminate\Database\Eloquent\Collection $payments + * @property-read int|null $payments_count + * @property-read \App\Models\Project|null $project + * @property-read \App\Models\User $user + * @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\PurchaseOrderFactory factory($count = null, $state = []) + * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder filter(\App\Filters\QueryFilters $filters) + * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder onlyTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder query() + * @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() + * @mixin \Eloquent + */ class PurchaseOrder extends BaseModel { use Filterable; diff --git a/app/Models/PurchaseOrderInvitation.php b/app/Models/PurchaseOrderInvitation.php index 4de45c020f7d..c83a20aa25f2 100644 --- a/app/Models/PurchaseOrderInvitation.php +++ b/app/Models/PurchaseOrderInvitation.php @@ -18,6 +18,62 @@ use Carbon\Carbon; use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Support\Str; +/** + * App\Models\PurchaseOrderInvitation + * + * @property int $id + * @property int $company_id + * @property int $user_id + * @property int $vendor_contact_id + * @property int $purchase_order_id + * @property string $key + * @property string|null $transaction_reference + * @property string|null $message_id + * @property string|null $email_error + * @property string|null $signature_base64 + * @property string|null $signature_date + * @property string|null $sent_date + * @property string|null $viewed_date + * @property string|null $opened_date + * @property int|null $created_at + * @property int|null $updated_at + * @property int|null $deleted_at + * @property string|null $email_status + * @property-read \App\Models\Company $company + * @property-read \App\Models\VendorContact $contact + * @property-read mixed $hashed_id + * @property-read \App\Models\PurchaseOrder $purchase_order + * @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 \Database\Factories\PurchaseOrderInvitationFactory factory($count = null, $state = []) + * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrderInvitation newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrderInvitation newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrderInvitation onlyTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrderInvitation query() + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope() + * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrderInvitation whereCompanyId($value) + * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrderInvitation whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrderInvitation whereDeletedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrderInvitation whereEmailError($value) + * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrderInvitation whereEmailStatus($value) + * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrderInvitation whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrderInvitation whereKey($value) + * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrderInvitation whereMessageId($value) + * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrderInvitation whereOpenedDate($value) + * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrderInvitation wherePurchaseOrderId($value) + * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrderInvitation whereSentDate($value) + * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrderInvitation whereSignatureBase64($value) + * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrderInvitation whereSignatureDate($value) + * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrderInvitation whereTransactionReference($value) + * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrderInvitation whereUpdatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrderInvitation whereUserId($value) + * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrderInvitation whereVendorContactId($value) + * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrderInvitation whereViewedDate($value) + * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrderInvitation withTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrderInvitation withoutTrashed() + * @mixin \Eloquent + */ class PurchaseOrderInvitation extends BaseModel { use MakesDates; diff --git a/app/Models/Quote.php b/app/Models/Quote.php index f0e35a5c57e3..c27d0d6b64be 100644 --- a/app/Models/Quote.php +++ b/app/Models/Quote.php @@ -26,6 +26,163 @@ use Illuminate\Support\Carbon; use Illuminate\Support\Facades\Storage; use Laracasts\Presenter\PresentableTrait; +/** + * App\Models\Quote + * + * @property int $id + * @property int $client_id + * @property int $user_id + * @property int|null $assigned_user_id + * @property int $company_id + * @property int $status_id + * @property int|null $project_id + * @property int|null $vendor_id + * @property int|null $recurring_id + * @property int|null $design_id + * @property int|null $invoice_id + * @property string|null $number + * @property float $discount + * @property bool $is_amount_discount + * @property string|null $po_number + * @property string|null $date + * @property string|null $last_sent_date + * @property string|null $due_date + * @property string|null $next_send_date + * @property bool $is_deleted + * @property object|null $line_items + * @property object|null $backup + * @property string|null $footer + * @property string|null $public_notes + * @property string|null $private_notes + * @property string|null $terms + * @property string|null $tax_name1 + * @property string $tax_rate1 + * @property string|null $tax_name2 + * @property string $tax_rate2 + * @property string|null $tax_name3 + * @property string $tax_rate3 + * @property string $total_taxes + * @property int $uses_inclusive_taxes + * @property string|null $custom_value1 + * @property string|null $custom_value2 + * @property string|null $custom_value3 + * @property string|null $custom_value4 + * @property string|null $custom_surcharge1 + * @property string|null $custom_surcharge2 + * @property string|null $custom_surcharge3 + * @property string|null $custom_surcharge4 + * @property int $custom_surcharge_tax1 + * @property int $custom_surcharge_tax2 + * @property int $custom_surcharge_tax3 + * @property int $custom_surcharge_tax4 + * @property string $exchange_rate + * @property string $amount + * @property string $balance + * @property string|null $partial + * @property string|null $partial_due_date + * @property string|null $last_viewed + * @property int|null $created_at + * @property int|null $updated_at + * @property int|null $deleted_at + * @property string|null $reminder1_sent + * @property string|null $reminder2_sent + * @property string|null $reminder3_sent + * @property string|null $reminder_last_sent + * @property string $paid_to_date + * @property int|null $subscription_id + * @property-read \Illuminate\Database\Eloquent\Collection $activities + * @property-read int|null $activities_count + * @property-read \App\Models\User|null $assigned_user + * @property-read \App\Models\Client $client + * @property-read \App\Models\Company $company + * @property-read \Illuminate\Database\Eloquent\Collection $documents + * @property-read int|null $documents_count + * @property-read mixed $balance_due + * @property-read mixed $hashed_id + * @property-read mixed $total + * @property-read mixed $valid_until + * @property-read \Illuminate\Database\Eloquent\Collection $history + * @property-read int|null $history_count + * @property-read \Illuminate\Database\Eloquent\Collection $invitations + * @property-read int|null $invitations_count + * @property-read \App\Models\Invoice|null $invoice + * @property-read \App\Models\Project|null $project + * @property-read \App\Models\User $user + * @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() + * @mixin \Eloquent + */ class Quote extends BaseModel { use MakesHash; diff --git a/app/Models/QuoteInvitation.php b/app/Models/QuoteInvitation.php index d1b645ba4365..6bfc589b76ae 100644 --- a/app/Models/QuoteInvitation.php +++ b/app/Models/QuoteInvitation.php @@ -19,6 +19,64 @@ use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Support\Carbon; use Illuminate\Support\Facades\Storage; +/** + * App\Models\QuoteInvitation + * + * @property int $id + * @property int $company_id + * @property int $user_id + * @property int $client_contact_id + * @property int $quote_id + * @property string $key + * @property string|null $transaction_reference + * @property string|null $message_id + * @property string|null $email_error + * @property string|null $signature_base64 + * @property string|null $signature_date + * @property string|null $sent_date + * @property string|null $viewed_date + * @property string|null $opened_date + * @property int|null $created_at + * @property int|null $updated_at + * @property int|null $deleted_at + * @property string|null $signature_ip + * @property string|null $email_status + * @property-read \App\Models\Company $company + * @property-read \App\Models\ClientContact $contact + * @property-read mixed $hashed_id + * @property-read \App\Models\Quote $quote + * @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 \Database\Factories\QuoteInvitationFactory factory($count = null, $state = []) + * @method static \Illuminate\Database\Eloquent\Builder|QuoteInvitation newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|QuoteInvitation newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|QuoteInvitation onlyTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|QuoteInvitation query() + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope() + * @method static \Illuminate\Database\Eloquent\Builder|QuoteInvitation whereClientContactId($value) + * @method static \Illuminate\Database\Eloquent\Builder|QuoteInvitation whereCompanyId($value) + * @method static \Illuminate\Database\Eloquent\Builder|QuoteInvitation whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|QuoteInvitation whereDeletedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|QuoteInvitation whereEmailError($value) + * @method static \Illuminate\Database\Eloquent\Builder|QuoteInvitation whereEmailStatus($value) + * @method static \Illuminate\Database\Eloquent\Builder|QuoteInvitation whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|QuoteInvitation whereKey($value) + * @method static \Illuminate\Database\Eloquent\Builder|QuoteInvitation whereMessageId($value) + * @method static \Illuminate\Database\Eloquent\Builder|QuoteInvitation whereOpenedDate($value) + * @method static \Illuminate\Database\Eloquent\Builder|QuoteInvitation whereQuoteId($value) + * @method static \Illuminate\Database\Eloquent\Builder|QuoteInvitation whereSentDate($value) + * @method static \Illuminate\Database\Eloquent\Builder|QuoteInvitation whereSignatureBase64($value) + * @method static \Illuminate\Database\Eloquent\Builder|QuoteInvitation whereSignatureDate($value) + * @method static \Illuminate\Database\Eloquent\Builder|QuoteInvitation whereSignatureIp($value) + * @method static \Illuminate\Database\Eloquent\Builder|QuoteInvitation whereTransactionReference($value) + * @method static \Illuminate\Database\Eloquent\Builder|QuoteInvitation whereUpdatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|QuoteInvitation whereUserId($value) + * @method static \Illuminate\Database\Eloquent\Builder|QuoteInvitation whereViewedDate($value) + * @method static \Illuminate\Database\Eloquent\Builder|QuoteInvitation withTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|QuoteInvitation withoutTrashed() + * @mixin \Eloquent + */ class QuoteInvitation extends BaseModel { use MakesDates; diff --git a/app/Models/RecurringExpense.php b/app/Models/RecurringExpense.php index 502a568409e7..841be99b7afe 100644 --- a/app/Models/RecurringExpense.php +++ b/app/Models/RecurringExpense.php @@ -15,6 +15,132 @@ use App\Services\Recurring\RecurringService; use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Support\Carbon; +/** + * App\Models\RecurringExpense + * + * @property int $id + * @property int|null $created_at + * @property int|null $updated_at + * @property int|null $deleted_at + * @property int $company_id + * @property int|null $vendor_id + * @property int $user_id + * @property int $status_id + * @property int|null $invoice_id + * @property int|null $client_id + * @property int|null $bank_id + * @property int|null $project_id + * @property int|null $payment_type_id + * @property int|null $recurring_expense_id + * @property bool $is_deleted + * @property int $uses_inclusive_taxes + * @property string|null $tax_name1 + * @property string|null $tax_name2 + * @property string|null $tax_name3 + * @property string|null $date + * @property string|null $payment_date + * @property int $should_be_invoiced + * @property int $invoice_documents + * @property string|null $transaction_id + * @property string|null $custom_value1 + * @property string|null $custom_value2 + * @property string|null $custom_value3 + * @property string|null $custom_value4 + * @property int|null $category_id + * @property int $calculate_tax_by_amount + * @property string|null $tax_amount1 + * @property string|null $tax_amount2 + * @property string|null $tax_amount3 + * @property string|null $tax_rate1 + * @property string|null $tax_rate2 + * @property string|null $tax_rate3 + * @property string|null $amount + * @property string|null $foreign_amount + * @property string $exchange_rate + * @property int|null $assigned_user_id + * @property string|null $number + * @property int|null $invoice_currency_id + * @property int|null $currency_id + * @property string|null $private_notes + * @property string|null $public_notes + * @property string|null $transaction_reference + * @property int $frequency_id + * @property string|null $last_sent_date + * @property string|null $next_send_date + * @property int|null $remaining_cycles + * @property string|null $next_send_date_client + * @property-read \App\Models\User|null $assigned_user + * @property-read \App\Models\Client|null $client + * @property-read \App\Models\Company $company + * @property-read \Illuminate\Database\Eloquent\Collection $documents + * @property-read int|null $documents_count + * @property-read mixed $hashed_id + * @property-read \App\Models\User $user + * @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\RecurringExpenseFactory factory($count = null, $state = []) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense filter(\App\Filters\QueryFilters $filters) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense onlyTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense query() + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope() + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense whereAmount($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense whereAssignedUserId($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense whereBankId($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense whereCalculateTaxByAmount($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense whereCategoryId($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense whereClientId($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense whereCompanyId($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense whereCurrencyId($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense whereCustomValue1($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense whereCustomValue2($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense whereCustomValue3($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense whereCustomValue4($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense whereDate($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense whereDeletedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense whereExchangeRate($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense whereForeignAmount($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense whereFrequencyId($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense whereInvoiceCurrencyId($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense whereInvoiceDocuments($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense whereInvoiceId($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense whereIsDeleted($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense whereLastSentDate($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense whereNextSendDate($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense whereNextSendDateClient($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense whereNumber($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense wherePaymentDate($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense wherePaymentTypeId($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense wherePrivateNotes($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense whereProjectId($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense wherePublicNotes($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense whereRecurringExpenseId($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense whereRemainingCycles($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense whereShouldBeInvoiced($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense whereStatusId($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense whereTaxAmount1($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense whereTaxAmount2($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense whereTaxAmount3($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense whereTaxName1($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense whereTaxName2($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense whereTaxName3($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense whereTaxRate1($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense whereTaxRate2($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense whereTaxRate3($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense whereTransactionId($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense whereTransactionReference($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense whereUpdatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense whereUserId($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense whereUsesInclusiveTaxes($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense whereVendorId($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense withTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|RecurringExpense withoutTrashed() + * @mixin \Eloquent + */ class RecurringExpense extends BaseModel { use SoftDeletes; diff --git a/app/Models/RecurringInvoice.php b/app/Models/RecurringInvoice.php index a5b78f379627..f95a941723f0 100644 --- a/app/Models/RecurringInvoice.php +++ b/app/Models/RecurringInvoice.php @@ -24,6 +24,160 @@ use Laracasts\Presenter\PresentableTrait; /** * Class for Recurring Invoices. + * + * @property int $id + * @property int $client_id + * @property int $user_id + * @property int|null $assigned_user_id + * @property int $company_id + * @property int|null $project_id + * @property int|null $vendor_id + * @property int $status_id + * @property string|null $number + * @property float $discount + * @property int $is_amount_discount + * @property string|null $po_number + * @property string|null $date + * @property string|null $due_date + * @property int $is_deleted + * @property object|null $line_items + * @property object|null $backup + * @property string|null $footer + * @property string|null $public_notes + * @property string|null $private_notes + * @property string|null $terms + * @property string|null $tax_name1 + * @property string $tax_rate1 + * @property string|null $tax_name2 + * @property string $tax_rate2 + * @property string|null $tax_name3 + * @property string $tax_rate3 + * @property string $total_taxes + * @property string|null $custom_value1 + * @property string|null $custom_value2 + * @property string|null $custom_value3 + * @property string|null $custom_value4 + * @property string $amount + * @property string $balance + * @property string|null $partial + * @property string|null $last_viewed + * @property int $frequency_id + * @property string|null $last_sent_date + * @property string|null $next_send_date + * @property int|null $remaining_cycles + * @property int|null $created_at + * @property int|null $updated_at + * @property int|null $deleted_at + * @property string $auto_bill + * @property int $auto_bill_enabled + * @property int|null $design_id + * @property int $uses_inclusive_taxes + * @property string|null $custom_surcharge1 + * @property string|null $custom_surcharge2 + * @property string|null $custom_surcharge3 + * @property string|null $custom_surcharge4 + * @property int $custom_surcharge_tax1 + * @property int $custom_surcharge_tax2 + * @property int $custom_surcharge_tax3 + * @property int $custom_surcharge_tax4 + * @property string|null $due_date_days + * @property string|null $partial_due_date + * @property string $exchange_rate + * @property string $paid_to_date + * @property int|null $subscription_id + * @property string|null $next_send_date_client + * @property-read \Illuminate\Database\Eloquent\Collection $activities + * @property-read int|null $activities_count + * @property-read \App\Models\User|null $assigned_user + * @property-read \App\Models\Client $client + * @property-read \App\Models\Company $company + * @property-read \Illuminate\Database\Eloquent\Collection $documents + * @property-read int|null $documents_count + * @property-read mixed $hashed_id + * @property-read mixed $status + * @property-read \Illuminate\Database\Eloquent\Collection $history + * @property-read int|null $history_count + * @property-read \Illuminate\Database\Eloquent\Collection $invitations + * @property-read int|null $invitations_count + * @property-read \Illuminate\Database\Eloquent\Collection $invoices + * @property-read int|null $invoices_count + * @property-read \App\Models\Project|null $project + * @property-read \App\Models\Subscription|null $subscription + * @property-read \App\Models\User $user + * @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\RecurringInvoiceFactory factory($count = null, $state = []) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice filter(\App\Filters\QueryFilters $filters) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice onlyTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice query() + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope() + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereAmount($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereAssignedUserId($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereAutoBill($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereAutoBillEnabled($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereBackup($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereBalance($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereClientId($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereCompanyId($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereCustomSurcharge1($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereCustomSurcharge2($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereCustomSurcharge3($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereCustomSurcharge4($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereCustomSurchargeTax1($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereCustomSurchargeTax2($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereCustomSurchargeTax3($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereCustomSurchargeTax4($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereCustomValue1($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereCustomValue2($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereCustomValue3($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereCustomValue4($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereDate($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereDeletedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereDesignId($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereDiscount($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereDueDate($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereDueDateDays($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereExchangeRate($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereFooter($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereFrequencyId($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereIsAmountDiscount($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereIsDeleted($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereLastSentDate($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereLastViewed($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereLineItems($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereNextSendDate($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereNextSendDateClient($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereNumber($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice wherePaidToDate($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice wherePartial($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice wherePartialDueDate($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice wherePoNumber($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice wherePrivateNotes($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereProjectId($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice wherePublicNotes($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereRemainingCycles($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereStatusId($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereSubscriptionId($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereTaxName1($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereTaxName2($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereTaxName3($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereTaxRate1($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereTaxRate2($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereTaxRate3($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereTerms($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereTotalTaxes($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereUpdatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereUserId($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereUsesInclusiveTaxes($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice whereVendorId($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice withTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoice withoutTrashed() + * @mixin \Eloquent */ class RecurringInvoice extends BaseModel { diff --git a/app/Models/RecurringInvoiceInvitation.php b/app/Models/RecurringInvoiceInvitation.php index b7b3de9fbe6f..922b8ba6de74 100644 --- a/app/Models/RecurringInvoiceInvitation.php +++ b/app/Models/RecurringInvoiceInvitation.php @@ -16,6 +16,61 @@ use App\Utils\Traits\MakesDates; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\SoftDeletes; +/** + * App\Models\RecurringInvoiceInvitation + * + * @property int $id + * @property int $company_id + * @property int $user_id + * @property int $client_contact_id + * @property int $recurring_invoice_id + * @property string $key + * @property int|null $created_at + * @property int|null $updated_at + * @property int|null $deleted_at + * @property string|null $transaction_reference + * @property string|null $message_id + * @property string|null $email_error + * @property string|null $signature_base64 + * @property string|null $signature_date + * @property string|null $sent_date + * @property string|null $viewed_date + * @property string|null $opened_date + * @property string|null $email_status + * @property-read \App\Models\Company $company + * @property-read \App\Models\ClientContact $contact + * @property-read mixed $hashed_id + * @property-read \App\Models\RecurringInvoice $recurring_invoice + * @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|RecurringInvoiceInvitation newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoiceInvitation newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoiceInvitation onlyTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoiceInvitation query() + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope() + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoiceInvitation whereClientContactId($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoiceInvitation whereCompanyId($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoiceInvitation whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoiceInvitation whereDeletedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoiceInvitation whereEmailError($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoiceInvitation whereEmailStatus($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoiceInvitation whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoiceInvitation whereKey($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoiceInvitation whereMessageId($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoiceInvitation whereOpenedDate($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoiceInvitation whereRecurringInvoiceId($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoiceInvitation whereSentDate($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoiceInvitation whereSignatureBase64($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoiceInvitation whereSignatureDate($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoiceInvitation whereTransactionReference($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoiceInvitation whereUpdatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoiceInvitation whereUserId($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoiceInvitation whereViewedDate($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoiceInvitation withTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|RecurringInvoiceInvitation withoutTrashed() + * @mixin \Eloquent + */ class RecurringInvoiceInvitation extends BaseModel { use MakesDates; diff --git a/app/Models/RecurringQuote.php b/app/Models/RecurringQuote.php index 67d710942d0b..ce68c134dd50 100644 --- a/app/Models/RecurringQuote.php +++ b/app/Models/RecurringQuote.php @@ -24,6 +24,154 @@ use Laracasts\Presenter\PresentableTrait; /** * Class for Recurring Quotes. + * + * @property int $id + * @property int $client_id + * @property int $user_id + * @property int|null $assigned_user_id + * @property int $company_id + * @property int|null $project_id + * @property int|null $vendor_id + * @property int $status_id + * @property float $discount + * @property int $is_amount_discount + * @property string|null $number + * @property string|null $po_number + * @property string|null $date + * @property string|null $due_date + * @property int $is_deleted + * @property object|null $line_items + * @property object|null $backup + * @property string|null $footer + * @property string|null $public_notes + * @property string|null $private_notes + * @property string|null $terms + * @property string|null $tax_name1 + * @property string $tax_rate1 + * @property string|null $tax_name2 + * @property string $tax_rate2 + * @property string|null $tax_name3 + * @property string $tax_rate3 + * @property string $total_taxes + * @property string|null $custom_value1 + * @property string|null $custom_value2 + * @property string|null $custom_value3 + * @property string|null $custom_value4 + * @property string $amount + * @property string $balance + * @property string|null $last_viewed + * @property int $frequency_id + * @property string|null $last_sent_date + * @property string|null $next_send_date + * @property int|null $remaining_cycles + * @property int|null $created_at + * @property int|null $updated_at + * @property int|null $deleted_at + * @property string $auto_bill + * @property int $auto_bill_enabled + * @property string $paid_to_date + * @property string|null $custom_surcharge1 + * @property string|null $custom_surcharge2 + * @property string|null $custom_surcharge3 + * @property string|null $custom_surcharge4 + * @property int $custom_surcharge_tax1 + * @property int $custom_surcharge_tax2 + * @property int $custom_surcharge_tax3 + * @property int $custom_surcharge_tax4 + * @property string|null $due_date_days + * @property string $exchange_rate + * @property string|null $partial + * @property string|null $partial_due_date + * @property int|null $subscription_id + * @property int $uses_inclusive_taxes + * @property-read \Illuminate\Database\Eloquent\Collection $activities + * @property-read int|null $activities_count + * @property-read \App\Models\User|null $assigned_user + * @property-read \App\Models\Client $client + * @property-read \App\Models\Company $company + * @property-read \Illuminate\Database\Eloquent\Collection $documents + * @property-read int|null $documents_count + * @property-read mixed $hashed_id + * @property-read mixed $status + * @property-read \Illuminate\Database\Eloquent\Collection $history + * @property-read int|null $history_count + * @property-read \Illuminate\Database\Eloquent\Collection $invitations + * @property-read int|null $invitations_count + * @property-read \App\Models\Project|null $project + * @property-read \Illuminate\Database\Eloquent\Collection $quotes + * @property-read int|null $quotes_count + * @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 \Database\Factories\RecurringQuoteFactory factory($count = null, $state = []) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote filter(\App\Filters\QueryFilters $filters) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote onlyTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|RecurringQuote query() + * @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 withoutTrashed() + * @mixin \Eloquent */ class RecurringQuote extends BaseModel { diff --git a/app/Models/RecurringQuoteInvitation.php b/app/Models/RecurringQuoteInvitation.php index ea9888312250..0659e164076f 100644 --- a/app/Models/RecurringQuoteInvitation.php +++ b/app/Models/RecurringQuoteInvitation.php @@ -16,6 +16,61 @@ use App\Utils\Traits\MakesDates; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\SoftDeletes; +/** + * App\Models\RecurringQuoteInvitation + * + * @property int $id + * @property int $company_id + * @property int $user_id + * @property int $client_contact_id + * @property int $recurring_quote_id + * @property string $key + * @property string|null $transaction_reference + * @property string|null $message_id + * @property string|null $email_error + * @property string|null $signature_base64 + * @property string|null $signature_date + * @property string|null $sent_date + * @property string|null $viewed_date + * @property string|null $opened_date + * @property string|null $email_status + * @property int|null $created_at + * @property int|null $updated_at + * @property int|null $deleted_at + * @property-read \App\Models\Company $company + * @property-read \App\Models\ClientContact $contact + * @property-read mixed $hashed_id + * @property-read \App\Models\RecurringQuote $recurring_quote + * @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|RecurringQuoteInvitation newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|RecurringQuoteInvitation newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|RecurringQuoteInvitation onlyTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|RecurringQuoteInvitation query() + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope() + * @method static \Illuminate\Database\Eloquent\Builder|RecurringQuoteInvitation whereClientContactId($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringQuoteInvitation whereCompanyId($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringQuoteInvitation whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringQuoteInvitation whereDeletedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringQuoteInvitation whereEmailError($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringQuoteInvitation whereEmailStatus($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringQuoteInvitation whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringQuoteInvitation whereKey($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringQuoteInvitation whereMessageId($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringQuoteInvitation whereOpenedDate($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringQuoteInvitation whereRecurringQuoteId($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringQuoteInvitation whereSentDate($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringQuoteInvitation whereSignatureBase64($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringQuoteInvitation whereSignatureDate($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringQuoteInvitation whereTransactionReference($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringQuoteInvitation whereUpdatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringQuoteInvitation whereUserId($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringQuoteInvitation whereViewedDate($value) + * @method static \Illuminate\Database\Eloquent\Builder|RecurringQuoteInvitation withTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|RecurringQuoteInvitation withoutTrashed() + * @mixin \Eloquent + */ class RecurringQuoteInvitation extends BaseModel { use MakesDates; diff --git a/app/Models/Scheduler.php b/app/Models/Scheduler.php index 028b4fb6dbd4..f657dfee6a99 100644 --- a/app/Models/Scheduler.php +++ b/app/Models/Scheduler.php @@ -15,6 +15,8 @@ use App\Services\Scheduler\SchedulerService; use Illuminate\Database\Eloquent\SoftDeletes; /** + * App\Models\Scheduler + * * @property bool paused * @property bool is_deleted * @property \Carbon\Carbon|mixed start_from @@ -28,6 +30,50 @@ use Illuminate\Database\Eloquent\SoftDeletes; * @property mixed company * @property array parameters * @property string action_class + * @property int $id + * @property bool $is_deleted + * @property int|null $created_at + * @property int|null $updated_at + * @property int|null $deleted_at + * @property array|null $parameters + * @property int $company_id + * @property bool $is_paused + * @property int|null $frequency_id + * @property \Illuminate\Support\Carbon|null $next_run + * @property \Illuminate\Support\Carbon|null $next_run_client + * @property int $user_id + * @property string $name + * @property string $template + * @property int|null $remaining_cycles + * @property-read \App\Models\Company $company + * @property-read mixed $hashed_id + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel company() + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel exclude($columns) + * @method static \Database\Factories\SchedulerFactory factory($count = null, $state = []) + * @method static \Illuminate\Database\Eloquent\Builder|Scheduler filter(\App\Filters\QueryFilters $filters) + * @method static \Illuminate\Database\Eloquent\Builder|Scheduler newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Scheduler newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Scheduler onlyTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|Scheduler query() + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope() + * @method static \Illuminate\Database\Eloquent\Builder|Scheduler whereCompanyId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Scheduler whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Scheduler whereDeletedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Scheduler whereFrequencyId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Scheduler whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Scheduler whereIsDeleted($value) + * @method static \Illuminate\Database\Eloquent\Builder|Scheduler whereIsPaused($value) + * @method static \Illuminate\Database\Eloquent\Builder|Scheduler whereName($value) + * @method static \Illuminate\Database\Eloquent\Builder|Scheduler whereNextRun($value) + * @method static \Illuminate\Database\Eloquent\Builder|Scheduler whereNextRunClient($value) + * @method static \Illuminate\Database\Eloquent\Builder|Scheduler whereParameters($value) + * @method static \Illuminate\Database\Eloquent\Builder|Scheduler whereRemainingCycles($value) + * @method static \Illuminate\Database\Eloquent\Builder|Scheduler whereTemplate($value) + * @method static \Illuminate\Database\Eloquent\Builder|Scheduler whereUpdatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Scheduler whereUserId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Scheduler withTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|Scheduler withoutTrashed() + * @mixin \Eloquent */ class Scheduler extends BaseModel { diff --git a/app/Models/Size.php b/app/Models/Size.php index f7f5d92edfc6..9cc11fd79499 100644 --- a/app/Models/Size.php +++ b/app/Models/Size.php @@ -13,6 +13,17 @@ namespace App\Models; /** * Class Size. + * + * @property int $id + * @property string $name + * @method static \Illuminate\Database\Eloquent\Builder|StaticModel company() + * @method static \Illuminate\Database\Eloquent\Builder|StaticModel exclude($columns) + * @method static \Illuminate\Database\Eloquent\Builder|Size newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Size newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Size query() + * @method static \Illuminate\Database\Eloquent\Builder|Size whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Size whereName($value) + * @mixin \Eloquent */ class Size extends StaticModel { diff --git a/app/Models/StaticModel.php b/app/Models/StaticModel.php index b2c6ccf58506..64c366556773 100644 --- a/app/Models/StaticModel.php +++ b/app/Models/StaticModel.php @@ -16,6 +16,17 @@ use App\Utils\Traits\MakesHash; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\ModelNotFoundException as ModelNotFoundException; +/** + * App\Models\StaticModel + * + * @property-read mixed $id + * @method static \Illuminate\Database\Eloquent\Builder|StaticModel company() + * @method static \Illuminate\Database\Eloquent\Builder|StaticModel exclude($columns) + * @method static \Illuminate\Database\Eloquent\Builder|StaticModel newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|StaticModel newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|StaticModel query() + * @mixin \Eloquent + */ class StaticModel extends Model { use MakesHash; diff --git a/app/Models/Subscription.php b/app/Models/Subscription.php index a9c788be1162..1e2f67ce8ccd 100644 --- a/app/Models/Subscription.php +++ b/app/Models/Subscription.php @@ -15,6 +15,96 @@ use App\Services\Subscription\SubscriptionService; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\SoftDeletes; +/** + * App\Models\Subscription + * + * @property int $id + * @property int $user_id + * @property int|null $assigned_user_id + * @property int $company_id + * @property string|null $product_ids + * @property int|null $frequency_id + * @property string|null $auto_bill + * @property string|null $promo_code + * @property float $promo_discount + * @property int $is_amount_discount + * @property int $allow_cancellation + * @property int $per_seat_enabled + * @property int $min_seats_limit + * @property int $max_seats_limit + * @property int $trial_enabled + * @property int $trial_duration + * @property int $allow_query_overrides + * @property int $allow_plan_changes + * @property string|null $plan_map + * @property int|null $refund_period + * @property array $webhook_configuration + * @property int|null $deleted_at + * @property bool $is_deleted + * @property int|null $created_at + * @property int|null $updated_at + * @property int|null $currency_id + * @property string|null $recurring_product_ids + * @property string $name + * @property int|null $group_id + * @property string $price + * @property string $promo_price + * @property int $registration_required + * @property int $use_inventory_management + * @property string|null $optional_product_ids + * @property string|null $optional_recurring_product_ids + * @property-read \App\Models\Company $company + * @property-read mixed $hashed_id + * @property-read \App\Models\GroupSetting|null $group_settings + * @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 \Database\Factories\SubscriptionFactory factory($count = null, $state = []) + * @method static \Illuminate\Database\Eloquent\Builder|Subscription filter(\App\Filters\QueryFilters $filters) + * @method static \Illuminate\Database\Eloquent\Builder|Subscription newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Subscription newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Subscription onlyTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|Subscription query() + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope() + * @method static \Illuminate\Database\Eloquent\Builder|Subscription whereAllowCancellation($value) + * @method static \Illuminate\Database\Eloquent\Builder|Subscription whereAllowPlanChanges($value) + * @method static \Illuminate\Database\Eloquent\Builder|Subscription whereAllowQueryOverrides($value) + * @method static \Illuminate\Database\Eloquent\Builder|Subscription whereAssignedUserId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Subscription whereAutoBill($value) + * @method static \Illuminate\Database\Eloquent\Builder|Subscription whereCompanyId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Subscription whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Subscription whereCurrencyId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Subscription whereDeletedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Subscription whereFrequencyId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Subscription whereGroupId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Subscription whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Subscription whereIsAmountDiscount($value) + * @method static \Illuminate\Database\Eloquent\Builder|Subscription whereIsDeleted($value) + * @method static \Illuminate\Database\Eloquent\Builder|Subscription whereMaxSeatsLimit($value) + * @method static \Illuminate\Database\Eloquent\Builder|Subscription whereMinSeatsLimit($value) + * @method static \Illuminate\Database\Eloquent\Builder|Subscription whereName($value) + * @method static \Illuminate\Database\Eloquent\Builder|Subscription whereOptionalProductIds($value) + * @method static \Illuminate\Database\Eloquent\Builder|Subscription whereOptionalRecurringProductIds($value) + * @method static \Illuminate\Database\Eloquent\Builder|Subscription wherePerSeatEnabled($value) + * @method static \Illuminate\Database\Eloquent\Builder|Subscription wherePlanMap($value) + * @method static \Illuminate\Database\Eloquent\Builder|Subscription wherePrice($value) + * @method static \Illuminate\Database\Eloquent\Builder|Subscription whereProductIds($value) + * @method static \Illuminate\Database\Eloquent\Builder|Subscription wherePromoCode($value) + * @method static \Illuminate\Database\Eloquent\Builder|Subscription wherePromoDiscount($value) + * @method static \Illuminate\Database\Eloquent\Builder|Subscription wherePromoPrice($value) + * @method static \Illuminate\Database\Eloquent\Builder|Subscription whereRecurringProductIds($value) + * @method static \Illuminate\Database\Eloquent\Builder|Subscription whereRefundPeriod($value) + * @method static \Illuminate\Database\Eloquent\Builder|Subscription whereRegistrationRequired($value) + * @method static \Illuminate\Database\Eloquent\Builder|Subscription whereTrialDuration($value) + * @method static \Illuminate\Database\Eloquent\Builder|Subscription whereTrialEnabled($value) + * @method static \Illuminate\Database\Eloquent\Builder|Subscription whereUpdatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Subscription whereUseInventoryManagement($value) + * @method static \Illuminate\Database\Eloquent\Builder|Subscription whereUserId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Subscription whereWebhookConfiguration($value) + * @method static \Illuminate\Database\Eloquent\Builder|Subscription withTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|Subscription withoutTrashed() + * @mixin \Eloquent + */ class Subscription extends BaseModel { use HasFactory, SoftDeletes, Filterable; diff --git a/app/Models/SystemLog.php b/app/Models/SystemLog.php index ca509a65f8e5..e402d09f468e 100644 --- a/app/Models/SystemLog.php +++ b/app/Models/SystemLog.php @@ -15,6 +15,41 @@ use App\Utils\Traits\MakesHash; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; +/** + * App\Models\SystemLog + * + * @property int $id + * @property int $company_id + * @property int|null $user_id + * @property int|null $client_id + * @property int|null $category_id + * @property int|null $event_id + * @property int|null $type_id + * @property array $log + * @property int|null $created_at + * @property int|null $updated_at + * @property int|null $deleted_at + * @method static \Illuminate\Database\Eloquent\Builder|SystemLog company() + * @method static \Illuminate\Database\Eloquent\Builder|SystemLog filter(\App\Filters\QueryFilters $filters) + * @method static \Illuminate\Database\Eloquent\Builder|SystemLog newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|SystemLog newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|SystemLog onlyTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|SystemLog query() + * @method static \Illuminate\Database\Eloquent\Builder|SystemLog whereCategoryId($value) + * @method static \Illuminate\Database\Eloquent\Builder|SystemLog whereClientId($value) + * @method static \Illuminate\Database\Eloquent\Builder|SystemLog whereCompanyId($value) + * @method static \Illuminate\Database\Eloquent\Builder|SystemLog whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|SystemLog whereDeletedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|SystemLog whereEventId($value) + * @method static \Illuminate\Database\Eloquent\Builder|SystemLog whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|SystemLog whereLog($value) + * @method static \Illuminate\Database\Eloquent\Builder|SystemLog whereTypeId($value) + * @method static \Illuminate\Database\Eloquent\Builder|SystemLog whereUpdatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|SystemLog whereUserId($value) + * @method static \Illuminate\Database\Eloquent\Builder|SystemLog withTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|SystemLog withoutTrashed() + * @mixin \Eloquent + */ class SystemLog extends Model { use Filterable; diff --git a/app/Models/Task.php b/app/Models/Task.php index df0bfae988b6..6f52ff2a8745 100644 --- a/app/Models/Task.php +++ b/app/Models/Task.php @@ -15,6 +15,84 @@ use App\Utils\Traits\MakesHash; use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Support\Carbon; +/** + * App\Models\Task + * + * @property int $id + * @property int $user_id + * @property int|null $assigned_user_id + * @property int $company_id + * @property int|null $client_id + * @property int|null $invoice_id + * @property int|null $project_id + * @property int|null $status_id + * @property int|null $status_sort_order + * @property int|null $created_at + * @property int|null $updated_at + * @property int|null $deleted_at + * @property string|null $custom_value1 + * @property string|null $custom_value2 + * @property string|null $custom_value3 + * @property string|null $custom_value4 + * @property int|null $duration + * @property string|null $description + * @property int $is_deleted + * @property int $is_running + * @property string|null $time_log + * @property string|null $number + * @property string $rate + * @property int $invoice_documents + * @property int $is_date_based + * @property int|null $status_order + * @property-read \App\Models\User|null $assigned_user + * @property-read \App\Models\Client|null $client + * @property-read \App\Models\Company $company + * @property-read \Illuminate\Database\Eloquent\Collection $documents + * @property-read int|null $documents_count + * @property-read mixed $hashed_id + * @property-read \App\Models\Invoice|null $invoice + * @property-read \App\Models\Project|null $project + * @property-read \App\Models\TaskStatus|null $status + * @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 \Database\Factories\TaskFactory factory($count = null, $state = []) + * @method static \Illuminate\Database\Eloquent\Builder|Task filter(\App\Filters\QueryFilters $filters) + * @method static \Illuminate\Database\Eloquent\Builder|Task newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Task newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Task onlyTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|Task query() + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope() + * @method static \Illuminate\Database\Eloquent\Builder|Task whereAssignedUserId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Task whereClientId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Task whereCompanyId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Task whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Task whereCustomValue1($value) + * @method static \Illuminate\Database\Eloquent\Builder|Task whereCustomValue2($value) + * @method static \Illuminate\Database\Eloquent\Builder|Task whereCustomValue3($value) + * @method static \Illuminate\Database\Eloquent\Builder|Task whereCustomValue4($value) + * @method static \Illuminate\Database\Eloquent\Builder|Task whereDeletedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Task whereDescription($value) + * @method static \Illuminate\Database\Eloquent\Builder|Task whereDuration($value) + * @method static \Illuminate\Database\Eloquent\Builder|Task whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Task whereInvoiceDocuments($value) + * @method static \Illuminate\Database\Eloquent\Builder|Task whereInvoiceId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Task whereIsDateBased($value) + * @method static \Illuminate\Database\Eloquent\Builder|Task whereIsDeleted($value) + * @method static \Illuminate\Database\Eloquent\Builder|Task whereIsRunning($value) + * @method static \Illuminate\Database\Eloquent\Builder|Task whereNumber($value) + * @method static \Illuminate\Database\Eloquent\Builder|Task whereProjectId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Task whereRate($value) + * @method static \Illuminate\Database\Eloquent\Builder|Task whereStatusId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Task whereStatusOrder($value) + * @method static \Illuminate\Database\Eloquent\Builder|Task whereStatusSortOrder($value) + * @method static \Illuminate\Database\Eloquent\Builder|Task whereTimeLog($value) + * @method static \Illuminate\Database\Eloquent\Builder|Task whereUpdatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Task whereUserId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Task withTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|Task withoutTrashed() + * @mixin \Eloquent + */ class Task extends BaseModel { use MakesHash; diff --git a/app/Models/TaskStatus.php b/app/Models/TaskStatus.php index 6b1a7fd67139..8e30f5fa43ac 100644 --- a/app/Models/TaskStatus.php +++ b/app/Models/TaskStatus.php @@ -15,6 +15,42 @@ use Illuminate\Database\Eloquent\SoftDeletes; /** * Class TaskStatus. + * + * @property int $id + * @property string|null $name + * @property int|null $company_id + * @property int|null $user_id + * @property int $is_deleted + * @property int|null $created_at + * @property int|null $updated_at + * @property int|null $deleted_at + * @property int|null $status_sort_order + * @property string $color + * @property int|null $status_order + * @property-read mixed $hashed_id + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel company() + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel exclude($columns) + * @method static \Database\Factories\TaskStatusFactory factory($count = null, $state = []) + * @method static \Illuminate\Database\Eloquent\Builder|TaskStatus filter(\App\Filters\QueryFilters $filters) + * @method static \Illuminate\Database\Eloquent\Builder|TaskStatus newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|TaskStatus newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|TaskStatus onlyTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|TaskStatus query() + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope() + * @method static \Illuminate\Database\Eloquent\Builder|TaskStatus whereColor($value) + * @method static \Illuminate\Database\Eloquent\Builder|TaskStatus whereCompanyId($value) + * @method static \Illuminate\Database\Eloquent\Builder|TaskStatus whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|TaskStatus whereDeletedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|TaskStatus whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|TaskStatus whereIsDeleted($value) + * @method static \Illuminate\Database\Eloquent\Builder|TaskStatus whereName($value) + * @method static \Illuminate\Database\Eloquent\Builder|TaskStatus whereStatusOrder($value) + * @method static \Illuminate\Database\Eloquent\Builder|TaskStatus whereStatusSortOrder($value) + * @method static \Illuminate\Database\Eloquent\Builder|TaskStatus whereUpdatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|TaskStatus whereUserId($value) + * @method static \Illuminate\Database\Eloquent\Builder|TaskStatus withTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|TaskStatus withoutTrashed() + * @mixin \Eloquent */ class TaskStatus extends BaseModel { diff --git a/app/Models/TaxRate.php b/app/Models/TaxRate.php index 9a893b001538..4b7b28ff7aec 100644 --- a/app/Models/TaxRate.php +++ b/app/Models/TaxRate.php @@ -14,6 +14,42 @@ namespace App\Models; use App\Utils\Traits\MakesHash; use Illuminate\Database\Eloquent\SoftDeletes; +/** + * App\Models\TaxRate + * + * @property int $id + * @property int $company_id + * @property int|null $user_id + * @property int|null $created_at + * @property int|null $updated_at + * @property int|null $deleted_at + * @property string $name + * @property string $rate + * @property int $is_deleted + * @property-read mixed $hashed_id + * @property-read mixed $tax_rate_id + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel company() + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel exclude($columns) + * @method static \Database\Factories\TaxRateFactory factory($count = null, $state = []) + * @method static \Illuminate\Database\Eloquent\Builder|TaxRate filter(\App\Filters\QueryFilters $filters) + * @method static \Illuminate\Database\Eloquent\Builder|TaxRate newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|TaxRate newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|TaxRate onlyTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|TaxRate query() + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope() + * @method static \Illuminate\Database\Eloquent\Builder|TaxRate whereCompanyId($value) + * @method static \Illuminate\Database\Eloquent\Builder|TaxRate whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|TaxRate whereDeletedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|TaxRate whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|TaxRate whereIsDeleted($value) + * @method static \Illuminate\Database\Eloquent\Builder|TaxRate whereName($value) + * @method static \Illuminate\Database\Eloquent\Builder|TaxRate whereRate($value) + * @method static \Illuminate\Database\Eloquent\Builder|TaxRate whereUpdatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|TaxRate whereUserId($value) + * @method static \Illuminate\Database\Eloquent\Builder|TaxRate withTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|TaxRate withoutTrashed() + * @mixin \Eloquent + */ class TaxRate extends BaseModel { use MakesHash; diff --git a/app/Models/Timezone.php b/app/Models/Timezone.php index 99a12752ac33..daf773deb09b 100644 --- a/app/Models/Timezone.php +++ b/app/Models/Timezone.php @@ -11,6 +11,24 @@ namespace App\Models; +/** + * App\Models\Timezone + * + * @property int $id + * @property string $name + * @property string $location + * @property int $utc_offset + * @method static \Illuminate\Database\Eloquent\Builder|StaticModel company() + * @method static \Illuminate\Database\Eloquent\Builder|StaticModel exclude($columns) + * @method static \Illuminate\Database\Eloquent\Builder|Timezone newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Timezone newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Timezone query() + * @method static \Illuminate\Database\Eloquent\Builder|Timezone whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Timezone whereLocation($value) + * @method static \Illuminate\Database\Eloquent\Builder|Timezone whereName($value) + * @method static \Illuminate\Database\Eloquent\Builder|Timezone whereUtcOffset($value) + * @mixin \Eloquent + */ class Timezone extends StaticModel { /** diff --git a/app/Models/TransactionEvent.php b/app/Models/TransactionEvent.php index 3dcf8539080d..e2d1fdf0fc53 100644 --- a/app/Models/TransactionEvent.php +++ b/app/Models/TransactionEvent.php @@ -13,6 +13,63 @@ namespace App\Models; /** * Class Bank. + * + * @property int $id + * @property int $client_id + * @property int $invoice_id + * @property int $payment_id + * @property int $credit_id + * @property string $client_balance + * @property string $client_paid_to_date + * @property string $client_credit_balance + * @property string $invoice_balance + * @property string $invoice_amount + * @property string $invoice_partial + * @property string $invoice_paid_to_date + * @property int|null $invoice_status + * @property string $payment_amount + * @property string $payment_applied + * @property string $payment_refunded + * @property int|null $payment_status + * @property array|null $paymentables + * @property int $event_id + * @property int $timestamp + * @property array|null $payment_request + * @property array|null $metadata + * @property string $credit_balance + * @property string $credit_amount + * @property int|null $credit_status + * @method static \Illuminate\Database\Eloquent\Builder|StaticModel company() + * @method static \Illuminate\Database\Eloquent\Builder|StaticModel exclude($columns) + * @method static \Illuminate\Database\Eloquent\Builder|TransactionEvent newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|TransactionEvent newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|TransactionEvent query() + * @method static \Illuminate\Database\Eloquent\Builder|TransactionEvent whereClientBalance($value) + * @method static \Illuminate\Database\Eloquent\Builder|TransactionEvent whereClientCreditBalance($value) + * @method static \Illuminate\Database\Eloquent\Builder|TransactionEvent whereClientId($value) + * @method static \Illuminate\Database\Eloquent\Builder|TransactionEvent whereClientPaidToDate($value) + * @method static \Illuminate\Database\Eloquent\Builder|TransactionEvent whereCreditAmount($value) + * @method static \Illuminate\Database\Eloquent\Builder|TransactionEvent whereCreditBalance($value) + * @method static \Illuminate\Database\Eloquent\Builder|TransactionEvent whereCreditId($value) + * @method static \Illuminate\Database\Eloquent\Builder|TransactionEvent whereCreditStatus($value) + * @method static \Illuminate\Database\Eloquent\Builder|TransactionEvent whereEventId($value) + * @method static \Illuminate\Database\Eloquent\Builder|TransactionEvent whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|TransactionEvent whereInvoiceAmount($value) + * @method static \Illuminate\Database\Eloquent\Builder|TransactionEvent whereInvoiceBalance($value) + * @method static \Illuminate\Database\Eloquent\Builder|TransactionEvent whereInvoiceId($value) + * @method static \Illuminate\Database\Eloquent\Builder|TransactionEvent whereInvoicePaidToDate($value) + * @method static \Illuminate\Database\Eloquent\Builder|TransactionEvent whereInvoicePartial($value) + * @method static \Illuminate\Database\Eloquent\Builder|TransactionEvent whereInvoiceStatus($value) + * @method static \Illuminate\Database\Eloquent\Builder|TransactionEvent whereMetadata($value) + * @method static \Illuminate\Database\Eloquent\Builder|TransactionEvent wherePaymentAmount($value) + * @method static \Illuminate\Database\Eloquent\Builder|TransactionEvent wherePaymentApplied($value) + * @method static \Illuminate\Database\Eloquent\Builder|TransactionEvent wherePaymentId($value) + * @method static \Illuminate\Database\Eloquent\Builder|TransactionEvent wherePaymentRefunded($value) + * @method static \Illuminate\Database\Eloquent\Builder|TransactionEvent wherePaymentRequest($value) + * @method static \Illuminate\Database\Eloquent\Builder|TransactionEvent wherePaymentStatus($value) + * @method static \Illuminate\Database\Eloquent\Builder|TransactionEvent wherePaymentables($value) + * @method static \Illuminate\Database\Eloquent\Builder|TransactionEvent whereTimestamp($value) + * @mixin \Eloquent */ class TransactionEvent extends StaticModel { diff --git a/app/Models/User.php b/app/Models/User.php index e952e7f5a9b3..fc57697d5e10 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -32,6 +32,115 @@ use Illuminate\Support\Carbon; use Illuminate\Support\Facades\Auth; use Laracasts\Presenter\PresentableTrait; +/** + * App\Models\User + * + * @property int $id + * @property int $account_id + * @property string|null $first_name + * @property string|null $last_name + * @property string|null $phone + * @property string|null $ip + * @property string|null $device_token + * @property string $email + * @property string|null $email_verified_at + * @property string|null $confirmation_code + * @property int|null $theme_id + * @property int|null $failed_logins + * @property string|null $referral_code + * @property string|null $oauth_user_id + * @property object|null $oauth_user_token + * @property string|null $oauth_provider_id + * @property string|null $google_2fa_secret + * @property string|null $accepted_terms_version + * @property string|null $avatar + * @property int|null $avatar_width + * @property int|null $avatar_height + * @property int|null $avatar_size + * @property int $is_deleted + * @property string|null $last_login + * @property string|null $signature + * @property string $password + * @property string|null $remember_token + * @property string|null $custom_value1 + * @property string|null $custom_value2 + * @property string|null $custom_value3 + * @property string|null $custom_value4 + * @property int|null $created_at + * @property int|null $updated_at + * @property int|null $deleted_at + * @property string|null $oauth_user_refresh_token + * @property string|null $last_confirmed_email_address + * @property int $has_password + * @property Carbon|null $oauth_user_token_expiry + * @property string|null $sms_verification_code + * @property int $verified_phone_number + * @property-read \App\Models\Account $account + * @property-read \Illuminate\Database\Eloquent\Collection $clients + * @property-read int|null $clients_count + * @property-read \Illuminate\Database\Eloquent\Collection $companies + * @property-read int|null $companies_count + * @property-read \Illuminate\Database\Eloquent\Collection $company_users + * @property-read int|null $company_users_count + * @property-read \Illuminate\Database\Eloquent\Collection $contacts + * @property-read int|null $contacts_count + * @property-read \Illuminate\Database\Eloquent\Collection $documents + * @property-read int|null $documents_count + * @property-read mixed $hashed_id + * @property-read \Illuminate\Notifications\DatabaseNotificationCollection $notifications + * @property-read int|null $notifications_count + * @property-read \Illuminate\Database\Eloquent\Collection $tokens + * @property-read int|null $tokens_count + * @method static \Database\Factories\UserFactory factory($count = null, $state = []) + * @method static \Illuminate\Database\Eloquent\Builder|User filter(\App\Filters\QueryFilters $filters) + * @method static \Illuminate\Database\Eloquent\Builder|User newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|User newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|User onlyTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|User query() + * @method static \Illuminate\Database\Eloquent\Builder|User whereAcceptedTermsVersion($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereAccountId($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereAvatar($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereAvatarHeight($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereAvatarSize($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereAvatarWidth($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereConfirmationCode($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereCustomValue1($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereCustomValue2($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereCustomValue3($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereCustomValue4($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereDeletedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereDeviceToken($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereEmail($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereEmailVerifiedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereFailedLogins($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereFirstName($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereGoogle2faSecret($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereHasPassword($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereIp($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereIsDeleted($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereLastConfirmedEmailAddress($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereLastLogin($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereLastName($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereOauthProviderId($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereOauthUserId($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereOauthUserRefreshToken($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereOauthUserToken($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereOauthUserTokenExpiry($value) + * @method static \Illuminate\Database\Eloquent\Builder|User wherePassword($value) + * @method static \Illuminate\Database\Eloquent\Builder|User wherePhone($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereReferralCode($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereRememberToken($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereSignature($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereSmsVerificationCode($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereThemeId($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereUpdatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|User whereVerifiedPhoneNumber($value) + * @method static \Illuminate\Database\Eloquent\Builder|User withTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|User withoutTrashed() + * @mixin \Eloquent + */ class User extends Authenticatable implements MustVerifyEmail { use Notifiable; diff --git a/app/Models/Vendor.php b/app/Models/Vendor.php index 3c5d7ddc095c..51f998ab5826 100644 --- a/app/Models/Vendor.php +++ b/app/Models/Vendor.php @@ -19,6 +19,93 @@ use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Support\Facades\Cache; use Laracasts\Presenter\PresentableTrait; +/** + * App\Models\Vendor + * + * @property int $id + * @property int|null $created_at + * @property int|null $updated_at + * @property int|null $deleted_at + * @property int $user_id + * @property int|null $assigned_user_id + * @property int $company_id + * @property string|null $currency_id + * @property string|null $name + * @property string|null $address1 + * @property string|null $address2 + * @property string|null $city + * @property string|null $state + * @property string|null $postal_code + * @property string|null $country_id + * @property string|null $phone + * @property string|null $private_notes + * @property string|null $website + * @property bool $is_deleted + * @property string|null $vat_number + * @property string|null $transaction_name + * @property string|null $number + * @property string|null $custom_value1 + * @property string|null $custom_value2 + * @property string|null $custom_value3 + * @property string|null $custom_value4 + * @property string|null $vendor_hash + * @property string|null $public_notes + * @property string|null $id_number + * @property-read \Illuminate\Database\Eloquent\Collection $activities + * @property-read int|null $activities_count + * @property-read \App\Models\User|null $assigned_user + * @property-read \App\Models\Company $company + * @property-read \Illuminate\Database\Eloquent\Collection $contacts + * @property-read int|null $contacts_count + * @property-read \App\Models\Country|null $country + * @property-read \Illuminate\Database\Eloquent\Collection $documents + * @property-read int|null $documents_count + * @property-read mixed $hashed_id + * @property-read \Illuminate\Database\Eloquent\Collection $primary_contact + * @property-read int|null $primary_contact_count + * @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 \Database\Factories\VendorFactory factory($count = null, $state = []) + * @method static \Illuminate\Database\Eloquent\Builder|Vendor filter(\App\Filters\QueryFilters $filters) + * @method static \Illuminate\Database\Eloquent\Builder|Vendor newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Vendor newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Vendor onlyTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|Vendor query() + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope() + * @method static \Illuminate\Database\Eloquent\Builder|Vendor whereAddress1($value) + * @method static \Illuminate\Database\Eloquent\Builder|Vendor whereAddress2($value) + * @method static \Illuminate\Database\Eloquent\Builder|Vendor whereAssignedUserId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Vendor whereCity($value) + * @method static \Illuminate\Database\Eloquent\Builder|Vendor whereCompanyId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Vendor whereCountryId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Vendor whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Vendor whereCurrencyId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Vendor whereCustomValue1($value) + * @method static \Illuminate\Database\Eloquent\Builder|Vendor whereCustomValue2($value) + * @method static \Illuminate\Database\Eloquent\Builder|Vendor whereCustomValue3($value) + * @method static \Illuminate\Database\Eloquent\Builder|Vendor whereCustomValue4($value) + * @method static \Illuminate\Database\Eloquent\Builder|Vendor whereDeletedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Vendor whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Vendor whereIdNumber($value) + * @method static \Illuminate\Database\Eloquent\Builder|Vendor whereIsDeleted($value) + * @method static \Illuminate\Database\Eloquent\Builder|Vendor whereName($value) + * @method static \Illuminate\Database\Eloquent\Builder|Vendor whereNumber($value) + * @method static \Illuminate\Database\Eloquent\Builder|Vendor wherePhone($value) + * @method static \Illuminate\Database\Eloquent\Builder|Vendor wherePostalCode($value) + * @method static \Illuminate\Database\Eloquent\Builder|Vendor wherePrivateNotes($value) + * @method static \Illuminate\Database\Eloquent\Builder|Vendor wherePublicNotes($value) + * @method static \Illuminate\Database\Eloquent\Builder|Vendor whereState($value) + * @method static \Illuminate\Database\Eloquent\Builder|Vendor whereTransactionName($value) + * @method static \Illuminate\Database\Eloquent\Builder|Vendor whereUpdatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Vendor whereUserId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Vendor whereVatNumber($value) + * @method static \Illuminate\Database\Eloquent\Builder|Vendor whereVendorHash($value) + * @method static \Illuminate\Database\Eloquent\Builder|Vendor whereWebsite($value) + * @method static \Illuminate\Database\Eloquent\Builder|Vendor withTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|Vendor withoutTrashed() + * @mixin \Eloquent + */ class Vendor extends BaseModel { use SoftDeletes; diff --git a/app/Models/VendorContact.php b/app/Models/VendorContact.php index 68dccb66ea32..5026bbdc9625 100644 --- a/app/Models/VendorContact.php +++ b/app/Models/VendorContact.php @@ -23,6 +23,95 @@ use Illuminate\Notifications\Notifiable; use Illuminate\Support\Facades\Cache; use Laracasts\Presenter\PresentableTrait; +/** + * App\Models\VendorContact + * + * @property int $id + * @property int $company_id + * @property int $user_id + * @property int $vendor_id + * @property int|null $created_at + * @property int|null $updated_at + * @property int|null $deleted_at + * @property int $is_primary + * @property string|null $first_name + * @property string|null $last_name + * @property string|null $email + * @property string|null $phone + * @property string|null $custom_value1 + * @property string|null $custom_value2 + * @property string|null $custom_value3 + * @property string|null $custom_value4 + * @property int $send_email + * @property string|null $email_verified_at + * @property string|null $confirmation_code + * @property int $confirmed + * @property string|null $last_login + * @property int|null $failed_logins + * @property string|null $oauth_user_id + * @property int|null $oauth_provider_id + * @property string|null $google_2fa_secret + * @property string|null $accepted_terms_version + * @property string|null $avatar + * @property string|null $avatar_type + * @property string|null $avatar_size + * @property string $password + * @property string|null $token + * @property int $is_locked + * @property string|null $contact_key + * @property string|null $remember_token + * @property-read \App\Models\Company $company + * @property-read mixed $contact_id + * @property-read mixed $hashed_id + * @property-read \Illuminate\Notifications\DatabaseNotificationCollection $notifications + * @property-read int|null $notifications_count + * @property-read \Illuminate\Database\Eloquent\Collection $purchase_order_invitations + * @property-read int|null $purchase_order_invitations_count + * @property-read \App\Models\User $user + * @property-read \App\Models\Vendor $vendor + * @method static \Database\Factories\VendorContactFactory factory($count = null, $state = []) + * @method static \Illuminate\Database\Eloquent\Builder|VendorContact newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|VendorContact newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|VendorContact onlyTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|VendorContact query() + * @method static \Illuminate\Database\Eloquent\Builder|VendorContact whereAcceptedTermsVersion($value) + * @method static \Illuminate\Database\Eloquent\Builder|VendorContact whereAvatar($value) + * @method static \Illuminate\Database\Eloquent\Builder|VendorContact whereAvatarSize($value) + * @method static \Illuminate\Database\Eloquent\Builder|VendorContact whereAvatarType($value) + * @method static \Illuminate\Database\Eloquent\Builder|VendorContact whereCompanyId($value) + * @method static \Illuminate\Database\Eloquent\Builder|VendorContact whereConfirmationCode($value) + * @method static \Illuminate\Database\Eloquent\Builder|VendorContact whereConfirmed($value) + * @method static \Illuminate\Database\Eloquent\Builder|VendorContact whereContactKey($value) + * @method static \Illuminate\Database\Eloquent\Builder|VendorContact whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|VendorContact whereCustomValue1($value) + * @method static \Illuminate\Database\Eloquent\Builder|VendorContact whereCustomValue2($value) + * @method static \Illuminate\Database\Eloquent\Builder|VendorContact whereCustomValue3($value) + * @method static \Illuminate\Database\Eloquent\Builder|VendorContact whereCustomValue4($value) + * @method static \Illuminate\Database\Eloquent\Builder|VendorContact whereDeletedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|VendorContact whereEmail($value) + * @method static \Illuminate\Database\Eloquent\Builder|VendorContact whereEmailVerifiedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|VendorContact whereFailedLogins($value) + * @method static \Illuminate\Database\Eloquent\Builder|VendorContact whereFirstName($value) + * @method static \Illuminate\Database\Eloquent\Builder|VendorContact whereGoogle2faSecret($value) + * @method static \Illuminate\Database\Eloquent\Builder|VendorContact whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|VendorContact whereIsLocked($value) + * @method static \Illuminate\Database\Eloquent\Builder|VendorContact whereIsPrimary($value) + * @method static \Illuminate\Database\Eloquent\Builder|VendorContact whereLastLogin($value) + * @method static \Illuminate\Database\Eloquent\Builder|VendorContact whereLastName($value) + * @method static \Illuminate\Database\Eloquent\Builder|VendorContact whereOauthProviderId($value) + * @method static \Illuminate\Database\Eloquent\Builder|VendorContact whereOauthUserId($value) + * @method static \Illuminate\Database\Eloquent\Builder|VendorContact wherePassword($value) + * @method static \Illuminate\Database\Eloquent\Builder|VendorContact wherePhone($value) + * @method static \Illuminate\Database\Eloquent\Builder|VendorContact whereRememberToken($value) + * @method static \Illuminate\Database\Eloquent\Builder|VendorContact whereSendEmail($value) + * @method static \Illuminate\Database\Eloquent\Builder|VendorContact whereToken($value) + * @method static \Illuminate\Database\Eloquent\Builder|VendorContact whereUpdatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|VendorContact whereUserId($value) + * @method static \Illuminate\Database\Eloquent\Builder|VendorContact whereVendorId($value) + * @method static \Illuminate\Database\Eloquent\Builder|VendorContact withTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|VendorContact withoutTrashed() + * @mixin \Eloquent + */ class VendorContact extends Authenticatable implements HasLocalePreference { use Notifiable; diff --git a/app/Models/Webhook.php b/app/Models/Webhook.php index 6a1c44a87fab..8b419a6bd739 100644 --- a/app/Models/Webhook.php +++ b/app/Models/Webhook.php @@ -13,6 +13,48 @@ namespace App\Models; use Illuminate\Database\Eloquent\SoftDeletes; +/** + * App\Models\Webhook + * + * @property int $id + * @property int|null $company_id + * @property int|null $user_id + * @property int|null $event_id + * @property int $is_deleted + * @property string $target_url + * @property string $format + * @property int|null $created_at + * @property int|null $updated_at + * @property int|null $deleted_at + * @property string|null $rest_method + * @property array|null $headers + * @property-read \App\Models\Company|null $company + * @property-read mixed $hashed_id + * @property-read \App\Models\User|null $user + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel company() + * @method static \Illuminate\Database\Eloquent\Builder|BaseModel exclude($columns) + * @method static \Illuminate\Database\Eloquent\Builder|Webhook filter(\App\Filters\QueryFilters $filters) + * @method static \Illuminate\Database\Eloquent\Builder|Webhook newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Webhook newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Webhook onlyTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|Webhook query() + * @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 withoutTrashed() + * @mixin \Eloquent + */ class Webhook extends BaseModel { use SoftDeletes; diff --git a/app/PaymentDrivers/Stripe/ACH.php b/app/PaymentDrivers/Stripe/ACH.php index 34825fd35d35..e8d31b2f411e 100644 --- a/app/PaymentDrivers/Stripe/ACH.php +++ b/app/PaymentDrivers/Stripe/ACH.php @@ -262,6 +262,7 @@ class ACH { $this->stripe->init(); + $response = false; try { $data = [ 'amount' => $this->stripe->convertToStripeAmount($amount, $this->stripe->client->currency()->precision, $this->stripe->client->currency()), diff --git a/app/Services/Client/ClientService.php b/app/Services/Client/ClientService.php index df0641c2eda8..5a88bf755bc0 100644 --- a/app/Services/Client/ClientService.php +++ b/app/Services/Client/ClientService.php @@ -11,14 +11,15 @@ namespace App\Services\Client; +use App\Utils\Number; use App\Models\Client; use App\Models\Credit; +use App\Services\Email\Email; +use App\Utils\Traits\MakesDates; +use Illuminate\Support\Facades\DB; use App\Services\Email\EmailObject; use App\Services\Email\EmailService; -use App\Utils\Number; -use App\Utils\Traits\MakesDates; use Illuminate\Mail\Mailables\Address; -use Illuminate\Support\Facades\DB; class ClientService { @@ -149,9 +150,12 @@ class ClientService $this->client_start_date = $this->translateDate($options['start_date'], $this->client->date_format(), $this->client->locale()); $this->client_end_date = $this->translateDate($options['end_date'], $this->client->date_format(), $this->client->locale()); - $email_service = new EmailService($this->buildStatementMailableData($pdf), $this->client->company); + // $email_service = new EmailService($this->buildStatementMailableData($pdf), $this->client->company); + // $email_service->send(); + + $email_object = $this->buildStatementMailableData($pdf); + Email::dispatch($email_object, $this->client->company); - $email_service->send(); } /** @@ -165,9 +169,7 @@ class ClientService $email_object = new EmailObject; $email_object->to = [new Address($this->client->present()->email(), $this->client->present()->name())]; $email_object->attachments = [['file' => base64_encode($pdf), 'name' => ctrans('texts.statement') . ".pdf"]]; - $email_object->settings = $this->client->getMergedSettings(); - $email_object->company = $this->client->company; - $email_object->client = $this->client; + $email_object->client_id = $this->client->id; $email_object->email_template_subject = 'email_subject_statement'; $email_object->email_template_body = 'email_template_statement'; $email_object->variables = [ diff --git a/app/Services/Email/MailEntity.php b/app/Services/Email/Email.php similarity index 50% rename from app/Services/Email/MailEntity.php rename to app/Services/Email/Email.php index 64629e57f523..edb6e4ada293 100644 --- a/app/Services/Email/MailEntity.php +++ b/app/Services/Email/Email.php @@ -11,121 +11,400 @@ namespace App\Services\Email; -use App\DataMapper\Analytics\EmailSuccess; -use App\Libraries\Google\Google; -use App\Libraries\MultiDB; -use App\Models\Company; use App\Models\User; use App\Utils\Ninja; -use App\Utils\Traits\MakesHash; -use GuzzleHttp\Exception\ClientException; +use App\Models\Client; +use App\Models\Vendor; +use App\Models\Company; +use App\Models\Invoice; +use App\Models\Payment; +use App\Models\SystemLog; +use App\Utils\HtmlEngine; +use App\Libraries\MultiDB; +use App\Models\ClientContact; +use App\Models\VendorContact; use Illuminate\Bus\Queueable; -use Illuminate\Contracts\Mail\Mailer; +use Illuminate\Mail\Mailable; +use App\Jobs\Util\SystemLogger; +use App\Utils\Traits\MakesHash; +use App\Utils\VendorHtmlEngine; +use App\Libraries\Google\Google; +use Illuminate\Support\Facades\Mail; +use App\Services\Email\EmailMailable; +use Illuminate\Support\Facades\Cache; +use Illuminate\Queue\SerializesModels; +use Turbo124\Beacon\Facades\LightLogs; +use Illuminate\Queue\InteractsWithQueue; +use GuzzleHttp\Exception\ClientException; +use App\DataMapper\Analytics\EmailFailure; +use App\DataMapper\Analytics\EmailSuccess; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Foundation\Bus\Dispatchable; -use Illuminate\Mail\Mailable; -use Illuminate\Queue\InteractsWithQueue; -use Illuminate\Queue\SerializesModels; -use Illuminate\Support\Facades\Cache; -use Illuminate\Support\Facades\Mail; -use Turbo124\Beacon\Facades\LightLogs; +use App\Events\Invoice\InvoiceWasEmailedAndFailed; +use App\Events\Payment\PaymentWasEmailedAndFailed; -class MailEntity implements ShouldQueue +class Email implements ShouldQueue { use Dispatchable, InteractsWithQueue, Queueable, SerializesModels, MakesHash; - public Company $company; + public $tries = 4; + + public $deleteWhenMissingModels = true; + + public bool $override; + + protected ?string $client_postmark_secret = null; + + protected ?string $client_mailgun_secret = null; + + protected ?string $client_mailgun_domain = null; + + private string $mailer = 'default'; public Mailable $mailable; - public Mailer $mail; - - public ?string $client_postmark_secret = null; - - public ?string $client_mailgun_secret = null; - - public ?string $client_mailgun_domain = null; - - public bool $override = false; - - private string $mailer = ''; - - public int $tries = 4; - - public $deleteWhenMissingModels = true; - - /** - * __construct - * - * @param mixed $invitation - * @param mixed $db - * @param mixed $mail_object - * @return void - */ - public function __construct(public mixed $invitation, private ?string $db, public MailObject $mail_object) + public function __construct(public EmailObject $email_object, public Company $company) { } /** - * Handle the job + * The backoff time between retries. * - * @return void + * @return array */ - public function handle(): void + public function backoff() { - MultiDB::setDb($this->db); + return [10, 30, 60, 240]; + } - /* Where there are no invitations, we need to harvest the company and also use the correct context to build the mailable*/ - $this->company = $this->invitation->company; + public function handle() + { - $this->override = $this->mail_object->override; + MultiDB::setDb($this->company->db); - $builder = new MailBuild($this); + $this->setOverride() + ->initModels() + ->setDefaults() + ->buildMailable(); - /* Construct Mailable */ - $builder->run($this); - - $this->mailable = $builder->getMailable(); - - /* Email quality checks */ - if ($this->preFlightChecksFail()) { + if($this->preFlightChecksFail()) return; - } - /* Try sending email */ - $this->setMailDriver() - ->configureMailer() - ->trySending(); + $this->email(); + + $this->tearDown(); + } - + /** - * configureMailer + * Sets the override flag * * @return self */ - public function configureMailer(): self + public function setOverride(): self { - $this->mail = Mail::mailer($this->mailer); + $this->override = $this->email_object->override; + + return $this; + } + + /** + * Initilializes the models + * + * @return self + */ + public function initModels(): self + { + + $this->email_object->entity_id ? $this->email_object->entity = $this->email_object->entity_class::withTrashed()->with('invitations')->find($this->email_object->entity_id) : $this->email_object->entity = null; + + $this->email_object->invitation_id ? $this->email_object->invitation = $this->email_object->entity->invitations()->where('id', $this->email_object->invitation_id)->first() : $this->email_object->invitation = null; + + $this->email_object->invitation_id ? $this->email_object->contact = $this->email_object->invitation->contact : $this->email_object->contact = null; + + $this->email_object->client_id ? $this->email_object->client = Client::withTrashed()->find($this->email_object->client_id) : $this->email_object->client = null; + $this->email_object->vendor_id ? $this->email_object->vendor = Vendor::withTrashed()->find($this->email_object->vendor_id) : $this->email_object->vendor = null; + + if (!$this->email_object->contact) + { + + $this->email_object->vendor_contact_id ? $this->email_object->contact = VendorContact::withTrashed()->find($this->email_object->vendor_contact_id) : null; + + $this->email_object->client_contact_id ? $this->email_object->contact = ClientContact::withTrashed()->find($this->email_object->client_contact_id) : null; + + } + + $this->email_object->user_id ? $this->email_object->user = User::withTrashed()->find($this->email_object->user_id) : $this->email_object->user = $this->company->owner(); + + $this->email_object->company_key = $this->company->company_key; + + $this->email_object->company = $this->company; + + $this->email_object->client_id ? $this->email_object->settings = $this->email_object->client->getMergedSettings() : $this->email_object->settings = $this->company->settings; + + $this->email_object->whitelabel = $this->company->account->isPaid() ? true : false; + + $this->email_object->logo = $this->email_object->settings->company_logo; + + $this->email_object->signature = $this->email_object->settings->email_signature; + + $this->resolveVariables(); + + return $this; + } + + /** + * Generates the correct set of variables + * + * @return self + */ + private function resolveVariables(): self + { + $_variables = $this->email_object->variables; + + match(class_basename($this->email_object->entity)){ + "Invoice" => $this->email_object->variables = (new HtmlEngine($this->email_object->invitation))->makeValues(), + "Quote" => $this->email_object->variables = (new HtmlEngine($this->email_object->invitation))->makeValues(), + "Credit" => $this->email_object->variables = (new HtmlEngine($this->email_object->invitation))->makeValues(), + "PurchaseOrder" => $this->email_object->variables = (new VendorHtmlEngine($this->email_object->invitation))->makeValues(), + default => $this->email_object->variables = [] + }; + + /** If we have passed some variable overrides we insert them here */ + foreach($_variables as $key => $value) + { + $this->email_object->variables[$key] = $value; + } + + return $this; + } + + /** + * tearDown + * + * @return self + */ + private function tearDown(): self + { + + $this->email_object->entity = null; + $this->email_object->invitation = null; + $this->email_object->client = null; + $this->email_object->vendor = null; + $this->email_object->user = null; + $this->email_object->contact = null; + $this->email_object->settings = null; + + return $this; + + } + + /** + * Builds the email defaults + * + * @return self + */ + public function setDefaults(): self + { + + (new EmailDefaults($this))->run(); + + return $this; + + } + + /** + * Populates the mailable + * + * @return self + */ + public function buildMailable(): self + { + + $this->mailable = new EmailMailable($this->email_object); + + return $this; + + } + + /** + * Attempts to send the email + * + * @return void + */ + public function email() + { + + $this->setMailDriver(); + + /* Init the mailer*/ + $mailer = Mail::mailer($this->mailer); + + /* Additional configuration if using a client third party mailer */ if ($this->client_postmark_secret) { - $this->mail->postmark_config($this->client_postmark_secret); + $mailer->postmark_config($this->client_postmark_secret); } if ($this->client_mailgun_secret) { - $this->mail->mailgun_config($this->client_mailgun_secret, $this->client_mailgun_domain); + $mailer->mailgun_config($this->client_mailgun_secret, $this->client_mailgun_domain); } - - return $this; + + /* Attempt the send! */ + try { + nlog("Using mailer => ". $this->mailer. " ". now()->toDateTimeString()); + + $mailer->send($this->mailable); + + Cache::increment($this->company->account->key); + + LightLogs::create(new EmailSuccess($this->company->company_key)) + ->send(); + + } catch (\Exception | \RuntimeException | \Google\Service\Exception $e) { + nlog("Mailer failed with {$e->getMessage()}"); + + $message = $e->getMessage(); + + /** + * Post mark buries the proper message in a a guzzle response + * this merges a text string with a json object + * need to harvest the ->Message property using the following + */ + if ($e instanceof ClientException) { //postmark specific failure + $response = $e->getResponse(); + $message_body = json_decode($response->getBody()->getContents()); + + if ($message_body && property_exists($message_body, 'Message')) { + $message = $message_body->Message; + nlog($message); + } + + $this->fail(); + $this->cleanUpMailers(); + return; + } + + //only report once, not on all tries + if ($this->attempts() == $this->tries) { + /* If the is an entity attached to the message send a failure mailer */ + $this->entityEmailFailed($message); + + /* Don't send postmark failures to Sentry */ + if (Ninja::isHosted() && (!$e instanceof ClientException)) { + app('sentry')->captureException($e); + } + } + + $this->tearDown(); + /* Releasing immediately does not add in the backoff */ + $this->release($this->backoff()[$this->attempts()-1]); + + $message = null; + } + + $this->cleanUpMailers(); + } + /** + * On the hosted platform we scan all outbound email for + * spam. This sequence processes the filters we use on all + * emails. + * + * @return bool + */ + public function preFlightChecksFail(): bool + { + /* If we are migrating data we don't want to fire any emails */ + if ($this->company->is_disabled && !$this->override) { + return true; + } + if (Ninja::isSelfHost()) { + return false; + } + + /* To handle spam users we drop all emails from flagged accounts */ + if ($this->company->account && $this->company->account->is_flagged) { + return true; + } + + /* On the hosted platform we set default contacts a @example.com email address - we shouldn't send emails to these types of addresses */ + if ($this->hasInValidEmails()) { + return true; + } + + /* GMail users are uncapped */ + if (in_array($this->email_object->settings->email_sending_method, ['gmail', 'office365', 'client_postmark', 'client_mailgun'])) { + return false; + } + + /* On the hosted platform, if the user is over the email quotas, we do not send the email. */ + if ($this->company->account && $this->company->account->emailQuotaExceeded()) { + return true; + } + + /* If the account is verified, we allow emails to flow */ + if ($this->company->account && $this->company->account->is_verified_account) { + //11-01-2022 + + /* Continue to analyse verified accounts in case they later start sending poor quality emails*/ + // if(class_exists(\Modules\Admin\Jobs\Account\EmailQuality::class)) + // (new \Modules\Admin\Jobs\Account\EmailQuality($this->nmo, $this->company))->run(); + + return false; + } + + /* On the hosted platform if the user has not verified their account we fail here - but still check what they are trying to send! */ + if ($this->company->account && !$this->company->account->account_sms_verified) { + if (class_exists(\Modules\Admin\Jobs\Account\EmailFilter::class)) { + return (new \Modules\Admin\Jobs\Account\EmailFilter($this->email_object, $this->company))->run(); + } + + return true; + } + + /* On the hosted platform we actively scan all outbound emails to ensure outbound email quality remains high */ + if (class_exists(\Modules\Admin\Jobs\Account\EmailFilter::class)) { + return (new \Modules\Admin\Jobs\Account\EmailFilter($this->email_object, $this->company))->run(); + } + + return false; + } + /** + * hasInValidEmails + * + * @return bool + */ + private function hasInValidEmails(): bool + { + foreach ($this->email_object->to as $address_object) { + if (strpos($address_object->address, '@example.com') !== false) { + return true; + } + + if (!str_contains($address_object->address, "@")) { + return true; + } + + if ($address_object->address == " ") { + return true; + } + } + + + return false; + } + + /** * Sets the mail driver to use and applies any specific configuration * the the mailable */ private function setMailDriver(): self { - switch ($this->mail_object->settings->email_sending_method) { + switch ($this->email_object->settings->email_sending_method) { case 'default': $this->mailer = config('mail.default'); break; @@ -157,7 +436,7 @@ class MailEntity implements ShouldQueue return $this; } - /** + /** * Allows configuration of multiple mailers * per company for use by self hosted users */ @@ -189,176 +468,16 @@ class MailEntity implements ShouldQueue */ private function cleanUpMailers(): void { - $this->client_postmark_secret = false; + $this->client_postmark_secret = null; - $this->client_mailgun_secret = false; + $this->client_mailgun_secret = null; - $this->client_mailgun_domain = false; + $this->client_mailgun_domain = null; + //always dump the drivers to prevent reuse app('mail.manager')->forgetMailers(); } - - /** - * Attempts to send the email - * - * @return void - */ - public function trySending(): void - { - try { - $this->mail->send($this->mailable); - - /* Count the amount of emails sent across all the users accounts */ - Cache::increment($this->company->account->key); - - LightLogs::create(new EmailSuccess($this->company->company_key)) - ->send(); - } catch(\Symfony\Component\Mime\Exception\RfcComplianceException $e) { - nlog("Mailer failed with a Logic Exception {$e->getMessage()}"); - $this->fail(); - $this->cleanUpMailers(); - // $this->logMailError($e->getMessage(), $this->company->clients()->first()); - return; - } catch(\Symfony\Component\Mime\Exception\LogicException $e) { - nlog("Mailer failed with a Logic Exception {$e->getMessage()}"); - $this->fail(); - $this->cleanUpMailers(); - // $this->logMailError($e->getMessage(), $this->company->clients()->first()); - return; - } catch (\Exception | \Google\Service\Exception $e) { - nlog("Mailer failed with {$e->getMessage()}"); - $message = $e->getMessage(); - - /** - * Post mark buries the proper message in a a guzzle response - * this merges a text string with a json object - * need to harvest the ->Message property using the following - */ - if (stripos($e->getMessage(), 'code 406') || stripos($e->getMessage(), 'code 300') || stripos($e->getMessage(), 'code 413')) { - $message = "Either Attachment too large, or recipient has been suppressed."; - - $this->fail(); - // $this->logMailError($e->getMessage(), $this->company->clients()->first()); - $this->cleanUpMailers(); - - return; - } - - //only report once, not on all tries - if ($this->attempts() == $this->tries) { - /* If the is an entity attached to the message send a failure mailer */ - if ($this->mail_object->entity_id) { - // $this->entityEmailFailed($message); - - /* Don't send postmark failures to Sentry */ - if (Ninja::isHosted() && (!$e instanceof ClientException)) { - app('sentry')->captureException($e); - } - } - } - - /* Releasing immediately does not add in the backoff */ - $this->release($this->backoff()[$this->attempts()-1]); - } - } - - /** - * On the hosted platform we scan all outbound email for - * spam. This sequence processes the filters we use on all - * emails. - */ - public function preFlightChecksFail(): bool - { - /* Handle bad state */ - if (!$this->company) { - return true; - } - - /* Handle deactivated company */ - if ($this->company->is_disabled && !$this->override) { - return true; - } - - /* To handle spam users we drop all emails from flagged accounts */ - if (Ninja::isHosted() && $this->company->account && $this->company->account->is_flagged) { - return true; - } - - /* On the hosted platform we set default contacts a @example.com email address - we shouldn't send emails to these types of addresses */ - if ($this->hasInValidEmails()) { - return true; - } - - /* GMail users are uncapped */ - if (in_array($this->mail_object->settings->email_sending_method, ['gmail', 'office365', 'client_postmark', 'client_mailgun'])) { - return false; - } - - /* On the hosted platform, if the user is over the email quotas, we do not send the email. */ - if (Ninja::isHosted() && $this->company->account && $this->company->account->emailQuotaExceeded()) { - return true; - } - - /* If the account is verified, we allow emails to flow */ - if (Ninja::isHosted() && $this->company->account && $this->company->account->is_verified_account) { - //11-01-2022 - - /* Continue to analyse verified accounts in case they later start sending poor quality emails*/ - // if(class_exists(\Modules\Admin\Jobs\Account\EmailQuality::class)) - // (new \Modules\Admin\Jobs\Account\EmailQuality($this->mail_object, $this->company))->run(); - - return false; - } - - - /* On the hosted platform if the user has not verified their account we fail here - but still check what they are trying to send! */ - if ($this->company->account && !$this->company->account->account_sms_verified) { - if (class_exists(\Modules\Admin\Jobs\Account\EmailFilter::class)) { - (new \Modules\Admin\Jobs\Account\EmailFilter($this->mail_object, $this->company))->run(); - } - - return true; - } - - /* On the hosted platform we actively scan all outbound emails to ensure outbound email quality remains high */ - if (class_exists(\Modules\Admin\Jobs\Account\EmailFilter::class)) { - (new \Modules\Admin\Jobs\Account\EmailFilter($this->mail_object, $this->company))->run(); - } - - return false; - } - - - /** - * Checks if emails are have some illegal / required characters. - * - * @return bool - */ - private function hasInValidEmails(): bool - { - if (Ninja::isSelfHost()) { - return false; - } - - foreach ($this->mail_object->to as $address_object) { - if (strpos($address_object->address, '@example.com') !== false) { - return true; - } - - if (!str_contains($address_object->address, "@")) { - return true; - } - - if ($address_object->address == " ") { - return true; - } - } - - - return false; - } - /** * Check to ensure no cross account @@ -370,7 +489,8 @@ class MailEntity implements ShouldQueue { /* Always ensure the user is set on the correct account */ if ($user->account_id != $this->company->account_id) { - $this->mail_object->settings->email_sending_method = 'default'; + $this->email_object->settings->email_sending_method = 'default'; + return $this->setMailDriver(); } } @@ -384,7 +504,7 @@ class MailEntity implements ShouldQueue */ private function resolveSendingUser(): ?User { - $sending_user = $this->mail_object->settings->gmail_sending_user_id; + $sending_user = $this->email_object->settings->gmail_sending_user_id; if ($sending_user == "0") { $user = $this->company->owner(); @@ -394,25 +514,24 @@ class MailEntity implements ShouldQueue return $user; } - /** * Configures Mailgun using client supplied secret * as the Mailer */ private function setMailgunMailer() { - if (strlen($this->mail_object->settings->mailgun_secret) > 2 && strlen($this->mail_object->settings->mailgun_domain) > 2) { - $this->client_mailgun_secret = $this->mail_object->settings->mailgun_secret; - $this->client_mailgun_domain = $this->mail_object->settings->mailgun_domain; + if (strlen($this->email_object->settings->mailgun_secret) > 2 && strlen($this->email_object->settings->mailgun_domain) > 2) { + $this->client_mailgun_secret = $this->email_object->settings->mailgun_secret; + $this->client_mailgun_domain = $this->email_object->settings->mailgun_domain; } else { - $this->mail_object->settings->email_sending_method = 'default'; + $this->email_object->settings->email_sending_method = 'default'; return $this->setMailDriver(); } $user = $this->resolveSendingUser(); - $sending_email = (isset($this->mail_object->settings->custom_sending_email) && stripos($this->mail_object->settings->custom_sending_email, "@")) ? $this->mail_object->settings->custom_sending_email : $user->email; - $sending_user = (isset($this->mail_object->settings->email_from_name) && strlen($this->mail_object->settings->email_from_name) > 2) ? $this->mail_object->settings->email_from_name : $user->name(); + $sending_email = (isset($this->email_object->settings->custom_sending_email) && stripos($this->email_object->settings->custom_sending_email, "@")) ? $this->email_object->settings->custom_sending_email : $user->email; + $sending_user = (isset($this->email_object->settings->email_from_name) && strlen($this->email_object->settings->email_from_name) > 2) ? $this->email_object->settings->email_from_name : $user->name(); $this->mailable ->from($sending_email, $sending_user); @@ -424,18 +543,18 @@ class MailEntity implements ShouldQueue */ private function setPostmarkMailer() { - if (strlen($this->mail_object->settings->postmark_secret) > 2) { - $this->client_postmark_secret = $this->mail_object->settings->postmark_secret; + if (strlen($this->email_object->settings->postmark_secret) > 2) { + $this->client_postmark_secret = $this->email_object->settings->postmark_secret; } else { - $this->mail_object->settings->email_sending_method = 'default'; + $this->email_object->settings->email_sending_method = 'default'; return $this->setMailDriver(); } $user = $this->resolveSendingUser(); - $sending_email = (isset($this->mail_object->settings->custom_sending_email) && stripos($this->mail_object->settings->custom_sending_email, "@")) ? $this->mail_object->settings->custom_sending_email : $user->email; - $sending_user = (isset($this->mail_object->settings->email_from_name) && strlen($this->mail_object->settings->email_from_name) > 2) ? $this->mail_object->settings->email_from_name : $user->name(); - + $sending_email = (isset($this->email_object->settings->custom_sending_email) && stripos($this->email_object->settings->custom_sending_email, "@")) ? $this->email_object->settings->custom_sending_email : $user->email; + $sending_user = (isset($this->email_object->settings->email_from_name) && strlen($this->email_object->settings->email_from_name) > 2) ? $this->email_object->settings->email_from_name : $user->name(); + $this->mailable ->from($sending_email, $sending_user); } @@ -447,7 +566,7 @@ class MailEntity implements ShouldQueue private function setOfficeMailer() { $user = $this->resolveSendingUser(); - + $this->checkValidSendingUser($user); nlog("Sending via {$user->name()}"); @@ -458,7 +577,7 @@ class MailEntity implements ShouldQueue $user->oauth_user_token = $token; $user->save(); } else { - $this->mail_object->settings->email_sending_method = 'default'; + $this->email_object->settings->email_sending_method = 'default'; return $this->setMailDriver(); } @@ -478,7 +597,7 @@ class MailEntity implements ShouldQueue $user = $this->resolveSendingUser(); $this->checkValidSendingUser($user); - + nlog("Sending via {$user->name()}"); $google = (new Google())->init(); @@ -491,8 +610,8 @@ class MailEntity implements ShouldQueue $google->getClient()->setAccessToken(json_encode($user->oauth_user_token)); } catch(\Exception $e) { - // $this->logMailError('Gmail Token Invalid', $this->company->clients()->first()); - $this->mail_object->settings->email_sending_method = 'default'; + $this->logMailError('Gmail Token Invalid', $this->company->clients()->first()); + $this->email_object->settings->email_sending_method = 'default'; return $this->setMailDriver(); } @@ -502,7 +621,7 @@ class MailEntity implements ShouldQueue if (!$user->oauth_user_token) { $this->company->account->gmailCredentialNotification(); - $this->mail_object->settings->email_sending_method = 'default'; + $this->email_object->settings->email_sending_method = 'default'; return $this->setMailDriver(); } @@ -516,7 +635,7 @@ class MailEntity implements ShouldQueue if (!$token) { $this->company->account->gmailCredentialNotification(); - $this->mail_object->settings->email_sending_method = 'default'; + $this->email_object->settings->email_sending_method = 'default'; return $this->setMailDriver(); } @@ -527,13 +646,41 @@ class MailEntity implements ShouldQueue }); } - /** + /** + * Logs any errors to the SystemLog + * + * @param string $errors + * @param null | \App\Models\Client $recipient_object + * @return void + */ + private function logMailError($errors, $recipient_object) :void + { + (new SystemLogger( + $errors, + SystemLog::CATEGORY_MAIL, + SystemLog::EVENT_MAIL_SEND, + SystemLog::TYPE_FAILURE, + $recipient_object, + $this->company + ))->handle(); + + $job_failure = new EmailFailure($this->company->company_key); + $job_failure->string_metric5 = 'failed_email'; + $job_failure->string_metric6 = substr($errors, 0, 150); + + LightLogs::create($job_failure) + ->send(); + + $job_failure = null; + } + + /** * Attempts to refresh the Microsoft refreshToken * - * @param App\Models\User - * @return string | boool + * @param \App\Models\User $user + * @return mixed */ - private function refreshOfficeToken($user) + private function refreshOfficeToken(User $user): mixed { $expiry = $user->oauth_user_token_expiry ?: now()->subDay(); @@ -567,23 +714,42 @@ class MailEntity implements ShouldQueue } /** - * Backoff time + * Entity notification when an email fails to send * + * @param string $message * @return void */ - public function backoff() + private function entityEmailFailed($message): void { - return [5, 10, 30, 240]; + $class = get_class($this->email_object->entity); + + switch ($class) { + case Invoice::class: + event(new InvoiceWasEmailedAndFailed($this->email_object->invitation, $this->company, $message, $this->email_object->html_template, Ninja::eventVars(auth()->user() ? auth()->user()->id : null))); + break; + case Payment::class: + event(new PaymentWasEmailedAndFailed($this->email_object->entity, $this->company, $message, Ninja::eventVars(auth()->user() ? auth()->user()->id : null))); + break; + default: + # code... + break; + } + + if ($this->email_object->client) { + $this->logMailError($message, $this->email_object->client); + } } - - /** - * Failed handler - * - * @param mixed $exception - * @return void - */ + + public function failed($exception = null) { + + if($exception) + nlog($exception->getMessage()); + config(['queue.failed.driver' => null]); + } -} + + +} \ No newline at end of file diff --git a/app/Services/Email/EmailDefaults.php b/app/Services/Email/EmailDefaults.php index 153d14c2e349..d90ede9e6154 100644 --- a/app/Services/Email/EmailDefaults.php +++ b/app/Services/Email/EmailDefaults.php @@ -11,18 +11,29 @@ namespace App\Services\Email; -use App\DataMapper\EmailTemplateDefaults; -use App\Models\Account; +use App\Models\Task; use App\Utils\Ninja; -use Illuminate\Mail\Mailables\Address; +use App\Models\Quote; +use App\Models\Credit; +use App\Models\Account; +use App\Models\Expense; +use App\Models\Invoice; +use App\Models\PurchaseOrder; +use App\Jobs\Invoice\CreateUbl; +use App\Utils\Traits\MakesHash; +use App\Jobs\Entity\CreateRawPdf; use Illuminate\Support\Facades\App; +use Illuminate\Mail\Mailables\Address; +use App\DataMapper\EmailTemplateDefaults; use League\CommonMark\CommonMarkConverter; +use App\Jobs\Vendor\CreatePurchaseOrderPdf; class EmailDefaults { + use MakesHash; /** * The settings object for this email - * @var CompanySettings $settings + * @var \App\DataMapper\CompanySettings $settings */ protected $settings; @@ -39,10 +50,9 @@ class EmailDefaults private string $locale; /** - * @param EmailService $email_service The email service class - * @param EmailObject $email_object the email object class + * @param Email $email job class */ - public function __construct(protected EmailService $email_service, public EmailObject $email_object) + public function __construct(protected Email $email) { } @@ -54,36 +64,20 @@ class EmailDefaults */ public function run() { - $this->settings = $this->email_object->settings; + $this->settings = $this->email->email_object->settings; - $this->setLocale() + $this->setLocale() ->setFrom() + ->setTo() ->setTemplate() ->setBody() ->setSubject() ->setReplyTo() ->setBcc() ->setAttachments() - ->setMetaData() ->setVariables(); - return $this->email_object; - } - - /** - * Sets the meta data for the Email object - */ - private function setMetaData(): self - { - $this->email_object->company_key = $this->email_service->company->company_key; - - $this->email_object->logo = $this->email_service->company->present()->logo(); - - $this->email_object->signature = $this->email_object->signature ?: $this->settings->email_signature; - - $this->email_object->whitelabel = $this->email_object->company->account->isPaid() ? true : false; - - return $this; + return $this->email->email_object; } /** @@ -91,12 +85,12 @@ class EmailDefaults */ private function setLocale(): self { - if ($this->email_object->client) { - $this->locale = $this->email_object->client->locale(); - } elseif ($this->email_object->vendor) { - $this->locale = $this->email_object->vendor->locale(); + if ($this->email->email_object->client) { + $this->locale = $this->email->email_object->client->locale(); + } elseif ($this->email->email_object->vendor) { + $this->locale = $this->email->email_object->vendor->locale(); } else { - $this->locale = $this->email_service->company->locale(); + $this->locale = $this->email->company->locale(); } App::setLocale($this->locale); @@ -112,16 +106,16 @@ class EmailDefaults */ private function setTemplate(): self { - $this->template = $this->email_object->settings->email_style; + $this->template = $this->email->email_object->settings->email_style; - match ($this->email_object->settings->email_style) { + match ($this->email->email_object->settings->email_style) { 'light' => $this->template = 'email.template.client', 'dark' => $this->template = 'email.template.client', 'custom' => $this->template = 'email.template.custom', default => $this->template = 'email.template.client', }; - $this->email_object->html_template = $this->template; + $this->email->email_object->html_template = $this->template; return $this; } @@ -131,16 +125,30 @@ class EmailDefaults */ private function setFrom(): self { - if (Ninja::isHosted() && $this->email_object->settings->email_sending_method == 'default') { - $this->email_object->from = new Address(config('mail.from.address'), $this->email_service->company->owner()->name()); + if (Ninja::isHosted() && $this->email->email_object->settings->email_sending_method == 'default') { + $this->email->email_object->from = new Address(config('mail.from.address'), $this->email->company->owner()->name()); return $this; } - if ($this->email_object->from) { + if ($this->email->email_object->from) { return $this; } - $this->email_object->from = new Address($this->email_service->company->owner()->email, $this->email_service->company->owner()->name()); + $this->email->email_object->from = new Address($this->email->company->owner()->email, $this->email->company->owner()->name()); + + return $this; + } + + /** + * Sets the To address + */ + private function setTo(): self + { + if ($this->email->email_object->to) { + return $this; + } + + $this->email->email_object->to = [new Address($this->email->email_object->contact->email, $this->email->email_object->contact->present()->name())]; return $this; } @@ -150,16 +158,19 @@ class EmailDefaults */ private function setBody(): self { - if ($this->email_object->body) { - $this->email_object->body = $this->email_object->body; - } elseif (strlen($this->email_object->settings->{$this->email_object->email_template_body}) > 3) { - $this->email_object->body = $this->email_object->settings->{$this->email_object->email_template_body}; + if ($this->email->email_object->body) { + // A Custom Message has been set in the email screen. + return $this; + } elseif (strlen($this->email->email_object->settings?->{$this->email->email_object->email_template_body}) > 3) { + // A body has been saved in the settings. + $this->email->email_object->body = $this->email->email_object->settings?->{$this->email->email_object->email_template_body}; } else { - $this->email_object->body = EmailTemplateDefaults::getDefaultTemplate($this->email_object->email_template_body, $this->locale); + // Default template to be used + $this->email->email_object->body = EmailTemplateDefaults::getDefaultTemplate($this->email->email_object->email_template_body, $this->locale); } if ($this->template == 'email.template.custom') { - $this->email_object->body = (str_replace('$body', $this->email_object->body, $this->email_object->settings->email_style_custom)); + $this->email->email_object->body = (str_replace('$body', $this->email->email_object->body, $this->email->email_object->settings->email_style_custom)); } return $this; @@ -170,12 +181,12 @@ class EmailDefaults */ private function setSubject(): self { - if ($this->email_object->subject) { //where the user updates the subject from the UI + if ($this->email->email_object->subject) { //where the user updates the subject from the UI return $this; - } elseif (strlen($this->email_object->settings->{$this->email_object->email_template_subject}) > 3) { - $this->email_object->subject = $this->email_object->settings->{$this->email_object->email_template_subject}; + } elseif (strlen($this->email->email_object->settings?->{$this->email->email_object->email_template_subject}) > 3) { + $this->email->email_object->subject = $this->email->email_object->settings?->{$this->email->email_object->email_template_subject}; } else { - $this->email_object->subject = EmailTemplateDefaults::getDefaultTemplate($this->email_object->email_template_subject, $this->locale); + $this->email->email_object->subject = EmailTemplateDefaults::getDefaultTemplate($this->email->email_object->email_template_subject, $this->locale); } return $this; @@ -186,11 +197,11 @@ class EmailDefaults */ private function setReplyTo(): self { - $reply_to_email = str_contains($this->email_object->settings->reply_to_email, "@") ? $this->email_object->settings->reply_to_email : $this->email_service->company->owner()->email; + $reply_to_email = str_contains($this->email->email_object->settings->reply_to_email, "@") ? $this->email->email_object->settings->reply_to_email : $this->email->company->owner()->email; - $reply_to_name = strlen($this->email_object->settings->reply_to_name) > 3 ? $this->email_object->settings->reply_to_name : $this->email_service->company->owner()->present()->name(); + $reply_to_name = strlen($this->email->email_object->settings->reply_to_name) > 3 ? $this->email->email_object->settings->reply_to_name : $this->email->company->owner()->present()->name(); - $this->email_object->reply_to = array_merge($this->email_object->reply_to, [new Address($reply_to_email, $reply_to_name)]); + $this->email->email_object->reply_to = array_merge($this->email->email_object->reply_to, [new Address($reply_to_email, $reply_to_name)]); return $this; } @@ -201,12 +212,12 @@ class EmailDefaults */ public function setVariables(): self { - $this->email_object->body = strtr($this->email_object->body, $this->email_object->variables); + $this->email->email_object->body = strtr($this->email->email_object->body, $this->email->email_object->variables); - $this->email_object->subject = strtr($this->email_object->subject, $this->email_object->variables); + $this->email->email_object->subject = strtr($this->email->email_object->subject, $this->email->email_object->variables); if ($this->template != 'custom') { - $this->email_object->body = $this->parseMarkdownToHtml($this->email_object->body); + $this->email->email_object->body = $this->parseMarkdownToHtml($this->email->email_object->body); } return $this; @@ -220,11 +231,11 @@ class EmailDefaults $bccs = []; $bcc_array = []; - if (strlen($this->email_object->settings->bcc_email) > 1) { - if (Ninja::isHosted() && $this->email_service->company->account->isPaid()) { - $bccs = array_slice(explode(',', str_replace(' ', '', $this->email_object->settings->bcc_email)), 0, 2); + if (strlen($this->email->email_object->settings->bcc_email) > 1) { + if (Ninja::isHosted() && $this->email->company->account->isPaid()) { + $bccs = array_slice(explode(',', str_replace(' ', '', $this->email->email_object->settings->bcc_email)), 0, 2); } elseif (Ninja::isSelfHost()) { - $bccs = (explode(',', str_replace(' ', '', $this->email_object->settings->bcc_email))); + $bccs = (explode(',', str_replace(' ', '', $this->email->email_object->settings->bcc_email))); } } @@ -232,7 +243,7 @@ class EmailDefaults $bcc_array[] = new Address($bcc); } - $this->email_object->bcc = array_merge($this->email_object->bcc, $bcc_array); + $this->email->email_object->bcc = array_merge($this->email->email_object->bcc, $bcc_array); return $this; } @@ -258,15 +269,81 @@ class EmailDefaults */ private function setAttachments(): self { - $attachments = []; + $documents = []; - if ($this->email_object->settings->document_email_attachment && $this->email_service->company->account->hasFeature(Account::FEATURE_DOCUMENTS)) { - foreach ($this->email_service->company->documents as $document) { - $attachments[] = ['file' => base64_encode($document->getFile()), 'name' => $document->name]; + /* Return early if the user cannot attach documents */ + if (!$this->email->email_object->settings->document_email_attachment || !$this->email->company->account->hasFeature(Account::FEATURE_DOCUMENTS)) { + return $this; + } + + /** Purchase Order / Invoice / Credit / Quote PDF */ + if ($this->email->email_object->entity instanceof PurchaseOrder) { + $pdf = (new CreatePurchaseOrderPdf($this->email->email_object->invitation))->rawPdf(); + + $this->email->email_object->attachments = array_merge($this->email->email_object->attachments, [['file' => base64_encode($pdf), 'name' => $this->email->email_object->entity->numberFormatter().'.pdf']]); + } elseif ($this->email->email_object->settings->pdf_email_attachment && + ($this->email->email_object->entity instanceof Invoice || + $this->email->email_object->entity instanceof Quote || + $this->email->email_object->entity instanceof Credit)) { + $pdf = ((new CreateRawPdf($this->email->email_object->invitation, $this->email->company->db))->handle()); + + $this->email->email_object->attachments = array_merge($this->email->email_object->attachments, [['file' => base64_encode($pdf), 'name' => $this->email->email_object->entity->numberFormatter().'.pdf']]); + } + + /* Company Documents */ + $this->email->email_object->documents = array_merge($this->email->email_object->documents, $this->email->company->documents->pluck('id')->toArray()); + + /** Entity Documents */ + if ($this->email->email_object->entity?->documents) { + $this->email->email_object->documents = array_merge($this->email->email_object->documents, $this->email->email_object->entity->documents->pluck('id')->toArray()); + } + + /** Recurring Invoice Documents */ + if ($this->email->email_object->entity instanceof Invoice && $this->email->email_object->entity->recurring_id != null) { + $this->email->email_object->documents = array_merge($this->email->email_object->documents, $this->email->email_object->entity->recurring_invoice->documents->pluck('id')->toArray()); + } + + /** Task / Expense Documents */ + if ($this->email->email_object->entity instanceof Invoice) { + $expense_ids = []; + $task_ids = []; + + foreach ($this->email->email_object->entity->line_items as $item) { + if (property_exists($item, 'expense_id')) { + $expense_ids[] = $item->expense_id; + } + + if (property_exists($item, 'task_id')) { + $task_ids[] = $item->task_id; + } + } + + if (count($expense_ids) > 0) { + Expense::whereIn('id', $this->transformKeys($expense_ids)) + ->where('invoice_documents', 1) + ->cursor() + ->each(function ($expense) { + $this->email->email_object->documents = array_merge($this->email->email_object->documents, $expense->documents->pluck('id')->toArray()); + }); + } + + if (count($task_ids) > 0 && $this->email->company->invoice_task_documents) { + Task::whereIn('id', $this->transformKeys($task_ids)) + ->cursor() + ->each(function ($task) { + $this->email->email_object->documents = array_merge($this->email->email_object->documents, $task->documents->pluck('id')->toArray()); + }); } } - $this->email_object->attachments = array_merge($this->email_object->attachments, $attachments); + /** UBL xml file */ + if ($this->email->email_object->entity instanceof Invoice && $this->email->email_object->settings->ubl_email_attachment) { + $ubl_string = (new CreateUbl($this->email->email_object->entity))->handle(); + + if ($ubl_string) { + $this->email->email_object->attachments = array_merge($this->email->email_object->attachments, [['file' => base64_encode($ubl_string), 'name' => $this->email->email_object->entity->getFileName('xml')]]); + } + } return $this; } @@ -276,8 +353,8 @@ class EmailDefaults */ private function setHeaders(): self { - if ($this->email_object->invitation_key) { - $this->email_object->headers = array_merge($this->email_object->headers, ['x-invitation-key' => $this->email_object->invitation_key]); + if ($this->email->email_object->invitation_key) { + $this->email->email_object->headers = array_merge($this->email->email_object->headers, ['x-invitation-key' => $this->email->email_object->invitation_key]); } return $this; diff --git a/app/Services/Email/EmailMailable.php b/app/Services/Email/EmailMailable.php index 116317e80e53..665a0c0ac797 100644 --- a/app/Services/Email/EmailMailable.php +++ b/app/Services/Email/EmailMailable.php @@ -11,14 +11,19 @@ namespace App\Services\Email; -use Illuminate\Mail\Attachment; +use App\Models\Document; use Illuminate\Mail\Mailable; +use Illuminate\Mail\Attachment; +use Illuminate\Support\Facades\URL; use Illuminate\Mail\Mailables\Content; -use Illuminate\Mail\Mailables\Envelope; use Illuminate\Mail\Mailables\Headers; +use Illuminate\Mail\Mailables\Envelope; class EmailMailable extends Mailable { + + public int $max_attachment_size = 3000000; + /** * Create a new message instance. * @@ -52,6 +57,16 @@ class EmailMailable extends Mailable */ public function content() { + + $links = Document::whereIn('id',$this->email_object->documents) + ->where('size', '>', $this->max_attachment_size) + ->cursor() + ->map(function ($document){ + + return " $document->hash]) ."'>". $document->name .""; + + }); + return new Content( view: $this->email_object->html_template, text: $this->email_object->text_template, @@ -63,7 +78,8 @@ class EmailMailable extends Mailable 'logo' => $this->email_object->logo, 'signature' => $this->email_object->signature, 'company' => $this->email_object->company, - 'greeting' => '' + 'greeting' => '', + 'links' => array_merge($this->email_object->links, $links->toArray()), ] ); } @@ -77,11 +93,20 @@ class EmailMailable extends Mailable { $attachments = []; - foreach ($this->email_object->attachments as $file) { - $attachments[] = Attachment::fromData(fn () => base64_decode($file['file']), $file['name']); - } + $attachments = collect($this->email_object->attachments)->map(function ($file){ + return Attachment::fromData(fn () => base64_decode($file['file']), $file['name']); + }); - return $attachments; + $documents = Document::whereIn('id',$this->email_object->documents) + ->where('size', '<', $this->max_attachment_size) + ->cursor() + ->map(function ($document){ + + return Attachment::fromData(fn () => $document->getFile(), $document->name); + + }); + + return $attachments->merge($documents)->toArray(); } /** diff --git a/app/Services/Email/EmailMailer.php b/app/Services/Email/EmailMailer.php index 265b4f574c61..4aa296f270df 100644 --- a/app/Services/Email/EmailMailer.php +++ b/app/Services/Email/EmailMailer.php @@ -37,6 +37,7 @@ use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\Mail; use Turbo124\Beacon\Facades\LightLogs; +//@deprecated v5.5.83 class EmailMailer implements ShouldQueue { use Dispatchable, InteractsWithQueue, Queueable, SerializesModels, MakesHash; diff --git a/app/Services/Email/EmailObject.php b/app/Services/Email/EmailObject.php index 01dfb7ed7a95..c5f160016115 100644 --- a/app/Services/Email/EmailObject.php +++ b/app/Services/Email/EmailObject.php @@ -11,13 +11,22 @@ namespace App\Services\Email; -use App\Models\Client; -use App\Models\ClientContact; -use App\Models\Company; use App\Models\User; +use App\Models\Quote; +use App\Models\Client; +use App\Models\Credit; use App\Models\Vendor; +use App\Models\Company; +use App\Models\Invoice; +use App\Models\Payment; +use App\Models\ClientContact; +use App\Models\PurchaseOrder; use App\Models\VendorContact; +use App\Models\QuoteInvitation; +use App\Models\CreditInvitation; +use App\Models\InvoiceInvitation; use Illuminate\Mail\Mailables\Address; +use App\Models\PurchaseOrderInvitation; /** * EmailObject. @@ -42,6 +51,8 @@ class EmailObject public string $company_key; + public Company $company; + public ?object $settings = null; public bool $whitelabel = false; @@ -52,15 +63,31 @@ class EmailObject public ?string $greeting = null; - public ?Client $client = null; + public ?int $invitation_id = null; - public ?Vendor $vendor = null; + public InvoiceInvitation | QuoteInvitation | CreditInvitation | PurchaseOrderInvitation | null $invitation; + + public ?int $entity_id = null; - public ?User $user = null; + public Invoice | Quote | Credit | PurchaseOrder | Payment | null $entity; + + public ?int $client_id = null; - public ?ClientContact $client_contact = null; + public ?Client $client; + + public ?int $vendor_id = null; - public ?VendorContact $vendor_contact = null; + public ?Vendor $vendor; + + public ?int $user_id = null; + + public ?User $user; + + public ?int $client_contact_id = null; + + public ClientContact | VendorContact | null $contact; + + public ?int $vendor_contact_id = null; public ?string $email_template_body = null; @@ -72,13 +99,18 @@ class EmailObject public array $headers = []; - public ?string $invitation_key = null; - - public ?int $entity_id = null; - public ?string $entity_class = null; public array $variables = []; - public ?Company $company = null; + public bool $override = false; + + public ?string $invitation_key = null; + + // @phpstan-ignore-next-line + public array $documents = []; + + public ?string $template = null; //invoice //quote //reminder1 + + public array $links = []; } diff --git a/app/Services/Email/MailBuild.php b/app/Services/Email/MailBuild.php deleted file mode 100644 index 51ac2a89e452..000000000000 --- a/app/Services/Email/MailBuild.php +++ /dev/null @@ -1,570 +0,0 @@ -resolveEntities() - ->setLocale() - ->setMetaData() - ->setFrom() - ->setTo() - ->setTemplate() - ->setSubject() - ->setBody() - ->setReplyTo() - ->setBcc() - ->setAttachments() - ->setVariables(); - - return $this; - } - - /** - * Returns the mailable to the mailer - * - * @return Mailable - */ - public function getMailable(): Mailable - { - return new MailMailable($this->mail_entity->mail_object); - } - - /** - * Resolve any class entities - * - * @return self - */ - private function resolveEntities(): self - { - $client_contact = $this->mail_entity?->invitation?->client_contact_id ? ClientContact::withTrashed()->find($this->mail_entity->invitation->client_contact_id) : null; - - $this->client = $client_contact?->client; - - $vendor_contact = $this->mail_entity?->invitation?->vendor_contact_id ? VendorContact::withTrashed()->find($this->mail_entity->invitation->vendor_contact_id) : null; - - $this->vendor = $vendor_contact?->vendor; - - if ($this->mail_entity?->invitation) { - if ($this->mail_entity->invitation?->invoice) { - $this->mail_entity->mail_object->entity_string = 'invoice'; - $this->mail_entity->mail_object->entity_class = Invoice::class; - } - - if ($this->mail_entity->invitation?->quote) { - $this->mail_entity->mail_object->entity_string = 'quote'; - $this->mail_entity->mail_object->entity_class = Quote::class; - } - - if ($this->mail_entity->invitation?->credit) { - $this->mail_entity->mail_object->entity_string = 'credit'; - $this->mail_entity->mail_object->entity_class = Credit::class; - } - - if ($this->mail_entity->invitation?->puchase_order) { - $this->mail_entity->mail_object->entity_string = 'purchase_order'; - $this->mail_entity->mail_object->entity_class = PurchaseOrder::class; - } - } - - return $this; - } - - /** - * Sets the locale - * Sets the settings object depending on context - * Sets the HTML variables depending on context - * - * @return self - */ - private function setLocale(): self - { - if ($this->client) { - $this->locale = $this->client->locale(); - $this->settings = $this->client->getMergedSettings(); - - if ($this->mail_entity->invitation) { - $this->variables = (new HtmlEngine($this->mail_entity->invitation))->makeValues(); - } - } elseif ($this->vendor) { - $this->locale = $this->vendor->locale(); - $this->settings = $this->mail_entity->company->settings; - - if ($this->mail_entity->invitation) { - $this->variables = (new VendorHtmlEngine($this->mail_entity->invitation))->makeValues(); - } - } else { - $this->locale = $this->mail_entity->company->locale(); - $this->settings = $this->mail_entity->company->settings; - } - - $this->mail_entity->mail_object->settings = $this->settings; - - App::setLocale($this->locale); - App::forgetInstance('translator'); - $t = app('translator'); - $t->replace(Ninja::transformTranslations($this->settings)); - - return $this; - } - - /** - * Sets the meta data for the Email object - * - * @return self - */ - private function setMetaData(): self - { - $this->mail_entity->mail_object->company_key = $this->mail_entity->company->company_key; - - $this->mail_entity->mail_object->logo = $this->mail_entity->company->present()->logo(); - - $this->mail_entity->mail_object->signature = $this->mail_entity->mail_object->signature ?: $this->settings->email_signature; - - $this->mail_entity->mail_object->whitelabel = $this->mail_entity->company->account->isPaid() ? true : false; - - $this->mail_entity->mail_object->company = $this->mail_entity->company; - - return $this; - } - - /** - * Sets the template - * - * @return self - */ - private function setTemplate(): self - { - $this->template = $this->settings->email_style; - - match ($this->settings->email_style) { - 'light' => $this->template = 'email.template.client', - 'dark' => $this->template = 'email.template.client', - 'custom' => $this->template = 'email.template.custom', - default => $this->template = 'email.template.client', - }; - - $this->mail_entity->mail_object->html_template = $this->template; - - return $this; - } - - /** - * setTo - * - * @return self - */ - private function setTo(): self - { - $this->mail_entity->mail_object->to = array_merge( - $this->mail_entity->mail_object->to, - [new Address($this->mail_entity->invitation->contact->email, $this->mail_entity->invitation->contact->present()->name())] - ); - - return $this; - } - - /** - * Sets the FROM address - * - * @return self - */ - private function setFrom(): self - { - if (Ninja::isHosted() && $this->settings->email_sending_method == 'default') { - $this->mail_entity->mail_object->from = new Address(config('mail.from.address'), $this->mail_entity->company->owner()->name()); - return $this; - } - - if ($this->mail_entity->mail_object->from) { - return $this; - } - - $this->mail_entity->mail_object->from = new Address($this->mail_entity->company->owner()->email, $this->mail_entity->company->owner()->name()); - - return $this; - } - - /** - * Sets the subject of the email - * - * @return self - */ - private function setSubject(): self - { - if ($this->mail_entity->mail_object->subject) { //where the user updates the subject from the UI - return $this; - } elseif (is_string($this->mail_entity->mail_object->email_template) && strlen($this->settings->{$this->resolveBaseEntityTemplate()}) > 3) { - $this->mail_entity->mail_object->subject = $this->settings->{$this->resolveBaseEntityTemplate()}; - } else { - $this->mail_entity->mail_object->subject = EmailTemplateDefaults::getDefaultTemplate($this->resolveBaseEntityTemplate(), $this->locale); - } - - return $this; - } - - /** - * Sets the body of the email - * - * @return self - */ - private function setBody(): self - { - if ($this->mail_entity->mail_object->body) { - $this->mail_entity->mail_object->body = $this->mail_entity->mail_object->body; - } elseif (is_string($this->mail_entity->mail_object->email_template) && strlen($this->settings->{$this->resolveBaseEntityTemplate('body')}) > 3) { - $this->mail_entity->mail_object->body = $this->settings->{$this->resolveBaseEntityTemplate('body')}; - } else { - $this->mail_entity->mail_object->body = EmailTemplateDefaults::getDefaultTemplate($this->resolveBaseEntityTemplate('body'), $this->locale); - } - - if ($this->template == 'email.template.custom') { - $this->mail_entity->mail_object->body = (str_replace('$body', $this->mail_entity->mail_object->body, $this->settings->email_style_custom)); - } - - return $this; - } - - /** - * Where no template is explicitly passed, we need to infer by the entity type - - * which is hopefully resolvable. - * - * @param string $type - * @return string - */ - private function resolveBaseEntityTemplate(string $type = 'subject'): string - { - if ($this->mail_entity->mail_object->email_template) { - match ($type) { - 'subject' => $template = "email_subject_{$this->mail_entity->mail_object->email_template}", - 'body' => $template = "email_template_{$this->mail_entity->mail_object->email_template}", - default => $template = "email_template_invoice", - }; - - return $template; - } - - //handle statements being emailed - //handle custom templates these types won't have a resolvable entity_string - if (!$this->mail_entity->mail_object->entity_string) { - return 'email_template_invoice'; - } - - match ($type) { - 'subject' => $template = "email_subject_{$this->mail_entity->mail_object->entity_string}", - 'body' => $template = "email_template_{$this->mail_entity->mail_object->entity_string}", - default => $template = "email_template_invoice", - }; - - return $template; - } - - /** - * Sets the attachments for the email - * - * Note that we base64 encode these, as they - * sometimes may not survive serialization. - * - * We decode these in the Mailable later - * - * @return self - */ - private function setAttachments(): self - { - $this->setContextAttachments(); - - if ($this->settings->document_email_attachment && $this->mail_entity->company->account->hasFeature(Account::FEATURE_DOCUMENTS)) { - $this->attachDocuments($this->mail_entity->company->documents); - } - - return $this; - } - - private function attachDocuments($documents): self - { - foreach ($documents as $document) { - if ($document->size > $this->max_attachment_size) { - $this->mail_entity->mail_object->attachment_links = array_merge($this->mail_entity->mail_object->attachment_links, [[" $document->hash]) ."'>". $document->name .""]]); - } else { - $this->mail_entity->mail_object->attachments = array_merge($this->mail_entity->mail_object->attachments, [['file' => base64_encode($document->getFile()), 'name' => $document->name]]); - } - } - - return $this; - } - - /** - * Depending on context we may need to resolve the - * attachment dependencies. - * - * ie. Resolve the entity. - * ie. Resolve if we should attach the Entity PDF - * ie. Create the Entity PDF - * ie. Inject the PDF - * - * @return self - */ - private function setContextAttachments(): self - { - if (!$this->settings->pdf_email_attachment || !$this->mail_entity->company->account->hasFeature(Account::FEATURE_PDF_ATTACHMENT)) { - return $this; - } - - if ($this->mail_entity->invitation?->purchase_order) { - $pdf = (new CreatePurchaseOrderPdf($this->mail_entity->invitation))->rawPdf(); - - $this->mail_entity->mail_object->attachments = array_merge($this->mail_entity->mail_object->attachments, [['file' => base64_encode($pdf), 'name' => $this->mail_entity->invitation->purchase_order->numberFormatter().'.pdf']]); - - if ($this->vendor->getSetting('document_email_attachment') !== false && $this->mail_entity->company->account->hasFeature(Account::FEATURE_DOCUMENTS)) { - $this->attachDocuments($this->mail_entity->invitation->purchase_order->documents); - } - - return $this; - } - - if (!$this->mail_entity->mail_object->entity_string) { - return $this; - } - - $pdf = ((new CreateRawPdf($this->mail_entity->invitation, $this->mail_entity->invitation->company->db))->handle()); - - $this->mail_entity->mail_object->attachments = array_merge($this->mail_entity->mail_object->attachments, [['file' => base64_encode($pdf), 'name' => $this->mail_entity->invitation->{$this->mail_entity->mail_object->entity_string}->numberFormatter().'.pdf']]); - - if ($this->client->getSetting('document_email_attachment') !== false && $this->mail_entity->company->account->hasFeature(Account::FEATURE_DOCUMENTS)) { - $this->attachDocuments($this->mail_entity->invitation->{$this->mail_entity->mail_object->entity_string}->documents); - } - - return $this; - - - - - if ($this->settings->ubl_email_attachment && $this->mail_entity->mail_object->entity_string == 'invoice') { - } - - if ($this->mail_entity->mail_object->entity_string == 'invoice') { - $line_items = $this->mail_entity->invitation->invoice->line_items; - - foreach ($line_items as $item) { - $expense_ids = []; - - if (property_exists($item, 'expense_id')) { - $expense_ids[] = $item->expense_id; - } - - if (count($expense_ids) > 0) { - $expenses = Expense::whereIn('id', $this->transformKeys($expense_ids)) - ->where('invoice_documents', 1) - ->cursor() - ->each(function ($expense) { - $this->attachDocuments($expense->documents); - }); - } - - $task_ids = []; - - if (property_exists($item, 'task_id')) { - $task_ids[] = $item->task_id; - } - - if (count($task_ids) > 0 && $this->mail_entity->company->invoice_task_documents) { - $tasks = Task::whereIn('id', $this->transformKeys($task_ids)) - ->cursor() - ->each(function ($task) { - $this->attachDocuments($task->documents); - }); - } - } - } - - - return $this; - } - - - /** - * Sets the reply to of the email - * - * @return self - */ - private function setReplyTo(): self - { - $reply_to_email = str_contains($this->settings->reply_to_email, "@") ? $this->settings->reply_to_email : $this->mail_entity->company->owner()->email; - - $reply_to_name = strlen($this->settings->reply_to_name) > 3 ? $this->settings->reply_to_name : $this->mail_entity->company->owner()->present()->name(); - - $this->mail_entity->mail_object->reply_to = array_merge($this->mail_entity->mail_object->reply_to, [new Address($reply_to_email, $reply_to_name)]); - - return $this; - } - - /** - * Replaces the template placeholders - * with variable values. - * - * @return self - */ - public function setVariables(): self - { - if ($this->mail_entity->mail_object->variables) { - $this->mail_entity->mail_object->subject = strtr($this->mail_entity->mail_object->subject, $this->mail_entity->mail_object->variables); - $this->mail_entity->mail_object->body = strtr($this->mail_entity->mail_object->body, $this->mail_entity->mail_object->variables); - } - - $this->mail_entity->mail_object->subject = strtr($this->mail_entity->mail_object->subject, $this->variables); - $this->mail_entity->mail_object->body = strtr($this->mail_entity->mail_object->body, $this->variables); - - if ($this->template != 'custom') { - $this->mail_entity->mail_object->body = $this->parseMarkdownToHtml($this->mail_entity->mail_object->body); - } - - return $this; - } - - /** - * Sets the BCC of the email - * - * @return self - */ - private function setBcc(): self - { - $bccs = []; - $bcc_array = []; - - if (strlen($this->settings->bcc_email) > 1) { - if (Ninja::isHosted() && $this->mail_entity->company->account->isPaid()) { - $bccs = array_slice(explode(',', str_replace(' ', '', $this->settings->bcc_email)), 0, 2); - } elseif (Ninja::isSelfHost()) { - $bccs = (explode(',', str_replace(' ', '', $this->settings->bcc_email))); - } - } - - foreach ($bccs as $bcc) { - $bcc_array[] = new Address($bcc); - } - - $this->mail_entity->mail_object->bcc = array_merge($this->mail_entity->mail_object->bcc, $bcc_array); - - return $this; - } - - /** - * Sets the CC of the email - * @todo at some point.... - */ - private function buildCc() - { - return [ - - ]; - } - - - /** - * Sets the headers for the email - * - * @return self - */ - private function setHeaders(): self - { - if ($this->mail_entity->mail_object->invitation_key) { - $this->mail_entity->mail_object->headers = array_merge($this->mail_entity->mail_object->headers, ['x-invitation-key' => $this->mail_entity->mail_object->invitation_key]); - } elseif ($this->mail_entity->invitation) { - $this->mail_entity->mail_object->headers = array_merge($this->mail_entity->mail_object->headers, ['x-invitation-key' => $this->mail_entity->invitation->key]); - } - - return $this; - } - - /** - * Converts any markdown to HTML in the email - * - * @param string $markdown The body to convert - * @return string The parsed markdown response - */ - private function parseMarkdownToHtml(string $markdown): ?string - { - $converter = new CommonMarkConverter([ - 'allow_unsafe_links' => false, - ]); - - return $converter->convert($markdown); - } -} diff --git a/app/Services/Email/MailMailable.php b/app/Services/Email/MailMailable.php deleted file mode 100644 index 31fb9e3b238c..000000000000 --- a/app/Services/Email/MailMailable.php +++ /dev/null @@ -1,100 +0,0 @@ -mail_object->subject, - tags: [$this->mail_object->company_key], - replyTo: $this->mail_object->reply_to, - from: $this->mail_object->from, - to: $this->mail_object->to, - bcc: $this->mail_object->bcc - ); - } - - /** - * Get the message content definition. - * - * @return \Illuminate\Mail\Mailables\Content - */ - public function content() - { - return new Content( - view: $this->mail_object->html_template, - text: $this->mail_object->text_template, - with: [ - 'text_body' => str_replace("
", "\n", strip_tags($this->mail_object->body, "
")), //@todo this is a bit hacky here. - 'body' => $this->mail_object->body, - 'settings' => $this->mail_object->settings, - 'whitelabel' => $this->mail_object->whitelabel, - 'logo' => $this->mail_object->logo, - 'signature' => $this->mail_object->signature, - 'company' => $this->mail_object->company, - 'greeting' => '' - ] - ); - } - - /** - * Get the attachments for the message. - * - * @return array - */ - public function attachments() - { - $attachments = []; - - foreach ($this->mail_object->attachments as $file) { - $attachments[] = Attachment::fromData(fn () => base64_decode($file['file']), $file['name']); - } - - return $attachments; - } - - /** - * Get the message headers. - * - * @return \Illuminate\Mail\Mailables\Headers - */ - public function headers() - { - return new Headers( - messageId: null, - references: [], - text: $this->mail_object->headers, - ); - } -} diff --git a/app/Services/Email/MailObject.php b/app/Services/Email/MailObject.php deleted file mode 100644 index d42a71a12ccb..000000000000 --- a/app/Services/Email/MailObject.php +++ /dev/null @@ -1,89 +0,0 @@ -{$this->scheduler->template}(); + if(method_exists($this, $this->scheduler->template)) + $this->{$this->scheduler->template}(); } private function email_statement() diff --git a/app/Services/Subscription/SubscriptionService.php b/app/Services/Subscription/SubscriptionService.php index 87848cf0abdb..a86d8cd90a84 100644 --- a/app/Services/Subscription/SubscriptionService.php +++ b/app/Services/Subscription/SubscriptionService.php @@ -355,7 +355,7 @@ class SubscriptionService * @param Invoice $invoice * @return float */ - private function calculateProRataRefund($invoice) :float + private function calculateProRataRefund($invoice, $subscription = null) :float { if (!$invoice || !$invoice->date) { return 0; @@ -367,7 +367,10 @@ class SubscriptionService $days_of_subscription_used = $start_date->diffInDays($current_date); - $days_in_frequency = $this->getDaysInFrequency(); + if($subscription) + $days_in_frequency = $subscription->service()->getDaysInFrequency(); + else + $days_in_frequency = $this->getDaysInFrequency(); if ($days_of_subscription_used >= $days_in_frequency) { return 0; diff --git a/app/Transformers/BankTransactionTransformer.php b/app/Transformers/BankTransactionTransformer.php index e4ef35eba5f2..515ba5c4b7d6 100644 --- a/app/Transformers/BankTransactionTransformer.php +++ b/app/Transformers/BankTransactionTransformer.php @@ -11,7 +11,6 @@ namespace App\Transformers; -use App\Models\Account; use App\Models\BankTransaction; use App\Models\Company; use App\Models\Expense; @@ -35,7 +34,6 @@ class BankTransactionTransformer extends EntityTransformer */ protected $availableIncludes = [ 'company', - 'account', 'expense', 'payment', 'vendor', @@ -76,13 +74,6 @@ class BankTransactionTransformer extends EntityTransformer ]; } - public function includeAccount(BankTransaction $bank_transaction) - { - $transformer = new AccountTransformer($this->serializer); - - return $this->includeItem($bank_transaction->account, $transformer, Account::class); - } - public function includeCompany(BankTransaction $bank_transaction) { $transformer = new CompanyTransformer($this->serializer); diff --git a/app/Utils/HtmlEngine.php b/app/Utils/HtmlEngine.php index cc4129a536d0..5fcbf1a2ad36 100644 --- a/app/Utils/HtmlEngine.php +++ b/app/Utils/HtmlEngine.php @@ -129,7 +129,7 @@ class HtmlEngine $data['$line_tax_labels'] = ['value' => $this->lineTaxLabels(), 'label' => ctrans('texts.taxes')]; $data['$line_tax_values'] = ['value' => $this->lineTaxValues(), 'label' => ctrans('texts.taxes')]; $data['$date'] = ['value' => $this->translateDate($this->entity->date, $this->client->date_format(), $this->client->locale()) ?: ' ', 'label' => ctrans('texts.date')]; - $data['$status_logo'] = ['value' => '', 'label' => '']; + $data['$status_logo'] = ['value' => ' ', 'label' => ' ']; $data['$invoice.date'] = &$data['$date']; $data['$invoiceDate'] = &$data['$date']; diff --git a/app/Utils/PaymentHtmlEngine.php b/app/Utils/PaymentHtmlEngine.php new file mode 100644 index 000000000000..48d847f37c0c --- /dev/null +++ b/app/Utils/PaymentHtmlEngine.php @@ -0,0 +1,349 @@ +payment = $payment; + $this->company = $payment->company; + $this->client = $payment->client; + $this->contact = $contact ?: $this->client->contacts()->first(); + $this->contact->load('client.company'); + $this->settings = $this->client->getMergedSettings(); + $this->helpers = new Helpers(); + } + + public function makePaymentVariables() + { + App::forgetInstance('translator'); + $t = app('translator'); + App::setLocale($this->contact->preferredLocale()); + $t->replace(Ninja::transformTranslations($this->client->getMergedSettings())); + + $data = []; + + $data['$from'] = ['value' => '', 'label' => ctrans('texts.from')]; + $data['$to'] = ['value' => '', 'label' => ctrans('texts.to')]; + $data['$number'] = ['value' => $this->payment->number ?: ' ', 'label' => ctrans('texts.payment_number')]; + $data['$payment.number'] = &$data['$number']; + $data['$entity'] = ['value' => '', 'label' => ctrans('texts.payment')]; + $data['$payment.amount'] = ['value' => Number::formatMoney($this->payment->amount, $this->client) ?: ' ', 'label' => ctrans('texts.amount')]; + $data['$payment.refunded'] = ['value' => Number::formatMoney($this->payment->refunded, $this->client) ?: ' ', 'label' => ctrans('texts.refund')]; + $data['$amount'] = &$data['$payment.amount']; + $data['$payment.date'] = ['value' => $this->translateDate($this->payment->date, $this->client->date_format(), $this->client->locale()), 'label' => ctrans('texts.payment_date')]; + $data['$transaction_reference'] = ['value' => $this->payment->transaction_reference, 'label' => ctrans('texts.transaction_reference')]; + $data['$public_notes'] = ['value' => $this->payment->public_notes, 'label' => ctrans('texts.notes')]; + + $data['$payment1'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'payment1', $this->payment->custom_value1, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'payment1')]; + $data['$payment2'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'payment2', $this->payment->custom_value2, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'payment2')]; + $data['$payment3'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'payment3', $this->payment->custom_value3, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'payment3')]; + $data['$payment4'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'payment4', $this->payment->custom_value4, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'payment4')]; + + $data['$custom1'] = &$data['$payment1']; + $data['$custom2'] = &$data['$payment2']; + $data['$custom3'] = &$data['$payment3']; + $data['$custom4'] = &$data['$payment4']; + + $data['$client1'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'client1', $this->client->custom_value1, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'client1')]; + $data['$client2'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'client2', $this->client->custom_value2, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'client2')]; + $data['$client3'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'client3', $this->client->custom_value3, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'client3')]; + $data['$client4'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'client4', $this->client->custom_value4, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'client4')]; + $data['$address1'] = ['value' => $this->client->address1 ?: ' ', 'label' => ctrans('texts.address1')]; + $data['$address2'] = ['value' => $this->client->address2 ?: ' ', 'label' => ctrans('texts.address2')]; + $data['$id_number'] = ['value' => $this->client->id_number ?: ' ', 'label' => ctrans('texts.id_number')]; + $data['$client.number'] = ['value' => $this->client->number ?: ' ', 'label' => ctrans('texts.number')]; + $data['$vat_number'] = ['value' => $this->client->vat_number ?: ' ', 'label' => ctrans('texts.vat_number')]; + $data['$website'] = ['value' => $this->client->present()->website() ?: ' ', 'label' => ctrans('texts.website')]; + $data['$phone'] = ['value' => $this->client->present()->phone() ?: ' ', 'label' => ctrans('texts.phone')]; + $data['$country'] = ['value' => isset($this->client->country->name) ? $this->client->country->name : '', 'label' => ctrans('texts.country')]; + $data['$email'] = ['value' => isset($this->contact) ? $this->contact->email : 'no contact email on record', 'label' => ctrans('texts.email')]; + $data['$client_name'] = ['value' => $this->client->present()->name() ?: ' ', 'label' => ctrans('texts.client_name')]; + $data['$client.name'] = &$data['$client_name']; + $data['$client'] = &$data['$client_name']; + $data['$client.address1'] = &$data['$address1']; + $data['$client.address2'] = &$data['$address2']; + $data['$client_address'] = ['value' => $this->client->present()->address() ?: ' ', 'label' => ctrans('texts.address')]; + $data['$client.address'] = &$data['$client_address']; + $data['$client.id_number'] = &$data['$id_number']; + $data['$client.vat_number'] = &$data['$vat_number']; + $data['$client.website'] = &$data['$website']; + $data['$client.phone'] = &$data['$phone']; + $data['$city_state_postal'] = ['value' => $this->client->present()->cityStateZip($this->client->city, $this->client->state, $this->client->postal_code, false) ?: ' ', 'label' => ctrans('texts.city_state_postal')]; + $data['$client.city_state_postal'] = &$data['$city_state_postal']; + $data['$postal_city_state'] = ['value' => $this->client->present()->cityStateZip($this->client->city, $this->client->state, $this->client->postal_code, true) ?: ' ', 'label' => ctrans('texts.postal_city_state')]; + $data['$client.postal_city_state'] = &$data['$postal_city_state']; + $data['$postal_city'] = ['value' => $this->client->present()->cityStateZip($this->client->city, null, $this->client->postal_code, true) ?: ' ', 'label' => ctrans('texts.postal_city')]; + $data['$client.postal_city'] = &$data['$postal_city']; + $data['$client.country'] = &$data['$country']; + $data['$client.email'] = &$data['$email']; + + $data['$client.balance'] = ['value' => Number::formatMoney($this->client->balance, $this->client), 'label' => ctrans('texts.account_balance')]; + $data['$outstanding'] = ['value' => Number::formatMoney($this->client->balance, $this->client), 'label' => ctrans('texts.account_balance')]; + $data['$client_balance'] = ['value' => Number::formatMoney($this->client->balance, $this->client), 'label' => ctrans('texts.account_balance')]; + $data['$paid_to_date'] = ['value' => Number::formatMoney($this->client->paid_to_date, $this->client), 'label' => ctrans('texts.paid_to_date')]; + + $data['$contact.full_name'] = ['value' => isset($this->contact) ? $this->contact->present()->name() : '', 'label' => ctrans('texts.name')]; + $data['$contact.email'] = ['value' => isset($this->contact) ? $this->contact->email : '', 'label' => ctrans('texts.email')]; + $data['$contact.phone'] = ['value' => isset($this->contact) ? $this->contact->phone : '', 'label' => ctrans('texts.phone')]; + + $data['$contact.name'] = ['value' => isset($this->contact) ? $this->contact->present()->name() : 'no contact name on record', 'label' => ctrans('texts.contact_name')]; + $data['$contact.first_name'] = ['value' => isset($this->contact) ? $this->contact->first_name : '', 'label' => ctrans('texts.first_name')]; + $data['$contact.last_name'] = ['value' => isset($this->contact) ? $this->contact->last_name : '', 'label' => ctrans('texts.last_name')]; + $data['$contact.custom1'] = ['value' => isset($this->contact) ? $this->contact->custom_value1 : ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'contact1')]; + $data['$contact.custom2'] = ['value' => isset($this->contact) ? $this->contact->custom_value2 : ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'contact1')]; + $data['$contact.custom3'] = ['value' => isset($this->contact) ? $this->contact->custom_value3 : ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'contact1')]; + $data['$contact.custom4'] = ['value' => isset($this->contact) ? $this->contact->custom_value4 : ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'contact1')]; + $data['$firstName'] = &$data['$contact.first_name']; + + $data['$company.city_state_postal'] = ['value' => $this->company->present()->cityStateZip($this->settings->city, $this->settings->state, $this->settings->postal_code, false) ?: ' ', 'label' => ctrans('texts.city_state_postal')]; + $data['$company.postal_city_state'] = ['value' => $this->company->present()->cityStateZip($this->settings->city, $this->settings->state, $this->settings->postal_code, true) ?: ' ', 'label' => ctrans('texts.postal_city_state')]; + $data['$company.postal_city'] = ['value' => $this->company->present()->cityStateZip($this->settings->city, null, $this->settings->postal_code, true) ?: ' ', 'label' => ctrans('texts.postal_city')]; + $data['$company.name'] = ['value' => $this->company->present()->name() ?: ' ', 'label' => ctrans('texts.company_name')]; + $data['$company.address1'] = ['value' => $this->settings->address1 ?: ' ', 'label' => ctrans('texts.address1')]; + $data['$company.address2'] = ['value' => $this->settings->address2 ?: ' ', 'label' => ctrans('texts.address2')]; + $data['$company.city'] = ['value' => $this->settings->city ?: ' ', 'label' => ctrans('texts.city')]; + $data['$company.state'] = ['value' => $this->settings->state ?: ' ', 'label' => ctrans('texts.state')]; + $data['$company.postal_code'] = ['value' => $this->settings->postal_code ?: ' ', 'label' => ctrans('texts.postal_code')]; + //$data['$company.country'] = ['value' => $this->getCountryName(), 'label' => ctrans('texts.country')]; + $data['$company.phone'] = ['value' => $this->settings->phone ?: ' ', 'label' => ctrans('texts.phone')]; + $data['$company.email'] = ['value' => $this->settings->email ?: ' ', 'label' => ctrans('texts.email')]; + $data['$company.vat_number'] = ['value' => $this->settings->vat_number ?: ' ', 'label' => ctrans('texts.vat_number')]; + $data['$company.id_number'] = ['value' => $this->settings->id_number ?: ' ', 'label' => ctrans('texts.id_number')]; + $data['$company.website'] = ['value' => $this->settings->website ?: ' ', 'label' => ctrans('texts.website')]; + $data['$company.address'] = ['value' => $this->company->present()->address($this->settings) ?: ' ', 'label' => ctrans('texts.address')]; + + $logo = $this->company->present()->logo($this->settings); + + $data['$company.logo'] = ['value' => $logo ?: ' ', 'label' => ctrans('texts.logo')]; + $data['$company_logo'] = &$data['$company.logo']; + $data['$company1'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'company1', $this->settings->custom_value1, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'company1')]; + $data['$company2'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'company2', $this->settings->custom_value2, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'company2')]; + $data['$company3'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'company3', $this->settings->custom_value3, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'company3')]; + $data['$company4'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'company4', $this->settings->custom_value4, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'company4')]; + + $data['$view_link'] = ['value' => $this->buildViewButton($this->payment->getLink(), ctrans('texts.view_payment')), 'label' => ctrans('texts.view_payment')]; + $data['$view_button'] = &$data['$view_link']; + $data['$viewButton'] = &$data['$view_link']; + $data['$viewLink'] = &$data['$view_link']; + $data['$paymentLink'] = &$data['$view_link']; + $data['$portalButton'] = ['value' => $this->buildViewButton($this->payment->getPortalLink(), ctrans('texts.login')), 'label' =>'']; + $data['$portal_url'] = &$data['$portalButton']; + + $data['$view_url'] = ['value' => $this->payment->getLink(), 'label' => ctrans('texts.view_payment')]; + $data['$signature'] = ['value' => $this->settings->email_signature ?: ' ', 'label' => '']; + $data['$emailSignature'] = &$data['$signature']; + + $data['$invoices'] = ['value' => $this->formatInvoices(), 'label' => ctrans('texts.invoices')]; + $data['$invoice_references'] = ['value' => $this->formatInvoiceReferences(), 'label' => ctrans('texts.invoices')]; + $data['$invoice'] = ['value' => $this->formatInvoice(), 'label' => ctrans('texts.invoices')]; + $data['$invoice.po_number'] = ['value' => $this->formatPoNumber(), 'label' => ctrans('texts.po_number')]; + $data['$poNumber'] = &$data['$invoice.po_number']; + $data['$payment.status'] = ['value' => $this->payment->stringStatus($this->payment->status_id), 'label' => ctrans('texts.payment_status')]; + $data['$invoices.amount'] = ['value' => $this->formatInvoiceField('amount'), 'label' => ctrans('texts.invoices')]; + $data['$invoices.balance'] = ['value' => $this->formatInvoiceField('balance'), 'label' => ctrans('texts.invoices')]; + $data['$invoices.due_date'] = ['value' => $this->formatInvoiceField('due_date'), 'label' => ctrans('texts.invoices')]; + $data['$invoices.po_number'] = ['value' => $this->formatInvoiceField('po_number'), 'label' => ctrans('texts.invoices')]; + + + if ($this->payment->status_id == 4) { + $data['$status_logo'] = ['value' => '
' . ctrans('texts.paid') .'
', 'label' => '']; + } else { + $data['$status_logo'] = ['value' => '', 'label' => '']; + } + + + $arrKeysLength = array_map('strlen', array_keys($data)); + array_multisort($arrKeysLength, SORT_DESC, $data); + + return $data; + + } + + private function formatInvoiceField($field) + { + $invoicex = ''; + + foreach ($this->payment->invoices as $invoice) { + $invoice_field = $invoice->{$field}; + + if (in_array($field, ['amount', 'balance'])) { + $invoice_field = Number::formatMoney($invoice_field, $this->client); + } + + if ($field == 'due_date') { + $invoice_field = $this->translateDate($invoice_field, $this->client->date_format(), $this->client->locale()); + } + + $invoicex .= ctrans('texts.invoice_number_short') . "{$invoice->number} {$invoice_field}"; + } + + return $invoicex; + } + + private function formatInvoice() + { + $invoice = ''; + + if ($this->payment->invoices()->exists()) { + $invoice = ctrans('texts.invoice_number_short').implode(',', $this->payment->invoices->pluck('number')->toArray()); + } + + return $invoice; + } + + private function formatPoNumber() + { + $invoice = ''; + + if ($this->payment->invoices()->exists()) { + $invoice = ctrans('texts.po_number_short').implode(',', $this->payment->invoices->pluck('po_number')->toArray()); + } + + return $invoice; + } + + private function formatInvoices() + { + $invoice_list = '

'; + + foreach ($this->payment->invoices as $invoice) { + $invoice_list .= ctrans('texts.invoice_number_short')." {$invoice->number} ".Number::formatMoney($invoice->pivot->amount, $this->client).'
'; + } + + return $invoice_list; + } + + private function formatInvoiceReferences() + { + $invoice_list = '

'; + + foreach ($this->payment->invoices as $invoice) { + if (strlen($invoice->po_number) > 1) { + $invoice_list .= ctrans('texts.po_number')." {$invoice->po_number}
"; + } + + $invoice_list .= ctrans('texts.invoice_number_short')." {$invoice->number}
"; + $invoice_list .= ctrans('texts.invoice_amount').' '.Number::formatMoney($invoice->pivot->amount, $this->client).'
'; + $invoice_list .= ctrans('texts.invoice_balance').' '.Number::formatMoney($invoice->fresh()->balance, $this->client).'
'; + $invoice_list .= '-----
'; + } + + return $invoice_list; + } + + public function makeValues() :array + { + $data = []; + + $values = $this->makePaymentVariables(); + + foreach ($values as $key => $value) { + $data[$key] = $value['value']; + } + + return $data; + } + + /** + * generateLabelsAndValues + * + * @return void + */ + public function generateLabelsAndValues() + { + $data = []; + + $values = $this->makePaymentVariables(); + + foreach ($values as $key => $value) { + $data['values'][$key] = $value['value']; + $data['labels'][$key.'_label'] = $value['label']; + } + + return $data; + } + + /** + * buildViewButton + * + * @param string $link + * @param string $text + * @return string + */ + private function buildViewButton(string $link, string $text): string + { + return ' +
+ + + + + + +
+ + '. $text .' + +
+ +
+ '; + + + return ' + + + + +
+ '. $text .' +
+ '; + } + + + + +} \ No newline at end of file diff --git a/app/Utils/VendorHtmlEngine.php b/app/Utils/VendorHtmlEngine.php index cddb2af04463..aab9b9fb3302 100644 --- a/app/Utils/VendorHtmlEngine.php +++ b/app/Utils/VendorHtmlEngine.php @@ -146,6 +146,7 @@ class VendorHtmlEngine $data['$entity.datetime'] = ['value' => $this->formatDatetime($this->entity->created_at, $this->company->date_format()), 'label' => ctrans('texts.date')]; $data['$po_number'] = &$data['$poNumber']; + $data['$status_logo'] = ['value' => ' ', 'label' => ' ']; $data['$entity'] = ['value' => '', 'label' => ctrans('texts.purchase_order')]; $data['$number'] = ['value' => $this->entity->number ?: ' ', 'label' => ctrans('texts.purchase_order_number')]; $data['$number_short'] = ['value' => $this->entity->number ?: ' ', 'label' => ctrans('texts.purchase_order_number_short')]; diff --git a/composer.json b/composer.json index 824b133a95c5..c85baeeb4327 100644 --- a/composer.json +++ b/composer.json @@ -53,7 +53,7 @@ "halaxa/json-machine": "^0.7.0", "hashids/hashids": "^4.0", "hedii/laravel-gelf-logger": "^7.0", - "imdhemy/laravel-purchases": "^0.10.3", + "imdhemy/laravel-purchases": "^1.7", "intervention/image": "^2.5", "invoiceninja/inspector": "^1.0", "laracasts/presenter": "^0.2.1", @@ -98,7 +98,6 @@ "barryvdh/laravel-ide-helper": "^2.13", "beyondcode/laravel-query-detector": "^1.6", "brianium/paratest": "^6.1", - "darkaonline/l5-swagger": "8.1.0", "fakerphp/faker": "^1.14", "filp/whoops": "^2.7", "friendsofphp/php-cs-fixer": "^3.14", diff --git a/composer.lock b/composer.lock index e18d3cd13a7c..d2bf544f4253 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "dc1556128221db2e30f3d3b21f4f276e", + "content-hash": "5aa22a61531e67324395d207a7c94e27", "packages": [ { "name": "afosto/yaac", @@ -380,16 +380,16 @@ }, { "name": "aws/aws-sdk-php", - "version": "3.261.4", + "version": "3.261.6", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "31bc1e2a528c0f0881e4366d8ee0fa729cd42b00" + "reference": "63b03ec821473861af58439f1a35173e904d0f8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/31bc1e2a528c0f0881e4366d8ee0fa729cd42b00", - "reference": "31bc1e2a528c0f0881e4366d8ee0fa729cd42b00", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/63b03ec821473861af58439f1a35173e904d0f8c", + "reference": "63b03ec821473861af58439f1a35173e904d0f8c", "shasum": "" }, "require": { @@ -468,9 +468,9 @@ "support": { "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", "issues": "https://github.com/aws/aws-sdk-php/issues", - "source": "https://github.com/aws/aws-sdk-php/tree/3.261.4" + "source": "https://github.com/aws/aws-sdk-php/tree/3.261.6" }, - "time": "2023-03-03T19:22:53+00:00" + "time": "2023-03-07T19:21:12+00:00" }, { "name": "bacon/bacon-qr-code", @@ -1508,28 +1508,27 @@ }, { "name": "doctrine/lexer", - "version": "2.1.0", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/doctrine/lexer.git", - "reference": "39ab8fcf5a51ce4b85ca97c7a7d033eb12831124" + "reference": "84a527db05647743d50373e0ec53a152f2cde568" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/39ab8fcf5a51ce4b85ca97c7a7d033eb12831124", - "reference": "39ab8fcf5a51ce4b85ca97c7a7d033eb12831124", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/84a527db05647743d50373e0ec53a152f2cde568", + "reference": "84a527db05647743d50373e0ec53a152f2cde568", "shasum": "" }, "require": { - "doctrine/deprecations": "^1.0", - "php": "^7.1 || ^8.0" + "php": "^8.1" }, "require-dev": { - "doctrine/coding-standard": "^9 || ^10", - "phpstan/phpstan": "^1.3", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "doctrine/coding-standard": "^10", + "phpstan/phpstan": "^1.9", + "phpunit/phpunit": "^9.5", "psalm/plugin-phpunit": "^0.18.3", - "vimeo/psalm": "^4.11 || ^5.0" + "vimeo/psalm": "^5.0" }, "type": "library", "autoload": { @@ -1566,7 +1565,7 @@ ], "support": { "issues": "https://github.com/doctrine/lexer/issues", - "source": "https://github.com/doctrine/lexer/tree/2.1.0" + "source": "https://github.com/doctrine/lexer/tree/3.0.0" }, "funding": [ { @@ -1582,7 +1581,7 @@ "type": "tidelift" } ], - "time": "2022-12-14T08:49:07+00:00" + "time": "2022-12-15T16:57:16+00:00" }, { "name": "dragonmantank/cron-expression", @@ -3046,29 +3045,34 @@ }, { "name": "imdhemy/appstore-iap", - "version": "0.3.11", + "version": "1.5.4", "source": { "type": "git", "url": "https://github.com/imdhemy/appstore-iap.git", - "reference": "f1400b7df2e003f8be0ef2f3fa267f7fbb2b69a5" + "reference": "319253eecb8844fef07848917383d9b4aa9ba2c6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/imdhemy/appstore-iap/zipball/f1400b7df2e003f8be0ef2f3fa267f7fbb2b69a5", - "reference": "f1400b7df2e003f8be0ef2f3fa267f7fbb2b69a5", + "url": "https://api.github.com/repos/imdhemy/appstore-iap/zipball/319253eecb8844fef07848917383d9b4aa9ba2c6", + "reference": "319253eecb8844fef07848917383d9b4aa9ba2c6", "shasum": "" }, "require": { "ext-json": "*", - "guzzlehttp/guzzle": "^6.0|^7.0", - "nesbot/carbon": "^2.41" + "ext-openssl": "*", + "ext-sodium": "*", + "guzzlehttp/guzzle": "^6.5|^7.4", + "lcobucci/jwt": "^4.2", + "nesbot/carbon": "^2.64", + "php": ">=7.4" }, "require-dev": { - "fakerphp/faker": "^1.14", - "friendsofphp/php-cs-fixer": "^2.16", - "phpunit/phpunit": "^8.5", - "symfony/var-dumper": "^5.1", - "vimeo/psalm": "^3.17" + "fakerphp/faker": "^1.15", + "friendsofphp/php-cs-fixer": "^3.0", + "phpunit/phpunit": "^9.5", + "roave/security-advisories": "dev-latest", + "symfony/var-dumper": "^5.3", + "vimeo/psalm": "^5.1" }, "type": "library", "autoload": { @@ -3078,7 +3082,7 @@ }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { @@ -3089,37 +3093,38 @@ "description": "PHP Appstore In-App Purchase implementation", "support": { "issues": "https://github.com/imdhemy/appstore-iap/issues", - "source": "https://github.com/imdhemy/appstore-iap/tree/0.3.11" + "source": "https://github.com/imdhemy/appstore-iap/tree/1.5.4" }, - "time": "2021-05-15T06:44:10+00:00" + "time": "2022-12-11T10:53:59+00:00" }, { "name": "imdhemy/google-play-billing", - "version": "0.6.4", + "version": "1.3.1", "source": { "type": "git", "url": "https://github.com/imdhemy/google-play-billing.git", - "reference": "957ec1a17db844ee74b1ad71252d2fbd489ab033" + "reference": "803b3357dfa31f89d062dbe757e10a482e262a35" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/imdhemy/google-play-billing/zipball/957ec1a17db844ee74b1ad71252d2fbd489ab033", - "reference": "957ec1a17db844ee74b1ad71252d2fbd489ab033", + "url": "https://api.github.com/repos/imdhemy/google-play-billing/zipball/803b3357dfa31f89d062dbe757e10a482e262a35", + "reference": "803b3357dfa31f89d062dbe757e10a482e262a35", "shasum": "" }, "require": { "ext-json": "*", "google/auth": "^1.15", - "guzzlehttp/guzzle": "^6.0|^7.0", + "guzzlehttp/guzzle": "^6.5|^7.4", "nesbot/carbon": "^2.41", - "php": ">=7.1" + "php": ">=7.4" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.16", - "fzaninotto/faker": "^1.9", - "phpunit/phpunit": "^8.5", - "symfony/var-dumper": "^5.1", - "vimeo/psalm": "^3.17" + "fakerphp/faker": "^1.16", + "friendsofphp/php-cs-fixer": "^3.2", + "phpunit/phpunit": "^9.5", + "roave/security-advisories": "dev-latest", + "symfony/var-dumper": "^5.3", + "vimeo/psalm": "^4.12" }, "type": "library", "autoload": { @@ -3128,6 +3133,9 @@ } }, "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], "authors": [ { "name": "imdhemy", @@ -3137,43 +3145,44 @@ "description": "Google Play Billing", "support": { "issues": "https://github.com/imdhemy/google-play-billing/issues", - "source": "https://github.com/imdhemy/google-play-billing/tree/0.6.4" + "source": "https://github.com/imdhemy/google-play-billing/tree/1.3.1" }, - "time": "2021-10-16T09:50:02+00:00" + "time": "2022-12-09T09:08:03+00:00" }, { "name": "imdhemy/laravel-purchases", - "version": "0.10.4", + "version": "1.7.2", "source": { "type": "git", "url": "https://github.com/imdhemy/laravel-in-app-purchases.git", - "reference": "eb9a4d248a626cb6b7a59c9626726fd8534aec78" + "reference": "bc70dfdec89f000c4048ef3fb3527d2d2eee9cb3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/imdhemy/laravel-in-app-purchases/zipball/eb9a4d248a626cb6b7a59c9626726fd8534aec78", - "reference": "eb9a4d248a626cb6b7a59c9626726fd8534aec78", + "url": "https://api.github.com/repos/imdhemy/laravel-in-app-purchases/zipball/bc70dfdec89f000c4048ef3fb3527d2d2eee9cb3", + "reference": "bc70dfdec89f000c4048ef3fb3527d2d2eee9cb3", "shasum": "" }, "require": { "ext-json": "*", - "imdhemy/appstore-iap": "^0.3", - "imdhemy/google-play-billing": "^0.6", - "nesbot/carbon": "^2.41", - "php": ">=7.1" + "ext-openssl": "*", + "imdhemy/appstore-iap": "^1.5", + "imdhemy/google-play-billing": "^1.2", + "laravel/framework": ">=8.0", + "php": ">=7.4" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.17", - "orchestra/testbench": "^5.0", - "phpunit/phpunit": "^8.5", - "psalm/plugin-laravel": "^1.2", - "vimeo/psalm": "^4.3" + "friendsofphp/php-cs-fixer": "^3.14", + "orchestra/testbench": "^6.24", + "psalm/plugin-laravel": "^1.5", + "roave/security-advisories": "dev-latest", + "vimeo/psalm": "^4.30" }, "type": "library", "extra": { "laravel": { "providers": [ - "Imdhemy\\Purchases\\PurchaseServiceProvider" + "Imdhemy\\Purchases\\ServiceProviders\\LiapServiceProvider" ], "aliases": { "Product": "\\Imdhemy\\Purchases\\Facades\\Product", @@ -3193,14 +3202,13 @@ "authors": [ { "name": "imdhemy", - "email": "imdhemy@gmail.com", - "homepage": "http://dhemy.studio", - "role": "Developer" + "email": "imdhemy@gmail.com" } ], - "description": "Laravel receipt validator for Google Play", - "homepage": "https://github.com/imdhemy/laravel-in-app-purchases", + "description": "The top-notch Laravel receipt validator.", + "homepage": "https://imdhemy.com/laravel-iap-docs", "keywords": [ + "app_store", "google_play", "in_app_purchases", "laravel", @@ -3208,7 +3216,7 @@ ], "support": { "issues": "https://github.com/imdhemy/laravel-in-app-purchases/issues", - "source": "https://github.com/imdhemy/laravel-in-app-purchases/tree/0.10.4" + "source": "https://github.com/imdhemy/laravel-in-app-purchases/tree/1.7.2" }, "funding": [ { @@ -3216,7 +3224,7 @@ "type": "github" } ], - "time": "2022-08-20T04:59:54+00:00" + "time": "2023-03-06T15:16:39+00:00" }, { "name": "intervention/image", @@ -8190,16 +8198,16 @@ }, { "name": "sentry/sentry", - "version": "3.13.1", + "version": "3.14.0", "source": { "type": "git", "url": "https://github.com/getsentry/sentry-php.git", - "reference": "71c86fe4699a7f1a40c7d985f3dc7667045152f0" + "reference": "60dd3f74ab21cc2bf53f39bf7c342798bc185c23" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/getsentry/sentry-php/zipball/71c86fe4699a7f1a40c7d985f3dc7667045152f0", - "reference": "71c86fe4699a7f1a40c7d985f3dc7667045152f0", + "url": "https://api.github.com/repos/getsentry/sentry-php/zipball/60dd3f74ab21cc2bf53f39bf7c342798bc185c23", + "reference": "60dd3f74ab21cc2bf53f39bf7c342798bc185c23", "shasum": "" }, "require": { @@ -8257,7 +8265,7 @@ }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { @@ -8278,7 +8286,7 @@ ], "support": { "issues": "https://github.com/getsentry/sentry-php/issues", - "source": "https://github.com/getsentry/sentry-php/tree/3.13.1" + "source": "https://github.com/getsentry/sentry-php/tree/3.14.0" }, "funding": [ { @@ -8290,7 +8298,7 @@ "type": "custom" } ], - "time": "2023-02-10T10:17:57+00:00" + "time": "2023-03-05T21:31:25+00:00" }, { "name": "sentry/sentry-laravel", @@ -12167,16 +12175,16 @@ }, { "name": "turbo124/beacon", - "version": "v1.4.3", + "version": "v1.4.4", "source": { "type": "git", "url": "https://github.com/turbo124/beacon.git", - "reference": "4df55a8f7373fc9dfeed9abf8753e739398b8efc" + "reference": "b300e2d900b0affa8d95e697925e6053fdd884b0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/turbo124/beacon/zipball/4df55a8f7373fc9dfeed9abf8753e739398b8efc", - "reference": "4df55a8f7373fc9dfeed9abf8753e739398b8efc", + "url": "https://api.github.com/repos/turbo124/beacon/zipball/b300e2d900b0affa8d95e697925e6053fdd884b0", + "reference": "b300e2d900b0affa8d95e697925e6053fdd884b0", "shasum": "" }, "require": { @@ -12223,9 +12231,9 @@ "turbo124" ], "support": { - "source": "https://github.com/turbo124/beacon/tree/v1.4.3" + "source": "https://github.com/turbo124/beacon/tree/v1.4.4" }, - "time": "2023-03-06T06:00:33+00:00" + "time": "2023-03-07T08:03:27+00:00" }, { "name": "turbo124/predis", @@ -13590,85 +13598,6 @@ ], "time": "2022-02-25T21:32:43+00:00" }, - { - "name": "darkaonline/l5-swagger", - "version": "8.1.0", - "source": { - "type": "git", - "url": "https://github.com/DarkaOnLine/L5-Swagger.git", - "reference": "aab46bf494ba52dcdd7d259ce178ad33d0327d04" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/DarkaOnLine/L5-Swagger/zipball/aab46bf494ba52dcdd7d259ce178ad33d0327d04", - "reference": "aab46bf494ba52dcdd7d259ce178ad33d0327d04", - "shasum": "" - }, - "require": { - "ext-json": "*", - "laravel/framework": ">=8.40.0 || ^7.0", - "php": "^7.2 || ^8.0", - "swagger-api/swagger-ui": "^3.0", - "symfony/yaml": "^5.0", - "zircote/swagger-php": "3.*" - }, - "require-dev": { - "mockery/mockery": "1.*", - "orchestra/testbench": "6.* || 5.*", - "php-coveralls/php-coveralls": "^2.0", - "phpunit/phpunit": "9.*" - }, - "type": "library", - "extra": { - "laravel": { - "providers": [ - "L5Swagger\\L5SwaggerServiceProvider" - ], - "aliases": { - "L5Swagger": "L5Swagger\\L5SwaggerFacade" - } - } - }, - "autoload": { - "files": [ - "src/helpers.php" - ], - "psr-4": { - "L5Swagger\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Darius Matulionis", - "email": "darius@matulionis.lt" - } - ], - "description": "OpenApi or Swagger integration to Laravel", - "keywords": [ - "api", - "documentation", - "laravel", - "openapi", - "specification", - "swagger", - "ui" - ], - "support": { - "issues": "https://github.com/DarkaOnLine/L5-Swagger/issues", - "source": "https://github.com/DarkaOnLine/L5-Swagger/tree/8.1.0" - }, - "funding": [ - { - "url": "https://github.com/DarkaOnLine", - "type": "github" - } - ], - "time": "2022-01-07T09:08:44+00:00" - }, { "name": "dnoegel/php-xdg-base-dir", "version": "v0.1.1", @@ -13708,30 +13637,30 @@ }, { "name": "doctrine/annotations", - "version": "1.14.3", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/doctrine/annotations.git", - "reference": "fb0d71a7393298a7b232cbf4c8b1f73f3ec3d5af" + "reference": "e157ef3f3124bbf6fe7ce0ffd109e8a8ef284e7f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/fb0d71a7393298a7b232cbf4c8b1f73f3ec3d5af", - "reference": "fb0d71a7393298a7b232cbf4c8b1f73f3ec3d5af", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/e157ef3f3124bbf6fe7ce0ffd109e8a8ef284e7f", + "reference": "e157ef3f3124bbf6fe7ce0ffd109e8a8ef284e7f", "shasum": "" }, "require": { - "doctrine/lexer": "^1 || ^2", + "doctrine/lexer": "^2 || ^3", "ext-tokenizer": "*", - "php": "^7.1 || ^8.0", + "php": "^7.2 || ^8.0", "psr/cache": "^1 || ^2 || ^3" }, "require-dev": { - "doctrine/cache": "^1.11 || ^2.0", - "doctrine/coding-standard": "^9 || ^10", - "phpstan/phpstan": "~1.4.10 || ^1.8.0", + "doctrine/cache": "^2.0", + "doctrine/coding-standard": "^10", + "phpstan/phpstan": "^1.8.0", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "symfony/cache": "^4.4 || ^5.4 || ^6", + "symfony/cache": "^5.4 || ^6", "vimeo/psalm": "^4.10" }, "suggest": { @@ -13778,9 +13707,9 @@ ], "support": { "issues": "https://github.com/doctrine/annotations/issues", - "source": "https://github.com/doctrine/annotations/tree/1.14.3" + "source": "https://github.com/doctrine/annotations/tree/2.0.1" }, - "time": "2023-02-01T09:20:38+00:00" + "time": "2023-02-02T22:02:53+00:00" }, { "name": "doctrine/instantiator", @@ -14016,16 +13945,16 @@ }, { "name": "filp/whoops", - "version": "2.15.0", + "version": "2.15.1", "source": { "type": "git", "url": "https://github.com/filp/whoops.git", - "reference": "3e8aebbca9f0ae6f618962c4ad514077fd365ab3" + "reference": "e864ac957acd66e1565f25efda61e37791a5db0b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filp/whoops/zipball/3e8aebbca9f0ae6f618962c4ad514077fd365ab3", - "reference": "3e8aebbca9f0ae6f618962c4ad514077fd365ab3", + "url": "https://api.github.com/repos/filp/whoops/zipball/e864ac957acd66e1565f25efda61e37791a5db0b", + "reference": "e864ac957acd66e1565f25efda61e37791a5db0b", "shasum": "" }, "require": { @@ -14075,7 +14004,7 @@ ], "support": { "issues": "https://github.com/filp/whoops/issues", - "source": "https://github.com/filp/whoops/tree/2.15.0" + "source": "https://github.com/filp/whoops/tree/2.15.1" }, "funding": [ { @@ -14083,31 +14012,31 @@ "type": "github" } ], - "time": "2023-03-03T12:00:00+00:00" + "time": "2023-03-06T18:09:13+00:00" }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.14.2", + "version": "v3.14.4", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "14f0541651841b63640e7aafad041ad55dc7aa88" + "reference": "1b3d9dba63d93b8a202c31e824748218781eae6b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/14f0541651841b63640e7aafad041ad55dc7aa88", - "reference": "14f0541651841b63640e7aafad041ad55dc7aa88", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/1b3d9dba63d93b8a202c31e824748218781eae6b", + "reference": "1b3d9dba63d93b8a202c31e824748218781eae6b", "shasum": "" }, "require": { "composer/semver": "^3.3", "composer/xdebug-handler": "^3.0.3", - "doctrine/annotations": "^1.14.2 || ^2", - "doctrine/lexer": "^2", + "doctrine/annotations": "^2", + "doctrine/lexer": "^2 || ^3", "ext-json": "*", "ext-tokenizer": "*", "php": "^7.4 || ^8.0", - "sebastian/diff": "^4.0", + "sebastian/diff": "^4.0 || ^5.0", "symfony/console": "^5.4 || ^6.0", "symfony/event-dispatcher": "^5.4 || ^6.0", "symfony/filesystem": "^5.4 || ^6.0", @@ -14165,7 +14094,7 @@ "description": "A tool to automatically fix PHP code style", "support": { "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.14.2" + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.14.4" }, "funding": [ { @@ -14173,7 +14102,7 @@ "type": "github" } ], - "time": "2023-01-29T23:47:01+00:00" + "time": "2023-02-09T21:49:13+00:00" }, { "name": "hamcrest/hamcrest-php", @@ -15091,16 +15020,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.10.3", + "version": "1.10.5", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "5419375b5891add97dc74be71e6c1c34baaddf64" + "reference": "1fb6f494d82455151ecf15c5c191923f5d84324e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/5419375b5891add97dc74be71e6c1c34baaddf64", - "reference": "5419375b5891add97dc74be71e6c1c34baaddf64", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/1fb6f494d82455151ecf15c5c191923f5d84324e", + "reference": "1fb6f494d82455151ecf15c5c191923f5d84324e", "shasum": "" }, "require": { @@ -15130,7 +15059,7 @@ ], "support": { "issues": "https://github.com/phpstan/phpstan/issues", - "source": "https://github.com/phpstan/phpstan/tree/1.10.3" + "source": "https://github.com/phpstan/phpstan/tree/1.10.5" }, "funding": [ { @@ -15146,20 +15075,20 @@ "type": "tidelift" } ], - "time": "2023-02-25T14:47:13+00:00" + "time": "2023-03-07T16:48:45+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "9.2.25", + "version": "9.2.26", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "0e2b40518197a8c0d4b08bc34dfff1c99c508954" + "reference": "443bc6912c9bd5b409254a40f4b0f4ced7c80ea1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/0e2b40518197a8c0d4b08bc34dfff1c99c508954", - "reference": "0e2b40518197a8c0d4b08bc34dfff1c99c508954", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/443bc6912c9bd5b409254a40f4b0f4ced7c80ea1", + "reference": "443bc6912c9bd5b409254a40f4b0f4ced7c80ea1", "shasum": "" }, "require": { @@ -15181,8 +15110,8 @@ "phpunit/phpunit": "^9.3" }, "suggest": { - "ext-pcov": "*", - "ext-xdebug": "*" + "ext-pcov": "PHP extension that provides line coverage", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" }, "type": "library", "extra": { @@ -15215,7 +15144,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.25" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.26" }, "funding": [ { @@ -15223,7 +15152,7 @@ "type": "github" } ], - "time": "2023-02-25T05:32:00+00:00" + "time": "2023-03-06T12:58:08+00:00" }, { "name": "phpunit/php-file-iterator", @@ -16827,67 +16756,6 @@ ], "time": "2023-01-03T19:28:04+00:00" }, - { - "name": "swagger-api/swagger-ui", - "version": "v3.52.5", - "source": { - "type": "git", - "url": "https://github.com/swagger-api/swagger-ui.git", - "reference": "f1ad60dc92e7edb0898583e16c3e66fe3e9eada2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/swagger-api/swagger-ui/zipball/f1ad60dc92e7edb0898583e16c3e66fe3e9eada2", - "reference": "f1ad60dc92e7edb0898583e16c3e66fe3e9eada2", - "shasum": "" - }, - "type": "library", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Anna Bodnia", - "email": "anna.bodnia@gmail.com" - }, - { - "name": "Buu Nguyen", - "email": "buunguyen@gmail.com" - }, - { - "name": "Josh Ponelat", - "email": "jponelat@gmail.com" - }, - { - "name": "Kyle Shockey", - "email": "kyleshockey1@gmail.com" - }, - { - "name": "Robert Barnwell", - "email": "robert@robertismy.name" - }, - { - "name": "Sahar Jafari", - "email": "shr.jafari@gmail.com" - } - ], - "description": " Swagger UI is a collection of HTML, Javascript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API.", - "homepage": "http://swagger.io", - "keywords": [ - "api", - "documentation", - "openapi", - "specification", - "swagger", - "ui" - ], - "support": { - "issues": "https://github.com/swagger-api/swagger-ui/issues", - "source": "https://github.com/swagger-api/swagger-ui/tree/v3.52.5" - }, - "time": "2021-10-14T14:25:14+00:00" - }, { "name": "symfony/polyfill-php81", "version": "v1.27.0", @@ -17029,81 +16897,6 @@ ], "time": "2023-02-14T08:44:56+00:00" }, - { - "name": "symfony/yaml", - "version": "v5.4.21", - "source": { - "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "3713e20d93e46e681e51605d213027e48dab3469" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/3713e20d93e46e681e51605d213027e48dab3469", - "reference": "3713e20d93e46e681e51605d213027e48dab3469", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-ctype": "^1.8" - }, - "conflict": { - "symfony/console": "<5.3" - }, - "require-dev": { - "symfony/console": "^5.3|^6.0" - }, - "suggest": { - "symfony/console": "For validating YAML files using the lint command" - }, - "bin": [ - "Resources/bin/yaml-lint" - ], - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Yaml\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Loads and dumps YAML files", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/yaml/tree/v5.4.21" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-02-21T19:46:44+00:00" - }, { "name": "theseer/tokenizer", "version": "1.2.1", @@ -17312,79 +17105,6 @@ }, "abandoned": "symfony/filesystem", "time": "2015-12-17T08:42:14+00:00" - }, - { - "name": "zircote/swagger-php", - "version": "3.3.7", - "source": { - "type": "git", - "url": "https://github.com/zircote/swagger-php.git", - "reference": "e8c3bb316e385e93a0c7e8b2aa0681079244c381" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zircote/swagger-php/zipball/e8c3bb316e385e93a0c7e8b2aa0681079244c381", - "reference": "e8c3bb316e385e93a0c7e8b2aa0681079244c381", - "shasum": "" - }, - "require": { - "doctrine/annotations": "^1.7", - "ext-json": "*", - "php": ">=7.2", - "psr/log": "^1.1 || ^2.0 || ^3.0", - "symfony/finder": ">=2.2", - "symfony/yaml": ">=3.3" - }, - "require-dev": { - "composer/package-versions-deprecated": "1.11.99.2", - "friendsofphp/php-cs-fixer": "^2.17 || ^3.0", - "phpunit/phpunit": ">=8.5.14" - }, - "bin": [ - "bin/openapi" - ], - "type": "library", - "autoload": { - "files": [ - "src/functions.php" - ], - "psr-4": { - "OpenApi\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Robert Allen", - "email": "zircote@gmail.com" - }, - { - "name": "Bob Fanger", - "email": "bfanger@gmail.com", - "homepage": "https://bfanger.nl" - }, - { - "name": "Martin Rademacher", - "email": "mano@radebatz.net", - "homepage": "https://radebatz.net" - } - ], - "description": "swagger-php - Generate interactive documentation for your RESTful API using phpdoc annotations", - "homepage": "https://github.com/zircote/swagger-php/", - "keywords": [ - "api", - "json", - "rest", - "service discovery" - ], - "support": { - "issues": "https://github.com/zircote/swagger-php/issues", - "source": "https://github.com/zircote/swagger-php/tree/3.3.7" - }, - "time": "2023-01-03T21:17:10+00:00" } ], "aliases": [], diff --git a/config/l5-swagger.php b/config/l5-swagger.php deleted file mode 100644 index b83b2dae0c50..000000000000 --- a/config/l5-swagger.php +++ /dev/null @@ -1,198 +0,0 @@ - 'default', - 'documentations' => [ - 'default' => [ - 'api' => [ - 'title' => 'L5 Swagger UI', - ], - - 'routes' => [ - /* - * Route for accessing api documentation interface - */ - 'api' => 'api/documentation', - ], - 'paths' => [ - /* - * File name of the generated json documentation file - */ - 'docs_json' => 'api-docs.json', - - /* - * File name of the generated YAML documentation file - */ - 'docs_yaml' => 'api-docs.yaml', - - /* - * Absolute paths to directory containing the swagger annotations are stored. - */ - 'annotations' => [ - base_path('app'), - ], - - ], - ], - ], - 'defaults' => [ - 'routes' => [ - /* - * Route for accessing parsed swagger annotations. - */ - 'docs' => 'swagger-docs-that-should-be-inaccessible', - - /* - * Route for Oauth2 authentication callback. - */ - 'oauth2_callback' => 'api/oauth2-callback', - - /* - * Middleware allows to prevent unexpected access to API documentation - */ - 'middleware' => [ - 'api' => [], - 'asset' => [], - 'docs' => [], - 'oauth2_callback' => [], - ], - - /* - * Route Group options - */ - 'group_options' => [], - ], - - 'paths' => [ - /* - * Absolute path to location where parsed annotations will be stored - */ - 'docs' => storage_path('api-docs'), - - /* - * Absolute path to directory where to export views - */ - 'views' => base_path('resources/views/vendor/l5-swagger'), - - /* - * Edit to set the api's base path - */ - 'base' => env('L5_SWAGGER_BASE_PATH', null), - - /* - * Edit to set path where swagger ui assets should be stored - */ - 'swagger_ui_assets_path' => env('L5_SWAGGER_UI_ASSETS_PATH', 'vendor/swagger-api/swagger-ui/dist/'), - - /* - * Absolute path to directories that should be exclude from scanning - */ - 'excludes' => [], - ], - - /* - * API security definitions. Will be generated into documentation file. - */ - 'securityDefinitions' => [ - 'securitySchemes' => [ - /* - * Examples of Security schemes - */ - /* - 'api_key_security_example' => [ // Unique name of security - 'type' => 'apiKey', // The type of the security scheme. Valid values are "basic", "apiKey" or "oauth2". - 'description' => 'A short description for security scheme', - 'name' => 'api_key', // The name of the header or query parameter to be used. - 'in' => 'header', // The location of the API key. Valid values are "query" or "header". - ], - 'oauth2_security_example' => [ // Unique name of security - 'type' => 'oauth2', // The type of the security scheme. Valid values are "basic", "apiKey" or "oauth2". - 'description' => 'A short description for oauth2 security scheme.', - 'flow' => 'implicit', // The flow used by the OAuth2 security scheme. Valid values are "implicit", "password", "application" or "accessCode". - 'authorizationUrl' => 'http://example.com/auth', // The authorization URL to be used for (implicit/accessCode) - //'tokenUrl' => 'http://example.com/auth' // The authorization URL to be used for (password/application/accessCode) - 'scopes' => [ - 'read:projects' => 'read your projects', - 'write:projects' => 'modify projects in your account', - ] - ], - */ - - /* Open API 3.0 support - 'passport' => [ // Unique name of security - 'type' => 'oauth2', // The type of the security scheme. Valid values are "basic", "apiKey" or "oauth2". - 'description' => 'Laravel passport oauth2 security.', - 'in' => 'header', - 'scheme' => 'https', - 'flows' => [ - "password" => [ - "authorizationUrl" => config('app.url') . '/oauth/authorize', - "tokenUrl" => config('app.url') . '/oauth/token', - "refreshUrl" => config('app.url') . '/token/refresh', - "scopes" => [] - ], - ], - ], - */ - ], - 'security' => [ - /* - * Examples of Securities - */ - [ - /* - 'oauth2_security_example' => [ - 'read', - 'write' - ], - - 'passport' => [] - */ - ], - ], - ], - - /* - * Set this to `true` in development mode so that docs would be regenerated on each request - * Set this to `false` to disable swagger generation on production - */ - 'generate_always' => env('L5_SWAGGER_GENERATE_ALWAYS', false), - - /* - * Set this to `true` to generate a copy of documentation in yaml format - */ - 'generate_yaml_copy' => env('L5_SWAGGER_GENERATE_YAML_COPY', true), - - /* - * Edit to trust the proxy's ip address - needed for AWS Load Balancer - * string[] - */ - 'proxy' => false, - - /* - * Configs plugin allows to fetch external configs instead of passing them to SwaggerUIBundle. - * See more at: https://github.com/swagger-api/swagger-ui#configs-plugin - */ - 'additional_config_url' => null, - - /* - * Apply a sort to the operation list of each API. It can be 'alpha' (sort by paths alphanumerically), - * 'method' (sort by HTTP method). - * Default is the order returned by the server unchanged. - */ - 'operations_sort' => env('L5_SWAGGER_OPERATIONS_SORT', null), - - /* - * Pass the validatorUrl parameter to SwaggerUi init on the JS side. - * A null value here disables validation. - */ - 'validator_url' => null, - - /* - * Uncomment to add constants which can be used in annotations - */ - // 'constants' => [ - // 'L5_SWAGGER_CONST_HOST' => env('L5_SWAGGER_CONST_HOST', 'http://my-default-host.com'), - // ], - ], -]; diff --git a/config/liap.php b/config/liap.php new file mode 100644 index 000000000000..b7f91958ab8e --- /dev/null +++ b/config/liap.php @@ -0,0 +1,116 @@ + [ + 'signed' => false, + 'middleware' => [], + 'prefix' => '', + ], + + /* + |-------------------------------------------------------------------------- + | Google Play Default Package name + |-------------------------------------------------------------------------- + | + | This value is the default package name used when the package name is not + | provided while verifying the receipts. + | + */ + 'google_play_package_name' => env('GOOGLE_PLAY_PACKAGE_NAME', 'com.invoiceninja.app'), + + /* + |-------------------------------------------------------------------------- + | Google Application Credentials + |-------------------------------------------------------------------------- + | + | This value is the path to the Google Application Credentials file. + | @see https://imdhemy.com/laravel-iap-docs/docs/credentials/google-play + | + */ + 'google_application_credentials' => env('GOOGLE_APPLICATION_CREDENTIALS', base_path('VERSION.txt')), + + /* + |-------------------------------------------------------------------------- + | App Store Password + |-------------------------------------------------------------------------- + | + | This value is the app-specific share password generated by the app store. + | @see https://imdhemy.com/laravel-iap-docs/docs/credentials/app-store + | + */ + 'appstore_password' => env('APPSTORE_PASSWORD', ''), + + /* + |-------------------------------------------------------------------------- + | Event Listeners + |-------------------------------------------------------------------------- + | + | This configuration is used to determine the event listeners that will be + | registered with the application. + | You can find a list of all available events of the documentation + | + | @see https://imdhemy.com/laravel-iap-docs/docs/server-notifications/event-list + | @see https://imdhemy.com/laravel-iap-docs/docs/get-started/event-listeners + | + */ + 'eventListeners' => [ + /* + |-------------------------------------------------------------------------- + | App Store Events + |-------------------------------------------------------------------------- + | + | These event listeners are triggered when a new notification is received from App Store. + | @see https://imdhemy.com/laravel-iap-docs/docs/server-notifications/event-list#app-store-events + | + */ + + /* \Imdhemy\Purchases\Events\AppStore\Cancel::class => [ + \App\Listeners\AppStore\Cancel::class, + ],*/ + + /* + |-------------------------------------------------------------------------- + | Google Play Events + |-------------------------------------------------------------------------- + | + | These event listeners are triggered when a new notification is received from Google Play + | @see @see https://imdhemy.com/laravel-iap-docs/docs/server-notifications/event-list#google-play-events + */ + + /* \Imdhemy\Purchases\Events\GooglePlay\SubscriptionRecovered::class => [ + \App\Listeners\GooglePlay\SubscriptionRecovered::class, + ],*/ + SubscriptionRenewed::class => [PlayStoreRenewSubscription::class], + DidRenew::class => [AppStoreRenewSubscription::class], + + ], + + /* + | -------------------------------------------------------------------------- + | App store JWT configuration + | -------------------------------------------------------------------------- + | + | The following configuration is used to generate the JWT token used to + | authenticate with the App Store server. + */ + // Your private key ID from App Store Connect (Ex: 2X9R4HXF34) + 'appstore_private_key_id' => env('APPSTORE_PRIVATE_KEY_ID'), + // The path to your private key file (Ex: /path/to/SuperSecretKey_ABC123.p8) + 'appstore_private_key' => env('APPSTORE_PRIVATE_KEY'), + // Your issuer ID from the Keys page in App Store Connect (Ex: "57246542-96fe-1a63-e053-0824d011072a") + 'appstore_issuer_id' => env('APPSTORE_ISSUER_ID'), + // Your app’s bundle ID (Ex: “com.example.testbundleid2021”) + 'appstore_bundle_id' => env('APPSTORE_BUNDLE_ID'), +]; diff --git a/config/purchase.php b/config/purchase.php deleted file mode 100644 index 4b735d6457ef..000000000000 --- a/config/purchase.php +++ /dev/null @@ -1,74 +0,0 @@ - [], - - 'google_play_package_name' => env('GOOGLE_PLAY_PACKAGE_NAME', 'com.invoiceninja.app'), - - 'appstore_password' => env('APPSTORE_PASSWORD', ''), - - 'eventListeners' => [ - /** - * -------------------------------------------------------- - * Google Play Events - * -------------------------------------------------------- - */ - SubscriptionPurchased::class => [], - SubscriptionRenewed::class => [PlayStoreRenewSubscription::class], - SubscriptionInGracePeriod::class => [], - SubscriptionExpired::class => [], - SubscriptionCanceled::class => [], - SubscriptionPaused::class => [], - SubscriptionRestarted::class => [], - SubscriptionDeferred::class => [], - SubscriptionRevoked::class => [], - SubscriptionOnHold::class => [], - SubscriptionRecovered::class => [], - SubscriptionPauseScheduleChanged::class => [], - SubscriptionPriceChangeConfirmed::class => [], - - /** - * -------------------------------------------------------- - * Appstore Events - * -------------------------------------------------------- - */ - Cancel::class => [], - DidChangeRenewalPref::class => [], - DidChangeRenewalStatus::class => [], - DidFailToRenew::class => [], - DidRecover::class => [], - DidRenew::class => [AppStoreRenewSubscription::class], - InitialBuy::class => [], - InteractiveRenewal::class => [], - PriceIncreaseConsent::class => [], - Refund::class => [], - Revoke::class => [], - ], -]; diff --git a/database/seeders/DateFormatsSeeder.php b/database/seeders/DateFormatsSeeder.php index e3ed5c2373c7..2dd48c8849d4 100644 --- a/database/seeders/DateFormatsSeeder.php +++ b/database/seeders/DateFormatsSeeder.php @@ -42,7 +42,9 @@ class DateFormatsSeeder extends Seeder foreach ($formats as $format) { // use binary to support case-sensitive search - $record = DateFormat::whereRaw('BINARY `format`= ?', [$format['format']])->first(); + // $record = DateFormat::whereRaw('BINARY `format`= ?', [$format['format']])->first(); + $record = DateFormat::find($format['id']); + if ($record) { $record->format_moment = $format['format_moment']; $record->format_dart = $format['format_dart']; @@ -71,7 +73,10 @@ class DateFormatsSeeder extends Seeder ]; foreach ($formats as $format) { - $record = DatetimeFormat::whereRaw('BINARY `format`= ?', [$format['format']])->first(); + // $record = DatetimeFormat::whereRaw('BINARY `format`= ?', [$format['format']])->first(); + + $record = DatetimeFormat::find($format['id']); + if ($record) { $record->format_moment = $format['format_moment']; $record->format_dart = $format['format_dart']; diff --git a/lang/en/texts.php b/lang/en/texts.php index ff03778970f7..a72d217ab0cb 100644 --- a/lang/en/texts.php +++ b/lang/en/texts.php @@ -5012,6 +5012,8 @@ $LANG = array( 'add_stripe' => 'Add Stripe', 'invalid_coupon' => 'Invalid Coupon', 'no_assigned_tasks' => 'No billable tasks for this project', + 'authorization_failure' => 'Insufficient permissions to perform this action', + 'authorization_sms_failure' => 'Please verify your account to send emails.', ); diff --git a/phpstan.neon b/phpstan.neon index 6f69d51b9a6b..75a327b3ec14 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,5 +1,5 @@ parameters: - level: 6 + level: 2 paths: - - app - - tests + - app + - tests diff --git a/public/vendor/livewire/livewire.js b/public/vendor/livewire/livewire.js index 35fcae6f0cf9..c28a26b9f00d 100644 --- a/public/vendor/livewire/livewire.js +++ b/public/vendor/livewire/livewire.js @@ -10,5 +10,5 @@ * * Copyright (c) 2014-2018, Jon Schlinkert. * Released under the MIT License. - */function join(segs,joinChar,options){return"function"==typeof options.join?options.join(segs):segs[0]+joinChar+segs[1]}function split$1(path,splitChar,options){return"function"==typeof options.split?options.split(path):path.split(splitChar)}function isValid(key,target,options){return"function"!=typeof options.isValid||options.isValid(key,target)}function isValidObject(val){return isobject(val)||Array.isArray(val)||"function"==typeof val}var _default$6=function(){function _default(el){var skipWatcher=arguments.length>1&&void 0!==arguments[1]&&arguments[1];_classCallCheck(this,_default),this.el=el,this.skipWatcher=skipWatcher,this.resolveCallback=function(){},this.rejectCallback=function(){},this.signature=(Math.random()+1).toString(36).substring(8)}return _createClass(_default,[{key:"toId",value:function(){return btoa(encodeURIComponent(this.el.outerHTML))}},{key:"onResolve",value:function(callback){this.resolveCallback=callback}},{key:"onReject",value:function(callback){this.rejectCallback=callback}},{key:"resolve",value:function(thing){this.resolveCallback(thing)}},{key:"reject",value:function(thing){this.rejectCallback(thing)}}]),_default}(),_default$5=function(_Action){_inherits(_default,_Action);var _super=_createSuper(_default);function _default(event,params,el){var _this;return _classCallCheck(this,_default),(_this=_super.call(this,el)).type="fireEvent",_this.payload={id:_this.signature,event:event,params:params},_this}return _createClass(_default,[{key:"toId",value:function(){return btoa(encodeURIComponent(this.type,this.payload.event,JSON.stringify(this.payload.params)))}}]),_default}(_default$6),MessageBus=function(){function MessageBus(){_classCallCheck(this,MessageBus),this.listeners={}}return _createClass(MessageBus,[{key:"register",value:function(name,callback){this.listeners[name]||(this.listeners[name]=[]),this.listeners[name].push(callback)}},{key:"call",value:function(name){for(var _len=arguments.length,params=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)params[_key-1]=arguments[_key];(this.listeners[name]||[]).forEach((function(callback){callback.apply(void 0,params)}))}},{key:"has",value:function(name){return Object.keys(this.listeners).includes(name)}}]),MessageBus}(),HookManager={availableHooks:["component.initialized","element.initialized","element.updating","element.updated","element.removed","message.sent","message.failed","message.received","message.processed","interceptWireModelSetValue","interceptWireModelAttachListener","beforeReplaceState","beforePushState"],bus:new MessageBus,register:function(name,callback){if(!this.availableHooks.includes(name))throw"Livewire: Referencing unknown hook: [".concat(name,"]");this.bus.register(name,callback)},call:function(name){for(var _this$bus,_len=arguments.length,params=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)params[_key-1]=arguments[_key];(_this$bus=this.bus).call.apply(_this$bus,[name].concat(params))}},DirectiveManager={directives:new MessageBus,register:function(name,callback){if(this.has(name))throw"Livewire: Directive already registered: [".concat(name,"]");this.directives.register(name,callback)},call:function(name,el,directive,component){this.directives.call(name,el,directive,component)},has:function(name){return this.directives.has(name)}},store$2={componentsById:{},listeners:new MessageBus,initialRenderIsFinished:!1,livewireIsInBackground:!1,livewireIsOffline:!1,sessionHasExpired:!1,sessionHasExpiredCallback:void 0,directives:DirectiveManager,hooks:HookManager,onErrorCallback:function(){},components:function(){var _this=this;return Object.keys(this.componentsById).map((function(key){return _this.componentsById[key]}))},addComponent:function(component){return this.componentsById[component.id]=component},findComponent:function(id){return this.componentsById[id]},getComponentsByName:function(name){return this.components().filter((function(component){return component.name===name}))},hasComponent:function(id){return!!this.componentsById[id]},tearDownComponents:function(){var _this2=this;this.components().forEach((function(component){_this2.removeComponent(component)}))},on:function(event,callback){this.listeners.register(event,callback)},emit:function(event){for(var _this$listeners,_len=arguments.length,params=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)params[_key-1]=arguments[_key];(_this$listeners=this.listeners).call.apply(_this$listeners,[event].concat(params)),this.componentsListeningForEvent(event).forEach((function(component){return component.addAction(new _default$5(event,params))}))},emitUp:function(el,event){for(var _len2=arguments.length,params=new Array(_len2>2?_len2-2:0),_key2=2;_key2<_len2;_key2++)params[_key2-2]=arguments[_key2];this.componentsListeningForEventThatAreTreeAncestors(el,event).forEach((function(component){return component.addAction(new _default$5(event,params))}))},emitSelf:function(componentId,event){var component=this.findComponent(componentId);if(component.listeners.includes(event)){for(var _len3=arguments.length,params=new Array(_len3>2?_len3-2:0),_key3=2;_key3<_len3;_key3++)params[_key3-2]=arguments[_key3];component.addAction(new _default$5(event,params))}},emitTo:function(componentName,event){for(var _len4=arguments.length,params=new Array(_len4>2?_len4-2:0),_key4=2;_key4<_len4;_key4++)params[_key4-2]=arguments[_key4];var components=this.getComponentsByName(componentName);components.forEach((function(component){component.listeners.includes(event)&&component.addAction(new _default$5(event,params))}))},componentsListeningForEventThatAreTreeAncestors:function(el,event){for(var parentIds=[],parent=el.parentElement.closest("[wire\\:id]");parent;)parentIds.push(parent.getAttribute("wire:id")),parent=parent.parentElement.closest("[wire\\:id]");return this.components().filter((function(component){return component.listeners.includes(event)&&parentIds.includes(component.id)}))},componentsListeningForEvent:function(event){return this.components().filter((function(component){return component.listeners.includes(event)}))},registerDirective:function(name,callback){this.directives.register(name,callback)},registerHook:function(name,callback){this.hooks.register(name,callback)},callHook:function(name){for(var _this$hooks,_len5=arguments.length,params=new Array(_len5>1?_len5-1:0),_key5=1;_key5<_len5;_key5++)params[_key5-1]=arguments[_key5];(_this$hooks=this.hooks).call.apply(_this$hooks,[name].concat(params))},changeComponentId:function(component,newId){var oldId=component.id;component.id=newId,component.fingerprint.id=newId,this.componentsById[newId]=component,delete this.componentsById[oldId],this.components().forEach((function(component){var children=component.serverMemo.children||{};Object.entries(children).forEach((function(_ref){var _ref2=_slicedToArray(_ref,2),key=_ref2[0],_ref2$=_ref2[1],id=_ref2$.id;_ref2$.tagName,id===oldId&&(children[key].id=newId)}))}))},removeComponent:function(component){component.tearDown(),delete this.componentsById[component.id]},onError:function(callback){this.onErrorCallback=callback},getClosestParentId:function(childId,subsetOfParentIds){var _this3=this,distancesByParentId={};subsetOfParentIds.forEach((function(parentId){var distance=_this3.getDistanceToChild(parentId,childId);distance&&(distancesByParentId[parentId]=distance)}));var closestParentId,smallestDistance=Math.min.apply(Math,_toConsumableArray(Object.values(distancesByParentId)));return Object.entries(distancesByParentId).forEach((function(_ref3){var _ref4=_slicedToArray(_ref3,2),parentId=_ref4[0];_ref4[1]===smallestDistance&&(closestParentId=parentId)})),closestParentId},getDistanceToChild:function(parentId,childId){var distanceMemo=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,parentComponent=this.findComponent(parentId);if(parentComponent){var childIds=parentComponent.childIds;if(childIds.includes(childId))return distanceMemo;for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:null;null===node&&(node=document);var allEls=Array.from(node.querySelectorAll("[wire\\:initial-data]")),onlyChildEls=Array.from(node.querySelectorAll("[wire\\:initial-data] [wire\\:initial-data]"));return allEls.filter((function(el){return!onlyChildEls.includes(el)}))},allModelElementsInside:function(root){return Array.from(root.querySelectorAll("[wire\\:model]"))},getByAttributeAndValue:function(attribute,value){return document.querySelector("[wire\\:".concat(attribute,'="').concat(value,'"]'))},nextFrame:function(fn){var _this=this;requestAnimationFrame((function(){requestAnimationFrame(fn.bind(_this))}))},closestRoot:function(el){return this.closestByAttribute(el,"id")},closestByAttribute:function(el,attribute){var closestEl=el.closest("[wire\\:".concat(attribute,"]"));if(!closestEl)throw"\nLivewire Error:\n\nCannot find parent element in DOM tree containing attribute: [wire:".concat(attribute,"].\n\nUsually this is caused by Livewire's DOM-differ not being able to properly track changes.\n\nReference the following guide for common causes: https://laravel-livewire.com/docs/troubleshooting \n\nReferenced element:\n\n").concat(el.outerHTML,"\n");return closestEl},isComponentRootEl:function(el){return this.hasAttribute(el,"id")},hasAttribute:function(el,attribute){return el.hasAttribute("wire:".concat(attribute))},getAttribute:function(el,attribute){return el.getAttribute("wire:".concat(attribute))},removeAttribute:function(el,attribute){return el.removeAttribute("wire:".concat(attribute))},setAttribute:function(el,attribute,value){return el.setAttribute("wire:".concat(attribute),value)},hasFocus:function(el){return el===document.activeElement},isInput:function(el){return["INPUT","TEXTAREA","SELECT"].includes(el.tagName.toUpperCase())},isTextInput:function(el){return["INPUT","TEXTAREA"].includes(el.tagName.toUpperCase())&&!["checkbox","radio"].includes(el.type)},valueFromInput:function(el,component){if("checkbox"===el.type){var modelName=wireDirectives(el).get("model").value,modelValue=component.deferredActions[modelName]?component.deferredActions[modelName].payload.value:getValue(component.data,modelName);return Array.isArray(modelValue)?this.mergeCheckboxValueIntoArray(el,modelValue):!!el.checked&&(el.getAttribute("value")||!0)}return"SELECT"===el.tagName&&el.multiple?this.getSelectValues(el):el.value},mergeCheckboxValueIntoArray:function(el,arrayValue){return el.checked?arrayValue.includes(el.value)?arrayValue:arrayValue.concat(el.value):arrayValue.filter((function(item){return item!=el.value}))},setInputValueFromModel:function(el,component){var modelString=wireDirectives(el).get("model").value,modelValue=getValue(component.data,modelString);"input"===el.tagName.toLowerCase()&&"file"===el.type||this.setInputValue(el,modelValue)},setInputValue:function(el,value){if(store$2.callHook("interceptWireModelSetValue",value,el),"radio"===el.type)el.checked=el.value==value;else if("checkbox"===el.type)if(Array.isArray(value)){var valueFound=!1;value.forEach((function(val){val==el.value&&(valueFound=!0)})),el.checked=valueFound}else el.checked=!!value;else"SELECT"===el.tagName?this.updateSelect(el,value):(value=void 0===value?"":value,el.value=value)},getSelectValues:function(el){return Array.from(el.options).filter((function(option){return option.selected})).map((function(option){return option.value||option.text}))},updateSelect:function(el,value){var arrayWrappedValue=[].concat(value).map((function(value){return value+""}));Array.from(el.options).forEach((function(option){option.selected=arrayWrappedValue.includes(option.value)}))}},fails=function(exec){try{return!!exec()}catch(error){return!0}},functionBindNative=!fails((function(){var test=function(){}.bind();return"function"!=typeof test||test.hasOwnProperty("prototype")})),FunctionPrototype$2=Function.prototype,call$2=FunctionPrototype$2.call,uncurryThisWithBind=functionBindNative&&FunctionPrototype$2.bind.bind(call$2,call$2),functionUncurryThis=functionBindNative?uncurryThisWithBind:function(fn){return function(){return call$2.apply(fn,arguments)}},ceil=Math.ceil,floor=Math.floor,mathTrunc=Math.trunc||function(x){var n=+x;return(n>0?floor:ceil)(n)},toIntegerOrInfinity=function(argument){var number=+argument;return number!=number||0===number?0:mathTrunc(number)},commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function createCommonjsModule(fn,basedir,module){return module={path:basedir,exports:{},require:function(path,base){return commonjsRequire(path,null==base?module.path:base)}},fn(module,module.exports),module.exports}function commonjsRequire(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var check=function(it){return it&&it.Math==Math&&it},global_1=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof commonjsGlobal&&commonjsGlobal)||function(){return this}()||Function("return this")(),defineProperty$4=Object.defineProperty,defineGlobalProperty=function(key,value){try{defineProperty$4(global_1,key,{value:value,configurable:!0,writable:!0})}catch(error){global_1[key]=value}return value},SHARED="__core-js_shared__",store$1=global_1[SHARED]||defineGlobalProperty(SHARED,{}),sharedStore=store$1,shared=createCommonjsModule((function(module){(module.exports=function(key,value){return sharedStore[key]||(sharedStore[key]=void 0!==value?value:{})})("versions",[]).push({version:"3.27.1",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.27.1/LICENSE",source:"https://github.com/zloirock/core-js"})})),isNullOrUndefined=function(it){return null==it},$TypeError$e=TypeError,requireObjectCoercible=function(it){if(isNullOrUndefined(it))throw $TypeError$e("Can't call method on "+it);return it},$Object$4=Object,toObject=function(argument){return $Object$4(requireObjectCoercible(argument))},hasOwnProperty=functionUncurryThis({}.hasOwnProperty),hasOwnProperty_1=Object.hasOwn||function(it,key){return hasOwnProperty(toObject(it),key)},id=0,postfix=Math.random(),toString$1=functionUncurryThis(1..toString),uid=function(key){return"Symbol("+(void 0===key?"":key)+")_"+toString$1(++id+postfix,36)},documentAll$2="object"==typeof document&&document.all,IS_HTMLDDA=void 0===documentAll$2&&void 0!==documentAll$2,documentAll_1={all:documentAll$2,IS_HTMLDDA:IS_HTMLDDA},documentAll$1=documentAll_1.all,isCallable=documentAll_1.IS_HTMLDDA?function(argument){return"function"==typeof argument||argument===documentAll$1}:function(argument){return"function"==typeof argument},aFunction=function(argument){return isCallable(argument)?argument:void 0},getBuiltIn=function(namespace,method){return arguments.length<2?aFunction(global_1[namespace]):global_1[namespace]&&global_1[namespace][method]},engineUserAgent=getBuiltIn("navigator","userAgent")||"",process$3=global_1.process,Deno$1=global_1.Deno,versions=process$3&&process$3.versions||Deno$1&&Deno$1.version,v8=versions&&versions.v8,match,version;v8&&(match=v8.split("."),version=match[0]>0&&match[0]<4?1:+(match[0]+match[1])),!version&&engineUserAgent&&(match=engineUserAgent.match(/Edge\/(\d+)/),(!match||match[1]>=74)&&(match=engineUserAgent.match(/Chrome\/(\d+)/),match&&(version=+match[1])));var engineV8Version=version,symbolConstructorDetection=!!Object.getOwnPropertySymbols&&!fails((function(){var symbol=Symbol();return!String(symbol)||!(Object(symbol)instanceof Symbol)||!Symbol.sham&&engineV8Version&&engineV8Version<41})),useSymbolAsUid=symbolConstructorDetection&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,WellKnownSymbolsStore=shared("wks"),Symbol$1=global_1.Symbol,symbolFor=Symbol$1&&Symbol$1.for,createWellKnownSymbol=useSymbolAsUid?Symbol$1:Symbol$1&&Symbol$1.withoutSetter||uid,wellKnownSymbol=function(name){if(!hasOwnProperty_1(WellKnownSymbolsStore,name)||!symbolConstructorDetection&&"string"!=typeof WellKnownSymbolsStore[name]){var description="Symbol."+name;symbolConstructorDetection&&hasOwnProperty_1(Symbol$1,name)?WellKnownSymbolsStore[name]=Symbol$1[name]:WellKnownSymbolsStore[name]=useSymbolAsUid&&symbolFor?symbolFor(description):createWellKnownSymbol(description)}return WellKnownSymbolsStore[name]},TO_STRING_TAG$4=wellKnownSymbol("toStringTag"),test={};test[TO_STRING_TAG$4]="z";var toStringTagSupport="[object z]"===String(test),toString=functionUncurryThis({}.toString),stringSlice$2=functionUncurryThis("".slice),classofRaw=function(it){return stringSlice$2(toString(it),8,-1)},TO_STRING_TAG$3=wellKnownSymbol("toStringTag"),$Object$3=Object,CORRECT_ARGUMENTS="Arguments"==classofRaw(function(){return arguments}()),tryGet=function(it,key){try{return it[key]}catch(error){}},classof=toStringTagSupport?classofRaw:function(it){var O,tag,result;return void 0===it?"Undefined":null===it?"Null":"string"==typeof(tag=tryGet(O=$Object$3(it),TO_STRING_TAG$3))?tag:CORRECT_ARGUMENTS?classofRaw(O):"Object"==(result=classofRaw(O))&&isCallable(O.callee)?"Arguments":result},$String$3=String,toString_1=function(argument){if("Symbol"===classof(argument))throw TypeError("Cannot convert a Symbol value to a string");return $String$3(argument)},charAt$1=functionUncurryThis("".charAt),charCodeAt=functionUncurryThis("".charCodeAt),stringSlice$1=functionUncurryThis("".slice),createMethod$3=function(CONVERT_TO_STRING){return function($this,pos){var first,second,S=toString_1(requireObjectCoercible($this)),position=toIntegerOrInfinity(pos),size=S.length;return position<0||position>=size?CONVERT_TO_STRING?"":void 0:(first=charCodeAt(S,position))<55296||first>56319||position+1===size||(second=charCodeAt(S,position+1))<56320||second>57343?CONVERT_TO_STRING?charAt$1(S,position):first:CONVERT_TO_STRING?stringSlice$1(S,position,position+2):second-56320+(first-55296<<10)+65536}},stringMultibyte={codeAt:createMethod$3(!1),charAt:createMethod$3(!0)},WeakMap$1=global_1.WeakMap,weakMapBasicDetection=isCallable(WeakMap$1)&&/native code/.test(String(WeakMap$1)),documentAll=documentAll_1.all,isObject=documentAll_1.IS_HTMLDDA?function(it){return"object"==typeof it?null!==it:isCallable(it)||it===documentAll}:function(it){return"object"==typeof it?null!==it:isCallable(it)},descriptors=!fails((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),document$3=global_1.document,EXISTS$1=isObject(document$3)&&isObject(document$3.createElement),documentCreateElement=function(it){return EXISTS$1?document$3.createElement(it):{}},ie8DomDefine=!descriptors&&!fails((function(){return 7!=Object.defineProperty(documentCreateElement("div"),"a",{get:function(){return 7}}).a})),v8PrototypeDefineBug=descriptors&&fails((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),$String$2=String,$TypeError$d=TypeError,anObject=function(argument){if(isObject(argument))return argument;throw $TypeError$d($String$2(argument)+" is not an object")},call$1=Function.prototype.call,functionCall=functionBindNative?call$1.bind(call$1):function(){return call$1.apply(call$1,arguments)},objectIsPrototypeOf=functionUncurryThis({}.isPrototypeOf),$Object$2=Object,isSymbol=useSymbolAsUid?function(it){return"symbol"==typeof it}:function(it){var $Symbol=getBuiltIn("Symbol");return isCallable($Symbol)&&objectIsPrototypeOf($Symbol.prototype,$Object$2(it))},$String$1=String,tryToString=function(argument){try{return $String$1(argument)}catch(error){return"Object"}},$TypeError$c=TypeError,aCallable=function(argument){if(isCallable(argument))return argument;throw $TypeError$c(tryToString(argument)+" is not a function")},getMethod=function(V,P){var func=V[P];return isNullOrUndefined(func)?void 0:aCallable(func)},$TypeError$b=TypeError,ordinaryToPrimitive=function(input,pref){var fn,val;if("string"===pref&&isCallable(fn=input.toString)&&!isObject(val=functionCall(fn,input)))return val;if(isCallable(fn=input.valueOf)&&!isObject(val=functionCall(fn,input)))return val;if("string"!==pref&&isCallable(fn=input.toString)&&!isObject(val=functionCall(fn,input)))return val;throw $TypeError$b("Can't convert object to primitive value")},$TypeError$a=TypeError,TO_PRIMITIVE=wellKnownSymbol("toPrimitive"),toPrimitive=function(input,pref){if(!isObject(input)||isSymbol(input))return input;var result,exoticToPrim=getMethod(input,TO_PRIMITIVE);if(exoticToPrim){if(void 0===pref&&(pref="default"),result=functionCall(exoticToPrim,input,pref),!isObject(result)||isSymbol(result))return result;throw $TypeError$a("Can't convert object to primitive value")}return void 0===pref&&(pref="number"),ordinaryToPrimitive(input,pref)},toPropertyKey=function(argument){var key=toPrimitive(argument,"string");return isSymbol(key)?key:key+""},$TypeError$9=TypeError,$defineProperty=Object.defineProperty,$getOwnPropertyDescriptor$1=Object.getOwnPropertyDescriptor,ENUMERABLE="enumerable",CONFIGURABLE$1="configurable",WRITABLE="writable",f$6=descriptors?v8PrototypeDefineBug?function(O,P,Attributes){if(anObject(O),P=toPropertyKey(P),anObject(Attributes),"function"==typeof O&&"prototype"===P&&"value"in Attributes&&WRITABLE in Attributes&&!Attributes[WRITABLE]){var current=$getOwnPropertyDescriptor$1(O,P);current&¤t[WRITABLE]&&(O[P]=Attributes.value,Attributes={configurable:CONFIGURABLE$1 in Attributes?Attributes[CONFIGURABLE$1]:current[CONFIGURABLE$1],enumerable:ENUMERABLE in Attributes?Attributes[ENUMERABLE]:current[ENUMERABLE],writable:!1})}return $defineProperty(O,P,Attributes)}:$defineProperty:function(O,P,Attributes){if(anObject(O),P=toPropertyKey(P),anObject(Attributes),ie8DomDefine)try{return $defineProperty(O,P,Attributes)}catch(error){}if("get"in Attributes||"set"in Attributes)throw $TypeError$9("Accessors not supported");return"value"in Attributes&&(O[P]=Attributes.value),O},objectDefineProperty={f:f$6},createPropertyDescriptor=function(bitmap,value){return{enumerable:!(1&bitmap),configurable:!(2&bitmap),writable:!(4&bitmap),value:value}},createNonEnumerableProperty=descriptors?function(object,key,value){return objectDefineProperty.f(object,key,createPropertyDescriptor(1,value))}:function(object,key,value){return object[key]=value,object},keys=shared("keys"),sharedKey=function(key){return keys[key]||(keys[key]=uid(key))},hiddenKeys$1={},OBJECT_ALREADY_INITIALIZED="Object already initialized",TypeError$2=global_1.TypeError,WeakMap=global_1.WeakMap,set$1,get,has,enforce=function(it){return has(it)?get(it):set$1(it,{})},getterFor=function(TYPE){return function(it){var state;if(!isObject(it)||(state=get(it)).type!==TYPE)throw TypeError$2("Incompatible receiver, "+TYPE+" required");return state}};if(weakMapBasicDetection||sharedStore.state){var store=sharedStore.state||(sharedStore.state=new WeakMap);store.get=store.get,store.has=store.has,store.set=store.set,set$1=function(it,metadata){if(store.has(it))throw TypeError$2(OBJECT_ALREADY_INITIALIZED);return metadata.facade=it,store.set(it,metadata),metadata},get=function(it){return store.get(it)||{}},has=function(it){return store.has(it)}}else{var STATE=sharedKey("state");hiddenKeys$1[STATE]=!0,set$1=function(it,metadata){if(hasOwnProperty_1(it,STATE))throw TypeError$2(OBJECT_ALREADY_INITIALIZED);return metadata.facade=it,createNonEnumerableProperty(it,STATE,metadata),metadata},get=function(it){return hasOwnProperty_1(it,STATE)?it[STATE]:{}},has=function(it){return hasOwnProperty_1(it,STATE)}}var internalState={set:set$1,get:get,has:has,enforce:enforce,getterFor:getterFor},$propertyIsEnumerable$1={}.propertyIsEnumerable,getOwnPropertyDescriptor$3=Object.getOwnPropertyDescriptor,NASHORN_BUG=getOwnPropertyDescriptor$3&&!$propertyIsEnumerable$1.call({1:2},1),f$5=NASHORN_BUG?function(V){var descriptor=getOwnPropertyDescriptor$3(this,V);return!!descriptor&&descriptor.enumerable}:$propertyIsEnumerable$1,objectPropertyIsEnumerable={f:f$5},$Object$1=Object,split=functionUncurryThis("".split),indexedObject=fails((function(){return!$Object$1("z").propertyIsEnumerable(0)}))?function(it){return"String"==classofRaw(it)?split(it,""):$Object$1(it)}:$Object$1,toIndexedObject=function(it){return indexedObject(requireObjectCoercible(it))},$getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor,f$4=descriptors?$getOwnPropertyDescriptor:function(O,P){if(O=toIndexedObject(O),P=toPropertyKey(P),ie8DomDefine)try{return $getOwnPropertyDescriptor(O,P)}catch(error){}if(hasOwnProperty_1(O,P))return createPropertyDescriptor(!functionCall(objectPropertyIsEnumerable.f,O,P),O[P])},objectGetOwnPropertyDescriptor={f:f$4},FunctionPrototype$1=Function.prototype,getDescriptor=descriptors&&Object.getOwnPropertyDescriptor,EXISTS=hasOwnProperty_1(FunctionPrototype$1,"name"),PROPER=EXISTS&&"something"===function(){}.name,CONFIGURABLE=EXISTS&&(!descriptors||descriptors&&getDescriptor(FunctionPrototype$1,"name").configurable),functionName={EXISTS:EXISTS,PROPER:PROPER,CONFIGURABLE:CONFIGURABLE},functionToString=functionUncurryThis(Function.toString);isCallable(sharedStore.inspectSource)||(sharedStore.inspectSource=function(it){return functionToString(it)});var inspectSource=sharedStore.inspectSource,makeBuiltIn_1=createCommonjsModule((function(module){var CONFIGURABLE_FUNCTION_NAME=functionName.CONFIGURABLE,enforceInternalState=internalState.enforce,getInternalState=internalState.get,defineProperty=Object.defineProperty,CONFIGURABLE_LENGTH=descriptors&&!fails((function(){return 8!==defineProperty((function(){}),"length",{value:8}).length})),TEMPLATE=String(String).split("String"),makeBuiltIn=module.exports=function(value,name,options){"Symbol("===String(name).slice(0,7)&&(name="["+String(name).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),options&&options.getter&&(name="get "+name),options&&options.setter&&(name="set "+name),(!hasOwnProperty_1(value,"name")||CONFIGURABLE_FUNCTION_NAME&&value.name!==name)&&(descriptors?defineProperty(value,"name",{value:name,configurable:!0}):value.name=name),CONFIGURABLE_LENGTH&&options&&hasOwnProperty_1(options,"arity")&&value.length!==options.arity&&defineProperty(value,"length",{value:options.arity});try{options&&hasOwnProperty_1(options,"constructor")&&options.constructor?descriptors&&defineProperty(value,"prototype",{writable:!1}):value.prototype&&(value.prototype=void 0)}catch(error){}var state=enforceInternalState(value);return hasOwnProperty_1(state,"source")||(state.source=TEMPLATE.join("string"==typeof name?name:"")),value};Function.prototype.toString=makeBuiltIn((function(){return isCallable(this)&&getInternalState(this).source||inspectSource(this)}),"toString")})),defineBuiltIn=function(O,key,value,options){options||(options={});var simple=options.enumerable,name=void 0!==options.name?options.name:key;if(isCallable(value)&&makeBuiltIn_1(value,name,options),options.global)simple?O[key]=value:defineGlobalProperty(key,value);else{try{options.unsafe?O[key]&&(simple=!0):delete O[key]}catch(error){}simple?O[key]=value:objectDefineProperty.f(O,key,{value:value,enumerable:!1,configurable:!options.nonConfigurable,writable:!options.nonWritable})}return O},max=Math.max,min$2=Math.min,toAbsoluteIndex=function(index,length){var integer=toIntegerOrInfinity(index);return integer<0?max(integer+length,0):min$2(integer,length)},min$1=Math.min,toLength=function(argument){return argument>0?min$1(toIntegerOrInfinity(argument),9007199254740991):0},lengthOfArrayLike=function(obj){return toLength(obj.length)},createMethod$2=function(IS_INCLUDES){return function($this,el,fromIndex){var value,O=toIndexedObject($this),length=lengthOfArrayLike(O),index=toAbsoluteIndex(fromIndex,length);if(IS_INCLUDES&&el!=el){for(;length>index;)if((value=O[index++])!=value)return!0}else for(;length>index;index++)if((IS_INCLUDES||index in O)&&O[index]===el)return IS_INCLUDES||index||0;return!IS_INCLUDES&&-1}},arrayIncludes={includes:createMethod$2(!0),indexOf:createMethod$2(!1)},indexOf=arrayIncludes.indexOf,push$3=functionUncurryThis([].push),objectKeysInternal=function(object,names){var key,O=toIndexedObject(object),i=0,result=[];for(key in O)!hasOwnProperty_1(hiddenKeys$1,key)&&hasOwnProperty_1(O,key)&&push$3(result,key);for(;names.length>i;)hasOwnProperty_1(O,key=names[i++])&&(~indexOf(result,key)||push$3(result,key));return result},enumBugKeys=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],hiddenKeys=enumBugKeys.concat("length","prototype"),f$3=Object.getOwnPropertyNames||function(O){return objectKeysInternal(O,hiddenKeys)},objectGetOwnPropertyNames={f:f$3},f$2=Object.getOwnPropertySymbols,objectGetOwnPropertySymbols={f:f$2},concat$1=functionUncurryThis([].concat),ownKeys=getBuiltIn("Reflect","ownKeys")||function(it){var keys=objectGetOwnPropertyNames.f(anObject(it)),getOwnPropertySymbols=objectGetOwnPropertySymbols.f;return getOwnPropertySymbols?concat$1(keys,getOwnPropertySymbols(it)):keys},copyConstructorProperties=function(target,source,exceptions){for(var keys=ownKeys(source),defineProperty=objectDefineProperty.f,getOwnPropertyDescriptor=objectGetOwnPropertyDescriptor.f,i=0;iindex;)objectDefineProperty.f(O,key=keys[index++],props[key]);return O},objectDefineProperties={f:f$1},html=getBuiltIn("document","documentElement"),GT=">",LT="<",PROTOTYPE="prototype",SCRIPT="script",IE_PROTO$1=sharedKey("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(content){return LT+SCRIPT+GT+content+LT+"/"+SCRIPT+GT},NullProtoObjectViaActiveX=function(activeXDocument){activeXDocument.write(scriptTag("")),activeXDocument.close();var temp=activeXDocument.parentWindow.Object;return activeXDocument=null,temp},NullProtoObjectViaIFrame=function(){var iframeDocument,iframe=documentCreateElement("iframe"),JS="java"+SCRIPT+":";return iframe.style.display="none",html.appendChild(iframe),iframe.src=String(JS),(iframeDocument=iframe.contentWindow.document).open(),iframeDocument.write(scriptTag("document.F=Object")),iframeDocument.close(),iframeDocument.F},activeXDocument,NullProtoObject=function(){try{activeXDocument=new ActiveXObject("htmlfile")}catch(error){}NullProtoObject="undefined"!=typeof document?document.domain&&activeXDocument?NullProtoObjectViaActiveX(activeXDocument):NullProtoObjectViaIFrame():NullProtoObjectViaActiveX(activeXDocument);for(var length=enumBugKeys.length;length--;)delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];return NullProtoObject()};hiddenKeys$1[IE_PROTO$1]=!0;var objectCreate=Object.create||function(O,Properties){var result;return null!==O?(EmptyConstructor[PROTOTYPE]=anObject(O),result=new EmptyConstructor,EmptyConstructor[PROTOTYPE]=null,result[IE_PROTO$1]=O):result=NullProtoObject(),void 0===Properties?result:objectDefineProperties.f(result,Properties)},correctPrototypeGetter=!fails((function(){function F(){}return F.prototype.constructor=null,Object.getPrototypeOf(new F)!==F.prototype})),IE_PROTO=sharedKey("IE_PROTO"),$Object=Object,ObjectPrototype=$Object.prototype,objectGetPrototypeOf=correctPrototypeGetter?$Object.getPrototypeOf:function(O){var object=toObject(O);if(hasOwnProperty_1(object,IE_PROTO))return object[IE_PROTO];var constructor=object.constructor;return isCallable(constructor)&&object instanceof constructor?constructor.prototype:object instanceof $Object?ObjectPrototype:null},ITERATOR$5=wellKnownSymbol("iterator"),BUGGY_SAFARI_ITERATORS$1=!1,IteratorPrototype$2,PrototypeOfArrayIteratorPrototype,arrayIterator;[].keys&&(arrayIterator=[].keys(),"next"in arrayIterator?(PrototypeOfArrayIteratorPrototype=objectGetPrototypeOf(objectGetPrototypeOf(arrayIterator)),PrototypeOfArrayIteratorPrototype!==Object.prototype&&(IteratorPrototype$2=PrototypeOfArrayIteratorPrototype)):BUGGY_SAFARI_ITERATORS$1=!0);var NEW_ITERATOR_PROTOTYPE=!isObject(IteratorPrototype$2)||fails((function(){var test={};return IteratorPrototype$2[ITERATOR$5].call(test)!==test}));NEW_ITERATOR_PROTOTYPE&&(IteratorPrototype$2={}),isCallable(IteratorPrototype$2[ITERATOR$5])||defineBuiltIn(IteratorPrototype$2,ITERATOR$5,(function(){return this}));var iteratorsCore={IteratorPrototype:IteratorPrototype$2,BUGGY_SAFARI_ITERATORS:BUGGY_SAFARI_ITERATORS$1},defineProperty$3=objectDefineProperty.f,TO_STRING_TAG$2=wellKnownSymbol("toStringTag"),setToStringTag=function(target,TAG,STATIC){target&&!STATIC&&(target=target.prototype),target&&!hasOwnProperty_1(target,TO_STRING_TAG$2)&&defineProperty$3(target,TO_STRING_TAG$2,{configurable:!0,value:TAG})},iterators={},IteratorPrototype$1=iteratorsCore.IteratorPrototype,returnThis$1=function(){return this},iteratorCreateConstructor=function(IteratorConstructor,NAME,next,ENUMERABLE_NEXT){var TO_STRING_TAG=NAME+" Iterator";return IteratorConstructor.prototype=objectCreate(IteratorPrototype$1,{next:createPropertyDescriptor(+!ENUMERABLE_NEXT,next)}),setToStringTag(IteratorConstructor,TO_STRING_TAG,!1),iterators[TO_STRING_TAG]=returnThis$1,IteratorConstructor},$String=String,$TypeError$8=TypeError,aPossiblePrototype=function(argument){if("object"==typeof argument||isCallable(argument))return argument;throw $TypeError$8("Can't set "+$String(argument)+" as a prototype")},objectSetPrototypeOf=Object.setPrototypeOf||("__proto__"in{}?function(){var setter,CORRECT_SETTER=!1,test={};try{(setter=functionUncurryThis(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(test,[]),CORRECT_SETTER=test instanceof Array}catch(error){}return function(O,proto){return anObject(O),aPossiblePrototype(proto),CORRECT_SETTER?setter(O,proto):O.__proto__=proto,O}}():void 0),PROPER_FUNCTION_NAME=functionName.PROPER,CONFIGURABLE_FUNCTION_NAME=functionName.CONFIGURABLE,IteratorPrototype=iteratorsCore.IteratorPrototype,BUGGY_SAFARI_ITERATORS=iteratorsCore.BUGGY_SAFARI_ITERATORS,ITERATOR$4=wellKnownSymbol("iterator"),KEYS="keys",VALUES="values",ENTRIES="entries",returnThis=function(){return this},iteratorDefine=function(Iterable,NAME,IteratorConstructor,next,DEFAULT,IS_SET,FORCED){iteratorCreateConstructor(IteratorConstructor,NAME,next);var CurrentIteratorPrototype,methods,KEY,getIterationMethod=function(KIND){if(KIND===DEFAULT&&defaultIterator)return defaultIterator;if(!BUGGY_SAFARI_ITERATORS&&KIND in IterablePrototype)return IterablePrototype[KIND];switch(KIND){case KEYS:case VALUES:case ENTRIES:return function(){return new IteratorConstructor(this,KIND)}}return function(){return new IteratorConstructor(this)}},TO_STRING_TAG=NAME+" Iterator",INCORRECT_VALUES_NAME=!1,IterablePrototype=Iterable.prototype,nativeIterator=IterablePrototype[ITERATOR$4]||IterablePrototype["@@iterator"]||DEFAULT&&IterablePrototype[DEFAULT],defaultIterator=!BUGGY_SAFARI_ITERATORS&&nativeIterator||getIterationMethod(DEFAULT),anyNativeIterator="Array"==NAME&&IterablePrototype.entries||nativeIterator;if(anyNativeIterator&&(CurrentIteratorPrototype=objectGetPrototypeOf(anyNativeIterator.call(new Iterable)))!==Object.prototype&&CurrentIteratorPrototype.next&&(objectGetPrototypeOf(CurrentIteratorPrototype)!==IteratorPrototype&&(objectSetPrototypeOf?objectSetPrototypeOf(CurrentIteratorPrototype,IteratorPrototype):isCallable(CurrentIteratorPrototype[ITERATOR$4])||defineBuiltIn(CurrentIteratorPrototype,ITERATOR$4,returnThis)),setToStringTag(CurrentIteratorPrototype,TO_STRING_TAG,!0)),PROPER_FUNCTION_NAME&&DEFAULT==VALUES&&nativeIterator&&nativeIterator.name!==VALUES&&(CONFIGURABLE_FUNCTION_NAME?createNonEnumerableProperty(IterablePrototype,"name",VALUES):(INCORRECT_VALUES_NAME=!0,defaultIterator=function(){return functionCall(nativeIterator,this)})),DEFAULT)if(methods={values:getIterationMethod(VALUES),keys:IS_SET?defaultIterator:getIterationMethod(KEYS),entries:getIterationMethod(ENTRIES)},FORCED)for(KEY in methods)(BUGGY_SAFARI_ITERATORS||INCORRECT_VALUES_NAME||!(KEY in IterablePrototype))&&defineBuiltIn(IterablePrototype,KEY,methods[KEY]);else _export({target:NAME,proto:!0,forced:BUGGY_SAFARI_ITERATORS||INCORRECT_VALUES_NAME},methods);return IterablePrototype[ITERATOR$4]!==defaultIterator&&defineBuiltIn(IterablePrototype,ITERATOR$4,defaultIterator,{name:DEFAULT}),iterators[NAME]=defaultIterator,methods},createIterResultObject=function(value,done){return{value:value,done:done}},charAt=stringMultibyte.charAt,STRING_ITERATOR="String Iterator",setInternalState$2=internalState.set,getInternalState$1=internalState.getterFor(STRING_ITERATOR);iteratorDefine(String,"String",(function(iterated){setInternalState$2(this,{type:STRING_ITERATOR,string:toString_1(iterated),index:0})}),(function(){var point,state=getInternalState$1(this),string=state.string,index=state.index;return index>=string.length?createIterResultObject(void 0,!0):(point=charAt(string,index),state.index+=point.length,createIterResultObject(point,!1))}));var functionUncurryThisClause=function(fn){if("Function"===classofRaw(fn))return functionUncurryThis(fn)},bind$1=functionUncurryThisClause(functionUncurryThisClause.bind),functionBindContext=function(fn,that){return aCallable(fn),void 0===that?fn:functionBindNative?bind$1(fn,that):function(){return fn.apply(that,arguments)}},iteratorClose=function(iterator,kind,value){var innerResult,innerError;anObject(iterator);try{if(!(innerResult=getMethod(iterator,"return"))){if("throw"===kind)throw value;return value}innerResult=functionCall(innerResult,iterator)}catch(error){innerError=!0,innerResult=error}if("throw"===kind)throw value;if(innerError)throw innerResult;return anObject(innerResult),value},callWithSafeIterationClosing=function(iterator,fn,value,ENTRIES){try{return ENTRIES?fn(anObject(value)[0],value[1]):fn(value)}catch(error){iteratorClose(iterator,"throw",error)}},ITERATOR$3=wellKnownSymbol("iterator"),ArrayPrototype$1=Array.prototype,isArrayIteratorMethod=function(it){return void 0!==it&&(iterators.Array===it||ArrayPrototype$1[ITERATOR$3]===it)},noop$1=function(){},empty=[],construct=getBuiltIn("Reflect","construct"),constructorRegExp=/^\s*(?:class|function)\b/,exec=functionUncurryThis(constructorRegExp.exec),INCORRECT_TO_STRING=!constructorRegExp.exec(noop$1),isConstructorModern=function(argument){if(!isCallable(argument))return!1;try{return construct(noop$1,empty,argument),!0}catch(error){return!1}},isConstructorLegacy=function(argument){if(!isCallable(argument))return!1;switch(classof(argument)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return INCORRECT_TO_STRING||!!exec(constructorRegExp,inspectSource(argument))}catch(error){return!0}};isConstructorLegacy.sham=!0;var isConstructor=!construct||fails((function(){var called;return isConstructorModern(isConstructorModern.call)||!isConstructorModern(Object)||!isConstructorModern((function(){called=!0}))||called}))?isConstructorLegacy:isConstructorModern,createProperty=function(object,key,value){var propertyKey=toPropertyKey(key);propertyKey in object?objectDefineProperty.f(object,propertyKey,createPropertyDescriptor(0,value)):object[propertyKey]=value},ITERATOR$2=wellKnownSymbol("iterator"),getIteratorMethod=function(it){if(!isNullOrUndefined(it))return getMethod(it,ITERATOR$2)||getMethod(it,"@@iterator")||iterators[classof(it)]},$TypeError$7=TypeError,getIterator=function(argument,usingIterator){var iteratorMethod=arguments.length<2?getIteratorMethod(argument):usingIterator;if(aCallable(iteratorMethod))return anObject(functionCall(iteratorMethod,argument));throw $TypeError$7(tryToString(argument)+" is not iterable")},$Array$1=Array,arrayFrom=function(arrayLike){var O=toObject(arrayLike),IS_CONSTRUCTOR=isConstructor(this),argumentsLength=arguments.length,mapfn=argumentsLength>1?arguments[1]:void 0,mapping=void 0!==mapfn;mapping&&(mapfn=functionBindContext(mapfn,argumentsLength>2?arguments[2]:void 0));var length,result,step,iterator,next,value,iteratorMethod=getIteratorMethod(O),index=0;if(!iteratorMethod||this===$Array$1&&isArrayIteratorMethod(iteratorMethod))for(length=lengthOfArrayLike(O),result=IS_CONSTRUCTOR?new this(length):$Array$1(length);length>index;index++)value=mapping?mapfn(O[index],index):O[index],createProperty(result,index,value);else for(next=(iterator=getIterator(O,iteratorMethod)).next,result=IS_CONSTRUCTOR?new this:[];!(step=functionCall(next,iterator)).done;index++)value=mapping?callWithSafeIterationClosing(iterator,mapfn,[step.value,index],!0):step.value,createProperty(result,index,value);return result.length=index,result},ITERATOR$1=wellKnownSymbol("iterator"),SAFE_CLOSING=!1;try{var called=0,iteratorWithReturn={next:function(){return{done:!!called++}},return:function(){SAFE_CLOSING=!0}};iteratorWithReturn[ITERATOR$1]=function(){return this},Array.from(iteratorWithReturn,(function(){throw 2}))}catch(error){}var checkCorrectnessOfIteration=function(exec,SKIP_CLOSING){if(!SKIP_CLOSING&&!SAFE_CLOSING)return!1;var ITERATION_SUPPORT=!1;try{var object={};object[ITERATOR$1]=function(){return{next:function(){return{done:ITERATION_SUPPORT=!0}}}},exec(object)}catch(error){}return ITERATION_SUPPORT},INCORRECT_ITERATION=!checkCorrectnessOfIteration((function(iterable){Array.from(iterable)}));_export({target:"Array",stat:!0,forced:INCORRECT_ITERATION},{from:arrayFrom});var path=global_1;path.Array.from;var defineProperty$2=objectDefineProperty.f,UNSCOPABLES=wellKnownSymbol("unscopables"),ArrayPrototype=Array.prototype;null==ArrayPrototype[UNSCOPABLES]&&defineProperty$2(ArrayPrototype,UNSCOPABLES,{configurable:!0,value:objectCreate(null)});var addToUnscopables=function(key){ArrayPrototype[UNSCOPABLES][key]=!0},$includes=arrayIncludes.includes,BROKEN_ON_SPARSE=fails((function(){return!Array(1).includes()}));_export({target:"Array",proto:!0,forced:BROKEN_ON_SPARSE},{includes:function(el){return $includes(this,el,arguments.length>1?arguments[1]:void 0)}}),addToUnscopables("includes");var entryUnbind=function(CONSTRUCTOR,METHOD){return functionUncurryThis(global_1[CONSTRUCTOR].prototype[METHOD])};entryUnbind("Array","includes");var isArray=Array.isArray||function(argument){return"Array"==classofRaw(argument)},$TypeError$6=TypeError,MAX_SAFE_INTEGER=9007199254740991,doesNotExceedSafeInteger=function(it){if(it>MAX_SAFE_INTEGER)throw $TypeError$6("Maximum allowed index exceeded");return it},flattenIntoArray=function(target,original,source,sourceLen,start,depth,mapper,thisArg){for(var element,elementLen,targetIndex=start,sourceIndex=0,mapFn=!!mapper&&functionBindContext(mapper,thisArg);sourceIndex0&&isArray(element)?(elementLen=lengthOfArrayLike(element),targetIndex=flattenIntoArray(target,original,element,elementLen,targetIndex,depth-1)-1):(doesNotExceedSafeInteger(targetIndex+1),target[targetIndex]=element),targetIndex++),sourceIndex++;return targetIndex},flattenIntoArray_1=flattenIntoArray,SPECIES$3=wellKnownSymbol("species"),$Array=Array,arraySpeciesConstructor=function(originalArray){var C;return isArray(originalArray)&&(C=originalArray.constructor,(isConstructor(C)&&(C===$Array||isArray(C.prototype))||isObject(C)&&null===(C=C[SPECIES$3]))&&(C=void 0)),void 0===C?$Array:C},arraySpeciesCreate=function(originalArray,length){return new(arraySpeciesConstructor(originalArray))(0===length?0:length)};_export({target:"Array",proto:!0},{flat:function(){var depthArg=arguments.length?arguments[0]:void 0,O=toObject(this),sourceLen=lengthOfArrayLike(O),A=arraySpeciesCreate(O,0);return A.length=flattenIntoArray_1(A,O,O,sourceLen,0,void 0===depthArg?1:toIntegerOrInfinity(depthArg)),A}}),addToUnscopables("flat"),entryUnbind("Array","flat");var push$2=functionUncurryThis([].push),createMethod$1=function(TYPE){var IS_MAP=1==TYPE,IS_FILTER=2==TYPE,IS_SOME=3==TYPE,IS_EVERY=4==TYPE,IS_FIND_INDEX=6==TYPE,IS_FILTER_REJECT=7==TYPE,NO_HOLES=5==TYPE||IS_FIND_INDEX;return function($this,callbackfn,that,specificCreate){for(var value,result,O=toObject($this),self=indexedObject(O),boundFunction=functionBindContext(callbackfn,that),length=lengthOfArrayLike(self),index=0,create=specificCreate||arraySpeciesCreate,target=IS_MAP?create($this,length):IS_FILTER||IS_FILTER_REJECT?create($this,0):void 0;length>index;index++)if((NO_HOLES||index in self)&&(result=boundFunction(value=self[index],index,O),TYPE))if(IS_MAP)target[index]=result;else if(result)switch(TYPE){case 3:return!0;case 5:return value;case 6:return index;case 2:push$2(target,value)}else switch(TYPE){case 4:return!1;case 7:push$2(target,value)}return IS_FIND_INDEX?-1:IS_SOME||IS_EVERY?IS_EVERY:target}},arrayIteration={forEach:createMethod$1(0),map:createMethod$1(1),filter:createMethod$1(2),some:createMethod$1(3),every:createMethod$1(4),find:createMethod$1(5),findIndex:createMethod$1(6),filterReject:createMethod$1(7)},$find=arrayIteration.find,FIND="find",SKIPS_HOLES=!0;FIND in[]&&Array(1)[FIND]((function(){SKIPS_HOLES=!1})),_export({target:"Array",proto:!0,forced:SKIPS_HOLES},{find:function(callbackfn){return $find(this,callbackfn,arguments.length>1?arguments[1]:void 0)}}),addToUnscopables(FIND),entryUnbind("Array","find");var $assign=Object.assign,defineProperty$1=Object.defineProperty,concat=functionUncurryThis([].concat),objectAssign=!$assign||fails((function(){if(descriptors&&1!==$assign({b:1},$assign(defineProperty$1({},"a",{enumerable:!0,get:function(){defineProperty$1(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var A={},B={},symbol=Symbol();return A[symbol]=7,"abcdefghijklmnopqrst".split("").forEach((function(chr){B[chr]=chr})),7!=$assign({},A)[symbol]||"abcdefghijklmnopqrst"!=objectKeys($assign({},B)).join("")}))?function(target,source){for(var T=toObject(target),argumentsLength=arguments.length,index=1,getOwnPropertySymbols=objectGetOwnPropertySymbols.f,propertyIsEnumerable=objectPropertyIsEnumerable.f;argumentsLength>index;)for(var key,S=indexedObject(arguments[index++]),keys=getOwnPropertySymbols?concat(objectKeys(S),getOwnPropertySymbols(S)):objectKeys(S),length=keys.length,j=0;length>j;)key=keys[j++],descriptors&&!functionCall(propertyIsEnumerable,S,key)||(T[key]=S[key]);return T}:$assign;_export({target:"Object",stat:!0,arity:2,forced:Object.assign!==objectAssign},{assign:objectAssign}),path.Object.assign;var $propertyIsEnumerable=objectPropertyIsEnumerable.f,propertyIsEnumerable=functionUncurryThis($propertyIsEnumerable),push$1=functionUncurryThis([].push),createMethod=function(TO_ENTRIES){return function(it){for(var key,O=toIndexedObject(it),keys=objectKeys(O),length=keys.length,i=0,result=[];length>i;)key=keys[i++],descriptors&&!propertyIsEnumerable(O,key)||push$1(result,TO_ENTRIES?[key,O[key]]:O[key]);return result}},objectToArray={entries:createMethod(!0),values:createMethod(!1)},$entries=objectToArray.entries;_export({target:"Object",stat:!0},{entries:function(O){return $entries(O)}}),path.Object.entries;var $values=objectToArray.values;_export({target:"Object",stat:!0},{values:function(O){return $values(O)}}),path.Object.values;var $Error$1=Error,replace=functionUncurryThis("".replace),TEST=String($Error$1("zxcasd").stack),V8_OR_CHAKRA_STACK_ENTRY=/\n\s*at [^:]*:[^\n]*/,IS_V8_OR_CHAKRA_STACK=V8_OR_CHAKRA_STACK_ENTRY.test(TEST),errorStackClear=function(stack,dropEntries){if(IS_V8_OR_CHAKRA_STACK&&"string"==typeof stack&&!$Error$1.prepareStackTrace)for(;dropEntries--;)stack=replace(stack,V8_OR_CHAKRA_STACK_ENTRY,"");return stack},installErrorCause=function(O,options){isObject(options)&&"cause"in options&&createNonEnumerableProperty(O,"cause",options.cause)},$TypeError$5=TypeError,Result=function(stopped,result){this.stopped=stopped,this.result=result},ResultPrototype=Result.prototype,iterate=function(iterable,unboundFunction,options){var iterator,iterFn,index,length,result,next,step,that=options&&options.that,AS_ENTRIES=!(!options||!options.AS_ENTRIES),IS_RECORD=!(!options||!options.IS_RECORD),IS_ITERATOR=!(!options||!options.IS_ITERATOR),INTERRUPTED=!(!options||!options.INTERRUPTED),fn=functionBindContext(unboundFunction,that),stop=function(condition){return iterator&&iteratorClose(iterator,"normal",condition),new Result(!0,condition)},callFn=function(value){return AS_ENTRIES?(anObject(value),INTERRUPTED?fn(value[0],value[1],stop):fn(value[0],value[1])):INTERRUPTED?fn(value,stop):fn(value)};if(IS_RECORD)iterator=iterable.iterator;else if(IS_ITERATOR)iterator=iterable;else{if(!(iterFn=getIteratorMethod(iterable)))throw $TypeError$5(tryToString(iterable)+" is not iterable");if(isArrayIteratorMethod(iterFn)){for(index=0,length=lengthOfArrayLike(iterable);length>index;index++)if((result=callFn(iterable[index]))&&objectIsPrototypeOf(ResultPrototype,result))return result;return new Result(!1)}iterator=getIterator(iterable,iterFn)}for(next=IS_RECORD?iterable.next:iterator.next;!(step=functionCall(next,iterator)).done;){try{result=callFn(step.value)}catch(error){iteratorClose(iterator,"throw",error)}if("object"==typeof result&&result&&objectIsPrototypeOf(ResultPrototype,result))return result}return new Result(!1)},normalizeStringArgument=function(argument,$default){return void 0===argument?arguments.length<2?"":$default:toString_1(argument)},errorStackInstallable=!fails((function(){var error=Error("a");return!("stack"in error)||(Object.defineProperty(error,"stack",createPropertyDescriptor(1,7)),7!==error.stack)})),TO_STRING_TAG$1=wellKnownSymbol("toStringTag"),$Error=Error,push=[].push,$AggregateError=function(errors,message){var that,options=arguments.length>2?arguments[2]:void 0,isInstance=objectIsPrototypeOf(AggregateErrorPrototype,this);objectSetPrototypeOf?that=objectSetPrototypeOf($Error(),isInstance?objectGetPrototypeOf(this):AggregateErrorPrototype):(that=isInstance?this:objectCreate(AggregateErrorPrototype),createNonEnumerableProperty(that,TO_STRING_TAG$1,"Error")),void 0!==message&&createNonEnumerableProperty(that,"message",normalizeStringArgument(message)),errorStackInstallable&&createNonEnumerableProperty(that,"stack",errorStackClear(that.stack,1)),installErrorCause(that,options);var errorsArray=[];return iterate(errors,push,{that:errorsArray}),createNonEnumerableProperty(that,"errors",errorsArray),that};objectSetPrototypeOf?objectSetPrototypeOf($AggregateError,$Error):copyConstructorProperties($AggregateError,$Error,{name:!0});var AggregateErrorPrototype=$AggregateError.prototype=objectCreate($Error.prototype,{constructor:createPropertyDescriptor(1,$AggregateError),message:createPropertyDescriptor(1,""),name:createPropertyDescriptor(1,"AggregateError")});_export({global:!0,constructor:!0,arity:2},{AggregateError:$AggregateError});var defineProperty=objectDefineProperty.f,ARRAY_ITERATOR="Array Iterator",setInternalState$1=internalState.set,getInternalState=internalState.getterFor(ARRAY_ITERATOR),es_array_iterator=iteratorDefine(Array,"Array",(function(iterated,kind){setInternalState$1(this,{type:ARRAY_ITERATOR,target:toIndexedObject(iterated),index:0,kind:kind})}),(function(){var state=getInternalState(this),target=state.target,kind=state.kind,index=state.index++;return!target||index>=target.length?(state.target=void 0,createIterResultObject(void 0,!0)):createIterResultObject("keys"==kind?index:"values"==kind?target[index]:[index,target[index]],!1)}),"values"),values=iterators.Arguments=iterators.Array;if(addToUnscopables("keys"),addToUnscopables("values"),addToUnscopables("entries"),descriptors&&"values"!==values.name)try{defineProperty(values,"name",{value:"values"})}catch(error){}var objectToString=toStringTagSupport?{}.toString:function(){return"[object "+classof(this)+"]"};toStringTagSupport||defineBuiltIn(Object.prototype,"toString",objectToString,{unsafe:!0});var engineIsNode="process"==classofRaw(global_1.process),SPECIES$2=wellKnownSymbol("species"),setSpecies=function(CONSTRUCTOR_NAME){var Constructor=getBuiltIn(CONSTRUCTOR_NAME),defineProperty=objectDefineProperty.f;descriptors&&Constructor&&!Constructor[SPECIES$2]&&defineProperty(Constructor,SPECIES$2,{configurable:!0,get:function(){return this}})},$TypeError$4=TypeError,anInstance=function(it,Prototype){if(objectIsPrototypeOf(Prototype,it))return it;throw $TypeError$4("Incorrect invocation")},$TypeError$3=TypeError,aConstructor=function(argument){if(isConstructor(argument))return argument;throw $TypeError$3(tryToString(argument)+" is not a constructor")},SPECIES$1=wellKnownSymbol("species"),speciesConstructor=function(O,defaultConstructor){var S,C=anObject(O).constructor;return void 0===C||isNullOrUndefined(S=anObject(C)[SPECIES$1])?defaultConstructor:aConstructor(S)},FunctionPrototype=Function.prototype,apply=FunctionPrototype.apply,call=FunctionPrototype.call,functionApply="object"==typeof Reflect&&Reflect.apply||(functionBindNative?call.bind(apply):function(){return call.apply(apply,arguments)}),arraySlice=functionUncurryThis([].slice),$TypeError$2=TypeError,validateArgumentsLength=function(passed,required){if(passed1?arguments[1]:void 0,that.length)),search=toString_1(searchString);return nativeStartsWith?nativeStartsWith(that,search,index):stringSlice(that,index,index+search.length)===search}}),entryUnbind("String","startsWith");var global$1="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==global$1&&global$1,support={searchParams:"URLSearchParams"in global$1,iterable:"Symbol"in global$1&&"iterator"in Symbol,blob:"FileReader"in global$1&&"Blob"in global$1&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in global$1,arrayBuffer:"ArrayBuffer"in global$1};function isDataView(obj){return obj&&DataView.prototype.isPrototypeOf(obj)}if(support.arrayBuffer)var viewClasses=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],isArrayBufferView=ArrayBuffer.isView||function(obj){return obj&&viewClasses.indexOf(Object.prototype.toString.call(obj))>-1};function normalizeName(name){if("string"!=typeof name&&(name=String(name)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(name)||""===name)throw new TypeError('Invalid character in header field name: "'+name+'"');return name.toLowerCase()}function normalizeValue(value){return"string"!=typeof value&&(value=String(value)),value}function iteratorFor(items){var iterator={next:function(){var value=items.shift();return{done:void 0===value,value:value}}};return support.iterable&&(iterator[Symbol.iterator]=function(){return iterator}),iterator}function Headers(headers){this.map={},headers instanceof Headers?headers.forEach((function(value,name){this.append(name,value)}),this):Array.isArray(headers)?headers.forEach((function(header){this.append(header[0],header[1])}),this):headers&&Object.getOwnPropertyNames(headers).forEach((function(name){this.append(name,headers[name])}),this)}function consumed(body){if(body.bodyUsed)return Promise.reject(new TypeError("Already read"));body.bodyUsed=!0}function fileReaderReady(reader){return new Promise((function(resolve,reject){reader.onload=function(){resolve(reader.result)},reader.onerror=function(){reject(reader.error)}}))}function readBlobAsArrayBuffer(blob){var reader=new FileReader,promise=fileReaderReady(reader);return reader.readAsArrayBuffer(blob),promise}function readBlobAsText(blob){var reader=new FileReader,promise=fileReaderReady(reader);return reader.readAsText(blob),promise}function readArrayBufferAsText(buf){for(var view=new Uint8Array(buf),chars=new Array(view.length),i=0;i-1?upcased:method}function Request(input,options){if(!(this instanceof Request))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var body=(options=options||{}).body;if(input instanceof Request){if(input.bodyUsed)throw new TypeError("Already read");this.url=input.url,this.credentials=input.credentials,options.headers||(this.headers=new Headers(input.headers)),this.method=input.method,this.mode=input.mode,this.signal=input.signal,body||null==input._bodyInit||(body=input._bodyInit,input.bodyUsed=!0)}else this.url=String(input);if(this.credentials=options.credentials||this.credentials||"same-origin",!options.headers&&this.headers||(this.headers=new Headers(options.headers)),this.method=normalizeMethod(options.method||this.method||"GET"),this.mode=options.mode||this.mode||null,this.signal=options.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&body)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(body),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==options.cache&&"no-cache"!==options.cache)){var reParamSearch=/([?&])_=[^&]*/;if(reParamSearch.test(this.url))this.url=this.url.replace(reParamSearch,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function decode(body){var form=new FormData;return body.trim().split("&").forEach((function(bytes){if(bytes){var split=bytes.split("="),name=split.shift().replace(/\+/g," "),value=split.join("=").replace(/\+/g," ");form.append(decodeURIComponent(name),decodeURIComponent(value))}})),form}function parseHeaders(rawHeaders){var headers=new Headers;return rawHeaders.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(header){return 0===header.indexOf("\n")?header.substr(1,header.length):header})).forEach((function(line){var parts=line.split(":"),key=parts.shift().trim();if(key){var value=parts.join(":").trim();headers.append(key,value)}})),headers}function Response(bodyInit,options){if(!(this instanceof Response))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');options||(options={}),this.type="default",this.status=void 0===options.status?200:options.status,this.ok=this.status>=200&&this.status<300,this.statusText=void 0===options.statusText?"":""+options.statusText,this.headers=new Headers(options.headers),this.url=options.url||"",this._initBody(bodyInit)}Request.prototype.clone=function(){return new Request(this,{body:this._bodyInit})},Body.call(Request.prototype),Body.call(Response.prototype),Response.prototype.clone=function(){return new Response(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Headers(this.headers),url:this.url})},Response.error=function(){var response=new Response(null,{status:0,statusText:""});return response.type="error",response};var redirectStatuses=[301,302,303,307,308];Response.redirect=function(url,status){if(-1===redirectStatuses.indexOf(status))throw new RangeError("Invalid status code");return new Response(null,{status:status,headers:{location:url}})};var DOMException=global$1.DOMException;try{new DOMException}catch(err){DOMException=function(message,name){this.message=message,this.name=name;var error=Error(message);this.stack=error.stack},DOMException.prototype=Object.create(Error.prototype),DOMException.prototype.constructor=DOMException}function fetch$1(input,init){return new Promise((function(resolve,reject){var request=new Request(input,init);if(request.signal&&request.signal.aborted)return reject(new DOMException("Aborted","AbortError"));var xhr=new XMLHttpRequest;function abortXhr(){xhr.abort()}xhr.onload=function(){var options={status:xhr.status,statusText:xhr.statusText,headers:parseHeaders(xhr.getAllResponseHeaders()||"")};options.url="responseURL"in xhr?xhr.responseURL:options.headers.get("X-Request-URL");var body="response"in xhr?xhr.response:xhr.responseText;setTimeout((function(){resolve(new Response(body,options))}),0)},xhr.onerror=function(){setTimeout((function(){reject(new TypeError("Network request failed"))}),0)},xhr.ontimeout=function(){setTimeout((function(){reject(new TypeError("Network request failed"))}),0)},xhr.onabort=function(){setTimeout((function(){reject(new DOMException("Aborted","AbortError"))}),0)},xhr.open(request.method,function(url){try{return""===url&&global$1.location.href?global$1.location.href:url}catch(e){return url}}(request.url),!0),"include"===request.credentials?xhr.withCredentials=!0:"omit"===request.credentials&&(xhr.withCredentials=!1),"responseType"in xhr&&(support.blob?xhr.responseType="blob":support.arrayBuffer&&request.headers.get("Content-Type")&&-1!==request.headers.get("Content-Type").indexOf("application/octet-stream")&&(xhr.responseType="arraybuffer")),!init||"object"!=typeof init.headers||init.headers instanceof Headers?request.headers.forEach((function(value,name){xhr.setRequestHeader(name,value)})):Object.getOwnPropertyNames(init.headers).forEach((function(name){xhr.setRequestHeader(name,normalizeValue(init.headers[name]))})),request.signal&&(request.signal.addEventListener("abort",abortXhr),xhr.onreadystatechange=function(){4===xhr.readyState&&request.signal.removeEventListener("abort",abortXhr)}),xhr.send(void 0===request._bodyInit?null:request._bodyInit)}))}fetch$1.polyfill=!0,global$1.fetch||(global$1.fetch=fetch$1,global$1.Headers=Headers,global$1.Request=Request,global$1.Response=Response),null==Element.prototype.getAttributeNames&&(Element.prototype.getAttributeNames=function(){for(var attributes=this.attributes,length=attributes.length,result=new Array(length),i=0;i=0&&matches.item(i)!==this;);return i>-1}),Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(s){var el=this;do{if(el.matches(s))return el;el=el.parentElement||el.parentNode}while(null!==el&&1===el.nodeType);return null});var Connection=function(){function Connection(){_classCallCheck(this,Connection),this.headers={}}return _createClass(Connection,[{key:"onMessage",value:function(message,payload){message.component.receiveMessage(message,payload)}},{key:"onError",value:function(message,status,response){return message.component.messageSendFailed(),store$2.onErrorCallback(status,response)}},{key:"showExpiredMessage",value:function(response,message){store$2.sessionHasExpiredCallback?store$2.sessionHasExpiredCallback(response,message):confirm("This page has expired.\nWould you like to refresh the page?")&&window.location.reload()}},{key:"sendMessage",value:function(message){var _this=this,payload=message.payload(),csrfToken=getCsrfToken(),socketId=this.getSocketId();if(window.__testing_request_interceptor)return window.__testing_request_interceptor(payload,this);fetch("".concat(window.livewire_app_url,"/livewire/message/").concat(payload.fingerprint.name),{method:"POST",body:JSON.stringify(payload),credentials:"same-origin",headers:_objectSpread2(_objectSpread2(_objectSpread2({"Content-Type":"application/json",Accept:"text/html, application/xhtml+xml","X-Livewire":!0},this.headers),{},{Referer:window.location.href},csrfToken&&{"X-CSRF-TOKEN":csrfToken}),socketId&&{"X-Socket-ID":socketId})}).then((function(response){if(response.ok)response.text().then((function(response){_this.isOutputFromDump(response)?(_this.onError(message),_this.showHtmlModal(response)):_this.onMessage(message,JSON.parse(response))}));else{if(!1===_this.onError(message,response.status,response))return;if(419===response.status){if(store$2.sessionHasExpired)return;store$2.sessionHasExpired=!0,_this.showExpiredMessage(response,message)}else response.text().then((function(response){_this.showHtmlModal(response)}))}})).catch((function(){_this.onError(message)}))}},{key:"isOutputFromDump",value:function(output){return!!output.match(/