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,57 +0,0 @@
1
- <%= content_for :javascript_footer do %>
2
- <script type="text/javascript">
3
-
4
- <% if @stock_bundle.errors.blank? %>
5
-
6
- <% if @stock_bundle.error_summary.blank? %>
7
-
8
- //var stockEntriesUrl = "<%= store_manager_stock_entries_url(@stock_bundle.store, sb: @stock_bundle.id) %>";
9
- //window.parent.location.replace(stockEntriesUrl);
10
-
11
- heading = "Stock Bundle Uploaded Successfully!";
12
- bodyContent = "<%= escape_javascript(render(:partial=>"/vyapari/store_manager/stock_bundles/show")) %>";
13
- window.parent.showLargeModal(heading, bodyContent, false);
14
-
15
- // Showing Growl Like Message
16
- //notifySuccess("<%= escape_javascript(@notification[:title]) %>", "<%= escape_javascript(@notification[:message]) %>");
17
-
18
- <% else %>
19
-
20
- heading = "Stock Bundle Uploaded with Errors";
21
- bodyContent = "<%= escape_javascript(render(:partial=>"/vyapari/store_manager/stock_bundles/show")) %>";
22
-
23
- window.parent.showLargeModal(heading, bodyContent, false);
24
-
25
- // Showing Growl Like Message
26
- //notifyError("<%= escape_javascript(@notification[:title]) %>", "<%= escape_javascript(@notification[:message]) %>");
27
-
28
- <% end %>
29
-
30
- // Inserting the row on top of the table and highlighting it
31
- window.parent.$('#div_stock_bundle_index table > tbody').prepend("<%= escape_javascript(render(:partial=>"/vyapari/store_manager/stock_bundles/row", locals: {stock_bundle: @stock_bundle, i: -1})) %>");
32
-
33
- window.parent.$("#tr_stock_bundle_<%= @stock_bundle.id %>").css("background-color", "#fffddd");
34
-
35
- <% else %>
36
-
37
- heading = "Upload Stock Bundle (CSV Format)";
38
- bodyContent = "<%= escape_javascript(render(:partial=>"/vyapari/store_manager/stock_bundles/form")) %>";
39
-
40
- window.parent.showLargeModal(heading, bodyContent);
41
-
42
- <%
43
- text = "You have few errors. All fields are mandatory."
44
- error_message = content_tag(:div, text, class: "alert alert-danger")
45
- %>
46
-
47
- $("#stock_bundle_form_error", window.parent.document).html("<%= escape_javascript(error_message) %>");
48
-
49
- $("#form_stock_bundle > div > div.panel-footer.clearfix > div > input", window.parent.document).replaceWith("<%= escape_javascript(theme_form_button(@stock_bundle)) %>");
50
-
51
- <% end %>
52
-
53
- $.rails.handleRemote($("a[data-remote]"));
54
-
55
- </script>
56
- <% end %>
57
-
@@ -1,50 +0,0 @@
1
- <% suppliers = Supplier.select("id, name").order("name ASC").all %>
2
-
3
- <%= form_for([:store_manager, @stock_entry], :html => {:id=>"form_stock_entry", :class=>"mb-0 form-horizontal", :stock_entry => "form", :method => (@stock_entry.new_record? ? :post : :put), :remote=>true}) do |f| %>
4
-
5
- <% if suppliers.empty? %>
6
- <div class="alert alert-danger alert-dismissible" role="alert">
7
- <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
8
- <p>
9
- <b>Warning:</b>You have not added any suppliers. Ask your administrator to add suppliers for the company so that you could upload stock you have received from those suppliers.
10
- </p>
11
- </div>
12
- <% end %>
13
-
14
- <div id="stock_entry_form_error">
15
- <%= @stock_entry.errors[:base].to_sentence %>
16
- </div>
17
-
18
- <div class="form-inputs mb-30 mt-30">
19
-
20
- <% if @stock_bundle && @stock_bundle.persisted? %>
21
-
22
- <%= theme_form_group("Supplier", required: true, error_class: "error") do %>
23
- <%= content_tag :div, @stock_bundle.supplier.try(:name) %>
24
- <% end %>
25
- <%= hidden_field_tag "stock_bundle[supplier_id]", @stock_bundle.supplier_id %>
26
-
27
- <% else %>
28
-
29
- <% options = {assoc_collection: suppliers, required: true, editable: true, assoc_display_method: :name} %>
30
- <%= theme_form_assoc_group(@stock_bundle, :supplier_id, **options) %>
31
-
32
- <% end %>
33
-
34
- <%= theme_form_field(@stock_bundle, :file, html_options: {type: 'file'}, label: "Upload the Stock file in CSV format", param_name: "stock_bundle[file]") %>
35
-
36
- </div>
37
-
38
- <div>
39
-
40
- <%= submit_tag("Save", :class=>"btn btn-primary pull-right ml-10") %>
41
-
42
- <%= link_to raw("<i class='fa fa-close mr-5'></i><span>Cancel</span>"), "#", onclick: "closeLargeModal();", class: "pull-right ml-10 btn btn-white" %>
43
-
44
- </div>
45
- <%= clear_tag(10) %>
46
-
47
- </div>
48
-
49
- <% end %>
50
-
@@ -1,80 +0,0 @@
1
- <div class="table-responsive">
2
- <table class="table table-hover members-table middle-align">
3
- <thead>
4
- <tr>
5
- <th style="text-align: center;width:60px">#</th>
6
- <th>Product Name</th>
7
- <th style="width:15%;text-align: center;">EAN/SKU</th>
8
- <th style="text-align: right;">PP</th>
9
- <th style="text-align: right;">LP</th>
10
- <th style="text-align: right;">SP</th>
11
- <th style="text-align: right;">RP</th>
12
- <th style="text-align: center;">Quantity</th>
13
- <th>Status</th>
14
- <th style="text-align: center;">Actions</th>
15
- </tr>
16
- </thead>
17
-
18
- <tbody>
19
- <% @stock_entries.each_with_index do |stock_entry, i| %>
20
-
21
- <% edit_link = edit_store_manager_stock_entry_path(@store, stock_entry) %>
22
-
23
- <% delete_link = store_manager_stock_entries_path(@store, stock_entry) %>
24
-
25
- <tr id="tr_stock_entry_<%= stock_entry.id %>">
26
-
27
- <th scope="row" style="text-align: center;">
28
- <% if i < 0 %>
29
- <i class="fa fa-check text-success"></i>
30
- <% else %>
31
- <%= i + 1 + (@per_page.to_i * (@current_page.to_i - 1)) %>
32
- <% end %>
33
- </th>
34
-
35
- <td class="stock_entry-name"><%= link_to stock_entry.product.name, store_manager_stock_entries_path(@store, stock_entry), remote: true %></td>
36
-
37
- <td class="stock_entry-name" style="text-align: center;"><%= stock_entry.product.ean_sku %></td>
38
-
39
- <td class="stock_entry-name" style="text-align: right;">
40
- <%= number_to_currency stock_entry.product.purchased_price, unit: "" %>
41
- </td>
42
-
43
- <td class="stock_entry-name" style="text-align: right;">
44
- <%= number_to_currency stock_entry.product.landed_price, unit: "" %>
45
- </td>
46
-
47
- <td class="stock_entry-name" style="text-align: right;">
48
- <%= number_to_currency stock_entry.product.selling_price, unit: "" %>
49
- </td>
50
-
51
- <td class="stock_entry-name" style="text-align: right;">
52
- <%= number_to_currency stock_entry.product.retail_price, unit: "" %>
53
- </td>
54
-
55
- <td class="stock_entry-name" style="text-align: center;">
56
- <%= stock_entry.quantity %>
57
- </td>
58
-
59
- <td class="stock_entry-name"><%= stock_entry.display_status %></td>
60
-
61
- <td class="action-links" style="width:10%">
62
-
63
- <%= link_to raw("<i class=\"linecons-pencil\"></i> Edit"), edit_link, :remote=>true, class: "edit" %>
64
-
65
- <%= link_to raw("<i class=\"linecons-trash\"></i> Delete"), delete_link, method: :delete, stock_entry: "menuitem", tabindex: "-1", data: { confirm: 'Are you sure?' }, :remote=>true, class: "delete" %>
66
-
67
- </td>
68
-
69
- </tr>
70
- <% end %>
71
- </tbody>
72
- </table>
73
- </div>
74
-
75
- <div class="row">
76
- <div class="col-sm-12">
77
- <%= paginate_kuppayam(@stock_entries) %>
78
- </div>
79
- </div>
80
-
@@ -1,33 +0,0 @@
1
- <% edit_link = edit_store_manager_stock_entry_path(@store, stock_entry) %>
2
-
3
- <% delete_link = store_manager_stock_entries_path(@store, stock_entry) %>
4
-
5
- <tr id="tr_stock_entry_<%= stock_entry.id %>">
6
-
7
- <th scope="row" style="text-align: center;">
8
- <% if i < 0 %>
9
- <i class="fa fa-check text-success"></i>
10
- <% else %>
11
- <%= i + 1 + (@per_page.to_i * (@current_page.to_i - 1)) %>
12
- <% end %>
13
- </th>
14
-
15
- <td class="stock_entry-name"><%= link_to stock_entry.id, store_manager_stock_entries_path(@store, stock_entry), remote: true %></td>
16
-
17
- <td class="stock_entry-name"><%= link_to stock_entry.code, store_manager_stock_entries_path(@store, stock_entry), remote: true %></td>
18
-
19
- <td class="stock_entry-name"><%= link_to stock_entry.display_stock_entry_type, store_manager_stock_entries_path(@store, stock_entry), remote: true %></td>
20
-
21
- <td class="stock_entry-name"><%= link_to stock_entry.region.try(:name), store_manager_stock_entries_path(@store, stock_entry), remote: true %></td>
22
-
23
- <td class="stock_entry-name"><%= link_to stock_entry.country.try(:name), store_manager_stock_entries_path(@store, stock_entry), remote: true %></td>
24
-
25
- <td class="action-links" style="width:10%">
26
-
27
- <%= link_to raw("<i class=\"linecons-pencil\"></i> Edit"), edit_link, :remote=>true, class: "edit" %>
28
-
29
- <%= link_to raw("<i class=\"linecons-trash\"></i> Delete"), delete_link, method: :delete, stock_entry: "menuitem", tabindex: "-1", data: { confirm: 'Are you sure?' }, :remote=>true, class: "delete" %>
30
-
31
- </td>
32
-
33
- </tr>
@@ -1,110 +0,0 @@
1
- <% @terminals = @stock_entry.terminals.page(@current_page).per(@per_page) %>
2
-
3
- <div id="div_stock_entry_show">
4
-
5
- <div class="row">
6
-
7
- <div class="col-md-9 col-sm-12 col-xs-12" style="border-right:1px solid #f1f1f1;">
8
-
9
- <div class="visible-sm visible-xs mt-50"></div>
10
-
11
- <%= theme_panel_heading(@stock_entry.display_name) %>
12
- <%= theme_panel_sub_heading(@stock_entry.code, "#") %>
13
- <%= theme_panel_sub_heading(@stock_entry.stock_entry_type, "#") %>
14
- <%= theme_panel_description(@stock_entry.region.name) if @stock_entry.region %>
15
- <%= theme_panel_description(@stock_entry.country.name) if @stock_entry.country %>
16
-
17
- <%= clear_tag(10) %>
18
-
19
- <div class="visible-sm visible-xs mb-50"></div>
20
-
21
- </div>
22
-
23
- <div class="col-md-3 col-sm-12 col-xs-12">
24
-
25
- <% edit_link = edit_store_manager_stock_entries_path_stock_entry_path(@store, @stock_entry) %>
26
-
27
- <% delete_link = store_manager_stock_entries_path_stock_entry_path(@store, @stock_entry) %>
28
-
29
- <%= link_to raw("<i class=\"linecons-pencil\"></i> Edit Stock Entry"), edit_link, :remote=>true, class: "btn btn-block btn-success" if @stock_entry.can_be_edited? %>
30
-
31
- <%= link_to raw("<i class=\"linecons-trash\"></i> Delete"), delete_link, method: :delete, stock_entry: "menuitem", tabindex: "-1", data: { confirm: 'Are you sure?' }, :remote=>true, class: "btn btn-block btn-danger btn-only-hover" if @stock_entry.can_be_deleted? %>
32
-
33
- <div class="visible-sm visible-xs mb-50"></div>
34
-
35
- </div>
36
-
37
- </div>
38
-
39
- <%= clear_tag(50) %>
40
-
41
- <ul class="nav nav-pills">
42
- <li class="active">
43
- <a href="#terminals" data-toggle="tab" aria-expanded="false">
44
- <span class="visible-xs"><i class="fa-database"></i></span>
45
- <span class="hidden-xs">Terminals</span>
46
- </a>
47
- </li>
48
-
49
- <li class="">
50
- <a href="#technical_details" data-toggle="tab" aria-expanded="false">
51
- <span class="visible-xs"><i class="fa-database"></i></span>
52
- <span class="hidden-xs">Technical Details</span>
53
- </a>
54
- </li>
55
- </ul>
56
-
57
- <div class="tab-content">
58
- <div class="tab-pane active" id="terminals" style="border: 1px solid #000;min-height:200px;padding:20px;margin-bottom:20px;max-height: 400px;overflow-y: auto;">
59
-
60
- <%= clear_tag(20) %>
61
-
62
- <div id="div_terminal_action_buttons">
63
- <div class="row">
64
- <div class="col-md-6">
65
-
66
- <%= theme_button('Add a Terminal', 'plus', new_store_manager_stock_entry_ath(@stock_entry), classes: "pull-left", btn_type: "success") %>
67
-
68
- <%= theme_button('Refresh', 'refresh', store_manager_stock_entry_path(@stock_entry), classes: "pull-left ml-10", btn_type: "white") %>
69
- </div>
70
- <div class="col-md-6">
71
- <%= search_form_kuppayam(Terminal, store_manager_stock_entry_path(@stock_entry), text: "") %>
72
- </div>
73
- </div>
74
- </div>
75
- <%= clear_tag(10) %>
76
-
77
- <div id="div_terminal_index">
78
- <%= render :partial=>"vyapari/store_manager/terminals/index" %>
79
- </div>
80
-
81
- </div>
82
- <div class="tab-pane" id="technical_details">
83
-
84
- <%= clear_tag(20) %>
85
-
86
- <div class="table-responsive">
87
- <table class="table table-striped table-condensed table-bordered mb-30">
88
- <tbody>
89
-
90
- <tr>
91
- <th>ID</th><td colspan="3"><%= @stock_entry.id %></td>
92
- </tr>
93
-
94
- <tr>
95
- <th>Created At</th><td><%= @stock_entry.created_at.strftime("%m/%d/%Y - %H:%M:%S") if @stock_entry.created_at %></td>
96
- <th>Updated At</th><td><%= @stock_entry.updated_at.strftime("%m/%d/%Y - %H:%M:%S") if @stock_entry.updated_at %></td>
97
- </tr>
98
-
99
- </tbody>
100
- </table>
101
-
102
- </div>
103
-
104
- </div>
105
- </div>
106
-
107
- <%= link_to "Close", "#", onclick: "closeLargeModal();", class: "btn btn-primary pull-right" %>
108
-
109
- <%= clear_tag %>
110
- </div>
@@ -1,61 +0,0 @@
1
- <%
2
- stock_entries_count = @stock_bundle.stock_entries.count
3
-
4
- if @stock_bundle.error_summary.blank?
5
- widget_class = "xe-counter-green"
6
- widget_icon = "fa-check"
7
- panel_heading = "Uploaded Successfully"
8
- panel_class = "panel-success"
9
- else
10
- widget_class = "xe-counter-red"
11
- widget_icon = "fa-exclamation-triangle"
12
- panel_heading = "Parse Error"
13
- panel_class = "panel-red"
14
- end
15
- %>
16
-
17
- <div class="row">
18
-
19
- <div class="col-md-3 col-sm-4 col-xs-12" style="border-right:1px solid #f1f1f1;">
20
-
21
- <div class="visible-sm visible-xs mt-50"></div>
22
-
23
- <div class="xe-widget xe-vertical-counter xe-vertical-counter-primary" data-count=".num" data-from="0" data-to="442" data-suffix=" TB" data-duration="5">
24
- <div class="xe-icon">
25
- <i class="linecons-truck"></i>
26
- </div>
27
-
28
- <div class="xe-label">
29
- <strong class="num"><%= stock_entries_count %></strong>
30
- <span>Product Items</span>
31
- </div>
32
- </div>
33
-
34
- <%= clear_tag(10) %>
35
-
36
- <div class="visible-sm visible-xs mb-50"></div>
37
-
38
- </div>
39
-
40
- <div class="col-md-9 col-sm-8 col-xs-12" style="border-right:1px solid #f1f1f1;">
41
-
42
- <div class="visible-sm visible-xs mt-50"></div>
43
-
44
- <div class="xe-widget xe-counter <%= widget_class %>" data-count=".num" data-from="0" data-to="57" data-prefix="-," data-suffix="%" data-duration="5" data-easing="true" data-delay="1">
45
- <div class="xe-icon">
46
- <i class="<%= widget_icon %>"></i>
47
- </div>
48
- <div class="xe-label">
49
- <strong class="num"><%= @stock_bundle.display_name %></strong>
50
- <span><strong style="font-size:16px;"><%= @stock_bundle.store.try(:name) %></strong></span>
51
- <span>Uploaded By: <%= @stock_bundle.uploader.try(:name) %></span>
52
- </div>
53
- </div>
54
-
55
- <%= clear_tag(10) %>
56
-
57
- <div class="visible-sm visible-xs mb-50"></div>
58
-
59
- </div>
60
-
61
- </div>
@@ -1,45 +0,0 @@
1
- <div class="row">
2
-
3
- <div class="col-md-12">
4
-
5
- <div id="div_stock_bundle_show">
6
- <% if @stock_bundle %>
7
- <%= render :partial=>"vyapari/store_manager/stock_entries/stock_bundle" %>
8
- <% end %>
9
- </div>
10
-
11
- <ul class="nav nav-tabs">
12
- </ul>
13
-
14
- <div class="tab-content">
15
- <div class="tab-pane active">
16
-
17
- <div id="div_stock_entry_action_buttons">
18
- <div class="row">
19
- <div class="col-md-6">
20
-
21
- <%= theme_button('Import / Update Stock', 'plus', store_manager_stock_bundles_path(@store), remote: false, classes: "pull-left", btn_type: "success") %>
22
-
23
- <%#= theme_button('Add a Single Item', 'check', new_store_manager_stock_entry_path(@store, overwrite: true), classes: "pull-left", btn_type: "success") %>
24
-
25
- <%= theme_button('Refresh', 'refresh', store_manager_stock_entries_path(@store), classes: "pull-left ml-10", btn_type: "white") %>
26
-
27
- </div>
28
- <div class="col-md-6">
29
- <%= search_form_kuppayam(StockEntry, store_manager_stock_entries_path(@store), text: @filters[:query]) %>
30
- </div>
31
- </div>
32
- </div>
33
- <%= clear_tag(10) %>
34
-
35
- <div id="div_stock_entry_index">
36
- <%= render :partial=>"vyapari/store_manager/stock_entries/index" %>
37
- </div>
38
- <%= clear_tag(10) %>
39
-
40
- </div>
41
- </div>
42
-
43
- </div>
44
-
45
- </div>
@@ -1,131 +0,0 @@
1
- <%
2
-
3
- # [d1, d2, d3].each_with_index do |d, i|
4
- # [t1, t2].each_with_index do |t, j|
5
-
6
- # cash_sales = t.invoices.where('DATE(created_at) = ?', d).active.cash_invoices.sum(:net_total_amount)
7
- # credit_card_sales = t.invoices.where('DATE(created_at) = ?', d).active.credit_card_invoices.sum(:net_total_amount)
8
-
9
- # puts "Day #{i+1}, Terminal #{j+1} - Cash Sales - #{cash_sales}"
10
- # puts "Day #{i+1}, Terminal #{j+1} - Credit Card Sales - #{credit_card_sales}"
11
- # end
12
- # end
13
-
14
- total_invoice_amount = @terminal.invoices.dated(@date).active.sum(:net_total_amount)
15
-
16
- total_invoices = @terminal.invoices.dated(@date).active.count
17
-
18
- total_cash = @terminal.invoices.dated(@date).active.cash_invoices.sum(:net_total_amount)
19
-
20
- total_cash_invoices = @terminal.invoices.dated(@date).active.where(payment_method: :cash).count
21
-
22
- total_credit = @terminal.invoices.dated(@date).active.credit_card_invoices.sum(:net_total_amount)
23
-
24
- total_credit_card_invoices = @terminal.invoices.dated(@date).active.where(payment_method: :credit_card).count
25
-
26
- %>
27
-
28
- <div class="row calendar-env">
29
- <div class="col-md-12 text-center">
30
- <div class="btn-group" style="margin:auto;">
31
-
32
- <%= link_to raw("<i class=\"fa fa-arrow-left\"></i>"), terminal_staff_dashboard_path(@terminal, date: (@date - 1.day)), class: "btn btn-white", style: "font-size: 20px;" %>
33
-
34
- <input type="text" name="reportdate" value="<%= @date.strftime("%m-%d-%Y") %>" class="btn btn-white" style="height:42px;" />
35
-
36
- <%= link_to raw("<i class=\"fa fa-arrow-right\"></i>"), terminal_staff_dashboard_path(@terminal, date: (@date + 1.day)), class: "btn btn-white", style: "font-size: 20px;" %>
37
- </div>
38
- </div>
39
- </div>
40
-
41
- <div class="row">
42
-
43
- <div class="col-sm-3">
44
-
45
- <div class="xe-widget xe-counter-block xe-counter-block-green" data-suffix="k" data-count=".num" data-from="0" data-to="310" data-duration="4" data-easing="false">
46
- <div class="xe-upper">
47
-
48
- <div class="xe-icon">
49
- <i class="fa-money"></i>
50
- </div>
51
- <div class="xe-label">
52
- <strong class="num"><%= number_to_currency total_invoice_amount, unit: "AED " %></strong>
53
- <span>Total Sales Today</span>
54
- </div>
55
-
56
- </div>
57
- <div class="xe-lower">
58
- <div class="border"></div>
59
-
60
- <span>Total Invoices Today: <b><%= total_invoices %></b></span>
61
- </div>
62
- </div>
63
- </div>
64
-
65
- <div class="col-sm-3">
66
-
67
- <div class="xe-widget xe-counter-block xe-counter-block-white" data-suffix="k" data-count=".num" data-from="0" data-to="310" data-duration="4" data-easing="false">
68
- <div class="xe-upper">
69
-
70
- <div class="xe-icon">
71
- <i class="fa-money"></i>
72
- </div>
73
- <div class="xe-label">
74
- <strong class="num"><%= number_to_currency total_cash, unit: "AED " %></strong>
75
- <span>Total Cash Sales Today</span>
76
- </div>
77
-
78
- </div>
79
- <div class="xe-lower">
80
- <div class="border"></div>
81
-
82
- <span>Total Cash Invoices Today: <b><%= total_cash_invoices %></b></span>
83
-
84
- </div>
85
- </div>
86
- </div>
87
-
88
- <div class="col-sm-3">
89
-
90
- <div class="xe-widget xe-counter-block xe-counter-block-white" data-suffix="k" data-count=".num" data-from="0" data-to="310" data-duration="4" data-easing="false">
91
- <div class="xe-upper">
92
-
93
- <div class="xe-icon">
94
- <i class="fa-credit-card"></i>
95
- </div>
96
- <div class="xe-label">
97
- <strong class="num"><%= number_to_currency total_credit, unit: "AED " %></strong>
98
- <span>Total Credit Card Sales Today</span>
99
- </div>
100
- </div>
101
- <div class="xe-lower">
102
- <div class="border"></div>
103
- <span>Total Credit Card Invoices Today: <b><%= total_credit_card_invoices %></b></span>
104
- </div>
105
- </div>
106
- </div>
107
-
108
- <div class="col-sm-3">
109
- <%= link_to raw("<i class=\"fa-book mr-10\"></i> Create Invoice"), new_terminal_staff_invoice_path(@terminal), remote: true, class: "btn btn-success btn-lg btn-block hidden-xs", style: "height:50px" %>
110
-
111
- <%= link_to raw("<i class=\"fa-book mr-10\"></i> Manage Invoices"), terminal_staff_invoices_path(@terminal), class: "btn btn-primary btn-only-hover btn-lg btn-block", style: "height:50px", target: "_blank" %>
112
- </div>
113
-
114
- </div>
115
-
116
- <script type="text/javascript">
117
- $(function() {
118
-
119
- $('input[name="reportdate"]').daterangepicker({
120
- singleDatePicker: true,
121
- showDropdowns: true
122
- },
123
-
124
- function(start, end, label) {
125
- var urlWithoutParams = location.protocol + '//' + location.host + location.pathname;
126
- var params = { locale:'en', date:start.format('DD-MM-YYYY') };
127
- var dateParam = jQuery.param(params);
128
- window.location.href = urlWithoutParams + "?" + dateParam;
129
- });
130
- });
131
- </script>