Browse Source

Merge tag 'hotfix_959' into develop

hotfix_959
feature/souke
Guillaume Bourgeois 1 year ago
parent
commit
ee59e2df56
2 changed files with 8 additions and 3 deletions
  1. +3
    -3
      backend/controllers/ProductController.php
  2. +5
    -0
      common/helpers/CSV.php

+ 3
- 3
backend/controllers/ProductController.php View File

$userGroupName = $productPriceCsv[2]; $userGroupName = $productPriceCsv[2];
$pointSaleName = $productPriceCsv[3]; $pointSaleName = $productPriceCsv[3];
$quantityFrom = (float)$productPriceCsv[4]; $quantityFrom = (float)$productPriceCsv[4];
$price = (float)$productPriceCsv[5];
$price = (float) str_replace(',', '.', $productPriceCsv[5]);


$product = $productName ? $productManager->findOneProductByName($productName) : null; $product = $productName ? $productManager->findOneProductByName($productName) : null;
$user = (count($userArray) > 1) ? $userManager->findOneUserById((int)$userArray[1]) : null; $user = (count($userArray) > 1) ? $userManager->findOneUserById((int)$userArray[1]) : null;
'', '',
'', '',
'', '',
$product->price
CSV::formatPrice($product->price)
]; ];


// prix spécifiques // prix spécifiques
$productPrice->userGroup ? $productPrice->userGroup->name : '', $productPrice->userGroup ? $productPrice->userGroup->name : '',
$productPrice->pointSale ? $productPrice->pointSale->name : '', $productPrice->pointSale ? $productPrice->pointSale->name : '',
$productPrice->from_quantity ?? '', $productPrice->from_quantity ?? '',
$productPrice->price
CSV::formatPrice($productPrice->price)
]; ];
} }
} }

+ 5
- 0
common/helpers/CSV.php View File

header("Content-Disposition: attachment;filename={$filename}"); header("Content-Disposition: attachment;filename={$filename}");
header("Content-Transfer-Encoding: binary"); header("Content-Transfer-Encoding: binary");
} }

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

Loading…
Cancel
Save