This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$bestMatchingSureties = $this->Quotes->Bonds->getBestMatchingSureties($quote->bond_id); | |
$rulesAutoapprove = []; | |
$bestMatchingSuretiesArray = $bestMatchingSureties->toArray(); | |
$requestData = $this->request->getData(); | |
foreach ($bestMatchingSureties->toArray()['all_sureties'] as $bestMatchingSurety) { | |
$this->Quotes->getConnection()->transactional(function () use ($bestMatchingSureties, $bestMatchingSurety, $quote, $requestData) { | |
$quote = $this->Quotes->selectSurety($requestData, $quote, $bestMatchingSurety); | |
$autoApprove = $this->Bonds->getMatchingSuretiesById($quote->bond_id, false, 'AutoApprove'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function selectSurety($requestData, Quote $quote, BestMatchingSuretyResult $bestMatchingSurety): Quote | |
{ | |
$data = [ | |
'surety_id' => $requestData['surety_id'] ?? null, | |
'surety_rate' => $requestData['surety_rate'] ?? null, | |
'agent_id' => $requestData['agent_id'] ?? null, | |
'amount' => $requestData['amount'] ?? $quote->bond->bond_amount, | |
]; | |
$quote = $this->patchEntity($quote, $data); | |
$suggested = $bestMatchingSurety->found; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected function setupAdmin() | |
{ | |
$this->_searchParameters = []; | |
parent::setupAdmin(); | |
$fields = [ | |
'underwriter' => [ | |
'url' => [ | |
'controller' => 'Underwriters', | |
'action' => 'view' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$responsiveFields = [ | |
'underwriter', | |
'bonds', | |
'bonds_written', | |
'closing_ratio', | |
]; | |
$this->Admin->setConfig('pageSubtitle', ['index' => __('Get Claim and Bond totals, grouped by Underwriters')]); | |
$this->Admin->setConfig('pageIcon', ['index' => 'building-o']); | |
$this->Admin->setConfig('headers', $headers); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$responsiveFields = [ | |
'agency' => '', | |
'bonds' => '', | |
'bonds_written' => 'd-none d-sm-table-cell', | |
'closing_ratio' => 'd-none d-sm-table-cell', | |
'quoted' => 'd-none d-sm-table-cell', | |
'net' => 'd-none d-md-table-cell', | |
'surety_gross' => 'd-none d-md-table-cell', | |
'surety_net' => 'd-none d-md-table-cell', | |
'claims_amount' => 'd-none d-lg-table-cell', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @var \App\View\AppView $this | |
*/ | |
if (isset($cmsPage) && !empty($cmsPage->jsonld)) { | |
$ldJson = json_decode($cmsPage->jsonld, true); | |
} elseif (!empty($bondType)) { | |
$ldJson = [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @var \App\View\AppView $this | |
*/ | |
if (isset($cmsPage) && !empty($cmsPage->jsonld)) { | |
$ldJson = json_decode($cmsPage->jsonld, true); | |
} elseif (!empty($bondType)) { | |
$ldJson = [ | |
"@context" => "https://schema.org/", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foreach ($bestMatchingSureties->toArray() as $bestMatchingSurety) { | |
$this->Quotes->getConnection()->transactional(function () use ($bestMatchingSureties, $quote, $requestDataSurety, $bestMatchingSurety) { | |
$quote = $this->Quotes->selectSurety($requestDataSurety, $quote, $bestMatchingSureties); | |
$autoApprove = $this->Quotes->Bonds->getMatchingSuretiesById($quote->bond_id, false, 'AutoApprove'); | |
$dataAutoApprove = (int)Hash::get(array_values($autoApprove), '0.data.auto_approve'); | |
if ($dataAutoApprove) { | |
$bestMatchingSurety->autoapprove = true; | |
} | |
return false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$this->elements = [ | |
'view' => [ | |
'postfix' => [ | |
'Bonds/associated_to_parent_bond_type', | |
'Admin/BondTypes/post_view', | |
'Audit/history_trail_and_note', | |
], | |
], | |
'edit' => [ | |
'postfix' => [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foreach ($bestMatchingSureties->all_sureties as $bestMatchingSurety) { | |
$this->Quotes->getConnection()->transactional(function () use ($bestMatchingSureties, $quote, $requestDataSurety, $bestMatchingSurety) { | |
$quote = $this->Quotes->selectSurety($requestDataSurety, $quote, $bestMatchingSureties); | |
$autoApprove = $this->Quotes->Bonds->getMatchingSuretiesById($quote->bond_id, false, 'AutoApprove'); | |
$dataAutoApprove = (int)Hash::get(array_values($autoApprove), '0.data.auto_approve'); | |
$bestMatchingSurety->autoapprove = false; | |
if ($dataAutoApprove) { | |
$bestMatchingSurety->autoapprove = true; | |
} | |
return false; |
OlderNewer