Check posting when check amount differs from pending receipt amount

Discussions concerning general integration topics.

Moderator: Phil Barton

joe.mag
Posts: 122
Joined: Thu Aug 04, 2011 3:11 pm

Re: Check posting when check amount differs from pending receipt amount

Post by joe.mag »

Bob, as always, you are exceedingly helpful and I appreciate you taking the time and effort to share this information. I guess I'm revealing my more procedural upbringing as the reliance on Tags, albeit logical, takes some effort for me to get my head around it.

If I read correctly, I need to make sure the Tags collection of the Check Transaction is properly populated so that the Transaction Manager has access to all the information needed to result in a coherent transaction. I gather that some of the required tag elements may already exist on a transaction but others may have to be added by me. As you observe, the ledger and OrderInformation can serve as the source of tag values. Here are the things that are tripping me up:

- How do I know what tags are required (other than by analyzing thrown exceptions until I get things to work)?
- Is there an enumeration of tag names? When I get an exception such as "Payee code is required" I imagine that means I need a tag for payee code but I'm not sure what the exact name of the tag I insert into the collection should be nor what the expected type is (e.g. GUID ID of a contact or the name of the contact or something else) For example, I tried adding a tag to address the missing Payee Code like this: trans.Tags.Add(new Tag("PayeeCode", "T")); to indicated that the title company "T" is the receipient of the check but I still get the same "Payee code is required" error!

I feel like I'm close but just having trouble closing the gap. I apologize if all of this is explained in the SDK guide or other dev forum posts but, while I have searched high and low, I have yet to find an answer!
BobRichards
Posts: 1376
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Check posting when check amount differs from pending receipt amount

Post by BobRichards »

The reliance of tags to pass required information instead of strongly typed interfaces with all required properties easily visible is a design pattern the ProTrust group decided on at the beginning. I will not defend it as it has been a perpetual thorn in the collective side of everyone that has been forced to interact with ProTrust on a low level. (Ahhh. I feel better now.)

There is a list of ProTrust tag names at namespace "SoftPro.Accounting.Client" in the "Constants" class. Check the SDK.

The proper way to set the tag is with contact's Guid converted to a string - not the contact code. You probably should do something like this.

Code: Select all

using SoftPro.Accounting.Client;  // "Constants" class name space.

IOrderContact firstTitleCompany = orderInformation.Contacts.Where(c => c.Type == "T").Single();
trans.Tags.Add(new Tag(Constants.OrderContactIDProperty, firstTitleCompany.ID.ToString()));
Bob Richards, Senior Software Developer, SoftPro
joe.mag
Posts: 122
Joined: Thu Aug 04, 2011 3:11 pm

Re: Check posting when check amount differs from pending receipt amount

Post by joe.mag »

To anyone who reads through this issue, let me give them closure.

I'll do my best to explain our experience, but I'm not a user of SoftPro so I may get some of the details wrong.

To restate our goal: we want to use the API to post the receipt of a check from the closing attorney or buyer to the register. This is part of a larger effort to automate the processing of Final Title Opinions and incoming closing checks to Select.

We concluded that interacting with the pending receipt that is automatically created in our implementation of SoftPro Select was a dead end. This transaction appears to have special properties, presumably since it is created as part of the order creation process. Since we're an attorney state, roughly 50% of the checks we receive do not exactly match the pending receipt created in the register by Select. All of our attempts to set the existing pending receipt's amount to the check amount failed when the amounts didn't match precisely. [Everything works great if the amounts do match.] We found that creating a new receipt transaction in the amount of the check did work (i.e. a new IReceiptTransaction). Select's automatic transaction balancing code then handled the discrepancy by generating additional transactions to keep the order in balance.

Finally, and I'm a little foggy on this, but my business people had me set the transaction's Order Contact ID to be either the attorney (code AT) or the buyers all (code BA) depending on the template that was used to create the order. I'm not sure this part is essential.

BTW, the idea of creating a check transaction that was suggested in this thread didn't get us closer to our goal since, as best we could tell, checks are only for outgoing funds, not for incoming.

I'll provide sample code in the next post.
joe.mag
Posts: 122
Joined: Thu Aug 04, 2011 3:11 pm

Re: Check posting when check amount differs from pending receipt amount

Post by joe.mag »

Code: Select all

// set up of the various objects like ledger manager and Transaction Manager are left out
// but you can find them in earlier posts and elsewhere in the forum
	
IReceiptTransaction recNew = tm.NewTransaction<IReceiptTransaction>(ledInfo);
recNew.Status = TransactionStatus.Pending;

// apply the full amount
var applied = recNew.Splits.Single(s => s.Kind == TransactionSplitKind.Applied);
applied.Amount = checkAmount;

recNew.Amount = checkAmount;
recNew.FromCheck = "1234"; // check's serial number
recNew.Name = activeName; // this is either the AT or the BA

// activeGuid is either the GUID or the AT contact or the BA contact to match above
recNew.Tags.Add(new Tag(SoftPro.Accounting.Client.Constants.OrderContactIDProperty, activeGuid.ToString()));

recNew.Status = TransactionStatus.Posted;
tm.ApplyChanges(recNew.RequiresAdjustmentReason ? "Check from " + strEntity : null, recNew);
Post Reply