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

Print multiple codes

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

    Print multiple codes

    Hi Guys,
    I need to modify some parts of my management software, and as you can see from the attached picture, my problem is for the invoice section. let me explain better , for the italia law, any customer can sell many products or services, and with different VAT codes (see the pictures in the red circle).

    What I can't do is this : I need to print a report with the summary of VAT that are in the invoice, ( e.g. like the picture, 4 different vat , I need to print at bottom of my invoice a list for these 4 different VAT)

    Do you have an idea how to make that ?
    Attached Files
    Cristiano
    [email protected]

    Skype: cris-do

    #2
    Re: Print multiple codes

    hello
    you might want to consider RTF. you can put a box and then select several if end if statements.
    the reasoning for the above is, in one invoice certain VAT codes will be present in another different ones will be present.
    so by selecting
    if (codice IVA = 22) 22->blahblah end if followed by a soft return. because there is a soft return the blank line will be eliminated.
    is my thinking seems right? ( I am hoping there are only few VAT codes, not hundreds)
    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


      #3
      Re: Print multiple codes

      Do you just want a list of the vat codes or do you want codes and amounts? Or do you want a list of the codes and the total amount?
      Last edited by Stan Mathews; 02-04-2014, 09:34 AM.
      There can be only one.

      Comment


        #4
        Re: Print multiple codes

        Originally posted by Stan Mathews View Post
        Do you just want a list of the vat codes or do you want codes and amounts? Or do you want a list of the codes and the total amount?

        Hi Stan,

        for the italian law i need the total of amount for each VAT code ( e.g : VAT 4% total amount 25 - VAT 22% total amount 125 , and so o n until finished the detailed table for thar invoice number )
        Cristiano
        [email protected]

        Skype: cris-do

        Comment


          #5
          Re: Print multiple codes

          I think you need a calculated field for each possible vat percentage. Each calculated field would use set.external_record_content_get() where the filter selected the current invoice and items with the desired vat. Then *TOTAL() to sum those.

          I'll try to work up an example using AlphaSports.

          On the AlphaSports invoice form or report based on the invoice set

          Code:
          a_ttl = "A total - "+alltrim(str(*total(set.external_record_content_get("invoice","invoice_items->extension","","Invoice_Number = "+quote(Invoice_Number)+" .and. left(Product->Description,1) = 'A'")),15,2))
          gives a total of items on the currently viewed (or currently printing) invoice where the first letter of the product description is A. It appears like, A total - 2.35

          One could create similar fields for B, C, D, etc.

          These would then be placed in an rtf as suggested.
          Last edited by Stan Mathews; 02-04-2014, 11:36 AM.
          There can be only one.

          Comment


            #6
            Re: Print multiple codes

            Thank youstan , but Sorry what is RTF ? is Rich Text Format ? if yes how do I make it with Alpha Five ?

            and then , this code you inserted in the calculated field in a invoice form ( from Alphasports)
            Last edited by Cristiano; 02-04-2014, 02:24 PM.
            Cristiano
            [email protected]

            Skype: cris-do

            Comment


              #7
              Re: Print multiple codes

              Yes, rich text format. You can drag-drop an rtf object on a form or report from the toolbox just as you would a plain text field. Once you have the object in place, right click and choose Insert, Expression. The expression would be a concatenation of your calculated fields.
              There can be only one.

              Comment


                #8
                Re: Print multiple codes

                It's been suggested to me by someone who doesn't have time to get deep into this discussion that you might be able to do what you want with a sub report in a report footer if that is where you want the vat totals. Your screen shot is of a form but I'm not clear on your final intent.

                The sub report would be based on the details table and grouped on the vat field.
                There can be only one.

                Comment


                  #9
                  Re: Print multiple codes

                  Ok Stan , understood,

                  Thanks for your help and suggestions
                  Cristiano
                  [email protected]

                  Skype: cris-do

                  Comment


                    #10
                    Re: Print multiple codes

                    Hi Stan,

                    sorry to disturb you, I made an is work :

                    iva_codes = set.external_record_content_get("invoice","invoice_items->iva","","invoice_number ="+quote(invoice_number))

                    But it's possible to use on a filter to have only the unique value from this result ? ? I tried to use : UNIQUE_KEY_VALUE() in the filter but do not work How I can filter the unique value for that calculated field ?




                    b.r
                    Cristiano
                    [email protected]

                    Skype: cris-do

                    Comment


                      #11
                      Re: Print multiple codes

                      iva_codes = set.external_record_content_get("invoice","invoice_items->iva","","invoice_number ="+quote(invoice_number)+" .and. unique_key_value()")

                      Or maybe you want

                      iva_codes = *remove_duplicates(set.external_record_content_get("invoice","invoice_items->iva","","invoice_number ="+quote(invoice_number)))

                      ?





                      But I don't think that's what you want to do. If you obtain the unique vat codes in this way, how will you total the amounts?
                      Last edited by Stan Mathews; 02-05-2014, 09:46 AM.
                      There can be only one.

                      Comment


                        #12
                        Re: Print multiple codes

                        Hi STAN,

                        Yes, this is part of what I do, then I create another calculated field that makes the total of the respective VAT codes

                        in attach 2 picture of invoice that one of my competitors has made, If you see (footer_of_invoice.jpg) there are 3 words - "IMPONIBILE" ( this is the total of all the product purchased but the first is the total for VAT at 20% - "IVA " and "IMPOSTA" is the value of 20% of the "IMPONIBILE".


                        If there are more VAT CODES ,(for the italian law a shop can sell more articles with different VAT codes ) under these above mentioned will be inserted also the rest of the total of amounts


                        B.R.
                        Attached Files
                        Cristiano
                        [email protected]

                        Skype: cris-do

                        Comment


                          #13
                          Re: Print multiple codes

                          The approach I would use on first encounter would be to parse the records,
                          the code below will parse the items and populate one variable for each vat category with the total of each.

                          Substitute your field names, I tested with a small table called INVLINES --- using fields names
                          TOTPR (numeric) for the line total and field
                          TAXPC (text) for the tax percent - the test table of 5 lines is attached for you to test
                          Using the table "INVLINES.DBF" run this code

                          Code:
                          TIN=TABLE.OPEN("INVLINES")
                          dim pc4 as n =0
                          dim pc7 as n =0
                          dim pc8 as n = 0
                          dim pc14 as n = 0
                          tin.fetch_first()
                          for i=1 to TIN.records_get()
                            eval("pc"+TIN.taxpc)=eval("pc"+TIN.taxpc)+tin.totpr*val(tin.taxpc)/100
                          	tin.fetch_next()
                          next
                          tin.close()
                          and the results
                          ?pc4 = 8.04
                          ?pc7 = 0
                          ?pc8 = 11.6
                          ?pc14= 12.32

                          With a bit more time and real examples I suppose I would try a more elegant solution using collections possibly.
                          On a form or report four or five (or however many) calc-> . . = TOTAL( Expression , GRP – ) would be easy enough
                          Attached Files
                          Last edited by Ray in Capetown; 02-05-2014, 01:15 PM. Reason: add comment

                          Comment


                            #14
                            Re: Print multiple codes

                            Hi Ray,


                            interesting your approach to the problem ... I want to try
                            Cristiano
                            [email protected]

                            Skype: cris-do

                            Comment

                            Working...
                            X