All tables
tables · table

cpoduty

The cpoduty table stores the breakdown of duties, taxes, and additional charges associated with specific Purchase Orders (PO). It acts as a child table to both the Purchase Order Header (cpohdr) and is often linked to specific line items via the serial number (sno). This table is critical for calculating the total landing cost of items by itemizing various tax components (like GST, Excise, or Freight) applied to a PO.

Row count
2,078
Last entry
Source
tables

Columns

7
ColumnTypeNullableMeaning
compcodestringNoUnique identifier for the company/branch.
ponointegerNoPurchase Order Number.
duty_codeintegerNoCode representing the specific tax or duty type.
amountnumberYesCalculated monetary value of the duty/tax.
snointegerYesSerial number used to sequence duties or link to specific PO lines.
duty_pernumberYesThe percentage rate applied for the specific duty code.
indexintegerNoInternal system row identifier.

Full documentation

### 1) Overview
 The `cpoduty` table stores the breakdown of duties, taxes, and additional charges associated with specific Purchase Orders (PO). It acts as a child table to both the Purchase Order Header (`cpohdr`) and is often linked to specific line items via the serial number (`sno`). This table is critical for calculating the total landing cost of items by itemizing various tax components (like GST, Excise, or Freight) applied to a PO.
 
 ### 2) Column Dictionary
 
 | Column | Type | Nullable | Meaning | Allowed Values | SQL Usage |
 | :--- | :--- | :--- | :--- | :--- | :--- |
 | **compcode** | string | No | Unique identifier for the company/branch. | e.g., "DAS" | Primary Join Key |
 | **pono** | integer | No | Purchase Order Number. | e.g., 115, 2586 | Foreign Key to `cpohdr` |
 | **duty_code** | integer | No | Code representing the specific tax or duty type. | e.g., 8 (GST), 51, 52 | Foreign Key to `cdutymas` |
 | **amount** | number | Yes | Calculated monetary value of the duty/tax. | e.g., 1528.00 | Aggregate Calculation |
 | **sno** | integer | Yes | Serial number used to sequence duties or link to specific PO lines. | e.g., 2, 3, 4 | Join to `cpodtl.sno` |
 | **duty_per** | number | Yes | The percentage rate applied for the specific duty code. | e.g., 10.0, 5.25 | Calculation Input |
 | **index** | integer | No | Internal system row identifier. | | Primary Key |
 
 ### 3) Relationships & Join Map
 
 The `cpoduty` table is a central component of the Purchase Order tax submodule and connects to the following physical tables based on the `SCHEMA_MAP`:
 
 #### Primary Joins
 * **dbo.cpohdr (Header):** Joins on `pono` and `compcode` to retrieve general PO details (Supplier code, PO date).
 * **dbo.cpodtl (Details):** Joins on `pono`, `compcode`, and `sno` to link a specific tax line to a specific item within the PO.
 * **dbo.cdutymas (Master):** Joins on `duty_code` and `compcode` to fetch the descriptive name of the tax (e.g., "IGST", "Freight Charges").
 
 #### Secondary Joins
 * **dbo.appdutymas / dbo.cappdutymas:** Joins on `duty_code` and `compcode` (Likely used for tax applicability logic).
 * **dbo.cpoduty (Self):** Multiple records exist per `pono` (one for each tax component).
 
 ---