update discount message
This commit is contained in:
@@ -187,8 +187,12 @@ class Origami::DiscountsController < BaseOrigamiController
|
||||
# Re-calc All Amount in Sale
|
||||
if response["status"] == true
|
||||
sale.compute_by_sale_items(sale_id, sale.sale_items, response["rebate_earned"].to_f,"member_discount")
|
||||
result = {:status=> "Success", :table_id => table_id, :table_type => table_type,:table_type => table_type }
|
||||
end
|
||||
|
||||
if response[:status] == false
|
||||
result = {:status=> "Success", :table_id => table_id, :table_type => table_type,:table_type => table_type,:url_status => response[:status],:url_message => response[:message] }
|
||||
end
|
||||
|
||||
render :json => result.to_json
|
||||
end
|
||||
|
||||
@@ -491,6 +491,9 @@ $(document).ready(function(){
|
||||
|
||||
// Selected Account
|
||||
var account_types = JSON.stringify(get_selected_account_types());
|
||||
|
||||
if($('.accounts-type').hasClass('selected-account') == true){
|
||||
|
||||
var params = {'sale_id':sale_id, 'sub_total':sub_total, 'account_types':account_types };
|
||||
|
||||
$.ajax({
|
||||
@@ -501,17 +504,23 @@ $(document).ready(function(){
|
||||
|
||||
if (result.url_status == false) {
|
||||
status = result.url_message
|
||||
type = 'red'
|
||||
btn_color = 'btn-red'
|
||||
}else{
|
||||
status = result.status
|
||||
type = ''
|
||||
btn_color = 'btn-green'
|
||||
}
|
||||
|
||||
$.confirm({
|
||||
title: 'Infomation!',
|
||||
content: status,
|
||||
columnClass: 'small',
|
||||
type: type,
|
||||
buttons: {
|
||||
confirm: {
|
||||
text: 'Ok',
|
||||
btnClass: 'btn-green',
|
||||
btnClass: btn_color,
|
||||
action: function(){
|
||||
if(result.table_type == "Table"){
|
||||
window.location.href = "/origami/table/" + result.table_id
|
||||
@@ -526,7 +535,22 @@ $(document).ready(function(){
|
||||
|
||||
}
|
||||
});
|
||||
}else{
|
||||
$.confirm({
|
||||
title: 'Alert !',
|
||||
content: 'Please Select Account',
|
||||
type: 'red',
|
||||
typeAnimated: true,
|
||||
buttons: {
|
||||
confirm: {
|
||||
text: 'Ok',
|
||||
btnClass: 'btn-danger',
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
});//end member discount
|
||||
});
|
||||
|
||||
/* Remove Selection */
|
||||
|
||||
Reference in New Issue
Block a user