View gist:b9d98b7e5eb85b41df2d6ae67a74a051
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'); |
View gist:1b1348e0f822169a08dd0361dc71dba9
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; |
View gist:73f762df9cf594cea905537ef8db2a89
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' |
View gist:42795841b68a0ecaaa6311c81478e8dd
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); |
View gist:fd0ca9dca57ef01a08a02083e00cce39
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', |
View ld_json.php
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 = [ |
View gist:46ae88aad66bb08f4b40448c7da03294
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/", |
View gist:4d40964aad64a84c97e9d78ce0dca485
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; |
View gist:fd56d519cb355b24a2b8d3143fb9abb3
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' => [ |
View QuotesController.php
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