2
0
mirror of https://github.com/frappe/books.git synced 2024-11-09 15:20:56 +00:00

fix: payment reference filter

This commit is contained in:
18alantom 2022-10-24 14:07:19 +05:30
parent 1e457ddcf2
commit 87971b8a6b

View File

@ -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;
}