Merge branch 'adminbsb_ui_changes' of bitbucket.org:code2lab/sxrestaurant
This commit is contained in:
@@ -67,7 +67,11 @@ class Settings::MenuItemInstancesController < ApplicationController
|
||||
|
||||
respond_to do |format|
|
||||
if @settings_menu_item_instances.save
|
||||
<<<<<<< HEAD
|
||||
@settings_menu_item_instances.item_attributes = params[:menu_item_instance][:item_attributes].split("")
|
||||
=======
|
||||
@settings_menu_item_instances.item_attributes = params[:menu_item_instance][:item_attributes].split(" ")
|
||||
>>>>>>> 7a28dc1ddc100e61789fae7f1f3503e2f703711e
|
||||
@settings_menu_item_instances.save
|
||||
format.html { redirect_to settings_menu_category_simple_menu_item_path(category,catID), notice: 'Menu item instance was successfully created.' }
|
||||
format.json { render :show, status: :created, location: @settings_menu_item_instances }
|
||||
|
||||
@@ -4,7 +4,7 @@ class Transactions::BookingsController < ApplicationController
|
||||
|
||||
def index
|
||||
|
||||
filter = params[:filter]
|
||||
filter = params[:receipt_no]
|
||||
from = params[:from]
|
||||
to = params[:to]
|
||||
|
||||
|
||||
@@ -14,7 +14,8 @@ class Transactions::CreditNotesController < ApplicationController
|
||||
to = params[:to]
|
||||
|
||||
if filter.nil? && from.nil? && to.nil? && customer.nil?
|
||||
@credit_notes = Sale.where('payment_status = ?', Sale::SALE_STATUS_OUTSTANDING)
|
||||
@credit_notes = Sale.where('payment_status = ?', Sale::SALE_STATUS_OUTSTANDING)
|
||||
@credit_notes = Kaminari.paginate_array(@credit_notes).page(params[:page]).per(20)
|
||||
else
|
||||
sale = Sale.search_credit_sales(customer,filter,from,to)
|
||||
if sale.count > 0
|
||||
|
||||
@@ -3,16 +3,13 @@ class Transactions::OrdersController < ApplicationController
|
||||
def index
|
||||
|
||||
filter = params[:filter]
|
||||
count = params[:count]
|
||||
from = params[:from]
|
||||
to = params[:to]
|
||||
|
||||
if filter.nil? && from.nil? && to.nil? && count.nil?
|
||||
if filter.nil? && from.nil? && to.nil?
|
||||
orders = Order.order("order_id desc")
|
||||
|
||||
else
|
||||
orders = Order.search(filter,from,to,count)
|
||||
|
||||
orders = Order.search(filter,from,to)
|
||||
end
|
||||
|
||||
if !orders.nil?
|
||||
|
||||
@@ -363,18 +363,18 @@ class Order < ApplicationRecord
|
||||
|
||||
end
|
||||
|
||||
def self.search(filter,from,to,count)
|
||||
if count.to_i > 0
|
||||
item_count = "and item_count = '#{count}'"
|
||||
def self.search(filter,from,to)
|
||||
if filter.blank?
|
||||
keyword = ''
|
||||
else
|
||||
item_count = ''
|
||||
keyword = "order_id LIKE ? OR status LIKE ? OR order_type LIKE ? OR source='#{filter}'","%#{filter}%","%#{filter}%","%#{filter}%"
|
||||
end
|
||||
if from.present? && to.present?
|
||||
Order.where("DATE_FORMAT(date,'%d-%m-%Y') >= ?" + " AND DATE_FORMAT(date,'%d-%m-%Y') <= ? #{item_count}", from,to)
|
||||
elsif !from.present? && !to.present? && count.present?
|
||||
Order.where("item_count = '#{count}'")
|
||||
|
||||
if from.present? && to.present?
|
||||
order = Order.where("DATE_FORMAT(date,'%d-%m-%Y') >= ?" + " AND DATE_FORMAT(date,'%d-%m-%Y') <= ?", from,to)
|
||||
query = order.where(keyword)
|
||||
else
|
||||
Order.where("order_id LIKE ? OR status LIKE ? OR order_type LIKE ? OR source='#{filter}'","%#{filter}%","%#{filter}%","%#{filter}%",)
|
||||
where("order_id LIKE ? OR status LIKE ? OR order_type LIKE ? OR source='#{filter}'","%#{filter}%","%#{filter}%","%#{filter}%")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class PrintSetting < ApplicationRecord
|
||||
# validations
|
||||
validates_presence_of :name, :unique_code, :printer_name, :page_width, :page_height
|
||||
validates_presence_of :name, :unique_code, :printer_name, :page_width, :page_height, :print_copies
|
||||
end
|
||||
|
||||
@@ -449,7 +449,7 @@ class Sale < ApplicationRecord
|
||||
sale = Sale.where("DATE_FORMAT(receipt_date,'%d-%m-%Y') >= ?" + " AND DATE_FORMAT(receipt_date,'%d-%m-%Y') <= ? and NOT sale_status = 'void' ", from,to)
|
||||
query = sale.where(keyword)
|
||||
else
|
||||
where("receipt_no LIKE ? OR cashier_name LIKE ? OR sale_status ='#{filter}'","%#{filter}%","%#{filter}%",)
|
||||
where("receipt_no LIKE ? OR cashier_name LIKE ? OR sale_status ='#{filter}'","%#{filter}%","%#{filter}%")
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
</div>
|
||||
|
||||
<div class="row clearfix">
|
||||
<div class="col-lg-9 col-md-9 col-sm-9">
|
||||
<div class="col-lg-8 col-md-8 col-sm-8">
|
||||
<div class="card">
|
||||
<div class="body table-responsive">
|
||||
<table class="table table-hover table-striped">
|
||||
@@ -83,7 +83,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-3 col-sm-3">
|
||||
<div class="col-lg-4 col-md-4 col-sm-4">
|
||||
<div class="card">
|
||||
<div class="body" id="custom-slimscroll">
|
||||
<%= render 'new_form', crm_customer: @crm_customer, taxes: @taxes %>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<%= f.input :api_settings %>
|
||||
<%= f.input :page_width %>
|
||||
<%= f.input :page_height %>
|
||||
<%= f.input :print_copies %>
|
||||
<%= f.input :print_copies, input_html: { min: '1', step: '1', :onkeypress => "return isNumberKey(event);", :onkeyup => "greaterThanOne(this.value);" } %>
|
||||
<%= f.input :precision %>
|
||||
<%= f.input :delimiter %>
|
||||
<%= f.input :heading_space %>
|
||||
@@ -58,4 +58,19 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
function isNumberKey(evt) {
|
||||
var charCode = (evt.which) ? evt.which : event.keyCode;
|
||||
if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57)) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
function greaterThanOne(val){
|
||||
if(parseInt(val)==0) $("#print_setting_print_copies").val(1);
|
||||
}
|
||||
</script>
|
||||
@@ -19,7 +19,7 @@
|
||||
<div class="row clearfix">
|
||||
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4">
|
||||
<label><%= t("views.right_panel.detail.enter_keyboards") %></label>
|
||||
<input type="text" id="receipt_no" name="receipt_no" class="form-control" placeholder="" style="margin-right: 10px">
|
||||
<input type="text" id="receipt_no" name="receipt_no" class="form-control" placeholder="Booking/Sale ID" style="margin-right: 10px">
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
|
||||
<label class=""><%= t("views.right_panel.detail.from") %></label>
|
||||
|
||||
Reference in New Issue
Block a user