<h2>Suspicious Vendor Analysis</h2>

<div ng-if="!_printView && tab === 'vendor'">
    <h3>Vendor Details</h3>

    <table class="padded-table">
        <tr>
            <td>Vendor ID:</td>
            <td style="text-align: left;"><a href="https://urlecho.appspot.com/echo?Content-Type=text%2Fhtml&body=%3Cp%3E%5BPlaceholder%20-%20would%20link%20to%20your%20SAP%20platform%5D%3C%2Fp%3E%0A%0A%3Cp%3E%3Cb%3EVendor%20ID%20{{ sourceData.Vendor_ID }}%3C%2Fb%3E%3C%2Fp%3E">{{ sourceData.Vendor_ID }}</td>
        </tr>
        <tr>
            <td>Vendor Name:</td>
            <td style="text-align: left;">{{ sourceData.Vendor_Name }}</td>
        </tr>
        <tr>
            <td>Address:</td>
            <td style="text-align: left;">
              {{ sourceData.Address_1 }}
              <br ng-if="sourceData.Address_2">
              {{ sourceData.Address_2 }}<br>
              {{ sourceData.City }}
              {{ sourceData.Postal_Code }}<br>
              {{ sourceData.Country }}
            </td>
        </tr>
        <tr>
            <td>IBAN:</td>
            <td style="text-align: left;">{{ sourceData.IBAN }}</td>
        </tr>
        <tr>
            <td>Bank Country:</td>
            <td style="text-align: left;">{{ sourceData.Bank_Country }}</td>
        </tr>
    </table>

    <hr>

    <h3>Match Details</h3>

    <table class="padded-table">
        <tr>
          <td><b>Match Type:</b></td>
          <td style="text-align: left;"><b>{{ sourceData.Match_Type }}</b></td>
        </tr>
        <tr>
          <td>Match Details:</td>
          <td style="text-align: left;">{{ sourceData.Match_Details }}</td>
        </tr>
    </table>

    <hr>

    <h3>Suspicious Vendor Checklist</h3>

    <table class="padded-table checklist-table" ng-if="sourceData.Match_Type == 'Bank Country Mismatch'">
      <tr>
        <td>1.</td>
        <td>
          <p>Verify vendor details in SAP system. Is there an explanation for the bank country mismatch?</p>

          <p ng-show="resultsData.checklist_1 == 'YES'">
            <textarea class="checklist-details-text" ng-model="resultsData.checklist_1_details"></textarea>
          </p>  
        </td>
        <td>
          <select ng-model="resultsData.checklist_1">
            <option value=""></option>
            <option value="YES">Yes (add details)</option>
            <option value="NO">No</option>
          </select>
        </td>
      </tr>
    </table>

    <table class="padded-table checklist-table" ng-if="sourceData.Match_Type == 'Employee Address Match' || sourceData.Match_Type == 'Employee Bank Account Match'">
      <tr>
        <td>1.</td>
        <td>
          <p>Verify vendor details in SAP system. Is there an explanation for the employee match?</p>

          <p ng-show="resultsData.checklist_1 == 'YES'">
            <textarea class="checklist-details-text" ng-model="resultsData.checklist_1_details"></textarea>
          </p>  
        </td>
        
        <td>
          <select ng-model="resultsData.checklist_1">
            <option value=""></option>
            <option value="YES">Yes (add details)</option>
            <option value="NO">No</option>
          </select>
        </td>
      </tr>
      <tr>
        <td>1b.</td>
        <td>
          <p>Contact staff investigations team. Ask them to identify whether there is an explanation for the employee match in the employee master file?</p>

          <p ng-show="resultsData.checklist_1b == 'YES'">
            <textarea class="checklist-details-text" ng-model="resultsData.checklist_1b_details"></textarea>
          </p>  
        </td>
        
        <td>
          <select ng-model="resultsData.checklist_1b">
            <option value=""></option>
            <option value="YES">Yes (add details)</option>
            <option value="NO">No</option>
          </select>
        </td>
      </tr>      
    </table>

    
    <table class="padded-table checklist-table" ng-if="sourceData.Match_Type == 'Legal Form Mismatch'">
      <tr>
        <td>1.</td>
        <td>
          <p>Verify vendor details in SAP system. Is there an explanation for the legal form mismatch (e.g. foreign subsidiary or branch that is not marked as such, translation error)?</p>

          <p ng-show="resultsData.checklist_1 == 'YES'">
            <textarea class="checklist-details-text" ng-model="resultsData.checklist_1_details"></textarea>
          </p>  
        </td>
        <td>
          <select ng-model="resultsData.checklist_1">
            <option value=""></option>
            <option value="YES">Yes (add details)</option>
            <option value="NO">No</option>
          </select>
        </td>
      </tr>
    </table>

    <table class="padded-table checklist-table" ng-if="sourceData.Match_Type == 'Potential Duplicate'">
      <tr>
        <td>1.</td>
        <td>
          <p>Verify vendor details in SAP system. Can it be confirmed that this is NOT a duplicate (false positive in fuzzy matching)?</p>

          <p ng-show="resultsData.checklist_1 == 'YES'">
            <textarea class="checklist-details-text" ng-model="resultsData.checklist_1_details"></textarea>
          </p>  
        </td>
        <td>
          <select ng-model="resultsData.checklist_1">
            <option value=""></option>
            <option value="YES">Yes (add details)</option>
            <option value="NO">No</option>
          </select>
        </td>
      </tr>
    </table>
    

    <table class="padded-table checklist-table" ng-if="resultsData.checklist_1 != 'YES' && resultsData.checklist_1b != 'YES'">
      <tr>
        <td>2.</td>
        <td>
          <p>Verify vendor change records in SAP system. Is there evidence of wrongdoing (e.g. change-and-change-back, changes prior to payments not evidenced by documentation)?</p>

          <p ng-show="resultsData.checklist_2 == 'YES'">
            <textarea class="checklist-details-text" ng-model="resultsData.checklist_2_details"></textarea>
          </p>  
        </td>
        <td>
          <select ng-model="resultsData.checklist_2">
            <option value=""></option>
            <option value="YES">Yes (add details)</option>
            <option value="NO">No</option>
          </select>
        </td>
      </tr>

      <tr>
        <td>3.</td>
        <td>
          <p>Verify payments history (click on &quot;Payments&quot; above). Is there evidence of wrongdoing (e.g. abnormal payment amounts or destinations, missing PO or GR confirmations)?</p>

          <p ng-show="resultsData.checklist_3 == 'YES'">
            <textarea class="checklist-details-text" ng-model="resultsData.checklist_3_details"></textarea>
          </p>  
        </td>
        <td>
          <select ng-model="resultsData.checklist_3">
            <option value=""></option>
            <option value="YES">Yes (add details)</option>
            <option value="NO">No</option>
          </select>
        </td>
      </tr>

      <tr>
        <td>4.</td>
        <td>
          <p>If wrongdoing is suspected, contact lead auditor and discuss next steps. If no wrongdoing is suspected, contact employee responsible for change that lead to mismatch and ask for his/her explanation. Is the explanation plausible?</p>

          <p ng-show="resultsData.checklist_4 == 'YES'">
            <textarea class="checklist-details-text" ng-model="resultsData.checklist_4_details"></textarea>
          </p>  
        </td>
        <td>
          <select ng-model="resultsData.checklist_4">
            <option value=""></option>
            <option value="YES">Yes (add details)</option>
            <option value="NO">No</option>
          </select>
        </td>
      </tr>

      <tr>
        <td>5.</td>
        <td>
          <p>Document the final results of your analysis under &quot;Final Results&quot; below.</p>  
        </td>
        <td>
          &nbsp;
        </td>
      </tr>      

      <tr ng-if="sourceData.Match_Type == 'Potential Duplicate'">
        <td>6.</td>
        <td>
          <p>For non-malicious but real duplicates: Inform vendor master team to merge vendor entries.</p>
        </td>
        <td>
          &nbsp;
        </td>
      </tr>      
    </table>

    
    
    <hr>

    <h3>Final Results</h3>
    
    <p><label>Vendor evaluation:
      <select ng-model="resultsData.evaluation">
          <option value=""></option>
          <option value="false_pos">False positive (analytics error)</option>
          <option value="explained">Explained positive</option>
          <option value="investigation">Investigation initiated</option>
          <option value="pending_response">Pending response</option>
      </select>
    </label></p>

    <p><label>Comments: <br>
    <textarea ng-model="resultsData.evaluationComments" rows="5" cols="40"></textarea></label></p>

</div>

<div ng-if="!_printView && tab === 'payments'">
    <h3>Last Payment Details</h3>

    <pre>
{{ sourceData.Last_Payments }}
    </pre>
</div>


<div ng-if="_printView">
      <h3>Vendor Details</h3>

    <table class="padded-table">
        <tr>
            <td>Vendor ID:</td>
            <td style="text-align: right;"><a href="https://urlecho.appspot.com/echo?Content-Type=text%2Fhtml&body=%3Cp%3E%5BPlaceholder%20-%20would%20link%20to%20your%20SAP%20platform%5D%3C%2Fp%3E%0A%0A%3Cp%3E%3Cb%3EVendor%20ID%20{{ sourceData.Vendor_ID }}%3C%2Fb%3E%3C%2Fp%3E">{{ sourceData.Vendor_ID }}</td>
        </tr>
        <tr>
            <td>Vendor Name:</td>
            <td style="text-align: left;">{{ sourceData.Vendor_Name }}</td>
        </tr>
        <tr>
            <td>Address:</td>
            <td style="text-align: left;">
              {{ sourceData.Address_1 }}
              {{ (sourceData.Address_2 ? '<br>' : '') }}
              {{ sourceData.Address_2 }}<br>
              {{ sourceData.City }}
              {{ sourceData.Postal_Code }}
              {{ sourceData.Country }}
            </td>
        </tr>
        <tr>
            <td>IBAN:</td>
            <td style="text-align: left;">{{ sourceData.IBAN }}</td>
        </tr>
        <tr>
            <td>Bank Country:</td>
            <td style="text-align: left;">{{ sourceData.Bank_Country }}</td>
        </tr>
    </table>

    <hr>

    <h3>Match Details</h3>

    <table class="padded-table">
        <tr>
          <td><b>Match Type:</b></td>
          <td style="text-align: left;"><b>{{ sourceData.Match_Type }}</b></td>
        </tr>
        <tr>
          <td>Match Details:</td>
          <td style="text-align: left;">{{ sourceData.Match_Details }}</td>
        </tr>
    </table>

    <hr>

    <h3>Suspicious Vendor Checklist</h3>

    <table class="padded-table checklist-table" ng-if="sourceData.Match_Type == 'Bank Country Mismatch'">
      <tr>
        <td>1.</td>
        <td>
          <p>Verify vendor details in SAP system. Is there an explanation for the bank country mismatch?</p>

          <p ng-show="resultsData.checklist_1 == 'YES'">
            {{ resultsData.checklist_1_details }}
          </p>  
        </td>
        <td>
          <span ng-if="resultsData.checklist_1 == 'YES'">Yes (add details)</span>
          <span ng-if="resultsData.checklist_1 == 'NO'">No</span>
        </td>
      </tr>
    </table>

    <table class="padded-table checklist-table" ng-if="sourceData.Match_Type == 'Employee Address Match' || sourceData.Match_Type == 'Employee Bank Account Match'">
      <tr>
        <td>1.</td>
        <td>
          <p>Verify vendor details in SAP system. Is there an explanation for the employee match?</p>

          <p ng-show="resultsData.checklist_1 == 'YES'">
            {{ resultsData.checklist_1_details }}
          </p>  
        </td>
        <td>
          <span ng-if="resultsData.checklist_1 == 'YES'">Yes (add details)</span>
          <span ng-if="resultsData.checklist_1 == 'NO'">No</span>
        </td>
      </tr>

      <tr>
        <td>1b.</td>
        <td>
          <p>Contact staff investigations team. Ask them to identify whether there is an explanation for the employee match in the employee master file?</p>

          <p ng-show="resultsData.checklist_1b == 'YES'">
            {{ resultsData.checklist_1b_details }}
          </p>  
        </td>
        <td>
          <span ng-if="resultsData.checklist_1b == 'YES'">Yes (add details)</span>
          <span ng-if="resultsData.checklist_1b == 'NO'">No</span>
        </td>
      </tr>      
    </table>

    
    <table class="padded-table checklist-table" ng-if="sourceData.Match_Type == 'Legal Form Mismatch'">
      <tr>
        <td>1.</td>
        <td>
          <p>Verify vendor details in SAP system. Is there an explanation for the legal form mismatch (e.g. foreign subsidiary or branch that is not marked as such, translation error)?</p>

          <p ng-show="resultsData.checklist_1 == 'YES'">
            <i>{{ resultsData.checklist_1_details }}</i>
          </p>  
        </td>
        <td>
          <span ng-if="resultsData.checklist_1 == 'YES'">Yes (add details)</span>
          <span ng-if="resultsData.checklist_1 == 'NO'">No</span>
        </td>
      </tr>
    </table>

    <table class="padded-table checklist-table" ng-if="sourceData.Match_Type == 'Potential Duplicate'">
      <tr>
        <td>1.</td>
        <td>
          <p>Verify vendor details in SAP system. Can it be confirmed that this is NOT a duplicate (false positive in fuzzy matching)?</p>

          <p ng-show="resultsData.checklist_1 == 'YES'">
            <i>{{ resultsData.checklist_1_details }}</i>
          </p>  
        </td>
        <td>
          <span ng-if="resultsData.checklist_1 == 'YES'">Yes (add details)</span>
          <span ng-if="resultsData.checklist_1 == 'NO'">No</span>
        </td>
      </tr>
    </table>
    

    <table class="padded-table checklist-table" ng-if="resultsData.checklist_1 != 'YES' && resultsData.checklist_1b != 'YES'">
      <tr>
        <td>2.</td>
        <td>
          <p>Verify vendor change records in SAP system. Is there evidence of wrongdoing (e.g. change-and-change-back, changes prior to payments not evidenced by documentation)?</p>

          <p ng-show="resultsData.checklist_2 == 'YES'">
            <i>{{ resultsData.checklist_2_details }}</i>
          </p>  
        </td>
        <td>
          <span ng-if="resultsData.checklist_2 == 'YES'">Yes (add details)</span>
          <span ng-if="resultsData.checklist_2 == 'NO'">No</span>
        </td>
      </tr>

      <tr>
        <td>3.</td>
        <td>
          <p>Verify payments history (click on &quot;Payments&quot; above). Is there evidence of wrongdoing (e.g. abnormal payment amounts or destinations, missing PO or GR confirmations)?</p>

          <p ng-show="resultsData.checklist_3 == 'YES'">
            <i>{{ resultsData.checklist_3_details }}</i>
          </p>  
        </td>
        <td>
          <span ng-if="resultsData.checklist_3 == 'YES'">Yes (add details)</span>
          <span ng-if="resultsData.checklist_3 == 'NO'">No</span>
        </td>
      </tr>

      <tr>
        <td>4.</td>
        <td>
          <p>If wrongdoing is suspected, contact lead auditor and discuss next steps. If no wrongdoing is suspected, contact employee responsible for change that lead to mismatch and ask for his/her explanation. Is the explanation plausible?</p>

          <p ng-show="resultsData.checklist_4 == 'YES'">
            <i>{{ resultsData.checklist_4_details }}</i>
          </p>  
        </td>
        <td>
          <span ng-if="resultsData.checklist_4 == 'YES'">Yes (add details)</span>
          <span ng-if="resultsData.checklist_4 == 'NO'">No</span>
        </td>
      </tr>
    </table>

    
    
    <hr>

    <h3>Final Results</h3>
    
    <p>Vendor evaluation:
      <b ng-if="resultsData.evaluation == 'false_pos'">False positive (analytics error)</b>
      <b ng-if="resultsData.evaluation == 'explained'">Explained positive</b>
      <b ng-if="resultsData.evaluation == 'investigation'">Investigation initiated</b>
      <b ng-if="resultsData.evaluation == 'pending_response'">Pending response</b>
    </p>

    <p>
      <b>Comments:</b> <br>
      {{ resultsData.evaluationComments }}
    </p>
</div>

