BConnect POS - Reference PHP

FundController extends AbstractController
in package

Management of the cash fund / treasury per point of sale.

Allows viewing movements (inflows/outflows), recording a fund outflow (with a supporting document and, where applicable, settlement of a purchase order), updating a movement, viewing its detail and feeding the DataTables lists.

Attributes
#[IsGranted]
'IS_AUTHENTICATED_FULLY'
#[Route]
'/fund'

Table of Contents

Methods

datatable()  : JsonResponse
Provides paginated/filtered fund-movement data in the DataTables server-side format.
index()  : Response
Index action to display the list of funds, handle form submission and handle data processing.
ouputFund()  : Response
Records a fund outflow.
showRetailFund()  : Response
updateFund()  : Response
Show action to display the details of a fund, its associated history funds, and purchase orders.

Methods

datatable()

Provides paginated/filtered fund-movement data in the DataTables server-side format.

public datatable(EntityManagerInterface $entityManager, Request $request, DataTableService $dataTableService) : JsonResponse
Parameters
$entityManager : EntityManagerInterface

Doctrine entity manager.

$request : Request

Request carrying the DataTables parameters.

$dataTableService : DataTableService

Service building the DataTables response.

Attributes
#[Route]
'/datatable'
$name: 'fund.datatable'
$methods: ['GET']
Return values
JsonResponse

DataTables-compatible JSON response.

index()

Index action to display the list of funds, handle form submission and handle data processing.

public index(EntityManagerInterface $entityManager, Request $request, MailerService $mailer, ConfigAppRepository $repository, UploaderService $uploaderService) : Response
Parameters
$entityManager : EntityManagerInterface
$request : Request
$mailer : MailerService
$repository : ConfigAppRepository
$uploaderService : UploaderService
Tags
Route

('/fund', name: 'fund.index')

throws
TransportExceptionInterface
Attributes
#[Route]
'/'
$name: 'fund.index'
Return values
Response

ouputFund()

Records a fund outflow.

public ouputFund(EntityManagerInterface $entityManager, Request $request, MailerService $mailer, ConfigAppRepository $repository, UploaderService $uploaderService) : Response

Handles the outflow form: amount, reason and supporting document. When the reason is "Demande d'achat", settles the related purchase order (moving it to the PAID status) and logs the operation. An email notification may be sent.

Parameters
$entityManager : EntityManagerInterface

Doctrine entity manager.

$request : Request

HTTP request (form submission).

$mailer : MailerService

Email notification service.

$repository : ConfigAppRepository

Point-of-sale configuration (recipients).

$uploaderService : UploaderService

Upload service for the supporting document.

Attributes
#[Route]
'/output'
$name: 'fund.output'
Return values
Response

The form view or a redirect after saving.

updateFund()

Show action to display the details of a fund, its associated history funds, and purchase orders.

public updateFund(Fund $fund, EntityManagerInterface $entityManager, Request $request, UploaderService $uploaderService) : Response
Parameters
$fund : Fund
$entityManager : EntityManagerInterface
$request : Request
$uploaderService : UploaderService
Attributes
#[Route]
'/update/fund/{id}'
$name: 'fund.update'
Return values
Response
On this page

Search results