change order item count

This commit is contained in:
phyusin
2018-03-16 18:07:35 +06:30
parent b16483708a
commit 7f6676c840

View File

@@ -53,12 +53,14 @@
</tr>
</thead>
<tbody>
<% order_item_count = 0 %>
<% if !@order_items.nil? %>
<% sub_total = 0 %>
<% @order_items.each do |order_item| %>
<% if order_item.include? ('all_order') %>
<% order_item['all_order'].each do |odr_item| %>
<%
order_item_count = order_item_count.to_i + 1
sub_total += odr_item['qty'].to_f * odr_item['price'].to_f
%>
<tr class="item-row" id=<%= odr_item['order_items_id'] %> >
@@ -385,10 +387,10 @@
//order_item_split
$('#order_item_split').on('click',function () {
var cnt_order_item = "<%= @order_items.count %>";
var cnt_order_item = "<%= order_item_count %>";
var order_items = get_selected_order_items();// Selected Order Items
var cnt_items = parseInt(cnt_order_item - 1) - parseInt(order_items.length);
var cnt_items = parseInt(cnt_order_item) - parseInt(order_items.length);
if (order_items.length > 0){
// if(cnt_items > 0){
swal({