Jump to content
Evgeny

add link only on paid invoices

Recommended Posts

Hello,

We try to add link in template (six) ->clientareainvoices.tpl in foreach section.

{foreach key=num item=invoice from=$invoices}
                <tr onclick="clickableSafeRedirect(event, 'viewinvoice.php?id={$invoice.id}', false)">
                    <td>{$invoice.invoicenum}
                    <br><a href="/index.php?m=mymodule&id={$invoice.id}" target="_blank"><u>Contract</u></a>
                    </td>
                    <td><span class="hidden">{$invoice.normalisedDateCreated}</span>{$invoice.datecreated}</td>
                    <td><span class="hidden">{$invoice.normalisedDateDue}</span>{$invoice.datedue}</td>
                    <td data-order="{$invoice.totalnum}">{$invoice.total}</td>
                    <td><span class="label status status-{$invoice.statusClass}">{$invoice.status}</span></td>
                    <td class="responsive-edit-button" style="display: none;">
                        <a href="viewinvoice.php?id={$invoice.id}" class="btn btn-block btn-info">
                            {$LANG.invoicesview}
                        </a>
                    </td>
                </tr>
            {/foreach}

This line

<br><a href="/index.php?m=mymodule&id={$invoice.id}" target="_blank"><u>Contract</u></a>

And link have added in all invoices, but we want to show this link only in Paid invoices.  How it make, we try add if $status="Paid", but it doesn’t work, we do something wrong, help me how it should look. Thanks.

Share this post


Link to post
Share on other sites

if you were going to do it in the template, you could do something like the code below and that should only show a contract link for paid invoices...

    <table id="tableInvoicesList" class="table table-list hidden">
        <thead>
            <tr>
                <th>{$LANG.invoicestitle}</th>
                <th>{$LANG.invoicesdatecreated}</th>
                <th>{$LANG.invoicesdatedue}</th>
                <th>{$LANG.invoicestotal}</th>
                <th>{$LANG.invoicesstatus}</th>
                <th></th>
            </tr>
        </thead>
        <tbody>
            {foreach key=num item=invoice from=$invoices}
                <tr onclick="clickableSafeRedirect(event, 'viewinvoice.php?id={$invoice.id}', false)">
                    <td>{$invoice.invoicenum}</td>
                    <td><span class="hidden">{$invoice.normalisedDateCreated}</span>{$invoice.datecreated}</td>
                    <td><span class="hidden">{$invoice.normalisedDateDue}</span>{$invoice.datedue}</td>
                    <td data-order="{$invoice.totalnum}">{$invoice.total}</td>
                    <td><span class="label status status-{$invoice.statusClass}">{$invoice.status}</span></td>
                    <td class="text-center">{if $invoice.rawstatus eq 'paid'}<a href="index.php?m=mymodule&id={$invoice.id}" target="_blank"><u>Contract</u></a>{/if}</td>
                </tr>
            {/foreach}
        </tbody>
    </table>

ZAulnNy.png

Share this post


Link to post
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