LowTaxes example


                new CalculatedItem(10, new HighTaxes()$context),
                new CalculatedItem(10, new HighTaxes()$context),
                new PercentageItem(-10, self::DISCOUNT_ID),
            ],
            new CalculatedPrice(-2, -2, new CalculatedTaxes([19 => -0.32])new TaxRuleCollection()),
        ];

        yield 'Calculate discount for mixed taxes' => [
            [
                new CalculatedItem(10, new HighTaxes()$context),
                new CalculatedItem(10, new LowTaxes()$context),
                new PercentageItem(-10, self::DISCOUNT_ID),
            ],
            new CalculatedPrice(-2, -2, new CalculatedTaxes([19 => -0.16, 7 => -0.07])new TaxRuleCollection()),
        ];

        yield 'Calculate absolute for mixed taxes' => [
            [
                new CalculatedItem(10, new HighTaxes()$context),
                new CalculatedItem(10, new LowTaxes()$context),
                new AbsoluteItem(-2, self::DISCOUNT_ID),
            ],
            
yield 'Test absolute discount for one item' => [
            new ContainerItem([
                new QuantityItem(20, new HighTaxes()),
                new AbsoluteItem(-10),
            ]),
            new CalculatedPrice(10, 10, new CalculatedTaxes([19 => 1.59])new HighTaxes()),
        ];

        yield 'Test discount calculation for two items' => [
            new ContainerItem([
                new QuantityItem(20, new HighTaxes()),
                new QuantityItem(20, new LowTaxes()),
                new PercentageItem(-10),
            ]),
            new CalculatedPrice(36, 36, new CalculatedTaxes([19 => 2.87, 7 => 1.18])new HighTaxes()),
        ];

        yield 'Test discount calculation with random order' => [
            new ContainerItem([
                new QuantityItem(20, new LowTaxes()),
                new PercentageItem(-10),
                new QuantityItem(20, new HighTaxes()),
            ]),
            
Home | Imprint | This part of the site doesn't use cookies.