Index: vhUnitTest/AX/Uitgaand/VKP/VerkoopFactuur/impl/AifConverter/Test.cls.xml =================================================================== diff -u -r35139 -r35145 --- vhUnitTest/AX/Uitgaand/VKP/VerkoopFactuur/impl/AifConverter/Test.cls.xml (.../Test.cls.xml) (revision 35139) +++ vhUnitTest/AX/Uitgaand/VKP/VerkoopFactuur/impl/AifConverter/Test.cls.xml (.../Test.cls.xml) (revision 35145) @@ -1,19 +1,14 @@ -vhUnitTest.TestCase +vhUnitTest.AX.Uitgaand.VKP.VerkoopFactuur.impl.AifConverter.Base @@ -121,13 +96,8 @@ do Boekingen.Insert(##class(DOM.VKP.Factuur.dto.BoekhoudBoeking).%New(100,703006)) do VerkoopFactuur.IndienMethodCall("GeefBoekhoudBoekingen").DanReturn(Boekingen) - #dim OrderApiStub As vhTest.Mock.DOM.VKP.OrderAPI = ##class(vhTest.Mock.DOM.VKP.OrderAPI).%New() - do OrderApiStub.IndienMethodCall("GeefFactuur",VerkoopFactuur.GeefID()).DanReturn(VerkoopFactuur) + #dim JournalTable As AXaif.LedgerGeneralJournal.AxdEntityLedgerJournalTable = ..GetJournalTable(VerkoopFactuur) - set Converter = ##class(AX.Uitgaand.VKP.VerkoopFactuur.impl.AifConverter).%New(,,OrderApiStub) - #dim GeneralJournal As AXaif.LedgerGeneralJournal.AxdLedgerGeneralJournal = Converter.Convert(VerkoopFactuur.GeefID()) - #dim JournalTable As AXaif.LedgerGeneralJournal.AxdEntityLedgerJournalTable = GeneralJournal.LedgerJournalTable.GetAt(1) - if $$$AssertEquals(JournalTable.LedgerJournalTrans.Count(),2) { do $$$AssertEquals(JournalTable.LedgerJournalTrans.GetAt(2).AccountType,"Ledger") do $$$AssertEquals(JournalTable.LedgerJournalTrans.GetAt(2).LedgerDimension.GetAt(1).Account,703010) @@ -175,6 +145,7 @@ 1 + + +vhUnitTest.AX.Uitgaand.VKP.VerkoopFactuur.impl.AifConverter.Base + + + + + + + + + + + + Index: vhTest/Utils/DOM/VKP/Factuur.cls.xml =================================================================== diff -u -r34988 -r35145 --- vhTest/Utils/DOM/VKP/Factuur.cls.xml (.../Factuur.cls.xml) (revision 34988) +++ vhTest/Utils/DOM/VKP/Factuur.cls.xml (.../Factuur.cls.xml) (revision 35145) @@ -14,7 +14,10 @@ do VerkoopFactuur.IndienMethodCall("GeefID").DanReturn(123456) do VerkoopFactuur.IndienMethodCall("GeefTotaalTeBetalen").DanReturn(121) do VerkoopFactuur.IndienMethodCall("GeefTotaalBelastbaar").DanReturn(100) - do VerkoopFactuur.IndienMethodCall("GeefTotaalKortingKontant").DanReturn("") + do VerkoopFactuur.IndienMethodCall("GeefTotaalGoederen").DanReturn(100) + do VerkoopFactuur.IndienMethodCall("GeefTotaalPort").DanReturn(0) + do VerkoopFactuur.IndienMethodCall("GeefTotaalBTW").DanReturn(21) + do VerkoopFactuur.IndienMethodCall("GeefTotaalKortingKontant").DanReturn(0) do VerkoopFactuur.IndienMethodCall("GeefMuntCode").DanReturn("EUR") do VerkoopFactuur.IndienMethodCall("GeefFactuurDatum").DanReturn($$$DummyDate) do VerkoopFactuur.IndienMethodCall("GeefVervalDatum").DanReturn($$$DummyDate+30) Index: vhUnitTest/AX/Uitgaand/VKP/VerkoopFactuur/impl/AifConverter/Base.cls.xml =================================================================== diff -u --- vhUnitTest/AX/Uitgaand/VKP/VerkoopFactuur/impl/AifConverter/Base.cls.xml (revision 0) +++ vhUnitTest/AX/Uitgaand/VKP/VerkoopFactuur/impl/AifConverter/Base.cls.xml (revision 35145) @@ -0,0 +1,24 @@ + + + +1 +vhUnitTest.TestCase + + +VerkoopFactuur:DOM.VKP.Factuur +1 +AXaif.LedgerGeneralJournal.AxdEntityLedgerJournalTable + + + + + + Index: AX/Uitgaand/VKP/VerkoopFactuur/impl/AifConverter.cls.xml =================================================================== diff -u -r35133 -r35145 --- AX/Uitgaand/VKP/VerkoopFactuur/impl/AifConverter.cls.xml (.../AifConverter.cls.xml) (revision 35133) +++ AX/Uitgaand/VKP/VerkoopFactuur/impl/AifConverter.cls.xml (.../AifConverter.cls.xml) (revision 35145) @@ -92,17 +92,20 @@ #dim Transaction As AXaif.LedgerGeneralJournal.AxdEntityLedgerJournalTrans = ..MakeTransaction(Factuur,BoekingIndex+1) set Transaction.AccountType = "Ledger" - if Factuur.GeefTotaalKortingKontant()>0 { - #dim TotaalGoederenInclusiefPort As %Numeric = Factuur.GeefTotaalGoederen() + Factuur.GeefTotaalPort() + #dim TotaalGoederenInclusiefPort As %Numeric = Factuur.GeefTotaalGoederen() + Factuur.GeefTotaalPort() + + if Factuur.GeefTotaalKortingKontant() = 0 { + set Transaction.ADUCorrectedTaxAmount = ..Formatter.FormatNumber( Factuur.GeefTotaalBTW() / TotaalGoederenInclusiefPort * Boeking.Bedrag,2) + set:(Factuur.GeefFactuurCode()=##class(DOM.VKP.Factuur.enu.FactuurType).Factuur()) Transaction.AmountCurCredit = ..Formatter.FormatNumber(Boeking.Bedrag,2) + set:(Factuur.GeefFactuurCode()=##class(DOM.VKP.Factuur.enu.FactuurType).Creditnota()) Transaction.AmountCurDebit = ..Formatter.FormatNumber(Boeking.Bedrag,2) + } else { set Transaction.ADUCorrectedTaxAmount = ..Formatter.FormatNumber( Factuur.GeefTotaalBTW() / TotaalGoederenInclusiefPort * Boeking.Bedrag ,2) set Transaction.CashDiscAmount = ..Formatter.FormatNumber( -1 * ( Factuur.GeefTotaalKortingKontant() / TotaalGoederenInclusiefPort * Boeking.Bedrag ) ,2) + set:(Factuur.GeefFactuurCode()=##class(DOM.VKP.Factuur.enu.FactuurType).Factuur()) Transaction.AmountCurCredit = ..Formatter.FormatNumber(Boeking.Bedrag+Transaction.ADUCorrectedTaxAmount,2) + set:(Factuur.GeefFactuurCode()=##class(DOM.VKP.Factuur.enu.FactuurType).Creditnota()) Transaction.AmountCurDebit = ..Formatter.FormatNumber(Boeking.Bedrag+Transaction.ADUCorrectedTaxAmount,2) } - - set:(Factuur.GeefFactuurCode()=##class(DOM.VKP.Factuur.enu.FactuurType).Factuur()) Transaction.AmountCurCredit = ..Formatter.FormatNumber(Boeking.Bedrag+Transaction.ADUCorrectedTaxAmount,2) - set:(Factuur.GeefFactuurCode()=##class(DOM.VKP.Factuur.enu.FactuurType).Creditnota()) Transaction.AmountCurDebit = ..Formatter.FormatNumber(Boeking.Bedrag+Transaction.ADUCorrectedTaxAmount,2) #dim BoekhoudRekeningId As %String = ..GrootboekrekeningBepaler.BepaalGrootboekrekening(Factuur.GeefKlantID(),Boeking.BoekhoudRekeningId) - set Transaction.LedgerDimension.GetAt(1).Account = BoekhoudRekeningId set Transaction.LedgerDimension.GetAt(1).DisplayValue = BoekhoudRekeningId Index: vhUnitTest/AX/Uitgaand/VKP/VerkoopFactuur/impl/AifConverter/TestFactuurKortingContant.cls.xml =================================================================== diff -u -r34987 -r35145 --- vhUnitTest/AX/Uitgaand/VKP/VerkoopFactuur/impl/AifConverter/TestFactuurKortingContant.cls.xml (.../TestFactuurKortingContant.cls.xml) (revision 34987) +++ vhUnitTest/AX/Uitgaand/VKP/VerkoopFactuur/impl/AifConverter/TestFactuurKortingContant.cls.xml (.../TestFactuurKortingContant.cls.xml) (revision 35145) @@ -1,7 +1,7 @@ -vhUnitTest.TestCase +vhUnitTest.AX.Uitgaand.VKP.VerkoopFactuur.impl.AifConverter.Base