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
label Fingerprint:
input.form-control(formControlName="fingerprint")
.row
.col-sm-3.col-xs-12
.form-group
label.text-left
input(type="checkbox", formControlName="invoicesWithPayments")
|  Инвойсы с платежами
.row
.col-sm-9.col-xs-12
.reset-button-container

View File

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