Merged changes from main CVS (up to 2.2.10)
[fa-stable.git] / sales / includes / db / cust_trans_db.inc
index ab560acefd2cf6e9105656d8a9b84a3573ce19fe..59115d8756083cfdc3e54cb8c7fc8b39881f60c9 100644 (file)
@@ -304,6 +304,20 @@ function get_related_documents($type, $trans_no)
 }
 //----------------------------------------------------------------------------------------
 
+function get_related_credits($inv_numbers)
+{
+       // FIXME -  credit notes retrieved here should be those linked to invoices containing 
+       // at least one line from this order
+       
+       $sql = "SELECT * FROM ".TB_PREF."debtor_trans WHERE type=".ST_CUSTCREDIT
+               ." AND trans_link IN(". implode(',', array_values($inv_numbers)).")";
+
+       $result = db_query($sql,"The related credit notes could not be retreived");
+
+}
+
+//----------------------------------------------------------------------------------------
+
 function get_customer_details_from_trans($type, $type_no)
 {
        $sql = "SELECT ".TB_PREF."debtors_master.name, ".TB_PREF."debtors_master.curr_code, ".TB_PREF."cust_branch.br_name