All tables
tables · table

custtax

The custtax table serves as a configuration mapping between customers and their specific tax or duty structures. It defines which duties (duty_code) are applicable to a particular customer (custcode) and the respective rates (taxpercentage).

Row count
933
Last entry
Source
tables

Columns

6
ColumnTypeNullableMeaning
indexintegerNoPrimary key for the record.
compcodestringNoThe unique identifier for the company.
custcodestringNoThe unique identifier for the customer.
srnointegerNoSerial number indicating the sequence of tax/duty application.
duty_codeintegerNoIdentifier for the specific duty or tax type.
taxpercentagenumberNoThe tax rate or percentage applied for the specific duty.

Full documentation

### 1. Overview
 The `custtax` table serves as a configuration mapping between customers and their specific tax or duty structures. It defines which duties (`duty_code`) are applicable to a particular customer (`custcode`) and the respective rates (`taxpercentage`). 
 
 This table is typically used during invoice generation or purchase order processing to calculate the tax breakdown based on the customer's profile.
 
 ### 2. Column Dictionary
 
 | Column | Type | Nullable | Meaning | Allowed Values | SQL Usage |
 | :--- | :--- | :--- | :--- | :--- | :--- |
 | **index** | integer | No | Primary key for the record. | 0, 1, 2... | PK |
 | **compcode** | string | No | The unique identifier for the company. | "DAS" | Join Key |
 | **custcode** | string | No | The unique identifier for the customer. | "SBNS", "SHAPL", "LLIL" | Join Key (FK) |
 | **srno** | integer | No | Serial number indicating the sequence of tax/duty application. | 1, 2, 3, 4, 5, 6 | Order By |
 | **duty_code** | integer | No | Identifier for the specific duty or tax type. | 1, 3, 6, 7, 11, 15, 19, 23, 51, 52 | Join Key (FK) |
 | **taxpercentage** | number | No | The tax rate or percentage applied for the specific duty. | 0.0, 1.0, 4.0, 5.0, 9.0, 12.5, 100.0 | Calculation |
 
 ### 3. Relationships & Join Map
 
 The `custtax` table acts as a child table to the Customer Master and a reference table for Duty definitions.
 
 #### Primary Joins (SCHEMA_MAP Confirmed):
 * **Customer Master (`dbo.cust`)**: Joined on `compcode` and `custcode` to retrieve customer names, addresses, and GST details.
 * **Duty Master (`dbo.dutymas`)**: Joined on `compcode` and `duty_code` to identify the name of the tax (e.g., CGST, SGST, IGST, Excise).
 * **Purchase Order Taxes (`dbo.potax`)**: Joined on `compcode`, `custcode`, and `duty_code` to synchronize tax rates between customer profiles and specific orders.
 
 #### Transactional Joins (Likely):
 * **Sales Invoices (`dbo.invhdr`)**: Linked via `compcode` and `custcode` to apply the default tax profile during billing.
 * **Invoice Tax Details (`dbo.invtax`)**: Joined on `compcode` and `duty_code` to compare applied invoice taxes against the customer's master tax configuration.
 * **Export PO Taxes (`dbo.exppotax`)**: Joined on `compcode`, `custcode`, and `duty_code` for international customer tax handling.
 
 ---