buli
2022-05-13 2f4492ee18f90274582fcc2bb06f5e9bf64136e8
force-app/main/default/pages/OrderPDF.page
@@ -1,5 +1,4 @@
<apex:page Controller="OrderPdfController" showHeader="false" sidebar="false" id="allPage" action="{!init2}" >
    <!-- <apex:page Controller="OrderPdfController" showHeader="false" sidebar="false" id="allPage" action="{!init2}" renderAs="pdf"> -->
<apex:page Controller="OrderPdfController" showHeader="false" sidebar="false" id="allPage" action="{!init2}" renderAs="pdf">
<html>
    <head>
        <style>
@@ -21,15 +20,12 @@
        </style>
    </head>
    <body style="font-family: Arial Unicode MS; page-break-inside: auto">
        <div id="pdf-wrapper">
            <div class="pdf-page">
                <table style="border-style:none;float: left;">
        <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">
                    <apex:outputPanel rendered="{!IF(Opp.ProductSegment__c = 'IE' || Opp.ProductSegment__c = 'RVI' || Opp.ProductSegment__c = 'BS'  && Opp.TradeType__c = 'Taxation', 'true', 'false')}" layout="none">
                                <div>报备单号</div>
                                <div>代理商全称</div>
                            </apex:outputPanel>
@@ -37,8 +33,7 @@
                        <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">
                    <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>
@@ -46,48 +41,41 @@
                        <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">
                    <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">
        <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">
                    <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">
                    <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">
                    <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">
                    <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">
                    <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">
                    <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>
@@ -101,9 +89,7 @@
                        <col width="25%" />
                        <col width="25%" />
                    </colgroup>
                    <tr>
                        <td colspan="4" height="5px"></td>
                    </tr>
            <tr><td colspan = "4" height="5px"></td></tr>
                    <tr>
                        <td colspan="4" style="text-align: center;font-size: 14pt;">合同</td>
                    </tr>
@@ -131,7 +117,7 @@
                    </apex:outputPanel>
                    <tr>
                        <td style="font-size: 8pt;">电话(Tel):&nbsp;</td>
                        <td colspan="3" style="font-size: 8pt;" id="Phone">{!specialDeliveryAddress.Phone}</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>
@@ -148,8 +134,7 @@
                        <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">
            <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>
@@ -174,12 +159,9 @@
                        </tr>
                    </apex:outputPanel>
        
                    <tr>
                        <td height="1px">&nbsp;</td>
                    </tr>
            <tr><td height="1px">&nbsp;</td></tr>
        
                    <apex:outputPanel rendered="{!IF((Opp.ProductSegment__c = 'BC' ) && Opp.TradeType__c = 'Tax Exemption', 'true', 'false')}"
                        layout="none">
            <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>
@@ -198,8 +180,7 @@
                        </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">
            <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>
@@ -213,8 +194,7 @@
                            <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">
            <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>
@@ -233,7 +213,7 @@
                        </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>
                <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_S_TEL__c}</td>
                        </tr>
                        <tr>
                            <td style="font-size: 8pt;">传真(FAX):&nbsp;</td>
@@ -269,12 +249,9 @@
                        </tr>
                    </apex:outputPanel>
        
                    <tr style="line-height: 4px">
                        <td height="1px">&nbsp;</td>
                    </tr>
            <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">
            <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> -->
@@ -300,7 +277,7 @@
                        </tr>
                        <tr>
                            <td style="font-size: 8pt;">传真(Fax):&nbsp;</td>
                            <td colspan="3" style="font-size: 8pt;" id="PDF_C_FAX__c">{!contra.order.PDF_C_FAX__c}</td>
                <td colspan = "3" style="font-size: 8pt;">{!contra.order.PDF_C_FAX__c}</td>
                        </tr>
                        <tr>
                            <td style="font-size: 8pt;">联系人:&nbsp;</td>
@@ -333,8 +310,7 @@
                        <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">
            <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>
@@ -353,15 +329,12 @@
                        </tr>
                    </apex:outputPanel>
        
                    <tr height="1px">
                        <td height="1px">&nbsp;</td>
                    </tr>
            <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">
            <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>
                <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>
@@ -385,15 +358,14 @@
                        </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>
                <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">
            <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>
@@ -416,12 +388,9 @@
                        </tr>
                    </apex:outputPanel>
        
                    <tr>
                        <td height="1px">&nbsp;</td>
                    </tr>
            <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">
            <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>
@@ -440,11 +409,10 @@
                        </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>
                <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">
            <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>
@@ -467,27 +435,21 @@
                        </tr>
                    </apex:outputPanel>
                </table>
            </div>
    
            <apex:outputPanel layout="none">
                <div style="page-break-after: always;" />
            </apex:outputPanel>
    
            <div class="pdf-page">
                <table style="font-size: 9pt;">
                    <tr>
                        <td style="text-align:left">
                            1. 兹经买卖双方同意, 缔结本合同并按本合同下述条款,买方同意购入及卖方同意出售以下货物:
                            <br/> 1. This Contract is made by and between the Buyer and the Seller,whereby the Buyer agrees to buy and
                            the Seller
                            <br/> agrees to sell the under-mentioned goods subject to the terms and conditions stipulated below:</td>
                1. 兹经买卖双方同意, 缔结本合同并按本合同下述条款,买方同意购入及卖方同意出售以下货物:<br/>
                1. This Contract is made by and between the Buyer and the Seller,whereby the Buyer agrees to buy and the Seller<br/>
                agrees to sell the under-mentioned goods subject to the terms and conditions stipulated below:</td>
                    </tr>
                    <tr>
                        <td style="text-align: right;">(USD)</td>
                    </tr>
            <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">
        <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>
@@ -508,31 +470,18 @@
        
                        <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>
                        <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">
        <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>
@@ -574,38 +523,16 @@
        
                        <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>
                        <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>
@@ -617,8 +544,7 @@
                        <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">
            <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"> -->
@@ -634,13 +560,10 @@
                        </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>
                    <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">
            <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;
@@ -664,9 +587,7 @@
                        </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>
                    <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>
@@ -680,91 +601,74 @@
                    </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/>
                    2. 生产国别及制造厂商:&nbsp;{!contra.order.PDF_Bi_manufacturers__c}<br/>
                    2. COUNTRY OF ORIGIN OF GOODS AND MANUFACTURERS:&nbsp;{!contra.order.PDF_Bi_manufacturersEn__c}<br/>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3">
                            3. 包装:
                            <br/> 商品應以坚固的出口纸皮箱或木箱包装,适于长途空运、天气或气候变化、防潮、抗震、防锈及多次搬运。由于包装不良而产生的
                            <br/> 直接损失, 由卖方负责。
                            <br/> 3. PACKING:
                            <br/> The goods should be packed in strong export carton box or wooden box, which is suitable for long haul
                            air transportation and
                            <br/> change of weather or climate, well protected against moisture, shocks, rust and withstand numerous transits.
                            All direct losses
                            <br/> incurred on account of improper packing shall be borne by the Seller.
                            <br/>
                    3. 包装: <br/>
                    商品應以坚固的出口纸皮箱或木箱包装,适于长途空运、天气或气候变化、防潮、抗震、防锈及多次搬运。由于包装不良而产生的<br/>
                    直接损失, 由卖方负责。<br/>
                    3. PACKING: <br/>
                    The goods should be packed in strong export carton box or wooden box, which is suitable for long haul air transportation and <br/>
                    change of weather or climate, well protected against moisture, shocks, rust and withstand numerous transits. All direct losses <br/>
                    incurred on account of improper packing shall be borne by the Seller.<br/>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3">
                            4.运输标识:
                            <br/> 卖方须在每件货物的包装外表上以不褪色的颜料标明件号、毛重、尺码及下列字句:
                            <br/> ”勿使受潮” 、“小心轻放”、 “此面向上”等字样及下列唛头:
                            <br/> 4. SHIPPING MARK:
                            <br/> The Seller shall mark on the surface of each package with fadeless paint, the package number,gross weight,measurement
                            <br/> and the following wordings:
                            <br/> “KEEP AWAY FROM MOISTURE”,“HANDLE WITH CARE” ,“THIS SIDE UP” etc. And the below shipping mark:
                            <br/>
                            <div>
                                <apex:outputField value="{!contra.order.PDF_Sp_SHIPPINGMARK__c}" />
                            </div>
                    4.运输标识: <br/>
                    卖方须在每件货物的包装外表上以不褪色的颜料标明件号、毛重、尺码及下列字句: <br/>
                    ”勿使受潮” 、“小心轻放”、 “此面向上”等字样及下列唛头:<br/>
                    4. SHIPPING MARK:  <br/>
                    The Seller shall mark on the surface of each package with fadeless paint, the package number,gross weight,measurement<br/>
                     and the following wordings:<br/>
                    “KEEP AWAY FROM MOISTURE”,“HANDLE WITH CARE” ,“THIS SIDE UP” etc. And the below shipping mark: <br/>
                    <div><apex:outputField value="{!contra.order.PDF_Sp_SHIPPINGMARK__c}" /></div>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3">
                            5.装运条款: {!contra.order.PDF_Sp_ShippingTerms__c}
                            <br/> 5.TERMS OF SHIPMENT: {!contra.ShippingTerms}
                            <br/>
                    5.装运条款: {!contra.order.PDF_Sp_ShippingTerms__c}<br/>
                    5.TERMS OF SHIPMENT: {!contra.ShippingTerms}<br/>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            6.交货期:
                            <apex:outputField value="{!contra.order.DeliveryTimeText__c}" />
                            <br/> 6.THE DELIVERY TIME:
                            <apex:outputField value="{!contra.order.DeliveryTimeTextEn__c}" />
                            <!-- <br/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&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/>
                    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/>
                    7.卖方应保留货物和零部件的产权和所有权,该等权利只有在全额收到货款时方自动转移到买方。<br/>
                    7.The Seller shall maintain title and ownership of the goods and spare parts thereof which shall automatically pass to the Buyer<br/>
                      only on receipt of the full payment.<br/>
                        </td>
                    </tr>
        
                    <tr>
                        <td colspan="3">
                            8. 装运口岸:&nbsp;{!contra.order.PDF_Sp_LOADING__c}
                            <br/> 8. PORT OF LOADING:&nbsp;{!contra.order.PDF_Sp_LOADING_E__c}
                            <br/>
                    8. 装运口岸:&nbsp;{!contra.order.PDF_Sp_LOADING__c}<br/>
                    8.  PORT OF LOADING:&nbsp;{!contra.order.PDF_Sp_LOADING_E__c}<br/>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3">
                            9. 目的口岸:&nbsp;{!contra.order.PDF_Sp_DestinationPort__c}
                            <br/> 9. PORT OF DESTINATION:&nbsp;{!contra.order.PDF_Sp_DestinationPort_E__c}
                            <br/>
                    9. 目的口岸:&nbsp;{!contra.order.PDF_Sp_DestinationPort__c}<br/>
                    9.  PORT OF DESTINATION:&nbsp;{!contra.order.PDF_Sp_DestinationPort_E__c}<br/>
                        </td>
                    </tr>
        
                    <tr>
                        <td colspan="3">
                            10. 保险:
                            <br/> 由卖方按发票金额的110%投保全险及战争险,并说明可以在中国境内索赔,空白背书。
                            <br/> 10. INSURANCE:
                            <br/> To be covered by the Seller for 110% of the invoice value covering all risks and war risk, indicating
                            claims payable in China,
                            <br/> in currency of the draft, blank endorsed.
                    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>
        
@@ -783,49 +687,36 @@
                <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/>
                    12. 所需的文件: <br/>
                    <apex:outputPanel rendered="{!IF((Opp.ProductSegment__c = 'IE' || Opp.ProductSegment__c = 'RVI' || Opp.ProductSegment__c = 'BS'|| Opp.ProductSegment__c = 'NDT' || Opp.ProductSegment__c = 'ANI') && Opp.TradeType__c = 'Taxation', 'true', 'false')}" layout="none">
                    1) {!contra.order.PDF_Bi_Quality__c}份由卖方出具的质量和数量证明;<br/>
                    2) {!contra.order.PDF_Bi_Origin__c}份卖方出具的原产地证明;及<br/>
                    3) {!contra.order.PDF_Bi_Non_Wooden__c}份非木质包装证明。<br/>
                            </apex:outputPanel>
                            <apex:outputPanel rendered="{!IF(Opp.TradeType__c = 'Tax Exemption', 'true', 'false')}" layout="none">
                                请在发货后{!contra.order.PDF_Bi_q1__c}个工作日内将以下所需的文件传真/电邮给买方;
                                <br/> 1) 空运提单正本{!contra.order.PDF_Bi_airway__c}份,副本{!contra.order.PDF_Bi_copyairway__c}份。并注明“运费已付”;
                                <br/> 2) 发票{!contra.order.PDF_Bi_invoice__c}份, 注明合同号和运输标识(如有一个以上运输标识, 应分别出具发票)及合同中其它细节;
                                <br/> 3) 如保险由卖方负责的情况下,卖方需提供保险单{!contra.order.PDF_Bi_Insurance__c}套,投一切险, 按发票金额110%投保一切险;
                                <br/> 4) {!contra.order.PDF_Bi_Packing__c}份由卖方出具的装箱单;
                                <br/> 5) {!contra.order.PDF_Bi_Quality__c}份由卖方出具的质量和数量证明;
                                <br/> 6) {!contra.order.PDF_Bi_Origin__c}份卖方出具的原产地证明;及
                                <br/> 7) {!contra.order.PDF_Bi_Non_Wooden__c}份非木质包装证明。
                                <br/>
                                <apex:outputPanel rendered="{!IF(Opp.ProductSegment__c = 'BS' || Opp.ProductSegment__c = 'ANI' ||Opp.ProductSegment__c = 'NDT', 'true', 'false')}"
                                    layout="none">
                                    8) 所有单据 {!contra.order.PDF_Bi_AllBill__c}
                                    <br/>
                    请在发货后{!contra.order.PDF_Bi_q1__c}个工作日内将以下所需的文件传真/电邮给买方;<br/>
                    1) 空运提单正本{!contra.order.PDF_Bi_airway__c}份,副本{!contra.order.PDF_Bi_copyairway__c}份。并注明“运费已付”;<br/>
                    2) 发票{!contra.order.PDF_Bi_invoice__c}份, 注明合同号和运输标识(如有一个以上运输标识, 应分别出具发票)及合同中其它细节;<br/>
                    3) 如保险由卖方负责的情况下,卖方需提供保险单{!contra.order.PDF_Bi_Insurance__c}套,投一切险, 按发票金额110%投保一切险;<br/>
                    4) {!contra.order.PDF_Bi_Packing__c}份由卖方出具的装箱单;<br/>
                    5) {!contra.order.PDF_Bi_Quality__c}份由卖方出具的质量和数量证明;<br/>
                    6) {!contra.order.PDF_Bi_Origin__c}份卖方出具的原产地证明;及<br/>
                    7) {!contra.order.PDF_Bi_Non_Wooden__c}份非木质包装证明。<br/>
                    <apex:outputPanel rendered="{!IF(Opp.ProductSegment__c = 'BS' || Opp.ProductSegment__c = 'ANI' ||Opp.ProductSegment__c = 'NDT', 'true', 'false')}" layout="none">
                    8) 所有单据 {!contra.order.PDF_Bi_AllBill__c}<br/>
                                </apex:outputPanel>
                                12. DOCUMENTS REQUIRED (please don’t attach any documents of contract value with the shipment):
                                <br/> Please fax/e-mail the below required documents to the Buyer within {!contra.order.PDF_Bi_q1__c}
                                working days after shipment;
                                <br/> 1) {!contra.order.PDF_Bi_airway__c} original and {!contra.order.PDF_Bi_copyairway__c} copy of clean
                                air waybills marked “freight prepaid”;
                                <br/> 2) Invoice in {!contra.order.PDF_Bi_invoice__c} copies indicating contract number and shipping mark
                                (in case of more than one shipping mark,the invoice shall be
                                <br/> issued separately), made out in details as per relative contract;
                                <br/> 3) Insurance Policy/Certificate in one original and {!contra.order.PDF_Bi_Insurance__c} copies for
                                110% of the invoice value if the insurance is bought by the Seller;
                                <br/> 4) Packing list in {!contra.order.PDF_Bi_Packing__c} copies issued by the Seller;
                                <br/> 5) Certificate of Quality and Quantity in {!contra.order.PDF_Bi_Quality__c} copies issued by the
                                Seller;
                                <br/> 6) Certificate of Origin in {!contra.order.PDF_Bi_Origin__c} copies issued by the Seller; and
                                <br/> 7) {!contra.order.PDF_Bi_Non_Wooden__c} Certificate of Non-wood material packing.
                                <br/>
                    12. DOCUMENTS REQUIRED (please don’t attach any documents of contract value with the shipment):<br/>
                    Please fax/e-mail the below required documents to the Buyer within {!contra.order.PDF_Bi_q1__c} working days after shipment;<br/>
                    1) {!contra.order.PDF_Bi_airway__c} original and {!contra.order.PDF_Bi_copyairway__c} copy of clean air waybills marked “freight prepaid”;<br/>
                    2) Invoice in {!contra.order.PDF_Bi_invoice__c} copies indicating contract number and shipping mark (in case of more than one shipping mark,the invoice shall be<br/>
                     issued separately), made out in details as per relative contract;<br/>
                    3) Insurance Policy/Certificate in one original and {!contra.order.PDF_Bi_Insurance__c} copies for 110% of the invoice value if the insurance is bought by the Seller;<br/>
                    4) Packing list in {!contra.order.PDF_Bi_Packing__c} copies issued by the Seller;<br/>
                    5) Certificate of Quality and Quantity in {!contra.order.PDF_Bi_Quality__c} copies issued by the Seller; <br/>
                    6) Certificate of Origin in {!contra.order.PDF_Bi_Origin__c} copies issued by the Seller; and<br/>
                    7) {!contra.order.PDF_Bi_Non_Wooden__c} Certificate of Non-wood material packing.<br/>
                                <apex:outputPanel rendered="{!IF(Opp.ProductSegment__c = 'BS', 'true', 'false')}" layout="none">
                                    8) All the documents {!contra.AllBills} cargo
                                    <br/>
                    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
@@ -836,108 +727,78 @@
        
                    <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/>
                    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">
            <apex:outputPanel rendered="{!IF(Opp.ProductSegment__c = 'BS' || Opp.ProductSegment__c = 'IE' || Opp.ProductSegment__c = 'RVI', 'true', 'false')}" layout="none">
                        <tr>
                            <td>
                                14. 质量保证:
                                <br/> A. 卖方保证本合同之货物是用最好的材料以上等的工艺制造,崭新及未用过的,其质量与规格一切方面与本合同的规定相符。
                                <br/> 保证期为最终验收报告签署之日起的{!contra.QAeng}但不超过发货日后的{!contra.QAeng4}。
                                <br/> 在保证期内,如买方按照货物使用说明书在正常条件下使用,由于卖方设计或制造上的缺陷而发生的损坏,由卖方负责。
                                <br/> 在保证期内如果货物的重要零部件需要更换,则该零部件的保证期从更换之日起重新计算,外购件以原供应商的保证期为准。
                                <br/> B. 如果双方共同商定并确认的供货范围中有遗漏的部件和设备并有可能导致整套货物不能按时验收投产或影响生产,卖方
                                <br/> 有义务和责任在制造过程中与买方商量做出相应的调整和补救,并保证整套以上货物能通过验收。
                                <br/> C. 本合同中所述的保证是适用于根据合同货物提供的的唯一保证。本保证条款取代并排除法律、惯例、法令或其他规定施加
                                <br/> 或默示的任何其他担保、保证和/或条件和/或因此而产生的责任。对于任何有缺陷的或不符合标准的货物,买方所适用的只有
                                <br/> 本条特别规定的救济。
                                <br/> 14. WARRANTY:
                                <br/> A.The Seller warrant that the goods hereof is made of the best materials with first class workmanship,
                                brand new and
                                <br/> unused and complies in all respects with the quality and specification stipulated in this Contract.
                                <br/> The warranty period shall be {!contra.QAeng3}counting from the date on which the goods have been
                                accepted by the end user
                                <br/> but limited to a maximum of {!contra.QAeng2} from the date of shipment.
                                <br/> Within the warranty period, the Seller shall be liable for the damage incurred on account of the
                                defects attributable to the design
                                <br/> and emerging during the course of manufacturing of the Seller’s side if the Buyer operate under
                                regular conditions in accordance
                                <br/> with the instruction to the equipments or the machines. Within the warranty period, if some important
                                units and parts of the goods
                                <br/> need to change, the warranty period of the new units and parts should be counted from the changing
                                date. If the new units and
                                <br/> parts are bought from the third party, the warranty period of the new units and parts should be
                                counted according to the original suppliers.
                                <br/> B.In case there’s any missing parts &amp; machines which are out of the agreed scope of supply and
                                most possibly would influence
                                <br/> the commissioning or production on time, the Seller has the obligation and responsibility to discuss
                                with Buyer to make concerned
                                <br/> adjustments and amendments to warrant the acceptance of the goods.
                                <br/> C. The warranty set out in this Contract is the only warranty applicable to the goods supplied pursuant
                                to this Contract. This
                                <br/> warranty replaces and excludes any other guarantee, warranty and/or condition imposed or implied
                                by law, custom, statute or
                                <br/> otherwise and/or resulting liabilities. Only those remedies specifically set out in this clause
                                are available to the Buyer
                                <br/> in respect of any defective or non-conforming goods.
                                <br/>
                    14. 质量保证:<br/>
                    A. 卖方保证本合同之货物是用最好的材料以上等的工艺制造,崭新及未用过的,其质量与规格一切方面与本合同的规定相符。<br/>
                    保证期为最终验收报告签署之日起的{!contra.QAeng}但不超过发货日后的{!contra.QAeng4}。<br/>
                    在保证期内,如买方按照货物使用说明书在正常条件下使用,由于卖方设计或制造上的缺陷而发生的损坏,由卖方负责。<br/>
                    在保证期内如果货物的重要零部件需要更换,则该零部件的保证期从更换之日起重新计算,外购件以原供应商的保证期为准。<br/>
                    B. 如果双方共同商定并确认的供货范围中有遗漏的部件和设备并有可能导致整套货物不能按时验收投产或影响生产,卖方<br/>
                    有义务和责任在制造过程中与买方商量做出相应的调整和补救,并保证整套以上货物能通过验收。<br/>
                    C. 本合同中所述的保证是适用于根据合同货物提供的的唯一保证。本保证条款取代并排除法律、惯例、法令或其他规定施加<br/>
                    或默示的任何其他担保、保证和/或条件和/或因此而产生的责任。对于任何有缺陷的或不符合标准的货物,买方所适用的只有<br/>
                    本条特别规定的救济。<br/>
                    14. WARRANTY:<br/>
                    A.The Seller warrant that the goods hereof is made of the best materials with first class workmanship, brand new and<br/>
                    unused and complies in all respects with the quality and specification stipulated in this Contract.<br/>
                    The warranty period shall be {!contra.QAeng3}counting from the date on which the goods have been accepted by the end user<br/>
                    but limited to a maximum of {!contra.QAeng2} from the date of shipment. <br/>
                    Within the warranty period, the Seller shall be liable for the damage incurred on account of the defects attributable to the design<br/>
                     and emerging during the course of manufacturing of the Seller’s side if the Buyer operate under regular conditions in accordance<br/>
                     with the instruction to the equipments or the machines. Within the warranty period, if some important units and parts of the goods<br/>
                     need to change, the warranty period of the new units and parts should be counted from the changing date. If the new units and<br/>
                      parts are bought from the third party, the warranty period of the new units and parts should be counted according to the original suppliers.<br/>
                    B.In case there’s any missing parts &amp; machines which are out of the agreed scope of supply and most possibly would influence <br/>
                    the commissioning or production on time, the Seller has the obligation and responsibility to discuss with Buyer to make concerned <br/>
                    adjustments and amendments to warrant the acceptance of the goods.<br/>
                    C. The warranty set out in this Contract is the only warranty applicable to the goods supplied pursuant to this Contract. This<br/>
                    warranty replaces and excludes any other guarantee, warranty and/or condition imposed or implied by law, custom, statute or <br/>
                    otherwise and/or resulting liabilities. Only those remedies specifically set out in this clause are available to the Buyer<br/>
                    in respect of any defective or non-conforming goods.<br/>
                            </td>
                        </tr>
                    </apex:outputPanel>
                    <apex:outputPanel rendered="{!IF(Opp.ProductSegment__c = 'NDT' || Opp.ProductSegment__c = 'ANI', 'true', 'false')}" layout="none">
                        <tr>
                            <td>
                                14. 质量保证:
                                <br/> A. 卖方保证本合同之货物是用最好的材料以上等的工艺制造,崭新及未用过的,其质量与规格一切方面与本合同的规定相符。
                                <br/> 保证期配件为3个月,主机为1年至3年,根据产品具体型号确定。
                                <br/> 在保证期内,如买方按照货物使用说明书在正常条件下使用,由于卖方设计或制造上的缺陷而发生的损坏,由卖方负责。
                                <br/> 在保证期内如果货物的重要零部件需要更换,则该零部件的保证期从更换之日起重新计算,外购件以原供应商的保证期为准。
                                <br/> B. 如果双方共同商定并确认的供货范围中有遗漏的部件和设备并有可能导致整套货物不能按时验收投产或影响生产,卖方
                                <br/> 有义务和责任在制造过程中与买方商量做出相应的调整和补救,并保证整套以上货物能通过验收。
                                <br/> C. 本合同中所述的保证是适用于根据合同货物提供的的唯一保证。本保证条款取代并排除法律、惯例、法令或其他规定施加
                                <br/> 或默示的任何其他担保、保证和/或条件和/或因此而产生的责任。对于任何有缺陷的或不符合标准的货物,买方所适用的只有
                                <br/> 本条特别规定的救济。
                                <br/> 14. WARRANTY:
                                <br/> A.The Seller warrant that the goods hereof is made of the best materials with first class workmanship,
                                brand new and unused and
                                <br/> complies in all respects with the quality and specification stipulated in this Contract.
                                <br/> The warranty period shall be three months for accessory, 1-3 years for instrument.
                                <br/> counting from the date on which the goods have been accepted by the end user but limited to a maximum
                                of
                                <br/> {!contra.QAeng2} from the date of shipment.
                                <br/> Within the warranty period, the Seller shall be liable for the damage incurred on account of the
                                defects attributable to the design
                                <br/> and emerging during the course of manufacturing of the Seller’s side if the Buyer operate under
                                regular conditions in accordance
                                <br/> with the instruction to the equipments or the machines. Within the warranty period, if some important
                                units and parts of the goods
                                <br/> need to change, the warranty period of the new units and parts should be counted from the changing
                                date. If the new units and
                                <br/> parts are bought from the third party, the warranty period of the new units and parts should be
                                counted according to the original suppliers.
                                <br/> B.In case there’s any missing parts &amp; machines which are out of the agreed scope of supply and
                                most possibly would influence
                                <br/> the commissioning or production on time, the Seller has the obligation and responsibility to discuss
                                with Buyer to make concerned
                                <br/> adjustments and amendments to warrant the acceptance of the goods.
                                <br/> C. The warranty set out in this Contract is the only warranty applicable to the goods supplied pursuant
                                to this Contract. This
                                <br/> warranty replaces and excludes any other guarantee, warranty and/or condition imposed or implied
                                by law, custom, statute or
                                <br/> otherwise and/or resulting liabilities. Only those remedies specifically set out in this clause
                                are available to the Buyer
                                <br/> in respect of any defective or non-conforming goods.
                                <br/>
                    14. 质量保证:<br/>
                    A. 卖方保证本合同之货物是用最好的材料以上等的工艺制造,崭新及未用过的,其质量与规格一切方面与本合同的规定相符。<br/>
                    保证期配件为3个月,主机为1年至3年,根据产品具体型号确定。<br/>
                    在保证期内,如买方按照货物使用说明书在正常条件下使用,由于卖方设计或制造上的缺陷而发生的损坏,由卖方负责。<br/>
                    在保证期内如果货物的重要零部件需要更换,则该零部件的保证期从更换之日起重新计算,外购件以原供应商的保证期为准。<br/>
                    B. 如果双方共同商定并确认的供货范围中有遗漏的部件和设备并有可能导致整套货物不能按时验收投产或影响生产,卖方<br/>
                    有义务和责任在制造过程中与买方商量做出相应的调整和补救,并保证整套以上货物能通过验收。<br/>
                    C. 本合同中所述的保证是适用于根据合同货物提供的的唯一保证。本保证条款取代并排除法律、惯例、法令或其他规定施加<br/>
                    或默示的任何其他担保、保证和/或条件和/或因此而产生的责任。对于任何有缺陷的或不符合标准的货物,买方所适用的只有<br/>
                    本条特别规定的救济。<br/>
                    14. WARRANTY:<br/>
                    A.The Seller warrant that the goods hereof is made of the best materials with first class workmanship, brand new and unused and<br/>
                     complies in all respects with the quality and specification stipulated in this Contract. <br/>
                    The warranty period shall be three months for accessory, 1-3 years for instrument.<br/>
                    counting from the date on which the goods have been accepted by the end user but limited to a maximum of<br/>
                      {!contra.QAeng2} from the date of shipment. <br/>
                    Within the warranty period, the Seller shall be liable for the damage incurred on account of the defects attributable to the design<br/>
                     and emerging during the course of manufacturing of the Seller’s side if the Buyer operate under regular conditions in accordance<br/>
                     with the instruction to the equipments or the machines. Within the warranty period, if some important units and parts of the goods<br/>
                     need to change, the warranty period of the new units and parts should be counted from the changing date. If the new units and<br/>
                      parts are bought from the third party, the warranty period of the new units and parts should be counted according to the original suppliers.<br/>
                    B.In case there’s any missing parts &amp; machines which are out of the agreed scope of supply and most possibly would influence <br/>
                    the commissioning or production on time, the Seller has the obligation and responsibility to discuss with Buyer to make concerned <br/>
                    adjustments and amendments to warrant the acceptance of the goods.<br/>
                    C. The warranty set out in this Contract is the only warranty applicable to the goods supplied pursuant to this Contract. This<br/>
                    warranty replaces and excludes any other guarantee, warranty and/or condition imposed or implied by law, custom, statute or <br/>
                    otherwise and/or resulting liabilities. Only those remedies specifically set out in this clause are available to the Buyer<br/>
                    in respect of any defective or non-conforming goods.<br/>
                            </td>
                        </tr>
                    </apex:outputPanel>
@@ -948,42 +809,28 @@
                <table style="font-size: 9pt;">
                    <tr>
                        <td>
                            15. 检验与索赔:
                            <br/> (1)交货之前,制造厂应对货物的质量规格、性能和数量进行精确和全面的检查并出具证明货物与本合同规定相符的证明书。
                            <br/> (2)货物到目的港或目的地后90天内,以较早者为准,买方應向中国出入境检验检疫局申请对有关货物的质量、规格和数量进
                            <br/> 行初步检验并由其出具检验报告。如中国出入境检验检疫局发现到货物的规格或/和数量与本合同规定不符,除应由保险公司或
                            <br/> 船运公司负责外,买方有权拒收货物或向卖方提出赔偿。
                            <br/> (3)如货物的质量和规格与本合同不符,或在本合同第13条规定的保证期内证明货物有缺陷,买方应申请中国出入境检验检疫
                            <br/> 局检验,并有权根据该检验报告向卖方提出索赔。
                            <br/> (4)卖方对与本合同不符部分,应在合理的期限内无偿换货或补发短缺或贬低货价,并负担由此产生的一切费用和损失,包括:
                            <br/> 利息、银行费用、运费、保险费、检验费、仓储、码头装卸费以及其他一切必要费用。
                            <br/> 15. INSPECTION AND CLAIMS:
                            <br/> (1)The manufacturer shall,before making delivery,make a precise and comprehensive inspection of the
                            goods with regard
                            <br/> to the quality, specification and quantity and issue certificates certifying that the goods are in conformity
                            with the stipulations of
                            <br/> the Contract.
                            <br/> (2)Within ninety (90) days after arrival of the goods at the port of destination or the place of destination,
                            whichever is the earlier,
                            <br/> the Buyer shall apply to the China Entry &amp; Exit Inspection &amp; Quarantine Bureau (CIQ) for a preliminary
                            inspection in respect of the
                            <br/> quality, specification and quantity of the goods and a survey report shall be issued thereof. If discrepancies
                            are found by the CIQ
                            <br/> regarding specifications or the quantity or both, except when the responsibilities lie with Insurance
                            Company or Shipping Company,
                            <br/> the Buyer has the right to reject the goods or to claim against the Seller.
                            <br/> (3)Should the quality and specification of the goods not in conformity with the Contract or should the
                            goods be proved defective
                            <br/> during the warranty period stipulated in Clause 13, the Buyer shall arrange for a survey to be carried
                            out by the CIQ and have the
                            <br/> right to claim against the Seller on the strength of the survey report.
                            <br/> (4)For any goods which are not in conformity with the Contract, the Seller,within a reasonable time,shall
                            make replacement
                            <br/>free of charge,deliver the short ones or devalue the goods and bear all the charges and losing incurred
                            thereof. The charges
                            <br/>include interest, banking charges, freight, premium, inspecting charges, storing charges, discharging
                            charges and other charges
                            <br/>incurred since the goods are not in conformity with the contract.
                    15. 检验与索赔:<br/>
                    (1)交货之前,制造厂应对货物的质量规格、性能和数量进行精确和全面的检查并出具证明货物与本合同规定相符的证明书。<br/>
                    (2)货物到目的港或目的地后90天内,以较早者为准,买方應向中国出入境检验检疫局申请对有关货物的质量、规格和数量进<br/>
                    行初步检验并由其出具检验报告。如中国出入境检验检疫局发现到货物的规格或/和数量与本合同规定不符,除应由保险公司或<br/>
                    船运公司负责外,买方有权拒收货物或向卖方提出赔偿。<br/>
                    (3)如货物的质量和规格与本合同不符,或在本合同第13条规定的保证期内证明货物有缺陷,买方应申请中国出入境检验检疫<br/>
                    局检验,并有权根据该检验报告向卖方提出索赔。<br/>
                    (4)卖方对与本合同不符部分,应在合理的期限内无偿换货或补发短缺或贬低货价,并负担由此产生的一切费用和损失,包括:<br/>
                    利息、银行费用、运费、保险费、检验费、仓储、码头装卸费以及其他一切必要费用。<br/>
                    15. INSPECTION AND CLAIMS:<br/>
                    (1)The manufacturer shall,before making delivery,make a precise and comprehensive inspection of the goods with regard<br/>
                     to the quality, specification and quantity and issue certificates certifying that the goods are in conformity with the stipulations of<br/>
                      the Contract. <br/>
                    (2)Within ninety (90) days after arrival of the goods at the port of destination or the place of destination, whichever is the earlier,<br/>
                      the Buyer shall apply to the China Entry &amp; Exit Inspection &amp; Quarantine Bureau (CIQ) for a preliminary inspection in respect of the<br/>
                      quality, specification and quantity of the goods and a survey report shall be issued thereof. If discrepancies are found by the CIQ<br/>
                      regarding specifications or the quantity or both, except when the responsibilities lie with Insurance Company or Shipping Company,<br/>
                      the Buyer has the right to reject the goods or to claim against the Seller.<br/>
                    (3)Should the quality and specification of the goods not in conformity with the Contract or should the goods be proved defective <br/>
                    during the warranty period stipulated in Clause 13, the Buyer shall arrange for a survey to be carried out by the CIQ and have the<br/>
                     right to claim against the Seller on the strength of the survey report.<br/>
                    (4)For any goods which are not in conformity with the Contract, the Seller,within a reasonable time,shall make replacement <br/>free of charge,deliver the short ones or devalue the goods and bear all the charges and losing incurred thereof. The charges <br/>include interest, banking charges, freight, premium, inspecting charges, storing charges, discharging charges and other charges <br/>incurred since the goods are not in conformity with the contract.
                        </td>
                    </tr>
                    <!-- </table>
@@ -993,114 +840,82 @@
                    <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.
                        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/>
                        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/>
                        18. 专利权:<br/>
                        卖方必须保障买方在中国使用其货物及其任何部分不受到第三方关于侵犯专利权、商标权或工业设计权的指控。任何第三方如果提出侵<br/>
                        权指控,卖方须与第三方交涉并承担由此引起的一切法律责任和费用。<br/>
                        18. PATENT RIGHTS<br/>
                        The Seller shall indemnify the Buyer against all third-party claims of infringement of patent, trademark, or industrial design rights <br/>
                        arising from use of the goods or any part thereof in China. In case any third party brings a charge of infringement, the Seller shall<br/>
                         negotiate with the third-party and be liable for any legal duty and expenses.<br/>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            19. 合同文件及资料的使用:
                            <br/> (1)在未经买方书面同意的情况下,卖方不得将由买方或代表买方提供的有关合同条文、规格、计划、图纸、模型、样品或资料提供
                            <br/> 给与履行本合同无关的任何人。即使向与履行本合同有关的人员提供,也应注意保密并仅限于履行合同必须的范围。
                            <br/> (2)除非执行合同需要,在事先未得到买方书面同意的情况下,卖方不得使用条款(1)中所列举的任何文件和资料。
                            <br/> (3)除合同本身外,条款(1)列明的所有文件始终为买方的财产,若买方要求,卖方应于其合同义务履行完毕以后将这些文件及全
                            <br/> 部复制件退还给买方。
                            <br/> 19. USE OF CONTRACT’S DOCUMENTS AND INFORMATION:
                            <br/> (1) The Seller shall not, without the Buyer’s prior written consent, disclose this Contract, or any
                            provision hereof, or any
                            <br/> specification, plan, drawing, pattern, sample, or information furnished by or on behalf of the Buyer
                            in connection therewith, to any
                            <br/> person other than the person employed by the Seller in the performance of this Contract. Disclosure
                            to any such employed person
                            <br/> shall be made in confidence and shall extend only so far as may be necessary for purposes of such performance.
                            <br/> (2) The Seller shall not, without the Buyer’s prior written consent, make use of any document or information
                            enumerated in
                            <br/> Clause (1) except for purposes of performing this Contract.
                            <br/> (3) Any document, other than this Contract itself, enumerated in Clause (1) shall remain the property
                            of the Buyer and shall be
                            <br/> returned (including all copies) to the Buyer on completion of the Seller’s performance under this Contract
                            if so required by the Buyer.
                            <br/>
                        19. 合同文件及资料的使用: <br/>
                        (1)在未经买方书面同意的情况下,卖方不得将由买方或代表买方提供的有关合同条文、规格、计划、图纸、模型、样品或资料提供<br/>
                        给与履行本合同无关的任何人。即使向与履行本合同有关的人员提供,也应注意保密并仅限于履行合同必须的范围。<br/>
                        (2)除非执行合同需要,在事先未得到买方书面同意的情况下,卖方不得使用条款(1)中所列举的任何文件和资料。<br/>
                        (3)除合同本身外,条款(1)列明的所有文件始终为买方的财产,若买方要求,卖方应于其合同义务履行完毕以后将这些文件及全<br/>
                        部复制件退还给买方。<br/>
                        19. USE OF CONTRACT’S DOCUMENTS AND INFORMATION: <br/>
                        (1) The Seller shall not, without the Buyer’s prior written consent, disclose this Contract, or any provision hereof, or any<br/>
                         specification, plan, drawing, pattern, sample, or information furnished by or on behalf of the Buyer in connection therewith, to any <br/>
                         person other than the person employed by the Seller in the performance of this Contract. Disclosure to any such employed person<br/>
                         shall be made in confidence and shall extend only so far as may be necessary for purposes of such performance. <br/>
                        (2) The Seller shall not, without the Buyer’s prior written consent, make use of any document or information enumerated in<br/>
                         Clause (1) except for purposes of performing this Contract.<br/>
                        (3) Any document, other than this Contract itself, enumerated in Clause (1) shall remain the property of the Buyer and shall be<br/>
                         returned (including all copies) to the Buyer on completion of the Seller’s performance under this Contract if so required by the Buyer. <br/>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            20. 仲裁:
                            <br/> 与本合同有关的或因执行本合同所发生的一切争执,由签订合同的双方友好协商解决。若不能解决时,案件可提交中国国际经济贸易
                            <br/> 仲裁委员会仲裁。仲裁按原合同进行。仲裁委员会的裁决为最终决定,签约双方都应服从;任何一方均不得向法院或其他当局求助申
                            <br/> 请修改该裁决。或者在双方同意的第三国或地区进行仲裁。仲裁费用由双方方负担。在仲裁期间,除了在仲裁过程中进行仲裁的部分
                            <br/> 外,本合同应继续执行。
                            <br/> 20. ARBITRA
                            <br/> All disputes in connection with this Contract or the execution thereof shall be settled friendly through
                            negotiation by the parties hereof.
                            <br/> In case no settlement can be reached, the case may then be submitted for arbitration to the China International
                            Economic and Trade
                            <br/> Arbitration Commission, in accordance with the Rulers of Procedures promulgated by they said Arbitration
                            Commission. The
                            <br/> arbitration shall take place in China and the decision of the Arbitration Commission shall be final
                            and binding upon both parties,
                            <br/> neither party shall seek recourse to a law court or other authorities to appeal to revision of the decision.
                            Or the arbitration may be
                            <br/> taken place in a third country or place mutually agreed by both parties. Arbitration fee shall be borne
                            by continue to execute
                            <br/> this Contract except those under arbitration.
                            <br/>
                        20. 仲裁:<br/>
                        与本合同有关的或因执行本合同所发生的一切争执,由签订合同的双方友好协商解决。若不能解决时,案件可提交中国国际经济贸易<br/>
                        仲裁委员会仲裁。仲裁按原合同进行。仲裁委员会的裁决为最终决定,签约双方都应服从;任何一方均不得向法院或其他当局求助申<br/>
                        请修改该裁决。或者在双方同意的第三国或地区进行仲裁。仲裁费用由双方方负担。在仲裁期间,除了在仲裁过程中进行仲裁的部分<br/>
                        外,本合同应继续执行。<br/>
                        20. ARBITRA<br/>
                        All disputes in connection with this Contract or the execution thereof shall be settled friendly through negotiation by the parties hereof.<br/>
                        In case no settlement can be reached, the case may then be submitted for arbitration to the China International Economic and Trade<br/>
                        Arbitration Commission, in accordance with the Rulers of Procedures promulgated by they said Arbitration Commission. The <br/>
                        arbitration shall take place in China and the decision of the Arbitration Commission shall be final and binding upon both parties, <br/>
                        neither party shall seek recourse to a law court or other authorities to appeal to revision of the decision. Or the  arbitration may be <br/>
                        taken place in a third country or place mutually agreed by both parties. Arbitration fee shall be borne by continue to execute<br/>
                         this Contract except those under arbitration. <br/>
                        </td>
                    </tr>
                </table>
@@ -1114,76 +929,58 @@
                    </colgroup>
                    <tr>
                        <td colspan="2">
                            21. 进出口许可证:
                            <br/> 进口本合同项下货物所需的中国政府及海关要求的进口许可证和其他进口文件由买方负责办理。出口本合同项下货物所需的出口国政
                            <br/> 府及海关要求的出口许可证和其他出口文件由卖方负责办理。
                            <br/> 21. IMPORT AND EXPORT LICENCES:
                            <br/> It is the responsibility of the Buyer to arrange import licenses or other import documents, if required
                            for the goods covered by this
                            <br/> Contract from the Chinese Government and Custom at the Buyer’s expense. It is the responsibility of
                            the Seller to arrange export
                            <br/> licenses or other export documents, if required for the Goods covered by this Contract from its country
                            Government and Custom at
                            <br/> the Seller’s expense.
                            <br/>
                        21. 进出口许可证:<br/>
                        进口本合同项下货物所需的中国政府及海关要求的进口许可证和其他进口文件由买方负责办理。出口本合同项下货物所需的出口国政<br/>
                        府及海关要求的出口许可证和其他出口文件由卖方负责办理。<br/>
                        21. IMPORT AND EXPORT LICENCES: <br/>
                        It is the responsibility of the Buyer to arrange import licenses or other import documents, if required for the goods covered by this <br/>
                        Contract from the Chinese Government and Custom at the Buyer’s expense. It is the responsibility of the Seller to arrange export<br/>
                         licenses or other export documents, if required for the Goods covered by this Contract from its country Government and Custom at<br/>
                          the Seller’s expense.<br/>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            22. 税费:
                            <br/> 中国政府根据现行税法向买方征收的与履行本合同有关的一切税费由买方支付。
                            <br/> 中国政府根据现行税法向卖方征收的与履行本合同有关的一切税费由卖方支付。
                            <br/> 发生在中国境外的,与履行本合同有关的一切税费,应由卖方承担。
                            <br/> 22. TAX AND DUTIES:
                            <br/> All taxes in connection with the execution of this Contract levied by the Chinese Government on the
                            Buyer in accordance with the
                            <br/> tax laws in effect shall be borne by the Buyer.All taxes in connection with the execution of this Contract
                            levied by the Chinese
                            <br/> Government on the Seller in accordance with the tax laws in effect shall be borne by the Seller. All
                            taxes arising outside China in
                            <br/> connection with the execution of this Contract shall be borne by the Seller.
                            <br/>
                        22. 税费:<br/>
                        中国政府根据现行税法向买方征收的与履行本合同有关的一切税费由买方支付。<br/>
                        中国政府根据现行税法向卖方征收的与履行本合同有关的一切税费由卖方支付。<br/>
                        发生在中国境外的,与履行本合同有关的一切税费,应由卖方承担。<br/>
                        22. TAX AND DUTIES:<br/>
                        All taxes in connection with the execution of this Contract levied by the Chinese Government on the Buyer in accordance with the<br/>
                         tax laws in effect shall be borne by the Buyer.All taxes in connection with the execution of this Contract levied by the Chinese<br/>
                         Government on the Seller in accordance with the tax laws in effect shall be borne by the Seller. All taxes arising outside China in<br/>
                         connection with the execution of this Contract shall be borne by the Seller. <br/>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            23.适用法律:
                            <br/> 本合同应按照中华人民共和国的法律管辖及解释。
                            <br/> 23. APPLICABLE LAW:
                            <br/> This Contract shall be governed and construed in accordance with the laws of People’s Republic of China.
                            <br/>
                        23.适用法律:<br/>
                        本合同应按照中华人民共和国的法律管辖及解释。<br/>
                        23. APPLICABLE LAW:<br/>
                        This Contract shall be governed and construed in accordance with the laws of People’s Republic of China.<br/>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            24.其他:
                            <br/> (1)本合同应以中文和英文书写,如中文和英文版本之间有任何不一致,则以英文本为主。技术图纸,买卖双方的所有函电以及与合
                            <br/> 同有关的文件均应以中文或英文书写。
                            <br/> (2)除技术规格中另有规定外,计量单位均使用公制。
                            <br/> (3)欲对合同条款做出任何修改,均须由买卖双方签署书面的合同修改书。
                            <br/> (4)本合同所有附件将是本合同不可分割的组成部分并具有同等效力。
                            <br/> (5)未在本合同中说明的商务惯例应符合INCOTERMS 2000条款的规定。
                            <br/> (6)本合同由买卖双方签订后立即生效。
                            <br/> &nbsp;&nbsp;此合同由买卖双方签署正本 {!contra.order.PDF_Co_Contract__c}份。 买方持有 {!contra.order.PDF_Co_BContra__c}份。
                            卖方持有 {!contra.order.PDF_Co_SContra__c}份。
                            <br/> 24. OTHERS:
                            <br/> (1)This Contract shall be written in both Chinese and English, in case there is any inconsistency between
                            the Chinese version
                            <br/> and the English version, the English version shall prevail. The technical drawings, all correspondence
                            and other documents
                            <br/>pertaining to this Contract exchanged by the parties shall be written in Chinese or English.
                            <br/> (2)All measurement shall be in SI unit, unless otherwise specified in the Technical Specifications.
                            <br/> (3)No variation in or modification of the terms of this Contract shall be valid except by written amendment
                            signed by the parties.
                            <br/> (4)All appendixes to this Contract shall be formed as an integral part of this Contract and shall be
                            equally effective.
                            <br/> (5) The commercial customs not described in this Contract shall be in accordance with the terms and
                            conditions of INCOTERMS
                            <br/> 2000.
                            <br/> (6)This Contract shall become effective upon execution by the Buyer and the Seller.
                            <br/> Both parties sign this Contract in {!contra.order.PDF_Co_Contract_E__c} .The buyer holds {!contra.order.PDF_Co_BContra_E__c}
                            .The seller holds {!contra.order.PDF_Co_SContra_E__c} .
                            <br/>
                        24.其他:<br/>
                        (1)本合同应以中文和英文书写,如中文和英文版本之间有任何不一致,则以英文本为主。技术图纸,买卖双方的所有函电以及与合<br/>
                        同有关的文件均应以中文或英文书写。<br/>
                        (2)除技术规格中另有规定外,计量单位均使用公制。<br/>
                        (3)欲对合同条款做出任何修改,均须由买卖双方签署书面的合同修改书。<br/>
                        (4)本合同所有附件将是本合同不可分割的组成部分并具有同等效力。<br/>
                        (5)未在本合同中说明的商务惯例应符合INCOTERMS 2000条款的规定。<br/>
                        (6)本合同由买卖双方签订后立即生效。<br/>
                        &nbsp;&nbsp;此合同由买卖双方签署正本 {!contra.order.PDF_Co_Contract__c}份。 买方持有 {!contra.order.PDF_Co_BContra__c}份。 卖方持有 {!contra.order.PDF_Co_SContra__c}份。<br/>
                        24. OTHERS:<br/>
                        (1)This Contract shall be written in both Chinese and English, in case there is any inconsistency between the Chinese version <br/>
                        and the English version, the English version shall prevail. The technical drawings, all correspondence and other documents <br/>pertaining to this Contract exchanged by the parties shall be written in Chinese or English.<br/>
                        (2)All measurement shall be in SI unit, unless otherwise specified in the Technical Specifications.<br/>
                        (3)No variation in or modification of the terms of this Contract shall be valid except by written amendment signed by the parties.<br/>
                        (4)All appendixes to this Contract shall be formed as an integral part of this Contract and shall be equally effective.<br/>
                        (5) The commercial customs not described in this Contract shall be in accordance with the terms and conditions of INCOTERMS <br/>
                        2000.<br/>
                        (6)This Contract shall become effective upon execution by the Buyer and the Seller. <br/>
                        Both parties sign this Contract in {!contra.order.PDF_Co_Contract_E__c} .The buyer holds {!contra.order.PDF_Co_BContra_E__c} .The seller holds {!contra.order.PDF_Co_SContra_E__c} .<br/>
                        </td>
                    </tr>
                    <tr>
@@ -1218,9 +1015,7 @@
                            [*]&nbsp;&nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" height="100px"></td>
                    </tr>
                <tr><td colspan = "2" height="100px"></td></tr>
                    <tr>
                        <td>
                            签名:&nbsp;&nbsp;
@@ -1249,8 +1044,7 @@
                            Title: &nbsp;&nbsp;Division Manager
                        </td>
                        <td>
                            Title: &nbsp;&nbsp;
                            <span id="PDF_Sign_Title__c">{!contra.order.PDF_Sign_Title__c}</span>
                        Title: &nbsp;&nbsp;{!contra.order.PDF_Sign_Title__c}
                        </td>
                    </tr>
                    <tr>
@@ -1270,11 +1064,9 @@
                        </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>
@@ -1310,12 +1102,8 @@
                                <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>
                                <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>
@@ -1336,8 +1124,7 @@
                    </apex:repeat>
                </apex:outputPanel>
        
                <apex:outputPanel rendered="{!IF(Opp.ProductSegment__c = 'IE' || Opp.ProductSegment__c = 'RVI' || Opp.ProductSegment__c = 'BS' , 'false', 'true')}"
                    layout="none">
         <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>
@@ -1349,250 +1136,15 @@
                        <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>
                        <td style="text-align: center;"><apex:outputText value="{!ndt.U8_Code__c}" style="width: 95%"/></td>
                        <td style="text-align: center;"><apex:outputText value="{!ndt.Part_Number__c}" style="width: 95%"/></td>
                        <td style="text-align: center;"><apex:outputText value="{!ndt.Quantity__c}" style="width: 95%; text-align: center;"/></td>
                        <td style="text-align: center;"><apex:outputText value="{!ndt.Name_of_Goods__c}" style="width: 95%"/></td>
                            </tr>
                        </apex:repeat>
                    </table>
                </apex:outputPanel>
            </div>
            
        </div>
    </body>
    <style>
        /* 20220221 PI改造 by 徐亮 start */
        body{margin: 0 auto;width: 780px;}
        .title1{height: 30px;}
        .title2{height: 110px;}
        /* 20220221 PI改造 by 徐亮 end */
    </style>
    <!-- 20220221 PI改造 by 徐亮 start  -->
    <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" />
    <script src="../../soap/ajax/53.0/connection.js" type="text/javascript"></script>
    <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/>
    <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
    <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
    <apex:includeScript value="{!URLFOR($Resource.jspdf)}"/>
    <apex:includeScript value="{!URLFOR($Resource.html2canvas)}"/>
    <script>
        AWSService.sfSessionId = '{!GETSESSIONID()}';
        sforce.connection.serverUrl = '{!$Site.Prefix}/services/Soap/u/53.0';
        var staticResourceContact = JSON.parse('{!staticResourceContact}');
        var staticResourceOrder = JSON.parse('{!staticResourceOrder}');
        var staticResourceFile = JSON.parse('{!staticResourceFile}');
        function Fun(pdf) {
            var form = jQuery("<form method='post'></form>");
            jQuery(document.body).append(form);
            let href = window.location.href
            let arr = href.split('/')
            form.attr({ "action": staticResourceFile.hostUrl + staticResourceFile.extraInfo + "?from=" + encodeURIComponent(href) + "&fileName=" + encodeURIComponent(arr[arr.length - 1].split('?')[0]) });
            // form.attr({"action":"http://127.0.0.1:8080/a/d?from="+encodeURIComponent(window.location.href)});
            let input = jQuery("<input type='hidden'/>");
            input.attr({ "name": "base64Str" });
            input.val(pdf.output('datauristring').substr(28));
            form.append(input);
            form.submit();
            // jQuery("body > *").each(function(){
            //  jQuery(this).css('display','none');
            // })
            // jQuery("body").append('<embed style="position:absolute; left: 0; top: 0;" width="100%" height="100%" src="'+pdf.output('datauristring')+'" type="application/pdf"/>')
        }
        let id = "pdf-wrapper";
        var target = document.getElementById(id);
        // 把imageDta转换成url
            // page_height:一页的高度
            function ImageDataToUrl(img_data,page_height){
                let cvs = document.createElement("CANVAS");
                cvs.width = img_data.width;
                cvs.height = page_height;
                var ctx= cvs.getContext("2d");
                ctx.fillStyle="white";
                ctx.fillRect(0,0,cvs.width,cvs.height);// 填充canvas所有区域为白色
                let aheight = img_data.height
                for (let i = 0;  i < img_data.height && img_data.height > page_height-5; i++) {
                    aheight = img_data.height-i;
                    let index = img_data.width*4*(aheight-1)
                    let blank_count=0;
                    for (let j = 0; j < img_data.width * 4; j+=4) {
                        if (img_data.data[index+j] > 222 && img_data.data[index+j+1] > 222 && img_data.data[index+j+2] > 222) {
                            //console.log(img_data.data[index+j] + ',' + img_data.data[index+j+1] + ',' + img_data.data[index+j+2]);
                            blank_count++;
                        }else{
                            //console.log(index + ',' + j);
                        }
                    }
                    if (blank_count > img_data.width * 0.99) {
                        break;
                    }
                }
                ctx.putImageData(img_data,0,0,0,0,img_data.width,aheight);
                return {
                    data : cvs.toDataURL('image/jpeg', 1.0),
                    height : aheight
                };
            }
            function jsPdfDownload() {
                let jtargets = jQuery("#pdf-wrapper .pdf-page");
                let j_arr = new Array(jtargets.length + 1).join(0).split('').map(function () { return false });
                let landscape = false;
                let pw = 595.28;
                let ph = 841.89;
                const marginw = 40;
                const marginh = 40;
                let orientation = '';
                if (landscape) {
                    pw += ph; ph = pw - ph; pw = pw - ph;
                    orientation = 'l';
                }
                var pdf = new jsPDF(orientation, 'pt', 'a4');// 第一个参数填字母l,注意不是数字1,为横向pdf
                jtargets.each(function (i, e) {
                    e.style.background = "#FFFFFF";
                })
                let rei = 0;
                let recursion = null;
                recursion = function (i) {
                    if (i >= jtargets.length) {
                        Fun(pdf);
                        return;
                    }
                    e = jtargets[i];
                    html2canvas(e, {
                        scale: 2,
                        onrendered: function (canvas) {
                            /**
                            本方法需要做几个事情
                            1.需要把canvas的内容分页显示到pdf的页中
                            2.canvas的宽高需要和pdf的宽高进行映射
                            3.截取到的内容需要放进一页宽高的canvas里面,并对其余区域刷白
                            */
                            var ctx = canvas.getContext("2d");
                            let canvas_max_page_num = 9;
                            let canvas_current_page_num = 0;
                            var contentWidth = canvas.width;
                            var contentHeight = canvas.height;
                            //未生成pdf的html页面高度
                            var leftHeight = contentHeight;
                            //页面偏移
                            var position = 0;
                            //a4纸的尺寸[595.28,841.89],html页面生成的canvas在pdf中图片的宽高
                            var outputWidth = pw - 2 * marginw;//595.28//左右边距20
                            let rate = outputWidth / 780;//输出宽度和内容宽度的比例
                            var outputHeight = ph - 2 * marginh;//左右边距20
                            let onePdfPageInCanvasHeight = contentWidth/outputWidth*outputHeight;//一页pdf在canvas中的高度;
                            //var pageData = canvas.toDataURL('image/jpeg', 1.0);
                            var pageData = null;
                            var imgData = null;
                            var captureHeight = null;// 截取的当前canvas页的高度
                            let j = i;
                            while(position < contentHeight){
                                if (j++) {
                                    pdf.addPage();
                                }
                                if(position+onePdfPageInCanvasHeight>contentHeight){
                                    captureHeight = contentHeight-position;
                                }else{
                                    captureHeight = onePdfPageInCanvasHeight;
                                }
                                imgData = ctx.getImageData(0,position,contentWidth,captureHeight);
                                pageData = ImageDataToUrl(imgData,onePdfPageInCanvasHeight);
                                pdf.addImage(pageData.data, 'JPEG', marginw, marginh, outputWidth, outputHeight);//左右边距20,被输出的图片会被拉伸为outputWidth,outputHeight的宽高
                                canvas_current_page_num++;
                                position += pageData.height;
                                if (canvas_max_page_num > 0 && canvas_current_page_num >= canvas_max_page_num) {
                                    break;
                                }
                            }
                            recursion(i + 1);
                        }
                    })
                };
                recursion(rei);
            }
            function ReplaceDecrypt(staticResource,data){
                for (let index = 0; index < staticResource.PIDetails.length; index++) {
                    let pi = staticResource.PIDetails[index];
                    let e = document.getElementById(pi.SF_Field_API_Name__c);
                    if (e && data && data.object && data.object[pi.AWS_Field_API__c]) {
                        e.innerHTML = data[pi.AWS_Field_API__c]
                    }
                }
            }
            //blockme();
            document.body.onload = function(){
                let i = 0;
                let Foo = function(){
                    if ( i == 2) {
                        if(confirm("PDF已加载完毕,是否显示?")){
                            jsPdfDownload();
                        }
                    }
                }
                if ('{!specialDeliveryContact.AWS_Data_Id__c}') {
                    AWSService.query(staticResourceContact.queryUrl, '{!specialDeliveryContact.AWS_Data_Id__c}', function(data){
                        ReplaceDecrypt(staticResourceContact,data);
                        i++;
                        Foo();
                    }, staticResourceContact.token);
                }else{
                    i++;
                    Foo();
                }
                if ('{!contra.order.AWS_Data_Id__c}') {
                    AWSService.query(staticResourceOrder.queryUrl, '{!contra.order.AWS_Data_Id__c}', function(data){
                        ReplaceDecrypt(staticResourceOrder,data);
                        i++;
                        Foo();
                    }, staticResourceOrder.token);
                }else{
                    i++;
                    Foo();
                }
            }
    </script>
    <!-- 20220221 PI改造 by 徐亮 end  -->
</html>
</apex:page>