Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant into loyalty
This commit is contained in:
@@ -2,7 +2,7 @@ class Account < ApplicationRecord
|
||||
validates_presence_of :title, :account_type
|
||||
|
||||
has_many :menu_items
|
||||
# belongs_to :lookup , :class_name => "Lookup"
|
||||
|
||||
def self.collection
|
||||
Account.select("id, title").map { |e| [e.title, e.id] }
|
||||
end
|
||||
|
||||
@@ -10,21 +10,26 @@ class Customer < ApplicationRecord
|
||||
validates :contact_no, uniqueness: true
|
||||
validates :email, uniqueness: true
|
||||
|
||||
|
||||
def self.get_member_group
|
||||
|
||||
gateway_url = MembershipSetting.find_by_membership_type("smartpay_url")
|
||||
url = gateway_url.gateway_url.to_s + "/api/get_all_member_group".to_s
|
||||
response = HTTParty.get(url)
|
||||
membership = MembershipSetting.find_by_membership_type("smartpay_url")
|
||||
app_token = membership.auth_token.to_s
|
||||
|
||||
url = membership.gateway_url.to_s + "/api/get_all_member_group".to_s
|
||||
response = HTTParty.get(url,
|
||||
:body => { app_token: app_token}.to_json,
|
||||
:headers => {
|
||||
'Content-Type' => 'application/json',
|
||||
'Accept' => 'application/json'
|
||||
}
|
||||
)
|
||||
puts response.body, response.code, response.message, response.headers.inspect
|
||||
|
||||
return response;
|
||||
|
||||
end
|
||||
|
||||
# http://192.168.1.47:3006/api/create_membership_customer
|
||||
#get_all_member_group
|
||||
|
||||
|
||||
def lastest_invoices
|
||||
sales.where(:customer_id => self.id).order("created_at desc").limit(5)
|
||||
end
|
||||
|
||||
@@ -72,4 +72,14 @@ class Printer::ReceiptPrinter < Printer::PrinterWorker
|
||||
pdf.render_file "tmp/receipt_bill.pdf"
|
||||
self.print("tmp/receipt_bill.pdf")
|
||||
end
|
||||
|
||||
#Bill Receipt Print
|
||||
def print_crm_order(booking,setting)
|
||||
#Use CUPS service
|
||||
#Generate PDF
|
||||
#Print
|
||||
pdf = CrmOrderPdf.new(booking,setting)
|
||||
pdf.render_file "tmp/print_crm_order.pdf"
|
||||
self.print("tmp/print_crm_order.pdf")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -55,8 +55,8 @@ class Sale < ApplicationRecord
|
||||
generate_receipt_no
|
||||
order = Order.find(order_id)
|
||||
|
||||
#Default - Values
|
||||
self.tax_type = "execlusive"
|
||||
#Default Tax - Values
|
||||
self.tax_type = "exclusive"
|
||||
|
||||
self.requested_by = requested_by
|
||||
self.requested_at = DateTime.now.utc
|
||||
|
||||
Reference in New Issue
Block a user