From 95903950670c3490743ca8f4937ec60c0f38dadb Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 28 May 2023 01:13:22 +0000 Subject: [PATCH] style fixes, bug fixes --- Admin/Install/Media/bill.pdf.php | 3 +- Controller/ApiBillController.php | 38 ++++++++++--------- Models/Bill.php | 6 +-- Theme/Backend/bill-create.tpl.php | 6 +-- Theme/Backend/purchase-bill-list.tpl.php | 2 +- Theme/Backend/purchase-bill.tpl.php | 4 +- Theme/Backend/sales-bill-list.tpl.php | 2 +- .../user-purchase-bill-dashboard.tpl.php | 2 +- Theme/Backend/user-purchase-bill.tpl.php | 4 +- 9 files changed, 35 insertions(+), 32 deletions(-) diff --git a/Admin/Install/Media/bill.pdf.php b/Admin/Install/Media/bill.pdf.php index 28361a0..a58f283 100755 --- a/Admin/Install/Media/bill.pdf.php +++ b/Admin/Install/Media/bill.pdf.php @@ -50,6 +50,7 @@ $pdf->attributes['city'] = $this->getData('bill_company_city') ?? '61206 Woells $pdf->attributes['ceo'] = $this->getData('bill_company_ceo') ?? 'Dennis Eichhorn'; $pdf->attributes['tax_office'] = $this->getData('bill_company_tax_office') ?? 'HRB ???'; $pdf->attributes['tax_number'] = $this->getData('bill_company_tax_id') ?? '123456789'; +$pdf->attributes['terms'] = $this->getData('bill_company_terms') ?? 'https://jingga.app/terms'; $pdf->attributes['bank_name'] = $this->getData('bill_company_bank_name') ?? 'Volksbank Mittelhessen'; $pdf->attributes['swift'] = $this->getData('bill_company_swift') ?? '.....'; @@ -282,7 +283,7 @@ $pdf->Ln(); // @todo: fix terms $pdf->setFont('helvetica', 'B', 8); -$pdf->Write(0, $lang[$pdf->language]['Terms'] . ': https://jingga.app/terms', '', 0, 'L', false, 0, false, false, 0); +$pdf->Write(0, $lang[$pdf->language]['Terms'] . ': ' . $pdf->attributes['terms'], '', 0, 'L', false, 0, false, false, 0); $pdf->Ln(); $pdf->setFont('helvetica', 'B', 8); diff --git a/Controller/ApiBillController.php b/Controller/ApiBillController.php index abaf905..36517b6 100755 --- a/Controller/ApiBillController.php +++ b/Controller/ApiBillController.php @@ -731,24 +731,6 @@ final class ApiBillController extends Controller $view->setData('bill_title', $request->getDataString('bill_title')); $view->setData('bill_subtitle', $request->getDataString('bill_subtitle')); $view->setData('keywords', $request->getDataString('keywords')); - $view->setData('bill_logo_name', $request->getDataString('bill_logo_name')); - $view->setData('bill_slogan', $request->getDataString('bill_slogan')); - - $view->setData('legal_company_name', $request->getDataString('legal_company_name')); - $view->setData('bill_company_address', $request->getDataString('bill_company_address')); - $view->setData('bill_company_city', $request->getDataString('bill_company_city')); - $view->setData('bill_company_ceo', $request->getDataString('bill_company_ceo')); - $view->setData('bill_company_website', $request->getDataString('bill_company_website')); - $view->setData('bill_company_email', $request->getDataString('bill_company_email')); - $view->setData('bill_company_phone', $request->getDataString('bill_company_phone')); - - $view->setData('bill_company_tax_office', $request->getDataString('bill_company_tax_office')); - $view->setData('bill_company_tax_id', $request->getDataString('bill_company_tax_id')); - $view->setData('bill_company_vat_id', $request->getDataString('bill_company_vat_id')); - - $view->setData('bill_company_bank_name', $request->getDataString('bill_company_bank_name')); - $view->setData('bill_company_bic', $request->getDataString('bill_company_bic')); - $view->setData('bill_company_iban', $request->getDataString('bill_company_iban')); $view->setData('bill_type_name', $request->getDataString('bill_type_name')); @@ -761,6 +743,26 @@ final class ApiBillController extends Controller $view->setData('bill_taxes', $request->getDataString('bill_taxes')); $view->setData('bill_currency', $request->getDataString('bill_currency')); + // Unit specifc settings + $view->setData('bill_logo_name', $request->getDataString('bill_logo_name')); + $view->setData('bill_slogan', $request->getDataString('bill_slogan')); + $view->setData('legal_company_name', $request->getDataString('legal_company_name')); + $view->setData('bill_company_address', $request->getDataString('bill_company_address')); + $view->setData('bill_company_city', $request->getDataString('bill_company_city')); + $view->setData('bill_company_ceo', $request->getDataString('bill_company_ceo')); + $view->setData('bill_company_website', $request->getDataString('bill_company_website')); + $view->setData('bill_company_email', $request->getDataString('bill_company_email')); + $view->setData('bill_company_phone', $request->getDataString('bill_company_phone')); + $view->setData('bill_company_terms', $request->getDataString('bill_company_terms')); + + $view->setData('bill_company_tax_office', $request->getDataString('bill_company_tax_office')); + $view->setData('bill_company_tax_id', $request->getDataString('bill_company_tax_id')); + $view->setData('bill_company_vat_id', $request->getDataString('bill_company_vat_id')); + + $view->setData('bill_company_bank_name', $request->getDataString('bill_company_bank_name')); + $view->setData('bill_company_swift', $request->getDataString('bill_company_swift')); + $view->setData('bill_company_bank_account', $request->getDataString('bill_company_bank_account')); + $pdf = $view->render(); $response->set('', $pdf); diff --git a/Models/Bill.php b/Models/Bill.php index 49405a7..17912c7 100755 --- a/Models/Bill.php +++ b/Models/Bill.php @@ -100,15 +100,15 @@ class Bill implements \JsonSerializable /** * Bill created at. * - * @var \DateTime + * @var null|\DateTime * @since 1.0.0 */ - public \DateTime $billDate; + public ?\DateTime $billDate = null; /** * Bill created at. * - * @var \DateTime + * @var null|\DateTime * @since 1.0.0 */ public ?\DateTime $performanceDate = null; diff --git a/Theme/Backend/bill-create.tpl.php b/Theme/Backend/bill-create.tpl.php index 20d3f9e..2ac7b91 100755 --- a/Theme/Backend/bill-create.tpl.php +++ b/Theme/Backend/bill-create.tpl.php @@ -257,7 +257,7 @@ echo $this->getData('nav')->render(); ?>
-
getHtml('Invoice'); ?>
+
getHtml('Invoice'); ?>
getData('nav')->render(); ?>
- +
@@ -515,7 +515,7 @@ echo $this->getData('nav')->render(); ?>
-
getHtml('Logs'); ?>
+
getHtml('Logs'); ?>
diff --git a/Theme/Backend/purchase-bill-list.tpl.php b/Theme/Backend/purchase-bill-list.tpl.php index 31b3bea..3198fb0 100755 --- a/Theme/Backend/purchase-bill-list.tpl.php +++ b/Theme/Backend/purchase-bill-list.tpl.php @@ -21,7 +21,7 @@ echo $this->getData('nav')->render(); ?>
-
getHtml('Bills'); ?>
+
getHtml('Bills'); ?>
diff --git a/Theme/Backend/purchase-bill.tpl.php b/Theme/Backend/purchase-bill.tpl.php index dfb3803..da60fb5 100755 --- a/Theme/Backend/purchase-bill.tpl.php +++ b/Theme/Backend/purchase-bill.tpl.php @@ -147,7 +147,7 @@ echo $this->getData('nav')->render(); ?>
-
getHtml('Invoice'); ?>
+
getHtml('Invoice'); ?>
@@ -289,7 +289,7 @@ echo $this->getData('nav')->render(); ?>
-
getHtml('Media'); ?>
+
getHtml('Media'); ?>
diff --git a/Theme/Backend/sales-bill-list.tpl.php b/Theme/Backend/sales-bill-list.tpl.php index ec108d7..a627c53 100755 --- a/Theme/Backend/sales-bill-list.tpl.php +++ b/Theme/Backend/sales-bill-list.tpl.php @@ -21,7 +21,7 @@ echo $this->getData('nav')->render(); ?>
-
getHtml('Bills'); ?>
+
getHtml('Bills'); ?>
diff --git a/Theme/Backend/user-purchase-bill-dashboard.tpl.php b/Theme/Backend/user-purchase-bill-dashboard.tpl.php index cdddcdd..80e7481 100755 --- a/Theme/Backend/user-purchase-bill-dashboard.tpl.php +++ b/Theme/Backend/user-purchase-bill-dashboard.tpl.php @@ -23,7 +23,7 @@ echo $this->getData('nav')->render(); ?>
-
getHtml('Bills'); ?>
+
getHtml('Bills'); ?>
diff --git a/Theme/Backend/user-purchase-bill.tpl.php b/Theme/Backend/user-purchase-bill.tpl.php index a77a9c0..5e2c226 100755 --- a/Theme/Backend/user-purchase-bill.tpl.php +++ b/Theme/Backend/user-purchase-bill.tpl.php @@ -147,7 +147,7 @@ echo $this->getData('nav')->render(); ?>
-
getHtml('Invoice'); ?>
+
getHtml('Invoice'); ?>
@@ -287,7 +287,7 @@ echo $this->getData('nav')->render(); ?>
-
getHtml('Media'); ?>
+
getHtml('Media'); ?>