diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js
index d2faf9da..d7c93cd2 100755
--- a/app/assets/javascripts/application.js
+++ b/app/assets/javascripts/application.js
@@ -199,3 +199,12 @@ function export_to(path)
var form_params = $("#frm_report").serialize();
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);
+}
diff --git a/app/assets/javascripts/order_reservation.js b/app/assets/javascripts/order_reservation.js
index 74a46b14..e7f63188 100644
--- a/app/assets/javascripts/order_reservation.js
+++ b/app/assets/javascripts/order_reservation.js
@@ -483,12 +483,7 @@ function showNewOrder(order_reservation,shop_code){
var date = new Date(order_reservation.requested_time);
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;
- //audio play
- var audio = new Audio('/'+shop_code+'-beep.mp3'); // define your audio
- // setTimeout(function(){
- // audio.loop = true;
- audio.play();
- // },10000);
+ audioPlayBackground(shop_code);
// $("#new_order").text(order_reservation.order_reservation_id);
// $("#new_order_date").text(requested_date);
diff --git a/app/controllers/origami/sales_controller.rb b/app/controllers/origami/sales_controller.rb
index eee75e37..6f4980cc 100755
--- a/app/controllers/origami/sales_controller.rb
+++ b/app/controllers/origami/sales_controller.rb
@@ -41,7 +41,7 @@ class Origami::SalesController < BaseOrigamiController
end
# Re-compute for add
- saleobj.compute
+ saleobj.compute(order.source)
saleobj.save
order.save
booking.save
diff --git a/app/views/reports/dailysale/index.html.erb b/app/views/reports/dailysale/index.html.erb
index cd6e146b..67f5002e 100755
--- a/app/views/reports/dailysale/index.html.erb
+++ b/app/views/reports/dailysale/index.html.erb
@@ -151,37 +151,20 @@
<%= number_with_precision(rounding_adj, precision:precision.to_i,delimiter:delimiter) rescue '-'%> |
- <% total_tax = 0
- tax_amount = 0
- tax_name = ''
- tax_arr = [] %>
+ <% total_tax = 0 %>
<% net = 0 %>
<% unless @tax.empty? %>
- <% @tax.each do |tax| %>
- <% if tax.tax_name.downcase == tax_name.downcase
- tax_amount += tax.tax_amount
- else
- tax_amount = tax.tax_amount
- end
- tax_name = tax.tax_name
- total_tax += tax.tax_amount.to_f
- %>
+ <% @tax.each do |tax|
+ total_tax += tax.tax_amount.to_f %>
- | <%= tax_name rescue '-'%> |
- <%= number_with_precision(tax_amount, precision:precision.to_i,delimiter:delimiter) rescue '-'%> |
+ <%= tax.tax_name rescue '-'%> |
+ <%= number_with_precision(tax.tax_amount, precision:precision.to_i,delimiter:delimiter) rescue '-'%> |
|
<% end %>
<% end %>
-
-
- | Discount |
- <%= number_with_precision(discount, precision:precision.to_i,delimiter:delimiter) rescue '-'%> |
- |
-
<% net = grand_total %>
- <% net = grand_total + discount%>
<% net = net - rounding_adj%>
<% net = net - total_tax %>
diff --git a/app/views/reports/dailysale/index.xls.erb b/app/views/reports/dailysale/index.xls.erb
index c4a9285a..e0a5842e 100755
--- a/app/views/reports/dailysale/index.xls.erb
+++ b/app/views/reports/dailysale/index.xls.erb
@@ -118,6 +118,7 @@
<% total_tax = 0 %>
+ <% net = 0 %>
<% unless @tax.empty? %>
<% @tax.each do |tax| %>
<% total_tax += tax.tax_amount.to_f %>
@@ -128,7 +129,9 @@
<% end %>
- <% net = total - total_tax %>
+ <% net = grand_total %>
+ <% net = net - rounding_adj%>
+ <% net = net - total_tax %>
| <%= t("views.right_panel.detail.net_amount") %> |
<%= number_with_delimiter(sprintf("%.2f",net), :delimiter => ',') rescue '-'%> |
diff --git a/app/views/reports/receipt_no/index.html.erb b/app/views/reports/receipt_no/index.html.erb
index 5cecd715..bd06be3f 100755
--- a/app/views/reports/receipt_no/index.html.erb
+++ b/app/views/reports/receipt_no/index.html.erb
@@ -116,7 +116,9 @@
<%= number_with_precision(discount_amt, precision: precision.to_i ,delimiter: delimiter) rescue '-' %> |
<% if !@sale_taxes.empty?
@sale_taxes.each do |tax| %>
- <%= number_with_precision(tax.st_amount, precision: precision.to_i ,delimiter: delimiter) rescue '-' %> |
+
+ <%= number_with_precision(tax.st_amount, precision: precision.to_i ,delimiter: delimiter) rescue '-' %>
+ |
<% end %>
<% else %>
<% @tax_profiles.each do |tax| %>