FINCUST-16037
Log in as superuser. Go to the task "Edit customer invoice layout rule
Edit the rule. Add 1 line where we have invoice type = "Subscription" and business form layout = "Customer Invoice printing run" and a second line where invoice type = "Service" and business form layout = "Customer invoice - report designer
View the business form layout for customer invoice - Report designer and click into the custom report called "Customer invoice printing report - custom report design"
In the share tab set the "report definition sharing options to the option "Dont share report definition
Create a dunning level group.
Create two invoices one that has a invoice type of "service" and one with invoice type of "subscription" that are overdue and appear in dunning group
click to edit
Login as ARAnalyst
Select the task "print dunning letters" and enter in appropriate details and select the option "generate associated invoice pdf"
Verify that a pdf has been created for the dunning letter and customer invoice.
Verify that the invoice of invoice type "subscription" is not printed as part of the invoice pdf. It is however displayed in the dunning letter pdf. Also the status in the "View dunning letter printing run group" will be completed with errors. We will also display the invoice that has failed.
Create two overdue invoices which have the type "service"
Login as ARAnalyst
Select the task "print dunning letters" and enter in appropriate details and select the option "generate associated invoice pdf"
Verify that a pdf has been created for the dunning letter and customer invoice.
Verify that we have a status of completed and no errors are displayed.
select the task "find dunning letter print run". Select print run and verify that the correct status is shown and that if an error is shown that we specify the invoice number.
After the print dunning task has been completed and we can see the status as "completed with errors"
Open the offending invoice and go to the print run tan. Click on magnifying glass of the dunning print run and verify that the status is displayed as "completed with errors" for the run.
In the dunning level group add a dunning level which has a business form layout not associated with Dunning letters. e.g. we do not set "Dunning letter level " etc.
Run the print dunning letter task and verify that an error is produced because we do not use a Dunning letter specific business form layout.
Create two customer invoices where we have type of subscription
Run the task "print dunning letters"
Verify that error is produced and that the invoice numbers are displayed are displayed.
Verify also that the invoices are referenced in the dunning letter pdf and that no invoice pdf is created.
Verify that the invoice that failed is declared.
Verify also that when we go to the invoice. Select printing run tab and then the magnifying glass associated with the dunning letter print run that we see the correct statu
Perform the task "schedule print dunning letter" for a time in the future. Run the task that has an invoice where the user does not have access.
After the time has elapsed. Go to the task "Find dunning letter print run" and verify that error status is displayed