Logidav Docs

ChannableService extends SaleService
in package

Class SaleService

Table of Contents

Constants

LAST_MAGENTO_ID_CONFIG_CODE  = 'LAST_MAGENTO_ID'
SOURCE  = 'Channable'
TNT_MAX_NB_PARCELS  = 3
TNT_MAX_PACKAGE_WEIGHT  = 30
TNT_MAX_WEIGHT  = 90
TRACKING_LENGTH  = 13

Properties

$alfyApi  : AlfyApi
$channableAccessToken  : string
$channableApiUrl  : string
$channableCompanyId  : int
$channableProjectId  : int
$channableV1ApiUrl  : string
$container  : ContainerInterface
$em  : EntityManager
$eventDispatcher  : EventDispatcher
$httpClient  : Client
$logService  : LogService
$mosaikasaService  : mixed
$productService  : mixed
$saleEntity  : Sale
$salePrestoService  : mixed
$saleProductService  : SaleProductService
$saleRepository  : SaleRepository
$smsService  : mixed
$source  : mixed
$status  : mixed
$header  : mixed
$trackingCodeService  : TrackingCodeService

Methods

__construct()  : mixed
addAlfyDeliveryDate()  : false|string
addLogIfHasConsolidatedProduct()  : mixed
addOrder()  : mixed
Ajouter une commande
addOrderItem()  : SaleProduct
Adding order items
addRepository()  : void
Add a repository to this service
addService()  : void
Add a service to this service
afterSaleCanceled()  : void
Handles logic to be executed after a sale has been canceled.
buildCsvDataFromTntData()  : mixed
calculateSaleProductRealShippingMethod()  : void
Calculates the real shipping method for the given SaleProduct.
calculateSaleProductShippingAmount()  : mixed
calculateSaleProductsShippment()  : bool
Calculating sale products shippment
calendarByTransporter()  : mixed
canCallOnSaleConfirmedWebhook()  : mixed
Check whether webhook call is active or not
canCallWebhook()  : mixed
Check whether webhook call is active or not
canCancelSale()  : bool
Can cancel sale
canCancelSaleProduct()  : bool
Can cancel sale product
cancelOrderInChannable()  : array<string|int, mixed>
Cancels an order in Channable for the specified order and order items.
cancelPreRefund()  : mixed
cancel preRefund
cancelSaleOrSaleProduct()  : string
Canceling sale or sale product
canImportSales()  : mixed
Check whether sales import is active or not
canReactiveSaleProduct()  : bool
Can cancel sale product
checkSaleAndSetComplete()  : bool
Checking sale and set complete if all saleProducts has been shipped
checkTrackingNumberUniqueness()  : bool
Check tracking number uniqness
construct()  : mixed
SaleService constructor.
createCalbersonPreExpeditionForSale()  : array<string|int, mixed>
createChronopostPreExpeditionForSale()  : array<string|int, mixed>
createGlsPreExpeditionForSale()  : array<string|int, mixed>
createInvoiceAfterShipmentCsv()  : false|string
create invoice after shipment csv
createManualExpedition()  : array<string|int, mixed>
Creating manual expedition for sale
createOrderShipment()  : mixed
Create Order Shipment
createOrderShipmentMagento()  : bool
This function is used for retrait
createRetraitExpedition()  : bool
Create retrait expedition
createRetraitExpeditionMagento()  : string
Creating retrait expedition for sale
createSalePresto()  : mixed
Add sale presto datas
createSdenPreExpeditionForSale()  : array<string|int, mixed>
createShipmentCsv()  : false|string
Create shipment csv in magento
createTntExpedition()  : array<string|int, mixed>
Creating tnt expedition
createTrackingUrl()  : mixed
existenceValidationRequest()  : array<string|int, mixed>
export()  : StreamedResponse
Exporting sales
exportSalesXls()  : mixed
Exporting as Xls
find()  : mixed
findAll()  : mixed
findBy()  : mixed
findById()  : mixed
findByNot()  : mixed
Search by not
findOneByIncrementId()  : mixed
findSalesUpdated()  : array<string|int, mixed>|int|string
findSpecificSales()  : mixed
generateChronopostTicketForSaleProduct()  : void
Generate sale product ticket
generateGeodisExpeditionTickets()  : array<string|int, array<string|int, mixed>>
Generate Geodis expedition ticket
generateGeodisExpeditionTicketsForParts()  : array<string|int, array<string|int, mixed>>
Generate Geodis expedition ticket
generateGeodisExpeditionTicketsTest()  : array<string|int, array<string|int, mixed>>
Generate Geodis expedition ticket
generateSaleDataMapping()  : array<string|int, mixed>
Map V2 data to logidav
generateUniqTrackingId()  : string
Generate a unique tracking number
generateUniqueSaleTrackingId()  : string
Generate unique sale tracking id
getAllSources()  : array<string|int, mixed>
getAvailableShippingBySale()  : array<string|int, mixed>
Get available shipping methods by Sale
getBillingEmail()  : string|null
Get billing email for sale
getCarrierLinks()  : array<string|int, mixed>
Get carrier track links
getCarrierList()  : array<string|int, mixed>|mixed|string
getCartCheckOrder()  : mixed
getChannableAccessToken()  : string
Retrieve the Channable access token.
getChannableApiUrl()  : string
Retrieve the Channable API URL.
getChannableCarrier()  : string
Determines and returns the carrier name for the provided sale product.
getChannableCompanyId()  : int
Obtenir le compte Channable
getChannableProjectId()  : int
Obtenir le projet Channable
getChronopostOrdersForPrint()  : mixed
getCountAmazonShippingNotPrinted()  : mixed
getCountEspagneShippingNotPrinted()  : mixed
getCountShippingNotPrinted()  : mixed
getCountStoreNotPrinted()  : int|mixed|string
getCustomerEmail()  : mixed
Get billing email for sale
getCustomerFullName()  : mixed
Getting Customer first name
getCustomerSales()  : mixed
getEntityManager()  : EntityManager
Getter of the Entity Manager
getFormattedSaleTrackings()  : array<string|int, mixed>
getIncrementIdFromTrack()  : mixed
getItemIdsFromTrack()  : mixed
getLastId()  : mixed
getLastMagentoId()  : mixed
getMarketplaceCreatedAt()  : DateTime
Get marketplace date
getNumberOfSav()  : mixed
getOldRetrait()  : mixed
getOrderInfo()  : array<string|int, mixed>
Get sale info
getOrders()  : array<string|int, mixed>|null
Fetches orders from the Channable API based on the provided filters.
getOrdersByRange()  : mixed
getPartnerName()  : mixed
getPaylinePaymentStats()  : mixed
Get Payline Stats PayPal|CB|FCB3X|PRESTO
getPaymentStat()  : mixed
Getting payment stats
getRepo()  : SaleRepository|SaleRepository
Get Repository
getReservedChronopostSales()  : string
Return sales in csv file
getSaleByTrackingId()  : mixed
getSaleByUser()  : mixed
getSaleIfItExists()  : mixed
Vérifier si une vente existe déjà
getSaleInfo()  : array<string|int, mixed>
Get sale info
getSaleInvoice()  : bool
Get order invoice
getSalePaymentMethod()  : string
Obtenir la méthode de paiement pour une vente
getSaleRepository()  : mixed
Get Sale Repository
getSaleSavCountByStatus()  : mixed
getSaleShippingAddress()  : array<string|int, mixed>
getSalesNumberByDateAndSource()  : mixed
getSaleSource()  : string
Get Sale source
getSaleTracking()  : string
Get Sale tracking
getSaleTrackingCodes()  : array<string|int, mixed>
getSaleTrackings()  : array<string|int, mixed>
getSaleTrackLink()  : string
Get Sale track link
getSaleTrackLinkV2()  : string
Get Sale track link
getSellsyTransporter()  : mixed
Get Sellsy transporter
getShipmentCreatedAt()  : mixed
getShippingAmountForSellsy()  : float
Get Shipping amount
getShippingMethodFromV1()  : mixed
Get Shipping method from v1 data v1 to v2
getShippingMethodFromV2Data()  : mixed
Mapping V2 shipping data to v1 data
getShippingTelephone()  : mixed
Get Shipping telephone for sale
getSource()  : string
Get source identifier
getV1ChannableApiUrl()  : string
Get the Channable API URL for version 1
handleRdv()  : void
importSalesByCriteria()  : mixed
isAllowedToCancelTuskOrder()  : false
isOkToSendRetraitEmail()  : bool
notifyCustomerForDelivery()  : array<string|int, mixed>
onAfterSaleCreated()  : mixed
This method is triggered after a sale is created.
onAfterSaleUpdated()  : mixed
This method is triggered after a sale is updated.
onSaleProductsShipped()  : void
Handles the shipment of sale products by processing them if they meet the required conditions.
processOrders()  : array<string|int, mixed>
Processes an array of orders and creates sales entries while providing feedback through the output interface.
processSaleForFrontApp()  : void
Process a sale transaction.
reactiveSaleProduct()  : string
Reactive sale or sale product
regenerateSaleTrackLinks()  : void
salesByDate()  : mixed
save()  : Sale
Save a Sale
saveFromApi()  : Sale|bool
Save a Sale
search()  : mixed
search a Sales
searchFull()  : array<string|int, mixed>
searchIdfPlanning()  : mixed
Search idf planning
searchIdfPlanningPdf()  : array<string|int, mixed>|Query|int|string
search a Sales
searchIdfTransporter()  : mixed
Search idf transporter
searchOrdersUpdated()  : mixed
searchProcessingInStockNotPrinted()  : mixed
Search processing in stock not printed sales
searchProcessingNotPrinted()  : mixed
Search processing not printed
searchProcessingNotPrintedNoStock()  : mixed
Search processing not printed
searchProcessingOldRetrait()  : mixed
searchProcessingRetraitNew()  : mixed
Search processing retrait new
searchProcessingRetraitNotPrinted()  : mixed
Search processing retrait not printed sales
searchRecapCommandesMarketplaces()  : mixed
Search processing not printed
searchSaleDropInvoiced()  : mixed
search a Sales
searchSaleDropPending()  : mixed
searchSaleSendExpedition()  : mixed
Search sent expedition sales
searchSalesForPrintInvoices()  : array<string|int, mixed>|int|string
Search for sales to print
searchShippedChronopost()  : mixed
Get SaleProduct
searchUpStairsPlanning()  : mixed
Get UpStairs planing
searchUpStairsTransporter()  : mixed
Search a Sales
sendRetraitEmail()  : bool|void
sendSmsCodeCoupon()  : string
sendSparePartToChronopost()  : array<string|int, mixed>
Sends a spare part shipment request to Chronopost
sendToChronopost()  : array<string|int, mixed>
Send sale to chronopost
sendToTrusk()  : mixed
setChannableAccessToken()  : void
Set the Channable access token
setChannableApiUrl()  : void
Set the Channable API URL.
setChannableCompanyId()  : mixed
Définir le compte Channable
setChannableProjectId()  : mixed
Définir le projet Channable
setEntityManager()  : void
Définit l'entity manager pour la classe parente
setIsIdf()  : mixed
Set Product as idf
setIsUpStairs()  : mixed
Set is UpStairs
setLastMagentoId()  : int
setRealShippingMethod()  : string
Set real shipping method by method and postalCode
setSaleEntity()  : mixed
Setting sale entity
setSaleProductAsShippedChronopost()  : mixed
Setting sale product as shipped
setSaleProductAsShippedGeodis()  : mixed
Setting sale product as shipped
setSaleProductsAsShipped()  : mixed
Setting sale product as shipped
setV1ChannableApiUrl()  : void
Set the Channable V1 API URL.
showInvoiceInformationsEditButton()  : bool
Show invoice edit button
showPreRefundBlock()  : mixed
Show pre refund block in sale show
showSaleProductsEditButton()  : mixed
showSaleProductsSelect()  : mixed
showSaleStatusEditButton()  : bool
Show sale status edit button
showShippingAddressFullname()  : mixed
showShippingInformationEditButton()  : bool
Show invoice edit button
showShippingMethodEditButton()  : bool
Show shipping method edit button in sale view
sumShipping()  : mixed
Sum shipping
switchToComplete()  : string
Switch sale to complete state
switchToProcessing()  : string
Switch sale to processing
trackingId()  : string
Generating tracking id
trackingIdByS()  : bool
Check is old tracking
updateContactOnFrontApp()  : mixed
updateInternalStockAndWriteAsirLog()  : void
updateOrderShipmentStatusInChannable()  : array<string|int, mixed>|null
Updates the shipment status of an order in Channable.
updateSaleAddress()  : string
Update sale address from sale sheet
updateSaleProductAvailabilityDate()  : mixed
07-12-2021 : Add type (DDISP) for Salelog by Habib ben aissa
_evaluateWeightItemFromProduct()  : float|int
_evaluateWeightItemLineFromProduct()  : mixed
cancelMagentoSale()  : mixed
Sending request to magento to cancel a sale
cancelSale()  : string
Canceling a sale
cancelSaleProduct()  : string
Canceling sale product
createNewSale()  : Sale
Creating new order
createSaleFromChannableOrder()  : array<string|int, mixed>
Creates a sale record from a given Channable order.
createSaleShipment()  : mixed
Creating sale shipment
getChronopostTrackingNumberForSpareParts()  : mixed
Save Chronopost shipping infos
getCustomerAvailabilityDate()  : false|string
getCustomerAvailabilityForSaleProduct()  : string
Getting product options
getCustomerFirstNameForSale()  : mixed
Getting customer First name for sale creation
getCustomerIdForSale()  : mixed
Getting customer id for sale creation
getCustomerLastNameForSale()  : mixed
Getting customer last Name for sale creation
getOrderItemReference()  : string
getProductOptionsForSale()  : mixed
Getting product options
getShippingMethodForSale()  : mixed
Getting Shipping for sale creation
mapChannableStatusToInternal()  : string
Mapper le statut Channable vers le statut interne
saveChronopostShippingInfo()  : mixed
Save Chronopost shipping infos
setIsInvoicedSellsy()  : mixed
Getting is invoiced Sellsy sale creation
updateOrderItem()  : SaleProduct
Update order item
addSingleHandleToContact()  : mixed
createContactInFrontApp()  : void
Creates a contact in the FrontApp system.
exportCsv()  : mixed
Exporting as csv
exportXls()  : mixed
Exporting as Xls
getFrontAppContactByContactId()  : array<string|int, mixed>|null
Retrieves the front app contact details by contact ID.
getProductInfoIfItExists()  : mixed|null
Retrieves the product information for a given product SKU if it exists.
getShippingInfoFromV2Data()  : array<string|int, mixed>
Get Shipping method for v2 data
processOrderProducts()  : array<string|int, mixed>
Process the products in an order and prepare the structured order items array
processShipment()  : void
Processes the shipment for the provided sale and sale product, updating the shipment status in an external system if all necessary data is present.
retriveOrderItemsIds()  : array<string|int, mixed>
Retrieves the unique item IDs from the provided sale order items.
retriveOrderTrackingId()  : string|null
Retrieves the tracking ID for the given sale product.
synchronizeSaleCancelInChannable()  : void
Synchronizes the cancellation of a sale order in Channable.
updateCustomFields()  : mixed
validateChannableConfiguration()  : void
Validates the configuration required for connecting to the Channable API.

Constants

LAST_MAGENTO_ID_CONFIG_CODE

public mixed LAST_MAGENTO_ID_CONFIG_CODE = 'LAST_MAGENTO_ID'

TNT_MAX_NB_PARCELS

public mixed TNT_MAX_NB_PARCELS = 3

TNT_MAX_PACKAGE_WEIGHT

public mixed TNT_MAX_PACKAGE_WEIGHT = 30

Properties

$eventDispatcher

protected EventDispatcher $eventDispatcher

$mosaikasaService

protected mixed $mosaikasaService

$salePrestoService

protected mixed $salePrestoService

$status

protected mixed $status = ['complete' => 'complete', 'pending_payment' => 'pending_payment', 'canceled' => 'canceled', 'holded' => 'holded', 'closed' => 'closed', 'payment_refused' => 'payment_refused', 'pending' => 'pending', 'paypal_reversed' => 'paypal_reversed', 'paypal_canceled_reversal' => 'paypal_canceled_reversal', 'payment_review' => 'payment_review', 'processing' => 'processing', 'fraud' => 'fraud', 'paid3x' => 'paid3x', 're_expedition' => 're_expedition']

$header

private mixed $header = ['id' => 'ID', 'incrementId' => 'Incr.ID', 'status' => 'Status', 'customer' => 'Client', 'sku' => 'SKU', 'Date' => 'Date', 'NOM' => 'NOM', 'Prenom' => 'Prenom', 'Mail' => 'Mail', 'Sub total' => 'Sub total', 'Remise' => 'Remise', 'Code remise' => 'Code remise', 'Frais de port' => 'Frais de port', 'Grand total hors taxe' => 'Grand total hors taxe', 'IAV' => 'IAV', 'Grand total avec taxe' => 'Grand total avec taxe', 'shippingMethod' => 'Livraison', 'realShippingMethod' => 'Livraison réel', 'grandTotal' => 'Total', 'createdAt' => 'Date', 'isPrinted' => 'Imprimer', 'source' => 'Source', 'qty' => 'QTY', 'available' => 'Dispo. Réelle', 'customerAvailable' => 'Dispo. Client', 'diffDates' => 'Diff. des dates', 'createdAtDate' => 'Date', 'createdAtTime' => 'Heure', 'notif' => 'Notif', 'track' => 'TRACKING', 'tnt_label' => 'Etiquette', 'magentoNum' => 'Numéro d\'expédition', 'scannedAt' => 'Date scan', 'menzzo' => 'MENZZO#', 'cmd' => 'Commande N°', 'date' => 'Date', 'billing_email' => 'Email de Facturation', 'dispo' => ' Dispo', 'expedition' => 'Suivre l\'expédition', 'sellsy' => 'ID sellsy', 'sellsyInvoicedAt' => 'Date sellsy facturé', 'user' => 'Utilisateur', 'message' => 'Message', 'created_at' => 'Date', 'phone' => 'Tel', 'address' => 'Adresse', 'postcode' => 'Code Postal', 'dateidf' => ' Date IDF', 'reason' => 'Etat', 'fixedDate' => 'Date RDV', 'idfCalledAtTime' => 'De', 'idfCalledToTime' => 'A', 'transporter' => 'Transporteur', 'username' => 'Transporteur', 'shippedAt' => 'Date']

Methods

__construct()

public __construct(EntityManagerInterface $entityManager) : mixed
Parameters
$entityManager : EntityManagerInterface

addAlfyDeliveryDate()

public addAlfyDeliveryDate(Sale $sale, SaleProduct $saleProduct[, mixed $userId = null ]) : false|string
Parameters
$sale : Sale
$saleProduct : SaleProduct
$userId : mixed = null
Return values
false|string

addLogIfHasConsolidatedProduct()

public addLogIfHasConsolidatedProduct(mixed $sale) : mixed
Parameters
$sale : mixed

addOrder()

Ajouter une commande

public addOrder(array<string|int, mixed> $data[, bool $isV2Data = false ]) : mixed
Parameters
$data : array<string|int, mixed>
$isV2Data : bool = false

addOrderItem()

Adding order items

public addOrderItem(mixed $item, mixed $sale, mixed $countItems[, mixed $k = null ]) : SaleProduct
Parameters
$item : mixed
$sale : mixed
$countItems : mixed
$k : mixed = null
Tags
throws
Exception
Return values
SaleProduct

addRepository()

Add a repository to this service

public addRepository(int $key, string $class) : void
Parameters
$key : int

Key

$class : string

Class

addService()

Add a service to this service

public addService(int $key, mixed $service) : void
Parameters
$key : int

Key

$service : mixed

buildCsvDataFromTntData()

public buildCsvDataFromTntData(mixed $tntData) : mixed
Parameters
$tntData : mixed

calculateSaleProductRealShippingMethod()

Calculates the real shipping method for the given SaleProduct.

public calculateSaleProductRealShippingMethod(SaleProduct &$sp) : void

This method determines the appropriate shipping method based on various conditions such as the sale's source, shipping address country, postal code, product characteristics, and more. It modifies the SaleProduct object directly to set the real shipping method based on the criteria defined within the method.

Parameters
$sp : SaleProduct

The SaleProduct object for which the real shipping method is calculated.

Tags
throws
Exception

If an error occurs while retrieving shipping information or processing logic.

calculateSaleProductsShippment()

Calculating sale products shippment

public calculateSaleProductsShippment(Sale $sale) : bool

You should not use this function again and this function will be remove in the next version The problem was TNT shipping problem

Parameters
$sale : Sale
Return values
bool

calendarByTransporter()

public calendarByTransporter(mixed $data) : mixed
Parameters
$data : mixed

canCallOnSaleConfirmedWebhook()

Check whether webhook call is active or not

public canCallOnSaleConfirmedWebhook() : mixed
Tags
throws
Exception

canCallWebhook()

Check whether webhook call is active or not

public canCallWebhook() : mixed
Tags
throws
Exception

canCancelSale()

Can cancel sale

public canCancelSale(mixed $saleId) : bool
Parameters
$saleId : mixed
Tags
throws
Exception
Return values
bool

canCancelSaleProduct()

Can cancel sale product

public canCancelSaleProduct(SaleProduct|int $saleProductId) : bool
Parameters
$saleProductId : SaleProduct|int
Tags
throws
Exception
Return values
bool

cancelOrderInChannable()

Cancels an order in Channable for the specified order and order items.

public cancelOrderInChannable(string $orderId, array<string|int, mixed> $orderItemIds) : array<string|int, mixed>
Parameters
$orderId : string

The ID of the order to be cancelled.

$orderItemIds : array<string|int, mixed>

A list of IDs for the order items to be cancelled.

Tags
throws
Exception

If the HTTP request fails or any other exception occurs.

Return values
array<string|int, mixed>

The response from the Channable API after attempting to cancel the order.

cancelPreRefund()

cancel preRefund

public cancelPreRefund(mixed $sale) : mixed
Parameters
$sale : mixed

cancelSaleOrSaleProduct()

Canceling sale or sale product

public cancelSaleOrSaleProduct(mixed $saleId, mixed $action, mixed $idSp[, mixed $forcedWhileExpeditionIsInProgress = false ][, mixed $createSaleSavAndPreRefund = true ][, mixed $user = null ]) : string
Parameters
$saleId : mixed
$action : mixed
$idSp : mixed
$forcedWhileExpeditionIsInProgress : mixed = false
$createSaleSavAndPreRefund : mixed = true
$user : mixed = null
Tags
throws
OptimisticLockException
throws
Exception
Return values
string

canImportSales()

Check whether sales import is active or not

public canImportSales() : mixed
Tags
throws
Exception

canReactiveSaleProduct()

Can cancel sale product

public canReactiveSaleProduct(SaleProduct|int $saleProductId) : bool
Parameters
$saleProductId : SaleProduct|int
Tags
throws
Exception
Return values
bool

checkSaleAndSetComplete()

Checking sale and set complete if all saleProducts has been shipped

public checkSaleAndSetComplete(mixed $sale[, null $userId = null ][, mixed $logChanges = false ]) : bool
Parameters
$sale : mixed
$userId : null = null
$logChanges : mixed = false
Tags
throws
GuzzleException
Return values
bool

checkTrackingNumberUniqueness()

Check tracking number uniqness

public checkTrackingNumberUniqueness(mixed $trackingNumber) : bool
Parameters
$trackingNumber : mixed
Return values
bool

createCalbersonPreExpeditionForSale()

public createCalbersonPreExpeditionForSale(mixed $orderId, mixed $orderItemId, mixed $token, mixed $warehouseId) : array<string|int, mixed>
Parameters
$orderId : mixed
$orderItemId : mixed
$token : mixed
$warehouseId : mixed
Tags
throws
Exception
Return values
array<string|int, mixed>

createChronopostPreExpeditionForSale()

public createChronopostPreExpeditionForSale(mixed $orderId, mixed $orderItemId, mixed $token) : array<string|int, mixed>
Parameters
$orderId : mixed
$orderItemId : mixed
$token : mixed
Tags
throws
Exception
Return values
array<string|int, mixed>

createGlsPreExpeditionForSale()

public createGlsPreExpeditionForSale(mixed $orderId, mixed $orderItemId, mixed $token) : array<string|int, mixed>
Parameters
$orderId : mixed
$orderItemId : mixed
$token : mixed
Tags
throws
Exception
Return values
array<string|int, mixed>

createInvoiceAfterShipmentCsv()

create invoice after shipment csv

public createInvoiceAfterShipmentCsv(mixed $isFullItemsToShip, mixed $isFullItemsShipped) : false|string
Parameters
$isFullItemsToShip : mixed
$isFullItemsShipped : mixed
Return values
false|string

createManualExpedition()

Creating manual expedition for sale

public createManualExpedition(mixed $saleId, mixed $items, mixed $carrier, mixed $trackNumber) : array<string|int, mixed>
Parameters
$saleId : mixed
$items : mixed
$carrier : mixed
$trackNumber : mixed
Tags
throws
GuzzleException
throws
SoapFault
Return values
array<string|int, mixed>

createOrderShipment()

Create Order Shipment

public createOrderShipment(mixed $itemsQty) : mixed
Parameters
$itemsQty : mixed

createOrderShipmentMagento()

This function is used for retrait

public createOrderShipmentMagento(mixed $sale, mixed $itemsToShip, mixed $sendMail) : bool
Parameters
$sale : mixed
$itemsToShip : mixed
$sendMail : mixed
Tags
throws
GuzzleException
todo

remove this function and create new one to work with retrait only

Return values
bool

createRetraitExpedition()

Create retrait expedition

public createRetraitExpedition(mixed $order, mixed $itemsToShip[, int $trackingLength = 13 ]) : bool
Parameters
$order : mixed
$itemsToShip : mixed
$trackingLength : int = 13
Tags
throws
SoapFault
todo

check and remove this function

Return values
bool

createRetraitExpeditionMagento()

Creating retrait expedition for sale

public createRetraitExpeditionMagento(mixed $sale, mixed $isFullItemsShipped[, mixed $userId = null ]) : string
Parameters
$sale : mixed
$isFullItemsShipped : mixed
$userId : mixed = null
Tags
throws
GuzzleException
todo

refactor this function

Return values
string

createSalePresto()

Add sale presto datas

public createSalePresto(mixed $sale, mixed $data) : mixed
Parameters
$sale : mixed
$data : mixed

createSdenPreExpeditionForSale()

public createSdenPreExpeditionForSale(mixed $orderId, mixed $orderItemId, mixed $token) : array<string|int, mixed>
Parameters
$orderId : mixed
$orderItemId : mixed
$token : mixed
Tags
throws
Exception
Return values
array<string|int, mixed>

createShipmentCsv()

Create shipment csv in magento

public createShipmentCsv(mixed $_incrementId, mixed $partner, mixed $trackingTitle, mixed $_trackingNumber, mixed $itemsToShip, mixed $isFullItemsShipped[, mixed $notify = true ]) : false|string
Parameters
$_incrementId : mixed
$partner : mixed
$trackingTitle : mixed
$_trackingNumber : mixed
$itemsToShip : mixed
$isFullItemsShipped : mixed
$notify : mixed = true
Return values
false|string

createTntExpedition()

Creating tnt expedition

public createTntExpedition(mixed $sale, mixed $orderItemIds) : array<string|int, mixed>

remove this function later

Parameters
$sale : mixed
$orderItemIds : mixed
Return values
array<string|int, mixed>

createTrackingUrl()

public createTrackingUrl(mixed $partner[, mixed $trackingNumber = '' ]) : mixed
Parameters
$partner : mixed
$trackingNumber : mixed = ''

existenceValidationRequest()

public existenceValidationRequest(mixed $saleId) : array<string|int, mixed>
Parameters
$saleId : mixed
Return values
array<string|int, mixed>

export()

Exporting sales

public export(mixed $title, mixed $data, mixed $columns, mixed $format[, array<string|int, mixed> $customHeader = [] ][, mixed $isAsirRecap = false ]) : StreamedResponse
Parameters
$title : mixed
$data : mixed
$columns : mixed
$format : mixed
$customHeader : array<string|int, mixed> = []
$isAsirRecap : mixed = false
Tags
throws
PHPExcel_Exception
Return values
StreamedResponse

exportSalesXls()

Exporting as Xls

public exportSalesXls(mixed $data, mixed $columns, mixed $title[, bool $toFile = false ]) : mixed
Parameters
$data : mixed
$columns : mixed
$title : mixed
$toFile : bool = false

find()

public find(mixed $id) : mixed
Parameters
$id : mixed

findBy()

public findBy([mixed $params = [] ]) : mixed
Parameters
$params : mixed = []

findById()

public findById(mixed $ids) : mixed
Parameters
$ids : mixed

findByNot()

Search by not

public findByNot([array<string|int, mixed> $params = [] ]) : mixed
Parameters
$params : array<string|int, mixed> = []

findOneByIncrementId()

public findOneByIncrementId(mixed $incrementId) : mixed
Parameters
$incrementId : mixed

findSalesUpdated()

public findSalesUpdated() : array<string|int, mixed>|int|string
Return values
array<string|int, mixed>|int|string

findSpecificSales()

public findSpecificSales() : mixed

generateChronopostTicketForSaleProduct()

Generate sale product ticket

public generateChronopostTicketForSaleProduct(SaleProduct $saleProduct) : void
Parameters
$saleProduct : SaleProduct
Tags
throws
DBALException

generateGeodisExpeditionTickets()

Generate Geodis expedition ticket

public generateGeodisExpeditionTickets(Sale $sale, array<string|int, mixed> $saleProductIds[, mixed $isValidated = true ][, mixed $fromDateTime = null ][, mixed $warehouseId = 1 ]) : array<string|int, array<string|int, mixed>>
Parameters
$sale : Sale
$saleProductIds : array<string|int, mixed>
$isValidated : mixed = true
$fromDateTime : mixed = null
$warehouseId : mixed = 1
Tags
throws
ORMException
throws
OptimisticLockException
Return values
array<string|int, array<string|int, mixed>>

generateGeodisExpeditionTicketsForParts()

Generate Geodis expedition ticket

public generateGeodisExpeditionTicketsForParts(Sale $sale, mixed $saleProduct, mixed $listUmgs) : array<string|int, array<string|int, mixed>>
Parameters
$sale : Sale
$saleProduct : mixed
$listUmgs : mixed
Tags
throws
ORMException
throws
OptimisticLockException
Return values
array<string|int, array<string|int, mixed>>

generateGeodisExpeditionTicketsTest()

Generate Geodis expedition ticket

public generateGeodisExpeditionTicketsTest(Sale $sale, array<string|int, mixed> $saleProductIds[, mixed $isValidated = true ][, mixed $fromDateTime = null ], mixed $weight, mixed $volume) : array<string|int, array<string|int, mixed>>
Parameters
$sale : Sale
$saleProductIds : array<string|int, mixed>
$isValidated : mixed = true
$fromDateTime : mixed = null
$weight : mixed
$volume : mixed
Tags
throws
ORMException
throws
OptimisticLockException
Return values
array<string|int, array<string|int, mixed>>

generateSaleDataMapping()

Map V2 data to logidav

public generateSaleDataMapping(mixed $data) : array<string|int, mixed>
Parameters
$data : mixed
Return values
array<string|int, mixed>

generateUniqTrackingId()

Generate a unique tracking number

public generateUniqTrackingId([int $length = 15 ]) : string
Parameters
$length : int = 15
Return values
string

generateUniqueSaleTrackingId()

Generate unique sale tracking id

public generateUniqueSaleTrackingId([mixed $prefix = 'MZ' ]) : string
Parameters
$prefix : mixed = 'MZ'
Return values
string

getAllSources()

public getAllSources() : array<string|int, mixed>
Tags
throws
DBALException
Return values
array<string|int, mixed>

getAvailableShippingBySale()

Get available shipping methods by Sale

public getAvailableShippingBySale(mixed $sale[, array<string|int, mixed> $address = [] ]) : array<string|int, mixed>
Parameters
$sale : mixed
$address : array<string|int, mixed> = []
Tags
todo

fix $address parameter

Return values
array<string|int, mixed>

getBillingEmail()

Get billing email for sale

public getBillingEmail([Sale|null $sale = null ]) : string|null
Parameters
$sale : Sale|null = null
Return values
string|null

Get carrier track links

public getCarrierLinks(mixed $carrier, mixed $trackings[, mixed $skipApiRequests = false ]) : array<string|int, mixed>
Parameters
$carrier : mixed
$trackings : mixed
$skipApiRequests : mixed = false
Return values
array<string|int, mixed>

getCarrierList()

public static getCarrierList([null $method = null ]) : array<string|int, mixed>|mixed|string
Parameters
$method : null = null
Return values
array<string|int, mixed>|mixed|string

getCartCheckOrder()

public getCartCheckOrder(mixed $cart) : mixed
Parameters
$cart : mixed

getChannableAccessToken()

Retrieve the Channable access token.

public getChannableAccessToken() : string
Return values
string

getChannableApiUrl()

Retrieve the Channable API URL.

public getChannableApiUrl() : string
Return values
string

getChannableCarrier()

Determines and returns the carrier name for the provided sale product.

public getChannableCarrier(mixed $saleProduct) : string
Parameters
$saleProduct : mixed

The sale product object containing carrier information.

Return values
string

The name of the carrier, defaulting to 'GEODIS' if none is specified.

getChannableCompanyId()

Obtenir le compte Channable

public getChannableCompanyId() : int
Return values
int

getChannableProjectId()

Obtenir le projet Channable

public getChannableProjectId() : int
Return values
int

getChronopostOrdersForPrint()

public getChronopostOrdersForPrint(mixed $ids) : mixed
Parameters
$ids : mixed

getCountAmazonShippingNotPrinted()

public getCountAmazonShippingNotPrinted(mixed $shippingMethode) : mixed
Parameters
$shippingMethode : mixed

getCountEspagneShippingNotPrinted()

public getCountEspagneShippingNotPrinted() : mixed

getCountShippingNotPrinted()

public getCountShippingNotPrinted(mixed $realShippingMethod) : mixed
Parameters
$realShippingMethod : mixed

getCountStoreNotPrinted()

public getCountStoreNotPrinted(mixed $storeId) : int|mixed|string
Parameters
$storeId : mixed
Return values
int|mixed|string

getCustomerEmail()

Get billing email for sale

public getCustomerEmail() : mixed

getCustomerFullName()

Getting Customer first name

public getCustomerFullName(mixed $sale) : mixed
Parameters
$sale : mixed

getCustomerSales()

public getCustomerSales(mixed $customerEmail, mixed $customerFirstName, mixed $customerLastName) : mixed
Parameters
$customerEmail : mixed
$customerFirstName : mixed
$customerLastName : mixed

getEntityManager()

Getter of the Entity Manager

public getEntityManager() : EntityManager
Return values
EntityManager

getFormattedSaleTrackings()

public getFormattedSaleTrackings([Sale|null $sale = null ][, bool $onlyShipped = false ][, bool $withSpId = false ][, mixed $skipApiRequests = false ]) : array<string|int, mixed>
Parameters
$sale : Sale|null = null
$onlyShipped : bool = false
$withSpId : bool = false
$skipApiRequests : mixed = false
Return values
array<string|int, mixed>

getIncrementIdFromTrack()

public getIncrementIdFromTrack(mixed $string[, mixed $trackingLength = 13 ]) : mixed
Parameters
$string : mixed
$trackingLength : mixed = 13

getItemIdsFromTrack()

public getItemIdsFromTrack(mixed $string[, mixed $trackingLength = 13 ]) : mixed
Parameters
$string : mixed
$trackingLength : mixed = 13

getLastId()

public getLastId([mixed $source = 'Menzzo' ]) : mixed
Parameters
$source : mixed = 'Menzzo'

getLastMagentoId()

public getLastMagentoId() : mixed
Tags
@return

|null

getMarketplaceCreatedAt()

Get marketplace date

public getMarketplaceCreatedAt([null $sale = null ]) : DateTime
Parameters
$sale : null = null
Return values
DateTime

getOrderInfo()

Get sale info

public getOrderInfo([mixed $sale = null ]) : array<string|int, mixed>
Parameters
$sale : mixed = null
Return values
array<string|int, mixed>

getOrders()

Fetches orders from the Channable API based on the provided filters.

public getOrders(OutputInterface $output[, string|null $status = null ][, string|null $fromDate = null ]) : array<string|int, mixed>|null
Parameters
$output : OutputInterface

The output interface for displaying messages.

$status : string|null = null

Optional filter for the status of the orders.

$fromDate : string|null = null

Optional filter for the minimum creation date of the orders.

Tags
throws
Exception

If there is an error while fetching the orders.

Return values
array<string|int, mixed>|null

The list of orders retrieved from the API, or null if an error occurs.

getOrdersByRange()

public getOrdersByRange(mixed $start, mixed $end) : mixed
Parameters
$start : mixed
$end : mixed
Tags
throws
Exception

getPartnerName()

public getPartnerName(mixed $filename) : mixed
Parameters
$filename : mixed

getPaylinePaymentStats()

Get Payline Stats PayPal|CB|FCB3X|PRESTO

public getPaylinePaymentStats(mixed $start, mixed $end) : mixed
Parameters
$start : mixed
$end : mixed

getPaymentStat()

Getting payment stats

public getPaymentStat(mixed $start, mixed $end) : mixed
Parameters
$start : mixed
$end : mixed

getReservedChronopostSales()

Return sales in csv file

public getReservedChronopostSales(mixed $token) : string
Parameters
$token : mixed
Return values
string

getSaleByTrackingId()

public getSaleByTrackingId(mixed $string) : mixed
Parameters
$string : mixed

getSaleByUser()

public getSaleByUser(mixed $mail, mixed $name, mixed $date[, mixed $serchInInfo = false ]) : mixed
Parameters
$mail : mixed
$name : mixed
$date : mixed
$serchInInfo : mixed = false

getSaleIfItExists()

Vérifier si une vente existe déjà

public getSaleIfItExists(string $channableOrderId) : mixed
Parameters
$channableOrderId : string

getSaleInfo()

Get sale info

public getSaleInfo([mixed $sale = null ]) : array<string|int, mixed>
Parameters
$sale : mixed = null
Return values
array<string|int, mixed>

getSaleInvoice()

Get order invoice

public getSaleInvoice([mixed $sale = null ]) : bool
Parameters
$sale : mixed = null
Tags
@return
Return values
bool

getSalePaymentMethod()

Obtenir la méthode de paiement pour une vente

public getSalePaymentMethod() : string
Return values
string

getSaleRepository()

Get Sale Repository

public getSaleRepository() : mixed

use getRepo() instead

getSaleSavCountByStatus()

public getSaleSavCountByStatus(mixed $sale, mixed $saleSavIdToSkip) : mixed
Parameters
$sale : mixed
$saleSavIdToSkip : mixed

getSaleShippingAddress()

public getSaleShippingAddress(mixed $sale) : array<string|int, mixed>
Parameters
$sale : mixed
Return values
array<string|int, mixed>

getSalesNumberByDateAndSource()

public getSalesNumberByDateAndSource(mixed $source, mixed $date[, null $time = null ]) : mixed
Parameters
$source : mixed
$date : mixed
$time : null = null
Tags
throws
DBALException

getSaleSource()

Get Sale source

public getSaleSource([null $sale = null ]) : string
Parameters
$sale : null = null
Return values
string

getSaleTracking()

Get Sale tracking

public getSaleTracking([Sale $sale = null ]) : string
Parameters
$sale : Sale = null
Return values
string

getSaleTrackingCodes()

public getSaleTrackingCodes([Sale|null $sale = null ][, bool $onlyShipped = false ]) : array<string|int, mixed>
Parameters
$sale : Sale|null = null
$onlyShipped : bool = false
Return values
array<string|int, mixed>

getSaleTrackings()

public getSaleTrackings([Sale|null $sale = null ][, bool $onlyShipped = false ][, mixed $skipApiRequests = false ]) : array<string|int, mixed>
Parameters
$sale : Sale|null = null
$onlyShipped : bool = false
$skipApiRequests : mixed = false
Return values
array<string|int, mixed>

Get Sale track link

public getSaleTrackLink([Sale $sale = null ]) : string
Parameters
$sale : Sale = null
Return values
string

getSaleTrackLinkV2()

Get Sale track link

public getSaleTrackLinkV2([Sale $sale = null ]) : string
Parameters
$sale : Sale = null
Return values
string

getSellsyTransporter()

Get Sellsy transporter

public getSellsyTransporter() : mixed

getShipmentCreatedAt()

public getShipmentCreatedAt() : mixed

getShippingAmountForSellsy()

Get Shipping amount

public getShippingAmountForSellsy() : float
Return values
float

getShippingMethodFromV1()

Get Shipping method from v1 data v1 to v2

public getShippingMethodFromV1(mixed $method) : mixed
Parameters
$method : mixed

getShippingMethodFromV2Data()

Mapping V2 shipping data to v1 data

public getShippingMethodFromV2Data([mixed $method = null ][, bool $getAll = false ]) : mixed
Parameters
$method : mixed = null
$getAll : bool = false

getShippingTelephone()

Get Shipping telephone for sale

public getShippingTelephone() : mixed

getSource()

Get source identifier

public getSource() : string
Return values
string

getV1ChannableApiUrl()

Get the Channable API URL for version 1

public getV1ChannableApiUrl() : string
Return values
string

importSalesByCriteria()

public importSalesByCriteria(mixed $searchCriteria) : mixed
Parameters
$searchCriteria : mixed

isAllowedToCancelTuskOrder()

public isAllowedToCancelTuskOrder(mixed $sale) : false
Parameters
$sale : mixed
Return values
false

isOkToSendRetraitEmail()

public isOkToSendRetraitEmail(Sale $sale[, bool $checkSentEmail = false ]) : bool
Parameters
$sale : Sale
$checkSentEmail : bool = false
Tags
throws
Exception
Return values
bool

notifyCustomerForDelivery()

public notifyCustomerForDelivery(Sale $sale, mixed $message, mixed $action, mixed $user) : array<string|int, mixed>
Parameters
$sale : Sale
$message : mixed
$action : mixed
$user : mixed
Return values
array<string|int, mixed>

processOrders()

Processes an array of orders and creates sales entries while providing feedback through the output interface.

public processOrders(array<string|int, mixed> $ordersData, OutputInterface $output) : array<string|int, mixed>
Parameters
$ordersData : array<string|int, mixed>

The data containing orders to process, including order details and associated data.

$output : OutputInterface

The interface for outputting messages and feedback during the processing.

Return values
array<string|int, mixed>

An array of processed orders, with each entry corresponding to a successfully handled order.

processSaleForFrontApp()

Process a sale transaction.

public processSaleForFrontApp(Sale $sale) : void

This method handles the processing of a sale transaction based on the provided Sale entity.

Parameters
$sale : Sale

The sale entity to be processed

Tags
throws
Exception

If the sale processing fails

reactiveSaleProduct()

Reactive sale or sale product

public reactiveSaleProduct(mixed $saleProductId[, mixed $forcedWhileRemboursement = false ][, mixed $user = null ]) : string
Parameters
$saleProductId : mixed
$forcedWhileRemboursement : mixed = false
$user : mixed = null
Tags
throws
OptimisticLockException
throws
Exception
Return values
string
public regenerateSaleTrackLinks([Sale|null $sale = null ]) : void
Parameters
$sale : Sale|null = null

salesByDate()

public salesByDate(mixed $date) : mixed
Parameters
$date : mixed

saveFromApi()

Save a Sale

public saveFromApi(mixed $datas) : Sale|bool

by Amine and will be removed in next version

Parameters
$datas : mixed
Tags
throws
Exception
Return values
Sale|bool

search a Sales

public search(mixed $data[, int $page = 0 ][, null $max = null ][, bool $getResult = true ]) : mixed
Parameters
$data : mixed
$page : int = 0
$max : null = null
$getResult : bool = true
Tags
@return

searchFull()

public searchFull([array<string|int, mixed> $params = [] ]) : array<string|int, mixed>
Parameters
$params : array<string|int, mixed> = []
Return values
array<string|int, mixed>

searchIdfPlanning()

Search idf planning

public searchIdfPlanning(mixed $data[, int $page = 0 ][, null $max = null ][, bool $getResult = true ]) : mixed
Parameters
$data : mixed
$page : int = 0
$max : null = null
$getResult : bool = true
Tags
@return

searchIdfPlanningPdf()

search a Sales

public searchIdfPlanningPdf(mixed $data[, mixed $getResult = true ]) : array<string|int, mixed>|Query|int|string
Parameters
$data : mixed
$getResult : mixed = true
Return values
array<string|int, mixed>|Query|int|string

searchIdfTransporter()

Search idf transporter

public searchIdfTransporter(mixed $data[, mixed $page = 0 ][, mixed $max = null ][, mixed $getResult = true ]) : mixed
Parameters
$data : mixed
$page : mixed = 0
$max : mixed = null
$getResult : mixed = true
Tags
@return

searchOrdersUpdated()

public searchOrdersUpdated(mixed $data[, mixed $page = 0 ][, mixed $max = null ][, mixed $getResult = true ]) : mixed
Parameters
$data : mixed
$page : mixed = 0
$max : mixed = null
$getResult : mixed = true

searchProcessingInStockNotPrinted()

Search processing in stock not printed sales

public searchProcessingInStockNotPrinted(mixed $data[, mixed $page = 0 ][, mixed $max = null ][, mixed $getResult = true ]) : mixed
Parameters
$data : mixed
$page : mixed = 0
$max : mixed = null
$getResult : mixed = true
Tags
@return

searchProcessingNotPrinted()

Search processing not printed

public searchProcessingNotPrinted(mixed $data[, int $page = 0 ][, null $max = null ][, bool $getResult = true ]) : mixed
Parameters
$data : mixed
$page : int = 0
$max : null = null
$getResult : bool = true
Tags
@return

searchProcessingNotPrintedNoStock()

Search processing not printed

public searchProcessingNotPrintedNoStock(mixed $data[, int $page = 0 ][, null $max = null ][, bool $getResult = true ]) : mixed
Parameters
$data : mixed
$page : int = 0
$max : null = null
$getResult : bool = true
Tags
@return

searchProcessingOldRetrait()

public searchProcessingOldRetrait(mixed $data[, mixed $page = 0 ][, mixed $max = null ][, mixed $getResult = true ]) : mixed
Parameters
$data : mixed
$page : mixed = 0
$max : mixed = null
$getResult : mixed = true

searchProcessingRetraitNew()

Search processing retrait new

public searchProcessingRetraitNew(mixed $data[, mixed $page = 0 ][, mixed $max = null ][, mixed $getResult = true ]) : mixed
Parameters
$data : mixed
$page : mixed = 0
$max : mixed = null
$getResult : mixed = true
Tags
@return

searchProcessingRetraitNotPrinted()

Search processing retrait not printed sales

public searchProcessingRetraitNotPrinted(mixed $data[, int $page = 0 ][, null $max = null ][, bool $getResult = true ]) : mixed
Parameters
$data : mixed
$page : int = 0
$max : null = null
$getResult : bool = true
Tags
@return

searchRecapCommandesMarketplaces()

Search processing not printed

public searchRecapCommandesMarketplaces(mixed $data[, int $page = 0 ][, null $max = null ][, bool $getResult = true ]) : mixed
Parameters
$data : mixed
$page : int = 0
$max : null = null
$getResult : bool = true
Tags
@return

searchSaleDropInvoiced()

search a Sales

public searchSaleDropInvoiced(mixed $data[, mixed $page = 0 ][, mixed $max = null ][, mixed $getResult = true ]) : mixed
Parameters
$data : mixed
$page : mixed = 0
$max : mixed = null
$getResult : mixed = true
Tags
@return

searchSaleDropPending()

public searchSaleDropPending(mixed $data[, mixed $page = 0 ][, mixed $max = null ][, mixed $getResult = true ]) : mixed
Parameters
$data : mixed
$page : mixed = 0
$max : mixed = null
$getResult : mixed = true

searchSaleSendExpedition()

Search sent expedition sales

public searchSaleSendExpedition(mixed $data[, int $page = 0 ][, null $max = null ][, bool $getResult = true ]) : mixed
Parameters
$data : mixed
$page : int = 0
$max : null = null
$getResult : bool = true
Tags
@return

searchSalesForPrintInvoices()

Search for sales to print

public searchSalesForPrintInvoices([array<string|int, mixed> $filters = [] ]) : array<string|int, mixed>|int|string

you should not use this function

Parameters
$filters : array<string|int, mixed> = []
Return values
array<string|int, mixed>|int|string

searchShippedChronopost()

Get SaleProduct

public searchShippedChronopost(mixed $data[, mixed $page = 0 ][, mixed $max = null ][, mixed $getResult = true ]) : mixed
Parameters
$data : mixed
$page : mixed = 0
$max : mixed = null
$getResult : mixed = true
Tags
@return

searchUpStairsPlanning()

Get UpStairs planing

public searchUpStairsPlanning(mixed $data[, mixed $page = 0 ][, mixed $max = null ][, mixed $getResult = true ]) : mixed
Parameters
$data : mixed
$page : mixed = 0
$max : mixed = null
$getResult : mixed = true

searchUpStairsTransporter()

Search a Sales

public searchUpStairsTransporter(mixed $data[, int $page = 0 ][, null $max = null ][, bool $getResult = true ]) : mixed
Parameters
$data : mixed
$page : int = 0
$max : null = null
$getResult : bool = true

sendRetraitEmail()

public sendRetraitEmail(Sale $finalSale[, null $userId = null ]) : bool|void
Parameters
$finalSale : Sale
$userId : null = null
Return values
bool|void

sendSmsCodeCoupon()

public sendSmsCodeCoupon(mixed $sale, mixed $ruleId, mixed $message[, null $userId = null ]) : string
Parameters
$sale : mixed
$ruleId : mixed
$message : mixed
$userId : null = null
Return values
string

sendSparePartToChronopost()

Sends a spare part shipment request to Chronopost

public sendSparePartToChronopost(mixed $order, mixed $saleProduct, mixed $partNumber, mixed $qty, mixed $dimensions) : array<string|int, mixed>
Parameters
$order : mixed
$saleProduct : mixed
$partNumber : mixed
$qty : mixed
$dimensions : mixed
Return values
array<string|int, mixed>

sendToChronopost()

Send sale to chronopost

public sendToChronopost(mixed $orderId, mixed $orderItemIds[, null $userId = null ]) : array<string|int, mixed>
Parameters
$orderId : mixed
$orderItemIds : mixed

//array of SaleProductIds

$userId : null = null
Return values
array<string|int, mixed>

sendToTrusk()

public sendToTrusk(Sale $sale) : mixed

USE TruskService

Parameters
$sale : Sale

setChannableAccessToken()

Set the Channable access token

public setChannableAccessToken(string|null $accessToken) : void
Parameters
$accessToken : string|null

setChannableApiUrl()

Set the Channable API URL.

public setChannableApiUrl(string|null $apiUrl) : void
Parameters
$apiUrl : string|null

setChannableCompanyId()

Définir le compte Channable

public setChannableCompanyId(int $companyId) : mixed
Parameters
$companyId : int

setChannableProjectId()

Définir le projet Channable

public setChannableProjectId(int $projectId) : mixed
Parameters
$projectId : int

setEntityManager()

Définit l'entity manager pour la classe parente

public setEntityManager(mixed $em) : void
Parameters
$em : mixed

Entity Manager

setIsIdf()

Set Product as idf

public setIsIdf(mixed $saleProduct) : mixed
Parameters
$saleProduct : mixed
Tags
@return
throws
Exception

setIsUpStairs()

Set is UpStairs

public setIsUpStairs(mixed $saleProduct) : mixed
Parameters
$saleProduct : mixed
Tags
throws
Exception

setLastMagentoId()

public setLastMagentoId(int $lastSaleId) : int
Parameters
$lastSaleId : int
Tags
throws
OptimisticLockException
Return values
int

setRealShippingMethod()

Set real shipping method by method and postalCode

public setRealShippingMethod(Sale &$sale, mixed $shipping[, mixed $shippingMethod = '' ]) : string
Parameters
$sale : Sale
$shipping : mixed
$shippingMethod : mixed = ''
Return values
string

setSaleEntity()

Setting sale entity

public setSaleEntity(Sale $entity) : mixed
Parameters
$entity : Sale

setSaleProductAsShippedChronopost()

Setting sale product as shipped

public setSaleProductAsShippedChronopost(mixed $sale, mixed $saleProduct, mixed $user[, mixed $notify = true ]) : mixed
Parameters
$sale : mixed
$saleProduct : mixed
$user : mixed
$notify : mixed = true
Tags
throws
Exception

setSaleProductAsShippedGeodis()

Setting sale product as shipped

public setSaleProductAsShippedGeodis(Sale $sale, SaleProduct $saleProduct, User $user[, bool $notify = true ]) : mixed

check setSaleProductsAsShipped

Parameters
$sale : Sale
$saleProduct : SaleProduct
$user : User
$notify : bool = true
Tags
throws
GuzzleException
see
setSaleProductsAsShipped

setSaleProductsAsShipped()

Setting sale product as shipped

public setSaleProductsAsShipped(Sale $sale, SaleProduct $saleProduct, User $user, mixed $carrier[, bool $notify = true ]) : mixed
Parameters
$sale : Sale
$saleProduct : SaleProduct
$user : User
$carrier : mixed
$notify : bool = true
Tags
throws
GuzzleException

setV1ChannableApiUrl()

Set the Channable V1 API URL.

public setV1ChannableApiUrl(string|null $v1ApiUrl) : void
Parameters
$v1ApiUrl : string|null

The URL for the Channable V1 API.

showInvoiceInformationsEditButton()

Show invoice edit button

public showInvoiceInformationsEditButton() : bool
Return values
bool

showPreRefundBlock()

Show pre refund block in sale show

public showPreRefundBlock() : mixed

showSaleProductsEditButton()

public showSaleProductsEditButton(mixed $saleProduct) : mixed
Parameters
$saleProduct : mixed

showSaleProductsSelect()

public showSaleProductsSelect(mixed $saleProduct) : mixed
Parameters
$saleProduct : mixed

showSaleStatusEditButton()

Show sale status edit button

public showSaleStatusEditButton() : bool
Return values
bool

showShippingAddressFullname()

public showShippingAddressFullname() : mixed

showShippingInformationEditButton()

Show invoice edit button

public showShippingInformationEditButton() : bool
Return values
bool

showShippingMethodEditButton()

Show shipping method edit button in sale view

public showShippingMethodEditButton() : bool
Return values
bool

sumShipping()

Sum shipping

public sumShipping(mixed $from, mixed $to) : mixed
Parameters
$from : mixed
$to : mixed

switchToComplete()

Switch sale to complete state

public switchToComplete(Sale $sale[, string $comment = '' ][, null $userId = null ][, bool $logChanges = false ]) : string
Parameters
$sale : Sale
$comment : string = ''
$userId : null = null
$logChanges : bool = false
Tags
todo

change function return type from string to boolean

Return values
string

switchToProcessing()

Switch sale to processing

public switchToProcessing(mixed $sale[, string $comment = '' ][, bool $logChanges = false ][, bool $cancelPreRefund = true ][, null $saleProduct = null ]) : string
Parameters
$sale : mixed
$comment : string = ''
$logChanges : bool = false
$cancelPreRefund : bool = true
$saleProduct : null = null
Return values
string

trackingId()

Generating tracking id

public trackingId([int $length = 15 ]) : string
Parameters
$length : int = 15
Tags
todo

refactor this function

Return values
string

trackingIdByS()

Check is old tracking

public trackingIdByS(mixed $string) : bool
Parameters
$string : mixed
Return values
bool

updateContactOnFrontApp()

public updateContactOnFrontApp(Sale $sale) : mixed
Parameters
$sale : Sale

updateInternalStockAndWriteAsirLog()

public updateInternalStockAndWriteAsirLog(SaleProduct $saleProduct, User $user[, mixed $operation = '+' ]) : void
Parameters
$saleProduct : SaleProduct
$user : User
$operation : mixed = '+'

updateOrderShipmentStatusInChannable()

Updates the shipment status of an order in Channable.

public updateOrderShipmentStatusInChannable(array<string|int, mixed> $shipmentData, string $incrementId) : array<string|int, mixed>|null
Parameters
$shipmentData : array<string|int, mixed>

The shipment data to be sent to Channable.

$incrementId : string

The unique increment ID of the order in Channable.

Tags
throws
Exception

If an error occurs during the update process.

Return values
array<string|int, mixed>|null

The response from Channable as an associative array, or null if the operation fails.

updateSaleAddress()

Update sale address from sale sheet

public updateSaleAddress(Sale $sale, mixed $datas, mixed $type[, mixed $userId = null ]) : string
Parameters
$sale : Sale
$datas : mixed
$type : mixed
$userId : mixed = null
Tags
throws
Exception
Return values
string

updateSaleProductAvailabilityDate()

07-12-2021 : Add type (DDISP) for Salelog by Habib ben aissa

public updateSaleProductAvailabilityDate(mixed $saleProduct, mixed $date[, mixed $user = null ]) : mixed
Parameters
$saleProduct : mixed
$date : mixed
$user : mixed = null
Tags
throws
ORMException
throws
OptimisticLockException

_evaluateWeightItemFromProduct()

protected _evaluateWeightItemFromProduct(mixed $item, mixed $itemProduct) : float|int
Parameters
$item : mixed
$itemProduct : mixed
Tags
deprectaed

this function will be remove din next versions

Return values
float|int

_evaluateWeightItemLineFromProduct()

protected _evaluateWeightItemLineFromProduct(mixed $item, mixed $itemProduct) : mixed
Parameters
$item : mixed
$itemProduct : mixed

cancelMagentoSale()

Sending request to magento to cancel a sale

protected cancelMagentoSale(mixed $sale) : mixed
Parameters
$sale : mixed

cancelSale()

Canceling a sale

protected cancelSale(Sale $sale, mixed $idSp, mixed $user[, bool $forcedWhileExpeditionIsInProgress = false ][, bool $createSaleSavAndPreRefund = true ]) : string
Parameters
$sale : Sale
$idSp : mixed
$user : mixed
$forcedWhileExpeditionIsInProgress : bool = false
$createSaleSavAndPreRefund : bool = true
Return values
string

cancelSaleProduct()

Canceling sale product

protected cancelSaleProduct(Sale $sale, mixed $idSp, mixed $user[, bool $forcedWhileExpeditionIsInProgress = false ]) : string
Parameters
$sale : Sale
$idSp : mixed
$user : mixed
$forcedWhileExpeditionIsInProgress : bool = false
Tags
throws
OptimisticLockException
throws
Exception
Return values
string

createNewSale()

Creating new order

protected createNewSale(mixed $data) : Sale
Parameters
$data : mixed
Tags
throws
Exception
Return values
Sale

createSaleFromChannableOrder()

Creates a sale record from a given Channable order.

protected createSaleFromChannableOrder(array<string|int, mixed> $orderItems, array<string|int, mixed> $orderData) : array<string|int, mixed>
Parameters
$orderItems : array<string|int, mixed>

A list of order items included in the Channable order.

$orderData : array<string|int, mixed>

The data of the Channable order, including pricing, customer, delivery, and extra information.

Return values
array<string|int, mixed>

An array representing the mapped sale record, including order details, addresses, payment info, items, and extra information.

createSaleShipment()

Creating sale shipment

protected createSaleShipment(mixed $sale, mixed $itemsQty, mixed $trackings, mixed $carrier) : mixed
Parameters
$sale : mixed
$itemsQty : mixed
$trackings : mixed
$carrier : mixed
Tags
throws
Exception

getChronopostTrackingNumberForSpareParts()

Save Chronopost shipping infos

protected getChronopostTrackingNumberForSpareParts(mixed $chronopostApiResponse) : mixed
Parameters
$chronopostApiResponse : mixed

getCustomerAvailabilityDate()

protected getCustomerAvailabilityDate(mixed $sale, mixed $item, mixed $product) : false|string
Parameters
$sale : mixed
$item : mixed
$product : mixed
Return values
false|string

getCustomerAvailabilityForSaleProduct()

Getting product options

protected getCustomerAvailabilityForSaleProduct(mixed $item, mixed $product) : string
Parameters
$item : mixed
$product : mixed
Return values
string

getCustomerFirstNameForSale()

Getting customer First name for sale creation

protected getCustomerFirstNameForSale(mixed $data) : mixed
Parameters
$data : mixed
Tags
@return

getCustomerIdForSale()

Getting customer id for sale creation

protected getCustomerIdForSale(mixed $data) : mixed
Parameters
$data : mixed
Tags
@return

getCustomerLastNameForSale()

Getting customer last Name for sale creation

protected getCustomerLastNameForSale(mixed $data) : mixed
Parameters
$data : mixed
Tags
@return

getOrderItemReference()

protected getOrderItemReference(mixed $sale, mixed $countItems, mixed $k) : string
Parameters
$sale : mixed
$countItems : mixed
$k : mixed
Return values
string

getProductOptionsForSale()

Getting product options

protected getProductOptionsForSale(mixed $item) : mixed
Parameters
$item : mixed
Tags
@return

getShippingMethodForSale()

Getting Shipping for sale creation

protected getShippingMethodForSale(mixed $data) : mixed
Parameters
$data : mixed
Tags
@return

mapChannableStatusToInternal()

Mapper le statut Channable vers le statut interne

protected mapChannableStatusToInternal(string $paidStatus, string $shippedStatus) : string
Parameters
$paidStatus : string
$shippedStatus : string
Return values
string

saveChronopostShippingInfo()

Save Chronopost shipping infos

protected saveChronopostShippingInfo(mixed $sale, SaleProduct $saleProduct, mixed $expedition, mixed &$trackingNumbers, mixed $internalTrackingCode[, null $userId = null ]) : mixed
Parameters
$sale : mixed
$saleProduct : SaleProduct
$expedition : mixed
$trackingNumbers : mixed
$internalTrackingCode : mixed
$userId : null = null

setIsInvoicedSellsy()

Getting is invoiced Sellsy sale creation

protected setIsInvoicedSellsy(mixed $data) : mixed
Parameters
$data : mixed
Tags
@return

updateOrderItem()

Update order item

protected updateOrderItem(array<string|int, mixed>|mixed $item, SaleProduct $saleProduct) : SaleProduct
Parameters
$item : array<string|int, mixed>|mixed
$saleProduct : SaleProduct
Tags
throws
OptimisticLockException
throws
ORMException
Return values
SaleProduct

addSingleHandleToContact()

private addSingleHandleToContact(mixed $contactId, mixed $handleValue, mixed $source) : mixed
Parameters
$contactId : mixed
$handleValue : mixed
$source : mixed

createContactInFrontApp()

Creates a contact in the FrontApp system.

private createContactInFrontApp(string $email) : void
Parameters
$email : string

The email address of the contact.

exportCsv()

Exporting as csv

private exportCsv(mixed $data, mixed $columns, mixed $title, mixed $isAsirRecap) : mixed
Parameters
$data : mixed
$columns : mixed
$title : mixed
$isAsirRecap : mixed

exportXls()

Exporting as Xls

private exportXls(mixed $data, mixed $columns, mixed $title) : mixed
Parameters
$data : mixed
$columns : mixed
$title : mixed
Tags
throws
PHPExcel_Exception

getFrontAppContactByContactId()

Retrieves the front app contact details by contact ID.

private getFrontAppContactByContactId(int $contactId) : array<string|int, mixed>|null
Parameters
$contactId : int

The ID of the contact to retrieve.

Return values
array<string|int, mixed>|null

The contact details if found, or null if not found.

getProductInfoIfItExists()

Retrieves the product information for a given product SKU if it exists.

private getProductInfoIfItExists(string $productSku) : mixed|null
Parameters
$productSku : string

The SKU of the product for which to retrieve information.

Return values
mixed|null

The product information if available, otherwise null.

getShippingInfoFromV2Data()

Get Shipping method for v2 data

private getShippingInfoFromV2Data(mixed $orderData) : array<string|int, mixed>
Parameters
$orderData : mixed
Return values
array<string|int, mixed>

processOrderProducts()

Process the products in an order and prepare the structured order items array

private processOrderProducts(array<string|int, mixed> $products) : array<string|int, mixed>
Parameters
$products : array<string|int, mixed>

The list of products in the order, each containing details like quantity, ID, reference code, price, etc.

Return values
array<string|int, mixed>

Returns an array of processed order items, each containing details like item ID, product ID, price, tax amount, quantity, and other related data.

processShipment()

Processes the shipment for the provided sale and sale product, updating the shipment status in an external system if all necessary data is present.

private processShipment(mixed $sale, mixed $saleProduct) : void
Parameters
$sale : mixed

The sale object used to gather order information and validation.

$saleProduct : mixed

The sale product object or list that contains details necessary for shipment processing.

retriveOrderItemsIds()

Retrieves the unique item IDs from the provided sale order items.

private retriveOrderItemsIds(array<string|int, mixed> $saleOrderItems[, mixed $saleProductItemIdsIds = [] ]) : array<string|int, mixed>
Parameters
$saleOrderItems : array<string|int, mixed>

The array of sale order items containing item data.

$saleProductItemIdsIds : mixed = []
Return values
array<string|int, mixed>

An array of unique item IDs.

retriveOrderTrackingId()

Retrieves the tracking ID for the given sale product.

private retriveOrderTrackingId(mixed $saleProduct) : string|null
Parameters
$saleProduct : mixed

The sale product for which to retrieve the tracking ID.

Return values
string|null

The tracking ID if available, otherwise null.

synchronizeSaleCancelInChannable()

Synchronizes the cancellation of a sale order in Channable.

private synchronizeSaleCancelInChannable(mixed $sale) : void
Parameters
$sale : mixed

The sale object containing the order details to be cancelled.

updateCustomFields()

private updateCustomFields(mixed $contactId, mixed $ordersFormatted) : mixed
Parameters
$contactId : mixed
$ordersFormatted : mixed

validateChannableConfiguration()

Validates the configuration required for connecting to the Channable API.

private validateChannableConfiguration() : void

Ensures that all necessary Channable configuration values, such as API URLs, access token, company ID, and project ID, are properly defined. Throws an exception if any required value is missing.

Tags
throws
Exception

If any required Channable configuration value is missing.


        
On this page

Search results