Can't create a quote or invoice

I have the same problem with creating invoices or quotes.

Didn’t want to jump into someone’s support thread but Kovah since you have access to the /kovah/ installation on my server I thought it may help you troubleshoot this problem (if the problem on my server is the same as what’s being described above).

Okay I will take a look into this if possible.

Hi,

I’m having the same problem, I tried to create a invoice from a quote and I after I click Submit nothing happens. The weird this is that it does work If I had the language set to english I used it in spanish and it does not work. I did a fresh install with 1.4.4 and with a clean database it does work, if I restore my database the problem begin.

The webconsole shows this:

31http://172.16.0.141/quotes/ajax/quote_to_invoice Failed to load resource: the server responded with a status of 500 (Internal Server Error)
jquery-1.11.2.min.js:4 POST http://172.16.0.141/quotes/ajax/quote_to_invoice 500 (Internal Server Error)send @ jquery-1.11.2.min.js:4m.extend.ajax @ jquery-1.11.2.min.js:4m.(anonymous function) @ jquery-1.11.2.min.js:4(anonymous function) @ VM1759:8m.event.dispatch @ jquery-1.11.2.min.js:3r.handle @ jquery-1.11.2.min.js:3

I cannot find any error on apache.

Thanks!

Hi there,

I’m new there, so first, hi to the community. :smile:

I have the same problem. I updated to 1.4.5 this morning and the problem still occurs.

I only have the 500 error on quotes/ajax/quote_to_invoice in the firebug console.
No error in the nginx log.
I’ve tried to set back language from french to english but it didn’t change anything.
Firefox, Edge, IE, same behaviour.

If you need further details, just telle me, I’ll try to provide them.

the problem seams connected with this function into the file invoices/models/mdl_items.php

 public function save($id = NULL, $db_array = NULL) {
    $id = parent::save($id, $db_array);

    $this->load->model('invoices/mdl_item_amounts');
    $this->mdl_item_amounts->calculate($id);

    $this->load->model('invoices/mdl_invoice_amounts');

    if (isset($db_array->quote_id)) {
        $this->mdl_invoice_amounts->calculate($db_array->quote_id);
    }
    
    return $id;
}

In some cases $db_array is an array, in some other cases is an object.

For example, in quote_to_invoice the code that call the funtion is this

 foreach ($quote_items as $quote_item) {
            $db_array = array(
                'invoice_id' => $invoice_id,
                'item_tax_rate_id' => $quote_item->item_tax_rate_id,
                'item_name' => $quote_item->item_name,
                'item_description' => $quote_item->item_description,
                'item_quantity' => $quote_item->item_quantity,
                'item_price' => $quote_item->item_price,
                'item_order' => $quote_item->item_order
            );

            $this->mdl_items->save(NULL, $db_array);
        }

so the var $db_array is passed as array.

Yesterday we discovered another case where the var was passed as object

@Kovah , you are the most expert to know if is better to pass the var as array or object , depending on how many times it is used as array or object

Will be fixed in 1.4.6 which will be released next sunday with some other small fixes

https://development.invoiceplane.com/browse/IP-379

1 Like