<%@ language = "JavaScript" %>
<% /*
    $Revision$
    $Id$
    File:             fin_statusupdate.asp
    Description:      A deeplink call to "finish" (prepare U4-export for) all
                      invoices underlying a specific 'ordernr' (borderel).
    Parameters:
        ordernr       Id stored as fin_kenmerkfactuur_waarde for SSD-invoices
                      to be exported (also stored as fac_usrdata_code).
    Context:          Client specific file to handle actions on 'fin_factuur'
                      as initiated from a report only accessible for autorized
                      employees.
    Note:
*/ %>
<%
DOCTYPE_Disable = 1;
var JSON_Result = true;
%>
<!--#include file="../../appl/Shared/common.inc"-->
<!--#include file="../../appl/Shared/json2.js"-->
<!--#include file="../../appl/Shared/funcodes.inc"-->
<%
  message = "";
  var ordernr = getQParam("ordernr", "");

  if (func_enabled["WEB_USER02"]) {
    message = "SSD-facturen onderliggend aan " + ordernr + " vrijgegeven.";

    // Vrijgeven SSD-facturen; ALLEEN door geautoriseerde VENR-medewerkers!
    sql = "BEGIN VENR.finish_ssdinvoices (" + safe.quoted_sql(ordernr) + "); END;";
    Oracle.Execute(sql);
  }
  else {
    message = L("lcl_no_auth");
  }

  result = { success : true, message : message }

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