Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Prerequisites to enable the software development environment: The MYOB Tool application requires Visual Studio 2010 and .NET Framework 2.0 to be installed on the development computer. SQL 2008R2 is currently used to access the database The application uses advanced controls from DevExpress a 3rd party vendor. The version of controls uses is V11.1.6.0 A license will be required for the software and can be purchased directly from https://www.devexpress.com/ It may be possible to compile the software with the DLL’s included. A Developer key is used to enable ODBC connection and read from the MYOB AccountRight database. This key was previously stored in a JIT DLL. It has been removed from the DLL as the previous subscription has been cancelled and amounts refunded to AdvantageCard gDeveloperKey = JITCommon.modJITCommon.JITDevKey A Developer license subscription will need to be obtained from MYOB. http://developer.myob.com/program/what-is-the-developer-program/ The MYOB tool utilises an SQL Server Compact database. When the software is first installed the database is created via code in modSQLDatabase Public Function CreateLoyaltyDatabase() Three tables exist in the database: ACardSettings – stores the configuration settings tblInvoice – stores invoices read from either MYOB AccountRight or RetailManager tblRedemption – stores redemptions processed via Transactor The software is dependent on a number of DLL’s which can be found in the References section The software utilises SCM Anywhere Hosted as its Source Safe Repository. If AdvantageCard wish to continue to use this platform, JIT can provide a login for a small monthly fee. The MYOB tool utilises a web service provided by Transactor. This allows read/write calls with THOR the Loyalty database. au.com.advantagecard.acthor The calls can be viewed via http://apthor.advantagecard.com.au/thor.asmx The application is deployed via ClickOnce. In summary, the software is compiled and uploaded to a server location, previously www.justinrigby.com This allows seamless deployment as the end user is required to download the software from a URL as shown below. When an update is uploaded to the server, the client software will check each time is loads and will download the update. A more detailed explanation can be viewed here: https://msdn.microsoft.com/en-us/library/t71a733d.aspx FrmMain is the Startup form for the application A timer and background worker are utilised for the automatic read/send frmMain.FormLoad calls routines to create directories and database if required and sets global values. Buttons call their respective forms “Begin Automatic MYOB Processing” fires timer and background worker and calls modMYOBSaleRead.RetrieveWebSebServiceMYOBAccountSales() or modMYOBSaleRead.RetrieveWebSebServiceRetailManagerSales() Code Modules of Descriptions: modGlobals: Defines all Global variables and functions used throughout the application Please note MYOB key will be needed when MYOB Developer subscription is obtained gDeveloperKey = JITCommon.modJITCommon.JITDevKey Public Function CreateDirFilesIfNeeded When installing, function creates required directory Public Function ValidatePotentialCard Validates an entered or scanned AC number against two 8 digit prefixes which are displayed on the configuration screen Public Function ValidatePotentialCardMYOB Validates a card retrieved from an MYOB sale Public Function GenerateWebServiceTransNo Creates transactionid based on THOR protocol Public Function IncrementMYOBLastSaleId Increments last MYOB in memory Public Function GetFirstDayOfMonth Returns first day of month Public Function GetLastDayOfMonth Returns last day of month Public Function ConvertToUNC Converts file path to UNC Public Function ConvertToUNCShared Converts file path to UNC Shared modMYOBSalesRead: Contains the calls for connection and read of MYOB AccountRight and Retail Manager. Please note connection is via ODBC and works on versions V19 or lower. Private Sub InitialiseSalesDataSet Call to initialise Sales datasets Private Sub InitialiseCardsDataSet Call to initialise card dataset Public Function RetrieveWebSebServiceRetailManagerSales Reads sales form Retail Manager to be sent to THOR via Web Service Public Function WSRetailMGetLastDocketId Read last DocketId from Retail Manager Public Function WSRMCheckforInvoicePaid Checks if individual sales in Retail Manager has been paid Public Function WSMYOBCheckforInvoicePaid Checks if individual sale in MYOB has been paid Public Function RetrieveWebSebServiceMYOBAccountSales Reads sales from MYOB to be sent to THOR via web service Private Sub CheckForAdvantageCard Checks for AdvantageCard number in MYOB card file and transactions Private Function ReturnAdvatageCard Returns AdvantageCard Private Function WSMYOBConnect Call to connect to MYOB via ODBC Private Function WSRetailManager_Connect Call to connect to Retail Manager Access database Private Function WSGetADONETError Retrieve ADONET error Private Sub WSDisconnectfromODBC Disconnect from MYOB ODBC Public Function WSCheckValidAccountingPassword Validates MYOB password Private Function CreateInvoice Creates invoice in tblInvoice record. Public Function SendTransactions Routine to send transactions to THOR via web service Public Function UpdateIsPaidinSQL Routine to update tblInvoice as being paid/settled modSQLDatabase: Contains a call to create the SQL Compact database. Public Function CreateLoyaltyDatabase Creates SQL Compact Database on install modWebServiceCalls: Contains the calls to au.com.advantagecard.acthor.ac_thor Public Function PingServer() Tests a connection to THOR before any processing it done Public Function CheckBalance Sends a card number to THOR and a Balance is retrieved Public Function SendPurchase Sends a transaction to THOR Public Function SendPurchaseRefund Sends a credit transaction to THOR Public Function CheckResponse Checks the response from THOR Public Function GetBalanceResponse Retrieves the balance from the XML response Public Function SendRedeem Sends a Redemption to THOR Public Function SendRedeemRefund Sends a Redemption Refund to THOR ACardLoyaltyData: Contains the GetConnection function to enable connection to the SQL Compact Database ACardSettingsData_1: Contains calls to the SQL Compact Database for the ACardSettings table Public Function Select_Record Call to retrieve table data Public Function Update Call to Update table data Public Function UpdateLastMYOBId Call to update MYOBLastSaleIdentityId The reason for this is so we know which record to read from next read of MYOB AccountRight Public Function UpdateLastRetailManagerId Call to update RMLastSaleIdentityId The reason for this is so we know which record to read from next read of Retail Manager tblInvoiceData: Contains calls to the SQL Compact Database for the tblInvoice table Public Function SelectNotExported Reads transactions from tblInvoice table that have not been exported and have been settled (paid) in MYOB Public Function SelectNotPaid Reads transactions from tblInvoice table that have not been exported and have NOT been settled (paid) in MYOB Public Function SelectFailedExport Reads transactions from tblInvoice table that have failed export Public Function SelectAll Reads all transactions from tblInvoice table Public Function Select_Record Reads and selects an individual record with InvoiceId as an input parameter Public Function Add Inserts a record to the table tblInvoice Public Function UpdateExported After a tblinvoice record is successfully sent to THOR it is updated as exported in the database Public Function UpdateIsPaid Unpaid records stored in the SQLDatabase are checked each read to see if they have been settled. If they are settled they are then updated in the database InvoicePaid = true Public Function UpdateFailedExport When sending a transaction to THOR, if there is a return code error the record is updated with isExported = false Public Function Update Updates a tblInvoice record tblRedemptionData: Contains calls to the SQL Compact Database for the tblRedemption table Public Function SelectNotExported Selects all records to exported to THOR Public Function SelectAll Selects all tblRedemption records Public Function Select_LastRecord Selects most recent tblRedemption record Public Function Select_RecordisRefunded Checks if a tblRedemption record has already been refunded Public Function Add Inserts a record to the table tblRedemption Public Function UpdateExported After a tblRedemption record is successfully sent to THOR it is updated as exported in the database Public Function Delete Deletes a tlbRedemption record