mirror of
https://github.com/kevin-DL/LaravelShoppingcart.git
synced 2026-01-23 23:51:25 +00:00
StyleCI
This commit is contained in:
@@ -378,7 +378,7 @@ class CartItem implements Arrayable, Jsonable
|
|||||||
case 'priceTax':
|
case 'priceTax':
|
||||||
return round($this->priceTarget + $this->tax, $decimals);
|
return round($this->priceTarget + $this->tax, $decimals);
|
||||||
case 'discountTotal':
|
case 'discountTotal':
|
||||||
return round ($this->discount * $this->qty, $decimals);
|
return round($this->discount * $this->qty, $decimals);
|
||||||
case 'weightTotal':
|
case 'weightTotal':
|
||||||
return round($this->weight * $this->qty, $decimals);
|
return round($this->weight * $this->qty, $decimals);
|
||||||
case 'priceTotal':
|
case 'priceTotal':
|
||||||
@@ -388,7 +388,7 @@ class CartItem implements Arrayable, Jsonable
|
|||||||
case 'priceTarget':
|
case 'priceTarget':
|
||||||
return round(($this->priceTotal - $this->discountTotal) / $this->qty, $decimals);
|
return round(($this->priceTotal - $this->discountTotal) / $this->qty, $decimals);
|
||||||
case 'taxTotal':
|
case 'taxTotal':
|
||||||
return round($this->subtotal * ($this->taxRate / 100) , $decimals);
|
return round($this->subtotal * ($this->taxRate / 100), $decimals);
|
||||||
case 'total':
|
case 'total':
|
||||||
return round($this->subtotal + $this->taxTotal, $decimals);
|
return round($this->subtotal + $this->taxTotal, $decimals);
|
||||||
|
|
||||||
|
|||||||
@@ -1310,8 +1310,8 @@ class CartTest extends TestCase
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** @test */
|
/** @test */
|
||||||
public function it_use_correctly_rounded_values_for_totals_and_cart_summary() {
|
public function it_use_correctly_rounded_values_for_totals_and_cart_summary()
|
||||||
|
{
|
||||||
$this->setConfigFormat(2, ',', '');
|
$this->setConfigFormat(2, ',', '');
|
||||||
|
|
||||||
$cart = $this->getCartDiscount(6);
|
$cart = $this->getCartDiscount(6);
|
||||||
@@ -1346,6 +1346,7 @@ class CartTest extends TestCase
|
|||||||
* Get an instance of the cart with discount.
|
* Get an instance of the cart with discount.
|
||||||
*
|
*
|
||||||
* @param int $discount
|
* @param int $discount
|
||||||
|
*
|
||||||
* @return \Gloudemans\Shoppingcart\Cart
|
* @return \Gloudemans\Shoppingcart\Cart
|
||||||
*/
|
*/
|
||||||
private function getCartDiscount($discount = 50)
|
private function getCartDiscount($discount = 50)
|
||||||
|
|||||||
Reference in New Issue
Block a user