Bladeren bron

Merge branch 'develop' of https://forge.laclic.fr/Laclic/CaracoleBundle into develop

packProduct
Charly 3 jaren geleden
bovenliggende
commit
f1e3f96a7c
5 gewijzigde bestanden met toevoegingen van 34 en 2 verwijderingen
  1. +9
    -0
      Builder/Product/ProductFamilyBuilder.php
  2. +9
    -1
      Container/PointSale/PointSaleContainer.php
  3. +10
    -1
      Container/Product/ProductFamilyContainer.php
  4. +1
    -0
      Solver/Price/ProductPriceSolver.php
  5. +5
    -0
      Solver/Product/ProductFamilySolver.php

+ 9
- 0
Builder/Product/ProductFamilyBuilder.php Bestand weergeven

@@ -0,0 +1,9 @@
<?php

namespace Lc\CaracoleBundle\Builder\Product;


class ProductFamilyBuilder
{

}

+ 9
- 1
Container/PointSale/PointSaleContainer.php Bestand weergeven

@@ -5,19 +5,23 @@ namespace Lc\CaracoleBundle\Container\PointSale;
use Lc\CaracoleBundle\Factory\PointSale\PointSaleFactory;
use Lc\CaracoleBundle\Repository\PointSale\PointSaleRepositoryQuery;
use Lc\CaracoleBundle\Repository\PointSale\PointSaleStore;
use Lc\CaracoleBundle\Solver\PointSale\PointSaleSolver;

class PointSaleContainer
{
protected PointSaleFactory $factory;
protected PointSaleSolver $solver;
protected PointSaleRepositoryQuery $repositoryQuery;
protected PointSaleStore $store;

public function __construct(
PointSaleFactory $factory,
PointSaleSolver $solver,
PointSaleRepositoryQuery $repositoryQuery,
PointSaleStore $store
) {
$this->factory = $factory;
$this->solver = $solver;
$this->repositoryQuery = $repositoryQuery;
$this->store = $store;
}
@@ -27,6 +31,11 @@ class PointSaleContainer
return $this->factory;
}

public function getSolver(): PointSaleSolver
{
return $this->solver;
}

public function getRepositoryQuery(): PointSaleRepositoryQuery
{
return $this->repositoryQuery;
@@ -36,5 +45,4 @@ class PointSaleContainer
{
return $this->store;
}

}

+ 10
- 1
Container/Product/ProductFamilyContainer.php Bestand weergeven

@@ -2,6 +2,7 @@

namespace Lc\CaracoleBundle\Container\Product;

use Lc\CaracoleBundle\Builder\Product\ProductFamilyBuilder;
use Lc\CaracoleBundle\Factory\Product\ProductFamilyFactory;
use Lc\CaracoleBundle\Repository\Product\ProductFamilyRepositoryQuery;
use Lc\CaracoleBundle\Repository\Product\ProductFamilyStore;
@@ -14,6 +15,7 @@ class ProductFamilyContainer
protected ProductFamilySolver $solver;
protected ProductFamilyRepositoryQuery $repositoryQuery;
protected ProductFamilyStore $store;
protected ProductFamilyBuilder $builder;
protected ProductFamilyResolver $resolver;

public function __construct(
@@ -21,12 +23,14 @@ class ProductFamilyContainer
ProductFamilySolver $solver,
ProductFamilyRepositoryQuery $repositoryQuery,
ProductFamilyStore $store,
ProductFamilyBuilder $builder,
ProductFamilyResolver $resolver
) {
$this->factory = $factory;
$this->solver = $solver;
$this->repositoryQuery = $repositoryQuery;
$this->store = $store;
$this->builder = $builder;
$this->resolver = $resolver;
}

@@ -55,4 +59,9 @@ class ProductFamilyContainer
return $this->resolver;
}

}
public function getBuilder(): ProductFamilyBuilder
{
return $this->builder;
}

}

+ 1
- 0
Solver/Price/ProductPriceSolver.php Bestand weergeven

@@ -99,6 +99,7 @@ class ProductPriceSolver
$solver = $this->getSolver($product);

if ($solver->getBehaviorPriceInherited($product) == 'by-piece') {
dump($product);
return $solver->getBuyingPriceInherited($product);
} elseif ($solver->getBehaviorPriceInherited($product) == 'by-reference-unit') {
if ($solver->getQuantityInherited($product) > 0) {

+ 5
- 0
Solver/Product/ProductFamilySolver.php Bestand weergeven

@@ -329,6 +329,11 @@ class ProductFamilySolver
return $productFamily->getBuyingPriceByRefUnit();
}

public function getBuyingPriceInherited(ProductFamilyInterface $productFamily): ?float
{
return $productFamily->getBuyingPrice();
}

public function getPriceByRefUnitInherited(ProductFamilyInterface $productFamily): ?float
{
return $productFamily->getPriceByRefUnit();

Laden…
Annuleren
Opslaan