UpdateBaseDeCalculDataCommand
extends ContainerAwareCommand
in package
Command to update buying prices and calculate prix_revient for use in the "base de calcul" interface.
Usage: php bin/console menzzo:product:update-base-de-calcul-data
Table of Contents
Properties
- $currencyService : CurrencyService
- $entityManager : EntityManagerInterface
Methods
- __construct() : mixed
- configure() : mixed
- Command configuration.
- execute() : int
- Executes the command.
- calculatePrixRevient() : float
- Calculates prix_revient value.
- getFretChinaValue() : float
- Gets the value of "MZ_FRET_CHINA_FOR_BASE_DE_CALCUL" from configuration.
- updateBuyingPrices() : void
- Updates missing 'current_buying_price' values in mz_product.
- updateConfigTimestamp() : void
- Records the timestamp of last successful buying price fill in configuration.
- updatePrixRevient() : void
- Calculates and updates 'prix_revient' for all valid products in price sheet.
Properties
$currencyService
private
CurrencyService
$currencyService
$entityManager
private
EntityManagerInterface
$entityManager
Methods
__construct()
public
__construct([mixed $name = null ][, EntityManagerInterface $entityManager = null ][, CurrencyService $currencyService = null ]) : mixed
Parameters
- $name : mixed = null
- $entityManager : EntityManagerInterface = null
- $currencyService : CurrencyService = null
configure()
Command configuration.
protected
configure() : mixed
execute()
Executes the command.
protected
execute(InputInterface $input, OutputInterface $output) : int
Parameters
- $input : InputInterface
- $output : OutputInterface
Return values
intcalculatePrixRevient()
Calculates prix_revient value.
private
calculatePrixRevient(float $buyPrice, float $volume, float $usdRate, float $fretChina) : float
Parameters
- $buyPrice : float
- $volume : float
- $usdRate : float
- $fretChina : float
Return values
floatgetFretChinaValue()
Gets the value of "MZ_FRET_CHINA_FOR_BASE_DE_CALCUL" from configuration.
private
getFretChinaValue() : float
Tags
Return values
floatupdateBuyingPrices()
Updates missing 'current_buying_price' values in mz_product.
private
updateBuyingPrices(SymfonyStyle $io, Connection $connection) : void
Parameters
- $io : SymfonyStyle
- $connection : Connection
updateConfigTimestamp()
Records the timestamp of last successful buying price fill in configuration.
private
updateConfigTimestamp(Connection $connection, string $configCode, string $timestamp) : void
Parameters
- $connection : Connection
- $configCode : string
- $timestamp : string
updatePrixRevient()
Calculates and updates 'prix_revient' for all valid products in price sheet.
private
updatePrixRevient(SymfonyStyle $io, Connection $connection) : void
Parameters
- $io : SymfonyStyle
- $connection : Connection