intacct-sdk-js icon indicating copy to clipboard operation
intacct-sdk-js copied to clipboard

Trouble applying credits to payment

Open dovigoldstein opened this issue 1 year ago • 2 comments

I can't seem to be able to find a way to apply a credit to a payment or payment details.

Given the below payment:

let createPayment = new Intacct.Functions.AccountsPayable.ApPaymentCreate({
    paymentMethod: 'Printed Check',
    paymentDate: '05/20/2023',
    transactionCurrency: 'USD',
    vendorId: 'TestVendorId',
    financialEntityId: 'BankId',
    groupPayments: true,
    apPaymentDetails: [
      new Intacct.Functions.AccountsPayable.ApPaymentDetailBill({
        recordNo: 8999,
        lineRecordNo: 2321,
        paymentAmount: 100,
      }),
      new Intacct.Functions.AccountsPayable.ApPaymentDetailBill({
        recordNo: 8999,
        lineRecordNo: 2322,
        paymentAmount: 50,
      }),
    ],
  }, 'controlid');

I've tried adding the credit to apPaymentDetails:

apPaymentDetails: [
      new Intacct.Functions.AccountsPayable.ApPaymentDetailBill({
        recordNo: 8999,
        lineRecordNo: 2321,
        paymentAmount: 100,
      }),
      new Intacct.Functions.AccountsPayable.ApPaymentDetailBill({
        recordNo: 8999,
        lineRecordNo: 2322,
        paymentAmount: 50,
      }),
      new Intacct.Functions.AccountsPayable.ApPaymentDetailCreditMemo ({
        recordNo: 562,
        lineRecordNo: 121212,
        paymentAmount: -50,
      }),
 ],

Which produces the following error: Oops, we can't find this transaction; enter a valid 562 key, then try again.

I've also tried adding detailTransaction to the APPaymentDetailBill, but it's ignored.

Any help would be appreciated

dovigoldstein avatar May 24 '23 21:05 dovigoldstein