Vlrsnup according to Apmuthu's list.
[fa-stable.git] / sales / customer_payments.php
index 3b44bc67e8613ee7bb906ae6eed66ff6da497777..956023bbcf14933bb17609686ca63dc1a1b651f6 100644 (file)
@@ -21,10 +21,10 @@ include_once($path_to_root . "/sales/includes/sales_db.inc");
 include_once($path_to_root . "/reporting/includes/reporting.inc");
 
 $js = "";
-if ($use_popup_windows) {
+if ($SysPrefs->use_popup_windows) {
        $js .= get_js_open_window(900, 500);
 }
-if ($use_date_picker) {
+if (user_use_date_picker()) {
        $js .= get_js_date_picker();
 }
 add_js_file('payalloc.js');
@@ -54,6 +54,7 @@ if (!isset($_POST['bank_account'])) { // first page call
                if($inv) {
                        $_SESSION['alloc']->person_id = $_POST['customer_id'] = $inv['debtor_no'];
                        $_SESSION['alloc']->read();
+                       $_POST['BranchID'] = $inv['branch_code'];
                        $_POST['DateBanked'] = sql2date($inv['tran_date']);
                        foreach($_SESSION['alloc']->allocs as $line => $trans) {
                                if ($trans->type == ST_SALESINVOICE && $trans->type_no == $_GET['SInvoice']) {
@@ -411,4 +412,3 @@ start_form();
 
 end_form();
 end_page();
-?>