2
0
mirror of https://github.com/frappe/books.git synced 2024-12-22 19:09:01 +00:00

fix: serial number validation

This commit is contained in:
akshayitzme 2023-05-08 15:07:13 +05:30 committed by Alan
parent 299cd83cc9
commit f2bbe5479e
3 changed files with 12 additions and 0 deletions

View File

@ -145,6 +145,10 @@ export class StockMovement extends Transfer {
}
async function validateSerialNumberStatus(doc: StockMovement) {
if (doc.isCancelled) {
return;
}
for (const { serialNumber, item } of getSerialNumberFromDoc(doc)) {
const cannotValidate = !(await canValidateSerialNumber(item, serialNumber));
if (cannotValidate) {

View File

@ -312,6 +312,10 @@ export abstract class StockTransfer extends Transfer {
}
async function validateSerialNumberStatus(doc: StockTransfer) {
if (doc.isCancelled) {
return;
}
for (const { serialNumber, item } of getSerialNumberFromDoc(doc)) {
const cannotValidate = !(await canValidateSerialNumber(item, serialNumber));
if (cannotValidate) {

View File

@ -52,6 +52,10 @@ async function validateItemRowBatch(
}
export async function validateSerialNumber(doc: StockMovement | StockTransfer) {
if (doc.isCancelled) {
return;
}
for (const row of doc.items ?? []) {
await validateItemRowSerialNumber(row);
}