Merge branch 'adminbsb_material_ui' of bitbucket.org:code2lab/sxrestaurant
This commit is contained in:
@@ -659,7 +659,7 @@ def self.get_item_query()
|
|||||||
# "JOIN employee_accesses ea ON ea.`employee_id` = sales.cashier_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.joins(" JOIN accounts acc ON acc.id = mi.account_id")
|
||||||
# query = query.where("i.item_instance_code IS NOT NULL")
|
# 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
|
end
|
||||||
|
|
||||||
def self.get_other_charges()
|
def self.get_other_charges()
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class SaleItem < ApplicationRecord
|
|||||||
sale_item.product_alt_name = item.product_alt_name
|
sale_item.product_alt_name = item.product_alt_name
|
||||||
sale_item.account_id = item.account_id
|
sale_item.account_id = item.account_id
|
||||||
sale_item.remark = type
|
sale_item.remark = type
|
||||||
if type == "FOC" || type == "promotion" || type == "void"
|
if type == "foc" || type == "promotion" || type == "void"
|
||||||
sale_item.qty = qty * (-1)
|
sale_item.qty = qty * (-1)
|
||||||
else
|
else
|
||||||
sale_item.qty = qty
|
sale_item.qty = qty
|
||||||
|
|||||||
@@ -184,7 +184,7 @@ class SalePayment < ApplicationRecord
|
|||||||
sale_items = SaleItem.where("sale_id='#{ self.sale.sale_id }'")
|
sale_items = SaleItem.where("sale_id='#{ self.sale.sale_id }'")
|
||||||
|
|
||||||
sale_items.each do|item|
|
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
|
end
|
||||||
|
|
||||||
self.payment_method = "foc"
|
self.payment_method = "foc"
|
||||||
|
|||||||
@@ -64,7 +64,7 @@
|
|||||||
|
|
||||||
<% @sale_data.each do |sale| %>
|
<% @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
|
total_qty += sale.total_item
|
||||||
end %>
|
end %>
|
||||||
|
|
||||||
@@ -125,7 +125,7 @@
|
|||||||
<!-- end sub total -->
|
<!-- end sub total -->
|
||||||
<% end %>
|
<% end %>
|
||||||
<!--Other Charges -->
|
<!--Other Charges -->
|
||||||
<%if @otehr_charges.present?%>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><b>Other Charges</b></td>
|
<td><b>Other Charges</b></td>
|
||||||
<td colspan="4"> </td>
|
<td colspan="4"> </td>
|
||||||
@@ -155,7 +155,7 @@
|
|||||||
<td><%= t("views.right_panel.detail.sub_total") %></td>
|
<td><%= t("views.right_panel.detail.sub_total") %></td>
|
||||||
<td ><span class="underline"><%= other_sub_total %></span></td>
|
<td ><span class="underline"><%= other_sub_total %></span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<%end%>
|
|
||||||
<!-- End Other Charges -->
|
<!-- End Other Charges -->
|
||||||
<tr style="border-top:2px solid grey;">
|
<tr style="border-top:2px solid grey;">
|
||||||
<td colspan="3"> </td>
|
<td colspan="3"> </td>
|
||||||
|
|||||||
Reference in New Issue
Block a user