reservation data
This commit is contained in:
@@ -404,7 +404,9 @@ $(document).on('turbolinks:load', function() {
|
|||||||
success: function(result){
|
success: function(result){
|
||||||
// For Server Print - from jade
|
// For Server Print - from jade
|
||||||
if ($("#server_mode").val() == "cloud") {
|
if ($("#server_mode").val() == "cloud") {
|
||||||
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
if(typeof code2lab != 'undefined'){
|
||||||
|
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
location.reload();
|
location.reload();
|
||||||
|
|
||||||
@@ -428,7 +430,9 @@ $(document).on('turbolinks:load', function() {
|
|||||||
success: function(result){
|
success: function(result){
|
||||||
// For Server Print - from jade
|
// For Server Print - from jade
|
||||||
if ($("#server_mode").val() == "cloud") {
|
if ($("#server_mode").val() == "cloud") {
|
||||||
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
if(typeof code2lab != 'undefined'){
|
||||||
|
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
location.reload();
|
location.reload();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -111,6 +111,26 @@ $(document).ready(function() {
|
|||||||
railBorderRadius: '0',
|
railBorderRadius: '0',
|
||||||
touchScrollStep : 50
|
touchScrollStep : 50
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#process-reservation-slimscroll').slimScroll({
|
||||||
|
height: height-$('#process-reservation-slimscroll').attr('data-height'),
|
||||||
|
size: '5px',
|
||||||
|
color: 'rgba(0,0,0,0.5)',
|
||||||
|
alwaysVisible: false,
|
||||||
|
borderRadius: '0',
|
||||||
|
railBorderRadius: '0',
|
||||||
|
touchScrollStep : 50
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#reservation-info-slimscroll').slimScroll({
|
||||||
|
height: height-$('#reservation-info-slimscroll').attr('data-height'),
|
||||||
|
size: '5px',
|
||||||
|
color: 'rgba(0,0,0,0.5)',
|
||||||
|
alwaysVisible: false,
|
||||||
|
borderRadius: '0',
|
||||||
|
railBorderRadius: '0',
|
||||||
|
touchScrollStep : 50
|
||||||
|
});
|
||||||
// $('.delete').click(function(){
|
// $('.delete').click(function(){
|
||||||
// var method = $(this).attr('data-method');
|
// var method = $(this).attr('data-method');
|
||||||
// var url = $(this).attr('data-ref');
|
// var url = $(this).attr('data-ref');
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
//= require custom.js
|
//= require custom.js
|
||||||
|
|
||||||
$(function(){
|
$(function(){
|
||||||
|
$(".room_type").hide();
|
||||||
/*new customer UI func:*/
|
/*new customer UI func:*/
|
||||||
//Initialize tooltips
|
//Initialize tooltips
|
||||||
$('.nav-tabs > li a[title]').tooltip();
|
$('.nav-tabs > li a[title]').tooltip();
|
||||||
@@ -21,6 +22,7 @@ $(function(){
|
|||||||
nextTab($active);
|
nextTab($active);
|
||||||
$('.wizard .nav-tabs li.active .connecting-line').css({"border-bottom-left-radius": 0, "border-top-left-radius": 0});
|
$('.wizard .nav-tabs li.active .connecting-line').css({"border-bottom-left-radius": 0, "border-top-left-radius": 0});
|
||||||
});
|
});
|
||||||
|
|
||||||
$(".prev-step").click(function (e) {
|
$(".prev-step").click(function (e) {
|
||||||
|
|
||||||
var $active = $('.wizard .nav-tabs li a.active');
|
var $active = $('.wizard .nav-tabs li a.active');
|
||||||
@@ -28,6 +30,28 @@ $(function(){
|
|||||||
|
|
||||||
});
|
});
|
||||||
/*new customer UI func:*/
|
/*new customer UI func:*/
|
||||||
|
|
||||||
|
$(".reservation_type").on("click", function(){
|
||||||
|
if($(this).val() == "Dine-in"){
|
||||||
|
$(".dining_type").show();
|
||||||
|
$(".room_type").hide();
|
||||||
|
}else{
|
||||||
|
$(".dining_type").hide();
|
||||||
|
$(".room_type").show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$(".number_limit").on("click", function(){
|
||||||
|
if(parseInt($(this).val()) <= 0){
|
||||||
|
if($(this).attr("data-type") == "room"){
|
||||||
|
$("#room_count").val(1);
|
||||||
|
}else if($(this).attr("data-type") == "adult"){
|
||||||
|
$("#adult_count").val(1);
|
||||||
|
}else{
|
||||||
|
$("#child_count").val(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
/*customer UI tab btn*/
|
/*customer UI tab btn*/
|
||||||
|
|||||||
@@ -76,7 +76,6 @@ class Origami::CustomersController < BaseOrigamiController
|
|||||||
filter = params[:filter]
|
filter = params[:filter]
|
||||||
|
|
||||||
if filter.nil?
|
if filter.nil?
|
||||||
puts params[:page]
|
|
||||||
@crm_customers = Customer.order("customer_id") #.page(params[:page])
|
@crm_customers = Customer.order("customer_id") #.page(params[:page])
|
||||||
#@products = Product.order("name").page(params[:page]).per(5)
|
#@products = Product.order("name").page(params[:page]).per(5)
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -1,6 +1,45 @@
|
|||||||
class Origami::ReservationController < BaseOrigamiController
|
class Origami::ReservationController < BaseOrigamiController
|
||||||
|
|
||||||
def index
|
def index
|
||||||
|
@reservations = Reservation.all
|
||||||
|
end
|
||||||
|
|
||||||
|
def show
|
||||||
|
end
|
||||||
|
|
||||||
|
def new
|
||||||
|
end
|
||||||
|
|
||||||
|
def edit
|
||||||
|
end
|
||||||
|
|
||||||
|
def create
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def update
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
# DELETE /crm/customers/1
|
||||||
|
# DELETE /crm/customers/1.json
|
||||||
|
def destroy
|
||||||
|
@reservation.destroy
|
||||||
|
respond_to do |format|
|
||||||
|
format.html { redirect_to origami_reservation_url, notice: 'Reservation was successfully destroyed.' }
|
||||||
|
format.json { head :no_content }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
# Use callbacks to share common setup or constraints between actions.
|
||||||
|
def set_origami_reservation
|
||||||
|
@reservation = Reservation.find(params[:reservation_id])
|
||||||
|
end
|
||||||
|
|
||||||
|
# Never trust parameters from the scary internet, only allow the white list through.
|
||||||
|
def customer_params
|
||||||
|
|
||||||
|
params.require(:reservation).permit(:reservation_id)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
15
app/models/reservation.rb
Normal file
15
app/models/reservation.rb
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
class Reservation < ApplicationRecord
|
||||||
|
self.primary_key = "reservation_id"
|
||||||
|
|
||||||
|
#primary key - need to be unique generated for multiple shops
|
||||||
|
before_create :generate_custom_id
|
||||||
|
|
||||||
|
has_many :reservation_items
|
||||||
|
|
||||||
|
scope :active, -> { where("created_at BETWEEN '#{DateTime.now.utc.beginning_of_day}' AND '#{DateTime.now.utc.end_of_day}'") }
|
||||||
|
|
||||||
|
private
|
||||||
|
def generate_custom_id
|
||||||
|
self.order_reservation_id = SeedGenerator.generate_id(self.class.name, "RS")
|
||||||
|
end
|
||||||
|
end
|
||||||
13
app/models/reservation_item.rb
Normal file
13
app/models/reservation_item.rb
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
class ReservationItem < ApplicationRecord
|
||||||
|
self.primary_key = "reservation_items_id"
|
||||||
|
|
||||||
|
#primary key - need to be unique
|
||||||
|
before_create :generate_custom_id
|
||||||
|
|
||||||
|
belongs_to :reservation, autosave: true
|
||||||
|
|
||||||
|
private
|
||||||
|
def generate_custom_id
|
||||||
|
self.reservation_items_id = SeedGenerator.generate_id(self.class.name, "RSI")
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -958,7 +958,9 @@
|
|||||||
|
|
||||||
// For Server Print - from jade
|
// For Server Print - from jade
|
||||||
if ($("#server_mode").val() == "cloud") {
|
if ($("#server_mode").val() == "cloud") {
|
||||||
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
if(typeof code2lab != 'undefined'){
|
||||||
|
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
location.reload();
|
location.reload();
|
||||||
}
|
}
|
||||||
@@ -1011,9 +1013,11 @@
|
|||||||
if((receipt_no!=undefined) && (receipt_no!=""))
|
if((receipt_no!=undefined) && (receipt_no!=""))
|
||||||
createReceiptNoInFirstBillData(receipt_no,type);
|
createReceiptNoInFirstBillData(receipt_no,type);
|
||||||
// For Server Print - from jade
|
// For Server Print - from jade
|
||||||
if ($("#server_mode").val() == "cloud") {
|
if ($("#server_mode").val() == "cloud") {
|
||||||
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
if(typeof code2lab != 'undefined'){
|
||||||
}
|
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
||||||
|
}
|
||||||
|
}
|
||||||
location.reload();
|
location.reload();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -1214,7 +1218,9 @@
|
|||||||
success: function (result) {
|
success: function (result) {
|
||||||
// For Server Print - from jade
|
// For Server Print - from jade
|
||||||
if ($("#server_mode").val() == "cloud") {
|
if ($("#server_mode").val() == "cloud") {
|
||||||
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
if(typeof code2lab != 'undefined'){
|
||||||
|
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
window.location.href = '/origami/';
|
window.location.href = '/origami/';
|
||||||
}
|
}
|
||||||
@@ -1321,7 +1327,9 @@
|
|||||||
console.log(result)
|
console.log(result)
|
||||||
// For Server Print - from jade
|
// For Server Print - from jade
|
||||||
if ($("#server_mode").val() == "cloud") {
|
if ($("#server_mode").val() == "cloud") {
|
||||||
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
if(typeof code2lab != 'undefined'){
|
||||||
|
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
window.location.href = '/origami/';
|
window.location.href = '/origami/';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1146,7 +1146,9 @@ var trans_flag = <%= @trans_flag %>;
|
|||||||
success:function(result){
|
success:function(result){
|
||||||
// For Server Print - from jade
|
// For Server Print - from jade
|
||||||
if ($("#server_mode").val() == "cloud") {
|
if ($("#server_mode").val() == "cloud") {
|
||||||
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
if(typeof code2lab != 'undefined'){
|
||||||
|
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pdf_view ==1) {
|
if (pdf_view ==1) {
|
||||||
@@ -1439,7 +1441,9 @@ var trans_flag = <%= @trans_flag %>;
|
|||||||
}, function () {
|
}, function () {
|
||||||
// For Server Print - from jade
|
// For Server Print - from jade
|
||||||
if ($("#server_mode").val() == "cloud") {
|
if ($("#server_mode").val() == "cloud") {
|
||||||
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
if(typeof code2lab != 'undefined'){
|
||||||
|
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
var flag = localStorage.getItem("trans_flag");
|
var flag = localStorage.getItem("trans_flag");
|
||||||
if((flag!=null) && (flag != "true")){
|
if((flag!=null) && (flag != "true")){
|
||||||
@@ -1482,7 +1486,9 @@ var trans_flag = <%= @trans_flag %>;
|
|||||||
customer_display_view(null,"reload");
|
customer_display_view(null,"reload");
|
||||||
// For Server Print - from jade
|
// For Server Print - from jade
|
||||||
if ($("#server_mode").val() == "cloud") {
|
if ($("#server_mode").val() == "cloud") {
|
||||||
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
if(typeof code2lab != 'undefined'){
|
||||||
|
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
var flag = localStorage.getItem("trans_flag");
|
var flag = localStorage.getItem("trans_flag");
|
||||||
if((flag!=null) && (flag != "true")){
|
if((flag!=null) && (flag != "true")){
|
||||||
@@ -1522,7 +1528,9 @@ var trans_flag = <%= @trans_flag %>;
|
|||||||
// console.log(result)
|
// console.log(result)
|
||||||
// For Server Print - from jade
|
// For Server Print - from jade
|
||||||
if ($("#server_mode").val() == "cloud") {
|
if ($("#server_mode").val() == "cloud") {
|
||||||
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
if(typeof code2lab != 'undefined'){
|
||||||
|
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
var flag = localStorage.getItem("trans_flag");
|
var flag = localStorage.getItem("trans_flag");
|
||||||
if((flag!=null) && (flag != "true")){
|
if((flag!=null) && (flag != "true")){
|
||||||
|
|||||||
@@ -324,7 +324,9 @@ $(document).ready(function(){
|
|||||||
url: ajax_url,
|
url: ajax_url,
|
||||||
success: function (result) {
|
success: function (result) {
|
||||||
if ($("#server_mode").val() == "cloud") {
|
if ($("#server_mode").val() == "cloud") {
|
||||||
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
if(typeof code2lab != 'undefined'){
|
||||||
|
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
location.reload();
|
location.reload();
|
||||||
}
|
}
|
||||||
@@ -433,7 +435,9 @@ function check_emp_access_code(access_code,type) {
|
|||||||
url: ajax_url,
|
url: ajax_url,
|
||||||
success: function (result) {
|
success: function (result) {
|
||||||
if ($("#server_mode").val() == "cloud") {
|
if ($("#server_mode").val() == "cloud") {
|
||||||
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
if(typeof code2lab != 'undefined'){
|
||||||
|
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
location.reload();
|
location.reload();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<div class="col-xs-3 col-sm-3 col-md-3 col-lg-3">
|
<div class="col-xs-3 col-sm-3 col-md-3 col-lg-3">
|
||||||
<div class="card" id="make-reservation-slimscroll" data-height="-50">
|
<div class="card" id="make-reservation-slimscroll" data-height="-50">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<h5 class="card-title text-center"><%= t :make_reservation %></h5>
|
<h5 class="card-title text-center bg-faded"><%= t :make_reservation %></h5>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="wizard">
|
<div class="wizard">
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
<ul class="nav nav-tabs" role="tablist">
|
<ul class="nav nav-tabs" role="tablist">
|
||||||
<li role="presentation" class="nav-item">
|
<li role="presentation" class="nav-item">
|
||||||
<div class="connecting-line border-right"></div>
|
<div class="connecting-line border-right"></div>
|
||||||
<a href="#step1" class="nav-link active" data-toggle="tab" aria-controls="reservation" role="tab" title="Reservation">
|
<a href="#reservation" class="nav-link active" data-toggle="tab" aria-controls="reservation" role="tab" title="Reservation">
|
||||||
<span class="round-tab">
|
<span class="round-tab">
|
||||||
1
|
1
|
||||||
</span>
|
</span>
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
</li>
|
</li>
|
||||||
<li role="presentation" class="nav-item disabled">
|
<li role="presentation" class="nav-item disabled">
|
||||||
<div class="connecting-line"></div>
|
<div class="connecting-line"></div>
|
||||||
<a href="#complete" class="nav-link disable" data-toggle="tab" aria-controls="personal_detail" role="tab" title="Personal Detail">
|
<a href="#personal_detail" class="nav-link disable" data-toggle="tab" aria-controls="personal_detail" role="tab" title="Personal Detail">
|
||||||
<span class="round-tab">
|
<span class="round-tab">
|
||||||
2
|
2
|
||||||
</span>
|
</span>
|
||||||
@@ -35,71 +35,115 @@
|
|||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="col-sm-12 col-md-12 col-lg-12">
|
<div class="col-sm-12 col-md-12 col-lg-12">
|
||||||
<label class="font-12 radio-inline">
|
<label class="font-12 radio-inline">
|
||||||
<input type="radio" name="type" checked class="radio-col-indigo" value="0"><%= t("views.right_panel.detail.dine_in") %>
|
<input type="radio" name="reservation_type" checked class="radio-col-indigo reservation_type" value="0"><%= t("views.right_panel.detail.dine_in") %>
|
||||||
</label>
|
</label>
|
||||||
<label class="font-12 radio-inline">
|
<label class="font-12 radio-inline">
|
||||||
<input type="radio" name="type" class="radio-col-indigo" value="1"><%= t :room %>
|
<input type="radio" name="reservation_type" class="radio-col-indigo reservation_type" value="1"><%= t :room %>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-row clearfix">
|
|
||||||
<div class="form-group col-sm-6 col-md-6 col-lg-6">
|
<div class="dining_type">
|
||||||
<input class="form-control check_in_date" name="from" id="from" type="text" placeholder="Check In Date">
|
<div class="form-row clearfix">
|
||||||
|
<div class="form-group col-sm-6 col-md-6 col-lg-6">
|
||||||
|
<input class="form-control check_in_date datepicker" name="check_in_date" id="check_in_date" type="text" placeholder="Check-in Date">
|
||||||
|
</div>
|
||||||
|
<div class="form-group col-sm-6 col-md-6 col-lg-6">
|
||||||
|
<input class="form-control check_out_date datepicker" name="check_out_date" id="check_out_date" type="text" placeholder="Check Out Date">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-sm-6 col-md-6 col-lg-6">
|
<div class="form-row clearfix">
|
||||||
<input class="form-control check_out_date" name="from" id="from" type="text" placeholder="Check Out Date">
|
<div class="form-group col-sm-6 col-md-6 col-lg-6">
|
||||||
|
<input class="form-control check_in_time timepicker" name="check_in_time" id="check_in_time" type="text" placeholder="Check-in Time">
|
||||||
|
</div>
|
||||||
|
<div class="form-group col-sm-6 col-md-6 col-lg-6">
|
||||||
|
<input class="form-control check_out_time timepicker" name="check_out_time" id="check_out_time" type="text" placeholder="Check Out Time">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-row clearfix">
|
|
||||||
<div class="form-group col-sm-6 col-md-6 col-lg-6">
|
<div class="room_type">
|
||||||
<input class="form-control check_in_time" name="from" id="from" type="text" placeholder="Check In Time">
|
<div class="form-row clearfix">
|
||||||
|
<div class="form-group col-sm-6 col-md-6 col-lg-6">
|
||||||
|
<input class="form-control check_in_date datepicker" name="check_in_date" id="check_in_date" type="text" placeholder="Check-in Date">
|
||||||
|
</div>
|
||||||
|
<div class="form-group col-sm-6 col-md-6 col-lg-6">
|
||||||
|
<input class="form-control check_out_date datepicker" name="check_out_date" id="check_out_date" type="text" placeholder="Check Out Date">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-sm-6 col-md-6 col-lg-6">
|
<div class="form-row clearfix">
|
||||||
<input class="form-control check_out_time" name="from" id="from" type="text" placeholder="Check Out Time">
|
<div class="form-group col-sm-12 col-md-12 col-lg-12">
|
||||||
</div>
|
<label for="room_count" class="control-label">ROOMS</label>
|
||||||
</div>
|
<input type="number" class="form-control number_limit" name="room_count" id="room_count" data-type="room" value="1">
|
||||||
<div class="form-row clearfix">
|
</div>
|
||||||
<div class="form-group col-sm-12 col-md-12 col-lg-12">
|
|
||||||
<label for="room_count" class="control-label">ROOMS</label>
|
|
||||||
<input type="number" class="form-control" name="room_count">
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-row clearfix">
|
<div class="form-row clearfix">
|
||||||
<div class="form-group col-sm-6 col-md-6 col-lg-6">
|
<div class="form-group col-sm-6 col-md-6 col-lg-6">
|
||||||
<label for="adult_count" class="control-label">ADULT</label>
|
<label for="adult_count" class="control-label">ADULT</label>
|
||||||
<input type="number" class="form-control" name="adult_count">
|
<input type="number" class="form-control number_limit" name="adult_count" id="adult_count" data-type="adult" value="1">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-sm-6 col-md-6 col-lg-6">
|
<div class="form-group col-sm-6 col-md-6 col-lg-6">
|
||||||
<label for="child_count" class="control-label">CHILD</label>
|
<label for="child_count" class="control-label">CHILD</label>
|
||||||
<input type="number" class="form-control" name="child_count">
|
<input type="number" class="form-control number_limit" name="child_count" id="child_count" data-type="child">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row text-center">
|
<div class="row text-center">
|
||||||
<div class="form-group col-sm-12 col-md-12 col-lg-12">
|
<div class="form-group col-sm-12 col-md-12 col-lg-12">
|
||||||
<button class="btn bg-blue btn-lg waves-effect next-step">CHECK AVAILABLE</button>
|
<button class="btn bg-blue btn-lg waves-effect">CHECK AVAILABLE</button>
|
||||||
|
<button class="btn bg-blue btn-lg waves-effect next-step">NEXT</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div><!-- .end.tab-content .reservation -->
|
</div><!-- .end.tab-panel .reservation -->
|
||||||
|
|
||||||
<div class="tab-pane" role="tabpanel" id="personal_detail">
|
<div class="tab-pane" role="tabpanel" id="personal_detail">
|
||||||
|
<div class="form-row">
|
||||||
|
<div class="form-group col-sm-12 col-md-12 col-lg-12">
|
||||||
|
<input class="form-control" name="name" id="name" type="text" placeholder="NAME">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-row">
|
||||||
|
<div class="form-group col-sm-12 col-md-12 col-lg-12">
|
||||||
|
<input class="form-control" name="contact_no" id="contact_no" type="number" placeholder="PHONE NUMBER">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-row">
|
||||||
|
<div class="form-group col-sm-12 col-md-12 col-lg-12">
|
||||||
|
<input class="form-control" name="address" id="address" type="text" placeholder="ADDRESS">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-row">
|
||||||
|
<div class="form-group col-sm-12 col-md-12 col-lg-12">
|
||||||
|
<label for="reservation_note" class="control-label">RESERVATION NOTE</label>
|
||||||
|
<textarea rows="3" id="reservation_note" name="reservation_note" class="form-control"></textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row text-center">
|
||||||
|
<div class="form-group col-sm-12 col-md-12 col-lg-12">
|
||||||
|
<button class="btn bg-blue btn-lg prev-step">PREV</button>
|
||||||
|
<button class="btn bg-blue btn-lg">SUBMIT</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div><!-- .end.tab-content .personal_detail -->
|
</div><!-- .end.tab-content .personal_detail -->
|
||||||
</div> <!-- .end.wizard -->
|
</div> <!-- .end.wizard -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-5 col-sm-5 col-md-5 col-lg-5">
|
|
||||||
<div class="card font-13">
|
|
||||||
<div class="row">
|
|
||||||
|
|
||||||
|
<div class="col-xs-9 col-sm-9 col-md-9 col-lg-9">
|
||||||
|
<div class="card font-13">
|
||||||
|
<div class="row clearfix">
|
||||||
|
<div class="col-xs-5 col-sm-5 col-md-5 col-lg-5" id="process-reservation-slimscroll" data-height="-80">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4" id="reservation-info-slimscroll" data-height="-80">
|
||||||
|
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
|
|
||||||
<div class="card font-13">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1052,7 +1052,9 @@ $("#first_bill").on('click', function(){
|
|||||||
createReceiptNoInFirstBillData(receipt_no,"");
|
createReceiptNoInFirstBillData(receipt_no,"");
|
||||||
// For Server Print - from jade
|
// For Server Print - from jade
|
||||||
if ($("#server_mode").val() == "cloud") {
|
if ($("#server_mode").val() == "cloud") {
|
||||||
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
if(typeof code2lab != 'undefined'){
|
||||||
|
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
location.reload();
|
location.reload();
|
||||||
}
|
}
|
||||||
@@ -1090,7 +1092,9 @@ $(".choose_payment").on('click', function () {
|
|||||||
|
|
||||||
// For Server Print - from jade
|
// For Server Print - from jade
|
||||||
if ($("#server_mode").val() == "cloud") {
|
if ($("#server_mode").val() == "cloud") {
|
||||||
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
if(typeof code2lab != 'undefined'){
|
||||||
|
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
location.reload();
|
location.reload();
|
||||||
@@ -1317,7 +1321,9 @@ $('#add_invoice').on('click',function(){
|
|||||||
success: function (result) {
|
success: function (result) {
|
||||||
// For Server Print - from jade
|
// For Server Print - from jade
|
||||||
if ($("#server_mode").val() == "cloud") {
|
if ($("#server_mode").val() == "cloud") {
|
||||||
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
if(typeof code2lab != 'undefined'){
|
||||||
|
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
window.location.href = '/origami/';
|
window.location.href = '/origami/';
|
||||||
}
|
}
|
||||||
@@ -1406,7 +1412,9 @@ $('#add_invoice').on('click',function(){
|
|||||||
console.log(result)
|
console.log(result)
|
||||||
// For Server Print - from jade
|
// For Server Print - from jade
|
||||||
if ($("#server_mode").val() == "cloud") {
|
if ($("#server_mode").val() == "cloud") {
|
||||||
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
if(typeof code2lab != 'undefined'){
|
||||||
|
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
window.location.href = '/origami/';
|
window.location.href = '/origami/';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -435,7 +435,9 @@ $('#reprint').on('click', function () {
|
|||||||
url: ajax_url,
|
url: ajax_url,
|
||||||
success: function (result) {
|
success: function (result) {
|
||||||
if ($("#server_mode").val() == "cloud") {
|
if ($("#server_mode").val() == "cloud") {
|
||||||
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
if(typeof code2lab != 'undefined'){
|
||||||
|
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
location.reload();
|
location.reload();
|
||||||
}
|
}
|
||||||
@@ -536,7 +538,9 @@ $(document).on('click', '.access_modal', function(event){
|
|||||||
success: function (result) {
|
success: function (result) {
|
||||||
// For Server Print - from jade
|
// For Server Print - from jade
|
||||||
if ($("#server_mode").val() == "cloud") {
|
if ($("#server_mode").val() == "cloud") {
|
||||||
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
if(typeof code2lab != 'undefined'){
|
||||||
|
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
location.reload();
|
location.reload();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -370,7 +370,9 @@ $(document).ready(function(){
|
|||||||
|
|
||||||
// For Server Print - from jade
|
// For Server Print - from jade
|
||||||
if ($("#server_mode").val() == "cloud") {
|
if ($("#server_mode").val() == "cloud") {
|
||||||
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
if(typeof code2lab != 'undefined'){
|
||||||
|
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
location.reload();
|
location.reload();
|
||||||
}
|
}
|
||||||
@@ -403,7 +405,9 @@ $(document).ready(function(){
|
|||||||
createReceiptNoInFirstBillData(receipt_no,type);
|
createReceiptNoInFirstBillData(receipt_no,type);
|
||||||
// For Server Print - from jade
|
// For Server Print - from jade
|
||||||
if ($("#server_mode").val() == "cloud") {
|
if ($("#server_mode").val() == "cloud") {
|
||||||
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
if(typeof code2lab != 'undefined'){
|
||||||
|
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
location.reload();
|
location.reload();
|
||||||
}
|
}
|
||||||
@@ -475,7 +479,9 @@ $('#void').on('click',function () {
|
|||||||
success: function (result) {
|
success: function (result) {
|
||||||
// For Server Print - from jade
|
// For Server Print - from jade
|
||||||
if ($("#server_mode").val() == "cloud") {
|
if ($("#server_mode").val() == "cloud") {
|
||||||
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
if(typeof code2lab != 'undefined'){
|
||||||
|
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
window.location.href = '/origami';
|
window.location.href = '/origami';
|
||||||
}
|
}
|
||||||
@@ -512,7 +518,9 @@ $('#foc').click(function() {
|
|||||||
}, function () {
|
}, function () {
|
||||||
// For Server Print - from jade
|
// For Server Print - from jade
|
||||||
if ($("#server_mode").val() == "cloud") {
|
if ($("#server_mode").val() == "cloud") {
|
||||||
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
if(typeof code2lab != 'undefined'){
|
||||||
|
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
window.location.href = '/origami';
|
window.location.href = '/origami';
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -406,7 +406,9 @@
|
|||||||
success: function (result) {
|
success: function (result) {
|
||||||
// For Server Print - from jade
|
// For Server Print - from jade
|
||||||
if ($("#server_mode").val() == "cloud") {
|
if ($("#server_mode").val() == "cloud") {
|
||||||
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
if(typeof code2lab != 'undefined'){
|
||||||
|
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
window.location.href = '/transactions/sales/';
|
window.location.href = '/transactions/sales/';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -326,7 +326,7 @@ scope "(:locale)", locale: /en|mm/ do
|
|||||||
# get 'sale/:sale_id/:type/credit_payment/others_payment/GiftVoucher' => "gift_voucher#index"
|
# get 'sale/:sale_id/:type/credit_payment/others_payment/GiftVoucher' => "gift_voucher#index"
|
||||||
|
|
||||||
#------------- Start Reservation -------------------#
|
#------------- Start Reservation -------------------#
|
||||||
get '/reservation' => "reservation#index"
|
resources :reservation
|
||||||
#------------- End Reservation -------------------#
|
#------------- End Reservation -------------------#
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
24
db/migrate/20180928052742_create_reservations.rb
Normal file
24
db/migrate/20180928052742_create_reservations.rb
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
class CreateReservations < ActiveRecord::Migration[5.1]
|
||||||
|
def change
|
||||||
|
create_table :reservations, :id => false do |t|
|
||||||
|
t.string :reservation_id, :limit => 16, :primary_key => true
|
||||||
|
t.string :source, :null => false, :default => "Cashier"
|
||||||
|
t.string :reservation_type, :null => false
|
||||||
|
t.string :customer_id, :null => false
|
||||||
|
t.datetime :checkin_datetime, :null => false
|
||||||
|
t.datetime :checkout_datetime
|
||||||
|
t.json :reservation_info
|
||||||
|
t.string :remark
|
||||||
|
t.string :status, :null => false, :default => "new"
|
||||||
|
t.datetime :action_at, :null => false
|
||||||
|
t.string :action_by, :null => false
|
||||||
|
t.datetime :modify_at
|
||||||
|
t.string :modify_by
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
drop_table :reservations
|
||||||
|
end
|
||||||
|
end
|
||||||
26
db/migrate/20180928074338_create_reservation_items.rb
Normal file
26
db/migrate/20180928074338_create_reservation_items.rb
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
class CreateReservationItems < ActiveRecord::Migration[5.1]
|
||||||
|
def change
|
||||||
|
create_table :reservation_items, :id => false do |t|
|
||||||
|
t.string :reservation_items_id, :limit => 16, :primary_key => true
|
||||||
|
t.string :reservation_id, foreign_key: true, :null => false, :limit => 16
|
||||||
|
t.string :item_status, :null => false, :default => "new"
|
||||||
|
t.string :item_code, :null => false
|
||||||
|
t.string :item_instance_code
|
||||||
|
t.string :item_name, :null => false
|
||||||
|
t.string :alt_name, :null => false
|
||||||
|
t.json :set_menu_items
|
||||||
|
t.integer :account_id, :limit => 8, :null => false, :default => 1
|
||||||
|
t.decimal :qty, :precision => 10, :scale => 2, :null => false, :default => 0.00
|
||||||
|
t.decimal :unit_price, :precision => 10, :scale => 2, :null => false, :default => 0.00
|
||||||
|
t.decimal :price, :precision => 10, :scale => 2, :null => false, :default => 0.00
|
||||||
|
t.string :remark
|
||||||
|
t.string :options
|
||||||
|
t.boolean :taxable, :null => false, :default => true
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
drop_table :reservation_items
|
||||||
|
end
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user