show currency supplier info for transaction

This commit is contained in:
omair saleh
2021-11-29 12:20:00 +08:00
parent f8f8833994
commit e6ada6b2d4
3 changed files with 14 additions and 0 deletions
@@ -21,6 +21,7 @@ class TransactionResource extends JsonResource
'booking' => new BookingResource($this->booking),
'type' => (int) $this->type,
'bill_no' => $this->bill_no,
'issuer' => new CompanyResource($this->issuer),
'recipient_bank_account' => new BankResource($this->when((int) $this->type === TransactionType::BILL,$this->booking->bank)),
'amount' => (double) $this->amount,
'original_amount' => (double) $this->original_amount,
+8
View File
@@ -26,6 +26,14 @@ class Transaction extends AbstractModel implements Documentable
return $this->BelongsTo( Booking::class, 'booking_id', 'id');
}
/**
* @return BelongsTo
*/
public function issuer(): BelongsTo
{
return $this->BelongsTo( Company::class, 'issuer', 'id');
}
/**
* @return BelongsTo
*/
@@ -16,6 +16,11 @@
{{ item.type === 3 ? item.original_currency.short_code : item.currency.short_code}} {{(Math.round((item.type === 3 ? item.original_amount : item.amount + Number.EPSILON) * 100) / 100).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")}}
</div>
</div>
<div class="col-auto" v-if="$store.isAdmin && item.type === 3">
<div class="font-heading fs-10 bold">
</div>
</div>
</div>
<div class="row">
<div class="col">