Skip to main content
MediPro builds a complete cut list for each window based on its dimensions and panel layout. Each line in the cut list identifies a profile code, a cut length, and a quantity. Profile names are resolved at render time from an Excel catalog file.

Profile catalog (datos.xlsx)

Profile names are stored in an Excel file located at public/datos.xlsx. The file is loaded on component mount via procesarPerfiles():
public function procesarPerfiles(): void
{
    $ruta = public_path('datos.xlsx');
    if (!file_exists($ruta)) {
        return;
    }

    $this->data = collect(Excel::toArray([], $ruta)[0])
        ->pluck(0)      // first column of the first sheet
        ->filter()
        ->values()
        ->toArray();
}
The loaded array ($this->data) contains one entry per row — each entry is the full product name string as it appears in the spreadsheet, for example "7955 - U 3/4 NEGRO 6MT".
If datos.xlsx is missing from the public/ directory, procesarPerfiles() returns early and $this->data remains empty. In that case, the cut list will display the numeric code only (e.g., COD: 7955) instead of the resolved product name. Place the file at public/datos.xlsx before first use.

Name lookup pattern

At render time each profile entry is matched against the catalog using a substring search:
foreach ($this->data as $nombreCompleto) {
    if (str_contains((string) $nombreCompleto, (string) $codigoBuscado)) {
        $nombreProductoExcel = $nombreCompleto;
        break;
    }
}
The match uses str_contains(), not an exact key lookup. This means a catalog row "7955 - U 3/4 NEGRO 6MT" will match when the code searched is "7955". Catalog rows must include the numeric code as a substring; formatting and description text around it do not matter.

Sistema Nova profile table

The following profiles are calculated for every Sistema Nova window. Lengths are in centimetres.
Profile nameCodeQuantityLength
U 3/479551ancho
T/M52831ancho
RIEL L84131ancho
U F (per unique fixed width)3003count of fixed panels at that widthanchoVidrio (fixed)
H (per unique sliding width)8220count of sliding panels at that widthanchoVidrio (sliding)
PF Fijo8115 - FIJOsee upright calculation belowaltoPuente − 0.3
PF Corrediza8115 - CORREDIZAnumCorredizas × 2altoPuente − 2.0
The three header profiles (U 3/4, T/M, RIEL L) always have quantity 1 and length equal to the raw ancho (not the adjusted value).
$w = $this->trunc($this->ancho);
$det['U 3/4'] = ['label' => '7955', 'alto' => $w, 'cantidad' => 1];
$det['T/M']   = ['label' => '5283', 'alto' => $w, 'cantidad' => 1];
$det['RIEL L']= ['label' => '8413', 'alto' => $w, 'cantidad' => 1];

Upright (parante) calculation for PF Fijo

The number of PF Fijo uprights depends on the position of each fixed panel relative to its neighbours.
$pf = 0;
foreach ($this->bloques as $i => $b) {
    if ($b === 'Fijo') {
        $pf += ($this->bloques[$i - 1] ?? null) === 'Corrediza'
            && ($this->bloques[$i + 1] ?? null) === 'Corrediza'
            ? 2   // fixed panel sandwiched between two sliding panels
            : 1;  // fixed panel on an edge or next to another fixed
    }
}
The rule is:
  • A fixed panel flanked by sliding panels on both sides requires 2 uprights (one for each side).
  • A fixed panel on an edge or adjacent to another fixed panel requires 1 upright.
Block arrangementPF Fijo count
F C F (1C + 2F)1 + 1 = 2
F F C (1C + 2F, edge)1 + 1 = 2
F C F C F (2C + 3F)1 + 2 + 1 = 4
F C F C F C (3C + 3F)1 + 2 + 1 = 4
Sliding panels always get two uprights each — one for each vertical side of the frame:
$det['PF Corrediza'] = [
    'label'    => '8115',
    'tipo'     => 'CORREDIZA',
    'alto'     => $this->trunc($this->altoPuente - 2.0),
    'cantidad' => $this->numCorredizas * 2,
];
The 2.0 cm deduction ($pfcorrediza) clears the bottom roller track.

Glass panel grouping

Fixed and sliding glass widths are grouped by their computed width value. If two fixed panels have identical computed widths, they are listed as one row with cantidad = 2 rather than two separate rows:
foreach ($this->medidasBloques as $b) {
    $a = number_format($b['ancho'], 1, '.', '');
    $b['tipo'] === 'F'
        ? ($f[$a] = ($f[$a] ?? 0) + 1)
        : ($c[$a] = ($c[$a] ?? 0) + 1);
}
This grouping means the cut list stays compact even for 5- or 6-division windows.

Build docs developers (and LLMs) love