erp_inventory 3.0.2 → 3.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +4 -0
- data/app/assets/javascripts/erp_inventory/application.js +9 -0
- data/app/assets/stylesheets/erp_inventory/application.css +7 -0
- data/app/controllers/erp_inventory/application_controller.rb +4 -0
- data/app/helpers/erp_inventory/application_helper.rb +4 -0
- data/app/models/extensions/product_instance.rb +9 -0
- data/app/models/extensions/product_type.rb +3 -0
- data/app/models/inv_entry_reln.rb +14 -0
- data/app/models/inv_entry_reln_type.rb +4 -0
- data/app/models/inv_entry_role_type.rb +4 -0
- data/app/models/inventory_entry.rb +21 -0
- data/app/models/prod_instance_inv_entry.rb +6 -0
- data/app/views/layouts/erp_inventory/application.html.erb +14 -0
- data/lib/erp_inventory/version.rb +1 -1
- data/public/javascripts/extensions/compass_ae/erp_app/desktop/applications/product_manager/inventory_form_panel.js +83 -0
- metadata +59 -42
data/README.rdoc
CHANGED
@@ -1,2 +1,6 @@
|
|
1
1
|
= ErpInventory
|
2
2
|
|
3
|
+
The Inventory Engine in CompassAE implements a set of models for storing information about the
|
4
|
+
availability and location of ProductTypes and optionally Product Instances. It is also the root
|
5
|
+
for yield and revenue management requirements to segment and allocate inventory for different
|
6
|
+
purposes.
|
@@ -0,0 +1,9 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into including all the files listed below.
|
2
|
+
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
|
3
|
+
// be included in the compiled file accessible from http://example.com/assets/application.js
|
4
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
5
|
+
// the compiled file.
|
6
|
+
//
|
7
|
+
//= require jquery
|
8
|
+
//= require jquery_ujs
|
9
|
+
//= require_tree .
|
@@ -0,0 +1,7 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll automatically include all the stylesheets available in this directory
|
3
|
+
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
|
4
|
+
* the top of the compiled file, but it's generally better to create a new file per style scope.
|
5
|
+
*= require_self
|
6
|
+
*= require_tree .
|
7
|
+
*/
|
@@ -0,0 +1,9 @@
|
|
1
|
+
ProductInstance.class_eval do
|
2
|
+
|
3
|
+
# A ProductInstance can be referenced by more than one inventory entry via overbooking or
|
4
|
+
# "first-come, first serve" inventory strategies. This is a cross-reference entity that
|
5
|
+
# allows this kind of relationship, which is optional depending on business circumstances.
|
6
|
+
has_many :prod_instance_inv_entries
|
7
|
+
has_many :inventory_entries, :through => :prod_instance_inv_entries
|
8
|
+
|
9
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class InvEntryReln < ActiveRecord::Base
|
2
|
+
|
3
|
+
belongs_to :inv_entry_from, :class_name => "InvEntry", :foreign_key => "inv_entry_id_from"
|
4
|
+
belongs_to :inv_entry_to, :class_name => "InvEntry", :foreign_key => "inv_entry_id_to"
|
5
|
+
|
6
|
+
belongs_to :from_role, :class_name => "InvEntryRoleType", :foreign_key => "role_type_id_from"
|
7
|
+
belongs_to :to_role, :class_name => "InvEntryRoleType", :foreign_key => "role_type_id_to"
|
8
|
+
|
9
|
+
belongs_to :inv_entry_reln_type
|
10
|
+
|
11
|
+
alias :from_item :inv_entry_from
|
12
|
+
alias :to_item :inv_entry_to
|
13
|
+
|
14
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
class InventoryEntry < ActiveRecord::Base
|
2
|
+
|
3
|
+
belongs_to :inventory_entry_record, :polymorphic => true
|
4
|
+
belongs_to :product_type
|
5
|
+
has_one :classification, :as => :classification, :class_name => 'CategoryClassification'
|
6
|
+
has_many :prod_instance_inv_entries
|
7
|
+
has_many :product_instances, :through => :prod_instance_inv_entries do
|
8
|
+
def available
|
9
|
+
includes([:prod_availability_status_type]).where('prod_availability_status_types.internal_identifier = ?', 'available')
|
10
|
+
end
|
11
|
+
|
12
|
+
def sold
|
13
|
+
includes([:prod_availability_status_type]).where('prod_availability_status_types.internal_identifier = ?', 'sold')
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def to_label
|
18
|
+
"#{description}"
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>ErpInventory</title>
|
5
|
+
<%= stylesheet_link_tag "erp_inventory/application" %>
|
6
|
+
<%= javascript_include_tag "erp_inventory/application" %>
|
7
|
+
<%= csrf_meta_tags %>
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
|
11
|
+
<%= yield %>
|
12
|
+
|
13
|
+
</body>
|
14
|
+
</html>
|
@@ -0,0 +1,83 @@
|
|
1
|
+
//
|
2
|
+
//Inventory Management
|
3
|
+
//
|
4
|
+
|
5
|
+
Ext.define("Compass.ErpApp.Desktop.Applications.ProductManager.InventoryFormPanel",{
|
6
|
+
extend:"Ext.form.Panel",
|
7
|
+
alias:'widget.productmanager_inventoryformpanel',
|
8
|
+
|
9
|
+
constructor : function(config) {
|
10
|
+
config = Ext.apply({
|
11
|
+
title:'Inventory',
|
12
|
+
frame:true,
|
13
|
+
buttonAlign:'left',
|
14
|
+
bodyStyle:'padding:5px 5px 0',
|
15
|
+
url:'/erp_products/erp_app/desktop/product_manager/update_inventory',
|
16
|
+
items:[
|
17
|
+
{
|
18
|
+
fieldLabel:'SKU #',
|
19
|
+
xtype:'textfield',
|
20
|
+
allowBlank:true,
|
21
|
+
name:'sku'
|
22
|
+
},{
|
23
|
+
fieldLabel:'# Available',
|
24
|
+
xtype:'numberfield',
|
25
|
+
allowBlank:false,
|
26
|
+
name:'number_available'
|
27
|
+
},
|
28
|
+
{
|
29
|
+
xtype:'hidden',
|
30
|
+
name:'product_type_id',
|
31
|
+
value:Compass.ErpApp.Desktop.Applications.ProductManager.selectedProductTypeId
|
32
|
+
},
|
33
|
+
],
|
34
|
+
buttons:[
|
35
|
+
{
|
36
|
+
text:'Update',
|
37
|
+
handler:function(btn){
|
38
|
+
var formPanel = btn.findParentByType('form');
|
39
|
+
var basicForm = formPanel.getForm();
|
40
|
+
|
41
|
+
basicForm.submit({
|
42
|
+
reset:false,
|
43
|
+
success:function(form, action){
|
44
|
+
var obj = Ext.decode(action.response.responseText);
|
45
|
+
if(obj.success){
|
46
|
+
Ext.getCmp('productListPanel').loadProducts();
|
47
|
+
}
|
48
|
+
else{
|
49
|
+
Ext.Msg.alert("Error", 'Error creating price');
|
50
|
+
}
|
51
|
+
},
|
52
|
+
failure:function(form, action){
|
53
|
+
Ext.Msg.alert("Error", 'Error creating price');
|
54
|
+
}
|
55
|
+
});
|
56
|
+
}
|
57
|
+
}
|
58
|
+
]
|
59
|
+
}, config);
|
60
|
+
|
61
|
+
this.callParent([config]);
|
62
|
+
}
|
63
|
+
});
|
64
|
+
|
65
|
+
Compass.ErpApp.Desktop.Applications.ProductManager.widgets.push({
|
66
|
+
xtype:'productmanager_inventoryformpanel',
|
67
|
+
listeners:{
|
68
|
+
'activate':function(panel){
|
69
|
+
var self = this;
|
70
|
+
Ext.Ajax.request({
|
71
|
+
url: '/erp_products/erp_app/desktop/product_manager/inventory/'+Compass.ErpApp.Desktop.Applications.ProductManager.selectedProductTypeId,
|
72
|
+
success: function(response) {
|
73
|
+
var obj = Ext.decode(response.responseText);
|
74
|
+
self.getForm().setValues(obj);
|
75
|
+
},
|
76
|
+
failure: function(response) {
|
77
|
+
Ext.Msg.alert('Error', 'Error loading inventory.');
|
78
|
+
}
|
79
|
+
});
|
80
|
+
}
|
81
|
+
}
|
82
|
+
});
|
83
|
+
|
metadata
CHANGED
@@ -1,48 +1,63 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: erp_inventory
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.2
|
3
|
+
version: !ruby/object:Gem::Version
|
5
4
|
prerelease:
|
5
|
+
version: 3.0.3
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
7
|
+
authors:
|
8
8
|
- Rick Koloski, Russell Holmes
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
12
|
+
|
13
|
+
date: 2012-08-07 00:00:00 -04:00
|
14
|
+
default_executable:
|
15
|
+
dependencies:
|
16
|
+
- !ruby/object:Gem::Dependency
|
15
17
|
name: erp_orders
|
16
|
-
|
18
|
+
prerelease: false
|
19
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
17
20
|
none: false
|
18
|
-
requirements:
|
21
|
+
requirements:
|
19
22
|
- - ~>
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version:
|
23
|
+
- !ruby/object:Gem::Version
|
24
|
+
version: "3.0"
|
22
25
|
type: :runtime
|
23
|
-
|
24
|
-
|
25
|
-
- !ruby/object:Gem::Dependency
|
26
|
+
version_requirements: *id001
|
27
|
+
- !ruby/object:Gem::Dependency
|
26
28
|
name: erp_dev_svcs
|
27
|
-
|
29
|
+
prerelease: false
|
30
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
28
31
|
none: false
|
29
|
-
requirements:
|
32
|
+
requirements:
|
30
33
|
- - ~>
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version:
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: "3.0"
|
33
36
|
type: :development
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
information about the availability and location of ProductTypes and optionally Product
|
38
|
-
Instances. It is also the root for yield and revenue management requirements to
|
39
|
-
segment and allocate inventory for different purposes.
|
40
|
-
email:
|
37
|
+
version_requirements: *id002
|
38
|
+
description: The Inventory Engine in CompassAE implements a set of models for storing information about the availability and location of ProductTypes and optionally Product Instances. It is also the root for yield and revenue management requirements to segment and allocate inventory for different purposes.
|
39
|
+
email:
|
41
40
|
- russonrails@gmail.com
|
42
41
|
executables: []
|
42
|
+
|
43
43
|
extensions: []
|
44
|
+
|
44
45
|
extra_rdoc_files: []
|
45
|
-
|
46
|
+
|
47
|
+
files:
|
48
|
+
- public/javascripts/extensions/compass_ae/erp_app/desktop/applications/product_manager/inventory_form_panel.js
|
49
|
+
- app/assets/javascripts/erp_inventory/application.js
|
50
|
+
- app/assets/stylesheets/erp_inventory/application.css
|
51
|
+
- app/controllers/erp_inventory/application_controller.rb
|
52
|
+
- app/helpers/erp_inventory/application_helper.rb
|
53
|
+
- app/models/extensions/product_instance.rb
|
54
|
+
- app/models/extensions/product_type.rb
|
55
|
+
- app/models/inv_entry_reln.rb
|
56
|
+
- app/models/inv_entry_reln_type.rb
|
57
|
+
- app/models/inv_entry_role_type.rb
|
58
|
+
- app/models/inventory_entry.rb
|
59
|
+
- app/models/prod_instance_inv_entry.rb
|
60
|
+
- app/views/layouts/erp_inventory/application.html.erb
|
46
61
|
- config/routes.rb
|
47
62
|
- db/migrate/20080805000050_base_inventory.rb
|
48
63
|
- db/migrate/20080805000051_base_inventory_indexes.rb
|
@@ -87,33 +102,35 @@ files:
|
|
87
102
|
- spec/models/inventory_entry_spec.rb
|
88
103
|
- spec/models/prod_instance_inv_entry_spec.rb
|
89
104
|
- spec/spec_helper.rb
|
105
|
+
has_rdoc: true
|
90
106
|
homepage: http://development.compassagile.com
|
91
107
|
licenses: []
|
108
|
+
|
92
109
|
post_install_message:
|
93
110
|
rdoc_options: []
|
94
|
-
|
111
|
+
|
112
|
+
require_paths:
|
95
113
|
- lib
|
96
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
114
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
97
115
|
none: false
|
98
|
-
requirements:
|
99
|
-
- -
|
100
|
-
- !ruby/object:Gem::Version
|
101
|
-
version:
|
102
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
116
|
+
requirements:
|
117
|
+
- - ">="
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: "0"
|
120
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
103
121
|
none: false
|
104
|
-
requirements:
|
105
|
-
- -
|
106
|
-
- !ruby/object:Gem::Version
|
107
|
-
version:
|
122
|
+
requirements:
|
123
|
+
- - ">="
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: "0"
|
108
126
|
requirements: []
|
127
|
+
|
109
128
|
rubyforge_project:
|
110
|
-
rubygems_version: 1.
|
129
|
+
rubygems_version: 1.6.2
|
111
130
|
signing_key:
|
112
131
|
specification_version: 3
|
113
|
-
summary: The Inventory Engine in CompassAE implements a set of models for storing
|
114
|
-
|
115
|
-
Instances.
|
116
|
-
test_files:
|
132
|
+
summary: The Inventory Engine in CompassAE implements a set of models for storing information about the availability and location of ProductTypes and optionally Product Instances.
|
133
|
+
test_files:
|
117
134
|
- spec/dummy/app/assets/javascripts/application.js
|
118
135
|
- spec/dummy/app/assets/stylesheets/application.css
|
119
136
|
- spec/dummy/app/controllers/application_controller.rb
|