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,44 +0,0 @@
|
|
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>Payment Method</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
|
-
<% customer_name = invoice.customer_name || "GUEST-#{invoice.id}-#{@store.code}-" %>
|
18
|
-
|
19
|
-
<% if invoice.draft? %>
|
20
|
-
<td class="invoice-name"><%= link_to invoice.invoice_number, edit_terminal_staff_invoice_path(@terminal, invoice), remote: true %></td>
|
21
|
-
<!-- <td class="invoice-name"><%#= link_to customer_name, edit_terminal_staff_invoice_path(@terminal, invoice), remote: true %></td> -->
|
22
|
-
<% else %>
|
23
|
-
<td class="invoice-name"><%= link_to invoice.invoice_number, terminal_staff_invoice_path(@terminal, invoice), remote: true %></td>
|
24
|
-
<!-- <td class="invoice-name"><%#= link_to customer_name, terminal_staff_invoice_path(@terminal, invoice), remote: true %></td> -->
|
25
|
-
<% end %>
|
26
|
-
|
27
|
-
<td class="invoice-name" style="text-align: center;"><%= invoice.display_payment_method %></td>
|
28
|
-
|
29
|
-
<!-- <td class="invoice-name" style="text-align: center;"><%#= invoice.invoice_date.strftime("%m/%d/%Y") if invoice.invoice_date %></td> -->
|
30
|
-
|
31
|
-
<td class="invoice-name" style="text-align: center;"><%= number_to_currency invoice.net_total_amount, unit: "AED " %></td>
|
32
|
-
|
33
|
-
</tr>
|
34
|
-
<% end %>
|
35
|
-
</tbody>
|
36
|
-
</table>
|
37
|
-
</div>
|
38
|
-
|
39
|
-
<div class="row">
|
40
|
-
<div class="col-sm-12">
|
41
|
-
<%= paginate_kuppayam(invoices) %>
|
42
|
-
</div>
|
43
|
-
</div>
|
44
|
-
|
@@ -1,6 +0,0 @@
|
|
1
|
-
<form method="get" action="/terminal_staff/<%= @terminal.id %>/search" enctype="application/x-www-form-urlencoded" data-remote="true">
|
2
|
-
<input type="text" class="form-control input-lg" placeholder="Search..." name="query">
|
3
|
-
<button type="submit" class="btn-unstyled">
|
4
|
-
<i class="linecons-search"></i>
|
5
|
-
</button>
|
6
|
-
</form>
|
@@ -1,24 +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: left;width:30%;">EAN / SKU</th>
|
6
|
-
<th style="text-align: left;width:50%;">Name</th>
|
7
|
-
<th style="text-align: right;width:20%;;">Price</th>
|
8
|
-
</tr>
|
9
|
-
</thead>
|
10
|
-
|
11
|
-
<tbody>
|
12
|
-
<% @products.each_with_index do |product, i| %>
|
13
|
-
|
14
|
-
<tr id="tr_product_<%= product.id %>">
|
15
|
-
<td class="product-name"><%= product.ean_sku %></td>
|
16
|
-
<td class="product-name"><%= product.name %></td>
|
17
|
-
<td style="text-align: right;"><strong><%= number_to_currency product.retail_price, unit: "AED " %></strong></td>
|
18
|
-
</td>
|
19
|
-
</tr>
|
20
|
-
|
21
|
-
<% end %>
|
22
|
-
</tbody>
|
23
|
-
</table>
|
24
|
-
</div>
|
@@ -1,56 +0,0 @@
|
|
1
|
-
|
2
|
-
<div id="div_terminal_dashboard_counts">
|
3
|
-
<%= render :partial=>"vyapari/terminal_staff/dashboard/counts" -%>
|
4
|
-
</div>
|
5
|
-
|
6
|
-
|
7
|
-
<div class="row hidden-xs">
|
8
|
-
<div class="col-md-6">
|
9
|
-
<div class="panel panel-color panel-gray">
|
10
|
-
|
11
|
-
<div class="panel-heading">
|
12
|
-
<h3 class="panel-title">Saved Invoices</h3>
|
13
|
-
</div>
|
14
|
-
|
15
|
-
<div class="panel-body">
|
16
|
-
<!-- Active Invoices -->
|
17
|
-
<% active_invoices = @terminal.invoices.active.today.order("created_at DESC").page(1).per(10) %>
|
18
|
-
<%= render :partial=>"vyapari/terminal_staff/dashboard/invoices", locals: { invoices: active_invoices } -%>
|
19
|
-
</div>
|
20
|
-
</div>
|
21
|
-
|
22
|
-
<div class="panel panel-color panel-gray">
|
23
|
-
|
24
|
-
<div class="panel-heading">
|
25
|
-
<h3 class="panel-title">Draft Invoices</h3>
|
26
|
-
</div>
|
27
|
-
|
28
|
-
<div class="panel-body">
|
29
|
-
<!-- Draft Invoices -->
|
30
|
-
<% draft_invoices = @terminal.invoices.draft.today.order("created_at DESC").page(1).per(10) %>
|
31
|
-
<%= render :partial=>"vyapari/terminal_staff/dashboard/invoices", locals: { invoices: draft_invoices } -%>
|
32
|
-
</div>
|
33
|
-
|
34
|
-
</div>
|
35
|
-
</div>
|
36
|
-
|
37
|
-
<div class="col-md-6">
|
38
|
-
<div class="panel panel-color panel-gray">
|
39
|
-
|
40
|
-
<div class="panel-heading">
|
41
|
-
<h3 class="panel-title">Check Price</h3>
|
42
|
-
</div>
|
43
|
-
|
44
|
-
<div class="panel-body search-env">
|
45
|
-
<div id="div_terminal_dashboard_search_form">
|
46
|
-
<%= render :partial=>"vyapari/terminal_staff/dashboard/search_form" -%>
|
47
|
-
</div>
|
48
|
-
<div id="div_terminal_dashboard_search_results">
|
49
|
-
</div>
|
50
|
-
</div>
|
51
|
-
|
52
|
-
</div>
|
53
|
-
</div>
|
54
|
-
</div>
|
55
|
-
|
56
|
-
<%= clear_tag(60) %>
|
@@ -1,12 +0,0 @@
|
|
1
|
-
<% if @products.any? %>
|
2
|
-
|
3
|
-
// Refresh the list
|
4
|
-
// $('#div_terminal_dashboard_search_form').html("<%#= escape_javascript(render(:partial=>"vyapari/terminal_staff/dashboard/search_form")) %>");
|
5
|
-
$('#div_terminal_dashboard_search_results').html("<%= escape_javascript(render(:partial=>"vyapari/terminal_staff/dashboard/search_results")) %>");
|
6
|
-
|
7
|
-
<% else %>
|
8
|
-
|
9
|
-
var noResultsText = "<%= escape_javascript(theme_panel_message(I18n.translate('success.no_results_found')))%>";
|
10
|
-
$('#div_terminal_dashboard_search_results').html(noResultsText);
|
11
|
-
|
12
|
-
<% end %>
|
@@ -1,62 +0,0 @@
|
|
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 = 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, target: "_blank", 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>
|
@@ -1,134 +0,0 @@
|
|
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">Customer Phone:</div>
|
34
|
-
<div class="col-md-8">
|
35
|
-
<%= f.text_field(:customer_phone, style: "width:100%;") %>
|
36
|
-
</div>
|
37
|
-
</div>
|
38
|
-
|
39
|
-
<div class="row mt-10 mb-10">
|
40
|
-
<div class="col-md-4">Customer Email:</div>
|
41
|
-
<div class="col-md-8">
|
42
|
-
<%= f.text_field(:customer_email, style: "width:100%;") %>
|
43
|
-
</div>
|
44
|
-
</div>
|
45
|
-
|
46
|
-
<div class="row mt-10 mb-10">
|
47
|
-
<div class="col-md-4">Payment Method:</div>
|
48
|
-
<div class="col-md-8">
|
49
|
-
<!-- Radio Button for Cash -->
|
50
|
-
<%= f.radio_button :payment_method, 'cash', class: "mr-5", :checked => true %>
|
51
|
-
<%= label :payment_method_cash, 'CASH', class: "mr-10" %>
|
52
|
-
|
53
|
-
<!-- Radio Button for Credit Card -->
|
54
|
-
<%= f.radio_button :payment_method, 'credit_card', class: "mr-5" %>
|
55
|
-
<%= label :payment_method_credit_card, 'CREDIT CARD', class: "mr-10" %>
|
56
|
-
|
57
|
-
<!-- Radio Button for Credit -->
|
58
|
-
<%= f.radio_button :payment_method, 'credit', class: "mr-5" %>
|
59
|
-
<%= label :payment_method_credit, 'CREDIT', class: "mr-10" %>
|
60
|
-
|
61
|
-
<!-- Radio Button for Cheque -->
|
62
|
-
<%= f.radio_button :payment_method, 'cheque', class: "mr-5" %>
|
63
|
-
<%= label :payment_method_cheque, 'CHEQUE', class: "mr-10" %>
|
64
|
-
</div>
|
65
|
-
</div>
|
66
|
-
|
67
|
-
<div class="row mt-10 mb-10">
|
68
|
-
<div class="col-md-4">Credit Card Number:</div>
|
69
|
-
<div class="col-md-8">
|
70
|
-
<%= f.text_field(:credit_card_number, style: ";width:100%;") %>
|
71
|
-
</div>
|
72
|
-
</div>
|
73
|
-
|
74
|
-
<div class="row mt-10 mb-10">
|
75
|
-
<div class="col-md-4">Notes:</div>
|
76
|
-
<div class="col-md-8">
|
77
|
-
|
78
|
-
<%= f.text_area(:notes, style: "width:100%;height:80px;") %>
|
79
|
-
|
80
|
-
<%#= theme_form_field(@invoice, :notes, required: true, form_style: "top-bottom", html_options: {type: :textarea, style: "height: 100px;"}) %>
|
81
|
-
|
82
|
-
<!-- <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> -->
|
83
|
-
</div>
|
84
|
-
</div>
|
85
|
-
|
86
|
-
</div>
|
87
|
-
|
88
|
-
<div class="col-md-6">
|
89
|
-
|
90
|
-
<div class="row mt-10 mb-10">
|
91
|
-
<div class="col-md-4 col-md-offset-2">Discount (%):</div>
|
92
|
-
<div class="col-md-4">
|
93
|
-
<%= f.text_field(:discount, style: "text-align: right;width:100%;") %>
|
94
|
-
</div>
|
95
|
-
</div>
|
96
|
-
|
97
|
-
<div class="row mt-10 mb-10" style="font-weight: bold;">
|
98
|
-
<div class="col-md-4 col-md-offset-2">Net Total:</div>
|
99
|
-
<div class="col-md-4" style="text-align: right">
|
100
|
-
<%= number_to_currency @invoice.net_total_amount, unit: "AED " %>
|
101
|
-
</div>
|
102
|
-
</div>
|
103
|
-
|
104
|
-
<div class="row mt-10 mb-10">
|
105
|
-
<div class="col-md-4 col-md-offset-2">Money Taken:</div>
|
106
|
-
<div class="col-md-4">
|
107
|
-
<%= f.text_field(:money_taken, style: "text-align: right;width:100%;") %>
|
108
|
-
</div>
|
109
|
-
</div>
|
110
|
-
|
111
|
-
<div class="row mt-10 mb-10">
|
112
|
-
<div class="col-md-4 col-md-offset-2">Customer Balance:</div>
|
113
|
-
<div class="col-md-4" style="text-align: right">
|
114
|
-
<%= number_to_currency @invoice.balance_to_give, unit: "AED " %>
|
115
|
-
</div>
|
116
|
-
</div>
|
117
|
-
|
118
|
-
</div>
|
119
|
-
|
120
|
-
</div>
|
121
|
-
|
122
|
-
<div class="form-group ">
|
123
|
-
|
124
|
-
<%= submit_tag("Save", :class=>"btn btn-info btn-lg pull-right ml-10", style: "width: 300px;") %>
|
125
|
-
|
126
|
-
<%= link_to "Close", "#", onclick: "closeLargeModal();", class: "btn btn-gray btn-lg pull-right", style: "width: 100px;" %>
|
127
|
-
|
128
|
-
</div>
|
129
|
-
<%= clear_tag(10) %>
|
130
|
-
|
131
|
-
</div>
|
132
|
-
|
133
|
-
<% end %>
|
134
|
-
|
@@ -1,70 +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>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
|
-
<% if @current_user.has_role?("POS Sales Maanger") %>
|
13
|
-
<th style="text-align: center;">Actions</th>
|
14
|
-
<% end %>
|
15
|
-
</tr>
|
16
|
-
</thead>
|
17
|
-
|
18
|
-
<tbody>
|
19
|
-
<% @invoices.each_with_index do |invoice, i| %>
|
20
|
-
|
21
|
-
<% edit_link = edit_terminal_staff_invoice_path(@terminal, invoice) %>
|
22
|
-
|
23
|
-
<% delete_link = terminal_staff_invoices_path(@terminal, invoice) %>
|
24
|
-
|
25
|
-
<tr id="tr_invoice_<%= invoice.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="invoice-name"><%= link_to invoice.invoice_number, terminal_staff_invoice_path(@terminal, invoice), remote: true %></td>
|
36
|
-
|
37
|
-
<td class="invoice-name" style="text-align: center;"><%= invoice.invoice_date.strftime("%m/%d/%Y") if invoice.invoice_date %></td>
|
38
|
-
|
39
|
-
<td class="invoice-name" style="text-align: center;"><%= invoice.user.display_name if invoice.user %></td>
|
40
|
-
|
41
|
-
<td class="invoice-name" style="text-align: center;"><%= invoice.display_payment_method %></td>
|
42
|
-
|
43
|
-
<td class="invoice-name" style="text-align: center;"><%= number_to_currency invoice.net_total_amount, unit: "" %></td>
|
44
|
-
|
45
|
-
<td class="invoice-name" style="text-align: center;"><%= invoice.display_status %></td>
|
46
|
-
|
47
|
-
<% if @current_user.has_role?("POS Sales Maanger") %>
|
48
|
-
|
49
|
-
<td class="action-links" style="width:10%">
|
50
|
-
|
51
|
-
<%= link_to raw("<i class=\"linecons-pencil\"></i> Edit"), edit_link, :remote=>true, class: "edit" %>
|
52
|
-
|
53
|
-
<%= 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" %>
|
54
|
-
|
55
|
-
</td>
|
56
|
-
|
57
|
-
<% end %>
|
58
|
-
|
59
|
-
</tr>
|
60
|
-
<% end %>
|
61
|
-
</tbody>
|
62
|
-
</table>
|
63
|
-
</div>
|
64
|
-
|
65
|
-
<div class="row">
|
66
|
-
<div class="col-sm-12">
|
67
|
-
<%= paginate_kuppayam(@invoices) %>
|
68
|
-
</div>
|
69
|
-
</div>
|
70
|
-
|
@@ -1,33 +0,0 @@
|
|
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.net_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>
|