Jump to content
anjali

Add download link for invoices

Recommended Posts

Hi everyone,

 

Is there any way to download invoices from client area? I would like to add a download link in the invoice listing page. Please help me to add this property.

 

Thanks

Share this post


Link to post
Share on other sites

do you want to change the exiting clickable links from the table to go to a pdf download instead of the screen invoice, or are you looking to add an extra column to the table and add a download link in each row?

Share this post


Link to post
Share on other sites

Hi brian!,

 

I just need to make an option to download the invoices from invoice listing page. I think extra column to the table and add a download link in each row will be a better option. Could you please help me in that?

 

Thanks

Share this post


Link to post
Share on other sites

Hi,

 

you could replace the final <div> block in clientareainvoices.tpl with the following...

 

<div class="table-container clearfix">
   <table id="tableInvoicesList" class="table table-list">
       <thead>
           <tr>
               <th>{$LANG.invoicesdownload}</th>
               <th>{$LANG.invoicestitle}</th>
               <th>{$LANG.invoicesdatecreated}</th>
               <th>{$LANG.invoicesdatedue}</th>
               <th>{$LANG.invoicestotal}</th>
               <th>{$LANG.invoicesstatus}</th>
               <th class="responsive-edit-button" style="display: none;"></th>
           </tr>
       </thead>
       <tbody>
           {foreach key=num item=invoice from=$invoices}
               <tr onclick="clickableSafeRedirect(event, 'viewinvoice.php?id={$invoice.id}', false)">
                   <td><a href="dl.php?type=i&id={$invoice.id}">{$LANG.quotedlpdfbtn}</a></td>
                   <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>{$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.manageproduct}
                       </a>
                   </td>
               </tr>
           {/foreach}
       </tbody>
   </table>
</div>

i've only added two lines - a column heading, which in English will say "Download"; and the download link itself, which will say "Download PDF" - both use existing language entries.

 

if you don't want to use text for the download links, then you could use a pdf logo instead - by changing the column heading to "PDF" and using the exiting pdf logo from the assets/img folder.

 

<div class="table-container clearfix">
   <table id="tableInvoicesList" class="table table-list">
       <thead>
           <tr>
               <th>PDF</th>
               <th>{$LANG.invoicestitle}</th>
               <th>{$LANG.invoicesdatecreated}</th>
               <th>{$LANG.invoicesdatedue}</th>
               <th>{$LANG.invoicestotal}</th>
               <th>{$LANG.invoicesstatus}</th>
               <th class="responsive-edit-button" style="display: none;"></th>
           </tr>
       </thead>
       <tbody>
           {foreach key=num item=invoice from=$invoices}
               <tr onclick="clickableSafeRedirect(event, 'viewinvoice.php?id={$invoice.id}', false)">
                   <td><a href="dl.php?type=i&id={$invoice.id}"><img src="{$BASE_PATH_IMG}/pdf.png" alt="{$LANG.quotedlpdfbtn}" /></a></td>
                   <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>{$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.manageproduct}
                       </a>
                   </td>
               </tr>
           {/foreach}
       </tbody>
   </table>
</div>

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