Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant into staging
This commit is contained in:
@@ -90,6 +90,8 @@ class Origami::CustomersController < BaseOrigamiController
|
|||||||
|
|
||||||
if status == true
|
if status == true
|
||||||
render json: JSON.generate({:status => true})
|
render json: JSON.generate({:status => true})
|
||||||
|
# Re-calc All Amount in Sale
|
||||||
|
sale.compute_by_sale_items(sale.sale_id, sale.sale_items, sale.total_discount)
|
||||||
else
|
else
|
||||||
render json: JSON.generate({:status => false, :error_message => "Record not found"})
|
render json: JSON.generate({:status => false, :error_message => "Record not found"})
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -274,7 +274,6 @@ class Sale < ApplicationRecord
|
|||||||
#tax_profile - list by order_by
|
#tax_profile - list by order_by
|
||||||
tax_profiles = TaxProfile.all.order("order_by asc")
|
tax_profiles = TaxProfile.all.order("order_by asc")
|
||||||
customer = Customer.find(sale.customer_id)
|
customer = Customer.find(sale.customer_id)
|
||||||
|
|
||||||
# #Creat new tax records
|
# #Creat new tax records
|
||||||
tax_profiles.each do |tax|
|
tax_profiles.each do |tax|
|
||||||
customer.tax_profiles.each do |cus_tax|
|
customer.tax_profiles.each do |cus_tax|
|
||||||
@@ -319,7 +318,6 @@ class Sale < ApplicationRecord
|
|||||||
tax_profiles = TaxProfile.all.order("order_by asc")
|
tax_profiles = TaxProfile.all.order("order_by asc")
|
||||||
|
|
||||||
customer = Customer.find(self.customer_id)
|
customer = Customer.find(self.customer_id)
|
||||||
|
|
||||||
# #Create new tax records
|
# #Create new tax records
|
||||||
tax_profiles.each do |tax|
|
tax_profiles.each do |tax|
|
||||||
customer.tax_profiles.each do |cus_tax|
|
customer.tax_profiles.each do |cus_tax|
|
||||||
|
|||||||
@@ -124,6 +124,8 @@ $(document).on('click',".customer_tr",function(){
|
|||||||
var url = "customers/" + customer_id + "/edit";
|
var url = "customers/" + customer_id + "/edit";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$("#customer_tax_profiles").children().removeAttr("selected").css({'color':'#000','background':'none'});;
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
url: url,
|
url: url,
|
||||||
@@ -135,7 +137,7 @@ $(document).on('click',".customer_tr",function(){
|
|||||||
var parse_taxes = JSON.parse(taxes);
|
var parse_taxes = JSON.parse(taxes);
|
||||||
console.log(parse_taxes);
|
console.log(parse_taxes);
|
||||||
$.each(parse_taxes, function(i, value){
|
$.each(parse_taxes, function(i, value){
|
||||||
$("#customer_tax_profiles option[value='" + value + "']").attr("selected","selected");
|
$("#customer_tax_profiles option[value='" + value + "']").attr("selected","selected").css({'color':'#fff','background':'#215d9c'});
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#customer_id').val(data.id);
|
$('#customer_id').val(data.id);
|
||||||
|
|||||||
Reference in New Issue
Block a user