1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
// import Settle from "~/model/Public/Settle.js";
function buildData(model) {
// this.settle = new Settle().data;
this.model = model;
}
buildData.prototype.buildDoceot = function () {
let doceots = [];
let doceotList = this.model.trnmod.trndoc.doceot;
for (let eot of doceotList) {
let doceot = {};
doceot.cortyp = eot.cortyp;
doceot.docsnf = eot.docsnf;
doceot.lev = eot.lev;
doceot.rcv = this.buildPtspta(eot.rcv);
doceots.push(doceot);
}
return doceots;
}
buildData.prototype.buildPtydet = function () {
let ptydet = {};
ptydet.rol = ptsptaObj.pts.rol;
ptydet.dftfeecur = ptsptaObj.pts.dftfeecur;
return ptydet;
}
buildData.prototype.buildPtspta = function () {
let ptspta = {};
let pts = ptsptaObj.pts;
let adr = ptsptaObj.adr;
ptspta.rol = pts.rol;
ptspta.name = pts.nam;
ptspta.ptyinr = pts.ptyinr;
ptspta.ptainr = pts.ptainr;
ptspta.extkey = pts.extkey;
ptspta.dftdsp = pts.dftdsp;
ptspta.dftcur = pts.dftcur;
ptspta.dftact = pts.dftact;
ptspta.dftfeecur = pts.dftfeecur;
ptspta.dftactptainr = pts.dftactptainr;
//ptspta.dftselrol=
ptspta.glggrpflg = pts.glggrpflg;
//ptspta.pansta=
//ptspta.ptytyp=
//ptspta.ptyextkey=
ptspta.adrblk = pts.adrblk;
//ptspta.rolsetflg=
if (adr !== null && adr !== undefined) {
ptspta.adrbic = adr.bic;
ptspta.adrLoccty = adr.loccty;
}
return ptspta;
}
buildData.prototype.buildGlepan = function () {
// let rec = {};
let cbsMap = {};
this.model.settle.rec.objtyp = "GID";
this.model.settle.rec.ownref = this.model.gidgrp.rec.ownref;
// this.model.settle.rec.objtyp = this.model.gidgrp.rec.objtyp;
this.model.settle.rec.branchInr = this.model.gidgrp.rec.branchInr;
this.model.settle.rec.detchgcod = this.model.gidgrp.rec.detchgcod;
this.model.settle.rec.paytyp = this.model.gidgrp.rec.paytyp;
this.model.settle.rec.swftyp = this.model.gidgrp.rec.swftyp;
this.model.settle.rec.valdat = this.model.gidgrp.rec.valdat;
this.model.settle.rec.gartyp = this.model.gidgrp.rec.gartyp;
// = rec;
// cbsMap.NOM1 = {
// "cur": this.model.gidgrp.cbs.nom1.cur,
// "amt": this.model.gidgrp.cbs.nom1.amt,
// }
// cbsMap.OPN1 = {};
// cbsMap.OPN2 = {
// "cur": this.model.gidgrp.cbs.opn2.cur,
// "amt": this.model.gidgrp.cbs.opn2.amt,
// }
// cbsMap.MAX = {
// "cur": this.model.gidgrp.cbs.max.cur,
// "amt": this.model.gidgrp.cbs.max.amt,
// }
// cbsMap.MAX2 = {
// "cur": this.model.gidgrp.cbs.max2.cur,
// "amt": this.model.gidgrp.cbs.max2.amt,
// }
Object.keys(this.model.gidgrp.cbs).forEach(key=>{
cbsMap[key.toUpperCase()]= {...this.model.gidgrp.cbs[key]};
})
this.model.settle.cbsMap = cbsMap;
let ptsptaList = [];
let ptydetList = [];
if (this.model.gidgrp.apl.pts.extkey !== "") {
ptsptaList.push(this.model.gidgrp.apl.pts);
// ptydetList.push(this.buildPtydet(this.model.gidgrp.apl));
}
if (this.model.gidgrp.adv.pts.extkey !== "") {
ptsptaList.push(this.model.gidgrp.adv.pts);
// ptydetList.push(this.buildPtydet(this.model.gidgrp.adv));
}
if (this.model.gidgrp.ben.pts.extkey !== "") {
ptsptaList.push(this.model.gidgrp.ben.pts);
// ptydetList.push(this.buildPtydet(this.model.gidgrp.ben));
}
this.model.settle.ptsList = ptsptaList;
this.model.settle.ptydet = ptydetList;
this.model.settle.setglg.setgll = [];
this.model.settle.setfog.setfol = [];
this.model.settle.setfeg.setfel = [];
this.model.settle.doceotList = this.buildDoceot();
//console.log(this.model);
this.model.settle.transName = this.model.gidgrp.transName;
// if (!!window.sessionStorage.userId) {
// this.model.settle.userId = window.sessionStorage.userId;
// } else {
// }
this.model.settle.userId = "742549";
}
export default buildData;