vyapari 0.1.4 → 0.1.5dev

Sign up to get free protection for your applications and to get access to all the features.
Files changed (164) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/vyapari/sample_stock_bundle.csv +1 -0
  3. data/app/controllers/vyapari/admin/base_controller.rb +10 -0
  4. data/app/controllers/vyapari/admin/brands_controller.rb +99 -0
  5. data/app/controllers/vyapari/admin/categories_controller.rb +115 -0
  6. data/app/controllers/vyapari/admin/countries_controller.rb +2 -2
  7. data/app/controllers/vyapari/admin/dashboard_controller.rb +3 -1
  8. data/app/controllers/vyapari/admin/exchange_rates_controller.rb +2 -2
  9. data/app/controllers/vyapari/admin/products_controller.rb +79 -0
  10. data/app/controllers/vyapari/admin/regions_controller.rb +1 -1
  11. data/app/controllers/vyapari/admin/resource_controller.rb +1 -0
  12. data/app/controllers/vyapari/admin/stores_controller.rb +67 -0
  13. data/app/controllers/vyapari/admin/suppliers_controller.rb +67 -0
  14. data/app/controllers/vyapari/admin/terminals_controller.rb +150 -0
  15. data/app/controllers/vyapari/application_controller.rb +12 -0
  16. data/app/controllers/vyapari/store_manager/base_controller.rb +28 -0
  17. data/app/controllers/vyapari/store_manager/dashboard_controller.rb +30 -0
  18. data/app/controllers/vyapari/store_manager/resource_controller.rb +17 -0
  19. data/app/controllers/vyapari/store_manager/stock_bundles_controller.rb +206 -0
  20. data/app/controllers/vyapari/store_manager/stock_entries_controller.rb +161 -0
  21. data/app/controllers/vyapari/terminal_staff/base_controller.rb +29 -0
  22. data/app/controllers/vyapari/terminal_staff/dashboard_controller.rb +29 -0
  23. data/app/controllers/vyapari/terminal_staff/invoices_controller.rb +138 -0
  24. data/app/controllers/vyapari/terminal_staff/line_items_controller.rb +123 -0
  25. data/app/controllers/vyapari/terminal_staff/resource_controller.rb +17 -0
  26. data/app/controllers/vyapari/user_dashboard_controller.rb +31 -0
  27. data/app/models/brand.rb +63 -10
  28. data/app/models/category.rb +60 -16
  29. data/app/models/country.rb +27 -5
  30. data/app/models/exchange_rate.rb +31 -6
  31. data/app/models/image/brand_image.rb +3 -0
  32. data/app/models/image/category_image.rb +3 -0
  33. data/app/models/image/product_image.rb +3 -0
  34. data/app/models/invoice.rb +223 -0
  35. data/app/models/line_item.rb +206 -0
  36. data/app/models/product.rb +67 -13
  37. data/app/models/region.rb +26 -3
  38. data/app/models/stock_bundle.rb +249 -0
  39. data/app/models/stock_entry.rb +271 -0
  40. data/app/models/store.rb +216 -0
  41. data/app/models/supplier.rb +85 -0
  42. data/app/models/terminal.rb +158 -0
  43. data/app/models/vyapari/application_record.rb +4 -0
  44. data/app/uploaders/brand_image_uploader.rb +14 -0
  45. data/app/uploaders/category_image_uploader.rb +14 -0
  46. data/app/uploaders/product_image_uploader.rb +14 -0
  47. data/app/uploaders/stock_bundle_uploader.rb +10 -0
  48. data/app/views/layouts/kuppayam/_footer.html.erb +1 -1
  49. data/app/views/layouts/kuppayam/_sidebar.html.erb +45 -44
  50. data/app/views/layouts/vyapari/_store_manager_menu.html.erb +107 -0
  51. data/app/views/layouts/vyapari/_terminal_staff_menu.html.erb +103 -0
  52. data/app/views/layouts/vyapari/store_manager.html.erb +112 -0
  53. data/app/views/layouts/vyapari/terminal_staff.html.erb +116 -0
  54. data/app/views/vyapari/admin/brands/_form.html.erb +23 -0
  55. data/app/views/vyapari/admin/brands/_index.html.erb +89 -0
  56. data/app/views/vyapari/admin/brands/_row.html.erb +63 -0
  57. data/app/views/vyapari/admin/brands/_show.html.erb +104 -0
  58. data/app/views/vyapari/admin/brands/index.html.erb +48 -0
  59. data/app/views/vyapari/admin/categories/_form.html.erb +28 -0
  60. data/app/views/vyapari/admin/categories/_index.html.erb +101 -0
  61. data/app/views/vyapari/admin/categories/_row.html.erb +69 -0
  62. data/app/views/vyapari/admin/categories/_show.html.erb +115 -0
  63. data/app/views/vyapari/admin/{users → categories}/index.html.erb +8 -24
  64. data/app/views/vyapari/admin/countries/_index.html.erb +1 -1
  65. data/app/views/vyapari/admin/countries/index.html.erb +19 -3
  66. data/app/views/vyapari/admin/exchange_rates/_form.html.erb +3 -4
  67. data/app/views/vyapari/admin/exchange_rates/_index.html.erb +7 -7
  68. data/app/views/vyapari/admin/exchange_rates/_row.html.erb +3 -3
  69. data/app/views/vyapari/admin/exchange_rates/_show.html.erb +1 -0
  70. data/app/views/vyapari/admin/exchange_rates/index.html.erb +19 -3
  71. data/app/views/vyapari/admin/products/_form.html.erb +32 -0
  72. data/app/views/vyapari/admin/products/_index.html.erb +58 -0
  73. data/app/views/vyapari/admin/products/_row.html.erb +30 -0
  74. data/app/views/vyapari/admin/products/_show.html.erb +81 -0
  75. data/app/views/vyapari/admin/products/index.html.erb +48 -0
  76. data/app/views/vyapari/admin/regions/_index.html.erb +1 -1
  77. data/app/views/vyapari/admin/regions/index.html.erb +19 -3
  78. data/app/views/vyapari/admin/stores/_form.html.erb +37 -0
  79. data/app/views/vyapari/admin/stores/_index.html.erb +84 -0
  80. data/app/views/vyapari/admin/stores/_row.html.erb +55 -0
  81. data/app/views/vyapari/admin/stores/_show.html.erb +110 -0
  82. data/app/views/vyapari/admin/stores/index.html.erb +48 -0
  83. data/app/views/vyapari/admin/suppliers/_form.html.erb +32 -0
  84. data/app/views/vyapari/admin/suppliers/_index.html.erb +58 -0
  85. data/app/views/vyapari/admin/suppliers/_row.html.erb +30 -0
  86. data/app/views/vyapari/admin/suppliers/_show.html.erb +81 -0
  87. data/app/views/vyapari/admin/suppliers/index.html.erb +48 -0
  88. data/app/views/vyapari/admin/terminals/_form.html.erb +24 -0
  89. data/app/views/vyapari/admin/terminals/_index.html.erb +75 -0
  90. data/app/views/vyapari/admin/terminals/_row.html.erb +49 -0
  91. data/app/views/vyapari/admin/terminals/_show.html.erb +74 -0
  92. data/app/views/vyapari/store_manager/dashboard/index.html.erb +93 -0
  93. data/app/views/vyapari/store_manager/stock_bundles/_form.html.erb +99 -0
  94. data/app/views/vyapari/store_manager/stock_bundles/_index.html.erb +74 -0
  95. data/app/views/vyapari/store_manager/stock_bundles/_row.html.erb +44 -0
  96. data/app/views/vyapari/store_manager/stock_bundles/_show.html.erb +110 -0
  97. data/app/views/vyapari/store_manager/stock_bundles/create.html.erb +57 -0
  98. data/app/views/vyapari/store_manager/stock_bundles/index.html.erb +36 -0
  99. data/app/views/vyapari/store_manager/stock_bundles/update.html.erb +57 -0
  100. data/app/views/vyapari/store_manager/stock_entries/_form.html.erb +50 -0
  101. data/app/views/vyapari/store_manager/stock_entries/_index.html.erb +80 -0
  102. data/app/views/vyapari/store_manager/stock_entries/_row.html.erb +33 -0
  103. data/app/views/vyapari/store_manager/stock_entries/_show.html.erb +110 -0
  104. data/app/views/vyapari/store_manager/stock_entries/_stock_bundle.html.erb +61 -0
  105. data/app/views/vyapari/store_manager/stock_entries/index.html.erb +45 -0
  106. data/app/views/vyapari/terminal_staff/dashboard/_counts.html.erb +88 -0
  107. data/app/views/vyapari/terminal_staff/dashboard/_invoices.html.erb +37 -0
  108. data/app/views/vyapari/terminal_staff/dashboard/index.html.erb +36 -0
  109. data/app/views/vyapari/terminal_staff/invoices/_draft.html.erb +62 -0
  110. data/app/views/vyapari/terminal_staff/invoices/_form.html.erb +120 -0
  111. data/app/views/vyapari/terminal_staff/invoices/_index.html.erb +64 -0
  112. data/app/views/vyapari/terminal_staff/invoices/_row.html.erb +33 -0
  113. data/app/views/vyapari/terminal_staff/invoices/_show.html.erb +171 -0
  114. data/app/views/vyapari/terminal_staff/invoices/index.html.erb +37 -0
  115. data/app/views/vyapari/terminal_staff/invoices/new.js.erb +13 -0
  116. data/app/views/vyapari/terminal_staff/invoices/show.html.erb +1 -0
  117. data/app/views/vyapari/terminal_staff/line_items/_form.html.erb +40 -0
  118. data/app/views/vyapari/terminal_staff/line_items/_index.html.erb +94 -0
  119. data/app/views/vyapari/terminal_staff/line_items/create.js.erb +34 -0
  120. data/app/views/vyapari/terminal_staff/line_items/destroy.js.erb +25 -0
  121. data/app/views/vyapari/terminal_staff/stores/index.html.erb +24 -0
  122. data/app/views/vyapari/user_dashboard/index.html.erb +51 -0
  123. data/config/routes.rb +62 -5
  124. data/db/import_data/brands.csv +7 -0
  125. data/db/import_data/categories.csv +12 -0
  126. data/db/import_data/countries.csv +1 -0
  127. data/db/import_data/dummy/brands.csv +7 -0
  128. data/db/import_data/dummy/categories.csv +12 -0
  129. data/db/import_data/dummy/countries.csv +1 -0
  130. data/db/import_data/dummy/exchange_rates.csv +5 -0
  131. data/db/import_data/dummy/products-copy.csv +1 -0
  132. data/db/import_data/dummy/products.csv +1 -0
  133. data/db/import_data/dummy/products.xlsx +0 -0
  134. data/db/import_data/dummy/regions.csv +13 -0
  135. data/db/import_data/dummy/stores.csv +10 -0
  136. data/db/import_data/dummy/suppliers.csv +14 -0
  137. data/db/import_data/dummy/terminals.csv +11 -0
  138. data/db/import_data/exchange_rates.csv +5 -0
  139. data/db/import_data/regions.csv +13 -0
  140. data/db/import_data/stores.csv +3 -0
  141. data/db/import_data/suppliers.csv +14 -0
  142. data/db/import_data/terminals.csv +3 -0
  143. data/db/migrate/20170000000200_create_exchange_rates.rb +3 -2
  144. data/db/migrate/20170000000203_create_contacts.rb +22 -0
  145. data/db/migrate/20170000000204_create_bank_accounts.rb +21 -0
  146. data/db/migrate/20170000000205_create_suppliers.rb +18 -0
  147. data/db/migrate/20170000000206_create_stores.rb +21 -0
  148. data/db/migrate/20170000000207_create_terminals.rb +18 -0
  149. data/db/migrate/20170000000210_create_brands.rb +14 -0
  150. data/db/migrate/20170000000211_create_categories.rb +22 -0
  151. data/db/migrate/20170000000212_create_products.rb +29 -0
  152. data/db/migrate/20170000000213_create_invoices.rb +58 -0
  153. data/db/migrate/20170000000215_create_stock_bundles.rb +17 -0
  154. data/db/migrate/20170000000216_create_stock_entries.rb +20 -0
  155. data/db/sample_reports/products.xlsx +0 -0
  156. data/lib/tasks/vyapari/all.rake +73 -0
  157. data/lib/vyapari/version.rb +1 -1
  158. metadata +150 -15
  159. data/app/controllers/vyapari/admin/users_controller.rb +0 -130
  160. data/app/views/vyapari/admin/users/_form.html.erb +0 -39
  161. data/app/views/vyapari/admin/users/_index.html.erb +0 -101
  162. data/app/views/vyapari/admin/users/_row.html.erb +0 -72
  163. data/app/views/vyapari/admin/users/_show.html.erb +0 -199
  164. data/lib/tasks/vyapari_tasks.rake +0 -4
@@ -0,0 +1,171 @@
1
+ <div class="panel panel-default">
2
+ <div class="panel-heading hidden-print">Invoice</div>
3
+ <div class="panel-body">
4
+
5
+ <section class="invoice-env">
6
+
7
+ <!-- Invoice header -->
8
+ <div class="invoice-header">
9
+
10
+ <!-- Invoice Options Buttons -->
11
+ <div class="invoice-options hidden-print">
12
+ <a href="#" class="btn btn-block btn-gray btn-icon btn-icon-standalone btn-icon-standalone-right text-left">
13
+ <i class="fa-envelope-o"></i>
14
+ <span>Send</span>
15
+ </a>
16
+
17
+ <a href="#" class="btn btn-block btn-secondary btn-icon btn-icon-standalone btn-icon-standalone-right btn-single text-left">
18
+ <i class="fa-print"></i>
19
+ <span>Print</span>
20
+ </a>
21
+ </div>
22
+
23
+ <!-- Invoice Data Header -->
24
+ <div class="invoice-logo">
25
+
26
+ <a href="#" class="logo">
27
+ <img src="assets/images/logo-white-bg.png" class="img-responsive" />
28
+ </a>
29
+
30
+ <ul class="list-unstyled">
31
+ <li class="upper">Invoice No. <strong>#5652256</strong></li>
32
+ <li>06 December 14</li>
33
+ <li>Prishtin&euml;, Kosovo</li>
34
+ </ul>
35
+
36
+ </div>
37
+
38
+ </div>
39
+
40
+
41
+ <!-- Client and Payment Details -->
42
+ <div class="invoice-details">
43
+
44
+ <div class="invoice-client-info">
45
+ <strong>Client</strong>
46
+
47
+ <ul class="list-unstyled">
48
+ <li>John Doe </li>
49
+ <li>Mr Nilson Otto </li>
50
+ <li>FoodMaster Ltd</li>
51
+ </ul>
52
+
53
+ <ul class="list-unstyled">
54
+ <li>1982 OOP </li>
55
+ <li>Madrid, Spain </li>
56
+ <li>+1 (151) 225-4183</li>
57
+ </ul>
58
+ </div>
59
+
60
+ <div class="invoice-payment-info">
61
+ <strong>Payment Details</strong>
62
+
63
+ <ul class="list-unstyled">
64
+ <li>V.A.T Reg #: <strong>542554(DEMO)78</strong></li>
65
+ <li>Account Name: <strong>FoodMaster Ltd</strong> </li>
66
+ <li>SWIFT code: <strong>45454DEMO545DEMO</strong></li>
67
+ </ul>
68
+ </div>
69
+
70
+ </div>
71
+
72
+
73
+ <!-- Invoice Entries -->
74
+ <table class="table table-bordered">
75
+ <thead>
76
+ <tr class="no-borders">
77
+ <th class="text-center hidden-xs">#</th>
78
+ <th width="60%" class="text-center">Product</th>
79
+ <th class="text-center hidden-xs">Quantity</th>
80
+ <th class="text-center">Price</th>
81
+ </tr>
82
+ </thead>
83
+
84
+ <tbody>
85
+ <tr>
86
+ <td class="text-center hidden-xs">1</td>
87
+ <td>On am we offices expense thought</td>
88
+ <td class="text-center hidden-xs">1</td>
89
+ <td class="text-right text-primary text-bold">$1,290</td>
90
+ </tr>
91
+
92
+ <tr>
93
+ <td class="text-center hidden-xs">2</td>
94
+ <td>Up do view time they shot</td>
95
+ <td class="text-center hidden-xs">1</td>
96
+ <td class="text-right text-primary text-bold">$400</td>
97
+ </tr>
98
+
99
+ <tr>
100
+ <td class="text-center hidden-xs">3</td>
101
+ <td>Way ham unwilling not breakfast</td>
102
+ <td class="text-center hidden-xs">1</td>
103
+ <td class="text-right text-primary text-bold">$550</td>
104
+ </tr>
105
+
106
+ <tr>
107
+ <td class="text-center hidden-xs">4</td>
108
+ <td>Songs to an blush woman be sorry</td>
109
+ <td class="text-center hidden-xs">1</td>
110
+ <td class="text-right text-primary text-bold">$4020</td>
111
+ </tr>
112
+
113
+ <tr>
114
+ <td class="text-center hidden-xs">5</td>
115
+ <td>Luckily offered article led lasting</td>
116
+ <td class="text-center hidden-xs">1</td>
117
+ <td class="text-right text-primary text-bold">$87</td>
118
+ </tr>
119
+
120
+ <tr>
121
+ <td class="text-center hidden-xs">6</td>
122
+ <td>Of as by belonging therefore suspicion</td>
123
+ <td class="text-center hidden-xs">1</td>
124
+ <td class="text-right text-primary text-bold">$140</td>
125
+ </tr>
126
+ </tbody>
127
+ </table>
128
+
129
+ <!-- Invoice Subtotals and Totals -->
130
+ <div class="invoice-totals">
131
+
132
+ <div class="invoice-subtotals-totals">
133
+ <span>
134
+ Sub - Total amount:
135
+ <strong>$6,487</strong>
136
+ </span>
137
+
138
+ <span>
139
+ VAT:
140
+ <strong>12.9%</strong>
141
+ </span>
142
+
143
+ <span>
144
+ Discount:
145
+ <strong>-----</strong>
146
+ </span>
147
+
148
+ <hr />
149
+
150
+ <span>
151
+ Grand Total:
152
+ <strong>$7,304</strong>
153
+ </span>
154
+ </div>
155
+
156
+ <div class="invoice-bill-info">
157
+ <address>
158
+ 795 Park Ave, Suite 120<br />
159
+ San Francisco, CA 94107<br />
160
+ P: (234) 145-1810 <br />
161
+ Full Name <br />
162
+ <a href="#">first.last@email.com</a>
163
+ </address>
164
+ </div>
165
+
166
+ </div>
167
+
168
+ </section>
169
+
170
+ </div>
171
+ </div>
@@ -0,0 +1,37 @@
1
+ <div class="row">
2
+
3
+ <div class="col-md-12">
4
+
5
+ <ul class="nav nav-tabs">
6
+ </ul>
7
+
8
+ <div class="tab-content">
9
+ <div class="tab-pane active">
10
+
11
+ <div id="div_invoice_action_buttons">
12
+ <div class="row">
13
+ <div class="col-md-6">
14
+
15
+ <%= theme_button('Create Invoice', 'plus', terminal_staff_invoices_path(@terminal), remote: false, classes: "pull-left", btn_type: "success") %>
16
+
17
+ <%= theme_button('Refresh', 'refresh', terminal_staff_invoices_path(@terminal), classes: "pull-left ml-10", btn_type: "white") %>
18
+
19
+ </div>
20
+ <div class="col-md-6">
21
+ <%= search_form_kuppayam(Invoice, terminal_staff_invoices_path(@terminal), text: @filters[:query]) %>
22
+ </div>
23
+ </div>
24
+ </div>
25
+ <%= clear_tag(10) %>
26
+
27
+ <div id="div_invoice_index">
28
+ <%= render :partial=>"vyapari/terminal_staff/invoices/index" %>
29
+ </div>
30
+ <%= clear_tag(10) %>
31
+
32
+ </div>
33
+ </div>
34
+
35
+ </div>
36
+
37
+ </div>
@@ -0,0 +1,13 @@
1
+ <% if @invoice %>
2
+
3
+ // Show the details in the large modal
4
+ var heading = "Create Invoice";
5
+ var bodyContent = "<%= escape_javascript(render(:partial=>"#{@resource_options[:view_path]}/draft")) %>";
6
+ showLargeModal(heading, bodyContent, false);
7
+
8
+ <% else %>
9
+
10
+ // Showing Growl Like Message
11
+ notifyError("<%= escape_javascript(@notification[:title]) %>", "<%= escape_javascript(raw(@notification[:message])) %>");
12
+
13
+ <% end %>
@@ -0,0 +1 @@
1
+ <%= render :partial=>"vyapari/terminal_staff/invoices/show" %>
@@ -0,0 +1,40 @@
1
+ <%
2
+
3
+ url = url_for([:terminal_staff, @invoice, line_item, { terminal_id: @invoice.terminal_id}])
4
+
5
+ if line_item.new_record?
6
+ http_method = :post
7
+ else
8
+ http_method = :put
9
+ end
10
+
11
+ %>
12
+
13
+ <%= form_for(line_item, :url => url, :method => http_method, :html => {:id=>"form_line_item", :class=>"mb-0 form-horizontal", :role => "form", :method => (line_item.new_record? ? :post : :put), :remote=>true}) do |f| %>
14
+
15
+ <div class="row ili">
16
+
17
+ <div class="col-md-1 li-form li-sl li-center" style="height:52px;">&nbsp;</div>
18
+
19
+ <div class="col-md-4 li-form li-item-name li-center"><%= f.text_field(:product_id, style: "text-align: left") %></div>
20
+
21
+ <div class="col-md-2 li-form li-quantity li-center"><%= f.text_field(:quantity, style: "text-align: center") %></div>
22
+
23
+ <div class="col-md-2 li-action li-form"><%= submit_tag("Save", :class=>"btn btn-primary btn-xs btn-block", style: "margin:0px;") %></div>
24
+
25
+ <div class="col-md-3"></div>
26
+
27
+ </div>
28
+
29
+ <% end %>
30
+
31
+ <script type="text/javascript">
32
+ $( "#div_line_item_form .li-item-name input").focus();
33
+
34
+ $('#div_line_item_form input').keydown(function (e) {
35
+ if (e.which === 13) {
36
+ var index = $('#div_line_item_form input').index(this) + 1;
37
+ $('#div_line_item_form input').eq(index).focus();
38
+ }
39
+ });
40
+ </script>
@@ -0,0 +1,94 @@
1
+ <style type="text/css">
2
+ .ili .li-heading {
3
+ background-color: #4b4b4b;
4
+ color: #fff;
5
+ border: 1px solid #FFF;
6
+ padding: 10px;
7
+ }
8
+
9
+ .ili .li-display {
10
+ background-color: #f1f1f1;
11
+ color: #4b4b4b;
12
+ border: 1px solid #FFF;
13
+ padding: 10px;
14
+ }
15
+
16
+ .ili .li-form {
17
+ background-color: #f1f1f1;
18
+ color: #4b4b4b;
19
+ border: 1px solid #FFF;
20
+ padding: 10px;
21
+ }
22
+
23
+ .ili .li-form input {
24
+ width:95%;
25
+ height: 30px;
26
+ }
27
+
28
+ .ili .li-center {text-align: center;}
29
+ .ili .li-left {text-align: left;}
30
+ .ili .li-right {text-align: right;}
31
+
32
+ /*.ili .li-sl {width: 10%;}
33
+ .ili .li-item-name {}
34
+ .ili .li-quantity {width: 10%;}
35
+ .ili .li-rate {width: 10%;}
36
+ .ili .li-action {width: 10%;}*/
37
+
38
+ </style>
39
+
40
+ <div class="row ili" id="div_line_item_header">
41
+ <div class="col-md-1 li-heading li-sl li-center">#</div>
42
+ <div class="col-md-4 li-heading li-item-name li-left">Item</div>
43
+ <div class="col-md-2 li-heading li-quantity li-center">Quantity</div>
44
+ <div class="col-md-2 li-rate li-heading li-right">Rate</div>
45
+ <div class="col-md-2 li-rate li-heading li-right">Total</div>
46
+ <div class="col-md-1 li-action li-heading li-center">&nbsp;</div>
47
+ </div>
48
+
49
+ <% @invoice.line_items.each_with_index do |line_item, i| %>
50
+
51
+ <div class="row ili" id="div_line_item_<%= line_item.id %>">
52
+
53
+ <%# edit_link = edit_terminal_staff_invoice_line_item_path(@invoice, line_item, terminal_id: @terminal.id) %>
54
+
55
+ <% delete_link = terminal_staff_invoice_line_item_path(@invoice, line_item, terminal_id: @terminal.id) %>
56
+
57
+ <div class="col-md-1 li-sl li-display">
58
+ <% if i < 0 %>
59
+ <i class="fa fa-check text-success"></i>
60
+ <% else %>
61
+ <%= i + 1 + (@per_page.to_i * (@current_page.to_i - 1)) %>
62
+ <% end %>
63
+ </div>
64
+
65
+ <div class="col-md-4 li-item-name li-display li-left"><%= line_item.display_name %></div>
66
+
67
+ <div class="col-md-2 li-quantity li-display li-center"><%= line_item.quantity %></div>
68
+
69
+ <div class="col-md-2 li-rate li-display li-right"><%= number_to_currency line_item.rate, unit: "" %></div>
70
+
71
+ <div class="col-md-2 li-rate li-display li-right"><%= number_to_currency (line_item.total_amount) , unit: "" %></div>
72
+
73
+ <div class="col-md-1 li-action li-display">
74
+ <%#= link_to raw("<i class=\"linecons-pencil\"></i>"), edit_link, :remote=>true, class: "edit" %>
75
+
76
+ <%= link_to raw("<i class=\"linecons-trash\"></i>"), delete_link, method: :delete, line_item: "menuitem", tabindex: "-1", data: { confirm: 'Are you sure?' }, :remote=>true, class: "delete" %>
77
+ </div>
78
+
79
+ </div>
80
+
81
+ <% end %>
82
+
83
+ <div id="div_line_item_form">
84
+ <%= render :partial=>"vyapari/terminal_staff/line_items/form", locals: {line_item: LineItem.new(quantity: 1) } %>
85
+ </div>
86
+
87
+ <div class="row mt-10 mb-10" style="font-weight: bold;">
88
+ <div class="col-md-2 col-md-offset-7">Gross Total:</div>
89
+ <div class="col-md-2" style="text-align: right">
90
+ <%= number_to_currency @invoice.total_amount, unit: "" %>
91
+ </div>
92
+ </div>
93
+
94
+
@@ -0,0 +1,34 @@
1
+ <% if @line_item.errors.blank? %>
2
+
3
+ // Refreshing the line items and invoice form
4
+ $("#div_line_item_index").html("<%= escape_javascript(render(:partial=>"/vyapari/terminal_staff/line_items/index")) %>");
5
+ $("#div_invoice_form").html("<%= escape_javascript(render(:partial=>"/vyapari/terminal_staff/invoices/form")) %>");
6
+
7
+ // Highlighting the newly saved line item
8
+ $("#div_line_item_<%= @line_item.id %>").css("background-color", "#fffddd");
9
+
10
+ // Hide errors
11
+ $("#invoice_form_error").hide();
12
+
13
+ // Showing Growl Like Message
14
+ notifySuccess("<%= escape_javascript(@notification[:title]) %>", "<%= escape_javascript(@notification[:message]) %>");
15
+
16
+ <% else %>
17
+
18
+ // Highlighting the line item in the table in red color
19
+ $("#div_line_item_<%= @line_item.id %>").css("background-color", "red");
20
+
21
+ // Show Main Error Message on the form
22
+ <% error_message = content_tag(:div, raw(@notification[:message]), class: "alert alert-danger mt-20") %>
23
+ $("#invoice_form_error").html("<%= escape_javascript(error_message) %>");
24
+ $("#invoice_form_error").show();
25
+
26
+ // Set the mouse focus on the EAN input field
27
+ $( "#div_line_item_form .li-item-name input").focus().select();
28
+
29
+ // Showing Growl Like Message
30
+ notifyError("<%= escape_javascript(@notification[:title]) %>", "<%= escape_javascript(raw(@notification[:message])) %>");
31
+
32
+ <% end %>
33
+
34
+
@@ -0,0 +1,25 @@
1
+ <% if @destroyed %>
2
+
3
+ // Removing the item from the list
4
+ $('#div_<%= @resource_options[:item_name] %>_<%= @r_object.id %>').remove();
5
+ $("#div_invoice_form").html("<%= escape_javascript(render(:partial=>"/vyapari/terminal_staff/invoices/form")) %>");
6
+
7
+ // Hide errors
8
+ $("#invoice_form_error").hide();
9
+
10
+ // Showing Growl Like Message
11
+ notifySuccess("<%= escape_javascript(@notification[:title]) %>", "<%= escape_javascript(@notification[:message]) %>");
12
+
13
+ <% else %>
14
+
15
+ // Show Main Error Message on the form
16
+ <% error_message = content_tag(:div, raw(@notification[:message]), class: "alert alert-danger mt-20") %>
17
+ $("#invoice_form_error").html("<%= escape_javascript(error_message) %>");
18
+ $("#invoice_form_error").show();
19
+
20
+ // Showing Growl Like Message
21
+ notifyError("<%= escape_javascript(@notification[:title]) %>", "<%= escape_javascript(@notification[:message]) %>");
22
+
23
+ <% end %>
24
+
25
+
@@ -0,0 +1,24 @@
1
+ <div class="row">
2
+
3
+ <% @stores.each do |store| %>
4
+ <div class="col-sm-4">
5
+ <div class="xe-widget xe-counter xe-counter-info" style="min-height:160px;max-height: 160px;overflow:hidden;">
6
+ <div class="xe-icon">
7
+ <i class="fa fa-building-o"></i>
8
+ </div>
9
+ <div class="xe-label">
10
+ <strong class="num"><%= store.code %></strong>
11
+ <span><%= store.name %></span>
12
+ <hr>
13
+ <div class="mt-10"></div>
14
+ <%= link_to "Dashboard", store_manager_dashboard_path(store) %>
15
+ <!-- <div class="mt-5"></div> -->
16
+ <%#= link_to "Manage Stock", store_manager_stock_entries_path(store) %>
17
+ <div class="mt-5"></div>
18
+ <%= link_to "Upload new Stock", store_manager_stock_bundles_path(store) %>
19
+ </div>
20
+ </div>
21
+ </div>
22
+ <% end %>
23
+
24
+ </div>
@@ -0,0 +1,51 @@
1
+ <% @stores = Store.active_and_inactive.all + Store.active_and_inactive.all %>
2
+
3
+ <h1 class="mb-40" style="text-align:center;color:#4b4b4b;">Welcome <strong><%= @current_user.name %></strong></h1>
4
+
5
+ <div class="col-md-12">
6
+ <% @stores.each do |store| %>
7
+ <div class="col-md-4 panel panel-default panel-border">
8
+
9
+ <div class="panel-body" style="height:300px;overflow-y: auto">
10
+
11
+ <div class="xe-widget xe-counter xe-counter-info">
12
+ <div class="xe-icon">
13
+ <i class="fa fa-building-o"></i>
14
+ </div>
15
+ <div class="xe-label">
16
+ <%= link_to store_manager_dashboard_path(store) do %>
17
+ <strong class="num"><%= store.name %></strong>
18
+ <% end %>
19
+ <span style="font-size:20px;"><%= store.code %></span>
20
+
21
+ </div>
22
+ </div>
23
+
24
+
25
+ <% store.terminals.active_and_inactive.each do |terminal| %>
26
+
27
+ <div class="col-sm-8">
28
+ <span style="font-size:14px;"><%= terminal.name %></span>
29
+ </div>
30
+
31
+ <div class="col-sm-4">
32
+ <%= link_to "Log In", terminal_staff_dashboard_path(terminal), class: "btn btn-secondary btn-xs" %>
33
+ </div>
34
+
35
+ <% end %>
36
+
37
+ </div>
38
+
39
+ <% if @current_user.has_role?("POS Sales Manager") || @current_user.has_role?("Warehouse Manager") %>
40
+ <div class="panel-footer">
41
+ <%= link_to "Manage", store_manager_dashboard_path(store), class: "btn btn-white btn-lg btn-block mt-30" %>
42
+ </div>
43
+ <% end %>
44
+
45
+ </div>
46
+ <% end %>
47
+ </div>
48
+
49
+ <%= clear_tag(30) %>
50
+
51
+
data/config/routes.rb CHANGED
@@ -1,7 +1,5 @@
1
1
  Vyapari::Engine.routes.draw do
2
2
 
3
- mount Usman::Engine => "/"
4
-
5
3
  namespace :admin do
6
4
 
7
5
  get '/dashboard', to: "dashboard#index", as: :dashboard
@@ -13,16 +11,75 @@ Vyapari::Engine.routes.draw do
13
11
 
14
12
  # Stock Management Routes
15
13
  resources :suppliers
16
- resources :stores
17
- resources :brands
14
+ resources :stores do
15
+
16
+ member do
17
+ put :update_status, as: :update_status
18
+ end
19
+
20
+ resources :terminals do
21
+ member do
22
+ put :update_status, as: :update_status
23
+ end
24
+ end
25
+ end
18
26
 
27
+ resources :brands do
28
+ member do
29
+ put :update_status, as: :update_status
30
+ put :mark_as_featured, as: :mark_as_featured
31
+ put :remove_from_featured, as: :remove_from_featured
32
+ end
33
+ end
34
+
19
35
  resources :categories do
20
36
  member do
21
37
  put :update_status, as: :update_status
38
+ put :mark_as_featured, as: :mark_as_featured
39
+ put :remove_from_featured, as: :remove_from_featured
40
+ put :make_parent, as: :make_parent
41
+ end
42
+ end
43
+
44
+ resources :products do
45
+ member do
46
+ put :update_status, as: :update_status
47
+ put :mark_as_featured, as: :mark_as_featured
48
+ put :remove_from_featured, as: :remove_from_featured
22
49
  end
23
50
  end
24
51
 
25
- end
52
+ end
53
+
54
+ get '/users/dashboard', to: "user_dashboard#index", as: :user_dashboard
55
+
56
+ namespace :store_manager do
57
+
58
+ scope '/:store_id' do
59
+ get 'dashboard', to: "dashboard#index", as: :dashboard
60
+ resources :terminals
61
+ resources :stock_entries
62
+ resources :stock_bundles do
63
+ member do
64
+ get :download_original_file, as: :download_original_file
65
+ get :download_error_file, as: :download_error_file
66
+ end
67
+ end
68
+ end
26
69
 
70
+ end
71
+
72
+ namespace :terminal_staff do
73
+
74
+ scope '/:terminal_id' do
75
+ get '/dashboard', to: "dashboard#index", as: :dashboard
76
+ resources :invoices do
77
+ resources :line_items
78
+ end
79
+ end
80
+
81
+ end
82
+
83
+ mount Usman::Engine => "/"
27
84
 
28
85
  end
@@ -0,0 +1,7 @@
1
+ name,code,permalink ,featured,status
2
+ Titan ,TTN,titan,FALSE,published
3
+ SAMSUNG ,SMNG,samsung,FALSE,published
4
+ MAX FASHIONS,MXFNS,max.fsn,FALSE,unpublished
5
+ NOKIA,NKA,nokia,TRUE,unpublished
6
+ JOSCO INTERNATIONAL JWELLERS ,JIJS,josco.in.jwr,TRUE,published
7
+ REDBULL ENERGY DRINK,RED,redbull.dr,FALSE ,published
@@ -0,0 +1,12 @@
1
+ NAME,PARENT ,CODE,STATUS,FEATURED,PRIORITY,ONELINER ,
2
+ TITAL,WATCHES,TTN,published ,FALSE,2,wrist watch from tata group,
3
+ SAMSUNG MOBILE ,MOBILES ,SMGM,unpublished ,TRUE,3,smart phone from korian brand samsung ,
4
+ RED BULL ZERO ,BEVERAGE ,RBZ,published ,FALSE,5,zero sugar energy drint from redbull,
5
+ REDBULL SODA,BEVERAGE ,RBSO,published ,FALSE ,8,soda from redbull brand ,
6
+ SHIRT ,TEXTILES ,SHRT,unpublished ,FALSE ,8,Mens fashio shirts from MAX ,
7
+ BANGLES ,JWELLERS ,BNGL,published ,TRUE,11,Diomand plated bangles for wedding ,
8
+ WEDDING RING,JWELLERS ,WRNG,published ,TRUE,12,Wedding ring for her.,
9
+ LED TV- 50 INCH,ELECTRONICS,LTV,published ,TRUE,14,LED TV for home ,
10
+ ,,,,,,,
11
+ ,,,,,,,
12
+ ,,,,,,,
@@ -0,0 +1 @@
1
+ name,code
@@ -0,0 +1,7 @@
1
+ name,code,permalink ,featured,status
2
+ Titan ,TTN,titan,FALSE,published
3
+ SAMSUNG ,SMNG,samsung,FALSE,published
4
+ MAX FASHIONS,MXFNS,max.fsn,FALSE,unpublished
5
+ NOKIA,NKA,nokia,TRUE,unpublished
6
+ JOSCO INTERNATIONAL JWELLERS ,JIJS,josco.in.jwr,TRUE,published
7
+ REDBULL ENERGY DRINK,RED,redbull.dr,FALSE ,published
@@ -0,0 +1,12 @@
1
+ NAME,PARENT ,CODE,STATUS,FEATURED,PRIORITY,ONELINER ,
2
+ TITAL,WATCHES,TTN,published ,FALSE,2,wrist watch from tata group,
3
+ SAMSUNG MOBILE ,MOBILES ,SMGM,unpublished ,TRUE,3,smart phone from korian brand samsung ,
4
+ RED BULL ZERO ,BEVERAGE ,RBZ,published ,FALSE,5,zero sugar energy drint from redbull,
5
+ REDBULL SODA,BEVERAGE ,RBSO,published ,FALSE ,8,soda from redbull brand ,
6
+ SHIRT ,TEXTILES ,SHRT,unpublished ,FALSE ,8,Mens fashio shirts from MAX ,
7
+ BANGLES ,JWELLERS ,BNGL,published ,TRUE,11,Diomand plated bangles for wedding ,
8
+ WEDDING RING,JWELLERS ,WRNG,published ,TRUE,12,Wedding ring for her.,
9
+ LED TV- 50 INCH,ELECTRONICS,LTV,published ,TRUE,14,LED TV for home ,
10
+ ,,,,,,,
11
+ ,,,,,,,
12
+ ,,,,,,,
@@ -0,0 +1 @@
1
+ name,code
@@ -0,0 +1,5 @@
1
+ base_currency,counter_currency,value,effective_date
2
+ INR,AED,18.01,11/3/17
3
+ USD,AED,3.65,1/1/15
4
+ SAR,AED,1.02,11/1/16
5
+ EUR,AED,5.6,11/1/17
@@ -0,0 +1 @@
1
+ name,ean_sku,reference_number,description,brand,category,purchased_price,landing_price,selling_price,retail_price,quantity
@@ -0,0 +1 @@
1
+ name,ean_sku,reference_number,description,brand,category,purchased_price,landing_price,selling_price,retail_price,quantity
Binary file
@@ -0,0 +1,13 @@
1
+ name,code,country
2
+ BUR DUBAI,DXBBD,AE
3
+ DEIRA,DXBDR,AE
4
+ SHARHAJ Al Nahda,SHJNAH,AE
5
+ AL AIN ,AUHALN,AE
6
+ FUJAIRAH Colony,FJHCOL,AE
7
+ ABU DHABI Mohammad Street,AUHMHD,AE
8
+ JUMAIRAH LAKE TOWERS ,DXBJLT,AE
9
+ JABIL ALI,DXBJBL,AE
10
+ Ajman Place,AJMPLC,AE
11
+ Al QUOZ,DXBALQ,AE
12
+ Sheikh Zayed Road,DXBSZR,AE
13
+ Al Barsha,DXBALB,AE