Task #19768
Updated by Redmine Admin 4 months ago
**As an** operations/logistics user
**I want** to generate a PDF document that displays both Import and Export details for HBLs
**So that** I can clearly track HBL movements across import and export files in a single, standardized report.
***
## Description
The system shall generate a **PDF report** listing HBL-related shipment records with **both Import and Export references** where applicable.
The displayed data must dynamically adjust based on whether the HBL is associated with **Import, Export, or both**, and whether the HBL has been marked as **Landing or Shipping** in Import.
***
## PDF Columns / Data Fields
The PDF report shall display the following columns:
1. **Import File Reference**
2. **Import Sub File Reference**
3. **Export File Reference**
4. **Export Sub File Reference**
5. **HBL Reference**
6. **Weight**
7. **Volume**
8. **Shipper / Consignee**
* Shipper → when data relates to **Import** **Export**
* Consignee → when data relates to **Export** **Import**
9. **Port of Loading / Port of Destination**
* Port of Loading → **Export**
* Port of Destination → **Import**
10. **Vessel Departure / Arrival**
* Vessel Departure → **Export**
* Vessel Arrival → **Import**
11. **Date of Departure / Arrival**
* Date of Departure → **Export**
* Date of Arrival → **Import**
***
## Business Rules
1. **HBL Eligibility**
* Only HBLs that are marked as **Landing** or **Shipping** in an **Import file** shall be included in the report.
2. **Import & Export Reference Mapping**
* If the HBL exists in an **Import file**, populate:
* Import File Reference
* Import Sub File Reference
* If the same HBL is also used in an **Export file**, populate:
* Export File Reference
* Export Sub File Reference
* If the HBL is not linked to Export, Export-related columns must remain blank.
3. **Conditional Party Display**
* Display **Consignee** when showing Import-related data.
* Display **Shipper** when showing Export-related data.
4. **Conditional Port & Vessel Details**
* Import:
* Port of Destination
* Vessel Arrival
* Date of Arrival
* Export:
* Port of Loading
* Vessel Departure
* Date of Departure
5. **Data Source Rules**
* Weight and Volume must be retrieved from the **HBL master record**.
* File References and Sub File References must reflect the files where the HBL is linked.
6. **Single Line per HBL**
* Each HBL must appear as a **single row** in the PDF, showing both Import and Export references side by side when applicable.
***
## Acceptance Criteria
### ✅ Scenario 1: PDF Generation
* Given valid HBL records exist
* When the user generates the PDF
* Then a downloadable PDF is created with all defined columns.
### ✅ Scenario 2: Import-only HBL
* Given an HBL exists in Import but not in Export
* Then Import File and Sub File References are populated
* And Export File and Sub File References remain empty.
### ✅ Scenario 3: Import + Export HBL
* Given an HBL marked as Landing or Shipping in Import and also linked to an Export file
* Then both Import and Export File & Sub File References are shown in the PDF.
### ✅ Scenario 4: Conditional Data Display
* Import fields display Consignee, Port of Destination, Vessel Arrival, and Date of Arrival.
* Export fields display Shipper, Port of Loading, Vessel Departure, and Date of Departure.
### ✅ Scenario 5: PDF Format & Usability
* The PDF must be properly formatted, readable, print-friendly, and suitable for audit and sharing purposes.