diff --git a/app/assets/stylesheets/kaui/invoice.scss b/app/assets/stylesheets/kaui/invoice.scss
index eb3b0ffa..fd7bcb0a 100644
--- a/app/assets/stylesheets/kaui/invoice.scss
+++ b/app/assets/stylesheets/kaui/invoice.scss
@@ -56,3 +56,18 @@ table.invoice-totals {
font-size: 12px;
padding: 5px 30px;
}
+
+.invoice-bar{
+ display: flex;
+ justify-content: space-between;
+ margin-bottom: 10px;
+}
+
+.search-icon{
+ margin-left: -25px;
+ opacity: 0.5;
+}
+
+#search-invoice-btn{
+ margin-left: 10px;
+}
\ No newline at end of file
diff --git a/app/views/kaui/invoices/index.html.erb b/app/views/kaui/invoices/index.html.erb
index 7958ef6c..24f27f45 100644
--- a/app/views/kaui/invoices/index.html.erb
+++ b/app/views/kaui/invoices/index.html.erb
@@ -1,9 +1,15 @@
-
Invoices
-
+
+
+
+
+
+
+ <%= link_to 'Latest invoices', kaui_engine.invoices_path %>
+
@@ -32,7 +38,8 @@ $(document).ready(function() {
"pagingType": <% if @max_nb_records.nil? -%>"simple"<% else -%>"full_numbers"<% end -%>,
"language": {
- "info": <% if @max_nb_records.nil? -%>"Showing _START_ to _END_ of <%= number_with_delimiter(Kaui::EngineControllerUtil::SIMPLE_PAGINATION_THRESHOLD) -%>+ entries"<% else -%>"Showing _START_ to _END_ of _TOTAL_ entries"<% end -%>
+ "info": <% if @max_nb_records.nil? -%>"Showing _START_ to _END_ of <%= number_with_delimiter(Kaui::EngineControllerUtil::SIMPLE_PAGINATION_THRESHOLD) -%>+ entries"<% else -%>"Showing _START_ to _END_ of _TOTAL_ entries"<% end -%>,
+ "zeroRecords": "No matching records found, please click on Latest Invoices"
},
"pageLength": <%= @limit %>,
"displayStart": <%= @offset %>,
@@ -63,5 +70,22 @@ $(document).ready(function() {
$(".dataTables_info").toggle(!noMoreData);
});
<% end %>
+
+ function searchInvoices () {
+ var invoiceSearch = document.getElementById('invoice-search').value;
+ table.search( invoiceSearch ).draw();
+ }
+
+ var searchInput = document.getElementById('invoice-search');
+
+ searchInput.addEventListener("keypress", function(event) {
+ if (event.keyCode == 13) {
+ searchInvoices();
+ }
+ });
+
+ $('#search-invoice-btn').on("click", function(event) {
+ searchInvoices();
+ });
});
<% end %>