示例#1
0
 function parse($str)
 {
     $json = $this->default_json();
     CoreLocal::set("memberID", CoreLocal::get('defaultNonMem'));
     CoreLocal::set("memMsg", "End of Shift");
     TransRecord::addRecord(array('upc' => 'ENDOFSHIFT', 'description' => 'End of Shift', 'trans_type' => 'S'));
     Database::getsubtotals();
     $chk = self::ttl();
     if ($chk !== true) {
         $json['main_frame'] = $chk;
         return $json;
     }
     CoreLocal::set("runningtotal", CoreLocal::get("amtdue"));
     return PrehLib::tender("CA", CoreLocal::get("runningtotal") * 100);
 }
示例#2
0
 function parse($str)
 {
     $my_url = MiscLib::base_url();
     $split = explode("CQ", $str);
     $tender = $split[1];
     $amt = $split[0];
     $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
         // save entered amount
         CoreLocal::set("tenderTotal", $amt);
         // go to the department select screen
         $ret['main_frame'] = $my_url . 'gui-modules/checklist.php';
     }
     if (!$ret['main_frame']) {
         $ret = PrehLib::tender($split[1], $split[0]);
     }
     return $ret;
 }
示例#3
0
 function parse($str)
 {
     /**
       If customer card is available, prevent other tenders
       unless specficially allowed (e.g., coupons).
     */
     if (CoreLocal::get('PaycardsBlockTenders') == 1) {
         $tender_code = strtoupper(substr($str, -2));
         $exceptions = strtoupper(CoreLocal::get('PaycardsBlockExceptions'));
         $except_array = preg_split('/[^A-Z]+/', $exceptions, 0, PREG_SPLIT_NO_EMPTY);
         if (CoreLocal::get('ccTermState') == 'ready' && !in_array($tender_code, $except_array)) {
             CoreLocal::set('boxMsg', _('Tender customer card before other tenders'));
             CoreLocal::set('boxMsgButtons', array('Charge Card [enter]' => '$(\'#reginput\').val(\'\');submitWrapper();', 'Cancel [clear]' => '$(\'#reginput\').val(\'CL\');submitWrapper();'));
             CoreLocal::set('strEntered', 'CCFROMCACHE');
             $ret = $this->default_json();
             $ret['main_frame'] = MiscLib::baseURL() . 'gui-modules/boxMsg2.php';
             return $ret;
         }
     }
     if (strlen($str) > 2) {
         $left = substr($str, 0, strlen($str) - 2);
         $right = substr($str, -2);
         $ret = PrehLib::tender($right, $left);
         return $ret;
     } else {
         $ret = $this->default_json();
         $base_object = new TenderModule($str, False);
         $tender_object = 0;
         $map = CoreLocal::get("TenderMap");
         if (is_array($map) && isset($map[$str])) {
             $class = $map[$str];
             $tender_object = new $class($str, False);
         }
         $errors = $base_object->ErrorCheck();
         if ($errors !== True) {
             $ret['output'] = $errors;
             return $ret;
         }
         if (is_object($tender_object)) {
             $errors = $tender_object->ErrorCheck();
             if ($errors !== True) {
                 $ret['output'] = $errors;
                 return $ret;
             }
         }
         if (is_object($tender_object) && !$tender_object->AllowDefault()) {
             $ret['output'] = $tender_object->DisabledPrompt();
             return $ret;
         } elseif (is_object($tender_object) && $tender_object->AllowDefault()) {
             CoreLocal::set('RepeatAgain', true);
             $ret['main_frame'] = $tender_object->DefaultPrompt();
             return $ret;
         } else {
             if ($base_object->AllowDefault()) {
                 CoreLocal::set('RepeatAgain', true);
                 $ret['main_frame'] = $base_object->DefaultPrompt();
                 return $ret;
             } else {
                 $ret['output'] = $base_object->DisabledPrompt();
                 return $ret;
             }
         }
     }
 }