chadrt Posted September 8, 2017 Share Posted September 8, 2017 So I would like to do a drop down menu with 4 pay periods this drop down would include the current pay period and 3 previous pay periods. I can calculate dates within a range of days but I need a static starting point so that all the "pay periods" within are always based on that. Any hints or tricks on doing this? I usually like to post some code usually to show I am trying but I am at a total loss!! Quote Link to comment https://forums.phpfreaks.com/topic/304909-drop-down-with-pay-periods/ Share on other sites More sharing options...
requinix Posted September 8, 2017 Share Posted September 8, 2017 A static starting point isn't completely required. You can calculate dates using rules. What are the rules for the pay period dates? Quote Link to comment https://forums.phpfreaks.com/topic/304909-drop-down-with-pay-periods/#findComment-1550953 Share on other sites More sharing options...
chadrt Posted September 8, 2017 Author Share Posted September 8, 2017 As an example: Aug 19th - Aug 25th is a pay week Aug 26th - Sep 1st is a pay week Those two weeks are a pay period then Friday September 8th is Payday (tomorrow im getting excited for payday btw LOL) Hopefully that was basically what you meant by rules? Quote Link to comment https://forums.phpfreaks.com/topic/304909-drop-down-with-pay-periods/#findComment-1550958 Share on other sites More sharing options...
requinix Posted September 8, 2017 Share Posted September 8, 2017 Not quite. Why are those the pay weeks? Who decided that? What decided that? In other words, if you wanted to figure out the paydays this next December or from last March, how would you do it? Can I assume that the second week could be Aug 26-Sep 2, and it's just that Sep 2 was a holiday? So pay periods are two weeks starting on a Tuesday, with the pay day being the Friday after it ends? Then the question is which groups of two weeks; looking to see what happens at the end of the year (fiscal or calendar) can help answer that. Quote Link to comment https://forums.phpfreaks.com/topic/304909-drop-down-with-pay-periods/#findComment-1550959 Share on other sites More sharing options...
chadrt Posted September 8, 2017 Author Share Posted September 8, 2017 So paydays are always every other Friday with one week as a lag behind as decided by management I suppose. A week always ends on a Friday the bookkeeper then has a full week to have all the commission sheets in and accounted for so that she can process payroll. Next payday would be from Sept 2nd 2017 to September 15th 2017 and the following Friday would be payday again which would be the 22nd of September and it would be for the previous pay period (9/2/17 to 9/15/17). So I created a simple database that holds all my commissions that we keep track of then I output a page that looks just like the hand written sheets we have to turn in. Only for me since I tend to hate pen and paper I can just select a pay period and click a button to display the sheet. I have a very simple with 6 fields that I fill out for each commission that I access on my smart phone. This keeps me happy with something electronic and management happy cause they get to see it in the same format they are used to (only they don't have to decipher handwriting). Quote Link to comment https://forums.phpfreaks.com/topic/304909-drop-down-with-pay-periods/#findComment-1550962 Share on other sites More sharing options...
requinix Posted September 8, 2017 Share Posted September 8, 2017 Ah, yeah, wrong 26th. Aug 26th was a Saturday. It would be nice if you could figure out how to determine when the pay period starts - like, why did it start Aug 19th and not the 12th or 26th? Without that you can reduce your work to (1) picking the starting date for the period and (2) entering data. You can do the first by giving yourself a little calendar thing then have the tool go X weeks after. Like you'd pick Aug 19th and it would generate the weeks Aug 19-25 and Aug 26-Sep 1. That'd be enough for me personally. Quote Link to comment https://forums.phpfreaks.com/topic/304909-drop-down-with-pay-periods/#findComment-1550963 Share on other sites More sharing options...
Phi11W Posted September 8, 2017 Share Posted September 8, 2017 So I would like to do a drop down menu with 4 pay periods this drop down would include the current pay period and 3 previous pay periods. Pay periods are defined by your Organisation. As such, they are proprietary Corporate Data and should be mastered in a Corporate-level Data Store (a.k.a. a Database). As soon as that "decision" has been made, your job suddenly becomes a lot easier. You simply have to read that table and extract the rows that you're interested in based, presumably, on the current date. No calculations, no derivations, just data retrieval and filtering. Regards, Phill W. Quote Link to comment https://forums.phpfreaks.com/topic/304909-drop-down-with-pay-periods/#findComment-1550964 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.