diff --git a/README.md b/README.md index 063f39a..d14334e 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,3 @@ -### Installation - -## Datenbank - ALTER TABLE `oxorder` - ADD COLUMN `D3LEITWEGID` VARCHAR(25) NOT NULL COMMENT 'xRechnung' AFTER `OSC_AMAZON_REMARK` - -## Composer - composer require d3/xrechnung:dev-modules/rel_mod_xrechnung - -## Zugangsdaten - Die Zugangdaten hinter https://xrechnung.DOMAIN.TLD/xrechnung.php? entsprechend modifizieren - .env. - +### XRechnung4OXID diff --git a/composer.json b/composer.json deleted file mode 100644 index f61f220..0000000 --- a/composer.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "d3/xrechnung", - "description": "xRechnung", - "type": "oxideshop-module", - "keywords": [ - "oxid", - "modules", - "eShop", - "d3" - ], - "authors": [ - { - "name": "D3 Data Development (Inh. Thomas Dartsch)", - "email": "info@shopmodule.com", - "homepage": "https://www.d3data.de", - "role": "Owner" - } - ], - "support": { - "email": "support@shopmodule.com" - }, - "homepage": "https://www.oxidmodule.com/", - - "require": { - }, - "extra": { - "oxideshop": { - "source-directory": "/src", - "target-directory": "d3/xrechnung" - } - }, - "autoload": { - "psr-4": { - "D3\\XRechnung\\": "../../../source/modules/d3/xrechnung" - } - } -} diff --git a/src/Application/views/admin/blocks/order_overview.tpl b/src/Application/views/admin/blocks/order_overview.tpl deleted file mode 100644 index 1154ff7..0000000 --- a/src/Application/views/admin/blocks/order_overview.tpl +++ /dev/null @@ -1,51 +0,0 @@ -[{$smarty.block.parent}] - -[{if $edit && $oView->d3CanExport() && $oViewConf->getActiveClassName()|oxlower == 'order_overview'}] -
-
- [{$oViewConf->getHiddenSid()}] - - - - -
- xRechnung - - - - - - - - - [{* - - *}] - - - -
- [{oxmultilang ident= - - :  - -
- - -
- - -

- - -
-
-
-[{/if}] \ No newline at end of file diff --git a/src/Application/views/admin/de/config_lang.php b/src/Application/views/admin/de/config_lang.php deleted file mode 100644 index 6b2181d..0000000 --- a/src/Application/views/admin/de/config_lang.php +++ /dev/null @@ -1,29 +0,0 @@ - - * @link http://www.oxidmodule.com - */ - -// @codeCoverageIgnoreStart - -$sLangName = "Deutsch"; -$iLangNr = 0; - -$aLang = array( - //Navigation - 'charset' => 'UTF-8', - 'SHOP_MODULE_GROUP_d3xrechnung' => 'Einstellungen', - 'SHOP_MODULE_d3xrechnung_PATH_GENERATOR' => 'Pfad xRechnung', - 'SHOP_MODULE_d3xrechnung_HTACCESS_USER' => '.htaccess - User', - 'SHOP_MODULE_d3xrechnung_HTACCESS_PASSWORD' => '.htaccess - Password', -); \ No newline at end of file diff --git a/src/Modules/Application/Controller/Admin/OrderOverview.php b/src/Modules/Application/Controller/Admin/OrderOverview.php deleted file mode 100644 index fb9ce80..0000000 --- a/src/Modules/Application/Controller/Admin/OrderOverview.php +++ /dev/null @@ -1,58 +0,0 @@ -getEditObjectId(); - if ($soxId != "-1" && isset($soxId)) { - // load object - $oOrder = oxNew(\OxidEsales\Eshop\Application\Model\Order::class); - if ($oOrder->load($soxId)) { - $oConfig = $this->getConfig(); - $aParams = $oConfig->getRequestParameter("editval"); - - if($aParams["oxorder__d3leitwegid"]) - { - $oOrder->assign( - array('d3leitwegid' => $aParams["oxorder__d3leitwegid"]) - ); - $oOrder->save(); - } - - $oUtils = \OxidEsales\Eshop\Core\Registry::getUtils(); - $sTrimmedBillName = trim($oOrder->oxorder__oxbilllname->getRawValue()); - if(!$sTrimmedBillName) { - return FALSE; - } - else { - $strx=array('#[^a-zA-Z0-9äöüß\040]#','# +#','#ä#','#ö#','#ü#','#ß#'); - $stry=array(' ',' ','ae','oe','ue','ss'); - $sTrimmedBillName=preg_replace($strx,$stry,$sTrimmedBillName); - $sTrimmedBillName=trim($sTrimmedBillName); - $sTrimmedBillName=strtolower($sTrimmedBillName); - } - $sFilename = $oOrder->oxorder__oxordernr->value . "_" . $sTrimmedBillName . ".xml"; - $sFilename = $this->makeValidFileName($sFilename); - ob_start(); - $oOrder->genXRechnung($sFilename, \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("xmllanguage"), false); - - $myConfig = Registry::getConfig(); - - echo file_get_contents($myConfig->getConfigParam('sShopDir')."/export/xml/".$sFilename); - $sXML = ob_get_contents(); - ob_end_clean(); - $oUtils->setHeader("Pragma: public"); - $oUtils->setHeader("Cache-Control: must-revalidate, post-check=0, pre-check=0"); - $oUtils->setHeader("Expires: 0"); - $oUtils->setHeader("Content-type: application/xml"); - $oUtils->setHeader("Content-Disposition: attachment; filename=" . $sFilename); - \OxidEsales\Eshop\Core\Registry::getUtils()->showMessageAndExit($sXML); - } - } - } -} diff --git a/src/Modules/Application/Model/Order.php b/src/Modules/Application/Model/Order.php deleted file mode 100644 index d345bc8..0000000 --- a/src/Modules/Application/Model/Order.php +++ /dev/null @@ -1,84 +0,0 @@ -oxorder__oxbillnr->value) { - $this->oxorder__oxbillnr->setValue($this->getNextBillNum()); - $blIsNewOrder = 1; - } - // setting invoice date - if ($this->oxorder__oxbilldate->value == '0000-00-00') { - $this->oxorder__oxbilldate->setValue(date('Y-m-d', mktime(0, 0, 0, date('m'), date('d'), date('Y')))); - $blIsNewOrder = 1; - } - - if ($blIsNewOrder) { - $this->save(); - } - - // adding info data - switch (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('exporttype')) { - case ('xml'): - return $this->getXRechnungXml($sFilename, $this->getId(), $iSelLang, $sendContent); - break; - default: - return $this->getXRechnungXml($sFilename, $this->getId(), $iSelLang, $sendContent); - } - } - - /** - * @param $sOrderId - * @return true - */ - protected function getXRechnungXml(string $sFilename, string $sOrderId, int $iSelLang, bool $sendContent = false) - { - $oConfig = Registry::getConfig(); - $oConfig->getConfigParam('d3xrechnung_PATH_GENERATOR'); - - $sPathDetails = $oConfig->getConfigParam('d3xrechnung_PATH_GENERATOR'); - $sPathDetails .= 'orderid='.$sOrderId; - $sPathDetails .= '&filename='.$sFilename; - $sPathDetails .= '&iSelLang='.$iSelLang; - $sPathDetails .= '&sendContent='.$sendContent; - $sPathDetails .= '&combinexmlpdf=false'; - - $sUser = $oConfig->getConfigParam('d3xrechnung_HTACCESS_USER'); - $sPassword = $oConfig->getConfigParam('d3xrechnung_HTACCESS_PASSWORD'); - - $client = new Client(); - try { - /* - $response = $client->request('GET', $sPathDetails, - ['auth' => ['schmidt', 'tGiVLrBQik!8']] - ); - */ - - $response = $client->request('GET', $sPathDetails, - ['auth' => [$sUser, $sPassword]] - ); - - if($sendContent) { - return $response->getBody(); // '{"id": 1420053, "name": "guzzle", ...}' - } - return true; - } - catch (ClientException $exception) { - $logger = Registry::getLogger(); - $logger->error(Psr7\Message::toString($exception->getRequest()), [$exception]); - $logger->error(Psr7\Message::toString($exception->getResponse()), [$exception]); - } - return true; - } - -} diff --git a/src/metadata.php b/src/metadata.php deleted file mode 100644 index b89401f..0000000 --- a/src/metadata.php +++ /dev/null @@ -1,84 +0,0 @@ - - * @link https://www.oxidmodule.com - */ - -declare(strict_types=1); - -use D3\DelUserExtension\Modules\Controller\Admin\userDeletingList; -use D3\DelUserExtension\Modules\Controller\Admin\userDeletingMain; -use D3\DelUserExtension\Modules\Core\Model\ListModel; - -$sMetadataVersion = '2.1'; - -$sModuleId = 'd3xrechnung'; -$logo = '(D3)'; - -/** - * Module information - */ -$aModule = [ - 'id' => $sModuleId, - 'title' => $logo.' Anpassung: xRechnung / Zugferd', - 'description' => [ - 'de' => '
- Ruft den Generator auf, und gibt die erstellte XML-Datei an den Browser zum Download aus.
-Der Pfad und Zugangsschutz zum Generator wird in der Konfiguration des Moduls hinterlegt. -
- Pfad: https://xrechnung.DOMAIN.TLD/xrechnung.php?
- Validierung:https://www.epoconsulting.com/erechnung-sap/xrechnung-validator
- Tickets: - - ', - 'en' => '', - ], - 'thumbnail' => 'picture.png', - 'version' => '1.0.0', - 'author' => $logo.' Data Development (Inh.: Thomas Dartsch)', - 'email' => 'support@shopmodule.com', - 'url' => 'https://www.oxidmodule.com/', - 'extend' => [ - \OxidEsales\Eshop\Application\Controller\Admin\OrderOverview::class => D3\XRechnung\Modules\Application\Controller\Admin\OrderOverview::class, - \OxidEsales\Eshop\Application\Model\Order::class => \D3\XRechnung\Modules\Application\Model\Order::class - ], - 'templates' => [ - ], - 'settings' => [ - [ - 'group' => 'd3xrechnung', - 'name' => 'd3xrechnung_PATH_GENERATOR', - 'type' => 'str', - 'value' => 'https://xrechnung.DOMAIN.TLD/xrechnung.php?' - ], - [ - 'group' => 'd3xrechnung', - 'name' => 'd3xrechnung_HTACCESS_USER', - 'type' => 'str', - 'value' => '' - ], - [ - 'group' => 'd3xrechnung', - 'name' => 'd3xrechnung_HTACCESS_PASSWORD', - 'type' => 'str', - 'value' => '' - ], - ], - 'blocks' => array( - array( - 'template' => 'order_overview.tpl', - 'block' => 'admin_order_overview_export', - 'file' => 'Application/views/admin/blocks/order_overview.tpl', - 'position' => 100 - ), - ), -]; diff --git a/src/out/img/xrechnung.png b/src/out/img/xrechnung.png deleted file mode 100644 index 3fe6b1d..0000000 Binary files a/src/out/img/xrechnung.png and /dev/null differ diff --git a/src/picture.png b/src/picture.png deleted file mode 100644 index d817ed4..0000000 Binary files a/src/picture.png and /dev/null differ