invoices search fixed (#253)

This commit is contained in:
Denis Ezhov 2019-04-25 16:23:15 +03:00 committed by GitHub
parent 3e34cbcbb0
commit 1725bb18dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 12 deletions

View File

@ -76,12 +76,6 @@ form([formGroup]="searchForm", novalidate)
.form-group .form-group
label Fingerprint: label Fingerprint:
input.form-control(formControlName="fingerprint") input.form-control(formControlName="fingerprint")
.row
.col-sm-3.col-xs-12
.form-group
label.text-left
input(type="checkbox", formControlName="invoicesWithPayments")
|  Инвойсы с платежами
.row .row
.col-sm-9.col-xs-12 .col-sm-9.col-xs-12
.reset-button-container .reset-button-container

View File

@ -4,6 +4,8 @@ import { ActivatedRoute, Params, Router } from '@angular/router';
import * as moment from 'moment'; import * as moment from 'moment';
import { mapValues, isEqual, chain, keys, difference } from 'lodash'; import { mapValues, isEqual, chain, keys, difference } from 'lodash';
import { PAYMENT_STATUS } from 'koffing/backend';
@Injectable() @Injectable()
export class SearchFormService { export class SearchFormService {
public searchForm: FormGroup; public searchForm: FormGroup;
@ -18,7 +20,7 @@ export class SearchFormService {
to: moment() to: moment()
.endOf('day') .endOf('day')
.toDate(), .toDate(),
invoicesWithPayments: true paymentStatus: PAYMENT_STATUS.captured
}; };
private mainSearchFields = ['invoiceID', 'invoiceStatus', 'paymentStatus']; private mainSearchFields = ['invoiceID', 'invoiceStatus', 'paymentStatus'];
@ -68,13 +70,12 @@ export class SearchFormService {
ip: '', ip: '',
email: '', email: '',
paymentID: '', paymentID: '',
paymentStatus: '', paymentStatus: this.defaultValues.paymentStatus,
paymentMethod: '', paymentMethod: '',
paymentFlow: '', paymentFlow: '',
fingerprint: '', fingerprint: '',
customerID: '', customerID: '',
bankCardTokenProvider: '', bankCardTokenProvider: ''
invoicesWithPayments: this.defaultValues.invoicesWithPayments
}); });
} }
@ -96,8 +97,7 @@ export class SearchFormService {
.toDate(), .toDate(),
to: moment(params.to) to: moment(params.to)
.endOf('day') .endOf('day')
.toDate(), .toDate()
invoicesWithPayments: params.invoicesWithPayments === 'true'
}; };
} }
} }