update ui desige for sx theme

This commit is contained in:
Aung Myo
2017-09-26 11:40:44 +06:30
parent dd9e8fe908
commit 7f5ce4e233
24 changed files with 1726 additions and 1460 deletions

View File

@@ -45,3 +45,5 @@ function export_to(path)
var form_params = $("#frm_report").serialize(); var form_params = $("#frm_report").serialize();
window.location = path+"?"+ form_params; window.location = path+"?"+ form_params;
} }

5
app/assets/javascripts/popper.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View 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;
}

View File

@@ -1,195 +1,192 @@
<div class="row">
<div class="col-md-9 col-lg-9"> <!-- Page Content -->
<h4><strong>Role Features</strong></h4> <div class="row">
<!-- <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="col-md-9 col-lg-9">
<div class="panel-group" id="accordion"> <h4><strong>Role Features</strong></h4>
<% if current_user.role == 'administrator' %> <!-- <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 panel-default"> <div class="panel-group" id="accordion">
<div class="panel-heading"> <% if current_user.role == 'administrator' %>
<h4 class="panel-title"> <div class="panel panel-default">
Administrator <div class="panel-heading">
</h4> <h4 class="panel-title">
</div> Administrator
<div id="admin" class="panel-collapse collapse in"> </h4>
<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>
</div> </div>
<% elsif current_user.role == 'manager' %> <div id="admin" class="panel-collapse collapse in">
<div class="panel panel-default"> <div class="panel-body">
<div class="panel-heading"> <ul class="col-md-4">
<h4 class="panel-title"> <li><strong>All Settings</strong></li>
Manager <ul>
</h4> <li>Zone</li>
</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> <li>OQS</li>
<ul> <li>Menu</li>
<li class="">Void</li> <li>Cashier Terminal</li>
<li class="">FOC</li> <li>Payment</li>
<li class="">Edit</li> <li>Merbership</li>
<li class="">Credit</li> <li>Print</li>
<li class="">Payment</li> <li>Employees</li>
</ul> <li>Accounts</li>
</ul> </ul>
</div> </ul>
</div> <ul class="col-md-4">
</div> <li><strong>Transactions</strong></li>
<% 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=""> <ul class="">
<li class="">Cashier Panel except Edit and Void</li> <li>Order</li>
<li class="">Sale and Order</li> <li>Sale</li>
<li class="">and Queue in CRM</li> <li>Credit Note</li>
</ul> </ul><br>
</div> <li><strong>Reports</strong></li>
</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=""> <ul class="">
<li class="">Daily Sale Report</li> <li>Daily Sale</li>
<li class="">Sale Item Report</li> <li>Sale Item</li>
<li class="">Receipt No Report</li> <li>Receipt</li>
<li class="">ShiftSale Report</li> <li>Shift Sale</li>
<li>Credit Sale</li>
<li>Void Sale</li>
</ul> </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>
</div> </div>
<% end %> </div>
</div> <% elsif current_user.role == 'manager' %>
</div> <div class="panel panel-default">
<div class="panel-heading">
<div class="col-md-3"> <h4 class="panel-title">
<div class="card" id="oqs" onclick="location.href='<%= oqs_root_path %>'"> Manager
<div class="card-content dashboard-nav">OQS</div> </h4>
</div> </div>
<div id="admin" class="panel-collapse collapse in">
<div class="card" id="origami" onclick="location.href='<%= origami_root_path %>'"> <div class="panel-body">
<div class="card-content dashboard-nav">Cashier</div> <ul class="col-md-4">
</div> <li class="">All Settings</li>
<ul class="">
<div class="card" id="crm" onclick="location.href='<%= crm_root_path %>'"> <li>Zone</li>
<div class="card-content dashboard-nav">CRM</div> <li>OQS</li>
</div> <li>Menu</li>
<li>Cashier Terminal</li>
<!-- No Needs <li>Print</li>
<div class="card" id="backend" onclick="location.href='<%= dashboard_path %>'"> <li>Employees</li>
<div class="card-content"> <li>Accounts</li>
<span class="card-title">Backend</span> </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> -->
<div class="card" id="backend" onclick="location.href='<%= inventory_path %>'"> <div class="col-md-3">
<div class="card-content dashboard-nav">Inventory</div> <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>
</div>
</div>
<div class="footer" style="background-color: inherit"> <div class="" style="background-color: inherit;">
<div class="card"> <div class="">
<div class="page-header center-text"> <div class="page-header center-text">
<h4 class="footer-header"> <h4 class="footer-header">
<%= @shop.name %> <%= @shop.name %>
</h4> </h4>
</div> </div>
<div class="center-text"> <div class="center-text">
<%= @shop.address %> <%= @shop.address %>

View File

@@ -1,10 +1,14 @@
<nav class="navbar navbar-toggleable-md fixed-top navbar-light setting_nav"> <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> <a href="#" class=" btn btn-info btn-sm " id="sx-menu-toggle" data-toggle="push-menu" role="button">
</button> <span class="fa fa-bars" ></span>
<a class="navbar-brand" href="<%= root_path %>" style="color: rgba(67, 185, 220, 0.9)">E-menu</a> </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"> <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"> <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> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Settings</a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
@@ -70,7 +74,7 @@
</li> </li>
</ul> </ul> -->
</div> </div>
<% if current_login_employee %> <% if current_login_employee %>
@@ -94,3 +98,10 @@
margin-bottom: 10px !important; margin-bottom: 10px !important;
} }
</style> </style>
<!-- Menu Toggle Script -->
<script>
$("#sx-menu-toggle").click(function(e) {
e.preventDefault();
$("#wrapper").toggleClass("toggled");
});
</script>

View 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>

View File

@@ -12,9 +12,11 @@
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= stylesheet_link_tag 'settings', 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 '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 'application', 'data-turbolinks-track': 'reload' %>
<%= javascript_include_tag 'fileinput.min', 'data-turbolinks-track': 'reload' %> <%= javascript_include_tag 'fileinput.min', 'data-turbolinks-track': 'reload' %>
<%= javascript_include_tag 'popper.min', 'data-turbolinks-track': 'reload' %>
</head> </head>
<body> <body>
@@ -35,7 +37,15 @@
<%= message %> <%= message %>
</div> </div>
<% end %> <% end %>
<%= yield %> <div id="wrapper">
<!-- Sidebar -->
<%=render 'layouts/sidebar' %>
<!-- /#sidebar-wrapper -->
<div id="page-content-wrapper">
<%= yield %>
</div>
</div>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">

View File

@@ -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"> <%= form_tag report_path, :method => :get, :id => "frm_report", :class => "form" do %>
<label class="">Select Date Range</label> <% if period_type != false %>
<% if @daterange %> <div class="row">
<input class="form-control" name="daterange" id="daterange" value="<%= @daterange %>" type="text" placeholder="Date Range" readonly="true">
<% else %> <div class="form-group col-md-3">
<input class="form-control" name="daterange" id="daterange" type="text" placeholder="Date Range" readonly="true"> <label class="">Select Date Range</label>
<% end %> <% if @daterange %>
</div> <input class="form-control" name="daterange" id="daterange" value="<%= @daterange %>" type="text" placeholder="Date Range" readonly="true">
<div class="form-group col-md-3"> <% else %>
<label class="">Commissioner</label> <input class="form-control" name="daterange" id="daterange" type="text" placeholder="Date Range" readonly="true">
<select class="form-control" name="commissioner" id="commissioner"> <% end %>
<option value=""></option> </div>
<% @commissioner.each do |c| %> <div class="form-group col-md-3">
<% if @com_id == c.id %> <label class="">Commissioner</label>
<option value="<%= c.id %>" selected><%= c.name %></option> <select class="form-control" name="commissioner" id="commissioner">
<% else %> <option value=""></option>
<option value="<%= c.id %>"><%= c.name %></option> <% @commissioner.each do |c| %>
<% end %> %> <% if @com_id == c.id %>
<% end %> <option value="<%= c.id %>" selected><%= c.name %></option>
</select> <% else %>
</div> <option value="<%= c.id %>"><%= c.name %></option>
<div class="form-group col-md-2 margin-top-20"> <% end %> %>
<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>
<% end %> <% end %>
</select>
<% end %> </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>
</div> <% end %>
<% end %>
<script type="text/javascript"> <script type="text/javascript">

View File

@@ -1,3 +1,5 @@
<div class="row">
<div class="col-md-12">
<div class="page-header"> <div class="page-header">
<ul class="breadcrumb"> <ul class="breadcrumb">
<li><a href="<%= dashboard_path %>">Home</a></li> <li><a href="<%= dashboard_path %>">Home</a></li>
@@ -5,23 +7,23 @@
</ul> </ul>
</div> </div>
<div class="container"> <!-- <div class="container"> -->
<%= render :partial => 'commission_report_filter', <%= render :partial => 'commission_report_filter',
:locals => {:period_type => true, :shift_name => true, :report_path => reports_commission_index_path} %> :locals => {:period_type => true, :shift_name => true, :report_path => reports_commission_index_path} %>
<hr/> <hr/>
</div> <!-- </div> -->
<div class="container"> <!-- <div class="container"> -->
<div class="row"> <!-- <div class="row"> -->
<div class="col-md-12 text-right"> <div class="text-right">
<a href="javascript:export_to('<%= reports_commission_index_path %>.xls')" class="btn btn-default">Export to <a href="javascript:export_to('<%= reports_commission_index_path %>.xls')" class="btn btn-default">Export to
Excel</a> Excel</a>
</div> </div>
</div> <!-- </div> -->
</div> <!-- </div> -->
<div class="container margin-top-20"> <div class="margin-top-20">
<div class="card row"> <div class="card">
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped"> <table class="table table-striped">
<thead> <thead>

View File

@@ -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"> <%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %>
<!-- <label class="">Select Shift Period</label> --> <% if period_type != false %>
<label class="">From</label> <div class="row">
<input data-behaviour='datepicker' class="form-control" name="from" id="from" type="text" placeholder="From date"> <div class="form-group col-md-2">
</div> <label>Select Period</label>
<div class="form-group col-md-2"> <select name="period" id="sel_period" class="form-control">
<label class="">To</label> <option value="">Select Period</option>
<input data-behaviour='datepicker' class="form-control" name="to" id="to" type="text" placeholder="To date"> <option value="0">Today</option>
</div> <option value="1">Yesterday</option>
<div class="form-group col-md-3"> <option value="2">This week</option>
<label class="">All Shift</label> <option value="3">Last week</option>
<select class="form-control select" name="shift_name" id="shift_name" > <option value="4">Last 7 days</option>
</select> <option value="5">This month</option>
</div> <option value="6">Last month</option>
<div class="form-group col-md-1 margin-top-20"> <option value="7">Last 30 days</option>
<input type="submit" value="Generate Report" class='btn btn-primary'> <option value="8">This year</option>
</div> <option value="9">Last year</option>
</div> </select>
<% end %> </div>
<% end %> <div class="form-group col-md-2">
</div> <!-- <label class="">Select Shift Period</label> -->
</div> <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"> <script type="text/javascript">
$(function(){ $(function(){
$('#custom_excel').hide(); $('#custom_excel').hide();
$('#custom_excel').click(function(){ $('#custom_excel').click(function(){
var url = $('#custom_excel').attr('data-url'); var url = $('#custom_excel').attr('data-url');
$('#frm_report').attr('action',url) $('#frm_report').attr('action',url)
$('#frm_report').submit(); $('#frm_report').submit();
// window.location = url; // window.location = url;
}); });
var item = $('#item').val(); var item = $('#item').val();
var payment_type = $('#payment_type'); var payment_type = $('#payment_type');
if(item == 'order'){ if(item == 'order'){
$('#cashier').hide(); $('#cashier').hide();
$('#waiter').show(); $('#waiter').show();
if(payment_type){ if(payment_type){
$('#payment_type').hide(); $('#payment_type').hide();
}
} }
} else if(item == 'sale'){
else if(item == 'sale'){ $('#waiter').hide();
$('#waiter').hide(); $('#cashier').show();
$('#cashier').show(); }
} else{
else{ $('#waiter').hide();
$('#waiter').hide(); $('#cashier').show();
$('#cashier').show(); $("#item").val('sale');
$("#item").val('sale'); }
} });
});
<% if params[:shift_name].to_i > 0%> <% if params[:shift_name].to_i > 0%>
shift_id = '<%= params[:shift_name] %>' shift_id = '<%= params[:shift_name] %>'
local_date = '<%= @shift_from %> - <%= @shift_to %> ' local_date = '<%= @shift_from %> - <%= @shift_to %> '
var shift = $('#shift_name'); var shift = $('#shift_name');
str = '<option value="'+ shift_id +'" '+ 'selected = "selected"' +'>' + local_date + '</option>'; str = '<option value="'+ shift_id +'" '+ 'selected = "selected"' +'>' + local_date + '</option>';
shift.append(str); shift.append(str);
<% end %> <% end %>
$("#from").val("<%=params[:from] rescue '-'%>"); $("#from").val("<%=params[:from] rescue '-'%>");
$("#to").val("<%=params[:to] rescue '-'%>"); $("#to").val("<%=params[:to] rescue '-'%>");
$("#sel_period").val(<%=params[:period] rescue '-'%>); $("#sel_period").val(<%=params[:period] rescue '-'%>);
$("#sel_sale_type").val(<%=params[:sale_type] rescue '-'%>); $("#sel_sale_type").val(<%=params[:sale_type] rescue '-'%>);
// shift = $(".shift-id").text() // shift = $(".shift-id").text()
// if (shift.length>0) { // if (shift.length>0) {
// $('.shift_name > option[value="'+shift+'"]').attr('selected','selected'); // $('.shift_name > option[value="'+shift+'"]').attr('selected','selected');
// } // }
<% if params[:period_type] == 1 || params[:period_type] == "1" %> <% if params[:period_type] == 1 || params[:period_type] == "1" %>
$("#rd_period_type_1").attr("checked","checked"); $("#rd_period_type_1").attr("checked","checked");
<% else %> <% else %>
$("#rd_period_type_0").attr("checked","checked"); $("#rd_period_type_0").attr("checked","checked");
<% end %> <% end %>
$(".btn-group button").removeClass("active"); $(".btn-group button").removeClass("active");
<% report_type = params[:report_type].blank? ? "0" : params[:report_type] %> <% report_type = params[:report_type].blank? ? "0" : params[:report_type] %>
$("#btn_report_type_<%= report_type %>").addClass("active"); $("#btn_report_type_<%= report_type %>").addClass("active");
$('#item').change(function(){ $('#item').change(function(){
var item = $('#item').val(); var item = $('#item').val();
var payment_type = $('#payment_type'); var payment_type = $('#payment_type');
if(item == 'sale'){ if(item == 'sale'){
$('#waiter').hide(); $('#waiter').hide();
$('#cashier').show(); $('#cashier').show();
if(payment_type){ if(payment_type){
$('#payment_type').show(); $('#payment_type').show();
} }
} }
else{ else{
$('#cashier').hide(); $('#cashier').hide();
$('#waiter').show(); $('#waiter').show();
if(payment_type){ if(payment_type){
$('#payment_type').hide(); $('#payment_type').hide();
} }
} }
}); });
</script> </script>

View File

@@ -5,22 +5,22 @@
</ul> </ul>
</div> </div>
<div class="container"> <!-- <div class="container"> -->
<%= render :partial=>'shift_sale_report_filter', <%= render :partial=>'shift_sale_report_filter',
:locals=>{ :period_type => true, :shift_name => true, :report_path =>reports_credit_payment_index_path} %> :locals=>{ :period_type => true, :shift_name => true, :report_path =>reports_credit_payment_index_path} %>
<hr /> <hr />
</div> <!-- </div> -->
<div class="container"> <!-- <div class="container"> -->
<div class="row"> <!-- <div class="row"> -->
<div class="col-md-12 text-right"> <div class="text-right">
<a href="javascript:export_to('<%=reports_credit_payment_index_path%>.xls')" class = "btn btn-default">Export to Excel</a> <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> -->
<div class="container margin-top-20"> <div class="margin-top-20">
<div class="card row"> <div class="card ">
<% unless @sale_data.blank? %> <% unless @sale_data.blank? %>
<table class="table table-striped" border="0"> <table class="table table-striped" border="0">

View File

@@ -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"> <%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %>
<!-- <label class="">Select Shift Period</label> --> <% if period_type != false %>
<label class="">From</label> <div class="row">
<input data-behaviour='datepicker' class="form-control" name="from" id="from" type="text" placeholder="From date"> <div class="form-group col-md-2">
</div> <label>Select Period</label>
<div class="form-group col-md-3"> <select name="period" id="sel_period" class="form-control">
<label class="">To</label> <option value="">Select Period</option>
<input data-behaviour='datepicker' class="form-control" name="to" id="to" type="text" placeholder="To date"> <option value="0">Today</option>
</div> <option value="1">Yesterday</option>
<div class="form-group col-md-2 margin-top-20"> <option value="2">This week</option>
<input type="submit" value="Generate Report" class='btn btn-primary'> <option value="3">Last week</option>
</div> <option value="4">Last 7 days</option>
</div> <option value="5">This month</option>
<% end %> <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="row"> <div class="form-group col-md-3">
<% if defined? show_monthly %> <!-- <label class="">Select Shift Period</label> -->
<div class="span3" style="margin-bottom:10px;"> <label class="">From</label>
<input type="hidden" id="report_type" name="report_type" value="0"> <input data-behaviour='datepicker' class="form-control" name="from" id="from" type="text" placeholder="From date">
<div class="btn-group" data-toggle="buttons-radio"> </div>
<button id="btn_report_type_1" onclick="$('#report_type').val(1)" type="button" class="btn btn-inverse">Monthly</button> <div class="form-group col-md-3">
<button id="btn_report_type_2" onclick="$('#report_type').val(2)" type="button" class="btn btn-inverse">Yearly</button> <label class="">To</label>
</div> <input data-behaviour='datepicker' class="form-control" name="to" id="to" type="text" placeholder="To date">
</div> </div>
<% end %> <div class="form-group col-md-2 margin-top-20">
</div> --> <input type="submit" value="Generate Report" class='btn btn-primary'>
</div>
<div class="row"> </div>
<div class="form-group"> <% end %>
<% 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 %>
<% if defined? items %>
<%= select_tag "item", options_for_select(@items, :selected => params[:item_type]), :class => "form-control" %>
<% end %>
</div>
</div>
<!-- <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 %> <% end %>
</div>
</div> <% 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 %>
<% 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"> <script type="text/javascript">
$(function(){ $(function(){
$('#custom_excel').hide(); $('#custom_excel').hide();
$('#custom_excel').click(function(){ $('#custom_excel').click(function(){
var url = $('#custom_excel').attr('data-url'); var url = $('#custom_excel').attr('data-url');
$('#frm_report').attr('action',url) $('#frm_report').attr('action',url)
$('#frm_report').submit(); $('#frm_report').submit();
// window.location = url;
});
var item = $('#item').val(); });
var payment_type = $('#payment_type');
if(item == 'order'){ var item = $('#item').val();
$('#cashier').hide(); var payment_type = $('#payment_type');
$('#waiter').show();
if(payment_type){ if(item == 'order'){
$('#payment_type').hide(); $('#cashier').hide();
$('#waiter').show();
if(payment_type){
$('#payment_type').hide();
}
} }
} else if(item == 'sale'){
else if(item == 'sale'){ $('#waiter').hide();
$('#waiter').hide(); $('#cashier').show();
$('#cashier').show(); }
} else{
else{ $('#waiter').hide();
$('#waiter').hide(); $('#cashier').show();
$('#cashier').show(); $("#item").val('sale');
$("#item").val('sale'); }
} });
});
//Reset the form to pervious values //Reset the form to pervious values
$("#branch").val(<%=params[:branch]%>); $("#branch").val(<%=params[:branch]%>);
@@ -156,9 +134,9 @@ $("#sel_period").val(<%=params[:period]%>);
$("#sel_sale_type").val(<%=params[:sale_type]%>); $("#sel_sale_type").val(<%=params[:sale_type]%>);
<% if params[:period_type] == 1 || params[:period_type] == "1" %> <% if params[:period_type] == 1 || params[:period_type] == "1" %>
$("#rd_period_type_1").attr("checked","checked"); $("#rd_period_type_1").attr("checked","checked");
<% else %> <% else %>
$("#rd_period_type_0").attr("checked","checked"); $("#rd_period_type_0").attr("checked","checked");
<% end %> <% end %>
$(".btn-group button").removeClass("active"); $(".btn-group button").removeClass("active");
<% report_type = params[:report_type].blank? ? "0" : params[:report_type] %> <% report_type = params[:report_type].blank? ? "0" : params[:report_type] %>

View File

@@ -1,139 +1,152 @@
<div class="page-header"> <div class="row">
<ul class="breadcrumb"> <div class="col-md-12">
<li><a href="<%= dashboard_path %>">Home</a></li> <div class="row">
<li>Daily Sale Report</li> <div class="page-header col-md-12 col-lg-12">
</ul> <ul class="breadcrumb">
</div> <li><a href="<%= dashboard_path %>">Home</a></li>
<li>Daily Sale Report</li>
<div class="container"> </ul>
<%= render :partial=>'shift_sale_report_filter', </div>
: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">&nbsp;</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">&nbsp;</td>
</tr>
<% end %>
</tbody>
<% end %>
</table>
</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">&nbsp;</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">&nbsp;</td>
</tr>
<% end %>
</tbody>
<% end %>
</table>
</div>
</div>
</div>
</div>
</div> </div>
</div> </div>

View File

@@ -1,130 +1,125 @@
<div class="row"> <%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %>
<div class="col-md-12"> <% if period_type != false %>
<%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %> <div class="row">
<% if period_type != false %> <div class="form-group col-md-2">
<div class="row"> <label>Select Period</label>
<div class="form-group col-md-2"> <select name="period" id="sel_period" class="form-control">
<label>Select Period</label> <option value="">Select Period</option>
<select name="period" id="sel_period" class="form-control"> <option value="0">Today</option>
<option value="">Select Period</option> <option value="1">Yesterday</option>
<option value="0">Today</option> <option value="2">This week</option>
<option value="1">Yesterday</option> <option value="3">Last week</option>
<option value="2">This week</option> <option value="4">Last 7 days</option>
<option value="3">Last week</option> <option value="5">This month</option>
<option value="4">Last 7 days</option> <option value="6">Last month</option>
<option value="5">This month</option> <option value="7">Last 30 days</option>
<option value="6">Last month</option> <option value="8">This year</option>
<option value="7">Last 30 days</option> <option value="9">Last year</option>
<option value="8">This year</option> </select>
<option value="9">Last year</option> </div>
</select> <% if defined? payments %>
</div> <div class="form-group col-md-2">
<% if defined? payments %> <label>Select Payments</label>
<div class="form-group col-md-2"> <%= select_tag "payment_type", options_for_select(@payments, :selected => params[:payment_type]), :class => "form-control" %>
<label>Select Payments</label> </div>
<%= 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 %> <% end %>
</div> <div class="form-group col-md-2">
</div> <!-- <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"> <script type="text/javascript">
$(function(){ $(function(){
$('#custom_excel').hide(); $('#custom_excel').hide();
$('#custom_excel').click(function(){ $('#custom_excel').click(function(){
var url = $('#custom_excel').attr('data-url'); var url = $('#custom_excel').attr('data-url');
$('#frm_report').attr('action',url) $('#frm_report').attr('action',url)
$('#frm_report').submit(); $('#frm_report').submit();
// window.location = url; // window.location = url;
}); });
var item = $('#item').val(); var item = $('#item').val();
var payment_type = $('#payment_type'); var payment_type = $('#payment_type');
if(item == 'order'){ if(item == 'order'){
$('#cashier').hide(); $('#cashier').hide();
$('#waiter').show(); $('#waiter').show();
if(payment_type){ if(payment_type){
$('#payment_type').hide(); $('#payment_type').hide();
}
} }
} else if(item == 'sale'){
else if(item == 'sale'){ $('#waiter').hide();
$('#waiter').hide(); $('#cashier').show();
$('#cashier').show(); }
} else{
else{ $('#waiter').hide();
$('#waiter').hide(); $('#cashier').show();
$('#cashier').show(); $("#item").val('sale');
$("#item").val('sale'); }
} });
});
<% if params[:shift_name].to_i > 0%> <% if params[:shift_name].to_i > 0%>
shift_id = '<%= params[:shift_name] %>' shift_id = '<%= params[:shift_name] %>'
local_date = '<%= @shift_from %> - <%= @shift_to %> ' local_date = '<%= @shift_from %> - <%= @shift_to %> '
var shift = $('#shift_name'); var shift = $('#shift_name');
str = '<option value="'+ shift_id +'" '+ 'selected = "selected"' +'>' + local_date + '</option>'; str = '<option value="'+ shift_id +'" '+ 'selected = "selected"' +'>' + local_date + '</option>';
shift.append(str); shift.append(str);
<% end %> <% end %>
$("#from").val("<%=params[:from] rescue '-'%>"); $("#from").val("<%=params[:from] rescue '-'%>");
$("#to").val("<%=params[:to] rescue '-'%>"); $("#to").val("<%=params[:to] rescue '-'%>");
$("#sel_period").val(<%=params[:period] rescue '-'%>); $("#sel_period").val(<%=params[:period] rescue '-'%>);
$("#sel_sale_type").val(<%=params[:sale_type] rescue '-'%>); $("#sel_sale_type").val(<%=params[:sale_type] rescue '-'%>);
// shift = $(".shift-id").text() // shift = $(".shift-id").text()
// if (shift.length>0) { // if (shift.length>0) {
// $('.shift_name > option[value="'+shift+'"]').attr('selected','selected'); // $('.shift_name > option[value="'+shift+'"]').attr('selected','selected');
// } // }
<% if params[:period_type] == 1 || params[:period_type] == "1" %> <% if params[:period_type] == 1 || params[:period_type] == "1" %>
$("#rd_period_type_1").attr("checked","checked"); $("#rd_period_type_1").attr("checked","checked");
<% else %> <% else %>
$("#rd_period_type_0").attr("checked","checked"); $("#rd_period_type_0").attr("checked","checked");
<% end %> <% end %>
$(".btn-group button").removeClass("active"); $(".btn-group button").removeClass("active");
<% report_type = params[:report_type].blank? ? "0" : params[:report_type] %> <% report_type = params[:report_type].blank? ? "0" : params[:report_type] %>
$("#btn_report_type_<%= report_type %>").addClass("active"); $("#btn_report_type_<%= report_type %>").addClass("active");
$('#item').change(function(){ $('#item').change(function(){
var item = $('#item').val(); var item = $('#item').val();
var payment_type = $('#payment_type'); var payment_type = $('#payment_type');
if(item == 'sale'){ if(item == 'sale'){
$('#waiter').hide(); $('#waiter').hide();
$('#cashier').show(); $('#cashier').show();
if(payment_type){ if(payment_type){
$('#payment_type').show(); $('#payment_type').show();
} }
} }
else{ else{
$('#cashier').hide(); $('#cashier').hide();
$('#waiter').show(); $('#waiter').show();
if(payment_type){ if(payment_type){
$('#payment_type').hide(); $('#payment_type').hide();
} }
} }
}); });
</script> </script>

View File

@@ -1,123 +1,127 @@
<div class="page-header"> <div class="row">
<ul class="breadcrumb"> <div class="col-md-12">
<li><a href="<%= dashboard_path %>">Home</a></li> <div class="page-header">
<li>Receipt List Report</li> <ul class="breadcrumb">
</ul> <li><a href="<%= dashboard_path %>">Home</a></li>
</div> <li>Receipt List Report</li>
</ul>
</div>
<div class="container"> <!-- <div class="container"> -->
<%= render :partial=>'shift_sale_report_filter', <%= render :partial=>'shift_sale_report_filter',
:locals=>{ :period_type => true, :shift_name => true,:payments => true, :report_path =>reports_receipt_no_index_path} %> :locals=>{ :period_type => true, :shift_name => true,:payments => true, :report_path =>reports_receipt_no_index_path} %>
<hr /> <hr />
</div> <!-- </div> -->
<div class="container"> <!-- <div class="container"> -->
<div class="row"> <!-- <div class="row"> -->
<div class="col-md-12 text-right"> <div class="text-right">
<a href="javascript:export_to('<%=reports_receipt_no_index_path%>.xls')" class = "btn btn-default">Export to Excel</a> <a href="javascript:export_to('<%=reports_receipt_no_index_path%>.xls')" class = "btn btn-default">Export to Excel</a>
</div>
<!-- </div> -->
<!-- </div> -->
<div class="margin-top-20">
<div class="card">
<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 %>
<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 %>
<tr style="border-top:4px double #666;">
<td colspan="2">&nbsp;</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">&nbsp;</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>
</div> </div>
</div> </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 %>
<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 %>
<tr style="border-top:4px double #666;">
<td colspan="2">&nbsp;</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">&nbsp;</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>
</div>
<script> <script>
$(function(){ $(function(){

View File

@@ -1,5 +1,4 @@
<div class="row">
<div class="col-md-12">
<%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %> <%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %>
<% if period_type != false %> <% if period_type != false %>
<div class="row"> <div class="row">
@@ -52,8 +51,7 @@
<% end %> <% end %>
<% end %> <% end %>
</div>
</div>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
$('#custom_excel').hide(); $('#custom_excel').hide();

View File

@@ -1,175 +1,179 @@
<div class="page-header"> <div class="row">
<div class="col-md-12">
<div class="page-header">
<ul class="breadcrumb"> <ul class="breadcrumb">
<li><a href="<%= dashboard_path %>">Home</a></li> <li><a href="<%= dashboard_path %>">Home</a></li>
<li>Sale Item Report</li> <li>Sale Item Report</li>
</ul> </ul>
</div> </div>
<div class="container"> <!-- <div class="container"> -->
<%= render :partial=>'shift_sale_report_filter', <%= render :partial=>'shift_sale_report_filter',
:locals=>{ :period_type => true, :shift_name => true, :report_path =>reports_saleitem_index_path} %> :locals=>{ :period_type => true, :shift_name => true, :report_path =>reports_saleitem_index_path} %>
<hr /> <hr />
</div> <!-- /div> -->
<div class="container"> <!-- <div class="container"> -->
<div class="row"> <!-- <div class="row"> -->
<div class="col-md-12 text-right"> <div class="text-right">
<a href="javascript:export_to('<%=reports_saleitem_index_path%>.xls')" class = "btn btn-default">Export to Excel</a> <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>&nbsp;</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">&nbsp;</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>&nbsp;</td>
<% if !cate_arr.include?(sale.menu_category_id) %>
<td><%= sale.menu_category_name %></td>
<% cate_arr.push(sale.menu_category_id) %>
<% else %>
<td>&nbsp;</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">&nbsp;</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">&nbsp;</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">&nbsp;</td>
<td>Cash Received</td>
<td><span><%= @cash_data - @change_amount %></span></td>
</tr>
<tr>
<td colspan="5">&nbsp;</td>
<td>Card Sales</td>
<td><span><%= @card_data %></span></td>
</tr>
<tr>
<td colspan="5">&nbsp;</td>
<td>Credit Sales</td>
<td><span><%= @credit_data %></span></td>
</tr>
<tr>
<td colspan="5">&nbsp;</td>
<td>FOC Sales</td>
<td><span><%= @foc_data %></span></td>
</tr>
<tr>
<td colspan="5">&nbsp;</td>
<td>Discount Amount</td>
<td><span><%= @discount_data %></span></td>
</tr>
<tr>
<td colspan="5">&nbsp;</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>
</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>&nbsp;</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">&nbsp;</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>&nbsp;</td>
<% if !cate_arr.include?(sale.menu_category_id) %>
<td><%= sale.menu_category_name %></td>
<% cate_arr.push(sale.menu_category_id) %>
<% else %>
<td>&nbsp;</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">&nbsp;</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">&nbsp;</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">&nbsp;</td>
<td>Cash Received</td>
<td><span><%= @cash_data - @change_amount %></span></td>
</tr>
<tr>
<td colspan="5">&nbsp;</td>
<td>Card Sales</td>
<td><span><%= @card_data %></span></td>
</tr>
<tr>
<td colspan="5">&nbsp;</td>
<td>Credit Sales</td>
<td><span><%= @credit_data %></span></td>
</tr>
<tr>
<td colspan="5">&nbsp;</td>
<td>FOC Sales</td>
<td><span><%= @foc_data %></span></td>
</tr>
<tr>
<td colspan="5">&nbsp;</td>
<td>Discount Amount</td>
<td><span><%= @discount_data %></span></td>
</tr>
<tr>
<td colspan="5">&nbsp;</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> <script>
$(function(){ $(function(){
@@ -273,5 +277,5 @@
}); });
} }
}); });
</script> </script>

View File

@@ -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"> <%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %>
<!-- <label class="">Select Shift Period</label> --> <% if period_type != false %>
<label class="">From</label> <div class="row">
<input data-behaviour='datepicker' class="form-control" name="from" id="from" type="text" placeholder="From date"> <div class="form-group col-md-2">
</div> <label>Select Period</label>
<div class="form-group col-md-3"> <select name="period" id="sel_period" class="form-control">
<label class="">To</label> <option value="0">Today</option>
<input data-behaviour='datepicker' class="form-control" name="to" id="to" type="text" placeholder="To date"> <option value="1">Yesterday</option>
</div> <option value="2">This week</option>
<div class="form-group col-md-2"> <option value="3">Last week</option>
<label class="">All Shift</label> <option value="4">Last 7 days</option>
<select class="form-control select" name="shift_name" id="shift_name" > <option value="5">This month</option>
</select> <option value="6">Last month</option>
</div> <option value="7">Last 30 days</option>
<div class="form-group col-md-2 margin-top-20"> <option value="8">This year</option>
<input type="submit" value="Generate Report" class='btn btn-primary'> <option value="9">Last year</option>
</div> </select>
</div> </div>
<% end %>
<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 %>
<% end %>
</div>
</div>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
$('#custom_excel').hide(); $('#custom_excel').hide();
$('#custom_excel').click(function(){ $('#custom_excel').click(function(){
var url = $('#custom_excel').attr('data-url'); var url = $('#custom_excel').attr('data-url');
$('#frm_report').attr('action',url) $('#frm_report').attr('action',url)
$('#frm_report').submit(); $('#frm_report').submit();
// window.location = url; // window.location = url;
}); });
var item = $('#item').val(); var item = $('#item').val();
var payment_type = $('#payment_type'); var payment_type = $('#payment_type');
if(item == 'order'){ if(item == 'order'){
$('#cashier').hide(); $('#cashier').hide();
$('#waiter').show(); $('#waiter').show();
if(payment_type){ if(payment_type){
$('#payment_type').hide(); $('#payment_type').hide();
}
} }
} else if(item == 'sale'){
else if(item == 'sale'){ $('#waiter').hide();
$('#waiter').hide(); $('#cashier').show();
$('#cashier').show(); }
} else{
else{ $('#waiter').hide();
$('#waiter').hide(); $('#cashier').show();
$('#cashier').show(); $("#item").val('sale');
$("#item").val('sale'); }
} });
});
//Reset the form to pervious values //Reset the form to pervious values
<% if params[:shift_name].to_i > 0%> <% if params[:shift_name].to_i > 0%>
shift_id = '<%= params[:shift_name] %>' 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") %>' 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'); var shift = $('#shift_name');
str = '<option value="'+ shift_id +'" '+ 'selected = "selected"' +'>' + local_date + '</option>'; str = '<option value="'+ shift_id +'" '+ 'selected = "selected"' +'>' + local_date + '</option>';
shift.append(str); shift.append(str);
<% end %> <% end %>
$("#from").val("<%=params[:from]%>"); $("#from").val("<%=params[:from]%>");
$("#to").val("<%=params[:to]%>"); $("#to").val("<%=params[:to]%>");
@@ -89,9 +87,9 @@ $("#sel_period").val(<%=params[:period]%>);
$("#sel_sale_type").val(<%=params[:sale_type]%>); $("#sel_sale_type").val(<%=params[:sale_type]%>);
<% if params[:period_type] == 1 || params[:period_type] == "1" %> <% if params[:period_type] == 1 || params[:period_type] == "1" %>
$("#rd_period_type_1").attr("checked","checked"); $("#rd_period_type_1").attr("checked","checked");
<% else %> <% else %>
$("#rd_period_type_0").attr("checked","checked"); $("#rd_period_type_0").attr("checked","checked");
<% end %> <% end %>
$(".btn-group button").removeClass("active"); $(".btn-group button").removeClass("active");
<% report_type = params[:report_type].blank? ? "0" : params[:report_type] %> <% report_type = params[:report_type].blank? ? "0" : params[:report_type] %>

View File

@@ -1,119 +1,121 @@
<div class="page-header"> <div class="row">
<ul class="breadcrumb"> <div class="col-md-12">
<li><a href="<%= dashboard_path %>">Home</a></li> <div class="page-header">
<li>Shift Sale Report</li> <ul class="breadcrumb">
</ul> <li><a href="<%= dashboard_path %>">Home</a></li>
</div> <li>Shift Sale Report</li>
</ul>
<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>
<div class="container margin-top-20"> <!-- <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="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="margin-top-20">
<!-- <div class="span11"> <!-- <div class="span11">
<div id="report_container" style="min-width: 400px; height: 400px; margin: 0 auto"></div> <div id="report_container" style="min-width: 400px; height: 400px; margin: 0 auto"></div>
</div> --> </div> -->
<div class="card row"> <div class="card">
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped"> <table class="table table-striped">
<thead> <thead>
<tr> <tr>
<th colspan="7"> From Date : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> <th colspan="7"> From Date : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %>
- To Date : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%> - To Date : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%>
</th> </th>
</tr> </tr>
<% if @shift_from %> <% if @shift_from %>
<tr> <tr>
<% if @shift_data.employee %> <% if @shift_data.employee %>
<% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %> <% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %>
<% end %> <% end %>
<th colspan="7">Shift Name = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )</th> <th colspan="7">Shift Name = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )</th>
</tr> </tr>
<% end %> <% end %>
<tr> <tr>
<th>Cashier Station</th> <th>Cashier Station</th>
<th>Cashier Name</th> <th>Cashier Name</th>
<th>Shift Name</th> <th>Shift Name</th>
<!-- <th>Void Amount</th> --> <!-- <th>Void Amount</th> -->
<th>Cash Payment</th> <th>Cash Payment</th>
<!-- <th>Credit Charges</th> --> <!-- <th>Credit Charges</th> -->
<th>Credit Payment</th> <th>Credit Payment</th>
<!-- <th>FOC Payment</th> --> <!-- <th>FOC Payment</th> -->
<th>Other Payment</th> <th>Other Payment</th>
<!-- <th>Grand Total <!-- <th>Grand Total
<br/>Rounding Adj</th> --> <br/>Rounding Adj</th> -->
<!-- <th>Rounding Adj</th> --> <!-- <th>Rounding Adj</th> -->
<th>Grand Total</th> <th>Grand Total</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<% void = 0%> <% void = 0%>
<% cash = 0%> <% cash = 0%>
<% credit = 0%> <% credit = 0%>
<% accept_credit = 0%> <% accept_credit = 0%>
<% foc = 0%> <% foc = 0%>
<% card = 0%> <% card = 0%>
<% total = 0%> <% total = 0%>
<% rounding_adj = 0%> <% rounding_adj = 0%>
<% g_total = 0 %> <% g_total = 0 %>
<% @sale_data.each do |result|%> <% @sale_data.each do |result|%>
<tr> <tr>
<td> <td>
<%= result.cashier_terminal.name rescue '-'%> <%= result.cashier_terminal.name rescue '-'%>
</td> </td>
<td> <td>
<%= result.employee.name rescue '-'%> <%= result.employee.name rescue '-'%>
</td> </td>
<td><%= result.shift_started_at.strftime("%e %b %I:%M%p") rescue '-' %> - <td><%= result.shift_started_at.strftime("%e %b %I:%M%p") rescue '-' %> -
<%= result.shift_closed_at.strftime("%e %b %I:%M%p") rescue '-' %> <%= result.shift_closed_at.strftime("%e %b %I:%M%p") rescue '-' %>
</td> </td>
<!-- <td style='color:red;'>(<%= sprintf "%.2f",result.void_amount.to_f.to_d 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.cash_sales.to_f.to_d rescue '-'%></td>
<td><%= sprintf "%.2f",result.credit_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.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.foc_amount.to_f.to_d rescue '-'%></td>
<td><%= sprintf "%.2f",result.card_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.other_sales.to_f.to_d rescue '-'%></td>
<td><%= sprintf "%.2f",result.grand_total.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 %> <% grand_total = result.grand_total.to_f %>
<!-- <td><%= sprintf "%.2f",grand_tota.to_f.to_d rescue '-'%></td> --> <!-- <td><%= sprintf "%.2f",grand_tota.to_f.to_d rescue '-'%></td> -->
</tr> </tr>
<% cash += result.cash_sales.to_f %> <% cash += result.cash_sales.to_f %>
<% credit += result.credit_sales.to_f %> <% credit += result.credit_sales.to_f %>
<% card += result.other_sales.to_f %> <% card += result.other_sales.to_f %>
<% total += result.grand_total.to_f %> <% total += result.grand_total.to_f %>
<% g_total += grand_total.to_f %> <% g_total += grand_total.to_f %>
<% end %> <% end %>
<tr style="border-top: 3px solid grey;"> <tr style="border-top: 3px solid grey;">
<td colspan="3"></td> <td colspan="3"></td>
<!-- <td style='color:red;'><b>(<%= sprintf("%.2f",void) rescue '-'%>)</b></td> --> <!-- <td style='color:red;'><b>(<%= sprintf("%.2f",void) rescue '-'%>)</b></td> -->
<td><b><%= sprintf("%.2f",cash) rescue '-'%></b></td> <td><b><%= sprintf("%.2f",cash) rescue '-'%></b></td>
<td><b><%= sprintf("%.2f",credit) rescue '-'%></b></td> <td><b><%= sprintf("%.2f",credit) rescue '-'%></b></td>
<!-- <td><b><%= sprintf("%.2f",accept_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",foc) rescue '-'%></b></td> -->
<td><b><%= sprintf("%.2f",card) rescue '-'%></b></td> <td><b><%= sprintf("%.2f",card) rescue '-'%></b></td>
<!-- <td><b><%= sprintf("%.2f",total) rescue '-'%></b></td> --> <!-- <td><b><%= sprintf("%.2f",total) rescue '-'%></b></td> -->
<!-- <td><b><%= sprintf("%.2f",rounding_adj) rescue '-'%></b></td> --> <!-- <td><b><%= sprintf("%.2f",rounding_adj) rescue '-'%></b></td> -->
<td><b><%= sprintf("%.2f",g_total) rescue '-'%></b></td> <td><b><%= sprintf("%.2f",g_total) rescue '-'%></b></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>

View File

@@ -1,5 +1,4 @@
<div class="row">
<div class="col-md-12">
<%= form_tag report_path, :method => :get, :id => "frm_report", :class => "form" do %> <%= form_tag report_path, :method => :get, :id => "frm_report", :class => "form" do %>
<% if period_type != false %> <% if period_type != false %>
<div class="row"> <div class="row">
@@ -38,8 +37,7 @@
<% end %> <% end %>
<% end %> <% end %>
</div>
</div>
<script type="text/javascript"> <script type="text/javascript">

View File

@@ -1,87 +1,89 @@
<div class="page-header"> <div class="row">
<ul class="breadcrumb"> <div class="col-md-12">
<li><a href="<%= dashboard_path %>">Home</a></li> <div class="page-header">
<li>Stock Check Report</li> <ul class="breadcrumb">
</ul> <li><a href="<%= dashboard_path %>">Home</a></li>
</div> <li>Stock Check Report</li>
</ul>
</div>
<div class="container"> <!-- <div class="container"> -->
<%= render :partial => 'stock_check_report_filter', <%= render :partial => 'stock_check_report_filter',
:locals => {:period_type => true, :shift_name => true, :report_path => reports_stock_check_index_path} %> :locals => {:period_type => true, :shift_name => true, :report_path => reports_stock_check_index_path} %>
<hr/> <hr/>
</div> <!-- </div> -->
<div class="container"> <!-- <div class="container"> -->
<div class="row"> <!-- <div class="row"> -->
<div class="col-md-12 text-right"> <div class="text-right">
<a href="javascript:export_to('<%= reports_stock_check_index_path %>.xls')" class="btn btn-default">Export to <a href="javascript:export_to('<%= reports_stock_check_index_path %>.xls')" class="btn btn-default">Export to
Excel</a> Excel</a>
</div> </div>
</div> <!-- </div> -->
</div> <!-- </div> -->
<div class="container margin-top-20"> <div class="margin-top-20">
<div class="card row"> <div class="card">
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped"> <table class="table table-striped">
<thead> <thead>
<tr> <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> <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>
<tr> <tr>
<th>Stock Check Reason</th> <th>Stock Check Reason</th>
<th>Checked By</th> <th>Checked By</th>
<th>Item Name</th> <th>Item Name</th>
<th>Stock Count</th> <th>Stock Count</th>
<th>Stock Balance</th> <th>Stock Balance</th>
<th>Different</th> <th>Different</th>
<th>Remark</th> <th>Remark</th>
<th>Date</th> <th>Date</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<% total_stock_count = 0 %> <% total_stock_count = 0 %>
<% total_stock_balance = 0 %> <% total_stock_balance = 0 %>
<% total_different = 0 %> <% total_different = 0 %>
<% @transaction.each do |result| %> <% @transaction.each do |result| %>
<tr> <tr>
<td><%= result.stock_check.reason rescue '-' %></td> <td><%= result.stock_check.reason rescue '-' %></td>
<td><%= Employee.find(result.stock_check.check_by).name rescue '-' %></td> <td><%= Employee.find(result.stock_check.check_by).name rescue '-' %></td>
<td> <td>
<% menu_item = MenuItemInstance.find_by_item_instance_code(result.item_code)%> <% menu_item = MenuItemInstance.find_by_item_instance_code(result.item_code)%>
<% if menu_item.nil? %> <% if menu_item.nil? %>
<%= Product.find_by_item_code(result.item_code).name rescue "-" %> <%= Product.find_by_item_code(result.item_code).name rescue "-" %>
<% else %> <% else %>
<%= menu_item.menu_item.name rescue "-" %> <%= menu_item.menu_item.name rescue "-" %>
- <%= menu_item.item_instance_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 %> <% 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;"> <tr style="border-top: 3px solid grey;">
<td colspan="3"></td> <td colspan="3"></td>
<td><b><%= total_stock_count rescue '-' %></b></td> <td><b><%= total_stock_count rescue '-' %></b></td>
<td><b><%= total_stock_balance rescue '-' %></b></td> <td><b><%= total_stock_balance rescue '-' %></b></td>
<td><b><%= total_different rescue '-' %></b></td> <td><b><%= total_different rescue '-' %></b></td>
<td colspan="2"></td> <td colspan="2"></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
</div> </div>
<script> <script>
$(function () { $(function () {
}); });
</script> </script>

View File

@@ -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"> <%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %>
<!-- <label class="">Select Shift Period</label> --> <% if period_type != false %>
<label class="">From</label> <div class="row">
<input data-behaviour='datepicker' class="form-control" name="from" id="from" type="text" placeholder="From date"> <div class="form-group col-md-2">
</div> <label>Select Period</label>
<div class="form-group col-md-2"> <select name="period" id="sel_period" class="form-control">
<label class="">To</label> <option value="">Select Period</option>
<input data-behaviour='datepicker' class="form-control" name="to" id="to" type="text" placeholder="To date"> <option value="0">Today</option>
</div> <option value="1">Yesterday</option>
<div class="form-group col-md-3"> <option value="2">This week</option>
<label class="">All Shift</label> <option value="3">Last week</option>
<select class="form-control select" name="shift_name" id="shift_name" > <option value="4">Last 7 days</option>
</select> <option value="5">This month</option>
</div> <option value="6">Last month</option>
<div class="form-group col-md-1 margin-top-20"> <option value="7">Last 30 days</option>
<input type="submit" value="Generate Report" class='btn btn-primary'> <option value="8">This year</option>
</div> <option value="9">Last year</option>
</div> </select>
<% end %> </div>
<% end %>
</div>
</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"> <script type="text/javascript">
$(function(){ $(function(){
$('#custom_excel').hide(); $('#custom_excel').hide();
$('#custom_excel').click(function(){ $('#custom_excel').click(function(){
var url = $('#custom_excel').attr('data-url'); var url = $('#custom_excel').attr('data-url');
$('#frm_report').attr('action',url) $('#frm_report').attr('action',url)
$('#frm_report').submit(); $('#frm_report').submit();
// window.location = url; // window.location = url;
}); });
var item = $('#item').val(); var item = $('#item').val();
var payment_type = $('#payment_type'); var payment_type = $('#payment_type');
if(item == 'order'){ if(item == 'order'){
$('#cashier').hide(); $('#cashier').hide();
$('#waiter').show(); $('#waiter').show();
if(payment_type){ if(payment_type){
$('#payment_type').hide(); $('#payment_type').hide();
}
} }
} else if(item == 'sale'){
else if(item == 'sale'){ $('#waiter').hide();
$('#waiter').hide(); $('#cashier').show();
$('#cashier').show(); }
} else{
else{ $('#waiter').hide();
$('#waiter').hide(); $('#cashier').show();
$('#cashier').show(); $("#item").val('sale');
$("#item").val('sale'); }
} });
});
<% if params[:shift_name].to_i > 0%> <% if params[:shift_name].to_i > 0%>
shift_id = '<%= params[:shift_name] %>' shift_id = '<%= params[:shift_name] %>'
local_date = '<%= @shift_from %> - <%= @shift_to %> ' local_date = '<%= @shift_from %> - <%= @shift_to %> '
var shift = $('#shift_name'); var shift = $('#shift_name');
str = '<option value="'+ shift_id +'" '+ 'selected = "selected"' +'>' + local_date + '</option>'; str = '<option value="'+ shift_id +'" '+ 'selected = "selected"' +'>' + local_date + '</option>';
shift.append(str); shift.append(str);
<% end %> <% end %>
$("#from").val("<%=params[:from] rescue '-'%>"); $("#from").val("<%=params[:from] rescue '-'%>");
$("#to").val("<%=params[:to] rescue '-'%>"); $("#to").val("<%=params[:to] rescue '-'%>");
$("#sel_period").val(<%=params[:period] rescue '-'%>); $("#sel_period").val(<%=params[:period] rescue '-'%>);
$("#sel_sale_type").val(<%=params[:sale_type] rescue '-'%>); $("#sel_sale_type").val(<%=params[:sale_type] rescue '-'%>);
// shift = $(".shift-id").text() // shift = $(".shift-id").text()
// if (shift.length>0) { // if (shift.length>0) {
// $('.shift_name > option[value="'+shift+'"]').attr('selected','selected'); // $('.shift_name > option[value="'+shift+'"]').attr('selected','selected');
// } // }
<% if params[:period_type] == 1 || params[:period_type] == "1" %> <% if params[:period_type] == 1 || params[:period_type] == "1" %>
$("#rd_period_type_1").attr("checked","checked"); $("#rd_period_type_1").attr("checked","checked");
<% else %> <% else %>
$("#rd_period_type_0").attr("checked","checked"); $("#rd_period_type_0").attr("checked","checked");
<% end %> <% end %>
$(".btn-group button").removeClass("active"); $(".btn-group button").removeClass("active");
<% report_type = params[:report_type].blank? ? "0" : params[:report_type] %> <% report_type = params[:report_type].blank? ? "0" : params[:report_type] %>
$("#btn_report_type_<%= report_type %>").addClass("active"); $("#btn_report_type_<%= report_type %>").addClass("active");
$('#item').change(function(){ $('#item').change(function(){
var item = $('#item').val(); var item = $('#item').val();
var payment_type = $('#payment_type'); var payment_type = $('#payment_type');
if(item == 'sale'){ if(item == 'sale'){
$('#waiter').hide(); $('#waiter').hide();
$('#cashier').show(); $('#cashier').show();
if(payment_type){ if(payment_type){
$('#payment_type').show(); $('#payment_type').show();
} }
} }
else{ else{
$('#cashier').hide(); $('#cashier').hide();
$('#waiter').show(); $('#waiter').show();
if(payment_type){ if(payment_type){
$('#payment_type').hide(); $('#payment_type').hide();
} }
} }
}); });
</script> </script>

View File

@@ -1,97 +1,95 @@
<div class="page-header"> <div class="row">
<ul class="breadcrumb"> <div class="col-md-12">
<li><a href="<%= dashboard_path %>">Home</a></li> <div class="page-header">
<li>Void Sale Report</li> <ul class="breadcrumb">
</ul> <li><a href="<%= dashboard_path %>">Home</a></li>
</div> <li>Void Sale Report</li>
</ul>
</div>
<div class="container"> <!-- <div class="container"> -->
<%= render :partial=>'shift_sale_report_filter', <%= render :partial=>'shift_sale_report_filter',
:locals=>{ :period_type => true, :shift_name => true, :report_path =>reports_void_sale_index_path} %> :locals=>{ :period_type => true, :shift_name => true, :report_path =>reports_void_sale_index_path} %>
<hr /> <hr />
</div> <!-- </div> -->
<div class="container"> <!-- <div class="container"> -->
<div class="row"> <!-- <div class="row"> -->
<div class="col-md-12 text-right"> <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> <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> -->
<div class="container margin-top-20"> <div class="margin-top-20">
<div class="card row"> <div class="card">
<% if @sale_data.count > 0 %> <% if @sale_data.count > 0 %>
<table class="table table-striped" border="0"> <table class="table table-striped" border="0">
<thead> <thead>
<% if !params[:from].blank?%> <% if !params[:from].blank?%>
<tr> <tr>
<th colspan="7">From Date : <%= params[:from] rescue '-'%> , To Date : <%= params[:to] rescue '-'%></th> <th colspan="7">From Date : <%= params[:from] rescue '-'%> , To Date : <%= params[:to] rescue '-'%></th>
</tr> </tr>
<% end %> <% end %>
<% if @shift_from %> <% if @shift_from %>
<tr> <tr>
<% if @shift %> <% if @shift %>
<% cashier_name = !@shift.nil? ? @shift[0].employee.name : '-' %> <% cashier_name = !@shift.nil? ? @shift[0].employee.name : '-' %>
<% end %> <% end %>
<th colspan="3">Shift Name = <%= @shift_from rescue '-'%> - <%= @shift_to rescue '-'%> ( <%= cashier_name rescue '-'%> )</th> <th colspan="3">Shift Name = <%= @shift_from rescue '-'%> - <%= @shift_to rescue '-'%> ( <%= cashier_name rescue '-'%> )</th>
</tr> </tr>
<% end %> <% end %>
<tr> <tr>
<th>Receipt No</th> <th>Receipt No</th>
<th>Sale Date</th> <th>Sale Date</th>
<th>Total Amount</th> <th>Total Amount</th>
<th>Grand Total</th> <th>Grand Total</th>
<th>Rounding Adj.</th> <th>Rounding Adj.</th>
<th>Grand Total + <br/>Rounding Adj.</th> <th>Grand Total + <br/>Rounding Adj.</th>
<!-- <th>Sale Status</th> --> <!-- <th>Sale Status</th> -->
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<% total_amount = 0.0 %> <% total_amount = 0.0 %>
<% grand_total = 0.0 %> <% grand_total = 0.0 %>
<% rounding_adjustment = 0.0 %> <% rounding_adjustment = 0.0 %>
<% grand_rounding_adjustment = 0.0 %> <% grand_rounding_adjustment = 0.0 %>
<% @sale_data.each do |result| %> <% @sale_data.each do |result| %>
<% result[:items].each do |item| %> <% result[:items].each do |item| %>
<tr> <tr>
<td><%= item.receipt_no rescue '-' %> </td> <td><%= item.receipt_no rescue '-' %> </td>
<td><%= item.receipt_date.utc.getlocal.strftime("%e %b %I:%M%p") 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.total_amount.to_f rescue '-'%> </td>
<td><%= item.grand_total.to_f rescue '-'%> </td> <td><%= item.grand_total.to_f rescue '-'%> </td>
<td><%= item.rounding_adjustment.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><%= item.grand_total.to_f + item.rounding_adjustment.to_f rescue '-'%> </td>
<!-- <td><%= result.sales_status rescue '-' %> </td> --> <!-- <td><%= result.sales_status rescue '-' %> </td> -->
<!-- <td><%= item.remarks rescue '-' %> </td> --> <!-- <td><%= item.remarks rescue '-' %> </td> -->
</tr> </tr>
<% total_amount = total_amount.to_f + item.total_amount.to_f %> <% total_amount = total_amount.to_f + item.total_amount.to_f %>
<% grand_total = grand_total.to_f + item.grand_total.to_f %> <% grand_total = grand_total.to_f + item.grand_total.to_f %>
<% rounding_adjustment = rounding_adjustment.to_f + item.rounding_adjustment.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 %> <% grand_rounding_adjustment = grand_rounding_adjustment.to_f + item.grand_total.to_f + item.rounding_adjustment.to_f %>
<% end %> <% end %>
<% end %> <% end %>
<tr style="border-top:4px double #666;font-weight:600;"> <tr style="border-top:4px double #666;font-weight:600;">
<td colspan="2" style="text-align:center;">Total Void Amount :</td> <td colspan="2" style="text-align:center;">Total Void Amount :</td>
<td><%= total_amount rescue '-' %></td> <td><%= total_amount rescue '-' %></td>
<td><%= grand_total rescue '-' %></td> <td><%= grand_total rescue '-' %></td>
<td><%= rounding_adjustment rescue '-'%></td> <td><%= rounding_adjustment rescue '-'%></td>
<td colspan="3"><%= grand_rounding_adjustment rescue '-'%></td> <td colspan="3"><%= grand_rounding_adjustment rescue '-'%></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<% end %> <% end %>
</div> </div>
</div> </div>
<script> <script>
$(function(){ $(function(){
var check_arr = []; var check_arr = [];
$('#sel_period').change(function(){ $('#sel_period').change(function(){
search_by_period(); search_by_period();
}); });
function search_by_period(){ function search_by_period(){

View File

@@ -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.css )
Rails.application.config.assets.precompile += %w( addorder.js ) 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 ---- # --- Inventory Definition ----
Rails.application.config.assets.precompile += %w( inventory_definitions.css ) Rails.application.config.assets.precompile += %w( inventory_definitions.css )