data['lang']; /** @noinspection PhpIncludeInspection */ $reportLanguage = include $basepath . '/' . \ltrim($tcoll['lang']->getPath(), '/'); $lang = $reportLanguage[$cLang]; $amount = $this->request->getDataFloat('amount') ?? 10000.0; $duration = $this->request->getDataInt('duration') ?? 10; $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); $pdf->SetCreator('Dennis Eichhorn'); $pdf->SetAuthor('Dennis Eichhorn'); $pdf->SetTitle('Demo Mailing'); $pdf->SetSubject('Mailing'); $pdf->SetKeywords('demo helper mailing'); $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); $pdf->SetMargins(PDF_MARGIN_LEFT, 15, PDF_MARGIN_RIGHT); $pdf->SetAutoPageBreak(false, 0); $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); $pdf->setPrintHeader(false); $pdf->setPrintFooter(false); $pdf->AddPage(); $pdf->SetFillColor(52, 58, 64); $pdf->Rect(0, 0, $pdf->getPageWidth(), $pdf->getPageHeight(), 'F'); $pdf->SetFillColor(54, 151, 219); $pdf->Rect(0, 0, $pdf->getPageWidth(), 5, 'F'); $pdf->SetFont('helvetica', '', 32); $pdf->SetTextColor(54, 151, 219); $pdf->Write(0, 'Demo Mailing - ' . $this->request->getDataString('date') ?? 'Y-m-d', '', 0, 'C', true, 0, false, false, 0); $pdf->Image(__DIR__ . '/logo.png', $pdf->getPageWidth() / 2 - 60 / 2, 40, 60, 60, 'PNG', '', 'C', true, 300, '', false, false, 0, false, false, false); $pdf->SetFillColor(67, 74, 81); $pdf->Rect(0, 110, $pdf->getPageWidth(), 145, 'F'); $html = '
| ' . $lang['Period'] . ' | ' . $lang['StraightLine'] . ' | ' . $lang['ArithmeticDegressive'] . ' | ' . $lang['ArithmeticProgressive'] . ' | ' . $lang['GeometricDegressive'] . ' | ' . $lang['GeometricProgressive'] . ' |
|---|---|---|---|---|---|
| ' . $i . ' | '; $thml .= '' . $this->getCurrency(Depreciation::getStraightLineResidualInT($amount, $duration, $i), 'medium', '') . ' | '; $thml .= '' . $this->getCurrency(Depreciation::getArithmeticDegressiveDepreciationResidualInT($amount, 0.0, $duration, $i), 'medium', '') . ' | '; $thml .= '' . $this->getCurrency(Depreciation::getArithmeticProgressiveDepreciationResidualInT($amount, 0.0, $duration, $i), 'medium', '') . ' | '; $thml .= '' . $this->getCurrency(Depreciation::getGeometicProgressiveDepreciationResidualInT($amount, $amount * 0.1, $duration, $i), 'medium', '') . ' | '; $thml .= '' . $this->getCurrency(Depreciation::getGeometicDegressiveDepreciationResidualInT($amount, $amount * 0.1, $duration, $i), 'medium', '') . ' | '; $thml .= '