MCRCustCreditTable.createCredit Method
Creates a credit based on the salesTable record passed in.
Syntax
public void createCredit(
SalesTable _salesTable,
RetailInfocodeId _retailInfocodeId,
RetailInformationSubcodeId _mcromcReasonCode,
AmountCur _amount,
[SalesLine _salesLine,
boolean _onAcctOverride,
MCRCustPaymTable _origPayment])
Run On
Called
Parameters
- _salesTable
Type: SalesTable Table
The SalesTable record for which this method creates a credit.
- _retailInfocodeId
Type: RetailInfocodeId Extended Data Type
The reason code infocode ID used to justify the creation of the credit.
- _mcromcReasonCode
Type: RetailInformationSubcodeId Extended Data Type
The reason code used to justify the creation of the credit.
- _amount
Type: AmountCur Extended Data Type
The amount for which the credit will be created.
- _salesLine
Type: SalesLine Table
The SalesLine record for which this method creates a credit; optional.
- _onAcctOverride
Type: boolean
The Boolean to determine whether or not to use On Account payment method; optional.
- _origPayment
Type: MCRCustPaymTable Table
The original method of payment; optional.
Remarks
If itemID has a value that means this is a price match this.AppliedPaymID - Gets assinged when the customer uses their credit.
this.AppliedSalesID - Gets assigned when the customer uses their credit.
this.Voucher - Gets set in the insert method, this is the voucher number of the custTrans record of the original credit posting (not the number of the payment using the credit).
this.JournalNum - Gets set in the insert method, this is the journal number of the original credit posting (not the number of the payment using the credit).
this.ccSettlementRecID - For credit card credits, need in case of a declined settlement request.
this.OrigPaymID - OrigPaymID normally points to the original payment record, from which all credit posting information is drawn. However, in the case of OnAccount override this is not true. To indicate this, OrigPaymID will be blank.
There is a MCRCustPaymTable record associated w/ each credit, to get that record need to do a find on the payment table by this credit's RecID and TableID.
CustCreditStatus is an enum with 4 values Open (Default) - This means that the credit is available for use (only applies to onAccount).
Applied - This means that the credit has been applied to a sales order (only applies to onAccount).
Pending - This means that the credit is pending (why it's pending is based on the credit type).
In the case of credit cards it is awaiting settlement.
Successful - This means that the credit has been given to the customer (all payments except onAccount).
Failed - This means that something went wrong when trying to credit the customer.