| | |
| | | AWSServiceTool.getNoPIContact(searchContactName,accountId); |
| | | Test.stopTest(); |
| | | } |
| | | @isTest |
| | | static void Test4(){ |
| | | Test.setMock(HttpCalloutMock.class, new HttpMock()); |
| | | |
| | | |
| | | Test.startTest(); |
| | | AWSServiceTool.sendToPiAWS('String rowDataStr', 'String endpoint','String awsToken'); |
| | | Test.stopTest(); |
| | | } |
| | | class HttpMock implements HttpCalloutMock{ |
| | | |
| | | string rid = ''; |
| | | public HttpMock(){ |
| | | } |
| | | public HttpMock(string rid){ |
| | | this.rid = rid; |
| | | } |
| | | public HTTPResponse respond(HTTPRequest request) { |
| | | // 创建一个假的回应 |
| | | System.debug('------------------------------------------------------'); |
| | | HttpResponse response = new HttpResponse(); |
| | | string body = ''; |
| | | system.debug(request.getEndpoint()); |
| | | string url = request.getEndpoint(); |
| | | |
| | | if(url.contains('token')){ |
| | | system.debug('url=token'); |
| | | response.setHeader('Content-Type', 'application/json'); |
| | | body='{ "message": "", "object": "freqfewqfewewfewfew", "status": "", "success": true, "timestamp": 0, "txId": "" }'; |
| | | } else if(url.toLowerCase().contains('insert')){ |
| | | system.debug('url=Insert'); |
| | | response.setHeader('Content-Type', 'application/json'); |
| | | body='{ "message": "", "object": [ { "dataId": "123456", "directShippmentAddress": "", "directShippmentAddressEncrypt": "", "isDelete": 0, "phoneNumber": "", "phoneNumberEncrypt": "", "sfRecordId": "'+rid+'" } ], "status": "", "success": true, "timestamp": 0, "txId": "" }'; |
| | | } else if(url.toLowerCase().contains('update')){ |
| | | system.debug('url=update'); |
| | | response.setHeader('Content-Type', 'application/json'); |
| | | body='{ "message": "", "object": [ { "dataId": "123456", "directShippmentAddress": "", "directShippmentAddressEncrypt": "", "isDelete": 0, "phoneNumber": "", "phoneNumberEncrypt": "", "sfRecordId": "'+rid+'" } ], "status": "", "success": true, "timestamp": 0, "txId": "" }'; |
| | | } else{ |
| | | |
| | | } |
| | | |
| | | response.setBody(body); |
| | | response.setStatus('OK'); |
| | | response.setStatusCode(200); |
| | | return response; |
| | | // } |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | //新增权限整理2021-05-10 |
| | | if (new_profileId.subString(0, 15) == System.label.Market_Department || new_profileId.subString(0, 15) == System.label.Market_Department1 || new_profileId.subString(0, 15) == System.label.Service_Owner || new_profileId.subString(0, 15) == System.label.Service_OwnerMinister |
| | | || UserInfo.getUserType() == 'PowerPartner' || new_profileId.subString(0, 15) == System.label.IEPrototypeManager || newAcc.RecordTypeId == '0120T0000003Cxt') { |
| | | || UserInfo.getUserType() == 'PowerPartner' || new_profileId.subString(0, 15) == System.label.IEPrototypeManager) { |
| | | //新增权限整理2021-05-10 |
| | | newAcc.IsNew__c = true; |
| | | } else { |
| | |
| | | //IE与LS分野的增加与修改 |
| | | newAcc.Sub_UseA__c = newAcc.Sub_Use1__c; |
| | | newAcc.Sub_UseD__c = newAcc.Sub_Use__c; |
| | | newAcc.IndustryBD__c = newAcc.IndustryB__c; |
| | | //newAcc.IndustryBD__c = newAcc.IndustryB__c; |
| | | |
| | | //IE与LS分野的增加与修改 |
| | | newAcc.UseD__c = newAcc.Use__c; |
| | |
| | | |
| | | } |
| | | //gwy 2021-06-04 LS 新增必填项OEM客户的标识 |
| | | if(newAcc.UserType__c == 'OEM客户' && newAcc.ProductSegment__c == 'BS'){ |
| | | /*if(newAcc.UserType__c == 'OEM客户' && newAcc.ProductSegment__c == 'BS'){ |
| | | newAcc.Whether_OEM__c = true; |
| | | } |
| | | }*/ |
| | | //王鹏伟添加 服务部创建客户、联系人 |
| | | //00528000000YWC6 孙 学洋 00528000000YWC6 |
| | | //00528000000YWE7 吴 晓东 00528000000YWE7 |
| | |
| | | // } else if (newAcc.Sub_Use__c == '炼钢厂') { |
| | | // newAcc.IndustryC__c = 'Metal Manufacturing'; |
| | | // newAcc.MarketVerticals__c = 'Manufacturing'; |
| | | // newAcc.Use__c = ' Tube/Rod/Bar/Sheet Metal'; |
| | | // newAcc.Use__c = ' Tube/Rod/Bar/Sheet Metal'; |
| | | // } else if (newAcc.Sub_Use__c == 'PMI-石化行业') { |
| | | // newAcc.IndustryC__c = 'Chemical/Petrochemical/Plastics'; |
| | | // newAcc.MarketVerticals__c = 'Maintenance'; |
| | |
| | | newAcc.AssetNDT4D__c != oldAcc.AssetNDT4D__c || |
| | | newAcc.IndustryCD__c != oldAcc.IndustryCD__c || |
| | | //gwy BS |
| | | newAcc.IndustryBD__c != oldAcc.IndustryBD__c || |
| | | //newAcc.IndustryBD__c != oldAcc.IndustryBD__c || |
| | | newAcc.AssetRVI4D__c != oldAcc.AssetRVI4D__c || |
| | | newAcc.AssetRVI3D__c != oldAcc.AssetRVI3D__c || |
| | | //newAcc.KeyAccountD__c != oldAcc.KeyAccountD__c || |
| | |
| | | //王鹏伟 添加&&((oldCon.ProductSegmentIE__c == true || oldCon.ProductSegmentRVI__c == true) && oldCon.isServiceCreate__c == true) |
| | | //服务部修改联系人信息 LS、NDT、ANI无需审批跳过审批状态变草案 |
| | | //新增权限整理2021-05-10 |
| | | //gwy 2021-08-20 除了市场部的人,都可以变草案 |
| | | //List<String> markNot = new String [] {'00528000000YVIc','0050K00000B3aNb','0050K00000B3aN7','00528000001uK0Z','00528000000YVHy','00528000000YVID'}; |
| | | if ((oldAcc.MarkisorNo__c == false |
| | | //新增权限整理2021-05-10 |
| | | || UserInfo.getUserType() == 'PowerPartner') |
| | | if ((new_profileId.subString(0, 15) == System.label.Service_Owner |
| | | //新增权限整理2021-05-10 |
| | | || UserInfo.getUserType() == 'PowerPartner' || now_userId == '00528000000YWC6' || now_userId == '00528000000YWE7') |
| | | && !((oldAcc.ProductSegment__c == 'BS' || oldAcc.ProductSegment__c == 'NDT' || oldAcc.ProductSegment__c == 'ANI') && oldAcc.serviceCreate__c == true)) { |
| | | newAcc.stautesD__c = 'Draft'; |
| | | } |
| | |
| | | newAcc.AssetNDT4D__c = newAcc.AssetNDT4__c; |
| | | } |
| | | //gwy BS |
| | | if (newAcc.IndustryB__c != oldAcc.IndustryB__c) { |
| | | /*if (newAcc.IndustryB__c != oldAcc.IndustryB__c) { |
| | | newAcc.IndustryBD__c = newAcc.IndustryB__c; |
| | | } |
| | | }*/ |
| | | if (newAcc.IndustryC__c != oldAcc.IndustryC__c) { |
| | | newAcc.IndustryCD__c = newAcc.IndustryC__c; |
| | | } |
| | |
| | | newAcc.DepartmentNameD__c = newAcc.DepartmentName__c; |
| | | } |
| | | //gwy 2021-06-08 客户取消邮编必填项 |
| | | /* if (newAcc.PostCodeD__c == null) { |
| | | /*if (newAcc.PostCodeD__c == null) { |
| | | newAcc.PostCodeD__c = '000000'; |
| | | }*/ |
| | | //王鹏伟新加 服务部创建客户联系人 |
| | |
| | | newAcc.AssetRVI2D__c = newAcc.AssetRVI2__c; |
| | | newAcc.AssetNDT4D__c = newAcc.AssetNDT4__c; |
| | | //gwy 2021-06-15 更改 |
| | | newAcc.IndustryBD__c = newAcc.IndustryB__c; |
| | | newAcc.IndustryCD__c = newAcc.IndustryC__c; |
| | | //newAcc.IndustryBD__c = newAcc.IndustryB__c; |
| | | //newAcc.IndustryCD__c = newAcc.IndustryC__c; |
| | | //newAcc.IndustryCD__c = newAcc.IndustryB__c; |
| | | //newAcc.IndustryBD__c = newAcc.IndustryB__c; |
| | | newAcc.AssetRVI4D__c = newAcc.AssetRVI4__c; |
| | |
| | | } |
| | | } |
| | | //gwy 2021-06-04 LS 新增必填项OEM客户的标识 |
| | | if(newAcc.UserType__c == 'OEM客户' && newAcc.ProductSegment__c == 'BS'){ |
| | | /*if(newAcc.UserType__c == 'OEM客户' && newAcc.ProductSegment__c == 'BS'){ |
| | | newAcc.Whether_OEM__c = true; |
| | | }else{ |
| | | newAcc.Whether_OEM__c = false; |
| | | } |
| | | }*/ |
| | | } |
| | | } |
| | | |
| | |
| | | for (Account newAcc : newList) { |
| | | |
| | | accIdList.add(newAcc.Id); |
| | | String dealerId = userMap.get(newAcc.OwnerId); |
| | | // String dealerId = userMap.get(newAcc.OwnerId); |
| | | // 手动导入客户 XHL 20210818 |
| | | String dealerId = String.isNotBlank(newAcc.ImportDealerId__c)? newAcc.ImportDealerId__c:userMap.get(newAcc.OwnerId); |
| | | |
| | | String groupId = StaticParameter.dealerGroupMap.get(dealerId == null ? '' : dealerId.substring(0, 15)); |
| | | Boolean flag = StaticParameter.specialDealerList.contains(dealerId == null ? '' : dealerId.substring(0, 15)); |
| | | if (flag) { |
| | |
| | | |
| | | List<AccountTeamMember> insertList = new list<AccountTeamMember>(); |
| | | for (Account newAcc : newList) { |
| | | String dealerId = userMap.get(newAcc.OwnerId); |
| | | // String dealerId = userMap.get(newAcc.OwnerId); |
| | | // 手动导入客户 XHL 20210818 |
| | | String dealerId = String.isNotBlank(newAcc.ImportDealerId__c)? newAcc.ImportDealerId__c:userMap.get(newAcc.OwnerId); |
| | | String groupId = StaticParameter.dealerGroupMap.get(dealerId == null ? '' : dealerId.substring(0, 15)); |
| | | // 市场战略部新建保存时将创建者插入客户小组 |
| | | if (newAcc.IsStrCreated__c == true) { |
| | |
| | | // String new_profileId = UserInfo.getProfileId().subString(0,15); |
| | | //calendarUtil.getMemberProfileID 这里用到的人员ID 和获取到的简档ID都是15位的 |
| | | String new_profileId = calendarUtil.getMemberProfileID(UserInfo.getUserId().subString(0,15)); |
| | | |
| | | |
| | | if (new_profileId.subString(0,15) == System.label.Market_Department || new_profileId.subString(0,15) == System.label.Market_Department1 || new_profileId.subString(0,15) == System.label.Service_Owner || |
| | | UserInfo.getUserType() == 'PowerPartner') { |
| | | newCon.IsNew__c = true; |
| | |
| | | if(new_profileId.subString(0,15) == '00e28000000YKLo'){ |
| | | newCon.IsNew__c = true; |
| | | } |
| | | // PIPL Update 20220420 By Chen Yanan Start |
| | | newCon.MobilePhoneD_Encrypted__c = newCon.MobilePhone_Encrypted__c; |
| | | newCon.OtherPhoneD_Encrypted__c = newCon.OtherPhone_Encrypted__c; |
| | | newCon.FaxD_Encrypted__c = newCon.Fax_Encrypted__c; |
| | | newCon.EmailD_Encrypted__c = newCon.Email_Encrypted__c; |
| | | newCon.PhoneD_Encrypted__c = newCon.Phone_Encrypted__c; |
| | | newCon.TitleD_Encrypted__c = newCon.Title_Encrypted__c; |
| | | newCon.Address1D_Encrypted__c = newCon.Address1_Encrypted__c; |
| | | newCon.Address2D_Encrypted__c = newCon.Address2_Encrypted__c; |
| | | newCon.Address3D_Encrypted__c = newCon.Address3_Encrypted__c; |
| | | newCon.PostcodeD_Encrypted__c = newCon.Postcode_Encrypted__c; |
| | | // PIPL Update 20220420 By Chen Yanan End |
| | | } |
| | | System.debug('setIsNew newCon: ' + newCon); |
| | | } |
| | | |
| | | } |
| | | |
| | | public static void updateForDealer(List<Contact> newList, Map<Id, Contact> newMap, List<Contact> oldList, Map<Id, Contact> oldMap) { |
| | |
| | | |
| | | if (newCon.MobilePhone != oldCon.MobilePhone) { |
| | | newCon.MobilePhoneD__c = newCon.MobilePhone; |
| | | // PIPL Update 20220420 By Chen Yanan Start |
| | | System.debug('MobilePhoneD_Encrypted__c'); |
| | | newCon.MobilePhoneD_Encrypted__c = newCon.MobilePhone_Encrypted__c; |
| | | // PIPL Update 20220420 By Chen Yanan End |
| | | } |
| | | if (newCon.OtherPhone != oldCon.OtherPhone) { |
| | | newCon.OtherPhoneD__c = newCon.OtherPhone; |
| | | // PIPL Update 20220420 By Chen Yanan Start |
| | | System.debug('OtherPhoneD_Encrypted__c'); |
| | | newCon.OtherPhoneD_Encrypted__c = newCon.OtherPhone_Encrypted__c; |
| | | // PIPL Update 20220420 By Chen Yanan End |
| | | } |
| | | if (newCon.Fax != oldCon.Fax) { |
| | | newCon.FaxD__c = newCon.Fax; |
| | | // PIPL Update 20220420 By Chen Yanan Start |
| | | System.debug('FaxD_Encrypted__c'); |
| | | newCon.FaxD_Encrypted__c = newCon.Fax_Encrypted__c; |
| | | // PIPL Update 20220420 By Chen Yanan End |
| | | } |
| | | if (newCon.Email != oldCon.Email) { |
| | | newCon.EmailD__c = newCon.Email; |
| | | // PIPL Update 20220420 By Chen Yanan Start |
| | | System.debug('EmailD_Encrypted__c'); |
| | | newCon.EmailD_Encrypted__c = newCon.Email_Encrypted__c; |
| | | // PIPL Update 20220420 By Chen Yanan End |
| | | } |
| | | if (newCon.Phone != oldCon.Phone) { |
| | | newCon.PhoneD__c = newCon.Phone; |
| | | // PIPL Update 20220420 By Chen Yanan Start |
| | | System.debug('PhoneD_Encrypted__c'); |
| | | newCon.PhoneD_Encrypted__c = newCon.Phone_Encrypted__c; |
| | | // PIPL Update 20220420 By Chen Yanan End |
| | | } |
| | | if (newCon.Title != oldCon.Title) { |
| | | newCon.TitleD__c = newCon.Title; |
| | | // PIPL Update 20220420 By Chen Yanan Start |
| | | System.debug('TitleD_Encrypted__c'); |
| | | newCon.TitleD_Encrypted__c = newCon.Title_Encrypted__c; |
| | | // PIPL Update 20220420 By Chen Yanan End |
| | | } |
| | | if (newCon.Address1__c != oldCon.Address1__c) { |
| | | newCon.Address1D__c = newCon.Address1__c; |
| | | System.debug('Address1D_Encrypted__c'); |
| | | // PIPL Update 20220420 By Chen Yanan Start |
| | | newCon.Address1D_Encrypted__c = newCon.Address1_Encrypted__c; |
| | | // PIPL Update 20220420 By Chen Yanan End |
| | | } |
| | | if (newCon.Address2__c != oldCon.Address2__c) { |
| | | newCon.Address2D__c = newCon.Address2__c; |
| | | System.debug('Address2D_Encrypted__c'); |
| | | // PIPL Update 20220420 By Chen Yanan Start |
| | | newCon.Address2D_Encrypted__c = newCon.Address2_Encrypted__c; |
| | | // PIPL Update 20220420 By Chen Yanan End |
| | | } |
| | | if (newCon.Address3__c != oldCon.Address3__c) { |
| | | newCon.Address3D__c = newCon.Address3__c; |
| | | System.debug('Address3D_Encrypted__c'); |
| | | // PIPL Update 20220420 By Chen Yanan Start |
| | | newCon.Address3D_Encrypted__c = newCon.Address3_Encrypted__c; |
| | | // PIPL Update 20220420 By Chen Yanan End |
| | | } |
| | | if (newCon.Postcode__c != oldCon.Postcode__c) { |
| | | newCon.PostcodeD__c = newCon.Postcode__c; |
| | | System.debug('PostcodeD_Encrypted__c'); |
| | | // PIPL Update 20220420 By Chen Yanan Start |
| | | newCon.PostcodeD_Encrypted__c = newCon.Postcode_Encrypted__c; |
| | | // PIPL Update 20220420 By Chen Yanan End |
| | | } |
| | | |
| | | if (newCon.ContactStatus__c != oldCon.ContactStatus__c) { |
| | |
| | | if (newCon.CancelReason__c != oldCon.CancelReason__c) { |
| | | newCon.CancelReasonD__c = newCon.CancelReason__c; |
| | | } |
| | | System.debug('updateForDealer newCon: ' + newCon); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | public static void dealerContactApproval(List<Contact> newList, Map<Id, Contact> newMap, List<Contact> oldList, Map<Id, Contact> oldMap) { |
| | |
| | | |
| | | newCon.ContactStatus__c = newCon.ContactStatusD__c; |
| | | newCon.CancelReason__c = newCon.CancelReasonD__c; |
| | | // PIPL Update 20220420 By Chen Yanan Start |
| | | newCon.MobilePhone_Encrypted__c = newCon.MobilePhoneD_Encrypted__c; |
| | | newCon.OtherPhone_Encrypted__c = newCon.OtherPhoneD_Encrypted__c; |
| | | newCon.Fax_Encrypted__c = newCon.FaxD_Encrypted__c; |
| | | newCon.Email_Encrypted__c = newCon.EmailD_Encrypted__c; |
| | | newCon.Phone_Encrypted__c = newCon.PhoneD_Encrypted__c; |
| | | newCon.Title_Encrypted__c = newCon.TitleD_Encrypted__c; |
| | | newCon.Address1_Encrypted__c = newCon.Address1D_Encrypted__c; |
| | | newCon.Address2_Encrypted__c = newCon.Address2D_Encrypted__c; |
| | | newCon.Address3_Encrypted__c = newCon.Address3D_Encrypted__c; |
| | | newCon.Postcode_Encrypted__c = newCon.PostcodeD_Encrypted__c; |
| | | // PIPL Update 20220420 By Chen Yanan End |
| | | } else if (newCon.StatusD__c != oldCon.StatusD__c) { |
| | | if (newCon.StatusD__c == 'Submit') { |
| | | //newCon.DealerSelectOwner__c = newCon.Account.DealerSelectOwner__c; |
| | |
| | | |
| | | newCon.ContactStatus__c = newCon.ContactStatusD__c; |
| | | newCon.CancelReason__c = newCon.CancelReasonD__c; |
| | | // PIPL Update 20220420 By Chen Yanan Start |
| | | System.debug('Pass'); |
| | | newCon.MobilePhone_Encrypted__c = newCon.MobilePhoneD_Encrypted__c; |
| | | newCon.OtherPhone_Encrypted__c = newCon.OtherPhoneD_Encrypted__c; |
| | | newCon.Fax_Encrypted__c = newCon.FaxD_Encrypted__c; |
| | | newCon.Email_Encrypted__c = newCon.EmailD_Encrypted__c; |
| | | newCon.Phone_Encrypted__c = newCon.PhoneD_Encrypted__c; |
| | | newCon.Title_Encrypted__c = newCon.TitleD_Encrypted__c; |
| | | newCon.Address1_Encrypted__c = newCon.Address1D_Encrypted__c; |
| | | newCon.Address2_Encrypted__c = newCon.Address2D_Encrypted__c; |
| | | newCon.Address3_Encrypted__c = newCon.Address3D_Encrypted__c; |
| | | newCon.Postcode_Encrypted__c = newCon.PostcodeD_Encrypted__c; |
| | | // PIPL Update 20220420 By Chen Yanan End |
| | | |
| | | // if (accsMap.containsKey(newCon.AccountId + '' + newCon.OwnerId) == true && newCon.IsNew__c == true) { |
| | | // AccountShare upd = new AccountShare( |
| | |
| | | |
| | | newCon.ContactStatusD__c = newCon.ContactStatus__c; |
| | | newCon.CancelReasonD__c = newCon.CancelReason__c; |
| | | // PIPL Update 20220420 By Chen Yanan Start |
| | | System.debug('Reject'); |
| | | newCon.MobilePhoneD_Encrypted__c = newCon.MobilePhone_Encrypted__c; |
| | | newCon.OtherPhoneD_Encrypted__c = newCon.OtherPhone_Encrypted__c; |
| | | newCon.FaxD_Encrypted__c = newCon.Fax_Encrypted__c; |
| | | newCon.EmailD_Encrypted__c = newCon.Email_Encrypted__c; |
| | | newCon.PhoneD_Encrypted__c = newCon.Phone_Encrypted__c; |
| | | newCon.TitleD_Encrypted__c = newCon.Title_Encrypted__c; |
| | | newCon.Address1D_Encrypted__c = newCon.Address1_Encrypted__c; |
| | | newCon.Address2D_Encrypted__c = newCon.Address2_Encrypted__c; |
| | | newCon.Address3D_Encrypted__c = newCon.Address3_Encrypted__c; |
| | | newCon.PostcodeD_Encrypted__c = newCon.Postcode_Encrypted__c; |
| | | // PIPL Update 20220420 By Chen Yanan End |
| | | } |
| | | System.debug('dealerContactApproval newCon: ' + newCon); |
| | | } |
| | | } |
| | | // 更新客户小组 |
| | |
| | | |
| | | global Database.QueryLocator start(Database.BatchableContext bc) { |
| | | |
| | | return Database.getQueryLocator([select Id from SS_Opportunity_detail_product__c]); |
| | | return Database.getQueryLocator([select Id from SSBD_All_Report__c]); |
| | | |
| | | } |
| | | |
| | |
| | | public boolean isExpress{get; private set; } |
| | | public boolean isRenew{get; private set; } |
| | | public String OCM_Number{get; private set; } |
| | | public String staticResource{get; private set; }// 20220221 PI改造 by Bright |
| | | |
| | | public DeliveryConfirmPDFController() { |
| | | laId = System.currentPageReference().getParameters().get('id'); |
| | | staticResource = JSON.serialize(PIHelper.getPIIntegrationInfo('loaner_application__c'));// 20220221 PI改造 by Bright |
| | | } |
| | | //初始化数据 |
| | | public PageReference init(){ |
| | |
| | | baseUrl += '/production'; |
| | | } |
| | | //获取借用单信息 |
| | | List<loaner_application__c> laList = [select Id,Follow_Opp_text__c,Follow_Opp__r.InquiryNumber__c,Equipment_Type__c ,pickup_time__c,Loaner_Apply_Renewal_Date__c,loaner_Remark__c,Rental_End_Date__c,Loaner_Ser__c,Approval_Date__c,loaner_request_number__c,Agent__r.Name,Approver__r.Name,Rental_Start_Date__c,loaner_place__c,Demo_purpose__c,direct_shippment_address__c,Loaner_receive_staff__c,Loaner_receive_staff_phone__c,CreatorUserType__c, |
| | | AWS_Data_Id__c,// 20220221 PI改造 by Bright |
| | | Applicant_department__c from loaner_application__c where Id = :laId]; |
| | | List<loaner_application__c> laList = [select Id,Follow_Opp_text__c,Follow_Opp__r.InquiryNumber__c,Equipment_Type__c ,pickup_time__c,Loaner_Apply_Renewal_Date__c,loaner_Remark__c,Rental_End_Date__c,Loaner_Ser__c,Approval_Date__c,loaner_request_number__c,Agent__r.Name,Approver__r.Name,Rental_Start_Date__c,loaner_place__c,Demo_purpose__c,direct_shippment_address__c,Loaner_receive_staff__c,Loaner_receive_staff_phone__c,CreatorUserType__c,Applicant_department__c from loaner_application__c where Id = :laId]; |
| | | if (laList.size() == 0) { |
| | | return null; |
| | | } |
| | |
| | | @isTest |
| | | private class DeliveryConfirmPDFControllerTest { |
| | | |
| | | @TestSetup |
| | | static void setup(){ |
| | | TestDataUtility.CreatePIPolicyConfigurations(new string[]{'loaner_application__c'}); |
| | | } |
| | | |
| | | |
| | | @isTest static void test_method_one() { |
| | | // Implement test code |
| | | OlympusCalendar__c oc1 = new OlympusCalendar__c(Date__c = Date.today().addDays(1), ChangeToHoliday__c=false, ChangeToWorkday__c=true); |
| New file |
| | |
| | | @isTest |
| | | private class FileUploadControllerTest { |
| | | static testMethod void testMethod1() { |
| | | // TestDataUtility.CreatePIPolicyConfiguration('Document'); |
| | | TestDataUtility.CreatePIPolicyConfiguration(); |
| | | Account acc = new Account(Name = 'test'); |
| | | Map<String,Object> accMap = new Map<String,Object>(); |
| | | accMap.put('Account',acc); |
| | | accMap.put('object','vjdoneqvds'); |
| | | String mapJson = JSON.serialize(accMap); |
| | | |
| | | Contact con = TestDataUtility.CreateContacts(1)[0]; |
| | | |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.BaseHttpMock(mapJson,'OK','200')); |
| | | |
| | | Test.startTest(); |
| | | ApexPages.StandardController sc = new ApexPages.StandardController(con); |
| | | FileUploadController fuc = new FileUploadController(sc); |
| | | |
| | | String msg = fuc.PIPL_Input_PDF_Error_Msg; |
| | | Document doc = fuc.documentData; |
| | | FileUploadController.Response fur = new FileUploadController.Response(); |
| | | fur.message = ''; |
| | | |
| | | FileUploadController.saveFile('Contact','123','456',fuc.parentId); |
| | | |
| | | FileAddress__c file = new FileAddress__c(); |
| | | PIHelper.PIIntegration pI=PIHelper.getPIIntegrationInfo('Document'); |
| | | file.DownloadLink__c =pI.undeleteUrl+'123'+'&fileName='+'Contact'; |
| | | file.FileName__c ='Contact'; |
| | | file.ViewLink__c =pI.queryUrl+'123'; |
| | | file.ParentRecordId__c =fuc.parentId; |
| | | file.AWS_File_Key__c = '123'; |
| | | insert file; |
| | | |
| | | FileUploadController.saveFile('Contact','123','456',fuc.parentId); |
| | | fuc.refreshFiles(); |
| | | fuc.parentId = ''; |
| | | fuc.refreshFiles(); |
| | | try{ |
| | | delete file; |
| | | }catch(Exception e){ |
| | | system.debug('Exception from delete file:'+e.getmessage()); |
| | | } |
| | | Test.stopTest(); |
| | | } |
| | | static testMethod void testMethod2() { |
| | | TestDataUtility.CreatePIPolicyConfiguration('Document'); |
| | | Account acc = new Account(Name = 'test'); |
| | | Map<String,Object> accMap = new Map<String,Object>(); |
| | | accMap.put('Account',acc); |
| | | accMap.put('object','vjdoneqvds'); |
| | | String mapJson = JSON.serialize(accMap); |
| | | |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.BaseHttpMock(mapJson,'OK','200')); |
| | | |
| | | Test.startTest(); |
| | | // throw new DMLException('insert false for test'); |
| | | FileUploadController.saveFile('','','',''); |
| | | |
| | | Test.stopTest(); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>50.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | /** |
| | | * @description : |
| | | * @author : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | * @group : |
| | | * @last modified on : 04-08-2022 |
| | | * @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | **/ |
| | | public with sharing class IENewOpportunityController { |
| | | public boolean hasError { get; set; } |
| | | //public boolean isDealerPage { get; set; } |
| | |
| | | opp.compo_opp__c = true; |
| | | } |
| | | opp.AccountId = acc.Id; |
| | | opp.Name = acc.Name;//dennis updated for test |
| | | opp.Account = acc; |
| | | opp.ProductSegment__c = acc.ProductSegment__c; |
| | | opp.Type = 'Not Traget'; |
| | |
| | | |
| | | Savepoint sp = Database.setSavepoint(); |
| | | try { |
| | | //0120K000000OptT正式环境 |
| | | //0120T0000003Ser测试环境 |
| | | opp.RecordTypeId = '0120T0000003Ser'; |
| | | opp.RecordTypeId = '0120K000000OptT'; |
| | | opp.SalesChannel__c = 'direct'; |
| | | insert opp; |
| | | if(opp.Have_Computer__c && opp.Association_Opportunity__c != null){ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <apiVersion>41.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | |
| | | return isOk; |
| | | } |
| | | |
| | | //联系人是否是填写的客户下的? |
| | | /*public static Boolean CustomerContactCheck(){ |
| | | Boolean disPersed = false; |
| | | List<Order> ordList = new List<Order>(); |
| | | ordList = [select id,name,SpecialDeliveryAccount__c,SpecialDeliveryContact2__c,SpecialDeliveryAccount_D__c,SpecialDeliveryContact2_D__c from Order]; |
| | | for (Order ord : ordList) { |
| | | if(ord.SpecialDeliveryAccount__c != null && ord.SpecialDeliveryContact2__c != null && ord.SpecialDeliveryAccount__c != ord.SpecialDeliveryContact2__r.Name){ |
| | | disPersed = true; |
| | | }else if(ord.SpecialDeliveryAccount_D__c != null && ord.SpecialDeliveryContact2_D__c != null && ord.SpecialDeliveryAccount_D__c != ord.SpecialDeliveryContact2_D__r.Name){ |
| | | disPersed = true; |
| | | } |
| | | } |
| | | |
| | | return disPersed; |
| | | }*/ |
| | | } |
| | |
| | | |
| | | LicenseCheckUtil.LicenseCheck(acc1.Id); |
| | | } |
| | | |
| | | } |
| | |
| | | public loaner_application__c lac {get;private set;} |
| | | public loaner_application__c la { get; private set; } |
| | | |
| | | // // 20220311 PI改造 --start |
| | | // public string staticResource { get; private set; } |
| | | // // 20220311 PI改造 --end |
| | | |
| | | public Set<String> laSet {get; private set;} |
| | | /* 画面步骤 |
| | | * 下架:StockDown |
| | |
| | | public LoanerLendDeliverController() { |
| | | laId = System.currentPageReference().getParameters().get('id'); |
| | | step = System.currentPageReference().getParameters().get('step'); |
| | | //staticResource = JSON.serialize(PIHelper.getPIIntegrationInfo('Contact')); //20220311 PI改造 |
| | | } |
| | | |
| | | public PageReference init() { |
| | |
| | | le.Name = temp.day()+ '日'+str+'物流单'; |
| | | if(str.equals('回寄')) le.IsDeliveryLogistics__c = false; |
| | | try{ |
| | | system.debug('le:'+le); |
| | | insert le; |
| | | }catch(Exception ex){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, ex.getMessage() + ' | Line:' + ex.getLineNumber())); |
| | |
| | | public loaner_application__c la { get; private set; } |
| | | public boolean isOk {get; private set; } |
| | | public String step { get; private set; } |
| | | public String staticResource { get; private set; }// Update PIPL 20220425 By Chen Yanan |
| | | |
| | | public String loanerType {get; private set; } |
| | | // 明细Bean |
| | |
| | | public LoanerPortionReturnController() { |
| | | laId = System.currentPageReference().getParameters().get('id'); |
| | | step = System.currentPageReference().getParameters().get('step'); |
| | | staticResource = JSON.serialize(PIHelper.getPIIntegrationInfo('loaner_application__c'));// Update PIPL 20220425 By Chen Yanan |
| | | } |
| | | |
| | | public PageReference init() { |
| | |
| | | } |
| | | |
| | | // 样机借出申请取得 |
| | | List<loaner_application__c> laList = [select Id,AWS_Data_Id__c,loaner_request_number__c,Return_Trake_Staff__c,Return_Track_Company__c,Return_Track_Number__c,Status__c,HP_Received_Sign_Date__c,RecordType.DeveloperName,loaner_manage_place__c,Equipment_Type__c from loaner_application__c where Id = :laId]; //Update PIPL 20220425 By Chen Yanan |
| | | List<loaner_application__c> laList = [select Id,loaner_request_number__c,Return_Trake_Staff__c,Return_Track_Company__c,Return_Track_Number__c,Status__c,HP_Received_Sign_Date__c,RecordType.DeveloperName,loaner_manage_place__c,Equipment_Type__c from loaner_application__c where Id = :laId]; |
| | | if (laList.size() == 0) { |
| | | return null; |
| | | } |
| | |
| | | lac = new loaner_application__c(); |
| | | lac.Return_Track_Company__c = la.Return_Track_Company__c; |
| | | lac.Return_Track_Number__c = la.Return_Track_Number__c; |
| | | lac.AWS_Data_Id__c = la.AWS_Data_Id__c; //Update PIPL 20220425 By Chen Yanan |
| | | lac.return_Number__c = ''; |
| | | if(la.Return_Trake_Staff__c != null){ |
| | | lac.Return_Trake_Staff__c = la.Return_Trake_Staff__c; |
| New file |
| | |
| | | public without sharing class MetaDataUtility { |
| | | |
| | | public static List<Metadata.LayoutSection> GetRecordTypePageLayout(string record_type_id,string objectType){ |
| | | |
| | | Map<string,object> mso = null; |
| | | string layout_name = GetRecordTypePageLayoutName(record_type_id,objectType,UserInfo.getProfileId()); |
| | | system.debug('layout_name='+layout_name); |
| | | List<Metadata.LayoutSection> temp = GetLayoutSections(objectType,layout_name); |
| | | if(temp==null){ |
| | | return null; |
| | | } |
| | | List<Metadata.LayoutSection> layoutSectionList = new List<Metadata.LayoutSection>(); |
| | | for(Metadata.LayoutSection section : temp){ |
| | | boolean a = false; |
| | | for( Metadata.LayoutColumn c: section.layoutColumns){ |
| | | //system.debug(c); |
| | | if(c.layoutItems != null && c.layoutItems.size() > 0 ){ |
| | | a = true; |
| | | } |
| | | |
| | | } |
| | | if(a){ |
| | | layoutSectionList.add(section); |
| | | } |
| | | } |
| | | return layoutSectionList; |
| | | } |
| | | |
| | | /*[{ |
| | | "attributes": { |
| | | "type": "Layout", |
| | | "url": "/services/data/v53.0/tooling/sobjects/Layout/00h10000009iAb5AAE" |
| | | }, |
| | | "Id": "00h10000009iAb5AAE", |
| | | "Name": ".客户人员レイアウト", |
| | | "TableEnumOrId": "01I10000000er3hEAA", |
| | | "LayoutType": "Standard" |
| | | }] |
| | | */ |
| | | |
| | | public static string GetTableOrEnumId(string objectType){ |
| | | |
| | | |
| | | Map<string,object> mso = null; |
| | | string resp = null; |
| | | string table_or_enum_id = objectType; |
| | | List<EntityDefinition> led = [SELECT Id, DurableId, DeveloperName, MasterLabel, Label, QualifiedApiName FROM EntityDefinition where QualifiedApiName = :objectType]; |
| | | if(led.size()>0){ |
| | | table_or_enum_id = led[0].DurableId; |
| | | } |
| | | /* |
| | | if(objectType.endsWith('__c')){ |
| | | resp = ToolingQuery('SELECT id,DeveloperName from CustomObject where DeveloperName =\''+objectType.replace('__c', '')+'\''); |
| | | if(resp == null){ |
| | | system.debug('resp is not ok'); |
| | | return null; |
| | | }else{ |
| | | mso = (Map<string,object>)Json.deserializeUntyped(resp); |
| | | if(integer.valueOf(mso.get('size')) > 0){ |
| | | table_or_enum_id = string.valueOf(((Map<string,object>)(((List<object>)mso.get('records'))[0])).get('Id')); |
| | | }else{ |
| | | system.debug('no records'); |
| | | return null; |
| | | } |
| | | } |
| | | }*/ |
| | | |
| | | return table_or_enum_id; |
| | | } |
| | | |
| | | /* |
| | | public static List<object> GetAllPageLayout(string objectType){ |
| | | string resp = null; |
| | | Map<string,object> mso = null; |
| | | |
| | | |
| | | string table_or_enum_id = GetTableOrEnumId(objectType); |
| | | |
| | | if(string.isBlank(table_or_enum_id)){ |
| | | return new List<object>(); |
| | | } |
| | | |
| | | resp = ToolingQuery('SELECT id,name,TableEnumOrId,LayoutType FROM Layout where TableEnumOrId = \''+table_or_enum_id+'\''); |
| | | if(resp == null){ |
| | | system.debug('Layout where TableEnumOrId='+table_or_enum_id+' is null'); |
| | | return null; |
| | | }else{ |
| | | mso = (Map<string,object>)Json.deserializeUntyped(resp); |
| | | if(integer.valueOf(mso.get('size')) > 0){ |
| | | return (List<object>)mso.get('records'); |
| | | }else{ |
| | | system.debug('no records'); |
| | | return new List<object>(); |
| | | } |
| | | } |
| | | }*/ |
| | | |
| | | |
| | | public static string GetRecordTypePageLayoutName(string record_type_id,string objectType, string profile_id){ |
| | | |
| | | // if(!string.isBlank(objectType)){ |
| | | // List<sobject> lso = [SELECT Id, Name, DeveloperName, SobjectType, IsActive, Description, BusinessProcessId FROM RecordType where SobjectType = :objectType]; |
| | | // if(lso.size()==0){ |
| | | // return string.valueOf(((Map<string,object>)(GetAllPageLayout(objectType)[0])).get('Name')); |
| | | // } |
| | | // } |
| | | |
| | | // 01210000000QfWdAAK |
| | | string query = 'SELECT Layout.Name, Layout.TableEnumOrId, ProfileId, Profile.Name, RecordTypeId FROM ProfileLayout where id!=null '; |
| | | if(!string.isBlank(record_type_id)){ |
| | | query += ' and RecordTypeId = \''+record_type_id+'\''; |
| | | } |
| | | |
| | | if(!string.isBlank(objectType)){ |
| | | query += ' and TableEnumOrId = \''+ GetTableOrEnumId(objectType) +'\''; |
| | | } |
| | | |
| | | if(!string.isBlank(profile_id)){ |
| | | query += ' and ProfileId = \''+profile_id+'\''; |
| | | } |
| | | query += ' order by LastModifiedDate desc '; |
| | | |
| | | string s = ToolingQuery(query); |
| | | if(string.isBlank(s)){ |
| | | system.debug('s is blank'); |
| | | return null; |
| | | }else{ |
| | | Map<string,object> mso = (Map<string,object>)JSON.deserializeUntyped(s); |
| | | |
| | | if(integer.valueOf(mso.get('size')) > 0){ |
| | | List<object> records = ((List<object>)mso.get('records')); |
| | | |
| | | mso = (Map<string,object>)(records[0]); |
| | | return string.valueOf(((Map<string,object>)(mso.get('Layout'))).get('Name')); |
| | | }else{ |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | public static string ToolingQuery(string query){ |
| | | |
| | | system.debug('query='+query); |
| | | String baseURL = 'callout:SF_Rest_API/services/data/v41.0/tooling/query?q='+ query.replace(' ', '+'); |
| | | HttpResponse resp = null; |
| | | HttpRequest req = new HttpRequest(); |
| | | req.setMethod('GET'); |
| | | |
| | | //req.setHeader('Authorization', 'Bearer ' + UserInfo.getsessionid()); |
| | | //req.setEndpoint(baseURL); |
| | | req.setEndpoint(baseURL); |
| | | |
| | | Http client = new Http(); |
| | | resp = client.send(req); |
| | | |
| | | system.debug(resp.getStatus()); |
| | | system.debug(resp.getStatusCode()); |
| | | if(resp.getStatus() == 'OK'){ |
| | | string s = resp.getBody(); |
| | | system.debug(resp.getBody()); |
| | | return s; |
| | | }else{ |
| | | system.debug('status is not ok,error:'+resp.getBody()); |
| | | return null; |
| | | } |
| | | |
| | | } |
| | | |
| | | public static List<Metadata.LayoutSection> GetLayoutSections(string object_name, string layout_name){ |
| | | List<String> componentNameList = new List<String>{object_name+'-'+layout_name}; |
| | | //通过Metadata.Operations.retrieve获取metadata |
| | | //Metadata.Layout -> Metadata.LayoutSection -> Metadata.LayoutColumn objects -> Metadata.LayoutItem objects |
| | | List<Metadata.Metadata> componentList = Metadata.Operations.retrieve(Metadata.MetadataType.Layout, componentNameList); |
| | | if(componentList?.size() > 0){ |
| | | Metadata.Layout layout = (Metadata.Layout) componentList.get(0); |
| | | List<Metadata.LayoutSection> layoutSectionList = layout.layoutSections; |
| | | return layoutSectionList; |
| | | } |
| | | else{ |
| | | return null; |
| | | } |
| | | |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | @isTest |
| | | public class MetaDataUtilityTest { |
| | | |
| | | @isTest |
| | | static void Test1(){ |
| | | /* |
| | | Test.setMock(HttpCalloutMock.class, new CalloutMockContainer('{"size":1,"totalSize":1,"done":true,"queryLocator":null,"entityTypeName":"Layout","records":[{"attributes":{"type":"Layout","url":"/services/data/v41.0/tooling/sobjects/Layout/00h28000001ReZhAAK"},"Id":"00h28000001ReZhAAK","Name":"Order Product Layout","TableEnumOrId":"OrderItem","LayoutType":"Standard"}]}')); |
| | | MetaDataUtility.GetRecordTypePageLayout(null, 'OrderItem'); |
| | | Test.setMock(HttpCalloutMock.class, new CalloutMockContainer('{"size":4,"totalSize":4,"done":true,"queryLocator":null,"entityTypeName":"ProfileLayout","records":[{"attributes":{"type":"ProfileLayout","url":"/services/data/v41.0/tooling/sobjects/ProfileLayout/01G0T00000AowJEUAZ"},"Layout":{"attributes":{"type":"Layout","url":"/services/data/v41.0/tooling/sobjects/Layout/00h28000001ReZOAA0"},"Name":"Case Layout","TableEnumOrId":"Case"},"ProfileId":"00e28000000wAuNAAU","Profile":{"attributes":{"type":"Profile","url":"/services/data/v41.0/tooling/sobjects/Profile/00e28000000wAuNAAU"},"Name":"系统管理员"},"RecordTypeId":"0120T00000023R0QAI"},{"attributes":{"type":"ProfileLayout","url":"/services/data/v41.0/tooling/sobjects/ProfileLayout/01G0T00000AowMSUAZ"},"Layout":{"attributes":{"type":"Layout","url":"/services/data/v41.0/tooling/sobjects/Layout/00h0T000000dswbQAA"},"Name":"Case LayoutApproval","TableEnumOrId":"Case"},"ProfileId":"00e28000000wAuNAAU","Profile":{"attributes":{"type":"Profile","url":"/services/data/v41.0/tooling/sobjects/Profile/00e28000000wAuNAAU"},"Name":"系统管理员"},"RecordTypeId":"0120T00000023R5QAI"},{"attributes":{"type":"ProfileLayout","url":"/services/data/v41.0/tooling/sobjects/ProfileLayout/01G0T00000AowPgUAJ"},"Layout":{"attributes":{"type":"Layout","url":"/services/data/v41.0/tooling/sobjects/Layout/00h0T000000dswbQAA"},"Name":"Case LayoutApproval","TableEnumOrId":"Case"},"ProfileId":"00e28000000wAuNAAU","Profile":{"attributes":{"type":"Profile","url":"/services/data/v41.0/tooling/sobjects/Profile/00e28000000wAuNAAU"},"Name":"系统管理员"},"RecordTypeId":"0120T00000023RAQAY"},{"attributes":{"type":"ProfileLayout","url":"/services/data/v41.0/tooling/sobjects/ProfileLayout/01G2800000HvfFWEAZ"},"Layout":{"attributes":{"type":"Layout","url":"/services/data/v41.0/tooling/sobjects/Layout/00h28000001ReZOAA0"},"Name":"Case Layout","TableEnumOrId":"Case"},"ProfileId":"00e28000000wAuNAAU","Profile":{"attributes":{"type":"Profile","url":"/services/data/v41.0/tooling/sobjects/Profile/00e28000000wAuNAAU"},"Name":"系统管理员"},"RecordTypeId":null}]}')); |
| | | MetaDataUtility.GetRecordTypePageLayout(null, 'Case');*/ |
| | | |
| | | Test.setMock(HttpCalloutMock.class, new CalloutMockContainer('{"size":3,"totalSize":3,"done":true,"queryLocator":null,"entityTypeName":"ProfileLayout","records":[{"attributes":{"type":"ProfileLayout","url":"/services/data/v41.0/tooling/sobjects/ProfileLayout/01G2800000wKyt5EAC"},"Layout":{"attributes":{"type":"Layout","url":"/services/data/v41.0/tooling/sobjects/Layout/00h28000003OBy1AAG"},"Name":"Contact layout for dealer Approval","TableEnumOrId":"Contact"},"ProfileId":"00e28000000wAuNAAU","Profile":{"attributes":{"type":"Profile","url":"/services/data/v41.0/tooling/sobjects/Profile/00e28000000wAuNAAU"},"Name":"系统管理员"},"RecordTypeId":"01228000000PvwMAAS"},{"attributes":{"type":"ProfileLayout","url":"/services/data/v41.0/tooling/sobjects/ProfileLayout/01G2800000wKysdEAC"},"Layout":{"attributes":{"type":"Layout","url":"/services/data/v41.0/tooling/sobjects/Layout/00h28000001ReZNAA0"},"Name":"Contact Layout","TableEnumOrId":"Contact"},"ProfileId":"00e28000000wAuNAAU","Profile":{"attributes":{"type":"Profile","url":"/services/data/v41.0/tooling/sobjects/Profile/00e28000000wAuNAAU"},"Name":"系统管理员"},"RecordTypeId":"01228000000PvwLAAS"},{"attributes":{"type":"ProfileLayout","url":"/services/data/v41.0/tooling/sobjects/ProfileLayout/01G2800000HvfFYEAZ"},"Layout":{"attributes":{"type":"Layout","url":"/services/data/v41.0/tooling/sobjects/Layout/00h28000001ReZNAA0"},"Name":"Contact Layout","TableEnumOrId":"Contact"},"ProfileId":"00e28000000wAuNAAU","Profile":{"attributes":{"type":"Profile","url":"/services/data/v41.0/tooling/sobjects/Profile/00e28000000wAuNAAU"},"Name":"系统管理员"},"RecordTypeId":null}]}')); |
| | | MetaDataUtility.GetRecordTypePageLayout(null, 'Contact'); |
| | | |
| | | |
| | | } |
| | | |
| | | class CalloutMockContainer implements HttpCalloutMock { |
| | | |
| | | string body; |
| | | public CalloutMockContainer(string body){ |
| | | this.body = body; |
| | | } |
| | | |
| | | // 实现这个接口方法 |
| | | public HTTPResponse respond(HTTPRequest request) { |
| | | // 创建一个假的回应 |
| | | HttpResponse response = new HttpResponse(); |
| | | response.setHeader('Content-Type', 'application/json'); |
| | | response.setBody(body); |
| | | response.setStatus('ok'); |
| | | response.setStatusCode(200); |
| | | return response; |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | |
| | | public Boolean aftORbef { get; set; } |
| | | public Boolean aftORbef1 { get; set; } |
| | | |
| | | public String staticResource { get; private set; }// 20220311 PI改造 by Bright |
| | | public String contactstaticResource { get; private set; }// 20220311 PI改造 by Bright |
| | | |
| | | public NEWCreateSWOQuoteController() { |
| | | swoId = System.currentPageReference().getParameters().get('swoId'); |
| | | Id = System.currentPageReference().getParameters().get('Id'); |
| | |
| | | baseUrl += '/production'; |
| | | } |
| | | rtUrl = System.currentPageReference().getParameters().get('retURL'); |
| | | |
| | | staticResource = JSON.serialize(PIHelper.getPIIntegrationInfo('Quotes__c'));// 20220221 PI改造 by Bright |
| | | contactstaticResource = JSON.serialize(PIHelper.getPIIntegrationInfo('Contact'));// 20220221 PI改造 by Bright |
| | | } |
| | | |
| | | public NEWCreateSWOQuoteController(ApexPages.StandardController controller) { |
| | |
| | | if (String.isNotBlank(Id)) { |
| | | |
| | | List<Quotes__c> quotesList = new List<Quotes__c>(); |
| | | quotesList = [SELECT Id, |
| | | AWS_Data_Id__c,CONTACT_NAME__r.Name,CONTACT_NAME__r.AWS_Data_Id__c, // 20220311 PI改造 by Bright |
| | | Name, BILLING_SCHEDULE__c, BILL_TO__c, SHIP_TO__c, BILL_TO_SELECT__c, CATEGORY_1_INDUSTRY_SO__c, CATEGORY_2_USE_SO__c, COLLECTION_STATUS__c, CONTACT_EMAIL__c, CONTACT_FAX__c, CONTACT_NAME__c, CONTACT_PHONE__c, CONTRACT_NAME__c, CURRENCY__c, DATE__c, DISCOUNT_ITEM__c, DISCOUNT_ITEM_F__c, DISCOUNT_WORKFLOW_TYPE__c, EST_EXTENDED_COST__c, EST_GROSS_PROFIT__c, EST_GROSS_PROFIT_PERCENT__c, ESTIMATE__c, EXP_CLOSE__c, EXPIRES__c, FDA_REPORT_COMPLETE__c, GOVERNMENT_ORDER__c, GSA_ORDER__c, INCOTERM__c, INITIATE_APPROVAL_ROUTING__c, INVOICE_MESSAGING__c, IS_SELLER_IMPORTER_OF_RECORD__c, LEAD_SOURCE__c, LEAD_TIME__c, LOCATION__c, NO_CHARGE_TYPE__c, notSaveEmail__c, NSN__c, ONLINE_BILLING__c, ONLINE_BILLING_ADDRESS__c, OPPORTUNITY__c, ORDER_TYPE__c, PKMS_PO_FOR_RECEIPT__c, PO__c, PROBABILITY__c, PRODUCT_SEGMENT__c, QUOTE_TITLE__c, RATE__c, RepairPart__c, REVISION_NEEDED__c, RMA_NOTES__c, COMPANY__c, SALES_TEAM_AUTO_ASSIGNMENT_OVERRIDE__c, SALES_TEAM_AUTO_ASSIGN_ON_SAVE__c, SELECT_MESSAGE__c, SHIPPING_CARRIER__c, SHIPPING_COST__c, SHIPPING_TAX_CODE__c, SHIPPING_TAX_RATE__c, SHIP_TO_ENTITY_USE_CODE__c, SHIP_TO_SELECT__c, SHIP_VIA__c, STATUS__c, SUBSIDIARY__c, SUBTOTAL__c, SWO__c, SWOName__c, SWO_NUMBER__c, SWO_PART_NUMBERS__c, SWO_SERIAL__c, SWOStatus__c, TAX_ID__c, TAX_OVERRIDE__c, TERMS__c, TERMS_OVERRIDE__c, THROW_MESSAGE__c, TOTAL_TRANSACTION_ITEM_WEIGHT_KGS__c, VERTICAL_MARKET_SEGMENT_SO__c, QuotesType__c, CUSTOMER_MESSAGE__c, TOTAL__c, BILL_TO_ENTITY_USE_CODE__c, COMPANYId__c, COMPANYName__c, DISCOUNT_STATUS__c, DISCOUNT_STATUS_ROUTING__c, TAX_CODE__c, TAX_RATE__c, TAX__c, DISCOUNT__c, SWOStatusMark__c FROM Quotes__c WHERE Id = :Id]; |
| | | quotesList = [SELECT Id, Name, BILLING_SCHEDULE__c, BILL_TO__c, SHIP_TO__c, BILL_TO_SELECT__c, CATEGORY_1_INDUSTRY_SO__c, CATEGORY_2_USE_SO__c, COLLECTION_STATUS__c, CONTACT_EMAIL__c, CONTACT_FAX__c, CONTACT_NAME__c, CONTACT_PHONE__c, CONTRACT_NAME__c, CURRENCY__c, DATE__c, DISCOUNT_ITEM__c, DISCOUNT_ITEM_F__c, DISCOUNT_WORKFLOW_TYPE__c, EST_EXTENDED_COST__c, EST_GROSS_PROFIT__c, EST_GROSS_PROFIT_PERCENT__c, ESTIMATE__c, EXP_CLOSE__c, EXPIRES__c, FDA_REPORT_COMPLETE__c, GOVERNMENT_ORDER__c, GSA_ORDER__c, INCOTERM__c, INITIATE_APPROVAL_ROUTING__c, INVOICE_MESSAGING__c, IS_SELLER_IMPORTER_OF_RECORD__c, LEAD_SOURCE__c, LEAD_TIME__c, LOCATION__c, NO_CHARGE_TYPE__c, notSaveEmail__c, NSN__c, ONLINE_BILLING__c, ONLINE_BILLING_ADDRESS__c, OPPORTUNITY__c, ORDER_TYPE__c, PKMS_PO_FOR_RECEIPT__c, PO__c, PROBABILITY__c, PRODUCT_SEGMENT__c, QUOTE_TITLE__c, RATE__c, RepairPart__c, REVISION_NEEDED__c, RMA_NOTES__c, COMPANY__c, SALES_TEAM_AUTO_ASSIGNMENT_OVERRIDE__c, SALES_TEAM_AUTO_ASSIGN_ON_SAVE__c, SELECT_MESSAGE__c, SHIPPING_CARRIER__c, SHIPPING_COST__c, SHIPPING_TAX_CODE__c, SHIPPING_TAX_RATE__c, SHIP_TO_ENTITY_USE_CODE__c, SHIP_TO_SELECT__c, SHIP_VIA__c, STATUS__c, SUBSIDIARY__c, SUBTOTAL__c, SWO__c, SWOName__c, SWO_NUMBER__c, SWO_PART_NUMBERS__c, SWO_SERIAL__c, SWOStatus__c, TAX_ID__c, TAX_OVERRIDE__c, TERMS__c, TERMS_OVERRIDE__c, THROW_MESSAGE__c, TOTAL_TRANSACTION_ITEM_WEIGHT_KGS__c, VERTICAL_MARKET_SEGMENT_SO__c, QuotesType__c, CUSTOMER_MESSAGE__c, TOTAL__c, BILL_TO_ENTITY_USE_CODE__c, COMPANYId__c, COMPANYName__c, DISCOUNT_STATUS__c, DISCOUNT_STATUS_ROUTING__c, TAX_CODE__c, TAX_RATE__c, TAX__c, DISCOUNT__c, SWOStatusMark__c FROM Quotes__c WHERE Id = :Id]; |
| | | if (quotesList.size() > 0) { |
| | | QuotesPage = quotesList[0]; |
| | | } |
| | |
| | | // Mail 页面初始化 Start |
| | | List<String> mailIdList = new List<String>(); |
| | | |
| | | List<FileAddress__c> attList = new List<FileAddress__c>(); |
| | | Map<String, List<FileAddress__c>> attMap = new Map<String, List<FileAddress__c>>(); |
| | | List<Attachment> attList = new List<Attachment>(); |
| | | Map<String, List<Attachment>> attMap = new Map<String, List<Attachment>>(); |
| | | |
| | | Map<String, Mail_Merge__c> mailMap = new Map<String, Mail_Merge__c>([select id, FROM__c, ccName__c, SUBJECT__c, MESSAGE__c, DATE__c, toName__c, EMAIL_SENT__c from Mail_Merge__c where Quotes__c = :Id order by id]); |
| | | |
| | |
| | | if (mailMap != null) { |
| | | mailIdList.addAll(mailMap.keySet()); |
| | | |
| | | attList = [select id, Name, FileName__c,ParentRecordId__c from FileAddress__c where ParentRecordId__c in :mailIdList order by ParentRecordId__c, id]; |
| | | attList = [select id, Name, ParentId from Attachment where ParentId in :mailIdList order by ParentId, id]; |
| | | if (attList.size() > 0) { |
| | | for (FileAddress__c att : attList) { |
| | | if (attMap.containsKey(att.ParentRecordId__c)) { |
| | | attMap.get(att.ParentRecordId__c).add(att); |
| | | for (Attachment att : attList) { |
| | | if (attMap.containsKey(att.ParentId)) { |
| | | attMap.get(att.ParentId).add(att); |
| | | } else { |
| | | List<FileAddress__c> a = new List<FileAddress__c>(); |
| | | List<Attachment> a = new List<Attachment>(); |
| | | a.add(att); |
| | | attMap.put(att.ParentRecordId__c, a); |
| | | attMap.put(att.ParentId, a); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | //首先是从swo创建quotes,有了swoid,就是用新的静态资源显示的免责申明。 |
| | | //之后,编辑已经创建完了的quotes,15号之前创建的,显示的是旧的。旧的就是aftORbef==false。 |
| | | //当然,aftORbef==false具体指的是旧的也可以指查不到的(还没有存入数据库的,创建时)。 |
| | | if (String.isNotBlank(swoId)) { |
| | | aftORbef1 = true; |
| | | }else{ |
| | |
| | | if ('维修报价单'.equals(QuotesPage.QuotesType__c)) { |
| | | QuotesPage.CUSTOMER_MESSAGE__c = ''; |
| | | //日期2121年11月15号之后的,用新的免责申明。 |
| | | if (aftORbef == true) { |
| | | if (aftORbef == true || aftORbef1 == true) { |
| | | QuotesPage.CUSTOMER_MESSAGE__c += '-维修质保只涵盖于本次维修的配件,维修质保期为仪器发货后三个月加八天。\n'; |
| | | Messages01 = '-维修质保只涵盖于本次维修的配件,维修质保期为仪器发货后三个月加八天。'; |
| | | }else{ |
| | |
| | | Messages05 = '日期:'; |
| | | } else if ('零件报价单'.equals(QuotesPage.QuotesType__c)) { |
| | | QuotesPage.CUSTOMER_MESSAGE__c = ''; |
| | | QuotesPage.CUSTOMER_MESSAGE__c += '-奥林巴斯服务部售出的维修配件确保为质量符合奥林巴斯参数指标的新品,奥林巴斯对售出的维修配件不提供保修服务,同时也不提供退、换货服务。敬请您谨慎购买。\n'; |
| | | Messages01 = '-奥林巴斯服务部售出的维修配件确保为质量符合奥林巴斯参数指标的新品,奥林巴斯对售出的维修配件不提供保修服务,同时也不提供退、换货服务。敬请您谨慎购买。'; |
| | | if ('NDT'.equals(QuotesPage.PRODUCT_SEGMENT__c)) { |
| | | QuotesPage.CUSTOMER_MESSAGE__c += '-仪景通光学科技(上海)有限公司北京分公司售出的维修配件为奥林巴斯原厂配件,仪景通公司对售出的维修配件不提供保修服务,也不提供退、换货服务,敬请您谨慎购买。\n'; |
| | | Messages01 = '-仪景通光学科技(上海)有限公司北京分公司售出的维修配件为奥林巴斯原厂配件,仪景通公司对售出的维修配件不提供保修服务,也不提供退、换货服务,敬请您谨慎购买。'; |
| | | }else { |
| | | QuotesPage.CUSTOMER_MESSAGE__c += '-奥林巴斯服务部售出的维修配件确保为质量符合奥林巴斯参数指标的新品,奥林巴斯对售出的维修配件不提供保修服务,同时也不提供退、换货服务。敬请您谨慎购买。\n'; |
| | | Messages01 = '-奥林巴斯服务部售出的维修配件确保为质量符合奥林巴斯参数指标的新品,奥林巴斯对售出的维修配件不提供保修服务,同时也不提供退、换货服务。敬请您谨慎购买。'; |
| | | } |
| | | QuotesPage.CUSTOMER_MESSAGE__c += '-用户在此确认此次报价,决定购买:\n'; |
| | | Messages02 = '-用户在此确认此次报价,决定购买:'; |
| | | QuotesPage.CUSTOMER_MESSAGE__c += '客户签字或盖章:\n'; |
| | |
| | | |
| | | if (String.isNotBlank(swoId)) { |
| | | QuotesPage.SWO__c = swoId; |
| | | //日期2121年11月15号之后的,用新的免责申明。 |
| | | aftORbef = true; |
| | | } |
| | | if (!'Cancel'.equals(QuotesPage.STATUS__c)) { |
| | |
| | | public class EmailInfo { |
| | | |
| | | public Mail_Merge__c mm {get; set; } |
| | | public List<FileAddress__c> attList {get; set; } |
| | | public List<Attachment> attList {get; set; } |
| | | public String haveAtt {get; set;} |
| | | public EmailInfo() { |
| | | |
| | | } |
| | | public EmailInfo(Mail_Merge__c mm_in, List<FileAddress__c> attList_in) { |
| | | public EmailInfo(Mail_Merge__c mm_in, List<Attachment> attList_in) { |
| | | mm = mm_in; |
| | | if (attList_in == null || attList_in.size() == 0) { |
| | | haveAtt = 'No'; |
| | | attList = new List<FileAddress__c>(); |
| | | attList = new List<Attachment>(); |
| | | } else { |
| | | attList = attList_in; |
| | | haveAtt = 'Yes'; |
| | |
| | | @isTest |
| | | private class NEWCreateSWOQuoteControllerTest { |
| | | |
| | | @TestSetup |
| | | static void setup(){ |
| | | TestDataUtility.CreatePIPolicyConfigurations(new string[]{'Quotes__c','Contact'}); |
| | | } |
| | | |
| | | static testMethod void QuotesIdIsNull() { |
| | | |
| | | List<RecordType> rectIE = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = 'Customer IE']; |
| | |
| | | webservice String TransmissionDateTime; |
| | | webservice String Text; |
| | | } |
| | | //add for pipl sushanhu 20220311 start |
| | | /*public static response sendToPiAWS(String rowDataStr, String endpoint,String awsToken) { |
| | | |
| | | Http http = new Http(); |
| | | HttpRequest req = new HttpRequest(); |
| | | HTTPResponse res; |
| | | String resb; |
| | | req.setHeader('Content-Type', 'application/json'); |
| | | req.setTimeout(120000); |
| | | req.setEndpoint(endpoint); |
| | | req.setMethod('POST'); |
| | | req.setHeader('pi-token', awsToken); |
| | | req.setBody(rowDataStr); |
| | | res = http.send(req); |
| | | string ress = String.valueOf(res.getStatusCode()) ; |
| | | resb = res.getBody(); |
| | | system.debug('ress:' + ress); |
| | | return new response(ress, resb); |
| | | } |
| | | |
| | | public static response getAwsToken(){ |
| | | String responseBody = AWSServiceTool.getAWSToken(); |
| | | return new response('success', responseBody); |
| | | } |
| | | public class response { |
| | | public string status; |
| | | public string responseBody; |
| | | public response(string status, string responseBody ) { |
| | | this.status = status; |
| | | this.responseBody = responseBody; |
| | | } |
| | | }*/ |
| | | //add for pipl sushanhu 20220311 end |
| | | /** |
| | | * @return yyyyMMdd の日付文字列 |
| | | */ |
| | |
| | | } |
| | | return result; |
| | | } |
| | | //add for pipl sushanhu 20220311 start |
| | | /*global class NFMResponse{ |
| | | public Boolean SFStatus; |
| | | public String SFMessage; |
| | | public StaticResponse staticResponse; |
| | | } |
| | | global class StaticResponse{ |
| | | public string status; |
| | | public String Message; |
| | | public StaticResponse(){ |
| | | status='0'; |
| | | Message=''; |
| | | } |
| | | } |
| | | public static NFMResponse getNFMResponse(){ |
| | | NFMResponse result=new NFMResponse(); |
| | | result.staticResponse =new StaticResponse(); |
| | | return result; |
| | | |
| | | }*/ |
| | | //add for pipl sushanhu 20220311 end |
| | | |
| | | public static Boolean EscapeSBG001TriggerHandler = false; |
| | | |
| | | } |
| | |
| | | // Contact con = TestDataUtility.CreateContacts(1)[0]; |
| | | Account acc = TestDataUtility.CreateAccounts(1)[0]; |
| | | Contact con = new Contact(); |
| | | String url = ApexPages.currentPage().getParameters().put('retURL','/'+acc.Id); |
| | | String url = ApexPages.currentPage().getParameters().put('con4_lkid',acc.Id); |
| | | |
| | | Test.startTest(); |
| | | ApexPages.StandardController sc = new ApexPages.StandardController(con); |
| | |
| | | |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock()); |
| | | // Contact contactTest = TestDataUtility.CreateContacts(1)[0]; |
| | | // Account acc = TestDataUtility.CreateAccounts(1)[0]; |
| | | //Account acc = TestDataUtility.CreateAccounts(1)[0]; |
| | | //Account acc1 = [SELECT Id,Name FROM Account WHERE RecordType.DeveloperName = 'Office' OR RecordType.DeveloperName = 'AgencyContact' OR RecordType.DeveloperName = 'Agency' Limit 1]; |
| | | String accrecordTypeId = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('Agency').getRecordTypeId(); |
| | | String accrecordTypeId = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('Dealer').getRecordTypeId(); |
| | | Account acc1 = new Account(Name = 'testacc1',RecordTypeId = accrecordTypeId,ProductSegment__c='BS'); |
| | | insert acc1; |
| | | Contact contact = new Contact(); |
| | |
| | | } |
| | | static testMethod void NewAndEditLoanerApplicationController() { |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock()); |
| | | loaner_application__c la = TestDataUtility.Createloanerapplications(1)[0]; |
| | | loaner_application__c la = new loaner_application__c(); |
| | | //loaner_application__c la = TestDataUtility.Createloanerapplications(1)[0]; |
| | | |
| | | Test.startTest(); |
| | | ApexPages.StandardController con = new ApexPages.StandardController(la); |
| | |
| | | } |
| | | static testMethod void NewAndEditOpportunityController() { |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock()); |
| | | Opportunity opp = TestDataUtility.CreateOpportunitys(1)[0]; |
| | | Opportunity opp = new Opportunity(); |
| | | //Opportunity opp = TestDataUtility.CreateOpportunitys(1)[0]; |
| | | |
| | | Test.startTest(); |
| | | Map<string,string> mso = ApexPages.currentPage().getParameters(); |
| | | mso.put('accid', 'value'); |
| | | mso.put('conId', 'value'); |
| | | ApexPages.StandardController sc = new ApexPages.StandardController(opp); |
| | | NewAndEditOpportunityController qis = new NewAndEditOpportunityController(sc); |
| | | qis.contactId = 'test'; |
| | | qis.primaryContactId = 'test'; |
| | | |
| | | String qisJson = '{"Is_Decided__c":false,"the_Upload_of_quotation_number__c":"","Cancel_Fail_Approve__c":"","SAP_QuotationCode__c":"","compo_opp__c":false,"CanChangeOpp__c":true,"Name":"test1","AccountId":"0010l00001Q1r4e","RecordTypeId":"012280000005hjO","Type":"","ApprovalStatus_D__c":"Draft","ProductSegment__c":"IE","SpecialPriceApproveStatus__c":"","BudgetAmount__c":"","Machine_Parts__c":"Machine","Amount":"","CurrencyIsoCode":"CNY","customerType__c":"","IsFirstDecide__c":false,"IE_need_business_approve__c":false,"IE_Discount_Special__c":"","IE_ShippingHandling__c":"","IE_local_cost__c":"","IE_Custom_Price__c":"","IE_Payment_terms__c":"","StockAnswerSummary__c":"","Phase1Date__c":"","InquiryResult__c":"","Phase2Date__c":"","ExpectedOrderDate__c":"","Phase3Date__c":"","ExpectedDeliveryDate__c":"","Order_Date__c":"","DeliveryDate__c":"","InquiryResultOrder__c":"","LeadSource":"","TradeType__c":"Taxation","CustomerSourceIE__c":"","SalesChannel__c":"dealer","Trade_Type_D__c":"Taxation","Dealer__c":"0010l00001Pj768","DealerSalesStaffName__c":"***","DealerService__c":"***","SubDealer__c":"test","Dealer_Sales_Staff_Name_D__c":"***","Dealer_Service_D__c":"***","Competitor_Product__c":"","CompetitorProductCode__c":"","Competitor_Product2__c":"","CompetitorProductCode2__c":"","Competitor_Product3__c":"","CompetitorProductCode3__c":"","Competitor_Product4__c":"","CompetitorProductCode4__c":"","Competitor_Product5__c":"","CompetitorProductCode5__c":"","Competitor_Product6__c":"","CompetitorProductCode6__c":"","Competitor_Product7__c":"","CompetitorProductCode7__c":"","Competitor_Product8__c":"","CompetitorProductCode8__c":"","CompetitorCompany__c":"_0001_","LostAmount__c":"","LostCompetitorProduct__c":"","InquiryResultLost__c":"","LostReason__c":"","LostReasonText__c":"","CancelReason__c":"","InquiryResultCancel__c":"","CancelReasonText__c":"","Have_Computer__c":false,"Remark__c":"","NewInquiryDate__c":"2022-4-8","StageName":"Prospect Created","Probability":"","OppUpdateDateTime__c":"","CloseDate":"2022-4-8","ProductSegmentCompetitor__c":"","IsNew__c":false,"OpportunityAmount_text__c":"","OpportunityLineItem_text__c":"","OpportunityLineItemOT_text__c":"","IsSendEmail__c":true,"IsUpdate__c":false,"OppUpdateDate__c":"","DealerSalesStaffName_Encrypted__c":"dcce196c4cfc273a83777852ddd486ab","Dealer_Sales_Staff_Name_D_Encrypted__c":"dcce196c4cfc273a83777852ddd486ab","DealerService_Encrypted__c":"dcce196c4cfc273a83777852ddd486ab","Dealer_Service_D_Encrypted__c":"dcce196c4cfc273a83777852ddd486ab","AWS_Data_Id__c":"961991622629785601"}'; |
| | | NewAndEditOpportunityController.saveOpportunity(qisJson,'avgwshDFcxAS',False); |
| | |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock()); |
| | | Order od = TestDataUtility.CreateOrders(1)[0]; |
| | | |
| | | |
| | | |
| | | |
| | | Test.startTest(); |
| | | ApexPages.StandardController sc = new ApexPages.StandardController(od); |
| | | NewAndEditOrderController qis = new NewAndEditOrderController(sc); |
| | |
| | | } |
| | | static testMethod void NewAndEditQuotesController() { |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock()); |
| | | Quotes__c uf = TestDataUtility.CreateQuotes(1)[0]; |
| | | //Quotes__c uf = TestDataUtility.CreateQuotes(1)[0]; |
| | | Quotes__c uf = new Quotes__c(); |
| | | |
| | | Test.startTest(); |
| | | ApexPages.StandardController con = new ApexPages.StandardController(uf); |
| | |
| | | |
| | | public String ProductSegment { get; set; } |
| | | |
| | | public String staticResource {get; set;} |
| | | |
| | | public String oppid {get; set;} |
| | | |
| | | public NewCrossHighOpportunityController() { |
| | | baseUrl = URL.getSalesforceBaseUrl().toExternalForm(); |
| | | String path = URL.getCurrentRequestUrl().getPath(); |
| | |
| | | |
| | | accId = System.currentPageReference().getParameters().get('accid'); |
| | | conId = System.currentPageReference().getParameters().get('conId'); |
| | | |
| | | staticResource = JSON.serialize(PIHelper.getPIIntegrationInfo('Opportunity')); |
| | | |
| | | List<Account> accList = [select Id, Name, ProductSegment__c,OwnerID__c from Account where Id = :accId]; |
| | | if (accList.size() > 0) { |
| | |
| | | |
| | | hasError = false; |
| | | |
| | | oppid = opp.id; |
| | | // String url = baseUrl + '\\' + opp.Id; |
| | | // return new Pagereference(url); |
| | | return null; |
| | | String url = baseUrl + '\\' + opp.Id; |
| | | return new Pagereference(url); |
| | | } catch (Exception e) { |
| | | Database.rollback(sp); |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, e.getMessage())); |
| | |
| | | @isTest |
| | | private class NewCrossRegionalControllerText { |
| | | |
| | | @TestSetup |
| | | static void setup(){ |
| | | TestDataUtility.CreatePIPolicyConfigurations(new string[]{'Opportunity','SBG001','Contact'}); |
| | | } |
| | | |
| | | static testMethod void testMethod1() { |
| | | List<RecordType> rectIE = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = 'Customer IE']; |
| | | Account accIE = new Account( |
| | |
| | | TradeType__c = 'Taxation' |
| | | ); |
| | | insert opp1; |
| | | |
| | | OpportunityContactRole ocr = new OpportunityContactRole(OpportunityId=opp1.Id,ContactId=con.Id,Role = 'End user' , IsPrimary = true); |
| | | insert ocr; |
| | | |
| | | |
| | | |
| | | |
| | | PageReference page = new PageReference('/apex/NewCrossHighOpportunity?accid=' + accIE.Id + '&conId=' + con.Id); |
| | | System.Test.setCurrentPage(page); |
| | |
| | | TradeType__c = 'Taxation' |
| | | ); |
| | | insert opp1; |
| | | |
| | | OpportunityContactRole ocr = new OpportunityContactRole(OpportunityId=opp1.Id,ContactId=con.Id,Role = 'End user' , IsPrimary = true); |
| | | insert ocr; |
| | | |
| | | PageReference page = new PageReference('/apex/NewCrossRegionalSalesOpportunity?accid=' + accIE.Id + '&conId=' + con.Id); |
| | | System.Test.setCurrentPage(page); |
| | |
| | | |
| | | public Boolean isIEDealer{get; set; } |
| | | |
| | | public String staticResource {get; set;} |
| | | |
| | | public String oppid {get; set;} |
| | | |
| | | public NewCrossRegionalSalesController() { |
| | | baseUrl = URL.getSalesforceBaseUrl().toExternalForm(); |
| | | String path = URL.getCurrentRequestUrl().getPath(); |
| | |
| | | accId = System.currentPageReference().getParameters().get('accid'); |
| | | conId = System.currentPageReference().getParameters().get('conId'); |
| | | |
| | | staticResource = JSON.serialize(PIHelper.getPIIntegrationInfo('Opportunity')); |
| | | |
| | | List<Account> accList = [select Id, Name, ProductSegment__c,compo_Acc__c,UserType__c from Account where Id = :accId]; |
| | | if (accList.size() > 0) { |
| | | acc = accList[0]; |
| | | } |
| | | |
| | | List<Contact> conList = [select Id, Name from Contact where Id = :conId];//pi |
| | | List<Contact> conList = [select Id, Name from Contact where Id = :conId]; |
| | | if (conList.size() > 0) { |
| | | con = conList[0]; |
| | | } |
| | |
| | | |
| | | hasError = false; |
| | | |
| | | // String url = baseUrl + '\\' + opp.Id; |
| | | // return new Pagereference(url); |
| | | oppid = opp.id; |
| | | return null; |
| | | String url = baseUrl + '\\' + opp.Id; |
| | | return new Pagereference(url); |
| | | } catch (Exception e) { |
| | | Database.rollback(sp); |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, e.getMessage())); |
| | |
| | | |
| | | if (diagnosisPart.DELIVERED__c == false && String.isBlank(diagnosisPart.Id)) { |
| | | Boolean isUpdateSwo = false; |
| | | List<SWO__c> swoList = [select Id,Diagnose_part_not_delievered_1__c,Diagnose_part_not_delievered_2__c,Diagnose_part_not_delievered_3__c from SWO__c where Id=:diagnosisPart.SWO__c]; |
| | | System.debug('swoList.size():'+swoList.size()); |
| | | List<SWO__c> swoList = [select Diagnose_part_not_delievered_1__c,Diagnose_part_not_delievered_2__c,Diagnose_part_not_delievered_3__c from SWO__c where Id=:diagnosisPart.SWO__c]; |
| | | if (swoList!=null && swoList.size()!=0) { |
| | | SWO__c swo = swoList[0]; |
| | | if(String.isBlank(swo.Diagnose_part_not_delievered_1__c)){ |
| | |
| | | isUpdateSwo = true; |
| | | swo.Diagnose_part_not_delievered_3__c = diagnosisPart.PART_NUMBER__c; |
| | | } |
| | | System.debug('swo.Id:'+swo.Id); |
| | | if(isUpdateSwo) update swo; |
| | | } |
| | | } |
| | |
| | | |
| | | public String ProductSegment { get; set; } |
| | | |
| | | public String staticResource {get; set;} |
| | | |
| | | public String oppid {get; set;} |
| | | |
| | | public NewHighProductsOppController() { |
| | | baseUrl = URL.getSalesforceBaseUrl().toExternalForm(); |
| | | String path = URL.getCurrentRequestUrl().getPath(); |
| | |
| | | |
| | | accId = System.currentPageReference().getParameters().get('accid'); |
| | | conId = System.currentPageReference().getParameters().get('conId'); |
| | | staticResource = JSON.serialize(PIHelper.getPIIntegrationInfo('Opportunity')); |
| | | |
| | | List<Account> accList = [select Id, Name, ProductSegment__c,OwnerID__c from Account where Id = :accId]; |
| | | if (accList.size() > 0) { |
| | |
| | | opp.AccountId = acc.Id; |
| | | opp.Account = acc; |
| | | opp.ProductSegment__c = acc.ProductSegment__c; |
| | | opp.Type = 'Not Traget'; |
| | | opp.Type = '非目标'; |
| | | opp.SalesChannel__c = 'dealer'; |
| | | opp.NewInquiryDate__c = Date.today(); |
| | | opp.StageName = 'Prospect Created'; |
| | |
| | | insert ocr; |
| | | |
| | | hasError = false; |
| | | oppid = opp.id; |
| | | // String url = baseUrl + '\\' + opp.Id; |
| | | // return new Pagereference(url); |
| | | return null; |
| | | |
| | | String url = baseUrl + '\\' + opp.Id; |
| | | return new Pagereference(url); |
| | | } catch (Exception e) { |
| | | Database.rollback(sp); |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, e.getMessage())); |
| | |
| | | @isTest |
| | | private class NewHighProductsOppControllerTest { |
| | | |
| | | @TestSetup |
| | | static void setup(){ |
| | | TestDataUtility.CreatePIPolicyConfigurations(new string[]{'Opportunity','SBG001','Contact'}); |
| | | } |
| | | |
| | | @isTest static void test_method_one() { |
| | | List<RecordType> rectIE = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = 'Customer BS']; |
| | | Account accIE = new Account( |
| | |
| | | public String contactID {get; private set;} |
| | | |
| | | public loaner_application__c la{get; private set;} |
| | | |
| | | // Update 20220318 By Yang Kaiyu Start |
| | | public loaner_user__c lu {get; private set;} |
| | | |
| | | public Contact con {get; private set;} |
| | | // Update 20220318 By Yang Kaiyu End |
| | | |
| | | public String typeName {get; private set;} |
| | | |
| | | public String userType {get; private set;} |
| | | |
| | | public String baseUrl { get; set; } |
| | | public String rtUrl { get; set; } |
| | | |
| | | // Update 20220318 By Yang Kaiyu Start |
| | | public String staticResource {get; set;} |
| | | public String staticResourceContact {get; set;} |
| | | public String staticResourceLoanerUser {get; set;} |
| | | |
| | | public String laid {get; set;} |
| | | // Update 20220318 By Yang Kaiyu End |
| | | |
| | | public NewLoanerApplicationController() { |
| | | baseUrl = URL.getSalesforceBaseUrl().toExternalForm(); |
| | |
| | | userType = UserInfo.getUserType(); |
| | | accountID = System.currentPageReference().getParameters().get('accid'); |
| | | contactID = System.currentPageReference().getParameters().get('conId'); |
| | | // Update 20220318 By Yang Kaiyu End |
| | | staticResource = JSON.serialize(PIHelper.getPIIntegrationInfo('loaner_application__c')); |
| | | staticResourceContact = JSON.serialize(PIHelper.getPIIntegrationInfo('Contact')); |
| | | staticResourceLoanerUser = JSON.serialize(PIHelper.getPIIntegrationInfo('loaner_user__c')); |
| | | // Update 20220318 By Yang Kaiyu End |
| | | |
| | | Account acc = [select id,ProductSegment__c from Account where id = :accountID]; |
| | | typeName = acc.ProductSegment__c; |
| | |
| | | .get(typeName).getRecordTypeId(); |
| | | |
| | | la = new loaner_application__c(); |
| | | // Update 20220318 By Yang Kaiyu End |
| | | lu = new loaner_user__c(); |
| | | con = new Contact(); |
| | | // Update 20220318 By Yang Kaiyu End |
| | | la.RecordTypeId= recordTypeId; |
| | | if(typeName == 'BS' && userType != 'Standard'){ |
| | | la.RecordTypeId = System.label.bs_D_ID; |
| | | } |
| | | System.debug(la.RecordTypeId); |
| | | //ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error,accountID)); |
| | | // Update 20220318 By Yang Kaiyu End |
| | | con = [select id,AWS_Data_Id__c,Phone,Phone_Encrypted__c,Name,LastName_Encrypted__c,Address1__c from Contact where id = :contactID]; |
| | | // Update 20220318 By Yang Kaiyu End |
| | | return null; |
| | | } |
| | | |
| | |
| | | Savepoint sp = Database.setSavepoint(); |
| | | try { |
| | | insert la; |
| | | |
| | | // loaner_user__c lu = new loaner_user__c(); // Update 20220412 By Chen Yanan |
| | | |
| | | loaner_user__c lu = new loaner_user__c(); |
| | | lu.loaner_application__c = la.id; |
| | | lu.Customer__c = accountID; |
| | | // Update 20220318 By Yang Kaiyu Start |
| | | // System.debug('lu------------'+lu); |
| | | // if(contactID != null){ |
| | | // lu.Contact__c = contactID; |
| | | // Contact contact = [select id,AWS_Data_Id__c,Phone,Phone_Encrypted__c,Name,LastName_Encrypted__c,Address1__c from Contact where id = :contactID]; |
| | | // lu.ContactNumber__c = contact.Phone; |
| | | |
| | | if(contactID != null){ |
| | | lu.Contact__c = contactID; |
| | | Contact contact = [select id,Phone,Name,Address1__c from Contact where id = :contactID]; |
| | | lu.ContactNumber__c = contact.Phone; |
| | | |
| | | // } |
| | | // Update 20220318 By Yang Kaiyu End |
| | | } |
| | | |
| | | insert lu; |
| | | // Update 20220318 By Yang Kaiyu Start |
| | | laid = la.id; |
| | | // String url = baseUrl + '\\' + la.Id; |
| | | // return new Pagereference(url); |
| | | return null; |
| | | // Update 20220318 By Yang Kaiyu End |
| | | String url = baseUrl + '\\' + la.Id; |
| | | return new Pagereference(url); |
| | | } catch (Exception e) { |
| | | Database.rollback(sp); |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, e.getMessage())); |
| | |
| | | @isTest |
| | | private class NewLoanerApplicationControllerTest { |
| | | |
| | | @TestSetup |
| | | static void setup(){ |
| | | TestDataUtility.CreatePIPolicyConfigurations(new string[]{'Opportunity','SBG001','Contact','loaner_application__c','loaner_user__c'}); |
| | | } |
| | | |
| | | static void setupTestData() { |
| | | OlympusCalendar__c oc1 = new OlympusCalendar__c(Date__c = Date.today().addDays(1), ChangeToHoliday__c=false, ChangeToWorkday__c=true); |
| | | OlympusCalendar__c oc2 = new OlympusCalendar__c(Date__c = Date.today().addDays(2), ChangeToHoliday__c=false, ChangeToWorkday__c=true); |
| | |
| | | public List<loaner_user__c> dataLines {get; private set;} |
| | | //订单Id |
| | | public String laId {get; private set;} |
| | | // Update 20220317 By Yang Kaiyu Start |
| | | public String staticResource {get; set;} |
| | | public String staticResourceContact {get; set;} |
| | | //PI contact |
| | | public List<ContactClass> conList {get;set;} |
| | | |
| | | public String contactId {get;set;} |
| | | public string conListJson {get{ |
| | | if(conList==null)return null; |
| | | return JSON.serialize(conList); |
| | | }} |
| | | public String dataLinesJson{get{ |
| | | if(dataLines==null)return null; |
| | | return JSON.serialize(dataLines); |
| | | }} |
| | | class ContactClass{ |
| | | public String contactIdValue{set;get;} |
| | | public String contactNameValue{set;get;} |
| | | public String contactPhoneValue{set;get;} |
| | | } |
| | | // Update 20220317 By Yang Kaiyu End |
| | | // |
| | | /*public NewLoanerUserController() { |
| | | laId = System.currentPageReference().getParameters().get('headId'); |
| | | //ApexPages.currentPage().getParameters().get('headId'); |
| | |
| | | }else{ |
| | | loaner_user__c lu = [select id,loaner_application__c from loaner_user__c where id = :luId]; |
| | | laId = lu.loaner_application__c; |
| | | } |
| | | // Update 20220317 By Yang Kaiyu Start |
| | | staticResource = JSON.serialize(PIHelper.getPIIntegrationInfo('loaner_user__c')); |
| | | staticResourceContact = JSON.serialize(PIHelper.getPIIntegrationInfo('contact')); |
| | | conList = new List<ContactClass>(); |
| | | // Update 20220317 By Yang Kaiyu End |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | baseUrl += '/production'; |
| | | } |
| | | dataLines = new List<loaner_user__c>(); |
| | | // Update 20220317 By Yang Kaiyu Start |
| | | luList = [select id,Contact__r.AWS_Data_Id__c,Contact__c,Contact__r.LastName,Contact__r.Phone,Contact__r.LastName_Encrypted__c,Contact__r.Phone_Encrypted__c,ContactNumber__c, |
| | | FromThePeriod__c,EndThePeriod__c,Remarks__c,Customer__c,Follow_UP_Opp__c |
| | | from loaner_user__c |
| | | where loaner_application__c =:laId]; |
| | | // Update 20220317 By Yang Kaiyu End |
| | | luList = [select id,Contact__c,ContactNumber__c,FromThePeriod__c,EndThePeriod__c,Remarks__c,Customer__c,Follow_UP_Opp__c from loaner_user__c where loaner_application__c =:laId]; |
| | | if(luList.size() >0){ |
| | | for(loaner_user__c lu : luList){ |
| | | // Update 20220317 By Yang Kaiyu Start |
| | | ContactClass con = new ContactClass(); |
| | | con.contactIdValue = lu.Contact__r.AWS_Data_Id__c; |
| | | con.contactNameValue = lu.Contact__r.LastName_Encrypted__c; |
| | | con.contactPhoneValue= lu.Contact__r.Phone_Encrypted__c; |
| | | conList.add(con); |
| | | // Update 20220317 By Yang Kaiyu End |
| | | dataLines.add(lu); |
| | | } |
| | | } |
| | |
| | | |
| | | public PageReference updateUser() { |
| | | |
| | | System.debug('进入updateUser'); |
| | | |
| | | List<loaner_user__c> updateList = new List<loaner_user__c>(); |
| | | loaner_application__c la =[select id,RecordType.DeveloperName from loaner_application__c where id=:laId]; |
| | | List<String> contactIdList = new List<String>(); |
| | |
| | | String firstLuId = ''; |
| | | String accountName = ''; |
| | | List<String> idList = new List<String>(); |
| | | System.debug('dataLines = ' + dataLines); |
| | | for(loaner_user__c luc : dataLines){ |
| | | if(!(String.isBlank(luc.Contact__c) || luc.Customer__c == null)){ |
| | | loaner_user__c lu = new loaner_user__c(); |
| | |
| | | @isTest |
| | | private class NewLoanerUserControllerTest { |
| | | |
| | | @TestSetup |
| | | static void setup(){ |
| | | TestDataUtility.CreatePIPolicyConfigurations(new string[]{'loaner_user__c','Contact'}); |
| | | } |
| | | |
| | | static void setupTestData() { |
| | | OlympusCalendar__c oc1 = new OlympusCalendar__c(Date__c = Date.today().addDays(1), ChangeToHoliday__c=false, ChangeToWorkday__c=true); |
| | | OlympusCalendar__c oc2 = new OlympusCalendar__c(Date__c = Date.today().addDays(2), ChangeToHoliday__c=false, ChangeToWorkday__c=true); |
| | |
| | | |
| | | public Boolean isIEDealer{get; set; } |
| | | |
| | | public String staticResource {get; set;} |
| | | public String opportunityAWSDataId{get; set;} |
| | | |
| | | public NewOpportunityController() { |
| | | baseUrl = URL.getSalesforceBaseUrl().toExternalForm(); |
| | | String path = URL.getCurrentRequestUrl().getPath(); |
| | |
| | | if(acc.compo_Acc__c == 'COMPO客户' && acc.ProductSegment__c == 'IE'){ |
| | | opp.compo_opp__c = true; |
| | | } |
| | | if(acc.UserType__c == 'OEM客户' && acc.ProductSegment__c == 'BS'){ |
| | | /*if(acc.UserType__c == 'OEM客户' && acc.ProductSegment__c == 'BS'){ |
| | | opp.useing__c = 'OEM'; |
| | | } |
| | | }*/ |
| | | opp.AccountId = acc.Id; |
| | | opp.Account = acc; |
| | | opp.ProductSegment__c = acc.ProductSegment__c; |
| | |
| | | opp.Dealer__c = dealerId; |
| | | } |
| | | |
| | | staticResource = JSON.serialize(PIHelper.getPIIntegrationInfo('Opportunity')); |
| | | return null; |
| | | } |
| | | |
| | |
| | | @isTest |
| | | private class NewOpportunityControllerTest { |
| | | |
| | | @TestSetup |
| | | static void setup(){ |
| | | TestDataUtility.CreatePIPolicyConfigurations(new string[]{'Opportunity','SBG001','Contact'}); |
| | | } |
| | | |
| | | @isTest static void test_method_one() { |
| | | List<RecordType> rectIE = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = 'Customer IE']; |
| | |
| | | public String swoId{get;set;} |
| | | public String repairId{get;set;} |
| | | public Boolean pageClose{get;set;} |
| | | public String baseUrl{get;set;} |
| | | public String productId{get;set;} |
| | | |
| | | /*public NewRepairPartsController(ApexPages.StandardController stdController) { |
| | | swoId = System.currentPageReference().getParameters().get('swoId'); |
| | | }*/ |
| | |
| | | } |
| | | |
| | | public void init(){ |
| | | baseUrl = URL.getSalesforceBaseUrl().toExternalForm(); |
| | | String path = URL.getCurrentRequestUrl().getPath(); |
| | | if (path.indexOf('/apex') > 0) { |
| | | baseUrl += path.substring(0, path.indexOf('/apex')); |
| | | } else if (path.indexOf('production/') > 0) { |
| | | baseUrl += '/production'; |
| | | } |
| | | if(String.isNotBlank(repairId)){ |
| | | Schema.DescribeSobjectResult repairPartType = RepairPart__c.sObjectType.getDescribe(); |
| | | Map<String, Schema.SObjectField> repairPart_fields = repairPartType.fields.getMap(); |
| | |
| | | return; |
| | | }else{ |
| | | return; |
| | | } |
| | | } |
| | | |
| | | public void productReturn(){ |
| | | if(String.isNotBlank(productId)){ |
| | | List<Product2> productList = [SELECT Id, Name, Product_ECCode__c, Description, ProductCode FROM Product2 WHERE Id = :productId limit 1]; |
| | | if(productList!=null && productList.size()!=0){ |
| | | repairPart.PART_NUMBER__c = productList[0].Product_ECCode__c; |
| | | repairPart.DESCRIPTION__c = productList[0].Description; |
| | | repairPart.ITEM__c = productList[0].ProductCode; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | public String rtUrl { get; set; } |
| | | |
| | | public String ProductSegment { get; set; } |
| | | public String staticResource {get; set;} |
| | | public String opportunityAWSDataId{get; set;} |
| | | |
| | | public NewReplacementOpportunityController() { |
| | | baseUrl = URL.getSalesforceBaseUrl().toExternalForm(); |
| | |
| | | opp.AccountId = acc.Id; |
| | | opp.Account = acc; |
| | | opp.ProductSegment__c = acc.ProductSegment__c; |
| | | opp.Type = 'Not Traget'; |
| | | opp.Type = '非目标'; |
| | | opp.SalesChannel__c = 'dealer'; |
| | | opp.NewInquiryDate__c = Date.today(); |
| | | opp.StageName = 'Prospect Created'; |
| | |
| | | if (UserInfo.getUserType() == 'PowerPartner' && acc.ProductSegment__c != 'BS') { |
| | | opp.Dealer__c = dealerId; |
| | | } |
| | | staticResource = JSON.serialize(PIHelper.getPIIntegrationInfo('Opportunity')); |
| | | |
| | | return null; |
| | | } |
| | | |
| | |
| | | newOpp.Competitor_Product_Code8_D__c = newOpp.CompetitorProductCode8__c; |
| | | newOpp.Dealer_Sales_Staff_Name_D__c = newOpp.DealerSalesStaffName__c; |
| | | newOpp.Dealer_Service_D__c = newOpp.DealerService__c; |
| | | // PIPL Update 20220420 By Chen Yanan Start |
| | | newOpp.Dealer_Sales_Staff_Name_D_Encrypted__c = newOpp.DealerSalesStaffName_Encrypted__c; |
| | | newOpp.Dealer_Service_D_Encrypted__c = newOpp.DealerService_Encrypted__c; |
| | | // PIPL Update 20220420 By Chen Yanan End |
| | | newOpp.Expected_Delivery_Date_D__c = newOpp.ExpectedDeliveryDate__c; |
| | | newOpp.Expected_Order_Date_D__c = newOpp.ExpectedOrderDate__c; |
| | | newOpp.Inquiry_Result_D__c = newOpp.InquiryResult__c; |
| | |
| | | } |
| | | if (newOpp.DealerSalesStaffName__c != oldOpp.DealerSalesStaffName__c) { |
| | | newOpp.Dealer_Sales_Staff_Name_D__c = newOpp.DealerSalesStaffName__c; |
| | | // PIPL Update 20220420 By Chen Yanan Start |
| | | newOpp.Dealer_Sales_Staff_Name_D_Encrypted__c = newOpp.DealerSalesStaffName_Encrypted__c; |
| | | // PIPL Update 20220420 By Chen Yanan End |
| | | } |
| | | if (newOpp.DealerService__c != oldOpp.DealerService__c) { |
| | | newOpp.Dealer_Service_D__c = newOpp.DealerService__c; |
| | | // PIPL Update 20220420 By Chen Yanan Start |
| | | newOpp.Dealer_Service_D_Encrypted__c = newOpp.DealerService_Encrypted__c; |
| | | // PIPL Update 20220420 By Chen Yanan End |
| | | } |
| | | if (newOpp.ExpectedDeliveryDate__c != oldOpp.ExpectedDeliveryDate__c) { |
| | | newOpp.Expected_Delivery_Date_D__c = newOpp.ExpectedDeliveryDate__c; |
| | |
| | | newOpp.CompetitorProductCode8__c = newOpp.Competitor_Product_Code8_D__c; |
| | | newOpp.DealerSalesStaffName__c = newOpp.Dealer_Sales_Staff_Name_D__c; |
| | | newOpp.DealerService__c = newOpp.Dealer_Service_D__c; |
| | | // PIPL Update 20220420 By Chen Yanan Start |
| | | newOpp.DealerSalesStaffName_Encrypted__c = newOpp.Dealer_Sales_Staff_Name_D_Encrypted__c; |
| | | newOpp.DealerService_Encrypted__c = newOpp.Dealer_Service_D_Encrypted__c; |
| | | // PIPL Update 20220420 By Chen Yanan End |
| | | newOpp.ExpectedDeliveryDate__c = newOpp.Expected_delivery_date_D__c; |
| | | newOpp.ExpectedOrderDate__c = newOpp.Expected_Order_Date_D__c; |
| | | newOpp.InquiryResult__c = newOpp.Inquiry_result_D__c; |
| | |
| | | newOpp.Competitor_Product_Code8_D__c = newOpp.CompetitorProductCode8__c; |
| | | newOpp.Dealer_Sales_Staff_Name_D__c = newOpp.DealerSalesStaffName__c; |
| | | newOpp.Dealer_Service_D__c = newOpp.DealerService__c; |
| | | // PIPL Update 20220420 By Chen Yanan Start |
| | | newOpp.Dealer_Sales_Staff_Name_D_Encrypted__c = newOpp.DealerSalesStaffName_Encrypted__c; |
| | | newOpp.Dealer_Service_D_Encrypted__c = newOpp.DealerService_Encrypted__c; |
| | | // PIPL Update 20220420 By Chen Yanan End |
| | | newOpp.Expected_Delivery_Date_D__c = newOpp.ExpectedDeliveryDate__c; |
| | | newOpp.Expected_Order_Date_D__c = newOpp.ExpectedOrderDate__c; |
| | | newOpp.Inquiry_Result_D__c = newOpp.InquiryResult__c; |
| | |
| | | } |
| | | |
| | | if (targetList.size() > 0) { |
| | | List<Order> odrList = [select id, OpportunityId,ForeignTradeCompany_D__c,TradeType__c,ProductSegment__c from Order where OpportunityId = :targetList and Status__c = 'Active']; |
| | | List<Order> odrList = [select id, OpportunityId from Order where OpportunityId = :targetList and Status__c = 'Active']; |
| | | for (Order odr : odrList) { |
| | | Opportunity opp = newMap.get(odr.OpportunityId); |
| | | |
| | |
| | | odr.Status__c = 'Inactive'; |
| | | } |
| | | } |
| | | |
| | | System.debug('odrList------'+odrList); |
| | | |
| | | if (odrList.size() > 0) update odrList; |
| | | } |
| | | if (targetList2.size() > 0) { |
| | |
| | | } |
| | | |
| | | |
| | | WebService static void batch(String oppId){ |
| | | |
| | | System.debug('$$$$$$$$$$'+oppId); |
| | | List<String> idList = new List<String>(); |
| | | idList.add(oppId); |
| | | Database.executeBatch(new OpportunityUpdateSendEmailBatch(idList), 10); |
| | | } |
| | | |
| | | WebService static String checkUpperLimitOfSales(String oppId, String dealerId) { |
| | | String result = ''; |
| | |
| | | } |
| | | String accountDealerErrorMessage = RadiationUtil.updateCertificationDetails(dealerId, null, getModelQuantityMap, false);*/ |
| | | String olympusDealerErrorMessage = RadiationUtil.updateCertificationDetails(olympusAccountId, null, getModelQuantityMap, false); |
| | | result = olympusDealerErrorMessage == '' ? '' : '仪景通可销售数量不足' ; |
| | | result = olympusDealerErrorMessage == '' ? '' : '奥林巴斯可销售数量不足' ; |
| | | //String flage = LicenseCheckUtil.LicenseCheckOly(); |
| | | Boolean temp = result.startsWith('你不能'); |
| | | if (temp) { |
| | |
| | | } |
| | | } |
| | | |
| | | WebService static String checkOrderStatus(String oppId, String stageName, String creuser, String owner) { |
| | | WebService static String checkOrderStatus(String oppId, String stageName, String creuser) { |
| | | String temp = '1'; |
| | | Order ord = new Order(); |
| | | List<Order> ordList = new List<Order>(); |
| | |
| | | if (ordList.size() > 0) { |
| | | ord = ordList[0]; |
| | | |
| | | if ( (ord.ApproveStatus__c == 'CancelPass' || ord.ApproveStatus__c == 'OrderDraft' || ord.ApproveStatus__c == 'Draft' || ord.ApproveStatus__c == 'Reject') && (creuser == userId || owner == userId)) { |
| | | if ( (ord.ApproveStatus__c == 'CancelPass' || ord.ApproveStatus__c == 'OrderDraft' || ord.ApproveStatus__c == 'Draft' || ord.ApproveStatus__c == 'Reject') && creuser == userId ) { |
| | | StaticParameter.StageProgressBarUpdate = true; |
| | | |
| | | |
| | |
| | | roleId == '00E28000000aKzs' || roleId == '00E0K000001jGiC' || roleId == '00E0K000001jGiR' || |
| | | roleId == '00E0K000001ywgX' || roleId == '00E28000000knAc' || roleId == '00E28000000knAh' || |
| | | roleId == '00E28000000aKzx' || roleId == '00E28000000knAw' || roleId == '00E28000000knB1' || |
| | | roleId == '00E28000000aL02' || roleId == '00E28000000kjpX') { |
| | | roleId == '00E28000000aL02') { |
| | | |
| | | Opportunity opp = new Opportunity(); |
| | | opp.Id = oppId; |
| | |
| | | temp = '0'; |
| | | } |
| | | } else { |
| | | if ((userId == '005280000037mrQ' || userId == '00528000002OAvH' || userId == '00528000000YSdB' || |
| | | if (userId == '005280000037mrQ' || userId == '00528000002OAvH' || userId == '00528000000YSdB' || |
| | | roleId == '00E0K000001ywwz' || roleId == '00E0K000001jGiM' || roleId == '00E0K000001jGib' || |
| | | roleId == '00E0K000001ywgS' || roleId == '00E28000000knAm' || roleId == '00E28000000knAr' || |
| | | roleId == '00E28000000aKzn' || roleId == '00E0K000001jGhn' || roleId == '00E0K000001jGhs' || |
| | |
| | | roleId == '00E28000000aKzs' || roleId == '00E0K000001jGiC' || roleId == '00E0K000001jGiR' || |
| | | roleId == '00E0K000001ywgX' || roleId == '00E28000000knAc' || roleId == '00E28000000knAh' || |
| | | roleId == '00E28000000aKzx' || roleId == '00E28000000knAw' || roleId == '00E28000000knB1' || |
| | | roleId == '00E28000000aL02' || roleId == '00E28000000kjpX') && (creuser == userId || owner == userId)) { |
| | | roleId == '00E28000000aL02') { |
| | | |
| | | Opportunity opp = new Opportunity(); |
| | | opp.Id = oppId; |
| | |
| | | |
| | | } |
| | | |
| | | WebService static String checkDealerId(String dealerId) { |
| | | String rtn = '0'; |
| | | // 获取系统管理员Id |
| | | String getUserId = System.label.SystemAdmin1_2_GPI; |
| | | // 获取当前用户Id |
| | | String userId = UserInfo.getUserId().subString(0,15); |
| | | dealerId.subString(0,15); |
| | | |
| | | String userDealerId; |
| | | List<User> userList = new List<User>(); |
| | | User user = new User(); |
| | | |
| | | if (String.isNotBlank(getUserId)) { |
| | | if (!getUserId.contains(userId)) { |
| | | userList = [select mu_Dealer__c |
| | | from User |
| | | where id =: userId]; |
| | | |
| | | user = userList[0]; |
| | | userDealerId = user.mu_Dealer__c; |
| | | if (String.isNotBlank(userDealerId)) { |
| | | userDealerId.substring(0,15); |
| | | } |
| | | if (userDealerId == dealerId) { |
| | | rtn = '1'; |
| | | } |
| | | }else { |
| | | rtn = '0'; |
| | | } |
| | | }else { |
| | | rtn = '0'; |
| | | } |
| | | System.debug('rtn='+rtn); |
| | | return rtn; |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | |
| | | private static void add() { |
| | | Integer i = 0; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | |
| | | public String ndt_fax{get;set;} |
| | | |
| | | public Boolean notSpecialDealer { get; set; } |
| | | public String staticResource { get;private set; } |
| | | //4月11号之后 |
| | | //public Boolean fourMaand { get; set; } |
| | | //发货月 |
| | |
| | | |
| | | Date today = Date.today(); |
| | | strToday = today.format(); |
| | | |
| | | staticResource = JSON.serialize(PIHelper.getPIIntegrationInfo('Contact'));// 20220222 PI改造 by Bright |
| | | } |
| | | |
| | | public PageReference init() { |
| | |
| | | PDF_Property__c, Opportunity.Name, PDF_No__c, Description, PDF_Order_No__c,CrossCooperativeProject__c, |
| | | Olympus_Price_BeforeDiscount_D__c, Discount_D__c, OlympusContractPricesD__c, CustomerContractPriceD__c, |
| | | Opportunity.ProductSegment__c, Opportunity.SalesChannel__c, Opportunity.Machine_Parts__c, |
| | | AWS_Data_Id__c, // 20220222 PI改造 by Bright |
| | | SpecialDeliveryAccount__c, SpecialDeliveryAccount_D__c, SpecialDeliveryContact2__c, SpecialDeliveryContact2_D__c,Opportunity.DeliveryDate__c |
| | | from Order where Id = :id]; |
| | | if (orderList.size() == 0) { |
| | |
| | | |
| | | delivery_contact = new Contact(); |
| | | if (order.SpecialDeliveryContact2_D__c != null) { |
| | | delivery_contact = [select Id, Department, Name, Phone, MobilePhone, |
| | | AWS_Data_Id__c, // 20220222 PI改造 by Bright |
| | | Address1__c from Contact where Id = :order.SpecialDeliveryContact2_D__c]; |
| | | delivery_contact = [select Id, Department, Name, Phone, MobilePhone,Address1__c from Contact where Id = :order.SpecialDeliveryContact2_D__c]; |
| | | } |
| | | |
| | | user = new Account(); |
| | |
| | | } |
| | | contact = new Contact(); |
| | | if (contactid != null && contactid.length() > 0) { |
| | | contact = [select Id, Department, Name, Phone, MobilePhone,Fax, |
| | | AWS_Data_Id__c, // 20220222 PI改造 by Bright |
| | | Email from Contact where Id = :contactid]; |
| | | contact = [select Id, Department, Name, Phone, MobilePhone,Fax,Email from Contact where Id = :contactid]; |
| | | } |
| | | |
| | | List<OrderItem> oiList = [select Id, PriceBookEntry.Product2.ProductCode, PriceBookEntry.Product2.Product_ECCode__c,PriceBookEntry.Product2.Name,PriceBookEntry.Product2.registrationCode__c, |
| | |
| | | Name, Opportunity.ExpectedDeliveryDate__c, PDF_Sap_No__c, OrderNumber, Opportunity.SubDealer__c, |
| | | PDF_Property__c, Opportunity.Name, PDF_No__c, Description, PDF_Order_No__c, |
| | | Olympus_Price_BeforeDiscount_D__c, Discount_D__c, OlympusContractPricesD__c, CustomerContractPriceD__c, |
| | | AWS_Data_Id__c, // 20220222 PI改造 by Bright |
| | | Opportunity.ProductSegment__c |
| | | from Order where Id = :id]; |
| | | if (orderList.size() == 0) { |
| | |
| | | public String delivery_user { get; set; } |
| | | public String delivery_phone { get; set; } |
| | | public String delivery_tel { get; set; } |
| | | public String delivery_aws_data_id { get; set; }// 20220222 PI改造 by Bright |
| | | // 最终用户信息 |
| | | public String user_name { get; set; } |
| | | public String user_no { get; set; } |
| | |
| | | public String user_property_IE { get; set; } |
| | | public String user_product_IE { get; set; } |
| | | public String user_market_RVI { get; set; } |
| | | public String user_aws_data_id { get; set; }// 20220222 PI改造 by Bright |
| | | // 订单信息2 |
| | | public Decimal order_subtotal { get; set; } |
| | | public Decimal order_discount_rate { get; set; } |
| | |
| | | delivery_user = delivery_contact.Name; |
| | | delivery_phone = delivery_contact.Phone; |
| | | delivery_tel = delivery_contact.MobilePhone; |
| | | delivery_aws_data_id = delivery_contact.AWS_Data_Id__c;// 20220222 PI改造 by Bright |
| | | |
| | | user_name = user.Name; |
| | | user_no = user.ManagementCode_F__c; |
| | |
| | | user_fax = contact.Fax; |
| | | user_email = Contact.Email; |
| | | user_tel = contact.MobilePhone; |
| | | user_aws_data_id = contact.AWS_Data_Id__c;// 20220222 PI改造 by Bright |
| | | user_property_IE = order.PDF_Property__c; |
| | | user_product_IE = user.Sub_Use__c == 'Automotive' ? '汽车' : user.Sub_Use__c; |
| | | user_market_RVI = user.Sub_Use__c; |
| | |
| | | @isTest |
| | | private class OrderPdf2ControllerTest { |
| | | |
| | | @TestSetup |
| | | static void setup(){ |
| | | TestDataUtility.CreatePIPolicyConfigurations(new string[]{'Contact','Opportunity','Order'}); |
| | | } |
| | | |
| | | |
| | | @isTest static void test_init1() { |
| | | OrderPdf2Controller.asd(); |
| | | List<RecordType> rectDealer = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = 'Dealer']; |
| | |
| | | |
| | | public List<OrderItem> oiList {get; set;} |
| | | |
| | | public String staticResourceContact { get; private set; }// PI改造 By Bright 20220422 |
| | | public String staticResourceOrder { get; private set; }// PI改造 By Bright 20220422 |
| | | public String staticResourceFile { get; private set; }// PI改造 By Bright 20220422 |
| | | |
| | | // The extension constructor initializes the private member |
| | | // variable mysObject by using the getRecord method from the standard |
| | | // controller. |
| | |
| | | } else if (path.indexOf('production/') > 0) { |
| | | baseUrl += '/production'; |
| | | } |
| | | |
| | | staticResourceContact = JSON.serialize(PIHelper.getPIIntegrationInfo('Contact'));// PI改造 By Bright 20220422 |
| | | staticResourceOrder = JSON.serialize(PIHelper.getPIIntegrationInfo('Order'));// PI改造 By Bright 20220422 |
| | | staticResourceFile = JSON.serialize(PIHelper.getPIIntegrationInfo('Document'));// PI改造 By Bright 20220422 |
| | | } |
| | | public PageReference init() { |
| | | od = new Order(); |
| | |
| | | } |
| | | specialDeliveryContact = new Contact(); |
| | | if (od.SpecialDeliveryContact2_D__c != null) { |
| | | specialDeliveryContact = [select Id, Name, |
| | | AWS_Data_Id__c,// 20220222 PI改造 by Bright |
| | | Email from Contact where Id = :od.SpecialDeliveryContact2_D__c]; |
| | | specialDeliveryContact = [select Id, Name, Email from Contact where Id = :od.SpecialDeliveryContact2_D__c]; |
| | | } |
| | | } |
| | | |
| | |
| | | PDF_C_Address__c, PDF_C_TEL__c, PDF_C_FAX__c, PDF_C_CONTACT__c , PDF_G_TrAndPre__c , PDF_G_SpecNo__c, PDF_F_Add__c, PDF_F_ContactPerson__c, |
| | | Opportunity.SpecialDeliveryAddress__c, Opportunity.SpecialDeliveryContact__c, Shipment_Term__c, Shipment_Term_D__c, Shipment_Term2__c, Shipment_Term2_D__c, |
| | | SpecialDeliveryAccount__c, SpecialDeliveryAccount_D__c, SpecialDeliveryContact2__c, SpecialDeliveryContact2_D__c, PDF_Order_No__c, DeliveryTimeText__c, DeliveryTimeTextEn__c, Total_price_E__c, ContractPriceTotal__c, |
| | | AWS_Data_Id__c,// 20220222 PI改造 by Bright |
| | | PDF_Shipment_Term2_Text__c, PDF_PaymentTerms__c, PDF_PaymentTerms_E__c, PDF_Sign_Name__c, PDF_Sign_Title__c,PDF_Sp_LOADING__c,PDF_Sp_LOADING_E__c |
| | | from Order |
| | | where id = :Id]; |
| | |
| | | } |
| | | specialDeliveryContact = new Contact(); |
| | | if (odpdf.SpecialDeliveryContact2_D__c != null) { |
| | | specialDeliveryContact = [select Id, Name, |
| | | AWS_Data_Id__c,// 20220222 PI改造 by Bright |
| | | Email from Contact where Id = :odpdf.SpecialDeliveryContact2_D__c]; |
| | | specialDeliveryContact = [select Id, Name, Email from Contact where Id = :odpdf.SpecialDeliveryContact2_D__c]; |
| | | } |
| | | |
| | | List<Quote> quoList = [select Id, Name, CreatedDate, OpportunityId, Opportunity.Dealer__c, Opportunity.DealerSalesStaffName__c, AccountId, PrintPrice__c, TotalPrice, |
| | |
| | | @isTest |
| | | private class OrderPdfControllerTest { |
| | | |
| | | @TestSetup |
| | | static void setup(){ |
| | | TestDataUtility.CreatePIPolicyConfigurations(new string[]{'Opportunity','Contact','Order','Document'}); |
| | | } |
| | | |
| | | |
| | | @isTest static void test_init() { |
| | | List<RecordType> rectDealer = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = 'Dealer']; |
| | | List<RecordType> rectIE = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = 'Customer IE']; |
| | |
| | | SpecialDeliveryContact2_D__c = contact.Id, |
| | | OpportunityId = opp.Id, |
| | | EffectiveDate = Date.today(), |
| | | ProductListApproveStatus__c = 'Draft',RecordTypeId=rectOdr[0].Id, |
| | | Status = 'Draft', |
| | | Pricebook2Id = pricebook.Id, |
| | | EndUser__c = contact.Id, |
| | |
| | | |
| | | insert oiList; |
| | | |
| | | Test.startTest(); |
| | | PageReference page = new PageReference('/apex/OrderContract?id=' + order.Id); |
| | | System.Test.setCurrentPage(page); |
| | | OrderPdfController controller = new OrderPdfController(); |
| | |
| | | controller.saveBtn(); |
| | | |
| | | controller.printBtn(); |
| | | Test.stopTest(); |
| | | } |
| | | |
| | | @isTest static void test_init2() { |
| | |
| | | SpecialDeliveryContact2_D__c = contact.Id, |
| | | OpportunityId = opp.Id, |
| | | EffectiveDate = Date.today(), |
| | | ProductListApproveStatus__c = 'Draft',RecordTypeId=rectOdr[0].Id, |
| | | Status = 'Draft', |
| | | Pricebook2Id = pricebook.Id, |
| | | EndUser__c = contact.Id, |
| | |
| | | |
| | | insert oiList; |
| | | |
| | | Test.startTest(); |
| | | PageReference page = new PageReference('/apex/OrderPdf?id=' + order.Id); |
| | | System.Test.setCurrentPage(page); |
| | | OrderPdfController controller = new OrderPdfController(); |
| | |
| | | //controller.init(); |
| | | controller.init2(); |
| | | //controller.init(); |
| | | Test.stopTest(); |
| | | } |
| | | |
| | | @isTest static void test_init2_2() { |
| | |
| | | SpecialDeliveryContact2_D__c = contact.Id, |
| | | OpportunityId = opp.Id, |
| | | EffectiveDate = Date.today(), |
| | | ProductListApproveStatus__c = 'Draft',RecordTypeId=rectOdr[0].Id, |
| | | Status = 'Draft', |
| | | Pricebook2Id = pricebook.Id, |
| | | EndUser__c = contact.Id, |
| | |
| | | } |
| | | |
| | | insert oiList; |
| | | Test.startTest(); |
| | | |
| | | PageReference page = new PageReference('/apex/OrderPdf?id=' + order.Id); |
| | | System.Test.setCurrentPage(page); |
| | | OrderPdfController controller = new OrderPdfController(); |
| | | |
| | | controller.init2(); |
| | | Test.stopTest(); |
| | | } |
| | | @isTest static void test_init2_3() { |
| | | List<RecordType> rectDealer = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = 'Dealer']; |
| | |
| | | SpecialDeliveryContact2_D__c = contact.Id, |
| | | OpportunityId = opp.Id, |
| | | EffectiveDate = Date.today(), |
| | | ProductListApproveStatus__c = 'Draft',RecordTypeId=rectOdr[0].Id, |
| | | Status = 'Draft', |
| | | Pricebook2Id = pricebook.Id, |
| | | EndUser__c = contact.Id, |
| | |
| | | |
| | | insert oiList; |
| | | |
| | | Test.startTest(); |
| | | PageReference page = new PageReference('/apex/OrderContract?id=' + order.Id); |
| | | System.Test.setCurrentPage(page); |
| | | OrderPdfController controller = new OrderPdfController(); |
| | |
| | | controller.saveBtn(); |
| | | |
| | | controller.printBtn(); |
| | | Test.stopTest(); |
| | | } |
| | | |
| | | } |
| | |
| | | hasError = false; |
| | | ord = new Order(); |
| | | cc = new Order(); |
| | | List<Order> raList = [select Id, Name, Dealer__c,SplitRatio__c,SplitRatiotext__c,CrossCooperativeDealerText__c,SplitRatioFormule__c,BS_AsistGenManger_BS__c,ApproveStatus__c from Order where Id = :raid]; |
| | | List<Order> raList = [select Id, Name, Dealer__c,SplitRatio__c,CrossCooperativeDealerText__c,SplitRatioFormule__c,BS_AsistGenManger_BS__c,ApproveStatus__c from Order where Id = :raid]; |
| | | UsId = UserInfo.getUserId().subString(0, 15); |
| | | if (raList.size() > 0) { |
| | | ord = raList[0]; |
| | |
| | | AppSta = ''; |
| | | hasError = false; |
| | | ra1 = new Order(); |
| | | List<Order> ra1List = [select Id, Name, Dealer__c,Dealer_A__r.Name,Dealer_B__r.Name ,SplitRatio__c,SplitRatiotext__c,CrossCooperativeDealerText__c,SplitRatioFormule__c,BS_AsistGenManger_BS__c from Order where Id = :raid]; |
| | | List<Order> ra1List = [select Id, Name, Dealer__c,SplitRatio__c,CrossCooperativeDealerText__c,SplitRatioFormule__c,BS_AsistGenManger_BS__c from Order where Id = :raid]; |
| | | UsId = UserInfo.getUserId().subString(0, 15); |
| | | if (ra1List.size() > 0) { |
| | | ra1 = ra1List[0]; |
| | |
| | | public PageReference saveBtn() { |
| | | hasError = false; |
| | | String response = ra1.SplitRatio__c; |
| | | /* if (String.isBlank(ra1.SplitRatio__c)) { |
| | | String SplitRatiotext = ra1.Dealer_A__r.Name +' '+ ra1.SplitRatio__c +' '+ ra1.Dealer_B__r.Name; |
| | | ra1.SplitRatiotext__c = SplitRatiotext; |
| | | ra1. |
| | | update ra1; |
| | | if (String.isBlank(ra1.SplitRatio__c)) { |
| | | /*String SplitRatiotext = ra1.Dealer__c +' '+ ra1.SplitRatio__c +' '+ ra1.CrossCooperativeDealerText__c; |
| | | ra1.SplitRatiotext__c = SplitRatiotext;*/ |
| | | update ra1; |
| | | }else { |
| | | update ra1; |
| | | }*/ |
| | | ra1.dealer_A_Name__c = ra1.Dealer_A__r.Name; |
| | | ra1.dealer_B_Name__c = ra1.Dealer_B__r.Name; |
| | | update ra1; |
| | | } |
| | | |
| | | return null; |
| | | } |
| | |
| | | newOrd.SpecialDeliveryContact_D__c = newOrd.SpecialDeliveryContact__c; |
| | | newOrd.SpecialDeliveryPhone_D__c = newOrd.SpecialDeliveryPhone__c; |
| | | newOrd.SpecialDeliveryAddress_D__c = newOrd.SpecialDeliveryAddress__c; |
| | | // PIPL Update 20220420 By Chen Yanan Start |
| | | newOrd.SpecialDeliveryContact_D_Encrypted__c = newOrd.SpecialDeliveryContact_Encrypted__c; |
| | | newOrd.SpecialDeliveryPhone_D_Encrypted__c = newOrd.SpecialDeliveryPhone_Encrypted__c; |
| | | newOrd.SpecialDeliveryAddress_D_Encrypted__c = newOrd.SpecialDeliveryAddress_Encrypted__c; |
| | | // PIPL Update 20220420 By Chen Yanan End |
| | | newOrd.SpecialParkage_D__c = newOrd.SpecialParkage__c; |
| | | newOrd.SpecialWarranty_D__c = newOrd.SpecialWarranty__c; |
| | | newOrd.DealerProfit_D__c = newOrd.DealerProfit__c; |
| | |
| | | } |
| | | |
| | | public static void setPriceBook(List<Order> newList, Map<Id, Order> newMap, List<Order> oldList, Map<Id, Order> oldMap) { |
| | | |
| | | |
| | | List<String> oppidList = new List<String>(); |
| | | for (Order o : newList) { |
| | | oppidList.add(o.OpportunityId); |
| | |
| | | } |
| | | if (newOrd.SpecialDeliveryContact__c != oldOrd.SpecialDeliveryContact__c) { |
| | | newOrd.SpecialDeliveryContact_D__c = newOrd.SpecialDeliveryContact__c; |
| | | // PIPL Update 20220420 By Chen Yanan Start |
| | | newOrd.SpecialDeliveryContact_D_Encrypted__c = newOrd.SpecialDeliveryContact_Encrypted__c; |
| | | // PIPL Update 20220420 By Chen Yanan End |
| | | } |
| | | if (newOrd.SpecialDeliveryPhone__c != oldOrd.SpecialDeliveryPhone__c) { |
| | | newOrd.SpecialDeliveryPhone_D__c = newOrd.SpecialDeliveryPhone__c; |
| | | // PIPL Update 20220420 By Chen Yanan Start |
| | | newOrd.SpecialDeliveryPhone_D_Encrypted__c = newOrd.SpecialDeliveryPhone_Encrypted__c; |
| | | // PIPL Update 20220420 By Chen Yanan End |
| | | } |
| | | if (newOrd.SpecialDeliveryAddress__c != oldOrd.SpecialDeliveryAddress__c) { |
| | | newOrd.SpecialDeliveryAddress_D__c = newOrd.SpecialDeliveryAddress__c; |
| | | // PIPL Update 20220420 By Chen Yanan Start |
| | | newOrd.SpecialDeliveryAddress_D_Encrypted__c = newOrd.SpecialDeliveryAddress_Encrypted__c; |
| | | // PIPL Update 20220420 By Chen Yanan End |
| | | } |
| | | if (newOrd.SpecialParkage__c != oldOrd.SpecialParkage__c) { |
| | | newOrd.SpecialParkage_D__c = newOrd.SpecialParkage__c; |
| | |
| | | newOrd.SpecialDeliveryContact__c = newOrd.SpecialDeliveryContact_D__c; |
| | | newOrd.SpecialDeliveryPhone__c = newOrd.SpecialDeliveryPhone_D__c; |
| | | newOrd.SpecialDeliveryAddress__c = newOrd.SpecialDeliveryAddress_D__c; |
| | | // PIPL Update 20220420 By Chen Yanan Start |
| | | newOrd.SpecialDeliveryContact_Encrypted__c = newOrd.SpecialDeliveryContact_D_Encrypted__c; |
| | | newOrd.SpecialDeliveryPhone_Encrypted__c = newOrd.SpecialDeliveryPhone_D_Encrypted__c; |
| | | newOrd.SpecialDeliveryAddress_Encrypted__c = newOrd.SpecialDeliveryAddress_D_Encrypted__c; |
| | | // PIPL Update 20220420 By Chen Yanan End |
| | | newOrd.SpecialParkage__c = newOrd.SpecialParkage_D__c; |
| | | newOrd.SpecialWarranty__c = newOrd.SpecialWarranty_D__c; |
| | | newOrd.DealerProfit__c = newOrd.DealerProfit_D__c; |
| | |
| | | newOrd.SpecialDeliveryContact_D__c = newOrd.SpecialDeliveryContact__c; |
| | | newOrd.SpecialDeliveryPhone_D__c = newOrd.SpecialDeliveryPhone__c; |
| | | newOrd.SpecialDeliveryAddress_D__c = newOrd.SpecialDeliveryAddress__c; |
| | | // PIPL Update 20220420 By Chen Yanan Start |
| | | newOrd.SpecialDeliveryContact_D_Encrypted__c = newOrd.SpecialDeliveryContact_Encrypted__c; |
| | | newOrd.SpecialDeliveryPhone_D_Encrypted__c = newOrd.SpecialDeliveryPhone_Encrypted__c; |
| | | newOrd.SpecialDeliveryAddress_D_Encrypted__c = newOrd.SpecialDeliveryAddress_Encrypted__c; |
| | | // PIPL Update 20220420 By Chen Yanan End |
| | | newOrd.SpecialParkage_D__c = newOrd.SpecialParkage__c; |
| | | newOrd.SpecialWarranty_D__c = newOrd.SpecialWarranty__c; |
| | | newOrd.DealerProfit_D__c = newOrd.DealerProfit__c; |
| | |
| | | |
| | | newOrd.Contract_StatusD__c = newOrd.Contract_Status__c; |
| | | newOrd.ProductConfig_D__c = newOrd.ProductConfig__c; |
| | | // PIPL Update 20220420 By Chen Yanan Start |
| | | newOrd.SpecialDeliveryPhone_Encrypted__c = newOrd.SpecialDeliveryPhone_D_Encrypted__c; |
| | | // PIPL Update 20220420 By Chen Yanan End |
| | | |
| | | if (newOrd.Upload_IsChanged__c == true) { |
| | | newOrd.Upload_IsChanged__c = false; |
| | |
| | | newOrder.BS_AsistBGenManger_BS__c = u.BS_AsistBGenManger__c == null ? u.Id : u.BS_AsistBGenManger__c; |
| | | newOrder.BS_AsistGenManger_BS__c = u.BS_AsistGenManger__c == null ? u.Id : u.BS_AsistGenManger__c; |
| | | |
| | | newOrder.BS_MandAGM__c = u.BS_Manager__c == u.BS_AsistBGenManger__c ? true : false; |
| | | //newOrder.BS_AGMandD__c = u.BS_AsistGenManger__c == u.BS_Department__c ? true : false; |
| | | //newOrder.BS_DandAB__c = u.BS_Department__c == u.BS_AsistBGenManger__c ? true : false; |
| | | newOrder.BS_MandAGM__c = u.BS_Manager__c == u.BS_AsistGenManger__c ? true : false; |
| | | newOrder.BS_AGMandD__c = u.BS_AsistGenManger__c == u.BS_Department__c ? true : false; |
| | | newOrder.BS_DandAB__c = u.BS_Department__c == u.BS_AsistBGenManger__c ? true : false; |
| | | newOrder.BS_ABGandBD__c = u.BS_AsistBGenManger__c == u.BS_BDepartment__c ? true : false; |
| | | newOrder.BS_BDandIND__c = u.BS_BDepartment__c == u.BS_INDepartment__c ? true : false; |
| | | newOrder.BS_INDandGM__c = u.BS_INDepartment__c == u.BS_GeneralManager__c ? true : false; |
| | | } |
| | | } |
| | | |
| | | |
| | | if (newOrder.ProductSegment__c != 'BS') { |
| | | newOrder.SalesOwner_BS__c = newOrder.OpportunityOwnerId__c; |
| | |
| | | } |
| | | //} |
| | | } |
| | | |
| | | for (Order newOrder : newList) { |
| | | if (newOrder.ProductSegment__c == 'BS') { |
| | | newOrder.BS_AGMandD__c = newOrder.BS_Manager_BS__c == newOrder.SalesOwner_BS__c ? true : false; |
| | | newOrder.BS_DandAB__c = newOrder.BS_Department_BS__c == newOrder.SalesOwner_BS__c ? true : false; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | // 合同-变更申请-原合同无效或者手动修改导致合同无效 |
| | | if (!approveStatus && status) { |
| | | if(newOrd.oldOrder__c){ |
| | | RadiationUtil.oldOrder = true; |
| | | if (updateFlag) { |
| | | newOrd.oldOrder__c = false; |
| | | } |
| | | |
| | | } |
| | | RadiationUtil.updateRadiationTypeQuantity(newOrd.Id,orderFounder , newOrd.DealerId__c, true,'无效或变更无效',newOrd.LastModifiedById ); |
| | | } |
| | | |
| | |
| | | |
| | | if (RadiationUtil.EscapeOrderTriggerHandler) { |
| | | RadiationUtil.EscapeOrderTriggerHandler = false; |
| | | if(newOrd.oldOrder__c){ |
| | | RadiationUtil.oldOrder = true; |
| | | if (updateFlag) { |
| | | newOrd.oldOrder__c = false; |
| | | } |
| | | } |
| | | RadiationUtil.updateRadiationTypeQuantity(newOrd.Id,orderFounder , newOrd.DealerId__c, true,'合同变更草案中',newOrd.LastModifiedById ); |
| | | |
| | | } |
| | |
| | | Boolean status = newOrd.Status__c != oldOrd.Status__c && newOrd.Status__c == 'Inactive'; |
| | | // 合同提交状态变成无效 |
| | | if ( status ) { |
| | | if(newOrd.oldOrder__c){ |
| | | RadiationUtil.oldOrder = true; |
| | | if (updateFlag) { |
| | | newOrd.oldOrder__c = false; |
| | | } |
| | | } |
| | | RadiationUtil.updateRadiationTypeQuantity(newOrd.Id,orderFounder , newOrd.DealerId__c, true,'合同提交变无效',newOrd.LastModifiedById ); |
| | | } |
| | | } else if (newOrd.ApproveStatus__c == 'CancelPass' && newOrd.Status__c == 'Active') { |
| | | // 合同-合同批准→→→合同取消 |
| | | if ( approveStatus && newOrd.BeforeSubmitStatus__c == 'OrderPass') { |
| | | if(newOrd.oldOrder__c){ |
| | | RadiationUtil.oldOrder = true; |
| | | if (updateFlag) { |
| | | newOrd.oldOrder__c = false; |
| | | } |
| | | } |
| | | |
| | | RadiationUtil.updateRadiationTypeQuantity(newOrd.Id,orderFounder , newOrd.DealerId__c, true,'合同取消',newOrd.LastModifiedById ); |
| | | } |
| | | |
| | | } else if (oldOrd.ApproveStatus__c == 'OrderSubmit' && newOrd.ApproveStatus__c == 'OrderReject' && newOrd.Status__c == 'Active') { |
| | | // 合同提交→→→合同驳回 |
| | | if(newOrd.oldOrder__c){ |
| | | RadiationUtil.oldOrder = true; |
| | | if (updateFlag) { |
| | | newOrd.oldOrder__c = false; |
| | | } |
| | | } |
| | | RadiationUtil.updateRadiationTypeQuantity(newOrd.Id,orderFounder , newOrd.DealerId__c, true,'合同驳回',newOrd.LastModifiedById ); |
| | | } else if (oldOrd.ApproveStatus__c == 'OrderSubmit' && newOrd.ApproveStatus__c == 'OrderDraft' && newOrd.Status__c == 'Active') { |
| | | // 合同提交→→→合同调回 |
| | | if(newOrd.oldOrder__c){ |
| | | RadiationUtil.oldOrder = true; |
| | | if (updateFlag) { |
| | | newOrd.oldOrder__c = false; |
| | | } |
| | | } |
| | | RadiationUtil.updateRadiationTypeQuantity(newOrd.Id,orderFounder , newOrd.DealerId__c, true,'合同调回',newOrd.LastModifiedById ); |
| | | } |
| | | |
| | |
| | | for(OpportunityContactRole oppor:role_list){ |
| | | roleMap.put(oppor.OpportunityId,oppor.ContactId); |
| | | } |
| | | System.debug('oppidList: ' + oppidList);//Nancy 2022-04-25 |
| | | System.debug('role_list: ' + role_list);//Nancy 2022-04-25 |
| | | // 获取系统管理员Id |
| | | String getUserId = System.label.SystemAdmin1_2_GPI; |
| | | String errMessage = '客户名或最终用户与询价不一致!'; |
| | |
| | | System.debug(oppAccountMap.get(orOne.OpportunityId) != orOne.AccountId); |
| | | System.debug( !roleMap.containsKey(orOne.OpportunityId)); |
| | | System.debug(orOne.EndUserD__c + '++'+ roleMap.get(orOne.OpportunityId)); |
| | | //zhj 2022-04-22 start |
| | | System.debug('oppAccountMap.get(orOne.OpportunityId) = ' + oppAccountMap.get(orOne.OpportunityId)); |
| | | System.debug('orOne.AccountId = ' + orOne.AccountId); |
| | | System.debug('roleMap.containsKey(orOne.OpportunityId) = ' + roleMap.containsKey(orOne.OpportunityId)); |
| | | System.debug('orOne.EndUserD__c = ' + orOne.EndUserD__c); |
| | | System.debug('roleMap.get(orOne.OpportunityId) = ' + roleMap.get(orOne.OpportunityId)); |
| | | //zhj 2022-04-22 end |
| | | |
| | | if(oppAccountMap.get(orOne.OpportunityId) != orOne.AccountId || !roleMap.containsKey(orOne.OpportunityId) || orOne.EndUserD__c != roleMap.get(orOne.OpportunityId)){ |
| | | // 获取用户Id |
| | | String userId = UserInfo.getUserId().subString(0,15); |
| | |
| | | } |
| | | String accountDealerErrorMessage = RadiationUtil.updateCertificationDetails(dealerId, null, getModelQuantityMap, false);*/ |
| | | String olympusDealerErrorMessage = RadiationUtil.updateCertificationDetails(olympusAccountId, null, getModelQuantityMap, false); |
| | | result = olympusDealerErrorMessage == '' ? '' : '仪景通可销售数量不足' ; |
| | | result = olympusDealerErrorMessage == '' ? '' : '奥林巴斯可销售数量不足' ; |
| | | Boolean temp = result.startsWith('你不能'); |
| | | if(temp){ |
| | | return '-1'; |
| | |
| | | 'ZZTT' => '100% TT IN ADVANCE' |
| | | }; |
| | | |
| | | public String staticResourceOpportunity{get; private set; }// 20220221 PI改造 by Bright |
| | | public String staticResourceContact{get; private set; }// 20220221 PI改造 by Bright |
| | | public String staticResourceFile{get; private set; }// 20220221 PI改造 by Bright |
| | | |
| | | |
| | | public QuotePDFController() { |
| | | targetId = ApexPages.currentPage().getParameters().get('Id'); |
| | | isPrintPrice = ApexPages.currentPage().getParameters().get('printprice'); |
| | | staticResourceOpportunity = JSON.serialize(PIHelper.getPIIntegrationInfo('Opportunity'));// 20220221 PI改造 by Bright |
| | | staticResourceContact = JSON.serialize(PIHelper.getPIIntegrationInfo('Contact'));// 20220221 PI改造 by Bright |
| | | staticResourceFile = JSON.serialize(PIHelper.getPIIntegrationInfo('Document'));// 20220221 PI改造 by Bright |
| | | } |
| | | |
| | | // 画面初始化 |
| | |
| | | SetName16__c, SetQty16__c, SetName17__c, SetQty17__c, SetName18__c, SetQty18__c, SetName19__c, SetQty19__c, SetName20__c, SetQty20__c, |
| | | SetName21__c, SetQty21__c, SetName22__c, SetQty22__c, SetName23__c, SetQty23__c, SetName24__c, SetQty24__c, SetName25__c, SetQty25__c, |
| | | SetName26__c, SetQty26__c, SetName27__c, SetQty27__c, SetName28__c, SetQty28__c, SetName29__c, SetQty29__c, SetName30__c, SetQty30__c, |
| | | Opportunity.AWS_Data_Id__c,// 20220221 PI改造 by Bright |
| | | Custom_Price_Total__c, Custom_Price_Total_Text__c, Shipment_Term__c |
| | | from Quote |
| | | where Id = :targetId]; |
| | |
| | | } |
| | | Contact con = new Contact(); |
| | | if (conid != null && conid.length() > 0) { |
| | | con = [select Id, Name, Phone, Email, |
| | | AWS_Data_Id__c,// 20220221 PI改造 by Bright |
| | | Account.Name from Contact where Id = :conid]; |
| | | con = [select Id, Name, Phone, Email, Account.Name from Contact where Id = :conid]; |
| | | } |
| | | // PDF报价信息 |
| | | quoteInfo = new QuoteInfo(quo, dealer, con); |
| | |
| | | public String note5 {get; private set;} |
| | | public String note6 {get; private set;} |
| | | public String note7 {get; private set;} |
| | | public String conAwsDataId {get; private set;} |
| | | public String oppAwsDataId {get; private set;} |
| | | |
| | | public QuoteInfo(Quote quo, Account acc, Contact con) { |
| | | printPrice = quo.PrintPrice__c; |
| | |
| | | note5 = quo.Shipment_Term__c; |
| | | note6 = quo.Opportunity.TradeType__c == 'Taxation' ? 'tax included' : 'tax exempted'; |
| | | note7 = quo.Opportunity.TradeType__c == 'Taxation' ? '含税' : '免税'; |
| | | conAwsDataId = con.aws_data_id__c; // 20220222 PI改造 by Bright |
| | | oppAwsDataId = quo.Opportunity.aws_data_id__c;// 20220222 PI改造 by Bright |
| | | } |
| | | } |
| | | |
| | |
| | | @isTest |
| | | private class QuotePDFControllerTest { |
| | | |
| | | @TestSetup |
| | | static void setup(){ |
| | | TestDataUtility.CreatePIPolicyConfigurations(new string[]{'Opportunity','Contact','Document'}); |
| | | } |
| | | |
| | | |
| | | @isTest static void test_init() { |
| | | Id pricebookId = Test.getStandardPricebookId(); |
| | | |
| | |
| | | if(orderList.size() > 0){ |
| | | System.debug('22222222222'); |
| | | for(Order odr : orderList){ |
| | | //王鹏伟新加判断,只有已同步的报价才会同步合同的付款条件 |
| | | if(oppMap.get(odr.OpportunityId).IsSyncing){ |
| | | odr.PaymentTerms__c = oppMap.get(odr.OpportunityId).PaymentTerms__c; |
| | | } |
| | | odr.PaymentTerms__c = oppMap.get(odr.OpportunityId).PaymentTerms__c; |
| | | } |
| | | System.debug(orderList); |
| | | update orderList; |
| | |
| | | //总金额 合计 |
| | | public Decimal grossAmt{get;set;} |
| | | public String conName{get;set;} |
| | | |
| | | // 20220222 PI改造 by Bright---start |
| | | public string staticResource { get; private set; } |
| | | public string contactStaticResource { get; private set; } |
| | | // 20220222 PI改造 by Bright---end |
| | | |
| | | // 第一页不会侵入页脚信息的最大行数 |
| | | private Decimal firstCount = 50; |
| | |
| | | public QuotesPDFController() { |
| | | //获取报价ID |
| | | id = System.currentPageReference().getParameters().get('id'); |
| | | staticResource = JSON.serialize(PIHelper.getPIIntegrationInfo('Quotes__c'));// 20220222 PI改造 by Bright |
| | | contactStaticResource = JSON.serialize(PIHelper.getPIIntegrationInfo('Contact'));// 20220222 PI改造 by Bright |
| | | } |
| | | |
| | | /** |
| | |
| | | //DISCOUNT__c |
| | | //TAX__c |
| | | //TOTAL__c |
| | | quo = [SELECT id,ESTIMATE__c,DATE__c,EXPIRES__c,CURRENCY__c,TERMS__c,INCOTERM__c,PO__c,LEAD_TIME__c,CONTACT_EMAIL__c,CONTACT_PHONE__c,CONTACT_NAME__c,CONTACT_NAME__r.AWS_Data_Id__c ,BILL_TO__c,SHIP_TO__c,CUSTOMER_MESSAGE__c,SWOName__c,QuotesType__c,COMPANYName__c,SUBTOTAL__c,DISCOUNT__c,TAX__c,TOTAL__c,AWS_Data_Id__c FROM Quotes__c WHERE Id = :id]; |
| | | quo = [SELECT id,ESTIMATE__c,DATE__c,EXPIRES__c,CURRENCY__c,TERMS__c,INCOTERM__c,PO__c,LEAD_TIME__c,CONTACT_EMAIL__c,CONTACT_PHONE__c,CONTACT_NAME__c,BILL_TO__c,SHIP_TO__c,CUSTOMER_MESSAGE__c,SWOName__c,QuotesType__c,COMPANYName__c,SUBTOTAL__c,DISCOUNT__c,TAX__c,TOTAL__c FROM Quotes__c WHERE Id = :id]; |
| | | List<Contact> conList = [select Id,Name from Contact where Id =: quo.CONTACT_NAME__c]; |
| | | if(conList!=null && conList.size()!=0){ |
| | | conName = conList[0].Name; |
| | |
| | | @isTest |
| | | private class QuotesPDFControllerTest { |
| | | |
| | | @TestSetup |
| | | static void setup(){ |
| | | TestDataUtility.CreatePIPolicyConfigurations(new string[]{'Quotes__c','Contact'}); |
| | | } |
| | | |
| | | static testMethod void testMethod1() { |
| | | |
| | | List<RecordType> rectIE = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = 'Customer IE']; |
| | |
| | | global class RadiationUtil { |
| | | |
| | | public static Boolean oldOrder = false; |
| | | |
| | | public static BOolean is_oly = false; |
| | | |
| | | public static Boolean EscapeOrderTriggerHandler = true; |
| | | /** |
| | | * [updateRadiationTypeQuantity description]更新代理商证照明细,更新奥林巴斯代理商的证照明细 |
| | |
| | | */ |
| | | public static void updateRadiationTypeQuantity (String Id, String orderFounder, String dealerId, Boolean toloseFlag, String operationType, String operator) { |
| | | |
| | | |
| | | String olympusAccountId = System.label.Olympus_Id ; |
| | | String olympusAccountId = System.label.Olympus_Id; |
| | | |
| | | String orderId = Id; |
| | | //获取合同的辐射类型和数量 |
| | |
| | | //查代理商的代理商购买明细 |
| | | Map<String, PurchaseDetails__c> dealerModelQuantityMap = GetPurchaseDetailsMap(dealerId); |
| | | //查奥林巴斯的代理商购买明细 |
| | | is_oly = true; |
| | | Map<String, PurchaseDetails__c> olympusModelQuantityMap = GetPurchaseDetailsMap(olympusAccountId); |
| | | is_oly = false; |
| | | // 查找 合同提交对应的代理商购买明细 |
| | | Map<String, PurchaseDetails__c> dealerResult = new Map<String, PurchaseDetails__c>(); |
| | | Map<String, PurchaseDetails__c> olympusResult = new Map<String, PurchaseDetails__c>(); |
| | |
| | | |
| | | } else {//增加已售产品数量 |
| | | reportMap.putAll(upsertChangedReport(olympusAccountId, radiationType, operationType, orderId, quantity, operator)); |
| | | is_oly = true; |
| | | olympusModelQuantityMap = insertPurchaseDetail(olympusModelQuantityMap, olympusAccountId, radiationType, radiationTypeQuantityMap); |
| | | is_oly = false; |
| | | } |
| | | } else {//减去已售产品数量 |
| | | if (toloseFlag) { |
| | |
| | | olympusResult.get(radiationType).SoldNumber__c -= quantity; |
| | | } else {//增加已售产品数量 |
| | | reportMap.putAll(upsertChangedReport(olympusAccountId, radiationType, operationType, orderId, quantity, operator)); |
| | | is_oly = true; |
| | | olympusModelQuantityMap = insertPurchaseDetail(olympusModelQuantityMap, olympusAccountId, radiationType, radiationTypeQuantityMap); |
| | | is_oly = false; |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | if ( olympusResult.size() > 0 && olympusResult != null) { |
| | | upsert olympusResult.values(); |
| | | is_oly = true; |
| | | insertReportMap.putAll(insertChangedReport(olympusResult, reportMap)); |
| | | is_oly = false; |
| | | } |
| | | |
| | | } else { |
| | |
| | | |
| | | if ( olympusModelQuantityMap.size() > 0 && olympusModelQuantityMap != null) { |
| | | upsert olympusModelQuantityMap.values(); |
| | | is_oly = true; |
| | | insertReportMap.putAll(insertChangedReport(olympusModelQuantityMap, reportMap)); |
| | | is_oly = false; |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | Map<String, Integer> radiationMap = new Map<String, Integer>(); |
| | | String accountDealerErrorMessage = updateCertificationDetails(dealerId, orderFounder, radiationMap, true); |
| | | is_oly = true; |
| | | String olympusDealerErrorMessage = updateCertificationDetails(olympusAccountId, orderFounder, radiationMap, true); |
| | | is_oly = false; |
| | | } |
| | | |
| | | } |
| | |
| | | String accountId = detail.PurchaseAccount__c; |
| | | //String accountIdafter = accountId.subString(0,15); |
| | | String key = accountId.subString(0, 15) + detail.PurProductModel__c; |
| | | |
| | | if (reportMap.containsKey(key)) { |
| | | reportMap.get(key).ChangedPurchase__c = detail.Id; |
| | | } |
| | |
| | | * @return [description] |
| | | */ |
| | | public static String updateCertificationDetails( String accountId, String orderFounder, Map<String, Decimal> dataMap, Boolean updateFlag) { |
| | | |
| | | Map<String, CertificationDetails__c> certificationDetailMap = GetAccountCertificationDetail(accountId); |
| | | |
| | | Map<String, CertificationDetails__c> temporaryCertificationDetailMap = GetAccountCertificationDetail(accountId); |
| | | |
| | | Map<String, CertificationDetails__c> certificationDetailMap = GetAccountCertificationDetail(accountId); |
| | | Map<String, CertificationDetails__c> temporaryCertificationDetailMap = GetAccountCertificationDetail(accountId); |
| | | Map<String, PurchaseDetails__c> purchaseDetailMap = GetPurchaseDetailsMap(accountId); |
| | | |
| | | Map<String, CertificationDetails__c> updatecertificationDetailMap = new Map<String, CertificationDetails__c>(); |
| | |
| | | */ |
| | | public static Map<String, CertificationDetails__c> GetAccountCertificationDetail (String accountId) { |
| | | Map<String, CertificationDetails__c> result = new Map<String, CertificationDetails__c>(); |
| | | List<CertificationDetails__c> certificationDetailsList = new List<CertificationDetails__c>(); |
| | | if (oldOrder && is_oly) { |
| | | certificationDetailsList = [ select Id, Name, ProdustionType__c, |
| | | ProductModelNumber__c, Ceiling80__c, Record80__c, Ceiling90__c, Record90__c , |
| | | CertificationDetailAccount__c, CertificationDetailAccountName__c, |
| | | LicenseInformation__r.IfQuantityCtrl__c,AccountRecordType__c,Record100__c, |
| | | Ceiling100__c |
| | | from CertificationDetails__c |
| | | where CertificationDetailAccount__c = :accountId |
| | | and ActivitieTypes__c = '销售' and IsActive__c = false]; |
| | | |
| | | }else{ |
| | | certificationDetailsList = [ select Id, Name, ProdustionType__c, |
| | | List<CertificationDetails__c> certificationDetailsList = [ select Id, Name, ProdustionType__c, |
| | | ProductModelNumber__c, Ceiling80__c, Record80__c, Ceiling90__c, Record90__c , |
| | | CertificationDetailAccount__c, CertificationDetailAccountName__c, |
| | | LicenseInformation__r.IfQuantityCtrl__c,AccountRecordType__c,Record100__c, |
| | |
| | | from CertificationDetails__c |
| | | where CertificationDetailAccount__c = :accountId |
| | | and ActivitieTypes__c = '销售' and IsActive__c = true]; |
| | | } |
| | | |
| | | |
| | | for (CertificationDetails__c detail : certificationDetailsList) { |
| | | result.put(detail.ProdustionType__c, detail); |
| | |
| | | purchaseDetail.PurProductModel__c = productModel; |
| | | purchaseDetail.PurchaseAccount__c = id; |
| | | purchaseDetail.TakeEffectInYear__c = effectiveYear; |
| | | if (oldOrder && is_oly) { |
| | | purchasedetail.company__c = '奥林巴斯'; |
| | | }else if(is_oly){ |
| | | purchaseDetail.company__c = '仪景通光学科技'; |
| | | } |
| | | |
| | | for (String model:certificationDetailMap.keySet()) { |
| | | if ('Delta和Vanta'.equals(model)) { |
| | |
| | | public static Map<String, PurchaseDetails__c> GetPurchaseDetailsMap( String accountId) { |
| | | String effectiveYear = String.valueOf(Date.today().year()); |
| | | Map<String, PurchaseDetails__c> result = new Map<String, PurchaseDetails__c>(); |
| | | List<PurchaseDetails__c> purchaseDetailsList = new List<PurchaseDetails__c>(); |
| | | if(is_oly == false){ |
| | | purchaseDetailsList = [select Id, Name, RemainingNumber__c, SoldNumber__c, |
| | | List<PurchaseDetails__c> purchaseDetailsList = [select Id, Name, RemainingNumber__c, SoldNumber__c, |
| | | PurProductModel__c, PurchaseAccount__c |
| | | from PurchaseDetails__c |
| | | where TakeEffectInYear__c = :effectiveYear and PurchaseAccount__c = :accountId]; |
| | | }else{ |
| | | if (oldOrder) { |
| | | purchaseDetailsList = [select Id, Name, RemainingNumber__c, SoldNumber__c, |
| | | PurProductModel__c, PurchaseAccount__c |
| | | from PurchaseDetails__c |
| | | where TakeEffectInYear__c = :effectiveYear and PurchaseAccount__c = :accountId and company__c = '奥林巴斯']; |
| | | }else{ |
| | | purchaseDetailsList = [select Id, Name, RemainingNumber__c, SoldNumber__c, |
| | | PurProductModel__c, PurchaseAccount__c |
| | | from PurchaseDetails__c |
| | | where TakeEffectInYear__c = :effectiveYear and PurchaseAccount__c = :accountId and company__c = '仪景通光学科技']; |
| | | } |
| | | } |
| | | if (purchaseDetailsList.size() > 0) { |
| | | for (PurchaseDetails__c purchaseDetail : purchaseDetailsList) { |
| | | result.put(purchaseDetail.PurProductModel__c, purchaseDetail); |
| | |
| | | //001修改Rest gwy start 2021-04-06 |
| | | //public class SBG001ResrException extends Exception {} |
| | | public static String status; |
| | | public static String responseBody;//dennis update for pi 2022/3/9 |
| | | public class SBG001 { |
| | | public SSBDCustomerContacts_element SSBDCustomerContacts; |
| | | } |
| | |
| | | public String ContactCode; |
| | | public String ContactEffectiveDateFrom; |
| | | public String PurposeOfAdvice; |
| | | public String DataId;//dennis update for pi 2022/3/9 |
| | | |
| | | } |
| | | //001修改Rest gwy end 2021-04-06 |
| | |
| | | || acc.RecordTypeId == '01228000000TdFG' // NDT |
| | | || acc.RecordTypeId == '01228000000TdFL' // ANI |
| | | || acc.RecordTypeId == '01228000000TdF1' // BS |
| | | || acc.RecordTypeId == '0120T0000003Cxt' // IE直销 |
| | | ) |
| | | && acc.stautesD__c == 'Pass') || acc.RecordTypeId == SBG001TriggerHandler.Account_Agency_Id //办事处 |
| | | ) { |
| | |
| | | || acc.RecordTypeId == '01228000000TdFG' // NDT |
| | | || acc.RecordTypeId == '01228000000TdFL' // ANI |
| | | || acc.RecordTypeId == '01228000000TdF1' // BS |
| | | || acc.RecordTypeId == '0120T0000003Cxt' // IE直销 |
| | | ) |
| | | && acc.stautesD__c == 'Pass' |
| | | && (acc.ManagementCode_Ext__c != old.ManagementCode_Ext__c |
| | |
| | | || con.AccountRecordTypeId__c == '01228000000TdFB' // RVI |
| | | || con.AccountRecordTypeId__c == '01228000000TdFG' // NDT |
| | | || con.AccountRecordTypeId__c == '01228000000TdF1' // BS |
| | | || con.AccountRecordTypeId__c == '0120T0000003Cxt' // IE直销 |
| | | ) |
| | | && con.StatusD__c == 'Pass') || con.AccountRecordTypeId__c == SBG001TriggerHandler.Account_Agency_Id// 办事处 |
| | | ) { |
| | |
| | | || con.AccountRecordTypeId__c == '01228000000TdFG' // NDT |
| | | || con.AccountRecordTypeId__c == '01228000000TdF1' // BS |
| | | || con.AccountRecordTypeId__c == SBG001TriggerHandler.Account_Agency_Id // 办事处 |
| | | || con.AccountRecordTypeId__c == '0120T0000003Cxt' // IE直销 |
| | | ) |
| | | && con.StatusD__c == 'Pass' |
| | | && (con.ManagementCode_Ext__c != old.ManagementCode_Ext__c |
| | |
| | | SSBDCustomerContact.CustomerDescription = acc.FacilityName__c; |
| | | SSBDCustomerContact.CustomerDescription2Description3 |
| | | = (String.isBlank(acc.DivisionName__c) ? '' : (acc.DivisionName__c=='无' ? '' : acc.DivisionName__c)); |
| | | if (acc.RecordTypeId == '01228000000TdF6' || acc.RecordTypeId == '01228000000TdFB' || acc.RecordTypeId == '01228000000TdFG' || acc.RecordTypeId == '01228000000TdFL' || acc.RecordTypeId == '0120T0000003Cxt') { // IE or RVI |
| | | if (acc.RecordTypeId == '01228000000TdF6' || acc.RecordTypeId == '01228000000TdFB' || acc.RecordTypeId == '01228000000TdFG' || acc.RecordTypeId == '01228000000TdFL') { // IE or RVI |
| | | SSBDCustomerContact.CustomerDescription2Description3 += ',' + (String.isBlank(acc.EnglishName__c) ? '' : acc.EnglishName__c); |
| | | } else { |
| | | SSBDCustomerContact.CustomerDescription2Description3 += ',' + (String.isBlank(acc.DepartmentName__c) ? '' : acc.Departmentname__c); |
| | |
| | | Phone, MobilePhone, |
| | | Fax, Email, PostCode__c, Address1__c, |
| | | CreatedDate, LastModifiedDate, |
| | | Account.UserType__c, |
| | | AWS_Data_Id__c//dennis update for pi 2022/3/9 |
| | | Account.UserType__c |
| | | from Contact where Id IN :conIds]; // 削除データを検索しないはず、All ROWS いらないはず |
| | | // System.debug(Logginglevel.DEBUG, 'SBG001_' + iflog.Name + ' conList.size()=' + conList.size()); |
| | | |
| | |
| | | SSBDCustomerContact.CustomerDescription = con.Account.FacilityName__c; |
| | | SSBDCustomerContact.CustomerDescription2Description3 |
| | | = (String.isBlank(con.Account.DivisionName__c) ? '' : (con.Account.DivisionName__c=='无' ? '' : con.Account.DivisionName__c)); |
| | | if (con.AccountRecordTypeId__c == '01228000000TdF6' || con.AccountRecordTypeId__c == '01228000000TdFB' || con.AccountRecordTypeId__c == '01228000000TdFG' || con.AccountRecordTypeId__c == '01228000000TdFL' || con.AccountRecordTypeId__c == '0120T0000003Cxt') { // IE or RVI |
| | | if (con.AccountRecordTypeId__c == '01228000000TdF6' || con.AccountRecordTypeId__c == '01228000000TdFB' || con.AccountRecordTypeId__c == '01228000000TdFG' || con.AccountRecordTypeId__c == '01228000000TdFL') { // IE or RVI |
| | | SSBDCustomerContact.CustomerDescription2Description3 += ',' + (String.isBlank(con.Account.EnglishName__c) ? '' : con.Account.EnglishName__c); |
| | | } else { |
| | | SSBDCustomerContact.CustomerDescription2Description3 += ',' + (String.isBlank(con.Account.DepartmentName__c) ? '' : con.Account.Departmentname__c); |
| | |
| | | + ',' + (String.isBlank(con.Email) ? '' : con.Email); |
| | | SSBDCustomerContact.PostalCode = String.isBlank(con.PostCode__c) ? '' : con.PostCode__c; |
| | | SSBDCustomerContact.Address = String.isBlank(con.Address1__c) ? '' : con.Address1__c; |
| | | SSBDCustomerContact.DataId = String.isBlank(con.AWS_Data_Id__c) ? '' : con.AWS_Data_Id__c; |
| | | SSBDCustomerContact.CustomerCategory = GetCustomerCategory(null,con);//'客户' + (String.isBlank(con.Account.ProductSegment__c) ? '' : con.Account.ProductSegment__c); |
| | | // JZHU-BPQBVK-IE最终用户接口传输逻辑变更(update-Start-20200525) |
| | | SSBDCustomerContact.UserType = ''; |
| | |
| | | } else { |
| | | logstr = iflog.Log__c; |
| | | } |
| | | // 添加aws上线开关 by sushanhu 20220419 |
| | | Boolean piOn =AWSServiceTool.getAWSServiceStatus(); |
| | | try{ |
| | | if (piOn) { |
| | | //update to aws 2022/3/9 dennis |
| | | PIHelper.PIIntegration pi =PIHelper.getPIIntegrationInfo('SBG001'); |
| | | // NFMUtil.response result =NFMUtil.sendToPiAWS(rowDataStr,pi.newUrl,pi.token); |
| | | AWSServiceTool.response result = AWSServiceTool.sendToPiAWS(rowDataStr,pi.newUrl,pi.token); |
| | | system.debug('aws result---'+result); |
| | | status = result.status; |
| | | system.debug('aws status---'+status); |
| | | responseBody=result.responseBody; |
| | | // Map<String, Object> res = (Map<String, Object>)JSON.deserializeUntyped(responseBody); |
| | | // status=(String)res.get(status); |
| | | if ('200'.equals(status)) { |
| | | |
| | | status = NFMUtil.sendToSapRet(rowDataStr, NFMUtil.SBG001_ENDPOINT); |
| | | system.debug('status--->'+status); |
| | | if (status == 'OK') { |
| | | logstr += '\nstatus='+status; |
| | | rowData.retry_cnt__c = 0; |
| | | } else { |
| | | } else { |
| | | if (rowData.retry_cnt__c == null) rowData.retry_cnt__c = 0; |
| | | if (rowData.retry_cnt__c < batch_retry_max_cnt) { |
| | | rowData.retry_cnt__c++; |
| | | LogAutoSendSchedule.assignOneMinute(); |
| | | } |
| | | if (rowData.retry_cnt__c >= batch_retry_max_cnt) { |
| | | //add respomseBody 记录错误信息 by sushanhu 20220406 start |
| | | rowData.ErrorLog__c = 'status:' + status +responseBody+ |
| | | rowData.ErrorLog__c = 'status:' + status + |
| | | '\n错误次数已经超过自动送信设定的最大次数,请手动送信'; |
| | | //add respomseBody 记录错误信息 by sushanhu 20220406 end |
| | | } |
| | | } |
| | | //update to aws 2022/3/9 dennis |
| | | logstr += '\nend'; |
| | | }else { |
| | | status = NFMUtil.sendToSapRet(rowDataStr, NFMUtil.SBG001_ENDPOINT); |
| | | system.debug('status--->'+status); |
| | | if (status == 'OK') { |
| | | logstr += '\nstatus='+status; |
| | | rowData.retry_cnt__c = 0; |
| | | } else { |
| | | if (rowData.retry_cnt__c == null) rowData.retry_cnt__c = 0; |
| | | if (rowData.retry_cnt__c < batch_retry_max_cnt) { |
| | | rowData.retry_cnt__c++; |
| | | LogAutoSendSchedule.assignOneMinute(); |
| | | } |
| | | if (rowData.retry_cnt__c >= batch_retry_max_cnt) { |
| | | rowData.ErrorLog__c = 'status:' + status + |
| | | '\n错误次数已经超过自动送信设定的最大次数,请手动送信'; |
| | | } |
| | | } |
| | | logstr += '\nend'; |
| | | // rowData.retry_cnt__c=0; |
| | | } |
| | | |
| | | logstr += '\nend'; |
| | | // rowData.retry_cnt__c=0; |
| | | }catch(Exception ex) { |
| | | // TODO IOException |
| | | // エラーが発生した場合 |
| | |
| | | @isTest |
| | | private class SBG001TriggerHandlerTest { |
| | | //add sushanhu for pipl 20220415 |
| | | @testSetup |
| | | static void makaDate(){ |
| | | TestDataUtility.CreatePIPolicyConfiguration('SBG001'); |
| | | } |
| | | //add sushanhu for pipl 20220415 |
| | | static testMethod void myUnitTest() { |
| | | List<RecordType> rectIE = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = 'Customer IE']; |
| | | List<RecordType> rectDealer = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = 'Dealer']; |
| | |
| | | public static Set<Id> SBG007_Ids = new Set<Id>(); |
| | | //007修改Rest gwy start 2021-04-06 |
| | | public static String status; |
| | | public static String responseBody;//dennis 2022/3/3 |
| | | public class SBG007 { |
| | | public GeDatas_element GeDatas; |
| | | } |
| | |
| | | public String Other2; |
| | | public String Other3; |
| | | public GeDataDetails_element[] GeDataDetails; |
| | | //dennis start for pi 2022/3/3 |
| | | public String DataId; |
| | | |
| | | } |
| | | public class GeDataDetails_element { |
| | |
| | | * @param oppIds 送信対象商談(論理上1件のみです) |
| | | * @param purposeOfAdviceMap 1:Delete 2:Add(Insert) 3:Change(Update) |
| | | */ |
| | | |
| | | @future (callout=true) |
| | | public static void callout(String iflog_Id, List<String> oppIds, Map<String, String> purposeOfAdviceMap) { |
| | | System.debug('进入callout'); |
| | | if (oppIds == null || oppIds.size() == 0) { |
| | | return; |
| | | } |
| | |
| | | EndUser__c, Machine_Parts__c, |
| | | SalesChannel__c, ExpectedDeliveryDate__c, DealerId__c,Dealer__r.ManagementCode_F__c,Dealer__r.ManagementCode_Ext__c,DealerSalesStaffName__c, |
| | | ForeignTradeCompany__c, SpecialDeliveryAddress__c, |
| | | SyncedQuoteId, |
| | | AWS_Data_Id__c //dennis start for pi 2022/3/3 |
| | | SyncedQuoteId |
| | | from Opportunity where Id IN :oppIds]; |
| | | System.debug('11111 oppList='+oppList); |
| | | |
| | |
| | | quotation.DealerSalesStaffName = opp.DealerSalesStaffName__c; |
| | | quotation.ForeignTradeCompany = opp.ForeignTradeCompany__c; |
| | | quotation.SpecialDeliveryAddress = opp.SpecialDeliveryAddress__c; |
| | | quotation.DataId = opp.AWS_Data_Id__c;//dennis start for pi 2022/3/3 |
| | | |
| | | //007修改Rest gwy start 2021-04-06 |
| | | quotation.GeDataDetails = new List<GeDataDetails_element>(); |
| | |
| | | } else { |
| | | logstr = iflog.Log__c; |
| | | } |
| | | // 添加aws上线开关 by sushanhu 20220419 |
| | | Boolean piOn =AWSServiceTool.getAWSServiceStatus(); |
| | | try{ |
| | | //add by sushanhu for test 20220421 |
| | | //piOn=false; |
| | | if (piOn) { |
| | | //update to aws 2022/3/3 dennis |
| | | PIHelper.PIIntegration pi =PIHelper.getPIIntegrationInfo('SBG007'); |
| | | // NFMUtil.response result =NFMUtil.sendToPiAWS(rowDataStr,pi.newUrl,pi.token); |
| | | AWSServiceTool.response result = AWSServiceTool.sendToPiAWS(rowDataStr,pi.newUrl,pi.token);//202204 25 update by sushanhu for pipl |
| | | system.debug('aws result---'+result); |
| | | status = result.status; |
| | | responseBody=result.responseBody; |
| | | system.debug('aws status--'+status); |
| | | if ('200'.equals(status)) { |
| | | logstr += status + '\n'; |
| | | rowData.retry_cnt__c = 0; |
| | | } |
| | | else { |
| | | if (rowData.retry_cnt__c == null) rowData.retry_cnt__c = 0; |
| | | if (rowData.retry_cnt__c < batch_retry_max_cnt) { |
| | | rowData.retry_cnt__c++; |
| | | LogAutoSendSchedule.assignOneMinute(); |
| | | } |
| | | if (rowData.retry_cnt__c >= batch_retry_max_cnt) { |
| | | |
| | | rowData.ErrorLog__c = 'status:' + status +responseBody// update 加入错误的返回体 sushanhu20220406 |
| | | +'\n错误次数已经超过自动送信设定的最大次数,请手动送信'; |
| | | } |
| | | } |
| | | }else { |
| | | // 007修改Rest gwy start 2021-04-12 |
| | | status = NFMUtil.sendToSapRet(rowDataStr, NFMUtil.SBG007_ENDPOINT); |
| | | if (status == 'OK') { |
| | | logstr += '\n' + status; |
| | | rowData.retry_cnt__c = 0; |
| | | } else { |
| | | if (rowData.retry_cnt__c == null) rowData.retry_cnt__c = 0; |
| | | if (rowData.retry_cnt__c < batch_retry_max_cnt) { |
| | | rowData.retry_cnt__c++; |
| | | LogAutoSendSchedule.assignOneMinute(); |
| | | } |
| | | if (rowData.retry_cnt__c >= batch_retry_max_cnt) { |
| | | rowData.ErrorLog__c = 'status:' + status + |
| | | '\n错误次数已经超过自动送信设定的最大次数,请手动送信'; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | //gaozw |
| | | /*Sbg007Sync.HTTPS_Port stub = new Sbg007Sync.HTTPS_Port(); |
| | | stub.timeout_x = 100000; // timeout in milliseconds |
| | |
| | | if (NFMUtil.CLIENT_CERT_NAME != null) { |
| | | stub.clientCertName_x = NFMUtil.CLIENT_CERT_NAME; |
| | | }*/ |
| | | |
| | | //comment by dennis 2022/3/3 end |
| | | //007修改Rest gwy start 2021-04-12 |
| | | status = NFMUtil.sendToSapRet(rowDataStr, NFMUtil.SBG007_ENDPOINT); |
| | | if (status == 'OK') { |
| | | logstr += '\n' + status; |
| | | rowData.retry_cnt__c = 0; |
| | | } else { |
| | | if (rowData.retry_cnt__c == null) rowData.retry_cnt__c = 0; |
| | | if (rowData.retry_cnt__c < batch_retry_max_cnt) { |
| | | rowData.retry_cnt__c++; |
| | | LogAutoSendSchedule.assignOneMinute(); |
| | | } |
| | | if (rowData.retry_cnt__c >= batch_retry_max_cnt) { |
| | | rowData.ErrorLog__c = 'status:' + status + |
| | | '\n错误次数已经超过自动送信设定的最大次数,请手动送信'; |
| | | } |
| | | } |
| | | //007修改Rest gwy end 2021-04-12 |
| | | //Sbg007Sync.GeDatas_element[] pQuotations = new Sbg007Sync.GeDatas_element[] { quotations }; |
| | | //OlympusCoJpCommonMessage.LOG_element[] logs = stub.SBG007_Sync_BC2GPI(pQuotations); |
| | | //comment by dennis 2022/3/3 |
| | | rowData.retry_cnt__c=0; |
| | | }catch(Exception ex) { |
| | | // TODO IOException |
| | |
| | | @isTest |
| | | private class SBG007TriggerHandlerTest |
| | | { |
| | | //add sushanhu for pipl 20220415 |
| | | @testSetup |
| | | static void makaDate(){ |
| | | TestDataUtility.CreatePIPolicyConfiguration(); |
| | | } |
| | | //add sushanhu for pipl 20220415 |
| | | // static testMethod void itShould(){ |
| | | // List<RecordType> rectIE = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = 'Customer IE']; |
| | | // Account accIE = new Account( |
| | |
| | | // } |
| | | |
| | | static testMethod void itShould2(){ |
| | | |
| | | List<RecordType> rectIE = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = 'Customer IE']; |
| | | Account accIE = new Account( |
| | | Name = '*', |
| | |
| | | System.assertEquals('', SBG007TriggerHandler.debug_msg); |
| | | |
| | | } |
| | | |
| | | static testMethod void itShould1(){ |
| | | BatchIF_Log__c iflog = new BatchIF_Log__c(); |
| | | iflog.Log__c = '{"GeDatas":{"Monitoring":{"TransmissionDateTime":"202108250938","Text":"","Tag":"MSGH","Sender":"8405","Receiver":"1330","NumberOfRecord":"1","MessageType":"SBG027","MessageGroupNumber":"20210000465499"},"GeData":[{"ZNMPA":"N","TradeType":"Taxation","SpecialWarranty":null,"SpecialDeliveryAddress":"3000002093,C-2018-72066","ServiceFee":null,"SalesChannel":"41","SalesAccountCode":"76002795","PurposeOfAdvice":null,"ProductSegment":"BS","PaymentCondition":"ZZTT","Other3":"null,null","Other2":"跨省份合作项目","Other1":"test,dealer","OrderCode":"00050193","OpportunityCode":"O-2021-115172","OlympusPriceBeforeDiscount":null,"OlympusContractPrices":729412.00,"MachineParts":"Machine","GeDataDetails":[{"ItemQuantity":20,"ItemCode":"000000000006498300","DetailLine":10},{"ItemQuantity":20,"ItemCode":"N2664900","DetailLine":20}],"ForeignTradeCompany":null,"EndUser":"C-2016-25119","Discount":49.00,"DeliveryDate":"20210825","DealerSalesStaffName":"a","DealerCode":"3000002093","CoopAgentPCT":"50","CoopAgent":"A-2021-120990"}]}}'; |
| | | insert iflog; |
| | | SBG007TriggerHandler.execute(iflog,null); |
| | | } |
| | | |
| | | } |
| | |
| | | /** |
| | | * @description : |
| | | * @author : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | * @group : |
| | | * @last modified on : 03-09-2022 |
| | | * @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | **/ |
| | | public without sharing class SBG027Controller { |
| | | public static String responseBody;//dennis 2022/3/9 |
| | | public static String status;//dennis 2022/3/9 |
| | | |
| | | public class SBG027 { |
| | | public GeDatas_element GeDatas; |
| | | } |
| | |
| | | public String SalesChannel; |
| | | public String DealerCode; |
| | | public String DealerSalesStaffName; |
| | | public String DataId; //dennis update for pi 2022/3/9 |
| | | public String DeliveryDate; |
| | | public String PaymentCondition; |
| | | public String SpecialWarranty; |
| | |
| | | Opportunity.SalesChannel__c, Opportunity.ExpectedDeliveryDate__c, Opportunity.DealerId__c,Opportunity.DealerSalesStaffName__c,OlympusContractPricesD__c,SpecialDeliveryContact_D__c,Opportunity.SpecialDeliveryContact_D__r.ManagementCode_F__c, |
| | | Opportunity.ForeignTradeCompany__c, Opportunity.SpecialDeliveryAddress__c,PaymentTerms__c,SpecialDeliveryContact__c,PDF_Sp_Shipment_Term__c,PDF_Sp_ShippingTerms__c, |
| | | ForeignTradeCompany_D__r.ManagementCode_F__c, SpecialDeliveryAccount_D__r.ManagementCode_F__c, SpecialDeliveryContact2_D__r.ManagementCode_F__c,Opportunity.Dealer__r.DummyDealer__c,ContractPriceTotal__c, |
| | | If_Supervise__c,CrossCooperativeDealerCode__c,SplitRatio__c,CrossCooperativeProject__c,Level_Category__c, |
| | | Opportunity.AWS_Data_Id__c //dennis start for pi 2022/3/3 |
| | | If_Supervise__c,CrossCooperativeDealerCode__c,SplitRatio__c,CrossCooperativeProject__c,Level_Category__c |
| | | from order where Id IN :ordIds ]; |
| | | //List<order> ordList = [select Id,Name,Opportunity.Name, Opportunity.CurrencyIsoCode,OrderNumber,Opportunity.ForeignTradeCompany__r.ManagementCode_F__c,CustomerContractPriceD__c,SpecialCondition_text__c,SalesChannel__c, |
| | | // Owner.Name,Opportunity.AccountId__c,Opportunity.InquiryNumber__c,Opportunity.SpecialDeliveryAddress__r.ManagementCode_F__c, ServiceFee_D__c,Opportunity.SpecialDeliveryAddress_D__c,Opportunity.SpecialDeliveryAddress_D__r.ManagementCode_F__c, |
| | |
| | | quotation.EndUser = ord.EndUserD__r.ManagementCode_F__c; |
| | | quotation.DeliveryDate = NFMUtil.formatDate2Str(ord.ExpDelDate__c); |
| | | quotation.ServiceFee = ord.ServiceFee_D__c; |
| | | quotation.DataId = ord.Opportunity.AWS_Data_Id__c;//dennis start for pi 2022/3/9 update to oppotuinity dataid |
| | | //2017/01/15追加 |
| | | if(ord.Opportunity.SalesChannel__c == 'direct' && ord.Opportunity.Machine_Parts__c == 'Parts'){ |
| | | quotation.Discount = 0; |
| | |
| | | quotation.Other2 = other2;//ord.SpecialCondition_text__c; |
| | | quotation.Other3 = ord.Shipment_Term_D__c + ',' + ord.Shipment_Term2_D__c; |
| | | // 跨区域销售 XHL 20210831 Start |
| | | /*quotation.CoopAgent = ''; |
| | | quotation.CoopAgentPCT = ''; |
| | | if (ord.CrossCooperativeProject__c) {//跨省份合作项目 |
| | | quotation.CoopAgent = ord.Dealer_B__r.ManagementCode_F__c;//合作区域代理商Code |
| | | quotation.DealerCode = ord.Dealer_A__r.ManagementCode_Ext__c; |
| | | quotation.DealerSalesStaffName = ord.DealerSalesStaffNameA__c; |
| | | String splitRatio = ord.SplitRatio__c; |
| | | if (String.isNotBlank(splitRatio) && splitRatio.indexof(':') > 0) { |
| | | Integer pct = Integer.valueOf(splitRatio.split(':')[1].trim())*10; |
| | | quotation.CoopAgentPCT = String.valueof(pct);//业绩拆分比例(取:后边的值*10) |
| | | } |
| | | } */ |
| | | |
| | | quotation.CoopAgent = ''; |
| | | quotation.CoopAgentPCT = ''; |
| | | if (ord.CrossCooperativeProject__c) {//跨省份合作项目 |
| | |
| | | } else { |
| | | logstr = iflog.Log__c; |
| | | } |
| | | // 添加aws上线开关 by sushanhu 20220420 |
| | | Boolean piOn =AWSServiceTool.getAWSServiceStatus(); |
| | | try{ |
| | | //add by sushanhu for test 20220421 |
| | | //piOn=false; |
| | | if (piOn) { |
| | | //update to aws 2022/3/9 dennis |
| | | PIHelper.PIIntegration pi =PIHelper.getPIIntegrationInfo('SBG027'); |
| | | // NFMUtil.response result =NFMUtil.sendToPiAWS(rowDataStr,pi.newUrl,pi.token); |
| | | AWSServiceTool.response result = AWSServiceTool.sendToPiAWS(rowDataStr,pi.newUrl,pi.token);//update forpipl by sushanhu 20220425 |
| | | system.debug('aws result---'+result); |
| | | status = result.status; |
| | | system.debug('aws status--'+status); |
| | | responseBody=result.responseBody; |
| | | // Map<String, Object> res = (Map<String, Object>)JSON.deserializeUntyped(responseBody); |
| | | // status=(String)res.get(status); |
| | | if ('200'.equals(status)) { |
| | | logstr += status + '\n'; |
| | | rowData.retry_cnt__c = 0; |
| | | } |
| | | //add by sushanhu 20220406 写入错误日志 start |
| | | else { |
| | | iflog.ErrorLog__c +=responseBody; |
| | | } |
| | | //add by sushanhu 20220406 写入错误日志 end |
| | | }else { |
| | | NFMUtil.sendToSap(rowDataStr, NFMUtil.SBG027_ENDPOINT); |
| | | rowData.retry_cnt__c = 0; |
| | | |
| | | } |
| | | |
| | | NFMUtil.sendToSap(rowDataStr, NFMUtil.SBG027_ENDPOINT); |
| | | rowData.retry_cnt__c = 0; |
| | | }catch(Exception ex) { |
| | | // TODO IOException |
| | | // エラーが発生した場合 |
| | |
| | | @isTest |
| | | public class SBG027TriggerHandleTest { |
| | | static String setdata(){ |
| | | //add by sushanhu 20220415 start |
| | | TestDataUtility.CreatePIPolicyConfiguration('SBG027'); |
| | | //add by sushanhu 20220415 end |
| | | Id pricebookId = Test.getStandardPricebookId(); |
| | | Pricebook2 pricebook = new Pricebook2( |
| | | Name = 'IE', |
| | |
| | | opp.Dealer__c = buyer.Id; |
| | | opp.RecordTypeId = rectOpp[0].Id; |
| | | opp.OwnerId = UserInfo.getUserId(); |
| | | opp.StageName = 'Phase3';//修改为Prospect Created 原来是Phase3 |
| | | opp.StageName = 'Phase3'; |
| | | opp.CurrencyIsoCode = 'CNY'; |
| | | opp.ProductSegment__c = 'IE'; |
| | | opp.CloseDate = Date.today(); |
| | |
| | | public static void deleteAccountLicenseInformation(Map<String, Account> accountMap) { |
| | | |
| | | System.debug('deleteAccountLicenseInformation--->Start'); |
| | | List<License_Information__c> existList = [select id, Name, AccountManagementCode__c,Is_Active_Formula__c |
| | | from License_Information__c where AccountManagementCode__c In :accountMap.keySet() and Is_Active_Formula__c = true]; |
| | | List<License_Information__c> existList = [select id, Name, AccountManagementCode__c |
| | | from License_Information__c where AccountManagementCode__c In :accountMap.keySet()]; |
| | | |
| | | if (existList.size() > 0) { |
| | | delete existList; |
| | |
| | | @RestResource(urlMapping = '/SBG203/*') |
| | | global with sharing class SBG203Rest { |
| | | //add Response to aws 20220311 add sushanhu for pipl |
| | | |
| | | static Boolean SFStatus=true; |
| | | static String SFMessage=''; |
| | | //add Response to aws 20220311 add sushanhu for pipl |
| | | |
| | | global class GeDatas { |
| | | public NFMUtil.Monitoring Monitoring; |
| | |
| | | public String BPCodeforeign; //免税 |
| | | public String BPType; //合作伙伴类型 |
| | | public String RegisterAddress; //住所(等同注册地址) |
| | | public String RegisterAddressEncrypted;// add by sushanhu 存储register密文 |
| | | public String RegionName; //省别 |
| | | public String City; //市 |
| | | public String Phone; //合作伙伴电话 |
| | |
| | | public String ContactMobilePhone; //收货人手机 |
| | | public String CITY1; //收货人城市 |
| | | public String ContactEnglishName; //英文名称 |
| | | // add for pi sushanhu 20220309 start |
| | | public String ContactNameEncrypted; //收货人名称密文 |
| | | public String ContactPhoneEncrypted; //收货人电话密文 |
| | | public String PostalCodeEncrypted; //邮编密文 |
| | | public String ContactAddressEncrypted; //收货地址密文 |
| | | public String ContactMobilePhoneEncrypted; //收货人手机密文 |
| | | public String ContactEnglishNameEncrypted; //英文名称密文 |
| | | //delete by sushanhu 和客户沟通 后期 不赋值这个字段 satrt 20220411 |
| | | // public String EnglishAddress; //英文地址 |
| | | // public String EnglishAddressEncrypted;// 英文地址密文 |
| | | //delete by sushanhu 和客户沟通 后期 不赋值这个字段 end 20220411 |
| | | public String DataId; //aws存储凭据 |
| | | // add for pi sushanhu 20220309 end |
| | | } |
| | | |
| | | // 销售人层级 |
| | |
| | | // 取得接口传输内容 |
| | | String strData = RestContext.request.requestBody.toString(); |
| | | GeDatas ges = (GeDatas) JSON.deserializeStrict(strData, GeDatas.class); |
| | | |
| | | if (ges == null) { |
| | | return; |
| | | } |
| | |
| | | RestResponse res = RestContext.response; |
| | | res.addHeader('Content-Type', 'application/json'); |
| | | res.statusCode = 200; |
| | | // 添加aws上线开关 by sushanhu 20220422 |
| | | Boolean piOn =AWSServiceTool.getAWSServiceStatus(); |
| | | // test |
| | | // piOn =false; |
| | | if (piOn) { |
| | | //update response to aws 20220311 sushanhu for pipl start |
| | | // result.SFStatus=SFStatus; |
| | | // result.SFMessage=SFMessage; |
| | | // String jsonResponse =JSON.serialize(result); |
| | | // system.debug('result---'+jsonResponse); |
| | | String jsonResponse = '{"staticResponse":{"status":"0","Message":""},"SFStatus":true,"SFMessage":""}' ; |
| | | res.responseBody = blob.valueOf(jsonResponse); |
| | | //update response to aws 20220311 sushanhu for pipl end |
| | | }else { |
| | | String jsonResponse = '{"status": "0", "Message":""}'; |
| | | res.responseBody = blob.valueOf(jsonResponse); |
| | | } |
| | | String jsonResponse = '{"status": "0", "Message":""}'; |
| | | res.responseBody = blob.valueOf(jsonResponse); |
| | | return; |
| | | } |
| | | |
| | |
| | | con.PostcodeD__c = consigneeInfo.PostalCode; |
| | | con.Address1__c = gda.BPType == '22' ? gda.RegisterAddress : consigneeInfo.ContactAddress; |
| | | con.Address1D__c = gda.BPType == '22' ? gda.RegisterAddress : consigneeInfo.ContactAddress; |
| | | //update to aws pi start 20220309 sushanhu |
| | | // con.EnglishAddress__c = gda.BPType == '22' ? gda.STR_SUPPL1 : ''; |
| | | //判断在aws执行 |
| | | con.Address1_Encrypted__c = gda.BPType == '22' ? gda.RegisterAddressEncrypted : consigneeInfo.ContactAddressEncrypted; |
| | | con.Address1D_Encrypted__c = gda.BPType == '22' ? gda.RegisterAddressEncrypted : consigneeInfo.ContactAddressEncrypted; |
| | | con.Postcode_Encrypted__c = consigneeInfo.PostalCodeEncrypted; |
| | | con.PostcodeD_Encrypted__c = consigneeInfo.PostalCodeEncrypted; |
| | | //delete by sushanhu 和客户沟通 后期 不赋值这个字段 satrt 20220411 |
| | | // con.EnglishAddress__c = gda.BPType == '22' ? consigneeInfo.EnglishAddress : ''; |
| | | // con.EnglishAddress_Encrypted__c=gda.BPType == '22' ?consigneeInfo.EnglishAddressEncrypted : ''; |
| | | //delete by sushanhu 和客户沟通 后期 不赋值这个字段 end 20220411 |
| | | //update to aws pi start 20220309 sushanhu end |
| | | con.EnglishAddress__c = gda.BPType == '22' ? gda.STR_SUPPL1 : ''; |
| | | if (String.isNotBlank(consigneeInfo.ContactEnglishName) && gda.BPType == '22') { |
| | | //update for pipl 和客户沟通 密文显示位数不变 20220411 start |
| | | // con.LastName = consigneeInfo.ContactName + '(' + consigneeInfo.ContactEnglishName + ')'; |
| | | con.LastName = consigneeInfo.ContactName ; |
| | | //update for pipl 和客户沟通 密文显示位数不变 20220411 end |
| | | |
| | | con.LastName = consigneeInfo.ContactName + '(' + consigneeInfo.ContactEnglishName + ')'; |
| | | con.FirstName = null; |
| | | con.FirstName_Encrypted__c =null; ////add for pipl susahnhu 20220311 |
| | | con.ContactEnglishName__c = consigneeInfo.ContactEnglishName; |
| | | con.ContactEnglishName_Encrypted__c= consigneeInfo.ContactEnglishNameEncrypted;//add for pipl susahnhu 20220311 |
| | | } else { |
| | | con.LastName = consigneeInfo.ContactName; |
| | | con.FirstName = null; |
| | | con.FirstName_Encrypted__c =null; ////add for pipl susahnhu 20220311 |
| | | } |
| | | //add for pipl susahnhu 20220311 start |
| | | con.LastName_Encrypted__c = consigneeInfo.ContactNameEncrypted; |
| | | con.AWS_Data_Id__c = consigneeInfo.DataId;// AWS 存储凭据 add for pipl susahnhu 20220311 |
| | | con.MobilePhone_Encrypted__c = consigneeInfo.ContactPhoneEncrypted; |
| | | con.MobilePhoneD_Encrypted__c = consigneeInfo.ContactPhoneEncrypted; |
| | | con.Phone_Encrypted__c = consigneeInfo.ContactPhoneEncrypted; |
| | | con.PhoneD_Encrypted__c = consigneeInfo.ContactPhoneEncrypted; |
| | | //add for pipl susahnhu 20220311 end |
| | | |
| | | con.ContactStatus__c = 'Active'; |
| | | con.ContactStatusD__c = 'Active'; |
| | | con.StatusD__c = 'Pass'; |
| | |
| | | } |
| | | // 将代理商的合作伙伴客户设置为假 |
| | | accountInfo.Dealer_Type__c = NFMUtil.getMapValue(transferMap, 'Dealer_Type__c', gda.AgentType, iflog); |
| | | //accountInfo.EnglishAddress__c = gda.RegisterAddress; |
| | | //update to oher1 add by sushanhu 20220422 start |
| | | accountInfo.EnglishAddress__c = gda.other1; |
| | | //update to oher1 add by sushanhu 20220422 end |
| | | accountInfo.EnglishAddress__c = gda.RegisterAddress; |
| | | } else if (gda.BPType == '22') { |
| | | accountInfo.RecordTypeId = '01228000000TF3Q'; //外贸公司 |
| | | accountInfo.Name = gda.CompanyName; |
| | |
| | | accountInfo.EnglishNameD__c = gda.CompanyEnglishName; |
| | | accountInfo.City__c = gda.City; |
| | | accountInfo.CityD__c = gda.City; |
| | | //update to oher1 add by sushanhu 20220422 start |
| | | // accountInfo.Address1__c = gda.RegisterAddress; |
| | | // accountInfo.Address1D__c = gda.RegisterAddress; |
| | | accountInfo.Address1__c = gda.other1; |
| | | accountInfo.Address1D__c = gda.other1; |
| | | //update to oher1 add by sushanhu 20220422 end |
| | | accountInfo.Address1__c = gda.RegisterAddress; |
| | | accountInfo.Address1D__c = gda.RegisterAddress; |
| | | accountInfo.Phone = gda.Phone; |
| | | accountInfo.PhoneD__c = gda.Phone; |
| | | accountInfo.Fax = gda.Fax; |
| | |
| | | public static Dealer_Discount__c dealerDiscount3; |
| | | @testSetup |
| | | static void inittransfersData() { |
| | | //add sushanhu for pipl 20220415 |
| | | //'SBG203' |
| | | TestDataUtility.CreatePIPolicyConfiguration(); |
| | | |
| | | //add sushanhu for pipl 20220415 |
| | | NFMUtil.EscapeSBG001TriggerHandler = true; |
| | | List<RecordType> rectIE = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = 'Dealer']; |
| | | Account acc0 = new Account( |
| | |
| | | |
| | | public List<RepairPart__c> rpList {get; set;} |
| | | |
| | | public List<FileAddress__c> attachmentList {get; set;} |
| | | public List<Attachment> attachmentList {get; set;} |
| | | |
| | | public List<diagnosisInfo> diagnosisList {get; set;} |
| | | |
| | |
| | | public RepairPart__c repairPart{get;set;} |
| | | |
| | | private String SwoStatus; |
| | | public String staticResource { get; private set; }// 20220313 PI改造 by Chen Yanan |
| | | public String contactstaticResource { get; private set; }// 20220313 PI改造 by Chen Yanan |
| | | public String contactAWSDataId { get; private set; }// 20220313 PI改造 by Chen Yanan |
| | | public String contactName { get; private set; }// 20220422 PI改造 by zhj |
| | | public String swoawsDataId{set;get;}// 20220313 PI改造 by Chen Yanan |
| | | public Boolean isNew { get; set; }// 20220313 PI改造 by Chen Yanan |
| | | public String frontCaseId { get; set; }// 20220422 PI改造 by zhj |
| | | public String frontSwoId { get; set; }// 20220424 PI改造 by zhj |
| | | //ASSIGNEDTO__c |
| | | public SWOController() { |
| | | |
| | | } |
| | | |
| | | public SWOController(ApexPages.StandardController stdController) { |
| | | isNew = true; |
| | | swoid = System.currentPageReference().getParameters().get('id'); |
| | | caseId = System.currentPageReference().getParameters().get('caseId'); |
| | | accId = System.currentPageReference().getParameters().get('accId'); |
| | | conId = System.currentPageReference().getParameters().get('conId'); |
| | | type = System.currentPageReference().getParameters().get('type'); |
| | | staticResource = JSON.serialize(PIHelper.getPIIntegrationInfo('SWO__c'));// 20220313 PI改造 by Chen Yanan |
| | | contactstaticResource = JSON.serialize(PIHelper.getPIIntegrationInfo('Contact'));// 20220313 PI改造 by Chen Yanan |
| | | System.debug(caseId); |
| | | } |
| | | |
| | | public void init() { |
| | | |
| | | lineCount = 0; |
| | | //获取初始URL |
| | | baseUrl = URL.getSalesforceBaseUrl().toExternalForm(); |
| | |
| | | User_FaultInfo__c ca = new User_FaultInfo__c(); |
| | | List<SWO__c> temp = new List<SWO__c>(); |
| | | if (caseId != null) { |
| | | // ca = [select id, NUMBER__c,COMPANY__c,CONTACT__c,SUBJECT__c from User_FaultInfo__c where id = : caseId]; |
| | | ca = [select id, NUMBER__c,COMPANY__c,CONTACT__c,SUBJECT__c, CONTACT__r.AWS_Data_Id__c, CONTACT__r.Name, CONTACT__r.Email from User_FaultInfo__c where id = : caseId];// 20220313 PI改造 by Chen Yanan |
| | | ca = [select id, NUMBER__c,COMPANY__c,CONTACT__c,SUBJECT__c from User_FaultInfo__c where id = : caseId]; |
| | | temp = [select id from SWO__c where CASE_NUMBER__c = :caseId]; |
| | | contactAWSDataId = String.isNotBlank(ca.CONTACT__r.AWS_Data_Id__c)?ca.CONTACT__r.AWS_Data_Id__c:''; |
| | | contactName = String.isNotBlank(ca.CONTACT__r.Name)?ca.CONTACT__r.Name:''; |
| | | } |
| | | System.debug('ca' + ca.NUMBER__c); |
| | | System.debug('temp' + temp.size()); |
| | | if (swoid != null) { |
| | | isNew = false;// 20220313 PI改造 by Chen Yanan |
| | | //初始化SWO |
| | | Schema.DescribeSobjectResult d_swo = SWO__c.sObjectType.getDescribe(); |
| | | Map<String, Schema.SObjectField> d_swo_map = d_swo.fields.getMap(); |
| | |
| | | } |
| | | fields_odr += field; |
| | | } |
| | | // soql_swo += fields_odr; |
| | | soql_swo += fields_odr + ', CONTACT__r.AWS_Data_Id__c, CONTACT__r.Name, CONTACT__r.Email ';// 20220313 PI改造 by Chen Yanan |
| | | soql_swo += fields_odr; |
| | | soql_swo += ' from SWO__c where Id = \'' + swoid + '\''; |
| | | System.debug('soql_swo: ' + soql_swo);// 20220313 PI改造 by Chen Yanan |
| | | List<SWO__c> swoList = Database.query(soql_swo); |
| | | System.debug('swoList: ' + swoList);// 20220313 PI改造 by Chen Yanan |
| | | if (swoList.size() > 0) { |
| | | swo = swoList[0]; |
| | | swoawsDataId = swo.AWS_Data_Id__c;// 20220313 PI改造 by Chen Yanan |
| | | // contactAWSDataId = String.isNotBlank(swo.CONTACT__r.AWS_Data_Id__c)?swo.CONTACT__r.AWS_Data_Id__c:'';// 20220313 PI改造 by Chen Yanan |
| | | } |
| | | //初始化记录SWO 原始ASSIGNED TO,保存时判断用户是否变更,如果变更给用户发送邮件 |
| | | assignedUser = swo.ASSIGNEDTO__c; |
| | | //初始化Mail Merge |
| | | List<String> mailIdList = new List<String>(); |
| | | |
| | | List<FileAddress__c> attList = new List<FileAddress__c>(); |
| | | Map<String, List<FileAddress__c>> attMap = new Map<String, List<FileAddress__c>>(); |
| | | List<Attachment> attList = new List<Attachment>(); |
| | | Map<String, List<Attachment>> attMap = new Map<String, List<Attachment>>(); |
| | | |
| | | Map<String, Mail_Merge__c> mailMap = new Map<String, Mail_Merge__c>([select id, FROM__c, ccName__c, SUBJECT__c, MESSAGE__c, DATE__c, toName__c, EMAIL_SENT__c from Mail_Merge__c where SWO__c = :swoid order by id]); |
| | | //mailMap = [select id,FROM__c,ccName__c,SUBJECT__c,MESSAGE__c from Mail_Merge__c where SWO__c = :id order by id]; |
| | |
| | | if (mailMap != null) { |
| | | mailIdList.addAll(mailMap.keySet()); |
| | | |
| | | attList = [select id, Name, ParentRecordId__c,FileName__c from FileAddress__c where ParentRecordId__c in :mailIdList order by ParentRecordId__c, id]; |
| | | attList = [select id, Name, ParentId from Attachment where ParentId in :mailIdList order by ParentId, id]; |
| | | if (attList.size() > 0) { |
| | | for (FileAddress__c att : attList) { |
| | | if (attMap.containsKey(att.ParentRecordId__c)) { |
| | | attMap.get(att.ParentRecordId__c).add(att); |
| | | for (Attachment att : attList) { |
| | | if (attMap.containsKey(att.ParentId)) { |
| | | attMap.get(att.ParentId).add(att); |
| | | } else { |
| | | List<FileAddress__c> a = new List<FileAddress__c>(); |
| | | List<Attachment> a = new List<Attachment>(); |
| | | a.add(att); |
| | | attMap.put(att.ParentRecordId__c, a); |
| | | attMap.put(att.ParentId, a); |
| | | } |
| | | } |
| | | } |
| | |
| | | rpList = [select Id, Name, Product__c, DescriptionNew__c, PART_NUMBERNew__c, INST_SERIAL__c, QUANTITY__c, DEFECT_PART_NUMBER__c, DEFECT_SERIAL_NUMBER__c, ANI_DEFECT_CATEGORY__c, HOURS__c, LOCATION__c, BILL_AT_0_VALUE__c, ECN__c, QTY_PICKED__c, |
| | | Product__r.Description,Product__r.Product_ECCode__c,Product__r.ProductCode from RepairPart__c where SWO_ID__c = :swoid order by Id]; |
| | | //初始化附件 |
| | | attachmentList = [select Id, Name, CreatedDate,FileName__c from FileAddress__c where ParentRecordId__c = :swoid]; |
| | | attachmentList = [select Id, Name, CreatedDate, BodyLength from Attachment where ParentId = :swoid]; |
| | | |
| | | //初始化diagnosis |
| | | List<Diagnosis_Part__c> diList = new List<Diagnosis_Part__c>(); |
| | |
| | | swo.CONTACT__c = conId; |
| | | } |
| | | swo.SWO_STATUS__c = 'Not Started'; |
| | | System.debug('SWO: ' + swo); |
| | | } |
| | | SwoStatus = swo.SWO_STATUS__c; |
| | | } |
| | |
| | | public PageReference save() { |
| | | System.debug('save'); |
| | | //errorMessage = ''; |
| | | System.debug('mustData() = ' + mustData()); |
| | | |
| | | //当SWO Status 改变为Quotation for approval时,此时间点自动抓取填充此处; |
| | | if(mustData() == false){ |
| | | return null; |
| | |
| | | // SWOSTATUS_Closed_AddAttachment();//SWOSTATUS_Closed_AddAttachment |
| | | // } |
| | | } |
| | | System.debug('swo save:' + swo); // Update By Yanan |
| | | if (swoid == null) { |
| | | System.debug('frontCaseId = ' + frontCaseId); |
| | | if(frontCaseId != null){ |
| | | swo.CASE_NUMBER__c = frontCaseId; |
| | | } |
| | | swo.CASE_NUMBER__c = caseId; |
| | | insert swo; |
| | | System.debug('swo.id = ' + swo.id); |
| | | swoid = swo.id; |
| | | frontSwoId = swo.id; |
| | | //ASSIGNED TO 字段变更,给变更后的用户发邮件 |
| | | /*if(swo.ASSIGNEDTO__c!=null && swo.ASSIGNEDTO__c!=assignedUser){ |
| | | assignedUser = swo.ASSIGNEDTO__c; |
| | |
| | | // } |
| | | // if(insertList.size() > 0 ) insert insertList; |
| | | |
| | | //zhj 2020-04-24 前端进行跳转需要进行确认事务 start |
| | | // PageReference ref = new Pagereference('/apex/SWOPageRead?id=' + swo.Id +'&type='+type); |
| | | // ref.setRedirect(true); |
| | | // return ref; |
| | | return null; |
| | | //zhj 2020-04-24 前端进行跳转需要进行确认事务 end |
| | | PageReference ref = new Pagereference('/apex/SWOPageRead?id=' + swo.Id +'&type='+type); |
| | | ref.setRedirect(true); |
| | | return ref; |
| | | } |
| | | /** |
| | | *数据验证 |
| | |
| | | public class EmailInfo { |
| | | |
| | | public Mail_Merge__c mm {get; set; } |
| | | public List<FileAddress__c> attList {get; set; } |
| | | public List<Attachment> attList {get; set; } |
| | | public String haveAtt {get; set;} |
| | | public EmailInfo() { |
| | | |
| | | } |
| | | public EmailInfo(Mail_Merge__c mm_in, List<FileAddress__c> attList_in) { |
| | | public EmailInfo(Mail_Merge__c mm_in, List<Attachment> attList_in) { |
| | | mm = mm_in; |
| | | if (attList_in == null || attList_in.size() == 0) { |
| | | haveAtt = 'No'; |
| | | attList = new List<FileAddress__c>(); |
| | | attList = new List<Attachment>(); |
| | | } else { |
| | | attList = attList_in; |
| | | haveAtt = 'Yes'; |
| | |
| | | private class SWOControllerTest { |
| | | |
| | | |
| | | @TestSetup |
| | | static void setup(){ |
| | | TestDataUtility.CreatePIPolicyConfigurations(new string[]{'SWO__c','Contact'}); |
| | | } |
| | | |
| | | public static User UserD(){ |
| | | User user2 = new User(); |
| | | user2.LastName = 'test2'; |
| | |
| | | ); |
| | | insert att; |
| | | |
| | | Test.startTest(); |
| | | PageReference page = new PageReference('apex/SWOPage?id='+swo.Id +'&type=Product'); |
| | | System.Test.setCurrentPage(page); |
| | | SWOController controller = new SWOController(new ApexPages.StandardController(swo)); |
| | |
| | | controller.addDiagnosisInfo(); |
| | | controller.openPageSave(); |
| | | controller.repairReturn(); |
| | | Test.stopTest(); |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | //测试环境 |
| | | //message += ('https://ssbg--ssbgtest.my.salesforce.com/apex/SWOPageRead?id='+swo.Id); |
| | | //正式环境链接地址 https://ssbg--c.ap6.visual.force.com/apex/SWOPageRead?id=a0r0K00006aylRy&sfdc.override=1 |
| | | message += ('https://ssbg--ssbgtest.my.salesforce.com/apex/SWOPageRead?id='+swo.Id); |
| | | message += ('https://ssbg.my.salesforce.com/apex/SWOPageRead?id='+swo.Id); |
| | | List<String> ccAddresses = new List<String>(); |
| | | List<String> toAddresses = new List<String>(); |
| | | Messaging.SingleEmailMessage sendMail = new Messaging.SingleEmailMessage(); |
| | |
| | | //页面输入检索条件 |
| | | public String searchByName{get;set;} |
| | | public String searchByAccount{get;set;} |
| | | public string searchByAWSDataIds{get;set;}// 20220221 PI改造 by Bright |
| | | public String memberType{get;set;} |
| | | public List<LineMember> lineList{get;set;} |
| | | public Integer lineNum{get;set;} |
| | | public String memberId{get;set;} |
| | | public String memberName{get;set;} |
| | | public String memberEmail{get;set;} |
| | | public String aws_data_id{get;set;}// 20220221 PI改造 by Bright |
| | | |
| | | public Boolean isError{get;set;} |
| | | public String staticResource{get; private set; }// 20220221 PI改造 by Bright |
| | | |
| | | public SearchMemberPageController() { |
| | | lineNum = Integer.valueOf(System.currentPageReference().getParameters().get('lineNum')); |
| | | staticResource = JSON.serialize(PIHelper.getPIIntegrationInfo('Contact'));// 20220221 PI改造 by Bright |
| | | } |
| | | public void init(){ |
| | | lineList = new List<LineMember>(); |
| | |
| | | String soql = ''; |
| | | if(memberType == 'Contact'){ |
| | | |
| | | soql = 'select Id,Name,Email,Account.Name,AWS_Data_Id__c from Contact where Id!=null '; |
| | | soql = 'select Id,Name,Email,Account.Name from Contact where Id!=null '; |
| | | |
| | | // 20220221 PI改造 by Bright |
| | | // if(String.isNotBlank(searchByName)){ |
| | | // soql += 'and Name like \'%'+searchByName.trim()+'%\' '; |
| | | // } |
| | | if(String.isNotBlank(searchByName)){ |
| | | soql += 'and Name like \'%'+searchByName.trim()+'%\' '; |
| | | } |
| | | if(String.isNotBlank(searchByAccount)){ |
| | | soql += 'and Account.Name like \'%'+searchByAccount.trim()+'%\' '; |
| | | } |
| | | |
| | | // 20220221 PI改造 by Bright |
| | | if (!String.isBlank(searchByAWSDataIds)) { |
| | | soql += 'and AWS_Data_Id__c in ' + SoqlHelper.ToInCondition(searchByAWSDataIds.split(',')); |
| | | } |
| | | |
| | | soql += ' limit 200'; |
| | | System.debug('sql='+soql); |
| | | soql += 'limit 200'; |
| | | List<Contact> conList = Database.query(soql); |
| | | if(conList!=null&&conList.size()!=0){ |
| | | for(Contact con : conList){ |
| | |
| | | line.name = con.Name; |
| | | line.email = con.Email; |
| | | line.account = con.Account.Name; |
| | | line.aws_data_id = con.AWS_Data_Id__c; |
| | | lineList.add(line); |
| | | } |
| | | } |
| | |
| | | memberId = line.Id; |
| | | memberName = line.name; |
| | | memberEmail = line.email; |
| | | aws_data_id = line.aws_data_id; |
| | | System.debug(line.email); |
| | | i++; |
| | | } |
| | |
| | | public String name{get;set;} |
| | | public String email{get;set;} |
| | | public String account{get;set;} |
| | | public String aws_data_id{get;set;} |
| | | |
| | | } |
| | | } |
| | |
| | | @isTest |
| | | private class SearchMemberPageControllerTest { |
| | | |
| | | @TestSetup |
| | | static void setup(){ |
| | | TestDataUtility.CreatePIPolicyConfigurations(new string[]{'Contact'}); |
| | | } |
| | | |
| | | static testMethod void testMethod1() { |
| | | List<RecordType> rectIE = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = 'Customer IE']; |
| | | |
| | |
| | | public without sharing class SendEmailController{ |
| | | public without sharing class SendEmailController { |
| | | |
| | | public Mail_Merge__c mail{get; set;} |
| | | |
| | |
| | | public Attachment attachment{get;set;} |
| | | |
| | | public List<Attachment> attachmentList{get;set;} |
| | | public List<FileAddress__c> newAttachmentList{get;set;} |
| | | |
| | | //SWO_Email_Member__c 这个对象只是为了生成页面上的人员明细行 |
| | | // public List<SWO_Email_Member__c> lineDataList_new{get;set;} |
| | |
| | | public List<String> ccAddresses ; |
| | | public List<String> bccAddresses ; |
| | | |
| | | public String AWSDataId{get;set;} |
| | | public String staticResourceMail{get;set;} |
| | | public String staticResourceMailMerge{get;set;} |
| | | public String staticResourceDocument{get;set;} |
| | | public SendEmailController() { |
| | | id = System.currentPageReference().getParameters().get('id'); |
| | | type = System.currentPageReference().getParameters().get('type'); |
| | | typeid = System.currentPageReference().getParameters().get('typeid'); |
| | | openType = System.currentPageReference().getParameters().get('openType'); |
| | | staticResourceMail = JSON.serialize(PIHelper.getPIIntegrationInfo('Mail')); |
| | | staticResourceMailMerge = JSON.serialize(PIHelper.getPIIntegrationInfo('Mail_Merge__c')); |
| | | staticResourceDocument = JSON.serialize(PIHelper.getPIIntegrationInfo('Document')); |
| | | } |
| | | |
| | | public SendEmailController(ApexPages.StandardController controller) { |
| | | // 20220318 PI 改造 By Bright start |
| | | // id = System.currentPageReference().getParameters().get('id'); |
| | | // type = System.currentPageReference().getParameters().get('type'); |
| | | // typeid = System.currentPageReference().getParameters().get('typeid'); |
| | | // openType = System.currentPageReference().getParameters().get('openType'); |
| | | this(); |
| | | // 20220318 PI 改造 By Bright end |
| | | public SendEmailController(ApexPages.StandardController stdController) { |
| | | id = System.currentPageReference().getParameters().get('id'); |
| | | type = System.currentPageReference().getParameters().get('type'); |
| | | typeid = System.currentPageReference().getParameters().get('typeid'); |
| | | openType = System.currentPageReference().getParameters().get('openType'); |
| | | } |
| | | |
| | | public void init(){ |
| | |
| | | mail.RECORD__c = typeid; |
| | | mail.RECORD_TYPE__c = type; |
| | | memberLineDatas = new List<MemberLine>(); |
| | | |
| | | if (!string.isBlank(typeid)) { |
| | | Id rid = typeid; |
| | | String sobjname = 'User_FaultInfo__c'; |
| | | sobjname = rid.getSobjectType().getDescribe().getName(); |
| | | List<sobject> lso = Database.query('select id,name from '+sobjname+' where id = :rid'); |
| | | System.debug('lso='+lso); |
| | | if (lso.size()>0) { |
| | | name = sobjname.replace('__c','')+':'+lso[0].get('Name'); |
| | | if (sobjname == 'User_FaultInfo__c') { |
| | | name = 'Case:'+lso[0].get('Name'); |
| | | } |
| | | } |
| | | System.debug('name='+name); |
| | | } |
| | | |
| | | |
| | | if(id == null){ |
| | | isOnClick = false; |
| | | mail.FROM__c = UserInfo.getUserEmail(); |
| | |
| | | } |
| | | } |
| | | }else{ |
| | | |
| | | |
| | | mail = [select id,send__c,MESSAGE__c,SUBJECT__c,TYPE__c,FROM__c,DATE__c,RECIPIENT__c,CC__c,BCC__c,RECORD__c,RECORD_TYPE__c,toName__c,ccName__c,bccName__c,ALL_MEMBER__c,ALL_MEMBER_NAME__c,ALL_MEMBER_TYPE__c,EMAIL_SENT__c,SWO__c,CaseF__c,Quotes__c, |
| | | AWS_Data_Id__c // 20220222 PI改造 by Brigh |
| | | from Mail_Merge__c where id =:id]; |
| | | AWSDataId=mail.AWS_Data_Id__c; |
| | | mail = [select id,send__c,MESSAGE__c,SUBJECT__c,TYPE__c,FROM__c,DATE__c,RECIPIENT__c,CC__c,BCC__c,RECORD__c,RECORD_TYPE__c,toName__c,ccName__c,bccName__c,ALL_MEMBER__c,ALL_MEMBER_NAME__c,ALL_MEMBER_TYPE__c,EMAIL_SENT__c,SWO__c,CaseF__c,Quotes__c from Mail_Merge__c where id =:id]; |
| | | //mail.TYPE__c == 'reply' 邮件为回复邮件 或者是系统自动发送的邮件 |
| | | //EMAIL_SENT__c =='YES' 邮件已发送 |
| | | if(mail.TYPE__c == 'reply' || mail.EMAIL_SENT__c =='YES'){ |
| | |
| | | replyEmailHead = '\n\n\n\n'; |
| | | replyEmailHead += '-------------邮件原件--------------\n'; |
| | | replyEmailHead += '发件人:' + mail.FROM__c + ';\n'; |
| | | replyEmailHead += '发件时间:' + (mail.DATE__c==null?Datetime.now():mail.DATE__c.addHours(8)) + ';\n'; |
| | | replyEmailHead += '发件时间:' + mail.DATE__c.addHours(8) + ';\n'; |
| | | replyEmailHead += '收件人:' + mailToAddressName + '\n'; |
| | | replyEmailHead += '抄送:' + mailCcAdressName + '\n'; |
| | | replyEmailHead += '主题:' + mail.SUBJECT__c + ';\n\n'; |
| | |
| | | addLine(); |
| | | } |
| | | attachmentList = [select Id,Name,CreatedDate,BodyLength,Body from Attachment where ParentId=:id]; |
| | | newAttachmentList = [select Id,CreatedDate,Name,ViewLink__c,AWS_File_Key__c,FileName__c from FileAddress__c where ParentRecordId__c=:id]; |
| | | /*if(String.isNotBlank(openType) && openType == 'Reply'){ |
| | | attachmentList.clear(); |
| | | }*/ |
| | |
| | | } |
| | | } |
| | | mail.EMAIL_SENT__c = 'YES'; |
| | | System.debug('mail='+mail); |
| | | upsert mail; |
| | | // 返回点击邮件页面 |
| | | PageReference ref = new Pagereference('/'+mail.RECORD__c+'?type=mail'); |
| | |
| | | } |
| | | |
| | | public void save() { |
| | | System.debug('handleType='+handleType); |
| | | toAddresses = new List<String>(); |
| | | ccAddresses = new List<String>(); |
| | | bccAddresses = new List<String>(); |
| | |
| | | @isTest |
| | | private class SendEmailControllerTest { |
| | | |
| | | @TestSetup |
| | | static void setup(){ |
| | | TestDataUtility.CreatePIPolicyConfigurations(new string[]{'Mail','Mail_Merge__c','Document'}); |
| | | } |
| | | |
| | | static testMethod void Add() { |
| | | |
| | | User_FaultInfo__c ca = new User_FaultInfo__c(); |
| | |
| | | domainInstanceMap.put('9', 'ap1'); |
| | | domainInstanceMap.put('O', 'cs5'); |
| | | domainInstanceMap.put('N', 'cs6'); |
| | | domainInstanceMap.put('0', 'cs112'); |
| | | soap = new PartnerSoapSforceCom.Soap(); |
| | | soap.SessionHeader = new PartnerSoapSforceCom.SessionHeader_element(); |
| | | // This is important, give session id, to let the call work. |
| | |
| | | '0010K00002W6zlh' => '00G0K000004AYjU',//成都盛锴科技有限公司(NDT) |
| | | '0010K00002ZVOwt' => '00G0K000004c0oG',//天津宏基伟业科技发展有限公司(NDT) |
| | | '0010K00002b6v6W' => '00G0K000004c4xH',//成都主导科技有限责任公司(NDT) |
| | | /*'0010T00000LO3ph' => '00G0T0000029vfq'//北京深景量光科技有限公司(BS)*/ |
| | | /*'0010T00000M9sbG' => '00G0T000002LFkO'//南京微是生物科技有限公司(BS)*/ |
| | | '0010K00002dVNy1' => '00G0K0000059xxY',//北京深景量光科技有限公司(BS) |
| | | '0010K00002dVNy2' => '00G0K0000059xxY', |
| | | '0010K00002dVNy3' => '00G0K0000059xxY', |
| | | '0010K00002ertQz' => '00G0K0000059xxd',//南京微是生物科技有限公司(BS) |
| | | '0010K00002ertR0' => '00G0K0000059xxd', |
| | | '0010K00002ertR1' => '00G0K0000059xxd', |
| | | '0010K00002dmXEJ' => '00G0K0000059tJo'//北京主导科技有限责任公司(NDT) |
| | | }; |
| | | |
| | |
| | | public String repairId {get; set;} |
| | | public TS_Repair__c tsr {get; set;} |
| | | |
| | | |
| | | public String datestr; |
| | | |
| | | public Integer num {get; set{ num = value;}} //添加产品时使用 |
| | |
| | | |
| | | //页面显示内容 |
| | | public List<RepairInfo> RepairInfoList {get; set;} |
| | | public String RepairInfoListStr {get{return JSON.serialize(RepairInfoList);} set;} |
| | | |
| | | public String temp {get; set;} |
| | | // Label |
| | |
| | | |
| | | public Map<String, List<BusinessActivity__c>> businessActivityListToMap; |
| | | |
| | | |
| | | |
| | | |
| | | // 王鹏伟定义变量开始 |
| | | // 前台点击按钮修改状态 |
| | | public String status {get; set;} |
| | |
| | | //onclickType=0时只能点击草案,申请;onclickType=1时只能点击驳回,批准 |
| | | public String onclickType {get; set;} //onclickType=0时 |
| | | // 王鹏伟定义变量结束 |
| | | |
| | | |
| | | // Add by zhj for PIPL 20220309 Start |
| | | public String contactId{set;get;}//For Lookup field |
| | | public String staticResourceContact {get; set;} |
| | | public String contactNameValue{set;get;} |
| | | public String contactIdValue{set;get;} |
| | | // Add by zhj for PIPL 20220309 End |
| | | |
| | | public TSRepairController() { |
| | | baseUrl = URL.getSalesforceBaseUrl().toExternalForm(); |
| | |
| | | datestr = System.currentPageReference().getParameters().get('date'); |
| | | |
| | | } |
| | | |
| | | |
| | | public PageReference init() { |
| | | errorMessageMap = new Map<String, List<String>>(); |
| | |
| | | } |
| | | |
| | | } |
| | | //contact信息(搜索查询query url用) |
| | | staticResourceContact = JSON.serialize(PIHelper.getPIIntegrationInfo('Contact')); |
| | | |
| | | return null; |
| | | } |
| | | |
| | |
| | | updateUserFaultInfo.UserFaultInfoNextService__c = ba.BusinessANextService__c ;//下次服务时间 |
| | | updateUserFaultInfo.UFAccount__c = ba.BusinessAAccount__c ;//客户单位(查找) |
| | | updateUserFaultInfo.UserFaultInfoCustomerUnit__c = ba.BusinessACustomerUnit__c ;//客户单位(文本) |
| | | if(String.isNotBlank(contactIdValue)&&String.isNotEmpty(contactIdValue)){} |
| | | updateUserFaultInfo.UFContact__c = ba.BusinessAContact__c ;//联系人 |
| | | updateUserFaultInfo.UFPhone__c = ba.BusinessAPhone_F__c ;//联系电话 |
| | | |
| | |
| | | |
| | | public static Account acc1; |
| | | public static Account acc2; |
| | | |
| | | @TestSetup |
| | | static void setup(){ |
| | | TestDataUtility.CreatePIPolicyConfigurations(new string[]{'Contact'}); |
| | | } |
| | | |
| | | static void basicData() { |
| | | |
| | |
| | | } |
| | | System.debug('con.Id' + con.Id); |
| | | System.debug('con list' + con); |
| | | System.debug('con list' + con.AccountId); |
| | | //new Opportunity |
| | | Opportunity opp = new Opportunity(); |
| | | if([SELECT Id,Name FROM Opportunity LIMIT 1].size()>0){ |
| | |
| | | // opp.StageName = 'Phase3'; |
| | | // update opp; |
| | | //new Order |
| | | System.debug('opp list' + opp.Id); |
| | | List<Order> odList = new List<Order>(); |
| | | List<OpportunityContactRole> oppoRuleList = new List<OpportunityContactRole>(); |
| | | for(Integer i=0;i<num;i++){ |
| | | Order od = new Order( |
| | | Name = 'TestOrder'+i, |
| | | Status = 'Draft', |
| | | Status__c = 'Active', |
| | | AccountId = '0060K00000QulEFQAZ', |
| | | AccountId = con.AccountId, |
| | | ApproveStatus__c = 'Draft', |
| | | OpportunityId = '0060K00000QulEFQAZ', |
| | | OpportunityId = opp.Id, |
| | | // ForeignTradeCompany_D__c = con.AccountId, |
| | | EffectiveDate = Date.today(), |
| | | IE_SP5_D__c = true, |
| | |
| | | SpecialDeliveryAccount_D__c = con.AccountId, |
| | | SpecialDeliveryContact2_D__c = con.Id, |
| | | EndUser__c = con.Id, |
| | | EndUserD__c = '0060K00000QulEFQAZ' |
| | | ); |
| | | EndUserD__c = con.Id, |
| | | SpecialDeliveryContact2__c = con.Id |
| | | ); |
| | | OpportunityContactRole oppoRule = new OpportunityContactRole(); |
| | | oppoRule.OpportunityId = od.OpportunityId; |
| | | System.debug('oppoRule.OpportunityId' + od.OpportunityId); |
| | | oppoRule.ContactId = od.EndUser__c; |
| | | oppoRule.Role = 'End user'; |
| | | oppoRule.IsPrimary = true; |
| | | oppoRuleList.add(oppoRule); |
| | | odList.add(od); |
| | | } |
| | | insert oppoRuleList; |
| | | insert odList; |
| | | return odList; |
| | | } |
| | |
| | | updList.add(orderData); |
| | | }else{ |
| | | //王鹏伟添加else返回 |
| | | //return '该合同不符合更新条件,不需要更新'; |
| | | return '该合同不符合更新条件,不需要更新'; |
| | | } |
| | | |
| | | } |
| | | if (updList.size() > 0){ |
| | | update updList; |
| | | return '更新成功'; |
| | | }else{ |
| | | return '该合同不符合更新条件,不需要更新'; |
| | | } |
| | | if (updList.size() > 0) update updList; |
| | | return '更新成功'; |
| | | } |
| | | } |
| | | |
| | |
| | | profilList.add(System.label.system_administrator); |
| | | profilList.add(System.label.system_administrator2); |
| | | profilList.add(System.label.SystemAdmin_GPI_New); |
| | | //profilList.add(System.label.Mark_Not_change); |
| | | return profilList; |
| | | } |
| | | } |
| | |
| | | /** |
| | | * @description : |
| | | * @author : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | * @group : |
| | | * @last modified on : 04-21-2022 |
| | | * @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | **/ |
| | | public without sharing class loanerAppTriggerHandler { |
| | | /** |
| | | * [changeFollowOpp description] 跟进询价改变时修改跟进询价(文本) |
| | | * Date 2020/8/20 |
| | | */ |
| | | public static void changeFollowOpp(List<loaner_application__c> newList, Map<Id, loaner_application__c> newMap, List<loaner_application__c> oldList, Map<Id, loaner_application__c> oldMap){ |
| | | // List<loaner_application__c> upList = new List<loaner_application__c>(); |
| | | // newList = [select id,Equipment_Type__c,Follow_Opp__c,Follow_Opp_text__c from loaner_application__c where id = 'a0Q0K00000JO2FfUAL']; |
| | | //List<loaner_application__c> upList = new List<loaner_application__c>(); |
| | | List<String> idList = new List<String>(); |
| | | System.debug('newList'+newList); |
| | | for(loaner_application__c la : newList){ |
| | | loaner_application__c oldla = oldMap.get(la.Id); |
| | | if(la.Equipment_Type__c == 'BS' && la.Follow_Opp__c != oldla.Follow_Opp__c && la.Follow_Opp__c != null){ |
| | |
| | | } |
| | | |
| | | public static void transferBack(List<loaner_application__c> newList, Map<Id, loaner_application__c> newMap, List<loaner_application__c> oldList, Map<Id, loaner_application__c> oldMap){ |
| | | System.debug('newList' + newList); |
| | | System.debug('oldList' + oldList); |
| | | List<String> idList = new List<String>(); |
| | | for(loaner_application__c la : newList){ |
| | | loaner_application__c old = oldMap.get(la.Id); |
| | |
| | | /** |
| | | * @description : |
| | | * @author : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | * @group : |
| | | * @last modified on : 04-21-2022 |
| | | * @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | **/ |
| | | @isTest |
| | | private class loanerAppTriggerHandlerTest { |
| | | |
| | |
| | | loaner.DEMO_PURPOSE__C = '演示'; |
| | | loaner.Request_shipping_Date__c = Date.today().addDays(10); |
| | | loaner.Request_return_Date__c = Date.today().addDays(10); |
| | | // loaner.Status__c = '已提交'; |
| | | loaner.Status__c = '申请中'; |
| | | loaner.Status__c = '已提交'; |
| | | loaner.Return_Track_Company__c = '物流公司'; |
| | | loaner.Loaner_receive_staff__c = '1'; |
| | | loaner.direct_shippment_address__c = '1'; |
| | | loaner.Loaner_receive_staff_phone__c = '1'; |
| | | loaner.Post_Code__c = '1'; |
| | | loaner.Follow_Opp__c = '0060T0000049Tm1QAE'; |
| | | //loaner.pickup_time__c = Date.today().addDays(3); |
| | | //loaner.Return_Trake_Staff__c = '返品人'; |
| | | insert loaner; |
| | |
| | | |
| | | loaner.Status__c = '取消'; |
| | | update loaner; |
| | | |
| | | loaner.Status__c = '草案中'; |
| | | loaner.Equipment_Type__c = 'BS'; |
| | | loaner.Follow_Opp__c = '0060T000003zTzNQAU'; |
| | | update loaner; |
| | | |
| | | loaner.Status__c = '申请中'; |
| | | update loaner; |
| | | |
| | | loaner.Status__c = '草案中'; |
| | | loaner.Equipment_Type__c = 'BS'; |
| | | loaner.Loaner_LendOrder__c = true; |
| | | update loaner; |
| | | |
| | | loaner.Status__c = '申请中'; |
| | | loaner.Equipment_Type__c = 'BS'; |
| | | loaner.Loaner_LendOrder__c = true; |
| | | update loaner; |
| | | |
| | | System.Test.stopTest(); |
| | | System.Test.stopTest(); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | <!-- 该页面用于Lead对象上传PDF,未来如果要添加其他对象的上传PDF功能,复制该页面,将**standardController**修改为其他对象API名称即可 --> |
| | | <apex:page standardController="Contract" extensions="FileUploadController" id="page" lightningStyleSheets="true"> |
| | | <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" /> |
| | | <script> |
| | | var staticResources = JSON.parse('{!staticResource}'); |
| | | var parentId = '{!parentId}'; |
| | | var uploadUrl = staticResources.newUrl; |
| | | var key; |
| | | |
| | | function alertErrorMessage(errorMsg) { |
| | | let errorMsgNode = document.getElementById("page:theForm:block:msgContent"); |
| | | errorMsgNode.innerText = errorMsg; |
| | | errorMsgNode.className = 'message errorM3'; |
| | | } |
| | | |
| | | function hiddenErrorMsgNode() { |
| | | let errorMsgNode = document.getElementById("page:theForm:block:msgContent"); |
| | | errorMsgNode.innerText = ''; |
| | | errorMsgNode.className = ''; |
| | | } |
| | | function getFileContent(event) { |
| | | var fileObject = document.getElementById("page:theForm:block:uploadSection:file"); |
| | | var reader = new FileReader(); |
| | | var data = reader.readAsDataURL(fileObject.files[0]); |
| | | debugger |
| | | console.log(event); |
| | | } |
| | | function getBase64(file) { |
| | | return new Promise((resolve, reject) => { |
| | | const reader = new FileReader(); |
| | | reader.readAsDataURL(file); |
| | | reader.onload = () => resolve(reader.result); |
| | | reader.onerror = error => reject(error); |
| | | }); |
| | | } |
| | | function disableButtonStatus() { |
| | | let btnNode = document.getElementById('uploadFileId'); |
| | | btnNode.classList.add("btnDisabled"); |
| | | } |
| | | |
| | | function enableButtonStatus() { |
| | | let btnNode = document.getElementById('uploadFileId'); |
| | | btnNode.classList.remove("btnDisabled"); |
| | | } |
| | | |
| | | function uploadFile() { |
| | | disableButtonStatus(); |
| | | var fileObject = document.getElementById("file").files[0]; |
| | | getBase64(fileObject).then( |
| | | data => { |
| | | console.log(data); |
| | | uploadFileToAWS(data, (fileObject.size).toString(), fileObject.name); |
| | | |
| | | } |
| | | ); |
| | | } |
| | | function confirmTrans(transId, isSuccess) { |
| | | |
| | | fetch(staticResources.updateUrl, { |
| | | method: 'POST', |
| | | body: JSON.stringify({ 'txId': transId, "isSuccess": isSuccess }), |
| | | headers: { |
| | | 'Content-Type': 'application/json', |
| | | 'pi-token': staticResources.token |
| | | } |
| | | }).then((data) => { |
| | | return data.json(); |
| | | }).then(data => { |
| | | console.log("confirmTrans-" + JSON.stringify(data)); |
| | | document.getElementById("file").files[0].name = ''; |
| | | enableButtonStatus(); |
| | | refreshFiles(); |
| | | return data.status; |
| | | }) |
| | | |
| | | } |
| | | function calculateFileSize(fileObject) { |
| | | if (fileObject.size > 20971520) { |
| | | alertErrorMessage('文件过大,请选择小于20mb的文件'); |
| | | } |
| | | } |
| | | function uploadFileToAWS(data, size, fileName) { |
| | | console.log("body=" + JSON.stringify({ 'file': data, "size": size, 'fileName': fileName })); |
| | | |
| | | fetch(uploadUrl, { |
| | | method: 'POST', |
| | | body: JSON.stringify({ 'file': data, "size": size, 'fileName': fileName }), |
| | | headers: { |
| | | 'Content-Type': 'application/json', |
| | | 'pi-token': staticResources.token |
| | | } |
| | | }).then((data) => { |
| | | return data.json(); |
| | | }).then(result => { |
| | | |
| | | console.log("result" + JSON.stringify(result)); |
| | | |
| | | if (result.success == true) { |
| | | key = result.object; |
| | | |
| | | Visualforce.remoting.Manager.invokeAction( |
| | | '{!$RemoteAction.FileUploadController.saveFile}', |
| | | fileName, key, result.txId, parentId, |
| | | function (resultvalue, event) { |
| | | |
| | | |
| | | |
| | | //2. show file list |
| | | if (resultvalue.status == 'fail') { |
| | | alertErrorMessage(resultvalue.message); |
| | | //1. Confirm trans |
| | | confirmTrans(result.txId, 0); |
| | | } else { |
| | | alertErrorMessage('上传成功'); |
| | | confirmTrans(result.txId, 1); |
| | | } |
| | | |
| | | // window.location.reload(); |
| | | }, |
| | | { escape: true } |
| | | ); |
| | | |
| | | console.log('key' + key); |
| | | } else { |
| | | alertErrorMessage('上传失败请稍后再试!'); |
| | | } |
| | | }).catch((error) => { |
| | | console.error('Error:', error); |
| | | }) |
| | | debugger |
| | | } |
| | | function downPdf(fileUrl) { |
| | | window.open(fileUrl,'_blank'); |
| | | } |
| | | |
| | | </script> |
| | | <style> |
| | | .pdf .num { |
| | | width: 30%; |
| | | } |
| | | |
| | | .pdf.name { |
| | | width: 30% |
| | | } |
| | | |
| | | .pdf.downLink { |
| | | width: 40% |
| | | } |
| | | </style> |
| | | <apex:form id="theForm"> |
| | | <apex:actionFunction name="refreshFiles" action="{!refreshFiles}" reRender="pdf,uploadSection"/> |
| | | <br/> |
| | | <br/> |
| | | <apex:pageBlock id="block"> |
| | | <div style="text-align: center;"> |
| | | <apex:outputPanel id="errorMsg"> |
| | | <apex:pageMessages id="msgContent" escape="false" /> |
| | | </apex:outputPanel> |
| | | </div> |
| | | <apex:pageBlockSection id="uploadSection"> |
| | | <!-- <apex:inputFile id="file" value="{!documentData.body}" filename="{!documentData.name}" /> --> |
| | | <input type="file" id="file" name="filename"/> |
| | | <input class="btn" id='uploadFileId' type="Button" value="确认上传" onclick="uploadFile()" /> |
| | | </apex:pageBlockSection> |
| | | </apex:pageBlock> |
| | | <apex:pageBlock title="PDF列表" id="pdf"> |
| | | <!-- <apex:pageBlockSection > --> |
| | | <!-- show uploated file list --> |
| | | <apex:pageBlockTable value="{!fileList}" var="file" align="center" columns="3" columnsWidth="30%,30%,40%"> |
| | | <apex:column id="name" headerValue="文件名称"> |
| | | <apex:outputLink value="/{!file.Id}" target="_blank">{!file.FileName__c}</apex:outputLink> |
| | | </apex:column> |
| | | <!-- <apex:column id="num" headerValue="父记录链接"> |
| | | <apex:outputLink value="/{!file.ParentRecordId__c}" target="_blank">{!file.ParentRecordId__c}</apex:outputLink> |
| | | </apex:column> --> |
| | | <apex:column id="previewLink" headerValue="预览链接"> |
| | | <apex:outputLink value="{!file.ViewLink__c}" target="{!file.ViewLink__c}">预览链接 |
| | | </apex:outputLink> |
| | | </apex:column> |
| | | <apex:column id="downLink" headerValue="下载链接"> |
| | | <!-- <apex:outputLink value= "{!file.DownloadLink__c}" target="{!file.DownloadLink__c}">下载链接 |
| | | </apex:outputLink> --> |
| | | <input class="btn" id='downloadFileButton' type="Button" value="下载" onclick="downPdf('{!file.DownloadLink__c}')" /> |
| | | </apex:column> |
| | | </apex:pageBlockTable> |
| | | <!-- </apex:pageBlockSection> --> |
| | | </apex:pageBlock> |
| | | </apex:form> |
| | | <apex:relatedList list="CombinedAttachments" > |
| | | </apex:relatedList> |
| | | <script> |
| | | const element = document.getElementsByName('attachFile')[0]; |
| | | element.remove(); |
| | | </script> |
| | | </apex:page> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexPage xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <availableInTouch>false</availableInTouch> |
| | | <confirmationTokenRequired>false</confirmationTokenRequired> |
| | | <label>ContractFileUploadPage</label> |
| | | </ApexPage> |
| | |
| | | <apex:page controller="DeliveryConfirmPDFController" showHeader="false" sidebar="false" id="allPage" action="{!init}" > <!-- renderAs="pdf" --> |
| | | <apex:page controller="DeliveryConfirmPDFController" showHeader="false" sidebar="false" id="allPage" action="{!init}" renderAs="pdf"> <!-- renderAs="pdf" --> |
| | | <html> |
| | | <head> |
| | | <style> |
| | | @page { |
| | | margin: 1mm 1mm 1mm 1mm; |
| | | } |
| | | /* 20220221 PI改造 by 徐亮 start */ |
| | | body{margin: 0 auto; |
| | | width: 780px;} |
| | | #pdf-wrapper{position: relative;} |
| | | #title1{height: 30px;} |
| | | #title2{height: 110px;} |
| | | /* 20220221 PI改造 by 徐亮 end */ |
| | | |
| | | </style> |
| | | <!-- 20220221 PI改造 by 徐亮 start --> |
| | | <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" /> |
| | | <script src="../../soap/ajax/53.0/connection.js" type="text/javascript"></script> |
| | | <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/> |
| | | |
| | | <apex:includeScript value="{!URLFOR($Resource.jspdf)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.html2canvas)}"/> |
| | | |
| | | |
| | | <!-- 20220221 PI改造 by 徐亮 end --> |
| | | </head> |
| | | <body style="font-family: Arial Unicode MS; page-break-inside: auto;font-size: 10px;"> |
| | | <div id="pdf-wrapper"> |
| | | <div id="title1"></div> |
| | | <apex:image value="{!URLFOR($Resource.pdfSign)}" width="80" style="position:absolute; left:300px; top:100px;"/> |
| | | <p style="text-align: center; display: block;font-size: 25px;">奥林巴斯样机借用单</p> |
| | | <p style="text-align: center; display: block;font-size: 25px;">仪景通样机借用单</p> |
| | | <table style="border: 2px solid black; width: 100%;border-collapse:collapse;" border="solid"> |
| | | <tr> |
| | | <td align="right" width="100px"><apex:outputText value="申请日期:" /></td> |
| | |
| | | </apex:outputPanel> |
| | | |
| | | <td align="right">借用担当:</td> |
| | | <td><span aws-obj="loaner_application__c" aws-api="loanerSer" aws-id="{!la.AWS_Data_Id__c}">{!la.Loaner_Ser__c}</span></td> |
| | | <td><apex:outputText value="{!la.Loaner_Ser__c}"/></td> |
| | | </tr> |
| | | <tr> |
| | | <td align="right">借用日期:</td> |
| | |
| | | <tr> |
| | | |
| | | <td align="right" width="90">寄送地址:</td> |
| | | <td colspan="3"><span aws-obj="loaner_application__c" aws-api="directShippmentAddress" aws-id="{!la.AWS_Data_Id__c}">{!la.direct_shippment_address__c}</span> </td> |
| | | <td colspan="3"><apex:outputField value="{!la.direct_shippment_address__c}"/></td> |
| | | </tr> |
| | | |
| | | <tr> |
| | | |
| | | <td align="right" width="90">联系人:</td> |
| | | <td><span aws-obj="loaner_application__c" aws-api="loanerReceiveStaff" aws-id="{!la.AWS_Data_Id__c}">{!la.Loaner_receive_staff__c}</span></td> |
| | | <td><apex:outputField value="{!la.Loaner_receive_staff__c}"/></td> |
| | | <td align="right" width="90">联系电话:</td> |
| | | <td width="200"><span aws-obj="loaner_application__c" aws-api="loanerReceiveStaffPhone" aws-id="{!la.AWS_Data_Id__c}">{!la.Loaner_receive_staff_phone__c}</span></td> |
| | | <td width="200"><apex:outputField value="{!la.Loaner_receive_staff_phone__c}"/></td> |
| | | |
| | | </tr> |
| | | |
| | |
| | | <apex:repeat value="{!luData}" var="luLine" id="lus"> |
| | | <tr> |
| | | <td class="dataCell" style="text-align: center;"> |
| | | <apex:outputText styleClass="Customer__r.Name" value="{!luLine.lu.Customer__r.Name}"/> |
| | | <apex:outputText value="{!luLine.lu.Customer__r.Name}"/> |
| | | </td> |
| | | <td class="dataCell" style="text-align: center;"> |
| | | <apex:outputText styleClass="Customer__r.DivisionName__c" value="{!luLine.lu.Customer__r.DivisionName__c}"/> |
| | | <apex:outputText value="{!luLine.lu.Customer__r.DivisionName__c}"/> |
| | | </td> |
| | | <td class="dataCell" style="text-align: center;"> |
| | | <span aws-obj="Contact" aws-api="lastName" aws-id="{!la.AWS_Data_Id__c}">{!luLine.lu.Contact__r.Name}</span> |
| | | <apex:outputText value="{!luLine.lu.Contact__r.Name}"/> |
| | | </td> |
| | | <apex:outputPanel rendered="{!IF(la.Equipment_Type__c == 'BS', true , false)}" layout="none"> |
| | | <td class="dataCell" style="text-align: center;"> |
| | | <span aws-obj="Contact" aws-api="phone" aws-id="{!la.AWS_Data_Id__c}">{!luLine.lu.Contact__r.Phone}</span> |
| | | <apex:outputText value="{!luLine.lu.Contact__r.Phone}"/> |
| | | </td> |
| | | </apex:outputPanel> |
| | | <apex:outputPanel rendered="{!IF(la.Equipment_Type__c == 'BS', false , true)}" layout="none"> |
| | |
| | | <tr><td>3.如借用之样机(备品)在借用期间损坏,我方有权要求贵方按相应金额赔偿或承担维修费用。</td></tr> |
| | | </apex:outputPanel> |
| | | <tr><td>4.借出样机在未征得我方的许可,贵方不得转借第三方使用,否则将中止借用并追究责任。</td></tr> |
| | | <tr><td>5.奥林巴斯有权根据需要随时收回借出的样机。</td></tr> |
| | | <tr><td>5.仪景通有权根据需要随时收回借出的样机。</td></tr> |
| | | </table> |
| | | </div> |
| | | |
| | | </body> |
| | | <!-- 20220221 PI改造 by 徐亮 start --> |
| | | <script> |
| | | AWSService.sfSessionId = '{!GETSESSIONID()}'; |
| | | var staticResource = JSON.parse('{!staticResource}'); |
| | | |
| | | function Fun(pdf){ |
| | | var iframe = document.createElement('iframe'); |
| | | iframe.setAttribute('style', 'position:absolute;right:0; top:0; bottom:0; height:100%; width:100%'); |
| | | document.body.appendChild(iframe); |
| | | iframe.src = pdf.output('datauristring'); |
| | | for(let e of document.body.childNodes){ |
| | | if( e != iframe && e.style){ |
| | | e.style.display = 'none'; |
| | | } |
| | | } |
| | | } |
| | | |
| | | let id = "pdf-wrapper"; |
| | | var target = document.getElementById(id); |
| | | function jsPdfDownload(){ |
| | | let pdfName = "测试"; |
| | | let id = "pdf-wrapper"; |
| | | var target = document.getElementById(id); |
| | | target.style.background = "#FFFFFF"; |
| | | if(pdfName==''||pdfName==undefined) pdfName= getNowFormatDate(); |
| | | |
| | | html2canvas(target, { |
| | | scale: 2, |
| | | onrendered:function(canvas) { |
| | | let landscape = false; |
| | | let pw = 595.28; |
| | | let ph = 841.89; |
| | | const marginw = 40; |
| | | |
| | | let orientation = ''; |
| | | if (landscape) { |
| | | let temp =ph; |
| | | ph = pw; |
| | | pw = temp; |
| | | orientation = 'l'; |
| | | } |
| | | |
| | | |
| | | var contentWidth = canvas.width; |
| | | var contentHeight = canvas.height; |
| | | |
| | | //一页pdf显示html页面生成的canvas高度; |
| | | var pageHeight = contentWidth / pw * ph; |
| | | //未生成pdf的html页面高度 |
| | | var leftHeight = contentHeight; |
| | | //页面偏移 |
| | | var position = 0; |
| | | //a4纸的尺寸[595.28,841.89],html页面生成的canvas在pdf中图片的宽高 |
| | | var imgWidth = pw-2*marginw;//595.28//左右边距20 |
| | | var imgHeight = imgWidth/contentWidth * contentHeight;//左右边距20 |
| | | |
| | | var pageData = canvas.toDataURL('image/jpeg', 1.0); |
| | | |
| | | var pdf = new jsPDF(orientation, 'pt', 'a4');// 第一个参数填字母l,注意不是数字1,为横向pdf |
| | | |
| | | //有两个高度需要区分,一个是html页面的实际高度,和生成pdf的页面高度(841.89) |
| | | //当内容未超过pdf一页显示的范围,无需分页 |
| | | if (leftHeight < pageHeight) { |
| | | pdf.addImage(pageData, 'JPEG', marginw, 0, imgWidth, imgHeight );//左右边距20 |
| | | } else { |
| | | while(leftHeight > 0) { |
| | | pdf.addImage(pageData, 'JPEG', marginw, position, imgWidth, imgHeight)//左右边距20 |
| | | leftHeight -= pageHeight; |
| | | position -= ph; |
| | | //避免添加空白页 |
| | | if(leftHeight > 0) { |
| | | pdf.addPage(); |
| | | } |
| | | } |
| | | } |
| | | Fun(pdf); |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | var aws_data = {}; |
| | | |
| | | function Decrypt(r,dataIds){ |
| | | let Foo = function(){ |
| | | for (const id of dataIds) { |
| | | if (aws_data.hasOwnProperty(id)) { |
| | | let d = aws_data[id]; |
| | | let $e =j$("[aws-id='"+d.dataId+ "']"); |
| | | $e.each((i,e)=>{ |
| | | j$(e).html(d[j$(e).attr("aws-api")]); |
| | | }); |
| | | //.find(".decrypt") |
| | | |
| | | } |
| | | } |
| | | unblockUI(); |
| | | } |
| | | let ids = []; |
| | | for (const id of dataIds) { |
| | | if (!aws_data.hasOwnProperty(id)) { |
| | | ids.push(id); |
| | | } |
| | | } |
| | | if (ids.length > 0) { |
| | | blockme(); |
| | | AWSService.search(r.searchUrl,JSON.stringify({ |
| | | "dataIds":ids |
| | | }),function(data){ |
| | | unblockUI(); |
| | | if(data.object && data.object.length > 0){ |
| | | |
| | | for(let d of data.object){ |
| | | if(d.dataId){ |
| | | aws_data[d.dataId] = d; |
| | | } |
| | | } |
| | | Foo(); |
| | | } |
| | | },r.token); |
| | | }else{ |
| | | Foo(); |
| | | } |
| | | } |
| | | |
| | | function DecryptAll(){ |
| | | let dataIds = []; |
| | | j$('[aws-id][aws-obj="loaner_application__c"]').each((i,e)=>{ |
| | | let v = j$(e).attr('aws-id'); |
| | | if (v) { |
| | | dataIds.push(v); |
| | | } |
| | | }); |
| | | Decrypt(staticResource,dataIds); |
| | | } |
| | | |
| | | j$(function(){ |
| | | //DecryptAll(); |
| | | |
| | | }) |
| | | |
| | | document.body.onclick = function(){ |
| | | jsPdfDownload(); |
| | | } |
| | | </script> |
| | | <!-- 20220221 PI改造 by 徐亮 end --> |
| | | </html> |
| | | </apex:page> |
| | |
| | | </apex:outputPanel> |
| | | <th style="text-align: center;"><a href="#" onclick="sortTableJs('2');return false;" style="text-decoration: underline;">{!$ObjectType.loaner_application_detail__c.fields.ECCode__c.label}</a>{!sortOrder[3]}</th> |
| | | <th style="text-align: center;"><a href="#" onclick="sortTableJs('3');return false;" style="text-decoration: underline;">{!$ObjectType.loaner_application_detail__c.fields.loaner_place__c.label}</a>{!sortOrder[3]}</th> |
| | | <!-- <th style="text-align: center;">样机名称</th> --> |
| | | <apex:outputPanel layout="none" rendered="{!IF(loanerApply.Equipment_Type__c == 'BS' , false , true)}"> |
| | | <th style="text-align: center;width: 50Px;"><a href="#" onclick="sortTableJs('4');return false;" style="text-decoration: underline;">{!$ObjectType.loaner_application_detail__c.fields.loaner_Status__c.label}/{!$ObjectType.Asset.fields.Count_can_allocate_F__c.label}</a>{!sortOrder[4]}</th> |
| | | </apex:outputPanel> |
| | |
| | | <td class="dataCell" align="center"> |
| | | {!records.aset.EC_Code__c} |
| | | </td> |
| | | <!-- <td class="dataCell" align="center"> |
| | | {!records.aset.Equipment_Type__c} |
| | | </td> --> |
| | | <td class="dataCell" align="center"> |
| | | {!records.aset.loaner_place__c} |
| | | </td> |
| | |
| | | <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/> |
| | | <!-- Update PIPL 20220425 By Chen Yanan Start --> |
| | | <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" /> |
| | | <apex:includeScript value="{!URLFOR($Resource.connection20)}"/> |
| | | <!-- Update PIPL 20220425 By Chen Yanan End --> |
| | | <style type="text/css"> td>div{display: inline-block;}</style> |
| | | <script> |
| | | // Update PIPL 20220425 By Chen Yanan start |
| | | AWSService.sfSessionId = '{!GETSESSIONID()}'; |
| | | var staticResource = JSON.parse('{!staticResource}'); |
| | | var aws_data = {}; |
| | | |
| | | function Decrypt(r,dataIds,callback){ |
| | | if (!(dataIds && dataIds.length)) { |
| | | if(callback)callback(); |
| | | return; |
| | | } |
| | | |
| | | let Foo = function(){ |
| | | for (const id of dataIds) { |
| | | if (aws_data.hasOwnProperty(id)) { |
| | | let d = aws_data[id]; |
| | | let $e =j$("[aws-id='"+d.dataId+ "']"); |
| | | $e.each((i,e)=>{ |
| | | if (d[j$(e).attr("aws-api")] != '') { |
| | | j$(e).attr('value',d[j$(e).attr("aws-api")]); |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | if(callback)callback(); |
| | | } |
| | | let ids = []; |
| | | for (const id of dataIds) { |
| | | if (!aws_data.hasOwnProperty(id)) { |
| | | ids.push(id); |
| | | } |
| | | } |
| | | if (ids.length > 0) { |
| | | |
| | | AWSService.query(r.queryUrl,ids[0],function(data){ |
| | | console.log('data: ' + JSON.stringify(data)); |
| | | if(data.object){ |
| | | aws_data[data.object.dataId] = data.object; |
| | | Foo(); |
| | | }else{ |
| | | if(callback)callback(); |
| | | } |
| | | },r.token); |
| | | }else{ |
| | | Foo(); |
| | | } |
| | | } |
| | | |
| | | function DecryptAll(callback){ |
| | | let dataIds1 = []; |
| | | j$('[aws-id][aws-obj="loaner_application__c"]').each((i,e)=>{ |
| | | let v = j$(e).attr('aws-id'); |
| | | if (v) { |
| | | dataIds1.push(v); |
| | | } |
| | | }); |
| | | Decrypt(staticResource,dataIds1,callback); |
| | | } |
| | | |
| | | j$(function(){ |
| | | DecryptAll(); |
| | | |
| | | }) |
| | | // Update PIPL 20220425 By Chen Yanan end |
| | | function test1(){ |
| | | getIsOk(); |
| | | } |
| | |
| | | <tr> |
| | | <td> |
| | | <label for="user">{!$ObjectType.loaner_application_detail__c.fields.Return_Trake_Staff__c.label}: </label> |
| | | <!-- Update PIPL 20220425 By Chen Yanan Start --> |
| | | <!-- <apex:inputField value="{!lac.Return_Trake_Staff__c}" id="user"></apex:inputField> --> |
| | | <!-- PIPL 改造后 --> |
| | | <apex:inputField html-aws-obj="loaner_application__c" html-aws-api="returnTrakeStaff" html-aws-id="{!lac.AWS_Data_Id__c}" id="Return_Trake_Staff__c" value="{!lac.Return_Trake_Staff__c}"></apex:inputField> |
| | | <!-- Update PIPL 20220425 By Chen Yanan --> |
| | | |
| | | <apex:inputField value="{!lac.Return_Trake_Staff__c}" id="user"></apex:inputField> |
| | | </td> |
| | | <td> |
| | | <apex:commandButton onclick="test1();" value="回寄" rerender="dummy" style="width: 70px;float: right;"/> |
| | |
| | | <!-- </apex:pageBlockSection> --> |
| | | </apex:pageBlock> |
| | | </apex:form> |
| | | <apex:relatedList list="CombinedAttachments" id="Notes"> |
| | | <apex:relatedList list="CombinedAttachments" id="Notes"> |
| | | <apex:facet name="NoteHeader" ></apex:facet> |
| | | </apex:relatedList> |
| | | <script> |
| | |
| | | <apex:includeScript value="{!URLFOR($Resource.SWOJS)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.connection20)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.apex20)}"/> |
| | | <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" /> |
| | | <script type="text/javascript"> |
| | | // 20220311 PI改造 by Bright start |
| | | AWSService.sfSessionId = '{!GETSESSIONID()}'; |
| | | var staticResource = JSON.parse('{!staticResource}'); |
| | | var contactstaticResource = JSON.parse('{!contactstaticResource}'); |
| | | |
| | | var aws_data = {}; |
| | | |
| | | function Decrypt(r,dataIds,callback){ |
| | | if (!(dataIds && dataIds.length)) { |
| | | if(callback)callback(); |
| | | return; |
| | | } |
| | | |
| | | let Foo = function(){ |
| | | for (const id of dataIds) { |
| | | if (aws_data.hasOwnProperty(id)) { |
| | | let d = aws_data[id]; |
| | | let $e =j$("[aws-id='"+d.dataId+ "']"); |
| | | $e.each((i,e)=>{ |
| | | j$(e).html(d[j$(e).attr("aws-api")]); |
| | | }) |
| | | |
| | | } |
| | | } |
| | | if(callback)callback(); |
| | | } |
| | | let ids = []; |
| | | for (const id of dataIds) { |
| | | if (!aws_data.hasOwnProperty(id)) { |
| | | ids.push(id); |
| | | } |
| | | } |
| | | if (ids.length > 0) { |
| | | |
| | | AWSService.search(r.searchUrl,JSON.stringify({ |
| | | "dataIds":ids |
| | | }),function(data){ |
| | | |
| | | if(data.object && data.object.length > 0){ |
| | | |
| | | for(let d of data.object){ |
| | | if(d.dataId){ |
| | | aws_data[d.dataId] = d; |
| | | } |
| | | } |
| | | Foo(); |
| | | }else{ |
| | | if(callback)callback(); |
| | | } |
| | | },r.token); |
| | | }else{ |
| | | Foo(); |
| | | } |
| | | } |
| | | |
| | | function DecryptAll(callback){ |
| | | let dataIds1 = []; |
| | | j$('[aws-id][aws-obj="Contact"]').each((i,e)=>{ |
| | | let v = j$(e).attr('aws-id'); |
| | | if (v) { |
| | | dataIds1.push(v); |
| | | } |
| | | }); |
| | | Decrypt(contactstaticResource,dataIds1,callback); |
| | | |
| | | let dataIds2 = []; |
| | | j$('[aws-id][aws-obj="Quotes__c"]').each((i,e)=>{ |
| | | let v = j$(e).attr('aws-id'); |
| | | if (v) { |
| | | dataIds2.push(v); |
| | | } |
| | | }); |
| | | Decrypt(staticResource,dataIds2,callback); |
| | | } |
| | | |
| | | j$(function(){ |
| | | DecryptAll(); |
| | | |
| | | }) |
| | | // 20220311 PI改造 by Bright end |
| | | </script> |
| | | <style type="text/css"> |
| | | .Page{ |
| | |
| | | <tr> |
| | | |
| | | <td colspan="2" align="left" ><apex:inputField id="CURRENCY" value="{!QuotesPage.CURRENCY__c}" style="width: 56%"/></td> |
| | | <td colspan="2" align="left" > |
| | | <a href="/{!QuotesPage.CONTACT_NAME__c}" aws-obj="Contact" aws-api="lastName" aws-id="{!QuotesPage.CONTACT_NAME__r.AWS_Data_Id__c}">{!QuotesPage.CONTACT_NAME__r.Name}</a> |
| | | </td> |
| | | <td colspan="2" align="left" ><apex:outputField value="{!QuotesPage.CONTACT_NAME__c}" style="width: 63%"/></td> |
| | | <td colspan="2"/> |
| | | <td colspan="2" class="title1">Summary</td> |
| | | <td/> |
| | |
| | | <td colspan="2" align="left" ><apex:outputField id="COMPANY" value="{!QuotesPage.COMPANY__c}"/> |
| | | <!-- <apex:outputLink value="/{!QuotesPage.COMPANYId__c}" target="LINK_{!QuotesPage.COMPANYId__c}" ><c:PDFWbr targetStr="{!QuotesPage.COMPANYName__c}"/></apex:outputLink> --> |
| | | </td> |
| | | <td align="left" ><apex:outputField html-aws-obj="Quotes__c" html-aws-api="contactPhone" html-aws-id="{!QuotesPage.AWS_Data_Id__c}" id="CONTACT_PHONE" value="{!QuotesPage.CONTACT_PHONE__c}"/></td> |
| | | <td align="left" ><apex:outputField id="CONTACT_PHONE" value="{!QuotesPage.CONTACT_PHONE__c}"/></td> |
| | | <td colspan="3"/> |
| | | <td class="title2">{!$ObjectType.Quotes__c.fields.DISCOUNT__c.label}</td> |
| | | <td class="title2" align="left" ><apex:outputField value="{!QuotesPage.DISCOUNT__c}" style="width: 62%"/></td> |
| | |
| | | <apex:inputText id="DisplayPROBABILITY" value="{!QuotesPage.PROBABILITY__c}" style="display: none;"/> |
| | | </td> |
| | | <td/> |
| | | <td align="left" ><apex:inputField id="PRODUCT_SEGMENT" value="{!QuotesPage.PRODUCT_SEGMENT__c}" style="width: 95%"/></td> |
| | | <td align="left" ><apex:inputField id="PRODUCT_SEGMENT" value="{!QuotesPage.PRODUCT_SEGMENT__c}" onchange="QuotesTypeChangeFunction();" style="width: 95%"/></td> |
| | | </tr> |
| | | <tr> |
| | | <td align="left" >{!$ObjectType.Quotes__c.fields.LOCATION__c.label}<span class="textRed">*</span></td> |
| | |
| | | <td align="left" >{!$ObjectType.Quotes__c.fields.SHIP_TO__c.label}</td> |
| | | </tr> |
| | | <tr> |
| | | <td colspan="2" align="left" ><apex:inputField html-aws-obj="Quotes__c" html-aws-api="billTo" html-aws-id="{!QuotesPage.AWS_Data_Id__c}" id="BILL_TO" value="{!QuotesPage.BILL_TO__c }" style="width: 90%;height: 80PX"/></td> |
| | | <td colspan="2" align="left" ><apex:inputField html-aws-obj="Quotes__c" html-aws-api="shipTo" html-aws-id="{!QuotesPage.AWS_Data_Id__c}" id="SHIP_TO" value="{!QuotesPage.SHIP_TO__c}" style="width: 90%;height: 80PX"/></td> |
| | | <td colspan="2" align="left" ><apex:inputField id="BILL_TO" value="{!QuotesPage.BILL_TO__c }" style="width: 90%;height: 80PX"/></td> |
| | | <td colspan="2" align="left" ><apex:inputField id="SHIP_TO" value="{!QuotesPage.SHIP_TO__c}" style="width: 90%;height: 80PX"/></td> |
| | | </tr> |
| | | <tr> |
| | | <td colspan="9"> <hr/></td> |
| | |
| | | </tr> |
| | | |
| | | <tr> |
| | | <apex:outputPanel layout="none" rendered="{!IF(aftORbef == false && aftORbef1 == false, true, false)}"> |
| | | <td colspan="9"> |
| | | <apex:outputText id="message01" value="{!Messages01}" style="resize:vertical;width: 100%"/> |
| | | </td> |
| | | </apex:outputPanel> |
| | | <td colspan="9"> |
| | | <apex:outputText id="message01" value="{!Messages01}" style="resize:vertical;width: 100%"/> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <!-- <tr> |
| | | <apex:outputPanel layout="none" rendered="{!IF(aftORbef == true || aftORbef1 == true, true, false)}"> |
| | | <td colspan="9"> |
| | | <apex:outputText value="-维修质保只涵盖于本次维修的配件,维修质保期为仪器发货后三个月加八天。" style="resize:vertical;width: 100%"/> |
| | | </td> |
| | | </apex:outputPanel> |
| | | </tr> |
| | | </tr> --> |
| | | <tr> |
| | | <td colspan="9"> |
| | | <apex:outputText id="message02" value="{!Messages02}" style="resize:vertical;width: 100%"/> |
| | |
| | | <td><apex:outputText value="{!mail.haveAtt}" /></td> |
| | | <td> |
| | | <apex:repeat value="{!mail.attList}" var="att" id="lines"> |
| | | <apex:outputLink value="/{!att.Id}" target="LINK_{!att.Id}"><c:PDFWbr targetStr="{!att.FileName__c}" /></apex:outputLink> |
| | | <apex:outputLink value="/{!att.Id}" target="LINK_{!att.Id}"><c:PDFWbr targetStr="{!att.Name}" /></apex:outputLink> |
| | | <br/> |
| | | </apex:repeat> |
| | | </td> |
| | |
| | | <apex:includeScript value="{!URLFOR($Resource.NewQuoteEntryJS)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.connection20)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.apex20)}"/> |
| | | <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" /> |
| | | |
| | | <script type="text/javascript"> |
| | | // 20220311 PI改造 by Bright start |
| | | AWSService.sfSessionId = '{!GETSESSIONID()}'; |
| | | var staticResource = JSON.parse('{!staticResource}'); |
| | | var contactstaticResource = JSON.parse('{!contactstaticResource}'); |
| | | |
| | | var aws_data = {}; |
| | | |
| | | function Decrypt(r,dataIds,callback){ |
| | | if (!(dataIds && dataIds.length)) { |
| | | if(callback)callback(); |
| | | return; |
| | | } |
| | | |
| | | let Foo = function(){ |
| | | for (const id of dataIds) { |
| | | if (aws_data.hasOwnProperty(id)) { |
| | | let d = aws_data[id]; |
| | | let $e =j$("[aws-id='"+d.dataId+ "']"); |
| | | $e.each((i,e)=>{ |
| | | j$(e).html(d[j$(e).attr("aws-api")]); |
| | | }) |
| | | |
| | | } |
| | | } |
| | | if(callback)callback(); |
| | | } |
| | | let ids = []; |
| | | for (const id of dataIds) { |
| | | if (!aws_data.hasOwnProperty(id)) { |
| | | ids.push(id); |
| | | } |
| | | } |
| | | if (ids.length > 0) { |
| | | |
| | | AWSService.search(r.searchUrl,JSON.stringify({ |
| | | "dataIds":ids |
| | | }),function(data){ |
| | | |
| | | if(data.object && data.object.length > 0){ |
| | | |
| | | for(let d of data.object){ |
| | | if(d.dataId){ |
| | | aws_data[d.dataId] = d; |
| | | } |
| | | } |
| | | Foo(); |
| | | }else{ |
| | | if(callback)callback(); |
| | | } |
| | | },r.token); |
| | | }else{ |
| | | Foo(); |
| | | } |
| | | } |
| | | |
| | | function DecryptAll(callback){ |
| | | let dataIds1 = []; |
| | | j$('[aws-id][aws-obj="Contact"]').each((i,e)=>{ |
| | | let v = j$(e).attr('aws-id'); |
| | | if (v) { |
| | | dataIds1.push(v); |
| | | } |
| | | }); |
| | | Decrypt(contactstaticResource,dataIds1,callback); |
| | | |
| | | let dataIds2 = []; |
| | | j$('[aws-id][aws-obj="Quotes__c"]').each((i,e)=>{ |
| | | let v = j$(e).attr('aws-id'); |
| | | if (v) { |
| | | dataIds2.push(v); |
| | | } |
| | | }); |
| | | Decrypt(staticResource,dataIds2,callback); |
| | | } |
| | | |
| | | j$(function(){ |
| | | DecryptAll(); |
| | | |
| | | }) |
| | | // 20220311 PI改造 by Bright end |
| | | |
| | | function openPDF(){ |
| | | |
| | |
| | | <tr> |
| | | |
| | | <td colspan="2" align="left" ><apex:outputField id="CURRENCY" value="{!QuotesPage.CURRENCY__c}" style="width: 56%"/></td> |
| | | <td colspan="2" align="left" > |
| | | <a href="/{!QuotesPage.CONTACT_NAME__c}" aws-obj="Contact" aws-api="lastName" aws-id="{!QuotesPage.CONTACT_NAME__r.AWS_Data_Id__c}">{!QuotesPage.CONTACT_NAME__r.Name}</a> |
| | | </td> |
| | | <td colspan="2" align="left" ><apex:outputField value="{!QuotesPage.CONTACT_NAME__c}" style="width: 63%"/></td> |
| | | <td colspan="2"/> |
| | | <td colspan="2" class="title1">Summary</td> |
| | | <td/> |
| | |
| | | <tr> |
| | | <td colspan="2" align="left" ><apex:outputField id="COMPANY" value="{!QuotesPage.COMPANY__c}"/> |
| | | </td> |
| | | <td align="left" ><apex:outputField html-aws-obj="Quotes__c" html-aws-api="contactPhone" html-aws-id="{!QuotesPage.AWS_Data_Id__c}" id="CONTACT_PHONE" value="{!QuotesPage.CONTACT_PHONE__c}"/></td> |
| | | <td align="left" ><apex:outputField id="CONTACT_PHONE" value="{!QuotesPage.CONTACT_PHONE__c}"/></td> |
| | | <td colspan="3"/> |
| | | <td class="title2">{!$ObjectType.Quotes__c.fields.DISCOUNT__c.label}</td> |
| | | <td class="title2" align="left" ><apex:outputField value="{!QuotesPage.DISCOUNT__c}" style="width: 62%"/></td> |
| | |
| | | <td class="hand" align="left" >{!$ObjectType.Quotes__c.fields.SHIP_TO__c.label}</td> |
| | | </tr> |
| | | <tr> |
| | | <td colspan="2" align="left" ><apex:outputField html-aws-obj="Quotes__c" html-aws-api="billTo" html-aws-id="{!QuotesPage.AWS_Data_Id__c}" id="BILL_TO" value="{!QuotesPage.BILL_TO__c }" style="width: 90%;height: 80PX"/></td> |
| | | <td colspan="2" align="left" ><apex:outputField html-aws-obj="Quotes__c" html-aws-api="shipTo" html-aws-id="{!QuotesPage.AWS_Data_Id__c}" id="SHIP_TO" value="{!QuotesPage.SHIP_TO__c}" style="width: 90%;height: 80PX"/></td> |
| | | <td colspan="2" align="left" ><apex:outputField id="BILL_TO" value="{!QuotesPage.BILL_TO__c }" style="width: 90%;height: 80PX"/></td> |
| | | <td colspan="2" align="left" ><apex:outputField id="SHIP_TO" value="{!QuotesPage.SHIP_TO__c}" style="width: 90%;height: 80PX"/></td> |
| | | </tr> |
| | | <tr> |
| | | <td colspan="9"> <hr/></td> |
| | |
| | | <td><apex:outputText value="{!mail.haveAtt}" /></td> |
| | | <td> |
| | | <apex:repeat value="{!mail.attList}" var="att" id="lines"> |
| | | <apex:outputLink value="/{!att.Id}" target="LINK_{!att.Id}"><c:PDFWbr targetStr="{!att.FileName__c}" /></apex:outputLink> |
| | | <apex:outputLink value="/{!att.Id}" target="LINK_{!att.Id}"><c:PDFWbr targetStr="{!att.Name}" /></apex:outputLink> |
| | | <br/> |
| | | </apex:repeat> |
| | | </td> |
| | |
| | | <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.CommonUtilJs)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.AWSService, 'AWSService.js') }" /> |
| | | <apex:includeScript value="/soap/ajax/40.0/connection.js"/> |
| | | |
| | | <script> |
| | | aws_result = ''; |
| | | AWSService.sfSessionId = '{!GETSESSIONID()}'; |
| | | var staticResource = JSON.parse('{!staticResource}'); |
| | | function GetObj(){ |
| | | return JSON.stringify([{ |
| | | dataId : document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo:AWS_Data_Id__c").value, |
| | | dealerSalesStaffName : document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo:dssn:opp_DealerSalesStaffName").value, |
| | | dealerService : document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo:ds:opp_DealerService").value, |
| | | }]); |
| | | } |
| | | function ProcessPI(sobjJson, payloadForNewPI,callback) { |
| | | console.log('---insert---'); |
| | | AWSService.post(staticResource.newUrl, payloadForNewPI, function(result){ |
| | | aws_result = result |
| | | if(aws_result && aws_result.object && aws_result.object.length > 0){ |
| | | let obj = aws_result.object[0]; |
| | | if(obj){ |
| | | document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo:AWS_Data_Id__c").value = obj.dataId; |
| | | |
| | | document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo:dssn:opp_DealerSalesStaffName").value = obj.dealerSalesStaffName; |
| | | document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo:ds:opp_DealerService").value = obj.dealerService; |
| | | function saveJs() { |
| | | blockme(); |
| | | saveBtn(); |
| | | } |
| | | |
| | | document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo:DealerSalesStaffName_Encrypted__c").value = obj.dealerSalesStaffNameEncrypt; |
| | | document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo:DealerService_Encrypted__c").value = obj.dealerServiceEncrypt; |
| | | |
| | | } |
| | | if(callback){ |
| | | callback(); |
| | | } |
| | | } |
| | | }, staticResource.token); |
| | | } |
| | | var oppid = ''; |
| | | function Redirect(){ |
| | | window.location.href = '/'+oppid; |
| | | } |
| | | function Trans(){ |
| | | let b = HasError(); |
| | | console.log('---HasError---'); |
| | | console.log(b); |
| | | console.log('---aws_result---'); |
| | | console.log(aws_result); |
| | | AWSService.post(staticResource.transactionUrl, JSON.stringify({ |
| | | "txId":aws_result.txId, |
| | | "isSuccess":b ? 0 : 1 |
| | | }), function(result){ |
| | | console.log('---result---'); |
| | | console.log(result); |
| | | console.log('finish'); |
| | | Redirect(); |
| | | //window.location.reload(); |
| | | }, staticResource.token); |
| | | |
| | | } |
| | | function HasError(){ |
| | | let e = document.getElementById("page:mainfrom:message"); |
| | | console.log(e); |
| | | if (!e) { |
| | | return false; |
| | | } |
| | | function saveYesJs() { |
| | | blockme(); |
| | | saveBtnYes(); |
| | | } |
| | | |
| | | if(j$(e).find(".editListError").length > 0){ |
| | | return true; |
| | | } |
| | | |
| | | let divs = j$(e).find("div.message"); |
| | | for (let i = 0; i < divs.length; i++) { |
| | | for (let j = 0; j < divs[i].classList.length; j++) { |
| | | for(let cls in divs[i].classList){ |
| | | if (cls.indexOf('error')>-1) { |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | return false; |
| | | } |
| | | function saveJs() { |
| | | blockme(); |
| | | ProcessPI({},GetObj(),function(){ |
| | | saveBtn(); |
| | | }); |
| | | } |
| | | function saveNoJs() { |
| | | blockme(); |
| | | saveBtnNo(); |
| | | } |
| | | |
| | | function saveYesJs() { |
| | | blockme(); |
| | | saveBtnYes(); |
| | | function cancelJs() { |
| | | var baseUrl = '{!baseUrl}'; |
| | | var rtUrl = '{!rtUrl}'; |
| | | if (rtUrl == 'null' || rtUrl == '') { |
| | | rtUrl = '{!conId}'; |
| | | } |
| | | |
| | | function saveNoJs() { |
| | | blockme(); |
| | | saveBtnNo(); |
| | | } |
| | | |
| | | function cancelJs() { |
| | | var baseUrl = '{!baseUrl}'; |
| | | var rtUrl = '{!rtUrl}'; |
| | | if (rtUrl == 'null' || rtUrl == '') { |
| | | rtUrl = '{!conId}'; |
| | | } |
| | | window.location.href = baseUrl + "/" + rtUrl; |
| | | } |
| | | window.location.href = baseUrl + "/" + rtUrl; |
| | | } |
| | | </script> |
| | | |
| | | <apex:form id="mainForm"> |
| | | <script> |
| | | oppid = '{!oppid}'; |
| | | </script> |
| | | <apex:actionFunction action="{!saveBtn}" name="saveBtn" reRender="mainForm,message" oncomplete="unblockUI();Trans();"/> |
| | | <apex:actionFunction action="{!saveBtn}" name="saveBtn" reRender="mainForm,message" oncomplete="unblockUI();"/> |
| | | <apex:actionFunction action="{!saveBtnYes}" name="saveBtnYes" reRender="mainForm,message" oncomplete="unblockUI();"/> |
| | | <apex:actionFunction action="{!saveBtnNo}" name="saveBtnNo" reRender="mainForm,message" oncomplete="unblockUI();"/> |
| | | |
| | |
| | | </apex:pageBlockSectionItem> |
| | | </apex:pageBlockSection> |
| | | |
| | | <apex:pageBlockSection id="DealerInfo" title="经销商相关信息" columns="2"> |
| | | <apex:pageBlockSection title="经销商相关信息" columns="2"> |
| | | <apex:pageBlockSectionItem > |
| | | <apex:outputLabel value="代理商名" for="opp_Dealer"/> |
| | | <apex:inputField value="{!opp.Dealer__c}" id="opp_Dealer"/> |
| | | </apex:pageBlockSectionItem> |
| | | |
| | | <apex:pageBlockSectionItem id="dssn" > |
| | | <apex:outputLabel value="代理商销售担当者名" for="opp_DealerSalesStaffName"/> |
| | | <apex:inputField value="{!opp.DealerSalesStaffName__c}" id="opp_DealerSalesStaffName"/><!--pi--> |
| | | </apex:pageBlockSectionItem> |
| | | |
| | | <apex:pageBlockSectionItem > |
| | | <apex:outputLabel value="代理商销售担当者名" for="opp_DealerSalesStaffName"/> |
| | | <apex:inputField value="{!opp.DealerSalesStaffName__c}" id="opp_DealerSalesStaffName"/> |
| | | </apex:pageBlockSectionItem> |
| | | |
| | | |
| | | |
| | | <apex:pageBlockSectionItem > |
| | | <apex:outputLabel value="中间商名" for="opp_SubDealer"/> |
| | | <apex:inputField value="{!opp.SubDealer__c}" id="opp_SubDealer"/> |
| | | </apex:pageBlockSectionItem> |
| | | <apex:pageBlockSectionItem id="ds" > |
| | | <apex:pageBlockSectionItem > |
| | | <apex:outputLabel value="代理商服务担当者名" for="opp_DealerService"/> |
| | | <apex:inputField value="{!opp.DealerService__c}" id="opp_DealerService"/><!--pi--> |
| | | <apex:inputField value="{!opp.DealerService__c}" id="opp_DealerService"/> |
| | | </apex:pageBlockSectionItem> |
| | | <apex:inputHidden value="{!opp.AWS_Data_Id__c}" id="AWS_Data_Id__c"/> |
| | | <apex:inputHidden value="{!opp.DealerSalesStaffName_Encrypted__c}" id="DealerSalesStaffName_Encrypted__c"/> |
| | | <apex:inputHidden value="{!opp.DealerService_Encrypted__c}" id="DealerService_Encrypted__c"/> |
| | | </apex:pageBlockSection> |
| | | |
| | | <apex:pageBlockSection title="跨区域销售" columns="2"> |
| | |
| | | <apex:outputLabel value="合作区域负责人" for="HeadOfCooperationArea__c"/> |
| | | <apex:inputField value="{!opp.HeadOfCooperationArea__c}" id="HeadOfCooperationArea__c"/> |
| | | </apex:pageBlockSectionItem> |
| | | |
| | | </apex:pageBlockSection> |
| | | |
| | | |
| | |
| | | <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.CommonUtilJs)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.AWSService, 'AWSService.js') }" /> |
| | | <apex:includeScript value="/soap/ajax/40.0/connection.js"/> |
| | | |
| | | <script> |
| | | aws_result = ''; |
| | | AWSService.sfSessionId = '{!GETSESSIONID()}'; |
| | | var staticResource = JSON.parse('{!staticResource}'); |
| | | function GetObj(){ |
| | | if('{!isDealerPage}'=='true'){ |
| | | if('{!ProductSegment}'=='NDT'||'{!ProductSegment}'=='ANT'){ |
| | | return JSON.stringify([{ |
| | | dataId : document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo:AWS_Data_Id__c").value, |
| | | dealerSalesStaffName : document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo2:dssnd2:opp_DealerSalesStaffName").value, |
| | | dealerService : document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo2:ds:opp_DealerService").value, |
| | | }]); |
| | | }else{ |
| | | return JSON.stringify([{ |
| | | dataId : document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo:AWS_Data_Id__c").value, |
| | | dealerSalesStaffName : document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo2:dssnd1:opp_DealerSalesStaffName").value, |
| | | dealerService : document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo2:ds:opp_DealerService").value, |
| | | }]); |
| | | } |
| | | }else{ |
| | | if('{!ProductSegment}'=='NDT'||'{!ProductSegment}'=='ANT'){ |
| | | return JSON.stringify([{ |
| | | dataId : document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo:AWS_Data_Id__c").value, |
| | | dealerSalesStaffName : document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo:dssn2:opp_DealerSalesStaffName").value, |
| | | dealerService : document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo:ds:opp_DealerService").value, |
| | | }]); |
| | | }else{ |
| | | return JSON.stringify([{ |
| | | dataId : document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo:AWS_Data_Id__c").value, |
| | | dealerSalesStaffName : document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo:dssn1:opp_DealerSalesStaffName").value, |
| | | dealerService : document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo:ds:opp_DealerService").value, |
| | | }]); |
| | | } |
| | | } |
| | | } |
| | | function ProcessPI(sobjJson, payloadForNewPI,callback) { |
| | | console.log('---insert---'); |
| | | AWSService.post(staticResource.newUrl, payloadForNewPI, function(result){ |
| | | aws_result = result |
| | | if(aws_result && aws_result.object && aws_result.object.length > 0){ |
| | | let obj = aws_result.object[0]; |
| | | if(obj){ |
| | | document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo:AWS_Data_Id__c").value = obj.dataId; |
| | | if('{!isDealerPage}'=='true'){ |
| | | document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo2:dssnd1:opp_DealerSalesStaffName").value = obj.dealerSalesStaffName; |
| | | document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo2:dsd:opp_DealerService").value = obj.dealerService; |
| | | |
| | | document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo:Dealer_Sales_Staff_Name_D_Encrypted__c").value = obj.dealerSalesStaffNameDEncrypt; |
| | | document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo:Dealer_Service_D_Encrypted__c").value = obj.dealerServiceDEncrypt; |
| | | }else{ |
| | | document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo:dssn1:opp_DealerSalesStaffName").value = obj.dealerSalesStaffName; |
| | | document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo:ds:opp_DealerService").value = obj.dealerService; |
| | | |
| | | document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo:DealerSalesStaffName_Encrypted__c").value = obj.dealerSalesStaffNameEncrypt; |
| | | document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo:DealerService_Encrypted__c").value = obj.dealerServiceEncrypt; |
| | | } |
| | | } |
| | | if(callback){ |
| | | callback(); |
| | | } |
| | | } |
| | | }, staticResource.token); |
| | | } |
| | | var oppid = ''; |
| | | function Redirect(){ |
| | | window.location.href = '/'+oppid; |
| | | } |
| | | function Trans(){ |
| | | let b = HasError(); |
| | | console.log('---HasError---'); |
| | | console.log(b); |
| | | console.log('---aws_result---'); |
| | | console.log(aws_result); |
| | | AWSService.post(staticResource.transactionUrl, JSON.stringify({ |
| | | "txId":aws_result.txId, |
| | | "isSuccess":b ? 0 : 1 |
| | | }), function(result){ |
| | | console.log('---result---'); |
| | | console.log(result); |
| | | console.log('finish'); |
| | | Redirect(); |
| | | //window.location.reload(); |
| | | }, staticResource.token); |
| | | |
| | | } |
| | | function HasError(){ |
| | | let e = document.getElementById("page:mainForm:message"); |
| | | console.log(e); |
| | | if (!e) { |
| | | return false; |
| | | } |
| | | |
| | | if(j$(e).find(".editListError").length > 0){ |
| | | return true; |
| | | } |
| | | |
| | | let divs = j$(e).find("div.message"); |
| | | for (let i = 0; i < divs.length; i++) { |
| | | for (let j = 0; j < divs[i].classList.length; j++) { |
| | | for(let cls in divs[i].classList){ |
| | | if (cls.indexOf('error')>-1) { |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | return false; |
| | | } |
| | | function saveJs() { |
| | | blockme(); |
| | | console.log('{!isDealerPage}'); |
| | | console.log('{!ProductSegment}'); |
| | | ProcessPI({},GetObj(),function(){ |
| | | saveBtn(); |
| | | }); |
| | | // |
| | | saveBtn(); |
| | | } |
| | | |
| | | function saveYesJs() { |
| | |
| | | </script> |
| | | |
| | | <apex:form id="mainForm"> |
| | | <script> |
| | | oppid = '{!oppid}'; |
| | | </script> |
| | | <apex:actionFunction action="{!saveBtn}" name="saveBtn" reRender="mainForm,message" oncomplete="unblockUI();Trans();"/> |
| | | <apex:actionFunction action="{!saveBtn}" name="saveBtn" reRender="mainForm,message" oncomplete="unblockUI();"/> |
| | | <apex:actionFunction action="{!saveBtnYes}" name="saveBtnYes" reRender="mainForm,message" oncomplete="unblockUI();"/> |
| | | <apex:actionFunction action="{!saveBtnNo}" name="saveBtnNo" reRender="mainForm,message" oncomplete="unblockUI();"/> |
| | | |
| | |
| | | </apex:pageBlockSectionItem> |
| | | </apex:pageBlockSection> |
| | | |
| | | <apex:pageBlockSection id="DealerInfo" title="经销商相关信息" columns="2"> |
| | | <apex:pageBlockSection title="经销商相关信息" columns="2"> |
| | | <apex:pageBlockSectionItem > |
| | | <apex:outputLabel value="代理商名" for="opp_Dealer"/> |
| | | <apex:inputField value="{!opp.Dealer__c}" id="opp_Dealer"/> |
| | | </apex:pageBlockSectionItem> |
| | | |
| | | <apex:pageBlockSectionItem id="dssn1" rendered="{!IF(ProductSegment == 'NDT' || ProductSegment == 'ANI', false, true)}"> |
| | | <apex:outputLabel value="代理商销售担当者名" for="opp_DealerSalesStaffName"/> |
| | | <apex:inputField value="{!opp.DealerSalesStaffName__c}" id="opp_DealerSalesStaffName"/><!--pi--> |
| | | </apex:pageBlockSectionItem> |
| | | |
| | | <apex:pageBlockSectionItem id="dssn2" rendered="{!IF(ProductSegment == 'NDT' || ProductSegment == 'ANI', true, false)}"> |
| | | <apex:outputLabel value="代理商销售担当者名" for="opp_DealerSalesStaffName"/> |
| | | <apex:inputField value="{!opp.DealerSalesStaffName__c}" id="opp_DealerSalesStaffName" required="true"/><!--pi--> |
| | | </apex:pageBlockSectionItem> |
| | | <apex:pageBlockSectionItem rendered="{!IF(ProductSegment == 'NDT' || ProductSegment == 'ANI', false, true)}"> |
| | | <apex:outputLabel value="代理商销售担当者名" for="opp_DealerSalesStaffName"/> |
| | | <apex:inputField value="{!opp.DealerSalesStaffName__c}" id="opp_DealerSalesStaffName"/> |
| | | </apex:pageBlockSectionItem> |
| | | |
| | | <apex:pageBlockSectionItem rendered="{!IF(ProductSegment == 'NDT' || ProductSegment == 'ANI', true, false)}"> |
| | | <apex:outputLabel value="代理商销售担当者名" for="opp_DealerSalesStaffName"/> |
| | | <apex:inputField value="{!opp.DealerSalesStaffName__c}" id="opp_DealerSalesStaffName" required="true"/> |
| | | </apex:pageBlockSectionItem> |
| | | |
| | | <apex:pageBlockSectionItem > |
| | | <apex:outputLabel value="中间商名" for="opp_SubDealer"/> |
| | | <apex:inputField value="{!opp.SubDealer__c}" id="opp_SubDealer"/> |
| | | </apex:pageBlockSectionItem> |
| | | <apex:pageBlockSectionItem id="ds" > |
| | | <apex:pageBlockSectionItem > |
| | | <apex:outputLabel value="代理商服务担当者名" for="opp_DealerService"/> |
| | | <apex:inputField value="{!opp.DealerService__c}" id="opp_DealerService"/><!--pi--> |
| | | <apex:inputField value="{!opp.DealerService__c}" id="opp_DealerService"/> |
| | | </apex:pageBlockSectionItem> |
| | | <apex:inputHidden value="{!opp.AWS_Data_Id__c}" id="AWS_Data_Id__c"/> |
| | | <apex:inputHidden value="{!opp.DealerSalesStaffName_Encrypted__c}" id="DealerSalesStaffName_Encrypted__c"/> |
| | | <apex:inputHidden value="{!opp.DealerService_Encrypted__c}" id="DealerService_Encrypted__c"/> |
| | | <apex:inputHidden value="{!opp.Dealer_Sales_Staff_Name_D_Encrypted__c}" id="Dealer_Sales_Staff_Name_D_Encrypted__c"/> |
| | | <!-- <apex:inputHidden value="{!opp.Dealer_Service_D_Encrypted__c}" id="Dealer_Service_D_Encrypted__c"/> --> |
| | | <input id="Page:mainForm:idSearchSetProduct:DealerInfo:Dealer_Service_D_Encrypted__c" type="hidden" name="Page:mainForm:idSearchSetProduct:DealerInfo:Dealer_Service_D_Encrypted__c" value="{!opp.Dealer_Service_D_Encrypted__c}"/> |
| | | </apex:pageBlockSection> |
| | | |
| | | <apex:pageBlockSection title="跨区域销售" columns="2"> |
| | |
| | | </apex:pageBlockSectionItem> |
| | | </apex:pageBlockSection> |
| | | |
| | | <apex:pageBlockSection id="DealerInfo2" title="经销商相关信息" columns="2"> |
| | | <apex:pageBlockSection title="经销商相关信息" columns="2"> |
| | | <apex:pageBlockSectionItem > |
| | | <apex:outputLabel value="代理商名" for="opp_Dealer"/> |
| | | <apex:inputField value="{!opp.Dealer__c}" id="opp_Dealer"/> |
| | | </apex:pageBlockSectionItem> |
| | | <!-- <apex:outputPanel layout="none" rendered="{!IF(ProductSegment == 'NDT' || ProductSegment == 'ANI', false, true)}"> --> |
| | | <apex:pageBlockSectionItem id="dssnd1" rendered="{!IF(ProductSegment == 'NDT' || ProductSegment == 'ANI', false, true)}"> |
| | | <apex:outputLabel value="代理商销售担当者名." for="opp_DealerSalesStaffName"/> |
| | | <apex:inputField value="{!opp.Dealer_Sales_Staff_Name_D__c}" id="opp_DealerSalesStaffName"/><!--pi--> |
| | | </apex:pageBlockSectionItem> |
| | | <apex:pageBlockSectionItem rendered="{!IF(ProductSegment == 'NDT' || ProductSegment == 'ANI', false, true)}"> |
| | | <apex:outputLabel value="代理商销售担当者名." for="opp_DealerSalesStaffName"/> |
| | | <apex:inputField value="{!opp.Dealer_Sales_Staff_Name_D__c}" id="opp_DealerSalesStaffName"/> |
| | | </apex:pageBlockSectionItem> |
| | | <!-- </apex:outputPanel> --> |
| | | <!-- <apex:outputPanel rendered="{!IF(ProductSegment == 'NDT' || ProductSegment == 'ANI', true, false)}" layout="inline"> --> |
| | | <apex:pageBlockSectionItem id="dssnd2" rendered="{!IF(ProductSegment == 'NDT' || ProductSegment == 'ANI', true, false)}"> |
| | | <apex:outputLabel value="代理商销售担当者名." for="opp_DealerSalesStaffName"/> |
| | | <apex:inputField value="{!opp.Dealer_Sales_Staff_Name_D__c}" id="opp_DealerSalesStaffName" required="true"/><!--pi--> |
| | | </apex:pageBlockSectionItem> |
| | | <apex:pageBlockSectionItem rendered="{!IF(ProductSegment == 'NDT' || ProductSegment == 'ANI', true, false)}"> |
| | | <apex:outputLabel value="代理商销售担当者名." for="opp_DealerSalesStaffName"/> |
| | | <apex:inputField value="{!opp.Dealer_Sales_Staff_Name_D__c}" id="opp_DealerSalesStaffName" required="true"/> |
| | | </apex:pageBlockSectionItem> |
| | | <!-- </apex:outputPanel> --> |
| | | <apex:pageBlockSectionItem > |
| | | <apex:outputLabel value="中间商名." for="opp_SubDealer"/> |
| | | <apex:inputField value="{!opp.Sub_Dealer_D__c}" id="opp_SubDealer"/> |
| | | </apex:pageBlockSectionItem> |
| | | <apex:pageBlockSectionItem id="dsd" > |
| | | <apex:pageBlockSectionItem > |
| | | <apex:outputLabel value="代理商服务担当者名." for="opp_DealerService"/> |
| | | <apex:inputField value="{!opp.Dealer_Service_D__c}" id="opp_DealerService"/><!--pi--> |
| | | <apex:inputField value="{!opp.Dealer_Service_D__c}" id="opp_DealerService"/> |
| | | </apex:pageBlockSectionItem> |
| | | </apex:pageBlockSection> |
| | | |
| | |
| | | <apex:inputField value="{!diagnosisPart.Product__c}" id="ITEM" required="true"/> |
| | | </apex:pageBlockSectionItem> |
| | | |
| | | <apex:pageBlockSectionItem > |
| | | <apex:outputLabel value="{!$ObjectType.Diagnosis_Part__c.fields.PRODUCT_CODE__c.label}" for="PRODUCT_CODE"/> |
| | | <apex:inputField value="{!diagnosisPart.PRODUCT_CODE__c}" id="PRODUCT_CODE" required="true"/> |
| | | </apex:pageBlockSectionItem> |
| | | |
| | | <apex:pageBlockSectionItem > |
| | | <apex:outputLabel value="{!$ObjectType.Diagnosis_Part__c.fields.PRODUCT_PART_NUMBER__c.label}" for="PRODUCT_PART_NUMBER"/> |
| | | <apex:inputField value="{!diagnosisPart.PRODUCT_PART_NUMBER__c}" id="PRODUCT_PART_NUMBER" required="true"/> |
| | | </apex:pageBlockSectionItem> |
| | | |
| | | <apex:pageBlockSectionItem > |
| | | <apex:outputLabel value="{!$ObjectType.Diagnosis_Part__c.fields.PRODUCT_DESCRIPTION__c.label}" for="PRODUCT_DESCRIPTION"/> |
| | | <apex:inputField value="{!diagnosisPart.PRODUCT_DESCRIPTION__c}" id="PRODUCT_DESCRIPTION" required="true"/> |
| | | </apex:pageBlockSectionItem> |
| | | |
| | | <apex:pageBlockSectionItem > |
| | | <apex:outputLabel value="{!$ObjectType.Diagnosis_Part__c.fields.QUANTITY__c.label}" for="QUANTITY"/> |
| | | <apex:inputField value="{!diagnosisPart.QUANTITY__c}" id="QUANTITY" required="true"/> |
| | |
| | | <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.CommonUtilJs)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.AWSService, 'AWSService.js') }" /> |
| | | <apex:includeScript value="/soap/ajax/40.0/connection.js"/> |
| | | |
| | | <script> |
| | | aws_result = ''; |
| | | function saveJs() { |
| | | blockme(); |
| | | if(document.getElementById("page:mainForm:idSearchSetProduct:DealerInfo:ReceiveInfo:dssn:opp_DealerSalesStaffName") || document.getElementById("page:mainForm:idSearchSetProduct:DealerInfo:ReceiveInfo:ds:opp_DealerService")){ |
| | | ProcessPI({},GetObj(),function(){ |
| | | saveBtn(); |
| | | }); |
| | | }else{ |
| | | saveBtn(); |
| | | } |
| | | |
| | | } |
| | | function saveJs() { |
| | | blockme(); |
| | | saveBtn(); |
| | | } |
| | | |
| | | function saveYesJs() { |
| | | blockme(); |
| | | saveBtnYes(); |
| | | } |
| | | function saveYesJs() { |
| | | blockme(); |
| | | saveBtnYes(); |
| | | } |
| | | |
| | | function saveNoJs() { |
| | | blockme(); |
| | | saveBtnNo(); |
| | | } |
| | | function saveNoJs() { |
| | | blockme(); |
| | | saveBtnNo(); |
| | | } |
| | | |
| | | function cancelJs() { |
| | | var baseUrl = '{!baseUrl}'; |
| | | var rtUrl = '{!rtUrl}'; |
| | | if (rtUrl == 'null' || rtUrl == '') { |
| | | rtUrl = '{!conId}'; |
| | | } |
| | | window.location.href = baseUrl + "/" + rtUrl; |
| | | function cancelJs() { |
| | | var baseUrl = '{!baseUrl}'; |
| | | var rtUrl = '{!rtUrl}'; |
| | | if (rtUrl == 'null' || rtUrl == '') { |
| | | rtUrl = '{!conId}'; |
| | | } |
| | | function GetObj(){ |
| | | return JSON.stringify([{ |
| | | dataId : document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo:AWS_Data_Id__c").value, |
| | | dealerSalesStaffName : document.getElementById("page:mainForm:idSearchSetProduct:DealerInfo:ReceiveInfo:dssn:opp_DealerSalesStaffName").value, |
| | | dealerService : document.getElementById("page:mainForm:idSearchSetProduct:DealerInfo:ReceiveInfo:ds:opp_DealerService").value, |
| | | }]); |
| | | |
| | | } |
| | | function ProcessPI(sobjJson, payloadForNewPI,callback) { |
| | | console.log('---insert---'); |
| | | AWSService.post(staticResource.newUrl, payloadForNewPI, function(result){ |
| | | aws_result = result |
| | | SetEditObj(); |
| | | if(callback){ |
| | | callback(); |
| | | } |
| | | }, staticResource.token); |
| | | } |
| | | function SetEditObj(){ |
| | | let obj = GetAWSResultObj(); |
| | | if(obj){ |
| | | document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo:AWS_Data_Id__c").value = obj.dataId; |
| | | |
| | | document.getElementById("page:mainForm:idSearchSetProduct:DealerInfo:ReceiveInfo:dssn:opp_DealerSalesStaffName").value = obj.dealerSalesStaffName; |
| | | document.getElementById("page:mainForm:idSearchSetProduct:DealerInfo:ReceiveInfo:ds:opp_DealerService").value = obj.dealerService; |
| | | |
| | | document.getElementById("page:mainForm:idSearchSetProduct:DealerInfo:DealerSalesStaffName_Encrypted__c").value = obj.dealerSalesStaffNameEncrypt; |
| | | document.getElementById("page:mainForm:idSearchSetProduct:DealerInfo:DealerService_Encrypted__c").value = obj.dealerServiceEncrypt; |
| | | } |
| | | } |
| | | function GetAWSResultObj(){ |
| | | if(aws_result && aws_result.object && aws_result.object.length > 0){ |
| | | return aws_result.object[0]; |
| | | } |
| | | return null; |
| | | } |
| | | var oppid = ''; |
| | | function Redirect(){ |
| | | window.location.href = '/'+oppid; |
| | | } |
| | | //aws 确认 |
| | | function Trans(){ |
| | | let b = HasError(); |
| | | console.log('---HasError---'); |
| | | console.log(b); |
| | | console.log('---aws_result---'); |
| | | console.log(aws_result); |
| | | if(b){ |
| | | //清空pi |
| | | document.getElementById('page:mainForm:DealerInfo:ReceiveInfo:dssn:opp_DealerSalesStaffName').value='' |
| | | document.getElementById('page:mainForm:DealerInfo:ReceiveInfo:ds:opp_DealerService').value='' |
| | | } |
| | | AWSService.post(staticResource.transactionUrl, JSON.stringify({ |
| | | "txId":aws_result.txId, |
| | | "isSuccess":b ? 0 : 1 |
| | | }), function(result){ |
| | | console.log('---result---'); |
| | | console.log(result); |
| | | console.log('finish'); |
| | | Redirect(); |
| | | //window.location.reload(); |
| | | }, staticResource.token); |
| | | |
| | | } |
| | | function HasError(){ |
| | | let e = document.getElementById("page:mainForm:message"); |
| | | console.log(e); |
| | | if (!e) { |
| | | return false; |
| | | } |
| | | if(j$(e).find(".editListError").length > 0){ |
| | | return true; |
| | | } |
| | | let divs = j$(e).find("div.message"); |
| | | for (let i = 0; i < divs.length; i++) { |
| | | for (let j = 0; j < divs[i].classList.length; j++) { |
| | | for(let cls of divs[i].classList){ |
| | | if (cls.indexOf('error')>-1) { |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | return false; |
| | | } |
| | | window.location.href = baseUrl + "/" + rtUrl; |
| | | } |
| | | </script> |
| | | |
| | | <apex:form id="mainForm"> |
| | | <script> |
| | | oppid = '{!oppid}'; |
| | | </script> |
| | | <apex:actionFunction action="{!saveBtn}" name="saveBtn" reRender="mainForm,message" oncomplete="unblockUI();Trans();"/> |
| | | <apex:actionFunction action="{!saveBtn}" name="saveBtn" reRender="mainForm,message" oncomplete="unblockUI();"/> |
| | | <apex:actionFunction action="{!saveBtnYes}" name="saveBtnYes" reRender="mainForm,message" oncomplete="unblockUI();"/> |
| | | <apex:actionFunction action="{!saveBtnNo}" name="saveBtnNo" reRender="mainForm,message" oncomplete="unblockUI();"/> |
| | | |
| | |
| | | </apex:pageBlockSectionItem> |
| | | </apex:pageBlockSection> |
| | | |
| | | <apex:pageBlockSection id="DealerInfo" title="经销商相关信息" columns="2"> |
| | | <apex:pageBlockSection title="经销商相关信息" columns="2"> |
| | | <apex:pageBlockSectionItem > |
| | | <apex:outputLabel value="代理商名" for="opp_Dealer"/> |
| | | <apex:inputField value="{!opp.Dealer__c}" id="opp_Dealer"/> |
| | | </apex:pageBlockSectionItem> |
| | | |
| | | <apex:pageBlockSectionItem id="dssn" > |
| | | <apex:outputLabel value="代理商销售担当者名" for="opp_DealerSalesStaffName"/> |
| | | <apex:inputField value="{!opp.DealerSalesStaffName__c}" id="opp_DealerSalesStaffName"/><!--pi--> |
| | | </apex:pageBlockSectionItem> |
| | | |
| | | <apex:pageBlockSectionItem > |
| | | <apex:outputLabel value="代理商销售担当者名" for="opp_DealerSalesStaffName"/> |
| | | <apex:inputField value="{!opp.DealerSalesStaffName__c}" id="opp_DealerSalesStaffName"/> |
| | | </apex:pageBlockSectionItem> |
| | | |
| | | |
| | | |
| | | <apex:pageBlockSectionItem > |
| | | <apex:outputLabel value="中间商名" for="opp_SubDealer"/> |
| | | <apex:inputField value="{!opp.SubDealer__c}" id="opp_SubDealer"/> |
| | | </apex:pageBlockSectionItem> |
| | | <apex:pageBlockSectionItem id="ds" > |
| | | <apex:pageBlockSectionItem > |
| | | <apex:outputLabel value="代理商服务担当者名" for="opp_DealerService"/> |
| | | <apex:inputField value="{!opp.DealerService__c}" id="opp_DealerService"/><!--pi--> |
| | | <apex:inputField value="{!opp.DealerService__c}" id="opp_DealerService"/> |
| | | </apex:pageBlockSectionItem> |
| | | <apex:inputHidden id="AWS_Data_Id__c" value="{!opp.AWS_Data_Id__c}"/> |
| | | <apex:inputHidden id="DealerSalesStaffName_Encrypted__c" value="{!opp.DealerSalesStaffName_Encrypted__c}"/> |
| | | <apex:inputHidden id="DealerService_Encrypted__c" value="{!opp.DealerService_Encrypted__c}"/> |
| | | </apex:pageBlockSection> |
| | | |
| | | |
| | |
| | | <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/> |
| | | <!-- Update 20220318 By Yang Kaiyu Start --> |
| | | <apex:includeScript value="{!URLFOR($Resource.CommonUtilJs)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.AWSService, 'AWSService.js') }" /> |
| | | <script src="../../soap/ajax/53.0/connection.js" type="text/javascript"></script> |
| | | <!-- Update 20220318 By Yang Kaiyu End --> |
| | | |
| | | <script> |
| | | // Update 20220318 By Yang Kaiyu Start |
| | | aws_result = ''; |
| | | lu_aws_result = ''; |
| | | AWSService.sfSessionId = '{!GETSESSIONID()}'; |
| | | var staticResource = JSON.parse('{!staticResource}'); |
| | | var staticResourceContact = JSON.parse('{!staticResourceContact}'); |
| | | var staticResourceLoanerUser = JSON.parse('{!staticResourceLoanerUser}'); |
| | | function searchPI(){ |
| | | console.log('---searchPI---'); |
| | | var conAwsDataid =''; |
| | | conAwsDataid = document.getElementById("page:mainfrom:idSearchSetProduct:con_AWS_Data_Id__c").value; |
| | | if(conAwsDataid){ |
| | | blockme(); |
| | | console.log('---AWSService---'); |
| | | AWSService.query(staticResourceContact.queryUrl,conAwsDataid,function(data){ |
| | | unblockUI(); |
| | | if(data.object){ |
| | | console.log('----------------data-----------------'); |
| | | console.log(data); |
| | | console.log('----------------data-----------------'); |
| | | document.getElementById("page:mainfrom:idSearchSetProduct:Contact__c").value = '{!contactID}'; |
| | | document.getElementById("page:mainfrom:idSearchSetProduct:ContactNumber__c").value = data.object.phone; |
| | | if(document.getElementById("page:mainfrom:idSearchSetProduct:ContactNumber__c").value){ |
| | | AWSService.post(staticResourceLoanerUser.newUrl, GetLUObj(), function(result){ |
| | | if(result && result.object){ |
| | | lu_aws_result = result; |
| | | console.log('----------------result-----------------'); |
| | | console.log(result); |
| | | console.log('----------------result-----------------'); |
| | | document.getElementById("page:mainfrom:idSearchSetProduct:lu_AWS_Data_Id__c").value = result.object.dataId; |
| | | document.getElementById("page:mainfrom:idSearchSetProduct:ContactNumber__c").value = result.object.phone; |
| | | document.getElementById("page:mainfrom:idSearchSetProduct:ContactNumber_Encrypted__c").value = result.object.phoneEncrypted; |
| | | } |
| | | }, staticResourceLoanerUser.token); |
| | | } |
| | | } |
| | | },staticResourceContact.token); |
| | | } |
| | | } |
| | | function GetLUObj(){ |
| | | return JSON.stringify([{ |
| | | contactNumber : document.getElementById("page:mainfrom:idSearchSetProduct:ContactNumber__c").value, |
| | | dataId : document.getElementById("page:mainfrom:idSearchSetProduct:lu_AWS_Data_Id__c").value, |
| | | }]); |
| | | } |
| | | function ProcessPI(sobjJson, payloadForNewPI,callback) { |
| | | console.log('---insert---'); |
| | | AWSService.post(staticResource.newUrl, payloadForNewPI, function(result){ |
| | | aws_result = result |
| | | SetEditObj(); |
| | | if(callback){ |
| | | callback(); |
| | | } |
| | | }, staticResource.token); |
| | | } |
| | | function SetEditObj(){ |
| | | let obj = GetAWSResultObj(); |
| | | if(obj){ |
| | | document.getElementById("page:mainfrom:idSearchSetProduct:AWS_Data_Id__c").value = obj.dataId; |
| | | function saveJs() { |
| | | blockme(); |
| | | saveBtn(); |
| | | } |
| | | |
| | | document.getElementById("page:mainfrom:idSearchSetProduct:ReceiveInfo:pc:Post_Code__c").value = obj.postCode; |
| | | document.getElementById("page:mainfrom:idSearchSetProduct:ReceiveInfo:lrsp:Loaner_receive_staff_phone__c").value= obj.loanerReceiveStaffPhone; |
| | | document.getElementById("page:mainfrom:idSearchSetProduct:ReceiveInfo:lrs:Loaner_receive_staff__c").value = obj.loanerReceiveStaff; |
| | | document.getElementById("page:mainfrom:idSearchSetProduct:LoanerApplicationDetailInfo:ls:Loaner_Ser__c").value = obj.loanerSer; |
| | | document.getElementById("page:mainfrom:idSearchSetProduct:ReceiveInfo:dsa:direct_shippment_address__c").value = obj.directShippmentAddress; |
| | | |
| | | document.getElementById("page:mainfrom:idSearchSetProduct:direct_shippment_address_Encrypted__c").value = obj.directShippmentAddressEncrypt; |
| | | document.getElementById("page:mainfrom:idSearchSetProduct:Pos_Code_Encrypted__c").value = obj.postCodeEncrypt; |
| | | document.getElementById("page:mainfrom:idSearchSetProduct:Loaner_receive_staff_phone_Encrypted__c").value = obj.loanerReceiveStaffPhoneEncrypt; |
| | | document.getElementById("page:mainfrom:idSearchSetProduct:Loaner_receive_staff_Encrypted__c").value = obj.loanerReceiveStaffEncrypt; |
| | | document.getElementById("page:mainfrom:idSearchSetProduct:Loaner_Ser_Encrypted__c").value = obj.loanerSerEncrypt; |
| | | } |
| | | function cancelJs() { |
| | | var baseUrl = '{!baseUrl}'; |
| | | var rtUrl = '{!contactID}'; |
| | | if (rtUrl == 'null' || rtUrl == '') { |
| | | rtUrl = '{!accountID}'; |
| | | } |
| | | function GetAWSResultObj(){ |
| | | if(aws_result && aws_result.object && aws_result.object.length > 0){ |
| | | return aws_result.object[0]; |
| | | } |
| | | return null; |
| | | } |
| | | function GetObj(){ |
| | | return JSON.stringify([{ |
| | | dataId : document.getElementById("page:mainfrom:idSearchSetProduct:AWS_Data_Id__c").value, |
| | | postCode : document.getElementById("page:mainfrom:idSearchSetProduct:ReceiveInfo:pc:Post_Code__c").value, |
| | | loanerReceiveStaffPhone : document.getElementById("page:mainfrom:idSearchSetProduct:ReceiveInfo:lrsp:Loaner_receive_staff_phone__c").value, |
| | | loanerReceiveStaff : document.getElementById("page:mainfrom:idSearchSetProduct:ReceiveInfo:lrs:Loaner_receive_staff__c").value, |
| | | loanerSer : document.getElementById("page:mainfrom:idSearchSetProduct:LoanerApplicationDetailInfo:ls:Loaner_Ser__c").value, |
| | | directShippmentAddress : document.getElementById("page:mainfrom:idSearchSetProduct:ReceiveInfo:dsa:direct_shippment_address__c").value, |
| | | }]); |
| | | |
| | | } |
| | | |
| | | var bt1 = false; |
| | | var bt2 = false; |
| | | var laid = ''; |
| | | function Redirect(){ |
| | | if(bt1 && bt2){ |
| | | window.location.href = '/'+laid; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | //aws 确认 |
| | | function Transla(){ |
| | | let e = HasError(); |
| | | if(!e){ |
| | | AWSService.post(staticResourceLoanerUser.transactionUrl, JSON.stringify({ |
| | | "txId":lu_aws_result.txId, |
| | | "isSuccess":e ? 0 : 1 |
| | | }), function(result){ |
| | | console.log('---result---'); |
| | | console.log(result); |
| | | console.log('finish'); |
| | | bt1=true; |
| | | Redirect(); |
| | | //window.location.reload(); |
| | | }, staticResourceLoanerUser.token); |
| | | } |
| | | } |
| | | function Trans(){ |
| | | let b = HasError(); |
| | | console.log('---HasError---'); |
| | | console.log(b); |
| | | console.log('---aws_result---'); |
| | | console.log(aws_result); |
| | | if(b){ |
| | | //清空pi |
| | | document.getElementById('page:mainfrom:idSearchSetProduct:ReceiveInfo:pc:Post_Code__c').value='' |
| | | document.getElementById('page:mainfrom:idSearchSetProduct:ReceiveInfo:lrsp:Loaner_receive_staff_phone__c').value='' |
| | | document.getElementById('page:mainfrom:idSearchSetProduct:ReceiveInfo:lrs:Loaner_receive_staff__c').value='' |
| | | document.getElementById('page:mainfrom:idSearchSetProduct:LoanerApplicationDetailInfo:ls:Loaner_Ser__c').value='' |
| | | document.getElementById('page:mainfrom:idSearchSetProduct:ReceiveInfo:dsa:direct_shippment_address__c').value='' |
| | | } |
| | | AWSService.post(staticResource.transactionUrl, JSON.stringify({ |
| | | "txId":aws_result.txId, |
| | | "isSuccess":b ? 0 : 1 |
| | | }), function(result){ |
| | | console.log('---result---'); |
| | | console.log(result); |
| | | console.log('finish'); |
| | | bt2=true; |
| | | Redirect(); |
| | | //window.location.reload(); |
| | | }, staticResource.token); |
| | | |
| | | } |
| | | function HasError(){ |
| | | let e = document.getElementById("page:mainfrom:message"); |
| | | console.log(e); |
| | | if (!e) { |
| | | return false; |
| | | } |
| | | |
| | | if(j$(e).find(".editListError").length > 0){ |
| | | return true; |
| | | } |
| | | |
| | | let divs = j$(e).find("div.message"); |
| | | for (let i = 0; i < divs.length; i++) { |
| | | for (let j = 0; j < divs[i].classList.length; j++) { |
| | | for(let cls in divs[i].classList){ |
| | | if (cls.indexOf('error')>-1) { |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | return false; |
| | | } |
| | | // Update 20220318 By Yang Kaiyu End |
| | | |
| | | function saveJs() { |
| | | blockme(); |
| | | // Update 20220318 By Yang Kaiyu Start |
| | | searchPI(); |
| | | ProcessPI({},GetObj(),function(){ |
| | | saveBtn(); |
| | | }); |
| | | // Update 20220318 By Yang Kaiyu End |
| | | } |
| | | |
| | | function cancelJs() { |
| | | var baseUrl = '{!baseUrl}'; |
| | | var rtUrl = '{!contactID}'; |
| | | if (rtUrl == 'null' || rtUrl == '') { |
| | | rtUrl = '{!accountID}'; |
| | | } |
| | | window.location.href = baseUrl + "/" + rtUrl; |
| | | } |
| | | window.location.href = baseUrl + "/" + rtUrl; |
| | | } |
| | | </script> |
| | | |
| | | <apex:form id="mainfrom"> |
| | | <!-- Update 20220318 By Yang Kaiyu Start --> |
| | | <script> |
| | | laid = '{!laid}'; |
| | | </script> |
| | | <!-- Update 20220318 By Yang Kaiyu End --> |
| | | <apex:actionFunction action="{!saveBtn}" name="saveBtn" reRender="mainfrom,message" oncomplete="unblockUI();Transla();Trans();"/> |
| | | |
| | | <apex:actionFunction action="{!saveBtn}" name="saveBtn" reRender="mainForm,message" oncomplete="unblockUI();"/> |
| | | <apex:actionFunction action="{!cancelBtn}" name="cancelBtn" reRender="mainForm,message" oncomplete="unblockUI();"/> |
| | | |
| | | <apex:outputPanel id="message"> |
| | |
| | | </apex:pageBlockButtons> |
| | | |
| | | <apex:outputPanel layout="none" > |
| | | <!-- Update 20220318 By Yang Kaiyu Start --> |
| | | <apex:pageBlockSection id="LoanerApplicationDetailInfo" title="样机借出申请详细信息" columns="2"> |
| | | <!-- Update 20220318 By Yang Kaiyu End --> |
| | | <apex:pageBlockSection title="样机借出申请详细信息" columns="2"> |
| | | |
| | | <apex:pageBlockSectionItem > |
| | | <apex:outputLabel value="样机借出申请名称" for="la_Name"/> |
| | |
| | | <apex:outputLabel value="样机分类" for="la_Type"/> |
| | | <apex:inputField value="{!la.Equipment_Type__c}" id="la_Type" required="true"/> |
| | | </apex:pageBlockSectionItem> |
| | | <!-- Update 20220318 By Yang Kaiyu Start --> |
| | | <apex:pageBlockSectionItem id="ls" > |
| | | <!-- Update 20220318 By Yang Kaiyu End --> |
| | | <apex:pageBlockSectionItem > |
| | | <apex:outputLabel value="借用担当" for="Loaner_Ser__c"/> |
| | | <!-- Update 20220318 By Yang Kaiyu Start --> |
| | | <apex:inputField value="{!la.Loaner_Ser__c}" id="Loaner_Ser__c" required="true"/><!--pi--> |
| | | <!-- Update 20220318 By Yang Kaiyu End --> |
| | | <apex:inputField value="{!la.Loaner_Ser__c}" id="Loaner_Ser__c" required="true"/> |
| | | </apex:pageBlockSectionItem> |
| | | |
| | | |
| | | <apex:pageBlockSectionItem rendered="{!IF(userType == 'Standard', false , true)}"> |
| | | <apex:outputLabel value="审批人" for="Approver__c"/> |
| | | <apex:inputField value="{!la.Approver__c}" id="Approver__c" required="true"/> |
| | |
| | | </apex:pageBlockSectionItem> |
| | | </apex:pageBlockSection> |
| | | |
| | | <!-- Update 20220318 By Yang Kaiyu Start --> |
| | | <apex:pageBlockSection id="ReceiveInfo" title="收件人信息" columns="2"> |
| | | <apex:pageBlockSectionItem id="lrs" > |
| | | <!-- Update 20220318 By Yang Kaiyu End --> |
| | | <apex:pageBlockSection title="收件人信息" columns="2"> |
| | | <apex:pageBlockSectionItem > |
| | | <apex:outputLabel value="收件人姓名" for="Loaner_receive_staff__c"/> |
| | | <!-- Update 20220318 By Yang Kaiyu Start --> |
| | | <apex:inputField value="{!la.Loaner_receive_staff__c}" id="Loaner_receive_staff__c"/><!--pi--> |
| | | <!-- Update 20220318 By Yang Kaiyu End --> |
| | | <apex:inputField value="{!la.Loaner_receive_staff__c}" id="Loaner_receive_staff__c"/> |
| | | </apex:pageBlockSectionItem> |
| | | <apex:pageBlockSectionItem > |
| | | <apex:outputLabel value="自提时间" for="pickup_time__c"/> |
| | | <apex:inputField value="{!la.pickup_time__c}" id="pickup_time__c"/> |
| | | </apex:pageBlockSectionItem> |
| | | <!-- Update 20220318 By Yang Kaiyu Start --> |
| | | <apex:pageBlockSectionItem id="dsa" > |
| | | <!-- Update 20220318 By Yang Kaiyu End --> |
| | | <apex:pageBlockSectionItem > |
| | | <apex:outputLabel value="收件人详细地址" for="direct_shippment_address__c"/> |
| | | <!-- Update 20220318 By Yang Kaiyu Start --> |
| | | <apex:inputField value="{!la.direct_shippment_address__c}" id="direct_shippment_address__c"/><!--pi--> |
| | | <!-- Update 20220318 By Yang Kaiyu End --> |
| | | <apex:inputField value="{!la.direct_shippment_address__c}" id="direct_shippment_address__c"/> |
| | | </apex:pageBlockSectionItem> |
| | | <apex:pageBlockSectionItem > |
| | | |
| | | </apex:pageBlockSectionItem> |
| | | <!-- Update 20220318 By Yang Kaiyu Start --> |
| | | <apex:pageBlockSectionItem id="lrsp" > |
| | | <!-- Update 20220318 By Yang Kaiyu End --> |
| | | <apex:pageBlockSectionItem > |
| | | <apex:outputLabel value="收件人电话" for="Loaner_receive_staff_phone__c"/> |
| | | <!-- Update 20220318 By Yang Kaiyu Start --> |
| | | <apex:inputField value="{!la.Loaner_receive_staff_phone__c}" id="Loaner_receive_staff_phone__c"/><!--pi--> |
| | | <!-- Update 20220318 By Yang Kaiyu Emd --> |
| | | <apex:inputField value="{!la.Loaner_receive_staff_phone__c}" id="Loaner_receive_staff_phone__c"/> |
| | | </apex:pageBlockSectionItem> |
| | | <apex:pageBlockSectionItem > |
| | | |
| | | </apex:pageBlockSectionItem> |
| | | <!-- Update 20220318 By Yang Kaiyu Start --> |
| | | <apex:pageBlockSectionItem id="pc" > |
| | | <!-- Update 20220318 By Yang Kaiyu End --> |
| | | <apex:pageBlockSectionItem > |
| | | <apex:outputLabel value="邮编" for="Post_Code__c"/> |
| | | <!-- Update 20220318 By Yang Kaiyu Start --> |
| | | <apex:inputField value="{!la.Post_Code__c}" id="Post_Code__c"/><!--pi--> |
| | | <!-- Update 20220318 By Yang Kaiyu End --> |
| | | </apex:pageBlockSectionItem> |
| | | <apex:inputField value="{!la.Post_Code__c}" id="Post_Code__c"/> |
| | | </apex:pageBlockSectionItem> |
| | | </apex:pageBlockSection> |
| | | <!-- Update 20220318 By Yang Kaiyu Start --> |
| | | <apex:inputHidden id="AWS_Data_Id__c" value="{!la.AWS_Data_Id__c}"/> |
| | | <apex:inputHidden id="Loaner_Ser_Encrypted__c" value="{!la.Loaner_Ser_Encrypted__c}"/> |
| | | <apex:inputHidden id="Pos_Code_Encrypted__c" value="{!la.Pos_Code_Encrypted__c}"/> |
| | | <apex:inputHidden id="direct_shippment_address_Encrypted__c" value="{!la.direct_shippment_address_Encrypted__c}"/> |
| | | <apex:inputHidden id="Loaner_receive_staff_phone_Encrypted__c" value="{!la.Loaner_receive_staff_phone_Encrypted__c}"/> |
| | | <input id="page:mainfrom:idSearchSetProduct:Loaner_receive_staff_Encrypted__c" type="hidden" name="page:mainfrom:idSearchSetProduct:Loaner_receive_staff_Encrypted__c" value="{!la.Loaner_receive_staff_Encrypted__c}"/> |
| | | |
| | | <apex:inputHidden id="Contact__c" value="{!lu.Contact__c}"/> |
| | | <!-- <apex:inputHidden id="lu_AWS_Data_Id__c" value="{!lu.AWS_Data_Id__c}"/> --> |
| | | <apex:inputHidden id="ContactNumber__c" value="{!lu.ContactNumber__c}"/> |
| | | <apex:inputHidden id="ContactNumber_Encrypted__c" value="{!lu.ContactNumber_Encrypted__c}"/> |
| | | <!-- <input id="page:mainfrom:idSearchSetProduct:Contact__c" type="hidden" name="page:mainfrom:idSearchSetProduct:Contact__c" value="{!lu.Contact__c}"/> --> |
| | | <input id="page:mainfrom:idSearchSetProduct:lu_AWS_Data_Id__c" type="hidden" name="page:mainfrom:idSearchSetProduct:lu_AWS_Data_Id__c" value="{!lu.AWS_Data_Id__c}"/> |
| | | <!-- <input id="page:mainfrom:idSearchSetProduct:ContactNumber__c" type="hidden" name="page:mainfrom:idSearchSetProduct:ContactNumber__c" value="{!lu.ContactNumber__c}"/> --> |
| | | <!-- <input id="page:mainfrom:idSearchSetProduct:ContactNumber_Encrypted__c" type="hidden" name="page:mainfrom:idSearchSetProduct:ContactNumber_Encrypted__c" value="{!lu.ContactNumber_Encrypted__c}"/> --> |
| | | |
| | | <apex:inputHidden id="con_AWS_Data_Id__c" value="{!con.AWS_Data_Id__c}"/> |
| | | <apex:inputHidden id="con_id" value="{!con.id}"/> |
| | | <!-- Update 20220318 By Yang Kaiyu End --> |
| | | <apex:pageBlockSection title="备注" > |
| | | <apex:pageBlockSectionItem > |
| | | <apex:outputLabel value="备注" for="loaner_Remark__c"/> |
| | |
| | | <apex:inputField value="{!la.DealerOrder_From__c}" id="DealerOrder_From__c"/> |
| | | </apex:pageBlockSectionItem> |
| | | </apex:pageBlockSection> |
| | | <!-- Update 20220318 By Yang Kaiyu Start --> |
| | | <!-- <apex:inputHidden id="Loaner_receive_staff_Encrypted__c" value="{!la.Loaner_receive_staff_Encrypted__c}"/> --> |
| | | <!-- Update 20220318 By Yang Kaiyu End --> |
| | | |
| | | |
| | | |
| | | |
| | |
| | | <apex:page standardController="loaner_user__c" extensions="NewLoanerUserController" id="allPage" showHeader="true" sidebar="false" action="{!init}" title="新建样机借用客户"> |
| | | <!-- <apex:page standardController="loaner_user__c" extensions="NewLoanerUserController" showHeader="true" sidebar="false" action="{!init}" title="新建样机借用客户"> --> |
| | | <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/> |
| | | <!-- Update 20220317 By Yang Kaiyu Start --> |
| | | <apex:includeScript value="{!URLFOR($Resource.CommonUtilJs)}"/> |
| | | <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" /> |
| | | <apex:includeScript value="/soap/ajax/40.0/connection.js"/> |
| | | <script src="../../soap/ajax/53.0/connection.js" type="text/javascript"></script> |
| | | <!-- Update 20220317 By Yang Kaiyu End --> |
| | | <script> |
| | | // Update 20220317 By Yang Kaiyu Start |
| | | AWSService.sfSessionId = '{!GETSESSIONID()}'; |
| | | var staticResource = JSON.parse('{!staticResource}'); |
| | | var staticResourceContact = JSON.parse('{!staticResourceContact}'); |
| | | var aws_data = {}; |
| | | let conList = []; |
| | | //替换vlookup |
| | | var closeField = ''; |
| | | var newSearchContactWindow = null; |
| | | var contactInfoStr = ''; |
| | | var conValue = '' |
| | | //自定义lookup查询 |
| | | function searchContact(contactNodeId,field,conValue,conid){ |
| | | closeField = conid; |
| | | this.conValue = conValue; |
| | | let accountValue = ""; |
| | | if (document.getElementById(field)!=null) { |
| | | accountValue = document.getElementById(field).value; |
| | | } |
| | | console.log(accountValue); |
| | | if(accountValue !='000000000000000'){ |
| | | let baseUrl = "/apex/SearchContactPage"; |
| | | let searchContactKeyWord = document.getElementById(conid).value; |
| | | let suffixUrl = "?contactId="+contactNodeId+"&accountId="+accountValue+"&searchContactKeyWord=" + searchContactKeyWord; |
| | | let newSearchContactParam = 'height=600,width=800,left=100,top=100,dialogHide=true,resizable=no,scrollbars=yes,toolbar=no,status=no'; |
| | | newSearchContactWindow = window.open(baseUrl+suffixUrl, 'Popup', newSearchContactParam); |
| | | if (window.focus) { |
| | | newSearchContactWindow.focus(); |
| | | } |
| | | return false; |
| | | }else{ |
| | | alert('请先选择客户再选择联系人') |
| | | } |
| | | } |
| | | var dataLinesJson; |
| | | function replaceSearchContactLookup() { |
| | | conList = JSON.parse('{!conListJson}'); |
| | | dataLinesJson = JSON.parse('{!dataLinesJson}'); |
| | | console.log('dataLinesJson = ' + dataLinesJson); |
| | | for(var i = 0;i<dataLinesJson.length;i++){ |
| | | let ii = i; |
| | | document.getElementById('allPage:allForm:allBlock:lines:'+ii+':contact').addEventListener('click',function(){ |
| | | searchContact('allPage:allForm:contactId','allPage:allForm:allBlock:lines:'+ii+':customer_lkid','allPage:allForm:allBlock:lines:'+ii+':contactId_Hidden','allPage:allForm:allBlock:lines:'+ii+':contact'); |
| | | }); |
| | | } |
| | | |
| | | |
| | | } |
| | | function htmlToElement(html) { |
| | | var template = document.createElement('template'); |
| | | html = html.trim(); // Never return a text node of whitespace as the result |
| | | template.innerHTML = html; |
| | | return template.content.firstChild; |
| | | } |
| | | function closePopupWindow() { |
| | | if (null != newSearchContactWindow) { |
| | | newSearchContactWindow.close(); |
| | | } |
| | | contactInfoStr = document.getElementById('allPage:allForm:contactId').value; |
| | | console.log('closePopup:'+contactInfoStr); |
| | | let contactInfo = JSON.parse(contactInfoStr); |
| | | let contactNodeId = conValue; |
| | | document.getElementById(contactNodeId).value = contactInfo.ContactId; |
| | | document.getElementById(closeField).value = contactInfo.Name; |
| | | } |
| | | function DecryptAll(){ |
| | | let dataIds = []; |
| | | |
| | | //"{!conList}".each((i,e)=>{ |
| | | // console.log('------------------') |
| | | // console.log(e); |
| | | // let v = "{!conList}"[i].contactIdValue; |
| | | // if (v) { |
| | | // dataIds.push(v); |
| | | // } |
| | | //}); |
| | | conList = JSON.parse('{!conListJson}'); |
| | | if(conList){ |
| | | for(var i=0 ;i<conList.length;i++){ |
| | | if(conList[i]!=null){ |
| | | let v = conList[i].contactIdValue; |
| | | if (v) { |
| | | dataIds.push(v); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | Decrypt(dataIds); |
| | | } |
| | | j$(function(){ |
| | | DecryptAll(); |
| | | |
| | | }) |
| | | function Decrypt(dataIds){ |
| | | let Foo = function(){ |
| | | for (const id in dataIds) { |
| | | if (aws_data.hasOwnProperty(dataIds[id])) { |
| | | let d = aws_data[dataIds[id]]; |
| | | let $e =j$("[aws-id='"+d.dataId+ "']"); |
| | | //$e.html(d[$e.attr("aws-id")]); |
| | | $e.each(function(i,e){ |
| | | j$(e).val(d.lastName); |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | let ids = []; |
| | | //for (const id in dataIds) { |
| | | // if (!aws_data.hasOwnProperty(id)) { |
| | | // ids.push(id); |
| | | // } |
| | | //} |
| | | for(var i =0 ;i<dataIds.length;i++){ |
| | | if (!aws_data.hasOwnProperty(dataIds[i])) { |
| | | ids.push(dataIds[i]); |
| | | } |
| | | } |
| | | if (ids.length > 0) { |
| | | blockme(); |
| | | AWSService.search(staticResourceContact.searchUrl, |
| | | JSON.stringify({ |
| | | "dataIds":ids |
| | | }), |
| | | function(data){ |
| | | unblockUI(); |
| | | if(data.object && data.object.length > 0){ |
| | | |
| | | for(let d in data.object){ |
| | | console.log('----------------') |
| | | console.log(d); |
| | | if(data.object[d].dataId){ |
| | | aws_data[data.object[d].dataId] = data.object[d]; |
| | | } |
| | | } |
| | | Foo(); |
| | | } |
| | | }, |
| | | staticResourceContact.token); |
| | | }else{ |
| | | Foo(); |
| | | } |
| | | } |
| | | // Update 20220317 By Yang Kaiyu End |
| | | function saveJs() { |
| | | if(confirm('联系人和客户为必填信息,如果为空将不保存此条记录,是否已确认所有需要保存的信息该字段都不为空?')){ |
| | | blockme(); |
| | | updateUser(); |
| | | } |
| | | <apex:page standardController="loaner_user__c" extensions="NewLoanerUserController" showHeader="true" sidebar="false" action="{!init}" title="新建样机借用客户"> |
| | | <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/> |
| | | <script> |
| | | |
| | | function saveJs() { |
| | | if(confirm('联系人和客户为必填信息,如果为空将不保存此条记录,是否已确认所有需要保存的信息该字段都不为空?')){ |
| | | blockme(); |
| | | updateUser(); |
| | | } |
| | | </script> |
| | | } |
| | | </script> |
| | | |
| | | |
| | | |
| | | <style type="text/css"> |
| | | .dateFormat{ |
| | | display: none; |
| | | } |
| | | </style> |
| | | <style type="text/css"> |
| | | .dateFormat{ |
| | | display: none; |
| | | } |
| | | </style> |
| | | |
| | | <apex:form id="allForm"> |
| | | <!-- Update 20220317 By Yang Kaiyu Start --> |
| | | <apex:inputHidden value="{!contactId}" id="contactId" /> |
| | | <!-- Update 20220317 By Yang Kaiyu End --> |
| | | <apex:actionFunction name="updateUser" action="{!updateUser}" rerender="allForm,message,allPanel" onComplete="unblockUI();"></apex:actionFunction> |
| | | <apex:outputPanel id="message"> |
| | | <apex:messages /> |
| | |
| | | <div style="overflow: scroll;height: 300px;width: 1260px; "> |
| | | <apex:variable value="{!1}" var="cnt" /> |
| | | <apex:repeat value="{!dataLines}" var="line" id="lines"> |
| | | <div style="width: 1260px;"> |
| | | {!$ObjectType.loaner_user__c.fields.Customer__c.label}: |
| | | <!-- Update 20220317 By Yang Kaiyu Start --> |
| | | <apex:inputField id="customer" value="{!line.Customer__c}" /> |
| | | <!-- Update 20220317 By Yang Kaiyu End --> |
| | | <div style="width: 1260px;"> |
| | | {!$ObjectType.loaner_user__c.fields.Customer__c.label}: |
| | | <apex:inputField value="{!line.Customer__c}" /> |
| | | {!$ObjectType.loaner_user__c.fields.Contact__c.label}: |
| | | <!-- Update 20220317 By Yang Kaiyu Start --> |
| | | <!-- <apex:inputField id="contact" value="{!line.Contact__c}" html-aws-id="{!line.Contact__r.AWS_Data_Id__c}" /> --> |
| | | <apex:inputText id="contact" html-aws-id="{!line.Contact__r.AWS_Data_Id__c}" disabled="false" value="{!line.Contact__r.LastName}" ></apex:inputText> |
| | | <apex:inputText id="contactId_Hidden" value="{!line.Contact__c}" style="display:none"/> |
| | | <!-- Update 20220317 By Yang Kaiyu End --> |
| | | |
| | | <apex:inputField value="{!line.Contact__c}" /> |
| | | {!$ObjectType.loaner_user__c.fields.FromThePeriod__c.label}: |
| | | <apex:inputField value="{!line.FromThePeriod__c}"/> |
| | | {!$ObjectType.loaner_user__c.fields.EndThePeriod__c.label}: |
| | | <apex:inputField value="{!line.EndThePeriod__c}"/> |
| | | {!$ObjectType.loaner_user__c.fields.Follow_UP_Opp__c.label}: |
| | | <apex:inputField value="{!line.Follow_UP_Opp__c}"/> |
| | | {!$ObjectType.loaner_user__c.fields.Follow_UP_Opp__c.label}: |
| | | <apex:inputField value="{!line.Follow_UP_Opp__c}"/> |
| | | {!$ObjectType.loaner_user__c.fields.Remarks__c.label}: |
| | | <apex:inputField value="{!line.Remarks__c}"/> |
| | | |
| | | <apex:variable value="{!cnt + 1}" var="cnt" /> |
| | | </div> |
| | | </apex:repeat> |
| | | <!-- Update 20220317 By Yang Kaiyu Start --> |
| | | <script> |
| | | sfdcPage.appendToOnloadQueue(function () { |
| | | //Replace Vlookup Field |
| | | |
| | | replaceSearchContactLookup(); |
| | | }) |
| | | </script> |
| | | <!-- Update 20220317 By Yang Kaiyu End --> |
| | | </div> |
| | | |
| | | </apex:pageBlock> |
| | |
| | | <apex:page id="Page" Controller="NewOpportunityController" sidebar="true" showHeader="true" action="{!init}"> |
| | | <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" /> |
| | | <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/> |
| | | |
| | | <script> |
| | | var staticResource = JSON.parse('{!staticResource}'); |
| | | var txId = ''; |
| | | // var DealerSalesStaffNameId = 'Page:mainForm:idSearchSetProduct:j_id53:j_id56:opp_DealerSalesStaffName'; |
| | | // var DealerServiceId = 'Page:mainForm:idSearchSetProduct:j_id53:j_id62:opp_DealerService'; |
| | | var DealerSalesStaffNameId = 'PIAPIBACK_opp_DealerSalesStaffName'; |
| | | var DealerServiceId = 'PIAPIBACK_opp_DealerService'; |
| | | var opportunityAWSDataId = 'Page:mainForm:idSearchSetProduct:j_id55:opportunityAWSDataId'; |
| | | function getPIData(){ |
| | | let opportunityPayloadList = []; |
| | | let opportunityPIData = new Object(); |
| | | |
| | | if(document.getElementsByClassName(DealerSalesStaffNameId)[0]){ |
| | | opportunityPIData.dealerSalesStaffName = document.getElementsByClassName(DealerSalesStaffNameId)[0].value |
| | | } |
| | | if(document.getElementsByClassName(DealerServiceId)[0]){ |
| | | opportunityPIData.dealerService = document.getElementsByClassName(DealerServiceId)[0].value |
| | | } |
| | | opportunityPayloadList.push(opportunityPIData); |
| | | return JSON.stringify(opportunityPayloadList); |
| | | } |
| | | function saveJs() { |
| | | blockme(); |
| | | new Promise(function(resolve,reject){ |
| | | //加密 |
| | | let queryPostBack = function(data){ |
| | | if(document.getElementsByClassName(DealerSalesStaffNameId)[0]){ |
| | | document.getElementsByClassName(DealerSalesStaffNameId)[0].value = data.object[0].dealerSalesStaffName; |
| | | } |
| | | if(document.getElementsByClassName(DealerServiceId)[0]){ |
| | | document.getElementsByClassName(DealerServiceId)[0].value = data.object[0].dealerService; |
| | | } |
| | | if(document.getElementById(opportunityAWSDataId)){ |
| | | document.getElementById(opportunityAWSDataId).value = data.object[0].dataId; |
| | | } |
| | | txId = data.txId; |
| | | resolve('success'); |
| | | }; |
| | | AWSService.post(staticResource.newUrl,getPIData(),queryPostBack,staticResource.token); |
| | | }).then(function(data){ |
| | | saveBtn(); |
| | | Trans(); |
| | | }) |
| | | } |
| | | //aws 确认 |
| | | function Trans(){ |
| | | let b = HasError(); |
| | | if(b){ |
| | | //清空代理商销售担当者名 |
| | | if(document.getElementsByClassName(DealerSalesStaffNameId)[0]){ |
| | | document.getElementsByClassName(DealerSalesStaffNameId)[0].value='' |
| | | } |
| | | if(document.getElementsByClassName(DealerServiceId)[0]){ |
| | | document.getElementsByClassName(DealerServiceId)[0].value='' |
| | | } |
| | | } |
| | | AWSService.post(staticResource.transactionUrl, JSON.stringify({ |
| | | "txId":txId, |
| | | "isSuccess":b ? 0 : 1 |
| | | }), function(result){ |
| | | console.log('Trans result = '+ JSON.stringify(result)); |
| | | }, staticResource.token); |
| | | } |
| | | function HasError(){ |
| | | let e = document.getElementById("Page:mainForm:message"); |
| | | return e.children[0]!=null; |
| | | saveBtn(); |
| | | } |
| | | |
| | | function saveYesJs() { |
| | |
| | | <apex:outputLabel value="COMPO询价" for="compo_opp"/> |
| | | <apex:inputField value="{!opp.compo_opp__c}" id="compo_opp"/> |
| | | </apex:pageBlockSectionItem> |
| | | <apex:pageBlockSectionItem rendered="{!IF(ProductSegment == 'BS', true, false)}"> |
| | | <!-- <apex:pageBlockSectionItem rendered="{!IF(ProductSegment == 'BS', true, false)}"> |
| | | <apex:outputLabel value="用途" for="useing"/> |
| | | <apex:inputField value="{!opp.useing__c}" id="useing"/> |
| | | </apex:pageBlockSectionItem> |
| | | </apex:pageBlockSectionItem> --> |
| | | </apex:pageBlockSection> |
| | | |
| | | <apex:pageBlockSection title="结果信息" columns="2"> |
| | |
| | | |
| | | <apex:pageBlockSectionItem rendered="{!IF(ProductSegment == 'NDT' || ProductSegment == 'ANI', false, true)}"> |
| | | <apex:outputLabel value="代理商销售担当者名" for="opp_DealerSalesStaffName"/> |
| | | <apex:inputField value="{!opp.DealerSalesStaffName__c}" id="opp_DealerSalesStaffName" styleClass="PIAPIBACK_opp_DealerSalesStaffName"/> |
| | | <apex:inputField value="{!opp.DealerSalesStaffName__c}" id="opp_DealerSalesStaffName"/> |
| | | </apex:pageBlockSectionItem> |
| | | |
| | | <apex:pageBlockSectionItem rendered="{!IF(ProductSegment == 'NDT' || ProductSegment == 'ANI', true, false)}"> |
| | | <apex:outputLabel value="代理商销售担当者名" for="opp_DealerSalesStaffName"/> |
| | | <apex:inputField value="{!opp.DealerSalesStaffName__c}" id="opp_DealerSalesStaffName" styleClass="PIAPIBACK_opp_DealerSalesStaffName" required="true"/> |
| | | <apex:inputField value="{!opp.DealerSalesStaffName__c}" id="opp_DealerSalesStaffName" required="true"/> |
| | | </apex:pageBlockSectionItem> |
| | | |
| | | <apex:pageBlockSectionItem > |
| | |
| | | </apex:pageBlockSectionItem> |
| | | <apex:pageBlockSectionItem > |
| | | <apex:outputLabel value="代理商服务担当者名" for="opp_DealerService"/> |
| | | <apex:inputField value="{!opp.DealerService__c}" id="opp_DealerService" styleClass="PIAPIBACK_opp_DealerService"/> |
| | | <apex:inputField value="{!opp.DealerService__c}" id="opp_DealerService"/> |
| | | </apex:pageBlockSectionItem> |
| | | <apex:inputHidden id="opportunityAWSDataId" value="{!opp.AWS_Data_Id__c}"/> |
| | | </apex:pageBlockSection> |
| | | |
| | | <apex:pageBlockSection title="竞争者信息" columns="2"> |
| | |
| | | <!-- <apex:outputPanel layout="none" rendered="{!IF(ProductSegment == 'NDT' || ProductSegment == 'ANI', false, true)}"> --> |
| | | <apex:pageBlockSectionItem rendered="{!IF(ProductSegment == 'NDT' || ProductSegment == 'ANI', false, true)}"> |
| | | <apex:outputLabel value="代理商销售担当者名." for="opp_DealerSalesStaffName"/> |
| | | <apex:inputField value="{!opp.Dealer_Sales_Staff_Name_D__c}" id="opp_DealerSalesStaffName" styleClass="PIAPIBACK_opp_DealerSalesStaffName"/> |
| | | <apex:inputField value="{!opp.Dealer_Sales_Staff_Name_D__c}" id="opp_DealerSalesStaffName"/> |
| | | </apex:pageBlockSectionItem> |
| | | <!-- </apex:outputPanel> --> |
| | | <!-- <apex:outputPanel rendered="{!IF(ProductSegment == 'NDT' || ProductSegment == 'ANI', true, false)}" layout="inline"> --> |
| | | <apex:pageBlockSectionItem rendered="{!IF(ProductSegment == 'NDT' || ProductSegment == 'ANI', true, false)}"> |
| | | <apex:outputLabel value="代理商销售担当者名." for="opp_DealerSalesStaffName"/> |
| | | <apex:inputField value="{!opp.Dealer_Sales_Staff_Name_D__c}" id="opp_DealerSalesStaffName" required="true" styleClass="PIAPIBACK_opp_DealerSalesStaffName"/> |
| | | <apex:inputField value="{!opp.Dealer_Sales_Staff_Name_D__c}" id="opp_DealerSalesStaffName" required="true"/> |
| | | </apex:pageBlockSectionItem> |
| | | <!-- </apex:outputPanel> --> |
| | | <apex:pageBlockSectionItem > |
| | |
| | | </apex:pageBlockSectionItem> |
| | | <apex:pageBlockSectionItem > |
| | | <apex:outputLabel value="代理商服务担当者名." for="opp_DealerService"/> |
| | | <apex:inputField value="{!opp.Dealer_Service_D__c}" id="opp_DealerService" styleClass="PIAPIBACK_opp_DealerService"/> |
| | | <apex:inputField value="{!opp.Dealer_Service_D__c}" id="opp_DealerService"/> |
| | | </apex:pageBlockSectionItem> |
| | | <apex:inputHidden id="opportunityAWSDataId" value="{!opp.AWS_Data_Id__c}"/> |
| | | </apex:pageBlockSection> |
| | | |
| | | <apex:pageBlockSection title="竞争者信息" columns="2"> |
| | |
| | | var changedAfterPrint = false; |
| | | var changedAfterBid = false; |
| | | |
| | | |
| | | if (changedAfterBid == 'true') { |
| | | if (confirm(Confirm_ChangedAfterBid)) { |
| | | blockme(); |
| | |
| | | <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/> |
| | | <style> |
| | | .pbSubheader { |
| | | background: #BFB19C!important; |
| | | /*background-color: #FFFFFF!important;*/ |
| | | /*background: #BFB19C;*/ |
| | | /*background-color: #44A3BB!important; |
| | | background-color: #E6E6FA!important;*/ |
| | | /*background-color: #1797c0!important;*/ |
| | | background-color: #DFE6F0!important; |
| | | /*color:#607799;*/ |
| | | /*color:#FFFFFF!important;*/ |
| | | /*background-color: #FFFFFF!important;*/ |
| | | /*font-size:12pt; |
| | | font-family:verdana;*/ |
| | | font-weight:bold; |
| | | } |
| | | </style> |
| | | <script> |
| | | //var isReturn = true; |
| | | function returnSWOPage(){ |
| | |
| | | } |
| | | blockme(); |
| | | deleteAction(); |
| | | |
| | | } |
| | | } |
| | | function toSearchProduct(){ |
| | | var baseUrl = j$(escapeVfId("baseUrl")).value(); |
| | | window.open(baseUrl + '/apex/NewSearchProductPage','_blank', 'width=500,height=300,scrollbars=yes,toolbar=no,status=no,directories=no,menubar=no,resizable=1', true); |
| | | } |
| | | function searchProduct(){ |
| | | var baseUrl = '{!baseUrl}'; |
| | | |
| | | openPopup(baseUrl + '/apex/NewSearchProductPage', 'setsearch', 950, 450, 'width=500,height=300,scrollbars=yes,toolbar=no,status=no,directories=no,menubar=no,resizable=1', true); |
| | | } |
| | | function productReturnJS(id,code,eccode,description){ |
| | | j$(escapeVfId("Product")).val(id); |
| | | j$(escapeVfId("Page:formInfo:RepairPartInfo:j_id42:j_id46:ITEM")).val(code); |
| | | j$(escapeVfId("PART_NUMBER")).val(eccode); |
| | | j$(escapeVfId("DESCRIPTION")).val(description); |
| | | } |
| | | |
| | | function setProduct(){ |
| | | blockme(); |
| | | var productId = j$(escapeVfId("Page:formInfo:RepairPartInfo:j_id39:j_id43:Product")).val(); |
| | | productReturn(productId); |
| | | } |
| | | |
| | | </script> |
| | | |
| | | <style type="text/css"> |
| | | .pbSubheader { |
| | | background: #BFB19C!important; |
| | | /*background-color: #FFFFFF!important;*/ |
| | | /*background: #BFB19C;*/ |
| | | /*background-color: #44A3BB!important; |
| | | background-color: #E6E6FA!important;*/ |
| | | /*background-color: #1797c0!important;*/ |
| | | background-color: #DFE6F0!important; |
| | | /*color:#607799;*/ |
| | | /*color:#FFFFFF!important;*/ |
| | | /*background-color: #FFFFFF!important;*/ |
| | | /*font-size:12pt; |
| | | font-family:verdana;*/ |
| | | font-weight:bold; |
| | | |
| | | } |
| | | </style> |
| | | <apex:form id="formInfo"> |
| | | <apex:outputPanel id="message"> |
| | | <apex:pagemessages /> |
| | | </apex:outputPanel> |
| | | <apex:actionFunction name="save" action="{!save}" oncomplete="returnSWOPage();unblockUI();" reRender="formInfo,message"/> |
| | | <apex:actionFunction name="deleteAction" action="{!deleteAction}" oncomplete="returnSWOPage();unblockUI();" reRender="formInfo,message"/> |
| | | <apex:actionFunction name="productReturn" action="{!productReturn}" oncomplete="unblockUI();" reRender="formInfo"> |
| | | <apex:param name="productId" value="{!productId}" /> |
| | | </apex:actionFunction> |
| | | <input type="hidden" id="repairPartId" value="{!repairId}" /> |
| | | <input type="hidden" id="pageClose" value="{!pageClose}" /> |
| | | <input type="hidden" id="swoId" value="{!repairPart.SWO_ID__c}" /> |
| | | <input type="hidden" id="id" value="{!repairPart.Id}" /> |
| | | <input type="hidden" id="baseUrl" value="{!baseUrl}" /> |
| | | <input type="hidden" id="Product" value="{!repairPart.Product__c}" /> |
| | | <input type="hidden" id="PART_NUMBER" value="{!repairPart.PART_NUMBER__c}" /> |
| | | <input type="hidden" id="DESCRIPTION" value="{!repairPart.DESCRIPTION__c}" /> |
| | | <apex:pageBlock id="RepairPartInfo" title="RepairPart"> |
| | | <apex:pageBlockButtons location="top"> |
| | | <apex:commandButton onclick="saveJS()" value="Save" oncomplete="returnSWOPage();" reRender="formInfo,messageInfo" style="width: 10%"> |
| | | |
| | | </apex:commandButton> |
| | | |
| | | <apex:commandButton onclick="closePage();" value="Cancel" style="width: 10%"> |
| | | <apex:commandButton onclick="closePage()" value="Cancel" style="width: 10%"> |
| | | |
| | | </apex:commandButton> |
| | | <!-- onclick="deleteJS();" --> |
| | |
| | | <apex:outputField value="{!repairPart.SWO_ID__c}" id="SWO_ID" /> |
| | | </apex:pageBlockSectionItem> |
| | | |
| | | <!-- <apex:pageBlockSectionItem > |
| | | <apex:pageBlockSectionItem > |
| | | <apex:outputLabel value="{!$ObjectType.RepairPart__c.fields.Product__c.label}" for="ITEM"/> |
| | | <apex:inputField value="{!repairPart.Product__c}" id="ITEM" required="true"/> |
| | | </apex:pageBlockSectionItem> --> |
| | | |
| | | <apex:pageBlockSectionItem > |
| | | <apex:outputLabel value="{!$ObjectType.RepairPart__c.fields.Product__c.label}" for="Product"/> |
| | | <apex:inputField value="{!repairPart.Product__c}" id="Product" required="true" /> |
| | | </apex:pageBlockSectionItem> |
| | | |
| | | <apex:pageBlockSectionItem > |
| | | <apex:outputLabel value="{!$ObjectType.RepairPart__c.fields.ITEM_ProductCode__c.label}" for="ITEM"/> |
| | | <apex:inputField value="{!repairPart.ITEM_ProductCode__c}" id="ITEM"/> |
| | | </apex:pageBlockSectionItem> |
| | | |
| | | <apex:pageBlockSectionItem > |
| | | <apex:outputLabel value="{!$ObjectType.RepairPart__c.fields.PART_NUMBERNew__c.label}" for="PART_NUMBER"/> |
| | | <apex:inputField value="{!repairPart.PART_NUMBERNew__c}" id="PART_NUMBER"/> |
| | | </apex:pageBlockSectionItem> |
| | | |
| | | <apex:pageBlockSectionItem > |
| | | <apex:outputLabel value="{!$ObjectType.RepairPart__c.fields.DescriptionNew__c.label}" for="Description"/> |
| | | <apex:inputField value="{!repairPart.DescriptionNew__c}" id="Description"/> |
| | | </apex:pageBlockSectionItem> |
| | | |
| | | <apex:pageBlockSectionItem > |
| | |
| | | </apex:pageBlockSection> |
| | | </apex:pageBlock> |
| | | </apex:form> |
| | | |
| | | <!-- 选择产品弹出层部分 --> |
| | | |
| | | <!-- <div id="popBox"> |
| | | <div class="close"> |
| | | <a href="javascript:void(0)" onclick="closeBox()">关闭</a> |
| | | </div> |
| | | <div class="content"> |
| | | <table width="100%"> |
| | | <colgroup> |
| | | <col width="33%"></col> |
| | | <col width="33%"></col> |
| | | <col width="33%"></col> |
| | | </colgroup> |
| | | <tr> |
| | | <td> |
| | | <apex:selectList id="type" value="{!ConditionType}" size="1"> |
| | | <apex:selectOption itemLabel="产品名称" itemValue="name"></apex:selectOption> |
| | | <apex:selectOption itemLabel="产品代码" itemValue="code"></apex:selectOption> |
| | | <apex:selectOption itemLabel="EC代码" itemValue="eccode"></apex:selectOption> |
| | | </apex:selectList> |
| | | </td> |
| | | <td> |
| | | <apex:inputText value="{!ByCondition}"></apex:inputText> |
| | | </td> |
| | | <td> |
| | | <apex:commandButton action="{!doSearch}" onclick="blockme();" reRender="data" oncomplete="unblockUI();" value="查询"></apex:commandButton> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <th>产品名称</th> |
| | | <th>产品代码</th> |
| | | <th>EC代码</th> |
| | | </tr> |
| | | </table> |
| | | <div style="width: 100%;height: 100%;overflow:auto;"> |
| | | <table width="100%"> |
| | | <colgroup> |
| | | <col width="33%"></col> |
| | | <col width="33%"></col> |
| | | <col width="33%"></col> |
| | | </colgroup> |
| | | <apex:repeat value="{!dataList}" var="line" id="result"> |
| | | <tr> |
| | | <td><apex:outputLink value="javascript:void(0)" onclick="returnBefore('{!line.id}','{!line.code}','{!line.eccode}','{!line.description}')">{!line.name}</apex:outputLink></td> |
| | | <td><apex:outputLink value="javascript:void(0)" onclick="returnBefore('{!line.id}','{!line.code}','{!line.eccode}','{!line.description}')">{!line.code}</apex:outputLink></td> |
| | | <td><apex:outputLink value="javascript:void(0)" onclick="returnBefore('{!line.id}','{!line.code}','{!line.eccode}','{!line.description}')">{!line.eccode}</apex:outputLink></td> |
| | | </tr> |
| | | </apex:repeat> |
| | | </table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div id="popLayer"> |
| | | </div> --> |
| | | </apex:page> |
| | |
| | | <apex:page id="Page" Controller="NewReplacementOpportunityController" sidebar="true" showHeader="true" action="{!init}"> |
| | | <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" /> |
| | | <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/> |
| | | |
| | | <script> |
| | | var staticResource = JSON.parse('{!staticResource}'); |
| | | var txId = ''; |
| | | function getPIData(){ |
| | | let opportunityPayloadList = []; |
| | | let opportunityPIData = new Object(); |
| | | opportunityPIData.dealerSalesStaffName = document.getElementById('Page:mainForm:idSearchSetProduct:j_id35:j_id38:opp_DealerSalesStaffName').value |
| | | opportunityPayloadList.push(opportunityPIData); |
| | | return JSON.stringify(opportunityPayloadList); |
| | | } |
| | | function saveJs() { |
| | | blockme(); |
| | | new Promise(function(resolve,reject){ |
| | | //加密 |
| | | let queryPostBack = function(data){ |
| | | document.getElementById('Page:mainForm:idSearchSetProduct:j_id35:j_id38:opp_DealerSalesStaffName').value = data.object[0].dealerSalesStaffName; |
| | | document.getElementById('Page:mainForm:idSearchSetProduct:j_id35:opportunityAWSDataId').value = data.object[0].dataId; |
| | | txId = data.txId; |
| | | resolve('success'); |
| | | }; |
| | | AWSService.post(staticResource.newUrl,getPIData(),queryPostBack,staticResource.token); |
| | | }).then(function(data){ |
| | | saveBtn(); |
| | | Trans(); |
| | | }) |
| | | } |
| | | |
| | | //aws 确认 |
| | | function Trans(){ |
| | | let b = HasError(); |
| | | if(b){ |
| | | //清空代理商销售担当者名 |
| | | document.getElementById('Page:mainForm:idSearchSetProduct:j_id35:j_id38:opp_DealerSalesStaffName').value='' |
| | | } |
| | | AWSService.post(staticResource.transactionUrl, JSON.stringify({ |
| | | "txId":txId, |
| | | "isSuccess":b ? 0 : 1 |
| | | }), function(result){ |
| | | console.log('Trans result = '+ JSON.stringify(result)); |
| | | }, staticResource.token); |
| | | } |
| | | |
| | | function HasError(){ |
| | | let e = document.getElementById("Page:mainForm:message"); |
| | | return e.children[0]!=null; |
| | | saveBtn(); |
| | | } |
| | | |
| | | function saveYesJs() { |
| | |
| | | </script> |
| | | |
| | | <apex:form id="mainForm"> |
| | | <apex:actionFunction action="{!saveBtn}" name="saveBtn" reRender="mainForm,message" oncomplete="Trans();unblockUI();"/> |
| | | <apex:actionFunction action="{!saveBtn}" name="saveBtn" reRender="mainForm,message" oncomplete="unblockUI();"/> |
| | | <apex:actionFunction action="{!saveBtnYes}" name="saveBtnYes" reRender="mainForm,message" oncomplete="unblockUI();"/> |
| | | <apex:actionFunction action="{!saveBtnNo}" name="saveBtnNo" reRender="mainForm,message" oncomplete="unblockUI();"/> |
| | | |
| | |
| | | <apex:outputLabel value="代理商销售担当者名" for="opp_DealerSalesStaffName"/> |
| | | <apex:inputField value="{!opp.DealerSalesStaffName__c}" id="opp_DealerSalesStaffName" required="true"/> |
| | | </apex:pageBlockSectionItem> |
| | | <apex:inputHidden id="opportunityAWSDataId" value="{!opp.AWS_Data_Id__c}"/> |
| | | </apex:pageBlockSection> |
| | | |
| | | </apex:pageBlock> |
| | |
| | | alert("同步的报价和最近上传的报价不一致,请上传当前同步的报价。"); |
| | | } |
| | | |
| | | |
| | | function getConnectDMLErrorMessages(results) { |
| | | var messages = [], |
| | | i = 0, |
| | |
| | | <td style="text-align:left;"><apex:outputText style="width:90%" id="productCode" value="{!info.productName}"></apex:outputText></td> |
| | | <td style="text-align:left;"><apex:outputText style="width:90%" id="productCode1" value="{!info.ProductCode}"></apex:outputText></td> |
| | | <td style="text-align:left;"><apex:outputText style="width:90%" id="ECCode" value="{!info.ECCode}"></apex:outputText></td> |
| | | |
| | | <apex:outputPanel rendered="{!AND(!specialDealer,!info.isSet)}" layout="none"> |
| | | <!-- <apex:outputPanel rendered="{!!specialDealer}" layout="none"> |
| | | <td style="text-align:right;"><apex:outputField style="width:90%" id="unitPrice" value="{!info.oi.UnitPrice}"></apex:outputField></td> |
| | | </apex:outputPanel> |
| | | <td style="text-align:right;"><apex:outputField style="width:90%" id="quantity" value="{!info.oi.Quantity}"></apex:outputField></td> --> |
| | | <apex:outputPanel rendered="{!AND(!specialDealer,!info.isSet)}" layout="none"> |
| | | <td style="text-align:right;"><apex:outputField style="width:90%" id="unitPrice" value="{!info.oi.UnitPrice}"></apex:outputField></td> |
| | | </apex:outputPanel> |
| | | <apex:outputPanel rendered="{!AND(!specialDealer,info.isSet)}" layout="none"> |
| | |
| | | <apex:outputPanel rendered="{!info.isSet}" layout="none"> |
| | | <td style="text-align:right;"><apex:outputText style="width:90%" id="quantity1" value="{!info.dqps.DecideProductSetCount__c}.00"></apex:outputText></td> |
| | | </apex:outputPanel> |
| | | |
| | | <!-- <td style="text-align:right;"><apex:outputField style="width:90%" id="quantity" value="{!info.oi.Quantity}"></apex:outputField></td> --> |
| | | <td style="text-align:center;"><apex:inputText style="width:90%;text-align:right;" id="divideCnt" value="{!info.divideCnt}"></apex:inputText></td> |
| | | <td style="text-align:left;"><apex:outputField style="width:90%" id="description" value="{!info.oi.Description}"></apex:outputField></td> |
| | | </tr> |
| | |
| | | <apex:page Controller="OrderPdfController" showHeader="false" sidebar="false" id="allPage" action="{!init2}" > |
| | | <!-- <apex:page Controller="OrderPdfController" showHeader="false" sidebar="false" id="allPage" action="{!init2}" renderAs="pdf"> --> |
| | | <apex:page Controller="OrderPdfController" showHeader="false" sidebar="false" id="allPage" action="{!init2}" renderAs="pdf"> |
| | | <html> |
| | | <head> |
| | | <style> |
| | |
| | | </style> |
| | | </head> |
| | | <body style="font-family: Arial Unicode MS; page-break-inside: auto"> |
| | | <div id="pdf-wrapper"> |
| | | <div class="pdf-page"> |
| | | <table style="border-style:none;float: left;"> |
| | | <tr style="font-size: 8pt;"> |
| | | <td> |
| | | <div>合同号</div> |
| | | <div>Contract No</div> |
| | | <apex:outputPanel rendered="{!IF(Opp.ProductSegment__c = 'IE' || Opp.ProductSegment__c = 'RVI' || Opp.ProductSegment__c = 'BS' && Opp.TradeType__c = 'Taxation', 'true', 'false')}" |
| | | layout="none"> |
| | | <div>报备单号</div> |
| | | <div>代理商全称</div> |
| | | </apex:outputPanel> |
| | | </td> |
| | | <td> |
| | | <div>: </div> |
| | | <div>: </div> |
| | | <apex:outputPanel rendered="{!IF(Opp.ProductSegment__c = 'IE' || Opp.ProductSegment__c = 'RVI' || Opp.ProductSegment__c = 'BS' && Opp.TradeType__c = 'Taxation', 'true', 'false')}" |
| | | layout="none"> |
| | | <div>: </div> |
| | | <div>: </div> |
| | | </apex:outputPanel> |
| | | </td> |
| | | <td> |
| | | <div> {!contra.order.PDF_Order_No__c}</div> |
| | | <div> {!contra.order.PDF_Order_No__c}</div> |
| | | <apex:outputPanel rendered="{!IF(Opp.ProductSegment__c = 'IE' || Opp.ProductSegment__c = 'RVI' || Opp.ProductSegment__c = 'BS' && Opp.TradeType__c = 'Taxation', 'true', 'false')}" |
| | | layout="none"> |
| | | <div> {!contra.order.PDF_I_Report__c}</div> |
| | | <div> {!contra.order.Dealer__c}</div> |
| | | </apex:outputPanel> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | <table style="border-style:none; float:right"> |
| | | <tr style="font-size: 8pt;"> |
| | | <td> |
| | | <apex:outputPanel rendered="{!IF((Opp.ProductSegment__c = 'IE' || Opp.ProductSegment__c = 'RVI' || Opp.ProductSegment__c = 'BS'|| Opp.ProductSegment__c = 'NDT'|| Opp.ProductSegment__c = 'ANI' ) && Opp.TradeType__c = 'Tax Exemption', 'true', 'false')}" |
| | | layout="none"> |
| | | <div>签订日期</div> |
| | | <div>Signature Date</div> |
| | | </apex:outputPanel> |
| | | <apex:outputPanel rendered="{!IF(Opp.ProductSegment__c = 'BS' || Opp.ProductSegment__c = 'NDT' ||Opp.ProductSegment__c = 'ANI' && Opp.TradeType__c = 'Tax Exemption', 'true', 'false')}" |
| | | layout="none"> |
| | | <div>签订地点</div> |
| | | <div>Signature Place</div> |
| | | </apex:outputPanel> |
| | | </td> |
| | | <td> |
| | | <apex:outputPanel rendered="{!IF((Opp.ProductSegment__c = 'IE' || Opp.ProductSegment__c = 'RVI' || Opp.ProductSegment__c = 'BS'|| Opp.ProductSegment__c = 'NDT'|| Opp.ProductSegment__c = 'ANI' ) && Opp.TradeType__c = 'Tax Exemption', 'true', 'false')}" |
| | | layout="none"> |
| | | <div>: </div> |
| | | <div>: </div> |
| | | </apex:outputPanel> |
| | | <apex:outputPanel rendered="{!IF(Opp.ProductSegment__c = 'BS'|| Opp.ProductSegment__c = 'NDT' ||Opp.ProductSegment__c = 'ANI' && Opp.TradeType__c = 'Tax Exemption', 'true', 'false')}" |
| | | layout="none"> |
| | | <div>: </div> |
| | | <div>: </div> |
| | | </apex:outputPanel> |
| | | </td> |
| | | <td> |
| | | <apex:outputPanel rendered="{!IF((Opp.ProductSegment__c = 'IE' || Opp.ProductSegment__c = 'RVI' || Opp.ProductSegment__c = 'BS'|| Opp.ProductSegment__c = 'NDT'|| Opp.ProductSegment__c = 'ANI' ) && Opp.TradeType__c = 'Tax Exemption', 'true', 'false')}" |
| | | layout="none"> |
| | | <div> {!contra.SignatureDate}</div> |
| | | <div> {!contra.SignatureDates}</div> |
| | | </apex:outputPanel> |
| | | <apex:outputPanel rendered="{!IF(Opp.ProductSegment__c = 'BS' || Opp.ProductSegment__c = 'NDT' ||Opp.ProductSegment__c = 'ANI'&& Opp.TradeType__c = 'Tax Exemption', 'true', 'false')}" |
| | | layout="none"> |
| | | <div> {!contra.order.PDF_SignaturePlace__c}</div> |
| | | <div> {!contra.order.PDF_SignaturePlaces__c}</div> |
| | | </apex:outputPanel> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | <table width="100%" cellspacing="0" cellpadding="0"> |
| | | <colgroup> |
| | | <col width="25%" /> |
| | | <col width="25%" /> |
| | | <col width="25%" /> |
| | | <col width="25%" /> |
| | | </colgroup> |
| | | <tr> |
| | | <td colspan="4" height="5px"></td> |
| | | </tr> |
| | | <tr> |
| | | <td colspan="4" style="text-align: center;font-size: 14pt;">合同</td> |
| | | </tr> |
| | | <tr> |
| | | <td colspan="4" style="text-align: center;font-size: 12pt;">CONTRACT</td> |
| | | </tr> |
| | | |
| | | <tr> |
| | | <td style="font-size: 8pt;">买方: </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!specialDeliveryAddress.Name}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">THE BUYER: </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!specialDeliveryAddress.EnglishName__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">地址: </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!specialDeliveryAddress.Address1__c}</td> |
| | | </tr> |
| | | <apex:outputPanel rendered="{!IF(Opp.TradeType__c != 'Taxation', 'true', 'false')}" layout="none"> |
| | | <tr> |
| | | <td style="font-size: 8pt;">ADD: </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_B_Add__c}</td> |
| | | </tr> |
| | | <table style="border-style:none;"> |
| | | <tr style="font-size: 8pt;"> |
| | | <td> |
| | | <div>合同号</div> |
| | | <div>Contract No</div> |
| | | <apex:outputPanel rendered="{!IF(Opp.ProductSegment__c = 'IE' || Opp.ProductSegment__c = 'RVI' || Opp.ProductSegment__c = 'BS' && Opp.TradeType__c = 'Taxation', 'true', 'false')}" layout="none"> |
| | | <div>报备单号</div> |
| | | <div>代理商全称</div> |
| | | </apex:outputPanel> |
| | | <tr> |
| | | <td style="font-size: 8pt;">电话(Tel): </td> |
| | | <td colspan="3" style="font-size: 8pt;" id="Phone">{!specialDeliveryAddress.Phone}</td> |
| | | </tr> |
| | | <apex:outputPanel rendered="{!IF(Opp.TradeType__c != 'Taxation', 'true', 'false')}" layout="none"> |
| | | <tr> |
| | | <td style="font-size: 8pt;">传真(Fax): </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!specialDeliveryAddress.Fax}</td> |
| | | </tr> |
| | | </td> |
| | | <td> |
| | | <div>: </div> |
| | | <div>: </div> |
| | | <apex:outputPanel rendered="{!IF(Opp.ProductSegment__c = 'IE' || Opp.ProductSegment__c = 'RVI' || Opp.ProductSegment__c = 'BS' && Opp.TradeType__c = 'Taxation', 'true', 'false')}" layout="none"> |
| | | <div>: </div> |
| | | <div>: </div> |
| | | </apex:outputPanel> |
| | | <tr> |
| | | <td style="font-size: 8pt;">联系人: </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!specialDeliveryContact.Name}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">CONTACT PERSON: </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_B_contactperson__c}</td> |
| | | </tr> |
| | | |
| | | <apex:outputPanel rendered="{!IF((Opp.ProductSegment__c = 'IE' || Opp.ProductSegment__c = 'RVI'|| Opp.ProductSegment__c = 'NDT'|| Opp.ProductSegment__c = 'ANI' ) && Opp.TradeType__c = 'Tax Exemption', 'true', 'false')}" |
| | | layout="none"> |
| | | <tr> |
| | | <td style="font-size: 8pt;">E-Mail: </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!specialDeliveryContact.Email}</td> |
| | | </tr> |
| | | </td> |
| | | <td> |
| | | <div> {!contra.order.PDF_Order_No__c}</div> |
| | | <div> {!contra.order.PDF_Order_No__c}</div> |
| | | <apex:outputPanel rendered="{!IF(Opp.ProductSegment__c = 'IE' || Opp.ProductSegment__c = 'RVI' || Opp.ProductSegment__c = 'BS' && Opp.TradeType__c = 'Taxation', 'true', 'false')}" layout="none"> |
| | | <div> {!contra.order.PDF_I_Report__c}</div> |
| | | <div> {!contra.order.Dealer__c}</div> |
| | | </apex:outputPanel> |
| | | |
| | | <apex:outputPanel rendered="{!IF(Opp.ProductSegment__c = 'IE', 'true', 'false')}" layout="none"> |
| | | <tr> |
| | | <td style="font-size: 8pt;">用户属性: </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_B_Attri__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">用户产品: </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!contra.account.Sub_Use__c}</td> |
| | | </tr> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | <table style="border-style:none; top:0px; right:0px; position:absolute;"> |
| | | <tr style="font-size: 8pt;"> |
| | | <td> |
| | | <apex:outputPanel rendered="{!IF((Opp.ProductSegment__c = 'IE' || Opp.ProductSegment__c = 'RVI' || Opp.ProductSegment__c = 'BS'|| Opp.ProductSegment__c = 'NDT'|| Opp.ProductSegment__c = 'ANI' ) && Opp.TradeType__c = 'Tax Exemption', 'true', 'false')}" layout="none"> |
| | | <div>签订日期</div> |
| | | <div>Signature Date</div> |
| | | </apex:outputPanel> |
| | | |
| | | <apex:outputPanel rendered="{!IF(Opp.ProductSegment__c = 'RVI', 'true', 'false')}" layout="none"> |
| | | <tr> |
| | | <td style="font-size: 8pt;">市场: </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!contra.account.Sub_Use__c}</td> |
| | | </tr> |
| | | <apex:outputPanel rendered="{!IF(Opp.ProductSegment__c = 'BS' || Opp.ProductSegment__c = 'NDT' ||Opp.ProductSegment__c = 'ANI' && Opp.TradeType__c = 'Tax Exemption', 'true', 'false')}" layout="none"> |
| | | <div>签订地点</div> |
| | | <div>Signature Place</div> |
| | | </apex:outputPanel> |
| | | |
| | | <tr> |
| | | <td height="1px"> </td> |
| | | </tr> |
| | | |
| | | <apex:outputPanel rendered="{!IF((Opp.ProductSegment__c = 'BC' ) && Opp.TradeType__c = 'Tax Exemption', 'true', 'false')}" |
| | | layout="none"> |
| | | <tr> |
| | | <td style="font-size: 8pt;">卖方: </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_SELLER__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">THE SELLER: </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_THE_SELLER__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">地址: </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_S_Adds__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">ADD: </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_S_Address__c}</td> |
| | | </tr> |
| | | |
| | | </td> |
| | | <td> |
| | | <apex:outputPanel rendered="{!IF((Opp.ProductSegment__c = 'IE' || Opp.ProductSegment__c = 'RVI' || Opp.ProductSegment__c = 'BS'|| Opp.ProductSegment__c = 'NDT'|| Opp.ProductSegment__c = 'ANI' ) && Opp.TradeType__c = 'Tax Exemption', 'true', 'false')}" layout="none"> |
| | | <div>: </div> |
| | | <div>: </div> |
| | | </apex:outputPanel> |
| | | <apex:outputPanel rendered="{!IF((Opp.ProductSegment__c = 'IE' || Opp.ProductSegment__c = 'RVI' || Opp.ProductSegment__c = 'BS'|| Opp.ProductSegment__c = 'NDT'|| Opp.ProductSegment__c = 'ANI' ) &&Opp.TradeType__c = 'Taxation', 'true', 'false')}" |
| | | layout="none"> |
| | | <tr> |
| | | <td style="font-size: 8pt;">卖方: </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_SELLER__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">地址: </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_S_Adds__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">电话 (TEL): </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_S_TEL__c}</td> |
| | | </tr> |
| | | <apex:outputPanel rendered="{!IF(Opp.ProductSegment__c = 'BS'|| Opp.ProductSegment__c = 'NDT' ||Opp.ProductSegment__c = 'ANI' && Opp.TradeType__c = 'Tax Exemption', 'true', 'false')}" layout="none"> |
| | | <div>: </div> |
| | | <div>: </div> |
| | | </apex:outputPanel> |
| | | <apex:outputPanel rendered="{!IF((Opp.ProductSegment__c = 'IE' || Opp.ProductSegment__c = 'RVI' || Opp.ProductSegment__c = 'BS' || Opp.ProductSegment__c = 'NDT'|| Opp.ProductSegment__c = 'ANI')&& Opp.TradeType__c = 'Tax Exemption', 'true', 'false')}" |
| | | layout="none"> |
| | | <tr> |
| | | <td style="font-size: 8pt;">卖方: </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_SELLER__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">THE SELLER: </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_THE_SELLER__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">地址: </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_S_Adds__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">ADD: </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_S_Address__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">电话(Tel): </td> |
| | | <td colspan="3" style="font-size: 8pt;" id="PDF_S_TEL__c">{!contra.order.PDF_S_TEL__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">传真(FAX): </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_S_FAX__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">Bank Name: </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_S_Bank_Name__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">Branch: </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_S_Branch__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">Address: </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_S_Bank_Address__c}</td> |
| | | </tr> |
| | | <!-- <tr> |
| | | <td style="font-size: 8pt;">Address: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_S_Address__c}</td> |
| | | </tr> --> |
| | | <tr> |
| | | <td style="font-size: 8pt;">Account no: </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_S_Account_No__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">Swift code: </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_S_Swift_Code__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">Account name: </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_S_Account_Name__c}</td> |
| | | </tr> |
| | | </td> |
| | | <td> |
| | | <apex:outputPanel rendered="{!IF((Opp.ProductSegment__c = 'IE' || Opp.ProductSegment__c = 'RVI' || Opp.ProductSegment__c = 'BS'|| Opp.ProductSegment__c = 'NDT'|| Opp.ProductSegment__c = 'ANI' ) && Opp.TradeType__c = 'Tax Exemption', 'true', 'false')}" layout="none"> |
| | | <div> {!contra.SignatureDate}</div> |
| | | <div> {!contra.SignatureDates}</div> |
| | | </apex:outputPanel> |
| | | |
| | | <tr style="line-height: 4px"> |
| | | <td height="1px"> </td> |
| | | </tr> |
| | | |
| | | <apex:outputPanel rendered="{!IF((Opp.ProductSegment__c = 'IE' || Opp.ProductSegment__c = 'RVI' || Opp.ProductSegment__c = 'BS'|| Opp.ProductSegment__c = 'NDT'|| Opp.ProductSegment__c = 'ANI' ) && Opp.TradeType__c = 'Tax Exemption', 'true', 'false')}" |
| | | layout="none"> |
| | | <!-- <tr> |
| | | <td style="font-size: 8pt;"> </td> |
| | | </tr> --> |
| | | <tr> |
| | | <td style="font-size: 8pt;">收货人: </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_C_Consignee__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">THE CONSIGNEE: </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_C_THECONSIGNE__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">地址: </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_C_Address__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">ADD: </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_C_Add__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">电话(Tel): </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_C_TEL__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">传真(Fax): </td> |
| | | <td colspan="3" style="font-size: 8pt;" id="PDF_C_FAX__c">{!contra.order.PDF_C_FAX__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">联系人: </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_C_CONTACT__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">CONTACT PERSON: </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_C_contactperson__c}</td> |
| | | </tr> |
| | | <apex:outputPanel rendered="{!IF(Opp.ProductSegment__c = 'BS' || Opp.ProductSegment__c = 'NDT' ||Opp.ProductSegment__c = 'ANI'&& Opp.TradeType__c = 'Tax Exemption', 'true', 'false')}" layout="none"> |
| | | <div> {!contra.order.PDF_SignaturePlace__c}</div> |
| | | <div> {!contra.order.PDF_SignaturePlaces__c}</div> |
| | | </apex:outputPanel> |
| | | <!-- <apex:outputPanel rendered="{!IF((Opp.ProductSegment__c = 'IE' || Opp.ProductSegment__c = 'RVI') && Opp.TradeType__c = 'Tax Exemption', 'true', 'false')}" layout="none"> |
| | | <tr> |
| | | <td style="font-size: 8pt;">THE CONSIGNEE: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_C_THECONSIGNE__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">ADD: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_C_Add__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">电话(Tel): </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.pdf_c_tel}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">传真(Fax): </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.pdf_c_fax}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">CONTACT PERSON: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_C_contactperson__c}</td> |
| | | </tr> |
| | | </apex:outputPanel> --> |
| | | <apex:outputPanel rendered="{!IF((Opp.ProductSegment__c = 'IE' || Opp.ProductSegment__c = 'RVI' || Opp.ProductSegment__c = 'BS'|| Opp.ProductSegment__c = 'NDT'|| Opp.ProductSegment__c = 'ANI' ) && Opp.TradeType__c = 'Taxation', 'true', 'false')}" |
| | | layout="none"> |
| | | <tr> |
| | | <td style="font-size: 8pt;">收货人: </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!contra.pdf_c_consignee}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">地址: </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!contra.pdf_c_address}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">电话(Tel): </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!contra.pdf_c_tel}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">联系人: </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!contra.pdf_c_contact}</td> |
| | | </tr> |
| | | </apex:outputPanel> |
| | | |
| | | <tr height="1px"> |
| | | <td height="1px"> </td> |
| | | </tr> |
| | | |
| | | <apex:outputPanel rendered="{!IF(Opp.TradeType__c = 'Tax Exemption' && (Opp.ProductSegment__c = 'BS'||Opp.ProductSegment__c = 'NDT'||Opp.ProductSegment__c = 'ANI'||Opp.ProductSegment__c = 'IE'||Opp.ProductSegment__c = 'RVI'), 'true', 'false')}" |
| | | layout="none"> |
| | | <tr> |
| | | <td style="font-size: 8pt;">通知人: </td> |
| | | <td colspan="3" style="font-size: 8pt;" id="PDF_N_NotifyParty__c">{!contra.order.PDF_N_NotifyParty__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">THE NOTIFY PARTY: </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_NOTIFY_PARTY__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">地址: </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_N_Address__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">ADD: </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_N_Add__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">电话(Tel): </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_N_TEL__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">传真(Fax): </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_N_FAX__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">联系人: </td> |
| | | <td colspan="3" style="font-size: 8pt;" id="PDF_N_CONTACT__c">{!contra.order.PDF_N_CONTACT__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">CONTACT PERSON: </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_N_CONTACTPERSON__c}</td> |
| | | </tr> |
| | | </apex:outputPanel> |
| | | <apex:outputPanel rendered="{!IF(Opp.TradeType__c = 'Tax Exemption' && (Opp.ProductSegment__c = 'ABC'), 'true', 'false')}" |
| | | layout="none"> |
| | | <tr> |
| | | <td style="font-size: 8pt;">THE NOTIFY PARTY: </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_NOTIFY_PARTY__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">ADD: </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_N_Add__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">电话(Tel): </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_N_TEL__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">传真(Fax): </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_N_FAX__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">CONTACT PERSON: </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_N_CONTACTPERSON__c}</td> |
| | | </tr> |
| | | </apex:outputPanel> |
| | | |
| | | <tr> |
| | | <td height="1px"> </td> |
| | | </tr> |
| | | |
| | | <apex:outputPanel rendered="{!IF((Opp.ProductSegment__c = 'IE' || Opp.ProductSegment__c = 'RVI' ) && Opp.TradeType__c = 'Tax Exemption', 'true', 'false')}" |
| | | layout="none"> |
| | | <tr> |
| | | <td style="font-size: 8pt;">转运商 (英文): </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_Forwarder__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">ADD: </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_F_Add__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">电话(Tel): </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_F_TEL__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">传真(Fax): </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_F_FAX__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">联系人 (中文): </td> |
| | | <td colspan="3" style="font-size: 8pt;" id="PDF_F_ContactPerson__c">{!contra.order.PDF_F_ContactPerson__c}</td> |
| | | </tr> |
| | | </apex:outputPanel> |
| | | <apex:outputPanel rendered="{!IF((Opp.ProductSegment__c = 'IE' || Opp.ProductSegment__c = 'RVI' || Opp.ProductSegment__c = 'BS'|| Opp.ProductSegment__c = 'NDT'|| Opp.ProductSegment__c = 'ANI' ) && Opp.TradeType__c = 'Taxation', 'true', 'false')}" |
| | | layout="none"> |
| | | <tr> |
| | | <td style="font-size: 8pt;">中间商公司: </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!Opp.SubDealer__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">公司名称: </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_F_Add__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">地址: </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_F_TEL__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">电话: </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_F_FAX__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">系统编号: </td> |
| | | <td colspan="3" style="font-size: 8pt;">{!contra.order.Id}</td> |
| | | </tr> |
| | | </apex:outputPanel> |
| | | </table> |
| | | </div> |
| | | |
| | | <apex:outputPanel layout="none"> |
| | | <div style="page-break-after: always;" /> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | <table width="100%" cellspacing="0" cellpadding="0"> |
| | | <colgroup> |
| | | <col width="25%"/> |
| | | <col width="25%"/> |
| | | <col width="25%"/> |
| | | <col width="25%"/> |
| | | </colgroup> |
| | | <tr><td colspan = "4" height="5px"></td></tr> |
| | | <tr> |
| | | <td colspan = "4" style="text-align: center;font-size: 14pt;">合同</td> |
| | | </tr> |
| | | <tr> |
| | | <td colspan = "4" style="text-align: center;font-size: 12pt;">CONTRACT</td> |
| | | </tr> |
| | | |
| | | <tr> |
| | | <td style="font-size: 8pt;">买方: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!specialDeliveryAddress.Name}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">THE BUYER: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!specialDeliveryAddress.EnglishName__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">地址: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!specialDeliveryAddress.Address1__c}</td> |
| | | </tr> |
| | | <apex:outputPanel rendered="{!IF(Opp.TradeType__c != 'Taxation', 'true', 'false')}" layout="none"> |
| | | <tr> |
| | | <td style="font-size: 8pt;">ADD: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_B_Add__c}</td> |
| | | </tr> |
| | | </apex:outputPanel> |
| | | |
| | | <div class="pdf-page"> |
| | | <table style="font-size: 9pt;"> |
| | | <tr> |
| | | <td style="font-size: 8pt;">电话(Tel): </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!specialDeliveryAddress.Phone}</td> |
| | | </tr> |
| | | <apex:outputPanel rendered="{!IF(Opp.TradeType__c != 'Taxation', 'true', 'false')}" layout="none"> |
| | | <tr> |
| | | <td style="font-size: 8pt;">传真(Fax): </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!specialDeliveryAddress.Fax}</td> |
| | | </tr> |
| | | </apex:outputPanel> |
| | | <tr> |
| | | <td style="font-size: 8pt;">联系人: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!specialDeliveryContact.Name}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">CONTACT PERSON: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_B_contactperson__c}</td> |
| | | </tr> |
| | | |
| | | <apex:outputPanel rendered="{!IF((Opp.ProductSegment__c = 'IE' || Opp.ProductSegment__c = 'RVI'|| Opp.ProductSegment__c = 'NDT'|| Opp.ProductSegment__c = 'ANI' ) && Opp.TradeType__c = 'Tax Exemption', 'true', 'false')}" layout="none" > |
| | | <tr> |
| | | <td style="font-size: 8pt;">E-Mail: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!specialDeliveryContact.Email}</td> |
| | | </tr> |
| | | </apex:outputPanel> |
| | | |
| | | <apex:outputPanel rendered="{!IF(Opp.ProductSegment__c = 'IE', 'true', 'false')}" layout="none"> |
| | | <tr> |
| | | <td style="font-size: 8pt;">用户属性: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_B_Attri__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">用户产品: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.account.Sub_Use__c}</td> |
| | | </tr> |
| | | </apex:outputPanel> |
| | | |
| | | <apex:outputPanel rendered="{!IF(Opp.ProductSegment__c = 'RVI', 'true', 'false')}" layout="none"> |
| | | <tr> |
| | | <td style="font-size: 8pt;">市场: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.account.Sub_Use__c}</td> |
| | | </tr> |
| | | </apex:outputPanel> |
| | | |
| | | <tr><td height="1px"> </td></tr> |
| | | |
| | | <apex:outputPanel rendered="{!IF((Opp.ProductSegment__c = 'BC' ) && Opp.TradeType__c = 'Tax Exemption', 'true', 'false')}" layout="none"> |
| | | <tr> |
| | | <td style="font-size: 8pt;">卖方: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_SELLER__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">THE SELLER: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_THE_SELLER__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">地址: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_S_Adds__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">ADD: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_S_Address__c}</td> |
| | | </tr> |
| | | |
| | | </apex:outputPanel> |
| | | <apex:outputPanel rendered="{!IF((Opp.ProductSegment__c = 'IE' || Opp.ProductSegment__c = 'RVI' || Opp.ProductSegment__c = 'BS'|| Opp.ProductSegment__c = 'NDT'|| Opp.ProductSegment__c = 'ANI' ) &&Opp.TradeType__c = 'Taxation', 'true', 'false')}" layout="none"> |
| | | <tr> |
| | | <td style="font-size: 8pt;">卖方: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_SELLER__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">地址: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_S_Adds__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">电话 (TEL): </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_S_TEL__c}</td> |
| | | </tr> |
| | | </apex:outputPanel> |
| | | <apex:outputPanel rendered="{!IF((Opp.ProductSegment__c = 'IE' || Opp.ProductSegment__c = 'RVI' || Opp.ProductSegment__c = 'BS' || Opp.ProductSegment__c = 'NDT'|| Opp.ProductSegment__c = 'ANI')&& Opp.TradeType__c = 'Tax Exemption', 'true', 'false')}" layout="none"> |
| | | <tr> |
| | | <td style="font-size: 8pt;">卖方: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_SELLER__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">THE SELLER: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_THE_SELLER__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">地址: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_S_Adds__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">ADD: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_S_Address__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">电话(Tel): </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_S_TEL__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">传真(FAX): </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_S_FAX__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">Bank Name: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_S_Bank_Name__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">Branch: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_S_Branch__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">Address: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_S_Bank_Address__c}</td> |
| | | </tr> |
| | | <!-- <tr> |
| | | <td style="font-size: 8pt;">Address: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_S_Address__c}</td> |
| | | </tr> --> |
| | | <tr> |
| | | <td style="font-size: 8pt;">Account no: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_S_Account_No__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">Swift code: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_S_Swift_Code__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">Account name: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_S_Account_Name__c}</td> |
| | | </tr> |
| | | </apex:outputPanel> |
| | | |
| | | <tr style="line-height: 4px"><td height="1px"> </td></tr> |
| | | |
| | | <apex:outputPanel rendered="{!IF((Opp.ProductSegment__c = 'IE' || Opp.ProductSegment__c = 'RVI' || Opp.ProductSegment__c = 'BS'|| Opp.ProductSegment__c = 'NDT'|| Opp.ProductSegment__c = 'ANI' ) && Opp.TradeType__c = 'Tax Exemption', 'true', 'false')}" layout="none"> |
| | | <!-- <tr> |
| | | <td style="font-size: 8pt;"> </td> |
| | | </tr> --> |
| | | <tr> |
| | | <td style="font-size: 8pt;">收货人: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_C_Consignee__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">THE CONSIGNEE: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_C_THECONSIGNE__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">地址: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_C_Address__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">ADD: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_C_Add__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">电话(Tel): </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_C_TEL__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">传真(Fax): </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_C_FAX__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">联系人: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_C_CONTACT__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">CONTACT PERSON: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_C_contactperson__c}</td> |
| | | </tr> |
| | | </apex:outputPanel> |
| | | <!-- <apex:outputPanel rendered="{!IF((Opp.ProductSegment__c = 'IE' || Opp.ProductSegment__c = 'RVI') && Opp.TradeType__c = 'Tax Exemption', 'true', 'false')}" layout="none"> |
| | | <tr> |
| | | <td style="font-size: 8pt;">THE CONSIGNEE: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_C_THECONSIGNE__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">ADD: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_C_Add__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">电话(Tel): </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.pdf_c_tel}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">传真(Fax): </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.pdf_c_fax}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">CONTACT PERSON: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_C_contactperson__c}</td> |
| | | </tr> |
| | | </apex:outputPanel> --> |
| | | <apex:outputPanel rendered="{!IF((Opp.ProductSegment__c = 'IE' || Opp.ProductSegment__c = 'RVI' || Opp.ProductSegment__c = 'BS'|| Opp.ProductSegment__c = 'NDT'|| Opp.ProductSegment__c = 'ANI' ) && Opp.TradeType__c = 'Taxation', 'true', 'false')}" layout="none"> |
| | | <tr> |
| | | <td style="font-size: 8pt;">收货人: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.pdf_c_consignee}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">地址: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.pdf_c_address}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">电话(Tel): </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.pdf_c_tel}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">联系人: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.pdf_c_contact}</td> |
| | | </tr> |
| | | </apex:outputPanel> |
| | | |
| | | <tr height="1px"><td height="1px"> </td></tr> |
| | | |
| | | <apex:outputPanel rendered="{!IF(Opp.TradeType__c = 'Tax Exemption' && (Opp.ProductSegment__c = 'BS'||Opp.ProductSegment__c = 'NDT'||Opp.ProductSegment__c = 'ANI'||Opp.ProductSegment__c = 'IE'||Opp.ProductSegment__c = 'RVI'), 'true', 'false')}" layout="none"> |
| | | <tr> |
| | | <td style="font-size: 8pt;">通知人: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_N_NotifyParty__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">THE NOTIFY PARTY: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_NOTIFY_PARTY__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">地址: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_N_Address__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">ADD: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_N_Add__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">电话(Tel): </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_N_TEL__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">传真(Fax): </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_N_FAX__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">联系人: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_N_CONTACT__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">CONTACT PERSON: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_N_CONTACTPERSON__c}</td> |
| | | </tr> |
| | | </apex:outputPanel> |
| | | <apex:outputPanel rendered="{!IF(Opp.TradeType__c = 'Tax Exemption' && (Opp.ProductSegment__c = 'ABC'), 'true', 'false')}" layout="none"> |
| | | <tr> |
| | | <td style="font-size: 8pt;">THE NOTIFY PARTY: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_NOTIFY_PARTY__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">ADD: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_N_Add__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">电话(Tel): </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_N_TEL__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">传真(Fax): </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_N_FAX__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">CONTACT PERSON: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_N_CONTACTPERSON__c}</td> |
| | | </tr> |
| | | </apex:outputPanel> |
| | | |
| | | <tr><td height="1px"> </td></tr> |
| | | |
| | | <apex:outputPanel rendered="{!IF((Opp.ProductSegment__c = 'IE' || Opp.ProductSegment__c = 'RVI' ) && Opp.TradeType__c = 'Tax Exemption', 'true', 'false')}" layout="none"> |
| | | <tr> |
| | | <td style="font-size: 8pt;">转运商 (英文): </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_Forwarder__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">ADD: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_F_Add__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">电话(Tel): </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_F_TEL__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">传真(Fax): </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_F_FAX__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">联系人 (中文): </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_F_ContactPerson__c}</td> |
| | | </tr> |
| | | </apex:outputPanel> |
| | | <apex:outputPanel rendered="{!IF((Opp.ProductSegment__c = 'IE' || Opp.ProductSegment__c = 'RVI' || Opp.ProductSegment__c = 'BS'|| Opp.ProductSegment__c = 'NDT'|| Opp.ProductSegment__c = 'ANI' ) && Opp.TradeType__c = 'Taxation', 'true', 'false')}" layout="none"> |
| | | <tr> |
| | | <td style="font-size: 8pt;">中间商公司: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!Opp.SubDealer__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">公司名称: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_F_Add__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">地址: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_F_TEL__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">电话: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_F_FAX__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="font-size: 8pt;">系统编号: </td> |
| | | <td colspan = "3" style="font-size: 8pt;">{!contra.order.Id}</td> |
| | | </tr> |
| | | </apex:outputPanel> |
| | | </table> |
| | | |
| | | <apex:outputPanel layout="none"> |
| | | <div style="page-break-after: always;"/> |
| | | </apex:outputPanel> |
| | | |
| | | <table style="font-size: 9pt;"> |
| | | <tr> |
| | | <td style="text-align:left"> |
| | | 1. 兹经买卖双方同意, 缔结本合同并按本合同下述条款,买方同意购入及卖方同意出售以下货物:<br/> |
| | | 1. This Contract is made by and between the Buyer and the Seller,whereby the Buyer agrees to buy and the Seller<br/> |
| | | agrees to sell the under-mentioned goods subject to the terms and conditions stipulated below:</td> |
| | | </tr> |
| | | <tr><td style="text-align: right;">(USD)</td></tr> |
| | | </table> |
| | | <apex:outputPanel rendered="{!IF(Opp.ProductSegment__c = 'IE' || Opp.ProductSegment__c = 'RVI' || Opp.ProductSegment__c = 'BS' , 'true', 'false')}" layout="none" > |
| | | <table width="100%" border="1" cellspacing="0" cellpadding="0" style="table-layout:auto;font-size: 9pt;"> |
| | | <tr> |
| | | <td width="5%" style="text-align: center;">序号</td> |
| | | <td style="text-align: center;">货物名称及规格</td> |
| | | <td width="10%" style="text-align: center;">单 位</td> |
| | | <td width="10%" style="text-align: center;">数 量</td> |
| | | <td width="15%" style="text-align: center;">单 价</td> |
| | | <td width="15%" style="text-align: center;">总 价</td> |
| | | </tr> |
| | | <tr> |
| | | <td width="5%" style="text-align: center;">Item</td> |
| | | <td style="text-align: center;">Goods & Specification</td> |
| | | <td width="10%" style="text-align: center;">Unit</td> |
| | | <td width="10%" style="text-align: center;">Qty</td> |
| | | <td width="15%" style="text-align: center;">Unit Price</td> |
| | | <td width="15%" style="text-align: center;">Total Amount</td> |
| | | </tr> |
| | | |
| | | <apex:repeat value="{!printSetInfo}" var="set"> |
| | | <tr> |
| | | <td style="text-align:left"> |
| | | 1. 兹经买卖双方同意, 缔结本合同并按本合同下述条款,买方同意购入及卖方同意出售以下货物: |
| | | <br/> 1. This Contract is made by and between the Buyer and the Seller,whereby the Buyer agrees to buy and |
| | | the Seller |
| | | <br/> agrees to sell the under-mentioned goods subject to the terms and conditions stipulated below:</td> |
| | | <td style="text-align: center;"><apex:outputText value="{!set.No__c}" /></td> |
| | | <td style="text-align: center;"><apex:outputText value="{!set.Goods__c}" /></td> |
| | | <td style="text-align: center;"><apex:outputText value="{!set.Unit__c}" /></td> |
| | | <td style="text-align: center;"><apex:outputText value="{!set.Qty__c}" /></td> |
| | | <td style="text-align: center;"><apex:outputText value="{!set.UnitPrice__c}" /></td> |
| | | <td style="text-align: center;"><apex:outputText value="{!set.Total_Amount__c}" /></td> |
| | | </tr> |
| | | </apex:repeat> |
| | | </table> |
| | | </apex:outputPanel> |
| | | |
| | | <apex:outputPanel rendered="{!IF(Opp.ProductSegment__c = 'IE' || Opp.ProductSegment__c = 'RVI' || Opp.ProductSegment__c = 'BS' , 'false', 'true')}" layout="none" > |
| | | |
| | | <table width="100%" border="1" cellspacing="0" cellpadding="0" style="table-layout:auto;font-size: 9pt;"> |
| | | <colgroup> |
| | | <col width="5%"/> |
| | | <col width="10%"/> |
| | | <col width="23%"/> |
| | | <col width="5%"/> |
| | | <col width="8%"/> |
| | | <col width="10%"/> |
| | | <col width="8%"/> |
| | | <col width="11%"/> |
| | | <col width="10%"/> |
| | | <col width="10%"/> |
| | | </colgroup> |
| | | <tr> |
| | | <td style="text-align: center;">序号</td> |
| | | <td style="text-align: center;">U8号码</td> |
| | | <td style="text-align: center;">产品型号</td> |
| | | <td style="text-align: center;">单位</td> |
| | | <td style="text-align: center;">数量</td> |
| | | <td style="text-align: center;">单价</td> |
| | | <td style="text-align: center;">折扣</td> |
| | | <td style="text-align: center;">折后单价</td> |
| | | <td style="text-align: center;">总价</td> |
| | | <td style="text-align: center;">备注</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align: center;">Item</td> |
| | | <td style="text-align: center;">U8</td> |
| | | <td style="text-align: center;">Part Number</td> |
| | | <td style="text-align: center;">Unit</td> |
| | | <td style="text-align: center;">Quantity</td> |
| | | <td style="text-align: center;">Unit Price</td> |
| | | <td style="text-align: center;">Discount </td> |
| | | <td style="text-align: center;">Discounted Price/Unit</td> |
| | | <td style="text-align: center;">Total Amount</td> |
| | | <td style="text-align: center;">Remark</td> |
| | | </tr> |
| | | |
| | | <apex:repeat value="{!printSetInfo}" var="set"> |
| | | <tr> |
| | | <td style="text-align: right;">(USD)</td> |
| | | <td style="text-align: center;"><apex:outputText value="{!set.No__c}" style="width: 95%"/></td> |
| | | <td style="text-align: center;"><apex:outputText value="{!set.U8__c}" style="width: 95%"/></td> |
| | | <td style="text-align: center;"><!-- <apex:outputText value="{!set.Goods__c}" style="width: 95%"/> --><c:PDFWbr targetStr="{!set.Goods__c}"/></td> |
| | | <td style="text-align: center;"><apex:outputText value="{!set.Unit__c}" style="width: 95%; text-align: right;"/></td> |
| | | <td style="text-align: center;"><apex:outputText value="{!set.Qty__c}" style="width: 95%; text-align: right;"/></td> |
| | | <td style="text-align: center;"><apex:outputText value="{!set.UnitPrice__c}" style="width: 95%"/></td> |
| | | <td style="text-align: center;"><apex:outputText value="{!set.discount__c}" style="width: 95%"/></td> |
| | | <td style="text-align: center;"><apex:outputText value="{!set.discountprice__c}" style="width: 95%; text-align: right;"/></td> |
| | | <td style="text-align: center;"><apex:outputText value="{!set.Total_AmountNDT__c}" style="width: 95%; text-align: right;"/></td> |
| | | <td style="text-align: center;"><!-- <apex:outputText value="{!set.Remark__c}" style="width: 95%"/> --><c:PDFWbr targetStr="{!set.Remark__c}"/></td> |
| | | </tr> |
| | | </table> |
| | | <apex:outputPanel rendered="{!IF(Opp.ProductSegment__c = 'IE' || Opp.ProductSegment__c = 'RVI' || Opp.ProductSegment__c = 'BS' , 'true', 'false')}" |
| | | layout="none"> |
| | | <table width="100%" border="1" cellspacing="0" cellpadding="0" style="table-layout:auto;font-size: 9pt;"> |
| | | <tr> |
| | | <td width="5%" style="text-align: center;">序号</td> |
| | | <td style="text-align: center;">货物名称及规格</td> |
| | | <td width="10%" style="text-align: center;">单 位</td> |
| | | <td width="10%" style="text-align: center;">数 量</td> |
| | | <td width="15%" style="text-align: center;">单 价</td> |
| | | <td width="15%" style="text-align: center;">总 价</td> |
| | | </tr> |
| | | <tr> |
| | | <td width="5%" style="text-align: center;">Item</td> |
| | | <td style="text-align: center;">Goods & Specification</td> |
| | | <td width="10%" style="text-align: center;">Unit</td> |
| | | <td width="10%" style="text-align: center;">Qty</td> |
| | | <td width="15%" style="text-align: center;">Unit Price</td> |
| | | <td width="15%" style="text-align: center;">Total Amount</td> |
| | | </tr> |
| | | |
| | | <apex:repeat value="{!printSetInfo}" var="set"> |
| | | <tr> |
| | | <td style="text-align: center;"> |
| | | <apex:outputText value="{!set.No__c}" /> |
| | | </td> |
| | | <td style="text-align: center;"> |
| | | <apex:outputText value="{!set.Goods__c}" /> |
| | | </td> |
| | | <td style="text-align: center;"> |
| | | <apex:outputText value="{!set.Unit__c}" /> |
| | | </td> |
| | | <td style="text-align: center;"> |
| | | <apex:outputText value="{!set.Qty__c}" /> |
| | | </td> |
| | | <td style="text-align: center;"> |
| | | <apex:outputText value="{!set.UnitPrice__c}" /> |
| | | </td> |
| | | <td style="text-align: center;"> |
| | | <apex:outputText value="{!set.Total_Amount__c}" /> |
| | | </td> |
| | | </tr> |
| | | </apex:repeat> |
| | | </table> |
| | | </apex:outputPanel> |
| | | |
| | | <apex:outputPanel rendered="{!IF(Opp.ProductSegment__c = 'IE' || Opp.ProductSegment__c = 'RVI' || Opp.ProductSegment__c = 'BS' , 'false', 'true')}" |
| | | layout="none"> |
| | | |
| | | <table width="100%" border="1" cellspacing="0" cellpadding="0" style="table-layout:auto;font-size: 9pt;"> |
| | | <colgroup> |
| | | <col width="5%" /> |
| | | <col width="10%" /> |
| | | <col width="23%" /> |
| | | <col width="5%" /> |
| | | <col width="8%" /> |
| | | <col width="10%" /> |
| | | <col width="8%" /> |
| | | <col width="11%" /> |
| | | <col width="10%" /> |
| | | <col width="10%" /> |
| | | </colgroup> |
| | | <tr> |
| | | <td style="text-align: center;">序号</td> |
| | | <td style="text-align: center;">U8号码</td> |
| | | <td style="text-align: center;">产品型号</td> |
| | | <td style="text-align: center;">单位</td> |
| | | <td style="text-align: center;">数量</td> |
| | | <td style="text-align: center;">单价</td> |
| | | <td style="text-align: center;">折扣</td> |
| | | <td style="text-align: center;">折后单价</td> |
| | | <td style="text-align: center;">总价</td> |
| | | <td style="text-align: center;">备注</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align: center;">Item</td> |
| | | <td style="text-align: center;">U8</td> |
| | | <td style="text-align: center;">Part Number</td> |
| | | <td style="text-align: center;">Unit</td> |
| | | <td style="text-align: center;">Quantity</td> |
| | | <td style="text-align: center;">Unit Price</td> |
| | | <td style="text-align: center;">Discount </td> |
| | | <td style="text-align: center;">Discounted Price/Unit</td> |
| | | <td style="text-align: center;">Total Amount</td> |
| | | <td style="text-align: center;">Remark</td> |
| | | </tr> |
| | | |
| | | <apex:repeat value="{!printSetInfo}" var="set"> |
| | | <tr> |
| | | <td style="text-align: center;"> |
| | | <apex:outputText value="{!set.No__c}" style="width: 95%" /> |
| | | </td> |
| | | <td style="text-align: center;"> |
| | | <apex:outputText value="{!set.U8__c}" style="width: 95%" /> |
| | | </td> |
| | | <td style="text-align: center;"> |
| | | <!-- <apex:outputText value="{!set.Goods__c}" style="width: 95%"/> --> |
| | | <c:PDFWbr targetStr="{!set.Goods__c}" /> |
| | | </td> |
| | | <td style="text-align: center;"> |
| | | <apex:outputText value="{!set.Unit__c}" style="width: 95%; text-align: right;" /> |
| | | </td> |
| | | <td style="text-align: center;"> |
| | | <apex:outputText value="{!set.Qty__c}" style="width: 95%; text-align: right;" /> |
| | | </td> |
| | | <td style="text-align: center;"> |
| | | <apex:outputText value="{!set.UnitPrice__c}" style="width: 95%" /> |
| | | </td> |
| | | <td style="text-align: center;"> |
| | | <apex:outputText value="{!set.discount__c}" style="width: 95%" /> |
| | | </td> |
| | | <td style="text-align: center;"> |
| | | <apex:outputText value="{!set.discountprice__c}" style="width: 95%; text-align: right;" /> |
| | | </td> |
| | | <td style="text-align: center;"> |
| | | <apex:outputText value="{!set.Total_AmountNDT__c}" style="width: 95%; text-align: right;" /> |
| | | </td> |
| | | <td style="text-align: center;"> |
| | | <!-- <apex:outputText value="{!set.Remark__c}" style="width: 95%"/> --> |
| | | <c:PDFWbr targetStr="{!set.Remark__c}" /> |
| | | </td> |
| | | </tr> |
| | | </apex:repeat> |
| | | </table> |
| | | </apex:outputPanel> |
| | | |
| | | <table style="font-size: 9pt;" width="100%"> |
| | | <colgroup> |
| | | <col width="30%" /> |
| | | <col width="60%" /> |
| | | <col width="10%" /> |
| | | </colgroup> |
| | | <apex:outputPanel rendered="{!IF(Opp.ProductSegment__c = 'IE' || Opp.ProductSegment__c = 'RVI' || Opp.ProductSegment__c = 'BS' , 'true', 'false')}" |
| | | layout="none"> |
| | | <tr> |
| | | <td>总金额: </td> |
| | | <!-- <apex:outputPanel rendered="{!IF(Opp.ProductSegment__c = 'BS' && Opp.TradeType__c = 'Tax Exemption', 'true', 'false')}" layout="none"> --> |
| | | <td>US$ |
| | | <apex:outputText value="{0, number, ##0.00}"> |
| | | <apex:param value="{!TotalMoney}" /> |
| | | </apex:outputText> |
| | | </td> |
| | | <!-- </apex:outputPanel> --> |
| | | <!-- <apex:outputPanel rendered="{!IF((Opp.ProductSegment__c = 'IE' || Opp.ProductSegment__c = 'RVI' || Opp.ProductSegment__c = 'BS') &&Opp.TradeType__c = 'Tax Exemption', 'true', 'false')}" layout="none"> |
| | | <td>{!contra.order.CustomerContractPrice__c}</td> |
| | | </apex:outputPanel> --> |
| | | </tr> |
| | | <tr> |
| | | <td>Total Value: </td> |
| | | <td>{!contra.order.Shipment_Term_D__c} |
| | | <u> {!contra.order.PDF_Shipment_Term2_Text__c} </u> |
| | | </td> |
| | | </tr> |
| | | </apex:repeat> |
| | | </table> |
| | | </apex:outputPanel> |
| | | |
| | | <table style="font-size: 9pt;" width="100%"> |
| | | <colgroup> |
| | | <col width="30%" /> |
| | | <col width="60%" /> |
| | | <col width="10%" /> |
| | | </colgroup> |
| | | <apex:outputPanel rendered="{!IF(Opp.ProductSegment__c = 'IE' || Opp.ProductSegment__c = 'RVI' || Opp.ProductSegment__c = 'BS' , 'true', 'false')}" layout="none" > |
| | | <tr> |
| | | <td>总金额: </td> |
| | | <!-- <apex:outputPanel rendered="{!IF(Opp.ProductSegment__c = 'BS' && Opp.TradeType__c = 'Tax Exemption', 'true', 'false')}" layout="none"> --> |
| | | <td>US$ |
| | | <apex:outputText value="{0, number, ##0.00}"> |
| | | <apex:param value="{!TotalMoney}" /> |
| | | </apex:outputText> |
| | | </td> |
| | | <!-- </apex:outputPanel> --> |
| | | <!-- <apex:outputPanel rendered="{!IF((Opp.ProductSegment__c = 'IE' || Opp.ProductSegment__c = 'RVI' || Opp.ProductSegment__c = 'BS') &&Opp.TradeType__c = 'Tax Exemption', 'true', 'false')}" layout="none"> |
| | | <td>{!contra.order.CustomerContractPrice__c}</td> |
| | | </apex:outputPanel> --> |
| | | </tr> |
| | | <tr> |
| | | <td>Total Value: </td> |
| | | <td>{!contra.order.Shipment_Term_D__c} <u> {!contra.order.PDF_Shipment_Term2_Text__c} </u> </td> |
| | | </tr> |
| | | </apex:outputPanel> |
| | | <apex:outputPanel rendered="{!IF(Opp.ProductSegment__c = 'IE' || Opp.ProductSegment__c = 'RVI' || Opp.ProductSegment__c = 'BS' , 'false', 'true')}" layout="none" > |
| | | <tr> |
| | | <td>运保费/Shipping Charge: </td> |
| | | <td style="text-indent: 45px">US$ |
| | | <apex:outputText value="{0,number,##0.00}"> |
| | | <apex:param value="{!TrAndPre}"/> |
| | | </apex:outputText> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td>总金额: </td> |
| | | <!-- <apex:outputPanel rendered="{!IF(Opp.ProductSegment__c = 'BS' && Opp.TradeType__c = 'Tax Exemption', 'true', 'false')}" layout="none"> --> |
| | | <td style="text-indent: 45px;">US$ |
| | | <apex:outputText value="{0, number, ##0.00}"> |
| | | <apex:param value="{!TotalMoney}" /> |
| | | </apex:outputText> |
| | | </td> |
| | | <!-- </apex:outputPanel> --> |
| | | <!-- <apex:outputPanel rendered="{!IF((Opp.ProductSegment__c = 'IE' || Opp.ProductSegment__c = 'RVI' || Opp.ProductSegment__c = 'BS') &&Opp.TradeType__c = 'Tax Exemption', 'true', 'false')}" layout="none"> |
| | | <td>{!contra.order.CustomerContractPrice__c}</td> |
| | | </apex:outputPanel> --> |
| | | </tr> |
| | | <tr> |
| | | <td>Total Value: </td> |
| | | <td>{!contra.order.Shipment_Term_D__c} <u> </u>{!contra.order.PDF_Shipment_Term2_Text__c} </td> |
| | | </tr> |
| | | </apex:outputPanel> |
| | | <tr> |
| | | <td>Say: U.S. DOLLARS: </td> |
| | | <!-- <apex:outputPanel rendered="{!IF(Opp.ProductSegment__c = 'BS' && Opp.TradeType__c = 'Tax Exemption', 'true', 'false')}" layout="none"> --> |
| | | <td>{!contra.order.Total_price_E__c}</td> |
| | | <!-- </apex:outputPanel> --> |
| | | <!-- <apex:outputPanel rendered="{!IF((Opp.ProductSegment__c = 'IE' || Opp.ProductSegment__c = 'RVI' || Opp.ProductSegment__c = 'BS') &&Opp.TradeType__c = 'Tax Exemption', 'true', 'false')}" layout="none"> |
| | | <td>{!contra.order.CustomerContractPrice__c}</td> |
| | | </apex:outputPanel> --> |
| | | </tr> |
| | | <tr> |
| | | <td colspan = "3"> |
| | | 2. 生产国别及制造厂商: {!contra.order.PDF_Bi_manufacturers__c}<br/> |
| | | 2. COUNTRY OF ORIGIN OF GOODS AND MANUFACTURERS: {!contra.order.PDF_Bi_manufacturersEn__c}<br/> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td colspan = "3"> |
| | | 3. 包装: <br/> |
| | | 商品應以坚固的出口纸皮箱或木箱包装,适于长途空运、天气或气候变化、防潮、抗震、防锈及多次搬运。由于包装不良而产生的<br/> |
| | | 直接损失, 由卖方负责。<br/> |
| | | 3. PACKING: <br/> |
| | | The goods should be packed in strong export carton box or wooden box, which is suitable for long haul air transportation and <br/> |
| | | change of weather or climate, well protected against moisture, shocks, rust and withstand numerous transits. All direct losses <br/> |
| | | incurred on account of improper packing shall be borne by the Seller.<br/> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td colspan = "3"> |
| | | 4.运输标识: <br/> |
| | | 卖方须在每件货物的包装外表上以不褪色的颜料标明件号、毛重、尺码及下列字句: <br/> |
| | | ”勿使受潮” 、“小心轻放”、 “此面向上”等字样及下列唛头:<br/> |
| | | 4. SHIPPING MARK: <br/> |
| | | The Seller shall mark on the surface of each package with fadeless paint, the package number,gross weight,measurement<br/> |
| | | and the following wordings:<br/> |
| | | “KEEP AWAY FROM MOISTURE”,“HANDLE WITH CARE” ,“THIS SIDE UP” etc. And the below shipping mark: <br/> |
| | | <div><apex:outputField value="{!contra.order.PDF_Sp_SHIPPINGMARK__c}" /></div> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td colspan = "3"> |
| | | 5.装运条款: {!contra.order.PDF_Sp_ShippingTerms__c}<br/> |
| | | 5.TERMS OF SHIPMENT: {!contra.ShippingTerms}<br/> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td colspan = "2"> |
| | | 6.交货期: <apex:outputField value="{!contra.order.DeliveryTimeText__c}" /><br/> |
| | | 6.THE DELIVERY TIME: <apex:outputField value="{!contra.order.DeliveryTimeTextEn__c}" /><br/> |
| | | <!-- by the Buyer.<br/> --> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td colspan = "3"> |
| | | 7.卖方应保留货物和零部件的产权和所有权,该等权利只有在全额收到货款时方自动转移到买方。<br/> |
| | | 7.The Seller shall maintain title and ownership of the goods and spare parts thereof which shall automatically pass to the Buyer<br/> |
| | | only on receipt of the full payment.<br/> |
| | | </td> |
| | | </tr> |
| | | |
| | | <tr> |
| | | <td colspan = "3"> |
| | | 8. 装运口岸: {!contra.order.PDF_Sp_LOADING__c}<br/> |
| | | 8. PORT OF LOADING: {!contra.order.PDF_Sp_LOADING_E__c}<br/> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td colspan = "3"> |
| | | 9. 目的口岸: {!contra.order.PDF_Sp_DestinationPort__c}<br/> |
| | | 9. PORT OF DESTINATION: {!contra.order.PDF_Sp_DestinationPort_E__c}<br/> |
| | | </td> |
| | | </tr> |
| | | |
| | | <tr> |
| | | <td colspan = "3"> |
| | | 10. 保险:<br/> |
| | | 由卖方按发票金额的110%投保全险及战争险,并说明可以在中国境内索赔,空白背书。<br/> |
| | | 10. INSURANCE: <br/> |
| | | To be covered by the Seller for 110% of the invoice value covering all risks and war risk, indicating claims payable in China, <br/> |
| | | in currency of the draft, blank endorsed. |
| | | </td> |
| | | </tr> |
| | | |
| | | <tr> |
| | | <td colspan = "4"> |
| | | 11. 付款方式: {!contra.order.PDF_PaymentTerms__c};<br/> |
| | | 所有银行手续费,包括对方银行和中转行手续费及其它费用,均由买方承担。<br/> |
| | | 11. TERMS OF PAYMENT: {!contra.order.PDF_PaymentTerms_E__c};<br/> |
| | | All the bank charges and other expenses, including beneficiary bank and intermediary bank, arising from the payment shall be borne by the Buyer.<br/> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | <!--<apex:outputPanel layout="none"> |
| | | <div style="page-break-after: always;"/> |
| | | </apex:outputPanel>--> |
| | | <table style="font-size: 9pt;"> |
| | | <tr> |
| | | <td> |
| | | 12. 所需的文件: <br/> |
| | | <apex:outputPanel rendered="{!IF((Opp.ProductSegment__c = 'IE' || Opp.ProductSegment__c = 'RVI' || Opp.ProductSegment__c = 'BS'|| Opp.ProductSegment__c = 'NDT' || Opp.ProductSegment__c = 'ANI') && Opp.TradeType__c = 'Taxation', 'true', 'false')}" layout="none"> |
| | | 1) {!contra.order.PDF_Bi_Quality__c}份由卖方出具的质量和数量证明;<br/> |
| | | 2) {!contra.order.PDF_Bi_Origin__c}份卖方出具的原产地证明;及<br/> |
| | | 3) {!contra.order.PDF_Bi_Non_Wooden__c}份非木质包装证明。<br/> |
| | | </apex:outputPanel> |
| | | <apex:outputPanel rendered="{!IF(Opp.ProductSegment__c = 'IE' || Opp.ProductSegment__c = 'RVI' || Opp.ProductSegment__c = 'BS' , 'false', 'true')}" |
| | | layout="none"> |
| | | <tr> |
| | | <td>运保费/Shipping Charge: </td> |
| | | <td style="text-indent: 45px">US$ |
| | | <apex:outputText value="{0,number,##0.00}"> |
| | | <apex:param value="{!TrAndPre}" /> |
| | | </apex:outputText> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td>总金额: </td> |
| | | <!-- <apex:outputPanel rendered="{!IF(Opp.ProductSegment__c = 'BS' && Opp.TradeType__c = 'Tax Exemption', 'true', 'false')}" layout="none"> --> |
| | | <td style="text-indent: 45px;">US$ |
| | | <apex:outputText value="{0, number, ##0.00}"> |
| | | <apex:param value="{!TotalMoney}" /> |
| | | </apex:outputText> |
| | | </td> |
| | | <!-- </apex:outputPanel> --> |
| | | <!-- <apex:outputPanel rendered="{!IF((Opp.ProductSegment__c = 'IE' || Opp.ProductSegment__c = 'RVI' || Opp.ProductSegment__c = 'BS') &&Opp.TradeType__c = 'Tax Exemption', 'true', 'false')}" layout="none"> |
| | | <td>{!contra.order.CustomerContractPrice__c}</td> |
| | | </apex:outputPanel> --> |
| | | </tr> |
| | | <tr> |
| | | <td>Total Value: </td> |
| | | <td>{!contra.order.Shipment_Term_D__c} |
| | | <u> </u>{!contra.order.PDF_Shipment_Term2_Text__c} |
| | | </td> |
| | | </tr> |
| | | <apex:outputPanel rendered="{!IF(Opp.TradeType__c = 'Tax Exemption', 'true', 'false')}" layout="none"> |
| | | 请在发货后{!contra.order.PDF_Bi_q1__c}个工作日内将以下所需的文件传真/电邮给买方;<br/> |
| | | 1) 空运提单正本{!contra.order.PDF_Bi_airway__c}份,副本{!contra.order.PDF_Bi_copyairway__c}份。并注明“运费已付”;<br/> |
| | | 2) 发票{!contra.order.PDF_Bi_invoice__c}份, 注明合同号和运输标识(如有一个以上运输标识, 应分别出具发票)及合同中其它细节;<br/> |
| | | 3) 如保险由卖方负责的情况下,卖方需提供保险单{!contra.order.PDF_Bi_Insurance__c}套,投一切险, 按发票金额110%投保一切险;<br/> |
| | | 4) {!contra.order.PDF_Bi_Packing__c}份由卖方出具的装箱单;<br/> |
| | | 5) {!contra.order.PDF_Bi_Quality__c}份由卖方出具的质量和数量证明;<br/> |
| | | 6) {!contra.order.PDF_Bi_Origin__c}份卖方出具的原产地证明;及<br/> |
| | | 7) {!contra.order.PDF_Bi_Non_Wooden__c}份非木质包装证明。<br/> |
| | | <apex:outputPanel rendered="{!IF(Opp.ProductSegment__c = 'BS' || Opp.ProductSegment__c = 'ANI' ||Opp.ProductSegment__c = 'NDT', 'true', 'false')}" layout="none"> |
| | | 8) 所有单据 {!contra.order.PDF_Bi_AllBill__c}<br/> |
| | | </apex:outputPanel> |
| | | <tr> |
| | | <td>Say: U.S. DOLLARS: </td> |
| | | <!-- <apex:outputPanel rendered="{!IF(Opp.ProductSegment__c = 'BS' && Opp.TradeType__c = 'Tax Exemption', 'true', 'false')}" layout="none"> --> |
| | | <td>{!contra.order.Total_price_E__c}</td> |
| | | <!-- </apex:outputPanel> --> |
| | | <!-- <apex:outputPanel rendered="{!IF((Opp.ProductSegment__c = 'IE' || Opp.ProductSegment__c = 'RVI' || Opp.ProductSegment__c = 'BS') &&Opp.TradeType__c = 'Tax Exemption', 'true', 'false')}" layout="none"> |
| | | <td>{!contra.order.CustomerContractPrice__c}</td> |
| | | </apex:outputPanel> --> |
| | | </tr> |
| | | <tr> |
| | | <td colspan="3"> |
| | | 2. 生产国别及制造厂商: {!contra.order.PDF_Bi_manufacturers__c} |
| | | <br/> 2. COUNTRY OF ORIGIN OF GOODS AND MANUFACTURERS: {!contra.order.PDF_Bi_manufacturersEn__c} |
| | | <br/> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td colspan="3"> |
| | | 3. 包装: |
| | | <br/> 商品應以坚固的出口纸皮箱或木箱包装,适于长途空运、天气或气候变化、防潮、抗震、防锈及多次搬运。由于包装不良而产生的 |
| | | <br/> 直接损失, 由卖方负责。 |
| | | <br/> 3. PACKING: |
| | | <br/> The goods should be packed in strong export carton box or wooden box, which is suitable for long haul |
| | | air transportation and |
| | | <br/> change of weather or climate, well protected against moisture, shocks, rust and withstand numerous transits. |
| | | All direct losses |
| | | <br/> incurred on account of improper packing shall be borne by the Seller. |
| | | <br/> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td colspan="3"> |
| | | 4.运输标识: |
| | | <br/> 卖方须在每件货物的包装外表上以不褪色的颜料标明件号、毛重、尺码及下列字句: |
| | | <br/> ”勿使受潮” 、“小心轻放”、 “此面向上”等字样及下列唛头: |
| | | <br/> 4. SHIPPING MARK: |
| | | <br/> The Seller shall mark on the surface of each package with fadeless paint, the package number,gross weight,measurement |
| | | <br/> and the following wordings: |
| | | <br/> “KEEP AWAY FROM MOISTURE”,“HANDLE WITH CARE” ,“THIS SIDE UP” etc. And the below shipping mark: |
| | | <br/> |
| | | <div> |
| | | <apex:outputField value="{!contra.order.PDF_Sp_SHIPPINGMARK__c}" /> |
| | | </div> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td colspan="3"> |
| | | 5.装运条款: {!contra.order.PDF_Sp_ShippingTerms__c} |
| | | <br/> 5.TERMS OF SHIPMENT: {!contra.ShippingTerms} |
| | | <br/> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td colspan="2"> |
| | | 6.交货期: |
| | | <apex:outputField value="{!contra.order.DeliveryTimeText__c}" /> |
| | | <br/> 6.THE DELIVERY TIME: |
| | | <apex:outputField value="{!contra.order.DeliveryTimeTextEn__c}" /> |
| | | <!-- <br/> by |
| | | the Buyer. --> |
| | | <br/> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td colspan="3"> |
| | | 7.卖方应保留货物和零部件的产权和所有权,该等权利只有在全额收到货款时方自动转移到买方。 |
| | | <br/> 7.The Seller shall maintain title and ownership of the goods and spare parts thereof which shall automatically |
| | | pass to the Buyer |
| | | <br/> only on receipt of the full payment. |
| | | <br/> |
| | | </td> |
| | | </tr> |
| | | |
| | | <tr> |
| | | <td colspan="3"> |
| | | 8. 装运口岸: {!contra.order.PDF_Sp_LOADING__c} |
| | | <br/> 8. PORT OF LOADING: {!contra.order.PDF_Sp_LOADING_E__c} |
| | | <br/> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td colspan="3"> |
| | | 9. 目的口岸: {!contra.order.PDF_Sp_DestinationPort__c} |
| | | <br/> 9. PORT OF DESTINATION: {!contra.order.PDF_Sp_DestinationPort_E__c} |
| | | <br/> |
| | | </td> |
| | | </tr> |
| | | |
| | | <tr> |
| | | <td colspan="3"> |
| | | 10. 保险: |
| | | <br/> 由卖方按发票金额的110%投保全险及战争险,并说明可以在中国境内索赔,空白背书。 |
| | | <br/> 10. INSURANCE: |
| | | <br/> To be covered by the Seller for 110% of the invoice value covering all risks and war risk, indicating |
| | | claims payable in China, |
| | | <br/> in currency of the draft, blank endorsed. |
| | | </td> |
| | | </tr> |
| | | |
| | | <tr> |
| | | <td colspan = "4"> |
| | | 11. 付款方式: {!contra.order.PDF_PaymentTerms__c};<br/> |
| | | 所有银行手续费,包括对方银行和中转行手续费及其它费用,均由买方承担。<br/> |
| | | 11. TERMS OF PAYMENT: {!contra.order.PDF_PaymentTerms_E__c};<br/> |
| | | All the bank charges and other expenses, including beneficiary bank and intermediary bank, arising from the payment shall be borne by the Buyer.<br/> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | <!--<apex:outputPanel layout="none"> |
| | | <div style="page-break-after: always;"/> |
| | | </apex:outputPanel>--> |
| | | <table style="font-size: 9pt;"> |
| | | <tr> |
| | | <td> |
| | | 12. 所需的文件: |
| | | <br/> |
| | | <apex:outputPanel rendered="{!IF((Opp.ProductSegment__c = 'IE' || Opp.ProductSegment__c = 'RVI' || Opp.ProductSegment__c = 'BS'|| Opp.ProductSegment__c = 'NDT' || Opp.ProductSegment__c = 'ANI') && Opp.TradeType__c = 'Taxation', 'true', 'false')}" |
| | | layout="none"> |
| | | 1) {!contra.order.PDF_Bi_Quality__c}份由卖方出具的质量和数量证明; |
| | | <br/> 2) {!contra.order.PDF_Bi_Origin__c}份卖方出具的原产地证明;及 |
| | | <br/> 3) {!contra.order.PDF_Bi_Non_Wooden__c}份非木质包装证明。 |
| | | <br/> |
| | | </apex:outputPanel> |
| | | <apex:outputPanel rendered="{!IF(Opp.TradeType__c = 'Tax Exemption', 'true', 'false')}" layout="none"> |
| | | 请在发货后{!contra.order.PDF_Bi_q1__c}个工作日内将以下所需的文件传真/电邮给买方; |
| | | <br/> 1) 空运提单正本{!contra.order.PDF_Bi_airway__c}份,副本{!contra.order.PDF_Bi_copyairway__c}份。并注明“运费已付”; |
| | | <br/> 2) 发票{!contra.order.PDF_Bi_invoice__c}份, 注明合同号和运输标识(如有一个以上运输标识, 应分别出具发票)及合同中其它细节; |
| | | <br/> 3) 如保险由卖方负责的情况下,卖方需提供保险单{!contra.order.PDF_Bi_Insurance__c}套,投一切险, 按发票金额110%投保一切险; |
| | | <br/> 4) {!contra.order.PDF_Bi_Packing__c}份由卖方出具的装箱单; |
| | | <br/> 5) {!contra.order.PDF_Bi_Quality__c}份由卖方出具的质量和数量证明; |
| | | <br/> 6) {!contra.order.PDF_Bi_Origin__c}份卖方出具的原产地证明;及 |
| | | <br/> 7) {!contra.order.PDF_Bi_Non_Wooden__c}份非木质包装证明。 |
| | | <br/> |
| | | <apex:outputPanel rendered="{!IF(Opp.ProductSegment__c = 'BS' || Opp.ProductSegment__c = 'ANI' ||Opp.ProductSegment__c = 'NDT', 'true', 'false')}" |
| | | layout="none"> |
| | | 8) 所有单据 {!contra.order.PDF_Bi_AllBill__c} |
| | | <br/> |
| | | </apex:outputPanel> |
| | | 12. DOCUMENTS REQUIRED (please don’t attach any documents of contract value with the shipment): |
| | | <br/> Please fax/e-mail the below required documents to the Buyer within {!contra.order.PDF_Bi_q1__c} |
| | | working days after shipment; |
| | | <br/> 1) {!contra.order.PDF_Bi_airway__c} original and {!contra.order.PDF_Bi_copyairway__c} copy of clean |
| | | air waybills marked “freight prepaid”; |
| | | <br/> 2) Invoice in {!contra.order.PDF_Bi_invoice__c} copies indicating contract number and shipping mark |
| | | (in case of more than one shipping mark,the invoice shall be |
| | | <br/> issued separately), made out in details as per relative contract; |
| | | <br/> 3) Insurance Policy/Certificate in one original and {!contra.order.PDF_Bi_Insurance__c} copies for |
| | | 110% of the invoice value if the insurance is bought by the Seller; |
| | | <br/> 4) Packing list in {!contra.order.PDF_Bi_Packing__c} copies issued by the Seller; |
| | | <br/> 5) Certificate of Quality and Quantity in {!contra.order.PDF_Bi_Quality__c} copies issued by the |
| | | Seller; |
| | | <br/> 6) Certificate of Origin in {!contra.order.PDF_Bi_Origin__c} copies issued by the Seller; and |
| | | <br/> 7) {!contra.order.PDF_Bi_Non_Wooden__c} Certificate of Non-wood material packing. |
| | | <br/> |
| | | <apex:outputPanel rendered="{!IF(Opp.ProductSegment__c = 'BS', 'true', 'false')}" layout="none"> |
| | | 8) All the documents {!contra.AllBills} cargo |
| | | <br/> |
| | | </apex:outputPanel> |
| | | <apex:outputPanel rendered="{!IF(Opp.ProductSegment__c = 'NDT' || Opp.ProductSegment__c = 'ANI', 'true', 'false')}" layout="none"> |
| | | 8) All the documents not with cargo |
| | | </apex:outputPanel> |
| | | </apex:outputPanel> |
| | | </td> |
| | | </tr> |
| | | |
| | | <tr> |
| | | <td> |
| | | 13. 装运通知: |
| | | <br/> 卖方应于发货四十八(48)小时内以传真或电邮形式提供发货通知告知买方合同号、货物名称、实装数量、重量、件数、发票价 |
| | | <br/> 值、航班号及日期、空运单号等 |
| | | <br/> 13. SHIPPING ADVICE: |
| | | <br/> The Seller, within forty eight (48) hours after shipment is made, shall notify the Buyer of the contract |
| | | no., name ofgoods, |
| | | <br/> quantity, weight loaded, number of packages, invoice value, flight number and date, air waybill number |
| | | etc. by fax or email. |
| | | <br/> |
| | | </td> |
| | | </tr> |
| | | <apex:outputPanel rendered="{!IF(Opp.ProductSegment__c = 'BS' || Opp.ProductSegment__c = 'IE' || Opp.ProductSegment__c = 'RVI', 'true', 'false')}" |
| | | layout="none"> |
| | | <tr> |
| | | <td> |
| | | 14. 质量保证: |
| | | <br/> A. 卖方保证本合同之货物是用最好的材料以上等的工艺制造,崭新及未用过的,其质量与规格一切方面与本合同的规定相符。 |
| | | <br/> 保证期为最终验收报告签署之日起的{!contra.QAeng}但不超过发货日后的{!contra.QAeng4}。 |
| | | <br/> 在保证期内,如买方按照货物使用说明书在正常条件下使用,由于卖方设计或制造上的缺陷而发生的损坏,由卖方负责。 |
| | | <br/> 在保证期内如果货物的重要零部件需要更换,则该零部件的保证期从更换之日起重新计算,外购件以原供应商的保证期为准。 |
| | | <br/> B. 如果双方共同商定并确认的供货范围中有遗漏的部件和设备并有可能导致整套货物不能按时验收投产或影响生产,卖方 |
| | | <br/> 有义务和责任在制造过程中与买方商量做出相应的调整和补救,并保证整套以上货物能通过验收。 |
| | | <br/> C. 本合同中所述的保证是适用于根据合同货物提供的的唯一保证。本保证条款取代并排除法律、惯例、法令或其他规定施加 |
| | | <br/> 或默示的任何其他担保、保证和/或条件和/或因此而产生的责任。对于任何有缺陷的或不符合标准的货物,买方所适用的只有 |
| | | <br/> 本条特别规定的救济。 |
| | | <br/> 14. WARRANTY: |
| | | <br/> A.The Seller warrant that the goods hereof is made of the best materials with first class workmanship, |
| | | brand new and |
| | | <br/> unused and complies in all respects with the quality and specification stipulated in this Contract. |
| | | <br/> The warranty period shall be {!contra.QAeng3}counting from the date on which the goods have been |
| | | accepted by the end user |
| | | <br/> but limited to a maximum of {!contra.QAeng2} from the date of shipment. |
| | | <br/> Within the warranty period, the Seller shall be liable for the damage incurred on account of the |
| | | defects attributable to the design |
| | | <br/> and emerging during the course of manufacturing of the Seller’s side if the Buyer operate under |
| | | regular conditions in accordance |
| | | <br/> with the instruction to the equipments or the machines. Within the warranty period, if some important |
| | | units and parts of the goods |
| | | <br/> need to change, the warranty period of the new units and parts should be counted from the changing |
| | | date. If the new units and |
| | | <br/> parts are bought from the third party, the warranty period of the new units and parts should be |
| | | counted according to the original suppliers. |
| | | <br/> B.In case there’s any missing parts & machines which are out of the agreed scope of supply and |
| | | most possibly would influence |
| | | <br/> the commissioning or production on time, the Seller has the obligation and responsibility to discuss |
| | | with Buyer to make concerned |
| | | <br/> adjustments and amendments to warrant the acceptance of the goods. |
| | | <br/> C. The warranty set out in this Contract is the only warranty applicable to the goods supplied pursuant |
| | | to this Contract. This |
| | | <br/> warranty replaces and excludes any other guarantee, warranty and/or condition imposed or implied |
| | | by law, custom, statute or |
| | | <br/> otherwise and/or resulting liabilities. Only those remedies specifically set out in this clause |
| | | are available to the Buyer |
| | | <br/> in respect of any defective or non-conforming goods. |
| | | <br/> |
| | | </td> |
| | | </tr> |
| | | 12. DOCUMENTS REQUIRED (please don’t attach any documents of contract value with the shipment):<br/> |
| | | Please fax/e-mail the below required documents to the Buyer within {!contra.order.PDF_Bi_q1__c} working days after shipment;<br/> |
| | | 1) {!contra.order.PDF_Bi_airway__c} original and {!contra.order.PDF_Bi_copyairway__c} copy of clean air waybills marked “freight prepaid”;<br/> |
| | | 2) Invoice in {!contra.order.PDF_Bi_invoice__c} copies indicating contract number and shipping mark (in case of more than one shipping mark,the invoice shall be<br/> |
| | | issued separately), made out in details as per relative contract;<br/> |
| | | 3) Insurance Policy/Certificate in one original and {!contra.order.PDF_Bi_Insurance__c} copies for 110% of the invoice value if the insurance is bought by the Seller;<br/> |
| | | 4) Packing list in {!contra.order.PDF_Bi_Packing__c} copies issued by the Seller;<br/> |
| | | 5) Certificate of Quality and Quantity in {!contra.order.PDF_Bi_Quality__c} copies issued by the Seller; <br/> |
| | | 6) Certificate of Origin in {!contra.order.PDF_Bi_Origin__c} copies issued by the Seller; and<br/> |
| | | 7) {!contra.order.PDF_Bi_Non_Wooden__c} Certificate of Non-wood material packing.<br/> |
| | | <apex:outputPanel rendered="{!IF(Opp.ProductSegment__c = 'BS', 'true', 'false')}" layout="none"> |
| | | 8) All the documents {!contra.AllBills} cargo<br/> |
| | | </apex:outputPanel> |
| | | <apex:outputPanel rendered="{!IF(Opp.ProductSegment__c = 'NDT' || Opp.ProductSegment__c = 'ANI', 'true', 'false')}" layout="none"> |
| | | <tr> |
| | | <td> |
| | | 14. 质量保证: |
| | | <br/> A. 卖方保证本合同之货物是用最好的材料以上等的工艺制造,崭新及未用过的,其质量与规格一切方面与本合同的规定相符。 |
| | | <br/> 保证期配件为3个月,主机为1年至3年,根据产品具体型号确定。 |
| | | <br/> 在保证期内,如买方按照货物使用说明书在正常条件下使用,由于卖方设计或制造上的缺陷而发生的损坏,由卖方负责。 |
| | | <br/> 在保证期内如果货物的重要零部件需要更换,则该零部件的保证期从更换之日起重新计算,外购件以原供应商的保证期为准。 |
| | | <br/> B. 如果双方共同商定并确认的供货范围中有遗漏的部件和设备并有可能导致整套货物不能按时验收投产或影响生产,卖方 |
| | | <br/> 有义务和责任在制造过程中与买方商量做出相应的调整和补救,并保证整套以上货物能通过验收。 |
| | | <br/> C. 本合同中所述的保证是适用于根据合同货物提供的的唯一保证。本保证条款取代并排除法律、惯例、法令或其他规定施加 |
| | | <br/> 或默示的任何其他担保、保证和/或条件和/或因此而产生的责任。对于任何有缺陷的或不符合标准的货物,买方所适用的只有 |
| | | <br/> 本条特别规定的救济。 |
| | | <br/> 14. WARRANTY: |
| | | <br/> A.The Seller warrant that the goods hereof is made of the best materials with first class workmanship, |
| | | brand new and unused and |
| | | <br/> complies in all respects with the quality and specification stipulated in this Contract. |
| | | <br/> The warranty period shall be three months for accessory, 1-3 years for instrument. |
| | | <br/> counting from the date on which the goods have been accepted by the end user but limited to a maximum |
| | | of |
| | | <br/> {!contra.QAeng2} from the date of shipment. |
| | | <br/> Within the warranty period, the Seller shall be liable for the damage incurred on account of the |
| | | defects attributable to the design |
| | | <br/> and emerging during the course of manufacturing of the Seller’s side if the Buyer operate under |
| | | regular conditions in accordance |
| | | <br/> with the instruction to the equipments or the machines. Within the warranty period, if some important |
| | | units and parts of the goods |
| | | <br/> need to change, the warranty period of the new units and parts should be counted from the changing |
| | | date. If the new units and |
| | | <br/> parts are bought from the third party, the warranty period of the new units and parts should be |
| | | counted according to the original suppliers. |
| | | <br/> B.In case there’s any missing parts & machines which are out of the agreed scope of supply and |
| | | most possibly would influence |
| | | <br/> the commissioning or production on time, the Seller has the obligation and responsibility to discuss |
| | | with Buyer to make concerned |
| | | <br/> adjustments and amendments to warrant the acceptance of the goods. |
| | | <br/> C. The warranty set out in this Contract is the only warranty applicable to the goods supplied pursuant |
| | | to this Contract. This |
| | | <br/> warranty replaces and excludes any other guarantee, warranty and/or condition imposed or implied |
| | | by law, custom, statute or |
| | | <br/> otherwise and/or resulting liabilities. Only those remedies specifically set out in this clause |
| | | are available to the Buyer |
| | | <br/> in respect of any defective or non-conforming goods. |
| | | <br/> |
| | | </td> |
| | | </tr> |
| | | 8) All the documents not with cargo |
| | | </apex:outputPanel> |
| | | </table> |
| | | <!--<apex:outputPanel layout="none"> |
| | | <div style="page-break-after: always;"/> |
| | | </apex:outputPanel>--> |
| | | <table style="font-size: 9pt;"> |
| | | <tr> |
| | | <td> |
| | | 15. 检验与索赔: |
| | | <br/> (1)交货之前,制造厂应对货物的质量规格、性能和数量进行精确和全面的检查并出具证明货物与本合同规定相符的证明书。 |
| | | <br/> (2)货物到目的港或目的地后90天内,以较早者为准,买方應向中国出入境检验检疫局申请对有关货物的质量、规格和数量进 |
| | | <br/> 行初步检验并由其出具检验报告。如中国出入境检验检疫局发现到货物的规格或/和数量与本合同规定不符,除应由保险公司或 |
| | | <br/> 船运公司负责外,买方有权拒收货物或向卖方提出赔偿。 |
| | | <br/> (3)如货物的质量和规格与本合同不符,或在本合同第13条规定的保证期内证明货物有缺陷,买方应申请中国出入境检验检疫 |
| | | <br/> 局检验,并有权根据该检验报告向卖方提出索赔。 |
| | | <br/> (4)卖方对与本合同不符部分,应在合理的期限内无偿换货或补发短缺或贬低货价,并负担由此产生的一切费用和损失,包括: |
| | | <br/> 利息、银行费用、运费、保险费、检验费、仓储、码头装卸费以及其他一切必要费用。 |
| | | <br/> 15. INSPECTION AND CLAIMS: |
| | | <br/> (1)The manufacturer shall,before making delivery,make a precise and comprehensive inspection of the |
| | | goods with regard |
| | | <br/> to the quality, specification and quantity and issue certificates certifying that the goods are in conformity |
| | | with the stipulations of |
| | | <br/> the Contract. |
| | | <br/> (2)Within ninety (90) days after arrival of the goods at the port of destination or the place of destination, |
| | | whichever is the earlier, |
| | | <br/> the Buyer shall apply to the China Entry & Exit Inspection & Quarantine Bureau (CIQ) for a preliminary |
| | | inspection in respect of the |
| | | <br/> quality, specification and quantity of the goods and a survey report shall be issued thereof. If discrepancies |
| | | are found by the CIQ |
| | | <br/> regarding specifications or the quantity or both, except when the responsibilities lie with Insurance |
| | | Company or Shipping Company, |
| | | <br/> the Buyer has the right to reject the goods or to claim against the Seller. |
| | | <br/> (3)Should the quality and specification of the goods not in conformity with the Contract or should the |
| | | goods be proved defective |
| | | <br/> during the warranty period stipulated in Clause 13, the Buyer shall arrange for a survey to be carried |
| | | out by the CIQ and have the |
| | | <br/> right to claim against the Seller on the strength of the survey report. |
| | | <br/> (4)For any goods which are not in conformity with the Contract, the Seller,within a reasonable time,shall |
| | | make replacement |
| | | <br/>free of charge,deliver the short ones or devalue the goods and bear all the charges and losing incurred |
| | | thereof. The charges |
| | | <br/>include interest, banking charges, freight, premium, inspecting charges, storing charges, discharging |
| | | charges and other charges |
| | | <br/>incurred since the goods are not in conformity with the contract. |
| | | </td> |
| | | </tr> |
| | | <!-- </table> |
| | | <apex:outputPanel layout="none"> |
| | | <div style="page-break-after: always;"/> |
| | | </apex:outputPanel> |
| | | <table style="font-size: 9pt;">--> |
| | | <tr> |
| | | <td> |
| | | 16. 人力不可抗拒事故: |
| | | <br/> 由于在生产、装运过程中发生的人力不可抗拒事故(如:战争、严重火灾、水灾、台风、地震以及双方均认为属于人不可抗拒事故) |
| | | <br/> 而使得卖方延期装船或不能交货,卖方可不负担责任。但是卖方应在上述事故发生后立即传真通知买方,并在传真后14天内,提供 |
| | | <br/> 不可抗拒事故发生地域的主管政府当局或商会出具的证件,空邮交买方以资证明。在此情况下,卖方仍须采取一切必要措施加速货 |
| | | <br/> 物的发运。如不可抗拒事故延续90天以上,任何一方有权向另一方发出书面通知中止本合同。 |
| | | <br/> 16. FORCE MAJEURE: |
| | | <br/> The Seller shall not be held responsible for the delay in shipment or non-delivery of the goods due |
| | | to force majeure, such as war, |
| | | <br/> serious fire, flood, typhoon and earthquake occur during the process of manufacturing or in the course |
| | | of loading or transit. The |
| | | <br/> Seller shall immediately advise the Buyer by fax of the occurrence mentioned above and within fourteen |
| | | (14) days thereafter, the |
| | | <br/> Seller shall send by airmail to the Buyer for their acceptance a certificate of the accident issued |
| | | by the competent government |
| | | <br/> authorities or the Chamber of Commerce where the accident occurs as evidence thereof. Under such circumstance |
| | | the Seller, |
| | | <br/> however, are still under the obligation to take all necessary measures to hasten the delivery of the |
| | | goods. In case the accident lasts |
| | | <br/> for more than ninety (90) days, both parties shall have the right to terminate this Contract by written |
| | | notice to the other party. |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td> |
| | | 17. 迟交货物及违约金: |
| | | <br/> 除本合同第15条所规定的不可抗拒事故原因外,如卖方不能按合同规定准时交货,在卖方同意承担 |
| | | <br/> 迟交违约金并由付款銀行在支付货款时扣除的条件下,买方应同意延期交货。但迟交违约金总额不 |
| | | <br/> 應超过合同总额的5%。迟交违约金率为每七(7)天千分之五,不足七(7)天者应按七(7)天计算。 |
| | | <br/>如延期交货超过本合同所规定的装运期十(10)周,买方有权向卖方发出书面通知中止本合同。 |
| | | <br/> 17. LATE DELIVERY AND LIQUIDATED DAMAGES: |
| | | <br/> Should the Seller fail to make delivery on time as stipulated in the Contract with the exception of |
| | | force majeure causes specified in |
| | | <br/> Clause 15 of this Contract, the Buyer shall agree to postpone the delivery on the condition that the |
| | | Seller agree to pay a liquidated |
| | | <br/> damages which shall be deducted by the paying bank from the payment under negotiation. The liquidated |
| | | damages, however, shall |
| | | <br/> not exceed five percent (5%) of the total value of the goods involved in the late delivery. The rate |
| | | of liquidated damages is charge |
| | | <br/> at one half percent (0.5%) for every seven (7) days, odd days less than seven (7) days should count |
| | | as seven (7) days. In case the |
| | | <br/> late delivery exceed ten (10) weeks of the time of shipment stipulated in the Contract, the Buyer shall |
| | | have the right to terminate |
| | | <br/> this Contract by written notice to the Seller. |
| | | <br/> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td> |
| | | 18. 专利权: |
| | | <br/> 卖方必须保障买方在中国使用其货物及其任何部分不受到第三方关于侵犯专利权、商标权或工业设计权的指控。任何第三方如果提出侵 |
| | | <br/> 权指控,卖方须与第三方交涉并承担由此引起的一切法律责任和费用。 |
| | | <br/> 18. PATENT RIGHTS |
| | | <br/> The Seller shall indemnify the Buyer against all third-party claims of infringement of patent, trademark, |
| | | or industrial design rights |
| | | <br/> arising from use of the goods or any part thereof in China. In case any third party brings a charge |
| | | of infringement, the Seller shall |
| | | <br/> negotiate with the third-party and be liable for any legal duty and expenses. |
| | | <br/> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td> |
| | | 19. 合同文件及资料的使用: |
| | | <br/> (1)在未经买方书面同意的情况下,卖方不得将由买方或代表买方提供的有关合同条文、规格、计划、图纸、模型、样品或资料提供 |
| | | <br/> 给与履行本合同无关的任何人。即使向与履行本合同有关的人员提供,也应注意保密并仅限于履行合同必须的范围。 |
| | | <br/> (2)除非执行合同需要,在事先未得到买方书面同意的情况下,卖方不得使用条款(1)中所列举的任何文件和资料。 |
| | | <br/> (3)除合同本身外,条款(1)列明的所有文件始终为买方的财产,若买方要求,卖方应于其合同义务履行完毕以后将这些文件及全 |
| | | <br/> 部复制件退还给买方。 |
| | | <br/> 19. USE OF CONTRACT’S DOCUMENTS AND INFORMATION: |
| | | <br/> (1) The Seller shall not, without the Buyer’s prior written consent, disclose this Contract, or any |
| | | provision hereof, or any |
| | | <br/> specification, plan, drawing, pattern, sample, or information furnished by or on behalf of the Buyer |
| | | in connection therewith, to any |
| | | <br/> person other than the person employed by the Seller in the performance of this Contract. Disclosure |
| | | to any such employed person |
| | | <br/> shall be made in confidence and shall extend only so far as may be necessary for purposes of such performance. |
| | | <br/> (2) The Seller shall not, without the Buyer’s prior written consent, make use of any document or information |
| | | enumerated in |
| | | <br/> Clause (1) except for purposes of performing this Contract. |
| | | <br/> (3) Any document, other than this Contract itself, enumerated in Clause (1) shall remain the property |
| | | of the Buyer and shall be |
| | | <br/> returned (including all copies) to the Buyer on completion of the Seller’s performance under this Contract |
| | | if so required by the Buyer. |
| | | <br/> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td> |
| | | 20. 仲裁: |
| | | <br/> 与本合同有关的或因执行本合同所发生的一切争执,由签订合同的双方友好协商解决。若不能解决时,案件可提交中国国际经济贸易 |
| | | <br/> 仲裁委员会仲裁。仲裁按原合同进行。仲裁委员会的裁决为最终决定,签约双方都应服从;任何一方均不得向法院或其他当局求助申 |
| | | <br/> 请修改该裁决。或者在双方同意的第三国或地区进行仲裁。仲裁费用由双方方负担。在仲裁期间,除了在仲裁过程中进行仲裁的部分 |
| | | <br/> 外,本合同应继续执行。 |
| | | <br/> 20. ARBITRA |
| | | <br/> All disputes in connection with this Contract or the execution thereof shall be settled friendly through |
| | | negotiation by the parties hereof. |
| | | <br/> In case no settlement can be reached, the case may then be submitted for arbitration to the China International |
| | | Economic and Trade |
| | | <br/> Arbitration Commission, in accordance with the Rulers of Procedures promulgated by they said Arbitration |
| | | Commission. The |
| | | <br/> arbitration shall take place in China and the decision of the Arbitration Commission shall be final |
| | | and binding upon both parties, |
| | | <br/> neither party shall seek recourse to a law court or other authorities to appeal to revision of the decision. |
| | | Or the arbitration may be |
| | | <br/> taken place in a third country or place mutually agreed by both parties. Arbitration fee shall be borne |
| | | by continue to execute |
| | | <br/> this Contract except those under arbitration. |
| | | <br/> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | <!-- <apex:outputPanel layout="none"> |
| | | <div style="page-break-after: always;"/> |
| | | </apex:outputPanel> --> |
| | | <table style="font-size: 9pt;"> |
| | | <colgroup> |
| | | <col width="50%" /> |
| | | <col width="50%" /> |
| | | </colgroup> |
| | | <tr> |
| | | <td colspan="2"> |
| | | 21. 进出口许可证: |
| | | <br/> 进口本合同项下货物所需的中国政府及海关要求的进口许可证和其他进口文件由买方负责办理。出口本合同项下货物所需的出口国政 |
| | | <br/> 府及海关要求的出口许可证和其他出口文件由卖方负责办理。 |
| | | <br/> 21. IMPORT AND EXPORT LICENCES: |
| | | <br/> It is the responsibility of the Buyer to arrange import licenses or other import documents, if required |
| | | for the goods covered by this |
| | | <br/> Contract from the Chinese Government and Custom at the Buyer’s expense. It is the responsibility of |
| | | the Seller to arrange export |
| | | <br/> licenses or other export documents, if required for the Goods covered by this Contract from its country |
| | | Government and Custom at |
| | | <br/> the Seller’s expense. |
| | | <br/> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td colspan="2"> |
| | | 22. 税费: |
| | | <br/> 中国政府根据现行税法向买方征收的与履行本合同有关的一切税费由买方支付。 |
| | | <br/> 中国政府根据现行税法向卖方征收的与履行本合同有关的一切税费由卖方支付。 |
| | | <br/> 发生在中国境外的,与履行本合同有关的一切税费,应由卖方承担。 |
| | | <br/> 22. TAX AND DUTIES: |
| | | <br/> All taxes in connection with the execution of this Contract levied by the Chinese Government on the |
| | | Buyer in accordance with the |
| | | <br/> tax laws in effect shall be borne by the Buyer.All taxes in connection with the execution of this Contract |
| | | levied by the Chinese |
| | | <br/> Government on the Seller in accordance with the tax laws in effect shall be borne by the Seller. All |
| | | taxes arising outside China in |
| | | <br/> connection with the execution of this Contract shall be borne by the Seller. |
| | | <br/> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td colspan="2"> |
| | | 23.适用法律: |
| | | <br/> 本合同应按照中华人民共和国的法律管辖及解释。 |
| | | <br/> 23. APPLICABLE LAW: |
| | | <br/> This Contract shall be governed and construed in accordance with the laws of People’s Republic of China. |
| | | <br/> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td colspan="2"> |
| | | 24.其他: |
| | | <br/> (1)本合同应以中文和英文书写,如中文和英文版本之间有任何不一致,则以英文本为主。技术图纸,买卖双方的所有函电以及与合 |
| | | <br/> 同有关的文件均应以中文或英文书写。 |
| | | <br/> (2)除技术规格中另有规定外,计量单位均使用公制。 |
| | | <br/> (3)欲对合同条款做出任何修改,均须由买卖双方签署书面的合同修改书。 |
| | | <br/> (4)本合同所有附件将是本合同不可分割的组成部分并具有同等效力。 |
| | | <br/> (5)未在本合同中说明的商务惯例应符合INCOTERMS 2000条款的规定。 |
| | | <br/> (6)本合同由买卖双方签订后立即生效。 |
| | | <br/> 此合同由买卖双方签署正本 {!contra.order.PDF_Co_Contract__c}份。 买方持有 {!contra.order.PDF_Co_BContra__c}份。 |
| | | 卖方持有 {!contra.order.PDF_Co_SContra__c}份。 |
| | | <br/> 24. OTHERS: |
| | | <br/> (1)This Contract shall be written in both Chinese and English, in case there is any inconsistency between |
| | | the Chinese version |
| | | <br/> and the English version, the English version shall prevail. The technical drawings, all correspondence |
| | | and other documents |
| | | <br/>pertaining to this Contract exchanged by the parties shall be written in Chinese or English. |
| | | <br/> (2)All measurement shall be in SI unit, unless otherwise specified in the Technical Specifications. |
| | | <br/> (3)No variation in or modification of the terms of this Contract shall be valid except by written amendment |
| | | signed by the parties. |
| | | <br/> (4)All appendixes to this Contract shall be formed as an integral part of this Contract and shall be |
| | | equally effective. |
| | | <br/> (5) The commercial customs not described in this Contract shall be in accordance with the terms and |
| | | conditions of INCOTERMS |
| | | <br/> 2000. |
| | | <br/> (6)This Contract shall become effective upon execution by the Buyer and the Seller. |
| | | <br/> Both parties sign this Contract in {!contra.order.PDF_Co_Contract_E__c} .The buyer holds {!contra.order.PDF_Co_BContra_E__c} |
| | | .The seller holds {!contra.order.PDF_Co_SContra_E__c} . |
| | | <br/> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td style="vertical-align: top;"> |
| | | 卖方: 仪景通光学科技(上海)有限公司 |
| | | </td> |
| | | <td style="vertical-align: top;"> |
| | | 买方: {!specialDeliveryAddress.Name} |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td style="vertical-align: top;"> |
| | | THE SELLER: Evident (Shanghai) Co., Ltd |
| | | </td> |
| | | <td style="vertical-align: top;"> |
| | | THE BUYER: {!specialDeliveryAddress.EnglishName__c} |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td> |
| | | For and on behalf of |
| | | </td> |
| | | <td> |
| | | For and on behalf of |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td> |
| | | [*] |
| | | </td> |
| | | <td> |
| | | [*] |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td colspan="2" height="100px"></td> |
| | | </tr> |
| | | <tr> |
| | | <td> |
| | | 签名: |
| | | </td> |
| | | <td> |
| | | 签名: |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <!-- <apex:outputPanel rendered="{!IF((Opp.ProductSegment__c = 'NDT' || Opp.ProductSegment__c = 'ANI' ), 'false', 'true')}" layout="none"> |
| | | <td> |
| | | Name: Mitsuyuki Shirakawa |
| | | </td> |
| | | </apex:outputPanel> |
| | | <apex:outputPanel rendered="{!IF((Opp.ProductSegment__c = 'NDT' || Opp.ProductSegment__c = 'ANI' ), 'true', 'true')}" layout="none"> --> |
| | | <td> |
| | | Name: Yoshito Sato |
| | | </td> |
| | | <!-- </apex:outputPanel> --> |
| | | <td> |
| | | Name: {!contra.order.PDF_Sign_Name__c} |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td> |
| | | Title: Division Manager |
| | | </td> |
| | | <td> |
| | | Title: |
| | | <span id="PDF_Sign_Title__c">{!contra.order.PDF_Sign_Title__c}</span> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td> |
| | | 日期: |
| | | </td> |
| | | <td> |
| | | 日期: |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td> |
| | | Signed on |
| | | </td> |
| | | <td> |
| | | Signed on |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | </div> |
| | | </apex:outputPanel> |
| | | </td> |
| | | </tr> |
| | | |
| | | <tr> |
| | | <td> |
| | | 13. 装运通知:<br/> |
| | | 卖方应于发货四十八(48)小时内以传真或电邮形式提供发货通知告知买方合同号、货物名称、实装数量、重量、件数、发票价<br/> |
| | | 值、航班号及日期、空运单号等<br/> |
| | | 13. SHIPPING ADVICE: <br/> |
| | | The Seller, within forty eight (48) hours after shipment is made, shall notify the Buyer of the contract no., name ofgoods, <br/> |
| | | quantity, weight loaded, number of packages, invoice value, flight number and date, air waybill number etc. by fax or email.<br/> |
| | | </td> |
| | | </tr> |
| | | <apex:outputPanel rendered="{!IF(Opp.ProductSegment__c = 'BS' || Opp.ProductSegment__c = 'IE' || Opp.ProductSegment__c = 'RVI', 'true', 'false')}" layout="none"> |
| | | <tr> |
| | | <td> |
| | | 14. 质量保证:<br/> |
| | | A. 卖方保证本合同之货物是用最好的材料以上等的工艺制造,崭新及未用过的,其质量与规格一切方面与本合同的规定相符。<br/> |
| | | 保证期为最终验收报告签署之日起的{!contra.QAeng}但不超过发货日后的{!contra.QAeng4}。<br/> |
| | | 在保证期内,如买方按照货物使用说明书在正常条件下使用,由于卖方设计或制造上的缺陷而发生的损坏,由卖方负责。<br/> |
| | | 在保证期内如果货物的重要零部件需要更换,则该零部件的保证期从更换之日起重新计算,外购件以原供应商的保证期为准。<br/> |
| | | B. 如果双方共同商定并确认的供货范围中有遗漏的部件和设备并有可能导致整套货物不能按时验收投产或影响生产,卖方<br/> |
| | | 有义务和责任在制造过程中与买方商量做出相应的调整和补救,并保证整套以上货物能通过验收。<br/> |
| | | C. 本合同中所述的保证是适用于根据合同货物提供的的唯一保证。本保证条款取代并排除法律、惯例、法令或其他规定施加<br/> |
| | | 或默示的任何其他担保、保证和/或条件和/或因此而产生的责任。对于任何有缺陷的或不符合标准的货物,买方所适用的只有<br/> |
| | | 本条特别规定的救济。<br/> |
| | | 14. WARRANTY:<br/> |
| | | A.The Seller warrant that the goods hereof is made of the best materials with first class workmanship, brand new and<br/> |
| | | unused and complies in all respects with the quality and specification stipulated in this Contract.<br/> |
| | | The warranty period shall be {!contra.QAeng3}counting from the date on which the goods have been accepted by the end user<br/> |
| | | but limited to a maximum of {!contra.QAeng2} from the date of shipment. <br/> |
| | | Within the warranty period, the Seller shall be liable for the damage incurred on account of the defects attributable to the design<br/> |
| | | and emerging during the course of manufacturing of the Seller’s side if the Buyer operate under regular conditions in accordance<br/> |
| | | with the instruction to the equipments or the machines. Within the warranty period, if some important units and parts of the goods<br/> |
| | | need to change, the warranty period of the new units and parts should be counted from the changing date. If the new units and<br/> |
| | | parts are bought from the third party, the warranty period of the new units and parts should be counted according to the original suppliers.<br/> |
| | | B.In case there’s any missing parts & machines which are out of the agreed scope of supply and most possibly would influence <br/> |
| | | the commissioning or production on time, the Seller has the obligation and responsibility to discuss with Buyer to make concerned <br/> |
| | | adjustments and amendments to warrant the acceptance of the goods.<br/> |
| | | C. The warranty set out in this Contract is the only warranty applicable to the goods supplied pursuant to this Contract. This<br/> |
| | | warranty replaces and excludes any other guarantee, warranty and/or condition imposed or implied by law, custom, statute or <br/> |
| | | otherwise and/or resulting liabilities. Only those remedies specifically set out in this clause are available to the Buyer<br/> |
| | | in respect of any defective or non-conforming goods.<br/> |
| | | </td> |
| | | </tr> |
| | | </apex:outputPanel> |
| | | <apex:outputPanel rendered="{!IF(Opp.ProductSegment__c = 'NDT' || Opp.ProductSegment__c = 'ANI', 'true', 'false')}" layout="none"> |
| | | <tr> |
| | | <td> |
| | | 14. 质量保证:<br/> |
| | | A. 卖方保证本合同之货物是用最好的材料以上等的工艺制造,崭新及未用过的,其质量与规格一切方面与本合同的规定相符。<br/> |
| | | 保证期配件为3个月,主机为1年至3年,根据产品具体型号确定。<br/> |
| | | 在保证期内,如买方按照货物使用说明书在正常条件下使用,由于卖方设计或制造上的缺陷而发生的损坏,由卖方负责。<br/> |
| | | 在保证期内如果货物的重要零部件需要更换,则该零部件的保证期从更换之日起重新计算,外购件以原供应商的保证期为准。<br/> |
| | | B. 如果双方共同商定并确认的供货范围中有遗漏的部件和设备并有可能导致整套货物不能按时验收投产或影响生产,卖方<br/> |
| | | 有义务和责任在制造过程中与买方商量做出相应的调整和补救,并保证整套以上货物能通过验收。<br/> |
| | | C. 本合同中所述的保证是适用于根据合同货物提供的的唯一保证。本保证条款取代并排除法律、惯例、法令或其他规定施加<br/> |
| | | 或默示的任何其他担保、保证和/或条件和/或因此而产生的责任。对于任何有缺陷的或不符合标准的货物,买方所适用的只有<br/> |
| | | 本条特别规定的救济。<br/> |
| | | 14. WARRANTY:<br/> |
| | | A.The Seller warrant that the goods hereof is made of the best materials with first class workmanship, brand new and unused and<br/> |
| | | complies in all respects with the quality and specification stipulated in this Contract. <br/> |
| | | The warranty period shall be three months for accessory, 1-3 years for instrument.<br/> |
| | | counting from the date on which the goods have been accepted by the end user but limited to a maximum of<br/> |
| | | {!contra.QAeng2} from the date of shipment. <br/> |
| | | Within the warranty period, the Seller shall be liable for the damage incurred on account of the defects attributable to the design<br/> |
| | | and emerging during the course of manufacturing of the Seller’s side if the Buyer operate under regular conditions in accordance<br/> |
| | | with the instruction to the equipments or the machines. Within the warranty period, if some important units and parts of the goods<br/> |
| | | need to change, the warranty period of the new units and parts should be counted from the changing date. If the new units and<br/> |
| | | parts are bought from the third party, the warranty period of the new units and parts should be counted according to the original suppliers.<br/> |
| | | B.In case there’s any missing parts & machines which are out of the agreed scope of supply and most possibly would influence <br/> |
| | | the commissioning or production on time, the Seller has the obligation and responsibility to discuss with Buyer to make concerned <br/> |
| | | adjustments and amendments to warrant the acceptance of the goods.<br/> |
| | | C. The warranty set out in this Contract is the only warranty applicable to the goods supplied pursuant to this Contract. This<br/> |
| | | warranty replaces and excludes any other guarantee, warranty and/or condition imposed or implied by law, custom, statute or <br/> |
| | | otherwise and/or resulting liabilities. Only those remedies specifically set out in this clause are available to the Buyer<br/> |
| | | in respect of any defective or non-conforming goods.<br/> |
| | | </td> |
| | | </tr> |
| | | </apex:outputPanel> |
| | | </table> |
| | | <!--<apex:outputPanel layout="none"> |
| | | <div style="page-break-after: always;"/> |
| | | </apex:outputPanel>--> |
| | | <table style="font-size: 9pt;"> |
| | | <tr> |
| | | <td> |
| | | 15. 检验与索赔:<br/> |
| | | (1)交货之前,制造厂应对货物的质量规格、性能和数量进行精确和全面的检查并出具证明货物与本合同规定相符的证明书。<br/> |
| | | (2)货物到目的港或目的地后90天内,以较早者为准,买方應向中国出入境检验检疫局申请对有关货物的质量、规格和数量进<br/> |
| | | 行初步检验并由其出具检验报告。如中国出入境检验检疫局发现到货物的规格或/和数量与本合同规定不符,除应由保险公司或<br/> |
| | | 船运公司负责外,买方有权拒收货物或向卖方提出赔偿。<br/> |
| | | (3)如货物的质量和规格与本合同不符,或在本合同第13条规定的保证期内证明货物有缺陷,买方应申请中国出入境检验检疫<br/> |
| | | 局检验,并有权根据该检验报告向卖方提出索赔。<br/> |
| | | (4)卖方对与本合同不符部分,应在合理的期限内无偿换货或补发短缺或贬低货价,并负担由此产生的一切费用和损失,包括:<br/> |
| | | 利息、银行费用、运费、保险费、检验费、仓储、码头装卸费以及其他一切必要费用。<br/> |
| | | 15. INSPECTION AND CLAIMS:<br/> |
| | | (1)The manufacturer shall,before making delivery,make a precise and comprehensive inspection of the goods with regard<br/> |
| | | to the quality, specification and quantity and issue certificates certifying that the goods are in conformity with the stipulations of<br/> |
| | | the Contract. <br/> |
| | | (2)Within ninety (90) days after arrival of the goods at the port of destination or the place of destination, whichever is the earlier,<br/> |
| | | the Buyer shall apply to the China Entry & Exit Inspection & Quarantine Bureau (CIQ) for a preliminary inspection in respect of the<br/> |
| | | quality, specification and quantity of the goods and a survey report shall be issued thereof. If discrepancies are found by the CIQ<br/> |
| | | regarding specifications or the quantity or both, except when the responsibilities lie with Insurance Company or Shipping Company,<br/> |
| | | the Buyer has the right to reject the goods or to claim against the Seller.<br/> |
| | | (3)Should the quality and specification of the goods not in conformity with the Contract or should the goods be proved defective <br/> |
| | | during the warranty period stipulated in Clause 13, the Buyer shall arrange for a survey to be carried out by the CIQ and have the<br/> |
| | | right to claim against the Seller on the strength of the survey report.<br/> |
| | | (4)For any goods which are not in conformity with the Contract, the Seller,within a reasonable time,shall make replacement <br/>free of charge,deliver the short ones or devalue the goods and bear all the charges and losing incurred thereof. The charges <br/>include interest, banking charges, freight, premium, inspecting charges, storing charges, discharging charges and other charges <br/>incurred since the goods are not in conformity with the contract. |
| | | </td> |
| | | </tr> |
| | | <!-- </table> |
| | | <apex:outputPanel layout="none"> |
| | | <div style="page-break-after: always;" /> |
| | | <div style="page-break-after: always;"/> |
| | | </apex:outputPanel> |
| | | <table style="font-size: 9pt;">--> |
| | | <tr> |
| | | <td> |
| | | 16. 人力不可抗拒事故:<br/> |
| | | 由于在生产、装运过程中发生的人力不可抗拒事故(如:战争、严重火灾、水灾、台风、地震以及双方均认为属于人不可抗拒事故)<br/> |
| | | 而使得卖方延期装船或不能交货,卖方可不负担责任。但是卖方应在上述事故发生后立即传真通知买方,并在传真后14天内,提供<br/> |
| | | 不可抗拒事故发生地域的主管政府当局或商会出具的证件,空邮交买方以资证明。在此情况下,卖方仍须采取一切必要措施加速货<br/> |
| | | 物的发运。如不可抗拒事故延续90天以上,任何一方有权向另一方发出书面通知中止本合同。<br/> |
| | | 16. FORCE MAJEURE:<br/> |
| | | The Seller shall not be held responsible for the delay in shipment or non-delivery of the goods due to force majeure, such as war,<br/> |
| | | serious fire, flood, typhoon and earthquake occur during the process of manufacturing or in the course of loading or transit. The<br/> |
| | | Seller shall immediately advise the Buyer by fax of the occurrence mentioned above and within fourteen (14) days thereafter, the<br/> |
| | | Seller shall send by airmail to the Buyer for their acceptance a certificate of the accident issued by the competent government<br/> |
| | | authorities or the Chamber of Commerce where the accident occurs as evidence thereof. Under such circumstance the Seller, <br/> |
| | | however, are still under the obligation to take all necessary measures to hasten the delivery of the goods. In case the accident lasts <br/> |
| | | for more than ninety (90) days, both parties shall have the right to terminate this Contract by written notice to the other party. |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td> |
| | | 17. 迟交货物及违约金:<br/> |
| | | 除本合同第15条所规定的不可抗拒事故原因外,如卖方不能按合同规定准时交货,在卖方同意承担<br/> |
| | | 迟交违约金并由付款銀行在支付货款时扣除的条件下,买方应同意延期交货。但迟交违约金总额不<br/> |
| | | 應超过合同总额的5%。迟交违约金率为每七(7)天千分之五,不足七(7)天者应按七(7)天计算。<br/>如延期交货超过本合同所规定的装运期十(10)周,买方有权向卖方发出书面通知中止本合同。<br/> |
| | | 17. LATE DELIVERY AND LIQUIDATED DAMAGES: <br/> |
| | | Should the Seller fail to make delivery on time as stipulated in the Contract with the exception of force majeure causes specified in <br/> |
| | | Clause 15 of this Contract, the Buyer shall agree to postpone the delivery on the condition that the Seller agree to pay a liquidated <br/> |
| | | damages which shall be deducted by the paying bank from the payment under negotiation. The liquidated damages, however, shall<br/> |
| | | not exceed five percent (5%) of the total value of the goods involved in the late delivery. The rate of liquidated damages is charge <br/> |
| | | at one half percent (0.5%) for every seven (7) days, odd days less than seven (7) days should count as seven (7) days. In case the<br/> |
| | | late delivery exceed ten (10) weeks of the time of shipment stipulated in the Contract, the Buyer shall have the right to terminate<br/> |
| | | this Contract by written notice to the Seller.<br/> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td> |
| | | 18. 专利权:<br/> |
| | | 卖方必须保障买方在中国使用其货物及其任何部分不受到第三方关于侵犯专利权、商标权或工业设计权的指控。任何第三方如果提出侵<br/> |
| | | 权指控,卖方须与第三方交涉并承担由此引起的一切法律责任和费用。<br/> |
| | | 18. PATENT RIGHTS<br/> |
| | | The Seller shall indemnify the Buyer against all third-party claims of infringement of patent, trademark, or industrial design rights <br/> |
| | | arising from use of the goods or any part thereof in China. In case any third party brings a charge of infringement, the Seller shall<br/> |
| | | negotiate with the third-party and be liable for any legal duty and expenses.<br/> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td> |
| | | 19. 合同文件及资料的使用: <br/> |
| | | (1)在未经买方书面同意的情况下,卖方不得将由买方或代表买方提供的有关合同条文、规格、计划、图纸、模型、样品或资料提供<br/> |
| | | 给与履行本合同无关的任何人。即使向与履行本合同有关的人员提供,也应注意保密并仅限于履行合同必须的范围。<br/> |
| | | (2)除非执行合同需要,在事先未得到买方书面同意的情况下,卖方不得使用条款(1)中所列举的任何文件和资料。<br/> |
| | | (3)除合同本身外,条款(1)列明的所有文件始终为买方的财产,若买方要求,卖方应于其合同义务履行完毕以后将这些文件及全<br/> |
| | | 部复制件退还给买方。<br/> |
| | | 19. USE OF CONTRACT’S DOCUMENTS AND INFORMATION: <br/> |
| | | (1) The Seller shall not, without the Buyer’s prior written consent, disclose this Contract, or any provision hereof, or any<br/> |
| | | specification, plan, drawing, pattern, sample, or information furnished by or on behalf of the Buyer in connection therewith, to any <br/> |
| | | person other than the person employed by the Seller in the performance of this Contract. Disclosure to any such employed person<br/> |
| | | shall be made in confidence and shall extend only so far as may be necessary for purposes of such performance. <br/> |
| | | (2) The Seller shall not, without the Buyer’s prior written consent, make use of any document or information enumerated in<br/> |
| | | Clause (1) except for purposes of performing this Contract.<br/> |
| | | (3) Any document, other than this Contract itself, enumerated in Clause (1) shall remain the property of the Buyer and shall be<br/> |
| | | returned (including all copies) to the Buyer on completion of the Seller’s performance under this Contract if so required by the Buyer. <br/> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td> |
| | | 20. 仲裁:<br/> |
| | | 与本合同有关的或因执行本合同所发生的一切争执,由签订合同的双方友好协商解决。若不能解决时,案件可提交中国国际经济贸易<br/> |
| | | 仲裁委员会仲裁。仲裁按原合同进行。仲裁委员会的裁决为最终决定,签约双方都应服从;任何一方均不得向法院或其他当局求助申<br/> |
| | | 请修改该裁决。或者在双方同意的第三国或地区进行仲裁。仲裁费用由双方方负担。在仲裁期间,除了在仲裁过程中进行仲裁的部分<br/> |
| | | 外,本合同应继续执行。<br/> |
| | | 20. ARBITRA<br/> |
| | | All disputes in connection with this Contract or the execution thereof shall be settled friendly through negotiation by the parties hereof.<br/> |
| | | In case no settlement can be reached, the case may then be submitted for arbitration to the China International Economic and Trade<br/> |
| | | Arbitration Commission, in accordance with the Rulers of Procedures promulgated by they said Arbitration Commission. The <br/> |
| | | arbitration shall take place in China and the decision of the Arbitration Commission shall be final and binding upon both parties, <br/> |
| | | neither party shall seek recourse to a law court or other authorities to appeal to revision of the decision. Or the arbitration may be <br/> |
| | | taken place in a third country or place mutually agreed by both parties. Arbitration fee shall be borne by continue to execute<br/> |
| | | this Contract except those under arbitration. <br/> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | <!-- <apex:outputPanel layout="none"> |
| | | <div style="page-break-after: always;"/> |
| | | </apex:outputPanel> --> |
| | | <table style="font-size: 9pt;"> |
| | | <colgroup> |
| | | <col width="50%"/> |
| | | <col width="50%"/> |
| | | </colgroup> |
| | | <tr> |
| | | <td colspan = "2"> |
| | | 21. 进出口许可证:<br/> |
| | | 进口本合同项下货物所需的中国政府及海关要求的进口许可证和其他进口文件由买方负责办理。出口本合同项下货物所需的出口国政<br/> |
| | | 府及海关要求的出口许可证和其他出口文件由卖方负责办理。<br/> |
| | | 21. IMPORT AND EXPORT LICENCES: <br/> |
| | | It is the responsibility of the Buyer to arrange import licenses or other import documents, if required for the goods covered by this <br/> |
| | | Contract from the Chinese Government and Custom at the Buyer’s expense. It is the responsibility of the Seller to arrange export<br/> |
| | | licenses or other export documents, if required for the Goods covered by this Contract from its country Government and Custom at<br/> |
| | | the Seller’s expense.<br/> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td colspan = "2"> |
| | | 22. 税费:<br/> |
| | | 中国政府根据现行税法向买方征收的与履行本合同有关的一切税费由买方支付。<br/> |
| | | 中国政府根据现行税法向卖方征收的与履行本合同有关的一切税费由卖方支付。<br/> |
| | | 发生在中国境外的,与履行本合同有关的一切税费,应由卖方承担。<br/> |
| | | 22. TAX AND DUTIES:<br/> |
| | | All taxes in connection with the execution of this Contract levied by the Chinese Government on the Buyer in accordance with the<br/> |
| | | tax laws in effect shall be borne by the Buyer.All taxes in connection with the execution of this Contract levied by the Chinese<br/> |
| | | Government on the Seller in accordance with the tax laws in effect shall be borne by the Seller. All taxes arising outside China in<br/> |
| | | connection with the execution of this Contract shall be borne by the Seller. <br/> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td colspan = "2"> |
| | | 23.适用法律:<br/> |
| | | 本合同应按照中华人民共和国的法律管辖及解释。<br/> |
| | | 23. APPLICABLE LAW:<br/> |
| | | This Contract shall be governed and construed in accordance with the laws of People’s Republic of China.<br/> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td colspan = "2"> |
| | | 24.其他:<br/> |
| | | (1)本合同应以中文和英文书写,如中文和英文版本之间有任何不一致,则以英文本为主。技术图纸,买卖双方的所有函电以及与合<br/> |
| | | 同有关的文件均应以中文或英文书写。<br/> |
| | | (2)除技术规格中另有规定外,计量单位均使用公制。<br/> |
| | | (3)欲对合同条款做出任何修改,均须由买卖双方签署书面的合同修改书。<br/> |
| | | (4)本合同所有附件将是本合同不可分割的组成部分并具有同等效力。<br/> |
| | | (5)未在本合同中说明的商务惯例应符合INCOTERMS 2000条款的规定。<br/> |
| | | (6)本合同由买卖双方签订后立即生效。<br/> |
| | | 此合同由买卖双方签署正本 {!contra.order.PDF_Co_Contract__c}份。 买方持有 {!contra.order.PDF_Co_BContra__c}份。 卖方持有 {!contra.order.PDF_Co_SContra__c}份。<br/> |
| | | 24. OTHERS:<br/> |
| | | (1)This Contract shall be written in both Chinese and English, in case there is any inconsistency between the Chinese version <br/> |
| | | and the English version, the English version shall prevail. The technical drawings, all correspondence and other documents <br/>pertaining to this Contract exchanged by the parties shall be written in Chinese or English.<br/> |
| | | (2)All measurement shall be in SI unit, unless otherwise specified in the Technical Specifications.<br/> |
| | | (3)No variation in or modification of the terms of this Contract shall be valid except by written amendment signed by the parties.<br/> |
| | | (4)All appendixes to this Contract shall be formed as an integral part of this Contract and shall be equally effective.<br/> |
| | | (5) The commercial customs not described in this Contract shall be in accordance with the terms and conditions of INCOTERMS <br/> |
| | | 2000.<br/> |
| | | (6)This Contract shall become effective upon execution by the Buyer and the Seller. <br/> |
| | | Both parties sign this Contract in {!contra.order.PDF_Co_Contract_E__c} .The buyer holds {!contra.order.PDF_Co_BContra_E__c} .The seller holds {!contra.order.PDF_Co_SContra_E__c} .<br/> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td style="vertical-align: top;"> |
| | | 卖方: 仪景通光学科技(上海)有限公司 |
| | | </td> |
| | | <td style="vertical-align: top;"> |
| | | 买方: {!specialDeliveryAddress.Name} |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td style="vertical-align: top;"> |
| | | THE SELLER: Evident (Shanghai) Co., Ltd |
| | | </td> |
| | | <td style="vertical-align: top;"> |
| | | THE BUYER: {!specialDeliveryAddress.EnglishName__c} |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td> |
| | | For and on behalf of |
| | | </td> |
| | | <td> |
| | | For and on behalf of |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td> |
| | | [*] |
| | | </td> |
| | | <td> |
| | | [*] |
| | | </td> |
| | | </tr> |
| | | <tr><td colspan = "2" height="100px"></td></tr> |
| | | <tr> |
| | | <td> |
| | | 签名: |
| | | </td> |
| | | <td> |
| | | 签名: |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <!-- <apex:outputPanel rendered="{!IF((Opp.ProductSegment__c = 'NDT' || Opp.ProductSegment__c = 'ANI' ), 'false', 'true')}" layout="none"> |
| | | <td> |
| | | Name: Mitsuyuki Shirakawa |
| | | </td> |
| | | </apex:outputPanel> |
| | | <apex:outputPanel rendered="{!IF((Opp.ProductSegment__c = 'NDT' || Opp.ProductSegment__c = 'ANI' ), 'true', 'true')}" layout="none"> --> |
| | | <td> |
| | | Name: Yoshito Sato |
| | | </td> |
| | | <!-- </apex:outputPanel> --> |
| | | <td> |
| | | Name: {!contra.order.PDF_Sign_Name__c} |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td> |
| | | Title: Division Manager |
| | | </td> |
| | | <td> |
| | | Title: {!contra.order.PDF_Sign_Title__c} |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td> |
| | | 日期: |
| | | </td> |
| | | <td> |
| | | 日期: |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td> |
| | | Signed on |
| | | </td> |
| | | <td> |
| | | Signed on |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | <apex:outputPanel layout="none"> |
| | | <div style="page-break-after: always;"/> |
| | | </apex:outputPanel> |
| | | <div class="pdf-page"> |
| | | <table width="100%"> |
| | | <tr> |
| | | <td style="text-align: center;">附件</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align: center;">Appendix</td> |
| | | </tr> |
| | | </table> |
| | | <apex:outputPanel rendered="{!IF((Opp.ProductSegment__c = 'NDT' || Opp.ProductSegment__c = 'ANI' ), 'false', 'true')}" layout="none"> |
| | | <apex:variable value="{!1}" var="cnt1" /> |
| | | <apex:repeat value="{!printRecords}" var="set"> |
| | | <apex:repeat value="{!set.setPage}" var="sp"> |
| | | |
| | | <table width="100%" border="1" cellspacing="0" cellpadding="0" style="table-layout:auto;font-size: 9pt;"> |
| | | <tr> |
| | | <!-- <apex:outputPanel rendered="{!IF((Opp.ProductSegment__c = 'NDT' || Opp.ProductSegment__c = 'ANI' ), 'false', 'true')}" layout="none"> --> |
| | | <td width="50%" style="text-align: center;">EC Code</td> |
| | | <td style="text-align: center;">Quantity</td> |
| | | <!-- </apex:outputPanel> --> |
| | | <!-- <apex:outputPanel rendered="{!IF((Opp.ProductSegment__c = 'NDT' || Opp.ProductSegment__c = 'ANI' ), 'true', 'false')}" layout="none"> |
| | | <td width="25%" style="text-align: center;">U8 Code</td> |
| | | <td width="25%" style="text-align: center;">Part Number</td> |
| | | <td width="25%" style="text-align: center;">Quantity</td> |
| | | <td style="text-align: center;">Name of Goods</td> |
| | | </apex:outputPanel> --> |
| | | </tr> |
| | | <!-- <apex:outputPanel rendered="{!IF((Opp.ProductSegment__c = 'NDT' || Opp.ProductSegment__c = 'ANI' ), 'false', 'true')}" layout="none"> --> |
| | | <tr> |
| | | <td width="50%" style="text-align: center;">EC编码</td> |
| | | <td style="text-align: center;">数量</td> |
| | | </tr> |
| | | <!-- </apex:outputPanel> --> |
| | | <apex:repeat value="{!sp}" var="line"> |
| | | <tr> |
| | | <!-- <apex:outputPanel rendered="{!IF((Opp.ProductSegment__c = 'NDT' || Opp.ProductSegment__c = 'ANI' ), 'false', 'true')}" layout="none"> --> |
| | | <td style="text-align: center;"> |
| | | <apex:outputText value="{!line.productEC}" /> |
| | | </td> |
| | | <td style="text-align: center;"> |
| | | <apex:outputText value="{!line.quantity}" /> |
| | | </td> |
| | | <!-- </apex:outputPanel> --> |
| | | <!-- <apex:outputPanel rendered="{!IF((Opp.ProductSegment__c = 'NDT' || Opp.ProductSegment__c = 'ANI' ), 'true', 'false')}" layout="none"> |
| | | <td width="25%" style="text-align: center;"><apex:outputText value="{!line.U8Code}" /></td> |
| | | <td width="25%" style="text-align: center;"><apex:outputText value="{!line.productEC}" /></td> |
| | | <td width="25%" style="text-align: center;"><apex:outputText value="{!line.quantity}" /></td> |
| | | <td style="text-align: center;"><apex:outputText value="{!line.productName}" /></td> |
| | | </apex:outputPanel> --> |
| | | </tr> |
| | | </apex:repeat> |
| | | </table> |
| | | |
| | | <!-- <apex:outputPanel rendered="{!cnt1 < pageCnt - 1}" layout="none"> |
| | | <div style="page-break-after: always;"/> |
| | | </apex:outputPanel> --> |
| | | <apex:variable value="{!cnt1 + 1}" var="cnt1" /> |
| | | |
| | | </apex:repeat> |
| | | </apex:repeat> |
| | | </apex:outputPanel> |
| | | |
| | | <apex:outputPanel rendered="{!IF(Opp.ProductSegment__c = 'IE' || Opp.ProductSegment__c = 'RVI' || Opp.ProductSegment__c = 'BS' , 'false', 'true')}" |
| | | layout="none"> |
| | | |
| | | <table width="100%"> |
| | | <tr> |
| | | <td style="text-align: center;">附件</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align: center;">Appendix</td> |
| | | </tr> |
| | | </table> |
| | | <apex:outputPanel rendered="{!IF((Opp.ProductSegment__c = 'NDT' || Opp.ProductSegment__c = 'ANI' ), 'false', 'true')}" layout="none"> |
| | | <apex:variable value="{!1}" var="cnt1" /> |
| | | <apex:repeat value="{!printRecords}" var="set"> |
| | | <apex:repeat value="{!set.setPage}" var="sp"> |
| | | |
| | | <table width="100%" border="1" cellspacing="0" cellpadding="0" style="table-layout:auto;font-size: 9pt;"> |
| | | <tr> |
| | | <td width="25%" style="text-align: center;">U8 Code</td> |
| | | <td width="25%" style="text-align: center;">Part Number</td> |
| | | <td width="25%" style="text-align: center;">Quantity</td> |
| | | <td style="text-align: center;">Name of Goods</td> |
| | | <!-- <apex:outputPanel rendered="{!IF((Opp.ProductSegment__c = 'NDT' || Opp.ProductSegment__c = 'ANI' ), 'false', 'true')}" layout="none"> --> |
| | | <td width="50%" style="text-align: center;">EC Code</td> |
| | | <td style="text-align: center;">Quantity</td> |
| | | <!-- </apex:outputPanel> --> |
| | | <!-- <apex:outputPanel rendered="{!IF((Opp.ProductSegment__c = 'NDT' || Opp.ProductSegment__c = 'ANI' ), 'true', 'false')}" layout="none"> |
| | | <td width="25%" style="text-align: center;">U8 Code</td> |
| | | <td width="25%" style="text-align: center;">Part Number</td> |
| | | <td width="25%" style="text-align: center;">Quantity</td> |
| | | <td style="text-align: center;">Name of Goods</td> |
| | | </apex:outputPanel> --> |
| | | </tr> |
| | | <apex:repeat value="{!ndtList}" var="ndt"> |
| | | <!-- <apex:outputPanel rendered="{!IF((Opp.ProductSegment__c = 'NDT' || Opp.ProductSegment__c = 'ANI' ), 'false', 'true')}" layout="none"> --> |
| | | <tr> |
| | | |
| | | <td style="text-align: center;"> |
| | | <apex:outputText value="{!ndt.U8_Code__c}" style="width: 95%" /> |
| | | </td> |
| | | <td style="text-align: center;"> |
| | | <apex:outputText value="{!ndt.Part_Number__c}" style="width: 95%" /> |
| | | </td> |
| | | <td style="text-align: center;"> |
| | | <apex:outputText value="{!ndt.Quantity__c}" style="width: 95%; text-align: center;" /> |
| | | </td> |
| | | <td style="text-align: center;"> |
| | | <apex:outputText value="{!ndt.Name_of_Goods__c}" style="width: 95%" /> |
| | | </td> |
| | | <td width="50%" style="text-align: center;">EC编码</td> |
| | | <td style="text-align: center;">数量</td> |
| | | </tr> |
| | | <!-- </apex:outputPanel> --> |
| | | <apex:repeat value="{!sp}" var="line"> |
| | | <tr> |
| | | <!-- <apex:outputPanel rendered="{!IF((Opp.ProductSegment__c = 'NDT' || Opp.ProductSegment__c = 'ANI' ), 'false', 'true')}" layout="none"> --> |
| | | <td style="text-align: center;"><apex:outputText value="{!line.productEC}" /></td> |
| | | <td style="text-align: center;"><apex:outputText value="{!line.quantity}" /></td> |
| | | <!-- </apex:outputPanel> --> |
| | | <!-- <apex:outputPanel rendered="{!IF((Opp.ProductSegment__c = 'NDT' || Opp.ProductSegment__c = 'ANI' ), 'true', 'false')}" layout="none"> |
| | | <td width="25%" style="text-align: center;"><apex:outputText value="{!line.U8Code}" /></td> |
| | | <td width="25%" style="text-align: center;"><apex:outputText value="{!line.productEC}" /></td> |
| | | <td width="25%" style="text-align: center;"><apex:outputText value="{!line.quantity}" /></td> |
| | | <td style="text-align: center;"><apex:outputText value="{!line.productName}" /></td> |
| | | </apex:outputPanel> --> |
| | | </tr> |
| | | </apex:repeat> |
| | | </table> |
| | | </apex:outputPanel> |
| | | </div> |
| | | |
| | | </div> |
| | | </body> |
| | | <style> |
| | | /* 20220221 PI改造 by 徐亮 start */ |
| | | body{margin: 0 auto;width: 780px;} |
| | | .title1{height: 30px;} |
| | | .title2{height: 110px;} |
| | | /* 20220221 PI改造 by 徐亮 end */ |
| | | </style> |
| | | <!-- 20220221 PI改造 by 徐亮 start --> |
| | | <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" /> |
| | | <script src="../../soap/ajax/53.0/connection.js" type="text/javascript"></script> |
| | | <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.jspdf)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.html2canvas)}"/> |
| | | |
| | | <script> |
| | | AWSService.sfSessionId = '{!GETSESSIONID()}'; |
| | | sforce.connection.serverUrl = '{!$Site.Prefix}/services/Soap/u/53.0'; |
| | | var staticResourceContact = JSON.parse('{!staticResourceContact}'); |
| | | var staticResourceOrder = JSON.parse('{!staticResourceOrder}'); |
| | | var staticResourceFile = JSON.parse('{!staticResourceFile}'); |
| | | function Fun(pdf) { |
| | | |
| | | var form = jQuery("<form method='post'></form>"); |
| | | jQuery(document.body).append(form); |
| | | let href = window.location.href |
| | | let arr = href.split('/') |
| | | form.attr({ "action": staticResourceFile.hostUrl + staticResourceFile.extraInfo + "?from=" + encodeURIComponent(href) + "&fileName=" + encodeURIComponent(arr[arr.length - 1].split('?')[0]) }); |
| | | // form.attr({"action":"http://127.0.0.1:8080/a/d?from="+encodeURIComponent(window.location.href)}); |
| | | let input = jQuery("<input type='hidden'/>"); |
| | | input.attr({ "name": "base64Str" }); |
| | | input.val(pdf.output('datauristring').substr(28)); |
| | | form.append(input); |
| | | form.submit(); |
| | | |
| | | // jQuery("body > *").each(function(){ |
| | | // jQuery(this).css('display','none'); |
| | | // }) |
| | | // jQuery("body").append('<embed style="position:absolute; left: 0; top: 0;" width="100%" height="100%" src="'+pdf.output('datauristring')+'" type="application/pdf"/>') |
| | | |
| | | } |
| | | |
| | | let id = "pdf-wrapper"; |
| | | var target = document.getElementById(id); |
| | | // 把imageDta转换成url |
| | | // page_height:一页的高度 |
| | | function ImageDataToUrl(img_data,page_height){ |
| | | let cvs = document.createElement("CANVAS"); |
| | | cvs.width = img_data.width; |
| | | cvs.height = page_height; |
| | | var ctx= cvs.getContext("2d"); |
| | | ctx.fillStyle="white"; |
| | | ctx.fillRect(0,0,cvs.width,cvs.height);// 填充canvas所有区域为白色 |
| | | let aheight = img_data.height |
| | | for (let i = 0; i < img_data.height && img_data.height > page_height-5; i++) { |
| | | aheight = img_data.height-i; |
| | | let index = img_data.width*4*(aheight-1) |
| | | let blank_count=0; |
| | | for (let j = 0; j < img_data.width * 4; j+=4) { |
| | | |
| | | if (img_data.data[index+j] > 222 && img_data.data[index+j+1] > 222 && img_data.data[index+j+2] > 222) { |
| | | //console.log(img_data.data[index+j] + ',' + img_data.data[index+j+1] + ',' + img_data.data[index+j+2]); |
| | | blank_count++; |
| | | }else{ |
| | | //console.log(index + ',' + j); |
| | | } |
| | | } |
| | | if (blank_count > img_data.width * 0.99) { |
| | | break; |
| | | } |
| | | } |
| | | |
| | | ctx.putImageData(img_data,0,0,0,0,img_data.width,aheight); |
| | | return { |
| | | data : cvs.toDataURL('image/jpeg', 1.0), |
| | | height : aheight |
| | | }; |
| | | } |
| | | function jsPdfDownload() { |
| | | |
| | | let jtargets = jQuery("#pdf-wrapper .pdf-page"); |
| | | let j_arr = new Array(jtargets.length + 1).join(0).split('').map(function () { return false }); |
| | | let landscape = false; |
| | | let pw = 595.28; |
| | | let ph = 841.89; |
| | | const marginw = 40; |
| | | const marginh = 40; |
| | | |
| | | let orientation = ''; |
| | | if (landscape) { |
| | | pw += ph; ph = pw - ph; pw = pw - ph; |
| | | orientation = 'l'; |
| | | } |
| | | var pdf = new jsPDF(orientation, 'pt', 'a4');// 第一个参数填字母l,注意不是数字1,为横向pdf |
| | | jtargets.each(function (i, e) { |
| | | e.style.background = "#FFFFFF"; |
| | | }) |
| | | |
| | | let rei = 0; |
| | | let recursion = null; |
| | | recursion = function (i) { |
| | | if (i >= jtargets.length) { |
| | | Fun(pdf); |
| | | return; |
| | | } |
| | | e = jtargets[i]; |
| | | html2canvas(e, { |
| | | scale: 2, |
| | | onrendered: function (canvas) { |
| | | /** |
| | | 本方法需要做几个事情 |
| | | 1.需要把canvas的内容分页显示到pdf的页中 |
| | | 2.canvas的宽高需要和pdf的宽高进行映射 |
| | | 3.截取到的内容需要放进一页宽高的canvas里面,并对其余区域刷白 |
| | | */ |
| | | var ctx = canvas.getContext("2d"); |
| | | let canvas_max_page_num = 9; |
| | | let canvas_current_page_num = 0; |
| | | var contentWidth = canvas.width; |
| | | var contentHeight = canvas.height; |
| | | |
| | | |
| | | //未生成pdf的html页面高度 |
| | | var leftHeight = contentHeight; |
| | | //页面偏移 |
| | | var position = 0; |
| | | |
| | | //a4纸的尺寸[595.28,841.89],html页面生成的canvas在pdf中图片的宽高 |
| | | var outputWidth = pw - 2 * marginw;//595.28//左右边距20 |
| | | let rate = outputWidth / 780;//输出宽度和内容宽度的比例 |
| | | var outputHeight = ph - 2 * marginh;//左右边距20 |
| | | let onePdfPageInCanvasHeight = contentWidth/outputWidth*outputHeight;//一页pdf在canvas中的高度; |
| | | //var pageData = canvas.toDataURL('image/jpeg', 1.0); |
| | | var pageData = null; |
| | | var imgData = null; |
| | | |
| | | var captureHeight = null;// 截取的当前canvas页的高度 |
| | | |
| | | let j = i; |
| | | while(position < contentHeight){ |
| | | |
| | | if (j++) { |
| | | pdf.addPage(); |
| | | } |
| | | |
| | | if(position+onePdfPageInCanvasHeight>contentHeight){ |
| | | captureHeight = contentHeight-position; |
| | | }else{ |
| | | captureHeight = onePdfPageInCanvasHeight; |
| | | } |
| | | |
| | | imgData = ctx.getImageData(0,position,contentWidth,captureHeight); |
| | | pageData = ImageDataToUrl(imgData,onePdfPageInCanvasHeight); |
| | | pdf.addImage(pageData.data, 'JPEG', marginw, marginh, outputWidth, outputHeight);//左右边距20,被输出的图片会被拉伸为outputWidth,outputHeight的宽高 |
| | | canvas_current_page_num++; |
| | | position += pageData.height; |
| | | if (canvas_max_page_num > 0 && canvas_current_page_num >= canvas_max_page_num) { |
| | | break; |
| | | } |
| | | } |
| | | |
| | | recursion(i + 1); |
| | | } |
| | | }) |
| | | }; |
| | | recursion(rei); |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | function ReplaceDecrypt(staticResource,data){ |
| | | for (let index = 0; index < staticResource.PIDetails.length; index++) { |
| | | let pi = staticResource.PIDetails[index]; |
| | | let e = document.getElementById(pi.SF_Field_API_Name__c); |
| | | if (e && data && data.object && data.object[pi.AWS_Field_API__c]) { |
| | | e.innerHTML = data[pi.AWS_Field_API__c] |
| | | } |
| | | } |
| | | } |
| | | <!-- <apex:outputPanel rendered="{!cnt1 < pageCnt - 1}" layout="none"> |
| | | <div style="page-break-after: always;"/> |
| | | </apex:outputPanel> --> |
| | | <apex:variable value="{!cnt1 + 1}" var="cnt1" /> |
| | | |
| | | |
| | | //blockme(); |
| | | document.body.onload = function(){ |
| | | |
| | | let i = 0; |
| | | let Foo = function(){ |
| | | if ( i == 2) { |
| | | if(confirm("PDF已加载完毕,是否显示?")){ |
| | | jsPdfDownload(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | if ('{!specialDeliveryContact.AWS_Data_Id__c}') { |
| | | AWSService.query(staticResourceContact.queryUrl, '{!specialDeliveryContact.AWS_Data_Id__c}', function(data){ |
| | | ReplaceDecrypt(staticResourceContact,data); |
| | | |
| | | i++; |
| | | Foo(); |
| | | }, staticResourceContact.token); |
| | | }else{ |
| | | i++; |
| | | Foo(); |
| | | } |
| | | |
| | | if ('{!contra.order.AWS_Data_Id__c}') { |
| | | AWSService.query(staticResourceOrder.queryUrl, '{!contra.order.AWS_Data_Id__c}', function(data){ |
| | | |
| | | ReplaceDecrypt(staticResourceOrder,data); |
| | | |
| | | i++; |
| | | Foo(); |
| | | }, staticResourceOrder.token); |
| | | }else{ |
| | | i++; |
| | | Foo(); |
| | | } |
| | | } |
| | | |
| | | |
| | | </apex:repeat> |
| | | </apex:repeat> |
| | | </apex:outputPanel> |
| | | |
| | | </script> |
| | | <!-- 20220221 PI改造 by 徐亮 end --> |
| | | <apex:outputPanel rendered="{!IF(Opp.ProductSegment__c = 'IE' || Opp.ProductSegment__c = 'RVI' || Opp.ProductSegment__c = 'BS' , 'false', 'true')}" layout="none" > |
| | | |
| | | <table width="100%" border="1" cellspacing="0" cellpadding="0" style="table-layout:auto;font-size: 9pt;"> |
| | | <tr> |
| | | <td width="25%" style="text-align: center;">U8 Code</td> |
| | | <td width="25%" style="text-align: center;">Part Number</td> |
| | | <td width="25%" style="text-align: center;">Quantity</td> |
| | | <td style="text-align: center;">Name of Goods</td> |
| | | </tr> |
| | | <apex:repeat value="{!ndtList}" var="ndt"> |
| | | <tr> |
| | | |
| | | <td style="text-align: center;"><apex:outputText value="{!ndt.U8_Code__c}" style="width: 95%"/></td> |
| | | <td style="text-align: center;"><apex:outputText value="{!ndt.Part_Number__c}" style="width: 95%"/></td> |
| | | <td style="text-align: center;"><apex:outputText value="{!ndt.Quantity__c}" style="width: 95%; text-align: center;"/></td> |
| | | <td style="text-align: center;"><apex:outputText value="{!ndt.Name_of_Goods__c}" style="width: 95%"/></td> |
| | | </tr> |
| | | </apex:repeat> |
| | | </table> |
| | | </apex:outputPanel> |
| | | |
| | | </body> |
| | | </html> |
| | | </apex:page> |
| | |
| | | <apex:page Controller="OrderPdf2Controller" showHeader="false" sidebar="false" id="allPage" action="{!init}" > <!-- renderAs="pdf" --> |
| | | <apex:page Controller="OrderPdf2Controller" showHeader="false" sidebar="false" id="allPage" action="{!init}" renderAs="pdf" > <!-- renderAs="pdf" --> |
| | | <head> |
| | | <style> |
| | | @page { |
| | |
| | | td.border-thick-title { border-width: 1pt 0pt 1pt 0pt; border-style: solid; border-color: black; text-align: center;} |
| | | td.border-thick-bottom { border-width: 0pt 0pt 1pt 0pt; border-style: solid; border-color: black; text-align: center;} |
| | | td.detail { text-align: center; } |
| | | /* 20220221 PI改造 by 徐亮 start */ |
| | | body{margin: 0 auto; |
| | | width: 780px;} |
| | | #title1{height: 30px;} |
| | | #title2{height: 110px;} |
| | | /* 20220221 PI改造 by 徐亮 end */ |
| | | |
| | | </style> |
| | | <!-- 20220221 PI改造 by 徐亮 start --> |
| | | <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" /> |
| | | <script src="../../soap/ajax/53.0/connection.js" type="text/javascript"></script> |
| | | <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/> |
| | | |
| | | <apex:includeScript value="{!URLFOR($Resource.jspdf)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.html2canvas)}"/> |
| | | |
| | | |
| | | <!-- 20220221 PI改造 by 徐亮 end --> |
| | | </head> |
| | | <body style="font-family: Arial Unicode MS; page-break-inside: auto; font-size: 8pt;line-height: 16pt;"> |
| | | <div id="pdf-wrapper"> |
| | | <div id="title1"></div> |
| | | <body style="font-family: Arial Unicode MS; page-break-inside: auto; font-size: 8pt;"> |
| | | <table border="0" width="100%"> |
| | | <tr> |
| | | <td style="text-align: center; font-size: 16pt;">完税订货单</td> |
| | |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align: right;">联系地址:</td> |
| | | <td style="text-align: left;" colspan="5" id="delivery_address">{!header.delivery_address}</td> |
| | | <td style="text-align: left;" colspan="5">{!header.delivery_address}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align: right;">城市:</td> |
| | |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align: right;">收货人姓名:</td> |
| | | <td style="text-align: left;" id="delivery_user">{!header.delivery_user}</td> |
| | | <td style="text-align: left;">{!header.delivery_user}</td> |
| | | <td style="text-align: right;">固话:</td> |
| | | <td style="text-align: left;" id="delivery_phone">{!header.delivery_phone}</td> |
| | | <td style="text-align: left;">{!header.delivery_phone}</td> |
| | | <td style="text-align: right;">手机:</td> |
| | | <td style="text-align: left;" id="delivery_tel">{!header.delivery_tel}</td> |
| | | <td style="text-align: left;">{!header.delivery_tel}</td> |
| | | </tr> |
| | | </table> |
| | | <table style="border:solid 1px black" width="100%"> |
| | |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align: right;">联系地址:</td> |
| | | <td style="text-align: left;" colspan="5" id="user_address">{!header.user_address}</td> |
| | | <td style="text-align: left;" colspan="5">{!header.user_address}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align: right;">城市:</td> |
| | |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align: right;">用户姓名:</td> |
| | | <td style="text-align: left;" id="user_name2">{!header.user_name2}</td> |
| | | <td style="text-align: left;">{!header.user_name2}</td> |
| | | <td style="text-align: right;">固话:</td> |
| | | <td style="text-align: left;" id="user_phone">{!header.user_phone}</td> |
| | | <td style="text-align: left;">{!header.user_phone}</td> |
| | | <td style="text-align: right;">手机:</td> |
| | | <td style="text-align: left;" id="user_tel">{!header.user_tel}</td> |
| | | <td style="text-align: left;">{!header.user_tel}</td> |
| | | </tr> |
| | | <apex:outputPanel layout="none" rendered="{!IF(productSegment == 'IE', true, false)}"> |
| | | <tr> |
| | |
| | | <td style="text-align: left;"> </td> |
| | | </tr> --> |
| | | </table> |
| | | </div> |
| | | </body> |
| | | <!-- 20220221 PI改造 by 徐亮 start --> |
| | | <script> |
| | | AWSService.sfSessionId = '{!GETSESSIONID()}'; |
| | | var staticResources = JSON.parse('{!staticResource}'); |
| | | |
| | | function Fun(pdf){ |
| | | var iframe = document.createElement('iframe'); |
| | | iframe.setAttribute('style', 'position:absolute;right:0; top:0; bottom:0; height:100%; width:100%'); |
| | | document.body.appendChild(iframe); |
| | | iframe.src = pdf.output('datauristring'); |
| | | for(let e of document.body.childNodes){ |
| | | if( e != iframe && e.style){ |
| | | e.style.display = 'none'; |
| | | } |
| | | } |
| | | } |
| | | |
| | | let id = "pdf-wrapper"; |
| | | var target = document.getElementById(id); |
| | | function jsPdfDownload(){ |
| | | let pdfName = "测试"; |
| | | let id = "pdf-wrapper"; |
| | | var target = document.getElementById(id); |
| | | target.style.background = "#FFFFFF"; |
| | | if(pdfName==''||pdfName==undefined) pdfName= getNowFormatDate(); |
| | | |
| | | html2canvas(target, { |
| | | scale: 2, |
| | | onrendered:function(canvas) { |
| | | let landscape = false; |
| | | let pw = 595.28; |
| | | let ph = 841.89; |
| | | const marginw = 40; |
| | | |
| | | let orientation = ''; |
| | | if (landscape) { |
| | | let temp =ph; |
| | | ph = pw; |
| | | pw = temp; |
| | | orientation = 'l'; |
| | | } |
| | | |
| | | |
| | | var contentWidth = canvas.width; |
| | | var contentHeight = canvas.height; |
| | | |
| | | //一页pdf显示html页面生成的canvas高度; |
| | | var pageHeight = contentWidth / pw * ph; |
| | | //未生成pdf的html页面高度 |
| | | var leftHeight = contentHeight; |
| | | //页面偏移 |
| | | var position = 0; |
| | | //a4纸的尺寸[595.28,841.89],html页面生成的canvas在pdf中图片的宽高 |
| | | var imgWidth = pw-2*marginw;//595.28//左右边距20 |
| | | var imgHeight = imgWidth/contentWidth * contentHeight;//左右边距20 |
| | | |
| | | var pageData = canvas.toDataURL('image/jpeg', 1.0); |
| | | |
| | | var pdf = new jsPDF(orientation, 'pt', 'a4');// 第一个参数填字母l,注意不是数字1,为横向pdf |
| | | |
| | | //有两个高度需要区分,一个是html页面的实际高度,和生成pdf的页面高度(841.89) |
| | | //当内容未超过pdf一页显示的范围,无需分页 |
| | | if (leftHeight < pageHeight) { |
| | | pdf.addImage(pageData, 'JPEG', marginw, 0, imgWidth, imgHeight );//左右边距20 |
| | | } else { |
| | | while(leftHeight > 0) { |
| | | pdf.addImage(pageData, 'JPEG', marginw, position, imgWidth, imgHeight)//左右边距20 |
| | | leftHeight -= pageHeight; |
| | | position -= ph; |
| | | //避免添加空白页 |
| | | if(leftHeight > 0) { |
| | | pdf.addPage(); |
| | | } |
| | | } |
| | | } |
| | | Fun(pdf); |
| | | } |
| | | }) |
| | | } |
| | | |
| | | //blockme(); |
| | | document.body.onload = function(){ |
| | | let dataIds = []; |
| | | |
| | | if('{!header.delivery_aws_data_id}')dataIds.push('{!header.delivery_aws_data_id}'); |
| | | if('{!header.user_aws_data_id}')dataIds.push('{!header.user_aws_data_id}'); |
| | | |
| | | AWSService.post(staticResources.searchUrl, JSON.stringify({ |
| | | dataIds:dataIds |
| | | }), function(data){ |
| | | |
| | | //unblockUI(); |
| | | if(data && data.object && data.object.length){ |
| | | for (const obj of data.object) { |
| | | if (obj.dataId == '{!header.delivery_aws_data_id}') { |
| | | document.getElementById("delivery_address").innerHTML = obj.address1; |
| | | document.getElementById("delivery_user").innerHTML = obj.lastName; |
| | | document.getElementById("delivery_phone").innerHTML = obj.phone; |
| | | document.getElementById("delivery_tel").innerHTML = obj.mobilePhone; |
| | | } |
| | | |
| | | if (obj.dataId == '{!header.user_aws_data_id}') { |
| | | document.getElementById("user_address").innerHTML = obj.address1; |
| | | document.getElementById("user_name2").innerHTML = obj.lastName; |
| | | document.getElementById("user_phone").innerHTML = obj.phone; |
| | | document.getElementById("user_tel").innerHTML = obj.mobilePhone; |
| | | } |
| | | } |
| | | |
| | | |
| | | setTimeout(() => { |
| | | jsPdfDownload(); |
| | | }, 1500); |
| | | } |
| | | |
| | | |
| | | |
| | | }, staticResources.token); |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | document.body.onclick = function(){ |
| | | //jsPdfDownload(); |
| | | } |
| | | </script> |
| | | <!-- 20220221 PI改造 by 徐亮 end --> |
| | | </apex:page> |
| | |
| | | td.border-thick-title { border-width: 1pt 0pt 1pt 0pt; border-style: solid; border-color: black; text-align: center;} |
| | | td.border-thick-bottom { border-width: 0pt 0pt 1pt 0pt; border-style: solid; border-color: black; text-align: center;} |
| | | td.detail { text-align: center; } |
| | | /* 20220221 PI改造 by 徐亮 start */ |
| | | body{margin: 0 auto; |
| | | width: 780px;} |
| | | #title1{height: 80px;} |
| | | #title2{height: 110px;} |
| | | /* 20220221 PI改造 by 徐亮 end */ |
| | | |
| | | </style> |
| | | <!-- 20220221 PI改造 by 徐亮 start --> |
| | | <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" /> |
| | | <script src="../../soap/ajax/53.0/connection.js" type="text/javascript"></script> |
| | | <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/> |
| | | |
| | | <apex:includeScript value="{!URLFOR($Resource.jspdf)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.html2canvas)}"/> |
| | | |
| | | |
| | | <!-- 20220221 PI改造 by 徐亮 end --> |
| | | </style> |
| | | </head> |
| | | |
| | | |
| | | <body style="font-family: Arial Unicode MS; page-break-inside: auto; font-size: 8pt;line-height: 16pt;"> |
| | | <div id="pdf-wrapper"> |
| | | <div id="title1"></div> |
| | | <table border="0" width="100%" style="margin-bottom: 8pt;"> |
| | | <body style="font-family: Arial Unicode MS; page-break-inside: auto; font-size: 8pt;"> |
| | | |
| | | <table border="0" width="100%"> |
| | | <apex:outputPanel layout="none" rendered="{!IF(productSegment == 'NDT', true, false)}"> |
| | | <tr> |
| | | <td style="text-align: center; font-size: 16pt;">SSBG-NDT内贸订货单</td> |
| | |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align: right;">收货人姓名:</td> |
| | | <td style="text-align: left;" id="delivery_user">{!header.delivery_user}</td> |
| | | <td style="text-align: left;">{!header.delivery_user}</td> |
| | | <td style="text-align: right;">固话:</td> |
| | | <td style="text-align: left;" id="delivery_phone">{!header.delivery_phone}</td> |
| | | <td style="text-align: left;">{!header.delivery_phone}</td> |
| | | <td style="text-align: right;">手机:</td> |
| | | <td style="text-align: left;" id="delivery_tel">{!header.delivery_tel}</td> |
| | | <td style="text-align: left;">{!header.delivery_tel}</td> |
| | | </tr> |
| | | </table> |
| | | <table style="border:solid 1px black" width="100%"> |
| | |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align: right;">联系地址:</td> |
| | | <td style="text-align: left;" colspan="5" id="user_address">{!header.user_address}</td> |
| | | <td style="text-align: left;" colspan="5">{!header.user_address}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align: right;">城市:</td> |
| | |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align: right;">用户姓名:</td> |
| | | <td style="text-align: left;" id="user_name2">{!header.user_name2}</td> |
| | | <td style="text-align: left;">{!header.user_name2}</td> |
| | | <td style="text-align: right;">固话:</td> |
| | | <td style="text-align: left;" id="user_phone">{!header.user_phone}</td> |
| | | <td style="text-align: left;">{!header.user_phone}</td> |
| | | <td style="text-align: right;">手机:</td> |
| | | <td style="text-align: left;" id="user_tel">{!header.user_tel}</td> |
| | | <td style="text-align: left;">{!header.user_tel}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align: right;">Sub Use:</td> |
| | |
| | | |
| | | </tr> |
| | | </table> |
| | | </div> |
| | | |
| | | </body> |
| | | <!-- 20220221 PI改造 by 徐亮 start --> |
| | | <script> |
| | | AWSService.sfSessionId = '{!GETSESSIONID()}'; |
| | | var staticResources = JSON.parse('{!staticResource}'); |
| | | |
| | | function Fun(pdf){ |
| | | var iframe = document.createElement('iframe'); |
| | | iframe.setAttribute('style', 'position:absolute;right:0; top:0; bottom:0; height:100%; width:100%'); |
| | | document.body.appendChild(iframe); |
| | | iframe.src = pdf.output('datauristring'); |
| | | for(let e of document.body.childNodes){ |
| | | if( e != iframe && e.style){ |
| | | e.style.display = 'none'; |
| | | } |
| | | } |
| | | } |
| | | |
| | | let id = "pdf-wrapper"; |
| | | var target = document.getElementById(id); |
| | | function jsPdfDownload(){ |
| | | let pdfName = "测试"; |
| | | let id = "pdf-wrapper"; |
| | | var target = document.getElementById(id); |
| | | target.style.background = "#FFFFFF"; |
| | | if(pdfName==''||pdfName==undefined) pdfName= getNowFormatDate(); |
| | | |
| | | html2canvas(target, { |
| | | scale: 2, |
| | | onrendered:function(canvas) { |
| | | let landscape = false; |
| | | let pw = 595.28; |
| | | let ph = 841.89; |
| | | const marginw = 40; |
| | | |
| | | let orientation = ''; |
| | | if (landscape) { |
| | | let temp =ph; |
| | | ph = pw; |
| | | pw = temp; |
| | | orientation = 'l'; |
| | | } |
| | | |
| | | |
| | | var contentWidth = canvas.width; |
| | | var contentHeight = canvas.height; |
| | | |
| | | //一页pdf显示html页面生成的canvas高度; |
| | | var pageHeight = contentWidth / pw * ph; |
| | | //未生成pdf的html页面高度 |
| | | var leftHeight = contentHeight; |
| | | //页面偏移 |
| | | var position = 0; |
| | | //a4纸的尺寸[595.28,841.89],html页面生成的canvas在pdf中图片的宽高 |
| | | var imgWidth = pw-2*marginw;//595.28//左右边距20 |
| | | var imgHeight = imgWidth/contentWidth * contentHeight;//左右边距20 |
| | | |
| | | var pageData = canvas.toDataURL('image/jpeg', 1.0); |
| | | |
| | | var pdf = new jsPDF(orientation, 'pt', 'a4');// 第一个参数填字母l,注意不是数字1,为横向pdf |
| | | |
| | | //有两个高度需要区分,一个是html页面的实际高度,和生成pdf的页面高度(841.89) |
| | | //当内容未超过pdf一页显示的范围,无需分页 |
| | | if (leftHeight < pageHeight) { |
| | | pdf.addImage(pageData, 'JPEG', marginw, 0, imgWidth, imgHeight );//左右边距20 |
| | | } else { |
| | | while(leftHeight > 0) { |
| | | pdf.addImage(pageData, 'JPEG', marginw, position, imgWidth, imgHeight)//左右边距20 |
| | | leftHeight -= pageHeight; |
| | | position -= ph; |
| | | //避免添加空白页 |
| | | if(leftHeight > 0) { |
| | | pdf.addPage(); |
| | | } |
| | | } |
| | | } |
| | | Fun(pdf); |
| | | } |
| | | }) |
| | | } |
| | | |
| | | //blockme(); |
| | | document.body.onload = function(){ |
| | | let dataIds = []; |
| | | |
| | | if('{!header.delivery_aws_data_id}')dataIds.push('{!header.delivery_aws_data_id}'); |
| | | if('{!header.user_aws_data_id}')dataIds.push('{!header.user_aws_data_id}'); |
| | | |
| | | AWSService.post(staticResources.searchUrl, JSON.stringify({ |
| | | dataIds:dataIds |
| | | }), function(data){ |
| | | |
| | | //unblockUI(); |
| | | if(data && data.object && data.object.length){ |
| | | for (const obj of data.object) { |
| | | if (obj.dataId == '{!header.delivery_aws_data_id}') { |
| | | document.getElementById("delivery_address").innerHTML = obj.address1; |
| | | document.getElementById("delivery_user").innerHTML = obj.lastName; |
| | | document.getElementById("delivery_phone").innerHTML = obj.phone; |
| | | document.getElementById("delivery_tel").innerHTML = obj.mobilePhone; |
| | | } |
| | | |
| | | if (obj.dataId == '{!header.user_aws_data_id}') { |
| | | document.getElementById("user_address").innerHTML = obj.address1; |
| | | document.getElementById("user_name2").innerHTML = obj.lastName; |
| | | document.getElementById("user_phone").innerHTML = obj.phone; |
| | | document.getElementById("user_tel").innerHTML = obj.mobilePhone; |
| | | } |
| | | } |
| | | |
| | | |
| | | setTimeout(() => { |
| | | jsPdfDownload(); |
| | | }, 1500); |
| | | } |
| | | |
| | | |
| | | |
| | | }, staticResources.token); |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | document.body.onclick = function(){ |
| | | //jsPdfDownload(); |
| | | } |
| | | </script> |
| | | <!-- 20220221 PI改造 by 徐亮 end --> |
| | | |
| | | |
| | | |
| | |
| | | <apex:page Controller="QuotePDFController" showHeader="false" sidebar="false" id="allPage" action="{!init}" > |
| | | <!-- <apex:page Controller="QuotePDFController" showHeader="false" sidebar="false" id="allPage" action="{!init}" renderAs="pdf"> --> |
| | | <apex:page Controller="QuotePDFController" showHeader="false" sidebar="false" id="allPage" action="{!init}" renderAs="pdf"> |
| | | <head> |
| | | <style> |
| | | @page { |
| | |
| | | </style> |
| | | </head> |
| | | <body style="font-family: Arial Unicode MS; page-break-inside: auto"> |
| | | <div id="pdf-wrapper"> |
| | | <div class="pdf-page"> |
| | | <table border="0" width="100%" style="border-collapse: collapse;"> |
| | | <tr> |
| | | <td style="text-align:right;">{!quoteInfo.quoteDate}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align:right;">{!$ObjectType.Quote.label}#{!quoteInfo.quoteNo}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align:right;">{!$Label.Label_Total_pages}:{!pageCnt}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align:left;">{!$Label.Label_From}:{!quoteInfo.dealerName}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align:left;">{!$ObjectType.Contact.label}:<span id="dealerContactName">{!quoteInfo.dealerContactName}</span> {!$ObjectType.Contact.fields.MobilePhone.label}:<span>{!quoteInfo.dealerContactPhone}</span></td> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align:left;">{!$ObjectType.Account.fields.Address1__c.label}:{!quoteInfo.dealerAddress}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align:left;">{!$ObjectType.Contact.fields.Phone.label}:{!quoteInfo.dealerPhone} {!$ObjectType.Contact.fields.Fax.label}:{!quoteInfo.dealerFax}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align:left;">{!$ObjectType.Contact.fields.Email.label}:{!quoteInfo.dealerEmail}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align:left;"> </td> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align:left;">{!$Label.Label_To}:{!quoteInfo.accountName}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align:left;" id="accountContactName">{!quoteInfo.accountContactName}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align:left;">{!$ObjectType.Contact.fields.Phone.label}:<span id="accountContactPhone">{!quoteInfo.accountContactPhone}</span> {!$ObjectType.Contact.fields.Email.label}:<span id="accountContactEmail">{!quoteInfo.accountContactEmail}</span></td> |
| | | </tr> |
| | | </table> |
| | | |
| | | <br/> |
| | | Quotation Sheet(Quotation #{!quoteInfo.quoteNo})<br/> |
| | | |
| | | <table border="1" width="100%" style="border-collapse: collapse;table-layout: fixed;"> |
| | | <colgroup> |
| | | <col width="10%" /> |
| | | <col width="60%" /> |
| | | <col width="10%" /> |
| | | <col width="20%" /> |
| | | </colgroup> |
| | | <tr style="text-align: center;"> |
| | | <th>{!$Label.Label_Units}</th> |
| | | <th>{!$Label.Label_Description}</th> |
| | | <th>{!$ObjectType.QuoteLineItem.fields.Quantity.label}</th> |
| | | <th>{!$ObjectType.QuoteLineItem.fields.TotalPrice.label}{!currencyIsoCode}</th> |
| | | </tr> |
| | | <apex:repeat value="{!printRecords}" var="set"> |
| | | <tr> |
| | | <td style="text-align: center;"><apex:outputText value="{!set.units}" /></td> |
| | | <td><apex:outputText value="{!set.description}" /></td> |
| | | <td style="text-align: right;"><apex:outputText value="{!set.qty}" /></td> |
| | | <td style="text-align: right;"><apex:outputText value="{!set.total}" /></td> |
| | | </tr> |
| | | </apex:repeat> |
| | | </table> |
| | | |
| | | <br/> |
| | | |
| | | Note:<br/> |
| | | <!-- 1) The payment terms are {!quoteInfo.note1} .<br/> |
| | | 付款方式 {!quoteInfo.note2} 。<br/> |
| | | 2) Quoation valid until {!quoteInfo.note3} .<br/> |
| | | 报价有效期到 {!quoteInfo.note3} 。<br/> |
| | | 3) All the commodoties come with {!quoteInfo.note4} year's manufacturer warranty.<br/> |
| | | 所有商品含 {!quoteInfo.note4} 年厂家保修。<br/> |
| | | 4) The above quotations are {!quoteInfo.note5} prices, Commodoties shipped to the clien's requirements.<br/> |
| | | 上述报价为 {!quoteInfo.note5} 价,商品送至客户指定地点。<br/> |
| | | 5) The above quotations are all {!quoteInfo.note6}.<br/> |
| | | 上述报价均为 {!quoteInfo.note7} 价。<br/> |
| | | 6) Configuration as per attached.<br/> |
| | | 配置清单详见附件。<br/> --> |
| | | <apex:outputText value="{!quoteInfo.comment}" escape="false"/> |
| | | <!-- 1) The above quotations are CIP prices, Commodities shipped to the client’s requirements.<br/> |
| | | 2) The above quotations are all tax {!quoteInfo.note2}.<br/> |
| | | 3) The payment terms are {!quoteInfo.note3}.<br/> |
| | | 4) Quotation valid until {!quoteInfo.note4}.<br/> |
| | | 5) All the commodities come with {!quoteInfo.note5} year’s manufacturer warranty.<br/> |
| | | 6) Configuration as per attached.<br/> |
| | | 7) Delivery lead time is {!quoteInfo.note7} days after receipt of payment.<br/> --> |
| | | |
| | | </div> |
| | | <apex:outputPanel rendered="{!pageCnt > 1}" layout="none"> |
| | | <div style="page-break-after: always;"/> |
| | | </apex:outputPanel> |
| | | |
| | | <apex:variable value="{!1}" var="cnt1" /> |
| | | <table border="0" width="100%" style="border-collapse: collapse;"> |
| | | <tr> |
| | | <td style="text-align:right;">{!quoteInfo.quoteDate}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align:right;">{!$ObjectType.Quote.label}#{!quoteInfo.quoteNo}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align:right;">{!$Label.Label_Total_pages}:{!pageCnt}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align:left;">{!$Label.Label_From}:{!quoteInfo.dealerName}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align:left;">{!$ObjectType.Contact.label}:{!quoteInfo.dealerContactName} {!$ObjectType.Contact.fields.MobilePhone.label}:{!quoteInfo.dealerContactPhone}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align:left;">{!$ObjectType.Account.fields.Address1__c.label}:{!quoteInfo.dealerAddress}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align:left;">{!$ObjectType.Contact.fields.Phone.label}:{!quoteInfo.dealerPhone} {!$ObjectType.Contact.fields.Fax.label}:{!quoteInfo.dealerFax}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align:left;">{!$ObjectType.Contact.fields.Email.label}:{!quoteInfo.dealerEmail}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align:left;"> </td> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align:left;">{!$Label.Label_To}:{!quoteInfo.accountName}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align:left;">{!quoteInfo.accountContactName}</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align:left;">{!$ObjectType.Contact.fields.Phone.label}:{!quoteInfo.accountContactPhone} {!$ObjectType.Contact.fields.Email.label}:{!quoteInfo.accountContactEmail}</td> |
| | | </tr> |
| | | </table> |
| | | |
| | | <br/> |
| | | Quotation Sheet(Quotation #{!quoteInfo.quoteNo})<br/> |
| | | |
| | | <table border="1" width="100%" style="border-collapse: collapse;table-layout: fixed;"> |
| | | <colgroup> |
| | | <col width="10%" /> |
| | | <col width="60%" /> |
| | | <col width="10%" /> |
| | | <col width="20%" /> |
| | | </colgroup> |
| | | <tr style="text-align: center;"> |
| | | <th>{!$Label.Label_Units}</th> |
| | | <th>{!$Label.Label_Description}</th> |
| | | <th>{!$ObjectType.QuoteLineItem.fields.Quantity.label}</th> |
| | | <th>{!$ObjectType.QuoteLineItem.fields.TotalPrice.label}{!currencyIsoCode}</th> |
| | | </tr> |
| | | <apex:repeat value="{!printRecords}" var="set"> |
| | | <!-- <apex:variable value="{!1}" var="cnt2" /> --> |
| | | <apex:repeat value="{!set.setPage}" var="sp"> |
| | | <div class="pdf-page"> |
| | | <table border="1" width="100%" style="border-collapse: collapse;table-layout: fixed; font-size: 12px;"> |
| | | <colgroup> |
| | | <col width="3%" /> |
| | | <col width="10%" /> |
| | | <col width="15%" /> |
| | | <col width="{!IF(isPrintPrice=='true', 23, 33)}%" /> |
| | | <col width="{!IF(isPrintPrice=='true', 20, 33)}%" /> |
| | | <col width="5%" /> |
| | | <apex:outputPanel rendered="{!isPrintPrice=='true'}" layout="none"> |
| | | <col width="12%" /> |
| | | <col width="12%" /> |
| | | </apex:outputPanel> |
| | | </colgroup> |
| | | <!-- <apex:outputPanel rendered="{!cnt2 == 1}" layout="none"> --> |
| | | <tr style="text-align: center;"> |
| | | <td colspan="{!IF(isPrintPrice=='true', 8, 6)}">{!set.description}{!$Label.Label_Set_detail}</td> |
| | | </tr> |
| | | <!-- </apex:outputPanel> --> |
| | | <tr style="text-align: center;"> |
| | | <td>{!$Label.Label_No}</td> |
| | | <td>{!$ObjectType.Product2.fields.ProductCode.label}</td> |
| | | <td>{!$ObjectType.Product2.fields.Product_ECCode__c.label}</td> |
| | | <td>{!$ObjectType.Product2.fields.Description.label}</td> |
| | | <td>{!$ObjectType.QuoteLineItem.fields.Description.label}</td> |
| | | <td>{!$ObjectType.QuoteLineItem.fields.Quantity.label}</td> |
| | | <apex:outputPanel rendered="{!isPrintPrice=='true'}" layout="none"> |
| | | <td>{!$ObjectType.QuoteLineItem.fields.UnitPrice.label}{!currencyIsoCode}</td> |
| | | <td>{!$ObjectType.QuoteLineItem.fields.TotalPrice.label}{!currencyIsoCode}</td> |
| | | </apex:outputPanel> |
| | | </tr> |
| | | <apex:repeat value="{!sp}" var="line"> |
| | | <tr> |
| | | <td style="text-align: center;"><apex:outputText value="{!line.lineNo}" /></td> |
| | | <td><apex:outputText escape="false" value="{!line.productCode}" /></td> |
| | | <td><apex:outputText escape="false" value="{!line.productEC}" /></td> |
| | | <td><apex:outputText escape="false" value="{!line.description}" /></td> |
| | | <td><apex:outputText escape="false" value="{!line.comment}" /></td> |
| | | <td style="text-align: right;"><apex:outputText value="{!line.quantity}" /></td> |
| | | <apex:outputPanel rendered="{!isPrintPrice=='true'}" layout="none"> |
| | | <td style="text-align: right;"><apex:outputText value="{!line.price}" /></td> |
| | | <td style="text-align: right;"><apex:outputText value="{!line.totalPrice}" /></td> |
| | | </apex:outputPanel> |
| | | </tr> |
| | | </apex:repeat> |
| | | </table> |
| | | </div> |
| | | |
| | | |
| | | <apex:outputPanel rendered="{!cnt1 < pageCnt - 1}" layout="none"> |
| | | <div style="page-break-after: always;"/> |
| | | </apex:outputPanel> |
| | | |
| | | <!-- <apex:variable value="{!cnt2 + 1}" var="cnt2" /> --> |
| | | <apex:variable value="{!cnt1 + 1}" var="cnt1" /> |
| | | </apex:repeat> |
| | | <tr> |
| | | <td style="text-align: center;"><apex:outputText value="{!set.units}" /></td> |
| | | <td><apex:outputText value="{!set.description}" /></td> |
| | | <td style="text-align: right;"><apex:outputText value="{!set.qty}" /></td> |
| | | <td style="text-align: right;"><apex:outputText value="{!set.total}" /></td> |
| | | </tr> |
| | | </apex:repeat> |
| | | </div> |
| | | </table> |
| | | |
| | | <br/> |
| | | |
| | | Note:<br/> |
| | | <!-- 1) The payment terms are {!quoteInfo.note1} .<br/> |
| | | 付款方式 {!quoteInfo.note2} 。<br/> |
| | | 2) Quoation valid until {!quoteInfo.note3} .<br/> |
| | | 报价有效期到 {!quoteInfo.note3} 。<br/> |
| | | 3) All the commodoties come with {!quoteInfo.note4} year's manufacturer warranty.<br/> |
| | | 所有商品含 {!quoteInfo.note4} 年厂家保修。<br/> |
| | | 4) The above quotations are {!quoteInfo.note5} prices, Commodoties shipped to the clien's requirements.<br/> |
| | | 上述报价为 {!quoteInfo.note5} 价,商品送至客户指定地点。<br/> |
| | | 5) The above quotations are all {!quoteInfo.note6}.<br/> |
| | | 上述报价均为 {!quoteInfo.note7} 价。<br/> |
| | | 6) Configuration as per attached.<br/> |
| | | 配置清单详见附件。<br/> --> |
| | | <apex:outputText value="{!quoteInfo.comment}" escape="false"/> |
| | | <!-- 1) The above quotations are CIP prices, Commodities shipped to the client’s requirements.<br/> |
| | | 2) The above quotations are all tax {!quoteInfo.note2}.<br/> |
| | | 3) The payment terms are {!quoteInfo.note3}.<br/> |
| | | 4) Quotation valid until {!quoteInfo.note4}.<br/> |
| | | 5) All the commodities come with {!quoteInfo.note5} year’s manufacturer warranty.<br/> |
| | | 6) Configuration as per attached.<br/> |
| | | 7) Delivery lead time is {!quoteInfo.note7} days after receipt of payment.<br/> --> |
| | | |
| | | <apex:outputPanel rendered="{!pageCnt > 1}" layout="none"> |
| | | <div style="page-break-after: always;"/> |
| | | </apex:outputPanel> |
| | | |
| | | <apex:variable value="{!1}" var="cnt1" /> |
| | | <apex:repeat value="{!printRecords}" var="set"> |
| | | <!-- <apex:variable value="{!1}" var="cnt2" /> --> |
| | | <apex:repeat value="{!set.setPage}" var="sp"> |
| | | <table border="1" width="100%" style="border-collapse: collapse;table-layout: fixed; font-size: 12px;"> |
| | | <colgroup> |
| | | <col width="3%" /> |
| | | <col width="10%" /> |
| | | <col width="15%" /> |
| | | <col width="{!IF(isPrintPrice=='true', 23, 33)}%" /> |
| | | <col width="{!IF(isPrintPrice=='true', 20, 33)}%" /> |
| | | <col width="5%" /> |
| | | <apex:outputPanel rendered="{!isPrintPrice=='true'}" layout="none"> |
| | | <col width="12%" /> |
| | | <col width="12%" /> |
| | | </apex:outputPanel> |
| | | </colgroup> |
| | | <!-- <apex:outputPanel rendered="{!cnt2 == 1}" layout="none"> --> |
| | | <tr style="text-align: center;"> |
| | | <td colspan="{!IF(isPrintPrice=='true', 8, 6)}">{!set.description}{!$Label.Label_Set_detail}</td> |
| | | </tr> |
| | | <!-- </apex:outputPanel> --> |
| | | <tr style="text-align: center;"> |
| | | <td>{!$Label.Label_No}</td> |
| | | <td>{!$ObjectType.Product2.fields.ProductCode.label}</td> |
| | | <td>{!$ObjectType.Product2.fields.Product_ECCode__c.label}</td> |
| | | <td>{!$ObjectType.Product2.fields.Description.label}</td> |
| | | <td>{!$ObjectType.QuoteLineItem.fields.Description.label}</td> |
| | | <td>{!$ObjectType.QuoteLineItem.fields.Quantity.label}</td> |
| | | <apex:outputPanel rendered="{!isPrintPrice=='true'}" layout="none"> |
| | | <td>{!$ObjectType.QuoteLineItem.fields.UnitPrice.label}{!currencyIsoCode}</td> |
| | | <td>{!$ObjectType.QuoteLineItem.fields.TotalPrice.label}{!currencyIsoCode}</td> |
| | | </apex:outputPanel> |
| | | </tr> |
| | | <apex:repeat value="{!sp}" var="line"> |
| | | <tr> |
| | | <td style="text-align: center;"><apex:outputText value="{!line.lineNo}" /></td> |
| | | <td><apex:outputText escape="false" value="{!line.productCode}" /></td> |
| | | <td><apex:outputText escape="false" value="{!line.productEC}" /></td> |
| | | <td><apex:outputText escape="false" value="{!line.description}" /></td> |
| | | <td><apex:outputText escape="false" value="{!line.comment}" /></td> |
| | | <td style="text-align: right;"><apex:outputText value="{!line.quantity}" /></td> |
| | | <apex:outputPanel rendered="{!isPrintPrice=='true'}" layout="none"> |
| | | <td style="text-align: right;"><apex:outputText value="{!line.price}" /></td> |
| | | <td style="text-align: right;"><apex:outputText value="{!line.totalPrice}" /></td> |
| | | </apex:outputPanel> |
| | | </tr> |
| | | </apex:repeat> |
| | | </table> |
| | | |
| | | <apex:outputPanel rendered="{!cnt1 < pageCnt - 1}" layout="none"> |
| | | <div style="page-break-after: always;"/> |
| | | </apex:outputPanel> |
| | | |
| | | <!-- <apex:variable value="{!cnt2 + 1}" var="cnt2" /> --> |
| | | <apex:variable value="{!cnt1 + 1}" var="cnt1" /> |
| | | </apex:repeat> |
| | | </apex:repeat> |
| | | </body> |
| | | <style> |
| | | /* 20220221 PI改造 by 徐亮 start */ |
| | | body{margin: 0 auto;width: 780px;} |
| | | .title1{height: 30px;} |
| | | .title2{height: 110px;} |
| | | /* 20220221 PI改造 by 徐亮 end */ |
| | | </style> |
| | | <!-- 20220221 PI改造 by 徐亮 start --> |
| | | <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" /> |
| | | <script src="../../soap/ajax/53.0/connection.js" type="text/javascript"></script> |
| | | <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.jspdf)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.html2canvas)}"/> |
| | | |
| | | <!-- 20220221 PI改造 by 徐亮 end --> |
| | | <!-- 20220221 PI改造 by 徐亮 start --> |
| | | <script> |
| | | AWSService.sfSessionId = '{!GETSESSIONID()}'; |
| | | sforce.connection.serverUrl = '{!$Site.Prefix}/services/Soap/u/53.0'; |
| | | var staticResourceContact = JSON.parse('{!staticResourceContact}'); |
| | | var staticResourceOpportunity = JSON.parse('{!staticResourceOpportunity}'); |
| | | var staticResourceFile = JSON.parse('{!staticResourceFile}'); |
| | | function Fun(pdf) { |
| | | |
| | | var form = jQuery("<form method='post'></form>"); |
| | | jQuery(document.body).append(form); |
| | | let href = window.location.href |
| | | let arr = href.split('/') |
| | | form.attr({ "action": staticResourceFile.hostUrl + staticResourceFile.extraInfo + "?from=" + encodeURIComponent(href) + "&fileName=" + encodeURIComponent(arr[arr.length - 1].split('?')[0]) }); |
| | | // form.attr({"action":"http://127.0.0.1:8080/a/d?from="+encodeURIComponent(window.location.href)}); |
| | | let input = jQuery("<input type='hidden'/>"); |
| | | input.attr({ "name": "base64Str" }); |
| | | input.val(pdf.output('datauristring').substr(28)); |
| | | form.append(input); |
| | | form.submit(); |
| | | |
| | | // jQuery("body > *").each(function(){ |
| | | // jQuery(this).css('display','none'); |
| | | // }) |
| | | // jQuery("body").append('<embed style="position:absolute; left: 0; top: 0;" width="100%" height="100%" src="'+pdf.output('datauristring')+'" type="application/pdf"/>') |
| | | |
| | | } |
| | | |
| | | let id = "pdf-wrapper"; |
| | | var target = document.getElementById(id); |
| | | // 把imageDta转换成url |
| | | // page_height:一页的高度 |
| | | function ImageDataToUrl(img_data,page_height){ |
| | | let cvs = document.createElement("CANVAS"); |
| | | cvs.width = img_data.width; |
| | | cvs.height = page_height; |
| | | var ctx= cvs.getContext("2d"); |
| | | ctx.fillStyle="white"; |
| | | ctx.fillRect(0,0,cvs.width,cvs.height);// 填充canvas所有区域为白色 |
| | | ctx.putImageData(img_data,0,0); |
| | | return cvs.toDataURL('image/jpeg', 1.0); |
| | | } |
| | | function jsPdfDownload() { |
| | | |
| | | let jtargets = jQuery("#pdf-wrapper .pdf-page"); |
| | | let j_arr = new Array(jtargets.length + 1).join(0).split('').map(function () { return false }); |
| | | let landscape = false; |
| | | let pw = 595.28; |
| | | let ph = 841.89; |
| | | const marginw = 40; |
| | | const marginh = 40; |
| | | |
| | | let orientation = ''; |
| | | if (landscape) { |
| | | pw += ph; ph = pw - ph; pw = pw - ph; |
| | | orientation = 'l'; |
| | | } |
| | | var pdf = new jsPDF(orientation, 'pt', 'a4');// 第一个参数填字母l,注意不是数字1,为横向pdf |
| | | jtargets.each(function (i, e) { |
| | | e.style.background = "#FFFFFF"; |
| | | }) |
| | | |
| | | let rei = 0; |
| | | let recursion = null; |
| | | recursion = function (i) { |
| | | if (i >= jtargets.length) { |
| | | Fun(pdf); |
| | | return; |
| | | } |
| | | e = jtargets[i]; |
| | | html2canvas(e, { |
| | | scale: 2, |
| | | onrendered: function (canvas) { |
| | | /** |
| | | 本方法需要做几个事情 |
| | | 1.需要把canvas的内容分页显示到pdf的页中 |
| | | 2.canvas的宽高需要和pdf的宽高进行映射 |
| | | 3.截取到的内容需要放进一页宽高的canvas里面,并对其余区域刷白 |
| | | */ |
| | | var ctx = canvas.getContext("2d"); |
| | | let canvas_max_page_num = 9; |
| | | let canvas_current_page_num = 0; |
| | | var contentWidth = canvas.width; |
| | | var contentHeight = canvas.height; |
| | | |
| | | |
| | | //未生成pdf的html页面高度 |
| | | var leftHeight = contentHeight; |
| | | //页面偏移 |
| | | var position = 0; |
| | | |
| | | //a4纸的尺寸[595.28,841.89],html页面生成的canvas在pdf中图片的宽高 |
| | | var outputWidth = pw - 2 * marginw;//595.28//左右边距20 |
| | | let rate = outputWidth / 780;//输出宽度和内容宽度的比例 |
| | | var outputHeight = ph - 2 * marginh;//左右边距20 |
| | | let onePdfPageInCanvasHeight = contentWidth/outputWidth*outputHeight;//一页pdf在canvas中的高度; |
| | | //var pageData = canvas.toDataURL('image/jpeg', 1.0); |
| | | var pageData = null; |
| | | var imgData = null; |
| | | |
| | | var captureHeight = null;// 截取的当前canvas页的高度 |
| | | |
| | | let j = i; |
| | | while(position < contentHeight){ |
| | | |
| | | if (j++) { |
| | | pdf.addPage(); |
| | | } |
| | | |
| | | if(position+onePdfPageInCanvasHeight>contentHeight){ |
| | | captureHeight = contentHeight-position; |
| | | }else{ |
| | | captureHeight = onePdfPageInCanvasHeight; |
| | | } |
| | | |
| | | imgData = ctx.getImageData(0,position,contentWidth,captureHeight); |
| | | pageData = ImageDataToUrl(imgData,onePdfPageInCanvasHeight); |
| | | pdf.addImage(pageData, 'JPEG', marginw, marginh, outputWidth, outputHeight);//左右边距20,被输出的图片会被拉伸为outputWidth,outputHeight的宽高 |
| | | canvas_current_page_num++; |
| | | position += onePdfPageInCanvasHeight; |
| | | if (canvas_max_page_num > 0 && canvas_current_page_num >= canvas_max_page_num) { |
| | | break; |
| | | } |
| | | } |
| | | |
| | | recursion(i + 1); |
| | | } |
| | | }) |
| | | }; |
| | | recursion(rei); |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | //blockme(); |
| | | document.body.onload = function(){ |
| | | |
| | | let i = 0; |
| | | let Foo = function(){ |
| | | if ( i == 2) { |
| | | if(confirm("PDF已加载完毕,是否显示?")){ |
| | | jsPdfDownload(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | AWSService.query(staticResourceContact.queryUrl, '{!quoteInfo.conAwsDataId}', function(data){ |
| | | //unblockUI(); |
| | | document.getElementById("accountContactName").innerHTML = data.object.lastName; |
| | | document.getElementById("accountContactPhone").innerHTML = data.object.phone; |
| | | document.getElementById("accountContactEmail").innerHTML = data.object.email; |
| | | i++; |
| | | Foo(); |
| | | }, staticResourceContact.token); |
| | | |
| | | AWSService.query(staticResourceOpportunity.queryUrl, '{!quoteInfo.oppAwsDataId}', function(data){ |
| | | //unblockUI(); |
| | | document.getElementById("dealerContactName").innerHTML = data.object.dealerSalesStaffName; |
| | | i++; |
| | | Foo(); |
| | | }, staticResourceOpportunity.token); |
| | | } |
| | | |
| | | |
| | | |
| | | </script> |
| | | <!-- 20220221 PI改造 by 徐亮 end --> |
| | | </apex:page> |
| | |
| | | <apex:page controller="QuotesPDFController" showHeader="false" sidebar="false" id="allPage" action="{!init}" > |
| | | <apex:page controller="QuotesPDFController" showHeader="false" sidebar="false" id="allPage" action="{!init}" renderAs="pdf"> |
| | | <!-- renderAs="pdf" --> |
| | | |
| | | <html> |
| | |
| | | size: A4 landscape; |
| | | margin: 12mm 12mm 5mm 12mm; |
| | | } |
| | | /* 20220221 PI改造 by 徐亮 start */ |
| | | body{margin: 0 auto; |
| | | width: 780px;} |
| | | #title1{height: 30px;} |
| | | #title2{height: 110px;} |
| | | /* 20220221 PI改造 by 徐亮 end */ |
| | | |
| | | </style> |
| | | <!-- 20220221 PI改造 by 徐亮 start --> |
| | | <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" /> |
| | | <script src="../../soap/ajax/53.0/connection.js" type="text/javascript"></script> |
| | | <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/> |
| | | |
| | | <apex:includeScript value="{!URLFOR($Resource.jspdf)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.html2canvas)}"/> |
| | | |
| | | |
| | | <!-- 20220221 PI改造 by 徐亮 end --> |
| | | </head> |
| | | |
| | | <body> |
| | | <div id="pdf-wrapper"> |
| | | <div id="title1"></div> |
| | | <table border="0" style="font-family: Arial Unicode MS; page-break-inside: auto" width="100%"> |
| | | <colgroup> |
| | | <col width="60%"/> |
| | |
| | | <td> |
| | | <!-- <c:PDFWbr targetStr="{!conName}"/><br/> |
| | | <c:PDFWbr targetStr="{!quo.COMPANYName__c}"/><br/> --> |
| | | <p style="line-height:15px;"><apex:outputField id="BILL_TO__c" value="{!quo.BILL_TO__c}"/><br/> |
| | | <p style="line-height:15px;"><apex:outputField value="{!quo.BILL_TO__c}"/><br/> |
| | | CHINA |
| | | </p> |
| | | </td> |
| | | <td> |
| | | <!-- <c:PDFWbr targetStr="{!conName}"/><br/> |
| | | <c:PDFWbr targetStr="{!quo.COMPANYName__c}"/><br/> --> |
| | | <p style="line-height:15px;"><apex:outputField id="SHIP_TO__c" value="{!quo.SHIP_TO__c}"/><br/> |
| | | <p style="line-height:15px;"><apex:outputField value="{!quo.SHIP_TO__c}"/><br/> |
| | | CHINA |
| | | </p> |
| | | </td> |
| | |
| | | </apex:outputPanel> |
| | | |
| | | <apex:outputPanel layout="none" rendered="{!IF(conName != null, true, false)}"> |
| | | <td style="border-bottom-width: 0;" id="conName">{!conName} </td> |
| | | <td style="border-bottom-width: 0;">{!conName} </td> |
| | | </apex:outputPanel> |
| | | <apex:outputPanel layout="none" rendered="{!IF(conName != null, false, true)}"> |
| | | <td style="border-bottom-width: 0;"> </td> |
| | | </apex:outputPanel> |
| | | |
| | | <apex:outputPanel layout="none" rendered="{!IF(quo.CONTACT_PHONE__c != null, true, false)}"> |
| | | <td style="border-bottom-width: 0;" id="CONTACT_PHONE__c">{!quo.CONTACT_PHONE__c} </td> |
| | | <td style="border-bottom-width: 0;">{!quo.CONTACT_PHONE__c} </td> |
| | | </apex:outputPanel> |
| | | <apex:outputPanel layout="none" rendered="{!IF(quo.CONTACT_PHONE__c != null, false, true)}"> |
| | | <td style="border-bottom-width: 0;"> </td> |
| | |
| | | </apex:outputText></td> |
| | | </tr> |
| | | </table> |
| | | </div> |
| | | |
| | | |
| | | </body> |
| | | <!-- 20220221 PI改造 by 徐亮 start --> |
| | | <script> |
| | | AWSService.sfSessionId = '{!GETSESSIONID()}'; |
| | | var staticResources = JSON.parse('{!staticResource}'); |
| | | var contactStaticResource = JSON.parse('{!contactStaticResource}'); |
| | | |
| | | function Fun(pdf){ |
| | | let uri = pdf.output('datauristring'); |
| | | let matches = /(?<=addFile=)[^&]*/.exec(window.location.href); |
| | | if (matches && matches.length) { |
| | | eval('top.'+matches[0]+'("'+uri+'")'); |
| | | return; |
| | | } |
| | | var iframe = document.createElement('iframe'); |
| | | iframe.setAttribute('style', 'position:absolute;right:0; top:0; bottom:0; height:100%; width:100%'); |
| | | document.body.appendChild(iframe); |
| | | iframe.src = uri; |
| | | for (let e of document.body.childNodes) { |
| | | if (e != iframe && e.style) { |
| | | e.style.display = 'none'; |
| | | } |
| | | } |
| | | } |
| | | |
| | | let id = "pdf-wrapper"; |
| | | var target = document.getElementById(id); |
| | | function jsPdfDownload(){ |
| | | let pdfName = "测试"; |
| | | let id = "pdf-wrapper"; |
| | | var target = document.getElementById(id); |
| | | target.style.background = "#FFFFFF"; |
| | | if(pdfName==''||pdfName==undefined) pdfName= getNowFormatDate(); |
| | | |
| | | html2canvas(target, { |
| | | scale: 2, |
| | | onrendered:function(canvas) { |
| | | let landscape = false; |
| | | let pw = 595.28; |
| | | let ph = 841.89; |
| | | const marginw = 40; |
| | | |
| | | let orientation = ''; |
| | | if (landscape) { |
| | | let temp =ph; |
| | | ph = pw; |
| | | pw = temp; |
| | | orientation = 'l'; |
| | | } |
| | | |
| | | |
| | | var contentWidth = canvas.width; |
| | | var contentHeight = canvas.height; |
| | | |
| | | //一页pdf显示html页面生成的canvas高度; |
| | | var pageHeight = contentWidth / pw * ph; |
| | | //未生成pdf的html页面高度 |
| | | var leftHeight = contentHeight; |
| | | //页面偏移 |
| | | var position = 0; |
| | | //a4纸的尺寸[595.28,841.89],html页面生成的canvas在pdf中图片的宽高 |
| | | var imgWidth = pw-2*marginw;//595.28//左右边距20 |
| | | var imgHeight = imgWidth/contentWidth * contentHeight;//左右边距20 |
| | | |
| | | var pageData = canvas.toDataURL('image/jpeg', 1.0); |
| | | |
| | | var pdf = new jsPDF(orientation, 'pt', 'a4');// 第一个参数填字母l,注意不是数字1,为横向pdf |
| | | |
| | | //有两个高度需要区分,一个是html页面的实际高度,和生成pdf的页面高度(841.89) |
| | | //当内容未超过pdf一页显示的范围,无需分页 |
| | | if (leftHeight < pageHeight) { |
| | | pdf.addImage(pageData, 'JPEG', marginw, 0, imgWidth, imgHeight );//左右边距20 |
| | | } else { |
| | | while(leftHeight > 0) { |
| | | pdf.addImage(pageData, 'JPEG', marginw, position, imgWidth, imgHeight)//左右边距20 |
| | | leftHeight -= pageHeight; |
| | | position -= ph; |
| | | //避免添加空白页 |
| | | if(leftHeight > 0) { |
| | | pdf.addPage(); |
| | | } |
| | | } |
| | | } |
| | | Fun(pdf); |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | document.body.onload = function(){ |
| | | let i = 0; |
| | | let Foo = function(){ |
| | | if(i == 2){ |
| | | jsPdfDownload(); |
| | | } |
| | | } |
| | | if('{!quo.AWS_Data_Id__c}'){ |
| | | AWSService.query(staticResources.queryUrl, '{!quo.AWS_Data_Id__c}', function(data){ |
| | | let e = document.getElementById("allPage:BILL_TO__c");if(e)e.innerHTML = data.object.billTo; |
| | | e =document.getElementById("allPage:SHIP_TO__c");if(e)e.innerHTML = data.object.shipTo; |
| | | e =document.getElementById("CONTACT_PHONE__c");if(e)e.innerHTML = data.object.contactPhone; |
| | | i++; |
| | | Foo(); |
| | | |
| | | }, staticResources.token); |
| | | }else{ |
| | | i++; |
| | | Foo(); |
| | | } |
| | | |
| | | if('{!quo.CONTACT_NAME__r.AWS_Data_Id__c}'){ |
| | | AWSService.query(contactStaticResource.queryUrl, '{!quo.CONTACT_NAME__r.AWS_Data_Id__c}', function(data){ |
| | | let e = document.getElementById("conName");if(e)e.innerHTML = data.object.lastName; |
| | | i++; |
| | | Foo(); |
| | | }, staticResources.token); |
| | | }else{ |
| | | i++; |
| | | Foo(); |
| | | } |
| | | |
| | | |
| | | } |
| | | </script> |
| | | <!-- 20220221 PI改造 by 徐亮 end --> |
| | | </html> |
| | | </apex:page> |
| | |
| | | <!-- </apex:pageBlockSection> --> |
| | | </apex:pageBlock> |
| | | </apex:form> |
| | | <apex:relatedList list="CombinedAttachments" id="Notes"> |
| | | <apex:relatedList list="CombinedAttachments" id="Notes"> |
| | | <apex:facet name="NoteHeader" ></apex:facet> |
| | | </apex:relatedList> |
| | | <script> |
| | |
| | | <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.connection20)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.apex20)}"/> |
| | | <!-- 20220313 PI改造 by Chen Yanan --> |
| | | <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" /> |
| | | |
| | | <script> |
| | | // 20220313 PI改造 by Chen Yanan start |
| | | AWSService.sfSessionId = '{!GETSESSIONID()}'; |
| | | var staticResources = JSON.parse('{!staticResource}'); |
| | | var contactstaticResource = JSON.parse('{!contactstaticResource}'); |
| | | var aws_data = {}; |
| | | console.log('AWS' + '{!contactAWSDataId}'); |
| | | var isNew = {!isNew}; |
| | | console.log('isNew: ' + isNew); |
| | | |
| | | function Decrypt(r,dataIds,callback){ |
| | | if (!(dataIds && dataIds.length)) { |
| | | if(callback)callback(); |
| | | return; |
| | | } |
| | | |
| | | let Foo = function(){ |
| | | for (const id of dataIds) { |
| | | if (aws_data.hasOwnProperty(id)) { |
| | | let d = aws_data[id]; |
| | | let $e =j$("[aws-id='"+d.dataId+ "']"); |
| | | $e.each((i,e)=>{ |
| | | //j$(e).html(d[j$(e).attr("aws-api")]); |
| | | j$(e).attr('value',d[j$(e).attr("aws-api")]) |
| | | }) |
| | | |
| | | } |
| | | } |
| | | if(callback)callback(); |
| | | } |
| | | let ids = []; |
| | | for (const id of dataIds) { |
| | | if (!aws_data.hasOwnProperty(id)) { |
| | | ids.push(id); |
| | | } |
| | | } |
| | | if (ids.length > 0) { |
| | | |
| | | // AWSService.search(r.searchUrl,JSON.stringify({ |
| | | // "dataIds":ids |
| | | // }),function(data){ |
| | | AWSService.query(r.queryUrl,ids[0],function(data){ |
| | | console.log('data: ' + JSON.stringify(data)); |
| | | // if(data.object && data.object.length > 0){ |
| | | if(data.object){ |
| | | |
| | | // for(let d of data.object){ |
| | | // if(d.dataId){ |
| | | // aws_data[d.dataId] = d; |
| | | // } |
| | | // } |
| | | aws_data[data.object.dataId] = data.object; |
| | | Foo(); |
| | | }else{ |
| | | if(callback)callback(); |
| | | } |
| | | },r.token); |
| | | }else{ |
| | | Foo(); |
| | | } |
| | | } |
| | | |
| | | function DecryptAll(callback){ |
| | | let dataIds1 = []; |
| | | j$('[aws-id][aws-obj="Contact"]').each((i,e)=>{ |
| | | let v = j$(e).attr('aws-id'); |
| | | if (v) { |
| | | dataIds1.push(v); |
| | | } |
| | | }); |
| | | Decrypt(contactstaticResource,dataIds1,callback); |
| | | |
| | | |
| | | } |
| | | |
| | | function DecryptSWOAll(callback) { |
| | | let dataIds2 = []; |
| | | j$('[aws-id][aws-obj="SWO__c"]').each((i,e)=>{ |
| | | let v = j$(e).attr('aws-id'); |
| | | if (v) { |
| | | dataIds2.push(v); |
| | | } |
| | | }); |
| | | Decrypt(staticResources,dataIds2,callback); |
| | | } |
| | | |
| | | j$(function(){ |
| | | DecryptSWOAll(); |
| | | DecryptAll(); |
| | | }) |
| | | // 20220313 PI改造 by Chen Yanan end |
| | | var IS_OPEN = true; |
| | | |
| | | j$(document).ready(function() { |
| | |
| | | IS_OPEN = false; |
| | | } |
| | | } |
| | | //Add By Li JUn for PIPL 20220414 Start |
| | | var aws_result = {}; |
| | | |
| | | function saveSWOToAWS(){ |
| | | // document.getElementById("errorMsg").innerHTML = ''; |
| | | // if(!document.getElementById("Page:mainForm:idSearchVisitor:updateContactLastName").value){ |
| | | // document.getElementById("errorMsg").innerHTML = '<strong>错误:</strong> 必须填写。'; |
| | | // return; |
| | | // } |
| | | blockme(); |
| | | let es = document.getElementsByTagName('select') |
| | | for(let ei in es){ |
| | | let e = es[ei]; |
| | | for(let opi in e.options){ |
| | | let op = e.options[opi]; |
| | | if(!op)continue; |
| | | if(op.value == "*****" && op.selected){ |
| | | unblockUI(); |
| | | alert('下拉框不能主动选择密文选项') |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | ProcessPIForAWS({},GetEditObj()); |
| | | } |
| | | |
| | | function ProcessPIForAWS(sobjJson, payloadForNewPI) { |
| | | let url = staticResources.newUrl |
| | | let moduleName = AWSService.insertModule; |
| | | if (!isNew) { |
| | | console.log('Update'); |
| | | moduleName = AWSService.updateModule; |
| | | url = staticResources.updateUrl |
| | | } |
| | | console.log('Payload for AWS:'+payloadForNewPI + ' Module Name:'+moduleName); |
| | | // AWSService.postAWS(url,moduleName, payloadForNewPI, function(result){ |
| | | AWSService.post(url, payloadForNewPI, function(result){ |
| | | aws_result = result; |
| | | SetEditObj(); |
| | | saveNew(); |
| | | }, staticResources.token); |
| | | } |
| | | |
| | | function GetEditObj(){ |
| | | var swoId = j$(escapeVfId("swoid")).value(); |
| | | console.log('swoId: ' + swoId); |
| | | return JSON.stringify([{ |
| | | // lastName : document.getElementById("Page:mainForm:idSearchVisitor:updateContactLastName").value, |
| | | // phone : document.getElementById("Page:mainForm:idSearchVisitor:updateContactPhone").value, |
| | | // type : document.getElementById("Page:mainForm:idSearchVisitor:updateContactType").value, |
| | | // doctorDivision1 : document.getElementById("Page:mainForm:idSearchVisitor:updateContactDoctorDivision").value, |
| | | // dataId:selectedAwsDataId |
| | | contactNameHidden: document.getElementById("Page:mainForm:CONTACT_NAME_HIDDEN__c").value, |
| | | dataId:'{!swoawsDataId}' |
| | | }]); |
| | | } |
| | | |
| | | function SetEditObj(){ |
| | | let obj = GetAWSResultObj(); |
| | | if(obj){ |
| | | console.log('Result from AWS:'+JSON.stringify(obj)); |
| | | document.getElementById('Page:mainForm:AWS_Data_Id__c').value = obj.dataId; |
| | | document.getElementById("Page:mainForm:CONTACT_NAME_HIDDEN__c").value = obj.contactNameHidden; |
| | | |
| | | // document.getElementById("Page:mainForm:idSearchVisitor:updateContactLastName").value = obj.lastName; |
| | | // document.getElementById("Page:mainForm:LastName_Encrypted__c").value = obj.lastNameEncrypt; |
| | | |
| | | // document.getElementById("Page:mainForm:idSearchVisitor:updateContactPhone").value = obj.phone; |
| | | // document.getElementById("Page:mainForm:Phone_Encrypted__c").value = obj.phoneEncrypt; |
| | | |
| | | // document.getElementById("Page:mainForm:idSearchVisitor:updateContactType").value = obj.type; |
| | | // document.getElementById("Page:mainForm:Type_Encrypted__c").value = obj.typeEncrypt; |
| | | |
| | | // document.getElementById("Page:mainForm:idSearchVisitor:updateContactDoctorDivision").value = obj.doctorDivision1; |
| | | // document.getElementById("Page:mainForm:Doctor_Division1_Encrypted__c").value = obj.doctorDivision1Encrypt; |
| | | } |
| | | |
| | | } |
| | | |
| | | function GetAWSResultObj(){ |
| | | if(aws_result && aws_result.object && aws_result.object.length > 0){ |
| | | return aws_result.object[0]; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | function Trans(){ |
| | | console.log('SWO ID : ' + document.getElementById('swoid').value); |
| | | var swoId = j$(escapeVfId("swoid")).value(); |
| | | console.log('SFRcordId:'+swoId); |
| | | // AWSService.postAWS(staticResources.transactionUrl,AWSService.confirmTrans, JSON.stringify({ |
| | | // "txId":aws_result.txId, |
| | | // "sfRecordId":swoId, |
| | | // "isSuccess":1 |
| | | // }), function(result){ |
| | | AWSService.post(staticResources.transactionUrl, JSON.stringify({ |
| | | "txId":aws_result.txId, |
| | | "sfRecordId":swoId, |
| | | "isSuccess":1 |
| | | }), function(result){ |
| | | //let id = document.getElementById('Page:mainForm:frontSwoId').value |
| | | let id = j$(escapeVfId("swoid")).value(); |
| | | window.location.href = '/apex/SWOPageRead?id=' + id +'&type='+'{!type}'; |
| | | //window.location.reload(); |
| | | }, staticResources.token); |
| | | } |
| | | |
| | | //Add By Li JUn for PIPL 20220414 End |
| | | </script> |
| | | |
| | | <style type="text/css"> |
| | |
| | | </style> |
| | | |
| | | <apex:form id="mainForm" style="width: 95%; margin-left: 30px;"> |
| | | |
| | | <apex:actionFunction name="mustData" action="{!mustData}" reRender="messageInfo" oncomplete="clickColorChange('Repair')"></apex:actionFunction> |
| | | <apex:actionFunction name="repairReturn" action="{!init}" reRender="mainForm" > |
| | | <apex:param name="swoid" assignTo="{!swoid}" value="" /><!-- mailRepair mainForm--> |
| | |
| | | <apex:actionFunction name="openPageSave" action="{!openPageSave}" reRender=""> |
| | | </apex:actionFunction> |
| | | <apex:actionFunction name="uploadFile" action="{!uploadFile}"></apex:actionFunction> |
| | | <!-- Add save method for PIPL 20220414 by Li Jun Start --> |
| | | <apex:inputHidden id="frontSwoId" value="{!frontSwoId}" /> |
| | | <apex:actionFunction name="saveNew" action="{!save}" reRender="swoid,frontSwoId" onComplete="Trans()"> |
| | | <apex:param name="frontCaseId" assignto="{!caseId}" value="{!caseId}"/> |
| | | </apex:actionFunction> |
| | | <!-- Add save method for PIPL 20220414 by Li Jun End --> |
| | | <input type="hidden" id="baseUrl" value="{!baseUrl}"/> |
| | | <input type="hidden" id="swoid" value="{!swoid}"/> |
| | | <input type="hidden" id="type" value="{!type}"/> |
| | |
| | | <apex:outputPanel id="messageInfo"> |
| | | <apex:pagemessages /> |
| | | </apex:outputPanel> |
| | | <!-- Before PIPL Update 20220414 By Chen Yanan Start --> |
| | | <!-- <apex:commandButton onclick="blockme();" value="Save" action="{!save}" style="width: 5%;"/> --> |
| | | <!-- Before PIPL Update 20220414 By Chen Yanan end --> |
| | | <!-- After PIPL Update 20220414 By Chen Yanan Start --> |
| | | <apex:commandButton id="saveSWO" value="Save" style="width: 5%;" onclick="saveSWOToAWS();" rerender="dummy" /> |
| | | <!-- After PIPL Update 20220414 By Chen Yanan end --> |
| | | <apex:commandButton onclick="blockme();" value="Save" action="{!save}" style="width: 5%;"/> |
| | | <table style="width: 100%;"> |
| | | <colgroup> |
| | | <col width="16%"/> |
| | |
| | | <td colspan="2">{!$ObjectType.SWO__c.fields.OFFICE__c.label}<span class="textRed">*</span></td> |
| | | <td><apex:inputField value="{!swo.TYPE__c}"/></td> |
| | | <td colspan="2">{!$ObjectType.SWO__c.fields.CONTACT_NAME_HIDDEN__c.label}</td> |
| | | |
| | | </tr> |
| | | |
| | | <tr> |
| | | <td colspan="2"><apex:inputField value="{!swo.OFFICE__c}"/></td> |
| | | <td></td> |
| | | <!-- Update By Yanan --> |
| | | <!-- <td colspan="2"><apex:inputField value="{!swo.CONTACT_NAME_HIDDEN__c}"/></td> --> |
| | | <td colspan="2" > |
| | | <apex:inputHidden id="AWS_Data_Id__c" value="{!swo.AWS_Data_Id__c}"/> |
| | | <apex:inputField html-aws-obj="SWO__c" html-aws-api="contactNameHidden" html-aws-id="{!swo.AWS_Data_Id__c}" id="CONTACT_NAME_HIDDEN__c" value="{!swo.CONTACT_NAME_HIDDEN__c }" /> |
| | | </td> |
| | | <!-- Update By Yanan --> |
| | | <td colspan="2"><apex:inputField value="{!swo.CONTACT_NAME_HIDDEN__c}"/></td> |
| | | </tr> |
| | | |
| | | <tr> |
| | |
| | | <table style="width: 100%;border-collapse: collapse;"> |
| | | <tr class="title"> |
| | | <td id="titleProduct" class="title1"><apex:commandLink oncomplete="clickColorChange('Product')" action="{!setProduct}" reRender="table" value="Product Info" /></td> |
| | | <!-- PIPL Update 20220414 By Chen Yanan Start --> |
| | | <!-- <td id="titleCase" class="title1"><apex:commandLink oncomplete="clickColorChange('Case')" action="{!setCase}" reRender="table" value="Case Info" /></td> --> |
| | | <!-- After --> |
| | | <td id="titleCase" class="title1"><apex:commandLink oncomplete="clickColorChange('Case');DecryptAll();" action="{!setCase}" reRender="table" value="Case Info" /></td> |
| | | <!-- PIPL Update 20220414 By Chen Yanan End --> |
| | | <td id="titlemail" class="title1"><apex:commandLink oncomplete="clickColorChange('mail')" action="{!setMail}" reRender="table" value="Mail Merge" /></td> |
| | | <td id="titleCase" class="title1"><apex:commandLink oncomplete="clickColorChange('Case')" action="{!setCase}" reRender="table" value="Case Info" /></td> |
| | | <td id="titlemail" class="title1"><apex:commandLink oncomplete="clickColorChange('mail')" action="{!setMail}" reRender="table" value="Mail Merge" /></td> |
| | | <td id="titleTracking" class="title1"><apex:commandLink oncomplete="clickColorChange('Tracking')" action="{!setTracking}" reRender="table" value="Tracking" /></td> |
| | | <td id="titleTechnical" class="title1"><apex:commandLink oncomplete="clickColorChange('Technical')" action="{!setTechnical}" reRender="table" value="Technical Info" /></td> |
| | | <td id="titleEstimation" class="title1"><apex:commandLink oncomplete="clickColorChange('Estimation')" action="{!setEstimation}" reRender="table" value="Estimation" /></td> |
| | |
| | | </tr> |
| | | <tr> |
| | | <td><apex:outputField value="{!swo.CASE_NUMBER__c}" ></apex:outputField></td> |
| | | <!-- PIPL Update 20220414 By Chen Yanan Start --> |
| | | <!-- <td><apex:inputField value="{!swo.EMAIL__c}"/></td> --> |
| | | <td colspan="2" align="left" > |
| | | <apex:inputField html-aws-obj="Contact" html-aws-api="email" html-aws-id="{!contactAWSDataId}" value="{!swo.EMAIL__c}" /> |
| | | </td> |
| | | |
| | | <!-- PIPL Update 20220414 By Chen Yanan End --> |
| | | <td><apex:inputField value="{!swo.EMAIL__c}"/></td> |
| | | </tr> |
| | | <tr> |
| | | <td>{!$ObjectType.SWO__c.fields.COMPANY__c.label}</td> |
| | |
| | | <td>{!$ObjectType.SWO__c.fields.TRAN__c.label}</td> |
| | | </tr> |
| | | <tr> |
| | | <!-- 20220313 PI改造 by Chen Yanan --> |
| | | <!-- <td><apex:outputField value="{!swo.CONTACT__c}" ></apex:outputField></td> --> |
| | | <td colspan="2" align="left" > |
| | | <!-- <a href="/{!swo.CONTACT__c}" aws-obj="Contact" aws-api="lastName" aws-id="{!contactAWSDataId}">{!swo.CONTACT__r.Name}</a> --> |
| | | <a href="/{!swo.CONTACT__c}" aws-obj="Contact" aws-api="lastName" aws-id="{!contactAWSDataId}">{!contactName}</a> |
| | | </td> |
| | | <!-- 20220313 PI改造 by Chen Yanan --> |
| | | <td><apex:outputField value="{!swo.CONTACT__c}" ></apex:outputField></td> |
| | | <td><apex:inputField value="{!swo.TRAN__c}"/></td> |
| | | </tr> |
| | | </table> |
| | |
| | | </apex:outputPanel> |
| | | |
| | | <apex:outputPanel rendered="{!IF(type = 'General' || type = 'All',true,false)}"> |
| | | <!-- Before PIPL Update by Li Jun 20220414 Start --> |
| | | <apex:commandButton value="Attach" action="{!uploadFile}"></apex:commandButton> |
| | | <!-- Before PIPL Update by Li Jun 20220414 End --> |
| | | <!-- After PIPL Update by Li Jun 20220414 Start --> |
| | | <input class="btn" type="Button" value="PIPL Attach" onclick="window.open('/apex/SWOFileUploadPage')" /> |
| | | <!-- After PIPL Update by Li Jun 20220414 End --> |
| | | <apex:commandButton value="Attach" onclick="uploadFileJS();return false;"></apex:commandButton> |
| | | |
| | | |
| | | <table class="tableCss" style="border:1px solid #000000;width: 80%"> |
| | | <tr style="text-align:center;"> |
| | | <th style="text-align:center;width: 33%;">File Name</th> |
| | |
| | | <apex:repeat id="attachmentList" value="{!attachmentList}" var="attachment"> |
| | | <tr style="text-align:center; vertical-align: middle;"> |
| | | <!-- <td><input value="{!attachment.Name}" readonly="readonly" style="border:none;"/></td> --> |
| | | <td><apex:outputLink value="/{!attachment.Id}">{!attachment.FileName__c}</apex:outputLink></td> |
| | | <td><apex:outputLink value="/{!attachment.Id}">{!attachment.Name}</apex:outputLink></td> |
| | | <td><apex:inputField value="{!attachment.CreatedDate}"/></td> |
| | | <!-- <td><apex:inputField value="{!attachment.BodyLength}"/></td>--> |
| | | <td><apex:inputField value="{!attachment.BodyLength}"/></td> |
| | | </tr> |
| | | </apex:repeat> |
| | | </table> |
| | |
| | | <br/> |
| | | <br/> |
| | | <!-- <apex:commandButton action="{!save}" onclick="blockme();" value="Save" oncomplete="isOk();unblockUI();" reRender="Page,mainForm" style="width: 5%;"/> --> |
| | | <!-- PIPL Update 20220414 By Chen Yanan --> |
| | | <!-- <apex:commandButton onclick="blockme();" value="Save" action="{!save}" style="width: 5%;"/> --> |
| | | <apex:commandButton id="saveSWOs" value="Save" style="width: 5%;" onclick="saveSWOToAWS();" rerender="dummy" /> |
| | | <!-- PIPL Update 20220414 By Chen Yanan --> |
| | | |
| | | <apex:commandButton onclick="blockme();" value="Save" action="{!save}" style="width: 5%;"/> |
| | | |
| | | </apex:form> |
| | | |
| | | <br/> |
| | |
| | | <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.connection20)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.apex20)}"/> |
| | | <!-- Update 20220315 By Chen Yanan --> |
| | | <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" /> |
| | | |
| | | <script> |
| | | // 20220315 PI改造 by Chen Yanan start |
| | | var staticResources = JSON.parse('{!staticResource}'); |
| | | var contactstaticResource = JSON.parse('{!contactstaticResource}'); |
| | | var aws_data = {}; |
| | | console.log('AWS' + '{!contactAWSDataId}'); |
| | | |
| | | function Decrypt(r,dataIds,callback){ |
| | | if (!(dataIds && dataIds.length)) { |
| | | if(callback)callback(); |
| | | return; |
| | | } |
| | | |
| | | let Foo = function(){ |
| | | for (const id of dataIds) { |
| | | if (aws_data.hasOwnProperty(id)) { |
| | | let d = aws_data[id]; |
| | | let $e =j$("[aws-id='"+d.dataId+ "']"); |
| | | $e.each((i,e)=>{ |
| | | j$(e).html(d[j$(e).attr("aws-api")]); |
| | | }) |
| | | |
| | | } |
| | | } |
| | | if(callback)callback(); |
| | | } |
| | | let ids = []; |
| | | for (const id of dataIds) { |
| | | if (!aws_data.hasOwnProperty(id)) { |
| | | ids.push(id); |
| | | } |
| | | } |
| | | if (ids.length > 0) { |
| | | |
| | | // AWSService.search(r.searchUrl,JSON.stringify({ |
| | | // "dataIds":ids |
| | | // }),function(data){ |
| | | AWSService.query(r.queryUrl,ids[0],function(data){ |
| | | console.log('data: ' + JSON.stringify(data)); |
| | | // if(data.object && data.object.length > 0){ |
| | | if(data.object){ |
| | | |
| | | // for(let d of data.object){ |
| | | // if(d.dataId){ |
| | | // aws_data[d.dataId] = d; |
| | | // } |
| | | // } |
| | | aws_data[data.object.dataId] = data.object; |
| | | Foo(); |
| | | }else{ |
| | | if(callback)callback(); |
| | | } |
| | | },r.token); |
| | | }else{ |
| | | Foo(); |
| | | } |
| | | } |
| | | |
| | | function DecryptAll(callback){ |
| | | let dataIds1 = []; |
| | | j$('[aws-id][aws-obj="Contact"]').each((i,e)=>{ |
| | | let v = j$(e).attr('aws-id'); |
| | | if (v) { |
| | | dataIds1.push(v); |
| | | } |
| | | }); |
| | | Decrypt(contactstaticResource,dataIds1,callback); |
| | | |
| | | |
| | | } |
| | | |
| | | function DecryptSWOAll(callback) { |
| | | let dataIds2 = []; |
| | | j$('[aws-id][aws-obj="SWO__c"]').each((i,e)=>{ |
| | | let v = j$(e).attr('aws-id'); |
| | | if (v) { |
| | | dataIds2.push(v); |
| | | } |
| | | }); |
| | | Decrypt(staticResources,dataIds2,callback); |
| | | } |
| | | |
| | | j$(function(){ |
| | | DecryptSWOAll(); |
| | | DecryptAll(); |
| | | }) |
| | | // 20220315 PI改造 by Chen Yanan end |
| | | |
| | | j$(document).ready(function() { |
| | | var type = j$(escapeVfId("type")).value(); |
| | | clickColorChange(type); |
| | |
| | | <tr> |
| | | <td colspan="2"><apex:outputField value="{!swo.OFFICE__c}"/></td> |
| | | <td></td> |
| | | <!-- 20220315 PI改造 by Chen Yanan start --> |
| | | <!-- <td colspan="2"><apex:outputField value="{!swo.CONTACT_NAME_HIDDEN__c}"/></td> --> |
| | | <!-- <td colspan="2" align="left" ><apex:outputField html-aws-obj="SWO__C" html-aws-api="contactName" html-aws-id="{!swo.CONTACT_NAME_HIDDEN__c}" id="CONTACT_NAME_HIDDEN__c" value="{!swo.CONTACT_NAME_HIDDEN__c}"/></td> --> |
| | | <td colspan="2" align="left" ><apex:outputField html-aws-obj="SWO__c" html-aws-api="contactNameHidden" html-aws-id="{!swo.AWS_Data_Id__c}" id="CONTACT_NAME_HIDDEN__c" value="{!swo.CONTACT_NAME_HIDDEN__c}"/></td> |
| | | <!-- 20220315 PI改造 by Chen Yanan End --> |
| | | <td colspan="2"><apex:outputField value="{!swo.CONTACT_NAME_HIDDEN__c}"/></td> |
| | | </tr> |
| | | |
| | | <tr> |
| | |
| | | <table style="width: 100%;border-collapse: collapse;"> |
| | | <tr class="title"> |
| | | <td id="titleProduct" class="title1"><apex:commandLink oncomplete="clickColorChange('Product')" action="{!setProduct}" reRender="table" value="Product Info" /></td> |
| | | <!-- PIPL Update 20220414 By Chen Yanan Start --> |
| | | <!-- <td id="titleCase" class="title1"><apex:commandLink oncomplete="clickColorChange('Case')" action="{!setCase}" reRender="table" value="Case Info" /></td> --> |
| | | <!-- After --> |
| | | <td id="titleCase" class="title1"><apex:commandLink oncomplete="clickColorChange('Case');DecryptAll();" action="{!setCase}" reRender="table" value="Case Info" /></td> |
| | | <!-- PIPL Update 20220414 By Chen Yanan End --> |
| | | <td id="titlemail" class="title1"><apex:commandLink oncomplete="clickColorChange('mail')" action="{!setMail}" reRender="table" value="Mail Merge" /></td> |
| | | <td id="titleCase" class="title1"><apex:commandLink oncomplete="clickColorChange('Case')" action="{!setCase}" reRender="table" value="Case Info" /></td> |
| | | <td id="titlemail" class="title1"><apex:commandLink oncomplete="clickColorChange('mail')" action="{!setMail}" reRender="table" value="Mail Merge" /></td> |
| | | <td id="titleTracking" class="title1"><apex:commandLink oncomplete="clickColorChange('Tracking')" action="{!setTracking}" reRender="table" value="Tracking" /></td> |
| | | <td id="titleTechnical" class="title1"><apex:commandLink oncomplete="clickColorChange('Technical')" action="{!setTechnical}" reRender="table" value="Technical Info" /></td> |
| | | <td id="titleEstimation" class="title1"><apex:commandLink oncomplete="clickColorChange('Estimation')" action="{!setEstimation}" reRender="table" value="Estimation" /></td> |
| | |
| | | <td><apex:outputText value="{!mail.haveAtt}" /></td> |
| | | <td> |
| | | <apex:repeat value="{!mail.attList}" var="att" id="lines"> |
| | | <apex:outputLink value="/{!att.Id}"><c:PDFWbr targetStr="{!att.FileName__c}" /></apex:outputLink> |
| | | <apex:outputLink value="/{!att.Id}"><c:PDFWbr targetStr="{!att.Name}" /></apex:outputLink> |
| | | <br/> |
| | | </apex:repeat> |
| | | </td> |
| | |
| | | </tr> |
| | | <tr> |
| | | <td><apex:outputField value="{!swo.CASE_NUMBER__c}" ></apex:outputField></td> |
| | | <!-- PIPL Update 20220414 By Chen Yanan Start --> |
| | | <!-- <td><apex:inputField value="{!swo.EMAIL__c}"/></td> --> |
| | | <td colspan="2" align="left" > |
| | | <apex:inputField html-aws-obj="Contact" html-aws-api="email" html-aws-id="{!contactAWSDataId}" value="{!swo.EMAIL__c}" /> |
| | | </td> |
| | | |
| | | <!-- PIPL Update 20220414 By Chen Yanan End --> |
| | | <td><apex:outputField value="{!swo.EMAIL__c}"/></td> |
| | | </tr> |
| | | <tr> |
| | | <td class="hand">{!$ObjectType.SWO__c.fields.COMPANY__c.label}</td> |
| | |
| | | <td class="hand">{!$ObjectType.SWO__c.fields.TRAN__c.label}</td> |
| | | </tr> |
| | | <tr> |
| | | <!-- 20220315 PI改造 by Chen Yanan start --> |
| | | <!-- <td><apex:outputField value="{!swo.CONTACT__c}" ></apex:outputField></td> --> |
| | | <td colspan="2" align="left" > |
| | | <a href="/{!swo.CONTACT__c}" aws-obj="Contact" aws-api="lastName" aws-id="{!contactAWSDataId}">{!swo.CONTACT__r.Name}</a> |
| | | </td> |
| | | <!-- 20220315 PI改造 by Chen Yanan End --> |
| | | <td><apex:outputField value="{!swo.CONTACT__c}" ></apex:outputField></td> |
| | | <td><apex:outputField value="{!swo.TRAN__c}"/></td> |
| | | </tr> |
| | | </table> |
| | |
| | | </apex:outputPanel> |
| | | |
| | | <apex:outputPanel rendered="{!IF(type = 'General' || type = 'All',true,false)}"> |
| | | <!-- Before PIPL Update by Li Jun 20220414 Start --> |
| | | <apex:commandButton value="Attach" action="{!uploadFile}"></apex:commandButton> |
| | | <!-- Before PIPL Update by Li Jun 20220414 End --> |
| | | <input class="btn" type="Button" value="PIPL Attach" onclick="window.open('/apex/SWOFileUploadPage')" /> |
| | | |
| | | |
| | | <table class="tableCss" style="border:1px solid #000000;width: 80%"> |
| | | <tr style="text-align:center;"> |
| | | <th style="text-align:center;width: 33%;">File Name</th> |
| | |
| | | <apex:repeat id="attachmentList" value="{!attachmentList}" var="attachment"> |
| | | <tr style="text-align:center; vertical-align: middle;"> |
| | | <!-- <td><output value="{!attachment.Name}" readonly="readonly" style="border:none;"/></td> --> |
| | | <td><apex:outputLink value="/{!attachment.Id}">{!attachment.FileName__c}</apex:outputLink></td> |
| | | <td><apex:outputLink value="/{!attachment.Id}">{!attachment.Name}</apex:outputLink></td> |
| | | <td><apex:outputField value="{!attachment.CreatedDate}"/></td> |
| | | <!-- <td><apex:outputField value="{!attachment.BodyLength}"/></td> --> |
| | | <td><apex:outputField value="{!attachment.BodyLength}"/></td> |
| | | </tr> |
| | | </apex:repeat> |
| | | </table> |
| | |
| | | <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.connection20)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.apex20)}"/> |
| | | <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" /> |
| | | <style type="text/css"> |
| | | td{line-height: 32px;} |
| | | [aws-api] { |
| | | position: relative; |
| | | } |
| | | [aws-api] .decrypt{ |
| | | position: absolute; |
| | | top: 50%;left: 0; |
| | | display: none; |
| | | text-align: left; |
| | | /* padding-left: 5px; */ |
| | | } |
| | | /* [aws-api]:hover .decrypt{display: block;width: 100px} */ |
| | | |
| | | </style> |
| | | <script> |
| | | AWSService.sfSessionId = '{!GETSESSIONID()}'; |
| | | var staticResource = JSON.parse('{!staticResource}'); |
| | | |
| | | var aws_data = {}; |
| | | |
| | | //zhj 2022-04-22 PIPL start |
| | | //js hover |
| | | function jsHover(){ |
| | | var encrypts = document.getElementsByClassName('encrypt'); |
| | | for(var i = 0;i<encrypts.length;i++){ |
| | | encrypts[i].onmouseover = (function close(j) { |
| | | return function () { |
| | | //显示Name |
| | | encrypts[j].children[1].children[0].innerText = encrypts[j].children[1].children[1].innerText |
| | | //显示Email |
| | | encrypts[j].children[2].children[0].innerText = encrypts[j].children[2].children[1].innerText |
| | | } |
| | | })(i); |
| | | } |
| | | } |
| | | //zhj 2022-04-22 PIPL end |
| | | |
| | | function Decrypt(r,dataIds,callback){ |
| | | if (!(dataIds && dataIds.length)) { |
| | | if(callback)callback(); |
| | | return; |
| | | } |
| | | |
| | | let Foo = function(){ |
| | | for (const id of dataIds) { |
| | | if (aws_data.hasOwnProperty(id)) { |
| | | let d = aws_data[id]; |
| | | let $e =j$("[aws-id='"+d.dataId+ "']"); |
| | | $e.each((i,e)=>{ |
| | | j$(e).find(".decrypt").html(d[j$(e).attr("aws-api")]); |
| | | }) |
| | | |
| | | } |
| | | } |
| | | if(callback)callback(); |
| | | jsHover(); |
| | | } |
| | | let ids = []; |
| | | for (const id of dataIds) { |
| | | if (!aws_data.hasOwnProperty(id)) { |
| | | ids.push(id); |
| | | } |
| | | } |
| | | if (ids.length > 0) { |
| | | |
| | | AWSService.search(r.searchUrl,JSON.stringify({ |
| | | "dataIds":ids |
| | | }),function(data){ |
| | | |
| | | if(data.object && data.object.length > 0){ |
| | | |
| | | for(let d of data.object){ |
| | | if(d.dataId){ |
| | | aws_data[d.dataId] = d; |
| | | } |
| | | } |
| | | Foo(); |
| | | }else{ |
| | | if(callback)callback(); |
| | | } |
| | | },r.token); |
| | | }else{ |
| | | Foo(); |
| | | } |
| | | } |
| | | |
| | | function DecryptAll(callback){ |
| | | let dataIds = []; |
| | | j$('[aws-id][aws-obj="Contact"]').each((i,e)=>{ |
| | | let v = j$(e).attr('aws-id'); |
| | | if (v) { |
| | | dataIds.push(v); |
| | | } |
| | | }); |
| | | Decrypt(staticResource,dataIds,callback); |
| | | } |
| | | |
| | | j$(function(){ |
| | | //DecryptAll(); |
| | | |
| | | }) |
| | | |
| | | function doSearchJS(){ |
| | | blockme(); |
| | | var searchByName = j$(escapeVfId("searchByName")).value(); |
| | | var searchByAccount = j$(escapeVfId("searchByAccount")).value(); |
| | | var searchByAWSDataIds = j$(escapeVfId("searchByAWSDataIds")).value(); |
| | | var memberType = j$(escapeVfId('Page:allData:memberType')).value(); |
| | | if (memberType == "Contact" && searchByName) { |
| | | AWSService.search(staticResource.searchUrl,JSON.stringify({ |
| | | contactName:searchByName |
| | | }),function(data){ |
| | | if (data && data.object && data.object.length) { |
| | | let ids = data.object.map(m=>m.dataId); |
| | | DoSearch(searchByName,searchByAccount,ids.join(',')); |
| | | }else{ |
| | | unblockUI(); |
| | | } |
| | | |
| | | },staticResource.token); |
| | | }else{ |
| | | DoSearch(searchByName,searchByAccount,[]); |
| | | } |
| | | |
| | | |
| | | DoSearch(searchByName,searchByAccount); |
| | | } |
| | | function saveJS(){ |
| | | blockme(); |
| | |
| | | } |
| | | var lineNum = j$(escapeVfId("lineNum")).value(); |
| | | var memberId = j$(escapeVfId("memberId")).value(); |
| | | var memberName = aws_data[j$(escapeVfId("aws_data_id")).value()].lastName; |
| | | var memberEmail = aws_data[j$(escapeVfId("aws_data_id")).value()].email; |
| | | var memberName = j$(escapeVfId("memberName")).value(); |
| | | var memberEmail = j$(escapeVfId("memberEmail")).value(); |
| | | window.opener.refreshPage(lineNum,memberId,memberName,memberEmail); |
| | | window.close(); |
| | | } |
| | |
| | | j$(escapeVfId("dataAccount")).attr("style","display:block"); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | </script> |
| | | <div style="width: 100%;height: 100%;"> |
| | | <apex:outputPanel id="message1"> |
| | | <apex:messages styleClass="editListError"/> |
| | | </apex:outputPanel> |
| | | <apex:form id="allData"> |
| | | <apex:actionFunction action="{!SearchMember}" name="DoSearch" reRender="result" oncomplete="DecryptAll(unblockUI);"> |
| | | <apex:actionFunction action="{!SearchMember}" name="DoSearch" reRender="result" oncomplete="unblockUI();"> |
| | | <apex:param assignTo="{!searchByName}" name="searchByName" value=""></apex:param> |
| | | <apex:param assignTo="{!searchByAccount}" name="searchByAccount" value=""></apex:param> |
| | | <apex:param assignTo="{!searchByAWSDataIds}" name="searchByAWSDataIds" value=""></apex:param> |
| | | </apex:actionFunction> |
| | | <apex:actionFunction action="{!save}" name="save" reRender="allData,message1" oncomplete="DecryptAll(()=>{unblockUI();refreshPage();closeJS();});"> |
| | | <apex:actionFunction action="{!save}" name="save" reRender="allData,message1" oncomplete="unblockUI();refreshPage();closeJS();"> |
| | | </apex:actionFunction> |
| | | <input type="hidden" id="isError" value="{!isError}" /> |
| | | <input type="hidden" id="lineNum" value="{!lineNum}" /> |
| | | <input type="hidden" id="memberId" value="{!memberId}" /> |
| | | <input type="hidden" id="memberName" value="{!memberName}" /> |
| | | <input type="hidden" id="memberEmail" value="{!memberEmail}" /> |
| | | <input type="hidden" id="aws_data_id" value="{!aws_data_id}" /> |
| | | |
| | | <table style="width: 100%;"> |
| | | <colgroup> |
| | |
| | | <tr> |
| | | <th style="text-align:center;"><apex:commandButton value="Search" onclick="doSearchJS();return false;" /> <apex:commandButton value="Save" onclick="saveJS();return false;"/></th> |
| | | |
| | | <th id="nameLable" style="text-align:center;"><input id="searchByAWSDataIds" type="hidden" value="{!searchByAWSDataIds}" /> Name:<input id="searchByName" type="text" value="{!searchByName}" /></th> |
| | | <th id="nameLable" style="text-align:center;">Name:<input id="searchByName" type="text" value="{!searchByName}" /></th> |
| | | |
| | | <th style="text-align:center;"><div id="accountLable">Account:<input id="searchByAccount" type="text" value="{!searchByAccount}" /></div></th> |
| | | |
| | |
| | | </apex:outputPanel> --> |
| | | </tr> |
| | | <apex:repeat value="{!lineList}" var="line"> |
| | | <tr class="encrypt"> |
| | | <tr> |
| | | <td style="text-align:right;"> |
| | | <apex:inputCheckbox id="checkbox" value="{!line.check}" /> |
| | | </td> |
| | | <td aws-obj="Contact" aws-api="lastName" aws-id="{!line.aws_data_id}"> |
| | | <!-- 20220222 PI改造 by Bright start --> |
| | | <span>{!line.name}</span> |
| | | <span class="decrypt"></span> |
| | | <!-- 20220222 PI改造 by Bright end --> |
| | | </td> |
| | | <td aws-obj="Contact" aws-api="email" aws-id="{!line.aws_data_id}"> |
| | | <!-- 20220222 PI改造 by Bright start --> |
| | | <span>{!line.email}</span> |
| | | <span class="decrypt"></span> |
| | | <!-- 20220222 PI改造 by Bright end --> |
| | | </td> |
| | | <td><apex:outputText value="{!line.name}"></apex:outputText></td> |
| | | <td><apex:outputText value="{!line.email}"></apex:outputText></td> |
| | | <td><apex:outputText value="{!line.account}"></apex:outputText></td> |
| | | </tr> |
| | | </apex:repeat> |
| | |
| | | <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.connection20)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.apex20)}"/> |
| | | <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" /> |
| | | |
| | | <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no"/> |
| | | <style type="text/css"> |
| | |
| | | } |
| | | </style> |
| | | <script> |
| | | let isBlocking = false; |
| | | function b(){ |
| | | if (!isBlocking) { |
| | | isBlocking = true; |
| | | blockme(); |
| | | } |
| | | } |
| | | |
| | | function ub(){ |
| | | if (isBlocking) { |
| | | isBlocking = false; |
| | | unblockUI(); |
| | | } |
| | | } |
| | | |
| | | function formSubmit(){ |
| | | testFile(); |
| | |
| | | var memberEmailId = "memberEmail"+lineNum; |
| | | j$(escapeVfId(memberNameId)).attr("value",memberName); |
| | | j$(escapeVfId(memberEmailId)).attr("value",memberEmail);*/ |
| | | // addMemberData(lineNum,memberId,memberName,memberEmail); |
| | | j$("#memberBody tr[line-id='"+lineNum+"'] input.emailAddress").val(memberEmail); |
| | | j$("#memberBody tr[line-id='"+lineNum+"'] input.name").val(memberName); |
| | | addMemberData(lineNum,memberId,memberName,memberEmail); |
| | | } |
| | | function statusChabge(linenumNum,type){ |
| | | var toId = "Page:messageForm:lineDataList:"+linenumNum+":"+"to"; |
| | |
| | | function openFile(){ |
| | | // alert('111111111'); |
| | | // uploadFileS(); |
| | | document.getElementById("file_input").value = ''; |
| | | popupBox.setTitle("请选择要上传的图片!"); |
| | | popupBox.importContentNode(document.getElementById("Page:messageForm:popupBox")); |
| | | popupBox.show(document.getElementById("Page:messageForm:popupBox")); |
| | |
| | | //dialog 弹窗 end |
| | | |
| | | //上传图片 |
| | | function saveAttachment(){ |
| | | var maxFileSize = 4350000; //Base64 编码以后最大的文件字节数 |
| | | var attachmentBody; //附件内容 |
| | | var attachmentName; //附件名称 |
| | | var attachmentType; //附件名称 |
| | | var attachmentSize; //附件大小 |
| | | var parentId = j$(escapeVfId("parentId")).value(); |
| | | // 获取上传图片的数量 |
| | | var size = document.getElementById("file_input").files.length; |
| | | if (size > 0) { |
| | | var nameList = []; |
| | | var typeList = []; |
| | | var bodyList = []; |
| | | for(var i = 0;i < size;i++){ |
| | | var fbody = document.getElementById("file_input").files[i]; |
| | | attachmentName = fbody.name; |
| | | if(fbody.size <= maxFileSize) { |
| | | attachmentType = fbody.type; |
| | | nameList.push(attachmentName); |
| | | typeList.push(attachmentType); |
| | | var fileReader = new FileReader(); |
| | | fileReader.readAsBinaryString(fbody); |
| | | fileReader.onload = function(e) { |
| | | bodyList.push(window.btoa(this.result)); |
| | | } |
| | | fileReader.onerror = function(e) { |
| | | alert("上传失败,请重新尝试"); |
| | | } |
| | | fileReader.onabort = function(e) { |
| | | alert("上传失败,请重新尝试"); |
| | | } |
| | | } else { |
| | | alert("Base64 编码最大允许4.3M文件,"+attachmentName + '过大无法上传'); |
| | | } |
| | | |
| | | |
| | | } |
| | | if (nameList.length > 0) { |
| | | //使用RemoteAction上传附件 |
| | | Visualforce.remoting.Manager.invokeAction( |
| | | '{!$RemoteAction.SendEmailController.AddAttachment}', |
| | | nameList, |
| | | typeList, |
| | | bodyList, |
| | | parentId, |
| | | function(result,event) { |
| | | |
| | | if(result == '文件上传成功'){ |
| | | alert(result); |
| | | RefreshPage(); |
| | | } else if (result == null){ |
| | | result = '文件上传失败,请重新上传'; |
| | | alert(result); |
| | | RefreshPage(); |
| | | } else { |
| | | alert(result); |
| | | function saveAttachment(){ |
| | | var maxFileSize = 4350000; //Base64 编码以后最大的文件字节数 |
| | | var attachmentBody; //附件内容 |
| | | var attachmentName; //附件名称 |
| | | var attachmentType; //附件名称 |
| | | var attachmentSize; //附件大小 |
| | | var parentId = j$(escapeVfId("parentId")).value(); |
| | | // 获取上传图片的数量 |
| | | var size = document.getElementById("file_input").files.length; |
| | | if (size > 0) { |
| | | var nameList = []; |
| | | var typeList = []; |
| | | var bodyList = []; |
| | | for(var i = 0;i < size;i++){ |
| | | var fbody = document.getElementById("file_input").files[i]; |
| | | attachmentName = fbody.name; |
| | | if(fbody.size <= maxFileSize) { |
| | | attachmentType = fbody.type; |
| | | nameList.push(attachmentName); |
| | | typeList.push(attachmentType); |
| | | var fileReader = new FileReader(); |
| | | fileReader.readAsBinaryString(fbody); |
| | | fileReader.onload = function(e) { |
| | | bodyList.push(window.btoa(this.result)); |
| | | } |
| | | |
| | | }); |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | // PI改造 By Bright 20220329 |
| | | AWSService.sfSessionId = '{!GETSESSIONID()}'; |
| | | var staticResourceMail = JSON.parse('{!staticResourceMail}'); |
| | | var staticResourceMailMerge = JSON.parse('{!staticResourceMailMerge}'); |
| | | var staticResourceDocument = JSON.parse('{!staticResourceDocument}'); |
| | | var isQuotesPdf = false; |
| | | |
| | | function alertErrorMessage(errorMsg) { |
| | | console.log(errorMsg); |
| | | } |
| | | |
| | | function uploadFileToAWS(data, size, fileName, callback) { |
| | | |
| | | console.log("body=" + JSON.stringify({ 'file': data, "size": size, 'fileName': fileName })); |
| | | AWSService.post(staticResourceDocument.newUrl, JSON.stringify({ |
| | | 'file': data, |
| | | "size": size, |
| | | 'fileName': fileName }) |
| | | , function(result){ |
| | | console.log("result" + JSON.stringify(result)); |
| | | |
| | | if (result.success) { |
| | | let key = result.object; |
| | | confirmTrans(result.txId,1,function(){ |
| | | if (callback) { |
| | | callback(key); |
| | | fileReader.onerror = function(e) { |
| | | alert("上传失败,请重新尝试"); |
| | | } |
| | | }) |
| | | //SendEmail(); |
| | | console.log('key' + key); |
| | | } else { |
| | | alertErrorMessage('上传失败请稍后再试!'); |
| | | } |
| | | }, staticResourceDocument.token); |
| | | |
| | | } |
| | | |
| | | function SendEmailCallBack(){ |
| | | console.log('SendEmailCallBack'); |
| | | } |
| | | |
| | | function confirmTrans(transId, isSuccess,callback) { |
| | | |
| | | AWSService.post(staticResourceDocument.updateUrl, JSON.stringify({ |
| | | "txId":transId, |
| | | "sfRecordId":"", |
| | | "isSuccess":isSuccess |
| | | }), function(data){ |
| | | console.log("confirmTrans-" + JSON.stringify(data)); |
| | | if (callback) { |
| | | callback() |
| | | } |
| | | }, staticResourceDocument.token); |
| | | |
| | | } |
| | | |
| | | function uploadFile() { |
| | | var maxFileSize = 4350000; |
| | | let files = document.getElementById("file_input").files |
| | | // 获取上传图片的数量 |
| | | |
| | | if (files.length == 0) { |
| | | alert('至少选择一个附件'); |
| | | return; |
| | | } |
| | | |
| | | let attachList=[]; |
| | | let complete_flags = new Array(files.length + 1).join(0).split('').map(function () { return false }); |
| | | let AllComplete = function(){ |
| | | for (let index = 0; index < complete_flags.length; index++){ |
| | | if(!complete_flags[index]){ |
| | | return; |
| | | } |
| | | } |
| | | |
| | | ub(); |
| | | } |
| | | for(var i = 0;i < files.length;i++){ |
| | | var fbody = files[i]; |
| | | let j = i; |
| | | if(fbody.size <= maxFileSize) { |
| | | |
| | | } else { |
| | | alert("Base64 编码最大允许4.3M文件,"+fbody.name + '过大无法上传'); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | popupBox.hide(); |
| | | b(); |
| | | for(var i = 0;i < files.length;i++){ |
| | | var fbody = files[i]; |
| | | let j = i; |
| | | var fileReader = new FileReader(); |
| | | fileReader.fbody = fbody; |
| | | fileReader.readAsDataURL(fbody); |
| | | fileReader.onload = function(e) { |
| | | let reader = this; |
| | | attachList.push({ |
| | | name:reader.fbody.name, |
| | | type:reader.fbody.type, |
| | | body:reader.result, |
| | | size:reader.fbody.size |
| | | }) |
| | | // |
| | | console.log('onload '+ j); |
| | | // ReadComplete(); |
| | | uploadFileToAWS(reader.result, reader.fbody.size, reader.fbody.name,function(key){ |
| | | complete_flags[j] = true; |
| | | AppendAttachmentHtml(reader.fbody.name,key,reader.fbody.size); |
| | | AllComplete(); |
| | | }); |
| | | |
| | | |
| | | } |
| | | fileReader.onerror = function(e) { |
| | | ub(); |
| | | alert("上传失败,请重新尝试"); |
| | | } |
| | | fileReader.onabort = function(e) { |
| | | ub(); |
| | | alert("上传失败,请重新尝试"); |
| | | } |
| | | } |
| | | |
| | | console.log('end'); |
| | | |
| | | } |
| | | |
| | | let AfterCallBack = null; |
| | | function AddQuotesPdf(callback){ |
| | | if (isQuotesPdf) { |
| | | alert('已添加报价单,无需重复添加'); |
| | | return; |
| | | } |
| | | b(); |
| | | AfterCallBack = callback; |
| | | j$("#pdf").attr("src",'/apex/QuotesPDF?id={!typeid}&addFile=AddQuotesPdfCallBack'); |
| | | } |
| | | |
| | | function AddQuotesPdfCallBack(uri){ |
| | | let bodys = uri.split(','); |
| | | let body = bodys[bodys.length-1] |
| | | let size = window.atob(body).length; |
| | | let name = '报价单.pdf'; |
| | | uploadFileToAWS(uri, size, name,function(key){ |
| | | ub(); |
| | | AppendAttachmentHtml(name,key,size); |
| | | isQuotesPdf = true; |
| | | if (AfterCallBack) { |
| | | AfterCallBack(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | function SendEmailJs(){ |
| | | |
| | | let tos = jQuery("#memberBody :checked[target='to']"); |
| | | if(tos.length<1){ |
| | | alert("至少填写一个收件人"); |
| | | return; |
| | | } |
| | | |
| | | let error_email_e = null; |
| | | j$("#memberBody .emailAddress").each(function(i,e){ |
| | | if (!/^[\w-]{1,99}@[\da-zA-Z]{1,99}\.[a-zA-Z]+$/.test(e.value)) { |
| | | error_email_e = e; |
| | | return false; |
| | | } |
| | | return true; |
| | | }) |
| | | |
| | | if (error_email_e) { |
| | | if(error_email_e.value){ |
| | | alert('邮箱地址格式不对:'+error_email_e.value); |
| | | }else{ |
| | | alert('邮箱地址必填'); |
| | | } |
| | | |
| | | j$(error_email_e).focus(); |
| | | j$(error_email_e).select(); |
| | | return; |
| | | } |
| | | |
| | | let subject = j$(".SUBJECT__c").val(); |
| | | if (!subject) { |
| | | alert("SUBJECT必填"); |
| | | return; |
| | | } |
| | | |
| | | |
| | | let message = j$(".MESSAGE__c").val(); |
| | | if (!message) { |
| | | alert("MESSAGE必填"); |
| | | return; |
| | | } |
| | | |
| | | let Foo = function(target){ |
| | | let targets = jQuery("#memberBody :checked[target='"+target+"']"); |
| | | let emails = []; |
| | | let names = []; |
| | | targets.each(function(i,e){ |
| | | let v = j$(e).closest("tr").find(".name").val(); |
| | | names.push(v?v:'-'); |
| | | emails.push(j$(e).closest("tr").find(".emailAddress").val()); |
| | | }); |
| | | return { |
| | | emails:emails, |
| | | names:names |
| | | } |
| | | } |
| | | |
| | | |
| | | let to = Foo('to'); |
| | | let cc = Foo('cc'); |
| | | let bcc = Foo('bcc'); |
| | | |
| | | |
| | | let payload = { |
| | | "bcc": bcc.emails.join(';'), |
| | | "bccName": bcc.names.join(';'), |
| | | "cc": cc.emails.join(';'), |
| | | "ccName": cc.names.join(';'), |
| | | "from": j$(".FROM__c").html(), |
| | | "fromName": "", |
| | | "message": message, |
| | | "recipient": to.emails.join(';'), |
| | | "recordId": "{!typeid}", |
| | | "recordType": "{!type}", |
| | | "subjectCopy": subject+'~{!name}', |
| | | "toName": to.names.join(';') |
| | | }; |
| | | b(); |
| | | |
| | | |
| | | |
| | | let Send = function(){ |
| | | let fileMap = {} |
| | | j$("a.attach_link").each(function(i,e){ |
| | | fileMap[j$(e).attr("data-key")] = j$(e).attr("data-name"); |
| | | }); |
| | | payload.fileMap = fileMap; |
| | | AWSService.post(staticResourceMail.newUrl,JSON.stringify(payload),function(data){ |
| | | console.log(data); |
| | | ub(); |
| | | if (data && data.success) { |
| | | alert('发送成功') |
| | | if ('{!typeid}') { |
| | | window.location.href = '/{!typeid}?type=mail'; |
| | | }else{ |
| | | window.location.href = '/'+data.object; |
| | | fileReader.onabort = function(e) { |
| | | alert("上传失败,请重新尝试"); |
| | | } |
| | | } else { |
| | | alert("Base64 编码最大允许4.3M文件,"+attachmentName + '过大无法上传'); |
| | | } |
| | | }else{ |
| | | alert('发送失败,原因:'+(data && data.message ? data.message :'未知错误')); |
| | | |
| | | |
| | | } |
| | | },staticResourceMail.token); |
| | | } |
| | | |
| | | // 如果没添加报价单,自动添加 |
| | | if ('{!type}' == 'Quotes' && !isQuotesPdf) { |
| | | AddQuotesPdf(Send); |
| | | }else{ |
| | | Send(); |
| | | } |
| | | |
| | | } |
| | | |
| | | function AppendAttachmentHtml(name,key,size){ |
| | | let html = '<tr style="text-align:center; vertical-align: middle;">' |
| | | + '<td><a class="attach_link" target="_blank" data-key="'+key+'" data-name="'+name+'" href="'+staticResourceDocument.queryUrl+key+'">'+name+'</a></td>' |
| | | +'<td>'+new Date().toLocaleString()+'</td>' |
| | | +'<td>'+size+'</td>' |
| | | +'<td><input type="button" class="btn delete_attachment" value="delete" /></td>' |
| | | +'</tr>'; |
| | | j$("table.attach_preview").append(html); |
| | | } |
| | | |
| | | function AddMemberJs(){ |
| | | let line_id = new Date().getTime()+''+Math.floor(Math.random()*1000); |
| | | let html = '<tr line-id="'+line_id+'" style="text-align:center;">' |
| | | +'<td><input id="memberName2" type="hidden" value=""><input class="emailAddress" type="text" value=""/></td>' |
| | | +'<td><input class="name" type="text" value=""/></td>' |
| | | +'<td><input line-id="'+line_id+'" target="to" type="checkbox" checked="checked"/></td>' |
| | | +'<td><input line-id="'+line_id+'" target="cc" type="checkbox"/></td>' |
| | | +' <td><input line-id="'+line_id+'" target="bcc" type="checkbox"/></td>' |
| | | +' <td><input line-id="'+line_id+'" class="btn delete" value="delete" type="button"/></td>' |
| | | +' <td><input type="button" value="Search" onclick="openSearchMemberPage('+line_id +');" class="btn search"/></td>' |
| | | +' </tr>'; |
| | | j$("#memberBody").append(html); |
| | | } |
| | | |
| | | j$(function(){ |
| | | j$("table.attach_preview").on("click",".delete_attachment",function(){ |
| | | j$(this).closest("tr").remove(); |
| | | }) |
| | | |
| | | j$("#memberBody").on("click",":checkbox",function(){ |
| | | let b = j$(this).prop("checked"); |
| | | console.log(b); |
| | | j$(":checkbox[line-id='"+j$(this).attr("line-id")+"']").prop("checked",false); |
| | | j$(this).prop("checked",b); |
| | | }) |
| | | |
| | | j$("#memberBody").on("click","input.delete",function(){ |
| | | j$("tr[line-id='"+j$(this).attr("line-id")+"']").remove(); |
| | | }) |
| | | |
| | | if ('{!AWSDataId}') { |
| | | b(); |
| | | AWSService.query(staticResourceMailMerge.queryUrl,'{!AWSDataId}',function(data){ |
| | | ub(); |
| | | if (data && data.object) { |
| | | let allMembers = data.object.allMember.split(';'); |
| | | let allMemberNames = data.object.allMemberName.split(';'); |
| | | j$("#memberBody .emailAddress").each(function(i,e){ |
| | | j$(e).val(allMembers[i]); |
| | | }) |
| | | |
| | | j$("#memberBody .name").each(function(i,e){ |
| | | j$(e).val(allMemberNames[i]=='-'?'':allMemberNames[i]); |
| | | }) |
| | | if (nameList.length > 0) { |
| | | //使用RemoteAction上传附件 |
| | | Visualforce.remoting.Manager.invokeAction( |
| | | '{!$RemoteAction.SendEmailController.AddAttachment}', |
| | | nameList, |
| | | typeList, |
| | | bodyList, |
| | | parentId, |
| | | function(result,event) { |
| | | |
| | | if(result == '文件上传成功'){ |
| | | alert(result); |
| | | RefreshPage(); |
| | | } else if (result == null){ |
| | | result = '文件上传失败,请重新上传'; |
| | | alert(result); |
| | | RefreshPage(); |
| | | } else { |
| | | alert(result); |
| | | } |
| | | |
| | | }); |
| | | |
| | | } |
| | | |
| | | },staticResourceMailMerge.token); |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | }) |
| | | </script> |
| | | <div style="width : 100%;"> |
| | | <div style="width : 70%; margin: auto;"> |
| | |
| | | <!-- <apex:param name="lineNum" assignTo="{!lineNum}" value="" /> --> |
| | | </apex:actionFunction> |
| | | |
| | | <apex:actionFunction name="SendEmail" action="{!SendEmail}" oncomplete="SendEmailCallBack();" reRender="messageForm" > |
| | | <apex:param name="handleType" assignTo="{!handleType}" value="send" /> |
| | | </apex:actionFunction> |
| | | |
| | | <div style="width: 100%"> |
| | | <div class="errorMessage" style="margin-left: 39%"> |
| | | <span id="errorMessage">{!errorMessage}</span> |
| | |
| | | </tr> |
| | | <tr> |
| | | <th style="width: 20%;text-align:center;">FROM:</th> |
| | | <td><apex:outputText styleClass="FROM__c" value="{!mail.FROM__c}" style="width: 40%"/></td> |
| | | <td><apex:outputText value="{!mail.FROM__c}" style="width: 40%"/></td> |
| | | </tr> |
| | | </table> |
| | | </div> |
| | |
| | | </thead> |
| | | <tbody id="memberBody"> |
| | | <apex:repeat id="lineDataList" value="{!memberLineDatas}" var="lineData"> |
| | | <tr line-id="{!lineData.lineNum}" style="text-align:center;"> |
| | | <tr style="text-align:center;"> |
| | | <td> |
| | | <input type="hidden" id="memberName{!lineData.lineNum}" value="{!lineData.name}" /> |
| | | <apex:inputText styleClass="emailAddress" value="{!lineData.emailAddress}" /></td> |
| | | <td><apex:inputText styleClass="name" value="{!lineData.name}" /></td> |
| | | <td><apex:inputCheckbox html-line-id="{!lineData.lineNum}" html-target="to" id="to" value="{!lineData.to}"/></td> |
| | | <td><apex:inputCheckbox html-line-id="{!lineData.lineNum}" html-target="cc" id="cc" value="{!lineData.cc}"/></td> |
| | | <td><apex:inputCheckbox html-line-id="{!lineData.lineNum}" html-target="bcc" id="bcc" value="{!lineData.bcc}"/></td> |
| | | <td><input line-id="{!lineData.lineNum}" class="btn delete" value="delete" type="button"/></td> |
| | | <!-- <td><apex:commandButton onclick="b();" action="{!deLine}" reRender="messageForm" value="delete" oncomplete="ub();" disabled="{!isOnClick}"> |
| | | <apex:inputText value="{!lineData.emailAddress}" /></td> |
| | | <td><apex:inputText value="{!lineData.name}" /></td> |
| | | <td><apex:inputCheckbox onclick="statusChabge({!lineData.lineNum},'to')" id="to" value="{!lineData.to}"/></td> |
| | | <td><apex:inputCheckbox onclick="statusChabge({!lineData.lineNum},'cc')" id="cc" value="{!lineData.cc}"/></td> |
| | | <td><apex:inputCheckbox onclick="statusChabge({!lineData.lineNum},'bcc')" id="bcc" value="{!lineData.bcc}"/></td> |
| | | <td><apex:commandButton onclick="blockme();" action="{!deLine}" reRender="messageForm" value="delete" oncomplete="unblockUI();" disabled="{!isOnClick}"> |
| | | <apex:param name="lineNum" assignTo="{!lineNum}" value="{!lineData.lineNum}" /> |
| | | </apex:commandButton></td> --> |
| | | </apex:commandButton></td> |
| | | <td> |
| | | <apex:commandButton onclick="openSearchMemberPage({!lineData.lineNum});" value="Search" disabled="{!isOnClick}"> |
| | | |
| | |
| | | </tbody> |
| | | <thead> |
| | | <tr style="text-align:center;"> |
| | | <!-- <td><apex:commandButton id="addLine" onclick="b();" action="{!addLine}" reRender="messageForm" value="ADD Member" oncomplete="ub();" disabled="{!isOnClick}"></apex:commandButton></td> --> |
| | | <td><apex:commandButton id="addLine" onclick="AddMemberJs();" value="ADD Member" oncomplete=""></apex:commandButton></td> |
| | | <td><apex:commandButton id="addLine" onclick="blockme();" action="{!addLine}" reRender="messageForm" value="ADD Member" oncomplete="unblockUI();" disabled="{!isOnClick}"></apex:commandButton></td> |
| | | </tr> |
| | | </thead> |
| | | </table> |
| | |
| | | </tr> --> |
| | | <tr> |
| | | <th style="text-align:center;width: 20%;">SUBJECT:</th> |
| | | <td><apex:inputField styleClass="SUBJECT__c" value="{!mail.SUBJECT__c}" style="width: 40%"/></td> |
| | | <td><apex:inputField value="{!mail.SUBJECT__c}" style="width: 40%"/></td> |
| | | </tr> |
| | | <tr> |
| | | <th style="text-align:center;width: 20%;">MESSAGE:</th> |
| | | <td><apex:inputField styleClass="MESSAGE__c" style="height: 200px;width: 60%" value="{!mail.MESSAGE__c}"/></td> |
| | | <td><apex:inputField style="height: 200px;width: 60%" value="{!mail.MESSAGE__c}"/></td> |
| | | </tr> |
| | | </table> |
| | | </div> |
| | |
| | | |
| | | <tr> |
| | | <td> |
| | | <!-- <apex:commandButton value="Upload Attachment" action="{!uploadFile}" disabled="{!isOnClick}"> |
| | | </apex:commandButton> --> |
| | | <apex:commandButton value="Upload Attachment" action="{!uploadFile}" disabled="{!isOnClick}"> |
| | | </apex:commandButton> |
| | | <apex:panelGroup > |
| | | <apex:commandButton onclick="openFile();return false;" value="图片批量上传" disabled="{!isOnClick}"/> |
| | | <apex:commandButton onclick="uploadFileS();return false;" value="图片批量上传" disabled="{!isOnClick}"/> |
| | | </apex:panelGroup> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | </div> |
| | | <apex:outputPanel rendered="{!IF(openType == 'View', true, false)}" style="margin-left: 5px;"> |
| | | <div style="margin-left: 5px;"> |
| | | <!-- border:1px solid #000000; --> |
| | | <table class="tableCss" style="width: 80%"> |
| | | <tr style="text-align:center;"> |
| | | <th style="text-align:center;width: 33%;">File Name</th> |
| | | <th style="text-align:center;width: 33%;">Upload Time</th> |
| | | <!-- <th style="text-align:center;width: 33%;">File Size</th> --> |
| | | <th style="text-align:center;width: 33%;">File Size</th> |
| | | </tr> |
| | | <apex:repeat id="attachmentList" value="{!newAttachmentList}" var="item"> |
| | | <apex:repeat id="attachmentList" value="{!attachmentList}" var="attachment"> |
| | | <tr style="text-align:center; vertical-align: middle;"> |
| | | <!-- <td><input value="{!item.Name}" readonly="readonly" style="border:none;"/></td> --> |
| | | <td><apex:outputLink value="/{!item.Id}">{!item.FileName__c}</apex:outputLink></td> |
| | | <td><apex:inputField value="{!item.CreatedDate}"/></td> |
| | | <!-- <td><apex:inputField value="{item.BodyLength}"/></td> --> |
| | | <td id="{!item.Id}"> |
| | | <a target="_blank" href="{!item.ViewLink__c}">查看</a> |
| | | <!-- <td><input value="{!attachment.Name}" readonly="readonly" style="border:none;"/></td> --> |
| | | <td><apex:outputLink value="/{!attachment.Id}">{!attachment.Name}</apex:outputLink></td> |
| | | <td><apex:inputField value="{!attachment.CreatedDate}"/></td> |
| | | <td><apex:inputField value="{!attachment.BodyLength}"/></td> |
| | | <td id="{!attachment.Id}"> |
| | | <apex:commandButton id="deleteFile" value="delete" action="{!deleteFile}" reRender="messageForm" onclick="blockme();" oncomplete="unblockUI();" disabled="{!isOnClick}"> |
| | | <apex:param name="fileId" assignTo="{!fileId}" value="{!attachment.Id}" /> |
| | | </apex:commandButton> |
| | | </td> |
| | | </tr> |
| | | </apex:repeat> |
| | | </table> |
| | | </apex:outputPanel> |
| | | <!-- 20220222 PI改造 by Bright start --> |
| | | <apex:outputPanel rendered="{!IF(openType == 'View', false, true)}" style="margin-left: 5px;"> |
| | | <!-- border:1px solid #000000; --> |
| | | <table class="tableCss attach_preview" style="width: 80%"> |
| | | <tr style="text-align:center;"> |
| | | <th style="text-align:center;width: 33%;">File Name</th> |
| | | <th style="text-align:center;width: 33%;">Upload Time</th> |
| | | <th style="text-align:center;width: 33%;">File Size</th> |
| | | </tr> |
| | | |
| | | </table> |
| | | </apex:outputPanel> |
| | | <!-- 20220222 PI改造 by Bright end --> |
| | | </div> |
| | | |
| | | <div style="width: 30%;height: 5%;margin-left: 30%;margin-top: middle;"> |
| | | <apex:outputPanel rendered="{!IF(type == 'Quotes', true, false)}"> |
| | | <apex:commandButton id="open" value="查看报价单" onclick="openPDF();return false;" style="width: 49%;height: 5%" /> |
| | | <apex:commandButton id="addPDf" value="添加报价单" onclick="AddQuotesPdf();return false;" oncomplete="" reRender="messageForm" style="width: 49%;height: 5%" disabled="{!isOnClick}"/> |
| | | <apex:commandButton id="open" value="查看报价单" onclick="openPDF()" style="width: 49%;height: 5%" /> |
| | | <apex:commandButton id="addPDf" value="添加报价单" action="{!addPDF}" onclick="blockme();" oncomplete="unblockUI();" reRender="messageForm" style="width: 49%;height: 5%" disabled="{!isOnClick}"/> |
| | | </apex:outputPanel> |
| | | <apex:commandButton id="test" value="Send Mail" onclick="SendEmailJs();return false;" style="width: 99%;height: 5%" disabled="{!isOnClick}"/> |
| | | <!-- <apex:commandButton id="test" action="{!SendEmail}" value="Send Mail" onclick="b();" oncomplete="ub();" reRender="messageForm" style="width: 99%;height: 5%" disabled="{!isOnClick}"> |
| | | <apex:commandButton id="test" action="{!SendEmail}" value="Send Mail" onclick="blockme();" oncomplete="unblockUI();" reRender="messageForm" style="width: 99%;height: 5%" disabled="{!isOnClick}"> |
| | | <apex:param name="handleType" assignTo="{!handleType}" value="send" /> |
| | | </apex:commandButton> --> |
| | | </apex:commandButton> |
| | | </div> |
| | | <apex:outputPanel id="popupBox" layout="block" style="display:none"> |
| | | |
| | | <input type="file" id="file_input" name="attFile" multiple="true"/><br/> |
| | | <center> |
| | | <apex:commandButton value="确认" onclick="uploadFile(); return false;" style="width: 20%; margin: 20px 10px 0px 10px" /> |
| | | <apex:commandButton value="确认" onclick="saveAttachment(); return false;" style="width: 20%; margin: 20px 10px 0px 10px" /> |
| | | <apex:commandButton value="取消" onclick="popupBox.hide();" style="width: 20%; margin: 20px 10px 0px 10px" /> |
| | | </center> |
| | | </apex:outputPanel> |
| | | </apex:form> |
| | | <iframe src="" id="pdf" style="position: absolute;left: 100%;" /> |
| | | </div> |
| | | </div> |
| | | </apex:page> |
| | |
| | | } else if (s == '失败') { |
| | | var oppId = '{!Opportunity.Id}'; |
| | | var creuser = '{!Opportunity.CreatedById}'.substring(0,15); |
| | | var owner = '{!Opportunity.OwnerId}'.substring(0,15); |
| | | |
| | | var userId = '{!$User.Id}'.substring(0,15); |
| | | |
| | | var roleId = '{!$User.UserRoleId}'.substring(0,15); |
| | | //alert(userId); |
| | | if(userId == '005280000037mrQ' || userId == '00528000002OAvH' || userId == '00528000000YSdB' || roleId == '00E0K000001ywwz' || roleId == '00E0K000001jGiM' || roleId == '00E0K000001jGib' || roleId == '00E0K000001ywgS' || roleId == '00E28000000knAm' || roleId == '00E28000000knAr' || roleId == '00E28000000aKzn' || roleId == '00E0K000001jGhn' || roleId == '00E0K000001jGhs' || roleId == '00E0K000001ywgN' || roleId == '00E0K000001PWuh' || roleId == '00E0K000001PWum' || roleId == '00E0K000001PWur' || roleId == '00E280000015xus' || roleId == '00E280000015xux' || roleId == '00E28000000aKzs' || roleId == '00E0K000001jGiC' || roleId == '00E0K000001jGiR' || roleId == '00E0K000001ywgX' || roleId == '00E28000000knAc' || roleId == '00E28000000knAh' || roleId == '00E28000000aKzx' || roleId == '00E28000000knAw' || roleId == '00E28000000knB1' || roleId == '00E28000000aL02' || roleId == '00E28000000kjpX'){ |
| | | var rtn = sforce.apex.execute("OpportunityWebService", "checkOrderStatus", {oppId: oppId,stageName:'Closed Lost',creuser: creuser,owner: owner}); |
| | | if(rtn == '1' && (creuser == userId || owner == userId)){ |
| | | if(userId == '005280000037mrQ' || userId == '00528000002OAvH' || userId == '00528000000YSdB' || roleId == '00E0K000001ywwz' || roleId == '00E0K000001jGiM' || roleId == '00E0K000001jGib' || roleId == '00E0K000001ywgS' || roleId == '00E28000000knAm' || roleId == '00E28000000knAr' || roleId == '00E28000000aKzn' || roleId == '00E0K000001jGhn' || roleId == '00E0K000001jGhs' || roleId == '00E0K000001ywgN' || roleId == '00E0K000001PWuh' || roleId == '00E0K000001PWum' || roleId == '00E0K000001PWur' || roleId == '00E280000015xus' || roleId == '00E280000015xux' || roleId == '00E28000000aKzs' || roleId == '00E0K000001jGiC' || roleId == '00E0K000001jGiR' || roleId == '00E0K000001ywgX' || roleId == '00E28000000knAc' || roleId == '00E28000000knAh' || roleId == '00E28000000aKzx' || roleId == '00E28000000knAw' || roleId == '00E28000000knB1' || roleId == '00E28000000aL02' ){ |
| | | var rtn = sforce.apex.execute("OpportunityWebService", "checkOrderStatus", {oppId: oppId,stageName:'Closed Lost',creuser: creuser}); |
| | | if(rtn == '1' && creuser == userId){ |
| | | /*if(!confirm("是否失败询价?")){ |
| | | return; |
| | | }*/ |
| | |
| | | return; |
| | | }else{ |
| | | //alert(rtn); |
| | | if(creuser != userId || owner != userId){ |
| | | alert('只有创建人和所有人才能失败询价'); |
| | | if(creuser != userId){ |
| | | alert('只有创建人才能失败询价'); |
| | | }else if(rtn == '0' ){ |
| | | alert('询价下存在有效合同,不能取消/失败'); |
| | | }else{ |
| | |
| | | } else if (s == '取消') { |
| | | var oppId = '{!Opportunity.Id}'; |
| | | var creuser = '{!Opportunity.CreatedById}'.substring(0,15); |
| | | var owner = '{!Opportunity.OwnerId}'.substring(0,15); |
| | | |
| | | var userId = '{!$User.Id}'.substring(0,15); |
| | | |
| | | var roleId = '{!$User.UserRoleId}'.substring(0,15); |
| | | //alert(userId); |
| | | if(userId == '005280000037mrQ' || userId == '00528000002OAvH' || userId == '00528000000YSdB' || roleId == '00E0K000001ywwz' || roleId == '00E0K000001jGiM' || roleId == '00E0K000001jGib' || roleId == '00E0K000001ywgS' || roleId == '00E28000000knAm' || roleId == '00E28000000knAr' || roleId == '00E28000000aKzn' || roleId == '00E0K000001jGhn' || roleId == '00E0K000001jGhs' || roleId == '00E0K000001ywgN' || roleId == '00E0K000001PWuh' || roleId == '00E0K000001PWum' || roleId == '00E0K000001PWur' || roleId == '00E280000015xus' || roleId == '00E280000015xux' || roleId == '00E28000000aKzs' || roleId == '00E0K000001jGiC' || roleId == '00E0K000001jGiR' || roleId == '00E0K000001ywgX' || roleId == '00E28000000knAc' || roleId == '00E28000000knAh' || roleId == '00E28000000aKzx' || roleId == '00E28000000knAw' || roleId == '00E28000000knB1' || roleId == '00E28000000aL02' || roleId == '00E28000000kjpX'){ |
| | | var rtn = sforce.apex.execute("OpportunityWebService", "checkOrderStatus", {oppId: oppId,stageName:'Closed Cancel',creuser: creuser,owner: owner}); |
| | | if(rtn == '1' && (creuser == userId || owner == userId)){ |
| | | if(userId == '005280000037mrQ' || userId == '00528000002OAvH' || userId == '00528000000YSdB' || roleId == '00E0K000001ywwz' || roleId == '00E0K000001jGiM' || roleId == '00E0K000001jGib' || roleId == '00E0K000001ywgS' || roleId == '00E28000000knAm' || roleId == '00E28000000knAr' || roleId == '00E28000000aKzn' || roleId == '00E0K000001jGhn' || roleId == '00E0K000001jGhs' || roleId == '00E0K000001ywgN' || roleId == '00E0K000001PWuh' || roleId == '00E0K000001PWum' || roleId == '00E0K000001PWur' || roleId == '00E280000015xus' || roleId == '00E280000015xux' || roleId == '00E28000000aKzs' || roleId == '00E0K000001jGiC' || roleId == '00E0K000001jGiR' || roleId == '00E0K000001ywgX' || roleId == '00E28000000knAc' || roleId == '00E28000000knAh' || roleId == '00E28000000aKzx' || roleId == '00E28000000knAw' || roleId == '00E28000000knB1' || roleId == '00E28000000aL02' ){ |
| | | var rtn = sforce.apex.execute("OpportunityWebService", "checkOrderStatus", {oppId: oppId,stageName:'Closed Cancel',creuser: creuser}); |
| | | if(rtn == '1' && creuser == userId){ |
| | | /*if(!confirm("是否失败询价?")){ |
| | | return; |
| | | }*/ |
| | |
| | | refreshPage(); |
| | | return; |
| | | }else{ |
| | | if(creuser != userId || owner != userId){ |
| | | alert('只有创建人和所有人才能取消询价'); |
| | | if(creuser != userId){ |
| | | alert('只有创建人才能取消询价'); |
| | | }else if(rtn == '0' ){ |
| | | alert('询价下存在有效合同,不能取消/失败'); |
| | | }else{ |
| | |
| | | <apex:includeScript value="{!URLFOR($Resource.jquerysuggestjs)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.connection20)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.apex20)}"/> |
| | | <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" /> |
| | | <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no"/> |
| | | <style type="text/css"> |
| | | /*.sfdcBody {position: absolute; |
| | |
| | | <!-- JS 方法 --> |
| | | <script> |
| | | var j$ = jQuery.noConflict(); |
| | | var closeField = ''; |
| | | var closePhone = ''; |
| | | var newSearchContactWindow = null; |
| | | var staticResourceContact = JSON.parse('{!staticResourceContact}') |
| | | |
| | | |
| | | j$(document).ready(function() { |
| | | var status = '{!tsr.TSReportStatus__c}'; |
| | |
| | | } |
| | | |
| | | |
| | | //20220310 zhj PIPL start |
| | | function isError(){ |
| | | let h = HasError() |
| | | if(h){ |
| | | unblockUI(); |
| | | } |
| | | } |
| | | function HasError(){ |
| | | // if (IsAddmessage) { |
| | | // return true; |
| | | // } |
| | | let e = document.getElementById("allPage:allForm:message"); |
| | | if (!e) { |
| | | return false; |
| | | } |
| | | |
| | | let divs = j$(e).find("div.message"); |
| | | for (let i = 0; i < divs.length; i++) { |
| | | for (let j = 0; j < divs[i].classList.length; j++) { |
| | | for(let cls of divs[i].classList){ |
| | | if (cls.indexOf('error')>-1) { |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | function alertErrorMessage(errorMsg) { |
| | | let errorMsgNode = document.getElementById("allPage:allForm:message"); |
| | | errorMsgNode.innerText = errorMsg; |
| | | errorMsgNode.className = 'pbError'; |
| | | } |
| | | |
| | | function htmlToElement(html) { |
| | | var template = document.createElement('template'); |
| | | html = html.trim(); // Never return a text node of whitespace as the result |
| | | template.innerHTML = html; |
| | | return template.content.firstChild; |
| | | } |
| | | |
| | | var contactIdValue = ''; |
| | | function searchContact(contactNodeId,field1,field2,field3,accountValueId){ |
| | | closeField = field1; |
| | | closePhone = field2; |
| | | contactIdValue = field3; |
| | | var accountValueLkid = document.getElementById(accountValueId+'_lkid').value; |
| | | var searchContactKeyWord = document.getElementById(field1).value; |
| | | if (accountValueLkid != '000000000000000') { |
| | | let baseUrl = "/apex/SearchContactPage"; |
| | | let suffixUrl = "?contactId="+contactNodeId+ "&accountId=" + accountValueLkid; |
| | | let newSearchContactParam = 'height=600,width=800,left=100,top=100,dialogHide=true,resizable=no,scrollbars=yes,toolbar=no,status=no'; |
| | | newSearchContactWindow = window.open(baseUrl+suffixUrl, 'Popup', newSearchContactParam); |
| | | if (window.focus) { |
| | | newSearchContactWindow.focus(); |
| | | } |
| | | return false; |
| | | }else { |
| | | alert('请先选择客户单位'); |
| | | } |
| | | } |
| | | |
| | | var currentLastName = ''; |
| | | var currentPhoneId = ''; |
| | | |
| | | function replaceSearchContactLookup() { |
| | | blockme(); |
| | | var RepairInfoListStr = JSON.parse('{!RepairInfoListStr}'); |
| | | sforce.connection.sessionId = '{!GETSESSIONID()}'; |
| | | let queryContactBack = function(data,number){ |
| | | document.getElementById(currentLastName).value = data.object.lastName; |
| | | document.getElementById(currentPhoneId).innerText = data.object.phone; |
| | | number++; |
| | | if(document.getElementById('allPage:allForm:RepairInfoList:'+number+':contactIdValue') != null && document.getElementById('allPage:allForm:RepairInfoList:'+number+':contactIdValue').value != ''){ |
| | | currentLastName = 'allPage:allForm:RepairInfoList:'+number+':Contacts__c'; |
| | | currentPhoneId = 'allPage:allForm:RepairInfoList:'+number+':j_id91'; |
| | | let sfId = document.getElementById('allPage:allForm:RepairInfoList:'+number+':contactIdValue').value; |
| | | var queryStr = 'Select Id, AWS_Data_Id__c' |
| | | +' from Contact where id = \'' |
| | | + sfId +'\' '; |
| | | var reports = sforce.connection.query(queryStr); |
| | | var records = reports.getArray("records"); |
| | | var awsDataId = records[0].AWS_Data_Id__c; |
| | | AWSService.queryTSRepair(staticResourceContact.queryUrl, awsDataId, queryContactBack, staticResourceContact.token,number); |
| | | } |
| | | } |
| | | for(var i = 0;i<RepairInfoListStr.length;i++){ |
| | | let contactHtmlString = '<img src="/img/s.gif" onclick="searchContact(\'allPage:allForm:contactId\',\'allPage:allForm:RepairInfoList:'+i+':Contacts__c\',\'allPage:allForm:RepairInfoList:'+i+':j_id91\',\'allPage:allForm:RepairInfoList:'+i+':contactIdValue\',\'allPage:allForm:RepairInfoList:'+i+':BusinessACustomerUnit\')" alt="Reference Document Number Lookup" class="lookupIcon" title="Reference Document Number Lookup (New Window)"/>'; |
| | | let lookUpNode = htmlToElement(contactHtmlString); |
| | | console.log(lookUpNode); |
| | | let parentNode = document.getElementById('allPage:allForm:RepairInfoList:'+i+':contactIdValue').parentNode; |
| | | parentNode.appendChild(lookUpNode); |
| | | } |
| | | if(document.getElementById('allPage:allForm:RepairInfoList:0:contactIdValue').value != ''){ |
| | | currentLastName = 'allPage:allForm:RepairInfoList:0:Contacts__c'; |
| | | currentPhoneId = 'allPage:allForm:RepairInfoList:0:j_id91'; |
| | | //解密 |
| | | let sfId = document.getElementById('allPage:allForm:RepairInfoList:0:contactIdValue').value; |
| | | var queryStr = 'Select Id, AWS_Data_Id__c' |
| | | +' from Contact where id = \'' |
| | | + sfId +'\' '; |
| | | var reports = sforce.connection.query(queryStr); |
| | | var records = reports.getArray("records"); |
| | | var awsDataId = records[0].AWS_Data_Id__c; |
| | | AWSService.queryTSRepair(staticResourceContact.queryUrl, awsDataId, queryContactBack, staticResourceContact.token,0); |
| | | } |
| | | unblockUI(); |
| | | } |
| | | |
| | | |
| | | function closePopupWindow() { |
| | | console.log('closePopupWindow()') |
| | | if (null != newSearchContactWindow) { |
| | | newSearchContactWindow.close(); |
| | | } |
| | | let contactInfoStr = document.getElementById('allPage:allForm:contactId').value; |
| | | console.log('closePopup:'+contactInfoStr); |
| | | let contactInfo = JSON.parse(contactInfoStr); |
| | | |
| | | document.getElementById(contactIdValue).value = contactInfo.ContactId; |
| | | document.getElementById(''+closeField).value = contactInfo.Name; |
| | | document.getElementById(''+closePhone).value = contactInfo.Phone; |
| | | document.getElementById(''+closePhone).innerText = contactInfo.Phone; |
| | | } |
| | | //20220310 zhj PIPL end |
| | | </script> |
| | | <apex:form id="allForm"> |
| | | <apex:inputHidden value="{!contactId}" id="contactId"/> |
| | | <!-- 王鹏伟 点击按钮更新状态开始 --> |
| | | <apex:actionFunction name="setStatus" action="{!setStatus}" reRender="Activities,message,Activities1" oncomplete="unblockUI();replaceSearchContactLookup();"> |
| | | <apex:actionFunction name="setStatus" action="{!setStatus}" reRender="Activities,message,Activities1" oncomplete="unblockUI();"> |
| | | |
| | | <apex:param name="status" assignTo="{!status}" value="" /> |
| | | </apex:actionFunction> |
| | | <!-- 王鹏伟 点击按钮更新状态结束 --> |
| | | <apex:actionFunction name="updateServiceCategory" action="{!updateServiceCategory}" rerender="Activities" onComplete="replaceSearchContactLookup();unblockUI();"> |
| | | <apex:actionFunction name="updateServiceCategory" action="{!updateServiceCategory}" rerender="Activities" onComplete="unblockUI();"> |
| | | <apex:param name="num" assignTo="{!num}" value="" /> |
| | | </apex:actionFunction> |
| | | |
| | |
| | | <apex:inputField id="BusinessACustomerUnit" value="{!repairInfo.ba.BusinessAAccount__c}" /> |
| | | </td> |
| | | <th style="text-align: center;">联系人</th> |
| | | <td align="left" > |
| | | <!-- <apex:inputField value="{!repairInfo.ba.BusinessAContact__c}" style="width: 80%"/> --> |
| | | <!-- Add By zhj for PIPL 20220309 Start --> |
| | | <apex:inputText value="{!contactNameValue}" id="Contacts__c" style="width: 80%"/> |
| | | <apex:inputHidden id="contactIdValue" value="{!repairInfo.ba.BusinessAContact__c}"/> |
| | | <!-- Add By zhj for PIPL 20220309 end --> |
| | | </td> |
| | | <td align="left" ><apex:inputField value="{!repairInfo.ba.BusinessAContact__c}" style="width: 80%"/></td> |
| | | <th style="text-align: center;">联系电话</th> |
| | | <td align="left" ><apex:outputField value="{!repairInfo.ba.BusinessAPhone_F__c}"/></td> |
| | | </tr> |
| | |
| | | <th style="text-align: center;" >客户单位</th> |
| | | <td style="text-align: left;"><apex:outputField value="{!repairInfo.ba.BusinessAAccount__c}" style="width: 80%"/></td> |
| | | <th style="text-align: center;">联系人</th> |
| | | <td align="left" > |
| | | <apex:outputField value="{!repairInfo.ba.BusinessAContact__c}" style="width: 80%"/> |
| | | <apex:inputHidden id="contactIdValue" value="{!repairInfo.ba.BusinessAContact__c}"/> |
| | | </td> |
| | | <td align="left" ><apex:outputField value="{!repairInfo.ba.BusinessAContact__c}" style="width: 80%"/></td> |
| | | <th style="text-align: center;">联系电话</th> |
| | | <td align="left" ><apex:outputField value="{!repairInfo.ba.BusinessAPhone_F__c}"/></td> |
| | | </tr> |
| | |
| | | <br/> |
| | | <br/> |
| | | </apex:repeat> |
| | | |
| | | </apex:outputPanel> |
| | | <script> |
| | | console.log('appendToOnloadQueue') |
| | | sfdcPage.appendToOnloadQueue(function () { |
| | | replaceSearchContactLookup(); |
| | | }); |
| | | </script> |
| | | <apex:commandButton id="test" onclick="blockme();" action="{!addBusinessActivity}" reRender="Activities" value="添加业务活动" oncomplete="unblockUI();" disabled="{!If(tsr.TSReportStatus__c = '申请中' || tsr.TSReportStatus__c = '确认' ,true , If((tsr.TSReportStatus__c = '草案中' || tsr.TSReportStatus__c = '驳回') && onclickType != '0',true,false))}"></apex:commandButton> |
| | | <apex:commandButton id="save" onclick="blockme();" action="{!save}" reRender="message,allPanel,allForm" value="保存" style="width: 70px;" oncomplete="unblockUI();isError();" disabled="{!If(tsr.TSReportStatus__c = '申请中' || tsr.TSReportStatus__c = '确认',true , If((tsr.TSReportStatus__c = '草案中' || tsr.TSReportStatus__c = '驳回') && onclickType != '0',true,false))}"></apex:commandButton> |
| | | <apex:commandButton id="save" onclick="blockme();" action="{!save}" reRender="message,allPanel,allForm" value="保存" style="width: 70px;" oncomplete="unblockUI();" disabled="{!If(tsr.TSReportStatus__c = '申请中' || tsr.TSReportStatus__c = '确认',true , If((tsr.TSReportStatus__c = '草案中' || tsr.TSReportStatus__c = '驳回') && onclickType != '0',true,false))}"></apex:commandButton> |
| | | </apex:form> |
| | | </apex:page> |
| | |
| | | <apex:outputField html-data-id="{!encryptedAPI}" title="{!ApiPrefix}{!encryptedAPI}" value="{!User_FaultInfo__c[encryptedAPI]}" /> |
| | | </apex:repeat> |
| | | <apex:outputField html-data-id="CONTACT__c" title="{!ApiPrefix}CONTACT__c" value="{!User_FaultInfo__c['CONTACT__c']}" /> |
| | | <apex:outputField html-data-id="PHONE__c" title="{!ApiPrefix}PHONE__c" value="{!User_FaultInfo__c['PHONE__c']}" /> |
| | | <apex:outputField html-data-id="E_MAIL__c" title="{!ApiPrefix}E_MAIL__c" value="{!User_FaultInfo__c['E_MAIL__c']}" /> |
| | | <apex:outputField html-data-id="UFContact__c" title="{!ApiPrefix}UFContact__c" value="{!User_FaultInfo__c['UFContact__c']}" /> |
| | | </apex:pageBlockSection> |
| | | <script> |
| | |
| | | ele.title=''; |
| | | ele.innerHTML = data.object.lastName; |
| | | } |
| | | |
| | | let t1 = "[title='"+config.ApiPrefix+"PHONE__c']"; |
| | | let ele1 = document.querySelector(t1); |
| | | if(ele1){ |
| | | ele1.title=''; |
| | | if (data.object.phoneD == '') { |
| | | ele1.innerHTML = data.object.mobilePhoneD; |
| | | } else { |
| | | ele1.innerHTML = data.object.phoneD; |
| | | } |
| | | } |
| | | |
| | | let t2 = "[title='"+config.ApiPrefix+"E_MAIL__c']"; |
| | | let ele2 = document.querySelector(t2); |
| | | if(ele2){ |
| | | ele2.title=''; |
| | | ele1.innerHTML = data.object.emailD; |
| | | } |
| | | }; |
| | | |
| | | var queryEndUserDBack = function queryEndUserDBack(data){ |
| | |
| | | /* |
| | | /* |
| | | * 各行、一番目は現在のStage、二番目からはクリックできるStage |
| | | * |
| | | * 行を定義しない場合、二番目からStageを定義しない場合、クリック不能になる |
| | |
| | | ]; |
| | | |
| | | var SSBD_HighendProductsCOLOR = |
| | | [["Prospect Created","Prospect Created"] |
| | | ,["Phase1","Prospect Created","Phase1"] |
| | | ,["Phase2","Prospect Created","Phase1","Phase2"] |
| | | ,["Phase3","Prospect Created","Phase1","Phase2","Phase3"] |
| | | ,["Closed Won","Prospect Created","Phase1","Phase2","Phase3","Closed Won","完成"] |
| | | ,["Closed Lost","Prospect Created","Phase1","Phase2","Phase3","Closed Lost","失败"] |
| | | ,["Closed Cancel","Prospect Created","Phase1","Phase2","Phase3","Closed Cancel","取消"] |
| | | ]; |
| | | |
| | | var IE_SSBD = |
| | | [["Prospect Created","Phase1","Closed Lost","Closed Cancel","失败","取消"] |
| | | ,["Phase1","Phase2","Closed Lost","Closed Cancel","失败","取消"] |
| | | ,["Phase2","Phase3","Closed Lost","Closed Cancel","失败","取消"] |
| | | ,["Phase3","Closed Won","Closed Lost","Closed Cancel","完成","失败","取消"] |
| | | ,["Closed Won"] |
| | | ,["Closed Lost"] |
| | | ,["Closed Cancel"] |
| | | ]; |
| | | |
| | | var IE_SSBDCOLOR = |
| | | [["Prospect Created","Prospect Created"] |
| | | ,["Phase1","Prospect Created","Phase1"] |
| | | ,["Phase2","Prospect Created","Phase1","Phase2"] |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <StaticResource xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <cacheControl>Private</cacheControl> |
| | | <contentType>application/x-javascript</contentType> |
| | | <contentType>text/javascript</contentType> |
| | | </StaticResource> |