• Angela Skenderi 2
  • NEWBIE
  • 10 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 2
    Replies
    if (payElementTypeId != null) {
      payElement.Earning_Attachment_Pay_Element_Type__c = payElementTypeId;
    }


private static Pay_Element__c createEarningsAttachmentPayElement(
    Earnings_Attachment__c earningsAttachment,
    Decimal deductionAmount,
    Id ppsId,
    IncomeModifierService.Settings earningsAttachmentSettings
  ) {
    String aeoName = buildEarningsAttachmentName(earningsAttachment);
    Decimal deductionAmountAndAdminCost = EarningsAttachmentCalculator.addAdminCosts(
      earningsAttachment,
      deductionAmount
    );

    Id payElementTypeId = earningsAttachment.PayElement.Earning_Attachment_Pay_Element_Type__c;

    return PayElementService.createPayElement(
      aeoName,
      ppsId,
      deductionAmountAndAdminCost,
      payElementTypeId,
      earningsAttachmentSettings
    );
  private Decimal getCarAllowances() {
    Decimal value = 0;

    for (Pay_Element__c payElement : payElements) {
      if (payElement.Is_Addition__c && payElement.Car_Allowance__c) {
      value += payElement.Value__c;
      }
    }
    
    return value;
  }

Logical operator can only be applied to Boolean is the error I receive for this method. 

  private Decimal getCarAllowances() {
    Decimal value = 0;

    for (Pay_Element__c payElement : payElements) {
      if (payElement.Is_Addition__c == payElement.Car_Allowance__c) {
      value += payElement.Value__c;
      }
    }
    
    return value;
  }

Comparison arguments must be compatible types: Boolean, Decimal is the error I receive for this one.

 
  private Decimal getCarAllowances() {
    Decimal value = 0;

    for (Pay_Element__c payElement : payElements) {
      if (payElement.Is_Addition__c == true &&
      (payElement.Car_Allowance__c == true))  {
        value += payElement.Value__c;
      }
    }

    return value;
  }
  private Decimal getCarAllowances() {
    Decimal value = 0;

    for (Pay_Element__c payElement : payElements) {
      if (payElement.Is_Addition__c && payElement.Car_Allowance__c) {
      value += payElement.Value__c;
      }
    }
    
    return value;
  }

Logical operator can only be applied to Boolean is the error I receive for this method. 

  private Decimal getCarAllowances() {
    Decimal value = 0;

    for (Pay_Element__c payElement : payElements) {
      if (payElement.Is_Addition__c == payElement.Car_Allowance__c) {
      value += payElement.Value__c;
      }
    }
    
    return value;
  }

Comparison arguments must be compatible types: Boolean, Decimal is the error I receive for this one.