Merge branch 'august_spring' of bitbucket.org:code2lab/sxrestaurant into august_spring

This commit is contained in:
Nweni
2017-08-24 18:04:57 +06:30
25 changed files with 412 additions and 222 deletions

View File

@@ -3,7 +3,7 @@
<div><strong id="order-title">COMMISSIONERS </strong></div>
</div>
<div class="card-block">
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem; min-height:600px; max-height:600px; overflow-x:scroll;">
<div class="card-columns" id="commissioners" style="float: left; padding-top:10px; column-gap: 1.2rem; min-height:600px; max-height:600px; overflow-x:scroll;">
<% @commissioners.each do |commissioner| %>
<div class="card tables green text-white" data-id="<%= commissioner.id %>">
<div class="card-block">

View File

@@ -8,6 +8,7 @@
<%= f.input :amount %>
<%= f.input :commission_type, :collection => ['Percentage','Net Amount'], prompt: 'Select Commission Type', class: 'form-control' %>
<label><%= f.check_box :is_active %> Active </label>
</div><br>
<div class="form-actions">
<%= link_to 'Back', origami_commissions_path, class: 'btn btn-success' %>

View File

@@ -1,7 +1,7 @@
<div class="row">
<!-- Column One -->
<div class="col-lg-5 col-md-5 col-sm-5" style="height: 100%">
<%= render 'origami/commissioners/commissioners_form', commissioners: @commissioners %>
<%= render 'origami/commissions/commissioners', commissioners: @commissioners %>
</div>
<!-- Column Two -->
@@ -210,7 +210,11 @@
url: ajax_url,
data: 'sale_item_id=' + sale_item_id,
success: function (result) {
// window.location.href = '/origami/table/' + table_id;
$('#commissioners').empty();
result.forEach(function (t) {
sale_item = "<div class=\"card tables green text-white\" data-id=" + t.id + ">" + "<div class=\"card-block\">" + t.name + "</div>" + "</div>"
$('#commissioners').append(sale_item);
})
}
});
})

View File

@@ -310,39 +310,40 @@
</div>
</div>
<!-- Column Three -->
<div class="col-lg-1 col-md-1 col-sm-1">
<!-- Waiter Buttons -->
<!-- Column Three -->
<div class="col-lg-1 col-md-1 col-sm-1">
<!-- Waiter Buttons -->
<button type="button" class="btn btn-primary btn-block" id='back' >Back</button>
<button type="button" id="add_order" class="btn btn-primary btn-block" >Add Order</button>
<% if @dining.bookings.length >= 1 %>
<% if @status_order == 'order' && @status_sale != 'sale' %>
<button type="button" id="customer" class="btn btn-primary btn-block" disabled>Customer</button>
<button type="button" class="btn btn-primary btn-block" disabled >Edit</button>
<button type="button" id="discount" class="btn btn-primary btn-block" disabled>Discount</button>
<button type="button" id="other-charges" class="btn btn-primary btn-block" disabled>Charges</button>
<button type="button" class="btn btn-primary btn-block" id='move'>Move</button>
<button type="button" id="request_bills" class="btn btn-primary btn-block">Req.Bill</button>
<button type="button" id="first_bill" class="btn btn-primary btn-block" disabled>First Bill</button>
<button type="button" id="pay" class="btn btn-primary btn-block" disabled>Pay</button>
<button type="button" class="btn btn-primary btn-block" disabled> Void </button>
<% else %>
<button type="button" id="customer" class="btn btn-primary btn-block" >Customer</button>
<button type="button" class="btn btn-primary btn-block" id='edit'>Edit</button>
<button type="button" id="discount" class="btn btn-primary btn-block" >Discount</button>
<button type="button" id="other-charges" class="btn btn-primary btn-block" >Charges</button>
<button type="button" class="btn btn-primary btn-block" id='move' disabled="">Move</button>
<button type="button" id="request_bills" class="btn btn-primary btn-block" disabled> Req.Bill</button>
<button type="button" id="first_bill" class="btn btn-primary btn-block">First Bill</button>
<button type="button" id="pay" class="btn btn-primary btn-block">Pay</button>
<button type="button" id="void" class="btn btn-primary btn-block" > Void </button>
<% end %>
<!-- Cashier Buttons -->
<button type="button" class="btn btn-primary btn-block" id='back'>Back</button>
<button type="button" id="add_order" class="btn btn-primary btn-block">Add Order</button>
<% if @dining.bookings.length >= 1 %>
<% if @status_order == 'order' && @status_sale != 'sale' %>
<button type="button" id="customer" class="btn btn-primary btn-block" disabled>Customer</button>
<button type="button" class="btn btn-primary btn-block" disabled>Edit</button>
<button type="button" id="discount" class="btn btn-primary btn-block" disabled>Discount</button>
<button type="button" id="other-charges" class="btn btn-primary btn-block" disabled>Charges</button>
<button type="button" class="btn btn-primary btn-block" id='move'>Move</button>
<button type="button" id="request_bills" class="btn btn-primary btn-block">Req.Bill</button>
<button type="button" id="first_bill" class="btn btn-primary btn-block" disabled>First Bill</button>
<button type="button" id="pay" class="btn btn-primary btn-block" disabled>Pay</button>
<button type="button" class="btn btn-primary btn-block" disabled> Void</button>
<% else %>
<button type="button" id="customer" class="btn btn-primary btn-block">Customer</button>
<button type="button" class="btn btn-primary btn-block" id='edit'>Edit</button>
<button type="button" id="discount" class="btn btn-primary btn-block">Discount</button>
<button type="button" id="other-charges" class="btn btn-primary btn-block">Charges</button>
<button type="button" id="commissions" class="btn btn-primary btn-block">Commissions</button>
<button type="button" class="btn btn-primary btn-block" id='move' disabled="">Move</button>
<button type="button" id="request_bills" class="btn btn-primary btn-block" disabled> Req.Bill</button>
<button type="button" id="first_bill" class="btn btn-primary btn-block">First Bill</button>
<button type="button" id="pay" class="btn btn-primary btn-block">Pay</button>
<button type="button" id="void" class="btn btn-primary btn-block"> Void</button>
<% end %>
<!-- Cashier Buttons -->
<!-- <button type="button" id="re-print" class="btn btn-primary btn-block" >Re.Print</button> -->
<% end %>
</div>
<!-- <button type="button" id="re-print" class="btn btn-primary btn-block" >Re.Print</button> -->
<% end %>
</div>
</div>
<script>
$(document).ready(function () {

View File

@@ -1,10 +1,33 @@
<%= simple_form_for(@in_juty) do |f| %>
<div class="col-md-3">
<%= simple_form_for([:origami,@in_juty]) do |f| %>
<%= f.error_notification %>
<div class="form-inputs">
</div>
<%= f.label :dinning_id %>
<%= f.collection_select :dinning_id, DiningFacility.all, :id, :name, {prompt: 'Select Dining Facilities'}, {class: 'form-control'} %><br/>
<%= f.label :commissioner_ids %>
<%= f.collection_select :commissioner_ids, Commissioner.all, :id, :name, {prompt: 'Select Commissioner'}, {class: 'form-control'} %><br/>
<label>In time</label>
<%= f.text_field :in_time, :value=>DateTime.now.strftime("%Y-%m-%d / %I:%M %p"),:class=>"form-control datepicker"%><br/>
<label>Out time</label>
<%= f.text_field :out_time, :value=>DateTime.now.strftime("%Y-%m-%d / %I:%M %p"),:class=>"form-control datepicker"%>
</div><br>
<div class="form-actions">
<%= f.button :submit %>
<%= link_to 'Back', origami_in_juties_path, class: 'btn btn-success' %>
<%= f.button :submit, class: 'btn btn-info' %>
</div>
<% end %>
</div>
<script type="text/javascript">
$(function() {
$('.datepicker').datepicker({
format : 'dd-mm-yyyy',
autoclose: true
});
$('.datepicker').attr('ReadOnly','true');
$('.datepicker').css('cursor','pointer');
});
</script>

View File

@@ -1,6 +1,10 @@
<h1>Editing In Juty</h1>
<%= render 'form', in_juty: @in_juty %>
<%= link_to 'Show', @in_juty %> |
<%= link_to 'Back', in_juties_path %>
<div class="span12">
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= origami_root_path %>">Home</a></li>
<li><a href="<%= origami_in_juties_path %>">In Juties</a></li>
<li>Edit</li>
</ul>
</div>
<%= render 'form', in_juty: @in_juty %>
</div>

View File

@@ -1,25 +1,38 @@
<p id="notice"><%= notice %></p>
<h1>In Juties</h1>
<table>
<thead>
<tr>
<th colspan="3"></th>
</tr>
</thead>
<tbody>
<% @in_juties.each do |in_juty| %>
<tr>
<td><%= link_to 'Show', in_juty %></td>
<td><%= link_to 'Edit', edit_in_juty_path(in_juty) %></td>
<td><%= link_to 'Destroy', in_juty, method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</tbody>
</table>
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= origami_root_path %>">Home</a></li>
<li>In Juties</li>
<span style="float: right">
<%= link_to t('.new', :default => t("helpers.links.new")), new_origami_in_juty_path, :class => 'btn btn-primary btn-sm' %>
</span>
</ul>
</div>
<br>
<div class="card">
<table class="table table-striped">
<thead>
<tr>
<th>Dining Facility Name</th>
<th>Commissioner Ids</th>
<th>In time</th>
<th>Out time</th>
<th colspan="3"></th>
</tr>
</thead>
<%= link_to 'New In Juty', new_in_juty_path %>
<tbody>
<% @in_juties.each do |in_juty| %>
<tr>
<td><%= in_juty.dining_facility.name rescue '-' %></td>
<td><%= in_juty.commissioner.name rescue '-' %></td>
<td><%= in_juty.in_time.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") rescue '-' %></td>
<td><%= in_juty.out_time.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") rescue '-' %></td>
<td><%= link_to 'Show', origami_in_juty_path(in_juty) %></td>
<td><%= link_to 'Edit', edit_origami_in_juty_path(in_juty) %></td>
<td><%= link_to 'Destroy', origami_in_juty_path(in_juty), method: :delete, data: {confirm: 'Are you sure?'} %></td>
</tr>
<% end %>
</tbody>
</table>
</div>

View File

@@ -1,5 +1,10 @@
<h1>New In Juty</h1>
<%= render 'form', in_juty: @in_juty %>
<%= link_to 'Back', in_juties_path %>
<div class="span12">
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= origami_root_path %>">Home</a></li>
<li><a href="<%= origami_in_juties_path %>">In Juties</a></li>
<li>New</li>
</ul>
</div>
<%= render 'form', in_juty: @in_juty %>
</div>

View File

@@ -1,4 +1,43 @@
<p id="notice"><%= notice %></p>
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= origami_root_path %>">Home</a></li>
<li><a href="<%= origami_in_juties_path %>">In Juties</a></li>
<%= link_to 'Edit', edit_in_juty_path(@in_juty) %> |
<%= link_to 'Back', in_juties_path %>
<span style="float: right">
</span>
</ul>
</div>
<div class="card">
<div class="card-block">
<h4 class="card-title">In Juty</h4>
<table class="table">
<tbody>
<tr>
<td style="width:20%">Dining Facility Name</td>
<td><%= @in_juty.dining_facility.name%></td>
</tr>
<tr>
<td style="width:20%">Commissioner Name</td>
<td>
<%= @in_juty.commissioner.name rescue '-' %>
</td>
</tr>
<tr>
<td style="width:20%">In Time</td>
<td><%= @in_juty.in_time.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") rescue '-' %></td>
</tr>
<tr>
<td style="width:20%">Out Time</td>
<td><%= @in_juty.out_time.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") rescue '-' %></td>
</tr>
</tbody>
</table>
<%= link_to 'Back', origami_in_juties_path, class: 'btn btn-success' %>
<%= link_to 'Edit', edit_origami_in_juty_path(@in_juty), class: 'btn btn-info' %>
<%= link_to 'Destroy', origami_in_juty_path(@in_juty), method: :delete, data: {confirm: 'Are you sure?'}, class: 'btn btn-danger' %>
</div>
</div>
</div>

View File

@@ -1,3 +1,4 @@
<%= simple_nested_form_for([:settings,@promotion]) do |f| %>
<%= f.error_notification %>
@@ -9,22 +10,34 @@
</div>
<div class="row">
<div class="col-md-6">
<span>Promo Start Date</span>
<span>* Promo Start Date</span>
<%= f.date_field :promo_start_date, :placeholder => "From Date" , :class => "form-control"%>
<br>
</div>
<div class="col-md-6">
<span>Promo End Date</span>
<span>* Promo End Date</span>
<%= f.date_field :promo_end_date ,:placeholder => "To Date" , :class => "form-control"%>
</div>
</div>
<div class="row">
<div class="col-md-6">
<%= f.input :promo_start_hour %>
<!-- <span>* Promo Start Hour</span> -->
<% if !@promotion.promo_start_hour.nil?%>
<%= f.input :promo_start_hour, as: :string, input_html: { :value => @promotion.promo_start_hour.utc.strftime('%H:%M') } %>
<% else %>
<%= f.input :promo_start_hour, as: :string, input_html: { } %>
<% end %>
<!-- <span>Promo Start Hour</span>
<%= text_field_tag :promo_start_hour , nil, :placeholder => "From Time", :id => "fromtime", :class => 'form-control' %> -->
</div>
<div class="col-md-6"><%= f.input :promo_end_hour %></div>
<div class="col-md-6">
<!-- <span>* Promo End Hour</span> -->
<% if !@promotion.promo_end_hour.nil?%>
<%= f.input :promo_end_hour, as: :string, input_html: {:value => @promotion.promo_end_hour.utc.strftime('%H:%M') } %>
<% else %>
<%= f.input :promo_end_hour, as: :string, input_html: {} %>
<% end %>
</div>
</div>
<div class="row">
<div class="col-md-12"><%= f.input :promo_day %></div>
@@ -36,28 +49,59 @@
</div>
</div>
<div class="row">
<div class="col-md-6"><%= f.input :original_product,collection: MenuItem.order("name desc"),input_html: { selected: 2 } %></div>
<div class="col-md-6"><%= f.input :original_product,collection: MenuItem.order("name desc").pluck(:name,:item_code),input_html: { selected: 2 } %></div>
<div class="col-md-6"><%= f.input :min_qty %></div>
</div>
<br>
<p><%= f.link_to_add "Add Product", :promotion_products, :class => 'btn btn-primary' %></p>
<br>
<%= f.fields_for :promotion_products do |p| %>
<div class="row">
<div class="col-md-1"><%= p.input :item_code , :class => "form-control" %></div>
<div class="col-md-1"><%= p.input :min_qty , :class => "form-control" %></div>
<div class="col-md-1"><%= p.input :net_off , :class => "form-control" %></div>
<div class="col-md-1"><%= p.input :net_price , :class => "form-control" %></div>
<div class="col-md-1"><%= p.input :percentage , :class => "form-control" %></div>
<div class="col-md-1" style='padding-top:30px;'><%= p.link_to_remove "X"%></div>
<div class="" style="border: 1px solid #cccccc;padding:1%">
<div class="row">
<div class="col-md-2" style="text-align:center">Item Code</div>
<div class="col-md-2" style="text-align:center">Min Qty</div>
<div class="col-md-2" style="text-align:center">Net off</div>
<div class="col-md-2" style="text-align:center">Net Price</div>
<div class="col-md-2" style="text-align:center">Percentage</div>
<div class="col-md-2" style="text-align:center"></div>
</div>
<div class="row"></div >
<%= f.fields_for :promotion_products do |pro| %>
<div class="row">
<div class="col-md-2"><%= pro.input :item_code, label: false,collection: MenuItem.order("name desc").pluck(:name,:item_code)%></div>
<div class="col-md-2"><%= pro.input :min_qty , label: false%></div>
<div class="col-md-2"><%= pro.input :net_off , label: false %></div>
<div class="col-md-2"><%= pro.input :net_price , label: false %></div>
<div class="col-md-2"><%= pro.input :percentage , label: false %></div>
<div class="col-md-2" style="text-align:right"><%= pro.link_to_remove "X" %></div>
</div>
<% end %>
<div class="row">
<div class="col-md-12" style="text-align:right;"><%= f.link_to_add "Add Product", :promotion_products, :class => 'btn btn-primary' %></div>
</div>
</div>
<% end %>
</div>
</div>
<br>
<div class="form-actions">
<%= f.button :submit %>
</div>
<% end %>
<script>
$(document).ready(function(){
$('#promotion_promo_start_date').datetimepicker({
timepicker:false,
format:'Y-m-d'
});
$('#promotion_promo_end_date').datetimepicker({
timepicker:false,
format:'Y-m-d'
});
$('#promotion_promo_start_hour').datetimepicker({
datepicker:false,
format:'H:m'
});
$('#promotion_promo_end_hour').datetimepicker({
datepicker:false,
format:'H:m'
});
});
</script>

View File

@@ -35,13 +35,11 @@
<td><%= link_to pro.promo_code, settings_promotion_path(pro) %></td>
<td><%= pro.promo_start_date %></td>
<td><%= pro.promo_end_date %></td>
<td><%= pro.promo_start_hour.strftime("%I:%M %P") rescue "-" %></td>
<td><%= pro.promo_end_hour.strftime("%I:%M %P") rescue "-" %></td>
<td><%= pro.promo_start_hour.utc.strftime("%I:%M %P") rescue "-" %></td>
<td><%= pro.promo_end_hour.utc.strftime("%I:%M %P") rescue "-" %></td>
<td><%= pro.promo_day %></td>
<td>
<% if MenuItem.exists?(pro.original_product) %>
<%= MenuItem.find(pro.original_product).name %>
<% end %>
<%= MenuItem.find_by_item_code(pro.original_product).name rescue "-"%>
</td>
<% if Employee.exists?(pro.created_by) %>
<td><%= Employee.find(pro.created_by).name %></td>

View File

@@ -17,8 +17,8 @@
<tr><td style="width:20%">Promotion code</td><td><%= @promotion.promo_code %></td></tr>
<tr><td style="width:20%">Promotion Start Date</td><td><%= @promotion.promo_start_date %></td></tr>
<tr><td style="width:20%">Promotion End Date</td><td><%= @promotion.promo_end_date %></td></tr>
<tr><td style="width:20%">Promotion Start Hour</td><td><%= @promotion.promo_start_hour %></td></tr>
<tr><td style="width:20%">Promotion Start Hour</td><td><%= @promotion.promo_end_hour %></td></tr>
<tr><td style="width:20%">Promotion Start Hour</td><td><%= @promotion.promo_start_hour.utc.strftime("%I:%M %P") rescue "-" %></td></tr>
<tr><td style="width:20%">Promotion Start Hour</td><td><%= @promotion.promo_end_hour.utc.strftime("%I:%M %P") rescue "-" %></td></tr>
<tr><td style="width:20%"><%= link_to 'Edit', edit_settings_promotion_path(@promotion) %></td><td><%= link_to 'Destroy', settings_promotion_path(@promotion), method: :delete, data: { confirm: 'Are you sure?' } %></td></tr>