All tables
tables · table

potax

The potax table is a line-item tax repository used within the Purchase Order (PO) module of the SQL Server database. It stores granular tax and duty percentages applicable to specific Purchase Orders, broken down by duty codes. Each entry links a company, a specific customer, and a purchase order to one or more tax components (e.g., Excise, VAT, GST components).

Row count
5
Last entry
Source
tables

Columns

7
ColumnTypeNullableMeaning
indexintegerNOPrimary key for the record.
compcodestringYESThe unique identifier for the company entity.
ponostringYESThe Purchase Order Number identifying the parent document.
custcodestringYESThe unique identifier for the Customer associated with the PO.
srnointegerYESSerial number representing the sequence of tax components for a PO.
duty_codeintegerYESReference to the specific tax or duty type (e.g., GST, Freight Tax).
taxpercentagenumberYESThe percentage rate applied for the specific duty code.

Full documentation

### 1. Overview
 The `potax` table is a line-item tax repository used within the Purchase Order (PO) module of the SQL Server database. It stores granular tax and duty percentages applicable to specific Purchase Orders, broken down by duty codes. Each entry links a company, a specific customer, and a purchase order to one or more tax components (e.g., Excise, VAT, GST components).
 
 ### 2. Column Dictionary
 
 | Column | Type | Nullable | Meaning | Allowed Values | SQL Usage |
 | :--- | :--- | :--- | :--- | :--- | :--- |
 | **index** | integer | NO | Primary key for the record. | e.g., 0, 1, 2 | Internal identity/reference. |
 | **compcode** | string | YES | The unique identifier for the company entity. | e.g., "DAS" | Join key to `dbo.pohdr`, `dbo.cust`. |
 | **pono** | string | YES | The Purchase Order Number identifying the parent document. | e.g., "M7/RM/2013400036" | Join key to `dbo.pohdr` (as `PONO`), `dbo.podtl`. |
 | **custcode** | string | YES | The unique identifier for the Customer associated with the PO. | e.g., "QHT(K)" | Join key to `dbo.cust`. |
 | **srno** | integer | YES | Serial number representing the sequence of tax components for a PO. | 1, 2, 3... | Ordering and line identification. |
 | **duty_code** | integer | YES | Reference to the specific tax or duty type (e.g., GST, Freight Tax). | e.g., 3, 7, 8 | Join key to `dbo.dutymas`. |
 | **taxpercentage** | number | YES | The percentage rate applied for the specific duty code. | e.g., 100.0, 12.0, 2.0 | Calculation of tax amounts. |
 
 ---
 
 ### 3. Relationships & Join Map
 
 #### Logical Relationships
 - **Parent Document:** Each record belongs to a Purchase Order header.
 - **Tax Definition:** Each record references a specific duty definition in the tax master.
 - **Customer Context:** Records are scoped by customer to allow customer-specific tax configurations.
 
 #### Physical Join Map (SCHEMA_MAP Ground Truth)
 
 | Target Table | Join Columns | Join Type | Purpose |
 | :--- | :--- | :--- | :--- |
 | **dbo.pohdr** | `compcode`, `pono` (matches `PONO`) | One-to-Many | Retrieve header info (dates, terms) for the taxes. |
 | **dbo.podtl** | `compcode`, `pono`, `custcode` | One-to-Many | Link tax rates to specific line items (Likely). |
 | **dbo.dutymas** | `compcode`, `duty_code` | Many-to-One | Retrieve tax names and nature (e.g., "Service Tax"). |
 | **dbo.cust** | `compcode`, `custcode` | Many-to-One | Link tax records to customer master profiles. |
 | **dbo.potaxamnd** | `compcode`, `pono`, `srno` | One-to-One | View history of tax rate amendments for the same PO. |
 | **dbo.exppotax** | `compcode`, `pono`, `custcode`, `srno` | Similar Structure | Parallel table used for Export Purchase Orders. |