"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" > <div id="form_container"> <form> <div id="div_title"> <img id="top" src="http://www.beautycollection.ca/img/nbc-logo-1474048406.jpg" alt=""> <h2>POS Report Generator</h2> </div> <ul id="ul_container" class="tables"> <li> <table> <tr> <th width="100px" rowspan="2">DEPOSIT</th> <th>CIBC</th> <td><input id="deposit_cibc" name="deposit_cibc" class="currency" size="10" value="" type="text" tabindex="1" /></td> </tr> <tr> <th>SHINHAN</th> <td><input id="deposit_shinhan" name="deposit_shinhan" class="currency" size="10" value="" type="text" tabindex="2" /></td> </tr> <tr> <td height="32px" colspan="3"></td> </tr> <tr> <th height="32px">POS Report</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> <tr> <th height="32px" width="65px">CASH</th> <th width="125px">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="3" 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="3" 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="3" 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="3" 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="3" 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="3" 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="3" 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="3" 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="3" 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="3" 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="3" 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="3" 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="3" 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="3" 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="3" 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="3" 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="3" 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="3" value="" type="text" tabindex="48" /> <span class="hundred" id="usd_total_hundred"></span> </td> </tr> <tr> <td height="32px">Coin Total</td> <td><span id="cad_coin_total"></span> </td> <td><span id="usd_coin_total"></span> </td> </tr> <tr> <td height="32px" >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="110px"> <tr> <th height="32px">EMP CREDIT</th> </tr> <tr> <td>#1. $ <input id="emp_amount_01" name="emp_amount" class="currency emp_credit" size="8" value="" type="text" tabindex="50" /></td> </tr> <tr> <td>#2. $ <input id="emp_amount_02" name="emp_amount" class="currency emp_credit" size="8" value="" type="text" tabindex="51" /></td> </tr> <tr> <td>#3. $ <input id="emp_amount_03" name="emp_amount" class="currency emp_credit" size="8" value="" type="text" tabindex="52" /></td> </tr> <tr> <td>#4. $ <input id="emp_amount_04" name="emp_amount" class="currency emp_credit" size="8" value="" type="text" tabindex="53" /></td> </tr> <tr> <td>#5. $ <input id="emp_amount_05" name="emp_amount" class="currency emp_credit" size="8" value="" type="text" tabindex="54" /></td> </tr> <tr> <td>#6. $ <input id="emp_amount_06" name="emp_amount" class="currency emp_credit" size="8" value="" type="text" tabindex="55" /></td> </tr> <tr> <td>#7. $ <input id="emp_amount_07" name="emp_amount" class="currency emp_credit" size="8" value="" type="text" tabindex="56" /></td> </tr> <tr> <td>#8. $ <input id="emp_amount_08" name="emp_amount" class="currency emp_credit" size="8" value="" type="text" tabindex="57" /></td> </tr> <tr> <td>#9. $ <input id="emp_amount_09" name="emp_amount" class="currency emp_credit" size="8" value="" type="text" tabindex="58" /></td> </tr> <tr> <td>#10. $ <input id="emp_amount_10" name="emp_amount" class="currency emp_credit" size="8" value="" type="text" tabindex="59" /></td> </tr> <tr> <td height="32px" >Total <span id="emp_credit_total"></span></td> </tr> </table> </li> <li> <table> <tr> <th height="32px" width="120px">EXPENSE NOTE</th> <th width="85px">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="8" 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="8" 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="8" 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="8" 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="8" 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="8" 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="8" 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="8" 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="8" 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="8" value="" type="text" tabindex="80" /></td> </tr> <tr> <td height="32px" >Total</td> <td> <span id="expense_total"></span></td> </tr> </table> </li> <li> <table> <tr> <th height="32px" width="120px">ADJUST NOTE</th> <th width="85px">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="8" 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="8" 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="8" 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="8" 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="8" 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="8" 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="8" 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="8" 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="8" 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="8" value="" type="text" tabindex="100" /></td> </tr> <tr> <td height="32px">Total</td> <td> <span id="adjust_total"></span></td> </tr> </table> </li> </ul> <input type="hidden" id="hidden_cad_cointotal" value="0" /> <input type="hidden" id="hidden_emp_credit_total" value="0" /> <input type="hidden" id="hidden_emp_credit_note" value="" /> <input type="hidden" id="hidden_expense_total" value="0" /> <input type="hidden" id="hidden_expense_note" value="" /> <input type="hidden" id="hidden_adjust_total" value="0" /> <input type="hidden" id="hidden_adjust_note" value="" /> <input type="hidden" id="hidden_cad_billtotal" value="0" /> <input type="hidden" id="hidden_usd_billtotal" value="0" /> </form> </div> <div id="div_result"> <button onclick="copyToClipboard('#report_result')">Copy to Clipboard</button> <pre id="report_result"></pre> </div> </html>
body { font-size:12px; } #div_title { height: 70px; margin: 0 0 0 20px; } #div_title h2 { padding: 10px 0 0 220px; } #div_title img { float: left; } #ul_container { margin: 0 0 0 20px; padding: 0; } #div_result { height: 70px; margin: 20px 0 0 20px; } table { border-collapse: collapse; border: 2px solid black; margin-right:10px; } th { text-align: center; border: 2px solid black; } th, td { border: 1px solid black; padding: 4px; } tr:nth-child(even){background-color: #f2f2f2} th { background-color: #f4ca41; color: black; } .tables li { display: inline-block; vertical-align: text-top; } #report_result { width:50%; white-space: pre-wrap; }
/*! * accounting.js v0.4.2, copyright 2014 Open Exchange Rates, MIT license, http://openexchangerates.github.io/accounting.js */ (function(p,z){function q(a){return!!(""===a||a&&a.charCodeAt&&a.substr)}function m(a){return u?u(a):"[object Array]"===v.call(a)}function r(a){return"[object Object]"===v.call(a)}function s(a,b){var d,a=a||{},b=b||{};for(d in b)b.hasOwnProperty(d)&&null==a[d]&&(a[d]=b[d]);return a}function j(a,b,d){var c=[],e,h;if(!a)return c;if(w&&a.map===w)return a.map(b,d);for(e=0,h=a.length;e<h;e++)c[e]=b.call(d,a[e],e,a);return c}function n(a,b){a=Math.round(Math.abs(a));return isNaN(a)?b:a}function x(a){var b=c.settings.currency.format;"function"===typeof a&&(a=a());return q(a)&&a.match("%v")?{pos:a,neg:a.replace("-","").replace("%v","-%v"),zero:a}:!a||!a.pos||!a.pos.match("%v")?!q(b)?b:c.settings.currency.format={pos:b,neg:b.replace("%v","-%v"),zero:b}:a}var c={version:"0.4.1",settings:{currency:{symbol:"$ ",format:"%s%v",decimal:".",thousand:",",precision:2,grouping:3},number:{precision:0,grouping:3,thousand:",",decimal:"."}}},w=Array.prototype.map,u=Array.isArray,v=Object.prototype.toString,o=c.unformat=c.parse=function(a,b){if(m(a))return j(a,function(a){return o(a,b)});a=a||0;if("number"===typeof a)return a;var b=b||".",c=RegExp("[^0-9-"+b+"]",["g"]),c=parseFloat((""+a).replace(/\((.*)\)/,"-$1").replace(c,"").replace(b,"."));return!isNaN(c)?c:0},y=c.toFixed=function(a,b){var b=n(b,c.settings.number.precision),d=Math.pow(10,b);return(Math.round(c.unformat(a)*d)/d).toFixed(b)},t=c.formatNumber=c.format=function(a,b,d,i){if(m(a))return j(a,function(a){return t(a,b,d,i)});var a=o(a),e=s(r(b)?b:{precision:b,thousand:d,decimal:i},c.settings.number),h=n(e.precision),f=0>a?"-":"",g=parseInt(y(Math.abs(a||0),h),10)+"",l=3<g.length?g.length%3:0;return f+(l?g.substr(0,l)+e.thousand:"")+g.substr(l).replace(/(\d{3})(?=\d)/g,"$1"+e.thousand)+(h?e.decimal+y(Math.abs(a),h).split(".")[1]:"")},A=c.formatMoney=function(a,b,d,i,e,h){if(m(a))return j(a,function(a){return A(a,b,d,i,e,h)});var a=o(a),f=s(r(b)?b:{symbol:b,precision:d,thousand:i,decimal:e,format:h},c.settings.currency),g=x(f.format);return(0<a?g.pos:0>a?g.neg:g.zero).replace("%s",f.symbol).replace("%v",t(Math.abs(a),n(f.precision),f.thousand,f.decimal))};c.formatColumn=function(a,b,d,i,e,h){if(!a)return[];var f=s(r(b)?b:{symbol:b,precision:d,thousand:i,decimal:e,format:h},c.settings.currency),g=x(f.format),l=g.pos.indexOf("%s")<g.pos.indexOf("%v")?!0:!1,k=0,a=j(a,function(a){if(m(a))return c.formatColumn(a,f);a=o(a);a=(0<a?g.pos:0>a?g.neg:g.zero).replace("%s",f.symbol).replace("%v",t(Math.abs(a),n(f.precision),f.thousand,f.decimal));if(a.length>k)k=a.length;return a});return j(a,function(a){return q(a)&&a.length<k?l?a.replace(f.symbol,f.symbol+Array(k-a.length+1).join(" ")):Array(k-a.length+1).join(" ")+a:a})};if("undefined"!==typeof exports){if("undefined"!==typeof module&&module.exports)exports=module.exports=c;exports.accounting=c}else"function"===typeof define&&define.amd?define([],function(){return c}):(c.noConflict=function(a){return function(){p.accounting=a;c.noConflict=z;return c}}(p.accounting),p.accounting=c)})(this); /* $(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(accounting.formatMoney(cad_cointotal, "= $ ", 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(accounting.formatMoney(cad_billtotal, "= $ ", 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(accounting.formatMoney(usd_billtotal, "= $USD ", 2, ".", ",")); }); $(".emp_credit").on("input", function(evt) { total_emp_credit_amount = accounting.unformat($('#emp_amount_01').val()) + accounting.unformat($('#emp_amount_02').val()) + accounting.unformat($('#emp_amount_03').val()) + accounting.unformat($('#emp_amount_04').val()) + accounting.unformat($('#emp_amount_05').val()) + accounting.unformat($('#emp_amount_06').val()) + accounting.unformat($('#emp_amount_07').val()) + accounting.unformat($('#emp_amount_08').val()) + accounting.unformat($('#emp_amount_09').val()) + accounting.unformat($('#emp_amount_10').val()) ; total_emp_credit_note = ""; if ( total_emp_credit_amount > 0.00 ) { total_emp_credit_note = (parseFloat($('#emp_amount_01').val()) > 0.00) ? " + " + accounting.formatMoney($('#emp_amount_01').val()) : ""; total_emp_credit_note += (parseFloat($('#emp_amount_02').val()) > 0.00) ? " + " + accounting.formatMoney($('#emp_amount_02').val()) : ""; total_emp_credit_note += (parseFloat($('#emp_amount_03').val()) > 0.00) ? " + " + accounting.formatMoney($('#emp_amount_03').val()) : ""; total_emp_credit_note += (parseFloat($('#emp_amount_04').val()) > 0.00) ? " + " + accounting.formatMoney($('#emp_amount_04').val()) : ""; total_emp_credit_note += (parseFloat($('#emp_amount_05').val()) > 0.00) ? " + " + accounting.formatMoney($('#emp_amount_05').val()) : ""; total_emp_credit_note += (parseFloat($('#emp_amount_06').val()) > 0.00) ? " + " + accounting.formatMoney($('#emp_amount_06').val()) : ""; total_emp_credit_note += (parseFloat($('#emp_amount_07').val()) > 0.00) ? " + " + accounting.formatMoney($('#emp_amount_07').val()) : ""; total_emp_credit_note += (parseFloat($('#emp_amount_08').val()) > 0.00) ? " + " + accounting.formatMoney($('#emp_amount_08').val()) : ""; total_emp_credit_note += (parseFloat($('#emp_amount_09').val()) > 0.00) ? " + " + accounting.formatMoney($('#emp_amount_09').val()) : ""; total_emp_credit_note += (parseFloat($('#emp_amount_10').val()) > 0.00) ? " + " + accounting.formatMoney($('#emp_amount_10').val()) : ""; ; total_emp_credit_note = " ( " + total_emp_credit_note.substr(3) + " )"; } $('#hidden_emp_credit_total').val(total_emp_credit_amount.toFixed(2)); $('#hidden_emp_credit_note').val(total_emp_credit_note); $('#emp_credit_total').text(accounting.formatMoney(total_emp_credit_amount)); }); $(".expense").on("input", function(evt) { total_expense_amount = ($('#expense_amount_01').val() === "") ? 0 : accounting.unformat($('#expense_amount_01').val()); total_expense_amount += ($('#expense_amount_02').val() === "") ? 0 : accounting.unformat($('#expense_amount_02').val()); total_expense_amount += ($('#expense_amount_03').val() === "") ? 0 : accounting.unformat($('#expense_amount_03').val()); total_expense_amount += ($('#expense_amount_04').val() === "") ? 0 : accounting.unformat($('#expense_amount_04').val()); total_expense_amount += ($('#expense_amount_05').val() === "") ? 0 : accounting.unformat($('#expense_amount_05').val()); total_expense_amount += ($('#expense_amount_06').val() === "") ? 0 : accounting.unformat($('#expense_amount_06').val()); total_expense_amount += ($('#expense_amount_07').val() === "") ? 0 : accounting.unformat($('#expense_amount_07').val()); total_expense_amount += ($('#expense_amount_08').val() === "") ? 0 : accounting.unformat($('#expense_amount_08').val()); total_expense_amount += ($('#expense_amount_09').val() === "") ? 0 : accounting.unformat($('#expense_amount_09').val()); total_expense_amount += ($('#expense_amount_10').val() === "") ? 0 : accounting.unformat($('#expense_amount_10').val()); ; total_expense_note = ""; if ( total_expense_amount > 0.00 ) { total_expense_note = ($('#expense_01').val() == "" && parseFloat($('#expense_amount_01').val()*1) === 0) ? "" : $('#expense_01').val() + " : " + accounting.formatMoney($('#expense_amount_01').val()); total_expense_note += ($('#expense_02').val() == "" && parseFloat($('#expense_amount_02').val()*1) === 0) ? "" : "\n\t\t+ " + $('#expense_02').val() + " : " + accounting.formatMoney($('#expense_amount_02').val()); total_expense_note += ($('#expense_03').val() == "" && parseFloat($('#expense_amount_03').val()*1) === 0) ? "" : "\n\t\t+ " + $('#expense_03').val() + " : " + accounting.formatMoney($('#expense_amount_03').val()); total_expense_note += ($('#expense_04').val() == "" && parseFloat($('#expense_amount_04').val()*1) === 0) ? "" : "\n\t\t+ " + $('#expense_04').val() + " : " + accounting.formatMoney($('#expense_amount_04').val()); total_expense_note += ($('#expense_05').val() == "" && parseFloat($('#expense_amount_05').val()*1) === 0) ? "" : "\n\t\t+ " + $('#expense_05').val() + " : " + accounting.formatMoney($('#expense_amount_05').val()); total_expense_note += ($('#expense_06').val() == "" && parseFloat($('#expense_amount_06').val()*1) === 0) ? "" : "\n\t\t+ " + $('#expense_06').val() + " : " + accounting.formatMoney($('#expense_amount_06').val()); total_expense_note += ($('#expense_07').val() == "" && parseFloat($('#expense_amount_07').val()*1) === 0) ? "" : "\n\t\t+ " + $('#expense_07').val() + " : " + accounting.formatMoney($('#expense_amount_07').val()); total_expense_note += ($('#expense_08').val() == "" && parseFloat($('#expense_amount_08').val()*1) === 0) ? "" : "\n\t\t+ " + $('#expense_08').val() + " : " + accounting.formatMoney($('#expense_amount_08').val()); total_expense_note += ($('#expense_09').val() == "" && parseFloat($('#expense_amount_09').val()*1) === 0) ? "" : "\n\t\t+ " + $('#expense_09').val() + " : " + accounting.formatMoney($('#expense_amount_09').val()); total_expense_note += ($('#expense_10').val() == "" && parseFloat($('#expense_amount_10').val()*1) === 0) ? "" : "\n\t\t+ " + $('#expense_10').val() + " : " + accounting.formatMoney($('#expense_amount_10').val()); total_expense_note = " ( " + total_expense_note + " )"; } $('#hidden_expense_total').val(total_expense_amount.toFixed(2)); $('#hidden_expense_note').val(total_expense_note); $('#expense_total').text(accounting.formatMoney(total_expense_amount)); }); $(".adjust").on("input", function(evt) { total_adjust_amount = accounting.unformat($('#adjust_amount_01').val()) + accounting.unformat($('#adjust_amount_02').val()) + accounting.unformat($('#adjust_amount_03').val()) + accounting.unformat($('#adjust_amount_04').val()) + accounting.unformat($('#adjust_amount_05').val()) + accounting.unformat($('#adjust_amount_06').val()) + accounting.unformat($('#adjust_amount_07').val()) + accounting.unformat($('#adjust_amount_08').val()) + accounting.unformat($('#adjust_amount_09').val()) + accounting.unformat($('#adjust_amount_10').val()) ; total_adjust_note = ""; if ( total_adjust_amount > 0.00 ) { total_adjust_note = ($('#adjust_01').val() == "" && parseFloat($('#adjust_amount_01').val()*1) === 0) ? "" : $('#adjust_01').val() + " : " + accounting.formatMoney($('#adjust_amount_01').val()); total_adjust_note += ($('#adjust_02').val() == "" && parseFloat($('#adjust_amount_02').val()*1) === 0) ? "" : "\n\t\t+ " + $('#adjust_02').val() + " : " + accounting.formatMoney($('#adjust_amount_02').val()); total_adjust_note += ($('#adjust_03').val() == "" && parseFloat($('#adjust_amount_03').val()*1) === 0) ? "" : "\n\t\t+ " + $('#adjust_03').val() + " : " + accounting.formatMoney($('#adjust_amount_03').val()); total_adjust_note += ($('#adjust_04').val() == "" && parseFloat($('#adjust_amount_04').val()*1) === 0) ? "" : "\n\t\t+ " + $('#adjust_04').val() + " : " + accounting.formatMoney($('#adjust_amount_04').val()); total_adjust_note += ($('#adjust_05').val() == "" && parseFloat($('#adjust_amount_05').val()*1) === 0) ? "" : "\n\t\t+ " + $('#adjust_05').val() + " : " + accounting.formatMoney($('#adjust_amount_05').val()); total_adjust_note += ($('#adjust_06').val() == "" && parseFloat($('#adjust_amount_06').val()*1) === 0) ? "" : "\n\t\t+ " + $('#adjust_06').val() + " : " + accounting.formatMoney($('#adjust_amount_06').val()); total_adjust_note += ($('#adjust_07').val() == "" && parseFloat($('#adjust_amount_07').val()*1) === 0) ? "" : "\n\t\t+ " + $('#adjust_07').val() + " : " + accounting.formatMoney($('#adjust_amount_07').val()); total_adjust_note += ($('#adjust_08').val() == "" && parseFloat($('#adjust_amount_08').val()*1) === 0) ? "" : "\n\t\t+ " + $('#adjust_08').val() + " : " + accounting.formatMoney($('#adjust_amount_08').val()); total_adjust_note += ($('#adjust_09').val() == "" && parseFloat($('#adjust_amount_09').val()*1) === 0) ? "" : "\n\t\t+ " + $('#adjust_09').val() + " : " + accounting.formatMoney($('#adjust_amount_09').val()); total_adjust_note += ($('#adjust_10').val() == "" && parseFloat($('#adjust_amount_10').val()*1) === 0) ? "" : "\n\t\t+ " + $('#adjust_10').val() + " : " + accounting.formatMoney($('#adjust_amount_10').val()); total_adjust_note = " ( " + total_adjust_note + " )"; } $('#hidden_adjust_total').val(total_adjust_amount.toFixed(2)); $('#hidden_adjust_note').val(total_adjust_note); $('#adjust_total').text(accounting.formatMoney(total_adjust_amount)); }); $(".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 = accounting.formatMoney((TOTAL_01 + TOTAL_02)) + " ( " + accounting.formatMoney(TOTAL_01) + " + " + accounting.formatMoney(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 = accounting.formatMoney(CARD_01 + CARD_02) + " ( " + accounting.formatMoney(CARD_01) + " + " + accounting.formatMoney(CARD_02) + " )" ; deposit_cibc = Number($('#deposit_cibc').val().replace(/[^0-9\.]+/g,"")); deposit_shinhan = Number($('#deposit_shinhan').val().replace(/[^0-9\.]+/g,"")); DEPOSIT = accounting.formatMoney(deposit_cibc + deposit_shinhan) + " ( CIBC : " + accounting.formatMoney(deposit_cibc) + " / SHINHAN : " + accounting.formatMoney(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 = accounting.formatMoney(REDEEMED_01 + REDEEMED_02) + " ( " + accounting.formatMoney(REDEEMED_01) + " + " + accounting.formatMoney(REDEEMED_02) + " )" ; COUPON_01 = Number($('#pos1_coupon').val().replace(/[^0-9\.]+/g,"")); COUPON_02 = Number($('#pos2_coupon').val().replace(/[^0-9\.]+/g,"")); COUPON = accounting.formatMoney(COUPON_01 + COUPON_02) + " ( " + accounting.formatMoney(COUPON_01) + " + " + accounting.formatMoney(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 = accounting.formatMoney(GIFT_CARD_01 + GIFT_CARD_02) + " ( " + accounting.formatMoney(GIFT_CARD_01) + " + " + accounting.formatMoney(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 = accounting.formatMoney(POINT_REFUND_01 + POINT_REFUND_02) + " ( " + accounting.formatMoney(POINT_REFUND_01) + " + " + accounting.formatMoney(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 = accounting.formatMoney(CASH_REFUND_01 + CASH_REFUND_02) + " ( " + accounting.formatMoney(CASH_REFUND_01) + " + " + accounting.formatMoney(CASH_REFUND_02) + " )"; COIN = accounting.formatMoney($('#hidden_cad_cointotal').val()); EMP_CREDIT = accounting.formatMoney($('#hidden_emp_credit_total').val()) + $('#hidden_emp_credit_note').val(); CAD_CASH = accounting.formatMoney($('#hidden_cad_billtotal').val()); US_CASH = accounting.formatMoney($('#hidden_usd_billtotal').val()); EXPENSE = accounting.formatMoney($('#hidden_expense_total').val()) + $('#hidden_expense_note').val(); ADJUST = accounting.formatMoney($('#hidden_adjust_total').val()) + $('#hidden_adjust_note').val(); RESULT = (accounting.unformat(TOTAL_01) + accounting.unformat(TOTAL_02)) - ( accounting.unformat(CARD_01) + accounting.unformat(CARD_02) + accounting.unformat(COIN) + accounting.unformat(EMP_CREDIT) + accounting.unformat(CAD_CASH) + accounting.unformat(US_CASH) + accounting.unformat(REDEEMED_01) + accounting.unformat(REDEEMED_02) + accounting.unformat(GIFT_CARD_01) + accounting.unformat(GIFT_CARD_02) + accounting.unformat(COUPON_01) + accounting.unformat(COUPON_02) + accounting.unformat(EXPENSE) + accounting.unformat(ADJUST) ) + (accounting.unformat(POINT_REFUND_01) + accounting.unformat(POINT_REFUND_02)) ; var today = new Date(); var yyyy = today.getFullYear(); var mm = ((today.getMonth()+1) < 10) ? "0" + (today.getMonth()+1) : (today.getMonth()+1); var dd = today.getDate(); var date = yyyy +'-'+ mm +'-'+ dd; var summary = "DATE : " + date + "\n\nTOTAL : " + 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').html(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(); } }); function copyToClipboard(element) { var text = $(element).clone().find('br').prepend('\r\n').end().text(); if ( text !== "") { element = $('<textarea>').appendTo('body').val(text).select(); document.execCommand('copy'); element.remove(); alert('The Result has been copied\n\rGo to report page and press Ctrl+V'); } }

Related: See More


Questions / Comments: