fixed conflit
This commit is contained in:
@@ -211,13 +211,13 @@ class SaleItem < ApplicationRecord
|
||||
# return price
|
||||
# end
|
||||
|
||||
def self.get_all_sale_items(sale_id)
|
||||
def self.get_all_sale_items(sale_id)
|
||||
sale_items = SaleItem.select("sale_id,product_code,item_instance_code,
|
||||
product_name,product_alt_name,account_id,status,remark,
|
||||
(CASE WHEN (qty > 0 AND remark IS NULL) OR (qty > 0 AND status='foc') OR (qty < 0 AND status = 'foc') OR (qty < 0 AND status='Discount') OR (status='promotion' AND (remark='promotion' OR remark = 'promotion nett price' OR remark= 'promotion discount')) THEN SUM(qty) ELSE qty END) as qty,
|
||||
SUM(qty) as qty,
|
||||
unit_price,
|
||||
taxable_price,
|
||||
(CASE WHEN (price > 0 AND remark IS NULL) OR (qty > 0 AND status='foc') OR (qty < 0 AND status = 'foc') OR (price < 0 AND status='Discount') OR (status='promotion' AND (remark='promotion' OR remark = 'promotion nett price' OR remark= 'promotion discount')) THEN SUM(price) ELSE price END) as price,
|
||||
SUM(price) as price,
|
||||
is_taxable")
|
||||
.where("sale_id = ?",sale_id)
|
||||
.order("product_name asc")
|
||||
@@ -238,11 +238,7 @@ class SaleItem < ApplicationRecord
|
||||
is_edit = self.qty >= 0 && self.qty != self.qty_was
|
||||
is_foc = self.status == "foc" && self.status_was != "foc"
|
||||
cancel_foc = self.status_was == "foc"
|
||||
# if is_foc
|
||||
# StockJournal.update_stock_journal(self.item_instance_code, "foc")
|
||||
# else cancel_foc
|
||||
# StockJournal.update_stock_journal(self.item_instance_code, "cancel_foc")
|
||||
# end
|
||||
|
||||
if is_void or cancel_void or is_edit or is_foc or cancel_foc
|
||||
found, inventory_definition = InventoryDefinition.find_product_in_inventory(self)
|
||||
if found
|
||||
|
||||
Reference in New Issue
Block a user