Skip to content

Commit d03216b

Browse files
Update customer-profile, item-update, view/datatable, sales, and transaction files
1 parent f746318 commit d03216b

File tree

5 files changed

+15
-7
lines changed

5 files changed

+15
-7
lines changed

functions/customer-profile.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function get_sale(){
2424
$statement->bindParam(':id', $id);
2525
$statement->execute();
2626
$result = $statement->fetch();
27-
echo $result['total'] ?? 0;
27+
echo number_format($result['total'] ?? 0, 2);
2828
}
2929

3030
function get_returned(){

functions/item-update.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
$sql = "UPDATE inventory SET
2222
name = :name,
23-
description = :description
23+
description = :description,
2424
price = :price
2525
WHERE id = :id";
2626

functions/view/datatable.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ function get_rent_list()
224224
function get_transaction_list()
225225
{
226226
global $db;
227-
$sql = "SELECT r.id, i.name, r.qty, r.price, r.returned, r.penalty, r.conditions, r.created_at, t.status, c.fullname, c.phone, c.address, c.id as customer_id, t.id as transact_id
227+
$sql = "SELECT r.id, i.name, r.qty, r.price, r.returned, r.penalty, r.conditions, r.item_damage, r.item_repaired, r.item_beyond_repair, r.created_at, t.status, c.fullname, c.phone, c.address, c.id as customer_id, t.id as transact_id
228228
FROM rentals r
229229
JOIN transactions t ON r.transact_id = t.id
230230
JOIN customers c ON t.customer_id = c.id
@@ -242,10 +242,14 @@ function get_transaction_list()
242242
<td><?php echo $row['phone'] ?></td>
243243
<td><?php echo $row['address'] ?></td>
244244
<td><?php echo $row['qty'] ?></td>
245+
<td><?php echo $row['qty'] - $row['item_damage'] ?></td>
246+
<td><?php echo $row['item_damage'] ?></td>
247+
<td><?php echo $row['item_repaired'] ?></td>
248+
<td><?php echo $row['item_beyond_repair'] ?></td>
245249
<td><?php echo $row['created_at'] ?></td>
246250
<td><?php echo $row['returned'] ?></td>
247-
<td>₱<?php echo $row['penalty'] ?></td>
248-
<td>₱<?php echo $row['price'] ?></td>
251+
<td>₱<?php echo number_format($row['penalty'] , 2) ?></td>
252+
<td>₱<?php echo number_format($row['price'] ,) ?></td>
249253
<td class="text-center">
250254
<a data-bss-tooltip="" class="mx-1" href="profile.php?id=<?php echo $row['customer_id'] ?>" title="Here you can see the customer transactions."><i class="far fa-eye text-primary" style="font-size: 20px;"></i></a>
251255
</td>
@@ -313,7 +317,7 @@ function get_customer_transaction_list()
313317
<td><?php echo $row['qty'] ?></td>
314318
<td><?php echo $row['created_at'] ?></td>
315319
<td><?php echo $row['returned'] ?></td>
316-
<td>₱<?php echo $row['price'] ?></td>
320+
<td>₱<?php echo number_format($row['price'], 2) ?></td>
317321
</tr>
318322
<?php
319323
}

sales.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@
5252
<th>Phone</th>
5353
<th>Address</th>
5454
<th>Qty</th>
55+
<th>Returned</th>
56+
<th>Damage</th>
57+
<th>Repaired</th>
58+
<th>Beyond Repair</th>
5559
<th>Borrowed Date</th>
5660
<th>Returned Date</th>
5761
<th>Penalty</th>

transaction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
<div class="row align-items-center no-gutters">
5858
<div class="col me-2">
5959
<div class="text-uppercase text-success fw-bold text-xs mb-1"><span>TOTAL</span></div>
60-
<div class="text-dark fw-bold h5 mb-0"><span>₱<?php echo $total; ?></span></div>
60+
<div class="text-dark fw-bold h5 mb-0"><span>₱<?php echo number_format($total, 2); ?></span></div>
6161
</div>
6262
<div class="col-auto"><i class="fas fa-dollar-sign fa-2x text-gray-300"></i></div>
6363
</div>

0 commit comments

Comments
 (0)