fixed conflict

This commit is contained in:
Nweni
2019-12-02 17:43:02 +06:30
118 changed files with 14390 additions and 190 deletions

View File

@@ -29,7 +29,7 @@ class Ability
can :manage, Order
can :manage, Booking
can :manage, Sale
can :manage, Customer
can :manage, DiningQueue
@@ -57,8 +57,8 @@ class Ability
can :show, :product_sale
can :get_customer, Customer
can :add_customer, Customer
can :update_sale_by_customer, Customer
can :add_customer, Customer
can :update_sale_by_customer, Customer
can :index, :other_charge
can :create, :other_charge
@@ -73,11 +73,11 @@ class Ability
can :create, :payment
can :reprint, :payment
can :rounding_adj, :payment
can :foc, :payment
can :print, :payment
can :foc, :payment
can :print, :payment
can :change_tax, :payment
can :move_dining, :movetable
can :move_dining, :movetable
can :moving, :movetable
can :move_dining, :moveroom
@@ -123,11 +123,11 @@ class Ability
can :print, :print
can :print_order_summary, :print
can :read, ShiftSale
can :update, ShiftSale
can :read, ShiftSale
can :update, ShiftSale
elsif user.role == "cashier" || user.role =="foodcourt_cashier"
elsif user.role == "cashier"
# can :overall_void, :void
can :index, :home
can :show, :home
@@ -136,10 +136,10 @@ class Ability
can :update, Order
can :manage, Booking
can :manage, OrderQueueStation
can :read, Sale
can :update, Sale
can :read, Sale
can :update, Sale
can :manage, Customer
can :manage, Customer
can :manage, OrderReservation
@@ -160,11 +160,11 @@ class Ability
can :create, :payment
can :reprint, :payment
can :rounding_adj, :payment
can :foc, :payment
can :foc, :payment
can :print, :payment
can :change_tax, :payment
can :move_dining, :movetable
can :move_dining, :movetable
can :moving, :movetable
can :move_dining, :moveroom
@@ -204,7 +204,7 @@ class Ability
can :item_edit, :sale_edit
can :overall_void, :void
elsif user.role == "account"
can :index, :dailysale
@@ -228,14 +228,14 @@ class Ability
elsif user.role == "supervisor"
can :manage, Employee
can :edit, :sale_edit
can :item_void, :sale_edit
can :item_foc, :sale_edit
can :item_edit, :sale_edit
can :item_void_cancel, :sale_edit
can :cancel_all_void, :sale_edit
can :apply_void, :sale_edit
can :cancel_all_void, :sale_edit
can :apply_void, :sale_edit
can :overall_void, :void
can :index, :other_charge
@@ -246,7 +246,7 @@ class Ability
can :remove_all_discount, :discount
can :member_discount, :discount
can :move_dining, :movetable
can :move_dining, :movetable
can :moving, :movetable
can :move_dining, :moveroom
@@ -297,9 +297,9 @@ class Ability
elsif user.role == "waiter"
can :index, :home
can :show, :home
can :show, :home
can :manage, Customer
can :manage, Customer
can :get_customer, Customer
can :add_customer, Customer
can :update_sale_by_customer, Customer
@@ -313,7 +313,7 @@ class Ability
can :member_discount, :discount
#ability for move table
can :move_dining, :movetable
can :move_dining, :movetable
can :moving, :movetable
can :move_dining, :moveroom
@@ -339,7 +339,7 @@ class Ability
can :print_order_summary, :print
elsif user.role == "kitchen"
#oqs Home
can :manage, OrderQueueStation
can :index, :home

View File

@@ -203,7 +203,7 @@ class OrderReservation < ApplicationRecord
other_amount = SaleItem.calculate_other_charges(saleObj.sale_items)
printer = Printer::ReceiptPrinter.new(print_settings)
filename, sale_receipt_no, printer_name = printer.print_receipt_bill(print_settings, false, nil,cashier_terminal,saleObj.sale_items,saleObj,saleObj.customer.name, item_price_by_accounts, discount_price_by_accounts, nil,nil,shop_details, "Paid",nil,nil,other_amount,nil,nil, order_reservation)
filename, sale_receipt_no, printer_name = printer.print_receipt_bill(print_settings, false, nil,cashier_terminal,saleObj.sale_items,saleObj,saleObj.customer.name, item_price_by_accounts, discount_price_by_accounts, nil,nil,shop_details, "Paid",nil,nil,other_amount,nil,nil, order_reservation,nil)
#receipt bill pdf setting
result = {:status=> true,

View File

@@ -188,20 +188,20 @@ class Printer::ReceiptPrinter < Printer::PrinterWorker
end
#Bill Receipt Print
def print_receipt_bill(printer_settings, kbz_pay_status, qr_code, cashier_terminal,sale_items,sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info = nil,rebate_amount=nil,shop_details, printed_status,balance,card_data,other_amount,latest_order_no,card_balance_amount,order_reservation)
def print_receipt_bill(printer_settings, kbz_pay_status, qr_code, cashier_terminal,sale_items,sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info = nil,rebate_amount=nil,shop_details, printed_status,balance,card_data,other_amount,latest_order_no,card_balance_amount,order_reservation,transaction_ref)
#Use CUPS service
#Generate PDF
#Print
if !printer_settings.nil?
if !printer_settings.unique_code.strip.downcase.include? ("receiptbillorder")
pdf = ReceiptBillPdf.new(printer_settings, kbz_pay_status, qr_code, sale_items, sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details,printed_status,balance,card_data,other_amount,latest_order_no,card_balance_amount)
pdf = ReceiptBillPdf.new(printer_settings, kbz_pay_status, qr_code, sale_items, sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details,printed_status,balance,card_data,other_amount,latest_order_no,card_balance_amount,transaction_ref)
settings = PrintSetting.where("shop_code='#{shop_details.shop_code}'")
if !settings.nil?
settings.each do |setting|
if setting.unique_code == 'ReceiptBillPdf'
pdf = ReceiptBillPdf.new(printer_settings, kbz_pay_status, qr_code, sale_items, sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details,printed_status,balance,card_data,other_amount,latest_order_no,card_balance_amount)
pdf = ReceiptBillPdf.new(printer_settings, kbz_pay_status, qr_code, sale_items, sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details,printed_status,balance,card_data,other_amount,latest_order_no,card_balance_amount,transaction_ref)
elsif setting.unique_code == 'ReceiptBillStarPdf'
pdf = ReceiptBillStarPdf.new(printer_settings, kbz_pay_status, qr_code, sale_items, sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details,printed_status,balance,card_data,other_amount,latest_order_no,card_balance_amount)
pdf = ReceiptBillStarPdf.new(printer_settings, kbz_pay_status, qr_code, sale_items, sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details,printed_status,balance,card_data,other_amount,latest_order_no,card_balance_amount,transaction_ref)
end
end
end
@@ -211,7 +211,7 @@ class Printer::ReceiptPrinter < Printer::PrinterWorker
receipt_bill_a5_pdf.each do |receipt_bilA5|
if receipt_bilA5[0] == 'ReceiptBillA5Pdf'
if receipt_bilA5[1] == '1'
pdf = ReceiptBillA5Pdf.new(printer_settings, sale_items, sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details,printed_status,balance,card_data,other_amount,latest_order_no,card_balance_amount)
pdf = ReceiptBillA5Pdf.new(printer_settings, sale_items, sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details,printed_status,balance,card_data,other_amount,latest_order_no,card_balance_amount,transaction_ref)
# else
# pdf = ReceiptBillPdf.new(printer_settings, sale_items, sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details,printed_status,balance,card_data,other_amount,latest_order_no,card_balance_amount)
end

View File

@@ -2096,7 +2096,6 @@ end
def unique_tax_profiles(order_source, customer_id)
tax_data = TaxProfile.where(group_type: order_source,shop_code: self.shop_code)
customer_tax_profiles = Customer.select(:tax_profiles).where(customer_id: customer_id).first
if customer_tax_profiles.present?
tax_data = tax_data.where(id: customer_tax_profiles.tax_profiles)

View File

@@ -150,6 +150,7 @@ class SaleAudit < ApplicationRecord
def self.getCardBalanceAmount(sale_id)
card_balance_amount = 0
transaction_ref =''
sale_audits = SaleAudit.where("sale_id='#{sale_id}' AND action='PAYMAL'")
if !sale_audits.nil?
sale_audits.each do |sale_audit|
@@ -159,6 +160,7 @@ class SaleAudit < ApplicationRecord
if remark[0]
if remark[0]["status"]
card_balance_amount = remark[0]["card_balance_amount"]
transaction_ref = remark[0]["transaction_ref"]
end
end
end
@@ -166,7 +168,7 @@ class SaleAudit < ApplicationRecord
end
end
return card_balance_amount
return card_balance_amount,transaction_ref
end
def self.valid_json(json)

View File

@@ -225,14 +225,14 @@ class SalePayment < ApplicationRecord
'Accept' => 'application/json; version=3'
}, :timeout => 10
)
rescue Errno::ECONNREFUSED
response = { "status" => false, "message" => "Can't open membership server"}
rescue Net::OpenTimeout
response = { status: false }
response = { "status" => false, "message" => "No internet connection " }
rescue OpenURI::HTTPError
response = { status: false}
response = { "status" => false, "message" => "No internet connection "}
rescue SocketError
response = { status: false}
response = { "status" => false, "message" => "No internet connection "}
end
Rails.logger.debug "Get Paypar Account "
Rails.logger.debug response.to_json

View File

@@ -16,7 +16,6 @@ class ShiftSale < ApplicationRecord
belongs_to :cashier_terminal
belongs_to :employee, :foreign_key => 'employee_id'
has_many :sales
belongs_to :shop
def self.current_shift(shop_code)
# today_date = DateTime.now.strftime("%Y-%m-%d")
@@ -84,6 +83,7 @@ class ShiftSale < ApplicationRecord
self.shift_started_at = DateTime.now
self.employee_id = current_user.id
self.opening_balance = opening_balance
self.shop_code = current_user.shop_code
self.other_sales = 0
self.save
end