update_data(); } if (get_post('_reconcile_date_changed')) { $_POST['bank_date'] = check_date() ? date2sql(get_post('reconcile_date')) : ''; $Ajax->activate('bank_date'); update_data(); } $id = find_submit('_rec_'); if ($id != -1) { change_tpl_flag($id); } if (isset($_POST['Reconcile'])) { set_focus('bank_date'); foreach ($_POST['last'] as $id => $value) { if ($value != check_value('rec_' . $id)) { if (!change_tpl_flag($id)) { break; } } } $Ajax->activate('_page_body'); } //------------------------------------------------------------------------------------------------ start_form(); start_table(TABLESTYLE_NOBORDER); start_row(); bank_accounts_list_cells(_("Account:"), 'bank_account', null, true); bank_reconciliation_list_cells(_("Bank Statement:"), get_post('bank_account'), 'bank_date', null, true, _("New")); end_row(); end_table(); $result = get_max_reconciled(get_post('reconcile_date'), $_POST['bank_account']);
// function change_tpl_flag($id) { global $Ajax; $sql = "UPDATE " . TB_PREF . "sales_orders SET type = !type WHERE order_no={$id}"; db_query($sql, "Can't change sales order type"); $Ajax->activate('orders_tbl'); } $id = find_submit('_chgtpl'); if ($id != -1) { change_tpl_flag($id); } if (isset($_POST['Update']) && isset($_POST['last'])) { foreach ($_POST['last'] as $id => $value) { if ($value != check_value('chgtpl' . $id)) { change_tpl_flag($id); } } } $show_dates = !in_array($_POST['order_view_mode'], array('OutstandingOnly', 'InvoiceTemplates', 'DeliveryTemplates')); //--------------------------------------------------------------------------------------------- // Order range form // if (get_post('_OrderNumber_changed') || get_post('_OrderReference_changed')) { $disable = get_post('OrderNumber') !== '' || get_post('OrderReference') !== ''; if ($show_dates) { $Ajax->addDisable(true, 'OrdersAfterDate', $disable); $Ajax->addDisable(true, 'OrdersToDate', $disable); } $Ajax->activate('orders_tbl'); }