This commit is contained in:
Cherry
2017-06-12 18:28:18 +06:30
50 changed files with 1335 additions and 407 deletions

View File

@@ -5,9 +5,10 @@
//= require_self
//= require_tree ./channels
(function() {
this.App || (this.App = {});
// Temp Disable
// (function() {
// this.App || (this.App = {});
App.cable = ActionCable.createConsumer();
// App.cable = ActionCable.createConsumer();
}).call(this);
// }).call(this);

View File

@@ -28,7 +28,7 @@ $(document).ready(function(){
$("#order-Tax").text('');
$("#order-grand-total").text('');
var zone_name=$(this).find(".orders-table").text();
var zone_name=$(this).find(".orders-table").text();
var receipt_no=$(this).find(".orders-receipt-no").text();
var unique_id = $(this).find(".orders-id").text();
var order_status=$(this).find(".orders-order-status").text().trim();
@@ -37,15 +37,12 @@ $(document).ready(function(){
control_button(order_status);
//for customer button
if(unique_id.charAt(0) == 'S'){
$("#customer").removeAttr('disabled');
}else{
$("#customer").attr('disabled','disabled');
}
var customer_id=$(this).find(".customer-id").text();
show_customer_details(customer_id);
var cashier="";
var receipt_date="";
@@ -63,13 +60,7 @@ $(document).ready(function(){
type: "POST",
url: "/origami/" + unique_id,
data: { 'booking_id' : unique_id },
success:function(result){
// =======
// type: "GET",
// url: "origami/" + unique_id,
// data: { 'id' : unique_id },
// success:function(result){
// >>>>>>> 5ee3ae257a59269b651dcc5c0232b95d7f41fb77
success:function(result){
for (i = 0; i < result.length; i++) {
var data = JSON.stringify(result[i]);
var parse_data = JSON.parse(data);
@@ -86,7 +77,7 @@ $(document).ready(function(){
//Receipt Charges
sub_total += (parse_data.qty*parse_data.price);
discount_amount = parse_data.discount_amount == null? '0.0' : parse_data.discount_amount;
tax_amount = parse_data.tax_amount;
grand_total_amount = parse_data.grand_total_amount;
@@ -184,27 +175,45 @@ $(document).ready(function(){
});
$('#customer').click(function() {
var sale_id=$(".selected-item").find(".orders-id").text();
var sale = $(".selected-item").find(".orders-id").text();
if (sale.substring(0, 3)=="SAL") {
var sale_id = sale
}else{
var sale_id = $(".selected-item").find(".order-cid").text();
}
window.location.href = '/origami/'+ sale_id + "/add_customer"
return false;
});
function show_customer_details(customer_id){
$('.customer_detail').removeClass('hide');
//Start Ajax
$.ajax({
type: "GET",
url: "origami/"+customer_id+"/get_customer/",
data: {},
dataType: "json",
success: function(data) {
$("#customer_name").text(data.name);
$("#customer_name").text(data.name);
}
});
//End Ajax
}
function show_customer_details(customer_id){
$('.customer_detail').removeClass('hide');
//Start Ajax
$.ajax({
type: "GET",
url: "origami/"+customer_id+"/get_customer/",
data: {},
dataType: "json",
success: function(data) {
$("#customer_name").text(data["customer"].name);
$.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);
if (balance) {
$("#customer_amount").text(balance);
}else{
$("#customer_amount").text('00');
}
}
});
}
});
//End Ajax
}
/* For Receipt - Calculate discount or tax */
$('.cashier_number').on('click', function(event){

View File

@@ -0,0 +1,3 @@
# 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/

View File

@@ -21,8 +21,9 @@
}
.cashier_number{
height:60px;
line-height:60px;
width: 33%;
height:70px;
line-height:70px;
text-align:center;
background:#54A5AF;
// float:left;
@@ -34,8 +35,8 @@
.pay{
width: 98%;
height:210px;
line-height:210px;
height:211px;
line-height:211px;
text-align:center;
font-size:20px;
color:white;
@@ -46,7 +47,7 @@
}
.long{
width:100%;
width:49%;
}
.sold {
@@ -121,4 +122,4 @@ select.form-control {
tr.discount-item-row:hover {
background-color: #e3e3e3 !important;
}
}

View File

@@ -0,0 +1,3 @@
// Place all the styles related to the settings/orders controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/