Logidav Docs

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

Properties

Methods

calculateSellPriceByProduct()

public calculateSellPriceByProduct(mixed $product) : false|void
Parameters
$product : mixed
Tags
throws
DBALException
Return values
false|void

export()

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
StreamedResponse

exportXls()

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.

resetProductPriceSheet()

public resetProductPriceSheet(mixed $product, mixed $userId) : array<string|int, mixed>|null
Parameters
$product : mixed
$userId : mixed
Tags
throws
DBALException
Return values
array<string|int, mixed>|null

updateProductPriceSheet()

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
StreamedResponse

        
On this page

Search results