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:
parent
299cd83cc9
commit
f2bbe5479e
@ -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) {
|
||||
|
@ -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) {
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user