We recently implemented a new way of posting timesheets where a person enters a category into their timesheet, but based on the day of the week, holiday, or whether it's overtime, the timesheet is posted and assigned to a different category. The logic for that is all in place and working properly (Used the SubledgerJournalizerProjectExtension class to accomplish this).
On top of this, I need to make the accounting distributions form work properly so people know where the timesheet categories are being posted to when the actually get posted. This is where I am having trouble, I can't seem to figure out how the AccountingDistribution table is populated (It looks like the projectAccountingDistribution table is populated based on the Accounting Distribution).
I was trying to work around this by using the editProjectCategoryId method in the projectAccountingDistribution table and various methods within the form for the amount and percent fields of the form. I was able to make this work in all scenarios aside from the one where I need to create an extra line.
The issue comes into play when a person works overtime for a given day. In this case I need to add an additional line to the form so the first line will take 1 category(and the first 8 hours from timesheet) and the second line will take the hours after 8. I'm having trouble figuring out the best way to do this, and if it's possible to sort of just overwrite the data within the existing form or if I need to fix it where the data is initially populating the accountingDistribution table. We are only using the form to view how the timesheet is posted before it's actually posted, which is why I was hoping to just be able to overwrite the data. Below is and example:
The highlighted day on the left - the worker worked 10 hours. So I need one line where he the category is weekday, percent is 80, amount is 400. And another line where the category is overtime, amount is 100, percent is 20. Basically I just need to know how to get the extra line and I believe I'd then be able to use the methods mentioned above to get the correct info in the fields.
Any help would be appreciated.
*This post is locked for comments