mirror of
https://github.com/frappe/books.git
synced 2026-08-24 10:04:45 -05:00
fix : revert unnecessary changes
This commit is contained in:
+1
-1
@@ -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 }[]>;
|
||||
}
|
||||
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user