| | |
| | | } |
| | | userId = UserInfo.getUserId(); |
| | | List<user> Useracc = new List<user>(); |
| | | <<<<<<< HEAD |
| | | Useracc = [ |
| | | SELECT accountid, Work_Location__c, UserPro_Type__c |
| | | FROM user |
| | | WHERE id = :userId |
| | | ]; |
| | | accountid = Useracc[0].accountid; |
| | | userWorkLocation = Useracc[0].Work_Location__c; |
| | | agencyProType = Useracc[0].UserPro_Type__c; |
| | | if (String.isBlank(Useracc[0].UserPro_Type__c)) { |
| | | agencyProType = 'ET'; |
| | | } |
| | | coc = new Consumable_order__c(); |
| | | |
| | | Dealerelationship = [ |
| | | SELECT Dealer_subordinate__c, Dealer_subordinate__r.Name |
| | | FROM Dealer_elationship__c |
| | | WHERE Dealer_principal__c = :accountid |
| | | ]; |
| | | List<Agency_Hospital_Link__c> AgencyHospitalLink = new List<Agency_Hospital_Link__c>(); |
| | | AgencyHospitalLink = [ |
| | | SELECT Id, Name, Hospital__c, Hospital__r.Id, Hospital__r.Name, Agency__c |
| | | FROM Agency_Hospital_Link__c |
| | | WHERE Agency__c = :accountId |
| | | ]; |
| | | ======= |
| | | Useracc = [SELECT accountid, Work_Location__c, UserPro_Type__c FROM user WHERE id = :userId]; |
| | | accountid = Useracc[0].accountid; |
| | | userWorkLocation = Useracc[0].Work_Location__c; |
| | |
| | | FROM Agency_Hospital_Link__c |
| | | WHERE Agency__c = :accountId |
| | | ]; |
| | | >>>>>>> LEXCommunityLiJun |
| | | // 新規 |
| | | if (invoiceId == null || invoiceId == '') { |
| | | if (deliveryId == null || deliveryId == '') { |
| | |
| | | // attachmentRecoeds.add(new InvoiceOrderInfo(attachmentinfo[i])); |
| | | // } |
| | | // } |
| | | <<<<<<< HEAD |
| | | List<ContentDocumentLink> links = [ |
| | | SELECT Id, ContentDocumentId |
| | | FROM ContentDocumentLink |
| | | WHERE LinkedEntityId = :invoiceId |
| | | ]; |
| | | ======= |
| | | List<ContentDocumentLink> links = [SELECT Id, ContentDocumentId FROM ContentDocumentLink WHERE LinkedEntityId = :invoiceId]; |
| | | >>>>>>> LEXCommunityLiJun |
| | | if (links != null && links.size() > 0) { |
| | | List<String> documentIds = new List<String>(); |
| | | for (ContentDocumentLink link : links) { |
| | |
| | | FROM ContentVersion |
| | | WHERE ContentDocumentId IN :documentIds |
| | | ]; |
| | | <<<<<<< HEAD |
| | | |
| | | ======= |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | if (cvInfo.size() > 0) { |
| | | for (Integer i = 0; i < cvInfo.size(); i++) { |
| | | attachmentRecoeds.add(new InvoiceOrderInfo(cvInfo[i])); |
| | |
| | | invoiceHead.Order_ForDealer__c = SecondDealer; |
| | | } |
| | | invoiceHead.Order_ForDealerText__c = coc.Order_ForDealerText__c; |
| | | <<<<<<< HEAD |
| | | if (Test.isRunningTest()) { |
| | | invoiceHead.Order_ForHospital__c = null; |
| | | ======= |
| | | if(Test.isRunningTest()){ |
| | | invoiceHead.Order_ForHospital__c = null; |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | insert invoiceHead; |
| | | invoiceId = invoiceHead.Id; |
| | |
| | | invoiceHead.Order_ForDealer__c = SecondDealer; |
| | | } |
| | | invoiceHead.Order_ForDealerText__c = coc.Order_ForDealerText__c; |
| | | <<<<<<< HEAD |
| | | if (Test.isRunningTest()) { |
| | | invoiceHead.Order_ForHospital__c = null; |
| | | ======= |
| | | if(Test.isRunningTest()){ |
| | | invoiceHead.Order_ForHospital__c = null; |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | insert invoiceHead; |
| | | System.debug('invoiceHead = ' + invoiceHead); |
| | |
| | | return null; |
| | | } |
| | | } |
| | | <<<<<<< HEAD |
| | | } |
| | | ======= |
| | | } |
| | | >>>>>>> LEXCommunityLiJun |