Merge branch 'adminbsb_material_ui'

This commit is contained in:
Aung Myo
2018-03-13 17:39:36 +06:30
8 changed files with 31 additions and 25 deletions

View File

@@ -143,7 +143,7 @@ class Crm::CustomersController < BaseCrmController
:body => member_params,
:headers => {
'Content-Type' => 'application/json',
'Accept' => 'application/json; version=2'
'Accept' => 'application/json; version=3'
},
:timeout => 10
)
@@ -269,7 +269,7 @@ end
:body => member_params,
:headers => {
'Content-Type' => 'application/json',
'Accept' => 'application/json; version=2'
'Accept' => 'application/json; version=3'
},
:timeout => 10
)
@@ -328,7 +328,7 @@ end
:body => member_params,
:headers => {
'Content-Type' => 'application/json',
'Accept' => 'application/json; version=2'
'Accept' => 'application/json; version=3'
},
:timeout => 10
)

View File

@@ -273,7 +273,7 @@ class Origami::DiscountsController < BaseOrigamiController
auth_token:auth_token}.to_json,
:headers => {
'Content-Type' => 'application/json',
'Accept' => 'application/json; version=2'
'Accept' => 'application/json; version=3'
}, :timeout => 10)
rescue HTTParty::Error
response = {"status": false, "message": "Can't open membership server " }

View File

@@ -63,9 +63,9 @@ class Origami::PaymentsController < BaseOrigamiController
# get member information
rebate = MembershipSetting.find_by_rebate(1)
if customer.membership_id != nil && rebate
member_info = Customer.get_member_account(customer)
current_balance = SaleAudit.paymal_search(sale_id)
# current_balance = 0
# member_info = Customer.get_member_account(customer)
# current_balance = SaleAudit.paymal_search(sale_id)
current_balance = 0
end
# get printer info
print_settings=PrintSetting.find_by_unique_code(unique_code)
@@ -152,8 +152,10 @@ class Origami::PaymentsController < BaseOrigamiController
if customer.membership_id != nil && rebate && credit_data.nil?
member_info = Customer.get_member_account(customer)
rebate_amount = Customer.get_membership_transactions(customer,saleObj.receipt_no)
current_balance = SaleAudit.paymal_search(sale_id)
if member_info["status"] == true
rebate_amount = Customer.get_membership_transactions(customer,saleObj.receipt_no)
current_balance = SaleAudit.paymal_search(sale_id)
end
end
#for card sale data

View File

@@ -8,9 +8,7 @@ class Origami::RequestBillsController < ApplicationController
if !ShiftSale.current_shift.nil?
order_id = params[:id] # order_id
bk_order = BookingOrder.find_by_order_id(order_id)
puts params[:id]
puts bk_order
puts bk_order.booking_id
order = Order.find(order_id)
check_booking = Booking.find_by_booking_id(bk_order.booking_id)
if check_booking.sale_id.nil?
@@ -29,6 +27,10 @@ class Origami::RequestBillsController < ApplicationController
# Promotion Activation
Promotion.promo_activate(@sale)
if order.source == "quick_service"
result = {:status=> @status, :data => @sale.sale_id }
render :json => result.to_json
end
else
@status = false
@error_message = "No Current Open Shift for This Employee"

View File

@@ -54,7 +54,7 @@ class Origami::VoucherController < BaseOrigamiController
}.to_json,
:headers => {
'Content-Type' => 'application/json',
'Accept' => 'application/json; version=2'
'Accept' => 'application/json; version=3'
}, :timeout => 10
)
rescue Net::OpenTimeout

View File

@@ -31,7 +31,7 @@ class Customer < ApplicationRecord
}.to_json,
:headers => {
'Content-Type' => 'application/json',
'Accept' => 'application/json; version=2'
'Accept' => 'application/json; version=3'
},
:timeout => 10)
rescue HTTParty::Error
@@ -68,7 +68,7 @@ class Customer < ApplicationRecord
}.to_json,
:headers => {
'Content-Type' => 'application/json',
'Accept' => 'application/json; version=2'
'Accept' => 'application/json; version=3'
},
:timeout => 10
)
@@ -121,7 +121,7 @@ class Customer < ApplicationRecord
:body => member_params,
:headers => {
'Content-Type' => 'application/json',
'Accept' => 'application/json; version=2'
'Accept' => 'application/json; version=3'
})
rescue Net::OpenTimeout
response = { status: false, message: "Server Time out" }
@@ -198,7 +198,7 @@ class Customer < ApplicationRecord
}.to_json,
:headers => {
'Content-Type' => 'application/json',
'Accept' => 'application/json; version=2'
'Accept' => 'application/json; version=3'
}, :timeout => 10)
rescue Net::OpenTimeout
response = { "status": false , "message": "Connect To" }
@@ -274,7 +274,7 @@ class Customer < ApplicationRecord
}.to_json,
:headers => {
'Content-Type' => 'application/json',
'Accept' => 'application/json; version=2'
'Accept' => 'application/json; version=3'
}, :timeout => 10)
rescue Net::OpenTimeout
response = { "status": false , "message": "Connect To" }
@@ -309,7 +309,7 @@ class Customer < ApplicationRecord
}.to_json,
:headers => {
'Content-Type' => 'application/json',
'Accept' => 'application/json; version=2'
'Accept' => 'application/json; version=3'
},
:timeout => 10
)

View File

@@ -85,7 +85,7 @@ class SalePayment < ApplicationRecord
}.to_json,
:headers => {
'Content-Type' => 'application/json',
'Accept' => 'application/json; version=2'
'Accept' => 'application/json; version=3'
}, :timeout => 10
)
rescue Net::OpenTimeout
@@ -133,7 +133,7 @@ class SalePayment < ApplicationRecord
auth_token:auth_token}.to_json,
:headers => {
'Content-Type' => 'application/json',
'Accept' => 'application/json; version=2'
'Accept' => 'application/json; version=3'
},
:timeout => 10
)
@@ -455,7 +455,7 @@ class SalePayment < ApplicationRecord
}.to_json,
:headers => {
'Content-Type' => 'application/json',
'Accept' => 'application/json; version=2'
'Accept' => 'application/json; version=3'
}, :timeout => 10)
rescue Net::OpenTimeout
response = { "status": false , "message": " Connection timeout" }
@@ -500,7 +500,8 @@ class SalePayment < ApplicationRecord
end
rebate_arr.push(data)
end
Rails.logger.debug "Rebage Response"
Rails.logger.debug rebate_arr.to_json
total_amount = rebate_prices - payparcost - overall_dis
if credit == 1
@@ -531,7 +532,7 @@ class SalePayment < ApplicationRecord
}.to_json,
:headers => {
'Content-Type' => 'application/json',
'Accept' => 'application/json; version=2'
'Accept' => 'application/json; version=3'
}, :timeout => 10)
rescue Net::OpenTimeout
response = { "status": false , "message": "Connect To" }

View File

@@ -203,11 +203,12 @@ $(document).ready(function(){
url: ajax_url,
// data: 'order_id='+ order_id,
success: function (result) {
console.log(result)
if (!result.status) {
swal("Information!", result.error_message);
}
else {
location.reload();
window.location.href = '../pending_order/'+ result.data;
}
}
});