creating order queue printer
This commit is contained in:
@@ -1,8 +1,25 @@
|
||||
class Oqs::PrintController < ApplicationController
|
||||
def print
|
||||
unique_code=="OrderItemPdf"
|
||||
assigned_item_id=params[:id]
|
||||
assigned_order_item=AssignedOrderItem.select("order_id, item_code").where('id='+assigned_item_id)
|
||||
order_queue_printer= OrderQueuePrinter.new
|
||||
order_queue_printer.print_order_item(assigned_order_item[0].order_id, assigned_order_item[0].item_code )
|
||||
|
||||
print_settings=PrintingSetting.find_by_unique_cod(unique_code)
|
||||
# order_queue_printer= OrderQueuePrinter.new(print_settings)
|
||||
order_queue_printer.print_order_item(print_settings,assigned_order_item[0].order_id, assigned_order_item[0].item_code )
|
||||
|
||||
unique_code =params[:unique_code]
|
||||
assigned_item_id=params[:id]
|
||||
# if unique_code=="OrderItemPdf"
|
||||
# print_settings=PrintingSetting.find_by_unique_cod(unique_code)
|
||||
# obj= OrderQueuePrinter.new(print_settings)
|
||||
# obj.print_order_item(print_settings,assigned_item_id)
|
||||
|
||||
|
||||
# end
|
||||
|
||||
# assigned_order_item=AssignedOrderItem.select("order_id, item_code").where('id='+assigned_item_id)
|
||||
|
||||
# order_queue_printer.print_order_item(assigned_order_item[0].order_id, assigned_order_item[0].item_code )
|
||||
end
|
||||
end
|
||||
|
||||
74
app/controllers/print_settings_controller.rb
Normal file
74
app/controllers/print_settings_controller.rb
Normal file
@@ -0,0 +1,74 @@
|
||||
class PrintSettingsController < ApplicationController
|
||||
before_action :set_print_setting, only: [:show, :edit, :update, :destroy]
|
||||
|
||||
# GET /print_settings
|
||||
# GET /print_settings.json
|
||||
def index
|
||||
@print_settings = PrintSetting.all
|
||||
end
|
||||
|
||||
# GET /print_settings/1
|
||||
# GET /print_settings/1.json
|
||||
def show
|
||||
end
|
||||
|
||||
# GET /print_settings/new
|
||||
def new
|
||||
@print_setting = PrintSetting.new
|
||||
end
|
||||
|
||||
# GET /print_settings/1/edit
|
||||
def edit
|
||||
end
|
||||
|
||||
# POST /print_settings
|
||||
# POST /print_settings.json
|
||||
def create
|
||||
@print_setting = PrintSetting.new(print_setting_params)
|
||||
|
||||
respond_to do |format|
|
||||
if @print_setting.save
|
||||
format.html { redirect_to @print_setting, notice: 'Print setting was successfully created.' }
|
||||
format.json { render :show, status: :created, location: @print_setting }
|
||||
else
|
||||
format.html { render :new }
|
||||
format.json { render json: @print_setting.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# PATCH/PUT /print_settings/1
|
||||
# PATCH/PUT /print_settings/1.json
|
||||
def update
|
||||
respond_to do |format|
|
||||
if @print_setting.update(print_setting_params)
|
||||
format.html { redirect_to @print_setting, notice: 'Print setting was successfully updated.' }
|
||||
format.json { render :show, status: :ok, location: @print_setting }
|
||||
else
|
||||
format.html { render :edit }
|
||||
format.json { render json: @print_setting.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /print_settings/1
|
||||
# DELETE /print_settings/1.json
|
||||
def destroy
|
||||
@print_setting.destroy
|
||||
respond_to do |format|
|
||||
format.html { redirect_to print_settings_url, notice: 'Print setting was successfully destroyed.' }
|
||||
format.json { head :no_content }
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_print_setting
|
||||
@print_setting = PrintSetting.find(params[:id])
|
||||
end
|
||||
|
||||
# Never trust parameters from the scary internet, only allow the white list through.
|
||||
def print_setting_params
|
||||
params.require(:print_setting).permit(:name, :unique_code, :template, :db_name, :db_type, :db_username, :db_password, :printer_name, :api_settings, :page_width, :page_height, :print_copies)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user