specific code change document avatax connector for ms

27
Specific Code Change Document AvaTax Connector for MS Dynamics AX 2012 R3 CU10 <Hotfix AX 6.3.3000.111.03.00> 1 | Page Step1: Code changes in Avalara AX project AvaTax Changed the following list of Macro Avalara project: Macro Name Macro value Code Changes AVA_M acro #define.SetClient #define.MicrosoftSetClient #define. ConnectorVersion Replace the “SetClient”, “MicrosoftSetClient” and “ConnectorVersion” macro value with the following values: #define.SetClient(' AX 2012 R3 CU10 || AX 6.3.3000.111.03.00') #define.MicrosoftSetClient(‘AX 2012 R3 CU10 || ’) #define.ConnectorVersion(' AX 6.3.3000. 111.03.00') AvaTax Changed the following list of objects in Avalara AX project: Table Changes: TmpTaxWorkTrans Method Name Modifications showTaxValue Search for following code if ((AVA_Configuration::find().TaxGroupId == this.TaxGroup ) || (substr(AVA_Configuration::find().TaxGroupId,1,6) == substr(this.TaxGroup,1,6))) and Replace with if (((AVA_Configuration::find().TaxGroupId == this.TaxGroup ) || (substr(AVA_Configuration::find().TaxGroupId,1,6) == substr(this.TaxGroup,1,6)) && AVA_TaxEngine::isAvaTaxConfigurationEnabled())) SalesTable Method Name Modifications 1. checkAgainstCre ditLimit Search the following code // @AVA+ if (!Ava_Configuration::find().DisableTaxCalculation) { this.Touched = NoYes::Yes; } //@AVA- ID Name AVA_Macro

Upload: khangminh22

Post on 23-Mar-2023

0 views

Category:

Documents


0 download

TRANSCRIPT

Specific Code Change Document AvaTax Connector for MS Dynamics AX 2012 R3 CU10 <Hotfix AX 6.3.3000.111.03.00>

1 | P a g e

Step1: Code changes in Avalara AX project

AvaTax Changed the following list of Macro Avalara project:

Macro Name Macro value Code Changes

AVA_Macro

#define.SetClient #define.MicrosoftSetClient #define. ConnectorVersion

Replace the “SetClient”, “MicrosoftSetClient” and “ConnectorVersion” macro value with the following values: #define.SetClient(' AX 2012 R3 CU10 || AX 6.3.3000.111.03.00') #define.MicrosoftSetClient(‘AX 2012 R3 CU10 || ’) #define.ConnectorVersion(' AX 6.3.3000. 111.03.00')

AvaTax Changed the following list of objects in Avalara AX project:

Table Changes:

TmpTaxWorkTrans

Method Name Modifications

showTaxValue

Search for following code if ((AVA_Configuration::find().TaxGroupId == this.TaxGroup ) || (substr(AVA_Configuration::find().TaxGroupId,1,6) == substr(this.TaxGroup,1,6))) and Replace with if (((AVA_Configuration::find().TaxGroupId == this.TaxGroup ) || (substr(AVA_Configuration::find().TaxGroupId,1,6) == substr(this.TaxGroup,1,6)) && AVA_TaxEngine::isAvaTaxConfigurationEnabled()))

SalesTable

Method Name Modifications 1. checkAgainstCre

ditLimit

Search the following code // @AVA+ if (!Ava_Configuration::find().DisableTaxCalculation) { this.Touched = NoYes::Yes; } //@AVA-

ID Name AVA_Macro

Specific Code Change Document AvaTax Connector for MS Dynamics AX 2012 R3 CU10 <Hotfix AX 6.3.3000.111.03.00>

2 | P a g e

And replace with // @AVA+ if (!Ava_Configuration::find().DisableTaxCalculation && AVA_TaxEngine::isAvaTaxConfigurationEnabled()) { this.Touched = NoYes::Yes; } // @AVA-

2. setEstimate

Search for following code // @AVA+ if (!Ava_Configuration::find().DisableTaxCalculation) { this.Touched = NoYes::Yes; } else // @AVA- And replace with // @AVA+ if (!Ava_Configuration::find().DisableTaxCalculation && AVA_TaxEngine::isAvaTaxConfigurationEnabled()) { this.Touched = NoYes::Yes; } else // @AVA-

MarkupTrans

Method Name Modifications

taxCombinationAllowed

Search for following code // @AVA + if (substr(AVA_Configuration::find().TaxGroupId,1,6) == substr(this.TaxGroup,1,6 )) return true; else // @AVA - and replace with // @AVA + if (substr(AVA_Configuration::find().TaxGroupId,1,6) == substr(this.TaxGroup,1,6 ) && AVA_TaxEngine::isAvaTaxConfigurationEnabled()) return true; else // @AVA -

Specific Code Change Document AvaTax Connector for MS Dynamics AX 2012 R3 CU10 <Hotfix AX 6.3.3000.111.03.00>

3 | P a g e

CustInvoiceTable Methods: Code Changes ValidateWrite

Search for following code //AVA+ if (((subStr(this.TaxGroup,1,6) == subStr(AVA_Configuration::find().TaxGroupId,1,6)))) { ava_TaxEngine.GetTax(this, this.InvoiceDate,false,null,ava_DocumentType::SalesOrder,'',AVA_ConnSource::FreeText); } //AVA- And replace with //AVA+ if ((subStr(this.TaxGroup,1,6) == subStr(AVA_Configuration::find().TaxGroupId,1,6)) && AVA_TaxEngine::isAvaTaxConfigurationEnabled()) { ava_TaxEngine.GetTax(this, this.InvoiceDate,false,null,ava_DocumentType::SalesOrder,'',AVA_ConnSource::FreeText); } //AVA-

ProjProposalJour Methods: Code Changes Insert

Search for following code if (((!AVA_Configuration::find().DisableTaxCalculation) && substr(this.TaxGroupId,1,6) != substr(AVA_Configuration::find().TaxGroupId,1,6))) And replace with if ((AVA_TaxEngine::isAvaTaxConfigurationEnabled() && (!AVA_Configuration::find().DisableTaxCalculation) && substr(this.TaxGroupId,1,6) != substr(AVA_Configuration::find().TaxGroupId,1,6)))

Class Changes:

SalesQuotationEditLinesForm_Sales_Confir

Method Name Modifications

Specific Code Change Document AvaTax Connector for MS Dynamics AX 2012 R3 CU10 <Hotfix AX 6.3.3000.111.03.00>

4 | P a g e

createJournal

1. Search for following code TaxEngine.GetTax(salesQuotationTable, systemDateGet(),false,null,AVA_DocumentType::SalesOrder,'',AVA_ConnSource::SalesQuotation); // @AVA +- And replace with if(AVA_TaxEngine::isAvaTaxConfigurationEnabled()) { TaxEngine.GetTax(salesQuotationTable, systemDateGet(),false,null,AVA_DocumentType::SalesOrder,'',AVA_ConnSource::SalesQuotation); // @AVA +- }

createSalesLines

1.Search the following code // @AVA + ArrLine [Line] = salesLine.RecId; Line++; // @AVA – And replace with // @AVA + if (AVA_TaxEngine::isAvaTaxConfigurationEnabled()) { ArrLine [Line] = salesLine.RecId; Line++; } // @AVA + 2.Search the line following code // @AVA + while select RecId from markupTrans where markupTrans.TransTableId == salesLine.TableId && markupTrans.TransRecId == salesLine.RecId { ArrLine [Line] = markupTrans.RecId; line++; } // @AVA - And replace with // @AVA + if (AVA_TaxEngine::isAvaTaxConfigurationEnabled()) { while select RecId from markupTrans where markupTrans.TransTableId == salesLine.TableId && markupTrans.TransRecId == salesLine.RecId { ArrLine [Line] = markupTrans.RecId; line++; } } // @AVA -

Specific Code Change Document AvaTax Connector for MS Dynamics AX 2012 R3 CU10 <Hotfix AX 6.3.3000.111.03.00>

5 | P a g e

updateNow

1. Search the following code // @AVA + line = 1; while select RecId from markupTrans where markupTrans.TransTableId == salesTableCreated.TableId && markupTrans.TransRecId == salesTableCreated.RecId {

ArrLine [Line] = markupTrans.RecId; line++;

} // @AVA - And replace with // @AVA + if (AVA_TaxEngine::isAvaTaxConfigurationEnabled()) { line = 1; while select RecId from markupTrans where markupTrans.TransTableId == salesTableCreated.TableId && markupTrans.TransRecId == salesTableCreated.RecId { ArrLine [Line] = markupTrans.RecId; line++; } } // @AVA - 3. Search for the following code

TaxEngine.CopyAvaTables(salesQuotationTable.QuotationId, salesTableCreated.SalesId, ArrLine); // @AVA +- And replace with //@AVA+ if (AVA_TaxEngine::isAvaTaxConfigurationEnabled()) { TaxEngine.CopyAvaTables(salesQuotationTable.QuotationId, salesTableCreated.SalesId, ArrLine); // @AVA +- } //AVA-

SalesQuotationEditLinesForm_Sales_Send

Method Name

Modifications

createJournal

1. Search the following code TaxEngine.GetTax(salesQuotationTable, systemDateGet(),false,null,AVA_DocumentType::SalesOrder,'',AVA_ConnSource::SalesQuotation); // @AVA +- and replace with //AVA+ if (AVA_TaxEngine::isAvaTaxConfigurationEnabled()) {

Specific Code Change Document AvaTax Connector for MS Dynamics AX 2012 R3 CU10 <Hotfix AX 6.3.3000.111.03.00>

6 | P a g e

TaxEngine.GetTax(salesQuotationTable, systemDateGet(),false,null,AVA_DocumentType::SalesOrder,'',AVA_ConnSource::SalesQuotation); } //AVA-

SalesInvoiceJournalPost

Method Name

Modifications

postFailed

1. Search the following code // @AVA + if (custInvoiceJour.InvoiceId && !this.isProforma()) taxEngine.CancelTax(custInvoiceJour.InvoiceId, SalesParmTable.salesTable().TaxGroup,SalesParmTable.salesTable().SalesType,AVA_ConnSource::SalesInvoice); // @AVA – And replace with // @AVA + if (custInvoiceJour.InvoiceId && !this.isProforma() && AVA_TaxEngine::isAvaTaxConfigurationEnabled() && !AVA_Configuration::find().DisableTaxCalculation) { taxEngine.CancelTax(custInvoiceJour.InvoiceId, SalesParmTable.salesTable().TaxGroup,SalesParmTable.salesTable().SalesType,AVA_ConnSource::SalesInvoice); } //AVA-

CustPostInvoice

Method Name Modifications

runInternal 1. Search the line following code //AVA+ if (custInvoiceTable.ForInterestAdjustment== NoYes::No) { TaxEngine.GetTax(CustInvoiceTable, CustInvoiceTable.InvoiceDate, False, NULL, Ava_documentType::SalesInvoice, InvoiceId,AVA_ConnSource::FreeTextInvoice); } //AVA- and replace with //AVA+ if (custInvoiceTable.ForInterestAdjustment== NoYes::No && ava_Taxengine::isAvaTaxConfigurationEnabled()) { TaxEngine.GetTax(CustInvoiceTable, CustInvoiceTable.InvoiceDate, False, NULL, Ava_documentType::SalesInvoice, InvoiceId,AVA_ConnSource::FreeTextInvoice); } //AVA-

Specific Code Change Document AvaTax Connector for MS Dynamics AX 2012 R3 CU10 <Hotfix AX 6.3.3000.111.03.00>

7 | P a g e

2. search the following code // @AVA + if (custInvoiceTable.ForInterestAdjustment== NoYes::No) { taxEngine.CommitTax(invoiceId, custInvoiceTable.TaxGroup,salesType::Sales,AVA_ConnSource::FreeTextInvoice); } // @AVA – And replace with // @AVA + if (custInvoiceTable.ForInterestAdjustment== NoYes::No && AVA_TaxEngine::isAvaTaxConfigurationEnabled() && !AVA_Configuration::find().DisableTaxCalculation) { taxEngine.CommitTax(invoiceId, custInvoiceTable.TaxGroup,salesType::Sales,AVA_ConnSource::FreeTextInvoice); } // @AVA - 3.Search the line following code // @AVA + if (!isPostingOK && custInvoiceTable.ForInterestAdjustment== NoYes::No) { taxEngine.CancelTax(invoiceId, custInvoiceTable.TaxGroup,salesType::Sales,AVA_ConnSource::FreeTextInvoice); } // @AVA – And replace with // @AVA + if (!isPostingOK && custInvoiceTable.ForInterestAdjustment== NoYes::No && AVA_TaxEngine::isAvaTaxConfigurationEnabled() && !AVA_Configuration::find().DisableTaxCalculation) { taxEngine.CancelTax(invoiceId, custInvoiceTable.TaxGroup,salesType::Sales,AVA_ConnSource::FreeTextInvoice); } // @AVA -

SalesTotals_ParmTrans

Method Name Modifications 1. showTax 1. Search the following code

ava_TaxEngine.GetTax(_salesParmTable.salesTable(), _salesParmTable.Transdate, true,

Specific Code Change Document AvaTax Connector for MS Dynamics AX 2012 R3 CU10 <Hotfix AX 6.3.3000.111.03.00>

8 | P a g e

_salesParmTable,AVA_DocumentType::SalesOrder,'',_salesParmTable.salesTable().SalesType == SalesType::ReturnItem ? AVA_ConnSource::ReturnOrder : AVA_ConnSource::SalesOrder ); // @AVA +- And replace with //AVA+ if (ava_TaxEngine::isAvaTaxConfigurationEnabled()) { ava_TaxEngine.GetTax(_salesParmTable.salesTable(), _salesParmTable.Transdate, true, _salesParmTable,AVA_DocumentType::SalesOrder,'',_salesParmTable.salesTable().SalesType == SalesType::ReturnItem ? AVA_ConnSource::ReturnOrder : AVA_ConnSource::SalesOrder ); } //AVA-

SalesInvoiceJournalCreate

Method Name Modifications 1. initJournalHeader

Update method as following protected void initJournalHeader() { // @AVA + AVA_TaxEngine ava_TaxEngine = New AVA_TaxEngine(); #AVA_Macro // @AVA - ; // @AVA + if (AVA_TaxEngine::isAvaTaxConfigurationEnabled() && !AVA_Configuration::find().DisableTaxCalculation && salesParmTable.salesTable().ProjId) { ava_TaxEngine.GetTax(salesParmTable.salesTable(), salesParmTable.Transdate, true, salesParmTable,ava_DocumentType::SalesOrder,'', salesParmTable.salesTable().SalesType == SalesType::ReturnItem ? AVA_ConnSource::ReturnOrder : AVA_ConnSource::SalesOrder); } // @AVA - super(); // @AVA + if (!salesParmTable.salesTable().ProjId) { if (AVA_TaxEngine::isAvaTaxConfigurationEnabled() && !AVA_Configuration::find().DisableTaxCalculation) { if (salesParmUpdate.Proforma) ava_TaxEngine.GetTax(salesParmTable.salesTable(), salesParmTable.Transdate, true, salesParmTable,ava_DocumentType::SalesOrder,'', salesParmTable.salesTable().SalesType == SalesType::ReturnItem ? AVA_ConnSource::ReturnOrder : AVA_ConnSource::SalesOrder); else AVA_TaxEngine.GetTax(salesTable, salesParmTable.Transdate, false, salesParmTable, ava_DocumentType::SalesInvoice, journalNumber,salesParmTable.salesTable().SalesType == SalesType::ReturnItem ? AVA_ConnSource::ReturnInvoice : AVA_ConnSource::SalesInvoice); } } // @AVA - }

Specific Code Change Document AvaTax Connector for MS Dynamics AX 2012 R3 CU10 <Hotfix AX 6.3.3000.111.03.00>

9 | P a g e

CustRecurrenceInvoiceGenerationService

Method Name Modifications createCustRecurrenceInvoice 1.Search for the following code

//AVA+ if (((subStr(custInvoiceTable.TaxGroup,1,6) == subStr(AVA_Configuration::find().TaxGroupId,1,6)))) { ava_TaxEngine.GetTax(custInvoiceTable, custInvoiceTable.InvoiceDate,false,null,ava_DocumentType::SalesOrder,'',AVA_ConnSource::FreeText); } //AVA- And replace with //AVA+ if ((subStr(custInvoiceTable.TaxGroup,1,6) == subStr(AVA_Configuration::find().TaxGroupId,1,6)) && AVA_TaxEngine::isAvaTaxConfigurationEnabled()) { ava_TaxEngine.GetTax(custInvoiceTable, custInvoiceTable.InvoiceDate,false,null,ava_DocumentType::SalesOrder,'',AVA_ConnSource::FreeText); } //AVA-

Tax

Method Name Modifications allocateInTaxWorkTrans

1. Search the following code if(configuration && ((taxWorkTrans.TaxGroup == configuration.TaxGroupId) || (subStr(taxWorkTrans.TaxGroup,strLen(configuration.TaxGroupId)+1,1) == #SubTaxGroup))) and replace with if(AVA_TaxEngine::isAvaTaxConfigurationEnabled() && ((taxWorkTrans.TaxGroup == configuration.TaxGroupId) || (subStr(taxWorkTrans.TaxGroup,strLen(configuration.TaxGroupId)+1,1) == #SubTaxGroup))) 2. Search for following code if ((AVA_Configuration::find().TaxGroupId != TaxGroup ) && (substr(AVA_Configuration::find().TaxGroupId,1,6) != substr(TaxGroup,1,6))) // @AVA

Specific Code Change Document AvaTax Connector for MS Dynamics AX 2012 R3 CU10 <Hotfix AX 6.3.3000.111.03.00>

10 | P a g e

+- and replace with if ((ava_Configuration::find().TaxGroupId != TaxGroup ) && (substr(ava_Configuration::find().TaxGroupId,1,6) != substr(TaxGroup,1,6)) && AVA_TaxEngine::isAvaTaxConfigurationEnabled()) // @AVA +-

3. distributeTotalTax

1.Search for following code // @AVA + //BP Deviation Documented DetailNumber = 3; globalCacheInvoiceId = Infolog.globalCache(); if (globalCacheInvoiceId.get(#TaxWorkTransInvoice, 0, '')) AVA_invoiceIdTemp = globalCacheInvoiceId.get(#TaxWorkTransInvoice, 0, ''); else AVA_invoiceIdTemp = ''; AVA_invoiceId = AVA_invoiceIdTemp ; // @AVA - And replace with // @AVA + if (AVA_TaxEngine::isAvaTaxConfigurationEnabled()) { //BP Deviation Documented detailNumber = 3; globalCacheInvoiceId = Infolog.globalCache(); if (globalCacheInvoiceId.get(#TaxWorkTransInvoice, 0, '')) AVA_invoiceIdTemp = globalCacheInvoiceId.get(#TaxWorkTransInvoice, 0, ''); else AVA_invoiceIdTemp = ''; AVA_invoiceId = AVA_invoiceIdTemp ; } // @AVA -

SalesTableForm

Method Name Modifications 1. setTouched

Search for the following condition if (!Ava_Configuration::find().DisableTaxCalculation) and replace with if (!Ava_Configuration::find().DisableTaxCalculation && AVA_TaxEngine::isAvaTaxConfigurationEnabled())

SalesTotals

Method Name Modifications executeDisplayFieldsServer

2. Search the following code ava_TaxEngine.GetTax(salesParmTable.salesTable(), salesParmTable ? salesParmTable.Transdate : systemDateGet(),

Specific Code Change Document AvaTax Connector for MS Dynamics AX 2012 R3 CU10 <Hotfix AX 6.3.3000.111.03.00>

11 | P a g e

True, salesParmTable,AVA_DocumentType::SalesOrder,'', salesParmTable.salesTable().SalesType == SalesType::ReturnItem ? AVA_ConnSource::ReturnOrder :AVA_ConnSource::SalesOrder ); // @AVA +- and replace with //AVA+ if(AVA_TaxEngine::isAvaTaxConfigurationEnabled()) { ava_TaxEngine.GetTax(salesParmTable.salesTable(), salesParmTable ? salesParmTable.Transdate : systemDateGet(), True, salesParmTable,AVA_DocumentType::SalesOrder,'', salesParmTable.salesTable().SalesType == SalesType::ReturnItem ? AVA_ConnSource::ReturnOrder :AVA_ConnSource::SalesOrder ); // @AVA +- } //AVA- 3. Search for the following code salesTable = _orderTable; ava_TaxEngine.GetTax(salesTable, systemDateGet(),false,null,AVA_DocumentType::SalesOrder,'',salesParmTable.salesTable().SalesType == SalesType::ReturnItem ? AVA_ConnSource::ReturnOrder : AVA_ConnSource::SalesOrder ); // @AVA +- and replace with //AVA+ if(AVA_TaxEngine::isAvaTaxConfigurationEnabled()) { salesTable = _orderTable; ava_TaxEngine.GetTax(salesTable, systemDateGet(),false,null,AVA_DocumentType::SalesOrder,'',salesParmTable.salesTable().SalesType == SalesType::ReturnItem ? AVA_ConnSource::ReturnOrder : AVA_ConnSource::SalesOrder ); // @AVA +- } //AVA-

SalesTableListPageInteraction

Method Name Modifications 1. setButtonSell

1. Search for following code // @AVA + if(strscan(( AVA_Configuration::find().Services), #TaxService, 1, 100) && (AVA_Configuration::find().EnableTaxOverrideDate)) { this.listPage().actionPaneControlEnabled(formControlStr(salesTableListPage, AVA_TaxOverrideDate),true); } else { this.listPage().actionPaneControlEnabled(formControlStr(salesTableListPage,AVA_TaxOverrideDate),false); } // @AVA –

Specific Code Change Document AvaTax Connector for MS Dynamics AX 2012 R3 CU10 <Hotfix AX 6.3.3000.111.03.00>

12 | P a g e

And replace with // @AVA + if((AVA_TaxEngine::isAvaTaxConfigurationEnabled()) && strscan((AVA_Configuration::find().Services), #TaxService, 1, 100) && (AVA_Configuration::find().EnableTaxOverrideDate)) { this.listPage().actionPaneControlEnabled(formControlStr(salesTableListPage, AVA_TaxOverrideDate),true); } else { this.listPage().actionPaneControlEnabled(formControlStr(salesTableListPage,AVA_TaxOverrideDate),false); } // @AVA -

FormletterJournalCreate Method Name Modifications CreateJournal Update the method as following

private void createJournal() { LogText logText; Counter origInfologNum = infologLine(); ttsbegin; this.init(); this.initSourceTable(); this.initTotals(); this.initFormletterProvider(); if (this.checkNoThrow()) // skip journal without throwing an exception. { this.initRecordList(); //AVA+ If(this.formletterType()==FormletterType::Sales && AVA_Configuration::find().DisableTaxCalculation == NoYes::No && AVA_TaxEngine::isAvaTaxConfigurationEnabled())//AVA+- { this.initJournalHeader(); } //AVA- if (this.check()) { //AVA+ if (AVA_TaxEngine::isAvaTaxConfigurationEnabled()) { If((this.formletterType()!=FormletterType::Sales && AVA_Configuration::find().DisableTaxCalculation == NoYes::No) || AVA_Configuration::find().DisableTaxCalculation == NoYes::Yes) //AVA+- { this.initJournalHeader(); } }

Specific Code Change Document AvaTax Connector for MS Dynamics AX 2012 R3 CU10 <Hotfix AX 6.3.3000.111.03.00>

13 | P a g e

else { this.initJournalHeader(); } //AVA- this.createJournalHeader(); this.createJournalLines(); if (this.isJournalCreated()) { this.insertRecordList(); this.createAgreementLinks(); this.endCreate(); // <GEERU> if (SysCountryRegionCode::isLegalEntityInCountryRegion([#isoRU]) && !this.checkVATTaxAgentChargeType_RU()) { throw error("@SYS21533"); } // </GEERU> } else {//No journal lines were created so roll back creation of journal header. this.noLinesForPosting(true); } } else { ttsabort; logText = Info::infoCon2Str(infolog.copy(origInfologNum + 1, infologLine())); this.createFailed(logText); throw error(strFmt("@SYS26498", this.parmParmTable().(this.fieldIdParmTable_OrderId()))); } } else { this.noLinesForPosting(); } ttscommit; }

FormletterService

Method Name Modifications run

1. Search the following code if (!AVA_Configuration::find().DisableTaxCalculation) and replace with if (!AVA_Configuration::find().DisableTaxCalculation && AVA_TaxEngine::isAvaTaxConfigurationEnabled())

Specific Code Change Document AvaTax Connector for MS Dynamics AX 2012 R3 CU10 <Hotfix AX 6.3.3000.111.03.00>

14 | P a g e

ProjInvoiceJournalCreate Method Name Modifications initJournalHeader

1. Search for following code // @AVA + if((isConfigurationkeyEnabled(configurationKeyNum(AVATax))) && (!AVA_configuration::find().DisableTaxCalculation)) { ava_TaxEngine.GetTax(projProposalJour, projInvoiceParmTable.InvoiceDate, false, null ,ava_DocumentType::SalesInvoice, projInvoiceJour.ProjInvoiceId,AVA_ConnSource::ProjectInvoiceProposal); } // @AVA - Replace with // @AVA + if((AVA_TaxEngine::isAvaTaxConfigurationEnabled()) && (!AVA_configuration::find().DisableTaxCalculation) && !this.proforma()) { ava_TaxEngine.GetTax(projProposalJour, projInvoiceParmTable.InvoiceDate, false, null ,ava_DocumentType::SalesInvoice, projInvoiceJour.ProjInvoiceId,AVA_ConnSource::ProjectInvoiceProposal); } // @AVA -

ProjInvoiceJournalPost Method Name Modifications postJournalPost

Search for the following code if ((!projInvoiceJour.isProforma()) && (AVA_TaxEngine.isProjPrepayment(projProposalJour))) and Replace with if ((AVA_TaxEngine::isAvaTaxConfigurationEnabled() && !AVA_Configuration::find().DisableTaxCalculation && !projInvoiceJour.isProforma()) && (AVA_TaxEngine.isProjPrepayment(projProposalJour)))

postFailed Search for the following code if ((!AVA_Configuration::find().DisableTaxCalculation) && (projInvoiceJour.ProjInvoiceId) && (!projInvoiceJour.isProforma()) && (taxEngine.isProjPrepayment(projProposalJourLoc)))

Specific Code Change Document AvaTax Connector for MS Dynamics AX 2012 R3 CU10 <Hotfix AX 6.3.3000.111.03.00>

15 | P a g e

and replace with if (AVA_TaxEngine::isAvaTaxConfigurationEnabled() && (!AVA_Configuration::find().DisableTaxCalculation) && (projInvoiceJour.ProjInvoiceId) && (!projInvoiceJour.isProforma()) && (taxEngine.isProjPrepayment(projProposalJourLoc)))

TaxProj

Method Name Modifications 1. markup

1. Declare the following variable: #AVA_Macro AVA_Details ava_Details; //AVA+- 2. Search the for the following code “this.insertIntersection(salesCalcTax.markupTaxGroup(), salesCalcTax.markupTaxItemGroup(), _transId, markupTrans.Txt, taxDate);” and replace the following code above to this. //@AVA+ /* this.insertIntersection(salesCalcTax.markupTaxGroup(), salesCalcTax.markupTaxItemGroup(), _transId, markupTrans.Txt, taxDate); */ //BP Deviation Documented if (((substr(salesCalcTax.parmProjProposalJour().TaxGroupId,1,6) != substr(AVA_Configuration::find().TaxGroupId,1,6)) || (AVA_Configuration::find().DisableTaxCalculation)) && !AVA_TaxEngine::isAvaTaxConfigurationEnabled()) { this.insertIntersection(salesCalcTax.markupTaxGroup(), salesCalcTax.markupTaxItemGroup(), _transId, markupTrans.Txt, taxDate); } else { select sum(TaxAmount) from ava_Details where ava_Details.LineRecId == markupTrans.RecId; if(ava_Details.TaxAmount != 0) { if (salesCalcTax.markupTaxItemGroup())

Specific Code Change Document AvaTax Connector for MS Dynamics AX 2012 R3 CU10 <Hotfix AX 6.3.3000.111.03.00>

16 | P a g e

{ this.insertIntersection(Ava_configuration::find().TaxGroupId, salesCalcTax.markupTaxItemGroup(), _transId, markupTrans.Txt, taxDate); } else { this.insertIntersection(Ava_configuration::find().TaxGroupId, #All, _transId, markupTrans.Txt, taxDate); } } } //@AVA-

2. new 1. Declare the following variable as below: #AVA_Macro AVA_Details ava_Details;//AVA+- 2. Search the for the following code “ this.insertIntersection(salesCalcTax.transTaxGroup(), ” And replace below code with this. //@AVA+ /* this.insertIntersection(salesCalcTax.transTaxGroup(), salesCalcTax.transTaxItemGroup(), salesCalcTax.transTransId(), salesCalcTax.transItemId(), taxCalculationDate); */ //BP Deviation Documented if (((substr(salesCalcTax.parmProjProposalJour().TaxGroupId,1,6) != substr(AVA_Configuration::find().TaxGroupId,1,6)) || (AVA_Configuration::find().DisableTaxCalculation)) && !AVA_TaxEngine::isAvaTaxConfigurationEnabled()) { this.insertIntersection(salesCalcTax.transTaxGroup(), salesCalcTax.transTaxItemGroup(), salesCalcTax.transTransId(), salesCalcTax.transItemId(), taxCalculationDate); } else {

Specific Code Change Document AvaTax Connector for MS Dynamics AX 2012 R3 CU10 <Hotfix AX 6.3.3000.111.03.00>

17 | P a g e

select sum(TaxAmount) from ava_Details where ava_Details.LineRecId == lineRecId; if(ava_Details.TaxAmount != 0) { if (salesCalcTax.markupTaxItemGroup()) { this.insertIntersection(Ava_configuration::find().TaxGroupId, salesCalcTax.transTaxItemGroup(), salesCalcTax.transTransId(), salesCalcTax.transItemId(), taxCalculationDate); } else { this.insertIntersection(Ava_configuration::find().TaxGroupId, #All, salesCalcTax.transTransId(), salesCalcTax.transItemId(), taxCalculationDate); } } } //@AVA-

SalesQuotationEditLinesForm_Proj_Send Method Name Modifications createJournal Search for the following code

taxEngine.GetTax(salesQuotationTable, systemDateGet(),false,null,AVA_DocumentType::SalesOrder,'',AVA_ConnSource::ProjectQuotation); // @AVA +- and replace with //AVA+ if(AVA_TaxEngine::isAvaTaxConfigurationEnabled()) { taxEngine.GetTax(salesQuotationTable, systemDateGet(),false,null,AVA_DocumentType::SalesOrder,'',AVA_ConnSource::ProjectQuotation); // @AVA +- } //AVA-

SalesQuotationEditLinesForm_Proj_Confir Method Name Modifications createJournal Search for the following code

taxEngine.GetTax(salesQuotationTable, systemDateGet(),false,null,AVA_DocumentType::SalesOrder,'',AVA_ConnSource::ProjectQu

Specific Code Change Document AvaTax Connector for MS Dynamics AX 2012 R3 CU10 <Hotfix AX 6.3.3000.111.03.00>

18 | P a g e

otation); // @AVA +- and replace with //AVA+ if(AVA_TaxEngine::isAvaTaxConfigurationEnabled()) { taxEngine.GetTax(salesQuotationTable, systemDateGet(),false,null,AVA_DocumentType::SalesOrder,'',AVA_ConnSource::ProjectQuotation); // @AVA +- } //AVA-

SalesTableListPageInteraction Method Name Modifications setButtonSell Search for the following code

if(strscan(( AVA_Configuration::find().Services), #TaxService, 1, 100) && (AVA_Configuration::find().EnableTaxOverrideDate)) and replace with if((AVA_TaxEngine::isAvaTaxConfigurationEnabled()) && strscan((AVA_Configuration::find().Services), #TaxService, 1, 100) && (AVA_Configuration::find().EnableTaxOverrideDate))

ProjProposalTotal Method Name Modifications Calc Search for the following code

if((isConfigurationkeyEnabled(configurationKeyNum(AVATax)) && (!AVA_configuration::find().DisableTaxCalculation))) and replace with if((AVA_TaxEngine::isAvaTaxConfigurationEnabled() && (!AVA_configuration::find().DisableTaxCalculation)))

new Search for the following code if((isConfigurationkeyEnabled(configurationKeyNum(AVATax)) && (!AVA_configuration::find().DisableTaxCalculation))) and replace with if((AVA_TaxEngine::isAvaTaxConfigurationEnabled()) && (!AVA_configuration::find().DisableTaxCalculation))

ProjInvoiceJournalCreate Method Name Modifications initJournalHeader Search for the following code

Specific Code Change Document AvaTax Connector for MS Dynamics AX 2012 R3 CU10 <Hotfix AX 6.3.3000.111.03.00>

19 | P a g e

if((isConfigurationkeyEnabled(configurationKeyNum(AVATax)) && (!AVA_configuration::find().DisableTaxCalculation))) and replace with if((AVA_TaxEngine::isAvaTaxConfigurationEnabled()) && (!AVA_configuration::find().DisableTaxCalculation))

Specific Code Change Document AvaTax Connector for MS Dynamics AX 2012 R3 CU10 <Hotfix AX 6.3.3000.111.03.00>

20 | P a g e

Form changes

CustFreeInvoice Methods: Code Changes Data Sources ->CustInvoiceTable -> CheckFieldsAreChanged

Search for following code if ((subStr(custInvoiceTable.TaxGroup,1,6) == subStr(AVA_Configuration::find().TaxGroupId,1,6)) && !AVA_Configuration::find().DisableTaxCalculation)

And replace with if ((subStr(custInvoiceTable.TaxGroup,1,6) == subStr(AVA_Configuration::find().TaxGroupId,1,6)) && !AVA_Configuration::find().DisableTaxCalculation && AVA_TaxEngine::isAvaTaxConfigurationEnabled())

\Forms\CustFreeInvoice\Designs\Design\[ActionPane:ActionPane]\[ActionPaneTab:InvoiceActionsTab]\[ButtonGroup:DetailsAction]\MenuItemButton:CustInvoiceTableTotals\Methods\clicked

Update method as following void clicked() { WorkflowTable workflowTableFieldList; AVA_TaxEngine ava_TaxEngine = new AVA_TaxEngine(); ; if (AVA_TaxEngine::isAvaTaxConfigurationEnabled()) { select DefaultConfiguration from workflowTableFieldList where workflowTableFieldList.TemplateName == 'CustFreeTextInvoiceTemplate' && workflowTableFieldList.DefaultConfiguration == NoYes::Yes; if ((WorkflowTable::findActiveTemplate('CustFreeTextInvoiceTemplate') || workflowTableFieldList.DefaultConfiguration)) { if (custInvoiceLine.RecId && ((subStr(custInvoiceTable.TaxGroup,1,6) == subStr(AVA_Configuration::find().TaxGroupId,1,6)))) ava_TaxEngine.GetTax(custInvoiceTable, custInvoiceTable.InvoiceDate,false,null,ava_DocumentType::SalesOrder,'',AVA_ConnSource::FreeTextInvoice); custInvoiceLine_ds.research(true); } if (custInvoiceLine.RecId && (subStr(custInvoiceTable.TaxGroup,1,6) == subStr(AVA_Configuration::find().TaxGroupId,1,6)) && !AVA_Configuration::find().DisableTaxCalculation) { if(isHeaderAddressChanged) { ava_TaxEngine.GetTax(custInvoiceTable, custInvoiceTable.InvoiceDate,false,null,ava_DocumentType::SalesOrder,'',AVA_ConnSource::FreeTextInvoice); isHeaderAddressChanged = false; } } } super(); }

Specific Code Change Document AvaTax Connector for MS Dynamics AX 2012 R3 CU10 <Hotfix AX 6.3.3000.111.03.00>

21 | P a g e

\Forms\CustFreeInvoice\Designs\Design\[ActionPane:ActionPane]\[ActionPaneTab:InvoiceActionsTab]\[ButtonGroup:DetailsAction]\MenuItemButton:TaxTransSource\Methods\clicked

2. Search for the following code //AVA+ select DefaultConfiguration from workflowTableFieldList where workflowTableFieldList.TemplateName == 'CustFreeTextInvoiceTemplate' && workflowTableFieldList.DefaultConfiguration == NoYes::Yes; if ((WorkflowTable::findActiveTemplate('CustFreeTextInvoiceTemplate') || workflowTableFieldList.DefaultConfiguration)) { if (custInvoiceLine.RecId && ((subStr(custInvoiceTable.TaxGroup,1,6) == subStr(AVA_Configuration::find().TaxGroupId,1,6)))) ava_TaxEngine.GetTax(custInvoiceTable, custInvoiceTable.InvoiceDate,false,null,ava_DocumentType::SalesOrder,'',AVA_ConnSource::FreeTextInvoice); custInvoiceLine_ds.research(true); } if (custInvoiceLine.RecId && (subStr(custInvoiceTable.TaxGroup,1,6) == subStr(AVA_Configuration::find().TaxGroupId,1,6)) && !AVA_Configuration::find().DisableTaxCalculation) { if(isHeaderAddressChanged) { ava_TaxEngine.GetTax(custInvoiceTable, custInvoiceTable.InvoiceDate,false,null,ava_DocumentType::SalesOrder,'',AVA_ConnSource::FreeTextInvoice); isHeaderAddressChanged = false; } } //AVA –

And replace with //AVA+ if (AVA_TaxEngine::isAvaTaxConfigurationEnabled()) { select DefaultConfiguration from workflowTableFieldList where workflowTableFieldList.TemplateName == 'CustFreeTextInvoiceTemplate' && workflowTableFieldList.DefaultConfiguration == NoYes::Yes; if ((WorkflowTable::findActiveTemplate('CustFreeTextInvoiceTemplate') || workflowTableFieldList.DefaultConfiguration)) { if (custInvoiceLine.RecId && ((subStr(custInvoiceTable.TaxGroup,1,6) == subStr(AVA_Configuration::find().TaxGroupId,1,6)))) ava_TaxEngine.GetTax(custInvoiceTable, custInvoiceTable.InvoiceDate,false,null,ava_DocumentType::SalesOrder,'',AVA_ConnSource::FreeTextInvoice); custInvoiceLine_ds.research(true); } if (custInvoiceLine.RecId && (subStr(custInvoiceTable.TaxGroup,1,6) == subStr(AVA_Configuration::find().TaxGroupId,1,6)) && !AVA_Configuration::find().DisableTaxCalculation) { if(isHeaderAddressChanged) { ava_TaxEngine.GetTax(custInvoiceTable, custInvoiceTable.InvoiceDate,false,null,ava_DocumentType::SalesOrder,'',AVA_ConnSource::FreeTextInvoice); isHeaderAddressChanged = false; } }

Specific Code Change Document AvaTax Connector for MS Dynamics AX 2012 R3 CU10 <Hotfix AX 6.3.3000.111.03.00>

22 | P a g e

} //AVA –

\Forms\CustFreeInvoice\Designs\Design\[ActionPane:ActionPane]\[ActionPaneTab:InvoiceActionsTab]\[ButtonGroup:PostAction]\MenuItemButton:ButtonCustPostInvoiceJob

Search for following code if (custInvoiceLine.RecId && (subStr(custInvoiceTable.TaxGroup,1,6) == subStr(AVA_Configuration::find().TaxGroupId,1,6)) && !AVA_Configuration::find().DisableTaxCalculation) And replace with if (custInvoiceLine.RecId && AVA_TaxEngine::isAvaTaxConfigurationEnabled() && (subStr(custInvoiceTable.TaxGroup,1,6) == subStr(AVA_Configuration::find().TaxGroupId,1,6)) && !AVA_Configuration::find().DisableTaxCalculation)

SalesQuotationTable Method: Code Changes

Specific Code Change Document AvaTax Connector for MS Dynamics AX 2012 R3 CU10 <Hotfix AX 6.3.3000.111.03.00>

23 | P a g e

Datasources: SalesQuotationTable 1. write

Search for following code if (element.isCalcTax()) and replace with if (element.isCalcTax() && AVA_TaxEngine::isAvaTaxConfigurationEnabled())

search for following code if (element.isCalcTax()) and replace with if (element.isCalcTax() && AVA_TaxEngine::isAvaTaxConfigurationEnabled()) Search the the following code

// @AVA + taxEngine.GetTax(salesQuotationTable, systemDateGet(),false,null,AVA_DocumentType::SalesOrder,'',AVA_ConnSource::SalesQuotation); if(SalesQuotationLine.RecId) { element.isCalcTax(false); } // @AVA -

Specific Code Change Document AvaTax Connector for MS Dynamics AX 2012 R3 CU10 <Hotfix AX 6.3.3000.111.03.00>

24 | P a g e

And replace with // @AVA + if (AVA_TaxEngine::isAvaTaxConfigurationEnabled()) { taxEngine.GetTax(salesQuotationTable, systemDateGet(),false,null,AVA_DocumentType::SalesOrder,'',AVA_ConnSource::SalesQuotation); if(SalesQuotationLine.RecId) { element.isCalcTax(false); } } // @AVA -

SalesTable Method: Code Changes Init Search for the following code

AVA_TaxOverrideDate.enabled(strscan(( AVA_Configuration::find().Services), #TaxService, 1, 100) && (AVA_Configuration::find().EnableTaxOverrideDate)? true : false); And replace with // @AVA + if(AVA_TaxEngine::isAvaTaxConfigurationEnabled()) { AVA_TaxOverrideDate.enabled(strscan(( AVA_Configuration::find().Services), #TaxService, 1, 100) && (AVA_Configuration::find().EnableTaxOverrideDate)? true : false); } else { AVA_TaxOverrideDate.enabled(false); } // @AVA -

Datasources : SalesTable 1. write

Search for the following code AVA_TaxEngine.GetTax(SalesTable, systemDateGet(),false,null,ava_DocumentType::SalesOrder,'',AVA_ConnSource::SalesOrder); //@AVA+- And replace with //AVA+ if (AVA_TaxEngine::isAvaTaxConfigurationEnabled()) { AVA_TaxEngine.GetTax(SalesTable, systemDateGet(),false,null,ava_DocumentType::SalesOrder,'',SalesTable.SalesType == SalesType::ReturnItem ? AVA_ConnSource::ReturnOrder : AVA_ConnSource::SalesOrder); //@AVA+- } //AVA-

Specific Code Change Document AvaTax Connector for MS Dynamics AX 2012 R3 CU10 <Hotfix AX 6.3.3000.111.03.00>

25 | P a g e

Search for following code AVA_TaxEngine.GetTax(SalesTable, systemDateGet(),false,null,ava_DocumentType::SalesOrder,'',AVA_ConnSource::SalesOrder); //@AVA+- And replace with //AVA+ if( AVA_TaxEngine::isAvaTaxConfigurationEnabled()) { taxEngine.GetTax(salesTable, systemDateGet(),false,null,ava_DocumentType::SalesOrder,'',AVA_ConnSource::SalesOrder); // @AVA +- } //AVA-

SalesQuotationProjTable Method: Code Changes

Search for the following code if (element.isCalcTax()) and replace with if (element.isCalcTax() && AVA_TaxEngine::isAvaTaxConfigurationEnabled())

Search for the following code if (element.isCalcTax()) and replace with if (element.isCalcTax() && AVA_TaxEngine::isAvaTaxConfigurationEnabled())

MarkupTrans Method: Code Changes

Datasource Markuptrans->Write

Search for the following code callerFormObject = element.args().caller(); if (callerFormObject && callerFormObject.name() == formStr(SalesQuotationTable) && formHasMethod(callerFormObject, identifierStr(isCalcTax))) { callerFormObject.isCalcTax(true); } and replace with // AVA + if(AVA_TaxEngine::isAvaTaxConfigurationEnabled()) { callerFormObject = element.args().caller(); if (callerFormObject && callerFormObject.name() ==

Specific Code Change Document AvaTax Connector for MS Dynamics AX 2012 R3 CU10 <Hotfix AX 6.3.3000.111.03.00>

26 | P a g e

formStr(SalesQuotationTable) && formHasMethod(callerFormObject, identifierStr(isCalcTax))) { callerFormObject.isCalcTax(true); } } // AVA -

LogisticsPostalAddress Method: Code Changes

Init Search for the following code // @AVA + AVA_AddressValidation.enabled(strscan(( AVA_Configuration::find().Services), #AddressService, 1, 100) ? true : false); validatedAddress = false; // @AVA +- and replace with // @AVA + if (AVA_TaxEngine::isAvaTaxConfigurationEnabled()) { AVA_AddressValidation.enabled(strscan(( AVA_Configuration::find().Services), #AddressService, 1, 100) ? true : false); validatedAddress = false; } // @AVA +-

Search for the following code if(ava_Configuration::find().DisableAddressValidation) and replace with if(AVA_TaxEngine::isAvaTaxConfigurationEnabled() && ava_Configuration::find().DisableAddressValidation)

Update method as following void clicked() { AVA_AddressValidation addressValidation = new ava_AddressValidation(); AVA_EntityUseCodeMapping entityUseCode; if (AVA_TaxEngine::isAvaTaxConfigurationEnabled()) { if (validatedAddress) addressValidation.UpdateTables(logisticsPostalAddress,DateTimeUtil::utcNow());

Specific Code Change Document AvaTax Connector for MS Dynamics AX 2012 R3 CU10 <Hotfix AX 6.3.3000.111.03.00>

27 | P a g e

ttsBegin; select forUpdate entityUseCode where entityUseCode.LogisticsPostalAddressRecId == logisticsPostalAddress.Location; if(entityUseCode) { entityUseCode.DeliveryName = LogisticsLocation.Description; entityUseCode.Address = logisticsPostalAddress.Address; entityUseCode.update(); } ttsCommit; } super(); }

Step 2: Synchronize database. Step 3 : Compile the AX application. Step 3: Generate Full CIL.