mirror of
https://github.com/frappe/books.git
synced 2026-08-24 10:04:45 -05:00
fix: add filter for uom
This commit is contained in:
@@ -659,8 +659,17 @@ export abstract class InvoiceItem extends Doc {
|
||||
);
|
||||
const conversionUoms = conversionItems.map((i) => i.uom) as string[];
|
||||
|
||||
const baseUnit = await doc.fyo.getValue(
|
||||
ModelNameEnum.Item,
|
||||
doc.item as string,
|
||||
'unit'
|
||||
);
|
||||
const validUoms = [...conversionUoms, baseUnit].filter(
|
||||
Boolean
|
||||
) as string[];
|
||||
|
||||
return {
|
||||
name: ['in', conversionUoms],
|
||||
name: ['in', validUoms],
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
@@ -65,8 +65,16 @@ export class StockMovementItem extends TransferItem {
|
||||
);
|
||||
const conversionUoms = conversionItems.map((i) => i.uom) as string[];
|
||||
|
||||
const baseUnit = await doc.fyo.getValue(
|
||||
ModelNameEnum.Item,
|
||||
doc.item as string,
|
||||
'unit'
|
||||
);
|
||||
const validUoms = [...conversionUoms, baseUnit].filter(
|
||||
Boolean
|
||||
) as string[];
|
||||
return {
|
||||
name: ['in', conversionUoms],
|
||||
name: ['in', validUoms],
|
||||
};
|
||||
},
|
||||
batch: async (doc: Doc) => {
|
||||
|
||||
@@ -483,7 +483,6 @@ export default defineComponent({
|
||||
this.row.set('setItemDiscountAmount', false);
|
||||
this.row.set('itemDiscountPercent', 0);
|
||||
}
|
||||
this.row.set('rate', this.fyo.pesa(0));
|
||||
|
||||
if (hasManualDiscount) {
|
||||
this.row.set('setItemDiscountAmount', true);
|
||||
|
||||
Reference in New Issue
Block a user