Table: dbo.Quick_Books_Retrieved_Account
this table contains information on gl accounts retrieved from quickbooks for a given ACS client, where the gl accounts have not yet been imported into the permanent ACS tables for that client. For quickbooks online, the process of importing data has two steps. First, we retrieve the data from a quickbooks online company, and then we import the retrieved data into the permanent ACS tables. We need a means to store off the information after that first step has completed, but before that second step. This table provides the means for us to store information on accounts that have been retrieved from a quickbooks online company, but not yet imported into the permanent tables in ACS for the client. Once the import completes for one client, the records in this table for that one client will be removed.
Columns
Name | Type | Constraints | Description
quick_books_retrieved_account_KEY | int (4) | NOT NULL | the primary Key for this table.
client_KEY | int (4) | NOT NULL | the client key, to allow us to group retrieved gl accounts by ACS client.
is_active | bit (1) | NOT NULL | True if the gl account is active, and false if the gl account is not active, in quickbooks.
list_id | nvarchar (60) | NOT NULL | the id of the account. this is supposed to be a unique value, for the gl accounts of one quickbooks company.
parent_id | nvarchar (60) | NOT NULL | the parent id of the quickbooks account, if any.
account_number | nvarchar (30) | NOT NULL | account number associated with this account. Account numbers are optional in quickbooks.
name | nvarchar (200) | NOT NULL | the name of this account.
full_name | nvarchar (400) | NOT NULL | the full name of the account. this should be a unique value, for the gl accounts of one quickbooks company.
description | nvarchar (200) | NOT NULL | a description of the gl account.
current_balance | decimal (9, 2) |  | Current balance of the QuickBooks gl account. This balance is retrieved from QuickBooks Online.
account_type | nvarchar (-1) | NOT NULL | The type of the Quickbooks Account, this comes directly from the Web API.
account_subtype | nvarchar (-1) | NOT NULL | The subtype of the Quickbooks Account, this comes directly from the Web API.

Primary key
Name | Columns | Description
PK_Quick_Books_Retrieved_Account | quick_books_retrieved_account_KEY |
Unique constraints
Name | Columns | Description
UK_Quick_Books_Retrieved_Account$client_KEY$list_id | client_KEY, list_id |
UK_Quick_Books_Retrieved_Account$client_KEY$full_name | client_KEY, full_name |

Foreign keys
Name | Columns | Referenced table | Description
FK_Quick_Books_Retrieved_Account__Client__client_KEY | client_KEY | Client (client_KEY) |

Incoming foreign keys
Name | Columns | Referencing table | Description
FK_Quick_Books_Retrieved_Transaction_Distribution__Quick_Books_Retrieved_Account__quick_books_retrieved_account_KEY | quick_books_retrieved_account_KEY | Quick_Books_Retrieved_Transaction_Distribution |