X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=gl%2Fgl_bank.php;h=b76e768e68bb672d0153d233238509c1b45b1516;hb=12e17bf9bcf8e8f56d72aeeb6dde817d1d921615;hp=b3f1c1b7766f0f5871371ecf47d4f817346734a7;hpb=45e45a854c40a7a2f9cc8f11e07a259c6923babd;p=fa-stable.git diff --git a/gl/gl_bank.php b/gl/gl_bank.php index b3f1c1b7..b76e768e 100644 --- a/gl/gl_bank.php +++ b/gl/gl_bank.php @@ -245,22 +245,8 @@ function handle_new_item() $_POST['dimension2_id'], $amount, $_POST['LineMemo']); line_start_focus(); } - -//----------------------------------------------------------------------------------------------- -$id = find_submit('Delete'); -if ($id != -1) - handle_delete_item($id); - -if (isset($_POST['AddItem'])) - handle_new_item(); - -if (isset($_POST['UpdateItem'])) - handle_update_item(); - -if (isset($_POST['CancelItemChanges'])) - line_start_focus(); - -if (isset($_POST['go'])) +/* +function display_quick_entries(&$cart) { if (!check_num('totamount', 0)) { @@ -269,7 +255,7 @@ if (isset($_POST['go'])) } elseif (!get_post('person_id')) { - if ($_SESSION['pay_items']->trans_type==systypes::bank_payment()) + if ($cart->trans_type==systypes::bank_payment()) display_error( _("No Quick Entries are defined for Payment.")); else display_error( _("No Quick Entries are defined for Deposit.")); @@ -279,7 +265,7 @@ if (isset($_POST['go'])) { $rate = 0; $totamount = input_num('totamount'); - $totamount = ($_SESSION['pay_items']->trans_type==systypes::bank_payment() ? 1:-1) * $totamount; + $totamount = ($cart->trans_type==systypes::bank_payment() ? 1:-1) * $totamount; $qe = get_quick_entry($_POST['person_id']); $qe_lines = get_quick_entry_lines($_POST['person_id']); while ($qe_line = db_fetch($qe_lines)) @@ -293,9 +279,9 @@ if (isset($_POST['go'])) $rate += $item['rate']; if ($rate != 0) $totamount = $totamount * 100 / ($rate + 100); - $_SESSION['pay_items']->clear_items(); + $cart->clear_items(); - $_SESSION['pay_items']->add_gl_item($qe_line['account'], $qe_line['dimension_id'], $qe_line['dimension2_id'], + $cart->add_gl_item($qe_line['account'], $qe_line['dimension_id'], $qe_line['dimension2_id'], $totamount, $qe['description']); $items = get_tax_group_items($tax_group); while ($item = db_fetch($items)) @@ -303,9 +289,9 @@ if (isset($_POST['go'])) if ($item['rate'] != 0) { $amount = $totamount * $item['rate'] / 100; - $code = ($_SESSION['pay_items']->trans_type==systypes::bank_payment() ? $item['purchasing_gl_code'] : + $code = ($cart->trans_type==systypes::bank_payment() ? $item['purchasing_gl_code'] : $item['sales_gl_code']); - $_SESSION['pay_items']->add_gl_item($code, 0, 0, $amount, $qe['description']); + $cart->add_gl_item($code, 0, 0, $amount, $qe['description']); } } } @@ -315,13 +301,31 @@ if (isset($_POST['go'])) $amount = $totamount * $qe_line['amount'] / 100; else $amount = $qe_line['amount']; - $_SESSION['pay_items']->add_gl_item($qe_line['account'], $qe_line['dimension_id'], $qe_line['dimension2_id'], + $cart->add_gl_item($qe_line['account'], $qe_line['dimension_id'], $qe_line['dimension2_id'], $amount, $qe['description']); } } line_start_focus(); } -} +} +*/ +//----------------------------------------------------------------------------------------------- +$id = find_submit('Delete'); +if ($id != -1) + handle_delete_item($id); + +if (isset($_POST['AddItem'])) + handle_new_item(); + +if (isset($_POST['UpdateItem'])) + handle_update_item(); + +if (isset($_POST['CancelItemChanges'])) + line_start_focus(); + +if (isset($_POST['go'])) + display_quick_entries($_SESSION['pay_items'], $_POST['person_id'], input_num('totamount'), + $_SESSION['pay_items']->trans_type==systypes::bank_payment()); //-----------------------------------------------------------------------------------------------