Jump to content

Filter unpaid invoices


Exxo

Recommended Posts

Hi,

i wanted to filter unpaid invoices for a custom view on my clientareahome.tpl

I tried the following code, but it won't show the unpaid ones. 

{foreach key=num item=invoice from=$invoices}
{if $invoice.status eq 'Unpaid'}
  ....
{/if}
{/foreach}

 

Link to comment
Share on other sites

1 hour ago, brian! said:

technically, it should be...


{if $invoice.statustext eq 'Unpaid'}

but I think the existing invoices array on the client homepage only contains unpaid invoices anyway.

Yes, got the same result there. 

With {debug} i got a version working:

{foreach key=num item=invoice from=$invoices}
  {if $invoice.rawstatus eq 'unpaid'}
  	...
  {/if}
{/foreach}

But since it's in the header.tpl it won't show invoices on every .tpl page.

So my question; How to i get the $invoices working in the header.tpl on other pages too?

Link to comment
Share on other sites

On 11/01/2021 at 14:14, Exxo said:

But since it's in the header.tpl it won't show invoices on every .tpl page.

do you want to show invoices on every page ???

On 11/01/2021 at 14:14, Exxo said:

So my question; How to i get the $invoices working in the header.tpl on other pages too?

are you actually wanting to show a list of invoices on every page in the client area in the header ?? I can understand a count (and you wouldn't need a hook for that), but a list ?!?

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