stockor 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (259) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +4 -0
  3. data/Gemfile +11 -0
  4. data/Gemfile.lock +220 -0
  5. data/Guardfile +13 -0
  6. data/README.md +7 -0
  7. data/Rakefile +7 -0
  8. data/client/skr/Extension.coffee +12 -0
  9. data/client/skr/components/.gitkeep +0 -0
  10. data/client/skr/components/address/Address.coffee +21 -0
  11. data/client/skr/components/address/address.html +20 -0
  12. data/client/skr/index.js +21 -0
  13. data/client/skr/models/Address.coffee +17 -0
  14. data/client/skr/models/Base.coffee +8 -0
  15. data/client/skr/models/Customer.coffee +26 -0
  16. data/client/skr/models/GlAccount.coffee +10 -0
  17. data/client/skr/models/GlManualEntry.coffee +11 -0
  18. data/client/skr/models/GlPeriod.coffee +10 -0
  19. data/client/skr/models/GlPosting.coffee +15 -0
  20. data/client/skr/models/GlTransaction.coffee +16 -0
  21. data/client/skr/models/IaLine.coffee +19 -0
  22. data/client/skr/models/IaReason.coffee +12 -0
  23. data/client/skr/models/InvLine.coffee +27 -0
  24. data/client/skr/models/InventoryAdjustment.coffee +17 -0
  25. data/client/skr/models/Invoice.coffee +31 -0
  26. data/client/skr/models/Location.coffee +15 -0
  27. data/client/skr/models/PaymentTerm.coffee +11 -0
  28. data/client/skr/models/PickTicket.coffee +19 -0
  29. data/client/skr/models/PoLine.coffee +27 -0
  30. data/client/skr/models/PoReceipt.coffee +20 -0
  31. data/client/skr/models/PorLine.coffee +26 -0
  32. data/client/skr/models/PtLine.coffee +27 -0
  33. data/client/skr/models/PurchaseOrder.coffee +23 -0
  34. data/client/skr/models/SalesOrder.coffee +32 -0
  35. data/client/skr/models/Sku.coffee +21 -0
  36. data/client/skr/models/SkuLoc.coffee +21 -0
  37. data/client/skr/models/SkuTran.coffee +23 -0
  38. data/client/skr/models/SkuVendor.coffee +19 -0
  39. data/client/skr/models/SoLine.coffee +27 -0
  40. data/client/skr/models/Uom.coffee +17 -0
  41. data/client/skr/models/Vendor.coffee +28 -0
  42. data/client/skr/models/VoLine.coffee +23 -0
  43. data/client/skr/models/Voucher.coffee +22 -0
  44. data/client/skr/models/mixins/CodeField.coffee +5 -0
  45. data/client/skr/screens/.gitkeep +0 -0
  46. data/client/skr/screens/Base.coffee +3 -0
  47. data/client/skr/screens/base/index.js +5 -0
  48. data/client/skr/screens/base/index.scss +9 -0
  49. data/client/skr/screens/base/layout.html +3 -0
  50. data/client/skr/screens/customer-maint/CustomerMaint.coffee +49 -0
  51. data/client/skr/screens/customer-maint/index.js +5 -0
  52. data/client/skr/screens/customer-maint/index.scss +9 -0
  53. data/client/skr/screens/customer-maint/layout.html +32 -0
  54. data/client/skr/styles.scss +1 -0
  55. data/client/skr/views/.gitkeep +0 -0
  56. data/client/skr/views/Base.coffee +5 -0
  57. data/config/database.yml +9 -0
  58. data/config/lanes.rb +7 -0
  59. data/config/routes.rb +39 -0
  60. data/config/screens.rb +17 -0
  61. data/config.ru +5 -0
  62. data/db/.gitkeep +0 -0
  63. data/db/migrate/20120110142845_create_skr_sequential_ids.rb +35 -0
  64. data/db/migrate/20140202185309_create_skr_gl_accounts.rb +15 -0
  65. data/db/migrate/20140202193316_create_skr_gl_periods.rb +16 -0
  66. data/db/migrate/20140202193318_create_skr_gl_transactions.rb +14 -0
  67. data/db/migrate/20140202193319_create_skr_gl_postings.rb +16 -0
  68. data/db/migrate/20140202193700_create_skr_gl_manual_entries.rb +13 -0
  69. data/db/migrate/20140213040608_create_skr_payment_terms.rb +16 -0
  70. data/db/migrate/20140220031700_create_skr_addresses.rb +19 -0
  71. data/db/migrate/20140220031800_create_skr_locations.rb +19 -0
  72. data/db/migrate/20140220190836_create_skr_vendors.rb +22 -0
  73. data/db/migrate/20140220203029_create_skr_customers.rb +22 -0
  74. data/db/migrate/20140224034759_create_skr_skus.rb +22 -0
  75. data/db/migrate/20140225032853_create_skr_sku_locs.rb +21 -0
  76. data/db/migrate/20140320030501_create_skr_uoms.rb +19 -0
  77. data/db/migrate/20140321031604_create_skr_sku_vendors.rb +18 -0
  78. data/db/migrate/20140322012143_create_skr_ia_reasons.rb +14 -0
  79. data/db/migrate/20140322014401_create_skr_inventory_adjustments.rb +16 -0
  80. data/db/migrate/20140322023453_create_skr_ia_lines.rb +18 -0
  81. data/db/migrate/20140322035024_create_skr_sku_trans.rb +21 -0
  82. data/db/migrate/20140322223912_create_skr_sales_orders.rb +27 -0
  83. data/db/migrate/20140322223920_create_skr_so_lines.rb +25 -0
  84. data/db/migrate/20140323001446_create_so_details_view.rb +81 -0
  85. data/db/migrate/20140327202102_create_skr_purchase_orders.rb +20 -0
  86. data/db/migrate/20140327202107_create_skr_po_lines.rb +25 -0
  87. data/db/migrate/20140327202207_create_skr_pick_tickets.rb +16 -0
  88. data/db/migrate/20140327202209_create_skr_pt_lines.rb +23 -0
  89. data/db/migrate/20140327224000_create_skr_invoices.rb +25 -0
  90. data/db/migrate/20140327224002_create_skr_inv_lines.rb +23 -0
  91. data/db/migrate/20140330232808_create_skr_sku_loc_details_view.rb +31 -0
  92. data/db/migrate/20140330232810_create_skr_sku_qty_details_view.rb +48 -0
  93. data/db/migrate/20140400164729_create_skr_vouchers.rb +22 -0
  94. data/db/migrate/20140400164733_create_skr_vo_lines.rb +21 -0
  95. data/db/migrate/20140401164729_create_skr_po_receipt.rb +16 -0
  96. data/db/migrate/20140401164740_create_skr_por_line.rb +21 -0
  97. data/db/migrate/20140422024010_create_skr_inv_details_view.rb +42 -0
  98. data/db/schema.sql +2662 -0
  99. data/db/seed/chart_of_accounts.yml +168 -0
  100. data/db/seed/payment_terms.yml +60 -0
  101. data/db/seed.rb +29 -0
  102. data/lib/skr/access_roles.rb +28 -0
  103. data/lib/skr/concerns/acts_as_uom.rb +47 -0
  104. data/lib/skr/concerns/code_identifier.rb +43 -0
  105. data/lib/skr/concerns/gl_tran_extensions.rb +18 -0
  106. data/lib/skr/concerns/has_gl_transaction.rb +67 -0
  107. data/lib/skr/concerns/has_sku_loc_lines.rb +47 -0
  108. data/lib/skr/concerns/immutable_model.rb +32 -0
  109. data/lib/skr/concerns/inv_extensions.rb +24 -0
  110. data/lib/skr/concerns/is_order_like.rb +47 -0
  111. data/lib/skr/concerns/is_sku_loc_line.rb +65 -0
  112. data/lib/skr/concerns/locked_fields.rb +84 -0
  113. data/lib/skr/concerns/pt_extensions.rb +22 -0
  114. data/lib/skr/concerns/random_hash_code.rb +40 -0
  115. data/lib/skr/concerns/so_extensions.rb +30 -0
  116. data/lib/skr/concerns/state_machine.rb +61 -0
  117. data/lib/skr/concerns/visible_id_identifier.rb +53 -0
  118. data/lib/skr/configuration.rb +68 -0
  119. data/lib/skr/db/migration_helpers.rb +178 -0
  120. data/lib/skr/extension.rb +23 -0
  121. data/lib/skr/model.rb +19 -0
  122. data/lib/skr/models/address.rb +97 -0
  123. data/lib/skr/models/business_entity.rb +29 -0
  124. data/lib/skr/models/customer.rb +35 -0
  125. data/lib/skr/models/gl_account.rb +56 -0
  126. data/lib/skr/models/gl_manual_entry.rb +31 -0
  127. data/lib/skr/models/gl_period.rb +13 -0
  128. data/lib/skr/models/gl_posting.rb +54 -0
  129. data/lib/skr/models/gl_transaction.rb +175 -0
  130. data/lib/skr/models/ia_line.rb +129 -0
  131. data/lib/skr/models/ia_reason.rb +16 -0
  132. data/lib/skr/models/inv_line.rb +90 -0
  133. data/lib/skr/models/inventory_adjustment.rb +60 -0
  134. data/lib/skr/models/invoice.rb +159 -0
  135. data/lib/skr/models/location.rb +31 -0
  136. data/lib/skr/models/payment_term.rb +30 -0
  137. data/lib/skr/models/pick_ticket.rb +71 -0
  138. data/lib/skr/models/po_line.rb +69 -0
  139. data/lib/skr/models/po_receipt.rb +51 -0
  140. data/lib/skr/models/por_line.rb +80 -0
  141. data/lib/skr/models/pt_line.rb +74 -0
  142. data/lib/skr/models/purchase_order.rb +112 -0
  143. data/lib/skr/models/sales_order.rb +159 -0
  144. data/lib/skr/models/sequential_id.rb +23 -0
  145. data/lib/skr/models/sku.rb +99 -0
  146. data/lib/skr/models/sku_loc.rb +94 -0
  147. data/lib/skr/models/sku_tran.rb +111 -0
  148. data/lib/skr/models/sku_vendor.rb +26 -0
  149. data/lib/skr/models/so_line.rb +159 -0
  150. data/lib/skr/models/uom.rb +63 -0
  151. data/lib/skr/models/user_proxy.rb +60 -0
  152. data/lib/skr/models/vendor.rb +33 -0
  153. data/lib/skr/models/vo_line.rb +35 -0
  154. data/lib/skr/models/voucher.rb +119 -0
  155. data/lib/skr/standard_pricing_provider.rb +14 -0
  156. data/lib/skr/version.rb +3 -0
  157. data/lib/skr.rb +18 -0
  158. data/lib/stockor.rb +4 -0
  159. data/lib/tasks/debug-activity.rake +58 -0
  160. data/log/test.log +0 -0
  161. data/spec/fixtures/skr/address.yml +2 -0
  162. data/spec/fixtures/skr/customer.yml +2 -0
  163. data/spec/fixtures/skr/gl_account.yml +2 -0
  164. data/spec/fixtures/skr/gl_manual_entry.yml +2 -0
  165. data/spec/fixtures/skr/gl_period.yml +2 -0
  166. data/spec/fixtures/skr/gl_posting.yml +2 -0
  167. data/spec/fixtures/skr/gl_transaction.yml +2 -0
  168. data/spec/fixtures/skr/ia_line.yml +2 -0
  169. data/spec/fixtures/skr/ia_reason.yml +2 -0
  170. data/spec/fixtures/skr/inv_line.yml +2 -0
  171. data/spec/fixtures/skr/inventory_adjustment.yml +2 -0
  172. data/spec/fixtures/skr/invoice.yml +2 -0
  173. data/spec/fixtures/skr/location.yml +2 -0
  174. data/spec/fixtures/skr/payment_term.yml +2 -0
  175. data/spec/fixtures/skr/pick_ticket.yml +2 -0
  176. data/spec/fixtures/skr/po_line.yml +2 -0
  177. data/spec/fixtures/skr/po_receipt.yml +2 -0
  178. data/spec/fixtures/skr/por_line.yml +2 -0
  179. data/spec/fixtures/skr/pt_line.yml +2 -0
  180. data/spec/fixtures/skr/purchase_order.yml +2 -0
  181. data/spec/fixtures/skr/sales_order.yml +2 -0
  182. data/spec/fixtures/skr/sku.yml +2 -0
  183. data/spec/fixtures/skr/sku_loc.yml +2 -0
  184. data/spec/fixtures/skr/sku_tran.yml +2 -0
  185. data/spec/fixtures/skr/sku_vendor.yml +2 -0
  186. data/spec/fixtures/skr/so_line.yml +2 -0
  187. data/spec/fixtures/skr/uom.yml +2 -0
  188. data/spec/fixtures/skr/vendor.yml +2 -0
  189. data/spec/fixtures/skr/vo_line.yml +2 -0
  190. data/spec/fixtures/skr/voucher.yml +2 -0
  191. data/spec/skr/address.rb +10 -0
  192. data/spec/skr/concerns/code_identifier_spec.rb +45 -0
  193. data/spec/skr/customer.rb +10 -0
  194. data/spec/skr/gl_account.rb +10 -0
  195. data/spec/skr/gl_manual_entry.rb +10 -0
  196. data/spec/skr/gl_period.rb +10 -0
  197. data/spec/skr/gl_posting.rb +10 -0
  198. data/spec/skr/gl_transaction.rb +10 -0
  199. data/spec/skr/ia_line.rb +10 -0
  200. data/spec/skr/ia_reason.rb +10 -0
  201. data/spec/skr/inv_line.rb +10 -0
  202. data/spec/skr/inventory_adjustment.rb +10 -0
  203. data/spec/skr/invoice.rb +10 -0
  204. data/spec/skr/location.rb +10 -0
  205. data/spec/skr/models/AddressSpec.coffee +5 -0
  206. data/spec/skr/models/CustomerSpec.coffee +5 -0
  207. data/spec/skr/models/GlAccountSpec.coffee +5 -0
  208. data/spec/skr/models/GlManualEntrySpec.coffee +5 -0
  209. data/spec/skr/models/GlPeriodSpec.coffee +5 -0
  210. data/spec/skr/models/GlPostingSpec.coffee +5 -0
  211. data/spec/skr/models/GlTransactionSpec.coffee +5 -0
  212. data/spec/skr/models/IaLineSpec.coffee +5 -0
  213. data/spec/skr/models/IaReasonSpec.coffee +5 -0
  214. data/spec/skr/models/InvLineSpec.coffee +5 -0
  215. data/spec/skr/models/InventoryAdjustmentSpec.coffee +5 -0
  216. data/spec/skr/models/InvoiceSpec.coffee +5 -0
  217. data/spec/skr/models/LocationSpec.coffee +5 -0
  218. data/spec/skr/models/PaymentTermSpec.coffee +5 -0
  219. data/spec/skr/models/PickTicketSpec.coffee +5 -0
  220. data/spec/skr/models/PoLineSpec.coffee +5 -0
  221. data/spec/skr/models/PoReceiptSpec.coffee +5 -0
  222. data/spec/skr/models/PorLineSpec.coffee +5 -0
  223. data/spec/skr/models/PtLineSpec.coffee +5 -0
  224. data/spec/skr/models/PurchaseOrderSpec.coffee +5 -0
  225. data/spec/skr/models/SalesOrderSpec.coffee +5 -0
  226. data/spec/skr/models/SkuLocSpec.coffee +5 -0
  227. data/spec/skr/models/SkuSpec.coffee +5 -0
  228. data/spec/skr/models/SkuTranSpec.coffee +5 -0
  229. data/spec/skr/models/SkuVendorSpec.coffee +5 -0
  230. data/spec/skr/models/SoLineSpec.coffee +5 -0
  231. data/spec/skr/models/UomSpec.coffee +5 -0
  232. data/spec/skr/models/VendorSpec.coffee +5 -0
  233. data/spec/skr/models/VoLineSpec.coffee +5 -0
  234. data/spec/skr/models/VoucherSpec.coffee +5 -0
  235. data/spec/skr/payment_term.rb +10 -0
  236. data/spec/skr/pick_ticket.rb +10 -0
  237. data/spec/skr/po_line.rb +10 -0
  238. data/spec/skr/po_receipt.rb +10 -0
  239. data/spec/skr/por_line.rb +10 -0
  240. data/spec/skr/pt_line.rb +10 -0
  241. data/spec/skr/purchase_order.rb +10 -0
  242. data/spec/skr/sales_order.rb +10 -0
  243. data/spec/skr/screens/Base.coffee +7 -0
  244. data/spec/skr/screens/CustomerMaint.coffee +7 -0
  245. data/spec/skr/screens/vendor-maint/VendorMaintSpec.coffee +5 -0
  246. data/spec/skr/sku.rb +10 -0
  247. data/spec/skr/sku_loc.rb +10 -0
  248. data/spec/skr/sku_tran.rb +10 -0
  249. data/spec/skr/sku_vendor.rb +10 -0
  250. data/spec/skr/so_line.rb +10 -0
  251. data/spec/skr/spec_helper.rb +26 -0
  252. data/spec/skr/uom.rb +10 -0
  253. data/spec/skr/vendor.rb +10 -0
  254. data/spec/skr/views/AddressSpec.coffee +5 -0
  255. data/spec/skr/vo_line.rb +10 -0
  256. data/spec/skr/voucher.rb +10 -0
  257. data/stockor.gemspec +38 -0
  258. data/tmp/.gitkeep +0 -0
  259. metadata +414 -0
@@ -0,0 +1,27 @@
1
+ class Skr.Models.PoLine extends Skr.Models.Base
2
+
3
+ FILE: FILE
4
+
5
+ props:
6
+ id: {"type":"integer","required":true}
7
+ purchase_order_id:{"type":"integer","required":true}
8
+ sku_loc_id: {"type":"integer","required":true}
9
+ sku_vendor_id: {"type":"integer","required":true}
10
+ part_code: {"type":"string","required":true}
11
+ sku_code: {"type":"string","required":true}
12
+ description: {"type":"string","required":true}
13
+ uom_code: {"type":"string","required":true}
14
+ uom_size: {"type":"integer","required":true}
15
+ position: {"type":"integer","required":true}
16
+ qty: {"type":"integer","required":true,"default":"0"}
17
+ qty_received: {"type":"integer","required":true,"default":"0"}
18
+ qty_canceled: {"type":"integer","required":true,"default":"0"}
19
+ price: {"type":"bigdec","required":true}
20
+ is_revised: {"type":"boolean","required":true,"default":"false"}
21
+
22
+ associations:
23
+ purchase_order: { model: "PurchaseOrder" }
24
+ sku_loc: { model: "SkuLoc" }
25
+ sku_vendor: { model: "SkuVendor" }
26
+ sku: { model: "Sku" }
27
+ receipts: { collection: "PorLine" }
@@ -0,0 +1,20 @@
1
+ class Skr.Models.PoReceipt extends Skr.Models.Base
2
+
3
+ FILE: FILE
4
+
5
+ props:
6
+ id: {"type":"integer","required":true}
7
+ visible_id: {"type":"integer","required":true}
8
+ location_id: {"type":"integer","required":true}
9
+ freight: {"type":"bigdec","required":true,"default":"0.0"}
10
+ purchase_order_id:{"type":"integer","required":true}
11
+ vendor_id: {"type":"integer","required":true}
12
+ voucher_id: "integer"
13
+ refno: "string"
14
+
15
+ associations:
16
+ purchase_order: { model: "PurchaseOrder" }
17
+ vendor: { model: "Vendor" }
18
+ location: { model: "Location" }
19
+ gl_transaction: { model: "GlTransaction" }
20
+ lines: { collection: "PorLine" }
@@ -0,0 +1,26 @@
1
+ class Skr.Models.PorLine extends Skr.Models.Base
2
+
3
+ FILE: FILE
4
+
5
+ props:
6
+ id: {"type":"integer","required":true}
7
+ po_receipt_id:{"type":"integer","required":true}
8
+ po_line_id: "integer"
9
+ sku_loc_id: {"type":"integer","required":true}
10
+ sku_vendor_id:"integer"
11
+ sku_code: {"type":"string","required":true}
12
+ part_code: {"type":"string","required":true}
13
+ description: {"type":"string","required":true}
14
+ uom_code: {"type":"string","required":true}
15
+ uom_size: {"type":"integer","required":true}
16
+ position: {"type":"integer","required":true}
17
+ qty: {"type":"integer","required":true,"default":"0"}
18
+ price: {"type":"bigdec","required":true}
19
+
20
+ associations:
21
+ po_receipt: { model: "PoReceipt" }
22
+ sku_loc: { model: "SkuLoc" }
23
+ po_line: { model: "PoLine" }
24
+ sku_vendor: { model: "SkuVendor" }
25
+ sku: { model: "Sku" }
26
+ sku_trans: { collection: "SkuTran" }
@@ -0,0 +1,27 @@
1
+ class Skr.Models.PtLine extends Skr.Models.Base
2
+
3
+ FILE: FILE
4
+
5
+ props:
6
+ id: {"type":"integer","required":true}
7
+ pick_ticket_id:{"type":"integer","required":true}
8
+ so_line_id: {"type":"integer","required":true}
9
+ sku_loc_id: {"type":"integer","required":true}
10
+ price: {"type":"bigdec","required":true}
11
+ sku_code: {"type":"string","required":true}
12
+ description: {"type":"string","required":true}
13
+ uom_code: {"type":"string","required":true}
14
+ bin: "string"
15
+ uom_size: {"type":"integer","required":true}
16
+ position: {"type":"integer","required":true}
17
+ qty: {"type":"integer","required":true,"default":"0"}
18
+ qty_invoiced: {"type":"integer","required":true,"default":"0"}
19
+ is_complete: {"type":"boolean","required":true,"default":"false"}
20
+
21
+ associations:
22
+ pick_ticket: { model: "PickTicket" }
23
+ sku_loc: { model: "SkuLoc" }
24
+ so_line: { model: "SoLine" }
25
+ inv_line: { model: "InvLine" }
26
+ sales_order: { model: "SalesOrder" }
27
+ sku: { model: "Sku" }
@@ -0,0 +1,23 @@
1
+ class Skr.Models.PurchaseOrder extends Skr.Models.Base
2
+
3
+ FILE: FILE
4
+
5
+ props:
6
+ id: {"type":"integer","required":true}
7
+ visible_id: {"type":"integer","required":true}
8
+ vendor_id: {"type":"integer","required":true}
9
+ location_id: {"type":"integer","required":true}
10
+ ship_addr_id: {"type":"integer","required":true}
11
+ terms_id: {"type":"integer","required":true}
12
+ state: {"type":"string","required":true}
13
+ is_revised: {"type":"boolean","required":true,"default":"false"}
14
+ order_date: {"type":"any","required":true}
15
+ receiving_completed_at:"date"
16
+
17
+ associations:
18
+ terms: { model: "PaymentTerm" }
19
+ vendor: { model: "Vendor" }
20
+ location: { model: "Location" }
21
+ ship_addr: { model: "Address" }
22
+ lines: { collection: "PoLine" }
23
+ receipts: { collection: "PoReceipt" }
@@ -0,0 +1,32 @@
1
+ class Skr.Models.SalesOrder extends Skr.Models.Base
2
+
3
+ FILE: FILE
4
+
5
+ props:
6
+ id: {"type":"integer","required":true}
7
+ visible_id: {"type":"integer","required":true}
8
+ customer_id: {"type":"integer","required":true}
9
+ location_id: {"type":"integer","required":true}
10
+ shipping_address_id:{"type":"integer","required":true}
11
+ billing_address_id: {"type":"integer","required":true}
12
+ terms_id: {"type":"integer","required":true}
13
+ order_date: {"type":"any","required":true}
14
+ state: {"type":"string","required":true}
15
+ is_revised: {"type":"boolean","required":true,"default":"false"}
16
+ hash_code: {"type":"string","required":true}
17
+ ship_partial: {"type":"boolean","required":true,"default":"false"}
18
+ is_complete: {"type":"boolean","required":true,"default":"false"}
19
+ po_num: "string"
20
+ notes: "string"
21
+ options: "any"
22
+
23
+ associations:
24
+ customer: { model: "Customer" }
25
+ location: { model: "Location" }
26
+ terms: { model: "PaymentTerm" }
27
+ billing_address: { model: "Address" }
28
+ shipping_address: { model: "Address" }
29
+ lines: { collection: "SoLine" }
30
+ skus: { collection: "Sku" }
31
+ pick_tickets: { collection: "PickTicket" }
32
+ invoices: { collection: "Invoice" }
@@ -0,0 +1,21 @@
1
+ class Skr.Models.Sku extends Skr.Models.Base
2
+
3
+ FILE: FILE
4
+
5
+ props:
6
+ id: {"type":"integer","required":true}
7
+ default_vendor_id: {"type":"integer","required":true}
8
+ gl_asset_account_id: {"type":"integer","required":true}
9
+ default_uom_code: {"type":"string","required":true}
10
+ code: {"type":"string","required":true}
11
+ description: {"type":"string","required":true}
12
+ is_other_charge: {"type":"boolean","required":true,"default":"false"}
13
+ does_track_inventory:{"type":"boolean","required":true,"default":"false"}
14
+ can_backorder: {"type":"boolean","required":true,"default":"false"}
15
+
16
+ associations:
17
+ default_vendor: { model: "Vendor" }
18
+ gl_asset_account: { model: "GlAccount" }
19
+ sku_locs: { collection: "SkuLoc" }
20
+ sku_vendors: { collection: "SkuVendor" }
21
+ uoms: { collection: "Uom" }
@@ -0,0 +1,21 @@
1
+ class Skr.Models.SkuLoc extends Skr.Models.Base
2
+
3
+ FILE: FILE
4
+
5
+ props:
6
+ id: {"type":"integer","required":true}
7
+ sku_id: {"type":"integer","required":true}
8
+ location_id: {"type":"integer","required":true}
9
+ mac: {"type":"bigdec","required":true,"default":"0.0"}
10
+ qty: {"type":"integer","required":true,"default":"0"}
11
+ qty_allocated:{"type":"integer","required":true,"default":"0"}
12
+ qty_picking: {"type":"integer","required":true,"default":"0"}
13
+ qty_reserved: {"type":"integer","required":true,"default":"0"}
14
+ bin: "string"
15
+
16
+ associations:
17
+ sku: { model: "Sku" }
18
+ location: { model: "Location" }
19
+ so_lines: { collection: "SoLine" }
20
+ pt_lines: { collection: "PtLine" }
21
+ sku_vendors: { collection: "SkuVendor" }
@@ -0,0 +1,23 @@
1
+ class Skr.Models.SkuTran extends Skr.Models.Base
2
+
3
+ FILE: FILE
4
+
5
+ props:
6
+ id: {"type":"integer","required":true}
7
+ origin_id: "integer"
8
+ origin_type: "string"
9
+ sku_loc_id: {"type":"integer","required":true}
10
+ cost: {"type":"bigdec","required":true}
11
+ origin_description:{"type":"string","required":true}
12
+ prior_qty: {"type":"integer","required":true}
13
+ mac: {"type":"bigdec","required":true}
14
+ prior_mac: {"type":"bigdec","required":true}
15
+ qty: {"type":"integer","required":true,"default":"0"}
16
+ uom_code: {"type":"string","required":true,"default":"EA"}
17
+ uom_size: {"type":"integer","required":true,"default":"1"}
18
+
19
+ associations:
20
+ sku_loc: { model: "SkuLoc" }
21
+ location: { model: "Location" }
22
+ origin: { model: "Origin" }
23
+ gl_transaction: { model: "GlTransaction" }
@@ -0,0 +1,19 @@
1
+ class Skr.Models.SkuVendor extends Skr.Models.Base
2
+
3
+ FILE: FILE
4
+
5
+ props:
6
+ id: {"type":"integer","required":true}
7
+ sku_id: {"type":"integer","required":true}
8
+ vendor_id: {"type":"integer","required":true}
9
+ list_price:{"type":"bigdec","required":true}
10
+ part_code: {"type":"string","required":true}
11
+ is_active: {"type":"boolean","required":true,"default":"true"}
12
+ uom_size: {"type":"integer","required":true,"default":"1"}
13
+ uom_code: {"type":"string","required":true,"default":"EA"}
14
+ cost: {"type":"bigdec","required":true}
15
+
16
+ associations:
17
+ sku: { model: "Sku" }
18
+ vendor: { model: "Vendor" }
19
+ sku_locs: { collection: "SkuLoc" }
@@ -0,0 +1,27 @@
1
+ class Skr.Models.SoLine extends Skr.Models.Base
2
+
3
+ FILE: FILE
4
+
5
+ props:
6
+ id: {"type":"integer","required":true}
7
+ sales_order_id:{"type":"integer","required":true}
8
+ sku_loc_id: {"type":"integer","required":true}
9
+ price: {"type":"bigdec","required":true}
10
+ sku_code: {"type":"string","required":true}
11
+ description: {"type":"string","required":true}
12
+ uom_code: {"type":"string","required":true}
13
+ uom_size: {"type":"integer","required":true}
14
+ position: {"type":"integer","required":true}
15
+ qty: {"type":"integer","required":true,"default":"0"}
16
+ qty_allocated: {"type":"integer","required":true,"default":"0"}
17
+ qty_picking: {"type":"integer","required":true,"default":"0"}
18
+ qty_invoiced: {"type":"integer","required":true,"default":"0"}
19
+ qty_canceled: {"type":"integer","required":true,"default":"0"}
20
+ is_revised: {"type":"boolean","required":true,"default":"false"}
21
+
22
+ associations:
23
+ sales_order: { model: "SalesOrder" }
24
+ sku_loc: { model: "SkuLoc" }
25
+ sku: { model: "Sku" }
26
+ location: { model: "Location" }
27
+ pt_lines: { collection: "PtLine" }
@@ -0,0 +1,17 @@
1
+ class Skr.Models.Uom extends Skr.Models.Base
2
+
3
+ FILE: FILE
4
+
5
+ props:
6
+ id: {"type":"integer","required":true}
7
+ sku_id:{"type":"integer","required":true}
8
+ price: {"type":"bigdec","required":true}
9
+ size: {"type":"integer","required":true,"default":"1"}
10
+ code: {"type":"string","required":true,"default":"EA"}
11
+ weight:"bigdec"
12
+ height:"bigdec"
13
+ width: "bigdec"
14
+ depth: "bigdec"
15
+
16
+ associations:
17
+ sku: { model: "Sku" }
@@ -0,0 +1,28 @@
1
+ class Skr.Models.Vendor extends Skr.Models.Base
2
+
3
+ FILE: FILE
4
+
5
+ props:
6
+ id: {"type":"integer","required":true}
7
+ billing_address_id: {"type":"integer","required":true}
8
+ shipping_address_id: {"type":"integer","required":true}
9
+ terms_id: {"type":"integer","required":true}
10
+ gl_payables_account_id:{"type":"integer","required":true}
11
+ gl_freight_account_id: {"type":"integer","required":true}
12
+ code: {"type":"string","required":true}
13
+ hash_code: {"type":"string","required":true}
14
+ name: {"type":"string","required":true}
15
+ notes: "string"
16
+ account_code: "string"
17
+ website: "string"
18
+
19
+ associations:
20
+ billing_address: { model: "Address" }
21
+ shipping_address: { model: "Address" }
22
+ terms: { model: "PaymentTerm" }
23
+ gl_payables_account: { model: "GlAccount" }
24
+ gl_freight_account: { model: "GlAccount" }
25
+ purchase_orders: { collection: "PurchaseOrder" }
26
+ vouchers: { collection: "Voucher" }
27
+ vendor_skus: { collection: "SkuVendor" }
28
+ sku_vendors: { collection: "SkuVendor" }
@@ -0,0 +1,23 @@
1
+ class Skr.Models.VoLine extends Skr.Models.Base
2
+
3
+ FILE: FILE
4
+
5
+ props:
6
+ id: {"type":"integer","required":true}
7
+ voucher_id: {"type":"integer","required":true}
8
+ sku_vendor_id:{"type":"integer","required":true}
9
+ po_line_id: "integer"
10
+ sku_code: {"type":"string","required":true}
11
+ part_code: {"type":"string","required":true}
12
+ description: {"type":"string","required":true}
13
+ uom_code: {"type":"string","required":true}
14
+ uom_size: {"type":"integer","required":true}
15
+ position: {"type":"integer","required":true}
16
+ qty: {"type":"integer","required":true,"default":"0"}
17
+ price: {"type":"bigdec","required":true}
18
+
19
+ associations:
20
+ voucher: { model: "Voucher" }
21
+ sku_vendor: { model: "SkuVendor" }
22
+ po_line: { model: "PoLine" }
23
+ sku: { model: "Sku" }
@@ -0,0 +1,22 @@
1
+ class Skr.Models.Voucher extends Skr.Models.Base
2
+
3
+ FILE: FILE
4
+
5
+ props:
6
+ id: {"type":"integer","required":true}
7
+ visible_id: {"type":"integer","required":true}
8
+ vendor_id: {"type":"integer","required":true}
9
+ purchase_order_id:"integer"
10
+ terms_id: {"type":"integer","required":true}
11
+ state: {"type":"string","required":true}
12
+ refno: "string"
13
+ confirmation_date:"any"
14
+
15
+ associations:
16
+ vendor: { model: "Vendor" }
17
+ customer: { model: "Customer" }
18
+ purchase_order: { model: "PurchaseOrder" }
19
+ terms: { model: "PaymentTerm" }
20
+ location: { model: "Location" }
21
+ gl_transactions: { collection: "GlTransaction" }
22
+ lines: { collection: "VoLine" }
@@ -0,0 +1,5 @@
1
+ Skr.Models.Mixins.CodeField = {
2
+
3
+ invalidChars: /[^A-Z0-9a-z]/
4
+
5
+ }
File without changes
@@ -0,0 +1,3 @@
1
+ class Skr.Screens.Base extends Lanes.Screens.Base
2
+
3
+ abstractClass: true
@@ -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,9 @@
1
+ /*
2
+ If your screen does not use any custom styles
3
+
4
+ You should remove this file and it's reference from:
5
+ lib/skr/base_screen.rb
6
+
7
+ Otherwise Lanes will continue to fetch an empty file whenever
8
+ the screen is displayed
9
+ */
@@ -0,0 +1,3 @@
1
+ <div>
2
+ <h1>Skr</h1>
3
+ </div>
@@ -0,0 +1,49 @@
1
+ class Skr.Screens.CustomerMaint extends Skr.Screens.Base
2
+
3
+ FILE: FILE
4
+
5
+ constructor: ->
6
+ super
7
+ this.reset()
8
+
9
+ useFormBindings: true
10
+
11
+ domEvents:
12
+ 'click .btn.save': 'save'
13
+ 'click .btn.reset': 'reset'
14
+ 'display-record': 'onRecordTrigger'
15
+
16
+ subviews:
17
+ finder:
18
+ component: 'RecordFinder'
19
+ options: 'finderOptions'
20
+ model: 'model'
21
+ terms:
22
+ component: 'SelectField'
23
+ model: 'model'
24
+ options: { association: 'terms', mappings: { title: 'code' } }
25
+ billaddr:
26
+ component: 'Address'
27
+ model: 'model.billing_address'
28
+ options: { field_name: 'billing_address_id' }
29
+ shipaddr:
30
+ component: 'Address'
31
+ model: 'model.shipping_address'
32
+ options: ->{ copyFrom: this.billaddr, field_name: 'shipping_address_id' }
33
+
34
+ finderOptions: ->
35
+ modelClass: Skr.Models.Customer
36
+ title: 'Find Customer',
37
+ invalid_chars: Skr.Models.Mixins.CodeField.invalidChars
38
+ withAssociations: ['billing_address', 'shipping_address', 'terms']
39
+ fields: [ 'code', 'name', 'notes', 'credit_limit' ]
40
+
41
+ reset: ->
42
+ this.model = new Skr.Models.Customer
43
+
44
+ save: ->
45
+ Lanes.Views.SaveNotify(this, include:['billing_address','shipping_address','terms'])
46
+
47
+ onRecordTrigger: (ev, model)->
48
+ this.model = model
49
+ window.c = model
@@ -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,9 @@
1
+ /*
2
+ If your screen does not use any custom styles
3
+
4
+ You should remove this file and it's reference from:
5
+ lib/skr/customer-maint_screen.rb
6
+
7
+ Otherwise Lanes will continue to fetch an empty file whenever
8
+ the screen is displayed
9
+ */
@@ -0,0 +1,32 @@
1
+ <div class="customer">
2
+ <%= h.toolbar buttons: ['save','reset'] %>
3
+
4
+ <div class="header">
5
+ <div class="row">
6
+ <%= h.subview 'finder', widths: [12,4,4,3], label: 'Code' %>
7
+ <%= h.text_field 'name', widths: [12,8,8,9] %>
8
+ </div>
9
+
10
+ <div class="row">
11
+ <%= h.text_field 'notes', widths: [12,9] %>
12
+ <%= h.subview 'terms', widths: [12,3] %>
13
+ </div>
14
+ </div>
15
+
16
+ <div class="row">
17
+ <div class="<%= h.grid_widths 12,6 %>">
18
+ <fieldset class="addresses bordered">
19
+ <legend>Billing Address</legend>
20
+ <%= h.subview 'billaddr', unwrapped: true %>
21
+
22
+ </fieldset>
23
+ </div>
24
+ <div class="<%= h.grid_widths 12,6 %>">
25
+ <fieldset class="addresses bordered">
26
+ <legend>Shiping Address</legend>
27
+ <%= h.subview 'shipaddr', unwrapped: true %>
28
+ </fieldset>
29
+ </div>
30
+ </div>
31
+
32
+ </div>
@@ -0,0 +1 @@
1
+ /* Enter styles for your application in scss format here */
File without changes
@@ -0,0 +1,5 @@
1
+ class Skr.Views.Base extends Lanes.Views.Base
2
+
3
+ abstractClass: true
4
+
5
+ constructor: -> super
@@ -0,0 +1,9 @@
1
+ development:
2
+ adapter: postgresql
3
+ database: skr_dev
4
+ host: /tmp
5
+
6
+ test:
7
+ adapter: postgresql
8
+ database: skr_test
9
+ host: /tmp
data/config/lanes.rb ADDED
@@ -0,0 +1,7 @@
1
+ # This file will be loaded if the current extension is the
2
+ # one controlling Lanes.
3
+ #
4
+ # It will not be evaluated if another extension is loading this one
5
+ Lanes.configure do | config |
6
+
7
+ end
data/config/routes.rb ADDED
@@ -0,0 +1,39 @@
1
+ Lanes::API.routes.draw do
2
+ resources Skr::Customer
3
+ resources Skr::Address
4
+ resources Skr::GlAccount
5
+ resources Skr::GlManualEntry
6
+ resources Skr::GlPeriod
7
+ resources Skr::GlPosting
8
+ resources Skr::GlTransaction
9
+ resources Skr::IaLine
10
+ resources Skr::IaReason
11
+ resources Skr::InvLine
12
+ resources Skr::InventoryAdjustment
13
+ resources Skr::Invoice
14
+ resources Skr::Location
15
+ resources Skr::PaymentTerm
16
+ resources Skr::Sku
17
+ resources Skr::SkuLoc
18
+ resources Skr::SkuTran
19
+ resources Skr::Uom
20
+ resources Skr::Vendor
21
+
22
+
23
+ resources Skr::PickTicket
24
+ resources Skr::PtLine
25
+
26
+ resources Skr::PoReceipt
27
+ resources Skr::PorLine
28
+
29
+ resources Skr::PurchaseOrder
30
+ resources Skr::PoLine
31
+
32
+ resources Skr::Voucher
33
+ resources Skr::VoLine
34
+
35
+ resources Skr::SalesOrder
36
+ resources Skr::SoLine
37
+
38
+
39
+ end
data/config/screens.rb ADDED
@@ -0,0 +1,17 @@
1
+ Lanes::Screen.define_group 'customer' do | group |
2
+ group.title = "Customers"
3
+ group.description = "Maintain records related to Customers"
4
+ group.icon = "icon-users"
5
+ end
6
+
7
+
8
+ Lanes::Screen.define "customer-maint" do | screen |
9
+ screen.title = "Customer Maintenance"
10
+ screen.icon = "icon-wrench2"
11
+ screen.group_id = "customer"
12
+ screen.model_class = "Customer"
13
+ screen.view_class = "Skr.Screens.CustomerMaint"
14
+ screen.js = 'skr/screens/customer-maint.js'
15
+ screen.css = 'skr/screens/customer-maint.css'
16
+ end
17
+
data/config.ru ADDED
@@ -0,0 +1,5 @@
1
+ require 'bundler'
2
+ Bundler.require
3
+ require_relative 'lib/skr'
4
+ require 'lanes/api'
5
+ run Lanes::API::Root
data/db/.gitkeep ADDED
File without changes