From 02f9245c7fdc4f0b45635b8590763d6bd85a9b1a Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Wed, 28 Jun 2017 16:18:14 +0630 Subject: [PATCH] update receipt and oqs font --- app/pdf/order_item_pdf.rb | 8 +++++--- app/pdf/order_summary_pdf.rb | 5 +++-- app/pdf/receipt_bill_pdf.rb | 4 ++-- config/routes.rb | 13 ------------- 4 files changed, 10 insertions(+), 20 deletions(-) diff --git a/app/pdf/order_item_pdf.rb b/app/pdf/order_item_pdf.rb index 3f697e06..4a95e066 100644 --- a/app/pdf/order_item_pdf.rb +++ b/app/pdf/order_item_pdf.rb @@ -16,8 +16,9 @@ class OrderItemPdf < Prawn::Document # super(:margin => [10, 5, 30, 5], :page_size => [200,400]) # font "public/fonts/#{font_name}".to_s + ".ttf".to_s - font "public/fonts/Zawgyi-One.ttf" - font "public/fonts/padauk.ttf" + # font "public/fonts/Zawgyi-One.ttf" + # font "public/fonts/padauk.ttf" + #font "public/fonts/Chinese.ttf" self.header_font_size = 12 self.item_font_size = 10 @@ -86,7 +87,8 @@ class OrderItemPdf < Prawn::Document if alt_name y_position = cursor bounding_box([0,y_position], :width => self.item_width, :height => self.item_height) do - text "(#{order_item.alt_name})", :size => self.item_font_size,:align => :left + font "public/fonts/Chinese.ttf" + text "(#{order_item.alt_name})", :size => self.item_font_size,:align => :left, :inline_format => true end end diff --git a/app/pdf/order_summary_pdf.rb b/app/pdf/order_summary_pdf.rb index d5b11d23..a51a6e34 100644 --- a/app/pdf/order_summary_pdf.rb +++ b/app/pdf/order_summary_pdf.rb @@ -29,7 +29,7 @@ class OrderSummaryPdf < Prawn::Document # order items if order_items == nil - order_items(order) + order_items(order, alt_name) else order_items(order_items, alt_name) end @@ -102,7 +102,8 @@ class OrderSummaryPdf < Prawn::Document if alt_name y_position = cursor bounding_box([0,y_position], :width => self.item_width, :height => self.item_height) do - text "(#{odi.alt_name})", :size => self.item_font_size,:align => :left + font "public/fonts/Chinese.ttf" + text "(#{odi.alt_name})", :size => self.item_font_size,:align => :left end end move_down 5 diff --git a/app/pdf/receipt_bill_pdf.rb b/app/pdf/receipt_bill_pdf.rb index 821ab7f6..9a0a4d21 100644 --- a/app/pdf/receipt_bill_pdf.rb +++ b/app/pdf/receipt_bill_pdf.rb @@ -194,10 +194,10 @@ class ReceiptBillPdf < Prawn::Document y_position = cursor move_down 5 bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do - text "Grand Total", :size => self.header_font_size,:align => :left + text "Grand Total",:style => :bold, :size => self.header_font_size,:align => :left end bounding_box([self.item_description_width,y_position], :width =>self.label_width) do - text "#{sale_data.grand_total}" , :size => self.header_font_size,:align => :right + text "#{sale_data.grand_total}" , :style => :bold, :size => self.header_font_size,:align => :right end move_down 5 diff --git a/config/routes.rb b/config/routes.rb index cfc5ce43..7e84d905 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -96,19 +96,6 @@ Rails.application.routes.draw do post "/:id/request_bills" => "request_bills#print",:as => "request_bill" ,:defaults => { :format => 'json' } get '/:sale_id/reprint' => 'payments#reprint' ,:defaults => { :format => 'json' } - - #---------Shift ---------------# - resources :shifts, only: [:index, :show, :new, :create, :edit, :update] - #shift - index (open/close shift landing page) - #shift - show (sales summary display) - #shift - new (open shift) - #shift - edit (close shift) - - resources :cash_mgmt, only: [:new, :create] - #payment - accepting or expending money from cashier - [Cash Journal] - #payment - Incoming payments - [accept all payment types (cash, other payments (except rebate)) - #payment - Outing payments - Cash only [ *Misc expeness tracking] - #--------- Payment ------------# get 'sale/:sale_id/payment' => 'payments#show'