Page 1 of 1

Supplier credit duedate

PostPosted: Fri Dec 17, 2021 4:11 pm
by perry
Hi

for Jiwa 7.2.1 SR4.

We've been asked to calculate the duedate on supplier credit as per supplier invoice.

However, I'm not able find how I can set the due date via plugin. The due date (on creditor transaction) is set to credit date and the creditorTransaction property is 'internal'.

So am I right that the DB trigger is the only possible solution?

Re: Supplier credit duedate  Topic is solved

PostPosted: Fri Dec 17, 2021 5:26 pm
by SBarnes
No you should be able to do it with reflection have a look at this post viewtopic.php?f=26&t=1139&hilit=SetPrivatePropertyValue and look for SetPrivatePropertyValue in the plugin where Mike did it.

Also this link shows you how to do it with a helper class using extension methods http://dotnetfollower.com/wordpress/201 ... eflection/

Re: Supplier credit duedate

PostPosted: Wed Dec 22, 2021 11:45 am
by perry
Thanks! will give it a try in new year

Re: Supplier credit duedate

PostPosted: Wed Jan 19, 2022 4:08 pm
by perry
just confirming it was way to go!

Cant post the entire plugin here but it is simple as
- use the SaveEnding Event
- get _CreditorTransaction property and read trans ID
- append Update statement to the SQL transaction to update the duedate