diff --git a/README.md b/README.md
index ef68d0b7..5ff1aeda 100755
--- a/README.md
+++ b/README.md
@@ -31,7 +31,7 @@ ruby 2.4.1p111
Campaign Id => {"campaign_type_id": 1}
-
+java -jar ~/Documents/Jade.jar http://192.168.1.88:3002
* ToDo list
diff --git a/app/controllers/origami/discounts_controller.rb b/app/controllers/origami/discounts_controller.rb
index f580a92f..1166a705 100755
--- a/app/controllers/origami/discounts_controller.rb
+++ b/app/controllers/origami/discounts_controller.rb
@@ -157,7 +157,11 @@ class Origami::DiscountsController < BaseOrigamiController
is_card = params[:is_card]
sub_total = params[:sub_total]
sale = Sale.find(sale_id)
-
+ if is_card == 'true'
+ is_card = true
+ else is_card.to_s == 'false'
+ is_card = false
+ end
# Check for Card Payment
is_card_payment = SalePayment.get_sale_payments_by_card(sale.sale_payments)
@@ -178,9 +182,7 @@ class Origami::DiscountsController < BaseOrigamiController
end
end
end
-
- generic_customer_id = sale.customer.membership_id
- account_no = sale.customer.paypar_account_no
+ generic_customer_id = sale.customer.membership_id
receipt_no = sale.receipt_no
membership = MembershipSetting.find_by_membership_type("paypar_url")
memberaction = MembershipAction.find_by_membership_type("member_discount")
@@ -188,12 +190,13 @@ class Origami::DiscountsController < BaseOrigamiController
campaign_type_id = memberaction.additional_parameter["campaign_type_id"]
auth_token = memberaction.auth_token.to_s
url = membership.gateway_url.to_s + memberaction.gateway_url.to_s
+ account_no = sale.customer.paypar_account_no rescue nil
# Check for items for Paypar Cloud
if acc_prices.length > 0
begin
response = HTTParty.post(url,
- :body => { account_no: nil,
+ :body => { account_no: account_no,
generic_customer_id:generic_customer_id ,
campaign_type_id: campaign_type_id,
receipt_no: receipt_no,
@@ -220,8 +223,8 @@ class Origami::DiscountsController < BaseOrigamiController
else
response = {"status": false, "message": "You have no selected discount item" }
end
- puts "discountttttttttttt"
- puts response.to_json
+ Rails.logger.debug "-------------- Member Discount Osaka ---------"
+ Rails.logger.debug response.to_json
# Re-calc All Amount in Sale
if response["status"] == true
discount_amount = response["discount_earned"]
diff --git a/app/views/origami/customers/index.html.erb b/app/views/origami/customers/index.html.erb
index e788a08f..03c73fea 100755
--- a/app/views/origami/customers/index.html.erb
+++ b/app/views/origami/customers/index.html.erb
@@ -32,7 +32,7 @@
-
+
@@ -423,13 +423,13 @@
success: function(data) {
if(data.status == true)
{
- var id = $("#table_id").val()
- var type = $("#type").val()
+ var id = $("#table_id").val();
+ var type = $("#type").val();
if (type=="Table") {
window.location.href = '/origami/table/'+id
}else{
- window.location.href = '/origami/room/'+id
- }
+ window.location.href = '/origami/room/'+id
+ }
}else{
swal("Alert!", "Record not found!", "error");
location.reload();
diff --git a/app/views/origami/jcb/index.html.erb b/app/views/origami/jcb/index.html.erb
index e33d4936..c7cc79f9 100755
--- a/app/views/origami/jcb/index.html.erb
+++ b/app/views/origami/jcb/index.html.erb
@@ -162,19 +162,19 @@ $('#jcb_pay').on('click',function(){
var sale_id = "<%= @sale_id %>";
if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){
$(this).off("click");
- //start member discount 5% by pay card
- var sub_total = $('#sub-total').text();
- var member_id = $('#membership_id').text();
- var member_discount = $('#member_discount').text();
- if (member_id && member_discount) {
- $.ajax({
- type: "POST",
- url: "/origami/" + sale_id + "/member_discount",
- data: {'sale_id':sale_id, 'sub_total':sub_total,'is_card':true },
- // success:function(result){
- // }
- });
- }
+ //start member discount 5% by pay card
+ // var sub_total = $('#sub-total').text();
+ // var member_id = $('#membership_id').text();
+ // var member_discount = $('#member_discount').text();
+ // if (member_id && member_discount) {
+ // $.ajax({
+ // type: "POST",
+ // url: "/origami/" + sale_id + "/member_discount",
+ // data: {'sale_id':sale_id, 'sub_total':sub_total,'is_card':true },
+ // success:function(result){
+ // }
+ // });
+ // }
//end member discount
$.ajax({type: "POST",
url: "<%= origami_payment_jcb_path %>",
diff --git a/app/views/origami/master/index.html.erb b/app/views/origami/master/index.html.erb
index 7dfac224..94a9e7c8 100755
--- a/app/views/origami/master/index.html.erb
+++ b/app/views/origami/master/index.html.erb
@@ -160,18 +160,18 @@
if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){
$(this).off("click");
//start member discount 5% by pay card
- var sub_total = $('#sub-total').text();
- var member_id = $('#membership_id').text();
- var member_discount = $('#member_discount').text();
- if (member_id && member_discount) {
- $.ajax({
- type: "POST",
- url: "/origami/" + sale_id + "/member_discount",
- data: {'sale_id':sale_id, 'sub_total':sub_total,'is_card':true },
- // success:function(result){
- // }
- });
- }
+ // var sub_total = $('#sub-total').text();
+ // var member_id = $('#membership_id').text();
+ // var member_discount = $('#member_discount').text();
+ // if (member_id && member_discount) {
+ // $.ajax({
+ // type: "POST",
+ // url: "/origami/" + sale_id + "/member_discount",
+ // data: {'sale_id':sale_id, 'sub_total':sub_total,'is_card':true },
+ // // success:function(result){
+ // // }
+ // });
+ // }
//end member discount
$.ajax({type: "POST",
url: "<%= origami_payment_master_path %>",
diff --git a/app/views/origami/mpu/index.html.erb b/app/views/origami/mpu/index.html.erb
index 85ebdc6c..722cd548 100755
--- a/app/views/origami/mpu/index.html.erb
+++ b/app/views/origami/mpu/index.html.erb
@@ -163,18 +163,18 @@
if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){
$(this).off("click");
//start member discount 5% by pay card
- var sub_total = $('#sub-total').text();
- var member_id = $('#membership_id').text();
- var member_discount = $('#member_discount').text();
- if (member_id && member_discount) {
- $.ajax({
- type: "POST",
- url: "/origami/" + sale_id + "/member_discount",
- data: {'sale_id':sale_id, 'sub_total':sub_total,'is_card':true },
- // success:function(result){
- // }
- });
- }
+ // var sub_total = $('#sub-total').text();
+ // var member_id = $('#membership_id').text();
+ // var member_discount = $('#member_discount').text();
+ // if (member_id && member_discount) {
+ // $.ajax({
+ // type: "POST",
+ // url: "/origami/" + sale_id + "/member_discount",
+ // data: {'sale_id':sale_id, 'sub_total':sub_total,'is_card':true },
+ // success:function(result){
+ // }
+ // });
+ // }
//end member discount
//Mpu Payment
$.ajax({type: "POST",
diff --git a/app/views/origami/payments/show.html.erb b/app/views/origami/payments/show.html.erb
index 286f86f3..7359397a 100755
--- a/app/views/origami/payments/show.html.erb
+++ b/app/views/origami/payments/show.html.erb
@@ -389,11 +389,11 @@
}else{
$(this).off("click");
var sale_id = $('#sale_id').text();
- var item_row = $('.is_card');
+ // var item_row = $('.is_card');
- if (item_row.length < 1) {
+ // if (item_row.length < 1) {
calculate_member_discount(sale_id);
- }
+ // }
// payment
var cash = $('#cash').text();
@@ -517,15 +517,20 @@
var sub_total = $('#sub-total').text();
var member_id = $('#membership_id').text();
var member_discount = $('#member_discount').text();
+ var item_row = $('.is_card');
if (member_id && member_discount) {
+ if (item_row.length < 1) {
+ is_card = false
+ }else{
+ is_card = true
+ }
$.ajax({
type: "POST",
url: "/origami/" + sale_id + "/member_discount",
- data: {'sale_id':sale_id, 'sub_total':sub_total,'is_card':false },
+ data: {'sale_id':sale_id, 'sub_total':sub_total,'is_card':is_card },
async: false,
success:function(result){
-
}
});
}
diff --git a/app/views/origami/visa/index.html.erb b/app/views/origami/visa/index.html.erb
index d239e231..cf0bd605 100755
--- a/app/views/origami/visa/index.html.erb
+++ b/app/views/origami/visa/index.html.erb
@@ -162,18 +162,18 @@
if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){
$(this).off("click");
//start member discount 5% by pay card
- var sub_total = $('#sub-total').text();
- var member_id = $('#membership_id').text();
- var member_discount = $('#member_discount').text();
- if (member_id && member_discount) {
- $.ajax({
- type: "POST",
- url: "/origami/" + sale_id + "/member_discount",
- data: {'sale_id':sale_id, 'sub_total':sub_total,'is_card':true },
- // success:function(result){
- // }
- });
- }
+ // var sub_total = $('#sub-total').text();
+ // var member_id = $('#membership_id').text();
+ // var member_discount = $('#member_discount').text();
+ // if (member_id && member_discount) {
+ // $.ajax({
+ // type: "POST",
+ // url: "/origami/" + sale_id + "/member_discount",
+ // data: {'sale_id':sale_id, 'sub_total':sub_total,'is_card':true },
+ // success:function(result){
+ // }
+ // });
+ // }
//end member discount
$.ajax({type: "POST",
url: "<%= origami_payment_visa_path %>",