public with sharing class NewMCAgentUpperLimitPDFController {
    public MCInfo targetMC {get; set;}
    public NewMCAgentUpperLimitPDFController() {

    }
     public NewMCAgentUpperLimitPDFController(ApexPages.StandardController controller) {
    }
    public void init() {
        String Maintenance_ContractID = ApexPages.currentPage().getParameters().get('id');
        List<Maintenance_Contract__c> MCList = [select
                                                id,
                                                Name,
                                                Dealer__r.Name,
                                                Department_Class__r.Name,
                                                Service_Contract_Staff__c,
                                                Payment_Plan_Sum_First__c,
                                                Payment_Plan_Date_First__c,
                                                Payment_Plan_Sum_Fifth__c,
                                                Payment_Plan_Date_Fifth__c,
                                                Payment_Plan_Sum_Third__c,
                                                Payment_Plan_Date_Third__c,
                                                Payment_Plan_Sum_Forth__c,
                                                Payment_Plan_Date_Forth__c,
                                                Payment_Plan_Sum_Second__c,
                                                Payment_Plan_Date_Second__c,
                                                Payment_Plan_Sum_Sixth__c,
                                                Payment_Plan_Date_Sixth__c,
                                                MainLeaderManager__c,
                                                Service_Contract_Staff__r.JingliApprovalManager__c,
                                                User_Salesdepartment__c,
                                                User_Salesdepartment_Sec__c,
                                                Service_Contract_Staff__r.Salesdepartment__c,
                                                Small_Repair_Time__c,
                                                Big_Repair_Time__c,
                                                Live_Technical_Support_Time__c,
                                                Engineer_Name__c,
                                                Phone_Number__c,
                                                Tour_Check__c,
                                                Inspection_Time__c,
                                                Dedust__c,
                                                Negotiate_Mean__c,
                                                First_Party_Contract_Number__c,
                                                Second_Party_Contract_Number__c,
                                                Term_Of_Payment__c,
                                                one_off_payment_agreed_period__c,
                                                Contract_Amount__c,
                                                Total_Contract_Amount_In_Words__c,
                                                Limit_Price_Amount__c,
                                                Limit_Price_Amount_in_Word__c,
                                                Service_Contract_Staff__r.Name,
                                                Total_Payment_Time__c,
                                                Payment_Plan_Sum_First_in_Word__c,
                                                Payment_Plan_Sum_Second_in_Word__c,
                                                Payment_Plan_Sum_Third_in_Word__c,
                                                Payment_Plan_Sum_Forth_in_Word__c,
                                                Payment_Plan_Sum_Fifth_in_Word__c,
                                                Payment_Plan_Sum_Sixth_in_Word__c,
                                                Estimation_Id__c,
                                                SalesOfficeCode_selection__c,
                                                Hospital__r.Name,
                                                Management_Code__c,
                                                Contract_Start_Date__c,
                                                Contract_End_Date__c,
                                                Total_Contract_Number__c,
                                                Is_New_Contract__c,
                                                Is_RecognitionModel__c,
                                                old_Is_RecognitionModel__c,
                    //LJPH-BUKD5A 《委托》合同文本的修改  精琢技术 wql 2020/10/23  start
                    //根据经销商名是否有值判断是否打印新/合同版本
                                                Dealer__c ,
                    //LJPH-BUKD5A 《委托》合同文本的修改  精琢技术 wql 2020/10/23  end
                                                //URF限次合同2期 xxf 2022/08/23 start
                                                (select Id,name,Total_Number_Asset_P__c,Total_Number_Asset_V__c,
                                                    URF_P_MaxRepairCount__c,URF_V_MaxRepairCount__c,
                                                    URF_P_RepairTime__c,URF_V_RepairTime__c
                                                from Maintenance_Contract__r
                                                where Estimation_Decision__c = true)
                                                //URF限次合同2期 xxf 2022/08/23 end
                                                from
                                                Maintenance_Contract__c
                                                where
                                                id = :Maintenance_ContractID];
        if (MCList.size() == 0) {
            throw new ControllerUtil.myException('维修合同不存在。');
        }
        if(MCList[0].Estimation_Id__c == null){
            throw new ControllerUtil.myException('维修合同报价不存在。');
        }

        //巡回、点检和除尘为0是显示为'/'
        if(MCList[0].Tour_Check__c == null || MCList[0].Tour_Check__c.equals('0')){
            MCList[0].Tour_Check__c = ' / ';
        }
        if(MCList[0].Inspection_Time__c == null || MCList[0].Inspection_Time__c.equals('0')){
            MCList[0].Inspection_Time__c = ' / ';
        }
        if(MCList[0].Dedust__c == null || MCList[0].Dedust__c.equals('0')){
            MCList[0].Dedust__c = ' / ';
        }   

        list<Maintenance_Contract_Asset_Estimate__c> MCAs = [select Id from Maintenance_Contract_Asset_Estimate__c
                                                                       where Maintenance_Contract_Estimate__c = :MCList[0].Estimation_Id__c];
        this.targetMC = new MCInfo(MCList,MCAs.size());
        

       
    }


    public integer getStringLength() {
        integer StringLength = 0;
        if( targetMC.MC.Hospital__r.Name != null ){
            StringLength = targetMC.MC.Hospital__r.Name.length();
        }
        if(targetMC.BCompany !=null && targetMC.BCompany.length() > StringLength){
            StringLength = targetMC.BCompany.length();
        }
        return StringLength;
    }

    private static Map<String, String> companyApiMap = new Map<String, String> {
        '北京RC' => '奥林巴斯（北京）销售服务有限公司',
        '上海RC' => '奥林巴斯（北京）销售服务有限公司上海分公司',
        '广州RC' => '奥林巴斯（北京）销售服务有限公司广州分公司',
        '沈阳RC' => '奥林巴斯（北京）销售服务有限公司',
        //wangweipeng  2021/07/30   start
        '成都RC' => '奥林巴斯（北京）销售服务有限公司成都维修分公司',
        '西安RC' => '奥林巴斯（北京）销售服务有限公司西安维修分公司',
        '杭州RC' => '奥林巴斯（北京）销售服务有限公司杭州维修分公司'
        //wangweipeng  2021/07/30   start
    };

        /**
     * 印刷するデータを格納するオブジェクを定義する、親
     */
    public class MCInfo {
        public Maintenance_Contract__c MC {get; private set;}
        public String BCompany {get; private set;}
        public String Department_Class {get; private set;}
        public String HospitalName {get; private set;}
        public integer AssetSize {get; private set;}
        public String StartYear {get; private set;}
        public String StartMonth {get; private set;}
        public String StartDay {get; private set;}
        public String EndYear {get; private set;}
        public String EndMonth {get; private set;}
        public String EndDay {get; private set;}
        public String First_Payment_Year {get; private set;}
        public String First_Payment_Month {get; private set;}
        public String First_Payment_Day {get; private set;}
        public String Second_Payment_Year {get; private set;}
        public String Second_Payment_Month {get; private set;}
        public String Second_Payment_Day {get; private set;}
        public String Third_Payment_Year {get; private set;}
        public String Third_Payment_Month {get; private set;}
        public String Third_Payment_Day {get; private set;}
        public String Forth_Payment_Year {get; private set;}
        public String Forth_Payment_Month {get; private set;}
        public String Forth_Payment_Day {get; private set;}
        public String Fifth_Payment_Year {get; private set;}
        public String Fifth_Payment_Month {get; private set;}
        public String Fifth_Payment_Day {get; private set;}
        public String Sixth_Payment_Year {get; private set;}
        public String Sixth_Payment_Month {get; private set;}
        public String Sixth_Payment_Day {get; private set;}


        public String Payment_Plan_Sum_First_in_Word {get; private set;}
        public String Payment_Plan_Sum_Second_in_Word {get; private set;}
        public String Payment_Plan_Sum_Third_in_Word {get; private set;}
        public String Payment_Plan_Sum_Forth_in_Word {get; private set;}
        public String Payment_Plan_Sum_Fifth_in_Word {get; private set;}
        public String Payment_Plan_Sum_Sixth_in_Word {get; private set;}
        public String Total_Contract_Amount_In_Words {get; private set;}
        
        public integer Total_Payment_Time {get; private set;}
        public String Limit_Price_Amount {get; private set;}
        public String Limit_Price_Amount_in_Word {get; private set;}
        public String TermZero_One {get; private set;}
        public String TermZero_Two {get; private set;}
        public String TermZero_Three {get; private set;}
        public String TermOne_One {get; private set;}
        public String TermOne_Two {get; private set;}
        public String TermTwo_One {get; private set;}
        public String TermTwo_Two {get; private set;}
        public String TermThree_One {get; private set;}
        public String TermThree_Two {get; private set;}
        public String TermThree_Three {get; private set;}
        public String TermTen_One1 {get; private set;}
        public String TermTen_Two1 {get; private set;}
        public String TermTen_Three1 {get; private set;}
        public String TermTen_Four1 {get; private set;}
        public String TermTen_Four_one {get; private set;}
        public String TermTen_Four_two {get; private set;}
        public String TermTen_Four_Three {get; private set;}
        public String TermFour_One {get; private set;}
        public String TermFour_Two {get; private set;}
        public String TermFour_Once {get; private set;}
        public String TermFour_Once_One {get; private set;}
        public String TermFour_Once_Two {get; private set;}
        public String TermFour_Once_Three {get; private set;}
        public String TermFour_Once_Four {get; private set;}
        //add    wangweipeng     2021/12/10      start
        public String TermFour_Once_Five {get; private set;}
        //add    wangweipeng     2021/12/10      end
        public String TermFour_Much {get; private set;}
        public String TermFour_Much_One {get; private set;}
        public String TermFour_Much_Two {get; private set;}
        public String TermFour_Much1 {get; private set;}
        public String TermFour_Much_Same1 {get; private set;}
        public String TermFour_Much_Same2 {get; private set;}
        public String TermFour_Much_Same3 {get; private set;}
        public String TermFour_Much2 {get; private set;}
        public String TermFour_Much3 {get; private set;}
        public String TermFour_Much4 {get; private set;}
        public String TermFour_Much5 {get; private set;}
        public String TermFour_Much6 {get; private set;}
        public String TermFive_Title {get; private set;}
        public String TermFive_Head {get; private set;}
        //add    wangweipeng     2021/12/10      start
        public String TermFive_Head2 {get; private set;}
        //add    wangweipeng     2021/12/10      end
        public String TermFive_One {get; private set;}
        //URF限次合同2期 xxf 20220818 start
        public String TermFive_AppendOne1 {get; private set;}
        //URF限次合同2期 xxf 20220818 end
        public String TermFive_One2 {get; private set;}
        //URF限次合同2期 xxf 20220823 start
        public String TermFive_One2Append {get; private set;}
        //URF限次合同2期 xxf 20220823 end
        //add    wangweipeng     2021/12/10      start
        public String TermFive_One3 {get; private set;}
        public String TermFive_One4 {get; private set;}
        public String TermFive_One5 {get; private set;}
        //URF限次合同2期 xxf 20220823 start
        public String TermFive_One5Append {get; private set;}
        //URF限次合同2期 xxf 20220823 end
        //URF限次合同2期 xxf 20220818 start
        public String TermFive_One5Ap {get; private set;}
        //URF限次合同2期 xxf 20220818 end
        public String TermFive_One6 {get; private set;}
        //URF限次合同2期 xxf 20220818 start
        public String TermFive_One7 {get; private set;}
        public String TermFive_One8 {get; private set;}
        //URF限次合同2期 xxf 20220818 end
        //add    wangweipeng     2021/12/10      end
        public String TermFive_Two {get; private set;}
        //URF限次合同2期 xxf 20220818 start
        public String TermFive_TwoAp {get; private set;}
        //URF限次合同2期 xxf 20220818 end
        public String TermFive_Two2 {get; private set;}
        public String TermFive_Three {get; private set;}
        //URF限次合同2期 xxf 20220819 start
        public String TermFive_ThreeAp {get; private set;}
        //URF限次合同2期 xxf 20220819 end
        public String TermFive_Three1 {get; private set;}
        public String TermFive_Three2 {get; private set;}
        public String TermFive_Four {get; private set;}
        //URF限次合同2期 xxf 20220819 start
        public String TermFive_FourAp {get; private set;}
        //URF限次合同2期 xxf 20220819 end
        public String TermFive_Four2 {get; private set;}
        // public String TermFive_Five {get; private set;}
        // public String TermFive_Five2 {get; private set;}
        public String TermFive_Six {get; private set;}
        public String TermFive_Seven {get; private set;}
        //URF限次合同2期 xxf 20220819 start
        public String TermFive_SixAp {get; private set;}
        public String TermFive_SevenAp {get; private set;}
        //URF限次合同2期 xxf 20220819 end
        //add    wangweipeng     2021/12/10      start
        public String TermFive_Seven2 {get; private set;}
        //add    wangweipeng     2021/12/10      end
        public String TermFive_Eight {get; private set;}
        public String TermFive_Nine {get; private set;}
        public String TermFive_Ten {get; private set;}
        public String TermFive_Ten2 {get; private set;}
        //XLIU-CEP8WW 【委托】合同文本更新/新增 LY 20220524 start
        public String TermFive_Eleven1 {get; private set;}
        public String TermFive_Eleven2 {get; private set;}
        public String TermFive_Eleven {get; private set;}
        public String TermFive_Table11 {get; private set;}
        public String TermFive_Table12 {get; private set;}
        public String TermFive_Table21 {get; private set;}
        public String TermFive_Table22 {get; private set;}
        public String TermFive_Table31 {get; private set;}
        public String TermFive_Table32 {get; private set;}
        public String TermFive_Table41 {get; private set;}
        public String TermFive_Table42 {get; private set;}
        public String TermFive_Table51 {get; private set;}
        public String TermFive_Table52 {get; private set;}
        //XLIU-CEP8WW 【委托】合同文本更新/新增 LY 20220524 end
        public String TermSix_Title {get; private set;}
        public String TermSix_One {get; private set;}
        public String TermSix_Two {get; private set;}
        public String TermSix_Three {get; private set;}
        public String TermSix_Four {get; private set;}
        public String TermSix_Five {get; private set;}
        public String TermSix_Five2 {get; private set;}
        public String TermSix_Six {get; private set;}
        public String TermSix_Six2 {get; private set;}
        public String TermSix_Seven {get; private set;}
        public String TermSix_Eight {get; private set;}
        public String TermSix_Nine {get; private set;}
        public String TermSix_Ten {get; private set;}
        public String TermSeven_Title {get; private set;}
        public String TermSeven_One {get; private set;}
        public String TermSeven_Two {get; private set;}
        public String TermEight_Title {get; private set;}
        public String TermEight_Title2 {get; private set;}
        //XLIU-CEP8WW 【委托】合同文本更新/新增 LY 20220524 start
        public String TermEight_Nine_Title {get; private set;}
        public String TermEight_Nine_One {get; private set;}
        public String TermEight_Nine_Two {get; private set;}
        public String TermEight_Nine_Three {get; private set;}
        public String TermEight_Nine_Four {get; private set;}
        public String TermEight_Nine_Four1 {get; private set;}
        public String TermEight_Nine_Four2 {get; private set;}
        public String TermEight_Nine_Four3 {get; private set;}
        public String TermEight_Nine_Four4 {get; private set;}
        public String TermEight_Nine_Four5 {get; private set;}
        public String TermEight_Nine_Four6 {get; private set;}
        public String TermEight_Nine_Four7 {get; private set;}
        public String TermEight_Nine_Four8 {get; private set;}
        public String TermEight_Nine_Five {get; private set;}
        //XLIU-CEP8WW 【委托】合同文本更新/新增 LY 20220524 end
        
        // public String TermEight_One {get; private set;}
        // public String TermEight_Two {get; private set;}
        // public String TermEight_Three {get; private set;}
        public String TermNine_One {get; private set;}
        // public String TermNine_Two {get; private set;}
        //LJPH-BUKD5A 《委托》合同文本的修改  精琢技术 wql 2020/10/23  start
                    //根据经销商名是否有值判断是否打印新/合同版本
        public String TermTen_One {get; private set;}
        //add    wangweipeng     2021/12/10      start
        // public String TermTen_One2 {get; private set;}
        public String TermTen_Two {get; private set;}
        //add    xiongxiaofeng     2022/08/09      start
        public String TermTen_There {get; private set;}
        //add    xiongxiaofeng     2022/08/09      end
        // public String TermTen_Two2 {get; private set;}
        //add    wangweipeng     2021/12/10      end
        public String TermEleven_One {get; private set;}
        public String TermEleven_Two {get; private set;}
        public String TermEleven_Three {get; private set;}
        public String TermEleven_Four {get; private set;}
        //LJPH-BUKD5A 《委托》合同文本的修改  精琢技术 wql 2020/10/23  end
                    

        public String TermSeven_Table11 {get; private set;}
        public String TermSeven_Table12 {get; private set;}
        public String TermSeven_Table21 {get; private set;}
        public String TermSeven_Table22 {get; private set;}
        public String TermSeven_Table31 {get; private set;}
        public String TermSeven_Table32 {get; private set;}
        public String TermSeven_Table41 {get; private set;}
        public String TermSeven_Table42 {get; private set;}
        public String TermSeven_Table51 {get; private set;}
        public String TermSeven_Table52 {get; private set;}
        public String TermSeven_Table53 {get; private set;}
        public String TermSeven_Table54 {get; private set;}
        public String TermSeven_Table55 {get; private set;}
        public String TermSeven_Table56 {get; private set;}
        public String TermSeven_Table57 {get; private set;}
        public String TermSeven_Table58 {get; private set;}
        public String TermSeven_Table61 {get; private set;}
        public String TermSeven_Table62 {get; private set;}
        public String TermSeven_Table71 {get; private set;}
        public String TermSeven_Table72 {get; private set;}
        public String TermSeven_Table81 {get; private set;}
        public String TermSeven_Table82 {get; private set;}
        public String TermSeven_Table91 {get; private set;}
        public String TermSeven_Table92 {get; private set;}
        public String TermSeven_Table101 {get; private set;}
        public String TermSeven_Table102 {get; private set;}
        public String TermSeven_Table111 {get; private set;}
        public String TermSeven_Table112 {get; private set;}
        // HWAG-BLWFGC  追加第八条，原八九条顺延 update by vivek start
        public String TermEightAppend_Title {get; private set;}
        public String TermEightAppend_One {get; private set;}
        public String TermEightAppend_Two {get; private set;}
        public String TermEightAppend_Three {get; private set;}
        public String TermEightAppend_Three1 {get; private set;}
        public String TermEightAppend_Four {get; private set;}
        public String TermEightAppend_Five {get; private set;}
        public String TermEightAppend_Six {get; private set;}
        // HWAG-BLWFGC  追加第八条，原八九条顺延 update by vivek end


        public String FirstPartyAbbreviation {get; private set;}
        public String SecondPartyAbbreviation {get; private set;}


        public String Payment_Plan_Sum_First {get; private set;}
        public String Payment_Plan_Sum_Second {get; private set;}
        public String Payment_Plan_Sum_Third {get; private set;}
        public String Payment_Plan_Sum_Forth {get; private set;}
        public String Payment_Plan_Sum_Fifth {get; private set;}
        public String Payment_Plan_Sum_Sixth {get; private set;}
        public String Contract_Amount {get; private set;}

        private String returnNewStr(String hospitalName){
            String hospitalNames = '';
            if(hospitalName.contains('/')){
                Integer index = hospitalName.lastIndexOf('/');
                hospitalNames = hospitalName.substring(0,index)+'<br/>'+hospitalName.substring(index+1);
            }else{
                if(hospitalName.length()>22){
                    hospitalNames = hospitalName.substring(0,22)+'<br/>'+hospitalName.substring(22);
                }else{
                    hospitalNames = hospitalName;
                }
                
            }
            return hospitalNames;
        }


        private void setDate(Date StartDate, Date EndDate, Date FirstPaymentDate,
            Date SecondPaymentDate,Date ThirdPaymentDate,
            Date ForthPaymentDate,Date FifthPaymentDate,
            Date SixthPaymentDate){
            if( StartDate != null ){
                this.StartYear = String.valueOf(StartDate.year());
                this.StartMonth =  String.valueOf(StartDate.month());
                this.StartDay =  String.valueOf(StartDate.day());

            }else{
                this.StartYear = ' / ';
                this.StartMonth =  ' / ';
                this.StartDay =  ' / ';
            }
            if( EndDate != null ){
                this.EndYear = String.valueOf(EndDate.year());
                this.EndMonth =  String.valueOf(EndDate.month());
                this.EndDay =  String.valueOf(EndDate.day());
            }else{
                this.EndYear = ' / ';
                this.EndMonth =  ' / ';
                this.EndDay =  ' / ';
            }
            if( FirstPaymentDate != null ){
                this.First_Payment_Year = String.valueOf(FirstPaymentDate.year());
                this.First_Payment_Month =  String.valueOf(FirstPaymentDate.month());
                this.First_Payment_Day =  String.valueOf(FirstPaymentDate.day());
            }else{
                this.First_Payment_Year = ' / ';
                this.First_Payment_Month =  ' / ';
                this.First_Payment_Day =  ' / ';

            }
            if( SecondPaymentDate != null ){
                this.Second_Payment_Year = String.valueOf(SecondPaymentDate.year());
                this.Second_Payment_Month =  String.valueOf(SecondPaymentDate.month());
                this.Second_Payment_Day =  String.valueOf(SecondPaymentDate.day());
            }else{
                this.Second_Payment_Year = ' / ';
                this.Second_Payment_Month =  ' / ';
                this.Second_Payment_Day =  ' / ';
            }
            if( ThirdPaymentDate != null ){
                this.Third_Payment_Year = String.valueOf(ThirdPaymentDate.year());
                this.Third_Payment_Month =  String.valueOf(ThirdPaymentDate.month());
                this.Third_Payment_Day =  String.valueOf(ThirdPaymentDate.day());
            }else{
                this.Third_Payment_Year = ' / ';
                this.Third_Payment_Month =  ' / ';
                this.Third_Payment_Day =  ' / ';
            }
            if( ForthPaymentDate != null ){
                this.Forth_Payment_Year = String.valueOf(ForthPaymentDate.year());
                this.Forth_Payment_Month =  String.valueOf(ForthPaymentDate.month());
                this.Forth_Payment_Day =  String.valueOf(ForthPaymentDate.day());
            }else{
                this.Forth_Payment_Year = ' / ';
                this.Forth_Payment_Month =  ' / ';
                this.Forth_Payment_Day =  ' / ';
            }
            if( FifthPaymentDate != null ){
                this.Fifth_Payment_Year = String.valueOf(FifthPaymentDate.year());
                this.Fifth_Payment_Month =  String.valueOf(FifthPaymentDate.month());
                this.Fifth_Payment_Day =  String.valueOf(FifthPaymentDate.day());
            }else{
                this.Fifth_Payment_Year = ' / ';
                this.Fifth_Payment_Month =  ' / ';
                this.Fifth_Payment_Day =  ' / ';
            }
            if( SixthPaymentDate != null ){
                this.Sixth_Payment_Year = String.valueOf(SixthPaymentDate.year());
                this.Sixth_Payment_Month =  String.valueOf(SixthPaymentDate.month());
                this.Sixth_Payment_Day =  String.valueOf(SixthPaymentDate.day());
            }else{
                this.Sixth_Payment_Year = ' / ';
                this.Sixth_Payment_Month =  ' / ';
                this.Sixth_Payment_Day =  ' / ';
            }


        }

        public MCInfo(List<Maintenance_Contract__c> MCList,integer AssetSize) {
            if (MCList.size() > 0) {
                this.MC = MCList[0];
                this.BCompany = companyApiMap.get(MC.SalesOfficeCode_selection__c);
                this.Department_Class = MC.Department_Class__r.Name.substring(MC.Hospital__r.Name.length());
                this.AssetSize = AssetSize;
                String Hospital = MC.Hospital__r.Name;
                this.HospitalName = returnNewStr(Hospital);
                if(MC.Total_Contract_Amount_In_Words__c != null){
                    this.Total_Contract_Amount_In_Words = MC.Total_Contract_Amount_In_Words__c;
                    // this.Total_Contract_Amount_In_Words = MC.Total_Contract_Amount_In_Words__c.substring(0,MC.Total_Contract_Amount_In_Words__c.length()-2);
                }
                // if(MC.Limit_Price_Amount__c != null){
                //     this.Limit_Price_Amount = MC.Limit_Price_Amount__c;
                //     // this.Total_Contract_Amount_In_Words = MC.Total_Contract_Amount_In_Words__c.substring(0,MC.Total_Contract_Amount_In_Words__c.length()-2);
                // }
                if(MC.Limit_Price_Amount_in_Word__c != null){
                    this.Limit_Price_Amount_in_Word = MC.Limit_Price_Amount_in_Word__c;
                    // this.Total_Contract_Amount_In_Words = MC.Total_Contract_Amount_In_Words__c.substring(0,MC.Total_Contract_Amount_In_Words__c.length()-2);
                }
                if(MC.Payment_Plan_Sum_First_in_Word__c != null){
                    this.Payment_Plan_Sum_First_in_Word = MC.Payment_Plan_Sum_First_in_Word__c;
                    // this.Payment_Plan_Sum_First_in_Word = MC.Payment_Plan_Sum_First_in_Word__c.substring(0,MC.Payment_Plan_Sum_First_in_Word__c.length()-2);
                }
                if(MC.Payment_Plan_Sum_Second_in_Word__c != null){
                    this.Payment_Plan_Sum_Second_in_Word = MC.Payment_Plan_Sum_Second_in_Word__c;
                    // this.Payment_Plan_Sum_Second_in_Word = MC.Payment_Plan_Sum_Second_in_Word__c.substring(0,MC.Payment_Plan_Sum_Second_in_Word__c.length()-2);
                }
                if(MC.Payment_Plan_Sum_Third_in_Word__c != null){
                    this.Payment_Plan_Sum_Third_in_Word = MC.Payment_Plan_Sum_Third_in_Word__c;
                    // this.Payment_Plan_Sum_Third_in_Word = MC.Payment_Plan_Sum_Third_in_Word__c.substring(0,MC.Payment_Plan_Sum_Third_in_Word__c.length()-2);
                }
                if(MC.Payment_Plan_Sum_Forth_in_Word__c != null){
                    this.Payment_Plan_Sum_Forth_in_Word = MC.Payment_Plan_Sum_Forth_in_Word__c;
                    // this.Payment_Plan_Sum_Forth_in_Word = MC.Payment_Plan_Sum_Forth_in_Word__c.substring(0,MC.Payment_Plan_Sum_Forth_in_Word__c.length()-2);
                }
                if(MC.Payment_Plan_Sum_Fifth_in_Word__c != null){
                    this.Payment_Plan_Sum_Fifth_in_Word = MC.Payment_Plan_Sum_Fifth_in_Word__c;
                    // this.Payment_Plan_Sum_Fifth_in_Word = MC.Payment_Plan_Sum_Fifth_in_Word__c.substring(0,MC.Payment_Plan_Sum_Fifth_in_Word__c.length()-2);
                }
                if(MC.Payment_Plan_Sum_Sixth_in_Word__c != null){
                    this.Payment_Plan_Sum_Sixth_in_Word = MC.Payment_Plan_Sum_Sixth_in_Word__c;
                    // this.Payment_Plan_Sum_Sixth_in_Word = MC.Payment_Plan_Sum_Sixth_in_Word__c.substring(0,MC.Payment_Plan_Sum_Sixth_in_Word__c.length()-2);
                }
              //   if('一次性付款'.equals(MC.Term_Of_Payment__c)){
              //       this.Payment_One = '本合同正式签订之日起';
              //       this.Payment_two = '日内，甲方向乙方支付全部合同款人民币';
              //       this.Payment_Four = '元 ( 大写';
              //   }else{
                    // this.Payment_Three = '日前，甲方向乙方支付人民币';
                    // this.Payment_Four = '元 ( 大写';
              //   }
                setDate(MC.Contract_Start_Date__c,MC.Contract_End_Date__c, 
                    MC.Payment_Plan_Date_First__c, MC.Payment_Plan_Date_Second__c,
                    MC.Payment_Plan_Date_Third__c, MC.Payment_Plan_Date_Forth__c, 
                    MC.Payment_Plan_Date_Fifth__c, MC.Payment_Plan_Date_Sixth__c);
                if(MC.Total_Payment_Time__c!=null){
                    this.Total_Payment_Time = integer.valueof(MC.Total_Payment_Time__c);
                }
                
                list<String> args = new String[]{'0','number','###,###,###,###,##0'};
                if(MC.Payment_Plan_Sum_First__c != null ){
                    this.Payment_Plan_Sum_First     =  String.format(MC.Payment_Plan_Sum_First__c.format(), args);
                }
                if(MC.Payment_Plan_Sum_Second__c != null ){
                    this.Payment_Plan_Sum_Second    =  String.format(MC.Payment_Plan_Sum_Second__c.format(), args);
                }
                if(MC.Payment_Plan_Sum_Third__c != null ){
                    this.Payment_Plan_Sum_Third     =  String.format(MC.Payment_Plan_Sum_Third__c.format(), args);
                }
                if(MC.Payment_Plan_Sum_Forth__c != null ){
                    this.Payment_Plan_Sum_Forth     =  String.format(MC.Payment_Plan_Sum_Forth__c.format(), args);
                }
                if(MC.Payment_Plan_Sum_Fifth__c != null ){
                    this.Payment_Plan_Sum_Fifth     =  String.format(MC.Payment_Plan_Sum_Fifth__c.format(), args);
                }
                if(MC.Payment_Plan_Sum_Sixth__c != null ){
                    this.Payment_Plan_Sum_Sixth     =  String.format(MC.Payment_Plan_Sum_Sixth__c.format(), args);
                }
                if(MC.Contract_Amount__c != null ){
                    this.Contract_Amount            =  String.format(MC.Contract_Amount__c.format(), args);
                }
                if(MC.Limit_Price_Amount__c != null ){
                    this.Limit_Price_Amount            =  String.format(MC.Limit_Price_Amount__c.format(), args);
                }


                this.FirstPartyAbbreviation     = '（以下简称“甲方”）';
                this.SecondPartyAbbreviation    = '（以下简称“乙方”）';
                // this.SecondPartyAbbreviation    = '';

                this.TermZero_One = '甲，乙双方经过共同协商，为附件中';
                this.TermZero_Two = '医院（以下简称“丙方”）所列';
                this.TermZero_Three = '件奥林巴斯系列产品在本合同服务委托期限内由乙方提供有偿服务（包括乙方协助丙方对参保设备进行预防故障工作，为参保设备提供维修服务、备品服务、小修保养等服务）而签订本维修业务委托协议（以下简称“本合同”）。';
                this.TermOne_One = '一、    本合同的参保设备清单参见附件1，且必须在服务委托期开始时处于健康完好状态。如参保时有故障存在，除双方有另行约定外，已有故障应该先进行修理且不计入本合同，之后乙方按本合同约定承担相应责任。';
                this.TermOne_Two = '所有附件是本合同有效组成部分，与本合同具有同等法律效力。';
                this.TermTwo_One = '二、     本合同服务委托期限为';
                this.TermTwo_Two = '';
                this.TermThree_One = '三、   本合同总金额';
                this.TermThree_Two = '元(人民币大写';
                this.TermThree_Three = ')。';

                this.TermTen_One1 = '四、   本合同的保修范围金额为';
                this.TermTen_Two1 = '元(人民币大写';
                this.TermTen_Three1 = ')。';
                this.TermTen_Four1  = '1、在本合同服务委托期间内，对累计修理报价金额在保修范围金额内（含）的维';
                this.TermTen_Four_one ='修，由乙方提供维修等服务。甲方无须额外支付费用。';
                this.TermTen_Four_two =  '2、在本合同服务委托期间内，若累计修理报价金额达到保修范围金额时仍旧需要乙方继续对本合同参保设备提供维修服务，则甲方对超过保修范围金额的维修费用进行付费，付费标准为超过保修范围金额的75%。';
                this.TermTen_Four_Three = '如累计修理报价金额暂未超过保修范围金额(即累计修理报价金额＜保修范围金额)，再发生的单笔维修金额计算入累计修理报价金额即便超过保修范围金额，该笔维修仍由乙方提供无偿维修。自下一笔维修产生时，再行依据前款实施付费维修。';

                this.TermFour_One = '五、 付款方式';
                this.TermFour_Two = '本合同金额由甲方：';
                this.TermFour_Once = '一次性支付';
                this.TermFour_Once_One = '本合同正式签订之日起';
                this.TermFour_Once_Two = '日内，甲方向乙方支付全部合同款人民币';
                this.TermFour_Once_Three = '元（大写';
                this.TermFour_Once_Four = ')。';
                //add      wangweipeng            2021/12/10               start
                this.TermFour_Once_Five= '乙方收到甲方款项并完成认款后的7个工作日内向甲方提供正规发票。';
                //add      wangweipeng            2021/12/10               end
                this.TermFour_Much = '多次支付';
                this.TermFour_Much_One = '本合同款项分';
                this.TermFour_Much_Two = '期付出，详细如下：';
                this.TermFour_Much1 = '第一期款项付款时间为';
                this.TermFour_Much_Same1 = '前（含），甲方向乙方支付人民币';
                this.TermFour_Much_Same2 = '元(人民币大写';
                this.TermFour_Much_Same3 = ')。';
                this.TermFour_Much2 = '第二期款项付款时间为';
                this.TermFour_Much3 = '第三期款项付款时间为';
                this.TermFour_Much4 = '第四期款项付款时间为';
                this.TermFour_Much5 = '第五期款项付款时间为';
                this.TermFour_Much6 = '第六期款项付款时间为';

                this.TermFive_Title = '六、   乙方责任范围';
                this.TermFive_Head = '在本合同服务委托期间内，乙方对本合同参保设备提供如下服务：';
                //add      wangweipeng            2021/12/10               start
                this.TermFive_Head2 = '在乙方收到甲方按本协议第四条约定的全部款项后，在本合同服务委托期间内，乙方对本合同参保设备提供本协议约定服务，否则乙方有权拒绝提供直至甲方按约履行付款义务。具体服务如下： ';
                //add      wangweipeng            2021/12/10               end
                this.TermFive_One = '1、   本合同参保设备因自然损耗或按照乙方要求进行清洗消毒的情况下发生故障';
                this.TermFive_AppendOne1 = '时，由乙方进行维修。因故意人为损坏导致的故障，不在本合同维修范围内。';
                // this.TermFive_One2 = '纤维输尿管肾盂镜（URF-P5、URF-P6）：单根设备每年度至多';
                // this.TermFive_One2Append = '次大修，本合同参保设备中共';
                // //add      wangweipeng            2021/12/10               start
                // this.TermFive_One3 = '条累计至多';
                // this.TermFive_One4 = '次（含）大维修，小维修次数不限；';
                // this.TermFive_One5 = '电子输尿管肾盂镜（URF-V、URF-V2）：单根设备每年度至多';
                // this.TermFive_One5Append = '次大修，本合同参保设备中共';
                // this.TermFive_One5Ap = '2、   电子输尿管肾盂镜（URF-V、URF-V2）：单根设备每年度至多';
                // this.TermFive_One6 = '条累计至多';
                // this.TermFive_One7 = '次（含）大维修，小维修次数不限。';
                // this.TermFive_One8 = '当纤维输尿管肾盂镜（URF-P5、URF-P6）和电子输尿管肾盂镜（URF-V、URF-V2）的大维修次数均已达到合同约定的上限时，本合同自动终止，乙方停止提供本合同内约定的一切服务，包含但不限于大、小维修对应、备品提供等。';
                //add      wangweipeng            2021/12/10               end
                this.TermFive_Two = '2、   在零件齐备的情况下，乙方保证';
                this.TermFive_TwoAp = '3、   在零件齐备的情况下，乙方保证';
                //XLIU-CEP8WW 【委托】合同文本更新/新增 LY 20220524 start
                //this.TermFive_Two2 = '小时之内完成小维修。';
                this.TermFive_Two2 = '个工作日内完成小维修。';
                //XLIU-CEP8WW 【委托】合同文本更新/新增 LY 20220524 end
                this.TermFive_Three = '3、   在零件齐备的情况下，乙方保证';
                this.TermFive_ThreeAp = '4、   在零件齐备的情况下，乙方保证';
                this.TermFive_Three1 = '个工作日内完成大维修。';
                this.TermFive_Three2 = '4、 乙方只对本合同参保设备中周边仪器的主机，光源，超声主机、内镜清洗消毒机和监视器进行维修。其他与周边仪器相关的不可维修的设备（如电缆线、超声探头、水瓶、键盘、脚踏等）和耗品（如清洗用具、治疗附件、光源灯泡等）不属于维修范围。';
                this.TermFive_Four = '5、   原则上本合同所附设备在本合同第二条约定的合同服务委托期限内且在本合';
                this.TermFive_FourAp = '5、   原则上本合同所附设备在本合同第二条约定的合同服务委托期限内且在本合';
                this.TermFive_Four2 = '同生效之前发生的故障，乙方在本合同生效后提供维修服务且维修次数计入本合同。但是特例情况可由甲乙双方以补充协议的方式另行约定。';
                // this.TermFive_Five = '5、   原则上本合同所附设备在本合同第二条约定的合同服务委托期限内且在本合';
                // this.TermFive_Five2 = '同生效之前发生的故障，乙方在本合同生效后提供维修服务且维修费用计入本合同。但是特例情况可由甲乙双方以补充协议的方式另行约定。';
                this.TermFive_Six = '5、   若由于零件订购、停产等原因无法修理，则乙方只修理可维修的产品或产品的部分功能。';
                this.TermFive_SixAp = '6、   若由于零件订购、停产等原因无法修理，则乙方只修理可维修的产品或产品的部分功能。';
                // this.TermFive_Seven = '6、   如果本合同参保设备发生乙方修理责任范围内的故障需要进行大维修时，乙方优先向丙方提供备品。';
                // this.TermFive_SevenAp = '7、   如果本合同参保设备发生乙方修理责任范围内的故障需要进行大维修时，乙方优先向丙方提供备品。';
                //add      wangweipeng            2021/12/10               start
                this.TermFive_Seven2 = '7、   如果本合同参保设备发生乙方修理责任范围内的故障需要进行大维修时，乙方优先向丙方提供备品。乙方确保满足丙方周边设备类的备品提供。';
                //add      wangweipeng            2021/12/10               end
                this.TermFive_Eight = '8、   自本合同生效日起每隔3个月且在本合同服务委托期内，乙方将向丙方提供合同执行报告，提供前需获得甲方的认可。具体内容由乙方制定，包括且不限于：合同执行数据，乙方工作汇报，合同参保设备故障情况和相应故障预防建议等。';
                this.TermFive_Nine = '9、   在本合同服务委托期内，乙方结合丙方的实际情况，判断是否要向本合同参保设备提供故障预防工具。如乙方判断需要时，由乙方直接向丙方提供。具体提供方式和数量，以乙方判断为准。';
                this.TermFive_Ten = '10、   乙方指定工程师为丙方提供1年';
                this.TermFive_Ten2 = '次点检，并提交检查报告给医院备档。';
                this.TermFive_Eleven1 = '11、若附件1《参保设备清单》中包含“内镜清洗消毒装置”（型号：OER-AW、';
                this.TermFive_Eleven2 = 'OER-Smart，以下简称“OER-AW、OER-Smart”）的，在本合同期限内，乙方将安排工程师进行每6个月1次上门维护检测。乙方接到甲方设备出现维护保养报警提示通知后进行维护保养服务，更换相关组件。';
                //XLIU-CEP8WW 【委托】合同文本更新/新增 LY 20220524 start
                this.TermFive_Eleven = '12、 若附件1《参保设备清单》中包含下表中的奥辉系列产品，本条第8款、第9款、及第10款不适用于该奥辉系列产品。';
                this.TermFive_Table11 = '产品名称';
                this.TermFive_Table12 = '型号';
                this.TermFive_Table21 = '电子结肠镜';
                this.TermFive_Table22 = 'CF-LV1I';
                this.TermFive_Table31 = '电子结肠镜';
                this.TermFive_Table32 = 'CF-LV1L';
                this.TermFive_Table41 = '电子胃镜';
                this.TermFive_Table42 = 'GIF-LV1';
                this.TermFive_Table51 = '图像处理装置';
                this.TermFive_Table52 = 'CV-V1';
                //XLIU-CEP8WW 【委托】合同文本更新/新增 LY 20220524 end

                this.TermSix_Title = '七、    甲方责任范围 ';
                this.TermSix_One = '1、   甲方应按本合同约定及时支付委托费用。';
                this.TermSix_Two = '2、   甲方应配合丙方按照乙方说明书积极做好本合同参保设备的日常维护和保养工作，确保内镜始终处于良好的工作状态。';
                this.TermSix_Three = '3、   若丙方将本合同参保设备送至非奥林巴斯厂家进行维修，乙方对经过非奥林巴斯厂家维修的设备进行维修时，将按正常标准向甲方收取维修费用，而不视为本合同费用。';
                this.TermSix_Four = '4、   若丙方自行拆卸本合同参保设备，乙方对丙方自行拆卸的设备进行维修时，将按正常标准向甲方收取维修费用，而不视为本合同费用。';
                this.TermSix_Five = '5、   若丙方将本合同参保设备借给其他医院或机构使用，由此造成的故障，乙方将向甲方收取正常的维修费，而不视为本合同费用。';
                this.TermSix_Six = '6、   如果因为丙方使用不匹配的非奥林巴斯或乙方不推荐内镜附件导致的损坏故';
                this.TermSix_Six2 = '障，乙方将向甲方收取正常的维修费，而不视为本合同费用。';
                this.TermSix_Seven = '7、   甲方应该主动积极配合乙方协助为丙方提供设备管理服务，降低因为人为原因造成的损坏。';
                this.TermSix_Eight = '8、   甲方应积极配合乙方履行合同义务，及时提供各种材料，对于乙方提供的服务方案等，甲方有义务及时确认或反馈意见。';
                this.TermSix_Nine = '9、   甲方未经乙方事先书面同意，不得将本合同当事人的地位以及依本合同产生的任何权利义务转让给第三人或提供担保。';
                this.TermSix_Ten = '10、  甲方应保守乙方的商业机密，不得向任何第三方泄露任何或全部包括乙方的销售、市场、技术、维修以及任何其它被告知或从另一方取得乙方的信息；无论此信息在本合同中是否标明或界定为机密。同时不得将该信息用于非本合同所述的目的。本条规定的保密期限在本合同期满或终止后继续有效。';


                // this.TermSix_One = '1、 甲方应爱护本合同内所包含之设备，应按照乙方说明书积极做好本合同参保设备的日常维护和保养工作，确保内镜始终处于良好的工作状态。当设备出现维护保养报警提示时，甲方应及时通知乙方。';
                // this.TermSix_Two = '2、 无论在任何情况下，甲方均不得将本合同参保设备送至非奥林巴斯厂家进行维修。否则，乙方对经过非奥林巴斯厂家维修的设备进行维修时，将按正常标准向甲方收取维修费用，而不视为本合同费用。';
                // this.TermSix_Three = '3、无论在任何情况下，甲方均不得自行拆卸本合同参保设备。否则，乙方对甲方自行拆卸的设备进行维修时，将按正常标准向甲方收取维修费用，而不视为本合同费用。';
                // this.TermSix_Four = '4、甲方不可以将本合同参保设备借给其他医院或机构使用，若由此造成的故障，乙方将向甲方收取正常的维修费，而不视为本合同费用。';
                // this.TermSix_Five = '5、甲方如果因为使用不匹配的非奥林巴斯或乙方不推荐内镜附件导致的损坏故';
                // this.TermSix_Five2 = '障，乙方将向甲方收取正常的维修费，而不视为本合同费用。';
                // this.TermSix_Six = '6、甲方应该主动积极配合乙方管理设备，降低因为人为原因造成的损坏。';
                // this.TermSix_Seven = '7、甲方未经乙方事先书面同意，不得将本合同当事人的地位以及依本合同产生的任何权利义务转让给第三人或提供担保。';
                // this.TermSix_Eight = '8、甲方应保守乙方的商业机密，不得向任何第三方泄露任何或全部包括乙方的销售、市场、技术、维修以及任何其它被告知或从另一方取得乙方的信息；无论此信息在本合同中是否标明或界定为机密。同时不得将该信息用于非本合同所述的目的。本条规定的保密期限在本合同期满或终止后继续有效。';

                this.TermSeven_Title = '八、  甲乙双方同意本合同进行续签时，继续参加合同的参保设备的续签金额由该设备在本合同中的参保价格与本合同的合同消费率计算，公式：续签金额=本合同参保价格*（1+调整比例%）。 ';
                this.TermSeven_One = '（注：合同消费率=本合同委托期限内所有参保设备发生的维修报价金额之和/合同金额*100%。委托期限届满前由乙方负责对合同消费率进行预估，双方认可后可以按此作为制定续签金额的依据。）”';
                this.TermSeven_Table11 = 'X<50%';
                this.TermSeven_Table12 = '-40%';
                this.TermSeven_Table21 = '50%≦X<60%';
                this.TermSeven_Table22 = '-30%';
                this.TermSeven_Table31 = '60%≦X<70%';
                this.TermSeven_Table32 = '-25%';
                this.TermSeven_Table41 = '70%≦X<80%';
                this.TermSeven_Table42 = '-20%';
                this.TermSeven_Table51 = '80%≦X<90%';
                this.TermSeven_Table52 = '-15%';
                this.TermSeven_Table53 = '90%≦X<100%';
                this.TermSeven_Table54 = '-5%';
                this.TermSeven_Table55 = '100%≦X<110%';
                this.TermSeven_Table56 = '0%';
                this.TermSeven_Table57 = '110%≦X<120%';
                this.TermSeven_Table58 = '0%';
                this.TermSeven_Table61 = '120%≦X<130%';
                this.TermSeven_Table62 = '10%';
                this.TermSeven_Table101 = '130%≦X<140%';
                this.TermSeven_Table102 = '15%';
                this.TermSeven_Table111 = 'X≧140%';
                this.TermSeven_Table112 = '20%';


                this.TermSeven_Two = '2、   如参加续签的参保设备包含本合同项下设备以外的设备，则这部分设备的合同金额由双方另行协商约定。';

                // HWAG-BLWFGC  追加第八条，原八九条顺延 update by vivek start
                this.TermEightAppend_Title = '九、    合同变更、修改、解除和终止';
                this.TermEightAppend_One = '经甲乙双方协商同意，可对本合同进行修改和补充，修改及补充的内容经双方签字或盖章后作为本合同的有效组成部分，与本合同具有同等法律效力。若补充协议内容与本合同有冲突以补充协议为准。';
                this.TermEightAppend_Two = '本合同任何一方有下列情形之一，对方可不经催告解除本合同：';
                this.TermEightAppend_Three = '1、一方被采取查封、扣押、冻结等，或被申请开始进行拍卖、破产、清算、合';
                this.TermEightAppend_Three1 = '并、分立；';
                this.TermEightAppend_Four = '2、一方延迟履行本合同主要义务，经催告后在一方规定的合理期限内仍未履行；';
                this.TermEightAppend_Five = '3、一方有其他违约或违法行为致使本合同目的不能实现的。';
                this.TermEightAppend_Six = '4、由于不可抗力的原因，导致本合同部分不能履行、不能履行或延期履行时，遇有不可抗力事件的一方，应立即将事故情况通知对方，并提供部分不能履行、不能履行或延期履行的理由和所有相关的文件资料。';
                // HWAG-BLWFGC  追加第八条，原八九条顺延 update by vivek end
                //LJPH-BYGBSR 【委托】与经销商的标准合同文本修改 精琢技术 wql 2021/02/02 start
                //注释源代码
                // this.TermEight_Title = '九、   本合同的解释与执行适用中华人民共和国法律，在履行本合同过程中出现的争议双方应友好协商解决；协商不成的，可选择以下第（ ';
                // this.TermEight_Title2 = '）种方式解决：';

                // this.TermEight_One = '1、 任何一方有权向设在北京的中国国际经济贸易仲裁委员会申请仲裁，仲裁的裁决是终局性的，对双方均有约束力。';
                // this.TermEight_Two = '2、 向甲方所在地有管辖权的人民法院提起诉讼。';
                // this.TermEight_Three = '3、 向乙方所在地有管辖权的人民法院提起诉讼。';
                //XLIU-CEP8WW 【委托】合同文本更新/新增 LY 20220524 start
                //this.TermEight_Title = '九、  本合同的解释与执行适用中华人民共和国法律，在履行本合同过程中出现的争议双方应友好协商解决；';
                //this.TermEight_Title2 = '因本合同引起的或与本合同有关的任何争议，均提请北京仲裁委员会按照其仲裁规则进行仲裁。仲裁裁决是终局的，对双方均有约束力。';
                this.TermEight_Nine_Title = '十、    法令遵守';
                this.TermEight_Nine_One = '1、甲方在履行本合同义务时，应当遵守如下事项：甲方应严格遵守中国有关禁止行贿、受贿的法律法规、美国《反海外腐败法》以及本合同适用的贸易法律和法规，遵守乙方公布的《全球标准-奥林巴斯对第三方的期待》(https://www.olympus-global.com/csr/effort/third_party_global/?page=csr），并遵守乙方向甲方公布的反商业贿赂的任何行为准则、公司政策、指南等规定。甲方应保证与威胁社会秩序和公共安全的反社会势力组织（包括但不限于黑社会等）不存在任何联系，并且承诺不与反社会势力进行任何交易，或为其提供任何资金或其他形式的支持。甲方不得自行或者通过第三方采取暴力或胁迫等手段干涉或强迫交易，或进行其他可能有损乙方公司信誉或妨碍乙方公司业务正常开展的行为。';
                this.TermEight_Nine_Two = '2、甲方应保证其雇员、代理人、经销商同样遵守前项所述各义务。';
                this.TermEight_Nine_Three = '3、为确认甲方是否履行了本条第 1 款所约定的各项义务，乙方有权在事先通知甲方的情况下，进入甲方的事务所等办公地点进行检查，并要求甲方提供相关的资料，甲方应予以充分配合。';
                this.TermEight_Nine_Four = '4、乙方有权在合作期间以及合作终止后的两年内对甲方进行本合同项下相关的合规审计。在此期间，甲方须本着诚信勤勉的精神予以配合。';
                this.TermEight_Nine_Four1 = '合规审计的范围包括但不限于:';
                this.TermEight_Nine_Four2 = '（1）甲方的合规政策和流程相关文件；';
                this.TermEight_Nine_Four3 = '（2）与乙方合作相关的财务记录（如财务帐簿，银行对账单）及支持性文件；';
                this.TermEight_Nine_Four4 = '（3）甲方的财务报表与审计报告；';
                this.TermEight_Nine_Four5 = '（4）甲方的主要股东名单及涉及本合同业务的甲方员工名单；';
                this.TermEight_Nine_Four6 = '（5）与乙方合作相关的合同；';
                this.TermEight_Nine_Four7 = '（6）甲方违法违规情况的记录及支持文件；';
                this.TermEight_Nine_Four8 = '（7）其他与乙方合作相关的文件。';
                this.TermEight_Nine_Five = '合规审计的方法包括但不限于：审阅、复制上述电子或纸质文件，与员工、股东及利益相关人员面谈。';
                //LJPH-BYGBSR 【委托】与经销商的标准合同文本修改 精琢技术 wql 2021/02/02 end
                //XLIU-CEP8WW 【委托】合同文本更新/新增 LY 20220524 end

                this.TermNine_One = '十一、 本合同的解释与执行适用中华人民共和国法律，在履行本合同过程中出现的争议双方应友好协商解决；因本合同引起的或与本合同有关的任何争议，均提请北京仲裁委员会按照其仲裁规则进行仲裁。仲裁裁决是终局的，对双方均有约束力。';
                // this.TermNine_Two = '份，乙方执1份，自双方盖章之日起生效。如生效日期与本协议第二条约定的委托期限起始日期不一致时，双方同意以两者中较晚日期作为本合同的生效时间。';
                
                this.TermEleven_One = '十二、   若甲方是乙方的特约经销商，则自合同签订起，甲乙双方同意共享甲方与乙方签署《特约经销商合同》所缴纳的全额保证金。发生以下情况时，乙方有权从甲方所缴纳的保证金中予以直接扣除：';
                this.TermEleven_Two ='1、本合同执行期间，甲方不再是乙方的特约经销商且存在本合同欠款的；';
                this.TermEleven_Three ='2、本合同期满或合同解除后，乙方清算若甲方本合同项下存在欠款的。前述保证金不能足额扣除的乙方有权继续向甲方追缴；';
                this.TermEleven_Four ='3、如若本合同执行期间，甲方不再是乙方的特约经销商，则双方同意甲方基于《特约经销商合同》所缴纳的全额保证金将与本合同期满或提前解除并扣除欠款后无息返还甲方。';

                //LJPH-BUKD5A 《委托》合同文本的修改  精琢技术 wql 2020/10/23  start
                    //根据经销商名是否有值判断是否打印新/合同版本
                this.TermTen_One = '十三、 本协议甲方执';
                // this.TermTen_Two = '份，';
                this.TermTen_There= '份，乙方执1份，自双方盖章之日起生效。如生效日期与本合同第二条约定的委托期限起始日期不一致时，双方同意以两者中较晚日期作为本合同的生效时间。';
            }
                
        }

    }

}