From d6fe66b062f2e1190f2507cb6213c8dddd54e612 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Mon, 12 Jul 2021 21:45:06 +0800 Subject: [PATCH] change quotation segment select by best conversion rate instead of worst conversion rate --- .../Companies/Services/FetchesCompanyServiceSettings.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Classes/Modules/Companies/Services/FetchesCompanyServiceSettings.php b/app/Classes/Modules/Companies/Services/FetchesCompanyServiceSettings.php index a3827892..71fe8ac4 100644 --- a/app/Classes/Modules/Companies/Services/FetchesCompanyServiceSettings.php +++ b/app/Classes/Modules/Companies/Services/FetchesCompanyServiceSettings.php @@ -41,7 +41,7 @@ class FetchesCompanyServiceSettings $currency->max_limit->value, $currency->min_limit->value, $rate->selling); if($this->hasCustomOptions($constants)){ - $customOptions = $this->getServiceCustomOptions($constants, $object, $standardConfigurations, $object->getPaymentMethod())->sortByDesc(function($option) use($object) { + $customOptions = $this->getServiceCustomOptions($constants, $object, $standardConfigurations)->sortBy(function($option) use($object) { return (new CalculationObject($object, $option))->getTotal(); })->first();