mirror of
https://github.com/frappe/books.git
synced 2024-11-10 07:40:55 +00:00
refactor: batch-wise stock availability validation
This commit is contained in:
parent
1d188151e8
commit
ec31a3ba65
@ -132,15 +132,17 @@ export class StockManager {
|
||||
return;
|
||||
}
|
||||
|
||||
const ifItemHasBatchNumber = await this.fyo.getValue(
|
||||
const isItemHasBatchNumber = await this.fyo.getValue(
|
||||
'Item',
|
||||
details.item,
|
||||
'hasBatchNumber'
|
||||
);
|
||||
|
||||
if (!isItemHasBatchNumber) return;
|
||||
|
||||
const date = details.date.toISOString();
|
||||
const formattedDate = this.fyo.format(details.date, 'Datetime');
|
||||
|
||||
if (ifItemHasBatchNumber) {
|
||||
if (!details.batchNumber) {
|
||||
throw new ValidationError(
|
||||
t`Please enter Batch Number for ${details.item}`
|
||||
@ -171,7 +173,6 @@ export class StockManager {
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async #validateStockAvailability(details: SMIDetails) {
|
||||
if (!details.fromLocation) {
|
||||
|
Loading…
Reference in New Issue
Block a user