Proposal summary
This proposal describes the Inputting draft bills (pending approval state) into Netsuite Through the mail.
Requirement
Currently, accounting staff get invoice emails from users, and they have to download the PDF then manually create the vendor bills to Netsuite and pay them.
Instead of this, Swyft would like to automatically create the draft bills in Netsuite when users send emails to invoices@swyft.com.
Our Solution
Prerequisites
- Swyft needs to provide the following permissions:
- To create/edit vendor and vendor bill
- Setup company permission
- Swyft has to provide an email id or employee list of accounting staff to send the email using search every day.
Description of task
The solution can be achieved by adding an Email plugin implementation on Netsuite. We will provide one NetSuite email address after the development. So users need to add this NetSuite email address to CC when sending emails to invoices@swyft.com. We will deploy one script to create the bill(pending approval status).
- If the email attachment is PDF, then the script will create bills(pending approval status) using a dummy vendor, a dummy item, and a dummy location when Netsuite gets the email. The attachment from the email will be added to the created bill as an attachment.
We will create fields for selecting the dummy vendor, dummy item, and dummy location on the General preference. The administrator can set the dummy vendor, dummy location, and dummy item in General preference. The script will get the dummy vendor and dummy item from these fields and create bills using these values.
- Vendor: Dummy Vendor
- Bill status: Pending Approval
- Date: Today’s date
- Subsidiary, currency, and exchange rate: auto-populate based on the vendor
- Item: Dummy Item
- Item quantity: 1
- Item rate: 0.01
- Location: Dummy Location
- If the email attachment is CSV, XLS, or XLSX documents, then the script will encode the bill details from the document and create bills using these details. The attachment from the email will be added to the created bill as an attachment.
The format of CSV/XLS/XLSX should be as follows.
| Vendor | Email id of the vendor | Item name | Item quantity | Item rate | Item location |
| Test vendor | test@gmail.com | item1 | 1 | 10 | Test location |
| Test vendor | test@gmail.com | item2 | 5 | 15 | Test location |
We consider only one CSV or XLS or XLSX document containing data for a single bill. So the body fields such as Vendor and email id of the vendor should be the same for all item lines in the document.
If the file contains less than 50 item lines then the script will create bills in real-time. Otherwise, it will go for a scheduled process. So the script will store the file in a specific folder in the file cabinet. And another script which schedules at each 1 hr will get the files from the folder and creates the bills using data in the file.
Bill Creation Process
The script fetches the first line for getting values for body fields (vendor and email id of the vendor). And finds out the vendor by comparing the value in the email id of the vendor in the file with the email on the vendor record. So the unique identifier will be the email id of the vendor in the file. So in case if the email id of the vendor in the first line of the file is incorrect, then the script will create a bill with a dummy vendor.
Users have to enter the correct item name in the Item name column in the file. The script finds out the correct item by comparing the Item name in file with the value in the ITEM NAME/NUMBER field in the item record. In case if the item name is not valid in Netsuite, then the script will set the dummy item for the corresponding line.
We will create one custom checkbox field in Vendor Bill to identify the bills created by this script. And that will be enabled for the Bills that created through the above proposed script
Also, will create one search for the bills with status pending approval and this checkbox checked. The same search can be scheduled once in a day to send the email notifications to the specific email id or employees provided by Swyft. So accounting staff can refer to this saved search result/result on email notification to review the bills, correct the details in the vendor bill, and approve the same.
Risk
- According to the proposed solution, when NetSuite receives an email through this email plugin, the script will create bills on Netsuite. So even if a user sends any emails by mistake to this NetSuite email address, the script will create bills.
- If the user does not add the NetSuite email address to the CC of the email, no bills will be generated on NetSuite since we do not get any trigger on Netsuite.
- After the creation of the vendor bill, the business user has to review and update the Dummy vendor bills with correct vendor and item details based on the details on the attached document in the bill.
- The proposed solution will support only a single subsidiary. If there is a chance to come up with multiple subsidiaries in the future, then we will have to alter the script by including different dummy vendors, dummy items, and location fields for each subsidiary.
- The maximum size of an email that can be captured using the email plugin is 25,000,000 bytes (25 MB). The maximum size of an individual attachment in an email is 10 MB. If the size of the email is more than that, then the bill record will not be created in Netsuite since we cannot get that trigger in Plugin.
- The speed of bill record creation in Netsuite will be dependent on the size of the email attachment. If the email attachment size is high then it will take more time to create the bill record.
- If you want to create bills for the email that you have received before this implementation, you have to resend the email to the NetSuite plugin email.
- We can fetch the files that are supported by Netsuite. If any of the attached files are not supported by Netsuite, then they will not be received in NetSuite Plugin so that we cannot create vendor bills in Netsuite. we will process the file creation within an error handling module. So in case, the file creation fails due to any unexpected content(unsupported strings), then will create the bill by skipping Files.
- The CSV, XLS, or XLSX documents should be in the same data format and layout.
- If the file contains more than 50 item lines, the bill creation will take place within a scheduled script. So there will be a delay in bill creation.
- Users have to enter the correct item name, location, and vendor email id in the text fields in the file. If the values are not valid in the Netsuite account, then the script will create a bill using a dummy vendor, dummy location, and dummy item. And accounting staff needs to review and update the vendor bills using the attached document.
- We are considering only the item lines in this proposal, not including the expense lines.