Fixed transaction date check messages.
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Wed, 26 Jan 2011 13:01:36 +0000 (13:01 +0000)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Wed, 26 Jan 2011 13:01:36 +0000 (13:01 +0000)
17 files changed:
gl/accruals.php
gl/bank_transfer.php
gl/gl_bank.php
gl/gl_journal.php
gl/manage/revaluate_currencies.php
inventory/adjustments.php
inventory/transfers.php
purchasing/supplier_credit.php
purchasing/supplier_payment.php
sales/create_recurrent_invoices.php
sales/credit_note_entry.php
sales/customer_credit_invoice.php
sales/customer_delivery.php
sales/customer_invoice.php
sales/customer_payments.php
sales/inquiry/customer_inquiry.php
sales/sales_order_entry.php

index 091458c90fa28cc580ac87151e3679e9cabe4226..2b75c60e8a6c921ab2d958b94c6c5d89f3d4b831 100644 (file)
@@ -35,7 +35,7 @@ if (isset($_POST['go']) || isset($_POST['show']))
        }
        elseif (!is_date_in_fiscalyear($_POST['date_']))
        {
-               display_error(_("The entered date is not in fiscal year."));
+               display_error(_("The entered date is out of fiscal year or is closed for further data entry."));
                set_focus('date_');
                $input_error = 1;
        }
@@ -61,7 +61,7 @@ if (isset($_POST['go']) || isset($_POST['show']))
                        ($freq==3?add_months($date_,$per):add_months($date_,3*$per))));
                if (!is_date_in_fiscalyears($lastdate, false))
                {
-                       display_error(_("Some of the period dates are outside the fiscal year. Create a new fiscal year first!"));
+                       display_error(_("Some of the period dates are outside the fiscal year or are closed for further data entry. Create a new fiscal year first!"));
                        set_focus('date_');
                        $input_error = 1;
                }
index 351bfb5d51dd5cc6dd91a2a4b86f30de816282a3..482539f4c9605044a5f404abe1148f438ea71397 100644 (file)
@@ -111,7 +111,7 @@ function check_valid_entries()
        }
        if (!is_date_in_fiscalyear($_POST['DatePaid']))
        {
-               display_error(_("The entered date is not in fiscal year."));
+               display_error(_("The entered date is out of fiscal year or is closed for further data entry."));
                set_focus('DatePaid');
                return false;
        }
index 8dd950f1d703722641f2b50ce14ce4e130299603..d6efc5de66c743bd2d93fd3639f33047319aa210 100644 (file)
@@ -141,6 +141,7 @@ function create_cart($type, $trans_no)
                unset ($_SESSION['pay_items']);
        }
        
+       check_is_closed($type, $trans_no);
        $cart = new items_cart($type);
     $cart->order_id = $trans_no;
 
@@ -253,7 +254,7 @@ if (isset($_POST['Process']))
        }
        elseif (!is_date_in_fiscalyear($_POST['date_']))
        {
-               display_error(_("The entered date is not in fiscal year."));
+               display_error(_("The entered date is out of fiscal year or is closed for further data entry."));
                set_focus('date_');
                $input_error = 1;
        } 
index bc3e15e963286245665aec8bcee31404c28b80cf..bb744de690a12445aa7f9488c47e81c78f35b951 100644 (file)
@@ -97,6 +97,7 @@ function create_cart($type=0, $trans_no=0)
                unset ($_SESSION['journal_items']);
        }
 
+       check_is_closed($type, $trans_no);
        $cart = new items_cart($type);
     $cart->order_id = $trans_no;
 
@@ -157,7 +158,7 @@ if (isset($_POST['Process']))
        } 
        elseif (!is_date_in_fiscalyear($_POST['date_'])) 
        {
-               display_error(_("The entered date is not in fiscal year."));
+               display_error(_("The entered date is out of fiscal year or is closed for further data entry."));
                set_focus('date_');
                $input_error = 1;
        } 
index 78c5cbbbf8a65653adc0625dc718a94b960969c9..d0050d415aafbea03feaee1a69dad3fbd5452c84 100644 (file)
@@ -53,7 +53,7 @@ function check_data()
        }
        if (!is_date_in_fiscalyear($_POST['date']))
        {
-               display_error(_("The entered date is not in fiscal year."));
+               display_error(_("The entered date is out of fiscal year or is closed for further data entry."));
                set_focus('date');
                return false;
        }
index 205a3cb247c66bfae80b5a505e1e165b70e6446f..384dd30ce63bb4adc2e674a1f509b56b44a3420c 100644 (file)
@@ -111,7 +111,7 @@ function can_process()
        } 
        elseif (!is_date_in_fiscalyear($_POST['AdjDate'])) 
        {
-               display_error(_("The entered date is not in fiscal year."));
+               display_error(_("The entered date is out of fiscal year or is closed for further data entry."));
                set_focus('AdjDate');
                return false;
        } else {
index 26859e59a19c2b0939ddb698efeec2e98709ee5a..b4cc678e452c3a31b35f9a8fd9bd007bde1a0a4a 100644 (file)
@@ -108,7 +108,7 @@ if (isset($_POST['Process']))
        } 
        elseif (!is_date_in_fiscalyear($_POST['AdjDate'])) 
        {
-               display_error(_("The entered date is not in fiscal year."));
+               display_error(_("The entered date is out of fiscal year or is closed for further data entry."));
                set_focus('AdjDate');
                $input_error = 1;
        } 
index 4db923b90fae7426b623c508f4d5f0b3394f852f..dd3191571b4a14d1e804ab73bc9eab0c11eac21d 100644 (file)
@@ -173,7 +173,7 @@ function check_data()
        } 
        elseif (!is_date_in_fiscalyear($_SESSION['supp_trans']->tran_date)) 
        {
-               display_error(_("The entered date is not in fiscal year."));
+               display_error(_("The entered date is out of fiscal year or is closed for further data entry."));
                set_focus('tran_date');
                return false;
        }
index 5421ee401d426db3ce60862252aa81999c6a94df..7bafd736055368eb21506929efa22bfdfb49af3b 100644 (file)
@@ -182,7 +182,7 @@ function check_inputs()
        } 
        elseif (!is_date_in_fiscalyear($_POST['DatePaid'])) 
        {
-               display_error(_("The entered date is not in fiscal year."));
+               display_error(_("The entered date is out of fiscal year or is closed for further data entry."));
                set_focus('DatePaid');
                return false;
        }
index dcc9cffe44c4c11b3ab491cf18ac1707894b55ff..cfe424b494aa4bb606d6356f1f4a7571bcdb3d87 100644 (file)
@@ -89,7 +89,7 @@ if (isset($_GET['recurrent']))
                }
        }
        else
-               display_error(_("The entered date is not in fiscal year."));
+               display_error(_("The entered date is out of fiscal year or is closed for further data entry."));
 }
 
 $result = get_recurrent_invoices();
index 513fb25eb0f1fbe7b3354d22e6bf73fdd527602a..b80a66f3cf1947bf7ee70d2678db8b4f99602f39 100644 (file)
@@ -156,7 +156,7 @@ function can_process()
                set_focus('OrderDate');
                $input_error = 1;
        } elseif (!is_date_in_fiscalyear($_POST['OrderDate'])) {
-               display_error(_("The entered date is not in fiscal year."));
+               display_error(_("The entered date is out of fiscal year or is closed for further data entry."));
                set_focus('OrderDate');
                $input_error = 1;
        }
index 48f3f0d597ef6fd122f3a4a5e0e55451867f89f3..c46215389ae56f464bfe160dd5f60cf91cfae23f 100644 (file)
@@ -90,7 +90,7 @@ function can_process()
                set_focus('CreditDate');
                return false;
        } elseif (!is_date_in_fiscalyear($_POST['CreditDate'])) {
-               display_error(_("The entered date is not in fiscal year."));
+               display_error(_("The entered date is out of fiscal year or is closed for further data entry."));
                set_focus('CreditDate');
                return false;
        }
@@ -142,6 +142,7 @@ if (isset($_GET['InvoiceNumber']) && $_GET['InvoiceNumber'] > 0) {
 
 } elseif ( isset($_GET['ModifyCredit']) && $_GET['ModifyCredit']>0) {
 
+       check_is_closed(ST_CUSTCREDIT,$_GET['ModifyCredit']);
        $_SESSION['Items'] = new Cart(ST_CUSTCREDIT,$_GET['ModifyCredit']);
        copy_from_cart();
 
index ee19660c95aef179f922430fe509dfa8a4cac48b..2208a455c6b093539576f0c47c31560799c08288 100644 (file)
@@ -112,6 +112,7 @@ if (isset($_GET['OrderNumber']) && $_GET['OrderNumber'] > 0) {
 
 } elseif (isset($_GET['ModifyDelivery']) && $_GET['ModifyDelivery'] > 0) {
 
+       check_is_closed(ST_CUSTDELIVERY, $_GET['ModifyDelivery']);
        $_SESSION['Items'] = new Cart(ST_CUSTDELIVERY,$_GET['ModifyDelivery']);
 
        if ($_SESSION['Items']->count_items() == 0) {
@@ -159,7 +160,7 @@ function check_data()
        }
 
        if (!is_date_in_fiscalyear($_POST['DispatchDate'])) {
-               display_error(_("The entered date of delivery is not in fiscal year."));
+               display_error(_("The entered date is out of fiscal year or is closed for further data entry."));
                set_focus('DispatchDate');
                return false;
        }
index 560ea687c582334bba89c7bde5a0acb015346d4c..84d2673f62e5ca1e4113a300ce0ab2c9b8d9424f 100644 (file)
@@ -130,6 +130,8 @@ if ( (isset($_GET['DeliveryNumber']) && ($_GET['DeliveryNumber'] > 0) )
 
 } elseif (isset($_GET['ModifyInvoice']) && $_GET['ModifyInvoice'] > 0) {
 
+       check_is_closed(ST_SALESINVOICE, $_GET['ModifyInvoice']);
+
        if ( get_sales_parent_numbers(ST_SALESINVOICE, $_GET['ModifyInvoice']) == 0) { // 1.xx compatibility hack
                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
@@ -263,7 +265,7 @@ function check_data()
        }
 
        if (!is_date_in_fiscalyear($_POST['InvoiceDate'])) {
-               display_error(_("The entered invoice date is not in fiscal year."));
+               display_error(_("The entered date is out of fiscal year or is closed for further data entry."));
                set_focus('InvoiceDate');
                return false;
        }
index b67df99c774a1b3c06c22e2dd64faab2879c7ed9..1bf8e196fbb8651ec097eb839d7eba4dc8427292 100644 (file)
@@ -97,7 +97,7 @@ function can_process()
                set_focus('DateBanked');
                return false;
        } elseif (!is_date_in_fiscalyear($_POST['DateBanked'])) {
-               display_error(_("The entered date is not in fiscal year."));
+               display_error(_("The entered date is out of fiscal year or is closed for further data entry."));
                set_focus('DateBanked');
                return false;
        }
index 92c640d49a874ebde9c67a78e80537b4850da325..bcafeecc13c1b1d799a22271e3ca2db8c5ef2340 100644 (file)
@@ -161,7 +161,7 @@ function credit_link($row)
 
 function edit_link($row)
 {
-       $str = '';
+/*     $str = '';
 
        switch($row['type']) {
        case ST_SALESINVOICE:
@@ -182,9 +182,9 @@ function edit_link($row)
                        $str = "/sales/customer_delivery.php?ModifyDelivery=".$row['trans_no'];
                break;
        }
-       if ($str != "" && !is_closed_trans($row['type'], $row["trans_no"]))
-               return pager_link(_('Edit'), $str, ICON_EDIT);
-       return '';      
+       if ($str != '')
+*/             return edit_trans_link($row['type'], $row['trans_no'], $row['type']==ST_CUSTCREDIT && $row['order_']==0 ?
+                       "/sales/credit_note_entry.php?ModifyCredit=%d" : 0);
 }
 
 function prt_link($row)
index 08e8e7d6bd67b267c43ce204479f60f1bb627636..7b067dd59918d922be77ecfc3b1fc655884ff2b5 100644 (file)
@@ -87,6 +87,7 @@ if (isset($_GET['NewDelivery']) && is_numeric($_GET['NewDelivery'])) {
 }
 
 page($_SESSION['page_title'], false, false, "", $js);
+
 //-----------------------------------------------------------------------------
 
 if (list_updated('branch_id')) {
@@ -337,7 +338,7 @@ function can_process() {
                return false;
        }
        if ($_SESSION['Items']->trans_type!=ST_SALESORDER && $_SESSION['Items']->trans_type!=ST_SALESQUOTE && !is_date_in_fiscalyear($_POST['OrderDate'])) {
-               display_error(_("The entered date is not in fiscal year"));
+               display_error(_("The entered date is out of fiscal year or is closed for further data entry."));
                set_focus('OrderDate');
                return false;
        }
@@ -612,8 +613,9 @@ function create_cart($type, $trans_no)
                        $doc->line_items[$line_no]->qty_done = 0;
                }
                $_SESSION['Items'] = $doc;
-       } else
+       } else {
                $_SESSION['Items'] = new Cart($type, array($trans_no));
+       }
        copy_from_cart();
 }