diff --git a/app/assets/javascripts/origami.js b/app/assets/javascripts/origami.js index 8ce3d0c4..21ec1c92 100644 --- a/app/assets/javascripts/origami.js +++ b/app/assets/javascripts/origami.js @@ -18,17 +18,17 @@ $(document).ready(function(){ $(".orders").on('click', function(){ - var zone_name=$(this).find(".orders-table").text(); + var zone_name=$(this).find(".orders-table").text(); var receipt_no=$(this).find(".orders-receipt-no").text(); var unique_id=$(this).find(".orders-id").text(); - var order_status=$(this).find(".orders-order-status").text().trim(); + var order_status=$(this).find(".orders-order-status").text().trim(); // Enable/Disable Button control_button(order_status); //for customer button if(unique_id.charAt(0) == 'S'){ - $("#customer").removeAttr('disabled'); + $("#customer").removeAttr('disabled'); }else{ $("#customer").attr('disabled','disabled'); } @@ -49,7 +49,7 @@ $(document).ready(function(){ type: "GET", url: "origami/" + unique_id, data: { 'id' : unique_id }, - success:function(result){ + success:function(result){ for (i = 0; i < result.length; i++) { var data = JSON.stringify(result[i]); var parse_data = JSON.parse(data); @@ -78,7 +78,7 @@ $(document).ready(function(){ $("#order-grand-total").text(grand_total_amount); // Ordered Items - var order_items_rows = "" + + var order_items_rows = "" + "" + parse_data.item_name + "" + "" + parse_data.qty + "" + "" + parse_data.qty*parse_data.price + "" + @@ -94,9 +94,9 @@ $(document).ready(function(){ $(this).addClass('selected-item'); }); - // Bill Request + // Bill Request $('#request_bills').click(function() { - var order_id=$(".selected-item").find(".orders-id").text(); + var order_id=$(".selected-item").find(".orders-id").text(); if(order_id!=""){ window.location.href = '/origami/request_bills/'+ order_id } @@ -106,16 +106,16 @@ $(document).ready(function(){ return false; }); - // Discount for Payment + // Discount for Payment $('#discount').click(function() { - var order_id=$(".selected-item").find(".orders-id").text(); + var order_id=$(".selected-item").find(".orders-id").text(); if(order_id!=""){ window.location.href = '/origami/discount/'+ order_id } else { alert("Please select an order!"); - } - + } + return false; }); @@ -125,11 +125,11 @@ $(document).ready(function(){ var sub_total = $('#order-sub-total').text(); var grand_total = $('#order-grand-total').text(); var discount_type = $('#discount-type').val(); - var discount_value = $('#discount-amount').val(); + var discount_value = $('#discount-amount').val(); var discount_amount = discount_value; // For Percentage Discount - if(discount_type == 1){ + if(discount_type == 1){ discount_amount=(sub_total*discount_value)/100; } @@ -150,8 +150,8 @@ $(document).ready(function(){ } else { alert("Please select an order!"); - } - + } + return false; }); @@ -168,7 +168,7 @@ $(document).ready(function(){ original_value = $('#discount-amount').val(); var input_type = $(this).attr("data-type"); - + switch (input_type) { case 'num': var input_value = $(this).attr("data-value"); @@ -179,7 +179,7 @@ $(document).ready(function(){ else{ $('#discount-amount').val(original_value + '' + input_value); update_balance(); - } + } break; case 'add': @@ -210,16 +210,16 @@ $(document).ready(function(){ }); /* Button Control by Status */ -function control_button(order_status){ +function control_button(order_status){ if(order_status=="billed"){ $("#request_bills").prop('disabled', true); $("#discount").prop('disabled', false); - $("#pay").prop('disabled', false); + $("#pay-bill").prop('disabled', false); } else if(order_status=="new") { $("#request_bills").prop('disabled', false); $("#discount").prop('disabled', true); - $("#pay").prop('disabled', true); + $("#pay-bill").prop('disabled', true); } } @@ -236,9 +236,6 @@ function update_balance(){ } var total = (parseFloat(sub_total) + parseFloat(tax)) - discount_amount; - $('#order-discount').text(discount_amount); + $('#order-discount').text(discount_amount); $('#order-grand-total').text(total); } - - - diff --git a/app/assets/stylesheets/origami.scss b/app/assets/stylesheets/origami.scss index 0be16266..c37f2678 100644 --- a/app/assets/stylesheets/origami.scss +++ b/app/assets/stylesheets/origami.scss @@ -7,17 +7,36 @@ // min-height: 75rem; // padding-top: 4.5rem; // } +.others-payment{ + line-height:100px; + text-align:center; + color:white; + width:300px; + height:100px; + font-size:18px; +} .cashier_number{ - height:76px; - line-height:80px; + width: 30%; + height:71px; + line-height:71px; + text-align:center; background:#54A5AF; - float:left; - margin:2px; + // float:left; + // margin:2px; + font-size:20px; + color:white; + // cursor:pointer; +} + +.pay{ + width: 98%; + height:210px; + line-height:210px; + text-align:center; font-size:20px; color:white; - cursor:pointer; } .cashier_number:hover{ @@ -25,7 +44,7 @@ } .long{ - width:100% + width:49% } .sold { @@ -42,17 +61,17 @@ } .charges-name { - width: 80%; + width: 80%; text-align: left; } .item-name { - width: 60%; + width: 60%; text-align: left; } .item-attr { - width: 20%; + width: 20%; text-align: right; } @@ -70,7 +89,13 @@ background-color: #009900 } +.left{ + margin-left:1px; +} +.bottom{ + margin-bottom: 1px; +} /*----- Reset -----*/ select.form-control { diff --git a/app/views/origami/home/index.html.erb b/app/views/origami/home/index.html.erb index 9e406ede..e25aebd5 100644 --- a/app/views/origami/home/index.html.erb +++ b/app/views/origami/home/index.html.erb @@ -215,13 +215,13 @@ - - + + - + - + diff --git a/app/views/origami/others_payments/index.html.erb b/app/views/origami/others_payments/index.html.erb index bd77effd..7ac1a145 100644 --- a/app/views/origami/others_payments/index.html.erb +++ b/app/views/origami/others_payments/index.html.erb @@ -1,10 +1,10 @@
-
+
<% @payment_method_setting.each do |payment_method|%>
-
<%= payment_method.payment_method %>
+
<%= payment_method.payment_method %>
<% end %>
diff --git a/app/views/origami/payments/show.html.erb b/app/views/origami/payments/show.html.erb index f16ef927..4e7744f3 100644 --- a/app/views/origami/payments/show.html.erb +++ b/app/views/origami/payments/show.html.erb @@ -1,25 +1,35 @@
-
+
- Receipt No : <%=@sale_data.receipt_no rescue ' '%> - Receipt Date : <%=@sale_data.receipt_date.utc.getlocal.strftime("%d/%m/%Y - %I:%M %p") rescue '-'%> - Table No <% if @sale_data%>- <%=@sale_data.receipt_no%><% end %> - Sale Id <% if @sale_data %><%=@sale_data.sale_id %><% end %> + + + + + + + + + + + + + +
Receipt No : <%=@sale_data.receipt_no rescue ' '%>Receipt Date : <%=@sale_data.receipt_date.utc.getlocal.strftime("%d/%m/%Y - %I:%M %p") rescue '-'%>
Table No <% if @sale_data%>- <%=@sale_data.receipt_no%><% end %>Sale Id <% if @sale_data %><%=@sale_data.sale_id %><% end %>
Customer : Default CustomerPoints : 1234
- - +
+ - - + - +
ItemsQTY - Price + ItemsQTY + Price
@@ -71,95 +81,80 @@
-
-
AMOUNT DUE
-
<%= @sale_data.grand_total %>
+
+
Amount Due
+
<%= @sale_data.grand_total %>

-
CASH
+
Cash
<%= @cash %>

-
CREDIT
+
Credit
0.0

-
OTHERS PAYMENT
+
Others Payment
0.0

-
BALANCE
+
Balance
<%= @sale_data.grand_total %>

-
-
-
-
-
-
1
-
2
-
3
-
-
-
-
1000
+ +
+
+
+
1
+
2
+
3
+
+
+
4
+
5
+
6
+
+
+
7
+
8
+
9
+
+
+
0
+
.
+
00
+
+
+
+
Del
+
Clr
-
-
-
-
4
-
5
-
6
-
+
+
+
1000
+
3000
-
-
5000
+
+
5000
+
10000
+
+
+
Pay
-
-
-
-
7
-
8
-
9
-
-
-
-
10000
-
-
-
-
-
-
0
-
.
-
00
-
-
-
-
50000
-
-
-
-
-
-
-
DEL
-
CLR
-
-
-
-
PAY
-
-
-
+ +
+
+ + +
diff --git a/lib/tasks/clear_data.rake b/lib/tasks/clear_data.rake new file mode 100644 index 00000000..c9e0fe22 --- /dev/null +++ b/lib/tasks/clear_data.rake @@ -0,0 +1,16 @@ +namespace :clear do + desc "Clear Data" + task :data => :environment do + BookingOrder.delete_all + Booking.delete_all + OrderItem.delete_all + AssignedOrderItem.delete_all + Order.delete_all + SaleOrder.delete_all + SaleItem.delete_all + Sale.delete_all + SaleAudit.delete_all + SalePayment.delete_all + puts "Clear Data Done." + end +end