Samson Mutunga 1 day ago
parent
commit
5dd1e85b62

+ 24 - 19
resources/views/app/my-account/admin/orders/partials/ledger-transactions.blade.php

@@ -1,21 +1,26 @@
-<h6 class="fw-bold">Ledger Transactions</h6>
-<table class="table table-sm table-hover table-striped table-bordered mb-0">
-    <thead class="bg-warning bg-opacity-10">
-        <tr>
-            <th>Date</th>
-            <th>Plus/Minus</th>
-            <th>Amount</th>
-            <th>Memo</th>
-        </tr>
-    </thead>
-    <tbody>
-        @foreach ($order->ledgerTransactions as $transaction)
+<?php
+    $ledgerTransactions = $order->ledgerTransactions;
+ ?>
+ @if(count($ledgerTransactions))
+    <h6 class="fw-bold">Ledger Transactions</h6>
+    <table class="table table-sm table-hover table-striped table-bordered mb-0">
+        <thead class="bg-warning bg-opacity-10">
             <tr>
-                <td>{{ friendly_date($transaction->created_at) }}</td>
-                <td>{{ $transaction->plus_or_minus }}</td>
-                <td>${{ $transaction->amount }}</td>
-                <td>{{ $transaction->system_memo }}</td>
+                <th>Date</th>
+                <th>Plus/Minus</th>
+                <th>Amount</th>
+                <th>Memo</th>
             </tr>
-        @endforeach
-    </tbody>
-</table>
+        </thead>
+        <tbody>
+            @foreach ($order->ledgerTransactions as $transaction)
+                <tr>
+                    <td>{{ friendly_date($transaction->created_at) }}</td>
+                    <td>{{ $transaction->plus_or_minus }}</td>
+                    <td>${{ $transaction->amount }}</td>
+                    <td>{{ $transaction->system_memo }}</td>
+                </tr>
+            @endforeach
+        </tbody>
+    </table>
+@endif