Merge branch 'r-1902001-01' of gitlab.com:code2lab/SXRestaurant into r-1902001-01

This commit is contained in:
Myat Zin Wai Maw
2019-05-30 10:06:29 +06:30
25 changed files with 726 additions and 370 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 376 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 819 B

View File

@@ -69,11 +69,11 @@
z-index: 1100;
}
#sxModal-Content {
#sxModal-Content {
position: relative;
left: 42%;
top: 30%;
background-color: #32ad1a;
background-color: #32ad1a;
color: #fff;
text-align: center;
width: 200px;
@@ -92,7 +92,7 @@
#videoElement {
width: 480px;
height: 375px;
}
.cashier_number{
@@ -243,7 +243,7 @@ i.logout_icon{
span.round-tab:hover{
color: white;
border: 1px solid #fff;
background-color:#2196F3;
background-color:#2196F3;
}
.wizard .nav-tabs > li {
width: 25%;
@@ -268,4 +268,55 @@ i.logout_icon{
font-size: 14px;
color: #FFFFFF;
}
/*customer modal UI */
/*customer modal UI */
@media screen and (max-width: 785px) {
section.content{
margin: 80px 15px 0 225px;
}
.mbl_view{
display: none;
}
.navbar-brand-txt{
margin-top: -15px;
}
.toggle_mbl {
text-align: right;
}
.toggle_mbl img{
width: 24px;
margin-bottom: 14px;
}
.toggle_mbl a:hover, a:focus{
background-color: unset;
}
.col-mbl-view{
width: 50%;
}
.info-box .icon{
display: none;
}
.mbl_product_div{
display: none;
}
.sidebar .menu{
top: 10px;
}
.page-header{
width: 100%;
}
.ls-closed .bars:after, .ls-closed .bars:before{
top: 14px;
}
}

View File

@@ -120,4 +120,55 @@ i.logout_icon{
.table-width{
width: 100%;
}
}
@media screen and (max-width: 785px) {
section.content{
margin: 80px 15px 0 225px;
}
.mbl_view{
display: none;
}
.navbar-brand-txt{
margin-top: -15px;
}
.toggle_mbl {
text-align: right;
}
.toggle_mbl img{
width: 24px;
margin-bottom: 14px;
}
.toggle_mbl a:hover, a:focus{
background-color: unset;
}
.col-mbl-view{
width: 50%;
}
.info-box .icon{
display: none;
}
.mbl_product_div{
display: none;
}
.sidebar .menu{
top: 10px;
}
.page-header{
width: 100%;
}
.ls-closed .bars:after, .ls-closed .bars:before{
top: 14px;
}
}

View File

@@ -119,9 +119,65 @@ i.logout_icon{
margin-right: 15px;
color:#fff !important;
# background-color: green !important;
}
}
.payment-btn-box {
width: 130px;
width: 130px;
height: 50px;
}
}
@media screen and (max-width: 785px) {
#setting{ display: none;}
.menu-up{ display: none;}
}
@media screen and (max-width: 785px) {
section.content{
margin: 80px 15px 0 225px;
}
.mbl_view{
display: none;
}
.navbar-brand-txt{
margin-top: -15px;
}
.toggle_mbl {
text-align: right;
}
.toggle_mbl img{
width: 24px;
margin-bottom: 14px;
}
.toggle_mbl a:hover, a:focus{
background-color: unset;
}
.col-mbl-view{
width: 50%;
}
.info-box .icon{
display: none;
}
.mbl_product_div{
display: none;
}
.sidebar .menu{
top: 10px;
}
.page-header{
width: 100%;
}
.ls-closed .bars:after, .ls-closed .bars:before{
top: 14px;
}
}

View File

@@ -279,4 +279,55 @@ tr.discount-item-row:hover {
i.logout_icon{
position: relative;
top: 5px;
}
}
@media screen and (max-width: 785px) {
section.content{
margin: 80px 15px 0 225px;
}
.mbl_view{
display: none;
}
.navbar-brand-txt{
margin-top: -15px;
}
.toggle_mbl {
text-align: right;
}
.toggle_mbl img{
width: 24px;
margin-bottom: 14px;
}
.toggle_mbl a:hover, a:focus{
background-color: unset;
}
.col-mbl-view{
width: 50%;
}
.info-box .icon{
display: none;
}
.mbl_product_div{
display: none;
}
.sidebar .menu{
top: 10px;
}
.page-header{
width: 100%;
}
.ls-closed .bars:after, .ls-closed .bars:before{
top: 14px;
}
}

View File

@@ -22,7 +22,7 @@
display: block;
width: 100%;
text-align: center;
color: #000;
color: #000;
margin-top: -5px;
}
@@ -117,4 +117,10 @@
.box {
margin : 0 -60px 0 -60px;
}
}
@media screen and (max-width: 785px) {
.login_pwd{width: 90%;}
.login_ent{width: 10%;}
}

View File

@@ -62,8 +62,8 @@ select.form-control {
/*
.order-info {
min-height:300px;
max-height:500px;
min-height:300px;
max-height:500px;
overflow:auto
}
*/
@@ -222,7 +222,7 @@ select.form-control {
margin-right: 15px;
color:#fff !important;
# background-color: green !important;
}
}
/* Reciept Style */
#order-charges-table td {
@@ -336,11 +336,11 @@ tr.discount-item-row:hover {
z-index: 1100;
}
#sxModal-Content {
#sxModal-Content {
position: relative;
left: 42%;
top: 30%;
background-color: #32ad1a;
background-color: #32ad1a;
color: #fff;
text-align: center;
width: 200px;
@@ -373,7 +373,7 @@ tr.discount-item-row:hover {
opacity: 1;
filter: alpha(opacity=100); /* ie */
-moz-opacity: 1; /* mozilla */
}
/* For Payment Page */
@@ -465,7 +465,7 @@ iframe {
}
.tax-btn-box {
width: 230px;
width: 230px;
height: 80px;
}
@@ -518,12 +518,12 @@ nav.pagination .page a:hover,
opacity: 1;
z-index: 101;
filter: alpha(opacity=100); /* ie */
-moz-opacity: 1; /* mozilla */
-moz-opacity: 1; /* mozilla */
}
.existing_invoice{
background-color:#ffab51;
color:#fff;
}
@@ -628,7 +628,7 @@ nav.pagination .page a:hover,
span.round-tab:hover{
color: white;
border: 1px solid #fff;
background-color:#2196F3;
background-color:#2196F3;
}
.wizard .nav-tabs > li {
width: 25%;
@@ -656,6 +656,57 @@ nav.pagination .page a:hover,
/*customer modal UI */
.payment-btn-box {
width: 130px;
width: 130px;
height: 50px;
}
}
@media screen and (max-width: 785px) {
section.content{
margin: 80px 15px 0 225px;
}
.mbl_view{
display: none;
}
.navbar-brand-txt{
margin-top: -15px;
}
.toggle_mbl {
text-align: right;
}
.toggle_mbl img{
width: 24px;
margin-bottom: 14px;
}
.toggle_mbl a:hover, a:focus{
background-color: unset;
}
.col-mbl-view{
width: 50%;
}
.info-box .icon{
display: none;
}
.mbl_product_div{
display: none;
}
.sidebar .menu{
top: 10px;
}
.page-header{
width: 100%;
}
.ls-closed .bars:after, .ls-closed .bars:before{
top: 14px;
}
}

View File

@@ -47,8 +47,12 @@ class Api::OrdersController < Api::ApiController
# end
@shop = Shop.first
puts "Hello world"
puts @shop.to_json
return @shop.to_json
end
# Description
# This API allow new order creation
# Input Params

View File

@@ -1,6 +1,6 @@
class Reports::DailysaleController < BaseReportController
authorize_resource :class => false
def index
from, to = get_date_range_from_params
@sale_data = Sale.daily_sales_list(from,to)
@@ -16,9 +16,9 @@ class Reports::DailysaleController < BaseReportController
format.xls
end
end
def show
end
end

View File

@@ -879,7 +879,6 @@ def self.daily_sales_list(from,to)
total_sale.each do |sale|
grand_total = sale.grand_total
amount_received = sale.amount_received
old_grand_total = sale.old_grand_total
total_discount = sale.total_discount
void_amount = sale.void_amount
@@ -952,7 +951,6 @@ def self.get_by_shiftsales(from,to,shift)
end
shift_sale_data[shift_sale.id] = {
:shift_id => shift_sale.id,
:cashier_terminal_name => shift_sale.cashier_terminal.name,
:employee_name => shift_sale.employee.name,
:shift_started_at => shift_sale.shift_started_at,
@@ -1127,15 +1125,6 @@ def self.get_by_shift_items(shift_sale_range, shift, from, to, status,type,accou
return query,other_charges, product, discount_query , total_cash_amount , total_card_amount , total_credit_amount , total_foc_amount , total_grand_total , change_amount
end
def self.get_shift_sale_items(sh_id)
query = Sale.select("sales.shift_sale_id as shift_sale_id, i.account_id as account_id, acc.title as account_name, i.item_instance_code as item_code, i.menu_category_name, i.menu_category_code as menu_category_id, i.product_name as product_name, i.unit_price, i.price as price, i.qty as qty, SUM(i.qty) as total_item, SUM(i.qty * i.unit_price) as grand_total, i.status as status_type, i.remark as remark")
.joins("JOIN sale_items i on i.sale_id = sales.sale_id")
.joins("JOIN accounts acc on acc.id = i.account_id")
.where("sales.shift_sale_id=?", sh_id)
.group("acc.title,i.account_id,i.menu_category_code,i.item_instance_code,i.product_name,i.unit_price")
.order("acc.title desc, i.account_id desc, i.menu_category_code desc, i.unit_price asc")
end
def self.get_product_sale()
query = Sale.select("i.account_id as account_id, " +
"SUM(i.qty * i.unit_price) as grand_total,SUM(i.qty) as total_item," +

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">
<div class="col-lg-3 col-md-3 col-sm-3 col-mbl-view">
<label class="font-14"><%= 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">
<div class="col-lg-3 col-md-3 col-sm-3 col-mbl-view">
<label class="font-14"><%= 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">
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view">
<label class="font-14"><%= 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">
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view">
<label class="font-14"><%= 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,18 @@
<!-- <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 +147,7 @@
$("#login_form_password").focus();
$(".pin_pad").click(function (event) {
event.preventDefault();
event.preventDefault();
var value = $(this).data("value");
if (value == "CLR") {
@@ -154,12 +162,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 +207,3 @@
</script>
</body>
</html>

View File

@@ -15,14 +15,14 @@
<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="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>
</tr>
@@ -31,34 +31,34 @@
<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,111 @@
<% 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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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 +235,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 +253,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

@@ -54,10 +54,15 @@
<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>
@@ -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

@@ -1,83 +1,16 @@
# ## SQLIte3 --- Setup
#
# # SQLite version 3.x
# # gem install sqlite3
# #
# # Ensure the SQLite 3 gem is defined in your Gemfile
# # gem 'sqlite3'
# #
# default: &default
# adapter: sqlite3
# pool: 5
# timeout: 5000
#
# development:
# <<: *default
# database: db/development.sqlite3
#
# # Warning: The database defined as "test" will be erased and
# # re-generated from your development database when you run "rake".
# # Do not set this db to the same as development or production.
# test:
# <<: *default
# database: db/test.sqlite3
#
# production:
# <<: *default
# database: db/production.sqlite3
# Mysql --- Setup
# MySQL. Versions 5.0 and up are supported.
#
# Install the MySQL driver
# gem install mysql2
#
# Ensure the MySQL gem is defined in your Gemfile
# gem 'mysql2'
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.7/en/old-client.html
#
default: &default
adapter: mysql2
encoding: utf8
pool: 5
username: root
password:
socket: /tmp/mysql.sock
adapter: postgresql
host: localhost
pool: 5
timeout: 5000
encoding: unicode
username: wunna
password: admin123
port: 5432
development:
<<: *default
database: SXRestaurants_development
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
<<: *default
database: SXRestaurants_test
# As with config/secrets.yml, you never want to store sensitive information,
# like your database password, in your source code. If your source code is
# ever seen by anyone, they now have access to your database.
#
# Instead, provide the password as a unix environment variable when you boot
# the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database
# for a full rundown on how to provide these environment variables in a
# production deployment.
#
# On Heroku and other platform providers, you may have a full connection URL
# available as an environment variable. For example:
#
# DATABASE_URL="mysql2://myuser:mypass@localhost/somedatabase"
#
# You can use this database configuration with:
#
# production:
# url: <%= ENV['DATABASE_URL'] %>
#
<<: *default
database: SXDatabase
production:
<<: *default
database: SXRestaurants_production
username: SXRestaurants
password: <%= ENV['SXRESTAURANTS_DATABASE_PASSWORD'] %>
<<: *default
database: paymal

11
config/facebook.yml Normal file
View File

@@ -0,0 +1,11 @@
development:
## with doemal account
app_id: 1049017345154593
secret: 36b2d6132deb803aa9d503d0034e7a68
## My account
#app_id: 434807636720506
#secret: b94c5e35cde5a2c13cfb2e1ba8be30c6

View File

@@ -21,8 +21,8 @@ class ActionController::Base
end
else
# check for license file
if check_license
current_license(ENV["SX_PROVISION_URL"])
if check_license
current_license(ENV["SX_PROVISION_URL"])
else
redirect_to activate_path
end

View File

@@ -1,5 +1,6 @@
application_path="#{File.expand_path("../..", __FILE__)}"
directory application_path
#environment ENV.fetch("RAILS_ENV") { "production" }
environment "production"
pidfile "#{application_path}/tmp/puma/pid"
state_path "#{application_path}/tmp/puma/state"

View File

@@ -11,21 +11,12 @@
# if you're sharing your code publicly.
development:
secret_key_base: b61d85f8ed2a1a9e0eeece3443b3e8f838d002cc1d9f32115d8e93db920e2957adfedc57501d44741211538f3108b742cdeada87d5bfae796c53da1f90a3cd61
sx_provision_url: connect.smartsales.asia/api #connect.smartsales.dev/api #connect.smartsales.asia/api #provision.zsai.ws/api
server_mode: application
cipher_type: AES-256-CBC
sx_key: Wh@t1$C2L
secret_key_base: a17cafd23cb0d29cf61d909be65790f19f25a117683b25a23419b8cdf87d9ec21135e031130f6192998e385017ec1c3250e493c0e42c2e6241b66e14048c6eb5
test:
secret_key_base: 5c92143fd4a844fdaf8b22aba0cda22ef1fc68f1b26dd3d40656866893718ae5e58625b4c3a5dc86b04c8be0a505ec0ebc0be3bf52249a3d1e0c1334ee591cf0
secret_key_base: 477062b07514b11d98ad096b82d81cd692af7a9f084e022dc65cfe02b26b01d11dcf950e624927894a3a1850fde5c82c0b27d8a24686b6c2d522154d0adaffec
# Do not keep production secrets in the repository,
# instead read values from the environment.
production:
secret_key_base: c4bc81065013f9a3506d385bcbd49586c42e586488144b0de90c7da36867de9fa880f46b5c4f86f0ce9b7c783bb5a73bdb0e5605a47716567294390e726d3e22
sx_provision_url: connect.smartsales.asia/api #192.168.1.147:3002/api
server_mode: application
cipher_type: AES-256-CBC
sx_key: Wh@t1$C2L
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>

BIN
dump.rdb

Binary file not shown.