Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant into pre_master

This commit is contained in:
Yan
2017-06-14 10:16:55 +06:30
52 changed files with 1332 additions and 700 deletions

View File

@@ -17,6 +17,8 @@
//= require turbolinks
//= require cable
//= require settings/processing_items
//= require jquery-ui
//= require bootstrap-datepicker
$(document).on("focus", "[data-behaviour~='datepicker']", function(e){
$(this).datepicker({"format": "yyyy-M-dd", "weekStart": 1, "autoclose": true});

View File

@@ -192,7 +192,7 @@ $(document).ready(function(){
}else{
var sale_id = $(".selected-item").find(".order-cid").text();
}
window.location.href = '/origami/'+ sale_id + "/add_customer"
window.location.href = '/origami/'+ sale_id + "/customers"
return false;
});
@@ -205,10 +205,11 @@ $(document).ready(function(){
var url = "origami/"+customer_id+"/get_customer/"
}
$('.customer_detail').removeClass('hide');
$('.customer_detail').removeClass('hide');
//Start Ajax
$.ajax({
type: "GET",
$.ajax({
type: "GET",
url: url,
data: {},
dataType: "json",
@@ -217,8 +218,16 @@ $(document).ready(function(){
$.each(data["response_data"]["data"], function (i) {
if(data["response_data"]["data"][i]["accountable_type"] == "RebateAccount"){
var balance = data["response_data"]["data"][i]["balance"];
console.log(balance);
$("#customer_amount").text(balance);
if (data["response_data"]["status"]==true) {
$('.rebate_amount').removeClass('hide');
console.log(balance);
row =
'<td class="charges-name">' + data["response_data"]["data"][i]["accountable_type"] +'</td>'
+'<td class="item-attr">' + balance + '</td>';
$(".rebate_amount").append(row);
}
}
});
}

View File

@@ -0,0 +1,40 @@
// number key pad
$(document).on('click', '.cashier_number', function(event){
event.stopPropagation();
event.preventDefault();
if(event.handled !== true) {
var original_value;
original_value = $('#amount').text();
var input_value = $(this).attr("data-value");
var input_type = $(this).attr("data-type");
switch (input_type) {
case 'num':
if (original_value == "0.0"){
$('#amount').text(input_value);
}else{
$('#amount').append(input_value);
}
break;
case 'add':
var input_value = $(this).attr("data-value");
amount = parseInt(input_value) + parseInt(original_value);
$('#amount').html(amount);
break;
case 'clr':
$('#amount').html("0.0");
break;
case 'del' :
var cash=$('#amount').text();
$('#amount').text(cash.substr(0,cash.length-1));
break;
}
event.handled = true;
} else {
return false;
}
});

View File

@@ -0,0 +1,7 @@
//= require jquery
//= require bootstrap
//= require jquery_ujs
//= require turbolinks
//= require cable
//= require jquery-ui
//= require bootstrap-datepicker

View File

@@ -2,6 +2,8 @@
@import "bootstrap";
@import "font-awesome";
@import "theme";
@import "jquery-ui";
@import "bootstrap-datepicker3";
/* Show it is fixed to the top */

View File

@@ -0,0 +1,5 @@
@import "bootstrap";
@import "font-awesome";
@import "theme";
@import "jquery-ui";
@import "bootstrap-datepicker3";