Jump to content

Invoicepdf.tpl variables change


Recommended Posts

Hi I am trying to apply this rule: 

<td class="total-row text-center">{($total|replace:'€':''|replace:'EUR':'' * 4.9)|string_format:"%.2f"} RON</td>

Ex: image.png.921f155975f937dbd9fae4346c62be4e.png

 

The thing is that that line is not working if I edit it this way:

foreach ($invoiceitems as $item) {
    $tblhtml .= '
    <tr bgcolor="#fff">
        <td align="left">' . nl2br($item['description']) . '<br /></td>
        <td align="center">' . $item['amount'] . '</td>
        <td align="center">{($total|replace:'€':''|replace:'EUR':'' * 4.9)|string_format:"%.2f"} RON</td>
    </tr>';
}

Any help would be much appreciated for this line, thanks!

Link to comment
Share on other sites

it's a price formatter variable, so you should be able to do this...

<td align="center">' . (number_format($total->toNumeric() * 4.9,2)) . ' RON</td>

the problem with your code is that you're trying to use Smarty rather than PHP.... in that template, don't think Smarty, think PHP (and if necessary TCPDF).

Edited by brian!
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