Jump to content

Recommended Posts

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!!

Link to comment
https://forums.phpfreaks.com/topic/304909-drop-down-with-pay-periods/
Share on other sites

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 :thumb-up: im getting excited for payday btw LOL)

 

Hopefully that was basically what you meant by rules?

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.

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).

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.

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.