Merged changes from main trunk up to 2.2.3
[fa-stable.git] / purchasing / supplier_payment.php
index d78ee47edb95a09d99fa0d1325bc8a29adb6cb62..0c8aa7dd4940c75979d984fafdf4f6ec9e786a93 100644 (file)
@@ -19,6 +19,7 @@ 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");
 
 $js = "";
 if ($use_popup_windows)
@@ -28,7 +29,7 @@ if ($use_date_picker)
 
 add_js_file('payalloc.js');
 
-page(_("Supplier Payment Entry"), false, false, "", $js);
+page(_($help_context = "Supplier Payment Entry"), false, false, "", $js);
 
 if (isset($_GET['supplier_id']))
 {
@@ -69,6 +70,9 @@ if (isset($_GET['AddedID']))
 
        display_notification_centered( _("Payment has been sucessfully entered"));
 
+       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")));
 
 //    hyperlink_params($path_to_root . "/purchasing/allocations/supplier_allocate.php", _("&Allocate this Payment"), "trans_no=$payment_id&trans_type=22");
@@ -164,7 +168,11 @@ function check_inputs()
        }
 
        $_SESSION['alloc']->amount = -input_num('amount');
-       return check_allocations();
+
+       if (isset($_POST["TotalNumberOfAllocs"]))
+               return check_allocations();
+       else
+               return true;
 }
 
 //----------------------------------------------------------------------------------------