-
- if ($myrow["last_sent"] == '0000-00-00')
- {
- $last_sent = '';
- $due_date = $myrow["begin"];
- } else {
- $last_sent = sql2date($myrow["last_sent"]);
- if ($myrow['monthly'] > 0)
- $due_date = begin_month($last_sent);
- else
- $due_date = $last_sent;
- }
- $due_date = add_months($due_date, $myrow['monthly']);
+ $last_sent = calculate_from($myrow);
+ $due_date = add_months($last_sent, $myrow['monthly']);