# worksheet_account_contract_taxable_revenue

## Description

<details>
<summary><strong>Table Definition</strong></summary>

```sql
CREATE TABLE `worksheet_account_contract_taxable_revenue` (
  `account_contract_taxable_revenue_id` mediumint unsigned NOT NULL AUTO_INCREMENT,
  `worksheet_account_contract_closing_balance_id` mediumint unsigned DEFAULT NULL,
  `contract_id` mediumint unsigned NOT NULL,
  `account_id` mediumint unsigned NOT NULL,
  `reference_payment_entity_id` mediumint unsigned NOT NULL,
  `statement_period_id` mediumint unsigned NOT NULL,
  `abacus_event_id` mediumint unsigned NOT NULL,
  `amount` decimal(20,2) NOT NULL,
  `currency_code` char(3) NOT NULL,
  `revenue_transaction_type` enum('digital','physical','closing_balance') NOT NULL,
  `is_us_revenue` tinyint(1) NOT NULL DEFAULT '0',
  `created_at` datetime NOT NULL,
  `created_by` varchar(255) NOT NULL,
  `last_modified` datetime NOT NULL,
  `last_modified_by` varchar(255) NOT NULL,
  `deleted_at` datetime DEFAULT NULL,
  `deleted_by` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`account_contract_taxable_revenue_id`),
  KEY `fk_wactr_contract` (`contract_id`),
  KEY `fk_wactr_account` (`account_id`),
  KEY `fk_wactr_statement_period` (`statement_period_id`),
  KEY `fk_wactr_abacus_event` (`abacus_event_id`),
  KEY `fk_wactr_ref_payment_entity` (`reference_payment_entity_id`),
  KEY `fk_wactr_waccb` (`worksheet_account_contract_closing_balance_id`),
  CONSTRAINT `fk_wactr_abacus_event` FOREIGN KEY (`abacus_event_id`) REFERENCES `abacus_event` (`abacus_event_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `fk_wactr_account` FOREIGN KEY (`account_id`) REFERENCES `account` (`account_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `fk_wactr_contract` FOREIGN KEY (`contract_id`) REFERENCES `contract` (`contract_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `fk_wactr_ref_payment_entity` FOREIGN KEY (`reference_payment_entity_id`) REFERENCES `reference_payment_entity` (`reference_payment_entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `fk_wactr_statement_period` FOREIGN KEY (`statement_period_id`) REFERENCES `statement_period` (`statement_period_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `fk_wactr_waccb` FOREIGN KEY (`worksheet_account_contract_closing_balance_id`) REFERENCES `worksheet_account_contract_closing_balance` (`worksheet_account_contract_closing_balance_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=[Redacted by tbls] DEFAULT CHARSET=utf8mb3
```

</details>

## Columns

| Name                                          | Type                                         | Default | Nullable | Extra Definition | Children | Parents                                                                                     | Comment |
| --------------------------------------------- | -------------------------------------------- | ------- | -------- | ---------------- | -------- | ------------------------------------------------------------------------------------------- | ------- |
| abacus_event_id                               | mediumint unsigned                           |         | false    |                  |          | [abacus_event](abacus_event.md)                                                             |         |
| account_contract_taxable_revenue_id           | mediumint unsigned                           |         | false    | auto_increment   |          |                                                                                             |         |
| account_id                                    | mediumint unsigned                           |         | false    |                  |          | [account](account.md)                                                                       |         |
| amount                                        | decimal(20,2)                                |         | false    |                  |          |                                                                                             |         |
| contract_id                                   | mediumint unsigned                           |         | false    |                  |          | [contract](contract.md)                                                                     |         |
| created_at                                    | datetime                                     |         | false    |                  |          |                                                                                             |         |
| created_by                                    | varchar(255)                                 |         | false    |                  |          |                                                                                             |         |
| currency_code                                 | char(3)                                      |         | false    |                  |          |                                                                                             |         |
| deleted_at                                    | datetime                                     |         | true     |                  |          |                                                                                             |         |
| deleted_by                                    | varchar(255)                                 |         | true     |                  |          |                                                                                             |         |
| is_us_revenue                                 | tinyint(1)                                   | 0       | false    |                  |          |                                                                                             |         |
| last_modified                                 | datetime                                     |         | false    |                  |          |                                                                                             |         |
| last_modified_by                              | varchar(255)                                 |         | false    |                  |          |                                                                                             |         |
| reference_payment_entity_id                   | mediumint unsigned                           |         | false    |                  |          | [reference_payment_entity](reference_payment_entity.md)                                     |         |
| revenue_transaction_type                      | enum('digital','physical','closing_balance') |         | false    |                  |          |                                                                                             |         |
| statement_period_id                           | mediumint unsigned                           |         | false    |                  |          | [statement_period](statement_period.md)                                                     |         |
| worksheet_account_contract_closing_balance_id | mediumint unsigned                           |         | true     |                  |          | [worksheet_account_contract_closing_balance](worksheet_account_contract_closing_balance.md) |         |

## Constraints

| Name                        | Type        | Definition                                                                                                                                                        |
| --------------------------- | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| PRIMARY                     | PRIMARY KEY | PRIMARY KEY (account_contract_taxable_revenue_id)                                                                                                                 |
| fk_wactr_abacus_event       | FOREIGN KEY | FOREIGN KEY (abacus_event_id) REFERENCES abacus_event (abacus_event_id)                                                                                           |
| fk_wactr_account            | FOREIGN KEY | FOREIGN KEY (account_id) REFERENCES account (account_id)                                                                                                          |
| fk_wactr_contract           | FOREIGN KEY | FOREIGN KEY (contract_id) REFERENCES contract (contract_id)                                                                                                       |
| fk_wactr_ref_payment_entity | FOREIGN KEY | FOREIGN KEY (reference_payment_entity_id) REFERENCES reference_payment_entity (reference_payment_entity_id)                                                       |
| fk_wactr_statement_period   | FOREIGN KEY | FOREIGN KEY (statement_period_id) REFERENCES statement_period (statement_period_id)                                                                               |
| fk_wactr_waccb              | FOREIGN KEY | FOREIGN KEY (worksheet_account_contract_closing_balance_id) REFERENCES worksheet_account_contract_closing_balance (worksheet_account_contract_closing_balance_id) |

## Indexes

| Name                        | Definition                                                                     |
| --------------------------- | ------------------------------------------------------------------------------ |
| PRIMARY                     | PRIMARY KEY (account_contract_taxable_revenue_id) USING BTREE                  |
| fk_wactr_abacus_event       | KEY fk_wactr_abacus_event (abacus_event_id) USING BTREE                        |
| fk_wactr_account            | KEY fk_wactr_account (account_id) USING BTREE                                  |
| fk_wactr_contract           | KEY fk_wactr_contract (contract_id) USING BTREE                                |
| fk_wactr_ref_payment_entity | KEY fk_wactr_ref_payment_entity (reference_payment_entity_id) USING BTREE      |
| fk_wactr_statement_period   | KEY fk_wactr_statement_period (statement_period_id) USING BTREE                |
| fk_wactr_waccb              | KEY fk_wactr_waccb (worksheet_account_contract_closing_balance_id) USING BTREE |

## Relations

![er](worksheet_account_contract_taxable_revenue.svg)

---

> Generated by [tbls](https://github.com/k1LoW/tbls)
