mapping cat
This commit is contained in:
@@ -51,12 +51,20 @@ $totalRevenus = 0;
|
|||||||
foreach ($allExpenses as $exp) {
|
foreach ($allExpenses as $exp) {
|
||||||
$match = false;
|
$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']) {
|
if (!empty($exp['budget_item_id']) && (int)$exp['budget_item_id'] === (int)$item['id']) {
|
||||||
$match = true;
|
$match = true;
|
||||||
}
|
}
|
||||||
|
// 2. Lien forcé pour l'École
|
||||||
elseif ($exp['category'] === 'School' && trim($item['name']) === 'Estimacio escola') {
|
elseif ($exp['category'] === 'School' && trim($item['name']) === 'Estimacio escola') {
|
||||||
$match = true;
|
$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'])) {
|
elseif (empty($exp['budget_item_id']) && !empty($item['mapping_keywords'])) {
|
||||||
$keywords = array_map('trim', explode(',', $item['mapping_keywords']));
|
$keywords = array_map('trim', explode(',', $item['mapping_keywords']));
|
||||||
foreach ($keywords as $kw) {
|
foreach ($keywords as $kw) {
|
||||||
|
|||||||
Reference in New Issue
Block a user