feat: add fecEntregaBienes property and XML template support#270
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds support for an optional “fecha de entrega de bienes al transportista” on despatch shipments and emits it in the generated Despatch 2022 XML.
Changes:
- Introduces
fecEntregaBienesin theShipmentmodel with getter/setter. - Emits a
<cac:LoadingTransportEvent>with<cbc:OccurrenceDate>whenenvio.fecEntregaBienesis present.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| packages/xml/src/Xml/Templates/despatch2022.xml.twig | Conditionally outputs LoadingTransportEvent/OccurrenceDate from envio.fecEntregaBienes. |
| packages/core/src/Core/Model/Despatch/Shipment.php | Adds fecEntregaBienes property plus accessor methods to carry the new date field. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| /** | ||
| * Fecha de entrega de bienes al transportista. | ||
| * | ||
| * @var DateTime | ||
| */ | ||
| private $fecEntregaBienes; |
| /** | ||
| * @return DateTime | ||
| */ | ||
| public function getFecEntregaBienes(): ?DateTime |
| /** | ||
| * @param DateTime $fecEntregaBienes | ||
| * | ||
| * @return Shipment | ||
| */ | ||
| public function setFecEntregaBienes(?DateTime $fecEntregaBienes): Shipment |
| {% if envio.fecEntregaBienes %} | ||
| <cac:LoadingTransportEvent> | ||
| <cbc:OccurrenceDate>{{ envio.fecEntregaBienes|date('Y-m-d') }}</cbc:OccurrenceDate> | ||
| </cac:LoadingTransportEvent> | ||
| {% endif %} |
|
|
La ultima version de twig exige cambio de PHP minimo a 8.1, por ahora se podria fijar la dependencia a |



This pull request adds support for handling the delivery date of goods to the carrier in the shipment despatch process. The main changes include introducing a new property to the
Shipmentmodel, providing getter and setter methods for it, and updating the XML template to include this date if present.Shipment model enhancements:
fecEntregaBienesto theShipmentclass to store the delivery date of goods to the carrier.fecEntregaBienesproperty in theShipmentclass.XML template update:
despatch2022.xml.twigto include a<cac:LoadingTransportEvent>section with thefecEntregaBienesdate if it is available.