GlsService
in package
Table of Contents
Properties
- $container : ContainerInterface
- $entityManager : EntityManagerInterface
- $logService : LogServiceInterface
- $productService : ProductService
- $saleProductService : SaleProductService|object
- $apiGls : SaleService|object
- $eventDispatcher : EventDispatcherInterface
- $saleLogService : SaleLogService
- $saleProductShipmentService : SaleProductShipmentService
- $saleProductShipmentTrackingService : SaleProductShipmentTrackingService
- $saleService : SaleService|object
- $userService : UserService
Methods
- __construct() : mixed
- GLS Service constructor.
- createSaleProductShipment() : true
- generatBodyForEtiquetGls() : array<string|int, mixed>
- generate Body for etiqueete Gls
- getParcelInfoByTrackingId() : mixed
- Send Expedition to Gls
- isGlsable() : bool
- Check if a package should be handled by GLS based on dimensions and weight
- isWithinGlsWeightLimit() : bool
- Check if weight is within GLS limits
- saveGlsEtiquette() : string
- sendExpeditionToGls() : mixed
- Send Expedition to Gls
- createSaleProductShipmentRecord() : SaleProductShipment
- createSaleProductShipmentTrackingRecord() : void
- dispatchSaleProductsAfterTicketPrintedEvent() : void
- dispatchSaleProductsShippedEvent() : void
- finalizeSale() : void
- isOversizedPackage() : bool
- Calculate if package dimensions qualify as oversized
- logShipment() : void
- processShipment() : void
- updateSaleProductStatus() : void
Properties
$container
protected
ContainerInterface
$container
$entityManager
protected
EntityManagerInterface
$entityManager
$logService
protected
LogServiceInterface
$logService
$productService
protected
ProductService
$productService
$saleProductService
protected
SaleProductService|object
$saleProductService
$apiGls
private
SaleService|object
$apiGls
$eventDispatcher
private
EventDispatcherInterface
$eventDispatcher
$saleLogService
private
SaleLogService
$saleLogService
$saleProductShipmentService
private
SaleProductShipmentService
$saleProductShipmentService
$saleProductShipmentTrackingService
private
SaleProductShipmentTrackingService
$saleProductShipmentTrackingService
$saleService
private
SaleService|object
$saleService
$userService
private
UserService
$userService
Methods
__construct()
GLS Service constructor.
public
__construct(ContainerInterface $container, GlsApi $glsApi, EntityManagerInterface $entityManager, LogServiceInterface $logService, EventDispatcherInterface $eventDispatcher) : mixed
Parameters
- $container : ContainerInterface
- $glsApi : GlsApi
- $entityManager : EntityManagerInterface
- $logService : LogServiceInterface
- $eventDispatcher : EventDispatcherInterface
createSaleProductShipment()
public
createSaleProductShipment(array<string|int, int> $saleProductIds[, int|string|null $userId = null ][, bool $logChanges = false ][, bool $notify = true ]) : true
Parameters
- $saleProductIds : array<string|int, int>
- $userId : int|string|null = null
- $logChanges : bool = false
- $notify : bool = true
Tags
Return values
truegeneratBodyForEtiquetGls()
generate Body for etiqueete Gls
public
generatBodyForEtiquetGls(Sale $sale, mixed $item, mixed $generateBareCode) : array<string|int, mixed>
Parameters
- $sale : Sale
- $item : mixed
- $generateBareCode : mixed
Return values
array<string|int, mixed>getParcelInfoByTrackingId()
Send Expedition to Gls
public
getParcelInfoByTrackingId(mixed $trackingId) : mixed
Parameters
- $trackingId : mixed
isGlsable()
Check if a package should be handled by GLS based on dimensions and weight
public
static isGlsable(float $length, float $width, float $height, float $weight) : bool
Parameters
- $length : float
-
Length in cm
- $width : float
-
Width in cm
- $height : float
-
Height in cm
- $weight : float
-
Weight in kg
Return values
bool —True if GLS should handle the package
isWithinGlsWeightLimit()
Check if weight is within GLS limits
public
static isWithinGlsWeightLimit(float $weight) : bool
Parameters
- $weight : float
-
Weight in kg
Return values
boolsaveGlsEtiquette()
public
saveGlsEtiquette(mixed $data, mixed $sp) : string
Parameters
- $data : mixed
- $sp : mixed
Return values
stringsendExpeditionToGls()
Send Expedition to Gls
public
sendExpeditionToGls(mixed $data) : mixed
Parameters
- $data : mixed
createSaleProductShipmentRecord()
private
createSaleProductShipmentRecord(SaleProduct $sp, mixed $user, DateTime $now) : SaleProductShipment
Parameters
- $sp : SaleProduct
- $user : mixed
- $now : DateTime
Tags
Return values
SaleProductShipmentcreateSaleProductShipmentTrackingRecord()
private
createSaleProductShipmentTrackingRecord(SaleProduct $sp, DateTime $now, SaleProductShipment $saleProductShipment) : void
Parameters
- $sp : SaleProduct
- $now : DateTime
- $saleProductShipment : SaleProductShipment
dispatchSaleProductsAfterTicketPrintedEvent()
private
dispatchSaleProductsAfterTicketPrintedEvent(SaleProductShipment $saleProductShipment) : void
Parameters
- $saleProductShipment : SaleProductShipment
dispatchSaleProductsShippedEvent()
private
dispatchSaleProductsShippedEvent(array<string|int, mixed> $saleProductIds) : void
Parameters
- $saleProductIds : array<string|int, mixed>
finalizeSale()
private
finalizeSale(Sale $sale, DateTime $now, bool $logChanges, mixed $user) : void
Parameters
- $sale : Sale
- $now : DateTime
- $logChanges : bool
- $user : mixed
Tags
isOversizedPackage()
Calculate if package dimensions qualify as oversized
private
static isOversizedPackage(float $length, float $width, float $height) : bool
Parameters
- $length : float
-
Length in cm
- $width : float
-
Width in cm
- $height : float
-
Height in cm
Return values
boollogShipment()
private
logShipment(Sale $sale, bool $shipmentId, SaleProduct $sp, mixed $user) : void
Parameters
- $sale : Sale
- $shipmentId : bool
- $sp : SaleProduct
- $user : mixed
Tags
processShipment()
private
processShipment(SaleProduct $sp, Sale $sale, mixed $user, bool $notify) : void
Parameters
- $sp : SaleProduct
- $sale : Sale
- $user : mixed
- $notify : bool
Tags
updateSaleProductStatus()
private
updateSaleProductStatus(SaleProduct $sp, DateTime $now) : void
Parameters
- $sp : SaleProduct
- $now : DateTime