Avalara AvaTax for Microsoft Dynamics NAV 2013 RTM
|
|
- Donald Payne
- 6 years ago
- Views:
Transcription
1 Avalara AvaTax for Microsoft Dynamics NAV 2013 RTM Version 01 Revision date: 4/30/15 Product release: Microsoft NAV Avalara may have patents, patent applications, trademarks, copyrights, or other intellectual property rights governing the subject matter in this document. Except as expressly provided in any written license agreement from Avalara, the furnishing of this document does not give you any license to these patents, trademarks, copyrights, or other intellectual property Avalara, Inc. All rights reserved. Avalara, AvaTax, AvaTax Calc, AvaTax Returns, AvaTax Certs, AvaTax Local, AvaLocal, AvaTax POS, AvaPOS, AvaRates, TrustFile, BPObridge, Laserbridge+, Sales Taxll, Sales TaxPC, SalestaxPC+, StatetaxII, and StatetaxPC are either registered trademarks or trademarks of Avalara, Inc. in the United States or other countries. All other trademarks are property of their respective owners..
2 Changes in Avalara objects... 5 New objects in Avalara.fob... 5 Changes in Avalara Table... 5 Table AVA CONFIG... 5 Table AVA Install... 8 Table AVA Release State Buffer... 9 Changes in Avalara Codeunit Codeunit AVA Address Validation Codeunit AVA Tax Engine Codeunit AVA Validate Call Changes in Avalara Pages Page AVA Address Validation Page AVA Configuration Card Page AVA Address Country List Page AVA Country List Page AVA SOP Utility Page AVA Reconciliation Page AVA Item UPC MAP Changes in Avalara Menusuite Object MenuSuite 1060 Dept - Add-on Avalara AvaTax Changes in AvalaraX CodeUnits Codeunit 12 Gen. Jnl.-Post Codeunit 46 SelectionFilterManagement Codeunit 60 Sales-Calc. Discount Codeunit 80 Sales-Post Codeunit 398 Sales Tax Calculate Codeunit 414 Release Sales Document Codeunit 442 Sales-Post Prepayments Codeunit 5980 Service-Post Codeunit 5986 Serv-Amounts Mgt Codeunit 5987 Serv-Posting Journals Mgt Codeunit 5988 Serv-Documents Mgt Changes in AvalaraX Pages Page 1 Company Information Page 21 Customer Card Page 41 Sales Quote Page 42 Sales Order Avalara Inc. All rights reserved. Page 2 of 215
3 Page 43 Sales Invoice Page 44 Sales Credit Memo Page 46 Sales Order Subform Page 47 Sales Invoice Subform Page 95 Sales Quote Subform Page 96 Sales Cr. Memo Subform Page 132 Posted Sales Invoice Page 134 Posted Sales Credit Memo Page 300 Ship-to Address Page 368 Order Address Page 507 Blanket Sales Order Page 508 Blanket Sales Order Subform Page 5050 Contact Card Page 5703 Location Card Page 5714 Responsibility Center Card Page 5900 Service Order Page 5902 Service Order Subform Page 5905 Service Lines Page 5933 Service Invoice Page 5934 Service Invoice Subform Page 5935 Service Credit Memo Page 5936 Service Credit Memo Subform Page 5964 Service Quote Page 5965 Service Quote Subform Page 5966 Service Quote Lines Page 5972 Posted Service Credit Memo Page 5978 Posted Service Invoice Page 6050 Service Contract Page 6053 Service Contract Quote Page 6630 Sales Return Order Page 6631 Sales Return Order Subform Page 9300 Sales Quotes Page 9301 Sales Invoice List Page 9302 Sales Credit Memos Page 9303 Blanket Sales Orders Page 9304 Sales Return Order List Page 9305 Sales Order List Avalara Inc. All rights reserved. Page 3 of 215
4 Page 9317 Service Quotes Page 9318 Service Orders Page 9319 Service Invoices Page 9320 Service Credit Memos Page 9321 Service Contracts Avalara Inc. All rights reserved. Page 4 of 215
5 Changes in Avalara objects New objects in Avalara.fob Import below new objects Changes in Avalara Table Table AVA CONFIG Change in Version List of objects: New Value : AVANA Add new field Field No. Field Name Data Type Length 59 Tax Url Option Option 60 Services Enabled Text Use UPC as Item Code Boolean Caption ML for Field 59 : Production,Development, OptionString for field 59 : OnValidate Code for Field 59 : //AVANA Start IF "Tax Url Option" = 0 THEN "Tax Url" := ' ELSE IF "Tax Url Option" = 1 THEN "Tax Url" := ' ELSE "Tax Url" := ''; //AVANA End Add Global variable Name Data Type Subtype Length AVAConfig Record AVA CONFIG Changes in trigger OnInser() Adde below code IF.COUNT = 1 THEN ERROR('AvaTax configuration already exists'); Avalara Inc. All rights reserved. Page 5 of 215
6 Changes in Field Account Value Old value Account Value New Value Account Number Changes in Field Licence Key Old value Licence Key New Value License Key Changes in Field Tax Url Adde below code to OnValidate() Trigger //AVANA Start IF LOWERCASE("Tax Url") = ' THEN "Tax Url Option" := 0 ELSE IF LOWERCASE("Tax Url") = ' THEN "Tax Url Option" := 1 ELSE "Tax Url Option" := 2; //AVANA End Avalara Inc. All rights reserved. Page 6 of 215
7 Add new Field Tax URL Option With below properties Changes in Tax Url Option OnValidate //AVANA Start IF "Tax Url Option" = 0 THEN "Tax Url" := ' ELSE IF "Tax Url Option" = 1 THEN "Tax Url" := ' ELSE "Tax Url" := ''; //AVANA End Avalara Inc. All rights reserved. Page 7 of 215
8 Table AVA Install Change in Version List of objects: New Value : AVANA Changes in function TestConnection Changes in code (Modifed code highlighted in Red color) IF AvaAddrValidn.AvaIsAuthorised(AccKey,AccValue,URL,ResultText,AdapterVer,ExpityDate,ServicesEnabled) = 0 THEN //AVANA bstatus:=true ELSE bstatus:=false; MESSAGE (ResultText); Add below parameter Changes in function Screen1Validation Changes in code Modifed code highlighted in Red color IF (AccValue = '') OR (AccKey = '') OR (URL = '') THEN BEGIN bstatus:=false; IF (AccValue = '') THEN MESSAGE(Text ) ELSE IF (AccKey = '') THEN MESSAGE(Text ) ELSE IF (URL = '') THEN MESSAGE(Text ); END ELSE BEGIN bstatus := TestConnection(AccValue,AccKey,URL,ResultText,AdapterVer,ExpityDate,ServicesEnabled); IF CompCode = '' THEN BEGIN MESSAGE(Text ); bstatus:=false; Avalara Inc. All rights reserved. Page 8 of 215
9 Add below parameter Table AVA Release State Buffer Delete this Table object from Object designer Avalara Inc. All rights reserved. Page 9 of 215
10 Changes in Avalara Codeunit Codeunit AVA Address Validation Changes in function AvaValidate Modified code (Search for below 1 st line) ovalidresult:=oaddsrv.validate(ovalidaterequest); IF ovalidresult.resultcode = 0 THEN BEGIN "Addr 1":=oValidResult.Addresses.Item(0).Line1; "Addr 2":=oValidResult.Addresses.Item(0).Line2; "Addr 3":=oValidResult.Addresses.Item(0).Line3; TCity:=oValidResult.Addresses.Item(0).City; TState:=oValidResult.Addresses.Item(0).Region; Tzip:=oValidResult.Addresses.Item(0).PostalCode; TCountry:=oValidResult.Addresses.Item(0).Country; ResultText:=''; //AvaSplitString("Addr 1","Addr 2"); //AVANA END ELSE Changes in function AvaValidateBatch Modified code (Search for below 1 st line) ovalidresult:=oaddsrv.validate(ovalidaterequest); IF ovalidresult.resultcode = 0 THEN BEGIN "Addr 1":=oValidResult.Addresses.Item(0).Line1; "Addr 2":=oValidResult.Addresses.Item(0).Line2; "Addr 3":=oValidResult.Addresses.Item(0).Line3; TCity:=oValidResult.Addresses.Item(0).City; TState:=oValidResult.Addresses.Item(0).Region; Tzip:=oValidResult.Addresses.Item(0).PostalCode; TCountry:=oValidResult.Addresses.Item(0).Country; ResultText:=''; //AvaSplitString("Addr 1","Addr 2"); //AVANA END ELSE BEGIN Avalara Inc. All rights reserved. Page 10 of 215
11 Changes in function AvaIsAuthorised Add below local variables Modified code (Search for below 1 st line) changes are highlighted in Red color AvaNoService := 0; AavAddrService := 1; AvaTaxService := 10; AvaCertService := 100; AvaDisableService := 5; AVAServices := AvaNoService; otaxsvc := otaxsvc.taxsvc; Result:=3; Obj.SETRANGE(Obj.ID, ); IF Obj.FIND('-') THEN AdapterV:=Text Obj."Version List"; otaxsvc.profile.client:=text ; otaxsvc.configuration.security.account:=value; otaxsvc.configuration.security.license:=key; otaxsvc.configuration.url:=url; oisaures := otaxsvc.isauthorized(''); Res:=oIsAuRes.ResultCode; IF Res <> 0 THEN BEGIN IF Res <> AvaDisableService THEN BEGIN AdapterVer:=oTaxSvc.Profile.Adapter; TMessage:='Error: ' + oisaures.messages.item(0).summary; //EXIT(Res); //AVANA END ELSE Res :=0; END ELSE BEGIN AdapterVer:=oTaxSvc.Profile.Adapter; ValidDate:=DT2DATE(oIsAuRes.Expires); Avalara Inc. All rights reserved. Page 11 of 215
12 TMessage:=Text FORMAT(ValidDate); AVAServices := AVAServices+AvaTaxService; AVAServices := AVAServices+AavAddrService; AvaCertSvc:=AvaCertSvc.AvaCert2Svc; Result:=3; Obj.SETRANGE(Obj.ID, ); IF Obj.FIND('-') THEN AdapterV:=Text Obj."Version List"; AvaCertSvc.Profile.Client:=Text ; AvaCertSvc.Configuration.Security.Account:=Value; AvaCertSvc.Configuration.Security.License:=Key; AvaCertSvc.Configuration.Url:=URL; oisaures := AvaCertSvc.IsAuthorized(''); Res:=oIsAuRes.ResultCode; IF Res <> 0 THEN BEGIN IF Res <> AvaDisableService THEN BEGIN AdapterVer:=AvaCertSvc.Profile.Adapter; TMessage:='Error: ' + oisaures.messages.item(0).summary; //EXIT(Res); //AVANA END ELSE Res :=0; END ELSE BEGIN AdapterVer:=AvaCertSvc.Profile.Adapter; ValidDate:=DT2DATE(oIsAuRes.Expires); TMessage:=Text FORMAT(ValidDate); AVAServices := AVAServices+AvaCertService; //AVANA Start ServicesEnabled := 'Service(s) Enabled : No Service'; CASE AVAServices OF 1 : BEGIN AvaTaxServiceBln := 1; AavAddrServiceBln := 0; AvaCertServiceBln := 0; ServicesEnabled := 'Service(s) Enabled : Tax Calculation'; 11 : BEGIN AvaTaxServiceBln := 1; AavAddrServiceBln := 1; AvaCertServiceBln := 0; ServicesEnabled := 'Service(s) Enabled : Tax Calculation, Address Validation'; 111 : BEGIN AvaTaxServiceBln := 1; AavAddrServiceBln := 1; Avalara Inc. All rights reserved. Page 12 of 215
13 AvaCertServiceBln := 1; ServicesEnabled := 'Service(s) Enabled : Tax Calculation, Address Validation, Certs/CertCapture'; //AVANA End //EXIT(Res); //AVANA EXIT(AVAServices); //AVANA Changes in function AvaSplitString Changes are highlighted in Red Color MaxCount := 50; //AVANA this was 30 Space := ' '; "Len 1":=STRLEN(TAddress1); "Len 2":=STRLEN(TAddress2); IF "Len 2" > "Len 1" THEN BEGIN Tmp:=TAddress1; TAddress1:=TAddress2; TAddress2:=Tmp; "Len 1":=STRLEN(TAddress1); "Len 2":=STRLEN(TAddress2); IF "Len 1" > MaxCount THEN BEGIN Pos:=0; Ctr:=0; Tmp:=COPYSTR(TAddress1,1,MaxCount); REPEAT Ctr:=Ctr+Pos; Pos:=STRPOS(Tmp,Space); Tmp:=COPYSTR(Tmp,Pos+1,"Len 1"); UNTIL Pos=0; "TmpAdd 1":=COPYSTR(TAddress1,1,Ctr); END ELSE BEGIN Ctr:=STRLEN(TAddress1); "TmpAdd 1":=TAddress1; "TmpAdd 2":=COPYSTR(TAddress1,Ctr+1,"Len 1"); BEGIN MaxCount := 50 - STRLEN("TmpAdd 2"); //AVANA this was 30 IF "Len 2" > MaxCount THEN BEGIN Pos:=0; Avalara Inc. All rights reserved. Page 13 of 215
14 Codeunit AVA Tax Engine Changes in Global Text Constant: Text : TextConst 'ENU=NAV ' Text : TextConst 'ENU=NAV Changes in function fncalctax Remvoe Field QtyShipRec from Local variable Modifed Code (Search for 1 st Line) changes highlieghted in red Color AVAAddrLatLongFlag:=FALSE; DtlLevel:=3; EntityUseCode:=''; SalesHead.SETRANGE(SalesHead."No.",SalesHeaderNo); SalesHead.SETRANGE(SalesHead."Document Type",SalesHeaderType); SalesHead.FINDFIRST; ShipMethod:=0; IF STRPOS(SalesHead."Shipment Method Code",Text ) <> 0 THEN ShipMethod:=1 ELSE IF STRPOS(SalesHead."Tax Area Code",Text ) <> 0 THEN ShipMethod:=2; DocumentType := FORMAT(SalesHead."Document Type"); StrMessage:=Text FORMAT(SalesHead."No.",STRLEN(FORMAT(SalesHead."No."))); AvaCheckSalesTaxAdjust(SalesHead."No.", SalesHead."Document Type",FALSE); // ExemptionNo:=''; Modifed Code (Search for 1 st Line) changes highlieghted in red Color Disc:=FALSE; SalesLine.SETRANGE(SalesLine."Document Type",SalesHeaderType); SalesLine.SETRANGE(SalesLine."Document No.",SalesHeaderNo); SalesLine.SETFILTER(SalesLine.Type, '<>%1', SalesLine.Type::" "); IF SalesLine.FINDFIRST THEN BEGIN REPEAT { IF (SalesLine."Document Type" = SalesLine."Document Type" :: "Credit Memo") OR (SalesLine."Document Type" = SalesLine."Document Type" :: "Return Order") THEN QtyShipRec := SalesLine."Return Qty. to Receive" ELSE QtyShipRec := SalesLine."Qty. to Ship"; IF NOT((QtyShipRec=0) AND (SalesLine."Qty. to Invoice"=0)) OR ((Avaconfig."Statistics Quantity" = '1') AND NOT AvaReleaseStatisticsBln) THEN BEGIN //CONNECT-1596 } remove this code Ref1:='';Ref2:='';"G\LAccNo.":='';TaxibilityCode:=''; LineAmtPassed:=0;QtyPerLine:=0; ShipMethodLine:=ShipMethod; IF STRPOS(SalesLine."Tax Area Code",Text ) <> 0 THEN ShipMethodLine:=2; Avalara Inc. All rights reserved. Page 14 of 215
15 StrMessage:=Text FORMAT(SalesHead."No.",STRLEN(FORMAT(SalesHead."No.")))+ Text FORMAT(SalesLine."Line No.",STRLEN(FORMAT(SalesLine."Line No."))); IF SalesLine."Location Code"<>'' THEN BEGIN IF SalesLine."Location Code" <> SalesHead."Location Code" THEN BEGIN TmpAddressSrc:=Text ; Loc.GET(SalesLine."Location Code"); "TmpL 1":=Loc.Address; "TmpL 2":=Loc."Address 2"; "TmpL 3":=''; TmpCity:=Loc.City; TmpState:=Loc.County; TmpZip:=fnAVAPinCheck(Loc."Post Code"); TmpCountry:=FORMAT(Loc."Country/Region Code"); END ELSE BEGIN TmpAddressSrc:=' Header'+Text ; Loc.GET(SalesHead."Location Code"); "TmpL 1":=Loc.Address; "TmpL 2":=Loc."Address 2"; "TmpL 3":=''; TmpCity:=Loc.City; TmpState:=Loc.County; TmpZip:=fnAVAPinCheck(Loc."Post Code"); TmpCountry:=FORMAT(Loc."Country/Region Code"); IF TmpCountry = '' THEN BEGIN IF NOT Avaconfig.Initiate THEN BEGIN AvaUSTaxCountry.SETRANGE(AvaUSTaxCountry.Code,'00'); IF AvaUSTaxCountry.FINDFIRST THEN TmpCountry := 'US' ELSE BEGIN AvaCANTaxCountry.SETRANGE(AvaCANTaxCountry.Code,'00'); IF AvaCANTaxCountry.FINDFIRST THEN TmpCountry := 'CA'; IF (Avaconfig."Chk. Address") AND NOT(Avaconfig."Disable Address") AND NOT(AVAAddrLatLongFlag) THEN BEGIN AvaWindowOpen(StrMessage+Text TmpAddressSrc); AvaAddrValidn.AvaValidate("TmpL 1","TmpL 2","TmpL 3",TmpCity,TmpState,TmpZip,TmpCountry, TmpLatitude, TmpLongitude, TmpTaxRegionID, ResultText,0); AvaWindowClose(); IF ResultText <> '' THEN IF NOT(AVABatchModeFlag) THEN MESSAGE(Text 'Error: '+Text TmpAddressSrc+Text '%1'+ResultText,SalesLine."Line No.") ELSE BEGIN AVAInsertDocErrorMsg(SalesHeaderNo,SalesHeaderType,SalesLine."Line No.", TmpAddressSrc+Text FORMAT(SalesLine."Line No."), Text Text ': '+ResultText); IF Avaconfig."Abort Batch Posting with Error" THEN EXIT(FALSE); oaddfromline.line1:="tmpl 1"; Avalara Inc. All rights reserved. Page 15 of 215
16 oaddfromline.line2:="tmpl 2"; oaddfromline.line3:="tmpl 3"; oaddfromline.city:=tmpcity; oaddfromline.region:=tmpstate; oaddfromline.postalcode:=tmpzip; oaddfromline.country:=tmpcountry; END ELSE BEGIN AvaWindowOpen(StrMessage+Text TmpAddressSrc); IF NOT(AVAAddrLatLongFlag) THEN BEGIN oaddfromline.line1:="tmpl 1"; oaddfromline.line2:="tmpl 2"; oaddfromline.line3:="tmpl 3"; oaddfromline.city:=tmpcity; oaddfromline.region:=tmpstate; oaddfromline.postalcode:=tmpzip; oaddfromline.country:=tmpcountry; END ELSE BEGIN oaddfromline.taxregionid:=tmptaxregionid; oaddfromline.latitude:=tmplatitude; oaddfromline.longitude:=tmplongitude; AvaWindowClose(); END ELSE BEGIN AvaWindowOpen(StrMessage+Text TmpAddressSrc); oaddfromline.line1:=oaddfrom.line1; oaddfromline.line2:=oaddfrom.line2; oaddfromline.line3:=oaddfrom.line3; oaddfromline.city:=oaddfrom.city; oaddfromline.region:=oaddfrom.region; oaddfromline.postalcode:=oaddfrom.postalcode; oaddfromline.country:=oaddfrom.country; AvaWindowClose(); AVAAddrLatLongFlag:=FALSE; oaddtoline := oaddtoline.address; SL.SETRANGE("Document No.",SalesLine."Document No."); SL.SETRANGE("Line No.",SalesLine."Line No."); SL.SETRANGE("Document Type",SL."Document Type"::Invoice); SL.SETRANGE(Type,SL.Type::Item); SL.SETFILTER(Quantity,'<>0'); SL.SETFILTER("Shipment No.", '<>%1',''); IF SL.FINDFIRST THEN BEGIN SSH.SETRANGE("No.",SL."Shipment No."); IF SSH.FINDFIRST THEN BEGIN SH.SETRANGE("No.",SSH."Order No."); IF SH.FINDFIRST THEN BEGIN fnisemptyaddress(1,sh,entityusecode); templ1:=sh."ship-to Address"; templ2:=sh."ship-to Address 2"; templ3:=''; tempcity:=sh."ship-to City"; tempstate:=sh."ship-to County"; tempzip:=fnavapincheck(sh."ship-to Post Code"); Avalara Inc. All rights reserved. Page 16 of 215
17 tempcountry:=format(sh."ship-to Country/Region Code"); IF tempcountry = '' THEN BEGIN IF NOT Avaconfig.Initiate THEN BEGIN AvaUSTaxCountry.SETRANGE(AvaUSTaxCountry.Code,'00'); IF AvaUSTaxCountry.FINDFIRST THEN TmpCountry := 'US' ELSE BEGIN AvaCANTaxCountry.SETRANGE(AvaCANTaxCountry.Code,'00'); IF AvaCANTaxCountry.FINDFIRST THEN TmpCountry := 'CA'; oaddtoline.line1:=templ1; oaddtoline.line2:=templ2; oaddtoline.line3:=templ3; oaddtoline.city:=tempcity; oaddtoline.region:=tempstate; oaddtoline.postalcode:=tempzip; oaddtoline.country:=tempcountry; oaddtoline.taxregionid:=0; oaddtoline.latitude:=''; oaddtoline.longitude:=''; oaddfinaltoline := oaddtoline; END ELSE oaddfinaltoline := oaddto; END ELSE oaddfinaltoline := oaddto; END ELSE oaddfinaltoline := oaddto; UnitPrice:=SalesLine."Unit Price"; fngetitemdetails(salesline.type,salesline."no.",salesline."tax Group Code", Ref1,Ref2,"G\LAccNo.",TaxibilityCode,UnitPrice); Disc:=FALSE; IF SalesLine."Inv. Discount Amount" <> 0 THEN Disc:=TRUE ELSE Disc:=FALSE; RecGLSetup.GET; //AVANA IF NOT AvaReleaseStatisticsBln THEN BEGIN IF Avaconfig."Statistics Quantity" = '1' THEN BEGIN LineAmtPassed:=ROUND((SalesLine.Quantity*UnitPrice) - ((SalesLine.Quantity * UnitPrice * SalesLine."Line Discount %")/100),RecGLSetup."Amount Rounding Precision",'<'); //AVANA QtyPerLine:=SalesLine.Quantity; END ELSE IF Avaconfig."Statistics Quantity" = '2' THEN BEGIN IF (SalesLine."Document Type" = SalesLine."Document Type" :: "Return Order") OR (SalesLine."Document Type" = SalesLine."Document Type" :: "Credit Memo") THEN BEGIN IF SalesLine."Return Qty. to Receive" > 0 THEN LineAmtPassed:=ROUND((SalesLine."Return Qty. to Receive"*UnitPrice) - ((SalesLine."Return Qty. to Receive" * UnitPrice * SalesLine."Line Discount %")/100),RecGLSetup."Amount Rounding Precision",'<') //AVANA ELSE Avalara Inc. All rights reserved. Page 17 of 215
18 LineAmtPassed:=ROUND((SalesLine.Quantity*UnitPrice) - ((SalesLine.Quantity * UnitPrice * SalesLine."Line Discount %")/100),RecGLSetup."Amount Rounding Precision",'<'); //AVANA QtyPerLine:=SalesLine."Return Qty. to Receive"; END ELSE BEGIN IF SalesLine."Qty. to Ship" > 0 THEN LineAmtPassed:=ROUND((SalesLine."Qty. to Ship"*UnitPrice) - ((SalesLine."Qty. to Ship" * UnitPrice * SalesLine."Line Discount %")/100),RecGLSetup."Amount Rounding Precision",'<') //AVANA ELSE LineAmtPassed:=ROUND((SalesLine.Quantity*UnitPrice) - ((SalesLine.Quantity * UnitPrice * SalesLine."Line Discount %")/100),RecGLSetup."Amount Rounding Precision",'<'); //AVANA QtyPerLine:=SalesLine."Qty. to Ship"; END ELSE IF Avaconfig."Statistics Quantity" = '3' THEN BEGIN IF SalesLine."Qty. to Invoice" > 0 THEN LineAmtPassed:=ROUND((SalesLine."Qty. to Invoice"*UnitPrice) - ((SalesLine."Qty. to Invoice" * UnitPrice * SalesLine."Line Discount %")/100),RecGLSetup."Amount Rounding Precision",'<') //AVANA ELSE LineAmtPassed:=ROUND((SalesLine.Quantity*UnitPrice) - ((SalesLine.Quantity * UnitPrice * SalesLine."Line Discount %")/100),RecGLSetup."Amount Rounding Precision",'<'); //AVANA QtyPerLine:=SalesLine."Qty. to Invoice"; END ELSE BEGIN IF Avaconfig."Release Quantity" = '1' THEN BEGIN LineAmtPassed:=ROUND((SalesLine.Quantity*UnitPrice) - ((SalesLine.Quantity * UnitPrice * SalesLine."Line Discount %")/100),RecGLSetup."Amount Rounding Precision",'<'); //AVANA QtyPerLine:=SalesLine.Quantity; END ELSE IF Avaconfig."Release Quantity" = '2' THEN BEGIN IF (SalesLine."Document Type" = SalesLine."Document Type" :: "Credit Memo") OR (SalesLine."Document Type" = SalesLine."Document Type" :: "Return Order") THEN BEGIN IF SalesLine."Return Qty. to Receive" > 0 THEN LineAmtPassed:=ROUND((SalesLine."Return Qty. to Receive"*UnitPrice) - ((SalesLine."Return Qty. to Receive" * UnitPrice * SalesLine."Line Discount %")/100),RecGLSetup."Amount Rounding Precision",'<') //AVANA ELSE LineAmtPassed:=ROUND((SalesLine.Quantity*UnitPrice) - ((SalesLine.Quantity * UnitPrice * SalesLine."Line Discount %")/100),RecGLSetup."Amount Rounding Precision",'<'); //AVANA QtyPerLine:=SalesLine."Return Qty. to Receive"; END ELSE BEGIN IF SalesLine."Qty. to Ship" > 0 THEN LineAmtPassed:=ROUND((SalesLine."Qty. to Ship"*UnitPrice) - ((SalesLine."Qty. to Ship" * UnitPrice * SalesLine."Line Discount %")/100),RecGLSetup."Amount Rounding Precision",'<') //AVANA ELSE LineAmtPassed:=ROUND((SalesLine.Quantity*UnitPrice) - ((SalesLine.Quantity * UnitPrice * SalesLine."Line Discount %")/100),RecGLSetup."Amount Rounding Precision",'<'); //AVANA QtyPerLine:=SalesLine."Qty. to Ship"; END ELSE IF Avaconfig."Release Quantity" = '3' THEN BEGIN IF SalesLine."Qty. to Invoice" > 0 THEN LineAmtPassed:=ROUND((SalesLine."Qty. to Invoice"*UnitPrice) - ((SalesLine."Qty. to Invoice" * UnitPrice * SalesLine."Line Discount %")/100),RecGLSetup."Amount Rounding Precision",'<') //AVANA ELSE LineAmtPassed:=ROUND((SalesLine.Quantity*UnitPrice) - ((SalesLine.Quantity * UnitPrice * SalesLine."Line Discount %")/100),RecGLSetup."Amount Rounding Precision",'<'); //AVANA QtyPerLine:=SalesLine."Qty. to Invoice"; IF TDocType=1 THEN BEGIN IF QtyPerLine < 0 THEN Avalara Inc. All rights reserved. Page 18 of 215
19 QtyPerLine:=QtyPerLine*-1; END ELSE IF TDocType=5 THEN BEGIN IF QtyPerLine < 0 THEN QtyPerLine:=QtyPerLine*-1; LineAmtPassed:= LineAmtPassed * -1; IF Disc THEN IF NOT (SalesLine.Quantity=0) THEN TotalDisc:=TotalDisc + ((SalesLine."Inv. Discount Amount"/SalesLine.Quantity)*QtyPerLine) ELSE TotalDisc:=TotalDisc + 0; AvaWindowOpen(StrMessage+Text ); fnupdatetaxcode(salesline); fngettaxline(ogettaxrequest, oaddfromline, oaddfinaltoline, ShipMethodLine, SalesLine."Line No.", SalesLine."No.", SalesLine.Description, QtyPerLine, LineAmtPassed, Disc, ExemptionNo, Ref1, Ref2, "G\LAccNo.", TaxibilityCode, EntityUseCode, otaxlines, OutStatus); AvaWindowClose(); ////CONECT-1361 UNTIL SalesLine.NEXT = 0; IF TotalDisc <> 0 THEN ogettaxrequest.discount:=totaldisc*dcoefficient; StrMessage:=Text FORMAT(SalesHead."No.",STRLEN(FORMAT(SalesHead."No."))); AvaWindowOpen(StrMessage+Text ); GetResultCode:=fnGetTaxFinal(oGetTaxRequest,oGetTaxResult); TotalTax:=oGetTaxResult.TotalTax; AvaWindowClose(); CASE GetResultCode OF 0: Result:=TRUE; 1: BEGIN AvaUserPref.SETRANGE(AvaUserPref."User Pref Name",USERID); IF AvaUserPref.FINDFIRST THEN BEGIN IF AvaUserPref.Warnings THEN BEGIN Result:=FALSE; MESSAGE(Text '%1',oGetTaxResult.Messages.Item(0).Summary); Avalara Inc. All rights reserved. Page 19 of 215
20 END ELSE BEGIN IF Avaconfig."Display Warnings" THEN BEGIN Result:=FALSE; MESSAGE(Text '%1',oGetTaxResult.Messages.Item(0).Summary); 2: BEGIN Result:=FALSE; IF ogettaxresult.messages.item(0).severity = 2 THEN ERROR('Document No. : ' + SalesHead."No."+' ' +Text '%1',oGetTaxResult.Messages.Item(0).Summary) ELSE IF ogettaxresult.messages.item(1).severity = 2 THEN ERROR(Text '%1',oGetTaxResult.Messages.Item(1).Summary) ELSE IF ogettaxresult.messages.item(2).severity = 2 THEN ERROR(Text '%1',oGetTaxResult.Messages.Item(2).Summary); ELSE BEGIN Result:=FALSE; ERROR(Text Text ); AvaWindowOpen(StrMessage+Text ); HdrID:=fnObjToTbl(oGetTaxRequest,oGetTaxResult,oGetTaxResult.DocCode,TDocType,DT2DATE(oGetTaxResult.DocD ate),documenttype); fnqtyamtord(hdrid,salesline,false); //AVANA IF NOT Avaconfig."Show Message Dialog" THEN Window.CLOSE ELSE AvaWindowClose(); fnclear; Changes in function fncalctax1 Remvoe Field QtyShipRec from Local variable Modifed Code (Search for 1 st Line) changes highlieghted in red Color DtlLevel:=3; EntityUseCode:=''; SalesHead.SETRANGE(SalesHead."No.",SalesHeaderNo); SalesHead.SETRANGE(SalesHead."Document Type",SalesHeaderType); SalesHead.FINDFIRST; ShipMethod:=0; IF STRPOS(SalesHead."Shipment Method Code",Text ) <> 0 THEN ShipMethod:=1 ELSE IF STRPOS(SalesHead."Tax Area Code",Text ) <> 0 THEN ShipMethod:=2; DocumentType := FORMAT(SalesHead."Document Type"); StrMessage:=Text FORMAT(SalesHead."No.",STRLEN(FORMAT(SalesHead."No."))); Avalara Inc. All rights reserved. Page 20 of 215
21 AvaCheckSalesTaxAdjust(SalesHead."No.", SalesHead."Document Type",FALSE); ExemptionNo:=''; Modifed Code (Search for 1 st Line) changes highlieghted in red Color UnitPrice:=SalesLine."Unit Price"; fngetitemdetails(salesline.type,salesline."no.",salesline."tax Group Code",Ref1,Ref2,"G\LAccNo.",TaxibilityCode,UnitPrice); Disc:=FALSE; IF SalesLine."Inv. Discount Amount" <> 0 THEN Disc:=TRUE ELSE Disc:=FALSE; RecGLSetup.GET; //AVANA Avaconfig.FINDFIRST; InvoiceFlag := Avaconfig.Invoice; IF (SalesLine."Qty. Shipped Not Invoiced") <> 0 THEN BEGIN IF InvoiceFlag THEN BEGIN IF SalesLine."Qty. Shipped Not Invoiced" < SalesLine."Qty. to Invoice" THEN BEGIN LineAmtPassed:=ROUND((SalesLine."Qty. Shipped Not Invoiced"*UnitPrice) - ((SalesLine."Qty. Shipped Not Invoiced" * UnitPrice * SalesLine."Line Discount %")/100),RecGLSetup."Amount Rounding Precision",'<'); //AVANA QtyPerLine:=SalesLine."Qty. Shipped Not Invoiced"; END ELSE BEGIN LineAmtPassed:=ROUND((SalesLine."Qty. to Invoice"*UnitPrice) - ((SalesLine."Qty. to Invoice" * UnitPrice * SalesLine."Line Discount %")/100),RecGLSetup."Amount Rounding Precision",'<'); //AVANA QtyPerLine:=SalesLine."Qty. to Invoice"; END ELSE BEGIN IF SalesLine."Qty. Shipped Not Invoiced" < SalesLine."Qty. to Invoice" THEN BEGIN LineAmtPassed:=ROUND((((SalesLine."Qty. Shipped Not Invoiced")+(SalesLine."Qty. to Ship"))*UnitPrice) - (((SalesLine."Qty. Shipped Not Invoiced" + SalesLine."Qty. to Ship")* UnitPrice * SalesLine."Line Discount %")/100), RecGLSetup."Amount Rounding Precision",'<'); //AVANA QtyPerLine:=(SalesLine."Qty. Shipped Not Invoiced")+(SalesLine."Qty. to Ship"); END ELSE BEGIN LineAmtPassed:=ROUND((SalesLine."Qty. to Invoice"*UnitPrice) - ((SalesLine."Qty. to Invoice" * UnitPrice * SalesLine."Line Discount %")/100),RecGLSetup."Amount Rounding Precision",'<'); //AVANA QtyPerLine:=SalesLine."Qty. to Invoice"; END IF (SalesLine."Qty. Shipped Not Invoiced" = 0) AND (InvoiceFlag = FALSE) THEN BEGIN LineAmtPassed:=ROUND((SalesLine."Qty. to Invoice"*UnitPrice) - ((SalesLine."Qty. to Invoice" * UnitPrice * SalesLine."Line Discount %")/100),RecGLSetup."Amount Rounding Precision",'<'); //AVANA QtyPerLine:=SalesLine."Qty. to Invoice"; IF (SalesLine."Document Type" = SalesLine."Document Type" :: "Credit Memo") OR (SalesLine."Document Type" = SalesLine."Document Type" :: "Return Order") THEN BEGIN IF (SalesLine."Return Qty. Rcd. Not Invd.") <> 0 THEN BEGIN Avaconfig.FINDFIRST; InvoiceFlag := Avaconfig.Invoice; IF InvoiceFlag THEN BEGIN Avalara Inc. All rights reserved. Page 21 of 215
22 IF SalesLine."Return Qty. Rcd. Not Invd." < SalesLine."Qty. to Invoice" THEN BEGIN LineAmtPassed:=ROUND((SalesLine."Return Qty. Rcd. Not Invd."*UnitPrice) - ((SalesLine."Return Qty. Rcd. Not Invd." * UnitPrice * SalesLine."Line Discount %")/100),RecGLSetup."Amount Rounding Precision",'<'); //AVANA QtyPerLine:=SalesLine."Return Qty. Rcd. Not Invd."; END ELSE BEGIN LineAmtPassed:=ROUND((SalesLine."Qty. to Invoice"*UnitPrice) - ((SalesLine."Qty. to Invoice" * UnitPrice * SalesLine."Line Discount %")/100),RecGLSetup."Amount Rounding Precision",'<'); //AVANA QtyPerLine:=SalesLine."Qty. to Invoice"; END ELSE BEGIN IF SalesLine."Return Qty. Rcd. Not Invd." < SalesLine."Qty. to Invoice" THEN BEGIN LineAmtPassed:=ROUND((((SalesLine."Return Qty. Rcd. Not Invd.")+(SalesLine."Return Qty. to Receive"))*UnitPrice) - (((SalesLine."Return Qty. Rcd. Not Invd." + SalesLine."Return Qty. to Receive") * UnitPrice * SalesLine."Line Discount %")/100),RecGLSetup."Amount Rounding Precision",'<'); //AVANA QtyPerLine:=(SalesLine."Return Qty. Rcd. Not Invd.")+(SalesLine."Return Qty. to Receive"); END ELSE BEGIN LineAmtPassed:=ROUND((SalesLine."Qty. to Invoice"*UnitPrice) - ((SalesLine."Qty. to Invoice" * UnitPrice * SalesLine."Line Discount %")/100),RecGLSetup."Amount Rounding Precision",'<'); //AVANA QtyPerLine:=SalesLine."Qty. to Invoice"; END IF (SalesLine."Return Qty. Rcd. Not Invd." = 0) AND (InvoiceFlag=FALSE) THEN BEGIN LineAmtPassed:=ROUND((SalesLine."Qty. to Invoice"*UnitPrice) - ((SalesLine."Qty. to Invoice" * UnitPrice * SalesLine."Line Discount %")/100),RecGLSetup."Amount Rounding Precision",'<'); //AVANA QtyPerLine:=SalesLine."Qty. to Invoice"; IF TDocType=1 THEN BEGIN IF QtyPerLine < 0 THEN QtyPerLine:=QtyPerLine*-1; END ELSE IF TDocType=5 THEN BEGIN IF QtyPerLine < 0 THEN QtyPerLine:=QtyPerLine; LineAmtPassed:= LineAmtPassed * -1; IF Disc THEN IF NOT (SalesLine.Quantity=0) THEN TotalDisc:=TotalDisc + ((SalesLine."Inv. Discount Amount"/SalesLine.Quantity)*QtyPerLine) ELSE TotalDisc:=TotalDisc + 0; AvaWindowOpen(StrMessage+Text ); fnupdatetaxcode(salesline); fngettaxline(ogettaxrequest, oaddfromline, oaddfinaltoline, ShipMethodLine, SalesLine."Line No.", SalesLine."No.", SalesLine.Description, QtyPerLine, LineAmtPassed, Disc, Avalara Inc. All rights reserved. Page 22 of 215
23 ExemptionNo, Ref1, Ref2, "G\LAccNo.", TaxibilityCode, EntityUseCode, otaxlines, OutStatus); AvaWindowClose(); UNTIL SalesLine.NEXT = 0; IF TotalDisc <> 0 THEN ogettaxrequest.discount:=totaldisc*dcoefficient; StrMessage:=Text FORMAT(SalesHead."No.",STRLEN(FORMAT(SalesHead."No."))); AvaWindowOpen(StrMessage+Text ); GetResultCode:=fnGetTaxFinal(oGetTaxRequest,oGetTaxResult); TotalTax:=oGetTaxResult.TotalTax; AvaWindowClose(); CASE GetResultCode OF 0: Result:=TRUE; 1: BEGIN AvaUserPref.SETRANGE(AvaUserPref."User Pref Name",USERID); IF AvaUserPref.FINDFIRST THEN BEGIN IF AvaUserPref.Warnings THEN BEGIN Result:=FALSE; MESSAGE(Text '%1',oGetTaxResult.Messages.Item(0).Summary); END ELSE BEGIN IF Avaconfig."Display Warnings" THEN BEGIN Result:=FALSE; MESSAGE(Text '%1',oGetTaxResult.Messages.Item(0).Summary); 2: BEGIN Result:=FALSE; IF ogettaxresult.messages.item(0).severity = 2 THEN ERROR('Document No. : ' + SalesHead."No."+' ' +Text '%1',oGetTaxResult.Messages.Item(0).Summary) ELSE IF ogettaxresult.messages.item(1).severity = 2 THEN ERROR(Text '%1',oGetTaxResult.Messages.Item(1).Summary) ELSE IF ogettaxresult.messages.item(2).severity = 2 THEN ERROR(Text '%1',oGetTaxResult.Messages.Item(2).Summary); ELSE BEGIN Result:=FALSE; ERROR(Text Text ); AvaWindowOpen(StrMessage+Text ); HdrID:=fnObjToTbl(oGetTaxRequest,oGetTaxResult,oGetTaxResult.DocCode,TDocType,DT2DATE(oGetTaxResult.DocD ate),documenttype); Avalara Inc. All rights reserved. Page 23 of 215
24 fnqtyamtord(hdrid,salesline,true); AvaWindowClose(); fnclear; Changes in function fncalctaxbatch Modifed Code (Search for 1 st Line) changes highlieghted in red Color DtlLevel:=3; EntityUseCode:=''; SalesHead.SETRANGE(SalesHead."No.",SalesHeaderNo); SalesHead.SETRANGE(SalesHead."Document Type",SalesHeaderType); SalesHead.FINDFIRST; ShipMethod:=0; IF STRPOS(SalesHead."Shipment Method Code",Text ) <> 0 THEN ShipMethod:=1 ELSE IF STRPOS(SalesHead."Tax Area Code",Text ) <> 0 THEN ShipMethod:=2; DocumentType := FORMAT(SalesHead."Document Type"); AvaCheckSalesTaxAdjust(SalesHead."No.", SalesHead."Document Type",FALSE); ExemptionNo:=''; Modifed Code (Search for 1 st Line) changes highlieghted in red Color Disc:=FALSE; IF SalesLine."Inv. Discount Amount" <> 0 THEN Disc:=TRUE ELSE Disc:=FALSE; IF NOT (SalesHead.Ship AND SalesHead.Invoice) THEN BEGIN RecGLSetup.GET; //AVANA IF NOT AvaReleaseStatisticsBln THEN BEGIN //CONNECT-1596 IF Avaconfig."Statistics Quantity" = '1' THEN BEGIN LineAmtPassed:=ROUND((SalesLine.Quantity*UnitPrice) - ((SalesLine.Quantity * UnitPrice * SalesLine."Line Discount %")/100),RecGLSetup."Amount Rounding Precision",'<'); //AVANA QtyPerLine:=SalesLine.Quantity; END ELSE IF Avaconfig."Statistics Quantity" = '2' THEN BEGIN IF (SalesLine."Document Type" = SalesLine."Document Type" :: "Credit Memo") OR (SalesLine."Document Type" = SalesLine."Document Type" :: "Return Order") THEN BEGIN LineAmtPassed:=ROUND((SalesLine."Return Qty. to Receive"*UnitPrice) - ((SalesLine."Return Qty. to Receive" * UnitPrice * SalesLine."Line Discount %")/100),RecGLSetup."Amount Rounding Precision",'<'); //AVANA QtyPerLine:=SalesLine."Return Qty. to Receive"; END ELSE BEGIN LineAmtPassed:=ROUND((SalesLine."Qty. to Ship"*UnitPrice) - ((SalesLine."Qty. to Ship" * UnitPrice * SalesLine."Line Discount %")/100),RecGLSetup."Amount Rounding Precision",'<'); //AVANA QtyPerLine:=SalesLine."Qty. to Ship"; END ELSE IF Avaconfig."Statistics Quantity" = '3' THEN BEGIN LineAmtPassed:=ROUND((SalesLine."Qty. to Invoice"*UnitPrice) - ((SalesLine."Qty. to Invoice" * UnitPrice * SalesLine."Line Discount %")/100),RecGLSetup."Amount Rounding Precision",'<'); //AVANA QtyPerLine:=SalesLine."Qty. to Invoice"; END ELSE BEGIN IF Avaconfig."Release Quantity" = '1' THEN BEGIN Avalara Inc. All rights reserved. Page 24 of 215
25 LineAmtPassed:=ROUND((SalesLine.Quantity*UnitPrice) - ((SalesLine.Quantity * UnitPrice * SalesLine."Line Discount %")/100),RecGLSetup."Amount Rounding Precision",'<'); //AVANA QtyPerLine:=SalesLine.Quantity; END ELSE IF Avaconfig."Release Quantity" = '2' THEN BEGIN IF (SalesLine."Document Type" = SalesLine."Document Type" :: "Credit Memo") OR (SalesLine."Document Type" = SalesLine."Document Type" :: "Return Order") THEN BEGIN LineAmtPassed:=ROUND((SalesLine."Return Qty. to Receive"*UnitPrice) - ((SalesLine."Return Qty. to Receive" * UnitPrice * SalesLine."Line Discount %")/100),RecGLSetup."Amount Rounding Precision",'<'); //AVANA QtyPerLine:=SalesLine."Return Qty. to Receive"; END ELSE BEGIN LineAmtPassed:=ROUND((SalesLine."Qty. to Ship"*UnitPrice) - ((SalesLine."Qty. to Ship" * UnitPrice * SalesLine."Line Discount %")/100),RecGLSetup."Amount Rounding Precision",'<'); //AVANA QtyPerLine:=SalesLine."Qty. to Ship"; END ELSE IF Avaconfig."Release Quantity" = '3' THEN BEGIN LineAmtPassed:=ROUND((SalesLine."Qty. to Invoice"*UnitPrice) - ((SalesLine."Qty. to Invoice" * UnitPrice * SalesLine."Line Discount %")/100),RecGLSetup."Amount Rounding Precision",'<'); //AVANA QtyPerLine:=SalesLine."Qty. to Invoice"; IF TDocType=1 THEN BEGIN IF QtyPerLine < 0 THEN QtyPerLine:=QtyPerLine*-1; END ELSE IF TDocType=5 THEN BEGIN IF QtyPerLine < 0 THEN QtyPerLine:=QtyPerLine; LineAmtPassed:= LineAmtPassed * -1; IF Disc THEN IF NOT (SalesLine.Quantity=0) THEN TotalDisc:=TotalDisc + ((SalesLine."Inv. Discount Amount"/SalesLine.Quantity)*QtyPerLine) ELSE TotalDisc:=TotalDisc + 0; AvaWindowOpen(StrMessage+Text ); fnupdatetaxcode(salesline); fngettaxline(ogettaxrequest, oaddfromline, oaddfinaltoline, ShipMethodLine, SalesLine."Line No.", SalesLine."No.", SalesLine.Description, QtyPerLine*DCoefficient, LineAmtPassed*DCoefficient, Disc, ExemptionNo, Ref1, Ref2, "G\LAccNo.", TaxibilityCode, EntityUseCode, otaxlines, OutStatus); AvaWindowClose(); Avalara Inc. All rights reserved. Page 25 of 215
26 UNTIL SalesLine.NEXT = 0; IF TotalDisc <> 0 THEN ogettaxrequest.discount:=totaldisc*dcoefficient; StrMessage:=Text FORMAT(SalesHead."No.",STRLEN(FORMAT(SalesHead."No."))); AvaWindowOpen(StrMessage+Text ); GetResultCode:=fnGetTaxFinal(oGetTaxRequest,oGetTaxResult); TotalTax:=oGetTaxResult.TotalTax; AvaWindowClose(); CASE GetResultCode OF 0: Result:=TRUE; 1: BEGIN AvaUserPref.SETRANGE(AvaUserPref."User Pref Name",USERID); IF AvaUserPref.FINDFIRST THEN BEGIN IF AvaUserPref.Warnings THEN BEGIN Result:=FALSE; iresulttype:=1; tresultmessage:=text ogettaxresult.messages.item(0).summary; EXIT(FALSE); END ELSE BEGIN IF Avaconfig."Display Warnings" THEN BEGIN Result:=FALSE; iresulttype:=1; tresultmessage:=text ogettaxresult.messages.item(0).summary; EXIT(FALSE); 2: BEGIN Result:=FALSE; IF ogettaxresult.messages.item(0).severity = 2 THEN BEGIN iresulttype:=2; tresultmessage:=text ogettaxresult.messages.item(0).summary ; Status := 'Error'; AVABatchTaxFill(SalesHead,tResultMessage,Status); EXIT(FALSE); END ELSE IF ogettaxresult.messages.item(1).severity = 2 THEN BEGIN iresulttype:=2; tresultmessage:=text ogettaxresult.messages.item(1).summary; Status := 'Error'; AVABatchTaxFill(SalesHead,tResultMessage,Status); EXIT(FALSE); END ELSE IF ogettaxresult.messages.item(2).severity = 2 THEN BEGIN iresulttype:=2; tresultmessage:=text ogettaxresult.messages.item(2).summary; Status := 'Error'; AVABatchTaxFill(SalesHead,tResultMessage,Status); EXIT(FALSE); ELSE BEGIN Result:=FALSE; Avalara Inc. All rights reserved. Page 26 of 215
27 iresulttype:=2; tresultmessage:=text Text ; Status := 'Error'; AVABatchTaxFill(SalesHead,tResultMessage,Status); EXIT(FALSE); AvaWindowOpen(StrMessage+Text ); HdrID:=fnObjToTbl(oGetTaxRequest,oGetTaxResult,oGetTaxResult.DocCode,TDocType,DT2DATE(oGetTaxResult.DocD ate),documenttype); fnqtyamtord(hdrid,salesline,false); IF NOT Avaconfig."Show Message Dialog" THEN Window.CLOSE ELSE AvaWindowClose(); Remarks := 'Success'; Status := 'Success'; AVABatchTaxFill(SalesHead,Remarks,Status); fnclear; Changes in function fngettaxline Local Variables: Name Data Type Subtype Length AvaUseUPCCode Record Modified code (Search for 1 st line and add colored Lines) oaddfromtmp := oaddfromtmp.address; oaddfromtmp.line1:=oaddfrom.line1; oaddfromtmp.line2:=oaddfrom.line2; oaddfromtmp.line3:=oaddfrom.line3; oaddfromtmp.city:=oaddfrom.city; oaddfromtmp.region:=oaddfrom.region; oaddfromtmp.country:=oaddfrom.country; oaddfromtmp.postalcode:=oaddfrom.postalcode; oline := oline.line; oline.no:=format(num); IF(Avaconfig."Use UPC as Item Code") AND AvaUseUPCCode.GET(ItemCode) THEN oline.itemcode := AvaUseUPCCode."Item UPC Code" ELSE oline.itemcode:=itemcode; oline.description:=itemdesc; oline.qty:=qty; Avalara Inc. All rights reserved. Page 27 of 215
28 Changes in function fnobjtotbl Local Variables: Name Data Type Subtype Length RecGLSetup Record 98 PrepLineAmt Decimal Modified code (Search for 1 st line and add colored Lines) AvaLine."Item No." := orequest.lines.item(i).itemcode; AvaLine.Quantity := orequest.lines.item(i).qty; AvaLine."Line Ref 1" := orequest.lines.item(i).ref1; AvaLine."Line Ref 2" := orequest.lines.item(i).ref2; AvaLine."Tax Discount Amount" := oresult.taxlines.item(i).discount*dcoefficient; AvaLine."Tax Exempt Amount" := oresult.taxlines.item(i).exemption*dcoefficient; AvaLine."Exemption No." := orequest.lines.item(i).exemptionno; AvaLine."Tax Tax Amount" := oresult.taxlines.item(i).tax*dcoefficient; AvaLine."Total Taxable Amount" := oresult.taxlines.item(i).taxable*dcoefficient; AvaLine.Taxability := oresult.taxlines.item(i).taxability; AvaLine."Tax Code" := orequest.lines.item(i).taxcode; AvaLine."Tax Rate" := oresult.taxlines.item(i).rate; AvaLine."Entity No." := orequest.customerusagetype; AvaLine."Tax Area" := 'AVATAX'; IF NOT(COPYSTR(AvaHead."Document No.",1,3) = 'SER') THEN BEGIN SalesLine.SETRANGE(SalesLine."Document No.",COPYSTR(AvaHead."Document No.",4,100)); SalesLine.SETFILTER(SalesLine."Line No.",oTaxLine.No); SalesLine.SETFILTER("Document Type",DocumentType); SalesLine.SETRANGE("Document Type",SalesOrderHdr."Document Type"); IF SalesLine.FINDFIRST THEN BEGIN AvaLine."Tax Area" := SalesLine."Tax Area Code"; SalesLine."Amount Including VAT" := AvaLine."Tax Tax Amount" + AvaLine."Total Taxable Amount"; //AVANA start RecGLSetup.GET; IF (SalesLine."Prepayment %" > 0) AND (SalesOrderHdr."Prepmt. Include Tax") AND (AvaLine."Tax Tax Amount" > 0) THEN SalesLine."VAT %" := AvaLine."Tax Rate" * 100; SalesLine."Prepmt. Line Amount" := ROUND((SalesLine."Prepayment %" * SalesLine."Line Amount") / 100,RecGLSetup."Inv. Rounding Precision (LCY)"); PrepLineAmt := AvaLine."Total Taxable Amount" + AvaLine."Tax Tax Amount" + AvaLine."Tax Exempt Amount" + AvaLine."Tax Discount Amount"; IF SalesOrderHdr."Prepmt. Include Tax" THEN SalesLine."Prepmt. Amt. Incl. VAT" := ROUND((SalesLine."Prepayment %" * PrepLineAmt) / 100,RecGLSetup."Inv. Rounding Precision (LCY)") ELSE SalesLine."Prepmt. Amt. Incl. VAT" := SalesLine."Prepmt. Line Amount"; SalesLine."Prepayment Amount" := SalesLine."Prepmt. Amt. Incl. VAT"; //AVANA end SalesLine.MODIFY; END ELSE BEGIN SalesInvLine.SETRANGE(SalesInvLine."Document No.",COPYSTR(AvaHead."Document No.",4,100)); SalesInvLine.SETFILTER(SalesInvLine."Line No.",oTaxLine.No); IF SalesInvLine.FINDFIRST THEN AvaLine."Tax Area" := SalesInvLine."Tax Area Code" ELSE BEGIN Avalara Inc. All rights reserved. Page 28 of 215
29 recobjpostedcrline.setrange(recobjpostedcrline."document No.",COPYSTR(AvaHead."Document No.",4,100)); Changes in Function fnqtyamtord New code AvaHead.SETRANGE(AvaHead."No.",HdrID); IF AvaHead.FINDFIRST THEN BEGIN AvaLine.RESET; AvaLine.SETRANGE(AvaLine."Tax Header No.",HdrID); IF AvaLine.FINDFIRST THEN REPEAT IF SalesLine.FINDFIRST THEN REPEAT IF FORMAT(SalesLine."Line No.") = AvaLine."Tax Line No." THEN BEGIN AvaLine."Quantity Full":=SalesLine.Quantity; AvaLine."Quantity Inv.":=SalesLine."Qty. to Invoice"; IF TDocType = 5 THEN AvaLine."Quantity Shipped":=SalesLine."Return Qty. to Receive" ELSE AvaLine."Quantity Shipped":=SalesLine."Qty. to Ship"; AvaLine."Amount Full":=ROUND(SalesLine."Line Amount"-SalesLine."Inv. Discount Amount"-AvaLine."Tax Exempt Amount"); AvaLine."Discount Full":=ROUND(SalesLine."Inv. Discount Amount"); IF SalesLine.Quantity <> 0 THEN BEGIN AvaLine."Amount Inv.":= ROUND((SalesLine."Line Amount"-SalesLine."Inv. Discount Amount"-AvaLine."Tax Exempt Amount")/SalesLine.Quantity*SalesLine."Qty. to Invoice"); IF TDocType = 5 THEN AvaLine."Amount Shipped":=ROUND((SalesLine."Line Amount"-SalesLine."Inv. Discount Amount"-AvaLine."Tax Exempt Amount")/SalesLine.Quantity*SalesLine."Qty. to Invoice") ELSE AvaLine."Amount Shipped":= ROUND((SalesLine."Line Amount"-SalesLine."Inv. Discount Amount"-AvaLine."Tax Exempt Amount")/SalesLine.Quantity*SalesLine."Qty. to Ship"); AvaLine."Discount Inv.":=ROUND((SalesLine."Inv. Discount Amount"/SalesLine.Quantity)*SalesLine."Qty. to Invoice"); AvaLine."Discount Shipped":=ROUND((SalesLine."Inv. Discount Amount"/SalesLine.Quantity)*SalesLine."Qty. to Ship"); IF NOT AvaInvoiceType THEN BEGIN AvaLine."Tax Full":=0; AvaLine."Tax Inv.":=0; AvaLine."Tax Shipped":=0; IF AvaLine."Tax Tax Amount" <> 0 THEN BEGIN IF AvaLine."Quantity Inv." <> 0 THEN BEGIN Avalara Inc. All rights reserved. Page 29 of 215
30 IF NOT AvaInvoiceType THEN BEGIN IF Avaconfig."Statistics Quantity" = '1' THEN BEGIN AvaLine."Tax Full":=ROUND(AvaLine."Quantity Full"*(AvaLine."Tax Tax Amount"/AvaLine."Quantity Full")); AvaLine."Tax Inv.":=ROUND(AvaLine."Quantity Inv."*(AvaLine."Tax Tax Amount"/AvaLine."Quantity Full")); AvaLine."Tax Shipped":=ROUND(AvaLine."Quantity Shipped"*(AvaLine."Tax Tax Amount"/AvaLine."Quantity Full")); END ELSE IF Avaconfig."Statistics Quantity" = '2' THEN BEGIN AvaLine."Tax Full":=ROUND(AvaLine."Quantity Full"*(AvaLine."Tax Tax Amount"/AvaLine."Quantity Shipped")); AvaLine."Tax Inv.":=ROUND(AvaLine."Quantity Inv."*(AvaLine."Tax Tax Amount"/AvaLine."Quantity Shipped")); AvaLine."Tax Shipped":=ROUND(AvaLine."Quantity Shipped"*(AvaLine."Tax Tax Amount"/AvaLine."Quantity Shipped")); END ELSE IF Avaconfig."Statistics Quantity" = '3' THEN BEGIN AvaLine."Tax Full":=ROUND(AvaLine."Quantity Full"*(AvaLine."Tax Tax Amount"/AvaLine."Quantity Inv.")); AvaLine."Tax Inv.":=ROUND(AvaLine."Quantity Inv."*(AvaLine."Tax Tax Amount"/AvaLine."Quantity Inv.")); AvaLine."Tax Shipped":=ROUND(AvaLine."Quantity Shipped"*(AvaLine."Tax Tax Amount"/AvaLine."Quantity Inv.")); END ELSE BEGIN AvaLine."Tax Full":=ROUND(AvaLine."Quantity Full"*(AvaLine."Tax Tax Amount"/AvaLine."Quantity Inv.")); AvaLine."Tax Inv.":=ROUND(AvaLine."Quantity Inv."*(AvaLine."Tax Tax Amount"/AvaLine."Quantity Inv.")); AvaLine."Tax Shipped":=ROUND(AvaLine."Quantity Shipped"*(AvaLine."Tax Tax Amount"/AvaLine."Quantity Inv.")); AvaLine.MODIFY; UNTIL SalesLine.NEXT = 0; UNTIL AvaLine.NEXT=0; Remove Function fnqtyamtord1 Remove completed function Changes in function AVABatchTaxFill Modified code (Search for 1 st line and add colored Lines) IF Salesline.FINDFIRST THEN BEGIN REPEAT Amt += (Salesline.Amount + Salesline."Inv. Discount Amount"); TaxAmt += (AvaLine."Tax Tax Amount"); Totaldisc += Salesline."Line Discount Amount"; AmtIncTax += Salesline."Amount Including VAT"; UNTIL Salesline.NEXT = 0; Avalara Inc. All rights reserved. Page 30 of 215
31 AvaCheckSalesTaxAdjust(SalesHead."No.", SalesHead."Document Type",FALSE); ExemptionNo:=''; IF Avaconfig."Exempt Processing" = Avaconfig."Exempt Processing" :: "Bill-to Customer" THEN BEGIN Cust.SETRANGE(Cust."No.",SalesHead."Bill-to Customer No."); Changes in function fnservicecalctax Modified code (Search for 1 st line and add colored Lines) DtlLevel:=3; EntityUseCode:=''; ServiceHead.SETRANGE(ServiceHead."No.",ServiceHeaderNo); ServiceHead.SETRANGE(ServiceHead."Document Type",ServiceHeaderType); ServiceHead.FINDFIRST; DocumentType := FORMAT(ServiceHead."Document Type"); StrMessage:=Text FORMAT(ServiceHead."No.",STRLEN(FORMAT(ServiceHead."No."))); AvaCheckSalesTaxAdjust(ServiceHead."No.", ServiceHead."Document Type",TRUE); ExemptionNo:=''; Disc:=FALSE; IF ServiceLine."Inv. Discount Amount" <> 0 THEN Disc:=TRUE ELSE Disc:=FALSE; RecGLSetup.GET; //AVANA IF Avaconfig."Statistics Quantity" = '1' THEN BEGIN LineAmtPassed:=ROUND((ServiceLine.Quantity*UnitPrice) - ((ServiceLine.Quantity * UnitPrice * ServiceLine."Line Discount %")/100),RecGLSetup."Amount Rounding Precision",'<'); //AVANA QtyPerLine:=ServiceLine.Quantity; END ELSE IF Avaconfig."Statistics Quantity" = '2' THEN BEGIN IF (ServiceLine."Document Type" = ServiceLine."Document Type" :: "Credit Memo") THEN BEGIN LineAmtPassed:=ROUND((ServiceLine."Qty. to Invoice"*UnitPrice) - ((ServiceLine."Qty. to Invoice" * UnitPrice * ServiceLine."Line Discount %")/100),RecGLSetup."Amount Rounding Precision",'<'); //AVANA QtyPerLine:=ServiceLine."Qty. to Invoice"; END ELSE BEGIN LineAmtPassed:=ROUND((ServiceLine."Qty. to Ship"*UnitPrice) - ((ServiceLine."Qty. to Ship" * UnitPrice * ServiceLine."Line Discount %")/100),RecGLSetup."Amount Rounding Precision",'<'); //AVANA QtyPerLine:=ServiceLine."Qty. to Ship"; END ELSE IF Avaconfig."Statistics Quantity" = '3' THEN BEGIN LineAmtPassed:=ROUND((ServiceLine."Qty. to Invoice"*UnitPrice) - ((ServiceLine."Qty. to Invoice" * UnitPrice * ServiceLine."Line Discount %")/100),RecGLSetup."Amount Rounding Precision",'<'); //AVANA Avalara Inc. All rights reserved. Page 31 of 215
32 QtyPerLine:=ServiceLine."Qty. to Invoice"; IF TDocType=1 THEN BEGIN IF QtyPerLine < 0 THEN QtyPerLine:=QtyPerLine*-1; END ELSE IF TDocType=5 THEN BEGIN IF QtyPerLine < 0 THEN QtyPerLine:=QtyPerLine*-1; LineAmtPassed:= LineAmtPassed * -1; IF Disc THEN IF NOT (ServiceLine.Quantity=0) THEN TotalDisc:=TotalDisc + ((ServiceLine."Inv. Discount Amount"/ServiceLine.Quantity)*QtyPerLine) ELSE TotalDisc:=TotalDisc + 0; AvaWindowOpen(StrMessage+Text ); fnserviceupdatetaxcode(serviceline); fngettaxline(ogettaxrequest, oaddfromline, oaddto, ShipMethodLine, ServiceLine."Line No.", ServiceLine."No.", ServiceLine.Description, QtyPerLine, LineAmtPassed, Disc, ExemptionNo, Ref1, Ref2, "G\LAccNo.", TaxibilityCode, EntityUseCode, otaxlines, OutStatus); AvaWindowClose(); END UNTIL ServiceLine.NEXT = 0; IF TotalDisc <> 0 THEN ogettaxrequest.discount:=totaldisc*dcoefficient; StrMessage:=Text FORMAT(ServiceHead."No.",STRLEN(FORMAT(ServiceHead."No."))); AvaWindowOpen(StrMessage+Text ); GetResultCode:=fnGetTaxFinal(oGetTaxRequest,oGetTaxResult); TotalTax:=oGetTaxResult.TotalTax; Avalara Inc. All rights reserved. Page 32 of 215
33 AvaWindowClose(); CASE GetResultCode OF 0: Result:=TRUE; 1: BEGIN AvaUserPref.SETRANGE(AvaUserPref."User Pref Name",USERID); IF AvaUserPref.FINDFIRST THEN BEGIN IF AvaUserPref.Warnings THEN BEGIN Result:=FALSE; MESSAGE(Text '%1',oGetTaxResult.Messages.Item(0).Summary); END ELSE BEGIN IF Avaconfig."Display Warnings" THEN BEGIN Result:=FALSE; MESSAGE(Text '%1',oGetTaxResult.Messages.Item(0).Summary); 2: BEGIN Result:=FALSE; IF ogettaxresult.messages.item(0).severity = 2 THEN ERROR('Document No. : ' + ServiceHead."No."+' ' +Text '%1',oGetTaxResult.Messages.Item(0).Summary) ELSE IF ogettaxresult.messages.item(1).severity = 2 THEN ERROR(Text '%1',oGetTaxResult.Messages.Item(1).Summary) ELSE IF ogettaxresult.messages.item(2).severity = 2 THEN ERROR(Text '%1',oGetTaxResult.Messages.Item(2).Summary); ELSE BEGIN Result:=FALSE; ERROR(Text Text ); AvaWindowOpen(StrMessage+Text ); HdrID:=fnObjToTbl(oGetTaxRequest,oGetTaxResult,oGetTaxResult.DocCode,TDocType,DT2DATE(oGetTaxResult.DocDate),D ocumenttype); fnserviceqtyamtord(hdrid,serviceline,false); IF NOT Avaconfig."Show Message Dialog" THEN Window.CLOSE Avalara Inc. All rights reserved. Page 33 of 215
34 ELSE AvaWindowClose(); fnclear; Changes in function fnserviceqtyamtord Add Parameter New code AvaHead.SETRANGE(AvaHead."No.",HdrID); IF AvaHead.FINDFIRST THEN BEGIN AvaLine.RESET; AvaLine.SETRANGE(AvaLine."Tax Header No.",HdrID); IF AvaLine.FINDFIRST THEN REPEAT IF ServiceLine.FINDFIRST THEN REPEAT IF FORMAT(ServiceLine."Line No.") = AvaLine."Tax Line No." THEN BEGIN AvaLine."Quantity Full":=ServiceLine.Quantity; AvaLine."Quantity Inv.":=ServiceLine."Qty. to Invoice"; IF TDocType = 5 THEN AvaLine."Quantity Shipped":=ServiceLine."Qty. to Invoice" ELSE AvaLine."Quantity Shipped":=ServiceLine."Qty. to Ship"; AvaLine."Amount Full":=ROUND(ServiceLine."Line Amount"-ServiceLine."Inv. Discount Amount"-AvaLine."Tax Exempt Amount"); AvaLine."Discount Full":=ROUND(ServiceLine."Inv. Discount Amount"); IF ServiceLine.Quantity <> 0 THEN BEGIN AvaLine."Amount Inv.":= ROUND((ServiceLine."Line Amount"-ServiceLine."Inv. Discount Amount"-AvaLine."Tax Exempt Amount")/ServiceLine.Quantity*ServiceLine."Qty. to Invoice"); IF TDocType = 5 THEN AvaLine."Amount Shipped":= ROUND((ServiceLine."Line Amount"-ServiceLine."Inv. Discount Amount"- AvaLine."Tax Exempt Amount")/ServiceLine.Quantity*ServiceLine."Qty. to Invoice") Avalara Inc. All rights reserved. Page 34 of 215
35 ELSE AvaLine."Amount Shipped":= ROUND((ServiceLine."Line Amount"-ServiceLine."Inv. Discount Amount"- AvaLine."Tax Exempt Amount")/ServiceLine.Quantity*ServiceLine."Qty. to Ship"); Invoice"); to Ship"); Full")); Shipped")); Shipped")); Shipped")); Inv.")); Inv.")); AvaLine."Discount Inv.":=ROUND((ServiceLine."Inv. Discount Amount"/ServiceLine.Quantity)*ServiceLine."Qty. to AvaLine."Discount Shipped":=ROUND((ServiceLine."Inv. Discount Amount"/ServiceLine.Quantity)*ServiceLine."Qty. IF AvaLine."Tax Tax Amount" <> 0 THEN BEGIN IF AvaLine."Quantity Inv." <> 0 THEN BEGIN IF NOT AsInvoice THEN BEGIN IF Avaconfig."Statistics Quantity" = '1' THEN BEGIN AvaLine."Tax Full":=ROUND(AvaLine."Quantity Full"*(AvaLine."Tax Tax Amount"/AvaLine."Quantity Full")); AvaLine."Tax Inv.":=ROUND(AvaLine."Quantity Inv."*(AvaLine."Tax Tax Amount"/AvaLine."Quantity Full")); AvaLine."Tax Shipped":=ROUND(AvaLine."Quantity Shipped"*(AvaLine."Tax Tax Amount"/AvaLine."Quantity END ELSE IF Avaconfig."Statistics Quantity" = '2' THEN BEGIN AvaLine."Tax Full":=ROUND(AvaLine."Quantity Full"*(AvaLine."Tax Tax Amount"/AvaLine."Quantity AvaLine."Tax Inv.":=ROUND(AvaLine."Quantity Inv."*(AvaLine."Tax Tax Amount"/AvaLine."Quantity AvaLine."Tax Shipped":=ROUND(AvaLine."Quantity Shipped"*(AvaLine."Tax Tax Amount"/AvaLine."Quantity END ELSE IF Avaconfig."Statistics Quantity" = '3' THEN BEGIN AvaLine."Tax Full":=ROUND(AvaLine."Quantity Full"*(AvaLine."Tax Tax Amount"/AvaLine."Quantity Inv.")); AvaLine."Tax Inv.":=ROUND(AvaLine."Quantity Inv."*(AvaLine."Tax Tax Amount"/AvaLine."Quantity Inv.")); AvaLine."Tax Shipped":=ROUND(AvaLine."Quantity Shipped"*(AvaLine."Tax Tax Amount"/AvaLine."Quantity END ELSE BEGIN AvaLine."Tax Full":=ROUND(AvaLine."Quantity Full"*(AvaLine."Tax Tax Amount"/AvaLine."Quantity Inv.")); AvaLine."Tax Inv.":=ROUND(AvaLine."Quantity Inv."*(AvaLine."Tax Tax Amount"/AvaLine."Quantity Inv.")); AvaLine."Tax Shipped":=ROUND(AvaLine."Quantity Shipped"*(AvaLine."Tax Tax Amount"/AvaLine."Quantity AvaLine.MODIFY; UNTIL ServiceLine.NEXT = 0; UNTIL AvaLine.NEXT=0; Changes in function fnservicecalctax1 Modified code (Search for 1 st line and add colored Lines) DtlLevel:=3; EntityUseCode:=''; ServiceHead.SETRANGE(ServiceHead."No.",ServiceHeaderNo); ServiceHead.SETRANGE(ServiceHead."Document Type",ServiceHeaderType); ServiceHead.FINDFIRST; ShipMethod:=0; //Service AvaTax-POD Avalara Inc. All rights reserved. Page 35 of 215
36 IF STRPOS(ServiceHead."Shipment Method Code",Text ) <> 0 THEN ShipMethod:=1 ELSE IF STRPOS(ServiceHead."Tax Area Code",Text ) <> 0 THEN ShipMethod:=2; //Service AvaTax-POD DocumentType := FORMAT(ServiceHead."Document Type"); StrMessage:=Text FORMAT(ServiceHead."No.",STRLEN(FORMAT(ServiceHead."No."))); AvaCheckSalesTaxAdjust(ServiceHead."No.", ServiceHead."Document Type",TRUE); ExemptionNo:=''; IF Avaconfig."Exempt Processing" = Avaconfig."Exempt Processing" :: "Bill-to Customer" THEN BEGIN Cust.SETRANGE(Cust."No.",ServiceHead."Bill-to Customer No."); IF Cust.FINDFIRST THEN ExemptionNo :=Cust."Tax Exemption No."; END ELSE BEGIN IF Avaconfig."Exempt Processing" = Avaconfig."Exempt Processing" :: "Sell-to Customer" THEN Cust.SETRANGE(Cust."No.",ServiceHead."Customer No."); IF Cust.FINDFIRST THEN ExemptionNo :=Cust."Tax Exemption No."; IF Avaconfig."Exempt Processing" = Avaconfig."Exempt Processing" :: "Transaction Level" THEN ExemptionNo := ServiceHead."Tax Exemption No."; AvaWindowOpen(StrMessage); "TmpL 1":=''; "TmpL 2":=''; "TmpL 3":=''; TmpCity:=''; TmpState:=''; TmpZip:=''; TmpCountry:=''; ResultText:=''; TmpAddressSrc:=Text ; IF DocumentType = 'Credit Memo' THEN BEGIN IF Avaconfig."Return Address" = '1' THEN BEGIN fnserviceisemptyaddressret(3,servicehead,entityusecode); "TmpL 1":=ServiceHead.Address; "TmpL 2":=ServiceHead."Address 2"; "TmpL 3":=''; TmpCity:=ServiceHead.City; TmpState:=ServiceHead.County; TmpZip:=fnAVAPinCheck(ServiceHead."Post Code"); TmpCountry:=FORMAT(ServiceHead."Country/Region Code"); END ELSE IF Avaconfig."Return Address" = '2' THEN BEGIN fnserviceisemptyaddressret(2,servicehead,entityusecode); "TmpL 1":=ServiceHead."Bill-to Address"; "TmpL 2":=ServiceHead."Bill-to Address 2"; "TmpL 3":=''; TmpCity:=ServiceHead."Bill-to City"; TmpState:=ServiceHead."Bill-to County"; TmpZip:=fnAVAPinCheck(ServiceHead."Bill-to Post Code"); TmpCountry:=FORMAT(ServiceHead."Bill-to Country/Region Code"); Avalara Inc. All rights reserved. Page 36 of 215
37 END ELSE IF Avaconfig."Return Address" = '3' THEN BEGIN fnserviceisemptyaddressret(1,servicehead,entityusecode); "TmpL 1":=ServiceHead."Ship-to Address"; "TmpL 2":=ServiceHead."Ship-to Address 2"; Modified code (Search for 1 st line and add colored Lines) Disc:=FALSE; IF ServiceLine."Inv. Discount Amount" <> 0 THEN Disc:=TRUE ELSE Disc:=FALSE; Avaconfig.FINDFIRST; InvoiceFlag := Avaconfig.Invoice; RecGLSetup.GET; //AVANA IF (ServiceLine."Qty. Shipped Not Invoiced") <> 0 THEN BEGIN IF InvoiceFlag THEN BEGIN IF ServiceLine."Qty. Shipped Not Invoiced" < ServiceLine."Qty. to Invoice" THEN BEGIN LineAmtPassed:=ROUND((ServiceLine."Qty. Shipped Not Invoiced"*UnitPrice) - ((ServiceLine."Qty. Shipped Not Invoiced" * UnitPrice * ServiceLine."Line Discount %")/100),RecGLSetup."Amount Rounding Precision",'<'); //AVANA QtyPerLine:=ServiceLine."Qty. Shipped Not Invoiced"; END ELSE BEGIN LineAmtPassed:=ROUND((ServiceLine."Qty. to Invoice"*UnitPrice) - ((ServiceLine."Qty. to Invoice" * UnitPrice * ServiceLine."Line Discount %")/100),RecGLSetup."Amount Rounding Precision",'<'); //AVANA QtyPerLine:=ServiceLine."Qty. to Invoice"; END ELSE BEGIN IF ServiceLine."Qty. Shipped Not Invoiced" < ServiceLine."Qty. to Invoice" THEN BEGIN LineAmtPassed:=ROUND((((ServiceLine."Qty. Shipped Not Invoiced")+(ServiceLine."Qty. to Ship"))*UnitPrice) - (((ServiceLine."Qty. Shipped Not Invoiced" + ServiceLine."Qty. to Ship") * UnitPrice * ServiceLine."Line Discount %")/100), RecGLSetup."Amount Rounding Precision",'<'); //AVANA QtyPerLine:=(ServiceLine."Qty. Shipped Not Invoiced")+(ServiceLine."Qty. to Ship"); END ELSE BEGIN LineAmtPassed:=ROUND((ServiceLine."Qty. to Invoice"*UnitPrice) - ((ServiceLine."Qty. to Invoice" * UnitPrice * ServiceLine."Line Discount %")/100),RecGLSetup."Amount Rounding Precision",'<'); //AVANA QtyPerLine:=ServiceLine."Qty. to Invoice"; IF (ServiceLine."Qty. Shipped Not Invoiced" = 0) THEN BEGIN LineAmtPassed:=ROUND((ServiceLine."Qty. to Invoice"*UnitPrice) - ((ServiceLine."Qty. to Invoice" * UnitPrice * ServiceLine."Line Discount %")/100),RecGLSetup."Amount Rounding Precision",'<'); //AVANA QtyPerLine:=ServiceLine."Qty. to Invoice"; Avalara Inc. All rights reserved. Page 37 of 215
38 IF (ServiceLine."Document Type" = ServiceLine."Document Type" :: "Credit Memo") THEN BEGIN LineAmtPassed:=ROUND((ServiceLine."Qty. to Invoice"*UnitPrice) - ((ServiceLine."Qty. to Invoice" * UnitPrice * ServiceLine."Line Discount %")/100),RecGLSetup."Amount Rounding Precision",'<'); //AVANA QtyPerLine:=ServiceLine."Qty. to Invoice"; IF TDocType=1 THEN BEGIN IF QtyPerLine < 0 THEN QtyPerLine:=QtyPerLine*-1; END ELSE IF TDocType=5 THEN BEGIN IF QtyPerLine < 0 THEN QtyPerLine:=QtyPerLine; LineAmtPassed:= LineAmtPassed * -1; IF Disc THEN IF NOT (ServiceLine.Quantity=0) THEN TotalDisc:=TotalDisc + ((ServiceLine."Inv. Discount Amount"/ServiceLine.Quantity)*QtyPerLine) ELSE TotalDisc:=TotalDisc + 0; AvaWindowOpen(StrMessage+Text ); fnserviceupdatetaxcode(serviceline); fngettaxline(ogettaxrequest, oaddfromline, oaddto, ShipMethodLine, ServiceLine."Line No.", ServiceLine."No.", ServiceLine.Description, QtyPerLine, LineAmtPassed, Disc, ExemptionNo, Ref1, Ref2, "G\LAccNo.", TaxibilityCode, EntityUseCode, otaxlines, OutStatus); AvaWindowClose(); UNTIL ServiceLine.NEXT = 0; IF TotalDisc <> 0 THEN Avalara Inc. All rights reserved. Page 38 of 215
39 ogettaxrequest.discount:=totaldisc*dcoefficient; StrMessage:=Text FORMAT(ServiceHead."No.",STRLEN(FORMAT(ServiceHead."No."))); AvaWindowOpen(StrMessage+Text ); GetResultCode:=fnGetTaxFinal(oGetTaxRequest,oGetTaxResult); TotalTax:=oGetTaxResult.TotalTax; AvaWindowClose(); CASE GetResultCode OF 0: Result:=TRUE; 1: BEGIN AvaUserPref.SETRANGE(AvaUserPref."User Pref Name",USERID); IF AvaUserPref.FINDFIRST THEN BEGIN IF AvaUserPref.Warnings THEN BEGIN Result:=FALSE; MESSAGE(Text '%1',oGetTaxResult.Messages.Item(0).Summary); END ELSE BEGIN IF Avaconfig."Display Warnings" THEN BEGIN Result:=FALSE; MESSAGE(Text '%1',oGetTaxResult.Messages.Item(0).Summary); 2: BEGIN Result:=FALSE; IF ogettaxresult.messages.item(0).severity = 2 THEN ERROR('Document No. : ' + ServiceHead."No."+' ' +Text '%1',oGetTaxResult.Messages.Item(0).Summary) ELSE IF ogettaxresult.messages.item(1).severity = 2 THEN ERROR(Text '%1',oGetTaxResult.Messages.Item(1).Summary) ELSE IF ogettaxresult.messages.item(2).severity = 2 THEN ERROR(Text '%1',oGetTaxResult.Messages.Item(2).Summary); ELSE BEGIN Result:=FALSE; ERROR(Text Text ); AvaWindowOpen(StrMessage+Text ); HdrID:=fnObjToTbl(oGetTaxRequest,oGetTaxResult,oGetTaxResult.DocCode,TDocType,DT2DATE(oGetTaxResult.DocDate),D ocumenttype); ServiceLine.RESET; Avalara Inc. All rights reserved. Page 39 of 215
40 ServiceLine.SETRANGE(ServiceLine."Document Type",ServiceHeaderType); ServiceLine.SETRANGE(ServiceLine."Document No.",ServiceHeaderNo); ServiceLine.SETFILTER(ServiceLine.Type, '<>%1', ServiceLine.Type::" "); fnserviceqtyamtord(hdrid,serviceline,true); AvaWindowClose(); fnclear; Remove Function fnserviceqtyamtord1 Remove completed function Changes in function fnservicecalctaxbatch Modified code (Search for 1 st line and add colored Lines) ShipMethod:=0; IF STRPOS(SalesHead."Shipment Method Code",Text ) <> 0 THEN ShipMethod:=1 ELSE IF STRPOS(SalesHead."Tax Area Code",Text ) <> 0 THEN ShipMethod:=2; DocumentType := FORMAT(SalesHead."Document Type"); AvaCheckSalesTaxAdjust(ServiceHead."No.", ServiceHead."Document Type",TRUE); ExemptionNo:=''; IF Avaconfig."Exempt Processing" = Avaconfig."Exempt Processing" :: "Bill-to Customer" THEN BEGIN Modified code (Search for 1 st line and add colored Lines) Disc:=FALSE; IF SalesLine."Inv. Discount Amount" <> 0 THEN Disc:=TRUE ELSE Disc:=FALSE; RecGLSetup.GET; //AVANA IF NOT (SalesHead.Ship AND SalesHead.Invoice) THEN BEGIN IF NOT AvaReleaseStatisticsBln THEN BEGIN //CONNECT-1596 IF Avaconfig."Statistics Quantity" = '1' THEN BEGIN LineAmtPassed:=(SalesLine.Quantity*UnitPrice) - ROUND((SalesLine.Quantity * UnitPrice * SalesLine."Line Discount %")/100,RecGLSetup."Amount Rounding Precision",'<'); //AVANA QtyPerLine:=SalesLine.Quantity; END ELSE IF Avaconfig."Statistics Quantity" = '2' THEN BEGIN IF (SalesLine."Document Type" = SalesLine."Document Type" :: "Credit Memo") OR (SalesLine."Document Type" = SalesLine."Document Type" :: "Return Order") THEN BEGIN LineAmtPassed:=(SalesLine."Return Qty. to Receive"*UnitPrice) - ROUND((SalesLine."Return Qty. to Receive" * UnitPrice * SalesLine."Line Discount %")/100,RecGLSetup."Amount Rounding Precision",'<'); //AVANA QtyPerLine:=SalesLine."Return Qty. to Receive"; END ELSE BEGIN Avalara Inc. All rights reserved. Page 40 of 215
41 LineAmtPassed:=(SalesLine."Qty. to Ship"*UnitPrice) - ROUND((SalesLine."Qty. to Ship" * UnitPrice * SalesLine."Line Discount %")/100,RecGLSetup."Amount Rounding Precision",'<'); //AVANA QtyPerLine:=SalesLine."Qty. to Ship"; END ELSE IF Avaconfig."Statistics Quantity" = '3' THEN BEGIN LineAmtPassed:=(SalesLine."Qty. to Invoice"*UnitPrice) - ROUND((SalesLine."Qty. to Invoice" * UnitPrice * SalesLine."Line Discount %")/100,RecGLSetup."Amount Rounding Precision",'<'); //AVANA QtyPerLine:=SalesLine."Qty. to Invoice"; END ELSE BEGIN IF Avaconfig."Release Quantity" = '1' THEN BEGIN LineAmtPassed:=(SalesLine.Quantity*UnitPrice) - ROUND((SalesLine.Quantity * UnitPrice * SalesLine."Line Discount %")/100,RecGLSetup."Amount Rounding Precision",'<'); //AVANA QtyPerLine:=SalesLine.Quantity; END ELSE IF Avaconfig."Release Quantity" = '2' THEN BEGIN IF (SalesLine."Document Type" = SalesLine."Document Type" :: "Credit Memo") OR (SalesLine."Document Type" = SalesLine."Document Type" :: "Return Order") THEN BEGIN LineAmtPassed:=(SalesLine."Return Qty. to Receive"*UnitPrice) - ROUND((SalesLine."Return Qty. to Receive" * UnitPrice * SalesLine."Line Discount %")/100,RecGLSetup."Amount Rounding Precision",'<'); //AVANA QtyPerLine:=SalesLine."Return Qty. to Receive"; END ELSE BEGIN LineAmtPassed:=(SalesLine."Qty. to Ship"*UnitPrice) - ROUND((SalesLine."Qty. to Ship" * UnitPrice * SalesLine."Line Discount %")/100,RecGLSetup."Amount Rounding Precision",'<'); //AVANA QtyPerLine:=SalesLine."Qty. to Ship"; END ELSE IF Avaconfig."Release Quantity" = '3' THEN BEGIN LineAmtPassed:=(SalesLine."Qty. to Invoice"*UnitPrice) - ROUND((SalesLine."Qty. to Invoice" * UnitPrice * SalesLine."Line Discount %")/100,RecGLSetup."Amount Rounding Precision",'<'); //AVANA QtyPerLine:=SalesLine."Qty. to Invoice"; IF TDocType=1 THEN BEGIN IF QtyPerLine < 0 THEN QtyPerLine:=QtyPerLine*-1; END ELSE IF TDocType=5 THEN BEGIN IF QtyPerLine < 0 THEN QtyPerLine:=QtyPerLine; LineAmtPassed:= LineAmtPassed * -1; IF Disc THEN IF NOT (SalesLine.Quantity=0) THEN TotalDisc:=TotalDisc + ((SalesLine."Inv. Discount Amount"/SalesLine.Quantity)*QtyPerLine) ELSE TotalDisc:=TotalDisc + 0; Avalara Inc. All rights reserved. Page 41 of 215
42 fnupdatetaxcode(salesline); fngettaxline(ogettaxrequest, oaddfromline, oaddto, ShipMethodLine, SalesLine."Line No.", SalesLine."No.", SalesLine.Description, QtyPerLine*DCoefficient, LineAmtPassed*DCoefficient, Disc, ExemptionNo, Ref1, Ref2, "G\LAccNo.", TaxibilityCode, EntityUseCode, otaxlines, OutStatus); UNTIL SalesLine.NEXT = 0; IF TotalDisc <> 0 THEN ogettaxrequest.discount:=totaldisc*dcoefficient; StrMessage:=Text FORMAT(SalesHead."No.",STRLEN(FORMAT(SalesHead."No."))); GetResultCode:=fnGetTaxFinal(oGetTaxRequest,oGetTaxResult); TotalTax:=oGetTaxResult.TotalTax; CASE GetResultCode OF 0: Result:=TRUE; 1: BEGIN AvaUserPref.SETRANGE(AvaUserPref."User Pref Name",USERID); IF AvaUserPref.FINDFIRST THEN BEGIN IF AvaUserPref.Warnings THEN BEGIN Result:=FALSE; iresulttype:=1; tresultmessage:=text ogettaxresult.messages.item(0).summary; EXIT(FALSE); END ELSE BEGIN IF Avaconfig."Display Warnings" THEN BEGIN Result:=FALSE; iresulttype:=1; tresultmessage:=text ogettaxresult.messages.item(0).summary; EXIT(FALSE); Avalara Inc. All rights reserved. Page 42 of 215
43 2: BEGIN Result:=FALSE; IF ogettaxresult.messages.item(0).severity = 2 THEN BEGIN iresulttype:=2; tresultmessage:=text ogettaxresult.messages.item(0).summary ; Status := 'Error'; AVABatchTaxFill(SalesHead,tResultMessage,Status); EXIT(FALSE); END ELSE IF ogettaxresult.messages.item(1).severity = 2 THEN BEGIN iresulttype:=2; tresultmessage:=text ogettaxresult.messages.item(1).summary; Status := 'Error'; AVABatchTaxFill(SalesHead,tResultMessage,Status); EXIT(FALSE); END ELSE IF ogettaxresult.messages.item(2).severity = 2 THEN BEGIN iresulttype:=2; tresultmessage:=text ogettaxresult.messages.item(2).summary; Status := 'Error'; AVABatchTaxFill(SalesHead,tResultMessage,Status); EXIT(FALSE); ELSE BEGIN Result:=FALSE; iresulttype:=2; tresultmessage:=text Text ; Status := 'Error'; AVABatchTaxFill(SalesHead,tResultMessage,Status); EXIT(FALSE); HdrID:=fnObjToTbl(oGetTaxRequest,oGetTaxResult,oGetTaxResult.DocCode,TDocType,DT2DATE(oGetTaxResult.DocDate),D ocumenttype); fnqtyamtord(hdrid,salesline,false); Remarks := 'Success'; Status := 'Success'; AVABatchTaxFill(SalesHead,Remarks,Status); fnclear; Avalara Inc. All rights reserved. Page 43 of 215
44 Changes in function fnservcalctaxbatch Modified code (Search for 1 st line and add colored Lines) DtlLevel:=3; EntityUseCode:=''; ServiceHead.SETRANGE(ServiceHead."No.",ServiceHeaderNo); ServiceHead.SETRANGE(ServiceHead."Document Type",ServiceHeaderType); ServiceHead.FINDFIRST; DocumentType := FORMAT(ServiceHead."Document Type"); AvaCheckSalesTaxAdjust(ServiceHead."No.", ServiceHead."Document Type",TRUE); ExemptionNo:=''; Modified code (Search for 1 st line and add colored Lines) Disc:=FALSE; IF ServiceLine."Inv. Discount Amount" <> 0 THEN Disc:=TRUE ELSE Disc:=FALSE; RecGLSetup.GET; //AVANA IF NOT AvaReleaseStatisticsBln THEN BEGIN //CONNECT-1596 IF Avaconfig."Statistics Quantity" = '1' THEN BEGIN LineAmtPassed:=ROUND((ServiceLine.Quantity*UnitPrice) - ((ServiceLine.Quantity * UnitPrice * ServiceLine."Line Discount %")/100),RecGLSetup."Amount Rounding Precision",'<'); //AVANA QtyPerLine:=ServiceLine.Quantity; END ELSE IF Avaconfig."Statistics Quantity" = '2' THEN BEGIN IF (ServiceLine."Document Type" = ServiceLine."Document Type" :: "Credit Memo") THEN BEGIN LineAmtPassed:=ROUND((ServiceLine."Qty. to Invoice"*UnitPrice) - ((ServiceLine."Qty. to Invoice" * UnitPrice * ServiceLine."Line Discount %")/100),RecGLSetup."Amount Rounding Precision",'<'); //AVANA QtyPerLine:=ServiceLine."Qty. to Invoice"; END ELSE BEGIN LineAmtPassed:=ROUND((ServiceLine."Qty. to Ship"*UnitPrice) - ((ServiceLine."Qty. to Ship" * UnitPrice * ServiceLine."Line Discount %")/100),RecGLSetup."Amount Rounding Precision",'<'); //AVANA QtyPerLine:=ServiceLine."Qty. to Ship"; END ELSE IF Avaconfig."Statistics Quantity" = '3' THEN BEGIN LineAmtPassed:=ROUND((ServiceLine."Qty. to Invoice"*UnitPrice) - ((ServiceLine."Qty. to Invoice" * UnitPrice * ServiceLine."Line Discount %")/100),RecGLSetup."Amount Rounding Precision",'<'); //AVANA QtyPerLine:=ServiceLine."Qty. to Invoice"; END ELSE BEGIN IF Avaconfig."Release Quantity" = '1' THEN BEGIN LineAmtPassed:=ROUND((ServiceLine.Quantity*UnitPrice) - ((ServiceLine.Quantity * UnitPrice * ServiceLine."Line Discount %")/100),RecGLSetup."Amount Rounding Precision",'<'); //AVANA QtyPerLine:=ServiceLine.Quantity; END ELSE IF Avaconfig."Release Quantity" = '2' THEN BEGIN IF (ServiceLine."Document Type" = ServiceLine."Document Type" :: "Credit Memo") THEN BEGIN Avalara Inc. All rights reserved. Page 44 of 215
45 LineAmtPassed:=ROUND((ServiceLine."Qty. to Invoice"*UnitPrice) - ((ServiceLine."Qty. to Invoice" * UnitPrice * ServiceLine."Line Discount %")/100),RecGLSetup."Amount Rounding Precision",'<'); //AVANA QtyPerLine:=ServiceLine."Qty. to Invoice"; END ELSE BEGIN LineAmtPassed:=ROUND((ServiceLine."Qty. to Ship"*UnitPrice) - ((ServiceLine."Qty. to Ship" * UnitPrice * ServiceLine."Line Discount %")/100),RecGLSetup."Amount Rounding Precision",'<'); //AVANA QtyPerLine:=ServiceLine."Qty. to Ship"; END ELSE IF Avaconfig."Release Quantity" = '3' THEN BEGIN LineAmtPassed:=ROUND((ServiceLine."Qty. to Invoice"*UnitPrice) - ((ServiceLine."Qty. to Invoice" * UnitPrice * ServiceLine."Line Discount %")/100),RecGLSetup."Amount Rounding Precision",'<'); //AVANA QtyPerLine:=ServiceLine."Qty. to Invoice"; IF TDocType=1 THEN BEGIN IF QtyPerLine < 0 THEN QtyPerLine:=QtyPerLine*-1; END ELSE IF TDocType=5 THEN BEGIN IF QtyPerLine < 0 THEN QtyPerLine:=QtyPerLine; LineAmtPassed:= LineAmtPassed * -1; IF Disc THEN IF NOT (ServiceLine.Quantity=0) THEN TotalDisc:=TotalDisc + ((ServiceLine."Inv. Discount Amount"/ServiceLine.Quantity)*QtyPerLine) ELSE TotalDisc:=TotalDisc + 0; AvaWindowOpen(StrMessage+Text ); fnserviceupdatetaxcode(serviceline); fngettaxline(ogettaxrequest, oaddfromline, oaddto, ShipMethodLine, ServiceLine."Line No.", ServiceLine."No.", ServiceLine.Description, QtyPerLine*DCoefficient, LineAmtPassed*DCoefficient, Disc, ExemptionNo, Ref1, Ref2, "G\LAccNo.", TaxibilityCode, EntityUseCode, otaxlines, Avalara Inc. All rights reserved. Page 45 of 215
46 OutStatus); AvaWindowClose(); UNTIL ServiceLine.NEXT = 0; IF TotalDisc <> 0 THEN ogettaxrequest.discount:=totaldisc*dcoefficient; StrMessage:=Text FORMAT(ServiceHead."No.",STRLEN(FORMAT(ServiceHead."No."))); AvaWindowOpen(StrMessage+Text ); GetResultCode:=fnGetTaxFinal(oGetTaxRequest,oGetTaxResult); TotalTax:=oGetTaxResult.TotalTax; AvaWindowClose(); CASE GetResultCode OF 0: Result:=TRUE; 1: BEGIN AvaUserPref.SETRANGE(AvaUserPref."User Pref Name",USERID); IF AvaUserPref.FINDFIRST THEN BEGIN IF AvaUserPref.Warnings THEN BEGIN Result:=FALSE; iresulttype:=1; tresultmessage:=text ogettaxresult.messages.item(0).summary; EXIT(FALSE); END ELSE BEGIN IF Avaconfig."Display Warnings" THEN BEGIN Result:=FALSE; iresulttype:=1; tresultmessage:=text ogettaxresult.messages.item(0).summary; EXIT(FALSE); 2: BEGIN Result:=FALSE; IF ogettaxresult.messages.item(0).severity = 2 THEN BEGIN iresulttype:=2; tresultmessage:=text ogettaxresult.messages.item(0).summary ; Status := 'Error'; AVAServiceBatchTaxFill(ServiceHead,tResultMessage,Status); EXIT(FALSE); END ELSE IF ogettaxresult.messages.item(1).severity = 2 THEN BEGIN iresulttype:=2; tresultmessage:=text ogettaxresult.messages.item(1).summary; Avalara Inc. All rights reserved. Page 46 of 215
47 Status := 'Error'; AVAServiceBatchTaxFill(ServiceHead,tResultMessage,Status); EXIT(FALSE); END ELSE IF ogettaxresult.messages.item(2).severity = 2 THEN BEGIN iresulttype:=2; tresultmessage:=text ogettaxresult.messages.item(2).summary; Status := 'Error'; AVAServiceBatchTaxFill(ServiceHead,tResultMessage,Status); EXIT(FALSE); ELSE BEGIN Result:=FALSE; iresulttype:=2; tresultmessage:=text Text ; Status := 'Error'; AVAServiceBatchTaxFill(ServiceHead,tResultMessage,Status); EXIT(FALSE); AvaWindowOpen(StrMessage+Text ); HdrID:=fnObjToTbl(oGetTaxRequest,oGetTaxResult,oGetTaxResult.DocCode,TDocType,DT2DATE(oGetTaxResult.DocDate),D ocumenttype); fnserviceqtyamtord(hdrid,serviceline,false); IF NOT Avaconfig."Show Message Dialog" THEN Window.CLOSE ELSE AvaWindowClose(); Remarks := 'Success'; Status := 'Success'; AVAServiceBatchTaxFill(ServiceHead,Remarks,Status); fnclear; Changes in function AVAServiceBatchTaxFill Modified code (Search for 1 st line and add colored Lines) IF Serviceline.FINDFIRST THEN BEGIN REPEAT Amt += (Serviceline.Amount + Serviceline."Inv. Discount Amount"); TaxAmt += (AvaLine."Tax Tax Amount"); Totaldisc += Serviceline."Line Discount Amount"; AmtIncTax += Serviceline."Amount Including VAT"; UNTIL Serviceline.NEXT = 0; AvaCheckSalesTaxAdjust(ServiceHead."No.", ServiceHead."Document Type",TRUE); Avalara Inc. All rights reserved. Page 47 of 215
48 ExemptionNo:=''; Changes in function AvaCheckSalesTaxAdjust Add new parameter Local variables: Modified code (Search for 1 st line and add colored Lines) AvaSalesTaxAdjustAppl:=FALSE; LAvaSalesTaxAdjustFound:=FALSE; LItemCount:=0; IF Avaconfig.FINDFIRST THEN; IF NOT(Avaconfig."Enable Tax Amt Adj.") THEN EXIT; IF tdocumenttype = LSalesLine."Document Type"::"Credit Memo" THEN BEGIN IF NOT tdocumentserv THEN BEGIN LSalesLine.RESET; Avalara Inc. All rights reserved. Page 48 of 215
49 LSalesLine.SETRANGE("Document No.", tdocumentno); LSalesLine.SETRANGE("Document Type",tDocumentType); IF LSalesLine.FINDFIRST THEN REPEAT LItemCount:=LItemCount+1; IF LSalesLine."No."=TextSalesTaxAdjust THEN LAvaSalesTaxAdjustFound:=TRUE; UNTIL LSalesLine.NEXT=0; END ELSE BEGIN LServiceLine.RESET; LServiceLine.SETRANGE("Document No.", tdocumentno); LServiceLine.SETRANGE("Document Type",tDocumentType); IF LServiceLine.FINDFIRST THEN REPEAT LItemCount:=LItemCount+1; IF LServiceLine."No."=TextSalesTaxAdjust THEN LAvaSalesTaxAdjustFound:=TRUE; UNTIL LServiceLine.NEXT=0; IF LAvaSalesTaxAdjustFound AND (LItemCount>1) THEN ERROR(TextSalesTaxAdjustError) ELSE IF LAvaSalesTaxAdjustFound AND (LItemCount=1) THEN AvaSalesTaxAdjustAppl:=TRUE; Changes in function AvaServCheckTaxReqd Change data type of Local variable lavataxamtinvdiff Old value : Integer New value : Decimal Create new function DummyGetTax Parameter Avalara Inc. All rights reserved. Page 49 of 215
50 Return value Local variable Avalara Inc. All rights reserved. Page 50 of 215
51 New code oaddto := oaddto.address; oline := oline.line; otaxsrv := otaxsrv.taxsvc; ogettaxrequest := ogettaxrequest.gettaxrequest; RecCompanyInfo.FINDFIRST; oaddto.line1 := RecCompanyInfo.Address; oaddto.line2 := RecCompanyInfo."Address 2"; oaddto.line3 := ''; oaddto.city := RecCompanyInfo.City; oaddto.region := RecCompanyInfo.County; oaddto.country := RecCompanyInfo."Country/Region Code"; oaddto.postalcode := RecCompanyInfo."Post Code"; ogettaxrequest.destinationaddress := oaddto; oline.no := '1'; oline.qty := 1; oline.amount := 100; oline.itemcode := 'DUMMY'; ogettaxrequest.lines.add(oline); RecAvaConfig.FINDFIRST; IF RecAvaConfig."Company ID" <> '' THEN ogettaxrequest.companycode := RecAvaConfig."Company ID" ELSE ogettaxrequest.companycode := 'DEFAULT'; ogettaxrequest.doccode := 'DUMMY'; ogettaxrequest.docdate := CURRENTDATETIME; ogettaxrequest.doctype := 0; ogettaxrequest.detaillevel := 3; ogettaxrequest.customercode := 'DUMMY'; RecAvaConfig.FINDFIRST; otaxsrv.profile.client:=recavaconfig."connector Version"; otaxsrv.configuration.security.account:=recavaconfig."account Number"; otaxsrv.configuration.security.license:=recavaconfig."license Key"; otaxsrv.configuration.url:=recavaconfig."tax Url"; ogettaxresult:=otaxsrv.gettax(ogettaxrequest); IF (ogettaxresult.resultcode > 0) AND (ogettaxresult.messages.count > 0) THEN BEGIN IF NOT CallforGetTax THEN BEGIN IF ogettaxresult.messages.item(0).name <> Text THEN Avalara Inc. All rights reserved. Page 51 of 215
52 txtgetresultcode := Text ELSE BEGIN GetResultCode:=oGetTaxResult.ResultCode; txtgetresultcode := ogettaxresult.messages.item(0).summary; IF txtgetresultcode = Text THEN txtgetresultcode := Text ; END ELSE BEGIN GetResultCode:=oGetTaxResult.ResultCode; txtgetresultcode := ogettaxresult.messages.item(0).summary; IF txtgetresultcode = Text THEN txtgetresultcode := Text ; END ELSE BEGIN GetResultCode:=0; IF ogettaxresult.totaltax <> 0 THEN txtgetresultcode := Text ELSE txtgetresultcode := Text ; Avalara Inc. All rights reserved. Page 52 of 215
53 Codeunit AVA Validate Call Add new variable Name DataType Subtype AvaInstalled Codeunit AVA IsInstalled Changes in function AvaIsValidDocument Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(Source)) THEN EXIT(FALSE); { IF NOT CuAvaInstal.IsAvaTaxInstalled THEN BEGIN IF Source = 1 THEN MESSAGE(Text ); Valid:=FALSE; EXIT; AvaConfig.RESET; AvaConfig.SETRANGE(AvaConfig."Account Value"); } Remove commented code Valid:=FALSE; IF AvaConfig.FINDFIRST THEN BEGIN Modified code (Search for 1 st line and add colored Lines) IF TableType = 1 THEN BEGIN SalesHead.SETRANGE(SalesHead."No.",DocNum); SalesHead.SETRANGE(SalesHead."Document Type",DocType); IF SalesLine."Document No." <> '' THEN SalesLine.SETRANGE(SalesLine."Document Type",DocType) ELSE SalesLine.SETFILTER(SalesLine."Document Type", '<>%1', SalesLine.Type::" "); SalesLine.SETRANGE(SalesLine."Document No.",DocNum); SalesLine.SETFILTER(Type,'<>%1', SalesLine.Type::" "); END ELSE IF TableType = 2 THEN BEGIN Changes in function AvaIsValidDocumentBatch Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(Source)) THEN EXIT(FALSE); Avalara Inc. All rights reserved. Page 53 of 215
54 Changes in function AvaGetTaxOrder Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(0)) THEN Changes in function AvaGetTaxOrderBatch Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(0)) THEN Changes in function AvaGetTaxOrderPost Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(0)) THEN Changes in function AvaGetTaxOrderPost1 Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(0)) THEN Changes in function AvaGetTaxOrderBatchPost Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(0)) THEN Changes in function AvaIsTaxCalculated Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(0)) THEN Changes in function AvaPostInv Modified complete code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(0)) THEN EXIT(FALSE); DocCode:=SalesInv."No."; DocType:=1; IF DocumentType= 'Order' THEN BEGIN OrigDocCode:= SalesInv."Order No."; OrigDocCode := Text OrigDocCode; END ELSE IF DocumentType= 'Invoice' THEN BEGIN OrigDocCode:= SalesInv."Pre-Assigned No."; OrigDocCode := Text OrigDocCode; IF FORMAT(SalesInv."Posting Date") <> '' THEN PostingDate:=SalesInv."Posting Date" ELSE IF FORMAT(SalesInv."Shipment Date") <> '' THEN PostingDate:=SalesInv."Shipment Date" ELSE IF FORMAT(SalesInv."Order Date") <> '' THEN PostingDate:=SalesInv."Order Date"; Avalara Inc. All rights reserved. Page 54 of 215
55 InvDiscountAmt:=0; SalesInvLine.SETRANGE(SalesInvLine."Document No.",SalesInv."No."); SalesInvLine.SETFILTER(SalesInvLine.Type, '<>%1', SalesInvLine.Type::" "); SalesInvLine.SETRANGE("Prepayment Line",FALSE); //AVANA IF SalesInvLine.FINDFIRST THEN REPEAT InvDiscountAmt:=SalesInvLine."Inv. Discount Amount"; IF AvaConfig.COGS THEN IF (STRPOS(FORMAT(SalesInvLine."Tax Group Code"),FORMAT(AvaConfig."COGS Tax Group No.")) <> 0) THEN BEGIN RecItem.SETRANGE(RecItem."No.",SalesInvLine."No."); IF RecItem.FINDFIRST THEN BEGIN TotalAmt+=ROUND(RecItem."Standard Cost")*SalesInvLine.Quantity; END ELSE TotalAmt+=SalesInvLine.Amount + InvDiscountAmt; END ELSE TotalAmt+=SalesInvLine.Amount + InvDiscountAmt ELSE BEGIN TotalAmt+=SalesInvLine.Amount + InvDiscountAmt; UNTIL SalesInvLine.NEXT = 0; TotalTax:=SalesInv."Amount Including VAT" - SalesInv.Amount; ResultText:=''; AvaWindowOpen(Text DocNumPre); AvaWindowClose(); IF AvaConfig.FINDFIRST THEN; IF NOT AvaConfig."Enable AsynchronousAvaTax Post" THEN BEGIN IF AvaTaxEngine.fnPosting(TmpDocID,AvaConfig."Company ID",DocType,FORMAT(DocCode),FORMAT(OrigDocCode), PostingDate,TotalAmt,TotalTax,ResultText,AvaHead."No.") THEN BEGIN AvaWindowOpen(Text DocNumPre); AvaWindowClose(); EXIT(TRUE); END ELSE BEGIN AvaTaxEngine.fnCanceling(TmpDocID,AvaConfig."Company ID",DocType,2,FORMAT(DocCode)); ERROR('%1',ResultText); END ELSE BEGIN IF AvaHead."Document Id" = AvaHead."Document No." THEN BEGIN AvaHead."Document Id" := DocCode; AvaHead."Status Code":='OK'; AvaHead.MODIFY; Avalara Inc. All rights reserved. Page 55 of 215
56 EXIT(TRUE); Changes in function AvaPostShp Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(0)) THEN Changes in function AvaPostRtn Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(0)) THEN EXIT(FALSE); DocCode:=SalesCrMemo."No."; DocType:=5; IF SalesCrMemo."No." <> '' THEN BEGIN IF SalesCrMemo."Pre-Assigned No." <> '' THEN OrigDocCode:= SalesCrMemo."Pre-Assigned No." ELSE OrigDocCode:= SalesCrMemo."Return Order No."; END ELSE IF SalesCrMemo."Applies-to Doc. No." <> '' THEN OrigDocCode:=SalesCrMemo."Applies-to Doc. No." ELSE IF SalesCrMemo."External Document No." <> '' THEN OrigDocCode:=SalesCrMemo."External Document No." ELSE IF SalesCrMemo."Pre-Assigned No." <> '' THEN OrigDocCode:=SalesCrMemo."Pre-Assigned No."; IF DocumentType= 'Credit Memo' THEN OrigDocCode := Text OrigDocCode ELSE IF DocumentType= 'Return Order' THEN OrigDocCode := Text OrigDocCode; IF FORMAT(SalesCrMemo."Posting Date") <> '' THEN PostingDate:=SalesCrMemo."Posting Date" ELSE IF FORMAT(SalesCrMemo."Shipment Date") <> '' THEN PostingDate:=SalesCrMemo."Shipment Date"; InvDiscountAmt:=0; SalesCrMemoLine.SETRANGE(SalesCrMemoLine."Document No.",SalesCrMemo."No."); IF SalesCrMemoLine.FINDFIRST THEN REPEAT InvDiscountAmt :=SalesCrMemoLine."Inv. Discount Amount"; Avalara Inc. All rights reserved. Page 56 of 215
57 IF (AvaConfig.COGS) AND NOT((AvaConfig."Enable Tax Amt Adj.") AND (SalesCrMemoLine."No."=TextSalesTaxAdjust)) THEN IF (STRPOS(FORMAT(SalesCrMemoLine."Tax Group Code"),FORMAT(AvaConfig."COGS Tax Group No.")) <> 0) THEN BEGIN RecItem.SETRANGE(RecItem."No.",SalesCrMemoLine."No."); IF RecItem.FINDFIRST THEN BEGIN TotalAmt+=(ROUND(RecItem."Standard Cost")*SalesCrMemoLine.Quantity)*-1; END ELSE TotalAmt+=(SalesCrMemoLine.Amount + InvDiscountAmt)*-1; END ELSE TotalAmt+=(SalesCrMemoLine.Amount + InvDiscountAmt)*-1 ELSE BEGIN TotalAmt+=(SalesCrMemoLine.Amount + InvDiscountAmt)*-1; UNTIL SalesCrMemoLine.NEXT = 0; TotalTax:=(SalesCrMemo."Amount Including VAT" - SalesCrMemo.Amount)*-1; AvaWindowOpen(Text DocNumPre); IF AvaConfig.FINDFIRST THEN; IF NOT AvaConfig."Enable AsynchronousAvaTax Post" THEN BEGIN AvaWindowClose(); IF AvaTaxEngine.fnPosting(TmpDocID,AvaConfig."Company ID",DocType,FORMAT(DocCode),FORMAT(OrigDocCode), PostingDate,TotalAmt,TotalTax,ResultText,AvaHead."No.") THEN BEGIN AvaWindowOpen(Text DocNumPre); AvaWindowClose(); EXIT(TRUE); END ELSE BEGIN AvaTaxEngine.fnCanceling(TmpDocID,AvaConfig."Company ID",DocType,2,FORMAT(DocCode)); ERROR('%1',ResultText); END ELSE BEGIN IF AvaHead."Document Id" = AvaHead."Document No." THEN BEGIN AvaHead."Document Id" := DocCode; AvaHead."Status Code":='OK'; AvaHead.MODIFY; EXIT(TRUE); Changes in function AvaSetDocNumTypeTable Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(0)) THEN Changes in function AvaUpdateTaxGroupCode Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(0)) THEN Avalara Inc. All rights reserved. Page 57 of 215
58 Changes in function AvaCallStat Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(0)) THEN Changes in function AvaCallStatOrder Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(0)) THEN Changes in function OnRelease Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(0)) THEN Changes in function OnReleasePost Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(0)) THEN Changes in function OnReleaseBatch Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(0)) THEN Changes in function ReleaseBatchSales Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(0)) THEN Modified code (Search for 1 st line and add colored Lines) SalesSetup.GET; IF SalesSetup."Calc. Inv. Discount" THEN BEGIN CODEUNIT.RUN(CODEUNIT::"Sales-Calc. Discount",SalesLine); LSalesHead.GET(LSalesHead."Document Type",LSalesHead."No."); LAvaConfig.FINDFIRST; IF NOT LAvaConfig.Initiate THEN LSalesHead."Tax Area Code":=LAvaConfig."Tax Group No."; // LSalesHead.Status := LSalesHead.Status::Released; SalesLine.SetSalesHeader(LSalesHead); Changes in function AvaIsValidDocument2 Modified code (Search for 1 st line and add colored Lines) Avalara Inc. All rights reserved. Page 58 of 215
59 IF NOT(AvaCheckInstStatus(1)) THEN Changes in function AvaSummarizeTaxLines Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(0)) THEN Changes in function AvaFillTempAvaLines Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(0)) THEN Changes in function AvaGetCurrentDocID Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(0)) THEN Changes in function OnPost Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(0)) THEN Changes in function GetTaxAmount Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(0)) THEN Changes in function AvaGetTaxAmountFull Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(0)) THEN EXIT; AvaHead.SETRANGE(AvaHead."Document No.",DocNumPre); AvaTaxAmountFull:=0; IF AvaHead.FINDFIRST THEN BEGIN AvaLine.SETRANGE(AvaLine."Tax Header No.",AvaHead."No."); AvaLine.SETRANGE("Tax Line No.",FORMAT(SalesLineTemp."Line No.")); IF AvaLine.FINDFIRST THEN BEGIN IF AvaLine."Tax Exempt Amount" > 0 THEN AvaTaxAmountFull:=0 ELSE AvaTaxAmountFull:=AvaLine."Tax Tax Amount"; Changes in function AvaGetTaxHistory Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(0)) THEN Changes in function AvaCallStatHistory Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(0)) THEN Avalara Inc. All rights reserved. Page 59 of 215
60 Changes in function AvaBatchTaxFill Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(0)) THEN Changes in function AvaBatchTaxFill_data Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(0)) THEN Changes in function AvaReleaseChange Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(0)) THEN Changes in function AvaSummarizeInvoiceTaxLines Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(0)) THEN Changes in function AvaFillTempAvaHistLines Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(0)) THEN Changes in function AvaSetHistDocNumTypeTable Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(0)) THEN Changes in function AvaServiceIsValidDocument Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(Source)) THEN Changes in function AvaServiceGetTaxOrder Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(0)) THEN Changes in function AvaServiceIsTaxCalculated Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(0)) THEN Changes in function OnServicePost Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(0)) THEN Changes in function AvaServicePostInv Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(0)) THEN Avalara Inc. All rights reserved. Page 60 of 215
61 Changes in function OnServiceReleasePost Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(0)) THEN Changes in function AvaServiceIsValidDocument2 Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(1)) THEN Changes in function AvaServiceIsValidDocumentBatch Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(Source)) THEN Changes in function AvaServiceBatchTaxFill Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(0)) THEN Changes in function ReleaseServiceBatchSales Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(0)) THEN Changes in function OnServiceReleaseBatch Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(0)) THEN Changes in function AvaServiceBatchTaxFill_data Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(0)) THEN Changes in function AvaServGetTaxOrderBatchPost Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(0)) THEN Changes in function AvaServicePostRtn Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(0)) THEN Avalara Inc. All rights reserved. Page 61 of 215
62 Changes in function AvaServiceGetTaxAmountFull Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(0)) THEN Changes in function AvaIdentifyDocumentNum Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(0)) THEN Changes in function AvaGetTaxGroupCode Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(0)) THEN Changes in function AvaCheckInstStatus Add new Parameter AvaCheckInstStatus : Integer New code AvaInstall.RESET; IF (AvaInstall.FINDFIRST) AND (AvaInstall."Install Status" = 3)THEN EXIT(TRUE) ELSE BEGIN IF isource = 1 THEN BEGIN AvaUserPref.SETRANGE(AvaUserPref."User Pref Name",USERID); IF AvaUserPref.FINDFIRST THEN BEGIN IF AvaUserPref.Warnings THEN MESSAGE(Text ); END ELSE IF AvaConfig."Display Warnings" THEN MESSAGE(Text ); EXIT(FALSE); END Changes in function AvaCheckSalesTaxAdjust Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(0)) THEN Changes in function AvaCheckServSalesTaxAdjust Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(0)) THEN Changes in function AvaBatchTaxFill_NoData Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(0)) THEN Avalara Inc. All rights reserved. Page 62 of 215
63 Changes in function AvaGetTaxGroupCodePost Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(0)) THEN Changes in function AvaGetTaxExemptAmountFull Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(0)) THEN Changes in function AvaCommitInv Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(0)) THEN Changes in function AvaCommitRtn Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(0)) THEN Changes in function AvaServiceCommitInv Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(0)) THEN Changes in function AvaServiceCommitRtn Modified code (Search for 1 st line and add colored Lines) IF NOT(AvaCheckInstStatus(0)) THEN Avalara Inc. All rights reserved. Page 63 of 215
64 Add new function AvaAddrValidateSales Parameters: Local Variables: Retun Avalara Inc. All rights reserved. Page 64 of 215
65 Text Constants: New code Result:=FALSE; IF NOT(AvaCheckInstStatus(0)) THEN EXIT(Result); Result:=TRUE; IF AvaConfig.FINDFIRST THEN BEGIN IF ((AvaConfig.Services MOD 100) MOD 10) = 1 THEN BEGIN IF AvaConfig."Disable Address" = FALSE THEN BEGIN CLEAR(AVAAddrValidn); IF CuAVAAddrValidn.IsConfigValid(iSalesHeader."Sell-to Country/Region Code")=FALSE THEN Avalara Inc. All rights reserved. Page 65 of 215
66 EXIT; AVAAddrValidn.InitForm(iSalesHeader."Sell-to Address",iSalesHeader."Sell-to Address 2", isalesheader."sell-to City",iSalesHeader."Sell-to Post Code",iSalesHeader."Sell-to County",iSalesHeader."Sell-to Country/Region Code", ipagecaption + ' - Sell-To',iSalesHeader."Sell-to Customer No.",iSalesHeader."Ship-to Code"); IF AVAAddrValidn.RUNMODAL = ACTION::LookupOK THEN; IF AVAAddrValidn.UpdateAccept THEN BEGIN AVAAddrValidn.RtnAddress(iSalesHeader."Sell-to Address",iSalesHeader."Sell-to Address 2",iSalesHeader."Sell-to City", isalesheader."sell-to Post Code",iSalesHeader."Sell-to County",iSalesHeader."Sell-to Country/Region Code"); AVAAddrValidn.AvaUpdateLatLongData(iSalesHeader."No.",iSalesHeader."Sell-to Customer No.",'',TextAddressSellTo) //Validate Ship-To Address CLEAR(AVAAddrValidn); AVAAddrValidn.InitForm(iSalesHeader."Ship-to Address",iSalesHeader."Ship-to Address 2", isalesheader."ship-to City",iSalesHeader."Ship-to Post Code",iSalesHeader."Ship-to County",iSalesHeader."Ship-to Country/Region Code", ipagecaption + ' - Ship-To',iSalesHeader."Sell-to Customer No.",iSalesHeader."Ship-to Code"); IF AVAAddrValidn.RUNMODAL = ACTION::LookupOK THEN; IF AVAAddrValidn.UpdateAccept THEN BEGIN AVAAddrValidn.RtnAddress(iSalesHeader."Ship-to Address",iSalesHeader."Ship-to Address 2",iSalesHeader."Ship-to City", isalesheader."ship-to Post Code",iSalesHeader."Ship-to County",iSalesHeader."Ship-to Country/Region Code"); AVAAddrValidn.AvaUpdateLatLongData(iSalesHeader."No.",iSalesHeader."Sell-to Customer No.",iSalesHeader."Shipto Code",TextAddressShipTo) //Validate Bill-To Address CLEAR(AVAAddrValidn); AVAAddrValidn.InitForm(iSalesHeader."Bill-to Address",iSalesHeader."Bill-to Address 2", isalesheader."bill-to City",iSalesHeader."Bill-to Post Code",iSalesHeader."Bill-to County",iSalesHeader."Bill-to Country/Region Code", ipagecaption + ' - Bill-To',iSalesHeader."Bill-to Customer No.",iSalesHeader."Ship-to Code"); IF AVAAddrValidn.RUNMODAL = ACTION::LookupOK THEN; IF AVAAddrValidn.UpdateAccept THEN BEGIN AVAAddrValidn.RtnAddress(iSalesHeader."Bill-to Address",iSalesHeader."Bill-to Address 2", isalesheader."bill-to City",iSalesHeader."Bill-to Post Code",iSalesHeader."Bill-to County",iSalesHeader."Bill-to Country/Region Code"); AVAAddrValidn.AvaUpdateLatLongData(iSalesHeader."No.",iSalesHeader."Bill-to Customer No.",'',TextAddressBillTo) END ELSE BEGIN Avalara Inc. All rights reserved. Page 66 of 215
67 MESSAGE('Address Validation is disabled in AvaTax User Preference/ Configuration Window. Cannot proceed with address validation'); Result:=FALSE; END END ELSE BEGIN MESSAGE('Service Unavailable'); Result:=FALSE; END EXIT(Result); Add new function AvaDocEntityClsSales Parameters: Local Variables: Avalara Inc. All rights reserved. Page 67 of 215
68 New code IF NOT(AvaCheckInstStatus(0)) THEN EXIT(FALSE); IF AvaConfig.FINDFIRST THEN BEGIN IF (AvaConfig."Exempt Processing"=AvaConfig."Exempt Processing"::"Sell-to Customer") THEN BEGIN "AVAEntityClsCustomerNo.":=iSalesHeader."Sell-to Customer No."; AVAEntityClsCustomerName:=iSalesHeader."Sell-to Customer Name"; AVAEntityClsShippingCode:=iSalesHeader."Ship-to Code"; END ELSE BEGIN "AVAEntityClsCustomerNo.":=iSalesHeader."Bill-to Customer No."; AVAEntityClsCustomerName:=iSalesHeader."Bill-to Name"; IF isalesheader."sell-to Customer No."=iSalesHeader."Bill-to Customer No." THEN AVAEntityClsShippingCode:=iSalesHeader."Ship-to Code" ELSE AVAEntityClsShippingCode:=''; AVADocEntityExists:=FALSE; AVADocEntityClass.RESET; AVADocEntityClass.SETRANGE(AVADocEntityClass."Order No.",iSalesHeader."No."); AVADocEntityClass.SETRANGE(AVADocEntityClass."Document Type",iSalesHeader."Document Type"); AVADocEntityClass.SETRANGE(AVADocEntityClass."Sale Service",AVADocEntityClass."Sale Service"::Sale); IF NOT AVADocEntityClass.FINDFIRST THEN BEGIN TempAVADocEntityClass.INIT; TempAVADocEntityClass."No." := "AVAEntityClsCustomerNo."; TempAVADocEntityClass.Name := AVAEntityClsCustomerName; TempAVADocEntityClass."Document Type":=iSalesHeader."Document Type"; Avalara Inc. All rights reserved. Page 68 of 215
69 TempAVADocEntityClass."Sale Service":=TempAVADocEntityClass."Sale Service"::Sale; AVACustEntityClass.SETRANGE(AVACustEntityClass."No.",TempAVADocEntityClass."No."); AVACustEntityClass.SETRANGE(AVACustEntityClass.Code,AVAEntityClsShippingCode); IF AVACustEntityClass.FINDFIRST THEN BEGIN TempAVADocEntityClass.Code := AVACustEntityClass.Code; TempAVADocEntityClass."Entity ID" := AVACustEntityClass."Entity ID"; END ELSE BEGIN TempAVADocEntityClass.Code := ''; TempAVADocEntityClass."Entity ID" := ''; TempAVADocEntityClass."Order No." := isalesheader."no."; AVADocEntityExists:=FALSE; END ELSE BEGIN AVADocEntityExists:=TRUE; TempAVADocEntityClass:=AVADocEntityClass; TempAVADocEntityClass."No." := "AVAEntityClsCustomerNo."; TempAVADocEntityClass.Name := AVAEntityClsCustomerName; TempAVADocEntityClass.Code := AVAEntityClsShippingCode; AVAFormDocEntityClass.AVAUpdateFormControlValues(TempAVADocEntityClass); IF AVAFormDocEntityClass.RUNMODAL = ACTION::OK=TRUE THEN BEGIN TempAVADocEntityClass."Entity ID":=AVAFormDocEntityClass.AVAReturnControlValEntityClass; IF NOT AVADocEntityExists THEN TempAVADocEntityClass.INSERT ELSE TempAVADocEntityClass.MODIFY; CLEAR(AVAFormDocEntityClass); Add new function AvaDocLatLongSales Parameters: Avalara Inc. All rights reserved. Page 69 of 215
70 Local Variables: New code IF NOT(AvaCheckInstStatus(0)) THEN EXIT(FALSE); IF AvaConfig.FINDFIRST THEN BEGIN AVADocLatLongDataExists:=FALSE; CLEAR(TempAVADocLatLongData); TempAVADocLatLongData."No.":=iSalesHead."No."; TempAVADocLatLongData."Document Type":=iSalesHead."Document Type"; Avalara Inc. All rights reserved. Page 70 of 215
71 TempAVADocLatLongData."Sale Service":=TempAVADocLatLongData."Sale Service"::Sale; TempAVADocLatLongData."Type-SellTo":=TempAVADocLatLongData."Type-SellTo"::"Sell-To"; TempAVADocLatLongData."SellTo-Customer No.":=iSalesHead."Sell-to Customer No."; TempAVADocLatLongData."Type-BillTo":=TempAVADocLatLongData."Type-BillTo"::"Bill-To"; TempAVADocLatLongData."BillTo-Customer No.":=iSalesHead."Bill-to Customer No."; TempAVADocLatLongData."Type-ShipTo":=TempAVADocLatLongData."Type-ShipTo"::"Ship-To"; TempAVADocLatLongData."ShipTo-Customer No.":=iSalesHead."Sell-to Customer No."; TempAVADocLatLongData."ShipTo-Code":=iSalesHead."Ship-to Code"; AVADocLatLongData.RESET; AVADocLatLongData.SETRANGE(AVADocLatLongData."No.",iSalesHead."No."); AVADocLatLongData.SETRANGE(AVADocLatLongData."Document Type",iSalesHead."Document Type"); AVADocLatLongData.SETRANGE(AVADocLatLongData."Sale Service",AVADocLatLongData."Sale Service"::Sale); IF AVADocLatLongData.FIND('-') THEN BEGIN AVADocLatLongDataExists:=TRUE; IF (AVADocLatLongData."SellTo-Customer No.")=(iSalesHead."Sell-to Customer No.") THEN BEGIN TempAVADocLatLongData."SellTo-Latitude":=AVADocLatLongData."SellTo-Latitude"; TempAVADocLatLongData."SellTo-Longitude":=AVADocLatLongData."SellTo-Longitude"; TempAVADocLatLongData."SellTo-Region ID":=AVADocLatLongData."SellTo-Region ID"; END ELSE AvaUpdateAddrDetails(iSalesHead."Sell-to Customer No.",'',TempAVADocLatLongData."SellTo- Latitude",TempAVADocLatLongData."SellTo-Longitude", TempAVADocLatLongData."SellTo-Region ID"); IF (AVADocLatLongData."BillTo-Customer No.")=(iSalesHead."Bill-to Customer No.") THEN BEGIN TempAVADocLatLongData."BillTo-Latitude":=AVADocLatLongData."BillTo-Latitude"; TempAVADocLatLongData."BillTo-Longitude":=AVADocLatLongData."BillTo-Longitude"; TempAVADocLatLongData."BillTo-Region ID":=AVADocLatLongData."BillTo-Region ID"; END ELSE AvaUpdateAddrDetails(iSalesHead."Bill-to Customer No.",'',TempAVADocLatLongData."BillTo- Latitude",TempAVADocLatLongData."BillTo-Longitude", TempAVADocLatLongData."BillTo-Region ID"); IF isaleshead."ship-to Code" = '' THEN BEGIN TempAVADocLatLongData."ShipTo-Latitude":=AVADocLatLongData."ShipTo-Latitude"; TempAVADocLatLongData."ShipTo-Longitude":=AVADocLatLongData."ShipTo-Longitude"; TempAVADocLatLongData."ShipTo-Region ID":=AVADocLatLongData."ShipTo-Region ID"; END ELSE AvaUpdateAddrDetails(iSalesHead."Sell-to Customer No.",iSalesHead."Ship-to Code",TempAVADocLatLongData."ShipTo- Latitude",TempAVADocLatLongData."ShipTo-Longitude", TempAVADocLatLongData."ShipTo-Region ID"); END ELSE BEGIN AvaUpdateAddrDetails(iSalesHead."Sell-to Customer No.",'',TempAVADocLatLongData."SellTo- Latitude",TempAVADocLatLongData."SellTo-Longitude", TempAVADocLatLongData."SellTo-Region ID"); AvaUpdateAddrDetails(iSalesHead."Bill-to Customer No.",'',TempAVADocLatLongData."BillTo- Latitude",TempAVADocLatLongData."BillTo-Longitude", TempAVADocLatLongData."BillTo-Region ID"); Avalara Inc. All rights reserved. Page 71 of 215
72 AvaUpdateAddrDetails(iSalesHead."Sell-to Customer No.",iSalesHead."Ship-to Code",TempAVADocLatLongData."ShipTo- Latitude",TempAVADocLatLongData."ShipTo-Longitude", TempAVADocLatLongData."ShipTo-Region ID"); AVAFormDocLatLongData.AVAUpdateControlValues(TempAVADocLatLongData); IF AVAFormDocLatLongData.RUNMODAL = ACTION::OK=TRUE THEN BEGIN AVAFormDocLatLongData.AVARtnLatLongData (TempAVADocLatLongData); IF NOT AVADocLatLongDataExists THEN TempAVADocLatLongData.INSERT ELSE TempAVADocLatLongData.MODIFY; CLEAR(AVAFormDocLatLongData); Avalara Inc. All rights reserved. Page 72 of 215
73 Add new function AvaStatisticsActionSales Parameters: New code IF NOT(AvaCheckInstStatus(0)) THEN EXIT(FALSE); IF AvaConfig.FINDFIRST THEN BEGIN IF CuAvaInstal.AvaIsTaxServEnabled(AvaConfig) THEN BEGIN AvaSetUserPreference(); AvaSetDocNumTypeTable(iSalesHead."No.",iSalesHead."Document Type",1); AvaSetShowMessage(); IF AvaIsValidDocument(1) THEN BEGIN SetPostingFlag(FALSE); AvaSetReleaseFlag(FALSE); AvaGetTaxOrder(); COMMIT; IF OptRunStat THEN AvaCallStat(); COMMIT; Avalara Inc. All rights reserved. Page 73 of 215
74 Add new function AvaUpdateAddrDetails Parameters: Local Variables: New code AVACustValidAddress.RESET; AVACustValidAddress.SETRANGE(AVACustValidAddress."No.",CustomerNo); AVACustValidAddress.SETRANGE(AVACustValidAddress.Code,CustomerCode); IF AVACustValidAddress.FIND('-') THEN BEGIN Latitude:=AVACustValidAddress.Latitude; Avalara Inc. All rights reserved. Page 74 of 215
75 Longitude:=AVACustValidAddress.Longitude; TaxRegionID:=AVACustValidAddress."Region ID"; Add new function AvaAdjustSalesLines Parameters: Return value: Local Variables Avalara Inc. All rights reserved. Page 75 of 215
76 New code Result:=FALSE; IF NOT(AvaCheckInstStatus(0)) THEN EXIT(FALSE); IF AvaConfig.FINDFIRST THEN BEGIN IF CuAvaInstal.AvaIsTaxServEnabled(AvaConfig) THEN BEGIN lsalesline.reset; lsalesline.setrange(lsalesline."document Type", idocumenttype); lsalesline.setrange(lsalesline."document No.", idocumentnum); IF lsalesline.find('-') THEN BEGIN REPEAT IF (AvaConfig."Enable Tax Amt Adj.") AND (lsalesline."no."=textsalestaxadjust) THEN BEGIN lsalesline.amount:=0; IF lsalesline."line Amount"<>0 THEN lsalesline."amount Including VAT":=lSalesLine."Line Amount"; lsalesline."line Amount":=0; lsalesline."vat %":=0; lsalesline."vat Base Amount":=0; lsalesline.modify; Result:=TRUE; UNTIL lsalesline.next=0; END END END Avalara Inc. All rights reserved. Page 76 of 215
77 Add new function AvaStatisticsActionInvoiceSales Parameters: New code IF NOT(AvaCheckInstStatus(0)) THEN EXIT(FALSE); IF AvaConfig.FINDFIRST THEN BEGIN IF CuAvaInstal.AvaIsTaxServEnabled(AvaConfig) THEN BEGIN AvaSetUserPreference(); AvaSetDocNumTypeTable(iSalesInvoice."No.",1,2); IF AvaIsValidDocument(1) THEN BEGIN AvaGetTaxHistory(); COMMIT; AvaCallStatHistory; COMMIT; Add new function AvaStatisticsActionCreditSales Parameters: Avalara Inc. All rights reserved. Page 77 of 215
78 New code IF NOT(AvaCheckInstStatus(0)) THEN EXIT(FALSE); IF AvaConfig.FINDFIRST THEN BEGIN IF CuAvaInstal.AvaIsTaxServEnabled(AvaConfig) THEN BEGIN AvaSetUserPreference(); AvaSetDocNumTypeTable(iSalesCreditMemo."No.",5,3); IF AvaIsValidDocument(1) THEN BEGIN AvaGetTaxHistory(); COMMIT; AvaCallStatHistory; COMMIT; Add new function AvaAddrValidateService Parameters: Avalara Inc. All rights reserved. Page 78 of 215
79 Retun Value: Local Variables: Avalara Inc. All rights reserved. Page 79 of 215
80 New code Result:=FALSE; IF NOT(AvaCheckInstStatus(0)) THEN EXIT(Result); Result:=TRUE; IF AvaConfig.FINDFIRST THEN BEGIN IF ((AvaConfig.Services MOD 100) MOD 10) = 1 THEN BEGIN IF (AvaConfig."Disable Address" = FALSE) AND (AvaConfig."Enable Serv. Modu. Integrtn")THEN BEGIN CLEAR(AVAAddrValidn); IF CuAVAAddrValidn.IsConfigValid(iServiceHeader."Country/Region Code")=FALSE THEN EXIT; AVAAddrValidn.InitForm(iServiceHeader.Address,iServiceHeader."Address 2",iServiceHeader.City,iServiceHeader."Post Code",iServiceHeader.County, iserviceheader."country/region Code",iPageCaption + ' - General',iServiceHeader."Customer No.",iServiceHeader."Shipto Code"); IF AVAAddrValidn.RUNMODAL = ACTION::LookupOK THEN; IF AVAAddrValidn.UpdateAccept THEN BEGIN AVAAddrValidn.RtnAddress(iServiceHeader.Address,iServiceHeader."Address 2",iServiceHeader.City,iServiceHeader."Post Code",iServiceHeader.County, iserviceheader."country/region Code"); AVAAddrValidn.AvaUpdateLatLongData(iServiceHeader."No.",iServiceHeader."Customer No.",'',TextAddressSellTo); //Validate Bill-To Address CLEAR(AVAAddrValidn); Avalara Inc. All rights reserved. Page 80 of 215
81 AVAAddrValidn.InitForm(iServiceHeader."Bill-to Address",iServiceHeader."Bill-to Address 2",iServiceHeader."Bill-to City",iServiceHeader."Bill-to Post Code", iserviceheader."bill-to County",iServiceHeader."Bill-to Country/Region Code",iPageCaption + ' - Bill- To',iServiceHeader."Bill-to Customer No.",iServiceHeader."Ship-to Code"); IF AVAAddrValidn.RUNMODAL = ACTION::LookupOK THEN; IF AVAAddrValidn.UpdateAccept THEN BEGIN AVAAddrValidn.RtnAddress(iServiceHeader."Bill-to Address",iServiceHeader."Bill-to Address 2",iServiceHeader."Billto City",iServiceHeader."Bill-to Post Code", iserviceheader."bill-to County",iServiceHeader."Bill-to Country/Region Code"); AVAAddrValidn.AvaUpdateLatLongData(iServiceHeader."No.",iServiceHeader."Bill-to Customer No.",'',TextAddressBillTo); //Validate Ship-To Address CLEAR(AVAAddrValidn); AVAAddrValidn.InitForm(iServiceHeader."Ship-to Address",iServiceHeader."Ship-to Address 2",iServiceHeader."Ship-to City",iServiceHeader."Ship-to Post Code",iServiceHeader."Ship-to County", iserviceheader."ship-to Country/Region Code",iPageCaption + ' - Ship-To',iServiceHeader."Customer No.",iServiceHeader."Ship-to Code"); IF AVAAddrValidn.RUNMODAL = ACTION::LookupOK THEN; IF AVAAddrValidn.UpdateAccept THEN BEGIN AVAAddrValidn.RtnAddress(iServiceHeader."Ship-to Address",iServiceHeader."Ship-to Address 2",iServiceHeader."Ship-to City",iServiceHeader."Ship-to Post Code", iserviceheader."ship-to County",iServiceHeader."Ship-to Country/Region Code"); AVAAddrValidn.AvaUpdateLatLongData(iServiceHeader."No.",iServiceHeader."Customer No.",iServiceHeader."Shipto Code",TextAddressShipTo); END ELSE BEGIN IF NOT (AvaConfig."Enable Serv. Modu. Integrtn") THEN ERROR('Service Integration is disabled in AvaTax Configuration Window.'); MESSAGE('Address Validation is disabled in AvaTax User Preference/ Configuration Window. Cannot proceed with address validation'); Result:=FALSE; END ELSE BEGIN MESSAGE('Service Unavailable'); Result:=FALSE; END //Avalara End Add new function AvaDocEntityClsService Parameters: Avalara Inc. All rights reserved. Page 81 of 215
82 Local Variables: New code IF NOT(AvaCheckInstStatus(0)) THEN EXIT(FALSE); IF AvaConfig.FINDFIRST THEN BEGIN IF (AvaConfig."Enable Serv. Modu. Integrtn") THEN IF (AvaConfig."Exempt Processing"=AvaConfig."Exempt Processing"::"Sell-to Customer") THEN BEGIN "AVAEntityClsCustomerNo.":=iServiceHeader."Customer No."; AVAEntityClsCustomerName:=iServiceHeader.Name; Avalara Inc. All rights reserved. Page 82 of 215
83 AVAEntityClsShippingCode:=iServiceHeader."Ship-to Code"; END ELSE BEGIN "AVAEntityClsCustomerNo.":=iServiceHeader."Bill-to Customer No."; AVAEntityClsCustomerName:=iServiceHeader."Bill-to Name"; IF iserviceheader."customer No."=iServiceHeader."Bill-to Customer No." THEN AVAEntityClsShippingCode:=iServiceHeader."Ship-to Code" ELSE AVAEntityClsShippingCode:=''; END ELSE BEGIN MESSAGE('Service Integration is Disabled in AvaTax Configuration Window.'); EXIT; END AVADocEntityExists:=FALSE; AVADocEntityClass.RESET; AVADocEntityClass.SETRANGE(AVADocEntityClass."Order No.",iServiceHeader."No."); AVADocEntityClass.SETRANGE(AVADocEntityClass."Document Type",iServiceHeader."Document Type"); AVADocEntityClass.SETRANGE(AVADocEntityClass."Sale Service",AVADocEntityClass."Sale Service"::Service); IF NOT AVADocEntityClass.FINDFIRST THEN BEGIN TempAVADocEntityClass.INIT; TempAVADocEntityClass."No." := "AVAEntityClsCustomerNo."; TempAVADocEntityClass.Name := AVAEntityClsCustomerName; TempAVADocEntityClass."Document Type":=iServiceHeader."Document Type"; TempAVADocEntityClass."Sale Service":=TempAVADocEntityClass."Sale Service"::Service; AVACustEntityClass.SETRANGE(AVACustEntityClass."No.",TempAVADocEntityClass."No."); AVACustEntityClass.SETRANGE(AVACustEntityClass.Code,AVAEntityClsShippingCode); IF AVACustEntityClass.FINDFIRST THEN BEGIN TempAVADocEntityClass.Code := AVACustEntityClass.Code; TempAVADocEntityClass."Entity ID" := AVACustEntityClass."Entity ID"; END ELSE BEGIN TempAVADocEntityClass.Code := ''; TempAVADocEntityClass."Entity ID" := ''; TempAVADocEntityClass."Order No." := iserviceheader."no."; AVADocEntityExists:=FALSE; END ELSE BEGIN AVADocEntityExists:=TRUE; TempAVADocEntityClass:=AVADocEntityClass; TempAVADocEntityClass."No." := "AVAEntityClsCustomerNo."; TempAVADocEntityClass.Name := AVAEntityClsCustomerName; TempAVADocEntityClass.Code := AVAEntityClsShippingCode; Avalara Inc. All rights reserved. Page 83 of 215
84 AVAFormDocEntityClass.AVAUpdateFormControlValues(TempAVADocEntityClass); IF AVAFormDocEntityClass.RUNMODAL = ACTION::OK=TRUE THEN BEGIN TempAVADocEntityClass."Entity ID":=AVAFormDocEntityClass.AVAReturnControlValEntityClass; IF NOT AVADocEntityExists THEN TempAVADocEntityClass.INSERT ELSE TempAVADocEntityClass.MODIFY; CLEAR(AVAFormDocEntityClass); //Avalara End Add new function AvaDocLatLongService Parameters: Local Variables: Avalara Inc. All rights reserved. Page 84 of 215
85 New code IF NOT(AvaCheckInstStatus(0)) THEN EXIT(FALSE); AVADocLatLongDataExists:=FALSE; IF AvaConfig.FINDFIRST AND NOT(AvaConfig."Enable Serv. Modu. Integrtn") THEN BEGIN MESSAGE('Service Integration is Disabled in AvaTax Configuration Window.'); EXIT; CLEAR(TempAVADocLatLongData); TempAVADocLatLongData."No.":=iServiceHeader."No."; TempAVADocLatLongData."Document Type":=iServiceHeader."Document Type"; TempAVADocLatLongData."Sale Service":=TempAVADocLatLongData."Sale Service"::Service; TempAVADocLatLongData."Type-SellTo":=TempAVADocLatLongData."Type-SellTo"::"Sell-To"; TempAVADocLatLongData."SellTo-Customer No.":=iServiceHeader."Customer No."; TempAVADocLatLongData."Type-BillTo":=TempAVADocLatLongData."Type-BillTo"::"Bill-To"; TempAVADocLatLongData."BillTo-Customer No.":=iServiceHeader."Bill-to Customer No."; TempAVADocLatLongData."Type-ShipTo":=TempAVADocLatLongData."Type-ShipTo"::"Ship-To"; TempAVADocLatLongData."ShipTo-Customer No.":=iServiceHeader."Customer No."; TempAVADocLatLongData."ShipTo-Code":=iServiceHeader."Ship-to Code"; AVADocLatLongData.RESET; AVADocLatLongData.SETRANGE(AVADocLatLongData."No.",iServiceHeader."No."); Avalara Inc. All rights reserved. Page 85 of 215
86 AVADocLatLongData.SETRANGE(AVADocLatLongData."Document Type",iServiceHeader."Document Type"); AVADocLatLongData.SETRANGE(AVADocLatLongData."Sale Service",AVADocLatLongData."Sale Service"::Service); IF AVADocLatLongData.FIND('-') THEN BEGIN AVADocLatLongDataExists:=TRUE; IF (AVADocLatLongData."SellTo-Customer No.")=(iServiceHeader."Customer No.") THEN BEGIN TempAVADocLatLongData."SellTo-Latitude":=AVADocLatLongData."SellTo-Latitude"; TempAVADocLatLongData."SellTo-Longitude":=AVADocLatLongData."SellTo-Longitude"; TempAVADocLatLongData."SellTo-Region ID":=AVADocLatLongData."SellTo-Region ID"; END ELSE AvaUpdateAddrDetails(iServiceHeader."Customer No.",'',TempAVADocLatLongData."SellTo-Latitude", TempAVADocLatLongData."SellTo-Longitude", TempAVADocLatLongData."SellTo-Region ID"); IF (AVADocLatLongData."BillTo-Customer No.")=(iServiceHeader."Bill-to Customer No.") THEN BEGIN TempAVADocLatLongData."BillTo-Latitude":=AVADocLatLongData."BillTo-Latitude"; TempAVADocLatLongData."BillTo-Longitude":=AVADocLatLongData."BillTo-Longitude"; TempAVADocLatLongData."BillTo-Region ID":=AVADocLatLongData."BillTo-Region ID"; END ELSE AvaUpdateAddrDetails(iServiceHeader."Bill-to Customer No.",'',TempAVADocLatLongData."BillTo-Latitude", TempAVADocLatLongData."BillTo-Longitude", TempAVADocLatLongData."BillTo-Region ID"); IF iserviceheader."ship-to Code" = '' THEN BEGIN TempAVADocLatLongData."ShipTo-Latitude":=AVADocLatLongData."ShipTo-Latitude"; TempAVADocLatLongData."ShipTo-Longitude":=AVADocLatLongData."ShipTo-Longitude"; TempAVADocLatLongData."ShipTo-Region ID":=AVADocLatLongData."ShipTo-Region ID"; END ELSE AvaUpdateAddrDetails(iServiceHeader."Customer No.",iServiceHeader."Ship-to Code",TempAVADocLatLongData."ShipTo-Latitude",TempAVADocLatLongData."ShipTo-Longitude", TempAVADocLatLongData."ShipTo-Region ID"); END ELSE BEGIN AvaUpdateAddrDetails(iServiceHeader."Customer No.",'',TempAVADocLatLongData."SellTo- Latitude",TempAVADocLatLongData."SellTo-Longitude", TempAVADocLatLongData."SellTo-Region ID"); AvaUpdateAddrDetails(iServiceHeader."Bill-to Customer No.",'',TempAVADocLatLongData."BillTo- Latitude",TempAVADocLatLongData."BillTo-Longitude", TempAVADocLatLongData."BillTo-Region ID"); AvaUpdateAddrDetails(iServiceHeader."Customer No.",iServiceHeader."Ship-to Code",TempAVADocLatLongData."ShipTo- Latitude",TempAVADocLatLongData."ShipTo-Longitude", TempAVADocLatLongData."ShipTo-Region ID"); AVAFormDocLatLongData.AVAUpdateControlValues(TempAVADocLatLongData); IF AVAFormDocLatLongData.RUNMODAL = ACTION::OK=TRUE THEN BEGIN AVAFormDocLatLongData.AVARtnLatLongData(TempAVADocLatLongData); IF NOT AVADocLatLongDataExists THEN TempAVADocLatLongData.INSERT ELSE TempAVADocLatLongData.MODIFY; Avalara Inc. All rights reserved. Page 86 of 215
87 CLEAR(AVAFormDocLatLongData); Add new function AvaStatisticsActionService Parameters: New code IF NOT(AvaCheckInstStatus(0)) THEN EXIT(FALSE); IF AvaConfig.FINDFIRST THEN BEGIN IF CuAvaInstal.AvaIsTaxServEnabled(AvaConfig) AND (AvaConfig."Enable Serv. Modu. Integrtn") THEN BEGIN AvaSetUserPreference(); AvaServiceSetDocNumTypeTable(iServiceHeader."No.",iServiceHeader."Document Type",1); AvaSetShowMessage(); IF AvaServiceIsValidDocument(1) THEN BEGIN AvaServiceGetTaxOrder(); COMMIT; IF OptRunStat THEN AvaCallStat(); COMMIT; Avalara Inc. All rights reserved. Page 87 of 215
88 Add new function AvaAdjustServiceLines Parameters: Return Value: Local Variables: Avalara Inc. All rights reserved. Page 88 of 215
89 New code Result:=FALSE; IF NOT(AvaCheckInstStatus(0)) THEN EXIT(FALSE); IF AvaConfig.FINDFIRST THEN BEGIN IF CuAvaInstal.AvaIsTaxServEnabled(AvaConfig) AND (AvaConfig."Enable Serv. Modu. Integrtn") THEN BEGIN lserviceline.reset; lserviceline.setrange(lserviceline."document Type", idocumenttype); lserviceline.setrange(lserviceline."document No.", idocumentnum); IF lserviceline.find('-') THEN BEGIN REPEAT IF (AvaConfig."Enable Tax Amt Adj.") AND (lserviceline."no."=textsalestaxadjust) THEN BEGIN lserviceline.amount:=0; IF lserviceline."line Amount"<>0 THEN lserviceline."amount Including VAT":=lServiceLine."Line Amount"; lserviceline."line Amount":=0; lserviceline."vat %":=0; lserviceline."vat Base Amount":=0; lserviceline.modify; Result:=TRUE; UNTIL lserviceline.next=0; END END END Avalara Inc. All rights reserved. Page 89 of 215
90 Add new function AvaStatisticsActionInvoiceService Parameters: New code IF NOT(AvaCheckInstStatus(0)) THEN EXIT(FALSE); IF AvaConfig.FINDFIRST THEN BEGIN IF CuAvaInstal.AvaIsTaxServEnabled(AvaConfig) AND (AvaConfig."Enable Serv. Modu. Integrtn") THEN BEGIN AvaSetUserPreference(); AvaServiceSetDocNumTypeTable(iServiceInvoiceHeader."No.",1,2); IF AvaServiceIsValidDocument(1) THEN BEGIN AvaGetTaxHistory(); COMMIT; AvaCallStatHistory; COMMIT; Avalara Inc. All rights reserved. Page 90 of 215
91 Add new function AvaStatisticsActionCreditService Parameters: New code IF NOT(AvaCheckInstStatus(0)) THEN EXIT(FALSE); IF AvaConfig.FINDFIRST THEN BEGIN IF CuAvaInstal.AvaIsTaxServEnabled(AvaConfig) AND (AvaConfig."Enable Serv. Modu. Integrtn") THEN BEGIN AvaSetUserPreference(); AvaServiceSetDocNumTypeTable(iServiceCreditMemo."No.",5,3); IF AvaServiceIsValidDocument(1) THEN BEGIN AvaGetTaxHistory(); COMMIT; AvaCallStatHistory; COMMIT; Add new function AvaNavStatisticsValidDocument Parameters: Avalara Inc. All rights reserved. Page 91 of 215
92 Return Value: Local Variables: Avalara Inc. All rights reserved. Page 92 of 215
93 New code IF NOT(AvaCheckInstStatus(0)) THEN EXIT(FALSE); Result:=FALSE; AvaIsTaxCalculatedFlag:=FALSE; IF AvaConfig.FINDFIRST THEN IF ((AvaConfig.Services MOD 100)/10) >= 1 THEN BEGIN Result:=TRUE; AvaSetDocNumTypeTable(iDocumentNum,iDocumentType,iDocumentTable); IF AvaIsValidDocument(2) THEN BEGIN IF AvaIsTaxCalculated = 0 THEN BEGIN AvaFillTempAvaLines(); AvaIsTaxCalculatedFlag:=TRUE; IF isaleslinenum = TextSalesTaxAdjust THEN vavasalestaxadjustflag := TRUE ELSE vavasalestaxadjustflag := FALSE; END ELSE Result:=FALSE; EXIT(Result AND AvaIsTaxCalculatedFlag); Avalara Inc. All rights reserved. Page 93 of 215
94 Add new function AvaNavHistStatisticsValidDocument Parameters: Retun value: New code IF NOT(AvaCheckInstStatus(0)) THEN EXIT(FALSE); Result:=FALSE; IF AvaConfig.FINDFIRST THEN Avalara Inc. All rights reserved. Page 94 of 215
95 IF CuAvaInstal.AvaIsTaxServEnabled(AvaConfig) THEN BEGIN Result:=TRUE; AvaSetHistDocNumTypeTable(iSalesInvCrMemoNum); IF AvaIsValidDocument(2) THEN AvaFillTempAvaHistLines ELSE Result:=FALSE; EXIT(Result); Add new function AvaAddrValidateServiceContract Parameters: Return value: Avalara Inc. All rights reserved. Page 95 of 215
96 Local Variables: Text Constants: Avalara Inc. All rights reserved. Page 96 of 215
97 New code Result:=FALSE; IF NOT(AvaCheckInstStatus(0)) THEN EXIT(Result); Result:=TRUE; IF AvaConfig.FINDFIRST THEN BEGIN IF ((AvaConfig.Services MOD 100) MOD 10) = 1 THEN BEGIN IF (AvaConfig."Disable Address" = FALSE) AND (AvaConfig."Enable Serv. Modu. Integrtn")THEN BEGIN CLEAR(AVAAddrValidn); IF CuAVAAddrValidn.IsConfigValid(iServiceContractHeader."Country/Region Code")=FALSE THEN EXIT; AVAAddrValidn.InitForm(iServiceContractHeader.Address,iServiceContractHeader."Address 2",iServiceContractHeader.City,iServiceContractHeader."Post Code", iservicecontractheader.county,iservicecontractheader."country/region Code",iPageCaption + ' - General',iServiceContractHeader."Customer No.",iServiceContractHeader."Ship-to Code"); IF AVAAddrValidn.RUNMODAL = ACTION::LookupOK THEN; IF AVAAddrValidn.UpdateAccept THEN BEGIN AVAAddrValidn.RtnAddress(iServiceContractHeader.Address,iServiceContractHeader."Address 2",iServiceContractHeader.City,iServiceContractHeader."Post Code", iservicecontractheader.county,iservicecontractheader."country/region Code"); AVAAddrValidn.AvaUpdateLatLongData(iServiceContractHeader."Contract No.",iServiceContractHeader."Customer No.",'',TextAddressSellTo); //Validate Bill-To Address CLEAR(AVAAddrValidn); Avalara Inc. All rights reserved. Page 97 of 215
98 AVAAddrValidn.InitForm(iServiceContractHeader."Bill-to Address",iServiceContractHeader."Bill-to Address 2",iServiceContractHeader."Bill-to City", iservicecontractheader."bill-to Post Code", iservicecontractheader."bill-to County",iServiceContractHeader."Bill-to Country/Region Code", ipagecaption + ' - Bill-To',iServiceContractHeader."Bill-to Customer No.",iServiceContractHeader."Ship-to Code"); IF AVAAddrValidn.RUNMODAL = ACTION::LookupOK THEN; IF AVAAddrValidn.UpdateAccept THEN BEGIN AVAAddrValidn.RtnAddress(iServiceContractHeader."Bill-to Address",iServiceContractHeader."Bill-to Address 2",iServiceContractHeader."Bill-to City", iservicecontractheader."bill-to Post Code",iServiceContractHeader."Bill-to County",iServiceContractHeader."Bill-to Country/Region Code"); AVAAddrValidn.AvaUpdateLatLongData(iServiceContractHeader."Contract No.",iServiceContractHeader."Bill-to Customer No.",'',TextAddressBillTo); //Validate Ship-To Address CLEAR(AVAAddrValidn); AVAAddrValidn.InitForm(iServiceContractHeader."Ship-to Address",iServiceContractHeader."Ship-to Address 2",iServiceContractHeader."Ship-to City", iservicecontractheader."ship-to Post Code",iServiceContractHeader."Ship-to County",iServiceContractHeader."Ship-to Country/Region Code", ipagecaption + ' - Ship-To',iServiceContractHeader."Customer No.",iServiceContractHeader."Ship-to Code"); IF AVAAddrValidn.RUNMODAL = ACTION::LookupOK THEN; IF AVAAddrValidn.UpdateAccept THEN BEGIN AVAAddrValidn.RtnAddress(iServiceContractHeader."Ship-to Address",iServiceContractHeader."Ship-to Address 2",iServiceContractHeader."Ship-to City", iservicecontractheader."ship-to Post Code",iServiceContractHeader."Ship-to County",iServiceContractHeader."Shipto Country/Region Code"); AVAAddrValidn.AvaUpdateLatLongData(iServiceContractHeader."Contract No.",iServiceContractHeader."Customer No.",iServiceContractHeader."Ship-to Code",TextAddressShipTo); END ELSE BEGIN IF NOT (AvaConfig."Enable Serv. Modu. Integrtn") THEN ERROR('Service Integration is disabled in AvaTax Configuration Window.'); MESSAGE('Address Validation is disabled in AvaTax User Preference/ Configuration Window. Cannot proceed with address validation'); Result:=FALSE; END ELSE BEGIN MESSAGE('Service Unavailable'); Result:=FALSE; END Avalara Inc. All rights reserved. Page 98 of 215
99 Add new function AvaNavStatisticsValidDocumentService Parameters: Return value: Local Variables: Avalara Inc. All rights reserved. Page 99 of 215
100 New code IF NOT(AvaCheckInstStatus(0)) THEN EXIT(FALSE); Result:=FALSE; AvaIsTaxCalculatedFlag:=FALSE; IF AvaConfig.FINDFIRST THEN IF CuAvaInstal.AvaIsTaxServEnabled(AvaConfig) AND (AvaConfig."Enable Serv. Modu. Integrtn") THEN BEGIN Result:=TRUE; AvaServiceSetDocNumTypeTable(iDocumentNum,iDocumentType,iDocumentTable); IF AvaServiceIsValidDocument(2) THEN BEGIN IF AvaServiceIsTaxCalculated = 0 THEN BEGIN AvaFillTempAvaLines(); AvaIsTaxCalculatedFlag:=TRUE; IF iservicelinenum = TextSalesTaxAdjust THEN vavasalestaxadjustflag := TRUE ELSE vavasalestaxadjustflag := FALSE; END ELSE Result:=FALSE; EXIT(Result AND AvaIsTaxCalculatedFlag); Avalara Inc. All rights reserved. Page 100 of 215
101 Add new function AvaNavHistStatisticsValidDocumentService Parameters: Return Value: New code IF NOT(AvaCheckInstStatus(0)) THEN EXIT(FALSE); Result:=FALSE; IF AvaConfig.FINDFIRST THEN IF CuAvaInstal.AvaIsTaxServEnabled(AvaConfig) AND (AvaConfig."Enable Serv. Modu. Integrtn") THEN BEGIN Avalara Inc. All rights reserved. Page 101 of 215
102 Result:=TRUE; AvaSetHistDocNumTypeTable(iServiceInvCrMemoNum); IF AvaServiceIsValidDocument(2) THEN AvaFillTempAvaHistLines ELSE Result:=FALSE; EXIT(Result); Add new function AvaSetDocNumPreSales Parameters: New code CASE idoctype OF 0:vDocNumPre:='QUO' + idocnum; 1:vDocNumPre:='ORD' + idocnum; 2:vDocNumPre:='INV' + idocnum; 3:vDocNumPre:='CRM' + idocnum; 4:vDocNumPre:='BLC' + idocnum; 5:vDocNumPre:='RET' + idocnum; Avalara Inc. All rights reserved. Page 102 of 215
103 Add new function AvaEvaluateForAsyncSales Parameters: Local Variables: New code lavahead.reset; CASE idoctype OF 0: lavahead.setrange("document Type",FORMAT(iSalesHead."Document Type"::Quote)); 1: lavahead.setrange("document Type",FORMAT(iSalesHead."Document Type"::Order)); 2: lavahead.setrange("document Type",FORMAT(iSalesHead."Document Type"::Invoice)); 3: lavahead.setrange("document Type",FORMAT(iSalesHead."Document Type"::"Credit Memo")); Avalara Inc. All rights reserved. Page 103 of 215
104 4: lavahead.setrange("document Type",FORMAT(iSalesHead."Document Type"::"Blanket Order")); 5: lavahead.setrange("document Type",FORMAT(iSalesHead."Document Type"::"Return Order")); lavahead.setfilter("document No.",'%1','*'+vDocNumPre+'*'); IF lavahead.findlast THEN IF lavahead."status Code" = 'OK' THEN vdocnumpre := vdocnumpre + '-'+ FORMAT(lAvaHead.COUNT) ELSE vdocnumpre := lavahead."document No."; Add new function AvaSetUserPreference New code AvaUserPref.SETRANGE(AvaUserPref."User Pref Name",USERID); IF AvaUserPref.FINDFIRST THEN; Avalara Inc. All rights reserved. Page 104 of 215
105 Changes in Avalara Pages Page AVA Address Validation Change in Action Validate Address Modified code Search for 1 st line and add colored Lines AcceptEnable:= FALSE; ValidateAddressEnable := TRUE; IF StatusCode = 0 THEN BEGIN IF STRLEN("TmpL 1") > 50 THEN BEGIN "VLine 1":=COPYSTR("TmpL 1", 1, 49); "VLine 2":=COPYSTR("TmpL 1", 49); END ELSE BEGIN "VLine 1":="TmpL 1"; //AVANA //AVANA //AVANA Change in Action InitForm Modified code Search for 1 st line and add colored Lines StatusCode:=AvaAddrValidn.AvaValidate("TmpL 1","TmpL 2","TmpL 3",TmpCity,TmpState,TmpZip,TmpCountry, TmpLatitude, TmpLongitude, TmpRegionID, ResultText,0); AcceptEnable := FALSE; ValidateAddressEnable := FALSE; IF StatusCode = 0 THEN BEGIN IF STRLEN("TmpL 1") > 50 THEN BEGIN //AVANA "VLine 1":=COPYSTR("TmpL 1", 1, 49); //AVANA "VLine 2":=COPYSTR("TmpL 1", 49); //AVANA END ELSE BEGIN "VLine 1":="TmpL 1"; "VLine 2":="TmpL 2"; Change in Action RtnAddress Modified code Search for 1 st line and add colored Lines IF STRLEN("VLine 1") > 50 THEN BEGIN //AVANA L1:=COPYSTR("VLine 1", 0, 49); //AVANA L2:=COPYSTR("VLine 1", 49, STRLEN("VLine 1")-49); //AVANA END ELSE BEGIN L1:="VLine 1"; L2:="VLine 2"; Ct:=VCity; Avalara Inc. All rights reserved. Page 105 of 215
106 Page AVA Configuration Card Add Global variables: Name DataType Subtype Length RecAVASetUpAssistant Record AVA Setup Assistant RecAVAAddressCountry Record AVA Address Country RecTaxJurisdiction Record Tax Jurisdiction Change in Version List of objects: New Value : AVANA Changes in Page design Changes in Variable Text : TextConst NAV Page Action Verify Credentials Search for below 1 st line IF ("Account Number"<>'') AND ("License Key"<>'') AND ("Tax Url"<>'') AND ("Company ID"<>'') THEN BEGIN //IF AvaAddrvalidn.AvaIsAuthorised("License Key","Account Number","Tax Url",ResultText,Adapter,"Expiery Date") = 0 THEN BEGIN //AVANA Avalara Inc. All rights reserved. Page 106 of 215
107 IF AvaAddrvalidn.AvaIsAuthorised("License Key","Account Number","Tax Url",ResultText,Adapter,"Expiery Date","Services Enabled") >= 1 THEN BEGIN //AVANA ResultText:=Text FORMAT("Expiery Date"); IF NOT AvaInstald.IsAvaTaxInstalled() THEN BEGIN AvaInstald.InitializeConfigValues(TRUE,Adapter,"Account Number","License Key","Tax Url", FALSE,FALSE,TRUE,FALSE,Adapter,"Company ID","Expiery Date"); AvaInstald.InitiateApplicationData(); Initiate:=FALSE; "Disable Tax Calc.":=FALSE; "Disable Address":=FALSE; US:=FALSE; CAN:=FALSE; "Tax Group No.":='AVATAX'; "Batch Address Vlid" :=TRUE; //"Client Log":=TRUE; //"Request Time":=300; "Display Warnings":=TRUE; "Entity\Use":=TRUE; "Shipping Code":='FR'; "Misc. Code":='HNLD'; "Show Statistics":=TRUE; RecAVASetUpAssistant.RESET; IF RecAVASetUpAssistant.FINDFIRST THEN BEGIN RecAVASetUpAssistant.Credentials := ''; RecAVASetUpAssistant."Valid Account Credentials":= FALSE; RecAVASetUpAssistant.MODIFY; END ELSE BEGIN RecAVASetUpAssistant."Primary Key" := ''; RecAVASetUpAssistant.Credentials := ''; RecAVASetUpAssistant."Valid Account Credentials":= FALSE; RecAVASetUpAssistant.INSERT; END ELSE BEGIN RecAVASetUpAssistant.RESET; IF RecAVASetUpAssistant.FINDFIRST THEN BEGIN RecAVASetUpAssistant.Credentials := 'Verified on '+ FORMAT(CURRENTDATETIME); RecAVASetUpAssistant."Valid Account Credentials":= TRUE; RecAVASetUpAssistant.MODIFY; END ELSE BEGIN RecAVASetUpAssistant."Primary Key" := ''; RecAVASetUpAssistant.Credentials := 'Verified on '+ FORMAT(CURRENTDATETIME); RecAVASetUpAssistant."Valid Account Credentials":= TRUE; RecAVASetUpAssistant.INSERT; RecAVAAddressCountry.RESET; RecAVAAddressCountry.SETRANGE(Code,'00'); IF RecAVAAddressCountry.COUNT = 0 THEN BEGIN RecAVAAddressCountry.INIT; Avalara Inc. All rights reserved. Page 107 of 215
108 RecAVAAddressCountry.Code:='00'; RecAVAAddressCountry.Name:='No Country Name'; RecAVAAddressCountry.Check := TRUE; RecAVAAddressCountry."Form Check" := TRUE; RecAVAAddressCountry.INSERT; "Connector Version":= Text ;//AVAGetConnectorVersionNumber; AccountValueEnable :=FALSE; Changes in Caption for following fields: Name txtaccounturl txtcompanyid Caption Web Service URL Company Code Changes in Disable Tax Calc.--> OnValidate Search for below 1 st line IF "Disable Tax Calc." THEN BEGIN IF NOT DIALOG.CONFIRM('Do you want to disable Tax Calculation?', TRUE) THEN "Disable Tax Calc.":=FALSE; //IF ISCLEAR (AVA_WshShell) THEN //CREATE (AVA_WshShell,FALSE,TRUE); //AVA_WshShell.SendKeys ('{F5}'); CurrPage.UPDATE; Changes in txttaxschid--> OnValidate RecAVASetUpAssistant.RESET; IF RecAVASetUpAssistant.FINDFIRST THEN BEGIN RecTaxJurisdiction.RESET; RecTaxJurisdiction.SETRANGE(Code,"Tax Group No."); IF RecTaxJurisdiction.FINDFIRST THEN BEGIN IF RecTaxJurisdiction."Tax Account (Sales)" <> '' THEN BEGIN RecAVASetUpAssistant."TAX Schedule ID" := 'Verified on '+ FORMAT(CURRENTDATETIME); RecAVASetUpAssistant."Mapped GL Accounts":= TRUE; RecAVASetUpAssistant."Mapped Tax Area Code" := TRUE; END ELSE BEGIN RecAVASetUpAssistant."TAX Schedule ID" := ''; RecAVASetUpAssistant."Mapped GL Accounts":= FALSE; RecAVASetUpAssistant."Mapped Tax Area Code" := FALSE; END ELSE RecAVASetUpAssistant."TAX Schedule ID" := ''; RecAVASetUpAssistant.MODIFY; Avalara Inc. All rights reserved. Page 108 of 215
109 Changes in optaxschidyes--> OnValidate Search for below 1 st line IF Initiate = Initiate::"0" THEN BEGIN NoAVAINITIATEOnValidate; //IF ISCLEAR (AVA_WshShell) THEN //CREATE (AVA_WshShell,FALSE,TRUE); //AVA_WshShell.SendKeys ('{F5}'); CurrPage.UPDATE; Changes in Disable Address Validation--> OnValidate Search for below 1 st line IF "Disable Address" THEN BEGIN IF NOT DIALOG.CONFIRM('Do you want to disable Address Validation?', TRUE) THEN "Disable Address":=FALSE; //IF ISCLEAR (AVA_WshShell) THEN //CREATE (AVA_WshShell,FALSE,TRUE); //AVA_WshShell.SendKeys ('{F5}'); CurrPage.UPDATE; AvaAddressEnableDisable; RecAVASetUpAssistant.RESET; IF RecAVASetUpAssistant.FINDFIRST THEN BEGIN IF "Disable Address" THEN RecAVASetUpAssistant."Address Validation" := '' ELSE RecAVASetUpAssistant."Address Validation" := 'Enabled on '+ FORMAT(CURRENTDATETIME); RecAVASetUpAssistant.MODIFY; Remove following Variables: Name DataType Subtype Length --Build Integer AVA_WshShell Automation Changes in Text valiable Name New value Old value Text (877) Avalara Inc. All rights reserved. Page 109 of 215
110 Page AVA Address Country List Add following Variables: Name DataType Subtype Length RecAvaConfig Record AVA CONFIG RecAVASetUpAssistant Record AVA Setup Assistant Change in Function MoveAddressBack: Search for below 1 st line RecAvaCountry.SETRANGE(RecAvaCountry.Code); AVAAddressCountry.DELETE; //AVANA START RecAvaConfig.FINDFIRST; RecAVASetupAssistant.RESET; IF RecAVASetupAssistant.FINDFIRST THEN BEGIN RecAVASetupAssistant."Address Validation" := 'Enabled on '+ FORMAT(CURRENTDATETIME); RecAVASetupAssistant.MODIFY; //AVANA END COMMIT; UNTIL AVAAddressCountry.NEXT = 0; Page AVA Country List Add following Variables: Name DataType Subtype Length RecAvaConfig Record AVA CONFIG RecAVASetUpAssistant Record AVA Setup Assistant Change in Function MoveToAddress: Search for below 1 st line AVACountry."Avalara Validate":=TRUE; AVACountry.MODIFY; //AVANA START RecAvaConfig.FINDFIRST; RecAVASetUpAssistant.RESET; IF RecAVASetUpAssistant.FINDFIRST THEN BEGIN RecAVASetUpAssistant."Address Validation" := 'Enabled on '+ FORMAT(CURRENTDATETIME); RecAVASetUpAssistant.MODIFY; //AVANA END UNTIL AVACountry.NEXT = 0; Avalara Inc. All rights reserved. Page 110 of 215
111 Page AVA SOP Utility Changes in function Sales Get Tax; Modified code marked in red color (Search for 1 st Line) DocType:= FnFilter; IF FIND('-') THEN BEGIN REPEAT //ReleaseSalesDoc.Reopen(Rec); //AVANA AvaValidCall.AvaSetDocNumTypeTable("No.","Document Type",1); IF AvaValidCall.AvaIsValidDocumentBatch(1) THEN BEGIN IF AvaValidCall.ReleaseBatchSales(Rec) THEN BEGIN Page AVA Reconciliation Change in Version List of objects: New Value : AVANA Change in function FnConnect New Value of otaxsvc.profile.client otaxsvc.profile.client:=avaconfig."connector Version"; Avalara Inc. All rights reserved. Page 111 of 215
112 Page AVA Item UPC MAP New page New code on UPC code - OnValidate() Avalara Inc. All rights reserved. Page 112 of 215
113 Changes in Avalara Menusuite Object MenuSuite 1060 Dept - Add-on Avalara AvaTax Add below marked Item in specified location Avalara Inc. All rights reserved. Page 113 of 215
114 Changes in AvalaraX CodeUnits Codeunit 12 Gen. Jnl.-Post Global variable Added Name DataType Subtype Length AvaSalesTaxAdjustFlag Boolean Change to trigger InsertVAT TaxDetail."Tax Type"::"Sales Tax Only"); TaxDetail.SETRANGE("Effective Date",0D,"Posting Date"); //IF NOT TaxDetail.FIND('+') THEN //Avalara IF NOT TaxDetail.FIND('+') OR AvaSalesTaxAdjustFlag THEN//Avalara EXIT; New Function Added AvaSetSalesTaxAdjust Local Parameter AvaSalesTaxAdjustFlag:=tSalesTaxAdjust; Avalara Inc. All rights reserved. Page 114 of 215
115 Codeunit 46 SelectionFilterManagement New Function Added GetSelectionFilterForAvaDocs Local Parameters Return Value Avalara Inc. All rights reserved. Page 115 of 215
116 Variables RecRef.GETTABLE(AvaHeader); EXIT(GetSelectionFilter(RecRef,AvaHeader.FIELDNO("No."))); Changes in GetSelectionFilter FieldRef := RecRef.FIELD(SelectionFieldID); //FirstRecRef := FieldRef.VALUE; //Avalara Start-- //LastRecRef := FirstRecRef; //Avalara Start-- FirstRecRef := FORMAT(FieldRef.VALUE); //Avalara Start-- LastRecRef := FORMAT(FirstRecRef); //Avalara Start-- More := TempRecRefCount > 0; WHILE More DO IF RecRef.NEXT = 0 THEN More := FALSE ELSE BEGIN SavePos := TempRecRef.GETPOSITION; TempRecRef.SETPOSITION(RecRef.GETPOSITION); IF NOT TempRecRef.FIND THEN BEGIN More := FALSE; TempRecRef.SETPOSITION(SavePos); END ELSE BEGIN FieldRef := RecRef.FIELD(SelectionFieldID); LastRecRef := FORMAT(FieldRef.VALUE); //Avalara Start-- TempRecRefCount := TempRecRefCount - 1; IF TempRecRefCount = 0 THEN Avalara Inc. All rights reserved. Page 116 of 215
117 More := FALSE; Codeunit 60 Sales-Calc. Discount Global variable Added Name DataType Subtype Length AvaValidCall Codeunit AVA Validate Call New function Added AvaCheckInstStatus Return Value Variables Avalara Inc. All rights reserved. Page 117 of 215
118 AvaInstall.RESET; IF (AvaInstall.FINDFIRST) AND (AvaInstall."Install Status" = 3)THEN EXIT(TRUE) ELSE EXIT(FALSE); Codeunit 80 Sales-Post Global Variable (removed all Connector Metric Loic related variables) Name DataType Subtype Length AvaValidCall Codeunit AVA Validate Call DocId Text PInvoice Boolean AvaTaxEngine Codeunit AVA Tax Engine Avaconfig Record AVA CONFIG AvaConfig 1 Record AVA CONFIG AvaTaxServiceFlag Boolean AvaBatchModeFlag Boolean AvaDocErrorMsgs Record AVA Document Error Messages AvaDocPostBuf Record AVA Document Post Status AvaRunCommitInv AvaRunCommitRtn Global Text Constant Added Name DataType Subtype TextSalesTaxAdjust TextConst SALESTAXADJUST Change to trigger OnRun Local Variable Added Name DataType Subtype Length AvaInstallStatusFlag Boolean IF PostingDateExists AND (ReplaceDocumentDate OR ("Document Date" = 0D)) THEN VALIDATE("Document Date",PostingDate); //Avalara - Start AvaInstallStatusFlag:=AvaCheckInstStatus(); IF AvaInstallStatusFlag THEN AvaTaxEngine.AVASaveBatchModeFlag(AvaBatchModeFlag,"No.","Document Type"); //Avalara End Avalara Inc. All rights reserved. Page 118 of 215
119 CLEARALL; SalesSetup.GET; CheckCustBlockage("Sell-to Customer No.",TRUE); IF "Bill-to Customer No." <> "Sell-to Customer No." THEN CheckCustBlockage("Bill-to Customer No.",TRUE); //Avalara Start AvaInstallStatusFlag:=AvaCheckInstStatus(); IF AvaInstallStatusFlag THEN AvaValidCall.AvaSetShowMessage(); IF AvaInstallStatusFlag THEN BEGIN AvaValidCall.AvaSetShowMessage(); AvaDocPostBuf.SETRANGE(AvaDocPostBuf."No.","No."); IF NOT AvaDocPostBuf.FINDFIRST THEN BEGIN AvaDocPostBuf.INIT; AvaDocPostBuf."No.":="No."; AvaDocPostBuf.Type:=FORMAT("Document Type"); AvaDocPostBuf.INSERT; AvaValidCall.SetPostingFlag(TRUE); AvaValidCall.AvaSetReleaseFlag(Status = Status::Released); //Avalara End IF Invoice THEN BEGIN //Avalara Start IF AvaInstallStatusFlag THEN IF Avaconfig.FINDFIRST THEN BEGIN Avaconfig.Invoice := FALSE; Avaconfig.MODIFY; //Avalara End SalesLine.RESET; SalesLine.SETRANGE("Document Type","Document Type"); SalesLine.SETRANGE("Document No.","No."); SalesLine.SETFILTER(Quantity,'<>0'); IF "Document Type" IN ["Document Type"::Order,"Document Type"::"Return Order"] THEN SalesLine.SETFILTER("Qty. to Invoice",'<>0'); //Avalara - Start IF SalesLine.FINDFIRST AND (SalesLine."No." = 'SALESTAXADJUST') AND (Avaconfig."Enable Tax Amt Adj." = FALSE) THEN ERROR('Posting Not allowed as "Sales Tax Adjustment" is not enabled on AvaTax Configuration'); //Avalara End Avalara Inc. All rights reserved. Page 119 of 215
120 Invoice := NOT SalesLine.ISEMPTY; IF Invoice AND (NOT Ship) AND ("Document Type" = "Document Type"::Order) THEN BEGIN SalesLine.FINDSET; //Avalara Start PInvoice := TRUE; IF AvaInstallStatusFlag THEN AvaTaxEngine.SetInvoiceFlag(PInvoice); //Avalara End Invoice := FALSE; REPEAT Invoice := SalesLine."Quantity Shipped" - SalesLine."Quantity Invoiced" <> 0; UNTIL Invoice OR (SalesLine.NEXT = 0); END ELSE IF Invoice AND (NOT Receive) AND ("Document Type" = "Document Type"::"Return Order") THEN BEGIN SalesLine.FINDSET; //Avalara Start PInvoice := TRUE; IF AvaInstallStatusFlag THEN AvaTaxEngine.SetInvoiceFlag(PInvoice); //Avalara End Invoice := FALSE; IF TaxOption = TaxOption::SalesTax THEN BEGIN //Avalara Start IF AvaInstallStatusFlag THEN IF NOT("Tax Area Code"='') AND ("AvaConfig 1".FINDFIRST) THEN AvaTaxServiceFlag:=(("AvaConfig 1".Services MOD 100)/10) >= 1 ELSE AvaTaxServiceFlag:=FALSE ELSE AvaTaxServiceFlag:=FALSE; IF(AvaTaxServiceFlag) AND ("Document Type" IN ["Document Type"::Order,"Document Type"::Invoice,"Document Type"::"Return Order","Document Type"::"Credit Memo"]) THEN BEGIN AvaValidCall.AvaSetDocNumTypeTable("No.","Document Type",1); AvaBlnAvaIsValidDocument := AvaValidCall.AvaIsValidDocument(2); //AVANA IF AvaBlnAvaIsValidDocument THEN BEGIN //AVANA AvaValidCall.OnReleasePost(Rec,TempSalesLineForSalesTax); AvaValidCall.OnPost(SalesHeader,TempSalesLineForSalesTax,DocId); IF AvaInstallStatusFlag AND AvaBlnAvaIsValidDocument THEN BEGIN //AVANA AvaValidCall.AvaFillTempAvaLines(); AvaValidCall.AvaSummarizeTaxLines(TempSalesTaxAmtLine,2); Avalara Inc. All rights reserved. Page 120 of 215
121 END ELSE BEGIN //Avalara End IF SalesTaxCountry <> SalesTaxCountry::NoTax THEN BEGIN // NA0003.begin // SalesTaxCalculate.EndSalesTaxCalculation("Posting Date"); // NA0003.end // NA0003.begin IF UseExternalTaxEngine THEN SalesTaxCalculate.CallExternalTaxEngineForSales(SalesHeader,FALSE) ELSE SalesTaxCalculate.EndSalesTaxCalculation("Posting Date"); // NA0003.end SalesTaxCalculate.GetSalesTaxAmountLineTable(TempSalesTaxAmtLine); SalesTaxCalculate.DistTaxOverSalesLines(TempSalesLineForSalesTax); //Avalara END ELSE BEGIN TempVATAmountLineRemainder.DELETEALL; InsertValueEntryRelation; //Avalara Start //AVANA IF AvaInstallStatusFlag THEN BEGIN IF NOT("Tax Area Code"='') AND ("AvaConfig 1".FINDFIRST) THEN AvaTaxServiceFlag:=(("AvaConfig 1".Services MOD 100)/10) >= 1 ELSE AvaTaxServiceFlag:=FALSE; IF Invoice = TRUE THEN IF ("AvaConfig 1".FINDFIRST) AND ((("AvaConfig 1".Services MOD 100)/10) >= 1) THEN IF "Document Type" IN ["Document Type"::Order,"Document Type"::Invoice] THEN BEGIN AvaValidCall.AvaSetDocNumTypeTable(SalesInvHeader."No.",2,2); IF AvaBlnAvaIsValidDocument THEN BEGIN //AVANA SalesInvHeader.CALCFIELDS(Amount,"Amount Including VAT"); IF NOT AvaValidCall.AvaPostInv(DocId,SalesInvHeader) THEN ERROR('AvaTax Posting Failed..') ELSE AvaRunCommitInv := TRUE; END ELSE IF "Document Type" IN ["Document Type"::"Return Order","Document Type"::"Credit Memo"] THEN BEGIN AvaValidCall.AvaSetDocNumTypeTable(SalesCrMemoHeader."No.",5,3); IF AvaBlnAvaIsValidDocument THEN BEGIN //AVANA SalesCrMemoHeader.CALCFIELDS(Amount,"Amount Including VAT"); IF NOT AvaValidCall.AvaPostRtn(DocId,SalesCrMemoHeader) THEN ERROR('AvaTax Posting Failed..') ELSE AvaRunCommitRtn := TRUE; Avalara Inc. All rights reserved. Page 121 of 215
122 //Avalara End IF NOT InvtPickPutaway THEN // Balancing account IF ("Bal. Account No." <> '') AND IsOnlinePayment(SalesHeader) AND Invoice THEN PostBalancing(TransactionLogEntryNo); //AVANA //Avalara Start IF NOT "AvaConfig 1"."Enable AsynchronousAvaTax Post" THEN BEGIN IF AvaRunCommitInv THEN AvaValidCall.AvaCommitInv(DocId,SalesInvHeader); IF AvaRunCommitRtn THEN AvaValidCall.AvaCommitRtn(DocId,SalesCrMemoHeader); AvaDocPostBuf.RESET; AvaDocPostBuf.SETFILTER(AvaDocPostBuf."No.","No."); AvaDocPostBuf.SETFILTER(AvaDocPostBuf.Type,FORMAT("Document Type")); IF AvaDocPostBuf.FINDFIRST THEN AvaDocPostBuf.DELETEALL; //Avalara End Change to trigger PostItemJnlLine ItemJnlLine.Amount := ROUND(ItemJnlLine.Amount); //Avalara Start IF AvaCheckInstStatus THEN BEGIN IF Avaconfig.FINDFIRST THEN; IF (Avaconfig."Enable Tax Amt Adj.") AND (ItemJnlLine."Item No."=TextSalesTaxAdjust) THEN ItemJnlLine.Amount :=-(SalesLine."Amount Including VAT"); //Avalara End ItemJnlLine."Source Type" := ItemJnlLine."Source Type"::Customer; Change to trigger FillInvPostingBuffer InvPostingBuffer[1].PrepareSales(SalesLine); //Avalara Start IF AvaCheckInstStatus THEN BEGIN IF Avaconfig.FINDFIRST THEN; IF (Avaconfig."Enable Tax Amt Adj.") AND (SalesLine."No."= TextSalesTaxAdjust) THEN BEGIN TotalAmount := SalesLine."Amount Including VAT" - SalesLine.Amount; Avalara Inc. All rights reserved. Page 122 of 215
123 TotalAmountACY := SalesLineACY."Amount Including VAT" - SalesLineACY.Amount; TotalVAT := SalesLine.Amount; TotalVATACY := SalesLineACY.Amount; END ELSE BEGIN //Avalara End TotalVAT := SalesLine."Amount Including VAT" - SalesLine.Amount; TotalVATACY := SalesLineACY."Amount Including VAT" - SalesLineACY.Amount; TotalAmount := SalesLine.Amount; TotalAmountACY := SalesLineACY.Amount; //Avalara Start END ELSE BEGIN TotalVAT := SalesLine."Amount Including VAT" - SalesLine.Amount; TotalVATACY := SalesLineACY."Amount Including VAT" - SalesLineACY.Amount; TotalAmount := SalesLine.Amount; TotalAmountACY := SalesLineACY.Amount; //Avalara End IF SalesSetup."Discount Posting" IN Change to trigger SumSalesLines2 DivideAmount(QtyType,SalesLineQty); //Avalara Start IF AvaCheckInstStatus THEN BEGIN IF Avaconfig.FINDFIRST THEN; IF (Avaconfig."Enable Tax Amt Adj.") AND (SalesLine."No."=TextSalesTaxAdjust) THEN BEGIN SalesLine.Amount:=0; IF SalesLine."Line Amount"<>0 THEN SalesLine."Amount Including VAT":=SalesLine."Line Amount"; SalesLine."Line Amount":=0; SalesLine."VAT %":=0; SalesLine."VAT Base Amount":=0; //Avalara End SalesLine.Quantity := SalesLineQty; Change to trigger PostSalesTaxToGL Local Variable Added Name DataType Subtype Length Avalara Inc. All rights reserved. Page 123 of 215
124 AvaSalesTaxAdjustFlag Boolean TotalSalesLineLCY."Amount Including VAT" := TotalSalesLineLCY.Amount; //Avalara Start AvaSalesTaxAdjustFlag:=FALSE; IF AvaCheckInstStatus THEN BEGIN IF Avaconfig.FINDFIRST THEN AvaSalesTaxAdjustFlag:=(SalesLine."Document Type"=SalesLine."Document Type"::"Credit Memo") AND (Avaconfig."Enable Tax Amt Adj.") AND (SalesLine."No."=TextSalesTaxAdjust); GenJnlPostLine.AvaSetSalesTaxAdjust(AvaSalesTaxAdjustFlag); //Avalara End IF TempSalesTaxAmtLine.FIND('-') THEN IF ((TempSalesTaxAmtLine."Tax Base Amount" <> 0) AND (TempSalesTaxAmtLine."Tax Type" = TempSalesTaxAmtLine."Tax Type"::"Sales and Use Tax")) OR ((TempSalesTaxAmtLine.Quantity <> 0) AND (TempSalesTaxAmtLine."Tax Type" = TempSalesTaxAmtLine."Tax Type"::"Excise Tax")) OR ((AvaSalesTaxAdjustFlag) AND (SalesLine."No."=TextSalesTaxAdjust))//Avalara THEN BEGIN GenJnlLine.INIT; GenJnlLine."VAT Base Amount (LCY)" := //ROUND(TempSalesTaxAmtLine."Tax Base Amount"); //Avalara CurrExchRate.ExchangeAmtFCYToLCY(UseDate,SalesHeader."Currency Code",TempSalesTaxAmtLine."Tax Base Amount",SalesHeader."Currency Factor"); //Avalara GenJnlLine."VAT Base Amount" := GenJnlLine."VAT Base Amount (LCY)"; RemSalesTaxSrcAmt := RemSalesTaxSrcAmt - GenJnlLine."Source Curr. VAT Amount"; //RemSalesTaxAmt := RemSalesTaxAmt + TempSalesTaxAmtLine."Tax Amount"; //Avalara++-- RemSalesTaxAmt := RemSalesTaxAmt + CurrExchRate.ExchangeAmtFCYToLCY(UseDate,SalesHeader."Currency Code",TempSalesTaxAmtLine."Tax Amount",SalesHeader."Currency Factor"); //Avalara++-- GenJnlLine."VAT Amount (LCY)" := SalesTaxCalculate.ArithmeticRound(RemSalesTaxAmt,GLSetup."Amount Rounding Precision"); Avalara Inc. All rights reserved. Page 124 of 215
125 New Function Added AvaSetBatchModeFlag Parameters AvaBatchModeFlag:=tBatchModeFlag; New Function Added AvaCheckInstStatus Return Value Variable Avalara Inc. All rights reserved. Page 125 of 215
126 AvaInstall.RESET; IF (AvaInstall.FINDFIRST) AND (AvaInstall."Install Status" = 3)THEN EXIT(TRUE) ELSE EXIT(FALSE); Codeunit 398 Sales Tax Calculate Global Variable Added Name DataType Subtype Length AvaValidCall Codeunit AVA Validate Call AvaTaxPer Decimal AvaTaxAmt Decimal AvaConfig Record AVA CONFIG AvaInstallStatusFlag Boolean Global Text Constant Added Name DataType Subtype TextSalesTaxAdjust TextConst SALESTAXADJUST Change to trigger AddSalesLine SalesLine.TESTFIELD("Tax Group Code"); //Avalara Start AvaInstallStatusFlag:=AvaCheckInstStatus(); IF AvaInstallStatusFlag THEN Avalara Inc. All rights reserved. Page 126 of 215
127 AvaValidCall.AvaSetDocNumTypeTable(SalesHeader."No.",SalesHeader."Document Type",1); //Avalara End WITH TempSalesTaxLine DO BEGIN Change to trigger AddServiceLine IF NOT GetSalesTaxCountry(ServiceLine."Tax Area Code") THEN EXIT; //Avalara End AvaInstallStatusFlag:=AvaCheckInstStatus(); IF AvaInstallStatusFlag THEN AvaValidCall.AvaServiceSetDocNumTypeTable(ServiceHeader."No.",ServiceHeader."Document Type",1); //Avalara Start ServiceLine.TESTFIELD("Tax Group Code"); Change to trigger DistTaxOverSalesLines // NA0012.begin // IF "Tax Type" = "Tax Type"::"Sales Tax" THEN BEGIN IF "Tax Type" = "Tax Type"::"Sales and Use Tax" THEN BEGIN // NA0012.end //Avalara Start IF AvaCheckInstStatus THEN BEGIN AvaConfig.FINDFIRST; IF (AvaConfig."Enable Tax Amt Adj.") AND (SalesLine."No."=TextSalesTaxAdjust) THEN BEGIN Amount := 0; TaxAmount := SalesLine."Line Amount"; END ELSE BEGIN //Avalara End Amount := (SalesLine."Line Amount" - SalesLine."Inv. Discount Amount"); IF "Tax Difference" <> 0 THEN TaxAmount := "Tax Amount" ELSE TaxAmount := Amount * "Tax %" / 100; END END ELSE BEGIN //Avalara Start Amount := (SalesLine."Line Amount" - SalesLine."Inv. Discount Amount"); IF "Tax Difference" <> 0 THEN TaxAmount := "Tax Amount" ELSE TaxAmount := Amount * "Tax %" / 100; END//Avalara End END ELSE BEGIN IF (SalesLine."Quantity (Base)" = 0) OR (Quantity = 0) THEN TaxAmount := 0 ELSE Avalara Inc. All rights reserved. Page 127 of 215
128 TaxAmount := "Tax Amount" * ExchangeFactor * SalesLine."Quantity (Base)" / Quantity; IF TaxAmount = 0 THEN ReturnTaxAmount := 0 ELSE BEGIN ReturnTaxAmount := ArithmeticRound(TaxAmount + TotalTaxAmountRounding,Currency."Amount Rounding Precision"); TotalTaxAmountRounding := TaxAmount + TotalTaxAmountRounding - ReturnTaxAmount; //Avalara Start IF AvaCheckInstStatus THEN BEGIN AvaConfig.FINDFIRST; IF (AvaConfig."Enable Tax Amt Adj.") AND (SalesLine."No."=TextSalesTaxAdjust) THEN BEGIN SalesLine.Amount :=0; SalesLine."Line Amount":=0; END ELSE SalesLine.Amount := SalesLine."Line Amount" - SalesLine."Inv. Discount Amount"; END ELSE //Avalara End SalesLine.Amount := SalesLine."Line Amount" - SalesLine."Inv. Discount Amount"; SalesLine."VAT Base Amount" := SalesLine.Amount; IF SalesLine2.GET(SalesLine."Document Type",SalesLine."Document No.",SalesLine."Line No.") THEN BEGIN SalesLine2."Amount Including VAT" := SalesLine2."Amount Including VAT" + ReturnTaxAmount; SalesLine2.MODIFY; END ELSE BEGIN SalesLine2.COPY(SalesLine); SalesLine2."Amount Including VAT" := SalesLine.Amount + ReturnTaxAmount; SalesLine2.INSERT; IF SalesLine."Tax Liable" THEN SalesLine."Amount Including VAT" := SalesLine2."Amount Including VAT" ELSE SalesLine."Amount Including VAT" := SalesLine.Amount; IF (NOT AvaConfig.FINDFIRST) OR (SalesLine."Tax Area Code" <> AvaConfig."Tax Group No.") THEN BEGIN //AVANA IF SalesLine.Amount <> 0 THEN SalesLine."VAT %" := ROUND(100 * ( SalesLine."Amount Including VAT" - SalesLine.Amount) / SalesLine.Amount, ) ELSE SalesLine."VAT %" := 0; //AVANA SalesLine.MODIFY; UNTIL SalesLine.NEXT = 0; UNTIL NEXT = 0; SalesLine.SETRANGE("Tax Area Code"); Avalara Inc. All rights reserved. Page 128 of 215
129 Change to trigger DistTaxOverServLines // NA0012.begin // IF "Tax Type" = "Tax Type"::"Sales Tax" THEN BEGIN IF "Tax Type" = "Tax Type"::"Sales and Use Tax" THEN BEGIN //Avalara Start IF AvaCheckInstStatus THEN BEGIN AvaConfig.FINDFIRST; IF (AvaConfig."Enable Tax Amt Adj.") AND (ServLine."No."=TextSalesTaxAdjust) THEN BEGIN Amount := 0; TaxAmount := ServLine."Line Amount"; END ELSE BEGIN //Avalara End Amount := (ServLine."Line Amount" - ServLine."Inv. Discount Amount"); TaxAmount := Amount * "Tax %" / 100; //Avalara Start END END ELSE BEGIN Amount := (ServLine."Line Amount" - ServLine."Inv. Discount Amount"); TaxAmount := Amount * "Tax %" / 100; END //Avalara End END ELSE BEGIN IF (ServLine."Quantity (Base)" = 0) OR (Quantity = 0) THEN TaxAmount := 0 ELSE TaxAmount := "Tax Amount" * ExchangeFactor * ServLine."Quantity (Base)" / Quantity; IF TaxAmount = 0 THEN ReturnTaxAmount := 0 ELSE BEGIN ReturnTaxAmount := ArithmeticRound(TaxAmount + TotalTaxAmountRounding,Currency."Amount Rounding Precision"); TotalTaxAmountRounding := TaxAmount + TotalTaxAmountRounding - ReturnTaxAmount; //Avalara Start IF AvaCheckInstStatus THEN BEGIN AvaConfig.FINDFIRST; IF (AvaConfig."Enable Tax Amt Adj.") AND (ServLine."No."=TextSalesTaxAdjust) THEN BEGIN ServLine.Amount :=0; ServLine."Line Amount":=0; END ELSE ServLine.Amount := ServLine."Line Amount" - ServLine."Inv. Discount Amount"; END ELSE //Avalara End ServLine.Amount := ServLine."Line Amount" - ServLine."Inv. Discount Amount"; ServLine."VAT Base Amount" := ServLine.Amount; Avalara Inc. All rights reserved. Page 129 of 215
130 New Function Added UpdateAvaTaxVal Parameters AvaTaxPer := InpAvaTax; AvaTaxAmt := InpAvaTaxAmt; New Function Added AvaCheckInstStatus Return Value Avalara Inc. All rights reserved. Page 130 of 215
131 Variables AvaInstall.RESET; IF (AvaInstall.FINDFIRST) AND (AvaInstall."Install Status" = 3)THEN EXIT(TRUE) ELSE EXIT(FALSE); Avalara Inc. All rights reserved. Page 131 of 215
132 Codeunit 414 Release Sales Document Global variable Added Name DataType Subtype Length AvaValidCall Codeunit AVA Validate Call AvaConfig Record AVA CONFIG AvaTaxServiceFlag Boolean lavadocpostbuf Record AVA Document Post Status Change to trigger OnRun ReleaseATOs(Rec); //Avalara Start lavadocpostbuf.reset; lavadocpostbuf.setfilter("no.","no."); lavadocpostbuf.setfilter(type,format("document Type")); IF lavadocpostbuf.findfirst THEN AvaValidCall.SetPostingFlag(TRUE); IF NOT AvaValidCall.OnRelease(Rec,SalesLine) THEN SalesLine.CalcSalesTaxLines(Rec,SalesLine); //Avalara End MODIFY(TRUE); Avalara Inc. All rights reserved. Page 132 of 215
133 Codeunit 442 Sales-Post Prepayments Changes in function FillInvLineBuffer Modified Code (Search for 1 st line / modified code marked in Rec color) WITH PrepmtInvBuf DO BEGIN CLEAR(PrepmtInvBuf); FillInvLineBufKey(SalesLine,PrepmtInvBuf); IF NOT SalesHeader."Compress Prepayment" THEN BEGIN "Line No." := SalesLine."Line No."; Description := SalesLine.Description; FillFromGLAcc(SalesHeader."Compress Prepayment"); "Gen. Bus. Posting Group" := SalesLine."Gen. Bus. Posting Group"; "VAT Bus. Posting Group" := SalesLine."VAT Bus. Posting Group"; "VAT Calculation Type" := SalesLine."Prepmt. VAT Calc. Type"; "Global Dimension 1 Code" := SalesLine."Shortcut Dimension 1 Code"; "Global Dimension 2 Code" := SalesLine."Shortcut Dimension 2 Code"; Amount := SalesLine."Prepayment Amount"; "Amount Incl. VAT" := SalesLine."Prepmt. Amt. Incl. VAT"; "VAT Base Amount" := SalesLine."Prepayment Amount"; "VAT Amount" := SalesLine."Prepmt. Amt. Incl. VAT" - SalesLine."Prepayment Amount"; "Amount (ACY)" := SalesLine."Prepayment Amount"; "VAT Base Amount (ACY)" := SalesLine."Prepayment Amount"; "VAT Amount (ACY)" := SalesLine."Prepmt. Amt. Incl. VAT" - SalesLine."Prepayment Amount"; //AVANA Start //"VAT %" := SalesLine."Prepayment VAT %"; IF AVAValidTrans(SalesLine."Tax Area Code") THEN "VAT %" := SalesLine."Prepayment VAT %" ELSE "VAT %" := SalesLine."VAT %"; //AVANA end "VAT Identifier" := SalesLine."Prepayment VAT Identifier"; "VAT Difference" := SalesLine."Prepayment VAT Difference"; Changes in function UpdateVATOnLines Modified Code (Search for 1 st line / modified code marked in Rec color) IF SalesHeader."Prices Including VAT" THEN BEGIN IF PrepmtAmt = 0 THEN BEGIN IF AVAValidTrans(SalesHeader."Tax Area Code") THEN //AVANA VATAmount := 0; NewAmountIncludingVAT := 0; END ELSE BEGIN VATAmount := TempVATAmountLineRemainder."VAT Amount" + VATAmountLine."VAT Amount" * PrepmtAmt / VATAmountLine."Line Amount"; NewAmountIncludingVAT := TempVATAmountLineRemainder."Amount Including VAT" + VATAmountLine."Amount Including VAT" * PrepmtAmt / VATAmountLine."Line Amount"; NewAmount := ROUND(NewAmountIncludingVAT,Currency."Amount Rounding Precision") - ROUND(VATAmount,Currency."Amount Rounding Precision"); NewVATBaseAmount := ROUND( Avalara Inc. All rights reserved. Page 133 of 215
134 NewAmount * (1 - SalesHeader."VAT Base Discount %" / 100), Currency."Amount Rounding Precision"); END ELSE BEGIN NewAmount := PrepmtAmt; NewVATBaseAmount := ROUND( NewAmount * (1 - SalesHeader."VAT Base Discount %" / 100), Currency."Amount Rounding Precision"); IF AVAValidTrans(SalesHeader."Tax Area Code") THEN //AVANA IF VATAmountLine."VAT Base" = 0 THEN VATAmount := 0 ELSE VATAmount := TempVATAmountLineRemainder."VAT Amount" + VATAmountLine."VAT Amount" * NewAmount / VATAmountLine."VAT Base"; NewAmountIncludingVAT := NewAmount + ROUND(VATAmount,Currency."Amount Rounding Precision"); "Prepayment Amount" := NewAmount; Changes in function CalcVATAmountLines Modified Code (Search for 1 st line / modified code marked in Rec color) IF SalesHeader."Currency Code" = '' THEN Currency.InitRoundingPrecision ELSE Currency.GET(SalesHeader."Currency Code"); VATAmountLine.DELETEALL; WITH SalesLine DO BEGIN ApplyFilter(SalesHeader,DocumentType,SalesLine); IF FIND('-') THEN REPEAT NewAmount := PrepmtAmount(SalesLine,DocumentType); IF NewAmount <> 0 THEN BEGIN IF DocumentType = DocumentType::Invoice THEN NewAmount := "Prepmt. Line Amount"; IF "Prepmt. VAT Calc. Type" IN ["VAT Calculation Type"::"Reverse Charge VAT","VAT Calculation Type"::"Sales Tax"] THEN IF AVAValidTrans(SalesLine."Tax Area Code") THEN //AVANA "VAT %" := 0; IF NOT VATAmountLine.GET( "Prepayment VAT Identifier", "Prepmt. VAT Calc. Type","Prepayment Tax Group Code", FALSE,NewAmount >= 0) THEN BEGIN VATAmountLine.INIT; Changes in function UpdateSalesTaxOnLines Modified Code (Search for 1 st line / modified code marked in Rec color) //NA0001.begin WITH SalesLine DO BEGIN IF FINDSET THEN Avalara Inc. All rights reserved. Page 134 of 215
135 REPEAT IF IncludeTax THEN BEGIN "Prepmt. Line Amount" := ROUND("Line Amount" * "Prepayment %" / 100,Currency."Amount Rounding Precision"); "Prepayment Amount" := ROUND("Prepmt. Line Amount" + ("Amount Including VAT" - "Line Amount") * "Prepayment %" / 100, Currency."Amount Rounding Precision"); END ELSE "Prepayment Amount" := PrepmtAmount(SalesLine,DocumentType); "Prepmt. Amt. Incl. VAT" := "Prepayment Amount"; "Prepayment VAT %" := 0; IF AVAValidTrans("Tax Area Code") THEN //AVANA MODIFY; UNTIL NEXT = 0; //NA0001.end Add new function AVAValidTrans Local Parameter TaxAreaCode : Code[20] Return parameter AvaResultBln : Boolean; Local variables AvaUserPref : Record ; AvaConfig : Record ; Code //AVANA Start AvaUserPref.RESET; AvaUserPref.SETRANGE("User Pref Name",USERID); IF AvaUserPref.FINDFIRST THEN AvaResultBln := (NOT AvaConfig.FINDFIRST) OR (TaxAreaCode <> AvaConfig."Tax Group No.") OR AvaConfig."Disable Tax Calc." OR AvaUserPref.Disable ELSE AvaResultBln := (NOT AvaConfig.FINDFIRST) OR (TaxAreaCode <> AvaConfig."Tax Group No.") OR AvaConfig."Disable Tax Calc."; //AVANA End Avalara Inc. All rights reserved. Page 135 of 215
136 Codeunit 5980 Service-Post Global Varaible Added Name DataType Subtype Length AvaConfig Record AVA CONFIG Change to trigger PostWithLines Finalize(ServiceHeader); ServDocumentsMgt.AvaServPostCommitFinal;//Avalara PassedServHeader := ServiceHeader; ServDocumentsMgt.AvaUpdateTaxPostStatus(ServiceHeader."Last Posting No.");//Avalara Codeunit 5986 Serv-Amounts Mgt. Global Variable Added Name DataType Subtype Value AvaConfig Record AVA CONFIG Global Text Constant Added Name DataType Subtype TextSalesTaxAdjust TextConst SALESTAXADJUST Change to trigger FillInvPostingBuffer InvPostingBuffer[1].PrepareService(ServiceLine); //Avalara Start IF AvaCheckInstStatus THEN BEGIN AvaConfig.FINDFIRST; IF (AvaConfig."Enable Tax Amt Adj.") AND (ServiceLine."No."= TextSalesTaxAdjust) THEN BEGIN TotalAmount := ServiceLine."Amount Including VAT" - ServiceLine.Amount; TotalAmountACY := ServiceLineACY."Amount Including VAT" - ServiceLineACY.Amount; TotalVAT := ServiceLine.Amount; TotalVATACY := ServiceLineACY.Amount; END ELSE BEGIN //Avalara End TotalVAT := ServiceLine."Amount Including VAT" - ServiceLine.Amount; TotalVATACY := ServiceLineACY."Amount Including VAT" - ServiceLineACY.Amount; TotalAmount := ServiceLine.Amount; Avalara Inc. All rights reserved. Page 136 of 215
137 TotalAmountACY := ServiceLineACY.Amount; //Avalara Start END ELSE BEGIN TotalVAT := ServiceLine."Amount Including VAT" - ServiceLine.Amount; TotalVATACY := ServiceLineACY."Amount Including VAT" - ServiceLineACY.Amount; TotalAmount := ServiceLine.Amount; TotalAmountACY := ServiceLineACY.Amount; //Avalara End IF SalesSetup."Discount Posting" IN Change to trigger SumServiceLines2 TempVATAmountLineRemainder,TempServiceLineForSalesTax); //Avalara Start IF AvaCheckInstStatus THEN BEGIN AvaConfig.FINDFIRST; IF (AvaConfig."Enable Tax Amt Adj.") AND (ServLine."No."=TextSalesTaxAdjust) THEN BEGIN ServLine.Amount:=0; IF ServLine."Line Amount"<>0 THEN ServLine."Amount Including VAT":=ServLine."Line Amount"; ServLine."Line Amount":=0; ServLine."VAT %":=0; ServLine."VAT Base Amount":=0; //Avalara End ServLine.Quantity := ServLineQty; New Fucntion Added AvaCheckInstStatus Return Value Avalara Inc. All rights reserved. Page 137 of 215
138 Variables AvaInstall.RESET; IF (AvaInstall.FINDFIRST) AND (AvaInstall."Install Status" = 3)THEN EXIT(TRUE) ELSE EXIT(FALSE); Codeunit 5987 Serv-Posting Journals Mgt. Avalara Inc. All rights reserved. Page 138 of 215
139 Global Variable Added Name DataType Subtype Value AvaConfig Record AVA CONFIG Global Text Constant Added Name DataType Subtype TextSalesTaxAdjust TextConst SALESTAXADJUST Change to trigger PostItemJnlLine ItemJnlLine.Amount := ROUND(ItemJnlLine.Amount); //Avalara Start IF AvaCheckInstStatus THEN BEGIN AvaConfig.RESET; IF (AvaConfig."Enable Tax Amt Adj.") AND (ItemJnlLine."Item No."=TextSalesTaxAdjust) THEN ItemJnlLine.Amount:=-(ServiceLine."Amount Including VAT"); //Avalara End ItemJnlLine."Source Type" := ItemJnlLine."Source Type"::Customer; Change to trigger PostSalesTaxToGL Local Variable Added Name DataType Subtype Length LServiceLine Record Service Line AvaSalesTaxAdjustFlag Boolean RemSalesTaxSrcAmt := 0; IF ServiceHeader."Currency Code" <> '' THEN BEGIN //Avalara TotalServiceLineLCY."Amount Including VAT" := TotalServiceLineLCY.Amount; //Avalara - Start IF (ServiceHeader."Document Type" IN [ServiceHeader."Document Type"::Quote]) AND (ServiceHeader."Posting Date" = 0D) THEN UseDate := WORKDATE ELSE UseDate := ServiceHeader."Posting Date"; IF AvaCheckInstStatus THEN BEGIN AvaConfig.RESET; AvaConfig.FINDFIRST; AvaSalesTaxAdjustFlag:=AvaConfig."Enable Tax Amt Adj."; LServiceLine.RESET; LServiceLine.SETRANGE(LServiceLine."Document No.",ServiceHeader."No."); LServiceLine.SETRANGE(LServiceLine."Customer No.",ServiceHeader."Customer No."); LServiceLine.FINDFIRST; GenJnlPostLine.AvaSetSalesTaxAdjust(FALSE); //Avalara End Avalara Inc. All rights reserved. Page 139 of 215
140 IF TempSalesTaxAmtLine.FIND('-') THEN REPEAT TaxLineCount := TaxLineCount + 1; IF ((TempSalesTaxAmtLine."Tax Base Amount" <> 0) AND (TempSalesTaxAmtLine."Tax Type" = TempSalesTaxAmtLine."Tax Type"::"Sales and Use Tax")) OR ((TempSalesTaxAmtLine.Quantity <> 0) AND (TempSalesTaxAmtLine."Tax Type" = TempSalesTaxAmtLine."Tax Type"::"Excise Tax")) OR ((AvaSalesTaxAdjustFlag) AND (LServiceLine."No."=TextSalesTaxAdjust)) //Avalara THEN BEGIN GenJnlLine.INIT; GenJnlLine."Posting Date" := ServiceHeader."Posting Date"; GenJnlLine."Document Date" := ServiceHeader."Document Date"; GenJnlLine.Description := ServiceHeader."Posting Description"; GenJnlLine."Reason Code" := ServiceHeader."Reason Code"; GenJnlLine."Document Type" := GenJnlLineDocType; GenJnlLine."Document No." := GenJnlLineDocNo; GenJnlLine."External Document No." := GenJnlLineExtDocNo; GenJnlLine."System-Created Entry" := TRUE; GenJnlLine.Amount := 0; GenJnlLine."Source Currency Code" := ServiceHeader."Currency Code"; GenJnlLine."Source Currency Amount" := 0; GenJnlLine.Correction := ServiceHeader.Correction; GenJnlLine."Gen. Posting Type" := GenJnlLine."Gen. Posting Type"::Sale; GenJnlLine."Tax Area Code" := TempSalesTaxAmtLine."Tax Area Code"; GenJnlLine."Tax Type" := TempSalesTaxAmtLine."Tax Type"; GenJnlLine."Tax Exemption No." := ServiceHeader."Tax Exemption No."; GenJnlLine."Tax Group Code" := TempSalesTaxAmtLine."Tax Group Code"; GenJnlLine."Tax Liable" := TempSalesTaxAmtLine."Tax Liable"; GenJnlLine.Quantity := TempSalesTaxAmtLine.Quantity; GenJnlLine."VAT Calculation Type" := GenJnlLine."VAT Calculation Type"::"Sales Tax"; GenJnlLine."VAT Posting" := GenJnlLine."VAT Posting"::"Manual VAT Entry"; GenJnlLine."Shortcut Dimension 1 Code" := ServiceHeader."Shortcut Dimension 1 Code"; GenJnlLine."Shortcut Dimension 2 Code" := ServiceHeader."Shortcut Dimension 2 Code"; GenJnlLine."Dimension Set ID" := ServiceHeader."Dimension Set ID"; GenJnlLine."Source Code" := SrcCode; GenJnlLine."EU 3-Party Trade" := ServiceHeader."EU 3-Party Trade"; GenJnlLine."Bill-to/Pay-to No." := ServiceHeader."Bill-to Customer No."; GenJnlLine."Source Type" := GenJnlLine."Source Type"::Customer; GenJnlLine."Source No." := ServiceHeader."Bill-to Customer No."; GenJnlLine."Posting No. Series" := ServiceHeader."Posting No. Series"; GenJnlLine."STE Transaction ID" := ServiceHeader."STE Transaction ID"; GenJnlLine."Source Curr. VAT Base Amount" := TempSalesTaxAmtLine."Tax Base Amount"; GenJnlLine."VAT Base Amount (LCY)" := ROUND(TempSalesTaxAmtLine."Tax Base Amount"); //Avalara CurrExchRate.ExchangeAmtFCYToLCY( UseDate,ServiceHeader."Currency Code",TempSalesTaxAmtLine."Tax Base Amount",ServiceHeader."Currency Factor"); //Avalara GenJnlLine."VAT Base Amount" := GenJnlLine."VAT Base Amount (LCY)"; IF TaxJurisdiction.Code <> TempSalesTaxAmtLine."Tax Jurisdiction Code" THEN BEGIN TaxJurisdiction.GET(TempSalesTaxAmtLine."Tax Jurisdiction Code"); IF SalesTaxCountry = SalesTaxCountry::CA THEN BEGIN RemSalesTaxAmt := 0; RemSalesTaxSrcAmt := 0; IF ServiceHeader."Currency Code" <> '' THEN BEGIN IF (ServiceHeader."Document Type" IN [ServiceHeader."Document Type"::Quote]) AND (ServiceHeader."Posting Date" = 0D) THEN UseDate := WORKDATE ELSE UseDate := ServiceHeader."Posting Date"; IF TaxJurisdiction."Unrealized VAT Type" > 0 THEN BEGIN TaxJurisdiction.TESTFIELD("Unreal. Tax Acc. (Sales)"); Avalara Inc. All rights reserved. Page 140 of 215
141 GenJnlLine."Account No." := TaxJurisdiction."Unreal. Tax Acc. (Sales)"; END ELSE BEGIN TaxJurisdiction.TESTFIELD("Tax Account (Sales)"); GenJnlLine."Account No." := TaxJurisdiction."Tax Account (Sales)"; GenJnlLine."Tax Jurisdiction Code" := TempSalesTaxAmtLine."Tax Jurisdiction Code"; IF TempSalesTaxAmtLine."Tax Amount" <> 0 THEN BEGIN RemSalesTaxSrcAmt := RemSalesTaxSrcAmt + CurrExchRate.ExchangeAmtLCYToFCY( UseDate,ServiceHeader."Currency Code",TempSalesTaxAmtLine."Tax Amount",ServiceHeader."Currency Factor"); GenJnlLine."Source Curr. VAT Amount" := SalesTaxCalculate.ArithmeticRound(RemSalesTaxSrcAmt,Currency."Amount Rounding Precision"); RemSalesTaxSrcAmt := RemSalesTaxSrcAmt - GenJnlLine."Source Curr. VAT Amount"; //RemSalesTaxAmt := RemSalesTaxAmt + TempSalesTaxAmtLine."Tax Amount"; //Avalara RemSalesTaxAmt := RemSalesTaxAmt + CurrExchRate.ExchangeAmtFCYToLCY( UseDate,ServiceHeader."Currency Code",TempSalesTaxAmtLine."Tax Amount",ServiceHeader."Currency Factor"); //Avalara GenJnlLine."VAT Amount (LCY)" := SalesTaxCalculate.ArithmeticRound(RemSalesTaxAmt,GLSetup."Amount Rounding Precision"); RemSalesTaxAmt := RemSalesTaxAmt - GenJnlLine."VAT Amount (LCY)"; GenJnlLine."VAT Amount" := GenJnlLine."VAT Amount (LCY)"; GenJnlLine."VAT Difference" := TempSalesTaxAmtLine."Tax Difference"; IF NOT TotalServiceLineLCY."Amount Including VAT" + GenJnlLine."VAT Amount (LCY)"; GenJnlPostLine.AvaSetSalesTaxAdjust((AvaSalesTaxAdjustFlag) AND (LServiceLine."No."=TextSalesTaxAdjust));//Avalara GenJnlPostLine.RunWithCheck(GenJnlLine); Avalara Inc. All rights reserved. Page 141 of 215
142 New Function Added AvaCheckInstStatus Return Value Variables AvaInstall.RESET; IF (AvaInstall.FINDFIRST) AND (AvaInstall."Install Status" = 3)THEN EXIT(TRUE) ELSE EXIT(FALSE); Avalara Inc. All rights reserved. Page 142 of 215
143 Codeunit 5988 Serv-Documents Mgt. Global Variable Added Name DataType Subtype Length AvaValidCall Codeunit AVA Validate Call DocId Text Pinvoice Boolean AvaTaxEngine Codeunit AVA Tax Engine AvaConfig Record AVA CONFIG AvaConfig 1 Record AVA CONFIG AvaTaxServiceFlag Boolean TempServInvHeader Record Service Invoice Header TempServInvLine Record Service Invoice Line TempServCRMemoHeader Record Service Cr.Memo Header TempServCRMemoLine Record Service Cr.Memo Line AvaInstall Record AVA Install AvaDocPostBuf Record AVA Document Post Status AvaBlnAvaIsValidDocument Boolean Change to trigger PostDocumentLines Local Variable Added Name DataType Subtype Length AvaInstallStatusFlag Boolean ServLine.SETRANGE("Qty. to Invoice"); //Avalara Start AvaInstall.RESET; AvaInstallStatusFlag:=(AvaInstall.FIND('-') AND (AvaInstall."Install Status"=3)); IF AvaInstallStatusFlag THEN BEGIN AvaValidCall.AvaSetShowMessage(); AvaDocPostBuf.SETRANGE(AvaDocPostBuf."No.","No."); IF NOT AvaDocPostBuf.FINDFIRST THEN BEGIN AvaDocPostBuf.INIT; AvaDocPostBuf."No.":=ServHeader."No."; AvaDocPostBuf.Type:=FORMAT(ServHeader."Document Type"); AvaDocPostBuf.INSERT; AvaValidCall.SetPostingFlag(TRUE); //Avalara End IF TaxOption = TaxOption::SalesTax THEN BEGIN //Avalara - Start Avalara Inc. All rights reserved. Page 143 of 215
144 IF (AvaInstallStatusFlag) AND ("AvaConfig 1".FINDFIRST) THEN AvaTaxServiceFlag:=(("AvaConfig 1".Services MOD 100)/10) >= 1; IF (AvaInstallStatusFlag) AND (AvaTaxServiceFlag) AND ("AvaConfig 1"."Enable Serv. Modu. Integrtn") AND ("Document Type" IN ["Document Type"::Order,"Document Type"::Invoice,"Document Type"::"Credit Memo"]) THEN BEGIN AvaValidCall.AvaServiceSetDocNumTypeTable("No.","Document Type",1); AvaBlnAvaIsValidDocument := AvaValidCall.AvaServiceIsValidDocument(2); //AVANA IF (AvaInstallStatusFlag) AND AvaBlnAvaIsValidDocument THEN BEGIN AvaValidCall.OnServiceReleasePost(ServHeader,TempServiceLineForSalesTax); AvaValidCall.OnServicePost(ServHeader,TempServiceLineForSalesTax,DocId); IF (AvaInstallStatusFlag) AND ("AvaConfig 1"."Enable Serv. Modu. Integrtn") AND AvaBlnAvaIsValidDocument THEN BEGIN AvaValidCall.AvaFillTempAvaLines(); AvaValidCall.AvaSummarizeTaxLines(TempSalesTaxAmtLine,2); END ELSE //Avalara End IF SalesTaxCountry <> SalesTaxCountry::NoTax THEN BEGIN IF UseExternalTaxEngine THEN SalesTaxCalculate.CallExternalTaxEngineForServ(ServHeader,FALSE) ELSE SalesTaxCalculate.EndSalesTaxCalculation("Posting Date"); SalesTaxCalculate.GetSalesTaxAmountLineTable(TempSalesTaxAmtLine); SalesTaxCalculate.DistTaxOverServLines(TempServiceLineForSalesTax); END ELSE BEGIN TempVATAmountLineRemainder.DELETEALL; InvPostingBuffer[1].DELETEALL; //Avalara - Start IF ServLine.FINDFIRST AND (ServLine."No." = 'SALESTAXADJUST') AND (AvaConfig."Enable Tax Amt Adj." = FALSE) THEN ERROR('Posting Not allowed as "Sales Tax Adjustment" is not enabled on AvaTax Configuration'); //Avalara End // init cu for posting SLE type Usage Change to trigger FinalizeInvoiceDocument UNTIL ServCrMemoLine.NEXT = 0; ServCrMemoLine.DELETEALL; AvaSetCrMemoDetail(PServCrMemoHeader, PServCrMemoLine);//Avalara Avalara Inc. All rights reserved. Page 144 of 215
145 Change to trigger FinalizeCrMemoDocument UNTIL ServCrMemoLine.NEXT = 0; ServCrMemoLine.DELETEALL; AvaSetCrMemoDetail(PServCrMemoHeader, PServCrMemoLine);//Avalara Change to trigger CheckAndSetPostingConstants Local Variable Added Name DataType Subtype Length AvaInstallStatusFlag Boolean UNTIL PassedConsume OR (ServLine.NEXT = 0); //Avalara Start AvaInstall.RESET; AvaInstallStatusFlag:=(AvaInstall.FIND('-') AND (AvaInstall."Install Status"=3)); //Avalara End IF PassedInvoice THEN BEGIN //Avalara Start IF AvaConfig.FIND('-') AND (AvaInstallStatusFlag) THEN BEGIN AvaConfig.Invoice := FALSE; AvaConfig.MODIFY; //Avalara End ServLine.RESET; ServLine.SETFILTER(Quantity,'<>0'); IF "Document Type" = "Document Type"::Order THEN ServLine.SETFILTER("Qty. to Invoice",'<>0'); PassedInvoice := ServLine.FIND('-'); IF PassedInvoice AND ("Document Type" = "Document Type"::Order) AND NOT PassedShip THEN BEGIN //Avalara Start Pinvoice := TRUE; IF (AvaInstallStatusFlag) THEN AvaTaxEngine.SetInvoiceFlag(Pinvoice); //Avalara End PassedInvoice := FALSE; Avalara Inc. All rights reserved. Page 145 of 215
146 New Function Added AvaGetServInvNo Parameters ServInvHeaderVAR.INIT; ServInvHeaderVAR.COPY(ServInvHeader); New Function Added AvaSetCrMemoDetail Parameters Avalara Inc. All rights reserved. Page 146 of 215
147 Return Value TempServInvHeader:=PServInvHeader; TempServInvLine:= PServInvLine; New Function Added AvaSetInvDetail Parameters Avalara Inc. All rights reserved. Page 147 of 215
Avalara AvaTax for Microsoft Dynamics NAV 2015 RTM
Avalara AvaTax for Microsoft Dynamics NAV 2015 RTM Version 01 Revision date: 8/28/15 Product release: Microsoft NAV 8.00.37874.05.00 Avalara may have patents, patent applications, trademarks, copyrights,
More informationAvalara AvaTax for Microsoft Dynamics NAV 2015 RTM
Avalara AvaTax for Microsoft Dynamics NAV 2015 RTM Version 01 Revision date: 11/30/17 Product release: Microsoft NAV 8.00.37874.11.04 Avalara may have patents, patent applications, trademarks, copyrights,
More informationAvalara AvaTax for Microsoft Dynamics NAV 2013 R2
Avalara AvaTax for Microsoft Dynamics NAV 2013 R2 Version 01 Revision date: 9/9/15 Product release: Microsoft NAV 7.10.35473.09.00 Avalara may have patents, patent applications, trademarks, copyrights,
More informationAvalara AvaTax for Microsoft Dynamics NAV 2015 RTM
Avalara AvaTax for Microsoft Dynamics NAV 2015 RTM Version 01 Revision date: 11/10/16 Product release: Microsoft NAV 8.00.37874.10.00 Avalara may have patents, patent applications, trademarks, copyrights,
More informationAvalara AvaTax for Microsoft Dynamics NAV 2013 RTM
Avalara AvaTax for Microsoft Dynamics NAV 2013 RTM Version 01 Revision date: 10/9/14 Product release: Microsoft NAV 7.00.33781.03.00 Avalara may have patents, patent applications, trademarks, copyrights,
More informationAvalara AvaTax for Microsoft Dynamics NAV 2015 RTM
Avalara AvaTax for Microsoft Dynamics NAV 2015 RTM Version 01 Revision date: 12/2/14 Product release: Microsoft NAV 8.00.37874.01.00 Avalara may have patents, patent applications, trademarks, copyrights,
More informationAvalara AvaTax for Microsoft Dynamics 365 Finance and Operations Enterprise Edition
Avalara AvaTax for Microsoft Dynamics 365 Finance and Operations Enterprise Edition Version 01 Revision date: 9/25/18 Product release: Microsoft Dynamics 365 FO - EE Avalara may have patents, patent applications,
More informationAvaTax for Microsoft Dynamics AX Retail 2012
Revision date: 04/22/2013 Avalara may have patents, patent applications, trademarks, copyrights, or other intellectual property rights governing the subject matter in this document. Except as expressly
More informationVAT Reporting v
Avalara may have patents, patent applications, trademarks, copyrights, or other intellectual property rights governing the subject matter in this document. Except as expressly provided in any written license
More informationVAT Reporting v17.1.1
Avalara may have patents, patent applications, trademarks, copyrights, or other intellectual property rights governing the subject matter in this document. Except as expressly provided in any written license
More informationVAT Reporting v18.1.1
Avalara may have patents, patent applications, trademarks, copyrights, or other intellectual property rights governing the subject matter in this document. Except as expressly provided in any written license
More informationVAT Reporting v17.4.1
Avalara may have patents, patent applications, trademarks, copyrights, or other intellectual property rights governing the subject matter in this document. Except as expressly provided in any written license
More informationVAT Reporting v17.3.1
Avalara may have patents, patent applications, trademarks, copyrights, or other intellectual property rights governing the subject matter in this document. Except as expressly provided in any written license
More informationVAT Reporting v
Avalara may have patents, patent applications, trademarks, copyrights, or other intellectual property rights governing the subject matter in this document. Except as expressly provided in any written license
More informationVAT Reporting v
Avalara may have patents, patent applications, trademarks, copyrights, or other intellectual property rights governing the subject matter in this document. Except as expressly provided in any written license
More informationSage 300 ERP Sales Tax
Sage 300 ERP Sales Tax User Guide Version 1.0.1 Revision date: 01/28/2013 Avalara may have patents, patent applications, trademarks, copyrights, or other intellectual property rights governing the subject
More informationVAT Reporting v17.9.2
Avalara may have patents, patent applications, trademarks, copyrights, or other intellectual property rights governing the subject matter in this document. Except as expressly provided in any written license
More informationVAT Reporting v17.8.1
Avalara may have patents, patent applications, trademarks, copyrights, or other intellectual property rights governing the subject matter in this document. Except as expressly provided in any written license
More informationVAT Reporting v18.3.1
Avalara may have patents, patent applications, trademarks, copyrights, or other intellectual property rights governing the subject matter in this document. Except as expressly provided in any written license
More informationVAT Reporting v
Avalara may have patents, patent applications, trademarks, copyrights, or other intellectual property rights governing the subject matter in this document. Except as expressly provided in any written license
More informationMicrosoft Dynamics NAV 2009 Changes
Microsoft Dynamics NAV 2009 Changes This document provides an overview of the changed and new Microsoft Dynamics NAV objects. Sana 9 - The future of B2B e-commerce 2015 Sana Commerce Page 1 of 7 Table
More informationInstall and Configure Avalara AvaTax for Microsoft Dynamics 365 for Operations
Install and Configure Avalara AvaTax for Microsoft Dynamics 365 for Operations 1 This article applies to: Now that you've activated your AvaTax account and set up your tax profile, it's time to setup and
More informationDirect Purchasing for Version 3.x to NAV 2009 Classic RTC has same functionality, but different UI
Direct Purchasing for Version 3.x to NAV 2009 Classic RTC has same functionality, but different UI Direct Purchasing adds many new features to Navision Attain. First it allows you to issue a Purchase Order
More informationThe shortcut to e-commerce
The shortcut to e-commerce The table below provides the list of standard Microsoft Dynamics NAV objects that are modified by Sana Commerce. The standard Microsoft Dynamics NAV objects modified by Sana
More information3096 Temple Ave Pomona, CA Tel: Fax: Website:
NETcellent s Sales Order Import For ELLIOTT VERSION 7.4x From NETcellent System, Inc. 3096 Temple Ave Pomona, CA 91766 Tel: 909.622.5009 Fax: 909.622.5119 E-mail: sales@netcellent.com Website: www.netcellent.com
More informationThe shortcut to e-commerce
The shortcut to e-commerce The table below provides the list of standard Microsoft Dynamics NAV 2017 2018 objects that are modified by Sana Commerce. The standard Microsoft Dynamics NAV objects modified
More informationPop-Up Notes Manual Pop-Up Notes. For Microsoft Dynamics NAV
Pop-Up Notes For Microsoft Dynamics NAV Produced and Distributed by: Cost Control Software, Inc. 12409 Old Meridian Street Carmel, IN 46032 Phone: (317) 846-6025 www.costcontrolsoftware.com Page 1 Table
More informationThe shortcut to e-commerce
The shortcut to e-commerce The table below provides the list of standard Microsoft Dynamics NAV objects that are modified by Sana Commerce. The standard Microsoft Dynamics NAV objects modified by Sana
More information'SC_Standard_objects Type ID Name WSExposed 2016 Sana Commerce Page 2 of 6
This table provides the list of standard Microsoft Dynamics NAV 2009 R2 objects that are changed by Sana Commerce. This means that in these standard Microsoft Dynamics NAV objects some fields were created
More informationData Import Guide DBA Software Inc.
Contents 3 Table of Contents 1 Introduction 4 2 Data Import Instructions 5 3 Data Import - Customers 10 4 Data Import - Customer Contacts 16 5 Data Import - Delivery Addresses 19 6 Data Import - Suppliers
More informationSLIM CD LEVEL 3 User Manual Slim CD Inc
SLIM CD LEVEL 3 User Manual 2017 Slim CD Inc. support@slimcd.com 1-877-475-4623 954-752-9309 0 support@slimcd.com Contents WHAT IS LEVEL 3?... 2 SLIM CD LEVEL 3 EXPRESS... 3 ITEMS... 4 CUSTOMERS... 6 ADD
More information2. QuickBooks Desktop Integration User Guides
2. QuickBooks Desktop Integration User Guides Thank you for purchasing my extension. If you have any questions that are beyond the scope of this help file, please feel free to email via my user page contact
More informationClient Access and Log In... CUSTOMER CENTER: Overview... 3 Home Links Quick Search... 5 Settings... 5
Table of Contents WWW.LABELKINGS.COM Client Access and Log In....... Page 2 CUSTOMER CENTER: Overview.... 3 Home Links... 4 Billing, Orders, Support Quick Search...... 5 Settings.... 5 ENTERING NEW ORDERS......
More informationMicrosoft Dynamics GP. This paper provides guidance for ISV products that integrate with Inventory transaction posting.
INTEGRATE Microsoft Dynamics GP Integrating with the Historical Inventory Trial Balance White Paper This paper provides guidance for ISV products that integrate with Inventory transaction posting. Date:
More informationInvoice Specification EDI 810
Invoice Specification EDI 80 This document is solely for the use of Logicbroker, Inc. personnel and its intended client. No part of it may be circulated, Quoted, or reproduced for distribution outside
More informationBill Designer for Shoper 9
The information contained in this document is current as of the date of publication and subject to change. Because Tally must respond to changing market conditions, it should not be interpreted to be a
More informationPop-up Notes Features:
Pop-up Notes The purpose of Pop-Up Notes is to streamline your internal communications. Pop-Up Notes gives you the ability to repeatedly issue Notes and reminders electronically. Instead of scribbled on
More informationNC Tax. Changes. NCT for Microsoft Dynamics NAV*
Changes NC Tax NCT 11.00 for Microsoft Dynamics NAV* *NC Tax 11.00 is available for Microsoft Business Solutions Navision 3.70, Microsoft Business Solutions Navision 4.0 SP3, Microsoft Dynamics NAV 5.0
More informationEclipse Business Connect XML. Release (Eterm)
Eclipse Business Connect XML Release 8.6.4 (Eterm) Legal Notices 2008 Activant Solutions Inc. All rights reserved. Unauthorized reproduction is a violation of applicable laws. Activant and the Activant
More informationREMOTE SERVICE Module Reference Manual. Version 11.0 Revision Date 5/1/04
REMOTE SERVICE Module Reference Manual Version 11.0 Revision Date 5/1/04 The documentation in this publication is provided pursuant to a Sales and Licensing Contract for the Prophet 21 System entered into
More informationMicrosoft Dynamics GP. Working With Configurations Release 10.0
Microsoft Dynamics GP Working With Configurations Release 10.0 Copyright Copyright 2008 Microsoft Corporation. All rights reserved. Complying with all applicable copyright laws is the responsibility of
More informationAWG/VMC UCS (880) Inbound Invoice Map Version 4030
HEADER Segment: G01 - Invoice Identification Purpose: To transmit Identifying dates and numbers for this transaction set Element Name EleNbr G0101 373 Date Invoice Date G0102 76 Invoice Number Invoice
More informationCisco Systems (Italy) S.r.l. Services Overview Cisco and/or its affiliates. All rights reserved. Cisco Public 0
Cisco Systems (Italy) S.r.l. Services Overview 2012 Cisco and/or its affiliates. All rights reserved. Cisco Public 0 Introduction of Cisco Services (Italy) S.r.l. How it Affects You What is Changing and
More informationAutomatic Record Matching in the Payment Reconciliation Journal
Automatic Record Matching in the Payment Reconciliation Journal Design Insight White Paper Ciprian Iordache Software Development Engineer II Nikola Kukrika Software Development Engineer II September 2014
More informationNC Tax. Documentation. NCT 8.02 for Microsoft Dynamics NAV 2016*
Documentation NC Tax NCT 8.02 for Microsoft Dynamics NAV 2016* *NC Tax 8.02 is available for Navision Financials 2.60, Microsoft Business Solutions Navision 3.70, Microsoft Business Solutions Navision
More informationIMPORTING QUICKBOOKS DATA. Use this guide to help you convert from QuickBooks to Denali
IMPORTING QUICKBOOKS DATA Use this guide to help you convert from QuickBooks to Denali Importing QuickBooks Data Copyright Notification At Cougar Mountain Software, Inc., we strive to produce high-quality
More informationSage 300. Sage CRM 7.3 Integration Upgrade Guide
Sage 300 Sage CRM 7.3 Integration Upgrade Guide This is a publication of Sage Software, Inc. Copyright 2015. Sage Software, Inc. All rights reserved. Sage, the Sage logos, and the Sage product and service
More informationC/AL Programming Guide
C/AL Programming Guide The Way to Grow C/AL PROGRAMMING GUIDE NOTICE This material is for informational purposes only. Navision a/s disclaims all warranties and conditions with regard to use of the material
More informationMicrosoft Dynamics GP Release Integration Guide For Microsoft Retail Management System Headquarters
Microsoft Dynamics GP Release 10.0 Integration Guide For Microsoft Retail Management System Headquarters Copyright Copyright 2007 Microsoft Corporation. All rights reserved. Complying with all applicable
More informatione-invoicing Guide Version 1.2 March 2014
e-invoicing Guide Version 1.2 March 2014 Table of Contents About this Guide...3 Introduction...4 Creating an e-invoice/quotation...5 e-invoice/quotation Fields...5 e-invoice/quotation Details...5 Customer
More informationMagento 1 CCH SureTax for Magento Extension
Magento 1 CCH SureTax for Magento Extension User Guide August 16, 2016 2016, CCH Incorporated and its affiliates and licensors. All rights reserved. Material in this publication may not be reproduced or
More informationDocument Capture for Microsoft Dynamics NAV
Document Capture for Microsoft Dynamics NAV Walkthroughs - Version 4.50 Document Capture - Walkthroughs - Version 4.50 Page 1 / 57 TABLE OF CONTENTS TABLE OF CONTENTS... 2 SETUP AND ADMINISTRATION WALKTHROUGHS...
More informationDesign Insights Enhanced Cue Functionality
Design Insights Enhanced Cue Functionality May 2014 Contents Introduction 3 Basics of Implementing Cue Controls 3 Best Practices for Implementing Cue Controls: Enabling End User Customization of Indicators
More informationOTHER ACCOUNTS RECEIVABLE - SETUP
OTHER ACCOUNTS RECEIVABLE - SETUP (OAS - Figure 002) MENU DESCRIPTION This is the Setup Main Menu. Through this menu, the Operator may access Setup - Customer (OASC). By entering in the second field
More information844 Product Transfer Account
844 Product Transfer Account Adjustment Functional Group=CF This Draft Standard for Trial Use contains the format and establishes the data contents of the Product Transfer Account Adjustment Transaction
More informationRMH GENERAL CONFIGURATION
RMH GENERAL CONFIGURATION Retail Management Hero (RMH) rmhsupport@rrdisti.com www.rmhpos.com Copyright 2016, Retail Realm. All Rights Reserved. RMHDOCGENCONFIGD051216 Disclaimer Information in this document,
More informationCYMA IV Accounting for Windows Training Guide Series. General Import Training Guide
CYMA IV Accounting for Windows Training Guide Series General Import Training Guide November 2010 CYMA Systems, Inc. 2330 West University Drive, Suite 4 Tempe, AZ 85281 (800) 292-2962 Fax: (480) 303-2969
More informationBridgestone National Accounts Interface
Bridgestone National Accounts Interface The Bridgestone National Accounts Interface links TireMaster and Bridgestone s Automated Delivery Receipt System, giving you the ability to electronically file claims
More informationSage 300. Sage CRM 2018 Integration Upgrade Guide. October 2017
Sage 300 Sage CRM 2018 Integration Upgrade Guide October 2017 This is a publication of Sage Software, Inc. 2017 The Sage Group plc or its licensors. All rights reserved. Sage, Sage logos, and Sage product
More informationMicrosoft Retail Management System 1.3 Refreshes, Service Packs, and Hotfixes
Page 1 of 5 Microsoft Retail Management System 1.3 Refreshes, Service Packs, and Hotfixes 1.3 and Headquarters 1.3 Last Modified 5/4/2007 Posted 11/3/2006 Article ID Available Microsoft Retail Management
More informationWhat's New: Release to
26-Apr-2016 Page : 1 14:48:39 Modification and Development Release Notes, new development and modifications completed in release version range included on report. Please review and if interested in any,
More informationBridgestone/Firestone Interface
Bridgestone/Firestone Interface With the Bridgestone/Firestone Interface, you can electronically submit and process vendor claims for Bridgestone/Firestone transactions. These instructions describe how
More informationARIBA BPO PROCESS FOR CCA SUPPLIERS
CONTENTS ARIBA BPO PROCESS FOR CCA SUPPLIERS Introduction to Ariba Light 1 Ariba Light Workflow 2 Processing and Managing the Blanket Purchase Order 3 Processing the Invoice 4 Ariba Light -Interactive
More information810 IBM Subset - Invoice To Customer - (004010)
810 IBM Subset - Invoice To Customer - (004010) Functional Group ID=IN Introduction: This Draft Standard for Trial Use contains the format and establishes the data contents of the Invoice Transaction Set
More informationManual Ext. Fixed Assets
Manual Ext. Fixed Assets Prepared for Customers & Partners Project OPplus Ext. Fixed Assets Prepared by gbedv GmbH & Co. KG Contents General... 4 Manual Structure... 4 Description of Icons... 4 OPplus
More informationR98306 SNC-Lavalin ProFac Inc. 5/22/ :58: Override Next Status. 7. Override Transaction Unit of Measure
Title 1 Defaults 1. Order Type (Required) SO 2. Line Type 3. Beginning Status 520 4. Override Next Status 5. Line Number Increment 0 6. Reason Code 7. Override Transaction Unit of Measure 8. Default Transaction
More informationv12.1 The following sections have been changed in this release:
9 / 2 9 / 2 0 1 5, PixelPoint Release Notes v12.1 This document details changes made to PixelPoint files. Changes are listed in order from newest to oldest, and are either new features that have been added
More informationWhat's New on Release 26.1
What's New on Release 26.1 Welcome to Eagle Release 26.1 (server Level 38). This document summarizes the new features and enhancements. Use the red links below to take you to a particular section of this
More informationAccounts Receivable Customer
Accounts Receivable Customer Contents Overview... 1 Document Layout... 2 General Information Tab... 3 Corporate Information Tab... 3 Contact Information Tab... 4 Addresses Tab... 4 Overview The Customer
More informationCONNECTED 8.3 Release Notes
CONNECTED 8.3 Release Notes Introduction... 3 Minimum System Requirements for Connected 8.3... 3 Connected 8.3 Installation... 3 Enhancements... 4 General Enhancements... 4 Advanced Email Templates...
More informationBAA Oracle EBS R12.1 isupplier Portal Created on 11/26/2012 3:18:00 PM
Created on 11/26/2012 3:18:00 PM COPYRIGHT & TRADEMARKS Copyright 1998, 2009, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
More informationPrinter s Plan Jobs Section
Printer s Plan 2012 Jobs Section You can now have default service(s), such as Preflight, automatically added to a new Item. This is accomplished by customizing each product type with its own service(s).
More informationIssue dated 25 th July Create Credit Notes
Create Credit Notes From time to time a business may have to issue a credit note to a customer to cancel an invoice or part of the value of the invoice. Usually, as an Invoice has already been previously
More informationMicrosoft Dynamics GP. Localization Chile
Microsoft Dynamics GP Localization Chile Copyright Copyright 2010 Microsoft. All rights reserved. Limitation of liability This document is provided as-is. Information and views expressed in this document,
More information867 Bill Back itradenetwork OMS
867 Bill Back itradenetwork OMS X12/V4010/867: 867 Product Transfer and Resale Report Version: 1.3 Final Company: itradenetwork Publication: 12/23/2013 Trading Partner: Current: 4/3/2015 Table of Contents
More informationConfiguration Fixes for Encryption
Oracle Retail Point-of-Sale Release Notes Release 7.2.2 April 2007 This document lists the fixed defects included in Release 7.2.2 of Oracle Retail Point-of-Sale. Before installing this release, confirm
More informationNorth Dakota University System. Financial Systems 9.2. User Preferences
North Dakota University System Financial Systems 9.2 User Preferences July 2017 Table of Contents Overview... 1 User Preferences... 1 General Preferences... 2 Overall Preference... 2 OLE Information...
More informationSupplier Enablement Quick Reference Guide (QRG) October 2017
Supplier Enablement Quick Reference Guide (QRG) October 2017 1 Coupa Supplier Enablement Overview Coupa - Is a reimagining of the tools and technology we use to engage our suppliers from sourcing all the
More informationEnhanced Batch Processing SO-1100
Enhanced Batch Processing SO-1100 Overview This Extended Solution enhances the Sales Order Invoice batch processing function as follows: Allows invoices to be selected individually for batch merge User
More informationOracle Order Capture. Dependencies. Related Documentation and Resources. Implementation Guide
Oracle Order Capture Implementation Guide Release 11i August 2000 Part No. A86137-01 This topic group provides general descriptions of the set up and configuration tasks required to implement the application
More informationAbleCommerce v7.x AvaTax Connector Guide
AbleCommerce v7.x AvaTax Connector Guide Revision: 1.0 December 17, 2009 Copyright 2009 Able Solutions Corporation. All rights reserved. AbleCommerce is a division of Able Solutions Corporation. CommerceBuilder
More informationWhat s New in Microsoft Dynamics NAV 2013 R2
What s New in Microsoft Dynamics NAV 2013 R2 September 2013 Contents What s New: Application Changes for Microsoft Dynamics NAV 2013 R2 and Microsoft Dynamics NAV 2013 3 RapidStart Services for Microsoft
More informationMobilcomm 1211 West Sharon Road, Cincinnati, OH 45240
BRICS Princeton Road Hamilton, Ohio 45011 Matt Franke, Bill Vedra Attn: Email: Reference: Motorola XTS1500 Pricing Quote: Issued: Expires: Phone: Fax: 901-16854 10/3/2012 11/15/2012 513-785-1299 Item Product
More informationUser Documentation. t-commerce User s Guide
User Documentation t-commerce User s Guide TRIBUTE INC. USER DOCUMENTATION t-commerce User s Guide Copyright Notice and Trademarks 2000-2007 Tribute, Inc. All rights reserved t-commerce is a registered
More informationServiceLedger Getting Started Guides
ServiceLedger Getting Started Guides Getting Started with the Quote Manager The Quote Manager allows you to track the quotes and sales estimates you give to customers and prospects and allows you to track
More informationDeveloper Manual Sales Voucher Authorisation
Developer Manual Sales Voucher Authorisation The information contained in this document is current as of the date of publication and subject to change. Because Tally must respond to changing market conditions,
More informationCreate Credit Memo. Intel Information Technology Job aid Revision May 23, This job aid demonstrate how you can create credit demo.
Create Credit Memo Intel Information Technology Job aid Revision May 23, 2012 Description Who performs What you should know This job aid demonstrate how you can create credit demo. Intel Suppliers Once
More informationHold Flags for Sales Order SO-1328
Hold Flags for Sales Order SO-1328 Overview This Extended Solution to the Sales Order module allows you to place orders on specific types of hold : Terms Hold, Credit Hold and Margin Hold. The Custom Office
More information867 Product Transfer and Resale Report Functional Group=PT
867 Product Transfer and Resale Report Functional Group=PT This Draft Standard for Trial Use contains the format and establishes the data contents of the Product Transfer and Resale Report Transaction
More informationPurchase Order - v4010 Functional Group ID = PO
850 Functional Group ID = PO TESTING PROCEDURES & TIPS ON AUTOLIV's 850 DOCUMENT is now using this 850 document for MRO ordering. If you have any questions, please contact Autoliv IT Service Center at
More informationOverview... 3 Microsoft Dynamics GP 2013 and Microsoft Dynamics NAV 2013 Transition Upgrade Policy... 4
Published July 11, 2012 Contents Overview... 3 Transition Upgrade Policy... 4 License Migration Transition Upgrade (LMT Upgrade)... 5 License Credit Transition Upgrade (LCT Upgrade)... 5 Use of Old Product
More informationShipRite s Account Receivable Instructions
ShipRite s Account Receivable Instructions Setting up a new account Click on the POS button Enter the existing customer s PHONE number here. If they are in the database, their information will appear at
More informationConnecting YOUR Quick Base and QuickBooks
Connecting YOUR Quick Base and QuickBooks 1 Table of Contents Q2QConnect Configuration... 3 Connection Setup... 4 Quick Base Section... 4 QuickBooks Section... 5 Connecting the Database... 7 Mapping the
More informationDefect Repair Report as of 10/10/2014
27.05 Page 1 of 16 Release Notes By Module Framework The system reports no longer fail due to special characters in certain report names. 27.05-632 Framework The EFI Pace server now includes a patch for
More informationikan Software ikan Cloud AP Input Data File Format Guide
Introduction The ikan Cloud AP solution requires input data files from up to six sources. The number of input data files required depends on the ikan Cloud AP type. For ikan Cloud AP (Basic) the following
More informationFor addition help including training and support please contact Scanco by or phone. Scanco Support -
Scanco Mobility Module Contents Mobility Remote Setup... 2 Purchase Order EZ Import... 9 Sales Order EZ Import... 10 Bill of Materials EZ Import... 11 EZ Import Reject Maintenance... 12 Rejected Import
More informationSales Order Entry by Price List
Sales Order Entry by Price List Begin Transaction Plant Customer Number Customer Name Sales Order Details Sales Order Total Amount Sales Order Details: Item Item Description 1 Quantity Ordered Unit of
More informationEvatic Version (incl. Dashboards)
Evatic Version 4.2.0 (incl. Dashboards) New features and enhancements overview Review of the most important features of the last releases 3.9.7 4.1.0 1. General information 1.1 About this document This
More informationCHAPTER 8B PURCHASE ORDER MANAGEMENT
CHAPTER 8B PURCHASE ORDER MANAGEMENT Chapter 8B...1 Purchase Order Maintenance...2 Purchase Order Maintenance...3 Retrieving an Existing Purchase Order...5 Quick Search...6 Deleting an Existing Purchase
More informationCreated by: Yardley Technical Communication
QUOTATION PRINTING This manual contains reference information about software products from Activant Solutions Inc. The software described in this manual and the manual itself are furnished under the terms
More information