update crm addore
This commit is contained in:
@@ -74,7 +74,7 @@ class Crm::CustomersController < BaseCrmController
|
||||
@response = Customer.get_membership_transactions(@customer)
|
||||
|
||||
Rails.logger.debug "get membership transactions response"
|
||||
Rails.logger.debug response.to_json
|
||||
Rails.logger.debug @response.to_json
|
||||
# @response = ""
|
||||
#end customer amount
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ class Origami::AddordersController < ApplicationController#BaseOrigamiController
|
||||
|
||||
def detail
|
||||
@menu = MenuCategory.all.active
|
||||
#@menu = MenuCategory.where("menu_category_id is NULL").active
|
||||
@table_id = params[:id]
|
||||
@table = DiningFacility.find(@table_id)
|
||||
@booking = @table.get_booking
|
||||
@@ -45,6 +44,17 @@ class Origami::AddordersController < ApplicationController#BaseOrigamiController
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def get_menu_sub_category ()
|
||||
id = params[:id]
|
||||
if (id)
|
||||
#Pull this menu
|
||||
@sub_menu = MenuCategory.where("menu_category_id = #{id}").active
|
||||
# puts @menu.menu_items[1].item_attributes.to_json
|
||||
return @sub_menu
|
||||
end
|
||||
end
|
||||
|
||||
def get_all_product()
|
||||
@product = Product.all
|
||||
end
|
||||
|
||||
@@ -294,6 +294,7 @@ class ReceiptBillPdf < Prawn::Document
|
||||
balance = 0
|
||||
rebate_balance =0
|
||||
redeem = 0
|
||||
redeem_count = 0
|
||||
rebate_amount["data"].each do |res|
|
||||
total = total + res["balance"]
|
||||
#total redeem amount
|
||||
@@ -318,7 +319,7 @@ class ReceiptBillPdf < Prawn::Document
|
||||
|
||||
end
|
||||
# Total Rebate Amount if birthday
|
||||
if res["receipt_no"]== sale_data.receipt_no && res["account_status"]== "RebateBonusAccount" && res["status"]== "Rebate"
|
||||
if res["receipt_no"]== sale_data.receipt_no && res["account_status"]== "RebatebonusAccount" && res["status"]== "Rebate"
|
||||
rebate_balance = rebate_balance + res["deposit"]
|
||||
move_down 5
|
||||
y_position = cursor
|
||||
@@ -332,20 +333,22 @@ class ReceiptBillPdf < Prawn::Document
|
||||
#end Total rebate if birthday
|
||||
end
|
||||
|
||||
move_down 5
|
||||
move_down 5
|
||||
y_position = cursor
|
||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
|
||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
|
||||
text "Redeem Amount", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
end
|
||||
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
|
||||
text "#{number_with_precision(redeem, :precision => precision.to_i, :delimiter => delimiter)}", :size => self.item_font_size,:align => :right
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if redeem == 0
|
||||
old = total - rebate_balance
|
||||
else
|
||||
old = balance + redeem
|
||||
# if redeem_count == 0
|
||||
old = balance + redeem
|
||||
# end
|
||||
end
|
||||
|
||||
move_down 5
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
if @sub_menu
|
||||
json.sub_category @sub_menu.each do |sub_cat|
|
||||
json.id sub_cat.id
|
||||
json.code sub_cat.code
|
||||
json.name sub_cat.name
|
||||
json.menu_id sub_cat.menu_id
|
||||
json.menu_category_id sub_cat.menu_category_id
|
||||
end
|
||||
end
|
||||
@@ -189,6 +189,7 @@ scope "(:locale)", locale: /en|mm/ do
|
||||
post '/:id/create_survey' => "surveys#create", :as => "create_surveys"
|
||||
|
||||
get '/addorders/get_menu_category/:id' => "addorders#get_menu_category",:as => "get_menu_category", :defaults => { :format => 'json' }
|
||||
get '/addorders/get_menu_sub_category/:id' => "addorders#get_menu_sub_category",:as => "get_menu_sub_category", :defaults => { :format => 'json' }
|
||||
get '/addorders/products/list' => "addorders#get_all_product",:as => "get_all_product", :defaults => { :format => 'json' }
|
||||
|
||||
get '/:addorders/:id' => "addorders#detail"
|
||||
|
||||
Reference in New Issue
Block a user