diff --git a/Controller/BackendController.php b/Controller/BackendController.php index 3b6efe8..f0d182b 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -14,9 +14,9 @@ declare(strict_types=1); namespace Modules\SupplierManagement\Controller; -use Modules\SupplierManagement\Models\SupplierMapper; -use Modules\Billing\Models\PurchaseBillMapper; use Modules\Billing\Models\BillTypeL11n; +use Modules\Billing\Models\PurchaseBillMapper; +use Modules\SupplierManagement\Models\SupplierMapper; use phpOMS\Asset\AssetType; use phpOMS\Contract\RenderableInterface; use phpOMS\Localization\Money; @@ -108,16 +108,16 @@ final class BackendController extends Controller // stats if ($this->app->moduleManager->isActive('Billing')) { - $ytd = PurchaseBillMapper::getPurchaseBySupplierId($supplier->getId(), new SmartDateTime('Y-01-01'), new SmartDateTime('now')); - $mtd = PurchaseBillMapper::getPurchaseBySupplierId($supplier->getId(), new SmartDateTime('Y-m-01'), new SmartDateTime('now')); - $lastOrder = PurchaseBillMapper::getLastOrderDateBySupplierId($supplier->getId()); - $newestInvoices = PurchaseBillMapper::withConditional('language', $response->getLanguage(), [BillTypeL11n::class])::getNewestSupplierInvoices($supplier->getId(), 5); + $ytd = PurchaseBillMapper::getPurchaseBySupplierId($supplier->getId(), new SmartDateTime('Y-01-01'), new SmartDateTime('now')); + $mtd = PurchaseBillMapper::getPurchaseBySupplierId($supplier->getId(), new SmartDateTime('Y-m-01'), new SmartDateTime('now')); + $lastOrder = PurchaseBillMapper::getLastOrderDateBySupplierId($supplier->getId()); + $newestInvoices = PurchaseBillMapper::withConditional('language', $response->getLanguage(), [BillTypeL11n::class])::getNewestSupplierInvoices($supplier->getId(), 5); $monthlyPurchaseCosts = PurchaseBillMapper::getSupplierMonthlyPurchaseCosts($supplier->getId(), (new SmartDateTime('now'))->createModify(-1), new SmartDateTime('now')); } else { - $ytd = new Money(); - $mtd = new Money(); - $lastOrder = null; - $newestInvoices = []; + $ytd = new Money(); + $mtd = new Money(); + $lastOrder = null; + $newestInvoices = []; $monthlyPurchaseCosts = []; } diff --git a/Theme/Backend/supplier-profile.tpl.php b/Theme/Backend/supplier-profile.tpl.php index 3499c54..3f41a63 100755 --- a/Theme/Backend/supplier-profile.tpl.php +++ b/Theme/Backend/supplier-profile.tpl.php @@ -12,7 +12,6 @@ */ declare(strict_types=1); -use Modules\Profile\Models\ContactType; use phpOMS\Uri\UriFactory; $countryCodes = \phpOMS\Localization\ISO3166TwoEnum::getConstants(); @@ -22,10 +21,10 @@ $countries = \phpOMS\Localization\ISO3166NameEnum::getConstants(); * @var \Modules\SupplierManagement\Models\Supplier $supplier */ $supplier = $this->getData('supplier'); -$notes = $supplier->getNotes(); -$files = $supplier->getFiles(); +$notes = $supplier->getNotes(); +$files = $supplier->getFiles(); -$newestInvoices = $this->getData('newestInvoices') ?? []; +$newestInvoices = $this->getData('newestInvoices') ?? []; $monthlyPurchaseCosts = $this->getData('monthlyPurchaseCosts') ?? []; /**