| | |
| | | public Boolean changedAfterPrint { get; set; } // true の場合、画面に confirm メッセージが表示します。quoIdを新しいinsert。判定はjsにて実施 |
| | | public Boolean changedAfterBid { get; set; } // true の場合、画面に confirm メッセージが表示します。quoIdを新しいinsert。判定はjsにで実施 |
| | | //public Id qlistId { get; set; } |
| | | //lastbuy 2022/2/9 fy start |
| | | public Boolean filg { get; set; } |
| | | public Integer flglastbuy { get; set; } |
| | | public String errorProductmodel { get; set; } |
| | | //lastbuy 2022/2/9 fy end |
| | | |
| | | public String excel_text { get; set; } |
| | | public Integer select_index { get; set; } // excelImport専用ですが、jsにて制御することになるので、TODO katsu 削除予定 |
| | |
| | | } |
| | | } else { |
| | | quoId = System.currentPageReference().getParameters().get('copyid'); |
| | | system.debug('copyid++++++++++++'+quoId); |
| | | if (quoId != null) { |
| | | // コピーのデータが後で作成する |
| | | } else { |
| | |
| | | ,PricebookEntry.Product2.Intra_Trade_Foreign_RMB__c |
| | | //NoDiscount 金额(USD) |
| | | ,PricebookEntry.Product2.NoDiscount_Foreign__c |
| | | //fy 预留产品标识 |
| | | ,PricebookEntry.Product2.LastbuyProductFLG__c |
| | | ,Quote.Opportunity.Trade__c |
| | | //外贸多年保 2021/01/04 精琢技术 wql end |
| | | |
| | |
| | | |
| | | 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) { |
| | |
| | | //外贸多年保 2021/01/04 精琢技术 wql start |
| | | //维修合同报价(USD) |
| | | ,Repair_Contract_USD__c |
| | | //fy 预留产品标识 |
| | | ,LastbuyProductFLG__c |
| | | //计提金额(不含税,USD) |
| | | ,Intra_Trade_Foreign_RMB__c |
| | | //NoDiscount 金额(USD) |
| | |
| | | |
| | | errorflg = false; |
| | | errormessage = null; |
| | | |
| | | //20220214 fy lastbuy start |
| | | if(!ReservedProductVerification()){ |
| | | system.debug('flglastbuy++++'+flglastbuy); |
| | | if(flglastbuy==1){ |
| | | errorflg = true; |
| | | errormessage = '预留产品表中没有该询价,请通过本部窗口联系营业管理课' ; |
| | | return null; |
| | | }else if(flglastbuy==2){ |
| | | errorflg = true; |
| | | errormessage = errorProductmodel+'产品数量不可超过产品预留数量' ; |
| | | return null; |
| | | }else if(flglastbuy==3){ |
| | | errorflg = true; |
| | | errormessage = '预留产品'+errorProductmodel+'未录入预留产品表'; |
| | | return null; |
| | | } |
| | | } |
| | | //20220214 fy lastbuy end |
| | | // 2022-01-12 ssm 报价计算check |
| | | if (checkIsQuoteTrial()) { |
| | | errorflg = true; |
| | |
| | | // ここを修正したら、NFM007.triggerも要確認 |
| | | prd2LatestValMap = new Map<Id, Product2>(); |
| | | integer cntPrd2 = 0; |
| | | for (Product2 prd2 : [Select Id, Estimation_Entry_Possibility__c, SFDA_Status__c, Packing_list_manual__c |
| | | for (Product2 prd2 : [Select Id, Estimation_Entry_Possibility__c, SFDA_Status__c, Packing_list_manual__c, |
| | | //fy 预留产品标识 |
| | | LastbuyProductFLG__c |
| | | From Product2 Where Id IN :product2Ids]) { |
| | | cntPrd2 = cntPrd2 + 1; |
| | | if (prd2.Estimation_Entry_Possibility__c != '○') { |
| | |
| | | //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]; |
| | |
| | | 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) { |
| | |
| | | |
| | | // 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); |
| | |
| | | //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) { |
| | |
| | | } |
| | | } |
| | | System.debug('start save quote lines at: ' + System.currentTimeMillis()); |
| | | system.debug('qlist+++---+++'+qlist); |
| | | insert qlist; |
| | | System.debug('finished save quote lines at: ' + System.currentTimeMillis()); |
| | | |
| | |
| | | } |
| | | return true; |
| | | } |
| | | //lastbuy 2022/2/9 fy start |
| | | public boolean ReservedProductVerification() { |
| | | |
| | | filg=true; |
| | | Map<string,QuoteLineItem> quotlinitMap = new Map<string,QuoteLineItem>(); |
| | | List<Id> lastProductFLGListId = new List<Id>(); |
| | | List<QuoteLineItem> lastProductFLGList = new List<QuoteLineItem>(); |
| | | List<QuoteLineItem> act = new List<QuoteLineItem>(); |
| | | List<QuoteLineItem> act2 = new List<QuoteLineItem>(); |
| | | for(QELine aaa :activities){ |
| | | if(aaa.pageObject.PricebookEntry.Product2Id!=null){ |
| | | act.add(aaa.pageObject); |
| | | } |
| | | } |
| | | act2=act.deepClone(); |
| | | Map<String,QuoteLineItem> map1 = new Map<String,QuoteLineItem>(); |
| | | System.debug('activities1111111111112为所当为多多!!!'+activities); |
| | | integer i =0; |
| | | for(QuoteLineItem pspsc :act2){ |
| | | if(pspsc.PricebookEntry.Product2Id!=null){ |
| | | if(map1.containsKey(pspsc.PricebookEntry.Product2Id)){ |
| | | QuoteLineItem quoteLine = map1.get(pspsc.PricebookEntry.Product2Id); |
| | | quoteLine.Quantity__c =quoteLine.Quantity__c+pspsc.Quantity__c; |
| | | map1.put(pspsc.PricebookEntry.Product2Id,quoteLine); |
| | | }else{ |
| | | map1.put(pspsc.PricebookEntry.Product2Id,pspsc); |
| | | } |
| | | System.debug('34499879!!!'+activities); |
| | | } |
| | | } |
| | | System.debug('3434343!!!'+activities); |
| | | System.debug('5656565!!!'+map1); |
| | | for (QuoteLineItem value : map1.values()) { |
| | | if(value.PricebookEntry.Product2.LastbuyProductFLG__c){ |
| | | lastProductFLGListId.add(value.PricebookEntry.Product2Id); |
| | | quotlinitMap.put(value.PricebookEntry.Product2Id,value); |
| | | lastProductFLGList.add(value); |
| | | } |
| | | } |
| | | System.debug('activities++++!!!'+activities); |
| | | System.debug('activities!!!'+map1.values()); |
| | | System.debug('oppId!!!'+oppId); |
| | | System.debug('lastProductFLGList!!!'+lastProductFLGListId); |
| | | if(lastProductFLGListId!=null&&lastProductFLGListId.size()!=0){ |
| | | 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 :lastProductFLGListId and effectiveFLG__c = true]; |
| | | Map<string,LastbuyProduct__c> LastbuyObjMap = new Map<string,LastbuyProduct__c>(); |
| | | System.debug('LastbuyObjList+++++!!!'+LastbuyObjList); |
| | | if(LastbuyObjList!=null&&LastbuyObjList.size()!=0){ |
| | | for(LastbuyProduct__c lastbuypr :LastbuyObjList){ |
| | | LastbuyObjMap.put(lastbuypr.ProductName__c,lastbuypr); |
| | | } |
| | | }else{ |
| | | flglastbuy=1; |
| | | filg=false; |
| | | return filg; |
| | | } |
| | | System.debug('LastbuyObjMap!!!'+LastbuyObjMap); |
| | | System.debug('lastProductFLGList+++++++!!!'+lastProductFLGList); |
| | | if(lastProductFLGList!=null&&lastProductFLGList.size()!=0){ |
| | | for(QuoteLineItem lastbuypr :lastProductFLGList){ |
| | | Decimal quoteLItemNum=0; |
| | | if(LastbuyObjMap.containsKey(lastbuypr.PricebookEntry.Product2Id)){ |
| | | quoteLItemNum=LastbuyObjMap.get(lastbuypr.PricebookEntry.Product2Id).LastbuyQuantity__c; |
| | | System.debug('quoteLItemNum!!!'+quoteLItemNum); |
| | | System.debug('lastbuypr.pageObject.Quantity__c+++!!!'+lastbuypr.Quantity__c); |
| | | if(lastbuypr.Quantity__c>quoteLItemNum){ |
| | | errorProductmodel=lastbuypr.Asset_Model_No__c; |
| | | flglastbuy=2; |
| | | filg=false; |
| | | break; |
| | | } |
| | | }else{ |
| | | errorProductmodel=lastbuypr.Asset_Model_No__c; |
| | | flglastbuy=3; |
| | | filg=false; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | system.debug('filg====='+filg); |
| | | return filg; |
| | | } |
| | | //lastbuy 2022/2/9 fy end |
| | | //oppに画面の値を設定 |
| | | private void setOppFromOppInfo() { |
| | | opp.Wholesale_Price__c = oppInfo.Wholesale_Price; |