All tables
tables · table

appdutymas

The appdutymas (Applicable Duty Master) table serves as a mapping or configuration table that defines the relationship between primary duty codes (duty_code) and their associated applicable sub-duty or component codes (app_duty_code). This structure is typically used in ERP systems to bundle multiple tax components, charges, or approval duties under a single parent duty category.

Row count
56
Last entry
Source
tables

Columns

4
ColumnTypeNullableMeaning
indexintegerNoInternal row identifier
compcodestringNoUnique identifier for the company/organization unit
duty_codeintegerNoThe primary duty or tax group identifier
app_duty_codeintegerNoThe specific duty code applied or associated with the parent `duty_code`

Full documentation

### 1) Overview
 The `appdutymas` (Applicable Duty Master) table serves as a mapping or configuration table that defines the relationship between primary duty codes (`duty_code`) and their associated applicable sub-duty or component codes (`app_duty_code`). This structure is typically used in ERP systems to bundle multiple tax components, charges, or approval duties under a single parent duty category.
 
 ### 2) Column Dictionary
 
 | Column | Type | Nullable | Meaning | Allowed Values | SQL Usage |
 | :--- | :--- | :--- | :--- | :--- | :--- |
 | **index** | integer | No | Internal row identifier | 0, 1, 2, 3... | Primary Key (Internal) |
 | **compcode** | string | No | Unique identifier for the company/organization unit | e.g., "DAS", "PDS" | Join/Filter; `WHERE compcode = 'DAS'` |
 | **duty_code** | integer | No | The primary duty or tax group identifier | e.g., 1, 2, 8, 22 | Join to `dutymas` or `cdutymas` |
 | **app_duty_code** | integer | No | The specific duty code applied or associated with the parent `duty_code` | e.g., 0, 1, 10, 51 | Filter; Join to `dutymas` |
 
 ### 3) Relationships & Join Map
 
 The table acts as a bridge between high-level duty groups and specific duty components.
 
 #### Primary Joins (Authoritative):
 * **dbo.dutymas / dbo.cdutymas**: Joins on `(compcode, duty_code)` to retrieve the descriptive names and tax rates for the primary duty.
 * **dbo.saleappdutymas / dbo.cappdutymas**: These tables share an identical schema and likely represent functional clones for different modules (Sales vs. General/Purchase). They can be joined on `(compcode, duty_code, app_duty_code)`.
 
 #### Likely Indirect Joins (Usage Context):
 * **dbo.poduty / dbo.invtax**: The `duty_code` in this table explains how codes are grouped in transaction tables like Purchase Order duties or Invoice taxes.
 * **dbo.custtax / dbo.suptax**: Joins on `(compcode, duty_code)` to determine which duty components are applicable to specific customers or suppliers.
 
 #### Join Example:
 ```sql
 SELECT 
  A.compcode,
  A.duty_code,
  M1.duty_name AS ParentDuty,
  A.app_duty_code,
  M2.duty_name AS AppliedComponent
 FROM dbo.appdutymas A
 JOIN dbo.dutymas M1 ON A.compcode = M1.compcode AND A.duty_code = M1.duty_code
 JOIN dbo.dutymas M2 ON A.compcode = M2.compcode AND A.app_duty_code = M2.duty_code;
 ```