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

ADempiere DVD by Trifon Trifonov

Today's Enterprise software, particularly ERP-CRM is quite complex for use and administration. The same applies for sources and setup of workspace and build. Quite often in forums of ADempiere ERP-CRM we see complains that setup of development environment is complicated and labour extensive. Many times developers spend 2-3 days trying to setup workspace without result and post desperate messages in forums asking for assistance. In order to decrease time spent for setup i created ADempiere DVD which contains all ADempiere sources, Eclipse IDE and Sun JDK. All properly setuped and ready for use. Developer only need to copy one directory to his local hard drive and start customizing and extending ADempiere ERP-CRM suite. Currently there are two editions available: for Windows and Linux Operating systems. Trifon Trifonov

Compiere - Beginning of the end!

Compiere Inc. has very strange understandings for free: http://compiere.com/support/service-packs.php Is there a charge for downloading these service packs? The Service Pack is free of charge for customers on Standard and Extended level support subscriptions. For 2.6.3, the Service Pack is also available to customers on Self-service Support Subscriptions at no charge. Acording to the post all is free, but user must have subscription... We at ADempiere are totaly free as our migration and bug fixes which are more than 500 till now are free even for non subscribed users. One big THANK YOU to Compiere Inc. for leaving the battle field OPEN SOURCE to ADempiere and other forks. Trifon Trifonov

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