mirror of
https://github.com/frappe/books.git
synced 2024-12-22 10:58:59 +00:00
fix: allow multiple rows of same item in invoice
- this is to allow for different rates
This commit is contained in:
parent
ad05ca7466
commit
6bbee25dd5
@ -478,23 +478,12 @@ export abstract class InvoiceItem extends Doc {
|
||||
|
||||
static filters: FiltersMap = {
|
||||
item: (doc: Doc) => {
|
||||
const itemList = doc.parentdoc!.items as Doc[];
|
||||
const items = itemList.map((d) => d.item as string).filter(Boolean);
|
||||
|
||||
let itemNotFor = 'Sales';
|
||||
if (doc.isSales) {
|
||||
itemNotFor = 'Purchases';
|
||||
}
|
||||
|
||||
const baseFilter = { for: ['not in', [itemNotFor]] };
|
||||
if (items.length <= 0) {
|
||||
return baseFilter;
|
||||
}
|
||||
|
||||
return {
|
||||
name: ['not in', items],
|
||||
...baseFilter,
|
||||
};
|
||||
return { for: ['not in', [itemNotFor]] };
|
||||
},
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user