update table invoice

This commit is contained in:
Aung Myo
2018-01-24 18:12:47 +06:30
parent 8d2a928456
commit 357c7c8682
2 changed files with 13 additions and 8 deletions

View File

@@ -162,8 +162,13 @@ function checkReceiptNoInFirstBillData(receipt_no,payment) {
} }
} }
} }
if (payment) { if (payment) {
return json_data[0]["payment"]; if (json_data.length>0) {
return json_data[0]["payment"];
}else{
return false;
}
}else{ }else{
return status; return status;
} }

View File

@@ -25,22 +25,22 @@
<div class="card-block"> <div class="card-block">
<div class="card-title row"> <div class="card-title row">
<div class="col-lg-6 col-md-6 col-sm-6"> <div class="col-lg-6 col-md-6 col-sm-6">
<p> Receipt No: <span id="receipt_no"> &nbsp; Receipt No: <span id="receipt_no">
<%= @sale.receipt_no rescue '' %> <%= @sale.receipt_no rescue '' %>
</span></p> </span>
</div> </div>
<div class="col-lg-6 col-md-6 col-sm-6 text-right"> <div class="col-lg-6 col-md-6 col-sm-6 text-right">
<p>Date: <span id="receipt_date"><%= @sale.created_at.utc.getlocal.strftime("%d/%m/%Y - %I:%M %p") rescue '-'%></span></p> Date: <span id="receipt_date"><%= @sale.created_at.utc.getlocal.strftime("%d/%m/%Y - %I:%M %p") rescue '-'%></span>&nbsp;
</div> </div>
</div> </div>
<div class="card-title row customer_detail"> <div class="card-title row customer_detail">
<div class="col-lg-6 col-md-6 col-sm-6"> <div class="col-lg-6 col-md-6 col-sm-6">
<% if @status_sale == 'sale' %> <% if @status_sale == 'sale' %>
<p class="hidden customer-id"><%= @sale.customer_id rescue '' %></p> <p class="hidden customer-id"><%= @sale.customer_id rescue '' %></p>
<p>Customer : <%= @sale.customer.name rescue '-' %></p> &nbsp; Customer : <%= @sale.customer.name rescue '-' %>
<%else%> <%else%>
<p class="hidden customer-id"><%= @customer.customer_id rescue "" %></p> <p class="hidden customer-id"><%= @customer.customer_id rescue "" %></p>
<p>Customer : <%= @customer.name rescue "-" %></p> &nbsp; Customer : <%= @customer.name rescue "-" %>
<%end%> <%end%>
</div> </div>
@@ -68,7 +68,7 @@
<input type="hidden" id="sale_id" value="<%= @sale_array[0].sale_id %>"> <input type="hidden" id="sale_id" value="<%= @sale_array[0].sale_id %>">
<% <%
# Can't check for discount # Can't check for discount
unless sale_item.price == 0 # unless sale_item.price == 0
%> %>
<tr> <tr>
<td><%= count %></td> <td><%= count %></td>
@@ -77,7 +77,7 @@
<td class='item-attr'><%= sale_item.price %></td> <td class='item-attr'><%= sale_item.price %></td>
</tr> </tr>
<% <%
end # end
end end
end end