<div class="row">
  <div class="col-md-6">
    <div class="" ng-if="item.id && !item.client_id"><dl class="dl-horizontal"><dt>{{ "ID" | translate }}:</dt>
        <dd ng-if="itemType">
            <a ng-href="#/objects/client/{{item.id}}" ng-click="(vm.okOnModal || okOnModal)()" ng-if="itemType == 'client'">{{item.id}}</a>
            <a ng-href="#/objects/virtual_client/{{item.id}}" ng-click="(vm.okOnModal || okOnModal)()" ng-if="itemType == 'virtual_client'">{{item.id}}</a>
        </dd>
        <dd ng-if="!itemType">
          {{item.id}}
        </dd>
      </dl>
    </div>
    <div class="" ng-if="item.client_id"><dl class="dl-horizontal"><dt>{{ "CLIENT_ID" | translate }}:</dt>
        <dd>
          {{item.client_id}}
        </dd>
      </dl>
    </div>
    
    <div class="" ng-if="item.Creation_Date"><dl class="dl-horizontal"><dt>{{ "CREATION_DATE" | translate }}:</dt><dd>{{item.Creation_Date | parseDate | formatTimestamp}}</dd></dl></div>
    <div class="" ng-if="item.USERNAME"><dl class="dl-horizontal"><dt>{{ "USERNAME" | translate }}:</dt><dd>{{item.USERNAME}}</dd></dl></div>
    <div class="" ng-if="!item.F_CUSTOMER_ID && item.PartnerId"><dl class="dl-horizontal"><dt>{{ "F_CUSTOMER_ID" | translate }}:</dt><dd><span ng-if="!vm.openFafMbdata">{{item.PartnerId}}</span><span ng-if="vm.openFafMbdata"><a ng-click="vm.openFafMbdata('F_CUSTOMER_ID', item.PartnerId, item.F_BANK_ID || item.USERBK_NR, undefined, { payments: '<payments>' })" class="no-link-link">{{item.PartnerId}}</a></span></dd></dl></div>
    <div class="" ng-if="item.alert_id"><dl class="dl-horizontal"><dt>{{ "ALERT" | translate }}:</dt><dd><a ng-href="#/All/alert/{{item.alert_id}}" ng-if="item.alert_id">{{item.alert_id}}</a></dd></dl></div>
  </div>
  <div class="col-md-6">
    <div class="" ng-if="item.FIRSTNAME"><dl class="dl-horizontal"><dt>{{ "FIRSTNAME" | translate }}:</dt><dd><span compile="item.FIRSTNAME | highlight : item.highlightingData"></span></dd></dl></div>
    <div class="" ng-if="item.LASTNAME"><dl class="dl-horizontal"><dt ng-if="item.FIRSTNAME">{{ "LASTNAME" | translate }}:</dt><dt ng-if="!item.FIRSTNAME">{{ "NAME" | translate }}:</dt><dd><span ng-repeat = "name in item.LASTNAME.split('#;#')" ><span compile="name | highlight : item.highlightingData"></span><br/></span></dd></dl></div>
    <div class="" ng-if="item.DOB"><dl class="dl-horizontal"><dt>{{ "DOB" | translate }}:</dt><dd><span compile="item.DOB | highlight : item.highlightingData:'DOB'"></span></dd></dl></div>
    <div class=""  ng-if="item.Address || item.ADDR_CITY || item.ADDR_COUNTRY || item.ADDR_POSTAL_CODE || item.ADDR_HOUSE_NR || item.ADDR_PO_BOX">
        <dl class="dl-horizontal"><dt>{{ "ADDRESS" | translate }}:</dt>
        <dd>
            <span>
                <span compile="item.Address.split('#;#').join('<br/>') | highlight : item.highlightingData:'Address'"></span><span ng-if="item.Adress && (item.ADDR_CITY || item.ADDR_COUNTRY || item.ADDR_POSTAL_CODE || item.ADDR_HOUSE_NR || item.ADDR_PO_BOX)">, </span>
                <span compile="item.ADDR_HOUSE_NR | highlight : item.highlightingData:'ADDR_HOUSE_NR'"></span><span ng-if="item.ADDR_HOUSE_NR && (item.ADDR_CITY || item.ADDR_COUNTRY || item.ADDR_POSTAL_CODE || item.ADDR_PO_BOX)">, </span>
                <span compile="item.ADDR_POSTAL_CODE | highlight : item.highlightingData:'ADDR_POSTAL_CODE'"></span>
                <span compile="item.ADDR_CITY | highlight : item.highlightingData:'ADDR_CITY'"></span><span ng-if="(item.ADDR_CITY || item.ADDR_POSTAL_CODE) && (item.ADDR_COUNTRY || item.ADDR_PO_BOX)">, </span>
                <span compile="item.ADDR_COUNTRY | highlight : item.highlightingData:'ADDR_COUNTRY'"></span><span ng-if="item.ADDR_COUNTRY && (item.ADDR_PO_BOX)">, </span> 
                <span compile="item.ADDR_PO_BOX | highlight : item.highlightingData:'ADDR_PO_BOX'"></span>
            </span>
        </dd></dl>
    </div>
    <div class="" ng-if="item.COUNTRIES || item.ADDR_COUNTRY"><dl class="dl-horizontal"><dt>{{ config.general.wuestenrot ? 'ADDRESS_COUNTRY' : 'COUNTRIES' | translate }}:</dt><dd><span compile="[( item.COUNTRIES | highlight : item.highlightingData:'COUNTRIES' ), ( item.ADDR_COUNTRY | highlight : item.highlightingData:'ADDR_COUNTRY' )] | reduceStrings"></dd></dl></div>
    <div class="" ng-if="item.Nationality || item.NATIONALITY"><dl class="dl-horizontal"><dt>{{ "NATIONALITY" | translate }}:</dt><dd><span compile="(item.Nationality || item.NATIONALITY) | highlight : item.highlightingData:'NATIONALITY'"></span></dd></dl></div>
  </div>
</div>

<div class="two-column-view">
    <div class="" ng-if="item.Additional_Name1 || item.add_name"><dl class="dl-horizontal"><dt>{{ "ADDIT_NAME" | translate }}:</dt><dd>{{item.Additional_Name1 || item.add_name}}</dd></dl></div>
    <div class="" ng-if="item.Additional_Name2 || item.add_name2"><dl class="dl-horizontal"><dt>{{ "ADDIT_NAME_2" | translate }}:</dt><dd>{{item.Additional_Name2 || item.add_name2}}</dd></dl></div>
    <div class="" ng-if="item.add_info1"><dl class="dl-horizontal"><dt>{{ "ADDIT_INFO" | translate }}:</dt><dd><span compile="item.add_info1 | highlight : item.highlightingData"></span></dd></dl></div>
    <div class="" ng-if="item.add_info2"><dl class="dl-horizontal"><dt>{{ "ADDIT_INFO" | translate }} 2:</dt><dd>{{item.add_info2}}</dd></dl></div>
    <div class="" ng-if="item.add_info3"><dl class="dl-horizontal"><dt>{{ "ADDIT_INFO" | translate }} 3:</dt><dd>{{item.add_info3}}</dd></dl></div>
    <div class="" ng-if="item.add_info4"><dl class="dl-horizontal"><dt>{{ "ADDIT_INFO" | translate }} 4:</dt><dd><span compile="item.add_info4 | highlight : item.highlightingData"></span></dd></dl></div>
    <div class="" ng-if="item.locations"><dl class="dl-horizontal"><dt>{{ "LOCATIONS" | translate }}:</dt><dd>{{item.locations}}</dd></dl></div>
    <!-- <div class="" ng-if="item.contract"><dl class="dl-horizontal"><dt>{{ "CONTRACT" | translate }}:</dt><dd>{{item.contract}}</dd></dl></div> -->
    <div class="" ng-if="item.Gender"><dl class="dl-horizontal"><dt>{{ "GENDER" | translate }}:</dt><dd>{{ item.Gender }}</dd></dl></div>

    <!-- <div class="" ng-if="item.Remittance"><dl class="dl-horizontal"><dt>{{ "REMITTANCE" | translate }}:</dt><dd><span compile="item.Remittance | highlight : item.highlightingData"></span></dd></dl></div> -->

    <div class="" ng-if="item.request_params_json.REQUEST_ID"><dl class="dl-horizontal"><dt>{{ "REQUEST_ID" | translate }}:</dt><dd>{{item.request_params_json.REQUEST_ID}}</dd></dl></div>
    <div class="" ng-if="item.request_params_json.ResidencePermit"><dl class="dl-horizontal"><dt>{{ "ResidencePermit" | translate }}:</dt><dd>{{item.request_params_json.ResidencePermit}}</dd></dl></div>
    <div class="" ng-if="item.request_params_json.AccountSourceOfFunds"><dl class="dl-horizontal"><dt>{{ "AccountSourceOfFunds" | translate }}:</dt><dd>{{item.request_params_json.AccountSourceOfFunds}}</dd></dl></div>
    <div class="" ng-if="item.request_params_json.AccountAmountInitial"><dl class="dl-horizontal"><dt>{{ "AccountAmountInitial" | translate }}:</dt><dd>{{item.request_params_json.AccountAmountInitial | thousandSeparator}}</dd></dl></div>
    <div class="" ng-if="item.request_params_json.AccountSavingAmountPerMonth"><dl class="dl-horizontal"><dt>{{ "AccountSavingAmountPerMonth" | translate }}:</dt><dd>{{item.request_params_json.AccountSavingAmountPerMonth | thousandSeparator}}</dd></dl></div>
    <div class="" ng-if="item.request_params_json.AccountAmountPerMonth"><dl class="dl-horizontal"><dt>{{ "AccountAmountPerMonth" | translate }}:</dt><dd>{{item.request_params_json.AccountAmountPerMonth | thousandSeparator}}</dd></dl></div>
    <div class="" ng-if="item.request_params_json.VdbId"><dl class="dl-horizontal"><dt>{{ "VdbId" | translate }}:</dt><dd>{{item.request_params_json.VdbId}}</dd></dl></div>
    <div class="" ng-if="item.request_params_json.VdbResult"><dl class="dl-horizontal"><dt>{{ "VdbResult" | translate }}:</dt><dd>{{item.request_params_json.VdbResult}}</dd></dl></div>
    <div class="" ng-if="item.request_params_json.CheckId"><dl class="dl-horizontal"><dt>{{ "CheckId" | translate }}:</dt><dd>{{item.request_params_json.CheckId}}</dd></dl></div>
    <div class="" ng-if="item.request_params_json.Decision"><dl class="dl-horizontal"><dt>{{ "RPJ_DECISION" | translate }}:</dt><dd>{{item.request_params_json.Decision}}</dd></dl></div>
    <div class="" ng-if="item.request_params_json.Type"><dl class="dl-horizontal"><dt>{{ "RPJ_TYPE" | translate }}:</dt><dd>{{item.request_params_json.Type}}</dd></dl></div>
    <div class="" ng-if="item.request_params_json.ExternId"><dl class="dl-horizontal"><dt>{{ "ExternId" | translate }}:</dt><dd>{{item.request_params_json.ExternId}}</dd></dl></div>
    <div class="" ng-if="item.request_params_json.ProductCode"><dl class="dl-horizontal"><dt>{{ "ProductCode" | translate }}:</dt><dd>{{item.request_params_json.ProductCode}}</dd></dl></div>
    <div class="" ng-if="item.request_params_json.Duration"><dl class="dl-horizontal"><dt>{{ "Duration" | translate }}:</dt><dd>{{item.request_params_json.Duration}}</dd></dl></div>
    <div class="" ng-if="item.request_params_json.EmploymentStatus"><dl class="dl-horizontal"><dt>{{ "EmploymentStatus" | translate }}:</dt><dd>{{item.request_params_json.EmploymentStatus}}</dd></dl></div>
    <div class="" ng-if="item.request_params_json.LegalForm"><dl class="dl-horizontal"><dt>{{ "LegalForm" | translate }}:</dt><dd>{{item.request_params_json.LegalForm}}</dd></dl></div>
    <div class="" ng-if="item.request_params_json.Industry"><dl class="dl-horizontal"><dt>{{ "Industry" | translate }}:</dt><dd>{{item.request_params_json.Industry}}</dd></dl></div>
    <div class="" ng-if="item.request_params_json.TotalVolume"><dl class="dl-horizontal"><dt>{{ "TotalVolume" | translate }}:</dt><dd>{{item.request_params_json.TotalVolume}}</dd></dl></div>

    <div class="" ng-if="detailed && item.request_params_json.KD_PEP_CD"><dl class="dl-horizontal"><dt>{{ "CF_KD_PEP_CD" | translate }}:</dt><dd>{{item.request_params_json.KD_PEP_CD}}</dd></dl></div>
    <div class="" ng-if="detailed && item.request_params_json.SANCTIONS_CD"><dl class="dl-horizontal"><dt>{{ "CF_SANCTIONS_CD" | translate }}:</dt><dd>{{item.request_params_json.SANCTIONS_CD}}</dd></dl></div>
    <div class="" ng-if="detailed && item.request_params_json.CRIME_CD"><dl class="dl-horizontal"><dt>{{ "CF_CRIME_CD" | translate }}:</dt><dd>{{item.request_params_json.CRIME_CD}}</dd></dl></div>
    <div class="" ng-if="detailed && item.request_params_json.INTERN_CD"><dl class="dl-horizontal"><dt>{{ "CF_INTERNAL_CD" | translate }}:</dt><dd>{{item.request_params_json.INTERN_CD}}</dd></dl></div>
</div>

<show-transaction ng-if="item.F_CUSTOMER_ID || item.F_CUSTOMER_NR || item.F_CONTRACT_ID" data="item" type="'namecheck'"></show-transaction>
<show-transaction-client-wrapper ng-if="itemType == 'client' || itemType == 'buffer_client' || vm.type == 'client' || vm.type == 'buffer_client'" data="item"></show-transaction-client-wrapper>                                                                      
<!-- <show-transaction-client-wrapper data="item" /> -->

<!-- <div ng-if="item.contract">
  <table class="table table-hover">
    <thead>
      <tr>
        <th>{{ "CONTRACT" | translate }}</th>
      </tr>
    </thead>
    <tbody>
      <tr ng-repeat="row in item.contract | parseContract">
        <td style="word-break : break-word;">{{ row }}</td>
      </tr>
    </tbody>
  </table>
</div> -->

<div ng-show="item.reason.rules.length > 0" class="padT-5">
    <button class="btn btn-default btn-sm"
                    ng-click="item.rules_trigger = !item.rules_trigger"
                    ng-class="item.rules_trigger ? 'active' : ''"><b>{{ "SHOW" | translate }} {{ "RULES" | translate }}</b></button>
    <table class="table table-striped" ng-show="item.rules_trigger">
      <thead>
        <tr>
          <th>{{ "RULE" | translate }}</th>
          <th>{{ "MESSAGE" | translate }}</th>
          <th>{{ "SCORE" | translate }}</th>
        </tr>
      </thead>
      <tbody>
        <tr ng-repeat="row in item.reason.rules">
          <td>{{row.Rule}}<div ng-if="row.Message.split('~').length > 2"><rule-message message='row.Message' rulenamemode="row.Rule"></rule-message></div></td>
          <td compile="row.Message" ng-if="!(row.Message.split('~').length > 2)"></td>
          <td ng-if="row.Message.split('~').length > 2">
            <rule-message message='row.Message'></rule-message>
          </td>
          <td>{{row.Score | number:4}}</td>
        </tr>
      </tbody>
    </table>
</div>

<div ng-show="item.reason.matches.length === 0" class="padT-5">
  <h3>{{ "NO_RELEVANT_MATCHES_WERE_FOUND" | translate }}</h3>
</div>

<div ng-show="item.reason.matches.length > 0" class="padT-5">
    <button class="btn btn-default btn-sm"
                    ng-click="item.matches_trigger = !item.matches_trigger"
                    ng-class="item.matches_trigger ? 'active' : ''"><b>{{ "SHOW" | translate }} {{ "MATCHES" | translate }}</b></button>
    <table class="table table-striped" ng-show="item.matches_trigger">
      <thead>
        <tr>
          <th ng-repeat="col in config.types.list.view.list.brief" ng-class="col.class ? col.class : ''">{{col.label | translate }}</th>
          <th>{{ "SIMILARITY" | translate }}</th>
        </tr>
      </thead>
      <tbody>
        <tr ng-repeat="row in item.reason.matches">
          <td ng-repeat="col in config.types.list.view.list.brief track by $index">
            <div ng-if="$index != 0 && !row.highlightingData">{{row.list[col.field]}}</div>
            <div ng-if="$index != 0 && row.highlightingData"><span compile="row.list[col.field] | highlight : row.highlightingData:col.field"></span></div>
            <div ng-if="$index == 0 ">
               <a ng-href="#/objects/list/{{row.list.id}}" ng-if="!vm.viewMatchInfo"><b ng-show = "row.color == 2" class = "swamp">&#10004; </b><b ng-show = "row.color == 1" class = "dark-yellow">&#10004; </b>{{row.list.id}}</a>
              <a ng-if="vm.viewMatchInfo" ng-click="vm.viewMatchInfo(row.list)" class="no-link-link" title="{{ 'Matched: ' + row.match_version + ', shown: ' + row.list_version }}"><b ng-show = "row.color == 2" class = "swamp">&#10004; </b><b ng-show = "row.color == 1" class = "dark-yellow">&#10004; </b>{{row.list.id}}</a>
            </div>
          </td>
          <td>{{row.Similarity | number:4}}</td>
        </tr>
      </tbody>
    </table>

</div>



<div ng-if="item.faf_mbdata_clients">
    <h3>{{ 'CLIENTS' | translate }}</h3>
    <list ng-init="clientsconfig = guessColumns(item.faf_mbdata_clients, 'faf_mbdata_clients')" data="item.faf_mbdata_clients" columns="clientsconfig"/>
</div>