Example #1
0
     // make sure that both debit and credit are not set for one transaction
     if ($obj_gl->data["trans"][$i]["debit"] > 0 && $obj_gl->data["trans"][$i]["credit"] > 0) {
         $_SESSION["error"]["message"][] = "One transaction row can not have both credit and debit amounts";
         $_SESSION["error"]["trans_" . $i . "-error"] = 1;
     }
 }
 /*
 	Error Handling
 */
 // verify transaction exists (when editing an existing transaction)
 if ($obj_gl->id) {
     if (!$obj_gl->verify_id()) {
         log_write("error", "process", "The transaction you have attempted to edit - " . $obj_gl->id . " - does not exist in this system.");
     }
     // check if transaction is locked
     if ($obj_gl->check_lock()) {
         log_write("error", "process", "The transaction you have attempted to edit is locked and can not be modified.");
     }
 }
 // make sure we don't choose a transaction code number that is already in use
 if ($obj_gl->data["code_gl"]) {
     if (!$obj_gl->verify_code_gl()) {
         log_write("error", "process", "This transaction ID/code has already been used by another transaction - please enter a unique code or leave blank to recieve an automaticly assigned one.");
         $_SESSION["error"]["code_gl-error"] = 1;
     }
 }
 // verify transaction data
 if ($obj_gl->data["num_trans"]) {
     if (!$obj_gl->verify_valid_trans()) {
         // set returns
         $_SESSION["error"]["total_credit"] = $obj_gl->data["total_credit"];