Bulkl path fix reverse

This commit is contained in:
Dennis Eichhorn 2017-02-12 21:43:10 +01:00
parent f96ee01125
commit d54e2af707
63 changed files with 4041 additions and 0 deletions

43
Admin/Activate.php Normal file
View File

@ -0,0 +1,43 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
namespace Modules\Accounting\Admin;
use phpOMS\DataStorage\Database\DatabasePool;
use phpOMS\Module\ActivateAbstract;
use phpOMS\Module\InfoManager;
/**
* Navigation class.
*
* @category Modules
* @package Modules\Admin
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @license OMS License 1.0
* @link http://orange-management.com
* @since 1.0.0
*/
class Activate extends ActivateAbstract
{
/**
* {@inheritdoc}
*/
public static function activate(DatabasePool $dbPool, InfoManager $info)
{
parent::activate($dbPool, $info);
}
}

43
Admin/Deactivate.php Normal file
View File

@ -0,0 +1,43 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
namespace Modules\Accounting\Admin;
use phpOMS\DataStorage\Database\DatabasePool;
use phpOMS\Module\DeactivateAbstract;
use phpOMS\Module\InfoManager;
/**
* Navigation class.
*
* @category Modules
* @package Modules\Admin
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @license OMS License 1.0
* @link http://orange-management.com
* @since 1.0.0
*/
class Deactivate extends DeactivateAbstract
{
/**
* {@inheritdoc}
*/
public static function deactivate(DatabasePool $dbPool, InfoManager $info)
{
parent::deactivate($dbPool, $info);
}
}

View File

@ -0,0 +1,157 @@
[
{
"id": 1002601001,
"pid": "754a08ddf8bcb1cf22f310f09206dd783d42f7dd",
"type": 2,
"subtype": 0,
"name": "Accounting",
"uri": null,
"target": "self",
"icon": "fa fa-book",
"order": 50,
"from": 1002600000,
"permission": null,
"parent": 0,
"children": [
{
"id": 1002602001,
"pid": "754a08ddf8bcb1cf22f310f09206dd783d42f7dd",
"type": 2,
"subtype": 1,
"name": "Accounts",
"uri": "/{/lang}/backend/accounting/gl/list?{?}",
"target": "self",
"icon": null,
"order": 5,
"from": 1002600000,
"permission": null,
"parent": 1002601001,
"children": [
{
"id": 1002602101,
"pid": "1259733702c323edae599221fcbf82f0a479372a",
"type": 3,
"subtype": 1,
"name": "List",
"uri": "/{/lang}/backend/accounting/gl/list?{?}",
"target": "self",
"icon": null,
"order": 1,
"from": 1002600000,
"permission": null,
"parent": 1002602001,
"children": []
},
{
"id": 1002602201,
"pid": "1259733702c323edae599221fcbf82f0a479372a",
"type": 3,
"subtype": 1,
"name": "Create",
"uri": "/{/lang}/backend/accounting/gl/create?{?}",
"target": "self",
"icon": null,
"order": 5,
"from": 1002600000,
"permission": null,
"parent": 1002602001,
"children": []
}
]
},
{
"id": 1002605001,
"pid": "754a08ddf8bcb1cf22f310f09206dd783d42f7dd",
"type": 2,
"subtype": 1,
"name": "BatchPostings",
"uri": "/{/lang}/backend/accounting/stack/list?{?}",
"target": "self",
"icon": null,
"order": 10,
"from": 1002600000,
"permission": null,
"parent": 1002601001,
"children": [
{
"id": 1002605101,
"pid": "754a08ddf8bcb1cf22f310f09206dd783d42f7dd",
"type": 3,
"subtype": 1,
"name": "List",
"uri": "/{/lang}/backend/accounting/stack/list?{?}",
"target": "self",
"icon": null,
"order": 5,
"from": 1002600000,
"permission": null,
"parent": 1002605001,
"children": []
},
{
"id": 1002605201,
"pid": "754a08ddf8bcb1cf22f310f09206dd783d42f7dd",
"type": 3,
"subtype": 1,
"name": "Archive",
"uri": "/{/lang}/backend/accounting/stack/archive/list?{?}",
"target": "self",
"icon": null,
"order": 10,
"from": 1002600000,
"permission": null,
"parent": 1002605001,
"children": []
},
{
"id": 1002605301,
"pid": "754a08ddf8bcb1cf22f310f09206dd783d42f7dd",
"type": 3,
"subtype": 1,
"name": "Predefined",
"uri": "/{/lang}/backend/accounting/stack/predefined/list?{?}",
"target": "self",
"icon": null,
"order": 10,
"from": 1002600000,
"permission": null,
"parent": 1002605001,
"children": []
},
{
"id": 1002605401,
"pid": "754a08ddf8bcb1cf22f310f09206dd783d42f7dd",
"type": 3,
"subtype": 1,
"name": "Create",
"uri": "/{/lang}/backend/accounting/stack/create?{?}",
"target": "self",
"icon": null,
"order": 15,
"from": 1002600000,
"permission": null,
"parent": 1002605001,
"children": []
}
]
},
{
"id": 1002606001,
"pid": "754a08ddf8bcb1cf22f310f09206dd783d42f7dd",
"type": 2,
"subtype": 1,
"name": "Entries",
"uri": "/{/lang}/backend/accounting/entries/dashboard?{?}",
"target": "self",
"icon": null,
"order": 1,
"from": 1002600000,
"permission": null,
"parent": 1002601001,
"children": [
]
}
]
}
]

View File

@ -0,0 +1,40 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
namespace Modules\Accounting\Admin\Install;
use phpOMS\DataStorage\Database\DatabasePool;
/**
* Navigation class.
*
* @category Modules
* @package Modules\Admin
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @license OMS License 1.0
* @link http://orange-management.com
* @since 1.0.0
*/
class Navigation
{
public static function install(string $path, DatabasePool $dbPool)
{
$navData = json_decode(file_get_contents(__DIR__ . '/Navigation.install.json'), true);
$class = '\\Modules\\Navigation\\Admin\\Installer';
/** @var $class \Modules\Navigation\Admin\Installer */
$class::installExternal($dbPool, $navData);
}
}

214
Admin/Installer.php Normal file
View File

@ -0,0 +1,214 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
namespace Modules\Accounting\Admin;
use phpOMS\DataStorage\Database\DatabaseType;
use phpOMS\DataStorage\Database\DatabasePool;
use phpOMS\Module\InfoManager;
use phpOMS\Module\InstallerAbstract;
/**
* Navigation class.
*
* @category Modules
* @package Modules\Admin
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @license OMS License 1.0
* @link http://orange-management.com
* @since 1.0.0
*/
class Installer extends InstallerAbstract
{
/**
* {@inheritdoc}
*/
public static function install(string $path, DatabasePool $dbPool, InfoManager $info)
{
parent::install($path, $dbPool, $info);
switch ($dbPool->get('core')->getType()) {
case DatabaseType::MYSQL:
$dbPool->get('core')->con->prepare(
'CREATE TABLE if NOT EXISTS `' . $dbPool->get('core')->prefix . 'accounting_account` (
`accounting_account_id` int(11) NOT NULL AUTO_INCREMENT,
`accounting_account_name` varchar(25) NOT NULL,
`accounting_account_description` varchar(255) NOT NULL,
`accounting_account_type` tinyint(1) NOT NULL,
`accounting_account_parent` int(11) NOT NULL,
PRIMARY KEY (`accounting_account_id`),
KEY `accounting_account_parent` (`accounting_account_parent`)
)ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;'
)->execute();
$dbPool->get('core')->con->prepare(
'ALTER TABLE `' . $dbPool->get('core')->prefix . 'accounting_account`
ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'accounting_account_ibfk_1` FOREIGN KEY (`accounting_account_parent`) REFERENCES `' . $dbPool->get('core')->prefix . 'accounting_account` (`accounting_account_id`);'
)->execute();
$dbPool->get('core')->con->prepare(
'CREATE TABLE if NOT EXISTS `' . $dbPool->get('core')->prefix . 'accounting_batch` (
`accounting_batch_id` int(11) NOT NULL AUTO_INCREMENT,
`accounting_batch_title` varchar(30) NOT NULL,
`accounting_batch_creator` int(11) NOT NULL,
`accounting_batch_created`datetime NOT NULL,
`accounting_batch_type` tinyint(1) NOT NULL,
PRIMARY KEY (`accounting_batch_id`),
KEY `accounting_batch_creator` (`accounting_batch_creator`)
)ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;'
)->execute();
$dbPool->get('core')->con->prepare(
'ALTER TABLE `' . $dbPool->get('core')->prefix . 'accounting_batch`
ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'accounting_batch_ibfk_1` FOREIGN KEY (`accounting_batch_creator`) REFERENCES `' . $dbPool->get('core')->prefix . 'account` (`account_id`);'
)->execute();
$dbPool->get('core')->con->prepare(
'CREATE TABLE if NOT EXISTS `' . $dbPool->get('core')->prefix . 'accounting_posting` (
`accounting_posting_id` int(11) NOT NULL AUTO_INCREMENT,
`accounting_posting_batch` int(11) NOT NULL,
`accounting_posting_receipt` int(11) DEFAULT NULL,
`accounting_posting_receipt_ext` int(11) DEFAULT NULL,
`accounting_posting_price` decimal(11,3) NOT NULL,
`accounting_posting_affiliation` datetime NOT NULL,
PRIMARY KEY (`accounting_posting_id`),
KEY `accounting_posting_batch` (`accounting_posting_batch`)
)ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;'
)->execute();
$dbPool->get('core')->con->prepare(
'ALTER TABLE `' . $dbPool->get('core')->prefix . 'accounting_posting`
ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'accounting_posting_ibfk_1` FOREIGN KEY (`accounting_posting_batch`) REFERENCES `' . $dbPool->get('core')->prefix . 'accounting_batch` (`accounting_batch_id`);'
)->execute();
$dbPool->get('core')->con->prepare(
'CREATE TABLE if NOT EXISTS `' . $dbPool->get('core')->prefix . 'accounting_posting_ele` (
`accounting_posting_ele_id` int(11) NOT NULL AUTO_INCREMENT,
`accounting_posting_ele_type` tinyint(1) NOT NULL,
`accounting_posting_ele_account` int(11) NOT NULL,
`accounting_posting_ele_value` decimal(11,3) NOT NULL,
`accounting_posting_ele_tax` tinyint(1) NOT NULL,
PRIMARY KEY (`accounting_posting_ele_id`),
KEY `accounting_posting_ele_account` (`accounting_posting_ele_account`)
)ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;'
)->execute();
$dbPool->get('core')->con->prepare(
'ALTER TABLE `' . $dbPool->get('core')->prefix . 'accounting_posting_ele`
ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'accounting_posting_ele_ibfk_1` FOREIGN KEY (`accounting_posting_ele_account`) REFERENCES `' . $dbPool->get('core')->prefix . 'accounting_account` (`accounting_account_id`);'
)->execute();
/*
* type = (offer, confirmation etc.)
* soptained = date of when we received the service/order (not the invoice)
* check = person who checked or is supposed to check the invoice
* checked = date of when the invoice got approved (no datetime = no approval)
* posting referes (direct)
* payment referes to this (indirect)
* status {
* blank
* received-ok
* received-notok
* checked-ok
* checked-notok
* posted-ok
* posted-notok
* payed-ok
* payed-notok
* }
*/
/*
* TODO: Purchasing can create. person who creates automatically get's permission for these to read.
* TODO: move to different module
*/
/*
$dbPool->get('core')->con->prepare(
'CREATE TABLE if NOT EXISTS `' . $dbPool->get('core')->prefix . 'accounting_invoices_process` (
`AccountingInvoiceProcessID` int(11) NOT NULL AUTO_INCREMENT,
`media` int(11) DEFAULT NULL,
`type` tinyint(1) DEFAULT NULL,
`supplier` int(11) DEFAULT NULL,
`sname` varchar(32) DEFAULT NULL,
`optained` datetime NOT NULL,
`soptained` datetime NOT NULL,
`refnumber` varchar(24) NOT NULL,
`invoicedate` datetime NOT NULL,
`internalref` int(11) NOT NULL,
`due` datetime NOT NULL,
`duediscount` datetime NOT NULL,
`amount` decimal(11,3) NOT NULL,
`amountdiscount` decimal(11,3) NOT NULL,
`order` int(11) DEFAULT NULL,
`arrival` int(11) DEFAULT NULL,
`dnote` int(11) DEFAULT NULL,
PRIMARY KEY (`AccountingInvoiceProcessID`),
KEY `media` (`media`),
KEY `order` (`order`),
KEY `arrival` (`arrival`),
KEY `dnote` (`dnote`)
)ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;'
)->execute();
$dbPool->get('core')->con->prepare(
'ALTER TABLE `' . $dbPool->get('core')->prefix . 'accounting_invoices_process`
ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'accounting_invoices_process_ibfk_1` FOREIGN KEY (`media`) REFERENCES `' . $dbPool->get('core')->prefix . 'media` (`media_id`),
ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'accounting_invoices_process_ibfk_2` FOREIGN KEY (`order`) REFERENCES `' . $dbPool->get('core')->prefix . 'purchase_invoices` (`PurchaseInvoiceID`),
ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'accounting_invoices_process_ibfk_3` FOREIGN KEY (`arrival`) REFERENCES `' . $dbPool->get('core')->prefix . 'warehousing_arrival` (`WarehousingArrivalID`),
ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'accounting_invoices_process_ibfk_4` FOREIGN KEY (`dnote`) REFERENCES `' . $dbPool->get('core')->prefix . 'purchase_dnote` (`PurchaseDnoteID`);'
)->execute();
$dbPool->get('core')->con->prepare(
'CREATE TABLE if NOT EXISTS `' . $dbPool->get('core')->prefix . 'accounting_invoices_status` (
`AccountingInvoiceStatusID` int(11) NOT NULL AUTO_INCREMENT,
`invoice` int(11) DEFAULT NULL,
`status` tinyint(1) DEFAULT NULL,
`person` int(11) DEFAULT NULL,
`changed` datetime DEFAULT NULL,
`info` varchar(256) NOT NULL,
PRIMARY KEY (`AccountingInvoiceStatusID`),
KEY `invoice` (`invoice`),
KEY `person` (`person`)
)ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;'
)->execute();
$dbPool->get('core')->con->prepare(
'ALTER TABLE `' . $dbPool->get('core')->prefix . 'accounting_invoices_status`
ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'accounting_invoices_status_ibfk_1` FOREIGN KEY (`invoice`) REFERENCES `' . $dbPool->get('core')->prefix . 'accounting_invoices_process` (`AccountingInvoiceProcessID`),
ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'accounting_invoices_status_ibfk_2` FOREIGN KEY (`person`) REFERENCES `' . $dbPool->get('core')->prefix . 'account` (`account_id`);'
)->execute();
$dbPool->get('core')->con->prepare(
'CREATE TABLE if NOT EXISTS `' . $dbPool->get('core')->prefix . 'accounting_invoices_process_permission` (
`AccountingInvoiceProcessPermissionID` int(11) NOT NULL AUTO_INCREMENT,
`process` int(11) DEFAULT NULL,
`person` int(11) DEFAULT NULL,
`permission` int(11) DEFAULT NULL,
PRIMARY KEY (`AccountingInvoiceProcessPermissionID`),
KEY `person` (`person`),
KEY `process` (`process`)
)ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;'
)->execute();
$dbPool->get('core')->con->prepare(
'ALTER TABLE `' . $dbPool->get('core')->prefix . 'accounting_invoices_process_permission`
ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'accounting_invoices_process_permission_ibfk_1` FOREIGN KEY (`person`) REFERENCES `' . $dbPool->get('core')->prefix . 'account` (`account_id`),
ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'accounting_invoices_process_permission_ibfk_2` FOREIGN KEY (`process`) REFERENCES `' . $dbPool->get('core')->prefix . 'accounting_invoices_process` (`AccountingInvoiceProcessID`);'
)->execute();*/
break;
}
}
}

View File

@ -0,0 +1,102 @@
<?php
use phpOMS\Router\RouteVerb;
return [
'^.*/backend/accounting/personal/entries.*$' => [
[
'dest' => '\Modules\Accounting\Controller:viewPersonalEntries',
'verb' => RouteVerb::GET,
],
],
'^.*/backend/accounting/impersonal/entries.*$' => [
[
'dest' => '\Modules\Accounting\Controller:viewImpersonalEntries',
'verb' => RouteVerb::GET,
],
],
'^.*/backend/accounting/entries.*$' => [
[
'dest' => '\Modules\Accounting\Controller:viewEntries',
'verb' => RouteVerb::GET,
],
],
'^.*/backend/accounting/impersonal/journal/list.*$' => [
[
'dest' => '\Modules\Accounting\Controller:viewJournalList',
'verb' => RouteVerb::GET,
],
],
'^.*/backend/accounting/stack/list.*$' => [
[
'dest' => '\Modules\Accounting\Controller:viewStackList',
'verb' => RouteVerb::GET,
],
],
'^.*/backend/accounting/stack/entries.*$' => [
[
'dest' => '\Modules\Accounting\Controller:viewStackEntries',
'verb' => RouteVerb::GET,
],
],
'^.*/backend/accounting/stack/archive/list.*$' => [
[
'dest' => '\Modules\Accounting\Controller:viewStackArchiveList',
'verb' => RouteVerb::GET,
],
],
'^.*/backend/accounting/stack/create.*$' => [
[
'dest' => '\Modules\Accounting\Controller:viewStackCreate',
'verb' => RouteVerb::GET,
],
],
'^.*/backend/accounting/stack/predefined/list.*$' => [
[
'dest' => '\Modules\Accounting\Controller:viewStackPredefinedList',
'verb' => RouteVerb::GET,
],
],
'^.*/backend/accounting/gl/list.*$' => [
[
'dest' => '\Modules\Accounting\Controller:viewGLList',
'verb' => RouteVerb::GET,
],
],
'^.*/backend/accounting/gl/create.*$' => [
[
'dest' => '\Modules\Accounting\Controller:viewGLCreate',
'verb' => RouteVerb::GET,
],
],
'^.*/backend/accounting/gl/profile.*$' => [
[
'dest' => '\Modules\Accounting\Controller:viewGLProfile',
'verb' => RouteVerb::GET,
],
],
'^.*/api/accounting/dun/print.*$' => [
[
'dest' => '\Modules\Accounting\Controller:viewCostCenterProfile',
'verb' => RouteVerb::GET,
],
],
'^.*/api/accounting/statement/print.*$' => [
[
'dest' => '\Modules\Accounting\Controller:viewCostCenterProfile',
'verb' => RouteVerb::GET,
],
],
'^.*/api/accounting/balances/print.*$' => [
[
'dest' => '\Modules\Accounting\Controller:viewCostCenterProfile',
'verb' => RouteVerb::GET,
],
],
'^.*/api/accounting/accountform/print.*$' => [
[
'dest' => '\Modules\Accounting\Controller:viewCostCenterProfile',
'verb' => RouteVerb::GET,
],
],
];

3
Admin/Routes/console.php Normal file
View File

@ -0,0 +1,3 @@
<?php
$moduleRoutes = [];

3
Admin/Routes/socket.php Normal file
View File

@ -0,0 +1,3 @@
<?php
$moduleRoutes = [];

55
Admin/Uninstall.php Normal file
View File

@ -0,0 +1,55 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
namespace Modules\Accounting\Admin;
use phpOMS\DataStorage\Database\DatabasePool;
use phpOMS\DataStorage\Database\Schema\Builder;
use phpOMS\Module\UninstallAbstract;
/**
* Navigation class.
*
* @category Modules
* @package Modules\Admin
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @license OMS License 1.0
* @link http://orange-management.com
* @since 1.0.0
*/
class Uninstall extends UninstallAbstract
{
/**
* {@inheritdoc}
*/
public static function uninstall(DatabasePool $dbPool, InfoManager $info)
{
parent::uninstall($dbPool, $info);
$query = new Builder($dbPool->get());
$query->prefix($dbPool->get('core')->getPrefix())->drop(
'accounting_posting_ele',
'accounting_posting',
'accounting_batch',
'accounting_account'
);
$dbPool->get()->con->prepare($query->toSql())->execute();
}
}

46
Admin/Update.php Normal file
View File

@ -0,0 +1,46 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
namespace Modules\Accounting\Admin;
use phpOMS\DataStorage\Database\DatabasePool;
use phpOMS\Module\UpdateAbstract;
use phpOMS\System\File\Directory;
/**
* Navigation class.
*
* @category Modules
* @package Modules\Admin
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @license OMS License 1.0
* @link http://orange-management.com
* @since 1.0.0
*/
class Update extends UpdateAbstract
{
/**
* {@inheritdoc}
*/
public static function update(DatabasePool $dbPool, array $info)
{
Directory::deletePath(__DIR__ . '/Update');
mkdir('Update');
parent::update($dbPool, $info);
}
}

274
Controller.php Normal file
View File

@ -0,0 +1,274 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
namespace Modules\Accounting;
use Modules\Navigation\Models\Navigation;
use Modules\Navigation\Views\NavigationView;
use phpOMS\Contract\RenderableInterface;
use phpOMS\Message\RequestAbstract;
use phpOMS\Message\ResponseAbstract;
use phpOMS\Module\ModuleAbstract;
use phpOMS\Module\WebInterface;
use phpOMS\Views\View;
use phpOMS\Views\ViewLayout;
/**
* Accounting class.
*
* @category Modules
* @package Framework
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @license OMS License 1.0
* @link http://orange-management.com
* @since 1.0.0
*/
class Controller extends ModuleAbstract implements WebInterface
{
/**
* Module path.
*
* @var string
* @since 1.0.0
*/
/* public */ const MODULE_PATH = __DIR__;
/**
* Module version.
*
* @var string
* @since 1.0.0
*/
/* public */ const MODULE_VERSION = '1.0.0';
/**
* Module name.
*
* @var string
* @since 1.0.0
*/
/* public */ const MODULE_NAME = 'Accounting';
/**
* Providing.
*
* @var string
* @since 1.0.0
*/
protected static $providing = [];
/**
* Dependencies.
*
* @var string
* @since 1.0.0
*/
protected static $dependencies = [
'Media',
];
/**
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
* @param mixed $data Generic data
*
* @return RenderableInterface
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function viewEntries(RequestAbstract $request, ResponseAbstract $response, $data = null) : \Serializable
{
$view = new View($this->app, $request, $response);
$view->setTemplate('/Modules/Accounting/Theme/Backend/entries');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1000104001, $request, $response));
return $view;
}
/**
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
* @param mixed $data Generic data
*
* @return RenderableInterface
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function viewJournalList(RequestAbstract $request, ResponseAbstract $response, $data = null) : \Serializable
{
$view = new View($this->app, $request, $response);
$view->setTemplate('/Modules/Accounting/Theme/Backend/journal-list');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1000104001, $request, $response));
return $view;
}
/**
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
* @param mixed $data Generic data
*
* @return RenderableInterface
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function viewStackList(RequestAbstract $request, ResponseAbstract $response, $data = null) : \Serializable
{
$view = new View($this->app, $request, $response);
$view->setTemplate('/Modules/Accounting/Theme/Backend/stack-list');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1002605001, $request, $response));
return $view;
}
/**
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
* @param mixed $data Generic data
*
* @return RenderableInterface
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function viewStackPredefinedList(RequestAbstract $request, ResponseAbstract $response, $data = null) : \Serializable
{
$view = new View($this->app, $request, $response);
$view->setTemplate('/Modules/Accounting/Theme/Backend/stack-predefined-list');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1002605001, $request, $response));
return $view;
}
/**
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
* @param mixed $data Generic data
*
* @return RenderableInterface
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function viewStackCreate(RequestAbstract $request, ResponseAbstract $response, $data = null) : \Serializable
{
$view = new View($this->app, $request, $response);
$view->setTemplate('/Modules/Accounting/Theme/Backend/stack-create');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1002605001, $request, $response));
return $view;
}
/**
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
* @param mixed $data Generic data
*
* @return RenderableInterface
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function viewStackEntries(RequestAbstract $request, ResponseAbstract $response, $data = null) : \Serializable
{
$view = new View($this->app, $request, $response);
$view->setTemplate('/Modules/Accounting/Theme/Backend/stack-entries');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1002605001, $request, $response));
return $view;
}
/**
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
* @param mixed $data Generic data
*
* @return RenderableInterface
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function viewStackArchiveList(RequestAbstract $request, ResponseAbstract $response, $data = null) : \Serializable
{
$view = new View($this->app, $request, $response);
$view->setTemplate('/Modules/Accounting/Theme/Backend/stack-archive-list');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1002605001, $request, $response));
return $view;
}
/**
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
* @param mixed $data Generic data
*
* @return RenderableInterface
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function viewGLList(RequestAbstract $request, ResponseAbstract $response, $data = null) : \Serializable
{
$view = new View($this->app, $request, $response);
$view->setTemplate('/Modules/Accounting/Theme/Backend/gl-list');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1002602001, $request, $response));
return $view;
}
/**
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
* @param mixed $data Generic data
*
* @return RenderableInterface
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function viewGLCreate(RequestAbstract $request, ResponseAbstract $response, $data = null) : \Serializable
{
$view = new View($this->app, $request, $response);
$view->setTemplate('/Modules/Accounting/Theme/Backend/gl-create');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1002602001, $request, $response));
return $view;
}
/**
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
* @param mixed $data Generic data
*
* @return RenderableInterface
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function viewGLProfile(RequestAbstract $request, ResponseAbstract $response, $data = null) : \Serializable
{
$view = new View($this->app, $request, $response);
$view->setTemplate('/Modules/Accounting/Theme/Backend/gl-profile');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1002602001, $request, $response));
return $view;
}
}

101
Models/AccountAbstract.php Normal file
View File

@ -0,0 +1,101 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
namespace Modules\Accounting\Models;
/**
* Account abstraction class.
*
* @category Module
* @package Accounting
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @license OMS License 1.0
* @link http://orange-management.com
* @since 1.0.0
*/
abstract class AccountAbstract implements AccountInterface
{
/**
* Account ID.
*
* @var int
* @since 1.0.0
*/
protected $id = 0;
/**
* Type.
*
* @var \Modules\Accounting\Models\AccountType
* @since 1.0.0
*/
protected $type = null;
protected $parent = null;
/**
* Entry list.
*
* @var \Modules\Accounting\Models\EntryInterface[]
* @since 1.0.0
*/
protected $entryList = 0;
/**
* Constructor.
*
* @param int $id Account ID
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function __construct($id)
{
$this->id = $id;
}
/**
* Get entry.
*
* @param int $id Entry ID
*
* @return void
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function getEntryById($id)
{
}
/**
* Get entry.
*
* @param \DateTime $start Interval start
* @param \DateTime $end Interval end
* @param int $dateType
*
* @internal \Modules\Accounting\Models\TimeRangeType $dateTime Time range type
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function getEntriesByDate($start, $end, $dateType = TimeRangeType::RECEIPT_DATE)
{
}
}

212
Models/AccountBalance.php Normal file
View File

@ -0,0 +1,212 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
namespace Modules\Accounting\Models;
/**
* Account balance class.
*
* @category Modules
* @package Modules\Accounting\Models
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @license OMS License 1.0
* @link http://orange-management.com
* @since 1.0.0
*/
abstract class AccountBalance
{
/**
* Id.
*
* @var int
* @since 1.0.0
*/
private $id = null;
/**
* Time range start.
*
* @var \DateTime
* @since 1.0.0
*/
private $start = null;
/**
* Time range end.
*
* @var \DateTime
* @since 1.0.0
*/
private $end = null;
/**
* Time range type.
*
* @var \Modules\Accounting\Models\TimeRangeType
* @since 1.0.0
*/
private $rangetype = null;
/**
* Account.
*
* @var \Modules\Accounting\Models\AccountInterface
* @since 1.0.0
*/
private $account = null;
/**
* Balance.
*
* @var float
* @since 1.0.0
*/
private $balance = null;
/**
* Constructor.
*
* @param int $id Account id
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function __construct(int $id)
{
$this->id = $id;
}
/**
* @return \DateTime
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function getStart()
{
return $this->start;
}
/**
* @param \DateTime $start
*
* @return void
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function setStart($start)
{
$this->start = $start;
}
/**
* @return \DateTime
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function getEnd()
{
return $this->end;
}
/**
* @param \DateTime $end
*
* @return void
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function setEnd($end)
{
$this->end = $end;
}
/**
* @return TimeRangeType
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function getRangetype()
{
return $this->rangetype;
}
/**
* @param TimeRangeType $rangetype
*
* @return void
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function setRangetype($rangetype)
{
$this->rangetype = $rangetype;
}
/**
* @return AccountInterface
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function getAccount()
{
return $this->account;
}
/**
* @param AccountInterface $account
*
* @return void
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function setAccount($account)
{
$this->account = $account;
}
/**
* @return float
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function getBalance()
{
return $this->balance;
}
/**
* @param float $balance
*
* @return void
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function setBalance($balance)
{
$this->balance = $balance;
}
}

View File

@ -0,0 +1,51 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
namespace Modules\Accounting\Models;
/**
* Account interface.
*
* @category Module
* @package Accounting
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @license OMS License 1.0
* @link http://orange-management.com
* @since 1.0.0
*/
interface AccountInterface
{
/**
* Get all groups.
*
* This function gets all groups in a range
*
* @return float
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function getBalance();
/**
* Close out account.
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function closeOut();
}

40
Models/AccountType.php Normal file
View File

@ -0,0 +1,40 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
namespace Modules\Accounting\Models;
use phpOMS\Datatypes\Enum;
/**
* Account type enum.
*
* @category Modules
* @package Modules\Accounting
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @license OMS License 1.0
* @link http://orange-management.com
* @since 1.0.0
*/
abstract class AccountType extends Enum
{
/* public */ const IMPERSONAL = 0;
/* public */ const PERSONAL = 1;
/* public */ const CREDITOR = 2;
/* public */ const DEBITOR = 3;
}

156
Models/Balance.php Normal file
View File

@ -0,0 +1,156 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
namespace Modules\Accounting\Models;
use phpOMS\Utils\IO\ExchangeInterface;
/**
* Balance class.
*
* @category Modules
* @package Modules\Accounting\Models
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @license OMS License 1.0
* @link http://orange-management.com
* @since 1.0.0
*/
abstract class Balance implements ExchangeInterface
{
/**
* ID.
*
* @var int
* @since 1.0.0
*/
private $id = 0;
/**
* Date of the balance.
*
* @var \Datetime
* @since 1.0.0
*/
private $date = null;
/**
* Balance data.
*
* @var array
* @since 1.0.0
*/
private $balance = [
'credit' => [
'capital' => [],
'circulating' => [],
],
'debit' => [
'equity' => [],
'debt' => [],
],
];
/**
* Constructor.
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function __construct()
{
}
/**
* @return int
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function getId()
{
return $this->id;
}
/**
* @param int $id
*
* @return void
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function setId($id)
{
$this->id = $id;
}
/**
* {@inheritdoc}
*/
public function exportJson($path)
{
}
/**
* {@inheritdoc}
*/
public function importJson($path)
{
}
/**
* {@inheritdoc}
*/
public function exportCsv($path)
{
}
/**
* {@inheritdoc}
*/
public function importCsv($path)
{
}
/**
* {@inheritdoc}
*/
public function exportExcel($path)
{
}
/**
* {@inheritdoc}
*/
public function importExcel($path)
{
}
/**
* {@inheritdoc}
*/
public function exportPdf($path)
{
}
/**
* {@inheritdoc}
*/
public function importPdf($path)
{
}
}

303
Models/BatchPosting.php Normal file
View File

@ -0,0 +1,303 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
namespace Modules\Accounting\Models;
use phpOMS\Utils\IO\ExchangeInterface;
/**
* BatchPosting class.
*
* @category Module
* @package Accounting
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @license OMS License 1.0
* @link http://orange-management.com
* @since 1.0.0
*/
class BatchPosting implements ExchangeInterface, \Countable
{
/**
* ID.
*
* @var int
* @since 1.0.0
*/
private $id = 0;
/**
* Creator.
*
* @var int
* @since 1.0.0
*/
private $creator = null;
/**
* Created.
*
* @var \Datetime
* @since 1.0.0
*/
private $created = null;
/**
* Description.
*
* @var string
* @since 1.0.0
*/
private $description = null;
/**
* Postings.
*
* @var \Modules\Accounting\Models\PostingAbstract[]
* @since 1.0.0
*/
private $postings = [];
/**
* Constructor.
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function __construct()
{
}
/**
* Get id.
*
* @return int
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function getId()
{
return $this->id;
}
/**
* Set id.
*
* @param int $id Batch ID
*
* @return void
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function setId($id)
{
$this->id = $id;
}
/**
* Get description.
*
* @return string
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function getDescription()
{
return $this->description;
}
/**
* Set description.
*
* @param string $desc Description
*
* @return void
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function setDescription($desc)
{
}
/**
* Get created.
*
* @return \Datetime
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function getCreated()
{
return $this->created;
}
/**
* Set creator.
*
* @param \Datetime $created Created
*
* @return void
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function setCreated($created)
{
$this->created = $created;
}
/**
* Get creator.
*
* @return int
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function getCreator()
{
return $this->creator;
}
/**
* Set creator.
*
* @param int $creator Creator ID
*
* @return void
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function setCreator($creator)
{
$this->creator = $creator;
}
/**
* Get posting.
*
* @param int $id Posting ID
*
* @return \Modules\Accounting\Models\PostingAbstract
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function getPosting($id)
{
return $this->postings[$id];
}
/**
* Remove posting.
*
* @param int $id Posting ID
*
* @return void
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function removePosting($id)
{
unset($this->postings[$id]);
}
/**
* Add posting.
*
* @param \Modules\Accounting\Models\PostingAbstract $posting Posting
*
* @return void
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function addPosting($posting)
{
$this->postings[] = $posting;
}
/**
* {@inheritdoc}
*/
public function count()
{
return count($this->postings);
}
/**
* {@inheritdoc}
*/
public function exportJson($path)
{
}
/**
* {@inheritdoc}
*/
public function importJson($path)
{
}
/**
* {@inheritdoc}
*/
public function exportCsv($path)
{
}
/**
* {@inheritdoc}
*/
public function importCsv($path)
{
}
/**
* {@inheritdoc}
*/
public function exportExcel($path)
{
}
/**
* {@inheritdoc}
*/
public function importExcel($path)
{
}
/**
* {@inheritdoc}
*/
public function exportPdf($path)
{
}
/**
* {@inheritdoc}
*/
public function importPdf($path)
{
}
}

0
Models/CostCenter.php Normal file
View File

0
Models/CostObject.php Normal file
View File

0
Models/CreditPosting.php Normal file
View File

99
Models/Creditor.php Normal file
View File

@ -0,0 +1,99 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
namespace Modules\Accounting\Models;
use phpOMS\Utils\IO\ExchangeInterface;
/**
* Creditor class.
*
* @category Module
* @package Accounting
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @license OMS License 1.0
* @link http://orange-management.com
* @since 1.0.0
*/
abstract class Creditor implements ExchangeInterface
{
/**
* Constructor.
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function __construct()
{
}
/**
* {@inheritdoc}
*/
public function exportJson($path)
{
}
/**
* {@inheritdoc}
*/
public function importJson($path)
{
}
/**
* {@inheritdoc}
*/
public function exportCsv($path)
{
}
/**
* {@inheritdoc}
*/
public function importCsv($path)
{
}
/**
* {@inheritdoc}
*/
public function exportExcel($path)
{
}
/**
* {@inheritdoc}
*/
public function importExcel($path)
{
}
/**
* {@inheritdoc}
*/
public function exportPdf($path)
{
}
/**
* {@inheritdoc}
*/
public function importPdf($path)
{
}
}

View File

@ -0,0 +1,51 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
namespace Modules\Accounting\Models;
use Modules\Accounting\Models\PersonalAccount;
/**
* Creditor account class.
*
* @category Modules
* @package Modules\Accounting\Models
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @license OMS License 1.0
* @link http://orange-management.com
* @since 1.0.0
*/
abstract class CreditorAccount extends PersonalAccount
{
/**
* Constructor.
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function __construct()
{
}
public function getPDO()
{
}
public function getDefault()
{
}
}

0
Models/DebitPosting.php Normal file
View File

99
Models/Debitor.php Normal file
View File

@ -0,0 +1,99 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
namespace Modules\Accounting\Models;
use phpOMS\Utils\IO\ExchangeInterface;
/**
* Debitor class.
*
* @category Module
* @package Accounting
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @license OMS License 1.0
* @link http://orange-management.com
* @since 1.0.0
*/
abstract class Debitor implements ExchangeInterface
{
/**
* Constructor.
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function __construct()
{
}
/**
* {@inheritdoc}
*/
public function exportJson($path)
{
}
/**
* {@inheritdoc}
*/
public function importJson($path)
{
}
/**
* {@inheritdoc}
*/
public function exportCsv($path)
{
}
/**
* {@inheritdoc}
*/
public function importCsv($path)
{
}
/**
* {@inheritdoc}
*/
public function exportExcel($path)
{
}
/**
* {@inheritdoc}
*/
public function importExcel($path)
{
}
/**
* {@inheritdoc}
*/
public function exportPdf($path)
{
}
/**
* {@inheritdoc}
*/
public function importPdf($path)
{
}
}

55
Models/DebitorAccount.php Normal file
View File

@ -0,0 +1,55 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
namespace Modules\Accounting\Models;
use Modules\Accounting\Models\PersonalAccount;
/**
* DebitorAccount class.
*
* @category Modules
* @package Modules\Accounting\Models
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @license OMS License 1.0
* @link http://orange-management.com
* @since 1.0.0
*/
abstract class DebitorAccount extends PersonalAccount
{
/**
* Constructor.
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function __construct()
{
}
public function getDSO()
{
}
public function getDefault()
{
}
public function getNetReceivable()
{
}
}

31
Models/EntryInterface.php Normal file
View File

@ -0,0 +1,31 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
namespace Modules\Accounting\Models;
/**
* Entry interface.
*
* @category Modules
* @package Accounting
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @license OMS License 1.0
* @link http://orange-management.com
* @since 1.0.0
*/
interface EntryInterface
{
}

View File

@ -0,0 +1,99 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
namespace Modules\Accounting\Models;
use phpOMS\Utils\IO\ExchangeInterface;
/**
* ImpersonalAccount class.
*
* @category Module
* @package Accounting
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @license OMS License 1.0
* @link http://orange-management.com
* @since 1.0.0
*/
abstract class ImpersonalAccount implements ExchangeInterface
{
/**
* Constructor.
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function __construct()
{
}
/**
* {@inheritdoc}
*/
public function exportJson($path)
{
}
/**
* {@inheritdoc}
*/
public function importJson($path)
{
}
/**
* {@inheritdoc}
*/
public function exportCsv($path)
{
}
/**
* {@inheritdoc}
*/
public function importCsv($path)
{
}
/**
* {@inheritdoc}
*/
public function exportExcel($path)
{
}
/**
* {@inheritdoc}
*/
public function importExcel($path)
{
}
/**
* {@inheritdoc}
*/
public function exportPdf($path)
{
}
/**
* {@inheritdoc}
*/
public function importPdf($path)
{
}
}

View File

@ -0,0 +1,98 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
namespace Modules\Accounting\Models;
use phpOMS\Utils\IO\ExchangeInterface;
/**
* IncomeStatement class.
*
* @category Module
* @package Accounting
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @license OMS License 1.0
* @link http://orange-management.com
* @since 1.0.0
*/
abstract class IncomeStatement implements ExchangeInterface
{
private $id = 0;
private $date = null;
private $incomeStatement = [];
public function __construct()
{
}
/**
* {@inheritdoc}
*/
public function exportJson($path)
{
}
/**
* {@inheritdoc}
*/
public function importJson($path)
{
}
/**
* {@inheritdoc}
*/
public function exportCsv($path)
{
}
/**
* {@inheritdoc}
*/
public function importCsv($path)
{
}
/**
* {@inheritdoc}
*/
public function exportExcel($path)
{
}
/**
* {@inheritdoc}
*/
public function importExcel($path)
{
}
/**
* {@inheritdoc}
*/
public function exportPdf($path)
{
}
/**
* {@inheritdoc}
*/
public function importPdf($path)
{
}
}

99
Models/InvoicePosting.php Normal file
View File

@ -0,0 +1,99 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
namespace Modules\Accounting\Models;
/**
* Invoice posting class.
*
* @category Module
* @package Accounting
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @license OMS License 1.0
* @link http://orange-management.com
* @since 1.0.0
*/
abstract class InvoicePosting extends PostingAbstract
{
/**
* Constructor.
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function __construct()
{
}
/**
* {@inheritdoc}
*/
public function exportJson($path)
{
}
/**
* {@inheritdoc}
*/
public function importJson($path)
{
}
/**
* {@inheritdoc}
*/
public function exportCsv($path)
{
}
/**
* {@inheritdoc}
*/
public function importCsv($path)
{
}
/**
* {@inheritdoc}
*/
public function exportExcel($path)
{
}
/**
* {@inheritdoc}
*/
public function importExcel($path)
{
}
/**
* {@inheritdoc}
*/
public function exportPdf($path)
{
}
/**
* {@inheritdoc}
*/
public function importPdf($path)
{
}
}

View File

@ -0,0 +1,99 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
namespace Modules\Accounting\Models;
/**
* Invoice posting simple class.
*
* @category Module
* @package Accounting
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @license OMS License 1.0
* @link http://orange-management.com
* @since 1.0.0
*/
abstract class InvoicePostingSimple extends PostingAbstract
{
/**
* Constructor.
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function __construct()
{
}
/**
* {@inheritdoc}
*/
public function exportJson($path)
{
}
/**
* {@inheritdoc}
*/
public function importJson($path)
{
}
/**
* {@inheritdoc}
*/
public function exportCsv($path)
{
}
/**
* {@inheritdoc}
*/
public function importCsv($path)
{
}
/**
* {@inheritdoc}
*/
public function exportExcel($path)
{
}
/**
* {@inheritdoc}
*/
public function importExcel($path)
{
}
/**
* {@inheritdoc}
*/
public function exportPdf($path)
{
}
/**
* {@inheritdoc}
*/
public function importPdf($path)
{
}
}

View File

@ -0,0 +1,110 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
namespace Modules\Accounting\Models;
use phpOMS\Utils\IO\ExchangeInterface;
/**
* ImpersonalAccount class.
*
* @category Modules
* @package Modules\Accounting\Models
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @license OMS License 1.0
* @link http://orange-management.com
* @since 1.0.0
*/
abstract class PersonalAccountAbstract extends AccountAbstract implements ExchangeInterface
{
protected $id = 0;
public function __construct()
{
}
public function getBalance()
{
}
public function getAccountsReceivable()
{
}
public function getAccountsPayable()
{
}
public function getAccountsHistory($start, $end)
{
}
/**
* {@inheritdoc}
*/
public function exportJson($path)
{
}
/**
* {@inheritdoc}
*/
public function importJson($path)
{
}
/**
* {@inheritdoc}
*/
public function exportCsv($path)
{
}
/**
* {@inheritdoc}
*/
public function importCsv($path)
{
}
/**
* {@inheritdoc}
*/
public function exportExcel($path)
{
}
/**
* {@inheritdoc}
*/
public function importExcel($path)
{
}
/**
* {@inheritdoc}
*/
public function exportPdf($path)
{
}
/**
* {@inheritdoc}
*/
public function importPdf($path)
{
}
}

99
Models/Posting.php Normal file
View File

@ -0,0 +1,99 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
namespace Modules\Accounting\Models;
/**
* Posting class.
*
* @category Module
* @package Accounting
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @license OMS License 1.0
* @link http://orange-management.com
* @since 1.0.0
*/
abstract class Posting extends PostingAbstract
{
/**
* Constructor.
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function __construct()
{
}
/**
* {@inheritdoc}
*/
public function exportJson($path)
{
}
/**
* {@inheritdoc}
*/
public function importJson($path)
{
}
/**
* {@inheritdoc}
*/
public function exportCsv($path)
{
}
/**
* {@inheritdoc}
*/
public function importCsv($path)
{
}
/**
* {@inheritdoc}
*/
public function exportExcel($path)
{
}
/**
* {@inheritdoc}
*/
public function importExcel($path)
{
}
/**
* {@inheritdoc}
*/
public function exportPdf($path)
{
}
/**
* {@inheritdoc}
*/
public function importPdf($path)
{
}
}

View File

@ -0,0 +1,43 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
namespace Modules\Accounting\Models;
/**
* Posting abstract class.
*
* @category Module
* @package Accounting
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @license OMS License 1.0
* @link http://orange-management.com
* @since 1.0.0
*/
abstract class PostingAbstract implements PostingInterface
{
/**
* Constructor.
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function __construct()
{
}
}

View File

@ -0,0 +1,33 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
namespace Modules\Accounting\Models;
use phpOMS\Utils\IO\ExchangeInterface;
/**
* Posting interface.
*
* @category Modules
* @package Accounting
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @license OMS License 1.0
* @link http://orange-management.com
* @since 1.0.0
*/
interface PostingInterface extends ExchangeInterface
{
}

37
Models/TimeRangeType.php Normal file
View File

@ -0,0 +1,37 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
namespace Modules\Accounting\Models;
use phpOMS\Datatypes\Enum;
/**
* Time range type enum.
*
* @category Modules
* @package Modules\Accounting\Models
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @license OMS License 1.0
* @link http://orange-management.com
* @since 1.0.0
*/
abstract class TimeRangeType extends Enum
{
/* public */ const ENTRY_DATE = 0; /* Date of when the entry happened */
/* public */ const DUE_DATE = 1; /* Date of when the entry is due (only for invoices) */
/* public */ const RECEIPT_DATE = 2; /* Date of the receipt */
/* public */ const ASSOCIATED_DATE = 3; /* Date of the association (e.g. when did the articles arrive) */
}

97
Models/temp/Account.php Normal file
View File

@ -0,0 +1,97 @@
<?php
/**
class Account implements StructureElementInterface {
private $id = 0;
private $name = '';
private $account = 0;
private $values = [];
private $total = [];
private $type = 0; // GUV/Bilanz
private $assigned = 0; // Ertrags/Aufwandskonto | active/passive
private $currency = 0; // Currency type
private $tax = 0;
private $hasOP = false;
private $activity = true;
private $hasCostCenter = true;
private $hasCostObject = true;
private $defaultCostCenter = 0;
private $isFixedCostCenter = false;
private $isVirtual = false;
private $isCashback = false;
private $isOutdated = false;
public function __construct(int $account, string $name, array $values = [])
{
$this->account = $account;
$this->name = $name;
$this->values = [];
if(!empty($values)) {
$this->isOutdated = true;
}
}
public function getId()
{
return $this->id;
}
public function getName() : string
{
return $this->name;
}
public function addValue(AccountValue $value)
{
$this->values[] = $value;
$this->isOutdated = true;
}
public function getValues() : array
{
return $this->values;
}
public function getTotal() : Money
{
if($this->isOutdated) {
$this->parseValues();
}
$total = new Money(0);
foreach($this->total as $costCenter) {
$total->add($costCenter);
}
return $total;
}
public function getTotalCostCenter(int $costCenter) : Money
{
if($this->isOutdated) {
$this->parseValues();
}
return $this->total[$costCenter] ?? new Money(0);
}
private function parseValues() : array
{
$this->total = [];
foreach($this->values as $value) {
if(!isset($this->total[$value->getCostCenter()])) {
$this->total[$value->getCostCenter()] = new Money(0);
}
$this->total[$value->getCostCenter()]->add($value->getValue());
}
$this->isOutdated = false;
return $this->total;
}
}
*/

View File

@ -0,0 +1,58 @@
<?php
class AccountValue {
private $account = 0;
private $costCenter = 0;
private $date = null;
private $value = null;
private $contraAccount = 0;
private $text = '';
private $postingId = 0;
public function __construct($account, $costCenter, \DateTime $date, Money $value)
{
$this->account = $account;
$this->costCenter = $costCenter;
$this->date = $date;
$this->value = $value;
}
public function getAccount()
{
return $this->account;
}
public function getCostCenter()
{
return $this->costCenter;
}
public function getDate()
{
return $this->date;
}
public function getValue() : Money
{
return $this->value;
}
public static function group($values) : array
{
$accounts = [];
foreach($values as $value) {
if(!isset($accounts[$value->getAccount()])) {
$accounts[$value->getAccount()] = [];
}
if(!isset($accounts[$value->getAccount()][$value->getCostCenter()])) {
$accounts[$value->getAccount()][$value->getCostCenter()] = [];
}
$accounts[$value->getAccount()][$value->getCostCenter()] = $value;
}
return $accounts;
}
}

5
Models/temp/Balance.php Normal file
View File

@ -0,0 +1,5 @@
<?php
class Balance {
}

View File

View File

@ -0,0 +1,55 @@
<?php
class Distribution {
private $keyCollections = [];
public function __construct() {}
public function addKey(DistributionKey $key, $from, $to)
{
$keys = $this->normalizeKey($key, $from, $to);
foreach($keys as $key) {
if(!isset($this->keyCollections[$key->getFromAccount()])) {
$this->keyCollections[$key->getFromAccount()] = new KeyCollection(account here);
}
$this->keyCollections[$key->getFromAccount()]->addKey($key);
}
}
public function distribute($from, $to)
{
$accounts = $from->getAccountValues();
$values = [];
foreach($accounts as $account => $accountValues) {
$values = array_merge($values, $this->keyCollections[$account]->distribute($accountValues));
}
$values = AccountValue::group($values);
$to->setAccountValues($values);
return $to;
}
private function normalizeKey(DistributionKey $key, $from, $to) : array
{
$accountsSource = $from->getAccountsById($key->getFromAccount());
$accountDestination = $to->getAccountsById($key->getToAccount());
$keys = [];
foreach($accountsSource as $accountSource) {
foreach($key as $rawKey) {
$keys[$accountSource->getId()] = new DistributionKey(
$accountSource->getId(),
$rawKey->getFromCostCenters(),
$accountDestination,
$rawKey->getToCostCenters()
);
}
}
return $keys;
}
}

View File

@ -0,0 +1,41 @@
<?php
class DistributionKey {
private $fromAccount = 0;
private $fromCostCenter = 0;
private $toAccount = 0;
private $toCostCenter = 0;
private $percentage = 1.0;
public function __construct(int $fromAC, int $fromCC, int $toAC, int $toCC) {
$this->fromAccount = $fromAC;
$this->fromCostCenter = $fromCC;
$this->toAccount = $toAC;
$this->toCostCenter = $toCC;
}
public function getFromAccount() : int
{
return $this->fromAccount;
}
public function getFromCostCenter() : int
{
return $this->fromCostCenter;
}
public function distribute(AccountValue $value) : AccountValue
{
if($value->getAccount() !== $this->fromAccount) {
throw new \Exception('Bad account.');
}
if($value->getCostCenter() !== $this->fromCostCenter) {
throw new \Exception('Bad costcenter.');
}
return new AccountValue($this->toAccount, $this->toCostCenter, $value->getDate(), $value->getValue() * $this->percentage);
}
}

74
Models/temp/Element.php Normal file
View File

@ -0,0 +1,74 @@
<?php
class Element extends StructureElementAbstract {
private $id = 0;
private $name = '';
private $type = 0;
private $action = '';
private $children = [];
public function getId()
{
return $this->id;
}
public function getName() : string
{
return $this->name;
}
public function getValues() : array
{
$values = [];
foreach($this->children as $child) {
if($child instanceof Account) {
$values[$child->getAccount()] = $child->getValues();
} else {
$values += $child->getValues();
}
}
return $values;
}
public function getAccounts() : array
{
$accounts = [];
foreach($this->children as $child) {
if($child instanceof Account) {
$accounts[$child->getAccount()] = $child->getAccount();
} else {
$accounts += $child->getAccounts();
}
}
return $accounts;
}
public function getTotal()
{
$total = new Money(0);
foreach($this->children as $child) {
$total->add($child->getTotal());
}
return $total;
}
public function getTotalCostCenter(int $costCenter)
{
$total = new Money(0);
foreach($this->children as $child) {
$total->add($child->getTotalCostCenter($costCenter));
}
return $total;
}
public function getChildren() : array
{
return $this->children;
}
}

View File

@ -0,0 +1,32 @@
<?php
class KeyCollection {
private $fromAccount = 0;
private $distributionKeys = [];
public function __construct(int $account, array $distributionKeys = []) {
$this->fromAccount = $account;
$this->distributionKeys = $distributionKeys;
}
public function getAccount() : int
{
return $this->fromAccount;
}
public function addKey(DistributionKey $key)
{
$this->distributionKeys[$key->getFromCostCenter()] = $key;
}
public function distribute(array $accountValues) : array
{
$values = [];
foreach($accountValues as $value) {
$values[] = $this->distributionKeys[$value->getCostCenter()]->distribute($value);
}
return $values;
}
}

67
Models/temp/PL.php Normal file
View File

@ -0,0 +1,67 @@
<?php
class PL {
private $name = '';
private $structure = [];
public function addStructureElement(StructureElementInterface $element, int $position = -1)
{
if(count($structure) >= $position) {
$this->structure = array_merge(array_slice($this->structure, 0, $position - 1, false), [$element], array_slice($this->structure, $position-1, count($this->structure) - 1, false));
} else {
$this->structure[] = $element;
}
}
public function getStructure() : array
{
return $this->structure;
}
public function getAccountValues() : array
{
$values = [];
foreach($this->structure as $element) {
$values += $element->getValues();
}
}
public function getAccountsById(int $id) : array
{
$accounts = $this->get($id);
if(!isset($accounts)) {
return [];
}
if($accounts instanceof Account) {
return [$accounts];
}
return $accounts->getAccounts();
}
public function get(int $id)
{
if(isset($this->structure[$id])) {
return $this->structure[$id];
}
$found = null;
foreach($this->structure as $element) {
$found = $element->get($id);
if(isset($found)) {
return $found;
}
}
return $found;
}
public function getTotal(int $id, int $costCenter = null) : Money
{
return isset($costCenter) ? $this->structure[$id]->getTotalCostCenter($costCenter) : $this->structure[$id]->getTotal();
}
}

8
Models/temp/Position.php Normal file
View File

@ -0,0 +1,8 @@
<?php
class Position {
private $accounts = [];
private $color = [];
}

View File

@ -0,0 +1,7 @@
<?php
interface StructureElementInterface {
public function getId() : int;
public function getName() : string;
public function getValues() : array;
}

1
README.md Normal file
View File

@ -0,0 +1 @@
# Accounting #

View File

@ -0,0 +1,28 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
return ['Navigation' => [
'Accounting' => 'Accounting',
'AccountPostings' => 'Account Postings',
'Balance' => 'Balance',
'BatchPostings' => 'Batch Postings',
'CostCenters' => 'Cost Centers',
'CostObjects' => 'Cost Objects',
'Creditors' => 'Creditors',
'Debitors' => 'Debitors',
'Entries' => 'Entries',
'Postings' => 'Postings',
'Predefined' => 'Predefined',
]];

View File

@ -0,0 +1,17 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
$MODLANG[1] = [
];

View File

@ -0,0 +1,49 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
return ['Accounting' => [
'Account' => 'Account',
'Accounts' => 'Accounts',
'BatchPostings' => 'Batch Postings',
'Charts' => 'Charts',
'ContraAccount' => 'Contra Account',
'CostCenter' => 'Cost Center',
'CostCenters' => 'Cost Centers',
'CostObject' => 'Cost Object',
'CostObjects' => 'Cost Objects',
'Created' => 'Created',
'Creator' => 'Creator',
'Credit' => 'Credit',
'Debit' => 'Debit',
'Due' => 'Due',
'Entries' => 'Entries',
'EntryDate' => 'Entry Date',
'Evaluation' => 'Evaluation',
'ExternalVoucher' => 'External Voucher',
'Incoming' => 'Incoming',
'GL' => 'GL',
'List' => 'List',
'Name' => 'Name',
'Outgoing' => 'Outgoing',
'Parent' => 'Parent',
'Receipt' => 'Receipt',
'ReceiptDate' => 'Receipt Date',
'Stack' => 'Stack',
'TAccount' => 'T-Account',
'Text' => 'Text',
'To' => 'To',
'Total' => 'Total',
'Type' => 'Type',
]];

View File

@ -0,0 +1,12 @@
<template id="entry-list-tpl">
<div id="entry-list" class="box" style="z-index: 99; position: relative; top: 20px; display: block; margin: 0 auto; width: 20%;">
<table class="table">
<caption><?= $this->getText('Accounts'); ?></caption>
<thead>
<tr>
<td><?= $this->getText('ID', 0, 0); ?>
<td class="wf-100"><?= $this->getText('Account'); ?>
<tbody>
</table>
</div>
</template>

View File

@ -0,0 +1,181 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
//echo $this->getData('nav')->render();
$footerView = new \Web\Views\Lists\PaginationView($this->app, $this->request, $this->response);
$footerView->setTemplate('/Web/Templates/Lists/Footer/PaginationBig');
$footerView->setPages(1 / 25);
$footerView->setPage(1);
$footerView->setResults(1);
?>
<section class="box w-100">
<div class="inner">
<form>
<table class="layout wf-100">
<tr>
<td><label for="iAccountStart"><?= $this->getText('Account'); ?></label>
<td><label for="iAccountStart"><?= $this->getText('CostCenter'); ?>
<td><label for="iAccountStart"><?= $this->getText('CostObject'); ?>
<td><label for="iAccountStart"><?= $this->getText('EntryDate'); ?>
<tr>
<td><span class="input"><button type="button" id="account-start" formaction="" data-action='[{"type": "popup", "tpl": "entry-list-tpl", "aniIn": "fadeIn", "aniOut": "fadeOut", "stay": 1000}]'><i class="fa fa-book"></i>
</button><input type="number" id="iId" min="1" name="id" required></span>
<td><span class="input"><button type="button" formaction=""><i class="fa fa-book"></i>
</button><input type="number" id="iId" min="1" name="id" required></span>
<td><span class="input"><button type="button" formaction=""><i class="fa fa-book"></i>
</button><input type="number" id="iId" min="1" name="id" required></span>
<td><input type="datetime-local" id="iId" min="1" name="id" required>
<tr>
<td><label for="iAccountStart"><?= $this->getText('To'); ?></label>
<td><label for="iAccountStart"><?= $this->getText('To'); ?>
<td><label for="iAccountStart"><?= $this->getText('To'); ?>
<td><label for="iAccountStart"><?= $this->getText('To'); ?>
<tr>
<td><span class="input"><button type="button" formaction=""><i class="fa fa-book"></i>
</button><input type="number" id="iId" min="1" name="id" required></span>
<td><span class="input"><button type="button" formaction=""><i class="fa fa-book"></i>
</button><input type="number" id="iId" min="1" name="id" required></span>
<td><span class="input"><button type="button" formaction=""><i class="fa fa-book"></i>
</button><input type="number" id="iId" min="1" name="id" required></span>
<td><input type="datetime-local" id="iId" min="1" name="id" required>
<tr>
<td colspan="4"><input type="submit" value="<?= $this->getText('Search') ?>">
</table>
</form>
</div>
</section>
<div class="box w-100">
<div class="tabular-2">
<ul class="tab-links">
<li><label for="c-tab2-1"><?= $this->getText('List'); ?></label></li>
<li><label for="c-tab2-2"><?= $this->getText('Evaluation'); ?></label></li>
<li><label for="c-tab2-3"><?= $this->getText('Charts'); ?></label></li>
</ul>
<div class="tab-content">
<input type="radio" id="c-tab2-1" name="tabular-2" checked>
<div class="tab">
<section class="wf-100">
<table class="table">
<caption><?= $this->getText('Entries') ?></caption>
<thead>
<tr>
<td><?= $this->getText('EntryDate'); ?>
<td><?= $this->getText('Receipt'); ?>
<td><?= $this->getText('Debit'); ?>
<td><?= $this->getText('Credit'); ?>
<td class="wf-100"><?= $this->getText('Text'); ?>
<td><?= $this->getText('Account'); ?>
<td><?= $this->getText('ContraAccount'); ?>
<td><?= $this->getText('CostCenter'); ?>
<td><?= $this->getText('CostObject'); ?>
<td><?= $this->getText('ReceiptDate'); ?>
<td><?= $this->getText('ExternalVoucher'); ?>
<td><?= $this->getText('Creator'); ?>
<td><?= $this->getText('Created'); ?>
<tfoot>
<tr>
<td colspan="13"><?= $footerView->render(); ?>
<tbody>
<?php $count = 0;
foreach ([] as $key => $value) : $count++; ?>
<?php endforeach; ?>
<?php if ($count === 0) : ?>
<tr>
<td colspan="13" class="empty"><?= $this->getText('Empty', 0, 0); ?>
<?php endif; ?>
</table>
</section>
</div>
<input type="radio" id="c-tab2-2" name="tabular-2">
<div class="tab tab-2">
<section class="box w-33 floatLeft">
<table class="table">
<caption><?= $this->getText('Accounts') ?></caption>
<thead>
<tr>
<td><?= $this->getText('Account'); ?>
<td class="wf-100"><?= $this->getText('Name'); ?>
<td><?= $this->getText('Total'); ?>
<tbody>
<?php $count = 0;
foreach ([] as $key => $value) : $count++; ?>
<?php endforeach; ?>
<?php if ($count === 0) : ?>
<tr>
<td colspan="13" class="empty"><?= $this->getText('Empty', 0, 0); ?>
<?php endif; ?>
</table>
</section>
<section class="box w-33 floatLeft">
<table class="table floatLeft">
<caption><?= $this->getText('CostCenter') ?></caption>
<thead>
<tr>
<td><?= $this->getText('CostCenter'); ?>
<td class="wf-100"><?= $this->getText('Name'); ?>
<td><?= $this->getText('Total'); ?>
<tbody>
<?php $count = 0;
foreach ([] as $key => $value) : $count++; ?>
<?php endforeach; ?>
<?php if ($count === 0) : ?>
<tr>
<td colspan="13" class="empty"><?= $this->getText('Empty', 0, 0); ?>
<?php endif; ?>
</table>
</section>
<section class="box w-33 floatLeft">
<table class="table">
<caption><?= $this->getText('CostObject') ?></caption>
<thead>
<tr>
<td><?= $this->getText('Account'); ?>
<td class="wf-100"><?= $this->getText('Name'); ?>
<td><?= $this->getText('Total'); ?>
<tbody>
<?php $count = 0;
foreach ([] as $key => $value) : $count++; ?>
<?php endforeach; ?>
<?php if ($count === 0) : ?>
<tr>
<td colspan="13" class="empty"><?= $this->getText('Empty', 0, 0); ?>
<?php endif; ?>
</table>
</section>
</div>
<input type="radio" id="c-tab2-3" name="tabular-2">
<div class="tab tab-3">
<section class="box w-50 floatLeft">
<div class="inner">
</div>
</section>
<section class="box w-50 floatLeft">
<div class="inner">
</div>
</section>
<section class="box w-50 floatLeft">
<div class="inner">
</div>
</section>
</div>
</div>
</div>
</div>
<?php include 'account-list.tpl.php'; ?>

View File

@ -0,0 +1,33 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
echo $this->getData('nav')->render(); ?>
<section class="box w-50">
<header><h1><?= $this->getText('GL'); ?></h1></header>
<div class="inner">
<form>
<table class="layout wf-100">
<tr><td><label for="iId"><?= $this->getText('ID', 0, 0); ?></label>
<tr><td><input type="text" id="iId" name="id">
<tr><td><label for="iName"><?= $this->getText('Name'); ?></label>
<tr><td><input type="text" id="iName" name="name">
<tr><td><label for="iParent"><?= $this->getText('Parent'); ?></label>
<tr><td><input type="text" id="iParent" name="parent">
<tr><td><input type="submit" value="<?= $this->getText('Create', 0, 0); ?>">
</table>
</form>
</div>
</section>

View File

@ -0,0 +1,52 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
/**
* @var \phpOMS\Views\View $this
*/
$footerView = new \Web\Views\Lists\PaginationView($this->app, $this->request, $this->response);
$footerView->setTemplate('/Web/Templates/Lists/Footer/PaginationBig');
$footerView->setPages(1 / 25);
$footerView->setPage(1);
$footerView->setResults(1);
echo $this->getData('nav')->render(); ?>
<div class="box w-100">
<table class="table">
<caption><?= $this->getText('GL'); ?></caption>
<thead>
<tr>
<td><?= $this->getText('ID', 0, 0); ?>
<td class="wf-100"><?= $this->getText('Name'); ?>
<tfoot>
<tr><td colspan="5"><?= $footerView->render(); ?>
<tbody>
<?php $c = 0; foreach ([] as $key => $value) : $c++;
$url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/admin/group/settings?{?}&id=' . $value->getId()); ?>
<tr>
<td><a href="<?= $url; ?>"><?= $value->getId(); ?></a>
<td><a href="<?= $url; ?>"><?= $value->getName(); ?></a>
<td>
<td>
<td>
<?php endforeach; ?>
<?php if($c === 0) : ?>
<tr><td colspan="5" class="empty"><?= $this->getText('Empty', 0, 0); ?>
<?php endif; ?>
</table>
</div>

View File

@ -0,0 +1,16 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
echo $this->getData('nav')->render(); ?>

View File

@ -0,0 +1,52 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
/**
* @var \phpOMS\Views\View $this
*/
$footerView = new \Web\Views\Lists\PaginationView($this->app, $this->request, $this->response);
$footerView->setTemplate('/Web/Templates/Lists/Footer/PaginationBig');
$footerView->setPages(1 / 25);
$footerView->setPage(1);
$footerView->setResults(1);
echo $this->getData('nav')->render(); ?>
<div class="box w-100">
<table class="table">
<caption><?= $this->getText('Journal'); ?></caption>
<thead>
<tr>
<td><?= $this->getText('ID', 0, 0); ?>
<td class="wf-100"><?= $this->getText('Name'); ?>
<tfoot>
<tr><td colspan="5"><?= $footerView->render(); ?>
<tbody>
<?php $c = 0; foreach ([] as $key => $value) : $c++;
$url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/admin/group/settings?{?}&id=' . $value->getId()); ?>
<tr>
<td><a href="<?= $url; ?>"><?= $value->getId(); ?></a>
<td><a href="<?= $url; ?>"><?= $value->getName(); ?></a>
<td>
<td>
<td>
<?php endforeach; ?>
<?php if($c === 0) : ?>
<tr><td colspan="5" class="empty"><?= $this->getText('Empty', 0, 0); ?>
<?php endif; ?>
</table>
</div>

View File

@ -0,0 +1,54 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
/**
* @var \phpOMS\Views\View $this
*/
$footerView = new \Web\Views\Lists\PaginationView($this->app, $this->request, $this->response);
$footerView->setTemplate('/Web/Templates/Lists/Footer/PaginationBig');
$footerView->setPages(1 / 25);
$footerView->setPage(1);
$footerView->setResults(1);
echo $this->getData('nav')->render(); ?>
<div class="box w-100">
<table class="table">
<caption><?= $this->getText('BatchPostings'); ?></caption>
<thead>
<tr>
<td><?= $this->getText('ID', 0, 0); ?>
<td class="wf-100"><?= $this->getText('Name'); ?>
<td><?= $this->getText('Creator'); ?>
<td><?= $this->getText('Created'); ?>
<tfoot>
<tr><td colspan="5"><?= $footerView->render(); ?>
<tbody>
<?php $c = 0; foreach ([] as $key => $value) : $c++;
$url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/admin/group/settings?{?}&id=' . $value->getId()); ?>
<tr>
<td><a href="<?= $url; ?>"><?= $value->getId(); ?></a>
<td><a href="<?= $url; ?>"><?= $value->getName(); ?></a>
<td>
<td>
<td>
<?php endforeach; ?>
<?php if($c === 0) : ?>
<tr><td colspan="5" class="empty"><?= $this->getText('Empty', 0, 0); ?>
<?php endif; ?>
</table>
</div>

View File

@ -0,0 +1,38 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
/**
* @var \phpOMS\Views\View $this
*/
echo $this->getData('nav')->render(); ?>
<section class="box w-50">
<header><h1><?= $this->getText('Stack'); ?></h1></header>
<div class="inner">
<form>
<table class="layout wf-100">
<tr><td><label for="iName"><?= $this->getText('Name'); ?></label>
<tr><td><input id="iName" name="name" type="text">
<tr><td><label for="iType"><?= $this->getText('Type'); ?></label>
<tr><td><select id="iType" name="type">
<option value=""><?= $this->getText('TAccount'); ?>
<option value=""><?= $this->getText('Incoming'); ?>
<option value=""><?= $this->getText('Outgoing'); ?>
</select>
<tr><td><input name="submit" type="submit" value="<?= $this->getText('Create', 0, 0); ?>">
</table>
</form>
</div>
</section>

View File

@ -0,0 +1,16 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
echo $this->getData('nav')->render(); ?>

View File

@ -0,0 +1,54 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
/**
* @var \phpOMS\Views\View $this
*/
$footerView = new \Web\Views\Lists\PaginationView($this->app, $this->request, $this->response);
$footerView->setTemplate('/Web/Templates/Lists/Footer/PaginationBig');
$footerView->setPages(1 / 25);
$footerView->setPage(1);
$footerView->setResults(1);
echo $this->getData('nav')->render(); ?>
<div class="box w-100">
<table class="table">
<caption><?= $this->getText('BatchPostings'); ?></caption>
<thead>
<tr>
<td><?= $this->getText('ID', 0, 0); ?>
<td class="wf-100"><?= $this->getText('Name'); ?>
<td><?= $this->getText('Creator'); ?>
<td><?= $this->getText('Created'); ?>
<tfoot>
<tr><td colspan="5"><?= $footerView->render(); ?>
<tbody>
<?php $c = 0; foreach ([] as $key => $value) : $c++;
$url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/admin/group/settings?{?}&id=' . $value->getId()); ?>
<tr>
<td><a href="<?= $url; ?>"><?= $value->getId(); ?></a>
<td><a href="<?= $url; ?>"><?= $value->getName(); ?></a>
<td>
<td>
<td>
<?php endforeach; ?>
<?php if($c === 0) : ?>
<tr><td colspan="5" class="empty"><?= $this->getText('Empty', 0, 0); ?>
<?php endif; ?>
</table>
</div>

View File

@ -0,0 +1,55 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
/**
* @var \phpOMS\Views\View $this
*/
$footerView = new \Web\Views\Lists\PaginationView($this->app, $this->request, $this->response);
$footerView->setTemplate('/Web/Templates/Lists/Footer/PaginationBig');
$footerView->setPages(1 / 25);
$footerView->setPage(1);
$footerView->setResults(1);
echo $this->getData('nav')->render(); ?>
<div class="box w-100">
<table class="table">
<caption><?= $this->getText('BatchPostings'); ?></caption>
<thead>
<tr>
<td><?= $this->getText('ID', 0, 0); ?>
<td><?= $this->getText('Due'); ?>
<td class="wf-100"><?= $this->getText('Name'); ?>
<td><?= $this->getText('Creator'); ?>
<td><?= $this->getText('Created'); ?>
<tfoot>
<tr><td colspan="5"><?= $footerView->render(); ?>
<tbody>
<?php $c = 0; foreach ([] as $key => $value) : $c++;
$url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/admin/group/settings?{?}&id=' . $value->getId()); ?>
<tr>
<td><a href="<?= $url; ?>"><?= $value->getId(); ?></a>
<td><a href="<?= $url; ?>"><?= $value->getName(); ?></a>
<td>
<td>
<td>
<?php endforeach; ?>
<?php if($c === 0) : ?>
<tr><td colspan="5" class="empty"><?= $this->getText('Empty', 0, 0); ?>
<?php endif; ?>
</table>
</div>

BIN
img/module_teaser_small.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

44
info.json Normal file
View File

@ -0,0 +1,44 @@
{
"name": {
"id": 1002600000,
"internal": "Accounting",
"external": "OMS Accounting"
},
"version": "1.0.0",
"requirements": {
"phpOMS": "1.0.0",
"phpOMS-db": "1.0.0"
},
"creator": {
"name": "Orange Management",
"website": "www.spl1nes.com"
},
"description": "Accounting module.",
"directory": "Accounting",
"dependencies": {
"Admin" : "1.0.0"
},
"providing": {
"Navigation": "*"
},
"load": [
{
"pid": [
"47e9d72449035cd040e0f93693fd0a925bf6e340"
],
"type": 4,
"for": "Content",
"from": "Accounting",
"file": "Accounting"
},
{
"pid": [
"754a08ddf8bcb1cf22f310f09206dd783d42f7dd"
],
"type": 5,
"from": "Accounting",
"for": "Navigation",
"file": "Navigation"
}
]
}