Fresco fresco da Microsoft:
correzione al report 12100 degli elenchi clienti e fornitori rilasciato con le CDCR33026 e CDCR33027 che risolvono la gestione delle note di credito riferite a fatture registrate l’anno precedente.
Per ricapitolare applica questa correzione se hai installato le i seguenti oggetti:
1- Elenchi clienti e fornitori CDCR 28874 per la vesione 5.0 e CDCR 28953 per la vesrione 4.0 SP3
2- Gestione note di credito anno precedente CDCR 33027 per la versione 5.0 e CDCR 33026 per la versione 4.0 SP3
La correzione, che va bene per entrambi le versioni, è la seguente:
Report 12100
Trigger CalculateField2(VATCustVendSet
up2 : Record “VAT Cust. and Vend. List Setup”;VATRegistrationNo : Text[20];FromDate2 : Date;ToDate2 : Datep
Old code 1
…
VATEntry.SETRANGE(“CM Previous Year”,FALSE);
VATEntry2.SETCURRENTKEY(Type, “VAT Registration No.”, “Document Type”, “VAT Bus. Posting Group”,“VAT Prod. Posting Group”,
“Document Date”);
IF VATCustVendSetup2.Sign = VATCustVendSetup2.Sign::“Only Negative Amounts” THEN BEGIN//old line
VATEntry2.SETFILTER(Type, ‘%1’, VATCustVendSetup2.“Posting Type Filter”);
VATEntry2.SETFILTER(“VAT Registration No.”, ‘%1’, VATRegistrationNo);
VATEntry2.SETFILTER(“VAT Bus. Posting Group”, VATCustVendSetup2.“VAT Bus. Posting Group Filter”);
…
new code 1
…
VATEntry.SETRANGE(“CM Previous Year”,FALSE);
VATEntry2.SETCURRENTKEY(Type, “VAT Registration No.”, “Document Type”, “VAT Bus. Posting Group”,“VAT Prod. Posting Group”,
“Document Date”);
IF (VATCustVendSetup2.Sign = VATCustVendSetup2.Sign::“Only Negative Amounts”)//new line
OR (VATCustVendSetup2.Sign = VATCustVendSetup2.Sign::Both) THEN BEGIN//new line
VATEntry2.SETFILTER(Type, ‘%1’, VATCustVendSetup2.“Posting Type Filter”);
VATEntry2.SETFILTER(“VAT Registration No.”, ‘%1’, VATRegistrationNo);
VATEntry2.SETFILTER(“VAT Bus. Posting Group”, VATCustVendSetup2.“VAT Bus. Posting Group Filter”);
…
CASE VATCustVendSetup2.“Amount Type Filter” OF
VATCustVendSetup2.“Amount Type Filter”::Base:
BEGIN
VATEntry.CALCSUMS(Base,“Undeductable Base”,“Unrealized Base”);//old line
IF VATCustVendSetup2.Sign = VATCustVendSetup2.Sign::“Only Negative Amounts” THEN//old line
VATEntry2.CALCSUMS(Base,“Undeductable Base”,“Unrealized Base”);
IF VATCustVendSetup2.“Posting Type Filter”=VATCustVendSetup2.“Posting Type Filter”::Sale THEN
EXIT((ROUND(VATEntry.Base + VATEntry.“Undeductable Base” + VATEntry.“Unrealized Base”, 1, ‘=’)
…
New code 2
…
CASE VATCustVendSetup2.“Amount Type Filter” OF
VATCustVendSetup2.“Amount Type Filter”::Base:
BEGIN
IF (VATCustVendSetup2.Sign = VATCustVendSetup2.Sign::“Only Positive Amounts”)//new line
OR (VATCustVendSetup2.Sign = VATCustVendSetup2.Sign::Both) THEN //new line
VATEntry.CALCSUMS(Base,“Undeductable Base”,“Unrealized Base”); //new line
IF (VATCustVendSetup2.Sign = VATCustVendSetup2.Sign::“Only Negative Amounts”) //new line
OR (VATCustVendSetup2.Sign = VATCustVendSetup2.Sign::Both) THEN //new line
VATEntry2.CALCSUMS(Base,“Undeductable Base”,“Unrealized Base”);
IF VATCustVendSetup2.“Posting Type Filter”=VATCustVendSetup2.“Posting Type Filter”::Sale THEN
EXIT((ROUND(VATEntry.Base + VATEntry.“Undeductable Base” + VATEntry.“Unrealized Base”, 1, ‘=’)
…
old code 3
…
VATCustVendSetup2.“Amount Type Filter”::Amount:
BEGIN
VATEntry.CALCSUMS(Amount,“Undeductable Amount”,“Unrealized Amount”); //old line
IF VATCustVendSetup2.Sign = VATCustVendSetup2.Sign::“Only Negative Amounts” THEN //old line
VATEntry2.CALCSUMS(Amount,“Undeductable Amount”,“Unrealized Amount”);
IF VATCustVendSetup2.“Posting Type Filter”=VATCustVendSetup2.“Posting Type Filter”::Sale THEN
…
new code 3
…
VATCustVendSetup2.“Amount Type Filter”::Amount:
BEGIN
IF (VATCustVendSetup2.Sign = VATCustVendSetup2.Sign::“Only Positive Amounts”)//new line
OR (VATCustVendSetup2.Sign = VATCustVendSetup2.Sign::Both) THEN//new line
VATEntry.CALCSUMS(Amount,“Undeductable Amount”,“Unrealized Amount”); //new line
IF (VATCustVendSetup2.Sign = VATCustVendSetup2.Sign::“Only Negative Amounts”) //new line
OR (VATCustVendSetup2.Sign = VATCustVendSetup2.Sign::Both) THEN //new line
VATEntry2.CALCSUMS(Amount,“Undeductable Amount”,“Unrealized Amount”);
IF VATCustVendSetup2.“Posting Type Filter”=VATCustVendSetup2.“Posting Type Filter”::Sale THEN
…
old code 4
…
VATCustVendSetup2.“Amount Type Filter”::Both:
BEGIN
VATEntry.CALCSUMS(Base, Amount,“Undeductable Base”,“Undeductable Amount”,“Unrealized Base”,“Unrealized Amount”);//old line
IF VATCustVendSetup2.Sign = VATCustVendSetup2.Sign::“Only Negative Amounts” THEN//old line
VATEntry2.CALCSUMS(Base, Amount,“Undeductable Base”,“Undeductable Amount”,“Unrealized Base”,“Unrealized Amount”);
IF VATCustVendSetup2.“Posting Type Filter”=VATCustVendSetup2.“Posting Type Filter”::Sale THEN
…
new code 4
…
VATCustVendSetup2.“Amount Type Filter”::Both:
BEGIN
//VATEntry.CALCSUMS(Base, Amount,“Undeductable Base”,“Undeductable Amount”,“Unrealized Base”,“Unrealized Amount”);//old line
//IF VATCustVendSetup2.Sign = VATCustVendSetup2.Sign::“Only Negative Amounts” THEN//old line
IF (VATCustVendSetup2.Sign = VATCustVendSetup2.Sign::“Only Positive Amounts”) //new line
OR (VATCustVendSetup2.Sign = VATCustVendSetup2.Sign::Both) THEN //new line
VATEntry.CALCSUMS(Base, Amount,“Undeductable Base”,“Undeductable Amount”,“Unrealized Base”,“Unrealized Amount”);//new line
IF (VATCustVendSetup2.Sign = VATCustVendSetup2.Sign::“Only Negative Amounts”)//new line
OR (VATCustVendSetup2.Sign = VATCustVendSetup2.Sign::Both) THEN //new line
VATEntry2.CALCSUMS(Base, Amount,“Undeductable Base”,“Undeductable Amount”,“Unrealized Base”,“Unrealized Amount”);
IF VATCustVendSetup2.“Posting Type Filter”=VATCustVendSetup2.“Posting Type Filter”::Sale THEN
…