transaction bill

This commit is contained in:
glovetleong
2022-01-13 22:49:02 +08:00
parent 70adbae1d4
commit f56369d707
6 changed files with 63 additions and 9 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ class TransactionResource extends JsonResource
'status' => (int) $this->status,
'details' => TransactionDetailResource::collection($this->transactionDetails),
'documents' => new DocumentResource($this->documents()->first()),
'customer_booking' => new TransactionResource($this->when((int) $this->type === TransactionType::BILL, $this->booking->transactions()->payments()->complete()->where('original_amount', '=', $this->original_amount)->where('id', '<', $this->id)->orderByDesc('id')->first())),
'customer_booking' => new TransactionResource($this->when((int) $this->type === TransactionType::BILL, $this->owner)),
'expires_on' => Carbon::parse($this->expires_on)->format('d-m-Y h:i:s A'),
'updated_at' => Carbon::parse($this->updated_at)->format('d-m-Y h:i:s A')
];