Skip to content

Instantly share code, notes, and snippets.

<div class="view" style="overflow:scroll;">
<div class="table-responsive" style="overflow-x: auto; max-width: 100%">
<?php
echo $this->Form->create($followUp, [
'id' => 'enableFollowUp',
'url' => [
'plugin' => false,
'prefix' => 'Admin',
'controller' => 'Bonds',
'action' => 'enableFollowUp',
->prependOption([
'title' => __('Rules'),
'url' => ['prefix' => 'Admin', 'plugin' => false, 'controller' => 'AppRules', 'action' => 'index'],
'icon' => 'fa fa-address-card fa-fw',
'class' => 'nav-item',
])
$this->addFilter('InstantBondTypes.rate_calculation_type', [
'className' => 'Custom',
'method' => fn(Query $query, $field, $value, $data, $options) => $query
->contain(['InstantBondTypes'])
->where($query->newExpr()->like($query->identifier('InstantBondTypes.rate_calculation_type'), $value . '%')),
]);
$this->hasOne('InstantBondTypes')
->setStrategy('select');
public function generateAnyPdf($id = null)
{
$this->set('quote', $this->Quotes->get($id));
$this->set('templates', $this->Quotes->Sureties->Templates->find()->orderAsc('name'));
$this->set('sendTargets', $this->Quotes->getSendTargets($id));
}
function index(){
$bondCategoryId = $this->request->getQuery('bond_category_id');
$bondTypesByCategoryId = $this->BondTypes->find()->where(['bond_category_id' => $bondCategoryId] );
return $bondTypesByCategoryId;
}
<?php
/**
* @var \App\View\AppView $this
*/
$this->extend('/Base/portletCollapsed');
$this->assign('portlet_title', $sectionHeader ?? __('Related Bonds'));
$this->start("portlet_body");
$columns = $this->Admin->getDatatableColumns($headers, false);
$niceAlias = 'Bonds';
$tableId = 'table-' . \Cake\Utility\Text::slug(mb_strtolower($niceAlias));
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;
$this->elements = [
'view' => [
'postfix' => [
'Bonds/associated_to_parent_bond_type',
'Admin/BondTypes/post_view',
'Audit/history_trail_and_note',
],
],
'edit' => [
'postfix' => [
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;