Shipment/Calculator/ShipmentCalculator.php
public function calculateShippableQuantity(
        Common\SaleItemInterface $saleItem,
        Shipment\ShipmentInterface $ignore = null
    ) {
        // TODO Return zero if not shippable (?)

        // Quantity = Sold - Shipped - Returned (ignoring current)

        // TODO Packaging format
        $quantity = $saleItem->getTotalQuantity();
        $quantity -= $this->invoiceCalculator->calculateCreditedQuantity($saleItem);
        $quantity -= $this->calculateShippedQuantity($saleItem, $ignore);
        $quantity += $this->calculateReturnedQuantity($saleItem);

        return max($quantity, 0);
    }
public function calculateShippableQuantity(
        Common\SaleItemInterface $saleItem,
        Shipment\ShipmentInterface $ignore = null
    ) {
        // TODO Return zero if not shippable (?)

        // Quantity = Sold - Shipped - Returned (ignoring current)

        // TODO Packaging format
        $quantity = $saleItem->getTotalQuantity();
        $quantity -= $this->invoiceCalculator->calculateCreditedQuantity($saleItem);
        $quantity -= $this->calculateShippedQuantity($saleItem, $ignore);
        $quantity += $this->calculateReturnedQuantity($saleItem);

        return max($quantity, 0);
    }
public function calculateShippableQuantity ( Common \ SaleItemInterface $ saleItem , Shipment \ ShipmentInterface $ ignore = null ) { // TODO Return zero if not shippable (?) // Quantity = Sold - Shipped - Returned (ignoring current) // TODO Packaging format $ quantity = $ saleItem -> getTotalQuantity ( ) ; $ quantity -= $ this -> invoiceCalculator -> calculateCreditedQuantity ( $ saleItem ) ; $ quantity -= $ this -> calculateShippedQuantity ( $ saleItem , $ ignore ) ; $ quantity += $ this -> calculateReturnedQuantity ( $ saleItem ) ; return max ( $ quantity , 0 ) ; }
@inheritdoc

@todo Add bool $strict parameter : really shipped and not created/prepared
@inheritdoc