Fixed warnings related to empty item/customer/supplier selector in search modes.
[fa-stable.git] / purchasing / includes / db / supp_trans_db.inc
index 7790798696ba0ab77b8a5491e1693bf8fd7fad89..aa9490afc707e048723376ab87c05c1704a1fff1 100644 (file)
@@ -131,7 +131,7 @@ function get_supp_payment_before($supplier_id, $date)
        . TB_PREF . "bank_trans,"
        . TB_PREF . "bank_accounts "
        . "WHERE "
-       . TB_PREF . "supp_trans.supplier_id=" . $supplier_id . " "
+       . TB_PREF . "supp_trans.supplier_id='" . $supplier_id . "' "
        . "AND " . TB_PREF . "supp_trans.tran_date<'" . $date . "' "
        . "AND " . TB_PREF . "supp_trans.type=" . ST_SUPPAYMENT . " "
        . "AND " . TB_PREF . "supp_trans.trans_no=" . TB_PREF . "bank_trans.trans_no "
@@ -258,6 +258,8 @@ function get_sql_for_supplier_inquiry($filter, $after_date, $to_date, $supplier_
        else {
                $sql .= " AND trans.tran_date >= '$date_after'
                        AND trans.tran_date <= '$date_to'";
+               $sql2 .= " AND trans.delivery_date >= '$date_after'
+            AND trans.delivery_date <= '$date_to'";
        }
 
        if ($supplier_id != ALL_TEXT) {