update osaka demo bugs

This commit is contained in:
Aung Myo
2017-07-14 17:23:40 +06:30
parent ef7cc1f6f0
commit 0b7b5cae30
22 changed files with 76 additions and 53 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 673 B

View File

@@ -211,3 +211,29 @@ tr.discount-item-row:hover {
margin-left:-40px !important;
margin-top:-40px !important;
}
/*Loading gif for payment*/
#loading_wrapper{
position: fixed;
background-color: #C8C8C8 ;
height: 100%;
width: 100%;
left: 0;
opacity: 0.6;
top: 0;
z-index: 9999999;
}
#loading{
position: relative;
height: 100%;
width: 100%;
background-image: url('../../../image/loading-ajax.gif');
background-position: center center;
background-repeat: no-repeat;
opacity: 1;
filter: alpha(opacity=100); /* ie */
-moz-opacity: 1; /* mozilla */
}

View File

@@ -189,15 +189,15 @@ class Origami::DiscountsController < BaseOrigamiController
discount_amount = discount_amount + response["discount_bonus_earned"]
end
sale.compute_by_sale_items(sale_id, sale.sale_items, discount_amount, 'member_discount')
result = {:status=> "Success", :table_id => table_id,:table_type => table_type }
result = {:status=> "Success",:title=>"Member Discount", :table_id => table_id,:table_type => table_type }
end
if response["status"] == "500"
result = {:status=> response["error"], :table_id => table_id,:table_type => table_type }
result = {:status=> response["error"],:title=>"Alert", :table_id => table_id,:table_type => table_type }
end
if !response.nil?
if response[:status] == false
result = {:status=> response[:message], :table_id => table_id,:table_type => table_type }
result = {:status=> response[:message],:title=>"Alert", :table_id => table_id,:table_type => table_type }
end
end

View File

@@ -4,7 +4,7 @@ class Origami::HomeController < BaseOrigamiController
def index
@tables = Table.all.active.order('status desc')
@rooms = Room.all.active.order('status desc')
@complete = Sale.all
@complete = Sale.where("sale_status != 'new'")
@orders = Order.all.order('date desc')
# @shift = ShiftSale.current_open_shift(current_user.id)
end
@@ -13,7 +13,7 @@ class Origami::HomeController < BaseOrigamiController
def show
@tables = Table.all.active.order('status desc')
@rooms = Room.all.active.order('status desc')
@complete = Sale.all
@complete = Sale.where("sale_status != 'new'")
@orders = Order.all.order('date desc')
@status_order = ""
@status_sale = ""

View File

@@ -3,7 +3,7 @@ class Origami::OrdersController < BaseOrigamiController
def show
@tables = Table.all.active.order('status desc')
@rooms = Room.all.active.order('status desc')
@complete = Sale.all
@complete = Sale.where("sale_status != 'new'")
@orders = Order.all.order('status desc')
@order = Order.find(params[:order_id])
sale_order = SaleOrder.find_by_order_id(@order.order_id)

View File

@@ -91,9 +91,9 @@ class Origami::PaymentsController < BaseOrigamiController
#get customer amount
@customer = Customer.find(@sale_data.customer_id)
rebate = MembershipSetting.find_by_rebate(1)
# get member information
if @customer.membership_id != nil
if @customer.membership_id != nil && rebate
response = Customer.get_member_account(@customer)
if response["status"]==true
response["data"].each do |res|

View File

@@ -3,7 +3,7 @@ class Origami::RoomsController < BaseOrigamiController
def show
@tables = Table.all.active.order('status desc')
@rooms = Room.all.active.order('status desc')
@complete = Sale.all
@complete = Sale.where("sale_status != 'new'")
@orders = Order.all.order('date desc')
@room = DiningFacility.find(params[:room_id])
@sale_array = Array.new
@@ -31,9 +31,6 @@ class Origami::RoomsController < BaseOrigamiController
end
end
end
puts "hhhhhhhhhh"
puts @status
puts @obj.to_json
end

View File

@@ -3,7 +3,7 @@ class Origami::SalesController < BaseOrigamiController
def show
@tables = Table.all.active.order('status desc')
@rooms = Room.all.active.order('status desc')
@complete = Sale.all
@complete = Sale.where("sale_status != 'new'")
@orders = Order.all.order('date desc')
@sale = Sale.find(params[:sale_id])
end

View File

@@ -46,11 +46,11 @@
</div>
<div class="form-group">
<%= f.input :nrc_no, :class => "form-control nrc_no" %>
<%= 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",:required => true%>
<%= f.input :company, :class => "form-control col-md-6 company"%>
<% flash.each do |name, msg| %>
<% str="[\"#{msg['company']}\"]"

View File

@@ -121,10 +121,10 @@
</div>
<div class="form-group">
<%= f.input :nrc_no, :class => "form-control nrc_no" %>
<%= 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",:required => true%>
<%= f.input :company, :class => "form-control col-md-6 company"%>
<% flash.each do |name, msg| %>
<% str="[\"#{msg['company']}\"]"

View File

@@ -519,7 +519,7 @@ $(document).ready(function(){
}
$.confirm({
title: 'Infomation!',
title: result.title,
content: result.status,
columnClass: 'small',
type: type,
@@ -542,18 +542,14 @@ $(document).ready(function(){
}
});
}else{
$.confirm({
$.alert({
title: 'Alert!',
content: 'Please Select Account',
type: 'red',
typeAnimated: true,
buttons: {
confirm: {
text: 'Ok',
btnClass: 'btn-danger',
}
}
});
}
});//end member discount

View File

@@ -15,13 +15,13 @@
</ul>
<!-- Nav tabs - End -->
<div class="tab-content" style="max-height:670px; overflow:auto">
<div class="tab-content" style="max-height:570px; overflow:auto">
<!--- Panel 0 - Completed Orders -->
<!--- Panel 1 - Table Orders -->
<div class="tab-pane " id="tables" role="tabpanel">
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;min-height:500px; max-height:500px; overflow-x:scroll">
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
<% @tables.each do |table| %>
<% if table.status == 'occupied' %>
<div class="card tables red text-white" data-id="<%= table.id %>" data-name="<%= table.name %>">
@@ -42,7 +42,7 @@
<!--- Panel 2 - Room Orders -->
<div class="tab-pane active" id="rooms" role="tabpanel">
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;min-height:500px; max-height:500px; overflow-x:scroll" >
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;" >
<% @rooms.each do |room| %>
<% if room.status == 'occupied' %>
<div class="card rooms red text-white" data-id="<%= room.id %>" data-name="<%= room.name %>">
@@ -95,7 +95,7 @@
</div>
</div>
<div class="card-text" style="min-height:500px; max-height:500px; overflow-x:scroll" >
<div class="card-text" style="min-height:500px; max-height:500px; overflow:auto" >
<table class="table table-striped" id="order-items-table">
<thead>
<tr>

View File

@@ -15,13 +15,13 @@
</ul>
<!-- Nav tabs - End -->
<div class="tab-content" style="max-height:670px; overflow:auto">
<div class="tab-content" style="max-height:570px; overflow:auto">
<!--- Panel 0 - Completed Orders -->
<!--- Panel 1 - Table Orders -->
<div class="tab-pane active" id="tables" role="tabpanel">
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;min-height:500px; max-height:500px; overflow-x:scroll" >
<div class="card-columns" style="padding-top:10px;" >
<% @tables.each do |table| %>
<% if table.status == 'occupied' %>
<div class="card tables red text-white" data-id="<%= table.id %>" data-name="<%= table.name %>">
@@ -42,7 +42,7 @@
<!--- Panel 2 - Room Orders -->
<div class="tab-pane" id="rooms" role="tabpanel">
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;min-height:500px; max-height:500px; overflow-x:scroll" >
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;" >
<% @rooms.each do |room| %>
<% if room.status == 'occupied' %>
<div class="card rooms red text-white" data-id="<%= room.id %>" data-name="<%= room.name %>">
@@ -95,7 +95,7 @@
</div>
</div>
<div class="card-text" style="min-height:500px; max-height:500px; overflow-x:scroll" >
<div class="card-text" style="min-height:500px; max-height:500px; overflow:auto" >
<table class="table table-striped" id="order-items-table">
<thead>
<tr>

View File

@@ -175,11 +175,9 @@
<td class="item-attr"><strong id="order-sub-total"><%= sub_total %></strong></td>
</tr>
<tr>
<%if @selected_item.discount_type == 'member_discount'%>
<td class="charges-name"><strong>Member Discount:</strong></td>
<%else%>
<td class="charges-name"><strong>Discount:</strong></td>
<%end%>
<td class="item-attr"><strong id="order-discount">(<%=@selected_item.total_discount rescue 0%>)</strong></td>
</tr>
<tr class="rebate_amount"></tr>

View File

@@ -1,4 +1,6 @@
<div id="loading_wrapper" style="display:none;">
<div id="loading"></div>
</div>
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-3">
<div class="card" >
@@ -104,6 +106,7 @@
</div>
</div>
</div>
<div class="col-lg-5 col-md-5 col-sm-3">
<div class="row" style="margin-top:10px;">
<div class="col-md-8"><strong style="font-size:18px;">Amount Due</strong></div>
@@ -258,6 +261,8 @@
<button type="button" class="btn btn-primary btn-block"> FOC </button>
<button type="button" class="btn btn-primary btn-block" id="void"> Void </button>
</div>
</div>
<script>
@@ -344,8 +349,12 @@ $( document ).ready(function() {
$('#pay').click(function() {
$('#pay').text("Processing, Please wait!")
$( "#loading_wrapper" ).show();
if($('#balance').text() > 0){
alert(" Insufficient Amount!")
$( "#loading_wrapper" ).hide();
}else{
// payment
var cash = $('#cash').text();
@@ -364,7 +373,7 @@ $( document ).ready(function() {
else{
var msg = '';
}
$( "#loading_wrapper" ).hide();
if($('#balance').text() < 0){
$.confirm({
title: 'Infomation!',

View File

@@ -203,7 +203,7 @@
<td class="item-attr"><strong id="order-sub-total"><%= sub_total %></strong></td>
</tr>
<tr>
<%if @obj.discount_type == 'member_discount'%>
<%if @obj != nil && @status_sale == 'sale' && @obj.discount_type == 'member_discount'%>
<td class="charges-name"><strong>Member Discount:</strong></td>
<%else%>
<td class="charges-name"><strong>Discount:</strong></td>

View File

@@ -110,7 +110,7 @@ $(document).on('focusout', '.float-value', function(event){
$('#open_cashier').on('click',function(){
var cashier_terminal = $('#cashier_terminal').val();
var amount = $('#total').text();
var amount = $('#total').text()||0;
$.ajax({type: "POST",
url: "<%= origami_shifts_path %>",
data: "opening_balance=" + amount + "&cashier_terminal="+ cashier_terminal,

View File

@@ -11,7 +11,6 @@
<%= f.input :rebate %>
<%= f.input :bonus %>
<%= f.input :point %>
<%= f.input :created_by %>
</div>
<div class="form-actions">

View File

@@ -22,7 +22,6 @@
<th>Rebate</th>
<th>Bonus</th>
<th>Point</th>
<th>Created by</th>
<th colspan="3"></th>
</tr>
</thead>
@@ -40,7 +39,6 @@
<td><%= settings_membership_setting.rebate %></td>
<td><%= settings_membership_setting.bonus %></td>
<td><%= settings_membership_setting.point %></td>
<td><%= settings_membership_setting.created_by %></td>
<td><%= link_to 'Edit', edit_settings_membership_setting_path(settings_membership_setting) %></td>
<td><%= link_to 'Destroy', settings_membership_setting_path(settings_membership_setting), method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>

View File

@@ -32,7 +32,7 @@
<td><%= @settings_order_queue_station.station_name %></td>
<td><%= @settings_order_queue_station.is_active %></td>
<td><%= @settings_order_queue_station.auto_print %></td>
<td><%= @settings_order_queue_station.processing_items %></td>
<td><%= JSON.parse(@settings_order_queue_station.processing_items).count %></td>
<td><%= @settings_order_queue_station.print_copy %></td>
<td><%= @settings_order_queue_station.printer_name %></td>
<td><%= @settings_order_queue_station.font_size %></td>

BIN
public/image/loading-ajax.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB