Merge branch 'r-1902001-01' into r-1902001-01-dev

This commit is contained in:
NyanLinHtut
2019-06-03 11:16:16 +06:30
69 changed files with 2292 additions and 1409 deletions

View File

@@ -14,10 +14,10 @@
else
delimiter = ""
end
%>
%>
<!-- Widgets -->
<div class="row clearfix">
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12 col-mbl-view">
<div class="info-box bg-cyan hover-expand-effect">
<div class="icon">
<i class="material-icons">help</i>
@@ -30,7 +30,7 @@
</div>
</div>
</div>
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12 col-mbl-view">
<div class="info-box bg-pink hover-expand-effect">
<div class="icon">
<i class="material-icons">attach_money</i>
@@ -44,7 +44,7 @@
</div>
</div>
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12 col-mbl-view">
<div class="info-box bg-light-green hover-expand-effect">
<div class="icon">
<i class="material-icons">person_add</i>
@@ -57,7 +57,7 @@
</div>
</div>
</div>
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12 col-mbl-view">
<div class="info-box bg-orange hover-expand-effect">
<div class="icon">
<i class="material-icons">credit_card</i>
@@ -99,27 +99,27 @@
to_time = ''
end
%>
<div class="col-lg-3 col-md-3 col-sm-3">
<label class="font-14"><%= t("views.right_panel.detail.from") %></label>
<div class="col-lg-3 col-md-3 col-sm-3 col-mbl-view mbl-style">
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.from") %></label>
<input data-behaviour='datepicker' class="form-control datepicker" name="from" id="from" type="text" value="<%= from_date %>" placeholder="From date" style="height: 35px;">
<span id="fromErr" style="color:red;"></span>
</div>
<div class="col-lg-3 col-md-3 col-sm-3">
<label class="font-14"><%= t("views.right_panel.detail.to") %></label>
<div class="col-lg-3 col-md-3 col-sm-3 col-mbl-view mbl-style">
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.to") %></label>
<input data-behaviour='datepicker' class="form-control datepicker" name="to" id="to" type="text" value="<%= to_date %>" placeholder="To date" style="height: 35px;">
<span id="toErr" style="color:red;"></span>
</div>
<div class="col-lg-2 col-md-2 col-sm-2">
<label class="font-14"><%= t("views.right_panel.detail.from_time") %></label>
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.from_time") %></label>
<input data-behaviour='timepicker' class="form-control timepicker" name="from_time" id="from_time" type="text" value="<%= from_time %>" placeholder="From Time" style="height: 35px;">
<span id="from_timeErr" style="color:red;"></span>
</div>
<div class="col-lg-2 col-md-2 col-sm-2">
<label class="font-14"><%= t("views.right_panel.detail.to_time") %></label>
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.to_time") %></label>
<input data-behaviour='timepicker' class="form-control timepicker" name="to_time" id="to_time" type="text" value="<%= to_time %>" placeholder="To time" style="height: 35px;">
<span id="to_timeErr" style="color:red;"></span>
</div>
<div class="col-lg-2 col-md-2 col-sm-2">
<div class="col-lg-2 col-md-2 col-sm-2 toggle_mbl">
<label></label><br>
<input type="button" value="Generate" class='btn btn-primary btn_generate'>
</div>
@@ -131,26 +131,29 @@
<div class="row">
<% if current_user.role == 'administrator' || current_user.role == 'manager' || current_user.role == 'account' %>
<div class="col-xs-8 col-sm-8 col-md-8 col-lg-8">
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
<div class="card">
<div class="body">
<h4><i class="material-icons md-24">dashboard</i><%= (t :top) + " " + (t :products) %></h4>
<!-- <canvas id="top_products" class="col-md-12"></canvas> -->
<%= pie_chart @top_products %>
<% isMobile = request.user_agent %>
<% if !isMobile.include? "Mobile" %>
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 ">
<div class="card">
<div class="body">
<h4><i class="material-icons md-24">dashboard</i><%= (t :top) + " " + (t :products) %></h4>
<!-- <canvas id="top_products" class="col-md-12"></canvas> -->
<%= pie_chart @top_products %>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 ">
<div class="card">
<div class="body">
<h4><i class="material-icons md-24">dashboard</i><%= (t :bottom) + " " + (t :products) %></h4>
<!-- <canvas id="top_products" class="col-md-12"></canvas> -->
<%= pie_chart @bottom_products %>
</div>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
<div class="card">
<div class="body">
<h4><i class="material-icons md-24">dashboard</i><%= (t :bottom) + " " + (t :products) %></h4>
<!-- <canvas id="top_products" class="col-md-12"></canvas> -->
<%= pie_chart @bottom_products %>
</div>
</div>
</div>
</div>
<% end %>
<!-- <div class="row">
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
<div class="card">
@@ -231,9 +234,9 @@
<tr>
<% if payment.payment_method == 'paypar' %>
<td>Redeem Sale : </td>
<% else %>
<% else %>
<td><%= payment.payment_method.to_s.capitalize %> Sale : </td>
<% end %>
<% end %>
<td align="right">
<% @sale_data.each do |data| %>
<% pay_mth = payment.payment_method %>
@@ -254,7 +257,7 @@
</td>
</tr>
<% end %>
<% end %>
</table>
</div>
@@ -329,7 +332,7 @@
<td align="right" width="60px"><%= @total_order.total_order %></td>
</tr>
<% end %>
<% if !@total_accounts.nil? %>
<% @total_accounts.each do |account| %>
<tr>
@@ -346,7 +349,7 @@
<% if !@top_items.nil? %>
<tr>
<td width="40px"><%= t :top %> <%= t("views.right_panel.detail.item") %> : </td>
<td align="right" width="60px"><%= @top_items.item_name %>
<td align="right" width="60px"><%= @top_items.item_name %>
<br>(<%= @top_items.item_total_price %>)</td>
</tr>
<% end %>
@@ -359,19 +362,41 @@
</table>
</div>
</div>
</div>
</div>
<% if current_user.role == 'administrator' || current_user.role == 'manager' || current_user.role == 'account' %>
</div>
<% end %>
<% end %>
</div>
<% if isMobile.include? "Mobile" %>
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 ">
<div class="card">
<div class="body">
<h4><i class="material-icons md-24">dashboard</i><%= (t :top) + " " + (t :products) %></h4>
<!-- <canvas id="top_products" class="col-md-12"></canvas> -->
<%= pie_chart @top_products %>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 ">
<div class="card">
<div class="body">
<h4><i class="material-icons md-24">dashboard</i><%= (t :bottom) + " " + (t :products) %></h4>
<!-- <canvas id="top_products" class="col-md-12"></canvas> -->
<%= pie_chart @bottom_products %>
</div>
</div>
</div>
</div>
<% end %>
</div>
<script type="text/javascript">
$(document).ready(function(){
var from = '<%= @from.strftime('%d-%m-%Y') rescue '' %>';
var to = '<%= @to.strftime('%d-%m-%Y') rescue '' %>';
if((from!=undefined) && (from != null) && (from != '')){
$('#from').val(from);
}
@@ -434,4 +459,4 @@
if(status && t_status) status = true;
return status;
}
</script>
</script>

View File

@@ -154,7 +154,7 @@
$(".collapse.in").each(function () {
$(this).siblings(".panel-heading").find(".glyphicon").addClass("glyphicon-minus").removeClass("glyphicon-plus");
});
// Toggle plus minus icon on show hide of collapse element
$(".collapse").on('show.bs.collapse', function () {
$(this).parent().find(".glyphicon").removeClass("glyphicon-plus").addClass("glyphicon-minus");
@@ -164,11 +164,3 @@
});
</script>

View File

@@ -18,19 +18,19 @@
<%if current_login_employee.role !="waiter" %>
<a href="javascript:void(0);" class="bars"></a>
<% if current_login_employee.role == "administrator" || current_login_employee.role == "manager" || current_login_employee.role == "account" %>
<a class="navbar-brand" href="<%=dashboard_path%>" style="margin-left: 20px;">
<a class="navbar-brand mbl_view" href="<%=dashboard_path%>" style="margin-left: 20px;">
<% elsif current_login_employee.role == "supervisor" || current_login_employee.role == "cashier" || current_login_employee.role == "waiter" %>
<a class="navbar-brand" href="<%=origami_dashboard_path%>" style="margin-left: 20px;">
<a class="navbar-brand mbl_view" href="<%=origami_dashboard_path%>" style="margin-left: 20px;">
<%else%>
<a class="navbar-brand" href="" style="margin-left: 20px;">
<a class="navbar-brand mbl_view" href="" style="margin-left: 20px;">
<% end %>
<% else %>
<a class="navbar-brand m-0" href="<%= origami_dashboard_path%>">
<a class="navbar-brand m-0 mbl_view" href="<%= origami_dashboard_path%>">
<%end%>
<img src="<%= asset_path('SX-Logo-small.png') %>" width="40" height="40" alt="Logo" />
<span class="navbar-brand-txt">SX Restaurant</span>
</a>
<span class="navbar-brand m-0">
<span id="others_payment"></span>
</span>
@@ -40,11 +40,17 @@
<span class="navbar-brand navbar-brand-txt"><%= shop_detail.name %></span>
</div>
<!-- End Shop Info -->
<div class="navbar-right m-auto">
<% if order_reservation %>
<div class="online_order">
<span class="navbar-brand navbar-brand-txt header-default-color"><%= t :order_reservation %></span>
<span class="navbar-brand navbar-brand-txt header-default-color">
<% if request.user_agent.include? "Mobile" %>
<img src="/assets/online_order_icon.png" alt="<%= t :order_reservation %>" />
<% else %>
<%= t :order_reservation %>
<% end %>
</span>
<span class="order_no"></span>
</div>
<% end %>
@@ -52,7 +58,7 @@
<!-- Start Quick Access for Cashier -->
<!-- <div class="navbar-right m-auto">
<a href="#" class="dropdown-toggle waves-block col-white" data-toggle="dropdown" aria-haspopup="true" aria-expanded="flase">
<a href="#" class="dropdown-toggle waves-block col-white" data-toggle="dropdown" aria-haspopup="true" aria-expanded="flase">
<span><%= t :cashier %></span>
</a>
<ul class="dropdown-menu">
@@ -62,7 +68,7 @@
<i class="material-icons font-7 logout_icon shopinfo">monetization_on</i>
<span class="font-15 shopinfo dinein" ><%= t :dine_in %></span>
</a>
</p>
</p>
</li>
<li>
<p class="waves-effect waves-block p-l-20 m-b-5">
@@ -70,7 +76,7 @@
<i class="material-icons font-7 logout_icon shopinfo">restaurant_menu</i>
<span class="font-15 shopinfo quick_service" ><%= t :quick_service %></span>
</a>
</p>
</p>
</li>
<% if order_reservation %>
<li>
@@ -80,7 +86,7 @@
<span class="font-15 col-black online_order" ><%= t :order_reservation %></span>
<span class="order_no"></span>
</a>
</p>
</p>
</li>
<% end %>
<li>
@@ -89,7 +95,7 @@
<i class="material-icons font-7 logout_icon shopinfo">book</i>
<span class="font-15 col-black reservation" ><%= t :reservation %></span>
</a>
</p>
</p>
</li>
<li>
<p class="waves-effect waves-block p-l-20 m-b-5">
@@ -97,17 +103,23 @@
<i class="material-icons font-7 logout_icon shopinfo">restaurant</i>
<span class="font-15 col-black foodcourt" ><%= t :foodcourt %></span>
</a>
</p>
</p>
</li>
</ul>
</div> -->
<!-- End Quick Access for Cashier -->
<!-- Start Delete confirrm text !-->
<div class="navbar-right">
<a href="javascript:void(0);" class="dropdown-toggle waves-block" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
<div class="navbar-right toggle_mbl">
<a href="javascript:void(0);" class="dropdown-toggle waves-block" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
<% if current_login_employee %>
<span><%= current_login_employee.name %></span>
<span>
<% if request.user_agent.include? "Mobile" %>
<img src="/assets/user_icon.png" alt="<%= current_login_employee.name %>" />
<% else %>
<%= current_login_employee.name %>
<% end %>
</span>
<% end %>
</a>
<ul class="dropdown-menu">
@@ -118,14 +130,14 @@
<i class="material-icons font-7 logout_icon shopinfo">info</i>
<span class="font-15 shopinfo" >Shop Info</span>
</a>
</p>
</p>
</li>
<% end %>
<li>
<p class="waves-effect waves-block p-l-30 m-b-5 team_viewer">
<i class="material-icons font-7 logout_icon shopinfo">touch_app</i>
<span class="font-15 shopinfo" >Team Viewer</span>
</p>
</p>
</li>
<li>
<!-- <p class="delete waves-effect waves-block p-l-30 m-b-5" data-ref="<%=logout_path%>" data-method="delete">
@@ -140,7 +152,7 @@
<h6>Are you sure you want to Logout ?</h6>
<!-- <h6>This action can't be undo. </h6> -->
</span>
</li>
</li>
</ul>
<!-- NO Need for color Change
<a href="javascript:void(0);" class="js-right-sidebar" data-close="true">
@@ -156,7 +168,7 @@
var method = $(this).attr('data-method');
var url = $(this).attr('data-ref');
var html_text = $(this).siblings( "#delete_text" ).html();
//var page = url.substring(url.lastIndexOf('/') + 1);
//var page = url.substring(url.lastIndexOf('/') + 1);
swal({
title: "Confirmation",
text: html_text,
@@ -168,11 +180,11 @@
if (isConfirm) {
$.ajax({
type: method,
url: url ,
success: function(data) {
url: url ,
success: function(data) {
location.href = data.url;
}
});
});
} else {
swal("Cancelled", "Your imaginary file is safe :)", "error");
}
@@ -203,6 +215,6 @@
}
});
});
});
</script>
</script>

View File

@@ -2,12 +2,12 @@
<aside id="leftsidebar" class="sidebar">
<!-- User Info -->
<!-- <div class="user-info">
<div class="image">
<div class="image">
<img src="public/image/user.png" width="48" height="48" alt="User" />
</div>
<div class="info-container">
<div class="name" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
current_login_employee.name
current_login_employee.name
</div>
<div class="email">john.doe@example.com</div>
<div class="btn-group user-helper-dropdown">
@@ -21,7 +21,7 @@
<li role="seperator" class="divider"></li>
<li><a href="javascript:void(0);"><i class="material-icons">input</i>Sign Out</a></li>
</ul>
</div>
</div>
</div>
</div> -->
<!-- #User Info -->
@@ -42,7 +42,7 @@
</a>
</li>
<% if can? :menage, OrderQueueStation %>
<li>
<li class="menu-up">
<a href="<%= oqs_root_path %>">
<i class="material-icons">room_service</i>
<span><%= t :oqs %></span>
@@ -50,8 +50,8 @@
</li>
<% end %>
<% if can? :index, :home %>
<% if current_login_employee.role != "kitchen" %>
<li>
<% if current_login_employee.role != "kitchen" %>
<li class="menu-up">
<a href="<%= origami_dashboard_path %>">
<i class="material-icons">monetization_on</i>
<span><%= t :origami %></span>
@@ -60,27 +60,27 @@
<% end %>
<% end %>
<% if can? :menage, Customer %>
<li>
<li class="menu-up">
<a href="javascript:void(0);" class="menu-toggle">
<i class="material-icons">widgets</i>
<span><%= t :crm %></span>
</a>
<ul class="ml-menu">
<li>
<a href="<%= crm_customers_path %>"><%= t :customer %></a>
</li>
<% if can? :menage, DiningQueue %>
<li>
<a href="<%= crm_dining_queues_path %>"><%= t :queue %></a>
</li>
<% end %>
</li>
<% end %>
</ul>
</li>
<% end %>
<% end %>
<% if can? :menage, Inventory %>
<li>
<li class="menu-up">
<a href="<%= inventory_path %>">
<i class="material-icons">store</i>
<span><%= t :inventory %></span>
@@ -88,66 +88,9 @@
</li>
<%end%>
<li class="header"><%= t :backend %></li>
<li>
<a href="javascript:void(0);" class="menu-toggle">
<i class="material-icons">widgets</i>
<span><%= t :transactions %></span>
</a>
<ul class="ml-menu">
<% if can? :menage, Booking %>
<li>
<a href="<%= transactions_bookings_path %>"><%= t :bookings %></a>
</li>
<% end %>
<% if can? :menage, Order %>
<li>
<a href="<%= transactions_orders_path %>"><%= t :orders %></a>
</li>
<% end %>
<% if can? :menage, Sale %>
<li>
<a href="<%= transactions_sales_path %>"><%= t :sale %></a>
</li>
<% end %>
<% if can? :menage, Sale %>
<li>
<a href="<%= transactions_credit_notes_path %>"><%= (t :credit) %></a>
</li>
<% end %>
<% if can? :menage, Sale %>
<li>
<a href="<%= transactions_shift_sales_path %>"><%= (t :shiftsale) %></a>
</li>
<% end %>
<% if can? :menage, Survey %>
<li>
<a href="<%= transactions_surveys_path %>"><%= t("views.right_panel.detail.survey") %></a>
</li>
<% end %>
<% if can? :manage, OrderReservation %>
<% if order_reservation %>
<li>
<a href="<%= transactions_order_reservations_path %>"><%= t("views.right_panel.detail.order_reservation") %></a>
</li>
<% end %>
<% end %>
<% if can? :manage, Sale %>
<% if bank_integration %>
<li>
<a href="<%= transactions_card_sale_trans_path %>"><%= t :cb_payments %></a>
</li>
<% end %>
<% end %>
<% if can? :manage, Sale %>
<% if bank_integration %>
<li>
<a href="<%= transactions_card_settle_trans_path %>"><%= t :cb_settlement %></a>
</li>
<% end %>
<% end %>
</ul>
</li>
<% if can? :index, :dailysale %>
<% device = request.user_agent %>
<% if device.include? 'Mobile' %>
<% if can? :index, :dailysale %>
<li>
<a href="javascript:void(0);" class="menu-toggle">
<i class="material-icons">assessment</i>
@@ -207,8 +150,193 @@
</li>
<% end %>
</ul>
</li>
</li>
<%end%>
<li>
<a href="javascript:void(0);" class="menu-toggle">
<i class="material-icons">widgets</i>
<span><%= t :transactions %></span>
</a>
<ul class="ml-menu">
<% if can? :menage, Booking %>
<li>
<a href="<%= transactions_bookings_path %>"><%= t :bookings %></a>
</li>
<% end %>
<% if can? :menage, Order %>
<li>
<a href="<%= transactions_orders_path %>"><%= t :orders %></a>
</li>
<% end %>
<% if can? :menage, Sale %>
<li>
<a href="<%= transactions_sales_path %>"><%= t :sale %></a>
</li>
<% end %>
<% if can? :menage, Sale %>
<li>
<a href="<%= transactions_credit_notes_path %>"><%= (t :credit) %></a>
</li>
<% end %>
<% if can? :menage, Sale %>
<li>
<a href="<%= transactions_shift_sales_path %>"><%= (t :shiftsale) %></a>
</li>
<% end %>
<% if can? :menage, Survey %>
<li>
<a href="<%= transactions_surveys_path %>"><%= t("views.right_panel.detail.survey") %></a>
</li>
<% end %>
<% if can? :manage, OrderReservation %>
<% if order_reservation %>
<li>
<a href="<%= transactions_order_reservations_path %>"><%= t("views.right_panel.detail.order_reservation") %></a>
</li>
<% end %>
<% end %>
<% if can? :manage, Sale %>
<% if bank_integration %>
<li>
<a href="<%= transactions_card_sale_trans_path %>"><%= t :cb_payments %></a>
</li>
<% end %>
<% end %>
<% if can? :manage, Sale %>
<% if bank_integration %>
<li>
<a href="<%= transactions_card_settle_trans_path %>"><%= t :cb_settlement %></a>
</li>
<% end %>
<% end %>
</ul>
</li>
<%else%>
<li id="left-menu">
<a href="javascript:void(0);" class="menu-toggle">
<i class="material-icons">widgets</i>
<span><%= t :transactions %></span>
</a>
<ul class="ml-menu">
<% if can? :menage, Booking %>
<li>
<a href="<%= transactions_bookings_path %>"><%= t :bookings %></a>
</li>
<% end %>
<% if can? :menage, Order %>
<li>
<a href="<%= transactions_orders_path %>"><%= t :orders %></a>
</li>
<% end %>
<% if can? :menage, Sale %>
<li>
<a href="<%= transactions_sales_path %>"><%= t :sale %></a>
</li>
<% end %>
<% if can? :menage, Sale %>
<li>
<a href="<%= transactions_credit_notes_path %>"><%= (t :credit) %></a>
</li>
<% end %>
<% if can? :menage, Sale %>
<li>
<a href="<%= transactions_shift_sales_path %>"><%= (t :shiftsale) %></a>
</li>
<% end %>
<% if can? :menage, Survey %>
<li>
<a href="<%= transactions_surveys_path %>"><%= t("views.right_panel.detail.survey") %></a>
</li>
<% end %>
<% if can? :manage, OrderReservation %>
<% if order_reservation %>
<li>
<a href="<%= transactions_order_reservations_path %>"><%= t("views.right_panel.detail.order_reservation") %></a>
</li>
<% end %>
<% end %>
<% if can? :manage, Sale %>
<% if bank_integration %>
<li>
<a href="<%= transactions_card_sale_trans_path %>"><%= t :cb_payments %></a>
</li>
<% end %>
<% end %>
<% if can? :manage, Sale %>
<% if bank_integration %>
<li>
<a href="<%= transactions_card_settle_trans_path %>"><%= t :cb_settlement %></a>
</li>
<% end %>
<% end %>
</ul>
</li>
<% if can? :index, :dailysale %>
<li>
<a href="javascript:void(0);" class="menu-toggle">
<i class="material-icons">assessment</i>
<span><%= t :reports %></span>
</a>
<ul class="ml-menu">
<li>
<a href="<%= reports_dailysale_index_path %>">Daily Sales</a>
</li>
<li>
<a href="<%= reports_saleitem_index_path %>">Sale Items</a>
</li>
<li>
<a href="<%= reports_product_sale_index_path %>">Product Sale</a>
</li>
<% if order_reservation %>
<li>
<a href="<%= reports_order_reservation_index_path %>"><%= t("views.right_panel.detail.order_reservation") %></a>
</li>
<% end %>
<li>
<a href="<%= reports_receipt_no_index_path %>">Receipt</a>
</li>
<li>
<a href="<%= reports_receipt_no_detail_index_path %>">Receipt Detail</a>
</li>
<li>
<a href="<%= reports_shiftsale_index_path %>">Shift Sales</a>
</li>
<li>
<a href="<%= reports_credit_payment_index_path %>">Credit Sales</a>
</li>
<li>
<a href="<%= reports_void_sale_index_path %>">Void Sales</a>
</li>
<li>
<a href="<%= reports_waste_and_spoilage_index_path %>">Wastes & Spoilages</a>
</li>
<li>
<a href="<%= reports_payment_method_index_path %>">Payment Method</a>
</li>
<li>
<a href="<%= reports_commission_index_path %>">Commission</a>
</li>
<li>
<a href="<%= reports_induty_index_path %>">Induty</a>
</li>
<li>
<a href="<%= reports_stock_check_index_path %>">Stock Check</a>
</li>
<% if bank_integration %>
<li>
<a href="<%= reports_card_sale_tran_index_path %>">CB Payments</a>
</li>
<li>
<a href="<%= reports_card_settle_tran_index_path %>">CB Settlement</a>
</li>
<% end %>
</ul>
</li>
<% end %>
<% end %>
<div id="setting" >
<li class="header"><%= t :settings %></li>
<% if can? :menage, Zone %>
<li>
@@ -232,7 +360,7 @@
<i class="material-icons col-indigo">donut_large</i>
<span><%= t :oqs %></span>
</a>
</li>
</li>
<% end %>
<% if can? :menage, Employee %>
<li>
@@ -256,7 +384,7 @@
<i class="material-icons col-pupple">donut_large</i>
<span><%= t :printer %></span>
</a>
</li>
</li>
<% end %>
<% if can? :menage, TaxProfile %>
<li>
@@ -312,8 +440,11 @@
</a>
</li>
<% end %>
</div>
</ul>
</div>
<!-- #Menu -->
<!-- Footer -->
<div class="legal">
@@ -326,4 +457,4 @@
</div>
<!-- #Footer -->
</aside>
<!-- #END# Left Sidebar
<!-- #END# Left Sidebar

View File

@@ -35,7 +35,7 @@
<!-- <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js" integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4" crossorigin="anonymous"></script> -->
<%= javascript_include_tag 'login', 'data-turbolinks-track': 'reload' %>
<%= javascript_include_tag 'login', 'data-turbolinks-track': 'reload' %>
</head>
<body class="login-page">
@@ -57,8 +57,8 @@
</div>
<!-- #END# Page Loader -->
<% flash.each do |type, message| %>
<%
if type == "notice"
<%
if type == "notice"
color = "alert-success"
elsif type == "error"
color = "alert-danger"
@@ -67,22 +67,22 @@
else
color = "bg-black"
end %>
<p id="noti" class="hidden noti" data-placement-from="top" data-message="<%=message%>" data-placement-align="center"
data-animate-enter="" data-animate-exit="" data-color-name="<%=color%>" >
</p>
<% end %>
<% end %>
<div class="login-box">
<div class="logo text-center">
<img src="/image/SX-logo.png" width="150px" height="150px">
<p>
<small>Version - 1.0.1</small>
</p>
</p>
</div>
<div class="row">
<div class="col-lg-12_ col-md-12 col-sm-12 col-xs-12 text-center">
<div class="current-shop-name">
<span><%= shop_detail.name %></span>
<span><%= shop_detail.name %></span>
</div>
</div>
</div>
@@ -90,13 +90,13 @@
<div class="card padding-10">
<div class="card-header m-l-">
<div class="row clearfix">
<div class="col-lg-10 col-md-10 col-sm-10 col-xs-10">
<div class="col-lg-10 col-md-10 col-sm-10 col-xs-10 login_pwd">
<%= f.input :emp_id, as: :hidden, required: false, class: "form-control" %>
<%= f.input :password, label: "Access PIN", required: false, class: "form-control" %>
</div>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-10">
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-10 login_ent">
<br>
<span class="input-group-addon enter m-t-25 m-l--25" data-value="ENT" style="cursor: pointer;padding:0.1rem !important;">
<i class="material-icons">send</i>
@@ -126,10 +126,16 @@
<!-- <div class="pin_pad bg-grey" data-value="CLR">CLR</div>
<div class="pin_pad left" data-value="0">0</div>
<div class="pin_pad left bg-indigo" data-value="ENT">ENT</div> -->
<% if request.user_agent.include? 'Mobile' %>
<div class="pin_pad bg-blue-grey" data-value="CLR">CLR</div>
<div class="pin_pad left" data-value="0">0</div>
<div class="pin_pad bg-grey left" data-value="ENT">ENTER</div>
<% else %>
<div class="pin_pad bg-blue-grey" data-value="BAC">BACK</div>
<div class="pin_pad left" data-value="0">0</div>
<div class="pin_pad bg-grey left" data-value="CLR">CLR</div>
</div>
<div class="pin_pad bg-blue-grey" data-value="CLR">CLR</div>
<% end %>
</div>
</div>
</div>
<% end %>
@@ -139,7 +145,7 @@
$("#login_form_password").focus();
$(".pin_pad").click(function (event) {
event.preventDefault();
event.preventDefault();
var value = $(this).data("value");
if (value == "CLR") {
@@ -154,12 +160,12 @@
}
});
$(".enter").click(function (event) {
event.preventDefault();
event.preventDefault();
var value = $(this).data("value");
if (value == "ENT") {
$("#new_login_form").submit();
}
}
});
});
function showNotification(colorName, text, placementFrom, placementAlign, animateEnter, animateExit) {
@@ -199,5 +205,3 @@
</script>
</body>
</html>

View File

@@ -15,10 +15,10 @@
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" type="text/css"> -->
<%= stylesheet_link_tag 'login', media: 'all', 'data-turbolinks-track': 'reload' %>
<!-- <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js" integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4" crossorigin="anonymous"></script> -->
<%= javascript_include_tag 'login', 'data-turbolinks-track': 'reload' %>
<%= javascript_include_tag 'login', 'data-turbolinks-track': 'reload' %>
</head>
<body class="login_dashboard">
@@ -39,8 +39,8 @@
</div>
</div>
<% flash.each do |type, message| %>
<%
if type == "notice"
<%
if type == "notice"
color = "alert-success"
elsif type == "error"
color = "alert-danger"
@@ -49,11 +49,11 @@
else
color = "bg-black"
end %>
<p id="noti" class="hidden noti" data-placement-from="top" data-message="<%=message%>" data-placement-align="center"
data-animate-enter="" data-animate-exit="" data-color-name="<%=color%>" >
</p>
<% end %>
<% end %>
<!-- #END# Page Loader -->
<div class="container">
@@ -62,25 +62,25 @@
<img src="/image/SX-logo.png" width="150px" height="150px">
<p>
<small>Version - 1.0.1</small>
</p>
</p>
</div>
</div>
<div class="row">
<div class="col-lg-12_ col-md-12 col-sm-12 col-xs-12 text-center">
<div class="current-shop-name">
<span><%= shop_detail.name %></span>
<span><%= shop_detail.name %></span>
</div>
</div>
</div>
<div class="row bg-white box">
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6 p-t-20 p-l-10 p-r-10 p-b-50 bg-white">
<div class="row justify-content-center form-group">
<div class="row bg-white box">
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6 p-t-20 p-l-10 p-r-10 p-b-50 bg-white">
<div class="row justify-content-center form-group">
<input type="text" class="form-control col-4" id="emp_id" placeholder="Employee ID">
</div>
</div>
<br>
<div class="card padding-10">
<div class="card-content">
<div class="card-content card-btn">
<div class='col-md-12'>
<div class='row bottom'>
<div class="pin_pad " data-value="1">1</div>
@@ -103,14 +103,14 @@
<div class="pin_pad left bg-indigo" data-value="ENT">ENT</div> -->
<div class="pin_pad bg-blue-grey" data-value="BAC">BACK</div>
<div class="pin_pad left" data-value="0">0</div>
<div class="pin_pad bg-grey left" data-value="CLR">CLR</div>
</div>
<div class="pin_pad bg-grey left" data-value="CLR">CLR</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6 p-t-20 p-l-10 p-r-10 p-b-50 bg-white">
</div>
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6 p-t-20 p-l-10 p-r-10 p-b-50 bg-white">
<ul class="nav nav-tabs" role="tablist">
<% @roles.each do |role| %>
<%if role != "administrator" %>
@@ -119,8 +119,8 @@
</li>
<% end %>
<% end %>
</ul>
</ul>
<div class="tab-content" style="max-height:650px; overflow:auto">
@@ -129,7 +129,7 @@
<div class="tab-pane" id="<%=role%>" role="tabpanel" style="max-height:; overflow:auto">
<% @employees.each do |employee| %>
<%if employee.role == role %>
<div class="col-xs-3 col-sm-3 col-md-3 col-lg-3 empBtn" data-formid="#form_<%= employee.emp_id %>" style="float: left;">
<div class="col-xs-3 col-sm-3 col-md-3 col-lg-3 empBtn mbl-btn-usrgp" data-formid="#form_<%= employee.emp_id %>" style="float: left;">
<form id="form_<%= employee.emp_id %>" action="<%= emp_login_path(employee.emp_id) %>" method="PATCH">
</form>
<%if employee.image_path.present? %>
@@ -138,20 +138,20 @@
<div class="p-name"><b><%= employee.name%></b>
</div>
</div>
<% else %>
<% else %>
<div class="login_dashboard p-card">
<i class="material-icons style_icon">person</i>
<div class="p-name"><b><%= employee.name%></b>
</div>
</div>
<% end %>
<% end %>
</div>
<% end %>
<% end %>
</div>
</div>
<% end %>
<% end %>
</div>
</div>
</div>
<!-- <div class="col-xs-12 col-sm-12 col-md-2 col-lg-2"> </div> -->
</div>
@@ -159,7 +159,7 @@
</body>
</html>
<script>
<script>
$(document).ready(function () {
@@ -172,7 +172,7 @@
var text = $("#noti").attr('data-message');
if (text != null || colorName != null){
showNotification(colorName, text, placementFrom, placementAlign, animateEnter, animateExit);
showNotification(colorName, text, placementFrom, placementAlign, animateEnter, animateExit);
}
$(".empBtn").click(function (event) {
@@ -181,15 +181,15 @@
$(item).submit();
});
$('ul.nav.nav-tabs li a').click(function() {
var bb = $('.nav-item').children()[0];
$('ul.nav.nav-tabs li a').click(function() {
var bb = $('.nav-item').children()[0];
$(bb).removeClass('active_tab');
$(this).parent().addClass('active_tab').siblings().removeClass('active_tab');
});
$("#emp_id").focus();
$(".pin_pad").click(function (event) {
event.preventDefault();
event.preventDefault();
var value = $(this).data("value");
if (value == "CLR") {
@@ -213,11 +213,11 @@
$('#emp_id').keyup(function(e) {
e.preventDefault();
var txtVal = this.value;
var txtVal = this.value;
if(txtVal!=''){
if ($.isNumeric(txtVal)) {
if( txtVal.length === 3 ) {
if ($.isNumeric(txtVal)) {
if( txtVal.length === 3 ) {
window.location.href = '/auth/'+txtVal;
}
}else{
@@ -228,10 +228,10 @@
var aa = $('.nav-item').children().attr('href').replace('#','');
$('#'+aa).addClass('active');
var bb = $('.nav-item').children()[0];
var bb = $('.nav-item').children()[0];
$(bb).parent().addClass('active_tab').siblings().removeClass('active_tab');
});
});
function showNotification(colorName, text, placementFrom, placementAlign, animateEnter, animateExit) {
if (colorName === null || colorName === '') { colorName = 'bg-black'; }
@@ -268,6 +268,3 @@
}
//end Notificaiotn message
</script>

View File

@@ -2,15 +2,15 @@
<%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %>
<% if period_type != false %>
<div class="row">
<% if defined? @payment_method %>
<div class="col-lg-2 col-md-2 col-sm-2">
<label class="font-14"><%= t("views.right_panel.detail.select_payments") %></label>
<%= select_tag "payment_type", options_for_select(@payment_method, :selected => params[:payment_type]), :class => "form-control" %>
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.select_payments") %></label>
<%= select_tag "payment_type", options_for_select(@payment_method, :selected => params[:payment_type]), :class => "form-control" %>
</div>
<% end %>
<div class="col-lg-2 col-md-2 col-sm-2">
<label class="font-14"><%= t("views.right_panel.detail.select_period") %></label>
<% end %>
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.select_period") %></label>
<select name="period" id="sel_period" class="form-control">
<option value=""><%= t("views.right_panel.detail.select_period") %></option>
<option value="0">Today</option>
@@ -26,10 +26,10 @@
</select>
</div>
<% if not defined? payments %>
<div class="col-lg-2 col-md-2 col-sm-2">
<label class="font-14"><%= t("views.right_panel.detail.select_payments") %></label>
<div class="col-lg-2 col-md-2 col-sm-2 mbl-style">
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.select_payments") %></label>
<select name="payment_type" id="payment_type" class="form-control">
<% @payments.each do |pm| %>
<option class="<%=pm[1].downcase%>" value="<%=pm[1].downcase%>"><%=pm[0]%></option>
@@ -38,52 +38,52 @@
<option value="<%=pm.payment_method%>" class="<%=pm.payment_method%>" > <%=pm.payment_method%></option>
<%end %>
</select>
</div>
</div>
<% end %>
<div class="col-lg-2 col-md-2 col-sm-2">
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
<!-- <label class="">Select Shift Period</label> -->
<label class="font-14"><%= t("views.right_panel.detail.from") %></label>
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.from") %></label>
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="from" id="from" type="text" placeholder="From date" style="height: 32px;">
</div>
<div class="col-lg-2 col-md-2 col-sm-2">
<label class="font-14"><%= t("views.right_panel.detail.to") %></label>
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.to") %></label>
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="to" id="to" type="text" placeholder="To date" style="height: 32px;">
</div>
<div class="col-lg-2 col-md-2 col-sm-2">
<label class="font-14"><%= t("views.right_panel.detail.all_shift") %></label>
<div class="col-lg-2 col-md-2 col-sm-2 mbl-style">
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.all_shift") %></label>
<select class="form-control select" name="shift_name" id="shift_name" >
</select>
</div>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 mbl-right-btn mbl-style">
<br>
<input type="submit" value="Generate Report" class='btn btn-primary'>
</div>
</div>
</div>
</div>
<% end %>
<% end %>
</div>
<% end %>
</div>
<script type="text/javascript">
$(function(){
$('#custom_excel').hide();
$('#custom_excel').click(function(){
var url = $('#custom_excel').attr('data-url');
$('#frm_report').attr('action',url)
$('#frm_report').submit();
// window.location = url;
});
var item = $('#item').val();
var payment_type = $('#payment_type');
if(item == 'order'){
$('#cashier').hide();
$('#waiter').show();
if(payment_type){
$('#payment_type').hide();
}
}
}
else if(item == 'sale'){
$('#waiter').hide();
@@ -91,7 +91,7 @@
}
else{
$('#waiter').hide();
$('#cashier').show();
$('#cashier').show();
$("#item").val('sale');
}
});
@@ -109,7 +109,7 @@
$("#to").val("<%=params[:to] rescue '-'%>");
$("#sel_period").val(<%=params[:period] rescue '-'%>);
$("#sel_sale_type").val(<%=params[:sale_type] rescue '-'%>);
$(".<%=params[:payment_type]%>").attr('selected','selected')
@@ -128,7 +128,7 @@
if(item == 'sale'){
$('#waiter').hide();
$('#cashier').show();
$('#cashier').show();
if(payment_type){
$('#payment_type').show();
}

View File

@@ -16,10 +16,10 @@
<div class="text-right">
<a href="javascript:export_to('<%=reports_card_sale_tran_index_path%>.xls')" class = "btn btn-info wave-effects"><%= t("views.btn.exp_to_excel") %></a>
</div>
</div>
<div class="margin-top-20">
<div class="card" style="width:112%;">
<div class="margin-top-20 mbl-table">
<div class="card mbl-table-card" style="width:112%;">
<table class="table table-striped" border="0">
<thead>
@@ -28,12 +28,12 @@
</tr>
<% if @shift_from %>
<tr>
<% if @shift_data.employee %>
<% if @shift_data.employee %>
<% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %>
<% end %>
<% end %>
<th colspan="9"><%= t("views.right_panel.detail.shift_name") %> = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )</th>
</tr>
<% end %>
<% end %>
<tr>
<th><%= t("views.right_panel.detail.req_date") %></th>
@@ -63,7 +63,7 @@
UnionPay
<% else %>
<%= cardSale.app %>
<% end %>
<% end %>
</td>
<td><%= cardSale.sale.customer.name rescue '-' %></td>
<td><%= cardSale.sale.cashier_name rescue '-' %></td>
@@ -72,18 +72,18 @@
TID : <%= cardSale.terminal_id %>
<br>
<% end %>
<% if cardSale.merchant_id != '' %>
<% if cardSale.merchant_id != '' %>
MID : <%= cardSale.merchant_id %>
<br>
<% end %>
<% if cardSale.batch_no != '' %>
<% if cardSale.batch_no != '' %>
Batch : <%= cardSale.batch_no %>
<br>
<% end %>
<% if cardSale.trace != '' %>
<% if cardSale.trace != '' %>
Trace : <%= cardSale.trace %>
<% end %>
</td>
<% end %>
</td>
</tr>
<% end %>
<% else %>
@@ -102,20 +102,20 @@
var check_arr = [];
search_by_period();
$('#sel_period').change(function(){
search_by_period();
});
function search_by_period(){
var period = $('#sel_period').val();
var period_type = 0;
var from = "";
var to = "";
show_shift_name(period,period_type,from,to,'shift_item');
}
show_shift_name(period,period_type,from,to,'shift_item');
}
// OK button is clicked
$('#from').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
new_date = new Date(date) ;
@@ -130,50 +130,50 @@
to = new_date.getDate() + "-" + month + "-" + new_date.getFullYear();
$('#to').val(to)
search_by_date();
});
});
function search_by_date(){
from = $("#from").val();
to = $("#to").val();
var period = 0;
var period_type = 1;
var period_type = 1;
if(to != '' && from != ''){
shift_name = from + ',' + to;
check_arr.push(to);
if(check_arr.length == 1){
show_shift_name(period,period_type,from,to,'shift_item');
show_shift_name(period,period_type,from,to,'shift_item');
}
if(check_arr.length == 3){
check_arr = [];
}
}
}
function show_shift_name(period,period_type,from,to,shift_item){
var shift = $('#shift_name');
shift.empty();
var str = '';
var param_shift = '';
var param_shift = '';
var param_shift = '<%= params[:shift_name] rescue '-'%>';
if (from == '' && to == '') {
from = $("#from").val();
to = $("#to").val();
}
url = '<%= reports_get_shift_by_date_path %>';
$.get(url, {period :period, period_type :period_type, from :from, to :to, report_type :shift_item} , function(data){
str = '<option value="0">--- All Shift ---</option>';
$(data.message).each(function(index){
$(data.message).each(function(index){
var local_date = data.message[index].local_opening_date + ' - ' + data.message[index].local_closing_date;
var sh_date = data.message[index].opening_date + ' - ' + data.message[index].closing_date;
var shift_id = data.message[index].shift_id ;
@@ -182,18 +182,18 @@
selected = 'selected = "selected"';
}
else{
selected = '';
}
selected = '';
}
}else{
selected = '';
}
selected = '';
}
str += '<option value="'+ shift_id +'" '+ selected +'>' + local_date + '</option>';
// console.log(sh_date)
})
})
shift.append(str);
});
}
});
</script>
</script>

View File

@@ -2,15 +2,15 @@
<%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %>
<% if period_type != false %>
<div class="row">
<% if defined? @payment_method %>
<div class="col-lg-2 col-md-2 col-sm-2">
<label class="font-14"><%= t("views.right_panel.detail.select_payments") %></label>
<%= select_tag "payment_type", options_for_select(@payment_method, :selected => params[:payment_type]), :class => "form-control" %>
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.select_payments") %></label>
<%= select_tag "payment_type", options_for_select(@payment_method, :selected => params[:payment_type]), :class => "form-control" %>
</div>
<% end %>
<div class="col-lg-2 col-md-2 col-sm-2">
<label class="font-14"><%= t("views.right_panel.detail.select_period") %></label>
<% end %>
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.select_period") %></label>
<select name="period" id="sel_period" class="form-control">
<option value=""><%= t("views.right_panel.detail.select_period") %></option>
<option value="0">Today</option>
@@ -26,10 +26,10 @@
</select>
</div>
<% if not defined? payments %>
<div class="col-lg-2 col-md-2 col-sm-2">
<div class="col-lg-2 col-md-2 col-sm-2 mbl-style">
<label class="font-14"><%= t("views.right_panel.detail.select_payments") %></label>
<select name="payment_type" id="payment_type" class="form-control">
<% @payments.each do |pm| %>
<option class="<%=pm[1].downcase%>" value="<%=pm[1].downcase%>"><%=pm[0]%></option>
@@ -38,52 +38,52 @@
<option value="<%=pm.payment_method%>" class="<%=pm.payment_method%>" > <%=pm.payment_method%></option>
<%end %>
</select>
</div>
</div>
<% end %>
<div class="col-lg-2 col-md-2 col-sm-2">
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
<!-- <label class="">Select Shift Period</label> -->
<label class="font-14"><%= t("views.right_panel.detail.from") %></label>
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.from") %></label>
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="from" id="from" type="text" placeholder="From date" style="height: 32px;">
</div>
<div class="col-lg-2 col-md-2 col-sm-2">
<label class="font-14"><%= t("views.right_panel.detail.to") %></label>
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.to") %></label>
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="to" id="to" type="text" placeholder="To date" style="height: 32px;">
</div>
<div class="col-lg-2 col-md-2 col-sm-2">
<label class="font-14"><%= t("views.right_panel.detail.all_shift") %></label>
<div class="col-lg-2 col-md-2 col-sm-2 mbl-style">
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.all_shift") %></label>
<select class="form-control select" name="shift_name" id="shift_name" >
</select>
</div>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 mbl-right-btn mbl-style">
<br>
<input type="submit" value="Generate Report" class='btn btn-primary'>
</div>
</div>
</div>
</div>
<% end %>
<% end %>
</div>
<% end %>
</div>
<script type="text/javascript">
$(function(){
$('#custom_excel').hide();
$('#custom_excel').click(function(){
var url = $('#custom_excel').attr('data-url');
$('#frm_report').attr('action',url)
$('#frm_report').submit();
// window.location = url;
});
var item = $('#item').val();
var payment_type = $('#payment_type');
if(item == 'order'){
$('#cashier').hide();
$('#waiter').show();
if(payment_type){
$('#payment_type').hide();
}
}
}
else if(item == 'sale'){
$('#waiter').hide();
@@ -91,7 +91,7 @@
}
else{
$('#waiter').hide();
$('#cashier').show();
$('#cashier').show();
$("#item").val('sale');
}
});
@@ -109,7 +109,7 @@
$("#to").val("<%=params[:to] rescue '-'%>");
$("#sel_period").val(<%=params[:period] rescue '-'%>);
$("#sel_sale_type").val(<%=params[:sale_type] rescue '-'%>);
$(".<%=params[:payment_type]%>").attr('selected','selected')
@@ -128,7 +128,7 @@
if(item == 'sale'){
$('#waiter').hide();
$('#cashier').show();
$('#cashier').show();
if(payment_type){
$('#payment_type').show();
}

View File

@@ -16,10 +16,10 @@
<div class="text-right">
<a href="javascript:export_to('<%=reports_card_settle_tran_index_path%>.xls')" class = "btn btn-info wave-effects"><%= t("views.btn.exp_to_excel") %></a>
</div>
</div>
<div class="margin-top-20">
<div class="card">
<div class="margin-top-20 mbl-table">
<div class="card mbl-table-card">
<table class="table table-striped" border="0">
<thead>
@@ -28,12 +28,12 @@
</tr>
<% if @shift_from %>
<tr>
<% if @shift_data.employee %>
<% if @shift_data.employee %>
<% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %>
<% end %>
<% end %>
<th colspan="9"><%= t("views.right_panel.detail.shift_name") %> = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )</th>
</tr>
<% end %>
<% end %>
<tr>
<th><%= t("views.right_panel.detail.shift_sale_id") %></th>
@@ -81,20 +81,20 @@
var check_arr = [];
search_by_period();
$('#sel_period').change(function(){
search_by_period();
});
function search_by_period(){
var period = $('#sel_period').val();
var period_type = 0;
var from = "";
var to = "";
show_shift_name(period,period_type,from,to,'shift_item');
}
show_shift_name(period,period_type,from,to,'shift_item');
}
// OK button is clicked
$('#from').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
new_date = new Date(date) ;
@@ -109,50 +109,50 @@
to = new_date.getDate() + "-" + month + "-" + new_date.getFullYear();
$('#to').val(to)
search_by_date();
});
});
function search_by_date(){
from = $("#from").val();
to = $("#to").val();
var period = 0;
var period_type = 1;
var period_type = 1;
if(to != '' && from != ''){
shift_name = from + ',' + to;
check_arr.push(to);
if(check_arr.length == 1){
show_shift_name(period,period_type,from,to,'shift_item');
show_shift_name(period,period_type,from,to,'shift_item');
}
if(check_arr.length == 3){
check_arr = [];
}
}
}
function show_shift_name(period,period_type,from,to,shift_item){
var shift = $('#shift_name');
shift.empty();
var str = '';
var param_shift = '';
var param_shift = '';
var param_shift = '<%= params[:shift_name] rescue '-'%>';
if (from == '' && to == '') {
from = $("#from").val();
to = $("#to").val();
}
url = '<%= reports_get_shift_by_date_path %>';
$.get(url, {period :period, period_type :period_type, from :from, to :to, report_type :shift_item} , function(data){
str = '<option value="0">--- All Shift ---</option>';
$(data.message).each(function(index){
$(data.message).each(function(index){
var local_date = data.message[index].local_opening_date + ' - ' + data.message[index].local_closing_date;
var sh_date = data.message[index].opening_date + ' - ' + data.message[index].closing_date;
var shift_id = data.message[index].shift_id ;
@@ -161,18 +161,18 @@
selected = 'selected = "selected"';
}
else{
selected = '';
}
selected = '';
}
}else{
selected = '';
}
selected = '';
}
str += '<option value="'+ shift_id +'" '+ selected +'>' + local_date + '</option>';
// console.log(sh_date)
})
})
shift.append(str);
});
}
});
</script>
</script>

View File

@@ -11,17 +11,17 @@
<input class="form-control" name="daterange" id="daterange" type="text" placeholder="Date Range" readonly="true">
<% end %>
</div> -->
<div class="col-lg-3 col-md-3 col-sm-3">
<div class="col-lg-3 col-md-3 col-sm-3 col-mbl-view mbl-style">
<!-- <label class="">Select Shift Period</label> -->
<label class="font-14"><%= t("views.right_panel.detail.from") %></label>
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.from") %></label>
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="from" id="from" type="text" placeholder="From date" style="height: 34px;">
</div>
<div class="col-lg-3 col-md-3 col-sm-3">
<label class="font-14"><%= t("views.right_panel.detail.to") %></label>
<div class="col-lg-3 col-md-3 col-sm-3 col-mbl-view mbl-style">
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.to") %></label>
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="to" id="to" type="text" placeholder="To date" style="height: 34px;">
</div>
<div class="col-lg-2 col-md-2 col-sm-2">
<label class="font-14"><%= t :commissioner %></label>
<label class="font-14 mbl_lbl"><%= t :commissioner %></label>
<select class="form-control" name="commissioner" id="commissioner" style="height: 37px;">
<option value=""></option>
<% @commissioner.each do |c| %>
@@ -33,7 +33,7 @@
<% end %>
</select>
</div>
<div class="col-lg-2 col-md-2 col-sm-2 margin-top-20">
<div class="col-lg-2 col-md-2 col-sm-2 margin-top-20 mbl-right-btn mbl-style">
<br>
<input type="submit" value="Generate Report" class='btn btn-info wave-effects'>
</div>
@@ -89,4 +89,4 @@
});
</script>
-->
-->

View File

@@ -2,8 +2,8 @@
<%= 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 class="font-20"><%= t("views.right_panel.detail.select_period") %></label>
<div class="form-group col-md-2 mbl-style">
<label class="font-20 mbl_lbl"><%= t("views.right_panel.detail.select_period") %></label>
<select name="period" id="sel_period" class="form-control">
<option value=""><%= t("views.right_panel.detail.select_period") %></option>
<option value="0">Today</option>
@@ -19,60 +19,60 @@
</select>
</div>
<% if defined? filter_for_credit %>
<div class="form-group col-md-2">
<label class="font-20">Select Paid/ Unpaid</label>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 col-mbl-view mbl-style">
<label class="font-14">Select Paid/ Unpaid</label>
<%= select_tag "filter_check", options_for_select(@filter_for_credit, :selected => params[:filter_check]), :class => "form-control", :style => "height: 37px;" %>
</div>
<% end %>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
<label class="font-14"><%= t("views.right_panel.detail.order_source") %></label>
<%= select_tag "order_source", options_for_select(@sources, :selected => params[:order_source]), :class => "form-control" %>
</div>
<div class="form-group col-md-2">
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 col-mbl-view mbl-style">
<label class="font-14"><%= t("views.right_panel.detail.order_source") %></label>
<%= select_tag "order_source", options_for_select(@sources, :selected => params[:order_source]), :class => "form-control" %>
</div>
<div class="form-group col-md-2 col-mbl-view mbl-style">
<!-- <label class="">Select Shift Period</label> -->
<label class="font-20">From</label>
<label class="font-20 mbl_lbl">From</label>
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="from" id="from" type="text" placeholder="From date" style="height: 34px;">
</div>
<div class="form-group col-md-2">
<label class="font-20">To</label>
<div class="form-group col-md-2 col-mbl-view mbl-style">
<label class="font-20 mbl_lbl">To</label>
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="to" id="to" type="text" placeholder="To date" style="height: 34px;">
</div>
<div class="form-group col-md-2">
<label class="font-20">All Shift</label>
<div class="form-group col-md-2 mbl-style">
<label class="font-20 mbl_lbl">All Shift</label>
<select class="form-control select" name="shift_name" id="shift_name" style="height: 37px;">
</select>
</div>
</div>
</div>
</div>
<div class="row clearfix">
<div class="form-group col-md-12" align="right">
<div class="form-group col-md-12 mbl-style mbl-right-btn" align="right">
<br>
<input type="submit" value="Generate Report" class='btn btn-primary'>
</div>
</div>
</div>
<% end %>
<% end %>
</div>
<% end %>
</div>
<script type="text/javascript">
$(function(){
$('#custom_excel').hide();
$('#custom_excel').click(function(){
var url = $('#custom_excel').attr('data-url');
$('#frm_report').attr('action',url)
$('#frm_report').submit();
// window.location = url;
});
var item = $('#item').val();
var payment_type = $('#payment_type');
if(item == 'order'){
$('#cashier').hide();
$('#waiter').show();
if(payment_type){
$('#payment_type').hide();
}
}
}
else if(item == 'sale'){
$('#waiter').hide();
@@ -80,7 +80,7 @@
}
else{
$('#waiter').hide();
$('#cashier').show();
$('#cashier').show();
$("#item").val('sale');
}
});
@@ -117,7 +117,7 @@
if(item == 'sale'){
$('#waiter').hide();
$('#cashier').show();
$('#cashier').show();
if(payment_type){
$('#payment_type').show();
}

View File

@@ -1,10 +1,10 @@
<div class="p-l-15">
<%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %>
<% if period_type != false %>
<div class="row">
<div class="col-lg-2 col-md-2 col-sm-2">
<label class="font-14"><%= t("views.right_panel.detail.select_period") %></label>
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl mbl-style">
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.select_period") %></label>
<select name="period" id="sel_period" class="form-control">
<option value=""><%= t("views.right_panel.detail.select_period") %></option>
<option value="0">Today</option>
@@ -21,20 +21,20 @@
</div>
<input type="hidden" name="report_type" value="daily_sale" id="sel_sale_type">
<div class="col-lg-3 col-md-3 col-sm-3">
<div class="col-lg-3 col-md-3 col-sm-3 col-mbl-view mbl-style">
<!-- <label class="">Select Shift Period</label> -->
<label class="font-14"><%= t("views.right_panel.detail.from") %></label>
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.from") %></label>
<input data-behaviour='datepicker' class="form-control datepicker" name="from" id="from" type="text" placeholder="From date" style="height: 35px;">
</div>
<div class="col-lg-3 col-md-3 col-sm-3">
<label class="font-14"><%= t("views.right_panel.detail.to") %></label>
<div class="col-lg-3 col-md-3 col-sm-3 col-mbl-view mbl-style">
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.to") %></label>
<input data-behaviour='datepicker' class="form-control datepicker" name="to" id="to" type="text" placeholder="To date" style="height: 35px;">
</div>
<div class="col-lg-2 col-md-2 col-sm-2 margin-top-20">
<div class="col-lg-2 col-md-2 col-sm-2 margin-top-20 mbl-right-btn mbl-style">
<label></label><br>
<input type="submit" value="Generate Report" class='btn btn-primary'>
</div>
</div>
</div>
</div>
<% end %>
<div class="row">
@@ -44,11 +44,11 @@
<% end %>
<% if defined? menu_types %>
<%= select_tag "menu_type", options_for_select(@menu_types, :selected => params[:menu_type]), :class => "form-control" %>
<%= 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" %>
<%= select_tag "payment_type", options_for_select(@payments, :selected => params[:payment_type]), :class => "form-control" %>
<% end %>
<% if defined? shift_name %>
@@ -63,31 +63,31 @@
<% 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 %>
<% if defined? bsm %>
<%= select_tag "singer", options_from_collection_for_select(bsm,"id","name"),:prompt => "All BSM List", :class => "form-control" %>
<% end %>
<% 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" %>
<%= select_tag "payment_type_list", options_for_select(@payment_list, :selected => params[:payment_type_list]), :class => "form-control" %>
<% end %>
<% if defined? items %>
<%= select_tag "item", options_for_select(@items, :selected => params[:item_type]), :class => "form-control" %>
<% 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 %>
</div>
<% end %>
</div>
<script type="text/javascript">
$(function(){
@@ -108,7 +108,7 @@
$('#waiter').show();
if(payment_type){
$('#payment_type').hide();
}
}
}
else if(item == 'sale'){
$('#waiter').hide();
@@ -116,7 +116,7 @@
}
else{
$('#waiter').hide();
$('#cashier').show();
$('#cashier').show();
$("#item").val('sale');
}
});
@@ -151,7 +151,7 @@ $('#item').change(function(){
if(item == 'sale'){
$('#waiter').hide();
$('#cashier').show();
$('#cashier').show();
if(payment_type){
$('#payment_type').show();
}
@@ -164,4 +164,4 @@ $('#item').change(function(){
}
}
});
</script>
</script>

View File

@@ -1,5 +1,5 @@
<div class="page-header" style="width:130%;">
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item active"><%= t("views.right_panel.detail.daily_sale_report") %></li>
@@ -15,50 +15,50 @@
<hr />
<div class=" text-right">
<a href="javascript:export_to('<%=reports_dailysale_index_path%>.xls')" class = "btn btn-info wave-effects"><%= t("views.btn.exp_to_excel") %></a>
</div>
</div>
<div class="row">
<div class="col-md-12 col-lg-12">
<div class="card" style="width:129%;">
<div class="card mbl_card">
<div class="body table-responsive">
<table class="table table-bordered">
<thead>
<thead>
<tr>
<th colspan="15"> <%= t("views.right_panel.detail.from_date") %> : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - <%= t("views.right_panel.detail.to_date") %> : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%></th>
<th colspan="18"> <%= t("views.right_panel.detail.from_date") %> : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - <%= t("views.right_panel.detail.to_date") %> : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%></th>
</tr>
<tr>
<th style='text-align:center;'><%= t("views.right_panel.detail.sr") %></th>
<th style='text-align:center;'><%= t("views.right_panel.detail.date") %></th>
<th style='text-align:center;'><%= t("views.right_panel.detail.void_amount") %></th>
<% if @payment_methods.include? ("MPU") %>
<th style='text-align:center;'><%= t("views.right_panel.detail.mpu_sales") %></th>
<th style='text-align:center;' class="d-none d-sm-table-cell"><%= t("views.right_panel.detail.mpu_sales") %></th>
<% end %>
<% if @payment_methods.include? ("Master") %>
<th style='text-align:center;'><%= t("views.right_panel.detail.master_sales") %></th>
<th style='text-align:center;' class="d-none d-sm-table-cell"><%= t("views.right_panel.detail.master_sales") %></th>
<% end %>
<% if @payment_methods.include? ("VISA") %>
<th style='text-align:center;'><%= t("views.right_panel.detail.visa_sales") %></th>
<th style='text-align:center;' class="d-none d-sm-table-cell"><%= t("views.right_panel.detail.visa_sales") %></th>
<% end %>
<% if @payment_methods.include? ("JCB") %>
<th style='text-align:center;'><%= t("views.right_panel.detail.jcb_sales") %></th>
<th style='text-align:center;' class="d-none d-sm-table-cell"><%= t("views.right_panel.detail.jcb_sales") %></th>
<% end %>
<% if @payment_methods.include? ("UNIONPAY") %>
<th style='text-align:center;'><%= t("views.right_panel.detail.unionpay_sales") %></th>
<th style='text-align:center;' class="d-none d-sm-table-cell"><%= t("views.right_panel.detail.unionpay_sales") %></th>
<% end %>
<% if @payment_methods.include? ("Alipay") %>
<th style='text-align:center;'><%= t("views.right_panel.detail.alipay_sales") %></th>
<th style='text-align:center;' class="d-none d-sm-table-cell"><%= t("views.right_panel.detail.alipay_sales") %></th>
<% end %>
<% if @payment_methods.include? ("PAYMAL") %>
<th style='text-align:center;'><%= t("views.right_panel.detail.paymal_sales") %></th>
<th style='text-align:center;' class="d-none d-sm-table-cell"><%= t("views.right_panel.detail.paymal_sales") %></th>
<% end %>
<% if @payment_methods.include? ("DINGA") %>
<th style='text-align:center;'><%= t("views.right_panel.detail.dinga_sales") %></th>
<th style='text-align:center;' class="d-none d-sm-table-cell"><%= t("views.right_panel.detail.dinga_sales") %></th>
<% end %>
<% if @payment_methods.include? ("JunctionPay") %>
<th style='text-align:center;'><%= t("views.right_panel.detail.junctionpay_sales") %></th>
<th style='text-align:center;' class="d-none d-sm-table-cell"><%= t("views.right_panel.detail.junctionpay_sales") %></th>
<% end %>
<% if @payment_methods.include? ("Redeem") %>
<th style='text-align:center;'><%= t("views.right_panel.detail.redeem_sales") %></th>
<th style='text-align:center;' class="d-none d-sm-table-cell"><%= t("views.right_panel.detail.redeem_sales") %></th>
<% end %>
<th style='text-align:center;'><%= t("views.right_panel.detail.cash_sales") %></th>
<th style='text-align:center;'><%= t("views.right_panel.detail.credit_sales") %></th>
@@ -67,10 +67,10 @@
<th style='text-align:center;'><%= t("views.right_panel.detail.giftvoucher_sales") %></th>
<% end %>
<th style='text-align:center;'>(<%= t("views.right_panel.detail.discount") %>)</th>
<!-- <th style='text-align:center;'><%= t("views.right_panel.detail.grand_total") %> + <br/> <%= t("views.right_panel.detail.rnd_adj_sh") %></th> -->
<th style='text-align:center;'><%= t("views.right_panel.detail.grand_total") %></th>
<!-- <th style='text-align:center;'><%= t("views.right_panel.detail.grand_total") %> + <br/> <%= t("views.right_panel.detail.rnd_adj_sh") %></th> -->
<th style='text-align:center;'><%= t("views.right_panel.detail.grand_total") %></th>
<th style='text-align:center;'><%= t("views.right_panel.detail.rnd_adj_sh") %></th>
</tr>
</thead>
<% if @print_settings.precision.to_i > 0
@@ -84,7 +84,7 @@
else
delimiter = ""
end
%>
%>
<% unless @sale_data.empty? %>
<tbody>
@@ -105,8 +105,8 @@
<% foc = 0 %>
<% discount = 0 %>
<% total = 0 %>
<% grand_total = 0 %>
<% old_grand_total = 0 %>
<% grand_total = 0 %>
<% old_grand_total = 0 %>
<% count = 1 %> <% rounding_adj = 0 %>
<% @sale_data.each do |sale| %>
<% void += sale[:void_amount] %>
@@ -122,121 +122,141 @@
<% giftvoucher += sale[:giftvoucher_amount] %>
<% paypar += sale[:paypar_amount] %>
<% cash += sale[:cash_amount]-sale[:total_change_amount] %>
<% credit += sale[:credit_amount] %>
<% credit += sale[:credit_amount] %>
<% foc += sale[:foc_amount] %>
<% discount += sale[:total_discount] %>
<% total += sale[: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 %>
<% 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_precision(sale[:void_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% if @payment_methods.include? ("MPU") %>
<td style='text-align:right;'><%= number_with_precision(sale[:mpu_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(sale[:mpu_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% end %>
<% if @payment_methods.include? ("Master") %>
<td style='text-align:right;'><%= number_with_precision(sale[:master_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(sale[:master_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% end %>
<% if @payment_methods.include? ("VISA") %>
<td style='text-align:right;'><%= number_with_precision(sale[:visa_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(sale[:visa_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% end %>
<% if @payment_methods.include? ("JCB") %>
<td style='text-align:right;'><%= number_with_precision(sale[:jcb_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(sale[:jcb_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% end %>
<% if @payment_methods.include? ("UNIONPAY") %>
<td style='text-align:right;'><%= number_with_precision(sale[:unionpay_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(sale[:unionpay_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% end %>
<% if @payment_methods.include? ("Alipay") %>
<td style='text-align:right;'><%= number_with_precision(sale[:alipay_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(sale[:alipay_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% end %>
<% if @payment_methods.include? ("PAYMAL") %>
<td style='text-align:right;'><%= number_with_precision(sale[:paymal_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(sale[:paymal_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% end %>
<% if @payment_methods.include? ("DINGA") %>
<td style='text-align:right;'><%= number_with_precision(sale[:dinga_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(sale[:dinga_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% end %>
<% if @payment_methods.include? ("JunctionPay") %>
<td style='text-align:right;'><%= number_with_precision(sale[:junctionpay_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(sale[:junctionpay_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% end %>
<% if @payment_methods.include? ("Redeem") %>
<td style='text-align:right;'><%= number_with_precision(sale[:paypar_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(sale[:paypar_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% end %>
<td style='text-align:right;'><%= number_with_precision(sale[:cash_amount]-sale[:total_change_amount], precision:precision.to_i, delimiter: delimiter) rescue '-'%></td>
<td style='text-align:right;'><%= number_with_precision(sale[:credit_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;'><%= number_with_precision(sale[:foc_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;'><%= number_with_precision(sale[:foc_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% if @payment_methods.include? ("GiftVoucher") %>
<td style='text-align:right;'><%= number_with_precision(sale[:giftvoucher_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% end %>
<td style='text-align:right;'><%= number_with_precision(sale[:giftvoucher_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% end %>
<td style='text-align:right;'>(<%= number_with_precision(sale[:total_discount], precision:precision,delimiter:delimiter) rescue '-'%>)</td>
<!-- <td style='text-align:right;'><%= number_with_precision(sale[:grand_total].to_f + sale[:rounding_adj].to_f , precision:precision.to_i,delimiter:delimiter) rescue '-'%></td> -->
<td style='text-align:right;'><%= number_with_precision(sale[:grand_total], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<!-- <td style='text-align:right;'><%= number_with_precision(sale[:grand_total].to_f + sale[:rounding_adj].to_f , precision:precision.to_i,delimiter:delimiter) rescue '-'%></td> -->
<td style='text-align:right;'><%= number_with_precision(sale[:grand_total], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;'><%= number_with_precision(sale[:rounding_adj].to_f, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
</tr>
<% count = count + 1 %>
<% end %>
<% colspan = 7 %>
<tr style="font-weight:600;">
<td colspan="3" style='text-align:center;'>Total</td>
<td colspan="3" style='text-align:center;'>Total</td>
<% if @payment_methods.include? ("MPU") %>
<% colspan += 1 %>
<td style='text-align:right;'><%= number_with_precision(mpu , precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% if !request.user_agent.include? "Mobile" %>
<% colspan += 1 %>
<% end %>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(mpu , precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% end%>
<% if @payment_methods.include? ("Master") %>
<% colspan += 1 %>
<td style='text-align:right;'><%= number_with_precision(master, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% if !request.user_agent.include? "Mobile" %>
<% colspan += 1 %>
<% end %>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(master, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% end%>
<% if @payment_methods.include? ("VISA") %>
<% colspan += 1 %>
<td style='text-align:right;'><%= number_with_precision(visa, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% if !request.user_agent.include? "Mobile" %>
<% colspan += 1 %>
<% end %>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(visa, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% end%>
<% if @payment_methods.include? ("JCB") %>
<% colspan += 1 %>
<td style='text-align:right;'><%= number_with_precision(jcb, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% if !request.user_agent.include? "Mobile" %>
<% colspan += 1 %>
<% end %>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(jcb, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% end%>
<% if @payment_methods.include? ("UNIONPAY") %>
<% colspan += 1 %>
<td style='text-align:right;'><%= number_with_precision(unionpay, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% if !request.user_agent.include? "Mobile" %>
<% colspan += 1 %>
<% end %>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(unionpay, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% end %>
<% if @payment_methods.include? ("Alipay") %>
<% colspan += 1 %>
<td style='text-align:right;'><%= number_with_precision(alipay, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% if !request.user_agent.include? "Mobile" %>
<% colspan += 1 %>
<% end %>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(alipay, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% end %>
<% if @payment_methods.include? ("PAYMAL") %>
<% colspan += 1 %>
<td style='text-align:right;'><%= number_with_precision(paymal, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% if !request.user_agent.include? "Mobile" %>
<% colspan += 1 %>
<% end %>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(paymal, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% end %>
<% if @payment_methods.include? ("DINGA") %>
<% colspan += 1 %>
<td style='text-align:right;'><%= number_with_precision(dinga, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% if !request.user_agent.include? "Mobile" %>
<% colspan += 1 %>
<% end %>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(dinga, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% end %>
<% if @payment_methods.include? ("JunctionPay") %>
<% colspan += 1 %>
<td style='text-align:right;'><%= number_with_precision(junctionpay, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% if !request.user_agent.include? "Mobile" %>
<% colspan += 1 %>
<% end %>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(junctionpay, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% end %>
<% if @payment_methods.include? ("Redeem") %>
<% colspan += 1 %>
<td style='text-align:right;'><%= number_with_precision(paypar, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% if !request.user_agent.include? "Mobile" %>
<% colspan += 1 %>
<% end %>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(paypar, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% end %>
<td style='text-align:right;'><%= number_with_precision(cash, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;'><%= number_with_precision(credit, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;'><%= number_with_precision(foc, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% if @payment_methods.include? ("GiftVoucher") %>
<% colspan += 1 %>
<td style='text-align:right;'><%= number_with_precision(giftvoucher, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% end %>
<td style='text-align:right;'><%= number_with_precision(giftvoucher, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% end %>
<td style='text-align:right;'>(<%= number_with_precision(discount, precision:precision.to_i,delimiter:delimiter) rescue '-'%>)</td>
<!-- <td style='text-align:right;'><%= number_with_precision(total, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td> -->
<td style='text-align:right;'><%= number_with_precision(grand_total, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;'><%= number_with_precision(rounding_adj, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;'><%= number_with_precision(grand_total, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;'><%= number_with_precision(rounding_adj, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
</tr>
<% total_tax = 0 %>
<% net = 0 %>
<% unless @tax.empty? %>
<% @tax.each do |tax|
<% @tax.each do |tax|
total_tax += tax.tax_amount.to_f %>
<tr style="font-weight:600;">
<td colspan="<%= colspan %>" style='text-align:right;'><%= tax.tax_name rescue '-'%></td>
@@ -245,14 +265,14 @@
</tr>
<% end %>
<% end %>
<% net = grand_total %>
<% net = net - rounding_adj%>
<% net = net - total_tax %>
<tr style="font-weight:600;">
<td colspan="<%= colspan %>" style='text-align:right;'><%= t("views.right_panel.detail.net_amount") %></td>
<td style='text-align:right;'><%= number_with_precision(net, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td colspan="2">&nbsp;</td>
<td colspan="2">&nbsp;</td>
</tr>
</tbody>
<% end %>
@@ -263,4 +283,4 @@
</div>
</div>
</div>
</div>

View File

@@ -19,7 +19,7 @@
<th style='text-align:center;'><%= t("views.right_panel.detail.date") %></th>
<th style='text-align:center;'><%= t("views.right_panel.detail.void_amount") %></th>
<% if @payment_methods.include? ("MPU") %>
<th style='text-align:center;'><%= t("views.right_panel.detail.mpu_sales") %></th>
<th style='text-align:center;' class='mobile'><%= t("views.right_panel.detail.mpu_sales") %></th>
<% end %>
<% if @payment_methods.include? ("Master") %>
<th style='text-align:center;'><%= t("views.right_panel.detail.master_sales") %></th>

View File

@@ -2,8 +2,8 @@
<%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %>
<% if period_type != false %>
<div class="row">
<div class="col-lg-2 col-md-2 col-sm-2">
<label class="font-14"><%= t("views.right_panel.detail.select_period") %></label>
<div class="col-lg-2 col-md-2 col-sm-2 mbl-style">
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.select_period") %></label>
<select name="period" id="sel_period" class="form-control">
<option value=""><%= t("views.right_panel.detail.select_period") %></option>
<option value="0">Today</option>
@@ -20,8 +20,8 @@
</div>
<!-- <input type="hidden" name="report_type" value="sale_item" id="sel_sale_type"> -->
<% if defined? commissioners %>
<div class="col-lg-2 col-md-2 col-sm-2">
<label class="font-14">Select Commissioner</label>
<div class="col-lg-2 col-md-2 col-sm-2 mbl-style">
<label class="font-14 mbl_lbl">Select Commissioner</label>
<select class="form-control" id="commissioner" name="commissioner">
<option value="">--Select Commissioner--</option>
<% if !@commissioners.nil? %>
@@ -34,31 +34,31 @@
<% end %>
<% end %>
</select>
</div>
</div>
<% end %>
<div class="col-lg-2 col-md-2 col-sm-2">
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
<!-- <label class="">Select Shift Period</label> -->
<label class="font-14"><%= t("views.right_panel.detail.from") %></label>
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.from") %></label>
<input data-behaviour='datepicker' class="form-control m-t-3 datepicker" name="from" id="from" type="text" placeholder="From date" style="height: 32px;">
</div>
<div class="col-lg-2 col-md-2 col-sm-2">
<label class="font-14"><%= t("views.right_panel.detail.to") %></label>
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.to") %></label>
<input data-behaviour='datepicker' class="form-control m-t-3 datepicker" name="to" id="to" type="text" placeholder="To date" style="height: 32px;">
</div>
<div class="col-lg-2 col-md-2 col-sm-2">
<label class="font-14">All Shift</label>
<div class="col-lg-2 col-md-2 col-sm-2 mbl-style">
<label class="font-14 mbl_lbl">All Shift</label>
<select class="form-control select" name="shift_name" id="shift_name" >
</select>
</div>
<div class="col-lg-2 col-md-2 col-sm-2 margin-top-20">
<div class="col-lg-2 col-md-2 col-sm-2 margin-top-20 mbl-right-btn mbl-style">
<br>
<input type="submit" value="Generate Report" class='btn btn-primary'>
</div>
</div>
</div>
</div>
<% end %>
<% end %>
</div>
<% end %>
</div>
<script type="text/javascript">
$(function(){
@@ -83,7 +83,7 @@
}
else{
$('#waiter').hide();
$('#cashier').show();
$('#cashier').show();
$("#item").val('sale');
}
});

View File

@@ -2,8 +2,8 @@
<%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %>
<% if period_type != false %>
<div class="row">
<div class="col-lg-2 col-md-2 col-sm-2">
<label class="font-13"><%= t("views.right_panel.detail.select_period") %></label>
<div class="col-lg-2 col-md-2 col-sm-2 mbl-style">
<label class="font-13 mbl_lbl"><%= t("views.right_panel.detail.select_period") %></label>
<select name="period" id="sel_period" class="form-control">
<option value=""><%= t("views.right_panel.detail.select_period") %></option>
<option value="0">Today</option>
@@ -19,40 +19,40 @@
</select>
</div>
<% if defined? providers %>
<div class="col-lg-1 col-md-1 col-sm-1">
<div class="col-lg-1 col-md-1 col-sm-1 col-mbl-view mbl-style">
<label class="font-13"><%= t("views.right_panel.detail.select_providers") %></label>
<%= select_tag "provider", options_for_select(@providers, :selected => params[:provider]), :class => "form-control", :style => "height: 35px;" %>
<%= select_tag "provider", options_for_select(@providers, :selected => params[:provider]), :class => "form-control", :style => "height: 35px;" %>
</div>
<% end %>
<% if defined? payment_types %>
<div class="col-lg-1 col-md-1 col-sm-1">
<div class="col-lg-1 col-md-1 col-sm-1 col-mbl-view mbl-style">
<label class="font-13"><%= t("views.right_panel.detail.select_payment") %></label>
<%= select_tag "payment_type", options_for_select(@payment_types, :selected => params[:payment_type]), :class => "form-control", :style => "height: 35px;" %>
<%= select_tag "payment_type", options_for_select(@payment_types, :selected => params[:payment_type]), :class => "form-control", :style => "height: 35px;" %>
</div>
<% end %>
<div class="col-lg-2 col-md-2 col-sm-2">
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
<!-- <label class="">Select Shift Period</label> -->
<label class="font-13"><%= t("views.right_panel.detail.from") %></label>
<label class="font-13 mbl_lbl"><%= t("views.right_panel.detail.from") %></label>
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="from" id="from" type="text" placeholder="From date" style="height: 32px;">
</div>
<div class="col-lg-2 col-md-2 col-sm-2">
<label class="font-13"><%= t("views.right_panel.detail.to") %></label>
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
<label class="font-13 mbl_lbl"><%= t("views.right_panel.detail.to") %></label>
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="to" id="to" type="text" placeholder="To date" style="height: 32px;">
</div>
<div class="col-lg-2 col-md-2 col-sm-2">
<label class="font-13"><%= t("views.right_panel.detail.all_shift") %></label>
<div class="col-lg-2 col-md-2 col-sm-2 mbl-style">
<label class="font-13 mbl_lbl"><%= t("views.right_panel.detail.all_shift") %></label>
<select class="form-control select" name="shift_name" id="shift_name" >
</select>
</div>
<div class="col-lg-1 col-md-1 col-sm-1 margin-top-20">
<div class="col-lg-1 col-md-1 col-sm-1 margin-top-20 mbl-right-btn mbl-style">
<br>
<input type="submit" value="Generate Report" class='btn btn-primary'>
</div>
</div>
</div>
</div>
<% end %>
<% end %>
</div>
<% end %>
</div>
<script type="text/javascript">
<% if params[:shift_name].to_i > 0%>

View File

@@ -2,8 +2,8 @@
<%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %>
<% if period_type != false %>
<div class="row">
<div class="col-lg-2 col-md-2 col-sm-2">
<label class="font-14"><%= t("views.right_panel.detail.select_period") %></label>
<div class="col-lg-2 col-md-2 col-sm-2 mbl-style">
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.select_period") %></label>
<select name="period" id="sel_period" class="form-control">
<option value=""><%= t("views.right_panel.detail.select_period") %></option>
<option value="0">Today</option>
@@ -19,55 +19,55 @@
</select>
</div>
<% if defined? payments %>
<div class="col-lg-2 col-md-2 col-sm-2">
<div class="col-lg-2 col-md-2 col-sm-2 mbl-style">
<label class="font-14"><%= t("views.right_panel.detail.select_payments") %></label>
<%= select_tag "payment_type", options_for_select(@payments, :selected => params[:payment_type]), :class => "form-control" %>
<%= select_tag "payment_type", options_for_select(@payments, :selected => params[:payment_type]), :class => "form-control" %>
</div>
<% end %>
<div class="col-lg-2 col-md-2 col-sm-2">
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
<!-- <label class="">Select Shift Period</label> -->
<label class="font-14"><%= t("views.right_panel.detail.from") %></label>
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.from") %></label>
<input data-behaviour='datepicker' class="form-control datepicker m-t-3 from" name="from" id="from" type="text" placeholder="From date" style="height: 34px;">
</div>
<div class="col-lg-2 col-md-2 col-sm-2">
<label class="font-14"><%= t("views.right_panel.detail.to") %></label>
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.to") %></label>
<input data-behaviour='datepicker' class="form-control datepicker m-t-3 to" name="to" id="to" type="text" placeholder="To date" style="height: 34px;">
</div>
<div class="col-lg-2 col-md-2 col-sm-2">
<label class="font-14"><%= t("views.right_panel.detail.all_shift") %></label>
<div class="col-lg-2 col-md-2 col-sm-2 mbl-style">
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.all_shift") %></label>
<select class="form-control select" name="shift_name" id="shift_name" style="height: 37px;" >
</select>
</div>
<div class="col-lg-1 col-md-1 col-sm-1 margin-top-20">
<div class="col-lg-1 col-md-1 col-sm-1 margin-top-20 mbl-right-btn mbl-style">
<br>
<input type="submit" value="Generate Report" class='btn btn-primary'>
</div>
</div>
</div>
</div>
<% end %>
<% end %>
</div>
<% end %>
</div>
<script type="text/javascript">
$(function(){
$('#custom_excel').hide();
$('#custom_excel').click(function(){
var url = $('#custom_excel').attr('data-url');
$('#frm_report').attr('action',url)
$('#frm_report').submit();
// window.location = url;
});
var item = $('#item').val();
var payment_type = $('#payment_type');
if(item == 'order'){
$('#cashier').hide();
$('#waiter').show();
if(payment_type){
$('#payment_type').hide();
}
}
}
else if(item == 'sale'){
$('#waiter').hide();
@@ -75,7 +75,7 @@
}
else{
$('#waiter').hide();
$('#cashier').show();
$('#cashier').show();
$("#item").val('sale');
}
});
@@ -112,7 +112,7 @@
if(item == 'sale'){
$('#waiter').hide();
$('#cashier').show();
$('#cashier').show();
if(payment_type){
$('#payment_type').show();
}

View File

@@ -16,14 +16,14 @@
<hr />
<div class="text-right">
<a href="javascript:export_to('<%=reports_payment_method_index_path%>.xls')" class = "btn btn-info wave-effects"><%= t("views.btn.exp_to_excel") %></a>
</div>
</div>
<div class="margin-top-20">
<div class="card">
<div class="margin-top-20 mbl-table">
<div class="card mbl-table-card">
<table class="table table-bordered">
<thead>
<thead>
<tr>
<th colspan="9">
<th colspan="9">
<strong>
<%= t("views.right_panel.detail.from_date") %> : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - <%= t("views.right_panel.detail.to_date") %> : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%>
</strong>
@@ -31,9 +31,9 @@
</tr>
<% if @shift_from %>
<tr>
<% if @shift_data.employee %>
<% if @shift_data.employee %>
<% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %>
<% end %>
<% end %>
<th colspan="9">
<strong><%= t("views.right_panel.detail.shift_name") %> = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )</strong>
</th>
@@ -67,7 +67,7 @@
else
delimiter = ""
end
%>
%>
<% unless @sale_data.empty? %>
<tbody>
<% @sale_data.each do |sale| %>
@@ -88,7 +88,7 @@
<td><%= number_with_precision(sale[:giftvoucher_amount] , precision: precision.to_i ,delimiter: delimiter) rescue '-' %></td>
</tr>
<% end %>
</tbody>
<% end %>
</table>
@@ -103,7 +103,7 @@
<td colspan="7"><strong>All Payment Details</strong></td>
</tr>
<%end%>
<tr>
<th> <%= t("views.right_panel.detail.shift_name") %> </th>
<th><%= t("views.right_panel.detail.receipt_no") %></th>
@@ -120,9 +120,9 @@
<% if payment.payment_method === 'cash'
total += payment.payment_amount - payment.change_amount
else
total += payment.payment_amount
end%>
<tr>
total += payment.payment_amount
end%>
<tr>
<% if @shift_from.nil? && @shift_to.nil? %>
<td><%= payment.sale_date.utc.getlocal.strftime("%e %b %I:%M%p") rescue '-'%></td>
<% else %>
@@ -138,9 +138,9 @@
<td><%= number_with_precision(payment.payment_amount , precision: precision.to_i ,delimiter: delimiter) rescue '-' %> </td>
<%end%>
<td><%= number_with_precision(payment.sale.grand_total , precision: precision.to_i ,delimiter: delimiter) rescue '-' %></td>
</tr>
<% end %>
<%if total>0%>
<tr>
@@ -162,15 +162,15 @@
$('#sel_period').change(function(){
search_by_period();
});
function search_by_period(){
var period = $('#sel_period').val();
var period_type = 0;
var from = "";
var to = "";
show_shift_name(period,period_type,from,to,'shift_item');
}
show_shift_name(period,period_type,from,to,'shift_item');
}
// OK button is clicked
$('#from').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
@@ -186,49 +186,49 @@
to = new_date.getDate() + "-" + month + "-" + new_date.getFullYear();
$('#to').val(to)
search_by_date();
});
});
function search_by_date(){
from = $("#from").val();
to = $("#to").val();
var period = 0;
var period_type = 1;
var period_type = 1;
if(to != '' && from != ''){
shift_name = from + ',' + to;
check_arr.push(to);
if(check_arr.length == 1){
show_shift_name(period,period_type,from,to,'shift_item');
show_shift_name(period,period_type,from,to,'shift_item');
}
if(check_arr.length == 3){
check_arr = [];
}
}
}
function show_shift_name(period,period_type,from,to,shift_item){
var shift = $('#shift_name');
shift.empty();
if (from == '' && to == '') {
from = $("#from").val();
to = $("#to").val();
}
var str = '';
var param_shift = '';
var param_shift = '';
var param_shift = '<%= params[:shift_name] rescue '-'%>';
console.log(param_shift);
url = '<%= reports_get_shift_by_date_path %>';
console.log(url);
console.log(url);
$.get(url, {period :period, period_type :period_type, from :from, to :to, report_type :shift_item} , function(data){
console.log(data);
str = '<option value="0">--- All Shift ---</option>';
$(data.message).each(function(index){
$(data.message).each(function(index){
var local_date = data.message[index].local_opening_date + ' - ' + data.message[index].local_closing_date;
var sh_date = data.message[index].opening_date + ' - ' + data.message[index].closing_date;
var shift_id = data.message[index].shift_id ;
@@ -237,19 +237,19 @@
selected = 'selected = "selected"';
}
else{
selected = '';
}
selected = '';
}
}else{
selected = '';
}
selected = '';
}
str += '<option value="'+ shift_id +'" '+ selected +'>' + local_date + '</option>';
// console.log(sh_date)
})
})
shift.append(str);
});
}
});
</script>
</script>

View File

@@ -2,8 +2,8 @@
<%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %>
<% if period_type != false %>
<div class="row">
<div class="col-lg-2 col-md-2 col-sm-2">
<label class="font-14"><%= t("views.right_panel.detail.select_period") %></label>
<div class="col-lg-2 col-md-2 col-sm-2 mbl-style">
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.select_period") %></label>
<select name="period" id="sel_period" class="form-control">
<option value=""><%= t("views.right_panel.detail.select_period") %></option>
<option value="0">Today</option>
@@ -33,21 +33,21 @@
</select>
</div>
<% end %>
<div class="col-lg-2 col-md-2 col-sm-2">
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
<!-- <label class="">Select Shift Period</label> -->
<label class="font-14"><%= t("views.right_panel.detail.from") %></label>
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.from") %></label>
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="from" id="from" type="text" placeholder="From date" style="height: 32px;">
</div>
<div class="col-lg-2 col-md-2 col-sm-2">
<label class="font-14"><%= t("views.right_panel.detail.to") %></label>
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.to") %></label>
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="to" id="to" type="text" placeholder="To date" style="height: 32px;">
</div>
<div class="col-lg-2 col-md-2 col-sm-2">
<label class="font-14"><%= t("views.right_panel.detail.all_shift") %></label>
<div class="col-lg-2 col-md-2 col-sm-2 mbl-style">
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.all_shift") %></label>
<select class="form-control select" name="shift_name" id="shift_name" >
</select>
</div>
<div class="col-lg-2 col-md-2 col-sm-2 margin-top-20" style="margin-top: 20px;">
<div class="col-lg-2 col-md-2 col-sm-2 margin-top-20 mbl-style mbl-right-btn" style="margin-top: 20px;">
<input type="submit" value="Generate Report" class='btn btn-primary'>
</div>

View File

@@ -24,8 +24,8 @@
<!-- </div> -->
<!-- </div> -->
<div class="margin-top-20">
<div class="card">
<div class="margin-top-20 mbl-table">
<div class="card mbl-table-card">
<table class="table table-striped" border="0">
<thead>

View File

@@ -2,8 +2,8 @@
<%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %>
<% if period_type != false %>
<div class="row">
<div class="col-lg-2 col-md-2 col-sm-2">
<label class="font-14"><%= t("views.right_panel.detail.select_period") %></label>
<div class="col-lg-2 col-md-2 col-sm-2 mbl-style">
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.select_period") %></label>
<select name="period" id="sel_period" class="form-control">
<option value=""><%= t("views.right_panel.detail.select_period") %></option>
<option value="0">Today</option>
@@ -19,10 +19,10 @@
</select>
</div>
<% if defined? payments %>
<div class="col-lg-2 col-md-2 col-sm-2">
<label class="font-14"><%= t("views.right_panel.detail.select_payments") %></label>
<div class="col-lg-2 col-md-2 col-sm-2 mbl-style">
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.select_payments") %></label>
<select name="payment_type" id="payment_type" class="form-control">
<% @payments.each do |pm| %>
<option class="<%=pm[1].downcase%>" value="<%=pm[1].downcase%>"><%=pm[0]%></option>
@@ -31,52 +31,52 @@
<option value="<%=pm.payment_method%>" class="<%=pm.payment_method%>" > <%=pm.payment_method%></option>
<%end %>
</select>
</div>
</div>
<% end %>
<div class="col-lg-2 col-md-2 col-sm-2">
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
<!-- <label class="">Select Shift Period</label> -->
<label class="font-14"><%= t("views.right_panel.detail.from") %></label>
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.from") %></label>
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="from" id="from" type="text" placeholder="From date" style="height: 32px;">
</div>
<div class="col-lg-2 col-md-2 col-sm-2">
<label class="font-14"><%= t("views.right_panel.detail.to") %></label>
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.to") %></label>
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="to" id="to" type="text" placeholder="To date" style="height: 32px;">
</div>
<div class="col-lg-2 col-md-2 col-sm-2">
<label class="font-14"><%= t("views.right_panel.detail.all_shift") %></label>
<div class="col-lg-2 col-md-2 col-sm-2 mbl-style">
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.all_shift") %></label>
<select class="form-control select" name="shift_name" id="shift_name" >
</select>
</div>
<div class="col-lg-1 col-md-1 col-sm-1 margin-top-20">
<div class="col-lg-1 col-md-1 col-sm-1 margin-top-20 mbl-style mbl-right-btn">
<br>
<input type="submit" value="Generate Report" class='btn btn-primary'>
</div>
</div>
</div>
</div>
<% end %>
<% end %>
</div>
<% end %>
</div>
<script type="text/javascript">
$(function(){
$('#custom_excel').hide();
$('#custom_excel').click(function(){
var url = $('#custom_excel').attr('data-url');
$('#frm_report').attr('action',url)
$('#frm_report').submit();
// window.location = url;
});
var item = $('#item').val();
var payment_type = $('#payment_type');
if(item == 'order'){
$('#cashier').hide();
$('#waiter').show();
if(payment_type){
$('#payment_type').hide();
}
}
}
else if(item == 'sale'){
$('#waiter').hide();
@@ -84,7 +84,7 @@
}
else{
$('#waiter').hide();
$('#cashier').show();
$('#cashier').show();
$("#item").val('sale');
}
});
@@ -101,7 +101,7 @@
$("#to").val("<%=params[:to] rescue '-'%>");
$("#sel_period").val(<%=params[:period] rescue '-'%>);
$("#sel_sale_type").val(<%=params[:sale_type] rescue '-'%>);
$(".<%=params[:payment_type]%>").attr('selected','selected')
// shift = $(".shift-id").text()
@@ -124,7 +124,7 @@
if(item == 'sale'){
$('#waiter').hide();
$('#cashier').show();
$('#cashier').show();
if(payment_type){
$('#payment_type').show();
}

View File

@@ -15,10 +15,10 @@
<hr />
<div class="text-right">
<a href="javascript:export_to('<%=reports_receipt_no_detail_index_path%>.xls')" class = "btn btn-info wave-effects"><%= t("views.btn.exp_to_excel") %></a>
</div>
</div>
<div class="margin-top-20">
<div class="card">
<div class="margin-top-20 mbl-table">
<div class="card mbl-table-card">
<table class="table table-striped" border="0">
<thead>
<tr>
@@ -27,9 +27,9 @@
</tr>
<% if @shift_from %>
<tr>
<% if @shift_data.employee %>
<% if @shift_data.employee %>
<% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %>
<% end %>
<% end %>
<th colspan="7"><%= t("views.right_panel.detail.shift_name") %> = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )</th>
</tr>
<% end %>
@@ -37,9 +37,9 @@
<th><b><%= t("views.right_panel.detail.shift_name") %></b></th>
<th><b><%= t("views.right_panel.detail.table") %></b></th>
<th><b><%= t("views.right_panel.detail.receipt_no") %></b></th>
<th><b><%= t :cashier %> <%= t("views.right_panel.detail.name") %></b></th>
<th><b><%= t :cashier %> <%= t("views.right_panel.detail.name") %></b></th>
<th><b><%= t("views.right_panel.detail.revenue") %></b></th>
<th>&nbsp;</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
@@ -48,7 +48,7 @@
<% table_name=nil
table_type =nil
if result.table_id.to_i>0
table = DiningFacility.find(result.table_id)
table = DiningFacility.find(result.table_id)
table_type = table.type
table_name = table.name
end %>
@@ -57,7 +57,7 @@
<td><%= @shift_from %> - <%= @shift_to %></td>
<td><%= table_type %> - <%= table_name %></td>
<td><%= result.receipt_no rescue '-' %> </td>
<td><%= result.cashier_name rescue '-' %></td>
<td><%= result.cashier_name rescue '-' %></td>
<td><%=result.grand_total%></td>
<!-- <td>&nbsp;</td> -->
</tr>
@@ -76,8 +76,8 @@
<% if item.price.to_i < 0.to_i %>
<% if item.qty.to_i < 0.to_i%>
[PROMO QTY]<%= item.product_name rescue '-' %>
<% else %>
[PROMO PRICE]<%= item.product_name rescue '-' %>
<% else %>
[PROMO PRICE]<%= item.product_name rescue '-' %>
<% end %>
<% else %>
<%= item.product_name rescue '-' %>
@@ -86,70 +86,70 @@
<td><%= item.qty rescue '-' %></td>
<td><%= item.unit_price rescue '-' %></td>
<td><%= item.price rescue '-' %></td>
<td><%=l item.created_at.utc.getlocal, :format => :short rescue '-' %> </td>
<td><%=l item.created_at.utc.getlocal, :format => :short rescue '-' %> </td>
</tr>
<% end %>
<tr><td colspan="5">&nbsp;</td></tr>
<%survey = Survey.find_by_receipt_no(result.receipt_no)%>
<% if !survey.nil?%>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>No. of Guest</td>
<td><%= survey.total_customer rescue '-' %></td>
<td>&nbsp;</td>
</tr>
<% end %>
<td>&nbsp;</td>
</tr>
<% end %>
<% if !result.total_amount.nil?%>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.amount") %></td>
<td><%= result.total_amount %></td>
<td>&nbsp;</td>
</tr>
<td>&nbsp;</td>
</tr>
<% end %>
<% if result.total_discount.to_f > 0 %>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><%= t("views.right_panel.detail.total") %>
<%= t("views.right_panel.detail.discount") %>
<%= t("views.right_panel.detail.discount") %>
<%= t("views.right_panel.detail.amount") %></td>
<td> - <%= result.total_discount %> </td>
<td>&nbsp;</td>
</tr>
<td>&nbsp;</td>
</tr>
<% end %>
<% if !result.total_tax.nil? %>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>Tax Amount </td>
<td><%= result.total_tax %> </td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<% end %>
<% sale_payments = SalePayment.get_sale_payments(result) %>
<% if sale_payments.length > 0%>
<% if sale_payments.length > 0%>
<% sale_payments.each do |rec| %>
<%if rec.payment_amount.to_f > 0 %>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>Payment <%= rec.payment_method.upcase %></td>
<td><%= rec.payment_amount %> ( <%= rec.payment_status %> )</td>
<td>&nbsp;</td>
</tr>
</tr>
<% if !rec.payment_reference.nil? %>
<% if !rec.payment_reference.nil? %>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>Payment Ref.</td>
<td><%= rec.payment_reference %></td>
<td>&nbsp;</td>
@@ -157,10 +157,10 @@
<% end %>
<% end %>
<% end %>
<% if result.amount_changed != 0 && !result.amount_changed.nil? %>
<% if result.amount_changed != 0 && !result.amount_changed.nil? %>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><%= t("views.right_panel.detail.change") %> <%= t("views.right_panel.detail.amount") %></td>
<td><%= result.amount_changed %></td>
<td>&nbsp;</td>
@@ -169,25 +169,25 @@
<% if !result.customer_id.nil?%>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>Customer</td>
<td><%= result.customer.name rescue '-'%>
<td><%= result.customer.name rescue '-'%>
(<%= result.customer.company rescue '-' %>)
</td>
<td>&nbsp;</td>
</tr>
<% end %>
<% end %>
<% end %>
<tr style="border-top:4px double #666;">
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><b>Total Nett</b> - <b><%= grand_total %></b></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</tbody>
</table>
</div>
@@ -201,20 +201,20 @@
var check_arr = [];
search_by_period();
$('#sel_period').change(function(){
search_by_period();
});
function search_by_period(){
var period = $('#sel_period').val();
var period_type = 0;
var from = "";
var to = "";
show_shift_name(period,period_type,from,to,'shift_item');
}
show_shift_name(period,period_type,from,to,'shift_item');
}
// OK button is clicked
$('#from').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
new_date = new Date(date) ;
@@ -229,50 +229,50 @@
to = new_date.getDate() + "-" + month + "-" + new_date.getFullYear();
$('#to').val(to)
search_by_date();
});
});
function search_by_date(){
from = $("#from").val();
to = $("#to").val();
var period = 0;
var period_type = 1;
var period_type = 1;
if(to != '' && from != ''){
shift_name = from + ',' + to;
check_arr.push(to);
if(check_arr.length == 1){
show_shift_name(period,period_type,from,to,'shift_item');
show_shift_name(period,period_type,from,to,'shift_item');
}
if(check_arr.length == 3){
check_arr = [];
}
}
}
function show_shift_name(period,period_type,from,to,shift_item){
var shift = $('#shift_name');
shift.empty();
var str = '';
var param_shift = '';
var param_shift = '';
var param_shift = '<%= params[:shift_name] rescue '-'%>';
if (from == '' && to == '') {
from = $("#from").val();
to = $("#to").val();
}
url = '<%= reports_get_shift_by_date_path %>';
$.get(url, {period :period, period_type :period_type, from :from, to :to, report_type :shift_item} , function(data){
str = '<option value="0">--- All Shift ---</option>';
$(data.message).each(function(index){
$(data.message).each(function(index){
var local_date = data.message[index].local_opening_date + ' - ' + data.message[index].local_closing_date;
var sh_date = data.message[index].opening_date + ' - ' + data.message[index].closing_date;
var shift_id = data.message[index].shift_id ;
@@ -281,18 +281,18 @@
selected = 'selected = "selected"';
}
else{
selected = '';
}
selected = '';
}
}else{
selected = '';
}
selected = '';
}
str += '<option value="'+ shift_id +'" '+ selected +'>' + local_date + '</option>';
// console.log(sh_date)
})
})
shift.append(str);
});
}
});
</script>
</script>

View File

@@ -2,8 +2,8 @@
<%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %>
<% if period_type != false %>
<div class="row">
<div class="col-lg-2 col-md-2 col-sm-2">
<label class="font-14"><%= t("views.right_panel.detail.select_period") %></label>
<div class="col-lg-2 col-md-2 col-sm-2 mbl-style">
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.select_period") %></label>
<select name="period" id="sel_period" class="form-control">
<option value=""><%= t("views.right_panel.detail.select_period") %></option>
<option value="0">Today</option>
@@ -18,9 +18,9 @@
<option value="9">Last year</option>
</select>
</div>
<!-- <input type="hidden" name="report_type" value="sale_item" id="sel_sale_type"> -->
<div class="col-lg-2 col-md-2 col-sm-2">
<label class="font-14">Select Type</label>
<!-- <input type="hidden" name="report_type" value="sale_item" id="sel_sale_type"> -->
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
<label class="font-14 mbl_lbl">Select Type</label>
<select name="sale_type" id="sel_sale_type" class="form-control">
<option value="">Select Type</option>
<option value="revenue" selected>Revenue Only</option>
@@ -31,40 +31,40 @@
<option value="promotion">Promotion Only</option>
<option value="other">Other Amount Only</option>
</select>
</div>
<div class="col-lg-2 col-md-2 col-sm-2">
<label class="font-14"><%= t("views.right_panel.detail.select_account") %></label>
</div>
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.select_account") %></label>
<select name="account_type" id="account_type" class="form-control">
<option value = "">Select Account</option>
<% @account.each do |acc| %>
<option value="<%=acc.title%>" class="<%=acc.title%>" > <%=acc.title%></option>
<%end %>
</select>
</div>
<div class="col-lg-2 col-md-2 col-sm-2">
</select>
</div>
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
<!-- <label class="">Select Shift Period</label> -->
<label class="font-14"><%= t("views.right_panel.detail.from") %></label>
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.from") %></label>
<input data-behaviour='datepicker' class="form-control m-t-3 datepicker" name="from" id="from" type="text" placeholder="From date" style="height: 32px;">
</div>
<div class="col-lg-2 col-md-2 col-sm-2">
<label class="font-14"><%= t("views.right_panel.detail.to") %></label>
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.to") %></label>
<input data-behaviour='datepicker' class="form-control m-t-3 datepicker" name="to" id="to" type="text" placeholder="To date" style="height: 32px;">
</div>
<div class="col-lg-2 col-md-2 col-sm-2">
<label class="font-14">All Shift</label>
<div class="col-lg-2 col-md-2 col-sm-2 mbl-style">
<label class="font-14 mbl_lbl">All Shift</label>
<select class="form-control select" name="shift_name" id="shift_name" >
</select>
</div>
<div class="col-lg-12 col-md-12 col-sm-12 margin-top-20">
<div class="col-lg-12 col-md-12 col-sm-12 margin-top-20 mbl-right-btn">
<br>
<input type="submit" value="Generate Report" class='btn btn-primary float_right'>
</div>
</div>
</div>
</div>
<% end %>
<% end %>
</div>
<% end %>
</div>
<script type="text/javascript">
$(function(){
@@ -87,7 +87,7 @@
$('#waiter').show();
if(payment_type){
$('#payment_type').hide();
}
}
}
else if(item == 'sale'){
$('#waiter').hide();
@@ -95,7 +95,7 @@
}
else{
$('#waiter').hide();
$('#cashier').show();
$('#cashier').show();
$("#item").val('sale');
}
});
@@ -130,7 +130,7 @@
if(item == 'sale'){
$('#waiter').hide();
$('#cashier').show();
$('#cashier').show();
if(payment_type){
$('#payment_type').show();
}

View File

@@ -15,13 +15,13 @@
<hr />
<div class="text-right">
<%= link_to "Print", reports_print_sale_items_path(:type => params[:sale_type], :period => params[:period], :account => params[:account_type], :from => @from, :to => @to, :shift_name => params[:shift_name], :shift_from => @shift_from, :shift_to => @shift_to, :menu_cate_count => @menu_cate_count, :sale_items => @sale_data.to_json), :method => 'post', class:"btn btn-info wave-effects" %>
<button class="btn btn-info wave-effects" onclick="print_sale_items()">Print</button>
<a href="javascript:export_to('<%=reports_saleitem_index_path%>.xls')" class = "btn btn-info wave-effects "><%= t("views.btn.exp_to_excel") %></a>
</div>
<div class="margin-top-20">
<div class="card">
<div class="table-responsive">
<div class="table-responsive">
<table class="table table-striped" id="items_table" border="0">
<thead>
<tr>
@@ -29,9 +29,9 @@
</tr>
<% if @shift_from %>
<tr>
<% if @shift_data.employee %>
<% if @shift_data.employee %>
<% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %>
<% end %>
<% end %>
<th colspan="7"> <%= t("views.right_panel.detail.shift_name") %> = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )</th>
</tr>
<% end %>
@@ -43,9 +43,11 @@
<th><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.item") %></th>
<th><%= t("views.right_panel.detail.unit_price") %></th>
<th><%= t("views.right_panel.detail.revenue") %></th>
</tr>
</tr>
</thead>
<tbody>
<% puts 'testing!!!!!!' %>
<% puts @print_settings.precision.to_i %>
<% if @print_settings.precision.to_i > 0
precision = @print_settings.precision
else
@@ -57,15 +59,16 @@
else
delimiter = ""
end
%>
%>
<% acc_arr = Array.new %>
<% cate_arr = Array.new %>
<% cate_arr = Array.new %>
<% p_qty = 0 %>
<% sub_qty = 0 %>
<% sub_total = 0 %>
<% other_sub_total = 0 %>
<% product_sub_total = 0 %>
<% count = 0 %>
<% row_count = 0 %>
<% total_price = 0 %>
<% cate_count = 0 %>
<% acc_count = 0 %>
@@ -78,8 +81,9 @@
<% total_tax = 0 %>
<% unless @sale_data.blank? %>
<% @sale_data.each do |sale| %>
<% row_count += 1 %>
<!-- all total qty sum -->
<% if sale.status_type != "Discount" && sale.status_type != "foc" && sale.status_type != "promotion"
total_qty += sale.total_item
end %>
@@ -93,15 +97,15 @@
total_qty += sale.total_item*(-1)
end %>
<!-- end all total qty -->
<% if sale.status_type == "foc" && sale.grand_total < 0
total_item_foc += sale.grand_total*(-1)
end %>
end %>
<% if sale.status_type == "Discount" && sale.grand_total < 0
total_item_dis += sale.grand_total*(-1)
end %>
<% if !acc_arr.include?(sale.account_id) %>
<tr>
<td><b><%= sale.account_name %></b></td>
@@ -111,7 +115,7 @@
<% @totalByAccount.each do |account, total| %>
<% if sale.account_id == account %>
<b><%= number_with_precision(total, precision:precision.to_i,delimiter:delimiter) %></b>
<% grand_total += total %>
<% grand_total += total %>
<% end %>
<% end %>
</td>
@@ -120,7 +124,7 @@
<% end %>
<tr>
<td>&nbsp;</td>
<% if !cate_arr.include?(sale.menu_category_id) %>
<% if !cate_arr.include?(sale.menu_category_id) %>
<td><%= sale.menu_category_name %></td>
<% cate_arr.push(sale.menu_category_id) %>
<% else %>
@@ -133,7 +137,7 @@
<%else%>
<td><%= sale.total_item*(-1) rescue '-' %></td>
<% end %>
<td><%= number_with_precision(sale.unit_price , precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td><%= number_with_precision(sale.grand_total , precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
</tr>
@@ -141,7 +145,7 @@
<% @menu_cate_count.each do |key,value| %>
<% if sale.account_id == key %>
<% count = count + 1 %>
<% count = count + 1 %>
<% sub_total += sale.grand_total %>
<% #sub_qty += sale.total_item %>
<% if sale.status_type !="Discount" && (!sale.product_name.include? "FOC") && sale.status_type != "promotion"
@@ -154,7 +158,7 @@
<% if sale.status_type == "promotion" && @type == "promotion"
sub_qty += sale.total_item*(-1)
end %>
<% if count == value %>
<% if count == value %>
<tr>
<td colspan="3">&nbsp;</td>
<td><b>Total <%= sale.account_name %> Qty </b> </td>
@@ -172,7 +176,7 @@
<% end %>
<!--Product Sale -->
<% if @product.present?%>
<tr>
<td><b>Product</b></td>
<td colspan="4">&nbsp;</td>
@@ -194,9 +198,9 @@
<td> <%= number_with_precision(product.grand_total , precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
</tr>
<!-- sub total -->
<% product_sub_total += product.grand_total %>
<!-- end sub total -->
<!-- end sub total -->
<% end %>
<tr>
<td colspan="3">&nbsp;</td>
@@ -211,7 +215,7 @@
<!--Other Charges -->
<% if @type == "other" || @other_charges.present?%>
<tr>
<td><b>Other Charges</b></td>
<td colspan="4">&nbsp;</td>
@@ -232,9 +236,9 @@
<td> <%= number_with_precision(other.grand_total , precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
</tr>
<!-- sub total -->
<% other_sub_total += other.grand_total %>
<!-- end sub total -->
<!-- end sub total -->
<% end %>
<tr>
<td colspan="5">&nbsp;</td>
@@ -248,11 +252,11 @@
<td><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.item") %></td>
<td><span><%= total_qty%></span></td>
<td style="border-bottom:2px solid grey;"><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.amount") %></td>
<td style="border-bottom:2px solid grey;"><span><%= number_with_precision(grand_total , precision:precision.to_i,delimiter:delimiter)%></span></td>
<td style="border-bottom:2px solid grey;"><span><%= number_with_precision(grand_total , precision:precision.to_i,delimiter:delimiter)%></span></td>
</tr>
<% end %>
<% if @type == "other"%>
<tr>
<td><b>Other Charges</b></td>
<td colspan="4">&nbsp;</td>
@@ -273,9 +277,9 @@
<td> <%= number_with_precision(other.grand_total , precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
</tr>
<!-- sub total -->
<% other_sub_total += other.grand_total %>
<!-- end sub total -->
<!-- end sub total -->
<% end %>
<tr>
<td colspan="5">&nbsp;</td>
@@ -285,6 +289,7 @@
<%end%>
</tbody>
</table>
</div>
</div>
</div>
@@ -293,23 +298,20 @@
<script>
$(function(){
var check_arr = [];
var search = '<%= params[:period_type] %>';
if(search){
if(parseInt(search) == 0){
search_by_period();
search_by_period();
}
else{
search_by_date();
search_by_date();
}
}else{
search_by_period();
}
search_by_period();
}
$('#sel_period').change(function(){
search_by_period();
@@ -321,8 +323,8 @@
var from = "";
var to = "";
show_shift_name(period,period_type,from,to,'shift_item');
}
show_shift_name(period,period_type,from,to,'shift_item');
}
// OK button is clicked
$('#from').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
@@ -338,13 +340,13 @@
to = new_date.getDate() + "-" + month + "-" + new_date.getFullYear();
$('#to').val(to)
search_by_date();
});
});
function search_by_date(){
from = $("#from").val();
to = $("#to").val();
var period = 0;
var period_type = 1;
var period_type = 1;
if(to != '' && from != ''){
shift_name = from + ',' + to;
@@ -353,7 +355,7 @@
console.log(check_arr.length)
if(check_arr.length == 1){
show_shift_name(period,period_type,from,to,'shift_item');
show_shift_name(period,period_type,from,to,'shift_item');
}
if(check_arr.length == 3){
check_arr = [];
@@ -372,14 +374,14 @@
var selected = '';
var str = '';
var param_shift = '<%= params[:shift_name]%>';
url = '<%= reports_get_shift_by_sale_item_path %>';
console.log(url)
$.get(url, {period :period, period_type :period_type, from :from, to :to, report_type :shift_item} , function(data){
console.log(data)
str = '<option value="0">--- All Shift ---</option>';
$(data.message).each(function(index){
$(data.message).each(function(index){
var local_date = data.message[index].local_opening_date + ' - ' + data.message[index].local_closing_date;
var sh_date = data.message[index].opening_date + ' - ' + data.message[index].closing_date;
@@ -390,21 +392,46 @@
selected = 'selected = "selected"';
}
else{
selected = '';
}
selected = '';
}
}
else{
selected = '';
}
selected = '';
}
str += '<option value="'+ shift_id +'" '+ selected +'>' + local_date + '</option>';
// console.log(sh_date)
})
})
shift.append(str);
});
}
});
</script>
function print_sale_items(){
var period = $('#sel_period').val();
var type = $('#sel_sale_type').val();
var account = $('#account_type').val();
var from = $('#from').val();
var to = $('#to').val();
var shift = $('#shift_name').val();
// var flag = false;
// alert($('#row_count').val())
// if (flag == true) {
$.ajax({
type: "POST",
url: "<%= reports_print_sale_items_path %>",
data: "period="+period+"&period_type="+type+"&account_type="+account+"&from="+from+"&to="+to+"&shift_name="+shift,
success: function(data){
if (data != null){
location.reload();
}
$("#loader").hide();
}
});
// }
}
</script>

View File

@@ -2,8 +2,8 @@
<%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %>
<% if period_type != false %>
<div class="row">
<div class="col-lg-2 col-md-2 col-sm-2">
<label class="font-14"><%= t("views.right_panel.detail.select_period") %></label>
<div class="col-lg-2 col-md-2 col-sm-2 mbl-style">
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.select_period") %></label>
<select name="period" id="sel_period" class="form-control">
<option value=""><%= t("views.right_panel.detail.select_period") %></option>
<option value="0">Today</option>
@@ -18,50 +18,50 @@
<option value="9">Last year</option>
</select>
</div>
<div class="col-lg-3 col-md-3 col-sm-3">
<div class="col-lg-3 col-md-3 col-sm-3 col-mbl-view mbl-style">
<!-- <label class="font-14">Select Shift Period</label> -->
<label class="font-14"><%= t("views.right_panel.detail.from") %></label>
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.from") %></label>
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="from" id="from" type="text" placeholder="From date" style="height: 32px;">
</div>
<div class="col-lg-3 col-md-3 col-sm-3">
<label class="font-14"><%= t("views.right_panel.detail.to") %></label>
<div class="col-lg-3 col-md-3 col-sm-3 col-mbl-view mbl-style">
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.to") %></label>
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="to" id="to" type="text" placeholder="To date" style="height: 32px;">
</div>
<div class="col-lg-2 col-md-2 col-sm-2">
<label class="font-14"><%= t("views.right_panel.detail.all_shift") %></label>
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.all_shift") %></label>
<select class="form-control select" name="shift_name" id="shift_name" >
</select>
</div>
<div class="col-lg-2 col-md-2 col-sm-2 margin-top-20"><br>
<div class="col-lg-2 col-md-2 col-sm-2 margin-top-20 mbl-style mbl-right-btn"><br>
<input type="submit" value="Generate Report" class='btn btn-primary'>
</div>
</div>
</div>
</div>
<% end %>
<% end %>
</div>
</div>
<script type="text/javascript">
$(function(){
$('#custom_excel').hide();
$('#custom_excel').click(function(){
var url = $('#custom_excel').attr('data-url');
$('#frm_report').attr('action',url)
$('#frm_report').submit();
// window.location = url;
});
var item = $('#item').val();
var payment_type = $('#payment_type');
if(item == 'order'){
$('#cashier').hide();
$('#waiter').show();
if(payment_type){
$('#payment_type').hide();
}
}
}
else if(item == 'sale'){
$('#waiter').hide();
@@ -69,7 +69,7 @@
}
else{
$('#waiter').hide();
$('#cashier').show();
$('#cashier').show();
$("#item").val('sale');
}
});
@@ -102,7 +102,7 @@ $('#item').change(function(){
if(item == 'sale'){
$('#waiter').hide();
$('#cashier').show();
$('#cashier').show();
if(payment_type){
$('#payment_type').show();
}
@@ -115,4 +115,4 @@ $('#item').change(function(){
}
}
});
</script>
</script>

View File

@@ -54,13 +54,18 @@
<th><%= t("views.right_panel.detail.cash_payment") %></th>
<!-- <th>Credit Charges</th> -->
<th><%= t("views.right_panel.detail.credit_payment") %></th>
<th><%= t("views.btn.other_payment") %></th>
<th><%= t("views.btn.foc") %> <%= t :payment %></th>
<th class="d-none d-sm-table-cell"><%= t("views.btn.other_payment") %></th>
<th class="d-none d-sm-table-cell"><%= t("views.btn.foc") %> <%= t :payment %></th>
<!-- <th>Grand Total
<br/>Rounding Adj</th> -->
<!-- <th>Grand Total
<br/>Rounding Adj</th> -->
<!-- <th>Rounding Adj</th> -->
<th><%= t("views.right_panel.detail.grand_total") %></th>
<th>Print</th>
<th>Action</th>
</tr>
</thead>
<tbody>
@@ -104,8 +109,8 @@
<!-- <td><%= sprintf "%.2f",result.accept_credit_amount.to_f.to_d rescue '-'%></td> -->
<!-- <td><%= sprintf "%.2f",result.foc_amount.to_f.to_d rescue '-'%></td>
<td><%= sprintf "%.2f",result.card_amount.to_f.to_d rescue '-'%></td> -->
<td><%= number_with_precision(result[:other_sales].to_f, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td>
<td class="d-none d-sm-table-cell"><%= number_with_precision(result[:other_sales].to_f, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td class="d-none d-sm-table-cell">
<%= number_with_precision(result[:foc_sales].to_f, precision:precision.to_i,delimiter:delimiter) rescue '-'%>
</td>
<td><%= number_with_precision(result[:grand_total].to_f, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
@@ -133,8 +138,8 @@
<td><b><%= number_with_precision(credit, precision:precision.to_i,delimiter:delimiter) rescue '-'%></b></td>
<!-- <td><b><%= sprintf("%.2f",accept_credit) rescue '-'%></b></td> -->
<!-- <td><b><%= sprintf("%.2f",foc) rescue '-'%></b></td> -->
<td><b><%= number_with_precision(card, precision:precision.to_i,delimiter:delimiter) rescue '-'%></b></td>
<td><b><%= number_with_precision(foc, precision:precision.to_i,delimiter:delimiter) rescue '-'%></b></td>
<td class="d-none d-sm-table-cell"><b><%= number_with_precision(card, precision:precision.to_i,delimiter:delimiter) rescue '-'%></b></td>
<td class="d-none d-sm-table-cell"><b><%= number_with_precision(foc, precision:precision.to_i,delimiter:delimiter) rescue '-'%></b></td>
<!-- <td><b><%= sprintf("%.2f",total) rescue '-'%></b></td> -->
<!-- <td><b><%= sprintf("%.2f",rounding_adj) rescue '-'%></b></td> -->
<td><b><%= number_with_precision(g_total, precision:precision.to_i,delimiter:delimiter) rescue '-'%></b></td>

View File

@@ -11,23 +11,23 @@
<input class="form-control" name="daterange" id="daterange" type="text" placeholder="Date Range" readonly="true">
<% end %>
</div> -->
<div class="col-lg-3 col-md-3 col-sm-3">
<div class="col-lg-3 col-md-3 col-sm-3 col-mbl-view mbl-style">
<!-- <label class="">Select Shift Period</label> -->
<label class="font-14">From</label>
<label class="font-14 mbl_lbl">From</label>
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="from" id="from" type="text" placeholder="From date" style="height: 32px;">
</div>
<div class="col-lg-3 col-md-3 col-sm-3">
<label class="font-14">To</label>
<div class="col-lg-3 col-md-3 col-sm-3 col-mbl-view mbl-style">
<label class="font-14 mbl_lbl">To</label>
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="to" id="to" type="text" placeholder="To date" style="height: 32px;">
</div>
<div class="form-group col-md-4">
<label class="font-14">Select Item</label>
<div class="form-group col-md-4 mbl-style">
<label class="font-14 mbl_lbl">Select Item</label>
<select class="form-control" name="item_code" id="item_code">
<option value="">Select Item</option>
<% @inventory_definitions.each do |item| %>
<%
<%
selected = ""
if item.item_code.to_s == params[:item_code].to_s
if item.item_code.to_s == params[:item_code].to_s
selected = "selected"
end
%>
@@ -43,7 +43,7 @@
<% end %>
</select>
</div>
<div class="form-group col-md-2 margin-top-20"><br>
<div class="form-group col-md-2 margin-top-20 mbl-right-btn mbl-style"><br>
<input type="submit" value="Generate Report" class='btn btn-primary'>
</div>
<!-- <div class="form-group col-md-2 margin-top-20">

View File

@@ -2,8 +2,8 @@
<%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %>
<% if period_type != false %>
<div class="row">
<div class="form-group col-lg-2 col-md-2 col-sm-2">
<label class="font-20"><%= t("views.right_panel.detail.select_period") %><%= t("views.right_panel.detail.select_period") %></label>
<div class="form-group col-lg-2 col-md-2 col-sm-2 mbl-style">
<label class="font-20 mbl_lbl"><%= t("views.right_panel.detail.select_period") %><%= t("views.right_panel.detail.select_period") %></label>
<select name="period" id="sel_period" class="form-control">
<option value=""><%= t("views.right_panel.detail.select_period") %></option>
<option value="0">Today</option>
@@ -19,25 +19,25 @@
</select>
</div>
<div class="form-group col-lg-2 col-md-2 col-sm-2">
<div class="form-group col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
<!-- <label class="">Select Shift Period</label> -->
<label class="font-20"><%= t("views.right_panel.detail.from") %></label>
<label class="font-20 mbl_lbl"><%= t("views.right_panel.detail.from") %></label>
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="from" id="from" type="text" placeholder="From date" style="height: 34px;">
</div>
<div class="form-group col-lg-2 col-md-2 col-sm-2">
<label class="font-20"><%= t("views.right_panel.detail.to") %></label>
<div class="form-group col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
<label class="font-20 mbl_lbl"><%= t("views.right_panel.detail.to") %></label>
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="to" id="to" type="text" placeholder="To date" style="height: 34px;">
</div>
<div class="form-group col-lg-3 col-md-3 col-sm-3">
<label class="font-20"><%= t("views.right_panel.detail.all_shift") %></label>
<div class="form-group col-lg-3 col-md-3 col-sm-3 mbl-style">
<label class="font-20 mbl_lbl"><%= t("views.right_panel.detail.all_shift") %></label>
<select class="form-control select" name="shift_name" id="shift_name" style="height: 37px;">
</select>
</div>
<div class=" col-lg-1 col-md-1 col-sm-1 margin-top-20">
<div class=" col-lg-1 col-md-1 col-sm-1 margin-top-20 mbl-right-btn mbl-style">
<br>
<input type="submit" value="Generate Report" class='btn btn-primary'>
</div>
</div>
</div>
</div>
<% end %>
<% end %>
</div>
@@ -60,7 +60,7 @@
$('#waiter').show();
if(payment_type){
$('#payment_type').hide();
}
}
}
else if(item == 'sale'){
$('#waiter').hide();
@@ -68,7 +68,7 @@
}
else{
$('#waiter').hide();
$('#cashier').show();
$('#cashier').show();
$("#item").val('sale');
}
});
@@ -105,7 +105,7 @@
if(item == 'sale'){
$('#waiter').hide();
$('#cashier').show();
$('#cashier').show();
if(payment_type){
$('#payment_type').show();
}

View File

@@ -19,12 +19,12 @@
<!-- <div class="row"> -->
<div class="col-md-12 text-right">
<a href="javascript:export_to('<%=reports_void_sale_index_path%>.xls')" class = "btn btn-info wave-effects"><%= t("views.btn.exp_to_excel") %></a>
</div>
</div>
<!-- </div> -->
<!-- </div> -->
<div class="margin-top-20">
<div class="card">
<div class="margin-top-20 mbl-table">
<div class="card mbl-table-card">
<% if @sale_data.count > 0 %>
<table class="table table-striped" border="0">
<thead>
@@ -35,19 +35,19 @@
<% end %>
<% if @shift_from %>
<tr>
<% if @shift %>
<% if @shift %>
<% cashier_name = !@shift.nil? ? @shift[0].employee.name : '-' %>
<% end %>
<% end %>
<th colspan="3"><%= t("views.right_panel.detail.shift_name") %> = <%= @shift_from rescue '-'%> - <%= @shift_to rescue '-'%> ( <%= cashier_name rescue '-'%> )</th>
</tr>
<% end %>
<% end %>
<tr>
<th><%= t("views.right_panel.detail.receipt_no") %></th>
<th><%= t("views.right_panel.detail.sale_date") %></th>
<th><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.amount") %></th>
<th><%= t("views.right_panel.detail.grand_total") %></th>
<th><%= t("views.right_panel.detail.rnd_adj_sh") %></th>
<th><%= t("views.right_panel.detail.grand_total") %> + <br/><%= t("views.right_panel.detail.rnd_adj_sh") %></th>
<th><%= t("views.right_panel.detail.grand_total") %> + <br/><%= t("views.right_panel.detail.rnd_adj_sh") %></th>
<!-- <th>Sale Status</th> -->
</tr>
</thead>
@@ -63,7 +63,7 @@
else
delimiter = ""
end
%>
%>
<% total_amount = 0.0 %>
<% grand_total = 0.0 %>
<% rounding_adjustment = 0.0 %>
@@ -76,7 +76,7 @@
<td><%= number_with_precision(item.total_amount.to_f, precision: precision.to_i ,delimiter: delimiter) %> </td>
<td><%= number_with_precision(item.grand_total.to_f , precision: precision.to_i ,delimiter: delimiter) rescue '-'%> </td>
<td><%= number_with_precision(item.rounding_adjustment.to_f, precision: precision.to_i ,delimiter: delimiter) rescue '-' %></td>
<td><%= number_with_precision(item.grand_total.to_f + item.rounding_adjustment.to_f , precision: precision.to_i ,delimiter: delimiter) rescue '-'%> </td>
<td><%= number_with_precision(item.grand_total.to_f + item.rounding_adjustment.to_f , precision: precision.to_i ,delimiter: delimiter) rescue '-'%> </td>
<!-- <td><%= result.sales_status rescue '-' %> </td> -->
<!-- <td><%= item.remarks rescue '-' %> </td> -->
</tr>
@@ -113,8 +113,8 @@
var from = "";
var to = "";
show_shift_name(period,period_type,from,to,'shift_item');
}
show_shift_name(period,period_type,from,to,'shift_item');
}
// OK button is clicked
$('#from').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
@@ -130,13 +130,13 @@
to = new_date.getDate() + "-" + month + "-" + new_date.getFullYear();
$('#to').val(to)
search_by_date();
});
});
function search_by_date(){
from = $("#from").val();
to = $("#to").val();
var period = 0;
var period_type = 1;
var period_type = 1;
if(to != '' && from != ''){
shift_name = from + ',' + to;
@@ -145,7 +145,7 @@
console.log(check_arr.length)
if(check_arr.length == 1){
show_shift_name(period,period_type,from,to,'shift_item');
show_shift_name(period,period_type,from,to,'shift_item');
}
if(check_arr.length == 3){
check_arr = [];
@@ -163,7 +163,7 @@
shift.empty();
var str = '';
var param_shift = '';
var param_shift = '';
var param_shift = '<%= params[:shift_name] rescue '-'%>';
url = '<%= reports_get_shift_by_date_path %>';
@@ -171,7 +171,7 @@
$.get(url, {period :period, period_type :period_type, from :from, to :to, report_type :shift_item} , function(data){
str = '<option value="0">--- All Shift ---</option>';
$(data.message).each(function(index){
$(data.message).each(function(index){
var local_date = data.message[index].local_opening_date + ' - ' + data.message[index].local_closing_date;
var sh_date = data.message[index].opening_date + ' - ' + data.message[index].closing_date;
@@ -181,18 +181,18 @@
selected = 'selected = "selected"';
}
else{
selected = '';
}
selected = '';
}
}else{
selected = '';
}
selected = '';
}
str += '<option value="'+ shift_id +'" '+ selected +'>' + local_date + '</option>';
// console.log(sh_date)
})
})
shift.append(str);
});
}
});
</script>
</script>

View File

@@ -7,6 +7,13 @@
</span>
</ol>
</div>
<style>
@media screen and (max-width: 785px) {
section.content{
margin: 80px 5px 0 5px !important;
}
}
</style>
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div class="main-box-body clearfix p-l-5 p-r-5">
@@ -17,20 +24,20 @@
<td colspan="8">
<%= form_tag transactions_bookings_path, :method => :get do %>
<div class="row clearfix">
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4">
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 mbl-style">
<label><%= t("views.right_panel.detail.enter_keyboards") %></label>
<input type="text" id="receipt_no" name="receipt_no" class="form-control" placeholder="Booking/ Sale ID/ Table/ Room" style="margin-right: 10px">
</div>
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
<label class=""><%= t("views.right_panel.detail.from") %></label>
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 col-mbl-view mbl-style">
<label class="mbl_lbl"><%= t("views.right_panel.detail.from") %></label>
<input class="form-control datepicker" name="from" id="from" type="text" placeholder="From date">
</div>
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
<label class=""><%= t("views.right_panel.detail.to") %></label>
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 col-mbl-view mbl-style">
<label class="mbl_lbl"><%= t("views.right_panel.detail.to") %></label>
<input class="form-control datepicker" name="to" id="to" type="text" placeholder="To date">
</div>
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1">
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 mbl-right-btn mbl-style">
<label></label>
<br><input type="submit" value="Search" class='btn btn-primary btn-md'>
</div>
@@ -96,7 +103,3 @@
});
</script>

View File

@@ -23,7 +23,7 @@
<a class="nav-link" data-toggle="tab" href="#sale" role="tab"><%= t :sale_details %></a>
</li>
</ul>
<!-- Nav tabs - End -->
<div class="tab-content" style="min-height:670px; max-height:670px;">
<div class="tab-pane active" id="booking" role="tabpanel">
@@ -78,7 +78,7 @@
</table>
</div>
</div>
<div class="tab-pane" id="order" role="tabpanel">
<div class="table-responsive">
<table class="table table-striped">
@@ -167,7 +167,7 @@
if(order_id!=undefined && order_id!=null && order_id!=""){
if($('#request_bill').is(":visible")) {
$('#request_bill').prop("disabled",true);
}
}
$.ajax({
type: "GET",
url: ajax_url,
@@ -176,11 +176,11 @@
$('#request_bill').prop("disabled",false);
swal("Information!", result.error_message);
}
else {
else {
location.reload();
}
}
});
});
}else{
swal("Opps","There is no orders!","warning");
}
@@ -198,10 +198,10 @@
$('#change_booking_status').prop("disabled",false);
swal("Opps",result.error_message,"warning");
}
else {
else {
swal({
title: "Information",
text: result.message,
title: "Information",
text: result.message,
type: "success",
html: true,
closeOnConfirm: false,
@@ -213,8 +213,6 @@
});
}
}
});
});
});
</script>

View File

@@ -7,6 +7,13 @@
</span>
</ol>
</div>
<style>
@media screen and (max-width: 785px) {
section.content{
margin: 80px 5px 0 5px !important;
}
}
</style>
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div class="main-box-body clearfix p-l-5 p-r-5">
@@ -17,40 +24,40 @@
<td colspan="8">
<%= form_tag transactions_card_sale_trans_path, :method => :get do %>
<div class="row clearfix">
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 mbl-style">
<label><%= t("views.right_panel.detail.enter_keyboards") %></label>
<input type="text" id="sale_id" name="sale_id" class="form-control" placeholder="Sale ID/ Customer Name/ Cashier Name" style="margin-right: 10px;height: 34px;">
</div>
<% if defined? @payment_method %>
<div class="col-lg-2 col-md-2 col-sm-2">
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
<label class="font-14"><%= t("views.right_panel.detail.select_payments") %></label>
<%= select_tag "payment_type", options_for_select(@payment_method, :selected => params[:payment_type]), :class => "form-control" %>
<%= select_tag "payment_type", options_for_select(@payment_method, :selected => params[:payment_type]), :class => "form-control" %>
</div>
<% end %>
<% if not defined? status %>
<div class="col-lg-2 col-md-2 col-sm-2">
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
<label class="font-14"><%= t("views.right_panel.detail.select_status") %></label>
<select name="status_type" id="status_type" class="form-control">
<% @status.each do |pm| %>
<option class="<%=pm[1].downcase%>" value="<%=pm[1].downcase%>"><%=pm[0]%></option>
<%end %>
</select>
</div>
</div>
<% end %>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
<label class=""><%= t("views.right_panel.detail.from") %></label>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 col-mbl-view mbl-style">
<label class="mbl_lbl"><%= t("views.right_panel.detail.from") %></label>
<input class="form-control datepicker" name="from" id="from" type="text" placeholder="From date" style="height: 34px;">
</div>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
<label class=""><%= t("views.right_panel.detail.to") %></label>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 col-mbl-view mbl-style">
<label class="mbl_lbl"><%= t("views.right_panel.detail.to") %></label>
<input class="form-control datepicker" name="to" id="to" type="text" placeholder="To date" style="height: 34px;">
</div>
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1">
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 mbl-right-btn mbl-style">
<label></label>
<br><input type="submit" value="Search" class='btn btn-primary btn-md'>
</div>
@@ -58,12 +65,12 @@
<% end %>
</td>
</tr>
</tbody>
</table>
</div>
<div class="card" style="width:122%;">
<div class="table-responsive">
@@ -102,7 +109,7 @@
UnionPay
<% else %>
<%= cardSale.app %>
<% end %>
<% end %>
</td>
<td><%= cardSale.sale.customer.name rescue '-' %></td>
<td><%= cardSale.sale.cashier_name rescue '-' %></td>
@@ -111,18 +118,18 @@
TID : <%= cardSale.terminal_id %>
<br>
<% end %>
<% if cardSale.merchant_id != '' %>
<% if cardSale.merchant_id != '' %>
MID : <%= cardSale.merchant_id %>
<br>
<% end %>
<% if cardSale.batch_no != '' %>
<% if cardSale.batch_no != '' %>
Batch : <%= cardSale.batch_no %>
<br>
<% end %>
<% if cardSale.trace != '' %>
<% if cardSale.trace != '' %>
Trace : <%= cardSale.trace %>
<% end %>
</td>
<% end %>
</td>
<td><%= cardSale.status %></td>
</tr>
<% end %>
@@ -150,24 +157,24 @@
$('#status_type').val("<%= params[:status_type] %>");
$('#sale_id').val("<%= params[:sale_id] %>");
$('#sel_period').val("<%= params[:period] %>");
var check_arr = [];
search_by_period();
$('#sel_period').change(function(){
search_by_period();
});
function search_by_period(){
var period = $('#sel_period').val();
var period_type = 0;
var from = "";
var to = "";
show_shift_name(period,period_type,from,to,'shift_item');
}
show_shift_name(period,period_type,from,to,'shift_item');
}
// OK button is clicked
$('#from').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
new_date = new Date(date) ;
@@ -182,32 +189,32 @@
to = new_date.getDate() + "-" + month + "-" + new_date.getFullYear();
$('#to').val(to);
search_by_date();
});
});
function search_by_date(){
from = $("#from").val();
to = $("#to").val();
to = $("#to").val();
var period = 0;
var period_type = 1;
var period_type = 1;
if(to != '' && from != ''){
shift_name = from + ',' + to;
check_arr.push(to);
console.log(check_arr.length)
if(check_arr.length == 1){
show_shift_name(period,period_type,from,to,'shift_item');
show_shift_name(period,period_type,from,to,'shift_item');
}
if(check_arr.length == 3){
check_arr = [];
}
}
}
function show_shift_name(period,period_type,from,to,shift_item){
var shift = $('#shift_name');
if (from == '' && to == '') {
@@ -215,18 +222,18 @@
to = $("#to").val();
}
shift.empty();
var str = '';
var param_shift = '';
var param_shift = '';
var param_shift = '<%= params[:shift_name] rescue '-'%>';
url = '<%= reports_get_shift_by_date_path %>';
$.get(url, {period :period, period_type :period_type, from :from, to :to, report_type :shift_item} , function(data){
str = '<option value="0">--- All Shift ---</option>';
$(data.message).each(function(index){
$(data.message).each(function(index){
var local_date = data.message[index].local_opening_date + ' - ' + data.message[index].local_closing_date;
var sh_date = data.message[index].opening_date + ' - ' + data.message[index].closing_date;
var shift_id = data.message[index].shift_id ;
@@ -235,18 +242,18 @@
selected = 'selected = "selected"';
}
else{
selected = '';
}
selected = '';
}
}else{
selected = '';
}
selected = '';
}
str += '<option value="'+ shift_id +'" '+ selected +'>' + local_date + '</option>';
// console.log(sh_date)
})
})
shift.append(str);
});
}
});
</script>
</script>

View File

@@ -7,6 +7,13 @@
</span>
</ol>
</div>
<style>
@media screen and (max-width: 785px) {
section.content{
margin: 80px 5px 0 5px !important;
}
}
</style>
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div class="main-box-body clearfix p-l-5 p-r-5">
@@ -17,40 +24,40 @@
<td colspan="8">
<%= form_tag transactions_card_settle_trans_path, :method => :get do %>
<div class="row clearfix">
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 mbl-style">
<label><%= t("views.right_panel.detail.enter_keyboards") %></label>
<input type="text" id="cashier_name" name="cashier_name" class="form-control" placeholder="Cashier Name" style="margin-right: 10px;height: 34px;">
</div>
<% if defined? @payment_method %>
<div class="col-lg-2 col-md-2 col-sm-2">
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
<label class="font-14"><%= t("views.right_panel.detail.select_payments") %></label>
<%= select_tag "payment_type", options_for_select(@payment_method, :selected => params[:payment_type]), :class => "form-control" %>
<%= select_tag "payment_type", options_for_select(@payment_method, :selected => params[:payment_type]), :class => "form-control" %>
</div>
<% end %>
<% if not defined? status %>
<div class="col-lg-2 col-md-2 col-sm-2">
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
<label class="font-14"><%= t("views.right_panel.detail.select_status") %></label>
<select name="status_type" id="status_type" class="form-control">
<% @status.each do |pm| %>
<option class="<%=pm[1].downcase%>" value="<%=pm[1].downcase%>"><%=pm[0]%></option>
<%end %>
</select>
</div>
</div>
<% end %>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
<label class=""><%= t("views.right_panel.detail.from") %></label>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 col-mbl-view mbl-style">
<label class="mbl_lbl"><%= t("views.right_panel.detail.from") %></label>
<input class="form-control datepicker" name="from" id="from" type="text" placeholder="From date" style="height: 34px;">
</div>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
<label class=""><%= t("views.right_panel.detail.to") %></label>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 col-mbl-view mbl-style">
<label class="mbl_lbl"><%= t("views.right_panel.detail.to") %></label>
<input class="form-control datepicker" name="to" id="to" type="text" placeholder="To date" style="height: 34px;">
</div>
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1">
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 mbl-right-btn mbl-style">
<label></label>
<br><input type="submit" value="Search" class='btn btn-primary btn-md'>
</div>
@@ -58,14 +65,14 @@
<% end %>
</td>
</tr>
</tbody>
</table>
</div>
<div class="card" style="width:112%;">
<div class="card">
<div class="table-responsive">
<table class="table table-striped">
<thead>
@@ -128,20 +135,20 @@
var check_arr = [];
search_by_period();
$('#sel_period').change(function(){
search_by_period();
});
function search_by_period(){
var period = $('#sel_period').val();
var period_type = 0;
var from = "";
var to = "";
show_shift_name(period,period_type,from,to,'shift_item');
}
show_shift_name(period,period_type,from,to,'shift_item');
}
// OK button is clicked
$('#from').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
new_date = new Date(date) ;
@@ -156,50 +163,50 @@
to = new_date.getDate() + "-" + month + "-" + new_date.getFullYear();
$('#to').val(to)
search_by_date();
});
});
function search_by_date(){
from = $("#from").val();
to = $("#to").val();
var period = 0;
var period_type = 1;
var period_type = 1;
if(to != '' && from != ''){
shift_name = from + ',' + to;
check_arr.push(to);
if(check_arr.length == 1){
show_shift_name(period,period_type,from,to,'shift_item');
show_shift_name(period,period_type,from,to,'shift_item');
}
if(check_arr.length == 3){
check_arr = [];
}
}
}
function show_shift_name(period,period_type,from,to,shift_item){
var shift = $('#shift_name');
shift.empty();
var str = '';
var param_shift = '';
var param_shift = '';
var param_shift = '<%= params[:shift_name] rescue '-'%>';
if (from == '' && to == '') {
from = $("#from").val();
to = $("#to").val();
}
url = '<%= reports_get_shift_by_date_path %>';
$.get(url, {period :period, period_type :period_type, from :from, to :to, report_type :shift_item} , function(data){
str = '<option value="0">--- All Shift ---</option>';
$(data.message).each(function(index){
$(data.message).each(function(index){
var local_date = data.message[index].local_opening_date + ' - ' + data.message[index].local_closing_date;
var sh_date = data.message[index].opening_date + ' - ' + data.message[index].closing_date;
var shift_id = data.message[index].shift_id ;
@@ -208,19 +215,19 @@
selected = 'selected = "selected"';
}
else{
selected = '';
}
selected = '';
}
}else{
selected = '';
}
selected = '';
}
str += '<option value="'+ shift_id +'" '+ selected +'>' + local_date + '</option>';
// console.log(sh_date)
})
})
shift.append(str);
});
}
});
</script>
</script>

View File

@@ -5,7 +5,7 @@
<li class="active">
<a href="<%= transactions_credit_notes_path %>">Credit Note</a>
</li>
</ol>
</div>
</div> -->
@@ -18,6 +18,13 @@
</span>
</ol>
</div>
<style>
@media screen and (max-width: 785px) {
section.content{
margin: 80px 5px 0 5px !important;
}
}
</style>
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div class="main-box-body clearfix p-l-5 p-r-5">
@@ -28,11 +35,11 @@
<td colspan="">
<%= form_tag transactions_credit_notes_path, :method => :get do %>
<div class="row clearfix">
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 mbl-style">
<label class="font-14"><%= t("views.right_panel.detail.enter_keyboards") %></label>
<input type="text" name="receipt_no" class="form-control m-t-3" placeholder="Receipt No/Cashier Name/Status" style="margin-right: 10px">
</div>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 col-mbl-view mbl-style">
<label class="font-14"><%= t("views.right_panel.detail.select_customer") %></label>
<select class="selectpicker form-control col-md-12" name="customer">
<option value=""><%= t("views.right_panel.detail.select_customer") %></option>
@@ -40,22 +47,22 @@
<option value="<%= customer.customer_id %>">
<%= customer.name %></option>
<%end %>
</select>
</select>
</div>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 col-mbl-view mbl-style">
<label class="font-14"><%= t("views.right_panel.detail.order_source") %></label>
<%= select_tag "order_source", options_for_select(@sources, :selected => params[:order_source]), :class => "form-control" %>
<%= select_tag "order_source", options_for_select(@sources, :selected => params[:order_source]), :class => "form-control" %>
</div>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
<label class="font-14"><%= t("views.right_panel.detail.from") %></label>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 col-mbl-view mbl-style">
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.from") %></label>
<input class="form-control datepicker m-t-3" name="from" id="date" type="text" placeholder="From date">
</div>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
<label class="font-14"><%= t("views.right_panel.detail.to") %></label>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 col-mbl-view mbl-style">
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.to") %></label>
<input class="form-control datepicker m-t-3" name="to" id="date" type="text" placeholder="To date">
</div>
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1">
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 mbl-right-btn mbl-style">
<label class="font-14"> &nbsp;</label><br>
<input type="submit" value="Search" class='btn btn-primary btn-md'>
</div>
@@ -63,10 +70,10 @@
<% end %>
</td>
</tr>
</tbody>
</table>
</div>
<div class="card">
@@ -109,14 +116,14 @@
</td>
<td><%= sale.cashier_name rescue '-' %></td>
<td><%= link_to sale.customer.name, crm_customer_path(sale.customer_id) %></td>
<td>
<td>
<%if sale.source == "cashier" || sale.source == "emenu" %>
Cashier
<% elsif sale.source == "quick_service" %>
Quick Service
<% else %>
Online Order
<% end %>
<% end %>
</td>
<td> <%= sale.receipt_date.strftime("%d-%m-%Y %I:%M %p") %> </td>
</tr>
@@ -152,7 +159,7 @@
}
// console.log(arr_sale);
});
$(".credit_payment").on('click', function(){
$.ajax({
type: 'POST',
@@ -194,8 +201,3 @@
return arr_item;
}
</script>

View File

@@ -7,6 +7,13 @@
</span>
</ol>
</div>
<style>
@media screen and (max-width: 785px) {
section.content{
margin: 80px 5px 0 5px !important;
}
}
</style>
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div class="main-box-body clearfix p-l-5 p-r-5">
@@ -17,13 +24,13 @@
<td colspan="14">
<%= form_tag transactions_order_reservations_path, :method => :get do %>
<div class="row clearfix">
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 mbl-style">
<label><%= t("views.right_panel.detail.enter_keyboards") %></label>
<input type="text" id="filter" name="filter" class="form-control" placeholder="Status/Payment Type" style="margin-right: 10px;height: 34px;">
</div>
<div class="col-lg-2 col-md-2 col-sm-2">
<label class="font-14"><%= t("views.right_panel.detail.select_period") %></label>
<div class="col-lg-2 col-md-2 col-sm-2 mbl-style">
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.select_period") %></label>
<select name="period" id="sel_period" class="form-control">
<option value=""><%= t("views.right_panel.detail.select_period") %></option>
<option value="0">Today</option>
@@ -39,16 +46,16 @@
</select>
</div>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
<label class=""><%= t("views.right_panel.detail.from") %></label>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 col-mbl-view mbl-style">
<label class="mbl_lbl"><%= t("views.right_panel.detail.from") %></label>
<input class="form-control datepicker" name="from" id="from" type="text" placeholder="From date" style="height: 34px;">
</div>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
<label class=""><%= t("views.right_panel.detail.to") %></label>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 col-mbl-view mbl-style">
<label class="mbl_lbl"><%= t("views.right_panel.detail.to") %></label>
<input class="form-control datepicker" name="to" id="to" type="text" placeholder="To date" style="height: 34px;">
</div>
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1">
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 mbl-right-btn mbl-style">
<label></label>
<br><input type="submit" value="Search" class='btn btn-primary btn-md'>
</div>
@@ -56,18 +63,18 @@
<% end %>
</td>
</tr>
</tbody>
</table>
</div>
<div class="card">
<div class="table-responsive">
<table class="table table-bordered table-striped table-hover">
<thead>
<tr>
<th><%= t("views.right_panel.detail.order_reservation_id") %></th>
<th><%= t("views.right_panel.detail.sale_id") %></th>
@@ -112,8 +119,8 @@
%>
<% if @order_reservations != 0 %>
<% @order_reservations.each do |order_reservation| %>
<%
provider = ""
<%
provider = ""
discount_amount = order_reservation.discount_amount
delivery_fee = order_reservation.delivery_fee ? order_reservation.delivery_fee : 0.0
convenience_charge = order_reservation.convenience_charge
@@ -187,4 +194,4 @@
$('#sel_period').val("<%= params[:period] %>");
$('#filter').val("<%= params[:filter] %>");
});
</script>
</script>

View File

@@ -8,12 +8,19 @@
</span>
</ol>
</div>
<style>
@media screen and (max-width: 785px) {
section.content{
margin: 80px 5px 0 5px !important;
}
}
</style>
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div class="main-box-body clearfix p-l-15 p-r-15">
<%= form_tag transactions_orders_path, :method => :get do %>
<div class="row clearfix">
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 mbl-style">
<label class="form-control-label"><%= t("views.right_panel.button.search_keyboard") %></label>
<input type="text" id="receipt_no" name="filter" placeholder="Order ID" class="form-control input-md" >
</div>
@@ -24,31 +31,31 @@
<span class="highlight"></span>
<output id="rangevalue">0</output>
</div>
</div> -->
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
<label class="form-control-label"><%= t("views.right_panel.detail.from") %></label>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 col-mbl-view mbl-style">
<label class="form-control-label mbl_lbl"><%= t("views.right_panel.detail.from") %></label>
<input class="form-control datepicker" name="from" id="from" type="text" placeholder="From date">
</div>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
<label class="form-control-label"><%= t("views.right_panel.detail.to") %></label>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 col-mbl-view mbl-style">
<label class="form-control-label mbl_lbl"><%= t("views.right_panel.detail.to") %></label>
<input class="form-control datepicker" name="to" id="to" type="text" placeholder="To date">
</div>
<div class="form-group col-lg-1 col-md-1 col-sm-1 col-xs-1">
<div class="form-group col-lg-1 col-md-1 col-sm-1 col-xs-1 mbl-right-btn mbl-style">
<label > &nbsp;</label>
<br> <input type="submit" value="Search" class='btn btn-primary btn-md'>
</div>
</div>
</div>
</div>
<% end %>
<div class="card">
<div class="table-responsive">
<table class="table ">
<thead>
<tr>
<th><%= t("views.right_panel.detail.order_id") %></th>
<th><%= t :table %>/<%= t :room %></th>
<th><%= t("views.right_panel.detail.order_by") %></th>
<th><%= t("views.right_panel.detail.type") %></th>
@@ -60,7 +67,7 @@
</thead>
<tbody>
<% @orders.each do |order|
<% @orders.each do |order|
@dining = BookingOrder.find_by_order_id(order.order_id).booking.dining_facility
%>
@@ -73,13 +80,13 @@
<td><%= order.status %></td>
<td> <%= order.date.utc.getlocal.strftime("%d-%m-%Y %I:%M %p") %> </td>
<td> <%= order.item_count %> </td>
</tr>
<% end %>
</tbody>
</table>
<br>
<%if !@orders.nil?%>
<%= paginate @orders %>
<%end%>

View File

@@ -7,6 +7,13 @@
</span>
</ol>
</div>
<style>
@media screen and (max-width: 785px) {
section.content{
margin: 80px 5px 0 5px !important;
}
}
</style>
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div class="main-box-body clearfix p-l-5 p-r-5">
@@ -17,13 +24,13 @@
<td colspan="8">
<%= form_tag transactions_sales_path, :method => :get do %>
<div class="row clearfix">
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 mbl-style">
<label><%= t("views.right_panel.detail.enter_keyboards") %></label>
<input type="text" id="receipt_no" name="receipt_no" class="form-control" placeholder="Receipt No/Cashier Name/Status" style="margin-right: 10px;height: 34px;">
</div>
<div class="col-lg-2 col-md-2 col-sm-2">
<label class="font-14"><%= t("views.right_panel.detail.select_period") %></label>
<div class="col-lg-2 col-md-2 col-sm-2 mbl-style">
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.select_period") %></label>
<select name="period" id="sel_period" class="form-control">
<option value=""><%= t("views.right_panel.detail.select_period") %></option>
<option value="0">Today</option>
@@ -39,22 +46,22 @@
</select>
</div>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
<label class=""><%= t("views.right_panel.detail.from") %></label>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 col-mbl-view mbl-style">
<label class="mbl_lbl"><%= t("views.right_panel.detail.from") %></label>
<input class="form-control datepicker" name="from" id="from" type="text" placeholder="From date" style="height: 34px;">
</div>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
<label class=""><%= t("views.right_panel.detail.to") %></label>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 col-mbl-view mbl-style">
<label class="mbl_lbl"><%= t("views.right_panel.detail.to") %></label>
<input class="form-control datepicker" name="to" id="to" type="text" placeholder="To date" style="height: 34px;">
</div>
<div class="col-lg-2 col-md-2 col-sm-2">
<label class="font-14"><%= t("views.right_panel.detail.all_shift") %></label>
<div class="col-lg-2 col-md-2 col-sm-2 mbl-style">
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.all_shift") %></label>
<select class="form-control select" name="shift_name" id="shift_name" >
</select>
</div>
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1">
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 mbl-right-btn mbl-style">
<label></label>
<br><input type="submit" value="Search" class='btn btn-primary btn-md'>
</div>
@@ -62,18 +69,18 @@
<% end %>
</td>
</tr>
</tbody>
</table>
</div>
<div class="card">
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th><%= t("views.right_panel.detail.sale_id") %></th>
<th><%= t("views.right_panel.detail.receipt_no") %></th>
@@ -144,24 +151,24 @@
$('#from').val("<%= params[:from] %>");
$('#to').val("<%= params[:to] %>");
$('#sel_period').val("<%= params[:period] %>");
var check_arr = [];
search_by_period();
$('#sel_period').change(function(){
search_by_period();
});
function search_by_period(){
var period = $('#sel_period').val();
var period_type = 0;
var from = "";
var to = "";
show_shift_name(period,period_type,from,to,'shift_item');
}
show_shift_name(period,period_type,from,to,'shift_item');
}
// OK button is clicked
$('#from').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
new_date = new Date(date) ;
@@ -176,32 +183,32 @@
to = new_date.getDate() + "-" + month + "-" + new_date.getFullYear();
$('#to').val(to);
search_by_date();
});
});
function search_by_date(){
from = $("#from").val();
to = $("#to").val();
to = $("#to").val();
var period = 0;
var period_type = 1;
var period_type = 1;
if(to != '' && from != ''){
shift_name = from + ',' + to;
check_arr.push(to);
console.log(check_arr.length)
if(check_arr.length == 1){
show_shift_name(period,period_type,from,to,'shift_item');
show_shift_name(period,period_type,from,to,'shift_item');
}
if(check_arr.length == 3){
check_arr = [];
}
}
}
function show_shift_name(period,period_type,from,to,shift_item){
var shift = $('#shift_name');
if (from == '' && to == '') {
@@ -209,18 +216,18 @@
to = $("#to").val();
}
shift.empty();
var str = '';
var param_shift = '';
var param_shift = '';
var param_shift = '<%= params[:shift_name] rescue '-'%>';
url = '<%= reports_get_shift_by_date_path %>';
$.get(url, {period :period, period_type :period_type, from :from, to :to, report_type :shift_item} , function(data){
str = '<option value="0">--- All Shift ---</option>';
$(data.message).each(function(index){
$(data.message).each(function(index){
var local_date = data.message[index].local_opening_date + ' - ' + data.message[index].local_closing_date;
var sh_date = data.message[index].opening_date + ' - ' + data.message[index].closing_date;
var shift_id = data.message[index].shift_id ;
@@ -229,18 +236,18 @@
selected = 'selected = "selected"';
}
else{
selected = '';
}
selected = '';
}
}else{
selected = '';
}
selected = '';
}
str += '<option value="'+ shift_id +'" '+ selected +'>' + local_date + '</option>';
// console.log(sh_date)
})
})
shift.append(str);
});
}
});
</script>
</script>

View File

@@ -7,6 +7,13 @@
</span>
</ol>
</div>
<style>
@media screen and (max-width: 785px) {
section.content{
margin: 80px 5px 0 5px !important;
}
}
</style>
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div class="main-box-body clearfix p-l-5 p-r-5">
@@ -21,7 +28,7 @@
<label><%= t("views.right_panel.detail.enter_keyboards") %></label>
<input type="text" name="receipt_no" class="form-control" placeholder="" style="margin-right: 10px">
</div>
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
<label class=""><%= t("views.right_panel.detail.from") %></label>
<input class="form-control datepicker" name="from" id="from date" type="text" placeholder="From date">
</div>
@@ -29,7 +36,7 @@
<label class=""><%= t("views.right_panel.detail.to") %></label>
<input class="form-control datepicker" name="to" id="to date" type="text" placeholder="To date">
</div>
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1">
<label></label>
<br><input type="submit" value="Search" class='btn btn-primary btn-md'>
@@ -107,6 +114,3 @@
});
</script>

View File

@@ -1,25 +1,25 @@
<%= form_tag transactions_surveys_path, :method => :get, :id=>"frm_report", :class => "form" do %>
<div class="row clearfix">
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 mbl-style">
<label class="form-control-label"><%= t("views.right_panel.button.search_keyboard") %></label>
<input type="text" id="dining_name" name="filter" placeholder="Dining Name" class="form-control input-md" >
</div>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
<label class="form-control-label"><%= t("views.right_panel.detail.from") %></label>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 col-mbl-view mbl-style">
<label class="form-control-label mbl_lbl"><%= t("views.right_panel.detail.from") %></label>
<input class="form-control datepicker" name="from" id="from" type="text" placeholder="From date">
</div>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
<label class="form-control-label"><%= t("views.right_panel.detail.to") %></label>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 col-mbl-view mbl-style">
<label class="form-control-label mbl_lbl"><%= t("views.right_panel.detail.to") %></label>
<input class="form-control datepicker" name="to" id="to" type="text" placeholder="To date">
</div>
<div class="form-group col-lg-1 col-md-1 col-sm-1 col-xs-1">
<div class="form-group col-lg-1 col-md-1 col-sm-1 col-xs-1 mbl-right-btn mbl-style">
<label > &nbsp;</label>
<br> <input type="submit" value="Search" class='btn btn-primary btn-md'>
</div>
</div>
</div>
</div>
<% end %>
<script type="text/javascript">
$(function(){
@@ -38,4 +38,4 @@ $("#dining_name").val("<%=params[:filter]%>");
$("#from").val("<%=params[:from]%>");
$("#to").val("<%=params[:to]%>");
</script>
</script>

View File

@@ -7,6 +7,13 @@
</span>
</ol>
</div>
<style>
@media screen and (max-width: 785px) {
section.content{
margin: 80px 5px 0 5px !important;
}
}
</style>
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div class="main-box-body clearfix p-l-15 p-r-15">
@@ -67,8 +74,8 @@
<% foreigner_lists = foreign.split(",") %>
<% if !foreigner_lists.empty? %>
<% foreigner_lists.each do |fgn| %>
<% unless fgn.match(/[^[:digit:]]+/)
total_foreigner = total_foreigner.to_i + fgn.to_i
<% unless fgn.match(/[^[:digit:]]+/)
total_foreigner = total_foreigner.to_i + fgn.to_i
end %>
<% if !fgn.scan(/\D/).empty? %>
<%= fgn %> :<% end %> <%= fgn.to_i unless fgn.match(/[^[:digit:]]+/) %><br>
@@ -104,4 +111,4 @@
$("#from").val("<%=params[:from] rescue '-'%>");
$("#to").val("<%=params[:to] rescue '-'%>");
});
</script>
</script>