mirror of
https://github.com/Karaka-Management/oms-SupplierManagement.git
synced 2026-01-11 01:18:40 +00:00
code fixes
This commit is contained in:
parent
e6006238b4
commit
bd64e5cb31
|
|
@ -310,6 +310,7 @@
|
|||
{ "value": "FI" },
|
||||
{ "value": "FR" },
|
||||
{ "value": "DE" },
|
||||
{ "value": "DE_0" },
|
||||
{ "value": "GR" },
|
||||
{ "value": "HU" },
|
||||
{ "value": "IE" },
|
||||
|
|
|
|||
|
|
@ -61,8 +61,9 @@ final class Installer extends InstallerAbstract
|
|||
$attrValues = self::createSupplierAttributeValues($app, $attrTypes, $attributes);
|
||||
|
||||
$data = include __DIR__ . '/Install/Admin.install.php';
|
||||
$content = \json_decode($data[0]['content'], true);
|
||||
|
||||
/** @var array $content */
|
||||
$content = \json_decode($data[0]['content'], true);
|
||||
foreach ($content as $type => $_) {
|
||||
$content[$type] = \reset($attrValues[$type])['id'];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -118,16 +118,31 @@ final class ApiController extends Controller
|
|||
return $supplier;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create supplier segmentation.
|
||||
*
|
||||
* Default: segment->section->sales_group and to the side supplier_type
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
* @param ResponseAbstract $response Response
|
||||
* @param Supplier $supplier Supplier
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private function createSupplierSegmentation(RequestAbstract $request, ResponseAbstract $response, Supplier $supplier) : void
|
||||
{
|
||||
/** @var \Model\Setting $settings */
|
||||
$settings = $this->app->appSettings->get(null, SettingsEnum::DEFAULT_SEGMENTATION);
|
||||
|
||||
/** @var array $segmentation */
|
||||
$segmentation = \json_decode($settings->content, true);
|
||||
if ($segmentation === false || $segmentation === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
/** @var \Modules\Attribute\Models\AttributeType[] $types */
|
||||
$types = SupplierAttributeTypeMapper::getAll()
|
||||
->where('name', \array_keys($segmentation), 'IN')
|
||||
->execute();
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ final class SearchController extends Controller
|
|||
'link' => '{/base}/purchase/supplier/view?id=' . $account->id,
|
||||
'email' => $account->account->getContactByType(ContactType::EMAIL)->content,
|
||||
'phone' => $account->account->getContactByType(ContactType::PHONE)->content,
|
||||
'city' => $account->mainAddress?->city,
|
||||
'city' => $account->mainAddress->city,
|
||||
'image' => $image->id === 0
|
||||
? 'Web/Backend/img/logo_grey.png'
|
||||
: $image->getPath(),
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user