BookValueAfterDisposal-FixedAsset

 ShowBookValueAfterDisposal()
IF "Disposal Date" > 0D THEN BEGIN
  CLEAR(TempFALedgEntry);
  TempFALedgEntry.DELETEALL;
  TempFALedgEntry.SETCURRENTKEY("FA No.","Depreciation Book Code","FA Posting Date");
  DepreciationCalc.SetFAFilter(FALedgEntry,"FA No.","Depreciation Book Code",FALSE);
  WITH FALedgEntry DO BEGIN
    IF FIND('-') THEN
      REPEAT
        IF (("FA Posting Category" = "FA Posting Category"::Disposal) AND
            ("FA Posting Type" <> "FA Posting Type"::"Book Value on Disposal") AND
            ("FA Posting Type" <> "FA Posting Type"::"Salvage Value")) OR
           "Part of Book Value"
        THEN BEGIN
          TempFALedgEntry := FALedgEntry;
          TempFALedgEntry.INSERT;
        END;
      UNTIL NEXT = 0;
    TempFALedgEntry.SETRANGE("FA No.",TempFALedgEntry."FA No.");
    TempFALedgEntry.SETRANGE("Depreciation Book Code",TempFALedgEntry."Depreciation Book Code");
    PAGE.RUN(0,TempFALedgEntry);
  END;
END ELSE BEGIN
  FALedgEntry.SETCURRENTKEY("FA No.","Depreciation Book Code","Part of Book Value","FA Posting Date");
  FALedgEntry.SETRANGE("FA No.","FA No.");
  FALedgEntry.SETRANGE("Depreciation Book Code","Depreciation Book Code");
  FALedgEntry.SETRANGE("Part of Book Value",TRUE);
  PAGE.RUN(0,FALedgEntry);
END;
CalcBookValue()
IF "Disposal Date" > 0D THEN
  "Book Value" := 0
ELSE
  CALCFIELDS("Book Value");