Example #1
0
 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;
 }
Example #2
0
 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;
 }
Example #3
0
 public function errorCheck()
 {
     if ($this->amount - CoreLocal::get('amtdue') > 0 && CoreLocal::get('amtdue') > 0) {
         return DisplayLib::boxMsg(_('max tender is ') . CoreLocal::get('amtdue'), _('no change allowed'), false, DisplayLib::standardClearButton());
     }
     return true;
 }
Example #4
0
    function body_content()
    {
        $this->input_header();
        echo DisplayLib::printheaderb();
        ?>
        <div class="baseHeight">
            <div class="<?php 
        echo $this->color;
        ?>
 centeredDisplay">
            <img alt="key" src='<?php 
        echo $this->img;
        ?>
' />
            <p>
            <?php 
        echo $this->msg;
        ?>
            </p>
            </div>
        </div>
        <?php 
        Database::getsubtotals();
        echo "<div id=\"footer\">";
        echo DisplayLib::printfooter();
        echo "</div>";
    }
Example #5
0
 function check($str)
 {
     $this->ret = $this->default_json();
     if (substr($str, -2) == "SD") {
         $strl = substr($str, 0, strlen($str) - 2);
         if (!is_numeric($strl)) {
             return False;
         } elseif (CoreLocal::get("tenderTotal") != 0) {
             $this->ret['output'] = DisplayLib::boxMsg(_("discount not applicable after tender"), '', false, DisplayLib::standardClearButton());
         } elseif ($strl > 50) {
             $this->ret['output'] = DisplayLib::boxMsg(_("discount exceeds maximum"), '', false, DisplayLib::standardClearButton());
         } elseif ($strl <= 0) {
             $this->ret['output'] = DisplayLib::boxMsg(_("discount must be greater than zero"), '', false, DisplayLib::standardClearButton());
         } elseif ($strl <= 50 and $strl > 0) {
             $existingPD = CoreLocal::get("percentDiscount");
             $stackablePD = $strl;
             $equivalentPD = $existingPD + $stackablePD;
             //    sum discounts
             $this->ret = PrehLib::percentDiscount($equivalentPD, $this->ret);
         } else {
             return false;
         }
         return true;
     }
     return false;
 }
Example #6
0
 function parse($str)
 {
     if ($str == "0ID") {
         // Member zero clears member info from the transaction
         PrehLib::clearMember();
         $ret = array("main_frame" => false, "output" => DisplayLib::lastpage(), "target" => ".baseHeight", "redraw_footer" => true);
         return $ret;
     } else {
         if (CoreLocal::get('RestrictDefaultNonMem') == 1 && $str == CoreLocal::get('defaultNonMem') . 'ID') {
             // PrehLib::ttl will automatically prompt for member if it
             // has not been entered; otherwise just total
             $ret = $this->default_json();
             $try = PrehLib::ttl();
             if ($try !== true) {
                 $ret['main_frame'] = $try . '?idSearch=' . CoreLocal::get('defaultNonMem');
             } else {
                 $ret['output'] = DisplayLib::lastpage();
             }
             return $ret;
         } else {
             // always re-apply other member numbers
             $ret = PrehLib::memberID(substr($str, 0, strlen($str) - 2));
             return $ret;
         }
     }
 }
Example #7
0
 /**
   Check for errors
   @return True or an error message string
 */
 public function errorCheck()
 {
     $clearButton = array('OK [clear]' => 'parseWrapper(\'CL\');');
     if (CoreLocal::get("isMember") != 0 && $this->amount - CoreLocal::get("amtdue") - 0.005 > CoreLocal::get("dollarOver") && CoreLocal::get("cashOverLimit") == 1) {
         return DisplayLib::boxMsg(_("member check tender cannot exceed total purchase by over \$") . CoreLocal::get("dollarOver"), '', false, $clearButton);
     } elseif (CoreLocal::get("store") == "wfc" && CoreLocal::get("isMember") != 0 && $this->amount - CoreLocal::get("amtdue") - 0.005 > 0) {
         // This should really be a separate tender
         // module for store-specific behavior
         $db = Database::pDataConnect();
         $q = sprintf("SELECT card_no FROM custReceiptMessage\n                WHERE card_no=%d AND modifier_module='WfcEquityMessage'", CoreLocal::get('memberID'));
         $r = $db->query($q);
         if ($db->num_rows($r) > 0) {
             return DisplayLib::xboxMsg(_("member check tender cannot exceed total purchase if equity is owed"), $clearButton);
         }
         // multi use
         if (CoreLocal::get('standalone') == 0) {
             $chkQ = "select trans_num from dlog \n                    where trans_type='T' and trans_subtype in ('CA','CK') \n                    and card_no=" . (int) CoreLocal::get('memberID') . "\n                    group by trans_num \n                    having sum(case when trans_subtype='CK' then total else 0 end) < 0 \n                    and sum(Case when trans_subtype='CA' then total else 0 end) > 0";
             $db = Database::mDataConnect();
             $chkR = $db->query($chkQ);
             if ($db->num_rows($chkR) > 0) {
                 return DisplayLib::xboxMsg(_("already used check over benefit today"), $clearButton);
             }
         }
     } elseif (CoreLocal::get("isMember") == 0 && $this->amount - CoreLocal::get("amtdue") - 0.005 > 0) {
         $msg = _('Non-members may not write checks for more than the total purchase.');
         return DisplayLib::xboxMsg($msg, $clearButton);
     }
     return true;
 }
Example #8
0
 /**
   Check for errors
   @return True or an error message string
 */
 public function errorCheck()
 {
     if (MiscLib::truncate2(CoreLocal::get("amtdue")) < MiscLib::truncate2($this->amount)) {
         return DisplayLib::xboxMsg(_("tender cannot exceed purchase amount"), DisplayLib::standardClearButton());
     }
     return true;
 }
Example #9
0
 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);
     }
 }
Example #10
0
 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;
 }
Example #11
0
 function parse($str)
 {
     $curID = CoreLocal::get("currentid");
     $dbc = Database::tDataConnect();
     $query = "SELECT trans_type,tax,foodstamp FROM localtemptrans WHERE trans_id={$curID}";
     $res = $dbc->query($query);
     if ($dbc->num_rows($res) == 0) {
         return True;
     }
     // shouldn't ever happen
     $item = $dbc->fetch_row($res);
     $query = "SELECT MAX(id) FROM taxrates";
     $res = $dbc->query($query);
     $tax_cap = 0;
     if ($dbc->num_rows($res) > 0) {
         $taxID = $dbc->fetch_row($res);
         $max = $taxID[0];
         if (!empty($max)) {
             $tax_cap = $max;
         }
     }
     $dbc->query($query);
     $next_tax = $item['tax'] + 1;
     $next_fs = 0;
     if ($next_tax > $max) {
         $next_tax = 0;
         $next_fs = 1;
     }
     $query = "UPDATE localtemptrans \n            set tax={$next_tax},foodstamp={$next_fs} \n            WHERE trans_id={$curID}";
     $dbc->query($query);
     $ret = $this->default_json();
     $ret['output'] = DisplayLib::listItems(CoreLocal::get("currenttopid"), $curID);
     return $ret;
     // maintain item cursor position
 }
Example #12
0
 public function parse($str)
 {
     $ret = $this->default_json();
     if (CoreLocal::get('memberID') == '0') {
         $ret['output'] = DisplayLib::boxMsg(_("Apply member number first"), _('No member selected'), false, array_merge(array('Member Search [ID]' => 'parseWrapper(\'ID\');'), DisplayLib::standardClearButton()));
         return $ret;
     }
     if ($str == 'ACCESS') {
         if (CoreLocal::get('AccessQuickMenu') != '' && class_exists('QuickMenuLauncher')) {
             $qm = new QuickMenuLauncher();
             return $qm->parse('QM' . CoreLocal::get('AccessQuickMenu'));
         } else {
             $str = 'ACCESS0';
         }
     }
     if ($str !== 'ACCESS6' && CoreLocal::get('AccessSelection') === '') {
         CoreLocal::set('AccessSelection', $str);
         $ret['main_frame'] = MiscLib::baseURL() . 'gui-modules/adminlogin.php?class=AccessProgramParser';
         return $ret;
     } else {
         CoreLocal::set('AccessSelection', '');
     }
     $selection = substr($str, 6);
     TransRecord::addRecord(array('upc' => 'ACCESS', 'description' => 'ACCESS SIGNUP', 'quantity' => 1, 'ItemQtty' => 1, 'numflag' => $selection));
     $ret['output'] = DisplayLib::lastpage();
     $ret['receipt'] = 'accessSignupSlip';
     return $ret;
 }
Example #13
0
 function parse($str)
 {
     $lines = CoreLocal::get('screenLines');
     if (!$lines === '' || !is_numeric($lines)) {
         $lines = 11;
     }
     $ret = $this->default_json();
     if ($str == "U") {
         $ret["output"] = DisplayLib::listItems(CoreLocal::get("currenttopid"), $this->next_valid(CoreLocal::get("currentid"), True));
     } elseif ($str == "D") {
         $ret["output"] = DisplayLib::listItems(CoreLocal::get("currenttopid"), $this->next_valid(CoreLocal::get("currentid"), False));
     } else {
         $change = (int) substr($str, 1);
         $curID = CoreLocal::get("currenttopid");
         $newID = CoreLocal::get("currentid");
         if ($str[0] == "U") {
             $newID -= $change;
         } else {
             $newID += $change;
         }
         if ($newID == $curID || $newID == $curID + $lines) {
             $curID = $newID - 5;
         }
         if ($curID < 1) {
             $curID = 1;
         }
         $ret["output"] = DisplayLib::listItems($curID, $newID);
     }
     return $ret;
 }
Example #14
0
 /**
   React to missing item
   @param $upc [string] UPC value
   @param $json [keyed array] formatted return value
   @return [keyed array] formatted return value
   
   The $json parameter and return value have the
   same format as Parser since this module interacts
   with input parsing. 
 */
 public function handle($upc, $json)
 {
     $opts = array('upc' => $upc, 'description' => 'BADSCAN');
     TransRecord::add_log_record($opts);
     $json['output'] = DisplayLib::boxMsg(_('not a valid item'), _('UPC: ') . $upc, false, DisplayLib::standardClearButton());
     return $json;
 }
Example #15
0
 public function body_content()
 {
     echo $this->noinput_header();
     ?>
     <div class="baseHeight">
     <?php 
     if (CoreLocal::get("plainmsg") && strlen(CoreLocal::get("plainmsg")) > 0) {
         echo DisplayLib::printheaderb();
         echo "<div class=\"centerOffset\">";
         echo DisplayLib::plainmsg(CoreLocal::get("plainmsg"));
         echo "</div>";
     } else {
         // No input and no messages, so
         // list the items
         if (CoreLocal::get("End") == 1) {
             echo DisplayLib::printReceiptfooter(true);
         } else {
             echo DisplayLib::lastpage(true);
         }
     }
     echo "</div>";
     // end base height
     echo "<div id=\"footer\">";
     echo DisplayLib::printfooter(true);
     echo '</div>';
 }
Example #16
0
 function check($str)
 {
     $this->ret = $this->default_json();
     if (substr($str, -2) == "DA") {
         $strl = substr($str, 0, strlen($str) - 2);
         if (substr($str, 0, 2) == "VD") {
             $this->ret = PrehLib::percentDiscount(0, $this->ret);
         } elseif (!is_numeric($strl)) {
             return false;
         } elseif (CoreLocal::get("tenderTotal") != 0) {
             $this->ret['output'] = DisplayLib::boxMsg(_("discount not applicable after tender"), '', false, DisplayLib::standardClearButton());
         } elseif ($strl > 50) {
             $this->ret['output'] = DisplayLib::boxMsg(_("discount exceeds maximum"), '', false, DisplayLib::standardClearButton());
         } elseif ($strl <= 0) {
             $this->ret['output'] = DisplayLib::boxMsg(_("discount must be greater than zero"), '', false, DisplayLib::standardClearButton());
         } elseif ($strl <= 50 and $strl > 0) {
             $this->ret = PrehLib::percentDiscount($strl, $this->ret);
             $this->ret['redraw_footer'] = true;
         } else {
             return false;
         }
         return true;
     }
     return false;
 }
Example #17
0
 /**
   Check for errors
   @return True or an error message string
 */
 public function errorCheck()
 {
     if ($this->amount > CoreLocal::get("amtdue") + 0.005 && CoreLocal::get("amtdue") >= 0) {
         return DisplayLib::xboxMsg(_("tender cannot exceed purchase amount"), DisplayLib::standardClearButton());
     }
     return true;
 }
Example #18
0
 function body_content()
 {
     $this->input_header('onsubmit="lookupFormCallback();return false;"');
     echo '<div class="baseHeight">';
     $id = $_REQUEST['id'];
     $local = false;
     if (substr($id, 0, 2) == '_l') {
         $local = true;
         $id = substr($id, 2);
     }
     $mode = $_REQUEST['mode'];
     $msg = 'Looking up transaction';
     if ($mode == 'verify') {
         $msg = 'Verifying transaction';
     }
     echo DisplayLib::boxMsg($msg . '<br />Please wait', '', true);
     echo '</div>';
     // baseHeight
     printf('<input type="hidden" id="refNum" value="%s" />', $id);
     printf('<input type="hidden" id="local" value="%d" />', $local ? 1 : 0);
     printf('<input type="hidden" id="lookupMode" value="%s" />', $mode);
     echo "<div id=\"footer\">";
     echo DisplayLib::printfooter();
     echo "</div>\n";
     $this->add_onload_command('performLookup();');
 }
Example #19
0
 function parse($str)
 {
     $ret = $this->default_json();
     $ret['receipt'] = 'partial';
     $ret['output'] = DisplayLib::lastpage();
     return $ret;
 }
Example #20
0
 public function getFooter()
 {
     $ret = "<div id=\"footer\">" . DisplayLib::printfooter() . "</div>\n" . "</div>\n";
     ob_start();
     $this->scale_box();
     $ret .= ob_get_clean();
     return $ret;
 }
Example #21
0
    function body_content()
    {
        $this->input_header();
        echo '<div class="baseHeight">';
        echo DisplayLib::boxMsg('<b>Hello World!</b><br />
			Enter anything to continue');
        echo '</div>';
        $this->footer();
    }
Example #22
0
 /**
   Check for errors
   @return True or an error message string
 */
 public function errorCheck()
 {
     global $CORE_LOCAL;
     $this->conn = CoopCredLib::ccDataConnect();
     if ($this->conn === False) {
         return "Error: ccDataConnect() failed.";
     }
     $programOK = CoopCredLib::programOK($this->tender_code, $this->conn);
     if ($programOK !== True) {
         return DisplayLib::boxMsg("{$programOK}");
     }
     $subtotals = CoopCredLib::getCCredSubtotals($this->tender_code, $this->conn);
     if ($subtotals !== True) {
         return DisplayLib::boxMsg("{$subtotals}");
     }
     $pc = $CORE_LOCAL->get("CCredProgramCode");
     //$pc = $CORE_LOCAL->get("programCode");
     /* For Refunding the total without entering the exact amount
      *  i.e. with QA alone.
      */
     if ($this->amount == '' && $this->DefaultTotal() < 0) {
         $this->amount = $this->DefaultTotal();
     }
     /* No Available Balance.
      */
     if ($CORE_LOCAL->get("{$pc}availBal") < 0) {
         return DisplayLib::boxMsg(_("Member") . " #" . $CORE_LOCAL->get("memberID") . ' ' . _("does not have enough Coop Cred in ") . '<b>' . $CORE_LOCAL->get("{$pc}programName") . '</b>' . _(" to cover this purchase."));
     }
     /* Tender more than Available Balance
      * the amount remaining less the amount of this type already tendered
      * in the current transaction.
      * I think availBal already includes memChargeTotal.
      */
     if (abs($CORE_LOCAL->get("{$pc}memChargeTotal")) + $this->amount >= $CORE_LOCAL->get("{$pc}availBal") + 0.005) {
         $memChargeCommitted = $CORE_LOCAL->get("{$pc}availBal") + $CORE_LOCAL->get("{$pc}memChargeTotal");
         return DisplayLib::xboxMsg(_("The amount of Coop Cred you have in ") . '<b>' . $CORE_LOCAL->get("{$pc}programName") . '</b>' . _(" is only \$") . number_format($memChargeCommitted, 2) . '.');
     }
     /* Tender more than Amount Due.
      */
     if (MiscLib::truncate2($CORE_LOCAL->get("amtdue")) < MiscLib::truncate2($this->amount)) {
         return DisplayLib::xboxMsg(_("The amount of Coop Cred tendered may not exceed the Amount Due."));
     }
     /* Add the tender to those used in this transaction.
      */
     if ($CORE_LOCAL->get('CCredTendersUsed') == '') {
         $CORE_LOCAL->set('CCredTendersUsed', array("{$this->tender_code}" => $CORE_LOCAL->get("CCredProgramID")));
     } else {
         $tu = $CORE_LOCAL->get('CCredTendersUsed');
         if (!array_key_exists("{$this->tender_code}", $tu)) {
             $tu["{$this->tender_code}"] = $CORE_LOCAL->get("CCredProgramID");
             $CORE_LOCAL->set('CCredTendersUsed', $tu);
         }
     }
     return true;
     // errorCheck()
 }
Example #23
0
 function parse($str)
 {
     $ret = $this->default_json();
     PrehLib::chargeOk();
     $memChargeCommitted = CoreLocal::get("availBal") - CoreLocal::get("memChargeTotal");
     $title = _('Member #') . CoreLocal::get('memberID');
     $msg = _("Current AR balance is ") . CoreLocal::get("balance") . "<br />" . _("Available AR balance is ") . CoreLocal::get("availBal");
     $ret['output'] = DisplayLib::boxMsg($msg, $title, true, array_merge(array('Tender [Store Credit]' => 'parseWrapper(\'MI\');'), DisplayLib::standardClearButton()));
     return $ret;
 }
Example #24
0
 private function overlayKeys($number)
 {
     $db = Database::pDataConnect();
     $my_keys = array();
     if ($db->table_exists('QuickLookups')) {
         $prep = $db->prepare('
             SELECT label,
                 action
             FROM QuickLookups
             WHERE lookupSet = ?
             ORDER BY sequence');
         $res = $db->execute($prep, array($number));
         while ($row = $db->fetch_row($res)) {
             $my_keys[] = new quickkey($row['label'], $row['action']);
         }
     }
     if (count($my_keys) == 0) {
         include dirname(__FILE__) . '/quickkeys/keys/' . $number . '.php';
     }
     if (count($my_keys) == 0) {
         return DisplayLib::boxMsg('Menu not found', '', false, DisplayLib::standardClearButton());
     }
     $clearButton = false;
     $ret = '';
     for ($i = 0; $i < count($my_keys); $i++) {
         if ($i % 3 == 0) {
             if ($i != 0) {
                 $ret .= ' </div>';
             }
             $ret .= '<div class="qkRow">';
         }
         $ret .= sprintf('
             <div class="qkBox">
                 <div id="qkDiv%d">
                     <button type="button" class="quick_button pos-button coloredBorder"
                         onclick="$(\'#reginput\').val($(\'#reginput\').val()+\'%s\');submitWrapper();">
                     %s
                     </button>
                 </div>
             </div>', $i, $my_keys[$i]->output_text, $my_keys[$i]->title);
     }
     if (!$clearButton) {
         $ret .= '<div class="qkBox">
             <div>
                 <button type="button" class="quick_button pos-button errorColoredArea"
                     onclick="$(\'#reginput\').val(\'CL\');submitWrapper();">
                     Clear <span class="smaller">[clear]</span>
                 </button>
             </div>
             </div>';
     }
     $ret .= '</div>';
     return $ret;
 }
Example #25
0
 /**
   Check for errors
   @return True or an error message string
 */
 public function errorCheck()
 {
     if (CoreLocal::get("fntlflag") == 0) {
         return DisplayLib::boxMsg(_("eligible amount must be totaled before foodstamp tender can be accepted"), '', false, array('Total [FS Total]' => 'parseWrapper(\'FNTL\');$(\'#reginput\').focus();', 'Dimiss [clear]' => 'parseWrapper(\'CL\');'));
     } elseif ($this->amount !== false && $this->amount > 0 && $this->amount > CoreLocal::get("fsEligible") + 0.005) {
         return DisplayLib::xboxMsg(_('Foodstamp tender cannot exceed eligible amount'), DisplayLib::standardClearButton());
     } elseif ($this->amount !== false && $this->amount <= 0 && $this->amount < CoreLocal::get("fsEligible") - 0.005) {
         return DisplayLib::xboxMsg(_('Foodstamp return cannot exceed eligible amount' . $info), DisplayLib::standardClearButton());
     }
     return true;
 }
Example #26
0
 function parse($str)
 {
     global $CORE_LOCAL;
     $return_value = $this->default_json();
     if ($CORE_LOCAL->get("LastID") != "0") {
         $return_value['output'] = DisplayLib::boxMsg("transaction in progress");
     } else {
         $return_value['main_frame'] = MiscLib::base_url() . 'gui-modules/HelloWorld.php';
     }
     return $return_value;
 }
Example #27
0
 function parse($str)
 {
     $ret = $this->default_json();
     if (CoreLocal::get("memberID") == 0) {
         $ret['output'] = DisplayLib::boxMsg(_("Apply member number first"), _('No member selected'), false, array_merge(array('Member Search [ID]' => 'parseWrapper(\'ID\');'), DisplayLib::standardClearButton()));
     } else {
         $plugin_info = new VirtualCoupon();
         $ret['main_frame'] = $plugin_info->pluginUrl() . '/VirtCoupDisplay.php';
     }
     return $ret;
 }
Example #28
0
 /**
   Check for errors
   @return True or an error message string
 */
 public function errorCheck()
 {
     $clearButton = array('OK [clear]' => 'parseWrapper(\'CL\');');
     if (CoreLocal::get("isMember") != 0 && $this->amount - CoreLocal::get("amtdue") - 0.005 > CoreLocal::get("dollarOver") && CoreLocal::get("cashOverLimit") == 1) {
         return DisplayLib::boxMsg(_("member check tender cannot exceed total purchase by over \$") . CoreLocal::get("dollarOver"), '', false, $clearButton);
     } else {
         if (CoreLocal::get("isMember") == 0 && $this->amount - CoreLocal::get("amtdue") - 0.005 > 0) {
             return DisplayLib::xboxMsg(_('non-member check tender cannot exceed total purchase'), $clearButton);
         }
     }
     return true;
 }
Example #29
0
 function parse($str)
 {
     $ret = $this->default_json();
     if (strlen($str) > 2) {
         $comment = substr($str, 2);
         TransRecord::addcomment($comment);
         $ret['output'] = DisplayLib::lastpage();
     } else {
         $ret['main_frame'] = MiscLib::base_url() . 'gui-modules/bigComment.php';
     }
     return $ret;
 }
Example #30
0
 function parse($str)
 {
     $ret = $this->default_json();
     if ($str == "cdInvalid") {
         $ret['output'] = DisplayLib::boxMsg(CoreLocal::get("casediscount") . _("% case discount invalid"), '', false, DisplayLib::standardClearButton());
     } elseif ($str == "cdStaffNA") {
         $ret['output'] = DisplayLib::boxMsg(_("case discount not applicable to staff"), '', false, DisplayLib::standardClearButton());
     } elseif ($str == "cdSSINA") {
         $ret['output'] = DisplayLib::boxMsg(_("hit 10% key to apply case discount for member") . " " . CoreLocal::get("memberID"), '', false, DisplayLib::standardClearButton());
     }
     return $ret;
 }