add payment type filter for order reservation
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<% if period_type != false %>
|
||||
<div class="row">
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.select_period") %></label>
|
||||
<label class="font-13"><%= t("views.right_panel.detail.select_period") %></label>
|
||||
<select name="period" id="sel_period" class="form-control">
|
||||
<option value=""><%= t("views.right_panel.detail.select_period") %></option>
|
||||
<option value="0">Today</option>
|
||||
@@ -19,22 +19,28 @@
|
||||
</select>
|
||||
</div>
|
||||
<% if defined? providers %>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.select_providers") %></label>
|
||||
<%= select_tag "provider", options_for_select(@providers, :selected => params[:provider]), :class => "form-control" %>
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<label class="font-13"><%= t("views.right_panel.detail.select_providers") %></label>
|
||||
<%= select_tag "provider", options_for_select(@providers, :selected => params[:provider]), :class => "form-control", :style => "height: 35px;" %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if defined? payment_types %>
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<label class="font-13"><%= t("views.right_panel.detail.select_payment") %></label>
|
||||
<%= select_tag "payment_type", options_for_select(@payment_types, :selected => params[:payment_type]), :class => "form-control", :style => "height: 35px;" %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<!-- <label class="">Select Shift Period</label> -->
|
||||
<label class="font-14"><%= t("views.right_panel.detail.from") %></label>
|
||||
<label class="font-13"><%= t("views.right_panel.detail.from") %></label>
|
||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="from" id="from" type="text" placeholder="From date" style="height: 32px;">
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.to") %></label>
|
||||
<label class="font-13"><%= t("views.right_panel.detail.to") %></label>
|
||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="to" id="to" type="text" placeholder="To date" style="height: 32px;">
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.all_shift") %></label>
|
||||
<label class="font-13"><%= t("views.right_panel.detail.all_shift") %></label>
|
||||
<select class="form-control select" name="shift_name" id="shift_name" >
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
<!-- <div class="container"> -->
|
||||
<%= render :partial=>'shift_sale_report_filter',
|
||||
:locals=>{ :period_type => true, :shift_name => true,:providers => true, :report_path =>reports_order_reservation_index_path} %>
|
||||
:locals=>{ :period_type => true, :shift_name => true, :providers => true, :payment_types => true, :report_path =>reports_order_reservation_index_path} %>
|
||||
<hr />
|
||||
<!-- </div> -->
|
||||
|
||||
@@ -41,9 +41,10 @@
|
||||
<% end %>
|
||||
|
||||
<tr>
|
||||
<th><%= t("views.right_panel.detail.receipt_date") %></th>
|
||||
<th><%= t :reference_number %></th>
|
||||
<th><%= t :customer %></th>
|
||||
<th><%= t("views.right_panel.detail.type") %></th>
|
||||
<th><%= t("views.right_panel.detail.requested_time") %></th>
|
||||
<!-- <th><%= t("views.right_panel.detail.type") %></th> -->
|
||||
<th><%= t("views.right_panel.detail.provider") %></th>
|
||||
<th><%= t :payment_method %></th>
|
||||
<th><%= t :payment %> <%= t("views.right_panel.detail.status")%></th>
|
||||
@@ -124,13 +125,20 @@
|
||||
else
|
||||
provider = order_reservation.provider
|
||||
end
|
||||
payment_type = ""
|
||||
if order_reservation.payment_type == "cash_on_delivery"
|
||||
payment_type = "COD"
|
||||
elsif order_reservation.payment_type == "dinga"
|
||||
payment_type = "DINGA"
|
||||
end
|
||||
%>
|
||||
<tr>
|
||||
<td><%= order_reservation.receipt_date.utc.getlocal.strftime("%Y-%m-%d") %></td>
|
||||
<td><%= order_reservation.transaction_ref %></td>
|
||||
<td><%= order_reservation.name %></td>
|
||||
<td><%= order_reservation.order_reservation_type %></td>
|
||||
<td><%= order_reservation.requested_time.utc.getlocal.strftime("%Y-%m-%d %I:%M %p") %></td>
|
||||
<!-- <td><%= order_reservation.order_reservation_type %></td> -->
|
||||
<td><%= provider%></td>
|
||||
<td><%= order_reservation.payment_type%></td>
|
||||
<td><%= payment_type%></td>
|
||||
<td><%= order_reservation.payment_status%></td>
|
||||
<td><%= number_with_precision(order_reservation.total_amount, precision:precision.to_i, delimiter:delimiter) rescue '0.0'%></td>
|
||||
<td><%= number_with_precision(discount_amount , precision:precision.to_i, delimiter:delimiter) rescue '0.0'%></td>
|
||||
@@ -146,7 +154,7 @@
|
||||
end %>
|
||||
|
||||
<tr>
|
||||
<td colspan="6"></td>
|
||||
<td colspan="6"><b>Total</b></td>
|
||||
<td><b><%= number_with_precision(total_amount , precision:precision.to_i, delimiter:delimiter) rescue '0.0'%></b></td>
|
||||
<td><b><%= number_with_precision(total_discount_amount , precision:precision.to_i, delimiter:delimiter) rescue '0.0'%></b></td>
|
||||
<td><b><%= number_with_precision(total_delivery_fee , precision:precision.to_i, delimiter:delimiter) rescue '0.0'%></b></td>
|
||||
|
||||
@@ -24,9 +24,10 @@
|
||||
<% end %>
|
||||
|
||||
<tr>
|
||||
<th><%= t("views.right_panel.detail.receipt_date") %></th>
|
||||
<th><%= t :reference_number %></th>
|
||||
<th><%= t :customer %></th>
|
||||
<th><%= t("views.right_panel.detail.type") %></th>
|
||||
<th><%= t("views.right_panel.detail.requested_time") %></th>
|
||||
<!-- <th><%= t("views.right_panel.detail.type") %></th> -->
|
||||
<th><%= t("views.right_panel.detail.provider") %></th>
|
||||
<th><%= t :payment_method %></th>
|
||||
<th><%= t :payment %> <%= t("views.right_panel.detail.status")%></th>
|
||||
@@ -98,13 +99,20 @@
|
||||
else
|
||||
provider = order_reservation.provider
|
||||
end
|
||||
payment_type = ""
|
||||
if order_reservation.payment_type == "cash_on_delivery"
|
||||
payment_type = "COD"
|
||||
elsif order_reservation.payment_type == "dinga"
|
||||
payment_type = "DINGA"
|
||||
end
|
||||
%>
|
||||
<tr>
|
||||
<td><%= order_reservation.receipt_date.utc.getlocal.strftime("%Y-%m-%d") %></td>
|
||||
<td><%= order_reservation.transaction_ref %></td>
|
||||
<td><%= order_reservation.name %></td>
|
||||
<td><%= order_reservation.order_reservation_type %></td>
|
||||
<td><%= order_reservation.requested_time.utc.getlocal.strftime("%Y-%m-%d %I:%M %p") %></td>
|
||||
<!-- <td><%= order_reservation.order_reservation_type %></td> -->
|
||||
<td><%= provider%></td>
|
||||
<td><%= order_reservation.payment_type%></td>
|
||||
<td><%= payment_type%></td>
|
||||
<td><%= order_reservation.payment_status%></td>
|
||||
<td><%= order_reservation.total_amount rescue '0.0'%></td>
|
||||
<td><%= discount_amount rescue '0.0'%></td>
|
||||
@@ -120,7 +128,7 @@
|
||||
end %>
|
||||
|
||||
<tr>
|
||||
<td colspan="6"></td>
|
||||
<td colspan="6"><b>Total</b></td>
|
||||
<td><b><%= total_amount rescue '0.0'%></b></td>
|
||||
<td><b><%= total_discount_amount rescue '0.0'%></b></td>
|
||||
<td><b><%= total_delivery_fee rescue '0.0'%></b></td>
|
||||
|
||||
Reference in New Issue
Block a user