Customer - Information
/
Y
N
0.0
0.0
1000
1
1
N
Y
5000
Y
admin
2007/04/09 10:47:14.000
Text file inputSelect FieldsY Select FieldsTransform FieldsY Transform FieldsCustomer OutputY
Customer Output
OpenVPMSLoaderPlugin
Y
1
none
openvpmsCLNUMBER<party.customerperson>titlefalsefalse<party.customerperson>firstNamefalsefalse<party.customerperson>lastNamefalsefalse<party.customerperson>activefalsefalse<party.customerperson>contacts[0]<contact.phoneNumber>telephoneNumbertruetrue<party.customerperson>contacts[0]<contact.phoneNumber>areaCodetruetrue<party.customerperson>contacts[0]<contact.phoneNumber>purposes[0]true<lookup.contactPurpose>code=HOMEtrue<party.customerperson>contacts[1]<contact.phoneNumber>telephoneNumbertruetrue<party.customerperson>contacts[1]<contact.phoneNumber>areaCodetruetrue<party.customerperson>contacts[1]<contact.phoneNumber>purposes[0]true<lookup.contactPurpose>code=WORKtrue<party.customerperson>contacts[3]<contact.location>addresstruetrue<party.customerperson>contacts[3]<contact.location>suburbtruetrue<party.customerperson>contacts[3]<contact.location>statetruetrue<party.customerperson>contacts[3]<contact.location>postcodetruetrue<party.customerperson>contacts[4]<contact.location>addresstruefalse<party.customerperson>contacts[4]<contact.location>suburbtruefalse<party.customerperson>identities[0]<entityIdentity.code>codetruetrue<party.customerperson>type[0]true<lookup.customerAccountType>$valuefalsetruetrue1000
466
147
Y
Select Fields
SelectValues
Y
1
none
CLIENTID
CLNUMBER
-2
-2
SURNAME
CLSURNAME
-2
-2
FIRSTNAME
CLFSTNAME
-2
-2
TITLE
CLTITLE
-2
-2
HOMEPHONE
CLPHONE
-2
-2
WORKPHONE
WKPHONE
-2
-2
ADDRESS1
CLADDRESS1
-2
-2
TOWN
CLSUBURB
-2
-2
STATE
CLSTATE
-2
-2
POSTCODE
CLPOSTCODE
-2
-2
CODE
-2
-2
RESSTREET
-2
-2
RESSUBURB
-2
-2
ACCTYPE
-2
-2
212
147
Y
Text file input
TextFileInput
Y
1
none
N
,
"
N
1
1
N
1
N
80
0
Y
N
N
N
DOS
${NETVET_DATA}\client.txt
CSV
None
CLIENTID
Integer
$
.
,
-
-1
6
0
none
N
CODE
String
$
.
,
-
-1
10
0
none
N
SURNAME
String
-
-1
30
-1
none
N
FIRSTNAME
String
-
-1
30
-1
none
N
TITLE
String
-
-1
15
-1
none
N
HOMEPHONE
String
-
-1
20
-1
none
N
WORKPHONE
String
-
-1
20
-1
none
N
ADDRESS1
String
-
-1
50
-1
right
N
TOWN
String
-
-1
50
-1
none
N
STATE
String
-
-1
15
-1
none
N
POSTCODE
String
$
.
,
-
-1
10
0
none
N
RESSTREET
String
-1
50
-1
none
N
RESSUBURB
String
-1
30
-1
none
N
ACCTYPE
String
-1
15
-1
none
N
0
Y
Y
warning
error
line
Y
en_au
58
147
Y
Transform Fields
ScriptValueMod
Y
1
none
0
Script 1
//Script here
var wordUtils = Packages.org.apache.commons.lang.WordUtils;
var ovpmsfuncs = Packages.org.openvpms.etl.ETLHelper
// Transform Name information
CLFSTNAME.setString(wordUtils.capitalizeFully(trim(CLFSTNAME.getString())))
CLSURNAME.setString(wordUtils.capitalizeFully(trim(CLSURNAME.getString())))
if (CLSURNAME.getString() == "" || CLSURNAME.getString() == null) {
CLSURNAME.setString("No LastName")
}
CLTITLE.setString(trim(CLTITLE.getString()))
// Transform Address information
CLADDRESS1.setString(wordUtils.capitalizeFully(trim(CLADDRESS1.getString())))
CLSUBURB.setString(wordUtils.capitalizeFully(trim(CLSUBURB.getString())))
CLSTATE.setString(wordUtils.capitalize(trim(CLSTATE.getString())))
CLPOSTCODE.setString(trim(CLPOSTCODE.getString()))
var CLADDRESS = CLADDRESS1.getString()
RESSTREET.setString(wordUtils.capitalizeFully(trim(RESSTREET.getString())))
RESSUBURB.setString(wordUtils.capitalizeFully(trim(RESSUBURB.getString())))
var RESADDRESS = null
var RESTOWN = null
if (RESSTREET.getString() != CLADDRESS1.getString()) {
RESADDRESS = RESSTREET.getString()
RESTOWN = RESSUBURB.getString()
}
// Transform Phone Information
CLPHONE.setString(trim(CLPHONE.getString()))
WKPHONE.setString(trim(WKPHONE.getString()))
var CLPHONENUM
var WKPHONENUM
var CLPHONEAREA
var WKPHONEAREA
try {
if (substr(CLPHONE.getString(),0,1) == "(") {
CLPHONENUM = trim(substr(CLPHONE.getString(),4))
if (CLPHONENUM == "")
CLPHONEAREA = ""
else
CLPHONEAREA = trim(substr(CLPHONE.getString(),1,3))
}
else {
CLPHONENUM = CLPHONE.getString()
CLPHONEAREA = ""
}
}
catch (e) {
CLPHONENUM = CLPHONE.getString()
CLPHONEAREA = ""
}
try {
if (substr(WKPHONE.getString(),0,1) == "(") {
WKPHONENUM = trim(substr(WKPHONE.getString(),4))
if (WKPHONENUM == "")
WKPHONEAREA = ""
else
WKPHONEAREA = trim(substr(WKPHONE.getString(),1,3))
}
else {
WKPHONENUM = WKPHONE.getString()
WKPHONEAREA = ""
}
}
catch (e) {
WKPHONENUM = WKPHONE.getString()
WKPHONEAREA = ""
}
// active flag
var ACTIVE = true
//Account Type
ACCTYPE.setString(replace(upper(ACCTYPE.getString())," ","_"))
CLADDRESS
CLADDRESS
String
255
-1
CLPHONEAREA
CLPHONEAREA
String
-1
-1
CLPHONENUM
CLPHONENUM
String
-1
-1
WKPHONEAREA
WKPHONEAREA
String
-1
-1
WKPHONENUM
WKPHONENUM
String
-1
-1
ACTIVE
ACTIVE
Boolean
-1
-1
RESADDRESS
RESADDRESS
String
-1
-1
RESTOWN
RESTOWN
String
-1
-1
342
148
Y