From 70a908158f00f02222d68476278f315989f25aa5 Mon Sep 17 00:00:00 2001 From: phyusin Date: Mon, 6 Nov 2017 16:02:01 +0630 Subject: [PATCH 1/2] fix for checkbox in promotion and Back btn fix for Customers in Origami --- app/views/origami/customers/index.html.erb | 3 ++- app/views/settings/promotions/_form.html.erb | 20 +++++++++++--------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/app/views/origami/customers/index.html.erb b/app/views/origami/customers/index.html.erb index 488f32e9..3c40c8ed 100755 --- a/app/views/origami/customers/index.html.erb +++ b/app/views/origami/customers/index.html.erb @@ -5,7 +5,8 @@ - <%= link_to 'Back', dashboard_path %> + Back + diff --git a/app/views/settings/promotions/_form.html.erb b/app/views/settings/promotions/_form.html.erb index 0b333ede..f8e54317 100755 --- a/app/views/settings/promotions/_form.html.erb +++ b/app/views/settings/promotions/_form.html.erb @@ -82,17 +82,19 @@
-
- +
+
<%= f.hidden_field :promo_day, :class => "form-control" %> -
-
-
-
-
-
-
+
+    +    +    +    +    +    + +
- - # - Items - QTY - Price - - - -
-
- -
- - - <% sub_total = 0 - count = 0 - %> - <% @sale_data.sale_items.each do |sale_item| - count += 1 - %> - - <% sub_total += sale_item.price%> - - - - - - - <%end %> - -
<%= count %> - <%=sale_item.product_name%>@<%=sale_item.unit_price%> - - <%=sale_item.qty%> - - <%=(sale_item.price)%> -
-
-
- -
- +
+
+ +
+ + + <% sub_total = 0 + count = 0 + %> + <% @sale_data.sale_items.each do |sale_item| + count += 1 + %> + + <% sub_total += sale_item.price%> + + + + + + + <%end %> + +
<%= count %><%=sale_item.product_name%>@<%=sale_item.unit_price%><%=sale_item.qty%><%=(sale_item.price)%>
+
+
+ + + + + + + + +
+
+
+
+
Amount Due
+
<%= @sale_data.grand_total %>
+
+
+
+
Cash
+
<%= @cash %>
+
+ +
+
Credit
+
<%= @credit %>
+
+ <% if @other == 0.0 && @ppamount == 0.0 && @visacount == 0.0 && @jcbcount == 0.0 && @mastercount == 0.0%> +
+
Other Payments
+
<%= @other %>
+
+ <% else %> +
+
Other Payments
+
+ <% end %> +
+
+
+ + <% if @other != 0.0 %> +
+
+
MPU
+
<%= @other %>
+ <% else %> + + <% end %> + + <% if @ppamount != 0.0 %> +
+
+
Redeem
+
<%= @ppamount %>
+
+ <% else %> + + <% end %> + + <% if @visacount != 0.0 %> +
+
+
Visa
+
<%= @visacount %>
+
+ <% else %> + + <% end %> + + <% if @jcbcount != 0.0 %> +
+
+
JCB
+
<%= @jcbcount %>
+
+ <% else %> + + <% end %> + + <% if @mastercount != 0.0 %> +
+
+
Master
+
<%= @mastercount %>
+
+ <% else %> + + <% end %> +
+
+
Balance
+
<%= @sale_data.grand_total %>
+
+
-
-
-
-
Amount Due
-
<%= @sale_data.grand_total %>
-
-
-
-
Cash
-
<%= @cash %>
-
- -
-
Credit
-
<%= @credit %>
-
- <% if @other == 0.0 && @ppamount == 0.0 && @visacount == 0.0 && @jcbcount == 0.0 && @mastercount == 0.0%> -
-
Other Payments
-
<%= @other %>
-
- <% else %> -
-
Other Payments
-
- <% end %> - - - <% if @other != 0.0 %> -
-
-
MPU
-
<%= @other %>
-
- <% else %> - - <% end %> - - <% if @ppamount != 0.0 %> -
-
-
Redeem
-
<%= @ppamount %>
-
- <% else %> - - <% end %> - - <% if @visacount != 0.0 %> -
-
-
Visa
-
<%= @visacount %>
-
- <% else %> - - <% end %> - - <% if @jcbcount != 0.0 %> -
-
-
JCB
-
<%= @jcbcount %>
-
- <% else %> - - <% end %> - - <% if @mastercount != 0.0 %> -
-
-
Master
-
<%= @mastercount %>
-
- <% else %> - - <% end %> -
-
-
Balance
-
<%= @sale_data.grand_total %>
-
-
- -
-
-
-
1
-
2
-
3
+ -
- - - +
+
+ +
@@ -393,16 +394,16 @@ title: "Infomation!", text: 'Changed amount ' + $('#balance').text() * (-1), }, function () { - window.location.href = '/origami'; + window.location.href = '/origami'; }); }else{ $('#pay').text("Pay"); swal({ - title: "Infomation!", - text: 'Thank You !', - }, function () { - window.location.href = '/origami'; - }); + title: "Infomation!", + text: 'Thank You !', + }, function () { + window.location.href = '/origami'; + }); } } }); @@ -411,19 +412,19 @@ $('#void').on('click',function () { swal({ - title: "Infomation!", - text: 'Are you sure want to Void !', - }, function () { - var sale_id = $('#sale_id').text(); - var ajax_url = "/origami/sale/" + sale_id + '/void'; - $.ajax({ - type: 'POST', - url: ajax_url, - success: function () { - window.location.href = '/origami/'; - } - }) - }); + title: "Infomation!", + text: 'Are you sure want to Void !', + }, function () { + var sale_id = $('#sale_id').text(); + var ajax_url = "/origami/sale/" + sale_id + '/void'; + $.ajax({ + type: 'POST', + url: ajax_url, + success: function () { + window.location.href = '/origami/'; + } + }) + }); }); }); @@ -459,17 +460,17 @@ if (cash > 0) { swal({ - title: "Infomation!", - text: 'Thank You !', - }, function () { - window.location.href = '/origami'; - }); + title: "Infomation!", + text: 'Thank You !', + }, function () { + window.location.href = '/origami'; + }); } } }); }); - + function calculate_member_discount(sale_id) { var sub_total = $('#sub-total').text(); var member_id = $('#membership_id').text();