flangefrog Posted October 17, 2014 Report Posted October 17, 2014 Please format the tax rate on display. Instead of displaying GST (15.0000%) I want it to display GST (15%). Probably something like floatval($tax_rate) would be fine, I can't think of a reason anybody would need extra 0s. As a workaround I've changed the database column to be an INT. a.daniello and PauloV 2 Quote
Darin Posted October 17, 2014 Report Posted October 17, 2014 I know of at least one province in Canada that has a provincial sales tax rate of 9.975%, so it definitely needs the decimal places. However, I don't need them, so I used round( ) on the tax rate in my invoice template to get rid of those zeros in the pdf invoice. In line 315 of components/invoice_templates/default_invoice/default_invoice_pdf.php change $tax->amount to round($tax->amount) so that it looks like $data[] = array('notes'=>null,'label'=>Language::_("DefaultInvoice.tax_heading", true, $tax->name, round($tax->amount)),'price'=>$this->CurrencyFormat->format($tax->tax_total, $this->invoice->currency, self::$standard_num_options)); If you still want some of the decimal places, you can specify how many like this round($tax->amount,2) It doesn't bother me if the zeros still appear in the admin panel, so this change was all it took to make me happy. Quote
flangefrog Posted October 17, 2014 Author Report Posted October 17, 2014 I know of at least one province in Canada that has a provincial sales tax rate of 9.975%, so it definitely needs the decimal places. I wasn't suggesting to remove numbers after the decimal, floatval() just removes the extraneous 0s. e.g. floatval(1.1234) = 1.1234 floatval(1.1230 ) = 1.123 floatval(1.0000) = 1 $amount + 0 or (float)$amount do the same thing. Quote
Darin Posted October 17, 2014 Report Posted October 17, 2014 Ah, now I understand your request. I agree. Quote
Paul Posted October 17, 2014 Report Posted October 17, 2014 CORE-1483 a.daniello, Blesta Addons and PauloV 3 Quote
Blesta Addons Posted March 10, 2016 Report Posted March 10, 2016 +1 for fix in v4 a.daniello and PauloV 2 Quote
Paul Posted March 10, 2016 Report Posted March 10, 2016 I bumped this up in our backlog. If you don't see it in 4.0 beta 1, feel free to remind us and we may be able to sneak it in before final. PauloV 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.