| | |
| | | //lastbuy 2022/2/9 fy start |
| | | List<LastbuyProduct__c> upLastbuyObjList = new List<LastbuyProduct__c>(); |
| | | if(lastProductFLGList!=null){ |
| | | List<LastbuyProduct__c> LastbuyObjList=[select id,LastbuyQuantity__c,InquiryCode__c,ProductName__c from LastbuyProduct__c where InquiryCode__c= : opp.Id 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= : opp.Id and ProductName__c in :lastProductFLGList and effectiveFLG__c = true]; |
| | | System.debug('bbbbbbbbbbbbbbb==='+lastProductFLGList); |
| | | if(LastbuyObjList!=null){ |
| | | for(LastbuyProduct__c lastbuypr :LastbuyObjList){ |
| | | Decimal quoteLItemNum=0; |
| | |
| | | opp.addError('产品数量不可超过产品预留数量'); |
| | | }else{ |
| | | lastbuypr.ActualQuantity__c=quoteLItemNum; |
| | | lastbuypr.effectiveFLG__c=false; |
| | | upLastbuyObjList.add(lastbuypr); |
| | | } |
| | | System.debug('cccccccccccccc==='+lastbuypr); |
| | | } |
| | | System.debug('aaaaaaaaaaaaaa==='+LastbuyObjList); |
| | | |
| | | }else{ |
| | | opp.addError('预留表中还没有数据'); |
| | | } |