project QadFinancials > class BDDocument > method DefaultValuesDDocumentNumber
Parameters
icDDocumentRowid | input | character | |
icDDocumentType | input | character | |
iiDDocumentYear | input | integer | |
oiDDocumentNumber | output | integer | |
oiReturnStatus | output | integer | Return status of the method. |
Internal usage
QadFinancials
program code (program1/bddocument.p)
if icDDocumentRowid = ? or icDDocumentRowid = "":U or
iiDDocumentYear = ? or iiDDocumentYear = 0
then return.
find first bDDocument where
bDDocument.tc_Rowid = icDDocumentRowid
no-error.
if not available bDDocument
then return.
if icDDocumentType <> bDDocument.DDocumentType or bDDocument.DDocumentNumber = 0
then do:
if icDDocumentType <> bDDocument.DDocumentType and bDDocument.DDocumentNumber <> 0
then do:
assign vhFcComponent = ?.
<M-2 run ReleaseNumber
(input viCompanyId (iiCompanyId),
input iiDDocumentYear (iiNumbrYear),
input 'D':U + bDDocument.DDocumentType (icNumbrType),
input bDDocument.DDocumentNumber (iiNumbr),
input viFcCurrentInstanceId (iiInstanceId),
input vcFcComponentName (icClassName),
output viFcReturnSuper (oiReturnStatus)) in BNumber>
if viFcReturnSuper <> 0
then assign oiReturnStatus = viFCReturnSuper.
if oiReturnStatus < 0
then return.
end.
if icDDocumentType = ? or icDDocumentType = "":U
then assign bDDocument.DDocumentNumber = 0.
else do:
assign vhFcComponent = ?.
<M-1 run GetNumber
(input viCompanyId (iiCompanyId),
input iiDDocumentYear (iiNumbrYear),
input 'D':U + icDDocumentType (icNumbrType),
output bDDocument.DDocumentNumber (oiNumber),
input viFcCurrentInstanceId (iiInstanceId),
input vcFcComponentName (icClassName),
output viFcReturnSuper (oiReturnStatus)) in BNumber>
if viFcReturnSuper <> 0
then assign oiReturnStatus = viFCReturnSuper.
if oiReturnStatus < 0
then return.
end.
end.
assign bDDocument.DDocumentType = icDDocumentType
oiDDocumentNumber = bDDocument.DDocumentNumber.