feat : améliorations page inventory et filtre date masqué
- Colonnes Bâtiment et Case ajoutées sur inventory (inline buildingCase via readableLink) - Bouton Rafraîchir repositionné dans l'en-tête du tableau (pattern case.vue) - Sync : date du jour pour l'appel EDNOTIF, extraction de la dernière exit date - UiDateMaskedInput : nouveau composant date masqué JJ/MM/AAAA - Propagation du masque date sur tous les datatables (reception, shipment, case, inventory) - Label de colonne "Date et heure" raccourci en "Date" - Champ exitDate ajouté en back (caché côté front, prêt pour future feature) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -29,7 +29,7 @@ final class BovineSyncInventoryProcessor implements ProcessorInterface
|
||||
array $uriVariables = [],
|
||||
array $context = [],
|
||||
): BovineSyncInventoryResult {
|
||||
$inventory = $this->bovinApi->getInventory(new DateTimeImmutable('2000-01-01'));
|
||||
$inventory = $this->bovinApi->getInventory(new DateTimeImmutable('today'));
|
||||
|
||||
$result = new BovineSyncInventoryResult();
|
||||
$result->total = count($inventory->animals);
|
||||
@@ -88,12 +88,17 @@ final class BovineSyncInventoryProcessor implements ProcessorInterface
|
||||
$bovine->setBirthDate($identification->birthDate?->date);
|
||||
}
|
||||
|
||||
$latestEntry = null;
|
||||
$latestExit = null;
|
||||
foreach ($animal->presencePeriods as $period) {
|
||||
if (null === $period->exit && null !== $period->entry?->date) {
|
||||
$bovine->setArrivalDate($period->entry->date);
|
||||
|
||||
break;
|
||||
if (null !== $period->entry?->date && (null === $latestEntry || $period->entry->date > $latestEntry)) {
|
||||
$latestEntry = $period->entry->date;
|
||||
}
|
||||
if (null !== $period->exit?->date && (null === $latestExit || $period->exit->date > $latestExit)) {
|
||||
$latestExit = $period->exit->date;
|
||||
}
|
||||
}
|
||||
$bovine->setArrivalDate($latestEntry);
|
||||
$bovine->setExitDate($latestExit);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user