KFSG#54266 Xerox-koppeling(en)
svn path=/Website/branches/v2018.2/; revision=41181
This commit is contained in:
94
CUST/KFSG/custfunctions.wsc
Normal file
94
CUST/KFSG/custfunctions.wsc
Normal file
@@ -0,0 +1,94 @@
|
||||
<?xml version="1.0"?>
|
||||
<component>
|
||||
<?component error="true" debug="true"?>
|
||||
<registration
|
||||
description="custfunctions"
|
||||
progid="custfunction.wsc"
|
||||
version="1.00"
|
||||
classid="{4F51571C-1DFC-4769-B8DD-37B356378F12}"
|
||||
>
|
||||
</registration>
|
||||
|
||||
<public>
|
||||
|
||||
<!-- properties -->
|
||||
<property name="Oracle">
|
||||
<put/>
|
||||
</property>
|
||||
<property name="__Log">
|
||||
<put/>
|
||||
</property>
|
||||
<property name="__DoLog">
|
||||
<put/>
|
||||
</property>
|
||||
<property name="safe">
|
||||
<put/>
|
||||
</property>
|
||||
|
||||
<!-- methods -->
|
||||
<method name="bes_punch_receive">
|
||||
<PARAMETER name="RequestForm"/>
|
||||
<PARAMETER name="bes_srtdeel_key"/>
|
||||
<PARAMETER name="item"/>
|
||||
</method>
|
||||
|
||||
</public>
|
||||
|
||||
<script language="javascript">
|
||||
<![CDATA[
|
||||
|
||||
/*
|
||||
$Revision$
|
||||
$Id$
|
||||
*/
|
||||
|
||||
function put_Oracle(newValue) {Oracle = newValue};
|
||||
function put___Log(newValue) {__Log = newValue};
|
||||
function put___DoLog(newValue) {__DoLog = newValue};
|
||||
function put_safe(newValue) {safe = newValue};
|
||||
|
||||
/* Dit zijn de enige drie functies die je mag gebruiken */
|
||||
var Oracle;
|
||||
var __Log;
|
||||
var __DoLog;
|
||||
var safe;
|
||||
|
||||
|
||||
|
||||
bes_punch_receive = function (RequestForm, bes_srtdeel_key, item, pResult)
|
||||
{
|
||||
var result = {orderurl: ""};
|
||||
var sql = "SELECT sd.prs_bedrijf_key FROM bes_srtdeel sd WHERE sd.bes_srtdeel_key = " + bes_srtdeel_key;
|
||||
var oRs = Oracle.Execute(sql);
|
||||
var bedr_key = oRs("prs_bedrijf_key").value;
|
||||
oRs.Close();
|
||||
|
||||
function punchNVL(nm, n, def)
|
||||
{
|
||||
var nm = nm.replace('#', n);
|
||||
if (RequestForm(nm).Count() == 0)
|
||||
return def;
|
||||
if (RequestForm(nm) == "")
|
||||
return def;
|
||||
return RequestForm(nm)(1);
|
||||
};
|
||||
|
||||
// Alleen voor leverancier Xerox uitvoeren
|
||||
if (bedr_key == 30821)
|
||||
{
|
||||
// PO
|
||||
var po_nr = punchNVL("NEW_ITEM-CUST_FIELD1[#]", item, "Onbekend");
|
||||
__Log('PO-NR: CUST_FIELD1[' + item + ']= ' + po_nr);
|
||||
if (po_nr != 'Onbekend')
|
||||
{
|
||||
sql = "UPDATE bes_srtdeel SET bes_srtdeel_opmerking = " + safe.quoted_sql(po_nr) + " WHERE bes_srtdeel_key = " + bes_srtdeel_key;
|
||||
Oracle.Execute(sql);
|
||||
result.flex_defaults = result.flex_defaults + "&Refnr. leverancier=" + po_nr;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
]]>
|
||||
</script>
|
||||
</component>
|
||||
Reference in New Issue
Block a user