<%@language = "javascript" %>
<% /*
     $Revision$
     $Id$

    File:               BES_opdr_xml.asp
    Description:        XML converter for bestellingen and opdrachten
    Parameters:         one of the opdr_key or bes_key should be supplied. If both, opdr_key is used
        opdr_key        optional, key of the bes_bestelopdr to be printed using XML and cust.xsl
        bes_key         optional, key of the orderrequest bes_bestelling to be printed using XML and cust.xsl
    Context:            Called from bes.asp
    Note:
*/ %>

<!-- #include file="../Shared/common.inc"-->
<!-- #include file="../Shared/xml_converter.inc" -->
<!-- #include file="./bes.inc" -->

<%
    var bes_key     = getQParamInt("bes_key", -1);
    var opdr_key    = getQParamInt("opdr_key", -1);

    if (opdr_key != -1)
    {
        // TODO Voor bes_opdr bestaan nog geen handige functies
        FCLT2XMLResponse( {xmlnode: 'bestelopdr', key: opdr_key});
    }
    else
    {
        var bes_bestelling = bes.bestelling_info(bes_key);
        var this_bes = bes.func_enabled_bestelling(bes_bestelling);
        user.auth_required_or_abort(this_bes.canReadAny);

    FCLT2XMLResponse( {xmlnode: 'bestelling', key: bes_key});
    }
%>
<% ASPPAGE_END(); %> 
