Jump to content

if invoices are past due


jon-e2

Recommended Posts

Hello,

 

I am trying to create an element of our dashboard that displays only invoices that are past due.

 

Since the {$todaysdate} is a different format than {$invoices.datedue} I am using {$smarty.now|date_format:" %m/%d/%G"} which works great.

 

The way I am going about this is with the if rule. I want it to display the notice that there is a past due invoice IF{$invoices.datedue} is past {$smarty.now|date_format:" %m/%d/%G"}

 

First code i tried was:

 

{if $smarty.now|date_format:" %m/%d/%G" gte $invoice.datedue}
<div class="box-notice">
whoah dude you owe us some cash
</div>
{/if}

 

But then I noticed that it wouldn't know what invoice it to look at So I tried

 

{if $smarty.now|date_format:" %m/%d/%G" gte {foreach key=num item=invoice from=$invoices}$invoice.datedue{/foreach}}
<div class="box-notice">
whoah dude you owe us some cash 
</div>
{/if}

 

Which is causing some sort of issue loading the page now. SO i was wondering if you had any insight as to what I am doing wrong or how I need to change this code for it to work correctly.

 

Thanks.

Edited by jon-e2
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