jamilda Posted May 5, 2015 Share Posted May 5, 2015 Hello, I need to have in my PDF invoice instead of phone number eg.: '123456789', phone number with prefix eg.: 'tel: 123456789' I can't find solution. Please help me find code where it is possible to change it. Thanks Milan Link to comment Share on other sites More sharing options...
NemoPS Posted May 6, 2015 Share Posted May 6, 2015 Can you screen the spot you mention? It should be enough to modify the invoice tpl inside the /pdf/ folder, or the php of the class if you mean the address Link to comment Share on other sites More sharing options...
tuk66 Posted May 6, 2015 Share Posted May 6, 2015 Unfortunately, it is not so easy. You have to edit both /classes/pdf/HTMLTemplateInvoice.php and /pdf/invoice.tpl files and add also the phone number in addition to the formatted address. Link to comment Share on other sites More sharing options...
jamilda Posted May 6, 2015 Author Share Posted May 6, 2015 Can you screen the spot you mention? It should be enough to modify the invoice tpl inside the /pdf/ folder, or the php of the class if you mean the address This is example of my PDF Invoice address. Last two numbers are mobile phone and our national VAT number (IČO). These two numbers are very similar. I would like to distinguish these numbers with prefixes IČO: 723836xx tel: 7345080xx Link to comment Share on other sites More sharing options...
tuk66 Posted May 11, 2015 Share Posted May 11, 2015 Move the IČO (dni) just bellow the name. Both numbers have different length so the reader should be confused. 1 Link to comment Share on other sites More sharing options...
jamilda Posted May 14, 2015 Author Share Posted May 14, 2015 Thank you for your suggestions. There was neccessary to make these changes in classes/pdf/HTMLTemplateInvoice.php public function getContent() { $country = new Country((int)$this->order->id_address_invoice); $invoice_address = new Address((int)$this->order->id_address_invoice); $formatted_invoice_address = AddressFormat::generateAddress($invoice_address, array(), '<br />', ' '); $state_pos1 = strpos($formatted_invoice_address,"Czech Republic"); // find position of word "Czech Republic" in address $str_tel_ico = substr($formatted_invoice_address,$state_pos1 + 20); // 20 characters plus this position $str_tel_ico_mod = 'tel: ' . $str_tel_ico; //add to the beginning "tel: " $ICO_position = strpos($str_tel_ico_mod,"<br />"); // find position of word "<br />" if ($ICO_position > '0'){ $str_ico = substr($str_tel_ico_mod,$ICO_position + 6); // 6 characters plus this position $str_ico_mod = 'IČO: ' . $str_ico; //add to the beginning "IČO:" $str_tel_ico_mod = str_replace($str_ico,$str_ico_mod,$str_tel_ico_mod); } $formatted_invoice_address = str_replace($str_tel_ico,$str_tel_ico_mod,$formatted_invoice_address); $formatted_delivery_address = ''; 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