Exemplo n.º 1
0
 /**
  * Member function to set banked value
  * @param Double  
  * return void
  */
 public function createTermImage($policynumber)
 {
     /**
      * prepair data to build TermImage
      */
     $this->_policynumber = $policynumber;
     $this->_amount = 0;
     $this->_months = 12;
     $policyDisb = new Datasource_Insurance_LegacyPolicies();
     $policy = $policyDisb->getByPolicyNumber($policynumber);
     $this->_policyname = $policy->policyName;
     $termDisb = new Datasource_Insurance_Policy_Term();
     $term = $termDisb->getPolicyTerm($policynumber, $policy->startDate);
     $this->_startdate = $policy->startDate;
     $policy->termid = $term['id'];
     $this->_getMult($policy);
     $policyOptionsArray = explode("|", $policy->policyOptions);
     $pItemHist = new Datasource_Insurance_Policy_PolicyTermItemHist();
     foreach ($policyOptionsArray as $key => $value) {
         $this->_initialise();
         $option = new Datasource_Insurance_Policy_Options($policy->policyType);
         $this->_optionID = $option->fetchOptionsByName($value);
         $this->_sumInsOption = $policyDisb->getPolicyOptionMatch($policy->policyOptions, $value, $policy->amountsCovered);
         $cover->sumInsured = $this->_sumInsOption;
         if ($this->_sumInsOption > 0) {
             $cover = new Model_Insurance_Cover();
             $cover->policyOptionID = $this->_optionID;
             $cover->sumInsured = $this->_sumInsOption;
             $this->_premOption = $policyDisb->getPolicyOptionMatch($policy->policyOptions, $value, $policy->optionPremiums) * $this->_mult;
             $this->_discOption = $policyDisb->getPolicyOptionMatch($policy->policyOptions, $value, $policy->optionDiscounts);
             $this->_calculateTax();
             $this->_calculateNet($policy, $value);
             $cover->grosspremium = $this->_premOption + $this->_iptOption;
             $cover->premium = $this->_premOption;
             $cover->netpremium = $this->_netOption;
             $cover->ipt = $this->_iptOption;
             $pItemHist->setItemHist($policy, $cover);
         }
     }
 }
Exemplo n.º 2
0
 /**
  * Save the quote into the legacy database tables
  *
  * @munt 10
  */
 protected function _saveToLegacy()
 {
     // Insert/Update the legacy customer table
     // Check to see if we already have a legacy identifier
     if (is_null($this->_quoteModel->legacyID) || $this->_quoteModel->legacyID == '') {
         // This is the first save to legacy so we need to generate a new unique ID
         // I say unique.. but ermm.. well you'll see *sigh*
         $numberTracker = new Datasource_Core_NumberTracker();
         $this->_quoteModel->legacyID = 'QHLI' . (string) $numberTracker->getNextPolicyNumber() . '/01';
         $this->_quoteDataSource->save($this->_quoteModel);
         // Do a quick save now we have a legacy quote number
     }
     $this->_quoteModel->policyNumber = $this->_quoteModel->legacyID;
     $this->_quoteModel->policyLength = 12;
     // Insert/Update the legacy quote table
     $legacyQuote = new Model_Insurance_LegacyQuote();
     $legacyQuote->policyNumber = $this->getLegacyID();
     // Quote number
     $legacyQuote->refNo = $this->getLegacyCustomerReference();
     // Customer reference number
     $legacyQuote->agentSchemeNumber = $this->getAgentSchemeNumber();
     // Todo: This should be the agent scheme number for the selected agent!
     $legacyQuote->policyName = 'landlordsp';
     // Landlords+ quote/policy
     $legacyQuote->issueDate = date('Y-m-d');
     // Issued date - today
     $legacyQuote->startDate = $this->getStartDate();
     $legacyQuote->endDate = $this->getEndDate();
     $legacyQuote->policyType = 'L';
     $legacyQuote->policyLength = 12;
     $legacyQuote->payStatus = $this->_quoteModel->status;
     if ($this->getPayFrequency() == "ANNUALLY") {
         $legacyQuote->payBy = "Annually";
     }
     $idd = new Datasource_Insurance_IddSupport();
     if (!$idd->isIddSupport($legacyQuote->policyNumber)) {
         $inserArray = array();
         $insertArray['policynumber'] = $legacyQuote->policyNumber;
         $insertArray['agentschemeno'] = $legacyQuote->agentSchemeNumber;
         $insertArray['csuid'] = 0;
         $fsaAgentStatusDatasource = new Datasource_Fsa_AgentStatus();
         $fsaStatus = $fsaAgentStatusDatasource->getAgentFsaStatus($legacyQuote->agentSchemeNumber);
         if (isset($fsaStatus['status_abbr'])) {
             $insertArray['FSA_status'] = $fsaStatus['status_abbr'];
         } else {
             $insertArray['FSA_status'] = "";
         }
         $insertArray['origsaleid'] = 9;
         $insertArray['callerid'] = 2;
         $idd->setIddSupport($insertArray);
     }
     $properties = $this->getProperties();
     $legacyQuote->propertyAddress1 = $properties[0]['line_1'];
     $legacyQuote->propertyAddress2 = $properties[0]['line_2'];
     $legacyQuote->propertyAddress3 = $properties[0]['town'];
     $legacyQuote->propertyPostcode = $properties[0]['postcode'];
     // Build the policy options pipe delimitted nonsense!!! FML
     $premiums = $this->calculatePremiums();
     if ($premiums != '') {
         // Depending on if this is an annual or monthly quote we have to save different values in the database :(
         if ($this->getPayFrequency() == "ANNUALLY") {
             $legacyQuote->premium = $premiums['totalGrossAnnualPremium'];
             $legacyQuote->quote = $premiums['totalGrossAnnualPremium'] + $premiums['totalGrossAnnualIPT'];
             $legacyQuote->ipt = $premiums['totalGrossAnnualIPT'];
         } else {
             $legacyQuote->premium = $premiums['totalGrossMonthlyPremium'];
             $legacyQuote->quote = $premiums['totalGrossMonthlyPremium'] + $premiums['totalGrossMonthlyIPT'];
             $legacyQuote->ipt = $premiums['totalGrossMonthlyIPT'];
         }
         $this->_quoteModel->premium = $premiums['totalGrossMonthlyPremium'];
         $this->_quoteModel->ipt = $premiums['totalGrossAnnualIPT'];
         $legacyQuote->riskArea = $premiums['riskAreas']['buildingsAreaID'];
         $legacyQuote->termid = $this->setPolicyTerm();
     }
     $mult = 1;
     if ($this->getPayFrequency() == 'MONTHLY') {
         $mult = 12;
     }
     $policyOptions = '';
     $amountsCovered = '';
     $optionPremiums = '';
     $pItemHist = new Datasource_Insurance_Policy_PolicyTermItemHist();
     $cover = new Model_Insurance_Cover();
     // Get IPT percentage
     $propertiesDatasource = new Datasource_Insurance_Quote_Properties();
     $properties = $propertiesDatasource->getByQuoteID($this->_quoteModel->ID);
     $postcode = $properties[0]['postcode'];
     $taxDatasource = new Datasource_Core_Tax();
     $tax = $taxDatasource->getTaxbyTypeAndPostcode('ipt', $postcode);
     $ipt = 1 + $tax['rate'] / 100;
     if ($premiums != '') {
         if ($this->hasProduct(self::BUILDING_COVER) && $this->isValidValue($premiums['netBuilding'])) {
             $policyOptions .= 'buildingsp|';
             $amountsCovered .= $premiums['rebuildValue'] > 0 ? $premiums['rebuildValue'] : $premiums['calculatedDSIValue'];
             $amountsCovered .= '|';
             $optionPremiums .= round($premiums['annualBuilding'] / $mult, 2) . '|';
             $cover->policyOptionID = 33;
             $cover->sumInsured = $premiums['rebuildValue'] > 0 ? $premiums['rebuildValue'] : $premiums['calculatedDSIValue'];
             $cover->grosspremium = round($premiums['annualBuilding'] * $ipt, 2);
             $cover->premium = $premiums['annualBuilding'];
             $cover->netpremium = $premiums['netBuilding'];
             $cover->ipt = $cover->grosspremium - $cover->premium;
             $pItemHist->setItemHist($legacyQuote, $cover);
             if ($this->isValidValue($premiums['netBuildingAD'])) {
                 $policyOptions .= 'buildingsAccidentalDamagep|';
                 $amountsCovered .= $premiums['rebuildValue'] > 0 ? $premiums['rebuildValue'] : $premiums['calculatedDSIValue'];
                 $amountsCovered .= '|';
                 $optionPremiums .= round($premiums['annualBuildingAD'] / $mult, 2) . '|';
                 $cover->policyOptionID = 37;
                 $cover->grosspremium = round($premiums['annualBuildingAD'] * $ipt, 2);
                 $cover->premium = $premiums['annualBuildingAD'];
                 $cover->netpremium = $premiums['netBuildingAD'];
                 $cover->ipt = $cover->grosspremium - $cover->premium;
                 $pItemHist->setItemHist($legacyQuote, $cover);
             }
             if ($this->isValidValue($premiums['netBFlood'])) {
                 $policyOptions .= 'buildingslflood|';
                 $amountsCovered .= $premiums['rebuildValue'] > 0 ? $premiums['rebuildValue'] : $premiums['calculatedDSIValue'];
                 $amountsCovered .= '|';
                 $optionPremiums .= round($premiums['annualBFlood'] / $mult, 2) . '|';
                 $cover->policyOptionID = 31;
                 $cover->grosspremium = round($premiums['annualBFlood'] * $ipt, 2);
                 $cover->premium = $premiums['annualBFlood'];
                 $cover->netpremium = $premiums['netBFlood'];
                 $cover->ipt = $cover->grosspremium - $cover->premium;
                 $pItemHist->setItemHist($legacyQuote, $cover);
             }
         }
         if ($this->hasProduct(self::UNFURNISHED_CONTENTS_COVER) && $this->isValidValue($premiums['netLContent'])) {
             $policyOptions .= 'limitedcontentsp|';
             $amountsCovered .= '5000|';
             $optionPremiums .= round($premiums['annualLContent'] / $mult, 2) . '|';
             $cover->policyOptionID = 39;
             $cover->sumInsured = 5000;
             $cover->grosspremium = round($premiums['annualLContent'] * $ipt, 2);
             $cover->premium = $premiums['annualLContent'];
             $cover->netpremium = $premiums['netLContent'];
             $cover->ipt = $cover->grosspremium - $cover->premium;
             $pItemHist->setItemHist($legacyQuote, $cover);
         }
         if ($this->hasProduct(self::CONTENTS_COVER) && $this->isValidValue($premiums['netContent'])) {
             $policyOptions .= 'contentslp|';
             $meta = $this->getProductMeta(self::CONTENTS_COVER);
             $amountsCovered .= $meta['cover_amount'] . '|';
             $optionPremiums .= round($premiums['annualContent'] / $mult, 2) . '|';
             $cover->sumInsured = $meta['cover_amount'];
             $cover->policyOptionID = 34;
             $cover->grosspremium = round($premiums['annualContent'] * $ipt, 2);
             $cover->premium = $premiums['annualContent'];
             $cover->netpremium = $premiums['netContent'];
             $cover->ipt = $cover->grosspremium - $cover->premium;
             $pItemHist->setItemHist($legacyQuote, $cover);
             if ($this->isValidValue($premiums['netContentsAD'])) {
                 $policyOptions .= 'contentslAccidentalDamagep|';
                 $amountsCovered .= $meta['cover_amount'] . '|';
                 $optionPremiums .= round($premiums['annualContentsAD'] / $mult, 2) . '|';
                 $cover->policyOptionID = 38;
                 $cover->grosspremium = round($premiums['annualContentsAD'] * $ipt, 2);
                 $cover->premium = $premiums['annualContentsAD'];
                 $cover->netpremium = $premiums['netContentsAD'];
                 $cover->ipt = $cover->grosspremium - $cover->premium;
                 $pItemHist->setItemHist($legacyQuote, $cover);
             }
             if ($this->isValidValue($premiums['netBFlood'])) {
                 $policyOptions .= 'contentslflood|';
                 $amountsCovered .= $meta['cover_amount'] . '|';
                 $optionPremiums .= round($premiums['annualCFlood'] / $mult, 2) . '|';
                 $cover->policyOptionID = 32;
                 $cover->grosspremium = round($premiums['annualCFlood'] * $ipt, 2);
                 $cover->premium = $premiums['annualCFlood'];
                 $cover->netpremium = $premiums['netCFlood'];
                 $cover->ipt = $cover->grosspremium - $cover->premium;
                 $pItemHist->setItemHist($legacyQuote, $cover);
             }
         }
         // ** RENT GUARANTEE ** //
         if ($this->hasProduct(self::RENT_GUARANTEE) && $this->isValidValue($premiums['netAnnualRentGuarantee'])) {
             $policyOptions .= 'rentguaranteep|';
             $meta = $this->getProductMeta(self::RENT_GUARANTEE);
             $amountsCovered .= $meta['monthly_rent'] . '|';
             $optionPremiums .= round($premiums['grossAnnualRentGuarantee'] / $mult, 2) . '|';
             $cover->policyOptionID = 36;
             $cover->sumInsured = $meta['monthly_rent'];
             $cover->grosspremium = round($premiums['grossAnnualRentGuarantee'] * $ipt, 2);
             $cover->premium = $premiums['grossAnnualRentGuarantee'];
             $cover->netpremium = $premiums['netAnnualRentGuarantee'];
             $cover->ipt = $cover->grosspremium - $cover->premium;
             $pItemHist->setItemHist($legacyQuote, $cover);
         }
         // ** LEGAL EXPENSES ** //
         if ($this->hasProduct(self::LEGAL_EXPENSES) && $this->isValidValue($premiums['netAnnualLegalExpensesCover'])) {
             $policyOptions .= 'legalexpensesp|';
             $amountsCovered .= '50000|';
             $optionPremiums .= round($premiums['grossAnnualLegalExpensesCover'] / $mult, 2) . '|';
             $cover->policyOptionID = 35;
             $cover->sumInsured = 50000;
             $cover->grosspremium = round($premiums['grossAnnualLegalExpensesCover'] * $ipt, 2);
             $cover->premium = $premiums['grossAnnualLegalExpensesCover'];
             $cover->netpremium = $premiums['netAnnualLegalExpensesCover'];
             $cover->ipt = $cover->grosspremium - $cover->premium;
             $pItemHist->setItemHist($legacyQuote, $cover);
         }
         // ** EMERGENCY ASSISTANCE ** //
         if ($this->hasProduct(self::EMERGENCY_ASSISTANCE)) {
             if ($this->isValidValue($premiums['netEA'])) {
                 $policyOptions .= 'emergencyassistance|';
                 $amountsCovered .= '1500|';
                 $optionPremiums .= round($premiums['annualEA'] / $mult, 2) . '|';
                 $cover->policyOptionID = 4;
                 $cover->sumInsured = 1500;
                 $cover->grosspremium = round($premiums['annualEA'] * $ipt, 2);
                 $cover->premium = $premiums['annualEA'];
                 $cover->netpremium = $premiums['netEA'];
                 $cover->ipt = $cover->grosspremium - $cover->premium;
                 $pItemHist->setItemHist($legacyQuote, $cover);
             }
             if ($this->isValidValue($premiums['netEAB'])) {
                 $policyOptions .= 'emergencyassistancebahbuildings|';
                 $amountsCovered .= '0|';
                 $optionPremiums .= round($premiums['annualEAB'] / $mult, 2) . '|';
                 $cover->policyOptionID = 28;
                 $cover->sumInsured = 0;
                 $cover->grosspremium = round($premiums['annualEAB'] * $ipt, 2);
                 $cover->premium = $premiums['annualEAB'];
                 $cover->netpremium = $premiums['netEAB'];
                 $cover->ipt = $cover->grosspremium - $cover->premium;
                 $pItemHist->setItemHist($legacyQuote, $cover);
             }
             if ($this->isValidValue($premiums['netEAS'])) {
                 $policyOptions .= 'emergencyassistancestandalone|';
                 $amountsCovered .= '1500|';
                 $optionPremiums .= round($premiums['annualEAS'] / $mult, 2) . '|0|';
                 $cover->policyOptionID = 30;
                 $cover->sumInsured = 1500;
                 $cover->grosspremium = round($premiums['annualEAS'] * $ipt, 2);
                 $cover->premium = $premiums['annualEAS'];
                 $cover->netpremium = $premiums['netEAS'];
                 $cover->ipt = $cover->grosspremium - $cover->premium;
                 $pItemHist->setItemHist($legacyQuote, $cover);
             }
             if ($this->isValidValue($premiums['netEABS'])) {
                 $policyOptions .= 'emergencyassistancebahstandalone|';
                 $amountsCovered .= '0|';
                 $optionPremiums .= round($premiums['annualEABS'] / $mult, 2) . '|';
                 $cover->policyOptionID = 29;
                 $cover->sumInsured = 0;
                 $cover->grosspremium = round($premiums['annualEABS'] * $ipt, 2);
                 $cover->premium = $premiums['annualEABS'];
                 $cover->netpremium = $premiums['netEABS'];
                 $cover->ipt = $cover->grosspremium - $cover->premium;
                 $pItemHist->setItemHist($legacyQuote, $cover);
             }
         }
         // We also have to populate the POLICYVARIABLE table for MTA/Renewals *arrghghh*
         // NOTE: This code is seriously ugly due to time restraints. Intention is to re-write it
         //       when we re-write the admin suites so we don't have to maintain horrible legacy systems!
         /* POLICY VARIABLES */
         $policyVariables = array();
         $policyNumber = $this->getPolicyNumber();
         // Policy Risk Area - 1
         $policyVariables[] = array('policyVariableDefID' => 1, 'policyNumber' => $policyNumber, 'timestamp' => date('Y-m-d h:i:s'), 'value' => $premiums['riskAreas']['buildingsAreaID']);
         // No claims discount - 3
         // Possible options 0=0, 1=1, 2=2, 3=3, 4=3+
         $properties = $this->getProperties();
         $ncbID = $properties[0]['no_claims_years_id'];
         $policyVariables[] = array('policyVariableDefID' => 3, 'policyNumber' => $policyNumber, 'timestamp' => date('Y-m-d h:i:s'), 'value' => $ncbID - 1);
         // Managed property - 4
         // Possible options 0=No, 1=Yes
         $policyVariables[] = array('policyVariableDefID' => 4, 'policyNumber' => $policyNumber, 'timestamp' => date('Y-m-d h:i:s'), 'value' => $properties[0]['letting_agent_managed']);
         if ($this->hasProduct(self::BUILDING_COVER)) {
             // Year of Construction - 2
             $policyVariables[] = array('policyVariableDefID' => 2, 'policyNumber' => $policyNumber, 'timestamp' => date('Y-m-d h:i:s'), 'value' => $premiums['dsiData']['yearBuiltID']);
             // Buildings excess - 5
             // Possible options 0=0, 1=100, 2=250, 3=500, 4=1000
             $buildingExcessID = 0;
             $buildingMeta = $this->getProductMeta(self::BUILDING_COVER);
             $buildingExcess = $buildingMeta['excess'];
             switch ($buildingExcess) {
                 case '0':
                     $buildingExcessID = 0;
                     break;
                 case '100':
                     $buildingExcessID = 1;
                     break;
                 case '250':
                     $buildingExcessID = 2;
                     break;
                 case '500':
                     $buildingExcessID = 3;
                     break;
                 case '1000':
                     $buildingExcessID = 4;
                     break;
             }
             $policyVariables[] = array('policyVariableDefID' => 5, 'policyNumber' => $policyNumber, 'timestamp' => date('Y-m-d h:i:s'), 'value' => $buildingExcessID);
         }
         // Tenant type - 6
         // Possible options
         // 		0=Employed
         //		1=Self Employed
         //		2=Student
         //		3=Retired
         //		4=Unemployed
         //		5=Housing Authority
         //		6=Unknown
         //		7=Claiming Benefit
         $tenantTypeID = 7;
         // NOTE : This is the worst code I've EVER written Argghhh
         switch ($properties[0]['tenant_type_id']) {
             case 1:
                 $tenantTypeID = 0;
                 break;
             case 2:
                 $tenantTypeID = 1;
                 break;
             case 3:
                 $tenantTypeID = 2;
                 break;
             case 4:
                 $tenantTypeID = 3;
                 break;
             case 5:
                 $tenantTypeID = 4;
                 break;
             case 6:
                 $tenantTypeID = 7;
                 break;
             case 7:
                 $tenantTypeID = 5;
                 break;
             case 8:
                 $tenantTypeID = 6;
                 break;
         }
         $policyVariables[] = array('policyVariableDefID' => 6, 'policyNumber' => $policyNumber, 'timestamp' => date('Y-m-d h:i:s'), 'value' => $tenantTypeID);
         // Contents area - 7
         $policyVariables[] = array('policyVariableDefID' => 7, 'policyNumber' => $policyNumber, 'timestamp' => date('Y-m-d h:i:s'), 'value' => $premiums['riskAreas']['contentsAreaID']);
         // Contents excess - 8
         // Possible options 0=0, 1=100, 2=250, 3=500, 4=1000
         if ($this->hasProduct(self::CONTENTS_COVER)) {
             $contentsMeta = $this->getProductMeta(self::CONTENTS_COVER);
             switch ($contentsMeta['excess']) {
                 case '0':
                     $buildingExcessID = 0;
                     break;
                 case '100':
                     $buildingExcessID = 1;
                     break;
                 case '250':
                     $buildingExcessID = 2;
                     break;
                 case '500':
                     $buildingExcessID = 3;
                     break;
                 case '1000':
                     $buildingExcessID = 4;
                     break;
             }
             $policyVariables[] = array('policyVariableDefID' => 8, 'policyNumber' => $policyNumber, 'timestamp' => date('Y-m-d h:i:s'), 'value' => $buildingExcessID);
         }
         // Building flood risk - 9
         // Possible options 0=No, 1=Yes
         $policyVariables[] = array('policyVariableDefID' => 9, 'policyNumber' => $policyNumber, 'timestamp' => date('Y-m-d h:i:s'), 'value' => $premiums['riskAreas']['floodArea'] == 0 ? 0 : 1);
         // Contents flood risk - 10
         // Possible options 0=No, 1=Yes
         $policyVariables[] = array('policyVariableDefID' => 10, 'policyNumber' => $policyNumber, 'timestamp' => date('Y-m-d h:i:s'), 'value' => $premiums['riskAreas']['floodArea'] == 0 ? 0 : 1);
         // Buildings cover over 500,000 - 11
         // Possible options 0=No, 1=Yes
         $buildingValue = $premiums['rebuildValue'] > 0 ? $premiums['rebuildValue'] : $premiums['calculatedDSIValue'];
         $policyVariables[] = array('policyVariableDefID' => 11, 'policyNumber' => $policyNumber, 'timestamp' => date('Y-m-d h:i:s'), 'value' => $buildingValue <= 500000 ? 0 : 1);
         // Years owned property - 12
         // Possible options
         //		0 = 0
         //		1 = 1
         //		2 = 2
         //		3 = 3
         // 		4 = 3+
         $yearsOwnedID = $properties[0]['ownership_length_id'];
         $policyVariables[] = array('policyVariableDefID' => 12, 'policyNumber' => $policyNumber, 'timestamp' => date('Y-m-d h:i:s'), 'value' => $yearsOwnedID - 1);
         /********************/
         // Save the policy variables
         $legacyPolicyVariables = new Datasource_Insurance_LandlordsPlus_Legacy_PolicyVariables();
         $legacyPolicyVariables->save($policyVariables);
     }
     $legacyQuote->policyOptions = trim($policyOptions, '|');
     $legacyQuote->amountsCovered = trim($amountsCovered, '|');
     $legacyQuote->optionPremiums = trim($optionPremiums, '|');
     $policyCover = new Datasource_Insurance_Policy_Cover();
     $policyCover->populateFromLegacy($legacyQuote->policyNumber, $legacyQuote->policyOptions, $legacyQuote->amountsCovered, $legacyQuote->optionPremiums);
     $legacyQuoteDatasource = new Datasource_Insurance_LegacyQuotes();
     $legacyQuoteDatasource->save($legacyQuote);
     if ($premiums != '' && $this->hasProduct(self::BUILDING_COVER)) {
         // We also need to populate the legacy SIVALUE table or MTA's & Renewals don't work :(
         $buildingMeta = $this->getProductMeta(self::BUILDING_COVER);
         $sivalueData = array();
         $sivalueData['policynumber'] = $this->getPolicyNumber();
         // If SI is derived siTypeID = 1, if it's manual then siTypeID = 2
         if (isset($buildingMeta['rebuild_value']) && $buildingMeta['rebuild_value'] > 0) {
             $sivalueData['siTypeID'] = 2;
             $sivalueData['siValue'] = $premiums['rebuildValue'];
         } else {
             $sivalueData['siTypeID'] = 1;
             $sivalueData['siValue'] = $premiums['calculatedDSIValue'];
         }
         // policyOptionID is always 33 - Landlords Buildings+
         $sivalueData['policyOptionID'] = 33;
         // startdate and enddate are entered here too! *sigh*
         $sivalueData['startdate'] = $this->getStartDate();
         $sivalueData['enddate'] = $this->getEndDate();
         // dsiArea
         $sivalueData['dsiArea'] = $premiums['dsiData']['areaID'];
         // dsiYearBuiltID
         $sivalueData['dsiYearBuiltID'] = $premiums['dsiData']['yearBuiltID'];
         // dsiPropertyTypeID
         $sivalueData['dsiPropertyTypeID'] = $premiums['dsiData']['dsiPropertyTypeID'];
         // dsiBedroomNumID
         $sivalueData['dsiBedroomNumID'] = $premiums['dsiData']['dsiBedroomQuantityID'];
         $siValueDatasource = new Datasource_Insurance_LandlordsPlus_Legacy_Sivalue();
         $siValueDatasource->save($sivalueData);
     }
 }