Jump to content

Eu (Proforma) Invoicing Critical Bug


blesta_tester

Recommended Posts

There is a bug with it, I don't know why yet. Last proforma I wrote the previous month was #41, then of course I accepted some payments, these proforma invoices got converted to a normal invoices, and I've tried to create proforma yesterday. It got #0 assigned. Yes, 0, that's not a mistake :) That's why I ask Blesta developers if they're going to fix that in 3.5, because they haven't fixed it in 3.4.2. Without EU invoicing we cannot use Blesta billing.

normally what my plugin do , my plugin store the last proforma ID generated in a row table , and every timea proforma is created it increment it with +1 . when new proforma is created , my plugin check if the proforma ID is the same as stored in database , if yes it increment the last proforma ID to +1 . is the proforma generated has ID not the same as the last stored ID , it correct it and increment the last proforma ID +1 .

is so simple , if the proforma created has returned to 0 , there two probability .

1- the last proforma invoice row are not exist

1- you have changed the value for this row in the admin tools setting .

Link to comment
Share on other sites

The EU invoicing model must be fixed in Blesta core. I hope it will be :)

 

Summary:

1) Each proforma invoice must have unique and subsequent number.

2) When proforma invoice is paid the invoice date must be equal to payment date.

 

Do you guys agree?

Yes i agree, but you forgot one thing, client details have to be always saved on the invoice and cannot ever be changed once the final invoice is generated :)

Link to comment
Share on other sites

mostly for this last point, is solved by archiving the pdf, as saying it's impossible to change detail in invoice after being paid can never be solved, as even direct database access can change it, so I think it's more the method of archiving and stamp the pdf (sign it with certificate), that can solve this last point, but it's maybe out of the scope of Blesta.

Link to comment
Share on other sites

PauloV, thanks, I forgot that.

 

The summary is now:

 

1) Each proforma invoice must have unique and subsequent number.

2) When proforma invoice is paid the invoice date must be equal to payment date.

3) Client details have to be always saved on the invoice and cannot ever be changed once the final invoice is generated.

 

Serge, that is okay. Employees do not have direct access to database to alter the database content.

Link to comment
Share on other sites

mostly for this last point, is solved by archiving the pdf, as saying it's impossible to change detail in invoice after being paid can never be solved, as even direct database access can change it, so I think it's more the method of archiving and stamp the pdf (sign it with certificate), that can solve this last point, but it's maybe out of the scope of Blesta.

 

 

Only can be changed in direct database if data is uncrypted ;) Blesta has a function that encrypts all data so it can be handy in this case. Encrypt all client data on Array, is better this way.

 

 

Exemple:

 

If you have an PDF sored on file, and some change the data on database, it will not help, because you cannot find the file (if you alter the database file link), you can also generate a new Certified PDF on the fly, or even delet the file accidently or the file go corrputed, but if you have all data encrypted on database. you can search data and it will be very dificult to change data on database, and you will be able to generate PDF on the fly.

 

And because we can only auto back by default database in Blesta, if something goes rong you have backups to regenerate everything :)

 

I propose to save encrypted client data on Array in database, also, but not mandatory in my point of view, generate a file and save it, if the file dosent exists, Blesta will generate a new one, if not, blesta will link to the existing file :)

Link to comment
Share on other sites

Only can be changed in direct database if data is uncrypted ;) Blesta has a function that encrypts all data so it can be handy in this case. Encrypt all client data on Array, is better this way.

 

 

Exemple:

 

If you have an PDF sored on file, and some change the data on database, it will not help, because you cannot find the file (if you alter the database file link), you can also generate a new Certified PDF on the fly, or even delet the file accidently or the file go corrputed, but if you have all data encrypted on database. you can search data and it will be very dificult to change data on database, and you will be able to generate PDF on the fly.

 

And because we can only auto back by default database in Blesta, if something goes rong you have backups to regenerate everything :)

 

I propose to save encrypted client data on Array in database, also, but not mandatory in my point of view, generate a file and save it, if the file dosent exists, Blesta will generate a new one, if not, blesta will link to the existing file :)

 

 

i have created a separate plugin for testing purpose  to do the same thing , the only thing i ahev not stored the info in crypted stat .

what i have do :

 

when i invoice/proforma are generated , i get the info from the event add.invoice , i have stored this infor in a new table called "invoice_clients_data" , in my html invoice template i have chenged the database query to get the info from my table and not from the client table .

 

now even if the client change the info the invoice data should remaing the same .

 

tested and is working fine at the moment in my test server . maybe i will release it soon , or i will include it in the admin tools plugins .

 

BUT FINNALLY I HOPE THIS SHOULD BE IN CORE FEATURE .

Link to comment
Share on other sites

Is that option: Correct Date For New Invoice, under Invoices tab? I am facing to this trouble right now.

 

Thanks.

you need enable

Enable EU Invoicing

Correct Date For New Invoice

if you want a copy of invoice when it generated , this usefull for EU LAW enable

Save Invoice as PDF file when PAID Totally

Link to comment
Share on other sites

you need enable

Enable EU Invoicing

Correct Date For New Invoice

I checked that, and still one error: Due date. 

- in proforma invoice: invoice date was Mar 08, due date was Mar 12.

- when converted to normal invoice, the invoice date is Mar 18, but the due date is still Mar 12.

 

Can you check again please, naja7host?

Also, I would like to hear from Blesta guys if you can release a patch for this, before releasing a new version?

 

Thank you.

Link to comment
Share on other sites

I checked that, and still one error: Due date. 

- in proforma invoice: invoice date was Mar 08, due date was Mar 12.

- when converted to normal invoice, the invoice date is Mar 18, but the due date is still Mar 12.

 

Can you check again please, naja7host?

Also, I would like to hear from Blesta guys if you can release a patch for this, before releasing a new version?

 

Thank you.

as i though the due date should not be changed . because the due date is a fixed date in the proforma .

what others thinks ? due date should have date earlier than invoice date ? if yes , is should be the invoice date ?

i can change the code to make it as the invoice date . but ned more opinions about this subject .

Link to comment
Share on other sites

I checked that, and still one error: Due date. 

- in proforma invoice: invoice date was Mar 08, due date was Mar 12.

- when converted to normal invoice, the invoice date is Mar 18, but the due date is still Mar 12.

 

Can you check again please, naja7host?

Also, I would like to hear from Blesta guys if you can release a patch for this, before releasing a new version?

 

Thank you.

as i though the due date should not be changed . because the due date is a fixed date in the proforma .

what others thinks ? due date should have date earlier than invoice date ? if yes , is should be the invoice date ?

i can change the code to make it as the invoice date . but ned more opinions about this subject .

Link to comment
Share on other sites

So back to Paul's question...

 

What if the proforma invoice is paid late? Then changing the date billed to be the date paid would mean that the date billed is greater than the date due. For example:

 

Proforma date billed: 2015-02-01

Proforma date due: 2015-03-01

Proforma date paid: 2015-03-15

 

Now becomes:

 

Invoice date billed: 2015-03-15

Invoice date due: 2015-03-01

Invoice date paid: 2015-03-15

Link to comment
Share on other sites

So back to Paul's question...

 

What if the proforma invoice is paid late? Then changing the date billed to be the date paid would mean that the date billed is greater than the date due. For example:

 

Proforma date billed: 2015-02-01

Proforma date due: 2015-03-01

Proforma date paid: 2015-03-15

 

Now becomes:

 

Invoice date billed: 2015-03-15

Invoice date due: 2015-03-01

Invoice date paid: 2015-03-15

 

Cody check this, is what we want :)

 

 

Exemple 1) If the Invoice is the Final Invoice (converted from Pro-Forma to Invoice), the date is the date of the convertion, and not the date of Payment

 

Exemple 2) If the Pro-Forma Invoice is paid in full, the invoice is converted to Final Invoice, and the Final Invoice as to have the date of the convertion (converting from Pro-Forma to Final Invoice)

 

Exemple 3) If Pro-Forma invoice is partial paid, dont convert to final invoice, and the date stay the same

 

Think that Pro-Forma is one document and Final Invoice is anouther document totally diferent from the first one, and the dates dont have to do with each outher, thats why we need diferent sequential number, and we need also to check/search both documents in Blesta every day :)

Link to comment
Share on other sites

Cody check this, is what we want :)

 

 

Exemple 1) If the Invoice is the Final Invoice (converted from Pro-Forma to Invoice), the date is the date of the convertion, and not the date of Payment

 

Exemple 2) If the Pro-Forma Invoice is paid in full, the invoice is converted to Final Invoice, and the Final Invoice as to have the date of the convertion (converting from Pro-Forma to Final Invoice)

 

Exemple 3) If Pro-Forma invoice is partial paid, dont convert to final invoice, and the date stay the same

 

Think that Pro-Forma is one document and Final Invoice is anouther document totally diferent from the first one, and the dates dont have to do with each outher, thats why we need diferent sequential number, and we need also to check/search both documents in Blesta every day :)

@PaulV , i think cody ask about the due date and not the invoice date , and her question is clear , is the same issue as @phamhung has .

sometimes the due date will be earlier than the invoice date .

@Cody , i have asked about this subject , the answer was no probleme , because the due date can also be referrel to the proforma , and in most case the due date is not needed to be mentioned if the invoice is paid fully , as is not a legal element that the invoice should have , as the date and the number and other info . but i preffer listen to more EU customers about this subject .

Link to comment
Share on other sites

Setting the date billed to the date paid should be simple enough, but not displaying the due date is another issue. Once an invoice is an invoice, I don't believe there is any record of it once being proforma.

 

Is it a problem if the due date is also set to the date billed / date paid? Or maybe change the due date only if it is older than the date billed / date paid? Or is it standard to not display the due date at all? If we don't display it at all, we need to be able to tell that it use to be a proforma invoice.

 

Thoughts?

Link to comment
Share on other sites

yes:

 

So i can resume , the due date should be showed in proforma invoice , after convertion to final invoice is not needed to be shown , for that reason is safe to not change the due date . It remain a reference for proforma invoice .

 

I think I pointed this before in a simillar post.

Link to comment
Share on other sites

CORE-1605 - When proforma is converted to an invoice, set date billed to current date

 

Also, CORE-1561 - Requeue invoice for delivery when converted from proforma

 

Both of these should be in 3.4.3 as soon as next week.

 

That leaves 2 things I believe, please correct me if I'm missing anything.

 

1. CORE-1287 - Prevent Proforma and draft invoices from reusing numbers. This is more complex.

2. Do not display date due on invoices converted from proforma.

 

On #2 I think some more discussion is required. There are a couple ways to do this:

 

1. Have an invoice settings option to disable the display of due dates on all invoices. This may be useful for those who do not use proforma as well.

2. Do not display due dates on invoices that were created from paid proforma invoices. If we do this, we need to store more information on the invoice that indicates that it was previously a proforma invoice, possibly another field in the table.

 

Thoughts on #2? Thoughts on CORE-1605, CORE-1561, or CORE-1287?

 

EDIT: Also, to add, it would be simple to remove display of the due date on invoices that are not proforma with a little code. So, while we come up with the best solution, you could make this change now to affect all invoices (but not pro forma).

Link to comment
Share on other sites

2. Do not display date due on invoices converted from proforma.

 

On #2 I think some more discussion is required. There are a couple ways to do this:

 

1. Have an invoice settings option to disable the display of due dates on all invoices. This may be useful for those who do not use proforma as well.

2. Do not display due dates on invoices that were created from paid proforma invoices. If we do this, we need to store more information on the invoice that indicates that it was previously a proforma invoice, possibly another field in the table.

 

Thoughts on #2? Thoughts on CORE-1605, CORE-1561, or CORE-1287?

 

EDIT: Also, to add, it would be simple to remove display of the due date on invoices that are not proforma with a little code. So, while we come up with the best solution, you could make this change now to affect all invoices (but not pro forma).

 

Simplest option is to add a few settings under "Display on Invoice" in [settings] > [Company] > [billing/Payment]:

 

[ x ] Date Due for Drafts

[ x ] Date Due for Standard Invoices

[ x ] Date Due for Pro forma Invoices

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...