Jump to content

Change invoice text


DiegoM

Recommended Posts

Hey guys!

 

I'd like to change my invoice text in {$invoice_html_contents}, where "(10/01/2017 - 09/02/2017)" to "january" or "jan/2017". To be more specific, I want that in portuguese. :lol:

 

January = Janeiro

February = Fevereiro

March = Março

April = Abril

May = Maio

June = Junho

July = Julho

August = Agosto

October = Outubro

November = Novembro

December = Dezembro

 

Maybe can use invoice_date_due to calculate and obtain the month name too. But I don't know how to do it in WHMCS.

 

Can anyone give me some tips how to do it?

 

Thanks in advance!

Edited by DiegoM
Link to comment
Share on other sites

off the top of my head, I can think of two ways to do this...

 

1. if you were wanting to do this purely in the email template, then as they use Smarty, you'd need to replace the dates with your Portuguese month name... that may be using regex and/or PHP functions to strip/replace the unwanted text... though the added complication of trying to do that in an email template in v7 is that you'd have to tweak your Smarty Security Policy settings to allow you to use any required PHP function.

 

if going down this road, it would probably easier to use/edit the output of the {$invoice_items} looped array rather than {$invoice_html_contents}.

 

2. the other way would be to use an action hook to alter the invoice line description - this would have the knock-on effect on changing it on the html and PDF invoices too (you may or may not want that).

 

either method would require a lengthy explanation of how to do, so you should probably post in Service Offers & Requests and pay a developer to write a custom solution for you. :idea:

Link to comment
Share on other sites

Hey Brian! Thanks for your answer!

 

I think it's easier to remove this period of date from my {$invoice_html_contents} in invoice template.

 

Today my template is showing:

SERVICE (10/01/2017 - 09/02/2017) R$23,23

------------------------------------------------------

Sub Total: R$23,23

Credit: R$0,00

Total: R$23,23

------------------------------------------------------

 

How can I remove the underlined text? If I remove it and someone has more than one service, will it show everything together?

Link to comment
Share on other sites

if you just want to remove those dates from the invoice (much simpler!), you should just be able to use the following in the email template...

 

{$invoice_html_contents|regex_replace:'%[\t ()/0-9-]{26}%':''}

 

if you're using v7+, you'll need to add 'regex_replace' to your Smarty Security Policy to make this work - if using v6, you won't have to. :idea:

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated