mirror of
https://github.com/frappe/books.git
synced 2025-01-03 15:17:30 +00:00
fix: StockTransfer item filter
This commit is contained in:
parent
5f66cfe5d5
commit
b460e96c97
@ -11,6 +11,7 @@ import { ValidationError } from 'fyo/utils/errors';
|
|||||||
import { ModelNameEnum } from 'models/types';
|
import { ModelNameEnum } from 'models/types';
|
||||||
import { Money } from 'pesa';
|
import { Money } from 'pesa';
|
||||||
import { safeParseFloat } from 'utils/index';
|
import { safeParseFloat } from 'utils/index';
|
||||||
|
import { StockTransfer } from './StockTransfer';
|
||||||
|
|
||||||
export class StockTransferItem extends Doc {
|
export class StockTransferItem extends Doc {
|
||||||
item?: string;
|
item?: string;
|
||||||
@ -28,6 +29,12 @@ export class StockTransferItem extends Doc {
|
|||||||
hsnCode?: number;
|
hsnCode?: number;
|
||||||
batch?: string;
|
batch?: string;
|
||||||
|
|
||||||
|
parentdoc?: StockTransfer;
|
||||||
|
|
||||||
|
get isSales() {
|
||||||
|
return this.schemaName === ModelNameEnum.ShipmentItem;
|
||||||
|
}
|
||||||
|
|
||||||
formulas: FormulaMap = {
|
formulas: FormulaMap = {
|
||||||
description: {
|
description: {
|
||||||
formula: async () =>
|
formula: async () =>
|
||||||
@ -198,6 +205,7 @@ export class StockTransferItem extends Doc {
|
|||||||
static filters: FiltersMap = {
|
static filters: FiltersMap = {
|
||||||
item: (doc: Doc) => {
|
item: (doc: Doc) => {
|
||||||
let itemNotFor = 'Sales';
|
let itemNotFor = 'Sales';
|
||||||
|
console.log(doc.schemaName, doc.isSales);
|
||||||
if (doc.isSales) {
|
if (doc.isSales) {
|
||||||
itemNotFor = 'Purchases';
|
itemNotFor = 'Purchases';
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user