[0000225] Supplier Payment Report showing paid invoices (rounding problem)
[fa-stable.git] / purchasing / supplier_payment.php
index 0c8aa7dd4940c75979d984fafdf4f6ec9e786a93..265fe536ed01b64f5db599382ae2f0aa220e147c 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");
 
@@ -73,7 +72,7 @@ if (isset($_GET['AddedID']))
        submenu_print(_("&Print This Remittance"), ST_SUPPAYMENT, $payment_id."-".ST_SUPPAYMENT, 'prtopt');
        submenu_print(_("&Email This Remittance"), ST_SUPPAYMENT, $payment_id."-".ST_SUPPAYMENT, null, 1);
 
-    display_note(get_gl_view_str(22, $payment_id, _("View the GL &Journal Entries for this Payment")));
+    display_note(get_gl_view_str(ST_SUPPAYMENT, $payment_id, _("View the GL &Journal Entries for this Payment")));
 
 //    hyperlink_params($path_to_root . "/purchasing/allocations/supplier_allocate.php", _("&Allocate this Payment"), "trans_no=$payment_id&trans_type=22");
 
@@ -88,6 +87,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);
@@ -134,7 +140,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');