From c9ab0a8fb4c1d65f91b70e4c4edb305e87f6a5cb Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Thu, 11 Mar 2021 21:23:41 +0100 Subject: [PATCH] draft ::with() function for models --- Controller/BackendController.php | 2 +- Theme/Backend/client-profile.tpl.php | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Controller/BackendController.php b/Controller/BackendController.php index fb72b04..94b748e 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -111,7 +111,7 @@ final class BackendController extends Controller $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); + $newestInvoices = SalesBillMapper::with('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(); diff --git a/Theme/Backend/client-profile.tpl.php b/Theme/Backend/client-profile.tpl.php index 6d99525..9fac0f0 100755 --- a/Theme/Backend/client-profile.tpl.php +++ b/Theme/Backend/client-profile.tpl.php @@ -233,6 +233,7 @@ echo $this->getData('nav')->render(); getHtml('Number'); ?> + getHtml('Type'); ?> getHtml('Name'); ?> getHtml('Net'); ?> getHtml('Date'); ?> @@ -242,6 +243,7 @@ echo $this->getData('nav')->render(); ?> getNumber(); ?> + type->getL11n(); ?> billTo; ?> net->getCurrency(); ?> createdAt->format('Y-m-d'); ?>