Payment terms related functions moved to separate file, common function for calculati...
[fa-stable.git] / sales / includes / db / sales_order_db.inc
index 3296c5917c0e402e8b4cfc0e50948aa951d5faa0..7abe76217ad711556e905822c690619b234c7dd4 100644 (file)
@@ -383,27 +383,6 @@ function close_sales_order($order_no)
 
 //---------------------------------------------------------------------------------------------------------------
 
-function get_invoice_duedate($terms, $invdate)
-{
-       if (!is_date($invdate))
-       {
-               return new_doc_date();
-       }
-       
-       $myrow = get_payment_terms($terms);
-       
-       if (!$myrow)
-               return $invdate;
-
-       if ($myrow['type'] == PTT_FOLLOWING)
-               $duedate = add_days(end_month($invdate), $myrow['days']);
-       elseif ($myrow['type'] == PTT_DAYS)
-               $duedate = add_days($invdate, $myrow['days']);
-       else
-               $duedate = $invdate;
-       return $duedate;
-}
-
 function get_customer_to_order($customer_id) {
 
        // Now check to ensure this account is not on hold */
@@ -419,7 +398,6 @@ function get_customer_to_order($customer_id) {
                  cust.curr_code,
                  cust.discount,
                  cust.payment_terms,
-                 cust.pymt_discount,
                  cust.credit_limit - Sum(IFNULL(IF(trans.type IN(".implode(',', array(ST_CUSTCREDIT, ST_CUSTPAYMENT, ST_BANKDEPOSIT))."),
                        -1, 1) * (ov_amount + ov_gst + ov_freight + ov_freight_tax + ov_discount),0)) as cur_credit
                FROM ".TB_PREF."debtors_master cust