> ## Documentation Index
> Fetch the complete documentation index at: https://docs.spn.wtf/llms.txt
> Use this file to discover all available pages before exploring further.

# User Guide

> Step-by-step guide to processing GST files

The application follows a **6-step workflow**. Follow each step in order.

***

## Step 1: Select Company

Choose the company from the dropdown menu.

This dynamically updates the required file uploads based on that company's SOP configuration.

***

## Step 2: Location & Trade Type

<ParamField path="Location" type="string" required>
  Enter the location name (e.g. `Mumbai`, `Delhi`). This string is applied uniformly to all rows in the output.
</ParamField>

<ParamField path="Trade Type" type="enum">
  Required for certain companies (e.g. Godrej, Sunpure). Options:

  * `GT` — General Trade
  * `MT` — Modern Trade
  * `None`

  This affects the logic used to generate or parse document numbers during processing.
</ParamField>

***

## Step 3: Month / Year Filter

Select the **Month** and **Year** to filter records.

**Filter Rule:** The app includes all records from January 1 of the selected year up to the last day of the selected month.

<Example>
  Selecting **July 2024** captures invoices from **Jan 1, 2024 → Jul 31, 2024**.
  Records from August 2024 or any prior year are automatically excluded.
</Example>

***

## Step 4: Upload Input Files

Accepted formats: `.xlsx`, `.xls`, `.csv`

| File                | Description                                                                   |
| ------------------- | ----------------------------------------------------------------------------- |
| **Bill Details**    | Core transactional data (required)                                            |
| **B2B Master**      | Party metadata — used to fetch GSTIN from Party Code                          |
| **Material Master** | Item metadata — used to fetch HSN Code and HSN Description from Material Code |

<Warning>
  Uploaded files must contain all columns defined by the company's SOP. A missing or misspelled column header will trigger a validation error listing the missing columns.
</Warning>

***

## Step 5: Process & Preview

Click **Process Files**. The app will:

1. Validate all inputs against the SOP
2. Apply the month/year date filter
3. Look up **GSTIN** for each party — parties not found are tagged `UNREGISTERED` (treated as B2C)
4. Map **HSN Codes** to products from the Material Master
5. Display a summary — Total Tax, B2B vs B2C row counts, Unique States, and any missing data warnings

Review the preview before downloading.

***

## Step 6: Download Output

Click **Download** to export the fully standardized `.xlsx` file.

If multiple document types are present (e.g. Tax Invoices and Credit Notes), the app provides **separate download buttons** for each split file.

***

## Processing Modes

| Mode                    | Description                                                                                                             |
| ----------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| **Single Processing**   | Processes one company's inputs for a specific location                                                                  |
| **State Consolidation** | Merges multiple locations/companies for a state into one sheet, with Document Summaries (e.g. cancelled invoice counts) |
