diff --git a/application/helpers/locale_helper.php b/application/helpers/locale_helper.php index c13044b73..22c83ae7c 100644 --- a/application/helpers/locale_helper.php +++ b/application/helpers/locale_helper.php @@ -13,12 +13,6 @@ function to_currency($number, $escape=FALSE) $thousands_separator = $CI->config->item('thousands_separator') ? $CI->config->item('thousands_separator') : ''; $decimal_point = $CI->config->item('decimal_point') ? $CI->config->item('decimal_point') : '.'; $decimals = $CI->config->item('currency_decimals') ? $CI->config->item('currency_decimals') : 0; - - // in case of taxation with 3 decimals, force the currency decimal to be 3 and not max 2 as per db table (this is only used at UI level) - if( $CI->config->item('tax_decimals') > $CI->config->item('currency_decimals') ) - { - $decimals = $CI->config->item('tax_decimals'); - } if($number >= 0) { @@ -48,12 +42,6 @@ function to_currency_no_money($number) $decimals = $CI->config->item('currency_decimals') ? $CI->config->item('currency_decimals') : 0; - // in case of taxation with 3 decimals, force the currency decimal to be 3 and not max 2 as per db table (this is only used at UI level) - if( $CI->config->item('tax_decimals') > $CI->config->item('currency_decimals') ) - { - $decimals = $CI->config->item('tax_decimals'); - } - return number_format($number, $decimals, '.', ''); } @@ -63,12 +51,6 @@ function totals_decimals() $decimals = $CI->config->item('currency_decimals') ? $CI->config->item('currency_decimals') : 0; - // in case of taxation with 3 decimals, force the tatals decimal to be 3 so roundings are correct - if( $CI->config->item('tax_decimals') > $CI->config->item('currency_decimals') ) - { - $decimals = $CI->config->item('tax_decimals'); - } - return $decimals; } diff --git a/database/database.sql b/database/database.sql index f07649d67..c36adbfb6 100644 --- a/database/database.sql +++ b/database/database.sql @@ -60,6 +60,7 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES ('currency_symbol', '$'), ('decimal_point', '.'), ('currency_decimals', '2'), +('tax_decimals', '2'), ('quantity_decimals', '0'); -- -------------------------------------------------------- diff --git a/database/migrate_phppos_dist.sql b/database/migrate_phppos_dist.sql index b1486ed3b..7dd160adc 100644 --- a/database/migrate_phppos_dist.sql +++ b/database/migrate_phppos_dist.sql @@ -60,6 +60,7 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES ('currency_symbol', '$'), ('decimal_point', '.'), ('currency_decimals', '2'), +('tax_decimals', '2'), ('quantity_decimals', '0'); -- -------------------------------------------------------- diff --git a/database/tables.sql b/database/tables.sql index 99f094c8a..d39c0554e 100644 --- a/database/tables.sql +++ b/database/tables.sql @@ -60,6 +60,7 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES ('currency_symbol', '$'), ('decimal_point', '.'), ('currency_decimals', '2'), +('tax_decimals', '2'), ('quantity_decimals', '0'); -- --------------------------------------------------------