function check($str) { // only check & warn once per transaction if (CoreLocal::get('cashDropWarned') == True) { return False; } // checking one time CoreLocal::set('cashDropWarned', True); // cannot check in standalone if (CoreLocal::get('standalone') == 1) { return False; } // lookup cashier total $db = Database::mDataConnect(); $q = sprintf("SELECT sum(-total) FROM dtransactions WHERE\n trans_subtype='CA' AND trans_status <> 'X' AND emp_no=%d", CoreLocal::get('CashierNo')); $r = $db->query($q); $ttl = 0; if ($db->num_rows($r) > 0) { $row = $db->fetch_row($r); $ttl = $row[0]; } if ($ttl > CoreLocal::get('cashDropThreshold')) { return True; } else { return False; } }
protected function ajax() { $decision = strtoupper(FormLib::get('input', 'CL')); $ret = array('dest_page' => MiscLib::base_url() . 'gui-modules/pos2.php', 'endorse' => false, 'cleared' => false); $repeat_cmd = CoreLocal::get('strEntered'); $requested_cmd = FormLib::get('cmd'); if (!empty($requested_cmd)) { $repeat_cmd = $requested_cmd; } if ($decision == "CL") { CoreLocal::set("msgrepeat", 0); CoreLocal::set("lastRepeat", ''); CoreLocal::set("toggletax", 0); CoreLocal::set("togglefoodstamp", 0); CoreLocal::set("RepeatAgain", false); $ret['cleared'] = true; } elseif (strlen($decision) > 0) { CoreLocal::set("msgrepeat", 1); CoreLocal::set("strRemembered", $repeat_cmd); } else { CoreLocal::set("msgrepeat", 1); CoreLocal::set("strRemembered", $repeat_cmd); } return $ret; }
function tender_out($asTender) { $ret = $this->default_json(); Database::getsubtotals(); if (CoreLocal::get("amtdue") <= 0.005) { CoreLocal::set("change", -1 * CoreLocal::get("amtdue")); $cash_return = CoreLocal::get("change"); if ($asTender != "FS") { TransRecord::addchange($cash_return, 'CA'); } CoreLocal::set("End", 1); $ret['output'] = DisplayLib::printReceiptFooter(); $ret['redraw_footer'] = true; $ret['receipt'] = 'full'; TransRecord::finalizeTransaction(); } else { CoreLocal::set("change", 0); CoreLocal::set("fntlflag", 0); $ttl_result = PrehLib::ttl(); TransRecord::debugLog('Tender Out (PrehLib): ' . print_r($ttl_result, true)); TransRecord::debugLog('Tender Out (amtdue): ' . print_r(CoreLocal::get('amtdue'), true)); $ret['output'] = DisplayLib::lastpage(); } return $ret; }
function preprocess() { $plugin_info = new QuickMenus(); $this->plugin_url = $plugin_info->pluginUrl() . '/'; $this->offset = isset($_REQUEST['offset']) ? $_REQUEST['offset'] : 0; if (count($_POST) > 0) { $output = ""; if ($_REQUEST["clear"] == 0) { $value = $_REQUEST['ddQKselect']; if ($value === '') { CoreLocal::set("msgrepeat", 0); CoreLocal::set("strRemembered", ''); } else { $output = CoreLocal::get("qmInput") . $value; CoreLocal::set("msgrepeat", 1); CoreLocal::set("strRemembered", $output); CoreLocal::set("currentid", CoreLocal::get("qmCurrentId")); } if (!FormLib::validateToken() && is_numeric($value)) { CoreLocal::set("msgrepeat", 0); } } if (substr(strtoupper($output), 0, 2) == "QM") { CoreLocal::set("qmNumber", substr($output, 2)); return True; } else { $this->change_page($this->page_url . "gui-modules/pos2.php"); } return False; } return True; }
/** Input processing function */ function preprocess() { // a selection was made if (isset($_REQUEST['search'])) { $entered = strtoupper($_REQUEST['search']); if ($entered == "" || $entered == "CL") { // should be empty string // javascript causes this input if the // user presses CL{enter} // Redirect to main screen CoreLocal::set("tenderTotal", "0"); $this->change_page($this->page_url . "gui-modules/pos2.php"); return False; } if (!empty($entered)) { // built department input string and set it // to be the next POS entry // Redirect to main screen $input = CoreLocal::get("tenderTotal") . "CQ" . $entered; CoreLocal::set("msgrepeat", 1); CoreLocal::set("strRemembered", $input); $this->change_page($this->page_url . "gui-modules/pos2.php"); return False; } } return True; }
/** Suspends the current transaction If the remote server is available, it will be suspended there. Otherwise it is suspended locally. @return [string] transaction identifier */ public static function suspendorder() { $query_a = "select emp_no, trans_no from localtemptrans"; $db_a = Database::tDataConnect(); $result_a = $db_a->query($query_a); $row_a = $db_a->fetch_array($result_a); $cashier_no = substr("000" . $row_a["emp_no"], -2); $trans_no = substr("0000" . $row_a["trans_no"], -4); $trans_num = ReceiptLib::receiptNumber(); if (CoreLocal::get("standalone") == 0) { $db_a->add_connection(CoreLocal::get("mServer"), CoreLocal::get("mDBMS"), CoreLocal::get("mDatabase"), CoreLocal::get("mUser"), CoreLocal::get("mPass"), false, true); $cols = Database::getMatchingColumns($db_a, "localtemptrans", "suspended"); $db_a->transfer(CoreLocal::get("tDatabase"), "select {$cols} from localtemptrans", CoreLocal::get("mDatabase"), "insert into suspended ({$cols})"); $db_a->close(CoreLocal::get("mDatabase"), True); } else { $query = "insert into suspended select * from localtemptrans"; $result = $db_a->query($query); } /* ensure the cancel happens */ $cancelR = $db_a->query("UPDATE localtemptrans SET trans_status='X',charflag='S'"); TransRecord::finalizeTransaction(true); CoreLocal::set("plainmsg", _("transaction suspended")); $recall_line = CoreLocal::get("standalone") . " " . CoreLocal::get("laneno") . " " . $cashier_no . " " . $trans_no; /** If the transaction is marked as complete but somehow did not actually finish, this will prevent the suspended receipt from adding tax/discount lines to the transaction */ CoreLocal::set('End', 0); return $trans_num; }
function preprocess() { if (isset($_REQUEST["selectlist"])) { /** generate XML based on menu choice **/ switch ($_REQUEST['selectlist']) { case 'KC': $this->xml = DatacapCaAdmin::keyChange(); $this->output = 'display'; break; case 'PD': $this->xml = DatacapCaAdmin::paramDownload(); $this->output = 'display'; break; case 'KR': $this->xml = DatacapCaAdmin::keyReport(); break; case 'SR': $this->xml = DatacapCaAdmin::statsReport(); break; case 'DR': $this->xml = DatacapCaAdmin::declineReport(); break; case 'PR': $this->xml = DatacapCaAdmin::paramReport(); break; case 'CL': default: $this->change_page('PaycardEmvMenu.php'); return false; } } elseif (isset($_REQUEST['xml-resp'])) { /** parse response XML and display a dialog box or print a receipt **/ $xml = $_REQUEST['xml-resp']; $output = $_REQUEST['output-method']; $resp = DatacapCaAdmin::parseResponse($xml); if ($output == 'display' || $resp['receipt'] === false) { CoreLocal::set('boxMsg', '<strong>' . $resp['status'] . '</strong><br />' . $resp['msg-text']); CoreLocal::set('strRemembered', ''); $this->change_page(MiscLib::baseURL() . 'gui-modules/boxMsg2.php'); return false; } else { $print_class = CoreLocal::get('ReceiptDriver'); if ($print_class === '' || !class_exists($print_class)) { $print_class = 'ESCPOSPrintHandler'; } $PRINT_OBJ = new $print_class(); $receipt_body = implode("\n", $resp['receipt']); $receipt_body .= "\n\n\n\n\n\n\n"; $receipt_body .= chr(27) . chr(105); if (session_id() != '') { session_write_close(); } $PRINT_OBJ->writeLine($receipt_body); $this->change_page($this->page_url . "gui-modules/pos2.php"); return false; } } return true; }
/** Set up state and redirect if needed @return True or a URL to redirect */ public function preReqCheck() { if ($this->tender_code == 'CC' && CoreLocal::get('store') == 'wfc') { CoreLocal::set('kickOverride', true); } return true; }
/** Input processing function */ function preprocess() { // a selection was made if (isset($_REQUEST['search'])) { $entered = strtoupper($_REQUEST['search']); if ($entered == "" || $entered == "CL") { // should be empty string // javascript causes this input if the // user presses CL{enter} // Redirect to main screen CoreLocal::set("departmentAmount", "0"); $this->change_page($this->page_url . "gui-modules/pos2.php"); return False; } if (is_numeric($entered)) { // built department input string and set it // to be the next POS entry // Redirect to main screen $input = CoreLocal::get("departmentAmount") . "DP" . $entered . "0"; $qty = CoreLocal::get("quantity"); if ($qty != "" & $qty != 1 & $qty != 0) { $input = $qty . "*" . $input; } CoreLocal::set("msgrepeat", 1); CoreLocal::set("strRemembered", $input); $this->change_page($this->page_url . "gui-modules/pos2.php"); return False; } } return True; }
function parse($str) { $ret = $this->default_json(); if ($str == "FNTL") { $ret['main_frame'] = MiscLib::base_url() . 'gui-modules/fsTotalConfirm.php'; } elseif ($str == "TETL") { $ret['main_frame'] = MiscLib::base_url() . 'gui-modules/requestInfo.php?class=Totals'; } elseif ($str == "FTTL") { PrehLib::finalttl(); } elseif ($str == "TL") { CoreLocal::set('End', 0); $chk = PrehLib::ttl(); if ($chk !== True) { $ret['main_frame'] = $chk; } } elseif ($str == "MTL") { $chk = PrehLib::omtr_ttl(); if ($chk !== True) { $ret['main_frame'] = $chk; } } elseif ($str == "WICTL") { $ttl = PrehLib::wicableTotal(); $ret['output'] = DisplayLib::boxMsg(_('WIC Total') . sprintf(': $%.2f', $ttl), '', true, DisplayLib::standardClearButton()); // return early since output has been set return $ret; } if (!$ret['main_frame']) { $ret['output'] = DisplayLib::lastpage(); $ret['redraw_footer'] = True; } return $ret; }
function preprocess() { if (isset($_REQUEST["selectlist"])) { $input = $_REQUEST["selectlist"]; if ($input == "CL") { CoreLocal::set("msgrepeat", 0); CoreLocal::set("strRemembered", ""); CoreLocal::set("refundComment", ""); } else { if ($input == "Other") { return True; } else { $input = str_replace("'", "", $input); CoreLocal::set("strRemembered", CoreLocal::get("refundComment")); // add comment calls additem(), which wipes // out refundComment; save it TransRecord::addcomment("PO: " . $input); CoreLocal::set("refundComment", CoreLocal::get("strRemembered")); CoreLocal::set("msgrepeat", 1); //CoreLocal::set("refund",1); } } $this->change_page($this->page_url . "gui-modules/pos2.php"); return False; } return True; }
function preprocess() { if (isset($_REQUEST["selectlist"])) { $parser = new PaycardDatacapParser(); switch ($_REQUEST['selectlist']) { case 'WICON': CoreLocal::set('WicMode', true); $this->change_page(MiscLib::baseURL() . 'gui-modules/pos2.php'); return false; case 'WICOFF': CoreLocal::set('WicMode', false); $this->change_page(MiscLib::baseURL() . 'gui-modules/pos2.php'); return false; case 'WICT': $plugin = new WicPlugin(); $this->change_page($plugin->pluginURL() . '/WicTenderPage.php'); return false; break; case 'CL': default: break; } $this->change_page(MiscLib::baseURL() . 'gui-modules/pos2.php'); return false; } return true; }
public function preprocess() { $this->upc = FormLib::get('upc'); if (FormLib::get('reginput', false) !== false) { $inp = FormLib::get('reginput'); if (strtoupper($inp) == 'CL') { $this->change_page(MiscLib::baseURL() . 'gui-modules/pos2.php'); return false; } $dbc = Database::pDataConnect(); $empP = $dbc->prepare(' SELECT emp_no FROM employees WHERE EmpActive=1 AND frontendsecurity >= ? AND (CashierPassword=? OR AdminPassword=?)'); if ($dbc->getValue($empP, array(30, $inp, $inp)) !== false) { CoreLocal::set('strRemembered', $this->upc); CoreLocal::set('msgrepeat', 1); $arr = CoreLocal::get('WicOverride'); if (!is_array($arr)) { $arr = array(); } $arr[] = ltrim($this->upc, '0'); CoreLocal::set('WicOverride', $arr); $this->change_page(MiscLib::baseURL() . 'gui-modules/pos2.php'); return false; } else { $this->box_color = 'errorColoredArea'; } } return true; }
protected function ajax() { CoreLocal::set("cabReference", $_REQUEST['input']); $receipt = ReceiptLib::printReceipt('cab', CoreLocal::get('cabReference')); ReceiptLib::writeLine($receipt); return 'Done'; }
function preprocess() { $me = CoreLocal::get('CashierNo'); $this->security = Authenticate::getPermission($me); if (isset($_REQUEST['selectlist'])) { if (!FormLib::validateToken()) { return false; } if (empty($_REQUEST['selectlist'])) { $this->change_page($this->page_url . "gui-modules/pos2.php"); return False; } elseif ($_REQUEST['selectlist'] == 'SUSPEND') { Database::getsubtotals(); if (CoreLocal::get("LastID") == 0) { CoreLocal::set("boxMsg", _("no transaction in progress")); CoreLocal::set('boxMsgButtons', array('Dismiss [clear]' => '$(\'#reginput\').val(\'CL\');submitWrapper();')); $this->change_page($this->page_url . "gui-modules/boxMsg2.php"); return False; } else { // ajax call to end transaction // and print receipt $ref = SuspendLib::suspendorder(); $this->add_onload_command("\$.ajax({\n type:'post',\n url:'{$this->page_url}ajax-callbacks/ajax-end.php',\n cache: false,\n data: 'receiptType=suspended&ref={$ref}',\n dataType: 'json',\n success: function(data){\n \$.ajax({\n type:'post',\n url:'{$this->page_url}ajax-callbacks/ajax-transaction-sync.php',\n cache: false,\n success: function(data){\n location='{$this->page_url}gui-modules/pos2.php';\n },\n error: function(e1){\n location='{$this->page_url}gui-modules/pos2.php';\n }\n });\n },\n error: function(e1){\n location='{$this->page_url}gui-modules/pos2.php';\n }\n });"); return True; } } else { if ($_REQUEST['selectlist'] == 'RESUME') { Database::getsubtotals(); if (CoreLocal::get("LastID") != 0) { CoreLocal::set("boxMsg", _("transaction in progress")); CoreLocal::set('boxMsgButtons', array('Dismiss [clear]' => '$(\'#reginput\').val(\'CL\');submitWrapper();')); $this->change_page($this->page_url . "gui-modules/boxMsg2.php"); } elseif (SuspendLib::checksuspended() == 0) { CoreLocal::set("boxMsg", _("no suspended transaction")); CoreLocal::set('boxMsgButtons', array('Dismiss [clear]' => '$(\'#reginput\').val(\'CL\');submitWrapper();')); CoreLocal::set("strRemembered", ""); $this->change_page($this->page_url . "gui-modules/boxMsg2.php"); } else { $this->change_page($this->page_url . "gui-modules/suspendedlist.php"); } return False; } else { if ($_REQUEST['selectlist'] == 'TR') { TenderReport::printReport(); $this->change_page($this->page_url . "gui-modules/pos2.php"); return False; } else { if ($_REQUEST['selectlist'] == 'OTR' && $this->security >= 30) { $this->change_page($this->page_url . 'gui-modules/requestInfo.php?class=AnyTenderReportRequest'); return False; } elseif ($_REQUEST['selectlist'] == 'UNDO' && $this->security >= 30) { $this->change_page($this->page_url . 'gui-modules/undo.php'); return false; } } } } } return True; }
function parse($str) { $json = $this->default_json(); $arg = $this->left; CoreLocal::set("sc", 1); $staffID = substr($arg, 0, 4); $pQuery = "select staffID,chargecode,blueLine from chargecodeview where chargecode = '" . $arg . "'"; $pConn = Database::pDataConnect(); $result = $pConn->query($pQuery); $num_rows = $pConn->num_rows($result); $row = $pConn->fetch_array($result); if ($num_rows == 0) { $json['output'] = DisplayLib::xboxMsg(_("unable to authenticate staff ") . $staffID, DisplayLib::standardClearButton()); CoreLocal::set("isStaff", 0); // apbw 03/05/05 SCR return $json; } else { CoreLocal::set("isStaff", 1); // apbw 03/05/05 SCR CoreLocal::set("memMsg", $row["blueLine"]); $tQuery = "update localtemptrans set card_no = '" . $staffID . "', percentDiscount = 15"; $tConn = Database::tDataConnect(); $this->addscDiscount(); TransRecord::discountnotify(15); $tConn->query($tQuery); Database::getsubtotals(); $chk = self::ttl(); if ($chk !== True) { $json['main_frame'] = $chk; return $json; } CoreLocal::set("runningTotal", CoreLocal::get("amtdue")); return self::tender("MI", CoreLocal::get("runningTotal") * 100); } }
public function handle($upc, $json) { $my_url = MiscLib::base_url(); switch (ltrim($upc, '0')) { case '8006': if (CoreLocal::get("memberID") == 0) { $json['main_frame'] = $my_url . 'gui-modules/memlist.php'; } else { if (CoreLocal::get("msgrepeat") == 0) { CoreLocal::set("boxMsg", "<B>" . $total . " stock payment</B><BR>insert form<BR>press [enter] to endorse<P><FONT size='-1'>[clear] to cancel</FONT>"); $ret["main_frame"] = $my_url . "gui-modules/boxMsg2.php?endorse=stock&endorseAmt=" . $total; } } break; case '8005': if (CoreLocal::get("memberID") == 0) { $json['main_frame'] = $my_url . 'gui-modules/memlist.php'; } elseif (CoreLocal::get("isMember") == 0) { $json['output'] = DisplayLib::boxMsg(_("member discount not applicable"), '', false, DisplayLib::standardClearButton()); } elseif (CoreLocal::get("percentDiscount") > 0) { $json['output'] = DisplayLib::boxMsg(CoreLocal::get("percentDiscount") . "% discount already applied", '', false, DisplayLib::standardClearButton()); } break; } // magic plu, but other conditions not matched if ($json['main_frame'] === false && empty($json['output'])) { $json['output'] = DisplayLib::boxMsg($upc . "<br />is not a valid item", '', false, DisplayLib::standardClearButton()); } return $json; }
function __construct() { if (CoreLocal::get('fntlflag') == 0 && CoreLocal::get('End') != 1) { CoreLocal::set("fntlflag", 1); Database::setglobalvalue("FntlFlag", 1); } }
function preprocess() { $this->my_drawer = ReceiptLib::currentDrawer(); $this->available = ReceiptLib::availableDrawers(); $this->is_admin = false; $db = Database::pDataConnect(); $sec = Authenticate::getPermission(CoreLocal::get('CashierNo')); if ($sec >= 30) { $this->is_admin = true; } if (isset($_REQUEST['selectlist'])) { if (empty($_REQUEST['selectlist'])) { if (empty($this->available) && !$this->is_admin && $this->my_drawer == 0) { // no drawer available and not admin // sign out and go back to main login screen Database::setglobalvalue("LoggedIn", 0); CoreLocal::set("LoggedIn", 0); CoreLocal::set("training", 0); CoreLocal::set("gui-scale", "no"); $this->change_page($this->page_url . "gui-modules/login2.php"); } else { $this->change_page($this->page_url . "gui-modules/pos2.php"); } return False; } if (substr($_REQUEST['selectlist'], 0, 2) == 'TO' && $this->is_admin) { // take over a drawer $new_drawer = substr($_REQUEST['selectlist'], 2); if ($this->my_drawer != 0) { // free up the current drawer if it exists ReceiptLib::drawerKick(); ReceiptLib::freeDrawer($this->my_drawer); } // switch to the requested drawer ReceiptLib::assignDrawer(CoreLocal::get('CashierNo'), $new_drawer); ReceiptLib::drawerKick(); $this->my_drawer = $new_drawer; } elseif (substr($_REQUEST['selectlist'], 0, 2) == 'SW') { // switch to available drawer $new_drawer = substr($_REQUEST['selectlist'], 2); foreach ($this->available as $id) { // verify the requested drawer is available if ($new_drawer == $id) { if ($this->my_drawer != 0) { // free up the current drawer if it exists ReceiptLib::drawerKick(); ReceiptLib::freeDrawer($this->my_drawer); } // switch to the requested drawer ReceiptLib::assignDrawer(CoreLocal::get('CashierNo'), $new_drawer); ReceiptLib::drawerKick(); $this->my_drawer = $new_drawer; break; } } } } return True; }
function preprocess() { if (isset($_REQUEST["selectlist"])) { CoreLocal::set("prefix", $_REQUEST["selectlist"]); $this->change_page($this->page_url . "gui-modules/pos2.php"); return False; } return True; }
public function handle($deptID, $amount, $json) { if (CoreLocal::get('msgrepeat') == 0) { CoreLocal::set("boxMsg", "<b>A/R Payment Sale</b><br>remember to retain you<br>\n reprinted receipt"); CoreLocal::set('boxMsgButtons', array('Confirm [enter]' => '$(\'#reginput\').val(\'\');submitWrapper();', 'Cancel [clear]' => '$(\'#reginput\').val(\'CL\');submitWrapper();')); $json['main_frame'] = MiscLib::base_url() . 'gui-modules/boxMsg2.php?quiet=1'; } return $json; }
function parse($str) { $ret = $this->default_json(); if ($str == 'PCLOOKUP') { $info = new Paycards(); $ret['main_frame'] = $info->pluginUrl() . '/gui/PaycardTransListPage.php'; CoreLocal::set('strEntered', ''); } return $ret; }
/** Store token in cache @return [boolean] true */ public static function setToken($token) { $tokens = \CoreLocal::get('crsfTokens'); if (!is_array($tokens)) { $tokens = array(); } $tokens[$token] = time(); \CoreLocal::set('crsfTokens', $tokens); return true; }
function parse($str) { $remainder = ""; $parts = explode('RF', $str, 2); foreach ($parts as $p) { $remainder .= $p; } CoreLocal::set("refund", 1); return $remainder; }
public function handle($deptID, $amount, $json) { if (CoreLocal::get('msgrepeat') == 0) { // invert has not happened yet CoreLocal::set('strEntered', 100 * $amount * -1 . 'DP' . $deptID); CoreLocal::set('msgrepeat', 1); $json['main_frame'] = MiscLib::base_url() . 'gui-modules/boxMsg2.php?autoconfirm=1'; } return $json; }
public static function adminLoginCallback($success) { if ($success) { CoreLocal::set('strRemembered', CoreLocal::get('strEntered')); CoreLocal::set('msgrepeat', 1); return true; } else { return false; } }
public static function adminLoginCallback($success) { if ($success) { CoreLocal::set('refundComment', CoreLocal::get('strEntered')); return MiscLib::base_url() . 'gui-modules/refundComment.php'; } else { CoreLocal::set('refundComment', ''); return false; } }
public static function adminLoginCallback($success) { if ($success) { CoreLocal::set('InactiveMemList', array()); return true; } else { CoreLocal::set('InactiveMemList', array()); PrehLib::clearMember(); return false; } }
function body_content() { ?> <div class="baseHeight"> <?php echo PaycardLib::paycard_msgBox(PaycardLib::PAYCARD_TYPE_GIFT, "Check Card Balance?", "If you proceed, you <b>cannot void</b> any previous action on this card!", "[enter] to continue<br>[clear] to cancel"); CoreLocal::set("msgrepeat", 2); ?> </div> <?php }
public function parse($str) { $my_url = MiscLib::base_url(); $split = explode("DP", $str); $dept = $split[1]; $amt = $split[0]; if (strstr($amt, '.')) { $amt = round($amt * 100); } $ret = $this->default_json(); /** This "if" is the new addition to trigger the department select screen */ if (empty($split[1])) { // no department specified, just amount followed by DP // maintain refund if needed if (CoreLocal::get("refund")) { $amt = "RF" . $amt; } // save entered amount CoreLocal::set("departmentAmount", $amt); // go to the department select screen $ret['main_frame'] = $my_url . 'gui-modules/deptlist.php'; } else { if (CoreLocal::get("refund") == 1 && CoreLocal::get("refundComment") == "") { if (CoreLocal::get("SecurityRefund") > 20) { $ret['main_frame'] = $my_url . "gui-modules/adminlogin.php?class=RefundAdminLogin"; } else { $ret['main_frame'] = $my_url . 'gui-modules/refundComment.php'; } CoreLocal::set("refundComment", CoreLocal::get("strEntered")); } } /* apply any appropriate special dept modules */ $deptmods = CoreLocal::get('SpecialDeptMap'); $db = Database::pDataConnect(); if (!is_array($deptmods) && $db->table_exists('SpecialDeptMap')) { $model = new \COREPOS\pos\lib\models\op\SpecialDeptMapModel($db); $deptmods = $model->buildMap(); CoreLocal::set('SpecialDeptMap', $deptmods); } $index = (int) ($dept / 10); if (is_array($deptmods) && isset($deptmods[$index])) { foreach ($deptmods[$index] as $mod) { $obj = new $mod(); $ret = $obj->handle($dept, $amt / 100, $ret); } } if (!$ret['main_frame']) { $ret = PrehLib::deptkey($amt, $dept, $ret); } return $ret; }