From 5835379ec30b1667c4e522db9d294c9b7bb8633a Mon Sep 17 00:00:00 2001
From: buli <137736985@qq.com>
Date: 星期二, 26 四月 2022 12:00:31 +0800
Subject: [PATCH] SSBG Back up

---
 force-app/main/default/pages/NewLoanerApplication.page                |    2 
 force-app/main/default/classes/NewOpportunityControllerTest.cls       |    5 
 force-app/main/default/classes/LoanerPortionReturnController.cls      |    5 
 force-app/main/default/pages/SearchMemberPage.page                    |  152 +
 force-app/main/default/pages/DeliveryConfirmPDF.page                  |  191 +
 force-app/main/default/classes/NewHighProductsOppController.cls       |   12 
 force-app/main/default/pages/NewCrossRegionalSalesOpportunity.page    |  177 +
 force-app/main/default/pages/OrderPdf3.page                           |  172 +
 force-app/main/default/classes/ContactTriggerHandler.cls              |   98 
 force-app/main/default/classes/loanerAppTriggerHandlerTest.cls        |   32 
 force-app/main/default/classes/DeliveryConfirmPDFControllerTest.cls   |    6 
 force-app/main/default/pages/NEWCreateSWOQuoteReadOnly.page           |    2 
 force-app/main/default/classes/NewLoanerApplicationControllerTest.cls |    6 
 force-app/main/default/classes/SWOController.cls                      |    4 
 force-app/main/default/pages/NewCrossHighOpportunity.page             |  155 +
 force-app/main/default/classes/SBG007TriggerHandlerTest.cls           |   15 
 force-app/main/default/classes/NewCrossRegionalControllerText.cls     |   15 
 force-app/main/default/pages/OrderPdf2.page                           |  170 +
 force-app/main/default/pages/SendEmail.page                           |  552 ++++
 force-app/main/default/classes/NewCrossRegionalSalesController.cls    |   18 
 force-app/main/default/classes/OrderTriggerTest.cls                   |   23 
 manifest/packageUpdatePIPLCode.xml                                    |   89 
 force-app/main/default/classes/SWOControllerTest.cls                  |    8 
 force-app/main/default/classes/OrderTriggerHandler.cls                |    2 
 force-app/main/default/pages/QuotesPDF.page                           |  157 +
 force-app/main/default/classes/DeliveryConfirmPDFController.cls       |    6 
 force-app/main/default/classes/SearchMemberPageController.cls         |   27 
 force-app/main/default/classes/SendEmailControllerTest.cls            |    6 
 force-app/main/default/classes/QuotesPDFControllerTest.cls            |    6 
 force-app/main/default/classes/SendEmailController.cls                |   52 
 force-app/main/default/pages/SWOPage.page                             |    3 
 force-app/main/default/classes/TSRepairControllerTest.cls             |    5 
 force-app/main/default/pages/LoanerPortionReturn.page                 |   74 
 force-app/main/default/pages/NewHighProductsOpp.page                  |  169 +
 force-app/main/default/classes/SBG027TriggerHandleTest.cls            |    3 
 force-app/main/default/classes/loanerAppTriggerHandler.cls            |   13 
 force-app/main/default/classes/OpportunityTriggerHandler.cls          |   23 
 force-app/main/default/classes/OrderPdfControllerTest.cls             |   19 
 force-app/main/default/classes/QuotePDFController.cls                 |   17 
 force-app/main/default/classes/NewHighProductsOppControllerTest.cls   |    6 
 force-app/main/default/classes/SBG001TriggerHandlerTest.cls           |    6 
 force-app/main/default/classes/QuotePDFControllerTest.cls             |    6 
 force-app/main/default/classes/OrderPdfController.cls                 |   50 
 force-app/main/default/classes/OrderPdf2Controller.cls                |   17 
 force-app/main/default/classes/OpportunityTriggerTest.cls             |   16 
 force-app/main/default/classes/NewLoanerUserControllerTest.cls        |    6 
 force-app/main/default/classes/NewCrossHighOpportunityController.cls  |   12 
 force-app/main/default/classes/SBG203RestTest.cls                     |    5 
 force-app/main/default/pages/NewLoanerUser.page                       |   22 
 force-app/main/default/pages/QuotePDF.page                            |  493 +++-
 manifest/packageTriggerController.xml                                 |    1 
 force-app/main/default/classes/QuotesPDFController.cls                |    9 
 force-app/main/default/classes/SearchMemberPageControllerTest.cls     |    6 
 force-app/main/default/classes/NEWCreateSWOQuoteController.cls        |   22 
 force-app/main/default/classes/NEWCreateSWOQuoteControllerTest.cls    |    6 
 force-app/main/default/classes/OrderPdf2ControllerTest.cls            |    6 
 /dev/null                                                             |  100 -
 force-app/main/default/pages/NEWCreateSWOQuote.page                   |    2 
 force-app/main/default/pages/OrderPDF.page                            | 2672 +++++++++++++++-----------
 59 files changed, 4,271 insertions(+), 1,683 deletions(-)

diff --git a/force-app/main/default/classes/ContactTriggerHandler.cls b/force-app/main/default/classes/ContactTriggerHandler.cls
index e17979a..e5f43b6 100644
--- a/force-app/main/default/classes/ContactTriggerHandler.cls
+++ b/force-app/main/default/classes/ContactTriggerHandler.cls
@@ -5,7 +5,7 @@
             // String new_profileId = UserInfo.getProfileId().subString(0,15);
             //calendarUtil.getMemberProfileID  杩欓噷鐢ㄥ埌鐨勪汉鍛業D 鍜岃幏鍙栧埌鐨勭畝妗D閮芥槸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);
             }
         }
         // 鏇存柊瀹㈡埛灏忕粍
diff --git a/force-app/main/default/classes/DeliveryConfirmPDFController.cls b/force-app/main/default/classes/DeliveryConfirmPDFController.cls
index 61e0288..f431ab0 100644
--- a/force-app/main/default/classes/DeliveryConfirmPDFController.cls
+++ b/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;
         }
diff --git a/force-app/main/default/classes/DeliveryConfirmPDFControllerTest.cls b/force-app/main/default/classes/DeliveryConfirmPDFControllerTest.cls
index 70b650d..62e128b 100644
--- a/force-app/main/default/classes/DeliveryConfirmPDFControllerTest.cls
+++ b/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);
diff --git a/force-app/main/default/classes/LoanerPortionReturnController.cls b/force-app/main/default/classes/LoanerPortionReturnController.cls
index dc45f15..9e4731f 100644
--- a/force-app/main/default/classes/LoanerPortionReturnController.cls
+++ b/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;
diff --git a/force-app/main/default/classes/NEWCreateSWOQuoteController.cls b/force-app/main/default/classes/NEWCreateSWOQuoteController.cls
index d547fe6..8762845 100644
--- a/force-app/main/default/classes/NEWCreateSWOQuoteController.cls
+++ b/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';
diff --git a/force-app/main/default/classes/NEWCreateSWOQuoteControllerTest.cls b/force-app/main/default/classes/NEWCreateSWOQuoteControllerTest.cls
index 07d5e1f..1c6162c 100644
--- a/force-app/main/default/classes/NEWCreateSWOQuoteControllerTest.cls
+++ b/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'];
diff --git a/force-app/main/default/classes/NewCrossHighOpportunityController.cls b/force-app/main/default/classes/NewCrossHighOpportunityController.cls
index dd4c0b5..815d013 100644
--- a/force-app/main/default/classes/NewCrossHighOpportunityController.cls
+++ b/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()));
diff --git a/force-app/main/default/classes/NewCrossRegionalControllerText.cls b/force-app/main/default/classes/NewCrossRegionalControllerText.cls
index 138fbef..468555f 100644
--- a/force-app/main/default/classes/NewCrossRegionalControllerText.cls
+++ b/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);
diff --git a/force-app/main/default/classes/NewCrossRegionalSalesController.cls b/force-app/main/default/classes/NewCrossRegionalSalesController.cls
index 5d756d6..eb16921 100644
--- a/force-app/main/default/classes/NewCrossRegionalSalesController.cls
+++ b/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';
             //姝e紡鐜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()));
diff --git a/force-app/main/default/classes/NewHighProductsOppController.cls b/force-app/main/default/classes/NewHighProductsOppController.cls
index 722d92c..a5b53a2 100644
--- a/force-app/main/default/classes/NewHighProductsOppController.cls
+++ b/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()));
diff --git a/force-app/main/default/classes/NewHighProductsOppControllerTest.cls b/force-app/main/default/classes/NewHighProductsOppControllerTest.cls
index 5cba708..d1098f7 100644
--- a/force-app/main/default/classes/NewHighProductsOppControllerTest.cls
+++ b/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(
diff --git a/force-app/main/default/classes/NewLoanerApplicationControllerTest.cls b/force-app/main/default/classes/NewLoanerApplicationControllerTest.cls
index c9e3e1e..07152af 100644
--- a/force-app/main/default/classes/NewLoanerApplicationControllerTest.cls
+++ b/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);
diff --git a/force-app/main/default/classes/NewLoanerUserControllerTest.cls b/force-app/main/default/classes/NewLoanerUserControllerTest.cls
index 06698d0..c1d69ac 100644
--- a/force-app/main/default/classes/NewLoanerUserControllerTest.cls
+++ b/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);
diff --git a/force-app/main/default/classes/NewOpportunityControllerTest.cls b/force-app/main/default/classes/NewOpportunityControllerTest.cls
index af363d0..e9c1c8f 100644
--- a/force-app/main/default/classes/NewOpportunityControllerTest.cls
+++ b/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'];
diff --git a/force-app/main/default/classes/OpportunityTriggerHandler.cls b/force-app/main/default/classes/OpportunityTriggerHandler.cls
index be66aac..6a2b27c 100644
--- a/force-app/main/default/classes/OpportunityTriggerHandler.cls
+++ b/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) {
diff --git a/force-app/main/default/classes/OpportunityTriggerTest.cls b/force-app/main/default/classes/OpportunityTriggerTest.cls
index 12b89cf..b68c474 100644
--- a/force-app/main/default/classes/OpportunityTriggerTest.cls
+++ b/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';
diff --git a/force-app/main/default/classes/OrderPdf2Controller.cls b/force-app/main/default/classes/OrderPdf2Controller.cls
index 65069b7..55868c5 100644
--- a/force-app/main/default/classes/OrderPdf2Controller.cls
+++ b/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;
diff --git a/force-app/main/default/classes/OrderPdf2ControllerTest.cls b/force-app/main/default/classes/OrderPdf2ControllerTest.cls
index efc5fdb..ed740dc 100644
--- a/force-app/main/default/classes/OrderPdf2ControllerTest.cls
+++ b/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'];
diff --git a/force-app/main/default/classes/OrderPdfController.cls b/force-app/main/default/classes/OrderPdfController.cls
index e63df9c..2b1c117 100644
--- a/force-app/main/default/classes/OrderPdfController.cls
+++ b/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 == '绌鸿繍') {
diff --git a/force-app/main/default/classes/OrderPdfControllerTest.cls b/force-app/main/default/classes/OrderPdfControllerTest.cls
index b88b5f7..0bf5f71 100644
--- a/force-app/main/default/classes/OrderPdfControllerTest.cls
+++ b/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();
     }
 
 }
\ No newline at end of file
diff --git a/force-app/main/default/classes/OrderTriggerHandler.cls b/force-app/main/default/classes/OrderTriggerHandler.cls
index f915de4..a337dea 100644
--- a/force-app/main/default/classes/OrderTriggerHandler.cls
+++ b/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
         // 鑾峰彇绯荤粺绠$悊鍛業d
         String getUserId = System.label.SystemAdmin1_2_GPI;
         String errMessage = '瀹㈡埛鍚嶆垨鏈�缁堢敤鎴蜂笌璇环涓嶄竴鑷达紒';
diff --git a/force-app/main/default/classes/OrderTriggerTest.cls b/force-app/main/default/classes/OrderTriggerTest.cls
index 7ea53f7..c6580f9 100644
--- a/force-app/main/default/classes/OrderTriggerTest.cls
+++ b/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);
     }
 
     //
diff --git a/force-app/main/default/classes/QuotePDFController.cls b/force-app/main/default/classes/QuotePDFController.cls
index 9651bb6..1040798 100644
--- a/force-app/main/default/classes/QuotePDFController.cls
+++ b/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
         }
     }
 
diff --git a/force-app/main/default/classes/QuotePDFControllerTest.cls b/force-app/main/default/classes/QuotePDFControllerTest.cls
index 4cd2017..e344903 100644
--- a/force-app/main/default/classes/QuotePDFControllerTest.cls
+++ b/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();
 
diff --git a/force-app/main/default/classes/QuotesPDFController.cls b/force-app/main/default/classes/QuotesPDFController.cls
index b94d45a..b8e9736 100644
--- a/force-app/main/default/classes/QuotesPDFController.cls
+++ b/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;
diff --git a/force-app/main/default/classes/QuotesPDFControllerTest.cls b/force-app/main/default/classes/QuotesPDFControllerTest.cls
index 2558a13..3724508 100644
--- a/force-app/main/default/classes/QuotesPDFControllerTest.cls
+++ b/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'];
diff --git a/force-app/main/default/classes/SBG001TriggerHandlerTest.cls b/force-app/main/default/classes/SBG001TriggerHandlerTest.cls
index fe5afbc..1eb7c75 100644
--- a/force-app/main/default/classes/SBG001TriggerHandlerTest.cls
+++ b/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'];
diff --git a/force-app/main/default/classes/SBG007TriggerHandlerTest.cls b/force-app/main/default/classes/SBG007TriggerHandlerTest.cls
index 946dcd9..a002328 100644
--- a/force-app/main/default/classes/SBG007TriggerHandlerTest.cls
+++ b/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);
+    }   
+
 }
\ No newline at end of file
diff --git a/force-app/main/default/classes/SBG027TriggerHandleTest.cls b/force-app/main/default/classes/SBG027TriggerHandleTest.cls
index 629bd25..562a0aa 100644
--- a/force-app/main/default/classes/SBG027TriggerHandleTest.cls
+++ b/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',
diff --git a/force-app/main/default/classes/SBG203RestTest.cls b/force-app/main/default/classes/SBG203RestTest.cls
index 5d396de..9b4bb28 100644
--- a/force-app/main/default/classes/SBG203RestTest.cls
+++ b/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(
diff --git a/force-app/main/default/classes/SWOController.cls b/force-app/main/default/classes/SWOController.cls
index 09de04c..6164b52 100644
--- a/force-app/main/default/classes/SWOController.cls
+++ b/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
 			}
 			//鍒濆鍖栬褰昐WO 鍘熷ASSIGNED TO锛屼繚瀛樻椂鍒ゆ柇鐢ㄦ埛鏄惁鍙樻洿锛屽鏋滃彉鏇寸粰鐢ㄦ埛鍙戦�侀偖浠�
 			assignedUser = swo.ASSIGNEDTO__c;
diff --git a/force-app/main/default/classes/SWOControllerTest.cls b/force-app/main/default/classes/SWOControllerTest.cls
index 53a5778..4268076 100644
--- a/force-app/main/default/classes/SWOControllerTest.cls
+++ b/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();
     }
 
     
diff --git a/force-app/main/default/classes/SearchMemberPageController.cls b/force-app/main/default/classes/SearchMemberPageController.cls
index b3a6f71..b87945a 100644
--- a/force-app/main/default/classes/SearchMemberPageController.cls
+++ b/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;}
+        
     }
 }
\ No newline at end of file
diff --git a/force-app/main/default/classes/SearchMemberPageControllerTest.cls b/force-app/main/default/classes/SearchMemberPageControllerTest.cls
index d6a2289..30a3db8 100644
--- a/force-app/main/default/classes/SearchMemberPageControllerTest.cls
+++ b/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'];
         
diff --git a/force-app/main/default/classes/SendEmailController.cls b/force-app/main/default/classes/SendEmailController.cls
index 7025254..822b3bf 100644
--- a/force-app/main/default/classes/SendEmailController.cls
+++ b/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>();
diff --git a/force-app/main/default/classes/SendEmailControllerTest.cls b/force-app/main/default/classes/SendEmailControllerTest.cls
index 524bc5d..34be45f 100644
--- a/force-app/main/default/classes/SendEmailControllerTest.cls
+++ b/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();
diff --git a/force-app/main/default/classes/TSRepairControllerTest.cls b/force-app/main/default/classes/TSRepairControllerTest.cls
index 7e04dd5..bab9220 100644
--- a/force-app/main/default/classes/TSRepairControllerTest.cls
+++ b/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() {
 
diff --git a/force-app/main/default/classes/loanerAppTriggerHandler.cls b/force-app/main/default/classes/loanerAppTriggerHandler.cls
index 983b992..c0016a3 100644
--- a/force-app/main/default/classes/loanerAppTriggerHandler.cls
+++ b/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);
diff --git a/force-app/main/default/classes/loanerAppTriggerHandlerTest.cls b/force-app/main/default/classes/loanerAppTriggerHandlerTest.cls
index af7b715..8ff8ca0 100644
--- a/force-app/main/default/classes/loanerAppTriggerHandlerTest.cls
+++ b/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();
 	}
 	
 }
\ No newline at end of file
diff --git a/force-app/main/default/pages/DeliveryConfirmPDF.page b/force-app/main/default/pages/DeliveryConfirmPDF.page
index b237c18..55c0e28 100644
--- a/force-app/main/default/pages/DeliveryConfirmPDF.page
+++ b/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;
+
+                //涓�椤祊df鏄剧ずhtml椤甸潰鐢熸垚鐨刢anvas楂樺害;
+                var pageHeight = contentWidth / pw * ph;
+                //鏈敓鎴恜df鐨刪tml椤甸潰楂樺害
+                var leftHeight = contentHeight;
+                //椤甸潰鍋忕Щ
+                var position = 0;
+                //a4绾哥殑灏哄[595.28,841.89]锛宧tml椤甸潰鐢熸垚鐨刢anvas鍦╬df涓浘鐗囩殑瀹介珮
+                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椤甸潰鐨勫疄闄呴珮搴︼紝鍜岀敓鎴恜df鐨勯〉闈㈤珮搴�(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>
\ No newline at end of file
diff --git a/force-app/main/default/pages/LoanerPortionReturn.page b/force-app/main/default/pages/LoanerPortionReturn.page
index 38b205b..dd7021f 100644
--- a/force-app/main/default/pages/LoanerPortionReturn.page
+++ b/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;"/>  
diff --git a/force-app/main/default/pages/NEWCreateSWOQuote.page b/force-app/main/default/pages/NEWCreateSWOQuote.page
index 0766bfd..6278a46 100644
--- a/force-app/main/default/pages/NEWCreateSWOQuote.page
+++ b/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>
diff --git a/force-app/main/default/pages/NEWCreateSWOQuoteReadOnly.page b/force-app/main/default/pages/NEWCreateSWOQuoteReadOnly.page
index c13f458..2568d35 100644
--- a/force-app/main/default/pages/NEWCreateSWOQuoteReadOnly.page
+++ b/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>
diff --git a/force-app/main/default/pages/NewCrossHighOpportunity.page b/force-app/main/default/pages/NewCrossHighOpportunity.page
index e26539a..d5bb146 100644
--- a/force-app/main/default/pages/NewCrossHighOpportunity.page
+++ b/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="浠g悊鍟嗗悕" for="opp_Dealer"/>
                     <apex:inputField value="{!opp.Dealer__c}" id="opp_Dealer"/>
                 </apex:pageBlockSectionItem>
                 
-                    <apex:pageBlockSectionItem >
-                        <apex:outputLabel value="浠g悊鍟嗛攢鍞媴褰撹�呭悕" for="opp_DealerSalesStaffName"/>
-                        <apex:inputField value="{!opp.DealerSalesStaffName__c}" id="opp_DealerSalesStaffName"/>
-                    </apex:pageBlockSectionItem>
-                
-          
-              
+                <apex:pageBlockSectionItem id="dssn" >
+                    <apex:outputLabel value="浠g悊鍟嗛攢鍞媴褰撹�呭悕" 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="浠g悊鍟嗘湇鍔℃媴褰撹�呭悕" 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>
 
 
diff --git a/force-app/main/default/pages/NewCrossRegionalSalesOpportunity.page b/force-app/main/default/pages/NewCrossRegionalSalesOpportunity.page
index a879e0f..d1f3d30 100644
--- a/force-app/main/default/pages/NewCrossRegionalSalesOpportunity.page
+++ b/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="浠g悊鍟嗗悕" 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="浠g悊鍟嗛攢鍞媴褰撹�呭悕" 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="浠g悊鍟嗛攢鍞媴褰撹�呭悕" 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="浠g悊鍟嗛攢鍞媴褰撹�呭悕" 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="浠g悊鍟嗛攢鍞媴褰撹�呭悕" 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="浠g悊鍟嗘湇鍔℃媴褰撹�呭悕" 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="浠g悊鍟嗗悕" 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="浠g悊鍟嗛攢鍞媴褰撹�呭悕." 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="浠g悊鍟嗛攢鍞媴褰撹�呭悕." 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="浠g悊鍟嗛攢鍞媴褰撹�呭悕." 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="浠g悊鍟嗛攢鍞媴褰撹�呭悕." 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="浠g悊鍟嗘湇鍔℃媴褰撹�呭悕." 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>
 
diff --git a/force-app/main/default/pages/NewHighProductsOpp.page b/force-app/main/default/pages/NewHighProductsOpp.page
index a275d18..597f068 100644
--- a/force-app/main/default/pages/NewHighProductsOpp.page
+++ b/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="浠g悊鍟嗗悕" for="opp_Dealer"/>
                     <apex:inputField value="{!opp.Dealer__c}" id="opp_Dealer"/>
                 </apex:pageBlockSectionItem>
                 
-                    <apex:pageBlockSectionItem >
-                        <apex:outputLabel value="浠g悊鍟嗛攢鍞媴褰撹�呭悕" for="opp_DealerSalesStaffName"/>
-                        <apex:inputField value="{!opp.DealerSalesStaffName__c}" id="opp_DealerSalesStaffName"/>
-                    </apex:pageBlockSectionItem>
-                
-          
-              
+                <apex:pageBlockSectionItem id="dssn" >
+                    <apex:outputLabel value="浠g悊鍟嗛攢鍞媴褰撹�呭悕" 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="浠g悊鍟嗘湇鍔℃媴褰撹�呭悕" 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>
 
      
diff --git a/force-app/main/default/pages/NewLoanerApplication.page b/force-app/main/default/pages/NewLoanerApplication.page
index b0f9038..00b63f3 100644
--- a/force-app/main/default/pages/NewLoanerApplication.page
+++ b/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
diff --git a/force-app/main/default/pages/NewLoanerUser.page b/force-app/main/default/pages/NewLoanerUser.page
index f66ca52..8b94606 100644
--- a/force-app/main/default/pages/NewLoanerUser.page
+++ b/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}:
diff --git a/force-app/main/default/pages/OrderPDF.page b/force-app/main/default/pages/OrderPDF.page
index bff6e35..2b19872 100644
--- a/force-app/main/default/pages/OrderPDF.page
+++ b/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>浠g悊鍟嗗叏绉�</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;">鐢佃瘽锛圱el锛�:&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;">浼犵湡锛團ax锛�:&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;">鐢佃瘽锛圱el锛�:&nbsp;</td>
-                <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_C_TEL__c}</td>
-            </tr>
-            <tr>
-                <td style="font-size: 8pt;">浼犵湡锛團ax锛�:&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;">鐢佃瘽锛圱el锛�:&nbsp;</td>
-                <td colspan = "3" style="font-size: 8pt;">{!contra.pdf_c_tel}</td>
-            </tr>
-            <tr>
-                <td style="font-size: 8pt;">浼犵湡锛團ax锛�:&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;">鐢佃瘽锛圱el锛�:&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;">鐢佃瘽锛圱el锛�:&nbsp;</td>
-                <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_N_TEL__c}</td>
-            </tr>
-            <tr>
-                <td style="font-size: 8pt;">浼犵湡锛團ax锛�:&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;">鐢佃瘽锛圱el锛�:&nbsp;</td>
-                <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_N_TEL__c}</td>
-            </tr>
-            <tr>
-                <td style="font-size: 8pt;">浼犵湡锛團ax锛�:&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;">鐢佃瘽锛圱el锛�:&nbsp;</td>
-                <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_F_TEL__c}</td>
-            </tr>
-            <tr>
-                <td style="font-size: 8pt;">浼犵湡锛團ax锛�:&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锛寃hereby 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/>
-                    鍟嗗搧鎳変互鍧氬浐鐨勫嚭鍙g焊鐨鎴栨湪绠卞寘瑁咃紝閫備簬闀块�旂┖杩愩�佸ぉ姘旀垨姘斿�欏彉鍖栥�侀槻娼�佹姉闇囥�侀槻閿堝強澶氭鎼繍銆傜敱浜庡寘瑁呬笉鑹�屼骇鐢熺殑<br/>
-                    鐩存帴鎹熷け, 鐢卞崠鏂硅礋璐c��<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锛実ross weight锛宮easurement<br/>
-                     and the following wordings锛�<br/>
-                    鈥淜EEP AWAY FROM MOISTURE鈥濓紝鈥淗ANDLE WITH CARE鈥� 锛屸�淭HIS 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. 瑁呰繍鍙e哺锛�&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. 鐩殑鍙e哺锛�&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) 绌鸿繍鎻愬崟姝f湰{!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鈥檛 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 鈥渇reight 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/>
-                    鏈変箟鍔″拰璐d换鍦ㄥ埗閫犺繃绋嬩腑涓庝拱鏂瑰晢閲忓仛鍑虹浉搴旂殑璋冩暣鍜岃ˉ鏁戯紝骞朵繚璇佹暣濂椾互涓婅揣鐗╄兘閫氳繃楠屾敹銆�<br/>
-                    C. 鏈悎鍚屼腑鎵�杩扮殑淇濊瘉鏄�傜敤浜庢牴鎹悎鍚岃揣鐗╂彁渚涚殑鐨勫敮涓�淇濊瘉銆傛湰淇濊瘉鏉℃鍙栦唬骞舵帓闄ゆ硶寰嬨�佹儻渚嬨�佹硶浠ゆ垨鍏朵粬瑙勫畾鏂藉姞<br/>
-                    鎴栭粯绀虹殑浠讳綍鍏朵粬鎷呬繚銆佷繚璇佸拰/鎴栨潯浠跺拰/鎴栧洜姝よ�屼骇鐢熺殑璐d换銆傚浜庝换浣曟湁缂洪櫡鐨勬垨涓嶇鍚堟爣鍑嗙殑璐х墿锛屼拱鏂规墍閫傜敤鐨勫彧鏈�<br/>
-                    鏈潯鐗瑰埆瑙勫畾鐨勬晳娴庛��<br/>
-                    14. WARRANTY锛�<br/>
-                    A锛嶵he 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鈥檚 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锛嶪n case there鈥檚 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/>
-                    鏈変箟鍔″拰璐d换鍦ㄥ埗閫犺繃绋嬩腑涓庝拱鏂瑰晢閲忓仛鍑虹浉搴旂殑璋冩暣鍜岃ˉ鏁戯紝骞朵繚璇佹暣濂椾互涓婅揣鐗╄兘閫氳繃楠屾敹銆�<br/>
-                    C. 鏈悎鍚屼腑鎵�杩扮殑淇濊瘉鏄�傜敤浜庢牴鎹悎鍚岃揣鐗╂彁渚涚殑鐨勫敮涓�淇濊瘉銆傛湰淇濊瘉鏉℃鍙栦唬骞舵帓闄ゆ硶寰嬨�佹儻渚嬨�佹硶浠ゆ垨鍏朵粬瑙勫畾鏂藉姞<br/>
-                    鎴栭粯绀虹殑浠讳綍鍏朵粬鎷呬繚銆佷繚璇佸拰/鎴栨潯浠跺拰/鎴栧洜姝よ�屼骇鐢熺殑璐d换銆傚浜庝换浣曟湁缂洪櫡鐨勬垨涓嶇鍚堟爣鍑嗙殑璐х墿锛屼拱鏂规墍閫傜敤鐨勫彧鏈�<br/>
-                    鏈潯鐗瑰埆瑙勫畾鐨勬晳娴庛��<br/>
-                    14. WARRANTY锛�<br/>
-                    A锛嶵he 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鈥檚 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锛嶪n case there鈥檚 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锛塗he manufacturer shall锛宐efore making delivery锛宮ake 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锛塛ithin 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锛塖hould 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锛塅or any goods which are not in conformity with the Contract, the Seller锛寃ithin a reasonable time锛宻hall make replacement <br/>free of charge锛宒eliver 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锛夊湪鏈粡涔版柟涔﹂潰鍚屾剰鐨勬儏鍐典笅锛屽崠鏂逛笉寰楀皢鐢变拱鏂规垨浠h〃涔版柟鎻愪緵鐨勬湁鍏冲悎鍚屾潯鏂囥�佽鏍笺�佽鍒掋�佸浘绾搞�佹ā鍨嬨�佹牱鍝佹垨璧勬枡鎻愪緵<br/>
-                        缁欎笌灞ヨ鏈悎鍚屾棤鍏崇殑浠讳綍浜恒�傚嵆浣垮悜涓庡饱琛屾湰鍚堝悓鏈夊叧鐨勪汉鍛樻彁渚涳紝涔熷簲娉ㄦ剰淇濆瘑骞朵粎闄愪簬灞ヨ鍚堝悓蹇呴』鐨勮寖鍥淬��<br/>
-                        锛�2锛夐櫎闈炴墽琛屽悎鍚岄渶瑕侊紝鍦ㄤ簨鍏堟湭寰楀埌涔版柟涔﹂潰鍚屾剰鐨勬儏鍐典笅锛屽崠鏂逛笉寰椾娇鐢ㄦ潯娆撅紙1锛変腑鎵�鍒椾妇鐨勪换浣曟枃浠跺拰璧勬枡銆�<br/>
-                        锛�3锛夐櫎鍚堝悓鏈韩澶栵紝鏉℃锛�1锛夊垪鏄庣殑鎵�鏈夋枃浠跺缁堜负涔版柟鐨勮储浜э紝鑻ヤ拱鏂硅姹傦紝鍗栨柟搴斾簬鍏跺悎鍚屼箟鍔″饱琛屽畬姣曚互鍚庡皢杩欎簺鏂囦欢鍙婂叏<br/>
-                        閮ㄥ鍒朵欢閫�杩樼粰涔版柟銆�<br/>
-                        19. USE OF CONTRACT鈥橲 DOCUMENTS AND INFORMATION: <br/>
-                        (1) The Seller shall not, without the Buyer鈥檚 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鈥檚 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鈥檚 performance under this Contract if so required by the Buyer. <br/>
-                    </td>
-                </tr>
-                <tr>
-                    <td>
-                        20. 浠茶锛�<br/>
-                        涓庢湰鍚堝悓鏈夊叧鐨勬垨鍥犳墽琛屾湰鍚堝悓鎵�鍙戠敓鐨勪竴鍒囦簤鎵э紝鐢辩璁㈠悎鍚岀殑鍙屾柟鍙嬪ソ鍗忓晢瑙e喅銆傝嫢涓嶈兘瑙e喅鏃讹紝妗堜欢鍙彁浜や腑鍥藉浗闄呯粡娴庤锤鏄�<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. 杩涘嚭鍙h鍙瘉锛�<br/>
-                        杩涘彛鏈悎鍚岄」涓嬭揣鐗╂墍闇�鐨勪腑鍥芥斂搴滃強娴峰叧瑕佹眰鐨勮繘鍙h鍙瘉鍜屽叾浠栬繘鍙f枃浠剁敱涔版柟璐熻矗鍔炵悊銆傚嚭鍙f湰鍚堝悓椤逛笅璐х墿鎵�闇�鐨勫嚭鍙e浗鏀�<br/>
-                        搴滃強娴峰叧瑕佹眰鐨勫嚭鍙h鍙瘉鍜屽叾浠栧嚭鍙f枃浠剁敱鍗栨柟璐熻矗鍔炵悊銆�<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鈥檚 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鈥檚 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鈥檚 Republic of China.<br/> 
-                    </td>
-                </tr>
-                <tr>
-                    <td colspan = "2">
-                        24.鍏朵粬:<br/>
-                        锛�1锛夋湰鍚堝悓搴斾互涓枃鍜岃嫳鏂囦功鍐欙紝濡備腑鏂囧拰鑻辨枃鐗堟湰涔嬮棿鏈変换浣曚笉涓�鑷达紝鍒欎互鑻辨枃鏈负涓汇�傛妧鏈浘绾革紝涔板崠鍙屾柟鐨勬墍鏈夊嚱鐢典互鍙婁笌鍚�<br/>
-                        鍚屾湁鍏崇殑鏂囦欢鍧囧簲浠ヤ腑鏂囨垨鑻辨枃涔﹀啓銆�<br/>
-                        锛�2锛夐櫎鎶�鏈鏍间腑鍙︽湁瑙勫畾澶栵紝璁¢噺鍗曚綅鍧囦娇鐢ㄥ叕鍒躲��<br/>
-                        锛�3锛夋瀵瑰悎鍚屾潯娆惧仛鍑轰换浣曚慨鏀癸紝鍧囬』鐢变拱鍗栧弻鏂圭缃蹭功闈㈢殑鍚堝悓淇敼涔︺��<br/>
-                        锛�4锛夋湰鍚堝悓鎵�鏈夐檮浠跺皢鏄湰鍚堝悓涓嶅彲鍒嗗壊鐨勭粍鎴愰儴鍒嗗苟鍏锋湁鍚岀瓑鏁堝姏銆�<br/>
-                        锛�5锛夋湭鍦ㄦ湰鍚堝悓涓鏄庣殑鍟嗗姟鎯緥搴旂鍚圛NCOTERMS 2000鏉℃鐨勮瀹氥��<br/>
-                        锛�6锛夋湰鍚堝悓鐢变拱鍗栧弻鏂圭璁㈠悗绔嬪嵆鐢熸晥銆�<br/>
-                        &nbsp;&nbsp;姝ゅ悎鍚岀敱涔板崠鍙屾柟绛剧讲姝f湰 {!contra.order.PDF_Co_Contract__c}浠姐�� 涔版柟鎸佹湁 {!contra.order.PDF_Co_BContra__c}浠姐�� 鍗栨柟鎸佹湁 {!contra.order.PDF_Co_SContra__c}浠姐��<br/>
-                        24. OTHERS:<br/>
-                        锛�1锛塗his 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锛堿ll measurement shall be in SI unit, unless otherwise specified in the Technical Specifications.<br/>
-                        锛�3锛塏o variation in or modification of the terms of this Contract shall be valid except by written amendment signed by the parties.<br/>
-                        锛�4锛堿ll 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锛塗his 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>浠g悊鍟嗗叏绉�</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;">鐢佃瘽锛圱el锛�:&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;">浼犵湡锛團ax锛�:&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;">鐢佃瘽锛圱el锛�:&nbsp;</td>
+                            <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_C_TEL__c}</td>
+                        </tr>
+                        <tr>
+                            <td style="font-size: 8pt;">浼犵湡锛團ax锛�:&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;">鐢佃瘽锛圱el锛�:&nbsp;</td>
+                        <td colspan = "3" style="font-size: 8pt;">{!contra.pdf_c_tel}</td>
+                    </tr>
+                    <tr>
+                        <td style="font-size: 8pt;">浼犵湡锛團ax锛�:&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;">鐢佃瘽锛圱el锛�:&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;">鐢佃瘽锛圱el锛�:&nbsp;</td>
+                            <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_N_TEL__c}</td>
+                        </tr>
+                        <tr>
+                            <td style="font-size: 8pt;">浼犵湡锛團ax锛�:&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;">鐢佃瘽锛圱el锛�:&nbsp;</td>
+                            <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_N_TEL__c}</td>
+                        </tr>
+                        <tr>
+                            <td style="font-size: 8pt;">浼犵湡锛團ax锛�:&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;">鐢佃瘽锛圱el锛�:&nbsp;</td>
+                            <td colspan="3" style="font-size: 8pt;">{!contra.order.PDF_F_TEL__c}</td>
+                        </tr>
+                        <tr>
+                            <td style="font-size: 8pt;">浼犵湡锛團ax锛�:&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锛寃hereby 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/> 鍟嗗搧鎳変互鍧氬浐鐨勫嚭鍙g焊鐨鎴栨湪绠卞寘瑁咃紝閫備簬闀块�旂┖杩愩�佸ぉ姘旀垨姘斿�欏彉鍖栥�侀槻娼�佹姉闇囥�侀槻閿堝強澶氭鎼繍銆傜敱浜庡寘瑁呬笉鑹�屼骇鐢熺殑
+                            <br/> 鐩存帴鎹熷け, 鐢卞崠鏂硅礋璐c��
+                            <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锛実ross weight锛宮easurement
+                            <br/> and the following wordings锛�
+                            <br/> 鈥淜EEP AWAY FROM MOISTURE鈥濓紝鈥淗ANDLE WITH CARE鈥� 锛屸�淭HIS 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. 瑁呰繍鍙e哺锛�&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. 鐩殑鍙e哺锛�&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) 绌鸿繍鎻愬崟姝f湰{!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鈥檛 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 鈥渇reight 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/> 鏈変箟鍔″拰璐d换鍦ㄥ埗閫犺繃绋嬩腑涓庝拱鏂瑰晢閲忓仛鍑虹浉搴旂殑璋冩暣鍜岃ˉ鏁戯紝骞朵繚璇佹暣濂椾互涓婅揣鐗╄兘閫氳繃楠屾敹銆�
+                                <br/> C. 鏈悎鍚屼腑鎵�杩扮殑淇濊瘉鏄�傜敤浜庢牴鎹悎鍚岃揣鐗╂彁渚涚殑鐨勫敮涓�淇濊瘉銆傛湰淇濊瘉鏉℃鍙栦唬骞舵帓闄ゆ硶寰嬨�佹儻渚嬨�佹硶浠ゆ垨鍏朵粬瑙勫畾鏂藉姞
+                                <br/> 鎴栭粯绀虹殑浠讳綍鍏朵粬鎷呬繚銆佷繚璇佸拰/鎴栨潯浠跺拰/鎴栧洜姝よ�屼骇鐢熺殑璐d换銆傚浜庝换浣曟湁缂洪櫡鐨勬垨涓嶇鍚堟爣鍑嗙殑璐х墿锛屼拱鏂规墍閫傜敤鐨勫彧鏈�
+                                <br/> 鏈潯鐗瑰埆瑙勫畾鐨勬晳娴庛��
+                                <br/> 14. WARRANTY锛�
+                                <br/> A锛嶵he 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鈥檚 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锛嶪n case there鈥檚 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/> 鏈変箟鍔″拰璐d换鍦ㄥ埗閫犺繃绋嬩腑涓庝拱鏂瑰晢閲忓仛鍑虹浉搴旂殑璋冩暣鍜岃ˉ鏁戯紝骞朵繚璇佹暣濂椾互涓婅揣鐗╄兘閫氳繃楠屾敹銆�
+                                <br/> C. 鏈悎鍚屼腑鎵�杩扮殑淇濊瘉鏄�傜敤浜庢牴鎹悎鍚岃揣鐗╂彁渚涚殑鐨勫敮涓�淇濊瘉銆傛湰淇濊瘉鏉℃鍙栦唬骞舵帓闄ゆ硶寰嬨�佹儻渚嬨�佹硶浠ゆ垨鍏朵粬瑙勫畾鏂藉姞
+                                <br/> 鎴栭粯绀虹殑浠讳綍鍏朵粬鎷呬繚銆佷繚璇佸拰/鎴栨潯浠跺拰/鎴栧洜姝よ�屼骇鐢熺殑璐d换銆傚浜庝换浣曟湁缂洪櫡鐨勬垨涓嶇鍚堟爣鍑嗙殑璐х墿锛屼拱鏂规墍閫傜敤鐨勫彧鏈�
+                                <br/> 鏈潯鐗瑰埆瑙勫畾鐨勬晳娴庛��
+                                <br/> 14. WARRANTY锛�
+                                <br/> A锛嶵he 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鈥檚 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锛嶪n case there鈥檚 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锛塗he manufacturer shall锛宐efore making delivery锛宮ake 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锛塛ithin 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锛塖hould 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锛塅or any goods which are not in conformity with the Contract, the Seller锛寃ithin a reasonable time锛宻hall
+                            make replacement
+                            <br/>free of charge锛宒eliver 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锛夊湪鏈粡涔版柟涔﹂潰鍚屾剰鐨勬儏鍐典笅锛屽崠鏂逛笉寰楀皢鐢变拱鏂规垨浠h〃涔版柟鎻愪緵鐨勬湁鍏冲悎鍚屾潯鏂囥�佽鏍笺�佽鍒掋�佸浘绾搞�佹ā鍨嬨�佹牱鍝佹垨璧勬枡鎻愪緵
+                            <br/> 缁欎笌灞ヨ鏈悎鍚屾棤鍏崇殑浠讳綍浜恒�傚嵆浣垮悜涓庡饱琛屾湰鍚堝悓鏈夊叧鐨勪汉鍛樻彁渚涳紝涔熷簲娉ㄦ剰淇濆瘑骞朵粎闄愪簬灞ヨ鍚堝悓蹇呴』鐨勮寖鍥淬��
+                            <br/> 锛�2锛夐櫎闈炴墽琛屽悎鍚岄渶瑕侊紝鍦ㄤ簨鍏堟湭寰楀埌涔版柟涔﹂潰鍚屾剰鐨勬儏鍐典笅锛屽崠鏂逛笉寰椾娇鐢ㄦ潯娆撅紙1锛変腑鎵�鍒椾妇鐨勪换浣曟枃浠跺拰璧勬枡銆�
+                            <br/> 锛�3锛夐櫎鍚堝悓鏈韩澶栵紝鏉℃锛�1锛夊垪鏄庣殑鎵�鏈夋枃浠跺缁堜负涔版柟鐨勮储浜э紝鑻ヤ拱鏂硅姹傦紝鍗栨柟搴斾簬鍏跺悎鍚屼箟鍔″饱琛屽畬姣曚互鍚庡皢杩欎簺鏂囦欢鍙婂叏
+                            <br/> 閮ㄥ鍒朵欢閫�杩樼粰涔版柟銆�
+                            <br/> 19. USE OF CONTRACT鈥橲 DOCUMENTS AND INFORMATION:
+                            <br/> (1) The Seller shall not, without the Buyer鈥檚 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鈥檚 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鈥檚 performance under this Contract
+                            if so required by the Buyer.
+                            <br/>
+                        </td>
+                    </tr>
+                    <tr>
+                        <td>
+                            20. 浠茶锛�
+                            <br/> 涓庢湰鍚堝悓鏈夊叧鐨勬垨鍥犳墽琛屾湰鍚堝悓鎵�鍙戠敓鐨勪竴鍒囦簤鎵э紝鐢辩璁㈠悎鍚岀殑鍙屾柟鍙嬪ソ鍗忓晢瑙e喅銆傝嫢涓嶈兘瑙e喅鏃讹紝妗堜欢鍙彁浜や腑鍥藉浗闄呯粡娴庤锤鏄�
+                            <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. 杩涘嚭鍙h鍙瘉锛�
+                            <br/> 杩涘彛鏈悎鍚岄」涓嬭揣鐗╂墍闇�鐨勪腑鍥芥斂搴滃強娴峰叧瑕佹眰鐨勮繘鍙h鍙瘉鍜屽叾浠栬繘鍙f枃浠剁敱涔版柟璐熻矗鍔炵悊銆傚嚭鍙f湰鍚堝悓椤逛笅璐х墿鎵�闇�鐨勫嚭鍙e浗鏀�
+                            <br/> 搴滃強娴峰叧瑕佹眰鐨勫嚭鍙h鍙瘉鍜屽叾浠栧嚭鍙f枃浠剁敱鍗栨柟璐熻矗鍔炵悊銆�
+                            <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鈥檚 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鈥檚 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鈥檚 Republic of China.
+                            <br/>
+                        </td>
+                    </tr>
+                    <tr>
+                        <td colspan="2">
+                            24.鍏朵粬:
+                            <br/> 锛�1锛夋湰鍚堝悓搴斾互涓枃鍜岃嫳鏂囦功鍐欙紝濡備腑鏂囧拰鑻辨枃鐗堟湰涔嬮棿鏈変换浣曚笉涓�鑷达紝鍒欎互鑻辨枃鏈负涓汇�傛妧鏈浘绾革紝涔板崠鍙屾柟鐨勬墍鏈夊嚱鐢典互鍙婁笌鍚�
+                            <br/> 鍚屾湁鍏崇殑鏂囦欢鍧囧簲浠ヤ腑鏂囨垨鑻辨枃涔﹀啓銆�
+                            <br/> 锛�2锛夐櫎鎶�鏈鏍间腑鍙︽湁瑙勫畾澶栵紝璁¢噺鍗曚綅鍧囦娇鐢ㄥ叕鍒躲��
+                            <br/> 锛�3锛夋瀵瑰悎鍚屾潯娆惧仛鍑轰换浣曚慨鏀癸紝鍧囬』鐢变拱鍗栧弻鏂圭缃蹭功闈㈢殑鍚堝悓淇敼涔︺��
+                            <br/> 锛�4锛夋湰鍚堝悓鎵�鏈夐檮浠跺皢鏄湰鍚堝悓涓嶅彲鍒嗗壊鐨勭粍鎴愰儴鍒嗗苟鍏锋湁鍚岀瓑鏁堝姏銆�
+                            <br/> 锛�5锛夋湭鍦ㄦ湰鍚堝悓涓鏄庣殑鍟嗗姟鎯緥搴旂鍚圛NCOTERMS 2000鏉℃鐨勮瀹氥��
+                            <br/> 锛�6锛夋湰鍚堝悓鐢变拱鍗栧弻鏂圭璁㈠悗绔嬪嵆鐢熸晥銆�
+                            <br/> &nbsp;&nbsp;姝ゅ悎鍚岀敱涔板崠鍙屾柟绛剧讲姝f湰 {!contra.order.PDF_Co_Contract__c}浠姐�� 涔版柟鎸佹湁 {!contra.order.PDF_Co_BContra__c}浠姐��
+                            鍗栨柟鎸佹湁 {!contra.order.PDF_Co_SContra__c}浠姐��
+                            <br/> 24. OTHERS:
+                            <br/> 锛�1锛塗his 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锛堿ll measurement shall be in SI unit, unless otherwise specified in the Technical Specifications.
+                            <br/> 锛�3锛塏o variation in or modification of the terms of this Contract shall be valid except by written amendment
+                            signed by the parties.
+                            <br/> 锛�4锛堿ll 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锛塗his 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);
+        // 鎶奿mageDta杞崲鎴恥rl
+            // 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;
+        
+                            
+                            //鏈敓鎴恜df鐨刪tml椤甸潰楂樺害
+                            var leftHeight = contentHeight;
+                            //椤甸潰鍋忕Щ
+                            var position = 0;
+                            
+                            //a4绾哥殑灏哄[595.28,841.89]锛宧tml椤甸潰鐢熸垚鐨刢anvas鍦╬df涓浘鐗囩殑瀹介珮
+                            var outputWidth = pw - 2 * marginw;//595.28//宸﹀彸杈硅窛20
+                            let rate = outputWidth / 780;//杈撳嚭瀹藉害鍜屽唴瀹瑰搴︾殑姣斾緥
+                            var outputHeight = ph - 2 * marginh;//宸﹀彸杈硅窛20
+                            let onePdfPageInCanvasHeight = contentWidth/outputWidth*outputHeight;//涓�椤祊df鍦╟anvas涓殑楂樺害;
+                            //var pageData = canvas.toDataURL('image/jpeg', 1.0);
+                            var pageData = null;
+                            var imgData = null;
+                            
+                            var captureHeight = null;// 鎴彇鐨勫綋鍓峜anvas椤电殑楂樺害
+                            
+                            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,琚緭鍑虹殑鍥剧墖浼氳鎷変几涓簅utputWidth锛宱utputHeight鐨勫楂�
+                                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>
\ No newline at end of file
diff --git a/force-app/main/default/pages/OrderPdf2.page b/force-app/main/default/pages/OrderPdf2.page
index 6fff05d..8345a38 100644
--- a/force-app/main/default/pages/OrderPdf2.page
+++ b/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;
+
+                //涓�椤祊df鏄剧ずhtml椤甸潰鐢熸垚鐨刢anvas楂樺害;
+                var pageHeight = contentWidth / pw * ph;
+                //鏈敓鎴恜df鐨刪tml椤甸潰楂樺害
+                var leftHeight = contentHeight;
+                //椤甸潰鍋忕Щ
+                var position = 0;
+                //a4绾哥殑灏哄[595.28,841.89]锛宧tml椤甸潰鐢熸垚鐨刢anvas鍦╬df涓浘鐗囩殑瀹介珮
+                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椤甸潰鐨勫疄闄呴珮搴︼紝鍜岀敓鎴恜df鐨勯〉闈㈤珮搴�(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>
\ No newline at end of file
diff --git a/force-app/main/default/pages/OrderPdf3.page b/force-app/main/default/pages/OrderPdf3.page
index 0c28f12..fdad6ec 100644
--- a/force-app/main/default/pages/OrderPdf3.page
+++ b/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;
+
+                //涓�椤祊df鏄剧ずhtml椤甸潰鐢熸垚鐨刢anvas楂樺害;
+                var pageHeight = contentWidth / pw * ph;
+                //鏈敓鎴恜df鐨刪tml椤甸潰楂樺害
+                var leftHeight = contentHeight;
+                //椤甸潰鍋忕Щ
+                var position = 0;
+                //a4绾哥殑灏哄[595.28,841.89]锛宧tml椤甸潰鐢熸垚鐨刢anvas鍦╬df涓浘鐗囩殑瀹介珮
+                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椤甸潰鐨勫疄闄呴珮搴︼紝鍜岀敓鎴恜df鐨勯〉闈㈤珮搴�(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  -->
 
 
 
diff --git a/force-app/main/default/pages/QuotePDF.page b/force-app/main/default/pages/QuotePDF.page
index 0248eda..103cf6e 100644
--- a/force-app/main/default/pages/QuotePDF.page
+++ b/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鈥檚 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鈥檚 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鈥檚 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鈥檚 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);
+    // 鎶奿mageDta杞崲鎴恥rl
+        // 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;
+    
+                        
+                        //鏈敓鎴恜df鐨刪tml椤甸潰楂樺害
+                        var leftHeight = contentHeight;
+                        //椤甸潰鍋忕Щ
+                        var position = 0;
+                        
+                        //a4绾哥殑灏哄[595.28,841.89]锛宧tml椤甸潰鐢熸垚鐨刢anvas鍦╬df涓浘鐗囩殑瀹介珮
+                        var outputWidth = pw - 2 * marginw;//595.28//宸﹀彸杈硅窛20
+                        let rate = outputWidth / 780;//杈撳嚭瀹藉害鍜屽唴瀹瑰搴︾殑姣斾緥
+                        var outputHeight = ph - 2 * marginh;//宸﹀彸杈硅窛20
+                        let onePdfPageInCanvasHeight = contentWidth/outputWidth*outputHeight;//涓�椤祊df鍦╟anvas涓殑楂樺害;
+                        //var pageData = canvas.toDataURL('image/jpeg', 1.0);
+                        var pageData = null;
+                        var imgData = null;
+                        
+                        var captureHeight = null;// 鎴彇鐨勫綋鍓峜anvas椤电殑楂樺害
+                        
+                        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,琚緭鍑虹殑鍥剧墖浼氳鎷変几涓簅utputWidth锛宱utputHeight鐨勫楂�
+                            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>
\ No newline at end of file
diff --git a/force-app/main/default/pages/QuotesPDF.page b/force-app/main/default/pages/QuotesPDF.page
index bafe58d..8e6ec01 100644
--- a/force-app/main/default/pages/QuotesPDF.page
+++ b/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;
+
+                //涓�椤祊df鏄剧ずhtml椤甸潰鐢熸垚鐨刢anvas楂樺害;
+                var pageHeight = contentWidth / pw * ph;
+                //鏈敓鎴恜df鐨刪tml椤甸潰楂樺害
+                var leftHeight = contentHeight;
+                //椤甸潰鍋忕Щ
+                var position = 0;
+                //a4绾哥殑灏哄[595.28,841.89]锛宧tml椤甸潰鐢熸垚鐨刢anvas鍦╬df涓浘鐗囩殑瀹介珮
+                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椤甸潰鐨勫疄闄呴珮搴︼紝鍜岀敓鎴恜df鐨勯〉闈㈤珮搴�(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>
\ No newline at end of file
diff --git a/force-app/main/default/pages/SWOPage.page b/force-app/main/default/pages/SWOPage.page
index 62aeeb0..ec2d8f2 100644
--- a/force-app/main/default/pages/SWOPage.page
+++ b/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);
diff --git a/force-app/main/default/pages/SearchMemberPage.page b/force-app/main/default/pages/SearchMemberPage.page
index 4767d57..447e4d6 100644
--- a/force-app/main/default/pages/SearchMemberPage.page
+++ b/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>
diff --git a/force-app/main/default/pages/SendEmail.page b/force-app/main/default/pages/SendEmail.page
index c6a373f..8487046 100644
--- a/force-app/main/default/pages/SendEmail.page
+++ b/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>
\ No newline at end of file
diff --git a/manifest/packagePIPL.xml b/manifest/packagePIPL.xml
deleted file mode 100644
index be9313a..0000000
--- a/manifest/packagePIPL.xml
+++ /dev/null
@@ -1,100 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<Package xmlns="http://soap.sforce.com/2006/04/metadata">
-    <types>
-        <members>DeveloperUtility</members>
-        <members>TestDataUtility</members>
-        <members>NewAndEditLoanerAppDetailController</members>
-        <members>NewAndEditLoanerApplicationControlTest</members>
-        <members>SearchContactControllerTest</members>
-        <members>NewAndEditContactControllerTest</members>
-        <members>NewAndEditLoanerAppDetailControllerTest</members>
-        <members>CustContControllerTest</members>
-        <members>NewAndEditLoanerUserControllerTest</members>
-        <members>NewAndEditUserFaultInfoControllerTest</members>
-        <members>NewAndEditQuotesControllerTest</members>
-        <members>NewAndEditLoanerExpressController</members>
-        <members>NewAndEditLoanerApplicationController</members>
-        <members>PIHelperTest</members>
-        <members>NewAndEditOpportunityControllerTest</members>
-        <members>TydelikeConControllerTest</members>
-        <members>IENewOpportunityControllerTest</members>
-        <members>NewAndEditLoanerExpressControllerTest</members>
-        <members>NewAndEditBaseControllerTest</members>
-        <members>NewAndEditOrderControllerTest</members>
-        <members>SoqlHelperTest</members>
-        <members>NewAndEditUserFaultInfoController</members>
-        <members>LayoutDescriberHelperTest</members>
-        <members>TydelikeAccControllerTest</members>
-        <members>SBG203Rest</members>
-        <members>SBG027Controller</members>
-        <members>OrderTriggerHandler</members>
-        <members>NFMUtil</members>
-        <members>SBG027TriggerHandler</members>
-        <members>Sbg027Sync</members>
-        <members>NewOpportunityController</members>
-        <members>SBG001TriggerHandler</members>
-        <members>SBG007TriggerHandler</members>
-        <members>NewAndEditQuotesController</members>
-        <members>SWOController</members>
-        <members>TSRepairController</members>
-        <members>NewReplacementOpportunityController</members>
-        <members>LoanerLendDeliverController</members>
-        <members>NewAndEditContactController</members>
-        <members>AWSServiceTool</members>
-        <members>AWSServiceTool2</members>
-        <members>AWSServiceTool2Test</members>
-        <members>LayoutDescriberHelper</members>
-        <members>NewAndEditBaseController</members>
-        <members>PIHelper</members>
-        <members>AWSServiceToolTest</members>
-        <members>NewAndEditRepairControllerTest</members>
-        <members>SoqlHelper</members>
-        <members>NewAndEditRepairController</members>
-        <members>NewAndEditLoanerUserController</members>
-        <members>TydelikeAccController</members>
-        <members>TydelikeConController</members>
-        <members>CustContController</members>
-        <members>NewAndEditOrderController</members>
-        <members>IENewOpportunityController</members>
-        <members>SearchContactController</members>
-        <members>NewAndEditOpportunityController</members>
-        <name>ApexClass</name>
-    </types> 
-    <types>
-        <members>NewAndEditLoanerApplication</members>
-        <members>TestLabel</members>
-        <members>ViewQuotesDecryptInfo</members>
-        <members>ViewUserFaultInfoDecryptInfo</members>
-        <members>ViewLoanerUserDecryptInfo</members>
-        <members>NewAndEditLoanerUser</members>
-        <members>NewAndEditQuotes</members>
-        <members>ViewOpportunityDecryptInfo</members>
-        <members>ViewOrderDecryptInfo</members>
-        <members>ViewLoanerApplicationDecryptInfo</members>
-        <members>NewAndEditOpportunity</members>
-        <members>TydelikeAcc</members>
-        <members>SearchContactPage</members>
-        <members>NewAndEditContact</members>
-        <members>ViewRepairDecryptInfo</members>
-        <members>IENewOpportunity</members>
-        <members>ViewContactDecryptInfo</members>
-        <members>NewAndEditUserFaultInfo</members>
-        <members>CustContPage</members>
-        <members>NewAndEditOrder</members>
-        <members>TydelikeCon</members>
-        <members>TSRepair</members>
-        <members>NewReplacementOpportunity</members>
-        <members>LoanerLendDeliver</members>
-        <members>NewOpportunity</members>
-        <members>SWOPage</members>
-        <members>SWOPageRead</members>
-        <name>ApexPage</name>
-    </types>
-    <types>
-        <members>AWSService</members>
-        <members>html2canvas</members>
-        <members>jspdf</members>
-        <name>StaticResource</name>
-    </types>
-    <version>52.0</version>
-</Package>
\ No newline at end of file
diff --git a/manifest/packageTriggerController.xml b/manifest/packageTriggerController.xml
index 65849ec..46080e1 100644
--- a/manifest/packageTriggerController.xml
+++ b/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>
diff --git a/manifest/packageUpdatePIPLCode.xml b/manifest/packageUpdatePIPLCode.xml
new file mode 100644
index 0000000..6ec0004
--- /dev/null
+++ b/manifest/packageUpdatePIPLCode.xml
@@ -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>
\ No newline at end of file

--
Gitblit v1.9.1