This commit is contained in:
Zoey
2019-05-30 09:35:53 +06:30
26 changed files with 738 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

@@ -269,3 +269,54 @@ i.logout_icon{
color: #FFFFFF;
}
/*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

@@ -121,3 +121,54 @@ 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

@@ -125,3 +125,59 @@ i.logout_icon{
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

@@ -280,3 +280,54 @@ 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

@@ -118,3 +118,9 @@
.box {
margin : 0 -60px 0 -60px;
}
@media screen and (max-width: 785px) {
.login_pwd{width: 90%;}
.login_ent{width: 10%;}
}

View File

@@ -659,3 +659,54 @@ nav.pagination .page a:hover,
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

@@ -122,6 +122,7 @@ class Crm::CustomersController < BaseCrmController
#get customer amount
@customer = Customer.find(params[:id])
@response = Customer.get_membership_transactions(@customer)
puts @response.to_json
Rails.logger.debug "get membership transactions response"
Rails.logger.debug @response.to_json

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

@@ -179,11 +179,14 @@
<th><%= t("views.right_panel.detail.sales_status") %></th>
<th><%= t("views.right_panel.detail.receipt_date") %></th>
</tr>
</thead>
<tbody>
<% add_grand_total =0 %>
<% @sales.each do |sale| %>
<tr>
<td><%= link_to sale.sale_id, transactions_sale_path(sale) %></td>
<td><%= sale.receipt_no %></td>
<td><%= sale.total_discount %></td>
@@ -194,7 +197,15 @@
<td> <%= sale.sale_status %> </td>
<td> <%= sale.receipt_date.utc.getlocal.strftime("%d-%m-%Y %I:%M %p") %> </td>
</tr>
<% add_grand_total += sale.grand_total%>
<% end %>
<% if !@sales.empty?%>
<tr style="border-top:2px solid #666;">
<th colspan="5">Balance</th>
<th colspan="4"><%= add_grand_total %></th>
</tr>
<% end %>
</tbody>
</table>
</div>

View File

@@ -17,7 +17,7 @@
%>
<!-- 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">
@@ -365,6 +368,28 @@
<% 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">

View File

@@ -164,11 +164,3 @@
});
</script>

View File

@@ -18,14 +18,14 @@
<%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>
@@ -44,7 +44,13 @@
<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 %>
@@ -104,10 +110,16 @@
<!-- End Quick Access for Cashier -->
<!-- Start Delete confirrm text !-->
<div class="navbar-right">
<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">

View File

@@ -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>
@@ -51,7 +51,7 @@
<% end %>
<% if can? :index, :home %>
<% if current_login_employee.role != "kitchen" %>
<li>
<li class="menu-up">
<a href="<%= origami_dashboard_path %>">
<i class="material-icons">monetization_on</i>
<span><%= t :origami %></span>
@@ -60,7 +60,7 @@
<% 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>
@@ -80,7 +80,7 @@
</li>
<% 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,65 +88,8 @@
</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>
<% device = request.user_agent %>
<% if device.include? 'Mobile' %>
<% if can? :index, :dailysale %>
<li>
<a href="javascript:void(0);" class="menu-toggle">
@@ -209,6 +152,191 @@
</ul>
</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>
@@ -312,8 +440,11 @@
</a>
</li>
<% end %>
</div>
</ul>
</div>
<!-- #Menu -->
<!-- Footer -->
<div class="legal">

View File

@@ -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,9 +126,17 @@
<!-- <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 class="pin_pad bg-blue-grey" data-value="CLR">CLR</div>
<% end %>
</div>
</div>
</div>
@@ -199,5 +207,3 @@
</script>
</body>
</html>

View File

@@ -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>
@@ -134,34 +134,34 @@
<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>
@@ -181,44 +181,34 @@
<tr style="font-weight:600;">
<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>

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"] %>