diff --git a/app/assets/javascripts/custom.js b/app/assets/javascripts/custom.js
index a2011022..778de553 100644
--- a/app/assets/javascripts/custom.js
+++ b/app/assets/javascripts/custom.js
@@ -9,7 +9,8 @@ $(document).ready(function() {
color: 'rgba(0,0,0,0.5)',
alwaysVisible: false,
borderRadius: '0',
- railBorderRadius: '0'
+ railBorderRadius: '0',
+ touchScrollStep : 25
});
$('#order-detail-slimscroll').slimScroll({
@@ -18,7 +19,18 @@ $(document).ready(function() {
color: 'rgba(0,0,0,0.5)',
alwaysVisible: false,
borderRadius: '0',
- railBorderRadius: '0'
+ railBorderRadius: '0',
+ touchScrollStep : 25
+ });
+
+ $('#menu-slimscroll').slimScroll({
+ height: height-$('#menu-slimscroll').attr('data-height'),
+ size: '5px',
+ color: 'rgba(0,0,0,0.5)',
+ alwaysVisible: false,
+ borderRadius: '0',
+ railBorderRadius: '0',
+ touchScrollStep : 25
});
// $('.delete').click(function(){
diff --git a/app/controllers/origami/addorders_controller.rb b/app/controllers/origami/addorders_controller.rb
index f5bb7d37..0e905724 100755
--- a/app/controllers/origami/addorders_controller.rb
+++ b/app/controllers/origami/addorders_controller.rb
@@ -1,6 +1,6 @@
class Origami::AddordersController < BaseOrigamiController
# before_action :set_dining, only: [:detail]
-
+
def index
@tables = Table.all.active.order('zone_id asc').group("zone_id")
@rooms = Room.all.active.order('zone_id asc').group("zone_id")
diff --git a/app/controllers/origami/quick_service_controller.rb b/app/controllers/origami/quick_service_controller.rb
index 44dcfcb8..8abcfcc8 100644
--- a/app/controllers/origami/quick_service_controller.rb
+++ b/app/controllers/origami/quick_service_controller.rb
@@ -1,6 +1,12 @@
class Origami::QuickServiceController < ApplicationController
# before_action :set_dining, only: [:detail]
-
+ before_action :check_user
+ def check_user
+ if current_user.nil?
+ redirect_to root_path
+ end
+ end
+
def index
today = DateTime.now
day = Date.today.wday
@@ -211,6 +217,11 @@ class Origami::QuickServiceController < ApplicationController
end
end
+ def check_user
+ if current_user.nil?
+ redirect_to root_path
+ end
+ end
# this can always true
def check_order_with_booking(booking)
if booking.sale.sale_status == "completed" || booking.sale.sale_status == "new"
diff --git a/app/controllers/origami/request_bills_controller.rb b/app/controllers/origami/request_bills_controller.rb
index adfe35a6..e2553a83 100755
--- a/app/controllers/origami/request_bills_controller.rb
+++ b/app/controllers/origami/request_bills_controller.rb
@@ -1,5 +1,11 @@
class Origami::RequestBillsController < ApplicationController
-
+ before_action :check_user
+
+ def check_user
+ if current_user.nil?
+ redirect_to root_path
+ end
+ end
# Print Request Bill and add to sale tables
def print
@sale = Sale.new
diff --git a/app/controllers/reports/saleitem_controller.rb b/app/controllers/reports/saleitem_controller.rb
index 796b02ad..a731cb44 100755
--- a/app/controllers/reports/saleitem_controller.rb
+++ b/app/controllers/reports/saleitem_controller.rb
@@ -15,8 +15,10 @@ class Reports::SaleitemController < BaseReportController
shift = ShiftSale.where('shift_started_at = ? and shift_closed_at = ? ',shift_sale.shift_started_at, shift_sale.shift_closed_at)
end
end
- @sale_data, @other_charges,@discount_data , @cash_data , @card_data , @credit_data , @foc_data , @grand_total , @change_amount = Sale.get_by_shift_items(shift_sale_range,shift, from, to, Sale::SALE_STATUS_COMPLETED)
-
+ @type = params[:sale_type]
+ @sale_data, @other_charges,@discount_data , @cash_data , @card_data , @credit_data , @foc_data , @grand_total , @change_amount = Sale.get_by_shift_items(shift_sale_range,shift, from, to, Sale::SALE_STATUS_COMPLETED,@type)
+puts @other_charges.to_json
+puts "oooooooooooooooooooooooo"
@sale_taxes = Sale.get_separate_tax(shift_sale_range,shift,from,to,nil)
@account_cate_count = Hash.new {|hash, key| hash[key] = 0}
diff --git a/app/models/sale.rb b/app/models/sale.rb
index a997e27f..5d3c6b4d 100755
--- a/app/models/sale.rb
+++ b/app/models/sale.rb
@@ -806,12 +806,27 @@ def self.get_by_shift_sale(from,to,status)
return query = query.where("shift_sales.shift_started_at >= ?" + " AND shift_sales.shift_closed_at <= ?", from,to)
end
-def self.get_item_query()
- query = Sale.select("acc.title as account_name,mi.account_id, i.item_instance_code as item_code,i.account_id as account_id, " +
- "SUM(i.qty * i.unit_price) as grand_total,SUM(i.qty) as total_item,i.qty as qty," +
+def self.get_item_query(type)
+
+ if type == "revenue" || type.nil?
+ sale_type = "i.status IS NULL and i.qty >0 "
+ elsif type == "all"
+ sale_type = ""
+ elsif type == "discount"
+ sale_type = "i.status = 'Discount'"
+ elsif type == "foc"
+ sale_type = "i.status = 'foc' and i.qty > 0"
+ elsif type == "void"
+ sale_type = "i.status = 'void' and i.qty > 0"
+ elsif type == "other"
+ sale_type = "i.item_instance_code IS NULL"
+ end
+ query = Sale.select("acc.title as account_name,mi.account_id,
+ i.item_instance_code as item_code,i.account_id as account_id, " +
+ "SUM(i.qty * i.unit_price) as grand_total,
+ SUM(i.qty) as total_item,i.qty as qty," +
"i.status as status_type,"+
- " i.unit_price,i.price as price,i.product_name as product_name, mc.name as" +
- " menu_category_name,mc.id as menu_category_id ")
+ "i.unit_price,i.price as price,i.product_name as product_name,mc.name as " +"menu_category_name,mc.id as menu_category_id ")
query = query.joins("JOIN sale_items i ON i.sale_id = sales.sale_id" +
" JOIN menu_item_instances mii ON i.item_instance_code = mii.item_instance_code" +
@@ -820,7 +835,7 @@ def self.get_item_query()
" JOIN menu_categories mc ON mc.id = mi.menu_category_id ")
# "JOIN employee_accesses ea ON ea.`employee_id` = sales.cashier_id ")
query = query.joins(" JOIN accounts acc ON acc.id = mi.account_id")
- # query = query.where("i.item_instance_code IS NOT NULL")
+ query = query.where("#{sale_type}")
query = query.group("acc.title,mi.account_id,mi.menu_category_id,i.product_name,i.unit_price")
.order("acc.title desc, mi.account_id desc, mi.menu_category_id desc, i.unit_price asc")
end
@@ -835,10 +850,15 @@ def self.get_other_charges()
query = query.group("i.sale_item_id")
end
-def self.get_by_shift_items(shift_sale_range, shift, from, to, status)
+def self.get_by_shift_items(shift_sale_range, shift, from, to, status,type)
# date_type_selection = get_sql_function_for_report_type(report_type)
- query = self.get_item_query()
-
+ if type == "other"
+ other_charges = self.get_other_charges()
+ query = self.get_item_query(type)
+ else
+ query = self.get_item_query(type)
+ end
+
discount_query = 0
total_card_amount = 0
total_cash_amount = 0
diff --git a/app/views/origami/addorders/detail.html.erb b/app/views/origami/addorders/detail.html.erb
index 05d50339..607f4c0e 100755
--- a/app/views/origami/addorders/detail.html.erb
+++ b/app/views/origami/addorders/detail.html.erb
@@ -35,6 +35,7 @@
<%end%>
+
@@ -199,7 +201,7 @@
-
+
diff --git a/app/views/reports/saleitem/_shift_sale_report_filter.html.erb b/app/views/reports/saleitem/_shift_sale_report_filter.html.erb
index 88f26c1f..75a331e9 100755
--- a/app/views/reports/saleitem/_shift_sale_report_filter.html.erb
+++ b/app/views/reports/saleitem/_shift_sale_report_filter.html.erb
@@ -18,13 +18,25 @@
-
-
+
+
+
+
+
+
-
+
@@ -52,7 +64,7 @@
$('#frm_report').attr('action',url)
$('#frm_report').submit();
// window.location = url;
- });
+ });
var item = $('#item').val();
var payment_type = $('#payment_type');
@@ -76,17 +88,18 @@
});
<% if params[:shift_name].to_i > 0%>
- shift_id = '<%= params[:shift_name] %>'
- local_date = '<%= @shift_from %> - <%= @shift_to %> '
- var shift = $('#shift_name');
- str = '
';
- shift.append(str);
+ shift_id = '<%= params[:shift_name] %>'
+ local_date = '<%= @shift_from %> - <%= @shift_to %> '
+ var shift = $('#shift_name');
+ str = '
';
+ shift.append(str);
<% end %>
$("#from").val("<%=params[:from] rescue '-'%>");
$("#to").val("<%=params[:to] rescue '-'%>");
$("#sel_period").val(<%=params[:period] rescue '-'%>);
- $("#sel_sale_type").val(<%=params[:sale_type] rescue '-'%>);
+ var sale_type = "<%=params[:sale_type]%>";
+ $("#sel_sale_type").val(sale_type);
<% if params[:period_type] == 1 || params[:period_type] == "1" %>
diff --git a/app/views/reports/saleitem/index.html.erb b/app/views/reports/saleitem/index.html.erb
index 3c03dec2..531d289b 100644
--- a/app/views/reports/saleitem/index.html.erb
+++ b/app/views/reports/saleitem/index.html.erb
@@ -57,8 +57,7 @@
delimiter = ""
end
%>
- <% unless @sale_data.blank? %>
- <% acc_arr = Array.new %>
+ <% acc_arr = Array.new %>
<% cate_arr = Array.new %>
<% sub_qty = 0 %>
@@ -75,24 +74,27 @@
<% total_item_foc = 0 %>
<% total_item_dis = 0.0 %>
<% total_tax = 0 %>
-
+ <% unless @sale_data.blank? %>
<% @sale_data.each do |sale| %>
+
- <% if sale.status_type == "foc" && sale.grand_total < 0
+
<% if !acc_arr.include?(sale.account_id) %>
| <%= sale.account_name %> |
@@ -151,7 +153,8 @@
<% end %>
- <% if @other_charges.present? %>
+ <% if @type == "other"%>
+
| Other Charges |
|
@@ -191,55 +194,38 @@
<%= number_with_precision(grand_total , precision:precision.to_i,delimiter:delimiter)%> |
<% end %>
-
-
- | |
- <%= t("views.right_panel.detail.foc_item") %> <%= t("views.right_panel.detail.amount") %> |
- <%= number_with_precision(total_item_foc , precision:precision.to_i,delimiter:delimiter) %> |
-
-
- | |
- <%= t("views.right_panel.detail.item_discount") %> <%= t("views.right_panel.detail.amount") %> |
- <%= number_with_precision(total_item_dis , precision:precision.to_i,delimiter:delimiter) %> |
-
-
- | |
- <%= t("views.right_panel.detail.foc_sales") %> |
-
- <%= number_with_precision(@foc_data, precision:precision.to_i, delimiter:delimiter) %>
- |
-
-
- | |
- <%= t("views.right_panel.detail.discount") %> <%= t("views.right_panel.detail.amount") %> |
-
-
- <%= number_with_precision(@discount_data , precision: precision.to_i,delimiter: delimiter) %>
-
- |
-
+ <% if @type == "other"%>
- <% @sale_taxes.each do |tax| %>
-
- <% end %>
-
- | |
- Net Amount |
-
- <%= number_with_precision(grand_total.to_f - @discount_data.to_f , precision:precision.to_i,delimiter:delimiter)%> |
-
-
+
+ | Other Charges |
+ |
+ |
+
+ <% @other_charges.each do |other| %>
+ <% if other.total_item > 0
+ total_qty += other.total_item
+ end %>
+ <% grand_total +=other.grand_total%>
+
+ | |
+ Other Charges |
+ <%= other.item_code rescue '-' %> |
+ <%= other.product_name rescue '-' %> |
+ <%= other.total_item rescue '-' %> |
+ <%= number_with_precision(other.unit_price , precision:precision.to_i,delimiter:delimiter) rescue '-'%> |
+ <%= number_with_precision(other.grand_total , precision:precision.to_i,delimiter:delimiter) rescue '-'%> |
+
+
+
+ <% other_sub_total += other.grand_total %>
+
+ <% end %>
+
+ | |
+ <%= t("views.right_panel.detail.sub_total") %> |
+ <%= number_with_precision(other_sub_total , precision:precision.to_i,delimiter:delimiter)%> |
+
+ <%end%>
diff --git a/app/views/reports/saleitem/index.xls.erb b/app/views/reports/saleitem/index.xls.erb
index f97edbb8..85c666a5 100755
--- a/app/views/reports/saleitem/index.xls.erb
+++ b/app/views/reports/saleitem/index.xls.erb
@@ -27,10 +27,22 @@
- <% unless @sale_data.blank? %>
- <% acc_arr = Array.new %>
+ <% if @print_settings.precision.to_i > 0
+ precision = @print_settings.precision
+ else
+ precision = 0
+ end
+ #check delimiter
+ if @print_settings.delimiter
+ delimiter = ","
+ else
+ delimiter = ""
+ end
+ %>
+ <% acc_arr = Array.new %>
<% cate_arr = Array.new %>
+ <% sub_qty = 0 %>
<% sub_total = 0 %>
<% other_sub_total = 0 %>
<% count = 0 %>
@@ -42,14 +54,29 @@
<% total_amount = 0 %>
<% discount = 0 %>
<% total_item_foc = 0 %>
- <% total_item_dis = 0 %>
-
+ <% total_item_dis = 0.0 %>
+ <% total_tax = 0 %>
+ <% unless @sale_data.blank? %>
<% @sale_data.each do |sale| %>
-
- <% if sale.total_item > 0
+
+
+
+
<% if !acc_arr.include?(sale.account_id) %>
| <%= sale.account_name %> |
@@ -58,7 +85,7 @@
<% @totalByAccount.each do |account, total| %>
<% if sale.account_id == account %>
- <%= total %>
+ <%= number_with_precision(total, precision:precision.to_i,delimiter:delimiter) %>
<% grand_total += total %>
<% end %>
<% end %>
@@ -77,95 +104,110 @@
| <%= sale.item_code rescue '-' %> |
<%= sale.product_name rescue '-' %> |
<%= sale.total_item rescue '-' %> |
- <%= sale.unit_price rescue '-' %> |
- <%= sale.grand_total rescue '-' %> |
+ <%= number_with_precision(sale.unit_price , precision:precision.to_i,delimiter:delimiter) rescue '-'%> |
+ <%= number_with_precision(sale.grand_total , precision:precision.to_i,delimiter:delimiter) rescue '-'%> |
- <% @menu_cate_count.each do |key,value| %>
- <% if sale.menu_category_id == key %>
+ <% @menu_cate_count.each do |key,value| %>
+ <% if sale.account_id == key %>
<% count = count + 1 %>
<% sub_total += sale.grand_total %>
+ <% #sub_qty += sale.total_item %>
+ <% if sale.status_type!="Discount" && (!sale.product_name.include? "FOC")
+ sub_qty += sale.total_item
+ end %>
+
<% if count == value %>
- | |
+ |
+ Total <%= sale.account_name %> Qty |
+ <%= sub_qty %> |
<%= t("views.right_panel.detail.sub_total") %> |
- <%= sub_total %> |
+ <%= number_with_precision(sub_total , precision:precision.to_i,delimiter:delimiter)%> |
- <% if sale.status_type === "foc"
- total_item_foc += sale.grand_total
- end %>
-
- <% if sale.status_type === "Discount"
- total_item_dis += sale.grand_total
- end %>
<% sub_total = 0.0%>
+ <% sub_qty = 0 %>
<% count = 0%>
<% end %>
- <% end %>
<% end %>
+ <% end %>
- <% end %>
+ <% end %>
-
- | Other Charges |
- |
- |
-
- <% @other_charges.each do |other| %>
- <% if other.total_item > 0
- total_qty += other.total_item
- end %>
- <% grand_total +=other.grand_total%>
-
- | |
- Other Charges |
- <%= other.item_code rescue '-' %> |
- <%= other.product_name rescue '-' %> |
- <%= other.total_item rescue '-' %> |
- <%= other.unit_price rescue '-' %> |
- <%= other.grand_total rescue '-' %> |
+ <% if @type == "other"%>
+
+
+ | Other Charges |
+ |
+ |
-
-
- <% other_sub_total += other.grand_total %>
-
- <% end %>
-
- | |
- <%= t("views.right_panel.detail.sub_total") %> |
- <%= other_sub_total %> |
-
+ <% @other_charges.each do |other| %>
+ <% if other.total_item > 0
+ total_qty += other.total_item
+ end %>
+ <% grand_total +=other.grand_total%>
+
+ | |
+ Other Charges |
+ <%= other.item_code rescue '-' %> |
+ <%= other.product_name rescue '-' %> |
+ <%= other.total_item rescue '-' %> |
+ <%= number_with_precision(other.unit_price , precision:precision.to_i,delimiter:delimiter) rescue '-'%> |
+ <%= number_with_precision(other.grand_total , precision:precision.to_i,delimiter:delimiter) rescue '-'%> |
+
+
+
+ <% other_sub_total += other.grand_total %>
+
+ <% end %>
+
+ | |
+ <%= t("views.right_panel.detail.sub_total") %> |
+ <%= number_with_precision(other_sub_total , precision:precision.to_i,delimiter:delimiter)%> |
+
+ <%end%>
| |
<%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.item") %> |
<%= total_qty%> |
- <%= t("views.right_panel.detail.net_amount") %> |
- <%= grand_total%> |
+ <%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.amount") %> |
+ <%= number_with_precision(grand_total , precision:precision.to_i,delimiter:delimiter)%> |
<% end %>
-
-
- | |
- <%= t("views.right_panel.detail.foc_item") %> <%= t("views.right_panel.detail.amount") %> |
- <%= total_item_foc %> |
-
-
- | |
- <%= t("views.right_panel.detail.item_discount") %> <%= t("views.right_panel.detail.amount") %> |
- <%= total_item_dis %> |
-
-
- | |
- <%= t("views.right_panel.detail.foc_sales") %> |
- <%= @foc_data %> |
-
-
- | |
- <%= t("views.right_panel.detail.discount") %> <%= t("views.right_panel.detail.amount") %> |
- <%= @discount_data %> |
-
+ <% if @type == "other"%>
+
+
+ | Other Charges |
+ |
+ |
+
+ <% @other_charges.each do |other| %>
+ <% if other.total_item > 0
+ total_qty += other.total_item
+ end %>
+ <% grand_total +=other.grand_total%>
+
+ | |
+ Other Charges |
+ <%= other.item_code rescue '-' %> |
+ <%= other.product_name rescue '-' %> |
+ <%= other.total_item rescue '-' %> |
+ <%= number_with_precision(other.unit_price , precision:precision.to_i,delimiter:delimiter) rescue '-'%> |
+ <%= number_with_precision(other.grand_total , precision:precision.to_i,delimiter:delimiter) rescue '-'%> |
+
+
+
+ <% other_sub_total += other.grand_total %>
+
+ <% end %>
+
+ | |
+ <%= t("views.right_panel.detail.sub_total") %> |
+ <%= number_with_precision(other_sub_total , precision:precision.to_i,delimiter:delimiter)%> |
+
+ <%end%>
diff --git a/app/views/reports/saleitem/indexbackup.html.erb b/app/views/reports/saleitem/indexbackup.html.erb
new file mode 100644
index 00000000..3c03dec2
--- /dev/null
+++ b/app/views/reports/saleitem/indexbackup.html.erb
@@ -0,0 +1,366 @@
+
+
+
+ <%= render :partial=>'shift_sale_report_filter',
+ :locals=>{ :period_type => true, :shift_name => true, :report_path =>reports_saleitem_index_path} %>
+
+
+
+
+
+
+
+
+
+
+
+ | <%= t("views.right_panel.detail.from_date") %> : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - <%= t("views.right_panel.detail.to_date") %> : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%> |
+
+ <% if @shift_from %>
+
+ <% if @shift_data.employee %>
+ <% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %>
+ <% end %>
+ | <%= t("views.right_panel.detail.shift_name") %> = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> ) |
+
+ <% end %>
+
+ | |
+ <%= t("views.right_panel.header.menu_category") %> |
+ <%= t("views.right_panel.detail.code") %> |
+ <%= t("views.right_panel.detail.product") %> |
+ <%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.item") %> |
+ <%= t("views.right_panel.detail.unit_price") %> |
+ <%= t("views.right_panel.detail.revenue") %> |
+
+
+
+ <% if @print_settings.precision.to_i > 0
+ precision = @print_settings.precision
+ else
+ precision = 0
+ end
+ #check delimiter
+ if @print_settings.delimiter
+ delimiter = ","
+ else
+ delimiter = ""
+ end
+ %>
+ <% unless @sale_data.blank? %>
+ <% acc_arr = Array.new %>
+ <% cate_arr = Array.new %>
+
+ <% sub_qty = 0 %>
+ <% sub_total = 0 %>
+ <% other_sub_total = 0 %>
+ <% count = 0 %>
+ <% total_price = 0 %>
+ <% cate_count = 0 %>
+ <% acc_count = 0 %>
+ <% grand_total = 0 %>
+ <% total_qty = 0 %>
+ <% total_amount = 0 %>
+ <% discount = 0 %>
+ <% total_item_foc = 0 %>
+ <% total_item_dis = 0.0 %>
+ <% total_tax = 0 %>
+
+ <% @sale_data.each do |sale| %>
+
+ <% if sale.status_type != "Discount" && sale.status_type != "foc"
+ total_qty += sale.total_item
+ end %>
+ <% if sale.status_type == "foc" && sale.price > 0
+ total_qty += sale.total_item
+ end %>
+
+ <% if sale.status_type == "foc" && sale.grand_total < 0
+ total_item_foc += sale.grand_total*(-1)
+ end %>
+
+ <% if sale.status_type == "Discount" && sale.grand_total < 0
+ total_item_dis += sale.grand_total*(-1)
+ end %>
+
+ <% if !acc_arr.include?(sale.account_id) %>
+
+ | <%= sale.account_name %> |
+ |
+ <%= t("views.right_panel.detail.total_price_by") %> <%= sale.account_name %> |
+
+ <% @totalByAccount.each do |account, total| %>
+ <% if sale.account_id == account %>
+ <%= number_with_precision(total, precision:precision.to_i,delimiter:delimiter) %>
+ <% grand_total += total %>
+ <% end %>
+ <% end %>
+ |
+
+ <% acc_arr.push(sale.account_id) %>
+ <% end %>
+
+ | |
+ <% if !cate_arr.include?(sale.menu_category_id) %>
+ <%= sale.menu_category_name %> |
+ <% cate_arr.push(sale.menu_category_id) %>
+ <% else %>
+ |
+ <% end %>
+ <%= sale.item_code rescue '-' %> |
+ <%= sale.product_name rescue '-' %> |
+ <%= sale.total_item rescue '-' %> |
+ <%= number_with_precision(sale.unit_price , precision:precision.to_i,delimiter:delimiter) rescue '-'%> |
+ <%= number_with_precision(sale.grand_total , precision:precision.to_i,delimiter:delimiter) rescue '-'%> |
+
+
+
+ <% @menu_cate_count.each do |key,value| %>
+ <% if sale.account_id == key %>
+ <% count = count + 1 %>
+ <% sub_total += sale.grand_total %>
+ <% #sub_qty += sale.total_item %>
+ <% if sale.status_type!="Discount" && (!sale.product_name.include? "FOC")
+ sub_qty += sale.total_item
+ end %>
+
+ <% if count == value %>
+
+ | |
+ Total <%= sale.account_name %> Qty |
+ <%= sub_qty %> |
+ <%= t("views.right_panel.detail.sub_total") %> |
+ <%= number_with_precision(sub_total , precision:precision.to_i,delimiter:delimiter)%> |
+
+ <% sub_total = 0.0%>
+ <% sub_qty = 0 %>
+ <% count = 0%>
+ <% end %>
+ <% end %>
+ <% end %>
+
+ <% end %>
+
+ <% if @other_charges.present? %>
+
+ | Other Charges |
+ |
+ |
+
+ <% @other_charges.each do |other| %>
+ <% if other.total_item > 0
+ total_qty += other.total_item
+ end %>
+ <% grand_total +=other.grand_total%>
+
+ | |
+ Other Charges |
+ <%= other.item_code rescue '-' %> |
+ <%= other.product_name rescue '-' %> |
+ <%= other.total_item rescue '-' %> |
+ <%= number_with_precision(other.unit_price , precision:precision.to_i,delimiter:delimiter) rescue '-'%> |
+ <%= number_with_precision(other.grand_total , precision:precision.to_i,delimiter:delimiter) rescue '-'%> |
+
+
+
+ <% other_sub_total += other.grand_total %>
+
+ <% end %>
+
+ | |
+ <%= t("views.right_panel.detail.sub_total") %> |
+ <%= number_with_precision(other_sub_total , precision:precision.to_i,delimiter:delimiter)%> |
+
+ <%end%>
+
+
+ | |
+ <%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.item") %> |
+ <%= total_qty%> |
+ <%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.amount") %> |
+ <%= number_with_precision(grand_total , precision:precision.to_i,delimiter:delimiter)%> |
+
+ <% end %>
+
+
+ | |
+ <%= t("views.right_panel.detail.foc_item") %> <%= t("views.right_panel.detail.amount") %> |
+ <%= number_with_precision(total_item_foc , precision:precision.to_i,delimiter:delimiter) %> |
+
+
+ | |
+ <%= t("views.right_panel.detail.item_discount") %> <%= t("views.right_panel.detail.amount") %> |
+ <%= number_with_precision(total_item_dis , precision:precision.to_i,delimiter:delimiter) %> |
+
+
+ | |
+ <%= t("views.right_panel.detail.foc_sales") %> |
+
+ <%= number_with_precision(@foc_data, precision:precision.to_i, delimiter:delimiter) %>
+ |
+
+
+ | |
+ <%= t("views.right_panel.detail.discount") %> <%= t("views.right_panel.detail.amount") %> |
+
+
+ <%= number_with_precision(@discount_data , precision: precision.to_i,delimiter: delimiter) %>
+
+ |
+
+
+ <% @sale_taxes.each do |tax| %>
+
+ <% end %>
+
+ | |
+ Net Amount |
+
+ <%= number_with_precision(grand_total.to_f - @discount_data.to_f , precision:precision.to_i,delimiter:delimiter)%> |
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file