update sale and customer

This commit is contained in:
Aung Myo
2017-06-14 18:13:13 +06:30
parent 914069e3af
commit 2da2edc5ec
8 changed files with 112 additions and 166 deletions

View File

@@ -93,7 +93,7 @@
<td>Grand Total</td>
<td colspan="2"><%= number_with_precision(@sale.grand_total, :precision => 2, :delimiter => ',') rescue ' '%></td>
</tr>
<tr><td>&nbsp;<td></tr>
<tr><td colspan="5">&nbsp;<td></tr>
<tr>
<td colspan=2 style="text-align:center"></td>
<td>Pay Amount</td>
@@ -108,7 +108,7 @@
<tr>
<td colspan=2 style="text-align:center"></td>
<td>Payment <%= r.payment_method rescue ' '%></td>
<td><%= number_with_precision(r.payment_amount, :precision => 2, :delimiter => ',') rescue ' '%>
<td colspan="2"><%= number_with_precision(r.payment_amount, :precision => 2, :delimiter => ',') rescue ' '%>
</td>
</tr>
@@ -171,12 +171,12 @@
<i class="fa fa-arrow-left fa-lg"></i> Back
</a>
<a href="<%= transactions_sales_path%>" style="margin-top: 10px " class="btn btn-primary pull-right btn-lg">
<!-- <a href="<%= transactions_void_path(@sale)%>" style="margin-top: 10px " class="btn btn-primary pull-right btn-lg">
<i class="fa fa-trash fa-lg"></i> Void Sale
</a>
<a href="<%= transactions_sales_path%>" style="margin-top: 10px " class="btn btn-primary pull-right btn-lg">
<a href="<%= transactions_manual_void_sale_path(@sale)%>" style="margin-top: 10px " class="btn btn-primary pull-right btn-lg">
<i class="fa fa-invoice fa-lg"></i> Complete Sale
</a>
</a> -->
</div>
</div>

View File

@@ -1,112 +0,0 @@
<div class="row">
<div class="col-lg-12">
<ol class="breadcrumb">
<li><a href="<%= crm_root_path %>">Home</a></li>
<li class="active">
<a href="<%= transactions_sales_path %>">Sale</a>
</li>
<li class="active">
<a href="<%= transactions_sales_path %>"><%= @sale.sale_id %></a>
</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="main-box-body clearfix">
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<td colspan="4">
</td>
<td>
</td>
</tr>
<tr>
<td colspan="6">&nbsp;</td>
</tr>
<tr>
<th>Receipt Date </th>
<th>Receipt no</th>
<th>Cashier</th>
<th>Sales status</th>
<th>Receipt generated at</th>
</tr>
</thead>
<tbody>
<tr>
<td><%= @sale.receipt_date.strftime("%d-%M-%Y") %></td>
<td><%= @sale.receipt_no %></td>
<td><%= @sale.cashier rescue '-' %></td>
<td> <%= @sale.sale_status %> </td>
<td> <%= @sale.requested_at.strftime("%d-%m-%Y") %> </td>
</tr>
<tr style="border-top:2px solid #000">
<th>Sale item name</th>
<th> Qty</th>
<th>Unit price</th>
<th>Total pirce </th>
<th>Created at</th>
</tr>
<% @sale.sale_items.each do |s| %>
<tr>
<td><%=s.product_name rescue ' '%></td>
<td><%=s.qty rescue ' '%></td>
<td><%= number_with_precision(s.price, :precision => 2, :delimiter => ',') rescue ' '%></td>
<td><%= number_with_precision(s.qty * s.price, :precision => 2, :delimiter => ',') rescue ' '%></td>
<td><%=l s.created_at.utc.getlocal , :format => :short rescue ' ' %></td>
</tr>
<% end %>
<tr style="border-top:2px solid #000">
<td colspan=2 style="text-align:center"></td>
<td>Total</td>
<td colspan="2"><%= number_with_precision(@sale.total_amount, :precision => 2, :delimiter => ',') rescue ' '%></td>
</tr>
<tr>
<td colspan=2 style="text-align:center"></td>
<td>Discount</td>
<td colspan="2"><%= number_with_precision(@sale.total_discount, :precision => 2, :delimiter => ',') rescue ' '%></td>
</tr>
<tr>
<td colspan=2 style="text-align:center"></td>
<td>Tax</td>
<td colspan="2"><%= number_with_precision(@sale.total_tax, :precision => 2, :delimiter => ',') rescue ' '%></td>
</tr>
<tr>
<td colspan=2 style="text-align:center"></td>
<td>Grand Total</td>
<td colspan="2"><%= number_with_precision(@sale.grand_total, :precision => 2, :delimiter => ',') rescue ' '%></td>
</tr>
<tr><td>&nbsp;<td></tr>
<tr>
<td colspan=2 style="text-align:center"></td>
<td>Pay Amount</td>
<td colspan="2"><%= number_with_precision(@sale.amount_received, :precision => 2, :delimiter => ',') rescue ' '%></td>
</tr>
<tr>
<td colspan=2 style="text-align:center"></td>
<td>Change</td>
<td colspan="2"><%= number_with_precision(@sale.amount_changed, :precision => 2, :delimiter => ',') rescue ' '%></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,59 @@
<div class="row">
<div class="col-lg-12">
<ol class="breadcrumb">
<li><a href="<%= crm_root_path %>">Home</a></li>
<li class="active">
<a href="<%= transactions_sales_path %>">Sale</a>
</li>
<li class="active">
<a href="<%= transactions_sale_path(@sale) %>"><%= %></a>
</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-lg-10 col-md-10 col-sm-10">
<div class="tab-content" style="min-height:670px; max-height:670px; overflow-y:scroll">
<div class="tab-pane active" id="queue" role="tabpanel" style="min-height:670px; max-height:670px; overflow-y:">
<h3>Choose your reason</h3>
<table>
<tr>
<td>
<div class="checkbox checkbox-primary">
<input id="checkbox" class="styled checkbox-primary" type="checkbox" checked="">
<label for="checkbox">
Primary
</label>
</div>
</td>
<td>
</td>
<td>&nbsp;</td>
</tr>
</table>
</div>
</div>
</div>
<div class="col-lg-2 col-md-2 col-sm-2">
<a href="<%= transactions_sale_path(@sale)%>" style="margin-top: 10px " class="btn btn-primary pull-right btn-lg">
<i class="fa fa-arrow-left fa-lg"></i> Back
</a>
</div>
</div>