-
-
+ ng-keydown="$ctrl.onKeyPress($event)"
+ required="true"
+ min="0">
+
- Id/Name: {{$ctrl.filter.search}}
+ {{$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
index 334e4cf01..b11911ee3 100644
--- a/modules/invoiceIn/front/serial-search-panel/index.js
+++ b/modules/invoiceIn/front/serial-search-panel/index.js
@@ -5,16 +5,16 @@ import './style.scss';
class Controller extends SearchPanel {
constructor($element, $) {
super($element, $);
+ this.filter = {};
const filter = {
fields: ['daysAgo']
};
- this.$http.get('InvoiceInConfigs', {filter});
- }
-
- $onInit() {
- this.filter = {
- tags: []
- };
+ this.$http.get('InvoiceInConfigs', {filter}).then(res => {
+ if (res.data) {
+ this.invoiceInConfig = res.data[0];
+ this.addFilters();
+ }
+ });
}
removeItemFilter(param) {
@@ -28,6 +28,9 @@ class Controller extends SearchPanel {
}
addFilters() {
+ if (!this.filter.daysAgo)
+ this.filter.daysAgo = this.invoiceInConfig.daysAgo;
+
return this.model.addFilter({}, this.filter);
}
}
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('