GenerateReferenceSaleController
extends AbstractController
in package
Provides a unique invoice reference, consistent between web and mobile.
Table of Contents
Properties
- $entityManager : EntityManagerInterface
Methods
- __construct() : mixed
- generateInvoiceReference() : JsonResponse
- Generates a sale reference in the "VNT-YYYY-NNNN" format.
Properties
$entityManager
private
EntityManagerInterface
$entityManager
Methods
__construct()
public
__construct(EntityManagerInterface $entityManager) : mixed
Parameters
- $entityManager : EntityManagerInterface
-
Doctrine entity manager.
generateInvoiceReference()
Generates a sale reference in the "VNT-YYYY-NNNN" format.
public
generateInvoiceReference() : JsonResponse
The counter is based on the number of sales already recorded for the current year, incremented by one, to produce a readable and unique identifier.
Tags
Attributes
- #[Route]
- '/api/get-reference-sale'
- $name: 'sale.get.ref'
Return values
JsonResponse —JSON object containing the "reference" key.