Denny Chen
2022-02-28 6947068a02499b9d1022f9efca5bcf1bdd3f1c70
force-app/main/default/classes/NewQuoteEntryController.cls
@@ -155,6 +155,7 @@
        }
      } else {
        quoId = System.currentPageReference().getParameters().get('copyid');
        system.debug('copyid++++++++++++'+quoId);
        if (quoId != null) {
          // コピーのデータが後で作成する
        } else {
@@ -414,6 +415,7 @@
         From QuoteLineItem where Quoteid = :quoId Order by Item_Order__c, Id];
      String copyQuoId = System.currentPageReference().getParameters().get('copyid');
      system.debug('copyid2++++++++++++'+copyQuoId);
      CheckItem = items;
      if (copyQuoId == null) {
@@ -2537,6 +2539,7 @@
  //SWAG-C9JCS8 【委托】【紧急】询价GZ-SP-GD0757135报价单问题 fy end
  public boolean dataEntry() {
    system.debug('activities++++----****3'+activities);
    //SWAG-C9JCS8 【委托】【紧急】询价GZ-SP-GD0757135报价单问题 fy start
    // Boolean ifdecide=false;
    // List<Opportunity> oppsde = [Select Id, Estimation_Decision__c From Opportunity Where Id = : oppId];
@@ -2581,6 +2584,7 @@
        errormessage = System.Label.Error_Message3;
      }
      //decimal temSalesAmount1 = 0; // 2018/09/28 CHAN-B4YAB8 经销商小计合计 end
      system.debug('activities++++----****2'+activities);
      for (QELine a : activities) {
        if ((a.Asset_Model != null) && (a.Asset_Model != '')) {
          if (a.PageObject.Quantity__c == null || a.PageObject.Quantity__c == 0) {
@@ -2782,6 +2786,7 @@
      // 20150302 jo 見積の主机安装地点を設定
      List<String> pIds = new List<String>();
      system.debug('activities++++----****1'+activities);
      for (QELine s : activities) {
        if (String.isBlank(s.PageObject.Id__c) == false) {
          pIds.add(s.PageObject.Id__c);
@@ -2858,6 +2863,7 @@
      //Sap送信,Printに合わせて1~
      Integer i = 1;
      if (activities.size() > 0) {
        system.debug('activities++++----****'+activities);
        for (QELine s : activities) {
          if (s.Asset_Model != null && s.Asset_Model != '') {
            if (s.pageObject.PricebookEntryId != null) {
@@ -2903,6 +2909,7 @@
          }
        }
        System.debug('start save quote lines at: ' + System.currentTimeMillis());
        system.debug('qlist+++---+++'+qlist);
        insert qlist;
        System.debug('finished save quote lines at: ' + System.currentTimeMillis());
@@ -3122,8 +3129,11 @@
      lastProductFLGList.add(qli.pageObject.PricebookEntry.Product2Id);
      quotlinitMap.put(qli.pageObject.PricebookEntry.Product2Id,qli.pageObject);
    }
    System.debug('activities!!!'+activities);
    System.debug('oppId!!!'+oppId);
    System.debug('lastProductFLGList!!!'+lastProductFLGList);
    if(lastProductFLGList!=null){
        List<LastbuyProduct__c> LastbuyObjList=[select id,LastbuyQuantity__c,InquiryCode__c,ProductName__c from LastbuyProduct__c where InquiryCode__c= : oppId and ProductName__c in :lastProductFLGList];
        List<LastbuyProduct__c> LastbuyObjList=[select id,LastbuyQuantity__c,InquiryCode__c,ProductName__c,effectiveFLG__c from LastbuyProduct__c where InquiryCode__c= : oppId and ProductName__c in :lastProductFLGList and effectiveFLG__c = true];
        if(LastbuyObjList!=null){
            for(LastbuyProduct__c lastbuypr :LastbuyObjList){
              Decimal quoteLItemNum=0;