Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
1.3 kB
5
Indexable
Never
"SELECT
-- picking location
HL_EMPLACEMENT1.EMNEMP,
HL_EMPLACEMENT1.EMC1EM,
HL_EMPLACEMENT1.EMC2EM,
HL_EMPLACEMENT1.EMC3EM,
HL_EMPLACEMENT1.EMC4EM,
HL_EMPLACEMENT1.EMC5EM,
---- destination location
HL_EMPLACEMENT2.EMNEMP,
HL_EMPLACEMENT2.EMC1EM,
HL_EMPLACEMENT2.EMC2EM,
HL_EMPLACEMENT2.EMC3EM,
HL_EMPLACEMENT2.EMC4EM,
HL_EMPLACEMENT2.EMC5EM,'"+context.mvt_id+"','"+context.ligne+"'
FROM SD_HLMVTGP HL_MVT_GEI

JOIN SD_HLPRELP HL_PRELEVEMENT
ON HL_PRELEVEMENT.PVNSUP = HL_MVT_GEI.VGNSUP
AND HL_PRELEVEMENT.PVCACT = HL_MVT_GEI.VGCACT

JOIN SD_HLEMPLP HL_EMPLACEMENT1
ON HL_EMPLACEMENT1.EMNEMP = HL_PRELEVEMENT.PVNEPP

JOIN SD_HLEMPLP HL_EMPLACEMENT2
ON HL_EMPLACEMENT2.EMNEMP = HL_PRELEVEMENT.PVNEMD 

WHERE HL_MVT_GEI.VGNSUP = LTRIM(RTRIM('"+context.sscc_ini +"'))
AND HL_MVT_GEI.VGCACT = LTRIM(RTRIM('"+context.inicli +"'))
AND HL_MVT_GEI.VGSMVG = '+'
AND HL_MVT_GEI.VGCTST = '200'
AND HL_MVT_GEI.VGCTVG = '300'
AND HL_MVT_GEI.VGTGBL = '1'
AND HL_MVT_GEI.VGCMBG IN ('001', '003', '004')
AND 
(SUBSTR('00'||HL_MVT_GEI.VGSCRE, -2)||
 SUBSTR('00'||HL_MVT_GEI.VGACRE, -2)||
 SUBSTR('00'||HL_MVT_GEI.VGMCRE, -2)||
 SUBSTR('00'||HL_MVT_GEI.VGJCRE, -2)||
 SUBSTR(HL_MVT_GEI.VGHCRE, 1, 4)) = LTRIM(RTRIM('"+context.maj_mvt+"'))"