I am attempting to create a single cash receipt (ex: PYMNT1234) and apply it to multiple invoices. I have the following problem:
1. I loop through a datareader of invoices to apply payments too. When I try to create a single XML document with one <RMCashReceiptsType> and multiple <RMApplyType> by adding to the collection like below, all of the <TARMApply>'s are the same. When I add the next one to the collection it replaces the properties of them all.
With paymentApply
.APTODCNM = sDocNum
.APFRDCNM = sPaymentDoc
.APPTOAMT = dApplyAmt
.APFRDCTY = 9
.APTODCTY = 1
.APPLYDATE = frmMain.dtpApplyDate.Text
.GLPOSTDT = Date.Today.ToString
End With
payment.taRMApply = paymentApply
ReDim Preserve eConnect.RMApplyType(0)
eConnect.RMApplyType(0) = payment