Dementu Posted August 13, 2018 Share Posted August 13, 2018 Witam, nie mogę zmusić prestę aby prawidłowo zaokrąglała podatek Vat. Zasada jest taka, że zaokrągla w górę(zalecane) i ma zaokrąglać każdy produkt. Niestety jak widać na załączonych screenach zaokrągla tylko do drugiego miejsca po przecinku. Prawidłowa kwota podatku w tym przypadku powinna być 1.37 natomiast liczbę 1,365 zaokrągla do 1,36 Proszę o pomoc. Link to comment Share on other sites More sharing options...
selljus.pl Posted August 13, 2018 Share Posted August 13, 2018 Gdzieś musi być błąd w szablonie, bez wglądu w kod niewiele można powiedzieć. Link to comment Share on other sites More sharing options...
Dementu Posted August 13, 2018 Author Share Posted August 13, 2018 Jeżeli dobrze zrozumiałem to błąd znajduje się w szablonie wykupionym z template monster? Link to comment Share on other sites More sharing options...
marcin_jaworski Posted August 14, 2018 Share Posted August 14, 2018 To ustawia się w zapleczu w Preferencje -> ogólne. Link to comment Share on other sites More sharing options...
Dementu Posted August 14, 2018 Author Share Posted August 14, 2018 Dziękuję za odpowiedź, to już sprawdzałem. Tak jak wcześniej wspominałem, problemem jest to, że presta zaokrągla tylko do drugiej cyfry po przecinku. W tym przykładzie 1.365 po zaokrągleniu powinno być na fakturze 1,37 a jest 1,36 Link to comment Share on other sites More sharing options...
marcin_jaworski Posted August 15, 2018 Share Posted August 15, 2018 Spróbuj w classes/Tools.php wiersz 1765 zmienić z /** * returns the rounded value of $value to specified precision, according to your configuration; * * @note : PHP 5.3.0 introduce a 3rd parameter mode in round function * * @param float $value * @param int $precision * @return float */ public static function ps_round($value, $precision = 0, $round_mode = null) { if ($round_mode === null) { if (Tools::$round_mode == null) { Tools::$round_mode = (int)Configuration::get('PS_PRICE_ROUND_MODE'); } $round_mode = Tools::$round_mode; } switch ($round_mode) { case PS_ROUND_UP: return Tools::ceilf($value, $precision); case PS_ROUND_DOWN: return Tools::floorf($value, $precision); case PS_ROUND_HALF_DOWN: case PS_ROUND_HALF_EVEN: case PS_ROUND_HALF_ODD: return Tools::math_round($value, $precision, $round_mode); case PS_ROUND_HALF_UP: default: return Tools::math_round($value, $precision, PS_ROUND_HALF_UP); } } Na: /** * returns the rounded value of $value to specified precision, according to your configuration; * * @note : PHP 5.3.0 introduce a 3rd parameter mode in round function * * @param float $value * @param int $precision * @return float */ public static function ps_round($value, $precision = 0, $round_mode = null) { if ($round_mode === null) { if (Tools::$round_mode == null) { Tools::$round_mode = (int)Configuration::get('PS_PRICE_ROUND_MODE'); } $round_mode = Tools::$round_mode; } switch ($round_mode) { case PS_ROUND_UP: return Tools::ceilf($value, $precision); case PS_ROUND_DOWN: return Tools::floorf($value, $precision); case PS_ROUND_HALF_DOWN: return round($value, $precision, PHP_ROUND_HALF_DOWN); case PS_ROUND_HALF_EVEN: case PS_ROUND_HALF_ODD: return Tools::math_round($value, $precision, $round_mode); case PS_ROUND_HALF_UP: return round($value, $precision, PHP_ROUND_HALF_UP); default: return round($value, $precision, PHP_ROUND_HALF_UP); } } Link to comment Share on other sites More sharing options...
Dementu Posted August 15, 2018 Author Share Posted August 15, 2018 Cały sklep od tego padł Link to comment Share on other sites More sharing options...
Dementu Posted August 15, 2018 Author Share Posted August 15, 2018 Class 'Tools' not found in /home/admin/domains/xxx/public_html/config/config.inc.php on line 80\n' Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now