Change Payment Terms for parent and children, all open orders

Eric Lehti

VIP Member
On December 31 we want to change Payment Terms for one customer and its many children.
Terms will be 'Net 30 days' for all existing open sales orders and all future orders.

In the example below, F4211 records are always purged to Sales History (F42119) during Sales Update (DREAM writer P42800 processing option 16).
Export from F0150 "Address Organization Structure Master" all the children belonging to this parent (WHERE MAPA8 = parentNbr) to work file CHILD.

INSERT one row into CHILD table, SET MAAN8 = parentNbr. The CHILD table is now ready for the next steps.

Determine from F0014 "Payment Terms" which code exists for 'Net 30 Days'. The value 'N30' is "Net 30 Days".

To change payment terms for all future orders, run this SQL statement:
update f0301 SET A5TRAR='N30' where A5AN8 in (select MAAN8 from CHILD)

To change payment terms on all existing open orders, run these SQL statements:
update f4201 SET SHPTC ='N30' where SHAN8 in (select MAAN8 from CHILD)
update f4211 SET SDPTC ='N30' where SDAN8 in (select MAAN8 from CHILD)

Forgotten anything?
 
Just a thought, as we don't purge sales detail until completed with the Sales Update, P42800, you may not want to change any records that have a Next Status of 620 or greater since the invoice has already printed with the "old" payment terms. Sometimes detail records are delayed after invoiceing for one reason or another and don't get moved to history immediately.

Also both the F4201 and the F4211 contain the Parent Address Book number in the SHPA8 and SDPA8, respectively. You may want to verify that the Parent AN8 you want to have the new terms is already in these fields as it would make the update somewhat easier.
 
Back
Top