receipt bill pdf fixed
This commit is contained in:
@@ -220,7 +220,7 @@ class Foodcourt::OrdersController < BaseFoodcourtController
|
||||
|
||||
#bill channel
|
||||
if ENV["SERVER_MODE"] == 'cloud'
|
||||
from = request.subdomain + "." + request.domain
|
||||
from = request.host
|
||||
else
|
||||
from = ""
|
||||
end
|
||||
|
||||
@@ -16,7 +16,7 @@ class Foodcourt::SecondDisplayController < BaseFoodcourtController
|
||||
tax_profiles = nil
|
||||
end
|
||||
if ENV["SERVER_MODE"] == 'cloud'
|
||||
from = request.subdomain + "." + request.domain
|
||||
from = request.host
|
||||
else
|
||||
from = ""
|
||||
end
|
||||
|
||||
@@ -90,7 +90,7 @@ class Printer::ReceiptPrinter < Printer::PrinterWorker
|
||||
end
|
||||
|
||||
#Bill Receipt Print
|
||||
def print_receipt_bill(printer_settings, kbz_pay_status, qr_code, cashier_terminal,sale_items,sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info = nil,rebate_amount=nil,shop_details, printed_status,balance,card_data,other_amount,latest_order_no,card_balance_amount,order_reservation)
|
||||
def print_receipt_bill(printer_settings, kbz_pay_status, qr_code, cashier_terminal, sale_items, sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info, rebate_amount, shop_details, printed_status, balance, card_data, other_amount, latest_order_no, card_balance_amount, order_reservation = nil, transaction_ref = nil)
|
||||
if Lookup.collection_of('print_settings').none? { |x| x == ["ActionCable", "1"] }
|
||||
#Use CUPS service
|
||||
#Generate PDF
|
||||
|
||||
@@ -482,57 +482,40 @@ class ReceiptBillPdf < Prawn::Document
|
||||
where sa.sale_id='#{sale_data.sale_id}')) = 0
|
||||
THEN payment_method!='creditnote' ELSE 1 END) AND sale_id = ?", sale_data.sale_id)
|
||||
.group("payment_method")
|
||||
<<<<<<< HEAD
|
||||
end
|
||||
|
||||
sale_payments.each do |payment|
|
||||
y_position = cursor
|
||||
if payment.payment_method == "paypar"
|
||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
|
||||
text "Redeem Payment", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
elsif printed_status == 'credit_payment'
|
||||
text "#{payment.payment_method.capitalize} Payment on #{payment.updated_at.strftime('%d-%m-%Y')}", :left_margin => -10, :size => self.item_font_size,:align => :left
|
||||
else
|
||||
payment_method = payment.payment_method.capitalize
|
||||
if payment.payment_method == "paymal"
|
||||
payment_method ='Card'
|
||||
end
|
||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
|
||||
text "#{payment_method} Payment", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
end
|
||||
=======
|
||||
end
|
||||
>>>>>>> r-1902001-01
|
||||
|
||||
sale_payments.each do |payment|
|
||||
y_position = cursor
|
||||
if payment.payment_method == "paypar"
|
||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
|
||||
text "Redeem Payment", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
elsif printed_status == 'credit_payment'
|
||||
text "#{payment.payment_method.capitalize} Payment on #{payment.updated_at.strftime('%d-%m-%Y')}", :left_margin => -10, :size => self.item_font_size,:align => :left
|
||||
end
|
||||
elsif printed_status == 'credit_payment'
|
||||
text "#{payment.payment_method.capitalize} Payment on #{payment.updated_at.strftime('%d-%m-%Y')}", :left_margin => -10, :size => self.item_font_size,:align => :left
|
||||
else
|
||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
|
||||
text "#{payment.payment_method.capitalize} Payment", :size => self.item_font_size,:align => :left
|
||||
payment_method = payment.payment_method.capitalize
|
||||
if payment.payment_method == "paymal"
|
||||
payment_method ='Card'
|
||||
end
|
||||
bounding_box([0, y_position], :width =>self.item_description_width, :height => self.item_height) do
|
||||
text "#{payment_method} Payment", :size => self.item_font_size, :align => :left
|
||||
end
|
||||
end
|
||||
|
||||
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
|
||||
text "#{number_format(payment.payment_amount, :precision => precision.to_i, :delimiter => delimiter)}" , :size => self.item_font_size,:align => :right
|
||||
bounding_box([self.item_description_width, y_position], :width =>self.label_width) do
|
||||
text "#{number_format(payment.payment_amount, :precision => precision.to_i, :delimiter => delimiter)}" , :size => self.item_font_size, :align => :right
|
||||
end
|
||||
move_down line_move
|
||||
end
|
||||
|
||||
if sale_data.amount_received > 0
|
||||
y_position = cursor
|
||||
move_down line_move
|
||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
|
||||
text "Change Amount", :size => self.item_font_size,:align => :left
|
||||
bounding_box([0, y_position], :width =>self.item_description_width, :height => self.item_height) do
|
||||
text "Change Amount", :size => self.item_font_size, :align => :left
|
||||
end
|
||||
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
|
||||
text "#{number_format(sale_data.amount_changed, :precision => precision.to_i, :delimiter => delimiter)}" , :size => self.item_font_size,:align => :right
|
||||
bounding_box([self.item_description_width, y_position], :width =>self.label_width) do
|
||||
text "#{number_format(sale_data.amount_changed, :precision => precision.to_i, :delimiter => delimiter)}" , :size => self.item_font_size, :align => :right
|
||||
end
|
||||
# move_down line_move
|
||||
end
|
||||
|
||||
@@ -1297,7 +1297,7 @@ $(document).ready(function(){
|
||||
type: 'POST',
|
||||
url: ajax_url,
|
||||
data: "remark="+ remark + "&sale_id=" + sale_id+ "&access_code=" + access_code,
|
||||
success: function (result) {result
|
||||
success: function (result) {
|
||||
customer_display_view(null,"reload");
|
||||
// For Server Print - from jade
|
||||
if ($("#server_mode").val() == "cloud") {
|
||||
|
||||
Reference in New Issue
Block a user