vyapari 0.1.5dev10 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (181) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/vyapari/admin/base_controller.rb +0 -9
  3. data/app/controllers/vyapari/admin/countries_controller.rb +2 -2
  4. data/app/controllers/vyapari/admin/dashboard_controller.rb +1 -3
  5. data/app/controllers/vyapari/admin/exchange_rates_controller.rb +2 -2
  6. data/app/controllers/vyapari/admin/regions_controller.rb +1 -1
  7. data/app/controllers/vyapari/admin/resource_controller.rb +0 -1
  8. data/app/controllers/vyapari/admin/users_controller.rb +130 -0
  9. data/app/controllers/vyapari/application_controller.rb +0 -11
  10. data/app/models/brand.rb +19 -67
  11. data/app/models/category.rb +19 -63
  12. data/app/models/country.rb +7 -31
  13. data/app/models/exchange_rate.rb +7 -32
  14. data/app/models/product.rb +20 -75
  15. data/app/models/region.rb +20 -37
  16. data/app/models/vyapari/application_record.rb +0 -3
  17. data/app/views/layouts/kuppayam/_footer.html.erb +1 -1
  18. data/app/views/layouts/kuppayam/_sidebar.html.erb +44 -45
  19. data/app/views/vyapari/admin/countries/_index.html.erb +1 -1
  20. data/app/views/vyapari/admin/countries/index.html.erb +3 -19
  21. data/app/views/vyapari/admin/exchange_rates/_form.html.erb +4 -3
  22. data/app/views/vyapari/admin/exchange_rates/_index.html.erb +7 -7
  23. data/app/views/vyapari/admin/exchange_rates/_row.html.erb +3 -3
  24. data/app/views/vyapari/admin/exchange_rates/_show.html.erb +0 -1
  25. data/app/views/vyapari/admin/exchange_rates/index.html.erb +3 -19
  26. data/app/views/vyapari/admin/regions/_index.html.erb +1 -1
  27. data/app/views/vyapari/admin/regions/index.html.erb +3 -19
  28. data/app/views/vyapari/admin/users/_form.html.erb +39 -0
  29. data/app/views/vyapari/admin/users/_index.html.erb +101 -0
  30. data/app/views/vyapari/admin/users/_row.html.erb +72 -0
  31. data/app/views/vyapari/admin/users/_show.html.erb +199 -0
  32. data/app/views/vyapari/admin/{categories → users}/index.html.erb +24 -8
  33. data/config/routes.rb +5 -66
  34. data/db/migrate/20170000000200_create_exchange_rates.rb +2 -3
  35. data/lib/tasks/vyapari_tasks.rake +4 -0
  36. data/lib/vyapari/version.rb +1 -1
  37. metadata +15 -167
  38. data/app/assets/images/vyapari/sample_stock_bundle.csv +0 -1
  39. data/app/controllers/vyapari/admin/brands_controller.rb +0 -99
  40. data/app/controllers/vyapari/admin/categories_controller.rb +0 -115
  41. data/app/controllers/vyapari/admin/products_controller.rb +0 -79
  42. data/app/controllers/vyapari/admin/stores_controller.rb +0 -67
  43. data/app/controllers/vyapari/admin/suppliers_controller.rb +0 -67
  44. data/app/controllers/vyapari/admin/terminals_controller.rb +0 -150
  45. data/app/controllers/vyapari/store_manager/base_controller.rb +0 -33
  46. data/app/controllers/vyapari/store_manager/dashboard_controller.rb +0 -31
  47. data/app/controllers/vyapari/store_manager/reports/invoices_controller.rb +0 -249
  48. data/app/controllers/vyapari/store_manager/reports/sales_controller.rb +0 -299
  49. data/app/controllers/vyapari/store_manager/reports/stock_controller.rb +0 -132
  50. data/app/controllers/vyapari/store_manager/resource_controller.rb +0 -17
  51. data/app/controllers/vyapari/store_manager/stock_bundles_controller.rb +0 -206
  52. data/app/controllers/vyapari/store_manager/stock_entries_controller.rb +0 -161
  53. data/app/controllers/vyapari/terminal_staff/base_controller.rb +0 -38
  54. data/app/controllers/vyapari/terminal_staff/dashboard_controller.rb +0 -35
  55. data/app/controllers/vyapari/terminal_staff/invoices_controller.rb +0 -147
  56. data/app/controllers/vyapari/terminal_staff/line_items_controller.rb +0 -139
  57. data/app/controllers/vyapari/terminal_staff/resource_controller.rb +0 -17
  58. data/app/controllers/vyapari/user_dashboard_controller.rb +0 -31
  59. data/app/models/bank_account.rb +0 -44
  60. data/app/models/contact.rb +0 -72
  61. data/app/models/image/brand_image.rb +0 -3
  62. data/app/models/image/category_image.rb +0 -3
  63. data/app/models/image/product_image.rb +0 -3
  64. data/app/models/invoice.rb +0 -256
  65. data/app/models/line_item.rb +0 -207
  66. data/app/models/stock_bundle.rb +0 -249
  67. data/app/models/stock_entry.rb +0 -275
  68. data/app/models/store.rb +0 -302
  69. data/app/models/supplier.rb +0 -79
  70. data/app/models/terminal.rb +0 -158
  71. data/app/uploaders/brand_image_uploader.rb +0 -14
  72. data/app/uploaders/category_image_uploader.rb +0 -14
  73. data/app/uploaders/product_image_uploader.rb +0 -14
  74. data/app/uploaders/stock_bundle_uploader.rb +0 -10
  75. data/app/views/layouts/vyapari/_store_manager_menu.html.erb +0 -126
  76. data/app/views/layouts/vyapari/_terminal_staff_menu.html.erb +0 -106
  77. data/app/views/layouts/vyapari/store_manager.html.erb +0 -112
  78. data/app/views/layouts/vyapari/terminal_staff.html.erb +0 -116
  79. data/app/views/vyapari/admin/brands/_form.html.erb +0 -23
  80. data/app/views/vyapari/admin/brands/_index.html.erb +0 -89
  81. data/app/views/vyapari/admin/brands/_row.html.erb +0 -63
  82. data/app/views/vyapari/admin/brands/_show.html.erb +0 -104
  83. data/app/views/vyapari/admin/brands/index.html.erb +0 -48
  84. data/app/views/vyapari/admin/categories/_form.html.erb +0 -28
  85. data/app/views/vyapari/admin/categories/_index.html.erb +0 -101
  86. data/app/views/vyapari/admin/categories/_row.html.erb +0 -69
  87. data/app/views/vyapari/admin/categories/_show.html.erb +0 -115
  88. data/app/views/vyapari/admin/products/_form.html.erb +0 -32
  89. data/app/views/vyapari/admin/products/_index.html.erb +0 -58
  90. data/app/views/vyapari/admin/products/_row.html.erb +0 -30
  91. data/app/views/vyapari/admin/products/_show.html.erb +0 -81
  92. data/app/views/vyapari/admin/products/index.html.erb +0 -48
  93. data/app/views/vyapari/admin/stores/_form.html.erb +0 -37
  94. data/app/views/vyapari/admin/stores/_index.html.erb +0 -84
  95. data/app/views/vyapari/admin/stores/_row.html.erb +0 -55
  96. data/app/views/vyapari/admin/stores/_show.html.erb +0 -110
  97. data/app/views/vyapari/admin/stores/index.html.erb +0 -48
  98. data/app/views/vyapari/admin/suppliers/_form.html.erb +0 -32
  99. data/app/views/vyapari/admin/suppliers/_index.html.erb +0 -58
  100. data/app/views/vyapari/admin/suppliers/_row.html.erb +0 -30
  101. data/app/views/vyapari/admin/suppliers/_show.html.erb +0 -81
  102. data/app/views/vyapari/admin/suppliers/index.html.erb +0 -48
  103. data/app/views/vyapari/admin/terminals/_form.html.erb +0 -24
  104. data/app/views/vyapari/admin/terminals/_index.html.erb +0 -75
  105. data/app/views/vyapari/admin/terminals/_row.html.erb +0 -49
  106. data/app/views/vyapari/admin/terminals/_show.html.erb +0 -74
  107. data/app/views/vyapari/store_manager/dashboard/_sales_counts.html.erb +0 -90
  108. data/app/views/vyapari/store_manager/dashboard/_stock_counts.html.erb +0 -63
  109. data/app/views/vyapari/store_manager/dashboard/_terminals.html.erb +0 -23
  110. data/app/views/vyapari/store_manager/dashboard/index.html.erb +0 -64
  111. data/app/views/vyapari/store_manager/reports/invoices/_index.html.erb +0 -65
  112. data/app/views/vyapari/store_manager/reports/invoices/index.html.erb +0 -105
  113. data/app/views/vyapari/store_manager/reports/sales/_index.html.erb +0 -64
  114. data/app/views/vyapari/store_manager/reports/sales/index.html.erb +0 -105
  115. data/app/views/vyapari/store_manager/reports/stock/_index.html.erb +0 -72
  116. data/app/views/vyapari/store_manager/reports/stock/index.html.erb +0 -32
  117. data/app/views/vyapari/store_manager/stock_bundles/_form.html.erb +0 -99
  118. data/app/views/vyapari/store_manager/stock_bundles/_index.html.erb +0 -74
  119. data/app/views/vyapari/store_manager/stock_bundles/_row.html.erb +0 -44
  120. data/app/views/vyapari/store_manager/stock_bundles/_show.html.erb +0 -110
  121. data/app/views/vyapari/store_manager/stock_bundles/create.html.erb +0 -57
  122. data/app/views/vyapari/store_manager/stock_bundles/index.html.erb +0 -36
  123. data/app/views/vyapari/store_manager/stock_bundles/update.html.erb +0 -57
  124. data/app/views/vyapari/store_manager/stock_entries/_form.html.erb +0 -50
  125. data/app/views/vyapari/store_manager/stock_entries/_index.html.erb +0 -80
  126. data/app/views/vyapari/store_manager/stock_entries/_row.html.erb +0 -33
  127. data/app/views/vyapari/store_manager/stock_entries/_show.html.erb +0 -110
  128. data/app/views/vyapari/store_manager/stock_entries/_stock_bundle.html.erb +0 -61
  129. data/app/views/vyapari/store_manager/stock_entries/index.html.erb +0 -45
  130. data/app/views/vyapari/terminal_staff/dashboard/_counts.html.erb +0 -131
  131. data/app/views/vyapari/terminal_staff/dashboard/_invoices.html.erb +0 -44
  132. data/app/views/vyapari/terminal_staff/dashboard/_search_form.html.erb +0 -6
  133. data/app/views/vyapari/terminal_staff/dashboard/_search_results.html.erb +0 -24
  134. data/app/views/vyapari/terminal_staff/dashboard/index.html.erb +0 -56
  135. data/app/views/vyapari/terminal_staff/dashboard/search.js.erb +0 -12
  136. data/app/views/vyapari/terminal_staff/invoices/_draft.html.erb +0 -62
  137. data/app/views/vyapari/terminal_staff/invoices/_form.html.erb +0 -134
  138. data/app/views/vyapari/terminal_staff/invoices/_index.html.erb +0 -70
  139. data/app/views/vyapari/terminal_staff/invoices/_row.html.erb +0 -33
  140. data/app/views/vyapari/terminal_staff/invoices/_show.html.erb +0 -204
  141. data/app/views/vyapari/terminal_staff/invoices/index.html.erb +0 -35
  142. data/app/views/vyapari/terminal_staff/invoices/new.js.erb +0 -18
  143. data/app/views/vyapari/terminal_staff/invoices/show.html.erb +0 -1
  144. data/app/views/vyapari/terminal_staff/invoices/show.js.erb +0 -13
  145. data/app/views/vyapari/terminal_staff/line_items/_form.html.erb +0 -40
  146. data/app/views/vyapari/terminal_staff/line_items/_index.html.erb +0 -96
  147. data/app/views/vyapari/terminal_staff/line_items/create.js.erb +0 -34
  148. data/app/views/vyapari/terminal_staff/line_items/destroy.js.erb +0 -25
  149. data/app/views/vyapari/user_dashboard/index.html.erb +0 -51
  150. data/db/import_data/brands.csv +0 -7
  151. data/db/import_data/categories.csv +0 -12
  152. data/db/import_data/countries.csv +0 -1
  153. data/db/import_data/dummy/brands.csv +0 -7
  154. data/db/import_data/dummy/categories.csv +0 -12
  155. data/db/import_data/dummy/countries.csv +0 -1
  156. data/db/import_data/dummy/exchange_rates.csv +0 -5
  157. data/db/import_data/dummy/products-copy.csv +0 -1
  158. data/db/import_data/dummy/products.csv +0 -1
  159. data/db/import_data/dummy/products.xlsx +0 -0
  160. data/db/import_data/dummy/regions.csv +0 -13
  161. data/db/import_data/dummy/stores.csv +0 -10
  162. data/db/import_data/dummy/suppliers.csv +0 -14
  163. data/db/import_data/dummy/terminals.csv +0 -11
  164. data/db/import_data/exchange_rates.csv +0 -5
  165. data/db/import_data/regions.csv +0 -13
  166. data/db/import_data/stores.csv +0 -3
  167. data/db/import_data/suppliers.csv +0 -14
  168. data/db/import_data/terminals.csv +0 -3
  169. data/db/migrate/20170000000203_create_contacts.rb +0 -22
  170. data/db/migrate/20170000000204_create_bank_accounts.rb +0 -21
  171. data/db/migrate/20170000000205_create_suppliers.rb +0 -18
  172. data/db/migrate/20170000000206_create_stores.rb +0 -21
  173. data/db/migrate/20170000000207_create_terminals.rb +0 -18
  174. data/db/migrate/20170000000210_create_brands.rb +0 -14
  175. data/db/migrate/20170000000211_create_categories.rb +0 -22
  176. data/db/migrate/20170000000212_create_products.rb +0 -29
  177. data/db/migrate/20170000000213_create_invoices.rb +0 -61
  178. data/db/migrate/20170000000215_create_stock_bundles.rb +0 -17
  179. data/db/migrate/20170000000216_create_stock_entries.rb +0 -20
  180. data/db/sample_reports/products.xlsx +0 -0
  181. data/lib/tasks/vyapari/all.rake +0 -73
@@ -1,17 +0,0 @@
1
- class CreateStockBundles < ActiveRecord::Migration
2
- def change
3
- create_table(:stock_bundles) do |t|
4
- t.datetime :uploaded_date
5
- t.references :store, index: true
6
- t.references :supplier, index: true
7
- t.references :uploader, references: :users, index: true
8
- t.string :name
9
- t.string :file
10
- t.string :error_summary
11
- t.string :error_details
12
- t.string :error_file
13
- t.string :status, :null => false, :default=>"pending", :limit=>16
14
- t.timestamps
15
- end
16
- end
17
- end
@@ -1,20 +0,0 @@
1
- class CreateStockEntries < ActiveRecord::Migration[5.0]
2
- def change
3
- create_table :stock_entries do |t|
4
-
5
- t.references :store, index: true
6
- t.references :product, index: true
7
- t.references :supplier, index: true
8
- t.references :stock_bundle, index: true
9
- t.references :invoice, index: true
10
-
11
- t.integer :quantity
12
-
13
- # active, damaged, returned, sold, reserved
14
- t.string :status, :null => false, :default=>"active", :limit=>16
15
-
16
- t.timestamps null: false
17
- end
18
-
19
- end
20
- end
Binary file
@@ -1,73 +0,0 @@
1
- require 'csv'
2
- require 'open-uri'
3
- require 'time'
4
-
5
- namespace 'vyapari' do
6
- namespace 'import' do
7
-
8
- desc "Import all data in sequence"
9
- task 'all' => :environment do
10
-
11
- import_list = ["countries", "regions", "exchange_rates", "suppliers", "stores", "brands", "categories", "terminals"]
12
-
13
- import_list.each do |item|
14
- print "Importing #{item.titleize} \t".yellow
15
- begin
16
- Rake::Task["vyapari:import:#{item}"].invoke
17
- rescue ArgumentError => e
18
- puts "Loading #{item} - Failed - #{e.message}".red
19
- rescue Exception => e
20
- puts "Importing #{item.titleize} - Failed - #{e.message}".red
21
- puts "Backtrace:\n\t#{e.backtrace.join("\n\t")}"
22
- end
23
- end
24
- puts " "
25
- end
26
-
27
- ["Country", "Region", "ExchangeRate", "Supplier", "Store", "Brand", "Category", "Terminal"].each do |cls_name|
28
- name = cls_name.underscore.pluralize
29
- desc "Import #{cls_name.pluralize}"
30
- task name => :environment do
31
- verbose = true
32
- verbose = false if ["false", "f","0","no","n"].include?(ENV["verbose"].to_s.downcase.strip)
33
- path = ENV['path']
34
- cls_name.constantize.import_data(Vyapari::Engine, path, false, verbose)
35
- end
36
- end
37
-
38
- namespace 'dummy' do
39
-
40
- desc "Import all dummy data in sequence"
41
- task 'all' => :environment do
42
-
43
- import_list = ["dummy:countries", "dummy:regions", "dummy:exchange_rates", "dummy:suppliers", "dummy:stores", "dummy:brands", "dummy:categories", "dummy:terminals"]
44
-
45
- import_list.each do |item|
46
- print "Loading #{item.split(':').last.titleize} \t".yellow
47
- begin
48
- Rake::Task["vyapari:import:#{item}"].invoke
49
- rescue ArgumentError => e
50
- puts "Loading #{item} - Failed - #{e.message}".red
51
- rescue Exception => e
52
- puts "Loading #{item} - Failed - #{e.message}".red
53
- puts "Backtrace:\n\t#{e.backtrace.join("\n\t")}"
54
- end
55
- end
56
- puts " "
57
- end
58
-
59
- ["Country", "Region", "ExchangeRate", "Supplier", "Store", "Brand", "Category", "Terminal"].each do |cls_name|
60
- name = cls_name.underscore.pluralize
61
- desc "Load Dummy #{cls_name.pluralize}"
62
- task name => :environment do
63
- verbose = true
64
- verbose = false if ["false", "f","0","no","n"].include?(ENV["verbose"].to_s.downcase.strip)
65
- cls_name.constantize.import_data(Vyapari::Engine, nil, true, verbose)
66
- end
67
- end
68
-
69
- end
70
-
71
- end
72
- end
73
-