Managing Custom Plugins with Datacentre

As of v7, using Upload All to upload plugins to the server will replace the plugins folder on the server rather than merging with what is there.

When the custom plugins are downloaded by clients (when they log in), the server plugins folder will normally be merged with what they have. To get a clean plugins folder on the client, delete the plugins folder prior to logging in.

If you will be adding and deleting custom plugins frequently, and want them cleanly synced to clients without accumulating old deleted ones on the clients and without the users having to manually delete the folder to clean up, there is a hidden option to have the cleanup performed automatically...

warning: do not use this option for users who might create their own custom forms or reports, because it will cause them to be lost.

To have a client machine replace it's custom plugins folder with the one from the server, when the server plugins change (rather than merge), you can set the hidden option clobberCustomPlugins on the client.

On Mac, use defaults write on the command line

defaults write nz.co.cognito.MoneyWorks.Gold clobberCustomPlugins YES

On Windows, use RegEdit to add a clobberCustomPlugins value in the MoneyWorks Gold Preferences tree with value 1

Posted in Esoterica | Comments Off on Managing Custom Plugins with Datacentre

Suppressing Standard Plugins

Sometimes you don't want particular clients to see any standard reports (or maybe forms), but if you delete the standard plugins folder, MoneyWorks will recreate it on next launch.

You can delete the subfolders and leave the Standard Plugins Checksum file in place: this will prevent MoneyWorks from reinstalling the folder until at least the next software update.

To permanently prevent standard plugins recreation, delete the content you do not want (say, the Reports folder), and create an empty file in the Standard Plugins folder named No Standard Plugins (you could just rename the checksum file to this). If this file is present, MoneyWorks will not reinstall standard plugins.

Posted in Esoterica | Comments Off on Suppressing Standard Plugins

Persistent Data and DevKeys

In MoneyWorks 7 we introduced a new internal data table called "User2", specifically so that mwScripts and external plug-ins can store their own persistent data in a MoneyWorks database.

However with diverse scripts each storing their own data, there is the potential for one script to inadvertently destroy or modify data stored by another. To prevent this, records in the User2 table must be accessed using two keys: a DevKey, which is unique to a particular developer or project, and a Key which can have any value. A DevKey is allocated by Cognito to developers on request, and is an integer no greater than 65,535 (#FFFF).

Because each developer/project will have a unique DevKey, developers can use whatever values they like in the Key field, knowing that they don't have to worry about data being modified by other scripts happening to use the same value. Separate projects from one developer that each store only a little data (a few settings perhaps) can be managed under one DevKey. However it may be more sensible to use a separate DevKey for projects that store a lot of data, for example you want to log every change of address made to any customer record, or store additional information against each product record.

DevKey values of greater than #FFFF can be used freely within a specific document, but should not be used across documents as they might clash with other scripts using these unrestricted DevKeys.

Note that these are conventions only, and there is nothing to stop the ignorant or malicious using a DevKey that is not assigned to them. But we're confident that you wouldn't be one of these.

To access the User2 table, use the mwScript functions GetPersistent() and SetPersistent(). If accessing from an external system (e.g. using COM/AppleEvent/REST), use export and import.

Posted in Database, MWScript | Comments Off on Persistent Data and DevKeys

Schema

You can obtain the full MoneyWorks database schema by exporting "xmlschema" to a file. E.g.

tell application "MoneyWorks Gold" to export "xmlschema" into POSIX file "/schema.xml"

Note that text field usable sizes are general one byte less than the size indicated here, in some cases they are larger than the size indicated (spillover is stored elsewhere).


<?xml version="1.0"?>
<tables>
    <table>
        <file_num>0</file_num>
        <name>Account</name>
        <fields>
            <field name="SequenceNumber" type="long" unsigned="true" />
            <field name="LastModifiedTime" type="time" unsigned="true" />
            <field name="Code" type="string" size="8" indexed="true" />
            <field name="Type" type="char_short" indexed="true" />
            <field name="Group" type="string" size="6" indexed="true" />
            <field name="Category" type="string" size="8" indexed="true" />
            <field name="Description" type="string" size="40" />
            <field name="PandL" type="string" size="8" indexed="true" />
            <field name="TaxCode" type="string" size="4" />
            <field name="Flags" type="short" />
            <field name="System" type="char_short" indexed="true" />
            <field name="Created" type="time" unsigned="true" />
            <field name="Category2" type="string" size="16" />
            <field name="Category3" type="string" size="16" />
            <field name="Category4" type="string" size="16" />
            <field name="AccountantCode" type="string" size="10" />
            <field name="Colour" type="short" />
            <field name="Currency" type="string" size="4" />
            <field name="SecurityLevel" type="short" />
            <field name="BankAccountNumber" type="string" size="24" />
            <field name="BalanceLimit" type="decimal" />
            <field name="ManualChequeNumber" type="string" size="12" />
            <field name="PrintedChequeNumber" type="string" size="12" />
            <field name="LastStatementImport" type="time" unsigned="true" />
            <field name="Comments" type="string" size="200" />
            <field name="ManualChequeNumDigits" type="byte" />
            <field name="PrintedChequeNumDigits" type="byte" />
        </fields>
    </table>
    <table>
        <file_num>1</file_num>
        <name>Ledger</name>
        <fields>
            <field name="SequenceNumber" type="long" unsigned="true" />
            <field name="LastModifiedTime" type="time" unsigned="true" />
            <field name="AccountCode" type="string" size="8" />
            <field name="Department" type="string" size="6" indexed="true" />
            <field name="Category" type="string" size="8" indexed="true" />
            <field name="Classification" type="string" size="6" indexed="true" />
            <field name="Type" type="char_short" indexed="true" />
            <field name="BalanceLast91" type="decimal" />
            <field name="BalanceLast90" type="decimal" />
            <field name="BalanceLast89" type="decimal" />
            <field name="BalanceLast88" type="decimal" />
            <field name="BalanceLast87" type="decimal" />
            <field name="BalanceLast86" type="decimal" />
            <field name="BalanceLast85" type="decimal" />
            <field name="BalanceLast84" type="decimal" />
            <field name="BalanceLast83" type="decimal" />
            <field name="BalanceLast82" type="decimal" />
            <field name="BalanceLast81" type="decimal" />
            <field name="BalanceLast80" type="decimal" />
            <field name="BalanceLast79" type="decimal" />
            <field name="BalanceLast78" type="decimal" />
            <field name="BalanceLast77" type="decimal" />
            <field name="BalanceLast76" type="decimal" />
            <field name="BalanceLast75" type="decimal" />
            <field name="BalanceLast74" type="decimal" />
            <field name="BalanceLast73" type="decimal" />
            <field name="BalanceLast72" type="decimal" />
            <field name="BalanceLast71" type="decimal" />
            <field name="BalanceLast70" type="decimal" />
            <field name="BalanceLast69" type="decimal" />
            <field name="BalanceLast68" type="decimal" />
            <field name="BalanceLast67" type="decimal" />
            <field name="BalanceLast66" type="decimal" />
            <field name="BalanceLast65" type="decimal" />
            <field name="BalanceLast64" type="decimal" />
            <field name="BalanceLast63" type="decimal" />
            <field name="BalanceLast62" type="decimal" />
            <field name="BalanceLast61" type="decimal" />
            <field name="BalanceLast60" type="decimal" />
            <field name="BalanceLast59" type="decimal" />
            <field name="BalanceLast58" type="decimal" />
            <field name="BalanceLast57" type="decimal" />
            <field name="BalanceLast56" type="decimal" />
            <field name="BalanceLast55" type="decimal" />
            <field name="BalanceLast54" type="decimal" />
            <field name="BalanceLast53" type="decimal" />
            <field name="BalanceLast52" type="decimal" />
            <field name="BalanceLast51" type="decimal" />
            <field name="BalanceLast50" type="decimal" />
            <field name="BalanceLast49" type="decimal" />
            <field name="BalanceLast48" type="decimal" />
            <field name="BalanceLast47" type="decimal" />
            <field name="BalanceLast46" type="decimal" />
            <field name="BalanceLast45" type="decimal" />
            <field name="BalanceLast44" type="decimal" />
            <field name="BalanceLast43" type="decimal" />
            <field name="BalanceLast42" type="decimal" />
            <field name="BalanceLast41" type="decimal" />
            <field name="BalanceLast40" type="decimal" />
            <field name="BalanceLast39" type="decimal" />
            <field name="BalanceLast38" type="decimal" />
            <field name="BalanceLast37" type="decimal" />
            <field name="BalanceLast36" type="decimal" />
            <field name="BalanceLast35" type="decimal" />
            <field name="BalanceLast34" type="decimal" />
            <field name="BalanceLast33" type="decimal" />
            <field name="BalanceLast32" type="decimal" />
            <field name="BalanceLast31" type="decimal" />
            <field name="BalanceLast30" type="decimal" />
            <field name="BalanceLast29" type="decimal" />
            <field name="BalanceLast28" type="decimal" />
            <field name="BalanceLast27" type="decimal" />
            <field name="BalanceLast26" type="decimal" />
            <field name="BalanceLast25" type="decimal" />
            <field name="BalanceLast24" type="decimal" />
            <field name="BalanceLast23" type="decimal" />
            <field name="BalanceLast22" type="decimal" />
            <field name="BalanceLast21" type="decimal" />
            <field name="BalanceLast20" type="decimal" />
            <field name="BalanceLast19" type="decimal" />
            <field name="BalanceLast18" type="decimal" />
            <field name="BalanceLast17" type="decimal" />
            <field name="BalanceLast16" type="decimal" />
            <field name="BalanceLast15" type="decimal" />
            <field name="BalanceLast14" type="decimal" />
            <field name="BalanceLast13" type="decimal" />
            <field name="BalanceLast12" type="decimal" />
            <field name="BalanceLast11" type="decimal" />
            <field name="BalanceLast10" type="decimal" />
            <field name="BalanceLast09" type="decimal" />
            <field name="BalanceLast08" type="decimal" />
            <field name="BalanceLast07" type="decimal" />
            <field name="BalanceLast06" type="decimal" />
            <field name="BalanceLast05" type="decimal" />
            <field name="BalanceLast04" type="decimal" />
            <field name="BalanceLast03" type="decimal" />
            <field name="BalanceLast02" type="decimal" />
            <field name="BalanceLast01" type="decimal" />
            <field name="Balance" type="decimal" />
            <field name="BudgetALast29" type="long" />
            <field name="BudgetALast28" type="long" />
            <field name="BudgetALast27" type="long" />
            <field name="BudgetALast26" type="long" />
            <field name="BudgetALast25" type="long" />
            <field name="BudgetALast24" type="long" />
            <field name="BudgetALast23" type="long" />
            <field name="BudgetALast22" type="long" />
            <field name="BudgetALast21" type="long" />
            <field name="BudgetALast20" type="long" />
            <field name="BudgetALast19" type="long" />
            <field name="BudgetALast18" type="long" />
            <field name="BudgetALast17" type="long" />
            <field name="BudgetALast16" type="long" />
            <field name="BudgetALast15" type="long" />
            <field name="BudgetALast14" type="long" />
            <field name="BudgetALast13" type="long" />
            <field name="BudgetALast12" type="long" />
            <field name="BudgetALast11" type="long" />
            <field name="BudgetALast10" type="long" />
            <field name="BudgetALast09" type="long" />
            <field name="BudgetALast08" type="long" />
            <field name="BudgetALast07" type="long" />
            <field name="BudgetALast06" type="long" />
            <field name="BudgetALast05" type="long" />
            <field name="BudgetALast04" type="long" />
            <field name="BudgetALast03" type="long" />
            <field name="BudgetALast02" type="long" />
            <field name="BudgetALast01" type="long" />
            <field name="BudgetA" type="long" />
            <field name="BudgetANext01" type="long" />
            <field name="BudgetANext02" type="long" />
            <field name="BudgetANext03" type="long" />
            <field name="BudgetANext04" type="long" />
            <field name="BudgetANext05" type="long" />
            <field name="BudgetANext06" type="long" />
            <field name="BudgetANext07" type="long" />
            <field name="BudgetANext08" type="long" />
            <field name="BudgetANext09" type="long" />
            <field name="BudgetANext10" type="long" />
            <field name="BudgetANext11" type="long" />
            <field name="BudgetANext12" type="long" />
            <field name="BudgetANext13" type="long" />
            <field name="BudgetANext14" type="long" />
            <field name="BudgetANext15" type="long" />
            <field name="BudgetANext16" type="long" />
            <field name="BudgetANext17" type="long" />
            <field name="BudgetANext18" type="long" />
            <field name="BudgetBLast29" type="long" />
            <field name="BudgetBLast28" type="long" />
            <field name="BudgetBLast27" type="long" />
            <field name="BudgetBLast26" type="long" />
            <field name="BudgetBLast25" type="long" />
            <field name="BudgetBLast24" type="long" />
            <field name="BudgetBLast23" type="long" />
            <field name="BudgetBLast22" type="long" />
            <field name="BudgetBLast21" type="long" />
            <field name="BudgetBLast20" type="long" />
            <field name="BudgetBLast19" type="long" />
            <field name="BudgetBLast18" type="long" />
            <field name="BudgetBLast17" type="long" />
            <field name="BudgetBLast16" type="long" />
            <field name="BudgetBLast15" type="long" />
            <field name="BudgetBLast14" type="long" />
            <field name="BudgetBLast13" type="long" />
            <field name="BudgetBLast12" type="long" />
            <field name="BudgetBLast11" type="long" />
            <field name="BudgetBLast10" type="long" />
            <field name="BudgetBLast09" type="long" />
            <field name="BudgetBLast08" type="long" />
            <field name="BudgetBLast07" type="long" />
            <field name="BudgetBLast06" type="long" />
            <field name="BudgetBLast05" type="long" />
            <field name="BudgetBLast04" type="long" />
            <field name="BudgetBLast03" type="long" />
            <field name="BudgetBLast02" type="long" />
            <field name="BudgetBLast01" type="long" />
            <field name="BudgetB" type="long" />
            <field name="BudgetBNext01" type="long" />
            <field name="BudgetBNext02" type="long" />
            <field name="BudgetBNext03" type="long" />
            <field name="BudgetBNext04" type="long" />
            <field name="BudgetBNext05" type="long" />
            <field name="BudgetBNext06" type="long" />
            <field name="BudgetBNext07" type="long" />
            <field name="BudgetBNext08" type="long" />
            <field name="BudgetBNext09" type="long" />
            <field name="BudgetBNext10" type="long" />
            <field name="BudgetBNext11" type="long" />
            <field name="BudgetBNext12" type="long" />
            <field name="BudgetBNext13" type="long" />
            <field name="BudgetBNext14" type="long" />
            <field name="BudgetBNext15" type="long" />
            <field name="BudgetBNext16" type="long" />
            <field name="BudgetBNext17" type="long" />
            <field name="BudgetBNext18" type="long" />
            <field name="Concat" type="string" size="14" indexed="true" />
            <field name="System" type="char_short" indexed="true" />
        </fields>
    </table>
    <table>
        <file_num>2</file_num>
        <name>General</name>
        <fields>
            <field name="SequenceNumber" type="long" unsigned="true" />
            <field name="LastModifiedTime" type="time" unsigned="true" />
            <field name="Code" type="string" size="10" indexed="true" />
            <field name="Description" type="string" size="32" />
            <field name="Date" type="date" unsigned="true" />
            <field name="Long" type="long" />
        </fields>
    </table>
    <table>
        <file_num>3</file_num>
        <name>Department</name>
        <fields>
            <field name="SequenceNumber" type="long" unsigned="true" />
            <field name="LastModifiedTime" type="time" unsigned="true" />
            <field name="Code" type="string" size="6" indexed="true" />
            <field name="Description" type="string" size="36" />
            <field name="Classification" type="string" size="6" indexed="true" />
            <field name="Custom1" type="string" size="16" />
            <field name="Custom2" type="string" size="10" />
            <field name="Flags" type="short" />
        </fields>
    </table>
    <table>
        <file_num>4</file_num>
        <name>Link</name>
        <fields>
            <field name="SequenceNumber" type="long" unsigned="true" />
            <field name="LastModifiedTime" type="time" unsigned="true" />
            <field name="Dept" type="string" size="6" indexed="true" />
            <field name="Group" type="string" size="6" indexed="true" />
        </fields>
    </table>
    <table>
        <file_num>5</file_num>
        <name>Transaction</name>
        <fields>
            <field name="SequenceNumber" type="long" unsigned="true" indexed="true" />
            <field name="LastModifiedTime" type="time" unsigned="true" />
            <field name="OurRef" type="string" size="12" indexed="true" />
            <field name="TransDate" type="date" unsigned="true" indexed="true" />
            <field name="EnterDate" type="date" unsigned="true" indexed="true" />
            <field name="DueDate" type="date" unsigned="true" />
            <field name="Period" type="short" indexed="true" />
            <field name="Type" type="string" size="4" indexed="true" />
            <field name="TheirRef" type="string" size="22" />
            <field name="NameCode" type="string" size="12" indexed="true" />
            <field name="Flag" type="string" size="6" />
            <field name="Description" type="string" size="26" />
            <field name="Gross" type="decimal" />
            <field name="Analysis" type="string" size="10" />
            <field name="Contra" type="string" size="8" />
            <field name="ToFrom" type="string" size="26" />
            <field name="Status" type="string" size="2" indexed="true" />
            <field name="Hold" type="boolean" />
            <field name="DatePaid" type="date" unsigned="true" />
            <field name="AmtPaid" type="decimal" />
            <field name="unused" type="char_short" />
            <field name="PayAmount" type="decimal" />
            <field name="Aging" type="short" />
            <field name="TaxAmount" type="decimal" />
            <field name="TaxCycle" type="short" />
            <field name="Recurring" type="boolean" />
            <field name="Printed" type="short" />
            <field name="Flags" type="long" />
            <field name="TaxProcessed" type="decimal" />
            <field name="Salesperson" type="string" size="6" />
            <field name="Colour" type="short" />
            <field name="BankJNSeq" type="long" unsigned="true" />
            <field name="PaymentMethod" type="short" />
            <field name="TimePosted" type="time" unsigned="true" />
            <field name="SecurityLevel" type="short" />
            <field name="User1" type="string" size="12" />
            <field name="User2" type="string" size="12" />
            <field name="User3" type="string" size="12" />
            <field name="PromptPaymentDate" type="date" unsigned="true" />
            <field name="PromptPaymentAmt" type="decimal" />
            <field name="ProdPriceCode" type="string" size="2" />
            <field name="MailingAddress" type="string" size="2" />
            <field name="DeliveryAddress" type="string" size="2" />
            <field name="FreightCode" type="string" size="16" />
            <field name="FreightAmount" type="decimal" />
            <field name="FreightDetails" type="string" size="2" />
            <field name="SpecialBank" type="string" size="2" />
            <field name="SpecialBranch" type="string" size="2" />
            <field name="SpecialAccount" type="string" size="2" />
            <field name="Currency" type="string" size="4" />
            <field name="ExchangeRate" type="double" />
            <field name="EnteredBy" type="string" size="4" />
            <field name="PostedBy" type="string" size="4" />
            <field name="AmtWrittenOff" type="decimal" />
            <field name="OrderTotal" type="decimal" />
            <field name="OrderShipped" type="decimal" />
            <field name="OrderDeposit" type="decimal" />
            <field name="OriginatingOrderSeq" type="long" />
            <field name="CurrencyTransferSeq" type="long" />
            <field name="PromptPaymentTerms" type="short" />
            <field name="PromptPaymentDisc" type="float" />
        </fields>
    </table>
    <table>
        <file_num>6</file_num>
        <name>Detail</name>
        <fields>
            <field name="Detail.SequenceNumber" type="long" unsigned="true" />
            <field name="Detail.LastModifiedTime" type="time" unsigned="true" />
            <field name="Detail.ParentSeq" type="long" indexed="true" />
            <field name="Detail.Sort" type="short" />
            <field name="Detail.Account" type="string" size="14" indexed="true" />
            <field name="Detail.Dept" type="string" size="6" />
            <field name="Detail.PostedQty" type="double" />
            <field name="Detail.TaxCode" type="string" size="4" />
            <field name="Detail.Gross" type="decimal" />
            <field name="Detail.Tax" type="decimal" />
            <field name="Detail.Debit" type="decimal" />
            <field name="Detail.Credit" type="decimal" />
            <field name="Detail.Description" type="string" size="34" />
            <field name="Detail.StockQty" type="double" />
            <field name="Detail.StockCode" type="string" size="16" indexed="true" />
            <field name="Detail.CostPrice" type="double" />
            <field name="Detail.UnitPrice" type="double" />
            <field name="Detail.Statement" type="long" indexed="true" />
            <field name="Detail.JobCode" type="string" size="10" indexed="true" />
            <field name="Detail.SaleUnit" type="string" size="4" />
            <field name="Detail.Discount" type="double" />
            <field name="Detail.Flags" type="short" />
            <field name="Detail.OrderQty" type="double" />
            <field name="Detail.BackorderQty" type="double" />
            <field name="Detail.PrevShipQty" type="double" />
            <field name="Detail.BaseCurrencyNet" type="decimal" />
            <field name="Detail.SerialNumber" type="string" size="2" />
            <field name="Detail.Period" type="short" />
            <field name="Detail.TransactionType" type="char_short" />
            <field name="Detail.SecurityLevel" type="short" />
            <field name="Detail.RevalueQty" type="double" />
            <field name="Detail.StockLocation" type="string" size="4" />
            <field name="Detail.OrderStatus" type="boolean" />
            <field name="Detail.ExpensedTax" type="decimal" />
        </fields>
    </table>
    <table>
        <file_num>7</file_num>
        <name>Log</name>
        <fields>
            <field name="SequenceNumber" type="long" unsigned="true" />
            <field name="LastModifiedTime" type="time" unsigned="true" />
            <field name="Description" type="char_long" />
            <field name="Who" type="string" size="4" />
            <field name="Info1" type="string" size="16" />
            <field name="Info2" type="string" size="16" />
            <field name="Info3" type="string" size="16" />
        </fields>
    </table>
    <table>
        <file_num>8</file_num>
        <name>TaxRate</name>
        <fields>
            <field name="SequenceNumber" type="long" unsigned="true" />
            <field name="LastModifiedTime" type="time" unsigned="true" />
            <field name="TaxCode" type="string" size="4" />
            <field name="PaidAccount" type="string" size="8" />
            <field name="RecAccount" type="string" size="8" />
            <field name="Rate1" type="double" />
            <field name="Date" type="date" unsigned="true" />
            <field name="Rate2" type="double" />
            <field name="Combine" type="short" />
            <field name="CombineRate1" type="double" />
            <field name="CombineRate2" type="double" />
            <field name="GSTReceived" type="decimal" />
            <field name="NetReceived" type="decimal" />
            <field name="GSTPaid" type="decimal" />
            <field name="NetPaid" type="decimal" />
            <field name="RateName" type="string" size="30" />
            <field name="ReportCycleStart" type="short" />
            <field name="ReportCycleEnd" type="short" />
            <field name="ReportDate" type="date" unsigned="true" />
            <field name="PSTReceived" type="decimal" />
            <field name="PSTPaid" type="decimal" />
            <field name="Type" type="short" />
            <field name="Combination" type="string" size="16" />
        </fields>
    </table>
    <table>
        <file_num>9</file_num>
        <name>Message</name>
        <fields>
            <field name="SequenceNumber" type="long" unsigned="true" />
            <field name="LastModifiedTime" type="time" unsigned="true" />
            <field name="StartDate" type="date" unsigned="true" />
            <field name="EndDate" type="date" unsigned="true" />
            <field name="NextDate" type="date" unsigned="true" indexed="true" />
            <field name="Keep" type="boolean" />
            <field name="Ref" type="long" />
            <field name="LastDay" type="byte" />
            <field name="NDaily" type="byte" />
            <field name="NWeekly" type="byte" />
            <field name="NMonthly" type="byte" />
            <field name="Once" type="byte" />
            <field name="XTimes" type="byte" />
            <field name="Forever" type="byte" />
            <field name="Day" type="byte" />
            <field name="Type" type="short" />
            <field name="DayOfWeek" type="byte" />
            <field name="N" type="byte" />
            <field name="X" type="byte" />
            <field name="AvoidWeekends" type="byte" />
            <field name="Reverse" type="byte" />
            <field name="" type="byte" />
            <field name="Message" type="string" size="256" />
            <field name="User" type="string" size="4" />
        </fields>
    </table>
    <table>
        <file_num>10</file_num>
        <name>Name</name>
        <fields>
            <field name="SequenceNumber" type="long" unsigned="true" />
            <field name="LastModifiedTime" type="time" unsigned="true" />
            <field name="Code" type="string" size="12" indexed="true" />
            <field name="Name" type="string" size="30" />
            <field name="Contact" type="string" size="26" />
            <field name="Position" type="string" size="30" />
            <field name="Address1" type="string" size="22" />
            <field name="Address2" type="string" size="22" />
            <field name="Address3" type="string" size="22" />
            <field name="Address4" type="string" size="22" />
            <field name="Delivery1" type="string" size="22" />
            <field name="Delivery2" type="string" size="22" />
            <field name="Delivery3" type="string" size="22" />
            <field name="Delivery4" type="string" size="22" />
            <field name="Phone" type="string" size="20" />
            <field name="Fax" type="string" size="20" />
            <field name="Category1" type="string" size="8" />
            <field name="Category2" type="string" size="8" />
            <field name="Category3" type="string" size="8" />
            <field name="Category4" type="string" size="8" />
            <field name="CustomerType" type="short" indexed="true" />
            <field name="D90Plus" type="decimal" />
            <field name="D60Plus" type="decimal" />
            <field name="D30Plus" type="decimal" />
            <field name="DCurrent" type="decimal" />
            <field name="CCurrent" type="decimal" />
            <field name="DebtorTerms" type="byte" />
            <field name="CreditorTerms" type="byte" />
            <field name="Bank" type="string" size="8" />
            <field name="AccountName" type="string" size="22" />
            <field name="BankBranch" type="string" size="22" />
            <field name="TheirRef" type="string" size="16" />
            <field name="Hold" type="boolean" />
            <field name="RecAccount" type="string" size="8" />
            <field name="PayAccount" type="string" size="8" />
            <field name="Kind" type="short" indexed="true" />
            <field name="CreditLimit" type="long" />
            <field name="Discount" type="decimal" />
            <field name="Comment" type="string" size="24" />
            <field name="SupplierType" type="short" indexed="true" />
            <field name="Colour" type="short" />
            <field name="Salesperson" type="string" size="6" />
            <field name="TaxCode" type="string" size="4" />
            <field name="SplitMode" type="short" />
            <field name="PostCode" type="string" size="12" />
            <field name="State" type="string" size="4" />
            <field name="BankAccountNumber" type="string" size="24" />
            <field name="Currency" type="string" size="4" />
            <field name="PaymentMethod" type="short" />
            <field name="DBalance" type="decimal" />
            <field name="DDI" type="string" size="20" />
            <field name="eMail" type="string" size="30" />
            <field name="Mobile" type="string" size="14" />
            <field name="AfterHours" type="string" size="12" />
            <field name="Contact2" type="string" size="12" />
            <field name="Position2" type="string" size="12" />
            <field name="DDI2" type="string" size="12" />
            <field name="eMail2" type="string" size="22" />
            <field name="Mobile2" type="string" size="14" />
            <field name="AfterHours2" type="string" size="12" />
            <field name="WebURL" type="string" size="10" />
            <field name="ProductPricing" type="string" size="2" />
            <field name="DateOfLastSale" type="date" unsigned="true" />
            <field name="SplitAcct1" type="string" size="14" />
            <field name="SplitAcct2" type="string" size="14" />
            <field name="SplitPercent" type="double" />
            <field name="SplitAmount" type="decimal" />
            <field name="UserNum" type="double" />
            <field name="UserText" type="string" size="8" />
            <field name="CustPromptPaymentTerms" type="short" />
            <field name="CustPromptPaymentDiscount" type="float" />
            <field name="SuppPromptPaymentTerms" type="short" />
            <field name="SuppPromptPaymentDiscount" type="float" />
            <field name="LastPaymentMethod" type="short" />
            <field name="CreditCardNum" type="string" size="20" />
            <field name="CreditCardExpiry" type="string" size="6" />
            <field name="CreditCardName" type="string" size="20" />
            <field name="TaxNumber" type="string" size="20" />
            <field name="Custom1" type="string" size="16" />
            <field name="Custom2" type="string" size="16" />
            <field name="Custom3" type="string" size="16" />
            <field name="Custom4" type="string" size="16" />
            <field name="DeliveryPostcode" type="string" size="12" />
            <field name="DeliveryState" type="string" size="4" />
            <field name="AddressCountry" type="string" size="16" />
            <field name="DeliveryCountry" type="string" size="16" />
            <field name="ReceiptMethod" type="short" />
            <field name="ABUID" type="string" size="2" />
            <field name="BankParticulars" type="string" size="2" />
            <field name="Flags" type="short" />
        </fields>
    </table>
    <table>
        <file_num>11</file_num>
        <name>Payments</name>
        <fields>
            <field name="SequenceNumber" type="long" unsigned="true" />
            <field name="LastModifiedTime" type="time" unsigned="true" />
            <field name="InvoiceID" type="long" indexed="true" />
            <field name="CashTrans" type="long" indexed="true" />
            <field name="Date" type="date" unsigned="true" />
            <field name="GSTCycle" type="short" />
            <field name="Amount" type="decimal" />
        </fields>
    </table>
    <table>
        <file_num>13</file_num>
        <name>Product</name>
        <fields>
            <field name="SequenceNumber" type="long" unsigned="true" />
            <field name="LastModifiedTime" type="time" unsigned="true" />
            <field name="Code" type="string" size="16" indexed="true" />
            <field name="SuppliersCode" type="string" size="20" />
            <field name="Supplier" type="string" size="12" />
            <field name="Description" type="string" size="38" />
            <field name="Comment" type="string" size="30" />
            <field name="Category1" type="string" size="8" />
            <field name="Category2" type="string" size="8" />
            <field name="Category3" type="string" size="8" />
            <field name="Category4" type="string" size="8" />
            <field name="SalesAcct" type="string" size="14" />
            <field name="COGAcct" type="string" size="14" />
            <field name="StockAcct" type="string" size="14" />
            <field name="UserNum" type="double" />
            <field name="SellUnit" type="string" size="4" />
            <field name="SellPrice" type="double" />
            <field name="Plussage" type="float" />
            <field name="BuyWeight" type="float" />
            <field name="BuyUnit" type="string" size="4" />
            <field name="CostPrice" type="double" />
            <field name="ConversionFactor" type="double" />
            <field name="MarginWarning" type="double" />
            <field name="SellDiscount" type="double" />
            <field name="SellDiscountMode" type="short" />
            <field name="UserText" type="string" size="8" />
            <field name="StockOnHand" type="double" />
            <field name="StockValue" type="double" />
            <field name="MinBuildQty" type="double" />
            <field name="NormalBuildQty" type="double" />
            <field name="ReorderLevel" type="double" />
            <field name="JobPricingMode" type="short" />
            <field name="Flags" type="long" />
            <field name="Colour" type="short" />
            <field name="UseMultiplePrices" type="boolean" />
            <field name="SellPriceB" type="double" />
            <field name="SellPriceC" type="double" />
            <field name="SellPriceD" type="double" />
            <field name="SellPriceE" type="double" />
            <field name="SellPriceF" type="double" />
            <field name="QtyBreak1" type="float" />
            <field name="QtyBreak2" type="float" />
            <field name="QtyBreak3" type="float" />
            <field name="QtyBreak4" type="float" />
            <field name="QtyBrkSellPriceA1" type="double" />
            <field name="QtyBrkSellPriceA2" type="double" />
            <field name="QtyBrkSellPriceA3" type="double" />
            <field name="QtyBrkSellPriceA4" type="double" />
            <field name="QtyBrkSellPriceB1" type="double" />
            <field name="QtyBrkSellPriceB2" type="double" />
            <field name="QtyBrkSellPriceB3" type="double" />
            <field name="QtyBrkSellPriceB4" type="double" />
            <field name="Type" type="string" size="2" indexed="true" />
            <field name="Count" type="double" />
            <field name="OnOrder" type="double" />
            <field name="StockTakeStartQty" type="double" />
            <field name="StockTakeValue" type="double" />
            <field name="StockTakeNewQty" type="double" />
            <field name="BarCode" type="string" size="20" indexed="true" />
            <field name="BuyPriceCurrency" type="string" size="4" />
            <field name="BuyPrice" type="double" />
            <field name="Custom1" type="string" size="16" />
            <field name="Custom2" type="string" size="16" />
            <field name="Custom3" type="string" size="16" />
            <field name="Custom4" type="string" size="16" />
            <field name="BuyTaxCode" type="string" size="4" />
            <field name="SellTaxCode" type="string" size="4" />
            <field name="LeadTimeDays" type="short" />
            <field name="Hash" type="short" indexed="true" />
            <field name="SellWeight" type="float" />
        </fields>
    </table>
    <table>
        <file_num>15</file_num>
        <name>Job</name>
        <fields>
            <field name="SequenceNumber" type="long" unsigned="true" />
            <field name="LastModifiedTime" type="time" unsigned="true" />
            <field name="Code" type="string" size="10" indexed="true" />
            <field name="Description" type="string" size="40" />
            <field name="Client" type="string" size="12" />
            <field name="Comment" type="string" size="40" />
            <field name="StartDate" type="date" unsigned="true" />
            <field name="Markup" type="double" />
            <field name="Quote" type="decimal" />
            <field name="Billed" type="decimal" />
            <field name="Status" type="char_short" indexed="true" />
            <field name="Flags" type="short" />
            <field name="Colour" type="short" />
            <field name="WIPAccount" type="string" size="14" />
            <field name="Category1" type="string" size="8" />
            <field name="Category2" type="string" size="8" />
            <field name="Category3" type="string" size="8" />
            <field name="Category4" type="string" size="8" />
            <field name="OrderNum" type="string" size="12" />
            <field name="Contact" type="string" size="20" />
            <field name="Phone" type="string" size="20" />
            <field name="EndDate" type="date" unsigned="true" />
            <field name="Manager" type="string" size="4" />
            <field name="PercentComplete" type="float" />
            <field name="Variations" type="decimal" />
            <field name="RetentionsHeld" type="decimal" />
            <field name="RetentionsOwing" type="decimal" />
            <field name="ProductPricing" type="string" size="2" />
            <field name="RetainPercent" type="float" />
            <field name="UserNum" type="double" />
            <field name="UserText" type="string" size="8" />
            <field name="Project" type="string" size="10" />
            <field name="TargetDate" type="date" unsigned="true" />
            <field name="Custom1" type="string" size="10" />
            <field name="Custom2" type="string" size="10" />
            <field name="Custom3" type="string" size="16" />
            <field name="Custom4" type="string" size="16" />
        </fields>
    </table>
    <table>
        <file_num>17</file_num>
        <name>Build</name>
        <fields>
            <field name="SequenceNumber" type="long" unsigned="true" />
            <field name="LastModifiedTime" type="time" unsigned="true" />
            <field name="Build.ProductSeq" type="long" indexed="true" />
            <field name="Build.Order" type="short" />
            <field name="Build.Qty" type="double" />
            <field name="Build.PartCode" type="string" size="16" />
            <field name="Build.Flags" type="short" />
        </fields>
    </table>
    <table>
        <file_num>18</file_num>
        <name>JobSheet</name>
        <fields>
            <field name="SequenceNumber" type="long" unsigned="true" />
            <field name="LastModifiedTime" type="time" unsigned="true" />
            <field name="Job" type="string" size="10" indexed="true" />
            <field name="Qty" type="double" />
            <field name="Resource" type="string" size="16" indexed="true" />
            <field name="Date" type="date" unsigned="true" />
            <field name="CostCentre" type="string" size="6" unsigned="true" />
            <field name="Account" type="string" size="8" />
            <field name="Period" type="short" />
            <field name="Units" type="string" size="4" />
            <field name="CostPrice" type="decimal" />
            <field name="SellPrice" type="decimal" />
            <field name="Memo" type="string" size="40" />
            <field name="DestTransSeq" type="long" />
            <field name="SourceTransSeq" type="long" indexed="true" />
            <field name="DateEntered" type="date" unsigned="true" />
            <field name="Flags" type="short" />
            <field name="Colour" type="short" />
            <field name="Status" type="char_short" indexed="true" />
            <field name="Type" type="char_short" />
            <field name="Analysis" type="string" size="10" />
            <field name="BillValue" type="decimal" />
            <field name="ActivityCode" type="string" size="10" />
            <field name="Comments" type="string" size="40" />
            <field name="Batch" type="long" />
            <field name="EnteredBy" type="string" size="4" indexed="true" />
        </fields>
    </table>
    <table>
        <file_num>19</file_num>
        <name>BankRecs</name>
        <fields>
            <field name="SequenceNumber" type="long" unsigned="true" indexed="true" />
            <field name="LastModifiedTime" type="time" unsigned="true" />
            <field name="Account" type="string" size="8" />
            <field name="Opening" type="decimal" />
            <field name="Closing" type="decimal" />
            <field name="Statement" type="short" />
            <field name="Date" type="date" unsigned="true" />
            <field name="ReconciledTime" type="time" unsigned="true" />
            <field name="Discrepancy" type="decimal" />
        </fields>
    </table>
    <table>
        <file_num>22</file_num>
        <name>AutoSplit</name>
        <fields>
            <field name="SequenceNumber" type="long" unsigned="true" />
            <field name="LastModifiedTime" type="time" unsigned="true" />
            <field name="MatchFunction" type="string" size="256" />
            <field name="SplitMode" type="long" />
            <field name="SplitAcct1" type="string" size="14" />
            <field name="SplitAcct2" type="string" size="14" />
            <field name="SplitAmount1" type="double" />
            <field name="SplitAmount2" type="double" />
            <field name="SplitAcct3" type="string" size="14" />
            <field name="SplitAcct4" type="string" size="14" />
            <field name="SplitAmount3" type="double" />
            <field name="MatchName" type="string" size="12" />
            <field name="Priority" type="short" />
        </fields>
    </table>
    <table>
        <file_num>23</file_num>
        <name>Memo</name>
        <fields>
            <field name="SequenceNumber" type="long" unsigned="true" />
            <field name="LastModifiedTime" type="time" unsigned="true" />
            <field name="Memo.NameSeq" type="long" indexed="true" />
            <field name="Memo.Order" type="short" />
            <field name="Memo.Date" type="date" unsigned="true" />
            <field name="Memo.RecallDate" type="date" unsigned="true" indexed="true" />
            <field name="Memo.Flags" type="short" />
            <field name="Memo.Text" type="string" size="80" />
        </fields>
    </table>
    <table>
        <file_num>24</file_num>
        <name>User</name>
        <fields>
            <field name="SequenceNumber" type="long" unsigned="true" />
            <field name="LastModifiedTime" type="time" unsigned="true" />
            <field name="Key" type="string" size="10" indexed="true" />
            <field name="Data" type="string" size="246" />
        </fields>
    </table>
    <table>
        <file_num>25</file_num>
        <name>OffLedger</name>
        <fields>
            <field name="SequenceNumber" type="long" unsigned="true" />
            <field name="LastModifiedTime" type="time" unsigned="true" />
            <field name="Kind" type="string" size="4" indexed="true" />
            <field name="Name" type="string" size="16" indexed="true" />
            <field name="Description" type="string" size="40" />
            <field name="Flags" type="long" />
            <field name="" type="string" size="8" />
            <field name="" type="string" size="8" />
            <field name="Balance91" type="double" />
            <field name="Balance90" type="double" />
            <field name="Balance89" type="double" />
            <field name="Balance88" type="double" />
            <field name="Balance87" type="double" />
            <field name="Balance86" type="double" />
            <field name="Balance85" type="double" />
            <field name="Balance84" type="double" />
            <field name="Balance83" type="double" />
            <field name="Balance82" type="double" />
            <field name="Balance81" type="double" />
            <field name="Balance80" type="double" />
            <field name="Balance79" type="double" />
            <field name="Balance78" type="double" />
            <field name="Balance77" type="double" />
            <field name="Balance76" type="double" />
            <field name="Balance75" type="double" />
            <field name="Balance74" type="double" />
            <field name="Balance73" type="double" />
            <field name="Balance72" type="double" />
            <field name="Balance71" type="double" />
            <field name="Balance70" type="double" />
            <field name="Balance69" type="double" />
            <field name="Balance68" type="double" />
            <field name="Balance67" type="double" />
            <field name="Balance66" type="double" />
            <field name="Balance65" type="double" />
            <field name="Balance64" type="double" />
            <field name="Balance63" type="double" />
            <field name="Balance62" type="double" />
            <field name="Balance61" type="double" />
            <field name="Balance60" type="double" />
            <field name="Balance59" type="double" />
            <field name="Balance58" type="double" />
            <field name="Balance57" type="double" />
            <field name="Balance56" type="double" />
            <field name="Balance55" type="double" />
            <field name="Balance54" type="double" />
            <field name="Balance53" type="double" />
            <field name="Balance52" type="double" />
            <field name="Balance51" type="double" />
            <field name="Balance50" type="double" />
            <field name="Balance49" type="double" />
            <field name="Balance48" type="double" />
            <field name="Balance47" type="double" />
            <field name="Balance46" type="double" />
            <field name="Balance45" type="double" />
            <field name="Balance44" type="double" />
            <field name="Balance43" type="double" />
            <field name="Balance42" type="double" />
            <field name="Balance41" type="double" />
            <field name="Balance40" type="double" />
            <field name="Balance39" type="double" />
            <field name="Balance38" type="double" />
            <field name="Balance37" type="double" />
            <field name="Balance36" type="double" />
            <field name="Balance35" type="double" />
            <field name="Balance34" type="double" />
            <field name="Balance33" type="double" />
            <field name="Balance32" type="double" />
            <field name="Balance31" type="double" />
            <field name="Balance30" type="double" />
            <field name="Balance29" type="double" />
            <field name="Balance28" type="double" />
            <field name="Balance27" type="double" />
            <field name="Balance26" type="double" />
            <field name="Balance25" type="double" />
            <field name="Balance24" type="double" />
            <field name="Balance23" type="double" />
            <field name="Balance22" type="double" />
            <field name="Balance21" type="double" />
            <field name="Balance20" type="double" />
            <field name="Balance19" type="double" />
            <field name="Balance18" type="double" />
            <field name="Balance17" type="double" />
            <field name="Balance16" type="double" />
            <field name="Balance15" type="double" />
            <field name="Balance14" type="double" />
            <field name="Balance13" type="double" />
            <field name="Balance12" type="double" />
            <field name="Balance11" type="double" />
            <field name="Balance10" type="double" />
            <field name="Balance09" type="double" />
            <field name="Balance08" type="double" />
            <field name="Balance07" type="double" />
            <field name="Balance06" type="double" />
            <field name="Balance05" type="double" />
            <field name="Balance04" type="double" />
            <field name="Balance03" type="double" />
            <field name="Balance02" type="double" />
            <field name="Balance01" type="double" />
            <field name="Balance00" type="double" />
            <field name="Budget29" type="double" />
            <field name="Budget28" type="double" />
            <field name="Budget27" type="double" />
            <field name="Budget26" type="double" />
            <field name="Budget25" type="double" />
            <field name="Budget24" type="double" />
            <field name="Budget23" type="double" />
            <field name="Budget22" type="double" />
            <field name="Budget21" type="double" />
            <field name="Budget20" type="double" />
            <field name="Budget19" type="double" />
            <field name="Budget18" type="double" />
            <field name="Budget17" type="double" />
            <field name="Budget16" type="double" />
            <field name="Budget15" type="double" />
            <field name="Budget14" type="double" />
            <field name="Budget13" type="double" />
            <field name="Budget12" type="double" />
            <field name="Budget11" type="double" />
            <field name="Budget10" type="double" />
            <field name="Budget09" type="double" />
            <field name="Budget08" type="double" />
            <field name="Budget07" type="double" />
            <field name="Budget06" type="double" />
            <field name="Budget05" type="double" />
            <field name="Budget04" type="double" />
            <field name="Budget03" type="double" />
            <field name="Budget02" type="double" />
            <field name="Budget01" type="double" />
            <field name="Budget00" type="double" />
            <field name="BudgetNext01" type="double" />
            <field name="BudgetNext02" type="double" />
            <field name="BudgetNext03" type="double" />
            <field name="BudgetNext04" type="double" />
            <field name="BudgetNext05" type="double" />
            <field name="BudgetNext06" type="double" />
            <field name="BudgetNext07" type="double" />
            <field name="BudgetNext08" type="double" />
            <field name="BudgetNext09" type="double" />
            <field name="BudgetNext10" type="double" />
            <field name="BudgetNext11" type="double" />
            <field name="BudgetNext12" type="double" />
            <field name="BudgetNext13" type="double" />
            <field name="BudgetNext14" type="double" />
            <field name="BudgetNext15" type="double" />
            <field name="BudgetNext16" type="double" />
            <field name="BudgetNext17" type="double" />
            <field name="BudgetNext18" type="double" />
            <field name="LinkedAccountU" type="string" size="14" />
            <field name="LinkedAccountR" type="string" size="14" />
            <field name="PreferredBankCR" type="string" size="8" />
            <field name="PreferredBankCP" type="string" size="8" />
        </fields>
    </table>
    <table>
        <file_num>26</file_num>
        <name>Filter</name>
        <fields>
            <field name="SequenceNumber" type="long" unsigned="true" />
            <field name="LastModifiedTime" type="time" unsigned="true" />
            <field name="File" type="short" />
            <field name="TabSet" type="short" />
            <field name="Tab" type="short" />
            <field name="Type" type="short" />
            <field name="User" type="string" size="4" />
            <field name="Name" type="string" size="32" />
            <field name="FilterFunction" type="string" size="256" />
            <field name="Order" type="short" />
        </fields>
    </table>
    <table>
        <file_num>27</file_num>
        <name>Stickies</name>
        <fields>
            <field name="SequenceNumber" type="long" unsigned="true" />
            <field name="LastModifiedTime" type="time" unsigned="true" />
            <field name="FileNum" type="short" indexed="true" />
            <field name="Colour" type="short" />
            <field name="User" type="string" size="4" />
            <field name="OwnerSeq" type="long" indexed="true" />
            <field name="Message" type="string" size="158" />
            <field name="Flags" type="short" />
        </fields>
    </table>
    <table>
        <file_num>28</file_num>
        <name>Lists</name>
        <fields>
            <field name="SequenceNumber" type="long" unsigned="true" />
            <field name="LastModifiedTime" type="time" unsigned="true" />
            <field name="ListID" type="string" size="16" indexed="true" />
            <field name="Item" type="string" size="16" indexed="true" />
            <field name="Comment" type="string" size="68" />
        </fields>
    </table>
    <table>
        <file_num>29</file_num>
        <name>Login</name>
        <fields>
            <field name="SequenceNumber" type="long" unsigned="true" />
            <field name="LastModifiedTime" type="time" unsigned="true" />
            <field name="Initials" type="string" size="4" indexed="true" />
            <field name="Name" type="string" size="32" />
            <field name="Password" type="string" size="34" />
            <field name="" type="string" size="158" />
            <field name="Privileges" type="string" size="66" />
            <field name="email" type="string" size="32" />
            <field name="Flags" type="short" />
            <field name="Category" type="string" size="8" />
            <field name="email_extra" type="string" size="14" />
        </fields>
    </table>
    <table>
        <file_num>30</file_num>
        <name>User2</name>
        <fields>
            <field name="SequenceNumber" type="long" unsigned="true" />
            <field name="LastModifiedTime" type="time" unsigned="true" />
            <field name="DevKey" type="long" unsigned="true" indexed="true" />
            <field name="Key" type="string" size="28" indexed="true" />
            <field name="Int1" type="long" />
            <field name="Int2" type="long" />
            <field name="Float1" type="double" />
            <field name="Float2" type="double" />
            <field name="Date1" type="date" unsigned="true" />
            <field name="Date2" type="date" unsigned="true" />
            <field name="Text1" type="string" size="20" />
            <field name="Text2" type="string" size="20" />
            <field name="Text" type="string" size="152" />
        </fields>
    </table>
</tables>
Posted in Database | Comments Off on Schema

Columnar reports

The MoneyWorks report writer makes it easy to make reports where the columns contain time-based values (such as actual year-to-date, or annual budget). But what about where you want something else, such as departments, classifications or different types of general ledger code?

Departments as Columns

Consider for example where we have four departments in a group called SHOPS representing branches, say NORTH, EAST, SOUTH and WEST, and want a report with a separate column for each branch showing year-to-date values.

For an explanation of how to achieve this in a custom report, please see the PDF article linked below:

Columnar_Reports.pdf

Posted in Reporting | Comments Off on Columnar reports

Interfacing with MS Office

Did you know that MoneyWorks works well with Microsoft Office? You can pull reports directly into Excel, mail merge directly into Word, set your budgets straight from Excel and more.

To show you how this works, we've provided some sample Excel and Word documents. You can download these and use them "as is" (they are useful in their own right), or you are welcome to explore the associated VBA code and alter them for your own purposes.

Important note: If you are running 64 bit Office you must also run 64 bit MoneyWorks.

The samples are for Windows, and include:

Budgeting

A sample Excel spreadsheet that allows you to extract and set budgets in the currently open MoneyWorks document. Two Excel functions are implemented, GetBalance and GetMovement. These extract balance and movement data for the nominated accounts. In addition a macro is provided that extracts actual information for the named accounts over the named time periods, allows it to be altered, and then resubmitted as either MoneyWorks A or B budgets.

Do MoneyWorks Report

Two spreadsheets to extract a MoneyWorks report and place it directly onto the spreadsheet.

The Excel Report spreadsheet should be placed in the "Scripts" folder in the "MoneyWorks Custom Plug-ins" folder (Excel and Word documents placed in this folder are directly accessible through the Command menu in MoneyWorks). When started the spreadsheet will ask for a report (you can choose whether to use one in the Standard or Custom plug-ins folders), and this report will then be placed starting at the currently selected cell of the spreadsheet.

The MoneyWorks Report spreadsheet is similar to the "Excel Report" spreadsheet, except that this will not automatically start when opened (so don't put it into the "MoneyWorks Custom Plug-ins/Scripts" directory). Click the button to be prompted for a report, which will be placed into the current cell of the spreadsheet.

Interest Calculation

This Excel template extracts the current debtor information from the open MoneyWorks document, and works out the interest payable based on the nominated rate and the minimum balance (only debtors with overdue balances greater than the minimum are applicable for interest). The amount of interest due is displayed, and you are prompted as to whether you want to take these charges back into MoneyWorks (as invoices) or not. Note that for MoneyWorks to be able to import these interest invoices, you must put the import map file "InterestImportMap.impo" into the "Import Maps" folder in your "MoneyWorks Custom Plug-ins" folder.

Mail Merge

A Word document that provides a direct mail merge with MoneyWorks. Place this file into your "Scripts" folder in your "MoneyWorks Custom Plug-ins" folder and it will appear at the bottom of the Command menu in MoneyWorks. To activate the mail merge, highlight the records in the MoneyWorks Names file that you wish to merge against, and choose "MoneyWorks Mailmerge" from the bottom of the Commands menu. You will have the opportunity to modify the mail merge letter, and then press "Ctrl-Shift-M" to complete the merge.

Overpayment schedule

Extracts a list of overpayments (unallocated debtor receipts) from MoneyWorks and places them in the spreadsheet, allowing you to see who has overpaid what and when.

Ratio Viewer

Graphs the Current Ratio and Liquidity Ratio of the currently open MoneyWorks documents. These ratios (and others) are often used to monitor the health of an organisation.

Note that all these Excel and Word documents need to have macros enabled before they can operate with MoneyWorks. When you open one, you will be warned that it contains a macro - you should click "Enable Macros". Needless to say, the documents are provided "as is", and Cognito Software Ltd takes no responsibility for any loss or damage caused in the extremely unlikely event that they misbehave.

The download file is a zipped archive of the sample Office documents in Excel and Word. These are done in Office 2000 -- if you have Office 97, you can still open and look at these, but the macros will need to be altered for them to be able to run.

Download Office 2000 templates (140K, Windows Only)

Note: You will need the full version of MoneyWorks for Windows version 3.0.4 (or later) to be able to use these (they will not work with the demo).

Posted in COM/VBS | Comments Off on Interfacing with MS Office

Interfacing to MoneyWorks using COM/VBS

It is possible to attach front-end data entry systems, external data analysis, executive query facilities etc to MoneyWorks using Visual Basic (or other COM/OLE Automation-compliant scripting languages).

The commands

Open:    Open the specified document

Usage:

Open  (path as string)  ' list of objects to open

Example:

mwObject.Open ("C:\My Document\XYZ Accounts.mwd3")

This will
open the specified document, closing any currently open document first. This command can also be used to open report files &c (but this is not very useful)

This can also be used to make network connections using the moneyworks:// URL scheme. See
MoneyWorks URL Scheme

Possible errors:

10500 MoneyWorks can not service OLE requests at this time (modal dialog up)

Quit: Quit application

Example:

mwObject.Quit()

Asks
MoneyWorks to quit.

Possible errors:

10500 MoneyWorks can not service OLE requests at this time (modal dialog up)
10505 MoneyWorks did not quit (user may have aborted)

ImportFile:
Imports data from a text file using a specified import map.

Usage:

boolVar = ImportFile(textFilePath as string, mapNameOrPath as string)

Example:

isok = mwObject.ImportFile ("C:\My Documents\names.txt", "NameMap.impo")

This will import the data from the text file. You must already have set up and saved an import map to suit the data being imported. MoneyWorks determines where the records are to go from the import map (i.e. if its a Name import map, they will be names). If any errors are encountered with the data, the entire import is aborted, and your script will get an error number 10503.

ImportText
Imports data from a string using a specified import map.

Usage:

boolVar = ImportText(data as string, mapNameOrPath as string)

Example:

isok = mwObject.ImportText ("Fred" & Chr(9) & "Fred Bloggs" & Chr(9) & "2" & Chr(13), "C:\Files\MyMap.impo")

In this case,
the text to be imported is supplied directly to the importtext command. (Here, the import map would be set up to accept the three fields)

Error numbers you should be prepared to handle when importing:

10501 The named import map could not be found
10503 Errors in import: non-specific
10506 No document is open

MoneyWorks Gold 4.0.6 and later:

The mapNameOrPath parameter may be xml text containg a single "args" tag with the following attributes:

<?xml version="1.0"?>
<args file="transaction"
   map="updatemap"
   update="true"
   post="true"
   seqnum="999"/>

Yes, the <?xml version="1.0"?> is required.

file must be present. Useful values are "transaction", "account", "user", or "build". You can import into other files this way but there is no point—just use the regular syntax. If it's "account", the import data should be in the same format you get when you Copy accounts from the accounts list.

map must specify the name of an import map in the Plug-Ins if the file is "transaction".

update is optional for transactions. If true the import data must specify a single invoice to replace an existing transaction whose sequence number is specified using the seqnum attribute. If the invoice identified by seqnum is not posted, then it gets deleted upon successful import of the new transaction (new one effectively replaces it). If the invoice is posted (and providing any payments are not processed for GST), it is cancelled. If there were any payments on it, they become overpayments which may then be (manually) allocated to the new (or any other) invoice.

post is optional for transactions. Transactions are posted on successful completion of the import

Note that from Applescript, the quotes in the xml will need to be escaped with a \

If the file is "build", You are importing build recipe data for manufactured products. The import data must contain the fields: ProductCode, Qty, PartCode in that order, tab-delimited.

If the file is "user", you are importing any persistent data that you may need to store—usually in support of your external system—the import data must contain the fields: Key, Data, in that order, tab-delimited (key is up to 9 chars (must not start with '#')). Data can be up to 255 chars.

Export: export data from specified file

Usage:

strVar = Export (filename as string, searchExpr as string, destPath as string)

[Result: anything] ' if no destination file is specified, reply is tab-delimited text of records

Exporting is even more versatile than importing. Some of the variations are shown below:

Example 1:

rsltStr = mwObject.Export ( "Transaction", "Gross > 0", "")

This returns the matching transaction records as a tab-delimited string. You get every field from the record, including some gobbledgook ones that won't mean much to you.

Note that the result (even if it is an empty string must be assigned to a string variable (this is only because of the idiosyncratic VB syntax).

Example 2:

rsltStr = mwObject.Export ("Job", "", "C:\Some Jobs.txt")

This exports all job records (since there is no search specification) to a file called "Some Jobs" on the hard disk. If the destination file already exists, MoneyWorks will overwrite the file with the data, obliterating whatever was in the file before. Take Care.

Special Searches

Using "=" as the search expression will export a single "record" containing just the field names for the file

Using "*" as the search expression will give you the highlighted records in the main list window belonging to the file you have asked for, or all records if there is no highlighted selection

Using "**" as the search expression will give you the highlighted records in the main list window belonging to the file you have asked for or none if there is no highlighted selection.

The export syntax allows the 'filename' parameter to contain formatting information that specifies what is to be exported:

"TableName[.sortfield[-]][#formatstring]"

sortField can be included to sort the export by that field

sortfield can have a "-" appended to specify descending sort

formatstring can specify what to export. Everything in the format string is returned verbatim except for anything inside [...] which is treated as an expression which can reference the fields of the file being exported. Thus if you want tab-delimited, then put tabs between the expressions. You can use metacharacters \t \r \n \xHH (hex) or \\. Note that since Applescript expands the same metacharacters, you are best to use meta-metacharacters in applescripts, e.g. \\t \\r \\x0a etc

As of v6.1.1, If the format string is exactly the text "xml", "xml-terse", or "xml-verbose" then the records will be exported as xml.

Examples

mwObject.export("Name", "", "") ' same as usual
mwObject.Export( "Name.Code-", "', "") ' export in usual format but sorted descending by code 
mwObject.export("Name.Code-#[Code],[Phone]\\r", "", "") ' export code and phone number separated by a comma with lines delimited by a Return character
mwObject.export("Name.Code-#\"[Code]\",\"[Phone]\"\\r\\n", "", "") ' as above, but fields are quoted, and line delimiter is MSDOS-style
mwObject.export("Ledger.concat#\"[AccountCode + if(Department != ``, `-` + Department, ``)]\",\"[Lookup(AccountCode, `Account.Description`)+ if(Department != ``, ` (` + Lookup(Department, `Department.Description`) + `)`, ``)]\",\"Y\",\"[Lookup(AccountCode, `Account.TaxCode`)]\"\\r", "", "") ' exports account codes in banklink format 
mwObject.export("Name#xml", "", "") ' export as xml

Possible errors:

10502 The logical file name (i.e. "Job" in the above example) is not valid (you may have misspelled it)
10504 Bad search expression. MW could not do the search (try it out in the advanced Find dialog box to make sure it works)
10506 No document is open

DoReport: run a named MoneyWorks report

Usage:

DoReport(reportName as string, startDate as string, endDate as string, outputMode as integer, destinationFilePath as string, jobDialogs as Boolean)

startDate: a date (as text, e.g. "31/3/96") within the starting period to run the report for

endDate: a
date (as text, e.g. "31/3/96") within the ending period to run the report for

outputMode: where to send the report : 1 = print, 2 = preview, 3 = export, 0 = return text

destinationFilePath: the text file to export into (if output option is text file)

jobDialogs: if false, no dialogs are shown

Result: if outputMode is not 1..3, result is tab delimited text of report, otherwise it is an empty string

Example

strRslt = mwObj.DoReport("Profit Report", "1/4/96", "1/4/96", 3, "C:\EIS folder\Profit rep.txt", FALSE)

This runs the reports for the (entire) period in which the date 1/4/96 falls. The result is exported to the text file and the settings dialogs are bypassed (the user does not need to do anything). Any settings you want (except the period range) must already have been set up in the report. If you need to do the same report with different settings, save copies of the report with those settings already set.

NOTE: Only reports of type .CREP can be run this way.

Possible errors:

10500 MoneyWorks can not service OLE requests at this time (modal dialog up)
10506 No document is open
10507 Report name not recognised
10508 User cancelled report (this can happen even if you suppress the dialogs)

Evaluate: Evaluate an expression using the built-in expression parser

Usage:

Evaluate expressionText

Example:

mwObj.Evaluate("Today()")

returns today's date (as text)

mwObj.Evaluate( "1 + 1" )

returns "2"

mwObj.Evaluate("Lookup(`1000`, `Account.Descripton`)")

Returns the name of account 1000. Note that quotes in the expression have been done using backquotes ` instead of ". MoneyWorks treats ` as " for this purpose. In VB you can also embed a " in text by doubling it, e.g. ("Lookup(""1000"", ""Account.Descripton"")")

Example visual basic program

Dim mwObj As MoneyWorksApplication
Dim x As String

Sub test()
Set mwObj = GetObject("", "MoneyWorks.Application") ' attach to running MW
mwObj.Open("c:\Users\Rowan\Documents\MoneyWorks\Acme Widgets Gold.mwd7")
x = mwObj.ImportFile("C:\import text.txt", "NameMap.impo")
mwObj.Quit
End Sub

Posted in COM/VBS | Comments Off on Interfacing to MoneyWorks using COM/VBS

Deimplemented messages in external helper scripts

In MoneyWorks 7, the following messages are no longer sent to external helper scripts.

OpenedDocument
AllowCloseDocument
ClosedDocument
AllowSaveDocument
SavedDocument

The following messages are still sent to an external helper script. The UserLoggedIn/UserLoggingOut are not sent even if password protection is not enabled. External helper scripts see these messages before internal (MWScript) scripts do.

Load
Unload
UserLoggedIn
UserLoggingOut
Before
Validate
Cancel
After
ValidateField
ValidateCell
WantMessages
ExitedField
ExitedCell
PostedTransaction
GetScriptIdentifier
Posted in AppleScript, COM/VBS | Comments Off on Deimplemented messages in external helper scripts

Registering External Helper Scripts on 64-bit Windows

The MoneyWorks GUI app runs in 32-bit mode, so external Helper scripts need to be registered as 32 bit.

The following batch file will register a Helper.wsc in your custom plugins on 64-bit Windows 7.

set REGTOOL="C:\Windows\SYSWOW64\REGSVR32.EXE"
set TARGET="C:\Users\YOURUSERNAME\Documents\MoneyWorks Custom Plug-Ins\Scripts\Helper.wsc"
set ENGINE="C:\Windows\SYSWOW64\scrobj.dll"
%REGTOOL% /i:%TARGET% %ENGINE%

You'll need to "Run as Administrator"

Posted in COM/VBS | Comments Off on Registering External Helper Scripts on 64-bit Windows

Downloads

MoneyWorks Automation Guide

Manpage.pdf

CLI PHP example (OS X)

PHP source

FileMakerGo and mwRest sample (460k)

Plug-ins and tutorial for FileMaker 7 - 10 (300k)

FileMaker Pro 5.5 - 7 Tutorial (350k)

Posted in Download | Comments Off on Downloads