Cannot create invoice

I am having the same problem works on the android phone but not on the desktop Chrome or Firefox.
VPS Setup:
Debian 8 64Bit
Apache

If you say Debian 8: it may be related to this problem.
Please check this and report back.

Strange it would work when you would access the site with the IP address but not with the domain.

Anyway I reinstalled the VPS with Ubuntu 14.4 and all is well.

Thanks for the help

I’m running into the same issue.

I have included my system info as well as the stuff from the 500 error from console/fiddler

System Info
InvoicePlane 1.4.3
CentOS Linux release 7.1.1503 (Core)
Server version: Apache/2.4.6 (CentOS)
PHP 5.4.16 (cli) (built: Jun 23 2015 21:17:27)
mysqld Ver 5.6.26 for Linux on x86_64 (MySQL Community Server (GPL))

Thanks for all the hard work!

HTTP Request:
POST /invoices/invoices/ajax/create HTTP/1.1
Host: server.lan
Connection: keep-alive
Content-Length: 155
Accept: /
Origin: http://server.lan
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 Safari/537.36
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Referer: http://server.lan/invoices/dashboard
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.8
Cookie: ci_session=a%3A8%3A%7Bs%3A10%3A%22session_id%22%3Bs%3A32%3A%222bc2a98f76487baa969ee6c947b89de4%22%3Bs%3A10%3A%22ip_address%22%3Bs%3A11%3A%22192.168.0.3%22%3Bs%3A10%3A%22user_agent%22%3Bs%3A105%3A%22Mozilla%2F5.0+%28X11%3B+Linux+x86_64%29+AppleWebKit%2F537.36+%28KHTML%2C+like+Gecko%29+Chrome%2F44.0.2403.157+Safari%2F537.36%22%3Bs%3A13%3A%22last_activity%22%3Bi%3A1441842023%3Bs%3A9%3A%22user_data%22%3Bs%3A0%3A%22%22%3Bs%3A9%3A%22user_type%22%3Bs%3A1%3A%221%22%3Bs%3A7%3A%22user_id%22%3Bs%3A1%3A%221%22%3Bs%3A9%3A%22user_name%22%3Bs%3A10%3A%22Harp+%26+Hen%22%3B%7Df8e285057106d323b37b6061157c446128c0eb80

HTTP Response:

A Database Error Occurred

Error Number: 1366

Incorrect integer value: ‘’ for column ‘payment_method’ at row 1

INSERT INTO ip_invoices (invoice_date_created, invoice_group_id, invoice_time_created, invoice_password, user_id, payment_method, client_id, invoice_date_due, invoice_number, invoice_terms, invoice_status_id, invoice_url_key, invoice_date_modified) VALUES (‘2015-09-09’, ‘5’, ‘16:40:41’, ‘’, ‘1’, ‘’, ‘1’, ‘2015-10-09’, ‘INV-8’, ‘’, 1, ‘bbQ98Rp5C6BUunM’, ‘2015-09-09 16:40:48’)

Filename: /var/www/html/invoices/core/MY_Model.php

Line Number: 207

Thanks for this error log. Could you please post which payment method was set for this particular invoice?

Sure thing. And thanks for your hard work again!

I left everything the default, though I did change the invoice group and added a payment method.

At the risk of asking a dumb question, I added the payment method (Since I had not previously specified anything) But is there a mechanism to assign it to an invoice? (Maybe user error on my part, though you can see in the create invoice form it doesn’t give you an option to specify it there. I’ll poke around the docs a bit.)

Also I don’t if know if it helps, but I have included some screenshots and noticed that in the index_groups page, it looks like it increments the invoice, but the invoice never gets created (screenshot of invoice screen and group below.)

Original Error, with console open.
Note that the screen doesn’t update with an explict error we just see it in the console, so if you hit submit a number of times the invoice_group next_id will update in the below screenshots.

The invoice_groups screen that shows the ID is incremented up.

The invoice screen without invoice added.

2 Likes

Hello!

I had the exact same problem (thanks for this conversation I could finally find the error message) and could understand that one need to have created a payment method first, AND set one payment method in the invoices settings as default. If one does not do this correctly, creating new invoices will simply fail without any visible error. So to fix, create one payment method AND set it in the invoice settings as default payment method.

Thanks to Kovah for this really great piece of software. May I recommend that with AJAX, its best to not just print out errors when they happen, but to be situation-aware, so that for example if an error occurs during an AJAX call, that the error is formatted in JSON and later then display in the front-end gui.