receipt bill pdf fixed

This commit is contained in:
yarzar_code
2020-08-26 15:36:04 +06:30
parent 39871691e9
commit 78ecd6b1e8
6 changed files with 21 additions and 38 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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") {