auto fixes + some impl.

This commit is contained in:
Dennis Eichhorn 2024-01-26 22:53:58 +00:00
parent cf138cd266
commit ce57535b7b
51 changed files with 1656 additions and 514 deletions

19
Admin/Hooks/Manual.php Normal file
View File

@ -0,0 +1,19 @@
<?php
/**
* Jingga
*
* PHP Version 8.1
*
* @package Modules\Accounting
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
return [
'/PRE:Module:Billing\-bill\-finalize/' => [
'callback' => ['\Modules\Accounting\Controller\ApiController:eventBillArchive'],
],
];

View File

@ -1257,7 +1257,6 @@ Account,Type (B/PL),C/D,S,Sammelkonto,IFRS,HB,SB,EUR,G,U,K,Tax ID,PL Tax1,B Tax1
8403,,,,,,,,,,,,,,,,,,,Erlöse 19% USt,"Revenue, 19 % VAT"
8404,,,,,,,,,,,,,,,,,,,Erlöse 19% USt,"Revenue, 19 % VAT"
8405,,,,,,,,,,,,,,,,,,,Erlöse 19% USt,"Revenue, 19 % VAT"
8405,,,,,,,,,,,,,,,,,,,Erlöse 19% USt,"Revenue, 19 % VAT"
8406,,,,,,,,,,,,,,,,,,,Erlöse 19% USt,"Revenue, 19 % VAT"
8407,,,,,,,,,,,,,,,,,,,Erlöse 19% USt,"Revenue, 19 % VAT"
8408,,,,,,,,,,,,,,,,,,,Erlöse 19% USt,"Revenue, 19 % VAT"

1 Balance/P&L Credit/Debit Is acc. Account What is the parent/acc. Account Accounting types Tax types (Gewerbe, Umsatz, Koest) Allowed tax id Overwrites tax id definitions if defined Tax report pos.
1257 8403 Erlöse 19% USt Revenue, 19 % VAT
1258 8404 Erlöse 19% USt Revenue, 19 % VAT
1259 8405 Erlöse 19% USt Revenue, 19 % VAT
8405 Erlöse 19% USt Revenue, 19 % VAT
1260 8406 Erlöse 19% USt Revenue, 19 % VAT
1261 8407 Erlöse 19% USt Revenue, 19 % VAT
1262 8408 Erlöse 19% USt Revenue, 19 % VAT

View File

@ -246,29 +246,168 @@
"primary": true,
"autoincrement": true
},
"accounting_posting_status": {
"name": "accounting_posting_status",
"type": "TINYINT",
"null": false
},
"accounting_posting_number": {
"name": "accounting_posting_number",
"type": "VARCHAR(255)",
"null": false
},
"accounting_posting_account": {
"name": "accounting_posting_account",
"type": "INT",
"null": true,
"default": null,
"foreignTable": "accounting_account",
"foreignKey": "accounting_account_id"
},
"accounting_posting_paymentterms": {
"@todo": "only install in providing case + then use foreignTable/Key",
"name": "accounting_posting_paymentterms",
"type": "INT",
"null": true,
"default": null
},
"accounting_posting_payment": {
"description": "should this handle the dues?",
"name": "accounting_posting_payment",
"type": "INT",
"null": true,
"default": null
},
"accounting_posting_dun_level": {
"name": "accounting_posting_dun_level",
"type": "TINYINT",
"null": false
},
"accounting_posting_dun_stop": {
"name": "accounting_posting_dun_stop",
"type": "TINYINT(1)",
"null": false
},
"accounting_posting_bill": {
"@todo": "only install in providing case + then use foreignTable/Key",
"name": "accounting_posting_bill",
"type": "INT",
"null": true
},
"accounting_posting_batch": {
"name": "accounting_posting_batch",
"type": "INT",
"null": false,
"null": true,
"foreignTable": "accounting_batch",
"foreignKey": "accounting_batch_id"
},
"accounting_posting_receipt": {
"name": "accounting_posting_receipt",
"type": "INT",
"default": null,
"null": true
},
"accounting_posting_receipt_ext": {
"name": "accounting_posting_receipt_ext",
"type": "INT",
"default": null,
"null": true
},
"accounting_posting_price": {
"name": "accounting_posting_price",
"accounting_posting_value": {
"name": "accounting_posting_value",
"type": "BIGINT",
"null": false
},
"accounting_posting_createdat": {
"name": "accounting_posting_createdat",
"type": "DATETIME",
"null": false
},
"accounting_posting_createdby": {
"name": "accounting_posting_createdby",
"type": "INT",
"null": false,
"foreignTable": "account",
"foreignKey": "account_id"
},
"accounting_posting_performance": {
"name": "accounting_posting_performance",
"type": "DATETIME",
"null": false
},
"accounting_posting_unit": {
"name": "accounting_posting_unit",
"type": "INT",
"null": false,
"foreignTable": "unit",
"foreignKey": "unit_id"
}
}
},
"accounting_posting_note": {
"name": "accounting_posting_note",
"fields": {
"accounting_posting_note_id": {
"name": "accounting_posting_note_id",
"type": "INT",
"null": false,
"primary": true,
"autoincrement": true
},
"accounting_posting_note_dst": {
"name": "accounting_posting_note_dst",
"type": "INT",
"null": false,
"foreignTable": "editor_doc",
"foreignKey": "editor_doc_id"
},
"accounting_posting_note_src": {
"name": "accounting_posting_note_src",
"type": "INT",
"null": false,
"foreignTable": "accounting_posting",
"foreignKey": "accounting_posting_id"
}
}
},
"accounting_posting_media": {
"name": "accounting_posting_media",
"fields": {
"accounting_posting_media_id": {
"name": "accounting_posting_media_id",
"type": "INT",
"null": false,
"primary": true,
"autoincrement": true
},
"accounting_posting_media_dst": {
"name": "accounting_posting_media_dst",
"type": "INT",
"null": false,
"foreignTable": "media",
"foreignKey": "media_id"
},
"accounting_posting_media_src": {
"name": "accounting_posting_media_src",
"type": "INT",
"null": false,
"foreignTable": "accounting_posting",
"foreignKey": "accounting_posting_id"
}
}
},
"accounting_posting_eq": {
"name": "accounting_posting_eq",
"description": "Marks posts as equalized credit/debit",
"fields": {
"accounting_posting_eq_id": {
"name": "accounting_posting_eq_id",
"type": "INT",
"null": false,
"primary": true,
"autoincrement": true
},
"accounting_posting_eq_1": {
"name": "accounting_posting_eq_1",
"type": "INT",
"null": true,
"foreignTable": "accounting_posting",
"foreignKey": "accounting_posting_id"
},
"accounting_posting_eq_2": {
"name": "accounting_posting_eq_2",
"type": "INT",
"null": true,
"foreignTable": "accounting_posting",
"foreignKey": "accounting_posting_id"
}
}
},
@ -282,7 +421,20 @@
"primary": true,
"autoincrement": true
},
"accounting_posting_ele_status": {
"description": "debit/credit",
"name": "accounting_posting_ele_status",
"type": "TINYINT",
"null": false
},
"accounting_posting_ele_text": {
"description": "debit/credit",
"name": "accounting_posting_ele_text",
"type": "VARCHAR(255)",
"null": false
},
"accounting_posting_ele_type": {
"description": "debit/credit",
"name": "accounting_posting_ele_type",
"type": "TINYINT",
"null": false
@ -294,6 +446,22 @@
"foreignTable": "accounting_account",
"foreignKey": "accounting_account_id"
},
"accounting_posting_ele_cc": {
"name": "accounting_posting_ele_cc",
"type": "INT",
"null": true,
"default": null,
"foreignTable": "accounting_costcenter",
"foreignKey": "accounting_costcenter_id"
},
"accounting_posting_ele_co": {
"name": "accounting_posting_ele_co",
"type": "INT",
"null": true,
"default": null,
"foreignTable": "accounting_costobject",
"foreignKey": "accounting_costobject_id"
},
"accounting_posting_ele_value": {
"name": "accounting_posting_ele_value",
"type": "BIGINT",
@ -303,6 +471,45 @@
"name": "accounting_posting_ele_tax",
"type": "INT",
"null": false
},
"accounting_posting_ele_createdat": {
"name": "accounting_posting_ele_createdat",
"type": "DATETIME",
"null": false
},
"accounting_posting_ele_createdby": {
"name": "accounting_posting_ele_createdby",
"type": "INT",
"null": false,
"foreignTable": "account",
"foreignKey": "account_id"
},
"accounting_posting_ele_performance": {
"name": "accounting_posting_ele_performance",
"type": "DATETIME",
"null": false
},
"accounting_posting_ele_opposite": {
"description": "Often you have a 1:1 match between credit/debit posting, this speeds it up. Alternatively you have to find the opposite postings through the posting",
"name": "accounting_posting_ele_opposite",
"type": "INT",
"null": false,
"foreignTable": "accounting_posting_ele",
"foreignKey": "accounting_posting_ele_id"
},
"accounting_posting_ele_posting": {
"name": "accounting_posting_ele_posting",
"type": "INT",
"null": false,
"foreignTable": "accounting_posting",
"foreignKey": "accounting_posting_id"
},
"accounting_posting_ele_unit": {
"name": "accounting_posting_ele_unit",
"type": "INT",
"null": false,
"foreignTable": "unit",
"foreignKey": "unit_id"
}
}
}

View File

@ -22,7 +22,6 @@ use phpOMS\Message\Http\HttpRequest;
use phpOMS\Message\Http\HttpResponse;
use phpOMS\Module\InstallerAbstract;
use phpOMS\Module\ModuleInfo;
use phpOMS\Uri\HttpUri;
/**
* Installer class.
@ -88,7 +87,7 @@ final class Installer extends InstallerAbstract
}
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('code', $line[0]);
@ -109,7 +108,7 @@ final class Installer extends InstallerAbstract
for ($i = 1; $i < $languages; ++$i) {
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('ref', $accountId);
@ -147,7 +146,7 @@ final class Installer extends InstallerAbstract
foreach ($mapper::yield()->execute() as $person) {
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$request = new HttpRequest();
// @todo define default account number format for clients, if number -> consider number as starting value
// @todo define default account number format for suppliers, if number -> consider number as starting value

View File

@ -18,7 +18,7 @@ use phpOMS\Account\PermissionType;
use phpOMS\Router\RouteVerb;
return [
'^.*/accounting/entries.*$' => [
'^.*/accounting/entries(\?.*$|$)' => [
[
'dest' => '\Modules\Accounting\Controller\BackendController:viewEntries',
'verb' => RouteVerb::GET,
@ -29,7 +29,7 @@ return [
],
],
],
'^.*/accounting/stack/list.*$' => [
'^.*/accounting/stack/list(\?.*$|$)' => [
[
'dest' => '\Modules\Accounting\Controller\BackendController:viewStackList',
'verb' => RouteVerb::GET,
@ -40,7 +40,7 @@ return [
],
],
],
'^.*/accounting/stack/entries.*$' => [
'^.*/accounting/stack/entries(\?.*$|$)' => [
[
'dest' => '\Modules\Accounting\Controller\BackendController:viewStackEntries',
'verb' => RouteVerb::GET,
@ -51,7 +51,7 @@ return [
],
],
],
'^.*/accounting/stack/archive/list.*$' => [
'^.*/accounting/stack/archive/list(\?.*$|$)' => [
[
'dest' => '\Modules\Accounting\Controller\BackendController:viewStackArchiveList',
'verb' => RouteVerb::GET,
@ -62,7 +62,7 @@ return [
],
],
],
'^.*/accounting/stack/create.*$' => [
'^.*/accounting/stack/create(\?.*$|$)' => [
[
'dest' => '\Modules\Accounting\Controller\BackendController:viewStackCreate',
'verb' => RouteVerb::GET,
@ -73,7 +73,7 @@ return [
],
],
],
'^.*/accounting/stack/predefined/list.*$' => [
'^.*/accounting/stack/predefined/list(\?.*$|$)' => [
[
'dest' => '\Modules\Accounting\Controller\BackendController:viewStackPredefinedList',
'verb' => RouteVerb::GET,
@ -84,9 +84,9 @@ return [
],
],
],
'^.*/accounting/coa/profile.*$' => [
'^.*/accounting/coa/view(\?.*$|$)' => [
[
'dest' => '\Modules\Accounting\Controller\BackendController:viewAccountProfile',
'dest' => '\Modules\Accounting\Controller\BackendController:viewAccountView',
'verb' => RouteVerb::GET,
'permission' => [
'module' => BackendController::NAME,
@ -95,7 +95,7 @@ return [
],
],
],
'^.*/accounting/coa/list.*$' => [
'^.*/accounting/coa/list(\?.*$|$)' => [
[
'dest' => '\Modules\Accounting\Controller\BackendController:viewCOAList',
'verb' => RouteVerb::GET,
@ -106,7 +106,7 @@ return [
],
],
],
'^.*/accounting/coa/create.*$' => [
'^.*/accounting/coa/create(\?.*$|$)' => [
[
'dest' => '\Modules\Accounting\Controller\BackendController:viewCOACreate',
'verb' => RouteVerb::GET,
@ -117,9 +117,9 @@ return [
],
],
],
'^.*/accounting/dun/print.*$' => [
'^.*/accounting/dun/print(\?.*$|$)' => [
[
'dest' => '\Modules\Accounting\Controller\BackendController:viewCostCenterProfile',
'dest' => '\Modules\Accounting\Controller\BackendController:viewCostCenterView',
'verb' => RouteVerb::GET,
'permission' => [
'module' => BackendController::NAME,
@ -128,9 +128,9 @@ return [
],
],
],
'^.*/accounting/statement/print.*$' => [
'^.*/accounting/statement/print(\?.*$|$)' => [
[
'dest' => '\Modules\Accounting\Controller\BackendController:viewCostCenterProfile',
'dest' => '\Modules\Accounting\Controller\BackendController:viewCostCenterView',
'verb' => RouteVerb::GET,
'permission' => [
'module' => BackendController::NAME,
@ -139,9 +139,9 @@ return [
],
],
],
'^.*/accounting/balances/print.*$' => [
'^.*/accounting/balances/print(\?.*$|$)' => [
[
'dest' => '\Modules\Accounting\Controller\BackendController:viewCostCenterProfile',
'dest' => '\Modules\Accounting\Controller\BackendController:viewCostCenterView',
'verb' => RouteVerb::GET,
'permission' => [
'module' => BackendController::NAME,
@ -150,9 +150,9 @@ return [
],
],
],
'^.*/accounting/accountform/print.*$' => [
'^.*/accounting/accountform/print(\?.*$|$)' => [
[
'dest' => '\Modules\Accounting\Controller\BackendController:viewCostCenterProfile',
'dest' => '\Modules\Accounting\Controller\BackendController:viewCostCenterView',
'verb' => RouteVerb::GET,
'permission' => [
'module' => BackendController::NAME,
@ -162,7 +162,7 @@ return [
],
],
'^.*/accounting/costcenter/list.*$' => [
'^.*/accounting/costcenter/list(\?.*$|$)' => [
[
'dest' => '\Modules\Accounting\Controller\BackendController:viewCostCenterList',
'verb' => RouteVerb::GET,
@ -173,7 +173,7 @@ return [
],
],
],
'^.*/accounting/costobject/list.*$' => [
'^.*/accounting/costobject/list(\?.*$|$)' => [
[
'dest' => '\Modules\Accounting\Controller\BackendController:viewCostObjectList',
'verb' => RouteVerb::GET,
@ -184,9 +184,9 @@ return [
],
],
],
'^.*/accounting/costcenter/profile.*$' => [
'^.*/accounting/costcenter/view(\?.*$|$)' => [
[
'dest' => '\Modules\Accounting\Controller\BackendController:viewCostCenterProfile',
'dest' => '\Modules\Accounting\Controller\BackendController:viewCostCenterView',
'verb' => RouteVerb::GET,
'permission' => [
'module' => BackendController::NAME,
@ -195,9 +195,9 @@ return [
],
],
],
'^.*/accounting/costobject/profile.*$' => [
'^.*/accounting/costobject/view(\?.*$|$)' => [
[
'dest' => '\Modules\Accounting\Controller\BackendController:viewCostObjectProfile',
'dest' => '\Modules\Accounting\Controller\BackendController:viewCostObjectView',
'verb' => RouteVerb::GET,
'permission' => [
'module' => BackendController::NAME,
@ -207,7 +207,7 @@ return [
],
],
'^.*/accounting/supplier/list.*$' => [
'^.*/accounting/supplier/list(\?.*$|$)' => [
[
'dest' => '\Modules\Accounting\Controller\BackendController:viewSupplierList',
'verb' => RouteVerb::GET,
@ -218,7 +218,7 @@ return [
],
],
],
'^.*/accounting/client/list.*$' => [
'^.*/accounting/client/list(\?.*$|$)' => [
[
'dest' => '\Modules\Accounting\Controller\BackendController:viewClientList',
'verb' => RouteVerb::GET,
@ -229,9 +229,9 @@ return [
],
],
],
'^.*/accounting/supplier/profile.*$' => [
'^.*/accounting/supplier/view(\?.*$|$)' => [
[
'dest' => '\Modules\Accounting\Controller\BackendController:viewSupplierProfile',
'dest' => '\Modules\Accounting\Controller\BackendController:viewSupplierView',
'verb' => RouteVerb::GET,
'permission' => [
'module' => BackendController::NAME,
@ -240,9 +240,9 @@ return [
],
],
],
'^.*/accounting/client/profile.*$' => [
'^.*/accounting/client/view(\?.*$|$)' => [
[
'dest' => '\Modules\Accounting\Controller\BackendController:viewClientProfile',
'dest' => '\Modules\Accounting\Controller\BackendController:viewClientView',
'verb' => RouteVerb::GET,
'permission' => [
'module' => BackendController::NAME,
@ -251,9 +251,9 @@ return [
],
],
],
'^.*/accounting/supplier/entries.*$' => [
'^.*/accounting/supplier/entries(\?.*$|$)' => [
[
'dest' => '\Modules\Accounting\Controller\BackendController:viewSupplierProfile',
'dest' => '\Modules\Accounting\Controller\BackendController:viewSupplierView',
'verb' => RouteVerb::GET,
'permission' => [
'module' => BackendController::NAME,
@ -262,9 +262,9 @@ return [
],
],
],
'^.*/accounting/client/entries.*$' => [
'^.*/accounting/client/entries(\?.*$|$)' => [
[
'dest' => '\Modules\Accounting\Controller\BackendController:viewClientProfile',
'dest' => '\Modules\Accounting\Controller\BackendController:viewClientView',
'verb' => RouteVerb::GET,
'permission' => [
'module' => BackendController::NAME,

View File

@ -22,8 +22,18 @@ use Modules\Accounting\Models\CostCenter;
use Modules\Accounting\Models\CostCenterMapper;
use Modules\Accounting\Models\CostObject;
use Modules\Accounting\Models\CostObjectMapper;
use Modules\Accounting\Models\Posting;
use Modules\Accounting\Models\PostingElement;
use Modules\Accounting\Models\PostingMapper;
use Modules\Accounting\Models\PostingSide;
use Modules\Admin\Models\AccountMapper;
use Modules\Admin\Models\NullAccount;
use Modules\ItemManagement\Models\Attribute\ItemAttributeTypeMapper;
use Modules\ItemManagement\Models\Attribute\ItemAttributeValueMapper;
use phpOMS\Localization\BaseStringL11n;
use phpOMS\Localization\ISO639x1Enum;
use phpOMS\Message\Http\HttpRequest;
use phpOMS\Message\Http\HttpResponse;
use phpOMS\Message\Http\RequestStatusCode;
use phpOMS\Message\RequestAbstract;
use phpOMS\Message\ResponseAbstract;
@ -41,9 +51,148 @@ use phpOMS\Model\Message\FormValidation;
*/
final class ApiController extends Controller
{
public function hookPersonalAccountCreate(...$data)
use \Modules\Attribute\Controller\ApiAttributeTraitController;
/**
* Event after creating a stock
*
* @param int $account Account
* @param mixed $old Old stock model
* @param mixed $new New / created stock model
* @param null|int $type Event type (usually mapper hash)
* @param string $trigger Trigger name
* @param null|string $module Module name who triggers the event
* @param null|string $ref Reference (e.g. reference to a different model)
* @param null|string $content Content for the event (e.g. comment, values, ...)
* @param null|string $ip Ip of the account
*
* @return void
*
* @since 1.0.0
*/
public function eventBillArchive(
int $account,
mixed $old,
mixed $new,
?int $type = null,
string $trigger = '',
?string $module = null,
?string $ref = null,
?string $content = null,
?string $ip = null
) : void
{
\var_dump($data);
if (!$new->type->isAccounting) {
return;
}
$type = '';
$person = null;
/** @var \Modules\Billing\Models\Bill $new */
if ($new->client !== null) {
$new->client = \Modules\ClientManagement\Models\ClientMapper::get()
->where('id', $new->client->id)
->execute();
$person = $new->client;
$type = 'client';
} else {
$new->supplier = \Modules\SupplierManagement\Models\SupplierMapper::get()
->where('id', $new->supplier->id)
->execute();
$person = $new->supplier;
$type = 'supplier';
}
$finAcc = AccountAbstractMapper::get()
->where('code', $person->number)
->execute();
$posting = new Posting();
$posting->createdBy = new NullAccount($account);
$posting->unit = $new->unit;
$posting->account = AccountAbstractMapper::get()
->where('code', $person->number)
->execute();
// First side
$firstElement = new PostingElement();
$firstElement->createdBy = new NullAccount($account);
$firstElement->unit = $posting->unit;
$firstElement->account = $finAcc;
$firstElement->value = $new->grossSales->getInt();
if ($type === 'client') {
$firstElement->type = $new->grossSales->getInt() > 0
? PostingSide::DEBIT
: PostingSide::CREDIT;
} else {
$firstElement->type = $new->grossSales->getInt() > 0
? PostingSide::CREDIT
: PostingSide::DEBIT;
}
$posting->elements[] = $firstElement;
// Second side
foreach ($new->elements as $element) {
// @todo handle pl account from bill
// @todo handle taxes
$postingElement = new PostingElement();
$postingElement->createdBy = new NullAccount($account);
$postingElement->unit = $posting->unit;
$postingElement->account = $finAcc;
$postingElement->value = $element->totalSalesPriceGross->getInt();
$postingElement->type = $firstElement->type === PostingSide::DEBIT
? PostingSide::CREDIT
: PostingSide::DEBIT;
$posting->elements[] = $postingElement;
}
// @todo check debit === credit
// @todo check bill tax = sum(element.tax)
// @todo check bill net = sum(element.net)
// @todo check bill gross = sum(element.gross)
$this->createModel($account, $posting, PostingMapper::class, 'posting-bill', $ip);
}
public function hookPersonalAccountCreate(
int $account,
mixed $old,
mixed $new,
?int $type = null,
string $trigger = '',
?string $module = null,
?string $ref = null,
?string $content = null,
?string $ip = null
) : void
{
$accountType = $new instanceof \Modules\ClientManagement\Models\Client
? AccountType::DEBITOR
: AccountType::CREDITOR;
$new->account = AccountMapper::get()
->where('id', $new->account->id)
->execute();
$response = new HttpResponse();
$request = new HttpRequest();
// @todo define default account number format for clients, if number -> consider number as starting value
// @todo define default account number format for suppliers, if number -> consider number as starting value
$request->header->account = $account;
$request->setData('code', $new->number);
$request->setData('content', \rtrim($new->account->name1 . ' ' . $new->account->name2));
$request->setData('language', ISO639x1Enum::_EN);
$request->setData('type', $accountType);
$request->setData('account', $new->account->id);
$this->apiAccountCreate($request, $response);
}
/**
@ -105,14 +254,17 @@ final class ApiController extends Controller
private function createAccountFromRequest(RequestAbstract $request) : AccountAbstract
{
$account = new AccountAbstract();
$account->code = $request->getDataString('code') ?? '';
$account->code = $request->getDataString('code') ?? '';
$account->account = $request->getDataInt('account');
if ($request->hasData('content')) {
$account->setL11n($request->getDataString('content') ?? '', $request->getDataString('language') ?? ISO639x1Enum::_EN);
$account->setL11n(
$request->getDataString('content') ?? '',
ISO639x1Enum::tryFromValue($request->getDataString('language')) ?? ISO639x1Enum::_EN
);
}
$account->type = $request->getDataInt('type') ?? AccountType::IMPERSONAL;
$account->type = AccountType::tryFromValue($request->getDataInt('type')) ?? AccountType::IMPERSONAL;
return $account;
}
@ -155,12 +307,10 @@ final class ApiController extends Controller
*/
private function createAccountL11nFromRequest(RequestAbstract $request) : BaseStringL11n
{
$accountL11n = new BaseStringL11n();
$accountL11n->ref = $request->getDataInt('ref') ?? 0;
$accountL11n->setLanguage(
$request->getDataString('language') ?? $request->header->l11n->language
);
$accountL11n->content = $request->getDataString('content') ?? '';
$accountL11n = new BaseStringL11n();
$accountL11n->ref = $request->getDataInt('ref') ?? 0;
$accountL11n->language = ISO639x1Enum::tryFromValue($request->getDataString('language')) ?? $request->header->l11n->language;
$accountL11n->content = $request->getDataString('content') ?? '';
return $accountL11n;
}
@ -253,6 +403,31 @@ final class ApiController extends Controller
$costcenter = $this->createCostCenterFromRequest($request);
$this->createModel($request->header->account, $costcenter, CostCenterMapper::class, 'costcenter', $request->getOrigin());
// Create item attribute value
$type = ItemAttributeTypeMapper::get()
->with('defaults')
->where('name', 'costcenter')
->execute();
$internalRequest = new HttpRequest($request->uri);
$internalRequest->header->account = $request->header->account;
$internalRequest->setData('default', true);
$internalRequest->setData('value', $costcenter->code);
$internalRequest->setData('title', $costcenter->getL11n());
$internalRequest->setData('language', $costcenter->l11n->language);
$internalRequest->setData('unit', $request->getDataInt('unit') ?? $this->app->unitId);
$attrValue = $this->createAttributeValueFromRequest($internalRequest, $type);
$this->createModel($request->header->account, $attrValue, ItemAttributeValueMapper::class, 'attr_value', $request->getOrigin());
$this->createModelRelation(
$request->header->account,
$type->id,
$attrValue->id,
ItemAttributeTypeMapper::class, 'defaults', '', $request->getOrigin()
);
$this->createStandardCreateResponse($request, $response, $costcenter);
}
@ -277,7 +452,7 @@ final class ApiController extends Controller
}
/**
* Method to create costcenter from request.
* Method to create cost center from request.
*
* @param RequestAbstract $request Request
*
@ -287,9 +462,12 @@ final class ApiController extends Controller
*/
private function createCostCenterFromRequest(RequestAbstract $request) : CostCenter
{
$costcenter = new CostCenter();
$costcenter = new CostCenter();
$costcenter->code = $request->getDataString('code') ?? '';
$costcenter->setL11n($request->getDataString('content') ?? '', $request->getDataString('language') ?? ISO639x1Enum::_EN);
$costcenter->setL11n(
$request->getDataString('content') ?? '',
ISO639x1Enum::tryFromValue($request->getDataString('language')) ?? ISO639x1Enum::_EN
);
$costcenter->unit = $request->getDataInt('unit') ?? 1;
return $costcenter;
@ -362,11 +540,36 @@ final class ApiController extends Controller
$costobject = $this->createCostObjectFromRequest($request);
$this->createModel($request->header->account, $costobject, CostObjectMapper::class, 'costobject', $request->getOrigin());
// Create item attribute value
$type = ItemAttributeTypeMapper::get()
->with('defaults')
->where('name', 'costobject')
->execute();
$internalRequest = new HttpRequest($request->uri);
$internalRequest->header->account = $request->header->account;
$internalRequest->setData('default', true);
$internalRequest->setData('value', $costobject->code);
$internalRequest->setData('title', $costobject->getL11n());
$internalRequest->setData('language', $costobject->l11n->language);
$internalRequest->setData('unit', $request->getDataInt('unit') ?? $this->app->unitId);
$attrValue = $this->createAttributeValueFromRequest($internalRequest, $type);
$this->createModel($request->header->account, $attrValue, ItemAttributeValueMapper::class, 'attr_value', $request->getOrigin());
$this->createModelRelation(
$request->header->account,
$type->id,
$attrValue->id,
ItemAttributeTypeMapper::class, 'defaults', '', $request->getOrigin()
);
$this->createStandardCreateResponse($request, $response, $costobject);
}
/**
* Method to create costobject from request.
* Method to create cost object from request.
*
* @param RequestAbstract $request Request
*
@ -376,9 +579,12 @@ final class ApiController extends Controller
*/
private function createCostObjectFromRequest(RequestAbstract $request) : CostObject
{
$costobject = new CostObject();
$costobject = new CostObject();
$costobject->code = $request->getDataString('code') ?? '';
$costobject->setL11n($request->getDataString('content') ?? '', $request->getDataString('language') ?? ISO639x1Enum::_EN);
$costobject->setL11n(
$request->getDataString('content') ?? '',
ISO639x1Enum::tryFromValue($request->getDataString('language')) ?? ISO639x1Enum::_EN
);
$costobject->unit = $request->getDataInt('unit') ?? 1;
return $costobject;

View File

@ -17,8 +17,6 @@ namespace Modules\Accounting\Controller;
use Modules\Accounting\Models\AccountAbstractMapper;
use Modules\Accounting\Models\CostCenterMapper;
use Modules\Accounting\Models\CostObjectMapper;
use Modules\Admin\Models\LocalizationMapper;
use Modules\Admin\Models\SettingsEnum;
use Modules\Auditor\Models\AuditMapper;
use Modules\ClientManagement\Models\Attribute\ClientAttributeTypeMapper;
use Modules\ClientManagement\Models\ClientMapper;
@ -252,10 +250,10 @@ final class BackendController extends Controller
* @since 1.0.0
* @codeCoverageIgnore
*/
public function viewCostCenterProfile(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
public function viewCostCenterView(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
{
$view = new View($this->app->l11nManager, $request, $response);
$view->setTemplate('/Modules/Accounting/Theme/Backend/costcenter-profile');
$view->setTemplate('/Modules/Accounting/Theme/Backend/costcenter-view');
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1002604001, $request, $response);
return $view;
@ -273,10 +271,10 @@ final class BackendController extends Controller
* @since 1.0.0
* @codeCoverageIgnore
*/
public function viewCostObjectProfile(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
public function viewCostObjectView(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
{
$view = new View($this->app->l11nManager, $request, $response);
$view->setTemplate('/Modules/Accounting/Theme/Backend/costobject-profile');
$view->setTemplate('/Modules/Accounting/Theme/Backend/costobject-view');
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1002604001, $request, $response);
return $view;
@ -426,7 +424,7 @@ final class BackendController extends Controller
* @since 1.0.0
* @codeCoverageIgnore
*/
public function viewSupplierProfile(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
public function viewSupplierView(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
{
$head = $response->data['Content']->head;
$nonce = $this->app->appSettings->getOption('script-nonce');
@ -437,7 +435,7 @@ final class BackendController extends Controller
$head->addAsset(AssetType::JSLATE, 'Modules/Accounting/Controller.js', ['nonce' => $nonce, 'type' => 'module']);
$view = new View($this->app->l11nManager, $request, $response);
$view->setTemplate('/Modules/Accounting/Theme/Backend/personal-profile');
$view->setTemplate('/Modules/Accounting/Theme/Backend/personal-view');
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1002604001, $request, $response);
$account = SupplierMapper::get()
@ -459,11 +457,8 @@ final class BackendController extends Controller
$view->data['hasBilling'] = $this->app->moduleManager->isActive('Billing');
/** @var \Model\Setting $settings */
$settings = $this->app->appSettings->get(null, SettingsEnum::DEFAULT_LOCALIZATION);
$view->data['attributeView'] = new \Modules\Attribute\Theme\Backend\Components\AttributeView($this->app->l11nManager, $request, $response);
$view->data['attributeView']->data['default_localization'] = LocalizationMapper::get()->where('id', (int) $settings->id)->execute();
$view->data['attributeView'] = new \Modules\Attribute\Theme\Backend\Components\AttributeView($this->app->l11nManager, $request, $response);
$view->data['attributeView']->data['default_localization'] = $this->app->l11nServer;
/** @var \Modules\Media\Models\Media[] $files */
$files = MediaMapper::getAll()
@ -474,8 +469,10 @@ final class BackendController extends Controller
$view->data['files'] = $files;
$view->data['media-upload'] = new \Modules\Media\Theme\Backend\Components\Upload\BaseView($this->app->l11nManager, $request, $response);
$view->data['note'] = new \Modules\Editor\Theme\Backend\Components\Note\BaseView($this->app->l11nManager, $request, $response);
$view->data['media-upload'] = new \Modules\Media\Theme\Backend\Components\Upload\BaseView($this->app->l11nManager, $request, $response);
$view->data['note'] = new \Modules\Editor\Theme\Backend\Components\Note\BaseView($this->app->l11nManager, $request, $response);
$view->data['address-component'] = new \Modules\Admin\Theme\Backend\Components\AddressEditor\AddressView($this->app->l11nManager, $request, $response);
$view->data['contact-component'] = new \Modules\Admin\Theme\Backend\Components\ContactEditor\ContactView($this->app->l11nManager, $request, $response);
return $view;
}
@ -492,7 +489,7 @@ final class BackendController extends Controller
* @since 1.0.0
* @codeCoverageIgnore
*/
public function viewClientProfile(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
public function viewClientView(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
{
$head = $response->data['Content']->head;
$nonce = $this->app->appSettings->getOption('script-nonce');
@ -503,12 +500,13 @@ final class BackendController extends Controller
$head->addAsset(AssetType::JSLATE, 'Modules/Accounting/Controller.js', ['nonce' => $nonce, 'type' => 'module']);
$view = new View($this->app->l11nManager, $request, $response);
$view->setTemplate('/Modules/Accounting/Theme/Backend/personal-profile');
$view->setTemplate('/Modules/Accounting/Theme/Backend/personal-view');
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1002604001, $request, $response);
$account = ClientMapper::get()
->with('account')
->with('contactElements')
->with('account/addresses')
->with('account/contacts')
->with('mainAddress')
->with('files')->limit(5, 'files')->sort('files/id', OrderType::DESC)
->with('notes')->limit(5, 'notes')->sort('notes/id', OrderType::DESC)
@ -517,11 +515,8 @@ final class BackendController extends Controller
$view->data['account'] = $account;
/** @var \Model\Setting $settings */
$settings = $this->app->appSettings->get(null, SettingsEnum::DEFAULT_LOCALIZATION);
$view->data['attributeView'] = new \Modules\Attribute\Theme\Backend\Components\AttributeView($this->app->l11nManager, $request, $response);
$view->data['attributeView']->data['default_localization'] = LocalizationMapper::get()->where('id', (int) $settings->id)->execute();
$view->data['attributeView'] = new \Modules\Attribute\Theme\Backend\Components\AttributeView($this->app->l11nManager, $request, $response);
$view->data['attributeView']->data['default_localization'] = $this->app->l11nServer;
/** @var \Modules\Attribute\Models\AttributeType[] $attributeTypes */
$attributeTypes = ClientAttributeTypeMapper::getAll()
@ -585,8 +580,10 @@ final class BackendController extends Controller
$view->data['files'] = $files;
$view->data['media-upload'] = new \Modules\Media\Theme\Backend\Components\Upload\BaseView($this->app->l11nManager, $request, $response);
$view->data['note'] = new \Modules\Editor\Theme\Backend\Components\Note\BaseView($this->app->l11nManager, $request, $response);
$view->data['media-upload'] = new \Modules\Media\Theme\Backend\Components\Upload\BaseView($this->app->l11nManager, $request, $response);
$view->data['note'] = new \Modules\Editor\Theme\Backend\Components\Note\BaseView($this->app->l11nManager, $request, $response);
$view->data['address-component'] = new \Modules\Admin\Theme\Backend\Components\AddressEditor\AddressView($this->app->l11nManager, $request, $response);
$view->data['contact-component'] = new \Modules\Admin\Theme\Backend\Components\ContactEditor\ContactView($this->app->l11nManager, $request, $response);
$view->data['hasBilling'] = $this->app->moduleManager->isActive('Billing');

View File

@ -73,18 +73,6 @@ class AccountAbstract
*/
public array $entries = [];
/**
* Get account id.
*
* @return int
*
* @since 1.0.0
*/
public function getId() : int
{
return $this->id;
}
/**
* Get entry.
*
@ -114,12 +102,12 @@ class AccountAbstract
if ($l11n instanceof BaseStringL11n) {
$this->l11n = $l11n;
} elseif (isset($this->l11n) && $this->l11n instanceof BaseStringL11n) {
$this->l11n->content = $l11n;
$this->l11n->setLanguage($lang);
$this->l11n->content = $l11n;
$this->l11n->language = $lang;
} else {
$this->l11n = new BaseStringL11n();
$this->l11n->content = $l11n;
$this->l11n->setLanguage($lang);
$this->l11n = new BaseStringL11n();
$this->l11n->content = $l11n;
$this->l11n->language = $lang;
}
}
@ -148,7 +136,7 @@ class AccountAbstract
*
* @since 1.0.0
*/
public function getEntriesByDate(\DateTime $start, \DateTime $end = null, int $dateType = TimeRangeType::RECEIPT_DATE) : array
public function getEntriesByDate(\DateTime $start, ?\DateTime $end = null, int $dateType = TimeRangeType::RECEIPT_DATE) : array
{
return [];
}
@ -159,7 +147,7 @@ class AccountAbstract
public function toArray() : array
{
return [
'id' => $this->id,
'id' => $this->id,
];
}

View File

@ -36,11 +36,11 @@ class AccountAbstractMapper extends DataMapperFactory
* @since 1.0.0
*/
public const COLUMNS = [
'accounting_account_id' => ['name' => 'accounting_account_id', 'type' => 'int', 'internal' => 'id'],
'accounting_account_code' => ['name' => 'accounting_account_code', 'type' => 'string', 'internal' => 'code', 'autocomplete' => true],
'accounting_account_type' => ['name' => 'accounting_account_type', 'type' => 'int', 'internal' => 'type'],
'accounting_account_parent' => ['name' => 'accounting_account_parent', 'type' => 'int', 'internal' => 'parent'],
'accounting_account_account' => ['name' => 'accounting_account_account', 'type' => 'int', 'internal' => 'account'],
'accounting_account_id' => ['name' => 'accounting_account_id', 'type' => 'int', 'internal' => 'id'],
'accounting_account_code' => ['name' => 'accounting_account_code', 'type' => 'string', 'internal' => 'code', 'autocomplete' => true],
'accounting_account_type' => ['name' => 'accounting_account_type', 'type' => 'int', 'internal' => 'type'],
'accounting_account_parent' => ['name' => 'accounting_account_parent', 'type' => 'int', 'internal' => 'parent'],
'accounting_account_account' => ['name' => 'accounting_account_account', 'type' => 'int', 'internal' => 'account'],
];
/**

View File

@ -37,10 +37,10 @@ final class AccountL11nMapper extends DataMapperFactory
* @since 1.0.0
*/
public const COLUMNS = [
'accounting_account_l11n_id' => ['name' => 'accounting_account_l11n_id', 'type' => 'int', 'internal' => 'id'],
'accounting_account_l11n_title' => ['name' => 'accounting_account_l11n_title', 'type' => 'string', 'internal' => 'content', 'autocomplete' => true],
'accounting_account_l11n_account' => ['name' => 'accounting_account_l11n_account', 'type' => 'int', 'internal' => 'ref'],
'accounting_account_l11n_lang' => ['name' => 'accounting_account_l11n_lang', 'type' => 'string', 'internal' => 'language'],
'accounting_account_l11n_id' => ['name' => 'accounting_account_l11n_id', 'type' => 'int', 'internal' => 'id'],
'accounting_account_l11n_title' => ['name' => 'accounting_account_l11n_title', 'type' => 'string', 'internal' => 'content', 'autocomplete' => true],
'accounting_account_l11n_account' => ['name' => 'accounting_account_l11n_account', 'type' => 'int', 'internal' => 'ref'],
'accounting_account_l11n_lang' => ['name' => 'accounting_account_l11n_lang', 'type' => 'string', 'internal' => 'language'],
];
/**

View File

@ -74,32 +74,6 @@ class BatchPosting implements \Countable
$this->created = new \DateTimeImmutable('now');
}
/**
* Get id.
*
* @return int
*
* @since 1.0.0
*/
public function getId() : int
{
return $this->id;
}
/**
* Get posting.
*
* @param int $id Posting ID
*
* @return null|PostingInterface
*
* @since 1.0.0
*/
public function getPosting(int $id) : ?PostingInterface
{
return $this->postings[$id] ?? null;
}
/**
* Remove posting.
*
@ -120,20 +94,6 @@ class BatchPosting implements \Countable
return true;
}
/**
* Add posting.
*
* @param PostingInterface $posting Posting
*
* @return void
*
* @since 1.0.0
*/
public function addPosting(PostingInterface $posting) : void
{
$this->postings[] = $posting;
}
/**
* {@inheritdoc}
*/

View File

@ -61,18 +61,6 @@ class CostCenter
public int $unit = 0;
/**
* Get balance id
*
* @return int
*
* @since 1.0.0
*/
public function getId() : int
{
return $this->id;
}
/**
* Set l11n
*
@ -88,12 +76,12 @@ class CostCenter
if ($l11n instanceof BaseStringL11n) {
$this->l11n = $l11n;
} elseif (isset($this->l11n) && $this->l11n instanceof BaseStringL11n) {
$this->l11n->content = $l11n;
$this->l11n->setLanguage($lang);
$this->l11n->content = $l11n;
$this->l11n->language = $lang;
} else {
$this->l11n = new BaseStringL11n();
$this->l11n->content = $l11n;
$this->l11n->setLanguage($lang);
$this->l11n = new BaseStringL11n();
$this->l11n->content = $l11n;
$this->l11n->language = $lang;
}
}
@ -117,9 +105,9 @@ class CostCenter
public function toArray() : array
{
return [
'id' => $this->id,
'code' => $this->code,
'parent' => $this->parent,
'id' => $this->id,
'code' => $this->code,
'parent' => $this->parent,
];
}

View File

@ -37,10 +37,10 @@ final class CostCenterL11nMapper extends DataMapperFactory
* @since 1.0.0
*/
public const COLUMNS = [
'accounting_costcenter_l11n_id' => ['name' => 'accounting_costcenter_l11n_id', 'type' => 'int', 'internal' => 'id'],
'accounting_costcenter_l11n_name' => ['name' => 'accounting_costcenter_l11n_name', 'type' => 'string', 'internal' => 'content', 'autocomplete' => true],
'accounting_costcenter_l11n_costcenter' => ['name' => 'accounting_costcenter_l11n_costcenter', 'type' => 'int', 'internal' => 'ref'],
'accounting_costcenter_l11n_language' => ['name' => 'accounting_costcenter_l11n_language', 'type' => 'string', 'internal' => 'language'],
'accounting_costcenter_l11n_id' => ['name' => 'accounting_costcenter_l11n_id', 'type' => 'int', 'internal' => 'id'],
'accounting_costcenter_l11n_name' => ['name' => 'accounting_costcenter_l11n_name', 'type' => 'string', 'internal' => 'content', 'autocomplete' => true],
'accounting_costcenter_l11n_costcenter' => ['name' => 'accounting_costcenter_l11n_costcenter', 'type' => 'int', 'internal' => 'ref'],
'accounting_costcenter_l11n_language' => ['name' => 'accounting_costcenter_l11n_language', 'type' => 'string', 'internal' => 'language'],
];
/**

View File

@ -49,11 +49,11 @@ final class CostCenterMapper extends DataMapperFactory
*/
public const HAS_MANY = [
'l11n' => [
'mapper' => CostCenterL11nMapper::class,
'table' => 'accounting_costcenter_l11n',
'self' => 'accounting_costcenter_l11n_costcenter',
'mapper' => CostCenterL11nMapper::class,
'table' => 'accounting_costcenter_l11n',
'self' => 'accounting_costcenter_l11n_costcenter',
'column' => 'content',
'external' => null,
'external' => null,
],
];

View File

@ -61,18 +61,6 @@ class CostObject
public int $unit = 0;
/**
* Get balance id
*
* @return int
*
* @since 1.0.0
*/
public function getId() : int
{
return $this->id;
}
/**
* Set l11n
*
@ -88,12 +76,12 @@ class CostObject
if ($l11n instanceof BaseStringL11n) {
$this->l11n = $l11n;
} elseif (isset($this->l11n) && $this->l11n instanceof BaseStringL11n) {
$this->l11n->content = $l11n;
$this->l11n->setLanguage($lang);
$this->l11n->content = $l11n;
$this->l11n->language = $lang;
} else {
$this->l11n = new BaseStringL11n();
$this->l11n->content = $l11n;
$this->l11n->setLanguage($lang);
$this->l11n = new BaseStringL11n();
$this->l11n->content = $l11n;
$this->l11n->language = $lang;
}
}
@ -117,9 +105,9 @@ class CostObject
public function toArray() : array
{
return [
'id' => $this->id,
'code' => $this->code,
'parent' => $this->parent,
'id' => $this->id,
'code' => $this->code,
'parent' => $this->parent,
];
}

View File

@ -37,10 +37,10 @@ final class CostObjectL11nMapper extends DataMapperFactory
* @since 1.0.0
*/
public const COLUMNS = [
'accounting_costobject_l11n_id' => ['name' => 'accounting_costobject_l11n_id', 'type' => 'int', 'internal' => 'id'],
'accounting_costobject_l11n_name' => ['name' => 'accounting_costobject_l11n_name', 'type' => 'string', 'internal' => 'content', 'autocomplete' => true],
'accounting_costobject_l11n_costobject' => ['name' => 'accounting_costobject_l11n_costobject', 'type' => 'int', 'internal' => 'ref'],
'accounting_costobject_l11n_language' => ['name' => 'accounting_costobject_l11n_language', 'type' => 'string', 'internal' => 'language'],
'accounting_costobject_l11n_id' => ['name' => 'accounting_costobject_l11n_id', 'type' => 'int', 'internal' => 'id'],
'accounting_costobject_l11n_name' => ['name' => 'accounting_costobject_l11n_name', 'type' => 'string', 'internal' => 'content', 'autocomplete' => true],
'accounting_costobject_l11n_costobject' => ['name' => 'accounting_costobject_l11n_costobject', 'type' => 'int', 'internal' => 'ref'],
'accounting_costobject_l11n_language' => ['name' => 'accounting_costobject_l11n_language', 'type' => 'string', 'internal' => 'language'],
];
/**

View File

@ -49,11 +49,11 @@ final class CostObjectMapper extends DataMapperFactory
*/
public const HAS_MANY = [
'l11n' => [
'mapper' => CostObjectL11nMapper::class,
'table' => 'accounting_costobject_l11n',
'self' => 'accounting_costobject_l11n_costobject',
'mapper' => CostObjectL11nMapper::class,
'table' => 'accounting_costobject_l11n',
'self' => 'accounting_costobject_l11n_costobject',
'column' => 'content',
'external' => null,
'external' => null,
],
];

View File

@ -42,26 +42,14 @@ class Creditor
*/
public $account = null;
/**
* Get id.
*
* @return int
*
* @since 1.0.0
*/
public function getId() : int
{
return $this->id;
}
/**
* {@inheritdoc}
*/
public function toArray() : array
{
return [
'id' => $this->id,
'account' => $this->account,
'id' => $this->id,
'account' => $this->account,
];
}

View File

@ -42,26 +42,14 @@ class Debitor
*/
public $account = null;
/**
* Get id.
*
* @return int
*
* @since 1.0.0
*/
public function getId() : int
{
return $this->id;
}
/**
* {@inheritdoc}
*/
public function toArray() : array
{
return [
'id' => $this->id,
'account' => $this->account,
'id' => $this->id,
'account' => $this->account,
];
}

View File

@ -15,13 +15,32 @@ declare(strict_types=1);
namespace Modules\Accounting\Models;
/**
* Posting interface.
* Null model
*
* @package Modules\Accounting\Models
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/
interface PostingInterface
final class NullAccountAbstract extends AccountAbstract
{
/**
* Constructor
*
* @param int $id Model id
*
* @since 1.0.0
*/
public function __construct(int $id = 0)
{
$this->id = $id;
}
/**
* {@inheritdoc}
*/
public function jsonSerialize() : mixed
{
return ['id' => $this->id];
}
}

View File

@ -14,6 +14,9 @@ declare(strict_types=1);
namespace Modules\Accounting\Models;
use Modules\Admin\Models\Account;
use Modules\Admin\Models\NullAccount;
/**
* Posting class.
*
@ -22,6 +25,45 @@ namespace Modules\Accounting\Models;
* @link https://jingga.app
* @since 1.0.0
*/
abstract class Posting extends PostingAbstract
class Posting
{
public int $id = 0;
public int $status = 0;
public string $number = '';
public ?AccountAbstract $account = null;
public ?int $paymentTerms = null;
public ?int $payment = null;
public int $dunLevel = 0;
public bool $dunStop = false;
public ?int $bill = null;
public ?int $batch = null;
public int $value = 0;
public \DateTimeImmutable $createdAt;
public \DateTimeImmutable $performanceDate;
public Account $createdBy;
public int $unit = 0;
public array $elements = [];
public function __construct()
{
$this->createdAt = new \DateTimeImmutable('now');
$this->performanceDate = new \DateTimeImmutable('now');
$this->createdBy = new NullAccount();
}
}

68
Models/PostingElement.php Normal file
View File

@ -0,0 +1,68 @@
<?php
/**
* Jingga
*
* PHP Version 8.1
*
* @package Modules\Accounting\Models
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
namespace Modules\Accounting\Models;
use Modules\Admin\Models\Account;
use Modules\Admin\Models\NullAccount;
/**
* Posting class.
*
* @package Modules\Accounting\Models
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/
class PostingElement
{
public int $id = 0;
public int $status = 0;
public string $text = '';
public int $type = 0;
public \DateTimeImmutable $createdAt;
public \DateTimeImmutable $performanceDate;
public Account $createdBy;
public AccountAbstract $account;
public ?CostCenter $costcenter = null;
public ?CostObject $costobject = null;
public int $value = 0;
public int $tax = 0;
public int $unit = 0;
public ?self $opposite = null;
public int $posting = 0;
public function __construct()
{
$this->createdAt = new \DateTimeImmutable('now');
$this->performanceDate = new \DateTimeImmutable('now');
$this->createdBy = new NullAccount();
$this->account = new NullAccountAbstract();
}
}

View File

@ -0,0 +1,115 @@
<?php
/**
* Jingga
*
* PHP Version 8.1
*
* @package Modules\Accounting\Models
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
namespace Modules\Accounting\Models;
use Modules\Admin\Models\AccountMapper;
use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
/**
* Account mapper class.
*
* @package Modules\Accounting\Models
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*
* @template T of PostingElement
* @extends DataMapperFactory<T>
*/
class PostingElementMapper extends DataMapperFactory
{
/**
* Columns.
*
* @var array<string, array{name:string, type:string, internal:string, autocomplete?:bool, readonly?:bool, writeonly?:bool, annotations?:array}>
* @since 1.0.0
*/
public const COLUMNS = [
'accounting_posting_ele_id' => ['name' => 'accounting_posting_ele_id', 'type' => 'int', 'internal' => 'id'],
'accounting_posting_ele_status' => ['name' => 'accounting_posting_ele_status', 'type' => 'int', 'internal' => 'status'],
'accounting_posting_ele_text' => ['name' => 'accounting_posting_ele_text', 'type' => 'string', 'internal' => 'text'],
'accounting_posting_ele_type' => ['name' => 'accounting_posting_ele_type', 'type' => 'int', 'internal' => 'type'],
'accounting_posting_ele_account' => ['name' => 'accounting_posting_ele_account', 'type' => 'int', 'internal' => 'account'],
'accounting_posting_ele_cc' => ['name' => 'accounting_posting_ele_cc', 'type' => 'int', 'internal' => 'costcenter'],
'accounting_posting_ele_co' => ['name' => 'accounting_posting_ele_co', 'type' => 'int', 'internal' => 'costobject'],
'accounting_posting_ele_value' => ['name' => 'accounting_posting_ele_value', 'type' => 'int', 'internal' => 'value'],
'accounting_posting_ele_tax' => ['name' => 'accounting_posting_ele_tax', 'type' => 'int', 'internal' => 'tax'],
'accounting_posting_ele_createdat' => ['name' => 'accounting_posting_ele_createdat', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt'],
'accounting_posting_ele_createdby' => ['name' => 'accounting_posting_ele_createdby', 'type' => 'int', 'internal' => 'createdBy'],
'accounting_posting_ele_performance' => ['name' => 'accounting_posting_ele_performance', 'type' => 'DateTimeImmutable', 'internal' => 'performanceDate'],
'accounting_posting_ele_opposite' => ['name' => 'accounting_posting_ele_opposite', 'type' => 'int', 'internal' => 'opposite'],
'accounting_posting_ele_posting' => ['name' => 'accounting_posting_ele_posting', 'type' => 'int', 'internal' => 'posting'],
'accounting_posting_ele_unit' => ['name' => 'accounting_posting_ele_unit', 'type' => 'int', 'internal' => 'unit'],
];
/**
* Has one relation.
*
* @var array<string, array{mapper:class-string, external:string, by?:string, column?:string, conditional?:bool}>
* @since 1.0.0
*/
public const OWNS_ONE = [
'account' => [
'mapper' => AccountAbstractMapper::class,
'external' => 'accounting_posting_ele_account',
],
'createdBy' => [
'mapper' => AccountMapper::class,
'external' => 'accounting_posting_ele_createdby',
],
'costcenter' => [
'mapper' => CostCenterMapper::class,
'external' => 'accounting_posting_ele_cc',
],
'costobject' => [
'mapper' => CostObjectMapper::class,
'external' => 'accounting_posting_ele_co',
],
/*
'opposite' => [
'mapper' => PostingElementMapper::class,
'external' => 'accounting_posting_ele_opposite',
],
'posting' => [
'mapper' => PostingMapper::class,
'external' => 'accounting_posting_ele_posting',
],
*/
];
/**
* Model to use by the mapper.
*
* @var class-string<T>
* @since 1.0.0
*/
public const MODEL = PostingElement::class;
/**
* Primary table.
*
* @var string
* @since 1.0.0
*/
public const TABLE = 'accounting_posting_ele';
/**
* Primary field name.
*
* @var string
* @since 1.0.0
*/
public const PRIMARYFIELD = 'accounting_posting_ele_id';
}

112
Models/PostingMapper.php Normal file
View File

@ -0,0 +1,112 @@
<?php
/**
* Jingga
*
* PHP Version 8.1
*
* @package Modules\Accounting\Models
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
namespace Modules\Accounting\Models;
use Modules\Admin\Models\AccountMapper;
use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
/**
* Account mapper class.
*
* @package Modules\Accounting\Models
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*
* @template T of Posting
* @extends DataMapperFactory<T>
*/
class PostingMapper extends DataMapperFactory
{
/**
* Columns.
*
* @var array<string, array{name:string, type:string, internal:string, autocomplete?:bool, readonly?:bool, writeonly?:bool, annotations?:array}>
* @since 1.0.0
*/
public const COLUMNS = [
'accounting_posting_id' => ['name' => 'accounting_posting_id', 'type' => 'int', 'internal' => 'id'],
'accounting_posting_status' => ['name' => 'accounting_posting_status', 'type' => 'int', 'internal' => 'status'],
'accounting_posting_number' => ['name' => 'accounting_posting_number', 'type' => 'string', 'internal' => 'number'],
'accounting_posting_account' => ['name' => 'accounting_posting_account', 'type' => 'int', 'internal' => 'account'],
'accounting_posting_paymentterms' => ['name' => 'accounting_posting_paymentterms', 'type' => 'int', 'internal' => 'paymentTerms'],
'accounting_posting_payment' => ['name' => 'accounting_posting_payment', 'type' => 'int', 'internal' => 'payment'],
'accounting_posting_dun_level' => ['name' => 'accounting_posting_dun_level', 'type' => 'int', 'internal' => 'dunLevel'],
'accounting_posting_dun_stop' => ['name' => 'accounting_posting_dun_stop', 'type' => 'bool', 'internal' => 'dunStop'],
'accounting_posting_bill' => ['name' => 'accounting_posting_bill', 'type' => 'int', 'internal' => 'bill'],
'accounting_posting_batch' => ['name' => 'accounting_posting_batch', 'type' => 'int', 'internal' => 'batch'],
'accounting_posting_value' => ['name' => 'accounting_posting_value', 'type' => 'int', 'internal' => 'value'],
'accounting_posting_createdat' => ['name' => 'accounting_posting_createdat', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt'],
'accounting_posting_createdby' => ['name' => 'accounting_posting_createdby', 'type' => 'int', 'internal' => 'createdBy'],
'accounting_posting_performance' => ['name' => 'accounting_posting_performance', 'type' => 'DateTimeImmutable', 'internal' => 'performanceDate'],
'accounting_posting_unit' => ['name' => 'accounting_posting_unit', 'type' => 'int', 'internal' => 'unit'],
];
/**
* Has one relation.
*
* @var array<string, array{mapper:class-string, external:string, by?:string, column?:string, conditional?:bool}>
* @since 1.0.0
*/
public const OWNS_ONE = [
'account' => [
'mapper' => AccountAbstractMapper::class,
'external' => 'accounting_posting_account',
],
'createdBy' => [
'mapper' => AccountMapper::class,
'external' => 'accounting_posting_createdby',
],
];
/**
* Has many relation.
*
* @var array<string, array{mapper:class-string, table:string, self?:?string, external?:?string, column?:string}>
* @since 1.0.0
*/
public const HAS_MANY = [
'elements' => [
'mapper' => PostingElementMapper::class,
'table' => 'accounting_posting_ele',
'self' => 'accounting_posting_ele_posting',
'external' => null,
],
];
/**
* Model to use by the mapper.
*
* @var class-string<T>
* @since 1.0.0
*/
public const MODEL = Posting::class;
/**
* Primary table.
*
* @var string
* @since 1.0.0
*/
public const TABLE = 'accounting_posting';
/**
* Primary field name.
*
* @var string
* @since 1.0.0
*/
public const PRIMARYFIELD = 'accounting_posting_id';
}

9
Models/PostingAbstract.php → Models/PostingSide.php Executable file → Normal file
View File

@ -14,14 +14,19 @@ declare(strict_types=1);
namespace Modules\Accounting\Models;
use phpOMS\Stdlib\Base\Enum;
/**
* Posting abstract class.
* Posting side enum.
*
* @package Modules\Accounting\Models
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/
abstract class PostingAbstract implements PostingInterface
abstract class PostingSide extends Enum
{
public const DEBIT = 1; /* Soll */
public const CREDIT = 2; /* Haben */
}

View File

@ -34,7 +34,7 @@ abstract class TimeRangeType extends Enum
public const ASSOCIATED_DATE = 4; /* Date of the association (e.g. when did the articles arrive) */
public const PERIOD_DATE = 5; /* Date of the period this booking is assoziated with */
public const PERIOD_DATE = 5; /* Date of the period this booking is associated with */
public const SQUARED_DATE = 6; /* Date of when the entry got squared/balanced */
}

View File

@ -17,7 +17,7 @@ return ['Accounting' => [
'Accounts' => 'Konten',
'BatchPostings' => 'Chargenbuchungen',
'Charts' => 'Charts',
'COA' => 'Chart of Accounts (COA)',
'COA' => 'Chart of Accounts (COA)',
'Code' => 'Code',
'ContraAccount' => 'Gegenkonto',
'CostCenter' => 'Kostenstelle',
@ -50,38 +50,38 @@ return ['Accounting' => [
'Total' => 'Gesamt',
'Type' => 'Typ',
'City' => 'Stadt',
'Zip' => 'Postleitzahl',
'Address' => 'Adresse',
'Country' => 'Land',
'Zip' => 'Postleitzahl',
'Address' => 'Adresse',
'Country' => 'Land',
'Info' => 'Info',
'Date' => 'Datum',
'Number' => 'Nummer',
'Payment' => 'Zahlung',
'Number' => 'Nummer',
'Payment' => 'Zahlung',
'Open' => 'Offen',
'Balanced' => 'Ausgeglichen',
'Balance' => 'Ausgleich',
'YTDSales' => 'Ytd Sales',
'MTDSales' => 'Mtd Sales',
'CLV' => 'CLV',
'LastContact' => 'Letzter Kontakt',
'LastOrder' => 'Letzte Bestellung',
'DSO' => 'DSO',
'Name1' => 'Name 1',
'Name2' => 'Name 2',
'Name3' => 'Name 3',
'Contact' => 'Kontakt',
'Phone' => 'Telefon',
'Email' => 'Email',
'Website' => 'Webseite',
'Postal' => 'Postleitzahl',
'Map' => 'Karte',
'RecentInvoices' => 'Neuste Rechnungen',
'Notes' => 'Notizen',
'Documents' => 'Dokumente',
'CreatedAt' => 'Erstellt',
'Finance' => 'Finanzen',
'Files' => 'Dateien',
'Title' => 'Titel',
'Net' => 'Netto',
'BalanceSheet' => 'Balance Sheet',
'Balanced' => 'Ausgeglichen',
'Balance' => 'Ausgleich',
'YTDSales' => 'Ytd Sales',
'MTDSales' => 'Mtd Sales',
'CLV' => 'CLV',
'LastContact' => 'Letzter Kontakt',
'LastOrder' => 'Letzte Bestellung',
'DSO' => 'DSO',
'Name1' => 'Name 1',
'Name2' => 'Name 2',
'Name3' => 'Name 3',
'Contact' => 'Kontakt',
'Phone' => 'Telefon',
'Email' => 'Email',
'Website' => 'Webseite',
'Postal' => 'Postleitzahl',
'Map' => 'Karte',
'RecentInvoices' => 'Neuste Rechnungen',
'Notes' => 'Notizen',
'Documents' => 'Dokumente',
'CreatedAt' => 'Erstellt',
'Finance' => 'Finanzen',
'Files' => 'Dateien',
'Title' => 'Titel',
'Net' => 'Netto',
'BalanceSheet' => 'Balance Sheet',
]];

View File

@ -17,7 +17,7 @@ return ['Accounting' => [
'Accounts' => 'Accounts',
'BatchPostings' => 'Batch Postings',
'Charts' => 'Charts',
'COA' => 'Chart of Accounts (COA)',
'COA' => 'Chart of Accounts (COA)',
'Code' => 'Code',
'ContraAccount' => 'Contra Account',
'CostCenter' => 'Cost Center',
@ -50,38 +50,38 @@ return ['Accounting' => [
'Total' => 'Total',
'Type' => 'Type',
'City' => 'City',
'Zip' => 'Zip',
'Address' => 'Address',
'Country' => 'Country',
'Zip' => 'Zip',
'Address' => 'Address',
'Country' => 'Country',
'Info' => 'Info',
'Date' => 'Date',
'Number' => 'Number',
'Payment' => 'Payment',
'Number' => 'Number',
'Payment' => 'Payment',
'Open' => 'Open',
'Balanced' => 'Balanced',
'Balance' => 'Balance',
'YTDSales' => 'YTD Sales',
'MTDSales' => 'MTD Sales',
'CLV' => 'CLV',
'LastContact' => 'Last Contact',
'LastOrder' => 'Last Order',
'DSO' => 'DSO',
'Name1' => 'Name 1',
'Name2' => 'Name 2',
'Name3' => 'Name 3',
'Contact' => 'Contact',
'Phone' => 'Phone',
'Email' => 'Email',
'Website' => 'Website',
'Postal' => 'Postal',
'Map' => 'Map',
'RecentInvoices' => 'Recent Invoices',
'Notes' => 'Notes',
'Documents' => 'Documents',
'CreatedAt' => 'Created At',
'Finance' => 'Finance',
'Files' => 'Files',
'Title' => 'Title',
'Net' => 'Net',
'BalanceSheet' => 'Balance Sheet',
'Balanced' => 'Balanced',
'Balance' => 'Balance',
'YTDSales' => 'YTD Sales',
'MTDSales' => 'MTD Sales',
'CLV' => 'CLV',
'LastContact' => 'Last Contact',
'LastOrder' => 'Last Order',
'DSO' => 'DSO',
'Name1' => 'Name 1',
'Name2' => 'Name 2',
'Name3' => 'Name 3',
'Contact' => 'Contact',
'Phone' => 'Phone',
'Email' => 'Email',
'Website' => 'Website',
'Postal' => 'Postal',
'Map' => 'Map',
'RecentInvoices' => 'Recent Invoices',
'Notes' => 'Notes',
'Documents' => 'Documents',
'CreatedAt' => 'Created At',
'Finance' => 'Finance',
'Files' => 'Files',
'Title' => 'Title',
'Net' => 'Net',
'BalanceSheet' => 'Balance Sheet',
]];

View File

@ -34,7 +34,7 @@ echo $this->data['nav']->render(); ?>
<tbody>
<?php $c = 0;
foreach ($accounts as $key => $value) : ++$c;
$url = UriFactory::build('{/base}/accounting/coa/profile?{?}&id=' . $value->id); ?>
$url = UriFactory::build('{/base}/accounting/coa/view?{?}&id=' . $value->id); ?>
<tr data-href="<?= $url; ?>">
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->code); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getL11n()); ?></a>

View File

@ -35,7 +35,7 @@ echo $this->data['nav']->render(); ?>
<td class="wf-100"><?= $this->getHtml('Name'); ?>
<tbody>
<?php $count = 0; foreach ($costcenter as $key => $value) : ++$count;
$url = UriFactory::build('{/base}/tag/single?{?}&id=' . $value->id); ?>
$url = UriFactory::build('{/base}/tag/view?{?}&id=' . $value->id); ?>
<tr tabindex="0" data-href="<?= $url; ?>">
<td data-label="<?= $this->getHtml('Code'); ?>"><a href="<?= $url; ?>">
<?= $this->printHtml($value->code); ?></a>

View File

@ -35,7 +35,7 @@ echo $this->data['nav']->render(); ?>
<td class="wf-100"><?= $this->getHtml('Name'); ?>
<tbody>
<?php $count = 0; foreach ($costobject as $key => $value) : ++$count;
$url = UriFactory::build('{/base}/tag/single?{?}&id=' . $value->id); ?>
$url = UriFactory::build('{/base}/tag/view?{?}&id=' . $value->id); ?>
<tr tabindex="0" data-href="<?= $url; ?>">
<td data-label="<?= $this->getHtml('Code'); ?>"><a href="<?= $url; ?>">
<?= $this->printHtml($value->code); ?></a>

View File

View File

@ -27,76 +27,76 @@ echo $this->data['nav']->render(); ?>
<section class="portlet">
<div class="portlet-head"><?= $this->getHtml('Accounts'); ?><i class="g-icon download btn end-xs">download</i></div>
<div class="slider">
<table id="iSalesClientList" class="default sticky">
<table id="iPersonalAccountList" class="default sticky">
<thead>
<tr>
<td><?= $this->getHtml('ID', '0', '0'); ?>
<label for="iSalesClientList-sort-1">
<input type="radio" name="iSalesClientList-sort" id="iSalesClientList-sort-1">
<label for="iPersonalAccountList-sort-1">
<input type="radio" name="iPersonalAccountList-sort" id="iPersonalAccountList-sort-1">
<i class="sort-asc g-icon">expand_less</i>
</label>
<label for="iSalesClientList-sort-2">
<input type="radio" name="iSalesClientList-sort" id="iSalesClientList-sort-2">
<label for="iPersonalAccountList-sort-2">
<input type="radio" name="iPersonalAccountList-sort" id="iPersonalAccountList-sort-2">
<i class="sort-desc g-icon">expand_more</i>
</label>
<label>
<i class="filter g-icon">filter_alt</i>
</label>
<td class="wf-100"><?= $this->getHtml('Name'); ?>
<label for="iSalesClientList-sort-3">
<input type="radio" name="iSalesClientList-sort" id="iSalesClientList-sort-3">
<label for="iPersonalAccountList-sort-3">
<input type="radio" name="iPersonalAccountList-sort" id="iPersonalAccountList-sort-3">
<i class="sort-asc g-icon">expand_less</i>
</label>
<label for="iSalesClientList-sort-4">
<input type="radio" name="iSalesClientList-sort" id="iSalesClientList-sort-4">
<label for="iPersonalAccountList-sort-4">
<input type="radio" name="iPersonalAccountList-sort" id="iPersonalAccountList-sort-4">
<i class="sort-desc g-icon">expand_more</i>
</label>
<label>
<i class="filter g-icon">filter_alt</i>
</label>
<td><?= $this->getHtml('City'); ?>
<label for="iSalesClientList-sort-5">
<input type="radio" name="iSalesClientList-sort" id="iSalesClientList-sort-5">
<label for="iPersonalAccountList-sort-5">
<input type="radio" name="iPersonalAccountList-sort" id="iPersonalAccountList-sort-5">
<i class="sort-asc g-icon">expand_less</i>
</label>
<label for="iSalesClientList-sort-6">
<input type="radio" name="iSalesClientList-sort" id="iSalesClientList-sort-6">
<label for="iPersonalAccountList-sort-6">
<input type="radio" name="iPersonalAccountList-sort" id="iPersonalAccountList-sort-6">
<i class="sort-desc g-icon">expand_more</i>
</label>
<label>
<i class="filter g-icon">filter_alt</i>
</label>
<td><?= $this->getHtml('Zip'); ?>
<label for="iSalesClientList-sort-7">
<input type="radio" name="iSalesClientList-sort" id="iSalesClientList-sort-7">
<label for="iPersonalAccountList-sort-7">
<input type="radio" name="iPersonalAccountList-sort" id="iPersonalAccountList-sort-7">
<i class="sort-asc g-icon">expand_less</i>
</label>
<label for="iSalesClientList-sort-8">
<input type="radio" name="iSalesClientList-sort" id="iSalesClientList-sort-8">
<label for="iPersonalAccountList-sort-8">
<input type="radio" name="iPersonalAccountList-sort" id="iPersonalAccountList-sort-8">
<i class="sort-desc g-icon">expand_more</i>
</label>
<label>
<i class="filter g-icon">filter_alt</i>
</label>
<td><?= $this->getHtml('Address'); ?>
<label for="iSalesClientList-sort-9">
<input type="radio" name="iSalesClientList-sort" id="iSalesClientList-sort-9">
<label for="iPersonalAccountList-sort-9">
<input type="radio" name="iPersonalAccountList-sort" id="iPersonalAccountList-sort-9">
<i class="sort-asc g-icon">expand_less</i>
</label>
<label for="iSalesClientList-sort-10">
<input type="radio" name="iSalesClientList-sort" id="iSalesClientList-sort-10">
<label for="iPersonalAccountList-sort-10">
<input type="radio" name="iPersonalAccountList-sort" id="iPersonalAccountList-sort-10">
<i class="sort-desc g-icon">expand_more</i>
</label>
<label>
<i class="filter g-icon">filter_alt</i>
</label>
<td><?= $this->getHtml('Country'); ?>
<label for="iSalesClientList-sort-11">
<input type="radio" name="iSalesClientList-sort" id="iSalesClientList-sort-11">
<label for="iPersonalAccountList-sort-11">
<input type="radio" name="iPersonalAccountList-sort" id="iPersonalAccountList-sort-11">
<i class="sort-asc g-icon">expand_less</i>
</label>
<label for="iSalesClientList-sort-12">
<input type="radio" name="iSalesClientList-sort" id="iSalesClientList-sort-12">
<label for="iPersonalAccountList-sort-12">
<input type="radio" name="iPersonalAccountList-sort" id="iPersonalAccountList-sort-12">
<i class="sort-desc g-icon">expand_more</i>
</label>
<label>
@ -105,7 +105,7 @@ echo $this->data['nav']->render(); ?>
<tbody>
<?php $count = 0;
foreach ($accounts as $key => $value) : ++$count;
$url = UriFactory::build('{/base}/accounting/' . $type . '/profile?{?}&id=' . $value->id);
$url = UriFactory::build('{/base}/accounting/' . $type . '/view?{?}&id=' . $value->id);
?>
<tr data-href="<?= $url; ?>">
<td data-label="<?= $this->getHtml('ID', '0', '0'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->number); ?></a>
@ -113,7 +113,7 @@ echo $this->data['nav']->render(); ?>
<td data-label="<?= $this->getHtml('City'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->mainAddress->city); ?></a>
<td data-label="<?= $this->getHtml('Zip'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->mainAddress->postal); ?></a>
<td data-label="<?= $this->getHtml('Address'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->mainAddress->address); ?></a>
<td data-label="<?= $this->getHtml('Country'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->mainAddress->getCountry()); ?></a>
<td data-label="<?= $this->getHtml('Country'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->mainAddress->country); ?></a>
<?php endforeach; ?>
<?php if ($count === 0) : ?>
<tr><td colspan="8" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>

View File

@ -22,16 +22,14 @@ use phpOMS\Uri\UriFactory;
/** @var \phpOMS\Views\View $this */
$account = $this->data['account'] ?? null;
$notes = $account->notes;
$files = $account->files;
$accountImage = $this->getData('accountImage') ?? new NullMedia();
$attributeView = $this->data['attributeView'];
$attributeView = $this->data['attributeView'];
$countryCodes = \phpOMS\Localization\ISO3166TwoEnum::getConstants();
$countries = \phpOMS\Localization\ISO3166NameEnum::getConstants();
$languages = ISO639Enum::getConstants();
$languages = ISO639Enum::getConstants();
echo $this->data['nav']->render(); ?>
<div class="tabview tab-2">
@ -97,17 +95,17 @@ echo $this->data['nav']->render(); ?>
<div class="portlet-body">
<div class="form-group">
<label for="iPhone"><?= $this->getHtml('Phone'); ?></label>
<input type="text" id="iPhone" name="name1" value="<?= $this->printHtml($account->getMainContactElement(ContactType::PHONE)->content); ?>">
<input type="text" id="iPhone" name="name1" value="<?= $this->printHtml($account->account->getContactByType(ContactType::PHONE)->content); ?>">
</div>
<div class="form-group">
<label for="iEmail"><?= $this->getHtml('Email'); ?></label>
<input type="text" id="iEmail" name="name1" value="<?= $this->printHtml($account->getMainContactElement(ContactType::EMAIL)->content); ?>">
<input type="text" id="iEmail" name="name1" value="<?= $this->printHtml($account->account->getContactByType(ContactType::EMAIL)->content); ?>">
</div>
<div class="form-group">
<label for="iWebsite"><?= $this->getHtml('Website'); ?></label>
<input type="text" id="iWebsite" name="name1" value="<?= $this->printHtml($account->getMainContactElement(ContactType::WEBSITE)->content); ?>">
<input type="text" id="iWebsite" name="name1" value="<?= $this->printHtml($account->account->getContactByType(ContactType::WEBSITE)->content); ?>">
</div>
</div>
</section>
@ -170,7 +168,7 @@ echo $this->data['nav']->render(); ?>
<label for="iCountry"><?= $this->getHtml('Country'); ?></label>
<select id="iCountry" name="country">
<?php foreach ($countryCodes as $code3 => $code2) : ?>
<option value="<?= $this->printHtml($code2); ?>"<?= $this->printHtml($code2 === $account->mainAddress->getCountry() ? ' selected' : ''); ?>><?= $this->printHtml($countries[$code3]); ?>
<option value="<?= $this->printHtml($code2); ?>"<?= $this->printHtml($code2 === $account->mainAddress->country ? ' selected' : ''); ?>><?= $this->printHtml($countries[$code3]); ?>
<?php endforeach; ?>
</select>
</div>
@ -198,7 +196,7 @@ echo $this->data['nav']->render(); ?>
</section>
</div>
<div class="col-xs-12 col-lg-9 plain-grid">
<?php if (!empty($notes) && ($warning = $account->getEditorDocByTypeName('account_backend_warning'))->id !== 0) : ?>
<?php if (!empty($account->notes) && ($warning = $account->getEditorDocByTypeName('account_backend_warning'))->id !== 0) : ?>
<!-- If note warning exists -->
<div class="row">
<div class="col-xs-12">
@ -269,8 +267,8 @@ echo $this->data['nav']->render(); ?>
<td class="wf-100"><?= $this->getHtml('Title'); ?>
<td><?= $this->getHtml('CreatedAt'); ?>
<tbody>
<?php foreach ($notes as $note) :
$url = UriFactory::build('{/base}/editor/single?{?}&id=' . $note->id);
<?php foreach ($account->notes as $note) :
$url = UriFactory::build('{/base}/editor/view?{?}&id=' . $note->id);
?>
<tr data-href="<?= $url; ?>">
<td><a href="<?= $url; ?>"><?= $note->title; ?></a>
@ -292,8 +290,8 @@ echo $this->data['nav']->render(); ?>
<td>
<td><?= $this->getHtml('CreatedAt'); ?>
<tbody>
<?php foreach ($files as $file) :
$url = UriFactory::build('{/base}/media/single?{?}&id=' . $file->id);
<?php foreach ($account->files as $file) :
$url = UriFactory::build('{/base}/media/view?{?}&id=' . $file->id);
?>
<tr data-href="<?= $url; ?>">
<td><a href="<?= $url; ?>"><?= $file->name; ?></a>
@ -464,15 +462,17 @@ echo $this->data['nav']->render(); ?>
<input type="radio" id="c-tab-4" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-4' ? ' checked' : ''; ?>>
<div class="tab">
<?= $this->data['contact-component']->render('account-contact', 'contacts', $account->account->contacts); ?>
<?= $this->data['address-component']->render('account-address', 'addresses', $account->account->addresses); ?>
</div>
<input type="radio" id="c-tab-5" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-5' ? ' checked' : ''; ?>>
<div class="tab">
<div class="tab col-simple">
<?= $this->data['media-upload']->render('account-file', 'files', '', $account->files); ?>
</div>
<input type="radio" id="c-tab-6" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-6' ? ' checked' : ''; ?>>
<div class="tab">
<div class="tab col-simple">
<?= $this->data['note']->render('account-note', 'notes', $account->notes); ?>
</div>
</div>

View File

@ -0,0 +1,479 @@
<?php
/**
* Jingga
*
* PHP Version 8.1
*
* @package Modules\HumanResourceTimeRecording
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
use Modules\Admin\Models\ContactType;
use Modules\Billing\Models\SalesBillMapper;
use Modules\Media\Models\NullMedia;
use phpOMS\DataStorage\Database\Query\OrderType;
use phpOMS\Localization\ISO639Enum;
use phpOMS\Stdlib\Base\SmartDateTime;
use phpOMS\Uri\UriFactory;
/** @var \phpOMS\Views\View $this */
$account = $this->data['account'] ?? null;
$accountImage = $this->getData('accountImage') ?? new NullMedia();
$attributeView = $this->data['attributeView'];
$countryCodes = \phpOMS\Localization\ISO3166TwoEnum::getConstants();
$countries = \phpOMS\Localization\ISO3166NameEnum::getConstants();
$languages = ISO639Enum::getConstants();
echo $this->data['nav']->render(); ?>
<div class="tabview tab-2">
<div class="box">
<ul class="tab-links">
<li><label for="c-tab-1"><?= $this->getHtml('Account'); ?></label>
<li><label for="c-tab-2"><?= $this->getHtml('Finance'); ?></label>
<li><label for="c-tab-7"><?= $this->getHtml('Payment'); ?></label>
<li><label for="c-tab-3"><?= $this->getHtml('Entries'); ?></label>
<li><label for="c-tab-4"><?= $this->getHtml('Address'); ?></label>
<li><label for="c-tab-5"><?= $this->getHtml('Files'); ?></label>
<li><label for="c-tab-6"><?= $this->getHtml('Notes'); ?></label>
</ul>
</div>
<div class="tab-content">
<input type="radio" id="c-tab-1" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-1' ? ' checked' : ''; ?>>
<div class="tab">
<div class="row">
<div class="col-xs-12 col-lg-3 last-lg">
<div class="box">
<?php if(true) : ?>
<a class="button" href="<?= UriFactory::build('{/base}/sales/bill/create?account=' . $account->id); ?>"><?= $this->getHtml('CreateBill', 'Billing'); ?></a>
<?php endif; ?>
<?php if (false) : ?>
<a class="button"><?= $this->getHtml('ViewAccount', 'Accounting'); ?></a>
<?php endif; ?>
</div>
<section class="portlet">
<form>
<div class="portlet-body">
<div class="form-group">
<label for="iId"><?= $this->getHtml('ID', '0', '0'); ?></label>
<span class="input"><button type="button" formaction=""><i class="g-icon">book</i></button><input type="number" id="iId" min="1" name="id" value="<?= $this->printHtml($account->number); ?>" disabled></span>
</div>
<div class="form-group">
<label for="iName1"><?= $this->getHtml('Name1'); ?></label>
<input type="text" id="iName1" name="name1" value="<?= $this->printHtml($account->account->name1); ?>" required>
</div>
<div class="form-group">
<label for="iName2"><?= $this->getHtml('Name2'); ?></label>
<input type="text" id="iName2" name="name2" value="<?= $this->printHtml($account->account->name2); ?>">
</div>
<div class="form-group">
<label for="iName3"><?= $this->getHtml('Name3'); ?></label>
<input type="text" id="iName3" name="name3" value="<?= $this->printHtml($account->account->name3); ?>">
</div>
</div>
<div class="portlet-foot">
<input type="submit" value="<?= $this->getHtml('Save', '0', '0'); ?>" name="save-account-profile"> <input type="submit" value="<?= $this->getHtml('Delete', '0', '0'); ?>" name="delete-account-profile">
</div>
</form>
</section>
<section class="portlet">
<div class="portlet-head">
<?= $this->getHtml('Contact'); ?>
<a class="end-xs" href=""><i class="g-icon btn">mail</i></a>
</div>
<div class="portlet-body">
<div class="form-group">
<label for="iPhone"><?= $this->getHtml('Phone'); ?></label>
<input type="text" id="iPhone" name="name1" value="<?= $this->printHtml($account->account->getContactByType(ContactType::PHONE)->content); ?>">
</div>
<div class="form-group">
<label for="iEmail"><?= $this->getHtml('Email'); ?></label>
<input type="text" id="iEmail" name="name1" value="<?= $this->printHtml($account->account->getContactByType(ContactType::EMAIL)->content); ?>">
</div>
<div class="form-group">
<label for="iWebsite"><?= $this->getHtml('Website'); ?></label>
<input type="text" id="iWebsite" name="name1" value="<?= $this->printHtml($account->account->getContactByType(ContactType::WEBSITE)->content); ?>">
</div>
</div>
</section>
<section class="portlet map-small">
<div class="portlet-head">
<?= $this->getHtml('Address'); ?>
<span class="clickPopup end-xs">
<label for="addressDropdown"><i class="g-icon btn">print</i></label>
<input id="addressDropdown" name="addressDropdown" type="checkbox">
<div class="popup">
<ul>
<li>
<input id="id1" type="checkbox">
<ul>
<li>
<label for="id1">
<a href="" class="button">Word</a>
<span></span>
<i class="g-icon expand">chevron_right</i>
</label>
<li>Letter
</ul>
<li><label class="button cancel" for="addressDropdown">Cancel</label>
</ul>
</div>
</span>
</div>
<div class="portlet-body">
<?php if (!empty($account->mainAddress->fao)) : ?>
<div class="form-group">
<label for="iFAO"><?= $this->getHtml('FAO'); ?></label>
<input type="text" id="iFAO" name="fao" value="<?= $this->printHtml($account->mainAddress->fao); ?>">
</div>
<?php endif; ?>
<div class="form-group">
<label for="iAddress"><?= $this->getHtml('Address'); ?></label>
<input type="text" id="iAddress" name="address" value="<?= $this->printHtml($account->mainAddress->address); ?>" required>
</div>
<?php if (!empty($account->mainAddress->addressAddition)) : ?>
<div class="form-group">
<label for="iAddition"><?= $this->getHtml('Addition'); ?></label>
<input type="text" id="iAddition" name="addition" value="<?= $this->printHtml($account->mainAddress->addressAddition); ?>">
</div>
<?php endif; ?>
<div class="form-group">
<label for="iPostal"><?= $this->getHtml('Postal'); ?></label>
<input type="text" id="iPostal" name="postal" value="<?= $this->printHtml($account->mainAddress->postal); ?>" required>
</div>
<div class="form-group">
<label for="iCity"><?= $this->getHtml('City'); ?></label>
<input type="text" id="iCity" name="city" value="<?= $this->printHtml($account->mainAddress->city); ?>" required>
</div>
<div class="form-group">
<label for="iCountry"><?= $this->getHtml('Country'); ?></label>
<select id="iCountry" name="country">
<?php foreach ($countryCodes as $code3 => $code2) : ?>
<option value="<?= $this->printHtml($code2); ?>"<?= $this->printHtml($code2 === $account->mainAddress->country ? ' selected' : ''); ?>><?= $this->printHtml($countries[$code3]); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iClientMap"><?= $this->getHtml('Map'); ?></label>
<div id="iClientMap" class="map" data-lat="<?= $account->mainAddress->lat; ?>" data-lon="<?= $account->mainAddress->lon; ?>"></div>
</div>
</div>
</section>
<section class="portlet">
<div class="portlet-body">
<img alt="<?= $this->printHtml($accountImage->name); ?>" width="100%" loading="lazy" class="item-image"
src="<?= $accountImage->id === 0
? 'Web/Backend/img/logo_grey.png'
: UriFactory::build($accountImage->getPath()); ?>">
</div>
</section>
<section class="portlet highlight-4">
<div class="portlet-body">
<textarea class="undecorated"><?= $this->printHtml($account->info); ?></textarea>
</div>
</section>
</div>
<div class="col-xs-12 col-lg-9 plain-grid">
<?php if (!empty($account->notes) && ($warning = $account->getEditorDocByTypeName('account_backend_warning'))->id !== 0) : ?>
<!-- If note warning exists -->
<div class="row">
<div class="col-xs-12">
<section class="portlet highlight-1">
<div class="portlet-body"><?= $this->printHtml($warning->plain); ?></div>
</section>
</div>
</div>
<?php endif; ?>
<?php if ($this->data['hasBilling']) : ?>
<div class="row">
<div class="col-xs-12 col-lg-4">
<section class="portlet highlight-7">
<div class="portlet-body">
<table class="wf-100">
<tr><td><?= $this->getHtml('YTDSales'); ?>:
<td><?= $this->getCurrency(SalesBillMapper::getClientNetSales($account->id, SmartDateTime::startOfYear($this->data['business_start']), new \DateTime('now')), format: 'medium'); ?>
<tr><td><?= $this->getHtml('MTDSales'); ?>:
<td><?= $this->getCurrency(SalesBillMapper::getClientNetSales($account->id, SmartDateTime::startOfMonth(), new \DateTime('now')), format: 'medium'); ?>
<tr><td><?= $this->getHtml('CLV'); ?>:
<td><?= $this->getCurrency(SalesBillMapper::getCLVHistoric($account->id), format: 'medium'); ?>
</table>
</div>
</section>
</div>
<div class="col-xs-12 col-lg-4">
<section class="portlet highlight-2">
<div class="portlet-body">
<table class="wf-100">
<tr><td><?= $this->getHtml('LastContact'); ?>:
<td><?= SalesBillMapper::getClientLastOrder($account->id)?->format('Y-m-d'); ?>
<tr><td><?= $this->getHtml('LastOrder'); ?>:
<td><?= SalesBillMapper::getClientLastOrder($account->id)?->format('Y-m-d'); ?>
<tr><td><?= $this->getHtml('Created'); ?>:
<td><?= $account->createdAt->format('Y-m-d H:i'); ?>
</table>
</div>
</section>
</div>
<div class="col-xs-12 col-lg-4">
<section class="portlet highlight-3">
<div class="portlet-body">
<table class="wf-100">
<tr><td><?= $this->getHtml('DSO'); ?>:
<td>TBD
<tr><td><?= $this->getHtml('Due'); ?>:
<td>TBD
<tr><td><?= $this->getHtml('Balance'); ?>:
<td>TBD
</table>
</div>
</section>
</div>
</div>
<?php endif; ?>
<div class="row">
<div class="col-xs-12 col-md-6">
<section class="portlet">
<div class="portlet-head"><?= $this->getHtml('Notes'); ?></div>
<div class="slider">
<table id="iNotesItemList" class="default sticky">
<thead>
<tr>
<td class="wf-100"><?= $this->getHtml('Title'); ?>
<td><?= $this->getHtml('CreatedAt'); ?>
<tbody>
<?php foreach ($account->notes as $note) :
$url = UriFactory::build('{/base}/editor/view?{?}&id=' . $note->id);
?>
<tr data-href="<?= $url; ?>">
<td><a href="<?= $url; ?>"><?= $note->title; ?></a>
<td><a href="<?= $url; ?>"><?= $note->createdAt->format('Y-m-d'); ?></a>
<?php endforeach; ?>
</table>
</div>
</section>
</div>
<div class="col-xs-12 col-md-6">
<section class="portlet">
<div class="portlet-head"><?= $this->getHtml('Documents'); ?></div>
<div class="slider">
<table id="iFilesClientList" class="default sticky">
<thead>
<tr>
<td class="wf-100"><?= $this->getHtml('Title'); ?>
<td>
<td><?= $this->getHtml('CreatedAt'); ?>
<tbody>
<?php foreach ($account->files as $file) :
$url = UriFactory::build('{/base}/media/view?{?}&id=' . $file->id);
?>
<tr data-href="<?= $url; ?>">
<td><a href="<?= $url; ?>"><?= $file->name; ?></a>
<td><a href="<?= $url; ?>"><?= $file->extension; ?></a>
<td><a href="<?= $url; ?>"><?= $file->createdAt->format('Y-m-d'); ?></a>
<?php endforeach; ?>
</table>
</div>
</section>
</div>
</div>
<?php if ($this->data['hasBilling']) : ?>
<div class="row">
<div class="col-xs-12">
<section class="portlet">
<div class="portlet-head"><?= $this->getHtml('RecentInvoices'); ?></div>
<table id="iSalesItemList" class="default sticky">
<thead>
<tr>
<td><?= $this->getHtml('Number'); ?>
<td><?= $this->getHtml('Type'); ?>
<td class="wf-100"><?= $this->getHtml('Name'); ?>
<td><?= $this->getHtml('Net'); ?>
<td><?= $this->getHtml('Date'); ?>
<tbody>
<?php
$newestInvoices = SalesBillMapper::getAll()
->with('type')
->with('type/l11n')
->with('account')
->where('account', $account->id)
->where('type/l11n/language', $this->response->header->l11n->language)
->sort('id', OrderType::DESC)
->limit(5)
->execute();
/** @var \Modules\Billing\Models\Bill $invoice */
foreach ($newestInvoices as $invoice) :
$url = UriFactory::build('{/base}/sales/bill?{?}&id=' . $invoice->id);
?>
<tr data-href="<?= $url; ?>">
<td><a href="<?= $url; ?>"><?= $invoice->getNumber(); ?></a>
<td><a href="<?= $url; ?>"><?= $invoice->type->getL11n(); ?></a>
<td><a href="<?= $url; ?>"><?= $invoice->billTo; ?></a>
<td><a href="<?= $url; ?>"><?= $this->getCurrency($invoice->netSales); ?></a>
<td><a href="<?= $url; ?>"><?= $invoice->createdAt->format('Y-m-d'); ?></a>
<?php endforeach; ?>
</table>
</section>
</div>
</div>
<?php endif; ?>
</div>
</div>
</div>
<input type="radio" id="c-tab-2" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-2' ? ' checked' : ''; ?>>
<div class="tab">
<div class="row">
<div class="col-xs-12 col-sm-6">
<section class="portlet">
<div class="portlet-head"><?= $this->getHtml('Account'); ?></div>
<div class="portlet-body">
<div class="form-group">
<label for="iBalanceSheet"><?= $this->getHtml('BalanceSheet'); ?></label>
<input id="iBalanceSheet" type="text">
</div>
</div>
</section>
</div>
<div class="col-xs-12 col-sm-6">
<section class="portlet">
<div class="portlet-head"><?= $this->getHtml('Accounts'); ?></div>
<div class="slider">
<table class="default sticky">
<thead>
<tr>
<td>
<tbody>
<tr>
<td>
</table>
</div>
</section>
</div>
</div>
</div>
<input type="radio" id="c-tab-7" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-7' ? ' checked' : ''; ?>>
<div class="tab">
<div class="row">
</div>
</div>
<input type="radio" id="c-tab-3" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-3' ? ' checked' : ''; ?>>
<div class="tab">
<div class="row">
<div class="col-xs-12 col-lg-3 last-lg">
<section class="portlet">
<div class="portlet-head"><?= $this->getHtml('QuickAction'); ?></div>
<div class="portlet-body">
</div>
</section>
</div>
<div class="col-xs-12 col-lg-9 plain-grid">
<div class="row">
<div class="col-xs-12">
<section class="portlet col-simple" style="height: 350px;">
<div class="portlet-head top-xs"><?= $this->getHtml('Open'); ?></div>
<table id="iSalesItemList" class="default sticky">
<thead>
<tr>
<td>
<td><?= $this->getHtml('Info'); ?>
<td><?= $this->getHtml('Date'); ?>
<td><?= $this->getHtml('Credit'); ?>
<td><?= $this->getHtml('Debit'); ?>
<td><?= $this->getHtml('Number'); ?>
<td class="wf-100"><?= $this->getHtml('Text'); ?>
<td><?= $this->getHtml('Due'); ?>
<td><?= $this->getHtml('Payment'); ?>
<tbody>
<tr>
<td colspan="9" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
</table>
<div class="portlet-body col-xs"></div>
<div class="portlet-foot bottom-xs">
<?= $this->getHtml('Total'); ?>: 0.00
<?= $this->getHtml('Due'); ?>: 0.00
</div>
</section>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<section class="portlet col-simple" style="height: 350px;">
<div class="portlet-head top-xs"><?= $this->getHtml('Total'); ?></div>
<table id="iSalesItemList" class="default sticky">
<thead>
<tr>
<td><?= $this->getHtml('Info'); ?>
<td><?= $this->getHtml('Date'); ?>
<td><?= $this->getHtml('Credit'); ?>
<td><?= $this->getHtml('Debit'); ?>
<td><?= $this->getHtml('Number'); ?>
<td class="wf-100"><?= $this->getHtml('Text'); ?>
<td><?= $this->getHtml('Due'); ?>
<td><?= $this->getHtml('Payment'); ?>
<td><?= $this->getHtml('Balanced'); ?>
<td><?= $this->getHtml('Balance'); ?>
<tbody>
<tr>
<td colspan="10" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
</table>
<div class="portlet-body col-xs"></div>
</section>
</div>
</div>
</div>
</div>
</div>
<input type="radio" id="c-tab-4" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-4' ? ' checked' : ''; ?>>
<div class="tab">
<?= $this->data['contact-component']->render('account-contact', 'contacts', $account->account->contacts); ?>
<?= $this->data['address-component']->render('account-address', 'addresses', $account->account->addresses); ?>
</div>
<input type="radio" id="c-tab-5" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-5' ? ' checked' : ''; ?>>
<div class="tab col-simple">
<?= $this->data['media-upload']->render('account-file', 'files', '', $account->files); ?>
</div>
<input type="radio" id="c-tab-6" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-6' ? ' checked' : ''; ?>>
<div class="tab col-simple">
<?= $this->data['note']->render('account-note', 'notes', $account->notes); ?>
</div>
</div>
</div>

View File

@ -75,8 +75,8 @@ final class Autoloader
*/
public static function defaultAutoloader(string $class) : void
{
$class = \ltrim($class, '\\');
$class = \strtr($class, '_\\', '//');
$class = \ltrim($class, '\\');
$class = \strtr($class, '_\\', '//');
if (\stripos($class, 'Web/Backend') !== false || \stripos($class, 'Web/Api') !== false) {
$class = \is_dir(__DIR__ . '/Web') ? $class : \str_replace('Web/', 'MainRepository/Web/', $class);

View File

@ -1,4 +1,15 @@
<?php
/**
* Jingga
*
* PHP Version 8.1
*
* @package Modules\Accounting\tests
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
\ini_set('memory_limit', '2048M');
@ -67,10 +78,10 @@ $GLOBALS['is_github'] = $IS_GITHUB;
$tmp = FileLogger::getInstance(__DIR__ . '/../Logs');
$CONFIG = [
'db' => [
'db' => [
'core' => [
'masters' => [
'admin' => [
'admin' => [
'db' => 'mysql', /* db type */
'host' => '127.0.0.1', /* db host address */
'port' => '3306', /* db host port */
@ -80,7 +91,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'insert' => [
'insert' => [
'db' => 'mysql', /* db type */
'host' => '127.0.0.1', /* db host address */
'port' => '3306', /* db host port */
@ -90,7 +101,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'select' => [
'select' => [
'db' => 'mysql', /* db type */
'host' => '127.0.0.1', /* db host address */
'port' => '3306', /* db host port */
@ -100,7 +111,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'update' => [
'update' => [
'db' => 'mysql', /* db type */
'host' => '127.0.0.1', /* db host address */
'port' => '3306', /* db host port */
@ -110,7 +121,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'delete' => [
'delete' => [
'db' => 'mysql', /* db type */
'host' => '127.0.0.1', /* db host address */
'port' => '3306', /* db host port */
@ -120,7 +131,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'schema' => [
'schema' => [
'db' => 'mysql', /* db type */
'host' => '127.0.0.1', /* db host address */
'port' => '3306', /* db host port */
@ -132,7 +143,7 @@ $CONFIG = [
],
],
'postgresql' => [
'admin' => [
'admin' => [
'db' => 'pgsql', /* db type */
'host' => '127.0.0.1', /* db host address */
'port' => '5432', /* db host port */
@ -142,7 +153,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'insert' => [
'insert' => [
'db' => 'pgsql', /* db type */
'host' => '127.0.0.1', /* db host address */
'port' => '5432', /* db host port */
@ -152,7 +163,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'select' => [
'select' => [
'db' => 'pgsql', /* db type */
'host' => '127.0.0.1', /* db host address */
'port' => '5432', /* db host port */
@ -162,7 +173,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'update' => [
'update' => [
'db' => 'pgsql', /* db type */
'host' => '127.0.0.1', /* db host address */
'port' => '5432', /* db host port */
@ -172,7 +183,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'delete' => [
'delete' => [
'db' => 'pgsql', /* db type */
'host' => '127.0.0.1', /* db host address */
'port' => '5432', /* db host port */
@ -182,7 +193,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'schema' => [
'schema' => [
'db' => 'pgsql', /* db type */
'host' => '127.0.0.1', /* db host address */
'port' => '5432', /* db host port */
@ -194,37 +205,37 @@ $CONFIG = [
],
],
'sqlite' => [
'admin' => [
'admin' => [
'db' => 'sqlite', /* db type */
'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'insert' => [
'insert' => [
'db' => 'sqlite', /* db type */
'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'select' => [
'select' => [
'db' => 'sqlite', /* db type */
'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'update' => [
'update' => [
'db' => 'sqlite', /* db type */
'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'delete' => [
'delete' => [
'db' => 'sqlite', /* db type */
'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'schema' => [
'schema' => [
'db' => 'sqlite', /* db type */
'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */
'weight' => 1000, /* db table prefix */
@ -232,7 +243,7 @@ $CONFIG = [
],
],
'mssql' => [
'admin' => [
'admin' => [
'db' => 'mssql', /* db type */
'host' => '127.0.0.1', /* db host address */
'port' => '1433', /* db host port */
@ -242,7 +253,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'insert' => [
'insert' => [
'db' => 'mssql', /* db type */
'host' => '127.0.0.1', /* db host address */
'port' => '1433', /* db host port */
@ -252,7 +263,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'select' => [
'select' => [
'db' => 'mssql', /* db type */
'host' => '127.0.0.1', /* db host address */
'port' => '1433', /* db host port */
@ -262,7 +273,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'update' => [
'update' => [
'db' => 'mssql', /* db type */
'host' => '127.0.0.1', /* db host address */
'port' => '1433', /* db host port */
@ -272,7 +283,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'delete' => [
'delete' => [
'db' => 'mssql', /* db type */
'host' => '127.0.0.1', /* db host address */
'port' => '1433', /* db host port */
@ -282,7 +293,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'schema' => [
'schema' => [
'db' => 'mssql', /* db type */
'host' => '127.0.0.1', /* db host address */
'port' => '1433', /* db host port */
@ -322,16 +333,16 @@ $CONFIG = [
'password' => '123456',
],
],
'log' => [
'log' => [
'file' => [
'path' => __DIR__ . '/Logs',
],
],
'page' => [
'page' => [
'root' => '/',
'https' => false,
],
'app' => [
'app' => [
'path' => __DIR__,
'default' => [
'app' => 'Backend',
@ -350,7 +361,7 @@ $CONFIG = [
],
],
],
'socket' => [
'socket' => [
'master' => [
'host' => '127.0.0.1',
'limit' => 300,
@ -360,7 +371,7 @@ $CONFIG = [
'language' => [
'en',
],
'apis' => [
'apis' => [
],
];

View File

@ -17,7 +17,6 @@ namespace Modules\Accounting\tests\Controller\Api;
use phpOMS\Message\Http\HttpRequest;
use phpOMS\Message\Http\HttpResponse;
use phpOMS\Message\Http\RequestStatusCode;
use phpOMS\Uri\HttpUri;
trait ApiControllerAccountTrait
{
@ -28,7 +27,7 @@ trait ApiControllerAccountTrait
public function testApiAccountCreate() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('name', '1');
@ -46,7 +45,7 @@ trait ApiControllerAccountTrait
public function testApiAccountCreateInvalid() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('invalid', '1');
@ -62,7 +61,7 @@ trait ApiControllerAccountTrait
public function testApiAccountUpdate() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('id', '1');
@ -80,7 +79,7 @@ trait ApiControllerAccountTrait
public function testApiAccountUpdateInvalid() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('invalid', '1');

View File

@ -17,7 +17,6 @@ namespace Modules\Accounting\tests\Controller\Api;
use phpOMS\Message\Http\HttpRequest;
use phpOMS\Message\Http\HttpResponse;
use phpOMS\Message\Http\RequestStatusCode;
use phpOMS\Uri\HttpUri;
trait ApiControllerBatchEntryTrait
{
@ -27,8 +26,8 @@ trait ApiControllerBatchEntryTrait
*/
public function testApiBatchEntryCreate() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$response = new HttpResponse();
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('name', '1');
@ -45,8 +44,8 @@ trait ApiControllerBatchEntryTrait
*/
public function testApiBatchEntryCreateInvalid() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$response = new HttpResponse();
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('invalid', '1');
@ -61,8 +60,8 @@ trait ApiControllerBatchEntryTrait
*/
public function testApiBatchEntryUpdate() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$response = new HttpResponse();
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('id', '1');
@ -79,8 +78,8 @@ trait ApiControllerBatchEntryTrait
*/
public function testApiBatchEntryUpdateInvalid() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$response = new HttpResponse();
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('invalid', '1');
@ -95,8 +94,8 @@ trait ApiControllerBatchEntryTrait
*/
public function testApiRecurringEntryCreate() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$response = new HttpResponse();
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('name', '1');
@ -113,8 +112,8 @@ trait ApiControllerBatchEntryTrait
*/
public function testApiRecurringEntryCreateInvalid() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$response = new HttpResponse();
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('invalid', '1');
@ -129,8 +128,8 @@ trait ApiControllerBatchEntryTrait
*/
public function testApiRecurringEntryUpdate() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$response = new HttpResponse();
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('id', '1');
@ -147,8 +146,8 @@ trait ApiControllerBatchEntryTrait
*/
public function testApiRecurringEntryUpdateInvalid() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$response = new HttpResponse();
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('invalid', '1');

View File

@ -17,7 +17,6 @@ namespace Modules\Accounting\tests\Controller\Api;
use phpOMS\Message\Http\HttpRequest;
use phpOMS\Message\Http\HttpResponse;
use phpOMS\Message\Http\RequestStatusCode;
use phpOMS\Uri\HttpUri;
trait ApiControllerCostCenterTrait
{
@ -27,8 +26,8 @@ trait ApiControllerCostCenterTrait
*/
public function testApiCostCenterCreate() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$response = new HttpResponse();
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('name', '1');
@ -45,8 +44,8 @@ trait ApiControllerCostCenterTrait
*/
public function testApiCostCenterCreateInvalid() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$response = new HttpResponse();
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('invalid', '1');
@ -61,8 +60,8 @@ trait ApiControllerCostCenterTrait
*/
public function testApiCostCenterUpdate() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$response = new HttpResponse();
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('id', '1');
@ -79,8 +78,8 @@ trait ApiControllerCostCenterTrait
*/
public function testApiCostCenterUpdateInvalid() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$response = new HttpResponse();
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('invalid', '1');

View File

@ -17,7 +17,6 @@ namespace Modules\Accounting\tests\Controller\Api;
use phpOMS\Message\Http\HttpRequest;
use phpOMS\Message\Http\HttpResponse;
use phpOMS\Message\Http\RequestStatusCode;
use phpOMS\Uri\HttpUri;
trait ApiControllerCostObjectTrait
{
@ -27,8 +26,8 @@ trait ApiControllerCostObjectTrait
*/
public function testApiCostObjectCreate() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$response = new HttpResponse();
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('name', '1');
@ -45,8 +44,8 @@ trait ApiControllerCostObjectTrait
*/
public function testApiCostObjectCreateInvalid() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$response = new HttpResponse();
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('invalid', '1');
@ -61,8 +60,8 @@ trait ApiControllerCostObjectTrait
*/
public function testApiCostObjectUpdate() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$response = new HttpResponse();
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('id', '1');
@ -79,8 +78,8 @@ trait ApiControllerCostObjectTrait
*/
public function testApiCostObjectUpdateInvalid() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$response = new HttpResponse();
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('invalid', '1');

View File

@ -17,7 +17,6 @@ namespace Modules\Accounting\tests\Controller\Api;
use phpOMS\Message\Http\HttpRequest;
use phpOMS\Message\Http\HttpResponse;
use phpOMS\Message\Http\RequestStatusCode;
use phpOMS\Uri\HttpUri;
trait ApiControllerEntryTrait
{
@ -28,7 +27,7 @@ trait ApiControllerEntryTrait
public function testApiEntryCreate() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('name', '1');
@ -46,7 +45,7 @@ trait ApiControllerEntryTrait
public function testApiEntryCreateInvalidData() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('invalid', '1');
@ -62,7 +61,7 @@ trait ApiControllerEntryTrait
public function testApiEntryUpdate() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('id', '1');
@ -80,7 +79,7 @@ trait ApiControllerEntryTrait
public function testApiEntryUpdateInvalidData() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('invalid', '1');

View File

@ -17,7 +17,6 @@ namespace Modules\Accounting\tests\Controller\Api;
use phpOMS\Message\Http\HttpRequest;
use phpOMS\Message\Http\HttpResponse;
use phpOMS\Message\Http\RequestStatusCode;
use phpOMS\Uri\HttpUri;
trait ApiControllerTaxKeyTrait
{
@ -27,8 +26,8 @@ trait ApiControllerTaxKeyTrait
*/
public function testApiTaxKeyCreate() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$response = new HttpResponse();
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('name', '1');
@ -45,8 +44,8 @@ trait ApiControllerTaxKeyTrait
*/
public function testApiTaxKeyCreateInvalid() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$response = new HttpResponse();
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('invalid', '1');
@ -61,8 +60,8 @@ trait ApiControllerTaxKeyTrait
*/
public function testApiTaxKeyUpdate() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$response = new HttpResponse();
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('id', '1');
@ -79,8 +78,8 @@ trait ApiControllerTaxKeyTrait
*/
public function testApiTaxKeyUpdateInvalid() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$response = new HttpResponse();
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('invalid', '1');

View File

@ -65,16 +65,6 @@ final class BalanceL11nTest extends \PHPUnit\Framework\TestCase
self::assertEquals('TestDescription', $this->l11n->description);
}
/**
* @covers Modules\Accounting\Models\BalanceL11n
* @group module
*/
public function testLanguageInputOutput() : void
{
$this->l11n->setLanguage(ISO639x1Enum::_DE);
self::assertEquals(ISO639x1Enum::_DE, $this->l11n->language);
}
/**
* @covers Modules\Accounting\Models\BalanceL11n
* @group module
@ -84,15 +74,15 @@ final class BalanceL11nTest extends \PHPUnit\Framework\TestCase
$this->l11n->name = 'Title';
$this->l11n->description = 'Description';
$this->l11n->balance = 2;
$this->l11n->setLanguage(ISO639x1Enum::_DE);
$this->l11n->language = ISO639x1Enum::_DE;
self::assertEquals(
[
'id' => 0,
'name' => 'Title',
'description' => 'Description',
'balance' => 2,
'language' => ISO639x1Enum::_DE,
'id' => 0,
'name' => 'Title',
'description' => 'Description',
'balance' => 2,
'language' => ISO639x1Enum::_DE,
],
$this->l11n->jsonSerialize()
);

View File

@ -48,7 +48,7 @@ final class BalanceTest extends \PHPUnit\Framework\TestCase
{
self::assertEquals(
[
'id' => 0,
'id' => 0,
],
$this->balance->jsonSerialize()
);

View File

@ -65,34 +65,24 @@ final class CostCenterL11nTest extends \PHPUnit\Framework\TestCase
self::assertEquals('TestDescription', $this->l11n->description);
}
/**
* @covers Modules\Accounting\Models\CostCenterL11n
* @group module
*/
public function testLanguageInputOutput() : void
{
$this->l11n->setLanguage(ISO639x1Enum::_DE);
self::assertEquals(ISO639x1Enum::_DE, $this->l11n->language);
}
/**
* @covers Modules\Accounting\Models\CostCenterL11n
* @group module
*/
public function testSerialize() : void
{
$this->l11n->name = 'Title';
$this->l11n->description = 'Description';
$this->l11n->costcenter = 2;
$this->l11n->setLanguage(ISO639x1Enum::_DE);
$this->l11n->name = 'Title';
$this->l11n->description = 'Description';
$this->l11n->costcenter = 2;
$this->l11n->language = ISO639x1Enum::_DE;
self::assertEquals(
[
'id' => 0,
'name' => 'Title',
'description' => 'Description',
'costcenter' => 2,
'language' => ISO639x1Enum::_DE,
'id' => 0,
'name' => 'Title',
'description' => 'Description',
'costcenter' => 2,
'language' => ISO639x1Enum::_DE,
],
$this->l11n->jsonSerialize()
);

View File

@ -72,9 +72,9 @@ final class CostCenterTest extends \PHPUnit\Framework\TestCase
self::assertEquals(
[
'id' => 0,
'code' => '123',
'parent' => null,
'id' => 0,
'code' => '123',
'parent' => null,
],
$this->cc->jsonSerialize()
);

View File

@ -65,34 +65,24 @@ final class CostObjectL11nTest extends \PHPUnit\Framework\TestCase
self::assertEquals('TestDescription', $this->l11n->description);
}
/**
* @covers Modules\Accounting\Models\CostObjectL11n
* @group module
*/
public function testLanguageInputOutput() : void
{
$this->l11n->setLanguage(ISO639x1Enum::_DE);
self::assertEquals(ISO639x1Enum::_DE, $this->l11n->language);
}
/**
* @covers Modules\Accounting\Models\CostObjectL11n
* @group module
*/
public function testSerialize() : void
{
$this->l11n->name = 'Title';
$this->l11n->description = 'Description';
$this->l11n->costobject = 2;
$this->l11n->setLanguage(ISO639x1Enum::_DE);
$this->l11n->name = 'Title';
$this->l11n->description = 'Description';
$this->l11n->costobject = 2;
$this->l11n->language = ISO639x1Enum::_DE;
self::assertEquals(
[
'id' => 0,
'name' => 'Title',
'description' => 'Description',
'costobject' => 2,
'language' => ISO639x1Enum::_DE,
'id' => 0,
'name' => 'Title',
'description' => 'Description',
'costobject' => 2,
'language' => ISO639x1Enum::_DE,
],
$this->l11n->jsonSerialize()
);

View File

@ -72,9 +72,9 @@ final class CostObjectTest extends \PHPUnit\Framework\TestCase
self::assertEquals(
[
'id' => 0,
'code' => '123',
'parent' => null,
'id' => 0,
'code' => '123',
'parent' => null,
],
$this->co->jsonSerialize()
);

View File

@ -48,8 +48,8 @@ final class CreditorTest extends \PHPUnit\Framework\TestCase
{
self::assertEquals(
[
'id' => 0,
'account' => null,
'id' => 0,
'account' => null,
],
$this->creditor->jsonSerialize()
);

View File

@ -48,8 +48,8 @@ final class DebitorTest extends \PHPUnit\Framework\TestCase
{
self::assertEquals(
[
'id' => 0,
'account' => null,
'id' => 0,
'account' => null,
],
$this->debitor->jsonSerialize()
);