Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cesarockstar1985/73f762df9cf594cea905537ef8db2a89 to your computer and use it in GitHub Desktop.
Save cesarockstar1985/73f762df9cf594cea905537ef8db2a89 to your computer and use it in GitHub Desktop.
protected function setupAdmin()
{
$this->_searchParameters = [];
parent::setupAdmin();
$fields = [
'underwriter' => [
'url' => [
'controller' => 'Underwriters',
'action' => 'view'
],
'url_field_param' => 'underwriter_id',
'url_options' => ['escape' => false],
],
'bonds' => [],
'bonds_written' => [],
'closing_ratio' => [
'formatter' => 'Reports.closingRatio',
],
'quoted' => [
'formatter' => 'Reports.currency',
],
'surety_gross' => [
'formatter' => 'Reports.currency',
],
'surety_net' => [
'formatter' => 'Reports.currency',
],
'claims_amount' => [
'formatter' => 'Reports.currency',
],
'commission' => [
'formatter' => 'Reports.currency',
],
'loss_ratio' => [
'formatter' => 'Reports.lossRatio',
],
'wwis_net' => [
'formatter' => 'Reports.wwisNet',
],
];
$headers = [
'underwriter' => __('Underwriter'),
'bonds' => __('Bonds'),
'bonds_written' => __('Bonds Written'),
'closing_ratio' => __('Closing Ratio'),
'quoted' => __('Quoted'),
'net' => __('Net'),
'surety_gross' => __('Surety Gross'),
'surety_net' => __('Surety Net'),
'claims_amount' => __('Claims'),
'commission' => __('Commission'),
'loss_ratio' => __('Loss Ratio'),
'wwis_net' => __('WWIS Net'),
];
$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->Admin->setConfig('fields', $fields);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment