Skip to main content

Automatic Invoice Printing/Emailing in ADempiere

Recently i was involved in business process automation with ADempiere. Goal was to make most of the processes as automated as possible. With this post i would like to share my experience in Automatic Invoice printing and email sending to the end customers.

Out of the box ADempiere comes with a process called "Print Invoices". It is located under "Quote-to-Invoice"->"Sales Invoices" in the main menu.

"Print Invoices" process parameters
This process has few parameters(non of them is mandatory). Most of the parameters allow user to filter which Invoices to be printed based on: date range of Date Invoiced, Customer, Specific Invoice or Range of Invoice numbers. Top two parameters "EMail PDF" and "Mail Template" change behavior of "Print Invoices" process and turn it into email sending process.
Note: If you tick "EMail PDF" check-box then "Mail Template" parameter is also mandatory.
We will get back to the EMail sending functionality later.

Upon successful execution of "Print Invoices" process, ADempiere displays total number of Invoices printed. Not so interesting screen for me but i wanted to give you idea how all steps look like.

"Print Invoices" result screen
So far invoice printing produced paper Invoices for us. This was not so challenging to achieve, but i had to hack the code a bit as ADempiere always wanted to have at least one of the process parameters filled(either specific Invoice, Customer, Date range or Invoice number range). We wanted completely automated process, i.e. no user interaction or fixed process parameters.
It is time to move to the next question. Can we send automatically EMails to our customers with the same process?
As you might guess it should be possible. Every ERP system pretending to be modern should be able to send EMails. Steps to setup automatic EMail sending in ADempiere are quite easy.

  • Define Mail Template.
"Mail Template" window is located under: "Partner Relations"-->"Mail Template".
We have to enter Name of our EMail Template, Subject and Body(Mail Text). ADempiere allows us to use variables in the EMail body, so that we can have more personalized EMail messages. In this case i have used @Name@ to substitute name of the EMail recipient. 
Mail Template

After defining EMail template we should be able to manually start "Print Invoices" process and to send personalized EMail messages with Invoices attached as PDF files.
  • Schedule "Invoice Print" process
Second step from the setup process is to define scheduled execution of "Print Invoices" process.
We have to create new record in "Scheduler" window. Most important here is to define which is the process we want to schedule, scheduled interval, name of the schedule and values of report parameters which ADempiere scheduler should pass to the process when invoking it.

Schedule
We will define values of only two parameters:

  1. Parameter "EMail PDF". We will set default value to "Y"(Yes). This will instruct "Print Invoices" process to send EMails.

Parameter "EMail PDF"
  1. Parameter "Mail Template". Here we have to set default value to be the ID of the "Mail Template" we created above. In my case this was 1 000 000. 

Parameter "Mail Template"
Now we are ready to test our new workflow. Please restart your application Server(Have to check)???





Comments

Popular posts from this blog

Compiere Inc. still do not know how to make developer friendly environment

I work with Compiere and it's fork Adempiere since 2.5 years. During all this years till Adempiere was born i had big headache each time new version was produced by Compiere Inc. because of the lack of proper Eclipse IDE setting. I had to manually set project setting inside Eclipse for all Compiere ERP-CRM sub-projects. This process took around 1-2 hours if all source files were provided by Compiere Inc. There were cases when Compiere Inc. forgot for given class and source were non-compilable. A recent post from Enrique Ruibal reminded me about this past headaches: https://sourceforge.net/forum/message.php?msg_id=4679608 Adempiere() is much more mature and developer friendly project. At least i'm trying to keep all IDE setting up to date and working. Good luck

Compiere vs. ADempiere: Count of Partners

ADempiere project is one year old now, more precisely 13 months old. Before one year father project Compiere had around 60 partners, which was quite good number. Each partner was obliged to pay 3 000 USD per year which made 180 000 USD income only from partners. Today Compiere has 32 partners and each pays 8 000 USD = 256 000 USD year. It looks that Compiere Inc. managed to increase it's income, but number of partner dropped by half. It is Compiere inc. decision how much to charge for partnership, i'm not going to discuss this now. But it is very interesting observation that although income from partners increased Compiere Inc. decided to close source code access to Service Packs and push users to pay for it. It looks that only money from partners are not enough for the Inc.. Well it is again Compiere Inc. right to decide how much to charge for access to source code and how much not to charge, but users can see that functionality which ADempiere provides get bigger and bigger e...