generate task shift_sales rake

This commit is contained in:
Thein Lin Kyaw
2020-04-30 18:08:55 +06:30
parent d60853e9e5
commit af8a3c7a54
2 changed files with 127 additions and 6 deletions

View File

@@ -89,7 +89,7 @@ class Origami::PaymentsController < BaseOrigamiController
path = request.fullpath
latest_order_no = nil
is_kbz = params[:is_kbz]
if saleObj = Sale.find(sale_id)
sale_items = SaleItem.get_all_sale_items(sale_id)
@@ -98,7 +98,7 @@ class Origami::PaymentsController < BaseOrigamiController
Rails.logger.info '################ CASH PAYMENT #################'
sale_payment = SalePayment.new
if path.include? ("credit_payment")
sale_payment.process_payment(saleObj, current_user, cash, "cash", nil, true)
sale_payment.process_payment(saleObj, current_user, cash, "creditnote", nil, true)
else
sale_payment.process_payment(saleObj, current_user, cash, "cash")
end
@@ -107,7 +107,7 @@ class Origami::PaymentsController < BaseOrigamiController
sp.kbz_edit_sale_payment(sp.received_amount.to_f, current_user)
end
rebate_amount = nil
# For Cashier by Zone
@@ -202,17 +202,17 @@ class Origami::PaymentsController < BaseOrigamiController
discount_price_by_accounts = SaleItem.get_discount_price_by_accounts(saleObj.sale_items)
other_amount = SaleItem.calculate_other_charges(sale_items)
credit_pdf = Lookup.find_by_lookup_type("credit_pdf")
if (path.include? ("credit_payment")) && !credit_pdf.nil? && credit_pdf.value.to_i == 1
if (path.include? ("credit_payment")) && !credit_pdf.nil? && credit_pdf.value.to_i == 1
printed_status = 'credit_payment'
else
printed_status = 'Paid'
end
printer = Printer::ReceiptPrinter.new(print_settings)
filename, sale_receipt_no, printer_name = printer.print_receipt_bill(print_settings, false, nil, cashier_terminal,sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_detail, printed_status,current_balance,card_data,other_amount,latest_order_no,card_balance_amount,nil)
#end
if !saleObj.nil?
# InventoryJob.perform_now(self.id)
# InventoryDefinition.calculate_product_count(saleObj)