receipt bill order pdf

This commit is contained in:
phyusin
2018-12-12 11:32:26 +06:30
parent 3ea1b6be6c
commit f675179060
3 changed files with 5 additions and 8 deletions

View File

@@ -730,6 +730,7 @@ function print_receipt(){
if(typeof code2lab != 'undefined'){
code2lab.printFile(result.filepath.substr(6), result.printer_url);
}
window.location.href = '/origami/order_reservation';
}
else{
swal({

View File

@@ -85,7 +85,7 @@ class Api::OrderReserve::OrderReservationController < Api::ApiController
result = { :status => true, :order_reservation_id => order_reservation_id, :message => "Order reservation is successfully created!" }
order_reservation = OrderReservation.get_pending_orders #find(order_reservation_id)
if ENV["SERVER_MODE"] == 'cloud'
from = "" #request.subdomain + "." + request.domain
from = request.subdomain + "." + request.domain
else
from = ""
end

View File

@@ -214,15 +214,11 @@ class ReceiptBillOrderPdf < Prawn::Document
if !order_reservation.delivery_type.nil? && order_reservation.delivery_fee.to_f > 0
y_position = cursor
bounding_box([0, y_position], :width =>self.item_width - 10, :height => self.item_height) do
text "Delivery Charges" , :size => self.item_font_size, :align => :left
bounding_box([0, y_position], :width =>self.description_width - 13, :height => self.item_height) do
text "Delivery Charges (#{order_reservation.delivery_type})" , :size => self.item_font_size, :align => :left
end
bounding_box([self.item_width - 10,y_position], :width =>self.price_width, :height => self.item_height) do
text " (#{order_reservation.delivery_type})", :size => self.item_font_size,:align => :right
end
bounding_box([(self.item_width - 10) + self.price_width,y_position], :width =>self.label_width, :height => self.item_height) do
bounding_box([self.description_width - 48,y_position], :width =>self.label_width, :height => self.item_height) do
text "#{number_with_precision(order_reservation.delivery_fee, :precision => precision.to_i, :delimiter => delimiter)}", :size => self.item_font_size,:align => :right
end
end