index.js 1.74 KB
import commonFunctions from '~/mixin/commonFunctions.js';
import moment from 'moment';
import BigNumber from 'bignumber.js';
export default {
	mixins: [commonFunctions],
	methods: {
		docamtChange(){
			if(this.model.setmod.docamt!=""){
				this.model.aamset.utlamt=this.model.setmod.docamt;
			}
			this.sftmtChange();
		},
		newmatdatChange(){
			if(this.model.liaall&&this.model.liaall.liaallg){
				for(var i=0;i<this.model.liaall.liaallg.length;i++){
					if(this.model.liaall.liaallg[i].cbtpfx=="AKZ"){
						this.model.liaall.liaallg[i].modifySet.push("matdat");
						this.model.bddgrp.rec.matdat = this.model.newmatdat;
						this.model.bddgrp.rec.stadat = moment(this.model.bddgrp.rec.matdat).subtract(this.model.bddgrp.rec.tenmaxday, 'days').format('YYYY-MM-DD');
						break;
					}
				}
			}
			this.sftmtChange();
		},
		sftmtChange(){
			if(this.model.sftmt==""){
				this.model.bdtp.tag72add="";
			}
			else{
				if(this.model.bdtp.modifySet && this.model.bdtp.modifySet.includes('tag72add')){
				}
				else{
					//this.model.bdtp.tag72add="We acknowledge receipt of documents and will settle as follows:";
					this.model.bdtp.tag72add="YOUR REF.: " + (this.model.bddgrp.rec.sndref==""?this.model.bddgrp.prb.pts.ref:this.model.bddgrp.rec.sndref)+"\n"
					+"PLEASE BE ADVISED THAT DRAFTS/DOCUMENTS UNDER THE "
					+"ABOVE ITEM FOR "+ this.model.setmod.doccur + " " + new BigNumber(this.model.setmod.docamt).toFormat(2)+ " HAVE BEEN "
					+"ACCEPTED. PAYMENT WILL BE EFFECTED AS PER YOUR "
					+"INSTRUCTIONS AT MATURITY "+moment(this.model.newmatdat).format("D MMM.,YYYY")+". "
					+"THE MATURITY DATE WILL BE EXTENDED TO THE FIRST "
					+"FOLLOWING BANKING DAY IF THE DUE DATE FALLS ON A "
					+"NON-BANKING DAY."+"\n"
					+"RGDS.";
				}
			}
		}
	}
}