BuilderWorker
extends AbstractWorker
in package
implements
BuilderWorkerInterface
uses
StrategiesAwareTrait
Worker "billing.book.builder".
Construye el XML y la entidad resultante de cualquier tipo de libro
tributario a partir del bag con detalles normalizados por el LoaderWorker.
Selecciona la estrategia usando BookBagInterface::getTipo() directamente:
libro_ventaslibro_compraslibro_boletaslibro_guiasresumen_ventas_diarias
Attributes
- #[Worker]
- $name: 'builder'
- $component: 'book'
- $package: 'billing'
Table of Contents
Interfaces
- BuilderWorkerInterface
- Interfaz para el worker `billing.book.builder`.
Properties
- $signatureService : SignatureServiceInterface
Methods
- __construct() : mixed
- build() : BookInterface
- Construye la entidad libro a partir de la bolsa normalizada.
Properties
$signatureService
private
SignatureServiceInterface
$signatureService
Methods
__construct()
public
__construct(SignatureServiceInterface $signatureService[, iterable<string|int, mixed> $strategies = [] ]) : mixed
Parameters
- $signatureService : SignatureServiceInterface
- $strategies : iterable<string|int, mixed> = []
build()
Construye la entidad libro a partir de la bolsa normalizada.
public
build(BookBagInterface $bag) : BookInterface
Parameters
- $bag : BookBagInterface
-
Bolsa con detalles ya normalizados.
Attributes
- #[Operation]
- $parameters: ['bag' => ['example' => ['tipo' => TipoLibro::VENTAS, 'caratula' => ['RutEmisorLibro' => '76192083-9', 'PeriodoTributario' => '2024-01'], 'detalle' => [['TpoDoc' => 33, 'NroDoc' => 1, 'TasaImp' => 19, 'FchDoc' => '2024-01-10', 'RUTDoc' => '12345678-9', 'RznSoc' => 'Empresa Compradora SpA', 'MntNeto' => 100000, 'MntIVA' => 19000, 'MntTotal' => 119000]], 'certificate' => ['certificate' => '', 'privateKey' => ''], 'emisor' => ['rut' => '76192083-9', 'razon_social' => 'SASCO SpA']]]]
Return values
BookInterface —Entidad libro resultante con su XML.