소스 검색

[Administration] Produits : import CSV prix spécifiques #959

master
Guillaume Bourgeois 1 년 전
부모
커밋
118af22225
3개의 변경된 파일9개의 추가작업 그리고 4개의 파일을 삭제
  1. +3
    -3
      backend/controllers/ProductController.php
  2. +5
    -0
      common/helpers/CSV.php
  3. +1
    -1
      common/logic/PointSale/PointSale/Repository/PointSaleRepository.php

+ 3
- 3
backend/controllers/ProductController.php 파일 보기

@@ -399,7 +399,7 @@ class ProductController extends BackendController
$userGroupName = $productPriceCsv[2];
$pointSaleName = $productPriceCsv[3];
$quantityFrom = (float)$productPriceCsv[4];
$price = (float)$productPriceCsv[5];
$price = (float) str_replace(',', '.', $productPriceCsv[5]);

$product = $productName ? $productManager->findOneProductByName($productName) : null;
$user = (count($userArray) > 1) ? $userManager->findOneUserById((int)$userArray[1]) : null;
@@ -493,7 +493,7 @@ class ProductController extends BackendController
'',
'',
'',
$product->price
CSV::formatPrice($product->price)
];

// prix spécifiques
@@ -507,7 +507,7 @@ class ProductController extends BackendController
$productPrice->userGroup ? $productPrice->userGroup->name : '',
$productPrice->pointSale ? $productPrice->pointSale->name : '',
$productPrice->from_quantity ?? '',
$productPrice->price
CSV::formatPrice($productPrice->price)
];
}
}

+ 5
- 0
common/helpers/CSV.php 파일 보기

@@ -85,4 +85,9 @@ class CSV
header("Content-Disposition: attachment;filename={$filename}");
header("Content-Transfer-Encoding: binary");
}

public static function formatPrice($price)
{
return str_replace('.', ',', $price);
}
}

+ 1
- 1
common/logic/PointSale/PointSale/Repository/PointSaleRepository.php 파일 보기

@@ -47,7 +47,7 @@ class PointSaleRepository extends AbstractRepository
return $this->createDefaultQuery()
->filterIsOnline()
->filterByName($name)
->fineOne();
->findOne();
}

public function findPointSalesByDistribution(Distribution $distribution)

Loading…
취소
저장