finished order and sales in setting
This commit is contained in:
68
app/views/settings/orders/index.html.erb
Normal file
68
app/views/settings/orders/index.html.erb
Normal file
@@ -0,0 +1,68 @@
|
||||
<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="<%= settings_orders_path %>">Order</a>
|
||||
</li>
|
||||
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
<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="6">
|
||||
<%= form_tag settings_orders_path, :method => :get do %>
|
||||
<div class="input-append form-group pull-right">
|
||||
<input type="text" name="filter" placeholder="Order ID" class="form-control input-sm col-md-8">
|
||||
<button type="submit" class="btn btn-primary btn-sm">Search</button>
|
||||
</div>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Order ID </th>
|
||||
<th>Type</th>
|
||||
<th>Customer</th>
|
||||
<th>Order status</th>
|
||||
<th>Order date</th>
|
||||
<th>Items Count</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% @orders.each do |order| %>
|
||||
|
||||
<tr>
|
||||
<td><%= order.order_id %></td>
|
||||
<td><%= order.order_type %></td>
|
||||
<td><%= order.customer.name rescue '-' %></td>
|
||||
<td><%= order.status %></td>
|
||||
<td> <%= order.date.strftime("%d-%m-%Y") %> </td>
|
||||
<td> <%= order.item_count %> </td>
|
||||
<td><%= link_to 'Show', settings_order_path(order) %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<br>
|
||||
|
||||
<%= paginate @orders %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
85
app/views/settings/orders/show.html.erb
Normal file
85
app/views/settings/orders/show.html.erb
Normal file
@@ -0,0 +1,85 @@
|
||||
<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="<%= settings_orders_path %>">Order</a>
|
||||
</li>
|
||||
<li class="active">
|
||||
<a href="<%= settings_orders_path %>"><%= @order.order_id %></a>
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
<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>
|
||||
<th>Type</th>
|
||||
<th>Customer</th>
|
||||
<th>Order status</th>
|
||||
<th>Order date</th>
|
||||
<th>Order By</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><%= @order.order_type %></td>
|
||||
<td><%= @order.customer.name rescue '-' %></td>
|
||||
<td><%= @order.status %></td>
|
||||
<td> <%= @order.date.strftime("%d-%m-%Y") %> </td>
|
||||
<td> <%= @order.waiter rescue '-' %> </td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3>Order Items</h3>
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Item Name</th>
|
||||
<th>Qty</th>
|
||||
<th> Unit Price</th>
|
||||
<th>Total Price</th>
|
||||
<th>Option</th>
|
||||
<th>Status</th>
|
||||
<th>Order By</th>
|
||||
<th>Created at</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% @order.order_items.each do |order| %>
|
||||
|
||||
<tr>
|
||||
<td><%= order.item_name %></td>
|
||||
<td><%= order.qty %></td>
|
||||
<td><%= order.price %></td>
|
||||
<td><%= order.qty * order.price %></td>
|
||||
<td> <%= order.options %> </td>
|
||||
<td> <%= order.order_item_status %> </td>
|
||||
<td> <%= order.item_order_by %> </td>
|
||||
<td> <%= order.created_at.strftime("%d-%m-%Y") %> </td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<a href="<%= settings_orders_path%>" class="btn btn-primary pull-left">
|
||||
<i class="fa fa-arrow-left fa-xs"></i> Back
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
85
app/views/settings/sales/index.html.erb
Normal file
85
app/views/settings/sales/index.html.erb
Normal file
@@ -0,0 +1,85 @@
|
||||
<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="<%= settings_sales_path %>">Sale</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="8">
|
||||
<%= form_tag settings_sales_path, :method => :get do %>
|
||||
<div class="input-append form-group pull-right">
|
||||
<input data-behaviour='datepicker' class="datepicker col-md-3 form-control" name="date" id="date" type="text" placeholder="Search by date" style="margin-right: 10px">
|
||||
|
||||
<input type="text" name="receipt_no" class="col-md-4 form-control" placeholder="Receipt No" style="margin-right: 10px">
|
||||
<button type="submit" class="btn btn-primary btn">Search</button>
|
||||
</div>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Sale Id </th>
|
||||
<th>Receipt no </th>
|
||||
<th>Grand total</th>
|
||||
<th>Tax amount</th>
|
||||
<th>Cashier</th>
|
||||
<th>Sales status</th>
|
||||
<th>Receipt Date</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% @sales.each do |sale| %>
|
||||
|
||||
<tr>
|
||||
<td><%= sale.sale_id %></td>
|
||||
<td><%= sale.receipt_no %></td>
|
||||
<td><%= sale.grand_total rescue '-' %></td>
|
||||
<td><%= sale.total_tax %></td>
|
||||
<td><%= sale.cashier_name rescue '-' %></td>
|
||||
<td> <%= sale.sale_status %> </td>
|
||||
<td> <%= sale.receipt_date.strftime("%d-%m-%Y") %> </td>
|
||||
<td><%= link_to 'Show', settings_sale_path(sale) %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<br>
|
||||
|
||||
<%= paginate @sales %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
if (jQuery().datepicker) {
|
||||
$('.datepicker').datepicker({
|
||||
format : 'dd-mm-yyyy',
|
||||
autoclose: true
|
||||
});
|
||||
$('.datepicker').attr('ReadOnly','true');
|
||||
$('.datepicker').css('cursor','pointer');
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
103
app/views/settings/sales/show.html.erb
Normal file
103
app/views/settings/sales/show.html.erb
Normal file
@@ -0,0 +1,103 @@
|
||||
<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="<%= settings_sales_path %>">Sale</a>
|
||||
</li>
|
||||
<li class="active">
|
||||
<a href="<%= settings_sales_path %>"><%= @sale.sale_id %></a>
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
<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>
|
||||
<th>Receipt Date </th>
|
||||
<th>Receipt no</th>
|
||||
<th>Cashier</th>
|
||||
<th>OSales 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>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>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>Grand Total</td>
|
||||
<td colspan="2"><%= number_with_precision(@sale.grand_total, :precision => 2, :delimiter => ',') rescue ' '%></td>
|
||||
</tr>
|
||||
<tr><td> <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>
|
||||
|
||||
<a href="<%= settings_sales_path%>" class="btn btn-primary pull-left">
|
||||
<i class="fa fa-arrow-left fa-xs"></i> Back
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user