"price"
Bootstrap 3.0.0 Snippet by arkiz

<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-price-format/2.1/jquery.priceformat.js"></script> <body id="main_body" > <img id="top" src="top.png" alt=""> <div id="form_container"> <form> <div class="form_description"> <h2>POS Report Generator</h2> </div> <ul class="tables"> <li> <table width="350px"> <tr> <th rowspan="2">DEPOSIT</th> <th>(CIBC)</th> <th><input id="deposit_cibc" name="deposit_cibc" class="currency" size="6" value="" type="text" tabindex="10" /></th> </tr> <tr> <th>(SHINHAN)</th> <th><input id="deposit_shinhan" name="deposit_shinhan" class="currency" size="6" value="" type="text" tabindex="10" /></th> </tr> <tr> <th>POS</th> <th>#1</th> <th>#2</th> </tr> <tr> <td>NET TTL</td> <td><lable>$ </lable><input id="pos1_net_ttl" name="pos1_net_ttl" class="currency" size="6" value="" type="text" tabindex="10" /></td> <td><lable>$ </lable><input id="pos2_net_ttl" name="pos2_net_ttl" class="currency" size="6" value="" type="text" tabindex="20" /></td> </tr> <tr> <td>TOTAL</td> <td><lable>$ </lable><input id="pos1_total" name="pos1_total" class="currency" size="6" value="" type="text" tabindex="11" /></td> <td><lable>$ </lable><input id="pos2_total" name="pos2_total" class="currency" size="6" value="" type="text" tabindex="21" /></td> </tr> <tr> <td>Paid on Account</td> <td><lable>$ </lable><input id="pos1_paid_on_account" name="pos1_paid_on_account" class="currency" size="6" value="" type="text" tabindex="12"/></td> <td><lable>$ </lable><input id="pos2_paid_on_account" name="pos2_paid_on_account" class="currency" size="6" value="" type="text" tabindex="22"/></td> </tr> <tr> <td>Coupon</td> <td><lable>$ </lable><input id="pos1_coupon" name="pos1_coupon" class="currency" size="6" value="" type="text" tabindex="13"/></td> <td><lable>$ </lable><input id="pos2_coupon" name="pos2_coupon" class="currency" size="6" value="" type="text" tabindex="23"/></td> </tr> <tr> <td>Gift Card</td> <td><lable>$ </lable><input id="pos1_gift_card" name="pos1_gift_card" class="currency" size="6" value="" type="text" tabindex="14"/></td> <td><lable>$ </lable><input id="pos2_gift_card" name="pos2_gift_card" class="currency" size="6" value="" type="text" tabindex="24"/></td> </tr> <tr> <td>Point Refund</td> <td><lable>$ </lable><input id="pos1_point_refund" name="pos1_point_refund" class="currency" size="6" value="" type="text" tabindex="15"/></td> <td><lable>$ </lable><input id="pos2_point_refund" name="pos2_point_refund" class="currency" size="6" value="" type="text" tabindex="25" /></td> </tr> <tr> <td>Cash Refund</td> <td><lable>$ </lable><input id="pos1_cash_refund" name="pos1_cash_refund" class="currency" size="6" value="" type="text" tabindex="16" /></td> <td><lable>$ </lable><input id="pos2_cash_refund" name="pos2_cash_refund" class="currency" size="6" value="" type="text" tabindex="26" /></td> </tr> <tr> <td>Transaction</td> <td><lable># </lable><input id="pos1_trans" name="pos1_trans" class="numeric" size="6" value="" type="text" tabindex="17" /></td> <td><lable># </lable><input id="pos2_trans" name="pos2_trans" class="numeric" size="6" value="" type="text" tabindex="27" /></td> </tr> </table> </li> <li> <table width="300px"> <tr> <th>CASH</th> <th>CAD</th> <th>USD</th> </tr> <tr> <td>$0.10</td> <td><lable>x </lable><input id="cad_cash_dime" name="cad_cash_dime" class="numeric cash" size="2" value="" type="text" tabindex="30" /> <span class="dime" id="cad_total_dime"></span> </td> <td><!-- <lable>x </lable><input id="usd_cash_dime" name="usd_cash_dime" class="numeric cash" size="2" value="" type="text" tabindex="40" /> <span class="dime" id="usd_total_dime"></span> --> </td> </tr> <tr> <td>$0.25</td> <td><lable>x </lable><input id="cad_cash_quarter" name="cad_cash_quarter" class="numeric cash" size="2" value="" type="text" tabindex="31" /> <span class="quarter" id="cad_total_quarter"></span> </td> <td><!-- <lable>x </lable><input id="usd_cash_quarter" name="usd_cash_quarter" class="numeric cash" size="2" value="" type="text" tabindex="41" /> <span class="quarter" id="usd_total_quarter"></span>--> </td> </tr> <tr> <td>$1</td> <td><lable>x </lable><input id="cad_cash_loonie" name="cad_cash_loonie" class="numeric cash" size="2" value="" type="text" tabindex="32" /> <span class="loonie" id="cad_total_loonie"></span> </td> <td><lable>x </lable><input id="usd_cash_loonie" name="usd_cash_loonie" class="numeric cash" size="2" value="" type="text" tabindex="42" /> <span class="loonie" id="usd_total_loonie"></span> </td> </tr> <tr> <td>$2</td> <td><lable>x </lable><input id="cad_cash_toonie" name="cad_cash_toonie" class="numeric cash" size="2" value="" type="text" tabindex="33" /> <span class="loonie" id="cad_total_toonie"></span> </td> <td><lable>x </lable><input id="usd_cash_toonie" name="usd_cash_toonie" class="numeric cash" size="2" value="" type="text" tabindex="43" /> <span class="loonie" id="usd_total_toonie"></span> </td> </tr> <tr> <td>$5</td> <td><lable>x </lable><input id="cad_cash_five" name="cad_cash_five" class="numeric cash" size="2" value="" type="text" tabindex="34" /> <span class="five" id="cad_total_five"></span> </td> <td><lable>x </lable><input id="usd_cash_five" name="usd_cash_five" class="numeric cash" size="2" value="" type="text" tabindex="44" /> <span class="five" id="usd_total_five"></span> </td> </tr> <tr> <td>$10</td> <td><lable>x </lable><input id="cad_cash_ten" name="cad_cash_ten" class="numeric cash" size="2" value="" type="text" tabindex="35" /> <span class="ten" id="cad_total_ten"></span> </td> <td><lable>x </lable><input id="usd_cash_ten" name="usd_cash_ten" class="numeric cash" size="2" value="" type="text" tabindex="45" /> <span class="ten" id="usd_total_ten"></span> </td> </tr> <tr> <td>$20</td> <td><lable>x </lable><input id="cad_cash_twenty" name="cad_cash_twenty" class="numeric cash" size="2" value="" type="text" tabindex="36" /> <span class="twenty" id="cad_total_twenty"></span> </td> <td><lable>x </lable><input id="usd_cash_twenty" name="usd_cash_twenty" class="numeric cash" size="2" value="" type="text" tabindex="46" /> <span class="twenty" id="usd_total_twenty"></span> </td> </tr> <tr> <td>$50</td> <td><lable>x </lable><input id="cad_cash_fifty" name="cad_cash_fifty" class="numeric cash" size="2" value="" type="text" tabindex="37" /> <span class="fifty" id="cad_total_fifty"></span> </td> <td><lable>x </lable><input id="usd_cash_fifty" name="usd_cash_fifty" class="numeric cash" size="2" value="" type="text" tabindex="47" /> <span class="fifty" id="usd_total_fifty"></span> </td> </tr> <tr> <td>$100</td> <td><lable>x </lable><input id="cad_cash_hundred" name="cad_cash_hundred" class="numeric cash" size="2" value="" type="text" tabindex="38" /> <span class="hundred" id="cad_total_hundred"></span> </td> <td><lable>x </lable><input id="usd_cash_hundred" name="usd_cash_hundred" class="numeric cash" size="2" value="" type="text" tabindex="48" /> <span class="hundred" id="usd_total_hundred"></span> </td> </tr> <tr> <td>Coin Total</td> <td><span id="cad_coin_total"></span> </td> <td><span id="usd_coin_total"></span> </td> </tr> <tr> <td>Bill Total</td> <td><span id="cad_bill_total"></span> </td> <td><span id="usd_bill_total"></span> </td> </tr> </table> </li> <li> <table width="150px"> <tr> <th>EMP CREDIT</th> </tr> <tr> <td>#1. $ <input id="emp_amount_01" name="emp_amount" class="currency emp_credit" size="4" value="" type="text" tabindex="50" /></td> </tr> <tr> <td>#2. $ <input id="emp_amount_02" name="emp_amount" class="currency emp_credit" size="4" value="" type="text" tabindex="51" /></td> </tr> <tr> <td>#3. $ <input id="emp_amount_03" name="emp_amount" class="currency emp_credit" size="4" value="" type="text" tabindex="52" /></td> </tr> <tr> <td>#4. $ <input id="emp_amount_04" name="emp_amount" class="currency emp_credit" size="4" value="" type="text" tabindex="53" /></td> </tr> <tr> <td>#5. $ <input id="emp_amount_05" name="emp_amount" class="currency emp_credit" size="4" value="" type="text" tabindex="54" /></td> </tr> <tr> <td>#6. $ <input id="emp_amount_06" name="emp_amount" class="currency emp_credit" size="4" value="" type="text" tabindex="55" /></td> </tr> <tr> <td>#7. $ <input id="emp_amount_07" name="emp_amount" class="currency emp_credit" size="4" value="" type="text" tabindex="56" /></td> </tr> <tr> <td>#8. $ <input id="emp_amount_08" name="emp_amount" class="currency emp_credit" size="4" value="" type="text" tabindex="57" /></td> </tr> <tr> <td>#9. $ <input id="emp_amount_09" name="emp_amount" class="currency emp_credit" size="4" value="" type="text" tabindex="58" /></td> </tr> <tr> <td>#10. $ <input id="emp_amount_10" name="emp_amount" class="currency emp_credit" size="4" value="" type="text" tabindex="59" /></td> </tr> <tr> <td>Total <span id="emp_credit_total"></span></td> </tr> </table> </li> <li> <table width="260px"> <tr> <th>EXPENSE NOTE</th> <th>AMOUNT</th> </tr> <tr> <td>#1. <input id="expense_01" name="expense_name" class="expense" size="12" value="" type="text" tabindex="61" /></td> <td>$ <input id="expense_amount_01" name="expense_amount" class="currency expense" size="4" value="" type="text" tabindex="62" /></td> </tr> <tr> <td>#2. <input id="expense_02" name="expense_name" class="expense" size="12" value="" type="text" tabindex="63" /></td> <td>$ <input id="expense_amount_02" name="expense_amount" class="currency expense" size="4" value="" type="text" tabindex="64" /></td> </tr> <tr> <td>#3. <input id="expense_03" name="expense_name" class="expense" size="12" value="" type="text" tabindex="65" /></td> <td>$ <input id="expense_amount_03" name="expense_amount" class="currency expense" size="4" value="" type="text" tabindex="66" /></td> </tr> <tr> <td>#4. <input id="expense_04" name="expense_name" class="expense" size="12" value="" type="text" tabindex="67" /></td> <td>$ <input id="expense_amount_04" name="expense_amount" class="currency expense" size="4" value="" type="text" tabindex="68" /></td> </tr> <tr> <td>#5. <input id="expense_05" name="expense_name" class="expense" size="12" value="" type="text" tabindex="69" /></td> <td>$ <input id="expense_amount_05" name="expense_amount" class="currency expense" size="4" value="" type="text" tabindex="70" /></td> </tr> <tr> <td>#6. <input id="expense_06" name="expense_name" class="expense" size="12" value="" type="text" tabindex="71" /></td> <td>$ <input id="expense_amount_06" name="expense_amount" class="currency expense" size="4" value="" type="text" tabindex="72" /></td> </tr> <tr> <td>#7. <input id="expense_07" name="expense_name" class="expense" size="12" value="" type="text" tabindex="73" /></td> <td>$ <input id="expense_amount_07" name="expense_amount" class="currency expense" size="4" value="" type="text" tabindex="74" /></td> </tr> <tr> <td>#8. <input id="expense_08" name="expense_name" class="expense" size="12" value="" type="text" tabindex="75" /></td> <td>$ <input id="expense_amount_08" name="expense_amount" class="currency expense" size="4" value="" type="text" tabindex="76" /></td> </tr> <tr> <td>#9. <input id="expense_09" name="expense_name" class="expense" size="12" value="" type="text" tabindex="77" /></td> <td>$ <input id="expense_amount_09" name="expense_amount" class="currency expense" size="4" value="" type="text" tabindex="78" /></td> </tr> <tr> <td>#10. <input id="expense_10" name="expense_name" class="expense" size="12" value="" type="text" tabindex="79" /></td> <td>$ <input id="expense_amount_10" name="expense_amount" class="currency expense" size="4" value="" type="text" tabindex="80" /></td> </tr> <tr> <td>Total</td> <td> <span id="expense_total"></span></td> </tr> </table> </li> <li> <table> <tr> <th>ADJUST NOTE</th> <th>AMOUNT</th> </tr> <tr> <td>#1. <input id="adjust_01" name="adjust_name" class="adjust" size="12" value="" type="text" tabindex="81" /></td> <td>- $ <input id="adjust_amount_01" name="adjust_amount" class="currency adjust" size="4" value="" type="text" tabindex="82" /></td> </tr> <tr> <td>#2. <input id="adjust_02" name="adjust_name" class="adjust" size="12" value="" type="text" tabindex="83" /></td> <td>- $ <input id="adjust_amount_02" name="adjust_amount" class="currency adjust" size="4" value="" type="text" tabindex="84" /></td> </tr> <tr> <td>#3. <input id="adjust_03" name="adjust_name" class="adjust" size="12" value="" type="text" tabindex="85" /></td> <td>- $ <input id="adjust_amount_03" name="adjust_amount" class="currency adjust" size="4" value="" type="text" tabindex="86" /></td> </tr> <tr> <td>#4. <input id="adjust_04" name="adjust_name" class="adjust" size="12" value="" type="text" tabindex="87" /></td> <td>- $ <input id="adjust_amount_04" name="adjust_amount" class="currency adjust" size="4" value="" type="text" tabindex="88" /></td> </tr> <tr> <td>#5. <input id="adjust_05" name="adjust_name" class="adjust" size="12" value="" type="text" tabindex="89" /></td> <td>- $ <input id="adjust_amount_05" name="adjust_amount" class="currency adjust" size="4" value="" type="text" tabindex="90" /></td> </tr> <tr> <td>#6. <input id="adjust_06" name="adjust_name" class="adjust" size="12" value="" type="text" tabindex="91" /></td> <td>- $ <input id="adjust_amount_06" name="adjust_amount" class="currency adjust" size="4" value="" type="text" tabindex="92" /></td> </tr> <tr> <td>#7. <input id="adjust_07" name="adjust_name" class="adjust" size="12" value="" type="text" tabindex="93" /></td> <td>- $ <input id="adjust_amount_07" name="adjust_amount" class="currency adjust" size="4" value="" type="text" tabindex="94" /></td> </tr> <tr> <td>#8. <input id="adjust_08" name="adjust_name" class="adjust" size="12" value="" type="text" tabindex="95" /></td> <td>- $ <input id="adjust_amount_08" name="adjust_amount" class="currency adjust" size="4" value="" type="text" tabindex="96" /></td> </tr> <tr> <td>#9. <input id="adjust_09" name="adjust_name" class="adjust" size="12" value="" type="text" tabindex="97" /></td> <td>- $ <input id="adjust_amount_09" name="adjust_amount" class="currency adjust" size="4" value="" type="text" tabindex="98" /></td> </tr> <tr> <td>#10. <input id="adjust_10" name="expense_name" class="adjust" size="12" value="" type="text" tabindex="99" /></td> <td>- $ <input id="adjust_amount_10" name="adjust_amount" class="currency adjust" size="4" value="" type="text" tabindex="100" /></td> </tr> <tr> <td>Total</td> <td> <span id="adjust_total"></span></td> </tr> </table> </li> </ul> <input type="hidden" id="hidden_cad_cointotal" /> <input type="hidden" id="hidden_emp_credit_total" /> <input type="hidden" id="hidden_expense_total" /> <input type="hidden" id="hidden_adjust_total" /> <input type="hidden" id="hidden_cad_billtotal" /> <input type="hidden" id="hidden_usd_billtotal" /> </form> </div> <div> <pre id="report_result"> </pre> </div> </html>
table { border-collapse: collapse; } th, td { text-align: left; padding: 8px; } tr:nth-child(even){background-color: #f2f2f2} th { background-color: #4CAF50; color: white; } .tables li { display: inline-block; vertical-align: text-top; }
/* $(document).on('keypress', '.currency', function () { console.log($(this).context.value); alert($(this).value); }); */ $(document).ready(function(){ $(".currency").on("input", function(evt) { $(this).priceFormat({ prefix: '', thousandsSeparator: ',' }); }); $(".cash").on("input", function(evt) { var unit = $(this).context.value; var unitprice = 0; switch($(this).attr('id')) { case 'cad_cash_dime': case 'usd_cash_dime': unitprice = 0.1; break; case 'cad_cash_quarter': case 'usd_cash_quarter': unitprice = 0.25; break; case 'cad_cash_loonie': case 'usd_cash_loonie': unitprice = 1; break; case 'cad_cash_toonie': case 'usd_cash_toonie': unitprice = 2; break; case 'cad_cash_five': case 'usd_cash_five': unitprice = 5; break; case 'cad_cash_ten': case 'usd_cash_ten': unitprice = 10; break; case 'cad_cash_twenty': case 'usd_cash_twenty': unitprice = 20; break; case 'cad_cash_fifty': case 'usd_cash_fifty': unitprice = 50; break; case 'cad_cash_hundred': case 'usd_cash_hundred': unitprice = 100; break; } $(this).next('span').text(parseFloat(unit*unitprice).toFixed(2)); $(this).next('span').priceFormat({ prefix: '= $ ', thousandsSeparator: ',' }); cad_cointotal = parseFloat($('#cad_cash_dime').val()*0.1) + parseFloat($('#cad_cash_quarter').val()*0.25) + parseFloat($('#cad_cash_loonie').val()*1.00) + parseFloat($('#cad_cash_toonie').val()*2); $('#hidden_cad_cointotal').val(cad_cointotal.toFixed(2)); $('#cad_coin_total').text('= $CAD ' + parseFloat(cad_cointotal.toFixed(2))); cad_billtotal = parseFloat($('#cad_cash_five').val()*5) + parseFloat($('#cad_cash_ten').val()*10) + parseFloat($('#cad_cash_twenty').val()*20) + parseFloat($('#cad_cash_fifty').val()*50) + parseFloat($('#cad_cash_hundred').val()*100); $('#hidden_cad_billtotal').val(cad_billtotal.toFixed(2)); $('#cad_bill_total').text('= $CAD ' + parseFloat(cad_billtotal.toFixed(2))); // usd_cointotal = parseFloat($('#usd_cash_dime').val()*0.1) // + parseFloat($('#usd_cash_quarter').val()*0.25); // $('#usd_coin_total').text('= $USD ' + parseFloat(usd_cointotal.toFixed(2))); usd_billtotal = parseFloat($('#usd_cash_loonie').val()*1.00) + parseFloat($('#usd_cash_toonie').val()*2) + parseFloat($('#usd_cash_five').val()*5) + parseFloat($('#usd_cash_ten').val()*10) + parseFloat($('#usd_cash_twenty').val()*20) + parseFloat($('#usd_cash_fifty').val()*50) + parseFloat($('#usd_cash_hundred').val()*100); $('#hidden_usd_billtotal').val(usd_billtotal.toFixed(2)); $('#usd_bill_total').text('= $USD ' + parseFloat(usd_billtotal.toFixed(2))); }); $(".emp_credit").on("input", function(evt) { total_emp_credit_amount = parseFloat($('#emp_amount_01').val()*1) + parseFloat($('#emp_amount_02').val()*1) + parseFloat($('#emp_amount_03').val()*1) + parseFloat($('#emp_amount_04').val()*1) + parseFloat($('#emp_amount_05').val()*1) + parseFloat($('#emp_amount_06').val()*1) + parseFloat($('#emp_amount_07').val()*1) + parseFloat($('#emp_amount_08').val()*1) + parseFloat($('#emp_amount_09').val()*1) + parseFloat($('#emp_amount_10').val()*1) ; $('#hidden_emp_credit_total').val(total_emp_credit_amount.toFixed(2)); $('#emp_credit_total').text("$ " + total_emp_credit_amount.toFixed(2)); }); $(".expense").on("input", function(evt) { total_expense_amount = parseFloat($('#expense_amount_01').val()*1) + parseFloat($('#expense_amount_02').val()*1) + parseFloat($('#expense_amount_03').val()*1) + parseFloat($('#expense_amount_04').val()*1) + parseFloat($('#expense_amount_05').val()*1) + parseFloat($('#expense_amount_06').val()*1) + parseFloat($('#expense_amount_07').val()*1) + parseFloat($('#expense_amount_08').val()*1) + parseFloat($('#expense_amount_09').val()*1) + parseFloat($('#expense_amount_10').val()*1) ; $('#hidden_expense_total').val(total_expense_amount.toFixed(2)); $('#expense_total').text("$ " + total_expense_amount.toFixed(2)); }); $(".adjust").on("input", function(evt) { total_adjust_amount = parseFloat($('#adjust_amount_01').val()*1) + parseFloat($('#adjust_amount_02').val()*1) + parseFloat($('#adjust_amount_03').val()*1) + parseFloat($('#adjust_amount_04').val()*1) + parseFloat($('#adjust_amount_05').val()*1) + parseFloat($('#adjust_amount_06').val()*1) + parseFloat($('#adjust_amount_07').val()*1) + parseFloat($('#adjust_amount_08').val()*1) + parseFloat($('#adjust_amount_09').val()*1) + parseFloat($('#adjust_amount_10').val()*1) ; $('#hidden_adjust_total').val(total_adjust_amount.toFixed(2)); $('#adjust_total').text("- $ " + total_adjust_amount.toFixed(2)); }); $(".numeric").keypress(function (e) { //if the letter is not digit then display error and don't type anything if (e.which != 8 && e.which !== 0 && (e.which < 48 || e.which > 57)) { return false; } }); $("input").on("input", function(evt) { TOTAL_01 = Number($('#pos1_total').val().replace(/[^0-9\.]+/g,"")); TOTAL_02 = Number($('#pos2_total').val().replace(/[^0-9\.]+/g,"")); TOTAL = (TOTAL_01 + TOTAL_02).toFixed(2) + " ( " + TOTAL_01 + " + " + TOTAL_02 + " )"; TRANS = Number($('#pos1_trans').val()) + Number($('#pos2_trans').val()) + " ( " + Number($('#pos1_trans').val()) + " + " + Number($('#pos2_trans').val()) + " )"; CARD_01 = Number($('#pos1_net_ttl').val().replace(/[^0-9\.]+/g,"")); CARD_02 = Number($('#pos2_net_ttl').val().replace(/[^0-9\.]+/g,"")); CARD = (CARD_01 + CARD_02).toFixed(2) + " ( " + CARD_01 + " + " + CARD_02 + " )"; deposit_cibc = Number($('#deposit_cibc').val().replace(/[^0-9\.]+/g,"")); deposit_shinhan = Number($('#deposit_shinhan').val().replace(/[^0-9\.]+/g,"")); DEPOSIT = (deposit_cibc + deposit_shinhan).toFixed(2) + " ( CIBC : $ " + deposit_cibc + " / SHINHAN : $ " + deposit_shinhan + " )"; REDEEMED_01 = Number($('#pos1_paid_on_account').val().replace(/[^0-9\.]+/g,"")); REDEEMED_02 = Number($('#pos2_paid_on_account').val().replace(/[^0-9\.]+/g,"")); REDEEMED = (REDEEMED_01 + REDEEMED_02).toFixed(2) + " ( " + REDEEMED_01 + " + " + REDEEMED_02 + " )"; COUPON_01 = Number($('#pos1_coupon').val().replace(/[^0-9\.]+/g,"")); COUPON_02 = Number($('#pos2_coupon').val().replace(/[^0-9\.]+/g,"")); COUPON = (COUPON_01 + COUPON_02).toFixed(2) + " ( " + COUPON_01 + " + " + COUPON_02 + " )"; GIFT_CARD_01 = Number($('#pos1_gift_card').val().replace(/[^0-9\.]+/g,"")); GIFT_CARD_02 = Number($('#pos2_gift_card').val().replace(/[^0-9\.]+/g,"")); GIFT_CARD = (GIFT_CARD_01 + GIFT_CARD_02).toFixed(2) + " ( " + GIFT_CARD_01 + " + " + GIFT_CARD_02 + " )"; POINT_REFUND_01 = Number($('#pos1_point_refund').val().replace(/[^0-9\.]+/g,"")); POINT_REFUND_02 = Number($('#pos2_point_refund').val().replace(/[^0-9\.]+/g,"")); POINT_REFUND = (POINT_REFUND_01 + POINT_REFUND_02).toFixed(2) + " ( " + POINT_REFUND_01 + " + " + POINT_REFUND_02 + " )"; CASH_REFUND_01 = Number($('#pos1_cash_refund').val().replace(/[^0-9\.]+/g,"")); CASH_REFUND_02 = Number($('#pos2_cash_refund').val().replace(/[^0-9\.]+/g,"")); CASH_REFUND = (CASH_REFUND_01 + CASH_REFUND_02).toFixed(2) + " ( " + CASH_REFUND_01 + " + " + CASH_REFUND_02 + " )"; COIN = $('#hidden_cad_cointotal').val(); EMP_CREDIT = $('#hidden_emp_credit_total').val(); CAD_CASH = $('#hidden_cad_billtotal').val(); US_CASH = $('#hidden_usd_billtotal').val(); EXPENSE = $('#hidden_expense_total').val(); ADJUST = $('#hidden_adjust_total').val() RESULT = (TOTAL_01 + TOTAL_02).toFixed(2) - ( parseFloat((CARD_01 + CARD_02)).toFixed(2) + parseFloat(COIN ).toFixed(2) ); // + EMP_CREDIT // + CAD_CASH // + US_CASH // + (REDEEMED_01 + REDEEMED_02).toFixed(2) // + (GIFT_CARD_01 + GIFT_CARD_02).toFixed(2) // + (COUPON_01 + COUPON_02).toFixed(2) // + EXPENSE // + ADJUST // ) // + POINT_REFUND // ; var summary = "TOTAL : $ " + TOTAL + "\nTRANS : # " + TRANS + "\nCARD : $ " + CARD + "\nCOIN : $ " + COIN + "\nDEPOSIT : $ " + DEPOSIT + "\nEMPLOYEE CREDIT : $ " + EMP_CREDIT + "\nCASH : $" + CAD_CASH + " / US $ " + US_CASH + "\nREDEEMED : $ " + REDEEMED + "\nPOINT REFUND : $ " + POINT_REFUND + "\nCASH REFUND : $ " + CASH_REFUND + "\nGIFT CRAD : $ " + GIFT_CARD + "\nCOUPON: $ " + COUPON + "\nEXPENSE : $ " + EXPENSE + "\nADJUST : $ " + ADJUST + "\nRESULT : $ " + RESULT ; $('#report_result').text(summary); }); }); jQuery.extend(jQuery.expr[':'], { focusable: function (el, index, selector) { return $(el).is('a, button, :input, [tabindex]'); } }); $(document).on('keydown', ':focusable', function (e) { if (e.which == 13) { e.preventDefault(); ntabindex =parseInt($(this).attr('tabIndex')) +1; if( $('input[tabindex='+ntabindex+']').length === 0) { ntabindex = Math.ceil(ntabindex/10)*10; } $('input[tabindex='+ntabindex+']').focus(); } });

Related: See More


Questions / Comments: