35 lines
956 B
PHP
35 lines
956 B
PHP
<?php
|
|
|
|
namespace App\Services\TpCreator\DocumentProcessors;
|
|
|
|
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
|
|
|
|
class NdtClearanceTpProcessor extends AbstractTpDocumentProcessor
|
|
{
|
|
public function process(
|
|
array $lineData,
|
|
array $document,
|
|
Worksheet $sheet,
|
|
int $currentRow,
|
|
int $rowNo,
|
|
string $fullFolder,
|
|
string $testPackageNo,
|
|
bool $override
|
|
): int {
|
|
$docPath = $document['path'];
|
|
$docTitle = $document['title2'] ?? '';
|
|
|
|
$search = $this->alternativeGlob("storage/documents/{$docPath}/*{$testPackageNo}*.pdf");
|
|
|
|
$document['title2'] = str_replace("004_QA/", "", $docTitle);
|
|
$date = date('Y-m-d'); // Default to current date or welding date if available
|
|
|
|
$this->addRow($search, $document, $fullFolder, $testPackageNo, $date, $rowNo, $sheet, $currentRow, $override);
|
|
|
|
return $rowNo + 1;
|
|
}
|
|
}
|
|
|
|
|
|
|