All tables
tables · table

saleappdutymas

The saleappdutymas table serves as a mapping or junction table within the Sales/Tax module. It defines the relationship between primary Duty Codes (representing tax categories or groups) and their specific Applicable Duty Codes (representing individual tax components like GST, VAT, or Surcharges).

Row count
102
Last entry
Source
tables

Columns

4
ColumnTypeNullableMeaning
indexintegerNOPrimary Key (technical)
compcodestringNOCompany Identifier
duty_codeintegerNOPrimary Duty/Tax Code Group
app_duty_codeintegerNOSub-Duty or Component Duty Code

Full documentation

### 1) Overview
 The `saleappdutymas` table serves as a mapping or junction table within the Sales/Tax module. It defines the relationship between primary **Duty Codes** (representing tax categories or groups) and their specific **Applicable Duty Codes** (representing individual tax components like GST, VAT, or Surcharges). 
 
 This table allows the system to determine which sub-taxes or related duties should be triggered or calculated when a specific primary tax group is applied to a transaction. It is specifically used for sales-related tax configurations.
 
 ### 2) Column Dictionary
 
 | Column | Type | Nullable | Meaning | Allowed Values | SQL Usage |
 | :--- | :--- | :--- | :--- | :--- | :--- |
 | **index** | integer | NO | Primary Key (technical) | Auto-incrementing IDs | `WHERE index = 10` |
 | **compcode** | string | NO | Company Identifier | e.g., "DAS" | `ON a.compcode = b.compcode` |
 | **duty_code** | integer | NO | Primary Duty/Tax Code Group | e.g., 7, 11, 15 | `JOIN saledutymas ON ...` |
 | **app_duty_code** | integer | NO | Sub-Duty or Component Duty Code | e.g., 1, 5, 25 | `JOIN saledutymas ON ...` |
 
 ---
 
 ### 3) Relationships & Join Map
 
 #### Logical Relationships
 * **One-to-Many**: One `duty_code` (Primary Group) maps to multiple `app_duty_code` (Tax Components).
 * **Hierarchical**: This table creates a hierarchy for tax calculation in sales invoices.
 
 #### Strict Join Map (Based on SCHEMA_MAP)
 
 1. **saledutymas (Master Tax Definitions)**
  * **Join Column**: `duty_code` (and/or `app_duty_code`)
  * **Usage**: To retrieve the names and calculation rules (nature, sequence, roff) for the codes listed in this table.
  * **SQL**: `saleappdutymas.duty_code = saledutymas.duty_code`
 
 2. **dutymas (Generic Duty Master)**
  * **Join Column**: `duty_code`
  * **Usage**: General duty attributes (HSN, Tax Rate).
  * **SQL**: `saleappdutymas.duty_code = dutymas.duty_code`
 
 3. **invtax (Invoice Tax Details)**
  * **Join Column**: `duty_code`
  * **Usage**: Link applicable duty configurations to actual values calculated on specific invoices.
  * **SQL**: `saleappdutymas.duty_code = invtax.duty_code`
 
 4. **TEMPSALEREGISTER (Reporting)**
  * **Join Column**: `compcode` (Likely column-based logic)
  * **Usage**: The columns `sale1amt` through `sale25amt` in `TEMPSALEREGISTER` likely correspond to the numeric IDs found in `app_duty_code`.