project QadFinancials > class PMFGLegalDocument > method UpdateLegalDocument

Description

Method: calls an MFG/PRO API that will be used to update the invoice number and invoice date on a legal document record.


Parameters


icDomainCodeinputcharacterDomain code for the working domain.
icLegalDocNbrinputcharacterThe legal document number to be updated.
icSupplierinputcharacterThe supplier code used on the supplier invoice.
itEffectiveIssueDateinputdateEffective issue date of the legal document to be updated.
itCInvoiceDateinputdateSupplier invoice date.
iiCInvoiceYearinputintegerPosting year used on the supplier invoice.
icCInvoiceJournalCodeinputcharacterThe daybook code used on the supplier invoice.
iiCInvoiceVoucherinputintegerSupplier invoice voucher number.
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


unused


program code (program1/pmfglegaldocument.p)

if oiReturnStatus = 0 then
    assign oiReturnStatus = -98.

create tLegalDocument.
assign tLegalDocument.tcDomainCode          = icDomainCode
       tLegalDocument.tcSupplier            = icSupplier
       tLegalDocument.tcLegalDocNbr         = icLegalDocNbr
       tLegalDocument.ttEffectiveIssueDate  = itEffectiveIssueDate
       tLegalDocument.ttCInvoiceDate        = itCInvoiceDate
       tLegalDocument.tiCInvoiceVoucher     = iiCInvoiceVoucher
       tLegalDocument.tiCInvoiceYear        = iiCinvoiceYear
       tLegalDocument.tcCInvoiceJournalCode = icCInvoiceJournalCode.


assign  vhIn    = ?
        vhInOut = dataset tLegalDocument:handle
        vhOut   = ?.

<M-81 run CallService
   (input  vcDefaultMfgProgram (icProgramName), 
    input  'UpdateLegalDocument':U (icMethodName), 
    input  vhIn (izInput), 
    input-output vhInOut (bzInputOutput), 
    input-output vhOut (bzOutput), 
    input  ? (icAsyncHandler), 
    output viFcReturnSuper (oiReturnStatus)) in PMFGLegalDocument>
    
if viFcReturnSuper <> 0 then 
    assign oiReturnStatus = viFcReturnSuper.

for first tLegalDocument:
    assign oiReturnStatus = tLegalDocument.tiReturnStatus.
end. /* for first...*/

if oiReturnStatus = -98 then
    assign oiReturnStatus = 0.
    
delete object vhInOut.