Database SQL Operation: CaseApprovalCheck.readOrgUnitCheckForPercentage
Description: | Reads Org Unit Product Approval Check for its percentage amount |
Sterotype: | ns |
SELECT
DISTINCT(percentage)
INTO
:percentage
FROM
CaseApprovalCheck,
PositionHolderLink,
Position,
OrganisationUnit,
OrgUnitPositionLink
WHERE percentage =
(
SELECT
MAX(percentage)
FROM
CaseApprovalCheck,
PositionHolderLink,
Position,
OrganisationUnit,
OrgUnitPositionLink
WHERE PositionHolderLink.userName = :userName
AND Position.positionID = PositionHolderLink.positionID
AND
(
(
OrgUnitPositionLink.organisationUnitID = OrganisationUnit.organisationUnitID
)
AND
(
OrgUnitPositionLink.positionID = Position.positionID
)
)
AND CaseApprovalCheck.typeCode = :typeCode
AND CaseApprovalCheck.estimatedCost = :estimatedCost
AND CaseApprovalCheck.statusCode = :statusCode
)
AND PositionHolderLink.userName = :userName
AND Position.positionID = PositionHolderLink.positionID
AND
(
(
OrgUnitPositionLink.organisationUnitID = OrganisationUnit.organisationUnitID
)
AND
(
OrgUnitPositionLink.positionID = Position.positionID
)
)
AND CaseApprovalCheck.typeCode = :typeCode
AND CaseApprovalCheck.estimatedCost = :estimatedCost
AND CaseApprovalCheck.statusCode = :statusCode
|