1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-05 18:52:44 +01:00

Client portal client screen

This commit is contained in:
David Bomba 2019-10-04 07:51:54 +10:00
parent 5adc88d01e
commit ae02953a8f
4 changed files with 52 additions and 3 deletions

View File

@ -51,7 +51,7 @@ class PaymentController extends Controller
if (request()->ajax()) {
return DataTables::of($payments)->addColumn('action', function ($payment) {
return '<a href="/client/payments/'. $payment->hashed_id .'/edit" class="btn btn-xs btn-primary"><i class="glyphicon glyphicon-edit"></i>'.ctrans('texts.view').'</a>';
return '<a href="/client/payments/'. $payment->hashed_id .'" class="btn btn-xs btn-primary"><i class="glyphicon glyphicon-edit"></i>'.ctrans('texts.view').'</a>';
})->editColumn('payment_type_id', function ($payment) {
return $payment->type->name;
})
@ -82,8 +82,7 @@ class PaymentController extends Controller
$data['payment'] = $payment;
print_r($payment->toArray());
//return view('portal.default.payments.show', $data);
return view('portal.default.payments.show', $data);
}

View File

@ -13,6 +13,7 @@ namespace App\Models;
use App\Models\BaseModel;
use App\Models\Filterable;
use App\Utils\Number;
use App\Utils\Traits\MakesHash;
use Illuminate\Database\Eloquent\Model;
@ -93,6 +94,11 @@ class Payment extends BaseModel
return $this->hasOne(PaymentType::class,'id','payment_type_id');
}
public function formattedAmount()
{
return Number::formatMoney($this->amount, $this->client);
}
public static function badgeForStatus(int $status)
{
switch ($status) {

View File

@ -92,6 +92,7 @@ class PayPalExpressPaymentDriver extends BasePaymentDriver
*/
public function processPaymentView(array $data)
{
$response = $this->purchase($this->paymentDetails($data), $this->paymentItems($data));

View File

@ -0,0 +1,43 @@
@extends('portal.default.layouts.master')
@section('header')
@stop
@section('body')
<main class="main">
<div class="container-fluid">
<div class="row" style="padding-top: 30px;">
<div class="col d-flex justify-content-center">
<div class="card w-50 p-10">
<div class="card-header">
{{ ctrans('texts.payment')}}
</div>
<div class="card-body">
<table class="table table-responsive-sm table-bordered">
<tr><td style="text-align: right;">{{ctrans('texts.payment_date')}}</td><td>{{$payment->payment_date}}</td></tr>
<tr><td style="text-align: right;">{{ctrans('texts.transaction_reference')}}</td><td>{{$payment->transaction_reference}}</td></tr>
<tr><td style="text-align: right;">{{ctrans('texts.method')}}</td><td>{{$payment->type->name}}</td></tr>
<tr><td style="text-align: right;">{{ctrans('texts.amount')}}</td><td>{{$payment->formattedAmount()}}</td></tr>
<tr><td style="text-align: right;">{{ctrans('texts.status')}}</td><td>{!! $payment::badgeForStatus($payment->status_id) !!}</td></tr>
</table>
<table class="table table-responsive-sm table-sm">
@foreach($payment->invoices as $invoice)
<tr><td style="text-align: right;">{{ ctrans('texts.invoice_number')}}</td><td><a href="{{ route('client.invoice.show', ['invoice' => $invoice->hashed_id])}}">{{ $invoice->invoice_number }}</a></td></tr>
@endforeach
</table>
</div>
</div>
</div>
</div>
</div>
</main>
</body>
@endsection
@push('css')
@endpush
@push('scripts')
@endpush
@section('footer')
@endsection