Skip to content
This repository has been archived by the owner on Dec 20, 2021. It is now read-only.

Commit

Permalink
Close #15 : when registering a sale, take the minimum between the rea…
Browse files Browse the repository at this point in the history
…l product price and the price paid by the user
  • Loading branch information
Saluki committed Jun 6, 2015
1 parent 51e0054 commit 10df042
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Http/Controllers/BarController.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function registerSale(Request $request, ProductRepository $productReposit
}

$this->snapshotDetailsRepository->store([ 'type' => 'SALE',
'sum' => $sale['price'],
'sum' => min($sale['price'], $sale['cash']),
'time' => $sale['timestamp'],
'sale_id' => $saleId,
'cs_id' => $currentSnapshotId]);
Expand Down

0 comments on commit 10df042

Please sign in to comment.