SELECT
InstructionLineItem.instructLineItemID,
InstructionLineItem.amount,
InstructionLineItem.caseID,
InstructionLineItem.concernRoleID,
InstructionLineItem.caseNomineeID,
InstructionLineItem.currencyTypeCode,
ProductDelivery.productType,
Payslip.recipientName,
Payslip.paySlipInstructionID,
CaseDecisionObjective.relatedReference,
ServiceInvoice.serviceInvoiceID,
Payslip.payslipID,
Payslip.addressID,
Payslip.versionNo
INTO
:instructLineItemID,
:amount,
:caseid,
:concernRoleID,
:caseNomineeID,
:currencyTypeCode,
:productType,
:recipientName,
:payslipInstructionID,
:relatedReference,
:serviceInvoiceID,
:payslipID,
:addressID,
:versionNo
FROM
Payslip,
PayslipComponent,
InstructionLineItem,
ProductDelivery,
CaseDecisionFinancialComp,
CaseDecisionObjective,
ServiceInvoiceLineItem,
ServiceInvoice
WHERE Payslip.statusCode = :statusCode
AND ProductDelivery.productType = :productType
AND PayslipComponent.recipientTypeCode = :recipientTypeCode
AND CaseDecisionFinancialComp.financialCompID = InstructionLineItem.financialCompID
AND CaseDecisionObjective.caseDecisionObjectiveID = CaseDecisionFinancialComp.caseDecisionObjectiveID
AND ProductDelivery.caseID = InstructionLineItem.caseID
AND CaseDecisionObjective.overflowInd = '0'
AND cast(ServiceInvoiceLineItem.serviceInvoiceLineItemID as char(20)) = CaseDecisionObjective.relatedReference
AND ServiceInvoice.serviceInvoiceID = ServiceInvoiceLineItem.serviceInvoiceID
AND PayslipComponent.pslipInstructionID = Payslip.paySlipInstructionID
AND PayslipComponent.instructLineItemID = InstructionLineItem.instructLineItemID
ORDER BY concernRoleID,
caseNomineeID,
serviceInvoiceID,
serviceInvoiceLineItemID ASC
|