6 Replies Latest reply on Oct 30, 2014 11:07 AM by philmodjunk

    Flag several invoices to email to customer.

    projay

      Title

      Flag several invoices to email to customer.

      Post

      Well I thought I could figure this out but....Here is what I am trying to do which is pretty typical in the business world.

      I would like to flag lets say 3 invoices for a customer and email it to them as just "ONE PDF FILE".

      I am printing from the LINEITEMS layout.

      Any suggestions would be great.  Thanks in advance.  -J

        • 1. Re: Flag several invoices to email to customer.
          philmodjunk

          What user action will "flag" the invoices? If the user just clicks to select an invoice for inclusion in the email, You can add a check box field to click for that purpose.

          Then your script can find all records where the check box field is not empty.

          Go to related records with the "match found set" option can pull up a found set of line items records on your invoice print layout for all the selected invoices.

          Then it's a matter of setting up the layout design and sorting in order to produce a "multiple invoice" billing statement that you can save as PDF and attach to the email.

          An alternative approach is to use the "append" option in the save as PDF step to save PDF's of the invoices one at a time but appending them to each other to produce a single PDF file.

          • 2. Re: Flag several invoices to email to customer.
            projay

            I got all the way up to saving the invoice as pdf...but my sorting is not creating individual invoices so it is saving ALL found items in that one invoice.  

            Pic Attached.

            • 3. Re: Flag several invoices to email to customer.
              projay

              Also my Invoice part set is as follows

              Title Header
              Body
              Footer

              • 4. Re: Flag several invoices to email to customer.
                philmodjunk

                Since you are performing the find on a layout based on OrderLineItem, you do not need to go to related records step. You already have the records that you need for your PDF.

                But you need to change the design of this layout.

                Add a "print above" sub summary layout part "when sorted by _kf_order_id".

                Put the invoice fields that you have currently put into the header into this sub summary part

                Add a "print below" sub summary layout part also sorted by the same field. Add the invoice fields that you now have in the footer into this sub summary layout part.

                You'll now get groups of line items for each invoice with sub summary layout parts acting as "sub heads" and "sub footers" for each group of line items from the same invoice.

                • 5. Re: Flag several invoices to email to customer.
                  projay

                  So just to confirm things, I would have the following invoice parts:

                  1.  Sub-summarty (Leading) will have customer name address, etc...
                  2.  Body (which will have ALL my lineitem fields)
                  3. Sub-summary (Trailing)  will have totals from above lineitems.

                  Does that sound about right.   Thanks. -J

                  • 6. Re: Flag several invoices to email to customer.
                    philmodjunk

                    Yes. How you sort your line items records will control whether or not your sub summary parts are visible.