-
This commit is contained in:
@@ -81,9 +81,6 @@ class Api::BatchLineItemsController < ApplicationController
|
||||
client_id=""
|
||||
qty = params[:qty]
|
||||
total_count=0
|
||||
puts batch_id
|
||||
puts 'ello'
|
||||
puts params[:id]
|
||||
# check_member= Member.authenticate_session_token(session_token)
|
||||
# if !check_member.nil?
|
||||
encrypt_key=""
|
||||
@@ -264,5 +261,5 @@ class Api::BatchLineItemsController < ApplicationController
|
||||
@out = false,"Not Authorized"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
@@ -3,6 +3,11 @@ class BatchLineItemsController < ApplicationController
|
||||
skip_before_filter :verify_authenticity_token
|
||||
before_action :authenticate_member!
|
||||
require 'digest/md5'
|
||||
require 'barby'
|
||||
require 'barby/barcode/code_128'
|
||||
require 'barby/outputter/ascii_outputter'
|
||||
require 'barby/outputter/svg_outputter'
|
||||
|
||||
|
||||
def index
|
||||
# user_id=current_member.user_id
|
||||
@@ -129,6 +134,9 @@ class BatchLineItemsController < ApplicationController
|
||||
client_id=""
|
||||
qty = params[:qty]
|
||||
total_count=0
|
||||
check = params[:barcode]
|
||||
|
||||
|
||||
|
||||
# check_member= Member.authenticate_session_token(session_token)
|
||||
# if !check_member.nil?
|
||||
@@ -137,7 +145,6 @@ class BatchLineItemsController < ApplicationController
|
||||
|
||||
find_batch = Batch.find_by_id(batch_id)
|
||||
if !find_batch.nil?
|
||||
puts 'hkjfklasj'
|
||||
card_type=find_batch.adult_or_child.upcase
|
||||
product_category_id=find_batch.product_category_id
|
||||
find_product_category=ProductCategory.find_by_id(product_category_id)
|
||||
@@ -159,6 +166,14 @@ class BatchLineItemsController < ApplicationController
|
||||
asset_identity=BatchLineItem.generate_account_no(location_code)
|
||||
security_code=BatchLineItem.generate_security_code
|
||||
out=BatchLineItem.create_product(asset_identity,serial_no,batch_id,"","",security_code)
|
||||
if check.present?
|
||||
barcode = BatchLineItem.generate_barcode
|
||||
update_barcode = BatchLineItem.find_by_asset_identity(out[2])
|
||||
update_barcode.barcode = barcode
|
||||
barcode_128 = Barby::Code128.new(barcode)
|
||||
update_barcode.barcode_format = barcode_128
|
||||
update_barcode.save
|
||||
end
|
||||
total_count+=1
|
||||
end
|
||||
respond_to do |format|
|
||||
|
||||
@@ -39,6 +39,17 @@ class BatchLineItem < ApplicationRecord
|
||||
end
|
||||
return security_code
|
||||
end
|
||||
def self.generate_barcode
|
||||
|
||||
o = [('0'..'9')].map { |i| i.to_a }.flatten
|
||||
barcode = (0...10).map { o[rand(o.length)] }.join
|
||||
find_account_no = BatchLineItem.find_by_barcode(barcode)
|
||||
if !find_account_no.nil?
|
||||
o = [('0'..'9')].map { |i| i.to_a }.flatten
|
||||
barcode = (0...10).map { o[rand(o.length)] }.join
|
||||
end
|
||||
return barcode
|
||||
end
|
||||
def self.generate_serial_no(client_id)
|
||||
find_lookup=Lookup.find_by_name('generate_serial_no')
|
||||
if !find_lookup.nil?
|
||||
|
||||
@@ -11,6 +11,9 @@
|
||||
<%= hidden_field_tag 'id', params[:id] %>
|
||||
<%= label_tag(:qty, "Qty:") %>
|
||||
<%= text_field_tag :qty, "", class: 'adjust_height' %>
|
||||
<br/>
|
||||
<input type="checkbox" name="barcode" value="true" class="">Barcode
|
||||
<br/>
|
||||
<%= submit_tag("Generate", :class=>"btn btn-primary btn_height") %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
@@ -67,8 +67,8 @@
|
||||
<th>Manufacture UID</th>
|
||||
<th>Batch No</th>
|
||||
<th>Asset Type</th>
|
||||
<th>Created At </th>
|
||||
<th>Updated At </th>
|
||||
<th>Barcode </th>
|
||||
<th>Created At </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -79,8 +79,8 @@
|
||||
<td><%= item.manufacture_uid rescue '' %></td>
|
||||
<td><%= item.batch_name rescue '' %></td>
|
||||
<td><%= item.asset_type rescue '' %></td>
|
||||
<td><%= item.created_at.strftime("%e,%b %Y %I:%M %p") rescue '' %></td>
|
||||
<td><%= item.updated_at.strftime("%e,%b %Y %I:%M %p") rescue '' %></td>
|
||||
<td><%= item.barcode rescue '' %></td>
|
||||
<td><%= item.created_at.strftime("%e,%b %Y %I:%M %p") rescue '' %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
|
||||
21
app/views/users/Find Results
Normal file
21
app/views/users/Find Results
Normal file
@@ -0,0 +1,21 @@
|
||||
Searching 838 files for "page_no"
|
||||
|
||||
0 matches
|
||||
|
||||
Searching 838 files for "check_box"
|
||||
|
||||
/Users/nda/Documents/projectX/nemo_encoder/app/views/devise/sessions/new.html.erb:
|
||||
15 <% if devise_mapping.rememberable? -%>
|
||||
16 <div class ="form-group" >
|
||||
17: <%= f.check_box :remember_me %>
|
||||
18 <%= f.label :remember_me %>
|
||||
19 </div>
|
||||
|
||||
/Users/nda/Documents/projectX/nemo_encoder/app/views/users/_form.html.erb:
|
||||
58 <div class ="form-group" >
|
||||
59 <label for="is_active" class="string optional control-label">Active:</label>
|
||||
60: <%= check_box "Monday", "yes" %>
|
||||
61 </div>
|
||||
62 <% end %>
|
||||
|
||||
2 matches across 2 files
|
||||
Reference in New Issue
Block a user