Jump to content

Edit Proforma Invoice Via Invoices Model Cause Invoice Status To Active Invoice


Blesta Addons

Recommended Posts

we have a voided invoice .
 
when we  add a public_note via invoices model to a voided invoice ,  the invoice status back to active .
 
the code used is :

$this->Invoices->edit($invoice_id, array('note_public' => "test a note"));

NOTE : the invoice type is proforma .
NOTE 2 : tested with invoice an active proforma .

so any proforma invoice when e edit it via the model invoice with out set the invoice status , it convert to active invoice even if is not tottaly paid .

Link to comment
Share on other sites

the bug is related to function getNextInvoiceVars()  n this code

elseif ($vars['status'] == "proforma" || (($new || (isset($vars['prev_status']) && in_array($vars['prev_status'], array("void", "draft")))) && $client_settings['inv_type'] == "proforma")) {
   $vars['status'] = "proforma";
   $inv_format = $client_settings['inv_proforma_format'];
   $inv_start = $client_settings['inv_proforma_start'];
  }

the function return back the status to proforma and remove the void status .

Link to comment
Share on other sites

  • 2 weeks later...

UPDATE :

the bugs is not related only to voided proforma, also to active proforma invoice .

if the status is not set in the $vars , the invoice is converted to active invoice .

this will cause a serious law problems for us , as proforma is not paid and converted to invoice, the client is required to pay it even if he doesn't want to renew or pay the services the proforma is for . and the client claim because they have not yet decided to pay or not , and we issue them a invoice without their acceptance .
 

we are working a lot with invoice model , to edit private/public notes, date due ... ect

 

PLEASE A QUICK FIX AS SOON AS POSSIBLE .

Link to comment
Share on other sites

  • 2 weeks later...
  • 7 months later...

this issue has caused a serious problems .

when we set a note to a voided proforma invoice it back again to open status even if we set status to void in the call

$this->Invoices->edit($invoice_id, [
			'note_public' => "Some Note",
			'status' => "void"
		]);

how to reproduce the case,

void a proforma invoice, via a model call the above code . the proforma invoice status back to open !!!!

Link to comment
Share on other sites

this issue  has more thing to review .....

editing a proforma via Invoices->edit(); change the proforma status to invoice . let say we want to add public_note to proforma , , a change via the model convert the proforma to invoice !!!

 

        $this->Invoices->edit($invoice_id, ['note_public' => "puvlic note here");

 

i think is so logical do not change the status if no status was passed to $vars !? really we have understand the logic of blesta team about changing invoices/proforma .!

 

 

Link to comment
Share on other sites

2 hours ago, Blesta Addons said:

this issue  has more thing to review .....

editing a proforma via Invoices->edit(); change the proforma status to invoice . let say we want to add public_note to proforma , , a change via the model convert the proforma to invoice !!!

 

        $this->Invoices->edit($invoice_id, ['note_public' => "puvlic note here");

 

i think is so logical do not change the status if no status was passed to $vars !? really we have understand the logic of blesta team about changing invoices/proforma .!

 

 

Did this work in 3.6? I don't think we changed anything to do with proforma invoices in v4.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...