diff --git a/src/controllers/CommandController.ts b/src/controllers/CommandController.ts index 537236ce..dbe5c5db 100644 --- a/src/controllers/CommandController.ts +++ b/src/controllers/CommandController.ts @@ -3041,7 +3041,7 @@ export class CommandController extends Controller { const orgRevision = await this.orgRevisionRepo.findOne({ where: { id: posMasters[0].orgRevisionId } }); - if (orgRevision != null) { + if (orgRevision != null && orgRevision.isLock == false) { await this.orgRevisionRepo.update(orgRevision.id, { isLock: true, }); @@ -3547,7 +3547,8 @@ export class CommandController extends Controller { where: { id: revisionId }, relations: ["posMasters"] }); - if (orgRevision != null && !orgRevision?.posMasters.filter(x => x.statusReport === "REPORT") + if (orgRevision != null && !["REPORT"].includes( + orgRevision.posMasters.find(x => x.statusReport === "REPORT")?.statusReport || "") ) { await this.orgRevisionRepo.update(orgRevision.id, { isLock: false,