mirror of
https://github.com/frappe/books.git
synced 2024-11-09 23:30:56 +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 = {
|
static filters: FiltersMap = {
|
||||||
item: (doc: Doc) => {
|
item: (doc: Doc) => {
|
||||||
const itemList = doc.parentdoc!.items as Doc[];
|
|
||||||
const items = itemList.map((d) => d.item as string).filter(Boolean);
|
|
||||||
|
|
||||||
let itemNotFor = 'Sales';
|
let itemNotFor = 'Sales';
|
||||||
if (doc.isSales) {
|
if (doc.isSales) {
|
||||||
itemNotFor = 'Purchases';
|
itemNotFor = 'Purchases';
|
||||||
}
|
}
|
||||||
|
|
||||||
const baseFilter = { for: ['not in', [itemNotFor]] };
|
return { for: ['not in', [itemNotFor]] };
|
||||||
if (items.length <= 0) {
|
|
||||||
return baseFilter;
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
name: ['not in', items],
|
|
||||||
...baseFilter,
|
|
||||||
};
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user