diff --git a/Admin/Install/Admin.install.php b/Admin/Install/Admin.install.php index b0b5203..0965cc2 100755 --- a/Admin/Install/Admin.install.php +++ b/Admin/Install/Admin.install.php @@ -6,7 +6,7 @@ * * @package Modules\Billing\Admin * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Admin/Install/Media.php b/Admin/Install/Media.php index ad827d8..c0617b5 100755 --- a/Admin/Install/Media.php +++ b/Admin/Install/Media.php @@ -6,7 +6,7 @@ * * @package Modules\Billing\Admin\Install * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -23,7 +23,7 @@ use phpOMS\Application\ApplicationAbstract; * Media class. * * @package Modules\Billing\Admin\Install - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Admin/Install/Media/bill.pdf.php b/Admin/Install/Media/bill.pdf.php index afc8579..a3975e1 100755 --- a/Admin/Install/Media/bill.pdf.php +++ b/Admin/Install/Media/bill.pdf.php @@ -1,52 +1,64 @@ getData('defaultTemplates') ->findFile('.pdf.php') ->getAbsolutePath(); $pdf = new DefaultPdf('P', 'mm', 'A4', true, 'UTF-8', false); -$creator = $this->getData('bill_creator') ?? 'Jingga'; -$author = 'Jingga'; -$title = $this->getData('bill_title') ?? 'Invoice'; +$creator = $this->getData('bill_creator') ?? 'Jingga'; +$author = 'Jingga'; +$title = $this->getData('bill_title') ?? 'Invoice'; $subtitle = $this->getData('bill_subtitle') ?? 'Sub title'; $keywords = $this->getData('keywords') ?? []; $logoName = $this->getData('bill_logo_name') ?? 'Jingga'; $slogan = $this->getData('bill_slogan') ?? 'Business solutions made simple.'; $legalCompanyName = $this->getData('legal_company_name') ?? 'Jingga e.K.'; -$companyAddress = $this->getData('bill_company_address') ?? 'Gartenstr. 26'; -$companyCity = $this->getData('bill_company_city') ?? '61206 Woellstadt'; -$companyCEO = $this->getData('bill_company_ceo') ?? 'Dennis Eichhorn'; -$companyWebsite = $this->getData('bill_company_website') ?? 'www.jingga.app'; -$companyEmail = $this->getData('bill_company_email') ?? 'info@jingga.app'; -$companyPhone = $this->getData('bill_company_phone') ?? '+49 0152 ????'; +$companyAddress = $this->getData('bill_company_address') ?? 'Gartenstr. 26'; +$companyCity = $this->getData('bill_company_city') ?? '61206 Woellstadt'; +$companyCEO = $this->getData('bill_company_ceo') ?? 'Dennis Eichhorn'; +$companyWebsite = $this->getData('bill_company_website') ?? 'www.jingga.app'; +$companyEmail = $this->getData('bill_company_email') ?? 'info@jingga.app'; +$companyPhone = $this->getData('bill_company_phone') ?? '+49 0152 ????'; $taxOffice = $this->getData('bill_company_tax_office') ?? 'HRB'; -$taxId = $this->getData('bill_company_tax_id') ?? 'DE ?????????'; -$vatId = $this->getData('bill_company_vat_id') ?? 'DE ??????'; +$taxId = $this->getData('bill_company_tax_id') ?? 'DE ?????????'; +$vatId = $this->getData('bill_company_vat_id') ?? 'DE ??????'; $bankName = $this->getData('bill_company_bank_name') ?? 'Volksbank Mittelhessen'; -$bic = $this->getData('bill_company_bic') ?? ''; -$iban = $this->getData('bill_company_iban') ?? ''; +$bic = $this->getData('bill_company_bic') ?? ''; +$iban = $this->getData('bill_company_iban') ?? ''; $billTypeName = $this->getData('bill_type_name') ?? 'INVOICE'; $billInvoiceNumber = $this->getData('bill_invoice_no') ?? ''; -$billInvoiceDate = $this->getData('bill_invoice_date') ?? ''; -$billServiceDate = $this->getData('bill_service_date') ?? ''; -$billCustomerNo = $this->getData('bill_customer_no') ?? ''; -$billPO = $this->getData('bill_po') ?? ''; -$billDueDate = $this->getData('bill_due_date') ?? ''; +$billInvoiceDate = $this->getData('bill_invoice_date') ?? ''; +$billServiceDate = $this->getData('bill_service_date') ?? ''; +$billCustomerNo = $this->getData('bill_customer_no') ?? ''; +$billPO = $this->getData('bill_po') ?? ''; +$billDueDate = $this->getData('bill_due_date') ?? ''; $invoiceLines = $this->getData('bill_lines') ?? []; $paymentTerms = $this->getData('bill_payment_terms') ?? ''; -$terms = $this->getData('bill_terms') ?? 'https://jingga.app/terms'; -$taxes = $this->getData('bill_taxes') ?? ['19%' => '0.00']; -$currency = $this->getData('bill_currency') ?? 'EUR'; +$terms = $this->getData('bill_terms') ?? 'https://jingga.app/terms'; +$taxes = $this->getData('bill_taxes') ?? ['19%' => '0.00']; +$currency = $this->getData('bill_currency') ?? 'EUR'; // set document information $pdf->SetCreator($creator); @@ -61,7 +73,7 @@ $pdf->SetImageScale(PDF_IMAGE_SCALE_RATIO); $topPos = $pdf->getY(); // Address -$pdf->SetY(55); // @todo: depending on amount of lines +$pdf->SetY(55); // @todo: depending on amount of lines, there is a solution (html, or use backtracking of tcpdf) $pdf->SetFont('helvetica', '', 8); $lineHeight = $pdf->getY(); @@ -126,8 +138,8 @@ $data = [ ]; // Header -$w = array($pdf->getPageWidth() - 20 - 20 - 20 - 2*15, 20, 20, 20); -$num_headers = count($header); +$w = array($pdf->getPageWidth() - 20 - 20 - 20 - 2*15, 20, 20, 20); +$num_headers = \count($header); $pdf->setCellPadding(1, 1, 1, 1); diff --git a/Admin/Install/Navigation.install.json b/Admin/Install/Navigation.install.json index ebc7102..6b6e789 100755 --- a/Admin/Install/Navigation.install.json +++ b/Admin/Install/Navigation.install.json @@ -5,7 +5,7 @@ "type": 2, "subtype": 1, "name": "Billing", - "uri": "{/lang}/{/app}/sales/bill/list", + "uri": "{/base}/sales/bill/list", "target": "self", "icon": null, "order": 10, @@ -19,7 +19,7 @@ "type": 3, "subtype": 1, "name": "Open", - "uri": "{/lang}/{/app}/sales/bill/list", + "uri": "{/base}/sales/bill/list", "target": "self", "icon": null, "order": 1, @@ -34,7 +34,7 @@ "type": 3, "subtype": 1, "name": "Archive", - "uri": "{/lang}/{/app}/sales/bill/archive", + "uri": "{/base}/sales/bill/archive", "target": "self", "icon": null, "order": 5, @@ -49,7 +49,7 @@ "type": 3, "subtype": 1, "name": "Create", - "uri": "{/lang}/{/app}/sales/bill/create?{?}", + "uri": "{/base}/sales/bill/create?{?}", "target": "self", "icon": null, "order": 10, @@ -66,7 +66,7 @@ "type": 2, "subtype": 1, "name": "Billing", - "uri": "{/lang}/{/app}/purchase/bill/list", + "uri": "{/base}/purchase/bill/list", "target": "self", "icon": null, "order": 10, @@ -80,7 +80,7 @@ "type": 3, "subtype": 1, "name": "Open", - "uri": "{/lang}/{/app}/purchase/bill/list", + "uri": "{/base}/purchase/bill/list", "target": "self", "icon": null, "order": 1, @@ -95,7 +95,7 @@ "type": 3, "subtype": 1, "name": "Archive", - "uri": "{/lang}/{/app}/purchase/bill/archive", + "uri": "{/base}/purchase/bill/archive", "target": "self", "icon": null, "order": 5, @@ -110,7 +110,7 @@ "type": 3, "subtype": 1, "name": "Create", - "uri": "{/lang}/{/app}/purchase/bill/create?{?}", + "uri": "{/base}/purchase/bill/create?{?}", "target": "self", "icon": null, "order": 10, @@ -125,7 +125,7 @@ "type": 3, "subtype": 1, "name": "Upload", - "uri": "{/lang}/{/app}/purchase/bill/upload?{?}", + "uri": "{/base}/purchase/bill/upload?{?}", "target": "self", "icon": null, "order": 15, @@ -142,7 +142,7 @@ "type": 2, "subtype": 1, "name": "Billing", - "uri": "{/lang}/{/app}/warehouse/bill/list", + "uri": "{/base}/warehouse/bill/list", "target": "self", "icon": null, "order": 5, @@ -156,7 +156,7 @@ "type": 3, "subtype": 1, "name": "List", - "uri": "{/lang}/{/app}/warehouse/bill/list", + "uri": "{/base}/warehouse/bill/list", "target": "self", "icon": null, "order": 1, @@ -171,7 +171,7 @@ "type": 3, "subtype": 1, "name": "Archive", - "uri": "{/lang}/{/app}/warehouse/bill/archive", + "uri": "{/base}/warehouse/bill/archive", "target": "self", "icon": null, "order": 1, @@ -186,7 +186,7 @@ "type": 3, "subtype": 1, "name": "Create", - "uri": "{/lang}/{/app}/warehouse/bill/create?{?}", + "uri": "{/base}/warehouse/bill/create?{?}", "target": "self", "icon": null, "order": 5, @@ -203,7 +203,7 @@ "type": 3, "subtype": 1, "name": "Bill", - "uri": "{/lang}/{/app}/sales/analysis/bill", + "uri": "{/base}/sales/analysis/bill", "target": "self", "icon": null, "order": 15, @@ -218,7 +218,7 @@ "type": 3, "subtype": 1, "name": "Bill", - "uri": "{/lang}/{/app}/purchase/analysis/bill", + "uri": "{/base}/purchase/analysis/bill", "target": "self", "icon": null, "order": 15, @@ -233,7 +233,7 @@ "type": 2, "subtype": 1, "name": "Purchase", - "uri": "{/lang}/{/app}/private/purchase/billing/dashboard?{?}", + "uri": "{/base}/private/purchase/billing/dashboard?{?}", "target": "self", "icon": null, "order": 5, @@ -247,7 +247,7 @@ "type": 3, "subtype": 1, "name": "List", - "uri": "{/lang}/{/app}/private/purchase/billing/dashboard?{?}", + "uri": "{/base}/private/purchase/billing/dashboard?{?}", "target": "self", "icon": null, "order": 1, @@ -263,7 +263,7 @@ "type": 3, "subtype": 1, "name": "Upload", - "uri": "{/lang}/{/app}/private/purchase/billing/upload?{?}", + "uri": "{/base}/private/purchase/billing/upload?{?}", "target": "self", "icon": null, "order": 5, diff --git a/Admin/Install/Navigation.php b/Admin/Install/Navigation.php index 3347281..6742ccf 100755 --- a/Admin/Install/Navigation.php +++ b/Admin/Install/Navigation.php @@ -6,7 +6,7 @@ * * @package Modules\Billing\Admin\Install * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -20,7 +20,7 @@ use phpOMS\Application\ApplicationAbstract; * Navigation class. * * @package Modules\Billing\Admin\Install - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Admin/Install/WarehouseManagement.php b/Admin/Install/WarehouseManagement.php index 37ecf1d..dc6eb22 100755 --- a/Admin/Install/WarehouseManagement.php +++ b/Admin/Install/WarehouseManagement.php @@ -6,7 +6,7 @@ * * @package Modules\Billing\Admin\Install * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -22,7 +22,7 @@ use phpOMS\DataStorage\Database\Schema\Builder; * WarehouseManagement class. * * @package Modules\Billing\Admin\Install - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Admin/Install/Workflow.php b/Admin/Install/Workflow.php index c87223d..79b25a3 100644 --- a/Admin/Install/Workflow.php +++ b/Admin/Install/Workflow.php @@ -6,7 +6,7 @@ * * @package Modules\Billing\Admin\Install * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -20,7 +20,7 @@ use phpOMS\Application\ApplicationAbstract; * Workflow class. * * @package Modules\Billing\Admin\Install - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Admin/Installer.php b/Admin/Installer.php index 7f496c9..bc1fec8 100755 --- a/Admin/Installer.php +++ b/Admin/Installer.php @@ -6,7 +6,7 @@ * * @package Modules\Billing\Admin * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -30,7 +30,7 @@ use phpOMS\Uri\HttpUri; * Installer class. * * @package Modules\Billing\Admin - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ @@ -226,6 +226,16 @@ final class Installer extends InstallerAbstract return $billAttrValue; } + /** + * Create tax combinations (item & client/supplier) + * + * @param ApplicationAbstract $app Application + * @param array $taxes Tax data + * + * @return array + * + * @since 1.0.0 + */ private static function createTaxCombination(ApplicationAbstract $app, array $taxes) : array { $result = []; @@ -233,12 +243,26 @@ final class Installer extends InstallerAbstract /** @var \Modules\Billing\Controller\ApiController $module */ $module = $app->moduleManager->getModuleInstance('Billing'); - $itemAttributeSales = ItemAttributeTypeMapper::get()->with('defaults')->where('name', 'sales_tax_code')->execute(); - $clientAttributeSales = ClientAttributeTypeMapper::get()->with('defaults')->where('name', 'sales_tax_code')->execute(); - $supplierAttributeSales = SupplierAttributeTypeMapper::get()->with('defaults')->where('name', 'purchase_tax_code')->execute(); + /** @var \Modules\ItemManagement\Models\ItemAttributeType $itemAttributeSales */ + $itemAttributeSales = ItemAttributeTypeMapper::get() + ->with('defaults') + ->where('name', 'sales_tax_code') + ->execute(); + + /** @var \Modules\ClientManagement\Models\ClientAttributeType $clientAttributeSales */ + $clientAttributeSales = ClientAttributeTypeMapper::get() + ->with('defaults') + ->where('name', 'sales_tax_code') + ->execute(); + + /** @var \Modules\SupplierManagement\Models\SupplierAttributeType $supplierAttributeSales */ + $supplierAttributeSales = SupplierAttributeTypeMapper::get() + ->with('defaults') + ->where('name', 'purchase_tax_code') + ->execute(); foreach ($taxes as $tax) { - $itemValue = $itemAttributeSales->getDefaultByValue($tax['item_code']); + $itemValue = $itemAttributeSales->getDefaultByValue($tax['item_code']); $accountValue = $tax['type'] === 1 ? $clientAttributeSales->getDefaultByValue($tax['account_code']) : $supplierAttributeSales->getDefaultByValue($tax['account_code']); diff --git a/Admin/Routes/Web/Api.php b/Admin/Routes/Web/Api.php index a2eca4c..fbfa045 100644 --- a/Admin/Routes/Web/Api.php +++ b/Admin/Routes/Web/Api.php @@ -6,7 +6,7 @@ * * @package Modules * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Admin/Routes/Web/Backend.php b/Admin/Routes/Web/Backend.php index 281d820..b81648d 100755 --- a/Admin/Routes/Web/Backend.php +++ b/Admin/Routes/Web/Backend.php @@ -6,7 +6,7 @@ * * @package Modules * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Admin/Status.php b/Admin/Status.php index bd4301a..879ed95 100755 --- a/Admin/Status.php +++ b/Admin/Status.php @@ -6,7 +6,7 @@ * * @package Modules\Billing\Admin * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -20,7 +20,7 @@ use phpOMS\Module\StatusAbstract; * Status class. * * @package Modules\Billing\Admin - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Admin/Uninstaller.php b/Admin/Uninstaller.php index b363596..1b1c450 100755 --- a/Admin/Uninstaller.php +++ b/Admin/Uninstaller.php @@ -6,7 +6,7 @@ * * @package Modules\Billing\Admin * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -20,7 +20,7 @@ use phpOMS\Module\UninstallerAbstract; * Uninstaller class. * * @package Modules\Billing\Admin - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Admin/Updater.php b/Admin/Updater.php index d9f0c73..0b032cb 100755 --- a/Admin/Updater.php +++ b/Admin/Updater.php @@ -6,7 +6,7 @@ * * @package Modules\Billing\Admin * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -20,7 +20,7 @@ use phpOMS\Module\UpdaterAbstract; * Updater class. * * @package Modules\Billing\Admin - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Controller/ApiAttributeController.php b/Controller/ApiAttributeController.php index 9588b87..6d4d30d 100644 --- a/Controller/ApiAttributeController.php +++ b/Controller/ApiAttributeController.php @@ -1,5 +1,4 @@ bill = (int) $request->getData('bill'); $attribute->type = new NullBillAttributeType((int) $request->getData('type')); - if ($request->getData('value') !== null) { + if ($request->hasData('value')) { $attribute->value = new NullBillAttributeValue((int) $request->getData('value')); } else { $newRequest = clone $request; @@ -162,11 +160,11 @@ final class ApiAttributeController extends Controller private function createBillAttributeTypeL11nFromRequest(RequestAbstract $request) : BaseStringL11n { $attrL11n = new BaseStringL11n(); - $attrL11n->ref = (int) ($request->getData('type') ?? 0); - $attrL11n->setLanguage((string) ( - $request->getData('language') ?? $request->getLanguage() - )); - $attrL11n->content = (string) ($request->getData('title') ?? ''); + $attrL11n->ref = $request->getDataInt('type') ?? 0; + $attrL11n->setLanguage( + $request->getDataString('language') ?? $request->getLanguage() + ); + $attrL11n->content = $request->getDataString('title') ?? ''; return $attrL11n; } @@ -231,13 +229,13 @@ final class ApiAttributeController extends Controller */ private function createBillAttributeTypeFromRequest(RequestAbstract $request) : BillAttributeType { - $attrType = new BillAttributeType($request->getData('name') ?? ''); - $attrType->datatype = (int) ($request->getData('datatype') ?? 0); - $attrType->custom = (bool) ($request->getData('custom') ?? false); + $attrType = new BillAttributeType($request->getDataString('name') ?? ''); + $attrType->datatype = $request->getDataInt('datatype') ?? 0; + $attrType->custom = $request->getDataBool('custom') ?? false; $attrType->isRequired = (bool) ($request->getData('is_required') ?? false); - $attrType->validationPattern = (string) ($request->getData('validation_pattern') ?? ''); - $attrType->setL11n((string) ($request->getData('title') ?? ''), $request->getData('language') ?? ISO639x1Enum::_EN); - $attrType->setFields((int) ($request->getData('fields') ?? 0)); + $attrType->validationPattern = $request->getDataString('validation_pattern') ?? ''; + $attrType->setL11n($request->getDataString('title') ?? '', $request->getDataString('language') ?? ISO639x1Enum::_EN); + $attrType->setFields($request->getDataInt('fields') ?? 0); return $attrType; } @@ -313,15 +311,15 @@ final class ApiAttributeController extends Controller { /** @var BillAttributeType $type */ $type = BillAttributeTypeMapper::get() - ->where('id', (int) ($request->getData('type') ?? 0)) + ->where('id', $request->getDataInt('type') ?? 0) ->execute(); $attrValue = new BillAttributeValue(); - $attrValue->isDefault = (bool) ($request->getData('default') ?? false); + $attrValue->isDefault = $request->getDataBool('default') ?? false; $attrValue->setValue($request->getData('value'), $type->datatype); - if ($request->getData('title') !== null) { - $attrValue->setL11n($request->getData('title'), $request->getData('language') ?? ISO639x1Enum::_EN); + if ($request->hasData('title')) { + $attrValue->setL11n($request->getDataString('title') ?? '', $request->getDataString('language') ?? ISO639x1Enum::_EN); } return $attrValue; @@ -387,11 +385,11 @@ final class ApiAttributeController extends Controller private function createBillAttributeValueL11nFromRequest(RequestAbstract $request) : BaseStringL11n { $attrL11n = new BaseStringL11n(); - $attrL11n->ref = (int) ($request->getData('value') ?? 0); - $attrL11n->setLanguage((string) ( - $request->getData('language') ?? $request->getLanguage() - )); - $attrL11n->content = (string) ($request->getData('title') ?? ''); + $attrL11n->ref = $request->getDataInt('value') ?? 0; + $attrL11n->setLanguage( + $request->getDataString('language') ?? $request->getLanguage() + ); + $attrL11n->content = $request->getDataString('title') ?? ''; return $attrL11n; } diff --git a/Controller/ApiBillController.php b/Controller/ApiBillController.php index def2d61..6877841 100644 --- a/Controller/ApiBillController.php +++ b/Controller/ApiBillController.php @@ -7,7 +7,7 @@ * * @package Modules\Billing * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -48,7 +48,7 @@ use phpOMS\Views\View; * Billing class. * * @package Modules\Billing - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ @@ -169,17 +169,17 @@ final class ApiBillController extends Controller { /** @var \Modules\ClientManagement\Models\Client|\Modules\SupplierManagement\Models\Supplier $account */ $account = null; - if ($request->getData('client') !== null) { + if ($request->hasData('client')) { /** @var \Modules\ClientManagement\Models\Client $account */ $account = ClientMapper::get() ->with('account') ->with('mainAddress') ->where('id', (int) $request->getData('client')) ->execute(); - } elseif (((int) ($request->getData('supplier') ?? -1)) === 0) { + } elseif (($request->getDataInt('supplier') ?? -1) === 0) { /** @var \Modules\SupplierManagement\Models\Supplier $account */ $account = new NullSupplier(); - } elseif ($request->getData('supplier') !== null) { + } elseif ($request->hasData('supplier')) { /** @var \Modules\SupplierManagement\Models\Supplier $account */ $account = SupplierMapper::get() ->with('account') @@ -190,7 +190,7 @@ final class ApiBillController extends Controller /** @var \Modules\Billing\Models\BillType $billType */ $billType = BillTypeMapper::get() - ->where('id', (int) ($request->getData('type') ?? 1)) + ->where('id', $request->getDataInt('type') ?? 1) ->execute(); /* @var \Modules\Account\Models\Account $account */ @@ -214,7 +214,7 @@ final class ApiBillController extends Controller $bill->client = !$request->hasData('client') ? null : $account; $bill->supplier = !$request->hasData('supplier') ? null : $account; $bill->performanceDate = new \DateTime($request->getData('performancedate') ?? 'now'); - $bill->setStatus((int) ($request->getData('status') ?? BillStatus::ACTIVE)); + $bill->setStatus($request->getDataInt('status') ?? BillStatus::ACTIVE); return $bill; } @@ -233,8 +233,8 @@ final class ApiBillController extends Controller $val = []; if (($val['client/supplier'] = (empty($request->getData('client')) && (empty($request->getData('supplier')) - && ((int) ($request->getData('supplier') ?? -1) !== 0) - ))) + && ($request->getDataInt('supplier') ?? -1) !== 0) + )) || ($val['type'] = (empty($request->getData('type')))) ) { return $val; @@ -299,7 +299,7 @@ final class ApiBillController extends Controller $this->createModelRelation( $request->header->account, $media->getId(), - $request->getData('type', 'int'), + $request->getDataInt('type'), MediaMapper::class, 'types', '', @@ -440,7 +440,7 @@ final class ApiBillController extends Controller { $element = new BillElement(); $element->bill = (int) $request->getData('bill'); - $element->item = (int) ($request->getData('item') ?? 0); + $element->item = $request->getDataInt('item') ?? 0; if ($element->item === null) { return $element; @@ -457,9 +457,9 @@ final class ApiBillController extends Controller $element->itemNumber = $item->number; $element->itemName = $item->getL11n('name1')->description; - $element->quantity = (int) ($request->getData('quantity') ?? 0); + $element->quantity = $request->getDataInt('quantity') ?? 0; - $element->singleSalesPriceNet = new Money($request->getData('singlesalespricenet', 'int') ?? $item->salesPrice->getInt()); + $element->singleSalesPriceNet = new Money($request->getDataInt('singlesalespricenet') ?? $item->salesPrice->getInt()); $element->totalSalesPriceNet = clone $element->singleSalesPriceNet; $element->totalSalesPriceNet->mult($element->quantity); @@ -528,6 +528,8 @@ final class ApiBillController extends Controller $templateId = $request->getData('bill_template', 'int'); if ($templateId === null) { $billTypeId = $request->getData('bill_type', 'int'); + + /** @var \Modules\Billing\Models\BillType $billType */ $billType = BillTypeMapper::get() ->where('id', $billTypeId) ->execute(); @@ -535,6 +537,7 @@ final class ApiBillController extends Controller $templateId = $billType->defaultTemplate->getId(); } + /** @var \Modules\Media\Models\Collection $template */ $template = CollectionMapper::get() ->with('sources') ->where('id', $templateId) @@ -547,6 +550,7 @@ final class ApiBillController extends Controller $view = new View($this->app->l11nManager, $request, $response); $view->setTemplate('/' . \substr($template->getSourceByName('bill.pdf.php')->getPath(), 0, -8), 'pdf.php'); + /** @var \Model\Setting[] $settings */ $settings = $this->app->appSettings->get(null, [ AdminSettingsEnum::DEFAULT_TEMPLATES, @@ -556,9 +560,8 @@ final class ApiBillController extends Controller module: 'Admin' ); - $postKey = '::' . $this->app->unitId . ':Admin'; - if ($settings === false) { + /** @var \Model\Setting[] $settings */ $settings = $this->app->appSettings->get(null, [ AdminSettingsEnum::DEFAULT_TEMPLATES, @@ -567,18 +570,18 @@ final class ApiBillController extends Controller unit: null, module: 'Admin' ); - - $postKey = ':::Admin'; } + /** @var \Modules\Media\Models\Collection $defaultTemplates */ $defaultTemplates = CollectionMapper::get() ->with('sources') - ->where('id', (int) $settings[AdminSettingsEnum::DEFAULT_TEMPLATES . $postKey]->content) + ->where('id', (int) $settings[AdminSettingsEnum::DEFAULT_TEMPLATES]->content) ->execute(); + /** @var \Modules\Media\Models\Collection $defaultAssets */ $defaultAssets = CollectionMapper::get() ->with('sources') - ->where('id', (int) $settings[AdminSettingsEnum::DEFAULT_ASSETS . $postKey]->content) + ->where('id', (int) $settings[AdminSettingsEnum::DEFAULT_ASSETS]->content) ->execute(); $view->setData('defaultTemplates', $defaultTemplates); @@ -653,12 +656,14 @@ final class ApiBillController extends Controller /** @var \Modules\Billing\Models\Bill $bill */ $bill = BillMapper::get() ->with('elements') - ->where('id', $request->getData('bill') ?? 0) + ->where('id', $request->getDataInt('bill') ?? 0) ->execute(); - $templateId = $request->getData('bill_template', 'int'); + $templateId = $request->getDataInt('bill_template'); if ($templateId === null) { $billTypeId = $bill->type->getId(); + + /** @var \Modules\Billing\Models\BillType $billType */ $billType = BillTypeMapper::get() ->where('id', $billTypeId) ->execute(); @@ -666,6 +671,7 @@ final class ApiBillController extends Controller $templateId = $billType->defaultTemplate->getId(); } + /** @var \Modules\Media\Models\Collection $template */ $template = CollectionMapper::get() ->with('sources') ->where('id', $templateId) @@ -676,6 +682,7 @@ final class ApiBillController extends Controller $view = new View($this->app->l11nManager, $request, $response); $view->setTemplate('/' . \substr($template->getSourceByName('bill.pdf.php')->getPath(), 0, -8), 'pdf.php'); + /** @var \Model\Setting[] $settings */ $settings = $this->app->appSettings->get(null, [ AdminSettingsEnum::DEFAULT_TEMPLATES, @@ -685,9 +692,8 @@ final class ApiBillController extends Controller module: 'Admin' ); - $postKey = '::' . $this->app->unitId . ':Admin'; - if ($settings === false) { + /** @var \Model\Setting[] $settings */ $settings = $this->app->appSettings->get(null, [ AdminSettingsEnum::DEFAULT_TEMPLATES, @@ -696,18 +702,18 @@ final class ApiBillController extends Controller unit: null, module: 'Admin' ); - - $postKey = ':::Admin'; } + /** @var \Modules\Media\Models\Collection $defaultTemplates */ $defaultTemplates = CollectionMapper::get() ->with('sources') - ->where('id', (int) $settings[AdminSettingsEnum::DEFAULT_TEMPLATES . $postKey]->content) + ->where('id', (int) $settings[AdminSettingsEnum::DEFAULT_TEMPLATES]->content) ->execute(); + /** @var \Modules\Media\Models\Collection $defaultAssets */ $defaultAssets = CollectionMapper::get() ->with('sources') - ->where('id', (int) $settings[AdminSettingsEnum::DEFAULT_ASSETS . $postKey]->content) + ->where('id', (int) $settings[AdminSettingsEnum::DEFAULT_ASSETS]->content) ->execute(); $view->setData('defaultTemplates', $defaultTemplates); diff --git a/Controller/ApiBillTypeController.php b/Controller/ApiBillTypeController.php index b57d5b9..ef057f4 100644 --- a/Controller/ApiBillTypeController.php +++ b/Controller/ApiBillTypeController.php @@ -7,7 +7,7 @@ * * @package Modules\Billing * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -33,7 +33,7 @@ use phpOMS\Model\Message\FormValidation; * Billing class. * * @package Modules\Billing - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ @@ -78,12 +78,12 @@ final class ApiBillTypeController extends Controller */ private function createBillTypeFromRequest(RequestAbstract $request) : BillType { - $billType = new BillType($request->getData('name') ?? ''); - $billType->setL11n((string) ($request->getData('title') ?? ''), $request->getData('language') ?? ISO639x1Enum::_EN); - $billType->numberFormat = (string) ($request->getData('number_format') ?? '{id}'); - $billType->transferStock = (bool) ($request->getData('transfer_stock') ?? false); - $billType->isTemplate = (bool) ($request->getData('is_template') ?? false); - $billType->transferType = (int) ($request->getData('transfer_type') ?? BillTransferType::SALES); + $billType = new BillType($request->getDataString('name') ?? ''); + $billType->setL11n($request->getDataString('title') ?? '', $request->getDataString('language') ?? ISO639x1Enum::_EN); + $billType->numberFormat = (string) ($request->getData('number_format') ?? '{id}'); + $billType->transferStock = (bool) ($request->getData('transfer_stock') ?? false); + $billType->isTemplate = (bool) ($request->getData('is_template') ?? false); + $billType->transferType = $request->getDataInt('transfer_type') ?? BillTransferType::SALES; $billType->defaultTemplate = $request->hasData('template') ? new NullCollection((int) $request->getData('template')) : null; @@ -155,11 +155,11 @@ final class ApiBillTypeController extends Controller private function createBillTypeL11nFromRequest(RequestAbstract $request) : BaseStringL11n { $billTypeL11n = new BaseStringL11n(); - $billTypeL11n->ref = (int) ($request->getData('type') ?? 0); - $billTypeL11n->setLanguage((string) ( - $request->getData('language') ?? $request->getLanguage() - )); - $billTypeL11n->content = (string) ($request->getData('title') ?? ''); + $billTypeL11n->ref = $request->getDataInt('type') ?? 0; + $billTypeL11n->setLanguage( + $request->getDataString('language') ?? $request->getLanguage() + ); + $billTypeL11n->content = $request->getDataString('title') ?? ''; return $billTypeL11n; } diff --git a/Controller/ApiController.php b/Controller/ApiController.php index 003a28a..351877d 100755 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -7,7 +7,7 @@ * * @package Modules\Billing * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -23,7 +23,7 @@ use phpOMS\Message\ResponseAbstract; * Billing class. * * @package Modules\Billing - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Controller/ApiPriceController.php b/Controller/ApiPriceController.php index 35d5861..781daa7 100644 --- a/Controller/ApiPriceController.php +++ b/Controller/ApiPriceController.php @@ -7,7 +7,7 @@ * * @package Modules\Billing * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -40,7 +40,7 @@ use phpOMS\System\MimeType; * Billing class. * * @package Modules\Billing - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ @@ -62,8 +62,10 @@ final class ApiPriceController extends Controller public function apiPricingFind(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void { // Get item + /** @var null|\Modules\ItemManagement\Models\Item $item */ $item = null; if ($request->hasData('price_item')) { + /** @var null|\Modules\ItemManagement\Models\Item $item */ $item = ItemMapper::get() ->with('attributes') ->with('attributes/type') @@ -73,6 +75,7 @@ final class ApiPriceController extends Controller } // Get account + /** @var null|\Modules\ClientManagement\Models\Client|\Modules\SupplierManagement\Models\Supplier $account */ $account = null; /** @var null|\Modules\ClientManagement\Models\Client $client */ @@ -82,20 +85,24 @@ final class ApiPriceController extends Controller $supplier = null; if ($request->hasData('price_client')) { + /** @var null|\Modules\ClientManagement\Models\Client $client */ $client = ClientMapper::get() ->with('attributes/type') ->with('attributes/value') ->where('id', (int) $request->getData('price_client')) ->execute(); + /** @var null|\Modules\ClientManagement\Models\Client|\Modules\SupplierManagement\Models\Supplier $account */ $account = $client; } else { + /** @var null|\Modules\SupplierManagement\Models\Supplier $supplier */ $supplier = SupplierMapper::get() ->with('attributes/type') ->with('attributes/value') ->where('id', (int) $request->getData('price_supplier')) ->execute(); + /** @var null|\Modules\ClientManagement\Models\Client|\Modules\SupplierManagement\Models\Supplier $account */ $account = $supplier; } @@ -140,6 +147,7 @@ final class ApiPriceController extends Controller } */ + /** @var \Modules\Billing\Models\Price\Price[] $prices */ $prices = $queryMapper->execute(); // Find base price (@todo: probably not a good solution) @@ -158,7 +166,7 @@ final class ApiPriceController extends Controller && $price->clienttype->getId() === 0 && $price->promocode === '' ) { - if ($price->price < $bestBasePrice?->price ?? \PHP_INT_MAX) { + if ($price->price < ($bestBasePrice?->price ?? \PHP_INT_MAX)) { $bestBasePrice = $price; } } @@ -167,7 +175,7 @@ final class ApiPriceController extends Controller // @todo: implement prices which cannot be improved even if there are better prices available (i.e. some customer groups may not get better prices, Dentagen Beispiel) // alternatively set prices as 'improvable' => which whitelists a price as can be improved or 'alwaysimproces' which always overwrites other prices // Find best price - $bestPrice = null; + $bestPrice = null; $bestPriceValue = \PHP_INT_MAX; foreach ($prices as $price) { @@ -251,35 +259,35 @@ final class ApiPriceController extends Controller */ private function createPriceFromRequest(RequestAbstract $request) : Price { - $price = new Price(); - $price->name = $request->getData('name') ?? ''; - $price->promocode = $request->getData('promocode') ?? ''; + $price = new Price(); + $price->name = $request->getDataString('name') ?? ''; + $price->promocode = $request->getDataString('promocode') ?? ''; - $price->item = new NullItem((int) $request->getData('item')); - $price->itemgroup = new NullItemAttributeValue((int) $request->getData('itemgroup')); + $price->item = new NullItem((int) $request->getData('item')); + $price->itemgroup = new NullItemAttributeValue((int) $request->getData('itemgroup')); $price->itemsegment = new NullItemAttributeValue((int) $request->getData('itemsegment')); $price->itemsection = new NullItemAttributeValue((int) $request->getData('itemsection')); - $price->itemtype = new NullItemAttributeValue((int) $request->getData('itemtype')); + $price->itemtype = new NullItemAttributeValue((int) $request->getData('itemtype')); - $price->client = new NullClient((int) $request->getData('client')); - $price->clientgroup = new NullClientAttributeValue((int) $request->getData('clientgroup')); + $price->client = new NullClient((int) $request->getData('client')); + $price->clientgroup = new NullClientAttributeValue((int) $request->getData('clientgroup')); $price->clientsegment = new NullClientAttributeValue((int) $request->getData('clientsegment')); $price->clientsection = new NullClientAttributeValue((int) $request->getData('clientsection')); - $price->clienttype = new NullClientAttributeValue((int) $request->getData('clienttype')); + $price->clienttype = new NullClientAttributeValue((int) $request->getData('clienttype')); - $price->supplier = new NullSupplier((int) $request->getData('supplier')); - $price->unit = (int) $request->getData('unit'); - $price->type = (int) ($request->getData('type') ?? PriceType::SALES); - $price->quantity = (int) $request->getData('quantity'); - $price->price = (int) $request->getData('price'); - $price->priceNew = (int) $request->getData('price_name'); - $price->discount = (int) $request->getData('discount'); + $price->supplier = new NullSupplier((int) $request->getData('supplier')); + $price->unit = (int) $request->getData('unit'); + $price->type = $request->getDataInt('type') ?? PriceType::SALES; + $price->quantity = (int) $request->getData('quantity'); + $price->price = (int) $request->getData('price'); + $price->priceNew = (int) $request->getData('price_name'); + $price->discount = (int) $request->getData('discount'); $price->discountPercentage = (int) $request->getData('discountPercentage'); - $price->bonus = (int) $request->getData('bonus'); - $price->multiply = (bool) ($request->getData('multiply') ?? false); - $price->currency = $request->getData('currency') ?? ISO4217CharEnum::_EUR; - $price->start = $request->hasData('start') ? new \DateTime($request->getData('start')) : null; - $price->end = $request->hasData('end') ? new \DateTime($request->getData('end')) : null; + $price->bonus = (int) $request->getData('bonus'); + $price->multiply = $request->getDataBool('multiply') ?? false; + $price->currency = $request->getData('currency') ?? ISO4217CharEnum::_EUR; + $price->start = $request->hasData('start') ? new \DateTime($request->getData('start')) : null; + $price->end = $request->hasData('end') ? new \DateTime($request->getData('end')) : null; return $price; } diff --git a/Controller/ApiPurchaseController.php b/Controller/ApiPurchaseController.php index d2592db..20109d6 100644 --- a/Controller/ApiPurchaseController.php +++ b/Controller/ApiPurchaseController.php @@ -7,7 +7,7 @@ * * @package Modules\Billing * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -33,7 +33,7 @@ use phpOMS\Uri\HttpUri; * Billing class. * * @package Modules\Billing - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ @@ -54,10 +54,10 @@ final class ApiPurchaseController extends Controller */ public function apiSupplierBillUpload(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void { - $originalType = (int) ($request->getData('type') ?? $this->app->appSettings->get( + $originalType = $request->getDataInt('type') ?? (int) $this->app->appSettings->get( names: SettingsEnum::ORIGINAL_MEDIA_TYPE, module: self::NAME - )->content); + )->content; /** @var \Modules\Billing\Models\BillType $purchaseTransferType */ $purchaseTransferType = BillTypeMapper::get() @@ -103,8 +103,6 @@ final class ApiPurchaseController extends Controller throw new \Exception(); } - // @todo: Parse text and analyze text structure - // Create internal document $billResponse = new HttpResponse(); $billRequest = new HttpRequest(new HttpUri('')); diff --git a/Controller/ApiTaxController.php b/Controller/ApiTaxController.php index 1ed423a..5ebea00 100644 --- a/Controller/ApiTaxController.php +++ b/Controller/ApiTaxController.php @@ -7,7 +7,7 @@ * * @package Modules\Billing * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -36,7 +36,7 @@ use phpOMS\Model\Message\FormValidation; * Billing class. * * @package Modules\Billing - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ @@ -68,9 +68,9 @@ final class ApiTaxController extends Controller */ private function createTaxCombinationFromRequest(RequestAbstract $request) : TaxCombination { - $tax = new TaxCombination(); - $tax->taxType = (int) $request->getData('tax_type') ?? 1; - $tax->taxCode = (string) $request->getData('tax_code'); + $tax = new TaxCombination(); + $tax->taxType = $request->getDataInt('tax_type') ?? 1; + $tax->taxCode = (string) $request->getData('tax_code'); $tax->itemCode = new NullItemAttributeValue((int) $request->getData('item_code')); if ($tax->taxType === 1) { @@ -107,6 +107,7 @@ final class ApiTaxController extends Controller public function getClientTaxCode(Client $client, Address $taxOfficeAddress) : ClientAttributeValue { + /** @var \Modules\ClientManagement\Models\ClientAttributeType $codes */ $codes = ClientAttributeTypeMapper::get() ->with('defaults') ->where('name', 'sales_tax_code') @@ -136,4 +137,4 @@ final class ApiTaxController extends Controller return $taxCode; } -} \ No newline at end of file +} diff --git a/Controller/BackendController.php b/Controller/BackendController.php index 7dbd9d4..3abcdd3 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -6,7 +6,7 @@ * * @package Modules\Billing * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -38,7 +38,7 @@ use phpOMS\Views\View; * Billing class. * * @package Modules\Billing - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 * @codeCoverageIgnore @@ -74,14 +74,14 @@ final class BackendController extends Controller if ($request->getData('ptype') === 'p') { $view->setData('bills', $mapperQuery - ->where('id', (int) ($request->getData('id') ?? 0), '<') + ->where('id', $request->getDataInt('id') ?? 0, '<') ->where('client', null, '!=') ->where('type/l11n/language', $response->getLanguage()) ->execute() ); } elseif ($request->getData('ptype') === 'n') { $view->setData('bills', - $mapperQuery->where('id', (int) ($request->getData('id') ?? 0), '>') + $mapperQuery->where('id', $request->getDataInt('id') ?? 0, '>') ->where('client', null, '!=') ->where('type/l11n/language', $response->getLanguage()) ->execute() @@ -116,6 +116,7 @@ final class BackendController extends Controller $view->setTemplate('/Modules/Billing/Theme/Backend/bill-create'); $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1005104001, $request, $response)); + /** @var \Modules\Billing\Models\Bill $bill */ $bill = SalesBillMapper::get() ->with('elements') ->with('media') @@ -251,14 +252,14 @@ final class BackendController extends Controller if ($request->getData('ptype') === 'p') { $view->setData('bills', $mapperQuery - ->where('id', (int) ($request->getData('id') ?? 0), '<') + ->where('id', $request->getDataInt('id') ?? 0, '<') ->where('supplier', null, '!=') ->where('type/l11n/language', $response->getLanguage()) ->execute() ); } elseif ($request->getData('ptype') === 'n') { $view->setData('bills', - $mapperQuery->where('id', (int) ($request->getData('id') ?? 0), '>') + $mapperQuery->where('id', $request->getDataInt('id') ?? 0, '>') ->where('supplier', null, '!=') ->where('type/l11n/language', $response->getLanguage()) ->execute() @@ -342,11 +343,11 @@ final class BackendController extends Controller if ($request->getData('ptype') === 'p') { $view->setData('bills', - StockBillMapper::getAll()->where('id', (int) ($request->getData('id') ?? 0), '<')->limit(25)->execute() + StockBillMapper::getAll()->where('id', $request->getDataInt('id') ?? 0, '<')->limit(25)->execute() ); } elseif ($request->getData('ptype') === 'n') { $view->setData('bills', - StockBillMapper::getAll()->where('id', (int) ($request->getData('id') ?? 0), '>')->limit(25)->execute() + StockBillMapper::getAll()->where('id', $request->getDataInt('id') ?? 0, '>')->limit(25)->execute() ); } else { $view->setData('bills', @@ -762,13 +763,13 @@ final class BackendController extends Controller if ($request->getData('ptype') === 'p') { $view->setData('bills', $mapperQuery - ->where('id', (int) ($request->getData('id') ?? 0), '<') + ->where('id', $request->getDataInt('id') ?? 0, '<') ->where('type/l11n/language', $response->getLanguage()) ->execute() ); } elseif ($request->getData('ptype') === 'n') { $view->setData('bills', - $mapperQuery->where('id', (int) ($request->getData('id') ?? 0), '>') + $mapperQuery->where('id', $request->getDataInt('id') ?? 0, '>') ->where('type/l11n/language', $response->getLanguage()) ->execute() ); diff --git a/Controller/CliController.php b/Controller/CliController.php index 90ff7a7..9f8188f 100644 --- a/Controller/CliController.php +++ b/Controller/CliController.php @@ -6,7 +6,7 @@ * * @package Modules\Billing * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -33,7 +33,7 @@ use phpOMS\Views\View; * Billing controller class. * * @package Modules\Billing - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ @@ -53,10 +53,10 @@ final class CliController extends Controller */ public function cliParseSupplierBill(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface { - $originalType = (int) ($request->getData('type') ?? $this->app->appSettings->get( + $originalType = $request->getDataInt('type') ?? (int) $this->app->appSettings->get( names: SettingsEnum::ORIGINAL_MEDIA_TYPE, module: self::NAME - )->content); + )->content; /** @var \Modules\Billing\Models\Bill $bill */ $bill = BillMapper::get() @@ -72,12 +72,18 @@ final class CliController extends Controller $content = \strtolower($bill->getFileByType($originalType)->content->content ?? ''); $lines = \explode("\n", $content); - $language = $this->detectLanguage($content); + $language = $this->detectLanguage($content); $bill->language = $language; - $identifiers = \json_decode(\file_get_contents(__DIR__ . '/../Models/billIdentifier.json'), true); + $identifierContent = \file_get_contents(__DIR__ . '/../Models/billIdentifier.json'); + if ($identifierContent === false) { + $identifierContent = '{}'; + } + + $identifiers = \json_decode($identifierContent, true); /* Supplier */ + /** @var \Modules\SupplierManagement\Models\Supplier[] $suppliers */ $suppliers = SupplierMapper::getAll() ->with('account') ->with('mainAddress') @@ -89,17 +95,20 @@ final class CliController extends Controller $bill->supplier = new NullSupplier($supplierId); $supplier = $suppliers[$supplierId] ?? new NullSupplier(); - $bill->billTo = $supplier->account->name1; + $bill->billTo = $supplier->account->name1; $bill->billAddress = $supplier->mainAddress->address; - $bill->billCity = $supplier->mainAddress->city; - $bill->billZip = $supplier->mainAddress->postal; + $bill->billCity = $supplier->mainAddress->city; + $bill->billZip = $supplier->mainAddress->postal; $bill->billCountry = $supplier->mainAddress->getCountry(); /* Type */ $type = $this->findSupplierInvoiceType($content, $identifiers['type'], $language); + + /** @var \Modules\Billing\Models\BillType $billTye */ $billType = BillTypeMapper::get() ->where('name', $type) ->execute(); + $bill->type = new NullBillType($billType->getId()); /* Number */ @@ -125,6 +134,15 @@ final class CliController extends Controller return $view; } + /** + * Detect language from content + * + * @param string $content String to analyze + * + * @return string + * + * @since 1.0.0 + */ private function detectLanguage(string $content) : string { $detector = new Language(); @@ -137,6 +155,17 @@ final class CliController extends Controller return \substr(\array_keys($language)[0], 0, 2); } + /** + * Detect the supplier bill type + * + * @param string $content String to analyze + * @param array $types Possible bill types + * @param string $language Bill language + * + * @return string + * + * @since 1.0.0 + */ private function findSupplierInvoiceType(string $content, array $types, string $language) : string { $bestPos = \strlen($content); @@ -156,6 +185,16 @@ final class CliController extends Controller return empty($bestMatch) ? 'purchase_invoice' : $bestMatch; } + /** + * Detect the supplier bill number + * + * @param string[] $lines Bill lines + * @param array $matches Number match patterns + * + * @return string + * + * @since 1.0.0 + */ private function findBillNumber(array $lines, array $matches) : string { $bestPos = \count($lines); @@ -167,7 +206,7 @@ final class CliController extends Controller foreach ($lines as $row => $line) { if (\preg_match($match, $line, $found) === 1) { if ($row < $bestPos) { - $bestPos = $row; + $bestPos = $row; $bestMatch = \trim($found['bill_no']); } @@ -179,6 +218,16 @@ final class CliController extends Controller return $bestMatch; } + /** + * Detect the supplier bill due date + * + * @param string[] $lines Bill lines + * @param array $matches Due match patterns + * + * @return string + * + * @since 1.0.0 + */ private function findBillDue(array $lines, array $matches) : string { $bestPos = \count($lines); @@ -190,8 +239,8 @@ final class CliController extends Controller foreach ($lines as $row => $line) { if (\preg_match($match, $line, $found) === 1) { if ($row < $bestPos) { - // @question: don't many invoices have the due date at the bottom? bestPos doesn't make sense?! - $bestPos = $row; + // @todo: don't many invoices have the due date at the bottom? bestPos doesn't make sense?! + $bestPos = $row; $bestMatch = \trim($found['bill_due']); } @@ -203,6 +252,16 @@ final class CliController extends Controller return $bestMatch; } + /** + * Detect the supplier bill date + * + * @param string[] $lines Bill lines + * @param array $matches Date match patterns + * + * @return string + * + * @since 1.0.0 + */ private function findBillDate(array $lines, array $matches) : string { $bestPos = \count($lines); @@ -226,6 +285,16 @@ final class CliController extends Controller return $bestMatch; } + /** + * Detect the supplier bill gross amount + * + * @param string[] $lines Bill lines + * @param array $matches Gross match patterns + * + * @return string + * + * @since 1.0.0 + */ private function findBillGross(array $lines, array $matches) : int { $bestMatch = 0; @@ -257,19 +326,52 @@ final class CliController extends Controller return $bestMatch; } + /** + * Find possible supplier id + * + * Priorities: + * 1. bill_match_pattern + * 2. name1 + iban + * 3. name1 + city || address + * 4. name1 + * + * @param string $content Content to analyze + * @param Supplier[] $suppliers Suppliers + * + * @return int + * + * @todo: This can be optimized by a lot!!! + * + * @since 1.0.0 + */ private function matchSupplier(string $content, array $suppliers) : int { $bestMatch = 0; + // bill_match_pattern foreach ($suppliers as $supplier) { - if ((!empty($supplier->getAttributeByTypeName('iban')->value->valueStr) - && \stripos($content, $supplier->getAttributeByTypeName('iban')->value->valueStr) !== false) - || (!empty($supplier->getAttributeByTypeName('bill_match_pattern')->value->valueStr) + // @todo: consider to support regex? + if ((!empty($supplier->getAttributeByTypeName('bill_match_pattern')->value->valueStr) && \stripos($content, $supplier->getAttributeByTypeName('bill_match_pattern')->value->valueStr) !== false) ) { return $supplier->getId(); } + } + // name1 + iban + foreach ($suppliers as $supplier) { + if (\stripos($content, $supplier->account->name1) !== false) { + $ibans = $supplier->getPaymentsByType(PaymentType::SWIFT); + foreach ($ibans as $iban) { + if (\stripos($content, $iban->content2) !== false) { + return $supplier->getId(); + } + } + } + } + + // name1 + city || address + foreach ($suppliers as $supplier) { if (\stripos($content, $supplier->account->name1) !== false) { if ((!empty($supplier->mainAddress->city) && \stripos($content, $supplier->mainAddress->city) !== false) @@ -278,14 +380,30 @@ final class CliController extends Controller ) { return $supplier->getId(); } + } + } - $bestMatch = $supplier->getId(); + // name1 + foreach ($suppliers as $supplier) { + if (\stripos($content, $supplier->account->name1) !== false) { + return $supplier->getId(); } } return $bestMatch; } + /** + * Create DateTime from date string + * + * @param string $date Date string + * @param Supplier $supplier Supplier + * @param string[] $formats Date formats + * + * @return null|\DateTime + * + * @since 1.0.0 + */ private function parseDate(string $date, Supplier $supplier, array $formats) : ?\DateTime { if ((!empty($supplier->getAttributeByTypeName('bill_date_format')->value->valueStr))) { diff --git a/Controller/Controller.php b/Controller/Controller.php index 4cc854c..86c389d 100755 --- a/Controller/Controller.php +++ b/Controller/Controller.php @@ -6,7 +6,7 @@ * * @package Modules\Billing * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -21,7 +21,7 @@ use phpOMS\Module\WebInterface; * Billing class. * * @package Modules\Billing - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Models/Attribute/AttributeValueType.php b/Models/Attribute/AttributeValueType.php index fc933d7..b6b4780 100755 --- a/Models/Attribute/AttributeValueType.php +++ b/Models/Attribute/AttributeValueType.php @@ -6,7 +6,7 @@ * * @package Modules\Billing\Models\Attribute * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -20,7 +20,7 @@ use phpOMS\Stdlib\Base\Enum; * Attribute value type enum. * * @package Modules\Billing\Models\Attribute - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Models/Attribute/BillAttribute.php b/Models/Attribute/BillAttribute.php index c03638f..e2c01c3 100755 --- a/Models/Attribute/BillAttribute.php +++ b/Models/Attribute/BillAttribute.php @@ -6,7 +6,7 @@ * * @package Modules\Billing\Models\Attribute * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -18,7 +18,7 @@ namespace Modules\Billing\Models\Attribute; * Bill class. * * @package Modules\Billing\Models\Attribute - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Models/Attribute/BillAttributeMapper.php b/Models/Attribute/BillAttributeMapper.php index 1f1d998..5b34b5f 100755 --- a/Models/Attribute/BillAttributeMapper.php +++ b/Models/Attribute/BillAttributeMapper.php @@ -6,7 +6,7 @@ * * @package Modules\Billing\Models\Attribute * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -20,7 +20,7 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory; * Bill mapper class. * * @package Modules\Billing\Models\Attribute - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Models/Attribute/BillAttributeType.php b/Models/Attribute/BillAttributeType.php index 6aa4a1d..e09757e 100755 --- a/Models/Attribute/BillAttributeType.php +++ b/Models/Attribute/BillAttributeType.php @@ -6,7 +6,7 @@ * * @package Modules\Billing\Models\Attribute * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -21,7 +21,7 @@ use phpOMS\Localization\ISO639x1Enum; * Bill Attribute Type class. * * @package Modules\Billing\Models\Attribute - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ @@ -143,7 +143,7 @@ class BillAttributeType implements \JsonSerializable if ($l11n instanceof BaseStringL11n) { $this->l11n = $l11n; } elseif (isset($this->l11n) && $this->l11n instanceof BaseStringL11n) { - $this->l11n->content = $l11n; + $this->l11n->content = $l11n; $this->l11n->setLanguage($lang); } else { $this->l11n = new BaseStringL11n(); diff --git a/Models/Attribute/BillAttributeTypeL11nMapper.php b/Models/Attribute/BillAttributeTypeL11nMapper.php index 6b79741..daa4aed 100755 --- a/Models/Attribute/BillAttributeTypeL11nMapper.php +++ b/Models/Attribute/BillAttributeTypeL11nMapper.php @@ -6,7 +6,7 @@ * * @package Modules\Billing\Models\Attribute * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -21,7 +21,7 @@ use phpOMS\Localization\BaseStringL11n; * Bill mapper class. * * @package Modules\Billing\Models\Attribute - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Models/Attribute/BillAttributeTypeMapper.php b/Models/Attribute/BillAttributeTypeMapper.php index b48b289..ac44163 100755 --- a/Models/Attribute/BillAttributeTypeMapper.php +++ b/Models/Attribute/BillAttributeTypeMapper.php @@ -6,7 +6,7 @@ * * @package Modules\Billing\Models\Attribute * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -20,7 +20,7 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory; * Bill mapper class. * * @package Modules\Billing\Models\Attribute - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Models/Attribute/BillAttributeValue.php b/Models/Attribute/BillAttributeValue.php index 9e567fe..aa3855e 100755 --- a/Models/Attribute/BillAttributeValue.php +++ b/Models/Attribute/BillAttributeValue.php @@ -6,7 +6,7 @@ * * @package Modules\Billing\Models\Attribute * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -23,7 +23,7 @@ use phpOMS\Localization\ISO639x1Enum; * The relation with the type/bill is defined in the BillAttribute class. * * @package Modules\Billing\Models\Attribute - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ @@ -135,7 +135,7 @@ class BillAttributeValue implements \JsonSerializable if ($l11n instanceof BaseStringL11n) { $this->l11n = $l11n; } elseif (isset($this->l11n) && $this->l11n instanceof BaseStringL11n) { - $this->l11n->content = $l11n; + $this->l11n->content = $l11n; $this->l11n->setLanguage($lang); } else { $this->l11n = new BaseStringL11n(); diff --git a/Models/Attribute/BillAttributeValueL11nMapper.php b/Models/Attribute/BillAttributeValueL11nMapper.php index e25a87c..a0748a4 100755 --- a/Models/Attribute/BillAttributeValueL11nMapper.php +++ b/Models/Attribute/BillAttributeValueL11nMapper.php @@ -6,7 +6,7 @@ * * @package Modules\Billing\Models\Attribute * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -21,7 +21,7 @@ use phpOMS\Localization\BaseStringL11n; * Bill mapper class. * * @package Modules\Billing\Models\Attribute - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Models/Attribute/BillAttributeValueMapper.php b/Models/Attribute/BillAttributeValueMapper.php index 66a773a..92e8090 100755 --- a/Models/Attribute/BillAttributeValueMapper.php +++ b/Models/Attribute/BillAttributeValueMapper.php @@ -6,7 +6,7 @@ * * @package Modules\Billing\Models\Attribute * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -20,7 +20,7 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory; * Bill mapper class. * * @package Modules\Billing\Models\Attribute - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Models/Attribute/NullBillAttribute.php b/Models/Attribute/NullBillAttribute.php index 38fb1fd..2f2a716 100755 --- a/Models/Attribute/NullBillAttribute.php +++ b/Models/Attribute/NullBillAttribute.php @@ -6,7 +6,7 @@ * * @package Modules\Billing\Models\Attribute * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -18,7 +18,7 @@ namespace Modules\Billing\Models\Attribute; * Null model * * @package Modules\Billing\Models\Attribute - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Models/Attribute/NullBillAttributeType.php b/Models/Attribute/NullBillAttributeType.php index 80ac220..04e178c 100755 --- a/Models/Attribute/NullBillAttributeType.php +++ b/Models/Attribute/NullBillAttributeType.php @@ -6,7 +6,7 @@ * * @package Modules\Billing\Models\Attribute * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -18,7 +18,7 @@ namespace Modules\Billing\Models\Attribute; * Null model * * @package Modules\Billing\Models\Attribute - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Models/Attribute/NullBillAttributeValue.php b/Models/Attribute/NullBillAttributeValue.php index 1908b5e..4f9f338 100755 --- a/Models/Attribute/NullBillAttributeValue.php +++ b/Models/Attribute/NullBillAttributeValue.php @@ -6,7 +6,7 @@ * * @package Modules\Billing\Models\Attribute * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -18,7 +18,7 @@ namespace Modules\Billing\Models\Attribute; * Null model * * @package Modules\Billing\Models\Attribute - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Models/Bill.php b/Models/Bill.php index 0d8c0b3..fb86744 100755 --- a/Models/Bill.php +++ b/Models/Bill.php @@ -6,7 +6,7 @@ * * @package Modules\Billing\Models * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -31,7 +31,7 @@ use phpOMS\Localization\Money; * Bill class. * * @package Modules\Billing\Models - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Models/BillElement.php b/Models/BillElement.php index ad855c0..52e7ac6 100755 --- a/Models/BillElement.php +++ b/Models/BillElement.php @@ -6,7 +6,7 @@ * * @package Modules\Billing\Models * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -21,7 +21,7 @@ use phpOMS\Stdlib\Base\FloatInt; * Bill class. * * @package Modules\Billing\Models - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Models/BillElementMapper.php b/Models/BillElementMapper.php index 9b6eb3a..aed3691 100755 --- a/Models/BillElementMapper.php +++ b/Models/BillElementMapper.php @@ -6,7 +6,7 @@ * * @package Modules\Billing\Models * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -20,7 +20,7 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory; * Mapper class. * * @package Modules\Billing\Models - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Models/BillMapper.php b/Models/BillMapper.php index 2db1da6..a946c90 100755 --- a/Models/BillMapper.php +++ b/Models/BillMapper.php @@ -6,7 +6,7 @@ * * @package Modules\Billing\Models * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -27,7 +27,7 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory; * Mapper class. * * @package Modules\Billing\Models - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Models/BillStatus.php b/Models/BillStatus.php index fc3ef0a..3d9ae4c 100755 --- a/Models/BillStatus.php +++ b/Models/BillStatus.php @@ -6,7 +6,7 @@ * * @package Modules\Billing\Models * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -20,7 +20,7 @@ use phpOMS\Stdlib\Base\Enum; * Bill status enum. * * @package Modules\Billing\Models - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Models/BillTransferType.php b/Models/BillTransferType.php index 8c51c7d..f738c81 100755 --- a/Models/BillTransferType.php +++ b/Models/BillTransferType.php @@ -6,7 +6,7 @@ * * @package Modules\Billing\Models * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -20,7 +20,7 @@ use phpOMS\Stdlib\Base\Enum; * Bill transfer type enum. * * @package Modules\Billing\Models - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Models/BillType.php b/Models/BillType.php index 4a42242..d952b22 100755 --- a/Models/BillType.php +++ b/Models/BillType.php @@ -6,7 +6,7 @@ * * @package Modules\Billing\Models * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -23,7 +23,7 @@ use phpOMS\Localization\ISO639x1Enum; * Bill type enum. * * @package Modules\Billing\Models - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Models/BillTypeL11nMapper.php b/Models/BillTypeL11nMapper.php index 64ab458..b7c6b73 100755 --- a/Models/BillTypeL11nMapper.php +++ b/Models/BillTypeL11nMapper.php @@ -6,7 +6,7 @@ * * @package Modules\Billing\Models * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -21,7 +21,7 @@ use phpOMS\Localization\BaseStringL11n; * Bill type mapper class. * * @package Modules\Billing\Models - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Models/BillTypeMapper.php b/Models/BillTypeMapper.php index dcda8e3..a0bc70d 100755 --- a/Models/BillTypeMapper.php +++ b/Models/BillTypeMapper.php @@ -6,7 +6,7 @@ * * @package Modules\Billing\Models * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -22,7 +22,7 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory; * Billing mapper class. * * @package Modules\Billing\Models - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Models/NullBill.php b/Models/NullBill.php index d131002..576314a 100644 --- a/Models/NullBill.php +++ b/Models/NullBill.php @@ -6,7 +6,7 @@ * * @package Modules\Billing\Models * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -18,7 +18,7 @@ namespace Modules\Billing\Models; * Null bill class. * * @package Modules\Billing\Models - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Models/NullBillElement.php b/Models/NullBillElement.php index d538662..ea7c3c3 100755 --- a/Models/NullBillElement.php +++ b/Models/NullBillElement.php @@ -6,7 +6,7 @@ * * @package Modules\Billing\Models * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -18,7 +18,7 @@ namespace Modules\Billing\Models; * Null bill element class. * * @package Modules\Billing\Models - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Models/NullBillType.php b/Models/NullBillType.php index 211d2c2..53c9681 100755 --- a/Models/NullBillType.php +++ b/Models/NullBillType.php @@ -6,7 +6,7 @@ * * @package Modules\Billing\Models * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -18,7 +18,7 @@ namespace Modules\Billing\Models; * Null bill type class. * * @package Modules\Billing\Models - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Models/PermissionCategory.php b/Models/PermissionCategory.php index 3fec045..b3d0bdd 100755 --- a/Models/PermissionCategory.php +++ b/Models/PermissionCategory.php @@ -6,7 +6,7 @@ * * @package Modules\Billing\Models * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -20,7 +20,7 @@ use phpOMS\Stdlib\Base\Enum; * Permision state enum. * * @package Modules\Billing\Models - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Models/Price/NullPrice.php b/Models/Price/NullPrice.php index dfaf774..b647f2e 100644 --- a/Models/Price/NullPrice.php +++ b/Models/Price/NullPrice.php @@ -6,7 +6,7 @@ * * @package Modules\Billing\Models\Price * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -18,7 +18,7 @@ namespace Modules\Billing\Models\Price; * Null bill type class. * * @package Modules\Billing\Models\Price - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Models/Price/Price.php b/Models/Price/Price.php index f2fe414..92bebb4 100644 --- a/Models/Price/Price.php +++ b/Models/Price/Price.php @@ -6,7 +6,7 @@ * * @package Modules\Billing\Models\Price * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -30,7 +30,7 @@ use phpOMS\Localization\ISO4217CharEnum; * Bill class. * * @package Modules\Billing\Models\Price - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Models/Price/PriceMapper.php b/Models/Price/PriceMapper.php index a2aa306..4eaef80 100644 --- a/Models/Price/PriceMapper.php +++ b/Models/Price/PriceMapper.php @@ -6,7 +6,7 @@ * * @package Modules\Billing\Models\Price * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -26,7 +26,7 @@ use phpOMS\Localization\Defaults\CountryMapper; * Billing mapper class. * * @package Modules\Billing\Models\Price - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Models/Price/PriceType.php b/Models/Price/PriceType.php index c3c8c42..5bd8a05 100644 --- a/Models/Price/PriceType.php +++ b/Models/Price/PriceType.php @@ -6,7 +6,7 @@ * * @package Modules\Billing\Models\Price * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -20,7 +20,7 @@ use phpOMS\Stdlib\Base\Enum; * Module settings enum. * * @package Modules\Billing\Models\Price - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Models/PurchaseBillMapper.php b/Models/PurchaseBillMapper.php index 7f6d6c2..28cda96 100755 --- a/Models/PurchaseBillMapper.php +++ b/Models/PurchaseBillMapper.php @@ -6,7 +6,7 @@ * * @package Modules\Billing\Models * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -23,7 +23,7 @@ use phpOMS\Localization\Money; * Mapper class. * * @package Modules\Billing\Models - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Models/SalesBillMapper.php b/Models/SalesBillMapper.php index 1422226..bdd9bb4 100755 --- a/Models/SalesBillMapper.php +++ b/Models/SalesBillMapper.php @@ -6,7 +6,7 @@ * * @package Modules\Billing\Models * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -23,7 +23,7 @@ use phpOMS\Localization\Money; * Mapper class. * * @package Modules\Billing\Models - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Models/SettingsEnum.php b/Models/SettingsEnum.php index 8208ae6..8fa0992 100755 --- a/Models/SettingsEnum.php +++ b/Models/SettingsEnum.php @@ -6,7 +6,7 @@ * * @package Modules\Billing\Models * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -20,7 +20,7 @@ use phpOMS\Stdlib\Base\Enum; * Module settings enum. * * @package Modules\Billing\Models - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Models/StockBillMapper.php b/Models/StockBillMapper.php index 7a74349..1e50e47 100755 --- a/Models/StockBillMapper.php +++ b/Models/StockBillMapper.php @@ -6,7 +6,7 @@ * * @package Modules\Billing\Models * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -20,7 +20,7 @@ use phpOMS\DataStorage\Database\Query\Builder; * Mapper class. * * @package Modules\Billing\Models - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Models/Tax/BillTaxType.php b/Models/Tax/BillTaxType.php index 5bbeccf..0a174bd 100644 --- a/Models/Tax/BillTaxType.php +++ b/Models/Tax/BillTaxType.php @@ -6,7 +6,7 @@ * * @package Modules\Billing\Models\Tax * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -20,7 +20,7 @@ use phpOMS\Stdlib\Base\Enum; * Bill transfer type enum. * * @package Modules\Billing\Models\Tax - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Models/Tax/NullTaxCombination.php b/Models/Tax/NullTaxCombination.php index 913f11f..1f1765c 100644 --- a/Models/Tax/NullTaxCombination.php +++ b/Models/Tax/NullTaxCombination.php @@ -6,7 +6,7 @@ * * @package Modules\Billing\Models\Tax * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -18,7 +18,7 @@ namespace Modules\Billing\Models\Tax; * Null model * * @package Modules\Billing\Models\Tax - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Models/Tax/TaxCombination.php b/Models/Tax/TaxCombination.php index bbf4efd..cb7b45e 100644 --- a/Models/Tax/TaxCombination.php +++ b/Models/Tax/TaxCombination.php @@ -6,7 +6,7 @@ * * @package Modules\Billing\Models\Tax * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -25,7 +25,7 @@ use Modules\SupplierManagement\Models\SupplierAttributeValue; * Billing class. * * @package Modules\Billing\Models\Tax - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ @@ -63,6 +63,11 @@ class TaxCombination implements \JsonSerializable public ?\DateTime $end = null; + /** + * Constructor + * + * @since 1.0.0 + */ public function __construct() { $this->itemCode = new NullItemAttributeValue(); @@ -97,4 +102,4 @@ class TaxCombination implements \JsonSerializable { return $this->toArray(); } -} \ No newline at end of file +} diff --git a/Models/Tax/TaxCombinationMapper.php b/Models/Tax/TaxCombinationMapper.php index c10eff7..e1b0a0f 100644 --- a/Models/Tax/TaxCombinationMapper.php +++ b/Models/Tax/TaxCombinationMapper.php @@ -6,7 +6,7 @@ * * @package Modules\Billing\Models\Tax * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -23,7 +23,7 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory; * Billing mapper class. * * @package Modules\Billing\Models\Tax - * @license OMS License 1.0 + * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 */ diff --git a/Theme/Backend/Lang/Navigation.ar.lang.php b/Theme/Backend/Lang/Navigation.ar.lang.php index 04efe52..9bdb910 100755 --- a/Theme/Backend/Lang/Navigation.ar.lang.php +++ b/Theme/Backend/Lang/Navigation.ar.lang.php @@ -6,7 +6,7 @@ * * @package Modules\Localization * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Theme/Backend/Lang/Navigation.cs.lang.php b/Theme/Backend/Lang/Navigation.cs.lang.php index 7a703a3..cba47e2 100755 --- a/Theme/Backend/Lang/Navigation.cs.lang.php +++ b/Theme/Backend/Lang/Navigation.cs.lang.php @@ -6,7 +6,7 @@ * * @package Modules\Localization * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Theme/Backend/Lang/Navigation.da.lang.php b/Theme/Backend/Lang/Navigation.da.lang.php index b8a925d..ee35dae 100755 --- a/Theme/Backend/Lang/Navigation.da.lang.php +++ b/Theme/Backend/Lang/Navigation.da.lang.php @@ -6,7 +6,7 @@ * * @package Modules\Localization * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Theme/Backend/Lang/Navigation.de.lang.php b/Theme/Backend/Lang/Navigation.de.lang.php index 9ba17e9..7d38c04 100755 --- a/Theme/Backend/Lang/Navigation.de.lang.php +++ b/Theme/Backend/Lang/Navigation.de.lang.php @@ -6,7 +6,7 @@ * * @package Modules\Localization * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Theme/Backend/Lang/Navigation.el.lang.php b/Theme/Backend/Lang/Navigation.el.lang.php index 5ff8155..ba3a364 100755 --- a/Theme/Backend/Lang/Navigation.el.lang.php +++ b/Theme/Backend/Lang/Navigation.el.lang.php @@ -6,7 +6,7 @@ * * @package Modules\Localization * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Theme/Backend/Lang/Navigation.en.lang.php b/Theme/Backend/Lang/Navigation.en.lang.php index e32a6f5..36c3c27 100755 --- a/Theme/Backend/Lang/Navigation.en.lang.php +++ b/Theme/Backend/Lang/Navigation.en.lang.php @@ -6,7 +6,7 @@ * * @package Modules\Localization * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Theme/Backend/Lang/Navigation.es.lang.php b/Theme/Backend/Lang/Navigation.es.lang.php index cd0307d..cc6db4e 100755 --- a/Theme/Backend/Lang/Navigation.es.lang.php +++ b/Theme/Backend/Lang/Navigation.es.lang.php @@ -6,7 +6,7 @@ * * @package Modules\Localization * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Theme/Backend/Lang/Navigation.fi.lang.php b/Theme/Backend/Lang/Navigation.fi.lang.php index d54220e..493d858 100755 --- a/Theme/Backend/Lang/Navigation.fi.lang.php +++ b/Theme/Backend/Lang/Navigation.fi.lang.php @@ -6,7 +6,7 @@ * * @package Modules\Localization * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Theme/Backend/Lang/Navigation.fr.lang.php b/Theme/Backend/Lang/Navigation.fr.lang.php index 622f528..89d599a 100755 --- a/Theme/Backend/Lang/Navigation.fr.lang.php +++ b/Theme/Backend/Lang/Navigation.fr.lang.php @@ -6,7 +6,7 @@ * * @package Modules\Localization * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Theme/Backend/Lang/Navigation.hu.lang.php b/Theme/Backend/Lang/Navigation.hu.lang.php index f3feba4..ba4315e 100755 --- a/Theme/Backend/Lang/Navigation.hu.lang.php +++ b/Theme/Backend/Lang/Navigation.hu.lang.php @@ -6,7 +6,7 @@ * * @package Modules\Localization * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Theme/Backend/Lang/Navigation.it.lang.php b/Theme/Backend/Lang/Navigation.it.lang.php index 73078ac..242c965 100755 --- a/Theme/Backend/Lang/Navigation.it.lang.php +++ b/Theme/Backend/Lang/Navigation.it.lang.php @@ -6,7 +6,7 @@ * * @package Modules\Localization * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Theme/Backend/Lang/Navigation.ja.lang.php b/Theme/Backend/Lang/Navigation.ja.lang.php index 7e43c3b..ae8ab8b 100755 --- a/Theme/Backend/Lang/Navigation.ja.lang.php +++ b/Theme/Backend/Lang/Navigation.ja.lang.php @@ -6,7 +6,7 @@ * * @package Modules\Localization * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Theme/Backend/Lang/Navigation.ko.lang.php b/Theme/Backend/Lang/Navigation.ko.lang.php index ac0e391..de8b359 100755 --- a/Theme/Backend/Lang/Navigation.ko.lang.php +++ b/Theme/Backend/Lang/Navigation.ko.lang.php @@ -6,7 +6,7 @@ * * @package Modules\Localization * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Theme/Backend/Lang/Navigation.no.lang.php b/Theme/Backend/Lang/Navigation.no.lang.php index a754f45..2e68291 100755 --- a/Theme/Backend/Lang/Navigation.no.lang.php +++ b/Theme/Backend/Lang/Navigation.no.lang.php @@ -6,7 +6,7 @@ * * @package Modules\Localization * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Theme/Backend/Lang/Navigation.pl.lang.php b/Theme/Backend/Lang/Navigation.pl.lang.php index 8a37f56..f7005d0 100755 --- a/Theme/Backend/Lang/Navigation.pl.lang.php +++ b/Theme/Backend/Lang/Navigation.pl.lang.php @@ -6,7 +6,7 @@ * * @package Modules\Localization * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Theme/Backend/Lang/Navigation.pt.lang.php b/Theme/Backend/Lang/Navigation.pt.lang.php index 3207a36..bfa0b1b 100755 --- a/Theme/Backend/Lang/Navigation.pt.lang.php +++ b/Theme/Backend/Lang/Navigation.pt.lang.php @@ -6,7 +6,7 @@ * * @package Modules\Localization * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Theme/Backend/Lang/Navigation.ru.lang.php b/Theme/Backend/Lang/Navigation.ru.lang.php index dfacbe4..5ca37bd 100755 --- a/Theme/Backend/Lang/Navigation.ru.lang.php +++ b/Theme/Backend/Lang/Navigation.ru.lang.php @@ -6,7 +6,7 @@ * * @package Modules\Localization * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Theme/Backend/Lang/Navigation.sv.lang.php b/Theme/Backend/Lang/Navigation.sv.lang.php index ccc3d7b..d91aff9 100755 --- a/Theme/Backend/Lang/Navigation.sv.lang.php +++ b/Theme/Backend/Lang/Navigation.sv.lang.php @@ -6,7 +6,7 @@ * * @package Modules\Localization * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Theme/Backend/Lang/Navigation.th.lang.php b/Theme/Backend/Lang/Navigation.th.lang.php index 14722ba..641798b 100755 --- a/Theme/Backend/Lang/Navigation.th.lang.php +++ b/Theme/Backend/Lang/Navigation.th.lang.php @@ -6,7 +6,7 @@ * * @package Modules\Localization * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Theme/Backend/Lang/Navigation.tr.lang.php b/Theme/Backend/Lang/Navigation.tr.lang.php index 8907453..e5be4de 100755 --- a/Theme/Backend/Lang/Navigation.tr.lang.php +++ b/Theme/Backend/Lang/Navigation.tr.lang.php @@ -6,7 +6,7 @@ * * @package Modules\Localization * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Theme/Backend/Lang/Navigation.uk.lang.php b/Theme/Backend/Lang/Navigation.uk.lang.php index cbe600c..661639b 100755 --- a/Theme/Backend/Lang/Navigation.uk.lang.php +++ b/Theme/Backend/Lang/Navigation.uk.lang.php @@ -6,7 +6,7 @@ * * @package Modules\Localization * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Theme/Backend/Lang/Navigation.zh.lang.php b/Theme/Backend/Lang/Navigation.zh.lang.php index 29870d8..5a6ad65 100755 --- a/Theme/Backend/Lang/Navigation.zh.lang.php +++ b/Theme/Backend/Lang/Navigation.zh.lang.php @@ -6,7 +6,7 @@ * * @package Modules\Localization * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Theme/Backend/Lang/ar.lang.php b/Theme/Backend/Lang/ar.lang.php index 98c45bd..87b6435 100755 --- a/Theme/Backend/Lang/ar.lang.php +++ b/Theme/Backend/Lang/ar.lang.php @@ -6,7 +6,7 @@ * * @package Modules\Localization * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Theme/Backend/Lang/cs.lang.php b/Theme/Backend/Lang/cs.lang.php index f77f393..55494c1 100755 --- a/Theme/Backend/Lang/cs.lang.php +++ b/Theme/Backend/Lang/cs.lang.php @@ -6,7 +6,7 @@ * * @package Modules\Localization * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Theme/Backend/Lang/da.lang.php b/Theme/Backend/Lang/da.lang.php index 794bef1..cfd8b90 100755 --- a/Theme/Backend/Lang/da.lang.php +++ b/Theme/Backend/Lang/da.lang.php @@ -6,7 +6,7 @@ * * @package Modules\Localization * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Theme/Backend/Lang/de.lang.php b/Theme/Backend/Lang/de.lang.php index 3d0865a..55d1df8 100755 --- a/Theme/Backend/Lang/de.lang.php +++ b/Theme/Backend/Lang/de.lang.php @@ -6,7 +6,7 @@ * * @package Modules\Localization * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Theme/Backend/Lang/el.lang.php b/Theme/Backend/Lang/el.lang.php index 0de59c1..10d6b53 100755 --- a/Theme/Backend/Lang/el.lang.php +++ b/Theme/Backend/Lang/el.lang.php @@ -6,7 +6,7 @@ * * @package Modules\Localization * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Theme/Backend/Lang/en.lang.php b/Theme/Backend/Lang/en.lang.php index cd5e7b0..3d3d4a8 100755 --- a/Theme/Backend/Lang/en.lang.php +++ b/Theme/Backend/Lang/en.lang.php @@ -6,7 +6,7 @@ * * @package Modules\Localization * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Theme/Backend/Lang/es.lang.php b/Theme/Backend/Lang/es.lang.php index f4b3494..4ae62ed 100755 --- a/Theme/Backend/Lang/es.lang.php +++ b/Theme/Backend/Lang/es.lang.php @@ -6,7 +6,7 @@ * * @package Modules\Localization * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Theme/Backend/Lang/fi.lang.php b/Theme/Backend/Lang/fi.lang.php index 19f863a..c36b7a4 100755 --- a/Theme/Backend/Lang/fi.lang.php +++ b/Theme/Backend/Lang/fi.lang.php @@ -6,7 +6,7 @@ * * @package Modules\Localization * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Theme/Backend/Lang/fr.lang.php b/Theme/Backend/Lang/fr.lang.php index 5bef372..0e4a195 100755 --- a/Theme/Backend/Lang/fr.lang.php +++ b/Theme/Backend/Lang/fr.lang.php @@ -6,7 +6,7 @@ * * @package Modules\Localization * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Theme/Backend/Lang/hu.lang.php b/Theme/Backend/Lang/hu.lang.php index d043fa0..f558893 100755 --- a/Theme/Backend/Lang/hu.lang.php +++ b/Theme/Backend/Lang/hu.lang.php @@ -6,7 +6,7 @@ * * @package Modules\Localization * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Theme/Backend/Lang/it.lang.php b/Theme/Backend/Lang/it.lang.php index 6c6e66f..60f0f09 100755 --- a/Theme/Backend/Lang/it.lang.php +++ b/Theme/Backend/Lang/it.lang.php @@ -6,7 +6,7 @@ * * @package Modules\Localization * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Theme/Backend/Lang/ja.lang.php b/Theme/Backend/Lang/ja.lang.php index 32761a6..a7842b9 100755 --- a/Theme/Backend/Lang/ja.lang.php +++ b/Theme/Backend/Lang/ja.lang.php @@ -6,7 +6,7 @@ * * @package Modules\Localization * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Theme/Backend/Lang/ko.lang.php b/Theme/Backend/Lang/ko.lang.php index 1879803..cdf5035 100755 --- a/Theme/Backend/Lang/ko.lang.php +++ b/Theme/Backend/Lang/ko.lang.php @@ -6,7 +6,7 @@ * * @package Modules\Localization * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Theme/Backend/Lang/no.lang.php b/Theme/Backend/Lang/no.lang.php index 81d0b4d..c504388 100755 --- a/Theme/Backend/Lang/no.lang.php +++ b/Theme/Backend/Lang/no.lang.php @@ -6,7 +6,7 @@ * * @package Modules\Localization * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Theme/Backend/Lang/pl.lang.php b/Theme/Backend/Lang/pl.lang.php index 5e420a6..0b83cf2 100755 --- a/Theme/Backend/Lang/pl.lang.php +++ b/Theme/Backend/Lang/pl.lang.php @@ -6,7 +6,7 @@ * * @package Modules\Localization * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Theme/Backend/Lang/pt.lang.php b/Theme/Backend/Lang/pt.lang.php index 16ccd06..7e72d40 100755 --- a/Theme/Backend/Lang/pt.lang.php +++ b/Theme/Backend/Lang/pt.lang.php @@ -6,7 +6,7 @@ * * @package Modules\Localization * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Theme/Backend/Lang/ru.lang.php b/Theme/Backend/Lang/ru.lang.php index eae44dd..6d9a1d7 100755 --- a/Theme/Backend/Lang/ru.lang.php +++ b/Theme/Backend/Lang/ru.lang.php @@ -6,7 +6,7 @@ * * @package Modules\Localization * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Theme/Backend/Lang/sv.lang.php b/Theme/Backend/Lang/sv.lang.php index 6d101a4..4309ef6 100755 --- a/Theme/Backend/Lang/sv.lang.php +++ b/Theme/Backend/Lang/sv.lang.php @@ -6,7 +6,7 @@ * * @package Modules\Localization * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Theme/Backend/Lang/th.lang.php b/Theme/Backend/Lang/th.lang.php index e829bc7..ae28b32 100755 --- a/Theme/Backend/Lang/th.lang.php +++ b/Theme/Backend/Lang/th.lang.php @@ -6,7 +6,7 @@ * * @package Modules\Localization * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Theme/Backend/Lang/tr.lang.php b/Theme/Backend/Lang/tr.lang.php index d1e5796..bb68637 100755 --- a/Theme/Backend/Lang/tr.lang.php +++ b/Theme/Backend/Lang/tr.lang.php @@ -6,7 +6,7 @@ * * @package Modules\Localization * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Theme/Backend/Lang/uk.lang.php b/Theme/Backend/Lang/uk.lang.php index 47c8dca..17c9258 100755 --- a/Theme/Backend/Lang/uk.lang.php +++ b/Theme/Backend/Lang/uk.lang.php @@ -6,7 +6,7 @@ * * @package Modules\Localization * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Theme/Backend/Lang/zh.lang.php b/Theme/Backend/Lang/zh.lang.php index 45985b8..fa1b8b0 100755 --- a/Theme/Backend/Lang/zh.lang.php +++ b/Theme/Backend/Lang/zh.lang.php @@ -6,7 +6,7 @@ * * @package Modules\Localization * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Theme/Backend/bill-analysis.tpl.php b/Theme/Backend/bill-analysis.tpl.php index 2f395c5..4f9f9f0 100755 --- a/Theme/Backend/bill-analysis.tpl.php +++ b/Theme/Backend/bill-analysis.tpl.php @@ -6,7 +6,7 @@ * * @package Modules\ClientManagement * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ diff --git a/Theme/Backend/bill-create.tpl.php b/Theme/Backend/bill-create.tpl.php index 625392c..fbe7d5e 100755 --- a/Theme/Backend/bill-create.tpl.php +++ b/Theme/Backend/bill-create.tpl.php @@ -6,7 +6,7 @@ * * @package Modules\Billing * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -38,8 +38,7 @@ $billTypes = $this->getData('billtypes') ?? []; /** @var \Modules\Auditor\Models\Audit */ $logs = $this->getData('logs') ?? []; -// @todo: false needs to be replaced with status->NOT_FINALIZED (check which status it actually is) -$editable = $bill instanceof NullBill || false; +$editable = $bill instanceof NullBill || \in_array($bill->getStatus(), [BillStatus::DRAFT, BillStatus::UNPARSED]); $disabled = !$editable ? ' disabled' : ''; echo $this->getData('nav')->render(); ?> @@ -512,7 +511,7 @@ echo $this->getData('nav')->render(); ?> getId()); + $url = UriFactory::build('{/base}/admin/audit/single?id=' . $audit->getId()); ?> getId(); ?> @@ -523,7 +522,7 @@ echo $this->getData('nav')->render(); ?> getHtml('UNKNOWN', 'Auditor', 'Backend'); ?> printHtml( + href="createdBy->getId()); ?>">printHtml( $this->renderUserName('%3$s %2$s %1$s', [$audit->createdBy->name1, $audit->createdBy->name2, $audit->createdBy->name3, $audit->createdBy->login]) ); ?> createdAt->format('Y-m-d'); ?> diff --git a/Theme/Backend/purchase-bill-list.tpl.php b/Theme/Backend/purchase-bill-list.tpl.php index 7501999..3967dc3 100755 --- a/Theme/Backend/purchase-bill-list.tpl.php +++ b/Theme/Backend/purchase-bill-list.tpl.php @@ -6,7 +6,7 @@ * * @package Modules\Billing * @copyright Dennis Eichhorn - * @license OMS License 1.0 + * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ @@ -154,7 +154,7 @@ echo $this->getData('nav')->render(); ?> $value) : ++$count; - $url = UriFactory::build('{/lang}/{/app}/purchase/bill?{?}&id=' . $value->getId()); + $url = UriFactory::build('{/base}/purchase/bill?{?}&id=' . $value->getId()); ?>