update back buttom in cashier default

This commit is contained in:
Aung Myo
2017-11-14 15:33:06 +06:30
parent 6f06e7a9d7
commit 937576856f
22 changed files with 154 additions and 101 deletions

View File

@@ -6,7 +6,9 @@ class Origami::DiscountsController < BaseOrigamiController
sale_id = params[:id]
if Sale.exists?(sale_id)
@sale_data = Sale.find(sale_id)
@table = DiningFacility.find(@sale_data.bookings[0].dining_facility_id)
end
@member_discount = MembershipSetting.find_by_discount(1)
@accounts = Account.all
end

View File

@@ -5,6 +5,7 @@ class Origami::OtherChargesController < BaseOrigamiController
sale_id = params[:sale_id]
if Sale.exists?(sale_id)
@sale_data = Sale.find(sale_id)
@table = DiningFacility.find(@sale_data.bookings[0].dining_facility_id)
end
end

View File

@@ -62,7 +62,7 @@
<td class="item-attr"><strong id="sub_total">0.00</strong></td>
</tr>
</table>
<button type="button" class="btn btn-success create" id="create_order" disabled="disabled">Create Order</button>
<button type="button" class="btn btn-success btn-block create" id="create_order" disabled="disabled">Create Order</button>
</div>
</div>
</div>

View File

@@ -112,7 +112,7 @@
</div>
<div class="col-lg-1 col-md-1 col-sm-1 m-t-10">
<button type="button" class="btn bg-default m- btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment';"> Back </button>
<button type="button" class="btn bg-default m- btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment';"> <i class="material-icons m-t--5">reply</i>Back </button>
</div>
</div>
</div>

View File

@@ -1,15 +1,14 @@
<div class="container-fluid">
<div class="page-header">
<!-- <div class="page-header">
<ul class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li>
<li class="breadcrumb-item active">CRM</li>
<!-- <li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li> -->
<li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li>
<span class="float-right">
<a href="#" id="back">Back</a>
<!-- <%= link_to 'Back', dashboard_path %> -->
</span>
</ul>
</div>
</div> -->
<div class="row">
@@ -101,7 +100,7 @@
</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-4 col-md-4 col-sm-4" >
<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| %>
@@ -113,14 +112,14 @@
<%= f.hidden_field :id, :class => "form-control col-md-6 " %>
<div class="form-group">
<label>Salutation :</label><br>
<label>Mr</label>
<%= f.radio_button :salutation,"Mr", :class => "salutation mr", :value=>"Mr", :style=>"width: 30px"%>
<label>Miss</label>
<%= f.radio_button :salutation,"Mrs", :class => "salutation mrs", :value=>"Mrs", :style=>"width: 30px"%>
<label>Mrs</label>
<%= f.radio_button :salutation,"Miss", :class => "salutation miss", :value=>"Miss", :style=>"width: 30px"%>
<label>Mdm</label>
<%= f.radio_button :salutation,"Mdm", :class => "salutation mdm", :value=>"Mdm", :style=>"width: 30px"%>
<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" : "" %>">
@@ -238,7 +237,10 @@
</div>
<%end%>
</div>
<!-- Column Three -->
<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 id="sxModal">

View File

@@ -13,6 +13,8 @@
<div class="card-block">
<div class="card-title row">
<div class="col-lg-6 col-md-6 col-sm-6">
<span class="hidden" id ="table_id" value="<%=@table.id%>"><%=@table.id%></span>
<span class="hidden" id="table_type" value="<%=@table.type%>"><%=@table.type%></span>
<p id="sale-id" class="hidden"><%=@sale_data.sale_id %></p>
<p class="m-l-10">Receipt No: <span id="receipt_no"><%=@sale_data.receipt_no rescue ' '%></span></p>
<!-- <p>Cashier: <span id="cashier"><%=@sale_data.cashier_name rescue ' '%></span></p> -->
@@ -209,7 +211,7 @@
<div class="col-lg-1 col-md-1 col-sm-1">
<!-- Action Panel -->
<div>
<button type="button" class="btn bg-default btn-block" onclick="window.location.href = '/origami';"><i class="material-icons">reply</i> Back </button>
<button type="button" class="btn bg-default btn-block" id="back" ><i class="material-icons">reply</i> Back </button>
<button id="remove-item-discount" class="btn btn-primary btn- action-btn">Remove Item Discount</button>
<button id="remove-all" class="btn bg-primary btn-block action-btn">Remove All</button>
<button id="pay-discount" class="btn bg-primary btn-block action-btn">Enter</button>
@@ -225,6 +227,19 @@
<script type="text/javascript">
$(document).ready(function(){
$('#back').on('click',function(){
var id = $("#table_id").text();
var type = $("#table_type").text();
console.log(id);
console.log(type);
if (type=="Table") {
window.location.href = '/origami/table/'+id
}else{
window.location.href = '/origami/room/'+id
}
})
$(".cashier_number").on('click', function(event){
if(event.handled !== true) {
var original_value=0;

View File

@@ -109,17 +109,16 @@
</div>
<div class="col-lg-2 col-md-2 col-sm-2">
<!-- <button id="refreshbutton" type="button" class="btn btn-block radius-btn"> Refresh off </button> -->
<%if current_login_employee.role == "administrator" || current_login_employee.role == "manager" %>
<button id="back" type="button" class="btn btn-block btn-lg bg-default"> <i class="material-icons">reply</i> <%= t("views.btn.back") %>
</button>
<%end%>
<button id="cash_in" type="button" class="btn btn-block btn-lg bg-blue waves-effect"> <%= t("views.btn.cash_in") %> </button>
<button id="cash_out" type="button" class="btn btn-block btn-lg bg-blue waves-effect"> <%= t("views.btn.cash_out") %> </button>
<!-- Temporary Disabled -->
<button id="close_cashier" type="button" class="btn btn-block btn-lg bg-blue waves-effect"> <%= t("views.btn.close_cashier") %></button>
<%if current_login_employee.role == "administrator" || current_login_employee.role == "manager" %>
<button id="back" type="button" class="btn btn-block btn-lg bg-default"><i class="fa fa-home fa-lg"></i> <%= t("views.btn.back") %>
</button>
<%end%>
</div>
</div>
</div>

View File

@@ -16,7 +16,7 @@
<%= 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'><i class="fa fa-arrow-left"></i> 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>
<% end %>

View File

@@ -49,14 +49,14 @@
<%= paginate @duties_in %>
</div>
</div>
<div class="col-md-3 partial">
<%= render 'form', in_duty: @in_duty, table: @table %>
</div>
<div class="col-md-1">
<br>
<button type="button" class="form-control btn btn-default btn-block" id='back'>Back</button>
<button type="button" class="btn bg-default btn-block" onclick="window.location.href = '/origami/<%=@table.type.downcase%>/<%=@table.id%>'"><i class="material-icons m-t--5">reply</i> Back </button>
<button class="form-control btn btn-info btn-block" id="reset">New</button>
</div>
</div>
@@ -103,9 +103,9 @@
});
});
$('#back').on('click', function () {
window.location.href = '/origami/table/' + "<%= @table.id %>";
});
// $('#back').on('click', function () {
// window.location.href = '/origami/table/' + "<%= @table.id %>";
// });
$('#reset').click(function () {
location.reload();
/*var url = "<%= origami_index_in_duty_path %>";

View File

@@ -99,7 +99,7 @@
</div>
<div class="col-lg-1 col-md-1 col-sm-1">
<button type="button" class="btn btn-default btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment/others_payment';"> Back </button>
<button type="button" class="btn btn-default btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment/others_payment';"> <i class="material-icons m-t--5">reply</i>Back </button>
</div>
</div>
</div>

View File

@@ -99,7 +99,7 @@
</div>
<div class="col-lg-1 col-md-1 col-sm-1">
<button type="button" class="btn btn-default m-t-10 btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment/others_payment';"> Back </button>
<button type="button" class="btn btn-default m-t-10 btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment/others_payment';"><i class="material-icons m-t--5">reply</i> Back </button>
</div>
</div>
</div>

View File

@@ -101,7 +101,7 @@
</div>
<div class="col-md-1 col-lg-1 col-sm-1">
<button type="button" class="btn bg-default btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment';"> Back </button>
<button type="button" class="btn bg-default btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment/others_payment';"><i class="material-icons m-t--5">reply</i> Back </button>
</div>
</div>

View File

@@ -193,7 +193,7 @@
<!-- Column Three -->
<div class="col-lg-1 col-md-1 col-sm-1">
<button type="button" class="btn bg-default btn-block" id='back'>Back</button>
<button type="button" class="btn bg-default btn-block " id='back'><i class="material-icons">reply</i>Back</button>
<% if @sale_status != 'completed' %>
<button type="button" class="btn bg-blue btn-block" id='move'>MOVE</button>
<% end %>

View File

@@ -192,7 +192,7 @@
<div class="col-lg-1 col-md-1 col-sm-1">
<!-- Action Panel -->
<div>
<button type="button" class="btn bg-default btn-block" onclick="window.location.href = '/origami';"><i class="material-icons">reply</i> Back </button>
<button type="button" class="btn bg-default btn-block" onclick="window.location.href = '/origami/<%=@table.type.downcase%>/<%=@table.id%>'"><i class="material-icons">reply</i> Back </button>
<button id="charge_other" class="btn bg-success btn-block action-btn">Enter</button>
</div>
</div>

View File

@@ -21,7 +21,7 @@
</div>
</div>
<div class="col-lg-1 col-md-1 col-sm-1 m-t-10">
<button type="button" class="btn bg-default m- btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment';"> Back </button>
<button type="button" class="btn bg-default m- btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment';"> <i class="material-icons m-t--5">reply</i>Back </button>
</div>
</div>
</div>

View File

@@ -102,7 +102,7 @@
</div>
<div class="col-lg-1 col-md-1 col-sm-1">
<button type="button" class="btn bg-default m-t-10 btn-lg btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment/others_payment';"> Back </button>
<button type="button" class="btn bg-default m-t-10 btn-lg btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment/others_payment';"> <i class="material-icons m-t--5">reply</i>Back </button>
</div>
</div>
</div>

View File

@@ -312,7 +312,7 @@
<!-- Column Three -->
<div class="col-lg-1 col-md-1 col-sm-1">
<!-- Waiter Buttons -->
<button type="button" class="btn btn-default btn-block" id='back'><i class="fa fa-arrow-left"></i> Back</button>
<button type="button" class="btn btn-default btn-block" id='back'><i class="material-icons">reply</i> Back</button>
<button type="button" id="add_order" class="btn btn-block btn- bg-blue waves-effect">Add Order</button>
<button type="button" id="survey" class="btn btn-block bg-blue waves-effect">Survey</button>
<% if @room.bookings.length >= 1 %>
@@ -420,19 +420,17 @@ $(document).ready(function(){
window.location.href = '/origami/order/' + order_id;
});
// bind survey to order or sale
$("#survey").on('click', function () {
var sale = $('#sale_id').val();
if (sale) {
var sale_id = sale
} else {
var sale_id = $('#save_order_id').attr('data-order');
}
var table_id = $('.tables').attr("data-id");
window.location.href = '/origami/' + sale_id + "/survey"
});
// bind survey to order or sale
$("#survey").on('click', function () {
var sale = $('#sale_id').val();
if (sale) {
var sale_id = sale
} else {
var sale_id = "<%= @room.id %>";
}
//var table_id = $('.tables').attr("data-id");
window.location.href = '/origami/' + sale_id + "/surveys"
});
// bind customer to order or sale
$("#customer").on('click', function(){
var sale = $('#sale_id').val();

View File

@@ -197,7 +197,7 @@
<!-- Column Three -->
<div class="col-lg-1 col-md-1 col-sm-1">
<button type="button" class="btn btn-default btn-block" id='back'>Back</button>
<button type="button" class="btn btn-default btn-block" id='back'><i class="material-icons">reply</i>Back</button>
<% if @sale.sale_status != 'void' %>
<button type="button" id="void" class="btn bg-danger btn-block">VOID</button>
<% end %>

View File

@@ -1,72 +1,91 @@
<div class="container-fluid">
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-8 col-lg-8">
<%= simple_form_for(@survey, :url => origami_create_surveys_path) do |f| %>
<%= f.error_notification %>
<div class="form-inputs p-l-10">
<div class="col-xs-12 col-sm-12 col-md-8 col-lg-8">
<%= simple_form_for(@survey, :url => origami_create_surveys_path) do |f| %>
<%= f.error_notification %>
<div class="form-inputs p-l-10">
<%= f.input :child%>
<%= f.input :adult %>
<%= f.input :male %>
<%= f.input :female %>
<%= f.input :local %>
<%= f.input :child%>
<%= f.input :adult %>
<%= f.input :male %>
<%= f.input :female %>
<%= f.input :local %>
<div class="row clearfix">
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
<div class="form-group">
<div class="row clearfix">
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
<div class="form-group">
<label>Foreigner</label>
<select class="form-control col-md-12 selectpicker show-tick" name="survey[foreigner][][]" style="height: " >
<select class="form-control col-md-12 selectpicker show-tick" name="survey[foreigner][][]" style="height: " >
<% Lookup.where("lookup_type = ?", "country" ).each do |ct| %>
<option value="<%= ct.value %>">
<option value="<%= ct.value %>">
<%= ct.name %></option>
<%end %>
</select>
<%end %>
</select>
</div>
</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
<div class="form-group">
<label>Number</label>
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
<div class="form-group">
<label>Number</label>
<input type="number" name="survey[foreigner][][]" class="form-control">
</div>
</div>
</div>
<%= f.input :total_customer %>
<input type="hidden" name="table_id" value="<%=@dining_facility.id%>">
<%= f.input :dining_name, :as => :hidden, :input_html => { :value => @dining_facility.name } %>
<%= f.input :created_by, :as => :hidden, :input_html => { :value => current_login_employee.name } %>
<%= f.input :receipt_no, :as => :hidden, :input_html => { :value => @receipt_no} %>
<%= f.input :total_amount, :as => :hidden, :input_html => { :value => @grand_total } %>
</div>
<%= f.input :total_customer %>
<input type="hidden" name="table_id" value="<%=@dining_facility.id%>">
<%= f.input :dining_name, :as => :hidden, :input_html => { :value => @dining_facility.name } %>
<%= f.input :created_by, :as => :hidden, :input_html => { :value => current_login_employee.name } %>
<%= f.input :receipt_no, :as => :hidden, :input_html => { :value => @receipt_no} %>
<%= f.input :total_amount, :as => :hidden, :input_html => { :value => @grand_total } %>
<div class="form-actions">
<%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect' %>
</div>
<% end %>
</div>
<div class="form-actions">
<%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect' %>
</div>
<% end %>
</div>
<div class="col-xs-12 col-sm-12 col-md-4 col-lg-4">
<div class="card">
<div class="body">
<h5><i class="material-icons md-18">view_headline <%= t("views.right_panel.header.page_detail") %></i></h5>
<div class="col-xs-12 col-sm-12 col-md-3 col-lg-3">
<div class="card">
<div class="body">
<h5><i class="material-icons md-18">view_headline <%= t("views.right_panel.header.page_detail") %></i></h5>
<p>
1) <%= t("views.right_panel.detail.title") %> - <%= t("views.right_panel.detail.write_txt") %> <%= t("views.right_panel.detail.title_txt") %> <br>
2) <%= t("views.right_panel.detail.account_type") %> - <%= t("views.right_panel.detail.write_txt") %> <%= t("views.right_panel.detail.account_type_txt") %> <br>
3) <%= t("views.right_panel.detail.discount") %> - <%= t("views.right_panel.detail.checkbox") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.discount_txt") %> <br>
4) <%= t("views.right_panel.detail.point") %> - <%= t("views.right_panel.detail.checkbox") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.point_txt") %> <br>
5) <%= t("views.right_panel.detail.bonus") %> - <%= t("views.right_panel.detail.checkbox") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.bonus_txt") %> <br>
6) <%= t("views.right_panel.detail.rebate") %> - <%= t("views.right_panel.detail.checkbox") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.rebate_txt") %> <br>
1) <%= t("views.right_panel.detail.title") %> - <%= t("views.right_panel.detail.write_txt") %> <%= t("views.right_panel.detail.title_txt") %> <br>
2) <%= t("views.right_panel.detail.account_type") %> - <%= t("views.right_panel.detail.write_txt") %> <%= t("views.right_panel.detail.account_type_txt") %> <br>
3) <%= t("views.right_panel.detail.discount") %> - <%= t("views.right_panel.detail.checkbox") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.discount_txt") %> <br>
4) <%= t("views.right_panel.detail.point") %> - <%= t("views.right_panel.detail.checkbox") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.point_txt") %> <br>
5) <%= t("views.right_panel.detail.bonus") %> - <%= t("views.right_panel.detail.checkbox") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.bonus_txt") %> <br>
6) <%= t("views.right_panel.detail.rebate") %> - <%= t("views.right_panel.detail.checkbox") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.rebate_txt") %> <br>
</p>
<h5><i class="material-icons md-18">list <%= t("views.right_panel.header.button_lists") %></i> </h5>
<p>
1) <%= t("views.right_panel.button.submit") %> - <%= t("views.right_panel.detail.submit_btn_txt") %> <%= t("views.right_panel.detail.account_txt") %> <br>
1) <%= t("views.right_panel.button.submit") %> - <%= t("views.right_panel.detail.submit_btn_txt") %> <%= t("views.right_panel.detail.account_txt") %> <br>
</p>
<h5><i class="material-icons md-18">list <%= t("views.right_panel.header.link_lists") %></i> </h5>
<p>
1) <%= t("views.right_panel.button.home") %> - <%= t("views.right_panel.detail.home_txt") %> <br>
2) <%= t("views.right_panel.button.back") %> - <%= t("views.right_panel.detail.back_txt") %> <%= t("views.right_panel.detail.account_txt") %> <br>
</p>
</div>
</div>
</div>
</div>
</div>
</div>
<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>
<script type="text/javascript">
$(document).ready(function(){
$('#back').on('click',function(){
table_type = '<%=@table_type%>';
table_id = '<%=@dining_facility.id%>';
if(table_type == "Table"){
window.location.href = "/origami/table/" + table_id
}
else {
window.location.href = "/origami/room/" + table_id
}
})
});
</script>

View File

@@ -9,7 +9,7 @@
</div>
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-9 col-lg-9">
<div class="col-xs-12 col-sm-12 col-md-8 col-lg-8">
<div class="card">
<table class="table table-striped">
<thead>
@@ -70,5 +70,22 @@
</div>
</div>
</div>
<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>
<script type="text/javascript">
$(document).ready(function(){
$('#back').on('click',function(){
table_type = '<%=@table_type%>';
table = '<%=@dining_facility.id%>';
if(table_type == "Table"){
window.location.href = "/origami/table/" + table_id
}
else {
window.location.href = "/origami/room/" + table_id
}
})
});
</script>

View File

@@ -1,4 +1,4 @@
<div class="page-header">
<!-- <div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= '/origami/table/@dining_facility.id' %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item active"><%= t("views.right_panel.detail.survey") %></li>
@@ -7,6 +7,6 @@
<%= link_to t('.back',:default => t("views.btn.back")),'/origami/table/'+@dining_facility.id.to_s %>
</span>
</ol>
</div>
</div> -->
<%= render 'form', survey: @survey %>

View File

@@ -99,7 +99,7 @@
</div>
<div class="col-lg-1 col-md-1 col-sm-1">
<button type="button" class="btn bg-default m-t-10 btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment/others_payment';"> Back </button>
<button type="button" class="btn bg-default m-t-10 btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment/others_payment';"><i class="material-icons m-t--5">reply</i> Back </button>
</div>
</div>
</div>