Fixes for translations

This commit is contained in:
David Bomba 2023-08-02 20:10:42 +10:00
parent e35a99d454
commit 1b5bbb43da
11 changed files with 26 additions and 36 deletions

View File

@ -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

View File

@ -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,

View File

@ -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;
}
/**

View File

@ -75,6 +75,6 @@ class ApplePayDomain implements ShouldQueue
$parsed_url = parse_url($domain);
return $parsed_url['host'];
return $parsed_url['host'] ?? '';
}
}

View File

@ -58,4 +58,4 @@ class RefreshPdfs implements ShouldQueue
CreateEntityPdf::dispatch($invitation);
});
}
}
}

View File

@ -312,4 +312,4 @@ class ReminderJob implements ShouldQueue
return $invoice;
}
}
}

View File

@ -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');
}

View File

@ -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');
}

View File

@ -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),

View File

@ -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;
}
}
}

View File

@ -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()#'
- '#Call to an undefined method [a-zA-Z0-9\\_]+::company\(\)#'
- '#Call to an undefined method [a-zA-Z0-9\\_]+::entityFilter\(\)#'