114 lines
4.7 KiB
JavaScript
114 lines
4.7 KiB
JavaScript
// $(document).on('touchstart click', '.keypad', function(event){
|
|
// event.stopPropagation();
|
|
// event.preventDefault();
|
|
// if(event.handled !== true) {
|
|
//
|
|
// // Do your magic here.
|
|
// var input_value = $(this).attr("data-value");
|
|
// switch (input_value) {
|
|
//
|
|
// case 'delete':
|
|
// process_delete_payment();
|
|
// break;
|
|
//
|
|
// case 'foc':
|
|
// remove_input_action();
|
|
// $(".foc").attr("data-action","true");
|
|
// if(customerName.toString() != " "){ //if already chosen customer
|
|
// if($("#foc_reason_lists").attr("foc_reason") == ' '){
|
|
// alert("Please! Choose or Add FOC reason");
|
|
// foc_additional_form();
|
|
// }
|
|
// else{
|
|
// process_foc_payment();
|
|
// }
|
|
// }
|
|
// else{
|
|
// alert("Please! Choose or Save Customer");
|
|
// foc_additional_form();
|
|
// }
|
|
// break;
|
|
//
|
|
// case 'nett':
|
|
// remove_input_action();
|
|
// $(".nett").attr("data-action","true");
|
|
// if($(".credit_note_payment").hasClass("payment_selected")){
|
|
// if(customerName == " "){
|
|
// alert("Please! Choose or Save Customer");
|
|
// showCustomer();
|
|
// }
|
|
// else{
|
|
// $("#accept_payment_btn").attr("data-payment","credit");
|
|
// process_nett_payment();
|
|
// }
|
|
// }
|
|
// else{
|
|
// process_nett_payment();
|
|
// }
|
|
// break;
|
|
//
|
|
// case 'edit':
|
|
// process_edit_invoice();
|
|
// break;
|
|
//
|
|
// case 'cancel':
|
|
// remove_input_action();
|
|
// var status = $("#label_amountdue").attr("data-status");
|
|
// if (status != 'completed' && status != 'void'){
|
|
// $(".cancel").attr("data-action","true");
|
|
// var message = confirm("Are you sure to void? Please, add reason!");
|
|
// if (message == true) {
|
|
// $(".additional_form").hide();
|
|
// $("#void_sale_additional_form").show();
|
|
// process_cancel_payment();
|
|
// }
|
|
// }
|
|
// else{
|
|
// $(".cancel").addClass("dim");
|
|
// }
|
|
// break;
|
|
//
|
|
// case 'ent':
|
|
// amount_due = parseFloat($("#label_amountdue").attr("data-original"));
|
|
// other_amt = parseFloat($("#label_cash_amount").attr("data-value"));
|
|
// credit_amount = parseFloat($("#label_credit_note").text());
|
|
// if ($(".credit_note_payment").hasClass("payment_selected") && credit_amount > 0){
|
|
// if(customerName.toString() != " "){
|
|
// if(credit_amount > (amount_due - other_amt)){
|
|
// alert("You shouldn't exceed the amount due.");
|
|
// }
|
|
// else{
|
|
// $("#accept_payment_btn").attr("data-payment","credit");
|
|
// update_balance_due();
|
|
// }
|
|
// }
|
|
// else{
|
|
// alert("Please! Choose or Save Customer");
|
|
// }
|
|
// }
|
|
// else{
|
|
// update_balance_due();
|
|
// }
|
|
//
|
|
// break;
|
|
// case 'clear':
|
|
// process_clear_payment();
|
|
// break;
|
|
//
|
|
// default:
|
|
//
|
|
// var existing_value = $(".payment_selected span").text();
|
|
//
|
|
// if (existing_value == "0" || existing_value == "0.00") { existing_value = ""; }
|
|
// existing_value = existing_value + input_value;
|
|
// $(".payment_selected span").text(existing_value);
|
|
//
|
|
// }
|
|
//
|
|
//
|
|
// event.handled = true;
|
|
// } else {
|
|
// return false;
|
|
// }
|
|
// });
|