2
0
mirror of https://github.com/frappe/books.git synced 2025-02-11 16:39:25 +00:00
books/models/inventory/helpers.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

13 lines
331 B
TypeScript
Raw Normal View History

import { Doc } from "fyo/model/doc";
import { FilterFunction } from "fyo/model/types";
import { QueryFilter } from "utils/db/types";
2022-10-28 13:34:08 +05:30
export const locationFilter: FilterFunction = (doc: Doc) => {
const item = doc.item;
if (!doc.item) {
return { item: null };
}
return { item: ['in', [null, item]] } as QueryFilter;
};