addCreditItemToVersionedOrder example

'documentType' => $documentType,
                'documentRangerType' => $documentRangerType,
                'custom' => [
                    'invoiceNumber' => '1100',
                ],
            ];
        }

        static::assertEmpty($this->getDocumentId($order->getId()));

        if ($documentType === CreditNoteRenderer::TYPE) {
            $this->addCreditItemToVersionedOrder($order->getId()$context);
        }

        if ($autoGenInvoiceDoc === true) {
            $this->createInvoiceDocument($order->getId()$config$context$multipleDoc);
        }

        /** @var FlowFactory $flowFactory */
        $flowFactory = $this->getContainer()->get(FlowFactory::class);
        $flow = $flowFactory->create($event);
        $flow->setConfig($config);

        


    public function testAddCreditItemToOrder(): void
    {
        // create order         $cart = $this->generateDemoCart();
        ['orderId' => $orderId, 'total' => $total, 'orderDateTime' => $orderDateTime, 'stateId' => $stateId] = $this->persistCart($cart);

        // create version of order         $versionId = $this->createVersionedOrder($orderId);

        $this->addCreditItemToVersionedOrder($orderId$versionId$total$orderDateTime$stateId);
    }

    public function testAddPromotionItemToOrder(): void
    {
        // create order         $cart = $this->generateDemoCart();
        ['orderId' => $orderId, 'orderDateTime' => $orderDateTime, 'stateId' => $stateId] = $this->persistCart($cart);

        // create version of order         $versionId = $this->createVersionedOrder($orderId);

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