From 1725bb18ddb4cb8115eb4b0171288a3f956c04f2 Mon Sep 17 00:00:00 2001 From: Denis Ezhov Date: Thu, 25 Apr 2019 16:23:15 +0300 Subject: [PATCH] invoices search fixed (#253) --- .../invoices/search-form/search-form.component.pug | 6 ------ src/app/invoices/search-form/search-form.service.ts | 12 ++++++------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/app/invoices/search-form/search-form.component.pug b/src/app/invoices/search-form/search-form.component.pug index 4c9dd44..928b27b 100644 --- a/src/app/invoices/search-form/search-form.component.pug +++ b/src/app/invoices/search-form/search-form.component.pug @@ -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 diff --git a/src/app/invoices/search-form/search-form.service.ts b/src/app/invoices/search-form/search-form.service.ts index 29315c4..6a89a46 100644 --- a/src/app/invoices/search-form/search-form.service.ts +++ b/src/app/invoices/search-form/search-form.service.ts @@ -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() }; } }