fix : revert unnecessary changes

This commit is contained in:
Gadha2311
2025-09-17 11:29:31 +05:30
parent 5ff5e4b6c0
commit b0e995578b
2 changed files with 9 additions and 16 deletions
+1 -1
View File
@@ -69,7 +69,7 @@ export interface BaseField {
tab?: string; // UI Facing config, for grouping by tabs
abstract?: string; // Used to mark the location of a field in an Abstract schema
isCustom?: boolean; // Whether the field is a custom field
filters?: Record<string, string>;
filters?: Record<string, string>;
getOptions?: () => Promise<{ label: string; value: string }[]>;
}
+8 -15
View File
@@ -242,7 +242,7 @@
/>
</div>
<div v-if="shouldShowBatchQuantity" class="px-5 pt-6 col-span-2">
<div v-if="showAvlQuantityInBatch" class="px-5 pt-6 col-span-2">
<Float
:df="{
fieldname: 'availableQtyInBatch',
@@ -345,11 +345,11 @@ export default defineComponent({
isReadOnly() {
return this.row.isFreeItem;
},
shouldShowBatchQuantity(): boolean {
return !!(
showAvlQuantityInBatch() {
return (
this.row.links?.item &&
this.row.links?.item.hasBatch &&
this.itemVisibility === 'Inventory Items'
this.itemVisibility
);
},
},
@@ -401,25 +401,18 @@ export default defineComponent({
},
async getAvailableQtyInBatch(): Promise<number> {
if (!this.row.batch) {
this.availableQtyInBatch = 0;
return 0;
}
try {
const qty = await fyo.db.getStockQuantity(
return (
(await fyo.db.getStockQuantity(
this.row.item as string,
undefined,
undefined,
undefined,
this.row.batch
);
this.availableQtyInBatch = qty ?? 0;
return this.availableQtyInBatch;
} catch (error) {
this.availableQtyInBatch = 0;
return 0;
}
)) ?? 0
);
},
getDisplayTransferQuantity() {