I have the following arrangement: (this data is sorted by invoice but could be scrambled).
$datos =[{"factura":88,"total":41587.3942},{"factura":88,"total":43.01},{"factura":88,"total":1472},{"factura":88,"total":117.98},{"factura":88,"total":66.01},{"factura":999,"total":41587.3942},{"factura":999,"total":516.12},{"factura":999,"total":128},{"factura":999,"total":235.96},{"factura":999,"total":330.05}];
and I would like to add the values where the invoice is the same (in this case they are 2 invoice numbers, therefore my new arrangement wanted
Example:
$totalF =[{"factura":88,"total":41587.3942},{"factura":999,"total":42763.33}];
I hope you can help me.