Formatting the eBAS with XSL

Tom Worthington FACS

Visiting Fellow, Department of Computer Science, Australian National University, Canberra and Director of Publications For the Australian Computer Society

This document is Version 2.0, 24 September 2007: http://www.tomw.net.au/2002/atoxml.html

Summary

This is a demonstration of how XML transactions can be transformed into printable documents, as proposed in "Documents and databases: Making sense of developments in eBusiness, eCommerce, ePublishing and eLaw" (2002).

The Australian Taxation Office (ATO) provides specifications of electronic versions of tax forms on their Software Developers Homepage. This includes the Business Activity Statement (BAS) for to the Goods and Services Tax (GST):

Description: Specifications for electronic version of Activity Statement Form Types for
Business Activity Statement
Annual GST Return
Instalment Activity Statement
GST Calculation Worksheet for BAS.
From: Electronic Activity Statement Specifications, Version 2.4, Software Developers Homepage, ATO, May 2002, URL: http://ato.gov.au/softwaredevelopers

This document is provided for accounting software developers to incorporate the interface into their systems. While there are differences between the paper and electronic versions of the forms, it is possible to print out the electronic form in a similar format to the paper one, without the use of accounting software. As well as simplifying the systems needed for e-commerce (particularly small business) printable transactions can make the more acceptable for non-technical people.

The Australian Taxation Office (ATO), provide a Business Portal for submitting XML forms. The user enters their data in an accounting package, which generates an XML file in an ATO specified format. The file can be displayed in a web browser and then submitted to the portal.

Overview of the ATO Documentation

The ATO have modified their approach to use of XML. Previously the XML format closely related to the fields on the paper form and how they were used. The new format is a more abstract, and briefer, description of the data. An example from the ATO:

<FIELD ID="fG1">
<VALUE>2564125</VALUE>
<VISIBILITY>normal</VISIBILITY>
<IS_EDITABLE>true</IS_EDITABLE>
</FIELD>

Modified XML file format:

<GST_TOTAL_SALES>2564125</GST_TOTAL_SALES>

The metadata which was previously included in the XML document ("field id", "visibility", "is editable") is now included in separate tables. This makes the XML documents briefer, but requires the application designer to look at the separate documentation for details. It should be noted that the new format is being gradually introduced as new electronic forms are defined and the old format will continue for existing forms.

Also the XML files previously referred to a Document Type Definition (DTD) to formally define the transaction format. In the latest version this has been ommited. Designers are expected to refer to examples of the XML files and the tables defining the fields. As that document is not in a readily machine readable format (such as XML Schema) there is some room for human error.

The ATO's free ECI Client software can be used to manually create an XML document which is then imported into an accounting package. Alternatively there is a simple command line interface to allow the accounting package to invoke the ECI software. There is no web services interface.

ATO to  ECI then via  XML to Accounts Package then SQL to DB


Form:

Form Types Electronic Version

Form

Target Audience

Field Labels

Quarterly BAS

(BAS-A)

Associated NAT numbers:

NAT 4189-4.2001

NAT 4189-9.2001

  • GST, PAYG withholding, PAYG instalment

Business Activity Statement Text Heading, Activity Statement Period Text Message, GST Period Text Message, PAYGW Period Text Message, PAYGI Period Text Message, T2 Notional Tax Text Message, T7 Notional Tax Text Message, Document ID, ABN, CAN (where applicable), Form due on, Payment due on, GST accounting method, Your phone number, Name & Address Block, Biller Code Block, EFT Code Block, Time taken to complete form.

Option 1: Calculate GST and report quarterly radio button, G1, Does the amount shown at G1 include GST? (Yes/No) radio buttons, G2, G3, G10, G11, 1A, 1B. Option 2: Calculate GST and report annually radio button, G1, Does the amount shown at G1 include GST? (Yes/No) radio buttons, 1A, 1B. Option 3: Pay GST instalment amount radio button, G21, G22, G23, G24, 1A.

W1, W2, W4, W3, W5.

Option 1: Pay a PAYG instalment amount radio button, T7, T8, T9, T4, 5A, 5B. Option 2: Calculate PAYG instalment using income x rate radio button, T1, T2, T3, T11, T4, 5A, 5B.

1A, 1B, 4, 5A, 5B, 7, 7A (where applicable), 8A, 8B, 9.

Fields:

Field Label Reference Table Electronic Version

Field Label Number

Field Name

XML Field ID

Pre- Filled

Record Description

Edit Rules

Display Format

Document ID Block

Document ID

DIN

Yes

Numeric field, 11 characters in length.

PIC 9(11)

Range is from 100000000 to 99999999999.

Right justified.

Blocks of 3 digits.

ABN Block

ABN

ABN

Yes

Numeric field, 11 characters in length.

PIC 9(11)

Range is from 10000000000 to 99999999999

Right justified.

Blocks of 3 digits.

Client Account Number Block

CAN

CAC

*

Yes

Numeric field, 3 characters in length.

PIC 9(3)

Range is from 001 to 999

Right justified.

CAN field only displayed when value is greater than 001

Form due on Block

Form due on

FORM DUE ON

Yes

Date Format

DDMMCCYY

Valid Values:-

Date Day = 01 - [28|29|30|31]

Date Month = 01 - 12

Date Year = 2000 to present

DD/MM/CCYY

Payment due on Block

Payment due on

PAYMENT DUE ON

Yes

Date Format

DDMMCCYY

Valid Values:-

Date Day = 01 - [28|29|30|31]

Date Month = 01 - 12

Date Year = 2000 to present

DD/MM/CCYY

GST accounting method Block

GST accounting method

GST ACCOUNTING METHOD LABEL TEXT

Yes

Alphanumeric field,

50 characters in length.

PIC X(50)

Valid Characters:-

(1) Cash

(2) Non-cash (accruals)

Message appears on "Details" tab

Example document:

Electronic Version of Form Types - XML Format Exported File to Accounting Software Package

<FORM_PERIOD_LABEL_TEXT>July to September 2001</FORM_PERIOD_LABEL_TEXT>
<EFT_CODE> 51111 121 059 9059</EFT_CODE>
<BILLER_CODE>75556</BILLER_CODE>
<PAYG_WITHHOLDING>0</PAYG_WITHHOLDING>
<PAYG_INSTALMENT>12541</PAYG_INSTALMENT>
<DEFERRED_COMPANY_FUND_INSTALMENT>7879801</DEFERRED_COMPANY_FUND_INSTALMENT>
<TOTAL_DEBITS>7892342</TOTAL_DEBITS>
<TOTAL_CREDITS>0</TOTAL_CREDITS>
<NET_AMOUNT_FOR_THIS_STATEMENT>7892342</NET_AMOUNT_FOR_THIS_STATEMENT>
<GST_LABEL_TEXT>for the QUARTER from 1 Jul 2001 to 30 Sep 2001</GST_LABEL_TEXT>
<GST_ACCOUNTING_METHOD_LABEL_TEXT>Cash</GST_ACCOUNTING_METHOD_LABEL_TEXT>
<GST_ACCOUNTING_METHOD_LABEL>01</GST_ACCOUNTING_METHOD_LABEL>
<GST_OPTION_1>true</GST_OPTION_1>
...

Printing a BAS

While the ATO's ECI Client software can be used to print a BAS, this can also be done directly by software which can interpret an XML document.

EBAS via XML to Browser plus XSLT for format produces HTML to display form

To demonstrate this the XSL file atobas.xsl transforms the eBAS XML file atobas.xml to create a printable form.

As an example the Field "CAC" is printed with the caption " Client Account Number ":

XML

<CAC>001</CAC>

XSL

<p>Client Account Number <xsl:value-of select="CAC" /></p>

Result

Client Account Number 001

XSL to XML to HTML

To make the result look more like the paper form, styles are used to right justify and colour the text.

BAS Form

Anecdote: XML Standards Actually work

The above example was created and tested in 2002 with the Microsoft Internet Explorer Version 6 Web Browser. Like other newer versions of web browsers., IE6 has XSLT capabilities built in, so it is not necessary to have a separate software package to run the demonstration. The ATO's example eBAS XML file was modified by adding one line to the header, to instruct the browser to invoke the transformation automatically, to remove the need for manual intervention:

<?xml version="1.0" ?>
<?xml-stylesheet type="text/xsl" href="atobas.xsl"?>
<!DOCTYPE NAT4189-4.2001.V2>
From: ATO e-BAS example, ATO, 2002 (modified), URL: http://www.tomw.net.au/2002/atobas.xml

This same file was later loaded into Microsoft Word 2003 Beta 2. MS-Word automatically detected the XSLT entry and provided it as an option. By selecting this option "atobas.xsl" was retrieved from the web, the transformation applied to the data file and the resulting HTML document displayed. The result looks much as it does in MS-IE 6. This was an unexpected surprise:

Update 2007: New XML formats for Tax

Australian Taxation Office staff are members of the OASIS Tax XML Technical Committee, along with the Canada Revenue Agency, German Federal Ministry of the Interior, , Netherlands Tax and Customs Administration, UK H.M. Revenue & Customs, US IRS. This offers the prospect in the future of one standard global format for submitting value added tax (VAT)details electronically:

Tax XML is an initiative to research and analyze personal and business tax reporting & compliance information, represented in XML, to facilitate interoperability in a way that is open, flexible and international in scope. The products of Tax XML will include a vocabulary of terms, a repository of artifacts including XML templates, documents exchanged for tax compliance, best practices, guidelines and recommendations for practical implementation. It will focus on developing a common vocabulary that will allow participants to unambiguously identify the tax related information exchanged within a particular business context. ...

From: Statement of Purpose, OASIS Tax XML Technical Committee, OASIS, 2004?

The ATO are also proposing a Standard Business Reporting model, allowing a single data update for multiple government agencies.

Further Information

Copyright © Tom Worthington. 2002-2007