diff --git a/Admin/Activate.php b/Admin/Activate.php new file mode 100644 index 0000000..2576883 --- /dev/null +++ b/Admin/Activate.php @@ -0,0 +1,43 @@ + + * @author Dennis Eichhorn + * @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 + * @author Dennis Eichhorn + * @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); + } +} diff --git a/Admin/Deactivate.php b/Admin/Deactivate.php new file mode 100644 index 0000000..eba53de --- /dev/null +++ b/Admin/Deactivate.php @@ -0,0 +1,43 @@ + + * @author Dennis Eichhorn + * @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 + * @author Dennis Eichhorn + * @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); + } +} diff --git a/Admin/Install/Navigation.install.json b/Admin/Install/Navigation.install.json new file mode 100644 index 0000000..8177df4 --- /dev/null +++ b/Admin/Install/Navigation.install.json @@ -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": [ + + ] + } + ] + } +] diff --git a/Admin/Install/Navigation.php b/Admin/Install/Navigation.php new file mode 100644 index 0000000..63abfe1 --- /dev/null +++ b/Admin/Install/Navigation.php @@ -0,0 +1,40 @@ + + * @author Dennis Eichhorn + * @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 + * @author Dennis Eichhorn + * @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); + } +} diff --git a/Admin/Installer.php b/Admin/Installer.php new file mode 100644 index 0000000..45fb23c --- /dev/null +++ b/Admin/Installer.php @@ -0,0 +1,214 @@ + + * @author Dennis Eichhorn + * @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 + * @author Dennis Eichhorn + * @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; + } + } +} diff --git a/Admin/Routes/Web/Backend.php b/Admin/Routes/Web/Backend.php new file mode 100644 index 0000000..1b02353 --- /dev/null +++ b/Admin/Routes/Web/Backend.php @@ -0,0 +1,102 @@ + [ + [ + '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, + ], + ], +]; diff --git a/Admin/Routes/console.php b/Admin/Routes/console.php new file mode 100644 index 0000000..1ecbfac --- /dev/null +++ b/Admin/Routes/console.php @@ -0,0 +1,3 @@ + + * @author Dennis Eichhorn + * @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 + * @author Dennis Eichhorn + * @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(); + } +} diff --git a/Admin/Update.php b/Admin/Update.php new file mode 100644 index 0000000..a74800b --- /dev/null +++ b/Admin/Update.php @@ -0,0 +1,46 @@ + + * @author Dennis Eichhorn + * @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 + * @author Dennis Eichhorn + * @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); + } +} diff --git a/Controller.php b/Controller.php new file mode 100644 index 0000000..f748b68 --- /dev/null +++ b/Controller.php @@ -0,0 +1,274 @@ + + * @author Dennis Eichhorn + * @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 + * @author Dennis Eichhorn + * @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 + */ + 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 + */ + 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 + */ + 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 + */ + 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 + */ + 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 + */ + 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 + */ + 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 + */ + 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 + */ + 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 + */ + 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; + } + +} diff --git a/Models/AccountAbstract.php b/Models/AccountAbstract.php new file mode 100644 index 0000000..258bf21 --- /dev/null +++ b/Models/AccountAbstract.php @@ -0,0 +1,101 @@ + + * @author Dennis Eichhorn + * @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 + * @author Dennis Eichhorn + * @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 + */ + public function __construct($id) + { + $this->id = $id; + } + + /** + * Get entry. + * + * @param int $id Entry ID + * + * @return void + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ + 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 + */ + public function getEntriesByDate($start, $end, $dateType = TimeRangeType::RECEIPT_DATE) + { + } +} diff --git a/Models/AccountBalance.php b/Models/AccountBalance.php new file mode 100644 index 0000000..d5e81a4 --- /dev/null +++ b/Models/AccountBalance.php @@ -0,0 +1,212 @@ + + * @author Dennis Eichhorn + * @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 + * @author Dennis Eichhorn + * @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 + */ + public function __construct(int $id) + { + $this->id = $id; + } + + /** + * @return \DateTime + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ + public function getStart() + { + return $this->start; + } + + /** + * @param \DateTime $start + * + * @return void + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ + public function setStart($start) + { + $this->start = $start; + } + + /** + * @return \DateTime + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ + public function getEnd() + { + return $this->end; + } + + /** + * @param \DateTime $end + * + * @return void + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ + public function setEnd($end) + { + $this->end = $end; + } + + /** + * @return TimeRangeType + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ + public function getRangetype() + { + return $this->rangetype; + } + + /** + * @param TimeRangeType $rangetype + * + * @return void + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ + public function setRangetype($rangetype) + { + $this->rangetype = $rangetype; + } + + /** + * @return AccountInterface + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ + public function getAccount() + { + return $this->account; + } + + /** + * @param AccountInterface $account + * + * @return void + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ + public function setAccount($account) + { + $this->account = $account; + } + + /** + * @return float + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ + public function getBalance() + { + return $this->balance; + } + + /** + * @param float $balance + * + * @return void + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ + public function setBalance($balance) + { + $this->balance = $balance; + } +} diff --git a/Models/AccountInterface.php b/Models/AccountInterface.php new file mode 100644 index 0000000..3151967 --- /dev/null +++ b/Models/AccountInterface.php @@ -0,0 +1,51 @@ + + * @author Dennis Eichhorn + * @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 + * @author Dennis Eichhorn + * @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 + */ + public function getBalance(); + + /** + * Close out account. + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ + public function closeOut(); +} diff --git a/Models/AccountType.php b/Models/AccountType.php new file mode 100644 index 0000000..4de4f94 --- /dev/null +++ b/Models/AccountType.php @@ -0,0 +1,40 @@ + + * @author Dennis Eichhorn + * @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 + * @author Dennis Eichhorn + * @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; +} diff --git a/Models/Balance.php b/Models/Balance.php new file mode 100644 index 0000000..6a9ab0b --- /dev/null +++ b/Models/Balance.php @@ -0,0 +1,156 @@ + + * @author Dennis Eichhorn + * @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 + * @author Dennis Eichhorn + * @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 + */ + public function __construct() + { + } + + /** + * @return int + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ + public function getId() + { + return $this->id; + } + + /** + * @param int $id + * + * @return void + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ + 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) + { + } +} diff --git a/Models/BatchPosting.php b/Models/BatchPosting.php new file mode 100644 index 0000000..7539812 --- /dev/null +++ b/Models/BatchPosting.php @@ -0,0 +1,303 @@ + + * @author Dennis Eichhorn + * @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 + * @author Dennis Eichhorn + * @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 + */ + public function __construct() + { + } + + /** + * Get id. + * + * @return int + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ + public function getId() + { + return $this->id; + } + + /** + * Set id. + * + * @param int $id Batch ID + * + * @return void + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ + public function setId($id) + { + $this->id = $id; + } + + /** + * Get description. + * + * @return string + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ + public function getDescription() + { + return $this->description; + } + + /** + * Set description. + * + * @param string $desc Description + * + * @return void + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ + public function setDescription($desc) + { + } + + /** + * Get created. + * + * @return \Datetime + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ + public function getCreated() + { + return $this->created; + } + + /** + * Set creator. + * + * @param \Datetime $created Created + * + * @return void + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ + public function setCreated($created) + { + $this->created = $created; + } + + /** + * Get creator. + * + * @return int + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ + public function getCreator() + { + return $this->creator; + } + + /** + * Set creator. + * + * @param int $creator Creator ID + * + * @return void + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ + 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 + */ + public function getPosting($id) + { + return $this->postings[$id]; + } + + /** + * Remove posting. + * + * @param int $id Posting ID + * + * @return void + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ + 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 + */ + 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) + { + } +} diff --git a/Models/CostCenter.php b/Models/CostCenter.php new file mode 100644 index 0000000..e69de29 diff --git a/Models/CostObject.php b/Models/CostObject.php new file mode 100644 index 0000000..e69de29 diff --git a/Models/CreditPosting.php b/Models/CreditPosting.php new file mode 100644 index 0000000..e69de29 diff --git a/Models/Creditor.php b/Models/Creditor.php new file mode 100644 index 0000000..82c4212 --- /dev/null +++ b/Models/Creditor.php @@ -0,0 +1,99 @@ + + * @author Dennis Eichhorn + * @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 + * @author Dennis Eichhorn + * @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 + */ + 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) + { + } +} diff --git a/Models/CreditorAccount.php b/Models/CreditorAccount.php new file mode 100644 index 0000000..e0e7b24 --- /dev/null +++ b/Models/CreditorAccount.php @@ -0,0 +1,51 @@ + + * @author Dennis Eichhorn + * @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 + * @author Dennis Eichhorn + * @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 + */ + public function __construct() + { + } + + public function getPDO() + { + } + + public function getDefault() + { + } +} diff --git a/Models/DebitPosting.php b/Models/DebitPosting.php new file mode 100644 index 0000000..e69de29 diff --git a/Models/Debitor.php b/Models/Debitor.php new file mode 100644 index 0000000..6f9b861 --- /dev/null +++ b/Models/Debitor.php @@ -0,0 +1,99 @@ + + * @author Dennis Eichhorn + * @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 + * @author Dennis Eichhorn + * @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 + */ + 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) + { + } +} diff --git a/Models/DebitorAccount.php b/Models/DebitorAccount.php new file mode 100644 index 0000000..2a3d0d6 --- /dev/null +++ b/Models/DebitorAccount.php @@ -0,0 +1,55 @@ + + * @author Dennis Eichhorn + * @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 + * @author Dennis Eichhorn + * @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 + */ + public function __construct() + { + } + + public function getDSO() + { + } + + public function getDefault() + { + } + + public function getNetReceivable() + { + } +} diff --git a/Models/EntryInterface.php b/Models/EntryInterface.php new file mode 100644 index 0000000..adfd0f1 --- /dev/null +++ b/Models/EntryInterface.php @@ -0,0 +1,31 @@ + + * @author Dennis Eichhorn + * @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 + * @author Dennis Eichhorn + * @license OMS License 1.0 + * @link http://orange-management.com + * @since 1.0.0 + */ +interface EntryInterface +{ +} diff --git a/Models/ImpersonalAccount.php b/Models/ImpersonalAccount.php new file mode 100644 index 0000000..fce1d47 --- /dev/null +++ b/Models/ImpersonalAccount.php @@ -0,0 +1,99 @@ + + * @author Dennis Eichhorn + * @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 + * @author Dennis Eichhorn + * @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 + */ + 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) + { + } +} diff --git a/Models/IncomeStatement.php b/Models/IncomeStatement.php new file mode 100644 index 0000000..95e8b56 --- /dev/null +++ b/Models/IncomeStatement.php @@ -0,0 +1,98 @@ + + * @author Dennis Eichhorn + * @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 + * @author Dennis Eichhorn + * @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) + { + } +} diff --git a/Models/InvoicePosting.php b/Models/InvoicePosting.php new file mode 100644 index 0000000..b8b11c3 --- /dev/null +++ b/Models/InvoicePosting.php @@ -0,0 +1,99 @@ + + * @author Dennis Eichhorn + * @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 + * @author Dennis Eichhorn + * @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 + */ + 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) + { + } +} diff --git a/Models/InvoicePostingSimple.php b/Models/InvoicePostingSimple.php new file mode 100644 index 0000000..a0fea13 --- /dev/null +++ b/Models/InvoicePostingSimple.php @@ -0,0 +1,99 @@ + + * @author Dennis Eichhorn + * @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 + * @author Dennis Eichhorn + * @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 + */ + 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) + { + } +} diff --git a/Models/PersonalAccountAbstract.php b/Models/PersonalAccountAbstract.php new file mode 100644 index 0000000..98de5a7 --- /dev/null +++ b/Models/PersonalAccountAbstract.php @@ -0,0 +1,110 @@ + + * @author Dennis Eichhorn + * @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 + * @author Dennis Eichhorn + * @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) + { + } +} diff --git a/Models/Posting.php b/Models/Posting.php new file mode 100644 index 0000000..635b9a0 --- /dev/null +++ b/Models/Posting.php @@ -0,0 +1,99 @@ + + * @author Dennis Eichhorn + * @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 + * @author Dennis Eichhorn + * @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 + */ + 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) + { + } +} diff --git a/Models/PostingAbstract.php b/Models/PostingAbstract.php new file mode 100644 index 0000000..f4c1cff --- /dev/null +++ b/Models/PostingAbstract.php @@ -0,0 +1,43 @@ + + * @author Dennis Eichhorn + * @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 + * @author Dennis Eichhorn + * @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 + */ + public function __construct() + { + } +} diff --git a/Models/PostingInterface.php b/Models/PostingInterface.php new file mode 100644 index 0000000..92e79e0 --- /dev/null +++ b/Models/PostingInterface.php @@ -0,0 +1,33 @@ + + * @author Dennis Eichhorn + * @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 + * @author Dennis Eichhorn + * @license OMS License 1.0 + * @link http://orange-management.com + * @since 1.0.0 + */ +interface PostingInterface extends ExchangeInterface +{ +} diff --git a/Models/TimeRangeType.php b/Models/TimeRangeType.php new file mode 100644 index 0000000..6d4d7a3 --- /dev/null +++ b/Models/TimeRangeType.php @@ -0,0 +1,37 @@ + + * @author Dennis Eichhorn + * @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 + * @author Dennis Eichhorn + * @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) */ +} diff --git a/Models/temp/Account.php b/Models/temp/Account.php new file mode 100644 index 0000000..e2b3f86 --- /dev/null +++ b/Models/temp/Account.php @@ -0,0 +1,97 @@ +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; + } +} +*/ \ No newline at end of file diff --git a/Models/temp/AccountValue.php b/Models/temp/AccountValue.php new file mode 100644 index 0000000..f0aaecc --- /dev/null +++ b/Models/temp/AccountValue.php @@ -0,0 +1,58 @@ +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; + } +} diff --git a/Models/temp/Balance.php b/Models/temp/Balance.php new file mode 100644 index 0000000..0932325 --- /dev/null +++ b/Models/temp/Balance.php @@ -0,0 +1,5 @@ +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; + } +} diff --git a/Models/temp/DistributionKey.php b/Models/temp/DistributionKey.php new file mode 100644 index 0000000..f8d2dc1 --- /dev/null +++ b/Models/temp/DistributionKey.php @@ -0,0 +1,41 @@ +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); + } +} diff --git a/Models/temp/Element.php b/Models/temp/Element.php new file mode 100644 index 0000000..03f74a2 --- /dev/null +++ b/Models/temp/Element.php @@ -0,0 +1,74 @@ +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; + } +} diff --git a/Models/temp/KeyCollection.php b/Models/temp/KeyCollection.php new file mode 100644 index 0000000..0406352 --- /dev/null +++ b/Models/temp/KeyCollection.php @@ -0,0 +1,32 @@ +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; + } +} diff --git a/Models/temp/PL.php b/Models/temp/PL.php new file mode 100644 index 0000000..2b42732 --- /dev/null +++ b/Models/temp/PL.php @@ -0,0 +1,67 @@ += $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(); + } +} diff --git a/Models/temp/Position.php b/Models/temp/Position.php new file mode 100644 index 0000000..36c2d04 --- /dev/null +++ b/Models/temp/Position.php @@ -0,0 +1,8 @@ + + * @author Dennis Eichhorn + * @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', +]]; diff --git a/Theme/Backend/Lang/api.en.lang.php b/Theme/Backend/Lang/api.en.lang.php new file mode 100644 index 0000000..afe845f --- /dev/null +++ b/Theme/Backend/Lang/api.en.lang.php @@ -0,0 +1,17 @@ + + * @author Dennis Eichhorn + * @copyright Dennis Eichhorn + * @license OMS License 1.0 + * @version 1.0.0 + * @link http://orange-management.com + */ +$MODLANG[1] = [ +]; diff --git a/Theme/Backend/Lang/en.lang.php b/Theme/Backend/Lang/en.lang.php new file mode 100644 index 0000000..e908fa3 --- /dev/null +++ b/Theme/Backend/Lang/en.lang.php @@ -0,0 +1,49 @@ + + * @author Dennis Eichhorn + * @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', +]]; diff --git a/Theme/Backend/account-list.tpl.php b/Theme/Backend/account-list.tpl.php new file mode 100644 index 0000000..697cf07 --- /dev/null +++ b/Theme/Backend/account-list.tpl.php @@ -0,0 +1,12 @@ + \ No newline at end of file diff --git a/Theme/Backend/entries.tpl.php b/Theme/Backend/entries.tpl.php new file mode 100644 index 0000000..2b3a9f9 --- /dev/null +++ b/Theme/Backend/entries.tpl.php @@ -0,0 +1,181 @@ + + * @author Dennis Eichhorn + * @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); +?> + +
+
+
+ + + + + + +
+
+ + + +
+
+ + + +
+
+
+
+
+ +
+
+ +
+ +
+
+ + + + + + + + $value) : $count++; ?> + + + +
getText('Entries') ?>
getText('EntryDate'); ?> + getText('Receipt'); ?> + getText('Debit'); ?> + getText('Credit'); ?> + getText('Text'); ?> + getText('Account'); ?> + getText('ContraAccount'); ?> + getText('CostCenter'); ?> + getText('CostObject'); ?> + getText('ReceiptDate'); ?> + getText('ExternalVoucher'); ?> + getText('Creator'); ?> + getText('Created'); ?> +
render(); ?> +
getText('Empty', 0, 0); ?> + +
+
+
+ +
+
+ + + + + + $value) : $count++; ?> + + + +
getText('Accounts') ?>
getText('Account'); ?> + getText('Name'); ?> + getText('Total'); ?> +
getText('Empty', 0, 0); ?> + +
+
+
+ + + + + + $value) : $count++; ?> + + + +
getText('CostCenter') ?>
getText('CostCenter'); ?> + getText('Name'); ?> + getText('Total'); ?> +
getText('Empty', 0, 0); ?> + +
+
+
+ + + + + + $value) : $count++; ?> + + + +
getText('CostObject') ?>
getText('Account'); ?> + getText('Name'); ?> + getText('Total'); ?> +
getText('Empty', 0, 0); ?> + +
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + \ No newline at end of file diff --git a/Theme/Backend/gl-create.tpl.php b/Theme/Backend/gl-create.tpl.php new file mode 100644 index 0000000..21ec1af --- /dev/null +++ b/Theme/Backend/gl-create.tpl.php @@ -0,0 +1,33 @@ + + * @author Dennis Eichhorn + * @copyright Dennis Eichhorn + * @license OMS License 1.0 + * @version 1.0.0 + * @link http://orange-management.com + */ +echo $this->getData('nav')->render(); ?> + +
+

getText('GL'); ?>

+
+
+ +
+
+
+
+
+
+
+
+
+
+
diff --git a/Theme/Backend/gl-list.tpl.php b/Theme/Backend/gl-list.tpl.php new file mode 100644 index 0000000..29784c0 --- /dev/null +++ b/Theme/Backend/gl-list.tpl.php @@ -0,0 +1,52 @@ + + * @author Dennis Eichhorn + * @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(); ?> + +
+ + + + + + + $value) : $c++; + $url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/admin/group/settings?{?}&id=' . $value->getId()); ?> + +
getText('GL'); ?>
getText('ID', 0, 0); ?> + getText('Name'); ?> +
render(); ?> +
getId(); ?> + getName(); ?> + + + + + +
getText('Empty', 0, 0); ?> + +
+
diff --git a/Theme/Backend/gl-profile.tpl.php b/Theme/Backend/gl-profile.tpl.php new file mode 100644 index 0000000..01c1a1e --- /dev/null +++ b/Theme/Backend/gl-profile.tpl.php @@ -0,0 +1,16 @@ + + * @author Dennis Eichhorn + * @copyright Dennis Eichhorn + * @license OMS License 1.0 + * @version 1.0.0 + * @link http://orange-management.com + */ +echo $this->getData('nav')->render(); ?> diff --git a/Theme/Backend/journal-list.tpl.php b/Theme/Backend/journal-list.tpl.php new file mode 100644 index 0000000..5c0dcce --- /dev/null +++ b/Theme/Backend/journal-list.tpl.php @@ -0,0 +1,52 @@ + + * @author Dennis Eichhorn + * @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(); ?> + +
+ + + + + + + $value) : $c++; + $url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/admin/group/settings?{?}&id=' . $value->getId()); ?> + +
getText('Journal'); ?>
getText('ID', 0, 0); ?> + getText('Name'); ?> +
render(); ?> +
getId(); ?> + getName(); ?> + + + + + +
getText('Empty', 0, 0); ?> + +
+
diff --git a/Theme/Backend/stack-archive-list.tpl.php b/Theme/Backend/stack-archive-list.tpl.php new file mode 100644 index 0000000..cc9981c --- /dev/null +++ b/Theme/Backend/stack-archive-list.tpl.php @@ -0,0 +1,54 @@ + + * @author Dennis Eichhorn + * @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(); ?> + +
+ + + + + + + $value) : $c++; + $url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/admin/group/settings?{?}&id=' . $value->getId()); ?> + +
getText('BatchPostings'); ?>
getText('ID', 0, 0); ?> + getText('Name'); ?> + getText('Creator'); ?> + getText('Created'); ?> +
render(); ?> +
getId(); ?> + getName(); ?> + + + + + +
getText('Empty', 0, 0); ?> + +
+
diff --git a/Theme/Backend/stack-create.tpl.php b/Theme/Backend/stack-create.tpl.php new file mode 100644 index 0000000..815d39a --- /dev/null +++ b/Theme/Backend/stack-create.tpl.php @@ -0,0 +1,38 @@ + + * @author Dennis Eichhorn + * @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(); ?> + +
+

getText('Stack'); ?>

+
+
+ +
+
+
+
+
+
+
+
+
diff --git a/Theme/Backend/stack-entries.tpl.php b/Theme/Backend/stack-entries.tpl.php new file mode 100644 index 0000000..01c1a1e --- /dev/null +++ b/Theme/Backend/stack-entries.tpl.php @@ -0,0 +1,16 @@ + + * @author Dennis Eichhorn + * @copyright Dennis Eichhorn + * @license OMS License 1.0 + * @version 1.0.0 + * @link http://orange-management.com + */ +echo $this->getData('nav')->render(); ?> diff --git a/Theme/Backend/stack-list.tpl.php b/Theme/Backend/stack-list.tpl.php new file mode 100644 index 0000000..cc9981c --- /dev/null +++ b/Theme/Backend/stack-list.tpl.php @@ -0,0 +1,54 @@ + + * @author Dennis Eichhorn + * @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(); ?> + +
+ + + + + + + $value) : $c++; + $url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/admin/group/settings?{?}&id=' . $value->getId()); ?> + +
getText('BatchPostings'); ?>
getText('ID', 0, 0); ?> + getText('Name'); ?> + getText('Creator'); ?> + getText('Created'); ?> +
render(); ?> +
getId(); ?> + getName(); ?> + + + + + +
getText('Empty', 0, 0); ?> + +
+
diff --git a/Theme/Backend/stack-predefined-list.tpl.php b/Theme/Backend/stack-predefined-list.tpl.php new file mode 100644 index 0000000..b7c19a6 --- /dev/null +++ b/Theme/Backend/stack-predefined-list.tpl.php @@ -0,0 +1,55 @@ + + * @author Dennis Eichhorn + * @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(); ?> + +
+ + + + + + + $value) : $c++; + $url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/admin/group/settings?{?}&id=' . $value->getId()); ?> + +
getText('BatchPostings'); ?>
getText('ID', 0, 0); ?> + getText('Due'); ?> + getText('Name'); ?> + getText('Creator'); ?> + getText('Created'); ?> +
render(); ?> +
getId(); ?> + getName(); ?> + + + + + +
getText('Empty', 0, 0); ?> + +
+
diff --git a/img/module_teaser_small.png b/img/module_teaser_small.png new file mode 100644 index 0000000..f56e6ff Binary files /dev/null and b/img/module_teaser_small.png differ diff --git a/info.json b/info.json new file mode 100644 index 0000000..1dd9408 --- /dev/null +++ b/info.json @@ -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" + } + ] +}