Skip to content

Commit

Permalink
fixed #125
Browse files Browse the repository at this point in the history
  • Loading branch information
denisdulici committed Dec 5, 2017
1 parent 57e2f7f commit e6c4b27
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/Http/Controllers/Items/Items.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,13 +247,16 @@ public function totalItem()

if ($input_items) {
foreach ($input_items as $key => $item) {
$price = (double) $item['price'];
$quantity = (int) $item['quantity'];

$item_tax_total= 0;
$item_sub_total = ($item['price'] * $item['quantity']);
$item_sub_total = ($price * $quantity);

if (!empty($item['tax_id'])) {
$tax = Tax::find($item['tax_id']);

$item_tax_total = (($item['price'] * $item['quantity']) / 100) * $tax->rate;
$item_tax_total = (($price * $quantity) / 100) * $tax->rate;
}

$sub_total += $item_sub_total;
Expand Down

0 comments on commit e6c4b27

Please sign in to comment.