Get data from other Dunning document

Hello everyone,

i need your help.

I have a dunning template. If i create a dunning then i get the date of today with
{{ frappe.format_date(doc.posting_date) }}.

I would like to get the date from the last dunning and transfer them to the new created dunning.

I need only the date of the last dunning from the same customer.

Which code do i need for this?

Thank you for your help.