Cleanup in Customer Payments (fixed blinking error msg during processing payment)
authorJanusz Dobrowolski <janusz@frontaccouting.eu>
Tue, 19 Mar 2013 22:03:14 +0000 (23:03 +0100)
committerJanusz Dobrowolski <janusz@frontaccouting.eu>
Tue, 19 Mar 2013 22:03:14 +0000 (23:03 +0100)
sales/customer_payments.php

index d437c37336af53f67212975ea69ec7e1ba7dd5fc..d0a0ea8b04e0038429615fdd88c108e1af5f68b2 100644 (file)
@@ -252,6 +252,7 @@ if (get_post('AddPaymentItem') && can_process()) {
 
        new_doc_date($_POST['DateBanked']);
 
+       $new_pmt = !$_SESSION['alloc']->trans_no;
        //Chaitanya : 13-OCT-2011 - To support Edit feature
        $payment_no = write_customer_payment($_SESSION['alloc']->trans_no, $_POST['customer_id'], $_POST['BranchID'],
                $_POST['bank_account'], $_POST['DateBanked'], $_POST['ref'],
@@ -259,13 +260,11 @@ if (get_post('AddPaymentItem') && can_process()) {
 
        $_SESSION['alloc']->trans_no = $payment_no;
        $_SESSION['alloc']->write();
-       
-       unset($_POST);
-       unset($_SESSION);
 
+       unset($_SESSION['alloc']);
        //Chaitanya : 13-OCT-2011 - To support Edit feature
        //meta_forward($_SERVER['PHP_SELF'], "AddedID=$payment_no");
-       meta_forward($_SERVER['PHP_SELF'], !$_SESSION['alloc']->trans_no ? "AddedID=$payment_no" : "UpdatedID=$payment_no");
+       meta_forward($_SERVER['PHP_SELF'], $new_pmt ? "AddedID=$payment_no" : "UpdatedID=$payment_no");
 }
 
 //----------------------------------------------------------------------------------------------