<%@ language = "JavaScript" %>
<% /*
    $Revision$
    $Id$
    File:          bb_statusupdate.asp
    Description:   Update reference (bb_ref) for a specific transaction (bb_key).
    Parameters:
        bb_key     Key of transaction
        bb_ref     Reference to be updated
    Context:       Client specific file to handle opslaan-action initiated from
                   a report (only accessible for autorized employees).
    Note:
*/ %>
<%
var JSON_Result = true;
%>
<!-- #include file="../../appl/Shared/common.inc"-->
<!-- #include file="../../appl/Shared/json2.js" -->
<%
  // Alleen WEB_USER03-geautoriseerde WTC-ers mogen een transactie wijzigen!
  var authParams = user.checkAutorisation("WEB_USER03");

  message = "";
  var bbkey = getQParamInt("bb_key");
  var bbref = getQParam("bb_ref","");

  sql = " UPDATE wibc_bankboek "
      + "    SET ref_waarde = SUBSTR (" + safe.quoted_sql(bbref) + ", 1, 50), "
      + "        ref_update = SYSDATE "
      + "  WHERE bankboek_key = " + bbkey;
  Oracle.Execute(sql);

  message = "Referentie bijgewerkt.";

  result = { success : true, message : message }

  Response.Write(JSON.stringify(result));
%>
