$order = new objectInfo($_POST); $order->post_date = gen_db_date($_POST['post_date']); // fix the date to original format $order->id = $_POST['id'] != '' ? $_POST['id'] : ''; // will be null unless opening an existing purchase/receive } break; case 'delete': validate_security($security_level, 4); $id = $_POST['id'] != '' ? $_POST['id'] : ''; // will be null unless opening an existing purchase/receive if ($id) { $delOrd = new banking(); $delOrd->journal($id); // load the posted record based on the id submitted if ($delOrd->delete_payment()) { gen_add_audit_log(AUDIT_LOG_DEL_DESC, $order->purchase_invoice_id, $order->total_amount); if (DEBUG) { $messageStack->write_debug(); } gen_redirect(html_href_link(FILENAME_DEFAULT, gen_get_all_get_params(array('action')), 'SSL')); } } else { $messageStack->add(GL_ERROR_NEVER_POSTED, 'error'); } $messageStack->add(GL_ERROR_NO_DELETE, 'error'); // if we are here, there was an error, reload page $order = new objectInfo($_POST); $order->post_date = gen_db_date($_POST['post_date']); // fix the date to original format break;