Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant into sqa-1804-001

This commit is contained in:
phyusin
2018-05-17 11:23:23 +06:30
6 changed files with 23 additions and 31 deletions

View File

@@ -199,3 +199,12 @@ function export_to(path)
var form_params = $("#frm_report").serialize(); var form_params = $("#frm_report").serialize();
window.location = path+"?"+ form_params; window.location = path+"?"+ form_params;
} }
function audioPlayBackground(shop_code){
//audio play
var audio = new Audio('/'+shop_code+'-beep.mp3'); // define your audio
// setTimeout(function(){
// audio.loop = true;
audio.play();
// },10000);
}

View File

@@ -483,12 +483,7 @@ function showNewOrder(order_reservation,shop_code){
var date = new Date(order_reservation.requested_time); var date = new Date(order_reservation.requested_time);
var time = timeFormat(date); var time = timeFormat(date);
var requested_date = date.getFullYear() + '-' + (date.getMonth() >= 10? date.getMonth() : '0' + (date.getMonth() + 1)) +'-'+ (date.getDate() >= 10? date.getDate() : '0' + date.getDate()) +' '+time; var requested_date = date.getFullYear() + '-' + (date.getMonth() >= 10? date.getMonth() : '0' + (date.getMonth() + 1)) +'-'+ (date.getDate() >= 10? date.getDate() : '0' + date.getDate()) +' '+time;
//audio play audioPlayBackground(shop_code);
var audio = new Audio('/'+shop_code+'-beep.mp3'); // define your audio
// setTimeout(function(){
// audio.loop = true;
audio.play();
// },10000);
// $("#new_order").text(order_reservation.order_reservation_id); // $("#new_order").text(order_reservation.order_reservation_id);
// $("#new_order_date").text(requested_date); // $("#new_order_date").text(requested_date);

View File

@@ -41,7 +41,7 @@ class Origami::SalesController < BaseOrigamiController
end end
# Re-compute for add # Re-compute for add
saleobj.compute saleobj.compute(order.source)
saleobj.save saleobj.save
order.save order.save
booking.save booking.save

View File

@@ -151,37 +151,20 @@
<td style='text-align:right;'><%= number_with_precision(rounding_adj, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td> <td style='text-align:right;'><%= number_with_precision(rounding_adj, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
</tr> </tr>
<% total_tax = 0 <% total_tax = 0 %>
tax_amount = 0
tax_name = ''
tax_arr = [] %>
<% net = 0 %> <% net = 0 %>
<% unless @tax.empty? %> <% unless @tax.empty? %>
<% @tax.each do |tax| %> <% @tax.each do |tax|
<% if tax.tax_name.downcase == tax_name.downcase total_tax += tax.tax_amount.to_f %>
tax_amount += tax.tax_amount
else
tax_amount = tax.tax_amount
end
tax_name = tax.tax_name
total_tax += tax.tax_amount.to_f
%>
<tr style="font-weight:600;"> <tr style="font-weight:600;">
<td colspan="17" style='text-align:right;'><%= tax_name rescue '-'%></td> <td colspan="17" style='text-align:right;'><%= tax.tax_name rescue '-'%></td>
<td style='text-align:right;'><%= number_with_precision(tax_amount, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td> <td style='text-align:right;'><%= number_with_precision(tax.tax_amount, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td colspan="2">&nbsp;</td> <td colspan="2">&nbsp;</td>
</tr> </tr>
<% end %> <% end %>
<% end %> <% end %>
<tr style="font-weight:600;">
<td colspan="17" style='text-align:right;'>Discount </td>
<td style='text-align:right;'><%= number_with_precision(discount, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td colspan="2">&nbsp;</td>
</tr>
<% net = grand_total %> <% net = grand_total %>
<% net = grand_total + discount%>
<% net = net - rounding_adj%> <% net = net - rounding_adj%>
<% net = net - total_tax %> <% net = net - total_tax %>
<tr style="font-weight:600;"> <tr style="font-weight:600;">

View File

@@ -118,6 +118,7 @@
</tr> </tr>
<% total_tax = 0 %> <% total_tax = 0 %>
<% net = 0 %>
<% unless @tax.empty? %> <% unless @tax.empty? %>
<% @tax.each do |tax| %> <% @tax.each do |tax| %>
<% total_tax += tax.tax_amount.to_f %> <% total_tax += tax.tax_amount.to_f %>
@@ -128,7 +129,9 @@
</tr> </tr>
<% end %> <% end %>
<% net = total - total_tax %> <% net = grand_total %>
<% net = net - rounding_adj%>
<% net = net - total_tax %>
<tr style="font-weight:600;"> <tr style="font-weight:600;">
<td colspan="12" style='text-align:right;'><%= t("views.right_panel.detail.net_amount") %></td> <td colspan="12" style='text-align:right;'><%= t("views.right_panel.detail.net_amount") %></td>
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",net), :delimiter => ',') rescue '-'%></td> <td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",net), :delimiter => ',') rescue '-'%></td>

View File

@@ -116,7 +116,9 @@
<td><b><%= number_with_precision(discount_amt, precision: precision.to_i ,delimiter: delimiter) rescue '-' %></b></td> <td><b><%= number_with_precision(discount_amt, precision: precision.to_i ,delimiter: delimiter) rescue '-' %></b></td>
<% if !@sale_taxes.empty? <% if !@sale_taxes.empty?
@sale_taxes.each do |tax| %> @sale_taxes.each do |tax| %>
<td><b><%= number_with_precision(tax.st_amount, precision: precision.to_i ,delimiter: delimiter) rescue '-' %></b></td> <td>
<b><%= number_with_precision(tax.st_amount, precision: precision.to_i ,delimiter: delimiter) rescue '-' %></b>
</td>
<% end %> <% end %>
<% else %> <% else %>
<% @tax_profiles.each do |tax| %> <% @tax_profiles.each do |tax| %>