-
-//--------------------------------------------------------------------------------------------------
-function get_duedate_from_terms(&$trans)
-{
- $date = $trans->tran_date;
-
- if (!is_date($date))
- {
- $date = Today();
- }
- if ($trans->terms['type'] == PTT_FOLLOWING)
- { /*Its a day in the following month when due */
- $trans->due_date =
- add_days(end_month($date), $trans->terms["days"]);
- }
- else
- { /*Use the Days Before Due to add to the invoice date */
- $trans->due_date = add_days($date, $trans->terms["days"]);
- }
-}
-
-//--------------------------------------------------------------------------------------------------
-