protected function handleInsert(SaleInterface $sale)
    {
        $changed = false;

        // Generate number and key
        $changed |= $this->updateNumber($sale);
        $changed |= $this->updateKey($sale);

        // Handle customer information
        $changed |= $this->updateInformation($sale, true);

        // Update pricing
        $changed |= $this->pricingUpdater->updateVatNumberSubject($sale);

        // Update outstanding
        $changed |= $this->saleUpdater->updatePaymentTerm($sale);

        // Update discounts
        $changed |= $this->saleUpdater->updateDiscounts($sale, true);

        // Update taxation
        $changed |= $this->saleUpdater->updateTaxation($sale, true);

        // Update totals
        $changed |= $this->saleUpdater->updateTotals($sale);

        // Update state
        $changed |= $this->updateState($sale);

        return $changed;
    }
protected function handleInsert(SaleInterface $sale)
    {
        $changed = false;

        // Generate number and key
        $changed |= $this->updateNumber($sale);
        $changed |= $this->updateKey($sale);

        // Handle customer information
        $changed |= $this->updateInformation($sale, true);

        // Update pricing
        $changed |= $this->pricingUpdater->updateVatNumberSubject($sale);

        // Update outstanding
        $changed |= $this->saleUpdater->updatePaymentTerm($sale);

        // Update discounts
        $changed |= $this->saleUpdater->updateDiscounts($sale, true);

        // Update taxation
        $changed |= $this->saleUpdater->updateTaxation($sale, true);

        // Update totals
        $changed |= $this->saleUpdater->updateTotals($sale);

        // Update state
        $changed |= $this->updateState($sale);

        return $changed;
    }
protected function handleInsert ( SaleInterface $ sale ) { $ changed = false ; // Generate number and key $ changed |= $ this -> updateNumber ( $ sale ) ; $ changed |= $ this -> updateKey ( $ sale ) ; // Handle customer information $ changed |= $ this -> updateInformation ( $ sale , true ) ; // Update pricing $ changed |= $ this -> pricingUpdater -> updateVatNumberSubject ( $ sale ) ; // Update outstanding $ changed |= $ this -> saleUpdater -> updatePaymentTerm ( $ sale ) ; // Update discounts $ changed |= $ this -> saleUpdater -> updateDiscounts ( $ sale , true ) ; // Update taxation $ changed |= $ this -> saleUpdater -> updateTaxation ( $ sale , true ) ; // Update totals $ changed |= $ this -> saleUpdater -> updateTotals ( $ sale ) ; // Update state $ changed |= $ this -> updateState ( $ sale ) ; return $ changed ; }
Handles the sale insertion.

@param SaleInterface $sale

@return bool Whether the sale has been changed.

@throws \Ekyna\Component\Commerce\Exception\CommerceExceptionInterface
Handles the sale insertion .