mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
Merge branch 'steve/fix-view-statement-details' of gitlab.com:CIEFWorldwideSdnBhd/exchange-2.0
This commit is contained in:
@@ -15,7 +15,7 @@ class HasAccountStatementId implements Filter
|
||||
*/
|
||||
public static function apply(Builder $builder, $value)
|
||||
{
|
||||
return $builder->whereHas('statementTransaction', function ($query) use ($value) {
|
||||
return $builder->whereHas('transaction', function ($query) use ($value) {
|
||||
$query->where('account_statement_id', $value);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class BankStatementDetailResource extends JsonResource
|
||||
{
|
||||
/**
|
||||
* Transform the resource collection into an array.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return array
|
||||
*/
|
||||
public function toArray($request)
|
||||
{
|
||||
$transaction = $this->transaction;
|
||||
$accountStatement = $transaction->statement;
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'date' => Carbon::parse($transaction->posting_date)->format('Y-m-d'),
|
||||
'transaction_description_1' => $transaction->transaction_description,
|
||||
'pay_for' => $transaction->transaction_description_2,
|
||||
'system_references' => $this->system,
|
||||
'amount' => $transaction->amount,
|
||||
'account_statement_date_from' => Carbon::parse($accountStatement->date_from)->format('Y-m-d'),
|
||||
'account_statement_date_to' => Carbon::parse($accountStatement->date_to)->format('Y-m-d'),
|
||||
];
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -77,7 +77,8 @@
|
||||
<tr v-for="item in $store.getters.getListData(section)" :key="item.id">
|
||||
<td>{{item.id}}</td>
|
||||
<td>{{item.date}}</td>
|
||||
<td>{{item.transaction_description_1 | truncate(30, '...')}}</td>
|
||||
<td v-if="item.transaction_description_1 != null">{{item.transaction_description_1 | truncate(30, '...')}}</td>
|
||||
<td v-if="item.transaction_description_1 == null"></td>
|
||||
<td>{{item.pay_for}}</td>
|
||||
<td>{{item.system_references}}</td>
|
||||
<td>{{item.amount}}</td>
|
||||
|
||||
Reference in New Issue
Block a user