get_first('ODS'); $ledger->id = ($ledger->id == -1) ? $first_ledger['jrn_def_id'] : $id; /* !\brief show a form for quick_writing */ $id = (isset($_REQUEST['p_jrn'])) ? $_REQUEST['p_jrn'] : -1; $def = -1; $ledger->with_concerned = true; if ($g_user->check_jrn($id) == 'X') { NoAccess(); exit - 1; } if (!isset($_POST['summary']) && !isset($_POST['save'])) { require('operation_ods_new.inc.php'); exit(); } elseif (isset($_POST['summary'])) { try { $ledger->verify($_POST); require_once 'operation_ods_confirm.inc.php'; } catch (Exception $e) { echo alert($e->getMessage()); require('operation_ods_new.inc.php'); } exit(); } elseif (isset($_POST['save'])) { $array = $_POST; try { $ledger->save($array); $jr_id = $cn->get_value('select jr_id from jrn where jr_internal=$1', array($ledger->internal)); echo '