SCM Accounting Connector Settings

These custom settings enable you to change the behavior of the SCMAccounting Connector:

SCM-FFA Connector Settings

These custom fields in the SCM-FFA Connector Settings custom setting control the behavior of the SCMAccounting Connector.

Custom Field Description
Auto Post Journals Indicates whether journals created from SCM transactions are automatically posted in FinancialForce Accounting after creation without any input from a user. 
Auto Post Payable Invoice Indicates whether payable invoices created from SCM are automatically posted in FinancialForce Accounting after creation without any input from a user.
Auto Post Sales Invoice Indicates whether sales invoices created from SCM are automatically posted in FinancialForce Accounting after creation without any input from a user.
Auto Push PIN Indicates whether payable invoices are automatically pushed to FinancialForce Accounting when the AP voucher is matched in SCM.
Auto Push SIN Indicates whether sales invoices are automatically pushed to FinancialForce Accounting when the related shipment is complete for an order in SCM.
Create COGS Journals for DS Acct Items When enabled in drop ship scenarios, any accounting items added to the AP Voucher that get auto-added to a sales order and then billed via review bill process (for example, freight charges) will receive an SCM journal in FFA for the handling of Cost Of Goods Sold (COGS).
Default AP Control GLA Reporting Code The default FinancialForce Accounting GLA accounts payable code to use when synchronizing supplier sites with accounts.  
Note:

An appropriate general ledger account must exist in FinancialForce Accounting with this GLA code.

Default AR Control GLA Reporting Code The default FinancialForce Accounting GLA accounts receivable code to use when synchronizing supplier sites with accounts.  
Note:

An appropriate general ledger account must exist in FinancialForce Accounting with this GLA code.

Default Company By default, the FinancialForce Accounting Company that transactions will be created against.
Enable Manual Deposits When checked, deposits will not be automatically applied during the export of SCM Invoices. Use this setting if you require additional flexibility when applying deposits.
Max Credit Note Lines The maximum number of lines to create on a single credit note. If the number of lines required exceeds this number, additional credit notes will be created.
Max Journal Lines The maximum number of lines that can exist on a single journal. If the number of lines exceeds this amount, several journals are created. The default value is 150.
Max PIN Lines The maximum number of lines that can exist on a single payable invoice. If the number of lines exceeds this amount, several payable invoices are created. The default value is 80.
Max SIN Lines The maximum number of lines that can exist on a single sales invoice. If the number of lines exceeds this amount, several sales invoices are created. The default value is 80.
Sync Supplier to Account Indicates whether to create a Salesforce account and link it to the supplier site when you create a supplier site inFinancialForce Supply Chain Management When selected, certain fields on the account are updated when you update the supplier site.

SCM-FFA Plugins

Note: If you are using any SCM plugins or custom Apex classes as part of you org settings, your classes must have a visible constructor to be initialized. This follows the Salesforce update applied on August 18, 2020. Ensure your custom Apex classes comply with this requirement to avoid any errors when executing them:

All Apex classes must have a visible constructor to be initialized

For more information, see Restrict Reflective Access to Non-Global Constructors in Packages (Critical Update) in the Salesforce Spring '20 Release Notes.

The custom fields in the SCM-FFA Plugins custom setting enable you to specify a custom plugin to customize the way in which data is transferred to FinancialForce Accounting.

Custom Field Description
AP Voucher Export The name of an Apex class that implements the plugin interface for an AP Voucher Export.
Credit Invoice Export The name of an Apex class that implements the plugin interface for a Credit Invoice Export.
Invoice Export The name of an Apex class that implements the plugin interface for an Invoice Export.
Invoice Void Export The name of an Apex class that implements the plugin interface for a Invoice Void Export.
Journal Export The name of an Apex class that implements the plugin interface for a Journal Export.

Sample Plugin Classes

Invoice Export

Here is an example of a class that prevents invoices from being exported for a specific customer when referenced in the Invoice Export custom field of the SCM FFA Plugins custom setting.

global with sharing class SamplePluginRemoveInvoice extends SCMFFA.SCMFFAPlugin {
 
    global SamplePluginRemoveInvoice() {
         throwException = true;
    }
 
        // SAMPLE - Prevent export of invoices for a specific customer
        // When run on invoice export:
        // scmIdToFFARecord - the Id is the Id of the SCM Invoice
        // the sObject is the resulting FFA Sales Invoice
        // scmIdToFFALineRecords - the Id is the Id of the SCM Invoice
        // the sObject is the resulting FFA Sales Invoice Line Items
        // scmIdToFFALineRecords2 - not used
        global override void execute(Map<Id, sObject> scmIdToFFARecord, Map<Id, sObject[]> scmIdToFFALineRecords, Map<Id, sObject[]> scmIdToFFALineRecords2) {
        // query source SCM invoices
               SCMC__Invoicing__c[] invoices = [select Id, SCMC__Customer__c, SCMC__Customer__r.name
               from SCMC__Invoicing__c where Id in :scmIdToFFARecord.keySet()];
        // loop through source invoices and remove the FFA invoice from the passed in map
               for (SCMC__Invoicing__c inv : invoices) {
                       if (inv.SCMC__Customer__r.name.toLowerCase() == 'acme') {
                               scmIdToFFARecord.remove(inv.Id);
                               // not necessary - if there is no invoice being exported, none of its lines will be exported.
                               scmIdToFFALineRecords.remove(inv.Id);
                        }
               }
         }
}

Invoice Void Export

global with sharing class InvoiceVoidExportPlugin extends SCMC.SCMPlugin{
global InvoiceVoidExportPlugin() {
throwException = true;
doRollback = true;
}
global override void execute(Id[] recordIds) {
try {
Set<Id> invoiceIds = new Set<Id>(recordIds);
SCMFFA.InvoicesService.exportVoid(invoiceIds);
} catch (Exception ex){
throw new MyException ('Voiding invoice plugin failed ' + ex.getMessage()); } } }

Modify Dimensions

Here is an example of a class that modifies Dimension 1 on sales invoice lines when referenced in the Invoice Export custom field of the SCM FFA Plugins custom setting.

global with sharing class SamplePluginModifyDimensions extends SCMFFAPlugin {
 
global SamplePluginModifyDimensions() {
throwException = true;
}
 
// SAMPLE - modify SIN line's dimension 1 based on billing country
// When run on invoice export:
// scmIdToFFARecord - the Id is the Id of the SCM Invoice
// the sObject is the resulting FFA Sales Invoice
// scmIdToFFALineRecords - the Id is the Id of the SCM Invoice
// the sObject is the resulting FFA Sales Invoice Line Items
// scmIdToFFALineRecords2 - not used
global override void execute(Map<Id, sObject> scmIdToFFARecord, Map<Id, sObject[]> scmIdToFFALineRecords, Map<Id, sObject[]> scmIdToFFALineRecords2) {
// query source SCM invoices with shipping country
Map<Id, SCMC__Invoicing__c> invIdToInvoices = new Map<Id, SCMC__Invoicing__c>([
select Id
, SCMC__Ship_to_Country__c
from SCMC__Invoicing__c
where Id in :scmIdToFFARecord.keySet()
]);
 
set<string> countries = new set<string>();
for (SCMC__Invoicing__c inv : invIdToInvoices.values()) {
countries.add(inv.SCMC__Ship_to_Country__c);
}
// query the dimension we will be using
c2g__codaDimension1__c[] dim1s = [select Id, c2g__ReportingCode__c
from c2g__codaDimension1__c
where c2g__ReportingCode__c in :countries];
Map<string, c2g__codaDimension1__c> repCodeToDim1 = new Map<string, c2g__codaDimension1__c>();
for (c2g__codaDimension1__c dim : dim1s) {
repCodeToDim1.put(dim.c2g__ReportingCode__c, dim);
}
for (Id scmInvId : scmIdToFFALineRecords.keySet()) {
SCMC__Invoicing__c scmInv = invIdToInvoices.get(scmInvId);
c2g__codaDimension1__c dim1 = repCodeToDim1.get(scmInv.SCMC__Ship_to_Country__c);
if (dim1 != null) {
sObject[] lineSObjects = scmIdToFFALineRecords.get(scmInvId);
for (c2g__codaInvoiceLineItem__c invLine : (c2g__codaInvoiceLineItem__c[])lineSObjects) {
// simply set the new dimension on the SIN line. the connector will save any modifications that are made here.
invLine.c2g__Dimension1__c = dim1.Id;
}
}
}
}
}

SCM Plugins Custom Setting

Use these fields in the SCM Plugins custom setting to change the classes and modules that are called at certain points in FinancialForce Supply Chain Management.

Note:

These settings should only be changed by a system administrator. We recommend that you do not change these settings without first seeking advice from your FinancialForce representative.

Key: S – only exists if FinancialForce Service Contracts is installed on your organization.

Custom Field   Description
AP Voucher Credit   The name of the Apex class to be called when an AP voucher is credited.
AP Voucher Void   The name of the Apex class to be called when processing a void AP Voucher.
Change Request Invoice Plug S The name of the Apex class to be called to process a change request outside the package.
Invoice Void   The name of the Apex class to be called before an invoice is voided.
Invoice Void After   The name of the Apex class to be called after an invoice is voided. A Credit Invoice Id is provided.
Receipt of Capital Equipment   The name of the Apex class to be called after the receipt of a capital equipment purchase order line.
Recur Invoice Plugin   The name of the Apex class to be called to create an invoice for the recurring invoice process.
Recur Invoice Plugin   The name of the Apex class to be called by the billing engine associated with Service Contracts
Sales Invoice Bill   The name of the Apex class to be called on the Sales Order Review Invoice page when you click the Bill button. This is executed after the invoice is created and the sales order is updated.
Sales Invoice Credit   The name of the Apex class to be called when a sales invoice is credited. This can be used to credit tax when appropriate.