vyapari 0.1.4 → 0.1.5dev
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/images/vyapari/sample_stock_bundle.csv +1 -0
- data/app/controllers/vyapari/admin/base_controller.rb +10 -0
- data/app/controllers/vyapari/admin/brands_controller.rb +99 -0
- data/app/controllers/vyapari/admin/categories_controller.rb +115 -0
- data/app/controllers/vyapari/admin/countries_controller.rb +2 -2
- data/app/controllers/vyapari/admin/dashboard_controller.rb +3 -1
- data/app/controllers/vyapari/admin/exchange_rates_controller.rb +2 -2
- data/app/controllers/vyapari/admin/products_controller.rb +79 -0
- data/app/controllers/vyapari/admin/regions_controller.rb +1 -1
- data/app/controllers/vyapari/admin/resource_controller.rb +1 -0
- data/app/controllers/vyapari/admin/stores_controller.rb +67 -0
- data/app/controllers/vyapari/admin/suppliers_controller.rb +67 -0
- data/app/controllers/vyapari/admin/terminals_controller.rb +150 -0
- data/app/controllers/vyapari/application_controller.rb +12 -0
- data/app/controllers/vyapari/store_manager/base_controller.rb +28 -0
- data/app/controllers/vyapari/store_manager/dashboard_controller.rb +30 -0
- data/app/controllers/vyapari/store_manager/resource_controller.rb +17 -0
- data/app/controllers/vyapari/store_manager/stock_bundles_controller.rb +206 -0
- data/app/controllers/vyapari/store_manager/stock_entries_controller.rb +161 -0
- data/app/controllers/vyapari/terminal_staff/base_controller.rb +29 -0
- data/app/controllers/vyapari/terminal_staff/dashboard_controller.rb +29 -0
- data/app/controllers/vyapari/terminal_staff/invoices_controller.rb +138 -0
- data/app/controllers/vyapari/terminal_staff/line_items_controller.rb +123 -0
- data/app/controllers/vyapari/terminal_staff/resource_controller.rb +17 -0
- data/app/controllers/vyapari/user_dashboard_controller.rb +31 -0
- data/app/models/brand.rb +63 -10
- data/app/models/category.rb +60 -16
- data/app/models/country.rb +27 -5
- data/app/models/exchange_rate.rb +31 -6
- data/app/models/image/brand_image.rb +3 -0
- data/app/models/image/category_image.rb +3 -0
- data/app/models/image/product_image.rb +3 -0
- data/app/models/invoice.rb +223 -0
- data/app/models/line_item.rb +206 -0
- data/app/models/product.rb +67 -13
- data/app/models/region.rb +26 -3
- data/app/models/stock_bundle.rb +249 -0
- data/app/models/stock_entry.rb +271 -0
- data/app/models/store.rb +216 -0
- data/app/models/supplier.rb +85 -0
- data/app/models/terminal.rb +158 -0
- data/app/models/vyapari/application_record.rb +4 -0
- data/app/uploaders/brand_image_uploader.rb +14 -0
- data/app/uploaders/category_image_uploader.rb +14 -0
- data/app/uploaders/product_image_uploader.rb +14 -0
- data/app/uploaders/stock_bundle_uploader.rb +10 -0
- data/app/views/layouts/kuppayam/_footer.html.erb +1 -1
- data/app/views/layouts/kuppayam/_sidebar.html.erb +45 -44
- data/app/views/layouts/vyapari/_store_manager_menu.html.erb +107 -0
- data/app/views/layouts/vyapari/_terminal_staff_menu.html.erb +103 -0
- data/app/views/layouts/vyapari/store_manager.html.erb +112 -0
- data/app/views/layouts/vyapari/terminal_staff.html.erb +116 -0
- data/app/views/vyapari/admin/brands/_form.html.erb +23 -0
- data/app/views/vyapari/admin/brands/_index.html.erb +89 -0
- data/app/views/vyapari/admin/brands/_row.html.erb +63 -0
- data/app/views/vyapari/admin/brands/_show.html.erb +104 -0
- data/app/views/vyapari/admin/brands/index.html.erb +48 -0
- data/app/views/vyapari/admin/categories/_form.html.erb +28 -0
- data/app/views/vyapari/admin/categories/_index.html.erb +101 -0
- data/app/views/vyapari/admin/categories/_row.html.erb +69 -0
- data/app/views/vyapari/admin/categories/_show.html.erb +115 -0
- data/app/views/vyapari/admin/{users → categories}/index.html.erb +8 -24
- data/app/views/vyapari/admin/countries/_index.html.erb +1 -1
- data/app/views/vyapari/admin/countries/index.html.erb +19 -3
- data/app/views/vyapari/admin/exchange_rates/_form.html.erb +3 -4
- 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 +1 -0
- data/app/views/vyapari/admin/exchange_rates/index.html.erb +19 -3
- data/app/views/vyapari/admin/products/_form.html.erb +32 -0
- data/app/views/vyapari/admin/products/_index.html.erb +58 -0
- data/app/views/vyapari/admin/products/_row.html.erb +30 -0
- data/app/views/vyapari/admin/products/_show.html.erb +81 -0
- data/app/views/vyapari/admin/products/index.html.erb +48 -0
- data/app/views/vyapari/admin/regions/_index.html.erb +1 -1
- data/app/views/vyapari/admin/regions/index.html.erb +19 -3
- data/app/views/vyapari/admin/stores/_form.html.erb +37 -0
- data/app/views/vyapari/admin/stores/_index.html.erb +84 -0
- data/app/views/vyapari/admin/stores/_row.html.erb +55 -0
- data/app/views/vyapari/admin/stores/_show.html.erb +110 -0
- data/app/views/vyapari/admin/stores/index.html.erb +48 -0
- data/app/views/vyapari/admin/suppliers/_form.html.erb +32 -0
- data/app/views/vyapari/admin/suppliers/_index.html.erb +58 -0
- data/app/views/vyapari/admin/suppliers/_row.html.erb +30 -0
- data/app/views/vyapari/admin/suppliers/_show.html.erb +81 -0
- data/app/views/vyapari/admin/suppliers/index.html.erb +48 -0
- data/app/views/vyapari/admin/terminals/_form.html.erb +24 -0
- data/app/views/vyapari/admin/terminals/_index.html.erb +75 -0
- data/app/views/vyapari/admin/terminals/_row.html.erb +49 -0
- data/app/views/vyapari/admin/terminals/_show.html.erb +74 -0
- data/app/views/vyapari/store_manager/dashboard/index.html.erb +93 -0
- data/app/views/vyapari/store_manager/stock_bundles/_form.html.erb +99 -0
- data/app/views/vyapari/store_manager/stock_bundles/_index.html.erb +74 -0
- data/app/views/vyapari/store_manager/stock_bundles/_row.html.erb +44 -0
- data/app/views/vyapari/store_manager/stock_bundles/_show.html.erb +110 -0
- data/app/views/vyapari/store_manager/stock_bundles/create.html.erb +57 -0
- data/app/views/vyapari/store_manager/stock_bundles/index.html.erb +36 -0
- data/app/views/vyapari/store_manager/stock_bundles/update.html.erb +57 -0
- data/app/views/vyapari/store_manager/stock_entries/_form.html.erb +50 -0
- data/app/views/vyapari/store_manager/stock_entries/_index.html.erb +80 -0
- data/app/views/vyapari/store_manager/stock_entries/_row.html.erb +33 -0
- data/app/views/vyapari/store_manager/stock_entries/_show.html.erb +110 -0
- data/app/views/vyapari/store_manager/stock_entries/_stock_bundle.html.erb +61 -0
- data/app/views/vyapari/store_manager/stock_entries/index.html.erb +45 -0
- data/app/views/vyapari/terminal_staff/dashboard/_counts.html.erb +88 -0
- data/app/views/vyapari/terminal_staff/dashboard/_invoices.html.erb +37 -0
- data/app/views/vyapari/terminal_staff/dashboard/index.html.erb +36 -0
- data/app/views/vyapari/terminal_staff/invoices/_draft.html.erb +62 -0
- data/app/views/vyapari/terminal_staff/invoices/_form.html.erb +120 -0
- data/app/views/vyapari/terminal_staff/invoices/_index.html.erb +64 -0
- data/app/views/vyapari/terminal_staff/invoices/_row.html.erb +33 -0
- data/app/views/vyapari/terminal_staff/invoices/_show.html.erb +171 -0
- data/app/views/vyapari/terminal_staff/invoices/index.html.erb +37 -0
- data/app/views/vyapari/terminal_staff/invoices/new.js.erb +13 -0
- data/app/views/vyapari/terminal_staff/invoices/show.html.erb +1 -0
- data/app/views/vyapari/terminal_staff/line_items/_form.html.erb +40 -0
- data/app/views/vyapari/terminal_staff/line_items/_index.html.erb +94 -0
- data/app/views/vyapari/terminal_staff/line_items/create.js.erb +34 -0
- data/app/views/vyapari/terminal_staff/line_items/destroy.js.erb +25 -0
- data/app/views/vyapari/terminal_staff/stores/index.html.erb +24 -0
- data/app/views/vyapari/user_dashboard/index.html.erb +51 -0
- data/config/routes.rb +62 -5
- data/db/import_data/brands.csv +7 -0
- data/db/import_data/categories.csv +12 -0
- data/db/import_data/countries.csv +1 -0
- data/db/import_data/dummy/brands.csv +7 -0
- data/db/import_data/dummy/categories.csv +12 -0
- data/db/import_data/dummy/countries.csv +1 -0
- data/db/import_data/dummy/exchange_rates.csv +5 -0
- data/db/import_data/dummy/products-copy.csv +1 -0
- data/db/import_data/dummy/products.csv +1 -0
- data/db/import_data/dummy/products.xlsx +0 -0
- data/db/import_data/dummy/regions.csv +13 -0
- data/db/import_data/dummy/stores.csv +10 -0
- data/db/import_data/dummy/suppliers.csv +14 -0
- data/db/import_data/dummy/terminals.csv +11 -0
- data/db/import_data/exchange_rates.csv +5 -0
- data/db/import_data/regions.csv +13 -0
- data/db/import_data/stores.csv +3 -0
- data/db/import_data/suppliers.csv +14 -0
- data/db/import_data/terminals.csv +3 -0
- data/db/migrate/20170000000200_create_exchange_rates.rb +3 -2
- data/db/migrate/20170000000203_create_contacts.rb +22 -0
- data/db/migrate/20170000000204_create_bank_accounts.rb +21 -0
- data/db/migrate/20170000000205_create_suppliers.rb +18 -0
- data/db/migrate/20170000000206_create_stores.rb +21 -0
- data/db/migrate/20170000000207_create_terminals.rb +18 -0
- data/db/migrate/20170000000210_create_brands.rb +14 -0
- data/db/migrate/20170000000211_create_categories.rb +22 -0
- data/db/migrate/20170000000212_create_products.rb +29 -0
- data/db/migrate/20170000000213_create_invoices.rb +58 -0
- data/db/migrate/20170000000215_create_stock_bundles.rb +17 -0
- data/db/migrate/20170000000216_create_stock_entries.rb +20 -0
- data/db/sample_reports/products.xlsx +0 -0
- data/lib/tasks/vyapari/all.rake +73 -0
- data/lib/vyapari/version.rb +1 -1
- metadata +150 -15
- data/app/controllers/vyapari/admin/users_controller.rb +0 -130
- data/app/views/vyapari/admin/users/_form.html.erb +0 -39
- data/app/views/vyapari/admin/users/_index.html.erb +0 -101
- data/app/views/vyapari/admin/users/_row.html.erb +0 -72
- data/app/views/vyapari/admin/users/_show.html.erb +0 -199
- data/lib/tasks/vyapari_tasks.rake +0 -4
@@ -0,0 +1,110 @@
|
|
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>
|
@@ -0,0 +1,61 @@
|
|
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>
|
@@ -0,0 +1,45 @@
|
|
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>
|
@@ -0,0 +1,88 @@
|
|
1
|
+
<%
|
2
|
+
active_invoices = @terminal.invoices.active.count
|
3
|
+
draft_invoices = @terminal.invoices.draft.count
|
4
|
+
active_amount = @terminal.invoices.active.sum(:total_amount)
|
5
|
+
draft_amount = @terminal.invoices.draft.sum(:total_amount)
|
6
|
+
cash_invoices = @terminal.invoices.active.where(payment_method: :cash).count
|
7
|
+
cash_in_hand = 100
|
8
|
+
total_sales = 100
|
9
|
+
%>
|
10
|
+
|
11
|
+
<div class="row">
|
12
|
+
<div class="col-sm-3">
|
13
|
+
<%= link_to raw("<i class=\"fa-book mr-10\"></i> Create Invoice"), new_terminal_staff_invoice_path(@store), remote: true, class: "btn btn-success btn-lg btn-block", style: "height:50px" %>
|
14
|
+
|
15
|
+
<%= link_to raw("<i class=\"fa-book mr-10\"></i> Manage Invoice"), terminal_staff_invoices_path, class: "btn btn-primary btn-only-hover btn-lg btn-block", style: "height:50px" %>
|
16
|
+
</div>
|
17
|
+
|
18
|
+
<div class="col-sm-3">
|
19
|
+
|
20
|
+
<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">
|
21
|
+
<div class="xe-upper">
|
22
|
+
|
23
|
+
<div class="xe-icon">
|
24
|
+
<i class="fa-money"></i>
|
25
|
+
</div>
|
26
|
+
<div class="xe-label">
|
27
|
+
<strong class="num"><%= number_to_currency cash_in_hand, unit: "AED " %></strong>
|
28
|
+
<span>Cash In Hand</span>
|
29
|
+
</div>
|
30
|
+
|
31
|
+
</div>
|
32
|
+
<div class="xe-lower">
|
33
|
+
<div class="border"></div>
|
34
|
+
|
35
|
+
<span>Total Cash Invoices</span>
|
36
|
+
<strong><%= cash_invoices %></strong>
|
37
|
+
</div>
|
38
|
+
</div>
|
39
|
+
</div>
|
40
|
+
|
41
|
+
<div class="col-sm-3">
|
42
|
+
|
43
|
+
<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">
|
44
|
+
<div class="xe-upper">
|
45
|
+
|
46
|
+
<div class="xe-icon">
|
47
|
+
<i class="fa-floppy-o"></i>
|
48
|
+
</div>
|
49
|
+
<div class="xe-label">
|
50
|
+
<strong class="num"><%= active_invoices %></strong>
|
51
|
+
<span>Invoices Created</span>
|
52
|
+
</div>
|
53
|
+
|
54
|
+
</div>
|
55
|
+
<div class="xe-lower">
|
56
|
+
<div class="border"></div>
|
57
|
+
|
58
|
+
<span>Total Amount Billed</span>
|
59
|
+
<strong><%= number_to_currency active_amount, unit: "AED " %></strong>
|
60
|
+
</div>
|
61
|
+
</div>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<div class="col-sm-3">
|
65
|
+
|
66
|
+
<div class="xe-widget xe-counter-block xe-counter-block-gray" data-suffix="k" data-count=".num" data-from="0" data-to="310" data-duration="4" data-easing="false">
|
67
|
+
<div class="xe-upper">
|
68
|
+
|
69
|
+
<div class="xe-icon">
|
70
|
+
<i class="fa-pencil-square-o"></i>
|
71
|
+
</div>
|
72
|
+
<div class="xe-label">
|
73
|
+
<strong class="num"><%= draft_invoices %></strong>
|
74
|
+
<span>Draft Invoices</span>
|
75
|
+
</div>
|
76
|
+
|
77
|
+
</div>
|
78
|
+
<div class="xe-lower">
|
79
|
+
<div class="border"></div>
|
80
|
+
|
81
|
+
<span>Total Amount Un-Billed</span>
|
82
|
+
<strong><%= number_to_currency draft_amount, unit: "AED " %></strong>
|
83
|
+
</div>
|
84
|
+
</div>
|
85
|
+
</div>
|
86
|
+
|
87
|
+
|
88
|
+
</div>
|
@@ -0,0 +1,37 @@
|
|
1
|
+
<div class="table-responsive">
|
2
|
+
<table class="table table-hover members-table middle-align">
|
3
|
+
<thead>
|
4
|
+
<tr>
|
5
|
+
<th>Invoice Number</th>
|
6
|
+
<th>Customer</th>
|
7
|
+
<th>Date</th>
|
8
|
+
<th style="text-align: right;">Total Amount</th>
|
9
|
+
</tr>
|
10
|
+
</thead>
|
11
|
+
|
12
|
+
<tbody>
|
13
|
+
<% invoices.each_with_index do |invoice, i| %>
|
14
|
+
|
15
|
+
<tr id="tr_invoice_<%= invoice.id %>">
|
16
|
+
|
17
|
+
<td class="invoice-name"><%= link_to invoice.invoice_number, terminal_staff_invoice_path(@terminal, invoice), remote: true %></td>
|
18
|
+
|
19
|
+
<% customer_name = invoice.customer_name || "CUST-#{invoice.id}" %>
|
20
|
+
<td class="invoice-name"><%= link_to customer_name, terminal_staff_invoice_path(@terminal, invoice), remote: true %></td>
|
21
|
+
|
22
|
+
<td class="invoice-name" style="text-align: center;"><%= invoice.invoice_date.strftime("%m/%d/%Y") if invoice.invoice_date %></td>
|
23
|
+
|
24
|
+
<td class="invoice-name" style="text-align: center;"><%= number_to_currency invoice.total_amount, unit: "" %></td>
|
25
|
+
|
26
|
+
</tr>
|
27
|
+
<% end %>
|
28
|
+
</tbody>
|
29
|
+
</table>
|
30
|
+
</div>
|
31
|
+
|
32
|
+
<div class="row">
|
33
|
+
<div class="col-sm-12">
|
34
|
+
<%= paginate_kuppayam(invoices) %>
|
35
|
+
</div>
|
36
|
+
</div>
|
37
|
+
|
@@ -0,0 +1,36 @@
|
|
1
|
+
<%= render :partial=>"vyapari/terminal_staff/dashboard/counts" -%>
|
2
|
+
|
3
|
+
<div class="row">
|
4
|
+
<div class="col-md-6">
|
5
|
+
<div class="panel panel-color panel-blue">
|
6
|
+
|
7
|
+
<div class="panel-heading">
|
8
|
+
<h3 class="panel-title">Saved Invoices</h3>
|
9
|
+
</div>
|
10
|
+
|
11
|
+
<div class="panel-body">
|
12
|
+
<!-- Active Invoices -->
|
13
|
+
<% active_invoices = @terminal.invoices.active.order("created_at DESC").page(1).per(10) %>
|
14
|
+
<%= render :partial=>"vyapari/terminal_staff/dashboard/invoices", locals: { invoices: active_invoices } -%>
|
15
|
+
</div>
|
16
|
+
</div>
|
17
|
+
</div>
|
18
|
+
|
19
|
+
<div class="col-md-6">
|
20
|
+
<div class="panel panel-color panel-gray">
|
21
|
+
|
22
|
+
<div class="panel-heading">
|
23
|
+
<h3 class="panel-title">Draft Invoices</h3>
|
24
|
+
</div>
|
25
|
+
|
26
|
+
<div class="panel-body">
|
27
|
+
<!-- Draft Invoices -->
|
28
|
+
<% draft_invoices = @terminal.invoices.draft.order("created_at DESC").page(1).per(10) %>
|
29
|
+
<%= render :partial=>"vyapari/terminal_staff/dashboard/invoices", locals: { invoices: draft_invoices } -%>
|
30
|
+
</div>
|
31
|
+
|
32
|
+
</div>
|
33
|
+
</div>
|
34
|
+
</div>
|
35
|
+
|
36
|
+
<%= clear_tag(60) %>
|
@@ -0,0 +1,62 @@
|
|
1
|
+
<% status_hash = {draft: "default", active: "success", cancelled: "danger"} %>
|
2
|
+
|
3
|
+
<div id="div_invoice_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(@invoice.invoice_number) %>
|
12
|
+
<%= clear_tag(5) %>
|
13
|
+
<span class="mt-15 label label-lg label-<%= status_hash[@invoice.status.to_sym] %>" style="font-size:14px;"><%= @invoice.status.titleize %></span>
|
14
|
+
<%= clear_tag(10) %>
|
15
|
+
|
16
|
+
<%= theme_panel_sub_heading(@invoice.terminal.try(:name), "#") %>
|
17
|
+
|
18
|
+
<%= theme_panel_sub_heading(@invoice.store.try(:name), "#") %>
|
19
|
+
|
20
|
+
<%= theme_panel_description(@invoice.invoice_date.strftime("%m/%d/%Y - %H:%M:%S")) %>
|
21
|
+
|
22
|
+
<%= theme_panel_description(@invoice.user.name) %>
|
23
|
+
|
24
|
+
<%= clear_tag(10) %>
|
25
|
+
|
26
|
+
<div class="visible-sm visible-xs mb-50"></div>
|
27
|
+
|
28
|
+
</div>
|
29
|
+
|
30
|
+
<div class="col-md-3 col-sm-12 col-xs-12">
|
31
|
+
|
32
|
+
<% print_link = edit_terminal_staff_invoice_path(@terminal, @invoice) %>
|
33
|
+
|
34
|
+
<% delete_link = terminal_staff_invoice_path(@terminal, @invoice) %>
|
35
|
+
|
36
|
+
<%= link_to raw("<i class=\"fa-print\"></i> Print Invoice"), print_link, :remote=>true, class: "btn btn-block btn-white" if @invoice.active? %>
|
37
|
+
|
38
|
+
<%= link_to raw("<i class=\"linecons-trash\"></i> Delete"), delete_link, method: :delete, invoice: "menuitem", tabindex: "-1", data: { confirm: 'Are you sure?' }, :remote=>true, class: "btn btn-block btn-danger btn-only-hover" if @invoice.can_be_deleted? %>
|
39
|
+
|
40
|
+
<div class="visible-sm visible-xs mb-50"></div>
|
41
|
+
|
42
|
+
</div>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<%= clear_tag(50) %>
|
47
|
+
|
48
|
+
<div id="invoice_form_error">
|
49
|
+
<%= @invoice.errors[:base].to_sentence %>
|
50
|
+
<%= @line_item.errors[:base].to_sentence if @line_item %>
|
51
|
+
</div>
|
52
|
+
|
53
|
+
<div id="div_line_item_index" class="col-md-12" style="border: 1px solid #f1f1f1;">
|
54
|
+
<%= render :partial=>"vyapari/terminal_staff/line_items/index" %>
|
55
|
+
</div>
|
56
|
+
|
57
|
+
<div id="div_invoice_form" class="col-md-12 mb-10">
|
58
|
+
<%= render :partial=>"vyapari/terminal_staff/invoices/form" %>
|
59
|
+
</div>
|
60
|
+
|
61
|
+
<%= clear_tag %>
|
62
|
+
</div>
|
@@ -0,0 +1,120 @@
|
|
1
|
+
<%
|
2
|
+
|
3
|
+
url = url_for([:terminal_staff, @invoice, { terminal_id: @invoice.terminal_id}])
|
4
|
+
|
5
|
+
if @invoice.new_record?
|
6
|
+
http_method = :post
|
7
|
+
else
|
8
|
+
http_method = :put
|
9
|
+
end
|
10
|
+
|
11
|
+
%>
|
12
|
+
|
13
|
+
<%= form_for(@invoice, :url => url, :method => http_method, :html => {:id=>"form_invoice", :class=>"mb-0 form-horizontal", :invoice => "form", :method => (@invoice.new_record? ? :post : :put), :remote=>true}) do |f| %>
|
14
|
+
|
15
|
+
<div class="row">
|
16
|
+
<div class="col-md-6">
|
17
|
+
|
18
|
+
<div class="row mt-10 mb-10">
|
19
|
+
<div class="col-md-4">Customer Name:</div>
|
20
|
+
<div class="col-md-8">
|
21
|
+
<%= f.text_field(:customer_name, style: "width:100%;") %>
|
22
|
+
</div>
|
23
|
+
</div>
|
24
|
+
|
25
|
+
<div class="row mt-10 mb-10">
|
26
|
+
<div class="col-md-4">Customer Address:</div>
|
27
|
+
<div class="col-md-8">
|
28
|
+
<%= f.text_field(:customer_address, style: "width:100%;") %>
|
29
|
+
</div>
|
30
|
+
</div>
|
31
|
+
|
32
|
+
<div class="row mt-10 mb-10">
|
33
|
+
<div class="col-md-4">Payment Method:</div>
|
34
|
+
<div class="col-md-8">
|
35
|
+
<!-- Radio Button for Cash -->
|
36
|
+
<%= f.radio_button :payment_method, 'cash', class: "mr-5", :checked => true %>
|
37
|
+
<%= label :payment_method_cash, 'CASH', class: "mr-10" %>
|
38
|
+
|
39
|
+
<!-- Radio Button for Credit Card -->
|
40
|
+
<%= f.radio_button :payment_method, 'credit_card', class: "mr-5" %>
|
41
|
+
<%= label :payment_method_credit_card, 'CREDIT CARD', class: "mr-10" %>
|
42
|
+
|
43
|
+
<!-- Radio Button for Credit -->
|
44
|
+
<%= f.radio_button :payment_method, 'credit', class: "mr-5" %>
|
45
|
+
<%= label :payment_method_credit, 'CREDIT', class: "mr-10" %>
|
46
|
+
|
47
|
+
<!-- Radio Button for Cheque -->
|
48
|
+
<%= f.radio_button :payment_method, 'cheque', class: "mr-5" %>
|
49
|
+
<%= label :payment_method_cheque, 'CHEQUE', class: "mr-10" %>
|
50
|
+
</div>
|
51
|
+
</div>
|
52
|
+
|
53
|
+
<div class="row mt-10 mb-10">
|
54
|
+
<div class="col-md-4">Credit Card Number:</div>
|
55
|
+
<div class="col-md-8">
|
56
|
+
<%= f.text_field(:customer_name, style: ";width:100%;") %>
|
57
|
+
</div>
|
58
|
+
</div>
|
59
|
+
|
60
|
+
<div class="row mt-10 mb-10">
|
61
|
+
<div class="col-md-4">Notes:</div>
|
62
|
+
<div class="col-md-8">
|
63
|
+
|
64
|
+
<%= f.text_area(:notes, style: "width:100%;height:80px;") %>
|
65
|
+
|
66
|
+
<%#= theme_form_field(@invoice, :notes, required: true, form_style: "top-bottom", html_options: {type: :textarea, style: "height: 100px;"}) %>
|
67
|
+
|
68
|
+
<!-- <div class="form-group "><label class=" control-label mb-20"><b>Notes</b><span class="text-color-red ml-10 mr-5 pull-right">*</span></label><div><textarea name="invoice[notes]" id="inp_notes" type="textarea" style="height: 100px;" class="text input form-control" place_holder=""></textarea></div></div> -->
|
69
|
+
</div>
|
70
|
+
</div>
|
71
|
+
|
72
|
+
</div>
|
73
|
+
|
74
|
+
<div class="col-md-6">
|
75
|
+
|
76
|
+
<div class="row mt-10 mb-10">
|
77
|
+
<div class="col-md-4 col-md-offset-2">Discount:</div>
|
78
|
+
<div class="col-md-4">
|
79
|
+
<%= f.text_field(:discount, style: "text-align: right;width:100%;") %>
|
80
|
+
</div>
|
81
|
+
</div>
|
82
|
+
|
83
|
+
<div class="row mt-10 mb-10" style="font-weight: bold;">
|
84
|
+
<div class="col-md-4 col-md-offset-2">Net Total:</div>
|
85
|
+
<div class="col-md-4" style="text-align: right">
|
86
|
+
<%= number_to_currency @invoice.net_total_amount, unit: "AED " %>
|
87
|
+
</div>
|
88
|
+
</div>
|
89
|
+
|
90
|
+
<div class="row mt-10 mb-10">
|
91
|
+
<div class="col-md-4 col-md-offset-2">Money Taken:</div>
|
92
|
+
<div class="col-md-4">
|
93
|
+
<%= f.text_field(:money_taken, style: "text-align: right;width:100%;") %>
|
94
|
+
</div>
|
95
|
+
</div>
|
96
|
+
|
97
|
+
<div class="row mt-10 mb-10">
|
98
|
+
<div class="col-md-4 col-md-offset-2">Customer Balance:</div>
|
99
|
+
<div class="col-md-4" style="text-align: right">
|
100
|
+
<%= number_to_currency @invoice.balance_to_give, unit: "AED " %>
|
101
|
+
</div>
|
102
|
+
</div>
|
103
|
+
|
104
|
+
</div>
|
105
|
+
|
106
|
+
</div>
|
107
|
+
|
108
|
+
<div class="form-group ">
|
109
|
+
|
110
|
+
<%= submit_tag("Save", :class=>"btn btn-info btn-lg pull-right ml-10", style: "width: 300px;") %>
|
111
|
+
|
112
|
+
<%= link_to "Close", "#", onclick: "closeLargeModal();", class: "btn btn-gray btn-lg pull-right", style: "width: 100px;" %>
|
113
|
+
|
114
|
+
</div>
|
115
|
+
<%= clear_tag(10) %>
|
116
|
+
|
117
|
+
</div>
|
118
|
+
|
119
|
+
<% end %>
|
120
|
+
|
@@ -0,0 +1,64 @@
|
|
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>Invoice Number</th>
|
7
|
+
<th style="width:15%;text-align: center;">Date</th>
|
8
|
+
<th style="text-align: left;">User</th>
|
9
|
+
<th style="text-align: center;">Payment Method</th>
|
10
|
+
<th style="text-align: right;">Total Amount</th>
|
11
|
+
<th>Status</th>
|
12
|
+
<th style="text-align: center;">Actions</th>
|
13
|
+
</tr>
|
14
|
+
</thead>
|
15
|
+
|
16
|
+
<tbody>
|
17
|
+
<% @invoices.each_with_index do |invoice, i| %>
|
18
|
+
|
19
|
+
<% edit_link = edit_terminal_staff_invoice_path(@terminal, invoice) %>
|
20
|
+
|
21
|
+
<% delete_link = terminal_staff_invoices_path(@terminal, invoice) %>
|
22
|
+
|
23
|
+
<tr id="tr_invoice_<%= invoice.id %>">
|
24
|
+
|
25
|
+
<th scope="row" style="text-align: center;">
|
26
|
+
<% if i < 0 %>
|
27
|
+
<i class="fa fa-check text-success"></i>
|
28
|
+
<% else %>
|
29
|
+
<%= i + 1 + (@per_page.to_i * (@current_page.to_i - 1)) %>
|
30
|
+
<% end %>
|
31
|
+
</th>
|
32
|
+
|
33
|
+
<td class="invoice-name"><%= link_to invoice.invoice_number, terminal_staff_invoice_path(@terminal, invoice), remote: true %></td>
|
34
|
+
|
35
|
+
<td class="invoice-name" style="text-align: center;"><%= invoice.invoice_date.strftime("%m/%d/%Y") if invoice.invoice_date %></td>
|
36
|
+
|
37
|
+
<td class="invoice-name" style="text-align: center;"><%= invoice.user.display_name if invoice.user %></td>
|
38
|
+
|
39
|
+
<td class="invoice-name" style="text-align: center;"><%= invoice.display_payment_method %></td>
|
40
|
+
|
41
|
+
<td class="invoice-name" style="text-align: center;"><%= number_to_currency invoice.total_amount, unit: "" %></td>
|
42
|
+
|
43
|
+
<td class="invoice-name" style="text-align: center;"><%= invoice.display_status %></td>
|
44
|
+
|
45
|
+
<td class="action-links" style="width:10%">
|
46
|
+
|
47
|
+
<%= link_to raw("<i class=\"linecons-pencil\"></i> Edit"), edit_link, :remote=>true, class: "edit" %>
|
48
|
+
|
49
|
+
<%= link_to raw("<i class=\"linecons-trash\"></i> Delete"), delete_link, method: :delete, invoice: "menuitem", tabindex: "-1", data: { confirm: 'Are you sure?' }, :remote=>true, class: "delete" %>
|
50
|
+
|
51
|
+
</td>
|
52
|
+
|
53
|
+
</tr>
|
54
|
+
<% end %>
|
55
|
+
</tbody>
|
56
|
+
</table>
|
57
|
+
</div>
|
58
|
+
|
59
|
+
<div class="row">
|
60
|
+
<div class="col-sm-12">
|
61
|
+
<%= paginate_kuppayam(@invoices) %>
|
62
|
+
</div>
|
63
|
+
</div>
|
64
|
+
|
@@ -0,0 +1,33 @@
|
|
1
|
+
<% edit_link = edit_terminal_staff_invoice_path(@terminal, invoice) %>
|
2
|
+
|
3
|
+
<% delete_link = terminal_staff_invoices_path(@terminal, invoice) %>
|
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="invoice-name"><%= link_to invoice.invoice_number, terminal_staff_invoice_path(@terminal, invoice), remote: true %></td>
|
16
|
+
|
17
|
+
<td class="invoice-name" style="text-align: center;"><%= @invoice.invoice_date.strftime("%m/%d/%Y - %H:%M:%S") if @invoice.invoice_date %></td>
|
18
|
+
|
19
|
+
<td class="invoice-name" style="text-align: center;"><%= @invoice.user.display_payment_method %></td>
|
20
|
+
|
21
|
+
<td class="invoice-name" style="text-align: center;"><%= number_to_currency invoice.total_amount, unit: "" %></td>
|
22
|
+
|
23
|
+
<td class="invoice-name"><%= invoice.display_status %></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, invoice: "menuitem", tabindex: "-1", data: { confirm: 'Are you sure?' }, :remote=>true, class: "delete" %>
|
30
|
+
|
31
|
+
</td>
|
32
|
+
|
33
|
+
</tr>
|