From 5121bd32762a49cc6ca323d53ccadceea6b4a5e8 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sat, 20 Feb 2021 21:19:43 +0100 Subject: [PATCH] improve billing --- Controller/BackendController.php | 12 ++++++------ Theme/Backend/client-profile.tpl.php | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Controller/BackendController.php b/Controller/BackendController.php index d73c613..19afb97 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -14,7 +14,7 @@ declare(strict_types=1); namespace Modules\ClientManagement\Controller; -use Modules\Billing\Models\BillMapper; +use Modules\Billing\Models\SalesBillMapper; use Modules\Billing\Models\BillTypeL11n; use Modules\ClientManagement\Models\ClientMapper; use phpOMS\Asset\AssetType; @@ -108,11 +108,11 @@ final class BackendController extends Controller // stats if ($this->app->moduleManager->isActive('Billing')) { - $ytd = BillMapper::getSalesByClientId($client->getId(), new SmartDateTime('Y-01-01'), new SmartDateTime('now')); - $mtd = BillMapper::getSalesByClientId($client->getId(), new SmartDateTime('Y-m-01'), new SmartDateTime('now')); - $lastOrder = BillMapper::getLastOrderDateByClientId($client->getId()); - $newestInvoices = BillMapper::withConditional('language', $response->getLanguage(), [BillTypeL11n::class])::getNewestClientInvoices($client->getId(), 5); - $monthlySalesCosts = BillMapper::getClientMonthlySalesCosts($client->getId(), (new SmartDateTime('now'))->createModify(-1), new SmartDateTime('now')); + $ytd = SalesBillMapper::getSalesByClientId($client->getId(), new SmartDateTime('Y-01-01'), new SmartDateTime('now')); + $mtd = SalesBillMapper::getSalesByClientId($client->getId(), new SmartDateTime('Y-m-01'), new SmartDateTime('now')); + $lastOrder = SalesBillMapper::getLastOrderDateByClientId($client->getId()); + $newestInvoices = SalesBillMapper::withConditional('language', $response->getLanguage(), [BillTypeL11n::class])::getNewestClientInvoices($client->getId(), 5); + $monthlySalesCosts = SalesBillMapper::getClientMonthlySalesCosts($client->getId(), (new SmartDateTime('now'))->createModify(-1), new SmartDateTime('now')); } else { $ytd = new Money(); $mtd = new Money(); diff --git a/Theme/Backend/client-profile.tpl.php b/Theme/Backend/client-profile.tpl.php index 22dab10..34eeb04 100755 --- a/Theme/Backend/client-profile.tpl.php +++ b/Theme/Backend/client-profile.tpl.php @@ -208,7 +208,7 @@ echo $this->getData('nav')->render(); getHtml('Date'); ?> getId()); + $url = UriFactory::build('{/prefix}sales/bill?{?}&id=' . $invoice->getId()); ?> getNumber(); ?>