Browse Source

Merge branch 'develop'

master
Guillaume 1 year ago
parent
commit
90015ff510
3 changed files with 4 additions and 5 deletions
  1. +2
    -1
      backend/controllers/DocumentController.php
  2. +0
    -2
      backend/controllers/ProductController.php
  3. +2
    -2
      common/logic/Product/Product/Service/ProductSolver.php

+ 2
- 1
backend/controllers/DocumentController.php View File

@@ -622,6 +622,7 @@ class DocumentController extends BackendController

if ($documentManager->isValidClass($classDocument)) {
$document = $this->findModel($idDocument, $classDocument);
$classDocumentComplete = $documentManager->getClass($document, true);
$product = $productManager->findOneProductById($idProduct);

if ($document && $product) {
@@ -633,7 +634,7 @@ class DocumentController extends BackendController
$order->status = 'tmp-order';
$order->origin = Order::ORIGIN_ADMIN;
$order->date = date('Y-m-d H:i:s');
$fieldIdDocument = 'id_' . $classDocument::tableName();
$fieldIdDocument = 'id_' . $classDocumentComplete::tableName();
$order->$fieldIdDocument = $document->id;
$order->save();
} else {

+ 0
- 2
backend/controllers/ProductController.php View File

@@ -376,8 +376,6 @@ class ProductController extends BackendController
if ($model->file && $model->validate()) {
$productPriceCsvArray = array_map(function($data) { return str_getcsv($data,";");}, file($model->file->tempName));

//die('mime type : '.BaseFileHelper::getMimeType($model->file->tempName));

if(!$productPriceCsvArray || count($productPriceCsvArray[0]) != 6) {
$this->setFlash('error', "Format de fichier invalide. Veuillez vérifier que le séparateur de champs de votre fichier est bien \";\".");
}

+ 2
- 2
common/logic/Product/Product/Service/ProductSolver.php View File

@@ -203,10 +203,10 @@ class ProductSolver extends AbstractService implements SolverInterface

public function getProductQuantityMaxByDay(Product $product, string $day): ?float
{
$quantityMax = $product->quantity_max;
$quantityMax = ($product->quantity_max && $product->quantity_max > 0) ? $product->quantity_max : null;
if($this->isProductQuantityMaxDefinedByDay($product, $day)) {
$fieldQuantityMax = $this->getProductFieldNameQuantityMax($day);
$quantityMax = (float) $product->$fieldQuantityMax;
$quantityMax = $product->$fieldQuantityMax;
}
return $quantityMax;

Loading…
Cancel
Save