From 5b398ab0226369fbb96dabf82ad67fc670a1cef7 Mon Sep 17 00:00:00 2001 From: Risaldhar <122232237+Risaldhar@users.noreply.github.com> Date: Fri, 5 Dec 2025 21:15:45 +0300 Subject: [PATCH] Add SQR and MRF register templates --- Templates/MRF_header_register_template.csv | 3 + Templates/MRF_line_items_template.csv | 4 + Templates/README.md | 17 + Templates/SQR_register_template.csv | 3 + Templates/generate_register_templates.py | 385 +++++++++++++++++++++ 5 files changed, 412 insertions(+) create mode 100644 Templates/MRF_header_register_template.csv create mode 100644 Templates/MRF_line_items_template.csv create mode 100644 Templates/README.md create mode 100644 Templates/SQR_register_template.csv create mode 100644 Templates/generate_register_templates.py diff --git a/Templates/MRF_header_register_template.csv b/Templates/MRF_header_register_template.csv new file mode 100644 index 00000000..0b9f2fec --- /dev/null +++ b/Templates/MRF_header_register_template.csv @@ -0,0 +1,3 @@ +MRF_ID,Project,Discipline,Package_Area,Requisition_Title,Material_or_Service,Priority,Requisitioner_Name,Requisitioner_Dept,Required_On_Site_Date,Required_RFQ_Issue_Date,Delivery_Location,Incoterms,Budget_Cost_Center,Estimated_Value_USD,Funding_Approval_Ref,QAQC_Class,ITP_Required,QVD_List,HSE_Requirements,Hazmat,Packaging_Preservation,Origin_Preference,Client_Approval_Required,Potential_Vendors,Technical_Approver,QA_Approver,Finance_Approver,Status,Created_Date,Approved_Date,Attach_Scope_URL,Attach_BoM_URL,Attach_Drawings_URL,Attach_Spec_URL,Attach_ITP_URL,Remarks +MRF-2025-07501,Project-X,Mechanical,Unit-7700,Lifesaving Equipment for Jetty,Material,LongLead,Mohammed Salman,Operations,2026-04-04,2025-12-15,Ras Laffan Warehouse,DAP,CC-450-OPS,150000,CAPEX-REQ-0021,Class A,Yes,"COC,COI,Calibration Certificates",MSDS required,No,"Sealed, anti-corrosion film",Any/Approved,No,VEND-000123;VEND-000789,H. Patel,R. Khan,L. George,Reviewed,2025-12-05,,,,,,,Long lead; expedite RFQ +MRF-2025-07502,Project-X,Civil,Unit-7501,Structural Steel for Pipe Rack,Material,Normal,A. Navas,Engineering,2026-03-05,2025-12-12,Site Laydown Area,DAP,CC-330-ENG,280000,OPEX-ENG-114,Class B,Yes,"MTC,Dimensional Report,Welding Log",Permit to Work,No,"Wrapped, tagged",Local Preferred,Yes,VEND-000456;VEND-000654,M. Joseph,K. Varma,S. Thomas,Draft,2025-12-05,,,,,,,Await client drawing Rev C before RFQ diff --git a/Templates/MRF_line_items_template.csv b/Templates/MRF_line_items_template.csv new file mode 100644 index 00000000..a2d090fb --- /dev/null +++ b/Templates/MRF_line_items_template.csv @@ -0,0 +1,4 @@ +MRF_ID,Line_No,Item_Code,Description,Qty,UOM,Spec_Code,Drawing_No,Data_Sheet_No,Inspection_Class,QVD_Required,QA_Notes +MRF-2025-07501,1,LS-001,"SOLAS-approved Lifebuoy Ring, orange",50,EA,SOLAS 74/96,GEN-DRW-001,DS-LS-001,A,Yes,Include conformity mark & UV test report +MRF-2025-07502,1,STL-PR-HEB300,"HEB300 Beam, S275JR",120,M,EN 10025-2,PR-DRW-114,DS-STL-HEB300,B,Yes,Mill test certificate 3.1 required +MRF-2025-07502,2,STL-PL-12,Plate 12mm S275JR,40,MT,EN 10025-2,PR-DRW-115,DS-STL-PL-12,B,Yes,Ultrasonic test as per EN10160 S1/E1 diff --git a/Templates/README.md b/Templates/README.md new file mode 100644 index 00000000..05e84f1b --- /dev/null +++ b/Templates/README.md @@ -0,0 +1,17 @@ +# Register Templates + +Starter CSV templates for Supplier Qualification Register (SQR) and Material Requisition Form (MRF) tracking. + +## Files +- `SQR_register_template.csv` — sample supplier qualification entries with certification, HSE, and financial checkpoints. +- `MRF_header_register_template.csv` — example requisition headers covering scope, approvals, and logistics data. +- `MRF_line_items_template.csv` — representative line items linked to the header records. + +## Regenerating the templates +Run the helper script to refresh the CSVs with dates relative to today: + +```bash +python Templates/generate_register_templates.py +``` + +If `pandas` is available it will be used to build the CSVs; otherwise Python's built-in `csv` module is used. diff --git a/Templates/SQR_register_template.csv b/Templates/SQR_register_template.csv new file mode 100644 index 00000000..15cd6fb6 --- /dev/null +++ b/Templates/SQR_register_template.csv @@ -0,0 +1,3 @@ +SQR_ID,Vendor_ID,Supplier_Legal_Name,Trade_Name,Country,Registration_No,Tax_VAT_No,Address,Website,Primary_Contact_Name,Primary_Contact_Email,Primary_Contact_Phone,Supply_Categories,Product_Service_Keywords,ISO9001,ISO9001_Expiry,ISO14001,ISO14001_Expiry,ISO45001,ISO45001_Expiry,Other_Certifications,HSE_TRIR,HSE_LTI_Last12mo,Annual_Turnover_USD,Financial_Statements_Years,Bank_Letter,References_Count,Sanctions_Screening,PEP_Screening,Risk_Rating,Prequal_Tech,Prequal_HSE,Prequal_Finance,Final_Status,Approval_Date,Review_Due_Date,Attach_Profile_URL,Attach_QA_Manual_URL,Attach_HSE_Policy_URL,Attach_ISO9001_Cert_URL,Attach_References_File_URL,Attach_Financials_URL,Notes +SQR-2025-0001,VEND-000123,Solas Marine Services WLL,Solas Marine,QA,CR12345,QA-1234567,"Doha, Qatar",https://example.com,Ahmed Ali,ahmed.ali@example.com,+974 5555 1234,"Lifesaving equipment,Marine","lifebuoy, lifejacket, SOLAS",Yes,2026-12-05,No,,Yes,2026-12-05,API Q1,0.35,0,"3,200,000","2023,2024",Yes,5,Clear,No,Low,Pass,Pass,Pass,Approved,2025-12-05,2027-11-25,,,,,,,Approved for marine safety supplies +SQR-2025-0002,VEND-000456,Elegancia Steel WLL,Elegancia,QA,CR67890,QA-7654321,"Doha, Qatar",https://example.org,Sara John,sara.john@example.org,+974 6666 9876,"Fabrication,Structural Steel","beams, columns, welding",Yes,2026-12-05,Yes,2026-12-05,Yes,2026-12-05,EN1090,0.18,0,"12,500,000","2022,2023,2024",Yes,8,Clear,No,Medium,Pass,Pass,Pass,Approved,2025-12-05,2027-11-25,,,,,,,Approved for structural steel fabrication diff --git a/Templates/generate_register_templates.py b/Templates/generate_register_templates.py new file mode 100644 index 00000000..ba50e66f --- /dev/null +++ b/Templates/generate_register_templates.py @@ -0,0 +1,385 @@ +""" +Generate starter CSV templates for Supplier Qualification (SQR) and Material Requisition Form (MRF) registers. + +The templates are populated with realistic sample data so stakeholders can see the +expected structure, while keeping values generic enough for reuse. +""" +from __future__ import annotations + +import csv +from datetime import date, timedelta +from pathlib import Path +from typing import Iterable, List, Sequence + +try: + import pandas as pd # type: ignore +except ImportError: # pragma: no cover - fallback uses csv module + pd = None + + +def _write_csv(columns: Sequence[str], rows: Iterable[Sequence[object]], path: Path) -> None: + path.parent.mkdir(parents=True, exist_ok=True) + + if pd is not None: + df = pd.DataFrame(rows, columns=columns) + df.to_csv(path, index=False) + return + + with path.open("w", newline="", encoding="utf-8") as handle: + writer = csv.writer(handle) + writer.writerow(columns) + writer.writerows(rows) + + +def create_register_templates(output_dir: Path | str = Path("Templates")) -> List[Path]: + """Create CSV templates for SQR, MRF header, and MRF line items. + + Args: + output_dir: Directory where the CSV files will be written. Defaults to "Templates". + + Returns: + List of paths to the generated CSV files. + """ + output_dir = Path(output_dir) + + sqr_columns = [ + "SQR_ID", + "Vendor_ID", + "Supplier_Legal_Name", + "Trade_Name", + "Country", + "Registration_No", + "Tax_VAT_No", + "Address", + "Website", + "Primary_Contact_Name", + "Primary_Contact_Email", + "Primary_Contact_Phone", + "Supply_Categories", + "Product_Service_Keywords", + "ISO9001", + "ISO9001_Expiry", + "ISO14001", + "ISO14001_Expiry", + "ISO45001", + "ISO45001_Expiry", + "Other_Certifications", + "HSE_TRIR", + "HSE_LTI_Last12mo", + "Annual_Turnover_USD", + "Financial_Statements_Years", + "Bank_Letter", + "References_Count", + "Sanctions_Screening", + "PEP_Screening", + "Risk_Rating", + "Prequal_Tech", + "Prequal_HSE", + "Prequal_Finance", + "Final_Status", + "Approval_Date", + "Review_Due_Date", + "Attach_Profile_URL", + "Attach_QA_Manual_URL", + "Attach_HSE_Policy_URL", + "Attach_ISO9001_Cert_URL", + "Attach_References_File_URL", + "Attach_Financials_URL", + "Notes", + ] + + today = date.today() + in_1_year = today + timedelta(days=365) + review_due = today + timedelta(days=720) + + sqr_sample = [ + [ + "SQR-2025-0001", + "VEND-000123", + "Solas Marine Services WLL", + "Solas Marine", + "QA", + "CR12345", + "QA-1234567", + "Doha, Qatar", + "https://example.com", + "Ahmed Ali", + "ahmed.ali@example.com", + "+974 5555 1234", + "Lifesaving equipment,Marine", + "lifebuoy, lifejacket, SOLAS", + "Yes", + in_1_year.isoformat(), + "No", + "", + "Yes", + in_1_year.isoformat(), + "API Q1", + "0.35", + "0", + "3,200,000", + "2023,2024", + "Yes", + 5, + "Clear", + "No", + "Low", + "Pass", + "Pass", + "Pass", + "Approved", + today.isoformat(), + review_due.isoformat(), + "", + "", + "", + "", + "", + "", + "Approved for marine safety supplies", + ], + [ + "SQR-2025-0002", + "VEND-000456", + "Elegancia Steel WLL", + "Elegancia", + "QA", + "CR67890", + "QA-7654321", + "Doha, Qatar", + "https://example.org", + "Sara John", + "sara.john@example.org", + "+974 6666 9876", + "Fabrication,Structural Steel", + "beams, columns, welding", + "Yes", + in_1_year.isoformat(), + "Yes", + in_1_year.isoformat(), + "Yes", + in_1_year.isoformat(), + "EN1090", + "0.18", + "0", + "12,500,000", + "2022,2023,2024", + "Yes", + 8, + "Clear", + "No", + "Medium", + "Pass", + "Pass", + "Pass", + "Approved", + today.isoformat(), + review_due.isoformat(), + "", + "", + "", + "", + "", + "", + "Approved for structural steel fabrication", + ], + ] + + mrf_header_columns = [ + "MRF_ID", + "Project", + "Discipline", + "Package_Area", + "Requisition_Title", + "Material_or_Service", + "Priority", + "Requisitioner_Name", + "Requisitioner_Dept", + "Required_On_Site_Date", + "Required_RFQ_Issue_Date", + "Delivery_Location", + "Incoterms", + "Budget_Cost_Center", + "Estimated_Value_USD", + "Funding_Approval_Ref", + "QAQC_Class", + "ITP_Required", + "QVD_List", + "HSE_Requirements", + "Hazmat", + "Packaging_Preservation", + "Origin_Preference", + "Client_Approval_Required", + "Potential_Vendors", + "Technical_Approver", + "QA_Approver", + "Finance_Approver", + "Status", + "Created_Date", + "Approved_Date", + "Attach_Scope_URL", + "Attach_BoM_URL", + "Attach_Drawings_URL", + "Attach_Spec_URL", + "Attach_ITP_URL", + "Remarks", + ] + + mrf_header_sample = [ + [ + "MRF-2025-07501", + "Project-X", + "Mechanical", + "Unit-7700", + "Lifesaving Equipment for Jetty", + "Material", + "LongLead", + "Mohammed Salman", + "Operations", + (today + timedelta(days=120)).isoformat(), + (today + timedelta(days=10)).isoformat(), + "Ras Laffan Warehouse", + "DAP", + "CC-450-OPS", + "150000", + "CAPEX-REQ-0021", + "Class A", + "Yes", + "COC,COI,Calibration Certificates", + "MSDS required", + "No", + "Sealed, anti-corrosion film", + "Any/Approved", + "No", + "VEND-000123;VEND-000789", + "H. Patel", + "R. Khan", + "L. George", + "Reviewed", + today.isoformat(), + "", + "", + "", + "", + "", + "", + "Long lead; expedite RFQ", + ], + [ + "MRF-2025-07502", + "Project-X", + "Civil", + "Unit-7501", + "Structural Steel for Pipe Rack", + "Material", + "Normal", + "A. Navas", + "Engineering", + (today + timedelta(days=90)).isoformat(), + (today + timedelta(days=7)).isoformat(), + "Site Laydown Area", + "DAP", + "CC-330-ENG", + "280000", + "OPEX-ENG-114", + "Class B", + "Yes", + "MTC,Dimensional Report,Welding Log", + "Permit to Work", + "No", + "Wrapped, tagged", + "Local Preferred", + "Yes", + "VEND-000456;VEND-000654", + "M. Joseph", + "K. Varma", + "S. Thomas", + "Draft", + today.isoformat(), + "", + "", + "", + "", + "", + "", + "Await client drawing Rev C before RFQ", + ], + ] + + mrf_line_columns = [ + "MRF_ID", + "Line_No", + "Item_Code", + "Description", + "Qty", + "UOM", + "Spec_Code", + "Drawing_No", + "Data_Sheet_No", + "Inspection_Class", + "QVD_Required", + "QA_Notes", + ] + + mrf_line_sample = [ + [ + "MRF-2025-07501", + 1, + "LS-001", + "SOLAS-approved Lifebuoy Ring, orange", + 50, + "EA", + "SOLAS 74/96", + "GEN-DRW-001", + "DS-LS-001", + "A", + "Yes", + "Include conformity mark & UV test report", + ], + [ + "MRF-2025-07502", + 1, + "STL-PR-HEB300", + "HEB300 Beam, S275JR", + 120, + "M", + "EN 10025-2", + "PR-DRW-114", + "DS-STL-HEB300", + "B", + "Yes", + "Mill test certificate 3.1 required", + ], + [ + "MRF-2025-07502", + 2, + "STL-PL-12", + "Plate 12mm S275JR", + 40, + "MT", + "EN 10025-2", + "PR-DRW-115", + "DS-STL-PL-12", + "B", + "Yes", + "Ultrasonic test as per EN10160 S1/E1", + ], + ] + + paths = [ + output_dir / "SQR_register_template.csv", + output_dir / "MRF_header_register_template.csv", + output_dir / "MRF_line_items_template.csv", + ] + + _write_csv(sqr_columns, sqr_sample, paths[0]) + _write_csv(mrf_header_columns, mrf_header_sample, paths[1]) + _write_csv(mrf_line_columns, mrf_line_sample, paths[2]) + + return paths + + +if __name__ == "__main__": + written_paths = create_register_templates() + for path in written_paths: + print(path)