icMfgTableName | input | character | Name 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. |
icFinancialTableName | input | character | Name 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. |
ihFinancialDataBuffer | input | handle | |
ihMfgDataBuffer | input | handle | |
icMfgDomain | input | character | |
oiReturnStatus | output | integer | Return status of the method. |
<ANCESTOR-CODE> if oiReturnStatus = 0 then oiReturnStatus = -98. /* update the mfg table according the values of Payment Condition fields value */ if available tCopyPaymentCondition then do: /* sync some simple fields */ assign tct_mstr.ct_mod_date = today tct_mstr.ct_userid = vcUserLogin. /* sync PaymentConditionPaymentType */ if tCopyPaymentCondition.PaymentConditionPaymentTyp = {&PAYMENTCONDITIONPAYMENTTYPE-STAGED} then assign tct_mstr.ct_dating = yes. else assign tct_mstr.ct_dating = no. /* sync discount days if not both are 0 */ /* months */ if tCopyPaymentCondition.PaymentConditionPdDiscType = {&PAYMENTCONDITIONPERIODTYPE-MONTHS} then assign tct_mstr.ct_disc_days = (tCopyPaymentCondition.PaymentConditionDayMthDisc * 30) + tCopyPaymentCondition.PaymentConditionSupDayDisc. /* days */ else if tCopyPaymentCondition.PaymentConditionPdDiscType = {&PAYMENTCONDITIONPERIODTYPE-DAYS} then assign tct_mstr.ct_disc_days = tCopyPaymentCondition.PaymentConditionDayMthDisc + tCopyPaymentCondition.PaymentConditionSupDayDisc. /* FortNight */ else if tCopyPaymentCondition.PaymentConditionPdDiscType = {&PAYMENTCONDITIONPERIODTYPE-FORTNIGHT} then assign tct_mstr.ct_disc_days = (tCopyPaymentCondition.PaymentConditionDayMthDisc * 15) + tCopyPaymentCondition.PaymentConditionSupDayDisc. /* Week */ else if tCopyPaymentCondition.PaymentConditionPdDiscType = {&PAYMENTCONDITIONPERIODTYPE-WEEK} then assign tct_mstr.ct_disc_days = (tCopyPaymentCondition.PaymentConditionDayMthDisc * 7) + tCopyPaymentCondition.PaymentConditionSupDayDisc. else assign tct_mstr.ct_disc_days = 0. /* sync ct_from_inv by period type of discount */ if tCopyPaymentCondition.PaymentConditionPdDiscType = {&PAYMENTCONDITIONPERIODTYPE-DAYS} then assign tct_mstr.ct_from_inv = 1. else if tCopyPaymentCondition.PaymentConditionPdDiscType = {&PAYMENTCONDITIONPERIODTYPE-MONTHS} then tct_mstr.ct_from_inv = 2. else if tCopyPaymentCondition.PaymentConditionPdDiscType = {&PAYMENTCONDITIONPERIODTYPE-FORTNIGHT} then assign tct_mstr.ct_from_inv = 3. else if tCopyPaymentCondition.PaymentConditionPdDiscType = {&PAYMENTCONDITIONPERIODTYPE-WEEK} then assign tct_mstr.ct_from_inv = 4. /* sync normal due days */ /* months */ if tCopyPaymentCondition.PaymentConditionPeriodType = {&PAYMENTCONDITIONPERIODTYPE-MONTHS} then assign tct_mstr.ct_due_days = (tCopyPaymentCondition.PaymentConditionDaysMonths * 30) + tCopyPaymentCondition.PaymentConditionSupplDays. /* days */ else if tCopyPaymentCondition.PaymentConditionPeriodType = {&PAYMENTCONDITIONPERIODTYPE-DAYS} then assign tct_mstr.ct_due_days = tCopyPaymentCondition.PaymentConditionDaysMonths + tCopyPaymentCondition.PaymentConditionSupplDays. /* FORTNIGHT */ else if tCopyPaymentCondition.PaymentConditionPeriodType = {&PAYMENTCONDITIONPERIODTYPE-FORTNIGHT} then assign tct_mstr.ct_due_days = (tCopyPaymentCondition.PaymentConditionDaysMonths * 15) + tCopyPaymentCondition.PaymentConditionSupplDays. /* WEEKS */ else if tCopyPaymentCondition.PaymentConditionPeriodType = {&PAYMENTCONDITIONPERIODTYPE-WEEK} then assign tct_mstr.ct_due_days = (tCopyPaymentCondition.PaymentConditionDaysMonths * 7 ) + tCopyPaymentCondition.PaymentConditionSupplDays . else assign tct_mstr.ct_due_days = 0. /* sync period type */ if tCopyPaymentCondition.PaymentConditionPeriodType = {&PAYMENTCONDITIONPERIODTYPE-DAYS} then assign tct_mstr.ct_due_inv = 1. else if tCopyPaymentCondition.PaymentConditionPeriodType = {&PAYMENTCONDITIONPERIODTYPE-MONTHS} then assign tct_mstr.ct_due_inv = 2. else if tCopyPaymentCondition.PaymentConditionPeriodType = {&PAYMENTCONDITIONPERIODTYPE-FORTNIGHT} then assign tct_mstr.ct_due_inv = 3. else if tCopyPaymentCondition.PaymentConditionPeriodType = {&PAYMENTCONDITIONPERIODTYPE-WEEK} then assign tct_mstr.ct_due_inv = 4. /* sync ct_mtd_disc by period type of discount */ if tCopyPaymentCondition.PaymentConditionPdDiscType = {&PAYMENTCONDITIONPERIODTYPE-MONTHS} then assign tct_mstr.ct_mtd_disc = yes. else assign tct_mstr.ct_mtd_disc = no. /* sync ct_mtd_due by period type of normal */ if tCopyPaymentCondition.PaymentConditionPeriodType = {&PAYMENTCONDITIONPERIODTYPE-MONTHS} then assign tct_mstr.ct_mtd_due = yes. else assign tct_mstr.ct_mtd_due = no. end. /* end of if available tCopyPaymentCondition */ if oiReturnStatus = -98 then assign oiReturnStatus = 0.