Jump to content

This topic is 1277 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hi all

I'm looking to display to the user when the last payment was made for a lease (from the invoice table) to include date and amount paid. 

The payment table is related to the lease table by a LeaseID. Inside the invoice table I have Type (which defines the record as a "payment" or "charge"), Date, and Remittance, which is what needs to be shown. I'm assuming this would need to be an SQL statement where it gets the latest date from the invoice table where the record is marked as "payment" in the Type field. Then an additional calculation field to show the remittance amount.

Can this be done natively? 

Posted

In the payment table create a DatePaid field calculation: If ( Payments::Type = "Payment" ; Date )  then in the script just calculate Max ( DatePaid ) setting a field.

You could also do this with a WHILE function and avoid having to add extra calculation fields. 

  • Like 1
Posted
Ocean West
This post was recognized by Ocean West!

comment was awarded the badge 'Great Support' and 1 points.

Actually, you do not need to add anything to your schema for this. Just place a one-row portal to the payments table on the lease layout, sort it by date, descending (if the relationship is not sorted that way already) and filter it to show only records whose type is "payment".

 

  • Like 1

This topic is 1277 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.