Importing Misc Charges to R2 Orders
**This is a Custom enhancement**
Content was last updated in 06.01.15-00
Revision History
Details
You can import the transactions done by the crews with their vendors as 'Misc Charges' into the R2 Orders through a console application. This way, you can have them as a misc item line of the transactions done by the crew with their vendors as well in the R2 Orders. This feature works for all types of Order like Rental, Sales Order etc.,
Importing Misc charges fails if the Order is:
Done and Invoiced
In Process
Lost
Cancelled
Pre-requisites
Create a Misc charge in Maintenance module.
Create an Order in R2, save and close the Order.
Sample Workflow
Open R2NEPIntegrate.ini file from the R2 installation root folder.
Provide the 'MiscChargesInfoFilePath'.
Provide the 'Integration employee ID' who runs the integration program.
In the Console, the CSV file name has to be passed as the parameter which will be read from the path mentioned in the property of the r2NEPIntegrate.ini file.
Place the sample CSV file in the path mentioned in the r2NEPIntegrate.ini file.

Figure 1.0: R2NEPIntegrate.ini file
Open the CSV file and key in the data. Then, save the file. Want to know the column details?

In the CSV, the rows without the Order ID/Invoice number cannot be processed and console application throws an error for such rows.
The rows which already processed cannot be processed again.
Run the command on the windows command prompt by providing the following details.
<batch file name.bat> <CSV file name.csv> <MiscID>
For example: ImportMiscChargesToOrder.bat CrewTransactionSample_New.csv FESSTSC

Figure 3.0: Run the batch file
After executing, you will see the success message in the command prompt indicating that the misc charges are inserted to the R2 order.

Figure 4.0: Import successful message
Apart from running the command directly on the prompt, you can run it like a scheduled task in following way.
Create a separate batch file with command <batch file name.bat> <CSV file name.csv> <MiscID>.
Create a scheduled task which runs the above batch file automatically at specific time.
This way you can have multiple batch files created with pre-configured settings of Batch file, CSV file and Misc ID.
Now, open the Order and the valid rows in CSV file is inserted as Misc charges as shown in figure 5.0.
Product ID: The Misc ID passed in the console is imported in 'Product Id' column.
Description: The crew name provided in the csv file is imported in 'Description' column.
Bin: The 'Invoice Number' provided in the csv file is imported in the 'Bin' column.
Total Cost: The total Cost is computed based on the sum of the 'Total Spend excl Taxes/GST + Taxes+ Penalty'.
While opening the Order, the Total Cost is computed. When you open the Order after importing the data, you will be prompted to save the order again when you exit the Order.
If you save it, then the Total cost shows correct value. Otherwise, the amount which displayed in the 'Search Order' window shows incorrectly.
If the Order is opened while import takes place, please close and re-open the Order again to fetch the data into Order.

Figure 5.0: Misc charges are imported to R2 Order
The imported misc. charge lines populates values for the following columns in R2 Order which are not part of the csv file:
Table 2.0: Column values for the imported misc charge lines
Column | Value populated for the imported misc lines |
Line Quantity | 1 |
Line Duration | 1 |
Line Unit Price | It depends on the Markup% defined in R2 configuration.
Unit price = ((Cost)*(Markup%/100))+Cost |
Line Amount | Same as 'Unit Price' since 'Qty' and 'Duration' is '1' |
Discount | I is calculated in R2 Order based on Tax Region and Schedules on the Order |
Unit | Day for Rental Orders Each for Sale Orders |
When Multi-Currency is True, the Cost read from the file is the 'Transaction Cost'. Site and Base Cost will be set as per the conversions applicable for the order.
Misc. charges imported will be set as non-discountable on the order similar to how TNT import does.