mapping cat

This commit is contained in:
2026-03-23 17:39:56 +01:00
parent 7501339b39
commit 71ce5ce008
+8
View File
@@ -51,12 +51,20 @@ $totalRevenus = 0;
foreach ($allExpenses as $exp) {
$match = false;
// 1. Lien direct via l'ID de la charge
if (!empty($exp['budget_item_id']) && (int)$exp['budget_item_id'] === (int)$item['id']) {
$match = true;
}
// 2. Lien forcé pour l'École
elseif ($exp['category'] === 'School' && trim($item['name']) === 'Estimacio escola') {
$match = true;
}
elseif ($exp['category'] === 'Essence' && trim($item['name']) === 'Estimation gasolina') {
$match = true;
}
elseif ($exp['category'] === 'FMCG' && trim($item['name']) === 'Estimacio F&B & beauty') {
$match = true;
}
elseif (empty($exp['budget_item_id']) && !empty($item['mapping_keywords'])) {
$keywords = array_map('trim', explode(',', $item['mapping_keywords']));
foreach ($keywords as $kw) {