add payment type in order reservation
This commit is contained in:
@@ -7,6 +7,7 @@ $(function() {
|
||||
$('#cancel').hide();
|
||||
$(".tbl_customer").hide();
|
||||
$(".order_close_cashier").hide();
|
||||
$(".order_payment_type").hide();
|
||||
$(function() {
|
||||
$('.first-1').click();
|
||||
});
|
||||
@@ -253,6 +254,8 @@ function refreshDetailData(){
|
||||
$('#grand_total').text("0.00");
|
||||
$(".tbl_customer").hide();
|
||||
$(".order_close_cashier").hide();
|
||||
$(".order_payment_type").hide();
|
||||
$("#payment_type").text("");
|
||||
}
|
||||
|
||||
//show order list
|
||||
@@ -355,6 +358,8 @@ function show_order_detail(url,sr_no){
|
||||
$('#phone').text(data.phone);
|
||||
$('#address').text(address);
|
||||
|
||||
$(".order_payment_type").show();
|
||||
$("#payment_type").text(data.payment_type);
|
||||
$('#ref_no').text(data.transaction_ref);
|
||||
$('#callback_url').text(data.callback_url);
|
||||
$('#order_id').text(data.order_reservation_id);
|
||||
|
||||
@@ -173,7 +173,6 @@ class OrderReservation < ApplicationRecord
|
||||
end
|
||||
|
||||
def self.send_status_to_ordering(url,ref_no,status,waiting_time=nil,min_type=nil,reason=nil)
|
||||
puts "send status to ordering"
|
||||
base_url = 'https://api.doemal.com'
|
||||
token = '3T-tnlYtFJ-5Z1vY6XQqxQ'
|
||||
order_reservation = Lookup.collection_of("order_reservation")
|
||||
@@ -400,7 +399,7 @@ class OrderReservation < ApplicationRecord
|
||||
if filter.blank?
|
||||
keyword = ''
|
||||
else
|
||||
keyword = "status LIKE '%#{filter}%'"
|
||||
keyword = "status LIKE '%#{filter}%' OR payment_type LIKE '%#{filter}%'"
|
||||
end
|
||||
|
||||
if from.present? && to.present?
|
||||
@@ -411,7 +410,7 @@ class OrderReservation < ApplicationRecord
|
||||
else
|
||||
select("order_reservations.*, deliveries.provider, deliveries.delivery_fee")
|
||||
.joins(" JOIN deliveries on deliveries.order_reservation_id = order_reservations.order_reservation_id")
|
||||
.where("status LIKE '%#{filter}%'")
|
||||
.where("status LIKE '%#{filter}%' OR payment_type LIKE '%#{filter}%'")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -398,10 +398,14 @@
|
||||
<table class="table tbl_customer">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td colspan="2" class="body-td align-left">
|
||||
<td class="body-td align-left">
|
||||
<span class="font-13">REF.</span><br>
|
||||
<b id="trans_ref"></b>
|
||||
</td>
|
||||
<td class="body-td align-left order_payment_type">
|
||||
<span class="font-13">PAYMENT</span><br>
|
||||
<b id="payment_type"></b>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="body-td align-left">
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<div class="row clearfix">
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
|
||||
<label><%= t("views.right_panel.detail.enter_keyboards") %></label>
|
||||
<input type="text" id="filter" name="filter" class="form-control" placeholder="Status" style="margin-right: 10px;height: 34px;">
|
||||
<input type="text" id="filter" name="filter" class="form-control" placeholder="Status/Payment Type" style="margin-right: 10px;height: 34px;">
|
||||
</div>
|
||||
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
<th><%= t("views.right_panel.detail.requested_time") %></th>
|
||||
<th><%= t("views.right_panel.detail.cooking_time") %></th>
|
||||
<th><%= t("views.right_panel.detail.status") %></th>
|
||||
<th><%= t :payment %> <%= t("views.right_panel.detail.type") %></th>
|
||||
<th><%= t("views.right_panel.detail.remark") %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -58,6 +59,7 @@
|
||||
<td><%= @order_reservation.requested_time.utc.getlocal.strftime("%Y-%m-%d %I:%M %p") %></td>
|
||||
<td><%= @order_reservation.expected_waiting_time rescue '-' %></td>
|
||||
<td><%= @order_reservation.status %></td>
|
||||
<td><%= @order_reservation.payment_type %></td>
|
||||
<td><%= @order_reservation.order_remark ? @order_reservation.order_remark : @order_reservation.reservation_remark %></td>
|
||||
</tr>
|
||||
<tr style="border-top:2px solid #000">
|
||||
@@ -67,6 +69,7 @@
|
||||
<th><%= t("views.right_panel.detail.total_price") %></th>
|
||||
<th><%= t("views.right_panel.detail.created_at") %></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
<% @order_reservation.order_reservation_items.each do |item| %>
|
||||
<tr>
|
||||
@@ -76,6 +79,7 @@
|
||||
<td><%= number_with_precision(item.price > 0 ? item.qty * item.price : item.qty * item.unit_price, precision:precision.to_i, delimiter:delimiter) rescue ' '%></td>
|
||||
<td><%=l item.created_at.utc.getlocal , :format => :short rescue ' ' %></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<%
|
||||
@@ -123,27 +127,27 @@
|
||||
<tr style="border-top:2px solid #000">
|
||||
<td colspan=2 style="text-align:center"></td>
|
||||
<td><%= t("views.right_panel.detail.sub_total") %></td>
|
||||
<td colspan="3"><%= number_with_precision(total_amount, precision:precision.to_i, delimiter:delimiter) rescue ' '%></td>
|
||||
<td colspan="4"><%= number_with_precision(total_amount, precision:precision.to_i, delimiter:delimiter) rescue ' '%></td>
|
||||
</tr>
|
||||
<% if total_discount_amount > 0 %>
|
||||
<tr style="border-top:2px solid #000">
|
||||
<td colspan=2 style="text-align:center"></td>
|
||||
<td><%= t("views.right_panel.detail.discount_amount") %></td>
|
||||
<td colspan="3"><%= number_with_precision(total_discount_amount, precision:precision.to_i, delimiter:delimiter) rescue ' '%></td>
|
||||
<td colspan="4"><%= number_with_precision(total_discount_amount, precision:precision.to_i, delimiter:delimiter) rescue ' '%></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% if total_delivery_fee > 0 %>
|
||||
<tr style="border-top:2px solid #000">
|
||||
<td colspan=2 style="text-align:center"></td>
|
||||
<td><%= t("views.right_panel.detail.delivery_fee") %></td>
|
||||
<td colspan="3"><%= number_with_precision(total_delivery_fee, precision:precision.to_i, delimiter:delimiter) rescue ' '%></td>
|
||||
<td colspan="4"><%= number_with_precision(total_delivery_fee, precision:precision.to_i, delimiter:delimiter) rescue ' '%></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% if total_convenience_charge > 0 %>
|
||||
<tr style="border-top:2px solid #000">
|
||||
<td colspan=2 style="text-align:center"></td>
|
||||
<td><%= t("views.right_panel.detail.convenience_charge") %></td>
|
||||
<td colspan="3"><%= number_with_precision(total_convenience_charge, precision:precision.to_i, delimiter:delimiter) rescue ' '%></td>
|
||||
<td colspan="4"><%= number_with_precision(total_convenience_charge, precision:precision.to_i, delimiter:delimiter) rescue ' '%></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<!-- <% if total_delivery_tax > 0 %>
|
||||
@@ -171,14 +175,14 @@
|
||||
<tr style="border-top:2px solid #000">
|
||||
<td colspan=2 style="text-align:center"></td>
|
||||
<td><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.tax") %></td>
|
||||
<td colspan="3"><%= number_with_precision(total_tax, precision:precision.to_i, delimiter:delimiter) rescue ' '%></td>
|
||||
<td colspan="4"><%= number_with_precision(total_tax, precision:precision.to_i, delimiter:delimiter) rescue ' '%></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% if grand_total > 0 %>
|
||||
<tr style="border-top:2px solid #000">
|
||||
<td colspan=2 style="text-align:center"></td>
|
||||
<td colspan="2" style="text-align:center"></td>
|
||||
<td><%= t("views.right_panel.detail.grand_total") %> </td>
|
||||
<td colspan="3"><%= number_with_precision(grand_total, precision:precision.to_i, delimiter:delimiter) rescue ' '%></td>
|
||||
<td colspan="4"><%= number_with_precision(grand_total, precision:precision.to_i, delimiter:delimiter) rescue ' '%></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
|
||||
Reference in New Issue
Block a user