Generazione Automatica Fatture
This is one of the pre-installed Cron Jobs in the VikBooking Plugin. By choosing the Class File 'invoices generator.php' when adding a new Cron Job, you will be able to configure the parameters for setting up this recurring action. The job will use the current configuration for the invoices generation in PDF format so it is recommended to generate at least one invoice manually from the page 'All Bookings' to configure the auto-increment Invoice Number and to set the Company Legal Information. The job will guarantee the best result if executed at regular intervals of one time per day unless you wanted to click the Execute button every day from the back-end.
Once configured, the system will automatically generate invoices in PDF format and, optionally, the system will also send the generated invoices via email to the customer. This Cron Job is supposed to make you save a lot of time and to deliver the invoices to the customers exactly on time.
If you configure the job to send the invoices via email (as attachment), then you should set a custom text for the email message. The custom email text can be translated into other languages from the page 'Global - Translations' and it accepts HTML code even though there is not an HTML editor to compose it. You should use another editor and paste the HTML code in the text-area in this case. Pay attention when using HTML images because the same cron job could be executed from the front-end and from the back-end. For this reason you should not use any relative paths, just the full http source of the image hosted on your server or on any external server.
The parameters required are the ones below:
- Generate Invoices: After the Check-in Date, After the Check-out Date or Whenever the booking status is Confirmed.
- Invoices Date: the date to be used for the invoices. Either the generation date or the booking date. Depending on the policy of the Hotel, this should solve a lot of issues.
- Skip OTAs Bookings: if enabled, all the bookings that were transmitted by Vik Channel Manager, will be skipped and the invoices will not be generated. This depends on the payments policy with the OTAs.
- Send Invoices via Email: if enabled, the generated invoices will be sent to the customers upon creation. Please remember that from the page 'Invoices' you can always check if an invoice was ever emailed to the customer.
- Email Subject: no explanation should be necessary for this parameter
- Message to be sent via Email. This text accepts special tags that will be replaced with the corresponding values such as {checkin_date}. All the available tags are the ones below the text-area field for the message. No other special tags could be used unless you decided to modify the PHP code of this Cron Job or, better, to create a new Cron Job Class File by following the Developers section of the Documentation.
If the invoices generation is set to After the Check-in Date, the system will fetch all the bookings with a check-in date in the past for which an invoices was never generated.
The invoices generation type Whenever the booking status is Confirmed will read all the bookings status Confirmed, with a booking total greater than zero, for which an invoice is missing.
Lastly, the invoices generation type After the Check-out Date, will take all the bookings with a check-out date in the past whenever the execution date is. Only the (Confirmed) bookings that are missing an invoice will be processed.
This Cron Job stores in the database all the bookings that have an invoice generated. This means that the cron job will never create the same invoice twice, not even if the booking was modified. In this case the invoice should be removed from the page 'Invoices' of the Management Menu, and re-generated.
If no email messages are being sent to the customers with the PDF file attached, then you should check the configuration of the Custom Fields (there should be just one field of type Text marked as 'Email' and mandatory). Also, you should check the Sender Email address in the Configuration page because some Mail Servers could accepts the emails to be sent only from one specific postmaster address. Lastly, make sure that the Invoices are actually being generated from the page Invoices and then check if your Mail Server rejects attachments.