RE: Payment Application Batch Posted To Wrong Period
Rick,
Thank you again for your assistance with this issue. I believe that I have it all resolved at this point.
The only thing missing from your advice was to set the perappl to the correct period for aradjust transactions. (See below).
For future reference purposes, here are the exactly SQL updates that I ran after completing simple selects to confirm it was the data set I wanted affected.
update ardoc set perpost='201401' where batnbr='019475'
update ardoc set perclosed='201401' where batnbr='019475' and perclosed<'201401' and perclosed!=''
update artran set perpost='201401' where batnbr='019475'
update aradjust set adjgperpost='201401' where adjbatnbr='019475'
update aradjust set perappl='201401' where adjbatnbr='019475'
update ardoc set perclosed='201401' where custid+doctype+refnbr in (select custid+adjddoctype+adjdrefnbr from aradjust where adjbatnbr = '019475') and docbal = 0 and perclosed!='' and perclosed<'201401'
If I were doing this more frequently, I would write variables for the batch number and correct period number, but hopefully I won't need to do this much in the future. The values '201401' and '019475' need to be updated as necessary.
As a word of caution to anyone reading this in the future - backup your database before performing any of these procedures and always select data and review before running an update query.
Rick, thanks again for helping to solidify the correction plan.
Here's my LinkedIn - please stay in touch: http://lnkd.in/dzqQnU2
Best,
Jonathan Thayer