2 /**********************************************************************
3 Copyright (C) FrontAccounting, LLC.
4 Released under the terms of the GNU General Public License, GPL,
5 as published by the Free Software Foundation, either version 3
6 of the License, or (at your option) any later version.
7 This program is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
11 ***********************************************************************/
12 include_once($path_to_root . "/includes/date_functions.inc");
14 include_once($path_to_root . "/includes/ui.inc");
15 include_once($path_to_root . "/includes/banking.inc");
17 //----------------------------------------------------------------------------
18 // helper functions for script execution control
20 function processing_start()
23 $_SESSION['Processing'] = $_SERVER['PHP_SELF'];
26 function processing_end()
28 unset($_SESSION['Processing']);
29 if ( isset($_SESSION['Items']) ) {
30 unset($_SESSION['Items']->line_items);
31 unset($_SESSION['Items']);
35 function processing_active()
37 return (isset($_SESSION['Processing']) && $_SESSION['Processing']==$_SERVER['PHP_SELF']);
40 Check if the cart was not destroyed during opening the edition page in
43 function check_edit_conflicts($cartname='Items')
47 if (isset($_POST['cart_id']) && $_POST['cart_id'] != $_SESSION[$cartname]->cart_id) {
48 display_error(_('This edit session has been abandoned by opening sales document in another browser tab. You cannot edit more than one sales document at once.'));
49 $Ajax->activate('_page_body');
50 display_footer_exit();