Allowing multiple jounal entries on one trans_no.
[fa-stable.git] / sales / customer_payments.php
index 7612a2b4b68cf66bb30bc3432644cdc6b431ec9b..78561a9104b91531ea7b07e52261f452b0ef66fc 100644 (file)
@@ -49,7 +49,8 @@ if (!isset($_POST['bank_account'])) { // first page call
        if (isset($_GET['SInvoice'])) {
                //  get date and supplier
                $type = !isset($_GET['Type']) ? ST_SALESINVOICE : $_GET['Type'];
-               $inv = get_customer_trans($_GET['SInvoice'], $type);
+               $cust = !isset($_GET['customer_id']) ? null : $_GET['customer_id'];
+               $inv = get_customer_trans($_GET['SInvoice'], $type,  $cust);
                $dflt_act = get_default_bank_account($inv['curr_code']);
                $_POST['bank_account'] = $dflt_act['id'];
                if ($inv) {