Plug-ins > FM Books Connector

credit memo

(1/1)

gnickerson:
How do I apply a credit memo to a specifc invoice?

Melinda DePalma:
According to the OSR documentation CreditMemos are applied to Invoices by creating a ReceivePayment transaction and setting the 'SetCredit' aggregate.  Below is pseudo script outlining the way to apply a creditmemo to an invoice.  Elipsis (...) indicate steps left out for brevity.


PCQB_RqNew( "ReceivePaymentAdd" )
...
Loop
 #for each invoice to receive a payment against or to apply a credit memo - do the following...
 PCQB_RqAddRelatedRecord( "AppliedToTxnAdd")
 PCQB_RqAddFieldWithValue( "TxnID" ; The_Invoice_TxnID )
 ...
 Loop
  #for each creditmemo to be applied to the current invoice
  PCQB_RqAddRelatedRecord( "SetCredit" )
  PCQB_RqAddFieldWithValue( "CreditTxnID" ; the_txnid_of_the_credit_memo )
  PCQB_RqAddFieldWihtValue( "AppliedAmount" ; the_amt_from_the_creditmemo_to_apply )
  #be sure to close the related credit memo record!
  PCQB_RqCloseRelatedRecord
  ...
 End Loop
 ...
 #be sure to close the AppliedToTxnAdd record!
 PCQB_RqCloseRelatedRecord
 ...
End Loop
...

Navigation

[0] Message Index

Go to full version