new discount on sales

This commit is contained in:
Erastus
2018-08-31 15:27:44 -05:00
parent a5f0c83e87
commit a6b11e6f48
44 changed files with 288 additions and 334 deletions

View File

@@ -31,12 +31,12 @@ class Tax_lib
/*
* Compute the tax basis and returns the tax amount
*/
public function get_item_sales_tax($quantity, $price, $discount_percentage, $discount_fixed, $tax_percentage, $rounding_code)
public function get_item_sales_tax($quantity, $price, $discount, $discount_type, $tax_percentage, $rounding_code)
{
$decimals = tax_decimals();
// The tax basis should be returned at the currency scale
$tax_basis = $this->CI->sale_lib->get_item_total($quantity, $price, $discount_percentage, $discount_fixed, TRUE);
$tax_basis = $this->CI->sale_lib->get_item_total($quantity, $price, $discount, $discount_type, TRUE);
return $this->get_sales_tax_for_amount($tax_basis, $tax_percentage, $rounding_code, $decimals);
}
@@ -223,7 +223,7 @@ class Tax_lib
$decimals = tax_decimals();
// The tax basis should be returned at the currency scale
$tax_basis = $this->CI->sale_lib->get_item_total($item['quantity'], $item['price'], $item['discount'], $item['discount_fixed'], TRUE);
$tax_basis = $this->CI->sale_lib->get_item_total($item['quantity'], $item['price'], $item['discount'], $item['discount_type'], TRUE);
$tax_amount = $this->get_sales_tax_for_amount($tax_basis, $tax_rate, $rounding_code, $decimals);
$tax_group = (float)$tax_rate . '% ' . $tax_category;