You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Business Validation Error when attempting to create a deposit from payments in undeposited funds #391
When attempting to create a Deposit object to move payments from undeposited funds to a bank account, I keep getting "Business Validation Error: Select a bank account for this deposit" even though the DepositToAccountRef is correctly set to a valid bank account.
I tried mirroring this operation in the UI and got the same error when attempting to add funds manually to a bank deposit. When I selected the provided payments from the undeposited funds account (from the "Select the payments included in this deposit" section at the top), the payment was successful. This leads me to believe that the DepositLineDetail object may not be necessary when linking payments from undeposited funds.
Any guidance on the correct structure for creating deposits from undeposited funds payments would be greatly appreciated.
This is roughly the code I've been working with:
deposit=Deposit()
deposit.DepositToAccountRef=get_account_by_name(account_name).to_ref()
deposit.TxnDate=transaction_dateforpaymentinpayments:
line=DepositLine()
detail=DepositLineDetail() # I've tried removing this all togetherline.DetailType="DepositLineDetail"# I've tried with and without thisdetail.Entity=payment.CustomerRefdetail.PaymentMethodRef=payment.PaymentMethodRefdetail.AccountRef=get_account_by_name("Payments to deposit").to_ref() # the name of my undeposited funds accountline.DepositLineDetail=detail# type: ignoreline.Amount=payment.TotalAmt# type: ignoreline.LinkedTxn= [payment.to_linked_txn()]
deposit.Line.append(line)
deposit.save(qb=client)
Activity