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) { if (type == true) {
var table_type = $('#table_id').find("option:selected").data('type'); var table_type = $('#table_id').find("option:selected").data('type');
var table_id = $('#table_id').val(); 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{ }else{
var table_type = $('#table_type').text(); var table_type = $('#table_type').text();
var table_id = $('#table_id').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 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 def self.get_precision_delimiter
PrintSetting.find_by_unique_code("ReceiptBillPdf") PrintSetting.find_by_unique_code("CloseCashierPdf")
end end
end end

View File

@@ -219,13 +219,13 @@ class ReceiptBillA5Pdf < Prawn::Document
move_down line_move move_down line_move
y_position = cursor y_position = cursor
bounding_box([0,y_position], :width =>self.item_width + self.price_width, :height => self.item_height) do 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 end
bounding_box([self.item_width + self.price_width + 11,y_position], :width =>self.qty_width, :height => self.item_height) do 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 end
bounding_box([self.item_width + self.price_width + 8,y_position], :width =>self.total_width, :height => self.item_height) do 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
end end
@@ -550,23 +550,30 @@ class ReceiptBillA5Pdf < Prawn::Document
break; break;
end end
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 y_position = cursor
stroke_horizontal_rule stroke_horizontal_rule
bounding_box([self.label_width,y_position], :width =>self.description_width) do bounding_box([self.label_width,y_position], :width =>self.description_width) do
move_down 70 move_down 70
stroke_horizontal_rule stroke_horizontal_rule
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
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 end
end end
def footer(printed_status) def footer(printed_status)

View File

@@ -213,13 +213,13 @@ class ReceiptBillPdf < Prawn::Document
move_down line_move move_down line_move
y_position = cursor y_position = cursor
bounding_box([0,y_position], :width =>self.item_width + self.price_width, :height => self.item_height) do 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 end
bounding_box([self.item_width + self.price_width + 11,y_position], :width =>self.qty_width, :height => self.item_height) do 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 end
bounding_box([self.item_width + self.price_width + 8,y_position], :width =>self.total_width, :height => self.item_height) do 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
end end

View File

@@ -346,12 +346,10 @@
</div> </div>
</div> </div>
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1"> <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'> <button type="button" class="btn btn-block btn-default waves-effect" id='back'>
<i class="material-icons">reply</i> <i class="material-icons">reply</i>
Back Back
</button> </button>
<% end %>
<!-- --> <!-- -->
<% if current_login_employee.role == "cashier" %> <% 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> <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() { $("#back").on('click', function() {
localStorage.removeItem('cash'); localStorage.removeItem('cash');
customer_display_view(null,"reload"); customer_display_view(null,"reload");
var sale_id = $('#sale_id').text();
if (cashier_type=="cashier") { if (cashier_type=="cashier") {
window.location.href = '/origami/table/'+ dining_id; window.location.href = '/origami/table/'+ dining_id;
}else{ }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"> <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> <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"%> <% 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%> <%end%>
<!-- <% if @status != "order"%> <!-- <% if @status != "order"%>
<button type="button" id="survey" class="btn btn-block bg-blue waves-effect"><%= t("views.right_panel.detail.survey") %></button> <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 () { $('#addorder').on('click', function () {
var table_id = "<%=@table_id%>"; var table_id = "<%=@table_id%>";
var booking_id = "<%=@bookings.booking_id%>"; var booking_id = "<%=@bookings.booking_id%>";
var sale_id = $("#sale_id").val();
if (table_id) { 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{ }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 end
else else
#check for license file #check for license file
# if check_license if check_license
# current_license(ENV["SX_PROVISION_URL"]) current_license(ENV["SX_PROVISION_URL"])
# else else
# redirect_to activate_path redirect_to activate_path
# end end
end end
end end