+
+
+
+
+
+
+
+
+
+
+ {{$ctrl.$t('Serial')}}: {{$ctrl.filter.serial}}
+
+
+
diff --git a/modules/invoiceIn/front/serial-search-panel/index.js b/modules/invoiceIn/front/serial-search-panel/index.js
new file mode 100644
index 000000000..b11911ee3
--- /dev/null
+++ b/modules/invoiceIn/front/serial-search-panel/index.js
@@ -0,0 +1,44 @@
+import ngModule from '../module';
+import SearchPanel from 'core/components/searchbar/search-panel';
+import './style.scss';
+
+class Controller extends SearchPanel {
+ constructor($element, $) {
+ super($element, $);
+ this.filter = {};
+ const filter = {
+ fields: ['daysAgo']
+ };
+ this.$http.get('InvoiceInConfigs', {filter}).then(res => {
+ if (res.data) {
+ this.invoiceInConfig = res.data[0];
+ this.addFilters();
+ }
+ });
+ }
+
+ removeItemFilter(param) {
+ this.filter[param] = null;
+ this.addFilters();
+ }
+
+ onKeyPress($event) {
+ if ($event.key === 'Enter')
+ this.addFilters();
+ }
+
+ addFilters() {
+ if (!this.filter.daysAgo)
+ this.filter.daysAgo = this.invoiceInConfig.daysAgo;
+
+ return this.model.addFilter({}, this.filter);
+ }
+}
+
+ngModule.component('vnInvoiceInSerialSearchPanel', {
+ template: require('./index.html'),
+ controller: Controller,
+ bindings: {
+ model: '<'
+ }
+});
diff --git a/modules/invoiceIn/front/serial-search-panel/index.spec.js b/modules/invoiceIn/front/serial-search-panel/index.spec.js
new file mode 100644
index 000000000..b5228e126
--- /dev/null
+++ b/modules/invoiceIn/front/serial-search-panel/index.spec.js
@@ -0,0 +1,43 @@
+import './index.js';
+
+describe('InvoiceIn', () => {
+ describe('Component serial-search-panel', () => {
+ let controller;
+ let $scope;
+
+ beforeEach(ngModule('invoiceIn'));
+
+ beforeEach(inject(($componentController, $rootScope) => {
+ $scope = $rootScope.$new();
+ const $element = angular.element('