[GNC-dev] Problem with Customer.ApplyPayment
Gerhard Kotze
gkotze at gmail.com
Mon Aug 13 07:22:32 EDT 2018
Hello,
I'm using the Python bindings to import payments into Gnucash. The following code used to work
transaction = invoice.GetPostedTxn()
customer = invoice.GetOwner()
posted_acc = invoice.GetPostedAcc()
xfer_acc = root.lookup_by_name('Checking Account')
amount = gnc_numeric_from_decimal(Decimal(row['amount']))
date = parser.parse(row['date'])
customer.ApplyPayment(transaction, None, posted_acc, xfer_acc, amount, GncNumeric(1), date, '', number, True)
but now fails with this error
TypeError: in method 'gncOwnerApplyPayment', argument 2 of type 'Transaction **'
As far as I can tell, it doesn't like the 2nd argument being *None* anymore.
Does anyone know what I'm doing wrong?
Regards,
Gerhard
More information about the gnucash-devel
mailing list