Show read only values when editing a payment
This commit is contained in:
parent
e599b7ee89
commit
a5ead8407d
2 changed files with 10 additions and 1 deletions
|
|
@ -4,6 +4,11 @@ use Utils;
|
|||
|
||||
class PaymentPresenter extends EntityPresenter {
|
||||
|
||||
public function amount()
|
||||
{
|
||||
return Utils::formatMoney($this->entity->amount, $this->entity->client->currency_id);
|
||||
}
|
||||
|
||||
public function client()
|
||||
{
|
||||
return $this->entity->client ? $this->entity->client->getDisplayName() : '';
|
||||
|
|
|
|||
|
|
@ -38,7 +38,11 @@
|
|||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
|
||||
@if (!$payment)
|
||||
@if ($payment)
|
||||
{!! Former::plaintext()->label('client')->value($payment->client->getDisplayName()) !!}
|
||||
{!! Former::plaintext()->label('invoice')->value($payment->invoice->getDisplayName()) !!}
|
||||
{!! Former::plaintext()->label('amount')->value($payment->present()->amount) !!}
|
||||
@else
|
||||
{!! Former::select('client')->addOption('', '')->addGroupClass('client-select') !!}
|
||||
{!! Former::select('invoice')->addOption('', '')->addGroupClass('invoice-select') !!}
|
||||
{!! Former::text('amount') !!}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue