Merge branch 'staging'

This commit is contained in:
Yan
2017-07-17 15:13:31 +06:30
58 changed files with 1375 additions and 1252 deletions

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

@@ -67,7 +67,12 @@
<td class="item-attr"><strong id="order-beverage"></strong></td>
</tr> -->
<tr>
<td class="charges-name"><strong>Discount:</strong></td>
<%if @sale_data.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"><%=@sale_data.total_discount rescue 0%></strong>)</td>
</tr>
<tr class="hidden">
@@ -190,9 +195,11 @@
<button id="remove-item-discount" class="btn btn-warning btn-block action-btn">RemoveItem Discount</button>
<button id="remove-all" class="btn btn-warning btn-block action-btn">Remove All</button>
<button id="pay-discount" class="btn btn-danger btn-block action-btn">Enter</button>
<hr />
<button id="member-discount" class="btn btn-success btn-block action-btn
<%= @sale_data.customer.membership_id ? " " : "disabled"%>">Member Discount</button>
<% if @member_discount%>
<hr />
<button id="member-discount" class="btn btn-success btn-block action-btn
<%= @sale_data.customer.membership_id ? " " : "disabled"%>">Member Discount</button>
<%end %>
</div>
</div>
</div>
@@ -502,19 +509,18 @@ $(document).ready(function(){
data: params,
success:function(result){
if (result.url_status == false) {
status = result.url_message
if (result.status == "Success") {
type = 'green'
btn_color = 'btn-green'
}else{
type = 'red'
btn_color = 'btn-red'
}else{
status = result.status
type = ''
btn_color = 'btn-green'
}
$.confirm({
title: 'Infomation!',
content: status,
title: result.title,
content: result.status,
columnClass: 'small',
type: type,
buttons: {
@@ -536,18 +542,14 @@ $(document).ready(function(){
}
});
}else{
$.confirm({
title: 'Alert !',
content: 'Please Select Account',
type: 'red',
$.alert({
title: 'Alert!',
content: 'Please Select Account',
type: 'red',
typeAnimated: true,
buttons: {
confirm: {
text: 'Ok',
btnClass: 'btn-danger',
}
}
});
btnClass: 'btn-danger',
});
}
});//end member discount

View File

@@ -220,7 +220,11 @@
<td class="item-attr"><strong id="order-sub-total"><%= sub_total %></strong></td>
</tr>
<tr>
<td class="charges-name"><strong>Discount:</strong></td>
<%if @obj_sale != nil && @obj_sale.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">(<%= @obj_sale.total_discount rescue 0%>)</strong></td>
</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 " 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,7 +175,9 @@
<td class="item-attr"><strong id="order-sub-total"><%= sub_total %></strong></td>
</tr>
<tr>
<td class="charges-name"><strong>Discount:</strong></td>
<td class="charges-name"><strong>Discount:</strong></td>
<td class="item-attr"><strong id="order-discount">(<%=@selected_item.total_discount rescue 0%>)</strong></td>
</tr>
<tr class="rebate_amount"></tr>

View File

@@ -59,7 +59,11 @@
<td class="item-attr"><strong id="order-sub-total"><%=sub_total%></strong></td>
</tr>
<tr>
<%if @sale_data.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"><%=@sale_data.total_discount rescue 0%></strong>)</td>
</tr>
<tr class="hidden">

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" >
@@ -68,7 +70,12 @@
<td style="width:20%; text-align:right; border-top:none"><strong><span id="sub-total"><%=sub_total%></span></strong></td>
</tr>
<tr>
<td style="width:80%; text-align:left; border-top:none"><strong>(Discount)</strong></td>
<%if @sale_data.discount_type == 'member_discount'%>
<td style="width:80%; text-align:left; border-top:none"><strong>Member Discount:</strong></td>
<%else%>
<td style="width:80%; text-align:left; border-top:none"><strong>(Discount)</strong></td>
<%end%>
<td style="width:20%; text-align:right; border-top:none"><strong><span>(<%=@sale_data.total_discount rescue 0%>)</span></strong></td>
</tr>
<tr>
@@ -99,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>
@@ -253,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>
@@ -339,15 +349,19 @@ $( 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();
var credit = $('#credit').text();
var card = $('#card').text();
var sale_id = $('#sale_id').text();
$.ajax({type: "POST",
url: "<%= origami_payment_cash_path %>",
data: "cash="+ cash + "&sale_id=" + sale_id,
@@ -359,7 +373,7 @@ $( document ).ready(function() {
else{
var msg = '';
}
$( "#loading_wrapper" ).hide();
if($('#balance').text() < 0){
$.confirm({
title: 'Infomation!',
@@ -429,4 +443,4 @@ function update_balance(){
$('#balance').text(result.toFixed(2));
}
</script>
</script>

View File

@@ -40,7 +40,11 @@
<td class="item-attr"><strong id="order-sub-total"></strong></td>
</tr>
<tr>
<td class="charges-name"><strong>Discount:</strong></td>
<%if @sale.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">(<%= @sale.total_discount rescue 0%>)</strong></td>
</tr>
<tr>

View File

@@ -106,7 +106,11 @@
<td class="item-attr"><strong id="order-sub-total"><%= sub_total %></strong></td>
</tr>
<tr>
<td class="charges-name"><strong>Discount:</strong></td>
<%if @sale.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">(<%= @sale.total_discount rescue 0%>)</strong></td>
</tr>
<tr>

View File

@@ -203,7 +203,11 @@
<td class="item-attr"><strong id="order-sub-total"><%= sub_total %></strong></td>
</tr>
<tr>
<td class="charges-name"><strong>Discount:</strong></td>
<%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>
<%end%>
<td class="item-attr"><strong id="order-discount">(<%=@obj.total_discount rescue 0%>)</strong></td>
</tr>
<% if @status == "sale" %>

View File

@@ -164,7 +164,11 @@
<td class="item-attr"><strong id="order-sub-total"><%= sub_total %></strong></td>
</tr>
<tr>
<td class="charges-name"><strong>Discount:</strong></td>
<%if @sale.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">(<%= @sale.total_discount rescue 0%>)</strong></td>
</tr>
<tr>

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

@@ -40,7 +40,11 @@
<td class="item-attr"><strong id="order-sub-total"></strong></td>
</tr>
<tr>
<td class="charges-name"><strong>Discount:</strong></td>
<%if @sale.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">(<%= @sale.total_discount rescue 0%>)</strong></td>
</tr>
<tr>

View File

@@ -106,7 +106,11 @@
<td class="item-attr"><strong id="order-sub-total"><%= sub_total %></strong></td>
</tr>
<tr>
<td class="charges-name"><strong>Discount:</strong></td>
<%if @sale.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">(<%= @sale.total_discount rescue 0%>)</strong></td>
</tr>
<tr>