# Project Blueprint - Changan Inventario

## Overview
This is a full-stack web application built with Laravel designed for managing inventory for Changan. It leverages Laravel's MVC architecture, Eloquent ORM, and Filament for the administrative interface.

## Project Details
- **Framework:** Laravel 11.x
- **Database:** MySQL / SQLite (based on .env)
- **Frontend:** Blade, Tailwind CSS, Vite
- **Admin Panel:** Filament
- **Key Models:**
    - `PakingList`: Manages packing lists for shipments.
    - `Tube`: Represents tube-related data associated with a packing list.
    - `BillOfLading`: Manages shipping documents.
    - `Product`, `Warehouse`, `Category`, `Supplier`, `Client`, `Grupo`, etc.
    - `Grupo`: Represents a category or grouping of related records (e.g., product groups).

## Current Task: Category 14 Product Description Format in Purchase Order PDF & Date Uppercasing

### Objective
1. Format the purchase order PDF's product description for category 14 (IMPRENTA) to display as:
`Newsprint [Brand] [Grammage] gsm width [Width]" ([Width] mm) diameter ([Diameter] mm) core ([Core] mm)`
2. Format the `created_at` column in the purchase orders table to display in uppercase (e.g. `20 MAYO 2026`).

### Plan & Action Steps
1. **Analyze Category 14**: Category 14 corresponds to IMPRENTA. The products are stored with names starting with "PAPEL IMPRENTA" (which translates to Newsprint), followed by the brand name (e.g. IRVING, KAP PAPER, RESOLUTE).
2. **Update Description Formatting**:
   - Add a conditional formatting block in [PurchaseOrderPdfController.php](file:///c:/MyProjet/changan-inventario/app/Http/Controllers/PurchaseOrderPdfController.php) specifically for `category_id == 14`.
   - Format the name to "Newsprint [Brand]" (e.g. `Newsprint Irving`).
   - Format the grammage to `[Grammage] gsm` (e.g. `48.8 gsm`).
   - Convert the measure width to inches and mm (e.g. `width 27" (686 mm)`).
   - Convert diameter from CM to MM (e.g. `diameter (1000 mm)`).
   - Convert core from inches to MM (e.g. `core (76 mm)`).
3. **Format Date Column**:
   - Update `created_at` TextColumn in [PurchaseOrdersTable.php](file:///c:/MyProjet/changan-inventario/app/Filament/Resources/PurchaseOrders/Tables/PurchaseOrdersTable.php) using `formatStateUsing(fn($state) => mb_strtoupper(\Carbon\Carbon::parse($state)->translatedFormat('d M Y')))`.
4. **Verification**: Verify that the purchase order PDFs display correctly and the purchase orders table displays the dates in uppercase with the 'd M Y' format.

