5 Replies Latest reply on Jul 31, 2012 7:18 AM by Michelle_1

    Saving records from search result

    Michelle_1

      Title

      Saving records from search result

      Post

      Hello FileMaker heroes :)

      Here i am looking again for some lill help!

      My DB is aaaaaallllmost ready, i just need now the last steps!

      I make a time frame search and i get then the results in a layout.

      This is the monthly commisiion of each worker, that i have to pay.

      The problem is that maybe in some month some of the workers can have a negative provision, and this i need then to calculate for the next month.

      I think the best solution is that i need a script that allow me to SAVE this search results, like a new table or record, that i could get the numbers from this results and use somewhere else, in calculations and such.

      Just like a script tha get all the results from my search and save as a new extra record or a new invoice.

      Well i think thats abit complicated and i hope you people can understand what i mean :) i am very new with FM :)

       

      Thaaank you all!!

        • 1. Re: Saving records from search result
          JimMac

          I think the new record would be most convenient way in a new table related to the Worker.  This way you cans save on the new record:

          workerID

          Pay time frame  [DateStart to DateEnd]

          Commission

          PaidOnCheck#

          Simple Calculation would check Previous months for negative provisions and empty check#  then bring forward to current frame.

          Once cleared or accounted for, then place the Check# on all negative months to show "cleared"

          Even print on check stub:

          1/1/12 - 1/31/12  $-40.24

          2/1/12 -2/28/12   $-10.14

          3/1/12 - 3/31/12  $200.42

          Total commission   $150.04

          Jim...


          • 2. Re: Saving records from search result
            Michelle_1

            Undecided ogod

            i try to understan that...

            • 3. Re: Saving records from search result
              GuyStevens

              Hey Michelle,

              I think you might be able to do this very simply.

              If you make one invoice to every worker every month. Then you can add a checkbox to this invoice that you check when that invoice has been "accounted for"

              On your invoice you can show a portal that shows other invoices that still need to be "accounted for".

              The way to do this is to make a second table occurrence of the invoice table and create a relationship so that only values that are "Not accounted for" are shown trough this relationship.

              What you would need to do this is two fields:

              - A text field called "AccountedFor"

              This would be formatted to be a checkbox with one manual value of "Yes"

              - A text field calles "g_Yes" set to global storage containing the value "Yes"

              To be sure this always contains the value "Yes" even if you delete all invoices, you could set an Auto enter data of "Yes"; But remember that that only get's filled in the moment you create a new record.

              Now you create a new table occurrence of the invoices table (InvoicesNotAccountedFor) and you make the following relationship:

              Invoices::g_Yes------[Is Not Equal to sign]-------InvoicesNotAccountedFor::AccountedFor
              Invoices::EmployeeIdFk---------[=]------InvoicesNotAccountedFor::EmployeeIdfk

              Then you create a portal on your invoice layout based on the InvoicesNotAccountedFor that shows the invoice number, month, and the total amount.

              Then you put a Summary total field outside that portal that shows the total.

              You also add your accounted for checkbox. And as soon as you check that checkbox the invoice will be removed from the portal.

               

              If you need any help with this I could add it to the file I made you. That way you could see what I mean.

              • 4. Re: Saving records from search result
                GuyStevens

                I updated my example file and added the portal.

                The idea is that when an employee has a negative amount in a certain month. The next month you can add that amount to his invoice (the negative amount) so that amount get's subtracted from this invoice amount. If that's added to the invoice, the negative invoice can be checked as "accounted for".

                If his person keeps getting negative amounts, you can just let ik keep on going on untill he get's a positive invoice, and then you start checking off previous months.

                http://dl.dropbox.com/u/18099008/Demo_Files_FMP12/Magazines_Commission.fmp12

                • 5. Re: Saving records from search result
                  Michelle_1

                  Heey DaSaint!

                  I am suddenly in a goddamn hurry here in the office, im gonna look your file later at home.

                  Thank you again for your help!!

                   

                  Michelle