13 Replies Latest reply on Apr 16, 2012 11:21 AM by philmodjunk

    Creating a dicount

    2W0PWR

      Title

      Creating a dicount

      Post

      Hi,

       

      I have just downloaded Filemaker 12 and am currentrly re-designing my database for a more simple approach and am struggling with the discount.

      I have downloaded a Starter Solution and am wanting to change the Discount from being a % to a set amount. eg, Total Invoice £227.00 Discount £27.00 Total after discount £200.00. 

      Can anyone point me in the rite direction?

      Thanks,


      Dave

        • 1. Re: Creating a dicount
          philmodjunk

          Which starter solution? Invoices?

          • 2. Re: Creating a dicount
            2W0PWR

            Thats the one. Invoices. 

             

            Runs alot smoother than Filemaker Pro 11 on Filemake Go.

            • 3. Re: Creating a dicount
              philmodjunk

              First time I've looked at the new starter solution. It's been changed a lot.

              I see where you can specify a percent discount for each line item.

              Do you want to change this to a "flat rate" discount of a specified dollar amount for a given item?

              Or do you want to discount the invoice as a whole by specifying a specific amount to deduct from the invoice total?

              • 4. Re: Creating a dicount
                2W0PWR

                Hi Phil, 

                 

                Thanks for the reply, to keep it simple for now I'd like to just change the percent for each item to a flat rate. If I need to then change it to a percent I'll work out the discount and imput it manually.

                 

                Thanks

                • 5. Re: Creating a dicount
                  philmodjunk

                  Open manage | database | Fields and select the table named Invoice Data from the tables drop down. (Why did they not name this table "LineItems" like every other invoicing demo I've seen?) Find the field named "Discount Amount" and double click it to bring up this calculation in the specify calculation dialog:

                  ( Qty * Unit Price )  * Discount Rate

                  Change it to:

                  ( Qty * Unit Price )  - Discount Rate

                  Click OK to close dialogs and windows until you are back on the layout. Now go to the Invoice Details layout if you aren't already there and enter layout mode. Click the Discount Rate field to select it and then use the Data Formatting tab to change the data format from Percent to currency. You may need to resize this field to make it large enough to display a flat rate correctly.

                  • 6. Re: Creating a dicount
                    2W0PWR

                    Thanks for the reply, I have done this and it's not changed how the calculation is worked. 

                     

                    • 7. Re: Creating a dicount
                      philmodjunk

                      Should have looked more closely at the fields in the portal.

                      Find the field named Amount.

                      Change this expression:

                      Let     (
                          [
                          total         = Qty * Unit Price ;
                          discount     = total* Discount Rate
                          ] ;

                          total - discount

                          )

                      To this:

                      Let     (
                          [
                          total         = Qty * Unit Price ;
                          discount     = Discount Rate
                          ] ;

                          total - discount

                          )

                      • 8. Re: Creating a dicount
                        2W0PWR

                        Just changed it and the calculation stops working all together. 

                        • 9. Re: Creating a dicount
                          philmodjunk

                          "stops working all together" means what? you get an empty field, an error message when you click ok or the wrong result?

                          • 10. Re: Creating a dicount
                            2W0PWR

                            Hi Phil,

                             

                            I am sorry for the long reply. Not been around the computer all week.

                            The image bellow is before and the next image I will post is the after image when I have changed the script in the Amount field. The whole calculation stops working.

                            Hope your well,

                             

                            Dave

                            • 11. Re: Creating a dicount
                              2W0PWR

                              After

                              • 12. Re: Creating a dicount
                                2W0PWR

                                Hi Phil,

                                 

                                I have changed the Disc from Discount Rate to Discount Amount and the calculation works, but it's not a modifiable field. Is this changable?

                                and everytime I add a new line the price of the item is the same as the discount, I hope you understand what I mean.

                                Dave

                                • 13. Re: Creating a dicount
                                  philmodjunk

                                  You've made enough different changes that I am unlcear as to what you currently have. You would not and should not use the Discount amount field here as it is not modifiable and it refers to the discount rate field to compute the discount amount. The amount field does not refer to the discount amount field in its original form so using it in place of discount rate would not affect the value returned as the "amount".