first array:
[
{
"id": "11465",
"invoice_type": "invoice",
"amount": "773.25",
"id_status": "30",
"status_color": "1689e0",
"status_type": "4",
"_sort_status": "30",
"invoice_ref": "220419",
"customer_ref": "",
"vat": "162.38",
"vatincl": "935.63",
"saldo_vatincl": "935.63",
"description": "",
"_invoice_date": "2022-06-16",
"_invoice_duedate": "2022-07-01",
"invoice_date": "16/06/2022",
"invoice_duedate": "01/07/2022",
"due_delta": "-14",
"exported_bob": "1",
"id_customer": "1372",
"id_customer_contact": "1222",
"id_owner": "27",
"id_signer": "27",
"id_recovr": null,
"paid_amount": "0.00",
"customer_name": "CPAS de Malmedy",
"customer_code": "",
"customer_id_bob": "CPASDEMALM",
"status": "Envoyée",
"tags": null,
"tagnames": null,
"contact_name": "MartinIsabelle",
"costs": null,
"gross_margin": "773.250000",
"gross_margin_performance": "773.250000",
"worked_seconds": "42000.000000",
"costs_theo": "347.083333",
"amount_theo": "845.833333",
"performance": "91.41871924785",
"net_margin": "426.166667"
},
{
"id": "11464",
"invoice_type": "invoice",
"amount": "308.13",
"id_status": "30",
"status_color": "1689e0",
"status_type": "4",
"_sort_status": "30",
"invoice_ref": "220416",
"customer_ref": "",
"vat": "64.71",
"vatincl": "372.84",
"saldo_vatincl": "372.84",
"description": "",
"_invoice_date": "2022-06-16",
"_invoice_duedate": "2022-07-01",
"invoice_date": "16/06/2022",
"invoice_duedate": "01/07/2022",
"due_delta": "-14",
"exported_bob": "1",
"id_customer": "950",
"id_customer_contact": null,
"id_owner": "27",
"id_signer": "27",
"id_recovr": null,
"paid_amount": "0.00",
"customer_name": "Administration communale de Welkenraedt",
"customer_code": "ADMINISTR",
"customer_id_bob": "ADMINISTRA",
"status": "Envoyée",
"tags": null,
"tagnames": null,
"contact_name": null,
"costs": null,
"gross_margin": "308.130000",
"gross_margin_performance": "308.130000",
"worked_seconds": "15300.000000",
"costs_theo": "194.395000",
"amount_theo": "308.125000",
"performance": "100.00162271805",
"net_margin": "113.735000"
}
]
second array:
[
{
"Name": "CPAS de Malmedy",
"ID": 783,
"ParentID": 0,
"OwnerID": 0,
"HasParent": false,
"HasOwner": false,
"ValueListID": 102,
"DisplayID": "783",
"HasIcon": false,
"HasAutomaticPermission": false,
"IsDeleted": false,
"ItemGUID": "{674EDF6D-FE71-4062-8596-4D0C192F59D7}"
}
]
suddenly, we loop on the first array, if we find a match between the “customer_name” of the 1st and the “Name” of the 2nd array then: we add “ID” in the 1st array…