Jump to content

Help with invoice, € and Kč problem


Recommended Posts

Dear all,

 

I have been searching the internet and this forum for a solution and have not been unable to find a fix for an unusual problem that I have with the € and Kč currencies being displayed in the invoice.

 

I have updated my PDF.php and TOOLS.php files accordingly to get the Kč to display correctly instead of the letters KAT being displayed.

 

PDF.php code

 

static protected function convertSign($s)

{

$arr['before'] = array('€', '£', '¥');

$arr['after'] = array(chr(128), chr(163), chr(165));

$s = Tools::iconv('utf-8', self::encoding(), $s);

return str_replace($arr['before'], $arr['after'], $s);

}

 

TOOLS.code

 

}

if ($isNegative)

$ret = '-'.$ret;

if ($no_utf8)

return str_replace('€', chr(128), iconv('UTF-8','CP1250',$ret));

return $ret;

}

 

These are the two files and lines of code I had to update in order to show the Kč instead of KAT on my invoices, however, if a customer buys something in EURO (we also offer this currency) then in my EURO invoice the € is not displayed, I mean that where the € should be there is nothing, not even the ASCI code nothing.

 

However, if i remove a line of the code from PDF.php

 

{

$arr['before'] = array('€', '£', '¥');

$arr['after'] = array(chr(128), chr(163), chr(165));

$s = Tools::iconv('utf-8', self::encoding(), $s); << (if i remove this, Kč turns into KAT but euro works in my invoice!!)

return str_replace($arr['before'], $arr['after'], $s);

}

 

See attachment how my invoices look.

 

Please would any one have a fix for this so that the currencies display correctly on both invoices?

 

Thank you very much in advance

 

Pete

post-262920-0-24280200-1318570612_thumb.jpg

Link to comment
Share on other sites

I have this in my PrestaShop v1.4 files, but can helps:

 

PDF.php

 

static protected function convertSign($s)

{

$arr['before'] = array('€', 'L', 'Y');

$arr['after'] = array(chr(128), chr(163), chr(165));

return str_replace($arr['before'], $arr['after'], $s);

}

 

Tools.php

 

if ($isNegative)

$ret = '-'.$ret;

if ($no_utf8)

return str_replace('€', chr(128), iconv('UTF-8','CP1250',$ret));

 

Zdravím.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...