diff --git a/bin/backend/payment-status.css b/bin/backend/payment-status.css index 4022f290a3086e950e59adc5cb438d35069d7f27..8c834fa36a5201f02a1c83eb2373ff96069cf572 100644 --- a/bin/backend/payment-status.css +++ b/bin/backend/payment-status.css @@ -51,3 +51,9 @@ border-color: #004e5a; color: #004e5a; } + +.td.clickable:hover .processing-status, +.td.clickable:hover .payment-status { + border-color: #fff !important; + color: #fff !important; +} \ No newline at end of file diff --git a/locale.xml b/locale.xml index 692febb6490c27364422efe508d348590e05591e..c9369540b428c86f6dd44fd2388e6b4f7e2c853e 100644 --- a/locale.xml +++ b/locale.xml @@ -376,6 +376,10 @@ <de><![CDATA[Bestellung]]></de> <en><![CDATA[Order]]></en> </locale> + <locale name="process.history.empty.info"> + <de><![CDATA[Hier werden nur Einträge aufgelistet, die nach dem 01.07.2024 erstellt wurden.]]></de> + <en><![CDATA[Only entries created after 01/07/2024 are listed here.]]></en> + </locale> </groups> <groups name="quiqqer/erp" datatype="php"> diff --git a/src/QUI/ERP/Process.php b/src/QUI/ERP/Process.php index b0ac7d8dcd0836c8151c1c63ee29b1bb333f22ef..f4a3e39c3f60c5b731f2d8ff9823a5a6ae9bf20b 100644 --- a/src/QUI/ERP/Process.php +++ b/src/QUI/ERP/Process.php @@ -25,6 +25,12 @@ */ class Process { + /** + * this date determines when the global process ids start to work. + * also the relationships. + */ + const PROCESS_ACTIVE_DATE = '2024-07-01 00:00:00'; + /** * @var string */ @@ -272,6 +278,15 @@ public function getCompleteHistory(): Comments $this->parseSalesOrders($History); $this->parseTransactions($History); + if ($History->isEmpty()) { + $History->addComment( + QUI::getLocale()->get('quiqqer/erp', 'process.history.empty.info'), + strtotime(self::PROCESS_ACTIVE_DATE), + 'quiqqer/erp', + 'fa fa-info' + ); + } + try { QUI::getEvents()->fireEvent('quiqqerErpGetCompleteHistory', [$this, $this->processId]); } catch (\Exception $exception) { @@ -376,7 +391,22 @@ public function getInvoices(): array } try { - return QUI\ERP\Accounting\Invoice\Handler::getInstance()->getInvoicesByGlobalProcessId($this->processId); + $invoices = QUI\ERP\Accounting\Invoice\Handler::getInstance()->getInvoicesByGlobalProcessId( + $this->processId + ); + + $processDate = strtotime(self::PROCESS_ACTIVE_DATE); + + return array_filter($invoices, function ($Invoice) use ($processDate) { + $createDate = $Invoice->getAttribute('c_date'); + $createDate = strtotime($createDate); + + if ($createDate > $processDate) { + return true; + } + + return false; + }); } catch (\QUI\Exception) { return []; } @@ -483,7 +513,19 @@ public function getOrders(): array } try { - return QUI\ERP\Order\Handler::getInstance()->getOrdersByGlobalProcessId($this->processId); + $orders = QUI\ERP\Order\Handler::getInstance()->getOrdersByGlobalProcessId($this->processId); + $processDate = strtotime(self::PROCESS_ACTIVE_DATE); + + return array_filter($orders, function ($Order) use ($processDate) { + $createDate = $Order->getAttribute('c_date'); + $createDate = strtotime($createDate); + + if ($createDate > $processDate) { + return true; + } + + return false; + }); } catch (QUI\Exception) { return []; } @@ -589,7 +631,18 @@ public function getOffers(): array } } - return $result; + $processDate = strtotime(self::PROCESS_ACTIVE_DATE); + + return array_filter($result, function ($Offer) use ($processDate) { + $createDate = $Offer->getAttribute('c_date'); + $createDate = strtotime($createDate); + + if ($createDate > $processDate) { + return true; + } + + return false; + }); } //endregion @@ -675,7 +728,19 @@ public function getBookings(): array } } - return $result; + $processDate = strtotime(self::PROCESS_ACTIVE_DATE); + + return array_filter($result, function ($Booking) use ($processDate) { + // @todo c_date?? + $createDate = $Booking->getAttribute('c_date'); + $createDate = strtotime($createDate); + + if ($createDate > $processDate) { + return true; + } + + return false; + }); } //endregion @@ -760,7 +825,18 @@ public function getPurchasing(): array } } - return $result; + $processDate = strtotime(self::PROCESS_ACTIVE_DATE); + + return array_filter($result, function ($Purchase) use ($processDate) { + $createDate = $Purchase->getAttribute('c_date'); + $createDate = strtotime($createDate); + + if ($createDate > $processDate) { + return true; + } + + return false; + }); } //endregion @@ -837,7 +913,19 @@ public function getSalesOrders(): array } } - return $result; + + $processDate = strtotime(self::PROCESS_ACTIVE_DATE); + + return array_filter($result, function ($SalesOrder) use ($processDate) { + $createDate = $SalesOrder->getAttribute('c_date'); + $createDate = strtotime($createDate); + + if ($createDate > $processDate) { + return true; + } + + return false; + }); } //endregion @@ -889,7 +977,19 @@ public function getTransactions(): array } $Transactions = QUI\ERP\Accounting\Payments\Transactions\Handler::getInstance(); - $this->transactions = $Transactions->getTransactionsByProcessId($this->processId); + $transactions = $Transactions->getTransactionsByProcessId($this->processId); + $processDate = strtotime(self::PROCESS_ACTIVE_DATE); + + $this->transactions = array_filter($transactions, function ($Transaction) use ($processDate) { + $createDate = $Transaction->getDate(); + $createDate = strtotime($createDate); + + if ($createDate > $processDate) { + return true; + } + + return false; + }); return $this->transactions; }