IF NOT CONFIRM(Text000,FALSE) THEN EXIT; LoanID := STRSUBSTNO('%1/%2/%3/%4',"No.",LoanSchemes.Code,StartingMonth,StartingYear); IF Status = Status::Active THEN BEGIN WITH LoanScheduler DO BEGIN INIT; "Staff ID" := "No."; "Loan ID" := LoanID; "Starting Month" :=Month; "Starting Year" := StartingYear; Principal := "Loan Amount"; "Monthly Payment" := LoanCalculator.LoanCalculator("Loan Amount","Annual Interest Rate"/100, "Repayment Period",NoofRepayment); "Ending Month" := EndingMonth; "Ending Year" := EndingYear; "Outstanding Amount" := "Total Amount to be Paid"; "Transaction Date/Time" := CREATEDATETIME(TODAY,TIME); "User ID" := USERID; StartingMonthInteger := MonthBuffer.ReverseMonthCalculator(Month); LoanScheduler.EndingMonthInteger := MonthBuffer.ReverseMonthCalculator(EndingMonth); "Approved By" := "Approved By"; "Annual Interest Rate (%)" := "Annual Interest Rate"; "Loan Repayment Period" := "Repayment Period"; "No. of Payment in a Year" := NoofRepayment; "Approved By" := ApprovedBy; "Total Repayment Amount" := "Total Amount to be Paid"; "Loan Code" := LoanSchemes.Code; LoanScheduler.Description := "Loan Name"; LoanScheduler."Total Interest to be Paid" := "Total Interest Amount"; INSERT; END; END; "Loan Amount" := 0; ApprovedBy := ''; "Annual Interest Rate" := 0 ; "Repayment Period" := 0; NoofRepayment := 0; ApprovedBy := ''; LoanSchemes.Code := ''; BasicSalary := 0; "Loan Name" := ''; StartingMonth := StartingMonth::" "; Calculator;
Comments
perhaps a findlast or getnextentryno function would do the trick with the entry no.
|To-Increase|
I added a the FINDLAST and it worked