Jump to content

Error in print receipt?


Guest

Recommended Posts

Hi,

On some last tests before a shop goes online we discovered an error in the print receipt. You can find this as a user after login and watch an order. Underneath this order there is a option to print the invoice.

Bigger amounts are shown incorrectly. For example. In the invoice a price is € 67.720. When printing this invoice as a user from his/her account the price is € 67.00.

This error shows up when calling the print.receipt.php. I used the original file so no changes are made.

Using CC 5.14 (by CC upgraded from 5.07)

See att.

The ORDER attachment is the order that the user can see in his/her account. Underneath there is a text called PRINT. When clicking you see the contents of the next att.

The PRINT.RECEIPT is the printable version of the order. As you can see the values are totally incorrect. The print.receipt.php is an original file.

Link to comment
Share on other sites

Does the Euro monetary system specify that value expressions be such that the decimal separator must be the period and the thousands separator (if desired to show it) must be the comma?

Or are you free to use those characters in the manner according to your country's custom? (That is, do you use the period to separate thousands?)

You said, "For example. In the invoice a price is € 67.720."

Was your use of the period as a thousands separator intentional?

Link to comment
Share on other sites

That's correct. With the euro, and/or in our country it's € 10.000,-

I believe overseas it's more like $ 10,000

I'm getting the hint.....but how and where to change? Not in the admin as far as I can see :)

Link to comment
Share on other sites

Ok, so, when you enter the values in the admin Add/Edit Product screen, do you actually use the comma for the decimal fractional part?

I'm just asking to satisfy my curiosity. I'm still tracing out the different paths of code execution between the View Order and Print Receipt, which, so far as I got, the only difference is in how the period and comma are used, or not used.

Link to comment
Share on other sites

HI Dirty, Brian,

I don't know where to change the php formatting. But sure this has to do with it.

@ Brian, yes, our client uses the comma, but after saving it turns into a . instead of a comma. I think there's the problem and the print receipt is only build for us/en amounts.

For example; in our country you write: € 10.000,-. In USA style it's 10,000 $. Notice the difference. So I think here's the clue and the solution needs to be found in here. It would be nice if CC enters an option to change this cause for now all contries who uses our style the print reciept is completey useless for bigger amounts.

Correct me If my thought is wrong :)

Boudi

Link to comment
Share on other sites

  • 2 weeks later...

Has this been resolved?

If this is still an issue for country-specific-money-format scenarios, please try this:

In the file /classes/cubecart.class.php, near line 2269, find:

$item['price_total'] = $GLOBALS['tax']->priceFormat(number_format($item['price'] * $item['quantity'], 2), true);


and change to this:


$item['price_total'] = $GLOBALS['tax']->priceFormat($item['price'] * $item['quantity']);




Then, in /classes/tax.class.php, near line 243, find:



$symbol    = ($this->_currency_vars['symbol_decimal']) ? ',' : '.';

return $this->_currency_vars['symbol_left'].number_format($this->priceCorrection($price), $this->_currency_vars['decimal_places'], $symbol, '').$this->_currency_vars['symbol_right'];



and replace with this:



$symbol_d = ($this->_currency_vars['symbol_decimal']) ? ',' : '.';$symbol_t = (!$this->_currency_vars['symbol_decimal']) ? ',' : '.';

return $this->_currency_vars['symbol_left'].number_format($this->priceCorrection($price), $this->_currency_vars['decimal_places'], $symbol_d, $symbol_t).$this->_currency_vars['symbol_right'];

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...