예제 #1
0
             }
             gen_redirect(html_href_link(FILENAME_DEFAULT, gen_get_all_get_params(array('action')), 'SSL'));
         }
         // *************** END TRANSACTION *************************
     } else {
         $messageStack->add(INV_ADJ_QTY_ZERO, 'error');
     }
     $error = $messageStack->add(GL_ERROR_NO_POST, 'error');
     $cInfo = new objectInfo($_POST);
     break;
 case 'delete':
     validate_security($security_level, 4);
     // security check
     if ($glEntry->id) {
         $delOrd = new journal();
         $delOrd->journal($glEntry->id);
         // load the posted record based on the id submitted
         // *************** START TRANSACTION *************************
         $db->transStart();
         if ($delOrd->unPost('delete')) {
             $db->transCommit();
             // if not successful rollback will already have been performed
             gen_add_audit_log(INV_LOG_ADJ . TEXT_DELETE, $delOrd->journal_rows[0]['sku'], $delOrd->journal_rows[0]['qty']);
             if (DEBUG) {
                 $messageStack->write_debug();
             }
             gen_redirect(html_href_link(FILENAME_DEFAULT, gen_get_all_get_params(array('action')), 'SSL'));
             break;
         }
     }
     $error = $messageStack->add(GL_ERROR_NO_DELETE, 'error');
예제 #2
0
     $messageStack->add(GL_ERROR_NO_POST, 'error');
     if (DEBUG) {
         $messageStack->write_debug();
     }
     $cInfo = new objectInfo($_POST);
     // if we are here, there was an error, reload page
     $cInfo->post_date = gen_db_date($_POST['post_date']);
     break;
 case 'delete':
     validate_security($security_level, 4);
     // check for errors and prepare extra values
     if (!$glEntry->id) {
         $error = true;
     } else {
         $delGL = new journal();
         $delGL->journal($glEntry->id);
         // load the posted record based on the id submitted
         $recur_id = db_prepare_input($_POST['recur_id']);
         $recur_frequency = db_prepare_input($_POST['recur_frequency']);
         // *************** START TRANSACTION *************************
         $db->transStart();
         if ($recur_id > 0) {
             // will contain recur_id
             $affected_ids = $delGL->get_recur_ids($recur_id, $delGL->id);
             for ($i = 0; $i < count($affected_ids); $i++) {
                 $delGL->id = $affected_ids[$i]['id'];
                 $delGL->journal($delGL->id);
                 // load the posted record based on the id submitted
                 if (!$delGL->unPost('delete')) {
                     $error = true;
                     break;