mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04: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\MakesHash;
|
||||||
use App\Utils\Traits\Payment\Refundable;
|
use App\Utils\Traits\Payment\Refundable;
|
||||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
|
use Illuminate\Support\Facades\Cache;
|
||||||
|
|
||||||
class Payment extends BaseModel
|
class Payment extends BaseModel
|
||||||
{
|
{
|
||||||
@ -149,6 +150,15 @@ class Payment extends BaseModel
|
|||||||
return $this->belongsTo(PaymentType::class);
|
return $this->belongsTo(PaymentType::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function translatedType()
|
||||||
|
{
|
||||||
|
if(!$this->type)
|
||||||
|
return '';
|
||||||
|
|
||||||
|
return ctrans('texts.payment_type_'.$this->type->name);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public function gateway_type()
|
public function gateway_type()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(GatewayType::class);
|
return $this->belongsTo(GatewayType::class);
|
||||||
|
@ -57,7 +57,8 @@
|
|||||||
{{ $payment->translateDate($payment->date, $payment->client->date_format(), $payment->client->locale()) }}
|
{{ $payment->translateDate($payment->date, $payment->client->date_format(), $payment->client->locale()) }}
|
||||||
</td>
|
</td>
|
||||||
<td class="px-6 py-4 whitespace-nowrap text-sm leading-5 text-gray-500">
|
<td class="px-6 py-4 whitespace-nowrap text-sm leading-5 text-gray-500">
|
||||||
{{ optional($payment->type)->name }}
|
|
||||||
|
{{ $payment->translatedType(); }}
|
||||||
</td>
|
</td>
|
||||||
<td class="px-6 py-4 whitespace-nowrap text-sm leading-5 text-gray-500">
|
<td class="px-6 py-4 whitespace-nowrap text-sm leading-5 text-gray-500">
|
||||||
{!! \App\Utils\Number::formatMoney($payment->amount, $payment->client) !!}
|
{!! \App\Utils\Number::formatMoney($payment->amount, $payment->client) !!}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user