Page 1 of 1

Batch print/email, multiple attachments to same debtor

PostPosted: Mon Jan 15, 2024 12:07 pm
by DannyC
I'm looking into developing a plugin which can grab all the invoice PDFs (or delivery docket, pick slip i.e. whatever the report type is but typically invoice) going to the same debtor and attaching them all to a single email.

I've found this thread which gives me a clue, but not sure how I would go about it from the BatchPrint business logic.
viewtopic.php?f=26&t=1335

I assume I'd hook into the BatchPrint.ProcessStart? Maybe the BatchPrint.ProcessingLine?
And then how would I
add a handler for the SaveStart of the JiwaApplication.JiwaEmail.EmailMessage object before the salesOrder.Email() method is invoked.


I think I need a head start on this one :?

Re: Batch print/email, multiple attachments to same debtor

PostPosted: Mon Jan 15, 2024 3:58 pm
by SBarnes
Can you explain a bit more of what you are trying to acheieve as I can't see why you actually need a plugin and the batch printing screen can't achieve what you need out of the box?

Re: Batch print/email, multiple attachments to same debtor

PostPosted: Mon Jan 15, 2024 5:23 pm
by DannyC
Out of the box, the Batch Print/Email screen sends 1 email with 1 attachment per line, i.e per invoice.

If there are a few candidate sales orders to the same debtor, combine them into 1 email with multiple attachments.

Re: Batch print/email, multiple attachments to same debtor  Topic is solved

PostPosted: Mon Jan 15, 2024 5:35 pm
by SBarnes
Oh, you would be overriding the entire way that the process object in that screen currently works i.e. totally overriding the business logic which drills down in to each line and prints/emails the reports, one line doesn't know about another so therefore I doubt what you are trying to achieve would be possible within the existing screen.

You would probably need to create a new screen which filled up a grid of debtors and the did the logic of what you are describing which is a fair bit of work and probably well beyond what can be covered in a forum post.