diff --git a/app/assets/javascripts/addorder.js b/app/assets/javascripts/addorder.js index 78e08b2e..5b3142e6 100755 --- a/app/assets/javascripts/addorder.js +++ b/app/assets/javascripts/addorder.js @@ -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(); diff --git a/app/models/print_setting.rb b/app/models/print_setting.rb index 9b883726..d97650fe 100755 --- a/app/models/print_setting.rb +++ b/app/models/print_setting.rb @@ -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 diff --git a/app/pdf/receipt_bill_a5_pdf.rb b/app/pdf/receipt_bill_a5_pdf.rb index 4e4d586b..382633de 100644 --- a/app/pdf/receipt_bill_a5_pdf.rb +++ b/app/pdf/receipt_bill_a5_pdf.rb @@ -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 diff --git a/app/pdf/receipt_bill_pdf.rb b/app/pdf/receipt_bill_pdf.rb index fa923720..862a91a5 100755 --- a/app/pdf/receipt_bill_pdf.rb +++ b/app/pdf/receipt_bill_pdf.rb @@ -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 diff --git a/app/views/origami/payments/show.html.erb b/app/views/origami/payments/show.html.erb index 12a7c86f..ae7245a4 100755 --- a/app/views/origami/payments/show.html.erb +++ b/app/views/origami/payments/show.html.erb @@ -346,12 +346,10 @@