2 Replies Latest reply on Feb 18, 2011 10:47 AM by EvanScott

    Applying a Quantity Discount

    EvanScott

      Title

      Applying a Quantity Discount

      Post

      I have a database that currently looks up a price and then generates an invoice at the end of a week for a particular client. Now based on an individual client because every client has different qty. discount criteria and gets different discounts. But at the end of the week if they purchase X amount of merchandise they get X amount taken off. What would be the best way scripting or a calculation, and what kind would be best to use. Any help will greatly appreciated. 

        • 1. Re: Applying a Quantity Discount
          philmodjunk

          Do you have this structure?

          Invoices---<LineItems>---Products

          If so, you can run your script on the LineItems table.

          Find all records whose related Invoice record is in a specified date interval.
          Sort records by client.
          Use summary fields and calculations with the getsummary function to compute sub totals
          loop through these records computing and applying discounts per your business rules.

          This script can update line item records to show the discount, it can update fields in invoices or even create records in a related discount table.

          • 2. Re: Applying a Quantity Discount
            EvanScott

            I do have that relationship. Thank you very much this seems like a really good way to go about it.