BConnect POS - Reference PHP

SaleEditService
in package

Table of Contents

Properties

$entityManager  : EntityManagerInterface

Methods

__construct()  : mixed
canEdit()  : bool
updateSale()  : void
applyExistingDiscount()  : float
applyStockChanges()  : void
buildSubmittedItems()  : array<string|int, mixed>
calculateGrossTotal()  : float
normalizePaymentMethod()  : string
recordFundAdjustment()  : void
recordProductHistory()  : void
recordSaleEditHistory()  : void
replacePayments()  : void
replaceSaleItems()  : void

Properties

$entityManager read-only

private EntityManagerInterface $entityManager

Methods

__construct()

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

updateSale()

public updateSale(Sale $sale, User $user, array<string|int, mixed> $payload) : void
Parameters
$sale : Sale
$user : User
$payload : array<string|int, mixed>

applyExistingDiscount()

private applyExistingDiscount(Sale $sale, float $grossTotal) : float
Parameters
$sale : Sale
$grossTotal : float
Return values
float

applyStockChanges()

private applyStockChanges(Sale $sale, array<string|int, mixed> $submittedItems, User $user) : void
Parameters
$sale : Sale
$submittedItems : array<string|int, mixed>
$user : User

buildSubmittedItems()

private buildSubmittedItems(Sale $sale, array<string|int, mixed> $payload, User $user) : array<string|int, mixed>
Parameters
$sale : Sale
$payload : array<string|int, mixed>
$user : User
Return values
array<string|int, mixed>

calculateGrossTotal()

private calculateGrossTotal(Sale $sale) : float
Parameters
$sale : Sale
Return values
float

normalizePaymentMethod()

private normalizePaymentMethod(string $paymentMethod) : string
Parameters
$paymentMethod : string
Return values
string

recordFundAdjustment()

private recordFundAdjustment(Sale $sale, User $user, float $oldCollectedAmount, float $newCollectedAmount) : void
Parameters
$sale : Sale
$user : User
$oldCollectedAmount : float
$newCollectedAmount : float

recordProductHistory()

private recordProductHistory(Product $product, User $user, int $oldQuantity, int $newQuantity, Sale $sale) : void
Parameters
$product : Product
$user : User
$oldQuantity : int
$newQuantity : int
$sale : Sale

replacePayments()

private replacePayments(Sale $sale, array<string|int, mixed> $payload, float $finalTotal) : void
Parameters
$sale : Sale
$payload : array<string|int, mixed>
$finalTotal : float

replaceSaleItems()

private replaceSaleItems(Sale $sale, array<string|int, mixed> $submittedItems) : void
Parameters
$sale : Sale
$submittedItems : array<string|int, mixed>
On this page

Search results