Description
Update the GL code on a posting line that was created by manual input.
Parameters
| itPostingDate | input | date | posting date |
| icProjectCode | input | character | |
| icCostCentreCode | input | character | |
| icComponentList | input | character | Chr(2) separated list of extra components to check during SAF defaulting. |
| icComponentValueList | input | character | Chr(2) separated list of extra component values to check during SAF defaulting. |
| icLayerTypeCode | input | character | |
| tUpdatePostingLine | input-output | temp-table | posting line |
| tUpdatePostingSaf | input-output | temp-table | saf |
| tUpdatePostingLineEnabling | output | temp-table | enabling |
| tPostingLineSafStructures | output | temp-table | SAF Structures |
| iiBusinessRelation_ID | input | integer | Business Relation ID |
| icCurrencyCode | input | character | |
| icDivisionCode | input | character | Sub-Account Code |
| oiReturnStatus | output | integer | Return status of the method. |
Internal usage
unused
program code (program6/bjournalentry.p)
assign oiReturnStatus = -98.
/* For defect 10259-0087: When modify the postinline record tUpdatePostingLine should get record first */
for each tUpdatePostingLine:
if tUpdatePostingLine.tcGLCode <> '':U
then do:
<Q-6 run GLBeginsUnitOnGLChange (all) (Read) (NoCache)
(input tUpdatePostingLine.Company_ID, (CompanyID)
input tUpdatePostingLine.tcGLCode, (GLCode)
output dataset tqGLBeginsUnitOnGLChange) in BGL >
find first tqGLBeginsUnitOnGLChange
where tqGLBeginsUnitOnGLChange.tcGLCode = tUpdatePostingLine.tcGLCode no-error.
if not available tqGLBeginsUnitOnGLChange
then do:
find tqGLBeginsUnitOnGLChange
where tqGLBeginsUnitOnGLChange.tcGLCode BEGINS tUpdatePostingLine.tcGLCode no-error.
/* if there's only one record */
if available tqGLBeginsUnitOnGLChange
then assign tUpdatePostingLine.tcGLCode = tqGLBeginsUnitOnGLChange.tcGLCode.
/* Ambiguous records will not be found and available will be false */
else do:
oiReturnStatus = -4.
return.
end.
end.
if available tqGLBeginsUnitOnGLChange
then do:
assign tUpdatePostingLine.tcUnitCode = tqGLBeginsUnitOnGLChange.tcUnitCode.
<M-3 run PostingLineGLUpdate
(input itPostingDate (itPostingDate),
input icProjectCode (icProjectCode),
input icCostCentreCode (icCostCentreCode),
input icComponentList (icComponentList),
input icComponentValueList (icComponentValueList),
input icLayerTypeCode (icLayerTypeCode),
input iiBusinessRelation_ID (iiBusinessRelation_ID),
input icCurrencyCode (icCurrencyCode),
input icDivisionCode (icDivisionCode),
output oiReturnStatus (oiReturnStatus)) in BJournalEntry>
end. /* if available tqGLForUnitOnGLChange */
else tUpdatePostingLine.tcUnitCode = "":U.
end. /* if tUpdatePostingLine.tcGLCode <> '':U */
leave.
end. /* for each tUpdatePostingLine: */
if oiReturnStatus = -98 then assign oiReturnStatus = 0.