Commit 6d1d2d5a by lixinyi

调整cips标识号编码方法,改日间为必输,适应ie浏览器

parent b710927d
module.exports = {
presets: [
"@vue/cli-plugin-babel/preset",
["@babel/preset-env", { modules: false }],
],
plugins: [
[
"component",
{
libraryName: "element-ui",
styleLibraryName: "theme-chalk",
},
presets: [
"@vue/cli-plugin-babel/preset",
["@babel/preset-env", {
useBuiltIns: 'entry',
"corejs": "3",
}],
"@babel/preset-react",
],
],
plugins: [
[
"component",
{
libraryName: "element-ui",
styleLibraryName: "theme-chalk",
},
],
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-object-rest-spread",
"@babel/plugin-transform-runtime",
],
sourceType: 'unambiguous'
};
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -8,10 +8,14 @@
"lint": "vue-cli-service lint"
},
"dependencies": {
"@babel/preset-react": "^7.24.1",
"@babel/runtime": "^7.24.4",
"axios": "^0.27.2",
"babel-preset-mobx": "^2.0.0",
"core-js": "^3.8.3",
"decimal.js": "^10.4.0",
"element-ui": "^2.15.8",
"es6-promise": "^4.2.8",
"moment": "^2.29.4",
"save": "^2.5.0",
"vue": "^2.6.14",
......@@ -19,12 +23,17 @@
"vuex": "^3.6.2"
},
"devDependencies": {
"@babel/core": "^7.12.16",
"@babel/cli": "^7.24.1",
"@babel/core": "^7.24.4",
"@babel/eslint-parser": "^7.12.16",
"@babel/plugin-proposal-object-rest-spread": "^7.20.7",
"@babel/plugin-transform-runtime": "^7.24.3",
"@babel/preset-env": "^7.24.4",
"@vue/cli-plugin-babel": "~5.0.0",
"@vue/cli-plugin-eslint": "~5.0.0",
"@vue/cli-service": "~5.0.0",
"babel-plugin-component": "^1.1.1",
"babel-polyfill": "^6.26.0",
"eslint": "^7.32.0",
"eslint-plugin-vue": "^8.0.3",
"less": "^4.1.3",
......
......@@ -18,4 +18,4 @@
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
</html>
\ No newline at end of file
......@@ -40,7 +40,7 @@ import Decimal from 'decimal.js'
export default {
props: ['dataModel', 'sca'],
data() {
data:function() {
return {
scale: 2,
orgData: {},
......@@ -50,19 +50,19 @@ export default {
warningText:''
}
},
mounted() {
mounted:function() {
this.orgData = this.dataModel.value
? this.dataModel.value
: MsgJsonMap('Amount')
this.dataModel.value = this.orgData
this.options = MsgCodes['ccy']
for (let opt of this.options) {
for (var opt of this.options) {
this.scaleMap[opt.value] = opt.scale
}
this.changeOption(this.orgData.value)
},
methods: {
changeOption(value) {
changeOption:function(value) {
if (value === '') {
this.orgData.value = ''
this.iswarning = false;
......@@ -75,17 +75,17 @@ export default {
}
},
//与关联路径对应的Amount的币种进行比较,如果不一致则给出提示信息
compare(path) {
let pathMap = path.split('.')
let treeNodeArry = this.$root.$children[0].$children[0].$data.treeModel.treeNodeArry;
let exp = `treeNodeArry[${pathMap[0]}]`;
for (let index = 1; index < pathMap.length; index++) {
compare:function(path) {
var pathMap = path.split('.')
var treeNodeArry = this.$root.$children[0].$children[0].$data.treeModel.treeNodeArry;
var exp = `treeNodeArry[${pathMap[0]}]`;
for (var index = 1; index < pathMap.length; index++) {
const child = pathMap[index];
exp += `.children[${child}]`
}
let targetCcy = eval(exp + '.value.ccy')
var targetCcy = eval(exp + '.value.ccy')
let targetName = eval(exp + '.name')
var targetName = eval(exp + '.name')
if(targetCcy != undefined && targetCcy !='' && this.dataModel.value.ccy !== targetCcy){
this.iswarning = true;
......@@ -94,7 +94,7 @@ export default {
this.iswarning = false;
}
},
checkData() {
checkData:function() {
if (
this.orgData.ccy === undefined ||
this.orgData.ccy === null ||
......@@ -104,7 +104,7 @@ export default {
this.scale = this.options[0].scale
}
},
amountHandle() {
amountHandle:function() {
this.$root.$children[0].$children[0].$refs.form.validateField(
this.$parent._props.prop,
(errMsg) => {
......@@ -115,7 +115,7 @@ export default {
var maxValue = Decimal('999999999999.99')
const minValue = Decimal('0')
var tip = '999,999,999,999.99'
let value = inputValue.toFixed(this.scale, Decimal.ROUND_HALF_UP)
var value = inputValue.toFixed(this.scale, Decimal.ROUND_HALF_UP)
if (ccy !== '' && ccy !== undefined) {
if (ccy == 'RAND' || ccy == 'IDR' || ccy == 'VND') {
maxValue = Decimal('9999999999999999.99')
......
......@@ -40,7 +40,7 @@ import Decimal from 'decimal.js'
export default {
props: ['dataModel', 'sca1'],
data() {
data:function() {
return {
scale: 2,
orgData: {},
......@@ -50,19 +50,19 @@ export default {
warningText:''
}
},
mounted() {
mounted:function() {
this.orgData = this.dataModel.value
? this.dataModel.value
: MsgJsonMap('Amount')
this.dataModel.value = this.orgData
this.options = MsgCodes['Ccy']
for (let opt of this.options) {
for (var opt of this.options) {
this.scaleMap[opt.value] = opt.scale
}
this.changeOption(this.orgData.amount)
},
methods: {
changeOption(value) {
changeOption:function(value) {
if (value === '') {
this.orgData.amount = ''
this.iswarning = false;
......@@ -75,17 +75,17 @@ export default {
}
},
//与关联路径对应的Amount的币种进行比较,如果不一致则给出提示信息
compare(path) {
let pathMap = path.split('.')
let treeNodeArry = this.$root.$children[0].$children[0].$data.treeModel.treeNodeArry;
let exp = `treeNodeArry[${pathMap[0]}]`;
for (let index = 1; index < pathMap.length; index++) {
compare:function(path) {
var pathMap = path.split('.')
var treeNodeArry = this.$root.$children[0].$children[0].$data.treeModel.treeNodeArry;
var exp = `treeNodeArry[${pathMap[0]}]`;
for (var index = 1; index < pathMap.length; index++) {
const child = pathMap[index];
exp += `.children[${child}]`
}
let targetCcy = eval(exp + '.value.Ccy')
var targetCcy = eval(exp + '.value.Ccy')
let targetName = eval(exp + '.name')
var targetName = eval(exp + '.name')
if(targetCcy != undefined && targetCcy !='' && this.dataModel.value.Ccy !== targetCcy){
this.iswarning = true;
......@@ -94,7 +94,7 @@ export default {
this.iswarning = false;
}
},
checkData() {
checkData:function() {
if (
this.orgData.Ccy === undefined ||
this.orgData.Ccy === null ||
......@@ -104,7 +104,7 @@ export default {
this.scale = this.options[0].scale
}
},
amountHandle() {
amountHandle:function() {
this.$root.$children[0].$children[0].$refs.form.validateField(
this.$parent._props.prop,
(errMsg) => {
......@@ -115,7 +115,7 @@ export default {
var maxValue = Decimal('999999999999.99')
const minValue = Decimal('0')
var tip = '999,999,999,999.99'
let value = inputValue.toFixed(this.scale, Decimal.ROUND_HALF_UP)
var value = inputValue.toFixed(this.scale, Decimal.ROUND_HALF_UP)
if (Ccy !== '' && Ccy !== undefined) {
if (Ccy == 'RAND' || Ccy == 'IDR' || Ccy == 'VND') {
maxValue = Decimal('9999999999999999.99')
......
......@@ -8,14 +8,14 @@ import MsgCodes from '../script/MsgCode';
import MsgJsonMap from '../script/MsgJson';
export default {
props: ['dataModel'],
data() {
data:function() {
return {
options: MsgCodes['BTCCombinations'],
selectedValues: this.initValues()
}
},
methods: {
initValues() {
initValues:function() {
const arry = [];
const tmpData = this.dataModel.value ? this.dataModel.value : this.dataModel.value = MsgJsonMap('BTCDomain');
arry.push(tmpData.cd);
......@@ -23,7 +23,7 @@ export default {
arry.push(tmpData.fmly.subFmlyCd);
return arry;
},
onChange() {
onChange:function() {
this.dataModel.value.cd = this.selectedValues[0];
this.dataModel.value.fmly.cd = this.selectedValues[1];
this.dataModel.value.fmly.subFmlyCd = this.selectedValues[2];
......
......@@ -100,7 +100,7 @@
import Balance from "../script/MsgJson/Balance"
export default {
props:['dataModel','options'],
data(){
data:function(){
return {
form: {
cdOrPrtry:"",
......@@ -128,7 +128,7 @@ export default {
this.$delete(this.node.value,index)
this.$delete(this.result,index)
},
changeHandler(){
changeHandler:function(){
if("1" === this.form.subTp){
this.form.subTpPrtry = ""
this.disabled1 = false
......@@ -140,7 +140,7 @@ export default {
this.disabled2 = false
}
},
submit(){
submit:function(){
var b = JSON.parse(JSON.stringify(this.form));
var c = JSON.parse(JSON.stringify(Balance));
c.tp.cdOrPrtry.cd = b.cdOrPrtry
......@@ -189,7 +189,7 @@ export default {
}
},
},
mounted(){
mounted:function(){
}
}
</script>
......
......@@ -242,7 +242,7 @@
import send from "../Service/post";
export default {
props:["mty"],
data() {
data:function() {
return {
dialogFormVisible: false,
fullScreen: false,
......@@ -279,35 +279,35 @@ export default {
},
methods: {
showDialog(){
showDialog:function(){
this.dialogFormVisible = true;
},
closeDialog(){
closeDialog:function(){
this.messageData = [];
this.dialogFormVisible = false;
this.dataValue = ["",""];
this.fullScreen = false;
this.contentheight = {height:"60vh"};
},
zoomIn(){
zoomIn:function(){
this.contentheight = {height:"85vh"}
this.fullScreen = !this.fullScreen;
},
zoomOut(){
zoomOut:function(){
this.contentheight = {height:"60vh"}
this.fullScreen = !this.fullScreen;
},
searchMessage(pageNo){
let dataValue1,dataValue2;
var dataValue1,dataValue2;
//DataPicker置空时,dataValue数组为空值,要重新将dataValue数组初始化为 ["",""];
this.dataValue = this.dataValue === null ? ["",""] : this.dataValue;
dataValue1 = this.dataValue[0];
//选择结束日期时,需要将时间置为当日最晚时间
dataValue2 = this.dataValue[1] === "" ? this.dataValue[1] : this.dataValue[1] + " 23:59:59";
//mty传入的值是前端选择报文+当前报文类型
let data = {
var data = {
mty:this.msgtyp + "|" + this.mty,
type: "rtgs",
ownref:this.ownref,
......
......@@ -8,13 +8,13 @@
import { computed } from 'vue';
export default {
props: ['dataModel', 'dateType'],
data() {
data:function() {
return {
viewFormat: this.dateType === 'datetime' ? 'yyyy-MM-dd HH:mm:ss' : 'yyyy-MM-dd',
valueFormat: this.dateType === 'datetime' ? 'yyyy-MM-ddTHH:mm:ss.SSS+08:00' : 'yyyy-MM-dd',
}
},
mounted() {
mounted:function() {
if (this.dateType=== 'datetime' && this.dataModel.status === 'M' && this.dataModel.defaultValue != 'disabled') {
this.$delete(this.dataModel, 'value');
this.$set(this.dataModel, 'value', this.$moment(new Date()).format("YYYY-MM-DDTHH:mm:ss.SSS+08:00"));
......
......@@ -5,7 +5,7 @@
<script>
export default {
props: ['dataModel'],
mounted(){
mounted:function(){
this.dataModel.value = this.dataModel.defaultValue
}
}
......
......@@ -35,7 +35,7 @@
<script>
export default {
props: ['dataModel', 'pattern'],
data() {
data:function() {
return {
dialogVisible: false,
inputData: '',
......@@ -46,7 +46,7 @@ export default {
}
},
methods: {
addData() {
addData:function() {
const data = this.inputData.trim();
if (data !== '' && !this.tipShow) {
this.tableData.push({ name: data });
......@@ -55,11 +55,11 @@ export default {
this.dialogVisible = false;
this.inputData = '';
},
validate() {
validate:function() {
this.tipShow = this.inputData.trim() !== '' && this.pattern && !new RegExp("^" + this.pattern + "$").test(this.inputData);
}
},
mounted() {
mounted:function() {
if(this.dataModel.value===null||this.dataModel.value===undefined){
if(this.dataModel.defaultValue != undefined){
const data = this.dataModel.defaultValue;
......
......@@ -9,12 +9,12 @@
export default {
props: ['dataModel', 'node'],
methods: {
exchangeChildren() {
exchangeChildren:function() {
const tmp = this.dataModel.children;
this.dataModel.children = this.dataModel._children;
this.dataModel._children = tmp;
},
switchChange() {
switchChange:function() {
this.exchangeChildren();
this.node.expanded = this.node.isLeaf;
}
......
......@@ -9,7 +9,7 @@
import { isNotEmpty } from '../script/Rule/BeanUtil';
export default {
props: ['options', 'dataModel'],
mounted(){
mounted:function(){
if(this.options.length ===1 && this.dataModel.status === 'M'){
console.log(this.options[0].label);
console.log(this.options[0].value);
......
......@@ -53,7 +53,7 @@ export default {
config: Object,
selectable: Function,
},
data() {
data:function() {
return {};
},
methods: {
......
......@@ -20,7 +20,7 @@
import send from "../Service/post";
export default {
props:["mty","obj","loginUser"],
data() {
data:function() {
return {
dialogFormVisible: false,
form: {
......@@ -38,17 +38,17 @@ import send from "../Service/post";
};
},
methods: {
showDialog(){
showDialog:function(){
this.dialogFormVisible = true;
},
closeDialog(){
closeDialog:function(){
this.$refs.form.resetFields();
this.dialogFormVisible = false;
},
saveTemplate(){
saveTemplate:function(){
this.$refs.form.validate( valid =>{
if(valid){
let data = {
var data = {
name:this.form.nam,
text:this.form.text,
loginUser:this.loginUser,
......
......@@ -15,13 +15,13 @@
<script>
export default {
props: ["dataModel", "dataType"],
data() {
data:function() {
return {
text: "",
};
},
computed: {
vpcPlaceholder() {
vpcPlaceholder:function() {
this.text = "Please enter " + this.dataModel.name;
return this.text;
},
......
......@@ -71,7 +71,7 @@ export default {
"s-table": Table,
},
props: ["dataModel", "dataType", "max"],
data() {
data:function() {
return {
text: "",
disabled: false,
......@@ -108,7 +108,7 @@ export default {
};
},
methods: {
generate() {
generate:function() {
console.log(this.dataModel);
if ("uetr" === this.dataModel.tag) {
this.generateUetr();
......@@ -123,41 +123,41 @@ export default {
"txId" === this.dataModel.tag ||
"cdtId" === this.dataModel.tag
) {
let id = this.generateRandomString(16);//适应后端改为16
var id = this.generateRandomString(16);//适应后端改为16
this.generateId(id);
}else if(
("id" === this.dataModel.tag && "16" === this.dataModel.maxLength) ||
("instrId" === this.dataModel.tag && "16" === this.dataModel.maxLength) ||
("cxlId" === this.dataModel.tag && "16" === this.dataModel.maxLength)
){
let id = this.generateRandomString(16);
var id = this.generateRandomString(16);
this.generateId(id);
}else if(
("id" === this.dataModel.tag && "4" === this.dataModel.maxLength)
){
let id = this.generateRandomString(4);
var id = this.generateRandomString(4);
this.generateId(id);
}
},
generateUetr() {
let uid = this.guid();
generateUetr:function() {
var uid = this.guid();
this.$set(this.dataModel, "value", uid);
},
generateId(id) {
generateId:function(id) {
this.$set(this.dataModel, "value", id);
},
generateRandomString(length) {
let result = "";
let characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
let charactersLength = characters.length;
for (let i = 0; i < length; i++) {
generateRandomString:function(length) {
var result = "";
var characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
var charactersLength = characters.length;
for (var i = 0; i < length; i++) {
result += characters.charAt(
Math.floor(Math.random() * charactersLength)
);
}
return result;
},
guid() {
guid:function() {
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(
/[xy]/g,
function (c) {
......@@ -168,8 +168,8 @@ export default {
);
},
// 获取弹框表格数据
async getbic() {
// let params = "";
getbic:function() {
// var params = "";
// if("bicfi" === this.dataModel.tag){
// params ={
// biccod: this.dataModel.value,
......@@ -181,7 +181,7 @@ export default {
// bicnam: this.dataModel.value,
// };
// }
// let res = await Api.post('/getBic', params);
// var res = await Api.post('/getBic', params);
// if (res.respCode == SUCCESS) {
// //etyDialog为弹窗
// this.root.$refs['etyDialog'].show = true;
......@@ -191,27 +191,27 @@ export default {
// },
// // 选中弹框表格的行数据
// async selectGridEtyPromptData(row) {
// let params = {
// var params = {
// ...row,
// };
// let res = await Api.post('/service/ptspta/fetch', params);
// var res = await Api.post('/service/ptspta/fetch', params);
// if (res.respCode == SUCCESS) {
// this.$set(this.model.bcdgrp, row.role.toLowerCase(), res.data);
// }
},
// 点击选择按钮
choose() {
choose:function() {
this.loadData();
this.allSelectedList = [];
this.dialogVisible = true;
}, // 点击选择弹窗的确定按钮
chooseConfirm() {
chooseConfirm:function() {
console.log(this.allSelectedList[0].bic);
this.$set(this.dataModel, "value", this.allSelectedList[0].bic);
this.dialogVisible = false;
}, // 加载数据
loadData(newPageConfig) {
loadData:function(newPageConfig) {
console.log(newPageConfig);
if (newPageConfig && newPageConfig.pageNum) {
this.tableConfig.pageConfig.pageNum = newPageConfig.pageNum;
......@@ -226,7 +226,7 @@ export default {
pageSize: this.tableConfig.pageConfig.pageSize,
};
send.getBic(data).then((res) => {
let data = res.data;
var data = res.data;
console.log(res);
this.tableData = data.accountList;
this.tableConfig.pageConfig.total = data.total;
......@@ -248,11 +248,11 @@ export default {
},
// 改变多选列的选中状态时,更新选中列表
selectionChange(pageSelectedList) {
selectionChange:function(pageSelectedList) {
this.allSelectedList = pageSelectedList;
},
},
mounted() {
mounted:function() {
if("bicfi" === this.dataModel.tag){
this.loadData();
}
......@@ -262,7 +262,7 @@ export default {
if ("HKICHKHHXXX"===this.dataModel.headBic) {
this.$set(this.dataModel, "value", "HKICHKHHXXX");
}
let smhinr = this.$route.query.smhinr;
var smhinr = this.$route.query.smhinr;
if (smhinr != undefined && smhinr != null) {
// if (
// "bizMsgIdr" === this.dataModel.tag ||
......@@ -281,7 +281,7 @@ export default {
// this.text = "业务编号已自动生成"
if (smhinr === undefined || smhinr === null) {
this.showSpan = true;
let id = window.sessionStorage.getItem("id");
var id = window.sessionStorage.getItem("id");
if (id != null || id != undefined) {
this.dataModel.defaultValue = this.generateId(id);
} else {
......@@ -305,7 +305,7 @@ export default {
) {
this.active = true;
this.showSpan = true;
let id = window.sessionStorage.getItem("id");
var id = window.sessionStorage.getItem("id");
if (id != null || id != undefined) {
this.dataModel.defaultValue = this.generateId(id);
} else {
......@@ -326,7 +326,15 @@ export default {
this.active = true;
this.showSpan = true;
} else if("1" === this.dataModel.iscips){
this.$set(this.dataModel, 'value', "C"+this.$moment(new Date()).format("YYYYMMDDHHmmssSSS"));
// this.$set(this.dataModel, 'value', "C"+this.$moment(new Date()).format("YYYYMMDDHHmmssSSS"));
var msgid = window.sessionStorage.getItem("msgid");
if (msgid != null || msgid != undefined) {
this.dataModel.defaultValue = this.generateId(msgid);
} else {
msgid = this.$moment(new Date()).format("YYYYMMDDHHmm")+this.generateRandomString(6);//cips报文标识号
this.dataModel.defaultValue = this.generateId(msgid);
window.sessionStorage.setItem("msgid", msgid);
}
console.log("MsgId:"+this.dataModel.value);
}
if (this.dataModel.defaultValue !== undefined) {
......@@ -346,14 +354,14 @@ export default {
this.disabled = this.dataModel.unable || this.dataModel.disabled;
},
computed: {
vpcPlaceholder() {
vpcPlaceholder:function() {
this.text = "Please enter " + this.dataModel.name;
return this.text;
},
},
watch: {
"dataModel.disabled": {
handler(n, o) {
handler:function(n, o) {
this.disabled = this.dataModel.unable || n;
if("id" === this.dataModel.tag){
if(true === this.disabled){
......
<template>
<!-- <el-menu class="el-menu-demo" mode="horizontal">
<el-submenu index="1">
<template slot="title">CBPR+ Manual mirroring packet</template>
<div v-for="(item, i) in messageTypeCodes">
<el-menu-item><router-link :to="'/iso/'+item.value">{{item.label}}</router-link></el-menu-item>
</div>
</el-submenu>
<el-submenu index="2">
<template slot="title">RTGS Manual mirroring packet</template>
<div v-for="(item, i) in messageTypeCodesRtgs">
<el-menu-item><router-link :to="'/rtgs/'+item.value">{{item.label}}</router-link></el-menu-item>
</div>
</el-submenu> -->
<!-- <el-submenu index="3">
<template slot="title">SWIFT报文中央格转器</template>
<el-menu-item index="3-1"><router-link to="/mx2mt">MX转MT</router-link></el-menu-item>
<el-menu-item index="3-2"><router-link to="/mt2mx">MT转MX</router-link></el-menu-item>
</el-submenu> -->
<!-- </el-menu> -->
<el-row>
<!-- <el-col :span="3"></el-col> -->
<el-col :span="18" :offset="3">
<el-tabs v-model="activeName" type="card">
<!--
<el-tab-pane label="RTGS Manual mirroring packet" name="first">
<el-input v-model="inputRtgs" placeholder="Input message type for quick screening" @input="searchRtgsMessageByType"></el-input>
<el-table
:data="messageTypeCodesRtgs.filter((v) => v.isShow == true)"
:show-header="false"
style="width: 100%">
<el-table-column>
<template slot-scope="scope">
<router-link :to="'/rtgs/'+scope.row.value+`/${loginUser}`">{{"Create " + scope.row.value + " " + scope.row.label}}</router-link>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
-->
<el-tab-pane label="CBPR+ Manual mirroring packet" name="second">
<el-input v-model="inputCbprPlus" placeholder="Input message type for quick screening" @input="searchCbprPlusMessageByType"></el-input>
<el-table
......@@ -52,7 +17,6 @@
</el-tab-pane>
</el-tabs>
</el-col>
<!-- <el-col :span="3"></el-col> -->
</el-row>
</template>
......@@ -60,7 +24,7 @@
import MsgCodes from './script/MsgCode';
export default {
data() {
data:function() {
return {
messageTypeCodes : MsgCodes['messageTypeCode'],
messageTypeCodesRtgs : MsgCodes['messageTypeCodeRtgs'],
......@@ -71,9 +35,9 @@ export default {
}
},
methods:{
searchCbprPlusMessageByType(){
let icp = this.inputCbprPlus;
for(let mess of this.messageTypeCodes){
searchCbprPlusMessageByType:function(){
var icp = this.inputCbprPlus;
for(var mess of this.messageTypeCodes){
if(icp != null || icp != undefined){
console.log(mess.value.indexOf(icp));
console.log(mess.value);
......@@ -85,9 +49,9 @@ export default {
mess.isShow = true;
}
},
searchRtgsMessageByType(){
let ir = this.inputRtgs;
for(let mess of this.messageTypeCodesRtgs){
searchRtgsMessageByType:function(){
var ir = this.inputRtgs;
for(var mess of this.messageTypeCodesRtgs){
if(ir != null || ir != undefined){
if(mess.value.indexOf(ir) != -1)
mess.isShow = true;
......@@ -98,12 +62,12 @@ export default {
}
}
},
mounted(){
mounted:function(){
//点击goBack,返回刷新页面
this.searchCbprPlusMessageByType();
this. searchRtgsMessageByType();
},
created(){
created:function(){
console.log(this.loginUser);
}
}
......
......@@ -60,7 +60,7 @@
import MsgCodes from './script/MsgCode';
export default {
data() {
data:function() {
return {
CIPSmessageTypeCodes : MsgCodes['CIPSmessageTypeCode'],
activeName: 'second',
......@@ -70,11 +70,11 @@ export default {
}
},
methods:{
searchCIPSPlusMessageByType(){
let icp = this.inputCbprPlus;
searchCIPSPlusMessageByType:function(){
var icp = this.inputCbprPlus;
console.log(this.CIPSmessageTypeCodes);
console.log("icp:"+icp);
for(let mess of this.CIPSmessageTypeCodes){
for(var mess of this.CIPSmessageTypeCodes){
if(icp != null || icp != undefined){
console.log(mess.value.indexOf(icp));
console.log(mess.value);
......@@ -88,11 +88,11 @@ export default {
},
},
mounted(){
mounted:function(){
//点击goBack,返回刷新页面
this.searchCIPSPlusMessageByType();
},
created(){
created:function(){
console.log(this.loginUser);
}
}
......
......@@ -18,7 +18,7 @@
<script>
import send from "../Service/post";
export default {
data() {
data:function() {
return {
message: "",
mxmessage: "",
......@@ -28,7 +28,7 @@ export default {
};
},
methods: {
TxtListener() {
TxtListener:function() {
var box = document.getElementById("box");
var myTextarea = document.getElementById("myTextarea");
......@@ -75,7 +75,7 @@ export default {
false
);
},
change() {
change:function() {
this.message = document.getElementById("myTextarea").value;
send.mt2mx({mtMsg:this.message})
.then((res) => {
......@@ -90,7 +90,7 @@ export default {
});;
},
},
mounted() {
mounted:function() {
this.TxtListener();
},
};
......
......@@ -32,7 +32,7 @@
<script>
import send from "../Service/post";
export default {
data() {
data:function() {
return {
message: "",
mtmessage: "",
......@@ -44,7 +44,7 @@ export default {
};
},
methods: {
TxtListener() {
TxtListener:function() {
var box = document.getElementById("box");
var myTextarea = document.getElementById("myTextarea");
......@@ -91,7 +91,7 @@ export default {
false
);
},
change() {
change:function() {
this.message = document.getElementById("myTextarea").value;
this.data = { xml: this.message };
send.mxType(this.data).then((res) => {
......@@ -117,7 +117,7 @@ export default {
});
});;
},
sure() {
sure:function() {
this.dialogFormVisible = false;
this.data = { xml: this.message, mtType: this.form.mtType };
//console.log(this.data)
......@@ -132,7 +132,7 @@ export default {
});;
},
},
mounted() {
mounted:function() {
this.TxtListener();
},
};
......
......@@ -6,7 +6,7 @@
export default {
components: {},
props: {},
data() {
data:function() {
return {
loginUser: this.$route.query.loginUser,
};
......@@ -14,7 +14,7 @@ export default {
watch: {},
computed: {},
methods: {
toHome() {
toHome:function() {
this.$router.push({
path: "/",
query: {
......@@ -23,10 +23,10 @@ export default {
});
},
},
created() {
created:function() {
console.log(this.loginUser);
},
mounted() {}
mounted:function() {}
};
</script>
<style scoped>
......
......@@ -6,7 +6,7 @@
export default {
components: {},
props: {},
data() {
data:function() {
return {
loginUser: this.$route.query.loginUser,
};
......@@ -14,7 +14,7 @@ export default {
watch: {},
computed: {},
methods: {
toHome() {
toHome:function() {
this.$router.push({
path: "/cips",
query: {
......@@ -23,10 +23,10 @@ export default {
});
},
},
created() {
created:function() {
console.log(this.loginUser);
},
mounted() {}
mounted:function() {}
};
</script>
<style scoped>
......
......@@ -13866,12 +13866,12 @@ const MsgCodes = {
label2: "Notification To Receive",
isShow: true,
},
{
value: "camt.060.001.05",
label: "Account Reporting Request",
label2: "Account Reporting Request",
isShow: true,
},
// {
// value: "camt.060.001.05",
// label: "Account Reporting Request",
// label2: "Account Reporting Request",
// isShow: true,
// },
{
value: "pacs.004.001.09",
label: "Payment Return",
......@@ -13884,24 +13884,24 @@ const MsgCodes = {
label2: "FI To FI Payment Status Report",
isShow: true,
},
{
value: "pacs.010.001.03",
label: "Interbank Direct Debit",
label2: "Interbank Direct Debit",
isShow: true,
},
{
value: "pain.001.001.09",
label: "Customer Credit Transfer Initiation",
label2: "Customer Credit Transfer Initiation",
isShow: true,
},
{
value: "pain.002.001.10",
label: "Customer Payment Status Report",
label2: "Customer Payment Status Report",
isShow: true,
},
// {
// value: "pacs.010.001.03",
// label: "Interbank Direct Debit",
// label2: "Interbank Direct Debit",
// isShow: true,
// },
// {
// value: "pain.001.001.09",
// label: "Customer Credit Transfer Initiation",
// label2: "Customer Credit Transfer Initiation",
// isShow: true,
// },
// {
// value: "pain.002.001.10",
// label: "Customer Payment Status Report",
// label2: "Customer Payment Status Report",
// isShow: true,
// },
],
messageTypeCodeRtgs: [
// {
......
......@@ -7,7 +7,7 @@ import {
} from "./MsgValidator";
import MsgCodes from "./MsgCode";
export default function msgComRender(node) {
let renderObj = {};
var renderObj = {};
const data = node.data;
const msgTyp = data.type;
if (msgTyp !== undefined) {
......
export function appendTreeChild(nodeArry) {
const json = {};
const keySet = new Set();
for (let node of nodeArry) {
for (var node of nodeArry) {
if (keySet.has(node.tag) || node.array) {
let tmpNewNode = {};
var tmpNewNode = {};
genJsonNode(tmpNewNode, node);
if (!Array.isArray(json[node.tag])) {
let tmpOrgNode = json[node.tag];
var tmpOrgNode = json[node.tag];
json[node.tag] = [];
if (tmpOrgNode !== undefined) {
json[node.tag].push(tmpOrgNode);
......@@ -31,7 +31,7 @@ function genJsonNode(newJson, orgJson) {
newJson[orgJson.tag] = "";
} else if (Array.isArray(orgJson.value)) {
const arry = [];
for (let aEle of orgJson.value) {
for (var aEle of orgJson.value) {
arry.push(...Object.values(aEle));
}
newJson[orgJson.tag] = arry;
......@@ -76,7 +76,7 @@ function isEmpty(object) {
export function hasMandatoryChildNode(childNodeArry) {
if (childNodeArry) {
for (let node of childNodeArry) {
for (var node of childNodeArry) {
if (node.status === "M") {
return true;
}
......@@ -86,7 +86,7 @@ export function hasMandatoryChildNode(childNodeArry) {
export function isEmptyMsg(json) {
if (Array.isArray(json)) {
for (let js of json) {
for (var js of json) {
if (!isEmptyMsg(js)) {
return false;
}
......@@ -114,14 +114,14 @@ export function isEmptyMsg(json) {
function isEmptyJson(json) {
if (Array.isArray(json)) {
for (let js of json) {
for (var js of json) {
if (!isEmptyJson(js)) {
return false;
}
}
return true;
} else if (Object.prototype.toString.call(json) === "[object Object]") {
for (let js of Object.values(json)) {
for (var js of Object.values(json)) {
if (!isEmptyJson(js)) {
return false;
}
......@@ -136,7 +136,7 @@ function isEmptyJson(json) {
export function clearMsgValue(data, isValue) {
if (isValue) {
for (let key in data) {
for (var key in data) {
if (Object.prototype.toString.call(data[key]) === "[object Object]") {
clearMsgValue(data[key], true);
} else if (typeof data[key] === "string") {
......@@ -156,7 +156,7 @@ export function clearMsgValue(data, isValue) {
//已封装的深拷贝函数
export function deepClone(obj = {}, hashMap = new WeakMap()) {
//变量先置空
let objClone = null,
var objClone = null,
hashKey = hashMap.get(obj);
if (obj instanceof RegExp) return new RegExp(obj); //正则表达式的情况
if (obj instanceof Date) return new Date(obj); //日期对象的情况
......
......@@ -1088,7 +1088,7 @@ name:"日间夜间标志",
label:"BusinessPhase",
tag:"BizPhs",
type:"Select#BizPhaseTypeCode",
status:"O",
status:"M",
},
],
},
......
......@@ -765,7 +765,7 @@ name:"日间夜间标志",
label:"BusinessPhase",
tag:"BizPhs",
type:"Select#BizPhaseTypeCode",
status:"O",
status:"M",
},
],
},
......
export function appendTreeChild(nodeArry) {
const json = {};
const keySet = new Set();
for (let node of nodeArry) {
for (var node of nodeArry) {
if (keySet.has(node.tag) || node.array) {
let tmpNewNode = {};
var tmpNewNode = {};
genJsonNode(tmpNewNode, node);
if (!Array.isArray(json[node.tag])) {
let tmpOrgNode = json[node.tag];
var tmpOrgNode = json[node.tag];
json[node.tag] = [];
if (tmpOrgNode !== undefined) {
json[node.tag].push(tmpOrgNode);
......@@ -30,7 +30,7 @@ function genJsonNode(newJson, orgJson) {
newJson[orgJson.tag] = "";
} else if (Array.isArray(orgJson.value)) {
const arry = [];
for (let aEle of orgJson.value) {
for (var aEle of orgJson.value) {
arry.push(...Object.values(aEle));
}
newJson[orgJson.tag] = arry;
......@@ -75,7 +75,7 @@ function isEmpty(object) {
export function hasMandatoryChildNode(childNodeArry) {
if (childNodeArry) {
for (let node of childNodeArry) {
for (var node of childNodeArry) {
if (node.status === "M") {
return true;
}
......@@ -85,7 +85,7 @@ export function hasMandatoryChildNode(childNodeArry) {
export function isEmptyMsg(json) {
if (Array.isArray(json)) {
for (let js of json) {
for (var js of json) {
if (!isEmptyMsg(js)) {
return false;
}
......@@ -111,14 +111,14 @@ export function isEmptyMsg(json) {
function isEmptyJson(json) {
if (Array.isArray(json)) {
for (let js of json) {
for (var js of json) {
if (!isEmptyJson(js)) {
return false;
}
}
return true;
} else if (Object.prototype.toString.call(json) === "[object Object]") {
for (let js of Object.values(json)) {
for (var js of Object.values(json)) {
if (!isEmptyJson(js)) {
return false;
}
......@@ -133,7 +133,7 @@ function isEmptyJson(json) {
export function clearMsgValue(data, isValue) {
if (isValue) {
for (let key in data) {
for (var key in data) {
if (Object.prototype.toString.call(data[key]) === "[object Object]") {
clearMsgValue(data[key], true);
} else if (typeof data[key] === "string") {
......@@ -152,8 +152,8 @@ export function clearMsgValue(data, isValue) {
}
export function fillTreeValue(jsonArray, map) {
for (let job of jsonArray) {
for (let key of map.keys()) {
for (var job of jsonArray) {
for (var key of map.keys()) {
alert(key);
if (
job.tag === key &&
......@@ -171,7 +171,7 @@ export function fillTreeValue(jsonArray, map) {
//已封装的深拷贝函数
export function deepClone(obj = {}, hashMap = new WeakMap()) {
//变量先置空
let objClone = null,
var objClone = null,
hashKey = hashMap.get(obj);
if (obj instanceof RegExp) return new RegExp(obj); //正则表达式的情况
if (obj instanceof Date) return new Date(obj); //日期对象的情况
......
......@@ -24,9 +24,9 @@ export function amountValidator(isM, desc, sca) {
}
} else {
//包含小数点
let valueArray = amtValue.split(".");
let integerNumber = valueArray[0].length;
let decimalNumber = valueArray[1].length;
var valueArray = amtValue.split(".");
var integerNumber = valueArray[0].length;
var decimalNumber = valueArray[1].length;
if (decimalNumber > fractionDig) {
callback(new Error("The decimal place cannot exceed" + fractionDig));
} else if (integerNumber + decimalNumber > totalDig) {
......@@ -65,9 +65,9 @@ export function amountCIPSValidator(isM, desc, sca) {
}
} else {
//包含小数点
let valueArray = amtValue.split(".");
let integerNumber = valueArray[0].length;
let decimalNumber = valueArray[1].length;
var valueArray = amtValue.split(".");
var integerNumber = valueArray[0].length;
var decimalNumber = valueArray[1].length;
if (decimalNumber > fractionDig) {
callback(new Error("The decimal place cannot exceed" + fractionDig));
} else if (integerNumber + decimalNumber > totalDig) {
......@@ -97,9 +97,9 @@ export function numberValidator(totalDig, fractionDig) {
}
} else {
//包含小数点
let valueArray = value.split(".");
let integerNumber = valueArray[0].length;
let decimalNumber = valueArray[1].length;
var valueArray = value.split(".");
var integerNumber = valueArray[0].length;
var decimalNumber = valueArray[1].length;
if (decimalNumber > fractionDig) {
callback(new Error("The decimal place cannot exceed" + fractionDig));
} else if (integerNumber + decimalNumber > totalDig) {
......
......@@ -4,11 +4,11 @@ export function isEmpty(obj) {
export function isNotEmpty(obj) {
for (var i in obj) {
let value = obj[i];
var value = obj[i];
if (typeof value === 'object') {
if (Array.isArray(value)) {
if (value.length != 0) {
for (let index = 0; index < value.length; index++) {
for (var index = 0; index < value.length; index++) {
const element = value[index];
isNotEmpty(element);
}
......
......@@ -25,8 +25,8 @@ export default function validator(obj) {
//收款人名称、收款人地址必须有一个存在
function CIPS_Creditor(cdtr,position) {
const msg = "* 收款人名称、收款人地址必须有一个存在";
let nm = cdtr.Nm;
let adrLine = cdtr.AdrLine;
var nm = cdtr.Nm;
var adrLine = cdtr.AdrLine;
if(isEmpty(nm) && isEmpty(adrLine)){
message(position,msg);
......@@ -35,11 +35,11 @@ function CIPS_Creditor(cdtr,position) {
return true;
}
//汇款人名称、汇款人地址必须有一个存在
//付款人名称、付款人地址必须有一个存在
function CIPS_Dbtr(cdtr,position) {
const msg = "* 汇款人名称、汇款人地址必须有一个存在";
let nm = cdtr.Nm;
let adrLine = cdtr.AdrLine;
const msg = "* 付款人名称、付款人地址必须有一个存在";
var nm = cdtr.Nm;
var adrLine = cdtr.AdrLine;
if(isEmpty(nm) && isEmpty(adrLine)){
message(position,msg);
......@@ -51,8 +51,8 @@ function CIPS_Dbtr(cdtr,position) {
//收款人开户行行号、名称必须有一个存在
function CIPS_CdtrAgt(cdtr,position) {
const msg = "* 收款人开户行行号、名称必须有一个存在";
let mmbId = cdtr.FinInstnId.ClrSysMmbId.MmbId;
let nm = cdtr.FinInstnId.Nm;
var mmbId = cdtr.FinInstnId.ClrSysMmbId.MmbId;
var nm = cdtr.FinInstnId.Nm;
if(isEmpty(nm) && isEmpty(mmbId)){
message(position,msg);
......@@ -61,11 +61,11 @@ function CIPS_CdtrAgt(cdtr,position) {
return true;
}
//款人开户行行号、名称必须有一个存在
//款人开户行行号、名称必须有一个存在
function CIPS_DbtrAgt(cdtr,position) {
const msg = "* 款人开户行行号、名称必须有一个存在";
let mmbId = cdtr.FinInstnId.ClrSysMmbId.MmbId;
let nm = cdtr.FinInstnId.Nm;
const msg = "* 款人开户行行号、名称必须有一个存在";
var mmbId = cdtr.FinInstnId.ClrSysMmbId.MmbId;
var nm = cdtr.FinInstnId.Nm;
if(isEmpty(nm) && isEmpty(mmbId)){
message(position,msg);
......
......@@ -28,9 +28,9 @@ export default function validator(obj) {
//如果CopyDuplicate存在,那么Related必须存在。
function r1(obj){
const position = "Credit Transfer Transaction Information/CopyDuplicate";
let msg = "If CopyDuplicate is present, then Related MUST be present.";
let cpyDplct = obj.cpyDplct;
let rltd = obj.rltd;
var msg = "If CopyDuplicate is present, then Related MUST be present.";
var cpyDplct = obj.cpyDplct;
var rltd = obj.rltd;
if (isNotEmpty(cpyDplct)) {
if (isEmpty(rltd)) {
message(position,msg);
......
......@@ -19,9 +19,9 @@ export default function validator(obj) {
return false;
}
let ntry = obj.rpt.ntry;
var ntry = obj.rpt.ntry;
if (isNotEmpty(ntry)) {
for (let index = 0; index < ntry.length; index++) {
for (var index = 0; index < ntry.length; index++) {
const element = ntry[index];
//r15
if (!CBPR_Charges_TextualRule(element.chrgs, `Report/Entry[` + (index + 1) + `]/Charges`)) {
......@@ -31,8 +31,8 @@ export default function validator(obj) {
if (!CBPR_Interest_TextualRule(element.intrst, `Report/Entry[` + (index + 1) + `]/Interest`)) {
return false;
}
let ntryDtls = element.ntryDtls;
for (let idx = 0; idx < ntryDtls.length; idx++) {
var ntryDtls = element.ntryDtls;
for (var idx = 0; idx < ntryDtls.length; idx++) {
//r19
if (!CBPR_Charges_TextualRule(ntryDtls[idx].txDtls == undefined ? null : ntryDtls[idx].txDtls.chrgs, `Entry[` + (index + 1) + `]/Entry Details[` + (idx + 1) + `]/Transaction Details/Charges`)) {
return false;
......@@ -100,7 +100,7 @@ function CBPR_Business_Service_TextualRule() {
function CBPR_Business_Service_Usage_TextualRule(obj) {
const position = "Business Service";
const msg = "The value 'swift.cbprplus.02' must be used.";
let bizSvc = obj.bizSvc;
var bizSvc = obj.bizSvc;
if (bizSvc != 'swift.cbprplus.02') {
message(position, msg);
return false;
......@@ -146,8 +146,8 @@ function CBPR_Copy_Duplicate_Indicator_TextualRule() {
function CBPR_Party_Name_Postal_Address_FormalRule(PartyIdentification) {
const msg = "If Postal Address is present then Name is mandatory.";
const position = "Report/Account/Owner";
let nm = PartyIdentification.nm;
let pstlAdr = PartyIdentification.pstlAdr;
var nm = PartyIdentification.nm;
var pstlAdr = PartyIdentification.pstlAdr;
if (isNotEmpty(pstlAdr)) {
if (isEmpty(nm)) {
message(position, msg);
......@@ -173,11 +173,11 @@ function CBPR_Domain_Proprietary_Recommendation_TextualRule() {
function CBPR_Charges_TextualRule(obj, position) {
const msg = "Total Charges And Tax Amount must equal the sum of the individual record amounts.";
if (isNotEmpty(obj)) {
let totalamount = Decimal(obj.ttlChrgsAndTaxAmt.value);
let record = obj.rcrd;
var totalamount = Decimal(obj.ttlChrgsAndTaxAmt.value);
var record = obj.rcrd;
if (isNotEmpty(record)) {
let recordamount = new Decimal(0.00);
for (let index = 0; index < record.length; index++) {
var recordamount = new Decimal(0.00);
for (var index = 0; index < record.length; index++) {
recordamount = recordamount.add(new Decimal(record[index].amt.value));
}
if (totalamount.comparedTo(recordamount.toNumber()) != 0) {
......@@ -193,11 +193,11 @@ function CBPR_Charges_TextualRule(obj, position) {
function CBPR_Interest_TextualRule(obj, position) {
const msg = "Total Charges And Tax Amount must equal the sum of the individual record amounts.";
if (isNotEmpty(obj)) {
let totalamount = Decimal(obj.ttlIntrstAndTaxAmt.value);
let record = obj.rcrd;
var totalamount = Decimal(obj.ttlIntrstAndTaxAmt.value);
var record = obj.rcrd;
if (isNotEmpty(record)) {
let recordamount = new Decimal(0.00);
for (let index = 0; index < record.length; index++) {
var recordamount = new Decimal(0.00);
for (var index = 0; index < record.length; index++) {
recordamount = recordamount.add(new Decimal(record[index].amt.value));
}
if (totalamount.comparedTo(recordamount.toNumber()) != 0) {
......@@ -213,7 +213,7 @@ function CBPR_Interest_TextualRule(obj, position) {
function CBPR_Original_Instruction_Identification_FormalRule(obj, position) {
const msg = "This field must not start or end with a slash '/' and must not contain two consecutive slashes '//'.";
if (isNotEmpty(obj)) {
let instrId = obj.instrId;
var instrId = obj.instrId;
if (isNotEmpty(instrId)) {
if (instrId.startsWith('/') || instrId.endsWith("/") || instrId.indexOf("//") >= 0) {
message(position, msg);
......
......@@ -12,18 +12,18 @@ export default function validator(obj) {
return false;
}
let bal = obj.rpt.bal;
var bal = obj.rpt.bal;
if (isNotEmpty(bal)) {
for (let index = 0; index < bal.length; index++) {
for (var index = 0; index < bal.length; index++) {
const element = bal[index];
if (!r13(element)) {
return false;
}
}
}
let ttlNtriesPerBkTxCd = obj.rpt.txsSummry.ttlNtriesPerBkTxCd;
var ttlNtriesPerBkTxCd = obj.rpt.txsSummry.ttlNtriesPerBkTxCd;
if(isNotEmpty(ttlNtriesPerBkTxCd)){
for (let i = 0; index < ttlNtriesPerBkTxCd.length; i++) {
for (var i = 0; index < ttlNtriesPerBkTxCd.length; i++) {
if (!r14(ttlNtriesPerBkTxCd[i].bkTxCd, `Transactions Summary/Total Entries Per Bank Transaction Code[` + (i + 1) + `]/Bank Transaction Code`)) {
return false;
}
......@@ -33,9 +33,9 @@ export default function validator(obj) {
}
}
let ntry = obj.rpt.ntry;
var ntry = obj.rpt.ntry;
if (isNotEmpty(ntry)) {
for (let index = 0; index < ntry.length; index++) {
for (var index = 0; index < ntry.length; index++) {
const element = ntry[index];
if (!r14(element.bkTxCd, `Report/Entry[` + (index + 1) + `]/Bank Transaction Code`)) {
return false;
......@@ -43,9 +43,9 @@ export default function validator(obj) {
if (!r15(element.bkTxCd.domn.fmly, `Report/Entry[` + (index + 1) + `]/Bank Transaction Code`)) {
return false;
}
let ntryDtls = element.ntryDtls;
var ntryDtls = element.ntryDtls;
if (isNotEmpty(ntryDtls)) {
for (let idx = 0; idx < ntryDtls.length; idx++) {
for (var idx = 0; idx < ntryDtls.length; idx++) {
if (!r14(ntryDtls[idx].txDtls.bkTxCd, `Report/Entry[` + (index + 1) + `]/Entry Details[` + (idx + 1) + `]/Transaction Details/Bank Transaction Code`)) {
return false;
}
......@@ -83,9 +83,9 @@ export default function validator(obj) {
// 如果CopyDuplicate存在,那么Related必须存在。
function r1(obj) {
const position = "Credit Transfer Transaction Information/CopyDuplicate";
let msg = "If CopyDuplicate is present, then Related MUST be present.";
let cpyDplct = obj.cpyDplct;
let rltd = obj.rltd;
var msg = "If CopyDuplicate is present, then Related MUST be present.";
var cpyDplct = obj.cpyDplct;
var rltd = obj.rltd;
if (isNotEmpty(cpyDplct)) {
if (isEmpty(rltd)) {
message(position, msg);
......@@ -164,7 +164,7 @@ function r13(obj) {
const msg = "If Type is equal to ForwardAvailable, Availability is not allowed.";
const position = "Report/Balance/Type";
if (isNotEmpty(obj)) {
let type = obj.tp.cdOrPrtry.cd;
var type = obj.tp.cdOrPrtry.cd;
if (isNotEmpty(type)) {
if (type == 'FWAV') {
if (isNotEmpty(obj.avlbty)) {
......
......@@ -37,17 +37,17 @@ export default function validator(obj) {
return false;
}
let ntry = obj.stmt.ntry;
var ntry = obj.stmt.ntry;
if (isNotEmpty(ntry)) {
for (let index = 0; index < ntry.length; index++) {
for (var index = 0; index < ntry.length; index++) {
const element = ntry[index];
//r23
if (!CBPR_Charges_TextualRule(element.chrgs, `Statement/Entry[` + (index + 1) + `]/Charges`)) {
return false;
}
let ntryDtls = element.ntryDtls;
var ntryDtls = element.ntryDtls;
if (isNotEmpty(ntryDtls)) {
for (let idx = 0; idx < ntryDtls.length; idx++) {
for (var idx = 0; idx < ntryDtls.length; idx++) {
//r26
if (!CBPR_Charges_TextualRule(ntryDtls[idx].txDtls.chrgs, `Statement/Entry[` + (index + 1) + `]/Entry Details[` + (idx + 1) + `]/Transaction Details/Charges`)) {
return false;
......@@ -113,7 +113,7 @@ function CBPR_Business_Service_TextualRule() {
function CBPR_Business_Service_Usage_TextualRule(obj) {
const position = "Business Service";
const msg = "The value 'swift.cbprplus.02' must be used.";
let bizSvc = obj.bizSvc;
var bizSvc = obj.bizSvc;
if (bizSvc != 'swift.cbprplus.02') {
message(position, msg);
return false;
......@@ -175,13 +175,13 @@ function CBPR_Electronique_Or_Legal_Sequence_Number_FormalRule(obj) {
//r13 如果PageNumber = 1,那么必须有且只有一个Balance/Type/CodeOrProprietary/Code的值为“OPBD”,如果存在Balance/Type/SubType/Code,则值必须与“INTM”不同。
function CBPR_Page_Number_1_FormalRule(obj) {
const msg = "If PageNumber = 1 then there must be one and only one occurrence of Balance/Type/CodeOrProprietary/Code with value 'OPBD' and if Balance/Type/SubType/Code is present, value must be different from 'INTM'.";
let position = "Balance/Type/CodeOrProprietary/Code";
var position = "Balance/Type/CodeOrProprietary/Code";
if (isNotEmpty(obj)) {
if (obj.stmtPgntn.pgNb == '1') {
let bal = obj.bal;
let count = 0;
var bal = obj.bal;
var count = 0;
if (isNotEmpty(bal)) {
for (let index = 0; index < bal.length; index++) {
for (var index = 0; index < bal.length; index++) {
const element = bal[index];
if (element.tp.cdOrPrtry.cd == 'OPBD') {
if (isNotEmpty(element.tp.subTp)) {
......@@ -206,13 +206,13 @@ function CBPR_Page_Number_1_FormalRule(obj) {
//r14 如果PageNumber > 1,那么必须有且只有一个Balance/Type/CodeOrProprietary/Code的值为“OPBD”,并且Balance/Type/SubType/Code =“INTM”。
function CBPR_Page_Number_2_FormalRule(obj) {
const msg = "If PageNumber > 1 then there must be one and only one occurrence of Balance/Type/CodeOrProprietary/Code with value 'OPBD' and with Balance/Type/SubType/Code = 'INTM'. ";
let position = "Balance/Type/CodeOrProprietary/Code";
var position = "Balance/Type/CodeOrProprietary/Code";
if (isNotEmpty(obj)) {
if (Number(obj.stmtPgntn.pgNb) > 1) {
let bal = obj.bal;
let count = 0;
var bal = obj.bal;
var count = 0;
if (isNotEmpty(bal)) {
for (let index = 0; index < bal.length; index++) {
for (var index = 0; index < bal.length; index++) {
const element = bal[index];
if (element.tp.cdOrPrtry.cd == 'OPBD') {
if (isNotEmpty(element.tp.subTp)) {
......@@ -235,12 +235,12 @@ function CBPR_Page_Number_2_FormalRule(obj) {
//r15 如果LastPageIndicator为“True”,则必须有且只有一个Balance/Type/CodeOrProprietary/Code出现值为“CLBD”,如果Balance/Type/SubType/Code存在,则值必须与“INTM”不同。
function CBPR_Last_Page_Indicator_1_FormalRule(obj) {
const msg = "If LastPageIndicator is 'True' then there must be one and only one occurrence of Balance/Type/CodeOrProprietary/Code with value 'CLBD' and if Balance/Type/SubType/Code is present, value must be different from 'INTM'.";
let position = "Balance/Type/CodeOrProprietary/Code";
var position = "Balance/Type/CodeOrProprietary/Code";
if (obj.stmtPgntn.lastPgInd == "true") {
let bal = obj.bal;
let count = 0;
var bal = obj.bal;
var count = 0;
if (isNotEmpty(bal)) {
for (let index = 0; index < bal.length; index++) {
for (var index = 0; index < bal.length; index++) {
const element = bal[index];
if (element.tp.cdOrPrtry.cd == 'CLBD') {
if (isNotEmpty(element.tp.subTp)) {
......@@ -265,12 +265,12 @@ function CBPR_Last_Page_Indicator_1_FormalRule(obj) {
//r16 如果LastPageIndicator为“False”,则必须有且只有一次Balance/Type/CodeOrProprietary/Code的值为“CLBD”,并且Balance/Type/SubType/Code =“INTM”。
function CBPR_Last_Page_Indicator_2_FormalRule(obj) {
const msg = "If LastPageIndicator is 'False' then there must be one and only one occurrence of Balance/Type/CodeOrProprietary/Code with value 'CLBD' and with Balance/Type/SubType/Code = 'INTM'.";
let position = "Balance/Type/CodeOrProprietary/Code";
var position = "Balance/Type/CodeOrProprietary/Code";
if (obj.stmtPgntn.lastPgInd == "false") {
let bal = obj.bal;
let count = 0;
var bal = obj.bal;
var count = 0;
if (isNotEmpty(bal)) {
for (let index = 0; index < bal.length; index++) {
for (var index = 0; index < bal.length; index++) {
const element = bal[index];
if (element.tp.cdOrPrtry.cd == 'CLBD') {
if (isNotEmpty(element.tp.subTp)) {
......@@ -292,11 +292,11 @@ function CBPR_Last_Page_Indicator_2_FormalRule(obj) {
//r17 允许最多出现一次Balance/Type/CodeOrProprietary/Code值为“CLAV”
function CBPR_BalanceTypeCode_FormalRule(obj) {
const msg = "Maximum 1 occurrence of Balance/Type/CodeOrProprietary/Code with value 'CLAV' is allowed.";
let position = "Balance/Type/CodeOrProprietary/Code";
let bal = obj.bal;
let count = 0;
var position = "Balance/Type/CodeOrProprietary/Code";
var bal = obj.bal;
var count = 0;
if (isNotEmpty(bal)) {
for (let index = 0; index < bal.length; index++) {
for (var index = 0; index < bal.length; index++) {
const element = bal[index];
if (element.tp.cdOrPrtry.cd == 'CLAV') {
count++;
......@@ -346,11 +346,11 @@ function CBPR_Domain_Proprietary_Recommendation_TextualRule() {
function CBPR_Charges_TextualRule(obj, position) {
const msg = "Total Charges And Tax Amount must equal the sum of the individual record amounts.";
if (isNotEmpty(obj)) {
let totalamount = Decimal(obj.ttlChrgsAndTaxAmt.value);
let record = obj.rcrd;
var totalamount = Decimal(obj.ttlChrgsAndTaxAmt.value);
var record = obj.rcrd;
if (isNotEmpty(record)) {
let recordamount = new Decimal(0.00);
for (let index = 0; index < record.length; index++) {
var recordamount = new Decimal(0.00);
for (var index = 0; index < record.length; index++) {
recordamount = recordamount.add(new Decimal(record[index].amt.value));
}
if (totalamount.comparedTo(recordamount.toNumber()) != 0) {
......@@ -366,7 +366,7 @@ function CBPR_Charges_TextualRule(obj, position) {
function CBPR_Original_Instruction_Identification_FormalRule(obj, position) {
const msg = "This field must not start or end with a slash '/' and must not contain two consecutive slashes '//'.";
if (isNotEmpty(obj)) {
let instrId = obj.instrId;
var instrId = obj.instrId;
if (isNotEmpty(instrId)) {
if (instrId.startsWith('/') || instrId.endsWith("/") || instrId.indexOf("//") >= 0) {
message(position, msg);
......
......@@ -12,18 +12,18 @@ export default function validator(obj) {
return false;
}
let bal = obj.stmt.bal;
var bal = obj.stmt.bal;
if (isNotEmpty(bal)) {
for (let index = 0; index < bal.length; index++) {
for (var index = 0; index < bal.length; index++) {
const element = bal[index];
if (!r13(element)) {
return false;
}
}
}
let ttlNtriesPerBkTxCd = obj.stmt.txsSummry.ttlNtriesPerBkTxCd;
var ttlNtriesPerBkTxCd = obj.stmt.txsSummry.ttlNtriesPerBkTxCd;
if(isNotEmpty(ttlNtriesPerBkTxCd)){
for (let i = 0; index < ttlNtriesPerBkTxCd.length; i++) {
for (var i = 0; index < ttlNtriesPerBkTxCd.length; i++) {
if (!r14(ttlNtriesPerBkTxCd[i].bkTxCd, `Transactions Summary/Total Entries Per Bank Transaction Code[` + (i + 1) + `]/Bank Transaction Code`)) {
return false;
}
......@@ -33,9 +33,9 @@ export default function validator(obj) {
}
}
let ntry = obj.stmt.ntry;
var ntry = obj.stmt.ntry;
if (isNotEmpty(ntry)) {
for (let index = 0; index < ntry.length; index++) {
for (var index = 0; index < ntry.length; index++) {
const element = ntry[index];
if (!r14(element.bkTxCd, `Report/Entry[` + (index + 1) + `]/Bank Transaction Code`)) {
return false;
......@@ -43,9 +43,9 @@ export default function validator(obj) {
if (!r15(element.bkTxCd.domn.fmly, `Report/Entry[` + (index + 1) + `]/Bank Transaction Code`)) {
return false;
}
let ntryDtls = element.ntryDtls;
var ntryDtls = element.ntryDtls;
if (isNotEmpty(ntryDtls)) {
for (let idx = 0; idx < ntryDtls.length; idx++) {
for (var idx = 0; idx < ntryDtls.length; idx++) {
if (!r14(ntryDtls[idx].txDtls.bkTxCd, `Report/Entry[` + (index + 1) + `]/Entry Details[` + (idx + 1) + `]/Transaction Details/Bank Transaction Code`)) {
return false;
}
......@@ -85,9 +85,9 @@ export default function validator(obj) {
// 如果CopyDuplicate存在,那么Related必须存在。
function r1(obj) {
const position = "Credit Transfer Transaction Information/CopyDuplicate";
let msg = "If CopyDuplicate is present, then Related MUST be present.";
let cpyDplct = obj.cpyDplct;
let rltd = obj.rltd;
var msg = "If CopyDuplicate is present, then Related MUST be present.";
var cpyDplct = obj.cpyDplct;
var rltd = obj.rltd;
if (isNotEmpty(cpyDplct)) {
if (isEmpty(rltd)) {
message(position, msg);
......@@ -171,7 +171,7 @@ function r13(obj) {
const msg = "If Type is equal to ForwardAvailable, Availability is not allowed.";
const position = "Report/Balance/Type";
if (isNotEmpty(obj)) {
let type = obj.tp.cdOrPrtry.cd;
var type = obj.tp.cdOrPrtry.cd;
if (isNotEmpty(type)) {
if (type == 'FWAV') {
if (isNotEmpty(obj.avlbty)) {
......
......@@ -12,9 +12,9 @@ export default function validator(obj) {
return false;
}
let ntfctn = obj.ntfctn;
var ntfctn = obj.ntfctn;
if(isNotEmpty(ntfctn)){
for (let index = 0; index < ntfctn.length; index++) {
for (var index = 0; index < ntfctn.length; index++) {
const element = ntfctn[index];
//r11
if (!CBPR_Copy_Duplicate_Indicator_TextualRule(element,`Notification[` + (index + 1) + `]/Copy Duplicate Indicator`)){
......@@ -24,9 +24,9 @@ export default function validator(obj) {
// if (!CBPR_Transaction_Summary_Guideline(element,`Notification[` + (index + 1) + `]/Transactions Summary`)){
// return false;
// }
let ntry = element.ntry;
var ntry = element.ntry;
if(isNotEmpty(ntry)){
for (let idx = 0; idx < ntry.length; idx++) {
for (var idx = 0; idx < ntry.length; idx++) {
//r16
// if(!CBPR_Booking_Date_TextualRule(ntry[idx],`Notification[` + (index + 1) + `]/Entry[` + (idx + 1) + `]/Booking Date`)){
// return false;
......@@ -35,12 +35,12 @@ export default function validator(obj) {
// if(!CBPR_Value_Date_TextualRule(ntry[idx],`Notification[` + (index + 1) + `]/Entry[` + (idx + 1) + `]/Value Date`)){
// return false;
// }
let ntryDtls = ntry[idx].ntryDtls;
var ntryDtls = ntry[idx].ntryDtls;
if(isNotEmpty(ntryDtls)){
for (let indexofntryDtls = 0; indexofntryDtls < ntryDtls.length; indexofntryDtls++) {
let txDtls = ntryDtls[indexofntryDtls].txDtls;
for (var indexofntryDtls = 0; indexofntryDtls < ntryDtls.length; indexofntryDtls++) {
var txDtls = ntryDtls[indexofntryDtls].txDtls;
if(isNotEmpty(txDtls)){
for (let indexoftxDtls = 0; indexoftxDtls < txDtls.length; indexoftxDtls++) {
for (var indexoftxDtls = 0; indexoftxDtls < txDtls.length; indexoftxDtls++) {
//r20
if(!CBPR_Original_Instruction_Identification_FormalRule(txDtls[indexoftxDtls].refs,`Notification[` + (index + 1) + `]/Entry[` + (idx + 1) + `]/Entry Details[` + (indexofntryDtls + 1) + `]/Transaction Details[` + (indexoftxDtls + 1) + `]`)){
return false;
......@@ -104,7 +104,7 @@ function CBPR_Business_Service_TextualRule() {
function CBPR_Business_Service_Usage_TextualRule(obj) {
const position = "Business Service";
const msg = "The value 'swift.cbprplus.02' must be used.";
let bizSvc = obj.bizSvc;
var bizSvc = obj.bizSvc;
if (bizSvc!='swift.cbprplus.02') {
message(position,msg);
return false;
......@@ -232,7 +232,7 @@ function CBPR_Charges_TextualRule(){
function CBPR_Original_Instruction_Identification_FormalRule(obj,position){
const msg = "This field must not start or end with a slash '/' and must not contain two consecutive slashes '//'.";
position = position+"/References/Instruction Identification";
let instrId = obj.instrId;
var instrId = obj.instrId;
if (isNotEmpty(instrId)) {
if (instrId.startsWith('/') || instrId.endsWith("/") || instrId.indexOf("//")>=0) {
message(position,msg);
......
......@@ -27,8 +27,8 @@ export default function validator(obj) {
}
}
let itm = obj.ntfctn.itm;
for (let index = 0; index < itm.length; index++) {
var itm = obj.ntfctn.itm;
for (var index = 0; index < itm.length; index++) {
const element = itm[index];
if(isNotEmpty(element.dbtr.pty)){
//r50
......@@ -204,15 +204,15 @@ export default function validator(obj) {
function Mandatory_Debtor_Rule(obj){
const msg = "Either Debtor must be present or Item/Debtor must be present.";
let position = "Notification/Debtor | Notification/Item/Debtor";
let flag1 = false;
let flag2 = false;
var position = "Notification/Debtor | Notification/Item/Debtor";
var flag1 = false;
var flag2 = false;
if(isNotEmpty(obj.dbtr)){
flag1 = true;
}
if(isNotEmpty(obj.itm)){
let itme = obj.itm;
for (let index = 0; index < itme.length; index++) {
var itme = obj.itm;
for (var index = 0; index < itme.length; index++) {
const element = itme[index];
if(isNotEmpty(element.dbtr)){
flag2 = true;
......@@ -261,7 +261,7 @@ function CBPR_Business_Service_TextualRule() {
function CBPR_Business_Service_Usage_TextualRule(obj) {
const position = "Business Service";
const msg = "The value 'swift.cbprplus.02' must be used.";
let bizSvc = obj.bizSvc;
var bizSvc = obj.bizSvc;
if (bizSvc!='swift.cbprplus.02') {
message(position,msg);
return false;
......@@ -295,8 +295,8 @@ function CBPR_Related_BAH_Business_Service_TextualRule() {
function CBPR_Party_Name_Postal_Address_FormalRule(PartyIdentification,position) {
const msg = "If Postal Address is present then Name is mandatory.";
if(isNotEmpty(PartyIdentification)){
let nm = PartyIdentification.nm;
let pstlAdr = PartyIdentification.pstlAdr;
var nm = PartyIdentification.nm;
var pstlAdr = PartyIdentification.pstlAdr;
if (isNotEmpty(pstlAdr)) {
if (isEmpty(nm)) {
message(position,msg);
......@@ -311,7 +311,7 @@ function CBPR_Party_Name_Postal_Address_FormalRule(PartyIdentification,position)
function CBPR_Structured_vs_Unstructured_FormalRule(pstlAdr, position) {
const msg = "If PostalAddress is used and if AddressLine is present, then all other optional elements in PostalAddress must be absent.";
if (isNotEmpty(pstlAdr) && isNotEmpty(pstlAdr.adrLine)) {
let temp = pstlAdr.adrLine
var temp = pstlAdr.adrLine
pstlAdr.adrLine = null;
if (isNotEmpty(pstlAdr)) {
message(position, msg);
......@@ -327,9 +327,9 @@ function CBPR_Structured_vs_Unstructured_FormalRule(pstlAdr, position) {
function CBPR_Town_Name_And_Country_FormalRule(pstlAdr, position) {
const msg = "If “PostalAddress” is used, and if AddressLine is absent, then Country and Town name must be present.";
if (isNotEmpty(pstlAdr)) {
let adrLine = pstlAdr.adrLine;
let ctry = pstlAdr.ctry;
let twnNm = pstlAdr.twnNm;
var adrLine = pstlAdr.adrLine;
var ctry = pstlAdr.ctry;
var twnNm = pstlAdr.twnNm;
if (isEmpty(adrLine)) {
if (isEmpty(ctry) || isEmpty(twnNm)) {
message(position, msg);
......@@ -361,7 +361,7 @@ function CBPR_Agent_Option_2_TextualRule() {
//r15/r25/r30 地址行(非结构化地址)仅在FIN中或MI在共存期间启动付款的情况下才可用。结构化邮寄地址仍然是首选选项。因此:-如果在FIN或MI上发起付款,并且邮寄地址是非结构化的,则发出的ISO 20022消息将传输非结构化邮寄地址,直到债权人代理。-如果付款是在ISO 20022中发起的,则必须结构化邮政地址。
function CBPR_Co_existence_Postal_Address_TextualRule_R15(obj) {
const msg = "Address Line (Unstructured Address) remains available only for cases when the payment is initiated in FIN, or by an MI, during coexistence only. The Structured PostalAddress remains the prefered option.Therefore:- If a payment is initiated on FIN, or by an MI, and the postal address is unstructured, the outgoing ISO 20022 message will transport unstructured postal address, up to the Creditor Agent.- If a payment is initiated in ISO 20022, postal address must be structured.";
let agtAddr = null;
var agtAddr = null;
if(isNotEmpty(obj.grpHdr.msgSndr.agt)){
agtAddr = obj.grpHdr.msgSndr.agt.finInstnId.pstlAdr;
}
......@@ -371,7 +371,7 @@ function CBPR_Co_existence_Postal_Address_TextualRule_R15(obj) {
return false;
}
}
let ownragtAddr = null;
var ownragtAddr = null;
if(isNotEmpty(obj.ntfctn.acctOwnr.agt)){
ownragtAddr = obj.ntfctn.acctOwnr.agt.finInstnId.pstlAdr;
}
......@@ -381,7 +381,7 @@ function CBPR_Co_existence_Postal_Address_TextualRule_R15(obj) {
return false;
}
}
let dbtragtAddr = null;
var dbtragtAddr = null;
if(isNotEmpty(obj.ntfctn.dbtr.agt)){
dbtragtAddr = obj.ntfctn.dbtr.agt.finInstnId.pstlAdr;
}
......@@ -392,7 +392,7 @@ function CBPR_Co_existence_Postal_Address_TextualRule_R15(obj) {
}
}
let dbtragt2Addr = null;
var dbtragt2Addr = null;
if(isNotEmpty(obj.ntfctn.dbtrAgt)){
dbtragt2Addr = obj.ntfctn.dbtrAgt.finInstnId.pstlAdr;
}
......@@ -403,7 +403,7 @@ function CBPR_Co_existence_Postal_Address_TextualRule_R15(obj) {
}
}
let intrmyAgtAddr = null;
var intrmyAgtAddr = null;
if(isNotEmpty(obj.ntfctn.intrmyAgt)){
intrmyAgtAddr = obj.ntfctn.intrmyAgt.finInstnId.pstlAdr;
}
......@@ -414,10 +414,10 @@ function CBPR_Co_existence_Postal_Address_TextualRule_R15(obj) {
}
}
let itm = obj.ntfctn.itm;
for (let index = 0; index < itm.length; index++) {
var itm = obj.ntfctn.itm;
for (var index = 0; index < itm.length; index++) {
const element = itm[index];
let dbtrAgtAddr = null;
var dbtrAgtAddr = null;
if(isNotEmpty(element.dbtr.agt)){
dbtrAgtAddr = element.dbtr.agt.finInstnId.pstlAdr;
}
......@@ -427,7 +427,7 @@ function CBPR_Co_existence_Postal_Address_TextualRule_R15(obj) {
return false;
}
}
let dbtrAgt2Addr = null;
var dbtrAgt2Addr = null;
if(isNotEmpty(element.dbtrAgt)){
dbtrAgt2Addr = element.dbtrAgt.finInstnId.pstlAdr;
}
......@@ -437,7 +437,7 @@ function CBPR_Co_existence_Postal_Address_TextualRule_R15(obj) {
return false;
}
}
let intrmyAgtAddr = null;
var intrmyAgtAddr = null;
if(isNotEmpty(element.intrmyAgt)){
intrmyAgtAddr = element.intrmyAgt.finInstnId.pstlAdr;
}
......@@ -463,7 +463,7 @@ function CBPR_Co_existence_Postal_Address_TextualRule_R25(pstlAdr){
}
function CBPR_Co_existence_Postal_Address_TextualRule_R30(obj){
const msg = "Address Line (Unstructured Address) remains available only for cases when the payment is initiated in FIN, or by an MI, during coexistence only. The Structured PostalAddress remains the prefered option.Therefore:- If a payment is initiated on FIN, or by an MI, and the postal address is unstructured, the outgoing ISO 20022 message will transport unstructured postal address, up to the Creditor Agent.- If a payment is initiated in ISO 20022, postal address must be structured.";
let ptyAddr = null;
var ptyAddr = null;
if(isNotEmpty(obj.ntfctn.dbtr.pty)){
ptyAddr = obj.ntfctn.dbtr.pty.pstlAdr;
}
......@@ -473,10 +473,10 @@ function CBPR_Co_existence_Postal_Address_TextualRule_R30(obj){
return false;
}
}
let itm = obj.ntfctn.itm;
for (let index = 0; index < itm.length; index++) {
var itm = obj.ntfctn.itm;
for (var index = 0; index < itm.length; index++) {
const element = itm[index];
let dbtrptyAddr = null;
var dbtrptyAddr = null;
if(isNotEmpty(element.dbtr.pty)){
dbtrptyAddr = element.dbtr.pty.pstlAdr;
}
......@@ -494,8 +494,8 @@ function CBPR_Co_existence_Postal_Address_TextualRule_R30(obj){
function CBPR_Agent_Name_Postal_Address_FormalRule(na,position) {
const msg = "Name and Address must always be present together.";
if(isNotEmpty(na)){
let name = na.nm;
let addr = na.pstlAdr
var name = na.nm;
var addr = na.pstlAdr
if ((isNotEmpty(name)&&isEmpty(addr))||(isNotEmpty(addr)&&isEmpty(name))) {
message(position,msg);
return false;
......@@ -509,9 +509,9 @@ function CBPR_Expected_Value_Date_FormalRule(obj){
const msg = "If Notification/ExpectedValueDate is absent, then item/ExpectedValueDate must be present.";
if(isEmpty(obj.xpctdValDt)){
if(isNotEmpty(obj.itm)){
let flag = true;
let itm = obj.itm;
for (let index = 0; index < itm.length; index++) {
var flag = true;
var itm = obj.itm;
for (var index = 0; index < itm.length; index++) {
const element = itm[index];
if(isNotEmpty(element.xpctdValDt)){
flag = false;
......@@ -549,8 +549,8 @@ function CBPR_Debtor_Option_3_Jurisdictions_only_TextualRule() {
function CBPR_Party_Name_Any_BIC_FormalRule(PartyIdentification,position) {
const msg = "If AnyBIC is absent then Name is mandatory and it is recommended to also provide the Postal Address.";
if(isNotEmpty(PartyIdentification)){
let nm = PartyIdentification.nm;
let anyBIC = PartyIdentification.id.orgId.anyBIC;
var nm = PartyIdentification.nm;
var anyBIC = PartyIdentification.id.orgId.anyBIC;
if (isEmpty(anyBIC)) {
if (isEmpty(nm)) {
message(position,msg);
......
......@@ -39,8 +39,8 @@ export default function validator(obj) {
return false;
}
}
let rptgReq = obj.rptgReq;
for (let index = 0; index < rptgReq.length; index++) {
var rptgReq = obj.rptgReq;
for (var index = 0; index < rptgReq.length; index++) {
const element = rptgReq[index];
if(isNotEmpty(element.acctOwnr.pty)){
//r21
......@@ -128,7 +128,7 @@ function CBPR_Business_Service_TextualRule() {
function CBPR_Business_Service_Usage_TextualRule(obj) {
const position = "Business Service";
const msg = "The value 'swift.cbprplus.02' must be used.";
let bizSvc = obj.bizSvc;
var bizSvc = obj.bizSvc;
if (bizSvc != 'swift.cbprplus.02') {
message(position, msg);
return false;
......@@ -162,8 +162,8 @@ function CBPR_Related_BAH_Business_Service_TextualRule() {
function CBPR_Party_Name_Postal_Address_FormalRule(PartyIdentification, position) {
const msg = "If Postal Address is present then Name is mandatory.";
if (isNotEmpty(PartyIdentification)) {
let nm = PartyIdentification.nm;
let pstlAdr = PartyIdentification.pstlAdr;
var nm = PartyIdentification.nm;
var pstlAdr = PartyIdentification.pstlAdr;
if (isNotEmpty(pstlAdr)) {
if (isEmpty(nm)) {
message(position, msg);
......@@ -178,7 +178,7 @@ function CBPR_Party_Name_Postal_Address_FormalRule(PartyIdentification, position
function CBPR_Structured_vs_Unstructured_FormalRule(pstlAdr, position) {
const msg = "If Postal Address is used and if AddressLine is present, then all other optional elements in PostalAddress must be absent.";
if (isNotEmpty(pstlAdr) && isNotEmpty(pstlAdr.adrLine)) {
let temp = pstlAdr.adrLine
var temp = pstlAdr.adrLine
pstlAdr.adrLine = null;
if (isNotEmpty(pstlAdr)) {
message(position, msg);
......@@ -194,9 +194,9 @@ function CBPR_Structured_vs_Unstructured_FormalRule(pstlAdr, position) {
function CBPR_Town_Name_And_Country_FormalRule(pstlAdr, position) {
const msg = "If “PostalAddress” is used, and if AddressLine is absent, then Country and Town name must be present.";
if (isNotEmpty(pstlAdr)) {
let adrLine = pstlAdr.adrLine;
let ctry = pstlAdr.ctry;
let twnNm = pstlAdr.twnNm;
var adrLine = pstlAdr.adrLine;
var ctry = pstlAdr.ctry;
var twnNm = pstlAdr.twnNm;
if (isEmpty(adrLine)) {
if (isEmpty(ctry) || isEmpty(twnNm)) {
message(position, msg);
......@@ -240,7 +240,7 @@ function CBPR_Agent_Option_3_TextualRule() {
//r16 地址行(非结构化地址)仅在FIN中或MI在共存期间启动付款的情况下才可用。结构化邮寄地址仍然是首选选项。因此:-如果在FIN或MI上发起付款,并且邮寄地址是非结构化的,则发出的ISO 20022消息将传输非结构化邮寄地址,直到债权人代理。-如果付款是在ISO 20022中发起的,则必须结构化邮政地址。
function CBPR_Co_existence_Postal_Address_TextualRule(obj) {
const msg = "Address Line (Unstructured Address) remains available only for cases when the payment is initiated in FIN, or by an MI, during coexistence only. The Structured PostalAddress remains the prefered option.Therefore:- If a payment is initiated on FIN, or by an MI, and the postal address is unstructured, the outgoing ISO 20022 message will transport unstructured postal address, up to the Creditor Agent.- If a payment is initiated in ISO 20022, postal address must be structured.";
let agtAddr = null;
var agtAddr = null;
if(isNotEmpty(obj.grpHdr.msgSndr.agt)){
agtAddr = obj.grpHdr.msgSndr.agt.finInstnId.pstlAdr;
}
......@@ -250,10 +250,10 @@ function CBPR_Co_existence_Postal_Address_TextualRule(obj) {
return false;
}
}
let rptgReq = obj.rptgReq;
for (let index = 0; index < rptgReq.length; index++) {
var rptgReq = obj.rptgReq;
for (var index = 0; index < rptgReq.length; index++) {
const element = rptgReq[index];
let acctOwnragtAddr = null;
var acctOwnragtAddr = null;
if(isNotEmpty(element.acctOwnr.agt)){
acctOwnragtAddr = element.acctOwnr.agt.finInstnId.pstlAdr;
}
......@@ -263,7 +263,7 @@ function CBPR_Co_existence_Postal_Address_TextualRule(obj) {
return false;
}
}
let acctSvcrAddr = element.acctSvcr.finInstnId.pstlAdr;
var acctSvcrAddr = element.acctSvcr.finInstnId.pstlAdr;
if (isNotEmpty(acctSvcrAddr)) {
if (isNotEmpty(acctSvcrAddr.adrLine) || (isEmpty(acctSvcrAddr.ctry) || isEmpty(acctSvcrAddr.twnNm))) {
message(`Reporting Request[`(index + 1)`]/Account Servicer`, msg);
......@@ -277,8 +277,8 @@ function CBPR_Co_existence_Postal_Address_TextualRule(obj) {
//r17/r24/r27 姓名和地址必须同时出现
function CBPR_Agent_Name_Postal_Address_FormalRule(na, position) {
const msg = "Name and Address must always be present together.";
let name = na.nm;
let addr = na.pstlAdr
var name = na.nm;
var addr = na.pstlAdr
if ((isNotEmpty(name) && isEmpty(addr)) || (isNotEmpty(addr) && isEmpty(name))) {
message(position, msg);
return false;
......
......@@ -101,7 +101,7 @@ function CBPR_Business_Service_TextualRule() {
function CBPR_Business_Service_Usage_TextualRule(obj) {
const position = "Business Service";
const msg = "The value 'swift.cbprplus.02' must be used.";
let bizSvc = obj.bizSvc;
var bizSvc = obj.bizSvc;
if (bizSvc != 'swift.cbprplus.02') {
message(position, msg);
return false;
......@@ -178,7 +178,7 @@ function CBPR_Original_Instruction_Identification_FormalRule(obj) {
const msg = "This field must not start or end with a slash '/' and must not contain two consecutive slashes '//'.";
const position = "Transaction Information And Status/Original Instruction Identification";
if (isNotEmpty(obj)) {
let instrId = obj.orgnlInstrId;
var instrId = obj.orgnlInstrId;
if (isNotEmpty(instrId)) {
if (instrId.startsWith('/') || instrId.endsWith("/") || instrId.indexOf("//") >= 0) {
message(position, msg);
......@@ -212,8 +212,8 @@ function CBPR_Party_Name_Any_BIC_FormalRule(Originator) {
const msg = "If AnyBIC is absent, then Name is mandatory.";
const position = "Status Reason Information/Originator/Name";
if(isNotEmpty(Originator)){
let nm = Originator.nm;
let anyBIC = Originator.id.orgId.anyBIC;
var nm = Originator.nm;
var anyBIC = Originator.id.orgId.anyBIC;
if (isNotEmpty(Originator)) {
if (isEmpty(anyBIC)) {
if (isEmpty(nm)) {
......@@ -232,8 +232,8 @@ function CBPR_Party_Name_Postal_Address_FormalRule(Originator) {
"<br/>Recommendation: If present, the BIC (AnyBIC) will always take precedence in case of conflicting information.";
const position = "Status Reason Information/Originator/Postal Address";
if(isNotEmpty(Originator)){
let nm = Originator.nm;
let pstlAdr = Originator.pstlAdr;
var nm = Originator.nm;
var pstlAdr = Originator.pstlAdr;
if (isNotEmpty(pstlAdr)) {
if (isEmpty(nm)) {
message(position, msg);
......@@ -255,9 +255,9 @@ function CBPR_Town_Name_And_Country_FormalRule(pstlAdr) {
const msg = "If “PostalAddress” is used, and if AddressLine is absent, then Country and Town name must be present.";
const position = "Status Reason Information/Originator/Postal Address";
if (isNotEmpty(pstlAdr)) {
let adrLine = pstlAdr.adrLine;
let ctry = pstlAdr.ctry;
let twnNm = pstlAdr.twnNm;
var adrLine = pstlAdr.adrLine;
var ctry = pstlAdr.ctry;
var twnNm = pstlAdr.twnNm;
if (isEmpty(adrLine)) {
if (isEmpty(ctry) || isEmpty(twnNm)) {
message(position, msg);
......@@ -273,7 +273,7 @@ function CBPR_Structured_vs_Unstructured_FormalRule(pstlAdr) {
const msg = "If PostalAddress is used and if AddressLine is present, then all other optional elements in PostalAddress must be absent.";
const position = "Status Reason Information/Originator/Postal Address";
if (isNotEmpty(pstlAdr) && isNotEmpty(pstlAdr.adrLine)) {
let temp = pstlAdr.adrLine
var temp = pstlAdr.adrLine
pstlAdr.adrLine = null;
if (isNotEmpty(pstlAdr)) {
message(position, msg);
......
......@@ -10,9 +10,9 @@ export default function validator(obj) {
console.log("Execult pacs004 validatorRule");
//r34
let chrgsInf = obj.txInf.chrgsInf;
var chrgsInf = obj.txInf.chrgsInf;
if (isNotEmpty(chrgsInf)) {
for (let index = 0; index < chrgsInf.length; index++) {
for (var index = 0; index < chrgsInf.length; index++) {
const element = chrgsInf[index];
if (!commonRule.CBPR_Agent_Name_Postal_Address_FormalRule(element.agt.finInstnId, `Charges Information[` + (index + 1) + `]/Agent/Financial Institution Identification`)) {
return false;
......@@ -573,8 +573,8 @@ function CBPR_Message_Definition_Identifier_TextualRule() {
function CBPR_Name_Any_BIC_FormalRule(PartyIdentification,position) {
const msg = "If AnyBIC is Absent Then Name is mandatory.";
if (isNotEmpty(PartyIdentification)) {
let nm = PartyIdentification.nm;
let anyBIC = PartyIdentification.id.orgId.anyBIC;
var nm = PartyIdentification.nm;
var anyBIC = PartyIdentification.id.orgId.anyBIC;
if (isEmpty(anyBIC)) {
if (isEmpty(nm)) {
message(position, msg);
......@@ -590,8 +590,8 @@ function CBPR_Name_Any_BIC_FormalRule(PartyIdentification,position) {
function CBPR_Name_Postal_Address_FormalRule(na,position) {
const msg = "Name and Address must always be present together.";
if(isNotEmpty(na)){
let name = na.nm;
let addr = na.pstlAdr
var name = na.nm;
var addr = na.pstlAdr
if ((isNotEmpty(name)&&isEmpty(addr))||(isNotEmpty(addr)&&isEmpty(name))) {
message(position,msg);
return false;
......@@ -621,7 +621,7 @@ function CBPR_Original_End_To_End_Identification_TextualRule() {
function CBPR_Original_Instruction_Identification_FormalRule(obj) {
const msg = "This field must not start or end with a slash '/' and must not contain two consecutive slashes '//'.";
const position = "Transaction Information/Original Instruction Identification";
let instrId = obj.orgnlInstrId;
var instrId = obj.orgnlInstrId;
if (isNotEmpty(instrId)) {
if (instrId.startsWith('/') || instrId.endsWith("/") || instrId.indexOf("//") >= 0) {
message(position, msg);
......@@ -652,10 +652,10 @@ function CBPR_Original_Message_Identification_TextualRule() {
function CBPR_Original_Message_Name_Identification_FormalRule(obj) {
const msg = "This element should be populated with either pacs.002.001.xx or pacs.008.001.xx or pacs.009.001.xx or camt.053.001.xx or camt.054.001.xx or MT103 or MT202 or MT205 or MT 900 or MT910 or MT940 or MT950 when present.";
const position = "Transaction Information/Original Group Information/Original Message Name Identification";
let orgnlGrpInf = obj.txInf.orgnlGrpInf;
var orgnlGrpInf = obj.txInf.orgnlGrpInf;
if(isNotEmpty(orgnlGrpInf)){
let orgnlMsgNmId = obj.txInf.orgnlGrpInf.orgnlMsgNmId;
let regExp = "pacs.00[289].001.[0-9]{2}|camt.05[34].001.[0-9]{2}|MT103|MT202|MT205|MT900|MT910|MT940|MT950";
var orgnlMsgNmId = obj.txInf.orgnlGrpInf.orgnlMsgNmId;
var regExp = "pacs.00[289].001.[0-9]{2}|camt.05[34].001.[0-9]{2}|MT103|MT202|MT205|MT900|MT910|MT940|MT950";
if (!new RegExp("^" + regExp + "$").test(orgnlMsgNmId)){
message(position,msg);
return false;
......@@ -694,9 +694,9 @@ function CBPR_Originator_Identification_TextualRule() {
function CBPR_Partial_Return_TextualRule(obj) {
const msg = "In case of Partial Return, the 'ReturnReasonInformation/Additional information' must take the fixed value 'PART' and the “ReturnReasonInformation /Reason” must be populated with a code from the External reason code list.";
const position = "Return Reason Information/Additional information";
let addtlInf = obj.txInf.rtrRsnInf.addtlInf;
var addtlInf = obj.txInf.rtrRsnInf.addtlInf;
if(isNotEmpty(addtlInf)){
for (let index = 0; index < addtlInf.length; index++) {
for (var index = 0; index < addtlInf.length; index++) {
const element = addtlInf[index];
if(element != 'PART'){
message(position,msg);
......@@ -711,8 +711,8 @@ function CBPR_Partial_Return_TextualRule(obj) {
function CBPR_Party_Name_Any_BIC_FormalRule(PartyIdentification,position) {
const msg = "If AnyBIC is absent then Name is mandatory and it is recommended to also provide the Postal Address.";
if (isNotEmpty(PartyIdentification)) {
let nm = PartyIdentification.nm;
let anyBIC = PartyIdentification.id.orgId.anyBIC;
var nm = PartyIdentification.nm;
var anyBIC = PartyIdentification.id.orgId.anyBIC;
if (isEmpty(anyBIC)) {
if (isEmpty(nm)) {
message(position, msg);
......@@ -726,8 +726,8 @@ function CBPR_Party_Name_Any_BIC_FormalRule(PartyIdentification,position) {
//r37/r46/r54/r85/r94/r97/r116/r122/r137/r145
function CBPR_Party_Name_Postal_Address_FormalRule(PartyIdentification, position) {
const msg = "If Postal Address is present then Name is mandatory.";
let nm = PartyIdentification.nm;
let pstlAdr = PartyIdentification.pstlAdr;
var nm = PartyIdentification.nm;
var pstlAdr = PartyIdentification.pstlAdr;
if (isNotEmpty(pstlAdr)) {
if (isEmpty(nm)) {
message(position, msg);
......@@ -761,9 +761,9 @@ function CBPR_Related_Business_Application_Header_TextualRule() {
//r11
function CBPR_Remittance_Mutually_Exclusive_FormalRule(obj) {
const msg = "Either Structured or Unstructured Remittance can be present.";
let position = "Remittance Information/Unstructured | Structured";
let strd = obj.txInf.orgnlTxRef.rmtInf.strd;
let ustrd = obj.txInf.orgnlTxRef.rmtInf.ustrd;
var position = "Remittance Information/Unstructured | Structured";
var strd = obj.txInf.orgnlTxRef.rmtInf.strd;
var ustrd = obj.txInf.orgnlTxRef.rmtInf.ustrd;
if(isNotEmpty(strd) && isNotEmpty(ustrd)){
message(position,msg);
return false;
......@@ -833,7 +833,7 @@ function CBPR_SHAR_TextualRule() {
function CBPR_Structured_vs_Unstructured_FormalRule(pstlAdr, position) {
const msg = "If PostalAddress is used and if AddressLine is present, then all other optional elements in PostalAddress must be absent.";
if (isNotEmpty(pstlAdr) && isNotEmpty(pstlAdr.adrLine)) {
let temp = pstlAdr.adrLine
var temp = pstlAdr.adrLine
pstlAdr.adrLine = null;
if (isNotEmpty(pstlAdr)) {
message(position, msg);
......
......@@ -96,7 +96,7 @@ function CBPR_Business_Service_TextualRule() {
function CBPR_Business_Service_Usage_TextualRule(obj) {
const position = "Business Service";
const msg = "The value 'swift.cbprplus.02' must be used.";
let bizSvc = obj.bizSvc;
var bizSvc = obj.bizSvc;
if (bizSvc!='swift.cbprplus.02') {
message(position,msg);
return false;
......@@ -155,28 +155,28 @@ function CBPR_Agent_Option_3_TextualRule() {
//r16 地址行(非结构化地址)仅在FIN中或MI在共存期间启动付款的情况下才可用。结构化邮寄地址仍然是首选选项。因此:-如果在FIN或MI上发起付款,并且邮寄地址是非结构化的,则发出的ISO 20022消息将传输非结构化邮寄地址,直到债权人代理。-如果付款是在ISO 20022中发起的,则必须结构化邮政地址。
function CBPR_Co_existence_Postal_Address_TextualRule(obj) {
const msg = "Address Line (Unstructured Address) remains available only for cases when the payment is initiated in FIN, or by an MI, during coexistence only. The Structured PostalAddress remains the prefered option.Therefore:- If a payment is initiated on FIN, or by an MI, and the postal address is unstructured, the outgoing ISO 20022 message will transport unstructured postal address, up to the Creditor Agent.- If a payment is initiated in ISO 20022, postal address must be structured.";
let cdtrAddr = obj.cdtr.pstlAdr;
var cdtrAddr = obj.cdtr.pstlAdr;
if (isNotEmpty(cdtrAddr)) {
if(isNotEmpty(cdtrAddr.adrLine)||(isEmpty(cdtrAddr.ctry)||isEmpty(cdtrAddr.twnNm))) {
message("Creditor",msg);
return false;
}
}
let dbtrAddr = obj.drctDbtTxInf.dbtr.pstlAdr;
var dbtrAddr = obj.drctDbtTxInf.dbtr.pstlAdr;
if (isNotEmpty(dbtrAddr)) {
if(isNotEmpty(dbtrAddr.adrLine)||(isEmpty(dbtrAddr.ctry)||isEmpty(dbtrAddr.twnNm))) {
message("Debtor",msg);
return false;
}
}
let cdtrAgtAddr = obj.cdtrAgt.finInstnId.pstlAdr;
var cdtrAgtAddr = obj.cdtrAgt.finInstnId.pstlAdr;
if (isNotEmpty(cdtrAgtAddr)) {
if(isNotEmpty(cdtrAgtAddr.adrLine)||(isEmpty(cdtrAgtAddr.ctry)||isEmpty(cdtrAgtAddr.twnNm))) {
message("Creditor Agent",msg);
return false;
}
}
let dbtrAgtAddr = obj.drctDbtTxInf.dbtrAgt.finInstnId.pstlAdr;
var dbtrAgtAddr = obj.drctDbtTxInf.dbtrAgt.finInstnId.pstlAdr;
if (isNotEmpty(dbtrAgtAddr)) {
if(isNotEmpty(dbtrAgtAddr.adrLine)||(isEmpty(dbtrAgtAddr.ctry)||isEmpty(dbtrAgtAddr.twnNm))) {
message("Debtor Agent",msg);
......@@ -189,8 +189,8 @@ function CBPR_Co_existence_Postal_Address_TextualRule(obj) {
//r17/r21/r25/r29 姓名和地址必须同时出现
function CBPR_Agent_Name_Postal_Address_FormalRule(na,position) {
const msg = "Name and Address must always be present together.";
let name = na.nm;
let addr = na.pstlAdr
var name = na.nm;
var addr = na.pstlAdr
if ((isNotEmpty(name)&&isEmpty(addr))||(isNotEmpty(addr)&&isEmpty(name))) {
message(position,msg);
return false;
......@@ -202,9 +202,9 @@ function CBPR_Agent_Name_Postal_Address_FormalRule(na,position) {
function CBPR_Town_Name_And_Country_FormalRule(pstlAdr, position) {
const msg = "If “PostalAddress” is used, and if AddressLine is absent, then Country and Town name must be present.";
if (isNotEmpty(pstlAdr)) {
let adrLine = pstlAdr.adrLine;
let ctry = pstlAdr.ctry;
let twnNm = pstlAdr.twnNm;
var adrLine = pstlAdr.adrLine;
var ctry = pstlAdr.ctry;
var twnNm = pstlAdr.twnNm;
if (isEmpty(adrLine)) {
if (isEmpty(ctry) || isEmpty(twnNm)) {
message(position, msg);
......@@ -219,7 +219,7 @@ function CBPR_Town_Name_And_Country_FormalRule(pstlAdr, position) {
function CBPR_Structured_vs_Unstructured_FormalRule(pstlAdr, position) {
const msg = "If PostalAddress is used and if AddressLine is present, then all other optional elements in PostalAddress must be absent.";
if (isNotEmpty(pstlAdr) && isNotEmpty(pstlAdr.adrLine)) {
let temp = pstlAdr.adrLine
var temp = pstlAdr.adrLine
pstlAdr.adrLine = null;
if (isNotEmpty(pstlAdr)) {
message(position, msg);
......
......@@ -23,8 +23,8 @@ export default function validator(obj) {
return false;
}
let strd = obj.pmtInf.cdtTrfTxInf.rmtInf.strd;
for (let index = 0; index < strd.length; index++) {
var strd = obj.pmtInf.cdtTrfTxInf.rmtInf.strd;
for (var index = 0; index < strd.length; index++) {
const element = strd[index];
if(!CBPR_Party_Name_TextualRule(element.invcr,`Credit Transfer Transaction Information/Remittance Information/Structured[`+ (index + 1) +`]/Invoicer`) ||
!CBPR_Party_Name_TextualRule(element.invcee,`Credit Transfer Transaction Information/Remittance Information/Structured[`+ (index + 1) +`]/Invoicee`) ||
......@@ -121,7 +121,7 @@ function CBPR_Business_Service_TextualRule() {
function CBPR_Business_Service_Usage_TextualRule(obj) {
const position = "Business Service";
const msg = "The value 'swift.cbprplus.02' must be used.";
let bizSvc = obj.bizSvc;
var bizSvc = obj.bizSvc;
if (bizSvc!='swift.cbprplus.02') {
message(position,msg);
return false;
......@@ -170,8 +170,8 @@ function CGI_ISO_Date_Time_TextualRule(){
function CBPR_Party_Name_TextualRule(Party,position){
const msg = "If Postal Address is provided, then Name is mandatory. Name without address is allowed."
if(isNotEmpty(Party)){
let nm = Party.nm;
let pstlAdr = Party.pstlAdr;
var nm = Party.nm;
var pstlAdr = Party.pstlAdr;
if (isNotEmpty(pstlAdr)) {
if (isEmpty(nm)) {
message(position,msg);
......@@ -267,9 +267,9 @@ function CGI_ISO_Code_TextualRule() {
function CBPR_Town_Name_And_Country_FormalRule(pstlAdr, position) {
const msg = "If “PostalAddress” is used, and if AddressLine is absent, then Country and Town name must be present.";
if (isNotEmpty(pstlAdr)) {
let adrLine = pstlAdr.adrLine;
let ctry = pstlAdr.ctry;
let twnNm = pstlAdr.twnNm;
var adrLine = pstlAdr.adrLine;
var ctry = pstlAdr.ctry;
var twnNm = pstlAdr.twnNm;
if (isEmpty(adrLine)) {
if (isEmpty(ctry) || isEmpty(twnNm)) {
message(position, msg);
......@@ -284,9 +284,9 @@ function CBPR_Town_Name_And_Country_FormalRule(pstlAdr, position) {
function CBPR_Structured_vs_Unstructured_FormalRule(pstlAdr, position) {
const msg = "If PostalAddress is used and if AddressLine is present, then all other optional elements in PostalAddress must be absent.";
if (isNotEmpty(pstlAdr) && isNotEmpty(pstlAdr.adrLine)) {
let temp = pstlAdr.adrLine
var temp = pstlAdr.adrLine
// 所有的country为必填项
let temp1 = pstlAdr.ctry;
var temp1 = pstlAdr.ctry;
pstlAdr.adrLine = null;
pstlAdr.ctry = null;
if (isNotEmpty(pstlAdr)) {
......@@ -459,9 +459,9 @@ function CBPR_Instruction_for_Creditor_Agent1_TextualRule(obj){
"<br/>HOLD is optional";
const position = "Instruction For Creditor Agent/Code";
if (isNotEmpty(obj)){
let chqbcount = 0;
let holdcount = 0;
for (let index = 0; index < obj.length; index++) {
var chqbcount = 0;
var holdcount = 0;
for (var index = 0; index < obj.length; index++) {
const element = obj[index];
if(isNotEmpty(element.cd)){
if(element.cd == 'CHQB'){
......@@ -496,9 +496,9 @@ function CBPR_Instruction_for_Creditor_Agent2_TextualRule(obj){
"<br/>TELB is optional";
const position = "Instruction For Creditor Agent/Code";
if (isNotEmpty(obj)){
let phobcount = 0;
let telbcount = 0;
for (let index = 0; index < obj.length; index++) {
var phobcount = 0;
var telbcount = 0;
for (var index = 0; index < obj.length; index++) {
const element = obj[index];
if(isNotEmpty(element.cd)){
if(element.cd == 'PHOB'){
......
......@@ -74,7 +74,7 @@ function CBPR_Business_Service_TextualRule() {
function CBPR_Business_Service_Usage_TextualRule(obj) {
const position = "Business Service";
const msg = "The value 'swift.cbprplus.02' must be used.";
let bizSvc = obj.bizSvc;
var bizSvc = obj.bizSvc;
if (bizSvc!='swift.cbprplus.02') {
message(position,msg);
return false;
......@@ -177,8 +177,8 @@ function CBPR_Originator_Option_1_FormalRule(Originator) {
const msg = "If AnyBIC is absent, then Name is mandatory.";
const position = "Transaction Information And Status/Status Reason Information/Originator";
if(isNotEmpty(Originator)){
let nm = Originator.nm;
let anyBIC = Originator.id.orgId.anyBIC;
var nm = Originator.nm;
var anyBIC = Originator.id.orgId.anyBIC;
if (isNotEmpty(Originator)) {
if (isEmpty(anyBIC)) {
if (isEmpty(nm)) {
......@@ -196,8 +196,8 @@ function CBPR_Originator_Option_2_FormalRule(Originator) {
const msg = "If Postal Address is present, then Name is mandatory.";
const position = "Transaction Information And Status/Status Reason Information/Originator";
if(isNotEmpty(Originator)){
let nm = Originator.nm;
let pstlAdr = Originator.pstlAdr;
var nm = Originator.nm;
var pstlAdr = Originator.pstlAdr;
if (isNotEmpty(pstlAdr)) {
if (isEmpty(nm)) {
message(position, msg);
......@@ -219,7 +219,7 @@ function CBPR_Structured_vs_Unstructured_FormalRule(pstlAdr) {
const msg = "If PostalAddress is used and if AddressLine is present, then all other optional elements in PostalAddress must be absent.";
const position = "Transaction Information And Status/Status Reason Information/Originator";
if (isNotEmpty(pstlAdr) && isNotEmpty(pstlAdr.adrLine)) {
let temp = pstlAdr.adrLine
var temp = pstlAdr.adrLine
pstlAdr.adrLine = null;
if (isNotEmpty(pstlAdr)) {
message(position, msg);
......@@ -236,9 +236,9 @@ function CBPR_Town_Name_And_Country_FormalRule(pstlAdr) {
const msg = "If “PostalAddress” is used, and if AddressLine is absent, then Country and Town name must be present.";
const position = "Transaction Information And Status/Status Reason Information/Originator";
if (isNotEmpty(pstlAdr)) {
let adrLine = pstlAdr.adrLine;
let ctry = pstlAdr.ctry;
let twnNm = pstlAdr.twnNm;
var adrLine = pstlAdr.adrLine;
var ctry = pstlAdr.ctry;
var twnNm = pstlAdr.twnNm;
if (isEmpty(adrLine)) {
if (isEmpty(ctry) || isEmpty(twnNm)) {
message(position, msg);
......
......@@ -48,9 +48,9 @@ function r1() {
function r2(finInstnId) {
const position = 'Assigner/Agent/Financial Institution Identification'
const msg = "Either BIC or (Name and Postal Address) must be present and both can be present. Other elements remain optional."
let bicfi = finInstnId.bicfi;
let nm = finInstnId.nm;
let pstlAdr = finInstnId.pstlAdr;
var bicfi = finInstnId.bicfi;
var nm = finInstnId.nm;
var pstlAdr = finInstnId.pstlAdr;
if (isEmpty(bicfi)) {
if(isEmpty(nm)||isEmpty(pstlAdr)) {
message(position,msg);
......@@ -72,7 +72,7 @@ function r4(pstlAdr) {
const position = 'Assigner/Agent/Financial Institution Identification/Postal Address';
const msg = "If PostalAddress is used and if AddressLine is present, then all other optional elements in PostalAddress must be absent."
if(isNotEmpty(pstlAdr)&&isNotEmpty(pstlAdr.adrLine)) {
let temp = pstlAdr.adrLine
var temp = pstlAdr.adrLine
pstlAdr.adrLine = null;
if (isNotEmpty(pstlAdr)) {
message(position,msg);
......@@ -89,9 +89,9 @@ function r5(pstlAdr) {
const position = 'Assigner/Agent/Financial Institution Identification/Postal Address';
const msg = "If 'PostalAddress' is used, and if AddressLine is absent, then Country and Town name must be present.";
if(isNotEmpty(pstlAdr)){
let adrLine = pstlAdr.adrLine;
let ctry = pstlAdr.ctry;
let twnNm = pstlAdr.twnNm;
var adrLine = pstlAdr.adrLine;
var ctry = pstlAdr.ctry;
var twnNm = pstlAdr.twnNm;
if(isEmpty(adrLine)) {
if (isEmpty(ctry)||isEmpty(twnNm)) {
message(position,msg);
......@@ -106,9 +106,9 @@ function r5(pstlAdr) {
function r6(finInstnId) {
const position = 'Assignee/Agent/Financial Institution Identification';
const msg = "Either BIC or (Name and Postal Address) must be present and both can be present. Other elements remain optional."
let bicfi = finInstnId.bicfi;
let nm = finInstnId.nm;
let pstlAdr = finInstnId.pstlAdr;
var bicfi = finInstnId.bicfi;
var nm = finInstnId.nm;
var pstlAdr = finInstnId.pstlAdr;
if (isEmpty(bicfi)) {
if(isEmpty(nm)||isEmpty(pstlAdr)) {
message(position,msg);
......@@ -123,7 +123,7 @@ function r7(pstlAdr) {
const position = 'Assignee/Agent/Financial Institution Identification/Postal Address';
const msg = "If PostalAddress is used and if AddressLine is present, then all other optional elements in PostalAddress must be absent."
if(isNotEmpty(pstlAdr)&&isNotEmpty(pstlAdr.adrLine)) {
let temp = pstlAdr.adrLine
var temp = pstlAdr.adrLine
pstlAdr.adrLine = null;
if (isNotEmpty(pstlAdr)) {
message(position,msg);
......@@ -140,9 +140,9 @@ function r8(pstlAdr) {
const position = 'Assignee/Agent/Financial Institution Identification/Postal Address';
const msg = "If 'PostalAddress' is used, and if AddressLine is absent, then Country and Town name must be present.";
if(isNotEmpty(pstlAdr)){
let adrLine = pstlAdr.adrLine;
let ctry = pstlAdr.ctry;
let twnNm = pstlAdr.twnNm;
var adrLine = pstlAdr.adrLine;
var ctry = pstlAdr.ctry;
var twnNm = pstlAdr.twnNm;
if(isEmpty(adrLine)) {
if (isEmpty(ctry)||isEmpty(twnNm)) {
message(position,msg);
......@@ -227,9 +227,9 @@ function r18(pstlAdr) {
const position = 'Underlying/Transaction Information/Cancellation Reason Information/Originator/Postal Address';
const msg = "If 'PostalAddress' is used, and if AddressLine is absent, then Country and Town name must be present.";
if(isNotEmpty(pstlAdr)){
let adrLine = pstlAdr.adrLine;
let ctry = pstlAdr.ctry;
let twnNm = pstlAdr.twnNm;
var adrLine = pstlAdr.adrLine;
var ctry = pstlAdr.ctry;
var twnNm = pstlAdr.twnNm;
if(isEmpty(adrLine)) {
if (isEmpty(ctry)||isEmpty(twnNm)) {
message(position,msg);
......@@ -245,7 +245,7 @@ function r19(pstlAdr) {
const position = 'Underlying/Transaction Information/Cancellation Reason Information/Originator/Postal Address';
const msg = "If PostalAddress is used and if AddressLine is present, then all other optional elements in PostalAddress must be absent."
if(isNotEmpty(pstlAdr)&&isNotEmpty(pstlAdr.adrLine)) {
let temp = pstlAdr.adrLine
var temp = pstlAdr.adrLine
pstlAdr.adrLine = null;
if (isNotEmpty(pstlAdr)) {
message(position,msg);
......
......@@ -10,9 +10,9 @@ export default function validator(obj) {
}
//R6
let chrgsInf = obj.txInf.chrgsInf;
var chrgsInf = obj.txInf.chrgsInf;
if (isNotEmpty(chrgsInf)) {
for (let index = 0; index < chrgsInf.length; index++) {
for (var index = 0; index < chrgsInf.length; index++) {
const element = chrgsInf[index];
if (!HVPPlus_AgentsRule(element.agt.finInstnId,`Transaction Information/Charges Information[`+(index+1)+`]/Agent/Financial Institution Identification`)) {
return false;
......@@ -111,7 +111,7 @@ export default function validator(obj) {
//R7
if (isNotEmpty(chrgsInf)) {
for (let index = 0; index < chrgsInf.length; index++) {
for (var index = 0; index < chrgsInf.length; index++) {
const element = chrgsInf[index];
if (!StructuredVsUnstructuredRule(element.agt == undefined ? null : element.agt.finInstnId.pstlAdr,`Transaction Information/Charges Information[`+(index+1)+`]/Agent/Financial Institution Identification/Postal Address`)) {
return false;
......@@ -194,7 +194,7 @@ export default function validator(obj) {
//R8
if (isNotEmpty(chrgsInf)) {
for (let index = 0; index < chrgsInf.length; index++) {
for (var index = 0; index < chrgsInf.length; index++) {
const element = chrgsInf[index];
if (!TownNameAndCountryRule(element.agt.finInstnId.pstlAdr == undefined ? null : element.agt.finInstnId.pstlAdr,`Transaction Information/Charges Information[`+(index+1)+`]/Agent/Financial Institution Identification/Postal Address`)) {
return false;
......@@ -329,8 +329,8 @@ function HVPPlus_ReturnChain_Rule() {
function HKRTGS_CurrencyAmount(amt,position) {
const msg = "* The currency must be HKD, USD, EUR or CNY. The currency must be a supported settlement currency for the payment code."+
"<br/>* The amount must be greater than zero and at a maximum of 999,999,999,999.99. A maximum of two decimal point is supported.";
let ccy = amt.ccy;
let value = amt.value;
var ccy = amt.ccy;
var value = amt.value;
const inputValue = Decimal(value)
const maxValue = Decimal('999999999999.99')
const minValue = Decimal('0')
......@@ -356,9 +356,9 @@ function HVPSPlus_Amount() {
//BIC或(姓名和邮政地址)必须存在,并且两者都可以存在。其他元素仍然是可选的。
function HVPPlus_AgentsRule(finInstnId,position) {
const msg = "Either BIC or (Name and Postal Address) must be present and both can be present. Other elements remain optional.";
let bicfi = finInstnId.bicfi;
let nm = finInstnId.nm;
let pstlAdr = finInstnId.pstlAdr;
var bicfi = finInstnId.bicfi;
var nm = finInstnId.nm;
var pstlAdr = finInstnId.pstlAdr;
if (isEmpty(bicfi)) {
if(isEmpty(nm)||isEmpty(pstlAdr)) {
message(position,msg);
......@@ -372,7 +372,7 @@ function HVPPlus_AgentsRule(finInstnId,position) {
function StructuredVsUnstructuredRule(pstlAdr,position) {
const msg = "If PostalAddress is used and if AddressLine is present, then all other optional elements in PostalAddress must be absent.";
if(isNotEmpty(pstlAdr)&&isNotEmpty(pstlAdr.adrLine)) {
let temp = pstlAdr.adrLine
var temp = pstlAdr.adrLine
pstlAdr.adrLine = null;
if (isNotEmpty(pstlAdr)) {
message(position,msg);
......@@ -388,9 +388,9 @@ function StructuredVsUnstructuredRule(pstlAdr,position) {
function TownNameAndCountryRule(pstlAdr,position) {
const msg = "If “PostalAddress” is used, and if AddressLine is absent, then Country and Town name must be present.";
if(isNotEmpty(pstlAdr)){
let adrLine = pstlAdr.adrLine;
let ctry = pstlAdr.ctry;
let twnNm = pstlAdr.twnNm;
var adrLine = pstlAdr.adrLine;
var ctry = pstlAdr.ctry;
var twnNm = pstlAdr.twnNm;
if(isEmpty(adrLine)) {
if (isEmpty(ctry)||isEmpty(twnNm)) {
message(position,msg);
......@@ -457,8 +457,8 @@ function HVPPlus_NameAnyBICRule(Party,position) {
const msg = "If AnyBIC is Absent Then Name is mandatory."+
"<br/>at least one occurrence of [Party/Name] must be present "+
"<br/>when [Party/Identification/OrganisationIdentification/AnyBIC] is absent";
let nm = Party.nm;
let anyBIC = Party.id.orgId.anyBIC;
var nm = Party.nm;
var anyBIC = Party.id.orgId.anyBIC;
if (isNotEmpty(Party)) {
if (isEmpty(anyBIC)) {
if (isEmpty(nm)) {
......@@ -473,8 +473,8 @@ function HVPPlus_NameAnyBICRule(Party,position) {
//如果存在“Postal Address”,则“Name”是必填项。
function HVPPlus_NamePostalAddressRule(Party,position) {
const msg = "If Postal Address is present then Name is mandatory.";
let nm = Party.nm;
let pstlAdr = Party.pstlAdr;
var nm = Party.nm;
var pstlAdr = Party.pstlAdr;
if (isNotEmpty(Party)) {
if (isNotEmpty(pstlAdr)) {
if (isEmpty(nm)) {
......@@ -489,9 +489,9 @@ function HVPPlus_NamePostalAddressRule(Party,position) {
//AnyBIC或Name and Address必须存在,并且两者都可以存在。其他元素仍然是可选的。
function HVPPlus_PartiesRule(Party,position) {
const msg = "Either AnyBIC or Name and Address must be present and both can be present. Other elements remain optional.";
let nm = Party.nm;
let pstlAdr = Party.pstlAdr;
let anyBIC = Party.id.orgId.anyBIC;
var nm = Party.nm;
var pstlAdr = Party.pstlAdr;
var anyBIC = Party.id.orgId.anyBIC;
if (isNotEmpty(Party)) {
if (isEmpty(anyBIC)) {
if (isEmpty(nm)||isEmpty(pstlAdr)) {
......
......@@ -11,9 +11,9 @@ export default function validator(obj) {
}
//R17
let chrgsInf = obj.cdtTrfTxInf.chrgsInf;
var chrgsInf = obj.cdtTrfTxInf.chrgsInf;
if (isNotEmpty(chrgsInf)) {
for (let index = 0; index < chrgsInf.length; index++) {
for (var index = 0; index < chrgsInf.length; index++) {
const element = chrgsInf[index];
if (!HVPPlus_AgentsRule(element.agt.finInstnId, `Credit Transfer Transaction Information/Charges Information[` + (index + 1) + `]/Agent/Financial Institution Identification`)) {
return false;
......@@ -119,7 +119,7 @@ export default function validator(obj) {
//R19
if (isNotEmpty(chrgsInf)) {
for (let index = 0; index < chrgsInf.length; index++) {
for (var index = 0; index < chrgsInf.length; index++) {
const element = chrgsInf[index];
if (!StructuredVsUnstructuredRule(element.agt.finInstnId.pstlAdr, `Credit Transfer Transaction Information/Charges Information[` + (index + 1) + `]/Agent/Financial Institution Identification/Postal Address`)) {
return false;
......@@ -170,7 +170,7 @@ export default function validator(obj) {
//R18
if (isNotEmpty(chrgsInf)) {
for (let index = 0; index < chrgsInf.length; index++) {
for (var index = 0; index < chrgsInf.length; index++) {
const element = chrgsInf[index];
if (!TownNameAndCountryRule(element.agt.finInstnId.pstlAdr, `Credit Transfer Transaction Information/Charges Information[` + (index + 1) + `]/Agent/Financial Institution Identification/Postal Address`)) {
return false;
......@@ -230,10 +230,10 @@ export default function validator(obj) {
// 所有和支付代码相关的规则
function Category_Purpose_Rule(obj) {
let paymentCode = obj.cdtTrfTxInf.pmtTpInf.ctgyPurp.prtry;
var paymentCode = obj.cdtTrfTxInf.pmtTpInf.ctgyPurp.prtry;
// HKRTGS_ClearingMemberID2
if (paymentCode == "IFT51") {
let position = "Credit Transfer Transaction Information/Creditor Agent/Financial Institution Identification/Clearing System Member Identification/Clearing System Identification/Proprietary";
var position = "Credit Transfer Transaction Information/Creditor Agent/Financial Institution Identification/Clearing System Member Identification/Clearing System Identification/Proprietary";
const msg = "For payment code 51:" +
"<br/>* Possible values for Clearing System Identification:" +
"<br/>CUID - for representing //CH6!n (CHIPS Universal ID)" +
......@@ -241,7 +241,7 @@ function Category_Purpose_Rule(obj) {
"<br/>SPID - for representing /SPID/15x (Service Provider Identifier)" +
"<br/>* Either Code or Proprietary can be present but not both." +
"<br/>* The specified IP/ICU/Merging Bank Clearing Code, or CHIPS Universal Identifier, or other national clearing code, or the beneficiary bank identifier designated by Service Provider (SPID) must be a valid beneficiary bank identifier of the Service Provider of respective settlement currency (Receiver).";
let prtry = obj.cdtTrfTxInf.cdtrAgt.finInstnId.clrSysMmbId.clrSysId.prtry;
var prtry = obj.cdtTrfTxInf.cdtrAgt.finInstnId.clrSysMmbId.clrSysId.prtry;
if (isNotEmpty(prtry)) {
if (prtry!='CUID'||prtry!='NCLR'||prtry!='SPID') {
message(position,msg);
......@@ -250,10 +250,10 @@ function Category_Purpose_Rule(obj) {
}
} else if(paymentCode == "IFT35") {
// HKRTGS_InstructedAgent
let position = 'Credit Transfer Transaction Information/Instructing Agent or Instructed Agent';
var position = 'Credit Transfer Transaction Information/Instructing Agent or Instructed Agent';
const msg = "* For payment codes 35, either the instructing agent or instructed agent must be BKCHHKHHXXX, the agent bank of the RTGS link between Guangdong/Shenzhen and Hong Kong – Bank of China (Hong Kong), with clearing code 012.";
let instdBic = obj.cdtTrfTxInf.instdAgt.finInstnId.bicfi;
let instgBic = obj.cdtTrfTxInf.instgAgt.finInstnId.bicfi;
var instdBic = obj.cdtTrfTxInf.instdAgt.finInstnId.bicfi;
var instgBic = obj.cdtTrfTxInf.instgAgt.finInstnId.bicfi;
if (instdBic!='BKCHKHHXXX'&&instgBic!='BKCHKHHXXX') {
message(position,msg);
return false;
......@@ -300,8 +300,8 @@ function HKRTGS_ClearingMemberID2() {
function HKRTGS_CurrencyAmount(amt, position) {
const msg = "* The currency must be HKD, USD, EUR or CNY. The currency must be a supported settlement currency for the payment code." +
"<br/>* The amount must be greater than zero and at a maximum of 999,999,999,999.99. A maximum of two decimal point is supported.";
let ccy = amt.ccy;
let value = amt.value;
var ccy = amt.ccy;
var value = amt.value;
const inputValue = Decimal(value)
const maxValue = Decimal('999999999999.99')
const minValue = Decimal('0')
......@@ -395,9 +395,9 @@ function HKRTGS_SettlementMethod() {
//BIC或(姓名和邮政地址)必须存在,并且两者都可以存在。其他元素仍然是可选的。
function HVPPlus_AgentsRule(finInstnId, position) {
const msg = "Either BIC or (Name and Postal Address) must be present and both can be present. Other elements remain optional.";
let bicfi = finInstnId.bicfi;
let nm = finInstnId.nm;
let pstlAdr = finInstnId.pstlAdr;
var bicfi = finInstnId.bicfi;
var nm = finInstnId.nm;
var pstlAdr = finInstnId.pstlAdr;
if (isEmpty(bicfi)) {
if (isEmpty(nm) || isEmpty(pstlAdr)) {
message(position, msg);
......@@ -410,8 +410,8 @@ function HVPPlus_AgentsRule(finInstnId, position) {
//如果AnyBIC不存在,则名称为必填项。
function HVPPlus_NameAnyBICRule(Party, position) {
const msg = "If AnyBIC is Absent Then Name is mandatory.";
let nm = Party.nm;
let anyBIC = Party.id.orgId.anyBIC;
var nm = Party.nm;
var anyBIC = Party.id.orgId.anyBIC;
if (isNotEmpty(Party)) {
if (isEmpty(anyBIC)) {
if (isEmpty(nm)) {
......@@ -426,8 +426,8 @@ function HVPPlus_NameAnyBICRule(Party, position) {
//如果存在“Postal Address”,则“Name”是必填项。
function HVPPlus_NamePostalAddressRule(Party, position) {
const msg = "If Postal Address is present then Name is mandatory.";
let nm = Party.nm;
let pstlAdr = Party.pstlAdr;
var nm = Party.nm;
var pstlAdr = Party.pstlAdr;
if (isNotEmpty(Party)) {
if (isNotEmpty(pstlAdr)) {
if (isEmpty(nm)) {
......@@ -442,9 +442,9 @@ function HVPPlus_NamePostalAddressRule(Party, position) {
//AnyBIC或Name and Address必须存在,并且两者都可以存在。其他元素仍然是可选的。
function HVPPlus_PartiesRule(Party, position) {
const msg = "Either AnyBIC or Name and Address must be present and both can be present. Other elements remain optional.";
let nm = Party.nm;
let pstlAdr = Party.pstlAdr;
let anyBIC = Party.id.orgId.anyBIC;
var nm = Party.nm;
var pstlAdr = Party.pstlAdr;
var anyBIC = Party.id.orgId.anyBIC;
if (isNotEmpty(Party)) {
if (isEmpty(anyBIC)) {
if (isEmpty(nm)||isEmpty(pstlAdr)) {
......@@ -507,7 +507,7 @@ function Remittance_MutuallyExclusive() {
function StructuredVsUnstructuredRule(pstlAdr, position) {
const msg = "If PostalAddress is used and if AddressLine is present, then all other optional elements in PostalAddress must be absent.";
if (isNotEmpty(pstlAdr) && isNotEmpty(pstlAdr.adrLine)) {
let temp = pstlAdr.adrLine
var temp = pstlAdr.adrLine
pstlAdr.adrLine = null;
if (isNotEmpty(pstlAdr)) {
message(position, msg);
......@@ -529,9 +529,9 @@ function StructureVsUnstructuredRule() {
function TownNameAndCountryRule(pstlAdr, position) {
const msg = "If “PostalAddress” is used, and if AddressLine is absent, then Country and Town name must be present.";
if (isNotEmpty(pstlAdr)) {
let adrLine = pstlAdr.adrLine;
let ctry = pstlAdr.ctry;
let twnNm = pstlAdr.twnNm;
var adrLine = pstlAdr.adrLine;
var ctry = pstlAdr.ctry;
var twnNm = pstlAdr.twnNm;
if (isEmpty(adrLine)) {
if (isEmpty(ctry) || isEmpty(twnNm)) {
message(position, msg);
......
......@@ -321,33 +321,33 @@ export default function validator(obj) {
// 所有和支付代码相关的规则
function Category_Purpose_Rule(obj) {
let paymentCode = obj.cdtTrfTxInf.pmtTpInf.ctgyPurp.prtry;
var paymentCode = obj.cdtTrfTxInf.pmtTpInf.ctgyPurp.prtry;
if (paymentCode == "IFT31") {
//HKRTGS_CreditorAgentRule_DepositOfFund
let cdtrAgtPosition = 'Credit Transfer Transaction Information/Creditor Agent/Financial Institution Identification/BICFI';
var cdtrAgtPosition = 'Credit Transfer Transaction Information/Creditor Agent/Financial Institution Identification/BICFI';
const cdtrAgtmsg = "For payment code 31, the the CSD's BIC must be specified.";
let CreditorAgentBic = obj.cdtTrfTxInf.cdtrAgt.finInstnId.bicfi;
var CreditorAgentBic = obj.cdtTrfTxInf.cdtrAgt.finInstnId.bicfi;
if (isEmpty(CreditorAgentBic)) {
message(cdtrAgtPosition,cdtrAgtmsg);
return false;
}
//HKRTGS_CreditorRule_DepositOfFund
let cdtrPosition = 'Credit Transfer Transaction Information/Creditor/Financial Institution Identification/BICFI';
var cdtrPosition = 'Credit Transfer Transaction Information/Creditor/Financial Institution Identification/BICFI';
const cdtrmsg = "For payment code 31, the HKMA CMU BIC (HKMAHKHC) must be specified.";
let CreditorBic = obj.cdtTrfTxInf.cdtr.finInstnId.bicfi;
var CreditorBic = obj.cdtTrfTxInf.cdtr.finInstnId.bicfi;
if ("HKMAHKHC"!=CreditorBic) {
message(cdtrPosition,cdtrmsg);
return false;
}
} else if(paymentCode == "IFT08" || paymentCode == "IFT28") {
//HKRTGS_CreditorRule_PvP and HKRTGS_DebtorRule_PvP
let cdtrPosition = 'Credit Transfer Transaction Information/Creditor/Financial Institution Identification/BICFI';
var cdtrPosition = 'Credit Transfer Transaction Information/Creditor/Financial Institution Identification/BICFI';
const msg = "For payemnt code 08 or 28, " +
"<br/>* Debtor BIC must be present" +
"<br/>* Creditor BIC must be present." +
"<br/>* Creditor BIC must be different from Debtor BIC";
let CreditorBic = obj.cdtTrfTxInf.cdtr.finInstnId.bicfi;
let DebtorBic = obj.cdtTrfTxInf.dbtr.finInstnId.bicfi;
var CreditorBic = obj.cdtTrfTxInf.cdtr.finInstnId.bicfi;
var DebtorBic = obj.cdtTrfTxInf.dbtr.finInstnId.bicfi;
if (isEmpty(CreditorBic)||isEmpty(DebtorBic)) {
message(cdtrPosition,msg);
return false;
......@@ -356,11 +356,11 @@ function Category_Purpose_Rule(obj) {
return false;
}
if ( paymentCode == "IFT28") {
let ccyPosition = 'Credit Transfer Transaction Information/Interbank Settlement Amount/';
var ccyPosition = 'Credit Transfer Transaction Information/Interbank Settlement Amount/';
const ccymsg = "For CCPO payment, i.e. Cross Currency CHATS Optimiser Payment (payment code 28), the supported currency are HKD and RMB." +
"<br/>For HKD CCPO payment, its counter-party PvP leg must be a USD, EUR or RMB PvP payment (payment code 08)." +
"<br/>For RMB CCPO payment, its counter-party PvP leg must be a HKD, USD or EUR PvP payment";
let ccy = obj.cdtTrfTxInf.intrBkSttlmAmt.ccy;
var ccy = obj.cdtTrfTxInf.intrBkSttlmAmt.ccy;
if (ccy!="HKD"&&ccy!="CNY") {
message(ccyPosition,ccymsg);
return false;
......@@ -419,8 +419,8 @@ function HKRTGS_Currency_CCPO() {
function HKRTGS_CurrencyAmount(amt, position) {
const msg = "* The currency must be HKD, USD, EUR or CNY. The currency must be a supported settlement currency for the payment code." +
"<br/>* The amount must be greater than zero and at a maximum of 999,999,999,999.99. A maximum of two decimal point is supported.";
let ccy = amt.ccy;
let value = amt.value;
var ccy = amt.ccy;
var value = amt.value;
const inputValue = Decimal(value)
const maxValue = Decimal('999999999999.99')
const minValue = Decimal('0')
......@@ -506,9 +506,9 @@ function HKRTGS_SettlementDate() {
//BIC或(姓名和邮政地址)必须存在,并且两者都可以存在。其他元素仍然是可选的。
function HVPPlus_AgentsRule(finInstnId, position) {
const msg = "Either BIC or (Name and Postal Address) must be present and both can be present. Other elements remain optional.";
let bicfi = finInstnId.bicfi;
let nm = finInstnId.nm;
let pstlAdr = finInstnId.pstlAdr;
var bicfi = finInstnId.bicfi;
var nm = finInstnId.nm;
var pstlAdr = finInstnId.pstlAdr;
if (isEmpty(bicfi)) {
if (isEmpty(nm) || isEmpty(pstlAdr)) {
message(position, msg);
......@@ -521,8 +521,8 @@ function HVPPlus_AgentsRule(finInstnId, position) {
//如果AnyBIC不存在,则名称为必填项。
function HVPPlus_NameAnyBICRule(Party, position) {
const msg = "If AnyBIC is Absent Then Name is mandatory.";
let nm = Party.nm;
let anyBIC = Party.id.orgId.anyBIC;
var nm = Party.nm;
var anyBIC = Party.id.orgId.anyBIC;
if (isNotEmpty(Party)) {
if (isEmpty(anyBIC)) {
if (isEmpty(nm)) {
......@@ -537,8 +537,8 @@ function HVPPlus_NameAnyBICRule(Party, position) {
//如果存在“Postal Address”,则“Name”是必填项。
function HVPPlus_NamePostalAddressRule(Party, position) {
const msg = "If Postal Address is present then Name is mandatory.";
let nm = Party.nm;
let pstlAdr = Party.pstlAdr;
var nm = Party.nm;
var pstlAdr = Party.pstlAdr;
if (isNotEmpty(Party)) {
if (isNotEmpty(pstlAdr)) {
if (isEmpty(nm)) {
......@@ -553,9 +553,9 @@ function HVPPlus_NamePostalAddressRule(Party, position) {
//AnyBIC或Name and Address必须存在,并且两者都可以存在。其他元素仍然是可选的。
function HVPPlus_PartiesRule(Party, position) {
const msg = "Either AnyBIC or Name and Address must be present and both can be present. Other elements remain optional.";
let nm = Party.nm;
let pstlAdr = Party.pstlAdr;
let anyBIC = Party.id.orgId.anyBIC;
var nm = Party.nm;
var pstlAdr = Party.pstlAdr;
var anyBIC = Party.id.orgId.anyBIC;
if (isNotEmpty(Party)) {
if (isEmpty(anyBIC)) {
if (isEmpty(nm)||isEmpty(pstlAdr)) {
......@@ -613,7 +613,7 @@ function HVPPlusInstructionForCreditor_PresenceCodeRule() {
function StructuredVsUnstructuredRule(pstlAdr, position) {
const msg = "If PostalAddress is used and if AddressLine is present, then all other optional elements in PostalAddress must be absent.";
if (isNotEmpty(pstlAdr) && isNotEmpty(pstlAdr.adrLine)) {
let temp = pstlAdr.adrLine
var temp = pstlAdr.adrLine
pstlAdr.adrLine = null;
if (isNotEmpty(pstlAdr)) {
message(position, msg);
......@@ -634,9 +634,9 @@ function StructureVsUnstructuredRule() {
function TownNameAndCountryRule(pstlAdr, position) {
const msg = "If “PostalAddress” is used, and if AddressLine is absent, then Country and Town name must be present.";
if (isNotEmpty(pstlAdr)) {
let adrLine = pstlAdr.adrLine;
let ctry = pstlAdr.ctry;
let twnNm = pstlAdr.twnNm;
var adrLine = pstlAdr.adrLine;
var ctry = pstlAdr.ctry;
var twnNm = pstlAdr.twnNm;
if (isEmpty(adrLine)) {
if (isEmpty(ctry) || isEmpty(twnNm)) {
message(position, msg);
......
......@@ -79,8 +79,8 @@ function HKRTGS_ClearingCode() {
function HKRTGS_CurrencyAmount(amt, position) {
const msg = "* The currency must be HKD, USD, EUR or CNY. The currency must be a supported settlement currency for the payment code." +
"<br/>* The amount must be greater than zero and at a maximum of 999,999,999,999.99. A maximum of two decimal point is supported.";
let ccy = amt.ccy;
let value = amt.value;
var ccy = amt.ccy;
var value = amt.value;
const inputValue = Decimal(value)
const maxValue = Decimal('999999999999.99')
const minValue = Decimal('0')
......@@ -173,11 +173,11 @@ function HVPPlus_NoBICNoClearingRule(finInstnId) {
"<br/>- Clearing System Member Identification" +
"<br/>- LEI" +
"<br/>- Name and Postal Address (either Structured or Unstructured and “If Structured is used, Town Name and Country Code must be present”)"
let bicfi = finInstnId.bicfi;
let clrSysMmbId = finInstnId.clrSysMmbId;
let lei = finInstnId.lei;
let nm = finInstnId.nm;
let pstlAdr = finInstnId.pstlAdr;
var bicfi = finInstnId.bicfi;
var clrSysMmbId = finInstnId.clrSysMmbId;
var lei = finInstnId.lei;
var nm = finInstnId.nm;
var pstlAdr = finInstnId.pstlAdr;
if (isNotEmpty(finInstnId)) {
if (isEmpty(bicfi) && isEmpty(clrSysMmbId) && isEmpty(lei)) {
if (isEmpty(nm) || isEmpty(pstlAdr)) {
......@@ -218,7 +218,7 @@ function HVPSPlus_MessageIdentification() {
function StructuredVsUnstructuredRule(pstlAdr, position) {
const msg = "If PostalAddress is used and if AddressLine is present, then all other optional elements in PostalAddress must be absent.";
if (isNotEmpty(pstlAdr) && isNotEmpty(pstlAdr.adrLine)) {
let temp = pstlAdr.adrLine
var temp = pstlAdr.adrLine
pstlAdr.adrLine = null;
if (isNotEmpty(pstlAdr)) {
message(position, msg);
......@@ -234,9 +234,9 @@ function StructuredVsUnstructuredRule(pstlAdr, position) {
function TownNameAndCountryRule(pstlAdr, position) {
const msg = "If “PostalAddress” is used, and if AddressLine is absent, then Country and Town name must be present.";
if (isNotEmpty(pstlAdr)) {
let adrLine = pstlAdr.adrLine;
let ctry = pstlAdr.ctry;
let twnNm = pstlAdr.twnNm;
var adrLine = pstlAdr.adrLine;
var ctry = pstlAdr.ctry;
var twnNm = pstlAdr.twnNm;
if (isEmpty(adrLine)) {
if (isEmpty(ctry) || isEmpty(twnNm)) {
message(position, msg);
......
......@@ -7,6 +7,11 @@ import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css";
import locale from 'element-ui/lib/locale/lang/en'
import moment from 'moment';
import Es6Promise from 'es6-promise'
require('es6-promise').polyfill()
Es6Promise.polyfill()
var Promise = require('es6-promise').Promise;
Promise.polyfill()
Vue.prototype.$moment = moment ;
Vue.config.productionTip = false;
......
import VueRouter from "vue-router";
import ISO from "../iso/pages/index.vue";
import ISO2 from "../iso/pages/indexrtgs.vue";
import index from "../iso/index.vue";
import indexcips from "../iso/indexcips.vue";
import success from "../iso/pages/success.vue";
......@@ -27,11 +26,6 @@ export default new VueRouter({
props: true,
},
{
path: "/rtgs/:mty/:loginUser",
component: ISO2,
props: true,
},
{
path: "/",
component: index,
},
......
const { defineConfig } = require("@vue/cli-service");
module.exports = defineConfig({
publicPath: "./",
transpileDependencies: true,
chainWebpack (config) {
config.entry('main').add('babel-polyfill')
},
transpileDependencies:process.env.NODE_ENV === "development" ? ["*"] : [] ,
lintOnSave: false,
devServer: {
host: '0.0.0.0',
......@@ -17,5 +20,5 @@ module.exports = defineConfig({
headers: {
'Content-Type': 'text/html; charset=utf-8',
},
}
},
});
File added
#ip=127.0.0.1
#port=10091
ip=10.37.91.132
#ip=10.37.91.132
#port=9998
ip=10.37.98.201
port=9998
\ No newline at end of file
<!doctype html><html lang=""><head><meta charset="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width,initial-scale=1"/><link rel="icon" href="favicon.ico"/><title>ISO手工拟报</title><script defer="defer" src="js/chunk-vendors.80ffbb63.js"></script><script defer="defer" src="js/app.0c774191.js"></script><link href="css/chunk-vendors.7c88cb4c.css" rel="stylesheet"><link href="css/app.481e4eb6.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but swiftiso-editor doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
\ No newline at end of file
<!doctype html><html lang=""><head><meta charset="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width,initial-scale=1"/><link rel="icon" href="favicon.ico"/><title>ISO手工拟报</title><script defer="defer" src="js/chunk-vendors.e1d592f1.js"></script><script defer="defer" src="js/app.06c3df70.js"></script><script defer="defer" src="js/main.91e00e4c.js"></script><link href="css/chunk-vendors.b3e1a118.css" rel="stylesheet"><link href="css/app.1503674a.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but swiftiso-editor doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
\ No newline at end of file
......@@ -92,7 +92,7 @@ public class TestCIPS {
@Test
public void testcipsToMap()throws IOException {
File file = new File(System.getProperty("user.dir")+"\\src\\main\\resources\\json\\cips.111.001.02.xml");
File file = new File(System.getProperty("user.dir")+"\\src\\main\\resources\\json\\00871965.cps");
String gsonStr = FileUtils.readFileToString(file, "UTF-8");
Map<String, Object> gsonMaps = MsgUtil.cips2Map(file);
String swiftGsonStr = new JSONObject(gsonMaps).toJSONString();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment