back btn for pending

This commit is contained in:
phyusin
2018-05-22 10:59:56 +06:30
7 changed files with 42 additions and 30 deletions

View File

@@ -1091,7 +1091,12 @@ $(function() {
if (type == true) {
var table_type = $('#table_id').find("option:selected").data('type');
var table_id = $('#table_id').val();
window.location.href = "/origami/dashboard";
if(window.location.href.includes("modify_order")){
var link_url = window.location.href.split("/");
window.location.href = "/origami/quick_service/pending_order/"+link_url[link_url.length - 1];
}else{
window.location.href = "/origami/dashboard";
}
}else{
var table_type = $('#table_type').text();
var table_id = $('#table_id').text();

View File

@@ -3,6 +3,6 @@ class PrintSetting < ApplicationRecord
validates_presence_of :name, :unique_code, :printer_name, :api_settings, :page_width, :page_height, :print_copies, :header_font_size, :item_font_size
def self.get_precision_delimiter
PrintSetting.find_by_unique_code("ReceiptBillPdf")
PrintSetting.find_by_unique_code("CloseCashierPdf")
end
end

View File

@@ -219,14 +219,14 @@ class ReceiptBillA5Pdf < Prawn::Document
move_down line_move
y_position = cursor
bounding_box([0,y_position], :width =>self.item_width + self.price_width, :height => self.item_height) do
text "Sub Total", :size => self.item_font_size,:align => :left
text "Sub Total", :size => self.item_font_size,:align => :left
end
bounding_box([self.item_width + self.price_width + 11,y_position], :width =>self.qty_width, :height => self.item_height) do
text "#{number_with_precision(total_qty, :precision => precision.to_i, :delimiter => delimiter)}", :size => self.item_font_size,:align => :center
text "#{number_with_precision(total_qty, :precision => precision.to_i, :delimiter => delimiter)}", :size => self.item_font_size,:align => :center
end
bounding_box([self.item_width + self.price_width + 8,y_position], :width =>self.total_width, :height => self.item_height) do
text "#{number_with_precision(sub_total, :precision => precision.to_i, :delimiter => delimiter)}", :size => self.item_font_size,:align => :right
end
text "#{number_with_precision(sub_total, :precision => precision.to_i, :delimiter => delimiter)}", :size => self.item_font_size,:align => :right
end
end
def item_row(item,precision,delimiter,product_name,price,qty ,total_price)
@@ -550,22 +550,29 @@ class ReceiptBillA5Pdf < Prawn::Document
break;
end
end
if sale_data.payment_status == "foc"
if sale_data.payment_status == "foc" || sale_data.payment_status == "waste" || sale_data.payment_status == "spoile"
y_position = cursor
stroke_horizontal_rule
bounding_box([self.label_width,y_position], :width =>self.description_width) do
move_down 70
stroke_horizontal_rule
end
move_down 70
stroke_horizontal_rule
end
bounding_box([self.label_width,y_position], :width =>self.description_width) do
move_down 73
text "Acknowledged By" , :size => self.item_font_size,:align => :center
end
end
if sale_data.payment_status == "foc"
bounding_box([self.label_width,y_position], :width =>self.description_width) do
move_down 73
text "Acknowledged By" , :size => self.item_font_size,:align => :center
end
elsif sale_data.payment_status == "waste" || sale_data.payment_status == "spoile"
bounding_box([self.label_width,y_position], :width =>self.description_width) do
move_down 73
text "Approved By" , :size => self.item_font_size,:align => :center
end
end
end
end

View File

@@ -213,13 +213,13 @@ class ReceiptBillPdf < Prawn::Document
move_down line_move
y_position = cursor
bounding_box([0,y_position], :width =>self.item_width + self.price_width, :height => self.item_height) do
text "Sub Total", :size => self.item_font_size,:align => :left
text "Sub Total", :size => self.item_font_size,:align => :left
end
bounding_box([self.item_width + self.price_width + 11,y_position], :width =>self.qty_width, :height => self.item_height) do
text "#{number_with_precision(total_qty, :precision => precision.to_i, :delimiter => delimiter)}", :size => self.item_font_size,:align => :center
text "#{number_with_precision(total_qty, :precision => precision.to_i, :delimiter => delimiter)}", :size => self.item_font_size,:align => :center
end
bounding_box([self.item_width + self.price_width + 8,y_position], :width =>self.total_width, :height => self.item_height) do
text "#{number_with_precision(sub_total, :precision => precision.to_i, :delimiter => delimiter)}", :size => self.item_font_size,:align => :right
text "#{number_with_precision(sub_total, :precision => precision.to_i, :delimiter => delimiter)}", :size => self.item_font_size,:align => :right
end
end

View File

@@ -346,12 +346,10 @@
</div>
</div>
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1">
<% if @cashier_type!="quick_service" %>
<button type="button" class="btn btn-block btn-default waves-effect" id='back'>
<i class="material-icons">reply</i>
Back
</button>
<% end %>
<!-- -->
<% if current_login_employee.role == "cashier" %>
<a class="btn btn-block bg-deep-purple waves-effect access_modal" data-toggle="modal" data-type="foc"> FOC</a>
@@ -603,10 +601,11 @@ var customer_name = "<%= @customer.name %>";
$("#back").on('click', function() {
localStorage.removeItem('cash');
customer_display_view(null,"reload");
var sale_id = $('#sale_id').text();
if (cashier_type=="cashier") {
window.location.href = '/origami/table/'+ dining_id;
}else{
window.location.href = '/origami/quick_service';
window.location.href = '/origami/quick_service/pending_order/'+sale_id;
}
});

View File

@@ -170,7 +170,7 @@
<div class="col-lg-2 col-md-2 col-sm-2">
<button type="button" class="btn btn-default btn-block" id='back'><i class="material-icons">reply</i>Back</button>
<% if current_user.role != "waiter" || @status != "sale"%>
<button type="button" id="addorder" class="btn bg-blue btn-block">Add Order</button>
<button type="button" id="addorder" class="btn bg-blue btn-block">Update Order</button>
<%end%>
<!-- <% if @status != "order"%>
<button type="button" id="survey" class="btn btn-block bg-blue waves-effect"><%= t("views.right_panel.detail.survey") %></button>
@@ -215,10 +215,11 @@ $(document).ready(function(){
$('#addorder').on('click', function () {
var table_id = "<%=@table_id%>";
var booking_id = "<%=@bookings.booking_id%>";
var sale_id = $("#sale_id").val();
if (table_id) {
window.location.href = '/origami/quick_service/modify_order/' + table_id+"/"+$('#sale_id').val();
window.location.href = '/origami/quick_service/modify_order/' + table_id+"/"+sale_id;
}else{
window.location.href = '/origami/quick_service/modify_order/'+ booking_id+"/" +$('#sale_id').val();
window.location.href = '/origami/quick_service/modify_order/'+ booking_id+"/" +sale_id;
}
});

View File

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