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

GenerateInvoicesCommand.php will select orders without order number #147

Open
tom10271 opened this issue Jul 18, 2019 · 1 comment
Open

Comments

@tom10271
Copy link
Contributor

tom10271 commented Jul 18, 2019

#148

Root cause:
vendor/sylius/invoicing-plugin/src/Cli/GenerateInvoicesCommand.php

$orders = $this->orderRepository->findAll();

Fix by:

/** @var array $orders */
$orders = $this->orderRepository
    ->createQueryBuilder('o')
    ->where('o.number IS NOT NULL')
    ->getQuery()
    ->getResult();

Error message:

symfony console sylius-invoicing:generate-invoices -vvv

In InvoiceCreator.php line 35:
                                                                                                                                                                                                                                                         
  [Symfony\Component\Debug\Exception\FatalThrowableError]                                                                                                                                                                                                
  Argument 1 passed to Sylius\InvoicingPlugin\Creator\InvoiceCreator::__invoke() must be of the type string, null given, called in ~/Sites/hbx-cn/vendor/sylius/invoicing-plugin/src/Creator/MassInvoicesCreator.php on line 32  
                                                                                                                                                                                                                                                         

Exception trace:
 () at ~/Sites/hbx-cn/vendor/sylius/invoicing-plugin/src/Creator/InvoiceCreator.php:35
 Sylius\InvoicingPlugin\Creator\InvoiceCreator->__invoke() at ~/Sites/hbx-cn/vendor/sylius/invoicing-plugin/src/Creator/MassInvoicesCreator.php:32
 Sylius\InvoicingPlugin\Creator\MassInvoicesCreator->__invoke() at ~/Sites/hbx-cn/vendor/sylius/invoicing-plugin/src/Cli/GenerateInvoicesCommand.php:36
 Sylius\InvoicingPlugin\Cli\GenerateInvoicesCommand->execute() at ~/Sites/hbx-cn/vendor/symfony/console/Command/Command.php:255
 Symfony\Component\Console\Command\Command->run() at ~/Sites/hbx-cn/vendor/symfony/console/Application.php:939
 Symfony\Component\Console\Application->doRunCommand() at ~/Sites/hbx-cn/vendor/symfony/framework-bundle/Console/Application.php:87
 Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() at ~/Sites/hbx-cn/vendor/symfony/console/Application.php:273
 Symfony\Component\Console\Application->doRun() at ~/Sites/hbx-cn/vendor/symfony/framework-bundle/Console/Application.php:73
 Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at ~/Sites/hbx-cn/vendor/symfony/console/Application.php:149
 Symfony\Component\Console\Application->run() at ~/Sites/hbx-cn/bin/console:38

sylius-invoicing:generate-invoices [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command>

exit status 255
@tom10271 tom10271 changed the title GenerateInvoicesCommand.php will select order without order number yet GenerateInvoicesCommand.php will select orders without order number Jul 18, 2019
@tom10271
Copy link
Contributor Author

#148

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

No branches or pull requests

1 participant