update ui desige for sx theme
This commit is contained in:
@@ -45,3 +45,5 @@ function export_to(path)
|
||||
var form_params = $("#frm_report").serialize();
|
||||
window.location = path+"?"+ form_params;
|
||||
}
|
||||
|
||||
|
||||
|
||||
5
app/assets/javascripts/popper.min.js
vendored
Normal file
5
app/assets/javascripts/popper.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
172
app/assets/stylesheets/sx-sidebar.css
Normal file
172
app/assets/stylesheets/sx-sidebar.css
Normal file
@@ -0,0 +1,172 @@
|
||||
/*!
|
||||
* Start Bootstrap - Simple Sidebar (http://startbootstrap.com/template-overviews/simple-sidebar)
|
||||
* Copyright 2013-2017 Start Bootstrap
|
||||
* Licensed under MIT (https://github.com/BlackrockDigital/startbootstrap-simple-sidebar/blob/master/LICENSE)
|
||||
*/
|
||||
|
||||
#wrapper {
|
||||
padding-left: 0;
|
||||
-webkit-transition: all 0.5s ease;
|
||||
-moz-transition: all 0.5s ease;
|
||||
-o-transition: all 0.5s ease;
|
||||
transition: all 0.5s ease;
|
||||
}
|
||||
|
||||
#wrapper.toggled {
|
||||
padding-left: 200px;
|
||||
}
|
||||
|
||||
#sidebar-wrapper {
|
||||
/* z-index: 1000;*/
|
||||
/*position: fixed;*/
|
||||
z-index: 1;
|
||||
position: absolute;
|
||||
left: 200px;
|
||||
width: 0;
|
||||
height: 100%;
|
||||
margin-left: -200px;
|
||||
margin-top:-20px;
|
||||
overflow-x: auto;
|
||||
background: #222d32;
|
||||
-webkit-transition: all 0.5s ease;
|
||||
-moz-transition: all 0.5s ease;
|
||||
-o-transition: all 0.5s ease;
|
||||
transition: all 0.5s ease;
|
||||
}
|
||||
|
||||
#wrapper.toggled #sidebar-wrapper {
|
||||
width: 216px;
|
||||
}
|
||||
|
||||
#page-content-wrapper {
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
padding: 0px;
|
||||
|
||||
}
|
||||
|
||||
#wrapper.toggled #page-content-wrapper {
|
||||
position: absolute;
|
||||
margin-right: -200px;
|
||||
}
|
||||
|
||||
|
||||
/* Sidebar Styles */
|
||||
|
||||
.sidebar-nav {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
width: 200px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.sidebar-nav li {
|
||||
text-indent: 20px;
|
||||
line-height: 40px;
|
||||
}
|
||||
.sidebar-nav>li.header {
|
||||
color: #4b646f;
|
||||
background-color: #1a2226;
|
||||
line-height: 35px !important;
|
||||
}
|
||||
.main-nav {
|
||||
|
||||
/* background-color: #161926 !important;*/
|
||||
}
|
||||
/*.main-nav a {
|
||||
color: #fff !important;
|
||||
}
|
||||
*/
|
||||
.sidebar-nav li a {
|
||||
display: block;
|
||||
text-decoration: none;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.sidebar-nav li a:hover {
|
||||
text-decoration: none;
|
||||
color: #fff;
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
|
||||
.sidebar-nav li a:active,
|
||||
.sidebar-nav li a:focus {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.sidebar-nav > .sidebar-brand {
|
||||
height: 65px;
|
||||
font-size: 18px;
|
||||
line-height: 60px;
|
||||
}
|
||||
|
||||
.sidebar-nav > .sidebar-brand a {
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.sidebar-nav > .sidebar-brand a:hover {
|
||||
color: #fff;
|
||||
background: none;
|
||||
}
|
||||
|
||||
@media(min-width:768px) {
|
||||
#wrapper {
|
||||
padding-left: 0;
|
||||
}
|
||||
#wrapper.toggled {
|
||||
padding-left: 210px;
|
||||
}
|
||||
#sidebar-wrapper {
|
||||
width: 0;
|
||||
}
|
||||
#wrapper.toggled #sidebar-wrapper {
|
||||
width: 216px;
|
||||
}
|
||||
#page-content-wrapper {
|
||||
padding: 0px;
|
||||
position: relative;
|
||||
}
|
||||
#wrapper.toggled #page-content-wrapper {
|
||||
position: relative;
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.dropdown-item{
|
||||
padding: 0px 1.5rem !important;
|
||||
}
|
||||
|
||||
.sidebar-sub-menu {
|
||||
position: relative !important;
|
||||
width: 200px;
|
||||
list-style: none;
|
||||
font-size: 14px;
|
||||
background-color: #161926;
|
||||
padding: 0px !important;
|
||||
margin: 0px !important;
|
||||
}
|
||||
|
||||
.sidebar-sub-item {
|
||||
display: block;
|
||||
width: 100%;
|
||||
|
||||
/*clear: both;*/
|
||||
/*font-weight: normal;*/
|
||||
/*color: #292b2c;
|
||||
text-align: inherit;
|
||||
white-space: nowrap;
|
||||
background: none;
|
||||
border: 0;*/
|
||||
}
|
||||
.fa{
|
||||
|
||||
}
|
||||
.custom-fa-arrow{
|
||||
font-size: 20px !important;
|
||||
font-weight: bold;
|
||||
padding: 9px 20px;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,195 +1,192 @@
|
||||
<div class="row">
|
||||
<div class="col-md-9 col-lg-9">
|
||||
<h4><strong>Role Features</strong></h4>
|
||||
<!-- <p><strong>Note:</strong> The <strong>data-parent</strong> attribute makes sure that all collapsible elements under the specified parent will be closed when one of the collapsible item is shown.</p> -->
|
||||
<div class="panel-group" id="accordion">
|
||||
<% if current_user.role == 'administrator' %>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
Administrator
|
||||
</h4>
|
||||
</div>
|
||||
<div id="admin" class="panel-collapse collapse in">
|
||||
<div class="panel-body">
|
||||
<ul class="col-md-4">
|
||||
<li><strong>All Settings</strong></li>
|
||||
<ul>
|
||||
<li>Zone</li>
|
||||
<li>OQS</li>
|
||||
<li>Menu</li>
|
||||
<li>Cashier Terminal</li>
|
||||
<li>Payment</li>
|
||||
<li>Merbership</li>
|
||||
<li>Print</li>
|
||||
<li>Employees</li>
|
||||
<li>Accounts</li>
|
||||
</ul>
|
||||
</ul>
|
||||
<ul class="col-md-4">
|
||||
<li><strong>Transactions</strong></li>
|
||||
<ul class="">
|
||||
<li>Order</li>
|
||||
<li>Sale</li>
|
||||
<li>Credit Note</li>
|
||||
</ul><br>
|
||||
<li><strong>Reports</strong></li>
|
||||
<ul class="">
|
||||
<li>Daily Sale</li>
|
||||
<li>Sale Item</li>
|
||||
<li>Receipt</li>
|
||||
<li>Shift Sale</li>
|
||||
<li>Credit Sale</li>
|
||||
<li>Void Sale</li>
|
||||
</ul>
|
||||
</ul>
|
||||
<ul class="col-md-4">
|
||||
<li><strong>OQS</strong></li><br>
|
||||
<li><strong>Cashier</strong></li><br>
|
||||
<li><strong>CRM</strong></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Page Content -->
|
||||
<div class="row">
|
||||
<div class="col-md-9 col-lg-9">
|
||||
<h4><strong>Role Features</strong></h4>
|
||||
<!-- <p><strong>Note:</strong> The <strong>data-parent</strong> attribute makes sure that all collapsible elements under the specified parent will be closed when one of the collapsible item is shown.</p> -->
|
||||
<div class="panel-group" id="accordion">
|
||||
<% if current_user.role == 'administrator' %>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
Administrator
|
||||
</h4>
|
||||
</div>
|
||||
<% elsif current_user.role == 'manager' %>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
Manager
|
||||
</h4>
|
||||
</div>
|
||||
<div id="admin" class="panel-collapse collapse in">
|
||||
<div class="panel-body">
|
||||
<ul class="col-md-4">
|
||||
<li class="">All Settings</li>
|
||||
<ul class="">
|
||||
<li>Zone</li>
|
||||
<li>OQS</li>
|
||||
<li>Menu</li>
|
||||
<li>Cashier Terminal</li>
|
||||
<li>Print</li>
|
||||
<li>Employees</li>
|
||||
<li>Accounts</li>
|
||||
</ul>
|
||||
</ul>
|
||||
<ul class="col-md-4">
|
||||
<li class="">Transactions</li>
|
||||
<ul class="">
|
||||
<li>Order</li>
|
||||
<li>Sale</li>
|
||||
<li>Credit Note</li>
|
||||
</ul><br>
|
||||
<li>Reports</li>
|
||||
<ul class="">
|
||||
<li>Daily Sale</li>
|
||||
<li>Sale Item</li>
|
||||
<li>Receipt</li>
|
||||
<li>Shift Sale</li>
|
||||
<li>Credit Sale</li>
|
||||
<li>Void Sale</li>
|
||||
</ul>
|
||||
</ul>
|
||||
<ul class="col-md-4">
|
||||
<li>OQS</li><br>
|
||||
<li>Cashier</li><br>
|
||||
<li>CRM</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% elsif current_user.role == 'supervisour' %>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
Supervisor
|
||||
</h4>
|
||||
</div>
|
||||
<div id="supervisor" class="panel-collapse collapse in">
|
||||
<div class="panel-body">
|
||||
<ul class="">
|
||||
<div id="admin" class="panel-collapse collapse in">
|
||||
<div class="panel-body">
|
||||
<ul class="col-md-4">
|
||||
<li><strong>All Settings</strong></li>
|
||||
<ul>
|
||||
<li>Zone</li>
|
||||
<li>OQS</li>
|
||||
<ul>
|
||||
<li class="">Void</li>
|
||||
<li class="">FOC</li>
|
||||
<li class="">Edit</li>
|
||||
<li class="">Credit</li>
|
||||
<li class="">Payment</li>
|
||||
</ul>
|
||||
<li>Menu</li>
|
||||
<li>Cashier Terminal</li>
|
||||
<li>Payment</li>
|
||||
<li>Merbership</li>
|
||||
<li>Print</li>
|
||||
<li>Employees</li>
|
||||
<li>Accounts</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% elsif current_user.role == 'cashier' %>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
Cashier
|
||||
</h4>
|
||||
</div>
|
||||
<div id="cashier" class="panel-collapse collapse in">
|
||||
<div class="panel-body">
|
||||
</ul>
|
||||
<ul class="col-md-4">
|
||||
<li><strong>Transactions</strong></li>
|
||||
<ul class="">
|
||||
<li class="">Cashier Panel except Edit and Void</li>
|
||||
<li class="">Sale and Order</li>
|
||||
<li class="">and Queue in CRM</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% elsif current_user.role == 'account' %>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
Accountant
|
||||
</h4>
|
||||
</div>
|
||||
<div id="accountant" class="panel-collapse collapse in">
|
||||
<div class="panel-body">
|
||||
<li>Order</li>
|
||||
<li>Sale</li>
|
||||
<li>Credit Note</li>
|
||||
</ul><br>
|
||||
<li><strong>Reports</strong></li>
|
||||
<ul class="">
|
||||
<li class="">Daily Sale Report</li>
|
||||
<li class="">Sale Item Report</li>
|
||||
<li class="">Receipt No Report</li>
|
||||
<li class="">ShiftSale Report</li>
|
||||
<li>Daily Sale</li>
|
||||
<li>Sale Item</li>
|
||||
<li>Receipt</li>
|
||||
<li>Shift Sale</li>
|
||||
<li>Credit Sale</li>
|
||||
<li>Void Sale</li>
|
||||
</ul>
|
||||
</div>
|
||||
</ul>
|
||||
<ul class="col-md-4">
|
||||
<li><strong>OQS</strong></li><br>
|
||||
<li><strong>Cashier</strong></li><br>
|
||||
<li><strong>CRM</strong></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="card" id="oqs" onclick="location.href='<%= oqs_root_path %>'">
|
||||
<div class="card-content dashboard-nav">OQS</div>
|
||||
</div>
|
||||
|
||||
<div class="card" id="origami" onclick="location.href='<%= origami_root_path %>'">
|
||||
<div class="card-content dashboard-nav">Cashier</div>
|
||||
</div>
|
||||
|
||||
<div class="card" id="crm" onclick="location.href='<%= crm_root_path %>'">
|
||||
<div class="card-content dashboard-nav">CRM</div>
|
||||
</div>
|
||||
|
||||
<!-- No Needs
|
||||
<div class="card" id="backend" onclick="location.href='<%= dashboard_path %>'">
|
||||
<div class="card-content">
|
||||
<span class="card-title">Backend</span>
|
||||
</div>
|
||||
<% elsif current_user.role == 'manager' %>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
Manager
|
||||
</h4>
|
||||
</div>
|
||||
<div id="admin" class="panel-collapse collapse in">
|
||||
<div class="panel-body">
|
||||
<ul class="col-md-4">
|
||||
<li class="">All Settings</li>
|
||||
<ul class="">
|
||||
<li>Zone</li>
|
||||
<li>OQS</li>
|
||||
<li>Menu</li>
|
||||
<li>Cashier Terminal</li>
|
||||
<li>Print</li>
|
||||
<li>Employees</li>
|
||||
<li>Accounts</li>
|
||||
</ul>
|
||||
</ul>
|
||||
<ul class="col-md-4">
|
||||
<li class="">Transactions</li>
|
||||
<ul class="">
|
||||
<li>Order</li>
|
||||
<li>Sale</li>
|
||||
<li>Credit Note</li>
|
||||
</ul><br>
|
||||
<li>Reports</li>
|
||||
<ul class="">
|
||||
<li>Daily Sale</li>
|
||||
<li>Sale Item</li>
|
||||
<li>Receipt</li>
|
||||
<li>Shift Sale</li>
|
||||
<li>Credit Sale</li>
|
||||
<li>Void Sale</li>
|
||||
</ul>
|
||||
</ul>
|
||||
<ul class="col-md-4">
|
||||
<li>OQS</li><br>
|
||||
<li>Cashier</li><br>
|
||||
<li>CRM</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% elsif current_user.role == 'supervisour' %>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
Supervisor
|
||||
</h4>
|
||||
</div>
|
||||
<div id="supervisor" class="panel-collapse collapse in">
|
||||
<div class="panel-body">
|
||||
<ul class="">
|
||||
<li>OQS</li>
|
||||
<ul>
|
||||
<li class="">Void</li>
|
||||
<li class="">FOC</li>
|
||||
<li class="">Edit</li>
|
||||
<li class="">Credit</li>
|
||||
<li class="">Payment</li>
|
||||
</ul>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% elsif current_user.role == 'cashier' %>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
Cashier
|
||||
</h4>
|
||||
</div>
|
||||
<div id="cashier" class="panel-collapse collapse in">
|
||||
<div class="panel-body">
|
||||
<ul class="">
|
||||
<li class="">Cashier Panel except Edit and Void</li>
|
||||
<li class="">Sale and Order</li>
|
||||
<li class="">and Queue in CRM</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% elsif current_user.role == 'account' %>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
Accountant
|
||||
</h4>
|
||||
</div>
|
||||
<div id="accountant" class="panel-collapse collapse in">
|
||||
<div class="panel-body">
|
||||
<ul class="">
|
||||
<li class="">Daily Sale Report</li>
|
||||
<li class="">Sale Item Report</li>
|
||||
<li class="">Receipt No Report</li>
|
||||
<li class="">ShiftSale Report</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="card" id="backend" onclick="location.href='<%= inventory_path %>'">
|
||||
<div class="card-content dashboard-nav">Inventory</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="footer" style="background-color: inherit">
|
||||
<div class="card">
|
||||
<div class="page-header center-text">
|
||||
<h4 class="footer-header">
|
||||
<%= @shop.name %>
|
||||
</h4>
|
||||
<div class="col-md-3">
|
||||
<div class="card" id="oqs" onclick="location.href='<%= oqs_root_path %>'">
|
||||
<div class="card-content dashboard-nav">OQS</div>
|
||||
</div>
|
||||
|
||||
<div class="card" id="origami" onclick="location.href='<%= origami_root_path %>'">
|
||||
<div class="card-content dashboard-nav">Cashier</div>
|
||||
</div>
|
||||
|
||||
<div class="card" id="crm" onclick="location.href='<%= crm_root_path %>'">
|
||||
<div class="card-content dashboard-nav">CRM</div>
|
||||
</div>
|
||||
|
||||
<div class="card" id="backend" onclick="location.href='<%= inventory_path %>'">
|
||||
<div class="card-content dashboard-nav">Inventory</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="" style="background-color: inherit;">
|
||||
<div class="">
|
||||
<div class="page-header center-text">
|
||||
<h4 class="footer-header">
|
||||
<%= @shop.name %>
|
||||
</h4>
|
||||
</div>
|
||||
<div class="center-text">
|
||||
<%= @shop.address %>
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
|
||||
<nav class="navbar navbar-toggleable-md fixed-top navbar-light setting_nav">
|
||||
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="<%= root_path %>" style="color: rgba(67, 185, 220, 0.9)">E-menu</a>
|
||||
|
||||
<a href="#" class=" btn btn-info btn-sm " id="sx-menu-toggle" data-toggle="push-menu" role="button">
|
||||
<span class="fa fa-bars" ></span>
|
||||
</a>
|
||||
|
||||
<a class="navbar-brand" href="<%= dashboard_path %>" style="color: rgba(67, 185, 220, 0.9)">E-menu</a>
|
||||
|
||||
<div class="collapse navbar-collapse" id="navbarCollapse">
|
||||
<ul class="navbar-nav mr-auto">
|
||||
<!-- <ul class="navbar-nav mr-auto">
|
||||
<li class="navbar-nav mr-auto dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Settings</a>
|
||||
<ul class="dropdown-menu">
|
||||
@@ -70,8 +74,8 @@
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</ul> -->
|
||||
|
||||
</div>
|
||||
<% if current_login_employee %>
|
||||
<div class="right">
|
||||
@@ -94,3 +98,10 @@
|
||||
margin-bottom: 10px !important;
|
||||
}
|
||||
</style>
|
||||
<!-- Menu Toggle Script -->
|
||||
<script>
|
||||
$("#sx-menu-toggle").click(function(e) {
|
||||
e.preventDefault();
|
||||
$("#wrapper").toggleClass("toggled");
|
||||
});
|
||||
</script>
|
||||
85
app/views/layouts/_sidebar.html.erb
Normal file
85
app/views/layouts/_sidebar.html.erb
Normal file
@@ -0,0 +1,85 @@
|
||||
<div id="sidebar-wrapper">
|
||||
<ul class="sidebar-nav">
|
||||
<li class="header"><a>Main Navigation</a></li>
|
||||
<li>
|
||||
<%= link_to "Dashboard ", dashboard_path,:class =>"" %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to "OQS ", oqs_root_path,:class =>"" %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to "Cashier ", origami_root_path,:class =>"" %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to "CRM ", crm_customers_path,:class =>"" %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to "Inventory ", transactions_sales_path,:class =>"" %>
|
||||
</li>
|
||||
|
||||
<li class="header"><a>Settings</a></li>
|
||||
|
||||
<li>
|
||||
<%= link_to "Zones ", transactions_sales_path,:class =>"" %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to "Order Queue Station ", transactions_sales_path,:class =>"" %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to "Menu ", settings_menus_path,:class =>"" %>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<%= link_to "Cashier Terminal ", transactions_sales_path,:class =>"" %>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<%= link_to "Print Settings ", transactions_sales_path,:class =>"" %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to "Staff ", settings_menus_path,:class =>"" %>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<%= link_to "Product ", transactions_sales_path,:class =>"" %>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<%= link_to "Promotion ", transactions_sales_path,:class =>"" %>
|
||||
</li>
|
||||
<li>
|
||||
<div class="dropdown">
|
||||
<a class="custom-dropdown" href="#" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
Transaction <i class="fa fa-angle-left pull-right custom-fa-arrow"></i>
|
||||
</a>
|
||||
<div class="dropdown-menu sidebar-sub-menu" aria-labelledby="dropdownMenuButton">
|
||||
<%= link_to "Orders ", transactions_orders_path,:class =>"dropdown-item sidebar-sub-item" %>
|
||||
<%= link_to "Sales ", transactions_sales_path,:class =>"dropdown-item sidebar-sub-item" %>
|
||||
<%= link_to "Credit Note ", transactions_credit_notes_path,:class =>"dropdown-item sidebar-sub-item" %>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<!-- <li>
|
||||
<div class="dropdown">
|
||||
<a class="custom-dropdown" href="#" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" ariaroot_path-expanded="false">
|
||||
Transaction <i class="fa fa-angle-left pull-right custom-fa-arrow"></i>
|
||||
</a>
|
||||
<div class="dropdown-menu sidebar-sub-menu" aria-labelledby="dropdownMenuButton">
|
||||
<%= link_to "Daily Sale Report", reports_dailysale_index_path, :class =>"dropdown-item sidebar-sub-item" %>
|
||||
<%= link_to "Sales Item Report", reports_saleitem_index_path, :class =>"dropdown-item sidebar-sub-item" %>
|
||||
<%= link_to "Receipt Report", reports_receipt_no_index_path, :class =>"dropdown-item sidebar-sub-item" %>
|
||||
<%= link_to "Shift Sale Report", reports_shiftsale_index_path, :class =>"dropdown-item sidebar-sub-item" %>
|
||||
<%= link_to "Credit Sale Report", reports_credit_payment_index_path, :class =>"dropdown-item sidebar-sub-item" %>
|
||||
<%= link_to "Void Sale Report", reports_void_sale_index_path, :class =>"dropdown-item sidebar-sub-item" %>
|
||||
<%= link_to "Commission Report", reports_commission_index_path, :class =>"dropdown-item sidebar-sub-item" %>
|
||||
<%= link_to "Stock Check Report", reports_stock_check_index_path, :class =>"dropdown-item sidebar-sub-item" %>
|
||||
</div>
|
||||
</div>
|
||||
</li> -->
|
||||
|
||||
<li>
|
||||
<%= link_to "Reports", reports_dailysale_index_path, :class =>"" %>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
@@ -12,9 +12,11 @@
|
||||
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
|
||||
<%= stylesheet_link_tag 'settings', media: 'all', 'data-turbolinks-track': 'reload' %>
|
||||
<%= stylesheet_link_tag 'fileinput.min', media: 'all', 'data-turbolinks-track': 'reload' %>
|
||||
<%= stylesheet_link_tag 'sx-sidebar', media: 'all', 'data-turbolinks-track': 'reload' %>
|
||||
|
||||
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
|
||||
<%= javascript_include_tag 'fileinput.min', 'data-turbolinks-track': 'reload' %>
|
||||
<%= javascript_include_tag 'popper.min', 'data-turbolinks-track': 'reload' %>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@@ -35,7 +37,15 @@
|
||||
<%= message %>
|
||||
</div>
|
||||
<% end %>
|
||||
<%= yield %>
|
||||
<div id="wrapper">
|
||||
<!-- Sidebar -->
|
||||
<%=render 'layouts/sidebar' %>
|
||||
<!-- /#sidebar-wrapper -->
|
||||
<div id="page-content-wrapper">
|
||||
<%= yield %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
@@ -1,42 +1,39 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<%= form_tag report_path, :method => :get, :id => "frm_report", :class => "form" do %>
|
||||
<% if period_type != false %>
|
||||
<div class="row">
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label class="">Select Date Range</label>
|
||||
<% if @daterange %>
|
||||
<input class="form-control" name="daterange" id="daterange" value="<%= @daterange %>" type="text" placeholder="Date Range" readonly="true">
|
||||
<% else %>
|
||||
<input class="form-control" name="daterange" id="daterange" type="text" placeholder="Date Range" readonly="true">
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label class="">Commissioner</label>
|
||||
<select class="form-control" name="commissioner" id="commissioner">
|
||||
<option value=""></option>
|
||||
<% @commissioner.each do |c| %>
|
||||
<% if @com_id == c.id %>
|
||||
<option value="<%= c.id %>" selected><%= c.name %></option>
|
||||
<% else %>
|
||||
<option value="<%= c.id %>"><%= c.name %></option>
|
||||
<% end %> %>
|
||||
<% end %>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group col-md-2 margin-top-20">
|
||||
<input type="submit" value="Generate Report" class='btn btn-primary'>
|
||||
</div>
|
||||
<div class="form-group col-md-2 margin-top-20">
|
||||
<input type="button" value="Clear Filter" id="clear_filter" class='btn btn-danger'>
|
||||
</div>
|
||||
</div>
|
||||
<%= form_tag report_path, :method => :get, :id => "frm_report", :class => "form" do %>
|
||||
<% if period_type != false %>
|
||||
<div class="row">
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label class="">Select Date Range</label>
|
||||
<% if @daterange %>
|
||||
<input class="form-control" name="daterange" id="daterange" value="<%= @daterange %>" type="text" placeholder="Date Range" readonly="true">
|
||||
<% else %>
|
||||
<input class="form-control" name="daterange" id="daterange" type="text" placeholder="Date Range" readonly="true">
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label class="">Commissioner</label>
|
||||
<select class="form-control" name="commissioner" id="commissioner">
|
||||
<option value=""></option>
|
||||
<% @commissioner.each do |c| %>
|
||||
<% if @com_id == c.id %>
|
||||
<option value="<%= c.id %>" selected><%= c.name %></option>
|
||||
<% else %>
|
||||
<option value="<%= c.id %>"><%= c.name %></option>
|
||||
<% end %> %>
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group col-md-2 margin-top-20">
|
||||
<input type="submit" value="Generate Report" class='btn btn-primary'>
|
||||
</div>
|
||||
<div class="form-group col-md-2 margin-top-20">
|
||||
<input type="button" value="Clear Filter" id="clear_filter" class='btn btn-danger'>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= dashboard_path %>">Home</a></li>
|
||||
@@ -5,23 +7,23 @@
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
<!-- <div class="container"> -->
|
||||
<%= render :partial => 'commission_report_filter',
|
||||
:locals => {:period_type => true, :shift_name => true, :report_path => reports_commission_index_path} %>
|
||||
<hr/>
|
||||
</div>
|
||||
<!-- </div> -->
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12 text-right">
|
||||
<!-- <div class="container"> -->
|
||||
<!-- <div class="row"> -->
|
||||
<div class="text-right">
|
||||
<a href="javascript:export_to('<%= reports_commission_index_path %>.xls')" class="btn btn-default">Export to
|
||||
Excel</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- </div> -->
|
||||
<!-- </div> -->
|
||||
|
||||
<div class="container margin-top-20">
|
||||
<div class="card row">
|
||||
<div class="margin-top-20">
|
||||
<div class="card">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
|
||||
@@ -1,125 +1,121 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %>
|
||||
<% if period_type != false %>
|
||||
<div class="row">
|
||||
<div class="form-group col-md-2">
|
||||
<label>Select Period</label>
|
||||
<select name="period" id="sel_period" class="form-control">
|
||||
<option value="">Select Period</option>
|
||||
<option value="0">Today</option>
|
||||
<option value="1">Yesterday</option>
|
||||
<option value="2">This week</option>
|
||||
<option value="3">Last week</option>
|
||||
<option value="4">Last 7 days</option>
|
||||
<option value="5">This month</option>
|
||||
<option value="6">Last month</option>
|
||||
<option value="7">Last 30 days</option>
|
||||
<option value="8">This year</option>
|
||||
<option value="9">Last year</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-2">
|
||||
<!-- <label class="">Select Shift Period</label> -->
|
||||
<label class="">From</label>
|
||||
<input data-behaviour='datepicker' class="form-control" name="from" id="from" type="text" placeholder="From date">
|
||||
</div>
|
||||
<div class="form-group col-md-2">
|
||||
<label class="">To</label>
|
||||
<input data-behaviour='datepicker' class="form-control" name="to" id="to" type="text" placeholder="To date">
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label class="">All Shift</label>
|
||||
<select class="form-control select" name="shift_name" id="shift_name" >
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group col-md-1 margin-top-20">
|
||||
<input type="submit" value="Generate Report" class='btn btn-primary'>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %>
|
||||
<% if period_type != false %>
|
||||
<div class="row">
|
||||
<div class="form-group col-md-2">
|
||||
<label>Select Period</label>
|
||||
<select name="period" id="sel_period" class="form-control">
|
||||
<option value="">Select Period</option>
|
||||
<option value="0">Today</option>
|
||||
<option value="1">Yesterday</option>
|
||||
<option value="2">This week</option>
|
||||
<option value="3">Last week</option>
|
||||
<option value="4">Last 7 days</option>
|
||||
<option value="5">This month</option>
|
||||
<option value="6">Last month</option>
|
||||
<option value="7">Last 30 days</option>
|
||||
<option value="8">This year</option>
|
||||
<option value="9">Last year</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-2">
|
||||
<!-- <label class="">Select Shift Period</label> -->
|
||||
<label class="">From</label>
|
||||
<input data-behaviour='datepicker' class="form-control" name="from" id="from" type="text" placeholder="From date">
|
||||
</div>
|
||||
<div class="form-group col-md-2">
|
||||
<label class="">To</label>
|
||||
<input data-behaviour='datepicker' class="form-control" name="to" id="to" type="text" placeholder="To date">
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label class="">All Shift</label>
|
||||
<select class="form-control select" name="shift_name" id="shift_name" >
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group col-md-1 margin-top-20">
|
||||
<input type="submit" value="Generate Report" class='btn btn-primary'>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$('#custom_excel').hide();
|
||||
|
||||
$('#custom_excel').click(function(){
|
||||
var url = $('#custom_excel').attr('data-url');
|
||||
$('#frm_report').attr('action',url)
|
||||
$('#frm_report').submit();
|
||||
$(function(){
|
||||
$('#custom_excel').hide();
|
||||
|
||||
$('#custom_excel').click(function(){
|
||||
var url = $('#custom_excel').attr('data-url');
|
||||
$('#frm_report').attr('action',url)
|
||||
$('#frm_report').submit();
|
||||
// window.location = url;
|
||||
});
|
||||
|
||||
var item = $('#item').val();
|
||||
var payment_type = $('#payment_type');
|
||||
|
||||
if(item == 'order'){
|
||||
$('#cashier').hide();
|
||||
$('#waiter').show();
|
||||
if(payment_type){
|
||||
$('#payment_type').hide();
|
||||
}
|
||||
}
|
||||
else if(item == 'sale'){
|
||||
$('#waiter').hide();
|
||||
$('#cashier').show();
|
||||
}
|
||||
else{
|
||||
$('#waiter').hide();
|
||||
$('#cashier').show();
|
||||
$("#item").val('sale');
|
||||
}
|
||||
});
|
||||
|
||||
var item = $('#item').val();
|
||||
var payment_type = $('#payment_type');
|
||||
|
||||
if(item == 'order'){
|
||||
$('#cashier').hide();
|
||||
$('#waiter').show();
|
||||
if(payment_type){
|
||||
$('#payment_type').hide();
|
||||
}
|
||||
}
|
||||
else if(item == 'sale'){
|
||||
$('#waiter').hide();
|
||||
$('#cashier').show();
|
||||
}
|
||||
else{
|
||||
$('#waiter').hide();
|
||||
$('#cashier').show();
|
||||
$("#item").val('sale');
|
||||
}
|
||||
});
|
||||
|
||||
<% if params[:shift_name].to_i > 0%>
|
||||
<% if params[:shift_name].to_i > 0%>
|
||||
shift_id = '<%= params[:shift_name] %>'
|
||||
local_date = '<%= @shift_from %> - <%= @shift_to %> '
|
||||
var shift = $('#shift_name');
|
||||
str = '<option value="'+ shift_id +'" '+ 'selected = "selected"' +'>' + local_date + '</option>';
|
||||
shift.append(str);
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
$("#from").val("<%=params[:from] rescue '-'%>");
|
||||
$("#to").val("<%=params[:to] rescue '-'%>");
|
||||
$("#sel_period").val(<%=params[:period] rescue '-'%>);
|
||||
$("#sel_sale_type").val(<%=params[:sale_type] rescue '-'%>);
|
||||
$("#from").val("<%=params[:from] rescue '-'%>");
|
||||
$("#to").val("<%=params[:to] rescue '-'%>");
|
||||
$("#sel_period").val(<%=params[:period] rescue '-'%>);
|
||||
$("#sel_sale_type").val(<%=params[:sale_type] rescue '-'%>);
|
||||
// shift = $(".shift-id").text()
|
||||
// if (shift.length>0) {
|
||||
// $('.shift_name > option[value="'+shift+'"]').attr('selected','selected');
|
||||
// }
|
||||
|
||||
<% if params[:period_type] == 1 || params[:period_type] == "1" %>
|
||||
$("#rd_period_type_1").attr("checked","checked");
|
||||
<% else %>
|
||||
$("#rd_period_type_0").attr("checked","checked");
|
||||
<% end %>
|
||||
$(".btn-group button").removeClass("active");
|
||||
<% report_type = params[:report_type].blank? ? "0" : params[:report_type] %>
|
||||
$("#btn_report_type_<%= report_type %>").addClass("active");
|
||||
<% if params[:period_type] == 1 || params[:period_type] == "1" %>
|
||||
$("#rd_period_type_1").attr("checked","checked");
|
||||
<% else %>
|
||||
$("#rd_period_type_0").attr("checked","checked");
|
||||
<% end %>
|
||||
$(".btn-group button").removeClass("active");
|
||||
<% report_type = params[:report_type].blank? ? "0" : params[:report_type] %>
|
||||
$("#btn_report_type_<%= report_type %>").addClass("active");
|
||||
|
||||
$('#item').change(function(){
|
||||
var item = $('#item').val();
|
||||
var payment_type = $('#payment_type');
|
||||
$('#item').change(function(){
|
||||
var item = $('#item').val();
|
||||
var payment_type = $('#payment_type');
|
||||
|
||||
if(item == 'sale'){
|
||||
$('#waiter').hide();
|
||||
$('#cashier').show();
|
||||
if(payment_type){
|
||||
$('#payment_type').show();
|
||||
}
|
||||
}
|
||||
else{
|
||||
$('#cashier').hide();
|
||||
$('#waiter').show();
|
||||
if(payment_type){
|
||||
$('#payment_type').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
if(item == 'sale'){
|
||||
$('#waiter').hide();
|
||||
$('#cashier').show();
|
||||
if(payment_type){
|
||||
$('#payment_type').show();
|
||||
}
|
||||
}
|
||||
else{
|
||||
$('#cashier').hide();
|
||||
$('#waiter').show();
|
||||
if(payment_type){
|
||||
$('#payment_type').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -5,22 +5,22 @@
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
<!-- <div class="container"> -->
|
||||
<%= render :partial=>'shift_sale_report_filter',
|
||||
:locals=>{ :period_type => true, :shift_name => true, :report_path =>reports_credit_payment_index_path} %>
|
||||
<hr />
|
||||
</div>
|
||||
<!-- </div> -->
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12 text-right">
|
||||
<!-- <div class="container"> -->
|
||||
<!-- <div class="row"> -->
|
||||
<div class="text-right">
|
||||
<a href="javascript:export_to('<%=reports_credit_payment_index_path%>.xls')" class = "btn btn-default">Export to Excel</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- </div> -->
|
||||
<!-- </div> -->
|
||||
|
||||
<div class="container margin-top-20">
|
||||
<div class="card row">
|
||||
<div class="margin-top-20">
|
||||
<div class="card ">
|
||||
<% unless @sale_data.blank? %>
|
||||
|
||||
<table class="table table-striped" border="0">
|
||||
|
||||
@@ -1,144 +1,122 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %>
|
||||
<% if period_type != false %>
|
||||
<div class="row">
|
||||
<div class="form-group col-md-2">
|
||||
<label>Select Period</label>
|
||||
<select name="period" id="sel_period" class="form-control">
|
||||
<option value="">Select Period</option>
|
||||
<option value="0">Today</option>
|
||||
<option value="1">Yesterday</option>
|
||||
<option value="2">This week</option>
|
||||
<option value="3">Last week</option>
|
||||
<option value="4">Last 7 days</option>
|
||||
<option value="5">This month</option>
|
||||
<option value="6">Last month</option>
|
||||
<option value="7">Last 30 days</option>
|
||||
<option value="8">This year</option>
|
||||
<option value="9">Last year</option>
|
||||
</select>
|
||||
</div>
|
||||
<input type="hidden" name="report_type" value="daily_sale" id="sel_sale_type">
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<!-- <label class="">Select Shift Period</label> -->
|
||||
<label class="">From</label>
|
||||
<input data-behaviour='datepicker' class="form-control" name="from" id="from" type="text" placeholder="From date">
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label class="">To</label>
|
||||
<input data-behaviour='datepicker' class="form-control" name="to" id="to" type="text" placeholder="To date">
|
||||
</div>
|
||||
<div class="form-group col-md-2 margin-top-20">
|
||||
<input type="submit" value="Generate Report" class='btn btn-primary'>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<!-- <div class="row">
|
||||
<% if defined? show_monthly %>
|
||||
<div class="span3" style="margin-bottom:10px;">
|
||||
<input type="hidden" id="report_type" name="report_type" value="0">
|
||||
<div class="btn-group" data-toggle="buttons-radio">
|
||||
<button id="btn_report_type_1" onclick="$('#report_type').val(1)" type="button" class="btn btn-inverse">Monthly</button>
|
||||
<button id="btn_report_type_2" onclick="$('#report_type').val(2)" type="button" class="btn btn-inverse">Yearly</button>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div> -->
|
||||
|
||||
<div class="row">
|
||||
<div class="form-group">
|
||||
<% if defined? promotions %>
|
||||
<%= select_tag "promotion", options_for_select(@promotions, :selected => params[:promotion_type]), :class => "form-control" %>
|
||||
<% end %>
|
||||
|
||||
<% if defined? menu_types %>
|
||||
<%= select_tag "menu_type", options_for_select(@menu_types, :selected => params[:menu_type]), :class => "form-control" %>
|
||||
<% end %>
|
||||
|
||||
<% if defined? payments %>
|
||||
<%= select_tag "payment_type", options_for_select(@payments, :selected => params[:payment_type]), :class => "form-control" %>
|
||||
<% end %>
|
||||
|
||||
<% if defined? shift_name %>
|
||||
<!-- Temporary no needs
|
||||
<select name="shift_name" id="shift_name"></select>
|
||||
-->
|
||||
<% end %>
|
||||
|
||||
<% if defined? cashiers %>
|
||||
<%= select_tag "cashier", options_from_collection_for_select(@cashiers,"id","name"),:prompt => "All Cashier Stations", :class => "form-control" %>
|
||||
<% end %>
|
||||
|
||||
<% if defined? singer %>
|
||||
<%= select_tag "singer", options_from_collection_for_select(singer,"id","name"),:prompt => "All Vocal List", :class => "form-control" %>
|
||||
<% end %>
|
||||
|
||||
<% if defined? bsm %>
|
||||
<%= select_tag "singer", options_from_collection_for_select(bsm,"id","name"),:prompt => "All BSM List", :class => "form-control" %>
|
||||
<% end %>
|
||||
|
||||
<% if defined? guest_role %>
|
||||
<%= select_tag "guest_role", options_from_collection_for_select(@guest_role,"id","name"),:prompt => "Vocal/BSM List", :class => "form-control" %>
|
||||
<% end %>
|
||||
|
||||
<% if defined? list_by_payment_type %> <!-- for report detail by credit and foc -->
|
||||
<%= select_tag "payment_type_list", options_for_select(@payment_list, :selected => params[:payment_type_list]), :class => "form-control" %>
|
||||
<% end %>
|
||||
|
||||
<% if defined? products %>
|
||||
<%= select_tag "product", options_from_collection_for_select(@products,"id","name"),:prompt => "All Products", :class => "form-control" %>
|
||||
<% end %>
|
||||
<%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %>
|
||||
<% if period_type != false %>
|
||||
<div class="row">
|
||||
<div class="form-group col-md-2">
|
||||
<label>Select Period</label>
|
||||
<select name="period" id="sel_period" class="form-control">
|
||||
<option value="">Select Period</option>
|
||||
<option value="0">Today</option>
|
||||
<option value="1">Yesterday</option>
|
||||
<option value="2">This week</option>
|
||||
<option value="3">Last week</option>
|
||||
<option value="4">Last 7 days</option>
|
||||
<option value="5">This month</option>
|
||||
<option value="6">Last month</option>
|
||||
<option value="7">Last 30 days</option>
|
||||
<option value="8">This year</option>
|
||||
<option value="9">Last year</option>
|
||||
</select>
|
||||
</div>
|
||||
<input type="hidden" name="report_type" value="daily_sale" id="sel_sale_type">
|
||||
|
||||
<% if defined? items %>
|
||||
<%= select_tag "item", options_for_select(@items, :selected => params[:item_type]), :class => "form-control" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<!-- <label class="">Select Shift Period</label> -->
|
||||
<label class="">From</label>
|
||||
<input data-behaviour='datepicker' class="form-control" name="from" id="from" type="text" placeholder="From date">
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label class="">To</label>
|
||||
<input data-behaviour='datepicker' class="form-control" name="to" id="to" type="text" placeholder="To date">
|
||||
</div>
|
||||
<div class="form-group col-md-2 margin-top-20">
|
||||
<input type="submit" value="Generate Report" class='btn btn-primary'>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<!-- <div class="row">
|
||||
<div class="col-md-12">
|
||||
<input type="submit" value="Generate Report" class='btn btn-primary'>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="row">
|
||||
<div class="form-group">
|
||||
<% if defined? promotions %>
|
||||
<%= select_tag "promotion", options_for_select(@promotions, :selected => params[:promotion_type]), :class => "form-control" %>
|
||||
<% end %>
|
||||
|
||||
<% if defined? menu_types %>
|
||||
<%= select_tag "menu_type", options_for_select(@menu_types, :selected => params[:menu_type]), :class => "form-control" %>
|
||||
<% end %>
|
||||
|
||||
<% if defined? payments %>
|
||||
<%= select_tag "payment_type", options_for_select(@payments, :selected => params[:payment_type]), :class => "form-control" %>
|
||||
<% end %>
|
||||
|
||||
<% if defined? shift_name %>
|
||||
<!-- Temporary no needs
|
||||
<select name="shift_name" id="shift_name"></select> -->
|
||||
<% end %>
|
||||
|
||||
<% if defined? cashiers %>
|
||||
<%= select_tag "cashier", options_from_collection_for_select(@cashiers,"id","name"),:prompt => "All Cashier Stations", :class => "form-control" %>
|
||||
<% end %>
|
||||
|
||||
<% if defined? singer %>
|
||||
<%= select_tag "singer", options_from_collection_for_select(singer,"id","name"),:prompt => "All Vocal List", :class => "form-control" %>
|
||||
<% end %>
|
||||
|
||||
<% if defined? bsm %>
|
||||
<%= select_tag "singer", options_from_collection_for_select(bsm,"id","name"),:prompt => "All BSM List", :class => "form-control" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% if defined? guest_role %>
|
||||
<%= select_tag "guest_role", options_from_collection_for_select(@guest_role,"id","name"),:prompt => "Vocal/BSM List", :class => "form-control" %>
|
||||
<% end %>
|
||||
|
||||
<% if defined? list_by_payment_type %> <!-- for report detail by credit and foc -->
|
||||
<%= select_tag "payment_type_list", options_for_select(@payment_list, :selected => params[:payment_type_list]), :class => "form-control" %>
|
||||
<% end %>
|
||||
|
||||
<% if defined? products %>
|
||||
<%= select_tag "product", options_from_collection_for_select(@products,"id","name"),:prompt => "All Products", :class => "form-control" %>
|
||||
<% end %>
|
||||
|
||||
<% if defined? items %>
|
||||
<%= select_tag "item", options_for_select(@items, :selected => params[:item_type]), :class => "form-control" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$('#custom_excel').hide();
|
||||
|
||||
$('#custom_excel').click(function(){
|
||||
var url = $('#custom_excel').attr('data-url');
|
||||
$('#frm_report').attr('action',url)
|
||||
$('#frm_report').submit();
|
||||
// window.location = url;
|
||||
$(function(){
|
||||
$('#custom_excel').hide();
|
||||
|
||||
$('#custom_excel').click(function(){
|
||||
var url = $('#custom_excel').attr('data-url');
|
||||
$('#frm_report').attr('action',url)
|
||||
$('#frm_report').submit();
|
||||
|
||||
});
|
||||
|
||||
var item = $('#item').val();
|
||||
var payment_type = $('#payment_type');
|
||||
|
||||
if(item == 'order'){
|
||||
$('#cashier').hide();
|
||||
$('#waiter').show();
|
||||
if(payment_type){
|
||||
$('#payment_type').hide();
|
||||
}
|
||||
}
|
||||
else if(item == 'sale'){
|
||||
$('#waiter').hide();
|
||||
$('#cashier').show();
|
||||
}
|
||||
else{
|
||||
$('#waiter').hide();
|
||||
$('#cashier').show();
|
||||
$("#item").val('sale');
|
||||
}
|
||||
});
|
||||
|
||||
var item = $('#item').val();
|
||||
var payment_type = $('#payment_type');
|
||||
|
||||
if(item == 'order'){
|
||||
$('#cashier').hide();
|
||||
$('#waiter').show();
|
||||
if(payment_type){
|
||||
$('#payment_type').hide();
|
||||
}
|
||||
}
|
||||
else if(item == 'sale'){
|
||||
$('#waiter').hide();
|
||||
$('#cashier').show();
|
||||
}
|
||||
else{
|
||||
$('#waiter').hide();
|
||||
$('#cashier').show();
|
||||
$("#item").val('sale');
|
||||
}
|
||||
});
|
||||
|
||||
//Reset the form to pervious values
|
||||
$("#branch").val(<%=params[:branch]%>);
|
||||
@@ -156,9 +134,9 @@ $("#sel_period").val(<%=params[:period]%>);
|
||||
$("#sel_sale_type").val(<%=params[:sale_type]%>);
|
||||
|
||||
<% if params[:period_type] == 1 || params[:period_type] == "1" %>
|
||||
$("#rd_period_type_1").attr("checked","checked");
|
||||
$("#rd_period_type_1").attr("checked","checked");
|
||||
<% else %>
|
||||
$("#rd_period_type_0").attr("checked","checked");
|
||||
$("#rd_period_type_0").attr("checked","checked");
|
||||
<% end %>
|
||||
$(".btn-group button").removeClass("active");
|
||||
<% report_type = params[:report_type].blank? ? "0" : params[:report_type] %>
|
||||
|
||||
@@ -1,139 +1,152 @@
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= dashboard_path %>">Home</a></li>
|
||||
<li>Daily Sale Report</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
<%= render :partial=>'shift_sale_report_filter',
|
||||
:locals=>{ :period_type => true, :shift_name => false, :report_path =>reports_dailysale_index_path} %>
|
||||
<hr />
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12 text-right">
|
||||
<a href="javascript:export_to('<%=reports_dailysale_index_path%>.xls')" class = "btn btn-default">Export to Excel</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container margin-top-20">
|
||||
<div class="card row">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="15"> From Date : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - To Date : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style='text-align:center;'>Sr</th>
|
||||
<th style='text-align:center;'>Date</th>
|
||||
<th style='text-align:center;'>Void Amount</th>
|
||||
<th style='text-align:center;'>Mpu Sales</th>
|
||||
<th style='text-align:center;'>Master Sales</th>
|
||||
<th style='text-align:center;'>Visa Sales</th>
|
||||
<th style='text-align:center;'>Jcb Sales</th>
|
||||
<th style='text-align:center;'>Redeem Sales</th>
|
||||
<th style='text-align:center;'>Cash Sales</th>
|
||||
<th style='text-align:center;'>Credit Sales</th>
|
||||
<th style='text-align:center;'>FOC Sales</th>
|
||||
<th style='text-align:center;'>(Discount)</th>
|
||||
<th style='text-align:center;'>Grand Total + <br/> Rounding Adj.</th>
|
||||
<th style='text-align:center;'>Rounding Adj.</th>
|
||||
<th style='text-align:center;'>Grand Total</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<% unless @sale_data.empty? %>
|
||||
|
||||
<tbody>
|
||||
<% void = 0 %>
|
||||
<% mpu = 0 %>
|
||||
<% master = 0 %>
|
||||
<% visa = 0 %>
|
||||
<% jcb = 0 %>
|
||||
<% paypar = 0 %>
|
||||
<% cash = 0 %>
|
||||
<% credit = 0 %>
|
||||
<% foc = 0 %>
|
||||
<% discount = 0 %>
|
||||
<% total = 0 %>
|
||||
<% grand_total = 0 %>
|
||||
<% old_grand_total = 0 %>
|
||||
<% count = 1 %> <% rounding_adj = 0 %>
|
||||
<% @sale_data.each do |sale| %>
|
||||
<% void += sale[:void_amount] %>
|
||||
<% mpu += sale[:mpu_amount] %>
|
||||
<% master += sale[:master_amount] %>
|
||||
<% visa += sale[:visa_amount] %>
|
||||
<% jcb += sale[:jcb_amount] %>
|
||||
<% paypar += sale[:paypar_amount] %>
|
||||
<% cash += sale[:cash_amount]-sale[:total_change_amount] %>
|
||||
<% credit += sale[:credit_amount] %>
|
||||
<% foc += sale[:foc_amount] %>
|
||||
<% discount += sale[:total_discount] %>
|
||||
<% total += sale[:old_grand_total].to_f + sale[:rounding_adj].to_f %>
|
||||
<% grand_total += sale[:grand_total].to_f %>
|
||||
<% old_grand_total += sale[:old_grand_total].to_f %>
|
||||
<% rounding_adj += sale[:rounding_adj].to_f %>
|
||||
<tr>
|
||||
<td style='text-align:right;'><%= count %></td>
|
||||
<td><%= sale[:sale_date].strftime("#{sale[:sale_date].day.ordinalize} %b") rescue '-' %></td>
|
||||
<td style='color:red;text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:void_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:mpu_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:master_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:visa_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:jcb_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:paypar_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:cash_amount]-sale[:total_change_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:credit_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:foc_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'>(<%= number_with_delimiter(sprintf("%.2f",sale[:total_discount]), :delimiter => ',') rescue '-'%>)</td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:old_grand_total].to_f + sale[:rounding_adj].to_f ), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:rounding_adj].to_f), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:old_grand_total]), :delimiter => ',') rescue '-'%></td>
|
||||
</tr>
|
||||
<% count = count + 1 %>
|
||||
<% end %>
|
||||
|
||||
<tr style="font-weight:600;">
|
||||
<td colspan="3" style='text-align:center;'>Total</td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",mpu), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",master), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",visa), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",jcb), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",paypar), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",cash), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",credit), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",foc), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'>(<%= number_with_delimiter(sprintf("%.2f",discount), :delimiter => ',') rescue '-'%>)</td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",total), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",rounding_adj), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",old_grand_total), :delimiter => ',') rescue '-'%></td>
|
||||
</tr>
|
||||
|
||||
<% total_tax = 0 %>
|
||||
<% unless @tax.empty? %>
|
||||
<% @tax.each do |tax| %>
|
||||
<% total_tax += tax.tax_amount.to_f %>
|
||||
<tr style="font-weight:600;">
|
||||
<td colspan="12" style='text-align:right;'><%= tax.tax_name rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",tax.tax_amount), :delimiter => ',') rescue '-'%></td>
|
||||
<td colspan="2"> </td>
|
||||
</tr>
|
||||
|
||||
<% end %>
|
||||
<% net = total - total_tax %>
|
||||
<tr style="font-weight:600;">
|
||||
<td colspan="12" style='text-align:right;'>Net Amount</td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",net), :delimiter => ',') rescue '-'%></td>
|
||||
<td colspan="2"> </td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
<% end %>
|
||||
</table>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<div class="page-header col-md-12 col-lg-12">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= dashboard_path %>">Home</a></li>
|
||||
<li>Daily Sale Report</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="row">
|
||||
<div class="col-md-12 col-lg-12"> -->
|
||||
<!-- <div class="container"> -->
|
||||
<%= render :partial=>'shift_sale_report_filter',
|
||||
:locals=>{ :period_type => true, :shift_name => false, :report_path =>reports_dailysale_index_path} %>
|
||||
<hr />
|
||||
<!-- </div> -->
|
||||
<!-- </div>
|
||||
</div> -->
|
||||
|
||||
<!-- <div class="row"> -->
|
||||
<!-- <div class="container"> -->
|
||||
<div class=" text-right">
|
||||
<a href="javascript:export_to('<%=reports_dailysale_index_path%>.xls')" class = "btn btn-default">Export to Excel</a>
|
||||
</div>
|
||||
<!-- </div> -->
|
||||
<!-- </div> -->
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-12">
|
||||
<div class="card ">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="15"> From Date : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - To Date : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style='text-align:center;'>Sr</th>
|
||||
<th style='text-align:center;'>Date</th>
|
||||
<th style='text-align:center;'>Void Amount</th>
|
||||
<th style='text-align:center;'>Mpu Sales</th>
|
||||
<th style='text-align:center;'>Master Sales</th>
|
||||
<th style='text-align:center;'>Visa Sales</th>
|
||||
<th style='text-align:center;'>Jcb Sales</th>
|
||||
<th style='text-align:center;'>Redeem Sales</th>
|
||||
<th style='text-align:center;'>Cash Sales</th>
|
||||
<th style='text-align:center;'>Credit Sales</th>
|
||||
<th style='text-align:center;'>FOC Sales</th>
|
||||
<th style='text-align:center;'>(Discount)</th>
|
||||
<th style='text-align:center;'>Grand Total + <br/> Rounding Adj.</th>
|
||||
<th style='text-align:center;'>Rounding Adj.</th>
|
||||
<th style='text-align:center;'>Grand Total</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<% unless @sale_data.empty? %>
|
||||
|
||||
<tbody>
|
||||
<% void = 0 %>
|
||||
<% mpu = 0 %>
|
||||
<% master = 0 %>
|
||||
<% visa = 0 %>
|
||||
<% jcb = 0 %>
|
||||
<% paypar = 0 %>
|
||||
<% cash = 0 %>
|
||||
<% credit = 0 %>
|
||||
<% foc = 0 %>
|
||||
<% discount = 0 %>
|
||||
<% total = 0 %>
|
||||
<% grand_total = 0 %>
|
||||
<% old_grand_total = 0 %>
|
||||
<% count = 1 %> <% rounding_adj = 0 %>
|
||||
<% @sale_data.each do |sale| %>
|
||||
<% void += sale[:void_amount] %>
|
||||
<% mpu += sale[:mpu_amount] %>
|
||||
<% master += sale[:master_amount] %>
|
||||
<% visa += sale[:visa_amount] %>
|
||||
<% jcb += sale[:jcb_amount] %>
|
||||
<% paypar += sale[:paypar_amount] %>
|
||||
<% cash += sale[:cash_amount]-sale[:total_change_amount] %>
|
||||
<% credit += sale[:credit_amount] %>
|
||||
<% foc += sale[:foc_amount] %>
|
||||
<% discount += sale[:total_discount] %>
|
||||
<% total += sale[:old_grand_total].to_f + sale[:rounding_adj].to_f %>
|
||||
<% grand_total += sale[:grand_total].to_f %>
|
||||
<% old_grand_total += sale[:old_grand_total].to_f %>
|
||||
<% rounding_adj += sale[:rounding_adj].to_f %>
|
||||
<tr>
|
||||
<td style='text-align:right;'><%= count %></td>
|
||||
<td><%= sale[:sale_date].strftime("#{sale[:sale_date].day.ordinalize} %b") rescue '-' %></td>
|
||||
<td style='color:red;text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:void_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:mpu_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:master_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:visa_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:jcb_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:paypar_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:cash_amount]-sale[:total_change_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:credit_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:foc_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'>(<%= number_with_delimiter(sprintf("%.2f",sale[:total_discount]), :delimiter => ',') rescue '-'%>)</td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:old_grand_total].to_f + sale[:rounding_adj].to_f ), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:rounding_adj].to_f), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:old_grand_total]), :delimiter => ',') rescue '-'%></td>
|
||||
</tr>
|
||||
<% count = count + 1 %>
|
||||
<% end %>
|
||||
|
||||
<tr style="font-weight:600;">
|
||||
<td colspan="3" style='text-align:center;'>Total</td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",mpu), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",master), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",visa), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",jcb), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",paypar), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",cash), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",credit), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",foc), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'>(<%= number_with_delimiter(sprintf("%.2f",discount), :delimiter => ',') rescue '-'%>)</td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",total), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",rounding_adj), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",old_grand_total), :delimiter => ',') rescue '-'%></td>
|
||||
</tr>
|
||||
|
||||
<% total_tax = 0 %>
|
||||
<% unless @tax.empty? %>
|
||||
<% @tax.each do |tax| %>
|
||||
<% total_tax += tax.tax_amount.to_f %>
|
||||
<tr style="font-weight:600;">
|
||||
<td colspan="12" style='text-align:right;'><%= tax.tax_name rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",tax.tax_amount), :delimiter => ',') rescue '-'%></td>
|
||||
<td colspan="2"> </td>
|
||||
</tr>
|
||||
|
||||
<% end %>
|
||||
<% net = total - total_tax %>
|
||||
<tr style="font-weight:600;">
|
||||
<td colspan="12" style='text-align:right;'>Net Amount</td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",net), :delimiter => ',') rescue '-'%></td>
|
||||
<td colspan="2"> </td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
<% end %>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,130 +1,125 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %>
|
||||
<% if period_type != false %>
|
||||
<div class="row">
|
||||
<div class="form-group col-md-2">
|
||||
<label>Select Period</label>
|
||||
<select name="period" id="sel_period" class="form-control">
|
||||
<option value="">Select Period</option>
|
||||
<option value="0">Today</option>
|
||||
<option value="1">Yesterday</option>
|
||||
<option value="2">This week</option>
|
||||
<option value="3">Last week</option>
|
||||
<option value="4">Last 7 days</option>
|
||||
<option value="5">This month</option>
|
||||
<option value="6">Last month</option>
|
||||
<option value="7">Last 30 days</option>
|
||||
<option value="8">This year</option>
|
||||
<option value="9">Last year</option>
|
||||
</select>
|
||||
</div>
|
||||
<% if defined? payments %>
|
||||
<div class="form-group col-md-2">
|
||||
<label>Select Payments</label>
|
||||
<%= select_tag "payment_type", options_for_select(@payments, :selected => params[:payment_type]), :class => "form-control" %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="form-group col-md-2">
|
||||
<!-- <label class="">Select Shift Period</label> -->
|
||||
<label class="">From</label>
|
||||
<input data-behaviour='datepicker' class="form-control" name="from" id="from" type="text" placeholder="From date">
|
||||
</div>
|
||||
<div class="form-group col-md-2">
|
||||
<label class="">To</label>
|
||||
<input data-behaviour='datepicker' class="form-control" name="to" id="to" type="text" placeholder="To date">
|
||||
</div>
|
||||
<div class="form-group col-md-2">
|
||||
<label class="">All Shift</label>
|
||||
<select class="form-control select" name="shift_name" id="shift_name" >
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group col-md-1 margin-top-20">
|
||||
<input type="submit" value="Generate Report" class='btn btn-primary'>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %>
|
||||
<% if period_type != false %>
|
||||
<div class="row">
|
||||
<div class="form-group col-md-2">
|
||||
<label>Select Period</label>
|
||||
<select name="period" id="sel_period" class="form-control">
|
||||
<option value="">Select Period</option>
|
||||
<option value="0">Today</option>
|
||||
<option value="1">Yesterday</option>
|
||||
<option value="2">This week</option>
|
||||
<option value="3">Last week</option>
|
||||
<option value="4">Last 7 days</option>
|
||||
<option value="5">This month</option>
|
||||
<option value="6">Last month</option>
|
||||
<option value="7">Last 30 days</option>
|
||||
<option value="8">This year</option>
|
||||
<option value="9">Last year</option>
|
||||
</select>
|
||||
</div>
|
||||
<% if defined? payments %>
|
||||
<div class="form-group col-md-2">
|
||||
<label>Select Payments</label>
|
||||
<%= select_tag "payment_type", options_for_select(@payments, :selected => params[:payment_type]), :class => "form-control" %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="form-group col-md-2">
|
||||
<!-- <label class="">Select Shift Period</label> -->
|
||||
<label class="">From</label>
|
||||
<input data-behaviour='datepicker' class="form-control" name="from" id="from" type="text" placeholder="From date">
|
||||
</div>
|
||||
<div class="form-group col-md-2">
|
||||
<label class="">To</label>
|
||||
<input data-behaviour='datepicker' class="form-control" name="to" id="to" type="text" placeholder="To date">
|
||||
</div>
|
||||
<div class="form-group col-md-2">
|
||||
<label class="">All Shift</label>
|
||||
<select class="form-control select" name="shift_name" id="shift_name" >
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group col-md-1 margin-top-20">
|
||||
<input type="submit" value="Generate Report" class='btn btn-primary'>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$('#custom_excel').hide();
|
||||
|
||||
$('#custom_excel').click(function(){
|
||||
var url = $('#custom_excel').attr('data-url');
|
||||
$('#frm_report').attr('action',url)
|
||||
$('#frm_report').submit();
|
||||
$(function(){
|
||||
$('#custom_excel').hide();
|
||||
|
||||
$('#custom_excel').click(function(){
|
||||
var url = $('#custom_excel').attr('data-url');
|
||||
$('#frm_report').attr('action',url)
|
||||
$('#frm_report').submit();
|
||||
// window.location = url;
|
||||
});
|
||||
|
||||
var item = $('#item').val();
|
||||
var payment_type = $('#payment_type');
|
||||
|
||||
if(item == 'order'){
|
||||
$('#cashier').hide();
|
||||
$('#waiter').show();
|
||||
if(payment_type){
|
||||
$('#payment_type').hide();
|
||||
}
|
||||
}
|
||||
else if(item == 'sale'){
|
||||
$('#waiter').hide();
|
||||
$('#cashier').show();
|
||||
}
|
||||
else{
|
||||
$('#waiter').hide();
|
||||
$('#cashier').show();
|
||||
$("#item").val('sale');
|
||||
}
|
||||
});
|
||||
|
||||
var item = $('#item').val();
|
||||
var payment_type = $('#payment_type');
|
||||
|
||||
if(item == 'order'){
|
||||
$('#cashier').hide();
|
||||
$('#waiter').show();
|
||||
if(payment_type){
|
||||
$('#payment_type').hide();
|
||||
}
|
||||
}
|
||||
else if(item == 'sale'){
|
||||
$('#waiter').hide();
|
||||
$('#cashier').show();
|
||||
}
|
||||
else{
|
||||
$('#waiter').hide();
|
||||
$('#cashier').show();
|
||||
$("#item").val('sale');
|
||||
}
|
||||
});
|
||||
|
||||
<% if params[:shift_name].to_i > 0%>
|
||||
<% if params[:shift_name].to_i > 0%>
|
||||
shift_id = '<%= params[:shift_name] %>'
|
||||
local_date = '<%= @shift_from %> - <%= @shift_to %> '
|
||||
var shift = $('#shift_name');
|
||||
str = '<option value="'+ shift_id +'" '+ 'selected = "selected"' +'>' + local_date + '</option>';
|
||||
shift.append(str);
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
$("#from").val("<%=params[:from] rescue '-'%>");
|
||||
$("#to").val("<%=params[:to] rescue '-'%>");
|
||||
$("#sel_period").val(<%=params[:period] rescue '-'%>);
|
||||
$("#sel_sale_type").val(<%=params[:sale_type] rescue '-'%>);
|
||||
$("#from").val("<%=params[:from] rescue '-'%>");
|
||||
$("#to").val("<%=params[:to] rescue '-'%>");
|
||||
$("#sel_period").val(<%=params[:period] rescue '-'%>);
|
||||
$("#sel_sale_type").val(<%=params[:sale_type] rescue '-'%>);
|
||||
// shift = $(".shift-id").text()
|
||||
// if (shift.length>0) {
|
||||
// $('.shift_name > option[value="'+shift+'"]').attr('selected','selected');
|
||||
// }
|
||||
|
||||
<% if params[:period_type] == 1 || params[:period_type] == "1" %>
|
||||
$("#rd_period_type_1").attr("checked","checked");
|
||||
<% else %>
|
||||
$("#rd_period_type_0").attr("checked","checked");
|
||||
<% end %>
|
||||
$(".btn-group button").removeClass("active");
|
||||
<% report_type = params[:report_type].blank? ? "0" : params[:report_type] %>
|
||||
$("#btn_report_type_<%= report_type %>").addClass("active");
|
||||
<% if params[:period_type] == 1 || params[:period_type] == "1" %>
|
||||
$("#rd_period_type_1").attr("checked","checked");
|
||||
<% else %>
|
||||
$("#rd_period_type_0").attr("checked","checked");
|
||||
<% end %>
|
||||
$(".btn-group button").removeClass("active");
|
||||
<% report_type = params[:report_type].blank? ? "0" : params[:report_type] %>
|
||||
$("#btn_report_type_<%= report_type %>").addClass("active");
|
||||
|
||||
$('#item').change(function(){
|
||||
var item = $('#item').val();
|
||||
var payment_type = $('#payment_type');
|
||||
$('#item').change(function(){
|
||||
var item = $('#item').val();
|
||||
var payment_type = $('#payment_type');
|
||||
|
||||
if(item == 'sale'){
|
||||
$('#waiter').hide();
|
||||
$('#cashier').show();
|
||||
if(payment_type){
|
||||
$('#payment_type').show();
|
||||
}
|
||||
}
|
||||
else{
|
||||
$('#cashier').hide();
|
||||
$('#waiter').show();
|
||||
if(payment_type){
|
||||
$('#payment_type').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
if(item == 'sale'){
|
||||
$('#waiter').hide();
|
||||
$('#cashier').show();
|
||||
if(payment_type){
|
||||
$('#payment_type').show();
|
||||
}
|
||||
}
|
||||
else{
|
||||
$('#cashier').hide();
|
||||
$('#waiter').show();
|
||||
if(payment_type){
|
||||
$('#payment_type').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -1,121 +1,125 @@
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= dashboard_path %>">Home</a></li>
|
||||
<li>Receipt List Report</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= dashboard_path %>">Home</a></li>
|
||||
<li>Receipt List Report</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
<%= render :partial=>'shift_sale_report_filter',
|
||||
:locals=>{ :period_type => true, :shift_name => true,:payments => true, :report_path =>reports_receipt_no_index_path} %>
|
||||
<hr />
|
||||
</div>
|
||||
<!-- <div class="container"> -->
|
||||
<%= render :partial=>'shift_sale_report_filter',
|
||||
:locals=>{ :period_type => true, :shift_name => true,:payments => true, :report_path =>reports_receipt_no_index_path} %>
|
||||
<hr />
|
||||
<!-- </div> -->
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12 text-right">
|
||||
<a href="javascript:export_to('<%=reports_receipt_no_index_path%>.xls')" class = "btn btn-default">Export to Excel</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="container"> -->
|
||||
<!-- <div class="row"> -->
|
||||
<div class="text-right">
|
||||
<a href="javascript:export_to('<%=reports_receipt_no_index_path%>.xls')" class = "btn btn-default">Export to Excel</a>
|
||||
</div>
|
||||
<!-- </div> -->
|
||||
<!-- </div> -->
|
||||
|
||||
<div class="container margin-top-20">
|
||||
<div class="card row">
|
||||
<table class="table table-striped" border="0">
|
||||
<thead>
|
||||
|
||||
<tr>
|
||||
<th colspan="7"> From Date : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - To Date : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%></th>
|
||||
</tr>
|
||||
<% if @shift_from %>
|
||||
<tr>
|
||||
<% if @shift_data.employee %>
|
||||
<% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %>
|
||||
<% end %>
|
||||
<th colspan="7">Shift Name = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )</th>
|
||||
</tr>
|
||||
<% end %>
|
||||
<div class="margin-top-20">
|
||||
<div class="card">
|
||||
<table class="table table-striped" border="0">
|
||||
<thead>
|
||||
|
||||
<tr>
|
||||
<th>Recipt No</th>
|
||||
<th>Cashier Name</th>
|
||||
<th>Total Amount</th>
|
||||
<th>Discount Amount </th>
|
||||
<% @sale_taxes.each do |tax| %>
|
||||
<th><%= tax.tax_name %></th>
|
||||
<% end %>
|
||||
<!-- <th>Other Amount</th> -->
|
||||
<th>Grand Total</th>
|
||||
<th>Rounding Adj.</th>
|
||||
<th>Grand Total +<br/>
|
||||
Rounding Adj.
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% grand_total = 0 %>
|
||||
<% old_grand_total = 0 %>
|
||||
<% total_tax = 0 %>
|
||||
<% guest_count = 0 %>
|
||||
<% total_sum = 0 %>
|
||||
<% discount_amt = 0 %>
|
||||
<% other_amt = 0 %>
|
||||
<% total_nett = 0 %>
|
||||
<% rounding_adj = 0%> <% gov_tax = 0 %> <% service_charge = 0 %>
|
||||
<%if @sale_data %>
|
||||
<% @sale_data.each do |result| %>
|
||||
<tr>
|
||||
<th colspan="7"> From Date : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - To Date : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%></th>
|
||||
</tr>
|
||||
<% if @shift_from %>
|
||||
<tr>
|
||||
<% if @shift_data.employee %>
|
||||
<% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %>
|
||||
<% end %>
|
||||
<th colspan="7">Shift Name = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )</th>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
<% grand_total = grand_total.to_f + result.grand_total.to_f %>
|
||||
<% old_grand_total = old_grand_total.to_f + result.old_grand_total.to_f %>
|
||||
<% total_tax += result.total_tax.to_f %>
|
||||
<% total_sum += result.total_amount.to_f %>
|
||||
<% discount_amt += result.total_discount.to_f %>
|
||||
<% rounding_adj += result.rounding_adjustment.to_f %>
|
||||
|
||||
<tr>
|
||||
|
||||
<td><%= result.receipt_no rescue '-' %> </td>
|
||||
<td><%= result.cashier_name rescue '-' %></td>
|
||||
<td><%= result.total_amount rescue '-' %></td>
|
||||
<td><%= result.total_discount rescue '-' %></td>
|
||||
<% result.sale_taxes.each do |tax| %>
|
||||
<tr>
|
||||
<th>Recipt No</th>
|
||||
<th>Cashier Name</th>
|
||||
<th>Total Amount</th>
|
||||
<th>Discount Amount </th>
|
||||
<% @sale_taxes.each do |tax| %>
|
||||
<th><%= tax.tax_name %></th>
|
||||
<% end %>
|
||||
<!-- <th>Other Amount</th> -->
|
||||
<th>Grand Total</th>
|
||||
<th>Rounding Adj.</th>
|
||||
<th>Grand Total +<br/>
|
||||
Rounding Adj.
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% grand_total = 0 %>
|
||||
<% old_grand_total = 0 %>
|
||||
<% total_tax = 0 %>
|
||||
<% guest_count = 0 %>
|
||||
<% total_sum = 0 %>
|
||||
<% discount_amt = 0 %>
|
||||
<% other_amt = 0 %>
|
||||
<% total_nett = 0 %>
|
||||
<% rounding_adj = 0%> <% gov_tax = 0 %> <% service_charge = 0 %>
|
||||
<%if @sale_data %>
|
||||
<% @sale_data.each do |result| %>
|
||||
|
||||
<% grand_total = grand_total.to_f + result.grand_total.to_f %>
|
||||
<% old_grand_total = old_grand_total.to_f + result.old_grand_total.to_f %>
|
||||
<% total_tax += result.total_tax.to_f %>
|
||||
<% total_sum += result.total_amount.to_f %>
|
||||
<% discount_amt += result.total_discount.to_f %>
|
||||
<% rounding_adj += result.rounding_adjustment.to_f %>
|
||||
|
||||
<tr>
|
||||
|
||||
<td><%= result.receipt_no rescue '-' %> </td>
|
||||
<td><%= result.cashier_name rescue '-' %></td>
|
||||
<td><%= result.total_amount rescue '-' %></td>
|
||||
<td><%= result.total_discount rescue '-' %></td>
|
||||
<% result.sale_taxes.each do |tax| %>
|
||||
<td><%= tax.tax_payable_amount rescue '-' %></td>
|
||||
<%end%>
|
||||
|
||||
<td><%= result.old_grand_total %></td>
|
||||
<td><%= result.rounding_adjustment.to_f rescue '-' %></td>
|
||||
<td><%= result.grand_total_after_rounding() rescue '-'%></td>
|
||||
</tr>
|
||||
<%end%>
|
||||
|
||||
<% end %>
|
||||
<tr style="border-top:4px double #666;">
|
||||
<td colspan="2"> </td>
|
||||
<td><b><%= total_sum rescue '-'%></b></td>
|
||||
<td><b><%= discount_amt rescue '-'%></b></td>
|
||||
<% @sale_taxes.each do |tax| %>
|
||||
<td><%= result.old_grand_total %></td>
|
||||
<td><%= result.rounding_adjustment.to_f rescue '-' %></td>
|
||||
<td><%= result.grand_total_after_rounding() rescue '-'%></td>
|
||||
</tr>
|
||||
|
||||
<% end %>
|
||||
<tr style="border-top:4px double #666;">
|
||||
<td colspan="2"> </td>
|
||||
<td><b><%= total_sum rescue '-'%></b></td>
|
||||
<td><b><%= discount_amt rescue '-'%></b></td>
|
||||
<% @sale_taxes.each do |tax| %>
|
||||
<td><b><%= tax.st_amount.round(2) %></b></td>
|
||||
<% end %>
|
||||
<td><b><%= old_grand_total.to_f.round(2) rescue '-'%></b></td>
|
||||
<td><b><%= rounding_adj rescue '-'%></b></td>
|
||||
<td><b><%= old_grand_total.to_f.round + rounding_adj %></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"> </td>
|
||||
<td>Total Amount</td>
|
||||
<td>Discount Amount</td>
|
||||
<% @sale_taxes.each do |tax| %>
|
||||
<% end %>
|
||||
<td><b><%= old_grand_total.to_f.round(2) rescue '-'%></b></td>
|
||||
<td><b><%= rounding_adj rescue '-'%></b></td>
|
||||
<td><b><%= old_grand_total.to_f.round + rounding_adj %></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"> </td>
|
||||
<td>Total Amount</td>
|
||||
<td>Discount Amount</td>
|
||||
<% @sale_taxes.each do |tax| %>
|
||||
<td><%= tax.tax_name %></td>
|
||||
<% end %>
|
||||
<td>Grand Total</td>
|
||||
<td>Rounding Adj.</td>
|
||||
<td>Grand Total +<br/>
|
||||
Rounding Adj.
|
||||
</td>
|
||||
</tr>
|
||||
<%end%>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<% end %>
|
||||
<td>Grand Total</td>
|
||||
<td>Rounding Adj.</td>
|
||||
<td>Grand Total +<br/>
|
||||
Rounding Adj.
|
||||
</td>
|
||||
</tr>
|
||||
<%end%>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %>
|
||||
<% if period_type != false %>
|
||||
<div class="row">
|
||||
@@ -52,8 +51,7 @@
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$('#custom_excel').hide();
|
||||
|
||||
@@ -1,175 +1,179 @@
|
||||
<div class="page-header">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="page-header">
|
||||
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= dashboard_path %>">Home</a></li>
|
||||
<li>Sale Item Report</li>
|
||||
</ul>
|
||||
</div>
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= dashboard_path %>">Home</a></li>
|
||||
<li>Sale Item Report</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
<%= render :partial=>'shift_sale_report_filter',
|
||||
:locals=>{ :period_type => true, :shift_name => true, :report_path =>reports_saleitem_index_path} %>
|
||||
<!-- <div class="container"> -->
|
||||
<%= render :partial=>'shift_sale_report_filter',
|
||||
:locals=>{ :period_type => true, :shift_name => true, :report_path =>reports_saleitem_index_path} %>
|
||||
|
||||
<hr />
|
||||
</div>
|
||||
<hr />
|
||||
<!-- /div> -->
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12 text-right">
|
||||
<a href="javascript:export_to('<%=reports_saleitem_index_path%>.xls')" class = "btn btn-default">Export to Excel</a>
|
||||
</div>
|
||||
<!-- <div class="container"> -->
|
||||
<!-- <div class="row"> -->
|
||||
<div class="text-right">
|
||||
<a href="javascript:export_to('<%=reports_saleitem_index_path%>.xls')" class = "btn btn-default">Export to Excel</a>
|
||||
</div>
|
||||
<!-- </div> -->
|
||||
<!-- </div> -->
|
||||
|
||||
<div class="margin-top-20">
|
||||
<div class="card">
|
||||
<div class="table-responsive">
|
||||
|
||||
|
||||
<table class="table table-striped" id="items_table" border="0">
|
||||
<thead>
|
||||
|
||||
<tr>
|
||||
<th colspan="7"> From Date : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - To Date : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%></th>
|
||||
</tr>
|
||||
<% if @shift_from %>
|
||||
<tr>
|
||||
<% if @shift_data.employee %>
|
||||
<% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %>
|
||||
<% end %>
|
||||
<th colspan="7">Shift Name = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )</th>
|
||||
</tr>
|
||||
<% end %>
|
||||
<tr>
|
||||
<th> </th>
|
||||
<th>Menu Category</th>
|
||||
<th>Code</th>
|
||||
<th>Product</th>
|
||||
<th>Total Item</th>
|
||||
<th>Unit Price</th>
|
||||
<th>Revenue</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% unless @sale_data.blank? %>
|
||||
<% acc_arr = Array.new %>
|
||||
<% cate_arr = Array.new %>
|
||||
|
||||
<% sub_total = 0.0 %>
|
||||
<% count = 0%>
|
||||
<% total_price = 0.0 %>
|
||||
<% cate_count = 0 %>
|
||||
<% acc_count = 0%>
|
||||
<% grand_total = 0%>
|
||||
<% total_qty = 0%>
|
||||
<% total_amount = 0 %>
|
||||
<% discount = 0%>
|
||||
|
||||
<% @sale_data.each do |sale| %>
|
||||
<% total_qty += sale.total_item %>
|
||||
|
||||
<% if !acc_arr.include?(sale.account_id) %>
|
||||
<tr>
|
||||
<td><b><%= sale.account_name %></b></td>
|
||||
<td colspan="4"> </td>
|
||||
<td>Total Price By <%= sale.account_name %></td>
|
||||
<td>
|
||||
<% @totalByAccount.each do |account, total| %>
|
||||
<% if sale.account_id == account %>
|
||||
<b><%= total %></b>
|
||||
<% grand_total += total %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<% acc_arr.push(sale.account_id) %>
|
||||
|
||||
<% end %>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<% if !cate_arr.include?(sale.menu_category_id) %>
|
||||
<td><%= sale.menu_category_name %></td>
|
||||
<% cate_arr.push(sale.menu_category_id) %>
|
||||
<% else %>
|
||||
<td> </td>
|
||||
<% end %>
|
||||
<td><%= sale.item_code rescue '-' %></td>
|
||||
<td><%= sale.product_name rescue '-' %></td>
|
||||
<td><%= sale.total_item rescue '-' %></td>
|
||||
<td><%= sale.unit_price rescue '-' %></td>
|
||||
<td><%= sale.grand_total rescue '-' %></td>
|
||||
|
||||
</tr>
|
||||
|
||||
<!-- sub total -->
|
||||
<% @menu_cate_count.each do |key,value| %>
|
||||
<% if sale.menu_category_id == key %>
|
||||
|
||||
<% count = count + 1 %>
|
||||
<% sub_total += sale.grand_total %>
|
||||
<% if count == value %>
|
||||
<tr>
|
||||
<td colspan="5"> </td>
|
||||
<td>Sub Total</td>
|
||||
<td ><span class="underline"><%= sub_total %></span></td>
|
||||
|
||||
</tr>
|
||||
<% sub_total = 0.0%>
|
||||
<% count = 0%>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<!-- end sub total -->
|
||||
|
||||
<% end %>
|
||||
|
||||
<tr style="border-top:2px solid grey;">
|
||||
<td colspan="3"> </td>
|
||||
<td>Total Item</td>
|
||||
<td><span><%= total_qty%></span></td>
|
||||
<td>Total Amount</td>
|
||||
<td><span><%= grand_total%></span></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
<tr>
|
||||
<td colspan="5"> </td>
|
||||
<td>Cash Received</td>
|
||||
<td><span><%= @cash_data - @change_amount %></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5"> </td>
|
||||
<td>Card Sales</td>
|
||||
<td><span><%= @card_data %></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5"> </td>
|
||||
<td>Credit Sales</td>
|
||||
<td><span><%= @credit_data %></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5"> </td>
|
||||
<td>FOC Sales</td>
|
||||
<td><span><%= @foc_data %></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5"> </td>
|
||||
<td>Discount Amount</td>
|
||||
<td><span><%= @discount_data %></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5"> </td>
|
||||
<td>Grand Total</td>
|
||||
<!-- <td><span class="double_underline"><%= grand_total.to_f - @discount_data.to_f%></span></td> -->
|
||||
<td><span class="double_underline"><%= @grand_total - @change_amount%></span></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container margin-top-20">
|
||||
<div class="card row">
|
||||
<div class="table-responsive">
|
||||
|
||||
|
||||
<table class="table table-striped" id="items_table" border="0">
|
||||
<thead>
|
||||
|
||||
<tr>
|
||||
<th colspan="7"> From Date : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - To Date : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%></th>
|
||||
</tr>
|
||||
<% if @shift_from %>
|
||||
<tr>
|
||||
<% if @shift_data.employee %>
|
||||
<% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %>
|
||||
<% end %>
|
||||
<th colspan="7">Shift Name = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )</th>
|
||||
</tr>
|
||||
<% end %>
|
||||
<tr>
|
||||
<th> </th>
|
||||
<th>Menu Category</th>
|
||||
<th>Code</th>
|
||||
<th>Product</th>
|
||||
<th>Total Item</th>
|
||||
<th>Unit Price</th>
|
||||
<th>Revenue</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% unless @sale_data.blank? %>
|
||||
<% acc_arr = Array.new %>
|
||||
<% cate_arr = Array.new %>
|
||||
|
||||
<% sub_total = 0.0 %>
|
||||
<% count = 0%>
|
||||
<% total_price = 0.0 %>
|
||||
<% cate_count = 0 %>
|
||||
<% acc_count = 0%>
|
||||
<% grand_total = 0%>
|
||||
<% total_qty = 0%>
|
||||
<% total_amount = 0 %>
|
||||
<% discount = 0%>
|
||||
|
||||
<% @sale_data.each do |sale| %>
|
||||
<% total_qty += sale.total_item %>
|
||||
|
||||
<% if !acc_arr.include?(sale.account_id) %>
|
||||
<tr>
|
||||
<td><b><%= sale.account_name %></b></td>
|
||||
<td colspan="4"> </td>
|
||||
<td>Total Price By <%= sale.account_name %></td>
|
||||
<td>
|
||||
<% @totalByAccount.each do |account, total| %>
|
||||
<% if sale.account_id == account %>
|
||||
<b><%= total %></b>
|
||||
<% grand_total += total %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<% acc_arr.push(sale.account_id) %>
|
||||
|
||||
<% end %>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<% if !cate_arr.include?(sale.menu_category_id) %>
|
||||
<td><%= sale.menu_category_name %></td>
|
||||
<% cate_arr.push(sale.menu_category_id) %>
|
||||
<% else %>
|
||||
<td> </td>
|
||||
<% end %>
|
||||
<td><%= sale.item_code rescue '-' %></td>
|
||||
<td><%= sale.product_name rescue '-' %></td>
|
||||
<td><%= sale.total_item rescue '-' %></td>
|
||||
<td><%= sale.unit_price rescue '-' %></td>
|
||||
<td><%= sale.grand_total rescue '-' %></td>
|
||||
|
||||
</tr>
|
||||
|
||||
<!-- sub total -->
|
||||
<% @menu_cate_count.each do |key,value| %>
|
||||
<% if sale.menu_category_id == key %>
|
||||
|
||||
<% count = count + 1 %>
|
||||
<% sub_total += sale.grand_total %>
|
||||
<% if count == value %>
|
||||
<tr>
|
||||
<td colspan="5"> </td>
|
||||
<td>Sub Total</td>
|
||||
<td ><span class="underline"><%= sub_total %></span></td>
|
||||
|
||||
</tr>
|
||||
<% sub_total = 0.0%>
|
||||
<% count = 0%>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<!-- end sub total -->
|
||||
|
||||
<% end %>
|
||||
|
||||
<tr style="border-top:2px solid grey;">
|
||||
<td colspan="3"> </td>
|
||||
<td>Total Item</td>
|
||||
<td><span><%= total_qty%></span></td>
|
||||
<td>Total Amount</td>
|
||||
<td><span><%= grand_total%></span></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
<tr>
|
||||
<td colspan="5"> </td>
|
||||
<td>Cash Received</td>
|
||||
<td><span><%= @cash_data - @change_amount %></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5"> </td>
|
||||
<td>Card Sales</td>
|
||||
<td><span><%= @card_data %></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5"> </td>
|
||||
<td>Credit Sales</td>
|
||||
<td><span><%= @credit_data %></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5"> </td>
|
||||
<td>FOC Sales</td>
|
||||
<td><span><%= @foc_data %></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5"> </td>
|
||||
<td>Discount Amount</td>
|
||||
<td><span><%= @discount_data %></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5"> </td>
|
||||
<td>Grand Total</td>
|
||||
<!-- <td><span class="double_underline"><%= grand_total.to_f - @discount_data.to_f%></span></td> -->
|
||||
<td><span class="double_underline"><%= @grand_total - @change_amount%></span></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(function(){
|
||||
|
||||
@@ -273,5 +277,5 @@
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@@ -1,87 +1,85 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %>
|
||||
<% if period_type != false %>
|
||||
<div class="row">
|
||||
<div class="form-group col-md-2">
|
||||
<label>Select Period</label>
|
||||
<select name="period" id="sel_period" class="form-control">
|
||||
<option value="0">Today</option>
|
||||
<option value="1">Yesterday</option>
|
||||
<option value="2">This week</option>
|
||||
<option value="3">Last week</option>
|
||||
<option value="4">Last 7 days</option>
|
||||
<option value="5">This month</option>
|
||||
<option value="6">Last month</option>
|
||||
<option value="7">Last 30 days</option>
|
||||
<option value="8">This year</option>
|
||||
<option value="9">Last year</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<!-- <label class="">Select Shift Period</label> -->
|
||||
<label class="">From</label>
|
||||
<input data-behaviour='datepicker' class="form-control" name="from" id="from" type="text" placeholder="From date">
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label class="">To</label>
|
||||
<input data-behaviour='datepicker' class="form-control" name="to" id="to" type="text" placeholder="To date">
|
||||
</div>
|
||||
<div class="form-group col-md-2">
|
||||
<label class="">All Shift</label>
|
||||
<select class="form-control select" name="shift_name" id="shift_name" >
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group col-md-2 margin-top-20">
|
||||
<input type="submit" value="Generate Report" class='btn btn-primary'>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %>
|
||||
<% if period_type != false %>
|
||||
<div class="row">
|
||||
<div class="form-group col-md-2">
|
||||
<label>Select Period</label>
|
||||
<select name="period" id="sel_period" class="form-control">
|
||||
<option value="0">Today</option>
|
||||
<option value="1">Yesterday</option>
|
||||
<option value="2">This week</option>
|
||||
<option value="3">Last week</option>
|
||||
<option value="4">Last 7 days</option>
|
||||
<option value="5">This month</option>
|
||||
<option value="6">Last month</option>
|
||||
<option value="7">Last 30 days</option>
|
||||
<option value="8">This year</option>
|
||||
<option value="9">Last year</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<!-- <label class="">Select Shift Period</label> -->
|
||||
<label class="">From</label>
|
||||
<input data-behaviour='datepicker' class="form-control" name="from" id="from" type="text" placeholder="From date">
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label class="">To</label>
|
||||
<input data-behaviour='datepicker' class="form-control" name="to" id="to" type="text" placeholder="To date">
|
||||
</div>
|
||||
<div class="form-group col-md-2">
|
||||
<label class="">All Shift</label>
|
||||
<select class="form-control select" name="shift_name" id="shift_name" >
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group col-md-2 margin-top-20">
|
||||
<input type="submit" value="Generate Report" class='btn btn-primary'>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$('#custom_excel').hide();
|
||||
|
||||
$('#custom_excel').click(function(){
|
||||
var url = $('#custom_excel').attr('data-url');
|
||||
$('#frm_report').attr('action',url)
|
||||
$('#frm_report').submit();
|
||||
$(function(){
|
||||
$('#custom_excel').hide();
|
||||
|
||||
$('#custom_excel').click(function(){
|
||||
var url = $('#custom_excel').attr('data-url');
|
||||
$('#frm_report').attr('action',url)
|
||||
$('#frm_report').submit();
|
||||
// window.location = url;
|
||||
});
|
||||
|
||||
var item = $('#item').val();
|
||||
var payment_type = $('#payment_type');
|
||||
|
||||
if(item == 'order'){
|
||||
$('#cashier').hide();
|
||||
$('#waiter').show();
|
||||
if(payment_type){
|
||||
$('#payment_type').hide();
|
||||
}
|
||||
}
|
||||
else if(item == 'sale'){
|
||||
$('#waiter').hide();
|
||||
$('#cashier').show();
|
||||
}
|
||||
else{
|
||||
$('#waiter').hide();
|
||||
$('#cashier').show();
|
||||
$("#item").val('sale');
|
||||
}
|
||||
});
|
||||
|
||||
var item = $('#item').val();
|
||||
var payment_type = $('#payment_type');
|
||||
|
||||
if(item == 'order'){
|
||||
$('#cashier').hide();
|
||||
$('#waiter').show();
|
||||
if(payment_type){
|
||||
$('#payment_type').hide();
|
||||
}
|
||||
}
|
||||
else if(item == 'sale'){
|
||||
$('#waiter').hide();
|
||||
$('#cashier').show();
|
||||
}
|
||||
else{
|
||||
$('#waiter').hide();
|
||||
$('#cashier').show();
|
||||
$("#item").val('sale');
|
||||
}
|
||||
});
|
||||
|
||||
//Reset the form to pervious values
|
||||
<% if params[:shift_name].to_i > 0%>
|
||||
shift_id = '<%= params[:shift_name] %>'
|
||||
local_date = '<%= @shift.shift_started_at.utc.getlocal.strftime("%e %b %I:%M%p")%> -<%= @shift.shift_closed_at.utc.getlocal.strftime("%e %b %I:%M%p") %>'
|
||||
var shift = $('#shift_name');
|
||||
str = '<option value="'+ shift_id +'" '+ 'selected = "selected"' +'>' + local_date + '</option>';
|
||||
shift.append(str);
|
||||
shift_id = '<%= params[:shift_name] %>'
|
||||
local_date = '<%= @shift.shift_started_at.utc.getlocal.strftime("%e %b %I:%M%p")%> -<%= @shift.shift_closed_at.utc.getlocal.strftime("%e %b %I:%M%p") %>'
|
||||
var shift = $('#shift_name');
|
||||
str = '<option value="'+ shift_id +'" '+ 'selected = "selected"' +'>' + local_date + '</option>';
|
||||
shift.append(str);
|
||||
<% end %>
|
||||
$("#from").val("<%=params[:from]%>");
|
||||
$("#to").val("<%=params[:to]%>");
|
||||
@@ -89,9 +87,9 @@ $("#sel_period").val(<%=params[:period]%>);
|
||||
$("#sel_sale_type").val(<%=params[:sale_type]%>);
|
||||
|
||||
<% if params[:period_type] == 1 || params[:period_type] == "1" %>
|
||||
$("#rd_period_type_1").attr("checked","checked");
|
||||
$("#rd_period_type_1").attr("checked","checked");
|
||||
<% else %>
|
||||
$("#rd_period_type_0").attr("checked","checked");
|
||||
$("#rd_period_type_0").attr("checked","checked");
|
||||
<% end %>
|
||||
$(".btn-group button").removeClass("active");
|
||||
<% report_type = params[:report_type].blank? ? "0" : params[:report_type] %>
|
||||
|
||||
@@ -1,119 +1,121 @@
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= dashboard_path %>">Home</a></li>
|
||||
<li>Shift Sale Report</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= dashboard_path %>">Home</a></li>
|
||||
<li>Shift Sale Report</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
<%= render :partial=>'shift_sale_report_filter',
|
||||
:locals=>{ :period_type => true, :shift_name => true, :report_path =>reports_shiftsale_index_path} %>
|
||||
<hr />
|
||||
</div>
|
||||
<!-- <div class="container"> -->
|
||||
<%= render :partial=>'shift_sale_report_filter',
|
||||
:locals=>{ :period_type => true, :shift_name => true, :report_path =>reports_shiftsale_index_path} %>
|
||||
<hr />
|
||||
<!-- </div> -->
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12 text-right">
|
||||
<a href="javascript:export_to('<%=reports_shiftsale_index_path%>.xls')" class = "btn btn-default">Export to Excel</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="container"> -->
|
||||
<!-- <div class="row"> -->
|
||||
<div class="text-right">
|
||||
<a href="javascript:export_to('<%=reports_shiftsale_index_path%>.xls')" class = "btn btn-default">Export to Excel</a>
|
||||
</div>
|
||||
<!-- </div> -->
|
||||
<!-- </div> -->
|
||||
|
||||
<div class="container margin-top-20">
|
||||
<div class="margin-top-20">
|
||||
<!-- <div class="span11">
|
||||
<div id="report_container" style="min-width: 400px; height: 400px; margin: 0 auto"></div>
|
||||
</div> -->
|
||||
<div class="card row">
|
||||
<div class="table-responsive">
|
||||
<div class="card">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="7"> From Date : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %>
|
||||
- To Date : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%>
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
<% if @shift_from %>
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="7"> From Date : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %>
|
||||
- To Date : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%>
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
<% if @shift_from %>
|
||||
<tr>
|
||||
<% if @shift_data.employee %>
|
||||
<% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %>
|
||||
<% end %>
|
||||
<th colspan="7">Shift Name = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )</th>
|
||||
</tr>
|
||||
<% end %>
|
||||
<tr>
|
||||
<th>Cashier Station</th>
|
||||
<th>Cashier Name</th>
|
||||
<th>Shift Name</th>
|
||||
<!-- <th>Void Amount</th> -->
|
||||
<th>Cash Payment</th>
|
||||
<!-- <th>Credit Charges</th> -->
|
||||
<th>Credit Payment</th>
|
||||
<!-- <th>FOC Payment</th> -->
|
||||
<th>Other Payment</th>
|
||||
<% end %>
|
||||
<tr>
|
||||
<th>Cashier Station</th>
|
||||
<th>Cashier Name</th>
|
||||
<th>Shift Name</th>
|
||||
<!-- <th>Void Amount</th> -->
|
||||
<th>Cash Payment</th>
|
||||
<!-- <th>Credit Charges</th> -->
|
||||
<th>Credit Payment</th>
|
||||
<!-- <th>FOC Payment</th> -->
|
||||
<th>Other Payment</th>
|
||||
<!-- <th>Grand Total
|
||||
<br/>Rounding Adj</th> -->
|
||||
<br/>Rounding Adj</th> -->
|
||||
<!-- <th>Rounding Adj</th> -->
|
||||
<th>Grand Total</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% void = 0%>
|
||||
<% cash = 0%>
|
||||
<% credit = 0%>
|
||||
<% accept_credit = 0%>
|
||||
<% foc = 0%>
|
||||
<% card = 0%>
|
||||
<% total = 0%>
|
||||
<% rounding_adj = 0%>
|
||||
<% g_total = 0 %>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% void = 0%>
|
||||
<% cash = 0%>
|
||||
<% credit = 0%>
|
||||
<% accept_credit = 0%>
|
||||
<% foc = 0%>
|
||||
<% card = 0%>
|
||||
<% total = 0%>
|
||||
<% rounding_adj = 0%>
|
||||
<% g_total = 0 %>
|
||||
|
||||
<% @sale_data.each do |result|%>
|
||||
<tr>
|
||||
<td>
|
||||
<%= result.cashier_terminal.name rescue '-'%>
|
||||
</td>
|
||||
<td>
|
||||
<%= result.employee.name rescue '-'%>
|
||||
</td>
|
||||
<td><%= result.shift_started_at.strftime("%e %b %I:%M%p") rescue '-' %> -
|
||||
<%= result.shift_closed_at.strftime("%e %b %I:%M%p") rescue '-' %>
|
||||
</td>
|
||||
<!-- <td style='color:red;'>(<%= sprintf "%.2f",result.void_amount.to_f.to_d rescue '-'%>)</td> -->
|
||||
<td><%= sprintf "%.2f",result.cash_sales.to_f.to_d rescue '-'%></td>
|
||||
<td><%= sprintf "%.2f",result.credit_sales.to_f.to_d rescue '-'%></td>
|
||||
<!-- <td><%= sprintf "%.2f",result.accept_credit_amount.to_f.to_d rescue '-'%></td> -->
|
||||
<% @sale_data.each do |result|%>
|
||||
<tr>
|
||||
<td>
|
||||
<%= result.cashier_terminal.name rescue '-'%>
|
||||
</td>
|
||||
<td>
|
||||
<%= result.employee.name rescue '-'%>
|
||||
</td>
|
||||
<td><%= result.shift_started_at.strftime("%e %b %I:%M%p") rescue '-' %> -
|
||||
<%= result.shift_closed_at.strftime("%e %b %I:%M%p") rescue '-' %>
|
||||
</td>
|
||||
<!-- <td style='color:red;'>(<%= sprintf "%.2f",result.void_amount.to_f.to_d rescue '-'%>)</td> -->
|
||||
<td><%= sprintf "%.2f",result.cash_sales.to_f.to_d rescue '-'%></td>
|
||||
<td><%= sprintf "%.2f",result.credit_sales.to_f.to_d rescue '-'%></td>
|
||||
<!-- <td><%= sprintf "%.2f",result.accept_credit_amount.to_f.to_d rescue '-'%></td> -->
|
||||
<!-- <td><%= sprintf "%.2f",result.foc_amount.to_f.to_d rescue '-'%></td>
|
||||
<td><%= sprintf "%.2f",result.card_amount.to_f.to_d rescue '-'%></td> -->
|
||||
<td><%= sprintf "%.2f",result.other_sales.to_f.to_d rescue '-'%></td>
|
||||
<td><%= sprintf "%.2f",result.grand_total.to_f.to_d rescue '-'%></td>
|
||||
|
||||
<!-- <td><%= sprintf "%.2f",result.rounding_adj.to_f.to_d rescue '-'%></td> -->
|
||||
<!-- <td><%= sprintf "%.2f",result.rounding_adj.to_f.to_d rescue '-'%></td> -->
|
||||
<% grand_total = result.grand_total.to_f %>
|
||||
<!-- <td><%= sprintf "%.2f",grand_tota.to_f.to_d rescue '-'%></td> -->
|
||||
</tr>
|
||||
<% cash += result.cash_sales.to_f %>
|
||||
<% credit += result.credit_sales.to_f %>
|
||||
<% card += result.other_sales.to_f %>
|
||||
|
||||
<% total += result.grand_total.to_f %>
|
||||
<% g_total += grand_total.to_f %>
|
||||
<!-- <td><%= sprintf "%.2f",grand_tota.to_f.to_d rescue '-'%></td> -->
|
||||
</tr>
|
||||
<% cash += result.cash_sales.to_f %>
|
||||
<% credit += result.credit_sales.to_f %>
|
||||
<% card += result.other_sales.to_f %>
|
||||
|
||||
<% end %>
|
||||
<% total += result.grand_total.to_f %>
|
||||
<% g_total += grand_total.to_f %>
|
||||
|
||||
<tr style="border-top: 3px solid grey;">
|
||||
<td colspan="3"></td>
|
||||
<!-- <td style='color:red;'><b>(<%= sprintf("%.2f",void) rescue '-'%>)</b></td> -->
|
||||
<td><b><%= sprintf("%.2f",cash) rescue '-'%></b></td>
|
||||
<td><b><%= sprintf("%.2f",credit) rescue '-'%></b></td>
|
||||
<!-- <td><b><%= sprintf("%.2f",accept_credit) rescue '-'%></b></td> -->
|
||||
<!-- <td><b><%= sprintf("%.2f",foc) rescue '-'%></b></td> -->
|
||||
<td><b><%= sprintf("%.2f",card) rescue '-'%></b></td>
|
||||
<!-- <td><b><%= sprintf("%.2f",total) rescue '-'%></b></td> -->
|
||||
<!-- <td><b><%= sprintf("%.2f",rounding_adj) rescue '-'%></b></td> -->
|
||||
<td><b><%= sprintf("%.2f",g_total) rescue '-'%></b></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<% end %>
|
||||
|
||||
<tr style="border-top: 3px solid grey;">
|
||||
<td colspan="3"></td>
|
||||
<!-- <td style='color:red;'><b>(<%= sprintf("%.2f",void) rescue '-'%>)</b></td> -->
|
||||
<td><b><%= sprintf("%.2f",cash) rescue '-'%></b></td>
|
||||
<td><b><%= sprintf("%.2f",credit) rescue '-'%></b></td>
|
||||
<!-- <td><b><%= sprintf("%.2f",accept_credit) rescue '-'%></b></td> -->
|
||||
<!-- <td><b><%= sprintf("%.2f",foc) rescue '-'%></b></td> -->
|
||||
<td><b><%= sprintf("%.2f",card) rescue '-'%></b></td>
|
||||
<!-- <td><b><%= sprintf("%.2f",total) rescue '-'%></b></td> -->
|
||||
<!-- <td><b><%= sprintf("%.2f",rounding_adj) rescue '-'%></b></td> -->
|
||||
<td><b><%= sprintf("%.2f",g_total) rescue '-'%></b></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<%= form_tag report_path, :method => :get, :id => "frm_report", :class => "form" do %>
|
||||
<% if period_type != false %>
|
||||
<div class="row">
|
||||
@@ -38,8 +37,7 @@
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
@@ -1,87 +1,89 @@
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= dashboard_path %>">Home</a></li>
|
||||
<li>Stock Check Report</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= dashboard_path %>">Home</a></li>
|
||||
<li>Stock Check Report</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
<%= render :partial => 'stock_check_report_filter',
|
||||
:locals => {:period_type => true, :shift_name => true, :report_path => reports_stock_check_index_path} %>
|
||||
<hr/>
|
||||
</div>
|
||||
<!-- <div class="container"> -->
|
||||
<%= render :partial => 'stock_check_report_filter',
|
||||
:locals => {:period_type => true, :shift_name => true, :report_path => reports_stock_check_index_path} %>
|
||||
<hr/>
|
||||
<!-- </div> -->
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12 text-right">
|
||||
<!-- <div class="container"> -->
|
||||
<!-- <div class="row"> -->
|
||||
<div class="text-right">
|
||||
<a href="javascript:export_to('<%= reports_stock_check_index_path %>.xls')" class="btn btn-default">Export to
|
||||
Excel</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- </div> -->
|
||||
<!-- </div> -->
|
||||
|
||||
<div class="container margin-top-20">
|
||||
<div class="card row">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="8"><i> From Date </i>: <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - <i>To Date</i> : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Stock Check Reason</th>
|
||||
<th>Checked By</th>
|
||||
<th>Item Name</th>
|
||||
<th>Stock Count</th>
|
||||
<th>Stock Balance</th>
|
||||
<th>Different</th>
|
||||
<th>Remark</th>
|
||||
<th>Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% total_stock_count = 0 %>
|
||||
<% total_stock_balance = 0 %>
|
||||
<% total_different = 0 %>
|
||||
<div class="margin-top-20">
|
||||
<div class="card">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="8"><i> From Date </i>: <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - <i>To Date</i> : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Stock Check Reason</th>
|
||||
<th>Checked By</th>
|
||||
<th>Item Name</th>
|
||||
<th>Stock Count</th>
|
||||
<th>Stock Balance</th>
|
||||
<th>Different</th>
|
||||
<th>Remark</th>
|
||||
<th>Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% total_stock_count = 0 %>
|
||||
<% total_stock_balance = 0 %>
|
||||
<% total_different = 0 %>
|
||||
|
||||
<% @transaction.each do |result| %>
|
||||
<tr>
|
||||
<td><%= result.stock_check.reason rescue '-' %></td>
|
||||
<td><%= Employee.find(result.stock_check.check_by).name rescue '-' %></td>
|
||||
<td>
|
||||
<% menu_item = MenuItemInstance.find_by_item_instance_code(result.item_code)%>
|
||||
<% if menu_item.nil? %>
|
||||
<% @transaction.each do |result| %>
|
||||
<tr>
|
||||
<td><%= result.stock_check.reason rescue '-' %></td>
|
||||
<td><%= Employee.find(result.stock_check.check_by).name rescue '-' %></td>
|
||||
<td>
|
||||
<% menu_item = MenuItemInstance.find_by_item_instance_code(result.item_code)%>
|
||||
<% if menu_item.nil? %>
|
||||
<%= Product.find_by_item_code(result.item_code).name rescue "-" %>
|
||||
<% else %>
|
||||
<% else %>
|
||||
<%= menu_item.menu_item.name rescue "-" %>
|
||||
- <%= menu_item.item_instance_name rescue "-" %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td><%= result.stock_count rescue '-' %></td>
|
||||
<td><%= result.stock_balance rescue '-' %></td>
|
||||
<td><%= result.different rescue '-' %></td>
|
||||
<td><%= result.remark rescue '-' %></td>
|
||||
<td><%= result.created_at.strftime('%e %b %Y %I:%M %p') rescue '-' %></td>
|
||||
</tr>
|
||||
<% !result.stock_count.nil? ? total_stock_count += result.stock_count : total_stock_count += 0 %>
|
||||
<% !result.stock_balance.nil? ? total_stock_balance += result.stock_balance : total_stock_balance += 0 %>
|
||||
<% !result.different.nil? ? total_different += result.different : total_different += 0 %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td><%= result.stock_count rescue '-' %></td>
|
||||
<td><%= result.stock_balance rescue '-' %></td>
|
||||
<td><%= result.different rescue '-' %></td>
|
||||
<td><%= result.remark rescue '-' %></td>
|
||||
<td><%= result.created_at.strftime('%e %b %Y %I:%M %p') rescue '-' %></td>
|
||||
</tr>
|
||||
<% !result.stock_count.nil? ? total_stock_count += result.stock_count : total_stock_count += 0 %>
|
||||
<% !result.stock_balance.nil? ? total_stock_balance += result.stock_balance : total_stock_balance += 0 %>
|
||||
<% !result.different.nil? ? total_different += result.different : total_different += 0 %>
|
||||
<% end %>
|
||||
|
||||
<tr style="border-top: 3px solid grey;">
|
||||
<td colspan="3"></td>
|
||||
<td><b><%= total_stock_count rescue '-' %></b></td>
|
||||
<td><b><%= total_stock_balance rescue '-' %></b></td>
|
||||
<td><b><%= total_different rescue '-' %></b></td>
|
||||
<td colspan="2"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(function () {
|
||||
<tr style="border-top: 3px solid grey;">
|
||||
<td colspan="3"></td>
|
||||
<td><b><%= total_stock_count rescue '-' %></b></td>
|
||||
<td><b><%= total_stock_balance rescue '-' %></b></td>
|
||||
<td><b><%= total_different rescue '-' %></b></td>
|
||||
<td colspan="2"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(function () {
|
||||
|
||||
});
|
||||
</script>
|
||||
});
|
||||
</script>
|
||||
@@ -1,125 +1,120 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %>
|
||||
<% if period_type != false %>
|
||||
<div class="row">
|
||||
<div class="form-group col-md-2">
|
||||
<label>Select Period</label>
|
||||
<select name="period" id="sel_period" class="form-control">
|
||||
<option value="">Select Period</option>
|
||||
<option value="0">Today</option>
|
||||
<option value="1">Yesterday</option>
|
||||
<option value="2">This week</option>
|
||||
<option value="3">Last week</option>
|
||||
<option value="4">Last 7 days</option>
|
||||
<option value="5">This month</option>
|
||||
<option value="6">Last month</option>
|
||||
<option value="7">Last 30 days</option>
|
||||
<option value="8">This year</option>
|
||||
<option value="9">Last year</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-2">
|
||||
<!-- <label class="">Select Shift Period</label> -->
|
||||
<label class="">From</label>
|
||||
<input data-behaviour='datepicker' class="form-control" name="from" id="from" type="text" placeholder="From date">
|
||||
</div>
|
||||
<div class="form-group col-md-2">
|
||||
<label class="">To</label>
|
||||
<input data-behaviour='datepicker' class="form-control" name="to" id="to" type="text" placeholder="To date">
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label class="">All Shift</label>
|
||||
<select class="form-control select" name="shift_name" id="shift_name" >
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group col-md-1 margin-top-20">
|
||||
<input type="submit" value="Generate Report" class='btn btn-primary'>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %>
|
||||
<% if period_type != false %>
|
||||
<div class="row">
|
||||
<div class="form-group col-md-2">
|
||||
<label>Select Period</label>
|
||||
<select name="period" id="sel_period" class="form-control">
|
||||
<option value="">Select Period</option>
|
||||
<option value="0">Today</option>
|
||||
<option value="1">Yesterday</option>
|
||||
<option value="2">This week</option>
|
||||
<option value="3">Last week</option>
|
||||
<option value="4">Last 7 days</option>
|
||||
<option value="5">This month</option>
|
||||
<option value="6">Last month</option>
|
||||
<option value="7">Last 30 days</option>
|
||||
<option value="8">This year</option>
|
||||
<option value="9">Last year</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-2">
|
||||
<!-- <label class="">Select Shift Period</label> -->
|
||||
<label class="">From</label>
|
||||
<input data-behaviour='datepicker' class="form-control" name="from" id="from" type="text" placeholder="From date">
|
||||
</div>
|
||||
<div class="form-group col-md-2">
|
||||
<label class="">To</label>
|
||||
<input data-behaviour='datepicker' class="form-control" name="to" id="to" type="text" placeholder="To date">
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label class="">All Shift</label>
|
||||
<select class="form-control select" name="shift_name" id="shift_name" >
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group col-md-1 margin-top-20">
|
||||
<input type="submit" value="Generate Report" class='btn btn-primary'>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$('#custom_excel').hide();
|
||||
|
||||
$('#custom_excel').click(function(){
|
||||
var url = $('#custom_excel').attr('data-url');
|
||||
$('#frm_report').attr('action',url)
|
||||
$('#frm_report').submit();
|
||||
$(function(){
|
||||
$('#custom_excel').hide();
|
||||
|
||||
$('#custom_excel').click(function(){
|
||||
var url = $('#custom_excel').attr('data-url');
|
||||
$('#frm_report').attr('action',url)
|
||||
$('#frm_report').submit();
|
||||
// window.location = url;
|
||||
});
|
||||
|
||||
var item = $('#item').val();
|
||||
var payment_type = $('#payment_type');
|
||||
|
||||
if(item == 'order'){
|
||||
$('#cashier').hide();
|
||||
$('#waiter').show();
|
||||
if(payment_type){
|
||||
$('#payment_type').hide();
|
||||
}
|
||||
}
|
||||
else if(item == 'sale'){
|
||||
$('#waiter').hide();
|
||||
$('#cashier').show();
|
||||
}
|
||||
else{
|
||||
$('#waiter').hide();
|
||||
$('#cashier').show();
|
||||
$("#item").val('sale');
|
||||
}
|
||||
});
|
||||
|
||||
<% if params[:shift_name].to_i > 0%>
|
||||
var item = $('#item').val();
|
||||
var payment_type = $('#payment_type');
|
||||
|
||||
if(item == 'order'){
|
||||
$('#cashier').hide();
|
||||
$('#waiter').show();
|
||||
if(payment_type){
|
||||
$('#payment_type').hide();
|
||||
}
|
||||
}
|
||||
else if(item == 'sale'){
|
||||
$('#waiter').hide();
|
||||
$('#cashier').show();
|
||||
}
|
||||
else{
|
||||
$('#waiter').hide();
|
||||
$('#cashier').show();
|
||||
$("#item").val('sale');
|
||||
}
|
||||
});
|
||||
|
||||
<% if params[:shift_name].to_i > 0%>
|
||||
shift_id = '<%= params[:shift_name] %>'
|
||||
local_date = '<%= @shift_from %> - <%= @shift_to %> '
|
||||
var shift = $('#shift_name');
|
||||
str = '<option value="'+ shift_id +'" '+ 'selected = "selected"' +'>' + local_date + '</option>';
|
||||
shift.append(str);
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
$("#from").val("<%=params[:from] rescue '-'%>");
|
||||
$("#to").val("<%=params[:to] rescue '-'%>");
|
||||
$("#sel_period").val(<%=params[:period] rescue '-'%>);
|
||||
$("#sel_sale_type").val(<%=params[:sale_type] rescue '-'%>);
|
||||
$("#from").val("<%=params[:from] rescue '-'%>");
|
||||
$("#to").val("<%=params[:to] rescue '-'%>");
|
||||
$("#sel_period").val(<%=params[:period] rescue '-'%>);
|
||||
$("#sel_sale_type").val(<%=params[:sale_type] rescue '-'%>);
|
||||
// shift = $(".shift-id").text()
|
||||
// if (shift.length>0) {
|
||||
// $('.shift_name > option[value="'+shift+'"]').attr('selected','selected');
|
||||
// }
|
||||
|
||||
<% if params[:period_type] == 1 || params[:period_type] == "1" %>
|
||||
$("#rd_period_type_1").attr("checked","checked");
|
||||
<% else %>
|
||||
$("#rd_period_type_0").attr("checked","checked");
|
||||
<% end %>
|
||||
$(".btn-group button").removeClass("active");
|
||||
<% report_type = params[:report_type].blank? ? "0" : params[:report_type] %>
|
||||
$("#btn_report_type_<%= report_type %>").addClass("active");
|
||||
<% if params[:period_type] == 1 || params[:period_type] == "1" %>
|
||||
$("#rd_period_type_1").attr("checked","checked");
|
||||
<% else %>
|
||||
$("#rd_period_type_0").attr("checked","checked");
|
||||
<% end %>
|
||||
$(".btn-group button").removeClass("active");
|
||||
<% report_type = params[:report_type].blank? ? "0" : params[:report_type] %>
|
||||
$("#btn_report_type_<%= report_type %>").addClass("active");
|
||||
|
||||
$('#item').change(function(){
|
||||
var item = $('#item').val();
|
||||
var payment_type = $('#payment_type');
|
||||
$('#item').change(function(){
|
||||
var item = $('#item').val();
|
||||
var payment_type = $('#payment_type');
|
||||
|
||||
if(item == 'sale'){
|
||||
$('#waiter').hide();
|
||||
$('#cashier').show();
|
||||
if(payment_type){
|
||||
$('#payment_type').show();
|
||||
}
|
||||
}
|
||||
else{
|
||||
$('#cashier').hide();
|
||||
$('#waiter').show();
|
||||
if(payment_type){
|
||||
$('#payment_type').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
if(item == 'sale'){
|
||||
$('#waiter').hide();
|
||||
$('#cashier').show();
|
||||
if(payment_type){
|
||||
$('#payment_type').show();
|
||||
}
|
||||
}
|
||||
else{
|
||||
$('#cashier').hide();
|
||||
$('#waiter').show();
|
||||
if(payment_type){
|
||||
$('#payment_type').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -1,99 +1,97 @@
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= dashboard_path %>">Home</a></li>
|
||||
<li>Void Sale Report</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= dashboard_path %>">Home</a></li>
|
||||
<li>Void Sale Report</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
<%= render :partial=>'shift_sale_report_filter',
|
||||
:locals=>{ :period_type => true, :shift_name => true, :report_path =>reports_void_sale_index_path} %>
|
||||
<hr />
|
||||
</div>
|
||||
<!-- <div class="container"> -->
|
||||
<%= render :partial=>'shift_sale_report_filter',
|
||||
:locals=>{ :period_type => true, :shift_name => true, :report_path =>reports_void_sale_index_path} %>
|
||||
<hr />
|
||||
<!-- </div> -->
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<!-- <div class="container"> -->
|
||||
<!-- <div class="row"> -->
|
||||
<div class="col-md-12 text-right">
|
||||
<a href="javascript:export_to('<%=reports_void_sale_index_path%>.xls')" class = "btn btn-default">Export to Excel</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- </div> -->
|
||||
<!-- </div> -->
|
||||
|
||||
<div class="container margin-top-20">
|
||||
<div class="card row">
|
||||
<% if @sale_data.count > 0 %>
|
||||
<table class="table table-striped" border="0">
|
||||
<thead>
|
||||
<% if !params[:from].blank?%>
|
||||
<tr>
|
||||
<th colspan="7">From Date : <%= params[:from] rescue '-'%> , To Date : <%= params[:to] rescue '-'%></th>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% if @shift_from %>
|
||||
<tr>
|
||||
<% if @shift %>
|
||||
<% cashier_name = !@shift.nil? ? @shift[0].employee.name : '-' %>
|
||||
<% end %>
|
||||
<th colspan="3">Shift Name = <%= @shift_from rescue '-'%> - <%= @shift_to rescue '-'%> ( <%= cashier_name rescue '-'%> )</th>
|
||||
</tr>
|
||||
<% end %>
|
||||
<tr>
|
||||
<th>Receipt No</th>
|
||||
<th>Sale Date</th>
|
||||
<th>Total Amount</th>
|
||||
<th>Grand Total</th>
|
||||
<th>Rounding Adj.</th>
|
||||
<th>Grand Total + <br/>Rounding Adj.</th>
|
||||
<!-- <th>Sale Status</th> -->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% total_amount = 0.0 %>
|
||||
<% grand_total = 0.0 %>
|
||||
<% rounding_adjustment = 0.0 %>
|
||||
<% grand_rounding_adjustment = 0.0 %>
|
||||
<% @sale_data.each do |result| %>
|
||||
<% result[:items].each do |item| %>
|
||||
<tr>
|
||||
<td><%= item.receipt_no rescue '-' %> </td>
|
||||
<td><%= item.receipt_date.utc.getlocal.strftime("%e %b %I:%M%p") rescue '-' %></td>
|
||||
<td><%= item.total_amount.to_f rescue '-'%> </td>
|
||||
<td><%= item.grand_total.to_f rescue '-'%> </td>
|
||||
<td><%= item.rounding_adjustment.to_f rescue '-' %></td>
|
||||
<td><%= item.grand_total.to_f + item.rounding_adjustment.to_f rescue '-'%> </td>
|
||||
<!-- <td><%= result.sales_status rescue '-' %> </td> -->
|
||||
<!-- <td><%= item.remarks rescue '-' %> </td> -->
|
||||
</tr>
|
||||
<% total_amount = total_amount.to_f + item.total_amount.to_f %>
|
||||
<% grand_total = grand_total.to_f + item.grand_total.to_f %>
|
||||
<% rounding_adjustment = rounding_adjustment.to_f + item.rounding_adjustment.to_f %>
|
||||
<% grand_rounding_adjustment = grand_rounding_adjustment.to_f + item.grand_total.to_f + item.rounding_adjustment.to_f %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<tr style="border-top:4px double #666;font-weight:600;">
|
||||
<td colspan="2" style="text-align:center;">Total Void Amount :</td>
|
||||
<td><%= total_amount rescue '-' %></td>
|
||||
<td><%= grand_total rescue '-' %></td>
|
||||
<td><%= rounding_adjustment rescue '-'%></td>
|
||||
<td colspan="3"><%= grand_rounding_adjustment rescue '-'%></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="margin-top-20">
|
||||
<div class="card">
|
||||
<% if @sale_data.count > 0 %>
|
||||
<table class="table table-striped" border="0">
|
||||
<thead>
|
||||
<% if !params[:from].blank?%>
|
||||
<tr>
|
||||
<th colspan="7">From Date : <%= params[:from] rescue '-'%> , To Date : <%= params[:to] rescue '-'%></th>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% if @shift_from %>
|
||||
<tr>
|
||||
<% if @shift %>
|
||||
<% cashier_name = !@shift.nil? ? @shift[0].employee.name : '-' %>
|
||||
<% end %>
|
||||
<th colspan="3">Shift Name = <%= @shift_from rescue '-'%> - <%= @shift_to rescue '-'%> ( <%= cashier_name rescue '-'%> )</th>
|
||||
</tr>
|
||||
<% end %>
|
||||
<tr>
|
||||
<th>Receipt No</th>
|
||||
<th>Sale Date</th>
|
||||
<th>Total Amount</th>
|
||||
<th>Grand Total</th>
|
||||
<th>Rounding Adj.</th>
|
||||
<th>Grand Total + <br/>Rounding Adj.</th>
|
||||
<!-- <th>Sale Status</th> -->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% total_amount = 0.0 %>
|
||||
<% grand_total = 0.0 %>
|
||||
<% rounding_adjustment = 0.0 %>
|
||||
<% grand_rounding_adjustment = 0.0 %>
|
||||
<% @sale_data.each do |result| %>
|
||||
<% result[:items].each do |item| %>
|
||||
<tr>
|
||||
<td><%= item.receipt_no rescue '-' %> </td>
|
||||
<td><%= item.receipt_date.utc.getlocal.strftime("%e %b %I:%M%p") rescue '-' %></td>
|
||||
<td><%= item.total_amount.to_f rescue '-'%> </td>
|
||||
<td><%= item.grand_total.to_f rescue '-'%> </td>
|
||||
<td><%= item.rounding_adjustment.to_f rescue '-' %></td>
|
||||
<td><%= item.grand_total.to_f + item.rounding_adjustment.to_f rescue '-'%> </td>
|
||||
<!-- <td><%= result.sales_status rescue '-' %> </td> -->
|
||||
<!-- <td><%= item.remarks rescue '-' %> </td> -->
|
||||
</tr>
|
||||
<% total_amount = total_amount.to_f + item.total_amount.to_f %>
|
||||
<% grand_total = grand_total.to_f + item.grand_total.to_f %>
|
||||
<% rounding_adjustment = rounding_adjustment.to_f + item.rounding_adjustment.to_f %>
|
||||
<% grand_rounding_adjustment = grand_rounding_adjustment.to_f + item.grand_total.to_f + item.rounding_adjustment.to_f %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<tr style="border-top:4px double #666;font-weight:600;">
|
||||
<td colspan="2" style="text-align:center;">Total Void Amount :</td>
|
||||
<td><%= total_amount rescue '-' %></td>
|
||||
<td><%= grand_total rescue '-' %></td>
|
||||
<td><%= rounding_adjustment rescue '-'%></td>
|
||||
<td colspan="3"><%= grand_rounding_adjustment rescue '-'%></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(function(){
|
||||
|
||||
$(function(){
|
||||
var check_arr = [];
|
||||
|
||||
$('#sel_period').change(function(){
|
||||
|
||||
search_by_period();
|
||||
|
||||
});
|
||||
|
||||
|
||||
function search_by_period(){
|
||||
var period = $('#sel_period').val();
|
||||
var period_type = 0;
|
||||
@@ -102,15 +100,15 @@
|
||||
|
||||
show_shift_name(period,period_type,from,to,'shift_item');
|
||||
}
|
||||
|
||||
|
||||
$('#from').change(function(){
|
||||
search_by_date();
|
||||
});
|
||||
|
||||
|
||||
$('#to').change(function(){
|
||||
search_by_date();
|
||||
});
|
||||
|
||||
|
||||
function search_by_date(){
|
||||
var from = $('#from').val();
|
||||
var to = $('#to').val();
|
||||
@@ -121,7 +119,7 @@
|
||||
shift_name = from + ',' + to;
|
||||
|
||||
check_arr.push(to);
|
||||
|
||||
|
||||
console.log(check_arr.length)
|
||||
if(check_arr.length == 1){
|
||||
show_shift_name(period,period_type,from,to,'shift_item');
|
||||
@@ -130,25 +128,25 @@
|
||||
check_arr = [];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
function show_shift_name(period,period_type,from,to,shift_item){
|
||||
var shift = $('#shift_name');
|
||||
|
||||
|
||||
shift.empty();
|
||||
|
||||
|
||||
var str = '';
|
||||
var param_shift = '';
|
||||
var param_shift = '<%= params[:shift_name] rescue '-'%>';
|
||||
|
||||
url = '<%= reports_get_shift_by_date_path %>';
|
||||
|
||||
|
||||
$.get(url, {period :period, period_type :period_type, from :from, to :to, report_type :shift_item} , function(data){
|
||||
|
||||
str = '<option value="0">--- All Shift ---</option>';
|
||||
$(data.message).each(function(index){
|
||||
|
||||
|
||||
var local_date = data.message[index].local_opening_date + ' - ' + data.message[index].local_closing_date;
|
||||
var sh_date = data.message[index].opening_date + ' - ' + data.message[index].closing_date;
|
||||
var shift_id = data.message[index].shift_id ;
|
||||
@@ -163,7 +161,7 @@
|
||||
selected = '';
|
||||
}
|
||||
str += '<option value="'+ shift_id +'" '+ selected +'>' + local_date + '</option>';
|
||||
|
||||
|
||||
// console.log(sh_date)
|
||||
})
|
||||
shift.append(str);
|
||||
|
||||
@@ -37,6 +37,10 @@ Rails.application.config.assets.precompile += %w( fileinput.min.js )
|
||||
Rails.application.config.assets.precompile += %w( addorder.css )
|
||||
Rails.application.config.assets.precompile += %w( addorder.js )
|
||||
|
||||
# --- Custom SX Themem ----
|
||||
Rails.application.config.assets.precompile += %w( sx-sidebar.css )
|
||||
Rails.application.config.assets.precompile += %w( popper.min.js )
|
||||
|
||||
# --- Inventory Definition ----
|
||||
Rails.application.config.assets.precompile += %w( inventory_definitions.css )
|
||||
|
||||
|
||||
Reference in New Issue
Block a user