troubleshooting grouping rules in auto invoice

23
Troubleshooting Grouping Rules In AutoInvoice (Doc ID 1084554.1) To Bottom In this Document Purpo se Troubleshooting Steps Troubleshooting Grouping Rule Issues When Using AutoInvoice 1. One Credit Memo Is Created When Expecting Several 2. Multiple Invoice Transactions Created When Expecting One a. Consider the Mandatory and Optional Grouping Attributes b. Consider the frequency in which AutoInvoice is executed 3. Order Management - Line Transaction Flexfield 4. Mandatory And Optional Grouping Attribute Columns a. Release 12.x, Mandatory Grouping Attributes b. Release 12.x, Optional Grouping Attributes c. Release 11.5, Mandatory Grouping Attributes d. Release 11.5, Optional Grouping Attributes e. Scripts to identify grouping attributes 5. Intercompany Limitations 6. What Happens if One Line is Rejected? 7. How Commitment Lines are

Upload: nathanerp

Post on 13-Apr-2017

55 views

Category:

Software


0 download

TRANSCRIPT

Page 1: Troubleshooting grouping rules in auto invoice

Troubleshooting Grouping Rules In AutoInvoice (Doc ID 1084554.1) To Bottom

In this Document

PurposeTroubleshooting Steps

  Troubleshooting Grouping Rule Issues When Using AutoInvoice  1. One Credit Memo Is Created When Expecting Several  2. Multiple Invoice Transactions Created When Expecting One        a. Consider the Mandatory and Optional Grouping Attributes         b. Consider the frequency in which AutoInvoice is executed   3. Order Management - Line Transaction Flexfield  4. Mandatory And Optional Grouping Attribute Columns      a. Release 12.x, Mandatory Grouping Attributes       b. Release 12.x, Optional Grouping Attributes       c. Release 11.5, Mandatory Grouping Attributes       d. Release 11.5, Optional Grouping Attributes       e. Scripts to identify grouping attributes   5. Intercompany Limitations  6. What Happens if One Line is Rejected?  7. How Commitment Lines are Grouped  Still have Questions?References

APPLIES TO:

Oracle Receivables - Version 11.5.10.0 and laterInformation in this document applies to any platform.Checked for relevance 10-Jul-2013Executable:RAXTRX - AutoInvoice Import Program

PURPOSE

Oracle Receivables (AR): AutoInvoice Information Center > Generic Setup and Troubleshooting Resources > Note 1084554.1

This note was created to facilitate troubleshooting AutoInvoice Grouping Rule Issues. For general AutoInvoice Troubleshooting, please review Note 1075757.1, Troubleshooting AutoInvoice for Oracle Receivables Release 12. 

Grouping rules tell AutoInvoice how you want to group records in the interface tables into

Page 2: Troubleshooting grouping rules in auto invoice

invoices, debit memos, and credit memos. Grouping rules specify which attributes must be identical for lines to appear on the same transaction. 

There are Mandatory and Optional Grouping Attributes, predefined within the application.  These are the attributes that are used to determine how lines are grouped for a transaction.You can run the Ordering and Grouping Rules Listing to see a complete list of all MANDATORY grouping attributes.

You can also review Note 1067993.1, How To Use Grouping Rules With AutoInvoice.

 

TROUBLESHOOTING STEPS

Troubleshooting Grouping Rule Issues When Using AutoInvoice

1. One Credit Memo Is Created When Expecting Several

After importing credit memo records, you find that they are grouped together on one credit memo transaction.  You are expecting the records to be imported as two separate transactions.  The problem is that the grouping rule was defined only for the invoice transaction class. 

Review the Grouping Rule defined, to see what has been selected for Transaction Class.  You can do this using the following navigation:

Responsibility: Receivables ManagerNavigation: Setup > Transactions > Autoinvoice > Grouping Rules

Note that the Transaction Class is Invoice in the following example of a defined Grouping Rule:

Page 3: Troubleshooting grouping rules in auto invoice

 

 

Now navigate to the Class field and use the down arrow to determine what (if any) other classes are defined for this grouping rule:

Page 4: Troubleshooting grouping rules in auto invoice

 

Then use the List of Values (LOV) to select the Credit Memo Transaction Class.

Page 5: Troubleshooting grouping rules in auto invoice

Now use the LOV in the Optional Grouping Characteristics field to select the desired column.  For this example we chose INTERFACE_LINE_ATTRIBUTE1:

 

Page 6: Troubleshooting grouping rules in auto invoice

 

After applying the changes, the Grouping Rule now looks like this:

Page 7: Troubleshooting grouping rules in auto invoice

In order for a grouping rule to work, it must be defined for each transaction class (Invoice, Credit Memo, and/or Debit Memo), based on the types of transactions being imported.

2. Multiple Invoice Transactions Created When Expecting One

    a. Consider the Mandatory and Optional Grouping Attributes

You are importing a sales order that has several sales order lines. The sales order is split into several invoice transactions after executing AutoInvoice.

There are a few reasons why this might happen.  First, a custom grouping rule could be assigned to the Transaction Source.  When optional grouping attributes are applied, this increases the chances for grouping into separate transactions.   Secondly, if there are no optional grouping attributes defined for a grouping rule, then one of the sales order lines has a mandatory grouping attribute that is different then the other sales order lines.   The following will demonstrate both examples:

Page 8: Troubleshooting grouping rules in auto invoice

Example 1 - Additional Optional Grouping Attributes are Defined

AutoInvoice uses the following hierarchy to default Grouping Rules, stopping when the first Grouping Rule is found:

1. From the Transaction Sources screen2. From the customer profile at customer site level3. From the customer profile at customer level4. From the System Options 

This order cannot be changed.  As a result, if you have customer specific grouping exceptions then you must define grouping rules at the customer or site level for all customers or set a default grouping rule in the system options form. 

Review the Transaction Source used to determine the Grouping Rule that has been assigned:

Page 9: Troubleshooting grouping rules in auto invoice

In this example the WSH GROUPING RULE is associated to the transaction source, Order Entry Delivery Invoicing, which is the transaction source used when the transactions were imported. 

When we review the WSH GROUPING RULE, we see that an optional grouping attribute has been defined for the INTERFACE_LINE_ATTRIBUTE3 column.

 

Page 10: Troubleshooting grouping rules in auto invoice

 

Because of this additional attribute, the sales order lines are grouped by INTERFACE_LINE_ATTRIBUTE3.  If any one sales order line has a different value for INTERFACE_LINE_ATTRIBUTE3, then it is grouped into a separate transaction.

Example 2 - Sales Order Line Has Mandatory Grouping Attribute That Differs From Other Sales Order Lines

Usually this issue is identified in the early stages of implementation when testing the AutoInvoice process.  To help verify the issue, you can use the script below to review the sales order lines before importing.

Notes: 

Page 11: Troubleshooting grouping rules in auto invoice

1. For this example INTERFACE_LINE_ATTRIBUTE1 is used as the driving column since sales orders imported from Oracle Order Management use this column for the sales order number.   The query selects all of the Mandatory Grouping Attribute columns (as noted later in this document).  So you can change the where condition as needed, if you are importing from a legacy system or other source.

2. Different releases of Oracle Receivables may introduce changes to the Mandatory and Optional grouping attributes, so please carefully review the User Guide for your release to determine the proper grouping attributes. 

You may also use the select statements provided in step 4 below to query the database for the grouping attributes.

 

/* Test for Mandatory Grouping Attribute Columns OnlyPlease note that the attributes listed below are for Release 11.5  */

Select AGREEMENT_ID, COMMENTS,CONS_BILLING_NUMBER, CONVERSION_DATE,CONVERSION_RATE,CONVERSION_TYPE,CREDIT_METHOD_FOR_ACCT_RULE,CREDIT_METHOD_FOR_INSTALLMENTS,CURRENCY_CODE, CUSTOMER_BANK_ACCOUNT_ID,CUST_TRX_TYPE_ID, DOCUMENT_NUMBER,DOCUMENT_NUMBER_SEQUENCE_ID,GL_DATE, HEADER_ATTRIBUTE1,HEADER_ATTRIBUTE2,HEADER_ATTRIBUTE3,HEADER_ATTRIBUTE4,HEADER_ATTRIBUTE5,HEADER_ATTRIBUTE6,HEADER_ATTRIBUTE7,HEADER_ATTRIBUTE8,HEADER_ATTRIBUTE9,HEADER_ATTRIBUTE10,HEADER_ATTRIBUTE11,HEADER_ATTRIBUTE12,HEADER_ATTRIBUTE13,HEADER_ATTRIBUTE14,HEADER_ATTRIBUTE15,HEADER_ATTRIBUTE_CATEGORY,HEADER_GDF_ATTRIBUTE1,HEADER_GDF_ATTRIBUTE2,HEADER_GDF_ATTRIBUTE3,HEADER_GDF_ATTRIBUTE4,HEADER_GDF_ATTRIBUTE5,HEADER_GDF_ATTRIBUTE6,HEADER_GDF_ATTRIBUTE7,HEADER_GDF_ATTRIBUTE8,HEADER_GDF_ATTRIBUTE9,HEADER_GDF_ATTRIBUTE10,HEADER_GDF_ATTRIBUTE11,HEADER_GDF_ATTRIBUTE12,HEADER_GDF_ATTRIBUTE13,HEADER_GDF_ATTRIBUTE14,HEADER_GDF_ATTRIBUTE15,HEADER_GDF_ATTRIBUTE16,HEADER_GDF_ATTRIBUTE17,HEADER_GDF_ATTRIBUTE18,HEADER_GDF_ATTRIBUTE19,HEADER_GDF_ATTRIBUTE20,HEADER_GDF_ATTRIBUTE21,HEADER_GDF_ATTRIBUTE22,HEADER_GDF_ATTRIBUTE23,HEADER_GDF_ATTRIBUTE24,HEADER_GDF_ATTRIBUTE25,HEADER_GDF_ATTRIBUTE26,HEADER_GDF_ATTRIBUTE27,HEADER_GDF_ATTRIBUTE28,HEADER_GDF_ATTRIBUTE29,HEADER_GDF_ATTRIBUTE30,INITIAL_CUSTOMER_TRX_ID,INTERNAL_NOTES, INVOICING_RULE_ID,ORIG_SYSTEM_BILL_ADDRESS_ID,ORIG_SYSTEM_BILL_CONTACT_ID,ORIG_SYSTEM_BILL_CUSTOMER_ID,ORIG_SYSTEM_SHIP_CONTACT_ID,ORIG_SYSTEM_SHIP_CUSTOMER_ID,

Page 12: Troubleshooting grouping rules in auto invoice

ORIG_SYSTEM_SOLD_CUSTOMER_ID,ORIG_SYSTEM_BATCH_NAME,PAYMENT_SET_ID, PREVIOUS_CUSTOMER_TRX_ID,PRIMARY_SALESREP_ID, PRINTING_OPTION,PURCHASE_ORDER, PURCHASE_ORDER_DATE,PURCHASE_ORDER_REVISION, REASON_CODE,RECEIPT_METHOD_ID,RELATED_CUSTOMER_TRX_ID,SET_OF_BOOKS_ID,TERM_ID,TERRITORY_ID,TRX_DATE,TRX_NUMBERFrom RA_INTERFACE_LINES_ALLwhere INTREFACE_LINE_ATTRIBUTE1 = '&sales_order';

 If Optional Grouping Attributes are used, then you can use the following query, in addition to the one above:

/*Test for Optional Grouping Attribute Columns OnlyPlease note that the attributes listed below are for Release 11.5 */

Select ACCOUNTING_RULE_DURATION,ACCOUNTING_RULE_ID,ATTRIBUTE1,ATTRIBUTE2,ATTRIBUTE3,ATTRIBUTE4,ATTRIBUTE5,ATTRIBUTE6,ATTRIBUTE7,ATTRIBUTE8,ATTRIBUTE9,ATTRIBUTE10,ATTRIBUTE11,ATTRIBUTE12,ATTRIBUTE13,ATTRIBUTE14,ATTRIBUTE15,ATTRIBUTE_CATEGORY,INTERFACE_LINE_ATTRIBUTE1,INTERFACE_LINE_ATTRIBUTE2,INTERFACE_LINE_ATTRIBUTE3,INTERFACE_LINE_ATTRIBUTE4,INTERFACE_LINE_ATTRIBUTE5,INTERFACE_LINE_ATTRIBUTE6,INTERFACE_LINE_ATTRIBUTE7,INTERFACE_LINE_ATTRIBUTE8,INTERFACE_LINE_ATTRIBUTE9,INTERFACE_LINE_ATTRIBUTE10,INTERFACE_LINE_ATTRIBUTE11,INTERFACE_LINE_ATTRIBUTE12,INTERFACE_LINE_ATTRIBUTE13,INTERFACE_LINE_ATTRIBUTE14,INTERFACE_LINE_ATTRIBUTE15,INTERFACE_LINE_CONTEXT,INVENTORY_ITEM_ID,REFERENCE_LINE_ID,RULE_START_DATE,SALES_ORDER,SALES_ORDER_DATE,SALES_ORDER_LINE,SALES_ORDER_REVISION,SALES_ORDER_SOURCE,TAX_CODE,TAX_RATEFROM RA_INTERFACE_LINES_ALLwhere INTERFACE_LINE_ATTRIBUTE1 = '&sales_order'

When you execute either of the above queries, the output allows you to compare the sales order

Page 13: Troubleshooting grouping rules in auto invoice

lines by column to verify the values assigned to the attributes.  You can use SQL*DEVELOPER to review the output or save the output to a spreadsheet to verify the same.

The following reflects the output from SQL*DEVELOPER for the Mandatory Grouping Attributes for one sales order:

Note:  The TRX_DATE values are different for each record of the two sales order lines. In this case each record will be grouped as a separate invoice transaction.

 

    b. Consider the frequency in which AutoInvoice is executed

When scheduling the AutoInvoice process to execute on a frequent basis, you should consider the timing as to when the interface tables are populated from a source system. 

For instance, if you schedule the AutoInvoice process to execute every 5 minutes, you need to consider when the sales orders lines are interfaced from Order Management for a complete sales order.   If it takes 10 minutes for all sales order lines to be processed and interfaced to Receivables, then the AutoInvoice process should be scheduled to execute every 15 minutes.   

Considering the interval of the scheduled AutoInvoice process, will ensure that all sales order lines are imported together.  Otherwise a sales order can be invoiced on multiple invoices when the AutoInvoice process is executed before all sales order lines are interfaced to Oracle Receivables.

3. Order Management - Line Transaction Flexfield

What are the Order Management Details that are interfaced to Receivables in the Line Transaction Flexfield?

Note: These columns can be grouped using the Optional Grouping Attributes

Column Name Order Management Value

INTERFACE_LINE_ATTRIBUTE1

Sales Order Number

INTERFACE_LINE_ATTRIBUTE2

Order Type (Type Name)

INTERFACE_LINE_ATTRIBUTE3

For Shipped Line: WSH_NEW_DELIVERIES.DEL.NAMEFor Non-Shipped:Non-Shipped: Order LineReturn Line: 0 (zero)

Page 14: Troubleshooting grouping rules in auto invoice

Freight Charges: Delivery NameDiscount Lines: 0 (zero)

INTERFACE_LINE_ATTRIBUTE4

For Shipped Line: substr(DEL.WAYBILL,1,30)Non-Shipped Order Line: 0 (zero)Freight Charges: substr(DEL.WAYBILL,1,30)Discount Lines: 0 (zero)

INTERFACE_LINE_ATTRIBUTE5

For Sales Order Lines and Return Lines:  The number of times the order or return line has been interfaced for invoice or credit.

Freight Charges: 1 (one)

INTERFACE_LINE_ATTRIBUTE6

Sales Order Lines, Return Lines, Discount Lines: LINE.LINE_ID

Freight Charges: Charge.Charge_id

INTERFACE_LINE_ATTRIBUTE7

0

INTERFACE_LINE_ATTRIBUTE8

Shipped Order Line: WSH_DOCUMENT_INSTANCES.SEQUENCE_NUMBER

Non-Shipped Order Line: 0 (zero)

Return Lines: 0 (zero)

Freight Charges: 0 (zero)

Discount Lines: 0  (zero)

INTERFACE_LINE_ATTRIBUTE9

Customer Item Number if one is defined, otherwise insert 0 (zero).

INTERFACE_LINE_ATTRIBUTE10

Null

INTERFACE_LINE_ATTRIBUTE11

Discount Lines: PA.PRICE_ADJUSTMENT_ID

INTERFACE_LINE_ATTRIBUTE12

Sales Order Lines, Return Lines, and Discount Lines: LINE.SHIPMENT_NUMBER

Freight Charges: None

INTERFACE_LINE_ATTRIBUTE13

Sales Order Lines, Return Lines, and Discount Lines: LINE.OPTION_NUMBER

Page 15: Troubleshooting grouping rules in auto invoice

Freight Charges: None

INTERFACE_LINE_ATTRIBUTE14

Sales Order Lines, Return Lines, and Discount Lines: LINE.SERVICE_NUMBER

Freight Charges: None

INTERFACE_LINE_ATTRIBUTE15

Null

For more details regarding the Order Management Interfaces, review the Oracle Order Management Open Interfaces, API, and Electronic Messaging Guide, page 8-6.

4. Mandatory And Optional Grouping Attribute Columns

The following provides a list of mandatory and optional attributes from the RA_INTERFACE_LINES_ALL table. 

Note:   Some attributes have changed between Release 11.5 and 12.x An Enhancement Request (5943921) has been logged requesting the

REASON_CODE is removed from the Mandatory Grouping Attributes. 

   a. Release 12.x, Mandatory Grouping Attributes

Note:Grouping attribute behavior changed between Release 11.5., and Release 12. Note 1280194.1, Why Autoinvoice Ship to fields were mandatory grouping attributes in release 11i, but are optional in release 12?

AGREEMENT_IDAPPLICATION_IDBILLING_DATECOMMENTSCONS_BILLING_NUMBERCONTRACT_IDCONVERSION_DATECONVERSION_RATECONVERSION_TYPECREDIT_METHOD_FOR_ACCT_RULECREDIT_METHOD_FOR_INSTALLMENTSCURRENCY_CODECUSTOMER_BANK_ACCOUNT_IDCUST_TRX_TYPE_IDDEFAULT_TAXATION_COUNTRY

Page 16: Troubleshooting grouping rules in auto invoice

DOCUMENT_NUMBERDOCUMENT_NUMBER_SEQUENCE_IDDOCUMENT_SUB_TYPEGL_DATEHEADER_ATTRIBUTE1-15HEADER_ATTRIBUTE_CATEGORYHEADER_GDF_ATTRIBUTE1-30HEADER_GDF_ATTR_CATEGORYINITIAL_CUSTOMER_TRX_IDINTERNAL_NOTESINVOICING_RULE_IDLEGAL_ENTITY_IDORIG_SYSTEM_BILL_ADDRESS_IDORIG_SYSTEM_BILL_CONTACT_IDORIG_SYSTEM_BILL_CUSTOMER_IDORIG_SYSTEM_SOLD_CUSTOMER_IDPAYMENT_ATTRIBUTESORIG_SYSTEM_BATCH_NAMEPAYMENT_SET_IDPREVIOUS_CUSTOMER_TRX_IDPRIMARY_SALESREP_IDPRINTING_OPTIONPURCHASE_ORDERPURCHASE_ORDER_DATEPURCHASE_ORDER_REVISIONREASON_CODERECEIPT_METHOD_IDRELATED_CUSTOMER_TRX_IDSET_OF_BOOKS_IDTAXED_UPSTREAM_FLAGTERM_IDTERRITORY_IDTRX_DATETRX_NUMBER

   b. Release 12.x, Optional Grouping Attributes

ACCOUNTING_RULE_DURATIONACCOUNTING_RULE_IDATTRIBUTE1-15ATTRIBUTE_CATEGORYCODE_COMBINATION_IDINTERFACE_LINE_ATTRIBUTE1-15INTERFACE_LINE_CONTEXTINVENTORY_ITEM_IDLINE_GDF_ATTRIBUTE1-20LINE_GDF_ATTR_CATEGORY

Page 17: Troubleshooting grouping rules in auto invoice

ORIG_SYSTEM_SHIP_ADDRESS_IDORIG_SYSTEM_SHIP_CONTACT_IDORIG_SYSTEM_SHIP_CUSTOMER_IDREFERENCE_LINE_IDRULE_START_DATESALES_ORDERSALES_ORDER_DATESALES_ORDER_LINESALES_ORDER_REVISIONSALES_ORDER_SOURCETAX_CODETAX_RATE 

   c. Release 11.5, Mandatory Grouping Attributes

AGREEMENT_IDCOMMENTSCONS_BILLING_NUMBERCONTRACT_IDCONVERSION_DATECONVERSION_RATECONVERSION_TYPECREDIT_METHOD_FOR_ACCT_RULECREDIT_METHOD_FOR_INSTALLMENTSCURRENCY_CODECUSTOMER_BANK_ACCOUNT_IDCUST_TRX_TYPE_IDDOCUMENT_NUMBERDOCUMENT_NUMBER_SEQUENCE_IDGL_DATEHEADER_ATTRIBUTE1-15HEADER_ATTRIBUTE_CATEGORYHEADER_GDF_ATTRIBUTE1-30INITIAL_CUSTOMER_TRX_IDINTERNAL_NOTESINVOICING_RULE_IDORIG_SYSTEM_BILL_ADDRESS_IDORIG_SYSTEM_BILL_CONTACT_IDORIG_SYSTEM_SHIP_CUSTOMER_IDORIG_SYSTEM_SOLD_CUSTOMER_IDORIG_SYSTEM_SOLD_CUSTOMER_IDORIG_SYSTEM_BATCH_NAMEPAYMENT_SET_IDPREVIOUS_CUSTOMER_TRX_IDPRIMARY_SALESREP_IDPRINTING_OPTIONPURCHASE_ORDER

Page 18: Troubleshooting grouping rules in auto invoice

PURCHASE_ORDER_DATEPURCHASE_ORDER_REVISIONREASON_CODERECEIPT_METHOD_IDRELATED_CUSTOMER_TRX_IDSET_OF_BOOKS_IDTERM_IDTERRITORY_IDTRX_DATETRX_NUMBER

   d. Release 11.5, Optional Grouping Attributes

ACCOUNTING_RULE_DURATIONACCOUNTING_RULE_IDATTRIBUTE1-15ATTRIBUTE_CATEGORYINTERFACE_LINE_ATTRIBUTE1-15INTERFACE_LINE_CONTEXTINVENTORY_ITEM_IDREFERENCE_LINE_IDRULE_START_DATESALES_ORDERSALES_ORDER_DATESALES_ORDER_LINESALES_ORDER_REVISIONSALES_ORDER_SOURCETAX_CODETAX_RATE

   e. Scripts to identify grouping attributes

For a comprehensive list of all Mandatory and Optional Grouping Attributes used in your instance, you can run the following:

-- for MANDATORY

select column_type, from_column_namefrom ra_group_by_columnswhere column_type = 'M';

-- for OPTIONAL 

select column_type, from_column_namefrom ra_group_by_columnswhere column_type <> 'M';

To see a list of fields that will be used by the grouping rule for a particular transaction type, you can use the following scripts:

First, Determine the value to use in &group_rule_id below by running the following:

Page 19: Troubleshooting grouping rules in auto invoice

SELECT GROUPING_RULE_IDFROM RA_GROUPING_RULESWHERE NAME = '&Enter_Grouping_Rule_Name';

For example, using the value = 'DEFAULT' will result in GROUPING_RULE_ID = -1

Then run the following replacing &group_rule_id with the value returned by previous script and &trx_type with INV for Invoice, CM for Credit Memo and DM for Debit Memo:

SELECT UPPER(C.FROM_COLUMN_NAME),C.FROM_COLUMN_LENGTHFROM RA_GROUPING_TRX_TYPES T,RA_GROUP_BYS B,RA_GROUP_BY_COLUMNS CWHERE T.GROUPING_RULE_ID = &group_rule_idAND T.CLASS = DECODE('&trx_type','INV', 'I','CM', 'C','DM', 'D')AND T.GROUPING_TRX_TYPE_ID = B.GROUPING_TRX_TYPE_IDAND B.COLUMN_ID = C.COLUMN_IDUNIONSELECT UPPER(C.FROM_COLUMN_NAME),C.FROM_COLUMN_LENGTHFROM RA_GROUP_BY_COLUMNS CWHERE C.COLUMN_TYPE = 'M'order by 1;

By using the script above, you can identify which fields need to be similar for interface rows to be grouped into a single transaction.

For more information about Grouping Rules, you can also review the Receivables User's Guide, page 2-241.

5. Intercompany Limitations

Is it possible to split two intercompany lines from one order with unique delivery numbers into separate invoices?Answer:  No - Order management does not pass delivery number to receivables interface tables in any field and thus grouping rules cannot take this into account during invoice creation.

6. What Happens if One Line is Rejected?

Let's assume the Batch Source is set to Invalid Line: REJECT INVOICE in the batch source definition.  Is it possible to reject the entire invoice or is the only option to fix the problem and generate a second invoice?

If you state that you want to import (despite rejected lines), what you are really saying is that you want to import what you can of the transaction despite any rejections that occur to individual lines. However, once the transaction has been grouped, a rejection on any one line will reject the entire transaction. So, in other words, the feature favors rejecting entire post-group transactions.  In cases such as when a Customer ID is invalid, the customer is part of the grouping criteria and thus if you have a 5 line invoice rejected for invalid customer ID's and then you update 2 of the 5 lines to correct the error and re-run, AutoInvoice

Page 20: Troubleshooting grouping rules in auto invoice

will group the two corrected lines into an invoice and import the record, leaving three lines unprocessed.

7. How Commitment Lines are Grouped

In Lines attached to commitments the reference_line_id will populate Initial_customer_trx_id which is a mandatory grouping column.  Lines without commitments have this field as null.  Sales orders subsequently will always  split commitments into separate invoices from non-commitment order lines.

It is the standard functionality