project QadFinancials > class BMfgCreditTermsDetail > method UpdateMfgData

Description

Controls the processing of any update logic that is required when performing a create/modfiy operation on an MFG/PRO business component.
KEEP THE ANCESTOR TAG IN THE DESCENDANTS TO AVOID SCOPING PROBLEMS ON THE RECORD-AVAILABILITY
This method is the place holder for nay update ligic and complex mapping from the financials table to MFG/PRO.


Parameters


icMfgTableNameinputcharacterName of the MFG/PRO table name that is currently being processed. This is used to determine which logic to execute within the method in the cases where one business component maps to multiple tables in MFG/PRO.
icFinancialTableNameinputcharacterName of the Financial table name that is currently being processed. This is used to determine which logic to execute within the method in the cases where one business component has multiple tables that map to MFG/PRO.
ihFinancialDataBufferinputhandle
ihMfgDataBufferinputhandle
icMfgDomaininputcharacter
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


unused


program code (program/bmfgcredittermsdetail.p)

<ANCESTOR-CODE>

if oiReturnStatus = 0
then oiReturnStatus = -98.                             

/* update the mfg table according the values of Payment Condition fields value */
if available tCopyPaymentConditionStaged and tCopyPaymentConditionStaged.tc_Status = 'N':U
then do:    
    /* ======================================================================== */
    /* Create a query to extract the payment condition detail sequence from the MFG/PRO database */
    /* ======================================================================== */
    /* get credit term detail sequence by domain, payment condition code and detail code */    
    <Q-1 run DetailSeqByDomainCode (first)  (Read)  (NoCache)  (input vcCreditTermsDetailDomain, (Domain) 
                                input tCopyPaymentConditionStaged.tcPaymentConditionCode, (PaymentConditionCode)
                                output dataset tqDetailSeqByDomainCode) in BMfgCreditTermsDetail >
    find first tqDetailSeqByDomainCode no-error.
    if available tqDetailSeqByDomainCode
    then do:
        if tqDetailSeqByDomainCode.tictd_seq > viMaxSequence 
        then assign viMaxSequence = tqDetailSeqByDomainCode.tictd_seq + 1.
        else assign viMaxSequence = viMaxSequence + 1.
    end. /* end of if available */
    else do:
         assign viMaxSequence = viMaxSequence + 1.
    end.
    
    assign tctd_det.ctd_seq = viMaxSequence.
end. /* end of if available tCopyPaymentCondition */
if oiReturnStatus = -98
then assign oiReturnStatus = 0.