I changed the formula for DepositAmount to:
if {SO_InvoiceWrk.DepositAmt}=0 then
if {SO_InvoiceWrk.Last4UnencryptedCreditCardNos}<>"""" then
{SO_InvoiceWrk.TaxableAmt}+{SO_InvoiceWrk.NonTaxableAmt}-
{SO_InvoiceWrk.DiscountAmt}+{SO_InvoiceWrk.FreightAmt}+
{SO_InvoiceWrk.SalesTaxAmt}
else
{SO_InvoiceWrk.DepositAmt}
They always charge the full amount to the credit card, no partials, so this works for them. This is 4.4.