Merge branch 'adminbsb_material_ui' of bitbucket.org:code2lab/sxrestaurant
This commit is contained in:
@@ -373,7 +373,7 @@ $(function() {
|
|||||||
$('.add_to_order').removeAttr('data-attributes');
|
$('.add_to_order').removeAttr('data-attributes');
|
||||||
$('.add_to_order').removeAttr('data-options');
|
$('.add_to_order').removeAttr('data-options');
|
||||||
|
|
||||||
$('.change_qty').val(1);
|
$('.keypress_qty').val(1);
|
||||||
|
|
||||||
change_qty_plus_minus("count","plus","minus");
|
change_qty_plus_minus("count","plus","minus");
|
||||||
|
|
||||||
@@ -460,7 +460,7 @@ $(function() {
|
|||||||
$(".options-list").append(row);
|
$(".options-list").append(row);
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#count').val(1);
|
// $('#count').val(1);
|
||||||
$('#item_instances').text(instances);
|
$('#item_instances').text(instances);
|
||||||
$('#title_name').text(data.attr('data-name'));
|
$('#title_name').text(data.attr('data-name'));
|
||||||
$('#item_code').text(data.attr('data-item-code'));
|
$('#item_code').text(data.attr('data-item-code'));
|
||||||
@@ -825,12 +825,16 @@ $(function() {
|
|||||||
// Get Selected Class
|
// Get Selected Class
|
||||||
function change_qty_plus_minus(id,plus,minus) {
|
function change_qty_plus_minus(id,plus,minus) {
|
||||||
|
|
||||||
var count = parseInt($('#'+id).val())
|
|
||||||
var countEl = document.getElementById(id);
|
|
||||||
|
|
||||||
$('#'+plus).on("click", function(){
|
$('#'+plus).on("click", function(){
|
||||||
|
|
||||||
|
var count = parseInt($('#'+id).val());
|
||||||
|
var countEl = document.getElementById(id);
|
||||||
|
|
||||||
count++;
|
count++;
|
||||||
countEl.value = count;
|
countEl.value = count;
|
||||||
|
|
||||||
|
|
||||||
if (id == "count") {
|
if (id == "count") {
|
||||||
@@ -856,9 +860,13 @@ $(function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$('#'+minus).on("click", function(){
|
$('#'+minus).on("click", function(){
|
||||||
|
|
||||||
|
var count = parseInt($('#'+id).val());
|
||||||
|
var countEl = document.getElementById(id);
|
||||||
|
|
||||||
if (count > 1) {
|
if (count > 1) {
|
||||||
count--;
|
count--;
|
||||||
countEl.value = count;
|
countEl.value = count;
|
||||||
|
|
||||||
if (id=="count") {
|
if (id=="count") {
|
||||||
price = $("#unit_price").text();
|
price = $("#unit_price").text();
|
||||||
@@ -883,15 +891,15 @@ $(function() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$(".keypress_qty").on('keyup change', function (){
|
||||||
$('.keypress_qty').keyup(function(e){
|
// $('.keypress_qty').keyup(function(e){
|
||||||
|
|
||||||
id = $(this).attr('id');
|
id = $(this).attr('id');
|
||||||
value = $(this).val();
|
value = $(this).val();
|
||||||
|
|
||||||
if ($.isNumeric(value)) {
|
if ($.isNumeric(value)) {
|
||||||
$('.change_qty').attr('value',value);
|
|
||||||
if (id=="count") {
|
if (id=="count") {
|
||||||
|
$('.change_qty').attr('value',value);
|
||||||
price = $("#unit_price").text();
|
price = $("#unit_price").text();
|
||||||
$("#total_price").text(value*price);
|
$("#total_price").text(value*price);
|
||||||
}else{
|
}else{
|
||||||
|
|||||||
@@ -41,9 +41,9 @@ class Transactions::ShiftSalesController < ApplicationController
|
|||||||
@other_payment = ShiftSale.get_by_shift_other_payment(@shift)
|
@other_payment = ShiftSale.get_by_shift_other_payment(@shift)
|
||||||
|
|
||||||
# Calculate price_by_accounts
|
# Calculate price_by_accounts
|
||||||
@total_amount_by_account = ShiftSale.calculate_total_price_by_accounts(@shift,'amount')
|
@total_amount_by_account = ShiftSale.calculate_total_price_by_accounts(@shift,'amount')
|
||||||
@total_discount_by_account = ShiftSale.calculate_total_price_by_accounts(@shift,'discount')
|
@total_discount_by_account = ShiftSale.calculate_total_price_by_accounts(@shift,'discount')
|
||||||
@total_member_discount = ShiftSale.get_total_member_discount(@shift)
|
@total_member_discount = ShiftSale.get_total_member_discount(@shift)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -777,35 +777,34 @@ end
|
|||||||
|
|
||||||
def self.get_separate_tax(shift_sale_range=nil,shift,from,to,payment_type)
|
def self.get_separate_tax(shift_sale_range=nil,shift,from,to,payment_type)
|
||||||
|
|
||||||
if payment_type.blank?
|
# wrong amount tax for service and commercial tax
|
||||||
payment_type = ''
|
|
||||||
else
|
# if payment_type.blank?
|
||||||
if payment_type == 'card'
|
# payment_type = ''
|
||||||
payment_type = " and sale_payments.payment_method = 'mpu' or sale_payments.payment_method = 'visa' or sale_payments.payment_method = 'master' or sale_payments.payment_method = 'jcb' or sale_payments.payment_method = 'paypar'"
|
# else
|
||||||
else
|
# if payment_type == 'card'
|
||||||
payment_type = " and sale_payments.payment_method = '#{payment_type}'"
|
# payment_type = " and sale_payments.payment_method = 'mpu' or sale_payments.payment_method = 'visa' or sale_payments.payment_method = 'master' or sale_payments.payment_method = 'jcb' or sale_payments.payment_method = 'paypar'"
|
||||||
end
|
# else
|
||||||
end
|
# payment_type = " and sale_payments.payment_method = '#{payment_type}'"
|
||||||
|
# end
|
||||||
|
# end
|
||||||
|
|
||||||
if shift.present?
|
if shift.present?
|
||||||
query = SaleTax.select("SUM(tax_payable_amount) AS st_amount,tax_name")
|
query = SaleTax.select("SUM(tax_payable_amount) AS st_amount,tax_name")
|
||||||
.joins("LEFT JOIN sales ON sales.sale_id = sale_taxes.sale_id")
|
.joins("LEFT JOIN sales ON sales.sale_id = sale_taxes.sale_id")
|
||||||
.joins("join sale_payments on sale_payments.sale_id = sales.sale_id")
|
.where("sales.shift_sale_id in (?) and sale_status= 'completed'", shift.to_a)
|
||||||
.where("sales.shift_sale_id in (?) #{payment_type} and sale_status= 'completed' and sale_payments.payment_amount != 0", shift.to_a)
|
|
||||||
.group("sale_taxes.tax_name")
|
.group("sale_taxes.tax_name")
|
||||||
.order("sale_taxes.sale_tax_id asc")
|
.order("sale_taxes.sale_tax_id asc")
|
||||||
elsif shift_sale_range.present?
|
elsif shift_sale_range.present?
|
||||||
query = SaleTax.select("SUM(tax_payable_amount) AS st_amount,tax_name")
|
query = SaleTax.select("SUM(tax_payable_amount) AS st_amount,tax_name")
|
||||||
.joins("LEFT JOIN sales ON sales.sale_id = sale_taxes.sale_id")
|
.joins("LEFT JOIN sales ON sales.sale_id = sale_taxes.sale_id")
|
||||||
.joins("join sale_payments on sale_payments.sale_id = sales.sale_id")
|
.where("sales.shift_sale_id in (?) and sale_status= 'completed'", shift_sale_range.to_a)
|
||||||
.where("sales.shift_sale_id in (?) #{payment_type} and sale_status= 'completed' and sale_payments.payment_amount != 0", shift_sale_range.to_a)
|
|
||||||
.group("sale_taxes.tax_name")
|
.group("sale_taxes.tax_name")
|
||||||
.order("sale_taxes.sale_tax_id asc")
|
.order("sale_taxes.sale_tax_id asc")
|
||||||
else
|
else
|
||||||
query = SaleTax.select("SUM(tax_payable_amount) AS st_amount,tax_name")
|
query = SaleTax.select("SUM(tax_payable_amount) AS st_amount,tax_name")
|
||||||
.joins("LEFT JOIN sales ON sales.sale_id = sale_taxes.sale_id")
|
.joins("LEFT JOIN sales ON sales.sale_id = sale_taxes.sale_id")
|
||||||
.joins("join sale_payments on sale_payments.sale_id = sales.sale_id")
|
.where("sales.receipt_date between ? and ? and sale_status= 'completed'", from,to)
|
||||||
.where("sales.receipt_date between ? and ? #{payment_type} and sale_status= 'completed' and sale_payments.payment_amount != 0", from,to)
|
|
||||||
.group("sale_taxes.tax_name")
|
.group("sale_taxes.tax_name")
|
||||||
.order("sale_taxes.sale_tax_id asc")
|
.order("sale_taxes.sale_tax_id asc")
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<% if period_type != false %>
|
<% if period_type != false %>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||||
<label class="font-14"><%= t("views.right_panel.detail.select_period") %><%= t("views.right_panel.detail.select_period") %></label>
|
<label class="font-14"><%= t("views.right_panel.detail.select_period") %></label>
|
||||||
<select name="period" id="sel_period" class="form-control">
|
<select name="period" id="sel_period" class="form-control">
|
||||||
<option value=""><%= t("views.right_panel.detail.select_period") %></option>
|
<option value=""><%= t("views.right_panel.detail.select_period") %></option>
|
||||||
<option value="0">Today</option>
|
<option value="0">Today</option>
|
||||||
|
|||||||
Reference in New Issue
Block a user