stockor 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/Gemfile.lock +13 -13
  4. data/client/skr/Extension.coffee +12 -2
  5. data/client/skr/models/GlAccount.coffee +12 -1
  6. data/client/skr/models/PurchaseOrder.coffee +6 -1
  7. data/client/skr/models/SalesOrder.coffee +7 -1
  8. data/client/skr/models/Sku.coffee +6 -2
  9. data/client/skr/models/mixins/VisibleID.coffee +5 -0
  10. data/client/skr/screens/customer-maint/CustomerMaint.coffee +1 -1
  11. data/client/skr/screens/mixins/index.js +0 -1
  12. data/client/skr/screens/sales-order/SalesOrder.coffee +30 -0
  13. data/client/skr/screens/sales-order/index.js +5 -0
  14. data/client/skr/screens/sales-order/index.scss +8 -0
  15. data/client/skr/screens/sales-order/layout.html +30 -0
  16. data/client/skr/screens/sku-maint/SkuMaint.coffee +7 -2
  17. data/client/skr/screens/sku-maint/layout.html +4 -0
  18. data/client/skr/screens/vendor-maint/VendorMaint.coffee +1 -1
  19. data/client/skr/styles.scss +1 -0
  20. data/config/screens.rb +22 -6
  21. data/db/migrate/20140322223912_create_skr_sales_orders.rb +1 -1
  22. data/db/migrate/20140327202102_create_skr_purchase_orders.rb +1 -1
  23. data/db/migrate/20140330232810_create_skr_sku_qty_details_view.rb +2 -2
  24. data/db/schema.sql +71 -71
  25. data/db/seed.rb +4 -3
  26. data/lib/skr/access_roles.rb +14 -4
  27. data/lib/skr/concerns/state_machine.rb +7 -2
  28. data/lib/skr/extension.rb +10 -0
  29. data/lib/skr/model.rb +34 -1
  30. data/lib/skr/models/address.rb +4 -4
  31. data/lib/skr/models/customer.rb +1 -1
  32. data/lib/skr/models/purchase_order.rb +6 -1
  33. data/lib/skr/models/sales_order.rb +7 -1
  34. data/lib/skr/version.rb +1 -1
  35. data/lib/skr.rb +1 -2
  36. data/spec/fixtures/skr/address.yml +8 -0
  37. data/spec/fixtures/skr/customer.yml +7 -0
  38. data/spec/fixtures/skr/gl_account.yml +41 -0
  39. data/spec/fixtures/skr/location.yml +5 -0
  40. data/spec/fixtures/skr/payment_term.yml +4 -0
  41. data/spec/server/models/{address.rb → address_spec.rb} +2 -2
  42. data/spec/server/models/{customer.rb → customer_spec.rb} +2 -2
  43. data/spec/server/models/{gl_account.rb → gl_account_spec.rb} +2 -2
  44. data/spec/server/models/{gl_manual_entry.rb → gl_manual_entry_spec.rb} +2 -2
  45. data/spec/server/models/{gl_period.rb → gl_period_spec.rb} +2 -2
  46. data/spec/server/models/{gl_posting.rb → gl_posting_spec.rb} +2 -2
  47. data/spec/server/models/{gl_transaction.rb → gl_transaction_spec.rb} +2 -2
  48. data/spec/server/models/{ia_line.rb → ia_line_spec.rb} +2 -2
  49. data/spec/server/models/{ia_reason.rb → ia_reason_spec.rb} +2 -2
  50. data/spec/server/models/{inv_line.rb → inv_line_spec.rb} +2 -2
  51. data/spec/server/models/{inventory_adjustment.rb → inventory_adjustment_spec.rb} +2 -2
  52. data/spec/server/models/{invoice.rb → invoice_spec.rb} +2 -2
  53. data/spec/server/models/{location.rb → location_spec.rb} +2 -2
  54. data/spec/server/models/{payment_term.rb → payment_term_spec.rb} +2 -2
  55. data/spec/server/models/{pick_ticket.rb → pick_ticket_spec.rb} +2 -2
  56. data/spec/server/models/{po_line.rb → po_line_spec.rb} +2 -2
  57. data/spec/server/models/{po_receipt.rb → po_receipt_spec.rb} +2 -2
  58. data/spec/server/models/{por_line.rb → por_line_spec.rb} +2 -2
  59. data/spec/server/models/{pt_line.rb → pt_line_spec.rb} +2 -2
  60. data/spec/server/models/{purchase_order.rb → purchase_order_spec.rb} +2 -2
  61. data/spec/server/models/sales_order_spec.rb +22 -0
  62. data/spec/server/models/{sku_loc.rb → sku_loc_spec.rb} +2 -2
  63. data/spec/server/models/{sku.rb → sku_spec.rb} +2 -2
  64. data/spec/server/models/{sku_tran.rb → sku_tran_spec.rb} +2 -2
  65. data/spec/server/models/{sku_vendor.rb → sku_vendor_spec.rb} +2 -2
  66. data/spec/server/models/{so_line.rb → so_line_spec.rb} +2 -2
  67. data/spec/server/models/{uom.rb → uom_spec.rb} +2 -2
  68. data/spec/server/models/{vendor.rb → vendor_spec.rb} +2 -2
  69. data/spec/server/models/{vo_line.rb → vo_line_spec.rb} +2 -2
  70. data/spec/server/models/{voucher.rb → voucher_spec.rb} +2 -2
  71. data/spec/server/spec_helper.rb +42 -0
  72. data/spec/skr/models/CustomerSpec.coffee +4 -3
  73. data/spec/skr/models/SalesOrderSpec.coffee +4 -2
  74. data/spec/skr/screens/sales-order/SalesOrderSpec.coffee +5 -0
  75. metadata +40 -36
  76. data/client/skr/screens/mixins/Editing.coffee +0 -32
  77. data/lib/skr/concerns/code_identifier.rb +0 -43
  78. data/log/test.log +0 -0
  79. data/spec/server/models/sales_order.rb +0 -10
  80. /data/spec/server/models/{spec_helper.rb → spec_helper_spec.rb} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f0380f6e7b42c7134dacab53717cda237178218d
4
- data.tar.gz: ccd6d92f6a86ce3e8b40b91fd24e6038a4d499ba
3
+ metadata.gz: f560ee8a3baf00f8132abaa16e7102af0a754628
4
+ data.tar.gz: fc2279a4c83c7503f8ed05236ee15bb7a0c53f66
5
5
  SHA512:
6
- metadata.gz: fb2b347c580c38411504b64097364cc2b89e2e2dd370e0ae4748835697eecb9acd3fc221511ac1bfca7d207beca9de85adc203ea5e3a3745543666a613a54f48
7
- data.tar.gz: 030a173c0e3c6e662d3a6e0badf574934beb9962c896f33f51565df824bc418b3d5b211bcef4b862d4d77cb9e5118d84af4095b05cec411271c2060f0763f7d1
6
+ metadata.gz: 39612948c454591b7103a2528df39178141427af782c91e6f291a75772b467c2e535c2ce80b03060d56370ade3278ed7c621a9ca732f9e0d4b1040dfa9b40f48
7
+ data.tar.gz: ad721dbe0d756b452385afb05309ad9667d257ddccf011adceab0e7526cfdea17e34f0651d83df77de8589a1d971926900f2c362346cf3ea1141af06875fb5d0
data/.gitignore CHANGED
@@ -1,4 +1,5 @@
1
1
  public/assets
2
2
  tmp/cache
3
+ log/
3
4
  secrets.yml
4
5
  pkg
data/Gemfile.lock CHANGED
@@ -1,9 +1,9 @@
1
1
  GIT
2
2
  remote: git://github.com/argosity/lanes.git
3
- revision: 677204b46b9f22c78965fd70d01fd43a911db3ac
3
+ revision: 3574e2186fff13c0bc6203ce1fd437f30142e500
4
4
  branch: master
5
5
  specs:
6
- lanes (0.1.8)
6
+ lanes (0.1.9)
7
7
  activerecord (~> 4.2)
8
8
  bcrypt (~> 3.1)
9
9
  closure-compiler (~> 1.1)
@@ -35,7 +35,7 @@ GIT
35
35
  PATH
36
36
  remote: .
37
37
  specs:
38
- stockor (0.1.7)
38
+ stockor (0.1.8)
39
39
  aasm (~> 4.1)
40
40
  lanes
41
41
 
@@ -59,24 +59,24 @@ GEM
59
59
  arel (6.0.0)
60
60
  bcrypt (3.1.10)
61
61
  builder (3.2.2)
62
- byebug (4.0.4)
62
+ byebug (4.0.5)
63
63
  columnize (= 0.9.0)
64
64
  celluloid (0.16.0)
65
65
  timers (~> 4.0.0)
66
- childprocess (0.5.5)
66
+ childprocess (0.5.6)
67
67
  ffi (~> 1.0, >= 1.0.11)
68
68
  closure-compiler (1.1.11)
69
69
  coderay (1.1.0)
70
- coffee-script (2.3.0)
70
+ coffee-script (2.4.1)
71
71
  coffee-script-source
72
72
  execjs
73
- coffee-script-source (1.9.1)
73
+ coffee-script-source (1.9.1.1)
74
74
  columnize (0.9.0)
75
75
  compass-import-once (1.0.5)
76
76
  sass (>= 3.2, < 3.5)
77
- crass (1.0.1)
77
+ crass (1.0.2)
78
78
  eventmachine (1.0.7)
79
- execjs (2.4.0)
79
+ execjs (2.5.2)
80
80
  faker (1.4.3)
81
81
  i18n (~> 0.5)
82
82
  ffi (1.9.8)
@@ -103,7 +103,7 @@ GEM
103
103
  guard-minitest (2.4.4)
104
104
  guard-compat (~> 1.2)
105
105
  minitest (>= 3.0)
106
- hashie (3.4.0)
106
+ hashie (3.4.1)
107
107
  hike (1.2.3)
108
108
  hitimes (1.2.2)
109
109
  i18n (0.7.0)
@@ -126,7 +126,7 @@ GEM
126
126
  metaclass (0.0.4)
127
127
  method_source (0.8.2)
128
128
  mini_portile (0.6.2)
129
- minitest (5.5.1)
129
+ minitest (5.6.0)
130
130
  minitest-around (0.3.1)
131
131
  minitest (~> 5.0)
132
132
  mocha (1.1.0)
@@ -140,7 +140,7 @@ GEM
140
140
  notiffany (0.0.6)
141
141
  nenv (~> 0.1)
142
142
  shellany (~> 0.0)
143
- oj (2.12.1)
143
+ oj (2.12.4)
144
144
  pg (0.18.1)
145
145
  phantomjs (1.9.8.0)
146
146
  pry (0.10.1)
@@ -150,7 +150,7 @@ GEM
150
150
  pry-byebug (3.1.0)
151
151
  byebug (~> 4.0)
152
152
  pry (~> 0.10)
153
- puma (2.11.1)
153
+ puma (2.11.2)
154
154
  rack (>= 1.1, < 2.0)
155
155
  rack (1.6.0)
156
156
  rack-protection (1.5.3)
@@ -1,5 +1,15 @@
1
- #= require ./screens/customer-maint
2
-
3
1
  class Skr.Extension extends Lanes.Extensions.Base
4
2
 
5
3
  identifier: "skr"
4
+
5
+ # This method is called when the extension is registered
6
+ # Not all of Lanes will be available yet
7
+ onRegistered: ->
8
+
9
+ # Data that is provided by lib/skr/extension.rb's
10
+ # client_bootstrap_data method ends up here
11
+ setBootstrapData: (data)->
12
+ Skr.Models.GlAccount.initialize(data)
13
+
14
+ # All of lanes is loaded and it is in the process of booting
15
+ onAvailable: ->
@@ -1,9 +1,20 @@
1
1
  class Skr.Models.GlAccount extends Skr.Models.Base
2
2
 
3
+ cacheDuration: [1,'day']
3
4
 
4
5
  props:
5
6
  id: {"type":"integer","required":true}
6
7
  number: {"type":"string","required":true}
7
8
  name: {"type":"string","required":true}
8
- description:{"type":"string","required":true}
9
9
  is_active: {"type":"boolean","required":true,"default":"true"}
10
+
11
+ derived:
12
+ combined_name:
13
+ deps: ['number','name'], fn:->
14
+ "#{@number}: #{@name}"
15
+
16
+
17
+ @initialize: (data)->
18
+ this.default_ids = data.default_gl_account_ids
19
+ ms=Lanes.Vendor.Moment.duration(this::cacheDuration...).asMilliseconds()
20
+ Lanes.Models.ServerCache.store(this::urlRoot(), data.gl_accounts, ms)
@@ -8,11 +8,16 @@ class Skr.Models.PurchaseOrder extends Skr.Models.Base
8
8
  location_id: {"type":"integer","required":true}
9
9
  ship_addr_id: {"type":"integer","required":true}
10
10
  terms_id: {"type":"integer","required":true}
11
- state: {"type":"string","required":true}
11
+ state: {"type":"integer"}
12
12
  is_revised: {"type":"boolean","required":true,"default":"false"}
13
13
  order_date: {"type":"any","required":true}
14
14
  receiving_completed_at:"date"
15
15
 
16
+ enums:
17
+ state:
18
+ open: 1
19
+ received: 2
20
+
16
21
  associations:
17
22
  terms: { model: "PaymentTerm" }
18
23
  vendor: { model: "Vendor" }
@@ -10,7 +10,7 @@ class Skr.Models.SalesOrder extends Skr.Models.Base
10
10
  billing_address_id: {"type":"integer","required":true}
11
11
  terms_id: {"type":"integer","required":true}
12
12
  order_date: {"type":"any","required":true}
13
- state: {"type":"string","required":true}
13
+ state: {"type":"integer"}
14
14
  is_revised: {"type":"boolean","required":true,"default":"false"}
15
15
  hash_code: {"type":"string","required":true}
16
16
  ship_partial: {"type":"boolean","required":true,"default":"false"}
@@ -19,6 +19,12 @@ class Skr.Models.SalesOrder extends Skr.Models.Base
19
19
  notes: "string"
20
20
  options: "any"
21
21
 
22
+ enums:
23
+ state:
24
+ open: 1
25
+ complete: 5
26
+ canceled: 9
27
+
22
28
  associations:
23
29
  customer: { model: "Customer" }
24
30
  location: { model: "Location" }
@@ -4,7 +4,9 @@ class Skr.Models.Sku extends Skr.Models.Base
4
4
  props:
5
5
  id: {"type":"integer","required":true}
6
6
  default_vendor_id: {"type":"integer","required":true}
7
- gl_asset_account_id: {"type":"integer","required":true}
7
+ gl_asset_account_id: {"type":"integer","required":true, default: ->
8
+ Skr.Models.GlAccount.default_ids.asset
9
+ }
8
10
  default_uom_code: {"type":"string","required":true}
9
11
  code: {"type":"string","required":true}
10
12
  description: {"type":"string","required":true}
@@ -14,7 +16,9 @@ class Skr.Models.Sku extends Skr.Models.Base
14
16
 
15
17
  associations:
16
18
  default_vendor: { model: "Vendor" }
17
- gl_asset_account: { model: "GlAccount" }
19
+ gl_asset_account: { model: "GlAccount", default: ->
20
+ Skr.Models.GlAccount.fetchById(this.gl_asset_account_id)
21
+ }
18
22
  sku_locs: { collection: "SkuLoc" }
19
23
  sku_vendors: { collection: "SkuVendor" }
20
24
  uoms: { collection: "Uom" }
@@ -0,0 +1,5 @@
1
+ Skr.Models.Mixins.VisibleID = {
2
+
3
+ invalidChars: /[^0-9]/
4
+
5
+ }
@@ -1,7 +1,7 @@
1
1
  class Skr.Screens.CustomerMaint extends Skr.Screens.Base
2
2
 
3
3
  mixins:[
4
- Skr.Screens.Mixins.Editing
4
+ Lanes.Screens.Mixins.Editing
5
5
  ]
6
6
 
7
7
  useFormBindings: true
@@ -1 +0,0 @@
1
- //=require ./Editing
@@ -0,0 +1,30 @@
1
+ class Skr.Screens.SalesOrder extends Skr.Screens.Base
2
+
3
+ mixins:[
4
+ Lanes.Screens.Mixins.Editing
5
+ ]
6
+ formBindings: true
7
+ subviews:
8
+ terms:
9
+ component: 'SelectField'
10
+ model: 'model'
11
+ options: { association: 'terms'}
12
+ customer:
13
+ component: 'SelectField'
14
+ model: 'model'
15
+ options: { association: 'customer'}
16
+ billaddr:
17
+ component: 'Address'
18
+ model: 'model.billing_address'
19
+ options: { field_name: 'billing_address_id' }
20
+ shipaddr:
21
+ component: 'Address'
22
+ model: 'model.shipping_address'
23
+ options: ->{ copyFrom: this.billaddr, field_name: 'shipping_address_id' }
24
+
25
+ finderOptions: ->
26
+ modelClass: Skr.Models.SalesOrder
27
+ title: 'Find Sales Order',
28
+ invalid_chars: Skr.Models.Mixins.VisibleID.invalidChars
29
+ withAssociations: []
30
+ fields: ['visible_id', 'notes']
@@ -0,0 +1,5 @@
1
+ //= require_tree .
2
+
3
+ /*
4
+ Add additional requirement statements for other files that the screen uses
5
+ */
@@ -0,0 +1,8 @@
1
+ /*
2
+ If your screen does not use any custom styles
3
+
4
+ You should remove this file and it's reference from config/screens.rb
5
+
6
+ Otherwise Lanes will continue to fetch an empty file whenever
7
+ the screen is displayed
8
+ */
@@ -0,0 +1,30 @@
1
+ <div>
2
+ <%= h.toolbar buttons: ['save','reset'] %>
3
+ <div class="header">
4
+ <div class="row">
5
+ <%= h.subview 'finder', widths: [12,4,4,3], label: 'Number' %>
6
+ <%= h.text_field 'notes', widths: [12,8,8,9] %>
7
+ </div>
8
+ <div class="row">
9
+ <%= h.subview 'customer', widths: [12,3] %>
10
+ <%= h.text_field 'po_num', widths: [12,6] %>
11
+ <%= h.subview 'terms', widths: [12,3] %>
12
+ </div>
13
+ </div>
14
+ <div class="row">
15
+ <div class="<%= h.grid_widths 12,6 %>">
16
+ <fieldset class="addresses bordered">
17
+ <legend>Billing Address</legend>
18
+ <%= h.subview 'billaddr', unwrapped: true %>
19
+
20
+ </fieldset>
21
+ </div>
22
+ <div class="<%= h.grid_widths 12,6 %>">
23
+ <fieldset class="addresses bordered">
24
+ <legend>Shiping Address</legend>
25
+ <%= h.subview 'shipaddr', unwrapped: true %>
26
+ </fieldset>
27
+ </div>
28
+ </div>
29
+
30
+ </div>
@@ -1,9 +1,14 @@
1
1
  class Skr.Screens.SkuMaint extends Skr.Screens.Base
2
2
 
3
3
  mixins:[
4
- Skr.Screens.Mixins.Editing
4
+ Lanes.Screens.Mixins.Editing
5
5
  ]
6
- useFormBindings: true
6
+
7
+ subviews:
8
+ glacct:
9
+ component: 'SelectField'
10
+ model: 'model'
11
+ options: { association: 'gl_asset_account', mappings: { title: 'combined_name' } }
7
12
 
8
13
  finderOptions: ->
9
14
  modelClass: Skr.Models.Sku
@@ -9,4 +9,8 @@
9
9
 
10
10
  </div>
11
11
 
12
+ <div class="row">
13
+ <%= h.subview 'glacct', label: "GL Asset Account", widths: [12,3] %>
14
+ </div>
15
+
12
16
  </div>
@@ -1,7 +1,7 @@
1
1
  class Skr.Screens.VendorMaint extends Skr.Screens.Base
2
2
 
3
3
  mixins:[
4
- Skr.Screens.Mixins.Editing
4
+ Lanes.Screens.Mixins.Editing
5
5
  ]
6
6
 
7
7
  useFormBindings: true
@@ -5,6 +5,7 @@
5
5
  height: 48px;
6
6
  width: 150px;
7
7
  margin: 2px;
8
+ text-indent: -9999px;
8
9
  background: url(asset_path('images/skr/logo-sm.png')) no-repeat;
9
10
  }
10
11
  }
data/config/screens.rb CHANGED
@@ -1,13 +1,19 @@
1
1
  Lanes::Screen.define_group 'maint' do | group |
2
- group.title = "Customers"
3
- group.description = "Maintain records related to Customers"
4
- group.icon = "icon-users"
2
+ group.title = "Maintenance"
3
+ group.description = "Maintain records"
4
+ group.icon = "icon-wrench"
5
+ end
6
+
7
+ Lanes::Screen.define_group 'customer' do | group |
8
+ group.title = "Customer"
9
+ group.description = "Custoemr records"
10
+ group.icon = "icon-wrench"
5
11
  end
6
12
 
7
13
 
8
14
  Lanes::Screen.define "customer-maint" do | screen |
9
15
  screen.title = "Customer Maintenance"
10
- screen.icon = "icon-wrench2"
16
+ screen.icon = "icon-users"
11
17
  screen.group_id = "maint"
12
18
  screen.model_class = "Customer"
13
19
  screen.view_class = "Skr.Screens.CustomerMaint"
@@ -17,7 +23,7 @@ end
17
23
 
18
24
  Lanes::Screen.define "sku-maint" do | screen |
19
25
  screen.title = "SKU Maintenance"
20
- screen.icon = "icon-wrench2"
26
+ screen.icon = "icon-gift"
21
27
  screen.group_id = "maint"
22
28
  screen.model_class = "Sku"
23
29
  screen.view_class = "Skr.Screens.SkuMaint"
@@ -27,10 +33,20 @@ end
27
33
 
28
34
  Lanes::Screen.define "vendor-maint" do | screen |
29
35
  screen.title = "Vendor Maintenance"
30
- screen.icon = "icon-wrench2"
36
+ screen.icon = "icon-truck"
31
37
  screen.group_id = "maint"
32
38
  screen.model_class = "Vendor"
33
39
  screen.view_class = "Skr.Screens.VendorMaint"
34
40
  screen.js = "skr/screens/vendor-maint.js"
35
41
  screen.css = "skr/screens/vendor-maint.css"
36
42
  end
43
+ Lanes::Screen.define "sales-order" do | screen |
44
+ screen.title = "Sales Order"
45
+ screen.description = ""
46
+ screen.icon = ""
47
+ screen.group_id = "customer"
48
+ screen.model_class = "SalesOrder"
49
+ screen.view_class = "Skr.Screens.SalesOrder"
50
+ screen.js = "skr/screens/sales-order.js"
51
+ screen.css = "skr/screens/sales-order.css"
52
+ end
@@ -11,7 +11,7 @@ class CreateSkrSalesOrders < ActiveRecord::Migration
11
11
  t.skr_reference :billing_address, to_table: 'addresses'
12
12
  t.skr_reference :terms, to_table: 'payment_terms'
13
13
  t.date "order_date", null: false
14
- t.string "state", null: false
14
+ t.integer "state", null: false, limit: 2
15
15
  t.boolean "is_revised", null: false, default: false
16
16
  t.string "hash_code", null: false
17
17
  t.boolean "ship_partial", null: false, default: false
@@ -9,7 +9,7 @@ class CreateSkrPurchaseOrders < ActiveRecord::Migration
9
9
  t.skr_reference :location, single: true
10
10
  t.skr_reference :ship_addr, to_table: 'addresses'
11
11
  t.skr_reference :terms, to_table: 'payment_terms'
12
- t.string "state", null: false
12
+ t.integer "state", null: false, limit: 2
13
13
  t.boolean "is_revised", null: false, default: false
14
14
  t.date "order_date", null: false
15
15
  t.datetime "receiving_completed_at"
@@ -21,7 +21,7 @@ class CreateSkrSkuQtyDetailsView < ActiveRecord::Migration
21
21
  sum( ( sol.qty - sol.qty_canceled ) * sol.uom_size ) as qty
22
22
  from #{skr_prefix}so_lines sol
23
23
  join #{skr_prefix}sales_orders so on so.id = sol.sales_order_id
24
- and state not in ('canceled', 'complete')
24
+ and so.state not in (5,9) -- complete, canceled
25
25
  join #{skr_prefix}sku_locs sl on sl.id = sol.sku_loc_id
26
26
  join #{skr_prefix}skus s on s.id = sl.sku_id
27
27
  group by s.id
@@ -33,7 +33,7 @@ class CreateSkrSkuQtyDetailsView < ActiveRecord::Migration
33
33
  sum( ( pol.qty - pol.qty_canceled ) * pol.uom_size ) as qty
34
34
  from #{skr_prefix}po_lines pol
35
35
  join #{skr_prefix}purchase_orders po on po.id = pol.purchase_order_id
36
- and state not in ('canceled', 'complete')
36
+ and po.state not in (5,9) -- complete, canceled
37
37
  join #{skr_prefix}sku_locs sl on sl.id = pol.sku_loc_id
38
38
  join #{skr_prefix}skus s on s.id = sl.sku_id
39
39
  group by s.id