26.09.2013, 16:00 | #1 |
Участник
|
Ребята, подскажите пожалуйста, что здесь может неправильно отрабатывать??
Код: FA.GET("FA No."); IF FA."Responsible Employee"<>'' THEN BEGIN Emp.GET(FA."Responsible Employee"); IF Emp."Job Title Code"<>'' THEN JobTitle.GET(Emp."Job Title Code"); END; IF FA."Depreciation Group"<>'' THEN BEGIN DeprGroup.GET(FA."Depreciation Group"); IF DeprGroup.Code<>'' THEN DeprGroup.GET(DeprGroup.Code); END; IF FA."FA Type"<>FA."FA Type"::"Fixed Assets" THEN CurrReport.SKIP; DocNo:="FA Document Line"."Document No."; DocDate := "FA Document Line"."Posting Date"; "FA Depreciation Book".SETRANGE("FA No.","FA No."); "FA Depreciation Book".SETRANGE("Depreciation Book Code",FASetup."Default Depr. Book"); IF "FA Depreciation Book".FIND('-') THEN BEGIN AcquisitionDate:="FA Depreciation Book"."Acquisition Date"; END; "FA Depreciation Book".SETRANGE("FA No.","FA No."); "FA Depreciation Book".SETRANGE("Depreciation Book Code","Depreciation Book Code"); IF "FA Depreciation Book".FIND('-') THEN BEGIN "FA Posting Group R".GET("FA Depreciation Book"."FA Posting Group"); CreditAcc:="FA Posting Group R"."Acquisition Cost Account"; AccountExpense:="FA Posting Group R"."Depreciation Expense Acc."; DebetAcc:="FA Posting Group R"."Accum. Depreciation Account"; "FA Depreciation Book".CALCFIELDS("Acquisition Cost","Book Value",Depreciation); SalvageValue := "FA Depreciation Book"."Salvage Value"; AcquisitionCost := "FA Depreciation Book"."Acquisition Cost"; END; VASA:="FA Depreciation Book"."No. of Depreciation Months"; IF VASA<>0 THEN BEGIN "DB%":=(AcquisitionCost-SalvageValue); END; IF "DB%"<>0 THEN BEGIN NORMA:=ROUND(("DB%"*12/VASA/AcquisitionCost*100),1); END; |
|