Table: dbo.Year_End_Close_Net_Income_Distribution
The table contains the accounts that had net income distributed to them during a year end close event.
Columns
Name | Type | Constraints | Description
gl_fiscal_year_KEY | int (4) | NOT NULL | The foreign key refering to the options used to close to a new year. Also the fiscal year that this distribution belongs to.
gl_account_KEY | int (4) | NOT NULL | The foreign key refering to the account to which the distribution occured.
percentage | decimal (5, 4) | NOT NULL | The percentage of the total net income that was distributed. The goal is to have these sum to approximately 100.0000 when aggregating for a given combination of gl_fiscal_year_KEY and gl_account_segment_code_KEY. The problem is in the definition of "approximately". Roughly: "As close as you can get but have the actual dollars-and-cents come out exact; whatever minimal error is needed to achieve that". That is why there is no DBMS/DAL constraint.
year_end_close_net_income_distribution_KEY | int (4) | NOT NULL | Primary key.
gl_account_segment_code_KEY | int (4) |  | The segment code key associated with GLAccount when closing by segments. Null when not closing by segments.
sequence_number | int (4) | NOT NULL | The row order.
amount | decimal (9, 2) |  | The amount column shall be set to null for existing rows, but will not be null for new rows.
algorithm_version | tinyint (1) | NOT NULL | The algorithm_version column will be set to 1 for existing rows, but set to 2 for all new columns.

Primary key
Name | Columns | Description
PK_Year_End_Close_Net_Income_Distribution | year_end_close_net_income_distribution_KEY |
Unique constraints
Name | Columns | Description
UK_Year_End_Close_Net_Income_Distribution$gl_fiscal_year_KEY$gl_account_segment_code_KEY$sequence_number | gl_fiscal_year_KEY, gl_account_segment_code_KEY, sequence_number |

Foreign keys
Name | Columns | Referenced table | Description
FK_Year_End_Close_Net_Income_Distribution__GL_Account_Segment_Code__gl_account_segment_code_KEY | gl_account_segment_code_KEY | GL_Account_Segment_Code (gl_account_segment_code_KEY) |
FK_Year_End_Close_Net_Income_Distribution__Year_End_Close_Option__gl_fiscal_year_KEY | gl_fiscal_year_KEY | Year_End_Close_Option (gl_fiscal_year_KEY) |
FK_Year_End_Close_Net_Income_Distribution__GL_Account__gl_account_KEY | gl_account_KEY | GL_Account (gl_account_KEY) |