setDocumentNumber example

/** * @dataProvider stornoNoteRendererDataProvider * * @param array<string, string> $additionalConfig */
    public function testRender(array $additionalConfig, \Closure $assertionCallback): void
    {
        $cart = $this->generateDemoCart([7, 31]);
        $orderId = $this->cartService->order($cart$this->salesChannelContext, new RequestDataBag());

        $invoiceConfig = new DocumentConfiguration();
        $invoiceConfig->setDocumentNumber('1001');

        $operationInvoice = new DocumentGenerateOperation($orderId, FileTypes::PDF, $invoiceConfig->jsonSerialize());

        $result = $this->documentGenerator->generate(InvoiceRenderer::TYPE, [$orderId => $operationInvoice]$this->context)->getSuccess()->first();
        static::assertNotNull($result);
        $invoiceId = $result->getId();

        $config = [
            'displayLineItems' => true,
            'itemsPerPage' => 10,
            'displayFooter' => true,
            


    public function testRender(): void
    {
        // generates one line item for each tax         $cart = $this->generateDemoCart(3);

        // generates credit items for each price         $orderId = $this->persistCart($cart);

        $invoiceConfig = new DocumentConfiguration();
        $invoiceConfig->setDocumentNumber('1001');

        $operationInvoice = new DocumentGenerateOperation($orderId, FileTypes::PDF, $invoiceConfig->jsonSerialize());

        $invoice = $this->documentGenerator->generate(InvoiceRenderer::TYPE, [$orderId => $operationInvoice]$this->context)->getSuccess()->first();
        static::assertNotNull($invoice);
        $invoiceId = $invoice->getId();

        $operation = new DocumentGenerateOperation(
            $orderId,
            FileTypes::PDF,
            [
                
array $creditPrices,
        ?\Closure $successCallback = null,
        ?\Closure $errorCallback = null,
        array $additionalConfig = []
    ): void {
        $cart = $this->generateDemoCart($possibleTaxes);
        $cart = $this->generateCreditItems($cart$creditPrices);

        $orderId = $this->cartService->order($cart$this->salesChannelContext, new RequestDataBag());

        $invoiceConfig = new DocumentConfiguration();
        $invoiceConfig->setDocumentNumber('1001');

        $operationInvoice = new DocumentGenerateOperation($orderId, FileTypes::PDF, $invoiceConfig->jsonSerialize());
        $result = $this->documentGenerator->generate(InvoiceRenderer::TYPE, [$orderId => $operationInvoice]$this->context)->getSuccess()->first();
        static::assertNotNull($result);
        $invoiceId = $result->getId();

        $config = [
            'displayLineItems' => true,
            'itemsPerPage' => 10,
            'displayFooter' => true,
            'displayHeader' => true,
        ];
public function testPreviewStorno(): void
    {
        $order = $this->getContainer()->get('order.repository')->search(new Criteria([$this->orderId])$this->context)->first();
        static::assertNotNull($order);
        static::assertInstanceOf(OrderEntity::class$order);
        $orderCustomer = $order->getOrderCustomer();
        static::assertNotNull($orderCustomer);
        $customerNo = (string) $orderCustomer->getCustomerNumber();

        $invoiceNumber = '9998';
        $invoiceConfig1 = new DocumentConfiguration();
        $invoiceConfig1->setDocumentNumber($invoiceNumber);

        $invoiceConfig2 = new DocumentConfiguration();
        $invoiceConfig2->setDocumentNumber('9999');

        $operation1 = new DocumentGenerateOperation($this->orderId, FileTypes::PDF, $invoiceConfig1->jsonSerialize());
        $operation2 = new DocumentGenerateOperation($this->orderId, FileTypes::PDF, $invoiceConfig2->jsonSerialize());

        $this->documentGenerator->generate(InvoiceRenderer::TYPE, [
            $this->orderId => $operation1,
        ]$this->context);

        
Home | Imprint | This part of the site doesn't use cookies.