I have two fields, that are both dates -
paydate and today (date_time)
There is also a fixed date, which is due date, say in this case 1 Jun 2014.
I have a calc field, penalty, which should calculate the penalty as follows -
a. If customer has still not paid, then paydate is blank.
In that case, I would like to calculate in days the difference between today and duedate, and calculate penalty based on that (different field)
b. if customer has paid, and paydate is after duedate, then I would like to calculate difference between paydate and duedate in days.
Can someone help with the phpcode that I would need for the calc element?
Thanks for any help.
paydate and today (date_time)
There is also a fixed date, which is due date, say in this case 1 Jun 2014.
I have a calc field, penalty, which should calculate the penalty as follows -
a. If customer has still not paid, then paydate is blank.
In that case, I would like to calculate in days the difference between today and duedate, and calculate penalty based on that (different field)
b. if customer has paid, and paydate is after duedate, then I would like to calculate difference between paydate and duedate in days.
Can someone help with the phpcode that I would need for the calc element?
Thanks for any help.