All tables
tables · table

invdesptax

The invdesptax table serves as a granular repository for tax-level details associated with specific invoices within the dispatch/billing system. It tracks individual tax components (duties) applied to an invoice, including the tax percentage and the calculated tax amount. This table is typically a child table to invoice headers and is used for tax reporting, audit trails, and financial breakdowns (e.g., VAT, CGST, SGST).

Row count
57
Last entry
Source
tables

Columns

8
ColumnTypeNullableMeaning
indexintegerNOPrimary Key - Unique record identifier.
compcodestringNOCompany Identifier.
invnointegerNOInvoice Number.
invyearintegerNOFinancial year of the invoice.
duty_codeintegerNOReference to the type of tax/duty.
snointegerNOSerial number/Sequence of tax lines per invoice.
taxpernumberYESTax percentage applied.
taxamountnumberYESCalculated tax amount for the specific duty.

Full documentation

### 1) Overview
 The `invdesptax` table serves as a granular repository for tax-level details associated with specific invoices within the dispatch/billing system. It tracks individual tax components (duties) applied to an invoice, including the tax percentage and the calculated tax amount. This table is typically a child table to invoice headers and is used for tax reporting, audit trails, and financial breakdowns (e.g., VAT, CGST, SGST).
 
 ### 2) Column Dictionary
 
 | Column | Type | Nullable | Meaning | Allowed Values | SQL Usage |
 | :--- | :--- | :--- | :--- | :--- | :--- |
 | **index** | integer | NO | Primary Key - Unique record identifier. | | `WHERE index = 10` |
 | **compcode** | string | NO | Company Identifier. | e.g., "DAS" | `ON a.compcode = b.compcode` |
 | **invno** | integer | NO | Invoice Number. | | `JOIN ... ON invno = ...` |
 | **invyear** | integer | NO | Financial year of the invoice. | e.g., 2019 | `GROUP BY invyear` |
 | **duty_code** | integer | NO | Reference to the type of tax/duty. | 1, 11, 12, 19, 51, 52 | `WHERE duty_code = 51` |
 | **sno** | integer | NO | Serial number/Sequence of tax lines per invoice. | 1, 2, 3... | `ORDER BY sno` |
 | **taxper** | number | YES | Tax percentage applied. | e.g., 9.0, 18.0, 100.0 | `SUM(taxper)` |
 | **taxamount** | number | YES | Calculated tax amount for the specific duty. | | `SUM(taxamount)` |
 
 ### 3) Relationships & Join Map
 
 #### Real Physical Joins (Based on SCHEMA_MAP)
 
 **1. Invoice Dispatch Header**
 * **Relationship:** Child to Parent
 * **Join Condition:** `invdesptax.compcode = invdesphdr.compcode` AND `invdesptax.invno = invdesphdr.invno` AND `invdesptax.invyear = invdesphdr.invyear`
 * **Purpose:** To link specific tax breakdowns to general dispatch information.
 
 **2. Standard Invoice Header**
 * **Relationship:** Child to Parent
 * **Join Condition:** `invdesptax.compcode = invhdr.compcode` AND `invdesptax.invno = invhdr.invno` AND `invdesptax.invyear = invhdr.invyear`
 * **Purpose:** To retrieve customer details, invoice dates, and total amounts associated with these taxes.
 
 **3. Duty/Tax Master**
 * **Relationship:** Reference
 * **Join Condition:** `invdesptax.compcode = dutymas.compcode` AND `invdesptax.duty_code = dutymas.duty_code`
 * **Alternative Join:** `invdesptax.compcode = cdutymas.compcode` AND `invdesptax.duty_code = cdutymas.duty_code`
 * **Purpose:** To fetch the descriptive name of the tax (e.g., "CGST", "VAT") based on the `duty_code`.
 
 **4. Invoice Detail Comparison**
 * **Relationship:** Peer
 * **Join Condition:** `invdesptax.compcode = invdespdtl.compcode` AND `invdesptax.invno = invdespdtl.invno` AND `invdesptax.invyear = invdespdtl.invyear`
 * **Purpose:** Likely used to verify tax amounts against individual line item values in the dispatch detail.