sale item report and rebate balance
This commit is contained in:
@@ -95,6 +95,7 @@ class Crm::CustomersController < BaseCrmController
|
||||
auth_token = memberaction.auth_token.to_s
|
||||
url = membership.gateway_url.to_s + memberaction.gateway_url.to_s
|
||||
|
||||
begin
|
||||
response = HTTParty.post(url, :body => { name: name,phone: phone,email: email,
|
||||
dob: dob,
|
||||
member_group_id: member_group_id,merchant_uid:merchant_uid,auth_token:auth_token}.to_json,
|
||||
@@ -103,6 +104,9 @@ class Crm::CustomersController < BaseCrmController
|
||||
'Accept' => 'application/json'
|
||||
}
|
||||
)
|
||||
rescue Net::OpenTimeout
|
||||
response = { status: false }
|
||||
end
|
||||
|
||||
if response["status"] == true
|
||||
|
||||
@@ -159,7 +163,7 @@ end
|
||||
merchant_uid = memberaction.merchant_account_id.to_s
|
||||
auth_token = memberaction.auth_token.to_s
|
||||
url = membership.gateway_url.to_s + memberaction.gateway_url.to_s
|
||||
|
||||
begin
|
||||
response = HTTParty.post(url, :body => { name: name,phone: phone,email: email,
|
||||
dob: dob,
|
||||
id: id,member_group_id:member_group_id,merchant_uid:merchant_uid,auth_token:auth_token}.to_json,
|
||||
@@ -168,7 +172,9 @@ end
|
||||
'Accept' => 'application/json'
|
||||
}
|
||||
)
|
||||
|
||||
rescue Net::OpenTimeout
|
||||
response = { status: false }
|
||||
end
|
||||
format.html { redirect_to crm_customers_path, notice: 'Customer was successfully updated.' }
|
||||
format.json { render :show, status: :ok, location: @crm_customer }
|
||||
|
||||
|
||||
@@ -5,19 +5,7 @@ class Reports::DailySaleController < BaseReportController
|
||||
@sale_data = Sale.daily_sales_list(from,to)
|
||||
@tax = SaleTax.get_tax(from,to)
|
||||
end
|
||||
|
||||
# @locations = Location.all
|
||||
|
||||
# branch,from, to, report_type = get_date_range_from_params
|
||||
|
||||
# @location = Location.find_by_id(current_location)
|
||||
# @sale_data = Sale.daily_sales_report(current_location,from,to)
|
||||
# @tax = SaleT.get_tax(current_location,from,to)
|
||||
|
||||
# if @sale_data.blank? && @tax.blank? && request.post?
|
||||
# flash.now[:notice] = "No data available for selected filters"
|
||||
# end
|
||||
|
||||
def show
|
||||
|
||||
end
|
||||
|
||||
14
app/controllers/reports/sale_item_controller.rb
Normal file
14
app/controllers/reports/sale_item_controller.rb
Normal file
@@ -0,0 +1,14 @@
|
||||
class Reports::SaleItemController < BaseReportController
|
||||
|
||||
def index
|
||||
|
||||
from, to, report_type = get_date_range_from_params
|
||||
|
||||
@sale_data = Sale.get_by_range_by_saleitems(from,to,Sale::SALE_STATUS_COMPLETED,report_type)
|
||||
end
|
||||
|
||||
def show
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user