To Set Up For Order Entry
There are two pieces to the Flex that runs the BirdDog AvaTax connector: One that fires at Macola Order Entry, and one that fires at Macola Select for Billing.
Order Entry
This piece is typically triggered by saving and closing the Macola Order Entry screen after entering an order. It calls the BirdDog Print Order Acknowledgement function, calls out to Avalara with an Estimate Tax call, and writes the tax amount back to the order in Macola. This does not write a transaction up to the Avalara console. It also does not increment the order status in Macola.
Select for Billing
This piece fires triggered on selecting an order for billing in Macola. Selecting for billing in Macola automatically calls the BirdDog Process Invoices function. This causes Enterprise for Windows to perform the same process as doing Print Invoices directly in Macola. The BirdDog AvaTax connector then calls out to Avalara using the Get Tax call and gets a current tax estimate, updates the tax amount on the order (if necessary), and writes the transaction up to the Avalara console in an Uncommitted state. This also increments the order status on the order in Macola to 9 - Invoice Printed.
Macola Progression Setup
To set up the Order Entry Flex:
- In Progression Explorer, go to Order Entry > Trx > Orders > Enter Orders
- Click on the VBA/IDE Icon at the top
- In the Microsoft Visual Basic window that pops up:
- Double-click on OE0101 in the Nav Bar on the left
- Double-click on Order Entry Objects
- Double-click on macform

- You may already have text in this macform for other Flexcode. If you don't, then you can just copy the Flex below as is and will just need to change some paths/credentials. If you do already have Flex in this screen, then you will need to be more careful in where you place the new code. These steps assume the BirdDog Flexcode is the only code inserted into the OE macform.
- Paste this code into the macform window:
'--------------Print Acknowledgement--------------
Option Explicit
Public sOrdNo As String
Public bSaved As Boolean
Public sOrdType As String
Private Sub macForm_Initialize()
bSaved = False
End Sub
Private Sub macForm_ModeChange(ByVal mode As mode)
If bSaved = False Then Exit Sub
Dim pid As Variant
Dim sCmd As String
'Supports Quotes, Direct Invoicing, Credit Memos, or normal Order
If sOrdType = "Q=Quote" Then
sCmd = "C:\Users\username\Desktop\Enterprise\BirdDogSoftware.Enterprise.exe /coa:on /Database:(" & Trim(macForm.ConnInfo.Server) & "),(1),(" & macForm.ConnInfo.DB & "),(),(),(True),(),() /Name:PrintQuote /ParamValues:" & sOrdNo & "," & sOrdNo & ",0,NULL"
ElseIf sOrdType = "I=Invoice" Then
sCmd = "C:\Users\username\Desktop\Enterprise\BirdDogSoftware.Enterprise.exe /coa:on /Database:(" & Trim(macForm.ConnInfo.Server) & "),(1),(" & macForm.ConnInfo.DB & "),(),(),(True),(),() /Name:PrintInvoices /ParamValues:,," & sOrdNo & "," & sOrdNo & ",,,NULL,,,0"
ElseIf sOrdType = "C=Crdt Memo" Then
sCmd = "C:\Users\username\Desktop\Enterprise\BirdDogSoftware.Enterprise.exe /coa:on /Database:(" & Trim(macForm.ConnInfo.Server) & "),(1),(" & macForm.ConnInfo.DB & "),(),(),(True),(),() /Name:PrintInvoices /ParamValues:,," & sOrdNo & "," & sOrdNo & ",,,NULL,,,0"
Else
sCmd = "C:\Users\username\Desktop\Enterprise\BirdDogSoftware.Enterprise.exe /coa:on /Database:(" & Trim(macForm.ConnInfo.Server) & "),(1),(" & macForm.ConnInfo.DB & "),(),(),(True),(),() /Name:PrintOrderAcknowledgement /ParamValues:" & sOrdNo & "," & sOrdNo & ",0,NULL"
End If
pid = Shell(sCmd, vbNormalFocus)
bSaved = False
End Sub
Private Sub macForm_Save(AllowSave As Boolean)
AllowSave = True
sOrdNo = Trim(macForm.No.Text)
sOrdType = macForm.Type1.Text
bSaved = True
End Sub
Private Sub macForm_CloseForm()
End Sub
- In the above lines of code, you will need to change the path so that it points to where you have Enterprise for Windows installed. Specifically:
- References to "C:\Users\username\Desktop\Enterprise\BirdDogSoftware.Enterprise.exe" should be changed to where your Enterprise for Windows is installed.
- By default, this presumes Trusted Connection authentication in Enterprise for Windows. If that is not the case, you may need to change the connection credentials. So ",(),(),(True)," may need to adjusted according to:
- The first parenthesis contains the SQL login account
- The second parenthesis contains the SQL login password
- The third parenthesis determines whether or not Trusted Connection is used. If you're using a SQL account to connect, this will be set to False. If you are using Trusted Connection to authenticate with a Windows account, then the first 2 parentheses will be left blank and this will be set to True.
- In the end, it should look something like this:
If sOrdType = "Q=Quote" Then
sCmd = "\\SQLserverName\PathToBirdDog\BirdDogSoftware.Enterprise.exe /coa:on /Database:(" & Trim(macForm.ConnInfo.Server) & "),(1),(" & macForm.ConnInfo.DB & "),(sa),(sapassword),(False),(),() /Name:PrintQuote /ParamValues:" & sOrdNo & "," & sOrdNo & ",0,NULL"
- This will need to be done for each of the calls above so that all of them contain the correct path and credentials
- Once you have everything updated, hit Save in the MS Visual Basic window and close it
- Restart Macola
To Set Up The Select For Billing Flex
- In Progression Explorer, go to Order Entry > Trx > Billing > Select Orders
- In the Billing Entry screen, click the VBA/IDE icon at the top
- In the Microsoft Visual Basic window that pops up:
- Double-click on OE0101 in the Nav Bar on the left
- Double-click on Order Entry Objects
- Double-click on macform

- You may already have text in this macform for other Flexcode. If you don't, then you can just copy the Flex below as is and will just need to change some paths/credentials. If you do already have Flex in this screen, then you will need to be more careful in where you place the new code. These steps assume the BirdDog Flexcode is the only code inserted into the OE macform.
- Paste this code into the macform window:
'--------------Print Invoice--------------
Option Explicit
Public sOrdNo As String
Public bSaved As Boolean
Private Sub macForm_InitForm()
bSaved = False
End Sub
Private Sub macForm_ModeChange(ByVal mode As mode)
' Change the "C:\Users\username\Desktop\Enterprise\BirdDogSoftware.Enterprise.exe" part in each of the line below to be your shared directory example: "\\MyCompany\Enterprise\BirdDogSoftware.Enterprise.exe"
If bSaved = False Then Exit Sub
Dim pid As Variant
Dim sCmd As String
sCmd = "C:\Users\username\Desktop\Enterprise\BirdDogSoftware.Enterprise.exe /coa:on /Database:(" & Trim(macForm.ConnInfo.Server) & "),(1),(" & macForm.ConnInfo.DB & "),(),(),(True),(),() /Name:PrintInvoices /ParamValues:,," & sOrdNo & "," & sOrdNo & ",,,NULL,,,0"
pid = Shell(sCmd, vbNormalFocus)
bSaved = False
End Sub
Private Sub macForm_Save(AllowSave As Boolean)
AllowSave = True
sOrdNo = Trim(macForm.No.Text)
bSaved = True
End Sub
Private Sub macForm_CloseForm()
End Sub
- In the above line of code, you will need to change the path so that it points to where you have Enterprise for Windows installed. Specifically:
- The reference to "C:\Users\username\Desktop\Enterprise\BirdDogSoftware.Enterprise.exe" should be changed to where your Enterprise for Windows is installed.
- By default, this presumes Trusted Connection authentication in Enterprise for Windows. If that is not the case, you may need to change the connection credentials. So ",(),(),(True)," may need to adjusted according to:
- The first parenthesis contains the SQL login account
- The second parenthesis contains the SQL login password
- The third parenthesis determines whether or not Trusted Connection is used. If you're using a SQL account to connect, this will be set to False. If you are using Trusted Connection to authenticate with a Windows account, then the first 2 parentheses will be left blank and this will be set to True.
- In the end, it should look something like this:
sCmd = "\\SQLserverName\PathToBirdDog\Enterprise\BirdDogSoftware.Enterprise.exe /coa:on /Database:(" & Trim(macForm.ConnInfo.Server) & "),(1),(" & macForm.ConnInfo.DB & "),(sa),(sapassword),(False),(),() /Name:PrintInvoices /ParamValues:,," & sOrdNo & "," & sOrdNo & ",,,NULL,,,0"
pid = Shell(sCmd, vbNormalFocus)
- The parameters being specified after the /ParamValues: string above are (from left to right):
- start customer no, end customer no, start order no, end order no, invoice date, print duplicates, printer name, batch id, sort order, display Print Confirmation Dialog
- If these are left blank, then this uses the default Macola values. This is the recommended format as it covers most user scenarios.
- The most frequent adjustment to these parameters is for Printer Name (to use a printer other than the server's default one) or batch id (e.g., all invoices coming from your Ecommerce system are setup to use the same batch id.) BirdDog is able to assist in any other modifications to this.
- Once you have everything updated, hit Save in the MS Visual Basic window and close it.
- Restart Macola
SPECIAL NOTE: It should be noted that this call from Macola Select for Billing will actually Print the invoice through BirdDog, which will result in the Order Status being incremented to 9 - Invoice Printed. This is functionally the same as printing the invoice from inside Macola. If you have a custom Crystal Report Invoice template in Macola, you will need to reprint the invoice in Macola with the "Print Duplicates" box checked, in order to output the invoice on your custom template.