All tables
tables · table

Debithdr

The Debithdr table serves as the primary header for Debit and Credit Notes within the ERP system. It records high-level transactional data for financial adjustments, specifically handling material rejections, rate differences, and tax reversals.

Row count
117
Last entry
2026-01-09
Source
tables

Columns

27
ColumnTypeNullableMeaning
indexintegerNoUnique row index
compcodestringNoCompany code identifier
NotetypeintegerYesCategory of the note
NotenointegerNoUnique Note Number
NoteyearintegerNoFiscal Year of the Note
Note_FlagstringNoDirection of Adjustment
NotedatedatetimeYesDate the note was issued
custcodestringYesCode of the Customer or Supplier
basic_amtnumberYesTotal basic value before taxes
inv_amtnumberYesTotal Net amount (including taxes)
TaxableAmtnumberYesValue on which tax is calculated
CGST_AmtnumberYesCentral GST amount
SGST_AmtnumberYesState GST amount
IGST_AmtnumberYesIntegrated GST amount
supFlagstringYesParty category identifier
Bill_NonumberYesOriginal Invoice reference number
mrpnostringYesMaterial Receipt Note reference
ponostringYesOriginal Purchase Order number
ReasonsstringYesExplanation for the adjustment
vounostringYesInternal Voucher Number
cancel_flagstringYesStatus of the document
IRNstringYesE-Invoice Reference Number
docstringYesDocument display identifier
PartyNamestringYesName of the primary party
gststringYesGST Registration number of party
statecodestringYesGST State code
is_cancelstringYesBinary cancellation status

Full documentation

### 1. Overview
 The `Debithdr` table serves as the primary header for **Debit and Credit Notes** within the ERP system. It records high-level transactional data for financial adjustments, specifically handling material rejections, rate differences, and tax reversals. 
 
 Key functional roles:
 * **Note Categorization:** Differentiates between Debit ('D') and Credit ('C') notes using `Note_Flag`.
 * **Party Management:** Tracks adjustments against Customers, Suppliers, or Vendors via the `supFlag` field.
 * **Audit & Compliance:** Stores GST details, IRN (Invoice Reference Number) for e-invoicing, and E-Way Bill information.
 * **Traceability:** Links notes to original documents such as Invoices (`Bill_No`), Purchase Orders (`pono`), and Material Receipt Notes (`mrpno`).
 
 ### 2. Column Dictionary
 | Column | Type | Nullable | Meaning | Allowed Values | SQL Usage |
 | :--- | :--- | :--- | :--- | :--- | :--- |
 | **index** | integer | No | Unique row index | | Primary Key |
 | **compcode** | string | No | Company code identifier | e.g., "DAS" | Join Key |
 | **Notetype** | integer | Yes | Category of the note | 0 (Standard) | Filter/Join |
 | **Noteno** | integer | No | Unique Note Number | | Unique Identifier |
 | **Noteyear** | integer | No | Fiscal Year of the Note | e.g., 2022, 2023 | Join Key |
 | **Note_Flag** | string | No | Direction of Adjustment | 'D' (Debit), 'C' (Credit) | Filter/Join Key |
 | **Notedate** | datetime | Yes | Date the note was issued | | Date filtering |
 | **custcode** | string | Yes | Code of the Customer or Supplier | | Join to `cust` or `suppmas` |
 | **basic_amt** | number | Yes | Total basic value before taxes | | Financial reporting |
 | **inv_amt** | number | Yes | Total Net amount (including taxes) | | Payment tracking |
 | **TaxableAmt** | number | Yes | Value on which tax is calculated | | Tax Audit |
 | **CGST_Amt** | number | Yes | Central GST amount | | Tax Audit |
 | **SGST_Amt** | number | Yes | State GST amount | | Tax Audit |
 | **IGST_Amt** | number | Yes | Integrated GST amount | | Tax Audit |
 | **supFlag** | string | Yes | Party category identifier | 'C' (Customer), 'S' (Supplier), 'V' (Vendor) | Logic branching |
 | **Bill_No** | number | Yes | Original Invoice reference number | | Document linking |
 | **mrpno** | string | Yes | Material Receipt Note reference | | Join to `rmincoming` |
 | **pono** | string | Yes | Original Purchase Order number | | Join to `pohdr` |
 | **Reasons** | string | Yes | Explanation for the adjustment | "Rejection of Qty", "Rate Difference" | Reporting |
 | **vouno** | string | Yes | Internal Voucher Number | | Accounting Join |
 | **cancel_flag** | string | Yes | Status of the document | 'N' (Active), 'Y' (Cancelled) | Filter (WHERE <> 'Y') |
 | **IRN** | string | Yes | E-Invoice Reference Number | | Compliance |
 | **doc** | string | Yes | Document display identifier | | Internal Reference |
 | **PartyName** | string | Yes | Name of the primary party | | UI Display |
 | **gst** | string | Yes | GST Registration number of party | | Tax Audit |
 | **statecode** | string | Yes | GST State code | e.g., "06" (Haryana) | Join to `Statemas` |
 | **is_cancel** | string | Yes | Binary cancellation status | '0', '1' | Filtering |
 
 ### 3. Relationships & Join Map
 
 #### Joins Table
 | Target Table | Join Columns | Relationship |
 | :--- | :--- | :--- |
 | **`dbo.Debitdtl`** | `compcode`, `Noteno`, `Noteyear`, `Note_Flag` | **One-to-Many:** `Debithdr` contains the summary, `Debitdtl` contains individual item-level adjustments. |
 | **`dbo.cust`** | `compcode`, `custcode` | **Many-to-One:** Links note to Customer master when `supFlag` = 'C'. |
 | **`dbo.suppmas`** | `compcode`, `custcode` (as `supcode`) | **Many-to-One:** Links note to Supplier master when `supFlag` = 'S'. |
 | **`dbo.vendmas`** | `compcode`, `custcode` (as `vendcode`) | **Many-to-One:** Links note to Vendor master when `supFlag` = 'V'. |
 | **`dbo.company`** | `compcode` | **Many-to-One:** Retrieves company-specific profile/GST details. |
 | **`dbo.Statemas`** | `statecode` | **Many-to-One:** Resolves state codes to names. |
 
 #### Join Logic Summary
 1. **Header to Detail:** To view items rejected in a Debit Note, join `Debithdr` to `Debitdtl` on `Noteno`, `Noteyear`, `Note_Flag`, and `compcode`.
 2. **Party Identification:** Since `custcode` is used generically, use `supFlag` to determine if you should join to the Customer master (`cust`) or Supplier master (`suppmas`).
 3. **Inventory Impact:** For material rejections, `Debithdr` records are often joined to `rmincoming` using the `mrpno` to calculate net accepted stock.