Suggest Rent Payments

nvermanverma Member Posts: 396
Hello,

We are doing an implementation for one of our client which will help them keep track of their leased properties, rental payments, maintenance requests, starting and ending of lease and history of leased properties. I have created the following tables: Property (contains records of all the properties leased and owned and all the attributes of the property), Tenant (table maintains the record of tenants that are linked to a particular property with complete tenant details), Lease Renewal (contain record of complete lease renewal details like Lease start/End date, notice to landlord, etc), Rent Scheduled (contains information regarding the rent increases scheduled by property).

One of their requirements is integrating it with Finance. To do this, "Suggest Rent Payments" functionality will be added to the Payment Journal form which will list all the outstanding rental payments (from Lease Renewal Table) based on the filtering criteria entered by the user (it will be similar to "Suggest Vendor Payments").

I looked at the batch report for the "Suggest Vendor Payments" and I didn't get/understand anything. I tried debugging it just keeps going on and on. I am not really sure what to do? Therefore, can anyone help me tackle this problem since I am so lost.

Comments

  • ara3nara3n Member Posts: 9,256
    I suggest to write the process yourself. I had to make similar modification but for customers. This client was paying customers a lot for credit memo's.
    Instead of following the code for suggest vendor, it was easier to just loop through open customer ledgers and creating the payment lines.

    The Suggest vendor payment does a lot more based on amount allocation etc, that you probably don't need.

    if the consultants/client really wants all the features, then you need to leave the logic as is. and change the part where it goes to vendor ledger to get the data for open entries, Change that code to get the entries from your rental entries and the code should take care of the rest. Nav writes them into a buffer and then goes into the logic.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • nvermanverma Member Posts: 396
    After talking to the client. He explained to me that Payment Journal line should be created if the "Current Monthly Rent" field in the "Lease Renewal" table has a value.

    Now I just have to figure out how to create a Payment Journal Line based on this condition.
  • nvermanverma Member Posts: 396
    So I wrote this code, but I am not sure where exactly to put it (as in which trigger to put it) or even if it correct. Basically what I need the code to do is go through each record in "Lease Renewal: table and if the "Current Monthly rent" field is not empty, create a Payment Journal Line for that record.

    Currently I created a button in Payment Journal called "Suggest Rental Payments". Which is linked to a process report that I created called "Suggest Rent Payment"

    This code is currently in the repport trigger called "Lease Renewal - OnAfterGetRecord"
    IF "Lease Renewal"."Current Monthly Rent" <> 0.0 THEN
    BEGIN
    WITH GeneralJnlLine DO BEGIN
      INIT;
      LastLineNo := LastLineNo + 10000;
      "Line No." := LastLineNo;
      "Posting Date" := PostingDate;
      "Document Type" := "Document Type"::Payment;
      "Document No." := NextDocNo;
      NextDocNo := INCSTR(NextDocNo);
      Description := "Lease Renewal"."Property Management Co.";
      Amount := "Lease Renewal"."Current Monthly Rent";
      "Cost Center Code" := "Lease Renewal"."Cost Center Code";
      "Shortcut Dimension 1 Code" := "Lease Renewal"."Global Dimension 1 Code";
      "Shortcut Dimension 2 Code" := "Lease Renewal"."Global Dimension 2 Code";
      "Shortcut Dimension 3 Code" := "Lease Renewal"."Shortcut Dimension 3 Code";
      "Shortcut Dimension 4 Code" := "Lease Renewal"."Shortcut Dimension 4 Code";
      "Shortcut Dimension 5 Code" := "Lease Renewal"."Shortcut Dimension 5 Code";
      "Shortcut Dimension 6 Code" := "Lease Renewal"."Shortcut Dimension 6 Code";
      "Shortcut Dimension 7 Code" := "Lease Renewal"."Shortcut Dimension 7 Code";
      "Shortcut Dimension 8 Code" := "Lease Renewal"."Shortcut Dimension 8 Code";
      "Fund No."  := "Lease Renewal"."Fund No.";
      "Allocation Code" := "Lease Renewal"."Allocation Code";
      "Ctl. Fund No." := "Lease Renewal"."Ctl. Fund No.";
    
      GeneralJnlLine.INSERT(TRUE);
    END;
    End;
    

    I am not really sure what I am doing. Any suggestions would be greatly appreciated.
Sign In or Register to comment.