Fix for credit, payment and refund apply lists not working

I found that with the existing `to_record` method, you could not apply a payment to multiple invoices. It would always only apply to the last one in the. 

After looking at the request I found it to be incorrectly constructing the apply list.

Currently it looks like this:

```
<tranCust:applyList>
	<tranCust:apply>
	 	<tranCust:doc>5760</tranCust:doc>
 		<tranCust:apply>true</tranCust:apply>
 		<tranCust:amount>12</tranCust:amount>
	</tranCust:apply>
</tranCust:applyList>
<tranCust:applyList>
	<tranCust:apply>
 		<tranCust:doc>5761</tranCust:doc>
 		<tranCust:apply>true</tranCust:apply>
 		<tranCust:amount>34</tranCust:amount>
 	</tranCust:apply>
</tranCust:applyList>
```

It should look like this:
```
<tranCust:applyList>
	<tranCust:apply>
	 	<tranCust:doc>5760</tranCust:doc>
 		<tranCust:apply>true</tranCust:apply>
 		<tranCust:amount>12</tranCust:amount>
	</tranCust:apply>
	<tranCust:apply>
 		<tranCust:doc>5761</tranCust:doc>
 		<tranCust:apply>true</tranCust:apply>
 		<tranCust:amount>34</tranCust:amount>
 	</tranCust:apply>
</tranCust:applyList>
```