|
|
@@ -122,7 +122,7 @@ class CashOutsController < ApplicationController
|
|
|
all_sales = Sale.where("open_cash_register_id = (?) and status != 1", @cash_out.open_cash_register_id)
|
|
|
@cash_sales = CashRegistersMove.where("open_cash_register_id = (?) and move_type = '1' and status = 1 and sale_id IN (?)", @cash_out.open_cash_register_id, all_sales.where(saletype: 1).pluck(:id)).sum(:quantity)
|
|
|
@credit_sales = CashRegistersMove.where("open_cash_register_id = (?) and move_type = '1' and status = 1 and concept = 3", @cash_out.open_cash_register_id).sum(:quantity)
|
|
|
- @reserved_sales = CashRegistersMove.where("open_cash_register_id = (?) and move_type = '1' and status = 1 and sale_id IN (?)", @cash_out.open_cash_register_id, all_sales.where(saletype: 2).pluck(:id)).sum(:quantity)
|
|
|
+ @reserved_sales = CashRegistersMove.where("open_cash_register_id = (?) and move_type = '1' and status = 1 and concept IN (4, 6, 7)", @cash_out.open_cash_register_id).sum(:quantity)
|
|
|
@details.each do |detail|
|
|
|
detail["price_sale"] = Product.find(detail['product_id']).get_price_sale(@pointsale.id)
|
|
|
|