update shop note

This commit is contained in:
Aung Myo
2018-08-31 13:49:39 +06:30
parent fef6a4ccd0
commit efcef4d27b
7 changed files with 48 additions and 12 deletions

View File

@@ -13,7 +13,7 @@ class Settings::SetMenuItemsController < ApplicationController
# GET /settings/menu_items/1.json # GET /settings/menu_items/1.json
def show def show
# @sub_menu = MenuItem.where("menu_item_id=?",params[:id]).page(params[:page]).per(10) # @sub_menu = MenuItem.where("menu_item_id=?",params[:id]).page(params[:page]).per(10)
@menu_item_instance = MenuItemInstance.where("menu_item_id=?",params[:id]).page(params[:page]).per(10) @menu_item_instance = MenuItemInstance.where("menu_item_id=?",params[:id])
end end
# GET /settings/menu_items/new # GET /settings/menu_items/new

View File

@@ -101,6 +101,6 @@ class Settings::ShopsController < ApplicationController
# Never trust parameters from the scary internet, only allow the white list through. # Never trust parameters from the scary internet, only allow the white list through.
def shop_params def shop_params
params.require(:shop).permit(:logo, :name,:address,:city,:township,:state,:country,:phone_no,:reservation_no,:license,:activated_at,:license_data,:base_currency,:cloud_token,:cloud_url,:owner_token,:id_prefix,:is_rounding_adj,:quick_sale_summary,:calc_tax_order,:show_account_info, display_images_attributes: [:id, :shop_id, :name, :image]) params.require(:shop).permit(:logo, :name,:address,:city,:township,:state,:country,:phone_no,:reservation_no,:license,:activated_at,:license_data,:base_currency,:cloud_token,:cloud_url,:owner_token,:id_prefix,:is_rounding_adj,:quick_sale_summary,:calc_tax_order,:show_account_info,:note, display_images_attributes: [:id, :shop_id, :name, :image])
end end
end end

View File

@@ -13,7 +13,7 @@ class Settings::SimpleMenuItemsController < ApplicationController
# GET /settings/menu_items/1.json # GET /settings/menu_items/1.json
def show def show
# @sub_menu = MenuItem.where("menu_item_id=?",params[:id]).page(params[:page]).per(10) # @sub_menu = MenuItem.where("menu_item_id=?",params[:id]).page(params[:page]).per(10)
@menu_item_instance = MenuItemInstance.where("menu_item_id=?",params[:id]).page(params[:page]).per(10) @menu_item_instance = MenuItemInstance.where("menu_item_id=?",params[:id])
end end
# GET /settings/menu_items/new # GET /settings/menu_items/new

View File

@@ -92,6 +92,10 @@ class ReceiptBillA5Pdf < Prawn::Document
sign(sale_data) sign(sale_data)
if shop_details.note != nil
shop_note(printed_status)
end
footer(printed_status) footer(printed_status)
end end
@@ -647,6 +651,19 @@ class ReceiptBillA5Pdf < Prawn::Document
end end
def shop_note(shop)
move_down line_move
stroke_horizontal_rule
move_down line_move
move_down line_move
y_position = cursor
text "#{shop.note}", :size => self.item_font_size,:align => :left
move_down line_move
end
def footer(printed_status) def footer(printed_status)
move_down line_move move_down line_move
stroke_horizontal_rule stroke_horizontal_rule

View File

@@ -93,6 +93,10 @@ class ReceiptBillPdf < Prawn::Document
sign(sale_data) sign(sale_data)
if shop_details.note != nil
shop_note(shop_details)
end
footer(printed_status) footer(printed_status)
end end
@@ -647,6 +651,19 @@ class ReceiptBillPdf < Prawn::Document
end end
def shop_note(shop)
move_down line_move
stroke_horizontal_rule
move_down line_move
move_down line_move
y_position = cursor
text "#{shop.note}", :size => self.item_font_size,:align => :left
move_down line_move
end
def footer(printed_status) def footer(printed_status)
move_down line_move move_down line_move
stroke_horizontal_rule stroke_horizontal_rule

View File

@@ -514,9 +514,7 @@ $('#foc').click(function() {
if ($("#server_mode").val() == "cloud") { if ($("#server_mode").val() == "cloud") {
code2lab.printFile(result.filepath.substr(6), result.printer_url); code2lab.printFile(result.filepath.substr(6), result.printer_url);
} }
window.location.href = '/origami'; window.location.href = '/origami';
}); });
} }
} }

View File

@@ -23,6 +23,8 @@
<%= f.input :quick_sale_summary %> <%= f.input :quick_sale_summary %>
<%= f.input :calc_tax_order %> <%= f.input :calc_tax_order %>
<%= f.input :show_account_info %> <%= f.input :show_account_info %>
</div> </div>
<label>Shop Logo</label> <label>Shop Logo</label>
@@ -77,6 +79,8 @@
<%= f.file_field :image, :multiple => false, name: "display_images[image][]", accept: 'audio/mp3', :class => "order" %> <%= f.file_field :image, :multiple => false, name: "display_images[image][]", accept: 'audio/mp3', :class => "order" %>
</div> </div>
<%= f.input :note, as: :text, :input_html => { :rows => 5} %>
<div class="form-actions p-l-15"> <div class="form-actions p-l-15">
<%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect' %> <%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect' %>
</div> </div>