Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant into ui_ux_changes
This commit is contained in:
24
README.md
24
README.md
@@ -8,27 +8,20 @@ Things you may want to cover:
|
|||||||
ruby 2.4.1p111
|
ruby 2.4.1p111
|
||||||
|
|
||||||
* Membership Details
|
* Membership Details
|
||||||
|
Osaka =>
|
||||||
Osaka
|
Auth Token => wu8YvlLmah0CL => New => v3
|
||||||
|
=> rj0MJ0XI5GsKZehE => Old => v
|
||||||
Auth Token => wu8YvlLmah0CL => New ##note : Old => rj0MJ0XI5GsKZehE
|
|
||||||
|
|
||||||
=> code2lab => Old
|
=> code2lab => Old
|
||||||
|
|
||||||
Merchant account => RxzaYyAGzm7VqAZ4hKnv
|
Merchant account => RxzaYyAGzm7VqAZ4hKnv
|
||||||
|
|
||||||
Campaign Id => {"campaign_type_id": 5}
|
Campaign Id => {"campaign_type_id": 5}
|
||||||
|
|
||||||
|
BITP
|
||||||
|
Auth Token => pZBHXEFbGNj/G => New => V3
|
||||||
BITP
|
=> rj0MJ0XI5GsKZehE => Old => V2
|
||||||
|
|
||||||
Auth Token => pZBHXEFbGNj/G => New ##note : Old => rj0MJ0XI5GsKZehE
|
|
||||||
|
|
||||||
=> code2lab => Old
|
=> code2lab => Old
|
||||||
|
|
||||||
Merchant account => vWSsseoZCzxd6xcNf_uS
|
Merchant account => vWSsseoZCzxd6xcNf_uS
|
||||||
|
|
||||||
Campaign Id => {"campaign_type_id": 1}
|
Campaign Id => {"campaign_type_id": 1}
|
||||||
|
|
||||||
java -jar ~/Documents/Jade.jar http://192.168.1.88:3002
|
java -jar ~/Documents/Jade.jar http://192.168.1.88:3002
|
||||||
@@ -106,6 +99,11 @@ Change type in mysql
|
|||||||
For split bill
|
For split bill
|
||||||
1) settings/lookups => { type:split_bill, name:SplitBill, value:1 }
|
1) settings/lookups => { type:split_bill, name:SplitBill, value:1 }
|
||||||
|
|
||||||
|
For Sidekiq
|
||||||
|
1) If you want to use sidekiq
|
||||||
|
=> Create New Lookups => lookup_type = sidekiq, Name = sidekiq , Value = 1 or 0
|
||||||
|
|
||||||
|
For Check CUp status
|
||||||
###please open
|
###please open
|
||||||
sudo cat /etc/sudoers
|
sudo cat /etc/sudoers
|
||||||
### cope and parse
|
### cope and parse
|
||||||
|
|||||||
BIN
app/assets/images/slider/s1.jpg
Normal file
BIN
app/assets/images/slider/s1.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 199 KiB |
BIN
app/assets/images/slider/s2.jpg
Normal file
BIN
app/assets/images/slider/s2.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 81 KiB |
BIN
app/assets/images/slider/s3.jpg
Normal file
BIN
app/assets/images/slider/s3.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 120 KiB |
BIN
app/assets/images/slider/s4.jpg
Normal file
BIN
app/assets/images/slider/s4.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
@@ -366,6 +366,10 @@ $(function() {
|
|||||||
var items = $('.selected-instance');
|
var items = $('.selected-instance');
|
||||||
|
|
||||||
if (items.length >= min_qty) {
|
if (items.length >= min_qty) {
|
||||||
|
|
||||||
|
item = get_set_item(items);
|
||||||
|
customer_display_view(item,"set_add");
|
||||||
|
|
||||||
attribute_arr = []
|
attribute_arr = []
|
||||||
option_arr = []
|
option_arr = []
|
||||||
|
|
||||||
@@ -400,6 +404,7 @@ $(function() {
|
|||||||
price = $(items[i]).attr('data-price');
|
price = $(items[i]).attr('data-price');
|
||||||
option = $(items[i]).attr('data-options');
|
option = $(items[i]).attr('data-options');
|
||||||
sub_item = $(items[i]).attr('data-sub-item');
|
sub_item = $(items[i]).attr('data-sub-item');
|
||||||
|
option = $(items[i]).attr('data-options');
|
||||||
total = qty * price ;
|
total = qty * price ;
|
||||||
option_arr.push(option);
|
option_arr.push(option);
|
||||||
row ="<tr class='item_box' data-price ='"
|
row ="<tr class='item_box' data-price ='"
|
||||||
@@ -684,6 +689,8 @@ $(function() {
|
|||||||
$('.add_to_order').attr('data-attributes',JSON.stringify(attribute_arr));
|
$('.add_to_order').attr('data-attributes',JSON.stringify(attribute_arr));
|
||||||
$('.add_to_order').attr('data-options',JSON.stringify(option_arr));
|
$('.add_to_order').attr('data-options',JSON.stringify(option_arr));
|
||||||
var item_data = $(this);
|
var item_data = $(this);
|
||||||
|
item = get_item(item_data);
|
||||||
|
customer_display_view(item,"add");
|
||||||
show_item_detail(item_data);
|
show_item_detail(item_data);
|
||||||
calculate_sub_total();
|
calculate_sub_total();
|
||||||
|
|
||||||
@@ -692,6 +699,8 @@ $(function() {
|
|||||||
// click plus icon for add
|
// click plus icon for add
|
||||||
$(document).on('click', '.add_icon', function(event){
|
$(document).on('click', '.add_icon', function(event){
|
||||||
var item_data = $(this);
|
var item_data = $(this);
|
||||||
|
item = get_item(item_data);
|
||||||
|
customer_display_view(item,"add");
|
||||||
show_item_detail(item_data);
|
show_item_detail(item_data);
|
||||||
calculate_sub_total();
|
calculate_sub_total();
|
||||||
}); //End Add Icon Click
|
}); //End Add Icon Click
|
||||||
@@ -709,14 +718,22 @@ $(function() {
|
|||||||
instance = "("+data.attr('data-instance')+")";
|
instance = "("+data.attr('data-instance')+")";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
d_option = data.attr('data-options');
|
||||||
|
if (d_option){
|
||||||
|
option_name = "-"+data.attr('data-options');
|
||||||
|
}else{
|
||||||
|
option_name = '';
|
||||||
|
}
|
||||||
|
|
||||||
var rowCount = $('.summary-items tbody tr').length+1;
|
var rowCount = $('.summary-items tbody tr').length+1;
|
||||||
var item_row = $('.summary-items tbody tr');
|
var item_row = $('.summary-items tbody tr');
|
||||||
|
|
||||||
$(item_row).each(function(i){
|
$(item_row).each(function(i){
|
||||||
item_code = $(item_row[i]).attr('data-code');
|
item_code = $(item_row[i]).attr('data-code');
|
||||||
instance_code = $(item_row[i]).attr('data-instance-code');
|
instance_code = $(item_row[i]).attr('data-instance-code');
|
||||||
|
r_option = $(item_row[i]).attr('data-options');
|
||||||
|
|
||||||
if (item_code == data.attr('data-item-code') && instance_code == data.attr('data-instance-code')) {
|
if (item_code == data.attr('data-item-code') && instance_code == data.attr('data-instance-code')&&r_option==d_option) {
|
||||||
if (qty > 1) {
|
if (qty > 1) {
|
||||||
qty = parseInt($(item_row[i]).children('#item_qty').text()) + qty;
|
qty = parseInt($(item_row[i]).children('#item_qty').text()) + qty;
|
||||||
}else{
|
}else{
|
||||||
@@ -742,7 +759,7 @@ $(function() {
|
|||||||
+data.attr('data-attributes')+"' data-options ='"
|
+data.attr('data-attributes')+"' data-options ='"
|
||||||
+data.attr('data-options')+"' data-row ='"+rowCount+ "'>"
|
+data.attr('data-options')+"' data-row ='"+rowCount+ "'>"
|
||||||
+'<td class="item-cell-no">'+rowCount+'</td>'
|
+'<td class="item-cell-no">'+rowCount+'</td>'
|
||||||
+'<td class="item-cell-name" id="item_name" >' + data.attr('data-name')+ ' ' + instance +'</td>'
|
+'<td class="item-cell-name" id="item_name" >' + data.attr('data-name')+ ' ' + instance +' ' + option_name +'</td>'
|
||||||
+'<td class="item-cell-qty" id="item_qty">' + qty + '</td>'
|
+'<td class="item-cell-qty" id="item_qty">' + qty + '</td>'
|
||||||
+'<td class="item-cell-price" id="item_price">'
|
+'<td class="item-cell-price" id="item_price">'
|
||||||
+ parseFloat(price).toFixed(2)
|
+ parseFloat(price).toFixed(2)
|
||||||
@@ -759,8 +776,8 @@ $(function() {
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
$("#oqs_loading_wrapper").show();
|
$("#oqs_loading_wrapper").show();
|
||||||
|
|
||||||
type = window.location.href.indexOf("quick_service");
|
quick_service = window.location.href.indexOf("quick_service");
|
||||||
if (type != -1) {
|
if (quick_service != -1) {
|
||||||
type = 'quick_service'
|
type = 'quick_service'
|
||||||
var table_type = $('#table_type').text();
|
var table_type = $('#table_type').text();
|
||||||
var table_id = $('#table_id').val();
|
var table_id = $('#table_id').val();
|
||||||
@@ -796,6 +813,8 @@ $(function() {
|
|||||||
data: params,
|
data: params,
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
success:function(result){
|
success:function(result){
|
||||||
|
console.log(type)
|
||||||
|
console.log(table_type)
|
||||||
if (type == "quick_service") {
|
if (type == "quick_service") {
|
||||||
window.location.href = "/origami/quick_service"
|
window.location.href = "/origami/quick_service"
|
||||||
}else{
|
}else{
|
||||||
@@ -806,6 +825,7 @@ $(function() {
|
|||||||
window.location.href = "/origami/room/" + table_id
|
window.location.href = "/origami/room/" + table_id
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
customer_display_view(null,"reload");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// }else{
|
// }else{
|
||||||
@@ -824,9 +844,7 @@ $(function() {
|
|||||||
type = "quick_service"
|
type = "quick_service"
|
||||||
modify_order = window.location.href.indexOf("modify_order");
|
modify_order = window.location.href.indexOf("modify_order");
|
||||||
$("#oqs_loading_wrapper").show();
|
$("#oqs_loading_wrapper").show();
|
||||||
console.log(modify_order)
|
|
||||||
if (modify_order !=-1) {
|
if (modify_order !=-1) {
|
||||||
console.log($('#sale_id').text())
|
|
||||||
var ajax_url = '../../../quick_service/update_modify_order';
|
var ajax_url = '../../../quick_service/update_modify_order';
|
||||||
var table_type = $('#table_type').text();
|
var table_type = $('#table_type').text();
|
||||||
var table_id = $('#table_id').text();
|
var table_id = $('#table_id').text();
|
||||||
@@ -861,7 +879,6 @@ $(function() {
|
|||||||
data: params,
|
data: params,
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
success:function(result){
|
success:function(result){
|
||||||
console.log(result)
|
|
||||||
if (result.status) {
|
if (result.status) {
|
||||||
if (result.data == null){
|
if (result.data == null){
|
||||||
window.location.href = '/origami/quick_service/pending_order/' + $('#sale_id').text();
|
window.location.href = '/origami/quick_service/pending_order/' + $('#sale_id').text();
|
||||||
@@ -1152,6 +1169,67 @@ $(function() {
|
|||||||
});
|
});
|
||||||
//end Ajax
|
//end Ajax
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Get Item rows */
|
||||||
|
function get_item(data){
|
||||||
|
var sale_items = [];
|
||||||
|
|
||||||
|
var sale_item = {};
|
||||||
|
sale_item.qty = parseInt(data.attr('data-qty'))
|
||||||
|
sale_item.name = data.attr('data-name');
|
||||||
|
sale_item.price = data.attr('data-price');
|
||||||
|
sale_item.item_code = data.attr('data-item-code')
|
||||||
|
sale_item.instance_code = data.attr('data-instance-code')
|
||||||
|
sale_item.attributes = data.attr('data-attributes')
|
||||||
|
sale_item.options = data.attr('data-options')
|
||||||
|
sale_item.instance = data.attr('data-instance')
|
||||||
|
sale_items.push(sale_item);
|
||||||
|
|
||||||
|
return sale_items;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Get Item rows */
|
||||||
|
function get_set_item(items){
|
||||||
|
var sale_items = [];
|
||||||
|
var item = {};
|
||||||
|
item.code = $('.set-item').attr('data-code');
|
||||||
|
item.name = $('.set-item').attr('data-name');
|
||||||
|
item.item_name = $('#set_name').text();
|
||||||
|
item.qty = parseInt($('#set_count').val());
|
||||||
|
item.item_code = $('#set_item_code').text();
|
||||||
|
item.price = $('.set-item').attr('data-price');
|
||||||
|
item.option = $('.set-item').attr('data-options');
|
||||||
|
item.parent = $('.set-item').attr('data-parent');
|
||||||
|
|
||||||
|
sale_items.push(item);
|
||||||
|
|
||||||
|
$(items).each(function(i){
|
||||||
|
var sale_item = {};
|
||||||
|
sale_item.code = $(items[i]).attr('data-code');
|
||||||
|
sale_item.name = $(items[i]).attr('data-name');
|
||||||
|
sale_item.item_name = $('#set_name').text();
|
||||||
|
sale_item.qty = parseInt($('#set_count').val());
|
||||||
|
sale_item.item_code = $('#set_item_code').text();
|
||||||
|
sale_item.price = $(items[i]).attr('data-price');
|
||||||
|
sale_item.option = $(items[i]).attr('data-options');
|
||||||
|
sale_item.sub_item = $(items[i]).attr('data-sub-item');
|
||||||
|
sale_items.push(sale_item);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
return sale_items;
|
||||||
|
}
|
||||||
|
|
||||||
|
function customer_display_view(data,status) {
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
url: '../../origami/customer_view',
|
||||||
|
data: {"data":data,"status":status},
|
||||||
|
dataType: "json",
|
||||||
|
success:function(result){
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
/* $("input").keypress(function(){
|
/* $("input").keypress(function(){
|
||||||
$("span").text(i += 1);
|
$("span").text(i += 1);
|
||||||
});*/
|
});*/
|
||||||
|
|||||||
38
app/assets/javascripts/channels/second_display.js
Normal file
38
app/assets/javascripts/channels/second_display.js
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
App.checkin = App.cable.subscriptions.create('SecondDisplayChannel', {
|
||||||
|
// App.messages = App.cable.subscriptions.create('MessagesChannel', {
|
||||||
|
|
||||||
|
connected: function() {},
|
||||||
|
|
||||||
|
disconnected: function() {},
|
||||||
|
|
||||||
|
received: function(data) {
|
||||||
|
var data_obj = data.data;
|
||||||
|
var status = data.status;
|
||||||
|
var count = 0
|
||||||
|
var sub_total = 0
|
||||||
|
if (data.status == "order") {
|
||||||
|
for(var i in data_obj) {
|
||||||
|
|
||||||
|
sub_total = sub_total + (data_obj[i].price * data_obj[i].qty)
|
||||||
|
count += 1
|
||||||
|
row ='<tr>'
|
||||||
|
+'<td>'+count+'</td>'
|
||||||
|
+'<td class="item-name">'+data_obj[i].item_name+'</td>'
|
||||||
|
+'<td class="item-attr">'+data_obj[i].qty +'</td>'
|
||||||
|
+ '<td class="item-attr">'+data_obj[i].qty*data_obj[i].price +'</td>'
|
||||||
|
+'</tr>'
|
||||||
|
$(".second_display_items").append(row);
|
||||||
|
}//end looping
|
||||||
|
}else{
|
||||||
|
$('#s_sub_total').empty();
|
||||||
|
$('#s_sub_total').append(data_obj.total_amount);
|
||||||
|
$('#s_total_discount').empty();
|
||||||
|
$('#s_total_discount').append(data_obj.total_discount);
|
||||||
|
$('#s_tatal_tax').empty();
|
||||||
|
$('#s_tatal_tax').append(data_obj.total_tax);
|
||||||
|
$('#s_grand_total').empty();
|
||||||
|
$('#s_grand_total').append(data_obj.grand_total);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
156
app/assets/javascripts/channels/second_display_view.js
Normal file
156
app/assets/javascripts/channels/second_display_view.js
Normal file
@@ -0,0 +1,156 @@
|
|||||||
|
App.checkin = App.cable.subscriptions.create('SecondDisplayViewChannel', {
|
||||||
|
// App.messages = App.cable.subscriptions.create('MessagesChannel', {
|
||||||
|
|
||||||
|
connected: function() {},
|
||||||
|
|
||||||
|
disconnected: function() {},
|
||||||
|
|
||||||
|
received: function(data) {
|
||||||
|
var items = data.data;
|
||||||
|
var tax = data.tax_profiles;
|
||||||
|
var status= data.status
|
||||||
|
if (status == "reload") {
|
||||||
|
jQuery('#s_reload').click();
|
||||||
|
}
|
||||||
|
$('#second_display_slider').addClass("hidden")
|
||||||
|
$('#second_display_items').removeClass("hidden")
|
||||||
|
|
||||||
|
|
||||||
|
// append items
|
||||||
|
if (status == "add") {
|
||||||
|
for(var i in items) {
|
||||||
|
qty = parseInt(items[i].qty);
|
||||||
|
append = 0;
|
||||||
|
price = items[i].price;
|
||||||
|
|
||||||
|
instance_name = items[i].instance;
|
||||||
|
if (instance_name == "undefined"){
|
||||||
|
instance = '';
|
||||||
|
}else{
|
||||||
|
instance = "("+items[i].instance+")";
|
||||||
|
}
|
||||||
|
|
||||||
|
d_option = items[i].options;
|
||||||
|
if (d_option){
|
||||||
|
option_name = "-"+items[i].options;
|
||||||
|
}else{
|
||||||
|
option_name = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
var rowCount = $('.second_display_items tbody tr').length+1;
|
||||||
|
var item_row = $('.second_display_items tbody tr');
|
||||||
|
|
||||||
|
$(item_row).each(function(j){
|
||||||
|
var item_code = $(item_row[j]).attr('data-code');
|
||||||
|
var instance_code = $(item_row[j]).attr('data-instance-code');
|
||||||
|
var r_option = $(item_row[j]).attr('data-options');
|
||||||
|
if (item_code == items[i].item_code && instance_code == items[i].instance_code && r_option==d_option) {
|
||||||
|
if (qty > 1) {
|
||||||
|
qty = parseInt($(item_row[j]).children('#item_qty').text()) + qty;
|
||||||
|
}else{
|
||||||
|
qty = parseInt($(item_row[j]).children('#item_qty').text()) + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
$(item_row[j]).children('#item_qty').text(qty);
|
||||||
|
parseFloat($(item_row[j]).children('#item_price').text(parseFloat(price*qty).toFixed(2)));
|
||||||
|
append =1;
|
||||||
|
}else{
|
||||||
|
if (qty > 1) {
|
||||||
|
qty = qty;
|
||||||
|
}else{
|
||||||
|
qty = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (append===0) {
|
||||||
|
row ="<tr class='item_box' data-price ='"
|
||||||
|
+price+ "' 'data-instance ='"
|
||||||
|
+instance+ "' data-code='"+items[i].item_code+"' data-instance-code='"
|
||||||
|
+items[i].instance_code+"' data-attributes='"
|
||||||
|
+items[i].attributes+"' data-options ='"
|
||||||
|
+items[i].options+"' data-row ='"+rowCount+ "'>"
|
||||||
|
+'<td class="item-cell-no">'+rowCount+'</td>'
|
||||||
|
+'<td class="item-cell-name" id="item_name" >' + items[i].name+ ' ' + instance + ' ' + option_name +'</td>'
|
||||||
|
+'<td class="item-cell-qty" id="item_qty">' + qty + '</td>'
|
||||||
|
+'<td class="item-cell-price" id="item_price">'
|
||||||
|
+ parseFloat(price).toFixed(2)
|
||||||
|
+'</td>'
|
||||||
|
+'</tr>';
|
||||||
|
$(".second_display_items tbody").append(row);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (status == "set_add") {
|
||||||
|
// var option_arr = [];
|
||||||
|
var attribute_arr = [];
|
||||||
|
var rowCount = $('.second_display_items tbody tr').length+1;
|
||||||
|
for(var i in items) {
|
||||||
|
code = items[i].code;
|
||||||
|
item_code = items[i].item_code;
|
||||||
|
name = items[i].name;
|
||||||
|
item_name = items[i].item_name;
|
||||||
|
qty = items[i].qty;
|
||||||
|
price = items[i].price;
|
||||||
|
option = items[i].option;
|
||||||
|
sub_item = items[i].sub_item;
|
||||||
|
total = qty * price ;
|
||||||
|
// option_arr.push(option);
|
||||||
|
row ="<tr class='item_box' data-price ='"
|
||||||
|
+price+ "' data-toggle='modal' data-target='#sx_itemModal' 'data-instance ='"
|
||||||
|
+name+ "' data-code='"+item_code+"' data-instance-code='"
|
||||||
|
+code+"' data-attributes='"
|
||||||
|
+attribute_arr+"' data-options ='"
|
||||||
|
+option+"' data-row ='"+rowCount+ "' data-sub-item ='"+sub_item+ "'>"
|
||||||
|
+'<td class="item-cell-no">'+rowCount+'</td>'
|
||||||
|
+'<td class="item-cell-name" id="item_name" >' + item_name+ ' ' + name + ''+option+'</td>'
|
||||||
|
+'<td class="item-cell-qty" id="item_qty">' + qty + '</td>'
|
||||||
|
+'<td class="item-cell-price" id="item_price">'
|
||||||
|
+ parseFloat(total).toFixed(2)
|
||||||
|
+'</td>'
|
||||||
|
+'</tr>';
|
||||||
|
$(".second_display_items tbody").append(row);
|
||||||
|
rowCount = rowCount + 1;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//end apend items
|
||||||
|
var total_price = 0;
|
||||||
|
var taxable_amount = 0;
|
||||||
|
var total_discount = 0
|
||||||
|
var total_tax_amount = 0
|
||||||
|
var item_row = $('.second_display_items tbody tr');
|
||||||
|
//calculate Sub Total
|
||||||
|
$(item_row).each(function(i){
|
||||||
|
var unit_price = parseFloat($(item_row[i]).attr('data-price'));
|
||||||
|
var qty = parseFloat($(item_row[i]).children('#item_qty').text());
|
||||||
|
total_price += qty*unit_price;
|
||||||
|
});
|
||||||
|
//calculate Tax Amount
|
||||||
|
for(var i in tax) {
|
||||||
|
// substract , to give after discount
|
||||||
|
var total_tax = total_price - total_discount
|
||||||
|
// include or execulive
|
||||||
|
if (tax[i].inclusive){
|
||||||
|
rate = tax[i].rate
|
||||||
|
divided_value = (100 + rate)/rate
|
||||||
|
total_tax_amount = total_tax_amount + (total_tax / divided_value)
|
||||||
|
}else{
|
||||||
|
total_tax_amount = total_tax_amount + (total_tax * tax[i].rate / 100)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//end calculate Tax amount
|
||||||
|
var fixed_total_price = parseFloat(total_price).toFixed(2);
|
||||||
|
var fixed_taxable_amount = parseFloat(total_tax_amount).toFixed(2);
|
||||||
|
var fixed_grand_total = parseFloat(total_price + total_tax_amount).toFixed(2);
|
||||||
|
|
||||||
|
$('#s_sub_total').empty();
|
||||||
|
$('#s_sub_total').append(fixed_total_price);
|
||||||
|
$('#s_tatal_tax').empty();
|
||||||
|
$('#s_tatal_tax').append(fixed_taxable_amount);
|
||||||
|
$('#s_grand_total').empty();
|
||||||
|
$('#s_grand_total').append(fixed_grand_total);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
1
app/assets/javascripts/wow_script.js
Normal file
1
app/assets/javascripts/wow_script.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
jQuery("#wowslider-container").wowSlider({effect:"rotate",prev:"",next:"",duration:20*100,delay:20*100,width:580,height:212,autoPlay:true,stopOnHover:false,loop:false,bullets:true,caption:true,captionEffect:"slide",controls:true,logo:"",images:0});
|
||||||
337
app/assets/javascripts/wowslider.js
Normal file
337
app/assets/javascripts/wowslider.js
Normal file
@@ -0,0 +1,337 @@
|
|||||||
|
// -----------------------------------------------------------------------------------
|
||||||
|
// http://wowslider.com/
|
||||||
|
// JavaScript Wow Slider is a free software that helps you easily generate delicious
|
||||||
|
// slideshows with gorgeous transition effects, in a few clicks without writing a single line of code.
|
||||||
|
// Generated by WOW Slider 2.7
|
||||||
|
jQuery.fn.wowSlider = function (d) {
|
||||||
|
var e = jQuery;
|
||||||
|
var h = this;
|
||||||
|
var t = h.get(0);
|
||||||
|
d = e.extend({
|
||||||
|
prev: "",
|
||||||
|
next: "",
|
||||||
|
duration: 1000,
|
||||||
|
delay: 20 * 100,
|
||||||
|
width: 960,
|
||||||
|
height: 360,
|
||||||
|
controls: true,
|
||||||
|
autoPlay: true,
|
||||||
|
bullets: true,
|
||||||
|
}, d);
|
||||||
|
var a = e(".ws_images", h);
|
||||||
|
var l = a.find("ul");
|
||||||
|
|
||||||
|
function u(D) {
|
||||||
|
l.css({
|
||||||
|
left: -D + "00%"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
e("<div>")
|
||||||
|
.css({
|
||||||
|
width: "100%",
|
||||||
|
visibility: "hidden",
|
||||||
|
"font-size": 0,
|
||||||
|
"line-height": 0
|
||||||
|
})
|
||||||
|
.append(a.find("li:first img:first")
|
||||||
|
.clone()
|
||||||
|
.css({
|
||||||
|
width: "100%"
|
||||||
|
}))
|
||||||
|
.prependTo(a);
|
||||||
|
l.css({
|
||||||
|
position: "absolute",
|
||||||
|
top: 0,
|
||||||
|
animation: "none",
|
||||||
|
"-moz-animation": "none",
|
||||||
|
"-webkit-animation": "none"
|
||||||
|
});
|
||||||
|
var m = a.find("li");
|
||||||
|
var v = m.length;
|
||||||
|
|
||||||
|
function i(D) {
|
||||||
|
return ((D || 0) + v) % v
|
||||||
|
}
|
||||||
|
var C = navigator.userAgent;
|
||||||
|
if ((e.browser.msie && parseInt(e.browser.version, 10) < 8) || (/Safari/.test(C))) {
|
||||||
|
var b = Math.pow(10, Math.ceil(Math.LOG10E * Math.log(v)));
|
||||||
|
l.css({
|
||||||
|
width: b + "00%"
|
||||||
|
});
|
||||||
|
m.css({
|
||||||
|
width: 100 / b + "%"
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
l.css({
|
||||||
|
width: v + "00%",
|
||||||
|
display: "table"
|
||||||
|
});
|
||||||
|
m.css({
|
||||||
|
display: "table-cell",
|
||||||
|
"float": "none",
|
||||||
|
width: "auto"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
u(0);
|
||||||
|
var k = [];
|
||||||
|
m.each(function (D) {
|
||||||
|
var F = e(">img:first,>a:first,>div:first", this)
|
||||||
|
.get(0);
|
||||||
|
var G = e("<div></div>");
|
||||||
|
for (var E = 0; E < this.childNodes.length;) {
|
||||||
|
if (this.childNodes[E] != F) {
|
||||||
|
G.append(this.childNodes[E])
|
||||||
|
} else {
|
||||||
|
E++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!e(this)
|
||||||
|
.data("descr")) {
|
||||||
|
e(this)
|
||||||
|
.data("descr", G.html()
|
||||||
|
.replace(/^\s+|\s+$/g, ""))
|
||||||
|
}
|
||||||
|
e(this)
|
||||||
|
.css({
|
||||||
|
"font-size": 0
|
||||||
|
});
|
||||||
|
k[k.length] = e(">a>img", this)
|
||||||
|
.get(0) || e(">*", this)
|
||||||
|
.get(0)
|
||||||
|
});
|
||||||
|
k = e(k);
|
||||||
|
k.css("visibility", "visible");
|
||||||
|
|
||||||
|
function f(F, D, E) {
|
||||||
|
this.go = function (G) {
|
||||||
|
E.find("ul")
|
||||||
|
.stop(true)
|
||||||
|
.animate({
|
||||||
|
left: (G ? -G + "00%" : (/Safari/.test(navigator.userAgent) ? "0%" : 0))
|
||||||
|
}, F.duration, "easeInOutExpo");
|
||||||
|
return G
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var o = new f(d, k, a);
|
||||||
|
var c = 0;
|
||||||
|
|
||||||
|
function r(F, E, D) {
|
||||||
|
if (isNaN(F)) {
|
||||||
|
F = c + 1
|
||||||
|
}
|
||||||
|
F = i(F);
|
||||||
|
if (c == F) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
s(F, E, D)
|
||||||
|
}
|
||||||
|
function s(F, E, D) {
|
||||||
|
var F = o.go(F, c, E, D);
|
||||||
|
if (F < 0) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
q(F);
|
||||||
|
j(m[F]);
|
||||||
|
c = F;
|
||||||
|
z()
|
||||||
|
}
|
||||||
|
var B = h.find(".ws_bullets");
|
||||||
|
|
||||||
|
function q(D) {
|
||||||
|
if (B.length) {
|
||||||
|
n(D)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var p;
|
||||||
|
|
||||||
|
function z(D) {
|
||||||
|
w();
|
||||||
|
if (d.autoPlay) {
|
||||||
|
p = setTimeout(function () {
|
||||||
|
r()
|
||||||
|
}, d.delay + (D ? 0 : d.duration))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function w() {
|
||||||
|
if (p) {
|
||||||
|
clearTimeout(p)
|
||||||
|
}
|
||||||
|
p = null
|
||||||
|
}
|
||||||
|
function y(G, F, E, D) {
|
||||||
|
w();
|
||||||
|
G.preventDefault();
|
||||||
|
r(F, E, D);
|
||||||
|
z()
|
||||||
|
}
|
||||||
|
if (d.controls) {
|
||||||
|
var x = e('<a href="#" class="ws_next">' + d.next + "</a>");
|
||||||
|
var g = e('<a href="#" class="ws_prev">' + d.prev + "</a>");
|
||||||
|
h.append(x);
|
||||||
|
h.append(g);
|
||||||
|
x.bind("click", function (D) {
|
||||||
|
y(D, c + 1)
|
||||||
|
});
|
||||||
|
g.bind("click", function (D) {
|
||||||
|
y(D, c - 1)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
function A() {
|
||||||
|
h.find(".ws_bullets a")
|
||||||
|
.click(function (L) {
|
||||||
|
y(L, e(this)
|
||||||
|
.index())
|
||||||
|
});
|
||||||
|
if (B.length) {
|
||||||
|
var F = B.find(">div");
|
||||||
|
var K = e("a", B);
|
||||||
|
var I = K.find("IMG");
|
||||||
|
if (I.length) {
|
||||||
|
var H = e('<div class="ws_bulframe"/>')
|
||||||
|
.appendTo(F);
|
||||||
|
var E = e("<div/>")
|
||||||
|
.css({
|
||||||
|
width: I.length + 1 + "00%"
|
||||||
|
})
|
||||||
|
.appendTo(e("<div/>")
|
||||||
|
.appendTo(H));
|
||||||
|
I.appendTo(E);
|
||||||
|
e("<span/>")
|
||||||
|
.appendTo(H);
|
||||||
|
var G = -1;
|
||||||
|
|
||||||
|
function J(N) {
|
||||||
|
if (N < 0) {
|
||||||
|
N = 0
|
||||||
|
}
|
||||||
|
e(K.get(G))
|
||||||
|
.removeClass("ws_overbull");
|
||||||
|
e(K.get(N))
|
||||||
|
.addClass("ws_overbull");
|
||||||
|
H.show();
|
||||||
|
var O = {
|
||||||
|
left: K.get(N)
|
||||||
|
.offsetLeft - H.width() / 2,
|
||||||
|
"margin-top": K.get(N)
|
||||||
|
.offsetTop - K.get(0)
|
||||||
|
.offsetTop + "px",
|
||||||
|
"margin-bottom": -K.get(N)
|
||||||
|
.offsetTop + K.get(K.length - 1)
|
||||||
|
.offsetTop + "px"
|
||||||
|
};
|
||||||
|
var M = I.get(N);
|
||||||
|
var L = {
|
||||||
|
left: -M.offsetLeft + (e(M)
|
||||||
|
.outerWidth(true) - e(M)
|
||||||
|
.outerWidth()) / 2
|
||||||
|
};
|
||||||
|
if (G < 0) {
|
||||||
|
H.css(O);
|
||||||
|
E.css(L)
|
||||||
|
} else {
|
||||||
|
if (!document.all) {
|
||||||
|
O.opacity = 1
|
||||||
|
}
|
||||||
|
H.stop()
|
||||||
|
.animate(O, "fast");
|
||||||
|
E.stop()
|
||||||
|
.animate(L, "fast")
|
||||||
|
}
|
||||||
|
G = N
|
||||||
|
}
|
||||||
|
K.hover(function () {
|
||||||
|
J(e(this)
|
||||||
|
.index())
|
||||||
|
});
|
||||||
|
var D;
|
||||||
|
F.hover(function () {
|
||||||
|
if (D) {
|
||||||
|
clearTimeout(D);
|
||||||
|
D = 0
|
||||||
|
}
|
||||||
|
J(G)
|
||||||
|
}, function () {
|
||||||
|
K.removeClass("ws_overbull");
|
||||||
|
if (document.all) {
|
||||||
|
if (!D) {
|
||||||
|
D = setTimeout(function () {
|
||||||
|
H.hide();
|
||||||
|
D = 0
|
||||||
|
}, 400)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
H.stop()
|
||||||
|
.animate({
|
||||||
|
opacity: 0
|
||||||
|
}, {
|
||||||
|
duration: "fast",
|
||||||
|
complete: function () {
|
||||||
|
H.hide()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
F.click(function (L) {
|
||||||
|
y(L, e(L.target)
|
||||||
|
.index())
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function n(D) {
|
||||||
|
e("A", B)
|
||||||
|
.each(function (E) {
|
||||||
|
if (E == D) {
|
||||||
|
e(this)
|
||||||
|
.addClass("ws_selbull")
|
||||||
|
} else {
|
||||||
|
e(this)
|
||||||
|
.removeClass("ws_selbull")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
h.append("<div class='ws-title' style='display:none'></div>");
|
||||||
|
|
||||||
|
function j(E) {
|
||||||
|
var G = e("img", E)
|
||||||
|
.attr("title");
|
||||||
|
var F = e(E)
|
||||||
|
.data("descr");
|
||||||
|
var D = e(".ws-title", h);
|
||||||
|
D.stop(1, 1)
|
||||||
|
.stop(1, 1)
|
||||||
|
.fadeOut(1000 / 3, function () {
|
||||||
|
if (G || F) {
|
||||||
|
D.html((G ? "<span>" + G + "</span>" : "") + (F ? "<div>" + F + "</div>" : ""));
|
||||||
|
D.fadeIn(400, function () {
|
||||||
|
if (e.browser.msie) {
|
||||||
|
e(this)
|
||||||
|
.get(0)
|
||||||
|
.style.removeAttribute("filter")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if (B.length) {
|
||||||
|
A()
|
||||||
|
}
|
||||||
|
q(c);
|
||||||
|
j(m[c]);
|
||||||
|
z(1);
|
||||||
|
return this
|
||||||
|
};
|
||||||
|
jQuery.extend(jQuery.easing, {
|
||||||
|
easeInOutExpo: function (e, f, a, h, g) {
|
||||||
|
if (f == 0) {
|
||||||
|
return a
|
||||||
|
}
|
||||||
|
if (f == g) {
|
||||||
|
return a + h
|
||||||
|
}
|
||||||
|
if ((f /= g / 2) < 1) {
|
||||||
|
return h / 2 * Math.pow(2, 10 * (f - 1)) + a
|
||||||
|
}
|
||||||
|
return h / 2 * (-Math.pow(2, - 10 * --f) + 2) + a
|
||||||
|
}
|
||||||
|
});
|
||||||
220
app/assets/stylesheets/wow_style.css
Normal file
220
app/assets/stylesheets/wow_style.css
Normal file
@@ -0,0 +1,220 @@
|
|||||||
|
/*
|
||||||
|
* generated by WOW Slider 2.5
|
||||||
|
* template Quiet
|
||||||
|
*/
|
||||||
|
@import url("http://fonts.googleapis.com/css?family=Oswald");
|
||||||
|
#wowslider-container {
|
||||||
|
zoom: 1;
|
||||||
|
position: relative;
|
||||||
|
max-width:580px;
|
||||||
|
margin:0 auto;
|
||||||
|
z-index:100;
|
||||||
|
border:none;
|
||||||
|
text-align:left; /* reset align=center */
|
||||||
|
}
|
||||||
|
* html #wowslider-container{ width:580px }
|
||||||
|
#wowslider-container ul{
|
||||||
|
position:relative;
|
||||||
|
width: 10000%;
|
||||||
|
height:auto;
|
||||||
|
left:0;
|
||||||
|
list-style:none;
|
||||||
|
margin:0;
|
||||||
|
padding:0;
|
||||||
|
border-spacing:0;
|
||||||
|
overflow: visible;
|
||||||
|
/*table-layout:fixed;*/
|
||||||
|
}
|
||||||
|
#wowslider-container .ws_images ul li{
|
||||||
|
width:1%;
|
||||||
|
line-height:0; /*opera*/
|
||||||
|
float:left;
|
||||||
|
font-size:0;
|
||||||
|
padding:0 0 0 0;
|
||||||
|
margin:0 0 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wowslider-container .ws_images{
|
||||||
|
position: relative;
|
||||||
|
left:0;
|
||||||
|
top:0;
|
||||||
|
width:100%;
|
||||||
|
height:100%;
|
||||||
|
overflow:hidden;
|
||||||
|
}
|
||||||
|
#wowslider-container .ws_images a{
|
||||||
|
width:100%;
|
||||||
|
display:block;
|
||||||
|
color:transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wowslider-container .ws_images img{
|
||||||
|
width:100%;
|
||||||
|
border:none 0;
|
||||||
|
max-width: none;
|
||||||
|
}
|
||||||
|
#wowslider-container a{
|
||||||
|
text-decoration: none;
|
||||||
|
outline: none;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wowslider-container .ws_bullets {
|
||||||
|
font-size: 0px;
|
||||||
|
float: left;
|
||||||
|
position:absolute;
|
||||||
|
z-index:70;
|
||||||
|
}
|
||||||
|
#wowslider-container .ws_bullets div{
|
||||||
|
position:relative;
|
||||||
|
float:left;
|
||||||
|
}
|
||||||
|
#wowslider-container a.wsl{
|
||||||
|
display:none;
|
||||||
|
}
|
||||||
|
#wowslider-container .ws_bullets {
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
#wowslider-container .ws_bullets a {
|
||||||
|
width:15px;
|
||||||
|
height:15px;
|
||||||
|
background: url(./bullet.png) left top;
|
||||||
|
float: left;
|
||||||
|
text-indent: -4000px;
|
||||||
|
position:relative;
|
||||||
|
margin-left:3px;
|
||||||
|
color:transparent;
|
||||||
|
}
|
||||||
|
#wowslider-container .ws_bullets a:hover{
|
||||||
|
background-position: 0 50%;
|
||||||
|
}
|
||||||
|
#wowslider-container .ws_bullets a.ws_selbull{
|
||||||
|
background-position: 0 100%;
|
||||||
|
}
|
||||||
|
#wowslider-container a.ws_next, #wowslider-container a.ws_prev {
|
||||||
|
position:absolute;
|
||||||
|
display:none;
|
||||||
|
top:50%;
|
||||||
|
margin-top:-50px;
|
||||||
|
z-index:60;
|
||||||
|
height: 100px;
|
||||||
|
width: 60px;
|
||||||
|
background-image: url(./arrows.png);
|
||||||
|
}
|
||||||
|
#wowslider-container a.ws_next{
|
||||||
|
background-position: 100% 0;
|
||||||
|
right:0;
|
||||||
|
}
|
||||||
|
#wowslider-container a.ws_prev {
|
||||||
|
left:0;
|
||||||
|
background-position: 0 0;
|
||||||
|
}
|
||||||
|
* html #wowslider-container a.ws_next,* html #wowslider-container a.ws_prev{display:block}
|
||||||
|
#wowslider-container:hover a.ws_next, #wowslider-container:hover a.ws_prev {display:block}
|
||||||
|
/* bottom center */
|
||||||
|
#wowslider-container .ws_bullets {
|
||||||
|
top: 5px;
|
||||||
|
right: 10px;
|
||||||
|
}
|
||||||
|
#wowslider-container .ws_bullets .ws_bulframe {
|
||||||
|
top: 20px;
|
||||||
|
}
|
||||||
|
#wowslider-container .ws_bullets .ws_bulframe {
|
||||||
|
top: 20px;
|
||||||
|
}
|
||||||
|
#wowslider-container .ws-title{
|
||||||
|
position: absolute;
|
||||||
|
bottom: 10%;
|
||||||
|
left: 7%;
|
||||||
|
z-index: 50;
|
||||||
|
padding:12px;
|
||||||
|
color: #000000;
|
||||||
|
background:#fff;
|
||||||
|
font-family:Oswald,Impact,Charcoal,sans-serif;
|
||||||
|
font-size: 30px;
|
||||||
|
text-shadow: 1px 1px 1px #BBBBBB;
|
||||||
|
line-height: 30px;
|
||||||
|
border-radius:5px;
|
||||||
|
-moz-border-radius:5px;
|
||||||
|
-webkit-border-radius:5px;
|
||||||
|
opacity:0.5;
|
||||||
|
filter:progid:DXImageTransform.Microsoft.Alpha(opacity=50);
|
||||||
|
}
|
||||||
|
#wowslider-container .ws-title div{
|
||||||
|
font-size: 25px;
|
||||||
|
text-shadow: 1px 1px 1px #000000;
|
||||||
|
}#wowslider-container ul{
|
||||||
|
animation: wsBasic 12s infinite;
|
||||||
|
-moz-animation: wsBasic 12s infinite;
|
||||||
|
-webkit-animation: wsBasic 12s infinite;
|
||||||
|
}
|
||||||
|
@keyframes wsBasic{0%{left:-0%} 16.67%{left:-0%} 33.33%{left:-100%} 50%{left:-100%} 66.67%{left:-200%} 83.33%{left:-200%} }
|
||||||
|
@-moz-keyframes wsBasic{0%{left:-0%} 16.67%{left:-0%} 33.33%{left:-100%} 50%{left:-100%} 66.67%{left:-200%} 83.33%{left:-200%} }
|
||||||
|
@-webkit-keyframes wsBasic{0%{left:-0%} 16.67%{left:-0%} 33.33%{left:-100%} 50%{left:-100%} 66.67%{left:-200%} 83.33%{left:-200%} }
|
||||||
|
|
||||||
|
#wowslider-container .ws_shadow{
|
||||||
|
background: url(./shadow.png) left 100%;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-size:100%;
|
||||||
|
width:100%;
|
||||||
|
height:20%;
|
||||||
|
position: absolute;
|
||||||
|
left:0;
|
||||||
|
bottom:-20%;
|
||||||
|
z-index:-1;
|
||||||
|
}
|
||||||
|
* html #wowslider-container .ws_shadow{/*ie6*/
|
||||||
|
background:none;
|
||||||
|
filter:progid:DXImageTransform.Microsoft.AlphaImageLoader( src='wowslider/install/shadow.png', sizingMethod='scale');
|
||||||
|
}
|
||||||
|
*+html #wowslider-container .ws_shadow{/*ie7*/
|
||||||
|
background:none;
|
||||||
|
filter:progid:DXImageTransform.Microsoft.AlphaImageLoader( src='wowslider/install/shadow.png', sizingMethod='scale');
|
||||||
|
}
|
||||||
|
#wowslider-container .ws_bullets a img{
|
||||||
|
text-indent:0;
|
||||||
|
display:block;
|
||||||
|
top:15px;
|
||||||
|
left:-123px;
|
||||||
|
visibility:hidden;
|
||||||
|
position:absolute;
|
||||||
|
-moz-box-shadow: 0 0 5px #999999;
|
||||||
|
box-shadow: 0 0 5px #999999;
|
||||||
|
border: 5px solid #FFFFFF;
|
||||||
|
max-width:none;
|
||||||
|
}
|
||||||
|
#wowslider-container .ws_bullets a:hover img{
|
||||||
|
visibility:visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wowslider-container .ws_bulframe div div{
|
||||||
|
height:90px;
|
||||||
|
overflow:visible;
|
||||||
|
position:relative;
|
||||||
|
}
|
||||||
|
#wowslider-container .ws_bulframe div {
|
||||||
|
left:0;
|
||||||
|
overflow:hidden;
|
||||||
|
position:relative;
|
||||||
|
width:246px;
|
||||||
|
background-color:#FFFFFF;
|
||||||
|
}
|
||||||
|
#wowslider-container .ws_bullets .ws_bulframe{
|
||||||
|
display:none;
|
||||||
|
overflow:visible;
|
||||||
|
position:absolute;
|
||||||
|
cursor:pointer;
|
||||||
|
-moz-box-shadow: 0 0 5px #999999;
|
||||||
|
box-shadow: 0 0 5px #999999;
|
||||||
|
border: 5px solid #FFFFFF;
|
||||||
|
}
|
||||||
|
#wowslider-container .ws_bulframe span{
|
||||||
|
display:block;
|
||||||
|
position:absolute;
|
||||||
|
top:-11px;
|
||||||
|
margin-left:-5px;
|
||||||
|
left:123px;
|
||||||
|
background:url(./triangle.png);
|
||||||
|
width:15px;
|
||||||
|
height:6px;
|
||||||
|
}
|
||||||
11
app/channels/second_display_channel.rb
Normal file
11
app/channels/second_display_channel.rb
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
class SecondDisplayChannel < ApplicationCable::Channel
|
||||||
|
def subscribed
|
||||||
|
stream_from "second_display_channel"
|
||||||
|
end
|
||||||
|
|
||||||
|
def unsubscribed
|
||||||
|
stop_all_streams
|
||||||
|
# Any cleanup needed when channel is unsubscribed
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
11
app/channels/second_display_view_channel.rb
Normal file
11
app/channels/second_display_view_channel.rb
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
class SecondDisplayViewChannel < ApplicationCable::Channel
|
||||||
|
def subscribed
|
||||||
|
stream_from "second_display_view_channel"
|
||||||
|
end
|
||||||
|
|
||||||
|
def unsubscribed
|
||||||
|
stop_all_streams
|
||||||
|
# Any cleanup needed when channel is unsubscribed
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
class Origami::AddordersController < ApplicationController#BaseOrigamiController
|
class Origami::AddordersController < BaseOrigamiController
|
||||||
# before_action :set_dining, only: [:detail]
|
# before_action :set_dining, only: [:detail]
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@@ -161,10 +161,15 @@ class Origami::AddordersController < ApplicationController#BaseOrigamiController
|
|||||||
end
|
end
|
||||||
|
|
||||||
@status, @booking = @order.generate
|
@status, @booking = @order.generate
|
||||||
|
|
||||||
|
# Order.send_customer_view(@booking)
|
||||||
|
|
||||||
if current_user.role != "waiter" && params[:create_type] == "create_pay"
|
if current_user.role != "waiter" && params[:create_type] == "create_pay"
|
||||||
if @status && @booking && @order.source == 'quick_service'
|
if @status && @booking && @order.source == 'quick_service'
|
||||||
|
|
||||||
@status, @sale = Sale.request_bill(@order,current_user,current_login_employee)
|
@status, @sale = Sale.request_bill(@order,current_user,current_login_employee)
|
||||||
|
# for second display
|
||||||
|
ActionCable.server.broadcast "second_display_channel",data: @sale,status:"sale"
|
||||||
result = {:status=> @status, :data => @sale }
|
result = {:status=> @status, :data => @sale }
|
||||||
render :json => result.to_json
|
render :json => result.to_json
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -93,9 +93,6 @@ class Origami::HomeController < BaseOrigamiController
|
|||||||
@account_arr = Array.new
|
@account_arr = Array.new
|
||||||
if @customer.tax_profiles
|
if @customer.tax_profiles
|
||||||
accounts = @customer.tax_profiles
|
accounts = @customer.tax_profiles
|
||||||
puts accounts.to_json
|
|
||||||
puts "sssssssssss"
|
|
||||||
puts @customer.tax_profiles
|
|
||||||
@account_arr =[]
|
@account_arr =[]
|
||||||
accounts.each do |acc|
|
accounts.each do |acc|
|
||||||
account = TaxProfile.find(acc)
|
account = TaxProfile.find(acc)
|
||||||
|
|||||||
@@ -228,6 +228,23 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
@individual_total.push({'total_customer' => saleObj.equal_persons.to_i, 'per_person_amount' => per_person_amount.to_f })
|
@individual_total.push({'total_customer' => saleObj.equal_persons.to_i, 'per_person_amount' => per_person_amount.to_f })
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# rounding adjustment
|
||||||
|
# if @shop.is_rounding_adj
|
||||||
|
# a = saleObj.grand_total % 25 # Modulus
|
||||||
|
# b = saleObj.grand_total / 25 # Division
|
||||||
|
# #not calculate rounding if modulus is 0 and division is even
|
||||||
|
# #calculate rounding if modulus is zero or not zero and division are not even
|
||||||
|
# if (a != 0.0 && b%2 != 0.0) || (a==0.0 && b%2 !=0)
|
||||||
|
# new_total = Sale.get_rounding_adjustment(saleObj.grand_total)
|
||||||
|
# @rounding_adj = new_total-saleObj.grand_total
|
||||||
|
# else
|
||||||
|
# @rounding_adj = @sale_data.rounding_adjustment
|
||||||
|
# end
|
||||||
|
# else
|
||||||
|
# @rounding_adj = @sale_data.rounding_adjustment
|
||||||
|
# end
|
||||||
|
#end rounding adjustment
|
||||||
|
|
||||||
# rounding adjustment
|
# rounding adjustment
|
||||||
if @shop.is_rounding_adj
|
if @shop.is_rounding_adj
|
||||||
a = saleObj.grand_total % 25 # Modulus
|
a = saleObj.grand_total % 25 # Modulus
|
||||||
@@ -237,6 +254,7 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
if (a != 0.0 && b%2 != 0.0) || (a==0.0 && b%2 !=0)
|
if (a != 0.0 && b%2 != 0.0) || (a==0.0 && b%2 !=0)
|
||||||
new_total = Sale.get_rounding_adjustment(saleObj.grand_total)
|
new_total = Sale.get_rounding_adjustment(saleObj.grand_total)
|
||||||
@rounding_adj = new_total-saleObj.grand_total
|
@rounding_adj = new_total-saleObj.grand_total
|
||||||
|
saleObj.update_attributes(grand_total: new_total,old_grand_total: saleObj.grand_total,rounding_adjustment:@rounding_adj)
|
||||||
else
|
else
|
||||||
@rounding_adj = @sale_data.rounding_adjustment
|
@rounding_adj = @sale_data.rounding_adjustment
|
||||||
end
|
end
|
||||||
|
|||||||
23
app/controllers/origami/second_display_controller.rb
Normal file
23
app/controllers/origami/second_display_controller.rb
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
class Origami::SecondDisplayController < BaseOrigamiController
|
||||||
|
|
||||||
|
def index
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def customer_view
|
||||||
|
if params[:status]!= "billed"
|
||||||
|
tax_profiles = TaxProfile.all.order("order_by asc")
|
||||||
|
else
|
||||||
|
tax_profiles = nil
|
||||||
|
end
|
||||||
|
|
||||||
|
ActionCable.server.broadcast "second_display_view_channel",data: params[:data],tax_profiles: tax_profiles,status:params[:status]
|
||||||
|
end
|
||||||
|
#Shop Name in Navbor
|
||||||
|
helper_method :shop_detail
|
||||||
|
def shop_detail
|
||||||
|
@shop = Shop.first
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
end
|
||||||
@@ -46,6 +46,7 @@ class Origami::TableInvoicesController < BaseOrigamiController
|
|||||||
if (a != 0.0 && b%2 != 0.0) || (a==0.0 && b%2 !=0)
|
if (a != 0.0 && b%2 != 0.0) || (a==0.0 && b%2 !=0)
|
||||||
new_total = Sale.get_rounding_adjustment(sale.grand_total)
|
new_total = Sale.get_rounding_adjustment(sale.grand_total)
|
||||||
sale.rounding_adjustment = new_total-sale.grand_total
|
sale.rounding_adjustment = new_total-sale.grand_total
|
||||||
|
sale.update_attributes(grand_total: new_total,old_grand_total: sale.grand_total,rounding_adjustment:sale.rounding_adjustment)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
#end rounding adjustment
|
#end rounding adjustment
|
||||||
|
|||||||
@@ -18,4 +18,10 @@ class Reports::ProductSaleController < BaseReportController
|
|||||||
format.xls
|
format.xls
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
#Shop Name in Navbor
|
||||||
|
helper_method :shop_detail
|
||||||
|
def shop_detail
|
||||||
|
@shop = Shop.first
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -93,6 +93,11 @@ class Ability
|
|||||||
can :index, :home
|
can :index, :home
|
||||||
can :show, :home
|
can :show, :home
|
||||||
|
|
||||||
|
#ability for split_bill
|
||||||
|
can :index, :split_bill
|
||||||
|
can :create, :split_bill
|
||||||
|
can :update_sale, :split_bill
|
||||||
|
|
||||||
elsif user.role == "cashier"
|
elsif user.role == "cashier"
|
||||||
|
|
||||||
# can :overall_void, :void
|
# can :overall_void, :void
|
||||||
@@ -191,6 +196,11 @@ class Ability
|
|||||||
|
|
||||||
can :index, :home
|
can :index, :home
|
||||||
can :show, :home
|
can :show, :home
|
||||||
|
|
||||||
|
#ability for split_bill
|
||||||
|
can :index, :split_bill
|
||||||
|
can :create, :split_bill
|
||||||
|
can :update_sale, :split_bill
|
||||||
elsif user.role == "waiter"
|
elsif user.role == "waiter"
|
||||||
can :index, :home
|
can :index, :home
|
||||||
can :show, :home
|
can :show, :home
|
||||||
|
|||||||
@@ -487,6 +487,42 @@ class Order < ApplicationRecord
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.send_customer_view(booking)
|
||||||
|
@status = ""
|
||||||
|
@data_array = Array.new
|
||||||
|
if(!booking.sale_id.nil?)
|
||||||
|
sale = Sale.find(booking.sale_id)
|
||||||
|
if sale.sale_status != "completed" && sale.sale_status != 'void'
|
||||||
|
@data_array.push(sale)
|
||||||
|
@status = "sale"
|
||||||
|
@data_obj = sale
|
||||||
|
end
|
||||||
|
else
|
||||||
|
|
||||||
|
@status = "order"
|
||||||
|
booking.booking_orders.each do |booking_order|
|
||||||
|
@data_obj = Order.find(booking_order.order_id)
|
||||||
|
if (@data_obj.status == "new")
|
||||||
|
@data_obj.order_items.each do |item|
|
||||||
|
if !item.set_menu_items.nil?
|
||||||
|
instance_item_sets = JSON.parse(item.set_menu_items)
|
||||||
|
arr_instance_item_sets = Array.new
|
||||||
|
instance_item_sets.each do |instance_item|
|
||||||
|
item_instance_name = MenuItemInstance.find_by_item_instance_code(instance_item["item_instance_code"]).item_instance_name
|
||||||
|
arr_instance_item_sets.push(item_instance_name)
|
||||||
|
item.price = item.price.to_f + instance_item["price"].to_f
|
||||||
|
end
|
||||||
|
item.set_menu_items = arr_instance_item_sets
|
||||||
|
end
|
||||||
|
@data_array.push(item)
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
ActionCable.server.broadcast "second_display_channel",data: @data_array,status:@status
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def generate_custom_id
|
def generate_custom_id
|
||||||
|
|||||||
@@ -913,15 +913,15 @@ def self.get_shift_sales_by_receipt_no(shift_sale_range,shift,from,to,payment_ty
|
|||||||
|
|
||||||
query = Sale.all
|
query = Sale.all
|
||||||
if shift.present?
|
if shift.present?
|
||||||
query = query.where("sales.shift_sale_id in (?) #{payment_type} and sale_status= 'completed' and sales.payment_status= 'paid' and sale_payments.payment_amount != 0", shift.to_a)
|
query = query.where("sales.shift_sale_id in (?) #{payment_type} and sale_status= 'completed' and sale_payments.payment_amount != 0", shift.to_a)
|
||||||
.joins("join sale_payments on sale_payments.sale_id = sales.sale_id")
|
.joins("join sale_payments on sale_payments.sale_id = sales.sale_id")
|
||||||
.group("sales.sale_id")
|
.group("sales.sale_id")
|
||||||
elsif shift_sale_range.present?
|
elsif shift_sale_range.present?
|
||||||
query = query.where("sale_status='completed' #{payment_type} and sale_payments.payment_amount != 0 and sales.payment_status= 'paid' and sales.shift_sale_id in (?)",shift_sale_range.to_a)
|
query = query.where("sale_status='completed' #{payment_type} and sale_payments.payment_amount != 0 and sales.shift_sale_id in (?)",shift_sale_range.to_a)
|
||||||
.joins("join sale_payments on sale_payments.sale_id = sales.sale_id")
|
.joins("join sale_payments on sale_payments.sale_id = sales.sale_id")
|
||||||
.group("sales.sale_id")
|
.group("sales.sale_id")
|
||||||
else
|
else
|
||||||
query = query.where("sale_status='completed' and sales.receipt_date between ? and ? #{payment_type} and sales.payment_status= 'paid' and sale_payments.payment_amount != 0",from,to)
|
query = query.where("sale_status='completed' and sales.receipt_date between ? and ? #{payment_type} and sale_payments.payment_amount != 0",from,to)
|
||||||
.joins("join sale_payments on sale_payments.sale_id = sales.sale_id")
|
.joins("join sale_payments on sale_payments.sale_id = sales.sale_id")
|
||||||
.group("sales.sale_id")
|
.group("sales.sale_id")
|
||||||
end
|
end
|
||||||
@@ -1112,7 +1112,7 @@ end
|
|||||||
" i.price as unit_price,mi.name as product_name")
|
" i.price as unit_price,mi.name as product_name")
|
||||||
.joins("JOIN sale_items i ON i.sale_id = sales.sale_id JOIN menu_items mi ON i.product_code = mi.item_code")
|
.joins("JOIN sale_items i ON i.sale_id = sales.sale_id JOIN menu_items mi ON i.product_code = mi.item_code")
|
||||||
.where("(i.qty > 0 and i.price > 0) and receipt_date between '#{from}' and '#{to}'"+
|
.where("(i.qty > 0 and i.price > 0) and receipt_date between '#{from}' and '#{to}'"+
|
||||||
"and payment_status='paid' and sale_status= 'completed'")
|
"and sale_status= 'completed'")
|
||||||
.group('mi.name')
|
.group('mi.name')
|
||||||
.order("SUM(i.qty) DESC").limit(20)
|
.order("SUM(i.qty) DESC").limit(20)
|
||||||
else
|
else
|
||||||
@@ -1120,7 +1120,7 @@ end
|
|||||||
" i.price as unit_price,mi.name as product_name")
|
" i.price as unit_price,mi.name as product_name")
|
||||||
.joins("JOIN sale_items i ON i.sale_id = sales.sale_id JOIN menu_items mi ON i.product_code = mi.item_code")
|
.joins("JOIN sale_items i ON i.sale_id = sales.sale_id JOIN menu_items mi ON i.product_code = mi.item_code")
|
||||||
.where("(i.qty > 0 and i.price > 0) and DATE_FORMAT(receipt_date,'%Y-%m-%d') = '#{today}'"+
|
.where("(i.qty > 0 and i.price > 0) and DATE_FORMAT(receipt_date,'%Y-%m-%d') = '#{today}'"+
|
||||||
"and payment_status='paid' and sale_status= 'completed'")
|
"and sale_status= 'completed'")
|
||||||
.group('mi.name')
|
.group('mi.name')
|
||||||
.order("SUM(i.qty) DESC").limit(20)
|
.order("SUM(i.qty) DESC").limit(20)
|
||||||
end
|
end
|
||||||
@@ -1132,7 +1132,7 @@ end
|
|||||||
" i.price as unit_price,mi.name as product_name")
|
" i.price as unit_price,mi.name as product_name")
|
||||||
.joins("JOIN sale_items i ON i.sale_id = sales.sale_id JOIN menu_items mi ON i.product_code = mi.item_code")
|
.joins("JOIN sale_items i ON i.sale_id = sales.sale_id JOIN menu_items mi ON i.product_code = mi.item_code")
|
||||||
.where("(i.qty > 0 and i.price > 0) and receipt_date between '#{from}' and '#{to}'"+
|
.where("(i.qty > 0 and i.price > 0) and receipt_date between '#{from}' and '#{to}'"+
|
||||||
"and payment_status='paid' and sale_status= 'completed'")
|
"and sale_status= 'completed'")
|
||||||
.group('mi.name')
|
.group('mi.name')
|
||||||
.order("SUM(i.qty) ASC").limit(20)
|
.order("SUM(i.qty) ASC").limit(20)
|
||||||
else
|
else
|
||||||
@@ -1140,7 +1140,7 @@ end
|
|||||||
" i.price as unit_price,mi.name as product_name")
|
" i.price as unit_price,mi.name as product_name")
|
||||||
.joins("JOIN sale_items i ON i.sale_id = sales.sale_id JOIN menu_items mi ON i.product_code = mi.item_code")
|
.joins("JOIN sale_items i ON i.sale_id = sales.sale_id JOIN menu_items mi ON i.product_code = mi.item_code")
|
||||||
.where("(i.qty > 0 and i.price > 0) and DATE_FORMAT(receipt_date,'%Y-%m-%d') = '#{today}'"+
|
.where("(i.qty > 0 and i.price > 0) and DATE_FORMAT(receipt_date,'%Y-%m-%d') = '#{today}'"+
|
||||||
"and payment_status='paid' and sale_status= 'completed'")
|
"and sale_status= 'completed'")
|
||||||
.group('mi.name')
|
.group('mi.name')
|
||||||
.order("SUM(i.qty) ASC").limit(20)
|
.order("SUM(i.qty) ASC").limit(20)
|
||||||
end
|
end
|
||||||
@@ -1149,12 +1149,12 @@ end
|
|||||||
def self.hourly_sales(today,from,to)
|
def self.hourly_sales(today,from,to)
|
||||||
if !from.nil? && !to.nil?
|
if !from.nil? && !to.nil?
|
||||||
query= Sale.select("grand_total")
|
query= Sale.select("grand_total")
|
||||||
.where('payment_status="paid" and sale_status = "completed" and receipt_date between ? and ?',from,to)
|
.where('sale_status = "completed" and receipt_date between ? and ?',from,to)
|
||||||
.group("date_format(CONVERT_TZ(receipt_date,'+00:00', 'SYSTEM'), '%I %p')")
|
.group("date_format(CONVERT_TZ(receipt_date,'+00:00', 'SYSTEM'), '%I %p')")
|
||||||
.order('receipt_date')
|
.order('receipt_date')
|
||||||
else
|
else
|
||||||
query= Sale.select("grand_total")
|
query= Sale.select("grand_total")
|
||||||
.where('payment_status="paid" and sale_status = "completed" and DATE_FORMAT(receipt_date,"%Y-%m-%d") = ?',today)
|
.where('sale_status = "completed" and DATE_FORMAT(receipt_date,"%Y-%m-%d") = ?',today)
|
||||||
.group("date_format(CONVERT_TZ(receipt_date,'+00:00', 'SYSTEM'), '%I %p')")
|
.group("date_format(CONVERT_TZ(receipt_date,'+00:00', 'SYSTEM'), '%I %p')")
|
||||||
.order('receipt_date')
|
.order('receipt_date')
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<!-- Column One -->
|
<!-- Column One -->
|
||||||
<div class="row clearfix" style="margin-top:-50px !important">
|
<div class="row clearfix" style="">
|
||||||
<div class="col-lg-11 col-md-11 col-sm-11">
|
<div class="col-lg-11 col-md-11 col-sm-11">
|
||||||
<div class="body p-l-10">
|
<div class="body p-l-10">
|
||||||
<div class="row clearfix">
|
<div class="row clearfix">
|
||||||
@@ -20,7 +20,6 @@
|
|||||||
<select class="form-control select tables" name="table_id" id="tables">
|
<select class="form-control select tables" name="table_id" id="tables">
|
||||||
<option value="">Select Table</option>
|
<option value="">Select Table</option>
|
||||||
<% @tables.each do |table| %>
|
<% @tables.each do |table| %>
|
||||||
|
|
||||||
<option value="<%= table.id %>" data-id="<%= table.id %>"> <%= table.name %></option>
|
<option value="<%= table.id %>" data-id="<%= table.id %>"> <%= table.name %></option>
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -424,6 +424,7 @@
|
|||||||
<i class="material-icons">reply</i>
|
<i class="material-icons">reply</i>
|
||||||
<%= t("views.btn.back") %>
|
<%= t("views.btn.back") %>
|
||||||
</button>
|
</button>
|
||||||
|
<a href="<%=origami_second_display_index_path%>" target="_blank" id="second_view" class="btn action-btn bg-blue waves-effect" style="height: 45px">Customer View</a>
|
||||||
<button type="button" id="add_order" class="btn btn-block bg-blue waves-effect"><%= t("views.btn.add") %> <%= t("views.right_panel.detail.order") %></button>
|
<button type="button" id="add_order" class="btn btn-block bg-blue waves-effect"><%= t("views.btn.add") %> <%= t("views.right_panel.detail.order") %></button>
|
||||||
<button type="button" id="survey" class="btn btn-block bg-blue waves-effect"><%= t("views.right_panel.detail.survey") %></button>
|
<button type="button" id="survey" class="btn btn-block bg-blue waves-effect"><%= t("views.right_panel.detail.survey") %></button>
|
||||||
<% if @dining.status != "available" %>
|
<% if @dining.status != "available" %>
|
||||||
|
|||||||
@@ -501,6 +501,7 @@ var customer_name = "<%= @customer.name %>";
|
|||||||
|
|
||||||
$("#back").on('click', function() {
|
$("#back").on('click', function() {
|
||||||
localStorage.removeItem('cash');
|
localStorage.removeItem('cash');
|
||||||
|
customer_display_view(null,"reload");
|
||||||
if (cashier_type=="cashier") {
|
if (cashier_type=="cashier") {
|
||||||
window.location.href = '/origami/table/'+ dining_id;
|
window.location.href = '/origami/table/'+ dining_id;
|
||||||
}else{
|
}else{
|
||||||
@@ -608,6 +609,7 @@ var customer_name = "<%= @customer.name %>";
|
|||||||
$("#changed_amount").text('Changed amount ' + parseFloat($('#balance').text() * (-1)));
|
$("#changed_amount").text('Changed amount ' + parseFloat($('#balance').text() * (-1)));
|
||||||
<% end %>
|
<% end %>
|
||||||
}
|
}
|
||||||
|
|
||||||
//PDF lightbox data
|
//PDF lightbox data
|
||||||
// if($('#balance').text() < 0){
|
// if($('#balance').text() < 0){
|
||||||
// swal({
|
// swal({
|
||||||
@@ -684,6 +686,7 @@ var customer_name = "<%= @customer.name %>";
|
|||||||
url: ajax_url,
|
url: ajax_url,
|
||||||
data: "remark="+ remark + "&sale_id=" + sale_id,
|
data: "remark="+ remark + "&sale_id=" + sale_id,
|
||||||
success: function () {
|
success: function () {
|
||||||
|
customer_display_view(null,"reload");
|
||||||
if (cashier_type=="cashier") {
|
if (cashier_type=="cashier") {
|
||||||
window.location.href = '/origami';
|
window.location.href = '/origami';
|
||||||
}else{
|
}else{
|
||||||
@@ -841,6 +844,7 @@ var customer_name = "<%= @customer.name %>";
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
function update_balance(){
|
function update_balance(){
|
||||||
var cash = $('#cash').text();
|
var cash = $('#cash').text();
|
||||||
var credit = $('#credit').text();
|
var credit = $('#credit').text();
|
||||||
@@ -885,6 +889,7 @@ var customer_name = "<%= @customer.name %>";
|
|||||||
url: "<%= origami_payment_foc_path %>",
|
url: "<%= origami_payment_foc_path %>",
|
||||||
data: params,
|
data: params,
|
||||||
success:function(result){
|
success:function(result){
|
||||||
|
customer_display_view(null,"reload");
|
||||||
if (cash >= 0) {
|
if (cash >= 0) {
|
||||||
swal({
|
swal({
|
||||||
title: "Information!",
|
title: "Information!",
|
||||||
@@ -907,6 +912,17 @@ var customer_name = "<%= @customer.name %>";
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function customer_display_view(data,status) {
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
url: '../../../customer_view',
|
||||||
|
data: {"data":data,"status":status},
|
||||||
|
dataType: "json",
|
||||||
|
success:function(result){
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function calculate_member_discount(sale_id) {
|
function calculate_member_discount(sale_id) {
|
||||||
var sub_total = $('#sub-total').text();
|
var sub_total = $('#sub-total').text();
|
||||||
var member_id = $('#membership_id').text();
|
var member_id = $('#membership_id').text();
|
||||||
@@ -958,6 +974,7 @@ var customer_name = "<%= @customer.name %>";
|
|||||||
window.location.href = '/origami';
|
window.location.href = '/origami';
|
||||||
}else{
|
}else{
|
||||||
window.location.href = '/origami/quick_service';
|
window.location.href = '/origami/quick_service';
|
||||||
|
customer_display_view(null,"reload");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
60
app/views/origami/second_display/_second_display.html.erb
Normal file
60
app/views/origami/second_display/_second_display.html.erb
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
<div class="row clearfix">
|
||||||
|
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||||
|
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-block">
|
||||||
|
<div class="card-text" >
|
||||||
|
<div id="order-detail-slimscroll" data-height="150">
|
||||||
|
<table class="table table-striped second_display_items" id="order-items-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
|
||||||
|
<th>#</th>
|
||||||
|
<th class="item-name">Items</th>
|
||||||
|
<th class="item-">QTY</th>
|
||||||
|
<th class="item-">Price</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card-footer">
|
||||||
|
<table class="table" border="0">
|
||||||
|
<tr>
|
||||||
|
<td class="charges-name"><strong>Sub Total:</strong></td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="item-attr"><strong id="s_sub_total">0.00</strong></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="charges-name"><strong>Discount Amount:</strong></td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="item-attr"><strong id="s_total_discount">0.00</strong></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="charges-name"><strong>Tax Amount:</strong></td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="item-attr"><strong id="s_tatal_tax">0.00</strong></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="charges-name"><strong>Grand:</strong></td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="item-attr"><strong id="s_grand_total">0.00</strong></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||||
|
<%= image_tag("slider/s2.jpg", :alt => "rss feed") %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
18
app/views/origami/second_display/_slider.html.erb
Normal file
18
app/views/origami/second_display/_slider.html.erb
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
<%= stylesheet_link_tag 'wow_style', media: 'all', 'data-turbolinks-track': 'reload' %>
|
||||||
|
<%= javascript_include_tag 'wowslider', 'data-turbolinks-track': 'reload' %>
|
||||||
|
<%= javascript_include_tag 'wow_script', 'data-turbolinks-track': 'reload' %>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-lg-12 col-md-12 col-sm-12">
|
||||||
|
<div id="wowslider-container" style="max-width: 100%;">
|
||||||
|
<div class="ws_images full_screen">
|
||||||
|
<ul>
|
||||||
|
<li><%= image_tag("slider/s1.jpg", :alt => "rss feed") %></li>
|
||||||
|
<li><%= image_tag("slider/s2.jpg", :alt => "rss feed") %></li>
|
||||||
|
<li><%= image_tag("slider/s4.jpg", :alt => "rss feed") %></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="ws_bullets"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
19
app/views/origami/second_display/index.html.erb
Normal file
19
app/views/origami/second_display/index.html.erb
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<div class="container-fluid">
|
||||||
|
<button type="button" class="hidden" id="s_reload">Reload</button>
|
||||||
|
<div class="slider" id="second_display_slider">
|
||||||
|
<%= render 'slider' %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="item hidden" id="second_display_items">
|
||||||
|
<%= render 'second_display' %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function () {
|
||||||
|
$('#s_reload').on('click', function () {
|
||||||
|
window.location.href = '/origami/second_display';
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
3
app/views/origami/split_bill/index.html.erb
Executable file → Normal file
3
app/views/origami/split_bill/index.html.erb
Executable file → Normal file
@@ -387,7 +387,8 @@
|
|||||||
$('#order_item_split').on('click',function () {
|
$('#order_item_split').on('click',function () {
|
||||||
var cnt_order_item = "<%= @order_items.count %>";
|
var cnt_order_item = "<%= @order_items.count %>";
|
||||||
var order_items = get_selected_order_items();// Selected Order Items
|
var order_items = get_selected_order_items();// Selected Order Items
|
||||||
var cnt_items = parseInt(cnt_order_item) - parseInt(order_items.length);
|
|
||||||
|
var cnt_items = parseInt(cnt_order_item - 1) - parseInt(order_items.length);
|
||||||
if (order_items.length > 0){
|
if (order_items.length > 0){
|
||||||
// if(cnt_items > 0){
|
// if(cnt_items > 0){
|
||||||
swal({
|
swal({
|
||||||
|
|||||||
74
app/views/origami/table_invoices/show.html.erb
Executable file → Normal file
74
app/views/origami/table_invoices/show.html.erb
Executable file → Normal file
@@ -157,11 +157,59 @@
|
|||||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||||
<button id="back" type="button" class="btn btn-block btn-lg bg-default"> <i class="material-icons">reply</i> <%= t("views.btn.back") %>
|
<button id="back" type="button" class="btn btn-block btn-lg bg-default"> <i class="material-icons">reply</i> <%= t("views.btn.back") %>
|
||||||
<button type="button" id="pay" class="btn bg-blue btn-block">Pay</button>
|
<button type="button" id="pay" class="btn bg-blue btn-block">Pay</button>
|
||||||
<button type="button" class="btn bg-deep-purple btn-block" id="foc" active="<%= can? :foc, :payment %>"> FOC </button>
|
<button type="button" class="btn bg-deep-purple btn-block" data-toggle="modal" data-target="#focModal" <%= (can? :foc, :payment)? ' ': 'disabled=' %> active="true"> FOC </button>
|
||||||
<button type="button" id="void" class="btn bg-danger btn-block" active="<%= can? :overall_void, :void %>" > Void </button>
|
<button type="button" data-toggle="modal" data-target="#voidModal" class="btn bg-danger btn-block" <%= (can? :overall_void, :void)? ' ': 'disabled=' %> > Void </button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="modal fade" id="voidModal" tabindex="-1" role="dialog">
|
||||||
|
<div class="modal-dialog" role="document">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h4 class="modal-title" id="voidModalLabel">Please Enter Reason for Void</h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<input type="textarea" name="remark" class="form-control col-md-12 remark" id="remark">
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer ">
|
||||||
|
<div class="row p-r-20">
|
||||||
|
<div class="col-md-5">
|
||||||
|
<button type="button" class="btn btn-link p-t-5 p-b-5 bg-red waves-effect " id="void" active="true">VOID</button>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-5">
|
||||||
|
<button type="button" class="btn btn-link p-t-5 p-b-5 bg-blue waves-effect" data-dismiss="modal">CLOSE</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="modal fade" id="focModal" tabindex="-1" role="dialog">
|
||||||
|
<div class="modal-dialog" role="document">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h4 class="modal-title" id="focModalLabel">Please Enter Reason for FOC</h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<input type="textarea" name="remark" class="form-control col-md-12 remark" id="foc_remark">
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer ">
|
||||||
|
<div class="row p-r-20">
|
||||||
|
<div class="col-md-5">
|
||||||
|
<button type="button" class="btn btn-link bg-red waves-effect " id="foc" active="true">FOC</button>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-5">
|
||||||
|
<button type="button" class="btn btn-link bg-blue waves-effect" data-dismiss="modal">CLOSE</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
$(".tables").on('click', function(){
|
$(".tables").on('click', function(){
|
||||||
@@ -177,17 +225,18 @@ $(document).ready(function(){
|
|||||||
$('#pay').on('click',function() {
|
$('#pay').on('click',function() {
|
||||||
var sale_id = '<%= @sale.id %>';
|
var sale_id = '<%= @sale.id %>';
|
||||||
|
|
||||||
var url = '<%= @calculate_rouding_adj_path %>';
|
// var url = '<%= @calculate_rouding_adj_path %>';
|
||||||
|
|
||||||
$.ajax({
|
// $.ajax({
|
||||||
type: "GET",
|
// type: "GET",
|
||||||
url: url,
|
// url: url,
|
||||||
success:function(result){
|
// success:function(result){
|
||||||
// location.reload();
|
// // console.log(result);
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
window.location.href = '/origami/sale/'+ sale_id + "/cashier/payment";
|
window.location.href = '/origami/sale/'+ sale_id + "/cashier/payment";
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#back').on('click',function(){
|
$('#back').on('click',function(){
|
||||||
var lookup_split_bill = '<%= @split_bill %>';
|
var lookup_split_bill = '<%= @split_bill %>';
|
||||||
if(lookup_split_bill == '1'){
|
if(lookup_split_bill == '1'){
|
||||||
@@ -211,10 +260,12 @@ $('#void').on('click',function () {
|
|||||||
}, function (isConfirm) {
|
}, function (isConfirm) {
|
||||||
if (isConfirm) {
|
if (isConfirm) {
|
||||||
var sale_id = $('#sale_id').val();
|
var sale_id = $('#sale_id').val();
|
||||||
|
var remark = $("#remark").val();
|
||||||
var ajax_url = "/origami/sale/" + sale_id + '/void';
|
var ajax_url = "/origami/sale/" + sale_id + '/void';
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: ajax_url,
|
url: ajax_url,
|
||||||
|
data: "remark="+ remark + "&sale_id=" + sale_id,
|
||||||
success: function () {
|
success: function () {
|
||||||
window.location.href = '/origami';
|
window.location.href = '/origami';
|
||||||
}
|
}
|
||||||
@@ -227,13 +278,14 @@ $('#void').on('click',function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$('#foc').click(function() {
|
$('#foc').click(function() {
|
||||||
|
var remark = $("#foc_remark").val();
|
||||||
var cash = $('#grand_total').text();
|
var cash = $('#grand_total').text();
|
||||||
var sub_total = $('#sub_total').text();
|
var sub_total = $('#sub_total').text();
|
||||||
var sale_id = '';
|
var sale_id = '';
|
||||||
if($('.receipt_block > div').hasClass('selected-item')){
|
if($('.receipt_block > div').hasClass('selected-item')){
|
||||||
sale_id = $('.receipt_block > div.selected-item').parent().attr('data-id');
|
sale_id = $('.receipt_block > div.selected-item').parent().attr('data-id');
|
||||||
}
|
}
|
||||||
var params = { 'cash':cash,'sale_id':sale_id,'sub_total':sub_total };
|
var params = { 'cash':cash,'sale_id':sale_id,'sub_total':sub_total,'remark':remark,'type':'cashier' };
|
||||||
// console.log(sale_id);
|
// console.log(sale_id);
|
||||||
if(sale_id != ''){
|
if(sale_id != ''){
|
||||||
if ($(this).attr('active')=== "true") {
|
if ($(this).attr('active')=== "true") {
|
||||||
|
|||||||
@@ -41,6 +41,11 @@ Rails.application.config.assets.precompile += %w( fileinput.min.js )
|
|||||||
Rails.application.config.assets.precompile += %w( addorder.css )
|
Rails.application.config.assets.precompile += %w( addorder.css )
|
||||||
Rails.application.config.assets.precompile += %w( addorder.js )
|
Rails.application.config.assets.precompile += %w( addorder.js )
|
||||||
|
|
||||||
|
# --- Customer/ Customer - Crm ----
|
||||||
|
Rails.application.config.assets.precompile += %w( wow_style.css )
|
||||||
|
Rails.application.config.assets.precompile += %w( wowslider.js )
|
||||||
|
Rails.application.config.assets.precompile += %w( wow_script.js )
|
||||||
|
|
||||||
# --- Custom SX Themem ----
|
# --- Custom SX Themem ----
|
||||||
Rails.application.config.assets.precompile += %w( sx-sidebar.css )
|
Rails.application.config.assets.precompile += %w( sx-sidebar.css )
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
iv_key: f3ICP0M2HJLIeXURn3yv5A==
|
|
||||||
shop_name: sx_license_test3
|
|
||||||
email: aungmyo.zaw@code2lab.com
|
|
||||||
telephone: 0099404923
|
|
||||||
fax: 49494949432
|
|
||||||
address: Yangon
|
|
||||||
dbhost: m4ZCds3ANyqjqCgZVSTfRQ==
|
|
||||||
dbschema: +mvY73HAjWqMrby9Zu+tBg==
|
|
||||||
dbusername: UO2rBxhoSfDEKutK2OEL4A==
|
|
||||||
dbpassword: sVpy+Lj6i3MpT+CjoJrDOw==
|
|
||||||
api_token: srTutEOCzphDFOXQqVWnZwQDTXiHdzwzY
|
|
||||||
app_token: pSzbojYfXLNpSLmhdNTfLCtxfzeUahO
|
|
||||||
plan_sku: +53eC6oiOsBRxtBgVjyULw==
|
|
||||||
renewable_date: hon6p5jvfirTFniaFrH0qw==
|
|
||||||
plan_name: eaMIWzHlTnljCEkE2oxoHg==
|
|
||||||
@@ -95,6 +95,9 @@ scope "(:locale)", locale: /en|mm/ do
|
|||||||
get "quick_service/modify_order/:sale_id" => "quick_service#modify_order"
|
get "quick_service/modify_order/:sale_id" => "quick_service#modify_order"
|
||||||
post 'quick_service/update_modify_order' => "quick_service#update_modify_order", :defaults => { :format => 'json' }
|
post 'quick_service/update_modify_order' => "quick_service#update_modify_order", :defaults => { :format => 'json' }
|
||||||
|
|
||||||
|
resources :second_display
|
||||||
|
|
||||||
|
post '/customer_view' => "second_display#customer_view",:as => "customer_view", :defaults => { :format => 'json' }
|
||||||
|
|
||||||
resources :cash_ins, only: [:new, :create]
|
resources :cash_ins, only: [:new, :create]
|
||||||
resources :cash_outs, only: [:new, :create]
|
resources :cash_outs, only: [:new, :create]
|
||||||
|
|||||||
Reference in New Issue
Block a user