change consolidate receipt rake file

This commit is contained in:
phyusin
2018-11-16 17:11:21 +06:30
parent 01473bffbd
commit 2d36221c33
2 changed files with 3 additions and 3 deletions

View File

@@ -2951,7 +2951,7 @@ end
.joins("left join surveys on surveys.receipt_no = sales.receipt_no") .joins("left join surveys on surveys.receipt_no = sales.receipt_no")
query = query.where("sales.sale_status != 'new' && sale_payments.payment_amount > 0") query = query.where("sales.sale_status != 'new' && sale_payments.payment_amount > 0")
query = query.where("sales.created_at between ? and ?", '2017-11-01 00:00:00 +0630','2018-02-05 13:59:59 +0630') query = query.where("sales.created_at between ? and ?", '2017-11-01 00:00:00 +0630','2018-11-16 13:59:59 +0630')
.group("sales.sale_id") .group("sales.sale_id")
return query return query
end end
@@ -2963,7 +2963,7 @@ def self.all_receipt_details
.joins("join sales on sales.sale_id = sale_items.sale_id") .joins("join sales on sales.sale_id = sale_items.sale_id")
.group("sale_items.sale_item_id") .group("sale_items.sale_item_id")
query = query.where("sale_items.qty > 0 and sales.sale_status !='new'") query = query.where("sale_items.qty > 0 and sales.sale_status !='new'")
query = query.where("sale_items.created_at between ? and ?", '2017-11-01 00:00:00 +0630','2018-02-05 13:59:59 +0630') query = query.where("sale_items.created_at between ? and ?", '2017-11-01 00:00:00 +0630','2018-11-16 13:59:59 +0630')
return query return query
end end

View File

@@ -72,7 +72,7 @@ namespace :consolidate do
if sale.qty > 0 if sale.qty > 0
if sale.item_instance_code !=nil if sale.item_instance_code !=nil
byebug # byebug
menu_category = MenuCategory.find(MenuItem.find_by_item_code(sale.product_code).menu_category_id) menu_category = MenuCategory.find(MenuItem.find_by_item_code(sale.product_code).menu_category_id)
name = menu_category.name name = menu_category.name
code = menu_category.code code = menu_category.code