JournalEntries
Handles QuickBooks Journal Entries, supporting creation, updates, deletion, and queries for accounting adjustments. Note: Journal Entry Lines cannot be modified in existing entries.
Table Specific Information
JournalEntries are unique in that the Credit Line Items and Debit Line Items must add up to the same total in one transaction. It is not possible to change a Journal Line Item one at a time and thus end up with an unbalanced transaction.
Select
By default, SupportEnhancedSQL is set to true, and the following will be honored if present. Other filters will be executed client side. If SupportEnhancedSQL is set to false, only the following filters will be honored.
QuickBooks allows only a small subset of columns to be used in the WHERE clause of a SELECT query. These columns can typically be used with only the equals or = comparison. The available columns for JournalEntries are Id, Date, TimeCreated, ReferenceNumber, LineEntityName, LineEntityId, LineAccount, and LineAccountId. TimeModified and Date may be used with the >, >=, <, <=, or = conditions and may be used twice to specify a range. ReferenceNumber may be used with the = or LIKE conditions to establish a starts-with, ends-with, or contains syntax. For example:
SELECT * FROM JournalEntries WHERE TimeModified > '1/1/2011' AND TimeModified < '2/1/2011' AND ReferenceNumber LIKE '%12345%'
Insert
To add a JournalEntry, specify at least one Credit and one Debit Line. The LineAggregate column may be used to specify an XML aggregate of JournalEntry Line data. The columns that may be used in these aggregates are defined in the JournalEntryLines table and it starts with Line. For example, the following will insert a new JournalEntry with two Credit Lines and one Debit Line:
INSERT INTO JournalEntries (ReferenceNumber, LineAggregate) VALUES ('12345', '<JournalEntryLines> <Row><LineType>Credit</LineType><LineAccount>Retained Earnings</LineAccount><LineAmount>100</LineAmount></Row> <Row><LineType>Credit</LineType><LineAccount>Note Payable - Bank of Anycity</LineAccount><LineAmount>20</LineAmount></Row> <Row><LineType>Debit</LineType><LineAccount>Checking</LineAccount><LineAmount>120</LineAmount></Row> </JournalEntryLines>')
To insert subitems, set the ItemName field to the FullName of the item; for example, '<Row><ItemName>Subs:Carpet</ItemName><ItemQuantity>0</ItemQuantity></Row>'
To delete a JournalEntry, simply perform a DELETE statement and set the Id equal to the JournalEntryId you wish to delete. For example:
DELETE FROM JournalEntries WHERE Id = '16336-1450191232'
Columns
Name | Type | ReadOnly | References | ColumnSize | Description |
ID [KEY] | String | True | 255 |
The unique identifier for the journal entry. | |
ReferenceNumber | String | False | 21 |
The reference number assigned to the journal entry transaction. | |
TxnNumber | Integer | True |
An identifying number for the transaction, distinct from the Quickbooks generated ID. | ||
Date | Date | False |
The date of the transaction. When used in a WHERE clause of a SELECT query, it overrides the pseudo columns StartDate and EndDate. | ||
CreditLineCount | Integer | False |
The total number of credit lines included in the journal entry. | ||
DebitLineCount | Integer | False |
The total number of debit lines included in the journal entry. | ||
FirstCreditAccount | String | False |
The name of the first credit account associated with the journal entry. | ||
FirstCreditAmount | Decimal | False |
The monetary amount of the first credit line in the journal entry. | ||
FirstCreditMemo | String | False |
The memo text associated with the first credit line in the journal entry. | ||
FirstCreditEntityName | String | False |
The name of the entity linked to the first credit line of the journal entry. | ||
FirstCreditEntityId | String | False |
The unique ID of the entity linked to the first credit line of the journal entry. | ||
FirstDebitAccount | String | False |
The name of the first debit account associated with the journal entry. | ||
FirstDebitAmount | Decimal | False |
The monetary amount of the first debit line in the journal entry. | ||
FirstDebitMemo | String | False |
The memo text associated with the first debit line in the journal entry. | ||
FirstDebitEntityName | String | False |
The name of the entity linked to the first debit line of the journal entry. | ||
FirstDebitEntityId | String | False |
The unique ID of the entity linked to the first debit line of the journal entry. | ||
LineAggregate | String | False | 5000 |
An aggregate of the credit and debit line data, used for adding a journal entry and its line item data. | |
CurrencyName | String | False | 64 |
The name of the currency used for the journal entry. Requires QBXML version 8.0 or higher. | |
CurrencyId | String | False |
Currency.ID | 255 |
The unique identifier for the currency used for the journal entry. Requires QBXML version 8.0 or higher. |
ExchangeRate | Double | False |
The exchange rate applied to convert the foreign currency into the home currency of the QuickBooks file. | ||
IsHomeCurrencyAdjustment | Boolean | False |
Indicates if the transaction uses the home currency. If true, the Currency and ExchangeRate fields are overridden to default to the home currency. | ||
EditSequence | String | False | 16 |
A string used for versioning the journal entry in QuickBooks. | |
TimeModified | Datetime | False |
The timestamp indicating the last modification of the journal entry. | ||
TimeCreated | Datetime | False |
The timestamp indicating when the journal entry was created. |
Pseudo-Columns
Pseudo Column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source.
Name | Type | Description |
Line* | String |
All columns specific to journal entry line items can be included in insert operations. |
LineEntityName | String |
Filters journal entry data by the name of an entity linked to a line item. |
LineEntityId | String |
Filters journal entry data by the ID of an entity linked to a line item. |
LineAccount | String |
Filters journal entry data by the name of an account linked to a line item. |
LineAccountId | String |
Filters journal entry data by the ID of an account linked to a line item. |