receipt bill pdf fixed
This commit is contained in:
@@ -220,7 +220,7 @@ class Foodcourt::OrdersController < BaseFoodcourtController
|
|||||||
|
|
||||||
#bill channel
|
#bill channel
|
||||||
if ENV["SERVER_MODE"] == 'cloud'
|
if ENV["SERVER_MODE"] == 'cloud'
|
||||||
from = request.subdomain + "." + request.domain
|
from = request.host
|
||||||
else
|
else
|
||||||
from = ""
|
from = ""
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class Foodcourt::SecondDisplayController < BaseFoodcourtController
|
|||||||
tax_profiles = nil
|
tax_profiles = nil
|
||||||
end
|
end
|
||||||
if ENV["SERVER_MODE"] == 'cloud'
|
if ENV["SERVER_MODE"] == 'cloud'
|
||||||
from = request.subdomain + "." + request.domain
|
from = request.host
|
||||||
else
|
else
|
||||||
from = ""
|
from = ""
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ class Printer::ReceiptPrinter < Printer::PrinterWorker
|
|||||||
end
|
end
|
||||||
|
|
||||||
#Bill Receipt Print
|
#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"] }
|
if Lookup.collection_of('print_settings').none? { |x| x == ["ActionCable", "1"] }
|
||||||
#Use CUPS service
|
#Use CUPS service
|
||||||
#Generate PDF
|
#Generate PDF
|
||||||
|
|||||||
@@ -482,57 +482,40 @@ class ReceiptBillPdf < Prawn::Document
|
|||||||
where sa.sale_id='#{sale_data.sale_id}')) = 0
|
where sa.sale_id='#{sale_data.sale_id}')) = 0
|
||||||
THEN payment_method!='creditnote' ELSE 1 END) AND sale_id = ?", sale_data.sale_id)
|
THEN payment_method!='creditnote' ELSE 1 END) AND sale_id = ?", sale_data.sale_id)
|
||||||
.group("payment_method")
|
.group("payment_method")
|
||||||
<<<<<<< HEAD
|
|
||||||
end
|
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|
|
sale_payments.each do |payment|
|
||||||
y_position = cursor
|
y_position = cursor
|
||||||
if payment.payment_method == "paypar"
|
if payment.payment_method == "paypar"
|
||||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
|
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
|
text "Redeem Payment", :size => self.item_font_size,:align => :left
|
||||||
end
|
end
|
||||||
elsif printed_status == 'credit_payment'
|
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
|
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
|
else
|
||||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
|
payment_method = payment.payment_method.capitalize
|
||||||
text "#{payment.payment_method.capitalize} Payment", :size => self.item_font_size,:align => :left
|
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
|
end
|
||||||
|
|
||||||
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
|
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
|
text "#{number_format(payment.payment_amount, :precision => precision.to_i, :delimiter => delimiter)}" , :size => self.item_font_size, :align => :right
|
||||||
end
|
end
|
||||||
move_down line_move
|
move_down line_move
|
||||||
end
|
end
|
||||||
|
|
||||||
if sale_data.amount_received > 0
|
if sale_data.amount_received > 0
|
||||||
y_position = cursor
|
y_position = cursor
|
||||||
move_down line_move
|
move_down line_move
|
||||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
|
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
|
text "Change Amount", :size => self.item_font_size, :align => :left
|
||||||
end
|
end
|
||||||
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
|
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
|
text "#{number_format(sale_data.amount_changed, :precision => precision.to_i, :delimiter => delimiter)}" , :size => self.item_font_size, :align => :right
|
||||||
end
|
end
|
||||||
# move_down line_move
|
# move_down line_move
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1297,7 +1297,7 @@ $(document).ready(function(){
|
|||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: ajax_url,
|
url: ajax_url,
|
||||||
data: "remark="+ remark + "&sale_id=" + sale_id+ "&access_code=" + access_code,
|
data: "remark="+ remark + "&sale_id=" + sale_id+ "&access_code=" + access_code,
|
||||||
success: function (result) {result
|
success: function (result) {
|
||||||
customer_display_view(null,"reload");
|
customer_display_view(null,"reload");
|
||||||
// For Server Print - from jade
|
// For Server Print - from jade
|
||||||
if ($("#server_mode").val() == "cloud") {
|
if ($("#server_mode").val() == "cloud") {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
development:
|
development:
|
||||||
secret_key_base: b61d85f8ed2a1a9e0eeece3443b3e8f838d002cc1d9f32115d8e93db920e2957adfedc57501d44741211538f3108b742cdeada87d5bfae796c53da1f90a3cd61
|
secret_key_base: b61d85f8ed2a1a9e0eeece3443b3e8f838d002cc1d9f32115d8e93db920e2957adfedc57501d44741211538f3108b742cdeada87d5bfae796c53da1f90a3cd61
|
||||||
sx_provision_url: connect.smartsales.asia/api #connect.smartsales.dev/api #connect.smartsales.asia/api #provision.zsai.ws/api
|
sx_provision_url: connect.smartsales.asia/api #connect.smartsales.dev/api #connect.smartsales.asia/api #provision.zsai.ws/api
|
||||||
server_mode: cloud
|
server_mode: application
|
||||||
cipher_type: AES-256-CBC
|
cipher_type: AES-256-CBC
|
||||||
sx_key: Wh@t1$C2L
|
sx_key: Wh@t1$C2L
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user