Set up the Journal Creation On Lock Script

The Journal Creation On Lock Script Editor can be used to override and add conditions to the automatic journal creation settings defined elsewhere in MineMarket. The script includes the following functions:

By default, each function returns a Boolean value of true but can be edited to return false as required. The JournalEntryContext for each function can be edited to define the conditions required for automatic journal creation.

Example

The following script extract validates whether the despatch order (DO) associated with the invoice has Bill of Lading Date. Journals are created when the invoice is locked only if the associated DO has a defined Bill of Lading Date.

Copy
public bool CanGenerateJournalOnInvoiceLock(JournalEntryContext journalEntryContext)
{
    if(journalEntryContext != null && journalEntryContext.DespatchTotal.DespatchOrder != null)
    {
        return !journalEntryContext.DespatchTotal.DespatchOrder.BillOfLadingDate.IsNull;
    }
    return true;
}

Security Note: You need the Allow the user to maintain journal scripts security right in the Scripting user group security rights group for this activity.

Activity Steps

  1. Open the Chart Of Accounts screen.
  2. Click Edit Journal Creation On Lock Script.

    The Journal Creation On Lock Script Editor and the Scripting Ribbon Tab display.

  3. Edit the C# script.
  4. Click the Build icon on the Scripting ribbon tab to compile the script.
  5. Click the Save icon on the Scripting ribbon tab.