move multiple order and sales
This commit is contained in:
@@ -108,7 +108,7 @@
|
||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||
<p> Receipt No: <span id="receipt_no">
|
||||
<% if @status_sale == 'sale' %>
|
||||
<%= @obj_sale.receipt_no rescue '' %>
|
||||
<%= @sale_array[0].receipt_no rescue '' %>
|
||||
<% end %>
|
||||
</span></p>
|
||||
</div>
|
||||
@@ -126,6 +126,7 @@
|
||||
<table class="table table-striped" id="order-items-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th class="item-name">Items</th>
|
||||
<th class="item-attr">QTY</td>
|
||||
<th class="item-attr">Price</td>
|
||||
@@ -133,14 +134,18 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<%
|
||||
count = 0
|
||||
sub_total = 0
|
||||
if @status_sale == "sale"
|
||||
@obj_sale.sale_items.each do |sale_item|
|
||||
puts @sale_array[0]
|
||||
@sale_array[0].sale_items.each do |sale_item|
|
||||
count += 1
|
||||
sub_total = sub_total + sale_item.price
|
||||
%>
|
||||
<input type="hidden" id="sale_id" value="<%= @obj_sale.sale_id %>">
|
||||
<input type="hidden" id="sale_id" value="<%= @sale_array[0].sale_id %>">
|
||||
<% unless sale_item.price <= 0 %>
|
||||
<tr>
|
||||
<td><%= count %></td>
|
||||
<td class='item-name'><%= sale_item.product_name %></td>
|
||||
<td class='item-attr'><%= sale_item.qty %></td>
|
||||
<td class='item-attr'><%= sale_item.price %></td>
|
||||
@@ -152,11 +157,16 @@
|
||||
|
||||
if @status_order == 'order' && @status_sale != 'sale'
|
||||
unless @order_items.nil?
|
||||
count = 0
|
||||
@order_items.each do |order_item |
|
||||
puts @order_items.size
|
||||
puts "view"
|
||||
count += 1
|
||||
sub_total = sub_total + order_item.price
|
||||
|
||||
unless order_item.price <= 0 %>
|
||||
<tr>
|
||||
<td><%= count %></td>
|
||||
<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>
|
||||
@@ -220,14 +230,13 @@
|
||||
else
|
||||
@sale_array.each do |sale|
|
||||
if @sale_array.size > 1
|
||||
unless sale.receipt_no == @sale_array[0].receipt_no
|
||||
%>
|
||||
Pending New Invoice
|
||||
<%
|
||||
unless sale.receipt_no == @obj_sale.receipt_no
|
||||
%>
|
||||
<table class="table table-striped">
|
||||
<tr>
|
||||
<td><%= sale.receipt_no %></td>
|
||||
<td>Receipt No - <%= sale.receipt_no %></td>
|
||||
<td><button class='btn btn-sm btn-primary '>Show Detail </button></td>
|
||||
</tr>
|
||||
</table>
|
||||
<%
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||
<p> Receipt No: <span id="receipt_no">
|
||||
<% if @status_sale == 'sale' %>
|
||||
<%= @obj_sale.receipt_no rescue '' %>
|
||||
<%= @sale_array[0].receipt_no rescue '' %>
|
||||
<% end %>
|
||||
</span></p>
|
||||
</div>
|
||||
@@ -110,11 +110,12 @@
|
||||
count = 0
|
||||
sub_total = 0
|
||||
if @status_sale == "sale"
|
||||
@obj_sale.sale_items.each do |sale_item|
|
||||
puts @sale_array[0]
|
||||
@sale_array[0].sale_items.each do |sale_item|
|
||||
count += 1
|
||||
sub_total = sub_total + sale_item.price
|
||||
count += 1
|
||||
%>
|
||||
<input type="hidden" id="sale_id" value="<%= @obj_sale.sale_id %>">
|
||||
<input type="hidden" id="sale_id" value="<%= @sale_array[0].sale_id %>">
|
||||
<% unless sale_item.price <= 0 %>
|
||||
<tr>
|
||||
<td><%= count %></td>
|
||||
@@ -126,12 +127,16 @@
|
||||
end
|
||||
end
|
||||
end
|
||||
count = 0
|
||||
if @status_order == 'order' && @status_sale != 'sale'
|
||||
|
||||
if @status_order == 'order' && @status_sale != 'sale'
|
||||
unless @order_items.nil?
|
||||
count = 0
|
||||
@order_items.each do |order_item |
|
||||
puts @order_items.size
|
||||
puts "view"
|
||||
count += 1
|
||||
sub_total = sub_total + order_item.price
|
||||
count += 1
|
||||
|
||||
unless order_item.price <= 0 %>
|
||||
<tr>
|
||||
<td><%= count %></td>
|
||||
@@ -155,13 +160,10 @@
|
||||
Pending New Order
|
||||
<table class="table table-striped">
|
||||
<%
|
||||
count = 0
|
||||
@order_items.each do |order_item |
|
||||
count += 1
|
||||
%>
|
||||
|
||||
<tr>
|
||||
<td><%= count %></td>
|
||||
<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>
|
||||
@@ -171,9 +173,26 @@
|
||||
end
|
||||
%>
|
||||
</table>
|
||||
<button class='btn btn-primary'> Add to existing invoice </button>
|
||||
<%
|
||||
else
|
||||
@sale_array.each do |sale|
|
||||
if @sale_array.size > 1
|
||||
unless sale.receipt_no == @sale_array[0].receipt_no
|
||||
%>
|
||||
Pending New Invoice
|
||||
<table class="table table-striped">
|
||||
<tr>
|
||||
<td>Receipt No - <%= sale.receipt_no %></td>
|
||||
<td><button class='btn btn-sm btn-primary '>Show Detail </button></td>
|
||||
</tr>
|
||||
</table>
|
||||
<%
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
%>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
Reference in New Issue
Block a user