update assets
This commit is contained in:
@@ -143,7 +143,7 @@ $(document).ready(function(){
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Payment for Bill
|
// Payment for Bill
|
||||||
$('#pay').click(function() {
|
$('#pay-bill').click(function() {
|
||||||
var sale_id=$(".selected-item").find(".orders-id").text();
|
var sale_id=$(".selected-item").find(".orders-id").text();
|
||||||
if(sale_id!=""){
|
if(sale_id!=""){
|
||||||
window.location.href = '/origami/sale/'+ sale_id + "/payment"
|
window.location.href = '/origami/sale/'+ sale_id + "/payment"
|
||||||
@@ -160,52 +160,53 @@ $(document).ready(function(){
|
|||||||
window.location.href = '/crm/customers/'+ sale_id + "/assign_sale_id"
|
window.location.href = '/crm/customers/'+ sale_id + "/assign_sale_id"
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
||||||
/* For Receipt - Calculate discount or tax */
|
/* For Receipt - Calculate discount or tax */
|
||||||
$(document).on('click', '.cashier_number', function(event){
|
$('.cashier_number').on('click', function(event){
|
||||||
if(event.handled !== true) {
|
if(event.handled !== true) {
|
||||||
var original_value=0;
|
var original_value=0;
|
||||||
original_value = $('#discount-amount').val();
|
original_value = $('#discount-amount').val();
|
||||||
|
|
||||||
var input_type = $(this).attr("data-type");
|
var input_type = $(this).attr("data-type");
|
||||||
|
|
||||||
switch (input_type) {
|
switch (input_type) {
|
||||||
case 'num':
|
case 'num':
|
||||||
var input_value = $(this).attr("data-value");
|
var input_value = $(this).attr("data-value");
|
||||||
if (original_value == "0.0"){
|
if (original_value == "0.0"){
|
||||||
$('#discount-amount').val(input_value);
|
$('#discount-amount').val(input_value);
|
||||||
|
update_balance();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$('#discount-amount').val(original_value + '' + input_value);
|
||||||
|
update_balance();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'add':
|
||||||
|
var input_value = $(this).attr("data-value");
|
||||||
|
amount = parseInt(input_value) + parseInt(original_value);
|
||||||
|
$('#discount-amount').val(amount);
|
||||||
update_balance();
|
update_balance();
|
||||||
}
|
break;
|
||||||
else{
|
|
||||||
$('#discount-amount').val(original_value + '' + input_value);
|
case 'del' :
|
||||||
|
var discount_text=$('#discount-amount').val();
|
||||||
|
$('#discount-amount').val(discount_text.substr(0,discount_text.length-1));
|
||||||
update_balance();
|
update_balance();
|
||||||
}
|
break;
|
||||||
break;
|
|
||||||
|
|
||||||
case 'add':
|
case 'clr':
|
||||||
var input_value = $(this).attr("data-value");
|
$('#discount-amount').val("0.0");
|
||||||
amount = parseInt(input_value) + parseInt(original_value);
|
update_balance();
|
||||||
$('#discount-amount').val(amount);
|
break;
|
||||||
update_balance();
|
}
|
||||||
break;
|
|
||||||
|
|
||||||
case 'del' :
|
event.handled = true;
|
||||||
var discount_text=$('#discount-amount').val();
|
} else {
|
||||||
$('#discount-amount').val(discount_text.substr(0,discount_text.length-1));
|
return false;
|
||||||
update_balance();
|
}
|
||||||
break;
|
});
|
||||||
|
|
||||||
case 'clr':
|
|
||||||
$('#discount-amount').val("0.0");
|
|
||||||
update_balance();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
event.handled = true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/* Button Control by Status */
|
/* Button Control by Status */
|
||||||
|
|||||||
@@ -1,113 +0,0 @@
|
|||||||
// $(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;
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
# Place all the behaviors and hooks related to the matching controller here.
|
|
||||||
# All this logic will automatically be available in application.js.
|
|
||||||
# You can use CoffeeScript in this file: http://coffeescript.org/
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
# Place all the behaviors and hooks related to the matching controller here.
|
|
||||||
# All this logic will automatically be available in application.js.
|
|
||||||
# You can use CoffeeScript in this file: http://coffeescript.org/
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
// Place all the styles related to the origami/paypar controller here.
|
|
||||||
// They will automatically be included in application.css.
|
|
||||||
// You can use Sass (SCSS) here: http://sass-lang.com/
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
// Place all the styles related to the origami/RequestBills controller here.
|
|
||||||
// They will automatically be included in application.css.
|
|
||||||
// You can use Sass (SCSS) here: http://sass-lang.com/
|
|
||||||
@@ -219,9 +219,9 @@
|
|||||||
<button type="button" id="request_bills" class="btn btn-primary btn-lg btn-block">Req.Bill</button>
|
<button type="button" id="request_bills" class="btn btn-primary btn-lg btn-block">Req.Bill</button>
|
||||||
<!-- Cashier Buttons -->
|
<!-- Cashier Buttons -->
|
||||||
<button type="button" id="discount" class="btn btn-primary btn-lg btn-block">Discount</button>
|
<button type="button" id="discount" class="btn btn-primary btn-lg btn-block">Discount</button>
|
||||||
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Tax</button>
|
<!-- <button type="button" class="btn btn-primary btn-lg btn-block" disabled>Tax</button> -->
|
||||||
|
|
||||||
<button type="button" id="pay" class="btn btn-primary btn-lg btn-block" >Pay</button>
|
<button type="button" id="pay-bill" class="btn btn-primary btn-lg btn-block" >Pay</button>
|
||||||
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Re.Print</button>
|
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Re.Print</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -165,42 +165,42 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(document).on('click', '.cashier_number', function(event){
|
$(document).on('click', '.cashier_number', function(event){
|
||||||
//event.stopPropagation();
|
event.stopPropagation();
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
if(event.handled !== true) {
|
if(event.handled !== true) {
|
||||||
var original_value;
|
var original_value;
|
||||||
original_value = $('#cash').text();
|
original_value = $('#cash').text();
|
||||||
|
|
||||||
var input_type = $(this).attr("data-type");
|
var input_type = $(this).attr("data-type");
|
||||||
|
|
||||||
switch (input_type) {
|
switch (input_type) {
|
||||||
case 'num':
|
case 'num':
|
||||||
var input_value = $(this).attr("data-value");
|
var input_value = $(this).attr("data-value");
|
||||||
if (original_value == "0.0"){
|
if (original_value == "0.0"){
|
||||||
$('#cash').text(input_value);
|
$('#cash').text(input_value);
|
||||||
update_balance();
|
update_balance();
|
||||||
}else{
|
}else{
|
||||||
$('#cash').append(input_value);
|
$('#cash').append(input_value);
|
||||||
update_balance();
|
update_balance();
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'add':
|
|
||||||
var input_value = $(this).attr("data-value");
|
|
||||||
amount = parseInt(input_value) + parseInt(original_value);
|
|
||||||
$('#cash').text(amount);
|
|
||||||
update_balance();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'clr':
|
|
||||||
$('#cash').text("0.0");
|
|
||||||
update_balance();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
event.handled = true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'add':
|
||||||
|
var input_value = $(this).attr("data-value");
|
||||||
|
amount = parseInt(input_value) + parseInt(original_value);
|
||||||
|
$('#cash').text(amount);
|
||||||
|
update_balance();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'clr':
|
||||||
|
$('#cash').text("0.0");
|
||||||
|
update_balance();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
event.handled = true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$( document ).ready(function() {
|
$( document ).ready(function() {
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ Rails.application.config.assets.version = '1.0'
|
|||||||
# Rails.application.config.assets.precompile += %w( search.js )
|
# Rails.application.config.assets.precompile += %w( search.js )
|
||||||
|
|
||||||
# --- Waiter/ Cashier - Orgiami ----
|
# --- Waiter/ Cashier - Orgiami ----
|
||||||
Rails.application.config.assets.precompile += %w( orgiami.css )
|
Rails.application.config.assets.precompile += %w( origami.css )
|
||||||
Rails.application.config.assets.precompile += %w( orgiami.js )
|
Rails.application.config.assets.precompile += %w( origami.js )
|
||||||
# -- Order Queue Station -----
|
# -- Order Queue Station -----
|
||||||
Rails.application.config.assets.precompile += %w( OQS.css )
|
Rails.application.config.assets.precompile += %w( OQS.css )
|
||||||
Rails.application.config.assets.precompile += %w( OQS.js )
|
Rails.application.config.assets.precompile += %w( OQS.js )
|
||||||
|
|||||||
Reference in New Issue
Block a user