vyapari 0.1.5dev10 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/vyapari/admin/base_controller.rb +0 -9
- data/app/controllers/vyapari/admin/countries_controller.rb +2 -2
- data/app/controllers/vyapari/admin/dashboard_controller.rb +1 -3
- data/app/controllers/vyapari/admin/exchange_rates_controller.rb +2 -2
- data/app/controllers/vyapari/admin/regions_controller.rb +1 -1
- data/app/controllers/vyapari/admin/resource_controller.rb +0 -1
- data/app/controllers/vyapari/admin/users_controller.rb +130 -0
- data/app/controllers/vyapari/application_controller.rb +0 -11
- data/app/models/brand.rb +19 -67
- data/app/models/category.rb +19 -63
- data/app/models/country.rb +7 -31
- data/app/models/exchange_rate.rb +7 -32
- data/app/models/product.rb +20 -75
- data/app/models/region.rb +20 -37
- data/app/models/vyapari/application_record.rb +0 -3
- data/app/views/layouts/kuppayam/_footer.html.erb +1 -1
- data/app/views/layouts/kuppayam/_sidebar.html.erb +44 -45
- data/app/views/vyapari/admin/countries/_index.html.erb +1 -1
- data/app/views/vyapari/admin/countries/index.html.erb +3 -19
- data/app/views/vyapari/admin/exchange_rates/_form.html.erb +4 -3
- data/app/views/vyapari/admin/exchange_rates/_index.html.erb +7 -7
- data/app/views/vyapari/admin/exchange_rates/_row.html.erb +3 -3
- data/app/views/vyapari/admin/exchange_rates/_show.html.erb +0 -1
- data/app/views/vyapari/admin/exchange_rates/index.html.erb +3 -19
- data/app/views/vyapari/admin/regions/_index.html.erb +1 -1
- data/app/views/vyapari/admin/regions/index.html.erb +3 -19
- data/app/views/vyapari/admin/users/_form.html.erb +39 -0
- data/app/views/vyapari/admin/users/_index.html.erb +101 -0
- data/app/views/vyapari/admin/users/_row.html.erb +72 -0
- data/app/views/vyapari/admin/users/_show.html.erb +199 -0
- data/app/views/vyapari/admin/{categories → users}/index.html.erb +24 -8
- data/config/routes.rb +5 -66
- data/db/migrate/20170000000200_create_exchange_rates.rb +2 -3
- data/lib/tasks/vyapari_tasks.rake +4 -0
- data/lib/vyapari/version.rb +1 -1
- metadata +15 -167
- data/app/assets/images/vyapari/sample_stock_bundle.csv +0 -1
- data/app/controllers/vyapari/admin/brands_controller.rb +0 -99
- data/app/controllers/vyapari/admin/categories_controller.rb +0 -115
- data/app/controllers/vyapari/admin/products_controller.rb +0 -79
- data/app/controllers/vyapari/admin/stores_controller.rb +0 -67
- data/app/controllers/vyapari/admin/suppliers_controller.rb +0 -67
- data/app/controllers/vyapari/admin/terminals_controller.rb +0 -150
- data/app/controllers/vyapari/store_manager/base_controller.rb +0 -33
- data/app/controllers/vyapari/store_manager/dashboard_controller.rb +0 -31
- data/app/controllers/vyapari/store_manager/reports/invoices_controller.rb +0 -249
- data/app/controllers/vyapari/store_manager/reports/sales_controller.rb +0 -299
- data/app/controllers/vyapari/store_manager/reports/stock_controller.rb +0 -132
- data/app/controllers/vyapari/store_manager/resource_controller.rb +0 -17
- data/app/controllers/vyapari/store_manager/stock_bundles_controller.rb +0 -206
- data/app/controllers/vyapari/store_manager/stock_entries_controller.rb +0 -161
- data/app/controllers/vyapari/terminal_staff/base_controller.rb +0 -38
- data/app/controllers/vyapari/terminal_staff/dashboard_controller.rb +0 -35
- data/app/controllers/vyapari/terminal_staff/invoices_controller.rb +0 -147
- data/app/controllers/vyapari/terminal_staff/line_items_controller.rb +0 -139
- data/app/controllers/vyapari/terminal_staff/resource_controller.rb +0 -17
- data/app/controllers/vyapari/user_dashboard_controller.rb +0 -31
- data/app/models/bank_account.rb +0 -44
- data/app/models/contact.rb +0 -72
- data/app/models/image/brand_image.rb +0 -3
- data/app/models/image/category_image.rb +0 -3
- data/app/models/image/product_image.rb +0 -3
- data/app/models/invoice.rb +0 -256
- data/app/models/line_item.rb +0 -207
- data/app/models/stock_bundle.rb +0 -249
- data/app/models/stock_entry.rb +0 -275
- data/app/models/store.rb +0 -302
- data/app/models/supplier.rb +0 -79
- data/app/models/terminal.rb +0 -158
- data/app/uploaders/brand_image_uploader.rb +0 -14
- data/app/uploaders/category_image_uploader.rb +0 -14
- data/app/uploaders/product_image_uploader.rb +0 -14
- data/app/uploaders/stock_bundle_uploader.rb +0 -10
- data/app/views/layouts/vyapari/_store_manager_menu.html.erb +0 -126
- data/app/views/layouts/vyapari/_terminal_staff_menu.html.erb +0 -106
- data/app/views/layouts/vyapari/store_manager.html.erb +0 -112
- data/app/views/layouts/vyapari/terminal_staff.html.erb +0 -116
- data/app/views/vyapari/admin/brands/_form.html.erb +0 -23
- data/app/views/vyapari/admin/brands/_index.html.erb +0 -89
- data/app/views/vyapari/admin/brands/_row.html.erb +0 -63
- data/app/views/vyapari/admin/brands/_show.html.erb +0 -104
- data/app/views/vyapari/admin/brands/index.html.erb +0 -48
- data/app/views/vyapari/admin/categories/_form.html.erb +0 -28
- data/app/views/vyapari/admin/categories/_index.html.erb +0 -101
- data/app/views/vyapari/admin/categories/_row.html.erb +0 -69
- data/app/views/vyapari/admin/categories/_show.html.erb +0 -115
- data/app/views/vyapari/admin/products/_form.html.erb +0 -32
- data/app/views/vyapari/admin/products/_index.html.erb +0 -58
- data/app/views/vyapari/admin/products/_row.html.erb +0 -30
- data/app/views/vyapari/admin/products/_show.html.erb +0 -81
- data/app/views/vyapari/admin/products/index.html.erb +0 -48
- data/app/views/vyapari/admin/stores/_form.html.erb +0 -37
- data/app/views/vyapari/admin/stores/_index.html.erb +0 -84
- data/app/views/vyapari/admin/stores/_row.html.erb +0 -55
- data/app/views/vyapari/admin/stores/_show.html.erb +0 -110
- data/app/views/vyapari/admin/stores/index.html.erb +0 -48
- data/app/views/vyapari/admin/suppliers/_form.html.erb +0 -32
- data/app/views/vyapari/admin/suppliers/_index.html.erb +0 -58
- data/app/views/vyapari/admin/suppliers/_row.html.erb +0 -30
- data/app/views/vyapari/admin/suppliers/_show.html.erb +0 -81
- data/app/views/vyapari/admin/suppliers/index.html.erb +0 -48
- data/app/views/vyapari/admin/terminals/_form.html.erb +0 -24
- data/app/views/vyapari/admin/terminals/_index.html.erb +0 -75
- data/app/views/vyapari/admin/terminals/_row.html.erb +0 -49
- data/app/views/vyapari/admin/terminals/_show.html.erb +0 -74
- data/app/views/vyapari/store_manager/dashboard/_sales_counts.html.erb +0 -90
- data/app/views/vyapari/store_manager/dashboard/_stock_counts.html.erb +0 -63
- data/app/views/vyapari/store_manager/dashboard/_terminals.html.erb +0 -23
- data/app/views/vyapari/store_manager/dashboard/index.html.erb +0 -64
- data/app/views/vyapari/store_manager/reports/invoices/_index.html.erb +0 -65
- data/app/views/vyapari/store_manager/reports/invoices/index.html.erb +0 -105
- data/app/views/vyapari/store_manager/reports/sales/_index.html.erb +0 -64
- data/app/views/vyapari/store_manager/reports/sales/index.html.erb +0 -105
- data/app/views/vyapari/store_manager/reports/stock/_index.html.erb +0 -72
- data/app/views/vyapari/store_manager/reports/stock/index.html.erb +0 -32
- data/app/views/vyapari/store_manager/stock_bundles/_form.html.erb +0 -99
- data/app/views/vyapari/store_manager/stock_bundles/_index.html.erb +0 -74
- data/app/views/vyapari/store_manager/stock_bundles/_row.html.erb +0 -44
- data/app/views/vyapari/store_manager/stock_bundles/_show.html.erb +0 -110
- data/app/views/vyapari/store_manager/stock_bundles/create.html.erb +0 -57
- data/app/views/vyapari/store_manager/stock_bundles/index.html.erb +0 -36
- data/app/views/vyapari/store_manager/stock_bundles/update.html.erb +0 -57
- data/app/views/vyapari/store_manager/stock_entries/_form.html.erb +0 -50
- data/app/views/vyapari/store_manager/stock_entries/_index.html.erb +0 -80
- data/app/views/vyapari/store_manager/stock_entries/_row.html.erb +0 -33
- data/app/views/vyapari/store_manager/stock_entries/_show.html.erb +0 -110
- data/app/views/vyapari/store_manager/stock_entries/_stock_bundle.html.erb +0 -61
- data/app/views/vyapari/store_manager/stock_entries/index.html.erb +0 -45
- data/app/views/vyapari/terminal_staff/dashboard/_counts.html.erb +0 -131
- data/app/views/vyapari/terminal_staff/dashboard/_invoices.html.erb +0 -44
- data/app/views/vyapari/terminal_staff/dashboard/_search_form.html.erb +0 -6
- data/app/views/vyapari/terminal_staff/dashboard/_search_results.html.erb +0 -24
- data/app/views/vyapari/terminal_staff/dashboard/index.html.erb +0 -56
- data/app/views/vyapari/terminal_staff/dashboard/search.js.erb +0 -12
- data/app/views/vyapari/terminal_staff/invoices/_draft.html.erb +0 -62
- data/app/views/vyapari/terminal_staff/invoices/_form.html.erb +0 -134
- data/app/views/vyapari/terminal_staff/invoices/_index.html.erb +0 -70
- data/app/views/vyapari/terminal_staff/invoices/_row.html.erb +0 -33
- data/app/views/vyapari/terminal_staff/invoices/_show.html.erb +0 -204
- data/app/views/vyapari/terminal_staff/invoices/index.html.erb +0 -35
- data/app/views/vyapari/terminal_staff/invoices/new.js.erb +0 -18
- data/app/views/vyapari/terminal_staff/invoices/show.html.erb +0 -1
- data/app/views/vyapari/terminal_staff/invoices/show.js.erb +0 -13
- data/app/views/vyapari/terminal_staff/line_items/_form.html.erb +0 -40
- data/app/views/vyapari/terminal_staff/line_items/_index.html.erb +0 -96
- data/app/views/vyapari/terminal_staff/line_items/create.js.erb +0 -34
- data/app/views/vyapari/terminal_staff/line_items/destroy.js.erb +0 -25
- data/app/views/vyapari/user_dashboard/index.html.erb +0 -51
- data/db/import_data/brands.csv +0 -7
- data/db/import_data/categories.csv +0 -12
- data/db/import_data/countries.csv +0 -1
- data/db/import_data/dummy/brands.csv +0 -7
- data/db/import_data/dummy/categories.csv +0 -12
- data/db/import_data/dummy/countries.csv +0 -1
- data/db/import_data/dummy/exchange_rates.csv +0 -5
- data/db/import_data/dummy/products-copy.csv +0 -1
- data/db/import_data/dummy/products.csv +0 -1
- data/db/import_data/dummy/products.xlsx +0 -0
- data/db/import_data/dummy/regions.csv +0 -13
- data/db/import_data/dummy/stores.csv +0 -10
- data/db/import_data/dummy/suppliers.csv +0 -14
- data/db/import_data/dummy/terminals.csv +0 -11
- data/db/import_data/exchange_rates.csv +0 -5
- data/db/import_data/regions.csv +0 -13
- data/db/import_data/stores.csv +0 -3
- data/db/import_data/suppliers.csv +0 -14
- data/db/import_data/terminals.csv +0 -3
- data/db/migrate/20170000000203_create_contacts.rb +0 -22
- data/db/migrate/20170000000204_create_bank_accounts.rb +0 -21
- data/db/migrate/20170000000205_create_suppliers.rb +0 -18
- data/db/migrate/20170000000206_create_stores.rb +0 -21
- data/db/migrate/20170000000207_create_terminals.rb +0 -18
- data/db/migrate/20170000000210_create_brands.rb +0 -14
- data/db/migrate/20170000000211_create_categories.rb +0 -22
- data/db/migrate/20170000000212_create_products.rb +0 -29
- data/db/migrate/20170000000213_create_invoices.rb +0 -61
- data/db/migrate/20170000000215_create_stock_bundles.rb +0 -17
- data/db/migrate/20170000000216_create_stock_entries.rb +0 -20
- data/db/sample_reports/products.xlsx +0 -0
- data/lib/tasks/vyapari/all.rake +0 -73
@@ -1,64 +0,0 @@
|
|
1
|
-
<div class="row calendar-env">
|
2
|
-
<div class="col-md-12 text-center">
|
3
|
-
<div class="btn-group" style="margin:auto;">
|
4
|
-
|
5
|
-
<%= link_to raw("<i class=\"fa fa-arrow-left\"></i>"), store_manager_dashboard_path(@store, date: (@date - 1.day)), class: "btn btn-white", style: "font-size: 20px;" %>
|
6
|
-
|
7
|
-
<input type="text" name="reportdate" value="<%= @date.strftime("%m-%d-%Y") %>" class="btn btn-white" style="height:42px;" />
|
8
|
-
|
9
|
-
<%= link_to raw("<i class=\"fa fa-arrow-right\"></i>"), store_manager_dashboard_path(@store, date: (@date + 1.day)), class: "btn btn-white", style: "font-size: 20px;" %>
|
10
|
-
</div>
|
11
|
-
</div>
|
12
|
-
</div>
|
13
|
-
|
14
|
-
<script type="text/javascript">
|
15
|
-
$(function() {
|
16
|
-
|
17
|
-
$('input[name="reportdate"]').daterangepicker({
|
18
|
-
singleDatePicker: true,
|
19
|
-
showDropdowns: true
|
20
|
-
},
|
21
|
-
|
22
|
-
function(start, end, label) {
|
23
|
-
var urlWithoutParams = location.protocol + '//' + location.host + location.pathname;
|
24
|
-
var params = { locale:'en', date:start.format('DD-MM-YYYY') };
|
25
|
-
var dateParam = jQuery.param(params);
|
26
|
-
window.location.href = urlWithoutParams + "?" + dateParam;
|
27
|
-
});
|
28
|
-
});
|
29
|
-
</script>
|
30
|
-
|
31
|
-
<div class="row mt-40 mb-40">
|
32
|
-
<div class="col-sm-12">
|
33
|
-
<h3>Sales Summary</h3>
|
34
|
-
</div>
|
35
|
-
</div>
|
36
|
-
|
37
|
-
<div id="div_store_dashboard_sales_counts">
|
38
|
-
<%= render :partial=>"vyapari/store_manager/dashboard/sales_counts" -%>
|
39
|
-
</div>
|
40
|
-
|
41
|
-
<div class="row mt-40 mb-40">
|
42
|
-
<div class="col-sm-6">
|
43
|
-
<h3>Stock Summary</h3>
|
44
|
-
</div>
|
45
|
-
<div class="col-sm-6">
|
46
|
-
<%= link_to raw("<i class=\"fa-truck mr-10\"></i> View Stock"), store_manager_stock_entries_path(@store), class: "btn btn-primary pull-right ml-10 mt-20" %>
|
47
|
-
<%= link_to raw("<i class=\"fa-upload mr-10\"></i> Import Stock"), store_manager_stock_bundles_path(@store), class: "btn btn-secondary pull-right mt-20" %>
|
48
|
-
</div>
|
49
|
-
</div>
|
50
|
-
|
51
|
-
|
52
|
-
<div id="div_store_dashboard_stock_counts">
|
53
|
-
<%= render :partial=>"vyapari/store_manager/dashboard/stock_counts" -%>
|
54
|
-
</div>
|
55
|
-
|
56
|
-
<div class="row mt-40 mb-40">
|
57
|
-
<div class="col-sm-12">
|
58
|
-
<h3>Terminals</h3>
|
59
|
-
</div>
|
60
|
-
</div>
|
61
|
-
|
62
|
-
<div id="div_store_dashboard_terminals" class="mb-100">
|
63
|
-
<%= render :partial=>"vyapari/store_manager/dashboard/terminals" -%>
|
64
|
-
</div>
|
@@ -1,65 +0,0 @@
|
|
1
|
-
<div class="table-responsive table-scrollable">
|
2
|
-
<table class="table table-striped table-condensed table-bordered">
|
3
|
-
<thead>
|
4
|
-
<tr>
|
5
|
-
<% @columns.each do |col_item| %>
|
6
|
-
<% next unless @selected_columns.include?(col_item[:column_name]) %>
|
7
|
-
<th style="text-align: center;"><%= col_item[:display_name] %></th>
|
8
|
-
<% end %>
|
9
|
-
</tr>
|
10
|
-
</thead>
|
11
|
-
<tbody>
|
12
|
-
|
13
|
-
<% cols_except_id = @columns.reject{|item| item[:column_name] == :id}.select{|item| @selected_columns.include?(item[:column_name]) } %>
|
14
|
-
|
15
|
-
<% @results.each_with_index do |result, i| %>
|
16
|
-
<tr>
|
17
|
-
<th scope="row" style="text-align: center;"><%= i + 1 %></th>
|
18
|
-
|
19
|
-
<% cols_except_id.each do |col_item| %>
|
20
|
-
|
21
|
-
<% case col_item[:column_type] %>
|
22
|
-
<% when :string, :integer %>
|
23
|
-
<td style="text-align: <%= col_item[:align] %>;">
|
24
|
-
<%= result.send(col_item[:column_name]) %>
|
25
|
-
</td>
|
26
|
-
<% when :status %>
|
27
|
-
<td style="text-align: <%= col_item[:align] %>;">
|
28
|
-
<%= result.send(col_item[:column_name]).titleize %>
|
29
|
-
</td>
|
30
|
-
<% when :currency %>
|
31
|
-
<td style="text-align: <%= col_item[:align] %>;">
|
32
|
-
<%= number_to_currency(result.send(col_item[:column_name]), unit: "") %>
|
33
|
-
</td>
|
34
|
-
<% when :date %>
|
35
|
-
<td style="text-align: <%= col_item[:align] %>;"><%= result.send(col_item[:column_name]).strftime("%d-%m-%Y") %>
|
36
|
-
</td>
|
37
|
-
<% else %>
|
38
|
-
<td style="text-align: <%= col_item[:align] %>;"><%= result.send(col_item[:column_name]) %>
|
39
|
-
</td>
|
40
|
-
<% end %>
|
41
|
-
|
42
|
-
<% end %>
|
43
|
-
|
44
|
-
</tr>
|
45
|
-
<% end %>
|
46
|
-
|
47
|
-
</tbody>
|
48
|
-
|
49
|
-
<tfoot>
|
50
|
-
<% if @total && @total.first && @total.first.net_total_amount %>
|
51
|
-
<tr>
|
52
|
-
<td></td>
|
53
|
-
<% cols_except_id.each do |col_item| %>
|
54
|
-
<% if col_item[:column_name] == :net_total_amount %>
|
55
|
-
<td style="font-weight: bold;text-align: <%= col_item[:align] %>;"><%= number_to_currency @total.first.net_total_amount.to_s, unit: "AED " %></td>
|
56
|
-
<% else %>
|
57
|
-
<td></td>
|
58
|
-
<% end %>
|
59
|
-
<% end %>
|
60
|
-
</tr>
|
61
|
-
<% end %>
|
62
|
-
</tfoot>
|
63
|
-
|
64
|
-
</table>
|
65
|
-
</div>
|
@@ -1,105 +0,0 @@
|
|
1
|
-
<div class="row">
|
2
|
-
|
3
|
-
<!-- Action Buttons -->
|
4
|
-
<div class="col-md-12">
|
5
|
-
<a href="#" class="btn btn-primary pull-right mr-10" onclick="$('#div_report_filter_list').toggle();"><i class='fa-filter mr-10'></i></a>
|
6
|
-
|
7
|
-
<a href="#" class="btn btn-primary pull-right mr-10" onclick="$('#div_report_column_select').toggle();"><i class='fa-barcode mr-10'></i></a>
|
8
|
-
|
9
|
-
<%
|
10
|
-
csv_hash = {store_id: @store.id, format: :csv}
|
11
|
-
csv_hash.merge!(request.query_parameters.reject{ |x| x == 'locale' })
|
12
|
-
export_url = store_manager_invoices_report_path(csv_hash)
|
13
|
-
|
14
|
-
form_hash = {store_id: @store.id}
|
15
|
-
form_hash.merge!(request.query_parameters.reject{ |x| x == 'locale' })
|
16
|
-
form_url = store_manager_invoices_report_path(form_hash)
|
17
|
-
%>
|
18
|
-
|
19
|
-
<%= link_to raw("<i class='fa-excel-o'></i> Export"), export_url, class: "btn btn-primary pull-left mr-10" %>
|
20
|
-
|
21
|
-
<%= clear_tag %>
|
22
|
-
</div>
|
23
|
-
|
24
|
-
<!-- Filters -->
|
25
|
-
<div class="col-md-12">
|
26
|
-
<div id="div_report_column_select" style="padding:10px; border: 2px solid #fff; margin-bottom: 10px; display: none;">
|
27
|
-
|
28
|
-
<%= form_tag(form_url, :method => :get ) do %>
|
29
|
-
|
30
|
-
<div class="mb-20 pull-left" style="font-size:16px; color: darkred; text-align: left;">Selected Columns</div>
|
31
|
-
|
32
|
-
<%= submit_tag "Apply", class: "btn btn-primary pull-right mr-10" %>
|
33
|
-
|
34
|
-
<%= clear_tag %>
|
35
|
-
|
36
|
-
<div class="mb-20 pull-left" style="font-size:12px; color: #4b4b4b; text-align: left;">Click items on the left box to select. Selected items will appear on the right box.</div>
|
37
|
-
|
38
|
-
<select class="form-control" multiple="multiple" id="select-columns" name="cols[]">
|
39
|
-
<% @columns.each do |item| %>
|
40
|
-
<option value="<%= item[:column_name] %>" <%= @selected_columns.include?(item[:column_name]) ? 'selected="selected"' : '' %> ><%= item[:display_name] %></option>
|
41
|
-
<% end %>
|
42
|
-
</select>
|
43
|
-
|
44
|
-
<% end %>
|
45
|
-
|
46
|
-
</div>
|
47
|
-
</div>
|
48
|
-
|
49
|
-
<div class="col-md-12">
|
50
|
-
<div id="div_report_filter_list" style="padding:10px; border: 2px solid #fff; margin-bottom: 10px; display: none;">
|
51
|
-
<%= render :partial=>"kuppayam/filters/display_filters" %>
|
52
|
-
<hr style="border-top:1px solid #fff;">
|
53
|
-
<%= render :partial=>"kuppayam/filters/display_dropdown_filters" %>
|
54
|
-
</div>
|
55
|
-
</div>
|
56
|
-
</div>
|
57
|
-
|
58
|
-
<div class="row">
|
59
|
-
<div class="col-md-12">
|
60
|
-
<div class="panel panel-default" style="width:100%">
|
61
|
-
<div class="panel-body">
|
62
|
-
|
63
|
-
<%= clear_tag(10) %>
|
64
|
-
|
65
|
-
<div id="div_report_index">
|
66
|
-
<%#= render :partial=>"/reports/company_jpr/chart" %>
|
67
|
-
<%#= clear_tag(100) %>
|
68
|
-
<%= render :partial=>"vyapari/store_manager/reports/invoices/index" %>
|
69
|
-
</div>
|
70
|
-
<%= clear_tag(10) %>
|
71
|
-
|
72
|
-
</div>
|
73
|
-
</div>
|
74
|
-
</div>
|
75
|
-
</div>
|
76
|
-
|
77
|
-
<script type="text/javascript">
|
78
|
-
|
79
|
-
function applySelectedColumns(){
|
80
|
-
var selectedColumns = "";
|
81
|
-
|
82
|
-
$.each($("#select-columns option:selected"), function(){
|
83
|
-
selectedColumns = selectedColumns + "cols[]=" + $(this).val() + "&";
|
84
|
-
});
|
85
|
-
|
86
|
-
var uri = window.location.href.split("#")[0];
|
87
|
-
window.location.href = uri + selectedColumns;
|
88
|
-
}
|
89
|
-
|
90
|
-
jQuery(document).ready(function($)
|
91
|
-
{
|
92
|
-
$("#select-columns").multiSelect({
|
93
|
-
afterInit: function()
|
94
|
-
{
|
95
|
-
// Add alternative scrollbar to list
|
96
|
-
this.$selectableContainer.add(this.$selectionContainer).find('.ms-list').perfectScrollbar();
|
97
|
-
},
|
98
|
-
afterSelect: function()
|
99
|
-
{
|
100
|
-
// Update scrollbar size
|
101
|
-
this.$selectableContainer.add(this.$selectionContainer).find('.ms-list').perfectScrollbar('update');
|
102
|
-
}
|
103
|
-
});
|
104
|
-
});
|
105
|
-
</script>
|
@@ -1,64 +0,0 @@
|
|
1
|
-
<div class="table-responsive table-scrollable">
|
2
|
-
<table class="table table-striped table-condensed table-bordered">
|
3
|
-
<thead>
|
4
|
-
<tr>
|
5
|
-
<% @columns.each do |col_item| %>
|
6
|
-
<% next unless @selected_columns.include?(col_item[:column_name]) %>
|
7
|
-
<th style="text-align: center;"><%= col_item[:display_name] %></th>
|
8
|
-
<% end %>
|
9
|
-
</tr>
|
10
|
-
</thead>
|
11
|
-
<tbody>
|
12
|
-
|
13
|
-
<% cols_except_id = @columns.reject{|item| item[:column_name] == :id}.select{|item| @selected_columns.include?(item[:column_name]) } %>
|
14
|
-
|
15
|
-
<% @results.each_with_index do |result, i| %>
|
16
|
-
<tr>
|
17
|
-
<th scope="row" style="text-align: center;"><%= i + 1 %></th>
|
18
|
-
|
19
|
-
<% cols_except_id.each do |col_item| %>
|
20
|
-
|
21
|
-
<% case col_item[:column_type] %>
|
22
|
-
<% when :string, :integer %>
|
23
|
-
<td style="text-align: <%= col_item[:align] %>;">
|
24
|
-
<%= result.send(col_item[:column_name]) %>
|
25
|
-
</td>
|
26
|
-
<% when :status %>
|
27
|
-
<td style="text-align: <%= col_item[:align] %>;">
|
28
|
-
<%= result.send(col_item[:column_name]).titleize %>
|
29
|
-
</td>
|
30
|
-
<% when :currency %>
|
31
|
-
<td style="text-align: <%= col_item[:align] %>;">
|
32
|
-
<%= number_to_currency(result.send(col_item[:column_name]), unit: "") %>
|
33
|
-
</td>
|
34
|
-
<% when :date %>
|
35
|
-
<td style="text-align: <%= col_item[:align] %>;"><%= result.send(col_item[:column_name]).strftime("%d-%m-%Y") %>
|
36
|
-
</td>
|
37
|
-
<% else %>
|
38
|
-
<td style="text-align: <%= col_item[:align] %>;"><%= result.send(col_item[:column_name]) %>
|
39
|
-
</td>
|
40
|
-
<% end %>
|
41
|
-
|
42
|
-
<% end %>
|
43
|
-
|
44
|
-
</tr>
|
45
|
-
<% end %>
|
46
|
-
|
47
|
-
</tbody>
|
48
|
-
|
49
|
-
<tfoot>
|
50
|
-
<% if @total && @total.first && @total.first.retail_price %>
|
51
|
-
<tr>
|
52
|
-
<td></td>
|
53
|
-
<% cols_except_id.each do |col_item| %>
|
54
|
-
<% if col_item[:column_name] == :retail_price %>
|
55
|
-
<td style="font-weight: bold;text-align: <%= col_item[:align] %>;"><%= number_to_currency @total.first.retail_price.to_s, unit: "AED " %></td>
|
56
|
-
<% else %>
|
57
|
-
<td></td>
|
58
|
-
<% end %>
|
59
|
-
<% end %>
|
60
|
-
</tr>
|
61
|
-
<% end %>
|
62
|
-
</tfoot>
|
63
|
-
</table>
|
64
|
-
</div>
|
@@ -1,105 +0,0 @@
|
|
1
|
-
<div class="row">
|
2
|
-
|
3
|
-
<!-- Action Buttons -->
|
4
|
-
<div class="col-md-12">
|
5
|
-
<a href="#" class="btn btn-primary pull-right mr-10" onclick="$('#div_report_filter_list').toggle();"><i class='fa-filter mr-10'></i></a>
|
6
|
-
|
7
|
-
<a href="#" class="btn btn-primary pull-right mr-10" onclick="$('#div_report_column_select').toggle();"><i class='fa-barcode mr-10'></i></a>
|
8
|
-
|
9
|
-
<%
|
10
|
-
csv_hash = {store_id: @store.id, format: :csv}
|
11
|
-
csv_hash.merge!(request.query_parameters.reject{ |x| x == 'locale' })
|
12
|
-
export_url = store_manager_sales_report_path(csv_hash)
|
13
|
-
|
14
|
-
form_hash = {store_id: @store.id}
|
15
|
-
form_hash.merge!(request.query_parameters.reject{ |x| x == 'locale' })
|
16
|
-
form_url = store_manager_sales_report_path(form_hash)
|
17
|
-
%>
|
18
|
-
|
19
|
-
<%= link_to raw("<i class='fa-excel-o'></i> Export"), export_url, class: "btn btn-primary pull-left mr-10" %>
|
20
|
-
|
21
|
-
<%= clear_tag %>
|
22
|
-
</div>
|
23
|
-
|
24
|
-
<!-- Filters -->
|
25
|
-
<div class="col-md-12">
|
26
|
-
<div id="div_report_column_select" style="padding:10px; border: 2px solid #fff; margin-bottom: 10px; display: none;">
|
27
|
-
|
28
|
-
<%= form_tag(form_url, :method => :get ) do %>
|
29
|
-
|
30
|
-
<div class="mb-20 pull-left" style="font-size:16px; color: darkred; text-align: left;">Selected Columns</div>
|
31
|
-
|
32
|
-
<%= submit_tag "Apply", class: "btn btn-primary pull-right mr-10" %>
|
33
|
-
|
34
|
-
<%= clear_tag %>
|
35
|
-
|
36
|
-
<div class="mb-20 pull-left" style="font-size:12px; color: #4b4b4b; text-align: left;">Click items on the left box to select. Selected items will appear on the right box.</div>
|
37
|
-
|
38
|
-
<select class="form-control" multiple="multiple" id="select-columns" name="cols[]">
|
39
|
-
<% @columns.each do |item| %>
|
40
|
-
<option value="<%= item[:column_name] %>" <%= @selected_columns.include?(item[:column_name]) ? 'selected="selected"' : '' %> ><%= item[:display_name] %></option>
|
41
|
-
<% end %>
|
42
|
-
</select>
|
43
|
-
|
44
|
-
<% end %>
|
45
|
-
|
46
|
-
</div>
|
47
|
-
</div>
|
48
|
-
|
49
|
-
<div class="col-md-12">
|
50
|
-
<div id="div_report_filter_list" style="padding:10px; border: 2px solid #fff; margin-bottom: 10px; display: none;">
|
51
|
-
<%= render :partial=>"kuppayam/filters/display_filters" %>
|
52
|
-
<hr style="border-top:1px solid #fff;">
|
53
|
-
<%= render :partial=>"kuppayam/filters/display_dropdown_filters" %>
|
54
|
-
</div>
|
55
|
-
</div>
|
56
|
-
</div>
|
57
|
-
|
58
|
-
<div class="row">
|
59
|
-
<div class="col-md-12">
|
60
|
-
<div class="panel panel-default" style="width:100%">
|
61
|
-
<div class="panel-body">
|
62
|
-
|
63
|
-
<%= clear_tag(10) %>
|
64
|
-
|
65
|
-
<div id="div_report_index">
|
66
|
-
<%#= render :partial=>"/reports/company_jpr/chart" %>
|
67
|
-
<%#= clear_tag(100) %>
|
68
|
-
<%= render :partial=>"vyapari/store_manager/reports/sales/index" %>
|
69
|
-
</div>
|
70
|
-
<%= clear_tag(10) %>
|
71
|
-
|
72
|
-
</div>
|
73
|
-
</div>
|
74
|
-
</div>
|
75
|
-
</div>
|
76
|
-
|
77
|
-
<script type="text/javascript">
|
78
|
-
|
79
|
-
function applySelectedColumns(){
|
80
|
-
var selectedColumns = "";
|
81
|
-
|
82
|
-
$.each($("#select-columns option:selected"), function(){
|
83
|
-
selectedColumns = selectedColumns + "cols[]=" + $(this).val() + "&";
|
84
|
-
});
|
85
|
-
|
86
|
-
var uri = window.location.href.split("#")[0];
|
87
|
-
window.location.href = uri + selectedColumns;
|
88
|
-
}
|
89
|
-
|
90
|
-
jQuery(document).ready(function($)
|
91
|
-
{
|
92
|
-
$("#select-columns").multiSelect({
|
93
|
-
afterInit: function()
|
94
|
-
{
|
95
|
-
// Add alternative scrollbar to list
|
96
|
-
this.$selectableContainer.add(this.$selectionContainer).find('.ms-list').perfectScrollbar();
|
97
|
-
},
|
98
|
-
afterSelect: function()
|
99
|
-
{
|
100
|
-
// Update scrollbar size
|
101
|
-
this.$selectableContainer.add(this.$selectionContainer).find('.ms-list').perfectScrollbar('update');
|
102
|
-
}
|
103
|
-
});
|
104
|
-
});
|
105
|
-
</script>
|
@@ -1,72 +0,0 @@
|
|
1
|
-
<div class="table-responsive table-scrollable">
|
2
|
-
<table class="table table-striped table-condensed table-bordered">
|
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
|
-
<tbody>
|
18
|
-
|
19
|
-
<%# filters_to_add = {permalink: @current_company_group.permalink, code: @current_company.code } %>
|
20
|
-
|
21
|
-
<%# short_filters = generate_short_url_filters(@filters, filters_to_add, [:store, :terminal]) %>
|
22
|
-
|
23
|
-
<%#= link_to item.name, jobs_path(short_filters.merge(br: item.id)), target: :blank %>
|
24
|
-
|
25
|
-
<% @results.each_with_index do |item, i| %>
|
26
|
-
<tr>
|
27
|
-
<th scope="row" style="text-align: center;"><%= i + 1 + (@per_page.to_i * (@current_page.to_i - 1)) %></th>
|
28
|
-
|
29
|
-
<td>
|
30
|
-
<%= link_to item.name, "#", target: :blank %>
|
31
|
-
</td>
|
32
|
-
|
33
|
-
<td>
|
34
|
-
<%= item.ean_sku %>
|
35
|
-
</td>
|
36
|
-
|
37
|
-
<td style="text-align: right;"><%= number_to_currency item.purchased_price, unit: "AED " %></td>
|
38
|
-
|
39
|
-
<td style="text-align: right;"><%= number_to_currency item.landed_price, unit: "AED " %></td>
|
40
|
-
|
41
|
-
<td style="text-align: right;"><%= number_to_currency item.selling_price, unit: "AED " %></td>
|
42
|
-
|
43
|
-
<td style="text-align: right;"><%= number_to_currency item.retail_price, unit: "AED " %></td>
|
44
|
-
|
45
|
-
<td>
|
46
|
-
<%#= item.se_quantity %>
|
47
|
-
</td>
|
48
|
-
|
49
|
-
<td>
|
50
|
-
<%#= item.se_status %>
|
51
|
-
</td>
|
52
|
-
|
53
|
-
</tr>
|
54
|
-
<% end %>
|
55
|
-
</tbody>
|
56
|
-
<tfoot>
|
57
|
-
<% if @total && @total.first && @total.first.purchased_price %>
|
58
|
-
<tr>
|
59
|
-
<td></td>
|
60
|
-
<td></td>
|
61
|
-
<td></td>
|
62
|
-
<td style="font-weight: bold;text-align: right;"><%= number_to_currency @total.first.purchased_price.to_s, unit: "AED " %></td>
|
63
|
-
<td style="font-weight: bold;text-align: right;"><%= number_to_currency @total.first.landed_price.to_s, unit: "AED " %></td>
|
64
|
-
<td style="font-weight: bold;text-align: right;"><%= number_to_currency @total.first.selling_price.to_s, unit: "AED " %></td>
|
65
|
-
<td style="font-weight: bold;text-align: right;"><%= number_to_currency @total.first.retail_price.to_s, unit: "AED " %></td>
|
66
|
-
<td></td>
|
67
|
-
<td></td>
|
68
|
-
</tr>
|
69
|
-
<% end %>
|
70
|
-
</tfoot>
|
71
|
-
</table>
|
72
|
-
</div>
|