Merge branch 'adminbsb_ui_changes' of bitbucket.org:code2lab/sxrestaurant
This commit is contained in:
@@ -82,6 +82,7 @@ class HomeController < ApplicationController
|
||||
|
||||
@sale_data = Array.new
|
||||
@total_payment_methods = Sale.total_payment_methods(today)
|
||||
|
||||
@total_payment_methods.each do |payment|
|
||||
if payment.payment_method == "mpu" || payment.payment_method == "visa" || payment.payment_method == "master" || payment.payment_method == "jcb"
|
||||
pay = Sale.payment_sale('card', today)
|
||||
@@ -92,7 +93,6 @@ class HomeController < ApplicationController
|
||||
end
|
||||
end
|
||||
@summ_sale = Sale.summary_sale_receipt(today)
|
||||
p @summ_sale
|
||||
@total_customer = Sale.total_customer(today)
|
||||
@total_dinein = Sale.total_dinein(today)
|
||||
@total_takeaway = Sale.total_takeaway(today)
|
||||
|
||||
@@ -988,7 +988,7 @@ end
|
||||
end
|
||||
|
||||
def self.total_payment_methods(today)
|
||||
query = Sale.select("sp.payment_method")
|
||||
query = Sale.select("distinct sp.payment_method")
|
||||
.where('sales.sale_status = "completed" and DATE_FORMAT(sales.receipt_date,"%Y-%m-%d") = ?',today)
|
||||
.joins("JOIN sale_payments as sp ON sp.sale_id = sales.sale_id")
|
||||
end
|
||||
@@ -996,7 +996,7 @@ end
|
||||
def self.payment_sale(payment_method, today)
|
||||
query = Sale.joins("JOIN sale_payments as sp ON sp.sale_id = sales.sale_id")
|
||||
if payment_method == 'card'
|
||||
query = query.where('sales.sale_status = "completed" and DATE_FORMAT(sales.receipt_date,"%Y-%m-%d") = ? and sp.payment_method = "mpu" or sp.payment_method = "visa" or sp.payment_method = "master" or sp.payment_method = "jcb"',today)
|
||||
query = query.where('sales.sale_status = "completed" and DATE_FORMAT(sales.receipt_date,"%Y-%m-%d") = ? and (sp.payment_method = "mpu" or sp.payment_method = "visa" or sp.payment_method = "master" or sp.payment_method = "jcb")',today)
|
||||
else
|
||||
query = query.where("sales.sale_status = 'completed' and sp.payment_method = '#{payment_method}' and DATE_FORMAT(sales.receipt_date,'%Y-%m-%d') = ?",today)
|
||||
end
|
||||
|
||||
@@ -5,16 +5,16 @@
|
||||
|
||||
<div class="form-group">
|
||||
<label> <%= t("views.right_panel.detail.salutation") %> :</label><br>
|
||||
<label class="font-13"><%= t("views.right_panel.detail.mr") %>
|
||||
<label class="font-15"><%= t("views.right_panel.detail.mr") %>
|
||||
<%= f.radio_button :salutation,"Mr", :class => "salutation mr with-gap radio-col-indigo", :value=>"Mr", :style=>"width: 30px"%>
|
||||
</label>
|
||||
<label class="font-13 m-l--15"><%= t("views.right_panel.detail.miss") %>
|
||||
<label class="font-15"><%= t("views.right_panel.detail.miss") %>
|
||||
<%= f.radio_button :salutation,"Mrs", :class => "salutation mrs with-gap radio-col-indigo", :value=>"Mrs", :style=>"width: 30px"%>
|
||||
</label>
|
||||
<label class="font-13 m-l--15"><%= t("views.right_panel.detail.mrs") %>
|
||||
<label class="font-15"><%= t("views.right_panel.detail.mrs") %>
|
||||
<%= f.radio_button :salutation,"Miss", :class => "salutation miss with-gap radio-col-indigo", :value=>"Miss", :style=>"width: 30px"%>
|
||||
</label>
|
||||
<label class="font-13 m-l--15">
|
||||
<label class="font-15">
|
||||
<%= t("views.right_panel.detail.mdm") %>
|
||||
<%= f.radio_button :salutation,"Mdm", :class => "salutation mdm with-gap radio-col-indigo", :value=>"Mdm", :style=>"width: 30px"%>
|
||||
</label>
|
||||
@@ -50,7 +50,7 @@
|
||||
<% str="[\"#{msg['company']}\"]"
|
||||
str.gsub!('["', '')
|
||||
str.gsub!('"]', '') %>
|
||||
<lable class="error col-red m-t--10" style="margin-top:-6px"><%= str %></lable>
|
||||
<lable class="error col-red m-t-10" style="margin-top:-6px"><%= str %></lable>
|
||||
<% end -%>
|
||||
</div>
|
||||
<div class="form-group <%= (flash["errors"]) ? "error" : "" %>">
|
||||
@@ -60,7 +60,7 @@
|
||||
<% str="[\"#{msg['contact_no']}\"]"
|
||||
str.gsub!('["', '')
|
||||
str.gsub!('"]', '') %>
|
||||
<lable class="error col-red m-t--10" style="margin-top:-6px"><%= str %></lable>
|
||||
<lable class="error col-red m-t-10" style="margin-top:-6px"><%= str %></lable>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
<% str="[\"#{msg['email']}\"]"
|
||||
str.gsub!('["', '')
|
||||
str.gsub!('"]', '') %>
|
||||
<lable class="error col-red m-t--10" style="margin-top:-6px"><%= str %></lable>
|
||||
<lable class="error col-red m-t-10" style="margin-top:-6px"><%= str %></lable>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
@@ -111,7 +111,7 @@
|
||||
<% str="[\"#{msg['card_no']}\"]"
|
||||
str.gsub!('["', '')
|
||||
str.gsub!('"]', '') %>
|
||||
<lable class="error col-red m-t--10" style="margin-top:-6px"><%= str %></lable>
|
||||
<lable class="error col-red m-t-10" style="margin-top:-6px"><%= str %></lable>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -88,22 +88,18 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-3 col-sm-3">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="body" id="custom-slimscroll">
|
||||
<%= render 'new_form', crm_customer: @crm_customer, taxes: @taxes %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="body" id="custom-slimscroll">
|
||||
<%= render 'new_form', crm_customer: @crm_customer, taxes: @taxes %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="col-lg-1 col-md-1 col-sm-1 ">
|
||||
<br>
|
||||
<a href="<%= dashboard_path%>" class="btn btn-primary">
|
||||
<i class="fa fa-arrow-left fa-lg"></i> Back
|
||||
</a>
|
||||
</div> -->
|
||||
<!-- <div class="col-lg-1 col-md-1 col-sm-1 ">
|
||||
<br>
|
||||
<a href="<%= dashboard_path%>" class="btn btn-primary">
|
||||
<i class="fa fa-arrow-left fa-lg"></i> Back
|
||||
</a>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
|
||||
@@ -147,7 +147,11 @@
|
||||
<% if payment.payment_method == 'mpu' || payment.payment_method == 'visa' || payment.payment_method == 'master' || payment.payment_method == 'jcb' %>
|
||||
<tr>
|
||||
<td>Card Sale : </td>
|
||||
<td align="right"><%= @sale_data[0]['card'] %></td>
|
||||
<td align="right">
|
||||
<% @sale_data.each do |data| %>
|
||||
<%= data["card"] %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<% else %>
|
||||
<tr>
|
||||
@@ -220,16 +224,16 @@
|
||||
<table class="table">
|
||||
<% if !@total_order.nil? %>
|
||||
<tr>
|
||||
<td>Total Order : </td>
|
||||
<td align="right"><%= @total_order.total_order %></td>
|
||||
<td width="40px">Total Order : </td>
|
||||
<td align="right" width="60px" style="padding: 5px"><%= @total_order.total_order %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
<% if !(@total_accounts.nil?) %>
|
||||
<% @total_accounts.each do |account| %>
|
||||
<tr>
|
||||
<td><%= account.title %> (Account) : </td>
|
||||
<td align="right">
|
||||
<td width="40px"><%= account.title %> (Account) : </td>
|
||||
<td align="right" width="60px" style="padding: 5px">
|
||||
<% @account_data.each do |data| %>
|
||||
<% acc = account.title %>
|
||||
<%= data[""+acc+""] %> <% if !data[''+acc+''].nil? %> ( <%= data[''+acc+'_amount'] %> ) <% end %>
|
||||
@@ -240,15 +244,15 @@
|
||||
<% end %>
|
||||
<% if !@top_items.nil? %>
|
||||
<tr>
|
||||
<td>Top Item : </td>
|
||||
<td align="right"><%= @top_items.item_name %>
|
||||
<br>( <%= @top_items.item_total_price %> )</td>
|
||||
<td width="40px">Top Item : </td>
|
||||
<td align="right" width="60px" style="padding: 5px"><%= @top_items.item_name %>
|
||||
<br>(<%= @top_items.item_total_price %>)</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% if !@total_foc_items.nil? %>
|
||||
<tr>
|
||||
<td>Total FOC Item : </td>
|
||||
<td align="right"><%= @total_foc_items %></td>
|
||||
<td width="40px">Total FOC Item : </td>
|
||||
<td align="right" width="60px" style="padding: 5px"><%= @total_foc_items %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
@@ -30,9 +30,10 @@
|
||||
<ul class="dropdown-menu">
|
||||
<li>
|
||||
<%if current_login_employee.role !="waiter" %>
|
||||
<a class="delete waves-effect waves-block" style="padding:0.5rem 1rem; margin-bottom: 0rem;" data-ref="<%=logout_path%>" data-method="delete">
|
||||
<i class="material-icons m-t-10">exit_to_app</i> Logout
|
||||
</a>
|
||||
<p class="delete waves-effect waves-block p-l-30 m-t-15" data-ref="<%=logout_path%>" data-method="delete">
|
||||
<i class="material-icons">exit_to_app</i>
|
||||
<span class="font-20 m-b-10">Logout</span>
|
||||
</p>
|
||||
<span class="hidden" id="delete_text">
|
||||
<h6>Are you sure you want to Logout ?</h6>
|
||||
<!-- <h6>This action can't be undo. </h6> -->
|
||||
|
||||
@@ -13,242 +13,244 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-md-8 col-sm-8">
|
||||
<div class="card">
|
||||
<div class="main-box-body clearfix" id="order-detail-slimscroll" style="">
|
||||
<div class="table-responsive">
|
||||
<table id="origami-crm-table" class="table table-striped">
|
||||
|
||||
<div class="main-box-body clearfix" id="order-detail-slimscroll" style="">
|
||||
<div class="table-responsive">
|
||||
<table id="origami-crm-table" class="table table-striped">
|
||||
<thead>
|
||||
|
||||
<thead>
|
||||
|
||||
<tr>
|
||||
<td colspan="6">
|
||||
<!-- <% path ="/origami/#{@sale_id}/customers" %>
|
||||
<%= form_tag path, :id => "filter_form", :method => :get do %>
|
||||
<div class="input-append col-md-7 form-group pull-left">
|
||||
<input type="text" name="filter" style="margin-right:10px" id="search" placeholder="Search" class="form-control input-sm col-md-9">
|
||||
<input type="hidden" name="type" id="type" value="">
|
||||
<button type="submit" class="btn btn-primary btn-sm">Search</button>
|
||||
</div>
|
||||
<% end %>
|
||||
<button id="member_acc_no" class="btn btn-success btn-sm"><span class="fa fa-credit-card"></span> Member Card</button> -->
|
||||
<div class="body">
|
||||
<% path ="/origami/#{@sale_id}/customers" %>
|
||||
<%= form_tag path, :id => "filter_form", :method => :get do %>
|
||||
<div class="row clearfix">
|
||||
<div class="col-lg-5 col-md-5 col-sm-5 col-xs-12">
|
||||
|
||||
<input type="text" name="filter" style="margin-right:10px" id="search" placeholder="Search" class="form-control input-sm col-md-12">
|
||||
<input type="hidden" name="type" id="type" value="<%= @dining_facility.type %>">
|
||||
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-12">
|
||||
<button type="submit" class="btn bg-blue waves-effect waves-effect">Search</button>
|
||||
</div>
|
||||
|
||||
<button type="button" id="member_acc_no" class="btn bg-green btn-sm waves-effect" style="height: 30%;margin-right: 10px;">Member Card</button>
|
||||
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Select</th>
|
||||
<th>Sr.no</th>
|
||||
<th>Name</th>
|
||||
<th>Company</th>
|
||||
<th>Contact no</th>
|
||||
<th>Email</th>
|
||||
<!-- <th>Paypar No</th> -->
|
||||
</tr>
|
||||
</thead>
|
||||
<td colspan="6">
|
||||
<!-- <% path ="/origami/#{@sale_id}/customers" %>
|
||||
<%= form_tag path, :id => "filter_form", :method => :get do %>
|
||||
<div class="input-append col-md-7 form-group pull-left">
|
||||
<input type="text" name="filter" style="margin-right:10px" id="search" placeholder="Search" class="form-control input-sm col-md-9">
|
||||
<input type="hidden" name="type" id="type" value="">
|
||||
<button type="submit" class="btn btn-primary btn-sm">Search</button>
|
||||
</div>
|
||||
<% end %>
|
||||
<button id="member_acc_no" class="btn btn-success btn-sm"><span class="fa fa-credit-card"></span> Member Card</button> -->
|
||||
<div class="body">
|
||||
<% path ="/origami/#{@sale_id}/customers" %>
|
||||
<%= form_tag path, :id => "filter_form", :method => :get do %>
|
||||
<div class="row clearfix">
|
||||
<div class="col-lg-5 col-md-5 col-sm-5 col-xs-12">
|
||||
|
||||
<tbody>
|
||||
<% if @crm_customers.count > 0 %>
|
||||
<% @i = 0 %>
|
||||
<% @crm_customers.each do |crm_customer| %>
|
||||
<input type="text" name="filter" style="margin-right:10px" id="search" placeholder="Search" class="form-control input-sm col-md-12">
|
||||
<input type="hidden" name="type" id="type" value="<%= @dining_facility.type %>">
|
||||
|
||||
<tr class="customer_tr" data-ref="<%= crm_customer.customer_id %>">
|
||||
<td>
|
||||
<input type="radio" style="width:20px;" name="checkbox" class="checkbox_check" ></td>
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-12">
|
||||
<button type="submit" class="btn bg-blue waves-effect waves-effect">Search</button>
|
||||
</div>
|
||||
|
||||
<button type="button" id="member_acc_no" class="btn bg-green btn-sm waves-effect" style="height: 30%;margin-right: 10px;">Member Card</button>
|
||||
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th><%= t("views.right_panel.detail.sr_no") %></th>
|
||||
<th><%= t("views.right_panel.detail.name") %></th>
|
||||
<th><%= t("views.right_panel.detail.card_no") %></th>
|
||||
<th><%= t("views.right_panel.detail.contact_no") %></th>
|
||||
<th><%= t("views.right_panel.detail.email") %></th>
|
||||
<!-- <th>Paypar No</th> -->
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% if @crm_customers.count > 0 %>
|
||||
<% @i = 0 %>
|
||||
<% @crm_customers.each do |crm_customer| %>
|
||||
|
||||
<tr class="customer_tr" data-ref="<%= crm_customer.customer_id %>">
|
||||
<td>
|
||||
<% if crm_customer.customer_id != "CUS-000000000001" && crm_customer.customer_id != "CUS-000000000002" %>
|
||||
<%= @i += 1 %>
|
||||
<%else%>
|
||||
-
|
||||
<% end %>
|
||||
</td>
|
||||
<td><%= crm_customer.name %></td>
|
||||
<td><%= crm_customer.company rescue '-' %></td>
|
||||
<td><%= crm_customer.contact_no %></td>
|
||||
<td><%= crm_customer.email %></td>
|
||||
<!-- <td><%= crm_customer.paypar_account_no %></td> -->
|
||||
<input type="radio" style="width:20px;" name="checkbox" class="checkbox_check" ></td>
|
||||
<td>
|
||||
<% if crm_customer.customer_id != "CUS-000000000001" && crm_customer.customer_id != "CUS-000000000002" %>
|
||||
<%= @i += 1 %>
|
||||
<%else%>
|
||||
-
|
||||
<% end %>
|
||||
</td>
|
||||
<td><%= crm_customer.name %></td>
|
||||
<td><%= crm_customer.company rescue '-' %></td>
|
||||
<td><%= crm_customer.contact_no %></td>
|
||||
<td><%= crm_customer.email %></td>
|
||||
<!-- <td><%= crm_customer.paypar_account_no %></td> -->
|
||||
|
||||
</tr>
|
||||
<% end %>
|
||||
<%else%>
|
||||
<tr><td colspan="5"><p style="text-align:center"><strong>There are no record for your search</strong></p></td></tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<br>
|
||||
</tr>
|
||||
<% end %>
|
||||
<%else%>
|
||||
<tr><td colspan="5"><p style="text-align:center"><strong>There are no record for your search</strong></p></td></tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<br>
|
||||
|
||||
<%= paginate @crm_customers %>
|
||||
<%= paginate @crm_customers %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- <div class="col-lg-4 col-md-4 col-sm-4" style="min-height:600px; max-height:600px; overflow-x:scroll"> -->
|
||||
<div class="col-lg-3 col-md-3 col-sm-3" >
|
||||
<div id="custom-slimscroll">
|
||||
<%= simple_form_for @crm_customer,:url => crm_customers_path, :method => :post do |f| %>
|
||||
|
||||
<span class="patch_method"></span>
|
||||
<input type="hidden" id="sale_id" name="sale_id" value="<%= @sale_id %>" />
|
||||
<input type="hidden" id="table_id" name="table_id" value="<%= @dining_facility.id %>" />
|
||||
<input type="hidden" id="type" name="type" value="<%= @dining_facility.type %>" />
|
||||
<%= f.error_notification %>
|
||||
<%= f.hidden_field :id, :class => "form-control col-md-6 " %>
|
||||
<div class="form-group">
|
||||
<label>Salutation :</label><br>
|
||||
<label class="font-13">Mr</label>
|
||||
<%= f.radio_button :salutation,"Mr", :class => "salutation mr", :value=>"Mr"%>
|
||||
<label class="m-l--20">Miss</label>
|
||||
<%= f.radio_button :salutation,"Mrs", :class => "salutation mrs", :value=>"Mrs"%>
|
||||
<label class="m-l--20">Mrs</label>
|
||||
<%= f.radio_button :salutation,"Miss", :class => "salutation miss", :value=>"Miss"%>
|
||||
<label class="m-l--20">Mdm</label>
|
||||
<%= f.radio_button :salutation,"Mdm", :class => "salutation mdm", :value=>"Mdm"%>
|
||||
</div>
|
||||
|
||||
<div class="form-group <%= (flash["errors"]) ? "has-error" : "" %>">
|
||||
<%= f.input :name, :class => "form-control col-md-6 name", :required => true %>
|
||||
|
||||
<% flash.each do |name, msg| %>
|
||||
<% str="[\"#{msg['name']}\"]"
|
||||
str.gsub!('["', '')
|
||||
str.gsub!('"]', '') %>
|
||||
<span class="help-block"><%= str %></span>
|
||||
<% end -%>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Gender :</label><br>
|
||||
<label>Male</label>
|
||||
<%= f.radio_button :gender,"Male", :class => "gender male", :value=>"Male", :style=>"width: 30px"%>
|
||||
<label>Female</label>
|
||||
<%= f.radio_button :gender,"Female", :class => "gender female", :value=>"Female", :style=>"width: 30px"%>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<%= f.input :nrc_no, :label => "NRC No",:class => "form-control nrc_no" %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= f.input :company, :class => "form-control col-md-6 company"%>
|
||||
|
||||
<% flash.each do |name, msg| %>
|
||||
<% str="[\"#{msg['company']}\"]"
|
||||
str.gsub!('["', '')
|
||||
str.gsub!('"]', '') %>
|
||||
<span class="help-block"><%= str %></span>
|
||||
<% end -%>
|
||||
</div>
|
||||
<div class="form-group <%= (flash["errors"]) ? "has-error" : "" %>">
|
||||
<%= f.input :contact_no, :class => "form-control col-md-6 contact_no" ,:required => true%>
|
||||
|
||||
<% flash.each do |name, msg| %>
|
||||
<% str="[\"#{msg['contact_no']}\"]"
|
||||
str.gsub!('["', '')
|
||||
str.gsub!('"]', '') %>
|
||||
<span class="help-block"><%= str %></span>
|
||||
<% end -%>
|
||||
</div>
|
||||
|
||||
<div class="form-group <%= (flash["errors"]) ? "has-error" : "" %>">
|
||||
<%= f.input :email, :class => "form-control col-md-6 email" ,:required => true%>
|
||||
<% flash.each do |name, msg| %>
|
||||
<% str="[\"#{msg['contact_no']}\"]"
|
||||
str.gsub!('["', '')
|
||||
str.gsub!('"]', '') %>
|
||||
<span class="help-block"><%= str %></span>
|
||||
<% end -%>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<%= f.input :address, :class => "form-control col-md-6 address" %>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Sr.No</label>
|
||||
<input type="text" name="" value="<%=@count_customer%>" class="form-control" readonly="true">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Date Of Birth</label>
|
||||
<%= f.text_field :date_of_birth,:value=>"01-01-1990",:class=>"form-control datepicker"%>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Select Customer Type</label>
|
||||
<select class="form-control col-md-12" id="customer_type" name="customer[customer_type]" style="height: 40px" >
|
||||
<% Lookup.where("lookup_type = ?", "customer_type" ).each do |ct| %>
|
||||
<option value="<%= ct.value %>">
|
||||
<%= ct.name %></option>
|
||||
<%end %>
|
||||
</select>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="body" id="custom-slimscroll">
|
||||
<%= simple_form_for @crm_customer,:url => crm_customers_path, :method => :post do |f| %>
|
||||
|
||||
<span class="patch_method"></span>
|
||||
<input type="hidden" id="sale_id" name="sale_id" value="<%= @sale_id %>" />
|
||||
<input type="hidden" id="table_id" name="table_id" value="<%= @dining_facility.id %>" />
|
||||
<input type="hidden" id="type" name="type" value="<%= @dining_facility.type %>" />
|
||||
<%= f.error_notification %>
|
||||
<%= f.hidden_field :id, :class => "form-control col-md-6 " %>
|
||||
<div class="form-group">
|
||||
<%= f.input :tax_profiles, :collection => @taxes, :input_html => { :multiple => true }, :class => "form-control col-md-6 tax_profiles" %>
|
||||
<label><%= t("views.right_panel.detail.salutation") %> :</label><br>
|
||||
<label class="font-15"><%= t("views.right_panel.detail.mr") %>
|
||||
<%= f.radio_button :salutation,"Mr", :class => "salutation mr", :value=>"Mr"%></label>
|
||||
<label class="font-15 m-l-20"><%= t("views.right_panel.detail.miss") %>
|
||||
<%= f.radio_button :salutation,"Mrs", :class => "salutation mrs", :value=>"Mrs"%></label>
|
||||
<label class="font-15 m-l-20"><%= t("views.right_panel.detail.mrs") %>
|
||||
<%= f.radio_button :salutation,"Miss", :class => "salutation miss", :value=>"Miss"%></label>
|
||||
<label class="font-15 m-l-20"><%= t("views.right_panel.detail.mdm") %>
|
||||
<%= f.radio_button :salutation,"Mdm", :class => "salutation mdm", :value=>"Mdm"%></label>
|
||||
</div>
|
||||
|
||||
<div class="form-group <%= (flash["errors"]) ? "has-error" : "" %>">
|
||||
<%= f.input :card_no, :class => "form-control col-md-6 card_no"%>
|
||||
<%= f.input :name, :class => "form-control col-md-6 name", :required => true %>
|
||||
|
||||
<% flash.each do |name, msg| %>
|
||||
<% str="[\"#{msg['name']}\"]"
|
||||
str.gsub!('["', '')
|
||||
str.gsub!('"]', '') %>
|
||||
<span class="help-block" style="margin-top:-10px"><%= str %></span>
|
||||
<span class="help-block"><%= str %></span>
|
||||
<% end -%>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Paypar Account No:</label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" id="paypar_account_no" name="customer[paypar_account_no]" readonly />
|
||||
<div class="input-group-addon"><span class="fa fa-credit-card"></span></div>
|
||||
<label><%= t("views.right_panel.detail.gender") %> :</label><br>
|
||||
<label><%= t("views.right_panel.detail.male") %>
|
||||
<%= f.radio_button :gender,"Male", :class => "gender male", :value=>"Male", :style=>"width: 30px"%></label>
|
||||
<label><%= t("views.right_panel.detail.female") %>
|
||||
<%= f.radio_button :gender,"Female", :class => "gender female", :value=>"Female", :style=>"width: 30px"%></label>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<%= f.input :nrc_no, :label => "NRC No",:class => "form-control nrc_no" %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= f.input :company, :class => "form-control col-md-6 company"%>
|
||||
|
||||
<% flash.each do |name, msg| %>
|
||||
<% str="[\"#{msg['company']}\"]"
|
||||
str.gsub!('["', '')
|
||||
str.gsub!('"]', '') %>
|
||||
<span class="help-block"><%= str %></span>
|
||||
<% end -%>
|
||||
</div>
|
||||
<div class="form-group <%= (flash["errors"]) ? "has-error" : "" %>">
|
||||
<%= f.input :contact_no, :class => "form-control col-md-6 contact_no" ,:required => true%>
|
||||
|
||||
<% flash.each do |name, msg| %>
|
||||
<% str="[\"#{msg['contact_no']}\"]"
|
||||
str.gsub!('["', '')
|
||||
str.gsub!('"]', '') %>
|
||||
<span class="help-block"><%= str %></span>
|
||||
<% end -%>
|
||||
</div>
|
||||
|
||||
<div class="form-group <%= (flash["errors"]) ? "has-error" : "" %>">
|
||||
<%= f.input :email, :class => "form-control col-md-6 email" ,:required => true%>
|
||||
<% flash.each do |name, msg| %>
|
||||
<% str="[\"#{msg['contact_no']}\"]"
|
||||
str.gsub!('["', '')
|
||||
str.gsub!('"]', '') %>
|
||||
<span class="help-block"><%= str %></span>
|
||||
<% end -%>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<%= f.input :address, :class => "form-control col-md-6 address" %>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label><%= t("views.right_panel.detail.sr_no") %></label>
|
||||
<input type="text" name="" value="<%=@count_customer%>" class="form-control" readonly="true">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label><%= t("views.right_panel.detail.date_of_birth") %></label>
|
||||
<%= f.text_field :date_of_birth,:value=>"01-01-1990",:class=>"form-control datepicker"%>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label><%= t("views.right_panel.detail.select_customer_type") %></label>
|
||||
<select class="form-control col-md-12" id="customer_type" name="customer[customer_type]" style="height: 40px" >
|
||||
<% Lookup.where("lookup_type = ?", "customer_type" ).each do |ct| %>
|
||||
<option value="<%= ct.value %>">
|
||||
<%= ct.name %></option>
|
||||
<%end %>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Select Member Group</label>
|
||||
<select class="form-control col-md-12" name="member_group_id">
|
||||
<option value="">Select Membership Group</option>
|
||||
<% Lookup.where("lookup_type = ?", "member_group_type" ).each do |member| %>
|
||||
<option value="<%= member.value %>">
|
||||
<%= member.name %></option>
|
||||
<%end %>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= f.input :tax_profiles, :collection => @taxes, :input_html => { :multiple => true }, :class => "form-control col-md-6 tax_profiles" %>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect', :id => 'submit_customer' %>
|
||||
<!-- <%= f.button :submit, "Update",:class => 'btn bg-blue btn-block', :disabled =>'', :id => 'update_customer' %> -->
|
||||
<div class="form-group <%= (flash["errors"]) ? "has-error" : "" %>">
|
||||
<%= f.input :card_no, :class => "form-control col-md-6 card_no"%>
|
||||
<% flash.each do |name, msg| %>
|
||||
<% str="[\"#{msg['name']}\"]"
|
||||
str.gsub!('["', '')
|
||||
str.gsub!('"]', '') %>
|
||||
<span class="help-block" style="margin-top:-10px"><%= str %></span>
|
||||
<% end -%>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label><%= t("views.right_panel.detail.paypar_account_no") %>:</label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" id="paypar_account_no" name="customer[paypar_account_no]" readonly />
|
||||
<div class="input-group-addon"><span class="fa fa-credit-card"></span></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label><%= t("views.right_panel.detail.select_membership_group") %></label>
|
||||
<select class="form-control col-md-12" name="member_group_id">
|
||||
<option value=""><%= t("views.right_panel.detail.select_membership_group") %></option>
|
||||
<% Lookup.where("lookup_type = ?", "member_group_type" ).each do |member| %>
|
||||
<option value="<%= member.value %>">
|
||||
<%= member.name %></option>
|
||||
<%end %>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<%= f.submit t("views.btn.submit"),:class => 'btn btn-primary btn-lg waves-effect', :id => 'submit_customer' %>
|
||||
<!-- <%= f.button :submit, "Update",:class => 'btn bg-blue btn-block', :disabled =>'', :id => 'update_customer' %> -->
|
||||
</div>
|
||||
<%end%>
|
||||
</div>
|
||||
</div>
|
||||
<%end%>
|
||||
</div>
|
||||
<!-- Column Three -->
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<button type="button" class="btn btn-default btn-block" id='back'><i class="material-icons">reply</i>Back</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="sxModal">
|
||||
<div id="sxModal-Content"><h3>Card Tap</h3></div>
|
||||
</div>
|
||||
<div id="sxModal">
|
||||
<div id="sxModal-Content"><h3>Card Tap</h3></div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
/*$('.datepicker').datepicker({
|
||||
setDate: '12-12-1999',
|
||||
format : 'dd-mm-yyyy',
|
||||
@@ -407,36 +409,36 @@
|
||||
customer = '(' + customer_name + ')';
|
||||
}
|
||||
swal({
|
||||
title: "Confirmation !",
|
||||
text: 'Are You Sure to assign this customer' + customer + '!',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "green",
|
||||
confirmButtonText: "Yes!",
|
||||
cancelButtonClass: 'btn btn-danger',
|
||||
closeOnConfirm: false,
|
||||
}, 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)
|
||||
{
|
||||
var id = $("#table_id").val()
|
||||
var type = $("#type").val()
|
||||
if (type=="Table") {
|
||||
window.location.href = '/origami/table/'+id
|
||||
}else{
|
||||
window.location.href = '/origami/room/'+id
|
||||
}
|
||||
}else{
|
||||
swal("Alert!", "Record not found!", "error");
|
||||
location.reload();
|
||||
}
|
||||
title: "Confirmation !",
|
||||
text: 'Are You Sure to assign this customer' + customer + '!',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "green",
|
||||
confirmButtonText: "Yes!",
|
||||
cancelButtonClass: 'btn btn-danger',
|
||||
closeOnConfirm: false,
|
||||
}, 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)
|
||||
{
|
||||
var id = $("#table_id").val()
|
||||
var type = $("#type").val()
|
||||
if (type=="Table") {
|
||||
window.location.href = '/origami/table/'+id
|
||||
}else{
|
||||
window.location.href = '/origami/room/'+id
|
||||
}
|
||||
}else{
|
||||
swal("Alert!", "Record not found!", "error");
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
$('#back').on('click',function(){
|
||||
|
||||
@@ -1,24 +1,27 @@
|
||||
<%= simple_form_for @in_juty, :url => origami_index_in_juty_path(@table.id), :method => :post do |f| %>
|
||||
<span class="patch_method"></span>
|
||||
<%= f.error_notification %>
|
||||
<%= f.hidden_field :id, :class => "form-control col-md-6 " %>
|
||||
<div class="card">
|
||||
<div class="body">
|
||||
<span class="patch_method"></span>
|
||||
<%= f.error_notification %>
|
||||
<%= f.hidden_field :id, :class => "form-control col-md-6 " %>
|
||||
|
||||
<div class="form-inputs">
|
||||
<%= f.hidden_field :dinning_id, :value => @table.id, :class => "form-control col-md-4 " %>
|
||||
<label>Commissioner Name:</label>
|
||||
<%= f.collection_select :commissioner_ids, Commissioner.all, :id, :name, {prompt: 'Select Commissioner'}, {class: 'form-control'} %>
|
||||
<%= f.input :in_time, :placeholder => "From Date", :class => "form-control" %>
|
||||
<%= f.input :out_time, :placeholder => "To Date", :class => "form-control" %>
|
||||
</div><br>
|
||||
<div class="form-inputs">
|
||||
<%= f.hidden_field :dinning_id, :value => @table.id, :class => "form-control col-md-4 " %>
|
||||
<label>Commissioner Name:</label>
|
||||
<%= f.collection_select :commissioner_ids, Commissioner.all, :id, :name, {prompt: 'Select Commissioner'}, {class: 'form-control'} %>
|
||||
<%= f.input :in_time, :placeholder => "From Date", :class => "form-control" %>
|
||||
<%= f.input :out_time, :placeholder => "To Date", :class => "form-control" %>
|
||||
</div><br>
|
||||
|
||||
<div class="form-group">
|
||||
<%= f.button :submit, "Create", :class => 'btn btn-primary ', :id => 'create' %>
|
||||
<%= f.button :submit, "Update", :class => 'btn btn-primary ', :disabled => '', :id => 'update' %>
|
||||
<%= f.button :button, "Reset", :class => 'btn btn-danger ', :id => 'reset' %>
|
||||
<div class="form-group">
|
||||
<%= f.button :submit, "Create", :class => 'btn btn-primary ', :id => 'create' %>
|
||||
<%= f.button :submit, "Update", :class => 'btn btn-primary ', :disabled => '', :id => 'update' %>
|
||||
<%= f.button :button, "Reset", :class => 'btn btn-danger ', :id => 'reset' %>
|
||||
|
||||
<button type="button" class="btn btn-inverse pull-right" id='back'> <button type="button" class="btn bg-default btn-block" onclick="window.location.href = "origami_index_in_duty_path(@table.id)"><i class="material-icons">reply</i> Back </button>Back</button>
|
||||
<button type="button" class="btn btn-inverse pull-right" id='back'> <button type="button" class="btn bg-default btn-block" onclick="window.location.href = "origami_index_in_duty_path(@table.id)"><i class="material-icons">reply</i> Back </button>Back</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
||||
|
||||
@@ -1,14 +1,18 @@
|
||||
<%= simple_form_for([:origami, @in_duty]) do |f| %>
|
||||
<%= f.error_notification %>
|
||||
<div class="card">
|
||||
<div class="body">
|
||||
<%= f.error_notification %>
|
||||
<div class="form-inputs">
|
||||
<%= f.collection_select :commissioner_ids, Commissioner.all, :id, :name, {prompt: 'Select Commissioner'}, {class: 'form-control'} %>
|
||||
<br/><br/>
|
||||
<%= f.input :in_time %>
|
||||
<%= f.input :out_time %>
|
||||
</div>
|
||||
|
||||
<div class="form-inputs">
|
||||
<%= f.collection_select :commissioner_ids, Commissioner.all, :id, :name, {prompt: 'Select Commissioner'}, {class: 'form-control'} %>
|
||||
<br/><br/>
|
||||
<%= f.input :in_time %>
|
||||
<%= f.input :out_time %>
|
||||
<div class="form-actions">
|
||||
<%= f.button :submit %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<%= f.button :submit %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<br>
|
||||
<%= simple_form_for @in_duty, :url => origami_index_in_duty_path, :method => :post do |f| %>
|
||||
<div class="card">
|
||||
<div class="body">
|
||||
<span class="patch_method"></span>
|
||||
<%= f.error_notification %>
|
||||
<%= f.hidden_field :id, :class => "form-control col-md-6 " %>
|
||||
@@ -10,52 +12,55 @@
|
||||
<br/>
|
||||
|
||||
<!-- <%= f.input :in_time, :placeholder => "From Date", :class => "form-control datetimepicker" %>
|
||||
<%= f.input :out_time, :placeholder => "To Date", :class => "form-control datetimepicker" %>-->
|
||||
<%= f.input :out_time, :placeholder => "To Date", :class => "form-control datetimepicker" %>-->
|
||||
|
||||
<div class="form-group">
|
||||
<label class="font-14">* In Time</label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">
|
||||
<i class="material-icons">date_range</i>
|
||||
</span>
|
||||
<% if !@in_duty.in_time.nil?%>
|
||||
<input type="text" name="in_duty[in_time]" value="<%= @in_duty.in_time.strftime('%A, %d-%m-%Y') %>" class="datepicker form-control col-md-12" placeholder="Start Date...">
|
||||
<% else %>
|
||||
<input type="text" name="in_duty[in_time]" class="datetimepicker form-control col-md-12" placeholder="In Time...">
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="font-14">* In Time</label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">
|
||||
<i class="material-icons">date_range</i>
|
||||
</span>
|
||||
<% if !@in_duty.in_time.nil?%>
|
||||
<input type="text" name="in_duty[in_time]" value="<%= @in_duty.in_time.strftime('%A, %d-%m-%Y') %>" class="datepicker form-control col-md-12" placeholder="Start Date...">
|
||||
<% else %>
|
||||
<input type="text" name="in_duty[in_time]" class="datetimepicker form-control col-md-12" placeholder="In Time...">
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>* Out Time</label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">
|
||||
<i class="material-icons">date_range</i>
|
||||
</span>
|
||||
<% if !@in_duty.out_time.nil?%>
|
||||
<input type="text" name="in_duty[out_time]" value="<%= @in_duty.out_time.strftime('%A, %d-%m-%Y') %>" class="datepicker form-control col-md-12" placeholder="Start Date...">
|
||||
<% else %>
|
||||
<input type="text" name="in_duty[out_time]" class="datetimepicker form-control col-md-12" placeholder="Out Time...">
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div><br>
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<% f.button :submit, "Create", :class => 'btn bg-blue ', :id => 'create' %>
|
||||
<% f.button :submit, "Update", :class => 'btn bg-blue ', :disabled => '', :id => 'update' %>
|
||||
<% f.button :button, "Reset", :class => 'btn bg-danger ', :id => 'reset' %>
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<%= f.submit "Create In Duty", :class => 'btn bg-blue' %>
|
||||
<label>* Out Time</label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">
|
||||
<i class="material-icons">date_range</i>
|
||||
</span>
|
||||
<% if !@in_duty.out_time.nil?%>
|
||||
<input type="text" name="in_duty[out_time]" value="<%= @in_duty.out_time.strftime('%A, %d-%m-%Y') %>" class="datepicker form-control col-md-12" placeholder="Start Date...">
|
||||
<% else %>
|
||||
<input type="text" name="in_duty[out_time]" class="datetimepicker form-control col-md-12" placeholder="Out Time...">
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div><br>
|
||||
|
||||
<div class="form-group">
|
||||
<% f.button :submit, "Create", :class => 'btn bg-blue ', :id => 'create' %>
|
||||
<% f.button :submit, "Update", :class => 'btn bg-blue ', :disabled => '', :id => 'update' %>
|
||||
<% f.button :button, "Reset", :class => 'btn bg-danger ', :id => 'reset' %>
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<%= f.submit "Create In Duty", :class => 'btn bg-blue' %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<% end %>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$(document).ready(function () {
|
||||
$(document).ready(function () {
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
@@ -4,31 +4,34 @@
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<%= simple_form_for([:origami,@in_duty]) do |f| %>
|
||||
<%= f.error_notification %>
|
||||
<div class="card">
|
||||
<div class="body">
|
||||
<%= f.error_notification %>
|
||||
<div class="form-inputs">
|
||||
<label>Dining Name:</label>
|
||||
<%= @table.name %>
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
<div class="form-inputs">
|
||||
<label>Dining Name:</label>
|
||||
<%= @table.name %>
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
<label>Commissioner Name:</label>
|
||||
<%= f.collection_select :commissioner_ids, Commissioner.all, :id, :name, {prompt: 'Select Commissioner'}, {class: 'form-control'} %><br/><br/>
|
||||
<label>In time</label>
|
||||
<%= f.text_field :in_time, :value=>DateTime.now.strftime("%Y-%m-%d / %I:%M %p"),:class=>"form-control datepicker"%><br/>
|
||||
<label>Out time</label>
|
||||
<%= f.text_field :out_time, :value=>DateTime.now.strftime("%Y-%m-%d / %I:%M %p"),:class=>"form-control datepicker"%>
|
||||
</div><br>
|
||||
<div class="form-actions">
|
||||
<div class='row'>
|
||||
<div class="col-md-2">
|
||||
<%= link_to 'Back', origami_index_in_duty_path(@table.id), class: 'btn bg-default' %>
|
||||
</div>
|
||||
<div class="col-md-10">
|
||||
<button type="button" class="btn bg-blue btn-block" id='in_duty'>Create In Duty</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<label>Commissioner Name:</label>
|
||||
<%= f.collection_select :commissioner_ids, Commissioner.all, :id, :name, {prompt: 'Select Commissioner'}, {class: 'form-control'} %><br/><br/>
|
||||
<label>In time</label>
|
||||
<%= f.text_field :in_time, :value=>DateTime.now.strftime("%Y-%m-%d / %I:%M %p"),:class=>"form-control datepicker"%><br/>
|
||||
<label>Out time</label>
|
||||
<%= f.text_field :out_time, :value=>DateTime.now.strftime("%Y-%m-%d / %I:%M %p"),:class=>"form-control datepicker"%>
|
||||
</div><br>
|
||||
<div class="form-actions">
|
||||
<div class='row'>
|
||||
<div class="col-md-2">
|
||||
<%= link_to 'Back', origami_index_in_duty_path(@table.id), class: 'btn bg-default' %>
|
||||
</div>
|
||||
<div class="col-md-10">
|
||||
<button type="button" class="btn bg-blue btn-block" id='in_duty'>Create In Duty</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user