X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=gl%2Fbank_transfer.php;h=79195b5c99b6df06467232aa987338c6440c6314;hb=317210096efdbe5b375d5a0112d4f10a3c3c0b53;hp=a11352a6ebbca0370942f572425476588d8f54c5;hpb=0d191c7bff92b9a9bbc44dab48855477edb99ebf;p=fa-stable.git diff --git a/gl/bank_transfer.php b/gl/bank_transfer.php index a11352a6..79195b5c 100644 --- a/gl/bank_transfer.php +++ b/gl/bank_transfer.php @@ -21,7 +21,7 @@ include_once($path_to_root . "/gl/includes/gl_db.inc"); include_once($path_to_root . "/gl/includes/gl_ui.inc"); $js = ""; -if ($use_popup_windows) +if ($SysPrefs->use_popup_windows) $js .= get_js_open_window(800, 500); if (user_use_date_picker()) $js .= get_js_date_picker(); @@ -87,14 +87,13 @@ function gl_payment_controls($trans_no) $_POST['target_amount'] = price_format($to_trans['amount']); $_POST['amount'] = price_format(-$from_trans['amount']); } else { - $_POST['ref'] = $Refs->get_next(ST_BANKTRANSFER); + $_POST['ref'] = $Refs->get_next(ST_BANKTRANSFER, null, get_post('DatePaid')); $_POST['memo_'] = ''; $_POST['FromBankAccount'] = 0; $_POST['ToBankAccount'] = 0; $_POST['amount'] = 0; } } - $home_currency = get_company_currency(); start_form(); @@ -115,7 +114,8 @@ function gl_payment_controls($trans_no) } date_row(_("Transfer Date:"), 'DatePaid', '', true, 0, 0, 0, null, true); - ref_row(_("Reference:"), 'ref', '', $_POST['ref']); + ref_row(_("Reference:"), 'ref', '', $Refs->get_next(ST_BANKTRANSFER, null, get_post('DatePaid')), false, ST_BANKTRANSFER, + array('date' => get_post('DatePaid'))); table_section(2); @@ -232,15 +232,8 @@ function check_valid_entries($trans_no) set_focus('charge'); return false; } - if (!$Refs->is_valid($_POST['ref'])) - { - display_error(_("You must enter a reference.")); - set_focus('ref'); - return false; - } - if (! $trans_no && ! is_new_reference($_POST['ref'], ST_BANKTRANSFER)) { - display_error(_("The entered reference is already in use.")); + if (!check_reference($_POST['ref'], ST_BANKTRANSFER, $trans_no)) { set_focus('ref'); return false; }