fix sort posMasterNo

This commit is contained in:
AdisakKanthawilang 2024-02-29 17:49:39 +07:00
parent 6642f395f0
commit 019bdfcd1d

View file

@ -1497,7 +1497,10 @@ export class PositionController extends Controller {
posMaster.orgChild4Id = org.id;
posMaster.orgRevisionId = org.orgRevisionId;
}
}
}
const allPosMasterNo = posMasters.map(posMaster => posMaster.posMasterNo);
const maxPosMasterNo = Math.max(...allPosMasterNo);
posMaster.posMasterNo = maxPosMasterNo + 1;
posMaster.createdUserId = request.user.sub;
posMaster.createdFullName = request.user.name;
posMaster.lastUpdateUserId = request.user.sub;