diff --git a/app/Filters/QuoteFilters.php b/app/Filters/QuoteFilters.php index 1cb0bed3a999..a08c6aa09418 100644 --- a/app/Filters/QuoteFilters.php +++ b/app/Filters/QuoteFilters.php @@ -53,7 +53,7 @@ class QuoteFilters extends QueryFilters * - paused * - completed * - * @param string client_status The invoice status as seen by the client + * @param string $value The invoice status as seen by the client * @return Builder */ public function client_status(string $value = ''): Builder diff --git a/app/Http/Controllers/EmailController.php b/app/Http/Controllers/EmailController.php index 0939a79a294c..b3077f10eb60 100644 --- a/app/Http/Controllers/EmailController.php +++ b/app/Http/Controllers/EmailController.php @@ -144,6 +144,8 @@ class EmailController extends BaseController private function resolveClass(string $entity): string { + $class = ''; + match ($entity) { 'invoice' => $class = Invoice::class, 'App\Models\Invoice' => $class = Invoice::class, diff --git a/app/Jobs/Report/ProfitAndLoss.php b/app/Jobs/Report/ProfitAndLoss.php index fd8cd5575864..c3a31556a8fc 100644 --- a/app/Jobs/Report/ProfitAndLoss.php +++ b/app/Jobs/Report/ProfitAndLoss.php @@ -24,21 +24,8 @@ class ProfitAndLoss implements ShouldQueue { use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; - protected Company $company; - - protected array $payload; - - /** - * Create a new job instance. - * - * @param RecurringInvoice $recurring_invoice - * @param string $db - */ - public function __construct(Company $company, array $payload) + public function __construct(protected Company $company, protected array $payload) { - $this->company = $company; - - $this->payload = $payload; } /** diff --git a/app/Jobs/Util/ApplePayDomain.php b/app/Jobs/Util/ApplePayDomain.php index b9e424e2e3ef..001813a7afe0 100644 --- a/app/Jobs/Util/ApplePayDomain.php +++ b/app/Jobs/Util/ApplePayDomain.php @@ -75,6 +75,6 @@ class ApplePayDomain implements ShouldQueue $parsed_url = parse_url($domain); - return $parsed_url['host']; + return $parsed_url['host'] ?? ''; } } diff --git a/app/Jobs/Util/RefreshPdfs.php b/app/Jobs/Util/RefreshPdfs.php index cdc5a2c5ccdb..dba50bf67c69 100644 --- a/app/Jobs/Util/RefreshPdfs.php +++ b/app/Jobs/Util/RefreshPdfs.php @@ -58,4 +58,4 @@ class RefreshPdfs implements ShouldQueue CreateEntityPdf::dispatch($invitation); }); } -} +} \ No newline at end of file diff --git a/app/Jobs/Util/ReminderJob.php b/app/Jobs/Util/ReminderJob.php index 3a2d00919cc5..27a0f0632577 100644 --- a/app/Jobs/Util/ReminderJob.php +++ b/app/Jobs/Util/ReminderJob.php @@ -312,4 +312,4 @@ class ReminderJob implements ShouldQueue return $invoice; } -} +} \ No newline at end of file diff --git a/app/Models/Invoice.php b/app/Models/Invoice.php index b7f127ee0c90..1cb773ad64d0 100644 --- a/app/Models/Invoice.php +++ b/app/Models/Invoice.php @@ -252,42 +252,42 @@ class Invoice extends BaseModel return $this->dateMutator($value); } - public function company() + public function company(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(Company::class); } - public function project() + public function project(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(Project::class); } - public function vendor() + public function vendor(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(Vendor::class); } - public function design() + public function design(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(Design::class); } - public function user() + public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(User::class)->withTrashed(); } - public function recurring_invoice() + public function recurring_invoice(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(RecurringInvoice::class, 'recurring_id', 'id')->withTrashed(); } - public function assigned_user() + public function assigned_user(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(User::class, 'assigned_user_id', 'id')->withTrashed(); } - public function invitations() + public function invitations(): \Illuminate\Database\Eloquent\Relations\HasMany { return $this->hasMany(InvoiceInvitation::class); } @@ -297,22 +297,22 @@ class Invoice extends BaseModel return $this->belongsTo(Client::class)->withTrashed(); } - public function subscription() + public function subscription(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(Subscription::class)->withTrashed(); } - public function documents() + public function documents(): \Illuminate\Database\Eloquent\Relations\MorphMany { return $this->morphMany(Document::class, 'documentable'); } - public function payments() + public function payments(): \Illuminate\Database\Eloquent\Relations\MorphToMany { return $this->morphToMany(Payment::class, 'paymentable')->withTrashed()->withPivot('amount', 'refunded')->withTimestamps(); } - public function company_ledger() + public function company_ledger(): \Illuminate\Database\Eloquent\Relations\MorphMany { return $this->morphMany(CompanyLedger::class, 'company_ledgerable'); } diff --git a/app/Models/Payment.php b/app/Models/Payment.php index 368546283176..091cf5711018 100644 --- a/app/Models/Payment.php +++ b/app/Models/Payment.php @@ -77,7 +77,6 @@ use Illuminate\Database\Eloquent\SoftDeletes; * @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 company() * @method static \Illuminate\Database\Eloquent\Builder exclude($columns) * @method static \Database\Factories\PaymentFactory factory($count = null, $state = []) * @method static \Illuminate\Database\Eloquent\Builder|Payment filter(\App\Filters\QueryFilters $filters) @@ -228,7 +227,7 @@ class Payment extends BaseModel return $this->morphedByMany(Credit::class, 'paymentable')->withTrashed()->withPivot('amount', 'refunded')->withTimestamps(); } - public function company_ledger() + public function company_ledger(): \Illuminate\Database\Eloquent\Relations\MorphMany { return $this->morphMany(CompanyLedger::class, 'company_ledgerable'); } diff --git a/app/Services/Invoice/EInvoice/FacturaEInvoice.php b/app/Services/Invoice/EInvoice/FacturaEInvoice.php index df92882a0a42..9afa4ab037d3 100644 --- a/app/Services/Invoice/EInvoice/FacturaEInvoice.php +++ b/app/Services/Invoice/EInvoice/FacturaEInvoice.php @@ -463,7 +463,7 @@ class FacturaEInvoice extends AbstractService $company = $this->invoice->company; $seller = new FacturaeParty([ - "isLegalEntity" => true, // Se asume true si se omite + "isLegalEntity" => $company->custom_value1, // Se asume true si se omite "taxNumber" => $company->settings->vat_number, "name" => substr($company->present()->name(), 0, 40), "address" => substr($company->settings->address1, 0, 80), diff --git a/app/Services/Payment/RefundPayment.php b/app/Services/Payment/RefundPayment.php index 99747a392a2b..15952fe8733c 100644 --- a/app/Services/Payment/RefundPayment.php +++ b/app/Services/Payment/RefundPayment.php @@ -105,7 +105,7 @@ class RefundPayment /** * Create the payment activity. * - * @param json $notes gateway_transaction + * @param string $notes * @return $this */ private function createActivity($notes) @@ -309,4 +309,4 @@ class RefundPayment return $this->payment; } -} +} \ No newline at end of file diff --git a/phpstan.neon b/phpstan.neon index fbcbb4b248a7..11965c7dd020 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -12,5 +12,7 @@ parameters: universalObjectCratesClasses: - App\DataMapper\Tax\RuleInterface - App\DataMapper\FeesAndLimits + reportUnmatchedIgnoredErrors: false ignoreErrors: - - '#Call to an undefined method Illuminate\Database\Database\Eloquent\Builder::company()#' \ No newline at end of file + - '#Call to an undefined method [a-zA-Z0-9\\_]+::company\(\)#' + - '#Call to an undefined method [a-zA-Z0-9\\_]+::entityFilter\(\)#' \ No newline at end of file