X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=gl%2Fmanage%2Frevaluate_currencies.php;h=24241d21057a79e58abb8b13a482bca0c4a8c3c9;hb=0ce53780d575e7bf4eefaa1b7edc0603131cc2b3;hp=d0050d415aafbea03feaee1a69dad3fbd5452c84;hpb=7ce9ff6a73214a39ff495f04b330563212b43acb;p=fa-stable.git diff --git a/gl/manage/revaluate_currencies.php b/gl/manage/revaluate_currencies.php index d0050d41..24241d21 100644 --- a/gl/manage/revaluate_currencies.php +++ b/gl/manage/revaluate_currencies.php @@ -18,33 +18,28 @@ include_once($path_to_root . "/includes/ui.inc"); include_once($path_to_root . "/includes/banking.inc"); $js = ""; -if ($use_date_picker) +if (user_use_date_picker()) $js .= get_js_date_picker(); page(_($help_context = "Revaluation of Currency Accounts"), false, false, "", $js); -if (isset($_GET['AddedID'])) +if (isset($_GET['BA'])) { - $trans_no = $_GET['AddedID']; - $trans_type = ST_JOURNAL; + $BA = $_GET['BA']; + $JE = $_GET['JE']; - if ($trans_no == 0) - display_notification_centered( _("No Revaluation was needed")); - else + if ($BA != 0 || $JE !=0) { - display_notification_centered( _("Transfer has been entered")); - - display_note(get_gl_view_str($trans_type, $trans_no, _("&View the GL Journal Entries for this Transfer"))); + display_notification_centered(sprintf(_("%d Journal Entries for Bank Accounts have been added"), $BA)); + display_notification_centered(sprintf(_("%d Journal Entries for AR/AP accounts have been added"), $JE)); } - - //display_footer_exit(); + else + display_notification_centered( _("No revaluation was needed.")); } //--------------------------------------------------------------------------------------------- function check_data() { - global $Refs; - if (!is_date($_POST['date'])) { display_error( _("The entered date is invalid.")); @@ -57,19 +52,6 @@ function check_data() set_focus('date'); return false; } - if (!$Refs->is_valid($_POST['ref'])) - { - display_error(_("You must enter a reference.")); - set_focus('ref'); - return false; - } - - if (!is_new_reference($_POST['ref'], ST_JOURNAL)) - { - display_error(_("The entered reference is already in use.")); - set_focus('ref'); - return false; - } return true; } @@ -81,9 +63,9 @@ function handle_submit() if (!check_data()) return; - $trans_no = add_exchange_variation_all($_POST['date'], $_POST['ref'], $_POST['memo_']); + $trans = add_exchange_variation_all($_POST['date'], $_POST['memo_']); - meta_forward($_SERVER['PHP_SELF'], "AddedID=$trans_no"); + meta_forward($_SERVER['PHP_SELF'], "BA=".$trans[0]."&JE=".$trans[1]); //clear_data(); } @@ -92,14 +74,12 @@ function handle_submit() function display_reval() { - global $Refs; start_form(); start_table(TABLESTYLE2); if (!isset($_POST['date'])) $_POST['date'] = Today(); date_row(_("Date for Revaluation:"), 'date', '', null, 0, 0, 0, null, true); - ref_row(_("Reference:"), 'ref', '', $Refs->get_next(ST_JOURNAL)); textarea_row(_("Memo:"), 'memo_', null, 40,4); end_table(1); @@ -126,4 +106,3 @@ display_reval(); end_page(); -?>