Merged changes form main trunk (2.2.8, 2.2.9)
[fa-stable.git] / purchasing / supplier_payment.php
index 2ceac5f387d05bd036fd817f33dc531e0993d462..0d094ba346b5e49d0512ed05b905e1d33be4bf38 100644 (file)
@@ -17,7 +17,6 @@ include_once($path_to_root . "/includes/date_functions.inc");
 include_once($path_to_root . "/includes/ui.inc");
 include_once($path_to_root . "/includes/banking.inc");
 include_once($path_to_root . "/includes/data_checks.inc");
-//include_once($path_to_root . "/purchasing/includes/ui/supp_alloc_ui.inc");
 include_once($path_to_root . "/purchasing/includes/purchasing_db.inc");
 include_once($path_to_root . "/reporting/includes/reporting.inc");
 
@@ -114,6 +113,13 @@ function check_inputs()
 {
        global $Refs;
 
+       if (!get_post('supplier_id')) 
+       {
+               display_error(_("There is no supplier selected."));
+               set_focus('supplier_id');
+               return false;
+       } 
+       
        if ($_POST['amount'] == "") 
        {
                $_POST['amount'] = price_format(0);
@@ -160,7 +166,8 @@ function check_inputs()
                return false;
        }
 
-       if (input_num('amount') - input_num('discount') <= 0) 
+       //if (input_num('amount') - input_num('discount') <= 0) 
+       if (input_num('amount') <= 0) 
        {
                display_error(_("The total of the amount and the discount is zero or negative. Please enter positive values."));
                set_focus('amount');