提交 e73df5cd 编写于 作者: ibizdev's avatar ibizdev

xignzi006 发布系统代码

上级 3b20e7f0
......@@ -665,6 +665,7 @@ export default {
address1_city: "地址 1: 市/县",
primarycontactname: "主要联系人",
emailaddress1: "电子邮件",
revenue: "年收入",
parentaccountname: "上级客户",
},
uiactions: {
......
......@@ -664,6 +664,7 @@ export default {
address1_city: "地址 1: 市/县",
primarycontactname: "主要联系人",
emailaddress1: "电子邮件",
revenue: "年收入",
parentaccountname: "上级客户",
},
uiactions: {
......
......@@ -2122,17 +2122,421 @@ mock.onGet(new RegExp(/^\/invoices\/fetchbyparentkey(\?[\w-./?%&=,]*)*$/)).reply
});
// FetchCancel
mock.onGet(new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/invoices\/fetchcancel$/)).reply((config: any) => {
console.groupCollapsed("实体:invoice 方法: FetchCancel");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['accountid','contactid','opportunityid','quoteid','salesorderid'];
let tempValue: any = {};
const matchArray:any = new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/invoices\/fetchcancel$/).exec(config.url);
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
if (items.length > 0 && paramArray.length > 0) {
paramArray.forEach((paramkey: any) => {
if (tempValue[paramkey] && tempValue[paramkey].indexOf(";") > 0) {
let keysGrounp: Array<any> = tempValue[paramkey].split(new RegExp(/[\;]/));
let tempArray: Array<any> = [];
keysGrounp.forEach((singlekey: any) => {
let _items = items.filter((item: any) => { return item[paramkey] == singlekey });
if(_items.length >0){
tempArray.push(..._items);
}
})
items = tempArray;
} else {
items = items.filter((item: any) => { return item[paramkey] == tempValue[paramkey] });
}
})
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(items);
console.groupEnd();
console.groupEnd();
return [status, items];
});
// FetchCancel
mock.onGet(new RegExp(/^\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/invoices\/fetchcancel$/)).reply((config: any) => {
console.groupCollapsed("实体:invoice 方法: FetchCancel");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['contactid','opportunityid','quoteid','salesorderid'];
let tempValue: any = {};
const matchArray:any = new RegExp(/^\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/invoices\/fetchcancel$/).exec(config.url);
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
if (items.length > 0 && paramArray.length > 0) {
paramArray.forEach((paramkey: any) => {
if (tempValue[paramkey] && tempValue[paramkey].indexOf(";") > 0) {
let keysGrounp: Array<any> = tempValue[paramkey].split(new RegExp(/[\;]/));
let tempArray: Array<any> = [];
keysGrounp.forEach((singlekey: any) => {
let _items = items.filter((item: any) => { return item[paramkey] == singlekey });
if(_items.length >0){
tempArray.push(..._items);
}
})
items = tempArray;
} else {
items = items.filter((item: any) => { return item[paramkey] == tempValue[paramkey] });
}
})
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(items);
console.groupEnd();
console.groupEnd();
return [status, items];
});
// FetchCancel
mock.onGet(new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/invoices\/fetchcancel$/)).reply((config: any) => {
console.groupCollapsed("实体:invoice 方法: FetchCancel");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['accountid','opportunityid','quoteid','salesorderid'];
let tempValue: any = {};
const matchArray:any = new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/invoices\/fetchcancel$/).exec(config.url);
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
if (items.length > 0 && paramArray.length > 0) {
paramArray.forEach((paramkey: any) => {
if (tempValue[paramkey] && tempValue[paramkey].indexOf(";") > 0) {
let keysGrounp: Array<any> = tempValue[paramkey].split(new RegExp(/[\;]/));
let tempArray: Array<any> = [];
keysGrounp.forEach((singlekey: any) => {
let _items = items.filter((item: any) => { return item[paramkey] == singlekey });
if(_items.length >0){
tempArray.push(..._items);
}
})
items = tempArray;
} else {
items = items.filter((item: any) => { return item[paramkey] == tempValue[paramkey] });
}
})
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(items);
console.groupEnd();
console.groupEnd();
return [status, items];
});
// FetchCancel
mock.onGet(new RegExp(/^\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/invoices\/fetchcancel$/)).reply((config: any) => {
console.groupCollapsed("实体:invoice 方法: FetchCancel");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['opportunityid','quoteid','salesorderid'];
let tempValue: any = {};
const matchArray:any = new RegExp(/^\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/invoices\/fetchcancel$/).exec(config.url);
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
if (items.length > 0 && paramArray.length > 0) {
paramArray.forEach((paramkey: any) => {
if (tempValue[paramkey] && tempValue[paramkey].indexOf(";") > 0) {
let keysGrounp: Array<any> = tempValue[paramkey].split(new RegExp(/[\;]/));
let tempArray: Array<any> = [];
keysGrounp.forEach((singlekey: any) => {
let _items = items.filter((item: any) => { return item[paramkey] == singlekey });
if(_items.length >0){
tempArray.push(..._items);
}
})
items = tempArray;
} else {
items = items.filter((item: any) => { return item[paramkey] == tempValue[paramkey] });
}
})
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(items);
console.groupEnd();
console.groupEnd();
return [status, items];
});
// FetchCancel
mock.onGet(new RegExp(/^\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/invoices\/fetchcancel$/)).reply((config: any) => {
console.groupCollapsed("实体:invoice 方法: FetchCancel");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['quoteid','salesorderid'];
let tempValue: any = {};
const matchArray:any = new RegExp(/^\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/invoices\/fetchcancel$/).exec(config.url);
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
if (items.length > 0 && paramArray.length > 0) {
paramArray.forEach((paramkey: any) => {
if (tempValue[paramkey] && tempValue[paramkey].indexOf(";") > 0) {
let keysGrounp: Array<any> = tempValue[paramkey].split(new RegExp(/[\;]/));
let tempArray: Array<any> = [];
keysGrounp.forEach((singlekey: any) => {
let _items = items.filter((item: any) => { return item[paramkey] == singlekey });
if(_items.length >0){
tempArray.push(..._items);
}
})
items = tempArray;
} else {
items = items.filter((item: any) => { return item[paramkey] == tempValue[paramkey] });
}
})
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(items);
console.groupEnd();
console.groupEnd();
return [status, items];
});
// FetchCancel
mock.onGet(new RegExp(/^\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/invoices\/fetchcancel$/)).reply((config: any) => {
console.groupCollapsed("实体:invoice 方法: FetchCancel");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['salesorderid'];
let tempValue: any = {};
const matchArray:any = new RegExp(/^\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/invoices\/fetchcancel$/).exec(config.url);
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
if (items.length > 0 && paramArray.length > 0) {
paramArray.forEach((paramkey: any) => {
if (tempValue[paramkey] && tempValue[paramkey].indexOf(";") > 0) {
let keysGrounp: Array<any> = tempValue[paramkey].split(new RegExp(/[\;]/));
let tempArray: Array<any> = [];
keysGrounp.forEach((singlekey: any) => {
let _items = items.filter((item: any) => { return item[paramkey] == singlekey });
if(_items.length >0){
tempArray.push(..._items);
}
})
items = tempArray;
} else {
items = items.filter((item: any) => { return item[paramkey] == tempValue[paramkey] });
}
})
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(items);
console.groupEnd();
console.groupEnd();
return [status, items];
});
// FetchCancel
mock.onGet(new RegExp(/^\/invoices\/fetchcancel$/)).reply((config: any) => {
console.groupCollapsed("实体:invoice 方法: FetchCancel");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(mockDatas);
console.groupEnd();
console.groupEnd();
return [status, mockDatas ? mockDatas : []];
});
// FetchCancel
mock.onGet(new RegExp(/^\/invoices\/fetchcancel(\?[\w-./?%&=,]*)*$/)).reply((config: any) => {
console.groupCollapsed("实体:invoice 方法: FetchCancel");
console.table({url:config.url, method: config.method, data:config.data});
if(config.url.includes('page')){
let url = config.url.split('?')[1];
let params = qs.parse(url);
Object.assign(config, params);
}
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
let total = mockDatas.length;
let records: Array<any> = [];
if(!config.page || !config.size){
records = mockDatas;
}else{
if((config.page-1)*config.size < total){
records = mockDatas.slice(config.page,config.size);
}
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(records ? records : []);
console.groupEnd();
console.groupEnd();
return [status, records ? records : []];
});
// FetchDefault
mock.onGet(new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/invoices\/fetchdefault$/)).reply((config: any) => {
console.groupCollapsed("实体:invoice 方法: FetchDefault");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['accountid','contactid','opportunityid','quoteid','salesorderid'];
let tempValue: any = {};
const matchArray:any = new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/invoices\/fetchdefault$/).exec(config.url);
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
if (items.length > 0 && paramArray.length > 0) {
paramArray.forEach((paramkey: any) => {
if (tempValue[paramkey] && tempValue[paramkey].indexOf(";") > 0) {
let keysGrounp: Array<any> = tempValue[paramkey].split(new RegExp(/[\;]/));
let tempArray: Array<any> = [];
keysGrounp.forEach((singlekey: any) => {
let _items = items.filter((item: any) => { return item[paramkey] == singlekey });
if(_items.length >0){
tempArray.push(..._items);
}
})
items = tempArray;
} else {
items = items.filter((item: any) => { return item[paramkey] == tempValue[paramkey] });
}
})
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(items);
console.groupEnd();
console.groupEnd();
return [status, items];
});
// FetchDefault
mock.onGet(new RegExp(/^\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/invoices\/fetchdefault$/)).reply((config: any) => {
console.groupCollapsed("实体:invoice 方法: FetchDefault");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['contactid','opportunityid','quoteid','salesorderid'];
let tempValue: any = {};
const matchArray:any = new RegExp(/^\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/invoices\/fetchdefault$/).exec(config.url);
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
if (items.length > 0 && paramArray.length > 0) {
paramArray.forEach((paramkey: any) => {
if (tempValue[paramkey] && tempValue[paramkey].indexOf(";") > 0) {
let keysGrounp: Array<any> = tempValue[paramkey].split(new RegExp(/[\;]/));
let tempArray: Array<any> = [];
keysGrounp.forEach((singlekey: any) => {
let _items = items.filter((item: any) => { return item[paramkey] == singlekey });
if(_items.length >0){
tempArray.push(..._items);
}
})
items = tempArray;
} else {
items = items.filter((item: any) => { return item[paramkey] == tempValue[paramkey] });
}
})
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(items);
console.groupEnd();
console.groupEnd();
return [status, items];
});
// FetchDefault
mock.onGet(new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/invoices\/fetchdefault$/)).reply((config: any) => {
mock.onGet(new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/invoices\/fetchdefault$/)).reply((config: any) => {
console.groupCollapsed("实体:invoice 方法: FetchDefault");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['accountid','contactid','opportunityid','quoteid','salesorderid'];
const paramArray:Array<any> = ['accountid','opportunityid','quoteid','salesorderid'];
let tempValue: any = {};
const matchArray:any = new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/invoices\/fetchdefault$/).exec(config.url);
const matchArray:any = new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/invoices\/fetchdefault$/).exec(config.url);
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
......@@ -2168,16 +2572,16 @@ mock.onGet(new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/contacts\/([a-zA-Z0
// FetchDefault
mock.onGet(new RegExp(/^\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/invoices\/fetchdefault$/)).reply((config: any) => {
mock.onGet(new RegExp(/^\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/invoices\/fetchdefault$/)).reply((config: any) => {
console.groupCollapsed("实体:invoice 方法: FetchDefault");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['contactid','opportunityid','quoteid','salesorderid'];
const paramArray:Array<any> = ['opportunityid','quoteid','salesorderid'];
let tempValue: any = {};
const matchArray:any = new RegExp(/^\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/invoices\/fetchdefault$/).exec(config.url);
const matchArray:any = new RegExp(/^\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/invoices\/fetchdefault$/).exec(config.url);
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
......@@ -2213,16 +2617,16 @@ mock.onGet(new RegExp(/^\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-
// FetchDefault
mock.onGet(new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/invoices\/fetchdefault$/)).reply((config: any) => {
mock.onGet(new RegExp(/^\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/invoices\/fetchdefault$/)).reply((config: any) => {
console.groupCollapsed("实体:invoice 方法: FetchDefault");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['accountid','opportunityid','quoteid','salesorderid'];
const paramArray:Array<any> = ['quoteid','salesorderid'];
let tempValue: any = {};
const matchArray:any = new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/invoices\/fetchdefault$/).exec(config.url);
const matchArray:any = new RegExp(/^\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/invoices\/fetchdefault$/).exec(config.url);
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
......@@ -2258,16 +2662,16 @@ mock.onGet(new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-
// FetchDefault
mock.onGet(new RegExp(/^\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/invoices\/fetchdefault$/)).reply((config: any) => {
mock.onGet(new RegExp(/^\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/invoices\/fetchdefault$/)).reply((config: any) => {
console.groupCollapsed("实体:invoice 方法: FetchDefault");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['opportunityid','quoteid','salesorderid'];
const paramArray:Array<any> = ['salesorderid'];
let tempValue: any = {};
const matchArray:any = new RegExp(/^\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/invoices\/fetchdefault$/).exec(config.url);
const matchArray:any = new RegExp(/^\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/invoices\/fetchdefault$/).exec(config.url);
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
......@@ -2301,18 +2705,242 @@ mock.onGet(new RegExp(/^\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA
return [status, items];
});
// FetchDefault
mock.onGet(new RegExp(/^\/invoices\/fetchdefault$/)).reply((config: any) => {
console.groupCollapsed("实体:invoice 方法: FetchDefault");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(mockDatas);
console.groupEnd();
console.groupEnd();
return [status, mockDatas ? mockDatas : []];
});
// FetchDefault
mock.onGet(new RegExp(/^\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/invoices\/fetchdefault$/)).reply((config: any) => {
mock.onGet(new RegExp(/^\/invoices\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply((config: any) => {
console.groupCollapsed("实体:invoice 方法: FetchDefault");
console.table({url:config.url, method: config.method, data:config.data});
if(config.url.includes('page')){
let url = config.url.split('?')[1];
let params = qs.parse(url);
Object.assign(config, params);
}
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
let total = mockDatas.length;
let records: Array<any> = [];
if(!config.page || !config.size){
records = mockDatas;
}else{
if((config.page-1)*config.size < total){
records = mockDatas.slice(config.page,config.size);
}
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(records ? records : []);
console.groupEnd();
console.groupEnd();
return [status, records ? records : []];
});
// FetchPaid
mock.onGet(new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/invoices\/fetchpaid$/)).reply((config: any) => {
console.groupCollapsed("实体:invoice 方法: FetchPaid");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['accountid','contactid','opportunityid','quoteid','salesorderid'];
let tempValue: any = {};
const matchArray:any = new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/invoices\/fetchpaid$/).exec(config.url);
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
if (items.length > 0 && paramArray.length > 0) {
paramArray.forEach((paramkey: any) => {
if (tempValue[paramkey] && tempValue[paramkey].indexOf(";") > 0) {
let keysGrounp: Array<any> = tempValue[paramkey].split(new RegExp(/[\;]/));
let tempArray: Array<any> = [];
keysGrounp.forEach((singlekey: any) => {
let _items = items.filter((item: any) => { return item[paramkey] == singlekey });
if(_items.length >0){
tempArray.push(..._items);
}
})
items = tempArray;
} else {
items = items.filter((item: any) => { return item[paramkey] == tempValue[paramkey] });
}
})
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(items);
console.groupEnd();
console.groupEnd();
return [status, items];
});
// FetchPaid
mock.onGet(new RegExp(/^\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/invoices\/fetchpaid$/)).reply((config: any) => {
console.groupCollapsed("实体:invoice 方法: FetchPaid");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['contactid','opportunityid','quoteid','salesorderid'];
let tempValue: any = {};
const matchArray:any = new RegExp(/^\/contacts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/invoices\/fetchpaid$/).exec(config.url);
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
if (items.length > 0 && paramArray.length > 0) {
paramArray.forEach((paramkey: any) => {
if (tempValue[paramkey] && tempValue[paramkey].indexOf(";") > 0) {
let keysGrounp: Array<any> = tempValue[paramkey].split(new RegExp(/[\;]/));
let tempArray: Array<any> = [];
keysGrounp.forEach((singlekey: any) => {
let _items = items.filter((item: any) => { return item[paramkey] == singlekey });
if(_items.length >0){
tempArray.push(..._items);
}
})
items = tempArray;
} else {
items = items.filter((item: any) => { return item[paramkey] == tempValue[paramkey] });
}
})
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(items);
console.groupEnd();
console.groupEnd();
return [status, items];
});
// FetchPaid
mock.onGet(new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/invoices\/fetchpaid$/)).reply((config: any) => {
console.groupCollapsed("实体:invoice 方法: FetchPaid");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['accountid','opportunityid','quoteid','salesorderid'];
let tempValue: any = {};
const matchArray:any = new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/invoices\/fetchpaid$/).exec(config.url);
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
if (items.length > 0 && paramArray.length > 0) {
paramArray.forEach((paramkey: any) => {
if (tempValue[paramkey] && tempValue[paramkey].indexOf(";") > 0) {
let keysGrounp: Array<any> = tempValue[paramkey].split(new RegExp(/[\;]/));
let tempArray: Array<any> = [];
keysGrounp.forEach((singlekey: any) => {
let _items = items.filter((item: any) => { return item[paramkey] == singlekey });
if(_items.length >0){
tempArray.push(..._items);
}
})
items = tempArray;
} else {
items = items.filter((item: any) => { return item[paramkey] == tempValue[paramkey] });
}
})
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(items);
console.groupEnd();
console.groupEnd();
return [status, items];
});
// FetchPaid
mock.onGet(new RegExp(/^\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/invoices\/fetchpaid$/)).reply((config: any) => {
console.groupCollapsed("实体:invoice 方法: FetchPaid");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['opportunityid','quoteid','salesorderid'];
let tempValue: any = {};
const matchArray:any = new RegExp(/^\/opportunities\/([a-zA-Z0-9\-\;]{1,35})\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/invoices\/fetchpaid$/).exec(config.url);
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
if (items.length > 0 && paramArray.length > 0) {
paramArray.forEach((paramkey: any) => {
if (tempValue[paramkey] && tempValue[paramkey].indexOf(";") > 0) {
let keysGrounp: Array<any> = tempValue[paramkey].split(new RegExp(/[\;]/));
let tempArray: Array<any> = [];
keysGrounp.forEach((singlekey: any) => {
let _items = items.filter((item: any) => { return item[paramkey] == singlekey });
if(_items.length >0){
tempArray.push(..._items);
}
})
items = tempArray;
} else {
items = items.filter((item: any) => { return item[paramkey] == tempValue[paramkey] });
}
})
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(items);
console.groupEnd();
console.groupEnd();
return [status, items];
});
// FetchPaid
mock.onGet(new RegExp(/^\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/invoices\/fetchpaid$/)).reply((config: any) => {
console.groupCollapsed("实体:invoice 方法: FetchPaid");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['quoteid','salesorderid'];
let tempValue: any = {};
const matchArray:any = new RegExp(/^\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/invoices\/fetchdefault$/).exec(config.url);
const matchArray:any = new RegExp(/^\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/invoices\/fetchpaid$/).exec(config.url);
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
......@@ -2347,9 +2975,9 @@ mock.onGet(new RegExp(/^\/quotes\/([a-zA-Z0-9\-\;]{1,35})\/salesorders\/([a-zA-Z
});
// FetchDefault
mock.onGet(new RegExp(/^\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/invoices\/fetchdefault$/)).reply((config: any) => {
console.groupCollapsed("实体:invoice 方法: FetchDefault");
// FetchPaid
mock.onGet(new RegExp(/^\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/invoices\/fetchpaid$/)).reply((config: any) => {
console.groupCollapsed("实体:invoice 方法: FetchPaid");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......@@ -2357,7 +2985,7 @@ mock.onGet(new RegExp(/^\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/invoices\/fetchd
}
const paramArray:Array<any> = ['salesorderid'];
let tempValue: any = {};
const matchArray:any = new RegExp(/^\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/invoices\/fetchdefault$/).exec(config.url);
const matchArray:any = new RegExp(/^\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/invoices\/fetchpaid$/).exec(config.url);
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
......@@ -2391,9 +3019,9 @@ mock.onGet(new RegExp(/^\/salesorders\/([a-zA-Z0-9\-\;]{1,35})\/invoices\/fetchd
return [status, items];
});
// FetchDefault
mock.onGet(new RegExp(/^\/invoices\/fetchdefault$/)).reply((config: any) => {
console.groupCollapsed("实体:invoice 方法: FetchDefault");
// FetchPaid
mock.onGet(new RegExp(/^\/invoices\/fetchpaid$/)).reply((config: any) => {
console.groupCollapsed("实体:invoice 方法: FetchPaid");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......@@ -2406,9 +3034,9 @@ mock.onGet(new RegExp(/^\/invoices\/fetchdefault$/)).reply((config: any) => {
return [status, mockDatas ? mockDatas : []];
});
// FetchDefault
mock.onGet(new RegExp(/^\/invoices\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply((config: any) => {
console.groupCollapsed("实体:invoice 方法: FetchDefault");
// FetchPaid
mock.onGet(new RegExp(/^\/invoices\/fetchpaid(\?[\w-./?%&=,]*)*$/)).reply((config: any) => {
console.groupCollapsed("实体:invoice 方法: FetchPaid");
console.table({url:config.url, method: config.method, data:config.data});
if(config.url.includes('page')){
let url = config.url.split('?')[1];
......
<studio-view-style2 viewName="activitypointergridview" viewTitle="活动" class='degridview activity-pointer-grid-view'>
<template slot='title'>
<span class='caption-info'>{{$t(model.srfTitle)}}</span>
</template>
<i-input slot="quickSearch" v-show="!isExpandSearchForm" v-model="query" search @on-search="onSearch($event)"/>
<template slot="quickGroupSearch">
<app-quick-group :items="quickGroupModel" @valuechange="quickGroupValueChange($event)"></app-quick-group>
......
......@@ -65,21 +65,21 @@ export default class AccountServiceBase extends EntityService {
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
let listaccountsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts'),'undefined')){
listaccountsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts') as any);
if(listaccountsData && listaccountsData.length && listaccountsData.length > 0){
listaccountsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
masterData.listaccounts = listaccountsData;
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
......@@ -95,36 +95,36 @@ export default class AccountServiceBase extends EntityService {
}
}
masterData.opportunities = opportunitiesData;
let listaccountsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts'),'undefined')){
listaccountsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts') as any);
if(listaccountsData && listaccountsData.length && listaccountsData.length > 0){
listaccountsData.forEach((item:any) => {
let contactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_contacts'),'undefined')){
contactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_contacts') as any);
if(contactsData && contactsData.length && contactsData.length > 0){
contactsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.contactid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listaccounts = listaccountsData;
let contactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_contacts'),'undefined')){
contactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_contacts') as any);
if(contactsData && contactsData.length && contactsData.length > 0){
contactsData.forEach((item:any) => {
masterData.contacts = contactsData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.contactid = null;
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.contacts = contactsData;
masterData.leads = leadsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -134,10 +134,10 @@ export default class AccountServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/accounts`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(tempContext.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
......@@ -152,21 +152,21 @@ export default class AccountServiceBase extends EntityService {
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
let listaccountsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts'),'undefined')){
listaccountsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts') as any);
if(listaccountsData && listaccountsData.length && listaccountsData.length > 0){
listaccountsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
masterData.listaccounts = listaccountsData;
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
......@@ -182,42 +182,42 @@ export default class AccountServiceBase extends EntityService {
}
}
masterData.opportunities = opportunitiesData;
let listaccountsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts'),'undefined')){
listaccountsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts') as any);
if(listaccountsData && listaccountsData.length && listaccountsData.length > 0){
listaccountsData.forEach((item:any) => {
let contactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_contacts'),'undefined')){
contactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_contacts') as any);
if(contactsData && contactsData.length && contactsData.length > 0){
contactsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.contactid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listaccounts = listaccountsData;
let contactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_contacts'),'undefined')){
contactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_contacts') as any);
if(contactsData && contactsData.length && contactsData.length > 0){
contactsData.forEach((item:any) => {
masterData.contacts = contactsData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.contactid = null;
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.contacts = contactsData;
masterData.leads = leadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
......@@ -245,10 +245,10 @@ export default class AccountServiceBase extends EntityService {
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/accounts/${context.account}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
......@@ -264,10 +264,10 @@ export default class AccountServiceBase extends EntityService {
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/accounts/getdraft`,isloading);
res.data.account = data.account;
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
......@@ -338,21 +338,21 @@ export default class AccountServiceBase extends EntityService {
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
let listaccountsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts'),'undefined')){
listaccountsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts') as any);
if(listaccountsData && listaccountsData.length && listaccountsData.length > 0){
listaccountsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
masterData.listaccounts = listaccountsData;
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
......@@ -368,42 +368,42 @@ export default class AccountServiceBase extends EntityService {
}
}
masterData.opportunities = opportunitiesData;
let listaccountsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts'),'undefined')){
listaccountsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts') as any);
if(listaccountsData && listaccountsData.length && listaccountsData.length > 0){
listaccountsData.forEach((item:any) => {
let contactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_contacts'),'undefined')){
contactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_contacts') as any);
if(contactsData && contactsData.length && contactsData.length > 0){
contactsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.contactid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listaccounts = listaccountsData;
let contactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_contacts'),'undefined')){
contactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_contacts') as any);
if(contactsData && contactsData.length && contactsData.length > 0){
contactsData.forEach((item:any) => {
masterData.contacts = contactsData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.contactid = null;
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.contacts = contactsData;
masterData.leads = leadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
......
......@@ -62,21 +62,6 @@ export default class CampaignServiceBase extends EntityService {
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
let campaignlistsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists'),'undefined')){
campaignlistsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists') as any);
......@@ -107,6 +92,21 @@ export default class CampaignServiceBase extends EntityService {
}
}
masterData.campaigncampaigns = campaigncampaignsData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -116,9 +116,9 @@ export default class CampaignServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/campaigns`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(tempContext.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(tempContext.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
......@@ -133,21 +133,6 @@ export default class CampaignServiceBase extends EntityService {
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
let campaignlistsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists'),'undefined')){
campaignlistsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists') as any);
......@@ -178,11 +163,26 @@ export default class CampaignServiceBase extends EntityService {
}
}
masterData.campaigncampaigns = campaigncampaignsData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/campaigns/${context.campaign}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
......@@ -210,9 +210,9 @@ export default class CampaignServiceBase extends EntityService {
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/campaigns/${context.campaign}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
......@@ -228,9 +228,9 @@ export default class CampaignServiceBase extends EntityService {
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/campaigns/getdraft`,isloading);
res.data.campaign = data.campaign;
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
......@@ -258,21 +258,6 @@ export default class CampaignServiceBase extends EntityService {
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
let campaignlistsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists'),'undefined')){
campaignlistsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists') as any);
......@@ -303,11 +288,26 @@ export default class CampaignServiceBase extends EntityService {
}
}
masterData.campaigncampaigns = campaigncampaignsData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/campaigns/${context.campaign}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
......
......@@ -62,11 +62,11 @@ export default class CompetitorServiceBase extends EntityService {
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
let competitorproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_competitorproducts'),'undefined')){
competitorproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_competitorproducts') as any);
if(competitorproductsData && competitorproductsData.length && competitorproductsData.length > 0){
competitorproductsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -76,12 +76,12 @@ export default class CompetitorServiceBase extends EntityService {
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
let competitorproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_competitorproducts'),'undefined')){
competitorproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_competitorproducts') as any);
if(competitorproductsData && competitorproductsData.length && competitorproductsData.length > 0){
competitorproductsData.forEach((item:any) => {
masterData.competitorproducts = competitorproductsData;
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -91,7 +91,7 @@ export default class CompetitorServiceBase extends EntityService {
});
}
}
masterData.competitorproducts = competitorproductsData;
masterData.leadcompetitors = leadcompetitorsData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
......@@ -116,8 +116,8 @@ export default class CompetitorServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/competitors`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(tempContext.srfsessionkey+'_competitorproducts',JSON.stringify(res.data.competitorproducts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
......@@ -133,11 +133,11 @@ export default class CompetitorServiceBase extends EntityService {
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
let competitorproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_competitorproducts'),'undefined')){
competitorproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_competitorproducts') as any);
if(competitorproductsData && competitorproductsData.length && competitorproductsData.length > 0){
competitorproductsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -147,12 +147,12 @@ export default class CompetitorServiceBase extends EntityService {
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
let competitorproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_competitorproducts'),'undefined')){
competitorproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_competitorproducts') as any);
if(competitorproductsData && competitorproductsData.length && competitorproductsData.length > 0){
competitorproductsData.forEach((item:any) => {
masterData.competitorproducts = competitorproductsData;
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -162,7 +162,7 @@ export default class CompetitorServiceBase extends EntityService {
});
}
}
masterData.competitorproducts = competitorproductsData;
masterData.leadcompetitors = leadcompetitorsData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
......@@ -180,8 +180,8 @@ export default class CompetitorServiceBase extends EntityService {
masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/competitors/${context.competitor}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_competitorproducts',JSON.stringify(res.data.competitorproducts));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
......@@ -210,8 +210,8 @@ export default class CompetitorServiceBase extends EntityService {
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/competitors/${context.competitor}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_competitorproducts',JSON.stringify(res.data.competitorproducts));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
......@@ -228,8 +228,8 @@ export default class CompetitorServiceBase extends EntityService {
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/competitors/getdraft`,isloading);
res.data.competitor = data.competitor;
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_competitorproducts',JSON.stringify(res.data.competitorproducts));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
......@@ -258,11 +258,11 @@ export default class CompetitorServiceBase extends EntityService {
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
let competitorproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_competitorproducts'),'undefined')){
competitorproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_competitorproducts') as any);
if(competitorproductsData && competitorproductsData.length && competitorproductsData.length > 0){
competitorproductsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -272,12 +272,12 @@ export default class CompetitorServiceBase extends EntityService {
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
let competitorproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_competitorproducts'),'undefined')){
competitorproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_competitorproducts') as any);
if(competitorproductsData && competitorproductsData.length && competitorproductsData.length > 0){
competitorproductsData.forEach((item:any) => {
masterData.competitorproducts = competitorproductsData;
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -287,7 +287,7 @@ export default class CompetitorServiceBase extends EntityService {
});
}
}
masterData.competitorproducts = competitorproductsData;
masterData.leadcompetitors = leadcompetitorsData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
......@@ -305,8 +305,8 @@ export default class CompetitorServiceBase extends EntityService {
masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/competitors/${context.competitor}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_competitorproducts',JSON.stringify(res.data.competitorproducts));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
......
......@@ -68,21 +68,6 @@ export default class ContactServiceBase extends EntityService {
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && true){
let masterData:any = {};
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
......@@ -113,21 +98,6 @@ export default class ContactServiceBase extends EntityService {
}
}
masterData.listcontacts = listcontactsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
return res;
}
let masterData:any = {};
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
......@@ -143,6 +113,21 @@ export default class ContactServiceBase extends EntityService {
}
}
masterData.leads = leadsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
let masterData:any = {};
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
......@@ -173,6 +158,21 @@ export default class ContactServiceBase extends EntityService {
}
}
masterData.listcontacts = listcontactsData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -182,9 +182,9 @@ export default class ContactServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/contacts`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
......@@ -200,21 +200,6 @@ export default class ContactServiceBase extends EntityService {
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact){
let masterData:any = {};
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
......@@ -245,14 +230,6 @@ export default class ContactServiceBase extends EntityService {
}
}
masterData.listcontacts = listcontactsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/contacts/${context.contact}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
return res;
}
let masterData:any = {};
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
......@@ -268,6 +245,14 @@ export default class ContactServiceBase extends EntityService {
}
}
masterData.leads = leadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/contacts/${context.contact}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
let masterData:any = {};
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
......@@ -298,11 +283,26 @@ export default class ContactServiceBase extends EntityService {
}
}
masterData.listcontacts = listcontactsData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/contacts/${context.contact}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
......@@ -334,15 +334,15 @@ export default class ContactServiceBase extends EntityService {
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
let res:any = await Http.getInstance().get(`/contacts/${context.contact}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
......@@ -359,16 +359,16 @@ export default class ContactServiceBase extends EntityService {
if(context.account && true){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/contacts/getdraft`,isloading);
res.data.contact = data.contact;
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
let res:any = await Http.getInstance().get(`/contacts/getdraft`,isloading);
res.data.contact = data.contact;
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
......@@ -399,21 +399,6 @@ export default class ContactServiceBase extends EntityService {
public async AddList(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact){
let masterData:any = {};
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
......@@ -444,11 +429,26 @@ export default class ContactServiceBase extends EntityService {
}
}
masterData.listcontacts = listcontactsData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/addlist`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
return Http.getInstance().post(`/contacts/${context.contact}/addlist`,data,isloading);
......@@ -466,21 +466,6 @@ export default class ContactServiceBase extends EntityService {
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact){
let masterData:any = {};
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
......@@ -511,11 +496,26 @@ export default class ContactServiceBase extends EntityService {
}
}
masterData.listcontacts = listcontactsData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
return Http.getInstance().post(`/contacts/${context.contact}/checkkey`,data,isloading);
......@@ -548,21 +548,6 @@ export default class ContactServiceBase extends EntityService {
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact){
let masterData:any = {};
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
......@@ -593,14 +578,6 @@ export default class ContactServiceBase extends EntityService {
}
}
masterData.listcontacts = listcontactsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
return res;
}
let masterData:any = {};
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
......@@ -616,6 +593,14 @@ export default class ContactServiceBase extends EntityService {
}
}
masterData.leads = leadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
let masterData:any = {};
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
......@@ -646,11 +631,26 @@ export default class ContactServiceBase extends EntityService {
}
}
masterData.listcontacts = listcontactsData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
......@@ -666,21 +666,6 @@ export default class ContactServiceBase extends EntityService {
public async SetPrimary(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact){
let masterData:any = {};
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
......@@ -711,11 +696,26 @@ export default class ContactServiceBase extends EntityService {
}
}
masterData.listcontacts = listcontactsData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/setprimary`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
return Http.getInstance().post(`/contacts/${context.contact}/setprimary`,data,isloading);
......
......@@ -62,21 +62,6 @@ export default class IBizListServiceBase extends EntityService {
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let campaignlistsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists'),'undefined')){
campaignlistsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists') as any);
if(campaignlistsData && campaignlistsData.length && campaignlistsData.length > 0){
campaignlistsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.campaignlists = campaignlistsData;
let listaccountsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts'),'undefined')){
listaccountsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts') as any);
......@@ -122,6 +107,21 @@ export default class IBizListServiceBase extends EntityService {
}
}
masterData.listcontacts = listcontactsData;
let campaignlistsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists'),'undefined')){
campaignlistsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists') as any);
if(campaignlistsData && campaignlistsData.length && campaignlistsData.length > 0){
campaignlistsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.campaignlists = campaignlistsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -131,10 +131,10 @@ export default class IBizListServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/ibizlists`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
return res;
}
......@@ -149,21 +149,6 @@ export default class IBizListServiceBase extends EntityService {
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let campaignlistsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists'),'undefined')){
campaignlistsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists') as any);
if(campaignlistsData && campaignlistsData.length && campaignlistsData.length > 0){
campaignlistsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.campaignlists = campaignlistsData;
let listaccountsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts'),'undefined')){
listaccountsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts') as any);
......@@ -209,12 +194,27 @@ export default class IBizListServiceBase extends EntityService {
}
}
masterData.listcontacts = listcontactsData;
let campaignlistsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists'),'undefined')){
campaignlistsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists') as any);
if(campaignlistsData && campaignlistsData.length && campaignlistsData.length > 0){
campaignlistsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.campaignlists = campaignlistsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/ibizlists/${context.ibizlist}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
return res;
}
......@@ -242,10 +242,10 @@ export default class IBizListServiceBase extends EntityService {
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/ibizlists/${context.ibizlist}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
return res;
}
......@@ -261,10 +261,10 @@ export default class IBizListServiceBase extends EntityService {
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/ibizlists/getdraft`,isloading);
res.data.ibizlist = data.ibizlist;
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
return res;
}
......@@ -292,21 +292,6 @@ export default class IBizListServiceBase extends EntityService {
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let campaignlistsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists'),'undefined')){
campaignlistsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists') as any);
if(campaignlistsData && campaignlistsData.length && campaignlistsData.length > 0){
campaignlistsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.campaignlists = campaignlistsData;
let listaccountsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts'),'undefined')){
listaccountsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts') as any);
......@@ -352,12 +337,27 @@ export default class IBizListServiceBase extends EntityService {
}
}
masterData.listcontacts = listcontactsData;
let campaignlistsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists'),'undefined')){
campaignlistsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists') as any);
if(campaignlistsData && campaignlistsData.length && campaignlistsData.length > 0){
campaignlistsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.campaignlists = campaignlistsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/ibizlists/${context.ibizlist}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
return res;
}
......
import { Verify } from '@/utils/verify/verify';
/**
* 取消发票
*
* @export
* @class CancelLogicBase
*/
export default class CancelLogicBase {
/**
* 名称
*
* @memberof CancelLogicBase
*/
private name:string ="Cancel";
/**
* 唯一标识
*
* @memberof CancelLogicBase
*/
private id:string = "9A2B78B2-DC42-4EE1-96D4-507FAB73DE1D";
/**
* 默认参数名称
*
* @memberof CancelLogicBase
*/
private defaultParamName:string = "Default";
/**
* 参数集合
*
* @memberof CancelLogicBase
*/
private paramsMap:Map<string,any> = new Map();
/**
* Creates an instance of CancelLogicBase.
*
* @param {*} [opts={}]
* @memberof CancelLogicBase
*/
constructor(opts: any = {}) {
this.initParams(opts);
}
/**
* 初始化参数集合
*
* @param {*} [opts={}]
* @memberof CancelLogicBase
*/
public initParams(opts:any){
this.paramsMap.set('Default',opts);
}
/**
* 执行逻辑
*
* @param context 应用上下文
* @param params 传入参数
*/
public onExecute(context:any,params:any,isloading:boolean){
return this.executeBegin(context,params,isloading);
}
/**
* 开始
*
* @param params 传入参数
*/
private async executeBegin(context:any,params:any,isloading:boolean){
//开始节点
return this.paramsMap.get(this.defaultParamName).data;
}
}
\ No newline at end of file
import { Http,Util } from '@/utils';
import CancelLogicBase from './cancel-logic-base';
/**
* 取消发票
*
* @export
* @class CancelLogic
*/
export default class CancelLogic extends CancelLogicBase{
/**
* Creates an instance of CancelLogic
*
* @param {*} [opts={}]
* @memberof CancelLogic
*/
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
import { Http,Util } from '@/utils';
import EntityService from '../entity-service';
import CancelLogic from '@/service/invoice/cancel-logic';
import PaidLogic from '@/service/invoice/paid-logic';
......@@ -1356,6 +1358,44 @@ export default class InvoiceServiceBase extends EntityService {
return Http.getInstance().get(`/invoices/fetchbyparentkey`,tempData,isloading);
}
/**
* FetchCancel接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof InvoiceServiceBase
*/
public async FetchCancel(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && context.quote && context.salesorder && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/invoices/fetchcancel`,tempData,isloading);
}
if(context.contact && context.opportunity && context.quote && context.salesorder && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/invoices/fetchcancel`,tempData,isloading);
}
if(context.account && context.opportunity && context.quote && context.salesorder && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/invoices/fetchcancel`,tempData,isloading);
}
if(context.opportunity && context.quote && context.salesorder && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/invoices/fetchcancel`,tempData,isloading);
}
if(context.quote && context.salesorder && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/quotes/${context.quote}/salesorders/${context.salesorder}/invoices/fetchcancel`,tempData,isloading);
}
if(context.salesorder && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/salesorders/${context.salesorder}/invoices/fetchcancel`,tempData,isloading);
}
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/invoices/fetchcancel`,tempData,isloading);
}
/**
* FetchDefault接口方法
*
......@@ -1393,4 +1433,42 @@ export default class InvoiceServiceBase extends EntityService {
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/invoices/fetchdefault`,tempData,isloading);
}
/**
* FetchPaid接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof InvoiceServiceBase
*/
public async FetchPaid(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && context.quote && context.salesorder && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/invoices/fetchpaid`,tempData,isloading);
}
if(context.contact && context.opportunity && context.quote && context.salesorder && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/invoices/fetchpaid`,tempData,isloading);
}
if(context.account && context.opportunity && context.quote && context.salesorder && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/invoices/fetchpaid`,tempData,isloading);
}
if(context.opportunity && context.quote && context.salesorder && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/invoices/fetchpaid`,tempData,isloading);
}
if(context.quote && context.salesorder && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/quotes/${context.quote}/salesorders/${context.salesorder}/invoices/fetchpaid`,tempData,isloading);
}
if(context.salesorder && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/salesorders/${context.salesorder}/invoices/fetchpaid`,tempData,isloading);
}
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/invoices/fetchpaid`,tempData,isloading);
}
}
\ No newline at end of file
import InvoiceService from '@/service/invoice/invoice-service';
import { Verify } from '@/utils/verify/verify';
/**
* 发票已支付
*
* @export
* @class PaidLogicBase
*/
export default class PaidLogicBase {
/**
* 名称
*
* @memberof PaidLogicBase
*/
private name:string ="Paid";
/**
* 唯一标识
*
* @memberof PaidLogicBase
*/
private id:string = "72CD98D0-46C7-4BE7-9FE6-44BB8CE4E5FC";
/**
* 默认参数名称
*
* @memberof PaidLogicBase
*/
private defaultParamName:string = "Default";
/**
* 参数集合
*
* @memberof PaidLogicBase
*/
private paramsMap:Map<string,any> = new Map();
/**
* Creates an instance of PaidLogicBase.
*
* @param {*} [opts={}]
* @memberof PaidLogicBase
*/
constructor(opts: any = {}) {
this.initParams(opts);
}
/**
* 初始化参数集合
*
* @param {*} [opts={}]
* @memberof PaidLogicBase
*/
public initParams(opts:any){
this.paramsMap.set('Default',opts);
}
/**
* 计算0节点结果
*
* @param params 传入参数
*/
public compute0Cond(params:any):boolean{
return true;
}
/**
* 计算1节点结果
*
* @param params 传入参数
*/
public compute1Cond(params:any):boolean{
return true;
}
/**
* 执行逻辑
*
* @param context 应用上下文
* @param params 传入参数
*/
public onExecute(context:any,params:any,isloading:boolean){
return this.executeBegin(context,params,isloading);
}
/**
* 准备参数
*
* @param context 应用上下文
* @param params 传入参数
*/
private async executePrepareparam1(context:any,params:any,isloading:boolean){
// 准备参数节点
let tempDstParam0Context:any = this.paramsMap.get('Default').context?this.paramsMap.get('Default').context:{};
let tempDstParam0Data:any = this.paramsMap.get('Default').data?this.paramsMap.get('Default').data:{};
Object.assign(tempDstParam0Data,{statecode:"2"});
this.paramsMap.set('Default',{data:tempDstParam0Data,context:tempDstParam0Context});
if(this.compute1Cond(params)){
return this.executeDeaction1(context,params,isloading);
}
}
/**
* 开始
*
* @param params 传入参数
*/
private async executeBegin(context:any,params:any,isloading:boolean){
//开始节点
if(this.compute0Cond(params)){
return this.executePrepareparam1(context,params,isloading);
}
}
/**
* 更新发票状态
*
* @param context 应用上下文
* @param params 传入参数
*/
private async executeDeaction1(context:any,params:any,isloading:boolean){
// 行为处理节点
let result: any;
let actionParam:any = this.paramsMap.get('Default');
const targetService:InvoiceService = new InvoiceService();
if (targetService['Update'] && targetService['Update'] instanceof Function) {
result = await targetService['Update'](actionParam.context,actionParam.data, false);
}
if(result && result.status == 200){
Object.assign(actionParam.data,result.data);
return this.paramsMap.get(this.defaultParamName).data;
}
}
}
\ No newline at end of file
import { Http,Util } from '@/utils';
import PaidLogicBase from './paid-logic-base';
/**
* 发票已支付
*
* @export
* @class PaidLogic
*/
export default class PaidLogic extends PaidLogicBase{
/**
* Creates an instance of PaidLogic
*
* @param {*} [opts={}]
* @memberof PaidLogic
*/
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
......@@ -74,21 +74,6 @@ export default class OpportunityServiceBase extends EntityService {
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && true){
let masterData:any = {};
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -119,22 +104,6 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.quotes = quotesData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
return res;
}
if(context.contact && true){
let masterData:any = {};
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
......@@ -150,6 +119,22 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
if(context.contact && true){
let masterData:any = {};
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -180,22 +165,6 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.quotes = quotesData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
return res;
}
if(context.account && true){
let masterData:any = {};
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
......@@ -211,6 +180,22 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
if(context.account && true){
let masterData:any = {};
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -241,21 +226,6 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.quotes = quotesData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/accounts/${context.account}/opportunities`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
return res;
}
let masterData:any = {};
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
......@@ -271,6 +241,21 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/accounts/${context.account}/opportunities`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
let masterData:any = {};
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -301,6 +286,21 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.quotes = quotesData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -310,9 +310,9 @@ export default class OpportunityServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/opportunities`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
......@@ -328,21 +328,6 @@ export default class OpportunityServiceBase extends EntityService {
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity){
let masterData:any = {};
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -373,15 +358,6 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.quotes = quotesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
return res;
}
if(context.contact && context.opportunity){
let masterData:any = {};
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
......@@ -397,6 +373,15 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
if(context.contact && context.opportunity){
let masterData:any = {};
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -427,15 +412,6 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.quotes = quotesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/contacts/${context.contact}/opportunities/${context.opportunity}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
return res;
}
if(context.account && context.opportunity){
let masterData:any = {};
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
......@@ -451,6 +427,15 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/contacts/${context.contact}/opportunities/${context.opportunity}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
if(context.account && context.opportunity){
let masterData:any = {};
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -481,14 +466,6 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.quotes = quotesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/opportunities/${context.opportunity}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
return res;
}
let masterData:any = {};
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
......@@ -504,6 +481,14 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/opportunities/${context.opportunity}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
let masterData:any = {};
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -534,11 +519,26 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.quotes = quotesData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/opportunities/${context.opportunity}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
......@@ -576,29 +576,29 @@ export default class OpportunityServiceBase extends EntityService {
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
if(context.contact && context.opportunity){
let res:any = await Http.getInstance().get(`/contacts/${context.contact}/opportunities/${context.opportunity}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
if(context.account && context.opportunity){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/opportunities/${context.opportunity}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
let res:any = await Http.getInstance().get(`/opportunities/${context.opportunity}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
......@@ -615,32 +615,32 @@ export default class OpportunityServiceBase extends EntityService {
if(context.account && context.contact && true){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}/opportunities/getdraft`,isloading);
res.data.opportunity = data.opportunity;
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
if(context.contact && true){
let res:any = await Http.getInstance().get(`/contacts/${context.contact}/opportunities/getdraft`,isloading);
res.data.opportunity = data.opportunity;
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
if(context.account && true){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/opportunities/getdraft`,isloading);
res.data.opportunity = data.opportunity;
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
let res:any = await Http.getInstance().get(`/opportunities/getdraft`,isloading);
res.data.opportunity = data.opportunity;
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
......@@ -656,21 +656,6 @@ export default class OpportunityServiceBase extends EntityService {
public async Active(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity){
let masterData:any = {};
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -701,15 +686,6 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.quotes = quotesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/active`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
return res;
}
if(context.contact && context.opportunity){
let masterData:any = {};
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
......@@ -725,6 +701,15 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/active`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
if(context.contact && context.opportunity){
let masterData:any = {};
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -755,15 +740,6 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.quotes = quotesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/active`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
return res;
}
if(context.account && context.opportunity){
let masterData:any = {};
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
......@@ -779,6 +755,15 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/active`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
if(context.account && context.opportunity){
let masterData:any = {};
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -809,11 +794,26 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.quotes = quotesData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/opportunities/${context.opportunity}/active`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
return Http.getInstance().post(`/opportunities/${context.opportunity}/active`,data,isloading);
......@@ -831,21 +831,6 @@ export default class OpportunityServiceBase extends EntityService {
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity){
let masterData:any = {};
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -876,15 +861,6 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.quotes = quotesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
return res;
}
if(context.contact && context.opportunity){
let masterData:any = {};
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
......@@ -900,6 +876,15 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
if(context.contact && context.opportunity){
let masterData:any = {};
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -930,15 +915,6 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.quotes = quotesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
return res;
}
if(context.account && context.opportunity){
let masterData:any = {};
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
......@@ -954,6 +930,15 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
if(context.account && context.opportunity){
let masterData:any = {};
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -984,11 +969,26 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.quotes = quotesData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/opportunities/${context.opportunity}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
return Http.getInstance().post(`/opportunities/${context.opportunity}/checkkey`,data,isloading);
......@@ -1021,21 +1021,6 @@ export default class OpportunityServiceBase extends EntityService {
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity){
let masterData:any = {};
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -1066,15 +1051,6 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.quotes = quotesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
return res;
}
if(context.contact && context.opportunity){
let masterData:any = {};
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
......@@ -1090,6 +1066,15 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
if(context.contact && context.opportunity){
let masterData:any = {};
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -1120,15 +1105,6 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.quotes = quotesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
return res;
}
if(context.account && context.opportunity){
let masterData:any = {};
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
......@@ -1144,6 +1120,15 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
if(context.account && context.opportunity){
let masterData:any = {};
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -1174,14 +1159,6 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.quotes = quotesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/opportunities/${context.opportunity}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
return res;
}
let masterData:any = {};
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
......@@ -1197,6 +1174,14 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/opportunities/${context.opportunity}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
let masterData:any = {};
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -1227,11 +1212,26 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData.quotes = quotesData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/opportunities/${context.opportunity}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
......
......@@ -62,21 +62,21 @@ export default class ProductServiceBase extends EntityService {
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let productassociationsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productassociations'),'undefined')){
productassociationsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productassociations') as any);
if(productassociationsData && productassociationsData.length && productassociationsData.length > 0){
productassociationsData.forEach((item:any) => {
let productsubstitutesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes'),'undefined')){
productsubstitutesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes') as any);
if(productsubstitutesData && productsubstitutesData.length && productsubstitutesData.length > 0){
productsubstitutesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.productassociationid = null;
item.productsubstituteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.productassociations = productassociationsData;
masterData.productsubstitutes = productsubstitutesData;
let productpricelevelsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productpricelevels'),'undefined')){
productpricelevelsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productpricelevels') as any);
......@@ -92,21 +92,21 @@ export default class ProductServiceBase extends EntityService {
}
}
masterData.productpricelevels = productpricelevelsData;
let productsubstitutesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes'),'undefined')){
productsubstitutesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes') as any);
if(productsubstitutesData && productsubstitutesData.length && productsubstitutesData.length > 0){
productsubstitutesData.forEach((item:any) => {
let productassociationsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productassociations'),'undefined')){
productassociationsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productassociations') as any);
if(productassociationsData && productassociationsData.length && productassociationsData.length > 0){
productassociationsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.productsubstituteid = null;
item.productassociationid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.productsubstitutes = productsubstitutesData;
masterData.productassociations = productassociationsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -116,9 +116,9 @@ export default class ProductServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/products`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations));
this.tempStorage.setItem(tempContext.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
this.tempStorage.setItem(tempContext.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes));
this.tempStorage.setItem(tempContext.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
this.tempStorage.setItem(tempContext.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations));
return res;
}
......@@ -133,21 +133,21 @@ export default class ProductServiceBase extends EntityService {
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let productassociationsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productassociations'),'undefined')){
productassociationsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productassociations') as any);
if(productassociationsData && productassociationsData.length && productassociationsData.length > 0){
productassociationsData.forEach((item:any) => {
let productsubstitutesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes'),'undefined')){
productsubstitutesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes') as any);
if(productsubstitutesData && productsubstitutesData.length && productsubstitutesData.length > 0){
productsubstitutesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.productassociationid = null;
item.productsubstituteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.productassociations = productassociationsData;
masterData.productsubstitutes = productsubstitutesData;
let productpricelevelsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productpricelevels'),'undefined')){
productpricelevelsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productpricelevels') as any);
......@@ -163,26 +163,26 @@ export default class ProductServiceBase extends EntityService {
}
}
masterData.productpricelevels = productpricelevelsData;
let productsubstitutesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes'),'undefined')){
productsubstitutesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes') as any);
if(productsubstitutesData && productsubstitutesData.length && productsubstitutesData.length > 0){
productsubstitutesData.forEach((item:any) => {
let productassociationsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productassociations'),'undefined')){
productassociationsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productassociations') as any);
if(productassociationsData && productassociationsData.length && productassociationsData.length > 0){
productassociationsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.productsubstituteid = null;
item.productassociationid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.productsubstitutes = productsubstitutesData;
masterData.productassociations = productassociationsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/products/${context.product}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations));
this.tempStorage.setItem(context.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
this.tempStorage.setItem(context.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes));
this.tempStorage.setItem(context.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
this.tempStorage.setItem(context.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations));
return res;
}
......@@ -210,9 +210,9 @@ export default class ProductServiceBase extends EntityService {
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/products/${context.product}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations));
this.tempStorage.setItem(context.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
this.tempStorage.setItem(context.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes));
this.tempStorage.setItem(context.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
this.tempStorage.setItem(context.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations));
return res;
}
......@@ -228,9 +228,9 @@ export default class ProductServiceBase extends EntityService {
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/products/getdraft`,isloading);
res.data.product = data.product;
this.tempStorage.setItem(context.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations));
this.tempStorage.setItem(context.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
this.tempStorage.setItem(context.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes));
this.tempStorage.setItem(context.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
this.tempStorage.setItem(context.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations));
return res;
}
......@@ -258,21 +258,21 @@ export default class ProductServiceBase extends EntityService {
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let productassociationsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productassociations'),'undefined')){
productassociationsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productassociations') as any);
if(productassociationsData && productassociationsData.length && productassociationsData.length > 0){
productassociationsData.forEach((item:any) => {
let productsubstitutesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes'),'undefined')){
productsubstitutesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes') as any);
if(productsubstitutesData && productsubstitutesData.length && productsubstitutesData.length > 0){
productsubstitutesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.productassociationid = null;
item.productsubstituteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.productassociations = productassociationsData;
masterData.productsubstitutes = productsubstitutesData;
let productpricelevelsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productpricelevels'),'undefined')){
productpricelevelsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productpricelevels') as any);
......@@ -288,26 +288,26 @@ export default class ProductServiceBase extends EntityService {
}
}
masterData.productpricelevels = productpricelevelsData;
let productsubstitutesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes'),'undefined')){
productsubstitutesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes') as any);
if(productsubstitutesData && productsubstitutesData.length && productsubstitutesData.length > 0){
productsubstitutesData.forEach((item:any) => {
let productassociationsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productassociations'),'undefined')){
productassociationsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productassociations') as any);
if(productassociationsData && productassociationsData.length && productassociationsData.length > 0){
productassociationsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.productsubstituteid = null;
item.productassociationid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.productsubstitutes = productsubstitutesData;
masterData.productassociations = productassociationsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/products/${context.product}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations));
this.tempStorage.setItem(context.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
this.tempStorage.setItem(context.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes));
this.tempStorage.setItem(context.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
this.tempStorage.setItem(context.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations));
return res;
}
......
......@@ -78,21 +78,6 @@ export default class QuoteServiceBase extends EntityService {
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && true){
let masterData:any = {};
let quotedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
if(quotedetailsData && quotedetailsData.length && quotedetailsData.length > 0){
quotedetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quotedetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotedetails = quotedetailsData;
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -108,21 +93,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.contact && context.opportunity && true){
let masterData:any = {};
let quotedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -138,6 +108,21 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
return res;
}
if(context.contact && context.opportunity && true){
let masterData:any = {};
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -153,21 +138,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.account && context.opportunity && true){
let masterData:any = {};
let quotedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -183,6 +153,21 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
return res;
}
if(context.account && context.opportunity && true){
let masterData:any = {};
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -198,21 +183,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.opportunity && true){
let masterData:any = {};
let quotedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -228,6 +198,21 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
return res;
}
if(context.opportunity && true){
let masterData:any = {};
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -243,20 +228,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/opportunities/${context.opportunity}/quotes`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
let masterData:any = {};
let quotedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -272,6 +243,20 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/opportunities/${context.opportunity}/quotes`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
return res;
}
let masterData:any = {};
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -287,6 +272,21 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.salesorders = salesordersData;
let quotedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
if(quotedetailsData && quotedetailsData.length && quotedetailsData.length > 0){
quotedetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quotedetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotedetails = quotedetailsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -296,8 +296,8 @@ export default class QuoteServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/quotes`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
return res;
}
......@@ -313,21 +313,6 @@ export default class QuoteServiceBase extends EntityService {
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && context.quote){
let masterData:any = {};
let quotedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
if(quotedetailsData && quotedetailsData.length && quotedetailsData.length > 0){
quotedetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quotedetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotedetails = quotedetailsData;
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -343,14 +328,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.contact && context.opportunity && context.quote){
let masterData:any = {};
let quotedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -366,6 +343,14 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
return res;
}
if(context.contact && context.opportunity && context.quote){
let masterData:any = {};
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -381,14 +366,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.account && context.opportunity && context.quote){
let masterData:any = {};
let quotedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -404,6 +381,14 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
return res;
}
if(context.account && context.opportunity && context.quote){
let masterData:any = {};
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -419,14 +404,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.opportunity && context.quote){
let masterData:any = {};
let quotedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -442,6 +419,14 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
return res;
}
if(context.opportunity && context.quote){
let masterData:any = {};
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -457,13 +442,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/opportunities/${context.opportunity}/quotes/${context.quote}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
let masterData:any = {};
let quotedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -479,6 +457,13 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/opportunities/${context.opportunity}/quotes/${context.quote}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
return res;
}
let masterData:any = {};
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -494,10 +479,25 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.salesorders = salesordersData;
let quotedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
if(quotedetailsData && quotedetailsData.length && quotedetailsData.length > 0){
quotedetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quotedetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotedetails = quotedetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/quotes/${context.quote}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
return res;
}
......@@ -538,31 +538,31 @@ export default class QuoteServiceBase extends EntityService {
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && context.quote){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
return res;
}
if(context.contact && context.opportunity && context.quote){
let res:any = await Http.getInstance().get(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
return res;
}
if(context.account && context.opportunity && context.quote){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
return res;
}
if(context.opportunity && context.quote){
let res:any = await Http.getInstance().get(`/opportunities/${context.opportunity}/quotes/${context.quote}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
return res;
}
let res:any = await Http.getInstance().get(`/quotes/${context.quote}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
return res;
}
......@@ -579,35 +579,35 @@ export default class QuoteServiceBase extends EntityService {
if(context.account && context.contact && context.opportunity && true){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/getdraft`,isloading);
res.data.quote = data.quote;
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
return res;
}
if(context.contact && context.opportunity && true){
let res:any = await Http.getInstance().get(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/getdraft`,isloading);
res.data.quote = data.quote;
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
return res;
}
if(context.account && context.opportunity && true){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/getdraft`,isloading);
res.data.quote = data.quote;
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
return res;
}
if(context.opportunity && true){
let res:any = await Http.getInstance().get(`/opportunities/${context.opportunity}/quotes/getdraft`,isloading);
res.data.quote = data.quote;
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
return res;
}
let res:any = await Http.getInstance().get(`/quotes/getdraft`,isloading);
res.data.quote = data.quote;
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
return res;
}
......@@ -638,21 +638,6 @@ export default class QuoteServiceBase extends EntityService {
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && context.quote){
let masterData:any = {};
let quotedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
if(quotedetailsData && quotedetailsData.length && quotedetailsData.length > 0){
quotedetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quotedetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotedetails = quotedetailsData;
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -668,14 +653,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.contact && context.opportunity && context.quote){
let masterData:any = {};
let quotedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -691,6 +668,14 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
return res;
}
if(context.contact && context.opportunity && context.quote){
let masterData:any = {};
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -706,14 +691,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.account && context.opportunity && context.quote){
let masterData:any = {};
let quotedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -729,6 +706,14 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
return res;
}
if(context.account && context.opportunity && context.quote){
let masterData:any = {};
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -744,14 +729,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.opportunity && context.quote){
let masterData:any = {};
let quotedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -767,6 +744,14 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
return res;
}
if(context.opportunity && context.quote){
let masterData:any = {};
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -782,10 +767,25 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.salesorders = salesordersData;
let quotedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
if(quotedetailsData && quotedetailsData.length && quotedetailsData.length > 0){
quotedetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quotedetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotedetails = quotedetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/opportunities/${context.opportunity}/quotes/${context.quote}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
return res;
}
return Http.getInstance().post(`/quotes/${context.quote}/checkkey`,data,isloading);
......@@ -818,21 +818,6 @@ export default class QuoteServiceBase extends EntityService {
public async GenSalesOrder(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && context.quote){
let masterData:any = {};
let quotedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
if(quotedetailsData && quotedetailsData.length && quotedetailsData.length > 0){
quotedetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quotedetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotedetails = quotedetailsData;
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -848,14 +833,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/gensalesorder`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.contact && context.opportunity && context.quote){
let masterData:any = {};
let quotedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -871,6 +848,14 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/gensalesorder`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
return res;
}
if(context.contact && context.opportunity && context.quote){
let masterData:any = {};
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -886,14 +871,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/gensalesorder`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.account && context.opportunity && context.quote){
let masterData:any = {};
let quotedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -909,6 +886,14 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/gensalesorder`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
return res;
}
if(context.account && context.opportunity && context.quote){
let masterData:any = {};
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -924,14 +909,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/gensalesorder`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.opportunity && context.quote){
let masterData:any = {};
let quotedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -947,6 +924,14 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/gensalesorder`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
return res;
}
if(context.opportunity && context.quote){
let masterData:any = {};
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -962,10 +947,25 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.salesorders = salesordersData;
let quotedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
if(quotedetailsData && quotedetailsData.length && quotedetailsData.length > 0){
quotedetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quotedetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotedetails = quotedetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/opportunities/${context.opportunity}/quotes/${context.quote}/gensalesorder`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
return res;
}
return Http.getInstance().post(`/quotes/${context.quote}/gensalesorder`,data,isloading);
......@@ -983,21 +983,6 @@ export default class QuoteServiceBase extends EntityService {
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && context.quote){
let masterData:any = {};
let quotedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
if(quotedetailsData && quotedetailsData.length && quotedetailsData.length > 0){
quotedetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quotedetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotedetails = quotedetailsData;
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -1013,14 +998,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.contact && context.opportunity && context.quote){
let masterData:any = {};
let quotedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -1036,6 +1013,14 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
return res;
}
if(context.contact && context.opportunity && context.quote){
let masterData:any = {};
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -1051,14 +1036,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.account && context.opportunity && context.quote){
let masterData:any = {};
let quotedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -1074,6 +1051,14 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
return res;
}
if(context.account && context.opportunity && context.quote){
let masterData:any = {};
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -1089,14 +1074,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.opportunity && context.quote){
let masterData:any = {};
let quotedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -1112,6 +1089,14 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
return res;
}
if(context.opportunity && context.quote){
let masterData:any = {};
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -1127,13 +1112,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/opportunities/${context.opportunity}/quotes/${context.quote}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
let masterData:any = {};
let quotedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -1149,6 +1127,13 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/opportunities/${context.opportunity}/quotes/${context.quote}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
return res;
}
let masterData:any = {};
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -1164,10 +1149,25 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.salesorders = salesordersData;
let quotedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
if(quotedetailsData && quotedetailsData.length && quotedetailsData.length > 0){
quotedetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quotedetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotedetails = quotedetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/quotes/${context.quote}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
return res;
}
......
......@@ -80,21 +80,6 @@ export default class SalesOrderServiceBase extends EntityService {
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && context.quote && true){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorderdetails = salesorderdetailsData;
let invoicesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
......@@ -110,21 +95,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.invoices = invoicesData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
this.tempStorage.setItem(tempContext.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
return res;
}
if(context.contact && context.opportunity && context.quote && true){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
......@@ -140,6 +110,21 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.contact && context.opportunity && context.quote && true){
let masterData:any = {};
let invoicesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
......@@ -155,21 +140,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.invoices = invoicesData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
this.tempStorage.setItem(tempContext.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
return res;
}
if(context.account && context.opportunity && context.quote && true){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
......@@ -185,6 +155,21 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.account && context.opportunity && context.quote && true){
let masterData:any = {};
let invoicesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
......@@ -200,21 +185,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.invoices = invoicesData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
this.tempStorage.setItem(tempContext.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
return res;
}
if(context.opportunity && context.quote && true){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
......@@ -230,6 +200,21 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.opportunity && context.quote && true){
let masterData:any = {};
let invoicesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
......@@ -245,21 +230,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.invoices = invoicesData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
this.tempStorage.setItem(tempContext.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
return res;
}
if(context.quote && true){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
......@@ -275,6 +245,21 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.quote && true){
let masterData:any = {};
let invoicesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
......@@ -290,20 +275,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.invoices = invoicesData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/quotes/${context.quote}/salesorders`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
this.tempStorage.setItem(tempContext.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
return res;
}
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
......@@ -319,6 +290,20 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/quotes/${context.quote}/salesorders`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
let masterData:any = {};
let invoicesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
......@@ -334,6 +319,21 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.invoices = invoicesData;
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -343,8 +343,8 @@ export default class SalesOrderServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/salesorders`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
this.tempStorage.setItem(tempContext.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
......@@ -360,21 +360,6 @@ export default class SalesOrderServiceBase extends EntityService {
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorderdetails = salesorderdetailsData;
let invoicesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
......@@ -390,14 +375,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.invoices = invoicesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
return res;
}
if(context.contact && context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
......@@ -413,6 +390,14 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.contact && context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let invoicesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
......@@ -428,14 +413,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.invoices = invoicesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
return res;
}
if(context.account && context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
......@@ -451,6 +428,14 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.account && context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let invoicesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
......@@ -466,14 +451,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.invoices = invoicesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
return res;
}
if(context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
......@@ -489,6 +466,14 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let invoicesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
......@@ -504,14 +489,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.invoices = invoicesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
return res;
}
if(context.quote && context.salesorder){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
......@@ -527,6 +504,14 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.quote && context.salesorder){
let masterData:any = {};
let invoicesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
......@@ -542,13 +527,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.invoices = invoicesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/quotes/${context.quote}/salesorders/${context.salesorder}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
return res;
}
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
......@@ -564,6 +542,13 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/quotes/${context.quote}/salesorders/${context.salesorder}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
let masterData:any = {};
let invoicesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
......@@ -579,10 +564,25 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.invoices = invoicesData;
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/salesorders/${context.salesorder}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
......@@ -626,37 +626,37 @@ export default class SalesOrderServiceBase extends EntityService {
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && context.quote && context.salesorder){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.contact && context.opportunity && context.quote && context.salesorder){
let res:any = await Http.getInstance().get(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.account && context.opportunity && context.quote && context.salesorder){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.opportunity && context.quote && context.salesorder){
let res:any = await Http.getInstance().get(`/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.quote && context.salesorder){
let res:any = await Http.getInstance().get(`/quotes/${context.quote}/salesorders/${context.salesorder}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
let res:any = await Http.getInstance().get(`/salesorders/${context.salesorder}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
......@@ -673,42 +673,42 @@ export default class SalesOrderServiceBase extends EntityService {
if(context.account && context.contact && context.opportunity && context.quote && true){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/getdraft`,isloading);
res.data.salesorder = data.salesorder;
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.contact && context.opportunity && context.quote && true){
let res:any = await Http.getInstance().get(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/getdraft`,isloading);
res.data.salesorder = data.salesorder;
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.account && context.opportunity && context.quote && true){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/getdraft`,isloading);
res.data.salesorder = data.salesorder;
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.opportunity && context.quote && true){
let res:any = await Http.getInstance().get(`/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/getdraft`,isloading);
res.data.salesorder = data.salesorder;
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.quote && true){
let res:any = await Http.getInstance().get(`/quotes/${context.quote}/salesorders/getdraft`,isloading);
res.data.salesorder = data.salesorder;
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
let res:any = await Http.getInstance().get(`/salesorders/getdraft`,isloading);
res.data.salesorder = data.salesorder;
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
......@@ -739,21 +739,6 @@ export default class SalesOrderServiceBase extends EntityService {
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorderdetails = salesorderdetailsData;
let invoicesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
......@@ -769,14 +754,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.invoices = invoicesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
return res;
}
if(context.contact && context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
......@@ -792,6 +769,14 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.contact && context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let invoicesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
......@@ -807,14 +792,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.invoices = invoicesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
return res;
}
if(context.account && context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
......@@ -830,6 +807,14 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.account && context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let invoicesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
......@@ -845,14 +830,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.invoices = invoicesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
return res;
}
if(context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
......@@ -868,6 +845,14 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let invoicesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
......@@ -883,14 +868,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.invoices = invoicesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
return res;
}
if(context.quote && context.salesorder){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
......@@ -906,6 +883,14 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.quote && context.salesorder){
let masterData:any = {};
let invoicesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
......@@ -921,10 +906,25 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.invoices = invoicesData;
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/quotes/${context.quote}/salesorders/${context.salesorder}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
return Http.getInstance().post(`/salesorders/${context.salesorder}/checkkey`,data,isloading);
......@@ -957,21 +957,6 @@ export default class SalesOrderServiceBase extends EntityService {
public async GenInvoice(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorderdetails = salesorderdetailsData;
let invoicesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
......@@ -987,14 +972,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.invoices = invoicesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/geninvoice`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
return res;
}
if(context.contact && context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
......@@ -1010,6 +987,14 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/geninvoice`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.contact && context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let invoicesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
......@@ -1025,14 +1010,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.invoices = invoicesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/geninvoice`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
return res;
}
if(context.account && context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
......@@ -1048,6 +1025,14 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/geninvoice`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.account && context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let invoicesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
......@@ -1063,14 +1048,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.invoices = invoicesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/geninvoice`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
return res;
}
if(context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
......@@ -1086,6 +1063,14 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/geninvoice`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let invoicesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
......@@ -1101,14 +1086,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.invoices = invoicesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/geninvoice`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
return res;
}
if(context.quote && context.salesorder){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
......@@ -1124,6 +1101,14 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/geninvoice`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.quote && context.salesorder){
let masterData:any = {};
let invoicesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
......@@ -1139,10 +1124,25 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.invoices = invoicesData;
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/quotes/${context.quote}/salesorders/${context.salesorder}/geninvoice`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
return Http.getInstance().post(`/salesorders/${context.salesorder}/geninvoice`,data,isloading);
......@@ -1160,21 +1160,6 @@ export default class SalesOrderServiceBase extends EntityService {
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorderdetails = salesorderdetailsData;
let invoicesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
......@@ -1190,14 +1175,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.invoices = invoicesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
return res;
}
if(context.contact && context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
......@@ -1213,6 +1190,14 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.contact && context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let invoicesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
......@@ -1228,14 +1213,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.invoices = invoicesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
return res;
}
if(context.account && context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
......@@ -1251,6 +1228,14 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.account && context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let invoicesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
......@@ -1266,14 +1251,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.invoices = invoicesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
return res;
}
if(context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
......@@ -1289,6 +1266,14 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let invoicesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
......@@ -1304,14 +1289,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.invoices = invoicesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
return res;
}
if(context.quote && context.salesorder){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
......@@ -1327,6 +1304,14 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
if(context.quote && context.salesorder){
let masterData:any = {};
let invoicesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
......@@ -1342,13 +1327,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.invoices = invoicesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/quotes/${context.quote}/salesorders/${context.salesorder}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
return res;
}
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
......@@ -1364,6 +1342,13 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/quotes/${context.quote}/salesorders/${context.salesorder}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
let masterData:any = {};
let invoicesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
......@@ -1379,10 +1364,25 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.invoices = invoicesData;
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/salesorders/${context.salesorder}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
......
......@@ -100,6 +100,13 @@ export class MainGridBase extends GridControllerBase {
show: true,
util: 'PX'
},
{
name: 'revenue',
label: '年收入',
langtag: 'entities.account.main_grid.columns.revenue',
show: true,
util: 'PX'
},
{
name: 'parentaccountname',
label: '上级客户',
......@@ -146,6 +153,7 @@ export class MainGridBase extends GridControllerBase {
'address1_city':false,
'primarycontactname':false,
'emailaddress1':false,
'revenue':false,
'parentaccountname':false,
};
......
......@@ -97,13 +97,13 @@ export default class MainModel {
dataType: 'TEXT',
},
{
name: 'originatingleadid',
prop: 'originatingleadid',
name: 'parentaccountid',
prop: 'parentaccountid',
dataType: 'PICKUP',
},
{
name: 'parentaccountid',
prop: 'parentaccountid',
name: 'originatingleadid',
prop: 'originatingleadid',
dataType: 'PICKUP',
},
{
......@@ -116,6 +116,11 @@ export default class MainModel {
prop: 'address1_city',
dataType: 'TEXT',
},
{
name: 'revenue',
prop: 'revenue',
dataType: 'BIGDECIMAL',
},
{
name: 'account',
prop: 'accountid',
......
......@@ -83,6 +83,18 @@
</template>
</el-table-column>
</template>
<template v-if="getColumnState('revenue')">
<el-table-column show-overflow-tooltip :prop="'revenue'" :label="$t('entities.account.main_grid.columns.revenue')" :width="100" :align="'left'" :sortable="'custom'">
<template v-slot:header="{column}">
<span class="column-header ">
{{$t('entities.account.main_grid.columns.revenue')}}
</span>
</template>
<template v-slot="{row,column,$index}">
<span>{{row.revenue}}</span>
</template>
</el-table-column>
</template>
<template v-if="getColumnState('parentaccountname')">
<el-table-column show-overflow-tooltip :prop="'parentaccountname'" :label="$t('entities.account.main_grid.columns.parentaccountname')" :width="200" :align="'left'" :sortable="'custom'">
<template v-slot:header="{column}">
......
......@@ -20,7 +20,9 @@ import com.alibaba.fastjson.JSONObject;
public interface InvoiceMapper extends BaseMapper<Invoice>{
Page<Invoice> searchByParentKey(IPage page, @Param("srf") InvoiceSearchContext context, @Param("ew") Wrapper<Invoice> wrapper) ;
Page<Invoice> searchCancel(IPage page, @Param("srf") InvoiceSearchContext context, @Param("ew") Wrapper<Invoice> wrapper) ;
Page<Invoice> searchDefault(IPage page, @Param("srf") InvoiceSearchContext context, @Param("ew") Wrapper<Invoice> wrapper) ;
Page<Invoice> searchPaid(IPage page, @Param("srf") InvoiceSearchContext context, @Param("ew") Wrapper<Invoice> wrapper) ;
@Override
Invoice selectById(Serializable id);
@Override
......
......@@ -40,7 +40,9 @@ public interface IInvoiceService extends IService<Invoice>{
boolean save(Invoice et) ;
void saveBatch(List<Invoice> list) ;
Page<Invoice> searchByParentKey(InvoiceSearchContext context) ;
Page<Invoice> searchCancel(InvoiceSearchContext context) ;
Page<Invoice> searchDefault(InvoiceSearchContext context) ;
Page<Invoice> searchPaid(InvoiceSearchContext context) ;
List<Invoice> selectByOpportunityid(String opportunityid) ;
void removeByOpportunityid(String opportunityid) ;
List<Invoice> selectByPricelevelid(String pricelevelid) ;
......
......@@ -247,6 +247,15 @@ public class InvoiceServiceImpl extends ServiceImpl<InvoiceMapper, Invoice> impl
return new PageImpl<Invoice>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
* 查询集合 已取消
*/
@Override
public Page<Invoice> searchCancel(InvoiceSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<Invoice> pages=baseMapper.searchCancel(context.getPages(),context,context.getSelectCond());
return new PageImpl<Invoice>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
* 查询集合 DEFAULT
*/
......@@ -256,6 +265,15 @@ public class InvoiceServiceImpl extends ServiceImpl<InvoiceMapper, Invoice> impl
return new PageImpl<Invoice>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
* 查询集合 已支付
*/
@Override
public Page<Invoice> searchPaid(InvoiceSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<Invoice> pages=baseMapper.searchPaid(context.getPages(),context,context.getSelectCond());
return new PageImpl<Invoice>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
......
package cn.ibizlab.businesscentral.core.finance.service.logic;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import cn.ibizlab.businesscentral.core.finance.domain.Invoice;
/**
* 关系型数据实体[Cancel] 对象
*/
public interface IInvoiceCancelLogic {
void execute(Invoice invoice ) ;
}
package cn.ibizlab.businesscentral.core.finance.service.logic;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import cn.ibizlab.businesscentral.core.finance.domain.Invoice;
/**
* 关系型数据实体[Paid] 对象
*/
public interface IInvoicePaidLogic {
void execute(Invoice invoice ) ;
}
package cn.ibizlab.businesscentral.core.finance.service.logic.impl;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.kie.api.runtime.KieSession;
import org.kie.api.runtime.KieContainer;
import cn.ibizlab.businesscentral.core.finance.service.logic.IInvoiceCancelLogic;
import cn.ibizlab.businesscentral.core.finance.domain.Invoice;
/**
* 关系型数据实体[Cancel] 对象
*/
@Slf4j
@Service
public class InvoiceCancelLogicImpl implements IInvoiceCancelLogic{
@Autowired
private KieContainer kieContainer;
@Autowired
private cn.ibizlab.businesscentral.core.finance.service.IInvoiceService iBzSysDefaultService;
public cn.ibizlab.businesscentral.core.finance.service.IInvoiceService getIBzSysDefaultService() {
return this.iBzSysDefaultService;
}
public void execute(Invoice et){
KieSession kieSession = null;
try{
kieSession=kieContainer.newKieSession();
kieSession.insert(et);
kieSession.setGlobal("invoicecanceldefault",et);
kieSession.setGlobal("iBzSysInvoiceDefaultService",iBzSysDefaultService);
kieSession.setGlobal("curuser", cn.ibizlab.businesscentral.util.security.AuthenticationUser.getAuthenticationUser());
kieSession.startProcess("cn.ibizlab.businesscentral.core.finance.service.logic.invoicecancel");
}catch(Exception e){
throw new RuntimeException("执行[取消发票]处理逻辑发生异常"+e);
}finally {
if(kieSession!=null)
kieSession.destroy();
}
}
}
package cn.ibizlab.businesscentral.core.finance.service.logic.impl;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.kie.api.runtime.KieSession;
import org.kie.api.runtime.KieContainer;
import cn.ibizlab.businesscentral.core.finance.service.logic.IInvoicePaidLogic;
import cn.ibizlab.businesscentral.core.finance.domain.Invoice;
/**
* 关系型数据实体[Paid] 对象
*/
@Slf4j
@Service
public class InvoicePaidLogicImpl implements IInvoicePaidLogic{
@Autowired
private KieContainer kieContainer;
@Autowired
private cn.ibizlab.businesscentral.core.finance.service.IInvoiceService invoiceservice;
public cn.ibizlab.businesscentral.core.finance.service.IInvoiceService getInvoiceService() {
return this.invoiceservice;
}
@Autowired
private cn.ibizlab.businesscentral.core.finance.service.IInvoiceService iBzSysDefaultService;
public cn.ibizlab.businesscentral.core.finance.service.IInvoiceService getIBzSysDefaultService() {
return this.iBzSysDefaultService;
}
public void execute(Invoice et){
KieSession kieSession = null;
try{
kieSession=kieContainer.newKieSession();
kieSession.insert(et);
kieSession.setGlobal("invoicepaiddefault",et);
kieSession.setGlobal("invoiceservice",invoiceservice);
kieSession.setGlobal("iBzSysInvoiceDefaultService",iBzSysDefaultService);
kieSession.setGlobal("curuser", cn.ibizlab.businesscentral.util.security.AuthenticationUser.getAuthenticationUser());
kieSession.startProcess("cn.ibizlab.businesscentral.core.finance.service.logic.invoicepaid");
}catch(Exception e){
throw new RuntimeException("执行[发票已支付]处理逻辑发生异常"+e);
}finally {
if(kieSession!=null)
kieSession.destroy();
}
}
}
......@@ -4,7 +4,7 @@
<!--输出实体[ACCOUNT]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-account-607-1">
<changeSet author="a_LAB01_e85d8801c" id="tab-account-609-1">
<createTable tableName="ACCOUNT">
<column name="ADDRESS1_PRIMARYCONTACTNAME" remarks="" type="VARCHAR(100)">
</column>
......@@ -466,7 +466,7 @@
<!--输出实体[ACTIVITYPOINTER]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-activitypointer-80-4">
<changeSet author="a_LAB01_e85d8801c" id="tab-activitypointer-81-4">
<createTable tableName="ACTIVITYPOINTER">
<column name="SERIESID" remarks="" type="VARCHAR(60)">
</column>
......@@ -5157,7 +5157,7 @@
<!--输出实体[INVOICE]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-invoice-65-63">
<changeSet author="a_LAB01_e85d8801c" id="tab-invoice-74-63">
<createTable tableName="INVOICE">
<column name="BILLTO_LINE1" remarks="" type="VARCHAR(250)">
</column>
......@@ -10734,7 +10734,7 @@
<!--输出实体[TRANSACTIONCURRENCY]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-transactioncurrency-7-128">
<changeSet author="a_LAB01_e85d8801c" id="tab-transactioncurrency-8-128">
<createTable tableName="TRANSACTIONCURRENCY">
<column name="UPDATEDATE" remarks="" type="DATETIME">
</column>
......@@ -10987,31 +10987,31 @@
</changeSet>
<!--输出实体[ACCOUNT]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-account-607-135">
<changeSet author="a_LAB01_e85d8801c" id="fk-account-609-135">
<addForeignKeyConstraint baseColumnNames="PARENTACCOUNTID" baseTableName="ACCOUNT" constraintName="DER1N_ACCOUNT__ACCOUNT__PARENT" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ACCOUNTID" referencedTableName="ACCOUNT" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-account-607-136">
<changeSet author="a_LAB01_e85d8801c" id="fk-account-609-136">
<addForeignKeyConstraint baseColumnNames="PRIMARYCONTACTID" baseTableName="ACCOUNT" constraintName="DER1N_ACCOUNT__CONTACT__PRIMAR" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="CONTACTID" referencedTableName="CONTACT" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-account-607-137">
<changeSet author="a_LAB01_e85d8801c" id="fk-account-609-137">
<addForeignKeyConstraint baseColumnNames="PREFERREDEQUIPMENTID" baseTableName="ACCOUNT" constraintName="DER1N_ACCOUNT__EQUIPMENT__PREF" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EQUIPMENTID" referencedTableName="EQUIPMENT" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-account-607-138">
<changeSet author="a_LAB01_e85d8801c" id="fk-account-609-138">
<addForeignKeyConstraint baseColumnNames="ORIGINATINGLEADID" baseTableName="ACCOUNT" constraintName="DER1N_ACCOUNT__LEAD__ORIGINATI" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="LEADID" referencedTableName="LEAD" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-account-607-139">
<changeSet author="a_LAB01_e85d8801c" id="fk-account-609-139">
<addForeignKeyConstraint baseColumnNames="DEFAULTPRICELEVELID" baseTableName="ACCOUNT" constraintName="DER1N_ACCOUNT__PRICELEVEL__DEF" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="PRICELEVELID" referencedTableName="PRICELEVEL" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-account-607-140">
<changeSet author="a_LAB01_e85d8801c" id="fk-account-609-140">
<addForeignKeyConstraint baseColumnNames="PREFERREDSERVICEID" baseTableName="ACCOUNT" constraintName="DER1N_ACCOUNT__SERVICE__PREFER" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="SERVICEID" referencedTableName="SERVICE" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-account-607-141">
<changeSet author="a_LAB01_e85d8801c" id="fk-account-609-141">
<addForeignKeyConstraint baseColumnNames="SLAID" baseTableName="ACCOUNT" constraintName="DER1N_ACCOUNT__SLA__SLAID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="SLAID" referencedTableName="SLA" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-account-607-142">
<changeSet author="a_LAB01_e85d8801c" id="fk-account-609-142">
<addForeignKeyConstraint baseColumnNames="TERRITORYID" baseTableName="ACCOUNT" constraintName="DER1N_ACCOUNT__TERRITORY__TERR" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="TERRITORYID" referencedTableName="TERRITORY" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-account-607-143">
<changeSet author="a_LAB01_e85d8801c" id="fk-account-609-143">
<addForeignKeyConstraint baseColumnNames="TRANSACTIONCURRENCYID" baseTableName="ACCOUNT" constraintName="DER1N_ACCOUNT__TRANSACTIONCURR" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="TRANSACTIONCURRENCYID" referencedTableName="TRANSACTIONCURRENCY" validate="true"/>
</changeSet>
<!--输出实体[ACTIVITYMIMEATTACHMENT]外键关系 -->
......@@ -11023,13 +11023,13 @@
<addForeignKeyConstraint baseColumnNames="RESOURCESPECID" baseTableName="ACTIVITYPARTY" constraintName="DER1N_ACTIVITYPARTY__RESOURCES" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="RESOURCESPECID" referencedTableName="RESOURCESPEC" validate="true"/>
</changeSet>
<!--输出实体[ACTIVITYPOINTER]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-activitypointer-80-146">
<changeSet author="a_LAB01_e85d8801c" id="fk-activitypointer-81-146">
<addForeignKeyConstraint baseColumnNames="SERVICEID" baseTableName="ACTIVITYPOINTER" constraintName="DER1N_ACTIVITYPOINTER__SERVICE" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="SERVICEID" referencedTableName="SERVICE" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-activitypointer-80-147">
<changeSet author="a_LAB01_e85d8801c" id="fk-activitypointer-81-147">
<addForeignKeyConstraint baseColumnNames="SLAID" baseTableName="ACTIVITYPOINTER" constraintName="DER1N_ACTIVITYPOINTER__SLA__SL" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="SLAID" referencedTableName="SLA" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-activitypointer-80-148">
<changeSet author="a_LAB01_e85d8801c" id="fk-activitypointer-81-148">
<addForeignKeyConstraint baseColumnNames="TRANSACTIONCURRENCYID" baseTableName="ACTIVITYPOINTER" constraintName="DER1N_ACTIVITYPOINTER__TRANSAC" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="TRANSACTIONCURRENCYID" referencedTableName="TRANSACTIONCURRENCY" validate="true"/>
</changeSet>
<!--输出实体[ANNOTATION]外键关系 -->
......@@ -11418,19 +11418,19 @@
<addForeignKeyConstraint baseColumnNames="UOMID" baseTableName="T_INVENTORY" constraintName="DER1N_INVENTORY_UOM_UOMID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="UOMID" referencedTableName="UOM" validate="true"/>
</changeSet>
<!--输出实体[INVOICE]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-invoice-65-280">
<changeSet author="a_LAB01_e85d8801c" id="fk-invoice-74-280">
<addForeignKeyConstraint baseColumnNames="OPPORTUNITYID" baseTableName="INVOICE" constraintName="DER1N_INVOICE__OPPORTUNITY__OP" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="OPPORTUNITYID" referencedTableName="OPPORTUNITY" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-invoice-65-281">
<changeSet author="a_LAB01_e85d8801c" id="fk-invoice-74-281">
<addForeignKeyConstraint baseColumnNames="PRICELEVELID" baseTableName="INVOICE" constraintName="DER1N_INVOICE__PRICELEVEL__PRI" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="PRICELEVELID" referencedTableName="PRICELEVEL" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-invoice-65-282">
<changeSet author="a_LAB01_e85d8801c" id="fk-invoice-74-282">
<addForeignKeyConstraint baseColumnNames="SALESORDERID" baseTableName="INVOICE" constraintName="DER1N_INVOICE__SALESORDER__SAL" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="SALESORDERID" referencedTableName="SALESORDER" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-invoice-65-283">
<changeSet author="a_LAB01_e85d8801c" id="fk-invoice-74-283">
<addForeignKeyConstraint baseColumnNames="SLAID" baseTableName="INVOICE" constraintName="DER1N_INVOICE__SLA__SLAID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="SLAID" referencedTableName="SLA" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-invoice-65-284">
<changeSet author="a_LAB01_e85d8801c" id="fk-invoice-74-284">
<addForeignKeyConstraint baseColumnNames="TRANSACTIONCURRENCYID" baseTableName="INVOICE" constraintName="DER1N_INVOICE__TRANSACTIONCURR" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="TRANSACTIONCURRENCYID" referencedTableName="TRANSACTIONCURRENCY" validate="true"/>
</changeSet>
<!--输出实体[INVOICEDETAIL]外键关系 -->
......
......@@ -5,7 +5,7 @@
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="InvoiceResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`ACCOUNTNAME`, t1.`BILLTO_CITY`, t1.`BILLTO_COMPOSITE`, t1.`BILLTO_COUNTRY`, t1.`BILLTO_FAX`, t1.`BILLTO_LINE1`, t1.`BILLTO_LINE2`, t1.`BILLTO_LINE3`, t1.`BILLTO_NAME`, t1.`BILLTO_POSTALCODE`, t1.`BILLTO_STATEORPROVINCE`, t1.`BILLTO_TELEPHONE`, t1.`CONTACTNAME`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`CUSTOMERID`, t1.`CUSTOMERIDTYPE`, t1.`CUSTOMERNAME`, t1.`DATEDELIVERED`, t1.`DESCRIPTION`, t1.`DISCOUNTAMOUNT`, t1.`DISCOUNTAMOUNT_BASE`, t1.`DISCOUNTPERCENTAGE`, t1.`DUEDATE`, t1.`EMAILADDRESS`, t1.`ENTITYIMAGE`, t1.`ENTITYIMAGEID`, t1.`ENTITYIMAGE_TIMESTAMP`, t1.`ENTITYIMAGE_URL`, t1.`EXCHANGERATE`, t1.`FREIGHTAMOUNT`, t1.`FREIGHTAMOUNT_BASE`, t1.`IMPORTSEQUENCENUMBER`, t1.`INVOICEID`, t1.`INVOICENAME`, t1.`INVOICENUMBER`, t1.`LASTBACKOFFICESUBMIT`, t1.`LASTONHOLDTIME`, t1.`ONHOLDTIME`, t1.`OPPORTUNITYID`, t1.`OPPORTUNITYNAME`, t1.`OVERRIDDENCREATEDON`, t1.`OWNERID`, t1.`OWNERIDTYPE`, t1.`OWNERNAME`, t1.`PAYMENTTERMSCODE`, t1.`PRICELEVELID`, t1.`PRICELEVELNAME`, t1.`PRICELOCKED`, t1.`PRICINGERRORCODE`, t1.`PRIORITYCODE`, t1.`PROCESSID`, t1.`SALESORDERID`, t1.`SALESORDERNAME`, t1.`SHIPPINGMETHODCODE`, t1.`SHIPTO_CITY`, t1.`SHIPTO_COMPOSITE`, t1.`SHIPTO_COUNTRY`, t1.`SHIPTO_FAX`, t1.`SHIPTO_FREIGHTTERMSCODE`, t1.`SHIPTO_LINE1`, t1.`SHIPTO_LINE2`, t1.`SHIPTO_LINE3`, t1.`SHIPTO_NAME`, t1.`SHIPTO_POSTALCODE`, t1.`SHIPTO_STATEORPROVINCE`, t1.`SHIPTO_TELEPHONE`, t1.`SLAID`, t1.`SLANAME`, t1.`STAGEID`, t1.`STATECODE`, t1.`STATUSCODE`, t1.`TIMEZONERULEVERSIONNUMBER`, t1.`TOTALAMOUNT`, t1.`TOTALAMOUNTLESSFREIGHT`, t1.`TOTALAMOUNTLESSFREIGHT_BASE`, t1.`TOTALAMOUNT_BASE`, t1.`TOTALDISCOUNTAMOUNT`, t1.`TOTALDISCOUNTAMOUNT_BASE`, t1.`TOTALLINEITEMAMOUNT`, t1.`TOTALLINEITEMAMOUNT_BASE`, t1.`TOTALLINEITEMDISCOUNTAMOUNT`, t1.`TOTALTAX`, t1.`TOTALTAX_BASE`, t1.`TRANSACTIONCURRENCYID`, t1.`TRANSACTIONCURRENCYNAME`, t1.`TRAVERSEDPATH`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`UTCCONVERSIONTIMEZONECODE`, t1.`VERSIONNUMBER`, t1.`WILLCALL` FROM `INVOICE` t1 ) t1 where invoiceid=#{id}]]>
<![CDATA[select t1.* from (SELECT t1.`ACCOUNTNAME`, t1.`BILLTO_CITY`, t1.`BILLTO_COMPOSITE`, t1.`BILLTO_COUNTRY`, t1.`BILLTO_FAX`, t1.`BILLTO_LINE1`, t1.`BILLTO_LINE2`, t1.`BILLTO_LINE3`, t1.`BILLTO_NAME`, t1.`BILLTO_POSTALCODE`, t1.`BILLTO_STATEORPROVINCE`, t1.`BILLTO_TELEPHONE`, t1.`CONTACTNAME`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`CUSTOMERID`, t1.`CUSTOMERNAME`, t1.`CUSTOMERTYPE`, t1.`DATEDELIVERED`, t1.`DESCRIPTION`, t1.`DISCOUNTAMOUNT`, t1.`DISCOUNTAMOUNT_BASE`, t1.`DISCOUNTPERCENTAGE`, t1.`DUEDATE`, t1.`EMAILADDRESS`, t1.`ENTITYIMAGE`, t1.`ENTITYIMAGEID`, t1.`ENTITYIMAGE_TIMESTAMP`, t1.`ENTITYIMAGE_URL`, t1.`EXCHANGERATE`, t1.`FREIGHTAMOUNT`, t1.`FREIGHTAMOUNT_BASE`, t1.`IMPORTSEQUENCENUMBER`, t1.`INVOICEID`, t1.`INVOICENAME`, t1.`INVOICENUMBER`, t1.`LASTBACKOFFICESUBMIT`, t1.`LASTONHOLDTIME`, t1.`ONHOLDTIME`, t1.`OPPORTUNITYID`, t1.`OPPORTUNITYNAME`, t1.`OVERRIDDENCREATEDON`, t1.`OWNERID`, t1.`OWNERNAME`, t1.`OWNERTYPE`, t1.`PAYMENTTERMSCODE`, t1.`PRICELEVELID`, t1.`PRICELEVELNAME`, t1.`PRICELOCKED`, t1.`PRICINGERRORCODE`, t1.`PRIORITYCODE`, t1.`PROCESSID`, t1.`SALESORDERID`, t1.`SALESORDERNAME`, t1.`SHIPPINGMETHODCODE`, t1.`SHIPTO_CITY`, t1.`SHIPTO_COMPOSITE`, t1.`SHIPTO_COUNTRY`, t1.`SHIPTO_FAX`, t1.`SHIPTO_FREIGHTTERMSCODE`, t1.`SHIPTO_LINE1`, t1.`SHIPTO_LINE2`, t1.`SHIPTO_LINE3`, t1.`SHIPTO_NAME`, t1.`SHIPTO_POSTALCODE`, t1.`SHIPTO_STATEORPROVINCE`, t1.`SHIPTO_TELEPHONE`, t1.`SLAID`, t1.`SLANAME`, t1.`STAGEID`, t1.`STATECODE`, t1.`STATUSCODE`, t1.`TIMEZONERULEVERSIONNUMBER`, t1.`TOTALAMOUNT`, t1.`TOTALAMOUNTLESSFREIGHT`, t1.`TOTALAMOUNTLESSFREIGHT_BASE`, t1.`TOTALAMOUNT_BASE`, t1.`TOTALDISCOUNTAMOUNT`, t1.`TOTALDISCOUNTAMOUNT_BASE`, t1.`TOTALLINEITEMAMOUNT`, t1.`TOTALLINEITEMAMOUNT_BASE`, t1.`TOTALLINEITEMDISCOUNTAMOUNT`, t1.`TOTALTAX`, t1.`TOTALTAX_BASE`, t1.`TRANSACTIONCURRENCYID`, t1.`TRANSACTIONCURRENCYNAME`, t1.`TRAVERSEDPATH`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`UTCCONVERSIONTIMEZONECODE`, t1.`VERSIONNUMBER`, t1.`WILLCALL` FROM `INVOICE` t1 ) t1 where invoiceid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
......@@ -107,6 +107,15 @@
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据集合[Cancel]-->
<select id="searchCancel" parameterType="cn.ibizlab.businesscentral.core.finance.filter.InvoiceSearchContext" resultMap="InvoiceResultMap">
select t1.* from (
<include refid="Cancel" />
)t1
<where><if test="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere">${ew.sqlSegment}</if></where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.businesscentral.core.finance.filter.InvoiceSearchContext" resultMap="InvoiceResultMap">
select t1.* from (
......@@ -116,20 +125,41 @@
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据集合[Paid]-->
<select id="searchPaid" parameterType="cn.ibizlab.businesscentral.core.finance.filter.InvoiceSearchContext" resultMap="InvoiceResultMap">
select t1.* from (
<include refid="Paid" />
)t1
<where><if test="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere">${ew.sqlSegment}</if></where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据查询[ByParentKey]-->
<sql id="ByParentKey" databaseId="mysql">
<![CDATA[ SELECT t1.`ACCOUNTNAME`, t1.`BILLTO_CITY`, t1.`BILLTO_COMPOSITE`, t1.`BILLTO_COUNTRY`, t1.`BILLTO_FAX`, t1.`BILLTO_LINE1`, t1.`BILLTO_LINE2`, t1.`BILLTO_LINE3`, t1.`BILLTO_NAME`, t1.`BILLTO_POSTALCODE`, t1.`BILLTO_STATEORPROVINCE`, t1.`BILLTO_TELEPHONE`, t1.`CONTACTNAME`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`CUSTOMERID`, t1.`CUSTOMERIDTYPE`, t1.`CUSTOMERNAME`, t1.`DATEDELIVERED`, t1.`DESCRIPTION`, t1.`DISCOUNTAMOUNT`, t1.`DISCOUNTAMOUNT_BASE`, t1.`DISCOUNTPERCENTAGE`, t1.`DUEDATE`, t1.`EMAILADDRESS`, t1.`ENTITYIMAGE`, t1.`ENTITYIMAGEID`, t1.`ENTITYIMAGE_TIMESTAMP`, t1.`ENTITYIMAGE_URL`, t1.`EXCHANGERATE`, t1.`FREIGHTAMOUNT`, t1.`FREIGHTAMOUNT_BASE`, t1.`IMPORTSEQUENCENUMBER`, t1.`INVOICEID`, t1.`INVOICENAME`, t1.`INVOICENUMBER`, t1.`LASTBACKOFFICESUBMIT`, t1.`LASTONHOLDTIME`, t1.`ONHOLDTIME`, t1.`OPPORTUNITYID`, t1.`OPPORTUNITYNAME`, t1.`OVERRIDDENCREATEDON`, t1.`OWNERID`, t1.`OWNERIDTYPE`, t1.`OWNERNAME`, t1.`PAYMENTTERMSCODE`, t1.`PRICELEVELID`, t1.`PRICELEVELNAME`, t1.`PRICELOCKED`, t1.`PRICINGERRORCODE`, t1.`PRIORITYCODE`, t1.`PROCESSID`, t1.`SALESORDERID`, t1.`SALESORDERNAME`, t1.`SHIPPINGMETHODCODE`, t1.`SHIPTO_CITY`, t1.`SHIPTO_COMPOSITE`, t1.`SHIPTO_COUNTRY`, t1.`SHIPTO_FAX`, t1.`SHIPTO_FREIGHTTERMSCODE`, t1.`SHIPTO_LINE1`, t1.`SHIPTO_LINE2`, t1.`SHIPTO_LINE3`, t1.`SHIPTO_NAME`, t1.`SHIPTO_POSTALCODE`, t1.`SHIPTO_STATEORPROVINCE`, t1.`SHIPTO_TELEPHONE`, t1.`SLAID`, t1.`SLANAME`, t1.`STAGEID`, t1.`STATECODE`, t1.`STATUSCODE`, t1.`TIMEZONERULEVERSIONNUMBER`, t1.`TOTALAMOUNT`, t1.`TOTALAMOUNTLESSFREIGHT`, t1.`TOTALAMOUNTLESSFREIGHT_BASE`, t1.`TOTALAMOUNT_BASE`, t1.`TOTALDISCOUNTAMOUNT`, t1.`TOTALDISCOUNTAMOUNT_BASE`, t1.`TOTALLINEITEMAMOUNT`, t1.`TOTALLINEITEMAMOUNT_BASE`, t1.`TOTALLINEITEMDISCOUNTAMOUNT`, t1.`TOTALTAX`, t1.`TOTALTAX_BASE`, t1.`TRANSACTIONCURRENCYID`, t1.`TRANSACTIONCURRENCYNAME`, t1.`TRAVERSEDPATH`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`UTCCONVERSIONTIMEZONECODE`, t1.`VERSIONNUMBER`, t1.`WILLCALL` FROM `INVOICE` t1
<![CDATA[ SELECT t1.`ACCOUNTNAME`, t1.`BILLTO_CITY`, t1.`BILLTO_COMPOSITE`, t1.`BILLTO_COUNTRY`, t1.`BILLTO_FAX`, t1.`BILLTO_LINE1`, t1.`BILLTO_LINE2`, t1.`BILLTO_LINE3`, t1.`BILLTO_NAME`, t1.`BILLTO_POSTALCODE`, t1.`BILLTO_STATEORPROVINCE`, t1.`BILLTO_TELEPHONE`, t1.`CONTACTNAME`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`CUSTOMERID`, t1.`CUSTOMERNAME`, t1.`CUSTOMERTYPE`, t1.`DATEDELIVERED`, t1.`DESCRIPTION`, t1.`DISCOUNTAMOUNT`, t1.`DISCOUNTAMOUNT_BASE`, t1.`DISCOUNTPERCENTAGE`, t1.`DUEDATE`, t1.`EMAILADDRESS`, t1.`ENTITYIMAGE`, t1.`ENTITYIMAGEID`, t1.`ENTITYIMAGE_TIMESTAMP`, t1.`ENTITYIMAGE_URL`, t1.`EXCHANGERATE`, t1.`FREIGHTAMOUNT`, t1.`FREIGHTAMOUNT_BASE`, t1.`IMPORTSEQUENCENUMBER`, t1.`INVOICEID`, t1.`INVOICENAME`, t1.`INVOICENUMBER`, t1.`LASTBACKOFFICESUBMIT`, t1.`LASTONHOLDTIME`, t1.`ONHOLDTIME`, t1.`OPPORTUNITYID`, t1.`OPPORTUNITYNAME`, t1.`OVERRIDDENCREATEDON`, t1.`OWNERID`, t1.`OWNERNAME`, t1.`OWNERTYPE`, t1.`PAYMENTTERMSCODE`, t1.`PRICELEVELID`, t1.`PRICELEVELNAME`, t1.`PRICELOCKED`, t1.`PRICINGERRORCODE`, t1.`PRIORITYCODE`, t1.`PROCESSID`, t1.`SALESORDERID`, t1.`SALESORDERNAME`, t1.`SHIPPINGMETHODCODE`, t1.`SHIPTO_CITY`, t1.`SHIPTO_COMPOSITE`, t1.`SHIPTO_COUNTRY`, t1.`SHIPTO_FAX`, t1.`SHIPTO_FREIGHTTERMSCODE`, t1.`SHIPTO_LINE1`, t1.`SHIPTO_LINE2`, t1.`SHIPTO_LINE3`, t1.`SHIPTO_NAME`, t1.`SHIPTO_POSTALCODE`, t1.`SHIPTO_STATEORPROVINCE`, t1.`SHIPTO_TELEPHONE`, t1.`SLAID`, t1.`SLANAME`, t1.`STAGEID`, t1.`STATECODE`, t1.`STATUSCODE`, t1.`TIMEZONERULEVERSIONNUMBER`, t1.`TOTALAMOUNT`, t1.`TOTALAMOUNTLESSFREIGHT`, t1.`TOTALAMOUNTLESSFREIGHT_BASE`, t1.`TOTALAMOUNT_BASE`, t1.`TOTALDISCOUNTAMOUNT`, t1.`TOTALDISCOUNTAMOUNT_BASE`, t1.`TOTALLINEITEMAMOUNT`, t1.`TOTALLINEITEMAMOUNT_BASE`, t1.`TOTALLINEITEMDISCOUNTAMOUNT`, t1.`TOTALTAX`, t1.`TOTALTAX_BASE`, t1.`TRANSACTIONCURRENCYID`, t1.`TRANSACTIONCURRENCYNAME`, t1.`TRAVERSEDPATH`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`UTCCONVERSIONTIMEZONECODE`, t1.`VERSIONNUMBER`, t1.`WILLCALL` FROM `INVOICE` t1
WHERE ( t1.`CUSTOMERID` = #{srf.datacontext.srfparentkey} )
]]>
</sql>
<!--数据查询[Cancel]-->
<sql id="Cancel" databaseId="mysql">
<![CDATA[ SELECT t1.`ACCOUNTNAME`, t1.`BILLTO_CITY`, t1.`BILLTO_COMPOSITE`, t1.`BILLTO_COUNTRY`, t1.`BILLTO_FAX`, t1.`BILLTO_LINE1`, t1.`BILLTO_LINE2`, t1.`BILLTO_LINE3`, t1.`BILLTO_NAME`, t1.`BILLTO_POSTALCODE`, t1.`BILLTO_STATEORPROVINCE`, t1.`BILLTO_TELEPHONE`, t1.`CONTACTNAME`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`CUSTOMERID`, t1.`CUSTOMERNAME`, t1.`CUSTOMERTYPE`, t1.`DATEDELIVERED`, t1.`DESCRIPTION`, t1.`DISCOUNTAMOUNT`, t1.`DISCOUNTAMOUNT_BASE`, t1.`DISCOUNTPERCENTAGE`, t1.`DUEDATE`, t1.`EMAILADDRESS`, t1.`ENTITYIMAGE`, t1.`ENTITYIMAGEID`, t1.`ENTITYIMAGE_TIMESTAMP`, t1.`ENTITYIMAGE_URL`, t1.`EXCHANGERATE`, t1.`FREIGHTAMOUNT`, t1.`FREIGHTAMOUNT_BASE`, t1.`IMPORTSEQUENCENUMBER`, t1.`INVOICEID`, t1.`INVOICENAME`, t1.`INVOICENUMBER`, t1.`LASTBACKOFFICESUBMIT`, t1.`LASTONHOLDTIME`, t1.`ONHOLDTIME`, t1.`OPPORTUNITYID`, t1.`OPPORTUNITYNAME`, t1.`OVERRIDDENCREATEDON`, t1.`OWNERID`, t1.`OWNERNAME`, t1.`OWNERTYPE`, t1.`PAYMENTTERMSCODE`, t1.`PRICELEVELID`, t1.`PRICELEVELNAME`, t1.`PRICELOCKED`, t1.`PRICINGERRORCODE`, t1.`PRIORITYCODE`, t1.`PROCESSID`, t1.`SALESORDERID`, t1.`SALESORDERNAME`, t1.`SHIPPINGMETHODCODE`, t1.`SHIPTO_CITY`, t1.`SHIPTO_COMPOSITE`, t1.`SHIPTO_COUNTRY`, t1.`SHIPTO_FAX`, t1.`SHIPTO_FREIGHTTERMSCODE`, t1.`SHIPTO_LINE1`, t1.`SHIPTO_LINE2`, t1.`SHIPTO_LINE3`, t1.`SHIPTO_NAME`, t1.`SHIPTO_POSTALCODE`, t1.`SHIPTO_STATEORPROVINCE`, t1.`SHIPTO_TELEPHONE`, t1.`SLAID`, t1.`SLANAME`, t1.`STAGEID`, t1.`STATECODE`, t1.`STATUSCODE`, t1.`TIMEZONERULEVERSIONNUMBER`, t1.`TOTALAMOUNT`, t1.`TOTALAMOUNTLESSFREIGHT`, t1.`TOTALAMOUNTLESSFREIGHT_BASE`, t1.`TOTALAMOUNT_BASE`, t1.`TOTALDISCOUNTAMOUNT`, t1.`TOTALDISCOUNTAMOUNT_BASE`, t1.`TOTALLINEITEMAMOUNT`, t1.`TOTALLINEITEMAMOUNT_BASE`, t1.`TOTALLINEITEMDISCOUNTAMOUNT`, t1.`TOTALTAX`, t1.`TOTALTAX_BASE`, t1.`TRANSACTIONCURRENCYID`, t1.`TRANSACTIONCURRENCYNAME`, t1.`TRAVERSEDPATH`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`UTCCONVERSIONTIMEZONECODE`, t1.`VERSIONNUMBER`, t1.`WILLCALL` FROM `INVOICE` t1
WHERE ( t1.`STATECODE` = 3 )
]]>
</sql>
<!--数据查询[Default]-->
<sql id="Default" databaseId="mysql">
<![CDATA[ SELECT t1.`ACCOUNTNAME`, t1.`BILLTO_CITY`, t1.`BILLTO_COMPOSITE`, t1.`BILLTO_COUNTRY`, t1.`BILLTO_FAX`, t1.`BILLTO_LINE1`, t1.`BILLTO_LINE2`, t1.`BILLTO_LINE3`, t1.`BILLTO_NAME`, t1.`BILLTO_POSTALCODE`, t1.`BILLTO_STATEORPROVINCE`, t1.`BILLTO_TELEPHONE`, t1.`CONTACTNAME`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`CUSTOMERID`, t1.`CUSTOMERIDTYPE`, t1.`CUSTOMERNAME`, t1.`DATEDELIVERED`, t1.`DESCRIPTION`, t1.`DISCOUNTAMOUNT`, t1.`DISCOUNTAMOUNT_BASE`, t1.`DISCOUNTPERCENTAGE`, t1.`DUEDATE`, t1.`EMAILADDRESS`, t1.`ENTITYIMAGE`, t1.`ENTITYIMAGEID`, t1.`ENTITYIMAGE_TIMESTAMP`, t1.`ENTITYIMAGE_URL`, t1.`EXCHANGERATE`, t1.`FREIGHTAMOUNT`, t1.`FREIGHTAMOUNT_BASE`, t1.`IMPORTSEQUENCENUMBER`, t1.`INVOICEID`, t1.`INVOICENAME`, t1.`INVOICENUMBER`, t1.`LASTBACKOFFICESUBMIT`, t1.`LASTONHOLDTIME`, t1.`ONHOLDTIME`, t1.`OPPORTUNITYID`, t1.`OPPORTUNITYNAME`, t1.`OVERRIDDENCREATEDON`, t1.`OWNERID`, t1.`OWNERIDTYPE`, t1.`OWNERNAME`, t1.`PAYMENTTERMSCODE`, t1.`PRICELEVELID`, t1.`PRICELEVELNAME`, t1.`PRICELOCKED`, t1.`PRICINGERRORCODE`, t1.`PRIORITYCODE`, t1.`PROCESSID`, t1.`SALESORDERID`, t1.`SALESORDERNAME`, t1.`SHIPPINGMETHODCODE`, t1.`SHIPTO_CITY`, t1.`SHIPTO_COMPOSITE`, t1.`SHIPTO_COUNTRY`, t1.`SHIPTO_FAX`, t1.`SHIPTO_FREIGHTTERMSCODE`, t1.`SHIPTO_LINE1`, t1.`SHIPTO_LINE2`, t1.`SHIPTO_LINE3`, t1.`SHIPTO_NAME`, t1.`SHIPTO_POSTALCODE`, t1.`SHIPTO_STATEORPROVINCE`, t1.`SHIPTO_TELEPHONE`, t1.`SLAID`, t1.`SLANAME`, t1.`STAGEID`, t1.`STATECODE`, t1.`STATUSCODE`, t1.`TIMEZONERULEVERSIONNUMBER`, t1.`TOTALAMOUNT`, t1.`TOTALAMOUNTLESSFREIGHT`, t1.`TOTALAMOUNTLESSFREIGHT_BASE`, t1.`TOTALAMOUNT_BASE`, t1.`TOTALDISCOUNTAMOUNT`, t1.`TOTALDISCOUNTAMOUNT_BASE`, t1.`TOTALLINEITEMAMOUNT`, t1.`TOTALLINEITEMAMOUNT_BASE`, t1.`TOTALLINEITEMDISCOUNTAMOUNT`, t1.`TOTALTAX`, t1.`TOTALTAX_BASE`, t1.`TRANSACTIONCURRENCYID`, t1.`TRANSACTIONCURRENCYNAME`, t1.`TRAVERSEDPATH`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`UTCCONVERSIONTIMEZONECODE`, t1.`VERSIONNUMBER`, t1.`WILLCALL` FROM `INVOICE` t1
<![CDATA[ SELECT t1.`ACCOUNTNAME`, t1.`BILLTO_CITY`, t1.`BILLTO_COMPOSITE`, t1.`BILLTO_COUNTRY`, t1.`BILLTO_FAX`, t1.`BILLTO_LINE1`, t1.`BILLTO_LINE2`, t1.`BILLTO_LINE3`, t1.`BILLTO_NAME`, t1.`BILLTO_POSTALCODE`, t1.`BILLTO_STATEORPROVINCE`, t1.`BILLTO_TELEPHONE`, t1.`CONTACTNAME`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`CUSTOMERID`, t1.`CUSTOMERNAME`, t1.`CUSTOMERTYPE`, t1.`DATEDELIVERED`, t1.`DESCRIPTION`, t1.`DISCOUNTAMOUNT`, t1.`DISCOUNTAMOUNT_BASE`, t1.`DISCOUNTPERCENTAGE`, t1.`DUEDATE`, t1.`EMAILADDRESS`, t1.`ENTITYIMAGE`, t1.`ENTITYIMAGEID`, t1.`ENTITYIMAGE_TIMESTAMP`, t1.`ENTITYIMAGE_URL`, t1.`EXCHANGERATE`, t1.`FREIGHTAMOUNT`, t1.`FREIGHTAMOUNT_BASE`, t1.`IMPORTSEQUENCENUMBER`, t1.`INVOICEID`, t1.`INVOICENAME`, t1.`INVOICENUMBER`, t1.`LASTBACKOFFICESUBMIT`, t1.`LASTONHOLDTIME`, t1.`ONHOLDTIME`, t1.`OPPORTUNITYID`, t1.`OPPORTUNITYNAME`, t1.`OVERRIDDENCREATEDON`, t1.`OWNERID`, t1.`OWNERNAME`, t1.`OWNERTYPE`, t1.`PAYMENTTERMSCODE`, t1.`PRICELEVELID`, t1.`PRICELEVELNAME`, t1.`PRICELOCKED`, t1.`PRICINGERRORCODE`, t1.`PRIORITYCODE`, t1.`PROCESSID`, t1.`SALESORDERID`, t1.`SALESORDERNAME`, t1.`SHIPPINGMETHODCODE`, t1.`SHIPTO_CITY`, t1.`SHIPTO_COMPOSITE`, t1.`SHIPTO_COUNTRY`, t1.`SHIPTO_FAX`, t1.`SHIPTO_FREIGHTTERMSCODE`, t1.`SHIPTO_LINE1`, t1.`SHIPTO_LINE2`, t1.`SHIPTO_LINE3`, t1.`SHIPTO_NAME`, t1.`SHIPTO_POSTALCODE`, t1.`SHIPTO_STATEORPROVINCE`, t1.`SHIPTO_TELEPHONE`, t1.`SLAID`, t1.`SLANAME`, t1.`STAGEID`, t1.`STATECODE`, t1.`STATUSCODE`, t1.`TIMEZONERULEVERSIONNUMBER`, t1.`TOTALAMOUNT`, t1.`TOTALAMOUNTLESSFREIGHT`, t1.`TOTALAMOUNTLESSFREIGHT_BASE`, t1.`TOTALAMOUNT_BASE`, t1.`TOTALDISCOUNTAMOUNT`, t1.`TOTALDISCOUNTAMOUNT_BASE`, t1.`TOTALLINEITEMAMOUNT`, t1.`TOTALLINEITEMAMOUNT_BASE`, t1.`TOTALLINEITEMDISCOUNTAMOUNT`, t1.`TOTALTAX`, t1.`TOTALTAX_BASE`, t1.`TRANSACTIONCURRENCYID`, t1.`TRANSACTIONCURRENCYNAME`, t1.`TRAVERSEDPATH`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`UTCCONVERSIONTIMEZONECODE`, t1.`VERSIONNUMBER`, t1.`WILLCALL` FROM `INVOICE` t1
]]>
</sql>
<!--数据查询[Paid]-->
<sql id="Paid" databaseId="mysql">
<![CDATA[ SELECT t1.`ACCOUNTNAME`, t1.`BILLTO_CITY`, t1.`BILLTO_COMPOSITE`, t1.`BILLTO_COUNTRY`, t1.`BILLTO_FAX`, t1.`BILLTO_LINE1`, t1.`BILLTO_LINE2`, t1.`BILLTO_LINE3`, t1.`BILLTO_NAME`, t1.`BILLTO_POSTALCODE`, t1.`BILLTO_STATEORPROVINCE`, t1.`BILLTO_TELEPHONE`, t1.`CONTACTNAME`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`CUSTOMERID`, t1.`CUSTOMERNAME`, t1.`CUSTOMERTYPE`, t1.`DATEDELIVERED`, t1.`DESCRIPTION`, t1.`DISCOUNTAMOUNT`, t1.`DISCOUNTAMOUNT_BASE`, t1.`DISCOUNTPERCENTAGE`, t1.`DUEDATE`, t1.`EMAILADDRESS`, t1.`ENTITYIMAGE`, t1.`ENTITYIMAGEID`, t1.`ENTITYIMAGE_TIMESTAMP`, t1.`ENTITYIMAGE_URL`, t1.`EXCHANGERATE`, t1.`FREIGHTAMOUNT`, t1.`FREIGHTAMOUNT_BASE`, t1.`IMPORTSEQUENCENUMBER`, t1.`INVOICEID`, t1.`INVOICENAME`, t1.`INVOICENUMBER`, t1.`LASTBACKOFFICESUBMIT`, t1.`LASTONHOLDTIME`, t1.`ONHOLDTIME`, t1.`OPPORTUNITYID`, t1.`OPPORTUNITYNAME`, t1.`OVERRIDDENCREATEDON`, t1.`OWNERID`, t1.`OWNERNAME`, t1.`OWNERTYPE`, t1.`PAYMENTTERMSCODE`, t1.`PRICELEVELID`, t1.`PRICELEVELNAME`, t1.`PRICELOCKED`, t1.`PRICINGERRORCODE`, t1.`PRIORITYCODE`, t1.`PROCESSID`, t1.`SALESORDERID`, t1.`SALESORDERNAME`, t1.`SHIPPINGMETHODCODE`, t1.`SHIPTO_CITY`, t1.`SHIPTO_COMPOSITE`, t1.`SHIPTO_COUNTRY`, t1.`SHIPTO_FAX`, t1.`SHIPTO_FREIGHTTERMSCODE`, t1.`SHIPTO_LINE1`, t1.`SHIPTO_LINE2`, t1.`SHIPTO_LINE3`, t1.`SHIPTO_NAME`, t1.`SHIPTO_POSTALCODE`, t1.`SHIPTO_STATEORPROVINCE`, t1.`SHIPTO_TELEPHONE`, t1.`SLAID`, t1.`SLANAME`, t1.`STAGEID`, t1.`STATECODE`, t1.`STATUSCODE`, t1.`TIMEZONERULEVERSIONNUMBER`, t1.`TOTALAMOUNT`, t1.`TOTALAMOUNTLESSFREIGHT`, t1.`TOTALAMOUNTLESSFREIGHT_BASE`, t1.`TOTALAMOUNT_BASE`, t1.`TOTALDISCOUNTAMOUNT`, t1.`TOTALDISCOUNTAMOUNT_BASE`, t1.`TOTALLINEITEMAMOUNT`, t1.`TOTALLINEITEMAMOUNT_BASE`, t1.`TOTALLINEITEMDISCOUNTAMOUNT`, t1.`TOTALTAX`, t1.`TOTALTAX_BASE`, t1.`TRANSACTIONCURRENCYID`, t1.`TRANSACTIONCURRENCYNAME`, t1.`TRAVERSEDPATH`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`UTCCONVERSIONTIMEZONECODE`, t1.`VERSIONNUMBER`, t1.`WILLCALL` FROM `INVOICE` t1
WHERE ( t1.`STATECODE` = 2 )
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`ACCOUNTNAME`, t1.`BILLTO_CITY`, t1.`BILLTO_COMPOSITE`, t1.`BILLTO_COUNTRY`, t1.`BILLTO_FAX`, t1.`BILLTO_LINE1`, t1.`BILLTO_LINE2`, t1.`BILLTO_LINE3`, t1.`BILLTO_NAME`, t1.`BILLTO_POSTALCODE`, t1.`BILLTO_STATEORPROVINCE`, t1.`BILLTO_TELEPHONE`, t1.`CONTACTNAME`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`CUSTOMERID`, t1.`CUSTOMERIDTYPE`, t1.`CUSTOMERNAME`, t1.`DATEDELIVERED`, t1.`DESCRIPTION`, t1.`DISCOUNTAMOUNT`, t1.`DISCOUNTAMOUNT_BASE`, t1.`DISCOUNTPERCENTAGE`, t1.`DUEDATE`, t1.`EMAILADDRESS`, t1.`ENTITYIMAGE`, t1.`ENTITYIMAGEID`, t1.`ENTITYIMAGE_TIMESTAMP`, t1.`ENTITYIMAGE_URL`, t1.`EXCHANGERATE`, t1.`FREIGHTAMOUNT`, t1.`FREIGHTAMOUNT_BASE`, t1.`IMPORTSEQUENCENUMBER`, t1.`INVOICEID`, t1.`INVOICENAME`, t1.`INVOICENUMBER`, t1.`LASTBACKOFFICESUBMIT`, t1.`LASTONHOLDTIME`, t1.`ONHOLDTIME`, t1.`OPPORTUNITYID`, t1.`OPPORTUNITYNAME`, t1.`OVERRIDDENCREATEDON`, t1.`OWNERID`, t1.`OWNERIDTYPE`, t1.`OWNERNAME`, t1.`PAYMENTTERMSCODE`, t1.`PRICELEVELID`, t1.`PRICELEVELNAME`, t1.`PRICELOCKED`, t1.`PRICINGERRORCODE`, t1.`PRIORITYCODE`, t1.`PROCESSID`, t1.`SALESORDERID`, t1.`SALESORDERNAME`, t1.`SHIPPINGMETHODCODE`, t1.`SHIPTO_CITY`, t1.`SHIPTO_COMPOSITE`, t1.`SHIPTO_COUNTRY`, t1.`SHIPTO_FAX`, t1.`SHIPTO_FREIGHTTERMSCODE`, t1.`SHIPTO_LINE1`, t1.`SHIPTO_LINE2`, t1.`SHIPTO_LINE3`, t1.`SHIPTO_NAME`, t1.`SHIPTO_POSTALCODE`, t1.`SHIPTO_STATEORPROVINCE`, t1.`SHIPTO_TELEPHONE`, t1.`SLAID`, t1.`SLANAME`, t1.`STAGEID`, t1.`STATECODE`, t1.`STATUSCODE`, t1.`TIMEZONERULEVERSIONNUMBER`, t1.`TOTALAMOUNT`, t1.`TOTALAMOUNTLESSFREIGHT`, t1.`TOTALAMOUNTLESSFREIGHT_BASE`, t1.`TOTALAMOUNT_BASE`, t1.`TOTALDISCOUNTAMOUNT`, t1.`TOTALDISCOUNTAMOUNT_BASE`, t1.`TOTALLINEITEMAMOUNT`, t1.`TOTALLINEITEMAMOUNT_BASE`, t1.`TOTALLINEITEMDISCOUNTAMOUNT`, t1.`TOTALTAX`, t1.`TOTALTAX_BASE`, t1.`TRANSACTIONCURRENCYID`, t1.`TRANSACTIONCURRENCYNAME`, t1.`TRAVERSEDPATH`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`UTCCONVERSIONTIMEZONECODE`, t1.`VERSIONNUMBER`, t1.`WILLCALL` FROM `INVOICE` t1
<![CDATA[ SELECT t1.`ACCOUNTNAME`, t1.`BILLTO_CITY`, t1.`BILLTO_COMPOSITE`, t1.`BILLTO_COUNTRY`, t1.`BILLTO_FAX`, t1.`BILLTO_LINE1`, t1.`BILLTO_LINE2`, t1.`BILLTO_LINE3`, t1.`BILLTO_NAME`, t1.`BILLTO_POSTALCODE`, t1.`BILLTO_STATEORPROVINCE`, t1.`BILLTO_TELEPHONE`, t1.`CONTACTNAME`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`CUSTOMERID`, t1.`CUSTOMERNAME`, t1.`CUSTOMERTYPE`, t1.`DATEDELIVERED`, t1.`DESCRIPTION`, t1.`DISCOUNTAMOUNT`, t1.`DISCOUNTAMOUNT_BASE`, t1.`DISCOUNTPERCENTAGE`, t1.`DUEDATE`, t1.`EMAILADDRESS`, t1.`ENTITYIMAGE`, t1.`ENTITYIMAGEID`, t1.`ENTITYIMAGE_TIMESTAMP`, t1.`ENTITYIMAGE_URL`, t1.`EXCHANGERATE`, t1.`FREIGHTAMOUNT`, t1.`FREIGHTAMOUNT_BASE`, t1.`IMPORTSEQUENCENUMBER`, t1.`INVOICEID`, t1.`INVOICENAME`, t1.`INVOICENUMBER`, t1.`LASTBACKOFFICESUBMIT`, t1.`LASTONHOLDTIME`, t1.`ONHOLDTIME`, t1.`OPPORTUNITYID`, t1.`OPPORTUNITYNAME`, t1.`OVERRIDDENCREATEDON`, t1.`OWNERID`, t1.`OWNERNAME`, t1.`OWNERTYPE`, t1.`PAYMENTTERMSCODE`, t1.`PRICELEVELID`, t1.`PRICELEVELNAME`, t1.`PRICELOCKED`, t1.`PRICINGERRORCODE`, t1.`PRIORITYCODE`, t1.`PROCESSID`, t1.`SALESORDERID`, t1.`SALESORDERNAME`, t1.`SHIPPINGMETHODCODE`, t1.`SHIPTO_CITY`, t1.`SHIPTO_COMPOSITE`, t1.`SHIPTO_COUNTRY`, t1.`SHIPTO_FAX`, t1.`SHIPTO_FREIGHTTERMSCODE`, t1.`SHIPTO_LINE1`, t1.`SHIPTO_LINE2`, t1.`SHIPTO_LINE3`, t1.`SHIPTO_NAME`, t1.`SHIPTO_POSTALCODE`, t1.`SHIPTO_STATEORPROVINCE`, t1.`SHIPTO_TELEPHONE`, t1.`SLAID`, t1.`SLANAME`, t1.`STAGEID`, t1.`STATECODE`, t1.`STATUSCODE`, t1.`TIMEZONERULEVERSIONNUMBER`, t1.`TOTALAMOUNT`, t1.`TOTALAMOUNTLESSFREIGHT`, t1.`TOTALAMOUNTLESSFREIGHT_BASE`, t1.`TOTALAMOUNT_BASE`, t1.`TOTALDISCOUNTAMOUNT`, t1.`TOTALDISCOUNTAMOUNT_BASE`, t1.`TOTALLINEITEMAMOUNT`, t1.`TOTALLINEITEMAMOUNT_BASE`, t1.`TOTALLINEITEMDISCOUNTAMOUNT`, t1.`TOTALTAX`, t1.`TOTALTAX_BASE`, t1.`TRANSACTIONCURRENCYID`, t1.`TRANSACTIONCURRENCYNAME`, t1.`TRAVERSEDPATH`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`UTCCONVERSIONTIMEZONECODE`, t1.`VERSIONNUMBER`, t1.`WILLCALL` FROM `INVOICE` t1
]]>
</sql>
</mapper>
......
......@@ -119,7 +119,7 @@
"dename":"Invoice",
"delogicname":"发票",
"sysmoudle":{"id":"FINANCE","name":"Finance"},
"dedataset":[{"id":"ByParentKey" , "name":"ByParentKey"},{"id":"Default" , "name":"DEFAULT"}],
"dedataset":[{"id":"ByParentKey" , "name":"ByParentKey"},{"id":"Cancel" , "name":"已取消"},{"id":"Default" , "name":"DEFAULT"},{"id":"Paid" , "name":"已支付"}],
"deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"Cancel" , "name":"取消发票" , "type":"USERCUSTOM" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Finish" , "name":"确认发票" , "type":"USERCUSTOM" },{"id":"Paid" , "name":"发票已支付" , "type":"USERCUSTOM" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
}
......
package cn.ibizlab.businesscentral.finance.logic.invoicelogic.cancel;
import java.util.Map;
import java.util.HashMap;
import com.alibaba.fastjson.JSONObject;
global cn.ibizlab.businesscentral.core.finance.domain.Invoice invoicecanceldefault;
global cn.ibizlab.businesscentral.core.finance.service.IInvoiceService iBzSysInvoiceDefaultService;
global cn.ibizlab.businesscentral.util.security.AuthenticationUser curuser;
no-loop
//逻辑处理节点[开始]
rule "begin"
ruleflow-group "invoicecancelbegin"
when
then
end
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:g="http://www.jboss.org/drools/flow/gpd" xmlns:tns="http://www.jboss.org/drools" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" expressionLanguage="http://www.mvel.org/2.0" id="Definition" name="" targetNamespace="http://www.jboss.org/drools" typeLanguage="http://www.java.com/javaTypes">
<process id="cn.ibizlab.businesscentral.core.finance.service.logic.invoicecancel" isClosed="false" isExecutable="true" name="ScoreRule" processType="Private" tns:packageName="cn.ibizlab.businesscentral.core.finance.service.logic.invoicecancel">
<extensionElements>
<tns:import name="java.util.Map" />
<tns:import name="org.springframework.util.StringUtils"/>
<tns:import name="cn.ibizlab.businesscentral.util.helper.RuleUtils"/>
<tns:global identifier="invoicecanceldefault" type="cn.ibizlab.businesscentral.core.finance.domain.Invoice" />
</extensionElements>
<startEvent id="9A2B78B2-DC42-4EE1-96D4-507FAB73DE1D" isInterrupting="true"/>
<endEvent id="9A2B78B2-DC42-4EE1-96D4-507FAB73DE1D_End" name="End"/>
<sequenceFlow id="9A2B78B2-DC42-4EE1-96D4-507FAB73DE1D_End_Line" sourceRef="9A2B78B2-DC42-4EE1-96D4-507FAB73DE1D" targetRef="9A2B78B2-DC42-4EE1-96D4-507FAB73DE1D_End"/>
</process>
</definitions>
package cn.ibizlab.businesscentral.finance.logic.invoicelogic.paid;
import java.util.Map;
import java.util.HashMap;
import com.alibaba.fastjson.JSONObject;
global cn.ibizlab.businesscentral.core.finance.domain.Invoice invoicepaiddefault;
global cn.ibizlab.businesscentral.core.finance.service.IInvoiceService invoiceservice;
global cn.ibizlab.businesscentral.core.finance.service.IInvoiceService iBzSysInvoiceDefaultService;
global cn.ibizlab.businesscentral.util.security.AuthenticationUser curuser;
no-loop
//逻辑处理节点[准备参数]
rule "prepareparam1"
ruleflow-group "invoicepaidprepareparam1"
when
then
invoicepaiddefault.set("statecode","2");
update(invoicepaiddefault);//更新fact中变量值
end
//逻辑处理节点[开始]
rule "begin"
ruleflow-group "invoicepaidbegin"
when
then
end
//逻辑处理节点[更新发票状态]
rule "deaction1"
ruleflow-group "invoicepaiddeaction1"
when
then
invoiceservice.update(invoicepaiddefault);
update(invoicepaiddefault);//更新fact中变量值
end
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:g="http://www.jboss.org/drools/flow/gpd" xmlns:tns="http://www.jboss.org/drools" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" expressionLanguage="http://www.mvel.org/2.0" id="Definition" name="" targetNamespace="http://www.jboss.org/drools" typeLanguage="http://www.java.com/javaTypes">
<process id="cn.ibizlab.businesscentral.core.finance.service.logic.invoicepaid" isClosed="false" isExecutable="true" name="ScoreRule" processType="Private" tns:packageName="cn.ibizlab.businesscentral.core.finance.service.logic.invoicepaid">
<extensionElements>
<tns:import name="java.util.Map" />
<tns:import name="org.springframework.util.StringUtils"/>
<tns:import name="cn.ibizlab.businesscentral.util.helper.RuleUtils"/>
<tns:global identifier="invoicepaiddefault" type="cn.ibizlab.businesscentral.core.finance.domain.Invoice" />
</extensionElements>
<businessRuleTask activiti:exclusive="true" g:ruleFlowGroup="invoicepaidprepareparam1" id="C0E66037-E024-43BE-B1B2-CEDA60C832EE" implementation="http://www.jboss.org/drools/rule" name="准备参数"/>
<startEvent id="72CD98D0-46C7-4BE7-9FE6-44BB8CE4E5FC" isInterrupting="true"/>
<businessRuleTask activiti:exclusive="true" g:ruleFlowGroup="invoicepaiddeaction1" id="E6819088-CA61-43E5-80E4-6720891C5F57" implementation="http://www.jboss.org/drools/rule" name="更新发票状态"/>
<endEvent id="E6819088-CA61-43E5-80E4-6720891C5F57_End" name="End"/>
<sequenceFlow id="E6819088-CA61-43E5-80E4-6720891C5F57_End_Line" sourceRef="E6819088-CA61-43E5-80E4-6720891C5F57" targetRef="E6819088-CA61-43E5-80E4-6720891C5F57_End"/>
<sequenceFlow id="B6C47053-84A3-4EB7-8DFD-3532F5597DAA" sourceRef="72CD98D0-46C7-4BE7-9FE6-44BB8CE4E5FC" targetRef="C0E66037-E024-43BE-B1B2-CEDA60C832EE">
</sequenceFlow>
<sequenceFlow id="7DA904A6-9E90-4FC8-A46F-E91620F1B28D" sourceRef="C0E66037-E024-43BE-B1B2-CEDA60C832EE" targetRef="E6819088-CA61-43E5-80E4-6720891C5F57">
</sequenceFlow>
</process>
</definitions>
......@@ -196,6 +196,27 @@ public class InvoiceResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(invoiceMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Invoice-searchCancel-all') and hasPermission(#context,'iBizBusinessCentral-Invoice-Get')")
@ApiOperation(value = "获取已取消", tags = {"发票" } ,notes = "获取已取消")
@RequestMapping(method= RequestMethod.GET , value="/invoices/fetchcancel")
public ResponseEntity<List<InvoiceDTO>> fetchCancel(InvoiceSearchContext context) {
Page<Invoice> domains = invoiceService.searchCancel(context) ;
List<InvoiceDTO> list = invoiceMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Invoice-searchCancel-all') and hasPermission(#context,'iBizBusinessCentral-Invoice-Get')")
@ApiOperation(value = "查询已取消", tags = {"发票" } ,notes = "查询已取消")
@RequestMapping(method= RequestMethod.POST , value="/invoices/searchcancel")
public ResponseEntity<Page<InvoiceDTO>> searchCancel(@RequestBody InvoiceSearchContext context) {
Page<Invoice> domains = invoiceService.searchCancel(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(invoiceMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Invoice-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-Invoice-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"发票" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/invoices/fetchdefault")
......@@ -217,6 +238,27 @@ public class InvoiceResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(invoiceMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Invoice-searchPaid-all') and hasPermission(#context,'iBizBusinessCentral-Invoice-Get')")
@ApiOperation(value = "获取已支付", tags = {"发票" } ,notes = "获取已支付")
@RequestMapping(method= RequestMethod.GET , value="/invoices/fetchpaid")
public ResponseEntity<List<InvoiceDTO>> fetchPaid(InvoiceSearchContext context) {
Page<Invoice> domains = invoiceService.searchPaid(context) ;
List<InvoiceDTO> list = invoiceMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Invoice-searchPaid-all') and hasPermission(#context,'iBizBusinessCentral-Invoice-Get')")
@ApiOperation(value = "查询已支付", tags = {"发票" } ,notes = "查询已支付")
@RequestMapping(method= RequestMethod.POST , value="/invoices/searchpaid")
public ResponseEntity<Page<InvoiceDTO>> searchPaid(@RequestBody InvoiceSearchContext context) {
Page<Invoice> domains = invoiceService.searchPaid(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(invoiceMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.invoiceMapping.toDomain(#invoicedto),'iBizBusinessCentral-Invoice-Create')")
@ApiOperation(value = "根据订单建立发票", tags = {"发票" }, notes = "根据订单建立发票")
@RequestMapping(method = RequestMethod.POST, value = "/salesorders/{salesorder_id}/invoices")
......@@ -386,6 +428,29 @@ public class InvoiceResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(invoiceMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Invoice-searchCancel-all') and hasPermission(#context,'iBizBusinessCentral-Invoice-Get')")
@ApiOperation(value = "根据订单获取已取消", tags = {"发票" } ,notes = "根据订单获取已取消")
@RequestMapping(method= RequestMethod.GET , value="/salesorders/{salesorder_id}/invoices/fetchcancel")
public ResponseEntity<List<InvoiceDTO>> fetchInvoiceCancelBySalesOrder(@PathVariable("salesorder_id") String salesorder_id,InvoiceSearchContext context) {
context.setN_salesorderid_eq(salesorder_id);
Page<Invoice> domains = invoiceService.searchCancel(context) ;
List<InvoiceDTO> list = invoiceMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Invoice-searchCancel-all') and hasPermission(#context,'iBizBusinessCentral-Invoice-Get')")
@ApiOperation(value = "根据订单查询已取消", tags = {"发票" } ,notes = "根据订单查询已取消")
@RequestMapping(method= RequestMethod.POST , value="/salesorders/{salesorder_id}/invoices/searchcancel")
public ResponseEntity<Page<InvoiceDTO>> searchInvoiceCancelBySalesOrder(@PathVariable("salesorder_id") String salesorder_id, @RequestBody InvoiceSearchContext context) {
context.setN_salesorderid_eq(salesorder_id);
Page<Invoice> domains = invoiceService.searchCancel(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(invoiceMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Invoice-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-Invoice-Get')")
@ApiOperation(value = "根据订单获取DEFAULT", tags = {"发票" } ,notes = "根据订单获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/salesorders/{salesorder_id}/invoices/fetchdefault")
......@@ -409,6 +474,29 @@ public class InvoiceResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(invoiceMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Invoice-searchPaid-all') and hasPermission(#context,'iBizBusinessCentral-Invoice-Get')")
@ApiOperation(value = "根据订单获取已支付", tags = {"发票" } ,notes = "根据订单获取已支付")
@RequestMapping(method= RequestMethod.GET , value="/salesorders/{salesorder_id}/invoices/fetchpaid")
public ResponseEntity<List<InvoiceDTO>> fetchInvoicePaidBySalesOrder(@PathVariable("salesorder_id") String salesorder_id,InvoiceSearchContext context) {
context.setN_salesorderid_eq(salesorder_id);
Page<Invoice> domains = invoiceService.searchPaid(context) ;
List<InvoiceDTO> list = invoiceMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Invoice-searchPaid-all') and hasPermission(#context,'iBizBusinessCentral-Invoice-Get')")
@ApiOperation(value = "根据订单查询已支付", tags = {"发票" } ,notes = "根据订单查询已支付")
@RequestMapping(method= RequestMethod.POST , value="/salesorders/{salesorder_id}/invoices/searchpaid")
public ResponseEntity<Page<InvoiceDTO>> searchInvoicePaidBySalesOrder(@PathVariable("salesorder_id") String salesorder_id, @RequestBody InvoiceSearchContext context) {
context.setN_salesorderid_eq(salesorder_id);
Page<Invoice> domains = invoiceService.searchPaid(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(invoiceMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.invoiceMapping.toDomain(#invoicedto),'iBizBusinessCentral-Invoice-Create')")
@ApiOperation(value = "根据报价单订单建立发票", tags = {"发票" }, notes = "根据报价单订单建立发票")
@RequestMapping(method = RequestMethod.POST, value = "/quotes/{quote_id}/salesorders/{salesorder_id}/invoices")
......@@ -578,6 +666,29 @@ public class InvoiceResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(invoiceMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Invoice-searchCancel-all') and hasPermission(#context,'iBizBusinessCentral-Invoice-Get')")
@ApiOperation(value = "根据报价单订单获取已取消", tags = {"发票" } ,notes = "根据报价单订单获取已取消")
@RequestMapping(method= RequestMethod.GET , value="/quotes/{quote_id}/salesorders/{salesorder_id}/invoices/fetchcancel")
public ResponseEntity<List<InvoiceDTO>> fetchInvoiceCancelByQuoteSalesOrder(@PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id,InvoiceSearchContext context) {
context.setN_salesorderid_eq(salesorder_id);
Page<Invoice> domains = invoiceService.searchCancel(context) ;
List<InvoiceDTO> list = invoiceMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Invoice-searchCancel-all') and hasPermission(#context,'iBizBusinessCentral-Invoice-Get')")
@ApiOperation(value = "根据报价单订单查询已取消", tags = {"发票" } ,notes = "根据报价单订单查询已取消")
@RequestMapping(method= RequestMethod.POST , value="/quotes/{quote_id}/salesorders/{salesorder_id}/invoices/searchcancel")
public ResponseEntity<Page<InvoiceDTO>> searchInvoiceCancelByQuoteSalesOrder(@PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody InvoiceSearchContext context) {
context.setN_salesorderid_eq(salesorder_id);
Page<Invoice> domains = invoiceService.searchCancel(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(invoiceMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Invoice-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-Invoice-Get')")
@ApiOperation(value = "根据报价单订单获取DEFAULT", tags = {"发票" } ,notes = "根据报价单订单获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/quotes/{quote_id}/salesorders/{salesorder_id}/invoices/fetchdefault")
......@@ -601,6 +712,29 @@ public class InvoiceResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(invoiceMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Invoice-searchPaid-all') and hasPermission(#context,'iBizBusinessCentral-Invoice-Get')")
@ApiOperation(value = "根据报价单订单获取已支付", tags = {"发票" } ,notes = "根据报价单订单获取已支付")
@RequestMapping(method= RequestMethod.GET , value="/quotes/{quote_id}/salesorders/{salesorder_id}/invoices/fetchpaid")
public ResponseEntity<List<InvoiceDTO>> fetchInvoicePaidByQuoteSalesOrder(@PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id,InvoiceSearchContext context) {
context.setN_salesorderid_eq(salesorder_id);
Page<Invoice> domains = invoiceService.searchPaid(context) ;
List<InvoiceDTO> list = invoiceMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Invoice-searchPaid-all') and hasPermission(#context,'iBizBusinessCentral-Invoice-Get')")
@ApiOperation(value = "根据报价单订单查询已支付", tags = {"发票" } ,notes = "根据报价单订单查询已支付")
@RequestMapping(method= RequestMethod.POST , value="/quotes/{quote_id}/salesorders/{salesorder_id}/invoices/searchpaid")
public ResponseEntity<Page<InvoiceDTO>> searchInvoicePaidByQuoteSalesOrder(@PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody InvoiceSearchContext context) {
context.setN_salesorderid_eq(salesorder_id);
Page<Invoice> domains = invoiceService.searchPaid(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(invoiceMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.invoiceMapping.toDomain(#invoicedto),'iBizBusinessCentral-Invoice-Create')")
@ApiOperation(value = "根据商机报价单订单建立发票", tags = {"发票" }, notes = "根据商机报价单订单建立发票")
@RequestMapping(method = RequestMethod.POST, value = "/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/invoices")
......@@ -770,6 +904,29 @@ public class InvoiceResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(invoiceMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Invoice-searchCancel-all') and hasPermission(#context,'iBizBusinessCentral-Invoice-Get')")
@ApiOperation(value = "根据商机报价单订单获取已取消", tags = {"发票" } ,notes = "根据商机报价单订单获取已取消")
@RequestMapping(method= RequestMethod.GET , value="/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/invoices/fetchcancel")
public ResponseEntity<List<InvoiceDTO>> fetchInvoiceCancelByOpportunityQuoteSalesOrder(@PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id,InvoiceSearchContext context) {
context.setN_salesorderid_eq(salesorder_id);
Page<Invoice> domains = invoiceService.searchCancel(context) ;
List<InvoiceDTO> list = invoiceMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Invoice-searchCancel-all') and hasPermission(#context,'iBizBusinessCentral-Invoice-Get')")
@ApiOperation(value = "根据商机报价单订单查询已取消", tags = {"发票" } ,notes = "根据商机报价单订单查询已取消")
@RequestMapping(method= RequestMethod.POST , value="/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/invoices/searchcancel")
public ResponseEntity<Page<InvoiceDTO>> searchInvoiceCancelByOpportunityQuoteSalesOrder(@PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody InvoiceSearchContext context) {
context.setN_salesorderid_eq(salesorder_id);
Page<Invoice> domains = invoiceService.searchCancel(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(invoiceMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Invoice-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-Invoice-Get')")
@ApiOperation(value = "根据商机报价单订单获取DEFAULT", tags = {"发票" } ,notes = "根据商机报价单订单获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/invoices/fetchdefault")
......@@ -793,6 +950,29 @@ public class InvoiceResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(invoiceMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Invoice-searchPaid-all') and hasPermission(#context,'iBizBusinessCentral-Invoice-Get')")
@ApiOperation(value = "根据商机报价单订单获取已支付", tags = {"发票" } ,notes = "根据商机报价单订单获取已支付")
@RequestMapping(method= RequestMethod.GET , value="/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/invoices/fetchpaid")
public ResponseEntity<List<InvoiceDTO>> fetchInvoicePaidByOpportunityQuoteSalesOrder(@PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id,InvoiceSearchContext context) {
context.setN_salesorderid_eq(salesorder_id);
Page<Invoice> domains = invoiceService.searchPaid(context) ;
List<InvoiceDTO> list = invoiceMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Invoice-searchPaid-all') and hasPermission(#context,'iBizBusinessCentral-Invoice-Get')")
@ApiOperation(value = "根据商机报价单订单查询已支付", tags = {"发票" } ,notes = "根据商机报价单订单查询已支付")
@RequestMapping(method= RequestMethod.POST , value="/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/invoices/searchpaid")
public ResponseEntity<Page<InvoiceDTO>> searchInvoicePaidByOpportunityQuoteSalesOrder(@PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody InvoiceSearchContext context) {
context.setN_salesorderid_eq(salesorder_id);
Page<Invoice> domains = invoiceService.searchPaid(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(invoiceMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.invoiceMapping.toDomain(#invoicedto),'iBizBusinessCentral-Invoice-Create')")
@ApiOperation(value = "根据客户商机报价单订单建立发票", tags = {"发票" }, notes = "根据客户商机报价单订单建立发票")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/invoices")
......@@ -962,6 +1142,29 @@ public class InvoiceResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(invoiceMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Invoice-searchCancel-all') and hasPermission(#context,'iBizBusinessCentral-Invoice-Get')")
@ApiOperation(value = "根据客户商机报价单订单获取已取消", tags = {"发票" } ,notes = "根据客户商机报价单订单获取已取消")
@RequestMapping(method= RequestMethod.GET , value="/accounts/{account_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/invoices/fetchcancel")
public ResponseEntity<List<InvoiceDTO>> fetchInvoiceCancelByAccountOpportunityQuoteSalesOrder(@PathVariable("account_id") String account_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id,InvoiceSearchContext context) {
context.setN_salesorderid_eq(salesorder_id);
Page<Invoice> domains = invoiceService.searchCancel(context) ;
List<InvoiceDTO> list = invoiceMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Invoice-searchCancel-all') and hasPermission(#context,'iBizBusinessCentral-Invoice-Get')")
@ApiOperation(value = "根据客户商机报价单订单查询已取消", tags = {"发票" } ,notes = "根据客户商机报价单订单查询已取消")
@RequestMapping(method= RequestMethod.POST , value="/accounts/{account_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/invoices/searchcancel")
public ResponseEntity<Page<InvoiceDTO>> searchInvoiceCancelByAccountOpportunityQuoteSalesOrder(@PathVariable("account_id") String account_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody InvoiceSearchContext context) {
context.setN_salesorderid_eq(salesorder_id);
Page<Invoice> domains = invoiceService.searchCancel(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(invoiceMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Invoice-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-Invoice-Get')")
@ApiOperation(value = "根据客户商机报价单订单获取DEFAULT", tags = {"发票" } ,notes = "根据客户商机报价单订单获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/accounts/{account_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/invoices/fetchdefault")
......@@ -985,6 +1188,29 @@ public class InvoiceResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(invoiceMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Invoice-searchPaid-all') and hasPermission(#context,'iBizBusinessCentral-Invoice-Get')")
@ApiOperation(value = "根据客户商机报价单订单获取已支付", tags = {"发票" } ,notes = "根据客户商机报价单订单获取已支付")
@RequestMapping(method= RequestMethod.GET , value="/accounts/{account_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/invoices/fetchpaid")
public ResponseEntity<List<InvoiceDTO>> fetchInvoicePaidByAccountOpportunityQuoteSalesOrder(@PathVariable("account_id") String account_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id,InvoiceSearchContext context) {
context.setN_salesorderid_eq(salesorder_id);
Page<Invoice> domains = invoiceService.searchPaid(context) ;
List<InvoiceDTO> list = invoiceMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Invoice-searchPaid-all') and hasPermission(#context,'iBizBusinessCentral-Invoice-Get')")
@ApiOperation(value = "根据客户商机报价单订单查询已支付", tags = {"发票" } ,notes = "根据客户商机报价单订单查询已支付")
@RequestMapping(method= RequestMethod.POST , value="/accounts/{account_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/invoices/searchpaid")
public ResponseEntity<Page<InvoiceDTO>> searchInvoicePaidByAccountOpportunityQuoteSalesOrder(@PathVariable("account_id") String account_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody InvoiceSearchContext context) {
context.setN_salesorderid_eq(salesorder_id);
Page<Invoice> domains = invoiceService.searchPaid(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(invoiceMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.invoiceMapping.toDomain(#invoicedto),'iBizBusinessCentral-Invoice-Create')")
@ApiOperation(value = "根据联系人商机报价单订单建立发票", tags = {"发票" }, notes = "根据联系人商机报价单订单建立发票")
@RequestMapping(method = RequestMethod.POST, value = "/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/invoices")
......@@ -1154,6 +1380,29 @@ public class InvoiceResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(invoiceMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Invoice-searchCancel-all') and hasPermission(#context,'iBizBusinessCentral-Invoice-Get')")
@ApiOperation(value = "根据联系人商机报价单订单获取已取消", tags = {"发票" } ,notes = "根据联系人商机报价单订单获取已取消")
@RequestMapping(method= RequestMethod.GET , value="/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/invoices/fetchcancel")
public ResponseEntity<List<InvoiceDTO>> fetchInvoiceCancelByContactOpportunityQuoteSalesOrder(@PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id,InvoiceSearchContext context) {
context.setN_salesorderid_eq(salesorder_id);
Page<Invoice> domains = invoiceService.searchCancel(context) ;
List<InvoiceDTO> list = invoiceMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Invoice-searchCancel-all') and hasPermission(#context,'iBizBusinessCentral-Invoice-Get')")
@ApiOperation(value = "根据联系人商机报价单订单查询已取消", tags = {"发票" } ,notes = "根据联系人商机报价单订单查询已取消")
@RequestMapping(method= RequestMethod.POST , value="/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/invoices/searchcancel")
public ResponseEntity<Page<InvoiceDTO>> searchInvoiceCancelByContactOpportunityQuoteSalesOrder(@PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody InvoiceSearchContext context) {
context.setN_salesorderid_eq(salesorder_id);
Page<Invoice> domains = invoiceService.searchCancel(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(invoiceMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Invoice-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-Invoice-Get')")
@ApiOperation(value = "根据联系人商机报价单订单获取DEFAULT", tags = {"发票" } ,notes = "根据联系人商机报价单订单获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/invoices/fetchdefault")
......@@ -1177,6 +1426,29 @@ public class InvoiceResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(invoiceMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Invoice-searchPaid-all') and hasPermission(#context,'iBizBusinessCentral-Invoice-Get')")
@ApiOperation(value = "根据联系人商机报价单订单获取已支付", tags = {"发票" } ,notes = "根据联系人商机报价单订单获取已支付")
@RequestMapping(method= RequestMethod.GET , value="/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/invoices/fetchpaid")
public ResponseEntity<List<InvoiceDTO>> fetchInvoicePaidByContactOpportunityQuoteSalesOrder(@PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id,InvoiceSearchContext context) {
context.setN_salesorderid_eq(salesorder_id);
Page<Invoice> domains = invoiceService.searchPaid(context) ;
List<InvoiceDTO> list = invoiceMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Invoice-searchPaid-all') and hasPermission(#context,'iBizBusinessCentral-Invoice-Get')")
@ApiOperation(value = "根据联系人商机报价单订单查询已支付", tags = {"发票" } ,notes = "根据联系人商机报价单订单查询已支付")
@RequestMapping(method= RequestMethod.POST , value="/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/invoices/searchpaid")
public ResponseEntity<Page<InvoiceDTO>> searchInvoicePaidByContactOpportunityQuoteSalesOrder(@PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody InvoiceSearchContext context) {
context.setN_salesorderid_eq(salesorder_id);
Page<Invoice> domains = invoiceService.searchPaid(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(invoiceMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.invoiceMapping.toDomain(#invoicedto),'iBizBusinessCentral-Invoice-Create')")
@ApiOperation(value = "根据客户联系人商机报价单订单建立发票", tags = {"发票" }, notes = "根据客户联系人商机报价单订单建立发票")
@RequestMapping(method = RequestMethod.POST, value = "/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/invoices")
......@@ -1346,6 +1618,29 @@ public class InvoiceResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(invoiceMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Invoice-searchCancel-all') and hasPermission(#context,'iBizBusinessCentral-Invoice-Get')")
@ApiOperation(value = "根据客户联系人商机报价单订单获取已取消", tags = {"发票" } ,notes = "根据客户联系人商机报价单订单获取已取消")
@RequestMapping(method= RequestMethod.GET , value="/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/invoices/fetchcancel")
public ResponseEntity<List<InvoiceDTO>> fetchInvoiceCancelByAccountContactOpportunityQuoteSalesOrder(@PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id,InvoiceSearchContext context) {
context.setN_salesorderid_eq(salesorder_id);
Page<Invoice> domains = invoiceService.searchCancel(context) ;
List<InvoiceDTO> list = invoiceMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Invoice-searchCancel-all') and hasPermission(#context,'iBizBusinessCentral-Invoice-Get')")
@ApiOperation(value = "根据客户联系人商机报价单订单查询已取消", tags = {"发票" } ,notes = "根据客户联系人商机报价单订单查询已取消")
@RequestMapping(method= RequestMethod.POST , value="/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/invoices/searchcancel")
public ResponseEntity<Page<InvoiceDTO>> searchInvoiceCancelByAccountContactOpportunityQuoteSalesOrder(@PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody InvoiceSearchContext context) {
context.setN_salesorderid_eq(salesorder_id);
Page<Invoice> domains = invoiceService.searchCancel(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(invoiceMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Invoice-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-Invoice-Get')")
@ApiOperation(value = "根据客户联系人商机报价单订单获取DEFAULT", tags = {"发票" } ,notes = "根据客户联系人商机报价单订单获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/invoices/fetchdefault")
......@@ -1369,5 +1664,28 @@ public class InvoiceResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(invoiceMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Invoice-searchPaid-all') and hasPermission(#context,'iBizBusinessCentral-Invoice-Get')")
@ApiOperation(value = "根据客户联系人商机报价单订单获取已支付", tags = {"发票" } ,notes = "根据客户联系人商机报价单订单获取已支付")
@RequestMapping(method= RequestMethod.GET , value="/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/invoices/fetchpaid")
public ResponseEntity<List<InvoiceDTO>> fetchInvoicePaidByAccountContactOpportunityQuoteSalesOrder(@PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id,InvoiceSearchContext context) {
context.setN_salesorderid_eq(salesorder_id);
Page<Invoice> domains = invoiceService.searchPaid(context) ;
List<InvoiceDTO> list = invoiceMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Invoice-searchPaid-all') and hasPermission(#context,'iBizBusinessCentral-Invoice-Get')")
@ApiOperation(value = "根据客户联系人商机报价单订单查询已支付", tags = {"发票" } ,notes = "根据客户联系人商机报价单订单查询已支付")
@RequestMapping(method= RequestMethod.POST , value="/accounts/{account_id}/contacts/{contact_id}/opportunities/{opportunity_id}/quotes/{quote_id}/salesorders/{salesorder_id}/invoices/searchpaid")
public ResponseEntity<Page<InvoiceDTO>> searchInvoicePaidByAccountContactOpportunityQuoteSalesOrder(@PathVariable("account_id") String account_id, @PathVariable("contact_id") String contact_id, @PathVariable("opportunity_id") String opportunity_id, @PathVariable("quote_id") String quote_id, @PathVariable("salesorder_id") String salesorder_id, @RequestBody InvoiceSearchContext context) {
context.setN_salesorderid_eq(salesorder_id);
Page<Invoice> domains = invoiceService.searchPaid(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(invoiceMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册