diff --git a/.github/dev_bug_report.md b/.github/dev_bug_report.md
deleted file mode 100755
index ef93e56..0000000
--- a/.github/dev_bug_report.md
+++ /dev/null
@@ -1,35 +0,0 @@
----
-name: Dev Bug Report
-about: Create a report to help us improve
-title: ''
-labels: stat_backlog, type_bug
-assignees: ''
-
----
-
-# Bug Description
-A clear and concise description of what the bug is.
-
-# How to Reproduce
-
-Steps to reproduce the behavior:
-
-1. Go to '...'
-2. Click on '....'
-3. Scroll down to '....'
-4. See error
-
-## Minimal Code Example
-
-```
-// your code ...
-```
-
-# Expected Behavior
-A clear and concise description of what you expected to happen.
-
-# Screenshots
-If applicable, add screenshots to help explain your problem.
-
-# Additional Information
-Add any other context about the problem here.
diff --git a/.github/dev_feature_request.md b/.github/dev_feature_request.md
deleted file mode 100755
index 9573c35..0000000
--- a/.github/dev_feature_request.md
+++ /dev/null
@@ -1,18 +0,0 @@
----
-name: Dev Feature Request
-about: Suggest an idea for this project
-title: ''
-labels: stat_backlog, type_feature
-assignees: ''
-
----
-
-# What is the feature you request
-* A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
-* A clear and concise description of what you want to happen.
-
-# Alternatives
-A clear and concise description of any alternative solutions or features you've considered.
-
-# Additional Information
-Add any other context or screenshots about the feature request here.
diff --git a/.github/user_bug_report.md b/.github/user_bug_report.md
deleted file mode 100755
index 4b92a8e..0000000
--- a/.github/user_bug_report.md
+++ /dev/null
@@ -1,40 +0,0 @@
----
-name: User Bug Report
-about: Create a report to help us improve
-title: ''
-labels: stat_backlog, type_bug
-assignees: ''
-
----
-
-# Bug Description
-
-A clear and concise description of what the bug is.
-
-# How to Reproduce
-
-Steps to reproduce the behavior:
-
-1. Go to '...'
-2. Click on '....'
-3. Scroll down to '....'
-4. See error
-
-# Expected Behavior
-
-A clear and concise description of what you expected to happen.
-
-# Screenshots
-
-If applicable, add screenshots to help explain your problem.
-
-# System Information
-
-- System: [e.g. PC or iPhone11, ...]
-- OS: [e.g. iOS]
-- Browser [e.g. chrome, safari]
-- KarakaVersion [e.g. 22]
-
-# Additional Information
-
-Add any other context about the problem here.
diff --git a/.github/user_feature_request.md b/.github/user_feature_request.md
deleted file mode 100755
index c9595e8..0000000
--- a/.github/user_feature_request.md
+++ /dev/null
@@ -1,21 +0,0 @@
----
-name: User Feature Request
-about: Suggest an idea for this project
-title: ''
-labels: stat_backlog, type_feature
-assignees: ''
-
----
-
-# What is the feature you request
-
-* A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
-* A clear and concise description of what you want to happen.
-
-# Alternatives
-
-A clear and concise description of any alternative solutions or features you've considered.
-
-# Additional Information
-
-Add any other context or screenshots about the feature request here.
diff --git a/Admin/Install/Admin.install.json b/Admin/Install/Admin.install.json
deleted file mode 100755
index 1b8d939..0000000
--- a/Admin/Install/Admin.install.json
+++ /dev/null
@@ -1,9 +0,0 @@
-[
- {
- "type": "setting",
- "name": "1005100003",
- "content": "[\"en\", \"de\"]",
- "pattern": "",
- "module": "Billing"
- }
-]
\ No newline at end of file
diff --git a/Admin/Install/Admin.install.php b/Admin/Install/Admin.install.php
new file mode 100644
index 0000000..0fd52fb
--- /dev/null
+++ b/Admin/Install/Admin.install.php
@@ -0,0 +1,26 @@
+ 'setting',
+ 'name' => SettingsEnum::VALID_BILL_LANGUAGES,
+ 'content' => '["en","de"]',
+ 'pattern' => '',
+ 'module' => ApiController::NAME,
+ ],
+];
diff --git a/Admin/Install/Admin.php b/Admin/Install/Admin.php
index ea8cd1f..a21cb13 100755
--- a/Admin/Install/Admin.php
+++ b/Admin/Install/Admin.php
@@ -38,6 +38,6 @@ class Admin
*/
public static function install(ApplicationAbstract $app, string $path) : void
{
- \Modules\Admin\Admin\Installer::installExternal($app, ['path' => __DIR__ . '/Admin.install.json']);
+ \Modules\Admin\Admin\Installer::installExternal($app, ['path' => __DIR__ . '/Admin.install.php']);
}
}
diff --git a/Admin/Install/Media.install.json b/Admin/Install/Media.install.json
index 2f42254..9f59e9c 100755
--- a/Admin/Install/Media.install.json
+++ b/Admin/Install/Media.install.json
@@ -36,14 +36,28 @@
},
{
"type": "type",
- "name": "original",
+ "name": "internal",
"l11n": [
{
- "title": "Original",
+ "title": "Internal",
"lang": "en"
},
{
- "title": "Original",
+ "title": "Intern",
+ "lang": "de"
+ }
+ ]
+ },
+ {
+ "type": "type",
+ "name": "external",
+ "l11n": [
+ {
+ "title": "External",
+ "lang": "en"
+ },
+ {
+ "title": "Extern",
"lang": "de"
}
]
diff --git a/Admin/Install/Media.php b/Admin/Install/Media.php
index 274c55a..3dae6c2 100755
--- a/Admin/Install/Media.php
+++ b/Admin/Install/Media.php
@@ -54,11 +54,18 @@ class Media
],
[
'type' => 'setting',
- 'name' => SettingsEnum::ORIGINAL_MEDIA_TYPE,
+ 'name' => SettingsEnum::INTERNAL_MEDIA_TYPE,
'content' => (string) $media['type'][1]['id'],
'pattern' => '\\d+',
'module' => 'Billing',
],
+ [
+ 'type' => 'setting',
+ 'name' => SettingsEnum::EXTERNAL_MEDIA_TYPE,
+ 'content' => (string) $media['type'][2]['id'],
+ 'pattern' => '\\d+',
+ 'module' => 'Billing',
+ ],
],
]
);
diff --git a/Admin/Install/Media/bill.pdf.php b/Admin/Install/Media/bill.pdf.php
index e60edad..cb92fd3 100755
--- a/Admin/Install/Media/bill.pdf.php
+++ b/Admin/Install/Media/bill.pdf.php
@@ -13,15 +13,17 @@
declare(strict_types=1);
use Modules\Billing\Models\NullBill;
+use Modules\Media\Models\NullCollection;
use phpOMS\Localization\ISO3166NameEnum;
-use phpOMS\Localization\ISO3166TwoEnum;
use phpOMS\Localization\Money;
+use phpOMS\Stdlib\Base\FloatInt;
/** @var \phpOMS\Views\View $this */
-/** @var \Modules\Media\Models\Collection $media */
-$media = $this->getData('defaultTemplates');
-require_once $media->findFile('.pdf.php')->getAbsolutePath();
+/** @var \Modules\Media\Models\Collection $collection */
+$collection = $this->data['defaultTemplates'] ?? new NullCollection();
+
+require_once $collection->findFile('.pdf.php')->getAbsolutePath();
/** @var \Modules\Billing\Models\Bill $bill */
$bill = $this->data['bill'] ?? new NullBill();
@@ -32,8 +34,8 @@ $pdf = new DefaultPdf();
$lang = include __DIR__ . '/lang.php';
-$pdf->attributes['title_name'] = (string) ($this->data['bill_logo_name'] ?? 'Jingga');
-$pdf->attributes['slogan'] = (string) ($this->data['bill_slogan'] ?? 'Business solutions made simple.');
+$pdf->attributes['title_name'] = $this->data['bill_logo_name'] ?? 'Jingga';
+$pdf->attributes['slogan'] = $this->data['bill_slogan'] ?? 'Business solutions made simple.';
$pdf->setHeaderData(
__DIR__ . '/logo.png', 15,
@@ -47,22 +49,22 @@ $pdf->setSubject((string) ($this->data['bill_subtitle'] ?? ''));
$pdf->setKeywords(\implode(', ', (array) ($this->data['keywords'] ?? [])));
$pdf->language = $bill->language;
-$pdf->attributes['legal_name'] = (string) ($this->data['legal_company_name'] ?? 'Jingga e. K.');
-$pdf->attributes['address'] = (string) ($this->data['bill_company_address'] ?? 'Kirchstr. 33');
-$pdf->attributes['city'] = (string) ($this->data['bill_company_city'] ?? '61191 Rosbach');
+$pdf->attributes['legal_name'] = $this->data['legal_company_name'] ?? 'Jingga e. K.';
+$pdf->attributes['address'] = $this->data['bill_company_address'] ?? 'Kirchstr. 33';
+$pdf->attributes['city'] = $this->data['bill_company_city'] ?? '61191 Rosbach';
-$pdf->attributes['ceo'] = (string) ($this->data['bill_company_ceo'] ?? 'Dennis Eichhorn');
-$pdf->attributes['tax_office'] = (string) ($this->data['bill_company_tax_office'] ?? 'HRA 5058');
-$pdf->attributes['tax_number'] = (string) ($this->data['bill_company_tax_id'] ?? 'DE362646968');
-$pdf->attributes['terms'] = (string) ($this->data['bill_company_terms'] ?? 'https://jingga.app/terms');
+$pdf->attributes['ceo'] = $this->data['bill_company_ceo'] ?? 'Dennis Eichhorn';
+$pdf->attributes['tax_office'] = $this->data['bill_company_tax_office'] ?? 'HRA 5058';
+$pdf->attributes['tax_number'] = $this->data['bill_company_tax_id'] ?? 'DE362646968';
+$pdf->attributes['terms'] = $this->data['bill_company_terms'] ?? 'https://jingga.app/terms';
-$pdf->attributes['bank_name'] = (string) ($this->data['bill_company_bank_name'] ?? 'Volksbank Mittelhessen');
-$pdf->attributes['swift'] = (string) ($this->data['bill_company_swift'] ?? 'VBMHDE5F');
-$pdf->attributes['bank_account'] = (string) ($this->data['bill_company_bank_account'] ?? 'DE62 5139 0000 0084 8044 10');
+$pdf->attributes['bank_name'] = $this->data['bill_company_bank_name'] ?? 'Volksbank Mittelhessen';
+$pdf->attributes['swift'] = $this->data['bill_company_swift'] ?? 'VBMHDE5F';
+$pdf->attributes['bank_account'] = $this->data['bill_company_bank_account'] ?? 'DE62 5139 0000 0084 8044 10';
-$pdf->attributes['website'] = (string) ($this->data['bill_company_website'] ?? 'www.jingga.app');
-$pdf->attributes['email'] = (string) ($this->data['bill_company_email'] ?? 'info@jingga.app');
-$pdf->attributes['phone'] = (string) ($this->data['bill_company_phone'] ?? '+49 152 04337728');
+$pdf->attributes['website'] = $this->data['bill_company_website'] ?? 'www.jingga.app';
+$pdf->attributes['email'] = $this->data['bill_company_email'] ?? 'info@jingga.app';
+$pdf->attributes['phone'] = $this->data['bill_company_phone'] ?? '+49 152 04337728';
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
@@ -73,17 +75,11 @@ $topPos = $pdf->getY();
// Set up default bill template
$billTypeName = \strtoupper($bill->type->getL11n());
-// @todo: depending on amount of lines, there is a solution (html, or use backtracking of tcpdf)
-
// Address
$pdf->setY(50);
$pdf->setFont('helvetica', '', 10);
-$countries = ISO3166NameEnum::getConstants();
-$countryEnumName = ISO3166TwoEnum::getName($bill->billCountry);
-$toCountry = \is_string($countryEnumName) && ($country = ISO3166NameEnum::getByName($countryEnumName)) !== null
- ? $country
- : '';
+$toCountry = ISO3166NameEnum::getBy2Code($bill->billCountry);
$addressString = \trim(
$bill->billTo . "\n"
@@ -104,64 +100,58 @@ $pdf->Write(
);
$lineHeight = ($lineHeight - $pdf->getY()) / $addressLineCount;
+$pageWidth = $pdf->getPageWidth();
+$pageHeight = $pdf->getPageHeight();
+
// Bill head
$pdf->setFont('helvetica', 'B', 16);
$titleWidth = $pdf->getStringWidth($billTypeName, 'helvetica', 'B', 16);
$titleWidth = \is_array($titleWidth) ? \array_sum($titleWidth) : $titleWidth;
$pdf->setXY(
- $rightPos = ($pdf->getPageWidth() - $titleWidth - \max(60 - $titleWidth, 0) - 15 - 2),
+ $rightPos = ($pageWidth - $titleWidth - \max(60 - $titleWidth, 0) - 15 - 2),
$topPos + 50 + $lineHeight * $addressLineCount - 38,
true
);
$pdf->setTextColor(255, 255, 255);
$pdf->setFillColor(255, 162, 7);
-$pdf->Cell($pdf->getPageWidth() - $rightPos - 15, 0, $billTypeName, 0, 0, 'L', true);
+$pdf->Cell($pageWidth - $rightPos - 15, 0, $billTypeName, 0, 0, 'L', true);
$pdf->setFont('helvetica', '', 10);
$pdf->setTextColor(255, 162, 7);
$pdf->setXY($rightPos, $tempY = $pdf->getY() + 10, true);
$pdf->MultiCell(
- 26, 30,
+ 29, 30,
$lang[$pdf->language]['InvoiceNo'] . "\n"
. $lang[$pdf->language]['InvoiceDate'] . "\n"
. $lang[$pdf->language]['ServiceDate'] . "\n"
. $lang[$pdf->language]['CustomerNo'] . "\n"
- . $lang[$pdf->language]['PO'] . "\n"
+ . $lang[$pdf->language]['REF'] . "\n"
. $lang[$pdf->language]['DueDate'],
0, 'L'
);
-$pdf->setFont('helvetica', '', 10);
+//$pdf->setFont('helvetica', '', 10);
$pdf->setTextColor(0, 0, 0);
-$pdf->setXY($rightPos + 26 + 2, $tempY, true);
+$pdf->setXY($rightPos + 29 + 2, $tempY, true);
$pdf->MultiCell(
25, 30,
$bill->number . "\n"
. ($bill->billDate?->format('Y-m-d') ?? '0') . "\n"
. ($bill->performanceDate?->format('Y-m-d') ?? '0') . "\n"
. $bill->accountNumber . "\n"
- . '' . "\n" /* @todo: implement customer / supplier reference as string */
+ . $bill->external . "\n"
. ($bill->billDate?->format('Y-m-d') ?? '0'), /* Consider to add dueDate in addition */
0, 'L'
);
$pdf->Ln();
-$pdf->setY($pdf->getY() - 30);
-
-/*
-$pdf->writeHTMLCell(
- $pdf->getPageWidth() - 15 * 2, 0, null, null,
- "Lorem ipsum dolor sit amet,
Consectetur adipiscing elit. Vivamus ac massa sit amet eros posuere accumsan feugiat vel est. Maecenas ultricies enim eu eros rhoncus, volutpat cursus enim imperdiet. Aliquam et odio ipsum. Quisque dapibus scelerisque tempor. Phasellus purus lorem, venenatis eget pretium ac, convallis et ante. Aenean pulvinar justo consectetur mi tincidunt venenatis. Suspendisse ultricies enim id nulla facilisis lacinia.
Nunc placerat elementum turpis, quis facilisis diam volutpat at. Suspendisse enim leo, convallis nec ornare eu, auctor nec purus. Nunc neque metus, feugiat quis justo nec, mollis dignissim risus. Lorem ipsum dolor sit amet, consectetur adipiscing elit. In at ornare sem. Cras placerat, sapien sed ornare lacinia, mauris nulla volutpat nisl, eget dapibus nisl ipsum non est. Suspendisse ut nisl a ipsum rhoncus sodales.",
- 0, 0, false, true, 'J'
-);
-$pdf->Ln();
-*/
-
//Close and output PDF document
$path = (string) ($this->data['path'] ?? (($bill->billDate?->format('Y-m-d') ?? '0') . '_' . $bill->number . '.pdf'));
$pdf->Output($path, 'I');
diff --git a/Admin/Install/Media/lang.php b/Admin/Install/Media/lang.php
index 38f26e0..7c11b32 100755
--- a/Admin/Install/Media/lang.php
+++ b/Admin/Install/Media/lang.php
@@ -20,7 +20,7 @@ return [
'InvoiceDate' => 'Invoice Date',
'ServiceDate' => 'Service Date',
'CustomerNo' => 'Customer No.',
- 'PO' => 'PO',
+ 'REF' => 'REF',
'DueDate' => 'Due Date',
'Item' => 'Item',
'Currency' => 'Currency',
@@ -40,7 +40,7 @@ return [
'InvoiceDate' => 'Belegdatum',
'ServiceDate' => 'Leistungsdatum',
'CustomerNo' => 'Kundennummer',
- 'PO' => 'Kundenreferenz',
+ 'REF' => 'REF',
'DueDate' => 'Fälligkeitsdatum',
'Item' => 'Artikel',
'Currency' => 'Währung',
diff --git a/Admin/Install/Messages.install.json b/Admin/Install/Messages.install.json
index 7608fba..2a50782 100755
--- a/Admin/Install/Messages.install.json
+++ b/Admin/Install/Messages.install.json
@@ -9,13 +9,34 @@
"l11n": {
"en": {
"subject": "Billing",
- "body": "
Billing
Billing
Dear {user_name},
Thank you for for doing business with us.
Attached kindly find your bill.
Jingga e.K. - www.jingga.app - CEO Dennis Eichhorn - Amtsgericht Friedberg HRA 5058
",
+ "body": "Billing
Billing
Dear {user_name},
Thank you for for doing business with us.
Attached kindly find your bill.
Jingga e.K. - www.jingga.app - CEO Dennis Eichhorn - Amtsgericht Friedberg HRA 5058
",
"bodyalt": "Dear {user_name},\n\nThank you for doing business with us.\n\nAttached kindly find your bill.\n\n\nJingga e.K. - www.jingga.app - CEO Dennis Eichhorn - Amtsgericht Friedberg HRA 5058"
},
"de": {
"subject": "Rechnungsstellung",
- "body": "Abrechnung
Abrechnung
Sehr geehrte/r {user_name},
Vielen Dank für Ihre Geschäftsbeziehung mit uns.
Im Anhang finden Sie Ihre Rechnung.
Jingga e.K. - www.jingga.app - CEO Dennis Eichhorn - Amtsgericht Friedberg HRA 5058
",
- "bodyalt": "Sehr geehrte/r {user_name},\n\nvielen Dank für Ihre Geschäftsbeziehung mit uns.\n\nIm Anhang finden Sie freundlicherweise Ihre Rechnung.\n\n\nJingga e.K. - www.jingga.app - CEO Dennis Eichhorn - Amtsgericht Friedberg HRA 5058"
+ "body": "Abrechnung
Abrechnung
Sehr geehrte/r {user_name},
Vielen Dank für Ihre Geschäftsbeziehung mit uns.
Im Anhang finden Sie Ihre Rechnung.
Jingga e.K. - www.jingga.app - CEO Dennis Eichhorn - Amtsgericht Friedberg HRA 5058
",
+ "bodyalt": "Sehr geehrte/r {user_name},\n\nVielen Dank für Ihre Geschäftsbeziehung mit uns.\n\nIm Anhang finden Sie freundlicherweise Ihre Rechnung.\n\n\nJingga e.K. - www.jingga.app - CEO Dennis Eichhorn - Amtsgericht Friedberg HRA 5058"
+ }
+ },
+ "send": false
+ },
+ {
+ "type": "email_template",
+ "from": "",
+ "to": "",
+ "cc": "",
+ "bcc": "",
+ "ishtml": true,
+ "l11n": {
+ "en": {
+ "subject": "Order",
+ "body": "Order
Order
Dear {user_name},
We are looking forward to doing business with you.
Attached kindly find our order.
Jingga e.K. - www.jingga.app - CEO Dennis Eichhorn - Amtsgericht Friedberg HRA 5058
",
+ "bodyalt": "Dear {user_name},\n\nWe are looking forward to doing business with you.\n\nAttached kindly find our order.\n\n\nJingga e.K. - www.jingga.app - CEO Dennis Eichhorn - Amtsgericht Friedberg HRA 5058"
+ },
+ "de": {
+ "subject": "Bestellung",
+ "body": "Bestellung
Bestellung
Sehr geehrte/r {user_name},
Wir freuen uns eine Bestellung bei Ihnen aufgeben zu können.
Im Anhang finden Sie unsere Bestellung.
Jingga e.K. - www.jingga.app - CEO Dennis Eichhorn - Amtsgericht Friedberg HRA 5058
\ No newline at end of file
diff --git a/Theme/Backend/purchase-bill-list.tpl.php b/Theme/Backend/purchase-bill-list.tpl.php
index a516aeb..ad3f775 100755
--- a/Theme/Backend/purchase-bill-list.tpl.php
+++ b/Theme/Backend/purchase-bill-list.tpl.php
@@ -21,7 +21,7 @@ echo $this->data['nav']->render(); ?>
\ No newline at end of file
diff --git a/Theme/Backend/user-purchase-bill-dashboard.tpl.php b/Theme/Backend/user-purchase-bill-dashboard.tpl.php
index c66623b..176c8b3 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->data['nav']->render(); ?>