8 Replies Latest reply on Sep 13, 2014 6:51 PM by TKnTexas

    Look up Value "needs" help

    TKnTexas

      Title

      Look up Value "needs" help

      Post

      I have built a payroll app.  I have tables for Employee, some constants for calculation, Federal Tax rates, and the payroll check (child table to build the gross earnings).  

      It initially worked as expected.  But the last couple times I tried it I did a new payroll check record.  Select the employee from a drop down.  That populates payrate, marital status, number of deductions.  

      In the portal I put in one or more lines for hours worked and rate.  The extended amount of the line(s) added to gross wages on the parent (payroll check).  Social security and medicare calculate immediately and are displayed.  The Federal Withholding is blank.  

      To get the Federal Withholding to calculate, I go to the field for marital status on the parent record, and flip it to the opposite value and the back.   For example, if SINGLE I change to MARRIED.. commit.  Change to SINGLE .. commit.  If MARRIED I change it to SINGLE... commit.  Change back to MARRIED and commit.  

      The Tax will calculate with the first change, but since it is the wrong STATUS the amount is wrong.  Changing it back and it is right.  Comparing my calculation to my actual payroll check from my employer and it was to the penny the same.

      It worked then now it doesn't.  Thoughts of what I might have broken?

        • 1. Re: Look up Value "needs" help
          philmodjunk

          I'd need to see a bit more detail to be able to guess at any possible issues. Is there by any chance more than one "lookup" involved? where you look up data into field 1 and then the value in field 1 enables a look up of data into field 2? (there can then be a "timing" issue where field 2 may be looked up before field 1 looks up the correct value needed for field 2's look up.)

          • 2. Re: Look up Value "needs" help
            TKnTexas

            In the Paycheck Table, I create a new record.  I select the employee ID first.  This populates:  pay rate, marital status, number of exemptions, and amount of insurance deduction.  

            There is a portal for "building" gross wages.  There are calculation fields in the Paycheck table for:  Wages, Fed Withholding, Soc Sec, and Medicare.  The Social Security and Medicare taxes are calculation fields WAGES * tax rates.

            The Federal Withholding is a calculation, the wages are annualized, then the taxes are a look up from a tax table.  

            The timing of input is not the issue .. I think.  I will post screen prints next.

            • 3. Re: Look up Value "needs" help
              TKnTexas
              /files/0ff86093d7/Definitions.png 4950x5925
              • 4. Re: Look up Value "needs" help
                TKnTexas
                /files/faa55a72e0/First_is_NEW_RECORD.png 4950x5925
                • 5. Re: Look up Value "needs" help
                  TKnTexas

                  If there is any other info I can provide please let me know.  

                  • 6. Re: Look up Value "needs" help
                    philmodjunk

                    unless I am missing something, it's the FedWitholdTax field that is not calculating the expected value. In the calculation that you have defined, I see 5 different fields referenced, 4 local to the same table. I'd examine the values in each field and see which have the expected value and which do not. That will move us a step closer to the cause of this issue.

                    • 7. Re: Look up Value "needs" help
                      TKnTexas

                      I added the interim fields to the bottom of the layout.  I created a new check.  That annualized earnings field calculate right away.  But when the annualized earning field populates it should use the relationship to the Payroll Tax Table to look up the rate to use and the dollar amount.  

                      I am not very experience with these look ups.  Before this, my look up usage was ID and corresponding Name, address and/or Phone numbers.  

                      I do remember this working correctly, so I am not sure what I changed to "break it".

                      • 8. Re: Look up Value "needs" help
                        TKnTexas

                        I am still playing with this calculation, but unable to make any head way.  If any one has a thought I would be appreciate it.