Added links to payments for invoices in customer/supplier allocation inquiry
[fa-stable.git] / purchasing / supplier_payment.php
index 477c30b41a7a83c526ec0c36d83589f54860d986..ed8f5a089a9c50302c9e7614358e2e68b31fe496 100644 (file)
@@ -58,6 +58,8 @@ if (isset($_POST['_DatePaid_changed'])) {
 }
 
 if (list_updated('supplier_id') || list_updated('bank_account')) {
+  $_SESSION['alloc']->read();
+  $_POST['memo_'] = $_POST['amount'] = '';
   $Ajax->activate('alloc_tbl');
 }
 //----------------------------------------------------------------------------------------
@@ -76,7 +78,7 @@ if (!isset($_POST['bank_account'])) { // first page call
                        $_POST['memo_'] = $inv['supp_reference'];
                        foreach($_SESSION['alloc']->allocs as $line => $trans) {
                                if ($trans->type == ST_SUPPINVOICE && $trans->type_no == $_GET['PInvoice']) {
-                                       $_POST['amount'] = 
+                                       $_POST['amount'] =
                                                $_SESSION['alloc']->amount = price_format($_SESSION['alloc']->allocs[$line]->amount);
                                        $_SESSION['alloc']->allocs[$line]->current_allocated =
                                                $_SESSION['alloc']->allocs[$line]->amount;
@@ -86,7 +88,6 @@ if (!isset($_POST['bank_account'])) { // first page call
                        unset($inv);
                } else
                        display_error(_("Invalid purchase invoice number."));
-
        }
 }
 if (isset($_GET['AddedID'])) {
@@ -302,7 +303,6 @@ start_form();
 
        if ($bank_currency == $supplier_currency) {
                div_start('alloc_tbl');
-               $_SESSION['alloc']->read();
                show_allocatable(false);
                div_end();
        }