barcode update

This commit is contained in:
nandar
2018-07-26 09:33:20 +06:30
parent 004f801f71
commit 55554707f0
19 changed files with 36130 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/

View File

@@ -0,0 +1,3 @@
// Place all the styles related to the Sellers controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/

View File

@@ -0,0 +1,4 @@
json.set! :status, @out[0]
json.set! :data, @out[1]
json.set! :total_page_count, @out[2]

View File

@@ -0,0 +1,2 @@
json.set! :status, @out[0]
json.set! :message, @out[1]

View File

@@ -0,0 +1,8 @@
if @out[0] == true
json.set! :status, @out[0]
json.set! :total_export_qty, @out[1]
json.set! :total_activated_qty, @out[2]
else
json.set! :status, @out[0]
json.set! :message, @out[1]
end

View File

@@ -0,0 +1,13 @@
class CreateSellers < ActiveRecord::Migration[5.0]
def change
create_table :sellers do |t|
t.string :name
t.string :email
t.string :phone
t.string :address
t.string :key
t.timestamps
end
end
end

View File

@@ -0,0 +1,7 @@
class AddStatusBarcodeInBatchLineItems < ActiveRecord::Migration[5.0]
def change
add_column :batch_line_items, :barcode, :string, index: true
add_column :batch_line_items, :is_activated, :boolean, :default => false , index: true
add_column :batch_line_items, :activated_date, :datetime
end
end

View File

@@ -0,0 +1,6 @@
class AddExportToInBatch < ActiveRecord::Migration[5.0]
def change
add_column :batches, :export_to_seller_id, :integer
add_column :batches, :export_to_seller_date, :datetime
end
end

View File

@@ -0,0 +1,5 @@
class AddTypeInUser < ActiveRecord::Migration[5.0]
def change
add_column :users, :user_type, :string
end
end

View File

@@ -0,0 +1,5 @@
class DropTableSeller < ActiveRecord::Migration[5.0]
def change
drop_table :sellers
end
end

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,48 @@
require 'test_helper'
class SellersControllerTest < ActionDispatch::IntegrationTest
setup do
@seller = sellers(:one)
end
test "should get index" do
get sellers_url
assert_response :success
end
test "should get new" do
get new_seller_url
assert_response :success
end
test "should create seller" do
assert_difference('Seller.count') do
post sellers_url, params: { seller: { address: @seller.address, email: @seller.email, key: @seller.key, name: @seller.name, phone: @seller.phone } }
end
assert_redirected_to seller_url(Seller.last)
end
test "should show seller" do
get seller_url(@seller)
assert_response :success
end
test "should get edit" do
get edit_seller_url(@seller)
assert_response :success
end
test "should update seller" do
patch seller_url(@seller), params: { seller: { address: @seller.address, email: @seller.email, key: @seller.key, name: @seller.name, phone: @seller.phone } }
assert_redirected_to seller_url(@seller)
end
test "should destroy seller" do
assert_difference('Seller.count', -1) do
delete seller_url(@seller)
end
assert_redirected_to sellers_url
end
end

15
test/fixtures/sellers.yml vendored Normal file
View File

@@ -0,0 +1,15 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
one:
name: MyString
email: MyString
phone: MyString
address: MyString
key: MyString
two:
name: MyString
email: MyString
phone: MyString
address: MyString
key: MyString

View File

@@ -0,0 +1,7 @@
require 'test_helper'
class SellerTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end