public function showEditForm($upc, $display_mode = 1, $expand_mode = 1)
 {
     $upc = BarcodeLib::padUPC($upc);
     $ret = '<div id="3for1FieldSet" class="panel panel-default">';
     $ret .= "<div class=\"panel-heading\">\n                <a href=\"\" onclick=\"\$('#VolumeFieldsetContent').toggle();return false;\">\n               \"Three for a dollar\"\n                </a></div>";
     $css = $expand_mode == 1 ? '' : ' collapse';
     $ret .= '<div id="VolumeFieldsetContent" class="panel-body' . $css . '">';
     $dbc = $this->db();
     $model = new ProductsModel($dbc);
     $model->upc($upc);
     $model->load();
     $methods = array(0 => 'Disabled', 2 => 'Use this price for full sets', 1 => 'Always use this price');
     $ret .= "<table class=\"table table-bordered\"><tr>";
     $ret .= '<tr><th>Enabled</td>
         <th># Items' . \COREPOS\Fannie\API\lib\FannieHelp::ToolTip('# of items in a set') . '</th>
         <th>Price' . \COREPOS\Fannie\API\lib\FannieHelp::ToolTip('Price for the whole set') . '</th>
         <th>Mix/Match' . \COREPOS\Fannie\API\lib\FannieHelp::ToolTip('Items with the same Mix/Match all count') . '</th></tr>';
     $ret .= '<tr><td><select name="vp_method" class="form-control">';
     foreach ($methods as $value => $label) {
         $ret .= sprintf('<option value="%d"%s>%s</option>', $value, $value == $model->pricemethod() ? ' selected' : '', $label);
     }
     $ret .= '</select></td>';
     $ret .= '<td><input type="text" name="vp_qty" class="form-control" value="' . $model->quantity() . '" /></td>';
     $ret .= '<td>
         <div class="input-group">
         <span class="input-group-addon">$</span>
         <input type="text" name="vp_price" class="form-control" value="' . sprintf('%.2f', $model->groupprice()) . '" />
         </div>
         </td>';
     $ret .= '<td><input type="text" name="vp_mm" class="form-control" value="' . $model->mixmatchcode() . '" /></td>';
     $ret .= '</table></div></div>';
     return $ret;
 }
Exemple #2
0
 public function showEditForm($upc, $display_mode = 1, $expand_mode = 1)
 {
     $upc = BarcodeLib::padUPC($upc);
     $ret = '<div id="ExtraInfoFieldset" class="panel panel-default">';
     $ret .= "<div class=\"panel-heading\">\n                <a href=\"\" onclick=\"\$('#ExtraInfoFieldsetContent').toggle();return false;\">\n               Extra Info\n                </a></div>";
     $css = $expand_mode == 1 ? '' : ' collapse';
     $ret .= '<div id="ExtraInfoFieldsetContent" class="panel-body' . $css . '">';
     $info = array('cost' => 0.0, 'deposit' => 0, 'local' => 0, 'inUse' => 1, 'modified' => 'Unknown', 'idEnforced' => 0);
     $dbc = $this->db();
     $p = $dbc->prepare_statement('SELECT cost,deposit,local,inUse,modified,idEnforced FROM products WHERE upc=?');
     $r = $dbc->exec_statement($p, array($upc));
     if ($dbc->num_rows($r) > 0) {
         $info = $dbc->fetch_row($r);
     }
     $local_opts = array(0 => 'No');
     $origin = new OriginsModel($dbc);
     $local_opts = array_merge($local_opts, $origin->getLocalOrigins());
     if (count($local_opts) == 1) {
         $local_opts[1] = 'Yes';
         // generic local if no origins defined
     }
     $localSelect = '<select name="local" id="local-origin-id" class="form-control"
         onchange="$(\'#prod-local\').val(this.value);">';
     foreach ($local_opts as $id => $val) {
         $localSelect .= sprintf('<option value="%d" %s>%s</option>', $id, $id == $info['local'] ? 'selected' : '', $val);
     }
     $localSelect .= '</select>';
     $ageSelect = '<select name="idReq" id="idReq" class="form-control"
         onchange="$(\'#id-enforced\').val(this.value);">';
     $ages = array('n/a' => 0, 18 => 18, 21 => 21);
     foreach ($ages as $label => $age) {
         $ageSelect .= sprintf('<option %s value="%d">%s</option>', $age == $info['idEnforced'] ? 'selected' : '', $age, $label);
     }
     $ageSelect .= '</select>';
     $ret .= "<table class=\"table table-bordered\" width='100%'><tr>";
     $ret .= '<tr><th>Deposit' . \COREPOS\Fannie\API\lib\FannieHelp::ToolTip('PLU/UPC of linked deposit item') . '</th>
         <th>Age Req.</th>
         <th>Local</th>
         <th>In Use' . \COREPOS\Fannie\API\lib\FannieHelp::ToolTip('Uncheck to temporarily disable') . '</th></tr>';
     $ret .= sprintf('<tr>
             <td align="center"><input type="text" class="form-control" value="%d" name="deposit" 
                 id="deposit" onchange="$(\'#deposit-upc\').val(this.value);" /></td>
             <td align="center">%s</td>
             <td align="center">%s</td>
             <td align="center">
                 <input type="checkbox" id="extra-in-use-checkbox" name="inUse" value="1" %s 
                     onchange="$(\'#in-use-checkbox\').prop(\'checked\', $(this).prop(\'checked\'));" />
             </td></tr>', $info['deposit'], $ageSelect, $localSelect, $info['inUse'] == 1 ? 'checked' : '');
     $ret .= '</table>
             </div>
             </div>';
     return $ret;
 }
Exemple #3
0
    function body_content()
    {
        ob_start();
        ?>
        <ul>
        <li><a href="OverShortDayPage.php" target="_WholeByCashier">Whole Day O/S</a>
            <?php 
        echo \COREPOS\Fannie\API\lib\FannieHelp::ToolTip('<ul><li>View POS tender totals for all cashiers
                        on a given day and enter actual counted totals.
                        <li>The tool will calculate how much an individual
                        cashier is over or short for each tender
                        <br />as well as how much the overall store is over
                        or short.
                        <li>Work can be saved and resumed later.
                        <li>The day can be marked "resolved".</ul>');
        ?>
        </li> 
        <li><a href="OverShortCashierPage.php" target="_SingleCashier">Single Cashier O/S</a>
            <?php 
        echo \COREPOS\Fannie\API\lib\FannieHelp::ToolTip('<ul><li>View POS tender totals for cashiers
                        and enter actual counted totals.
                        <li>The difference
                        between this and the "Whole Day O/S" tool is this
                        accepts individual check amounts. If you do not need
                        all the individual checks (typically used for generating
                        bank deposit paperwork) then the "Whole Day O/S" tool
                        is likely more effective. The two tools work with the
                        same data so you can mix and match if needed.</ul>');
        ?>
        </li>
        <li><a href="OverShortSafecountPage.php" target="_SafeCount">Safe Count</a>
            <?php 
        echo \COREPOS\Fannie\API\lib\FannieHelp::ToolTip('<br />Enter information about cash on hand to calculate
                        <ul><li>what should be sent to the bank,
                        <li>how much change to order
                        in various denominations, and
                        <li>what should remain afterwards.
                        </ul>
                        <b>Very WFC specific</b>');
        ?>
        </li> 
        <li><a href="OverShortDepositSlips.php" target="_DepositSlips">Deposit Slips</a>
            <?php 
        echo \COREPOS\Fannie\API\lib\FannieHelp::ToolTip('<br />Uses information from the Safe Count tool to generate
                        paperwork that goes with the bank deposit.
                        <br /><b>Very WFC specific</b>');
        ?>
        </li> 
        <!--
        <li><a href="OverShortDayTillPage.php" target="_WholeByTill">Whole Day O/S by Till</a>
            <?php 
        echo \COREPOS\Fannie\API\lib\FannieHelp::ToolTip('<ul><li>View POS tender totals for all tills
                        on a given day and enter actual counted totals.
                        <li>The tool will calculate how much an individual
                        tills is over or short for each tender
                        <br />as well as how much the overall store is over
                        or short.
                        <li>Work can be saved and resumed later.
                        <li>The day can be marked "resolved".</ul>');
        ?>
        </li> 
        -->
        </ul>

        <?php 
        return ob_get_clean();
    }
Exemple #4
0
 public function get_id_view()
 {
     $dbc = FannieDB::getReadOnly($this->config->get('OP_DB'));
     $codes = new ReasoncodesModel($dbc);
     $plan = new EquityPaymentPlansModel($dbc);
     $plan->equityPaymentPlanID($this->id);
     if (!$plan->load()) {
         return '<div class="alert alert-danger">Error: plan does not exist</div>';
     }
     $ret = '<script type="text/javascript">
     function validateBillingCycle()
     {
         var val = $(\'input[name=cycle]\').val();
         if (val.match(/^\\s*\\d+[dDwWmMyY]\\s*$/)) {
             $(\'#billing-cycle-valid\').addClass(\'collapse\');
             return true;
         } else {
             $(\'#billing-cycle-valid\').removeClass(\'collapse\');
             $(\'#billing-cycle-valid\').html(\'<div class="alert alert-danger">Invalid Entry</div>\');
             $(\'input[name=cycle]\').focus();
             return false;
         }
     }
     </script>';
     $ret .= '<form method="post" onsubmit="return validateBillingCycle();">';
     $ret .= sprintf('
         <div class="form-group">
             <label>Name</label>
             <input class="form-control" type="text" name="name" value="%s" />
         </div>', $plan->name());
     $ret .= sprintf('
         <div class="form-group">
             <label>Total Equity Required</label>
             <div class="input-group">
                 <span class="input-group-addon">$</span>
                 <input type="text" class="form-control" name="final" value="%.2f" />
             </div>
         </div>', $plan->finalBalance());
     $ret .= sprintf('
         <div class="form-group">
             <label>Initial Payment</label>
             <div class="input-group">
                 <span class="input-group-addon">$</span>
                 <input type="text" class="form-control" name="initial" value="%.2f" />
             </div>
         </div>', $plan->initialPayment());
     $ret .= sprintf('
         <div class="form-group">
             <label>Recurring Payment</label>
             <div class="input-group">
                 <span class="input-group-addon">$</span>
                 <input type="text" class="form-control" name="recurring" value="%.2f" />
             </div>
         </div>', $plan->recurringPayment());
     $ret .= sprintf('
         <div class="form-group">
             <div id="billing-cycle-valid" class="collapse"></div>
             <label>Billing Cycle %s</label>
             <input class="form-control" type="text" name="cycle" value="%s" onchange="validateBillingCycle();" />
         </div>', \COREPOS\Fannie\API\lib\FannieHelp::toolTip('Enter a number followed by D, W, M, or Y for days, weeks, months, or years'), $plan->billingCycle());
     $ret .= sprintf('<div class="form-group">
         <label>Calculate Next Due Date based on</label>
         <select name="basis" class="form-control">
             <option value="0" %s>Join Date</option>
             <option value="1" %s>Date of Last Equity Payment</option>
         </select>
         </div>', $plan->dueDateBasis() == 0 ? 'selected' : '', $plan->dueDateBasis() == 1 ? 'selected' : '');
     $ret .= sprintf('
         <div class="form-group">
             <label>Overdue Limit (in days)</label>
             <input class="form-control" type="text" name="overdue" value="%d" />
         </div>', $plan->overDueLimit());
     $ret .= '<div class="form-group">
         <label>Reason Label for Overdue Accounts</label>
         <select class="form-control" name="reason">';
     $ret .= $codes->toOptions($plan->reasonMask());
     $ret .= '</select></div>';
     $ret .= sprintf('<input type="hidden" name="id" value="%d" />', $plan->equityPaymentPlanID());
     $ret .= '<p><button type="submit" class="btn btn-default">Save Plan</button></p>
         </form>';
     return $ret;
 }
    function form_content()
    {
        global $FANNIE_URL;
        ob_start();
        ?>
<form method = "get" action="<?php 
        echo $_SERVER['PHP_SELF'];
        ?>
">
<div class="col-sm-4">
    <div class="form-group">
        <label>Cashier#
            <?php 
        echo \COREPOS\Fannie\API\lib\FannieHelp::ToolTip('Leave blank to list all cashiers');
        ?>
</label>
        <input type=text name=emp_no id=emp_no  class="form-control" />
    </div>
    <div class="form-group">
        <label>Date Start</label>
        <input type=text id=date1 name=date1 class="form-control date-field" required />
    </div>
    <div class="form-group">
        <label>End Start</label>
        <input type=text id=date2 name=date2 class="form-control date-field" required />
    </div>
    <div class="form-group">
        <input type="checkbox" name="excel" id="excel" value="xls" />
        <label for="excel">Excel</label>
    </div>
    <p>
        <button type=submit class="btn btn-default btn-submit">Submit</button>
        <button type=reset class="btn btn-default btn-reset">Start Over</button>
    </p>
</div>
<div class="col-sm-4">
    <?php 
        echo FormLib::date_range_picker();
        ?>
</div>
</form>
<?php 
        return ob_get_clean();
    }