Monday, September 28, 2009

Just Getting It Done

Here’s a link to a great blog entry by Joel Spolsky (Joel on Software) about programmers who just get the job done and delivered.  I’m a great believer in “good enough”.  Not perfectly designed, n-tier architecture, reusable web services, but maintainable code, works, gets the job done and gets delivered.

Enough said.  Read the article.

Friday, September 25, 2009

Stuck Open Payables Voucher

We recently had a client call with two payables voucher that were stuck open.  The amount remaining was $0 but there were no payments associated with it.  Because the amount remaining was $0, they were unable to apply any further payments.  In addition, running Check Links and Reconcile didn’t resolve the situation.

Time to open up Query Analyzer (yes they’re still on SQL 2000).  After some digging, we found that there were Apply records in the PM10200 (apply work table) and the PM20100 (apply open table) for the full amount of the transaction.  Additionally, the date invoice paid off (DINVPDOF) was set and the current transaction amount (CURTRXAM) was set to $0.

The solution was to remove the apply records, clear out the date invoice paid off and set the current transaction amount to the document amount as follows:

--Delete orphanned apply to records from  the
--work table.
DELETE FROM PM10200
     WHERE VENDORID = '<<MyVendorID>>'
         AND APTVCHNM IN ('<<MyVoucherNumber1>>', '<<MyVoucherNumber2>>')

DELETE FROM PM20100
     WHERE VENDORID = '<<MyVendorID>>'
         AND APTVCHNM IN ('<<MyVoucherNumber1>>', '<<MyVoucherNumber2>>')

--Update the PM transaction header to set the
--current amount due (CURTRXAM) to the full
--document amount and the date invoice paid off
--(DINVPDOF) to empty (1/1/1900)
UPDATE PM20000 SET
        CURTRXAM = DOCAMNT
        ,DINVPDOF = '1/1/1900'
    WHERE VENDORID = '<<MyVendorID>>'
        AND VCHRNMBR IN ('<<MyVoucherNumber1>>', '<<MyVoucherNumber2>>')

For good measure, we ran Check Links against the Payables Transaction Logical File after completing this.  It didn’t register any errors with the specific vouchers.