tax
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
class Api::ShopsController < Api::ApiController
|
class Api::ShopsController < Api::ApiController
|
||||||
skip_before_action :set_current_tenant_by_subdomain_or_first
|
skip_before_action :set_current_tenant_by_subdomain_or_first, only: [:index, :show]
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@shops = Shop.select('id,logo,name,shop_code,address,phone_no').all
|
@shops = Shop.select('id,logo,name,shop_code,address,phone_no').all
|
||||||
|
|||||||
@@ -43,11 +43,12 @@ class Foodcourt::FoodCourtController < ApplicationController
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
@app_order_new_count = Booking.select("bookings.*,customers.*")
|
@app_order_new_count = Booking.select("bookings.*,customers.*")
|
||||||
|
.joins(" JOIN sales ON bookings.sale_id=sales.sale_id")
|
||||||
.joins(" JOIN booking_orders ON booking_orders.booking_id=bookings.booking_id")
|
.joins(" JOIN booking_orders ON booking_orders.booking_id=bookings.booking_id")
|
||||||
.joins("JOIN orders ON orders.order_id=booking_orders.order_id")
|
.joins("JOIN orders ON orders.order_id=booking_orders.order_id")
|
||||||
.joins("JOIN order_items ON orders.order_id=order_items.order_id")
|
.joins("JOIN order_items ON orders.order_id=order_items.order_id")
|
||||||
.joins("JOIN customers ON orders.customer_id=customers.customer_id")
|
.joins("JOIN customers ON orders.customer_id=customers.customer_id")
|
||||||
.where("orders.source='app' and DATE(bookings.created_at) = '#{Date.today}' and bookings.booking_status='assign'").uniq.length
|
.where("sales.sale_status =? and sales.payment_status =? and orders.source='app' and DATE(bookings.created_at)=?",'completed','paid',Date.today).order("bookings.created_at desc").uniq.length
|
||||||
render "foodcourt/addorders/detail"
|
render "foodcourt/addorders/detail"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ class Foodcourt::OrdersController < BaseFoodcourtController
|
|||||||
.joins("JOIN orders ON orders.order_id=booking_orders.order_id")
|
.joins("JOIN orders ON orders.order_id=booking_orders.order_id")
|
||||||
.joins("JOIN order_items ON orders.order_id=order_items.order_id")
|
.joins("JOIN order_items ON orders.order_id=order_items.order_id")
|
||||||
.joins("JOIN customers ON orders.customer_id=customers.customer_id")
|
.joins("JOIN customers ON orders.customer_id=customers.customer_id")
|
||||||
.where("sales.sale_status !=? and orders.source='app' and DATE(bookings.created_at)=?",'void',Date.today).order("bookings.created_at desc").uniq
|
.where("sales.sale_status =? and sales.payment_status =? and orders.source='app' and DATE(bookings.created_at)=?",'completed','paid',Date.today).order("bookings.created_at desc").uniq
|
||||||
end
|
end
|
||||||
def completed
|
def completed
|
||||||
customer =Customer.find_by_customer_id(params[:customer_id])
|
customer =Customer.find_by_customer_id(params[:customer_id])
|
||||||
|
|||||||
@@ -462,7 +462,8 @@ class Sale < ApplicationRecord
|
|||||||
|
|
||||||
tax_profiles = unique_tax_profiles(order_source, self.customer_id)
|
tax_profiles = unique_tax_profiles(order_source, self.customer_id)
|
||||||
if tax_type.nil?
|
if tax_type.nil?
|
||||||
if tax_profiles.count == 2
|
#in previous >> if tax_profiles.count ==2
|
||||||
|
if tax_profiles.count >= 2
|
||||||
tax_type = "all"
|
tax_type = "all"
|
||||||
elsif tax_profiles.count == 1
|
elsif tax_profiles.count == 1
|
||||||
if tax_profiles.name.downcase == "service charges"
|
if tax_profiles.name.downcase == "service charges"
|
||||||
|
|||||||
@@ -5,7 +5,17 @@ if @status == true
|
|||||||
json.order_items do
|
json.order_items do
|
||||||
json.array! @order.order_items, :item_code, :item_name, :qty, :options, :remark,:price
|
json.array! @order.order_items, :item_code, :item_name, :qty, :options, :remark,:price
|
||||||
end
|
end
|
||||||
|
if @sale
|
||||||
json.sale_id @sale.sale_id
|
json.sale_id @sale.sale_id
|
||||||
|
json.sale_items do
|
||||||
|
json.array! @sale.sale_items, :product_name, :qty, :remark,:price
|
||||||
|
end
|
||||||
|
json.grand_total @sale.grand_total
|
||||||
|
json.total_tax @sale.total_tax
|
||||||
|
json.taxes do
|
||||||
|
json.array! @sale.sale_taxes, :tax_name, :tax_rate, :tax_payable_amount, :inclusive
|
||||||
|
end
|
||||||
|
end
|
||||||
else
|
else
|
||||||
json.status :error
|
json.status :error
|
||||||
if @error_messages
|
if @error_messages
|
||||||
|
|||||||
@@ -215,6 +215,7 @@ namespace :shop do
|
|||||||
{membership_type:"member_discount",is_active:1,gateway_url:"/api/membership_campaigns/discount",additional_parameter:{campaign_type_id:5},merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"pZBHXEFbGNj/G",shop_code: args.shop_code},
|
{membership_type:"member_discount",is_active:1,gateway_url:"/api/membership_campaigns/discount",additional_parameter:{campaign_type_id:5},merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"pZBHXEFbGNj/G",shop_code: args.shop_code},
|
||||||
{membership_type:"get_member_campaign",is_active:1,gateway_url:"/api/membership_campaigns/get_member_campaign",additional_parameter:{campaign_type_id:5},merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"pZBHXEFbGNj/G",shop_code: args.shop_code},
|
{membership_type:"get_member_campaign",is_active:1,gateway_url:"/api/membership_campaigns/get_member_campaign",additional_parameter:{campaign_type_id:5},merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"pZBHXEFbGNj/G",shop_code: args.shop_code},
|
||||||
{membership_type:"search_paypar_account_no",is_active:1,gateway_url:"/api/generic_customer/get_membership_customer_data",merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"pZBHXEFbGNj/G",shop_code: args.shop_code},
|
{membership_type:"search_paypar_account_no",is_active:1,gateway_url:"/api/generic_customer/get_membership_customer_data",merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"pZBHXEFbGNj/G",shop_code: args.shop_code},
|
||||||
|
{membership_type:"void",is_active:1,gateway_url:"/api/payments/payment_void",merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"pZBHXEFbGNj/G",shop_code: args.shop_code},
|
||||||
{membership_type:"search_paypar_security_code",is_active:1,gateway_url:"/api/generic_customer/get_membership_customer_security_code",merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"pZBHXEFbGNj/G",shop_code: args.shop_code}])
|
{membership_type:"search_paypar_security_code",is_active:1,gateway_url:"/api/generic_customer/get_membership_customer_security_code",merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"pZBHXEFbGNj/G",shop_code: args.shop_code}])
|
||||||
puts " Finished member_actions Set Up Data"
|
puts " Finished member_actions Set Up Data"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user