mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01:00
Merge pull request #7264 from turbo124/v5-develop
Translate payment type
This commit is contained in:
commit
b4303d0b57
@ -23,6 +23,7 @@ use App\Utils\Traits\MakesDates;
|
||||
use App\Utils\Traits\MakesHash;
|
||||
use App\Utils\Traits\Payment\Refundable;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
|
||||
class Payment extends BaseModel
|
||||
{
|
||||
@ -149,6 +150,15 @@ class Payment extends BaseModel
|
||||
return $this->belongsTo(PaymentType::class);
|
||||
}
|
||||
|
||||
public function translatedType()
|
||||
{
|
||||
if(!$this->type)
|
||||
return '';
|
||||
|
||||
return ctrans('texts.payment_type_'.$this->type->name);
|
||||
|
||||
}
|
||||
|
||||
public function gateway_type()
|
||||
{
|
||||
return $this->belongsTo(GatewayType::class);
|
||||
|
@ -57,7 +57,8 @@
|
||||
{{ $payment->translateDate($payment->date, $payment->client->date_format(), $payment->client->locale()) }}
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm leading-5 text-gray-500">
|
||||
{{ optional($payment->type)->name }}
|
||||
|
||||
{{ $payment->translatedType(); }}
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm leading-5 text-gray-500">
|
||||
{!! \App\Utils\Number::formatMoney($payment->amount, $payment->client) !!}
|
||||
|
Loading…
Reference in New Issue
Block a user