update pull master
This commit is contained in:
@@ -29,7 +29,10 @@
|
||||
<tbody>
|
||||
<% sub_total = 0 %>
|
||||
<% @sale_data.sale_items.each do |sale_item| %>
|
||||
<% sub_total += sale_item.qty*sale_item.unit_price%>
|
||||
<%
|
||||
sub_total += sale_item.qty*sale_item.unit_price
|
||||
unless sale_item.price == 0
|
||||
%>
|
||||
<tr class="item-row" id=<%= sale_item.sale_item_id %> >
|
||||
<td style="width:60%; text-align:left">
|
||||
<span id="item-account-type" class="hidden"><%=sale_item.account_id%></span>
|
||||
@@ -42,7 +45,10 @@
|
||||
<span id="item-total-price"><%=(sale_item.qty*sale_item.unit_price)%></span>
|
||||
</td>
|
||||
</tr>
|
||||
<%end %>
|
||||
<%
|
||||
end
|
||||
end
|
||||
%>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -166,7 +172,7 @@
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<button id="net" class="btn btn-warning fluid action-btn">Net</button>
|
||||
<button id="net" class="btn btn-warning fluid action-btn">Nett</button>
|
||||
<button id="percentage" class="btn btn-primary fluid action-btn">Percentage</button>
|
||||
<button id="remove-item" class="btn btn-default fluid action-btn">Remove</button>
|
||||
</div>
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
<div class="card sales red text-white" data-id = "<%= sale.sale_id %>">
|
||||
<div class="card-block">
|
||||
<%= sale.receipt_no %>
|
||||
<span style="font-size:12px;float:right;line-height:inherit;"><%= sale.sale_status %></span>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
<div class="card sales red text-white" data-id = "<%= sale.sale_id %>">
|
||||
<div class="card-block">
|
||||
<%= sale.receipt_no %>
|
||||
<span style="font-size:12px;float:right;line-height:inherit;"><%= sale.sale_status %></span>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -138,7 +139,7 @@
|
||||
<%if @customer %>
|
||||
<p class="hidden customer-id"><%= @customer.customer_id rescue "" %></p>
|
||||
<p>Customer : <%= @customer.name rescue "" %></p>
|
||||
<%end%>
|
||||
<%end%>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-text">
|
||||
@@ -249,8 +250,10 @@
|
||||
</table>
|
||||
<button class='btn btn-primary' id='add_invoice'> Add to existing invoice </button>
|
||||
<% end %>
|
||||
<% if @sale_array.size > 1 %>
|
||||
<br><br>
|
||||
Pending Payment
|
||||
<% end %>
|
||||
<% @sale_array.each do |sale|
|
||||
if @sale_array.size > 1
|
||||
unless sale.receipt_no == @sale_array[0].receipt_no
|
||||
@@ -287,7 +290,7 @@
|
||||
<button type="button" class="btn btn-primary btn-block" id='move'>Move</button>
|
||||
<button type="button" id="request_bills" class="btn btn-primary btn-block">Req.Bill</button>
|
||||
<button type="button" id="pay" class="btn btn-primary btn-block" disabled>Pay</button>
|
||||
<button type="button" class="btn btn-primary btn-block" disabled=""> Void </button>
|
||||
<button type="button" class="btn btn-primary btn-block" disabled> Void </button>
|
||||
<% else %>
|
||||
<button type="button" class="btn btn-primary btn-block" disabled>Add Order</button>
|
||||
<button type="button" class="btn btn-primary btn-block" id='edit'>Edit</button>
|
||||
@@ -473,7 +476,7 @@ $('#edit').on('click',function(){
|
||||
var sale_id = "<%= @obj_sale.sale_id rescue "" %>"
|
||||
window.location.href = '/origami/table/'+ dining_id + "/sale/"+ sale_id + "/edit";
|
||||
})
|
||||
|
||||
|
||||
$('#void').on('click',function () {
|
||||
var sure = confirm("Are you sure want to Void");
|
||||
if (sure == true) {
|
||||
@@ -488,9 +491,9 @@ $('#edit').on('click',function(){
|
||||
})
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<% @complete.each do |sale| %>
|
||||
<div class="card sales red text-white" data-id = "<%= sale.sale_id %>">
|
||||
<div class="card-block">
|
||||
<%= sale.receipt_no %>
|
||||
<%= sale.receipt_no %><span style="font-size:12px;float:right;line-height:inherit;"><%= sale.sale_status %></span>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -95,10 +95,12 @@
|
||||
order_status = ""
|
||||
sale_order = SaleOrder.find_by_order_id(order)
|
||||
if sale_order
|
||||
sale = Sale.find(sale_order.sale_id)
|
||||
order_status = sale.sale_status
|
||||
if order_status == 'new'
|
||||
order_status = order.status
|
||||
unless sale_order.sale_id.nil?
|
||||
sale = Sale.find(sale_order.sale_id)
|
||||
order_status = sale.sale_status
|
||||
if order_status == 'new'
|
||||
order_status = order.status
|
||||
end
|
||||
end
|
||||
else
|
||||
order_status = order.status
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Table No</strong> <% if @sale_data%>- <%=@sale_data.receipt_no%><% end %></td>
|
||||
<td><strong>Sale Id</strong> </span><span id="sale_id"><% if @sale_data %><%=@sale_data.sale_id %><% end %></td>
|
||||
<td><strong>Sale Id</strong> <span id="sale_id"><% if @sale_data %><%=@sale_data.sale_id %><% end %></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Customer :</strong> <%= @sale_data.customer.name%></td>
|
||||
@@ -244,7 +244,7 @@
|
||||
|
||||
<button type="button" class="btn btn-primary btn-block" onclick="localStorage.removeItem('cash');window.location.href = '/origami';"> Back </button>
|
||||
<button type="button" class="btn btn-primary btn-block"> FOC </button>
|
||||
<button type="button" class="btn btn-primary btn-block"> Void </button>
|
||||
<button type="button" class="btn btn-primary btn-block" id="void"> Void </button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -354,6 +354,23 @@ $( document ).ready(function() {
|
||||
}
|
||||
});
|
||||
|
||||
$('#void').on('click',function () {
|
||||
var sure = confirm("Are you sure want to Void");
|
||||
if (sure == true) {
|
||||
var sale_id = $('#sale_id').text();
|
||||
var ajax_url = "/origami/sale/" + sale_id + '/void';
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: ajax_url,
|
||||
success: function () {
|
||||
window.location.href = '/origami/';
|
||||
}
|
||||
})
|
||||
} else {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function update_balance(){
|
||||
@@ -369,4 +386,5 @@ function update_balance(){
|
||||
var result = amount_due - total;
|
||||
$('#balance').text(result.toFixed(2));
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<% @complete.each do |sale| %>
|
||||
<div class="card sales red text-white" data-id = "<%= sale.sale_id %>">
|
||||
<div class="card-block">
|
||||
<%= sale.receipt_no %>
|
||||
<%= sale.receipt_no %><span style="font-size:12px;float:right;line-height:inherit;"><%= sale.sale_status %></span>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -155,7 +155,7 @@
|
||||
sub_total = 0
|
||||
if @status == "sale"
|
||||
@obj.sale_items.each do |sale_item|
|
||||
sub_total = sub_total + sale_item.price
|
||||
sub_total = sub_total + sale_item.price
|
||||
%>
|
||||
<input type="hidden" id="sale_id" value="<%= @obj.sale_id %>">
|
||||
<% unless sale_item.price == 0 %>
|
||||
@@ -213,32 +213,52 @@
|
||||
</table>
|
||||
</div>
|
||||
<br>
|
||||
<%
|
||||
if @status_sale == 'sale'
|
||||
unless @order_items.nil?
|
||||
%>
|
||||
Pending New Order
|
||||
<table class="table table-striped">
|
||||
<%
|
||||
count = 0
|
||||
@order_items.each do |order_item |
|
||||
count += 1
|
||||
%>
|
||||
|
||||
<%
|
||||
if @status == 'sale'
|
||||
unless @order_items.nil?
|
||||
%>
|
||||
Added New Order
|
||||
<table class="table table-striped">
|
||||
<%
|
||||
@order_items.each do |order_item |
|
||||
<tr>
|
||||
<td><%= count %>
|
||||
<td class='item-name'><%= order_item.item_name %></td>
|
||||
<td class='item-attr'><%= order_item.qty %></td>
|
||||
<td class='item-attr'><%= order_item.qty*order_item.price %></td>
|
||||
</tr>
|
||||
|
||||
<%
|
||||
end
|
||||
%>
|
||||
</table>
|
||||
<button class='btn btn-primary' id='add_invoice'> Add to existing invoice </button>
|
||||
<% end %>
|
||||
<% if @sale_array.size > 1 %>
|
||||
<br><br>
|
||||
Pending Payment
|
||||
<% end %>
|
||||
<% @sale_array.each do |sale|
|
||||
if @sale_array.size > 1
|
||||
unless sale.receipt_no == @sale_array[0].receipt_no
|
||||
%>
|
||||
|
||||
<tr>
|
||||
<td class='item-name'><%= order_item.item_name %></td>
|
||||
<td class='item-attr'><%= order_item.qty %></td>
|
||||
<td class='item-attr'><%= order_item.qty*order_item.price %></td>
|
||||
</tr>
|
||||
|
||||
<%
|
||||
end
|
||||
%>
|
||||
</table>
|
||||
<button class='btn btn-primary'> Add to existing invoice </button>
|
||||
<%
|
||||
end
|
||||
end
|
||||
%>
|
||||
<table class="table table-striped">
|
||||
<tr>
|
||||
<td>Receipt No - <%= sale.receipt_no %></td>
|
||||
<td><button class='btn btn-sm btn-primary invoicedetails' id="<%= sale.sale_id %>">Show Detail </button></td>
|
||||
</tr>
|
||||
</table>
|
||||
<%
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
%>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<% @complete.each do |sale| %>
|
||||
<div class="card sales red text-white" data-id = "<%= sale.sale_id %>">
|
||||
<div class="card-block">
|
||||
<%= sale.receipt_no %>
|
||||
<%= sale.receipt_no %><span style="font-size:12px;float:right;line-height:inherit;"><%= sale.sale_status %></span>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -185,7 +185,9 @@
|
||||
<!-- Column Three -->
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<button type="button" class="btn btn-primary btn-block" id='back'>Back</button>
|
||||
<button type="button" id="void" class="btn btn-primary btn-block">VOID</button>
|
||||
<% if @sale.sale_status != 'void' %>
|
||||
<button type="button" id="void" class="btn btn-primary btn-block">VOID</button>
|
||||
<% end %>
|
||||
<button type="button" id="re-print" class="btn btn-primary btn-block">Re.Print</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -128,6 +128,7 @@
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<button type="button" class="btn btn-primary btn-block" id='back'>Back</button>
|
||||
<button type="button" id="pay" class="btn btn-primary btn-block">Pay</button>
|
||||
<button type="button" id="void" class="btn btn-primary btn-block"> Void </button>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
@@ -143,5 +144,21 @@ $('#pay').on('click',function() {
|
||||
});
|
||||
$('#back').on('click',function(){
|
||||
window.location.href = '/origami/table/<%= @table.id %>';
|
||||
})
|
||||
});
|
||||
$('#void').on('click',function () {
|
||||
var sure = confirm("Are you sure want to Void");
|
||||
if (sure == true) {
|
||||
var sale_id = $('#sale_id').val();
|
||||
var ajax_url = "/origami/sale/" + sale_id + '/void';
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: ajax_url,
|
||||
success: function () {
|
||||
window.location.href = '/origami/';
|
||||
}
|
||||
})
|
||||
} else {
|
||||
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user