mirror of
https://github.com/frappe/books.git
synced 2024-11-09 23:30:56 +00:00
feat: filter items in invoices
This commit is contained in:
parent
fbb1c4db66
commit
17663b2dbe
@ -14,11 +14,16 @@ export default {
|
||||
required: 1,
|
||||
getFilters(_, doc) {
|
||||
let items = doc.parentdoc.items.map((d) => d.item).filter(Boolean);
|
||||
if (items.length > 0) {
|
||||
return {
|
||||
name: ['not in', items],
|
||||
};
|
||||
|
||||
const baseFilter = { for: ['not in', ['sales']] };
|
||||
if (items.length <= 0) {
|
||||
return baseFilter;
|
||||
}
|
||||
|
||||
return {
|
||||
name: ['not in', items],
|
||||
...baseFilter,
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -15,11 +15,16 @@ export default {
|
||||
required: 1,
|
||||
getFilters(_, doc) {
|
||||
let items = doc.parentdoc.items.map((d) => d.item).filter(Boolean);
|
||||
if (items.length > 0) {
|
||||
return {
|
||||
name: ['not in', items],
|
||||
};
|
||||
|
||||
const baseFilter = { for: ['not in', ['purchases']] };
|
||||
if (items.length <= 0) {
|
||||
return baseFilter;
|
||||
}
|
||||
|
||||
return {
|
||||
name: ['not in', items],
|
||||
...baseFilter,
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user