src/models/ShopOrder.php
public function getCalcMoneyDiscount()
    {
        $money = new Money("", $this->currency_code);

        //Товарные скидки
        foreach ($this->shopOrderItems as $shopOrderItem) {
            $money = $money->add($shopOrderItem->moneyDiscount->multiply($shopOrderItem->quantity));
        }

        //Скидка на корзину
        if ($this->shopDiscountCoupons) {
            foreach ($this->shopDiscountCoupons as $shopDiscountCoupon)
            {
                $shopDiscount = $shopDiscountCoupon->shopDiscount;
                if ($shopDiscountCoupon->shopDiscount->assignment_type == ShopDiscount::ASSIGNMENT_TYPE_CART) {

                    if ($shopDiscount->value_type == ShopDiscount::VALUE_TYPE_F) {
                        $discountMoney = new Money($shopDiscount->value, $shopDiscount->currency_code);
                        $money->add($discountMoney);
                    }
                    
                    if ($shopDiscount->value_type == ShopDiscount::VALUE_TYPE_P) {
                        $moneyOrderItems = $this->calcMoneyItems;
                        $moneyValue = $moneyOrderItems->amount * $shopDiscount->value / 100;
                        $discountMoney = new Money($moneyValue, $moneyOrderItems->currency);
                        $money->add($discountMoney);
                    }

                    if ($shopDiscount->isLast) {
                        break;
                    }

                }
            }
        }


        return $money;
    }
public function getCalcMoneyDiscount()
    {
        $money = new Money("", $this->currency_code);

        //Товарные скидки
        foreach ($this->shopOrderItems as $shopOrderItem) {
            $money = $money->add($shopOrderItem->moneyDiscount->multiply($shopOrderItem->quantity));
        }

        //Скидка на корзину
        if ($this->shopDiscountCoupons) {
            foreach ($this->shopDiscountCoupons as $shopDiscountCoupon)
            {
                $shopDiscount = $shopDiscountCoupon->shopDiscount;
                if ($shopDiscountCoupon->shopDiscount->assignment_type == ShopDiscount::ASSIGNMENT_TYPE_CART) {

                    if ($shopDiscount->value_type == ShopDiscount::VALUE_TYPE_F) {
                        $discountMoney = new Money($shopDiscount->value, $shopDiscount->currency_code);
                        $money->add($discountMoney);
                    }
                    
                    if ($shopDiscount->value_type == ShopDiscount::VALUE_TYPE_P) {
                        $moneyOrderItems = $this->calcMoneyItems;
                        $moneyValue = $moneyOrderItems->amount * $shopDiscount->value / 100;
                        $discountMoney = new Money($moneyValue, $moneyOrderItems->currency);
                        $money->add($discountMoney);
                    }

                    if ($shopDiscount->isLast) {
                        break;
                    }

                }
            }
        }


        return $money;
    }
Налог

@return Money