VLKC#40719 Eerste bestelstromen/Fleurop
svn path=/Website/branches/v2017.1/; revision=35302
This commit is contained in:
101
CUST/VLKC/custfunctions.wsc
Normal file
101
CUST/VLKC/custfunctions.wsc
Normal file
@@ -0,0 +1,101 @@
|
||||
<?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 Fleurop Interflora Nederland BV uitvoeren
|
||||
if (bedr_key == 5941)
|
||||
{
|
||||
// PO
|
||||
var po_nr = punchNVL("NEW_ITEM-CUST_FIELD3[#]", item, "Onbekend");
|
||||
__Log('PO-NR: CUST_FIELD3[' + 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);
|
||||
}
|
||||
// BTW
|
||||
var btw_perc = punchNVL("NEW_ITEM-CUST_FIELD4[#]", item, "Onbekend");
|
||||
__Log('BTW-PERCENTAGE: CUST_FIELD4[' + item + ']= ' + btw_perc);
|
||||
if (btw_perc != 'Onbekend')
|
||||
{
|
||||
sql = "UPDATE bes_srtdeel SET bes_srtdeel_btw = ROUND(" + parseFloat(btw_perc) + ") WHERE bes_srtdeel_key = " + bes_srtdeel_key;
|
||||
Oracle.Execute(sql);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
]]>
|
||||
</script>
|
||||
</component>
|
||||
Reference in New Issue
Block a user