Some of the terminology is misleading.
A
payment must have a
payment type attached to it - such payment types are defined in "Sales->Configuration->Payment Types".
If you look in "Sales->Configuration->Payment Types", you will see that for each payment type defined, a
payment type must be set! There are 2 things called payment type and each are actually different!! A better use of terminology would have been:
A
payment must have a
payment method attached to it - such payment methods are defined in "Sales->Configuration->Payment Methods" and can be managed by the user. Each payment method must have a payment type attached. Payment types are hard coded.
Anyway, all that aside, what you need to do is this:
- Code: Select all
Dim _PaymentTypes As New JiwaFinancials.Jiwa.JiwaSales.SalesOrder.PaymentTypeCollection
_PaymentTypes.Read()
Dim objPayment As New JiwaFinancials.Jiwa.JiwaSales.SalesOrder.Payment
With objPayment
.AmountPaid = Convert.ToDecimal(PaymentAmount)
TotalPaid = TotalPaid + PaymentAmount
.PaymentDate = InterfaceDT
.PaymentRef = PaymentRef
.BankName = "ROS"
.PaymentType = _PaymentTypes(1)
.ProcessPayment = True
End With
After line 2 above you will have a collection of all the payment types defined in the system. In the example above I simply apply the 1st payment type to the payment. You may, however, wish to iterate through the collection of payment types and then select a particular one, i.e. the one with the name of "Fred" or the first one that is of .paymenttype "cash".