Table: dbo.Custom_Office_Account_Grouping
This table will store all the grouping and grouping codes for the custom excel grid if the grid is grouped by account grouping
Columns
Name | Type | Constraints | Description
custom_office_account_grouping_KEY | int (4) | NOT NULL | Primary key
trial_balance_grid_KEY | int (4) | NOT NULL | Foreign key to custom excel grid table
gl_account_grouping_KEY | int (4) | NOT NULL | Foreign key to the gl account grouping table
gl_account_grouping_code_KEY | int (4) | NOT NULL | Foreign key to the gl account grouping code table
include_subcode | bit (1) | NOT NULL | Boolean that tells us whether to include subcode for the given account grouping code
include_accounts | bit (1) | NOT NULL | Boolean that tells us whether to include accounts for the given account grouping code
sequence_number | int (4) | NOT NULL | To order the codes in a specific order

Primary key
Name | Columns | Description
PK_Custom_Office_Account_Grouping | custom_office_account_grouping_KEY |
Unique constraints
Name | Columns | Description
UK_Custom_Office_Account_Grouping$trial_balance_grid_KEY$gl_account_grouping_KEY$gl_account_grouping_code_KEY | trial_balance_grid_KEY, gl_account_grouping_KEY, gl_account_grouping_code_KEY |

Foreign keys
Name | Columns | Referenced table | Description
FK_Custom_Office_Account_Grouping__GL_Account_Grouping__gl_account_grouping_KEY | gl_account_grouping_KEY | GL_Account_Grouping (gl_account_grouping_KEY) |
FK_Custom_Office_Account_Grouping__GL_Account_Grouping_Code__gl_account_grouping_code_KEY | gl_account_grouping_code_KEY | GL_Account_Grouping_Code (gl_account_grouping_code_KEY) |
FK_Custom_Office_Account_Grouping__Trial_Balance_Grid__trial_balance_grid_KEY | trial_balance_grid_KEY | Trial_Balance_Grid (trial_balance_grid_KEY) |