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

chitanda 发布系统代码

上级 daed74ac
......@@ -65,36 +65,6 @@ export default class AccountServiceBase extends EntityService {
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData: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.relationshipsid = 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) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.contactid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.contacts = contactsData;
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
......@@ -125,33 +95,6 @@ export default class AccountServiceBase 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`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof AccountServiceBase
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData: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);
......@@ -182,6 +125,33 @@ export default class AccountServiceBase extends EntityService {
}
}
masterData.contacts = contactsData;
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`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts));
return res;
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof AccountServiceBase
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
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);
......@@ -212,12 +182,42 @@ export default class AccountServiceBase extends EntityService {
}
}
masterData.leads = leadsData;
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.relationshipsid = 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) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.contactid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.contacts = contactsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(context.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(context.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts));
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+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(context.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(context.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts));
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+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(context.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(context.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts));
return res;
}
......@@ -338,72 +338,72 @@ export default class AccountServiceBase extends EntityService {
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData: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) => {
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){
opportunitiesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.opportunityid = 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.opportunities = opportunitiesData;
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;
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){
opportunitiesData.forEach((item:any) => {
masterData.leads = leadsData;
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.opportunityid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunities = opportunitiesData;
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) => {
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) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
item.contactid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
masterData.contacts = contactsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(context.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(context.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts));
return res;
}
......
......@@ -79,11 +79,11 @@ export default class CampaignServiceBase extends EntityService {
}
}
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);
if(campaignlistsData && campaignlistsData.length && campaignlistsData.length > 0){
campaignlistsData.forEach((item:any) => {
let campaigncampaignsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns'),'undefined')){
campaigncampaignsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns') as any);
if(campaigncampaignsData && campaigncampaignsData.length && campaigncampaignsData.length > 0){
campaigncampaignsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -93,12 +93,12 @@ export default class CampaignServiceBase extends EntityService {
});
}
}
masterData.campaignlists = campaignlistsData;
let campaigncampaignsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns'),'undefined')){
campaigncampaignsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns') as any);
if(campaigncampaignsData && campaigncampaignsData.length && campaigncampaignsData.length > 0){
campaigncampaignsData.forEach((item:any) => {
masterData.campaigncampaigns = campaigncampaignsData;
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;
......@@ -108,7 +108,7 @@ export default class CampaignServiceBase extends EntityService {
});
}
}
masterData.campaigncampaigns = campaigncampaignsData;
masterData.campaignlists = campaignlistsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -119,8 +119,8 @@ 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+'_campaignlists',JSON.stringify(res.data.campaignlists));
return res;
}
......@@ -150,11 +150,11 @@ export default class CampaignServiceBase extends EntityService {
}
}
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);
if(campaignlistsData && campaignlistsData.length && campaignlistsData.length > 0){
campaignlistsData.forEach((item:any) => {
let campaigncampaignsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns'),'undefined')){
campaigncampaignsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns') as any);
if(campaigncampaignsData && campaigncampaignsData.length && campaigncampaignsData.length > 0){
campaigncampaignsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -164,12 +164,12 @@ export default class CampaignServiceBase extends EntityService {
});
}
}
masterData.campaignlists = campaignlistsData;
let campaigncampaignsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns'),'undefined')){
campaigncampaignsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns') as any);
if(campaigncampaignsData && campaigncampaignsData.length && campaigncampaignsData.length > 0){
campaigncampaignsData.forEach((item:any) => {
masterData.campaigncampaigns = campaigncampaignsData;
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;
......@@ -179,12 +179,12 @@ export default class CampaignServiceBase extends EntityService {
});
}
}
masterData.campaigncampaigns = campaigncampaignsData;
masterData.campaignlists = campaignlistsData;
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+'_campaignlists',JSON.stringify(res.data.campaignlists));
return res;
}
......@@ -213,8 +213,8 @@ 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+'_campaignlists',JSON.stringify(res.data.campaignlists));
return res;
}
......@@ -231,8 +231,8 @@ export default class CampaignServiceBase extends EntityService {
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+'_campaignlists',JSON.stringify(res.data.campaignlists));
return res;
}
......@@ -290,11 +290,11 @@ export default class CampaignServiceBase extends EntityService {
}
}
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);
if(campaignlistsData && campaignlistsData.length && campaignlistsData.length > 0){
campaignlistsData.forEach((item:any) => {
let campaigncampaignsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns'),'undefined')){
campaigncampaignsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns') as any);
if(campaigncampaignsData && campaigncampaignsData.length && campaigncampaignsData.length > 0){
campaigncampaignsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -304,12 +304,12 @@ export default class CampaignServiceBase extends EntityService {
});
}
}
masterData.campaignlists = campaignlistsData;
let campaigncampaignsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns'),'undefined')){
campaigncampaignsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns') as any);
if(campaigncampaignsData && campaigncampaignsData.length && campaigncampaignsData.length > 0){
campaigncampaignsData.forEach((item:any) => {
masterData.campaigncampaigns = campaigncampaignsData;
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;
......@@ -319,12 +319,12 @@ export default class CampaignServiceBase extends EntityService {
});
}
}
masterData.campaigncampaigns = campaigncampaignsData;
masterData.campaignlists = campaignlistsData;
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+'_campaignlists',JSON.stringify(res.data.campaignlists));
return res;
}
......
......@@ -62,6 +62,21 @@ 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) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
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);
......@@ -92,21 +107,6 @@ export default class CompetitorServiceBase extends EntityService {
}
}
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;
}
delete item.srffrontuf;
}
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -116,9 +116,9 @@ 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+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(tempContext.srfsessionkey+'_competitorproducts',JSON.stringify(res.data.competitorproducts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
......@@ -133,6 +133,21 @@ 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) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
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);
......@@ -163,26 +178,11 @@ export default class CompetitorServiceBase extends EntityService {
}
}
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;
}
delete item.srffrontuf;
}
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
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+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_competitorproducts',JSON.stringify(res.data.competitorproducts));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
......@@ -210,9 +210,9 @@ 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+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_competitorproducts',JSON.stringify(res.data.competitorproducts));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
......@@ -228,9 +228,9 @@ 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+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_competitorproducts',JSON.stringify(res.data.competitorproducts));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
......@@ -258,6 +258,21 @@ 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) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
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);
......@@ -288,26 +303,11 @@ export default class CompetitorServiceBase extends EntityService {
}
}
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;
}
delete item.srffrontuf;
}
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
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+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_competitorproducts',JSON.stringify(res.data.competitorproducts));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
......
......@@ -64,11 +64,11 @@ 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) => {
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.relationshipsid = null;
......@@ -78,12 +78,12 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.campaignlists = campaignlistsData;
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
masterData.listaccounts = listaccountsData;
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;
......@@ -93,12 +93,12 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.listcontacts = listcontactsData;
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) => {
masterData.campaignlists = campaignlistsData;
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -108,12 +108,12 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.listaccounts = listaccountsData;
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
masterData.listleads = listleadsData;
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -123,7 +123,7 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.listleads = listleadsData;
masterData.listcontacts = listcontactsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -133,10 +133,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+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
return res;
}
......@@ -151,11 +151,11 @@ 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) => {
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.relationshipsid = null;
......@@ -165,12 +165,12 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.campaignlists = campaignlistsData;
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
masterData.listaccounts = listaccountsData;
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;
......@@ -180,12 +180,12 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.listcontacts = listcontactsData;
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) => {
masterData.campaignlists = campaignlistsData;
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -195,12 +195,12 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.listaccounts = listaccountsData;
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
masterData.listleads = listleadsData;
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -210,13 +210,13 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.listleads = listleadsData;
masterData.listcontacts = listcontactsData;
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+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
return res;
}
......@@ -244,10 +244,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+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
return res;
}
......@@ -263,10 +263,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+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
return res;
}
......@@ -309,11 +309,11 @@ 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) => {
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.relationshipsid = null;
......@@ -323,12 +323,12 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.campaignlists = campaignlistsData;
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
masterData.listaccounts = listaccountsData;
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;
......@@ -338,12 +338,12 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.listcontacts = listcontactsData;
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) => {
masterData.campaignlists = campaignlistsData;
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -353,12 +353,12 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.listaccounts = listaccountsData;
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
masterData.listleads = listleadsData;
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -368,13 +368,13 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.listleads = listleadsData;
masterData.listcontacts = listcontactsData;
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+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
return res;
}
......
......@@ -79,11 +79,11 @@ export default class LeadServiceBase extends EntityService {
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && true){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item: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) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -93,12 +93,12 @@ export default class LeadServiceBase extends EntityService {
});
}
}
masterData.listleads = listleadsData;
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) => {
masterData.leadcompetitors = leadcompetitorsData;
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -108,7 +108,7 @@ export default class LeadServiceBase extends EntityService {
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
masterData.listleads = listleadsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -118,17 +118,17 @@ export default class LeadServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/leads`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
if(context.contact && true){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item: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) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -138,12 +138,12 @@ export default class LeadServiceBase extends EntityService {
});
}
}
masterData.listleads = listleadsData;
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) => {
masterData.leadcompetitors = leadcompetitorsData;
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -153,7 +153,7 @@ export default class LeadServiceBase extends EntityService {
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
masterData.listleads = listleadsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -163,17 +163,17 @@ export default class LeadServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/leads`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
if(context.campaign && true){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item: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) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -183,12 +183,12 @@ export default class LeadServiceBase extends EntityService {
});
}
}
masterData.listleads = listleadsData;
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) => {
masterData.leadcompetitors = leadcompetitorsData;
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -198,7 +198,7 @@ export default class LeadServiceBase extends EntityService {
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
masterData.listleads = listleadsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -208,17 +208,17 @@ export default class LeadServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/campaigns/${context.campaign}/leads`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
if(context.account && true){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item: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) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -228,12 +228,12 @@ export default class LeadServiceBase extends EntityService {
});
}
}
masterData.listleads = listleadsData;
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) => {
masterData.leadcompetitors = leadcompetitorsData;
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -243,7 +243,7 @@ export default class LeadServiceBase extends EntityService {
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
masterData.listleads = listleadsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -253,16 +253,16 @@ export default class LeadServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/accounts/${context.account}/leads`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item: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) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -272,12 +272,12 @@ export default class LeadServiceBase extends EntityService {
});
}
}
masterData.listleads = listleadsData;
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) => {
masterData.leadcompetitors = leadcompetitorsData;
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -287,7 +287,7 @@ export default class LeadServiceBase extends EntityService {
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
masterData.listleads = listleadsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -297,8 +297,8 @@ export default class LeadServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/leads`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
......@@ -314,21 +314,6 @@ export default class LeadServiceBase extends EntityService {
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listleads = listleadsData;
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
......@@ -344,14 +329,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/contacts/${context.contact}/leads/${context.lead}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
if(context.contact && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -367,6 +344,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/contacts/${context.contact}/leads/${context.lead}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
if(context.contact && context.lead){
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);
......@@ -382,14 +367,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/contacts/${context.contact}/leads/${context.lead}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
if(context.campaign && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -405,6 +382,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/contacts/${context.contact}/leads/${context.lead}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
if(context.campaign && context.lead){
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);
......@@ -420,14 +405,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/campaigns/${context.campaign}/leads/${context.lead}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
if(context.account && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -443,6 +420,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/campaigns/${context.campaign}/leads/${context.lead}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
if(context.account && context.lead){
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);
......@@ -458,13 +443,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/leads/${context.lead}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -480,6 +458,13 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/leads/${context.lead}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
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);
......@@ -495,10 +480,25 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/leads/${context.lead}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
......@@ -539,31 +539,31 @@ export default class LeadServiceBase extends EntityService {
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.lead){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}/leads/${context.lead}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
if(context.contact && context.lead){
let res:any = await Http.getInstance().get(`/contacts/${context.contact}/leads/${context.lead}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
if(context.campaign && context.lead){
let res:any = await Http.getInstance().get(`/campaigns/${context.campaign}/leads/${context.lead}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
if(context.account && context.lead){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/leads/${context.lead}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
let res:any = await Http.getInstance().get(`/leads/${context.lead}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
......@@ -580,35 +580,35 @@ export default class LeadServiceBase extends EntityService {
if(context.account && context.contact && true){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}/leads/getdraft`,isloading);
res.data.lead = data.lead;
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
if(context.contact && true){
let res:any = await Http.getInstance().get(`/contacts/${context.contact}/leads/getdraft`,isloading);
res.data.lead = data.lead;
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
if(context.campaign && true){
let res:any = await Http.getInstance().get(`/campaigns/${context.campaign}/leads/getdraft`,isloading);
res.data.lead = data.lead;
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
if(context.account && true){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/leads/getdraft`,isloading);
res.data.lead = data.lead;
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
let res:any = await Http.getInstance().get(`/leads/getdraft`,isloading);
res.data.lead = data.lead;
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
......@@ -624,21 +624,6 @@ export default class LeadServiceBase extends EntityService {
public async Active(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listleads = listleadsData;
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
......@@ -654,14 +639,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/leads/${context.lead}/active`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
if(context.contact && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -677,6 +654,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/leads/${context.lead}/active`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
if(context.contact && context.lead){
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);
......@@ -692,14 +677,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/leads/${context.lead}/active`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
if(context.campaign && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -715,6 +692,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/leads/${context.lead}/active`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
if(context.campaign && context.lead){
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);
......@@ -730,14 +715,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/campaigns/${context.campaign}/leads/${context.lead}/active`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
if(context.account && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -753,6 +730,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/campaigns/${context.campaign}/leads/${context.lead}/active`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
if(context.account && context.lead){
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);
......@@ -768,10 +753,25 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/leads/${context.lead}/active`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
return Http.getInstance().post(`/leads/${context.lead}/active`,data,isloading);
......@@ -789,21 +789,6 @@ export default class LeadServiceBase extends EntityService {
public async AddList(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listleads = listleadsData;
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
......@@ -819,14 +804,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/leads/${context.lead}/addlist`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
if(context.contact && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -842,6 +819,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/leads/${context.lead}/addlist`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
if(context.contact && context.lead){
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);
......@@ -857,14 +842,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/leads/${context.lead}/addlist`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
if(context.campaign && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -880,6 +857,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/leads/${context.lead}/addlist`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
if(context.campaign && context.lead){
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);
......@@ -895,14 +880,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/campaigns/${context.campaign}/leads/${context.lead}/addlist`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
if(context.account && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -918,6 +895,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/campaigns/${context.campaign}/leads/${context.lead}/addlist`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
if(context.account && context.lead){
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);
......@@ -933,10 +918,25 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/leads/${context.lead}/addlist`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
return Http.getInstance().post(`/leads/${context.lead}/addlist`,data,isloading);
......@@ -969,21 +969,6 @@ export default class LeadServiceBase extends EntityService {
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listleads = listleadsData;
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
......@@ -999,14 +984,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/leads/${context.lead}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
if(context.contact && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -1022,6 +999,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/leads/${context.lead}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
if(context.contact && context.lead){
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);
......@@ -1037,14 +1022,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/leads/${context.lead}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
if(context.campaign && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -1060,6 +1037,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/leads/${context.lead}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
if(context.campaign && context.lead){
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);
......@@ -1075,14 +1060,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/campaigns/${context.campaign}/leads/${context.lead}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
if(context.account && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -1098,6 +1075,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/campaigns/${context.campaign}/leads/${context.lead}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
if(context.account && context.lead){
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);
......@@ -1113,10 +1098,25 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/leads/${context.lead}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
return Http.getInstance().post(`/leads/${context.lead}/checkkey`,data,isloading);
......@@ -1134,21 +1134,6 @@ export default class LeadServiceBase extends EntityService {
public async DisQualification(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listleads = listleadsData;
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
......@@ -1164,14 +1149,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/leads/${context.lead}/disqualification`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
if(context.contact && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -1187,6 +1164,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/leads/${context.lead}/disqualification`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
if(context.contact && context.lead){
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);
......@@ -1202,14 +1187,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/leads/${context.lead}/disqualification`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
if(context.campaign && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -1225,6 +1202,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/leads/${context.lead}/disqualification`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
if(context.campaign && context.lead){
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);
......@@ -1240,14 +1225,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/campaigns/${context.campaign}/leads/${context.lead}/disqualification`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
if(context.account && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -1263,6 +1240,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/campaigns/${context.campaign}/leads/${context.lead}/disqualification`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
if(context.account && context.lead){
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);
......@@ -1278,10 +1263,25 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/leads/${context.lead}/disqualification`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
return Http.getInstance().post(`/leads/${context.lead}/disqualification`,data,isloading);
......@@ -1329,21 +1329,6 @@ export default class LeadServiceBase extends EntityService {
public async Qualification(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listleads = listleadsData;
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
......@@ -1359,14 +1344,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/leads/${context.lead}/qualification`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
if(context.contact && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -1382,6 +1359,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/leads/${context.lead}/qualification`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
if(context.contact && context.lead){
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);
......@@ -1397,14 +1382,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/leads/${context.lead}/qualification`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
if(context.campaign && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -1420,6 +1397,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/leads/${context.lead}/qualification`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
if(context.campaign && context.lead){
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);
......@@ -1435,14 +1420,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/campaigns/${context.campaign}/leads/${context.lead}/qualification`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
if(context.account && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -1458,6 +1435,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/campaigns/${context.campaign}/leads/${context.lead}/qualification`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
if(context.account && context.lead){
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);
......@@ -1473,10 +1458,25 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/leads/${context.lead}/qualification`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
return Http.getInstance().post(`/leads/${context.lead}/qualification`,data,isloading);
......@@ -1494,21 +1494,6 @@ export default class LeadServiceBase extends EntityService {
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listleads = listleadsData;
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
......@@ -1524,14 +1509,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/leads/${context.lead}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
if(context.contact && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -1547,6 +1524,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/leads/${context.lead}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
if(context.contact && context.lead){
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);
......@@ -1562,14 +1547,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/leads/${context.lead}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
if(context.campaign && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -1585,6 +1562,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/leads/${context.lead}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
if(context.campaign && context.lead){
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);
......@@ -1600,14 +1585,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/campaigns/${context.campaign}/leads/${context.lead}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
if(context.account && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -1623,6 +1600,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/campaigns/${context.campaign}/leads/${context.lead}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
if(context.account && context.lead){
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);
......@@ -1638,13 +1623,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/leads/${context.lead}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -1660,6 +1638,13 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/leads/${context.lead}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
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);
......@@ -1675,10 +1660,25 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/leads/${context.lead}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
......
......@@ -74,36 +74,36 @@ 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 opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunityproductsData.forEach((item:any) => {
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.opportunityproductid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunityproducts = opportunityproductsData;
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
masterData.quotes = quotesData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunityproductsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.opportunityproductid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
masterData.opportunityproducts = opportunityproductsData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
......@@ -128,43 +128,43 @@ export default class OpportunityServiceBase extends EntityService {
}
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+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
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);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunityproductsData.forEach((item:any) => {
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.opportunityproductid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunityproducts = opportunityproductsData;
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
masterData.quotes = quotesData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunityproductsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.opportunityproductid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
masterData.opportunityproducts = opportunityproductsData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
......@@ -189,43 +189,43 @@ export default class OpportunityServiceBase extends EntityService {
}
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+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
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);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunityproductsData.forEach((item:any) => {
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.opportunityproductid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunityproducts = opportunityproductsData;
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
masterData.quotes = quotesData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunityproductsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.opportunityproductid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
masterData.opportunityproducts = opportunityproductsData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
......@@ -250,42 +250,42 @@ export default class OpportunityServiceBase extends EntityService {
}
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+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
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);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunityproductsData.forEach((item:any) => {
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.opportunityproductid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunityproducts = opportunityproductsData;
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
masterData.quotes = quotesData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunityproductsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.opportunityproductid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
masterData.opportunityproducts = opportunityproductsData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
......@@ -310,8 +310,8 @@ 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+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
......@@ -328,36 +328,36 @@ 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 opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunityproductsData.forEach((item:any) => {
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.opportunityproductid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunityproducts = opportunityproductsData;
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
masterData.quotes = quotesData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunityproductsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.opportunityproductid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
masterData.opportunityproducts = opportunityproductsData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
......@@ -375,43 +375,43 @@ 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+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
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);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunityproductsData.forEach((item:any) => {
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.opportunityproductid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunityproducts = opportunityproductsData;
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
masterData.quotes = quotesData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunityproductsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.opportunityproductid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
masterData.opportunityproducts = opportunityproductsData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
......@@ -429,43 +429,43 @@ 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+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
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);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunityproductsData.forEach((item:any) => {
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.opportunityproductid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunityproducts = opportunityproductsData;
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
masterData.quotes = quotesData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunityproductsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.opportunityproductid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
masterData.opportunityproducts = opportunityproductsData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
......@@ -483,42 +483,42 @@ 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+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
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);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunityproductsData.forEach((item:any) => {
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.opportunityproductid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunityproducts = opportunityproductsData;
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
masterData.quotes = quotesData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunityproductsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.opportunityproductid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
masterData.opportunityproducts = opportunityproductsData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
......@@ -536,8 +536,8 @@ export default class OpportunityServiceBase extends EntityService {
masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/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+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
......@@ -576,28 +576,28 @@ 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+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
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+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
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+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
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+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
......@@ -615,31 +615,31 @@ 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+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
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+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
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+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
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+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
......@@ -656,36 +656,36 @@ 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 opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunityproductsData.forEach((item:any) => {
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.opportunityproductid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunityproducts = opportunityproductsData;
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
masterData.quotes = quotesData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunityproductsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.opportunityproductid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
masterData.opportunityproducts = opportunityproductsData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
......@@ -703,43 +703,43 @@ 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+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
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);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunityproductsData.forEach((item:any) => {
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.opportunityproductid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunityproducts = opportunityproductsData;
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
masterData.quotes = quotesData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunityproductsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.opportunityproductid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
masterData.opportunityproducts = opportunityproductsData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
......@@ -757,43 +757,43 @@ 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+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
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);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunityproductsData.forEach((item:any) => {
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.opportunityproductid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunityproducts = opportunityproductsData;
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
masterData.quotes = quotesData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunityproductsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.opportunityproductid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
masterData.opportunityproducts = opportunityproductsData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
......@@ -811,8 +811,8 @@ 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}/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+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
......@@ -831,36 +831,36 @@ 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 opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunityproductsData.forEach((item:any) => {
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.opportunityproductid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunityproducts = opportunityproductsData;
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
masterData.quotes = quotesData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunityproductsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.opportunityproductid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
masterData.opportunityproducts = opportunityproductsData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
......@@ -878,43 +878,43 @@ 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+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
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);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunityproductsData.forEach((item:any) => {
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.opportunityproductid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunityproducts = opportunityproductsData;
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
masterData.quotes = quotesData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunityproductsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.opportunityproductid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
masterData.opportunityproducts = opportunityproductsData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
......@@ -932,43 +932,43 @@ 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+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
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);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunityproductsData.forEach((item:any) => {
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.opportunityproductid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunityproducts = opportunityproductsData;
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
masterData.quotes = quotesData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunityproductsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.opportunityproductid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
masterData.opportunityproducts = opportunityproductsData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
......@@ -986,8 +986,8 @@ 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}/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+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
......@@ -1021,36 +1021,36 @@ 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 opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunityproductsData.forEach((item:any) => {
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.opportunityproductid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunityproducts = opportunityproductsData;
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
masterData.quotes = quotesData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunityproductsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.opportunityproductid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
masterData.opportunityproducts = opportunityproductsData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
......@@ -1068,43 +1068,43 @@ 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+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
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);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunityproductsData.forEach((item:any) => {
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.opportunityproductid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunityproducts = opportunityproductsData;
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
masterData.quotes = quotesData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunityproductsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.opportunityproductid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
masterData.opportunityproducts = opportunityproductsData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
......@@ -1122,43 +1122,43 @@ 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+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
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);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunityproductsData.forEach((item:any) => {
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.opportunityproductid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunityproducts = opportunityproductsData;
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
masterData.quotes = quotesData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunityproductsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.opportunityproductid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
masterData.opportunityproducts = opportunityproductsData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
......@@ -1176,42 +1176,42 @@ 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+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
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);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunityproductsData.forEach((item:any) => {
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.opportunityproductid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunityproducts = opportunityproductsData;
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
masterData.quotes = quotesData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunityproductsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.opportunityproductid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
masterData.opportunityproducts = opportunityproductsData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
......@@ -1229,8 +1229,8 @@ export default class OpportunityServiceBase extends EntityService {
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+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
......
......@@ -65,21 +65,21 @@ export default class ProductServiceBase extends EntityService {
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let productpricelevelsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productpricelevels'),'undefined')){
productpricelevelsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productpricelevels') as any);
if(productpricelevelsData && productpricelevelsData.length && productpricelevelsData.length > 0){
productpricelevelsData.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.productpricelevelid = null;
item.productassociationid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.productpricelevels = productpricelevelsData;
masterData.productassociations = productassociationsData;
let productsubstitutesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes'),'undefined')){
productsubstitutesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes') as any);
......@@ -95,21 +95,21 @@ export default class ProductServiceBase extends EntityService {
}
}
masterData.productsubstitutes = productsubstitutesData;
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 productpricelevelsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productpricelevels'),'undefined')){
productpricelevelsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productpricelevels') as any);
if(productpricelevelsData && productpricelevelsData.length && productpricelevelsData.length > 0){
productpricelevelsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.productassociationid = null;
item.productpricelevelid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.productassociations = productassociationsData;
masterData.productpricelevels = productpricelevelsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -119,9 +119,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+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
this.tempStorage.setItem(tempContext.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes));
this.tempStorage.setItem(tempContext.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations));
this.tempStorage.setItem(tempContext.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes));
this.tempStorage.setItem(tempContext.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
return res;
}
......@@ -136,21 +136,21 @@ export default class ProductServiceBase extends EntityService {
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let productpricelevelsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productpricelevels'),'undefined')){
productpricelevelsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productpricelevels') as any);
if(productpricelevelsData && productpricelevelsData.length && productpricelevelsData.length > 0){
productpricelevelsData.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.productpricelevelid = null;
item.productassociationid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.productpricelevels = productpricelevelsData;
masterData.productassociations = productassociationsData;
let productsubstitutesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes'),'undefined')){
productsubstitutesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes') as any);
......@@ -166,26 +166,26 @@ export default class ProductServiceBase extends EntityService {
}
}
masterData.productsubstitutes = productsubstitutesData;
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 productpricelevelsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productpricelevels'),'undefined')){
productpricelevelsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productpricelevels') as any);
if(productpricelevelsData && productpricelevelsData.length && productpricelevelsData.length > 0){
productpricelevelsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.productassociationid = null;
item.productpricelevelid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.productassociations = productassociationsData;
masterData.productpricelevels = productpricelevelsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/products/${context.product}`,data,isloading);
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+'_productassociations',JSON.stringify(res.data.productassociations));
this.tempStorage.setItem(context.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes));
this.tempStorage.setItem(context.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
return res;
}
......@@ -213,9 +213,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+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
this.tempStorage.setItem(context.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes));
this.tempStorage.setItem(context.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations));
this.tempStorage.setItem(context.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes));
this.tempStorage.setItem(context.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
return res;
}
......@@ -231,9 +231,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+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
this.tempStorage.setItem(context.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes));
this.tempStorage.setItem(context.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations));
this.tempStorage.setItem(context.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes));
this.tempStorage.setItem(context.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
return res;
}
......@@ -291,21 +291,21 @@ export default class ProductServiceBase extends EntityService {
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let productpricelevelsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productpricelevels'),'undefined')){
productpricelevelsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productpricelevels') as any);
if(productpricelevelsData && productpricelevelsData.length && productpricelevelsData.length > 0){
productpricelevelsData.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.productpricelevelid = null;
item.productassociationid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.productpricelevels = productpricelevelsData;
masterData.productassociations = productassociationsData;
let productsubstitutesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes'),'undefined')){
productsubstitutesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes') as any);
......@@ -321,26 +321,26 @@ export default class ProductServiceBase extends EntityService {
}
}
masterData.productsubstitutes = productsubstitutesData;
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 productpricelevelsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productpricelevels'),'undefined')){
productpricelevelsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productpricelevels') as any);
if(productpricelevelsData && productpricelevelsData.length && productpricelevelsData.length > 0){
productpricelevelsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.productassociationid = null;
item.productpricelevelid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.productassociations = productassociationsData;
masterData.productpricelevels = productpricelevelsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/products/${context.product}/save`,data,isloading);
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+'_productassociations',JSON.stringify(res.data.productassociations));
this.tempStorage.setItem(context.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes));
this.tempStorage.setItem(context.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
return res;
}
......
......@@ -62,21 +62,6 @@ export default class SalesLiteratureServiceBase extends EntityService {
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let competitorsalesliteraturesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_competitorsalesliteratures'),'undefined')){
competitorsalesliteraturesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_competitorsalesliteratures') as any);
if(competitorsalesliteraturesData && competitorsalesliteraturesData.length && competitorsalesliteraturesData.length > 0){
competitorsalesliteraturesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.competitorsalesliteratures = competitorsalesliteraturesData;
let salesliteratureitemsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesliteratureitems'),'undefined')){
salesliteratureitemsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesliteratureitems') as any);
......@@ -107,6 +92,21 @@ export default class SalesLiteratureServiceBase extends EntityService {
}
}
masterData.productsalesliteratures = productsalesliteraturesData;
let competitorsalesliteraturesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_competitorsalesliteratures'),'undefined')){
competitorsalesliteraturesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_competitorsalesliteratures') as any);
if(competitorsalesliteraturesData && competitorsalesliteraturesData.length && competitorsalesliteraturesData.length > 0){
competitorsalesliteraturesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.competitorsalesliteratures = competitorsalesliteraturesData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -116,9 +116,9 @@ export default class SalesLiteratureServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/salesliteratures`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures));
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems));
this.tempStorage.setItem(tempContext.srfsessionkey+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
this.tempStorage.setItem(tempContext.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures));
return res;
}
......@@ -133,21 +133,6 @@ export default class SalesLiteratureServiceBase extends EntityService {
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let competitorsalesliteraturesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_competitorsalesliteratures'),'undefined')){
competitorsalesliteraturesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_competitorsalesliteratures') as any);
if(competitorsalesliteraturesData && competitorsalesliteraturesData.length && competitorsalesliteraturesData.length > 0){
competitorsalesliteraturesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.competitorsalesliteratures = competitorsalesliteraturesData;
let salesliteratureitemsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesliteratureitems'),'undefined')){
salesliteratureitemsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesliteratureitems') as any);
......@@ -178,11 +163,26 @@ export default class SalesLiteratureServiceBase extends EntityService {
}
}
masterData.productsalesliteratures = productsalesliteraturesData;
let competitorsalesliteraturesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_competitorsalesliteratures'),'undefined')){
competitorsalesliteraturesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_competitorsalesliteratures') as any);
if(competitorsalesliteraturesData && competitorsalesliteraturesData.length && competitorsalesliteraturesData.length > 0){
competitorsalesliteraturesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.competitorsalesliteratures = competitorsalesliteraturesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/salesliteratures/${context.salesliterature}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems));
this.tempStorage.setItem(context.srfsessionkey+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures));
return res;
}
......@@ -210,9 +210,9 @@ export default class SalesLiteratureServiceBase extends EntityService {
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/salesliteratures/${context.salesliterature}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems));
this.tempStorage.setItem(context.srfsessionkey+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures));
return res;
}
......@@ -228,9 +228,9 @@ export default class SalesLiteratureServiceBase extends EntityService {
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/salesliteratures/getdraft`,isloading);
res.data.salesliterature = data.salesliterature;
this.tempStorage.setItem(context.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems));
this.tempStorage.setItem(context.srfsessionkey+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures));
return res;
}
......@@ -258,21 +258,6 @@ export default class SalesLiteratureServiceBase extends EntityService {
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let competitorsalesliteraturesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_competitorsalesliteratures'),'undefined')){
competitorsalesliteraturesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_competitorsalesliteratures') as any);
if(competitorsalesliteraturesData && competitorsalesliteraturesData.length && competitorsalesliteraturesData.length > 0){
competitorsalesliteraturesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.competitorsalesliteratures = competitorsalesliteraturesData;
let salesliteratureitemsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesliteratureitems'),'undefined')){
salesliteratureitemsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesliteratureitems') as any);
......@@ -303,11 +288,26 @@ export default class SalesLiteratureServiceBase extends EntityService {
}
}
masterData.productsalesliteratures = productsalesliteraturesData;
let competitorsalesliteraturesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_competitorsalesliteratures'),'undefined')){
competitorsalesliteraturesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_competitorsalesliteratures') as any);
if(competitorsalesliteraturesData && competitorsalesliteraturesData.length && competitorsalesliteraturesData.length > 0){
competitorsalesliteraturesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.competitorsalesliteratures = competitorsalesliteraturesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/salesliteratures/${context.salesliterature}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems));
this.tempStorage.setItem(context.srfsessionkey+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures));
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 invoicesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
if(invoicesData && invoicesData.length && invoicesData.length > 0){
invoicesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.invoiceid = null;
}
delete item.srffrontuf;
}
});
}
}
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);
......@@ -110,21 +95,6 @@ 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);
......@@ -140,6 +110,21 @@ 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);
......@@ -155,21 +140,6 @@ 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);
......@@ -185,6 +155,21 @@ 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);
......@@ -200,21 +185,6 @@ 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);
......@@ -230,6 +200,21 @@ 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);
......@@ -245,21 +230,6 @@ 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);
......@@ -275,6 +245,21 @@ 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);
......@@ -290,20 +275,6 @@ 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);
......@@ -319,6 +290,20 @@ 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);
......@@ -334,6 +319,21 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
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);
if(invoicesData && invoicesData.length && invoicesData.length > 0){
invoicesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.invoiceid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.invoices = invoicesData;
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+'_invoices',JSON.stringify(res.data.invoices));
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
this.tempStorage.setItem(tempContext.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
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 invoicesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
if(invoicesData && invoicesData.length && invoicesData.length > 0){
invoicesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.invoiceid = null;
}
delete item.srffrontuf;
}
});
}
}
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);
......@@ -390,14 +375,6 @@ 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);
......@@ -413,6 +390,14 @@ 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);
......@@ -428,14 +413,6 @@ 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);
......@@ -451,6 +428,14 @@ 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);
......@@ -466,14 +451,6 @@ 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);
......@@ -489,6 +466,14 @@ 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);
......@@ -504,14 +489,6 @@ 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);
......@@ -527,6 +504,14 @@ 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);
......@@ -542,13 +527,6 @@ 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);
......@@ -564,6 +542,13 @@ 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);
......@@ -579,10 +564,25 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
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);
if(invoicesData && invoicesData.length && invoicesData.length > 0){
invoicesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.invoiceid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.invoices = invoicesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/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));
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
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+'_invoices',JSON.stringify(res.data.invoices));
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 res:any = await Http.getInstance().get(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
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 res:any = await Http.getInstance().get(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
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 res:any = await Http.getInstance().get(`/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
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 res:any = await Http.getInstance().get(`/quotes/${context.quote}/salesorders/${context.salesorder}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
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 res:any = await Http.getInstance().get(`/salesorders/${context.salesorder}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
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+'_invoices',JSON.stringify(res.data.invoices));
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 && 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+'_invoices',JSON.stringify(res.data.invoices));
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 && 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+'_invoices',JSON.stringify(res.data.invoices));
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 && 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+'_invoices',JSON.stringify(res.data.invoices));
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 && true){
let res:any = await Http.getInstance().get(`/quotes/${context.quote}/salesorders/getdraft`,isloading);
res.data.salesorder = data.salesorder;
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
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 res:any = await Http.getInstance().get(`/salesorders/getdraft`,isloading);
res.data.salesorder = data.salesorder;
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
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 invoicesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
if(invoicesData && invoicesData.length && invoicesData.length > 0){
invoicesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.invoiceid = null;
}
delete item.srffrontuf;
}
});
}
}
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);
......@@ -769,14 +754,6 @@ 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);
......@@ -792,6 +769,14 @@ 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);
......@@ -807,14 +792,6 @@ 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);
......@@ -830,6 +807,14 @@ 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);
......@@ -845,14 +830,6 @@ 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);
......@@ -868,6 +845,14 @@ 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);
......@@ -883,14 +868,6 @@ 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);
......@@ -906,6 +883,14 @@ 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);
......@@ -921,10 +906,25 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
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);
if(invoicesData && invoicesData.length && invoicesData.length > 0){
invoicesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.invoiceid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.invoices = invoicesData;
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+'_invoices',JSON.stringify(res.data.invoices));
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
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 invoicesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
if(invoicesData && invoicesData.length && invoicesData.length > 0){
invoicesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.invoiceid = null;
}
delete item.srffrontuf;
}
});
}
}
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);
......@@ -987,14 +972,6 @@ 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);
......@@ -1010,6 +987,14 @@ 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);
......@@ -1025,14 +1010,6 @@ 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);
......@@ -1048,6 +1025,14 @@ 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);
......@@ -1063,14 +1048,6 @@ 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);
......@@ -1086,6 +1063,14 @@ 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);
......@@ -1101,14 +1086,6 @@ 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);
......@@ -1124,6 +1101,14 @@ 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);
......@@ -1139,10 +1124,25 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
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);
if(invoicesData && invoicesData.length && invoicesData.length > 0){
invoicesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.invoiceid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.invoices = invoicesData;
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+'_invoices',JSON.stringify(res.data.invoices));
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
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 invoicesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
if(invoicesData && invoicesData.length && invoicesData.length > 0){
invoicesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.invoiceid = null;
}
delete item.srffrontuf;
}
});
}
}
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);
......@@ -1190,14 +1175,6 @@ 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);
......@@ -1213,6 +1190,14 @@ 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);
......@@ -1228,14 +1213,6 @@ 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);
......@@ -1251,6 +1228,14 @@ 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);
......@@ -1266,14 +1251,6 @@ 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);
......@@ -1289,6 +1266,14 @@ 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);
......@@ -1304,14 +1289,6 @@ 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);
......@@ -1327,6 +1304,14 @@ 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);
......@@ -1342,13 +1327,6 @@ 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);
......@@ -1364,6 +1342,13 @@ 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);
......@@ -1379,10 +1364,25 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
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);
if(invoicesData && invoicesData.length && invoicesData.length > 0){
invoicesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.invoiceid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.invoices = invoicesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/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));
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
return res;
}
......
......@@ -4769,7 +4769,7 @@
<!--输出实体[INCIDENT]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-incident-96-59">
<changeSet author="a_LAB01_e85d8801c" id="tab-incident-97-59">
<createTable tableName="INCIDENT">
<column name="LASTONHOLDTIME" remarks="" type="DATETIME">
</column>
......@@ -11357,43 +11357,43 @@
<addForeignKeyConstraint baseColumnNames="RESOURCESPECID" baseTableName="SERVICE" constraintName="DER1N_SERVICE__RESOURCESPEC__R" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="RESOURCESPECID" referencedTableName="RESOURCESPEC" validate="true"/>
</changeSet>
<!--输出实体[INCIDENT]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-incident-96-260">
<changeSet author="a_LAB01_e85d8801c" id="fk-incident-97-260">
<addForeignKeyConstraint baseColumnNames="PRIMARYCONTACTID" baseTableName="INCIDENT" constraintName="DER1N_INCIDENT__CONTACT__PRIMA" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="CONTACTID" referencedTableName="CONTACT" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-incident-96-261">
<changeSet author="a_LAB01_e85d8801c" id="fk-incident-97-261">
<addForeignKeyConstraint baseColumnNames="RESPONSIBLECONTACTID" baseTableName="INCIDENT" constraintName="DER1N_INCIDENT__CONTACT__RESPO" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="CONTACTID" referencedTableName="CONTACT" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-incident-96-262">
<changeSet author="a_LAB01_e85d8801c" id="fk-incident-97-262">
<addForeignKeyConstraint baseColumnNames="CONTRACTDETAILID" baseTableName="INCIDENT" constraintName="DER1N_INCIDENT__CONTRACTDETAIL" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="CONTRACTDETAILID" referencedTableName="CONTRACTDETAIL" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-incident-96-263">
<changeSet author="a_LAB01_e85d8801c" id="fk-incident-97-263">
<addForeignKeyConstraint baseColumnNames="CONTRACTID" baseTableName="INCIDENT" constraintName="DER1N_INCIDENT__CONTRACT__CONT" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="CONTRACTID" referencedTableName="CONTRACT" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-incident-96-264">
<changeSet author="a_LAB01_e85d8801c" id="fk-incident-97-264">
<addForeignKeyConstraint baseColumnNames="ENTITLEMENTID" baseTableName="INCIDENT" constraintName="DER1N_INCIDENT__ENTITLEMENT__E" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ENTITLEMENTID" referencedTableName="ENTITLEMENT" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-incident-96-265">
<changeSet author="a_LAB01_e85d8801c" id="fk-incident-97-265">
<addForeignKeyConstraint baseColumnNames="EXISTINGCASE" baseTableName="INCIDENT" constraintName="DER1N_INCIDENT__INCIDENT__EXIS" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="INCIDENTID" referencedTableName="INCIDENT" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-incident-96-266">
<changeSet author="a_LAB01_e85d8801c" id="fk-incident-97-266">
<addForeignKeyConstraint baseColumnNames="MASTERID" baseTableName="INCIDENT" constraintName="DER1N_INCIDENT__INCIDENT__MAST" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="INCIDENTID" referencedTableName="INCIDENT" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-incident-96-267">
<changeSet author="a_LAB01_e85d8801c" id="fk-incident-97-267">
<addForeignKeyConstraint baseColumnNames="PARENTCASEID" baseTableName="INCIDENT" constraintName="DER1N_INCIDENT__INCIDENT__PARE" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="INCIDENTID" referencedTableName="INCIDENT" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-incident-96-268">
<changeSet author="a_LAB01_e85d8801c" id="fk-incident-97-268">
<addForeignKeyConstraint baseColumnNames="PRODUCTID" baseTableName="INCIDENT" constraintName="DER1N_INCIDENT__PRODUCT__PRODU" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="PRODUCTID" referencedTableName="PRODUCT" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-incident-96-269">
<changeSet author="a_LAB01_e85d8801c" id="fk-incident-97-269">
<addForeignKeyConstraint baseColumnNames="FIRSTRESPONSEBYKPIID" baseTableName="INCIDENT" constraintName="DER1N_INCIDENT__SLAKPIINSTANCE" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="SLAKPIINSTANCEID" referencedTableName="SLAKPIINSTANCE" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-incident-96-271">
<changeSet author="a_LAB01_e85d8801c" id="fk-incident-97-271">
<addForeignKeyConstraint baseColumnNames="SLAID" baseTableName="INCIDENT" constraintName="DER1N_INCIDENT__SLA__SLAID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="SLAID" referencedTableName="SLA" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-incident-96-272">
<changeSet author="a_LAB01_e85d8801c" id="fk-incident-97-272">
<addForeignKeyConstraint baseColumnNames="SUBJECTID" baseTableName="INCIDENT" constraintName="DER1N_INCIDENT__SUBJECT__SUBJE" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="SUBJECTID" referencedTableName="SUBJECT" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-incident-96-273">
<changeSet author="a_LAB01_e85d8801c" id="fk-incident-97-273">
<addForeignKeyConstraint baseColumnNames="TRANSACTIONCURRENCYID" baseTableName="INCIDENT" constraintName="DER1N_INCIDENT__TRANSACTIONCUR" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="TRANSACTIONCURRENCYID" referencedTableName="TRANSACTIONCURRENCY" validate="true"/>
</changeSet>
<!--输出实体[INCIDENTCUSTOMER]外键关系 -->
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册