The changes for enable patient letters to be created and populated during charging.
However the application context (i.e. fields like OpenVPMS.location etc), is only supplied if parameters are prompted for; reports generated without user input cannot access the application context.
The workaround is to select the Patient Letter in Patients - Medical Records - Documents, and click Refresh.
This will re-generate the document from the template. Note that not all fields may be available, and that the current context may be different to that of the original charge.