Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when BankStatement (csv file) has no sign value #780

Open
Tobias-Horstmann opened this issue Apr 1, 2016 · 1 comment
Open

Error when BankStatement (csv file) has no sign value #780

Tobias-Horstmann opened this issue Apr 1, 2016 · 1 comment

Comments

@Tobias-Horstmann
Copy link

v 0.4.53
I have created a bank account and uploaded a csv file with following content:
"Tobias,ToCancel,HWV3YK60,67.00,01.04.2016" with UTF-8 encoding.
When setting the format for the bank account and set the field sign value for example to "+" and clicking on save I got the following error:

"
An error occurred
Sorry!

The page you are looking for doesn't exist. If you think this is an error, please let us know at [email protected].

If you encounter any error with this system, please send us a full copy of this page.
You might be looking for:

the products page
your current shopping cart
the login to access your previous purchases

An error occurred during execution; please try again later.
Additional information:
Doctrine\DBAL\Exception\ForeignKeyConstraintViolationException

File:

/home/ejc2016/www/ejc2016.ers.inbaz.org/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:64

Message:

An exception occurred while executing 'DELETE FROM bank_statement WHERE id = ?' with params [6]:

SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`ers_ejc2016`.`bank_statement_col`, CONSTRAINT `FK_EFDDB2244045140` FOREIGN KEY (`bank_statement_id`) REFERENCES `bank_statement` (`id`))

Stack trace:

#0 /home/ejc2016/www/ejc2016.ers.inbaz.org/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(142): Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException('An exception oc...', Object(Doctrine\DBAL\Driver\PDOException))
#1 /home/ejc2016/www/ejc2016.ers.inbaz.org/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(116): Doctrine\DBAL\DBALException::wrapException(Object(Doctrine\DBAL\Driver\PDOMySql\Driver), Object(Doctrine\DBAL\Driver\PDOException), 'An exception oc...')
#2 /home/ejc2016/www/ejc2016.ers.inbaz.org/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(988): Doctrine\DBAL\DBALException::driverExceptionDuringQuery(Object(Doctrine\DBAL\Driver\PDOMySql\Driver), Object(Doctrine\DBAL\Driver\PDOException), 'DELETE FROM ban...', Array)
#3 /home/ejc2016/www/ejc2016.ers.inbaz.org/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(591): Doctrine\DBAL\Connection->executeUpdate('DELETE FROM ban...', Array, Array)
#4 /home/ejc2016/www/ejc2016.ers.inbaz.org/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(579): Doctrine\DBAL\Connection->delete('bank_statement', Array, Array)
#5 /home/ejc2016/www/ejc2016.ers.inbaz.org/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(1086): Doctrine\ORM\Persisters\Entity\BasicEntityPersister->delete(Object(ErsBase\Entity\BankStatement))
#6 /home/ejc2016/www/ejc2016.ers.inbaz.org/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(398): Doctrine\ORM\UnitOfWork->executeDeletions(Object(Doctrine\ORM\Mapping\ClassMetadata))
#7 /home/ejc2016/www/ejc2016.ers.inbaz.org/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php(356): Doctrine\ORM\UnitOfWork->commit(NULL)
#8 /home/ejc2016/www/ejc2016.ers.inbaz.org/module/Admin/src/Admin/Controller/BankaccountController.php(256): Doctrine\ORM\EntityManager->flush()
#9 /home/ejc2016/www/ejc2016.ers.inbaz.org/vendor/zendframework/zend-mvc/src/Controller/AbstractActionController.php(82): Admin\Controller\BankaccountController->formatAction()
#10 [internal function]: Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
#11 /home/ejc2016/www/ejc2016.ers.inbaz.org/vendor/zendframework/zend-eventmanager/src/EventManager.php(444): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#12 /home/ejc2016/www/ejc2016.ers.inbaz.org/vendor/zendframework/zend-eventmanager/src/EventManager.php(205): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#13 /home/ejc2016/www/ejc2016.ers.inbaz.org/vendor/zendframework/zend-mvc/src/Controller/AbstractController.php(118): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#14 /home/ejc2016/www/ejc2016.ers.inbaz.org/vendor/zendframework/zend-mvc/src/DispatchListener.php(93): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
#15 [internal function]: Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#16 /home/ejc2016/www/ejc2016.ers.inbaz.org/vendor/zendframework/zend-eventmanager/src/EventManager.php(444): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#17 /home/ejc2016/www/ejc2016.ers.inbaz.org/vendor/zendframework/zend-eventmanager/src/EventManager.php(205): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#18 /home/ejc2016/www/ejc2016.ers.inbaz.org/vendor/zendframework/zend-mvc/src/Application.php(314): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#19 /home/ejc2016/www/ejc2016.ers.inbaz.org/public/index.php(18): Zend\Mvc\Application->run()
#20 {main}

Previous exceptions:

Doctrine\DBAL\Driver\PDOException

File:

    /home/ejc2016/www/ejc2016.ers.inbaz.org/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:93

Message:

    SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`ers_ejc2016`.`bank_statement_col`, CONSTRAINT `FK_EFDDB2244045140` FOREIGN KEY (`bank_statement_id`) REFERENCES `bank_statement` (`id`))

Stack trace:

    #0 /home/ejc2016/www/ejc2016.ers.inbaz.org/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(979): Doctrine\DBAL\Driver\PDOStatement->execute()
    #1 /home/ejc2016/www/ejc2016.ers.inbaz.org/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(591): Doctrine\DBAL\Connection->executeUpdate('DELETE FROM ban...', Array, Array)
    #2 /home/ejc2016/www/ejc2016.ers.inbaz.org/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(579): Doctrine\DBAL\Connection->delete('bank_statement', Array, Array)
    #3 /home/ejc2016/www/ejc2016.ers.inbaz.org/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(1086): Doctrine\ORM\Persisters\Entity\BasicEntityPersister->delete(Object(ErsBase\Entity\BankStatement))
    #4 /home/ejc2016/www/ejc2016.ers.inbaz.org/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(398): Doctrine\ORM\UnitOfWork->executeDeletions(Object(Doctrine\ORM\Mapping\ClassMetadata))
    #5 /home/ejc2016/www/ejc2016.ers.inbaz.org/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php(356): Doctrine\ORM\UnitOfWork->commit(NULL)
    #6 /home/ejc2016/www/ejc2016.ers.inbaz.org/module/Admin/src/Admin/Controller/BankaccountController.php(256): Doctrine\ORM\EntityManager->flush()
    #7 /home/ejc2016/www/ejc2016.ers.inbaz.org/vendor/zendframework/zend-mvc/src/Controller/AbstractActionController.php(82): Admin\Controller\BankaccountController->formatAction()
    #8 [internal function]: Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
    #9 /home/ejc2016/www/ejc2016.ers.inbaz.org/vendor/zendframework/zend-eventmanager/src/EventManager.php(444): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
    #10 /home/ejc2016/www/ejc2016.ers.inbaz.org/vendor/zendframework/zend-eventmanager/src/EventManager.php(205): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
    #11 /home/ejc2016/www/ejc2016.ers.inbaz.org/vendor/zendframework/zend-mvc/src/Controller/AbstractController.php(118): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
    #12 /home/ejc2016/www/ejc2016.ers.inbaz.org/vendor/zendframework/zend-mvc/src/DispatchListener.php(93): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
    #13 [internal function]: Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
    #14 /home/ejc2016/www/ejc2016.ers.inbaz.org/vendor/zendframework/zend-eventmanager/src/EventManager.php(444): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
    #15 /home/ejc2016/www/ejc2016.ers.inbaz.org/vendor/zendframework/zend-eventmanager/src/EventManager.php(205): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
    #16 /home/ejc2016/www/ejc2016.ers.inbaz.org/vendor/zendframework/zend-mvc/src/Application.php(314): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
    #17 /home/ejc2016/www/ejc2016.ers.inbaz.org/public/index.php(18): Zend\Mvc\Application->run()
    #18 {main}

PDOException

File:

    /home/ejc2016/www/ejc2016.ers.inbaz.org/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:91

Message:

    SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`ers_ejc2016`.`bank_statement_col`, CONSTRAINT `FK_EFDDB2244045140` FOREIGN KEY (`bank_statement_id`) REFERENCES `bank_statement` (`id`))

Stack trace:

    #0 /home/ejc2016/www/ejc2016.ers.inbaz.org/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php(91): PDOStatement->execute(NULL)
    #1 /home/ejc2016/www/ejc2016.ers.inbaz.org/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(979): Doctrine\DBAL\Driver\PDOStatement->execute()
    #2 /home/ejc2016/www/ejc2016.ers.inbaz.org/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(591): Doctrine\DBAL\Connection->executeUpdate('DELETE FROM ban...', Array, Array)
    #3 /home/ejc2016/www/ejc2016.ers.inbaz.org/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(579): Doctrine\DBAL\Connection->delete('bank_statement', Array, Array)
    #4 /home/ejc2016/www/ejc2016.ers.inbaz.org/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(1086): Doctrine\ORM\Persisters\Entity\BasicEntityPersister->delete(Object(ErsBase\Entity\BankStatement))
    #5 /home/ejc2016/www/ejc2016.ers.inbaz.org/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(398): Doctrine\ORM\UnitOfWork->executeDeletions(Object(Doctrine\ORM\Mapping\ClassMetadata))
    #6 /home/ejc2016/www/ejc2016.ers.inbaz.org/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php(356): Doctrine\ORM\UnitOfWork->commit(NULL)
    #7 /home/ejc2016/www/ejc2016.ers.inbaz.org/module/Admin/src/Admin/Controller/BankaccountController.php(256): Doctrine\ORM\EntityManager->flush()
    #8 /home/ejc2016/www/ejc2016.ers.inbaz.org/vendor/zendframework/zend-mvc/src/Controller/AbstractActionController.php(82): Admin\Controller\BankaccountController->formatAction()
    #9 [internal function]: Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
    #10 /home/ejc2016/www/ejc2016.ers.inbaz.org/vendor/zendframework/zend-eventmanager/src/EventManager.php(444): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
    #11 /home/ejc2016/www/ejc2016.ers.inbaz.org/vendor/zendframework/zend-eventmanager/src/EventManager.php(205): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
    #12 /home/ejc2016/www/ejc2016.ers.inbaz.org/vendor/zendframework/zend-mvc/src/Controller/AbstractController.php(118): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
    #13 /home/ejc2016/www/ejc2016.ers.inbaz.org/vendor/zendframework/zend-mvc/src/DispatchListener.php(93): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
    #14 [internal function]: Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
    #15 /home/ejc2016/www/ejc2016.ers.inbaz.org/vendor/zendframework/zend-eventmanager/src/EventManager.php(444): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
    #16 /home/ejc2016/www/ejc2016.ers.inbaz.org/vendor/zendframework/zend-eventmanager/src/EventManager.php(205): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
    #17 /home/ejc2016/www/ejc2016.ers.inbaz.org/vendor/zendframework/zend-mvc/src/Application.php(314): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
    #18 /home/ejc2016/www/ejc2016.ers.inbaz.org/public/index.php(18): Zend\Mvc\Application->run()
    #19 {main}

report a bug
Version: 0.4.53

© 2016 by European Juggling Association All rights reserved.
"

When I edit the csv file and add a "+" before the paid value, everything is fine.

@BigAndini
Copy link
Owner

The sign value is only needed if the bank statement does not contain positive and negative values but instead has an extra field that states if the value should be interpreted as positive or as negative. If the values are already positive or negative. I think at the moment this value is not needed. Let's check that once the format of the bank statements of your bank is known.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants