Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Charging different customers different amounts ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Charging different customers different amounts ?

    Hi all,

    I have one client (my brother and his Car Repair business) He is using an invoicing app based roughly on the sample Alpha Sports application (same set layout). He has asked me if it is possible to charge different prices for the same part based on the customer. For example Joe Regular gets charged cost price plus 20% for each part on the invoice. Mr Big Customer gets charged cost price plus 12%, being a better customer he gets a better deal. The current invoice has an embedded browse which shows the unit price which is a lookup direct from the parts table. This is multiplied by quantity to get the extension.

    The prices in the parts table will be changed to the cost price and he would like the invoice then to show the cost price times the uplift % per customer.

    I tried having a script attached to the browse that displays the invoice items but I got the "maximum stack depth exceeded error"

    Any pointers as to how this could be accomplished.

    Many thanks
    Ciaran

  • #2
    RE: Charging different customers different amounts

    "I tried having a script attached to the browse that displays the invoice items but I got the "maximum stack depth exceeded error" "

    Try showing us the script. "maximum stack depth exceeded error" usually is caused by something being executed multiple times without closing a table, form, etc.
    There can be only one.

    Comment


    • #3
      RE: Charging different customers different amounts

      Hi Ciaran,

      I have an app that does exactly what you want, in fact this is a lulu.
      My client not only charges different rates for each customer but also
      adds different values for before 8:00AM, after 5:00PM, Saturdays,
      Sundays, holidays, you name it he wants it. The long and the short of
      it is a 1-many set where the parent is the customer profile and the
      child is the labor and parts. In the customer profile table insert a
      field for discount, example 10 or 15 or whatever he chooses. This value
      can then be used in a calc field for the final cost.

      Have fun,
      efs

      Comment


      • #4
        RE: Charging different customers different amounts

        Edward,

        Are you using an embedded browse for the invoice line items ?

        I have one and there is a calculated field in the parts table called extension which is quantity * price. My "client" wishes to see a different base price, based on customer, right there in the browse while building the invoice. I guess the question is "Is it possible to change embedded browse values on the go?"

        Comment


        • #5
          RE: Charging different customers different amounts

          Ciaran,

          Yes, the expression to compute the extended price can include conditional components.

          Assume initial expression is

          qty * price


          Then assume the existence of a field called Price_Plan in the Customers table that specifies REGular or DIScount pricing for her.


          The expression could be changed to:

          qty * (if(Customers->Price_plan = "DIS", Price * 0.88, Price))

          By the way, AlphaSports runs on Vers 5, and you're posting in the Version 4 forum. If you're actually using Vers 5 you'll do better in the long run to post over there, instead of here.

          -- tom

          Comment


          • #6
            RE: Charging different customers different amounts

            Tom,

            Thanks for that. I never even considered expanding the original price*Quantity expression. This should be sufficient for my needs.

            I'm using Alpha Five v4.5 but I was referring to the original Alpha Sports application in the Alpha Five Tutorial book. I think it was from version 1.0 ? It wasn't really an application as such, just an invoice and set design excercise.

            I'm staying with 4.5 as I cannot yet justify the cost of version 5 :-(

            Thanks for your help.

            Comment


            • #7
              RE: Charging different customers different amounts

              Ciaran,

              In vers 4 (including 4.5) there's a sample database called "Invoice", located in the Invoice subfolder of the Samples folder in the program directory. By convention, folks here refer to it as the Invoicing Sample.

              It is quite different from the AlphaSports 'sample' database that ships with Vers 5, which is what prompted my comment.

              If you're referring to the Invoicing Sample and call it 'AlphaSports' you'll very likely confuse folks (like me) who have both versions and regularly visit both forums.

              -- tom

              Comment


              • #8
                RE: Charging different customers different amounts

                Tom,

                Ooops, point taken. I didn't realise I was causing confusion.

                Back to your original answer though, I have a question.
                When building the calculated field expression, the only fields that are visible are those of the INVOICE_ITEM table, so I cannot make reference to the DIS or REG field in CUSTOMERS (I've called it uplift)

                I think I need a bit of Xbasic to copy the value in the uplift field in CUSTOMERS into the INVOICE_ITEM table at the start of each invoice creation. (The uplift field is the value by which to increase that customers prices ie 1.2 for 20% etc)

                Hmmm..time to get thinking.

                Comment


                • #9
                  RE: Charging different customers different amounts

                  Ciaran,

                  The availablility of field values from other tables when entering a new record into a different table often turns on the context in which data entry is occurring.

                  If you're working with a form based on the set, then the values should be visible.

                  If you're working with a form based on the items table, then you'll either have to pass them to that form when it's opened, or 'look them up' once the new record begins.

                  Passing values to the called form is illustrated in the Code Archive. Search for a piece called something like "Pass Values to Called form".

                  Lookups can be done with one of the several different Lookup() functions. Check the xbasic reference manual for details.

                  It's even possible to arrange to use a field rule table lookup from the items table, to 'find' the right customer or invoice and then populate fields like customer number, invoice number, and 'uplift' value.

                  Lots of choices for you.

                  -- tom

                  Comment


                  • #10
                    RE: Charging different customers different amounts

                    Hi Ciaran,

                    Yes, the embedded browse reflects the parts ans labor, the calc field is part of the browse but gets it's value from a lookup to the parent profile.
                    The discount value is part of the customers profile.
                    efs

                    Comment


                    • #11
                      RE: Charging different customers different amounts

                      Tom,

                      Many thanks for the pointers to possible solutions. I finally settled on the following approach.

                      In my customer table I added an extra field called uplift. In this field I store a numeric value such as 1.15 which equates to 15%. When I depart the embedded browse, I multiply the price (in the browse) by the uplift value and the price then diaplayed on the invoice is the baseprice increased by 15% (or whatever value is in the uplift field)

                      After stepping back I could finally see the wood !

                      Cheers,
                      Ciaran

                      Comment

                      Working...
                      X