diff --git a/app/models/sale.rb b/app/models/sale.rb index 306c37ad..9e29e0b8 100755 --- a/app/models/sale.rb +++ b/app/models/sale.rb @@ -651,7 +651,7 @@ def self.get_item_query() # "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.group("i.product_name").order("mi.account_id, mi.menu_category_id") + query = query.group("i.product_name").order("mi.account_id") end def self.get_other_charges() diff --git a/app/models/sale_item.rb b/app/models/sale_item.rb index 0d596100..e15c4b79 100755 --- a/app/models/sale_item.rb +++ b/app/models/sale_item.rb @@ -34,7 +34,7 @@ class SaleItem < ApplicationRecord sale_item.product_alt_name = item.product_alt_name sale_item.account_id = item.account_id sale_item.remark = type - if type == "FOC" || type == "promotion" || type == "void" + if type == "foc" || type == "promotion" || type == "void" sale_item.qty = qty * (-1) else sale_item.qty = qty diff --git a/app/models/sale_payment.rb b/app/models/sale_payment.rb index 202108e6..7840817e 100755 --- a/app/models/sale_payment.rb +++ b/app/models/sale_payment.rb @@ -184,7 +184,7 @@ class SalePayment < ApplicationRecord sale_items = SaleItem.where("sale_id='#{ self.sale.sale_id }'") sale_items.each do|item| - SaleItem.update_existing_item(item.qty, item, self.sale.sale_id, "FOC", item.unit_price, item.price) + SaleItem.update_existing_item(item.qty, item, self.sale.sale_id, "foc", item.unit_price, item.price) end self.payment_method = "foc" diff --git a/app/views/reports/saleitem/index.html.erb b/app/views/reports/saleitem/index.html.erb index 2aa6762f..8a36d9e9 100644 --- a/app/views/reports/saleitem/index.html.erb +++ b/app/views/reports/saleitem/index.html.erb @@ -64,7 +64,7 @@ <% @sale_data.each do |sale| %> - <% if sale.total_item > 0 + <% if sale.total_item > 0 && sale.status_type != "Discount" && sale.status_type != "foc" total_qty += sale.total_item end %> @@ -125,7 +125,7 @@ <% end %> - <%if @otehr_charges.present?%> + Other Charges   @@ -155,7 +155,7 @@ <%= t("views.right_panel.detail.sub_total") %> <%= other_sub_total %> - <%end%> +