PHP 8 rerun of number_format fix.
[fa-stable.git] / sales / sales_order_entry.php
index 362723d7845af2967281eac6e8a38790d721e0fe..6318b4fd216a597b9c22054df30402cd43912c48 100644 (file)
@@ -122,6 +122,7 @@ if (list_updated('branch_id')) {
 
 if (isset($_GET['AddedID'])) {
        $order_no = $_GET['AddedID'];
+
        display_notification_centered(sprintf( _("Order # %d has been entered."),$order_no));
 
        submenu_view(_("&View This Order"), ST_SALESORDER, $order_no);
@@ -137,6 +138,14 @@ if (isset($_GET['AddedID'])) {
 
        submenu_option(_("Enter a &New Order"), "/sales/sales_order_entry.php?NewOrder=0");
 
+       $order = get_sales_order_header($order_no, ST_SALESORDER);
+       $customer_id = $order['debtor_no'];     
+       if ($order['prep_amount'] > 0)
+       {
+               $row = db_fetch(db_query(get_allocatable_sales_orders($customer_id, $order_no, ST_SALESORDER)));
+               if ($row === false)
+                       submenu_option(_("Receive Customer Payment"), "/sales/customer_payments.php?customer_id=$customer_id");
+       }
        submenu_option(_("Add an Attachment"), "/admin/attachments.php?filterType=".ST_SALESORDER."&trans_no=$order_no");
 
        display_footer_exit();
@@ -264,7 +273,7 @@ function copy_to_cart()
 {
        $cart = &$_SESSION['Items'];
 
-       $cart->reference = $_POST['ref'];
+       $cart->reference = get_post('ref');
 
        $cart->Comments =  $_POST['Comments'];