From 8a188dd73139a1e2d4b2effcd11ee59c4df64260 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Beganovi=C4=87?= Date: Mon, 23 Aug 2021 14:50:39 +0200 Subject: [PATCH] Scaffold `statement-aging-table` --- app/Services/PdfMaker/Design.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/app/Services/PdfMaker/Design.php b/app/Services/PdfMaker/Design.php index 7fab4d4b089d..2a957f1526e1 100644 --- a/app/Services/PdfMaker/Design.php +++ b/app/Services/PdfMaker/Design.php @@ -136,6 +136,10 @@ class Design extends BaseDesign 'id' => 'statement-payment-table', 'elements' => $this->statementPaymentTable(), ], + 'statement-aging-table' => [ + 'id' => 'statement-aging-table', + 'elements' => $this->statementAgingTable(), + ], 'table-totals' => [ 'id' => 'table-totals', 'elements' => $this->tableTotals(), @@ -392,6 +396,32 @@ class Design extends BaseDesign ]; } + public function statementAgingTable() + { + if (is_null($this->payments) || $this->type !== self::STATEMENT) { + return []; + } + + return [ + ['element' => 'thead', 'elements' => [ + ['element' => 'th', 'content' => '0-30', 'properties' => []], + ['element' => 'th', 'content' => '30-60', 'properties' => []], + ['element' => 'th', 'content' => '60-90', 'properties' => []], + ['element' => 'th', 'content' => '90-120', 'properties' => []], + ['element' => 'th', 'content' => '120+', 'properties' => []], + ]], + ['element' => 'tbody', 'elements' => [ + ['element' => 'tr', 'elements' => [ + ['element' => 'td', 'content' => '$0.00'], + ['element' => 'td', 'content' => '$0.00'], + ['element' => 'td', 'content' => '$0.00'], + ['element' => 'td', 'content' => '$0.00'], + ['element' => 'td', 'content' => '$0.00'], + ]], + ]], + ]; + } + /** * Generate the structure of table headers. () *