fixed conflict
This commit is contained in:
6
app/views/api/call_waiters/index.json.jbuilder
Normal file
6
app/views/api/call_waiters/index.json.jbuilder
Normal file
@@ -0,0 +1,6 @@
|
||||
if (@table)
|
||||
json.table_id @table.id
|
||||
json.name @table.name
|
||||
json.type @table.type
|
||||
json.time @time
|
||||
end
|
||||
@@ -19,6 +19,13 @@ if (@booking)
|
||||
@total_amount = 0.00
|
||||
@total_tax = 0.00
|
||||
|
||||
# For YGN BBQ
|
||||
adult_count = 0
|
||||
child_count = 0
|
||||
adult_spent = 0
|
||||
child_spent = 0
|
||||
# End YGN BBQ
|
||||
|
||||
if @booking.booking_orders
|
||||
order_items = []
|
||||
@booking.booking_orders.each do |bo|
|
||||
@@ -26,21 +33,45 @@ if (@booking)
|
||||
if (order.status == "new")
|
||||
order_items = order_items + order.order_items
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
json.order_items order_items do |item|
|
||||
json.item_instance_code item.item_code
|
||||
json.item_name item.item_name
|
||||
json.price item.price
|
||||
json.qty item.qty
|
||||
json.options item.options
|
||||
json.remark item.remark
|
||||
json.item_status item.order_item_status
|
||||
@total_amount = @total_amount + (item.price * item.qty)
|
||||
# For YGN BBQ
|
||||
if item.item_code == "P00001"
|
||||
adult_count += item.qty
|
||||
adult_spent += (item.price * item.qty)
|
||||
end
|
||||
if item.item_code == "P00002"
|
||||
child_count += item.qty
|
||||
child_spent += (item.price * item.qty)
|
||||
end
|
||||
# End YGN BBQ
|
||||
json.item_code item.item_code
|
||||
json.item_instance_code item.item_instance_code
|
||||
json.item_name item.item_name
|
||||
json.price item.price
|
||||
json.qty item.qty
|
||||
json.options item.options
|
||||
json.remark item.remark
|
||||
json.item_status item.order_item_status
|
||||
@total_amount = @total_amount + (item.price * item.qty)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
# For YGN BBQ
|
||||
if adult_count > 0
|
||||
json.per_adult_spent (adult_spent/adult_count) * 0.05
|
||||
else
|
||||
json.per_adult_spent 0
|
||||
end
|
||||
if child_count > 0
|
||||
json.per_child_spent (child_spent/child_count) * 0.05
|
||||
else
|
||||
json.per_child_spent 0
|
||||
end
|
||||
# End YGN BBQ
|
||||
|
||||
json.sub_total @total_amount
|
||||
json.commerical_tax @total_amount * 0.05
|
||||
json.total @total_amount + (@total_amount * 0.05)
|
||||
|
||||
@@ -7,8 +7,12 @@ json.valid_time_to menu.valid_time_to.strftime("%H:%M")
|
||||
if (menu.menu_categories)
|
||||
json.categories menu.menu_categories do |category|
|
||||
json.id category.id
|
||||
json.code category.code
|
||||
json.order_by category.order_by
|
||||
json.name category.name
|
||||
json.alt_name category.alt_name
|
||||
json.order_by category.order_by
|
||||
json.parent_id category.menu_category_id
|
||||
json.is_available category.is_available
|
||||
|
||||
if category.menu_items
|
||||
|
||||
@@ -1,42 +1,48 @@
|
||||
if @zones
|
||||
json.array! @zones do |zone|
|
||||
json.id zone.id
|
||||
json.name zone.name
|
||||
#List all tables
|
||||
json.tables zone.tables do |table|
|
||||
if zone.is_active
|
||||
json.id zone.id
|
||||
json.name zone.name
|
||||
#List all tables
|
||||
json.tables zone.tables do |table|
|
||||
if table.is_active
|
||||
json.id table.id
|
||||
json.name table.name
|
||||
json.status table.status
|
||||
json.zone_id table.zone_id #Add this zone_id to keep data structure consistance
|
||||
json.current_booking table.get_current_booking.booking_id rescue ""
|
||||
end
|
||||
end
|
||||
|
||||
json.rooms zone.rooms do |room|
|
||||
if room.is_active
|
||||
json.id room.id
|
||||
json.name room.name
|
||||
json.status room.status
|
||||
json.zone_id room.zone_id #Add this zone_id to keep data structure consistance
|
||||
json.current_booking room.get_current_booking.booking_id rescue ""
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
else #list all tables and rooms with out zones
|
||||
json.tables @all_tables do |table|
|
||||
if table.is_active
|
||||
json.id table.id
|
||||
json.name table.name
|
||||
json.status table.status
|
||||
json.zone_id table.zone_id #Add this zone_id to keep data structure consistance
|
||||
json.current_booking table.get_current_booking.booking_id rescue ""
|
||||
end
|
||||
end
|
||||
|
||||
json.rooms zone.rooms do |room|
|
||||
json.rooms @all_rooms do |room|
|
||||
if room.is_active
|
||||
json.id room.id
|
||||
json.name room.name
|
||||
json.status room.status
|
||||
json.zone_id room.zone_id #Add this zone_id to keep data structure consistance
|
||||
json.current_booking room.get_current_booking.booking_id rescue ""
|
||||
|
||||
end
|
||||
end
|
||||
else #list all tables and rooms with out zones
|
||||
json.tables @all_tables do |table|
|
||||
json.id table.id
|
||||
json.name table.name
|
||||
json.status table.status
|
||||
json.zone_id table.zone_id #Add this zone_id to keep data structure consistance
|
||||
json.current_booking table.get_current_booking.booking_id rescue ""
|
||||
|
||||
end
|
||||
|
||||
json.rooms @all_rooms do |room|
|
||||
json.id room.id
|
||||
json.name room.name
|
||||
json.status room.status
|
||||
json.zone_id room.zone_id #Add this zone_id to keep data structure consistance
|
||||
json.current_booking room.get_current_booking.booking_id rescue ""
|
||||
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@@ -11,79 +11,90 @@
|
||||
</div>
|
||||
|
||||
<div class="row clearfix">
|
||||
<div class="col-lg-9 col-md-9 col-sm-9">
|
||||
<div class="col-lg-8 col-md-8 col-sm-8">
|
||||
<div class="card">
|
||||
<div class="body table-responsive">
|
||||
<table class="table table-hover table-striped">
|
||||
<!-- <div class="table-responsive">
|
||||
<table class="table table-striped"> -->
|
||||
<thead>
|
||||
<tr>
|
||||
<td colspan="7">
|
||||
<!-- <button id="member_acc_no" class="btn btn-success btn-md"><span class="fa fa-credit-card"></span> Member Card</button>
|
||||
<button id="qr_code" class="btn btn-danger btn-md">
|
||||
<span class="fa fa-credit-card"></span> QR CODE
|
||||
</button> -->
|
||||
<div class="body">
|
||||
<%= form_tag crm_customers_path, :id => "filter_form", :method => :get do %>
|
||||
<div class="row clearfix">
|
||||
<div class="col-lg-5 col-md-5 col-sm-5 col-xs-12">
|
||||
<input type="text" name="filter" style="margin-right:10px" placeholder="Search" id="search" class="form-control">
|
||||
<input type="hidden" name="type" id="type" value="">
|
||||
</div>
|
||||
<!-- <div class="col-lg-2 col-md-2 col-sm-2 col-xs-12"> -->
|
||||
<button type="submit" class="btn bg-blue waves-effect" style="margin-right: 10px;"><%= t("views.btn.search") %></button>
|
||||
<!-- </div> -->
|
||||
<button type="button" id="member_acc_no" class="btn bg-green btn-sm waves-effect" style="margin-right: 10px;"><%= t("views.btn.memeber_card") %></button>
|
||||
<button type="button" id="qr_code" class="btn bg-green btn-sm waves-effect" style="margin-right: 10px;"><%= t("views.btn.qr_code") %></button>
|
||||
<div class="body">
|
||||
<div class="row p-l-20 p-t-20">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
||||
<%= form_tag crm_customers_path, :id => "filter_form", :method => :get do %>
|
||||
<div class="row clearfix">
|
||||
<div class="col-lg-5 col-md-5 col-sm-5 col-xs-12">
|
||||
<input type="text" name="filter" style="margin-right:10px" placeholder="Search" id="search" class="form-control">
|
||||
<input type="hidden" name="type" id="type" value="">
|
||||
</div>
|
||||
<% end %>
|
||||
<!-- <div class="col-lg-2 col-md-2 col-sm-2 col-xs-12"> -->
|
||||
<button type="submit" class="btn btn-sm bg-blue waves-effect" style="margin-right: 10px;"><%= t("views.btn.search") %></button>
|
||||
<!-- </div> -->
|
||||
<button type="button" id="member_acc_no" class="btn bg-green btn-sm waves-effect" style="margin-right: 10px;"><%= t("views.btn.memeber_card") %></button>
|
||||
<button type="button" id="qr_code" class="btn bg-green btn-sm waves-effect" style="margin-right: 10px;"><%= t("views.btn.qr_code") %></button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th><%= t("views.right_panel.detail.sr_no") %></th>
|
||||
<th><%= t("views.right_panel.detail.name") %></th>
|
||||
<th><%= t("views.right_panel.detail.card_no") %></th>
|
||||
<th><%= t("views.right_panel.detail.contact_no") %></th>
|
||||
<th><%= t("views.right_panel.detail.email") %></th>
|
||||
<th><%= t("views.right_panel.detail.action") %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% if @crm_customers.count > 0 %>
|
||||
<% @i = 0 %>
|
||||
<% @crm_customers.each do |crm_customer| %>
|
||||
<tr class="customer_tr" data-ref="<%= crm_customer.customer_id %>">
|
||||
<td>
|
||||
<input type="radio" style="width:20px;" name="checkbox" class="checkbox_check" ></td>
|
||||
<td>
|
||||
<% if crm_customer.customer_id != "CUS-000000000001" && crm_customer.customer_id != "CUS-000000000002" %>
|
||||
<%= @i += 1 %>
|
||||
<%else%>
|
||||
-
|
||||
<% end %>
|
||||
</td>
|
||||
<td><%= crm_customer.name %></td>
|
||||
<td><%= crm_customer.card_no rescue '-' %></td>
|
||||
<td><%= crm_customer.contact_no %></td>
|
||||
<td><%= crm_customer.email %></td>
|
||||
<td><%= link_to t("views.btn.show"), crm_customer_path(crm_customer) %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<tr><td colspan="7"><strong><p style="text-align: center;margin-bottom: -1px">There is no data for search <%=@filter%>....</p></strong></td></tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<br>
|
||||
<%= paginate @crm_customers %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover table-striped" style="width:100%">
|
||||
<!-- <div class="table-responsive">
|
||||
<table class="table table-striped"> -->
|
||||
<thead>
|
||||
<!-- <tr>
|
||||
<td colspan="7">
|
||||
<button id="member_acc_no" class="btn btn-success btn-md"><span class="fa fa-credit-card"></span> Member Card</button>
|
||||
<button id="qr_code" class="btn btn-danger btn-md">
|
||||
<span class="fa fa-credit-card"></span> QR CODE
|
||||
</button>
|
||||
|
||||
</td>
|
||||
</tr>-->
|
||||
<tr>
|
||||
<th></th>
|
||||
<th><%= t("views.right_panel.detail.sr_no") %></th>
|
||||
<th><%= t("views.right_panel.detail.name") %></th>
|
||||
<th><%= t("views.right_panel.detail.card_no") %></th>
|
||||
<th style="width:20%"><%= t("views.right_panel.detail.contact_no") %></th>
|
||||
<th style="width:20%"><%= t("views.right_panel.detail.email") %></th>
|
||||
<th><%= t("views.right_panel.detail.action") %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% if @crm_customers.count > 0 %>
|
||||
<% @i = 0 %>
|
||||
<% @crm_customers.each do |crm_customer| %>
|
||||
<tr class="customer_tr" data-ref="<%= crm_customer.customer_id %>">
|
||||
<td>
|
||||
<input type="radio" name="checkbox" class="checkbox_check" >
|
||||
</td>
|
||||
<td>
|
||||
<% if crm_customer.customer_id != "CUS-000000000001" && crm_customer.customer_id != "CUS-000000000002" %>
|
||||
<%= @i += 1 %>
|
||||
<%else%>
|
||||
-
|
||||
<% end %>
|
||||
</td>
|
||||
<td><%= crm_customer.name %></td>
|
||||
<td><%= crm_customer.card_no rescue '-' %></td>
|
||||
<td style="width:20px%;word-break: break-all;"><%= crm_customer.contact_no %></td>
|
||||
<td style="width:20px%;word-break: break-all;"><%= crm_customer.email %></td>
|
||||
<td><%= link_to t("views.btn.show"), crm_customer_path(crm_customer) %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<tr><td colspan="7"><strong><p style="text-align: center;margin-bottom: -1px">There is no data for search <%=@filter%>....</p></strong></td></tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<br>
|
||||
<%= paginate @crm_customers %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-3 col-sm-3">
|
||||
<div class="col-lg-4 col-md-4 col-sm-4">
|
||||
<div class="card">
|
||||
<div class="body" id="custom-slimscroll">
|
||||
<%= render 'new_form', crm_customer: @crm_customer, taxes: @taxes %>
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% if @response["status"] == true %>
|
||||
<% if @response["status"] == true && @response["data"].count > 0 %>
|
||||
<% @response["data"].each do |transaction| %>
|
||||
<tr>
|
||||
<td><%= transaction["date"]%></td>
|
||||
@@ -101,7 +101,7 @@
|
||||
<%end%>
|
||||
<%else%>
|
||||
<tr style="border-top:2px solid #666;">
|
||||
<td colspan="5"><p class="align-center">There is no transaction coz of <%=@response["data"]%> ...</p>
|
||||
<td colspan="5"><p class="align-center">There is no transaction coz of <%=@response["message"]%> ...</p>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
@@ -29,9 +29,9 @@
|
||||
<div class="row bottom">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 m-l--5">
|
||||
<div class="row m-l--5">
|
||||
<div class="col-md-3 left cashier_number" data-value="1" data-type="num">1</div>
|
||||
<div class="col-md-3 left cashier_number" data-value="2" data-type="num">2</div>
|
||||
<div class="col-md-3 left cashier_number" data-value="3" data-type="num">3</div>
|
||||
<div class="col-md-3 left-margin-1 cashier_number" data-value="1" data-type="num">1</div>
|
||||
<div class="col-md-3 left-margin-1 cashier_number" data-value="2" data-type="num">2</div>
|
||||
<div class="col-md-3 left-margin-1 cashier_number" data-value="3" data-type="num">3</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -39,9 +39,9 @@
|
||||
<div class="row bottom">
|
||||
<div class="col-md-12 m-l--5">
|
||||
<div class="row m-l--5">
|
||||
<div class="col-md-3 left cashier_number" data-value="4" data-type="num">4</div>
|
||||
<div class="col-md-3 left cashier_number" data-value="5" data-type="num">5</div>
|
||||
<div class="col-md-3 left cashier_number" data-value="6" data-type="num">6</div>
|
||||
<div class="col-md-3 left-margin-1 cashier_number" data-value="4" data-type="num">4</div>
|
||||
<div class="col-md-3 left-margin-1 cashier_number" data-value="5" data-type="num">5</div>
|
||||
<div class="col-md-3 left-margin-1 cashier_number" data-value="6" data-type="num">6</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -49,9 +49,9 @@
|
||||
<div class="row bottom">
|
||||
<div class="col-md-12 m-l--5">
|
||||
<div class="row m-l--5">
|
||||
<div class="col-md-3 left cashier_number" data-value="7" data-type="num">7</div>
|
||||
<div class="col-md-3 left cashier_number" data-value="8" data-type="num">8</div>
|
||||
<div class="col-md-3 left cashier_number" data-value="9" data-type="num">9</div>
|
||||
<div class="col-md-3 left-margin-1 cashier_number" data-value="7" data-type="num">7</div>
|
||||
<div class="col-md-3 left-margin-1 cashier_number" data-value="8" data-type="num">8</div>
|
||||
<div class="col-md-3 left-margin-1 cashier_number" data-value="9" data-type="num">9</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -59,9 +59,9 @@
|
||||
<div class="row bottom">
|
||||
<div class="col-md-12 m-l--5">
|
||||
<div class="row m-l--5">
|
||||
<div class="col-md-3 left cashier_number" data-value="0" data-type="num">0</div>
|
||||
<div class="col-md-3 left cashier_number" data-value="." data-type="num">.</div>
|
||||
<div class="col-md-3 left cashier_number" data-value="00" data-type="num">00</div>
|
||||
<div class="col-md-3 left-margin-1 cashier_number" data-value="0" data-type="num">0</div>
|
||||
<div class="col-md-3 left-margin-1 cashier_number" data-value="." data-type="num">.</div>
|
||||
<div class="col-md-3 left-margin-1 cashier_number" data-value="00" data-type="num">00</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -69,9 +69,9 @@
|
||||
<div class="row bottom">
|
||||
<div class="col-md-12 m-l--5">
|
||||
<div class="row m-l--5">
|
||||
<div class="col-md-3 left cashier_number"></div>
|
||||
<div class="col-md-3 left cashier_number red" data-type="del">DEL</div>
|
||||
<div class="col-md-3 left cashier_number green" data-type="clr">CLR</div>
|
||||
<div class="col-md-3 left-margin-1 cashier_number"></div>
|
||||
<div class="col-md-3 left-margin-1 cashier_number red" data-type="del">DEL</div>
|
||||
<div class="col-md-3 left-margin-1 cashier_number green" data-type="clr">CLR</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -100,8 +100,8 @@
|
||||
<%= link_to t("views.btn.new"),new_crm_dining_queue_path,:class => 'btn bg-green btn-block btn-lg btn-block', 'data-no-turbolink' => true %>
|
||||
<hr>
|
||||
|
||||
<button type="button" id="assign" class="btn btn-primary btn-block btn-lg waves-effect" disabled>Assign</button>
|
||||
<button type="button" id="cancel" class="btn btn-danger btn-block btn-lg waves-effect" disabled>Cancel</button>
|
||||
<button type="button" id="assign" class="btn btn-primary btn-block btn-lg waves-effect" style="font-size: 11px" disabled>Assign</button>
|
||||
<button type="button" id="cancel" class="btn btn-danger btn-block btn-lg waves-effect" style="font-size: 11px" disabled>Cancel</button>
|
||||
<!-- <a href="<%= dashboard_path %>" class="btn btn-default btn-block waves-effect" role="button" aria-haspopup="true" aria-expanded="false"> Back </a> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -118,7 +118,7 @@
|
||||
</button> -->
|
||||
<!-- <button type="button" class="btn btn-primary btn-lg btn-block" disabled>Print <br/>Order<br/>Summary</button> -->
|
||||
<button id="assign" value="" disabled="disabled" data-type="assign" class="btn assign btn-primary btn-lg btn-block">ASSIGN</button>
|
||||
<button id="cancel" value="" disabled="disabled" data-type="cancel" class="btn btn-danger cancel btn-lg btn-block">CANCLE</button>
|
||||
<button id="cancel" value="" disabled="disabled" data-type="cancel" class="btn btn-danger cancel btn-lg btn-block">CANCEL</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
|
||||
<% if current_user.role == 'administrator' || current_user.role == 'manager' %>
|
||||
<div class="row">
|
||||
<div class="col-xs-9 col-sm-9 col-md-9 col-lg-9">
|
||||
<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">
|
||||
@@ -111,32 +111,32 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-3 col-sm-3 col-md-3 col-lg-3">
|
||||
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
|
||||
<% if !@summ_sale.nil? %>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
|
||||
<div class="card">
|
||||
<div class="body">
|
||||
<h6>Sale</h6>
|
||||
<h6><%= t :sale %></h6>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<td>Total Receipt : </td>
|
||||
<td><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.receipt") %> : </td>
|
||||
<td align="right"><%= @summ_sale.total_receipt %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Total Sale : </td>
|
||||
<td><%= t("views.right_panel.detail.total") %> <%= t :sale %> : </td>
|
||||
<td align="right"><%= @summ_sale.total_amount %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Total Discount : </td>
|
||||
<td><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.discount") %> : </td>
|
||||
<td align="right"><%= @summ_sale.total_discount %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Total Tax : </td>
|
||||
<td><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.tax") %> : </td>
|
||||
<td align="right"><%= @summ_sale.total_tax %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Grand Total : </td>
|
||||
<td><%= t("views.right_panel.detail.grand_total") %> : </td>
|
||||
<td align="right"><%= @summ_sale.grand_total %></td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -144,16 +144,7 @@
|
||||
<% if !(@total_payment_methods.nil?) %>
|
||||
<% @total_payment_methods.each do |payment| %>
|
||||
<% if !@sale_data[0].empty? %>
|
||||
<% if payment.payment_method == 'mpu' || payment.payment_method == 'visa' || payment.payment_method == 'master' || payment.payment_method == 'jcb' %>
|
||||
<tr>
|
||||
<td>Card Sale : </td>
|
||||
<td align="right">
|
||||
<% @sale_data.each do |data| %>
|
||||
<%= data["card"] %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<% else %>
|
||||
<% if payment.payment_method != 'mpu' && payment.payment_method != 'visa' && payment.payment_method != 'master' && payment.payment_method != 'jcb' %>
|
||||
<tr>
|
||||
<td><%= payment.payment_method.to_s.capitalize %> Sale : </td>
|
||||
<td align="right">
|
||||
@@ -166,6 +157,17 @@
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% total_card = @sale_data.select { |hash| hash["card"]!=nil }.first %>
|
||||
<% if !total_card.nil? %>
|
||||
<tr>
|
||||
<td><%= t("views.right_panel.detail.card_sale") %> : </td>
|
||||
<td align="right">
|
||||
<%= total_card["card"].to_f %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
</table>
|
||||
</div>
|
||||
@@ -178,35 +180,35 @@
|
||||
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
|
||||
<div class="card">
|
||||
<div class="body">
|
||||
<h6>Customer</h6>
|
||||
<h6><%= t :customer %></h6>
|
||||
<table class="table">
|
||||
<% if !@total_customer.nil? %>
|
||||
<tr>
|
||||
<td>Total Customer : </td>
|
||||
<td align="right"><%= @total_customer.total_cus %></td>
|
||||
<td><%= t("views.right_panel.detail.total") %> <%= t :customer %> : </td>
|
||||
<td align="right"><%= @total_customer %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% if !@total_dinein.nil? %>
|
||||
<tr>
|
||||
<td>Dine in : </td>
|
||||
<td><%= t("views.right_panel.detail.dine_in") %> : </td>
|
||||
<td align="right"><%= @total_dinein.total_dinein_cus %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% if !@total_takeaway.nil? %>
|
||||
<tr>
|
||||
<td>Takeaway : </td>
|
||||
<td><%= t("views.right_panel.detail.takeaway") %> : </td>
|
||||
<td align="right"><%= @total_takeaway.total_take_cus %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% if !@total_other_customer.nil? %>
|
||||
<tr>
|
||||
<td>Customer : </td>
|
||||
<td><%= t :customer %> : </td>
|
||||
<td align="right"><%= @total_other_customer.total_cus %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% if !@total_membership.nil? %>
|
||||
<tr>
|
||||
<td>Membership : </td>
|
||||
<td><%= t("views.right_panel.detail.membership") %> : </td>
|
||||
<td align="right"><%= @total_membership.total_memb_cus %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
@@ -220,20 +222,20 @@
|
||||
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
|
||||
<div class="card">
|
||||
<div class="body">
|
||||
<h6>Order</h6>
|
||||
<h6><%= t("views.right_panel.detail.order") %></h6>
|
||||
<table class="table">
|
||||
<% if !@total_order.nil? %>
|
||||
<tr>
|
||||
<td width="40px">Total Order : </td>
|
||||
<td align="right" width="60px" style="padding: 5px"><%= @total_order.total_order %></td>
|
||||
<td width="40px"><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.order") %> : </td>
|
||||
<td align="right" width="60px"><%= @total_order.total_order %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
<% if !(@total_accounts.nil?) %>
|
||||
<% if !@total_accounts.nil? %>
|
||||
<% @total_accounts.each do |account| %>
|
||||
<tr>
|
||||
<td width="40px"><%= account.title %> (Account) : </td>
|
||||
<td align="right" width="60px" style="padding: 5px">
|
||||
<td align="right" width="60px">
|
||||
<% @account_data.each do |data| %>
|
||||
<% acc = account.title %>
|
||||
<%= data[""+acc+""] %> <% if !data[''+acc+''].nil? %> ( <%= data[''+acc+'_amount'] %> ) <% end %>
|
||||
@@ -244,15 +246,15 @@
|
||||
<% end %>
|
||||
<% if !@top_items.nil? %>
|
||||
<tr>
|
||||
<td width="40px">Top Item : </td>
|
||||
<td align="right" width="60px" style="padding: 5px"><%= @top_items.item_name %>
|
||||
<td width="40px"><%= t :top %> <%= t("views.right_panel.detail.item") %> : </td>
|
||||
<td align="right" width="60px"><%= @top_items.item_name %>
|
||||
<br>(<%= @top_items.item_total_price %>)</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% if !@total_foc_items.nil? %>
|
||||
<tr>
|
||||
<td width="40px">Total FOC Item : </td>
|
||||
<td align="right" width="60px" style="padding: 5px"><%= @total_foc_items %></td>
|
||||
<td width="40px"><%= t("views.right_panel.detail.total") %> <%= t("views.btn.foc") %> <%= t("views.right_panel.detail.item") %> : </td>
|
||||
<td align="right" width="60px"><%= @total_foc_items.to_int %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<form action="/install" method="POST" class="row">
|
||||
<form action="/activate" method="POST" class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="exampleInputEmail1">Business Name</label>
|
||||
@@ -10,7 +10,7 @@
|
||||
<input type="text" class="form-control" name="license_key" aria-describedby="license_key" placeholder="Add License Key">
|
||||
<small class="form-text text-muted">Add License Key from Email</small>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<!-- <div class="form-group">
|
||||
<label for="lblAdministrator">Administrator Username</label>
|
||||
<input type="text" class="form-control" name="admin_user" aria-describedby="admin_user" placeholder="Administrator Username">
|
||||
<small id="admin_user" class="form-text text-muted">First Employee who will be assign as administrator</small>
|
||||
@@ -18,9 +18,17 @@
|
||||
<div class="form-group">
|
||||
<label for="admin_password">Password</label>
|
||||
<input type="password" class="form-control" name="admin_password" placeholder="Password">
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="lblDBHost">Database Host</label>
|
||||
<input type="text" class="form-control" name="db_host" aria-describedby="db_host" placeholder="Database Host" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="lblDBName">Database Schema</label>
|
||||
<input type="text" class="form-control" name="db_schema" aria-describedby="db_schema" placeholder="Database Schema">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="lblAdministrator">Database Username</label>
|
||||
<input type="text" class="form-control" name="db_user" aria-describedby="db_user" placeholder="Database Username">
|
||||
|
||||
@@ -14,11 +14,16 @@
|
||||
<div class="container-fluid">
|
||||
<div class="navbar-header">
|
||||
<!-- <a href="javascript:void(0);" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse" aria-expanded="false"></a> -->
|
||||
<a href="javascript:void(0);" class="bars"></a>
|
||||
<a class="navbar-brand" href="<%=dashboard_path%>">
|
||||
<%if current_login_employee.role !="waiter" %>
|
||||
<a href="javascript:void(0);" class="bars"></a>
|
||||
<a class="navbar-brand" href="<%=dashboard_path%>" style="margin-left: 20px;">
|
||||
<% else %>
|
||||
<a class="navbar-brand m-0" href="<%=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>
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<!-- Start Delete confirrm text !-->
|
||||
<div class="navbar-right">
|
||||
@@ -29,16 +34,16 @@
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li>
|
||||
<%if current_login_employee.role !="waiter" %>
|
||||
<p class="delete waves-effect waves-block p-l-30 m-t-15" data-ref="<%=logout_path%>" data-method="delete">
|
||||
<i class="material-icons">exit_to_app</i>
|
||||
<span class="font-18 m-b-5">Logout</span>
|
||||
</p>
|
||||
<span class="hidden" id="delete_text">
|
||||
<h6>Are you sure you want to Logout ?</h6>
|
||||
<!-- <h6>This action can't be undo. </h6> -->
|
||||
</span>
|
||||
<%end%>
|
||||
<!-- <%if current_login_employee.role !="waiter" %> -->
|
||||
<!-- <%end%> -->
|
||||
<p class="delete waves-effect waves-block p-l-30 m-b-5" data-ref="<%=logout_path%>" data-method="delete">
|
||||
<i class="material-icons font-10 logout_icon">exit_to_app</i>
|
||||
<span class="font-18">Logout</span>
|
||||
</p>
|
||||
<span class="hidden" id="delete_text">
|
||||
<h6>Are you sure you want to Logout ?</h6>
|
||||
<!-- <h6>This action can't be undo. </h6> -->
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
<!-- NO Need for color Change
|
||||
|
||||
@@ -65,12 +65,14 @@
|
||||
</ul>
|
||||
</li>
|
||||
<% end %>
|
||||
<li>
|
||||
<% if can? :menage, Inventory %>
|
||||
<!-- <li>
|
||||
<a href="<%= inventory_path %>">
|
||||
<i class="material-icons">store</i>
|
||||
<span><%= t :inventory %></span>
|
||||
</a>
|
||||
</li>
|
||||
</li> -->
|
||||
<%end%>
|
||||
<li>
|
||||
<a href="javascript:void(0);" class="menu-toggle">
|
||||
<i class="material-icons">widgets</i>
|
||||
|
||||
@@ -65,13 +65,10 @@
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row bg-white">
|
||||
<!-- <div class="col-xs-12 col-sm-12 col-md-2 col-lg-2"> </div> -->
|
||||
<div class="row bg-white">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 p-t-20 p-l-10 p-r-10 p-b-50 bg-white">
|
||||
<div class="row justify-content-center form-group">
|
||||
<!-- <span class="col-md-4"></span> -->
|
||||
<input type="text" class="form-control col-4" id="emp_id" onkeypress="empID()" placeholder="Access PIN">
|
||||
<!-- <span class="col-md-4"></span> -->
|
||||
<div class="row justify-content-center form-group">
|
||||
<input type="text" class="form-control col-4" id="emp_id" placeholder="Employee ID">
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
@@ -148,6 +145,31 @@
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-1 col-black">
|
||||
<span>Waiter</span>
|
||||
</div>
|
||||
<div class="col-11">
|
||||
<hr />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row m-b-15">
|
||||
<% @employees.each do |employee| %>
|
||||
<%if employee.role == "waiter" %>
|
||||
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 empBtn" data-formid="#form_<%= employee.emp_id %>" >
|
||||
<form id="form_<%= employee.emp_id %>" action="<%= emp_login_path(employee.emp_id) %>" method="PATCH">
|
||||
</form>
|
||||
<div class="card emp-body">
|
||||
<div class="body bg-teal">
|
||||
<%= employee.name%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="col-xs-12 col-sm-12 col-md-2 col-lg-2"> </div> -->
|
||||
</div>
|
||||
@@ -157,9 +179,7 @@
|
||||
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
|
||||
// for Notificaiotn message
|
||||
|
||||
var placementFrom = $("#noti").attr('data-placement-from');
|
||||
var placementAlign = $("#noti").attr('data-placement-align');
|
||||
var animateEnter = $("#noti").attr('data-animate-enter');
|
||||
@@ -177,20 +197,22 @@
|
||||
$(item).submit();
|
||||
});
|
||||
|
||||
});
|
||||
function empID(){
|
||||
$('#emp_id').keyup(function(e) {
|
||||
var txtVal = this.value;
|
||||
if ($.isNumeric(txtVal)) {
|
||||
if( txtVal.length === 3 ) {
|
||||
window.location.href = '/auth/'+txtVal;
|
||||
}
|
||||
}else{
|
||||
alert("Please Enter Numeric Number")
|
||||
}
|
||||
});
|
||||
$('#emp_id').keyup(function(e) {
|
||||
e.preventDefault();
|
||||
var txtVal = this.value;
|
||||
|
||||
if(txtVal!=''){
|
||||
if ($.isNumeric(txtVal)) {
|
||||
if( txtVal.length === 3 ) {
|
||||
window.location.href = '/auth/'+txtVal;
|
||||
}
|
||||
}else{
|
||||
alert("Please Enter Numeric Number");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
function showNotification(colorName, text, placementFrom, placementAlign, animateEnter, animateExit) {
|
||||
if (colorName === null || colorName === '') { colorName = 'bg-black'; }
|
||||
|
||||
@@ -41,6 +41,10 @@
|
||||
<%= render 'layouts/right_sidebar' %>
|
||||
</section>
|
||||
|
||||
<!-- Notify -->
|
||||
<div id="notify-wrapper"></div>
|
||||
<!-- Notify -->
|
||||
|
||||
<!-- Main Content -->
|
||||
<section class="content">
|
||||
<% flash.each do |type, message| %>
|
||||
|
||||
@@ -98,10 +98,17 @@
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
// Qty update for OQS Edit Controller
|
||||
original_value = $('#qty').val();
|
||||
|
||||
// Qty update for OQS Edit Controller
|
||||
$('#qty-update').on('click', function(){
|
||||
var qty_weight = $("input[name='qty_weight']").val();
|
||||
|
||||
if(parseInt(qty_weight) > parseInt(original_value)){
|
||||
swal("Alert!", "Not allowed over quantity", "warning");
|
||||
return;
|
||||
}
|
||||
|
||||
var remarks = $("textarea[name='remarks']").val();
|
||||
var order_items_id = $(this).attr('data-id');
|
||||
var params = { 'order_items_id': order_items_id, 'qty_weight': qty_weight, 'remarks': remarks }
|
||||
@@ -110,7 +117,7 @@ $(document).ready(function(){
|
||||
url: '/oqs/' + order_items_id,
|
||||
data: params,
|
||||
success: function(result){
|
||||
alert("Updated!");
|
||||
// alert("Updated!");
|
||||
window.location.href = '/oqs';
|
||||
}
|
||||
});
|
||||
|
||||
@@ -84,8 +84,8 @@
|
||||
<%= qid.qty %>
|
||||
</span> ]
|
||||
</p>
|
||||
|
||||
<p class="card-text item-options"><%= qid.options == "[]"? "" : qid.options %></p>
|
||||
|
||||
<br/><p class="card-text item-options"><%= qid.options == "[]"? "" : qid.options %></p>
|
||||
|
||||
<span class="card-text">
|
||||
<span class="text-muted">Order at -
|
||||
|
||||
@@ -7,17 +7,36 @@
|
||||
<div class="row m-t--20">
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<ul class="nav nav-tabs flex-column" role="tablist" >
|
||||
<% @menu.each do |menu| %>
|
||||
<!-- <li class="nav-item menu_category" data-ref="<%= origami_get_menu_category_path menu.id%>">
|
||||
-->
|
||||
<li class="nav-item menu_category">
|
||||
<p class="hidden menu-id"><%= menu.id %></p>
|
||||
<a class="nav-link" data-toggle="tab" href="" role="tab"> <%= menu.name%></a>
|
||||
</li>
|
||||
<% end %>
|
||||
<% @menu.each do |menu| %>
|
||||
<% if menu.menu_category_id.nil?%>
|
||||
<li class="nav-item menu_category sub_click" data-id="<%=menu.id%>">
|
||||
<p class="hidden menu-id"><%= menu.id %></p>
|
||||
<a class="nav-link" data-toggle="tab" href="" role="tab"> <%= menu.name%>
|
||||
<ul class=" sub_category_list hidden fadeInTop animated" id="sub_category_list">
|
||||
</ul>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
<% end%>
|
||||
<%end %>
|
||||
<!-- <li class="nav-item menu_category">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Menu 1 <b class="caret"></b></a>
|
||||
<ul class="dropdown-menu multi-level">
|
||||
<li><a href="#">Action</a></li>
|
||||
<li><a href="#">Another action</a></li>
|
||||
<li><a href="#">Something else here</a></li>
|
||||
<li class="divider"></li>
|
||||
<li><a href="#">Separated link</a></li>
|
||||
<li class="divider"></li>
|
||||
<li><a href="#">One more separated link</a></li>
|
||||
|
||||
</ul>
|
||||
</li> -->
|
||||
<li class="nav-item product" data-ref="<%= origami_get_all_product_path %>">
|
||||
<a class="nav-link" data-toggle="tab" href="" role="tab">Products</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-md-7 col-lg-7 col-sm-7 m-t-10">
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
if @sub_menu
|
||||
json.sub_category @sub_menu.each do |sub_cat|
|
||||
json.id sub_cat.id
|
||||
json.code sub_cat.code
|
||||
json.name sub_cat.name
|
||||
json.menu_id sub_cat.menu_id
|
||||
json.menu_category_id sub_cat.menu_category_id
|
||||
end
|
||||
end
|
||||
@@ -21,6 +21,7 @@
|
||||
<label>You can pay up to </label>
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||
<%@can_credit = @can_credit +@rounding_adj%>
|
||||
<input type="text" name="validamount" id="validamount" class="form-control" readonly="" value="<%=@can_credit %>" data-member-value="">
|
||||
</div>
|
||||
</div>
|
||||
@@ -40,15 +41,13 @@
|
||||
<!-- </div> -->
|
||||
<% end %>
|
||||
<!-- <div class="row"> -->
|
||||
<div class="row">
|
||||
<!-- <div class="row">
|
||||
<div class="col-lg-5 col-md-5 col-sm-5">
|
||||
<label >Recent Credit Amount</label>
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||
<input type="text" name="valid_amount" id="valid_amount" class="form-control" value="" data-value="<%=@sale_id %>" data-member-value="">
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
</div> -->
|
||||
<!-- </div> -->
|
||||
<div class="row">
|
||||
<div class="col-lg-5 col-md-5 col-sm-5">
|
||||
@@ -170,6 +169,7 @@
|
||||
var amount = $('#amount').text();
|
||||
var sale_id = "<%= @sale_id %>";
|
||||
if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){
|
||||
$(this).off("click");
|
||||
$.ajax({type: "POST",
|
||||
url: "<%= origami_payment_credit_path %>",
|
||||
data: "amount="+ amount + "&sale_id="+ sale_id,
|
||||
@@ -178,7 +178,11 @@
|
||||
swal({
|
||||
title: "Information!",
|
||||
text: "Payment Success",
|
||||
type: "success"
|
||||
type: "success",
|
||||
html: true,
|
||||
closeOnConfirm: false,
|
||||
closeOnCancel: false,
|
||||
allowOutsideClick: false
|
||||
}, function () {
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment";
|
||||
});
|
||||
|
||||
@@ -14,86 +14,84 @@
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-md-8 col-sm-8">
|
||||
<div class="card">
|
||||
<div class="main-box-body clearfix" id="order-detail-slimscroll" style="">
|
||||
<div class="table-responsive">
|
||||
<table id="origami-crm-table" class="table table-striped">
|
||||
<div class="body">
|
||||
<div class="row p-t-20 p-l-20">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
||||
<!-- <% path ="/origami/#{@sale_id}/customers" %>
|
||||
<%= form_tag path, :id => "filter_form", :method => :get do %>
|
||||
<div class="input-append col-md-7 form-group pull-left">
|
||||
<input type="text" name="filter" style="margin-right:10px" id="search" placeholder="Search" class="form-control input-sm col-md-9">
|
||||
<input type="hidden" name="type" id="type" value="">
|
||||
<button type="submit" class="btn btn-primary btn-sm">Search</button>
|
||||
</div>
|
||||
<% end %>
|
||||
<button id="member_acc_no" class="btn btn-success btn-sm"><span class="fa fa-credit-card"></span> Member Card</button> -->
|
||||
<% path ="/origami/#{@sale_id}/customers" %>
|
||||
<%= form_tag path, :id => "filter_form", :method => :get do %>
|
||||
<div class="row clearfix">
|
||||
<div class="col-lg-5 col-md-5 col-sm-5 col-xs-12">
|
||||
|
||||
<thead>
|
||||
<input type="text" name="filter" style="margin-right:10px" id="search" placeholder="Search" class="form-control input-sm col-md-12">
|
||||
<!-- <input type="hidden" name="type" id="type" value="<%= @dining_facility.type %>"> -->
|
||||
|
||||
<tr>
|
||||
<td colspan="6">
|
||||
<!-- <% path ="/origami/#{@sale_id}/customers" %>
|
||||
<%= form_tag path, :id => "filter_form", :method => :get do %>
|
||||
<div class="input-append col-md-7 form-group pull-left">
|
||||
<input type="text" name="filter" style="margin-right:10px" id="search" placeholder="Search" class="form-control input-sm col-md-9">
|
||||
<input type="hidden" name="type" id="type" value="">
|
||||
<button type="submit" class="btn btn-primary btn-sm">Search</button>
|
||||
</div>
|
||||
<% end %>
|
||||
<button id="member_acc_no" class="btn btn-success btn-sm"><span class="fa fa-credit-card"></span> Member Card</button> -->
|
||||
<div class="body">
|
||||
<% path ="/origami/#{@sale_id}/customers" %>
|
||||
<%= form_tag path, :id => "filter_form", :method => :get do %>
|
||||
<div class="row clearfix">
|
||||
<div class="col-lg-5 col-md-5 col-sm-5 col-xs-12">
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-12">
|
||||
<button type="submit" class="btn bg-blue waves-effect waves-effect">Search</button>
|
||||
</div>
|
||||
|
||||
<input type="text" name="filter" style="margin-right:10px" id="search" placeholder="Search" class="form-control input-sm col-md-12">
|
||||
<input type="hidden" name="type" id="type" value="<%= @dining_facility.type %>">
|
||||
<button type="button" id="member_acc_no" class="btn bg-green btn-sm waves-effect" style="height: 30%;margin-right: 10px;">Member Card</button>
|
||||
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-12">
|
||||
<button type="submit" class="btn bg-blue waves-effect waves-effect">Search</button>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="main-box-body clearfix" id="order-detail-slimscroll" style="">
|
||||
<div class="table-responsive">
|
||||
<table id="origami-crm-table" class="table table-striped" style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th><%= t("views.right_panel.detail.sr_no") %></th>
|
||||
<th><%= t("views.right_panel.detail.name") %></th>
|
||||
<th><%= t("views.right_panel.detail.card_no") %></th>
|
||||
<th style="width:20%"><%= t("views.right_panel.detail.contact_no") %></th>
|
||||
<th style="width:20%"><%= t("views.right_panel.detail.email") %></th>
|
||||
<!-- <th>Paypar No</th> -->
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<button type="button" id="member_acc_no" class="btn bg-green btn-sm waves-effect" style="height: 30%;margin-right: 10px;">Member Card</button>
|
||||
<tbody>
|
||||
<% if @crm_customers.count > 0 %>
|
||||
<% @i = 0 %>
|
||||
<% @crm_customers.each do |crm_customer| %>
|
||||
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th><%= t("views.right_panel.detail.sr_no") %></th>
|
||||
<th><%= t("views.right_panel.detail.name") %></th>
|
||||
<th><%= t("views.right_panel.detail.card_no") %></th>
|
||||
<th><%= t("views.right_panel.detail.contact_no") %></th>
|
||||
<th><%= t("views.right_panel.detail.email") %></th>
|
||||
<!-- <th>Paypar No</th> -->
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% if @crm_customers.count > 0 %>
|
||||
<% @i = 0 %>
|
||||
<% @crm_customers.each do |crm_customer| %>
|
||||
|
||||
<tr class="customer_tr" data-ref="<%= crm_customer.customer_id %>">
|
||||
<td>
|
||||
<input type="radio" style="width:20px;" name="checkbox" class="checkbox_check" ></td>
|
||||
<tr class="customer_tr" data-ref="<%= crm_customer.customer_id %>">
|
||||
<td>
|
||||
<% if crm_customer.customer_id != "CUS-000000000001" && crm_customer.customer_id != "CUS-000000000002" %>
|
||||
<%= @i += 1 %>
|
||||
<%else%>
|
||||
-
|
||||
<% end %>
|
||||
</td>
|
||||
<td><%= crm_customer.name %></td>
|
||||
<td><%= crm_customer.company rescue '-' %></td>
|
||||
<td><%= crm_customer.contact_no %></td>
|
||||
<td><%= crm_customer.email %></td>
|
||||
<!-- <td><%= crm_customer.paypar_account_no %></td> -->
|
||||
<input type="radio" style="width:20px;" name="checkbox" class="checkbox_check" ></td>
|
||||
<td>
|
||||
<% if crm_customer.customer_id != "CUS-000000000001" && crm_customer.customer_id != "CUS-000000000002" %>
|
||||
<%= @i += 1 %>
|
||||
<%else%>
|
||||
-
|
||||
<% end %>
|
||||
</td>
|
||||
<td><%= crm_customer.name %></td>
|
||||
<td><%= crm_customer.company rescue '-' %></td>
|
||||
<td style="width:20%;word-break: break-all;"><%= crm_customer.contact_no %></td>
|
||||
<td style="width:20%;word-break: break-all;"><%= crm_customer.email %></td>
|
||||
<!-- <td><%= crm_customer.paypar_account_no %></td> -->
|
||||
|
||||
</tr>
|
||||
<% end %>
|
||||
<%else%>
|
||||
<tr><td colspan="5"><p style="text-align:center"><strong>There are no record for your search</strong></p></td></tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<br>
|
||||
</tr>
|
||||
<% end %>
|
||||
<%else%>
|
||||
<tr><td colspan="5"><p style="text-align:center"><strong>There are no record for your search</strong></p></td></tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<br>
|
||||
|
||||
<%= paginate @crm_customers %>
|
||||
<%= paginate @crm_customers %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -425,13 +423,13 @@
|
||||
success: function(data) {
|
||||
if(data.status == true)
|
||||
{
|
||||
var id = $("#table_id").val()
|
||||
var type = $("#type").val()
|
||||
var id = $("#table_id").val();
|
||||
var type = $("#type").val();
|
||||
if (type=="Table") {
|
||||
window.location.href = '/origami/table/'+id
|
||||
}else{
|
||||
window.location.href = '/origami/room/'+id
|
||||
}
|
||||
window.location.href = '/origami/room/'+id
|
||||
}
|
||||
}else{
|
||||
swal("Alert!", "Record not found!", "error");
|
||||
location.reload();
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
<% @sale_data.sale_items.each do |sale_item| %>
|
||||
<%
|
||||
sub_total += sale_item.qty*sale_item.unit_price
|
||||
if sale_item.price != 0 && sale_item.remark != "void"
|
||||
if sale_item.price != 0 && sale_item.remark != "void" && sale_item.remark != "foc"
|
||||
%>
|
||||
<tr class="item-row" id=<%= sale_item.sale_item_id %> >
|
||||
<td style="width:60%; text-align:left">
|
||||
|
||||
@@ -41,7 +41,11 @@
|
||||
<% @tables.each do |table| %>
|
||||
<% if table.status == 'occupied' %>
|
||||
<% if table.get_booking.nil? %>
|
||||
<% if table.get_checkout_booking.nil? %>
|
||||
<div class="card tables red text-white" data-id="<%= table.id %>">
|
||||
<% else %>
|
||||
<div class="card tables orange text-white" data-id="<%= table.id %>">
|
||||
<% end %>
|
||||
<div class="card-block">
|
||||
Zone <%= table.zone_id %> <br>
|
||||
Table <%= table.name %> ( <%= table.seater %> Seat )
|
||||
@@ -114,12 +118,13 @@
|
||||
<button id="back" type="button" class="btn btn-block btn-lg bg-default"> <i class="material-icons">reply</i> <%= t("views.btn.back") %>
|
||||
</button>
|
||||
<%end%>
|
||||
<%if current_login_employee.role != "waiter" %>
|
||||
<button id="cash_in" type="button" class="btn btn-block btn-lg bg-blue waves-effect"> <%= t("views.btn.cash_in") %> </button>
|
||||
<button id="cash_out" type="button" class="btn btn-block btn-lg bg-blue waves-effect"> <%= t("views.btn.cash_out") %> </button>
|
||||
<!-- Temporary Disabled -->
|
||||
|
||||
<button id="close_cashier" type="button" class="btn btn-block btn-lg bg-blue waves-effect"> <%= t("views.btn.close_cashier") %></button>
|
||||
|
||||
<%end%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
<div class="container-fluid">
|
||||
<div id="loading_wrapper" style="display:none;">
|
||||
<div id="loading"></div>
|
||||
</div>
|
||||
<div class="row clearfix">
|
||||
<!-- Column One -->
|
||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||
@@ -37,22 +40,26 @@
|
||||
<!--- Panel 1 - Table Orders -->
|
||||
<div class="tab-pane dining active " id="tables" role="tabpanel">
|
||||
<div class="card-columns">
|
||||
<% @tables.each do |table| %>
|
||||
<% @tables.each do |table| %>
|
||||
<% if table.status == 'occupied' %>
|
||||
<% if table.get_booking.nil? %>
|
||||
<% if table.get_checkout_booking.nil? %>
|
||||
<div class="card tables red text-white table_<%= table.id %>" data-id="<%= table.id %>">
|
||||
<% else %>
|
||||
<div class="card tables orange text-white table_<%= table.id %>" data-id="<%= table.id %>">
|
||||
<% end %>
|
||||
<div class="card-block">
|
||||
<%= table.name %>
|
||||
<span class="float-right font-12 new_text_<%= table.id %>"> billed</span>
|
||||
<div style="font-size:12px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<% else %>
|
||||
<% if table.get_checkout_booking.nil? %>
|
||||
<div class="card tables blue text-white table_<%= table.id %>" data-id="<%= table.id %>">
|
||||
<% else %>
|
||||
<% else %>
|
||||
<div class="card tables orange text-white table_<%= table.id %>" data-id="<%= table.id %>">
|
||||
<% end %>
|
||||
<% end %>
|
||||
<div class="card-block">
|
||||
<%= table.name %>
|
||||
<span class="float-right font-12 new_text_<%= table.id %>"> new</span>
|
||||
@@ -128,7 +135,11 @@
|
||||
<div id="save_order_id" data-order="">
|
||||
<% end %>
|
||||
<strong id="order-title">ORDER DETAILS </strong> | Table <%= @dining.name rescue "" %>
|
||||
<span class="float-right">Checkin Time : <%= @booking.checkin_at.utc.getlocal.strftime("%I:%M %p") %></span>
|
||||
<% if @booking.checkout_by.nil? && !@booking.reserved_by.nil? && %>
|
||||
<span class="float-right"><%= @booking.checkin_at.utc.getlocal.strftime("%I:%M %p") %> - <%= @booking.checkout_at.utc.getlocal.strftime("%I:%M %p") %></span>
|
||||
<% else %>
|
||||
<span class="float-right">Checkin Time : <%= @booking.checkin_at.utc.getlocal.strftime("%I:%M %p") %></span>
|
||||
<% end %>
|
||||
</div>
|
||||
<% elsif @status_sale == 'sale' %>
|
||||
<div><strong id="order-title">INVOICE DETAILS </strong> | Table <%= @dining.name rescue "" %>
|
||||
@@ -145,8 +156,7 @@
|
||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||
Receipt No: <span id="receipt_no">
|
||||
<% if @status_sale == 'sale' %>
|
||||
<%= @sale_array[0].receipt_no rescue '' %>
|
||||
|
||||
<%= @sale_array[0].receipt_no rescue '' %>
|
||||
<% end %>
|
||||
</span>
|
||||
<br>
|
||||
@@ -212,7 +222,7 @@
|
||||
<input type="hidden" id="sale_id" value="<%= @sale_array[0].sale_id %>">
|
||||
<%
|
||||
# Can't check for discount
|
||||
unless sale_item.price == 0
|
||||
# unless sale_item.price == 0
|
||||
count += 1
|
||||
%>
|
||||
<tr>
|
||||
@@ -223,19 +233,18 @@
|
||||
</tr>
|
||||
|
||||
<%
|
||||
|
||||
end
|
||||
# end
|
||||
end
|
||||
end
|
||||
|
||||
if @status_order == 'order' && @status_sale != 'sale'
|
||||
unless @order_items.nil?
|
||||
unless @order_items.nil? || @order_items.empty?
|
||||
count = 0
|
||||
@order_items.each do |order_item|
|
||||
count += 1
|
||||
sub_total = sub_total + (order_item.price * order_item.qty)
|
||||
|
||||
unless order_item.price == 0 %>
|
||||
# unless order_item.price == 0 %>
|
||||
<tr>
|
||||
<td><%= count %></td>
|
||||
<td class='item-name'><%= order_item.item_name %></td>
|
||||
@@ -244,7 +253,7 @@
|
||||
</tr>
|
||||
<%
|
||||
|
||||
end
|
||||
# end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -257,7 +266,7 @@
|
||||
<table class="table" id="order-charges-table" border="0">
|
||||
<tr>
|
||||
<td class="charges-name"><strong>Sub Total:</strong></td>
|
||||
<td class="item-attr"><strong id="order-sub-total"><%= sub_total %></strong></td>
|
||||
<td class="item-attr"><strong id="sub-total"><%= sub_total %></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<% if @obj_sale != nil && @obj_sale.discount_type == 'member_discount' %>
|
||||
@@ -284,7 +293,8 @@
|
||||
<tr>
|
||||
<td class="charges-name"><strong>Rounding Adj:</strong></td>
|
||||
<td class="item-attr">
|
||||
<strong id="order-round-adj"><%= @obj_sale.rounding_adjustment rescue 0 %></strong></td>
|
||||
<strong id="order-round-adj"><%= @obj_sale.rounding_adjustment
|
||||
%></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="charges-name"><strong>Grand Total:</strong></td>
|
||||
@@ -298,7 +308,7 @@
|
||||
|
||||
<%
|
||||
if @status_sale == 'sale'
|
||||
unless @order_items.nil?
|
||||
unless @order_items.nil? || @order_items.empty?
|
||||
%>
|
||||
Pending New Order
|
||||
<table class="table table-striped">
|
||||
@@ -359,6 +369,7 @@
|
||||
<%= t("views.btn.back") %>
|
||||
</button>
|
||||
<button type="button" id="add_order" class="btn btn-block bg-blue waves-effect"><%= t("views.btn.add") %> <%= t("views.right_panel.detail.order") %></button>
|
||||
<% if current_login_employee.role != "waiter" %>
|
||||
<button type="button" id="survey" class="btn btn-block bg-blue waves-effect"><%= t("views.right_panel.detail.survey") %></button>
|
||||
<% if @dining.status != "available" %>
|
||||
<% if @status_order == 'order' && @status_sale != 'sale' %>
|
||||
@@ -374,14 +385,20 @@
|
||||
<% end %>
|
||||
<% if @status_sale == 'sale' %>
|
||||
<button type="button" id="customer" class="btn btn-block bg-blue waves-effect">Customer</button>
|
||||
<button type="button" class="btn btn-block bg-blue waves-effect" id='edit'>Edit</button>
|
||||
<button type="button" class="btn btn-block bg-blue waves-effect" id='edit' active="<%= can? :edit, :sale_edit %>">Edit</button>
|
||||
<button type="button" id="discount" class="btn btn-block bg-blue waves-effect">Discount</button>
|
||||
<button type="button" id="other-charges" class="btn btn-block bg-blue waves-effect">Charges</button>
|
||||
|
||||
<button type="button" id="commissions" class="btn btn-block bg-blue waves-effect">Commissions</button>
|
||||
<button type="button" id="in_duties" class="btn btn-block bg-blue waves-effect">In Duties</button>
|
||||
<button type="button" id="first_bill" class="btn btn-block bg-blue waves-effect">First Bill</button>
|
||||
|
||||
<%if @membership.discount && @obj_sale.customer.membership_id %>
|
||||
<button type="button" class="btn btn-block bg-blue waves-effect" data-toggle="modal" data-target="#paymentModal">First Bill</button>
|
||||
<%else%>
|
||||
<button type="button" id="first_bill" class="btn btn-block bg-blue waves-effect">First Bill</button>
|
||||
<%end%>
|
||||
<button type="button" id="pay" class="btn btn-block bg-blue waves-effect">Pay</button>
|
||||
<button type="button" id="void" class="btn btn-block bg-blue waves-effect"> Void</button>
|
||||
<button type="button" id="void" class="btn btn-block bg-blue waves-effect" active="<%= can? :overall_void, :void %>"> Void</button>
|
||||
<% end %>
|
||||
<!-- Cashier Buttons -->
|
||||
|
||||
@@ -389,11 +406,51 @@
|
||||
<% else %>
|
||||
<button type="button" id="check_in" class="btn btn-block bg-blue waves-effect"><%= t("views.btn.check_in") %></button>
|
||||
<% end %>
|
||||
<span class="hidden" id="member_discount"><%= @membership.discount%></span>
|
||||
<span class="hidden" id="membership_id"><%= @obj_sale.customer.membership_id rescue 0%></span>
|
||||
<div class="modal fade" id="paymentModal" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="paymentModalLabel">Choose Payment</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<select class="form-control show-tick payment_method" id="payment_method" >
|
||||
<option value="Cash">Cash</option>
|
||||
<% @payment_methods.each do |pay| %>
|
||||
<option value="<%= pay.payment_method %>">
|
||||
<%= pay.payment_method %>
|
||||
</option>
|
||||
<%end %>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
<div class="modal-footer p-r-30">
|
||||
<button type="button" class="btn btn-link btn-danger waves-effect" data-dismiss="modal">CLOSE</button>
|
||||
|
||||
<button type="button" class="btn btn-link bg-blue waves-effect choose_payment">SAVE</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
/* start check first bill or not*/
|
||||
var receipt_no = "";
|
||||
if(($("#receipt_no").html()!=undefined) && ($("#receipt_no").html()!="")){
|
||||
receipt_no = ($("#receipt_no").html()).trim();
|
||||
}
|
||||
// console.log(checkReceiptNoInFirstBillData(receipt_no));
|
||||
if(checkReceiptNoInFirstBillData(receipt_no,"")){
|
||||
$("#pay").show();
|
||||
}else{
|
||||
$("#pay").hide();
|
||||
}
|
||||
/* end check first bill or not*/
|
||||
|
||||
$('.invoicedetails').on('click', function () {
|
||||
var dining_id = "<%= @dining.id %>";
|
||||
@@ -482,7 +539,7 @@
|
||||
window.location.href = '/origami/' + sale_id + '/other_charges'
|
||||
}
|
||||
else {
|
||||
alert("Please select an table!");
|
||||
swal ( "Oops" , "Please select an table!" , "warning" );
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -501,13 +558,12 @@
|
||||
window.location.href = '/origami/' + sale_id + '/discount'
|
||||
}
|
||||
else {
|
||||
alert("Please select an table!");
|
||||
swal ( "Oops" , "Please select an table!" , "warning" );
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
// Print for first bill
|
||||
$("#first_bill").on('click', function () {
|
||||
var sale_id = $('#sale_id').val();
|
||||
@@ -517,24 +573,68 @@
|
||||
type: "GET",
|
||||
url: ajax_url,
|
||||
success: function (result) {
|
||||
location.reload();
|
||||
receipt_no = ($("#receipt_no").html()).trim();
|
||||
if((receipt_no!=undefined) && (receipt_no!=""))
|
||||
createReceiptNoInFirstBillData(receipt_no,"");
|
||||
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
$(".choose_payment").on('click', function () {
|
||||
$( "#loading_wrapper").show();
|
||||
|
||||
var sale_id = $('#sale_id').val();
|
||||
type = $('.payment_method').val();
|
||||
|
||||
calculate_member_discount(sale_id,type);
|
||||
|
||||
var ajax_url = "/origami/sale/" + sale_id + "/first_bill";
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: ajax_url,
|
||||
success: function (result) {
|
||||
$( "#loading_wrapper" ).hide();
|
||||
receipt_no = ($("#receipt_no").html()).trim();
|
||||
if((receipt_no!=undefined) && (receipt_no!=""))
|
||||
createReceiptNoInFirstBillData(receipt_no,type);
|
||||
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
});
|
||||
function calculate_member_discount(sale_id,type) {
|
||||
var sub_total = $('#sub-total').text();
|
||||
if (type == "Cash") {
|
||||
is_card = false
|
||||
}else{
|
||||
is_card = true
|
||||
}
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/origami/" + sale_id + "/member_discount",
|
||||
data: {'sale_id':sale_id, 'sub_total':sub_total,'is_card':is_card },
|
||||
async: false,
|
||||
success:function(result){
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
// $('#pay').on('click', function () {
|
||||
// var sale_id = $('#sale_id').val();
|
||||
// var url = '/origami/sale/' + sale_id + "/rounding_adj";
|
||||
// $.ajax({
|
||||
// type: "POST",
|
||||
// url: '/origami/sale/' + sale_id + "/rounding_adj",
|
||||
// success: function (result) {
|
||||
// window.location.href = '/origami/sale/' + sale_id + "/payment";
|
||||
// }
|
||||
// });
|
||||
// });
|
||||
$('#pay').on('click', function () {
|
||||
var sale_id = $('#sale_id').val();
|
||||
|
||||
var url = '/origami/sale/' + sale_id + "/rounding_adj";
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: '/origami/sale/' + sale_id + "/rounding_adj",
|
||||
success: function (result) {
|
||||
window.location.href = '/origami/sale/' + sale_id + "/payment";
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
window.location.href = '/origami/sale/' + sale_id + "/payment";
|
||||
});
|
||||
|
||||
// Bill Request
|
||||
@@ -546,18 +646,19 @@
|
||||
url: ajax_url,
|
||||
// data: 'order_id='+ order_id,
|
||||
success: function (result) {
|
||||
|
||||
if (!result.status) {
|
||||
swal("Information!", result.error_message);
|
||||
}
|
||||
else {
|
||||
location.reload();
|
||||
else {
|
||||
location.reload();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#move').on('click', function () {
|
||||
var dining_id = "<%= @dining.id %>"
|
||||
var dining_id = "<%= @dining.id %>";
|
||||
window.location.href = '/origami/table/' + dining_id + "/movetable";
|
||||
})
|
||||
|
||||
@@ -574,8 +675,16 @@
|
||||
url: ajax_url,
|
||||
data: 'dining_id=' + dining_id + "&sale_id=" + sale_id,
|
||||
success: function (result) {
|
||||
alert("Invoice updated")
|
||||
swal({
|
||||
title: "Information!",
|
||||
text: "Invoice updated",
|
||||
html: true,
|
||||
closeOnConfirm: false,
|
||||
closeOnCancel: false,
|
||||
allowOutsideClick: false
|
||||
}, function () {
|
||||
window.location.reload();
|
||||
});
|
||||
}
|
||||
});
|
||||
})
|
||||
@@ -617,7 +726,12 @@
|
||||
$('#edit').on('click', function () {
|
||||
var dining_id = "<%= @dining.id %>"
|
||||
var sale_id = "<%= @obj_sale.sale_id rescue "" %>"
|
||||
window.location.href = '/origami/table/' + dining_id + "/sale/" + sale_id + "/edit";
|
||||
if ($(this).attr('active')=== "true") {
|
||||
window.location.href = '/origami/table/' + dining_id + "/sale/" + sale_id + "/edit";
|
||||
}else{
|
||||
swal("Opps","You are not authorized for void","warning")
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$('#commissions').on('click', function () {
|
||||
@@ -632,6 +746,7 @@
|
||||
});
|
||||
|
||||
$('#void').on('click', function () {
|
||||
if ($(this).attr('active')=== "true") {
|
||||
swal({
|
||||
title: "Alert",
|
||||
text: "Are you sure want to Void?",
|
||||
@@ -652,7 +767,10 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}else{
|
||||
swal("Opps","You are not authorized for void","warning")
|
||||
}
|
||||
});
|
||||
|
||||
$('#add_order').on('click', function () {
|
||||
@@ -666,7 +784,7 @@
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
data: {dining_id : dining_id},
|
||||
data: {'dining_id' : dining_id},
|
||||
datatype: 'JSON',
|
||||
url: '/origami/check_in',
|
||||
success: function(data) {
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
<div class="row">
|
||||
<div class="form-group col-lg-12 col-md-12 col-sm-12">
|
||||
<label>You can pay up to </label>
|
||||
<%@can_jcb = @can_jcb +@rounding_adj%>
|
||||
<input type="text" name="validamount" id="validamount" class="form-control col-lg-7 col-md-7 col-sm-7" readonly="" value="<%=@can_jcb %>" data-member-value="">
|
||||
</div>
|
||||
<hr>
|
||||
@@ -160,19 +161,20 @@ $('#jcb_pay').on('click',function(){
|
||||
var amount = $('#amount').text();
|
||||
var sale_id = "<%= @sale_id %>";
|
||||
if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){
|
||||
//start member discount 5% by pay card
|
||||
var sub_total = $('#sub-total').text();
|
||||
var member_id = $('#membership_id').text();
|
||||
var member_discount = $('#member_discount').text();
|
||||
if (member_id && member_discount) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/origami/" + sale_id + "/member_discount",
|
||||
data: {'sale_id':sale_id, 'sub_total':sub_total,'is_card':true },
|
||||
// success:function(result){
|
||||
// }
|
||||
});
|
||||
}
|
||||
$(this).off("click");
|
||||
//start member discount 5% by pay card
|
||||
// var sub_total = $('#sub-total').text();
|
||||
// var member_id = $('#membership_id').text();
|
||||
// var member_discount = $('#member_discount').text();
|
||||
// if (member_id && member_discount) {
|
||||
// $.ajax({
|
||||
// type: "POST",
|
||||
// url: "/origami/" + sale_id + "/member_discount",
|
||||
// data: {'sale_id':sale_id, 'sub_total':sub_total,'is_card':true },
|
||||
// success:function(result){
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
//end member discount
|
||||
$.ajax({type: "POST",
|
||||
url: "<%= origami_payment_jcb_path %>",
|
||||
@@ -182,6 +184,10 @@ $('#jcb_pay').on('click',function(){
|
||||
swal({
|
||||
title: "Information!",
|
||||
text: "Payment Successfully",
|
||||
html: true,
|
||||
closeOnConfirm: false,
|
||||
closeOnCancel: false,
|
||||
allowOutsideClick: false
|
||||
},function () {
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment";
|
||||
});
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
<div class="row">
|
||||
<div class="form-group col-lg-12 col-md-12 col-sm-12">
|
||||
<label>You can pay up to </label>
|
||||
<%@can_master = @can_master +@rounding_adj%>
|
||||
<input type="text" name="validamount" id="validamount" class="form-control col-lg-7 col-md-7 col-sm-7" readonly="" value="<%=@can_master %>" data-member-value="">
|
||||
</div>
|
||||
<hr>
|
||||
@@ -157,19 +158,20 @@
|
||||
var amount = $('#amount').text();
|
||||
var sale_id = "<%= @sale_id %>";
|
||||
if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){
|
||||
$(this).off("click");
|
||||
//start member discount 5% by pay card
|
||||
var sub_total = $('#sub-total').text();
|
||||
var member_id = $('#membership_id').text();
|
||||
var member_discount = $('#member_discount').text();
|
||||
if (member_id && member_discount) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/origami/" + sale_id + "/member_discount",
|
||||
data: {'sale_id':sale_id, 'sub_total':sub_total,'is_card':true },
|
||||
// success:function(result){
|
||||
// }
|
||||
});
|
||||
}
|
||||
// var sub_total = $('#sub-total').text();
|
||||
// var member_id = $('#membership_id').text();
|
||||
// var member_discount = $('#member_discount').text();
|
||||
// if (member_id && member_discount) {
|
||||
// $.ajax({
|
||||
// type: "POST",
|
||||
// url: "/origami/" + sale_id + "/member_discount",
|
||||
// data: {'sale_id':sale_id, 'sub_total':sub_total,'is_card':true },
|
||||
// // success:function(result){
|
||||
// // }
|
||||
// });
|
||||
// }
|
||||
//end member discount
|
||||
$.ajax({type: "POST",
|
||||
url: "<%= origami_payment_master_path %>",
|
||||
@@ -179,6 +181,10 @@
|
||||
swal({
|
||||
title: "Information!",
|
||||
text: "Payment Successfully",
|
||||
html: true,
|
||||
closeOnConfirm: false,
|
||||
closeOnCancel: false,
|
||||
allowOutsideClick: false
|
||||
},function () {
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment";
|
||||
});
|
||||
|
||||
@@ -21,7 +21,8 @@
|
||||
<div class="row">
|
||||
<div class="form-group col-lg-12 col-md-12 col-sm-12">
|
||||
<label>You can pay up to </label>
|
||||
<input type="text" name="validamount" id="validamount" class="form-control col-lg-7 col-md-7 col-sm-7" readonly="" value="<%=@can_mpu %>" data-member-value="">
|
||||
<%@can_mpu = @can_mpu +@rounding_adj%>
|
||||
<input type="text" name="validamount" id="validamount" class="form-control col-lg-7 col-md-7 col-sm-7" readonly="" value="<%= @can_mpu %>" data-member-value="">
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
@@ -160,19 +161,20 @@
|
||||
var amount = $('#amount').text();
|
||||
var sale_id = "<%= @sale_id %>";
|
||||
if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){
|
||||
$(this).off("click");
|
||||
//start member discount 5% by pay card
|
||||
var sub_total = $('#sub-total').text();
|
||||
var member_id = $('#membership_id').text();
|
||||
var member_discount = $('#member_discount').text();
|
||||
if (member_id && member_discount) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/origami/" + sale_id + "/member_discount",
|
||||
data: {'sale_id':sale_id, 'sub_total':sub_total,'is_card':true },
|
||||
// success:function(result){
|
||||
// }
|
||||
});
|
||||
}
|
||||
// var sub_total = $('#sub-total').text();
|
||||
// var member_id = $('#membership_id').text();
|
||||
// var member_discount = $('#member_discount').text();
|
||||
// if (member_id && member_discount) {
|
||||
// $.ajax({
|
||||
// type: "POST",
|
||||
// url: "/origami/" + sale_id + "/member_discount",
|
||||
// data: {'sale_id':sale_id, 'sub_total':sub_total,'is_card':true },
|
||||
// success:function(result){
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
//end member discount
|
||||
//Mpu Payment
|
||||
$.ajax({type: "POST",
|
||||
@@ -183,6 +185,10 @@
|
||||
swal({
|
||||
title: "Information!",
|
||||
text: "Payment Successfully",
|
||||
html: true,
|
||||
closeOnConfirm: false,
|
||||
closeOnCancel: false,
|
||||
allowOutsideClick: false
|
||||
}, function () {
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment";
|
||||
});
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<div><strong id="order-title">ORDER DETAILS</strong></div>
|
||||
</div> -->
|
||||
<div class="card-block">
|
||||
<div class="card-title row">
|
||||
<div class="row card-title">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||
<p id="sale-id" class="hidden"><%=@sale_data.sale_id %></p>
|
||||
<p>Receipt No: <span id="receipt_no"><%=@sale_data.receipt_no rescue ' '%></span></p>
|
||||
@@ -95,12 +95,17 @@
|
||||
<div class="card-title">
|
||||
<div class="form-horizontal">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
|
||||
<div class="-group">
|
||||
<input type="text" id="other-charges-amount" name="other-charges-amount" class="form-control" placeholder="Amount" />
|
||||
<div class="bottom-5">
|
||||
<input type="text" id="other-charges-amount" name="other-charges-amount" class="form-control" placeholder="Amount" onkeypress="return isNumberKey(event);" />
|
||||
<br><span id="other-charges-amountErr" style="color:red;"></span>
|
||||
</div>
|
||||
<div class="-group">
|
||||
<div class="bottom-5">
|
||||
<textarea id="reasons" name="reasons" rows="2" class="form-control" placeholder="Reasons"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom-5">
|
||||
<input type="checkbox" id="is_taxable" name="is_taxable" />
|
||||
<lable for="is_taxable">Is Taxable</lable>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -199,7 +204,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
$(document).ready(function(){
|
||||
$(".cashier_number").on('click', function(event){
|
||||
if(event.handled !== true) {
|
||||
var original_value=0;
|
||||
@@ -270,12 +275,23 @@
|
||||
var sub_total = $('#order-sub-total').text();
|
||||
var charge_amount = $("#other-charges-amount").val();
|
||||
var reasons = $("#reasons").val();
|
||||
var is_taxable = 0
|
||||
if ($("#is_taxable:checked").length > 0) {
|
||||
is_taxable = 1
|
||||
}
|
||||
$("#other-charges-amountErr").html("");
|
||||
if(charge_amount != ""){
|
||||
$("#other-charges-amount").val("");
|
||||
$("#reasons").val("");
|
||||
// Update sub total
|
||||
$('#order-sub-total').text(parseFloat(sub_total) + parseFloat(charge_amount));
|
||||
|
||||
// Update sub total
|
||||
$('#order-sub-total').text(parseFloat(sub_total) + parseFloat(charge_amount));
|
||||
|
||||
var item_row = item_row_template(sale_id, charge_amount, reasons);
|
||||
$("#order-items-table tbody").append(item_row);
|
||||
var item_row = item_row_template(sale_id, charge_amount, reasons, is_taxable);
|
||||
$("#order-items-table tbody").append(item_row);
|
||||
}
|
||||
else{
|
||||
$("#other-charges-amountErr").html("can't be blank");
|
||||
}
|
||||
});
|
||||
|
||||
// Calculate Other Charges for Payment
|
||||
@@ -323,13 +339,14 @@
|
||||
var sale_item = {};
|
||||
sale_item.id = $(this).attr('id');
|
||||
sale_item.name = $(this).find('#item-name-price').text();
|
||||
sale_item.price = $(this).find('#item-total-price').text();
|
||||
sale_item.price = $(this).find('#item-total-price').text()
|
||||
sale_item.is_taxable = $(this).find('#item_taxable').text();
|
||||
sale_items.push(sale_item);
|
||||
});
|
||||
return sale_items;
|
||||
}
|
||||
|
||||
function item_row_template(sale_id, charge_amount, reasons){
|
||||
function item_row_template(sale_id, charge_amount, reasons, is_taxable){
|
||||
var item_row = "<tr class='other-item-row' id='SLI-000000000000'>" +
|
||||
"<td style='width: 60%; text-align: left;'>" +
|
||||
"<span id='item_account_type' class='hidden'>" +
|
||||
@@ -338,6 +355,7 @@
|
||||
"<span id='item-name-price'>" +
|
||||
reasons +
|
||||
"</span>" +
|
||||
"<span id='item_taxable' class='hidden'>" + is_taxable + "</span>" +
|
||||
"</td>" +
|
||||
"<td style='width: 20%; text-align: right;'>" +
|
||||
"<span id='item-qty'>1</span>" +
|
||||
@@ -351,4 +369,13 @@
|
||||
return item_row;
|
||||
}
|
||||
|
||||
function isNumberKey(evt) {
|
||||
var charCode = (evt.which) ? evt.which : event.keyCode;
|
||||
if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57)) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="charges-name"><strong>Rounding Adj:</strong></td>
|
||||
<td class="item-attr"><strong><span><%=@sale_data.rounding_adjustment rescue 0%></span></strong></td>
|
||||
<td class="item-attr"><strong><%= @sale_data.rounding_adjustment rescue 0%></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="charges-name"><strong>Grand Total</strong></td>
|
||||
@@ -109,7 +109,7 @@
|
||||
</tfooter>
|
||||
</table>
|
||||
</div>
|
||||
<!-- <div> -->
|
||||
<!-- <div> -->
|
||||
<!-- <INPUT TYPE="Button" class='btn btn-primary' VALUE="Reprint" onClick="" style='width:120px'/>
|
||||
<INPUT TYPE="Submit" class='btn btn-primary' VALUE="CANCEL" action="origami/index" style='width:120px'/> -->
|
||||
<!-- </div> -->
|
||||
@@ -121,7 +121,11 @@
|
||||
<div class="card-header">
|
||||
<div class="row m-l-5 m-r-5">
|
||||
<div class="col-md-8"><strong>Amount Due</strong></div>
|
||||
<div class="col-md-4"><strong><span id="amount_due"><%= @sale_data.grand_total %></span></strong></div>
|
||||
<div class="col-md-4">
|
||||
<strong>
|
||||
<span id="grand_total" class="hidden"><%= @sale_data.grand_total rescue 0%></span>
|
||||
<span id="amount_due"><%= @sale_data.grand_total rescue 0%></span></strong>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row payment cash-color p-l-5 p-r-5">
|
||||
@@ -219,7 +223,7 @@
|
||||
<!-- <br> -->
|
||||
<div class="row m-l-5 m-r-5">
|
||||
<div class="col-md-8"><strong>Balance</strong></div>
|
||||
<div class="col-md-4"><strong><span id='balance'><%= @sale_data.grand_total %></span></strong></div>
|
||||
<div class="col-md-4"><strong><span id='balance'><%= @sale_data.grand_total rescue 0 %></span></strong></div>
|
||||
</div>
|
||||
<!-- <br> -->
|
||||
</div>
|
||||
@@ -276,8 +280,8 @@
|
||||
<i class="material-icons">reply</i>
|
||||
Back
|
||||
</button>
|
||||
<button type="button" class="btn bg-deep-purple btn-block" id="foc"> FOC </button>
|
||||
<button type="button" class="btn bg-red btn-block" id="void"> Void </button>
|
||||
<button type="button" class="btn bg-deep-purple btn-block" id="foc" active="<%= can? :foc, :payment %>"> FOC </button>
|
||||
<button type="button" class="btn bg-red btn-block" id="void" active="<%= can? :overall_void, :void %>"> Void </button>
|
||||
<!-- Waiter Buttons -->
|
||||
</div>
|
||||
|
||||
@@ -286,6 +290,21 @@
|
||||
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
/* start check first bill or not*/
|
||||
var receipt_no = "";
|
||||
if(($("#receipt_no").html()!=undefined) && ($("#receipt_no").html()!="")){
|
||||
receipt_no = ($("#receipt_no").html()).trim();
|
||||
}
|
||||
|
||||
payment_type = checkReceiptNoInFirstBillData(receipt_no,"payment")
|
||||
if(payment_type=="Cash"){
|
||||
$("#card_payment").hide();
|
||||
$("#credit_payment").hide();
|
||||
}else if(payment_type=="Credit"){
|
||||
$("#card_payment").hide();
|
||||
}
|
||||
|
||||
/* end check first bill or not*/
|
||||
var dining_id = "<%= @sale_data.bookings[0].dining_facility_id %>";
|
||||
|
||||
$("#back").on('click', function() {
|
||||
@@ -359,95 +378,128 @@
|
||||
});
|
||||
|
||||
$( document ).ready(function() {
|
||||
// Disable click event cash to prevent
|
||||
$(".payment .cash-color").off('click');
|
||||
// Disable click event cash to prevent
|
||||
$(".payment .cash-color").off('click');
|
||||
|
||||
$('#credit_payment').click(function() {
|
||||
var sale_id = $('#sale_id').text();
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment/credit_payment"
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#card_payment').click(function() {
|
||||
localStorage.setItem("cash",$('#cash').text() );
|
||||
var sale_id = $('#sale_id').text();
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment/others_payment"
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#pay').click(function() {
|
||||
$('#pay').text("Processing, Please wait!")
|
||||
|
||||
$( "#loading_wrapper" ).show();
|
||||
|
||||
if($('#balance').text() > 0){
|
||||
swal ( "Oops" , "Insufficient Amount!" , "error" );
|
||||
$( "#loading_wrapper" ).hide();
|
||||
}else{
|
||||
var sale_id = $('#sale_id').text();
|
||||
var item_row = $('.is_card');
|
||||
if (item_row.length < 1) {
|
||||
calculate_member_discount(sale_id);
|
||||
}
|
||||
|
||||
// payment
|
||||
var cash = $('#cash').text();
|
||||
var credit = $('#credit').text();
|
||||
var card = $('#card').text();
|
||||
|
||||
$.ajax({type: "POST",
|
||||
url: "<%= origami_payment_cash_path %>",
|
||||
data: "cash="+ cash + "&sale_id=" + sale_id,
|
||||
async: false,
|
||||
success:function(result){
|
||||
|
||||
localStorage.removeItem("cash");
|
||||
if (result.status) {
|
||||
var msg = result.message;
|
||||
}
|
||||
else{
|
||||
var msg = '';
|
||||
}
|
||||
$( "#loading_wrapper" ).hide();
|
||||
if($('#balance').text() < 0){
|
||||
swal({
|
||||
title: "Information!",
|
||||
text: 'Changed amount ' + $('#balance').text() * (-1),
|
||||
}, function () {
|
||||
window.location.href = '/origami';
|
||||
});
|
||||
}else{
|
||||
$('#pay').text("Pay");
|
||||
swal({
|
||||
title: "Information!",
|
||||
text: 'Thank You !',
|
||||
}, function () {
|
||||
window.location.href = '/origami';
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
$('#credit_payment').click(function() {
|
||||
var sale_id = $('#sale_id').text();
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment/credit_payment"
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#void').on('click',function () {
|
||||
swal({
|
||||
title: "Information!",
|
||||
text: 'Are you sure want to Void !',
|
||||
}, function () {
|
||||
var sale_id = $('#sale_id').text();
|
||||
var ajax_url = "/origami/sale/" + sale_id + '/void';
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: ajax_url,
|
||||
success: function () {
|
||||
window.location.href = '/origami/';
|
||||
}
|
||||
})
|
||||
});
|
||||
});
|
||||
$('#card_payment').click(function() {
|
||||
localStorage.setItem("cash",$('#cash').text() );
|
||||
var sale_id = $('#sale_id').text();
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment/others_payment"
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
$('#pay').click(function() {
|
||||
sub_total = $('#sub-total').text();
|
||||
if (payment_type == 'MPU' && $('.mpu').text() == 0 && sub_total != 0.0) {
|
||||
swal("Opps","Please Pay with MPU Payment","warning");
|
||||
}else if(payment_type == "Redeem" && $('#ppamount').text()==0 && sub_total != 0.0){
|
||||
swal("Opps","Please Pay with Redeem Payment","warning");
|
||||
}else if(payment_type == "VISA" && $('#visacount').text()==0 && sub_total != 0.0){
|
||||
swal("Opps","Please Pay with Visa Payment","warning");
|
||||
|
||||
}else if(payment_type == "JCB" && $('#jcbcount').text()==0 && sub_total != 0.0){
|
||||
swal("Opps","Please Pay with jcb Payment","warning");
|
||||
}
|
||||
else if(payment_type == "Master" && $('#mastercount').text()==0 && sub_total != 0.0){
|
||||
swal("Opps","Please Pay with Master Payment","warning");
|
||||
}else{
|
||||
|
||||
$( "#loading_wrapper").show();
|
||||
if($('#balance').text() > 0){
|
||||
swal ( "Oops", "Insufficient Amount!" , "error" );
|
||||
$("#loading_wrapper").hide();
|
||||
}else{
|
||||
$(this).off("click");
|
||||
var sale_id = $('#sale_id').text();
|
||||
// var item_row = $('.is_card');
|
||||
|
||||
// if (item_row.length < 1) {
|
||||
calculate_member_discount(sale_id);
|
||||
// }
|
||||
|
||||
// payment
|
||||
var cash = $('#cash').text();
|
||||
var credit = $('#credit').text();
|
||||
var card = $('#card').text();
|
||||
|
||||
$.ajax({type: "POST",
|
||||
url: "<%= origami_payment_cash_path %>",
|
||||
data: "cash="+ cash + "&sale_id=" + sale_id,
|
||||
async: false,
|
||||
success:function(result){
|
||||
/* start delete receipt no in first bill*/
|
||||
if(($("#receipt_no").html()!=undefined) && ($("#receipt_no").html()!="")){
|
||||
var receipt_no = ($("#receipt_no").html()).trim();
|
||||
deleteReceiptNoInFirstBillData(receipt_no);
|
||||
}
|
||||
/* end delete receipt no in first bill*/
|
||||
|
||||
localStorage.removeItem("cash");
|
||||
if (result.status) {
|
||||
var msg = result.message;
|
||||
}
|
||||
else{
|
||||
var msg = '';
|
||||
}
|
||||
$( "#loading_wrapper" ).hide();
|
||||
if($('#balance').text() < 0){
|
||||
swal({
|
||||
title: "Information!",
|
||||
text: 'Changed amount ' + $('#balance').text() * (-1),
|
||||
html: true,
|
||||
closeOnConfirm: false,
|
||||
closeOnCancel: false,
|
||||
allowOutsideClick: false
|
||||
}, function () {
|
||||
window.location.href = '/origami';
|
||||
});
|
||||
}else{
|
||||
$('#pay').text("Pay");
|
||||
swal({
|
||||
title: "Information!",
|
||||
text: 'Thank You !',
|
||||
html: true,
|
||||
closeOnConfirm: false,
|
||||
closeOnCancel: false,
|
||||
allowOutsideClick: false
|
||||
}, function () {
|
||||
window.location.href = '/origami';
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('#void').on('click',function () {
|
||||
if ($(this).attr('active') === "true") {
|
||||
swal({
|
||||
title: "Information!",
|
||||
text: 'Are you sure want to Void !',
|
||||
}, function () {
|
||||
var sale_id = $('#sale_id').text();
|
||||
var ajax_url = "/origami/sale/" + sale_id + '/void';
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: ajax_url,
|
||||
success: function () {
|
||||
window.location.href = '/origami/';
|
||||
}
|
||||
})
|
||||
});
|
||||
}else{
|
||||
swal("Opps","You are not authorized for void","warning")
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
function update_balance(){
|
||||
var cash = $('#cash').text();
|
||||
@@ -464,21 +516,23 @@
|
||||
}
|
||||
|
||||
$('#foc').click(function() {
|
||||
$( "#loading_wrapper" ).show();
|
||||
//$( "#loading_wrapper" ).show();
|
||||
// payment
|
||||
var cash = $('#amount_due').text();
|
||||
var cash = $('#grand_total').text();
|
||||
var sub_total = $('#sub-total').text();
|
||||
var sale_id = $('#sale_id').text();
|
||||
var params = { 'cash':cash,'sale_id':sale_id,'sub_total':sub_total };
|
||||
|
||||
$.ajax({type: "POST",
|
||||
if ($(this).attr('active')=== "true") {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "<%= origami_payment_foc_path %>",
|
||||
data: params,
|
||||
success:function(result){
|
||||
|
||||
$( "#loading_wrapper" ).hide();
|
||||
//$( "#loading_wrapper" ).hide();
|
||||
|
||||
if (cash > 0) {
|
||||
if (cash >= 0) {
|
||||
swal({
|
||||
title: "Information!",
|
||||
text: 'Thank You !',
|
||||
@@ -489,21 +543,29 @@
|
||||
|
||||
}
|
||||
});
|
||||
}else{
|
||||
swal("Opps","You are not authorized for foc","warning")
|
||||
}
|
||||
});
|
||||
|
||||
function calculate_member_discount(sale_id) {
|
||||
var sub_total = $('#sub-total').text();
|
||||
var member_id = $('#membership_id').text();
|
||||
var member_discount = $('#member_discount').text();
|
||||
var item_row = $('.is_card');
|
||||
|
||||
if (member_id && member_discount) {
|
||||
if (item_row.length < 1) {
|
||||
is_card = false
|
||||
}else{
|
||||
is_card = true
|
||||
}
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/origami/" + sale_id + "/member_discount",
|
||||
data: {'sale_id':sale_id, 'sub_total':sub_total,'is_card':false },
|
||||
data: {'sale_id':sale_id, 'sub_total':sub_total,'is_card':is_card },
|
||||
async: false,
|
||||
success:function(result){
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
<div class="row">
|
||||
<div class="form-group col-lg-12 col-md-12 col-sm-12">
|
||||
<label class="">You can redeem up to </label>
|
||||
<%@redeem_prices = @redeem_prices +@rounding_adj%>
|
||||
<input type="text" name="" id="redeemamt" class="form-control col-lg-7 col-md-7 col-sm-7" readonly="" value="<%= @redeem_prices %>" data-value="<%=@sale_id %>" data-member-value="<%= @membership_id %>">
|
||||
</div>
|
||||
<hr>
|
||||
@@ -146,7 +147,7 @@
|
||||
$('#used_amount').text(cash.substr(0,cash.length-1));
|
||||
break;
|
||||
case 'nett':
|
||||
var remain_amount = $('#valid_amount').val();
|
||||
var remain_amount = $('#redeemamt').val();
|
||||
$('#used_amount').text(remain_amount);
|
||||
break;
|
||||
|
||||
@@ -168,6 +169,7 @@
|
||||
swal ( "Oops" , "Insufficient Amount!" , "warning" );
|
||||
}else{
|
||||
if(redeem_amount <= "<%= @redeem_prices %>"){
|
||||
$(this).off("click");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "<%=origami_payment_paypar_path%>",
|
||||
@@ -178,6 +180,10 @@
|
||||
swal({
|
||||
title: "Information!",
|
||||
text: result.message,
|
||||
html: true,
|
||||
closeOnConfirm: false,
|
||||
closeOnCancel: false,
|
||||
allowOutsideClick: false
|
||||
}, function () {
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment"
|
||||
});
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
<div class="container-fluid">
|
||||
<div id="loading_wrapper" style="display:none;">
|
||||
<div id="loading"></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<!-- Column One -->
|
||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||
@@ -39,15 +42,23 @@
|
||||
<div class="card-columns">
|
||||
<% @tables.each do |table| %>
|
||||
<% if table.status == 'occupied' %>
|
||||
<% if table.get_booking.nil? %>
|
||||
<div class="card tables red text-white table_<%= table.id %>" data-id="<%= table.id %>">
|
||||
<% if table.get_booking.nil? %>
|
||||
<% if table.get_checkout_booking.nil? %>
|
||||
<div class="card tables red text-white table_<%= table.id %>" data-id="<%= table.id %>">
|
||||
<% else %>
|
||||
<div class="card tables orange text-white table_<%= table.id %>" data-id="<%= table.id %>">
|
||||
<% end %>
|
||||
<div class="card-block">
|
||||
<%= table.name %>
|
||||
<span class="pull-right font-12 new_text_<%= table.id %>"> billed</span>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="card tables blue text-white table_<%= table.id %>" data-id="<%= table.id %>">
|
||||
<% else %>
|
||||
<% if table.get_checkout_booking.nil? %>
|
||||
<div class="card tables blue text-white table_<%= table.id %>" data-id="<%= table.id %>">
|
||||
<% else %>
|
||||
<div class="card tables orange text-white table_<%= table.id %>" data-id="<%= table.id %>">
|
||||
<% end %>
|
||||
<div class="card-block">
|
||||
<%= table.name %>
|
||||
<span class="pull-right font-12 new_text_<%= table.id %>"> new</span>
|
||||
@@ -124,12 +135,20 @@
|
||||
<div class="card-header">
|
||||
<% if @status_order == 'order' %>
|
||||
<div id="save_order_id" data-order="<%= @obj_order.order_id %>"><strong id="order-title">ORDER DETAILS </strong> | Table <%= @room.name rescue "" %>
|
||||
<span class="float-right">Checkin Time : <%= @booking.checkin_at.utc.getlocal.strftime("%I:%M %p") %></span>
|
||||
<% if @booking.checkout_by.nil? && !@booking.reserved_by.nil? && %>
|
||||
<span class="float-right"><%= @booking.checkin_at.utc.getlocal.strftime("%I:%M %p") %> - <%= @booking.checkout_at.utc.getlocal.strftime("%I:%M %p") %></span>
|
||||
<% else %>
|
||||
<span class="float-right">Checkin Time : <%= @booking.checkin_at.utc.getlocal.strftime("%I:%M %p") %></span>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% elsif @status_sale == 'sale' %>
|
||||
<div><strong id="order-title">INVOICE DETAILS </strong> | Table <%= @room.name rescue "" %>
|
||||
<span class="float-right">Checkin Time : <%= @booking.checkin_at.utc.getlocal.strftime("%I:%M %p") %></span>
|
||||
<% if @booking.checkout_by.nil? && !@booking.reserved_by.nil? && %>
|
||||
<span class="float-right"><%= @booking.checkin_at.utc.getlocal.strftime("%I:%M %p") %> - <%= @booking.checkout_at.utc.getlocal.strftime("%I:%M %p") %></span>
|
||||
<% else %>
|
||||
<span class="float-right">Checkin Time : <%= @booking.checkin_at.utc.getlocal.strftime("%I:%M %p") %></span>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
@@ -167,7 +186,7 @@
|
||||
<div class="card-title row customer_detail p-l-5 p-r-5" >
|
||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||
<% if @status_sale == 'sale' %>
|
||||
<p class="hidden customer-id"><%= @obj_sale_sale.customer_id rescue '' %></p>
|
||||
<p class="hidden customer-id"><%= @obj_sale.customer_id rescue '' %></p>
|
||||
Customer : <%= @obj_sale.customer.name rescue '-' %>
|
||||
<%else%>
|
||||
<p class="hidden customer-id"><%= @obj_order.customer_id rescue "-" %></p>
|
||||
@@ -199,7 +218,7 @@
|
||||
<input type="hidden" id="sale_id" value="<%= @sale_array[0].sale_id %>">
|
||||
<%
|
||||
# Can't check for discount
|
||||
unless sale_item.price == 0
|
||||
# unless sale_item.price == 0
|
||||
count += 1
|
||||
%>
|
||||
<tr>
|
||||
@@ -211,18 +230,18 @@
|
||||
|
||||
<%
|
||||
|
||||
end
|
||||
# end
|
||||
end
|
||||
end
|
||||
|
||||
if @status_order == 'order' && @status_sale != 'sale'
|
||||
unless @order_items.nil?
|
||||
unless @order_items.nil? || @order_items.empty?
|
||||
count = 0
|
||||
@order_items.each do |order_item |
|
||||
count += 1
|
||||
sub_total = sub_total + (order_item.price * order_item.qty)
|
||||
|
||||
unless order_item.price == 0 %>
|
||||
# unless order_item.price == 0 %>
|
||||
<tr>
|
||||
<td><%= count %></td>
|
||||
<td class='item-name'><%= order_item.item_name %></td>
|
||||
@@ -231,7 +250,7 @@
|
||||
</tr>
|
||||
<%
|
||||
|
||||
end
|
||||
# end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -244,7 +263,7 @@
|
||||
<table class="table" id="order-charges-table" border="0">
|
||||
<tr>
|
||||
<td class="charges-name"><strong>Sub Total:</strong></td>
|
||||
<td class="item-attr"><strong id="order-sub-total"><%= sub_total %></strong></td>
|
||||
<td class="item-attr"><strong id="sub-total"><%= sub_total %></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<%if @obj_sale != nil && @obj_sale.discount_type == 'member_discount'%>
|
||||
@@ -275,7 +294,7 @@
|
||||
<br>
|
||||
<%
|
||||
if @status_sale == 'sale'
|
||||
unless @order_items.nil?
|
||||
unless @order_items.nil? || @order_items.empty?
|
||||
%>
|
||||
Pending New Order
|
||||
<table class="table table-striped">
|
||||
@@ -337,25 +356,61 @@
|
||||
<!-- <button type="button" class="btn bg-blue btn-block" disabled >Edit</button> -->
|
||||
<!-- <button type="button" id="discount" class="btn bg-blue btn-block" disabled >Discount</button> -->
|
||||
<!-- <button type="button" id="other-charges" class="btn bg-blue btn-block" disabled>Charges</button> -->
|
||||
<button type="button" id="customer" class="btn bg-blue btn-block" >Customer</button>
|
||||
<button type="button" class="btn bg-blue btn-block" id='move'>Move</button>
|
||||
<button type="button" id="request_bills" class="btn bg-blue btn-block">Req.Bill</button>
|
||||
<!-- <button type="button" id="first_bill" class="btn bg-blue btn-block" disabled>First Bill</button> -->
|
||||
<!-- <button type="button" id="pay" class="btn bg-blue btn-block" disabled>Pay</button> -->
|
||||
<!-- <button type="button" class="btn bg-blue btn-block" disabled=""> Void </button> -->
|
||||
<% else %>
|
||||
<% end %>
|
||||
<% if @status_sale == 'sale' %>
|
||||
<!-- <button type="button" class="btn bg-blue btn-block" disabled>Add Order</button> -->
|
||||
<button type="button" id="customer" class="btn bg-blue btn-block" >Customer</button>
|
||||
<button type="button" class="btn bg-blue btn-block" id='edit'>Edit</button>
|
||||
<button type="button" id="discount" class="btn bg-blue btn-block" >Discount</button>
|
||||
<button type="button" id="other-charges" class="btn bg-blue btn-block" >Charges</button>
|
||||
|
||||
<button type="button" id="commissions" class="btn btn-block bg-blue waves-effect">Commissions</button>
|
||||
<button type="button" id="in_duties" class="btn btn-block bg-blue waves-effect">In Duties</button>
|
||||
<!-- <button type="button" class="btn bg-blue btn-block" id='move' disabled="">Move</button> -->
|
||||
<!-- <button type="button" id="request_bills" class="btn bg-blue btn-block" disabled> Req.Bill</button> -->
|
||||
<button type="button" id="first_bill" class="btn bg-blue btn-block">First Bill</button>
|
||||
<%if @membership.discount && @obj_sale.customer.membership_id %>
|
||||
<button type="button" class="btn btn-block bg-blue waves-effect" data-toggle="modal" data-target="#paymentModal">First Bill</button>
|
||||
<%else%>
|
||||
<button type="button" id="first_bill" class="btn btn-block bg-blue waves-effect">First Bill</button>
|
||||
<%end%>
|
||||
<button type="button" id="pay" class="btn bg-blue btn-block">Pay</button>
|
||||
<button type="button" id="void" class="btn bg-blue btn-block" > Void </button>
|
||||
<% end %>
|
||||
|
||||
|
||||
<span class="hidden" id="member_discount"><%= @membership.discount%></span>
|
||||
<span class="hidden" id="membership_id"><%= @obj_sale.customer.membership_id rescue 0%></span>
|
||||
<div class="modal fade" id="paymentModal" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="paymentModalLabel">Choose Payment</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<select class="form-control show-tick payment_method" id="payment_method" >
|
||||
<option value="Cash">Cash</option>
|
||||
<% @payment_methods.each do |pay| %>
|
||||
<option value="<%= pay.payment_method %>">
|
||||
<%= pay.payment_method %>
|
||||
</option>
|
||||
<%end %>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
<div class="modal-footer p-r-30">
|
||||
<button type="button" class="btn btn-link btn-danger waves-effect" data-dismiss="modal">CLOSE</button>
|
||||
|
||||
<button type="button" class="btn btn-link bg-blue waves-effect choose_payment">SAVE</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Cashier Buttons -->
|
||||
|
||||
<!-- <button type="button" id="re-print" class="btn bg-blue btn-block" >Re.Print</button> -->
|
||||
@@ -394,6 +449,19 @@ $(document).ready(function(){
|
||||
// window.location.href = '/origami/order/' + order_id;
|
||||
// })
|
||||
|
||||
/* start check first bill or not*/
|
||||
var receipt_no = "";
|
||||
if(($("#receipt_no").html()!=undefined) && ($("#receipt_no").html()!="")){
|
||||
receipt_no = ($("#receipt_no").html()).trim();
|
||||
}
|
||||
// console.log(checkReceiptNoInFirstBillData(receipt_no));
|
||||
if(checkReceiptNoInFirstBillData(receipt_no,"")){
|
||||
$("#pay").show();
|
||||
}else{
|
||||
$("#pay").hide();
|
||||
}
|
||||
/* end check first bill or not*/
|
||||
|
||||
$('.invoicedetails').on('click',function(){
|
||||
var dining_id = "<%= @room.id %>";
|
||||
var sale_id = this.id;
|
||||
@@ -481,7 +549,7 @@ $(document).ready(function(){
|
||||
window.location.href = '/origami/' + sale_id + '/discount'
|
||||
}
|
||||
else {
|
||||
alert("Please select an table!");
|
||||
swal ( "Oops" , "Please select an table!" , "warning" );
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -500,7 +568,7 @@ $(document).ready(function(){
|
||||
window.location.href = '/origami/' + sale_id + '/other_charges'
|
||||
}
|
||||
else {
|
||||
alert("Please select an table!");
|
||||
swal ( "Oops" , "Please select an table!" , "warning" );
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -516,11 +584,54 @@ $("#first_bill").on('click', function(){
|
||||
type: "GET",
|
||||
url: ajax_url,
|
||||
success:function(result){
|
||||
receipt_no = ($("#receipt_no").html()).trim();
|
||||
if((receipt_no!=undefined) && (receipt_no!=""))
|
||||
createReceiptNoInFirstBillData(receipt_no,"");
|
||||
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(".choose_payment").on('click', function () {
|
||||
$( "#loading_wrapper").show();
|
||||
var sale_id = $('#sale_id').val();
|
||||
type = $('.payment_method').val();
|
||||
|
||||
calculate_member_discount(sale_id,type);
|
||||
|
||||
var ajax_url = "/origami/sale/" + sale_id + "/first_bill";
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: ajax_url,
|
||||
success: function (result) {
|
||||
$( "#loading_wrapper" ).hide();
|
||||
receipt_no = ($("#receipt_no").html()).trim();
|
||||
if((receipt_no!=undefined) && (receipt_no!=""))
|
||||
createReceiptNoInFirstBillData(receipt_no,type);
|
||||
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
});
|
||||
function calculate_member_discount(sale_id,type) {
|
||||
var sub_total = $('#sub-total').text();
|
||||
if (type == "Cash") {
|
||||
is_card = false
|
||||
}else{
|
||||
is_card = true
|
||||
}
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/origami/" + sale_id + "/member_discount",
|
||||
data: {'sale_id':sale_id, 'sub_total':sub_total,'is_card':is_card },
|
||||
async: false,
|
||||
success:function(result){
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
$('#pay').on('click',function() {
|
||||
var sale_id = $('#sale_id').val();
|
||||
var url = '/origami/sale/'+ sale_id + "/rounding_adj" ;
|
||||
@@ -583,8 +694,16 @@ $('#add_invoice').on('click',function(){
|
||||
url: ajax_url,
|
||||
data: 'dining_id='+ dining_id + "&sale_id=" + sale_id,
|
||||
success:function(result){
|
||||
alert("Invoice updated")
|
||||
window.location.reload();
|
||||
swal({
|
||||
title: "Information!",
|
||||
text: "Invoice updated",
|
||||
html: true,
|
||||
closeOnConfirm: false,
|
||||
closeOnCancel: false,
|
||||
allowOutsideClick: false
|
||||
}, function () {
|
||||
window.location.reload();
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -109,7 +109,7 @@
|
||||
<div class="col-lg-5 col-md-5 col-sm-5">
|
||||
<div class="card" >
|
||||
<div class="card-header">
|
||||
<div><strong id="order-title">INVOICE DETAILS </strong></div>
|
||||
<div><strong id="order-title">INVOICE DETAILS </strong>| Table <%= @dining.name rescue "" %></div>
|
||||
</div>
|
||||
<div class="card-block">
|
||||
<div class="card-title row p-l-5 p-r-5">
|
||||
@@ -146,7 +146,7 @@
|
||||
sub_total = sub_total + sale_item.price
|
||||
%>
|
||||
<input type="hidden" id="sale_id" value="<%= @sale.sale_id %>">
|
||||
<% unless sale_item.price <= 0 %>
|
||||
<% #unless sale_item.price <= 0 %>
|
||||
<tr>
|
||||
<td class='item-name'><%= sale_item.product_name %></td>
|
||||
<td class='item-attr'><%= sale_item.qty %></td>
|
||||
@@ -154,7 +154,7 @@
|
||||
</tr>
|
||||
<%
|
||||
|
||||
end
|
||||
#end
|
||||
end
|
||||
|
||||
%>
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
<div class="row">
|
||||
<div class="form-group col-lg-12 col-md-12 col-sm-12">
|
||||
<label>You can pay up to </label>
|
||||
<%@can_visa = @can_visa +@rounding_adj%>
|
||||
<input type="text" name="validamount" id="validamount" class="form-control col-lg-7 col-md-7 col-sm-7" readonly="" value="<%=@can_visa %>" data-member-value="">
|
||||
</div>
|
||||
<hr>
|
||||
@@ -159,19 +160,20 @@
|
||||
console.log(amount);
|
||||
console.log($("#validamount").attr("value"));
|
||||
if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){
|
||||
$(this).off("click");
|
||||
//start member discount 5% by pay card
|
||||
var sub_total = $('#sub-total').text();
|
||||
var member_id = $('#membership_id').text();
|
||||
var member_discount = $('#member_discount').text();
|
||||
if (member_id && member_discount) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/origami/" + sale_id + "/member_discount",
|
||||
data: {'sale_id':sale_id, 'sub_total':sub_total,'is_card':false },
|
||||
// success:function(result){
|
||||
// }
|
||||
});
|
||||
}
|
||||
// var sub_total = $('#sub-total').text();
|
||||
// var member_id = $('#membership_id').text();
|
||||
// var member_discount = $('#member_discount').text();
|
||||
// if (member_id && member_discount) {
|
||||
// $.ajax({
|
||||
// type: "POST",
|
||||
// url: "/origami/" + sale_id + "/member_discount",
|
||||
// data: {'sale_id':sale_id, 'sub_total':sub_total,'is_card':true },
|
||||
// success:function(result){
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
//end member discount
|
||||
$.ajax({type: "POST",
|
||||
url: "<%= origami_payment_visa_path %>",
|
||||
@@ -181,6 +183,10 @@
|
||||
swal({
|
||||
title: "Information!",
|
||||
text: "Payment Successfully",
|
||||
html: true,
|
||||
closeOnConfirm: false,
|
||||
closeOnCancel: false,
|
||||
allowOutsideClick: false
|
||||
}, function () {
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment";
|
||||
});
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
<%= f.input :api_settings %>
|
||||
<%= f.input :page_width %>
|
||||
<%= f.input :page_height %>
|
||||
<%= f.input :print_copies %>
|
||||
<%= f.input :precision %>
|
||||
<%= f.input :print_copies, input_html: { min: 1, step: '1', :onkeypress => "return isNumberKey(event);", :onkeyup => "greaterThanOne(this.value);" } %>
|
||||
<%= f.input :precision, input_html: { min: 0, max: 2, :onkeypress => "return isNumberKey(event);", :onkeyup => "greaterThanTwo(this.value);" } %>
|
||||
<%= f.input :delimiter %>
|
||||
<%= f.input :heading_space %>
|
||||
</div>
|
||||
@@ -58,4 +58,23 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
function isNumberKey(evt) {
|
||||
var charCode = (evt.which) ? evt.which : event.keyCode;
|
||||
if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57)) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
function greaterThanOne(val){
|
||||
if(parseInt(val)==0) $("#print_setting_print_copies").val(1);
|
||||
}
|
||||
|
||||
function greaterThanTwo(val){
|
||||
if(parseInt(val)>2) $("#print_setting_precision").val(2);
|
||||
}
|
||||
</script>
|
||||
@@ -1,7 +1,7 @@
|
||||
<div class="p-l-15">
|
||||
<%= form_tag report_path, :method => :get, :id => "frm_report", :class => "form" do %>
|
||||
<%= form_tag report_path, :method => :get, :id => "frm_report", :class => "form" do %>
|
||||
<% if period_type != false %>
|
||||
<div class="row">
|
||||
<div class="row">
|
||||
|
||||
<!-- <div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="">Select Date Range</label>
|
||||
@@ -12,17 +12,17 @@
|
||||
<% end %>
|
||||
</div> -->
|
||||
<div class="col-lg-3 col-md-3 col-sm-3">
|
||||
<!-- <label class="">Select Shift Period</label> -->
|
||||
<label class="font-14"><%= t("views.right_panel.detail.from") %></label>
|
||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="from" id="from" type="text" placeholder="From date">
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-3 col-sm-3">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.to") %></label>
|
||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="to" id="to" type="text" placeholder="To date">
|
||||
</div>
|
||||
<!-- <label class="">Select Shift Period</label> -->
|
||||
<label class="font-14"><%= t("views.right_panel.detail.from") %></label>
|
||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="from" id="from" type="text" placeholder="From date" style="height: 34px;">
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-3 col-sm-3">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.to") %></label>
|
||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="to" id="to" type="text" placeholder="To date" style="height: 34px;">
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14"><%= t :commissioner %></label>
|
||||
<select class="form-control" name="commissioner" id="commissioner">
|
||||
<select class="form-control" name="commissioner" id="commissioner" style="height: 37px;">
|
||||
<option value=""></option>
|
||||
<% @commissioner.each do |c| %>
|
||||
<% if @com_id == c.id %>
|
||||
@@ -34,16 +34,16 @@
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 margin-top-20">
|
||||
<br>
|
||||
<br>
|
||||
<input type="submit" value="Generate Report" class='btn btn-info wave-effects'>
|
||||
</div>
|
||||
<!-- <div class="col-lg-2 col-md-2 col-sm-2 margin-top-20">
|
||||
<input type="button" value="Clear Filter" id="clear_filter" class='btn btn-danger'>
|
||||
</div> -->
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<!-- <script type="text/javascript">
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
@@ -22,15 +22,15 @@
|
||||
<div class="form-group col-md-2">
|
||||
<!-- <label class="">Select Shift Period</label> -->
|
||||
<label class="font-20">From</label>
|
||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="from" id="from" type="text" placeholder="From date">
|
||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="from" id="from" type="text" placeholder="From date" style="height: 34px;">
|
||||
</div>
|
||||
<div class="form-group col-md-2">
|
||||
<label class="font-20">To</label>
|
||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="to" id="to" type="text" placeholder="To date">
|
||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="to" id="to" type="text" placeholder="To date" style="height: 34px;">
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label class="font-20">All Shift</label>
|
||||
<select class="form-control select" name="shift_name" id="shift_name" >
|
||||
<select class="form-control select" name="shift_name" id="shift_name" style="height: 37px;">
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group col-md-1 ">
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
$(function(){
|
||||
|
||||
var check_arr = [];
|
||||
|
||||
search_by_period();
|
||||
$('#sel_period').change(function(){
|
||||
|
||||
search_by_period();
|
||||
@@ -83,20 +83,24 @@
|
||||
|
||||
// OK button is clicked
|
||||
$('#from').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
|
||||
$('#from').val(date)
|
||||
new_date = new Date(date) ;
|
||||
month = parseInt(new_date.getMonth()+1)
|
||||
from = new_date.getDate() + "-" + month + "-" + new_date.getFullYear();
|
||||
$('#from').val(from)
|
||||
search_by_date();
|
||||
});
|
||||
$('#to').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
|
||||
$('#to').val(date)
|
||||
new_date = new Date(date) ;
|
||||
month = parseInt(new_date.getMonth()+1)
|
||||
to = new_date.getDate() + "-" + month + "-" + new_date.getFullYear();
|
||||
$('#to').val(to)
|
||||
search_by_date();
|
||||
});
|
||||
});
|
||||
|
||||
function search_by_date(){
|
||||
|
||||
var to_date = new Date($('#to').val());
|
||||
var to = to_date.getDate() + "-" + to_date.getMonth() + "-" + to_date.getFullYear();
|
||||
var from_date = new Date($('#from').val());
|
||||
var from = from_date.getDate() + "-" + from_date.getMonth() + "-" + from_date.getFullYear();
|
||||
from = $("#from").val();
|
||||
to = $("#to").val();
|
||||
|
||||
var period = 0;
|
||||
var period_type = 1;
|
||||
@@ -119,7 +123,10 @@
|
||||
|
||||
function show_shift_name(period,period_type,from,to,shift_item){
|
||||
var shift = $('#shift_name');
|
||||
|
||||
if (from == '' && to == '') {
|
||||
from = $("#from").val();
|
||||
to = $("#to").val();
|
||||
}
|
||||
shift.empty();
|
||||
|
||||
var str = '';
|
||||
|
||||
@@ -1,20 +1,21 @@
|
||||
<div class="container margin-top-20">
|
||||
<div class="card row">
|
||||
|
||||
<div class="margin-top-20">
|
||||
<div class="card ">
|
||||
<% unless @sale_data.blank? %>
|
||||
|
||||
<table class="table table-striped" border="0">
|
||||
<thead>
|
||||
<% if !params[:from].blank?%>
|
||||
<tr>
|
||||
<th colspan="7">From Date : <%= params[:from] rescue '-'%> , To Date : <%= params[:to] rescue '-'%></th>
|
||||
<th colspan="7"><%= t("views.right_panel.detail.from_date") %> : <%= params[:from] rescue '-'%> , <%= t("views.right_panel.detail.to_date") %> : <%= params[:to] rescue '-'%></th>
|
||||
</tr>
|
||||
<% end %>
|
||||
<tr>
|
||||
<th> Shift Name </th>
|
||||
<th> Receive No</th>
|
||||
<th> Cashier Name</th>
|
||||
<th> Customer Name</th>
|
||||
<th> Credit Amount </th>
|
||||
<th> <%= t("views.right_panel.detail.shift_name") %> </th>
|
||||
<th> <%= t("views.right_panel.detail.receipt_no") %></th>
|
||||
<th> <%= t :cashier %> <%= t("views.right_panel.detail.name") %></th>
|
||||
<th> <%= t :customer %> <%= t("views.right_panel.detail.name") %></th>
|
||||
<th> <%= t("views.right_panel.detail.credit_amount") %> </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -36,4 +37,4 @@
|
||||
</table>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -24,11 +24,11 @@
|
||||
<div class="col-lg-3 col-md-3 col-sm-3">
|
||||
<!-- <label class="">Select Shift Period</label> -->
|
||||
<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" placeholder="From date" style="height: 37px;">
|
||||
<input data-behaviour='datepicker' class="form-control datepicker" name="from" id="from" type="text" placeholder="From date" style="height: 35px;">
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-3 col-sm-3">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.to") %></label>
|
||||
<input data-behaviour='datepicker' class="form-control datepicker" name="to" id="to" type="text" placeholder="To date" style="height: 37px;">
|
||||
<input data-behaviour='datepicker' class="form-control datepicker" name="to" id="to" type="text" placeholder="To date" style="height: 35px;">
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 margin-top-20">
|
||||
<label></label><br>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
<div class="page-header">
|
||||
<div class="page-header" style="width:130%;">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
|
||||
<li class="breadcrumb-item active"><%= t("views.right_panel.detail.daily_sale_report") %></li>
|
||||
@@ -10,7 +10,6 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-12 col-sm-12 ">
|
||||
|
||||
<%= render :partial=>'shift_sale_report_filter',
|
||||
:locals=>{ :period_type => true, :shift_name => false, :report_path =>reports_dailysale_index_path} %>
|
||||
<hr />
|
||||
@@ -20,7 +19,7 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-12">
|
||||
<div class="card ">
|
||||
<div class="card" style="width:129%;">
|
||||
<div class="body table-responsive">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
@@ -73,7 +72,7 @@
|
||||
<% credit += sale[:credit_amount] %>
|
||||
<% foc += sale[:foc_amount] %>
|
||||
<% discount += sale[:total_discount] %>
|
||||
<% total += sale[:old_grand_total].to_f + sale[:rounding_adj].to_f %>
|
||||
<% 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 %>
|
||||
@@ -90,9 +89,9 @@
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:credit_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:foc_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'>(<%= number_with_delimiter(sprintf("%.2f",sale[:total_discount]), :delimiter => ',') rescue '-'%>)</td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:old_grand_total].to_f + sale[:rounding_adj].to_f ), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:grand_total].to_f + sale[:rounding_adj].to_f ), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:rounding_adj].to_f), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:old_grand_total]), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:grand_total]), :delimiter => ',') rescue '-'%></td>
|
||||
</tr>
|
||||
<% count = count + 1 %>
|
||||
<% end %>
|
||||
@@ -110,7 +109,7 @@
|
||||
<td style='text-align:right;'>(<%= number_with_delimiter(sprintf("%.2f",discount), :delimiter => ',') rescue '-'%>)</td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",total), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",rounding_adj), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",old_grand_total), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",grand_total), :delimiter => ',') rescue '-'%></td>
|
||||
</tr>
|
||||
|
||||
<% total_tax = 0 %>
|
||||
|
||||
@@ -1,118 +1,127 @@
|
||||
<div class="container margin-top-20">
|
||||
<div class="card row">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="15"> From Date : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - To Date : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style='text-align:center;'>Sr.no</th>
|
||||
<th style='text-align:center;'>Date</th>
|
||||
<th style='text-align:center;'>Void Amount</th>
|
||||
<th style='text-align:center;'>Mpu Sales</th>
|
||||
<th style='text-align:center;'>Master Sales</th>
|
||||
<th style='text-align:center;'>Visa Sales</th>
|
||||
<th style='text-align:center;'>Jcb Sales</th>
|
||||
<th style='text-align:center;'>Redeem Sales</th>
|
||||
<th style='text-align:center;'>Cash Sales</th>
|
||||
<th style='text-align:center;'>Credit Sales</th>
|
||||
<th style='text-align:center;'>FOC Sales</th>
|
||||
<th style='text-align:center;'>(Discount)</th>
|
||||
<th style='text-align:center;'>Grand Total + <br/> Rounding Adj.</th>
|
||||
<th style='text-align:center;'>Rounding Adj.</th>
|
||||
<th style='text-align:center;'>Grand Total</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<% unless @sale_data.empty? %>
|
||||
|
||||
<tbody>
|
||||
<% void = 0 %>
|
||||
<% mpu = 0 %>
|
||||
<% master = 0 %>
|
||||
<% visa = 0 %>
|
||||
<% jcb = 0 %>
|
||||
<% paypar = 0 %>
|
||||
<% cash = 0 %>
|
||||
<% credit = 0 %>
|
||||
<% foc = 0 %>
|
||||
<% discount = 0 %>
|
||||
<% total = 0 %>
|
||||
<% grand_total = 0 %>
|
||||
<% old_grand_total = 0 %>
|
||||
<% count = 1 %> <% rounding_adj = 0 %>
|
||||
<% @sale_data.each do |sale| %>
|
||||
<% void += sale[:void_amount] %>
|
||||
<% mpu += sale[:mpu_amount] %>
|
||||
<% master += sale[:master_amount] %>
|
||||
<% visa += sale[:visa_amount] %>
|
||||
<% jcb += sale[:jcb_amount] %>
|
||||
<% paypar += sale[:paypar_amount] %>
|
||||
<% cash += sale[:cash_amount]-sale[:total_change_amount] %>
|
||||
<% credit += sale[:credit_amount] %>
|
||||
<% foc += sale[:foc_amount] %>
|
||||
<% discount += sale[:total_discount] %>
|
||||
<% total += sale[:old_grand_total].to_f + sale[:rounding_adj].to_f %>
|
||||
<% grand_total += sale[:grand_total].to_f %>
|
||||
<% old_grand_total += sale[:old_grand_total].to_f %>
|
||||
<% rounding_adj += sale[:rounding_adj].to_f %>
|
||||
<tr>
|
||||
<td style='text-align:right;'><%= count %></td>
|
||||
<td><%= sale[:sale_date].strftime("#{sale[:sale_date].day.ordinalize} %b") rescue '-' %></td>
|
||||
<td style='color:red;text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:void_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:mpu_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:master_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:visa_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:jcb_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:paypar_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:cash_amount]-sale[:total_change_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:credit_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:foc_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'>(<%= number_with_delimiter(sprintf("%.2f",sale[:total_discount]), :delimiter => ',') rescue '-'%>)</td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:old_grand_total].to_f + sale[:rounding_adj].to_f ), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:rounding_adj].to_f), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:old_grand_total]), :delimiter => ',') rescue '-'%></td>
|
||||
</tr>
|
||||
<% count = count + 1 %>
|
||||
<% end %>
|
||||
|
||||
<tr style="font-weight:600;">
|
||||
<td colspan="3" style='text-align:center;'>Total</td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",mpu), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",master), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",visa), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",jcb), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",paypar), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",cash), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",credit), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",foc), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'>(<%= number_with_delimiter(sprintf("%.2f",discount), :delimiter => ',') rescue '-'%>)</td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",total), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",rounding_adj), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",old_grand_total), :delimiter => ',') rescue '-'%></td>
|
||||
</tr>
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-12 col-sm-12 ">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-12">
|
||||
<div class="card" >
|
||||
<div class="body table-responsive">
|
||||
<table class="table table-bordered">
|
||||
<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>
|
||||
<tr>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.sr") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.date") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.void_amount") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.mpu_sales") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.master_sales") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.visa_sales") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.jcb_sales") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.redeem_sales") %></th>
|
||||
<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>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.foc_sales") %></th>
|
||||
<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.rnd_adj_sh") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.grand_total") %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<% unless @sale_data.empty? %>
|
||||
|
||||
<% total_tax = 0 %>
|
||||
<% unless @tax.empty? %>
|
||||
<% @tax.each do |tax| %>
|
||||
<% total_tax += tax.tax_amount.to_f %>
|
||||
<tr style="font-weight:600;">
|
||||
<td colspan="12" style='text-align:right;'><%= tax.tax_name rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",tax.tax_amount), :delimiter => ',') rescue '-'%></td>
|
||||
<td colspan="2"> </td>
|
||||
</tr>
|
||||
|
||||
<% end %>
|
||||
<% net = total - total_tax %>
|
||||
<tr style="font-weight:600;">
|
||||
<td colspan="12" style='text-align:right;'>Net Amount</td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",net), :delimiter => ',') rescue '-'%></td>
|
||||
<td colspan="2"> </td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
<% end %>
|
||||
</table>
|
||||
<tbody>
|
||||
<% void = 0 %>
|
||||
<% mpu = 0 %>
|
||||
<% master = 0 %>
|
||||
<% visa = 0 %>
|
||||
<% jcb = 0 %>
|
||||
<% paypar = 0 %>
|
||||
<% cash = 0 %>
|
||||
<% credit = 0 %>
|
||||
<% foc = 0 %>
|
||||
<% discount = 0 %>
|
||||
<% total = 0 %>
|
||||
<% grand_total = 0 %>
|
||||
<% old_grand_total = 0 %>
|
||||
<% count = 1 %> <% rounding_adj = 0 %>
|
||||
<% @sale_data.each do |sale| %>
|
||||
<% void += sale[:void_amount] %>
|
||||
<% mpu += sale[:mpu_amount] %>
|
||||
<% master += sale[:master_amount] %>
|
||||
<% visa += sale[:visa_amount] %>
|
||||
<% jcb += sale[:jcb_amount] %>
|
||||
<% paypar += sale[:paypar_amount] %>
|
||||
<% cash += sale[:cash_amount]-sale[:total_change_amount] %>
|
||||
<% credit += sale[:credit_amount] %>
|
||||
<% foc += sale[:foc_amount] %>
|
||||
<% discount += sale[:total_discount] %>
|
||||
<% total += sale[:grand_total].to_f + sale[:rounding_adj].to_f %>
|
||||
<% grand_total += sale[:grand_total].to_f %>
|
||||
<% old_grand_total += sale[:old_grand_total].to_f %>
|
||||
<% rounding_adj += sale[:rounding_adj].to_f %>
|
||||
<tr>
|
||||
<td style='text-align:right;'><%= count %></td>
|
||||
<td><%= sale[:sale_date].strftime("#{sale[:sale_date].day.ordinalize} %b") rescue '-' %></td>
|
||||
<td style='color:red;text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:void_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:mpu_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:master_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:visa_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:jcb_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:paypar_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:cash_amount]-sale[:total_change_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:credit_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:foc_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'>(<%= number_with_delimiter(sprintf("%.2f",sale[:total_discount]), :delimiter => ',') rescue '-'%>)</td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:grand_total].to_f + sale[:rounding_adj].to_f ), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:rounding_adj].to_f), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:grand_total]), :delimiter => ',') rescue '-'%></td>
|
||||
</tr>
|
||||
<% count = count + 1 %>
|
||||
<% end %>
|
||||
|
||||
<tr style="font-weight:600;">
|
||||
<td colspan="3" style='text-align:center;'>Total</td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",mpu), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",master), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",visa), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",jcb), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",paypar), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",cash), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",credit), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",foc), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'>(<%= number_with_delimiter(sprintf("%.2f",discount), :delimiter => ',') rescue '-'%>)</td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",total), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",rounding_adj), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",grand_total), :delimiter => ',') rescue '-'%></td>
|
||||
</tr>
|
||||
|
||||
<% total_tax = 0 %>
|
||||
<% unless @tax.empty? %>
|
||||
<% @tax.each do |tax| %>
|
||||
<% total_tax += tax.tax_amount.to_f %>
|
||||
<tr style="font-weight:600;">
|
||||
<td colspan="12" style='text-align:right;'><%= tax.tax_name rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",tax.tax_amount), :delimiter => ',') rescue '-'%></td>
|
||||
<td colspan="2"> </td>
|
||||
</tr>
|
||||
|
||||
<% end %>
|
||||
<% net = total - total_tax %>
|
||||
<tr style="font-weight:600;">
|
||||
<td colspan="12" style='text-align:right;'><%= t("views.right_panel.detail.net_amount") %></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",net), :delimiter => ',') rescue '-'%></td>
|
||||
<td colspan="2"> </td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
<% end %>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -27,15 +27,15 @@
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<!-- <label class="">Select Shift Period</label> -->
|
||||
<label class="font-14"><%= t("views.right_panel.detail.from") %></label>
|
||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3 from" name="from" id="from" type="text" placeholder="From date">
|
||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3 from" name="from" id="from" type="text" placeholder="From date" style="height: 34px;">
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.to") %></label>
|
||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3 to" name="to" id="to" type="text" placeholder="To date">
|
||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3 to" name="to" id="to" type="text" placeholder="To date" style="height: 34px;">
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.all_shift") %></label>
|
||||
<select class="form-control select" name="shift_name" id="shift_name" >
|
||||
<select class="form-control select" name="shift_name" id="shift_name" style="height: 37px;" >
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-lg-1 col-md-1 col-sm-1 margin-top-20">
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
|
||||
<tr>
|
||||
<th> <%= t("views.right_panel.detail.shift_name") %> </th>
|
||||
<th> <%= t("views.right_panel.detail.payment_method") %></th>
|
||||
<th><%= t("views.right_panel.detail.receipt_no") %></th>
|
||||
<th> <%= t :cashier %> <%= t("views.right_panel.detail.name") %></th>
|
||||
<th> <%= t :payment_method %></th>
|
||||
<th> <%= t("views.right_panel.detail.amount") %> </th>
|
||||
@@ -92,7 +92,11 @@
|
||||
<tbody>
|
||||
<% total = 0 %>
|
||||
<% @pyament_method.each do |payment| %>
|
||||
<% total += payment.payment_amount %>
|
||||
<% if payment.payment_method === 'cash'
|
||||
total += payment.payment_amount - payment.change_amount
|
||||
else
|
||||
total += payment.payment_amount
|
||||
end%>
|
||||
<tr>
|
||||
<% if @shift_from.nil? && @shift_to.nil? %>
|
||||
<td><%= payment.sale_date.utc.getlocal.strftime("%e %b %I:%M%p") rescue '-'%></td>
|
||||
@@ -103,7 +107,11 @@
|
||||
<td><%= payment.cashier_name rescue '-' %></td>
|
||||
<!--<td><%= payment.sale.customer.name rescue '-' %></td>-->
|
||||
<td><%= payment.payment_method rescue '-' %></td>
|
||||
<td><%= payment.payment_amount rescue '-' %></td>
|
||||
<% if payment.payment_method === 'cash' %>
|
||||
<td><%= payment.payment_amount - payment.change_amount%> </td>
|
||||
<%else%>
|
||||
<td><%= payment.payment_amount%> </td>
|
||||
<%end%>
|
||||
<td><%= payment.sale.grand_total rescue '-' %></td>
|
||||
|
||||
</tr>
|
||||
@@ -125,7 +133,7 @@
|
||||
<script>
|
||||
$(function(){
|
||||
var check_arr = [];
|
||||
|
||||
search_by_period();
|
||||
$('#sel_period').change(function(){
|
||||
search_by_period();
|
||||
});
|
||||
@@ -141,20 +149,24 @@
|
||||
|
||||
// OK button is clicked
|
||||
$('#from').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
|
||||
$('#from').val(date)
|
||||
new_date = new Date(date) ;
|
||||
month = parseInt(new_date.getMonth()+1)
|
||||
from = new_date.getDate() + "-" + month + "-" + new_date.getFullYear();
|
||||
$('#from').val(from)
|
||||
search_by_date();
|
||||
});
|
||||
$('#to').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
|
||||
$('#to').val(date)
|
||||
new_date = new Date(date) ;
|
||||
month = parseInt(new_date.getMonth()+1)
|
||||
to = new_date.getDate() + "-" + month + "-" + new_date.getFullYear();
|
||||
$('#to').val(to)
|
||||
search_by_date();
|
||||
});
|
||||
});
|
||||
|
||||
function search_by_date(){
|
||||
|
||||
var to_date = new Date($('#to').val());
|
||||
var to = to_date.getDate() + "-" + to_date.getMonth() + "-" + to_date.getFullYear();
|
||||
var from_date = new Date($('#from').val());
|
||||
var from = from_date.getDate() + "-" + from_date.getMonth() + "-" + from_date.getFullYear();
|
||||
from = $("#from").val();
|
||||
to = $("#to").val();
|
||||
|
||||
var period = 0;
|
||||
var period_type = 1;
|
||||
@@ -177,7 +189,10 @@
|
||||
var shift = $('#shift_name');
|
||||
|
||||
shift.empty();
|
||||
|
||||
if (from == '' && to == '') {
|
||||
from = $("#from").val();
|
||||
to = $("#to").val();
|
||||
}
|
||||
var str = '';
|
||||
var param_shift = '';
|
||||
var param_shift = '<%= params[:shift_name] rescue '-'%>';
|
||||
|
||||
@@ -27,11 +27,11 @@
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<!-- <label class="">Select Shift Period</label> -->
|
||||
<label class="font-14"><%= t("views.right_panel.detail.from") %></label>
|
||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="from" id="from" type="text" placeholder="From date">
|
||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="from" id="from" type="text" placeholder="From date" style="height: 32px;">
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.to") %></label>
|
||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="to" id="to" type="text" placeholder="To date">
|
||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="to" id="to" type="text" placeholder="To date" style="height: 32px;">
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.all_shift") %></label>
|
||||
|
||||
@@ -46,8 +46,8 @@
|
||||
<th><%= t :cashier %> <%= t("views.right_panel.detail.name") %></th>
|
||||
<th><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.amount") %></th>
|
||||
<th><%= t("views.right_panel.detail.discount") %> <%= t("views.right_panel.detail.amount") %> </th>
|
||||
<% @sale_taxes.each do |tax| %>
|
||||
<th><%= tax.tax_name %></th>
|
||||
<% @tax_profiles.each do |tax| %>
|
||||
<th><%= tax.name %></th>
|
||||
<% end %>
|
||||
<!-- <th>Other Amount</th> -->
|
||||
<th><%= t("views.right_panel.detail.grand_total") %></th>
|
||||
@@ -83,11 +83,14 @@
|
||||
<td><%= result.cashier_name rescue '-' %></td>
|
||||
<td><%= result.total_amount rescue '-' %></td>
|
||||
<td><%= result.total_discount rescue '-' %></td>
|
||||
<%if result.customer.customer_type == "Takeaway"%>
|
||||
<td>0.0</td>
|
||||
<%end%>
|
||||
<% result.sale_taxes.each do |tax| %>
|
||||
<td><%= tax.tax_payable_amount rescue '-' %></td>
|
||||
<%end%>
|
||||
|
||||
<td><%= result.old_grand_total %></td>
|
||||
<td><%= result.grand_total %></td>
|
||||
<td><%= result.rounding_adjustment.to_f rescue '-' %></td>
|
||||
<td><%= result.grand_total_after_rounding() rescue '-'%></td>
|
||||
</tr>
|
||||
@@ -100,16 +103,17 @@
|
||||
<% @sale_taxes.each do |tax| %>
|
||||
<td><b><%= tax.st_amount.round(2) %></b></td>
|
||||
<% end %>
|
||||
<td><b><%= old_grand_total.to_f.round(2) rescue '-'%></b></td>
|
||||
<td><b><%= grand_total.to_f.round(2) rescue '-'%></b></td>
|
||||
<td><b><%= rounding_adj rescue '-'%></b></td>
|
||||
<td><b><%= old_grand_total.to_f.round + rounding_adj %></b></td>
|
||||
<td><b><%= grand_total.to_f.round + rounding_adj %></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"> </td>
|
||||
<td><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.amount") %></td>
|
||||
<td><%= t("views.right_panel.detail.discount") %> <%= t("views.right_panel.detail.amount") %></td>
|
||||
<% @sale_taxes.each do |tax| %>
|
||||
<td><%= tax.tax_name %></td>
|
||||
|
||||
<% @tax_profiles.each do |tax| %>
|
||||
<td><%= tax.name %></td>
|
||||
<% end %>
|
||||
<td><%= t("views.right_panel.detail.grand_total") %></td>
|
||||
<td><%= t("views.right_panel.detail.rnd_adj_sh") %></td>
|
||||
@@ -129,7 +133,7 @@
|
||||
$(function(){
|
||||
|
||||
var check_arr = [];
|
||||
|
||||
search_by_period();
|
||||
$('#sel_period').change(function(){
|
||||
|
||||
search_by_period();
|
||||
@@ -147,20 +151,24 @@
|
||||
|
||||
// OK button is clicked
|
||||
$('#from').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
|
||||
$('#from').val(date)
|
||||
new_date = new Date(date) ;
|
||||
month = parseInt(new_date.getMonth()+1)
|
||||
from = new_date.getDate() + "-" + month + "-" + new_date.getFullYear();
|
||||
$('#from').val(from)
|
||||
search_by_date();
|
||||
});
|
||||
$('#to').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
|
||||
$('#to').val(date)
|
||||
new_date = new Date(date) ;
|
||||
month = parseInt(new_date.getMonth()+1)
|
||||
to = new_date.getDate() + "-" + month + "-" + new_date.getFullYear();
|
||||
$('#to').val(to)
|
||||
search_by_date();
|
||||
});
|
||||
|
||||
function search_by_date(){
|
||||
|
||||
var to_date = new Date($('#to').val());
|
||||
var to = to_date.getDate() + "-" + to_date.getMonth() + "-" + to_date.getFullYear();
|
||||
var from_date = new Date($('#from').val());
|
||||
var from = from_date.getDate() + "-" + from_date.getMonth() + "-" + from_date.getFullYear();
|
||||
from = $("#from").val();
|
||||
to = $("#to").val();
|
||||
|
||||
var period = 0;
|
||||
var period_type = 1;
|
||||
@@ -170,7 +178,6 @@
|
||||
|
||||
check_arr.push(to);
|
||||
|
||||
console.log(check_arr.length)
|
||||
if(check_arr.length == 1){
|
||||
show_shift_name(period,period_type,from,to,'shift_item');
|
||||
}
|
||||
@@ -189,7 +196,10 @@
|
||||
var str = '';
|
||||
var param_shift = '';
|
||||
var param_shift = '<%= params[:shift_name] rescue '-'%>';
|
||||
|
||||
if (from == '' && to == '') {
|
||||
from = $("#from").val();
|
||||
to = $("#to").val();
|
||||
}
|
||||
url = '<%= reports_get_shift_by_date_path %>';
|
||||
|
||||
$.get(url, {period :period, period_type :period_type, from :from, to :to, report_type :shift_item} , function(data){
|
||||
|
||||
@@ -1,98 +1,106 @@
|
||||
<div class="container margin-top-20">
|
||||
<div class="card row">
|
||||
<table class="table table-striped" border="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="7"> From Date : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - To Date : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%></th>
|
||||
</tr>
|
||||
<% if @shift_from %>
|
||||
<tr>
|
||||
<% if @shift_data.employee %>
|
||||
<% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %>
|
||||
<% end %>
|
||||
<th colspan="7">Shift Name = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )</th>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
<tr>
|
||||
<th>Recipt No</th>
|
||||
<th>Cashier Name</th>
|
||||
<th>Total Amount</th>
|
||||
<th>Discount Amount </th>
|
||||
<% @sale_taxes.each do |tax| %>
|
||||
<th><%= tax.tax_name %></th>
|
||||
|
||||
<% end %>
|
||||
<!-- <th>Other Amount</th> -->
|
||||
<th>Grand Total</th>
|
||||
<th>Rounding Adj.</th>
|
||||
<th>Grand Total +<br/>
|
||||
Rounding Adj.
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% grand_total = 0 %>
|
||||
<% old_grand_total = 0 %>
|
||||
<% total_tax = 0 %>
|
||||
<% guest_count = 0 %>
|
||||
<% total_sum = 0 %>
|
||||
<% discount_amt = 0 %>
|
||||
<% other_amt = 0 %>
|
||||
<% total_nett = 0 %>
|
||||
<% rounding_adj = 0%> <% gov_tax = 0 %> <% service_charge = 0 %>
|
||||
<%if @sale_data %>
|
||||
<% @sale_data.each do |result| %>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="margin-top-20">
|
||||
<div class="card">
|
||||
<table class="table table-striped" border="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="9"> <%= 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>
|
||||
<% if @shift_from %>
|
||||
<tr>
|
||||
<% if @shift_data.employee %>
|
||||
<% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %>
|
||||
<% end %>
|
||||
<th colspan="9"><%= t("views.right_panel.detail.shift_name") %> = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )</th>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
<% grand_total = grand_total.to_f + result.grand_total.to_f %>
|
||||
<% old_grand_total = old_grand_total.to_f + result.old_grand_total.to_f %>
|
||||
<% total_tax += result.total_tax.to_f %>
|
||||
<% total_sum += result.total_amount.to_f %>
|
||||
<% discount_amt += result.total_discount.to_f %>
|
||||
<% rounding_adj += result.rounding_adjustment.to_f %>
|
||||
|
||||
<tr>
|
||||
|
||||
<td><%= result.receipt_no rescue '-' %> </td>
|
||||
<td><%= result.cashier_name rescue '-' %></td>
|
||||
<td><%= result.total_amount rescue '-' %></td>
|
||||
<td><%= result.total_discount rescue '-' %></td>
|
||||
<% result.sale_taxes.each do |tax| %>
|
||||
<tr>
|
||||
<th><%= t("views.right_panel.detail.receipt_no") %></th>
|
||||
<th><%= t :cashier %> <%= t("views.right_panel.detail.name") %></th>
|
||||
<th><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.amount") %></th>
|
||||
<th><%= t("views.right_panel.detail.discount") %> <%= t("views.right_panel.detail.amount") %> </th>
|
||||
<% @tax_profiles.each do |tax| %>
|
||||
<th><%= tax.name %></th>
|
||||
<% end %>
|
||||
<!-- <th>Other Amount</th> -->
|
||||
<th><%= t("views.right_panel.detail.grand_total") %></th>
|
||||
<th><%= t("views.right_panel.detail.rnd_adj_sh") %></th>
|
||||
<th><%= t("views.right_panel.detail.grand_total") %> +<br/>
|
||||
<%= t("views.right_panel.detail.rnd_adj_sh") %>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% grand_total = 0 %>
|
||||
<% old_grand_total = 0 %>
|
||||
<% total_tax = 0 %>
|
||||
<% guest_count = 0 %>
|
||||
<% total_sum = 0 %>
|
||||
<% discount_amt = 0 %>
|
||||
<% other_amt = 0 %>
|
||||
<% total_nett = 0 %>
|
||||
<% rounding_adj = 0%> <% gov_tax = 0 %> <% service_charge = 0 %>
|
||||
<%if @sale_data %>
|
||||
<% @sale_data.each do |result| %>
|
||||
|
||||
<% grand_total = grand_total.to_f + result.grand_total.to_f %>
|
||||
<% old_grand_total = old_grand_total.to_f + result.old_grand_total.to_f %>
|
||||
<% total_tax += result.total_tax.to_f %>
|
||||
<% total_sum += result.total_amount.to_f %>
|
||||
<% discount_amt += result.total_discount.to_f %>
|
||||
<% rounding_adj += result.rounding_adjustment.to_f %>
|
||||
|
||||
<tr>
|
||||
|
||||
<td><%= result.receipt_no rescue '-' %> </td>
|
||||
<td><%= result.cashier_name rescue '-' %></td>
|
||||
<td><%= result.total_amount rescue '-' %></td>
|
||||
<td><%= result.total_discount rescue '-' %></td>
|
||||
<%if result.customer.customer_type == "Takeaway"%>
|
||||
<td>0.0</td>
|
||||
<%end%>
|
||||
<% result.sale_taxes.each do |tax| %>
|
||||
<td><%= tax.tax_payable_amount rescue '-' %></td>
|
||||
<%end%>
|
||||
|
||||
<td><%= result.old_grand_total %></td>
|
||||
<td><%= result.rounding_adjustment.to_f rescue '-' %></td>
|
||||
<td><%= result.grand_total_after_rounding() rescue '-'%></td>
|
||||
</tr>
|
||||
<%end%>
|
||||
|
||||
<% end %>
|
||||
<tr style="border-top:4px double #666;">
|
||||
<td colspan="2"> </td>
|
||||
<td><b><%= total_sum rescue '-'%></b></td>
|
||||
<td><b><%= discount_amt rescue '-'%></b></td>
|
||||
<% @sale_taxes.each do |tax| %>
|
||||
<td><%= result.grand_total %></td>
|
||||
<td><%= result.rounding_adjustment.to_f rescue '-' %></td>
|
||||
<td><%= result.grand_total_after_rounding() rescue '-'%></td>
|
||||
</tr>
|
||||
|
||||
<% end %>
|
||||
<tr style="border-top:4px double #666;">
|
||||
<td colspan="2"> </td>
|
||||
<td><b><%= total_sum rescue '-'%></b></td>
|
||||
<td><b><%= discount_amt rescue '-'%></b></td>
|
||||
<% @sale_taxes.each do |tax| %>
|
||||
<td><b><%= tax.st_amount.round(2) %></b></td>
|
||||
<% end %>
|
||||
<td><b><%= old_grand_total.to_f.round(2) rescue '-'%></b></td>
|
||||
<td><b><%= rounding_adj rescue '-'%></b></td>
|
||||
<td><b><%= old_grand_total.to_f.round + rounding_adj %></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"> </td>
|
||||
<td>Total Amount</td>
|
||||
<td>Discount Amount</td>
|
||||
<% @sale_taxes.each do |tax| %>
|
||||
<td><%= tax.tax_name %></td>
|
||||
<% end %>
|
||||
<td>Grand Total</td>
|
||||
<td>Rounding Adj.</td>
|
||||
<td>Grand Total +<br/>
|
||||
Rounding Adj.
|
||||
</td>
|
||||
</tr>
|
||||
<%end%>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<% end %>
|
||||
<td><b><%= grand_total.to_f.round(2) rescue '-'%></b></td>
|
||||
<td><b><%= rounding_adj rescue '-'%></b></td>
|
||||
<td><b><%= grand_total.to_f.round + rounding_adj %></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"> </td>
|
||||
<td><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.amount") %></td>
|
||||
<td><%= t("views.right_panel.detail.discount") %> <%= t("views.right_panel.detail.amount") %></td>
|
||||
|
||||
<% @tax_profiles.each do |tax| %>
|
||||
<td><%= tax.name %></td>
|
||||
<% end %>
|
||||
<td><%= t("views.right_panel.detail.grand_total") %></td>
|
||||
<td><%= t("views.right_panel.detail.rnd_adj_sh") %></td>
|
||||
<td><%= t("views.right_panel.detail.grand_total") %> +<br/>
|
||||
<%= t("views.right_panel.detail.rnd_adj_sh") %>
|
||||
</td>
|
||||
</tr>
|
||||
<%end%>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -22,11 +22,11 @@
|
||||
<div class="col-lg-3 col-md-3 col-sm-3">
|
||||
<!-- <label class="">Select Shift Period</label> -->
|
||||
<label class="font-14"><%= t("views.right_panel.detail.from") %></label>
|
||||
<input data-behaviour='datepicker' class="form-control m-t-3 datepicker" name="from" id="from" type="text" placeholder="From date">
|
||||
<input data-behaviour='datepicker' class="form-control m-t-3 datepicker" name="from" id="from" type="text" placeholder="From date" style="height: 32px;">
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-3 col-sm-3">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.to") %></label>
|
||||
<input data-behaviour='datepicker' class="form-control m-t-3 datepicker" name="to" id="to" type="text" placeholder="To date">
|
||||
<input data-behaviour='datepicker' class="form-control m-t-3 datepicker" name="to" id="to" type="text" placeholder="To date" style="height: 32px;">
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14">All Shift</label>
|
||||
|
||||
@@ -49,7 +49,9 @@
|
||||
<% acc_arr = Array.new %>
|
||||
<% cate_arr = Array.new %>
|
||||
|
||||
<% sub_qty = 0 %>
|
||||
<% sub_total = 0 %>
|
||||
<% other_sub_total = 0 %>
|
||||
<% count = 0 %>
|
||||
<% total_price = 0 %>
|
||||
<% cate_count = 0 %>
|
||||
@@ -59,76 +61,116 @@
|
||||
<% total_amount = 0 %>
|
||||
<% discount = 0 %>
|
||||
<% total_item_foc = 0 %>
|
||||
<% total_item_dis = 0 %>
|
||||
<% total_item_dis = 0.0 %>
|
||||
<% total_tax = 0 %>
|
||||
|
||||
<% @sale_data.each do |sale| %>
|
||||
|
||||
<% total_qty += sale.total_item %>
|
||||
<% if sale.status_type != "Discount" && sale.status_type != "foc"
|
||||
total_qty += sale.total_item
|
||||
end %>
|
||||
|
||||
<% if !acc_arr.include?(sale.account_id) %>
|
||||
<tr>
|
||||
<td><b><%= sale.account_name %></b></td>
|
||||
<td colspan="4"> </td>
|
||||
<td><%= t("views.right_panel.detail.total_price_by") %> <%= sale.account_name %></td>
|
||||
<td>
|
||||
<% @totalByAccount.each do |account, total| %>
|
||||
<% if sale.account_id == account %>
|
||||
<b><%= total %></b>
|
||||
<% grand_total += total %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<% acc_arr.push(sale.account_id) %>
|
||||
<% if sale.status_type == "foc" && sale.grand_total < 0
|
||||
total_item_foc += sale.grand_total*(-1)
|
||||
end %>
|
||||
|
||||
<% end %>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<% if !cate_arr.include?(sale.menu_category_id) %>
|
||||
<td><%= sale.menu_category_name %></td>
|
||||
<% cate_arr.push(sale.menu_category_id) %>
|
||||
<% else %>
|
||||
<td> </td>
|
||||
<% if sale.status_type == "Discount" && sale.grand_total < 0
|
||||
total_item_dis += sale.grand_total*(-1)
|
||||
end %>
|
||||
|
||||
<% if !acc_arr.include?(sale.account_id) %>
|
||||
<tr>
|
||||
<td><b><%= sale.account_name %></b></td>
|
||||
<td colspan="4"> </td>
|
||||
<td><%= t("views.right_panel.detail.total_price_by") %> <%= sale.account_name %></td>
|
||||
<td>
|
||||
<% @totalByAccount.each do |account, total| %>
|
||||
<% if sale.account_id == account %>
|
||||
<b><%= total %></b>
|
||||
<% grand_total += total %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<% acc_arr.push(sale.account_id) %>
|
||||
<% end %>
|
||||
<td><%= sale.item_code rescue '-' %></td>
|
||||
<td><%= sale.product_name rescue '-' %></td>
|
||||
<td><%= sale.total_item rescue '-' %></td>
|
||||
<td><%= sale.unit_price rescue '-' %></td>
|
||||
<td><%= sale.grand_total rescue '-' %></td>
|
||||
</tr>
|
||||
<!-- sub total -->
|
||||
<% @menu_cate_count.each do |key,value| %>
|
||||
<% if sale.menu_category_id == key %>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<% if !cate_arr.include?(sale.menu_category_id) %>
|
||||
<td><%= sale.menu_category_name %></td>
|
||||
<% cate_arr.push(sale.menu_category_id) %>
|
||||
<% else %>
|
||||
<td> </td>
|
||||
<% end %>
|
||||
<td><%= sale.item_code rescue '-' %></td>
|
||||
<td><%= sale.product_name rescue '-' %></td>
|
||||
<td><%= sale.total_item rescue '-' %></td>
|
||||
<td><%= sale.unit_price rescue '-' %></td>
|
||||
<td><%= sale.grand_total rescue '-' %></td>
|
||||
</tr>
|
||||
<!-- sub total -->
|
||||
|
||||
<% count = count + 1 %>
|
||||
<% sub_total += sale.grand_total %>
|
||||
<% if count == value %>
|
||||
<tr>
|
||||
<td colspan="5"> </td>
|
||||
<td><%= t("views.right_panel.detail.sub_total") %></td>
|
||||
<td ><span class="underline"><%= sub_total %></span></td>
|
||||
</tr>
|
||||
<% if sale.status_type === "foc"
|
||||
total_item_foc += sale.grand_total
|
||||
end %>
|
||||
<% @menu_cate_count.each do |key,value| %>
|
||||
<% if sale.menu_category_id == key %>
|
||||
|
||||
<% if sale.status_type === "Discount"
|
||||
total_item_dis += sale.grand_total
|
||||
end %>
|
||||
<% sub_total = 0.0%>
|
||||
<% count = 0%>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% count = count + 1 %>
|
||||
<% sub_total += sale.grand_total %>
|
||||
<% sub_qty += sale.total_item %>
|
||||
<% if count == value %>
|
||||
<tr>
|
||||
<td colspan="3"> </td>
|
||||
<td><b>Total <%= sale.account_name %> Qty </b> </td>
|
||||
<td><b><%= sub_qty %></b></td>
|
||||
<td><%= t("views.right_panel.detail.sub_total") %></td>
|
||||
<td ><span class="underline"><%= sub_total %></span></td>
|
||||
</tr>
|
||||
<% sub_total = 0.0%>
|
||||
<% sub_qty = 0 %>
|
||||
<% count = 0%>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<!-- end sub total -->
|
||||
<% end %>
|
||||
|
||||
<!--Other Charges -->
|
||||
<% if @other_charges.present? %>
|
||||
<tr>
|
||||
<td><b>Other Charges</b></td>
|
||||
<td colspan="4"> </td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<% @other_charges.each do |other| %>
|
||||
<% if other.total_item > 0
|
||||
total_qty += other.total_item
|
||||
end %>
|
||||
<% grand_total +=other.grand_total%>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td>Other Charges</td>
|
||||
<td><%= other.item_code rescue '-' %></td>
|
||||
<td><%= other.product_name rescue '-' %></td>
|
||||
<td><%= other.total_item rescue '-' %></td>
|
||||
<td><%= other.unit_price rescue '-' %></td>
|
||||
<td><%= other.grand_total rescue '-' %></td>
|
||||
</tr>
|
||||
<!-- sub total -->
|
||||
|
||||
<% other_sub_total += other.grand_total %>
|
||||
<!-- end sub total -->
|
||||
<% end %>
|
||||
<tr>
|
||||
<td colspan="5"> </td>
|
||||
<td><%= t("views.right_panel.detail.sub_total") %></td>
|
||||
<td ><span><%= other_sub_total %></span></td>
|
||||
</tr>
|
||||
<%end%>
|
||||
<!-- End Other Charges -->
|
||||
<tr style="border-top:2px solid grey;">
|
||||
<td colspan="3"> </td>
|
||||
<td><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.item") %></td>
|
||||
<td><span><%= total_qty%></span></td>
|
||||
<td><%= t("views.right_panel.detail.net_amount") %></td>
|
||||
<td><span><%= grand_total%></span></td>
|
||||
<td style="border-bottom:2px solid grey;"><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.amount") %></td>
|
||||
<td style="border-bottom:2px solid grey;"><span><%= grand_total%></span></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
@@ -139,8 +181,8 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5"> </td>
|
||||
<td><%= t("views.right_panel.detail.item_discount") %> <%= t("views.right_panel.detail.amount") %></td>
|
||||
<td><span><%= total_item_dis %></span></td>
|
||||
<td style="border-bottom:2px solid grey;"><%= t("views.right_panel.detail.item_discount") %> <%= t("views.right_panel.detail.amount") %></td>
|
||||
<td style="border-bottom:2px solid grey;"><span><%= total_item_dis %></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5"> </td>
|
||||
@@ -149,9 +191,31 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5"> </td>
|
||||
<td><%= t("views.right_panel.detail.discount") %> <%= t("views.right_panel.detail.amount") %></td>
|
||||
<td><span><%= @discount_data %></span></td>
|
||||
</tr>
|
||||
<td style="border-bottom:2px solid grey;"><%= t("views.right_panel.detail.discount") %> <%= t("views.right_panel.detail.amount") %></td>
|
||||
<td style="border-bottom:2px solid grey;"><span><%= @discount_data %></span></td>
|
||||
</tr>
|
||||
|
||||
<% @sale_taxes.each do |tax| %>
|
||||
<!-- <tr>
|
||||
<td colspan="5"> </td>
|
||||
<td><%= tax.tax_name %></td>
|
||||
<td><%= tax.st_amount.round(2) %>
|
||||
<%total_tax += tax.st_amount%>
|
||||
</td>
|
||||
</tr> -->
|
||||
<% end %>
|
||||
<tr>
|
||||
<td colspan="5"> </td>
|
||||
<td style="border-top:2px solid grey;">Net Amount</td>
|
||||
<!-- <td><span class="double_underline"><%= grand_total.to_f - @discount_data.to_f%></span></td> -->
|
||||
<td style="border-top:2px solid grey;"><%= grand_total.to_f - @discount_data.to_f%></td>
|
||||
</tr>
|
||||
<!-- <tr>
|
||||
<td colspan="5"> </td>
|
||||
<td>Grand Total</td>
|
||||
|
||||
<td><span class="double_underline"><%= @grand_total - @change_amount%></span></td>
|
||||
</tr> -->
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -195,19 +259,23 @@
|
||||
|
||||
// OK button is clicked
|
||||
$('#from').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
|
||||
$('#from').val(date)
|
||||
new_date = new Date(date) ;
|
||||
month = parseInt(new_date.getMonth()+1)
|
||||
from = new_date.getDate() + "-" + month + "-" + new_date.getFullYear();
|
||||
$('#from').val(from)
|
||||
search_by_date();
|
||||
});
|
||||
$('#to').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
|
||||
$('#to').val(date)
|
||||
new_date = new Date(date) ;
|
||||
month = parseInt(new_date.getMonth()+1)
|
||||
to = new_date.getDate() + "-" + month + "-" + new_date.getFullYear();
|
||||
$('#to').val(to)
|
||||
search_by_date();
|
||||
});
|
||||
});
|
||||
|
||||
function search_by_date(){
|
||||
var to_date = new Date($('#to').val());
|
||||
var to = to_date.getDate() + "-" + to_date.getMonth() + "-" + to_date.getFullYear();
|
||||
var from_date = new Date($('#from').val());
|
||||
var from = from_date.getDate() + "-" + from_date.getMonth() + "-" + from_date.getFullYear();
|
||||
from = $("#from").val();
|
||||
to = $("#to").val();
|
||||
var period = 0;
|
||||
var period_type = 1;
|
||||
|
||||
@@ -229,12 +297,15 @@
|
||||
|
||||
function show_shift_name(period,period_type,from,to,shift_item){
|
||||
var shift = $('#shift_name');
|
||||
|
||||
if (from == '' && to == '') {
|
||||
from = $("#from").val();
|
||||
to = $("#to").val();
|
||||
}
|
||||
shift.empty();
|
||||
var selected = '';
|
||||
var str = '';
|
||||
var param_shift = '<%= params[:shift_name]%>';
|
||||
|
||||
|
||||
url = '<%= reports_get_shift_by_date_path %>';
|
||||
$.get(url, {period :period, period_type :period_type, from :from, to :to, report_type :shift_item} , function(data){
|
||||
console.log(data)
|
||||
|
||||
@@ -1,148 +1,175 @@
|
||||
<div class="container margin-top-20">
|
||||
<div class="card row">
|
||||
<div class="table-responsive">
|
||||
|
||||
|
||||
<table class="table table-striped" id="items_table" border="0">
|
||||
<thead>
|
||||
|
||||
<tr>
|
||||
<th colspan="7"> From Date : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - To Date : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%></th>
|
||||
</tr>
|
||||
<% if @shift_from %>
|
||||
<tr>
|
||||
<% if @shift_data.employee %>
|
||||
<% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %>
|
||||
<% end %>
|
||||
<th colspan="7">Shift Name = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )</th>
|
||||
</tr>
|
||||
<% end %>
|
||||
<tr>
|
||||
<th> </th>
|
||||
<th>Menu Category</th>
|
||||
<th>Code</th>
|
||||
<th>Product</th>
|
||||
<th>Total Item</th>
|
||||
<th>Unit Price</th>
|
||||
<th>Revenue</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% unless @sale_data.blank? %>
|
||||
<% acc_arr = Array.new %>
|
||||
<% cate_arr = Array.new %>
|
||||
|
||||
<% sub_total = 0.0 %>
|
||||
<% count = 0%>
|
||||
<% total_price = 0.0 %>
|
||||
<% cate_count = 0 %>
|
||||
<% acc_count = 0%>
|
||||
<% grand_total = 0%>
|
||||
<% total_qty = 0%>
|
||||
<% total_amount = 0 %>
|
||||
<% discount = 0%>
|
||||
|
||||
<% @sale_data.each do |sale| %>
|
||||
<% total_qty += sale.total_item %>
|
||||
|
||||
<% if !acc_arr.include?(sale.account_id) %>
|
||||
<tr>
|
||||
<td><b><%= sale.account_name %></b></td>
|
||||
<td colspan="4"> </td>
|
||||
<td>Total Price By <%= sale.account_name %></td>
|
||||
<td>
|
||||
<% @totalByAccount.each do |account, total| %>
|
||||
<% if sale.account_id == account %>
|
||||
<b><%= total %></b>
|
||||
<% grand_total += total %>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="margin-top-20">
|
||||
<div class="card">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped" id="items_table" border="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="7"> <%= 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>
|
||||
<% if @shift_from %>
|
||||
<tr>
|
||||
<% if @shift_data.employee %>
|
||||
<% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %>
|
||||
<% end %>
|
||||
<th colspan="7"> <%= t("views.right_panel.detail.shift_name") %> = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )</th>
|
||||
</tr>
|
||||
<% end %>
|
||||
<tr>
|
||||
<th> </th>
|
||||
<th><%= t("views.right_panel.header.menu_category") %></th>
|
||||
<th><%= t("views.right_panel.detail.code") %></th>
|
||||
<th><%= t("views.right_panel.detail.product") %></th>
|
||||
<th><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.item") %></th>
|
||||
<th><%= t("views.right_panel.detail.unit_price") %></th>
|
||||
<th><%= t("views.right_panel.detail.revenue") %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% unless @sale_data.blank? %>
|
||||
<% acc_arr = Array.new %>
|
||||
<% cate_arr = Array.new %>
|
||||
|
||||
<% sub_total = 0 %>
|
||||
<% other_sub_total = 0 %>
|
||||
<% count = 0 %>
|
||||
<% total_price = 0 %>
|
||||
<% cate_count = 0 %>
|
||||
<% acc_count = 0 %>
|
||||
<% grand_total = 0 %>
|
||||
<% total_qty = 0 %>
|
||||
<% total_amount = 0 %>
|
||||
<% discount = 0 %>
|
||||
<% total_item_foc = 0 %>
|
||||
<% total_item_dis = 0 %>
|
||||
|
||||
<% @sale_data.each do |sale| %>
|
||||
|
||||
<% if sale.total_item > 0
|
||||
total_qty += sale.total_item
|
||||
end %>
|
||||
|
||||
<% if !acc_arr.include?(sale.account_id) %>
|
||||
<tr>
|
||||
<td><b><%= sale.account_name %></b></td>
|
||||
<td colspan="4"> </td>
|
||||
<td><%= t("views.right_panel.detail.total_price_by") %> <%= sale.account_name %></td>
|
||||
<td>
|
||||
<% @totalByAccount.each do |account, total| %>
|
||||
<% if sale.account_id == account %>
|
||||
<b><%= total %></b>
|
||||
<% grand_total += total %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<% acc_arr.push(sale.account_id) %>
|
||||
<% end %>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<% if !cate_arr.include?(sale.menu_category_id) %>
|
||||
<td><%= sale.menu_category_name %></td>
|
||||
<% cate_arr.push(sale.menu_category_id) %>
|
||||
<% else %>
|
||||
<td> </td>
|
||||
<% end %>
|
||||
<td><%= sale.item_code rescue '-' %></td>
|
||||
<td><%= sale.product_name rescue '-' %></td>
|
||||
<td><%= sale.total_item rescue '-' %></td>
|
||||
<td><%= sale.unit_price rescue '-' %></td>
|
||||
<td><%= sale.grand_total rescue '-' %></td>
|
||||
</tr>
|
||||
<!-- sub total -->
|
||||
<% @menu_cate_count.each do |key,value| %>
|
||||
<% if sale.menu_category_id == key %>
|
||||
|
||||
<% count = count + 1 %>
|
||||
<% sub_total += sale.grand_total %>
|
||||
<% if count == value %>
|
||||
<tr>
|
||||
<td colspan="5"> </td>
|
||||
<td><%= t("views.right_panel.detail.sub_total") %></td>
|
||||
<td ><span class="underline"><%= sub_total %></span></td>
|
||||
</tr>
|
||||
<% if sale.status_type === "foc"
|
||||
total_item_foc += sale.grand_total
|
||||
end %>
|
||||
|
||||
<% if sale.status_type === "Discount"
|
||||
total_item_dis += sale.grand_total
|
||||
end %>
|
||||
<% sub_total = 0.0%>
|
||||
<% count = 0%>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<!-- end sub total -->
|
||||
<% end %>
|
||||
<!--Other Charges -->
|
||||
<tr>
|
||||
<td><b>Other Charges</b></td>
|
||||
<td colspan="4"> </td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<% @other_charges.each do |other| %>
|
||||
<% if other.total_item > 0
|
||||
total_qty += other.total_item
|
||||
end %>
|
||||
<% grand_total +=other.grand_total%>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td>Other Charges</td>
|
||||
<td><%= other.item_code rescue '-' %></td>
|
||||
<td><%= other.product_name rescue '-' %></td>
|
||||
<td><%= other.total_item rescue '-' %></td>
|
||||
<td><%= other.unit_price rescue '-' %></td>
|
||||
<td><%= other.grand_total rescue '-' %></td>
|
||||
</tr>
|
||||
<!-- sub total -->
|
||||
|
||||
<% other_sub_total += other.grand_total %>
|
||||
<!-- end sub total -->
|
||||
<% end %>
|
||||
<tr>
|
||||
<td colspan="5"> </td>
|
||||
<td><%= t("views.right_panel.detail.sub_total") %></td>
|
||||
<td ><span class="underline"><%= other_sub_total %></span></td>
|
||||
</tr>
|
||||
<!-- End Other Charges -->
|
||||
<tr style="border-top:2px solid grey;">
|
||||
<td colspan="3"> </td>
|
||||
<td><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.item") %></td>
|
||||
<td><span><%= total_qty%></span></td>
|
||||
<td><%= t("views.right_panel.detail.net_amount") %></td>
|
||||
<td><span><%= grand_total%></span></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<% acc_arr.push(sale.account_id) %>
|
||||
|
||||
<% end %>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<% if !cate_arr.include?(sale.menu_category_id) %>
|
||||
<td><%= sale.menu_category_name %></td>
|
||||
<% cate_arr.push(sale.menu_category_id) %>
|
||||
<% else %>
|
||||
<td> </td>
|
||||
<% end %>
|
||||
<td><%= sale.item_code rescue '-' %></td>
|
||||
<td><%= sale.product_name rescue '-' %></td>
|
||||
<td><%= sale.total_item rescue '-' %></td>
|
||||
<td><%= sale.unit_price rescue '-' %></td>
|
||||
<td><%= sale.grand_total rescue '-' %></td>
|
||||
|
||||
</tr>
|
||||
|
||||
<!-- sub total -->
|
||||
<% @menu_cate_count.each do |key,value| %>
|
||||
<% if sale.menu_category_id == key %>
|
||||
|
||||
<% count = count + 1 %>
|
||||
<% sub_total += sale.grand_total %>
|
||||
<% if count == value %>
|
||||
<tr>
|
||||
<td colspan="5"> </td>
|
||||
<td>Sub Total</td>
|
||||
<td ><span class="underline"><%= sub_total %></span></td>
|
||||
|
||||
</tr>
|
||||
<% sub_total = 0.0%>
|
||||
<% count = 0%>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<!-- end sub total -->
|
||||
|
||||
<% end %>
|
||||
|
||||
<tr style="border-top:2px solid grey;">
|
||||
<td colspan="3"> </td>
|
||||
<td>Total Item</td>
|
||||
<td><span><%= total_qty%></span></td>
|
||||
<td>Total Amount</td>
|
||||
<td><span><%= grand_total%></span></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
<tr>
|
||||
<td colspan="5"> </td>
|
||||
<td>Cash Received</td>
|
||||
<td><span><%= @cash_data - @change_amount %></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5"> </td>
|
||||
<td>Card Sales</td>
|
||||
<td><span><%= @card_data %></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5"> </td>
|
||||
<td>Credit Sales</td>
|
||||
<td><span><%= @credit_data %></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5"> </td>
|
||||
<td>FOC Sales</td>
|
||||
<td><span><%= @foc_data %></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5"> </td>
|
||||
<td>Discount Amount</td>
|
||||
<td><span><%= @discount_data %></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5"> </td>
|
||||
<td>Grand Total</td>
|
||||
<!-- <td><span class="double_underline"><%= grand_total.to_f - @discount_data.to_f%></span></td> -->
|
||||
<td><span class="double_underline"><%= @grand_total - @change_amount%></span></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<tr>
|
||||
<td colspan="5"> </td>
|
||||
<td><%= t("views.right_panel.detail.foc_item") %> <%= t("views.right_panel.detail.amount") %></td>
|
||||
<td><span><%= total_item_foc %></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5"> </td>
|
||||
<td><%= t("views.right_panel.detail.item_discount") %> <%= t("views.right_panel.detail.amount") %></td>
|
||||
<td><span><%= total_item_dis %></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5"> </td>
|
||||
<td><%= t("views.right_panel.detail.foc_sales") %></td>
|
||||
<td><span><%= @foc_data %></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5"> </td>
|
||||
<td><%= t("views.right_panel.detail.discount") %> <%= t("views.right_panel.detail.amount") %></td>
|
||||
<td><span><%= @discount_data %></span></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -5,6 +5,7 @@
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.select_period") %></label>
|
||||
<select name="period" id="sel_period" class="form-control">
|
||||
<option value=""><%= t("views.right_panel.detail.select_period") %></option>
|
||||
<option value="0">Today</option>
|
||||
<option value="1">Yesterday</option>
|
||||
<option value="2">This week</option>
|
||||
@@ -21,11 +22,11 @@
|
||||
<div class="col-lg-3 col-md-3 col-sm-3">
|
||||
<!-- <label class="font-14">Select Shift Period</label> -->
|
||||
<label class="font-14"><%= t("views.right_panel.detail.from") %></label>
|
||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="from" id="from" type="text" placeholder="From date">
|
||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="from" id="from" type="text" placeholder="From date" style="height: 32px;">
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-3 col-sm-3">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.to") %></label>
|
||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="to" id="to" type="text" placeholder="To date">
|
||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="to" id="to" type="text" placeholder="To date" style="height: 32px;">
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.all_shift") %></label>
|
||||
|
||||
@@ -54,8 +54,8 @@
|
||||
<th><%= t("views.right_panel.detail.cash_payment") %></th>
|
||||
<!-- <th>Credit Charges</th> -->
|
||||
<th><%= t("views.right_panel.detail.credit_payment") %></th>
|
||||
<!-- <th>FOC Payment</th> -->
|
||||
<th><%= t("views.btn.other_payment") %></th>
|
||||
<th><%= t("views.btn.foc") %> <%= t :payment %></th>
|
||||
<!-- <th>Grand Total
|
||||
<br/>Rounding Adj</th> -->
|
||||
<!-- <th>Rounding Adj</th> -->
|
||||
@@ -74,37 +74,42 @@
|
||||
<% g_total = 0 %>
|
||||
|
||||
<% @sale_data.each do |result|%>
|
||||
<tr>
|
||||
<td>
|
||||
<%= result.cashier_terminal.name rescue '-'%>
|
||||
</td>
|
||||
<td>
|
||||
<%= result.employee.name rescue '-'%>
|
||||
</td>
|
||||
<td><%= result.shift_started_at.strftime("%e %b %I:%M%p") rescue '-' %> -
|
||||
<%= result.shift_closed_at.strftime("%e %b %I:%M%p") rescue '-' %>
|
||||
</td>
|
||||
<!-- <td style='color:red;'>(<%= sprintf "%.2f",result.void_amount.to_f.to_d rescue '-'%>)</td> -->
|
||||
<td><%= sprintf "%.2f",result.cash_sales.to_f.to_d rescue '-'%></td>
|
||||
<td><%= sprintf "%.2f",result.credit_sales.to_f.to_d rescue '-'%></td>
|
||||
<!-- <td><%= sprintf "%.2f",result.accept_credit_amount.to_f.to_d rescue '-'%></td> -->
|
||||
<!-- <td><%= sprintf "%.2f",result.foc_amount.to_f.to_d rescue '-'%></td>
|
||||
<td><%= sprintf "%.2f",result.card_amount.to_f.to_d rescue '-'%></td> -->
|
||||
<td><%= sprintf "%.2f",result.other_sales.to_f.to_d rescue '-'%></td>
|
||||
<td><%= sprintf "%.2f",result.grand_total.to_f.to_d rescue '-'%></td>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<%= result[:cashier_terminal_name] rescue '-'%>
|
||||
</td>
|
||||
<td>
|
||||
<%= result[:employee_name] rescue '-'%>
|
||||
</td>
|
||||
<td><%= result[:shift_started_at].strftime("%e %b %I:%M%p") rescue '-' %> -
|
||||
<%= result[:shift_closed_at].strftime("%e %b %I:%M%p") rescue '-' %>
|
||||
</td>
|
||||
<!-- <td style='color:red;'>(<%= sprintf "%.2f",result.void_amount.to_f.to_d rescue '-'%>)</td> -->
|
||||
<td><%= sprintf "%.2f",result[:cash_sales].to_f.to_d rescue '-'%></td>
|
||||
<td><%= sprintf "%.2f",result[:credit_sales].to_f.to_d rescue '-'%></td>
|
||||
<!-- <td><%= sprintf "%.2f",result.accept_credit_amount.to_f.to_d rescue '-'%></td> -->
|
||||
<!-- <td><%= sprintf "%.2f",result.foc_amount.to_f.to_d rescue '-'%></td>
|
||||
<td><%= sprintf "%.2f",result.card_amount.to_f.to_d rescue '-'%></td> -->
|
||||
<td><%= sprintf "%.2f",result[:other_sales].to_f.to_d rescue '-'%></td>
|
||||
<td>
|
||||
<%= sprintf "%.2f",result[:foc_sales].to_f.to_d rescue '-'%>
|
||||
</td>
|
||||
<td><%= sprintf "%.2f",result[:grand_total].to_f.to_d rescue '-'%></td>
|
||||
|
||||
<!-- <td><%= sprintf "%.2f",result.rounding_adj.to_f.to_d rescue '-'%></td> -->
|
||||
<% grand_total = result.grand_total.to_f %>
|
||||
<!-- <td><%= sprintf "%.2f",grand_tota.to_f.to_d rescue '-'%></td> -->
|
||||
<!-- <td><%= sprintf "%.2f",result[:rounding_adj].to_f.to_d rescue '-'%></td> -->
|
||||
<% grand_total = result[:grand_total].to_f %>
|
||||
<!-- <td><%= sprintf "%.2f",grand_tota.to_f.to_d rescue '-'%></td> -->
|
||||
</tr>
|
||||
<% cash += result.cash_sales.to_f %>
|
||||
<% credit += result.credit_sales.to_f %>
|
||||
<% card += result.other_sales.to_f %>
|
||||
<% cash += result[:cash_sales].to_f %>
|
||||
<% credit += result[:credit_sales].to_f %>
|
||||
<% card += result[:other_sales].to_f %>
|
||||
<% foc += result[:foc_sales].to_f %>
|
||||
|
||||
<% total += result.grand_total.to_f %>
|
||||
<% total += result[:grand_total].to_f %>
|
||||
<% g_total += grand_total.to_f %>
|
||||
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<tr style="border-top: 3px solid grey;">
|
||||
<td colspan="3"></td>
|
||||
@@ -114,6 +119,7 @@
|
||||
<!-- <td><b><%= sprintf("%.2f",accept_credit) rescue '-'%></b></td> -->
|
||||
<!-- <td><b><%= sprintf("%.2f",foc) rescue '-'%></b></td> -->
|
||||
<td><b><%= sprintf("%.2f",card) rescue '-'%></b></td>
|
||||
<td><b><%= sprintf("%.2f",foc) rescue '-'%></b></td>
|
||||
<!-- <td><b><%= sprintf("%.2f",total) rescue '-'%></b></td> -->
|
||||
<!-- <td><b><%= sprintf("%.2f",rounding_adj) rescue '-'%></b></td> -->
|
||||
<td><b><%= sprintf("%.2f",g_total) rescue '-'%></b></td>
|
||||
@@ -127,7 +133,7 @@
|
||||
$(function(){
|
||||
|
||||
var check_arr = [];
|
||||
|
||||
search_by_period();
|
||||
$('#sel_period').change(function(){
|
||||
|
||||
search_by_period();
|
||||
@@ -145,20 +151,24 @@
|
||||
|
||||
// OK button is clicked
|
||||
$('#from').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
|
||||
$('#from').val(date)
|
||||
new_date = new Date(date) ;
|
||||
month = parseInt(new_date.getMonth()+1)
|
||||
from = new_date.getDate() + "-" + month + "-" + new_date.getFullYear();
|
||||
$('#from').val(from)
|
||||
search_by_date();
|
||||
});
|
||||
$('#to').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
|
||||
$('#to').val(date)
|
||||
new_date = new Date(date) ;
|
||||
month = parseInt(new_date.getMonth()+1)
|
||||
to = new_date.getDate() + "-" + month + "-" + new_date.getFullYear();
|
||||
$('#to').val(to)
|
||||
search_by_date();
|
||||
});
|
||||
|
||||
function search_by_date(){
|
||||
|
||||
var to_date = new Date($('#to').val());
|
||||
var to = to_date.getDate() + "-" + to_date.getMonth() + "-" + to_date.getFullYear();
|
||||
var from_date = new Date($('#from').val());
|
||||
var from = from_date.getDate() + "-" + from_date.getMonth() + "-" + from_date.getFullYear();
|
||||
from = $("#from").val();
|
||||
to = $("#to").val();
|
||||
|
||||
var period = 0;
|
||||
var period_type = 1;
|
||||
@@ -181,7 +191,10 @@
|
||||
|
||||
function show_shift_name(period,period_type,from,to,shift_item){
|
||||
var shift = $('#shift_name');
|
||||
|
||||
if (from == '' && to == '') {
|
||||
from = $("#from").val();
|
||||
to = $("#to").val();
|
||||
}
|
||||
shift.empty();
|
||||
|
||||
var str = '';
|
||||
|
||||
@@ -1,99 +1,107 @@
|
||||
<div class="container margin-top-20">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="margin-top-20">
|
||||
<!-- <div class="span11">
|
||||
<div id="report_container" style="min-width: 400px; height: 400px; margin: 0 auto"></div>
|
||||
</div> -->
|
||||
<div class="card row">
|
||||
<div class="table-responsive">
|
||||
<div class="card">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="7"> From Date : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %>
|
||||
- To Date : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%>
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
<% if @shift_from %>
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="7"> <%= 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>
|
||||
<% if @shift_from %>
|
||||
<tr>
|
||||
<% if @shift_data.employee %>
|
||||
<% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %>
|
||||
<% end %>
|
||||
<th colspan="7">Shift Name = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )</th>
|
||||
<th colspan="7"><%= t("views.right_panel.detail.shift_name") %> = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )</th>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
<tr>
|
||||
<th>Cashier Station</th>
|
||||
<th>Cashier Name</th>
|
||||
<th>Shift Name</th>
|
||||
<!-- <th>Void Amount</th> -->
|
||||
<th>Cash Payment</th>
|
||||
<!-- <th>Credit Charges</th> -->
|
||||
<th>Credit Payment</th>
|
||||
<!-- <th>FOC Payment</th> -->
|
||||
<th>Other Payment</th>
|
||||
<% end %>
|
||||
<tr>
|
||||
<th><%= t("views.right_panel.detail.cashier_station") %></th>
|
||||
<th><%= t :cashier %> <%= t("views.right_panel.detail.name") %></th>
|
||||
<th><%= t("views.right_panel.detail.shift_name") %></th>
|
||||
<!-- <th>Void Amount</th> -->
|
||||
<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>Grand Total
|
||||
<br/>Rounding Adj</th> -->
|
||||
<br/>Rounding Adj</th> -->
|
||||
<!-- <th>Rounding Adj</th> -->
|
||||
<th>Grand Total</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% void = 0%>
|
||||
<% cash = 0%>
|
||||
<% credit = 0%>
|
||||
<% accept_credit = 0%>
|
||||
<% foc = 0%>
|
||||
<% card = 0%>
|
||||
<% total = 0%>
|
||||
<% rounding_adj = 0%>
|
||||
<% g_total = 0 %>
|
||||
|
||||
<% @sale_data.each do |result|%>
|
||||
<tr>
|
||||
<td>
|
||||
<%= result.cashier_terminal.name rescue '-'%>
|
||||
</td>
|
||||
<td>
|
||||
<%= result.employee.name rescue '-'%>
|
||||
</td>
|
||||
<td><%= result.shift_started_at.strftime("%e %b %I:%M%p") rescue '-' %> -
|
||||
<%= result.shift_closed_at.strftime("%e %b %I:%M%p") rescue '-' %>
|
||||
</td>
|
||||
<!-- <td style='color:red;'>(<%= sprintf "%.2f",result.void_amount.to_f.to_d rescue '-'%>)</td> -->
|
||||
<td><%= sprintf "%.2f",result.cash_sales.to_f.to_d rescue '-'%></td>
|
||||
<td><%= sprintf "%.2f",result.credit_sales.to_f.to_d rescue '-'%></td>
|
||||
<!-- <td><%= sprintf "%.2f",result.accept_credit_amount.to_f.to_d rescue '-'%></td> -->
|
||||
<!-- <td><%= sprintf "%.2f",result.foc_amount.to_f.to_d rescue '-'%></td>
|
||||
<td><%= sprintf "%.2f",result.card_amount.to_f.to_d rescue '-'%></td> -->
|
||||
<td><%= sprintf "%.2f",result.other_sales.to_f.to_d rescue '-'%></td>
|
||||
<td><%= sprintf "%.2f",result.grand_total.to_f.to_d rescue '-'%></td>
|
||||
|
||||
<!-- <td><%= sprintf "%.2f",result.rounding_adj.to_f.to_d rescue '-'%></td> -->
|
||||
<% grand_total = result.grand_total.to_f %>
|
||||
<!-- <td><%= sprintf "%.2f",grand_tota.to_f.to_d rescue '-'%></td> -->
|
||||
</tr>
|
||||
<% cash += result.cash_sales.to_f %>
|
||||
<% credit += result.credit_sales.to_f %>
|
||||
<% card += result.other_sales.to_f %>
|
||||
|
||||
<% total += result.grand_total.to_f %>
|
||||
<% g_total += grand_total.to_f %>
|
||||
|
||||
<% end %>
|
||||
|
||||
<tr style="border-top: 3px solid grey;">
|
||||
<td colspan="3"></td>
|
||||
<!-- <td style='color:red;'><b>(<%= sprintf("%.2f",void) rescue '-'%>)</b></td> -->
|
||||
<td><b><%= sprintf("%.2f",cash) rescue '-'%></b></td>
|
||||
<td><b><%= sprintf("%.2f",credit) rescue '-'%></b></td>
|
||||
<!-- <td><b><%= sprintf("%.2f",accept_credit) rescue '-'%></b></td> -->
|
||||
<!-- <td><b><%= sprintf("%.2f",foc) rescue '-'%></b></td> -->
|
||||
<td><b><%= sprintf("%.2f",card) rescue '-'%></b></td>
|
||||
<!-- <td><b><%= sprintf("%.2f",total) rescue '-'%></b></td> -->
|
||||
<!-- <td><b><%= sprintf("%.2f",rounding_adj) rescue '-'%></b></td> -->
|
||||
<td><b><%= sprintf("%.2f",g_total) rescue '-'%></b></td>
|
||||
<th><%= t("views.right_panel.detail.grand_total") %></th>
|
||||
</tr>
|
||||
</tbody>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% void = 0%>
|
||||
<% cash = 0%>
|
||||
<% credit = 0%>
|
||||
<% accept_credit = 0%>
|
||||
<% foc = 0%>
|
||||
<% card = 0%>
|
||||
<% total = 0%>
|
||||
<% rounding_adj = 0%>
|
||||
<% g_total = 0 %>
|
||||
|
||||
<% @sale_data.each do |result|%>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<%= result[:cashier_terminal_name] rescue '-'%>
|
||||
</td>
|
||||
<td>
|
||||
<%= result[:employee_name] rescue '-'%>
|
||||
</td>
|
||||
<td><%= result[:shift_started_at].strftime("%e %b %I:%M%p") rescue '-' %> -
|
||||
<%= result[:shift_closed_at].strftime("%e %b %I:%M%p") rescue '-' %>
|
||||
</td>
|
||||
<!-- <td style='color:red;'>(<%= sprintf "%.2f",result.void_amount.to_f.to_d rescue '-'%>)</td> -->
|
||||
<td><%= sprintf "%.2f",result[:cash_sales].to_f.to_d rescue '-'%></td>
|
||||
<td><%= sprintf "%.2f",result[:credit_sales].to_f.to_d rescue '-'%></td>
|
||||
<!-- <td><%= sprintf "%.2f",result.accept_credit_amount.to_f.to_d rescue '-'%></td> -->
|
||||
<!-- <td><%= sprintf "%.2f",result.foc_amount.to_f.to_d rescue '-'%></td>
|
||||
<td><%= sprintf "%.2f",result.card_amount.to_f.to_d rescue '-'%></td> -->
|
||||
<td><%= sprintf "%.2f",result[:other_sales].to_f.to_d rescue '-'%></td>
|
||||
<td>
|
||||
<%= sprintf "%.2f",result[:foc_sales].to_f.to_d rescue '-'%>
|
||||
</td>
|
||||
<td><%= sprintf "%.2f",result[:grand_total].to_f.to_d rescue '-'%></td>
|
||||
|
||||
<!-- <td><%= sprintf "%.2f",result[:rounding_adj].to_f.to_d rescue '-'%></td> -->
|
||||
<% grand_total = result[:grand_total].to_f %>
|
||||
<!-- <td><%= sprintf "%.2f",grand_tota.to_f.to_d rescue '-'%></td> -->
|
||||
</tr>
|
||||
<% cash += result[:cash_sales].to_f %>
|
||||
<% credit += result[:credit_sales].to_f %>
|
||||
<% card += result[:other_sales].to_f %>
|
||||
<% foc += result[:foc_sales].to_f %>
|
||||
|
||||
<% total += result[:grand_total].to_f %>
|
||||
<% g_total += grand_total.to_f %>
|
||||
|
||||
<% end %>
|
||||
|
||||
<tr style="border-top: 3px solid grey;">
|
||||
<td colspan="3"></td>
|
||||
<!-- <td style='color:red;'><b>(<%= sprintf("%.2f",void) rescue '-'%>)</b></td> -->
|
||||
<td><b><%= sprintf("%.2f",cash) rescue '-'%></b></td>
|
||||
<td><b><%= sprintf("%.2f",credit) rescue '-'%></b></td>
|
||||
<!-- <td><b><%= sprintf("%.2f",accept_credit) rescue '-'%></b></td> -->
|
||||
<!-- <td><b><%= sprintf("%.2f",foc) rescue '-'%></b></td> -->
|
||||
<td><b><%= sprintf("%.2f",card) rescue '-'%></b></td>
|
||||
<td><b><%= sprintf("%.2f",foc) rescue '-'%></b></td>
|
||||
<!-- <td><b><%= sprintf("%.2f",total) rescue '-'%></b></td> -->
|
||||
<!-- <td><b><%= sprintf("%.2f",rounding_adj) rescue '-'%></b></td> -->
|
||||
<td><b><%= sprintf("%.2f",g_total) rescue '-'%></b></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -14,11 +14,11 @@
|
||||
<div class="col-lg-3 col-md-3 col-sm-3">
|
||||
<!-- <label class="">Select Shift Period</label> -->
|
||||
<label class="font-14">From</label>
|
||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="from" id="from" type="text" placeholder="From date">
|
||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="from" id="from" type="text" placeholder="From date" style="height: 32px;">
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-3 col-sm-3">
|
||||
<label class="font-14">To</label>
|
||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="to" id="to" type="text" placeholder="To date">
|
||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="to" id="to" type="text" placeholder="To date" style="height: 32px;">
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label class="font-14">Definition Item</label>
|
||||
|
||||
@@ -22,15 +22,15 @@
|
||||
<div class="form-group col-lg-2 col-md-2 col-sm-2">
|
||||
<!-- <label class="">Select Shift Period</label> -->
|
||||
<label class="font-20"><%= t("views.right_panel.detail.from") %></label>
|
||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="from" id="from" type="text" placeholder="From date">
|
||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="from" id="from" type="text" placeholder="From date" style="height: 34px;">
|
||||
</div>
|
||||
<div class="form-group col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-20"><%= t("views.right_panel.detail.to") %></label>
|
||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="to" id="to" type="text" placeholder="To date">
|
||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="to" id="to" type="text" placeholder="To date" style="height: 34px;">
|
||||
</div>
|
||||
<div class="form-group col-lg-3 col-md-3 col-sm-3">
|
||||
<label class="font-20"><%= t("views.right_panel.detail.all_shift") %></label>
|
||||
<select class="form-control select" name="shift_name" id="shift_name" >
|
||||
<select class="form-control select" name="shift_name" id="shift_name" style="height: 37px;">
|
||||
</select>
|
||||
</div>
|
||||
<div class=" col-lg-1 col-md-1 col-sm-1 margin-top-20">
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<div class="page-header">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
|
||||
<li class="breadcrumb-item active"><%= t("views.right_panel.detail.void_sale_report") %></li>
|
||||
<span class="float-right">
|
||||
<%= link_to 'Back', dashboard_path %>
|
||||
</span>
|
||||
</ol>
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
|
||||
<li class="breadcrumb-item active"><%= t("views.right_panel.detail.void_sale_report") %></li>
|
||||
<span class="float-right">
|
||||
<%= link_to 'Back', dashboard_path %>
|
||||
</span>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
@@ -90,6 +90,7 @@
|
||||
<script>
|
||||
$(function(){
|
||||
var check_arr = [];
|
||||
search_by_period();
|
||||
$('#sel_period').change(function(){
|
||||
search_by_period();
|
||||
});
|
||||
@@ -105,19 +106,23 @@
|
||||
|
||||
// OK button is clicked
|
||||
$('#from').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
|
||||
$('#from').val(date)
|
||||
new_date = new Date(date) ;
|
||||
month = parseInt(new_date.getMonth()+1)
|
||||
from = new_date.getDate() + "-" + month + "-" + new_date.getFullYear();
|
||||
$('#from').val(from)
|
||||
search_by_date();
|
||||
});
|
||||
$('#to').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
|
||||
$('#to').val(date)
|
||||
new_date = new Date(date) ;
|
||||
month = parseInt(new_date.getMonth()+1)
|
||||
to = new_date.getDate() + "-" + month + "-" + new_date.getFullYear();
|
||||
$('#to').val(to)
|
||||
search_by_date();
|
||||
});
|
||||
|
||||
function search_by_date(){
|
||||
var to_date = new Date($('#to').val());
|
||||
var to = to_date.getDate() + "-" + to_date.getMonth() + "-" + to_date.getFullYear();
|
||||
var from_date = new Date($('#from').val());
|
||||
var from = from_date.getDate() + "-" + from_date.getMonth() + "-" + from_date.getFullYear();
|
||||
from = $("#from").val();
|
||||
to = $("#to").val();
|
||||
var period = 0;
|
||||
var period_type = 1;
|
||||
|
||||
@@ -139,7 +144,10 @@
|
||||
|
||||
function show_shift_name(period,period_type,from,to,shift_item){
|
||||
var shift = $('#shift_name');
|
||||
|
||||
if (from == '' && to == '') {
|
||||
from = $("#from").val();
|
||||
to = $("#to").val();
|
||||
}
|
||||
shift.empty();
|
||||
|
||||
var str = '';
|
||||
|
||||
@@ -1,63 +1,66 @@
|
||||
<div class="container margin-top-20">
|
||||
<div class="card row">
|
||||
<% if @sale_data.count > 0 %>
|
||||
<table class="table table-striped" border="0">
|
||||
<thead>
|
||||
<% if !params[:from].blank?%>
|
||||
<tr>
|
||||
<th colspan="7">From Date : <%= params[:from] rescue '-'%> , To Date : <%= params[:to] rescue '-'%></th>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% if @shift_from %>
|
||||
<tr>
|
||||
<% if @shift %>
|
||||
<% cashier_name = !@shift.nil? ? @shift[0].employee.name : '-' %>
|
||||
<% end %>
|
||||
<th colspan="3">Shift Name = <%= @shift_from rescue '-'%> - <%= @shift_to rescue '-'%> ( <%= cashier_name rescue '-'%> )</th>
|
||||
</tr>
|
||||
<% end %>
|
||||
<tr>
|
||||
<th>Receipt No</th>
|
||||
<th>Sale Date</th>
|
||||
<th>Total Amount</th>
|
||||
<th>Grand Total</th>
|
||||
<th>Rounding Adj.</th>
|
||||
<th>Grand Total + <br/>Rounding Adj.</th>
|
||||
<!-- <th>Sale Status</th> -->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% total_amount = 0.0 %>
|
||||
<% grand_total = 0.0 %>
|
||||
<% rounding_adjustment = 0.0 %>
|
||||
<% grand_rounding_adjustment = 0.0 %>
|
||||
<% @sale_data.each do |result| %>
|
||||
<% result[:items].each do |item| %>
|
||||
<tr>
|
||||
<td><%= item.receipt_no rescue '-' %> </td>
|
||||
<td><%= item.receipt_date.utc.getlocal.strftime("%e %b %I:%M%p") rescue '-' %></td>
|
||||
<td><%= item.total_amount.to_f rescue '-'%> </td>
|
||||
<td><%= item.grand_total.to_f rescue '-'%> </td>
|
||||
<td><%= item.rounding_adjustment.to_f rescue '-' %></td>
|
||||
<td><%= item.grand_total.to_f + item.rounding_adjustment.to_f rescue '-'%> </td>
|
||||
<!-- <td><%= result.sales_status rescue '-' %> </td> -->
|
||||
<!-- <td><%= item.remarks rescue '-' %> </td> -->
|
||||
</tr>
|
||||
<% total_amount = total_amount.to_f + item.total_amount.to_f %>
|
||||
<% grand_total = grand_total.to_f + item.grand_total.to_f %>
|
||||
<% rounding_adjustment = rounding_adjustment.to_f + item.rounding_adjustment.to_f %>
|
||||
<% grand_rounding_adjustment = grand_rounding_adjustment.to_f + item.grand_total.to_f + item.rounding_adjustment.to_f %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<tr style="border-top:4px double #666;font-weight:600;">
|
||||
<td colspan="2" style="text-align:center;">Total Void Amount :</td>
|
||||
<td><%= total_amount rescue '-' %></td>
|
||||
<td><%= grand_total rescue '-' %></td>
|
||||
<td><%= rounding_adjustment rescue '-'%></td>
|
||||
<td colspan=""><%= grand_rounding_adjustment rescue '-'%></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="margin-top-20">
|
||||
<div class="card">
|
||||
<% if @sale_data.count > 0 %>
|
||||
<table class="table table-striped" border="0">
|
||||
<thead>
|
||||
<% if !params[:from].blank?%>
|
||||
<tr>
|
||||
<th colspan="7"><%= t("views.right_panel.detail.from_date") %> : <%= params[:from] rescue '-'%> , <%= t("views.right_panel.detail.to_date") %> : <%= params[:to] rescue '-'%></th>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% if @shift_from %>
|
||||
<tr>
|
||||
<% if @shift %>
|
||||
<% cashier_name = !@shift.nil? ? @shift[0].employee.name : '-' %>
|
||||
<% end %>
|
||||
<th colspan="3"><%= t("views.right_panel.detail.shift_name") %> = <%= @shift_from rescue '-'%> - <%= @shift_to rescue '-'%> ( <%= cashier_name rescue '-'%> )</th>
|
||||
</tr>
|
||||
<% end %>
|
||||
<tr>
|
||||
<th><%= t("views.right_panel.detail.receipt_no") %></th>
|
||||
<th><%= t("views.right_panel.detail.sale_date") %></th>
|
||||
<th><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.amount") %></th>
|
||||
<th><%= t("views.right_panel.detail.grand_total") %></th>
|
||||
<th><%= t("views.right_panel.detail.rnd_adj_sh") %></th>
|
||||
<th><%= t("views.right_panel.detail.grand_total") %> + <br/><%= t("views.right_panel.detail.rnd_adj_sh") %></th>
|
||||
<!-- <th>Sale Status</th> -->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% total_amount = 0.0 %>
|
||||
<% grand_total = 0.0 %>
|
||||
<% rounding_adjustment = 0.0 %>
|
||||
<% grand_rounding_adjustment = 0.0 %>
|
||||
<% @sale_data.each do |result| %>
|
||||
<% result[:items].each do |item| %>
|
||||
<tr>
|
||||
<td><%= item.receipt_no rescue '-' %> </td>
|
||||
<td><%= item.receipt_date.utc.getlocal.strftime("%e %b %I:%M%p") rescue '-' %></td>
|
||||
<td><%= item.total_amount.to_f rescue '-'%> </td>
|
||||
<td><%= item.grand_total.to_f rescue '-'%> </td>
|
||||
<td><%= item.rounding_adjustment.to_f rescue '-' %></td>
|
||||
<td><%= item.grand_total.to_f + item.rounding_adjustment.to_f rescue '-'%> </td>
|
||||
<!-- <td><%= result.sales_status rescue '-' %> </td> -->
|
||||
<!-- <td><%= item.remarks rescue '-' %> </td> -->
|
||||
</tr>
|
||||
<% total_amount = total_amount.to_f + item.total_amount.to_f %>
|
||||
<% grand_total = grand_total.to_f + item.grand_total.to_f %>
|
||||
<% rounding_adjustment = rounding_adjustment.to_f + item.rounding_adjustment.to_f %>
|
||||
<% grand_rounding_adjustment = grand_rounding_adjustment.to_f + item.grand_total.to_f + item.rounding_adjustment.to_f %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<tr style="border-top:4px double #666;font-weight:600;">
|
||||
<td colspan="2" style="text-align:center;">Total Void Amount :</td>
|
||||
<td><%= total_amount rescue '-' %></td>
|
||||
<td><%= grand_total rescue '-' %></td>
|
||||
<td><%= rounding_adjustment rescue '-'%></td>
|
||||
<td colspan="3"><%= grand_rounding_adjustment rescue '-'%></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
@@ -22,10 +22,25 @@
|
||||
<div class="col-xs-12 col-sm-12 col-md-4 col-lg-4">
|
||||
<div class="card">
|
||||
<div class="body">
|
||||
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
|
||||
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
|
||||
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
|
||||
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
|
||||
<h5><i class="material-icons md-18">view_headline <%= t("views.right_panel.header.page_detail") %></i></h5>
|
||||
<p>
|
||||
1) <%= t("views.right_panel.detail.membership_type") %> - <%= t("views.right_panel.detail.write_txt") %> <%= t("views.right_panel.detail.membership_type_txt") %> <%= t("views.right_panel.detail.name_txt2") %> <br>
|
||||
2) <%= t("views.right_panel.detail.is_active") %> - <%= t("views.right_panel.detail.checkbox") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.is_active_txt") %> <br>
|
||||
3) <%= t("views.right_panel.detail.gateway_communication_type") %> - <%= t("views.right_panel.detail.write_txt") %> <%= t("views.right_panel.detail.gateway_communication_type_txt") %> <br>
|
||||
4) <%= t("views.right_panel.detail.gateway_url") %> - <%= t("views.right_panel.detail.write_txt") %> <%= t("views.right_panel.detail.gateway_url_txt") %> <br>
|
||||
5) <%= t("views.right_panel.detail.auth_token") %> - <%= t("views.right_panel.detail.write_txt") %> <%= t("views.right_panel.detail.auth_token_txt") %> <br>
|
||||
6) <%= t("views.right_panel.detail.merchant_account") %> - <%= t("views.right_panel.detail.write_txt") %> <%= t("views.right_panel.detail.merchant_account_txt") %> <br>
|
||||
7) <%= t("views.right_panel.detail.created_by") %> - <%= t("views.right_panel.detail.write_txt") %> <%= t("views.right_panel.detail.created_by_txt") %> <br>
|
||||
</p>
|
||||
<h5><i class="material-icons md-18">list <%= t("views.right_panel.header.button_lists") %></i> </h5>
|
||||
<p>
|
||||
1) <%= t("views.right_panel.button.submit") %> - <%= t("views.right_panel.detail.submit_btn_txt") %> <%= t("views.right_panel.detail.membership_actions_txt") %> <br>
|
||||
</p>
|
||||
<h5><i class="material-icons md-18">list <%= t("views.right_panel.header.link_lists") %></i> </h5>
|
||||
<p>
|
||||
1) <%= t("views.right_panel.button.home") %> - <%= t("views.right_panel.detail.home_txt") %> <br>
|
||||
2) <%= t("views.right_panel.button.back") %> - <%= t("views.right_panel.detail.back_txt") %> <%= t("views.right_panel.detail.membership_actions_txt") %> <br>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
|
||||
<div class="page-header">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li>
|
||||
<li class="breadcrumb-item"><a href="<%= settings_membership_actions_path %>">Membership Actions</a></li>
|
||||
<li class="breadcrumb-item active">Edit</li>
|
||||
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
|
||||
<li class="breadcrumb-item"><a href="<%= settings_membership_actions_path %>"><%= t("views.right_panel.detail.setting_membership_actions") %></a></li>
|
||||
<li class="breadcrumb-item active"><%= t("views.btn.edit") %></li>
|
||||
<span class="float-right">
|
||||
<%= link_to t('.back', :default => t("views.btn.back")), settings_membership_actions_path %>
|
||||
</span>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<div class="page-header">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li>
|
||||
<li class="breadcrumb-item active">Settings Membership Actions</li>
|
||||
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
|
||||
<li class="breadcrumb-item active"><%= t("views.right_panel.detail.setting_membership_actions") %></li>
|
||||
<span class="float-right">
|
||||
<%= link_to t('.back', :default => t("views.btn.back")), dashboard_path %>
|
||||
</span>
|
||||
@@ -20,11 +20,11 @@
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Membership type</th>
|
||||
<th><%= t("views.right_panel.detail.membership_type") %></th>
|
||||
<!-- <th>Gateway url</th> -->
|
||||
<th>Merchant account</th>
|
||||
<th><%= t("views.right_panel.detail.merchant_account") %></th>
|
||||
|
||||
<th>Actions</th>
|
||||
<th><%= t("views.right_panel.detail.actions") %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -48,10 +48,25 @@
|
||||
<div class="col-xs-12 col-sm-12 col-md-3 col-lg-3">
|
||||
<div class="card">
|
||||
<div class="body">
|
||||
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
|
||||
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
|
||||
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
|
||||
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
|
||||
<h5>
|
||||
<i class="material-icons md-18">view_headline <%= t("views.right_panel.header.page_detail") %></i>
|
||||
</h5>
|
||||
<p>
|
||||
1) <%= t("views.right_panel.detail.membership_type") %> - <%= t("views.right_panel.detail.membership_type_txt") %> <br>
|
||||
2) <%= t("views.right_panel.detail.merchant_account") %> - <%= t("views.right_panel.detail.merchant_account_txt") %> <br>
|
||||
3) <%= t("views.right_panel.detail.actions") %> - <%= t("views.right_panel.detail.actions_txt") %> <%= t("views.right_panel.detail.membership_actions_txt") %> <br>
|
||||
</p>
|
||||
<h5><i class="material-icons md-18">list <%= t("views.right_panel.header.button_lists") %></i> </h5>
|
||||
<p>
|
||||
1) <%= t("views.right_panel.button.new") %> - <%= t("views.right_panel.detail.new_btn_txt") %> <%= t("views.right_panel.detail.membership_actions_txt") %> <br>
|
||||
2) <%= t("views.right_panel.button.show") %> - <%= t("views.right_panel.detail.show_btn_txt") %> <%= t("views.right_panel.detail.membership_actions_txt") %> <br>
|
||||
3) <%= t("views.right_panel.button.edit") %> - <%= t("views.right_panel.detail.edit_btn_txt") %> <%= t("views.right_panel.detail.membership_actions_txt") %> <br>
|
||||
</p>
|
||||
<h5><i class="material-icons md-18">list <%= t("views.right_panel.header.link_lists") %></i> </h5>
|
||||
<p>
|
||||
1) <%= t("views.right_panel.button.home") %> - <%= t("views.right_panel.detail.home_txt") %> <br>
|
||||
2) <%= t("views.right_panel.button.back") %> - <%= t("views.right_panel.detail.back_txt") %> <%= t("views.right_panel.detail.dashboard_txt") %> <br>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
|
||||
<div class="page-header">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li>
|
||||
<li class="breadcrumb-item"><a href="<%= settings_membership_actions_path %>">Membership Actions</a></li>
|
||||
<li class="breadcrumb-item active">New</li>
|
||||
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
|
||||
<li class="breadcrumb-item"><a href="<%= settings_membership_actions_path %>"><%= t("views.right_panel.detail.setting_membership_actions") %></a></li>
|
||||
<li class="breadcrumb-item active"><%= t("views.btn.new") %></li>
|
||||
<span class="float-right">
|
||||
<%= link_to t('.back', :default => t("views.btn.back")), settings_membership_actions_path %>
|
||||
</span>
|
||||
|
||||
@@ -1,69 +1,101 @@
|
||||
|
||||
<div class="page-header">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li>
|
||||
<li class="breadcrumb-item"><a href="<%= settings_membership_actions_path %>">Membership Actions</a></li>
|
||||
<li class="breadcrumb-item active">Details</li>
|
||||
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
|
||||
<li class="breadcrumb-item"><a href="<%= settings_membership_actions_path %>"><%= t("views.right_panel.detail.setting_membership_actions") %></a></li>
|
||||
<li class="breadcrumb-item active"><%= t :details %></li>
|
||||
<span class="float-right">
|
||||
<%= link_to t('.back', :default => t("views.btn.back")), settings_membership_actions_path %>
|
||||
</span>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Membership type</th>
|
||||
<td><%= @settings_membership_action.membership_type %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Is active</th>
|
||||
<td><%= @settings_membership_action.is_active %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Gateway communication type</th>
|
||||
<td><%= @settings_membership_action.gateway_communication_type %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Gateway url</th>
|
||||
<td><%= @settings_membership_action.gateway_url %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Auth token</th>
|
||||
<td><%= @settings_membership_action.auth_token %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Merchant account</th>
|
||||
<td><%= @settings_membership_action.merchant_account_id %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Created by</th>
|
||||
<td><%= @settings_membership_action.created_by %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Additional parameter</th>
|
||||
<td><%= @settings_membership_action.additional_parameter %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td colspan="" align="">
|
||||
<%= link_to t("views.btn.edit"), edit_settings_membership_action_path(@settings_membership_action),:class => 'btn btn-primary btn-sm waves-effect' %>
|
||||
<button class="delete btn btn-danger btn-sm waves-effect" data-ref="<%= settings_membership_action_path(@settings_membership_action)%>" data-method="delete" disabled>
|
||||
<%= t("views.btn.delete") %>
|
||||
</button>
|
||||
|
||||
<span class="hidden" id="delete_text">
|
||||
<h6>Are you sure you want to delete this row ?</h6>
|
||||
<h6>This action can't be undo. </h6>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-md-8 col-lg-8">
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><%= t("views.right_panel.detail.membership_type") %></th>
|
||||
<td><%= @settings_membership_action.membership_type %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><%= t("views.right_panel.detail.is_active") %></th>
|
||||
<td><%= @settings_membership_action.is_active %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><%= t("views.right_panel.detail.gateway_communication_type") %></th>
|
||||
<td><%= @settings_membership_action.gateway_communication_type %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><%= t("views.right_panel.detail.gateway_url") %></th>
|
||||
<td><%= @settings_membership_action.gateway_url %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><%= t("views.right_panel.detail.auth_token") %></th>
|
||||
<td><%= @settings_membership_action.auth_token %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><%= t("views.right_panel.detail.merchant_account") %></th>
|
||||
<td><%= @settings_membership_action.merchant_account_id %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><%= t("views.right_panel.detail.created_by") %></th>
|
||||
<td><%= @settings_membership_action.created_by %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><%= t("views.right_panel.detail.additional_parameter") %></th>
|
||||
<td><%= @settings_membership_action.additional_parameter %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td colspan="" align="">
|
||||
<%= link_to t("views.btn.edit"), edit_settings_membership_action_path(@settings_membership_action),:class => 'btn btn-primary btn-sm waves-effect' %>
|
||||
<button class="delete btn btn-danger btn-sm waves-effect" data-ref="<%= settings_membership_action_path(@settings_membership_action)%>" data-method="delete" disabled>
|
||||
<%= t("views.btn.delete") %>
|
||||
</button>
|
||||
|
||||
<span class="hidden" id="delete_text">
|
||||
<h6>Are you sure you want to delete this row ?</h6>
|
||||
<h6>This action can't be undo. </h6>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12 col-md-4 col-lg-4">
|
||||
<div class="card">
|
||||
<div class="body">
|
||||
<h5><%= t("views.right_panel.header.membership_actions") %></h5>
|
||||
<h5><i class="material-icons md-18">view_headline <%= t("views.right_panel.header.page_detail") %></i></h5>
|
||||
<p>
|
||||
1) <%= t("views.right_panel.detail.membership_type") %> - <%= t("views.right_panel.detail.membership_type_txt") %> <br>
|
||||
2) <%= t("views.right_panel.detail.is_active") %> - <%= t("views.right_panel.detail.membership_type_txt") %> <%= t("views.right_panel.detail.is_active_txt") %> <br>
|
||||
3) <%= t("views.right_panel.detail.gateway_communication_type") %> - <%= t("views.right_panel.detail.gateway_communication_type_txt") %><br>
|
||||
4) <%= t("views.right_panel.detail.gateway_url") %> - <%= t("views.right_panel.detail.gateway_url_txt") %><br>
|
||||
5) <%= t("views.right_panel.detail.auth_token") %> - <%= t("views.right_panel.detail.auth_token_txt") %><br>
|
||||
6) <%= t("views.right_panel.detail.merchant_account") %> - <%= t("views.right_panel.detail.merchant_account_txt") %><br>
|
||||
7) <%= t("views.right_panel.detail.created_by") %> - <%= t("views.right_panel.detail.created_by_txt") %> <%= t("views.right_panel.detail.membership_actions_txt") %> <br>
|
||||
8) <%= t("views.right_panel.detail.actions") %> - <%= t("views.right_panel.detail.actions_txt2") %> <%= t("views.right_panel.detail.membership_actions_txt") %> <br>
|
||||
</p>
|
||||
<h5><i class="material-icons md-18">list <%= t("views.right_panel.header.button_lists") %></i> </h5>
|
||||
<p>
|
||||
1) <%= t("views.right_panel.button.edit") %> - <%= t("views.right_panel.detail.edit_btn_txt") %> <%= t("views.right_panel.detail.membership_actions_txt") %> <br>
|
||||
2) <%= t("views.right_panel.button.delete") %> - <%= t("views.right_panel.detail.delete_btn_txt") %> <%= t("views.right_panel.detail.membership_actions_txt") %> <br>
|
||||
</p>
|
||||
<h5><i class="material-icons md-18">list <%= t("views.right_panel.header.link_lists") %></i> </h5>
|
||||
<p>
|
||||
1) <%= t("views.right_panel.button.home") %> - <%= t("views.right_panel.detail.home_txt") %> <br>
|
||||
2) <%= t("views.right_panel.button.back") %> - <%= t("views.right_panel.detail.back_txt") %> <%= t("views.right_panel.detail.dashboard_txt") %> <br>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@@ -24,10 +24,27 @@
|
||||
<div class="col-xs-12 col-sm-12 col-md-4 col-lg-4">
|
||||
<div class="card">
|
||||
<div class="body">
|
||||
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
|
||||
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
|
||||
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
|
||||
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
|
||||
<h5><i class="material-icons md-18">view_headline <%= t("views.right_panel.header.page_detail") %></i></h5>
|
||||
<p>
|
||||
1) <%= t("views.right_panel.detail.membership_type") %> - <%= t("views.right_panel.detail.write_txt") %> <%= t("views.right_panel.detail.membership_type_txt") %> <%= t("views.right_panel.detail.name_txt2") %> <br>
|
||||
2) <%= t("views.right_panel.detail.is_active") %> - <%= t("views.right_panel.detail.checkbox") %> <%= t("views.right_panel.detail.is_active_txt") %> <br>
|
||||
3) <%= t("views.right_panel.detail.gateway_communication_type") %> - <%= t("views.right_panel.detail.write_txt") %> <%= t("views.right_panel.detail.gateway_communication_type_txt") %> <br>
|
||||
4) <%= t("views.right_panel.detail.gateway_url") %> - <%= t("views.right_panel.detail.write_txt") %> <%= t("views.right_panel.detail.gateway_url_txt") %> <br>
|
||||
5) <%= t("views.right_panel.detail.auth_token") %> - <%= t("views.right_panel.detail.write_txt") %> <%= t("views.right_panel.detail.auth_token_txt") %> <br>
|
||||
6) <%= t("views.right_panel.detail.discount") %> - <%= t("views.right_panel.detail.checkbox") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.discount_txt") %> <br>
|
||||
7) <%= t("views.right_panel.detail.rebate") %> - <%= t("views.right_panel.detail.checkbox") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.rebate_txt") %> <br>
|
||||
8) <%= t("views.right_panel.detail.bonus") %> - <%= t("views.right_panel.detail.checkbox") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.bonus_txt") %> <br>
|
||||
9) <%= t("views.right_panel.detail.point") %> - <%= t("views.right_panel.detail.checkbox") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.point_txt") %> <br>
|
||||
</p>
|
||||
<h5><i class="material-icons md-18">list <%= t("views.right_panel.header.button_lists") %></i> </h5>
|
||||
<p>
|
||||
1) <%= t("views.right_panel.button.submit") %> - <%= t("views.right_panel.detail.submit_btn_txt") %> <%= t("views.right_panel.detail.membership_setting_txt") %> <br>
|
||||
</p>
|
||||
<h5><i class="material-icons md-18">list <%= t("views.right_panel.header.link_lists") %></i> </h5>
|
||||
<p>
|
||||
1) <%= t("views.right_panel.button.home") %> - <%= t("views.right_panel.detail.home_txt") %> <br>
|
||||
2) <%= t("views.right_panel.button.back") %> - <%= t("views.right_panel.detail.back_txt") %> <%= t("views.right_panel.detail.membership_setting_txt") %> <br>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
|
||||
<div class="page-header">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li>
|
||||
<li class="breadcrumb-item">Membership Setting</li>
|
||||
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
|
||||
<li class="breadcrumb-item"><%= t("views.right_panel.detail.membership_setting") %></li>
|
||||
<span class="float-right">
|
||||
<%= link_to t('.back', :default => t("views.btn.back")), dashboard_path %>
|
||||
</span>
|
||||
@@ -17,16 +17,16 @@
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Membership type</th>
|
||||
<th>Is active</th>
|
||||
<th>Gateway communication type</th>
|
||||
<th><%= t("views.right_panel.detail.membership_type") %></th>
|
||||
<th><%= t("views.right_panel.detail.is_active") %></th>
|
||||
<th><%= t("views.right_panel.detail.gateway_communication_type") %></th>
|
||||
<!-- <th>Gateway url</th> -->
|
||||
<!-- <th>Auth token</th>
|
||||
<th>Merchant account</th> -->
|
||||
<th>Discount</th>
|
||||
<th>Rebate</th>
|
||||
<th>Bonus</th>
|
||||
<th>Points</th>
|
||||
<th><%= t("views.right_panel.detail.discount") %></th>
|
||||
<th><%= t("views.right_panel.detail.rebate") %></th>
|
||||
<th><%= t("views.right_panel.detail.bonus") %></th>
|
||||
<th><%= t("views.right_panel.detail.point") %></th>
|
||||
<th ></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -55,10 +55,27 @@
|
||||
<div class="col-xs-12 col-sm-12 col-md-3 col-lg-3">
|
||||
<div class="card">
|
||||
<div class="body">
|
||||
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
|
||||
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
|
||||
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
|
||||
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
|
||||
<h5>
|
||||
<i class="material-icons md-18">view_headline <%= t("views.right_panel.header.page_detail") %></i>
|
||||
</h5>
|
||||
<p>
|
||||
1) <%= t("views.right_panel.detail.membership_type") %> - <%= t("views.right_panel.detail.membership_type_txt") %> <%= t("views.right_panel.detail.name_txt") %> <br>
|
||||
2) <%= t("views.right_panel.detail.is_active") %> - <%= t("views.right_panel.detail.is_active_txt") %> <br>
|
||||
3) <%= t("views.right_panel.detail.gateway_communication_type") %> - <%= t("views.right_panel.detail.gateway_communication_type_txt") %> <br>
|
||||
4) <%= t("views.right_panel.detail.discount") %> - <%= t("views.right_panel.detail.discount_txt") %> <br>
|
||||
5) <%= t("views.right_panel.detail.rebate") %> - <%= t("views.right_panel.detail.rebate_txt") %> <br>
|
||||
6) <%= t("views.right_panel.detail.bonus") %> - <%= t("views.right_panel.detail.bonus_txt") %> <br>
|
||||
7) <%= t("views.right_panel.detail.point") %> - <%= t("views.right_panel.detail.point_txt") %> <br>
|
||||
</p>
|
||||
<h5><i class="material-icons md-18">list <%= t("views.right_panel.header.button_lists") %></i> </h5>
|
||||
<p>
|
||||
1) <%= t("views.right_panel.button.new") %> - <%= t("views.right_panel.detail.new_btn_txt") %> <%= t("views.right_panel.detail.membership_setting_txt") %> <br>
|
||||
</p>
|
||||
<h5><i class="material-icons md-18">list <%= t("views.right_panel.header.link_lists") %></i> </h5>
|
||||
<p>
|
||||
1) <%= t("views.right_panel.button.home") %> - <%= t("views.right_panel.detail.home_txt") %> <br>
|
||||
2) <%= t("views.right_panel.button.back") %> - <%= t("views.right_panel.detail.back_txt") %> <%= t("views.right_panel.detail.dashboard_txt") %> <br>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
<th><%= t("views.right_panel.detail.name") %></th>
|
||||
<th><%= t("views.right_panel.detail.alt_name") %></th>
|
||||
<th><%= t("views.right_panel.detail.is_available") %></th>
|
||||
<th><%= t("views.right_panel.detail.order_by") %></th>
|
||||
<!-- <th><%= t("views.right_panel.detail.order_by") %></th> -->
|
||||
<th><%= t("views.right_panel.detail.parent") %></th>
|
||||
<th><%= t("views.right_panel.detail.actions") %></th>
|
||||
</tr>
|
||||
@@ -43,7 +43,7 @@
|
||||
<td><%= link_to settings_menu_category.name, settings_menu_category_path(settings_menu_category) %></td>
|
||||
<td><%= settings_menu_category.alt_name rescue ''%></td>
|
||||
<td><%= settings_menu_category.is_available rescue false%></td>
|
||||
<td><%= settings_menu_category.order_by rescue ''%></td>
|
||||
<!-- <td><%= settings_menu_category.order_by rescue ''%></td> -->
|
||||
<td><%= settings_menu_category.parent.name rescue ''%></td>
|
||||
<td><%= link_to t("views.btn.edit"), edit_settings_menu_category_path(settings_menu_category),:class => 'btn btn-info btn-sm waves-effect' %>
|
||||
</td></td>
|
||||
@@ -51,8 +51,8 @@
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<%= paginate @settings_menu_categories, param_name: :page, :outer_window => 3 %>
|
||||
</div>
|
||||
<%= paginate @settings_menu_categories, param_name: :page, :outer_window => 3 %>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12 col-md-3 col-lg-3">
|
||||
<div class="card">
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
<td><%= @settings_menu_category.menu.name %></td>
|
||||
<td><%= @settings_menu_category.name rescue "-" %></td>
|
||||
<td><%= @settings_menu_category.alt_name %></td>
|
||||
<td><%= settings_menu_category.is_available rescue false%></td>
|
||||
<td><%= @settings_menu_category.is_available rescue false%></td>
|
||||
<!-- <td><%= @settings_menu_category.order_by %></td> -->
|
||||
<td><%= @settings_menu_category.created_at.utc.getlocal.strftime("%Y-%m-%d") %></td>
|
||||
<td><%= link_to t("views.btn.edit"), edit_settings_menu_menu_category_path(@settings_menu_category, @settings_menu_category),:class => 'btn btn-primary btn-sm waves-effect' %>
|
||||
|
||||
@@ -3,15 +3,26 @@
|
||||
<div class="card">
|
||||
<div class="body">
|
||||
<%= simple_form_for([:settings,@item, @settings_menu_item_instances]) do |f| %>
|
||||
<%= f.error_notification %>
|
||||
<% if(flash["instance_code_error"]) %>
|
||||
<div class="alert alert-danger">Please review the problems below:</div>
|
||||
<% end %>
|
||||
|
||||
<div class="col-md- panel">
|
||||
<div class="form-group p-l-15">
|
||||
<%= f.input :item_instance_code %>
|
||||
<%= f.input :item_instance_code ,:input_html=>{:class=>""},:required=>true %>
|
||||
|
||||
<% flash.each do |test, msg| %>
|
||||
<% str="[\"#{msg['item_instance_code']}\"]"
|
||||
str.gsub!('["', '')
|
||||
str.gsub!('"]', '')
|
||||
%>
|
||||
<span class="help-block"><%= str %></span>
|
||||
<% end %>
|
||||
|
||||
<%= f.input :item_instance_name %>
|
||||
<%= f.input :price %>
|
||||
|
||||
<%= f.input :item_attributes, collection: MenuItemAttribute.collection, input_html: { multiple: true } %>
|
||||
<%= f.input :item_attributes, collection: @item.item_attributes, include_blank: false, include_hidden: false%>
|
||||
|
||||
<%= f.input :is_on_promotion %>
|
||||
<%= f.input :promotion_price %>
|
||||
|
||||
@@ -51,14 +51,14 @@
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 align-center">
|
||||
<%= f.submit "Update",:class => 'btn btn-primary btn-lg waves-effect', :style => "width: 150px" %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-actions">
|
||||
<%= f.submit "Update",:class => 'btn btn-primary btn-lg waves-effect' %>
|
||||
</div>
|
||||
<br>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12 col-md-3 col-lg-3">
|
||||
|
||||
@@ -106,39 +106,39 @@
|
||||
</div>
|
||||
-->
|
||||
<div class="row">
|
||||
<% arr = MenuItem.active.order("name desc").pluck(:name,:item_code) %>
|
||||
<% arr = MenuItem.active.joins("JOIN menu_item_instances as b ON b.menu_item_id=menu_items.id").group("menu_items.id").order("name desc").pluck(:name,:item_code) %>
|
||||
<% Product.order("name desc").pluck(:name,:item_code).each do |p| %>
|
||||
<% arr.push(p) %>
|
||||
<% arr.push(p) %>
|
||||
<% end %>
|
||||
<div class="col-md-3 form-group">
|
||||
<label class="control-label"><abbr title="required">*</abbr> Item</label>
|
||||
<select class="form-control item_code_place">
|
||||
<% if !@promotion.original_product.nil? %>
|
||||
<% menuiteminstance = MenuItemInstance.find_by_item_instance_code(@promotion.original_product) %>
|
||||
<% if menuiteminstance.nil?%>
|
||||
<% code = @promotion.original_product %>
|
||||
<% else %>
|
||||
<% code = menuiteminstance.menu_item.item_code %>
|
||||
<% end %>
|
||||
<% menuiteminstance = MenuItemInstance.find_by_item_instance_code(@promotion.original_product) %>
|
||||
<% if menuiteminstance.nil?%>
|
||||
<% code = @promotion.original_product %>
|
||||
<% else %>
|
||||
<% code = menuiteminstance.menu_item.item_code %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<option value="" selected>Choose Something</option>
|
||||
<% arr.each do |a| %>
|
||||
<% if a[1] == code %>
|
||||
<option value="<%= a[1]%>" selected><%= a[0] %></option>
|
||||
<% else %>
|
||||
<option value="<%= a[1]%>"><%= a[0] %></option>
|
||||
<% end %>
|
||||
<% if a[1] == code %>
|
||||
<option value="<%= a[1]%>" selected><%= a[0] %></option>
|
||||
<% else %>
|
||||
<option value="<%= a[1]%>"><%= a[0] %></option>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<% sample = [] %>
|
||||
<% if !@promotion.original_product.nil? %>
|
||||
<% if !MenuItemInstance.find_by_item_instance_code(@promotion.original_product).nil? %>
|
||||
<% sample = MenuItemInstance.where("item_instance_code=?",@promotion.original_product).pluck(:item_instance_name,:item_instance_code)%>
|
||||
<% else %>
|
||||
<% sample = Product.where("item_code=?",@promotion.original_product).pluck(:name,:item_code)%>
|
||||
<% end %>
|
||||
<% if !MenuItemInstance.find_by_item_instance_code(@promotion.original_product).nil? %>
|
||||
<% sample = MenuItemInstance.where("item_instance_code=?",@promotion.original_product).pluck(:item_instance_name,:item_instance_code)%>
|
||||
<% else %>
|
||||
<% sample = Product.where("item_code=?",@promotion.original_product).pluck(:name,:item_code)%>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<div class="col-md-3 form-group"><%= f.input :original_product,collection: sample %></div>
|
||||
<!-- <div class="col-md-6"><%= f.input :original_product,collection: MenuItemInstance.order("item_instance_name desc").pluck(:item_instance_name,:item_instance_code),input_html: { selected: 2 } %></div> -->
|
||||
@@ -160,7 +160,7 @@
|
||||
<%= f.fields_for :promotion_products do |pro| %>
|
||||
<div class="row">
|
||||
<%= pro.hidden_field :item_code,:class => "promo_product" %>
|
||||
<% arr = MenuItem.active.order("name desc").pluck(:name,:item_code) %>
|
||||
<% arr = MenuItem.joins("JOIN menu_item_instances as b ON b.menu_item_id=menu_items.id").group("menu_items.id").order("name desc").pluck(:name,:item_code) %>
|
||||
<% Product.order("name desc").pluck(:name,:item_code).each do |p| %>
|
||||
<% arr.push(p) %>
|
||||
<% end %>
|
||||
@@ -247,9 +247,10 @@
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
|
||||
$(document).ready(function(){
|
||||
if(($('.item_code_place').val()!=undefined) && ($('.item_code_place').val()!="")){
|
||||
getItemInstance($('.item_code_place').val());
|
||||
}
|
||||
|
||||
$('#promotion_promo_start_hour').on('change', function(event) {
|
||||
$('#promotion_promo_start_hour').val($('#promotion_promo_start_hour').val().split(":")[0]+":00");
|
||||
@@ -273,7 +274,7 @@
|
||||
});
|
||||
|
||||
var dayy = $("#promotion_promo_day").val().replace("[","").replace("]","");
|
||||
jQuery.each( dayy.split(","), function( i, d ) {
|
||||
$.each( dayy.split(","), function( i, d ) {
|
||||
$("input.selectDay[value='"+d+"']").prop( "checked", true );
|
||||
});
|
||||
|
||||
@@ -324,8 +325,13 @@
|
||||
// $(".item_code_place").select2();
|
||||
|
||||
$(".item_code_place").on('change', function(event) {
|
||||
var ajax_url = "<%= settings_find_item_instance_path %>";
|
||||
var item_code = this.value;
|
||||
getItemInstance(item_code);
|
||||
});
|
||||
|
||||
function getItemInstance(item_code) {
|
||||
var ajax_url = "<%= settings_find_item_instance_path %>";
|
||||
var original_product = "<%= @promotion.original_product %>";
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: ajax_url,
|
||||
@@ -334,13 +340,15 @@
|
||||
$("#promotion_original_product").empty();
|
||||
var itemlist;
|
||||
for (var i = 0; i < result.length; i++) {
|
||||
itemlist += "<option value ="+result[i][1]+">"+result[i][0]+"</option>"
|
||||
var selected = "";
|
||||
if(original_product == result[i][1]) selected = "selected";
|
||||
itemlist += "<option value ="+result[i][1]+" "+selected+">"+result[i][0]+"</option>"
|
||||
}
|
||||
$("#promotion_original_product").append(itemlist);
|
||||
//$("#promotion_original_product").select2();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//$(".promotion_promotion_products_item_code select").select2();
|
||||
//$(".item_code_place1").select2();
|
||||
@@ -356,7 +364,7 @@
|
||||
|
||||
// for promotion products data showing
|
||||
var promopdt = $(".promo_product");
|
||||
jQuery.each( promopdt, function( i, ppdt ) {
|
||||
$.each( promopdt, function( i, ppdt ) {
|
||||
var ajax_url = "<%= settings_find_parent_item_path %>";
|
||||
var item_code = ppdt.value;
|
||||
var select_id = ppdt.id;
|
||||
@@ -365,14 +373,33 @@
|
||||
url: ajax_url,
|
||||
data: 'item_instance_code=' + item_code,
|
||||
success: function (result) {
|
||||
// console.log(result);
|
||||
var par_item_code = "";
|
||||
var arr_item_inst = "";
|
||||
if((result[0]!=undefined) && (result[0]!="")){
|
||||
$.each(result[0],function(k,val){
|
||||
par_item_code = k;
|
||||
arr_item_inst = val;
|
||||
});
|
||||
}
|
||||
|
||||
if(result.length > 0){
|
||||
$("select#"+select_id).empty();
|
||||
$("select#"+select_id).append("<option value='"+item_code+"'>"+result[0]+"</option>");
|
||||
$("select#"+select_id).parent().parent().siblings("div.menu_item_choose").find("select").find("option[value='"+result[1]+"']").attr("selected","true")
|
||||
var iteminstlists;
|
||||
$.each(arr_item_inst,function(k2,v2al){
|
||||
$("select#"+select_id).empty();
|
||||
var selected = "";
|
||||
$.each(v2al,function(k3,v3al){
|
||||
if(k3 == item_code) selected = "selected";
|
||||
iteminstlists += "<option value='"+k3+"' "+selected+">"+v3al+"</option>";
|
||||
});
|
||||
});
|
||||
$("select#"+select_id).append(iteminstlists);
|
||||
|
||||
$("select#"+select_id).parent().parent().siblings("div.menu_item_choose").find("select").find("option[value='"+par_item_code+"']").attr("selected","true")
|
||||
// $("select#"+select_id).parent().parent().siblings("div.menu_item_choose").find("select").select2();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// promotion_promotion_products_attributes_0_item_code
|
||||
@@ -394,8 +421,8 @@
|
||||
}
|
||||
$("select#"+id).append(itemlist);
|
||||
//$("select#"+id).select2();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -10,12 +10,14 @@
|
||||
<%= f.input :item_code,:input_html => {:class => "col-md-9"} %>
|
||||
<%= f.input :name,:input_html => {:class => "col-md-9"} %>
|
||||
<%= f.input :alt_name,:input_html => {:class => "col-md-9"} %>
|
||||
<%= f.input :type, :collection => ["SimpleMenuItem","SetMenuItem"], :input_html => {:class => "col-md-9"},:input_html => {:class => "col-md-9"} %>
|
||||
<%= f.input :type, :collection => ["SimpleMenuItem","SetMenuItem"], :input_html => {:class => "col-md-9"},:input_html => {:class => "col-md-9"}, include_blank: false, include_hidden: false %>
|
||||
<%= f.input :min_qty,:input_html => {:class => "col-md-9"} %>
|
||||
<%= f.input :account_id, :label => "Account type", :collection => Account.collection,:input_html => {:class => "col-md-9"} %>
|
||||
<%= f.input :account_id, :label => "Account type", :collection => Account.collection,:input_html => {:class => "col-md-9"}, include_blank: false, include_hidden: false %>
|
||||
|
||||
<%= f.input :is_available,:input_html => {:class => "col-md-9"} %>
|
||||
|
||||
<%= f.input :taxable,:input_html => {:class => "col-md-9"} %>
|
||||
|
||||
<%= f.input :is_sub_item,:input_html => {:class => "col-md-9"} %>
|
||||
|
||||
<%= f.input :unit, :collection => Lookup.collection_of("unit") ,:input_html => {:class => "col-md-9"} %>
|
||||
|
||||
@@ -10,12 +10,14 @@
|
||||
<%= f.input :item_code,:input_html => {:class => "col-md-9"} %>
|
||||
<%= f.input :name,:input_html => {:class => "col-md-9"} %>
|
||||
<%= f.input :alt_name,:input_html => {:class => "col-md-9"} %>
|
||||
<%= f.input :type, :collection => ["SimpleMenuItem","SetMenuItem"], :input_html => {:class => "col-md-9"} %>
|
||||
<%= f.input :type, :collection => ["SimpleMenuItem","SetMenuItem"], :input_html => {:class => "col-md-9"}, include_blank: false, include_hidden: false %>
|
||||
<%= f.input :min_qty,:input_html => {:class => "col-md-9"} %>
|
||||
<%= f.input :account_id, :label => "Account type", :collection => Account.collection,:input_html => {:class => "col-md-9"} %>
|
||||
<%= f.input :account_id, :label => "Account type", :collection => Account.collection,:input_html => {:class => "col-md-9"}, include_blank: false, include_hidden: false %>
|
||||
|
||||
<%= f.input :is_available,:input_html => {:class => "col-md-9"} %>
|
||||
|
||||
<%= f.input :taxable,:input_html => {:class => "col-md-9"} %>
|
||||
|
||||
<%= f.input :is_sub_item,:input_html => {:class => "col-md-9"} %>
|
||||
|
||||
<%= f.input :unit, :collection => Lookup.collection_of("unit") ,:input_html => {:class => "col-md-9"} %>
|
||||
|
||||
@@ -107,7 +107,9 @@
|
||||
|
||||
<td><%= settings_menu_item.item_instance_code %></td>
|
||||
<td><%= settings_menu_item.item_instance_name %></td>
|
||||
<td><%= settings_menu_item.item_attributes %></td>
|
||||
<td>
|
||||
<%= MenuItemAttribute.where(id: settings_menu_item.item_attributes).pluck(:name) %>
|
||||
</td>
|
||||
<td><%= settings_menu_item.price %></td>
|
||||
<!-- <td><%= settings_menu_item.is_on_promotion %></td> -->
|
||||
<td><%= settings_menu_item.promotion_price %></td>
|
||||
|
||||
1
app/views/sym_control/run.html.erb
Executable file
1
app/views/sym_control/run.html.erb
Executable file
@@ -0,0 +1 @@
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<div class="row clearfix">
|
||||
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4">
|
||||
<label><%= t("views.right_panel.detail.enter_keyboards") %></label>
|
||||
<input type="text" id="receipt_no" name="receipt_no" class="form-control" placeholder="" style="margin-right: 10px">
|
||||
<input type="text" id="receipt_no" name="receipt_no" class="form-control" placeholder="Booking/Sale ID" style="margin-right: 10px">
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
|
||||
<label class=""><%= t("views.right_panel.detail.from") %></label>
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
<td><%=shift_sale.cashier_terminal.name%></td>
|
||||
<td><%= shift_sale.shift_started_at.utc.getlocal.strftime('%d-%m-%Y %I:%M %p') %>
|
||||
</td>
|
||||
<td><%= shift_sale.shift_started_at.utc.getlocal.strftime('%d-%m-%Y %I:%M %p') rescue '-' %>
|
||||
<td><%= shift_sale.shift_closed_at.utc.getlocal.strftime('%d-%m-%Y %I:%M %p') rescue '-' %>
|
||||
</td>
|
||||
<td><%=shift_sale.opening_balance %></td>
|
||||
<td><%=shift_sale.closing_balance %></td>
|
||||
|
||||
Reference in New Issue
Block a user