change order reservation data

This commit is contained in:
phyusin
2018-05-09 19:10:11 +06:30
parent fe306dc26b
commit 0127b23e93
9 changed files with 113 additions and 78 deletions

View File

@@ -360,7 +360,7 @@
<tr>
<td width ="50%" class="footer-td align-left col-blue">
<button type="button" class="btn btn-lg bg-red waves-effect" id="cancel" data-value="rejected">
<strong>DECLINE</strong>
<strong>REJECT</strong>
</button>
</td>
<td width ="50%" class="footer-td align-right col-blue">
@@ -394,8 +394,8 @@
</tr>
</table>
</div>
<div class="card-block">
<table class="table">
<div class="card-block" style="height: 520px">
<table class="table tbl_customer">
<tbody>
<tr>
<td class="body-td align-left">
@@ -413,8 +413,8 @@
<b id="customer_name"></b>
</td>
<td class="body-td align-right expected_time">
<span class="font-13">EXPECTED TIME</span><br>
<b id="expected_time"></b>
<span class="font-13">COOKING TIME</span><br>
<b><span id="expected_time"></span> MINS</b>
</td>
</tr>
<tr>
@@ -467,7 +467,7 @@
<div class="row text-center m-t-20">
<div class="col-xs-3 col-sm-3 col-md-3 col-lg-3"></div>
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
<button type="button" class="btn btn-lg btn-link bg-info timer_type" data-value="plus">After</button>
<button type="button" class="btn btn-lg btn-link bg-info timer_type" data-value="after">After</button>
</div>
</div>

View File

@@ -71,7 +71,6 @@
delimiter = ""
end %>
<%
discount_amount = 0.0
delivery_fee = 0.0
convenience_charge = 0.0
@@ -96,20 +95,24 @@
discount_amount = order_reservation.discount_amount
delivery_fee = order_reservation.delivery_fee ? order_reservation.delivery_fee : 0.0
convenience_charge = order_reservation.convenience_charge
(order_reservation.taxes).each do |tax| %>
<% end
JSON.parse(order_reservation.taxes).each do |tax_data|
if tax_data[0] == "delivery_tax"
delivery_tax = tax_data[1]
elsif tax_data[0] == "convenience_tax"
convenience_tax = tax_data[1]
elsif tax_data[0] == "commercial_tax"
commercial_tax = tax_data[1]
end
end
total_discount_amount += discount_amount.to_f
total_delivery_fee += delivery_fee.to_f
total_convenience_charge += convenience_charge
total_delivery_tax += delivery_tax
total_convenience_tax += convenience_tax
total_commercial_tax += commercial_tax
total_tax += order_reservation.total_tax
total_amount += order_reservation.total_amount
grand_total += order_reservation.grand_total
total_convenience_charge += convenience_charge.to_f
total_delivery_tax += delivery_tax.to_f
total_convenience_tax += convenience_tax.to_f
total_commercial_tax += commercial_tax.to_f
total_tax += order_reservation.total_tax.to_f
total_amount += order_reservation.total_amount.to_f
grand_total += order_reservation.grand_total.to_f
%>
<%
if order_reservation.provider == 'pick_up'
@@ -123,7 +126,7 @@
<tr>
<td><%= order_reservation.email %></td>
<td><%= order_reservation.order_reservation_type %></td>
<td><%= order_reservation.requested_time.utc.getlocal.strftime("%d %m %Y %I:%M %p") %></td>
<td><%= order_reservation.requested_time.utc.getlocal.strftime("%Y-%m-%d %I:%M %p") %></td>
<td><%= provider%></td>
<td><%= order_reservation.payment_type%></td>
<td><%= order_reservation.payment_status%></td>

View File

@@ -63,19 +63,25 @@
delivery_fee = order_reservation.delivery_fee ? order_reservation.delivery_fee : 0.0
convenience_charge = order_reservation.convenience_charge
(order_reservation.taxes).each do |tax| %>
<% end
JSON.parse(order_reservation.taxes).each do |tax_data|
if tax_data[0] == "delivery_tax"
delivery_tax = tax_data[1]
elsif tax_data[0] == "convenience_tax"
convenience_tax = tax_data[1]
elsif tax_data[0] == "commercial_tax"
commercial_tax = tax_data[1]
end
end
total_discount_amount += discount_amount.to_f
total_delivery_fee += delivery_fee.to_f
total_convenience_charge += convenience_charge
total_delivery_tax += delivery_tax
total_convenience_tax += convenience_tax
total_commercial_tax += commercial_tax
total_tax += order_reservation.total_tax
total_amount += order_reservation.total_amount
grand_total += order_reservation.grand_total
total_convenience_charge += convenience_charge.to_f
total_delivery_tax += delivery_tax.to_f
total_convenience_tax += convenience_tax.to_f
total_commercial_tax += commercial_tax.to_f
total_tax += order_reservation.total_tax.to_f
total_amount += order_reservation.total_amount.to_f
grand_total += order_reservation.grand_total.to_f
%>
<%
if order_reservation.provider == 'pick_up'
@@ -89,7 +95,7 @@
<tr>
<td><%= order_reservation.email %></td>
<td><%= order_reservation.order_reservation_type %></td>
<td><%= order_reservation.requested_time.utc.getlocal.strftime("%d %m %Y %I:%M %p") %></td>
<td><%= order_reservation.requested_time.utc.getlocal.strftime("%Y-%m-%d %I:%M %p") %></td>
<td><%= provider%></td>
<td><%= order_reservation.payment_type%></td>
<td><%= order_reservation.payment_status%></td>