update shift sale detail
This commit is contained in:
105
app/views/transactions/shift_sales/index.html.erb
Executable file
105
app/views/transactions/shift_sales/index.html.erb
Executable file
@@ -0,0 +1,105 @@
|
||||
<div class="page-header">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
|
||||
<li class="breadcrumb-item active"><%= t :shiftsale %></li>
|
||||
<span class="float-right">
|
||||
<%= link_to 'Back', dashboard_path %>
|
||||
</span>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
||||
<div class="main-box-body clearfix p-l-5 p-r-5">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td colspan="8">
|
||||
<%= form_tag transactions_shift_sales_path, :method => :get do %>
|
||||
<div class="row clearfix">
|
||||
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4">
|
||||
<label><%= t("views.right_panel.detail.enter_keyboards") %></label>
|
||||
<input type="text" name="receipt_no" class="form-control" placeholder="" style="margin-right: 10px">
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
|
||||
<label class=""><%= t("views.right_panel.detail.from") %></label>
|
||||
<input class="form-control datepicker" name="from" id="from date" type="text" placeholder="From date">
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
|
||||
<label class=""><%= t("views.right_panel.detail.to") %></label>
|
||||
<input class="form-control datepicker" name="to" id="to date" type="text" placeholder="To date">
|
||||
</div>
|
||||
|
||||
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1">
|
||||
<label></label>
|
||||
<br><input type="submit" value="Search" class='btn btn-primary btn-md'>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-striped table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Cashier Name</th>
|
||||
<th>Cashier Terminal </th>
|
||||
<th>Opening Time </th>
|
||||
<th>Closing Time </th>
|
||||
<th>Opening float </th>
|
||||
<th>Closing Amount </th>
|
||||
<th>Cast In </th>
|
||||
<th>Cast Out </th>
|
||||
<th>Total Receipt </th>
|
||||
<th>Dining Count </th>
|
||||
<th>Takeaway Count </th>
|
||||
<th>Total Void</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% if @shift_sales != 0 %>
|
||||
<% @shift_sales.each do |shift_sale| %>
|
||||
<tr>
|
||||
<td><%= shift_sale.employee.name%></td>
|
||||
<td><%=shift_sale.cashier_terminal.name%></td>
|
||||
<td><%= shift_sale.shift_started_at.utc.getlocal.strftime('%d-%m-%Y %I:%M %p') %>
|
||||
</td>
|
||||
<td><%= shift_sale.shift_started_at.utc.getlocal.strftime('%d-%m-%Y %I:%M %p') rescue '-' %>
|
||||
</td>
|
||||
<td><%=shift_sale.opening_balance %></td>
|
||||
<td><%=shift_sale.closing_balance %></td>
|
||||
<td><%=shift_sale.cash_in %></td>
|
||||
<td><%=shift_sale.cash_out %></td>
|
||||
<th><%= shift_sale.total_receipt %></th>
|
||||
<th><%= shift_sale.dining_count %></th>
|
||||
<th><%= shift_sale.takeaway_count %></th>
|
||||
<th>(<%= shift_sale.total_void.round(2) %>)</th>
|
||||
<td><%= link_to t("views.btn.show"), transactions_shift_sale_path(shift_sale),:class => 'btn btn-info btn-sm waves-effect' %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<tr><td colspan="8"><strong><p style="text-align: center">There is no data for search....</p></strong></td></tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<br>
|
||||
<% if @shift_sales != 0 %>
|
||||
<%= paginate @shift_sales %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
1
app/views/transactions/shift_sales/index.json.jbuilder
Executable file
1
app/views/transactions/shift_sales/index.json.jbuilder
Executable file
@@ -0,0 +1 @@
|
||||
json.array! @transactions_sales, partial: 'transactions_sales/transactions_sale', as: :transactions_sale
|
||||
59
app/views/transactions/shift_sales/indexback.html.erb
Executable file
59
app/views/transactions/shift_sales/indexback.html.erb
Executable file
@@ -0,0 +1,59 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<h1><%= t("views.right_panel.header.transactions_sales") %></h1>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%= t :cashier %></th>
|
||||
<th><%= t :cashier %> <%= t("views.right_panel.detail.name_txt2") %></th>
|
||||
<th><%= t("views.right_panel.detail.requested_by") %></th>
|
||||
<th><%= t("views.right_panel.detail.requested_at") %></th>
|
||||
<th><%= t("views.right_panel.detail.receipt_no") %></th>
|
||||
<th><%= t("views.right_panel.detail.receipt_date") %></th>
|
||||
<th><%= t :customer %></th>
|
||||
<th><%= t("views.right_panel.detail.payment_status") %></th>
|
||||
<th><%= t("views.right_panel.detail.sale_status") %></th>
|
||||
<th><%= t("views.right_panel.detail.total_amount") %></th>
|
||||
<th><%= t("views.right_panel.detail.total_discount") %></th>
|
||||
<th><%= t("views.right_panel.detail.total_tax") %></th>
|
||||
<th><%= t("views.right_panel.detail.tax_type") %></th>
|
||||
<th><%= t("views.right_panel.detail.grand_total") %></th>
|
||||
<th><%= t("views.right_panel.detail.rnd_adj") %></th>
|
||||
<th><%= t("views.right_panel.detail.amt_received") %></th>
|
||||
<th><%= t("views.right_panel.detail.amt_changed") %></th>
|
||||
<th colspan="3"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% @transactions_sales.each do |transactions_sale| %>
|
||||
<tr>
|
||||
<td><%= transactions_sale.cashier %></td>
|
||||
<td><%= transactions_sale.cashier_name %></td>
|
||||
<td><%= transactions_sale.requested_by %></td>
|
||||
<td><%= transactions_sale.requested_at %></td>
|
||||
<td><%= transactions_sale.receipt_no %></td>
|
||||
<td><%= transactions_sale.receipt_date %></td>
|
||||
<td><%= transactions_sale.customer %></td>
|
||||
<td><%= transactions_sale.payment_status %></td>
|
||||
<td><%= transactions_sale.sale_status %></td>
|
||||
<td><%= transactions_sale.total_amount %></td>
|
||||
<td><%= transactions_sale.total_discount %></td>
|
||||
<td><%= transactions_sale.total_tax %></td>
|
||||
<td><%= transactions_sale.tax_type %></td>
|
||||
<td><%= transactions_sale.grand_total %></td>
|
||||
<td><%= transactions_sale.rounding_adjustment %></td>
|
||||
<td><%= transactions_sale.amount_received %></td>
|
||||
<td><%= transactions_sale.amount_changed %></td>
|
||||
<td><%= link_to t("views.btn.show"), transactions_sale %></td>
|
||||
<td><%= link_to t("views.btn.edit"), edit_transactions_sale_path(transactions_sale) %></td>
|
||||
<td><%= link_to t("views.btn.delete"), transactions_sale, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
|
||||
<%= link_to 'New Transactions Sale', new_transactions_sale_path %>
|
||||
196
app/views/transactions/shift_sales/show.html.erb
Executable file
196
app/views/transactions/shift_sales/show.html.erb
Executable file
@@ -0,0 +1,196 @@
|
||||
<div class="page-header">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
|
||||
<li class="breadcrumb-item"><a href="<%= transactions_shift_sales_path %>"><%= t :shiftsale %></a></li>
|
||||
<li class="breadcrumb-item active"><%= t :details %></li>
|
||||
<span class="float-right">
|
||||
<%= link_to 'Back', transactions_shift_sales_path %>
|
||||
</span>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
||||
<div class="main-box-body clearfix p-l-5 p-r-5">
|
||||
<div class="card">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-striped table-hover">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Cashier </th>
|
||||
<th>Cashier Terminal </th>
|
||||
<th>Opening Date </th>
|
||||
<th>Opening float </th>
|
||||
<th>Received Amount </th>
|
||||
<th>Cast In </th>
|
||||
<th>Cast Out </th>
|
||||
<th>Total Receipt </th>
|
||||
<th>Dining Count </th>
|
||||
<th>Takeaway Count </th>
|
||||
<th>Total Void</th>
|
||||
</tr>
|
||||
<tr style="border-bottom:2px solid #000">
|
||||
<td><%= @shift.employee.name%></td>
|
||||
<td><%=@shift.cashier_terminal.name%></td>
|
||||
<td><%= @shift.shift_started_at.utc.getlocal.strftime('%d-%m-%Y %I:%M %p') %>
|
||||
</td>
|
||||
<td><%=@shift.opening_balance %></td>
|
||||
<td><%=@shift.closing_balance %></td>
|
||||
<td><%=@shift.cash_in %></td>
|
||||
<td><%=@shift.cash_out %></td>
|
||||
<th><%= @shift.total_receipt %></th>
|
||||
<th><%= @shift.dining_count %></th>
|
||||
<th><%= @shift.takeaway_count %></th>
|
||||
<th>(<%= @shift.total_void.round(2) %>)</th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="5">
|
||||
<table width="100%">
|
||||
<% @total_amount_by_account.each do |amount| %>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td style="text-align: right;"> Total <%= amount.account_name %> Amount</td>
|
||||
<td><%= amount.total_price.round(2) %></td>
|
||||
</tr>
|
||||
<%end%>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th style="text-align: right;"> Net Sales</th>
|
||||
<th><%=@shift.nett_sales %></th>
|
||||
</tr>
|
||||
|
||||
<% @total_discount_by_account.each do |amount| %>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td style="text-align: right;"> Total <%= amount.account_name %> Discount</td>
|
||||
<td><%= amount.total_price.round(2) %></td>
|
||||
</tr>
|
||||
<%end%>
|
||||
|
||||
<% if !@total_member_discount[0].member_discount.nil?
|
||||
@member_discount = @total_member_discount[0].member_discount rescue 0.0
|
||||
@overall = @shift.total_discounts - @member_discount
|
||||
%>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th style="text-align: right;"> Total Member Discount</th>
|
||||
<th><%= @member_discount %></th>
|
||||
</tr>
|
||||
<%else @overall = @shift.total_discounts %>
|
||||
|
||||
<%end%>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th style="text-align: right;"> Total Overall Discount</th>
|
||||
<th><%= @overall %></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th style="text-align: right;"> Total Discount</th>
|
||||
<th><%= @shift.total_discounts %></th>
|
||||
</tr>
|
||||
|
||||
<% @sale_taxes.each do |tax| %>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td style="text-align: right;"> <%= tax.tax_name %> </td>
|
||||
<td><%= tax.st_amount.round(2) %></td>
|
||||
</tr>
|
||||
<%end%>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th style="text-align: right;"> Total Tax </th>
|
||||
<th><%=@shift.total_taxes %></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th style="text-align: right;"> Rounding Adj </th>
|
||||
<th><%= @shift.total_rounding.round(2) %></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th style="text-align: right;"> Grand Total </th>
|
||||
<th><%= @shift.grand_total.round(2) %></th>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td colspan="6">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<th></th>
|
||||
<th style="text-align: right;">Cash Payment </th>
|
||||
<th><%=@shift.cash_sales %></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th style="text-align: right;">Credit Payment </th>
|
||||
<th><%=@shift.credit_sales %></th>
|
||||
</tr>
|
||||
<% @total_amount = 0
|
||||
|
||||
@other_payment.each do |other| %>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th style="text-align: right;">Other Payment Detail </th>
|
||||
<th></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td style="text-align: right;">MPU Payment </td>
|
||||
<td><%=other.mpu_amount.round(2) rescue 0.0 %></td>
|
||||
<% @total_amount = @total_amount+other.mpu_amount rescue 0.0 %>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td style="text-align: right;">VISA Payment </td>
|
||||
<td><%=other.visa_amount.round(2) rescue 0.0 %></td>
|
||||
<% @total_amount = @total_amount+other.visa_amount rescue 0.0 %>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td style="text-align: right;">JCB Payment </td>
|
||||
<td><%=other.master_amount.round(2) rescue 0.0 %></td>
|
||||
<% @total_amount = @total_amount+other.master_amount rescue 0.0 %>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td style="text-align: right;">Master Payment </td>
|
||||
<td><%=other.jcb_amount.round(2) rescue 0.0 %></td>
|
||||
<% @total_amount = @total_amount+other.jcb_amount rescue 0.0 %>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td style="text-align: right;">Reedem Payment </td>
|
||||
<td><%=other.paypar_amount.round(2) rescue 0.0 %></td>
|
||||
<% @total_amount = @total_amount+other.paypar_amount rescue 0.0 %>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td style="text-align: right;"><strong>FOC </strong></td>
|
||||
<td><%=other.foc_amount.round(2) rescue 0.0 %></td>
|
||||
<% @total_amount = @total_amount+other.foc_amount rescue 0.0 %>
|
||||
</tr>
|
||||
<%end%>
|
||||
|
||||
<tr>
|
||||
<th></th>
|
||||
<th style="text-align: right;">Total Other Payment </th>
|
||||
<th><%=@shift.other_sales %></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th style="text-align: right;">Total Payment </th>
|
||||
<th><%= @total_amount+@shift.cash_sales+@shift.credit_sales %></th>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
1
app/views/transactions/shift_sales/show.json.jbuilder
Executable file
1
app/views/transactions/shift_sales/show.json.jbuilder
Executable file
@@ -0,0 +1 @@
|
||||
json.partial! "transactions_sales/transactions_sale", transactions_sale: @transactions_sale
|
||||
Reference in New Issue
Block a user