Wednesday, March 19, 2014

General ledger Postings for Sales and Procurement Documents

BlueBox2.0 uses document maps to dictate GL movements from the document layer. This means that you can specify which entries get posted whenever specific documents are created, and using advanced condition statements you can be very precise about these postings.

Once your document maps are set up your system will populate the GL automatically providing you with a live Trial Balance, Balance Sheet and Income Statement.

The GL allocations for a stock-based business that uses GRN's to receive stock and Despatch Notes to ship stock have a specific layout that is worth noting:
  • GRN
    • DR Stock GL Account
      Note: for non-stock items being received be sure to set the 'GRN asset acct' to a special asset account (ie something like Non-stock Assets Received)
    • CR GRN Suspense Account
      Note: this Liabilities account should not be changed via item-data settings
  • Creditors Invoice
    • DR GRN Suspense GL Account
      Note: This 'expense' account must not be changed via item-data settings if the item was GRN'd in originally. For CR Invoices that are captured directly without a previous GRN this expense account can be set to anything.
    • CR Accounts Payable
    • DR Input Tax Account
  • Despatch
    • DR Cost of Sales
      Note: The 'DSP expense account' can be overridden at item-data level as required
    • CR Stock
      Note: be sure to set the 'DSP asset account' on non-stock items to the same asset account used in the GRN above
  • Debtors Invoice
    • CR Sales Revenue
      Note: this income Account can be overridden at item-data level as required
    • DR Accounts Receivable
    • CR Output Tax Account

Wednesday, March 12, 2014

Debug Toggle

For developers who want to see runtime errors pertaining to their BlueBox PHP scripts adding

&global[debug]=1

to their URLs will display any errors found.

Sunday, March 2, 2014

Sending Email from BlueBox with Mandrill

Mandrill.com (the platform/infrastructure behind Mailchimp.com) offers a powerful email sending solution for outbound emails. It can be very helpful for mail tracking (opens and clicks) and having some control over your outbound email messages.

In BlueBox we have recently added additional email settings to the bb_email module which allow you to configure your system to use Mandrill as the outbound mail server.

Setting up your Mandrill.com account:

Firstly you need to set up your Mandrill account. The free account comes with 12000 free emails per month. Within your account you can set up 2 control mechanisms to separate 'who is sending the messages' and thereby have one account for all your sites/customers if you have more then one BlueBox server to manage:
  • API Keys > these are essentially the 'passwords' used for sending outbound messages. You can have multiple keys and so using this method can control who is sending which messages.
  • Sub accounts > these are more detailed and offer more control, and can be used in conjunction with a key to for a true sub account for the customer/sender complete with mail limits etc.
Setting up your BlueBox system:

To set these go to Admin > Modules > Module Settings and select 'bb_email' as the module/class.

You will then see a set of bbsettings which can be configured, namely:
  • bbsetting_email_from_name
    (This setting overrides the same setting in the config file if set.)
  • bbsetting_email_from_email
    (This setting overrides the same setting in the config file if set.)
  • bbsetting_email_smtp_server
    smtp.mandrillapp.com
  • bbsetting_email_smtp_port
    587
  • bbsetting_email_smtp_username
    (your Mandrill username, normally your email)
  • bbsetting_email_smtp_password
    (the API key generated on Mandrill, see above)
  • bbsetting_email_smtp_security
    tls
  • bbsetting_email_smtp_headers
    X-MC-Subaccount=(subaccount_name),X-MC-Track=Opens|Clicks,
Note that for the last setting, bbsetting_email_smtp_headers, these are optional, and there is a pipe | between Opens and Clicks because commas are reserved for BlueBox bbsetting array separators.

Updating the DNS records for the 'from domain':

Because the emails are being sent from Mandrill.com's platform we need to tell the DNS network that they are authorised to send emails 'as' our 'from domains' - so for each from domain you should ideally edit it's DNS records and set the DKIM and SPF records in the TXT section of the DNS record. This is really quick and easy to do - simply follow the instructions on the Mandrill control panel and you have them set in a minute.

Saturday, November 16, 2013

Timing your PHP Code in BlueBox

If you think a piece of PHP code is inefficient but don't know where, there is a BlueBox function that can give you time-splits as the code progresses.

bb_timer([optional __LINE__ number],[optional return_value]);

The simplest use would be bb_timer(__LINE__); which will print to the screen the time taken to get to that specific line of code.

If you would rather have the value returned then enter a 'true' value into the second value.

Thursday, October 24, 2013

Including Sales Orders and Purchase Orders in Stock Returns

BlueBox2.0 has an automated stock returns module which allows you to return stock to a supplier via the GRN which received the stock, or to return stock from a customer via the Despatch Note that shipped the stock.

Recently added has been the ability to do that one document further up the chain, namely via the Purchase Order or via the Sales Order. These 2 new additions, complete with 'quick action' buttons in the views of each document type, are a logical starting point when wanting to process a supplier or customer return, and will make the returns process even easier to handle.

The new quick link on the Purchase Order view screen.
The new quick link on the Sales Order view screen.

Tuesday, October 22, 2013

BlueBox Despatch Notes - Including Backorder Status

Despatch Notes in BlueBox2.0 have been upgraded to include backorder status of items relating to the parent Sales Order if one exists. The Despatch Note has also had all financial info removed from it, and purely relates to item and qty despatched.

Note: if you want to access the financial view of the despatch note (ie the old view) you can still do so by using the special view in the Output menu.

Tuesday, October 1, 2013

BlueBox General Ledger Document Map Conditions

The GL in BlueBox is driven by  set of document maps. These are essentially a set of GL account instructions which tell the GL which account to credit or debit for each document in the document layer of BlueBox. 

So, for example, the document map for 'Creditors Invoices' tells the GL to credit the Liabilities account called 'Accounts Payable' and to debit the Expense account called 'Cost of Sales'. It also includes a 3rd instruction for the VAT/Tax account. The sum of all 3 'movements' balances the double entry for each line in the document being processed.

There are times when you may want a different set of movements depending on what has been entered into the document. For example, you may want to debit or credit a different account depending on which business unit the document was captured in.

Document and line conditions are the way to achieve this. These conditions are evaluated for each document map and, as their names suggest, are evaluated at 'header' or 'document' level, or at 'line' level.

The most basic way of entering a condition is to simply include the field name that you are evaluating. This implies that if that variable exists in the data being posted it will be seen as applicable.

Most likely though, will be the case where you require an evaluation of the value being passed through a field, and for this we need a bit more syntax.

The correct syntax for evaluated conditions is:

eval:$conf[fields][SESSION_business_unitISbb_business_unitsID]==2

Note the eval: which triggers the evaluation, and the double =='s which are programatical for ='s
In this case you would replace the 2 with the ID you required.

Also: Doc Maps require that ALL entries for that specific doc type need a condition if any of them have one... this way it eliminates which ones to ignore, so for the 'general one' you will need a condition like this:

eval:!in_array($conf[fields][SESSION_business_unitISbb_business_unitsID],array(2,4,6)) 

Note: it starts with a ! which means 'not' and the list of ID's mentioned in the other lines needs to be comma separated in the array at the end.