project QadFinancials > class BPosting > method CalcAllPostingLineForGLOpenItemRec
query calculated fields procedure
Description
Assign a value to query calculated fields
Parameters
iiCompanyId | input | integer | Company id |
iiGLID | input | integer | |
itFromPostingDate | input | date | |
itToPostingDate | input | date | |
itPostingDate | input | date | |
icLayerType | input | character | layer type |
iiJournalID | input | integer | |
icJournalCodes | input | character | List of Journal codes |
icDivisionCode | input | character | |
icCostCentreCode | input | character | |
icProjectCode | input | character | |
iiCurrencyID | input | integer | |
oiReturnStatus | output | integer | Return status of the method. |
Internal usage
QadFinancials
program code (program1/bposting.p)
/* fill translatable values before the loop, otherwise bad performance */
assign vcAllocationTypeLater = {&ALLOCATIONTYPE-LATER-TR}
vcAllocationTypeNew = {&ALLOCATIONTYPE-NEW-TR}
vcAllocationTypeLink = {&ALLOCATIONTYPE-LINK-TR}.
create query vhQuery in widget-pool "non-persistent".
vhQuery:forward-only = yes.
vhQuery:set-buffers(ih_Buffer).
vhQuery:query-prepare("for each ":U + ih_Buffer:table).
vhQuery:query-open().
vhQuery:get-first().
do while not vhQuery:query-off-end:
assign {&tdPostingLineTC} = {&tdPostingLineDebitTC} - {&tdPostingLineCreditTC}
{&tdPostingLineLC} = {&tdPostingLineDebitLC} - {&tdPostingLineCreditLC}
{&tdPostingLineCC} = {&tdPostingLineDebitCC} - {&tdPostingLineCreditCC}
{&tcAllocationType} = (if {&tcGLOpenItemMovementType} = "":U or
{&tcGLOpenItemMovementType} = ?
then vcAllocationTypeLater
else if {&tcGLOpenItemMovementType} = {&MOVEMENTTYPE-INITIAL}
then vcAllocationTypeNew
else vcAllocationTypeLink).
vhQuery:get-next().
end.
vhQuery:query-close().
delete object vhQuery.