About 50% of EnergyCAP Enterprise clients export billing data to their organization Accounts Payable or General Ledger system. The specific process and necessary software tools can be developed during software implementation. First, the information is entered or received into EnergyCAP. EnergyCAP audits the bills for billing errors, flags the issues and then passes the bills onto a supervisor for approval. When approved, the billing data is exported to the AP/GL system for payment. Once the AP/GL system pays the bills, information such as payment date, check number, etc can be imported back into EnergyCAP. The result is a complete bill record.
There are several advantages to doing business this way:
EnergyCAP can export to any AP/GL system. The company has extensive experience mapping data to and from a variety of different accounting systems. Typically, EnergyCAP exports to an intermediary file. A custom application reformats the EnergyCAP data to fit the AP/GL system and then imports to the system. When bringing data into EnergyCAP from the AP/GL system, the process is the same. This method ensures EnergyCAP’s compatibility with any system and at the same time protects the AP/GL system’s security and integrity.
NOTE: Bill Export and Import for AP/GL integration is a customized process for each organization. For pricing and implementation details, and/or a list of the applications interfaced with to date, contact EnergyCAP sales at sales@energycap.com.
See also—Exporting Bills from EnergyCAP to an AP/GL System.
Billing data can be exported from the EnergyCAP® database to a user-selected file type. The following file formats are supported:
The bill export procedure involves defining and/or selecting an export Profile which specifies precisely what data will be exported and the format of the file. The bill export Profile includes a topmost Cost Center filter, as well as options for selecting which accounts and/or billing dates will be included in the export. The exported file can then be imported to the client A/P system, manipulated in a spreadsheet program for energy analysis, and/or used for reporting or other purposes. For most EnergyCAP clients, the export process is defined and all details finalized during software implementation.
There are two export streams in EnergyCAP; these export options offer additional flexibility for integration into an organization’s accounting structure:
There are also two ways to initiate bill export:
The advantage of the export task is that it can be run independently of the EnergyCAP program, even as a ‘scheduled task’ in Windows®, using a previously-defined export profile. For more information about this procedure, see the topic on External Tasks.
The advantage of using the Bill Export window/wizard is that the bill export profile can be defined and/or modified. Follow the procedure below to define an export profile and export billing data from the EnergyCAP program.






The bill export process is complete.
This advanced topic provides guidance in constructing a visual basic script that can be automatically executed as a Windows Scheduled task. This script example runs the bill exporter (exports everything that's in the Waiting to A/P Export folder in Work Flow Manager) and locates it in a folder called D:\UtilBill\Out. The file is named AP_ECAP_EXPORT.csv. The export "map" (called the billexp.ini profile) is named BILLEXPORT.
The A/P import process must obtain the AP_ECAP_EXPORT.csv file from the AP_folder.
"ecap" is the datasource name (the name of the ODBC connection)
"apexport" is the user name and user password of a user set up just for exporting purposes. This user can have only one permission - Other Settings/Export.
________________________________
Option Explicit
Dim objFSO, myshell, export_folder, archive_folder, AP_folder, strFilename, strDate, strTime, strDateTime, EnergyCAP_APExport, strECEProgramDirectory
export_folder = "d:\utilbill\out\temp\" 'The folder for the file to be exported
AP_folder = "d:\utilbill\out\" 'The folder where A/P will grab the data
archive_folder = "d:\utilbill\out\archive\" 'The folder where the file is to be archived
strFilename = "AP_ECAP_Export" 'Name of the file to be created by EnergyCAP
strDate = Cstr(Year(date) & "-" & MonthName(month(date)) & "-" & Day(date)) 'Just the date in format YYYY-MON-DD
strTime = Cstr(FormatDateTime(Now(),vbLongTime)) 'Just the time in format HH:MM:SS AM/PM
strTime = Replace (strTime, ":",".",1,-1,vbTextCompare) 'Time is formatted to be HH.MM.SS AM/PM
strDateTime = strDate & "_" & strTime 'Date and time are strung together
EnergyCAP_APExport = "exptsk -d ""ecap"" -u apexport -p apexport -c STANDARD:BILL_TEXT -f """& export_folder & strFilename & ".csv"" -s ""BillExport""" 'This is the command line to execute the AP exporter - note the various parts of the command line and change where necessary
strECEProgramDirectory = "c:\program files\energycap enterprise\" 'Install location of EnergyCAP - the location of the exptsk.exe utility on the applications server
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set myshell = WScript.CreateObject("WScript.Shell")
if(objFSO.FileExists(export_folder & strFilename & ".csv")) then 'Looks in the dir to see if any files exist
objFSO.DeleteFile export_folder & strFilename & ".csv", "True"
end if
if(objFSO.FileExists(etl_folder & strFilename & ".csv")) then 'Looks in the dir to see if any files exist
objFSO.DeleteFile etl_folder & strFilename & ".csv", "True"
end if
myshell.CurrentDirectory = strECEProgramDirectory 'Sets the working directory to be the location where EnergyCAP is installed
myshell.Run EnergyCAP_APExport, 1, True 'Executes the AP Exporter
if(objFSO.FileExists(export_folder & strFilename & ".csv")) then 'Looks in the dir to see if any files exist
objFSO.CopyFile export_folder & strFilename & ".csv", archive_folder & strFilename & "_" & strDateTime & ".csv", "True" 'Archives the csv file created by EnergyCAP
objFSO.CopyFile export_folder & strFilename & ".csv", AP_folder & strFilename & ".csv", "True" 'readies the csv file created by EnergyCAP for AP
end if
if(objFSO.FileExists(export_folder & strFilename & ".csv")) then 'Cleans out any files left from the AP Export task
objFSO.DeleteFile export_folder & strFilename & ".csv", "True"
end if
There is no way to remove an unwanted export profile using the EnergyCAP software. However, the profile can be deleted by externally editing the billexp.ini file by hand.
! CAUTION: Be sure to make a backup of the billexp.ini file before editing it because if you accidentally delete the profile you want to keep you won't be able to recover it!
In a default EnergyCAP installation, the file is located in the following directory:
C:\Documents and Settings\your_user_name\Local Settings\Application Data\EnergyCAP Enterprise
The text document is organized in multiple sections. There will be a section for each profile, headed by the profile name in brackets, and ending with the MergeSelections= statement. Just delete the unwanted section and save the edited file to the same name and location.
Last Revised: EnergyCAP Release and Database Version: EnergyCAP Enterprise 6.2.64.130 [DB 64]
This document lists and describes all exportable AP fields and (if applicable) their field names in the EnergyCAP Enterprise database (assuming the database version mentioned above). This document will be helpful in developing specifications and processes for sharing EnergyCAP information with accounting (AP/GL) interfaces.
This topic does not provide details of the EnergyCAP bill export process. To learn more about exporting bill data, see Bill Export Detail and Process .
During the export setup, the user may select which lines of data to export. Best practices as of 4Q 2011 dictate that AT MINIMUM, the Bill summary, Account summary, Meter summary, G/L summary, and Bill Line summary should be selected for export. The individual fields within each of these lines may be chosen at the Project Manager’s discretion.

String Literals are used to clearly identify individual lines of the export file. Best practices dictate that for EVERY line type used for bill export, a string “literal” field should be added to the output fields to identify the line type for any AP interface. This is done during export profile definition using the EnergyCAP export interface:

At minimum, the string literal must contain the letter “L” plus a number (0-6), depending upon the line type. Also, the string literal MUST be the FIRST field, in order, from top to bottom. The string literal should contain the [abbreviation] and full name of the line type. Custom also dictates that an “@” character is added to the END of the string literal. Customarily, each string literal will contain the name of the output line with which it is associated.
Below is an example demonstrating how to create and insert the string literal for the Bill Header line of the export profile during profile definition:

The Bill Header line appears ONCE at the top of a given export file. It contains highest-level summary information about the bills contained in the file.

| Field Name | Database Field | Field Description | Sample Value |
| Current date | N/A | This is the date that the export file is generated. | 01/10/2012 |
| Current time | N/A |
This is the time that the export file is generated . |
03:45:16 |
| Number of bills | N/A | This is the number of bills written to the export file. | 9 |
| Total debits | N/A | This is the total cost of all debits in the export file. | $0.00 |
| Total credits | N/A | This is the total cost of all credits in the export file. | $31152.79 |
| Total amount | N/A | This is the sum of the Bill.TotalCost amounts for all the bills in the export file. | $31152.79 |
Bill Summary lines appear ONCE per bill. They contain high-level summary information about a particular bill.

| Field Name | Database Field | Field Description | Sample Value |
| Bill ID | Bill.billID | This is the unique ID number assigned to each bill. | 1024 |
| Cost center | CostCenter.costCenterInfo | This is the display name of the Cost Center containing the Account associated with this bill. | My Cost Center |
| Cost center code | CostCenter.costCenterCode | This is the unique code of the Cost Center containing the Account associated with this bill. | MYCOSTCENTER |
| Parent cost center | CostCenterParentChildView.costCenterInfo | This is the display name of the Cost Center containing the Cost Center associated with the Account associated with this bill. | Parent Cost Center |
| Parent cost center code | CostCenterParentChildView.costCenterCode | This is the unique code of the Cost Center containing the Cost Center associated with the Account associated with this bill. |
PARENTCC |
| Account | Account.accountCode | This is the unique account code of the Account associated with this bill. | 66661 |
| Start date | Bill.beginDate | This is the begin date of the time period covered by the bill. | 01/10/2012 |
| End date | Bill.endDate | This is the end date of the time period covered by the bill. | 02/09/2012 |
| Exported | Bill.exported | This is the flag to show whether or not the bill has been exported. | 0 |
| Exported date | Bill.exportDate | This is the date upon which the bill has been exported. If the bill has never been exported, this field will contain the value “<none>”. |
<none> |
| Total cost | Bill.totalCost |
This is the total cost of all charges on the bill | $150.00 |
| Vendor |
Vendor.vendorCode | This is the unique vendor code for the vendor assigned to the account with which this bill is assigned. | VENDOR2 |
| Billing period | Bill.billingPeriod | This is the billing period month to which this bill is assigned. | Jan |
| Billing year | Bill.billingPeriodYear | This is the billing period year to which this bill is assigned. | 2012 |
| Batch number |
Batch.batchCode | This is the unique batch number to which this bill is assigned. This field will be blank if the bill is not assigned to a batch. | 012012 |
| Account period | Bill.accountPeriod | This is the account period month assigned to this bill. This field will be blank if the bill is not assigned to an account period. |
March |
| Account year | Bill.accountPeriodYear | This is the account period year assigned to this bill. This field will be blank if the bill is not assigned to an account period. |
2012 |
| Control code | Bill.controlCode | This is the control code assigned to this bill. This field will be blank if there is no control code assigned to this bill. | 0010102012 |
| Due date | Bill.dueDate | This is the due date assigned to the bill. This field will contain the value “<none>” if no due date is assigned. | <none> |
| Estimated | Bill.estimated | This flag indicates whether the bill is an estimated bill or an actual bill. | 0 |
| Invoice number | Bill.invoiceNumber | This is the invoice number assigned to the bill. | 14243414241 |
| Next reading | Bill.NextReading | The Date/Time Stamp of when we expect the next reading to be taken. | 01/02/2012 |
| Statement date | Bill.StatementDate | This is the statement date assigned to the bill. | <none> |
| Observation method ID | Bill.observationMethodID |
This is the unique identifier for the type of bill. * |
|
| Account service Address | Bill.addressid | This is the service address assigned to the account to which this bill is assigned.** | |
| Account active | Account.active | This flag indicates whether or not the account to which this bill is assigned is active. | 1 |
| Created Date | Bill.createdDate |
This is the date on which the bill was created and saved. | 01/10/2012 |
| Modified Date | Bill.modifiedDate | This is the date on which the bill was last modified. | 01/10/2012 |
*Bills can be Automatic (1), Manual (2), Estimated (3), Simulated (4), Accrual (5), Adjustment (6) … from the ObservationMethod Table. The Observation Method used depends on what method is used to create the bill. For example, Manual is when bills are hand-keyed, Automated is for Bills that are imported, Estimated is when the Estimated flag is checked, Simulated is from processors like Bill Splits and Calculated Accounts. Accrual bills are created by the accruals module/processor, and Adjustment bills are when the “monkey wrench” is used from the bill edit screen.
**Joined to Address table where addresstypeid = 3 (Note: Physical – 1, Billing – 2, Service – 3)
Account Summary lines appear ONCE per bill. They contain account-level summary information about a particular bill.

| Field Name | Database Field | Field Description | Sample Value |
| Account ID | Account.accountID | This is the unique ID number assigned to the account. | 1024 |
| Start date | Bill.beginDate | This is the begin date of the time period covered by the bill. | 01/10/2012 |
| End date | Bill.endDate | This is the end date of the time period covered by the bill. | 02/09/2012 |
| Code |
Account.accountCode | This is the unique account code of the Account associated with this bill. | 66661 |
| Display |
Account.accountInfo | This is the display name of the Account associated with this bill. | 66661 |
| Vendor ID | Account.vendorID | This is the unique ID number of the vendor to which this account is assigned. Generated automatically by EnergyCAP during vendor creation. |
1024 |
| Vendor | Vendor.vendorCode | This is the unique code associated with the vendor to which this account is assigned. |
VENDOR1 |
| Rollup cost | N/A | This is the sum of all the dollar amounts belonging to the meters and account charges assigned to this account for this bill. | $1548.23 |
Meter Summary lines appear MULTIPLE times per Account Summary. They contain meter-level summary information about a particular bill.

| Field Name | Database Field | Field Description | Sample Value |
| Place ID | LogicalDevice.placeID | This is the unique ID number assigned to the place to which this meter is assigned. Generated automatically by EnergyCAP during Place creation. | 216 |
| Place code | Place.placeCode | This is the unique place code of the Place to which this meter is assigned. | MYPLACE |
| Place display | Place.placeInfo | This is the display name of the Place to which this meter is assigned. | My Place |
| Place type | PlaceType.placeTypeCode | This is the unique place type code of the Place to which this meter is assigned. | BUILDING |
| Meter ID | Meter.meterID | This is the unique ID number assigned to this meter. Generated automatically by EnergyCAP during Meter creation. | 52 |
| Meter code | LogicalDevice.logicalDeviceCode | This is the unique code assigned to this meter. | MULTIMETERS-ELE01 |
| Meter display | LogicalDevice.logicalDeviceInfo | This is the display name assigned to this meter. | MULTIMETERS-ELE01 |
| Cost | N/A | This is the sum of all the charges in this bill which are assigned to this meter. |
$845.12 |
| Use | N/A | This is the usage assigned to this meter in this bill. | 457.0000 |
| Demand | N/A | This is the demand assigned to this meter in this bill |
1245.0000 |
| Use unit |
Unit.unitCode | This is the unique unit code assigned to the use for this meter for this bill. | KWH |
| Demand unit | Unit.unitCode | This is the unique unit code assigned to the demand for this meter for this bill. | KW |
| Cost per Unit | N/A | This is the unit cost for the usage assigned to this meter for this bill (Cost / Use). | 1.85 |
G/L, GL, or General Ledger Summary lines appear ONCE per Meter Summary (if GL records are assigned to those meters), ONCE per Account Summary (for account-charges, if a GL record is assigned to the meter), or MULTIPLE times per Account Summary (for special charges, if the user inserts extra, non-template bodylines). They contain GL-level summary information about a particular bill.

| Field Name | Database Field | Field Description |
Sample Value |
| Code | GeneralLedger.generalLedgerCode | This is the unique general ledger code of the General Ledger record assigned to this meter. | ABC123 |
| Subcode 1 | GeneralLedger.subCode01 | This is a unique information placeholder. |
ABC124 |
| Subcode 2-19 | GeneralLedger.subCode02-19 | This is a unique information placeholder. | ABC125-143 |
| Subcode 20 | GeneralLedger.subCode20 | This is a unique information placeholder. | ABC144 |
| Cost |
N/A | This is the rolled-up cost of all charge lines underneath this GL. | $123.45 |
Bodyline or Bill Line Summary lines appear MULTIPLE times per GL Summary (if GL records are assigned to Accounts or Meters) or MULTIPLE times per Account or Meter summary. They contain bill bodyline-level information about a particular bill and contain the most granular information of all the export line types.

| Field Name | Database Field | Field Description | Sample Value |
| Commodity | Commodity.commodityCode | This is the unique commodity code for the commodity tracked by this bill bodyline. | MONEY |
| Observation type | ObservationType.observationTypeCode | This is the unique observation type code for the observation type tracked by this bill bodyline. | CHARGE |
| Unit | Unit.unitCode | This is the unique unit code for the unit of measure tracked by this bill bodyline. |
KWH |
| Cost unit | Unit.unitCode | This unique unit code for the cost unit of measure tracked by this bill bodyline. | USDOLLARS |
| Value | BodyLine.value | This is the numerical value for this bodyline. | 1234.0000 |
| Cost | Bodyline.cost | This is the cost for this bodyline. | $123.45 |
The Bill Footer line appears ONCE at the bottom of a given export file. It contains highest-level summary information about the bills contained in the file.

| Field Name |
Database Field | Field Description | Sample Value |
| Current date | N/A |
This is the date that the export file is generated. |
01/10/2012 |
| Current time | N/A |
This is the time that the export file is generated. |
03:45:16 |
| Number of bills | N/A |
This is the number of bills written to the export file. |
9 |
| Total debits | N/A |
This is the total cost of all debits in the export file. |
$0.00 |
| Total credits | N/A |
This is the total cost of all credits in the export file. |
$31152.79 |
| Total amount | N/A |
This is the sum of the Bill.TotalCost amounts for all the bills in the export file. | $31152.79 |