ProductPriceSheetService
in package
uses
DatatablesExportTrait
Class ProductPriceSheetService
Table of Contents
Constants
- COEFF_SELL_PRICE_03 = 1.1
- COEFF_SELL_PRICE_36 = 1.05
- COEFF_SELL_PRICE_912 = 0.95
- COEFF_SELL_PRICE_PLUS_12 = 0.8667
Properties
- $container : ContainerInterface
- $header : array<string|int, mixed>
- $entityManager : EntityManagerInterface
Methods
- __construct() : mixed
- calculateSellPriceByProduct() : false|void
- export() : StreamedResponse
- Exporting sales
- exportXls() : mixed
- Exporting as Xls
- getGroupIDForProductAssignment() : int
- Retrieves the group ID to assign a product to.
- getRepo() : ProductPriceSheetRepository
- getSheetSql() : mixed
- resetProductPriceSheet() : array<string|int, mixed>|null
- save() : ProductPriceSheet
- Save the entity
- updateProductPriceSheet() : void
- updateTableValueByColumn() : mixed
- exportCsv() : StreamedResponse
- Exporting as csv
- isNewlyCreatedProduct() : bool
Constants
COEFF_SELL_PRICE_03
public
mixed
COEFF_SELL_PRICE_03
= 1.1
COEFF_SELL_PRICE_36
public
mixed
COEFF_SELL_PRICE_36
= 1.05
COEFF_SELL_PRICE_912
public
mixed
COEFF_SELL_PRICE_912
= 0.95
COEFF_SELL_PRICE_PLUS_12
public
mixed
COEFF_SELL_PRICE_PLUS_12
= 0.8667
Properties
$container
protected
ContainerInterface
$container
$header
protected
array<string|int, mixed>
$header
= []
$entityManager
private
EntityManagerInterface
$entityManager
Methods
__construct()
public
__construct(EntityManagerInterface $entityManager, ContainerInterface $container, ProductPriceSheetChangesLogService $logCalculBaseService) : mixed
Parameters
- $entityManager : EntityManagerInterface
- $container : ContainerInterface
- $logCalculBaseService : ProductPriceSheetChangesLogService
calculateSellPriceByProduct()
public
calculateSellPriceByProduct(mixed $product) : false|void
Parameters
- $product : mixed
Tags
Return values
false|voidexport()
Exporting sales
public
export(mixed $title, mixed $data, mixed $columns, mixed $format[, array<string|int, mixed> $customHeader = [] ]) : StreamedResponse
Parameters
- $title : mixed
- $data : mixed
- $columns : mixed
- $format : mixed
- $customHeader : array<string|int, mixed> = []
Return values
StreamedResponseexportXls()
Exporting as Xls
public
exportXls(mixed $data, mixed $columns, mixed $title[, bool $toFile = false ]) : mixed
Parameters
- $data : mixed
- $columns : mixed
- $title : mixed
- $toFile : bool = false
getGroupIDForProductAssignment()
Retrieves the group ID to assign a product to.
public
getGroupIDForProductAssignment() : int
This function queries the database to retrieve the count of products in each group from the 'mz_product_price_sheet' table. It then determines the group with the minimum count and returns its ID.
Return values
int —The group ID to assign the product to.
getRepo()
public
getRepo() : ProductPriceSheetRepository
Return values
ProductPriceSheetRepositorygetSheetSql()
public
getSheetSql(mixed $id) : mixed
Parameters
- $id : mixed
Tags
resetProductPriceSheet()
public
resetProductPriceSheet(mixed $product, mixed $userId) : array<string|int, mixed>|null
Parameters
- $product : mixed
- $userId : mixed
Tags
Return values
array<string|int, mixed>|nullsave()
Save the entity
public
save(ProductPriceSheet $productPriceSheet) : ProductPriceSheet
Parameters
- $productPriceSheet : ProductPriceSheet
Return values
ProductPriceSheetupdateProductPriceSheet()
public
updateProductPriceSheet(mixed $product, mixed $userId, mixed $priceData) : void
Parameters
- $product : mixed
- $userId : mixed
- $priceData : mixed
updateTableValueByColumn()
public
updateTableValueByColumn(mixed $rowId, mixed $value) : mixed
Parameters
- $rowId : mixed
- $value : mixed
exportCsv()
Exporting as csv
private
exportCsv(mixed $data, mixed $columns, mixed $title) : StreamedResponse
Parameters
- $data : mixed
- $columns : mixed
- $title : mixed
Return values
StreamedResponseisNewlyCreatedProduct()
private
isNewlyCreatedProduct(Product $product) : bool
Parameters
- $product : Product