PDA

View Full Version : if invoices are past due



jon-e2
02-03-10, 09:53 PM
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.