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

Invoice Due Date & Payment Terms

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

    #16
    Re: Invoice Due Date & Payment Terms

    calculated fields such as 'Invoice Total' and 'Amount Due' at the form/report level not on the table
    i agree with that statement, calculated fields do not belong in the table since you can calculate on the fly, with one exception. if the data will change with change in time then the calculated field should also be saved.
    for example if the price of an item will change over time then the calculated amount paid for that item should be saved so as to prevent a new calculation done with new data will be different than what has happened awhile ago.
    thanks for reading

    gandhi

    version 11 3381 - 4096
    mysql backend
    http://www.alphawebprogramming.blogspot.com
    [email protected]
    Skype:[email protected]
    1 914 924 5171

    Comment


      #17
      Re: Invoice Due Date & Payment Terms

      I got the discount to work by creating a Payment Terms table which specifies the terms, discount %, discount days, and net days. This info is looked up and then the discount is calculated using a calculated field 'Balance' and entered into my discount field when a payment is being posted. The trouble I find about having calculated fields calculating on the fly is that they dramatically slow down my form because that is where I show a lot of data. If this was all at the table-level, then my form would work much smoother...any suggestions on this?

      Comment


        #18
        Re: Invoice Due Date & Payment Terms

        I store the total as Ghandi suggests for the same reason. I also like to use the totals in reports later based on products and services rendered without the need to calculate which is no longer necessary on historical data, not that it couldn't be recalculated. My issue with calculated fields in general is that they work every time, and in some cases where you might want to make an adjustment with out the calculations being enforced. I cannot think of an example off the top of my head but I do recall a time or two where the calculated field was working against what I was trying to do.
        On the point of a calculated field slowing down a form, that seems like it could be more the fact that you may be using an Ajax call back to get the info from the drop down table values rather than the actual calulation because client side usually works instantly. Try your form with explicit values rather than a lookup to another table for the discount, I would bet it's instant.
        Just a guess though.
        NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

        Comment


          #19
          Re: Invoice Due Date & Payment Terms

          A calculated field needn't become part of your table - or form, until you need it to. I often use vars to hold the calc value which is updated by a button or event, at which time the value is saved in a table field. Invoices in particular work against the rule of normalization for the very reason that this is historical data and should always match the printed invoice sent to the customer. If ever a correction does need to be made, some note should appear that the invoice has been revised and a copy was sent to the customer.

          So when you set the terms for a customer, you should probably copy that info to the invoice table in case the terms for that customer are changed at a later date - then it won't change past records.
          Last edited by MoGrace; 07-14-2016, 01:16 AM.
          Robin

          Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

          Comment


            #20
            Re: Invoice Due Date & Payment Terms

            Charles, I'm very interested in learning more about the explicit values. What's really slowing things down is that I'm listing all the customers with their balances, as well as their invoices with the totals, there's a lot of calculations being done. Could you suggest another way to go about it?

            current = dbsum("invoices","current",invoices->customer_id,"balance")
            over30 = dbsum("invoices","Over30",customer_id,"balance")
            over60 = dbsum("invoices","Over60",customer_id,"balance")
            over90 = dbsum("invoices","Over90",customer_id,"balance")
            balance_tbi = dbsum("invoices","BalanceTbi",Customer_Id,"Balance")
            invoice_count = count(invoices->invoice_number,GRP->customer)
            items_count = count(Th_Main_Database->Work_Number,GRP->invoices,GRP->TH_MAIN_DATABASE)
            inv_total = total(Th_Main_Database->Total,GRP->invoices)+invoices->Adjustment
            customer_balance = dbsum("invoices","Cust_Bal",Invoices->Customer_Id,"balance")-total(Payments->Payment_Amount,GRP->customer)
            inv_balance = calc->INV_TOTAL+Invoices->Adjustment-Invoices->Total_Paid_Amount
            list_sum_of_invoices = total(Invoices->Balance,GRP->customer)

            Invoice Form.jpg

            Comment


              #21
              Re: Invoice Due Date & Payment Terms

              Originally posted by hov333 View Post
              Charles, I'm very interested in learning more about the explicit values. What's really slowing things down is that I'm listing all the customers with their balances, as well as their invoices with the totals, there's a lot of calculations being done. Could you suggest another way to go about it?

              current = dbsum("invoices","current",invoices->customer_id,"balance")
              over30 = dbsum("invoices","Over30",customer_id,"balance")
              over60 = dbsum("invoices","Over60",customer_id,"balance")
              over90 = dbsum("invoices","Over90",customer_id,"balance")
              balance_tbi = dbsum("invoices","BalanceTbi",Customer_Id,"Balance")
              invoice_count = count(invoices->invoice_number,GRP->customer)
              items_count = count(Th_Main_Database->Work_Number,GRP->invoices,GRP->TH_MAIN_DATABASE)
              inv_total = total(Th_Main_Database->Total,GRP->invoices)+invoices->Adjustment
              customer_balance = dbsum("invoices","Cust_Bal",Invoices->Customer_Id,"balance")-total(Payments->Payment_Amount,GRP->customer)
              inv_balance = calc->INV_TOTAL+Invoices->Adjustment-Invoices->Total_Paid_Amount
              list_sum_of_invoices = total(Invoices->Balance,GRP->customer)

              [ATTACH=CONFIG]42280[/ATTACH]
              The way I read your first 5 calculated fields and customer_balance, you are reading the database 6 times for records you already have.

              Slowness is from extra data retrieval more than the number of calculated fields.

              The other calc fields use count() or total() and use the data already retrieved.

              I would try using total instead of dbsum.
              You would need 4 more calculated fields combos like:

              iOver30 = if(<ourover30filter>,balance,0)
              Over30_total=total(iOver30,GRP->customer)

              Then a like combo for current,over60,over90

              From the looks of it you have filtered indices for current,Over30,Over60,Over90 that would not be needed then and would speed up your writes to the table.

              I bet it improves performance with these changes.

              dbsum() is good for data from a table that is not already in the set and it's data is already retrieved.
              Al Buchholz
              Bookwood Systems, LTD
              Weekly QReportBuilder Webinars Thursday 1 pm CST

              Occam's Razor - KISS
              Normalize till it hurts - De-normalize till it works.
              Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
              When we triage a problem it is much easier to read sample systems than to read a mind.
              "Make it as simple as possible, but not simpler."
              Albert Einstein

              http://www.iadn.com/images/media/iadn_member.png

              Comment


                #22
                Re: Invoice Due Date &amp; Payment Terms

                thanks for the suggestion Al, yes I have filtered indexes here's the one for Over30:
                ISNOTBLANK("Invoices->Invoice_Date").AND.BETWEEN(Invoices->Invoice_Date,DATE()-60,DATE()-31)

                I will try to incorporate what you suggested, but
                1) the index filter as well as your suggested <iOver30 = if(<ourover30filter>,balance,0)> both rely on this 'balance' field which is calculated and stored in the table. So rather than calling out the table's field, I should be using calc->inv_balance, correct?
                2) I don't really have speed issues when writing to the table. Its the form itself that is very slow i.e. navigating and selecting records which I would like to fix.

                Comment


                  #23
                  Re: Invoice Due Date &amp; Payment Terms

                  Hi John,
                  Forgive me for my unsolicited opinion, but it looks like you are trying to do too much on this form.

                  For example:
                  1. You are showing a list of customers with open balances on the right, and yet your invoice table is not showing anything that indicates which invoices are included in the open balance. Instead, that list appears to be open orders that have not been invoiced.

                  2. The Invoice items list then is a detail view of an open order.

                  3. Therefore - why are payments being shown here when your orders are not billed yet?

                  If it were me, I would have a form that concerns the open orders, and another that is only about the invoices and their payments. Or I suppose you might use a tabbed object if you need to show both.
                  Robin

                  Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

                  Comment


                    #24
                    Re: Invoice Due Date &amp; Payment Terms

                    Originally posted by hov333 View Post
                    thanks for the suggestion Al, yes I have filtered indexes here's the one for Over30:
                    ISNOTBLANK("Invoices->Invoice_Date").AND.BETWEEN(Invoices->Invoice_Date,DATE()-60,DATE()-31)

                    I will try to incorporate what you suggested, but
                    1) the index filter as well as your suggested <iOver30 = if(<ourover30filter>,balance,0)> both rely on this 'balance' field which is calculated and stored in the table. So rather than calling out the table's field, I should be using calc->inv_balance, correct?
                    2) I don't really have speed issues when writing to the table. Its the form itself that is very slow i.e. navigating and selecting records which I would like to fix.
                    1. yes

                    2. it may not seem that way, but it will be faster.

                    3. and yes Robin it is a busy form, but should work
                    Al Buchholz
                    Bookwood Systems, LTD
                    Weekly QReportBuilder Webinars Thursday 1 pm CST

                    Occam's Razor - KISS
                    Normalize till it hurts - De-normalize till it works.
                    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
                    When we triage a problem it is much easier to read sample systems than to read a mind.
                    "Make it as simple as possible, but not simpler."
                    Albert Einstein

                    http://www.iadn.com/images/media/iadn_member.png

                    Comment


                      #25
                      Re: Invoice Due Date &amp; Payment Terms

                      Charles, I'm very interested in learning more about the explicit values. What's really slowing things down is that I'm listing all the customers with their balances, as well as their invoices with the totals, there's a lot of calculations being done. Could you suggest another way to go about it?
                      i am not charles, but have the pleasure of working with him.
                      what is slowing down is, you are bringing all the customers with their balances and then identify the one customer and display all the outstanding invoices whether billed or not and then display all the open items for a given invoice. this is lot of work for the computer not to mention to you and the person looking at the screen.
                      what i would do is take a path similar to quickbooks.
                      display a field ( in my world it is a textbox) and get the name of the customer, and then filter the data only to display data pertaining to that customer. similar to what you have done in your form but with a dropdown or something akin to that in the desktop side.
                      again taking clue from quickbooks(which displays the same kind of busy data) display main customer info in the middle and the invoices on the right side top and payments on the right side bottom with little but more valuable information. and when the person looking at the screen wants to do something, direct them with some mechanism. most people when they look at a screen on the web side spend around 15 seconds looking at the data anything more they are not interested in it they will move away. i do not know about desktop side. but less eyeful but important information will be more welcome than not in my opinion.
                      Last edited by GGandhi; 07-16-2016, 11:24 AM.
                      thanks for reading

                      gandhi

                      version 11 3381 - 4096
                      mysql backend
                      http://www.alphawebprogramming.blogspot.com
                      [email protected]
                      Skype:[email protected]
                      1 914 924 5171

                      Comment


                        #26
                        Re: Invoice Due Date &amp; Payment Terms

                        Good idea G, I actually started off trying to mimic the quickbooks form but eventually moved away from it without realizing.
                        With that in mind, I'd like to revise the "customer balance" calculation. Looking at QB, each customer is listed with their balance next to the name, then there are child records for each customer showing the transactions which make up the balance. I'm guessing I will need to figure out how to replicate a similar table...I have one for invoice headers and another for payments... Could someone point me in the right direction?

                        Comment


                          #27
                          Re: Invoice Due Date &amp; Payment Terms

                          Just to tossing this in, it would be a really good "feature" to add in an additional table to capture collection attempts. Date reason for not paying, last collection conversation, etc.
                          Another "feature" would be to add in a button to see any previous invoices for the same customer. Many times, people who do service work may quote a higher/lower price for a service on a per customer basis - reasoning aside, it happens and it comes up often where you may create an invoice and want to recall what you charged that person before 2 years ago for a similar problem.
                          Again just food for thought...
                          NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

                          Comment


                            #28
                            Re: Invoice Due Date &amp; Payment Terms

                            To replicate the QB model you might try a mapped table. Also for payments you would need both a pmt_hdr and a linked 1:N pmt_items table, since 1 payment may be applied to multiple invoices. I use a 3rd party program to import and export data in QB. It would be interesting to see what a payment export looks like...
                            Robin

                            Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

                            Comment

                            Working...
                            X