Anomalia in collega/scollega documenti

Ho notato questa stranezza: registro una fattura fornitore, poi registro una nota di credito sullo stesso fornitore e direttamente dal documento faccio Collega movimenti per legarlo alla fattura, poi registro la nota. A questo punto decido di scollegarli. Il sistema se navigo sulla nota di credito scollegata mi fa vedere due movimenti in più: uno sul vat entry e uno sul movimenti libro gornale(quest’ultimo a importo 0). Se il collegamento fattura/nota lo faccio dopo aver registrato la nota di credito questi movimenti non vengono generati. avete qualche idea? Grazie

ATTENZIONE. ho cancellato manualmente i record erronemente inseriti dal programma scollega movimenti perchè questa anomalia crea una squadratura tra registri iva e liquidazione iva.

ATTENZIONE. ho cancellato manualmente i record erronemente inseriti dal programma scollega movimenti perchè questa anomalia crea una squadratura tra registri iva e liquidazione iva.

Buon Giorno, mi sono scontrato anch’io con questo problema qualche tempo fa. E’ un bug della 4.00 W1. Presumo sia stato corretto con la 4.1. In ogni caso allego la correzione ricevuta dal support. Codeunit 12 Trigger UnapplyCustLedgEntry(GenJnlLine2 : Record “Gen. Journal Line”;DtldCustLedgEntry : Record “Detailed Cust. Ledg. Entry”) Add this local variable: Name DataType Subtype Length UnapplyVATEntries Boolean Add this code lines: IF (TotalAmountLCY <> 0) OR (TotalAmountAddCurr <> 0) AND (GLSetup.“Additional Reporting Currency” <> ‘’) THEN BEGIN InitGLEntry( CustPostingGr.“Receivables Account”,TotalAmountLCY,TotalAmountAddCurr,TRUE,TRUE); InsertGLEntry(TRUE); END; //new line begin UnapplyVATEntries := FALSE; IF DtldCustLedgEntry2.FIND(’-’) THEN REPEAT IF (DtldCustLedgEntry2.“Entry Type” = DtldCustLedgEntry2.“Entry Type”::“Payment Discount (VAT Adjustment)”) OR (DtldCustLedgEntry2.“Entry Type” = DtldCustLedgEntry2.“Entry Type”::“Payment Tolerance (VAT Adjustment)”) OR (DtldCustLedgEntry2.“Entry Type” = DtldCustLedgEntry2.“Entry Type”::“Payment Discount Tolerance (VAT Adjustment)”)THEN UnapplyVATEntries := TRUE UNTIL DtldCustLedgEntry2.NEXT = 0; //end new line VATEntry.SETCURRENTKEY(Type,“Bill-to/Pay-to No.”,“Transaction No.”); VATEntry.SETRANGE(Type,VATEntry.Type::Sale); VATEntry.SETRANGE(“Bill-to/Pay-to No.”,DtldCustLedgEntry.“Customer No.”); VATEntry.SETRANGE(“Transaction No.”,DtldCustLedgEntry.“Transaction No.”); IF VATEntry.FIND(’-’) THEN REPEAT IF UnapplyVATEntries OR (VATEntry.“Unrealized VAT Entry No.” <> 0) THEN BEGIN //new line NewVATEntry := VATEntry; NewVATEntry.“Closed by Entry No.” := 0; NewVATEntry.Closed := FALSE; NewVATEntry.Base := -VATEntry.Base; NewVATEntry.Amount := -VATEntry.Amount; NewVATEntry.“Unrealized Amount” := -VATEntry.“Unrealized Amount”; NewVATEntry.“Unrealized Base” := -VATEntry.“Unrealized Base”; NewVATEntry.“Remaining Unrealized Amount” := -VATEntry.“Remaining Unrealized Amount”; NewVATEntry.“Remaining Unrealized Base” := -VATEntry.“Remaining Unrealized Base”; NewVATEntry.“Additional-Currency Amount” := -VATEntry.“Additional-Currency Amount”; NewVATEntry.“Additional-Currency Base” := -VATEntry.“Additional-Currency Base”; NewVATEntry.“Add.-Currency Unrealized Amt.” := -VATEntry.“Add.-Currency Unrealized Amt.”; NewVATEntry.“Add.-Currency Unrealized Base” := -VATEntry.“Add.-Currency Unrealized Base”; NewVATEntry.“Add.-Curr. Rem. Unreal. Amount” := -VATEntry.“Add.-Curr. Rem. Unreal. Amount”; NewVATEntry.“Add.-Curr. Rem. Unreal. Base” := -VATEntry.“Add.-Curr. Rem. Unreal. Base”; NewVATEntry.“Transaction No.” := NextTransactionNo; NewVATEntry.“Entry No.” := NextVATEntryNo; NextVATEntryNo := NextVATEntryNo + 1; NewVATEntry.INSERT; IF VATEntry.“Unrealized VAT Entry No.” <> 0 THEN BEGIN VATPostingSetup.GET(VATEntry.“VAT Bus. Posting Group”,VATEntry.“VAT Prod. Posting Group”); IF VATPostingSetup.“VAT Calculation Type” IN [VATPostingSetup.“VAT Calculation Type”::“Normal VAT”, VATPostingSetup.“VAT Calculation Type”::“Full VAT”] THEN BEGIN VATPostingSetup.TESTFIELD(“Sales VAT Unreal. Account”); VATPostingSetup.TESTFIELD(“Sales VAT Account”); PostUnrealVATByUnapply( VATPostingSetup.“Sales VAT Unreal. Account”, VATPostingSetup.“Sales VAT Account”, VATEntry,NewVATEntry); END ELSE BEGIN VATEntry.TESTFIELD(“Tax Jurisdiction Code”); TaxJurisdiction.GET(VATEntry.“Tax Jurisdiction Code”); TaxJurisdiction.TESTFIELD(“Unreal. Tax Acc. (Sales)”); TaxJurisdiction.TESTFIELD(“Tax Account (Sales)”); PostUnrealVATByUnapply( TaxJurisdiction.“Unreal. Tax Acc. (Sales)”, TaxJurisdiction.“Tax Account (Sales)”, VATEntry,NewVATEntry); END; END; END; //new LIne Same correction for the vendor site: Trigger UnapplyVendLedgEntry(GenJnlLine2 : Record “Gen. Journal Line”;DtldVendLedgEntry : Record “Detailed Vendor Ledg. Entry”) Add this local variable Name DataType Subtype Length UnapplyVATEntries Boolean Make this code line changes IF (TotalAmountLCY <> 0) OR (TotalAmountAddCurr <> 0) AND (GLSetup.“Additional Reporting Currency” <> ‘’) THEN BEGIN InitGLEntry( VendPostingGr.“Payables Account”,TotalAmountLCY,TotalAmountAddCurr,TRUE,TRUE); InsertGLEntry(TRUE); END; //New line begin UnapplyVATEntries := FALSE; IF DtldVendLedgEntry2.FIND(’-’) THEN REPEAT IF (DtldVendLedgEntry2.“Entry Type” = DtldVendLedgEntry2.“Entry Type”::“Payment Discount (VAT Adjustment)”) OR (DtldVendLedgEntry2.“Entry Type” = DtldVendLedgEntry2.“Entry Type”::“Payment Tolerance (VAT Adjustment)”) OR (DtldVendLedgEntry2.“Entry Type” = DtldVendLedgEntry2.“Entry Type”::“Payment Discount Tolerance (VAT Adjustment)”) THEN UnapplyVATEntries := TRUE UNTIL DtldVendLedgEntry2.NEXT = 0; //end new line VATEntry.SETCURRENTKEY(Type,“Bill-to/Pay-to No.”,“Transaction No.”); VATEntry.SETRANGE(Type,VATEntry.Type::Purchase); VATEntry.SETRANGE(“Bill-to/Pay-to No.”,DtldVendLedgEntry.“Vendor No.”); VATEntry.SETRANGE(“Transaction No.”,DtldVendLedgEntry.“Transaction No.”); IF VATEntry.FIND(’-’) THEN REPEAT IF UnapplyVATEntries OR (VATEntry.“Unrealized VAT Entry No.” <> 0) THEN BEGIN //new line NewVATEntry := VATEntry; NewVATEntry.“Closed by Entry No.” := 0; NewVATEntry.Closed := FALSE; NewVATEntry.Base := -VATEntry.Base; NewVATEntry.Amount := -VATEntry.Amount; NewVATEntry.“Unrealized Amount” := -VATEntry.“Unrealized Amount”; NewVATEntry.“Unrealized Base” := -VATEntry.“Unrealized Base”; NewVATEntry.“Remaining Unrealized Amount” := -VATEntry.“Remaining Unrealized Amount”; NewVATEntry.“Remaining Unrealized Base” := -VATEntry.“Remaining Unrealized Base”; NewVATEntry.“Additional-Currency Amount” := -VATEntry.“Additional-Currency Amount”; NewVATEntry.“Additional-Currency Base” := -VATEntry.“Additional-Currency Base”; NewVATEntry.“Add.-Currency Unrealized Amt.” := -VATEntry.“Add.-Currency Unrealized Amt.”; NewVATEntry.“Add.-Currency Unrealized Base” := -VATEntry.“Add.-Currency Unrealized Base”; NewVATEntry.“Add.-Curr. Rem. Unreal. Amount” := -VATEntry.“Add.-Curr. Rem. Unreal. Amount”; NewVATEntry.“Add.-Curr. Rem. Unreal. Base” := -VATEntry.“Add.-Curr. Rem. Unreal. Base”; NewVATEntry.“Transaction No.” := NextTransactionNo; NewVATEntry.“Entry No.” := NextVATEntryNo; NextVATEntryNo := NextVATEntryNo + 1; NewVATEntry.INSERT; IF VATEntry.“Unrealized VAT Entry No.” <> 0 THEN BEGIN VATPostingSetup.GET(VATEntry.“VAT Bus. Posting Group”,VATEntry.“VAT Prod. Posting Group”); IF VATPostingSetup.“VAT Calculation Type” IN [VATPostingSetup.“VAT Calculation Type”::“Normal VAT”, VATPostingSetup.“VAT Calculation Type”::“Full VAT”] THEN BEGIN VATPostingSetup.TESTFIELD(“Purch. VAT Unreal. Account”); VATPostingSetup.TESTFIELD(“Purchase VAT Account”); PostUnrealVATByUnapply( VATPostingSetup.“Purch. VAT Unreal. Account”, VATPostingSetup.“Purchase VAT Account”, VATEntry,NewVATEntry); END ELSE BEGIN VATEntry.TESTFIELD(“Tax Jurisdiction Code”); TaxJurisdiction.GET(VATEntry.“Tax Jurisdiction Code”); TaxJurisdiction.TESTFIELD(“Unreal. Tax Acc. (Purchases)”); TaxJurisdiction.TESTFIELD(“Tax Account (Purchases)”); PostUnrealVATByUnapply( TaxJurisdiction.“Unreal. Tax Acc. (Purchases)”, TaxJurisdiction.“Tax Account (Purchases)”, VATEntry,NewVATEntry); END; END; END; //new line UNTIL VATEntry.NEXT = 0; Saluti, Claudio Aldini

grazie per la soluzione: precisamente in quale punto della funzione devo aggiungere queste righe di codice? ciao e grazie ancora[8)]