Amount of the subtotal of the items. **Required** if line items are specified.
10 characters max, with support for integers.

@param string|double $subtotal

@return $this
514479
public function setSubtotal($subtotal)
    {
        NumericValidator::validate($subtotal, "Subtotal");
        $subtotal = Formatter::formatToPrice($subtotal);
        $this->subtotal = $subtotal;
        return $this;
    }
365278
protected function agregarSubTotal(array $detalle, $x = 10) {
        $subtotal = 0;
        if (!isset($detalle[0])) {
            $detalle = [$detalle];
        }
        foreach($detalle as  &$d) {
            if (!empty($d['MontoItem'])) {
                $subtotal += $d['MontoItem'];
            }
        }
        if ($this->papelContinuo) {
            $this->Texto('Subtotal: '.$this->num($subtotal), $x);
        } else {
            $this->Texto('Subtotal:', 77, null, 'R', 100);
            $this->Texto($this->num($subtotal), 177, null, 'R', 22);
        }
        $this->Ln();
    }
446552
public function setParcelCount($count)
    {
        $this->set(Config::T8905, (string)$count);
        $this->set(Config::T8702, (string)$count);

        return $this;
    }
1286178
public function getTaxTotal()
    {
        $total = 0;
        $items = $this->Items();
        
        // Calculate total from items in the list
        foreach ($items as $item) {
            $tax = $item->UnitTax;
            $total += $tax * $item->Quantity;
        }
        
        $this->extend("updateTaxTotal", $total);

        $total = MathsHelper::round($total, 2);

        return $total;
    }
1037192
public function subtotal(Product $product)
    {
        $subtotal = $this->money($product);

        if (! $product->freebie) {
            $value    = $this->value($product);
            $discount = $this->discount($product);
            $subtotal = $subtotal->add($value)->subtract($discount);
        }

        $delivery = $this->delivery($product);
        $subtotal = $subtotal->add($delivery);

        return $subtotal;
    }
1092375
public function subTotal($format = true, $withDiscount = true, $taxedItemsOnly = false, $withTax = false)
    {
        $total = $this->price(false, $taxedItemsOnly) * $this->qty;

        if ($withDiscount) {
            $total -= $this->getDiscount(false);
        }

        if ($total < 0) {
            $total = 0;
        }

        if ($withTax) {
            $total += $this->tax(0, false, false, $withDiscount);
        }

        return LaraCart::formatMoney($total, $this->locale, $this->internationalFormat, $format);
    }
687793
public function subTotal($format = true, $withDiscount = true)
    {
        $total = 0;

        if ($this->count() != 0) {
            foreach ($this->getItems() as $item) {
                $total += $item->subTotal(false, $withDiscount);
            }
        }

        if ($total < 0) {
            $total = 0;
        }

        return $this->formatMoney($total, null, null, $format);
    }
1167045
public function getSubTotal()
    {
        $total = 0;

        // Calculate total from items in the list
        foreach ($this->Items() as $item) {
            $total += $item->SubTotal;
        }
        
        $this->extend("updateSubTotal", $total);

        return $total;
    }
817496
public function sub($quantity, $unit = null)
    {
        if ($unit === null) {
            $unit = $this->unit;
        }

        $quantity = new static($quantity, $unit, $this->currencyData);
        /** @var Currency $quantity */
        $quantity->to($this->unit);
        $this->value -= $quantity->getValue();
        return $this;
    }
1305616
public function setTotalPrice(Money $totalPrice = null)
    {
        $this->totalPrice = $totalPrice ? $totalPrice->getAmount() : $totalPrice;

        return $this;
    }
637212
public function subtotal($decimals = null, $decimalPoint = null, $thousandSeperator = null)
    {
        return $this->numberFormat($this->subtotal, $decimals, $decimalPoint, $thousandSeperator);
    }
338386
public function subtract($amount)
    {
        if ($amount instanceof FeeContract) {
            return $amount->subtract($this)->convertTo($this->currency());
        }

        throw_unless($amount instanceof Amount, BadMethodCallException::class);

        return new static(
            $this->amount - $amount->convertTo($this->currency())->amount,
            $this->currency()
        );
    }
368836
public function getTaxTotal()
    {
        $total = $this->UnitTax * $this->Quantity;

        $this->extend("updateTaxTotal", $total);

        return $total;
    }
819847
public function subItemsTotal($format = true, $taxedItemsOnly = false, $withTax = false)
    {
        $total = 0;

        foreach ($this->subItems as $subItem) {
            $total += $subItem->price(false, $taxedItemsOnly) * ($subItem->qty ?: 1);
        }

        if ($withTax) {
            $total += $this->tax * $total;
        }

        return LaraCart::formatMoney($total, $this->locale, $this->internationalFormat, $format);
    }
356422
public function setTotal($value)
    {
        if (!StaticValidator::isValid('number', $value)) {
            return $this;
        }

        $this->_total = StaticFilter::filter('number',$value);
        $this->_pages = ceil($this->_total / $this->_rowsPerPage);
        return $this;
    }
1147586
public function limit($offset, $amount = null)
    {
        $this->queryBuilder->limit($offset, $amount);
        return $this;
    }
955051
def update_subtotals(self, current, sub_key):
        

        if not self.sub_counts.get(sub_key):
            self.sub_counts[sub_key] = {}
        for item in current:
            try:
                self.sub_counts[sub_key][item] += 1
            except KeyError:
                self.sub_counts[sub_key][item] = 1