project BLF > class BWorkObject > method UpdateInvoiceNumbers
Description
When domain is using consecutive invoice numbering, then a temporary number was used to create the WorkObject. All occurences of this number will be changed with the correct permanent number at moment of presave of the invoice.
Parameters
Internal usage
QadFinancials
program code (program6/bworkobject.p)
/* Error Handling */
assign oiReturnStatus = -98
viLocalReturnStatus = 0.
UPDATEBLOCK:
do:
for each tUpdateInvoiceNumbersWorkObj:
find tWorkObject where
tWorkObject.tc_Status <> 'D':U and
index(tWorkObject.WorkObjectInstruction, trim(string(tUpdateInvoiceNumbersWorkObj.tiTempVoucher))) <> 0
no-error.
if available tWorkObject
then assign tWorkObject.WorkObjectInstruction = replace(tWorkObject.WorkObjectInstruction, string(tUpdateInvoiceNumbersWorkObj.tiTempVoucher), string(tUpdateInvoiceNumbersWorkObj.tiNewVoucher)) no-error.
end. /* for each tUpdateInvoiceNumbersWorkObj: */
end. /* UPDATEBLOCK */
/* Error handling */
assign oiReturnStatus = viLocalReturnStatus.