1 Reply Latest reply on Jul 19, 2013 8:36 AM by philmodjunk

    Automatic conditional invoicing solution



      Automatic conditional invoicing solution


           I have an invoice solution where the line items are displayed in a portal, from a table named "INVOICE DATA".

           I have another table named "PRESET_INVOICE_DATA" where the line items are filled for especific conditons based on two fields: For example:

           field_Level = Level 1

           field_Type = Adults

           lineItem1 = Product_X

           lineItem2 = Product_Y



           field_Level = Level 2

           field_Type = YoungAdults

           lineItem1 = Product_A

           lineItem2 = Product_B

           lineItem3 = Product_C


           ...and so on

           What would be the best and simplest way to "Auto-fill" an invoice using my "PRESET_INVOICE_DATA", based on the two conditional fields

        • 1. Re: Automatic conditional invoicing solution

               How have you set up your tables and relationships for this "preset" data? You might have a set of invoice records already in place but with data in a field that identifies them as "template" invoices. In which case, a script can duplicate the invoice and the line items records followed by updating the newly created invoice record with any customer info already specified at the time the script is performed (or the script just updates the new invoice an line item record "Status" fields to mark them as not being "template" records and then the user fills in the rest of the needed data.)

               Or you might have a table just of your line items data, one record for each line product ID's plus the two fields for level and type. In which case, your script can find these records and loop through them using set variable, set field to copy these ID's into new line items records for your current invoice.

               The option you choose to implement will determine the specific script you'd use to set up your invoice with these predetermined line items.