Using I4GL to determine payperiods.... new report processor?
Posted in 2003
Hello Group..... I've come across another interesting problem (aren't they all....), and I'm petitioning for some help. Here goes..... We have a pay / commission setup which doesn't really do any "time-traveling" for accounting. IE, someone pays, late in the commission period, we run commissions, the sales person gets a check, and then the next day the payment bounces. Oops. Problem being, if the client pays again, the sales person gets credited again. Which means, lost $$$'s because they got paid twice for a single client. To solve this problem, I need to be able to figure out previous payments, and their dates (done), and then check back-in-time to see if during any payperiod (for which they have payments) the client was fully paid. Seems simple enough, although it's a few queries, if the report is taking 2 minutes instead of 1, that's fine. How do I find the payperiods. Depending on the type of client, the payperiod could be Type 1: (1st - 15th, 16th - end of month) OR Type 2: (1st - end of month). Once I've fetched the date from the db, say 09/12/2003 and determined that it's Type 1, how do I say "ah, yes, this falls in Type 1"? [I think I have that solved, with a simple <= or >= ... anything easier?] BUT, if it falls after the 16th, or is Type 2, what could I use (in I4GL) to find the last date in the month (short of a text file or table w/ payperiods)? Lastly .... I would like to eventually move away from 4GL as a report processor, in liu of something a bit more "modern". Something similar to JasperReports would be ideal (can you do functions in JasperReports?), but commercial would be ok as well. Any ideas? Thanks. --Anthony