baimard/gestion

Error when creating an invoice

normen opened this issue · 3 comments

Describe the bug
When pressing the button to create an invoice theres a 500 server error. The invoice is created nonetheless.

To Reproduce
Steps to reproduce the behavior:

  1. Open Gestion
  2. Click on 'Add Invoice'
  3. See Error
  4. See that invoice is created anyway

Expected behavior
The invoice should be created without error.

Screenshots
Bildschirmfoto 2022-11-13 um 18 29 10

Logs

[index] Fehler: Doctrine\DBAL\Exception\DriverException: An exception occurred while executing a query: SQLSTATE[42883]: Undefined function: 7 ERROR:  function last_insert_id() does not exist
LINE 1: SELECT LAST_INSERT_ID();
               ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts. at <<closure>>

 0. /var/www/html/3rdparty/doctrine/dbal/src/Connection.php line 1780
    Doctrine\DBAL\Driver\API\PostgreSQL\ExceptionConverter->convert(Doctrine\DBAL\Driver\PDO\Exception {}, Doctrine\DBAL\Query {})
 1. /var/www/html/3rdparty/doctrine/dbal/src/Connection.php line 1719
    Doctrine\DBAL\Connection->handleDriverException(Doctrine\DBAL\Driver\PDO\Exception {}, Doctrine\DBAL\Query {})
 2. /var/www/html/3rdparty/doctrine/dbal/src/Statement.php line 193
    Doctrine\DBAL\Connection->convertExceptionDuringQuery(Doctrine\DBAL\Driver\PDO\Exception {}, "SELECT LAST_INSERT_ID();", [], [])
 3. /var/www/html/lib/private/DB/PreparedStatement.php line 87
    Doctrine\DBAL\Statement->execute([])
 5. /var/www/html/custom_apps/gestion/lib/Db/Bdd.php line 314
    OC\DB\PreparedStatement->execute([])
 6. /var/www/html/custom_apps/gestion/lib/Db/Bdd.php line 262
    OCA\Gestion\Db\Bdd->execSQLNoJsonReturn("SELECT LAST_INSERT_ID();", [])
 7. /var/www/html/custom_apps/gestion/lib/Db/Bdd.php line 115
    OCA\Gestion\Db\Bdd->lastinsertid()
 8. /var/www/html/custom_apps/gestion/lib/Controller/PageController.php line 279
    OCA\Gestion\Db\Bdd->insertFacture("megalith")
 9. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 225
    OCA\Gestion\Controller\PageController->insertFacture()
 10. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 133
    OC\AppFramework\Http\Dispatcher->executeController(OCA\Gestion\Controller\PageController {}, "insertFacture")
11. /var/www/html/lib/private/AppFramework/App.php line 172
    OC\AppFramework\Http\Dispatcher->dispatch(OCA\Gestion\Controller\PageController {}, "insertFacture")
12. /var/www/html/lib/private/Route/Router.php line 298
    OC\AppFramework\App::main("OCA\\Gestion\\C ... r", "insertFacture", OC\AppFramework\ ... {}, ["gestion.page.insertFacture"])
13. /var/www/html/lib/base.php line 1030
    OC\Route\Router->match("/apps/gestion/facture/insert")
14. /var/www/html/index.php line 36
    OC::handleRequest()

POST /apps/gestion/facture/insert
from 2003:d7:1708:a400:915:afc6:c9e1:2c4 by megalith at 2022-11-13T17:29:09+00:00

Nextcloud

  • Version 24.0.7 (PHP-FPM Docker)

Desktop (please complete the following information):

  • OS: iOS, MacOS
  • Browser Safari
  • Version 16

Smartphone (please complete the following information):

  • Device: iPhone/iPad/MacBook

Additional context
Add any other context about the problem here.

Its a postgres 13 database running in a separate docker container, anything other info I can supply?

it's du to that line : LINE 1: SELECT LAST_INSERT_ID();

Sorry for that I will correct this bug