This commit is contained in:
ahmedsophyudden
2021-11-04 23:01:45 +08:00
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ class CompanyResource extends JsonResource
'status' => (int) $this->status,
'contact' => new ContactResource ($this->when($this->has('contacts'), $this->contacts->first())),
'address' => new AddressResource($this->when($this->has('addresses'), $this->addresses->where('billing', true)->first())),
'employee' => new UserResource(Auth::user()->type === RoleTypes::USER ? $this->employees()->where('email', '=', Auth::user()->email)->first() : $this->employees()->where('users.status', '=', ApprovalStatus::APPROVED)->orderBy('id', 'DESC')->first()),
'employee' => new UserResource(Auth::user()->type === RoleTypes::USER ? $this->employees()->where('email', '=', Auth::user()->email)->first() : $this->employees()->orderBy('id', 'DESC')->first()),
'identification' => new DocumentResource($this->documents->whereIn('document_type', DocumentType::IDENTIFICATION_DOCUMENTS)->first()),
'bookings' => $this->whenLoaded('bookings', $this->bookings()->orderBy('id', 'DESC')->get(), []),
'total_payments' => (float) $this->transactions()->where('transactions.type', TransactionType::PAYMENT)->whereIn('transactions.status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])->sum('amount'),
+1 -1
View File
@@ -33,7 +33,7 @@
<div class="ref">Ref# {{ $invoice_transaction->payment_reference ?? '-' }}</div>
<div class="date">Date: {{ $po_order_transaction->created_at }}</div>
<div class="date">Date: {{ $po_order_transaction->booking->created_at }}</div>
<div>&nbsp;</div>
</div>
</td>
@@ -14,7 +14,7 @@
<td class="document-detail">
PO#: {{ $po_order_transaction->bill_no }} <br>
Ref#: {{ $po_order_transaction->payment_reference ?? '-' }} <br>
Date: {{ $po_order_transaction->created_at }}
Date: {{ $po_order_transaction->booking->created_at }}
</td>
</tr>
</table>