Notification of Fee Change

Discussions related to custom development with Select.
Post Reply
oleksiy_tereshchenko
Posts: 8
Joined: Fri Oct 10, 2014 2:45 pm

Notification of Fee Change

Post by oleksiy_tereshchenko »

Need help with publishing fee change events to external system.

It is our understanding that there is no specific event for fees and we need to subscribe to order change event. On order change event code below can be executed. HistoryItem description property will have xml describing change.

Could you please let us know, if this is only option we have? If not, what else is available?

OrderIdentifier id;

// Open found order.
using (IOrder order2 = os.OpenOrder(search, false))
{
try
{
dynamic dynamicOrder = (dynamic)order2;

os.ApplyChanges(order2);

id = order2.Identifier;
}
finally
{
os.CloseOrder(order2);
}
}
IOrderHistory[] orderHistory = os.GetOrderHistory(id);

foreach( IOrderHistory historyItem in orderHistory )
{
var desc = historyItem.Description;
}
BobRichards
Posts: 1377
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Notification of Fee Change

Post by BobRichards »

Comparing prior order versions with the OrderChanged event is the best way to go. While the IOrderHistory interface public, it should be left for SoftPro consumption. IOrderHistory does not track all changes a Dev may be interested and it definitely does not track your fees.
Bob Richards, Senior Software Developer, SoftPro
sindrapal
Posts: 42
Joined: Tue Oct 14, 2008 9:21 am

Re: Notification of Fee Change

Post by sindrapal »

The other option is to subscribe to the FeeDetailChanged event notification. You get notified when a transaction is posted, voided, deleted, etc and also when you make a change to the order that affects revenue (ex. bill code changes).

Here is a sample XML. Please let me know if you have any other questions.

<FeeDetailChangedEvent>
<LedgerID>cd843280-9ab2-42ec-b3fc-36288963d0b2</LedgerID>
<OrderVersion>3</OrderVersion>
<FeeDetails>
<FeeDetail>
<FeeDate>2013-04-09T15:48:13Z</FeeDate>
<HudLine />
<Amount>1000.00</Amount>
<BillCode>TP</BillCode>
<OrderContact>A</OrderContact>
<Description />
<IsTaxable>false</IsTaxable>
<SequenceNumber>-2147483635</SequenceNumber>
<SecurityIdentityID>08011c16-f370-417a-96df-72a501456141</SecurityIdentityID>
</FeeDetail>
<FeeDetail>
<FeeDate>2013-04-09T15:48:13Z</FeeDate>
<HudLine />
<Amount>-1000.00</Amount>
<BillCode>ESC</BillCode>
<OrderContact>A</OrderContact>
<Description />
<IsTaxable>false</IsTaxable>
<SequenceNumber>-2147483635</SequenceNumber>
<SecurityIdentityID>08011c16-f370-417a-96df-72a501456141</SecurityIdentityID>
</FeeDetail>
</FeeDetails>
</FeeDetailChangedEvent>
Post Reply