From 87971b8a6ba6fd0683c5293f6c6d542f81558f31 Mon Sep 17 00:00:00 2001 From: 18alantom <2.alan.tom@gmail.com> Date: Mon, 24 Oct 2022 14:07:19 +0530 Subject: [PATCH] fix: payment reference filter --- models/baseModels/PaymentFor/PaymentFor.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/models/baseModels/PaymentFor/PaymentFor.ts b/models/baseModels/PaymentFor/PaymentFor.ts index 1f9b0256..5cf55eda 100644 --- a/models/baseModels/PaymentFor/PaymentFor.ts +++ b/models/baseModels/PaymentFor/PaymentFor.ts @@ -76,14 +76,18 @@ export class PaymentFor extends Doc { static filters: FiltersMap = { referenceName: (doc) => { + const zero = + '0.' + + '0'.repeat(doc.fyo.singles.SystemSettings?.internalPrecision ?? 11); + const baseFilters = { - outstandingAmount: ['>', 0], + outstandingAmount: ['!=', zero], submitted: true, cancelled: false, }; const party = doc?.parentdoc?.party as undefined | string; - if (party === undefined) { + if (!party) { return baseFilters; }