buli
2022-04-26 5835379ec30b1667c4e522db9d294c9b7bb8633a
SSBG Back up
1个文件已删除
57个文件已修改
1个文件已添加
5954 ■■■■ 已修改文件
force-app/main/default/classes/ContactTriggerHandler.cls 98 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/DeliveryConfirmPDFController.cls 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/DeliveryConfirmPDFControllerTest.cls 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/LoanerPortionReturnController.cls 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/NEWCreateSWOQuoteController.cls 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/NEWCreateSWOQuoteControllerTest.cls 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/NewCrossHighOpportunityController.cls 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/NewCrossRegionalControllerText.cls 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/NewCrossRegionalSalesController.cls 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/NewHighProductsOppController.cls 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/NewHighProductsOppControllerTest.cls 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/NewLoanerApplicationControllerTest.cls 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/NewLoanerUserControllerTest.cls 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/NewOpportunityControllerTest.cls 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/OpportunityTriggerHandler.cls 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/OpportunityTriggerTest.cls 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/OrderPdf2Controller.cls 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/OrderPdf2ControllerTest.cls 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/OrderPdfController.cls 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/OrderPdfControllerTest.cls 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/OrderTriggerHandler.cls 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/OrderTriggerTest.cls 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/QuotePDFController.cls 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/QuotePDFControllerTest.cls 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/QuotesPDFController.cls 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/QuotesPDFControllerTest.cls 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/SBG001TriggerHandlerTest.cls 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/SBG007TriggerHandlerTest.cls 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/SBG027TriggerHandleTest.cls 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/SBG203RestTest.cls 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/SWOController.cls 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/SWOControllerTest.cls 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/SearchMemberPageController.cls 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/SearchMemberPageControllerTest.cls 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/SendEmailController.cls 52 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/SendEmailControllerTest.cls 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/TSRepairControllerTest.cls 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/loanerAppTriggerHandler.cls 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/loanerAppTriggerHandlerTest.cls 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/DeliveryConfirmPDF.page 191 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/LoanerPortionReturn.page 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/NEWCreateSWOQuote.page 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/NEWCreateSWOQuoteReadOnly.page 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/NewCrossHighOpportunity.page 155 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/NewCrossRegionalSalesOpportunity.page 177 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/NewHighProductsOpp.page 169 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/NewLoanerApplication.page 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/NewLoanerUser.page 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/OrderPDF.page 2672 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/OrderPdf2.page 170 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/OrderPdf3.page 172 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/QuotePDF.page 493 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/QuotesPDF.page 157 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/SWOPage.page 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/SearchMemberPage.page 152 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/SendEmail.page 552 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
manifest/packagePIPL.xml 100 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
manifest/packageTriggerController.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
manifest/packageUpdatePIPLCode.xml 89 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/ContactTriggerHandler.cls
@@ -5,7 +5,7 @@
            // 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;
@@ -25,8 +25,22 @@
                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) {
@@ -65,33 +79,73 @@
            
            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) {
@@ -100,7 +154,10 @@
            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) {
@@ -139,6 +196,18 @@
                
                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;
@@ -167,6 +236,19 @@
                    
                    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(
@@ -194,7 +276,21 @@
                    
                    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);
            }
        }
        // 更新客户小组
force-app/main/default/classes/DeliveryConfirmPDFController.cls
@@ -17,9 +17,11 @@
    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(){
@@ -38,7 +40,9 @@
            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,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,
        AWS_Data_Id__c,// 20220221 PI改造 by Bright
        Applicant_department__c from loaner_application__c where Id = :laId];
        if (laList.size() == 0) {
            return null;
        }
force-app/main/default/classes/DeliveryConfirmPDFControllerTest.cls
@@ -1,6 +1,12 @@
@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);
force-app/main/default/classes/LoanerPortionReturnController.cls
@@ -8,6 +8,7 @@
    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
@@ -20,6 +21,7 @@
    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() {
@@ -42,7 +44,7 @@
        }
        // 样机借出申请取得
        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];
        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
        if (laList.size() == 0) {
            return null;
        }
@@ -56,6 +58,7 @@
        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;
force-app/main/default/classes/NEWCreateSWOQuoteController.cls
@@ -298,8 +298,8 @@
            // Mail 页面初始化 Start
            List<String> mailIdList = new List<String>();
            List<Attachment> attList = new List<Attachment>();
            Map<String, List<Attachment>> attMap = new Map<String, List<Attachment>>();
            List<FileAddress__c> attList = new List<FileAddress__c>();
            Map<String, List<FileAddress__c>> attMap = new Map<String, List<FileAddress__c>>();
            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]);
@@ -307,15 +307,15 @@
            if (mailMap != null) {
                mailIdList.addAll(mailMap.keySet());
                attList =  [select id, Name, ParentId from Attachment where ParentId in :mailIdList order by ParentId, id];
                attList =  [select id, Name, FileName__c,ParentRecordId__c from FileAddress__c where ParentRecordId__c in :mailIdList order by ParentRecordId__c, id];
                if (attList.size() > 0) {
                    for (Attachment att : attList) {
                        if (attMap.containsKey(att.ParentId)) {
                            attMap.get(att.ParentId).add(att);
                    for (FileAddress__c att : attList) {
                        if (attMap.containsKey(att.ParentRecordId__c)) {
                            attMap.get(att.ParentRecordId__c).add(att);
                        } else {
                            List<Attachment> a = new List<Attachment>();
                            List<FileAddress__c> a = new List<FileAddress__c>();
                            a.add(att);
                            attMap.put(att.ParentId, a);
                            attMap.put(att.ParentRecordId__c, a);
                        }
                    }
                }
@@ -730,16 +730,16 @@
    public class EmailInfo {
        public Mail_Merge__c mm {get; set; }
        public List<Attachment> attList {get; set; }
        public List<FileAddress__c> attList {get; set; }
        public String haveAtt {get; set;}
        public EmailInfo() {
        }
        public EmailInfo(Mail_Merge__c mm_in, List<Attachment> attList_in) {
        public EmailInfo(Mail_Merge__c mm_in, List<FileAddress__c> attList_in) {
            mm = mm_in;
            if (attList_in == null || attList_in.size() == 0) {
                haveAtt = 'No';
                attList = new List<Attachment>();
                attList = new List<FileAddress__c>();
            } else {
                attList = attList_in;
                haveAtt = 'Yes';
force-app/main/default/classes/NEWCreateSWOQuoteControllerTest.cls
@@ -1,5 +1,11 @@
@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'];
force-app/main/default/classes/NewCrossHighOpportunityController.cls
@@ -14,6 +14,10 @@
    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();
@@ -33,6 +37,8 @@
        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) {
@@ -108,8 +114,10 @@
            hasError = false;
            String url = baseUrl + '\\' + opp.Id;
            return new Pagereference(url);
            oppid = opp.id;
            // String url = baseUrl + '\\' + opp.Id;
            // return new Pagereference(url);
            return null;
        } catch (Exception e) {
            Database.rollback(sp);
            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, e.getMessage()));
force-app/main/default/classes/NewCrossRegionalControllerText.cls
@@ -1,5 +1,11 @@
@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(
@@ -57,6 +63,12 @@
            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);
@@ -134,6 +146,9 @@
            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);
force-app/main/default/classes/NewCrossRegionalSalesController.cls
@@ -16,6 +16,10 @@
    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();
@@ -36,12 +40,14 @@
        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];
        List<Contact> conList = [select Id, Name from Contact where Id = :conId];//pi
        if (conList.size() > 0) {
            con = conList[0];
        }
@@ -114,9 +120,9 @@
        Savepoint sp = Database.setSavepoint();
        try {
            //测试环境ID
            opp.RecordTypeId = '0120T0000002Vh9';
            //opp.RecordTypeId = '0120T0000002Vh9';
            //正式环境ID
            //opp.RecordTypeId = '0120K000000OpaG';
            opp.RecordTypeId = '0120K000000OpaG';
            opp.CrossCooperativeProject__c = true;
            insert opp;
@@ -139,8 +145,10 @@
            hasError = false;
            String url = baseUrl + '\\' + opp.Id;
            return new Pagereference(url);
            // String url = baseUrl + '\\' + opp.Id;
            // return new Pagereference(url);
            oppid = opp.id;
            return null;
        } catch (Exception e) {
            Database.rollback(sp);
            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, e.getMessage()));
force-app/main/default/classes/NewHighProductsOppController.cls
@@ -14,6 +14,10 @@
    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();
@@ -33,6 +37,7 @@
        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) {
@@ -103,9 +108,10 @@
            insert ocr;
            hasError = false;
            String url = baseUrl + '\\' + opp.Id;
            return new Pagereference(url);
            oppid = opp.id;
            // String url = baseUrl + '\\' + opp.Id;
            // return new Pagereference(url);
            return null;
        } catch (Exception e) {
            Database.rollback(sp);
            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, e.getMessage()));
force-app/main/default/classes/NewHighProductsOppControllerTest.cls
@@ -1,5 +1,11 @@
@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(
force-app/main/default/classes/NewLoanerApplicationControllerTest.cls
@@ -1,5 +1,11 @@
@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);
force-app/main/default/classes/NewLoanerUserControllerTest.cls
@@ -1,5 +1,11 @@
@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);
force-app/main/default/classes/NewOpportunityControllerTest.cls
@@ -1,5 +1,10 @@
@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'];
force-app/main/default/classes/OpportunityTriggerHandler.cls
@@ -135,6 +135,10 @@
                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;
@@ -411,9 +415,15 @@
            }
            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;
@@ -538,6 +548,10 @@
                    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;
@@ -611,6 +625,10 @@
                    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;
@@ -1124,7 +1142,7 @@
        }
        if (targetList.size() > 0) {
            List<Order> odrList = [select id, OpportunityId from Order where OpportunityId = :targetList and Status__c = 'Active'];
            List<Order> odrList = [select id, OpportunityId,ForeignTradeCompany_D__c,TradeType__c,ProductSegment__c from Order where OpportunityId = :targetList and Status__c = 'Active'];
            for (Order odr : odrList) {
                Opportunity opp = newMap.get(odr.OpportunityId);
@@ -1149,7 +1167,8 @@
                    odr.Status__c = 'Inactive';
                }
            }
            System.debug('odrList------'+odrList);
            if (odrList.size() > 0) update odrList;
        }
        if (targetList2.size() > 0) {
force-app/main/default/classes/OpportunityTriggerTest.cls
@@ -1,3 +1,10 @@
/**
 * @description       :
 * @author            : ChangeMeIn@UserSettingsUnder.SFDoc
 * @group             :
 * @last modified on  : 04-21-2022
 * @last modified by  : ChangeMeIn@UserSettingsUnder.SFDoc
**/
@isTest
private class OpportunityTriggerTest {
    
@@ -458,7 +465,7 @@
        StaticParameter.OpportunityTriggerIsUpdate = true;
        List<RecordType> rectIE = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = 'Customer IE'];
        Account accIE = new Account(
            Name = '*',
            Name = 'test',
            RecordTypeId = rectIE[0].Id,
            OwnerId = UserInfo.getUserId(),
            DivisionName__c='Customer IE',
@@ -495,7 +502,7 @@
           
        List<RecordType> rectOpp = [select id from RecordType where IsActive = true and SobjectType = 'Opportunity'];
        Opportunity opp = new Opportunity(
            Name = 'test opp',
            Name = 'test',
            AccountId = accIE.Id,
            RecordTypeId = rectOpp[0].Id,
            OwnerId = UserInfo.getUserId(),
@@ -531,7 +538,7 @@
        insert role;
        Order odr = new Order(
            Name = '',
            Name = 'test',
            Status = 'Draft',
            Status__c = 'Active',
            AccountId = accIE.Id,
@@ -542,7 +549,8 @@
            IE_SP8__c = true,
            SpecialDeliveryAccount_D__c = accIE.Id,
            SpecialDeliveryContact2_D__c = con.Id,
            EndUser__c = con.Id
            EndUser__c = con.Id,
            EndUserD__c = con.Id
        );
        insert odr;
        opp.Name = 'test';
force-app/main/default/classes/OrderPdf2Controller.cls
@@ -64,6 +64,7 @@
    public String ndt_fax{get;set;}
    public Boolean notSpecialDealer { get; set; }
    public String staticResource { get;private set; }
    //4月11号之后
    //public Boolean fourMaand { get; set; }
    //发货月
@@ -82,6 +83,8 @@
        Date today = Date.today();
        strToday = today.format();
        staticResource = JSON.serialize(PIHelper.getPIIntegrationInfo('Contact'));// 20220222 PI改造 by Bright
    }
    public PageReference init() {
@@ -111,6 +114,7 @@
                                        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) {
@@ -174,7 +178,9 @@
        delivery_contact = new Contact();
        if (order.SpecialDeliveryContact2_D__c != null) {
            delivery_contact = [select Id, Department, Name, Phone, MobilePhone,Address1__c from Contact where Id = :order.SpecialDeliveryContact2_D__c];
            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];
        }
        user = new Account();
@@ -192,7 +198,9 @@
        }
        contact = new Contact();
        if (contactid != null && contactid.length() > 0) {
            contact = [select Id, Department, Name, Phone, MobilePhone,Fax,Email from Contact where Id = :contactid];
            contact = [select Id, Department, Name, Phone, MobilePhone,Fax,
            AWS_Data_Id__c, // 20220222 PI改造 by Bright
            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,
@@ -611,6 +619,7 @@
                                        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) {
@@ -757,6 +766,7 @@
        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; }
@@ -772,6 +782,7 @@
        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; }
@@ -819,6 +830,7 @@
            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;
@@ -831,6 +843,7 @@
            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;
force-app/main/default/classes/OrderPdf2ControllerTest.cls
@@ -1,6 +1,12 @@
@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'];
force-app/main/default/classes/OrderPdfController.cls
@@ -62,6 +62,10 @@
    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.
@@ -75,6 +79,10 @@
        } 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();
@@ -99,7 +107,7 @@
                     PDF_Bi_Packing__c, PDF_Bi_Quality__c, PDF_Bi_Origin__c, PDF_Bi_Non_Wooden__c, PDF_Co_Contract__c, PDF_Co_Contract_E__c, PDF_Co_BContra__c, PDF_Co_BContra_E__c, PDF_SignaturePlaces__c,
                     PDF_Co_SContra__c, PDF_Co_SContra_E__c, PDF_C_Consignee__c, PDF_C_THECONSIGNE__c, PDF_C_Address__c, PDF_C_TEL__c, PDF_C_FAX__c, PDF_C_CONTACT__c,
                     PDF_BusyerCompany__c, PDF_By_Add__c, PDF_By_Tel__c, PDF_Forwarder__c, PDF_F_Add__c, PDF_F_TEL__c, PDF_F_FAX__c, PDF_F_ContactPerson__c,
                     Opportunity.SpecialDeliveryAddress__c, Opportunity.SpecialDeliveryContact__c, DeliveryTimeText__c, DeliveryTimeTextEn__c,
                     Opportunity.SpecialDeliveryAddress__c, Opportunity.SpecialDeliveryContact__c, DeliveryTimeText__c, DeliveryTimeTextEn__c,PDF_Sp_LOADING_E__c,PDF_Sp_LOADING__c,
                     SpecialDeliveryAccount__c, SpecialDeliveryAccount_D__c, SpecialDeliveryContact2__c, SpecialDeliveryContact2_D__c, PDF_Order_No__c, Total_price_E__c, ContractPriceTotal__c,
                     PDF_Shipment_Term2_Text__c, PDF_PaymentTerms__c, PDF_PaymentTerms_E__c, PDF_Sign_Name__c, PDF_Sign_Title__c, org_order__c, Is_Already_Splited__c, PDF_Is_True__c 
                     from Order where id = :Id];
@@ -171,6 +179,12 @@
                if (od.PDF_B_contactperson__c  == null || od.PDF_B_contactperson__c == '') {
                    od.PDF_B_contactperson__c = od.B_contactperson__c;
                }*/
                if (od.PDF_Sp_LOADING_E__c == null || od.PDF_Sp_LOADING_E__c == '') {
                    od.PDF_Sp_LOADING_E__c = 'Hong Kong';
                }
                if (od.PDF_Sp_LOADING__c == null || od.PDF_Sp_LOADING__c == '') {
                    od.PDF_Sp_LOADING__c = '香港';
                }
                if (od.PDF_SELLER__c == null || od.PDF_SELLER__c == '') {
                    od.PDF_Bi_q1__c = '2';
@@ -250,7 +264,9 @@
            }
            specialDeliveryContact = new Contact();
            if (od.SpecialDeliveryContact2_D__c != null) {
                specialDeliveryContact = [select Id, Name, Email from Contact where Id = :od.SpecialDeliveryContact2_D__c];
                specialDeliveryContact = [select Id, Name,
                AWS_Data_Id__c,// 20220222 PI改造 by Bright
                Email from Contact where Id = :od.SpecialDeliveryContact2_D__c];
            }
        }
@@ -530,7 +546,8 @@
                        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,
                        PDF_Shipment_Term2_Text__c, PDF_PaymentTerms__c, PDF_PaymentTerms_E__c, PDF_Sign_Name__c, PDF_Sign_Title__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];
            ndtList = [select id, U8_Code__c, Quantity__c, Part_Number__c, Name_of_Goods__c from NDT_Produce__c where NDTOrder__c = :Id order by Id];
@@ -550,7 +567,9 @@
        }
        specialDeliveryContact = new Contact();
        if (odpdf.SpecialDeliveryContact2_D__c != null) {
            specialDeliveryContact = [select Id, Name, Email from Contact where Id = :odpdf.SpecialDeliveryContact2_D__c];
            specialDeliveryContact = [select Id, Name,
                                        AWS_Data_Id__c,// 20220222 PI改造 by Bright
                                        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,
@@ -640,6 +659,23 @@
        '51个月' => 'fifty-one (51) monthss',
        '63个月' => 'sixty-three (63) months'
    };
    private static Map<String, String> QAapiMap1 = new Map<String, String> {
        '12个月' => '12个月',
        '15个月' => '15个月',
        '18个月' => '18个月',
        '21个月' => '21个月',
        '24个月' => '24个月',
        '27个月' => '27个月',
        '30个月' => '30个月',
        '33个月' => '33个月',
        '36个月' => '36个月',
        '48个月' => '48个月',
        '60个月' => '60个月',
        '39个月' => '39个月',
        '51个月' => '51个月',
        '63个月' => '63个月'
    };
    public class SetInfo {
        private Integer maxLine = 36;
@@ -803,6 +839,8 @@
        public String AllBills { get; private set; }
        public String QAeng { get; private set; }
        public String QAeng2 { get; private set; }
        public String QAeng3 { get; private set; }
        public String QAeng4 { get; private set; }
        public String ShippingTerms { get; private set; }
        public String pdf_c_consignee { get; private set; }
@@ -821,8 +859,10 @@
            } else if (o.PDF_Bi_AllBill__c == '不随货') {
                AllBills = 'not with';
            }
            QAeng = QAapiMap.get(o.PDF_QA__c);
            QAeng = QAapiMap1.get(o.PDF_QA__c);
            QAeng4 = QAapiMap1.get(o.PDF_QA2__c);
            QAeng2 = QAapiMap.get(o.PDF_QA2__c);
            QAeng3 = QAapiMap.get(o.PDF_QA__c);
            if (o.PDF_Sp_ShippingTerms__c == '海运') {
                ShippingTerms = 'by sea';
            } else if (o.PDF_Sp_ShippingTerms__c == '空运') {
force-app/main/default/classes/OrderPdfControllerTest.cls
@@ -1,6 +1,12 @@
@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'];
@@ -116,6 +122,7 @@
            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,
@@ -136,6 +143,7 @@
        insert oiList;
        Test.startTest();
        PageReference page = new PageReference('/apex/OrderContract?id=' + order.Id);
        System.Test.setCurrentPage(page);
        OrderPdfController controller = new OrderPdfController();
@@ -145,6 +153,7 @@
        controller.saveBtn();
        controller.printBtn();
        Test.stopTest();
    }
    @isTest static void test_init2() {
@@ -280,6 +289,7 @@
            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,
@@ -300,6 +310,7 @@
        insert oiList;
        Test.startTest();
        PageReference page = new PageReference('/apex/OrderPdf?id=' + order.Id);
        System.Test.setCurrentPage(page);
        OrderPdfController controller = new OrderPdfController();
@@ -307,6 +318,7 @@
        //controller.init();
        controller.init2();
        //controller.init();
        Test.stopTest();
    }
    @isTest static void test_init2_2() {
@@ -429,6 +441,7 @@
            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,
@@ -448,12 +461,13 @@
        }
        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'];
@@ -571,6 +585,7 @@
            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,
@@ -591,6 +606,7 @@
        insert oiList;
        Test.startTest();
        PageReference page = new PageReference('/apex/OrderContract?id=' + order.Id);
        System.Test.setCurrentPage(page);
        OrderPdfController controller = new OrderPdfController();
@@ -600,6 +616,7 @@
        controller.saveBtn();
        controller.printBtn();
        Test.stopTest();
    }
}
force-app/main/default/classes/OrderTriggerHandler.cls
@@ -2851,6 +2851,8 @@
        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 = '客户名或最终用户与询价不一致!';
force-app/main/default/classes/OrderTriggerTest.cls
@@ -1,3 +1,10 @@
/**
 * @description       :
 * @author            : ChangeMeIn@UserSettingsUnder.SFDoc
 * @group             :
 * @last modified on  : 04-21-2022
 * @last modified by  : ChangeMeIn@UserSettingsUnder.SFDoc
**/
@isTest
private class OrderTriggerTest {
@@ -255,15 +262,15 @@
        List<Order> orderList3 = [select id, ApproveStatus__c from Order where Id = :odr.Id];
        System.assertEquals('OrderPass', orderList3[0].ApproveStatus__c);
        odr.ApproveStatus__c = 'Completed2';
        update odr;
        odr.ApproveStatus__c = 'OrderSubmit';
        update odr;
        odr.ApproveStatus__c = 'OrderReject';
        update odr;
        // odr.ApproveStatus__c = 'Completed2';
        // update odr;
        // odr.ApproveStatus__c = 'OrderSubmit';
        // update odr;
        // odr.ApproveStatus__c = 'OrderReject';
        // update odr;
        List<Order> orderList4 = [select id, ApproveStatus__c from Order where Id = :odr.Id];
        System.assertEquals('OrderReject', orderList4[0].ApproveStatus__c);
        // List<Order> orderList4 = [select id, ApproveStatus__c from Order where Id = :odr.Id];
        // System.assertEquals('OrderReject', orderList4[0].ApproveStatus__c);
    }
    //
force-app/main/default/classes/QuotePDFController.cls
@@ -83,9 +83,17 @@
        '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
    }
    // 画面初始化
@@ -118,6 +126,7 @@
                                      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];
@@ -154,7 +163,9 @@
        }
        Contact con = new Contact();
        if (conid != null && conid.length() > 0) {
            con = [select Id, Name, Phone, Email, Account.Name from Contact where Id = :conid];
            con = [select Id, Name, Phone, Email,
            AWS_Data_Id__c,// 20220221 PI改造 by Bright
            Account.Name from Contact where Id = :conid];
        }
        // PDF报价信息
        quoteInfo = new QuoteInfo(quo, dealer, con);
@@ -215,6 +226,8 @@
        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;
@@ -251,6 +264,8 @@
            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
        }
    }
force-app/main/default/classes/QuotePDFControllerTest.cls
@@ -1,6 +1,12 @@
@isTest
private class QuotePDFControllerTest {
    @TestSetup
    static void setup(){
        TestDataUtility.CreatePIPolicyConfigurations(new string[]{'Opportunity','Contact','Document'});
    }
    @isTest static void test_init() {
        Id pricebookId = Test.getStandardPricebookId();
force-app/main/default/classes/QuotesPDFController.cls
@@ -16,6 +16,11 @@
    //总金额 合计
    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;
@@ -39,6 +44,8 @@
    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
    }
    /**
@@ -55,7 +62,7 @@
            //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,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];
            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];
            List<Contact> conList = [select Id,Name from Contact where Id =: quo.CONTACT_NAME__c];
            if(conList!=null && conList.size()!=0){
                conName = conList[0].Name;
force-app/main/default/classes/QuotesPDFControllerTest.cls
@@ -1,5 +1,11 @@
@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'];
force-app/main/default/classes/SBG001TriggerHandlerTest.cls
@@ -1,5 +1,11 @@
@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'];
force-app/main/default/classes/SBG007TriggerHandlerTest.cls
@@ -1,6 +1,12 @@
@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(
@@ -64,6 +70,7 @@
//    }
    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 = '*',
@@ -235,4 +242,12 @@
           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);
    }
}
force-app/main/default/classes/SBG027TriggerHandleTest.cls
@@ -1,6 +1,9 @@
@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',
force-app/main/default/classes/SBG203RestTest.cls
@@ -13,6 +13,11 @@
    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(
force-app/main/default/classes/SWOController.cls
@@ -106,8 +106,8 @@
            System.debug('swoList: ' + swoList);// 20220313 PI改造 by Chen Yanan
            if (swoList.size() > 0) {
                swo = swoList[0];
                swoawsDataId = swo.AWS_Data_Id__c;
                contactAWSDataId = String.isNotBlank(swo.CONTACT__r.AWS_Data_Id__c)?swo.CONTACT__r.AWS_Data_Id__c:'';
                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;
force-app/main/default/classes/SWOControllerTest.cls
@@ -2,6 +2,11 @@
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';
@@ -219,6 +224,7 @@
        );
        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));
@@ -285,7 +291,7 @@
        controller.addDiagnosisInfo();
        controller.openPageSave();
        controller.repairReturn();
        Test.stopTest();
    }
    
force-app/main/default/classes/SearchMemberPageController.cls
@@ -2,16 +2,21 @@
    //页面输入检索条件
    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>();
@@ -24,15 +29,23 @@
        String soql = '';
        if(memberType == 'Contact'){
            soql = 'select Id,Name,Email,Account.Name from Contact where Id!=null ';
            soql = 'select Id,Name,Email,Account.Name,AWS_Data_Id__c from Contact where Id!=null ';
            if(String.isNotBlank(searchByName)){
                soql += 'and Name like \'%'+searchByName.trim()+'%\' ';
            }
            // 20220221 PI改造 by Bright
            // if(String.isNotBlank(searchByName)){
            //     soql += 'and Name like \'%'+searchByName.trim()+'%\' ';
            // }
            if(String.isNotBlank(searchByAccount)){
                soql += 'and Account.Name like \'%'+searchByAccount.trim()+'%\' ';
            }
            soql += 'limit 200';
            // 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);
            List<Contact> conList = Database.query(soql);
            if(conList!=null&&conList.size()!=0){
                for(Contact con : conList){
@@ -42,6 +55,7 @@
                    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);
                }
            }
@@ -78,6 +92,7 @@
                    memberId = line.Id;
                    memberName = line.name;
                    memberEmail = line.email;
                    aws_data_id = line.aws_data_id;
                    System.debug(line.email);
                    i++;
                }
@@ -110,5 +125,7 @@
        public String name{get;set;}
        public String email{get;set;}
        public String account{get;set;}
        public String aws_data_id{get;set;}
    }
}
force-app/main/default/classes/SearchMemberPageControllerTest.cls
@@ -1,5 +1,11 @@
@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'];
        
force-app/main/default/classes/SendEmailController.cls
@@ -1,4 +1,4 @@
public without sharing class SendEmailController {
public without sharing class SendEmailController{
    public Mail_Merge__c mail{get; set;}
@@ -23,6 +23,7 @@
    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;}
@@ -45,18 +46,28 @@
    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 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 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 void init(){
@@ -75,6 +86,23 @@
        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();
@@ -95,7 +123,12 @@
                }
            }
        }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 from Mail_Merge__c where id =:id];
            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.TYPE__c == 'reply' 邮件为回复邮件 或者是系统自动发送的邮件
            //EMAIL_SENT__c =='YES' 邮件已发送
            if(mail.TYPE__c == 'reply' || mail.EMAIL_SENT__c =='YES'){
@@ -147,7 +180,7 @@
                replyEmailHead    = '\n\n\n\n';
                replyEmailHead    += '-------------邮件原件--------------\n';
                replyEmailHead    += '发件人:' + mail.FROM__c + ';\n';
                replyEmailHead    += '发件时间:' + mail.DATE__c.addHours(8) + ';\n';
                replyEmailHead    += '发件时间:' + (mail.DATE__c==null?Datetime.now():mail.DATE__c.addHours(8)) + ';\n';
                replyEmailHead    += '收件人:' + mailToAddressName + '\n';
                replyEmailHead    += '抄送:' + mailCcAdressName + '\n';
                replyEmailHead    += '主题:' + mail.SUBJECT__c + ';\n\n';
@@ -195,6 +228,7 @@
                 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();
            }*/
@@ -372,6 +406,7 @@
                        }
                    }
                    mail.EMAIL_SENT__c = 'YES';
                    System.debug('mail='+mail);
                    upsert mail;
                    // 返回点击邮件页面
                    PageReference ref = new Pagereference('/'+mail.RECORD__c+'?type=mail');
@@ -388,6 +423,7 @@
    }
    public void save() {
        System.debug('handleType='+handleType);
        toAddresses = new List<String>();
        ccAddresses = new List<String>();
        bccAddresses = new List<String>();
force-app/main/default/classes/SendEmailControllerTest.cls
@@ -1,5 +1,11 @@
@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();
force-app/main/default/classes/TSRepairControllerTest.cls
@@ -18,6 +18,11 @@
    public static Account acc1;
    public static Account acc2;
    @TestSetup
    static void setup(){
        TestDataUtility.CreatePIPolicyConfigurations(new string[]{'Contact'});
    }
    static void basicData() {
force-app/main/default/classes/loanerAppTriggerHandler.cls
@@ -1,11 +1,20 @@
/**
 * @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>();
        // 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<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){
@@ -33,6 +42,8 @@
    }
    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);
force-app/main/default/classes/loanerAppTriggerHandlerTest.cls
@@ -1,3 +1,10 @@
/**
 * @description       :
 * @author            : ChangeMeIn@UserSettingsUnder.SFDoc
 * @group             :
 * @last modified on  : 04-21-2022
 * @last modified by  : ChangeMeIn@UserSettingsUnder.SFDoc
**/
@isTest
private class loanerAppTriggerHandlerTest {
    
@@ -101,12 +108,14 @@
        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;
@@ -191,7 +200,26 @@
        loaner.Status__c = '取消';
        update loaner;
System.Test.stopTest();
        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();
    }
    
}
force-app/main/default/pages/DeliveryConfirmPDF.page
@@ -1,16 +1,37 @@
<apex:page controller="DeliveryConfirmPDFController" showHeader="false" sidebar="false"  id="allPage" action="{!init}" renderAs="pdf">  <!-- renderAs="pdf" -->
<apex:page controller="DeliveryConfirmPDFController" showHeader="false" sidebar="false"  id="allPage" action="{!init}" >  <!-- 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>
@@ -31,7 +52,7 @@
            </apex:outputPanel>
            
            <td align="right">借用担当:</td>
            <td><apex:outputText value="{!la.Loaner_Ser__c}"/></td>
            <td><span aws-obj="loaner_application__c" aws-api="loanerSer" aws-id="{!la.AWS_Data_Id__c}">{!la.Loaner_Ser__c}</span></td>
        </tr>
        <tr>
            <td align="right">借用日期:</td>
@@ -93,15 +114,15 @@
        <tr>
            
            <td align="right" width="90">寄送地址:</td>
            <td colspan="3"><apex:outputField value="{!la.direct_shippment_address__c}"/></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>
        </tr>
        <tr>
            
            <td align="right" width="90">联系人:</td>
            <td><apex:outputField value="{!la.Loaner_receive_staff__c}"/></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 align="right" width="90">联系电话:</td>
            <td width="200"><apex:outputField value="{!la.Loaner_receive_staff_phone__c}"/></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>
        </tr>
@@ -131,17 +152,17 @@
        <apex:repeat value="{!luData}" var="luLine" id="lus">
        <tr>
            <td class="dataCell" style="text-align: center;">
                <apex:outputText value="{!luLine.lu.Customer__r.Name}"/>
                <apex:outputText styleClass="Customer__r.Name" value="{!luLine.lu.Customer__r.Name}"/>
            </td>
            <td class="dataCell" style="text-align: center;">
                <apex:outputText value="{!luLine.lu.Customer__r.DivisionName__c}"/>
                <apex:outputText styleClass="Customer__r.DivisionName__c" value="{!luLine.lu.Customer__r.DivisionName__c}"/>
            </td>
            <td class="dataCell" style="text-align: center;">
                <apex:outputText value="{!luLine.lu.Contact__r.Name}"/>
                <span aws-obj="Contact" aws-api="lastName" aws-id="{!la.AWS_Data_Id__c}">{!luLine.lu.Contact__r.Name}</span>
            </td>
            <apex:outputPanel rendered="{!IF(la.Equipment_Type__c == 'BS', true , false)}" layout="none">
                <td class="dataCell" style="text-align: center;">
                    <apex:outputText value="{!luLine.lu.Contact__r.Phone}"/>
                    <span aws-obj="Contact" aws-api="phone" aws-id="{!la.AWS_Data_Id__c}">{!luLine.lu.Contact__r.Phone}</span>
                </td>
            </apex:outputPanel>
            <apex:outputPanel rendered="{!IF(la.Equipment_Type__c == 'BS', false , true)}" layout="none">
@@ -261,9 +282,155 @@
            <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>
force-app/main/default/pages/LoanerPortionReturn.page
@@ -2,8 +2,75 @@
<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();
}
@@ -71,7 +138,12 @@
                    <tr>
                        <td>
                             <label for="user">{!$ObjectType.loaner_application_detail__c.fields.Return_Trake_Staff__c.label}: </label>
                            <apex:inputField value="{!lac.Return_Trake_Staff__c}" id="user"></apex:inputField>
                             <!-- 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  -->
                        </td>
                        <td>
                             <apex:commandButton onclick="test1();" value="回寄" rerender="dummy" style="width: 70px;float: right;"/>  
force-app/main/default/pages/NEWCreateSWOQuote.page
@@ -949,7 +949,7 @@
                            <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.Name}" /></apex:outputLink>
                                    <apex:outputLink value="/{!att.Id}" target="LINK_{!att.Id}"><c:PDFWbr targetStr="{!att.FileName__c}" /></apex:outputLink>
                                    <br/>
                                </apex:repeat>
                            </td>
force-app/main/default/pages/NEWCreateSWOQuoteReadOnly.page
@@ -901,7 +901,7 @@
                            <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.Name}" /></apex:outputLink>
                                    <apex:outputLink value="/{!att.Id}" target="LINK_{!att.Id}"><c:PDFWbr targetStr="{!att.FileName__c}" /></apex:outputLink>
                                    <br/>
                                </apex:repeat>
                            </td>
force-app/main/default/pages/NewCrossHighOpportunity.page
@@ -2,35 +2,122 @@
    <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>
    function saveJs() {
        blockme();
        saveBtn();
    }
    function saveYesJs() {
        blockme();
        saveBtnYes();
    }
    function saveNoJs() {
        blockme();
        saveBtnNo();
    }
    function cancelJs() {
        var baseUrl = '{!baseUrl}';
        var rtUrl = '{!rtUrl}';
        if (rtUrl == 'null' || rtUrl == '') {
            rtUrl = '{!conId}';
        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,
            }]);
        }
        window.location.href = baseUrl + "/" + rtUrl;
    }
        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;
                        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;
            }
            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 saveYesJs() {
            blockme();
            saveBtnYes();
        }
        function saveNoJs() {
            blockme();
            saveBtnNo();
        }
        function cancelJs() {
            var baseUrl = '{!baseUrl}';
            var rtUrl = '{!rtUrl}';
            if (rtUrl == 'null' || rtUrl == '') {
                rtUrl = '{!conId}';
            }
            window.location.href = baseUrl + "/" + rtUrl;
        }
    </script>
    <apex:form id="mainForm">
        <apex:actionFunction action="{!saveBtn}" name="saveBtn" reRender="mainForm,message" oncomplete="unblockUI();"/>
        <script>
            oppid = '{!oppid}';
        </script>
        <apex:actionFunction action="{!saveBtn}" name="saveBtn" reRender="mainForm,message" oncomplete="unblockUI();Trans();"/>
        <apex:actionFunction action="{!saveBtnYes}" name="saveBtnYes" reRender="mainForm,message" oncomplete="unblockUI();"/>
        <apex:actionFunction action="{!saveBtnNo}" name="saveBtnNo" reRender="mainForm,message" oncomplete="unblockUI();"/>
@@ -118,27 +205,28 @@
                </apex:pageBlockSectionItem>
            </apex:pageBlockSection>
            <apex:pageBlockSection title="经销商相关信息" columns="2">
            <apex:pageBlockSection id="DealerInfo" title="经销商相关信息" columns="2">
                <apex:pageBlockSectionItem >
                    <apex:outputLabel value="代理商名" for="opp_Dealer"/>
                    <apex:inputField value="{!opp.Dealer__c}" id="opp_Dealer"/>
                </apex:pageBlockSectionItem>
                
                    <apex:pageBlockSectionItem >
                        <apex:outputLabel value="代理商销售担当者名" for="opp_DealerSalesStaffName"/>
                        <apex:inputField value="{!opp.DealerSalesStaffName__c}" id="opp_DealerSalesStaffName"/>
                    </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_SubDealer"/>
                    <apex:inputField value="{!opp.SubDealer__c}" id="opp_SubDealer"/>
                </apex:pageBlockSectionItem>
                <apex:pageBlockSectionItem >
                <apex:pageBlockSectionItem id="ds" >
                    <apex:outputLabel value="代理商服务担当者名" for="opp_DealerService"/>
                    <apex:inputField value="{!opp.DealerService__c}" id="opp_DealerService"/>
                    <apex:inputField value="{!opp.DealerService__c}" id="opp_DealerService"/><!--pi-->
                </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">
@@ -146,7 +234,6 @@
                    <apex:outputLabel value="合作区域负责人" for="HeadOfCooperationArea__c"/>
                    <apex:inputField value="{!opp.HeadOfCooperationArea__c}" id="HeadOfCooperationArea__c"/>
                </apex:pageBlockSectionItem>
            </apex:pageBlockSection>
force-app/main/default/pages/NewCrossRegionalSalesOpportunity.page
@@ -2,11 +2,127 @@
    <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();
        saveBtn();
        console.log('{!isDealerPage}');
        console.log('{!ProductSegment}');
        ProcessPI({},GetObj(),function(){
            saveBtn();
        });
        //
    }
    function saveYesJs() {
@@ -30,7 +146,10 @@
    </script>
    <apex:form id="mainForm">
        <apex:actionFunction action="{!saveBtn}" name="saveBtn" reRender="mainForm,message" oncomplete="unblockUI();"/>
        <script>
            oppid = '{!oppid}';
        </script>
        <apex:actionFunction action="{!saveBtn}" name="saveBtn" reRender="mainForm,message" oncomplete="unblockUI();Trans();"/>
        <apex:actionFunction action="{!saveBtnYes}" name="saveBtnYes" reRender="mainForm,message" oncomplete="unblockUI();"/>
        <apex:actionFunction action="{!saveBtnNo}" name="saveBtnNo" reRender="mainForm,message" oncomplete="unblockUI();"/>
@@ -130,30 +249,36 @@
                </apex:pageBlockSectionItem>
            </apex:pageBlockSection>
            <apex:pageBlockSection title="经销商相关信息" columns="2">
            <apex:pageBlockSection id="DealerInfo" title="经销商相关信息" columns="2">
                <apex:pageBlockSectionItem >
                    <apex:outputLabel value="代理商名" for="opp_Dealer"/>
                    <apex:inputField value="{!opp.Dealer__c}" id="opp_Dealer"/>
                </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 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 >
                    <apex:outputLabel value="中间商名" for="opp_SubDealer"/>
                    <apex:inputField value="{!opp.SubDealer__c}" id="opp_SubDealer"/>
                </apex:pageBlockSectionItem>
                <apex:pageBlockSectionItem >
                <apex:pageBlockSectionItem id="ds" >
                    <apex:outputLabel value="代理商服务担当者名" for="opp_DealerService"/>
                    <apex:inputField value="{!opp.DealerService__c}" id="opp_DealerService"/>
                    <apex:inputField value="{!opp.DealerService__c}" id="opp_DealerService"/><!--pi-->
                </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">
@@ -319,30 +444,30 @@
                </apex:pageBlockSectionItem>
            </apex:pageBlockSection>
            <apex:pageBlockSection title="经销商相关信息" columns="2">
            <apex:pageBlockSection id="DealerInfo2" 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 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: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: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"/>
                    </apex:pageBlockSectionItem>
                <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:outputPanel> -->
                <apex:pageBlockSectionItem >
                    <apex:outputLabel value="中间商名." for="opp_SubDealer"/>
                    <apex:inputField value="{!opp.Sub_Dealer_D__c}" id="opp_SubDealer"/>
                </apex:pageBlockSectionItem>
                <apex:pageBlockSectionItem >
                <apex:pageBlockSectionItem id="dsd" >
                    <apex:outputLabel value="代理商服务担当者名." for="opp_DealerService"/>
                    <apex:inputField value="{!opp.Dealer_Service_D__c}" id="opp_DealerService"/>
                    <apex:inputField value="{!opp.Dealer_Service_D__c}" id="opp_DealerService"/><!--pi-->
                </apex:pageBlockSectionItem>
            </apex:pageBlockSection>
force-app/main/default/pages/NewHighProductsOpp.page
@@ -2,35 +2,135 @@
    <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>
    function saveJs() {
        blockme();
        saveBtn();
    }
    function saveYesJs() {
        blockme();
        saveBtnYes();
    }
    function saveNoJs() {
        blockme();
        saveBtnNo();
    }
    function cancelJs() {
        var baseUrl = '{!baseUrl}';
        var rtUrl = '{!rtUrl}';
        if (rtUrl == 'null' || rtUrl == '') {
            rtUrl = '{!conId}';
        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();
            }
        }
        window.location.href = baseUrl + "/" + rtUrl;
    }
        function saveYesJs() {
            blockme();
            saveBtnYes();
        }
        function saveNoJs() {
            blockme();
            saveBtnNo();
        }
        function cancelJs() {
            var baseUrl = '{!baseUrl}';
            var rtUrl = '{!rtUrl}';
            if (rtUrl == 'null' || rtUrl == '') {
                rtUrl = '{!conId}';
            }
            window.location.href = baseUrl + "/" + rtUrl;
        }
        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;
        }
    </script>
    <apex:form id="mainForm">
        <apex:actionFunction action="{!saveBtn}" name="saveBtn" reRender="mainForm,message" oncomplete="unblockUI();"/>
        <script>
            oppid = '{!oppid}';
        </script>
        <apex:actionFunction action="{!saveBtn}" name="saveBtn" reRender="mainForm,message" oncomplete="unblockUI();Trans();"/>
        <apex:actionFunction action="{!saveBtnYes}" name="saveBtnYes" reRender="mainForm,message" oncomplete="unblockUI();"/>
        <apex:actionFunction action="{!saveBtnNo}" name="saveBtnNo" reRender="mainForm,message" oncomplete="unblockUI();"/>
@@ -118,27 +218,28 @@
                </apex:pageBlockSectionItem>
            </apex:pageBlockSection>
            <apex:pageBlockSection title="经销商相关信息" columns="2">
            <apex:pageBlockSection id="DealerInfo" title="经销商相关信息" columns="2">
                <apex:pageBlockSectionItem >
                    <apex:outputLabel value="代理商名" for="opp_Dealer"/>
                    <apex:inputField value="{!opp.Dealer__c}" id="opp_Dealer"/>
                </apex:pageBlockSectionItem>
                
                    <apex:pageBlockSectionItem >
                        <apex:outputLabel value="代理商销售担当者名" for="opp_DealerSalesStaffName"/>
                        <apex:inputField value="{!opp.DealerSalesStaffName__c}" id="opp_DealerSalesStaffName"/>
                    </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_SubDealer"/>
                    <apex:inputField value="{!opp.SubDealer__c}" id="opp_SubDealer"/>
                </apex:pageBlockSectionItem>
                <apex:pageBlockSectionItem >
                <apex:pageBlockSectionItem id="ds" >
                    <apex:outputLabel value="代理商服务担当者名" for="opp_DealerService"/>
                    <apex:inputField value="{!opp.DealerService__c}" id="opp_DealerService"/>
                    <apex:inputField value="{!opp.DealerService__c}" id="opp_DealerService"/><!--pi-->
                </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>
     
force-app/main/default/pages/NewLoanerApplication.page
@@ -5,7 +5,7 @@
    <!-- Update 20220318 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 20220318 By Yang Kaiyu End -->
    <script>
        // Update 20220318 By Yang Kaiyu Start
force-app/main/default/pages/NewLoanerUser.page
@@ -7,6 +7,7 @@
    <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
@@ -31,7 +32,8 @@
            console.log(accountValue);
            if(accountValue !='000000000000000'){
                let baseUrl = "/apex/SearchContactPage";
                let suffixUrl = "?contactId="+contactNodeId+"&accountId="+accountValue;
                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) {
@@ -48,15 +50,12 @@
            dataLinesJson = JSON.parse('{!dataLinesJson}');
            console.log('dataLinesJson = ' + dataLinesJson);
            for(var i = 0;i<dataLinesJson.length;i++){
                //if(document.getElementById('allpage:allForm:allBlock:lines:'+i+':customer') != null){
                let contactHtmlString = '<img src="/img/s.gif" onclick="searchContact(\'allPage:allForm:contactId\',\'allPage:allForm:allBlock:lines:'+i+':customer_lkid\',\'allPage:allForm:allBlock:lines:'+i+':contact_lkid\',\'allPage:allForm:allBlock:lines:'+i+':contact\')" 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:allBlock:lines:'+i+':contact').parentNode;
                //parentNode.appendChild(lookUpNode);
                parentNode.replaceChild(lookUpNode, document.getElementById('allPage:allForm:allBlock:lines:'+i+':contact').parentNode.children[2]);
                //}
                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) {
@@ -203,8 +202,9 @@
                            <!-- Update 20220317 By Yang Kaiyu End -->
                               {!$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: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 -->
                               {!$ObjectType.loaner_user__c.fields.FromThePeriod__c.label}:
force-app/main/default/pages/OrderPDF.page
@@ -1,4 +1,5 @@
<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}" >
    <!-- <apex:page Controller="OrderPdfController" showHeader="false" sidebar="false" id="allPage" action="{!init2}" renderAs="pdf"> -->
<html>
    <head>
        <style>
@@ -20,1131 +21,1580 @@
        </style>
    </head>
    <body style="font-family: Arial Unicode MS; page-break-inside: auto">
        <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>
                </td>
                <td>
                    <div>:&nbsp;</div>
                    <div>:&nbsp;</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>:&nbsp;</div>
                    <div>:&nbsp;</div>
                    </apex:outputPanel>
                </td>
                <td>
                    <div>&nbsp;{!contra.order.PDF_Order_No__c}</div>
                    <div>&nbsp;{!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>&nbsp;{!contra.order.PDF_I_Report__c}</div>
                    <div>&nbsp;{!contra.order.Dealer__c}</div>
                    </apex:outputPanel>
                </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 = '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>:&nbsp;</div>
                    <div>:&nbsp;</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>:&nbsp;</div>
                    <div>:&nbsp;</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>&nbsp;{!contra.SignatureDate}</div>
                    <div>&nbsp;{!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>&nbsp;{!contra.order.PDF_SignaturePlace__c}</div>
                    <div>&nbsp;{!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;">买方:&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!specialDeliveryAddress.Name}</td>
            </tr>
            <tr>
                <td style="font-size: 8pt;">THE BUYER:&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!specialDeliveryAddress.EnglishName__c}</td>
            </tr>
            <tr>
                <td style="font-size: 8pt;">地址:&nbsp;</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:&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_B_Add__c}</td>
            </tr>
            </apex:outputPanel>
            <tr>
                <td style="font-size: 8pt;">电话(Tel):&nbsp;</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):&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!specialDeliveryAddress.Fax}</td>
            </tr>
            </apex:outputPanel>
            <tr>
                <td style="font-size: 8pt;">联系人:&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!specialDeliveryContact.Name}</td>
            </tr>
            <tr>
                <td style="font-size: 8pt;">CONTACT PERSON:&nbsp;</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:&nbsp;</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;">用户属性:&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_B_Attri__c}</td>
            </tr>
            <tr>
                <td style="font-size: 8pt;">用户产品:&nbsp;</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;">市场:&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!contra.account.Sub_Use__c}</td>
            </tr>
            </apex:outputPanel>
            <tr><td height="1px">&nbsp;</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;">卖方:&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_SELLER__c}</td>
            </tr>
            <tr>
                <td style="font-size: 8pt;">THE SELLER:&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_THE_SELLER__c}</td>
            </tr>
            <tr>
                <td style="font-size: 8pt;">地址:&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_S_Adds__c}</td>
            </tr>
            <tr>
                <td style="font-size: 8pt;">ADD:&nbsp;</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;">卖方:&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_SELLER__c}</td>
            </tr>
            <tr>
                <td style="font-size: 8pt;">地址:&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_S_Adds__c}</td>
            </tr>
            <tr>
                <td style="font-size: 8pt;">电话 (TEL):&nbsp;</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;">卖方:&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_SELLER__c}</td>
            </tr>
            <tr>
                <td style="font-size: 8pt;">THE SELLER:&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_THE_SELLER__c}</td>
            </tr>
            <tr>
                <td style="font-size: 8pt;">地址:&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_S_Adds__c}</td>
            </tr>
            <tr>
                <td style="font-size: 8pt;">ADD:&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_S_Address__c}</td>
            </tr>
            <tr>
                <td style="font-size: 8pt;">电话(Tel):&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_S_TEL__c}</td>
            </tr>
            <tr>
                <td style="font-size: 8pt;">传真(FAX):&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_S_FAX__c}</td>
            </tr>
            <tr>
                <td style="font-size: 8pt;">Bank Name:&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_S_Bank_Name__c}</td>
            </tr>
            <tr>
                <td style="font-size: 8pt;">Branch:&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_S_Branch__c}</td>
            </tr>
            <tr>
                <td style="font-size: 8pt;">Address:&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_S_Bank_Address__c}</td>
            </tr>
            <!-- <tr>
                <td style="font-size: 8pt;">Address:&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_S_Address__c}</td>
            </tr> -->
            <tr>
                <td style="font-size: 8pt;">Account no:&nbsp;</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:&nbsp;</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:&nbsp;</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">&nbsp;</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;">&nbsp;</td>
            </tr> -->
            <tr>
                <td style="font-size: 8pt;">收货人:&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_C_Consignee__c}</td>
            </tr>
            <tr>
                <td style="font-size: 8pt;">THE CONSIGNEE:&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_C_THECONSIGNE__c}</td>
            </tr>
            <tr>
                <td style="font-size: 8pt;">地址:&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_C_Address__c}</td>
            </tr>
            <tr>
                <td style="font-size: 8pt;">ADD:&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_C_Add__c}</td>
            </tr>
            <tr>
                <td style="font-size: 8pt;">电话(Tel):&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_C_TEL__c}</td>
            </tr>
            <tr>
                <td style="font-size: 8pt;">传真(Fax):&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_C_FAX__c}</td>
            </tr>
            <tr>
                <td style="font-size: 8pt;">联系人:&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_C_CONTACT__c}</td>
            </tr>
            <tr>
                <td style="font-size: 8pt;">CONTACT PERSON:&nbsp;</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:&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_C_THECONSIGNE__c}</td>
            </tr>
            <tr>
                <td style="font-size: 8pt;">ADD:&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_C_Add__c}</td>
            </tr>
            <tr>
                <td style="font-size: 8pt;">电话(Tel):&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!contra.pdf_c_tel}</td>
            </tr>
            <tr>
                <td style="font-size: 8pt;">传真(Fax):&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!contra.pdf_c_fax}</td>
            </tr>
            <tr>
                <td style="font-size: 8pt;">CONTACT PERSON:&nbsp;</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;">收货人:&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!contra.pdf_c_consignee}</td>
            </tr>
            <tr>
                <td style="font-size: 8pt;">地址:&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!contra.pdf_c_address}</td>
            </tr>
            <tr>
                <td style="font-size: 8pt;">电话(Tel):&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!contra.pdf_c_tel}</td>
            </tr>
            <tr>
                <td style="font-size: 8pt;">联系人:&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!contra.pdf_c_contact}</td>
            </tr>
            </apex:outputPanel>
            <tr height="1px"><td height="1px">&nbsp;</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;">通知人:&nbsp;</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:&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_NOTIFY_PARTY__c}</td>
            </tr>
            <tr>
                <td style="font-size: 8pt;">地址:&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_N_Address__c}</td>
            </tr>
            <tr>
                <td style="font-size: 8pt;">ADD:&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_N_Add__c}</td>
            </tr>
            <tr>
                <td style="font-size: 8pt;">电话(Tel):&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_N_TEL__c}</td>
            </tr>
            <tr>
                <td style="font-size: 8pt;">传真(Fax):&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_N_FAX__c}</td>
            </tr>
            <tr>
                <td style="font-size: 8pt;">联系人:&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_N_CONTACT__c}</td>
            </tr>
            <tr>
                <td style="font-size: 8pt;">CONTACT PERSON:&nbsp;</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:&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_NOTIFY_PARTY__c}</td>
            </tr>
            <tr>
                <td style="font-size: 8pt;">ADD:&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_N_Add__c}</td>
            </tr>
            <tr>
                <td style="font-size: 8pt;">电话(Tel):&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_N_TEL__c}</td>
            </tr>
            <tr>
                <td style="font-size: 8pt;">传真(Fax):&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_N_FAX__c}</td>
            </tr>
            <tr>
                <td style="font-size: 8pt;">CONTACT PERSON:&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_N_CONTACTPERSON__c}</td>
            </tr>
            </apex:outputPanel>
            <tr><td height="1px">&nbsp;</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;">转运商 (英文):&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_Forwarder__c}</td>
            </tr>
            <tr>
                <td style="font-size: 8pt;">ADD:&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_F_Add__c}</td>
            </tr>
            <tr>
                <td style="font-size: 8pt;">电话(Tel):&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_F_TEL__c}</td>
            </tr>
            <tr>
                <td style="font-size: 8pt;">传真(Fax):&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_F_FAX__c}</td>
            </tr>
            <tr>
                <td style="font-size: 8pt;">联系人 (中文):&nbsp;</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;">中间商公司:&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!Opp.SubDealer__c}</td>
            </tr>
            <tr>
                <td style="font-size: 8pt;">公司名称:&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_F_Add__c}</td>
            </tr>
            <tr>
                <td style="font-size: 8pt;">地址:&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_F_TEL__c}</td>
            </tr>
            <tr>
                <td style="font-size: 8pt;">电话:&nbsp;</td>
                <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_F_FAX__c}</td>
            </tr>
            <tr>
                <td style="font-size: 8pt;">系统编号:&nbsp;</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 &amp; 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>总金额:&nbsp;</td>
                    <!-- <apex:outputPanel rendered="{!IF(Opp.ProductSegment__c = 'BS' && Opp.TradeType__c = 'Tax Exemption', 'true', 'false')}" layout="none"> -->
                    <td>US$&nbsp;
                        <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:&nbsp;</td>
                    <td>{!contra.order.Shipment_Term_D__c} <u>&nbsp;&nbsp;&nbsp;&nbsp;{!contra.order.PDF_Shipment_Term2_Text__c}&nbsp;&nbsp;&nbsp;&nbsp;</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:&nbsp;</td>
                    <td style="text-indent: 45px">US$&nbsp;
                        <apex:outputText value="{0,number,##0.00}">
                            <apex:param value="{!TrAndPre}"/>
                        </apex:outputText>
                    </td>
                </tr>
                <tr>
                    <td>总金额:&nbsp;</td>
                    <!-- <apex:outputPanel rendered="{!IF(Opp.ProductSegment__c = 'BS' && Opp.TradeType__c = 'Tax Exemption', 'true', 'false')}" layout="none"> -->
                    <td style="text-indent: 45px;">US$&nbsp;
                        <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:&nbsp;</td>
                    <td>{!contra.order.Shipment_Term_D__c} <u>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</u>{!contra.order.PDF_Shipment_Term2_Text__c}&nbsp;&nbsp;&nbsp;&nbsp; </td>
                </tr>
            </apex:outputPanel>
            <tr>
                <td>Say: U.S. DOLLARS:&nbsp;</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. 生产国别及制造厂商:&nbsp;{!contra.order.PDF_Bi_manufacturers__c}<br/>
                    2. COUNTRY OF ORIGIN OF GOODS AND MANUFACTURERS:&nbsp;{!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 = "4">
                    6.交货期:  <apex:outputField value="{!contra.order.DeliveryTimeText__c}" /><br/>
                    6.THE DELIVERY TIME: <apex:outputField value="{!contra.order.DeliveryTimeTextEn__c}" /><br/>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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. 装运口岸:&nbsp;{!contra.order.PDF_Sp_LOADING__c}<br/>
                    8.  PORT OF LOADING:&nbsp;{!contra.order.PDF_Sp_LOADING_E__c}<br/>
                </td>
            </tr>
            <tr>
                <td colspan = "3">
                    9. 目的口岸:&nbsp;{!contra.order.PDF_Sp_DestinationPort__c}<br/>
                    9.  PORT OF DESTINATION:&nbsp;{!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 = "3">
                    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 arising from the payment at the remitting bank 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 &amp; 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 &amp; 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 &amp; Exit Inspection &amp; 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/>
                        &nbsp;&nbsp;此合同由买卖双方签署正本 {!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;">
                        卖方:&nbsp;&nbsp;仪景通光学科技(上海)有限公司
                    </td>
                    <td style="vertical-align: top;">
                        买方:&nbsp;&nbsp;{!specialDeliveryAddress.Name}
                    </td>
                </tr>
                <tr>
                    <td style="vertical-align: top;">
                        THE SELLER:&nbsp;&nbsp;Evident (Shanghai) Co., Ltd
                    </td>
                    <td style="vertical-align: top;">
                        THE BUYER:&nbsp;&nbsp;{!specialDeliveryAddress.EnglishName__c}
                    </td>
                </tr>
                <tr>
                    <td>
                        For and on behalf of&nbsp;&nbsp;
                    </td>
                    <td>
                        For and on behalf of&nbsp;&nbsp;
                    </td>
                </tr>
                <tr>
                    <td>
                        [*]&nbsp;&nbsp;
                    </td>
                    <td>
                        [*]&nbsp;&nbsp;
                    </td>
                </tr>
                <tr><td colspan = "2" height="100px"></td></tr>
                <tr>
                    <td>
                        签名:&nbsp;&nbsp;
                    </td>
                    <td>
                        签名:&nbsp;&nbsp;
                    </td>
                </tr>
                <tr>
                    <!-- <apex:outputPanel rendered="{!IF((Opp.ProductSegment__c = 'NDT' || Opp.ProductSegment__c = 'ANI' ), 'false', 'true')}" layout="none">
        <div id="pdf-wrapper">
            <div class="pdf-page">
                <table style="border-style:none;float: left;">
                    <tr style="font-size: 8pt;">
                        <td>
                        Name: &nbsp;&nbsp;Mitsuyuki Shirakawa
                            <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>:&nbsp;</div>
                            <div>:&nbsp;</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>:&nbsp;</div>
                                <div>:&nbsp;</div>
                            </apex:outputPanel>
                        </td>
                        <td>
                            <div>&nbsp;{!contra.order.PDF_Order_No__c}</div>
                            <div>&nbsp;{!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>&nbsp;{!contra.order.PDF_I_Report__c}</div>
                                <div>&nbsp;{!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>:&nbsp;</div>
                                <div>:&nbsp;</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>:&nbsp;</div>
                                <div>:&nbsp;</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>&nbsp;{!contra.SignatureDate}</div>
                                <div>&nbsp;{!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>&nbsp;{!contra.order.PDF_SignaturePlace__c}</div>
                                <div>&nbsp;{!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;">买方:&nbsp;</td>
                        <td colspan="3" style="font-size: 8pt;">{!specialDeliveryAddress.Name}</td>
                    </tr>
                    <tr>
                        <td style="font-size: 8pt;">THE BUYER:&nbsp;</td>
                        <td colspan="3" style="font-size: 8pt;">{!specialDeliveryAddress.EnglishName__c}</td>
                    </tr>
                    <tr>
                        <td style="font-size: 8pt;">地址:&nbsp;</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:&nbsp;</td>
                            <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_B_Add__c}</td>
                        </tr>
                    </apex:outputPanel>
                    <apex:outputPanel rendered="{!IF((Opp.ProductSegment__c = 'NDT' || Opp.ProductSegment__c = 'ANI' ), 'true', 'true')}" layout="none"> -->
                    <td>
                    Name: &nbsp;&nbsp;Wei Liu
                    </td>
                    <!-- </apex:outputPanel> -->
                    <td>
                        Name: &nbsp;&nbsp;{!contra.order.PDF_Sign_Name__c}
                    </td>
                </tr>
                <tr>
                    <td>
                        Title: &nbsp;&nbsp;Division Manager
                    </td>
                    <td>
                        Title: &nbsp;&nbsp;{!contra.order.PDF_Sign_Title__c}
                    </td>
                </tr>
                <tr>
                    <td>
                        日期:&nbsp;&nbsp;
                    </td>
                    <td>
                        日期:&nbsp;&nbsp;
                    </td>
                </tr>
                <tr>
                    <td>
                        Signed on&nbsp;&nbsp;
                    </td>
                    <td>
                        Signed on&nbsp;&nbsp;
                    </td>
                </tr>
            </table>
                    <tr>
                        <td style="font-size: 8pt;">电话(Tel):&nbsp;</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):&nbsp;</td>
                            <td colspan="3" style="font-size: 8pt;">{!specialDeliveryAddress.Fax}</td>
                        </tr>
                    </apex:outputPanel>
                    <tr>
                        <td style="font-size: 8pt;">联系人:&nbsp;</td>
                        <td colspan="3" style="font-size: 8pt;">{!specialDeliveryContact.Name}</td>
                    </tr>
                    <tr>
                        <td style="font-size: 8pt;">CONTACT PERSON:&nbsp;</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:&nbsp;</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;">用户属性:&nbsp;</td>
                            <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_B_Attri__c}</td>
                        </tr>
                        <tr>
                            <td style="font-size: 8pt;">用户产品:&nbsp;</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;">市场:&nbsp;</td>
                            <td colspan="3" style="font-size: 8pt;">{!contra.account.Sub_Use__c}</td>
                        </tr>
                    </apex:outputPanel>
                    <tr>
                        <td height="1px">&nbsp;</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;">卖方:&nbsp;</td>
                            <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_SELLER__c}</td>
                        </tr>
                        <tr>
                            <td style="font-size: 8pt;">THE SELLER:&nbsp;</td>
                            <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_THE_SELLER__c}</td>
                        </tr>
                        <tr>
                            <td style="font-size: 8pt;">地址:&nbsp;</td>
                            <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_S_Adds__c}</td>
                        </tr>
                        <tr>
                            <td style="font-size: 8pt;">ADD:&nbsp;</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;">卖方:&nbsp;</td>
                            <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_SELLER__c}</td>
                        </tr>
                        <tr>
                            <td style="font-size: 8pt;">地址:&nbsp;</td>
                            <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_S_Adds__c}</td>
                        </tr>
                        <tr>
                            <td style="font-size: 8pt;">电话 (TEL):&nbsp;</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;">卖方:&nbsp;</td>
                            <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_SELLER__c}</td>
                        </tr>
                        <tr>
                            <td style="font-size: 8pt;">THE SELLER:&nbsp;</td>
                            <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_THE_SELLER__c}</td>
                        </tr>
                        <tr>
                            <td style="font-size: 8pt;">地址:&nbsp;</td>
                            <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_S_Adds__c}</td>
                        </tr>
                        <tr>
                            <td style="font-size: 8pt;">ADD:&nbsp;</td>
                            <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_S_Address__c}</td>
                        </tr>
                        <tr>
                            <td style="font-size: 8pt;">电话(Tel):&nbsp;</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):&nbsp;</td>
                            <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_S_FAX__c}</td>
                        </tr>
                        <tr>
                            <td style="font-size: 8pt;">Bank Name:&nbsp;</td>
                            <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_S_Bank_Name__c}</td>
                        </tr>
                        <tr>
                            <td style="font-size: 8pt;">Branch:&nbsp;</td>
                            <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_S_Branch__c}</td>
                        </tr>
                        <tr>
                            <td style="font-size: 8pt;">Address:&nbsp;</td>
                            <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_S_Bank_Address__c}</td>
                        </tr>
                        <!-- <tr>
                        <td style="font-size: 8pt;">Address:&nbsp;</td>
                        <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_S_Address__c}</td>
                    </tr> -->
                        <tr>
                            <td style="font-size: 8pt;">Account no:&nbsp;</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:&nbsp;</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:&nbsp;</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">&nbsp;</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;">&nbsp;</td>
                    </tr> -->
                        <tr>
                            <td style="font-size: 8pt;">收货人:&nbsp;</td>
                            <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_C_Consignee__c}</td>
                        </tr>
                        <tr>
                            <td style="font-size: 8pt;">THE CONSIGNEE:&nbsp;</td>
                            <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_C_THECONSIGNE__c}</td>
                        </tr>
                        <tr>
                            <td style="font-size: 8pt;">地址:&nbsp;</td>
                            <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_C_Address__c}</td>
                        </tr>
                        <tr>
                            <td style="font-size: 8pt;">ADD:&nbsp;</td>
                            <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_C_Add__c}</td>
                        </tr>
                        <tr>
                            <td style="font-size: 8pt;">电话(Tel):&nbsp;</td>
                            <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_C_TEL__c}</td>
                        </tr>
                        <tr>
                            <td style="font-size: 8pt;">传真(Fax):&nbsp;</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;">联系人:&nbsp;</td>
                            <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_C_CONTACT__c}</td>
                        </tr>
                        <tr>
                            <td style="font-size: 8pt;">CONTACT PERSON:&nbsp;</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:&nbsp;</td>
                        <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_C_THECONSIGNE__c}</td>
                    </tr>
                    <tr>
                        <td style="font-size: 8pt;">ADD:&nbsp;</td>
                        <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_C_Add__c}</td>
                    </tr>
                    <tr>
                        <td style="font-size: 8pt;">电话(Tel):&nbsp;</td>
                        <td colspan = "3" style="font-size: 8pt;">{!contra.pdf_c_tel}</td>
                    </tr>
                    <tr>
                        <td style="font-size: 8pt;">传真(Fax):&nbsp;</td>
                        <td colspan = "3" style="font-size: 8pt;">{!contra.pdf_c_fax}</td>
                    </tr>
                    <tr>
                        <td style="font-size: 8pt;">CONTACT PERSON:&nbsp;</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;">收货人:&nbsp;</td>
                            <td colspan="3" style="font-size: 8pt;">{!contra.pdf_c_consignee}</td>
                        </tr>
                        <tr>
                            <td style="font-size: 8pt;">地址:&nbsp;</td>
                            <td colspan="3" style="font-size: 8pt;">{!contra.pdf_c_address}</td>
                        </tr>
                        <tr>
                            <td style="font-size: 8pt;">电话(Tel):&nbsp;</td>
                            <td colspan="3" style="font-size: 8pt;">{!contra.pdf_c_tel}</td>
                        </tr>
                        <tr>
                            <td style="font-size: 8pt;">联系人:&nbsp;</td>
                            <td colspan="3" style="font-size: 8pt;">{!contra.pdf_c_contact}</td>
                        </tr>
                    </apex:outputPanel>
                    <tr height="1px">
                        <td height="1px">&nbsp;</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;">通知人:&nbsp;</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:&nbsp;</td>
                            <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_NOTIFY_PARTY__c}</td>
                        </tr>
                        <tr>
                            <td style="font-size: 8pt;">地址:&nbsp;</td>
                            <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_N_Address__c}</td>
                        </tr>
                        <tr>
                            <td style="font-size: 8pt;">ADD:&nbsp;</td>
                            <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_N_Add__c}</td>
                        </tr>
                        <tr>
                            <td style="font-size: 8pt;">电话(Tel):&nbsp;</td>
                            <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_N_TEL__c}</td>
                        </tr>
                        <tr>
                            <td style="font-size: 8pt;">传真(Fax):&nbsp;</td>
                            <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_N_FAX__c}</td>
                        </tr>
                        <tr>
                            <td style="font-size: 8pt;">联系人:&nbsp;</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:&nbsp;</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:&nbsp;</td>
                            <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_NOTIFY_PARTY__c}</td>
                        </tr>
                        <tr>
                            <td style="font-size: 8pt;">ADD:&nbsp;</td>
                            <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_N_Add__c}</td>
                        </tr>
                        <tr>
                            <td style="font-size: 8pt;">电话(Tel):&nbsp;</td>
                            <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_N_TEL__c}</td>
                        </tr>
                        <tr>
                            <td style="font-size: 8pt;">传真(Fax):&nbsp;</td>
                            <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_N_FAX__c}</td>
                        </tr>
                        <tr>
                            <td style="font-size: 8pt;">CONTACT PERSON:&nbsp;</td>
                            <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_N_CONTACTPERSON__c}</td>
                        </tr>
                    </apex:outputPanel>
                    <tr>
                        <td height="1px">&nbsp;</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;">转运商 (英文):&nbsp;</td>
                            <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_Forwarder__c}</td>
                        </tr>
                        <tr>
                            <td style="font-size: 8pt;">ADD:&nbsp;</td>
                            <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_F_Add__c}</td>
                        </tr>
                        <tr>
                            <td style="font-size: 8pt;">电话(Tel):&nbsp;</td>
                            <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_F_TEL__c}</td>
                        </tr>
                        <tr>
                            <td style="font-size: 8pt;">传真(Fax):&nbsp;</td>
                            <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_F_FAX__c}</td>
                        </tr>
                        <tr>
                            <td style="font-size: 8pt;">联系人 (中文):&nbsp;</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;">中间商公司:&nbsp;</td>
                            <td colspan="3" style="font-size: 8pt;">{!Opp.SubDealer__c}</td>
                        </tr>
                        <tr>
                            <td style="font-size: 8pt;">公司名称:&nbsp;</td>
                            <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_F_Add__c}</td>
                        </tr>
                        <tr>
                            <td style="font-size: 8pt;">地址:&nbsp;</td>
                            <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_F_TEL__c}</td>
                        </tr>
                        <tr>
                            <td style="font-size: 8pt;">电话:&nbsp;</td>
                            <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_F_FAX__c}</td>
                        </tr>
                        <tr>
                            <td style="font-size: 8pt;">系统编号:&nbsp;</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;"/>
                <div style="page-break-after: always;" />
            </apex:outputPanel>
            <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">
            <div class="pdf-page">
                <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>
                            <!-- <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> -->
                            <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>
                       <!--  <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> -->
                            <td width="5%" style="text-align: center;">Item</td>
                            <td style="text-align: center;">Goods &amp; 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 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>
        
         <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">
                <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>总金额:&nbsp;</td>
                            <!-- <apex:outputPanel rendered="{!IF(Opp.ProductSegment__c = 'BS' && Opp.TradeType__c = 'Tax Exemption', 'true', 'false')}" layout="none"> -->
                            <td>US$&nbsp;
                                <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:&nbsp;</td>
                            <td>{!contra.order.Shipment_Term_D__c}
                                <u>&nbsp;&nbsp;&nbsp;&nbsp;{!contra.order.PDF_Shipment_Term2_Text__c}&nbsp;&nbsp;&nbsp;&nbsp;</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:&nbsp;</td>
                            <td style="text-indent: 45px">US$&nbsp;
                                <apex:outputText value="{0,number,##0.00}">
                                    <apex:param value="{!TrAndPre}" />
                                </apex:outputText>
                            </td>
                        </tr>
                        <tr>
                            <td>总金额:&nbsp;</td>
                            <!-- <apex:outputPanel rendered="{!IF(Opp.ProductSegment__c = 'BS' && Opp.TradeType__c = 'Tax Exemption', 'true', 'false')}" layout="none"> -->
                            <td style="text-indent: 45px;">US$&nbsp;
                                <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:&nbsp;</td>
                            <td>{!contra.order.Shipment_Term_D__c}
                                <u>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</u>{!contra.order.PDF_Shipment_Term2_Text__c}&nbsp;&nbsp;&nbsp;&nbsp;
                                </td>
                        </tr>
                    </apex:outputPanel>
                    <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>Say: U.S. DOLLARS:&nbsp;</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>
                </apex:repeat>
            </table>
        </apex:outputPanel>
                    <tr>
                        <td colspan="3">
                            2. 生产国别及制造厂商:&nbsp;{!contra.order.PDF_Bi_manufacturers__c}
                            <br/> 2. COUNTRY OF ORIGIN OF GOODS AND MANUFACTURERS:&nbsp;{!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="4">
                            6.交货期:
                            <apex:outputField value="{!contra.order.DeliveryTimeText__c}" />
                            <br/> 6.THE DELIVERY TIME:
                            <apex:outputField value="{!contra.order.DeliveryTimeTextEn__c}" />
                            <br/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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. 装运口岸:&nbsp;{!contra.order.PDF_Sp_LOADING__c}
                            <br/> 8. PORT OF LOADING:&nbsp;{!contra.order.PDF_Sp_LOADING_E__c}
                            <br/>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3">
                            9. 目的口岸:&nbsp;{!contra.order.PDF_Sp_DestinationPort__c}
                            <br/> 9. PORT OF DESTINATION:&nbsp;{!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="3">
                            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 arising from the payment at the remitting bank 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 &amp; 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 &amp; 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 &amp; Exit Inspection &amp; 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/> &nbsp;&nbsp;此合同由买卖双方签署正本 {!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;">
                            卖方:&nbsp;&nbsp;仪景通光学科技(上海)有限公司
                        </td>
                        <td style="vertical-align: top;">
                            买方:&nbsp;&nbsp;{!specialDeliveryAddress.Name}
                        </td>
                    </tr>
                    <tr>
                        <td style="vertical-align: top;">
                            THE SELLER:&nbsp;&nbsp;Evident (Shanghai) Co., Ltd
                        </td>
                        <td style="vertical-align: top;">
                            THE BUYER:&nbsp;&nbsp;{!specialDeliveryAddress.EnglishName__c}
                        </td>
                    </tr>
                    <tr>
                        <td>
                            For and on behalf of&nbsp;&nbsp;
                        </td>
                        <td>
                            For and on behalf of&nbsp;&nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            [*]&nbsp;&nbsp;
                        </td>
                        <td>
                            [*]&nbsp;&nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" height="100px"></td>
                    </tr>
                    <tr>
                        <td>
                            签名:&nbsp;&nbsp;
                        </td>
                        <td>
                            签名:&nbsp;&nbsp;
                        </td>
                    </tr>
                    <tr>
                        <!-- <apex:outputPanel rendered="{!IF((Opp.ProductSegment__c = 'NDT' || Opp.ProductSegment__c = 'ANI' ), 'false', 'true')}" layout="none">
                                <td>
                                Name: &nbsp;&nbsp;Mitsuyuki Shirakawa
                                </td>
                            </apex:outputPanel>
                            <apex:outputPanel rendered="{!IF((Opp.ProductSegment__c = 'NDT' || Opp.ProductSegment__c = 'ANI' ), 'true', 'true')}" layout="none"> -->
                        <td>
                            Name: &nbsp;&nbsp;Wei Liu
                        </td>
                        <!-- </apex:outputPanel> -->
                        <td>
                            Name: &nbsp;&nbsp;{!contra.order.PDF_Sign_Name__c}
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Title: &nbsp;&nbsp;Division Manager
                        </td>
                        <td>
                            Title: &nbsp;&nbsp;
                            <span id="PDF_Sign_Title__c">{!contra.order.PDF_Sign_Title__c}</span>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            日期:&nbsp;&nbsp;
                        </td>
                        <td>
                            日期:&nbsp;&nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Signed on&nbsp;&nbsp;
                        </td>
                        <td>
                            Signed on&nbsp;&nbsp;
                        </td>
                    </tr>
                </table>
            </div>
            <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%" 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>
            </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;
                    }
                }
    </body>
                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]
                    }
                }
            }
            //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();
                }
            }
    </script>
    <!-- 20220221 PI改造 by 徐亮 end  -->
</html>
</apex:page>
force-app/main/default/pages/OrderPdf2.page
@@ -1,4 +1,4 @@
<apex:page Controller="OrderPdf2Controller" showHeader="false" sidebar="false" id="allPage" action="{!init}" renderAs="pdf" > <!-- renderAs="pdf" -->
<apex:page Controller="OrderPdf2Controller" showHeader="false" sidebar="false" id="allPage" action="{!init}" > <!-- renderAs="pdf" -->
<head>
    <style>
        @page {
@@ -15,9 +15,30 @@
        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;">
<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%">
        <tr>
            <td style="text-align: center; font-size: 16pt;">完税订货单</td>
@@ -151,7 +172,7 @@
        </tr>
        <tr>
            <td style="text-align: right;">联系地址:</td>
            <td style="text-align: left;" colspan="5">{!header.delivery_address}</td>
            <td style="text-align: left;" colspan="5" id="delivery_address">{!header.delivery_address}</td>
        </tr>
        <tr>
            <td style="text-align: right;">城市:</td>
@@ -161,11 +182,11 @@
        </tr>
        <tr>
            <td style="text-align: right;">收货人姓名:</td>
            <td style="text-align: left;">{!header.delivery_user}</td>
            <td style="text-align: left;" id="delivery_user">{!header.delivery_user}</td>
            <td style="text-align: right;">固话:</td>
            <td style="text-align: left;">{!header.delivery_phone}</td>
            <td style="text-align: left;" id="delivery_phone">{!header.delivery_phone}</td>
            <td style="text-align: right;">手机:</td>
            <td style="text-align: left;">{!header.delivery_tel}</td>
            <td style="text-align: left;" id="delivery_tel">{!header.delivery_tel}</td>
        </tr>
    </table>
    <table style="border:solid 1px black" width="100%">
@@ -193,7 +214,7 @@
        </tr>
        <tr>
            <td style="text-align: right;">联系地址:</td>
            <td style="text-align: left;" colspan="5">{!header.user_address}</td>
            <td style="text-align: left;" colspan="5" id="user_address">{!header.user_address}</td>
        </tr>
        <tr>
            <td style="text-align: right;">城市:</td>
@@ -203,11 +224,11 @@
        </tr>
        <tr>
            <td style="text-align: right;">用户姓名:</td>
            <td style="text-align: left;">{!header.user_name2}</td>
            <td style="text-align: left;" id="user_name2">{!header.user_name2}</td>
            <td style="text-align: right;">固话:</td>
            <td style="text-align: left;">{!header.user_phone}</td>
            <td style="text-align: left;" id="user_phone">{!header.user_phone}</td>
            <td style="text-align: right;">手机:</td>
            <td style="text-align: left;">{!header.user_tel}</td>
            <td style="text-align: left;" id="user_tel">{!header.user_tel}</td>
        </tr>
        <apex:outputPanel layout="none" rendered="{!IF(productSegment == 'IE', true, false)}">
        <tr>
@@ -533,5 +554,134 @@
            <td style="text-align: left;">&nbsp;</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>
force-app/main/default/pages/OrderPdf3.page
@@ -16,13 +16,33 @@
        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; }
    </style>
        /* 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  -->
</head>
<body style="font-family: Arial Unicode MS; page-break-inside: auto; font-size: 8pt;">
    <table border="0" width="100%">
<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;">
        <apex:outputPanel layout="none" rendered="{!IF(productSegment == 'NDT', true, false)}">
            <tr>
                <td style="text-align: center; font-size: 16pt;">SSBG-NDT内贸订货单</td>
@@ -128,11 +148,11 @@
        </tr>
        <tr>
            <td style="text-align: right;">收货人姓名:</td>
            <td style="text-align: left;">{!header.delivery_user}</td>
            <td style="text-align: left;" id="delivery_user">{!header.delivery_user}</td>
            <td style="text-align: right;">固话:</td>
            <td style="text-align: left;">{!header.delivery_phone}</td>
            <td style="text-align: left;" id="delivery_phone">{!header.delivery_phone}</td>
            <td style="text-align: right;">手机:</td>
            <td style="text-align: left;">{!header.delivery_tel}</td>
            <td style="text-align: left;" id="delivery_tel">{!header.delivery_tel}</td>
        </tr>
    </table>
    <table style="border:solid 1px black" width="100%">
@@ -160,7 +180,7 @@
        </tr>
        <tr>
            <td style="text-align: right;">联系地址:</td>
            <td style="text-align: left;" colspan="5">{!header.user_address}</td>
            <td style="text-align: left;" colspan="5" id="user_address">{!header.user_address}</td>
        </tr>
        <tr>
            <td style="text-align: right;">城市:</td>
@@ -170,11 +190,11 @@
        </tr>
        <tr>
            <td style="text-align: right;">用户姓名:</td>
            <td style="text-align: left;">{!header.user_name2}</td>
            <td style="text-align: left;" id="user_name2">{!header.user_name2}</td>
            <td style="text-align: right;">固话:</td>
            <td style="text-align: left;">{!header.user_phone}</td>
            <td style="text-align: left;" id="user_phone">{!header.user_phone}</td>
            <td style="text-align: right;">手机:</td>
            <td style="text-align: left;">{!header.user_tel}</td>
            <td style="text-align: left;" id="user_tel">{!header.user_tel}</td>
        </tr>
        <tr>
            <td style="text-align: right;">Sub Use:</td>
@@ -312,8 +332,136 @@
            
        </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  -->
force-app/main/default/pages/QuotePDF.page
@@ -1,4 +1,5 @@
<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}" >
    <!-- <apex:page Controller="QuotePDFController" showHeader="false" sidebar="false" id="allPage" action="{!init}" renderAs="pdf"> -->
<head>
    <style>
        @page {
@@ -8,156 +9,348 @@
    </style>
</head>
<body style="font-family: Arial Unicode MS; page-break-inside: auto">
    <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}&nbsp;&nbsp;&nbsp;&nbsp;{!$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}&nbsp;&nbsp;&nbsp;&nbsp;{!$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;">&nbsp;</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}&nbsp;&nbsp;&nbsp;&nbsp;{!$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>
    <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>&nbsp;&nbsp;&nbsp;&nbsp;{!$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}&nbsp;&nbsp;&nbsp;&nbsp;{!$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;">&nbsp;</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>&nbsp;&nbsp;&nbsp;&nbsp;{!$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" />
        <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: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>
        </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/> -->
    <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>
    </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)}"/>
<!-- 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>
force-app/main/default/pages/QuotesPDF.page
@@ -1,4 +1,4 @@
<apex:page controller="QuotesPDFController" showHeader="false" sidebar="false"  id="allPage" action="{!init}" renderAs="pdf">
<apex:page controller="QuotesPDFController" showHeader="false" sidebar="false"  id="allPage" action="{!init}" >
<!-- renderAs="pdf" -->
      <html>
@@ -8,11 +8,30 @@
                        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%"/>
@@ -54,14 +73,14 @@
                              <td>
                                  <!-- <c:PDFWbr targetStr="{!conName}"/><br/>
                                  <c:PDFWbr targetStr="{!quo.COMPANYName__c}"/><br/> -->
                                  <p style="line-height:15px;"><apex:outputField value="{!quo.BILL_TO__c}"/><br/>
                                  <p style="line-height:15px;"><apex:outputField id="BILL_TO__c" 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 value="{!quo.SHIP_TO__c}"/><br/>
                                  <p style="line-height:15px;"><apex:outputField id="SHIP_TO__c" value="{!quo.SHIP_TO__c}"/><br/>
                                  CHINA
                                  </p>
                              </td>
@@ -108,14 +127,14 @@
                        </apex:outputPanel>
                        <apex:outputPanel layout="none" rendered="{!IF(conName != null, true, false)}">
                              <td style="border-bottom-width: 0;">{!conName}&nbsp;</td>
                              <td style="border-bottom-width: 0;" id="conName">{!conName}&nbsp;</td>
                        </apex:outputPanel>
                        <apex:outputPanel layout="none" rendered="{!IF(conName != null, false, true)}">
                              <td style="border-bottom-width: 0;">&nbsp;</td>
                        </apex:outputPanel>
                        <apex:outputPanel layout="none" rendered="{!IF(quo.CONTACT_PHONE__c != null, true, false)}">
                              <td style="border-bottom-width: 0;">{!quo.CONTACT_PHONE__c}&nbsp;</td>
                              <td style="border-bottom-width: 0;" id="CONTACT_PHONE__c">{!quo.CONTACT_PHONE__c}&nbsp;</td>
                        </apex:outputPanel>
                        <apex:outputPanel layout="none" rendered="{!IF(quo.CONTACT_PHONE__c != null, false, true)}">
                              <td style="border-bottom-width: 0;">&nbsp;</td>
@@ -298,8 +317,132 @@
                              </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>
force-app/main/default/pages/SWOPage.page
@@ -351,7 +351,8 @@
                    "sfRecordId":swoId,
                    "isSuccess":1
            }), function(result){
                let id  = document.getElementById('Page:mainForm:frontSwoId').value
                //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);
force-app/main/default/pages/SearchMemberPage.page
@@ -4,15 +4,132 @@
    <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();
            DoSearch(searchByName,searchByAccount);
            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,[]);
            }
        }
        function saveJS(){
            blockme();
@@ -26,8 +143,8 @@
            }
            var lineNum = j$(escapeVfId("lineNum")).value();
            var memberId = j$(escapeVfId("memberId")).value();
            var memberName = j$(escapeVfId("memberName")).value();
            var memberEmail = j$(escapeVfId("memberEmail")).value();
            var memberName = aws_data[j$(escapeVfId("aws_data_id")).value()].lastName;
            var memberEmail = aws_data[j$(escapeVfId("aws_data_id")).value()].email;
            window.opener.refreshPage(lineNum,memberId,memberName,memberEmail); 
            window.close();
        }
@@ -47,23 +164,28 @@
                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="unblockUI();">
             <apex:actionFunction action="{!SearchMember}" name="DoSearch" reRender="result" oncomplete="DecryptAll(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="unblockUI();refreshPage();closeJS();">
             <apex:actionFunction action="{!save}" name="save" reRender="allData,message1" oncomplete="DecryptAll(()=>{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>
@@ -83,7 +205,7 @@
                    <tr>
                         <th style="text-align:center;"><apex:commandButton value="Search" onclick="doSearchJS();return false;" />&nbsp;&nbsp;<apex:commandButton value="Save" onclick="saveJS();return false;"/></th>
                         <th id="nameLable" style="text-align:center;">Name:<input id="searchByName"  type="text" value="{!searchByName}" /></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 style="text-align:center;"><div id="accountLable">Account:<input id="searchByAccount"  type="text" value="{!searchByAccount}" /></div></th>
                         
@@ -117,12 +239,22 @@
                              </apex:outputPanel> -->
                         </tr>
                         <apex:repeat value="{!lineList}" var="line">
                             <tr>
                             <tr class="encrypt">
                                 <td style="text-align:right;">
                                     <apex:inputCheckbox id="checkbox" value="{!line.check}" />
                                 </td>
                                 <td><apex:outputText value="{!line.name}"></apex:outputText></td>
                                 <td><apex:outputText value="{!line.email}"></apex:outputText></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.account}"></apex:outputText></td>
                             </tr>
                         </apex:repeat>
force-app/main/default/pages/SendEmail.page
@@ -6,6 +6,7 @@
<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"> 
@@ -27,6 +28,20 @@
        }
    </style>
    <script>
        let isBlocking = false;
        function b(){
            if (!isBlocking) {
                isBlocking = true;
                blockme();
            }
        }
        function ub(){
            if (isBlocking) {
                isBlocking = false;
                unblockUI();
            }
        }
        function formSubmit(){
            testFile();
@@ -46,7 +61,9 @@
            var memberEmailId = "memberEmail"+lineNum;
            j$(escapeVfId(memberNameId)).attr("value",memberName);
            j$(escapeVfId(memberEmailId)).attr("value",memberEmail);*/
            addMemberData(lineNum,memberId,memberName,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);
        }
        function statusChabge(linenumNum,type){
            var toId = "Page:messageForm:lineDataList:"+linenumNum+":"+"to";
@@ -92,6 +109,7 @@
        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"));
@@ -102,72 +120,399 @@
        //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 + '过大无法上传');
        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);
                             }
                           });
                    }
                }
                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);
                            }
                        });
                }
                }
        }
        // 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);
                            }
                        })
                        //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;
                        }
                    }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]);
                        })
                    }
                },staticResourceMailMerge.token);
            }
        })
    </script>
    <div style="width : 100%;">
    <div style="width : 70%; margin: auto;">
@@ -189,6 +534,10 @@
                <!-- <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>
@@ -202,7 +551,7 @@
                    </tr>
                    <tr>
                        <th style="width: 20%;text-align:center;">FROM:</th>
                        <td><apex:outputText value="{!mail.FROM__c}" style="width: 40%"/></td>
                        <td><apex:outputText styleClass="FROM__c" value="{!mail.FROM__c}" style="width: 40%"/></td>
                    </tr>
                </table>
            </div>
@@ -221,17 +570,18 @@
                    </thead>
                    <tbody id="memberBody">
                        <apex:repeat id="lineDataList" value="{!memberLineDatas}" var="lineData">
                            <tr style="text-align:center;">
                            <tr line-id="{!lineData.lineNum}" style="text-align:center;">
                                <td>
                                <input type="hidden" id="memberName{!lineData.lineNum}" value="{!lineData.name}" />
                                <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: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: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}">
                                        
@@ -242,7 +592,8 @@
                    </tbody>
                    <thead>
                        <tr style="text-align:center;">
                            <td><apex:commandButton id="addLine" onclick="blockme();" action="{!addLine}" reRender="messageForm" value="ADD Member" oncomplete="unblockUI();" disabled="{!isOnClick}"></apex:commandButton></td>
                            <!-- <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>
                        </tr>
                    </thead>
                </table>
@@ -266,11 +617,11 @@
                    </tr> -->
                    <tr>
                        <th style="text-align:center;width: 20%;">SUBJECT:</th>
                        <td><apex:inputField value="{!mail.SUBJECT__c}" style="width: 40%"/></td>
                        <td><apex:inputField styleClass="SUBJECT__c" value="{!mail.SUBJECT__c}" style="width: 40%"/></td>
                    </tr>
                    <tr>
                        <th style="text-align:center;width: 20%;">MESSAGE:</th>
                        <td><apex:inputField style="height: 200px;width: 60%" value="{!mail.MESSAGE__c}"/></td>
                        <td><apex:inputField styleClass="MESSAGE__c" style="height: 200px;width: 60%" value="{!mail.MESSAGE__c}"/></td>
                    </tr>
                </table>
            </div>
@@ -284,57 +635,70 @@
                    <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="uploadFileS();return false;" value="图片批量上传" disabled="{!isOnClick}"/>
                                 <apex:commandButton onclick="openFile();return false;" value="图片批量上传" disabled="{!isOnClick}"/>
                            </apex:panelGroup>
                        </td>
                    </tr>
                </table>
            </div>
            <div style="margin-left: 5px;">
            <apex:outputPanel rendered="{!IF(openType == 'View', true, false)}" 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="{!attachmentList}" var="attachment">
                    <apex:repeat id="attachmentList" value="{!newAttachmentList}" var="item">
                        <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.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><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>
                        </tr>
                    </apex:repeat>
                </table>
            </div>
            </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 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()" 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: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:outputPanel>
                <apex:commandButton id="test" action="{!SendEmail}" value="Send   Mail" onclick="blockme();"  oncomplete="unblockUI();" reRender="messageForm" style="width: 99%;height: 5%" disabled="{!isOnClick}">
                <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: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="saveAttachment(); return false;" style="width: 20%; margin: 20px 10px 0px 10px" />
                    <apex:commandButton value="确认" onclick="uploadFile(); 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>
manifest/packagePIPL.xml
File was deleted
manifest/packageTriggerController.xml
@@ -7,6 +7,7 @@
        <members>SWOTrigger</members>
        <members>UserFaultInfoTrigger</members>
        <members>loanerAppStatusUp</members>
        <members>BusinessActivityTrigger</members>
        <name>ApexTrigger</name>
    </types>
    <version>52.0</version>
manifest/packageUpdatePIPLCode.xml
New file
@@ -0,0 +1,89 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>NewCrossHighOpportunity</members>
        <members>NewCrossRegionalSalesOpportunity</members>
        <members>SWOPageRead</members>
        <members>QuotesPDF</members>
        <members>SWOPage</members>
        <members>SendEmail</members>
        <members>NEWCreateSWOQuoteReadOnly</members>
        <members>NEWCreateSWOQuote</members>
        <members>SearchMemberPage</members>
        <members>TSRepair</members>
        <members>NewHighProductsOpp</members>
        <members>NewReplacementOpportunity</members>
        <members>OrderPdf3</members>
        <members>NewLoanerApplication</members>
        <members>NewLoanerUser</members>
        <members>LoanerPortionReturn</members>
        <members>DeliveryConfirmPDF</members>
        <members>NewOpportunity</members>
        <members>OrderPdf2</members>
        <members>OrderPDF</members>
        <members>QuotePDF</members>
        <name>ApexPage</name>
    </types>
    <types>
        <members>TydelikeAccControllerTest</members>
        <members>TydelikeConControllerTest</members>
        <members>TydelikeAccController</members>
        <members>TydelikeConController</members>
        <members>IENewOpportunityControllerTest</members>
        <members>IENewOpportunityController</members>
        <members>NewCrossRegionalControllerText</members>
        <members>NewCrossHighOpportunityController</members>
        <members>NewCrossRegionalSalesController</members>
        <members>CustContController</members>
        <members>SearchMemberPageControllerTest</members>
        <members>QuotesPDFControllerTest</members>
        <members>SWOControllerTest</members>
        <members>SendEmailControllerTest</members>
        <members>NEWCreateSWOQuoteControllerTest</members>
        <members>QuotesPDFController</members>
        <members>SWOController</members>
        <members>SendEmailController</members>
        <members>NEWCreateSWOQuoteController</members>
        <members>SearchMemberPageController</members>
        <members>SearchManagementControllerTest</members>
        <members>TSRepairControllerTest</members>
        <members>TSRepairController</members>
        <members>NewHighProductsOppControllerTest</members>
        <members>NewHighProductsOppController</members>
        <members>NewReplacementOpportunityController</members>
        <members>SBG203RestTest</members>
        <members>SBG203Rest</members>
        <members>SBG027Controller</members>
        <members>DeliveryConfirmPDFControllerTest</members>
        <members>loanerAppTriggerHandlerTest</members>
        <members>NewLoanerUserControllerTest</members>
        <members>loanerAppTriggerHandler</members>
        <members>DeliveryConfirmPDFController</members>
        <members>LoanerLendDeliverController</members>
        <members>LoanerPortionReturnController</members>
        <members>NewLoanerApplicationController</members>
        <members>NewLoanerApplicationControllerTest</members>
        <members>NewLoanerUserController</members>
        <members>NewOpportunityControllerTest</members>
        <members>NewOpportunityController</members>
        <members>QuotePDFController</members>
        <members>QuotePDFControllerTest</members>
        <members>OrderPdfController</members>
        <members>OrderPdf2ControllerTest</members>
        <members>OrderPdf2Controller</members>
        <members>OrderPdfControllerTest</members>
        <members>SBG027TriggerHandleTest</members>
        <members>SBG007TriggerHandler</members>
        <members>SBG007TriggerHandlerTest</members>
        <members>SBG001TriggerHandlerTest</members>
        <members>SBG001TriggerHandler</members>
        <members>NFMUtil</members>
        <members>OrderTriggerTest</members>
        <members>OrderTriggerHandler</members>
        <members>OpportunityTriggerHandler</members>
        <members>ContactTriggerHandler</members>
        <members>OpportunityTriggerTest</members>
        <name>ApexClass</name>
    </types>
    <version>52.0</version>
</Package>