Skip to content

Commit

Permalink
add scope to report
Browse files Browse the repository at this point in the history
  • Loading branch information
dbarzin committed Aug 25, 2023
1 parent ce31ad2 commit 8f3342d
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions app/Http/Controllers/ReportController.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,20 +193,23 @@ private function generateMadeControlTable(TemplateProcessor $templateProcessor,
$table = new Table(['borderSize' => 3, 'borderColor' => 'black', 'width' => 9800, 'unit' => TblWidth::TWIP]);
// create header
$table->addRow();
$table->addCell(2500, ['bgColor' => '#FFD5CA'])
$table->addCell(2000, ['bgColor' => '#FFD5CA'])
->addText('#', ['bold' => true ], ['align' => 'center']);
$table->addCell(12500, ['bgColor' => '#FFD5CA'])
->addText('Nom', ['bold' => true]);
$table->addCell(2800, ['bgColor' => '#FFD5CA'])
->addText('Date', ['bold' => true], ['align' => 'center']);
$table->addCell(12000, ['bgColor' => '#FFD5CA'])
->addText(trans("cruds.control.fields.name"), ['bold' => true]);
$table->addCell(3300, ['bgColor' => '#FFD5CA'])
->addText(trans("cruds.control.fields.realisation_date"), ['bold' => true], ['align' => 'center']);
$table->addCell(3000, ['bgColor' => '#FFD5CA'])
->addText(trans("cruds.control.fields.scope"), ['bold' => true], ['align' => 'center']);
$table->addCell(2000, ['bgColor' => '#FFD5CA'])
->addText('Score', ['bold' => true], ['align' => 'center']);
->addText(trans("cruds.control.fields.score"), ['bold' => true], ['align' => 'center']);

foreach ($controls as $control) {
$table->addRow();
$table->addCell(2500)->addText($control->clause);
$table->addCell(12500)->addText($control->name);
$table->addCell(2800)->addText($control->realisation_date, null, ['align' => 'center']);
$table->addCell(12500)->addText($control->scope);
$table->addCell(2000)->addText(
'',
($control->score === 1 ? ['color' => '#FF0000'] :
Expand Down

0 comments on commit 8f3342d

Please sign in to comment.