Friday, October 24, 2014

Automated Forex Gains and Losses in BlueBox

BlueBox has an automated way of dealing with the gains and losses which occur when a payment is finally attached to a debtors or creditors invoice.

It looks for a gain/loss between the base currency value in the invoice vs the base currency value in the payment.

If there is a gain/loss is check the following to see if it can automate the application of a suitable adjustment document (ie direct debit/credit note) to be applied to the invoice to correct the loss:

  • The payment must be in the same forex currency as the invoice
  • The payment must be for the full amount of the invoice (not just the balance owing)
  • There must be a bb_sales_debtors_direct_debit_notes_types named 'Forex Gain Adjustment'
  • There must be a bb_sales_debtors_direct_credit_notes_types named 'Forex Loss Adjustment'
  • There must be a bb_procurement_creditors_direct_credit_notes_types named 'Forex Gain Adjustment'
  • There must be a bb_procurement_creditors_direct_debit_notes_types named 'Forex Loss Adjustment'
  • The must be a nominated GL account for gains in the bbsetting: bb_finance_general_ledger_accounts > bbsetting_forex_gains_account
  • The must be a nominated GL account for losses in the bbsetting: bb_finance_general_ledger_accounts > bbsetting_forex_losses_account
Once these pre-requisites are confirmed to be in place the system will automatically add the required DR/CR notes each time a forex invoice is paid in full.

Inline Forex Base Currency Value Calculator for BlueBox

BlueBox includes forex specifications that allow you to manually set the forward rate and spot rates for any currency inputs in the system.

Until recently, if you wanted to over-ride the current spot rate for a currency value you would have to calculate the forward rate manually and then input it into the FR input box.

There is now a target base rate input field which automatically calculates the related FR rate to match the base rate that has been input:


Friday, August 22, 2014

Stripe Now Part of BlueBox Payment Gateways

BlueBox has recently added the Stripe Payment System to it's list of available payment methods/gateways.

A typical Pay Function would work like this:

Friday, August 15, 2014

jQuery Fixed Table Headers in BlueBox

A recent plugin added to BlueBox is Misha Koryak's FloatThread. This allows you to fix the table header within a fixed-width div as follows:


<div style=width:1000px;height:300px;overflow:auto; id=reportwrapper>

<table width=100% cellpadding=5 cellspacing=1 bgcolor=silver id=report_table_pointer>
<thead>
   <tr>
     <th> .. some content here .. </th>
     <th> .. some content here .. </th>
   </tr>
</thead>
<tbody>
   <tr>
     <td> .. some content here .. </td>
     <td> .. some content here .. </td>
   </tr>
</tbody>
</table>

</div>

<script src=\"engine/3rdparty/jquery/table_headers/jquery.floatThead.min.js\"></script>
<script>
var float_headers = jQuery('#report_table_pointer');
float_headers.floatThead({
scrollContainer: function(table){
return table.closest('#reportwrapper');
        }
});
</script>

Thursday, August 14, 2014

Redirect to Despatch Note after Auto-Generating Invoice

A new BlueBox setting has been installed which redirects the 'view' back to a despatch note after a debtors invoice has been auto-generated from it. The usual behaviour is for the end document to display the debtors invoice. bb_sales_debtors_invoices->bbsetting_inv_show_dsp_after_add - if set to 1 (on) will trigger a redirect back to the despatch note automatically.

Monday, June 9, 2014

BlueBox2.0 document pagination templates

BlueBox2.0 includes pagination templates that display long documents in a paginated format.

It is now possible to specify the number of lines on the first page differently from the number of lines on the subsequent pages by simply splitting the line-count with a pipe | and specify page 1's count first followed by the count for page 2 onwards after that.

For example:

<!--:set:global|force_custom_templates_in_system_mode=1:-->
<!--paginate_document_lines=10|15-->
<!--paginate_document_runon_template=bb_sales_quotes-print_runon-->
<!--:class:bb_sales_quotes_items:viewlist_print|sales_quoteISbb_sales_quotesID=(#_id#) and _id>=(#pdl_start_row#) and _id<=(#pdl_end_row#):-->

Monday, June 2, 2014

Neater Table to CSV Exports in BlueBox2

Update:

BlueBox includes a javascript library and PHP function which automatically exports tabular data to CSV export by simply adding ".table2csv_export('table_id')." into the string above your <table id=table_id> tag.

This feature has existed for a few years, but has been updated now to improve trimming of the contents. The numbers and text snippets in each cell are now trimmed to perform more reliably in Excel.

Friday, May 2, 2014

Print to PDF quickly with BlueBox

For BlueBox PHP coders and HTML5 developers here is a handy shortcut to printing any page to pdf with a few characters: (url broken up for legibility)

<a href=
/?class=some_class
&method=some_method
&global[noincludes]=print
&global[send2pdf]=1>Print to PDF</a>

Easy as that :-)


Thursday, April 24, 2014

Creating bespoke ajax lookups in BlueBox

BlueBox includes a default ajax-lookup feature for lists of information. This provides a neat facility for any link-table lookups and works by simply naming your fields with a capital ID in the field name ie userISbb_usersID.

Sometimes you want to use your own ajax lookups and there is a quick bbsetting that allows you to override the standard lookup, called bbsetting_ajax_lookup_jsfunction.

If you enter your javascript replacement function name into this setting for the required module, it will use that function rather than the standard one, ie my_lookup_function

A hidden div is automatically created with an id 'div_{field_name}' whenever a field for that module is created, so you can hook your ajax lookup into that div and the text input field is automatically given the id 'viewer_{field_name}' - with these 2 id's you have the ingredients to build an ajax lookup.

Your javascript lookup would work this way:

function my_lookup_function(){
  \$('div_global[fields][userISbb_usersID]').style.display='block';
  ajax2div('div_global[fields][userISbb_usersID]','/?class=my_class&method=my_method&global[noincludes]=rawtext&global[srch_txt]='+$('viewer_global[fields][userISbb_usersID]').value);
}

In your my_class->my_method you would then search the module using $global[srch_txt] and return the results.

Thursday, April 17, 2014

BlueBox and Mailchimp

BlueBox now integrates with MailChimp the popular bulk emailing platform.

To access/activate the integration follow these steps:

Go to Integration > MailChimp



Then edit the settings to insert your MailChimp API key:

To generate an API key in MailChimp go to Account Settings > Extras > API Keys

Then click on 'Create a key' and copy the key when it is generated.


Once you have the key inserted into BlueBox you can proceed to upload lists of BlueBox users to your matching MailChimp lists. You can send users from a Campaign of User Group as follows:


After you have used MailChimp to send to your new list you can access campaign stats from MailChimp by clicking on 'View Your Campaign Settings':





Wednesday, March 26, 2014

New Features for BlueBox Forms (Financial Document Lines)

Recently added to BlueBox2.0 financial document lines are 3 long-awaited features:
  • Editing Lines where the Items have Sizes/Colours
    Previously newly added items with sizes/colours were sent to the end of the list of items. Now, if the current line has been 'cleared' of it's item the first click/select of a new item will fill the current row.. any subsequent clicks will auto-populate at the end of the form.


  • Draggable Line Ordering:

    For new lines added to any form there is now the ability to drag the line into any position amongst the other newly added lines. The catch here is that this ONLY applies to newly added lines... any lines that are part of a previous posting and are being edited cannot be moved and cannot have any new items mixed among them.

  • Ajax Loading for Extra Details:

    For very large forms the extra fields in the [+] extra items area has slowed up the page load considerably. To get around this we now only load the extra fields as required via Ajax when the [+] is clicked.

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.