<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Apr 14, 2022 at 3:36 AM Martin Allen <<a href="mailto:martin.allen@exe-squared.co.uk">martin.allen@exe-squared.co.uk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div lang="EN-GB" style="overflow-wrap: break-word;">
<div class="gmail-m_4979078921417408861WordSection1">
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><span><a id="gmail-m_4979078921417408861OWAAMD8F9D2189073487EB08667521185AEF1" href="mailto:gitlab@code.vtiger.com" target="_blank"><span style="font-family:Calibri,sans-serif;text-decoration:none">@Ruben A. Estrada</span></a> If you have created
all the Invoices in advance, does this prevent the vtigercron from creating them again, when it gets to the recurring date for the next invoice? Looking at your merge request I can’t see anything that identifies if the invoice was created already? (Admittedly
I cant see if you are altering the recurring invoice data after creating them manually… but presume you must be doing something like that, as you cant manually create them a second time)?</span></p></div></div></blockquote><div><br></div><div>Martin, yes, I've taken care of that. There is a table called vtiger_invoice_recurring_info which stores the date when the last invoice in the series was created. When creating all of them in one shot with the new feature, that field gets updated so when the cron runs, it'll know there is no invoice to be created (see: RecurringInvoice::saveNextInvoiceCreationDate()). In fact I refactored the whole "Recurring Invoice" cron service so that the cron and my feature both use the same class "RecurringInvoice" to do the job. The code was quite old and messy and I believe it's a little bit better now.</div><div><br></div><div>About the comments by everyone else in this thread, I'm aware there are country to country differences which might make this feature not useful to your specific country. But at the very least, if you use the recurring invoice feature of vtiger, you can get an idea of how many and when the next invoices are going to be created (just hit cancel when the modal opens up). In my particular case (Mexico), an Invoice only becomes valid/official after doing a "digital signature process" involving certificates, private keys, etc (I have an extension for doing just that: <a href="https://simplesistemas.com/extensiones/facturacion-electronica-cfdi-para-vtiger">https://simplesistemas.com/extensiones/facturacion-electronica-cfdi-para-vtiger</a>). If an invoice does not get signed, it doesn't officially exist. Also, I think my MR should be accepted just because of the refactoring of the Recurring Invoice cron job.</div><div><br></div><div>Nice week everyone!</div></div></div>