1
0
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:
David Bomba 2022-03-06 08:40:03 +11:00 committed by GitHub
commit b4303d0b57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View File

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

View File

@ -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) !!}