Today, I will be demonstrating you how we can import the Pending invoice using excel file using Batch process.i.e Pending vendor invoice import data utility
Things to know:
Pending vendor invoice: Simply we can say that, it is the invoice that is used for invoicing against the purchase order for the vendor.
VendInvoiceInfoTable: It contains the pending invoice header information for one/more purchase Orders
VendInvoiceInfoLine: The VendInvoiceInfoLine table contains vendor invoice lines for a specific purchase order.
VendInvoiceInfoSubTable: Middle table between purch table and vendinvoiceInfo Table. It associates between the vendor invoices and the purchase orders.
VendInvoiceInfoSubLine: The VendInvoiceInfoSubLine table contains associations between the vendor invoice lines and the posted vendor packing slips.
VendPackingSlipTrans : The VendPackingSlipTrans table contains posted product receipt lines.
Sample Pending Invoice CSV/Excel file:
MzkPendingInvoiceBatch class: It is a batch class that does following actions
- Create a batch dialog
- Create an input file field
- Import t data from CSV file
- Executes batch
Here is the completed code:
Invoice Header creation
Invoice Line creation:
Note: One thing we noted that, it takes multiple packing slip id from the CSV template , and ids are separated via ‘comma’ and base on that i have written the code to first split the packing slip ids in list and then iterate the list above screen.
Main methods, entry point for the batch class, which ask for the dialog using ‘prompt’ method
Finally the run method, where actual work is done i.e
Import data from CSV and creates the invoice header and invoice lines
Lastly here is the batch job customized dialog that we have created.
Please let me know for any issue.!