According to the case that presented before like restlessness ... Add data to JSONArray
Now, for this very thing
for (int l = 0; l < lineas.length(); l++) {
lineas.getJSONObject(l).put("importe_aumentado", json.getJSONObject(l).getString("importe_aumentado"));
lineas.getJSONObject(l).put("importe_hotel", json.getJSONObject(l).getString("importe_hotel"));
lineas.getJSONObject(l).put("porcent_iva", json.getJSONObject(l).getString("porcent_iva"));
lineas.getJSONObject(l).put("ivaInc", json.getJSONObject(l).getBoolean("ivaInc"));
}
I have to make this work when several lines come to me, I have to join my two objects but the position of my json.getJSONObject () will have to be comparing a field that I have in lineas.getJSONObject () that is called number and in json.getJSONObject () that is called line_num. This is because not necessarily the information I want to add this in the position of my json.getJSONObject () is the same as lineas.getJSONObject ().
json.getJSONObject (). getString ("num_linea"))
Must be equal to
lineas.getJSONObject (). getString ("number"))
To add the correct data.