Form submit/escape hotkeys added.
[fa-stable.git] / sales / customer_invoice.php
index fed8094e05337bdd8035ac7f50f1ab9964569b31..6c43ef2273931246b1b5b5ff3a795411d59d96bd 100644 (file)
@@ -1,4 +1,14 @@
 <?php
+/**********************************************************************
+    Copyright (C) FrontAccounting, LLC.
+       Released under the terms of the GNU General Public License, GPL, 
+       as published by the Free Software Foundation, either version 3 
+       of the License, or (at your option) any later version.
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+    See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
+***********************************************************************/
 //---------------------------------------------------------------------------
 //
 //     Entry/Modify Sales Invoice against single delivery
@@ -118,7 +128,7 @@ if ( (isset($_GET['DeliveryNumber']) && ($_GET['DeliveryNumber'] > 0) )
 } elseif (isset($_GET['ModifyInvoice']) && $_GET['ModifyInvoice'] > 0) {
 
        if ( get_parent_trans(10, $_GET['ModifyInvoice']) == 0) { // 1.xx compatibility hack
-               echo"<center><br><b>" . _("There in no delivery notes for this invoice.<br>
+               echo"<center><br><b>" . _("There are no delivery notes for this invoice.<br>
                Most likely this invoice was created in Front Accounting version prior to 2.0
                and therefore can not be modified.") . "</b></center>";
                display_footer_exit();
@@ -324,7 +334,7 @@ $dspans[] = $spanlen;
 $is_batch_invoice = count($_SESSION['Items']->src_docs) > 1;
 
 $is_edition = $_SESSION['Items']->trans_type == 10 && $_SESSION['Items']->trans_no != 0;
-start_form(false, true);
+start_form();
 hidden('cart_id');
 
 start_table("$table_style2 width=80%", 5);
@@ -374,6 +384,15 @@ date_cells(_("Due Date"), 'due_date', '', $_POST['due_date'], 0, 0, 0, "class='t
 end_row();
 end_table();
 
+$row = get_customer_to_order($_SESSION['Items']->customer_id);
+if ($row['dissallow_invoices'] == 1)
+{
+       display_error(_("The selected customer account is currently on hold. Please contact the credit control personnel to discuss."));
+       end_form();
+       end_page();
+       exit();
+}      
+
 display_heading(_("Invoice Items"));
 
 div_start('Items');
@@ -493,7 +512,7 @@ end_table(1);
 submit_center_first('Update', _("Update"),
   _('Refresh document page'), true);
 submit_center_last('process_invoice', _("Process Invoice"),
-  _('Check entered data and save document'), true);
+  _('Check entered data and save document'), 'default');
 
 end_form();