finished customer to sale assign in crm
This commit is contained in:
@@ -123,6 +123,7 @@ GEM
|
|||||||
nokogiri (1.7.2)
|
nokogiri (1.7.2)
|
||||||
mini_portile2 (~> 2.1.0)
|
mini_portile2 (~> 2.1.0)
|
||||||
pdf-core (0.7.0)
|
pdf-core (0.7.0)
|
||||||
|
pg (0.20.0)
|
||||||
prawn (2.2.2)
|
prawn (2.2.2)
|
||||||
pdf-core (~> 0.7.0)
|
pdf-core (~> 0.7.0)
|
||||||
ttfunk (~> 1.5)
|
ttfunk (~> 1.5)
|
||||||
@@ -258,7 +259,6 @@ DEPENDENCIES
|
|||||||
kaminari!
|
kaminari!
|
||||||
listen (~> 3.0.5)
|
listen (~> 3.0.5)
|
||||||
pg
|
pg
|
||||||
mysql2 (>= 0.3.18, < 0.5)
|
|
||||||
prawn
|
prawn
|
||||||
prawn-table
|
prawn-table
|
||||||
puma (~> 3.0)
|
puma (~> 3.0)
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ class Crm::CustomersController < ApplicationController
|
|||||||
# GET /crm/customers
|
# GET /crm/customers
|
||||||
# GET /crm/customers.json
|
# GET /crm/customers.json
|
||||||
def index
|
def index
|
||||||
|
@sale_id = 0
|
||||||
@crm_customers = Customer.all
|
@crm_customers = Customer.all
|
||||||
@crm_customer = Customer.new
|
@crm_customer = Customer.new
|
||||||
@membership = Customer.get_member_group
|
@membership = Customer.get_member_group
|
||||||
@@ -35,6 +36,7 @@ class Crm::CustomersController < ApplicationController
|
|||||||
# POST /crm/customers
|
# POST /crm/customers
|
||||||
# POST /crm/customers.json
|
# POST /crm/customers.json
|
||||||
def create
|
def create
|
||||||
|
|
||||||
@crm_customers = Customer.new(customer_params)
|
@crm_customers = Customer.new(customer_params)
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
@@ -61,23 +63,41 @@ class Crm::CustomersController < ApplicationController
|
|||||||
)
|
)
|
||||||
|
|
||||||
if response["status"] == true
|
if response["status"] == true
|
||||||
|
puts "hhhhhhhhhhhhhhhhhh"
|
||||||
|
puts params[:sale_id]
|
||||||
customer = Customer.find(@crm_customers.customer_id)
|
customer = Customer.find(@crm_customers.customer_id)
|
||||||
status = customer.update_attributes(membership_id: response["customer_datas"]["id"])
|
status = customer.update_attributes(membership_id: response["customer_datas"]["id"])
|
||||||
|
if params[:sale_id] != 0
|
||||||
format.html { redirect_to crm_customers_path, notice: 'Customer was successfully created.' }
|
format.html { redirect_to crm_customers_path, notice: 'Customer was successfully created.' }
|
||||||
|
else
|
||||||
|
format.html { redirect_to '/crm/customers/'+params[:sale_id]+'/assign_sale_id', notice: 'Customer was successfully created.' }
|
||||||
|
end
|
||||||
# format.json { render :index, status: :created, location: @crm_customers }
|
# format.json { render :index, status: :created, location: @crm_customers }
|
||||||
else
|
else
|
||||||
|
|
||||||
@crm_customers.destroy
|
@crm_customers.destroy
|
||||||
format.html { redirect_to crm_customers_path, notice: 'Customer was not successfully created.' }
|
|
||||||
|
if params[:sale_id] != 0
|
||||||
|
format.html { redirect_to crm_customers_path, notice: response["message"] }
|
||||||
|
|
||||||
|
else
|
||||||
|
format.html { redirect_to '/crm/customers/'+params[:sale_id]+'/assign_sale_id', notice: response["message"] }
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
# format.json { render :index, status: :created, location: @crm_customers }
|
# format.json { render :index, status: :created, location: @crm_customers }
|
||||||
|
|
||||||
else
|
else
|
||||||
|
if params[:sale_id] != 0
|
||||||
format.html { redirect_to crm_customers_path}
|
format.html { redirect_to crm_customers_path}
|
||||||
format.json { render json: @crm_customers.errors, status: :unprocessable_entity }
|
format.json { render json: @crm_customers.errors, status: :unprocessable_entity }
|
||||||
|
|
||||||
|
else
|
||||||
|
format.html { redirect_to '/crm/customers/'+params[:sale_id]+'/assign_sale_id', notice: response["message"] }
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -107,13 +127,16 @@ class Crm::CustomersController < ApplicationController
|
|||||||
'Accept' => 'application/json'
|
'Accept' => 'application/json'
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
puts response.to_json
|
|
||||||
format.html { redirect_to crm_customers_path, notice: 'Customer was successfully updated.' }
|
format.html { redirect_to crm_customers_path, notice: 'Customer was successfully updated.' }
|
||||||
format.json { render :show, status: :ok, location: @crm_customer }
|
format.json { render :show, status: :ok, location: @crm_customer }
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
format.html { render :edit }
|
format.html { render :edit }
|
||||||
format.json { render json: @crm_customer.errors, status: :unprocessable_entity }
|
format.json { render json: @crm_customer.errors, status: :unprocessable_entity }
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -127,6 +150,23 @@ class Crm::CustomersController < ApplicationController
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# DELETE /crm/customers/1
|
||||||
|
# DELETE /crm/customers/1.json
|
||||||
|
def get_sale_id
|
||||||
|
|
||||||
|
@sale_id = params[:sale_id]
|
||||||
|
@crm_customers = Customer.all
|
||||||
|
@crm_customer = Customer.new
|
||||||
|
@membership = Customer.get_member_group
|
||||||
|
if @membership["status"] == true
|
||||||
|
@member_group = @membership["data"]
|
||||||
|
end
|
||||||
|
respond_to do |format|
|
||||||
|
format.html { render action: "index"}
|
||||||
|
format.json { render json: @crm_customers }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
# Use callbacks to share common setup or constraints between actions.
|
# Use callbacks to share common setup or constraints between actions.
|
||||||
def set_crm_customer
|
def set_crm_customer
|
||||||
|
|||||||
@@ -10,17 +10,31 @@ class Crm::HomeController < BaseCrmController
|
|||||||
end
|
end
|
||||||
|
|
||||||
#print for crm
|
#print for crm
|
||||||
def print
|
def print_order
|
||||||
|
|
||||||
@booking = Booking.find(params[:id])
|
@booking = Booking.find(params[:id])
|
||||||
|
|
||||||
unique_code="CrmOrderPdf"
|
unique_code="CrmOrderPdf"
|
||||||
|
|
||||||
#print_settings = PrintSetting.find_by_unique_code(unique_code)
|
print_settings = PrintSetting.find_by_unique_code(unique_code)
|
||||||
|
|
||||||
printer = Printer::ReceiptPrinter.new()
|
printer = Printer::ReceiptPrinter.new(print_settings)
|
||||||
|
|
||||||
printer.print_crm_order(@booking)
|
printer.print_crm_order(@booking,print_settings)
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def update_sale_by_customer
|
||||||
|
|
||||||
|
sale = Sale.find(params[:sale_id])
|
||||||
|
status = sale.update_attributes(customer_id: params[:customer_id])
|
||||||
|
|
||||||
|
if status == true
|
||||||
|
render json: JSON.generate({:status => true})
|
||||||
|
else
|
||||||
|
render json: JSON.generate({:status => false, :error_message => "Record not found"})
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -74,11 +74,11 @@ class Printer::ReceiptPrinter < Printer::PrinterWorker
|
|||||||
end
|
end
|
||||||
|
|
||||||
#Bill Receipt Print
|
#Bill Receipt Print
|
||||||
def print_crm_order(booking)
|
def print_crm_order(booking,setting)
|
||||||
#Use CUPS service
|
#Use CUPS service
|
||||||
#Generate PDF
|
#Generate PDF
|
||||||
#Print
|
#Print
|
||||||
pdf = CrmOrderPdf.new(booking)
|
pdf = CrmOrderPdf.new(booking,setting)
|
||||||
pdf.render_file "tmp/print_crm_order.pdf"
|
pdf.render_file "tmp/print_crm_order.pdf"
|
||||||
self.print("tmp/print_crm_order.pdf")
|
self.print("tmp/print_crm_order.pdf")
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,21 +1,21 @@
|
|||||||
class OrderItemPdf < Prawn::Document
|
class CrmOrderPdf < Prawn::Document
|
||||||
|
|
||||||
def initialize(order_item)
|
def initialize(order_item, print_settings)
|
||||||
super(:margin => [10, 5, 30, 5], :page_size => [200,400])
|
super(:margin => [10, 5, 30, 5], :page_size => [200,400])
|
||||||
|
|
||||||
# font "public/fonts/#{font_name}".to_s + ".ttf".to_s
|
# font "public/fonts/#{font_name}".to_s + ".ttf".to_s
|
||||||
# font "public/fonts/Zawgyi-One.ttf"
|
# font "public/fonts/Zawgyi-One.ttf"
|
||||||
# font "public/fonts/padauk.ttf"
|
# font "public/fonts/padauk.ttf"
|
||||||
font_size 9
|
font_size 9
|
||||||
text "#{order_item.dining}", :size => 15
|
text "#{order_item.type}", :size => 15
|
||||||
stroke_horizontal_rule
|
stroke_horizontal_rule
|
||||||
move_down 5
|
move_down 5
|
||||||
|
|
||||||
#order_info
|
#order_info
|
||||||
order_info(order_item.order_by,order_item.order_at, order_item.customer)
|
order_info(order_item.checkin_by,order_item.checkin_at, order_item.customer_id)
|
||||||
|
|
||||||
# order items
|
# order items
|
||||||
# order_items(order_item)
|
order_items(order_item)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Write Order Information to PDF
|
# Write Order Information to PDF
|
||||||
@@ -31,7 +31,40 @@ class OrderItemPdf < Prawn::Document
|
|||||||
move_down 20
|
move_down 20
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Write Order items to PDF
|
||||||
|
def order_items(order_item)
|
||||||
|
y_position = cursor
|
||||||
|
|
||||||
|
bounding_box([0,y_position], :width => 180, :height => 15) do
|
||||||
|
text "Item", :size => 7,:align => :left
|
||||||
|
end
|
||||||
|
|
||||||
|
bounding_box([160,y_position], :width => 20, :height => 15) do
|
||||||
|
text "Qty", :size => 7,:align => :right
|
||||||
|
end
|
||||||
|
|
||||||
|
stroke_horizontal_rule
|
||||||
|
move_down 5
|
||||||
|
|
||||||
|
#Add Order Item
|
||||||
|
add_order_items(order_item)
|
||||||
|
end
|
||||||
|
|
||||||
|
# Add order items under order info
|
||||||
|
def add_order_items(order_item)
|
||||||
|
y_position = cursor
|
||||||
|
|
||||||
|
move_down 5
|
||||||
|
|
||||||
|
bounding_box([0,y_position], :width => 180, :height => 20) do
|
||||||
|
text "#{order_item.sale_id}", :size => 7,:align => :left
|
||||||
|
end
|
||||||
|
|
||||||
|
bounding_box([160,y_position], :width => 20, :height => 20) do
|
||||||
|
text "#{order_item.sale_id}", :size => 7,:align => :right
|
||||||
|
end
|
||||||
|
|
||||||
|
move_down 5
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -16,3 +16,5 @@
|
|||||||
<%= f.button :submit %>
|
<%= f.button :submit %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<!-- -->
|
||||||
|
|
||||||
@@ -56,6 +56,7 @@
|
|||||||
<div class="col-lg-4">
|
<div class="col-lg-4">
|
||||||
<%= simple_form_for @crm_customer,:url => crm_customers_path, :method => :post do |f| %>
|
<%= simple_form_for @crm_customer,:url => crm_customers_path, :method => :post do |f| %>
|
||||||
<span class="patch_method"></span>
|
<span class="patch_method"></span>
|
||||||
|
<input type="hidden" id="sale_id" name="sale_id" value="<%= @sale_id %>" />
|
||||||
<%= f.hidden_field :id, :class => "form-control col-md-6 " %>
|
<%= f.hidden_field :id, :class => "form-control col-md-6 " %>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
@@ -80,7 +81,6 @@
|
|||||||
<%= f.text_field :date_of_birth,:class=>"form-control datepicker date_of_birth",:readonly =>true, :value => @date_of_birth%>
|
<%= f.text_field :date_of_birth,:class=>"form-control datepicker date_of_birth",:readonly =>true, :value => @date_of_birth%>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<select class="selectpicker form-control col-md-12" name="membership_id">
|
<select class="selectpicker form-control col-md-12" name="membership_id">
|
||||||
<option>Select Member Group</option>
|
<option>Select Member Group</option>
|
||||||
@@ -106,6 +106,8 @@
|
|||||||
<%end%>
|
<%end%>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.2.0/jquery-confirm.min.css">
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.2.0/jquery-confirm.min.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function () {
|
$(function () {
|
||||||
if (jQuery().datepicker) {
|
if (jQuery().datepicker) {
|
||||||
@@ -121,10 +123,21 @@
|
|||||||
|
|
||||||
$(document).on('click',".checkbox_check",function(){
|
$(document).on('click',".checkbox_check",function(){
|
||||||
if(this.checked){
|
if(this.checked){
|
||||||
|
|
||||||
|
var sale_id = $("#sale_id").val() || 0;
|
||||||
var customer_id = $(this).val();
|
var customer_id = $(this).val();
|
||||||
|
|
||||||
|
if(sale_id != 0){
|
||||||
|
var url = "../"+customer_id;
|
||||||
|
update_sale(customer_id,sale_id);
|
||||||
|
}else{
|
||||||
|
|
||||||
|
var url = "customers/"+customer_id;
|
||||||
|
}
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
url: "customers/"+customer_id,
|
url: url,
|
||||||
data: {},
|
data: {},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
@@ -156,6 +169,46 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
function update_sale(customer_id,sale_id) {
|
||||||
|
$.confirm({
|
||||||
|
title: 'Confirm!',
|
||||||
|
content: 'Are You Sure to assign this customer!',
|
||||||
|
buttons: {
|
||||||
|
|
||||||
|
cancel: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
confirm: {
|
||||||
|
text: 'Confirm',
|
||||||
|
btnClass: 'btn-green',
|
||||||
|
keys: ['enter', 'shift'],
|
||||||
|
action: function(){
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
url: "../../update_sale/" ,
|
||||||
|
data: {customer_id:customer_id,sale_id:sale_id},
|
||||||
|
dataType: "json",
|
||||||
|
success: function(data) {
|
||||||
|
if(data.status == true)
|
||||||
|
{
|
||||||
|
alert('Customer has assigned');
|
||||||
|
window.location.href = '/origami'
|
||||||
|
}else{
|
||||||
|
alert('Record not found!');
|
||||||
|
location.reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*function changeMethod() {
|
/*function changeMethod() {
|
||||||
$("#update_customer").attr('method', 'put');
|
$("#update_customer").attr('method', 'put');
|
||||||
}*/
|
}*/
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<% @booking.each do |booking| %>
|
<% @booking.each do |booking| %>
|
||||||
<% if booking.booking_status == "new" %>
|
<% if booking.booking_status == "new" %>
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-block booking_click" data-ref="<%= api_booking_path booking.id%>" id="card-block booking_block" style="width:100%;" data="<%= booking.id %>">
|
<div class="card-block booking_click" data-id="sfddf" data-ref="<%= api_booking_path booking.id%>" id="card-block booking_block" style="width:100%;" >
|
||||||
<h4 class="card-title">
|
<h4 class="card-title">
|
||||||
<%= @i += 1 %> . <%= booking.dining_facility.name %>
|
<%= @i += 1 %> . <%= booking.dining_facility.name %>
|
||||||
- <%= booking.id %>
|
- <%= booking.id %>
|
||||||
@@ -43,7 +43,7 @@ $(function(){
|
|||||||
$("#cancel").removeAttr("disabled");
|
$("#cancel").removeAttr("disabled");
|
||||||
$("#assign").removeAttr("disabled");
|
$("#assign").removeAttr("disabled");
|
||||||
$("#crm_print").removeAttr("disabled");
|
$("#crm_print").removeAttr("disabled");
|
||||||
$("#crm_print").attr('data',$(this).attr('data'));
|
//$("#crm_print").val($(this).attr('data'));
|
||||||
|
|
||||||
var url = $(this).attr('data-ref');
|
var url = $(this).attr('data-ref');
|
||||||
show_details(url);
|
show_details(url);
|
||||||
@@ -66,7 +66,6 @@ $(function(){
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function show_details(url_item){
|
function show_details(url_item){
|
||||||
|
|||||||
@@ -92,7 +92,7 @@
|
|||||||
<!-- Column Three--->
|
<!-- Column Three--->
|
||||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||||
<!-- OQS Buttons -->
|
<!-- OQS Buttons -->
|
||||||
<button type="button" id="crm_print" value="" class="btn btn-primary btn-lg btn-block" disabled="disabled">
|
<button id="crm_print" value="" disabled="disabled" data-type="assign" class="btn crm_print btn-primary btn-lg btn-block" >
|
||||||
Print
|
Print
|
||||||
</button>
|
</button>
|
||||||
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Print <br/>Order<br/>Summary</button>
|
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Print <br/>Order<br/>Summary</button>
|
||||||
@@ -105,11 +105,11 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
$( document ).ready(function() {
|
$( document ).ready(function() {
|
||||||
$('#crm_print').click(function() {
|
$('.crm_print').click(function() {
|
||||||
var id = $(this).attr('data');
|
var id = "BKI-000000000004"
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
url: "print/"+id ,
|
url: "crm/print/"+id,
|
||||||
data: {},
|
data: {},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
|
|||||||
@@ -206,15 +206,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div><p id="sale" value=""></p>
|
||||||
|
|
||||||
<!-- Column Three -->
|
<!-- Column Three -->
|
||||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||||
<!-- Waiter Buttons -->
|
<!-- Waiter Buttons -->
|
||||||
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Add Order</button>
|
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Add Order</button>
|
||||||
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Edit</button>
|
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Edit</button>
|
||||||
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Move</button>
|
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Move</button>
|
||||||
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Customer</button>
|
<button type="button" id="customer" value="SAL-000000000001" class="btn btn-primary btn-lg btn-block">Customer</button>
|
||||||
<button type="button" id="request_bills" class="btn btn-primary btn-lg btn-block">Req.Bill</button>
|
<button type="button" id="request_bills" class="btn btn-primary btn-lg btn-block">Req.Bill</button>
|
||||||
<!-- Cashier Buttons -->
|
<!-- Cashier Buttons -->
|
||||||
<button type="button" class="btn btn-primary btn-lg btn-block">Discount</button>
|
<button type="button" class="btn btn-primary btn-lg btn-block">Discount</button>
|
||||||
@@ -242,6 +241,7 @@ function callOrderDetails(sale_order_id){
|
|||||||
url = "origami/"+sale_order_id.split("_")[1]
|
url = "origami/"+sale_order_id.split("_")[1]
|
||||||
data_val = { sale_id: sale_order_id.split("_")[1]}
|
data_val = { sale_id: sale_order_id.split("_")[1]}
|
||||||
$("#pay").prop('disabled',false);
|
$("#pay").prop('disabled',false);
|
||||||
|
$("#customer").prop('disabled',false);
|
||||||
$("#request_bills").prop('disabled',true);
|
$("#request_bills").prop('disabled',true);
|
||||||
}else{
|
}else{
|
||||||
order_id = sale_order_id.split("_")[1]
|
order_id = sale_order_id.split("_")[1]
|
||||||
@@ -249,6 +249,7 @@ function callOrderDetails(sale_order_id){
|
|||||||
data_val = { order_id: sale_order_id.split("_")[1]}
|
data_val = { order_id: sale_order_id.split("_")[1]}
|
||||||
$("#request_bills").prop('disabled',false);
|
$("#request_bills").prop('disabled',false);
|
||||||
$("#pay").prop('disabled',true);
|
$("#pay").prop('disabled',true);
|
||||||
|
$("#customer").prop('disabled',true);
|
||||||
}
|
}
|
||||||
|
|
||||||
table_or_order_id = order_id
|
table_or_order_id = order_id
|
||||||
@@ -347,6 +348,12 @@ $( document ).ready(function() {
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#customer').click(function() {
|
||||||
|
var sale_id = $(this).val();
|
||||||
|
window.location.href = '/crm/customers/'+ sale_id + "/assign_sale_id"
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -93,9 +93,12 @@ Rails.application.routes.draw do
|
|||||||
#--------- Customer Relationship Management ------------#
|
#--------- Customer Relationship Management ------------#
|
||||||
namespace :crm do
|
namespace :crm do
|
||||||
root "home#index" #queue number
|
root "home#index" #queue number
|
||||||
|
get 'customers/:sale_id/assign_sale_id', to: "customers#get_sale_id", :as => "assign_sale"#get sale id with customer for crm
|
||||||
resources :customers
|
resources :customers
|
||||||
post "update_booking" , to: "bookings#update_booking", as: "update_booking"
|
post "update_booking" , to: "bookings#update_booking", as: "update_booking"#assign and cancel
|
||||||
get 'print/:id', to: "home#print"
|
post "update_sale" , to: "home#update_sale_by_customer"#update customer id in sale table
|
||||||
|
get '/print/:id', to: "home#print_order"#print order for crm
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
#--------- Order Queue Station ------------#
|
#--------- Order Queue Station ------------#
|
||||||
|
|||||||
Reference in New Issue
Block a user