diff --git a/build/PATCHDEF.EXE b/build/PATCHDEF.EXE index decf8831c..0f9b02344 100644 Binary files a/build/PATCHDEF.EXE and b/build/PATCHDEF.EXE differ diff --git a/build/fastrip.exe b/build/fastrip.exe index 579752d23..442af1c5a 100644 Binary files a/build/fastrip.exe and b/build/fastrip.exe differ diff --git a/cd/test/ba0792.txt b/cd/test/ba0792.txt new file mode 100644 index 000000000..94f616bfd --- /dev/null +++ b/cd/test/ba0792.txt @@ -0,0 +1,3 @@ +ba1.exe + +Corretta numerazione moduli diff --git a/cd/test/ba0792a.ini b/cd/test/ba0792a.ini new file mode 100644 index 000000000..1bd8537be --- /dev/null +++ b/cd/test/ba0792a.ini @@ -0,0 +1,34 @@ +[Main] +Demo=0 + +[ba1] +Edit_4 = ba3 -0 +Edit_5 = ba3 -0 +Edit_6 = ba4 -1 +File(477) = ba1.exe|X +Patch = 0792 +Versione = 21511200 + +[ba99] +Kill(0) = wxmsw240.dll|x +Kill(1) = batbsce.txt|x +Kill(2) = bastfsc.rep|x +Kill(3) = bastfsc.msk|x +Kill(4) = bastcms.msk|x +Kill(5) = bastcms.rep|x +Kill(6) = bastuue.rep|x +Kill(7) = bastuue.msk|x + +[ba] +Data = 21-05-2019 +Descrizione = Base +Dischi = 1 +Moduli = sy +OEM = +Patch = 792 +PostProcess = bainst -0 BA +PreProcess = +Prezzo(1) = +Prezzo(2) = +Versione = 21511200 + diff --git a/cd/test/ba0792a1.zip b/cd/test/ba0792a1.zip new file mode 100644 index 000000000..aa701cded Binary files /dev/null and b/cd/test/ba0792a1.zip differ diff --git a/cd/test/ba0794.txt b/cd/test/ba0794.txt new file mode 100644 index 000000000..ea7dcbcd4 --- /dev/null +++ b/cd/test/ba0794.txt @@ -0,0 +1,5 @@ +recdesc\f20.trr +recdesc\f20.dir + +Issue #33 +Aumentata a 80 caratteri la lunghezza del campo PEC \ No newline at end of file diff --git a/cd/test/ba0794a.ini b/cd/test/ba0794a.ini new file mode 100644 index 000000000..6fa20adbf --- /dev/null +++ b/cd/test/ba0794a.ini @@ -0,0 +1,32 @@ +[Main] +Demo=0 + +[ba2] +File(366) = recdesc\f20.dir|X +File(367) = recdesc\f20.trr|X +Patch = 0794 +Versione = 21511200 + +[ba99] +Kill(0) = batbsce.txt|x +Kill(1) = wxmsw240.dll|x +Kill(2) = bastcms.rep|x +Kill(3) = bastcms.msk|x +Kill(4) = bastfsc.msk|x +Kill(5) = bastfsc.rep|x +Kill(6) = bastuue.msk|x +Kill(7) = bastuue.rep|x + +[ba] +Data = 21-05-2019 +Descrizione = Base +Dischi = 1 +Moduli = sy +OEM = +Patch = 794 +PostProcess = bainst -0 BA +PreProcess = +Prezzo(1) = +Prezzo(2) = +Versione = 21511200 + diff --git a/cd/test/ba0794a1.zip b/cd/test/ba0794a1.zip new file mode 100644 index 000000000..c2300e129 Binary files /dev/null and b/cd/test/ba0794a1.zip differ diff --git a/cd/test/ba0804.txt b/cd/test/ba0804.txt new file mode 100644 index 000000000..30fc7329c --- /dev/null +++ b/cd/test/ba0804.txt @@ -0,0 +1,4 @@ +recdesc\f23.trr +recdesc\f23.dir + +Eliminato campo protocollo fppro che non serviva diff --git a/cd/test/ba0804a.ini b/cd/test/ba0804a.ini new file mode 100644 index 000000000..300609e8d --- /dev/null +++ b/cd/test/ba0804a.ini @@ -0,0 +1,32 @@ +[Main] +Demo=0 + +[ba2] +File(372) = recdesc\f23.dir|X +File(373) = recdesc\f23.trr|X +Patch = 0804 +Versione = 21511200 + +[ba99] +Kill(0) = wxmsw240.dll|x +Kill(1) = batbsce.txt|x +Kill(2) = bastfsc.rep|x +Kill(3) = bastfsc.msk|x +Kill(4) = bastcms.msk|x +Kill(5) = bastcms.rep|x +Kill(6) = bastuue.rep|x +Kill(7) = bastuue.msk|x + +[ba] +Data = 30-05-2019 +Descrizione = Base +Dischi = 1 +Moduli = sy +OEM = +Patch = 804 +PostProcess = bainst -0 BA +PreProcess = +Prezzo(1) = +Prezzo(2) = +Versione = 21511200 + diff --git a/cd/test/ba0804a1.zip b/cd/test/ba0804a1.zip new file mode 100644 index 000000000..c1aee4148 Binary files /dev/null and b/cd/test/ba0804a1.zip differ diff --git a/cd/test/cg0792.txt b/cd/test/cg0792.txt new file mode 100644 index 000000000..cff028a6a --- /dev/null +++ b/cd/test/cg0792.txt @@ -0,0 +1,3 @@ +cg2.exe + +Corretta numerazione moduli diff --git a/cd/test/cg0792a.ini b/cd/test/cg0792a.ini new file mode 100644 index 000000000..0de8e7cf2 --- /dev/null +++ b/cd/test/cg0792a.ini @@ -0,0 +1,94 @@ +[Main] +Demo=0 + +[cg2] +Edit_23 = cg2 -0 +File(153) = cg2.exe|X +Patch = 0792 +Versione = 21511200 + +[cg99] +Kill(0) = batbcam.msk|x +Kill(1) = batbesc.msk|x +Kill(2) = batblia.msk|x +Kill(3) = bastpor.msk|x +Kill(4) = bastcve.msk|x +Kill(5) = batbins.msk|x +Kill(6) = bastmsp.rep|x +Kill(7) = bastivd.msk|x +Kill(8) = bastleg.msk|x +Kill(9) = batbscc.msk|x +Kill(10) = bastscc.msk|x +Kill(11) = bastcco.rep|x +Kill(12) = batbcco.msk|x +Kill(13) = batbind.msk|x +Kill(14) = batblia.msk|x +Kill(15) = bastpor.rep|x +Kill(16) = batbleg.msk|x +Kill(17) = batbntb.msk|x +Kill(18) = batbtit.msk|x +Kill(19) = batbivd.msk|x +Kill(20) = bastcco.msk|x +Kill(21) = bastnot.msk|x +Kill(22) = batbdpn.msk|x +Kill(23) = bastver.msk|x +Kill(24) = bastscc.rep|x +Kill(25) = bastcfi.rep|x +Kill(26) = batbtra.msk|x +Kill(27) = batbndo.msk|x +Kill(28) = bastndo.msk|x +Kill(29) = bastcam.msk|x +Kill(30) = bastleg.rep|x +Kill(31) = bastivd.rep|x +Kill(32) = batblbu.msk|x +Kill(33) = batbver.msk|x +Kill(34) = batbzon.msk|x +Kill(35) = batbcve.msk|x +Kill(36) = bastdpn.msk|x +Kill(37) = bastzon.rep|x +Kill(38) = bastver.rep|x +Kill(39) = bastarb.msk|x +Kill(40) = batbmsp.msk|x +Kill(41) = cgtbcon.msk|x +Kill(42) = bastdpn.rep|x +Kill(43) = batbdel.msk|x +Kill(44) = batbinl.msk|x +Kill(45) = bastvet.rep|x +Kill(46) = bastreg.msk|x +Kill(47) = batbreg.msk|x +Kill(48) = bastarb.rep|x +Kill(49) = bastreg.rep|x +Kill(50) = bastntb.msk|x +Kill(51) = batbcfi.msk|x +Kill(52) = batbnot.msk|x +Kill(53) = bastcfi.msk|x +Kill(54) = batbpdb.msk|x +Kill(55) = bastesc.rep|x +Kill(56) = bastnot.rep|x +Kill(57) = bastpdb.rep|x +Kill(58) = batbpor.msk|x +Kill(59) = bastcam.rep|x +Kill(60) = bastcve.rep|x +Kill(61) = bastzon.msk|x +Kill(62) = bastvet.msk|x +Kill(63) = bastntb.rep|x +Kill(64) = bastndo.rep|x +Kill(65) = batbarb.msk|x +Kill(66) = bastmsp.msk|x +Kill(67) = bastpdb.msk|x +Kill(68) = batbvet.msk|x +Kill(69) = bastesc.msk|x + +[cg] +Data = 21-05-2019 +Descrizione = Contabilita' Generale +Dischi = 1 +Moduli = ba +OEM = +Patch = 792 +PostProcess = bainst -0 CG +PreProcess = +Prezzo(1) = +Prezzo(2) = +Versione = 21511200 + diff --git a/cd/test/cg0792a1.zip b/cd/test/cg0792a1.zip new file mode 100644 index 000000000..34e3dfce7 Binary files /dev/null and b/cd/test/cg0792a1.zip differ diff --git a/cd/test/cg0794.txt b/cd/test/cg0794.txt new file mode 100644 index 000000000..912052cdd --- /dev/null +++ b/cd/test/cg0794.txt @@ -0,0 +1,4 @@ +cg0200a.msk + +Issue #33 +Aumentata a 80 caratteri la lunghezza del campo PEC \ No newline at end of file diff --git a/cd/test/cg0794a.ini b/cd/test/cg0794a.ini new file mode 100644 index 000000000..ba549b856 --- /dev/null +++ b/cd/test/cg0794a.ini @@ -0,0 +1,97 @@ +[Main] +Demo=0 + +[cg9] +Edit_19 = cg0 -0 +Edit_20 = cg0 -1 +Edit_26 = cg0 -4 +Edit_5 = cg0 -5 +File(181) = cg0200a.msk|X +Patch = 794 +Versione = 21511200 + +[cg99] +Kill(0) = batbivd.msk|x +Kill(1) = bastcfi.rep|x +Kill(2) = bastivd.rep|x +Kill(3) = batbtit.msk|x +Kill(4) = bastscc.rep|x +Kill(5) = bastleg.rep|x +Kill(6) = batbndo.msk|x +Kill(7) = batbver.msk|x +Kill(8) = batbtra.msk|x +Kill(9) = batblbu.msk|x +Kill(10) = bastpor.rep|x +Kill(11) = bastnot.msk|x +Kill(12) = batblia.msk|x +Kill(13) = bastcco.msk|x +Kill(14) = batbntb.msk|x +Kill(15) = bastver.msk|x +Kill(16) = batbleg.msk|x +Kill(17) = batbdpn.msk|x +Kill(18) = bastcco.rep|x +Kill(19) = bastscc.msk|x +Kill(20) = batbind.msk|x +Kill(21) = batbcco.msk|x +Kill(22) = bastcam.rep|x +Kill(23) = batbarb.msk|x +Kill(24) = batbpor.msk|x +Kill(25) = bastndo.rep|x +Kill(26) = bastpdb.msk|x +Kill(27) = bastmsp.msk|x +Kill(28) = bastreg.rep|x +Kill(29) = bastesc.rep|x +Kill(30) = bastzon.msk|x +Kill(31) = bastarb.rep|x +Kill(32) = batbpdb.msk|x +Kill(33) = bastcve.rep|x +Kill(34) = bastpdb.rep|x +Kill(35) = bastntb.rep|x +Kill(36) = bastnot.rep|x +Kill(37) = bastvet.msk|x +Kill(38) = bastarb.msk|x +Kill(39) = bastvet.rep|x +Kill(40) = batbcfi.msk|x +Kill(41) = bastver.rep|x +Kill(42) = batbinl.msk|x +Kill(43) = bastntb.msk|x +Kill(44) = batbreg.msk|x +Kill(45) = bastcfi.msk|x +Kill(46) = bastreg.msk|x +Kill(47) = batbnot.msk|x +Kill(48) = bastcam.msk|x +Kill(49) = batbcve.msk|x +Kill(50) = cgtbcon.msk|x +Kill(51) = bastndo.msk|x +Kill(52) = batbzon.msk|x +Kill(53) = batbmsp.msk|x +Kill(54) = bastzon.rep|x +Kill(55) = batbdel.msk|x +Kill(56) = bastdpn.msk|x +Kill(57) = bastdpn.rep|x +Kill(58) = bastesc.msk|x +Kill(59) = batbvet.msk|x +Kill(60) = batbscc.msk|x +Kill(61) = bastleg.msk|x +Kill(62) = batbesc.msk|x +Kill(63) = batbcam.msk|x +Kill(64) = batbins.msk|x +Kill(65) = bastcve.msk|x +Kill(66) = bastpor.msk|x +Kill(67) = batblia.msk|x +Kill(68) = bastivd.msk|x +Kill(69) = bastmsp.rep|x + +[cg] +Data = 21-05-2019 +Descrizione = Contabilita' Generale +Dischi = 1 +Moduli = ba +OEM = +Patch = 794 +PostProcess = bainst -0 CG +PreProcess = +Prezzo(1) = +Prezzo(2) = +Versione = 21511200 + diff --git a/cd/test/cg0794a1.zip b/cd/test/cg0794a1.zip new file mode 100644 index 000000000..f7b55cc45 Binary files /dev/null and b/cd/test/cg0794a1.zip differ diff --git a/cd/test/cg0796.txt b/cd/test/cg0796.txt new file mode 100644 index 000000000..ab51b8ff7 --- /dev/null +++ b/cd/test/cg0796.txt @@ -0,0 +1,3 @@ +cg4.exe + +Corretta gestione del reverse charge non veniva più tolto dal volume d'affari \ No newline at end of file diff --git a/cd/test/cg0796a.ini b/cd/test/cg0796a.ini new file mode 100644 index 000000000..03a3bd349 --- /dev/null +++ b/cd/test/cg0796a.ini @@ -0,0 +1,93 @@ +[Main] +Demo=0 + +[cg1] +File(30) = cg4.exe|X +Patch = 0796 +Versione = 21511200 + +[cg99] +Kill(0) = bastscc.msk|x +Kill(1) = bastndo.rep|x +Kill(2) = bastarb.rep|x +Kill(3) = bastcco.rep|x +Kill(4) = batbpor.msk|x +Kill(5) = bastzon.msk|x +Kill(6) = bastmsp.msk|x +Kill(7) = bastcve.rep|x +Kill(8) = bastpdb.msk|x +Kill(9) = batbpdb.msk|x +Kill(10) = bastver.msk|x +Kill(11) = batbcco.msk|x +Kill(12) = batbntb.msk|x +Kill(13) = batbind.msk|x +Kill(14) = batbdpn.msk|x +Kill(15) = batbarb.msk|x +Kill(16) = batbleg.msk|x +Kill(17) = bastcam.rep|x +Kill(18) = bastnot.msk|x +Kill(19) = bastpor.rep|x +Kill(20) = bastcco.msk|x +Kill(21) = batblia.msk|x +Kill(22) = batbvet.msk|x +Kill(23) = bastcve.msk|x +Kill(24) = bastesc.msk|x +Kill(25) = batbins.msk|x +Kill(26) = batblia.msk|x +Kill(27) = bastpor.msk|x +Kill(28) = batbcve.msk|x +Kill(29) = batbdel.msk|x +Kill(30) = bastleg.msk|x +Kill(31) = bastcam.msk|x +Kill(32) = bastzon.rep|x +Kill(33) = batbscc.msk|x +Kill(34) = bastdpn.rep|x +Kill(35) = batbcam.msk|x +Kill(36) = bastdpn.msk|x +Kill(37) = batbesc.msk|x +Kill(38) = bastvet.rep|x +Kill(39) = bastcfi.msk|x +Kill(40) = bastndo.msk|x +Kill(41) = bastarb.msk|x +Kill(42) = batbreg.msk|x +Kill(43) = cgtbcon.msk|x +Kill(44) = batbnot.msk|x +Kill(45) = batbmsp.msk|x +Kill(46) = bastreg.msk|x +Kill(47) = batbzon.msk|x +Kill(48) = bastesc.rep|x +Kill(49) = bastntb.rep|x +Kill(50) = bastver.rep|x +Kill(51) = bastreg.rep|x +Kill(52) = bastpdb.rep|x +Kill(53) = batbcfi.msk|x +Kill(54) = bastvet.msk|x +Kill(55) = bastntb.msk|x +Kill(56) = bastnot.rep|x +Kill(57) = batbinl.msk|x +Kill(58) = bastmsp.rep|x +Kill(59) = bastivd.msk|x +Kill(60) = batblbu.msk|x +Kill(61) = batbtra.msk|x +Kill(62) = bastcfi.rep|x +Kill(63) = batbivd.msk|x +Kill(64) = bastleg.rep|x +Kill(65) = bastscc.rep|x +Kill(66) = batbtit.msk|x +Kill(67) = bastivd.rep|x +Kill(68) = batbver.msk|x +Kill(69) = batbndo.msk|x + +[cg] +Data = 21-05-2019 +Descrizione = Contabilita' Generale +Dischi = 1 +Moduli = ba +OEM = +Patch = 796 +PostProcess = bainst -0 CG +PreProcess = +Prezzo(1) = +Prezzo(2) = +Versione = 21511200 + diff --git a/cd/test/cg0796a1.zip b/cd/test/cg0796a1.zip new file mode 100644 index 000000000..ce78896a4 Binary files /dev/null and b/cd/test/cg0796a1.zip differ diff --git a/cd/test/cg0798.txt b/cd/test/cg0798.txt new file mode 100644 index 000000000..95204f27d --- /dev/null +++ b/cd/test/cg0798.txt @@ -0,0 +1,4 @@ +cg2.exe + +Aggiunto controllo su data operazione maggiore della data di inizio fatturazione elettronica +Modifica modaut diff --git a/cd/test/cg0798a.ini b/cd/test/cg0798a.ini new file mode 100644 index 000000000..6fd0da056 --- /dev/null +++ b/cd/test/cg0798a.ini @@ -0,0 +1,94 @@ +[Main] +Demo=0 + +[cg2] +Edit_23 = cg2 -0 +File(153) = cg2.exe|X +Patch = 0798 +Versione = 21511200 + +[cg99] +Kill(0) = bastver.msk|x +Kill(1) = bastleg.rep|x +Kill(2) = bastesc.rep|x +Kill(3) = batbcco.msk|x +Kill(4) = bastmsp.rep|x +Kill(5) = batbtra.msk|x +Kill(6) = batbtit.msk|x +Kill(7) = batblbu.msk|x +Kill(8) = bastivd.rep|x +Kill(9) = bastvet.msk|x +Kill(10) = bastcve.msk|x +Kill(11) = batbntb.msk|x +Kill(12) = bastcam.rep|x +Kill(13) = batbind.msk|x +Kill(14) = batbvet.msk|x +Kill(15) = bastscc.rep|x +Kill(16) = batbleg.msk|x +Kill(17) = bastivd.msk|x +Kill(18) = batblia.msk|x +Kill(19) = batbarb.msk|x +Kill(20) = bastcco.msk|x +Kill(21) = batbdpn.msk|x +Kill(22) = batbver.msk|x +Kill(23) = batbpor.msk|x +Kill(24) = batbndo.msk|x +Kill(25) = bastzon.msk|x +Kill(26) = bastarb.rep|x +Kill(27) = bastcco.rep|x +Kill(28) = batbcam.msk|x +Kill(29) = cgtbcon.msk|x +Kill(30) = bastpdb.msk|x +Kill(31) = batbdel.msk|x +Kill(32) = batbesc.msk|x +Kill(33) = batbpdb.msk|x +Kill(34) = batbreg.msk|x +Kill(35) = bastscc.msk|x +Kill(36) = bastdpn.msk|x +Kill(37) = bastndo.rep|x +Kill(38) = batbmsp.msk|x +Kill(39) = batbcfi.msk|x +Kill(40) = batbcve.msk|x +Kill(41) = bastcfi.msk|x +Kill(42) = batbzon.msk|x +Kill(43) = bastarb.msk|x +Kill(44) = bastpdb.rep|x +Kill(45) = bastndo.msk|x +Kill(46) = bastreg.msk|x +Kill(47) = bastdpn.rep|x +Kill(48) = bastntb.msk|x +Kill(49) = batbivd.msk|x +Kill(50) = bastvet.rep|x +Kill(51) = bastntb.rep|x +Kill(52) = batbinl.msk|x +Kill(53) = bastreg.rep|x +Kill(54) = bastcfi.rep|x +Kill(55) = bastver.rep|x +Kill(56) = bastnot.rep|x +Kill(57) = batbnot.msk|x +Kill(58) = bastmsp.msk|x +Kill(59) = bastcve.rep|x +Kill(60) = bastzon.rep|x +Kill(61) = batblia.msk|x +Kill(62) = batbins.msk|x +Kill(63) = bastpor.rep|x +Kill(64) = bastleg.msk|x +Kill(65) = bastesc.msk|x +Kill(66) = bastnot.msk|x +Kill(67) = bastcam.msk|x +Kill(68) = batbscc.msk|x +Kill(69) = bastpor.msk|x + +[cg] +Data = 27-05-2019 +Descrizione = Contabilita' Generale +Dischi = 1 +Moduli = ba +OEM = +Patch = 798 +PostProcess = bainst -0 CG +PreProcess = +Prezzo(1) = +Prezzo(2) = +Versione = 21511200 + diff --git a/cd/test/cg0798a1.zip b/cd/test/cg0798a1.zip new file mode 100644 index 000000000..f009c7050 Binary files /dev/null and b/cd/test/cg0798a1.zip differ diff --git a/cd/test/cg0800.txt b/cd/test/cg0800.txt new file mode 100644 index 000000000..930fba315 --- /dev/null +++ b/cd/test/cg0800.txt @@ -0,0 +1,4 @@ +cg5500b.msk +cg5.exe + +Spostata la colonna iva a credito o debito nella seconda colonna nella visualizzazione liquidazione \ No newline at end of file diff --git a/cd/test/cg0800a.ini b/cd/test/cg0800a.ini new file mode 100644 index 000000000..8e27a34b7 --- /dev/null +++ b/cd/test/cg0800a.ini @@ -0,0 +1,94 @@ +[Main] +Demo=0 + +[cg1] +File(53) = cg5.exe|X +File(62) = cg5500b.msk|X +Patch = 800 +Versione = 21511200 + +[cg99] +Kill(0) = bastcve.msk|x +Kill(1) = bastleg.msk|x +Kill(2) = bastntb.msk|x +Kill(3) = batbntb.msk|x +Kill(4) = bastmsp.msk|x +Kill(5) = batblia.msk|x +Kill(6) = bastnot.msk|x +Kill(7) = bastzon.rep|x +Kill(8) = bastcam.msk|x +Kill(9) = bastcfi.rep|x +Kill(10) = batbpor.msk|x +Kill(11) = bastcam.rep|x +Kill(12) = bastivd.msk|x +Kill(13) = batbind.msk|x +Kill(14) = batbver.msk|x +Kill(15) = bastesc.msk|x +Kill(16) = batbleg.msk|x +Kill(17) = bastcve.rep|x +Kill(18) = batbdpn.msk|x +Kill(19) = bastscc.rep|x +Kill(20) = bastcco.msk|x +Kill(21) = batbvet.msk|x +Kill(22) = batbscc.msk|x +Kill(23) = bastmsp.rep|x +Kill(24) = bastpor.msk|x +Kill(25) = batbtra.msk|x +Kill(26) = bastesc.rep|x +Kill(27) = batbcco.msk|x +Kill(28) = bastscc.msk|x +Kill(29) = bastarb.msk|x +Kill(30) = bastivd.rep|x +Kill(31) = cgtbcon.msk|x +Kill(32) = bastndo.rep|x +Kill(33) = bastvet.msk|x +Kill(34) = batbzon.msk|x +Kill(35) = bastver.msk|x +Kill(36) = bastdpn.msk|x +Kill(37) = bastleg.rep|x +Kill(38) = bastndo.msk|x +Kill(39) = bastreg.rep|x +Kill(40) = batbcam.msk|x +Kill(41) = batbcfi.msk|x +Kill(42) = bastdpn.rep|x +Kill(43) = bastcfi.msk|x +Kill(44) = batbinl.msk|x +Kill(45) = batbcve.msk|x +Kill(46) = bastreg.msk|x +Kill(47) = batbreg.msk|x +Kill(48) = bastver.rep|x +Kill(49) = bastpor.rep|x +Kill(50) = batbmsp.msk|x +Kill(51) = batbivd.msk|x +Kill(52) = batbnot.msk|x +Kill(53) = bastntb.rep|x +Kill(54) = batbins.msk|x +Kill(55) = bastvet.rep|x +Kill(56) = bastnot.rep|x +Kill(57) = bastpdb.rep|x +Kill(58) = batbtit.msk|x +Kill(59) = batblbu.msk|x +Kill(60) = batbesc.msk|x +Kill(61) = bastarb.rep|x +Kill(62) = bastzon.msk|x +Kill(63) = batbarb.msk|x +Kill(64) = bastpdb.msk|x +Kill(65) = batbndo.msk|x +Kill(66) = batblia.msk|x +Kill(67) = batbdel.msk|x +Kill(68) = batbpdb.msk|x +Kill(69) = bastcco.rep|x + +[cg] +Data = 27-05-2019 +Descrizione = Contabilita' Generale +Dischi = 1 +Moduli = ba +OEM = +Patch = 800 +PostProcess = bainst -0 CG +PreProcess = +Prezzo(1) = +Prezzo(2) = +Versione = 21511200 + diff --git a/cd/test/cg0800a1.zip b/cd/test/cg0800a1.zip new file mode 100644 index 000000000..d8c65ea98 Binary files /dev/null and b/cd/test/cg0800a1.zip differ diff --git a/cd/test/cg0802.txt b/cd/test/cg0802.txt new file mode 100644 index 000000000..4a232f2a9 --- /dev/null +++ b/cd/test/cg0802.txt @@ -0,0 +1,5 @@ +cg0800a.msk +cg0800a.rep +cg0.exe + +Ricompilato programma, maschera, report mancanti Stampa progressivi avanzata diff --git a/cd/test/cg0802a.ini b/cd/test/cg0802a.ini new file mode 100644 index 000000000..5d6c8c808 --- /dev/null +++ b/cd/test/cg0802a.ini @@ -0,0 +1,99 @@ +[Main] +Demo=0 + +[cg0] +Edit_19 = cg0 -0 +Edit_20 = cg0 -1 +Edit_26 = cg0 -4 +Edit_5 = cg0 -5 +File(0) = cg0.exe|X +File(8) = cg0800a.msk|X +File(9) = cg0800a.rep|X +Patch = 802 +Versione = 21511200 + +[cg99] +Kill(0) = bastesc.msk|x +Kill(1) = batblia.msk|x +Kill(2) = bastarb.msk|x +Kill(3) = batbvet.msk|x +Kill(4) = bastcco.rep|x +Kill(5) = bastcam.msk|x +Kill(6) = batbntb.msk|x +Kill(7) = bastcfi.rep|x +Kill(8) = bastntb.msk|x +Kill(9) = bastleg.rep|x +Kill(10) = batbndo.msk|x +Kill(11) = batbver.msk|x +Kill(12) = batbscc.msk|x +Kill(13) = bastcco.msk|x +Kill(14) = batblbu.msk|x +Kill(15) = bastmsp.msk|x +Kill(16) = batbleg.msk|x +Kill(17) = batbpdb.msk|x +Kill(18) = bastivd.msk|x +Kill(19) = bastmsp.rep|x +Kill(20) = batbind.msk|x +Kill(21) = bastcve.rep|x +Kill(22) = bastzon.rep|x +Kill(23) = bastpor.msk|x +Kill(24) = bastnot.msk|x +Kill(25) = bastivd.rep|x +Kill(26) = cgtbcon.msk|x +Kill(27) = batbdpn.msk|x +Kill(28) = batbarb.msk|x +Kill(29) = batbmsp.msk|x +Kill(30) = bastesc.rep|x +Kill(31) = bastvet.rep|x +Kill(32) = bastzon.msk|x +Kill(33) = bastndo.rep|x +Kill(34) = batbinl.msk|x +Kill(35) = bastscc.rep|x +Kill(36) = bastnot.rep|x +Kill(37) = batbtra.msk|x +Kill(38) = bastntb.rep|x +Kill(39) = batbcam.msk|x +Kill(40) = bastpor.rep|x +Kill(41) = batbcve.msk|x +Kill(42) = batbnot.msk|x +Kill(43) = bastndo.msk|x +Kill(44) = batbzon.msk|x +Kill(45) = batbivd.msk|x +Kill(46) = bastreg.msk|x +Kill(47) = bastpdb.rep|x +Kill(48) = bastcfi.msk|x +Kill(49) = bastcve.msk|x +Kill(50) = bastreg.rep|x +Kill(51) = bastver.msk|x +Kill(52) = bastdpn.rep|x +Kill(53) = bastscc.msk|x +Kill(54) = bastleg.msk|x +Kill(55) = batbcfi.msk|x +Kill(56) = bastdpn.msk|x +Kill(57) = batbreg.msk|x +Kill(58) = batbcco.msk|x +Kill(59) = bastvet.msk|x +Kill(60) = batbins.msk|x +Kill(61) = batbdel.msk|x +Kill(62) = bastpdb.msk|x +Kill(63) = batbpor.msk|x +Kill(64) = bastarb.rep|x +Kill(65) = batbtit.msk|x +Kill(66) = bastcam.rep|x +Kill(67) = bastver.rep|x +Kill(68) = batbesc.msk|x +Kill(69) = batblia.msk|x + +[cg] +Data = 28-05-2019 +Descrizione = Contabilita' Generale +Dischi = 1 +Moduli = ba +OEM = +Patch = 802 +PostProcess = bainst -0 CG +PreProcess = +Prezzo(1) = +Prezzo(2) = +Versione = 21511200 + diff --git a/cd/test/cg0802a1.zip b/cd/test/cg0802a1.zip new file mode 100644 index 000000000..635c98af1 Binary files /dev/null and b/cd/test/cg0802a1.zip differ diff --git a/cd/test/cg0804.txt b/cd/test/cg0804.txt new file mode 100644 index 000000000..1eb674070 --- /dev/null +++ b/cd/test/cg0804.txt @@ -0,0 +1,5 @@ +cg2.exe +cg2100c.msk + +Tolto codice protocollo dai movimenti, non serve +Periodo liquidazione precedente default gestito con f1 diff --git a/cd/test/cg0804a.ini b/cd/test/cg0804a.ini new file mode 100644 index 000000000..b9d6cad8b --- /dev/null +++ b/cd/test/cg0804a.ini @@ -0,0 +1,95 @@ +[Main] +Demo=0 + +[cg2] +Edit_23 = cg2 -0 +File(161) = cg2.exe|X +File(164) = cg2100c.msk|X +Patch = 0804 +Versione = 21511200 + +[cg99] +Kill(0) = bastmsp.rep|x +Kill(1) = bastivd.rep|x +Kill(2) = bastvet.rep|x +Kill(3) = bastivd.msk|x +Kill(4) = bastnot.msk|x +Kill(5) = bastesc.rep|x +Kill(6) = batbdpn.msk|x +Kill(7) = bastndo.rep|x +Kill(8) = cgtbcon.msk|x +Kill(9) = bastzon.msk|x +Kill(10) = bastmsp.msk|x +Kill(11) = bastcve.rep|x +Kill(12) = batblbu.msk|x +Kill(13) = batbind.msk|x +Kill(14) = batbpdb.msk|x +Kill(15) = bastpor.msk|x +Kill(16) = batbleg.msk|x +Kill(17) = bastzon.rep|x +Kill(18) = batbver.msk|x +Kill(19) = batbndo.msk|x +Kill(20) = bastcco.msk|x +Kill(21) = batbscc.msk|x +Kill(22) = bastvet.msk|x +Kill(23) = batbtit.msk|x +Kill(24) = batbcco.msk|x +Kill(25) = bastarb.rep|x +Kill(26) = bastver.rep|x +Kill(27) = bastcam.rep|x +Kill(28) = bastcve.msk|x +Kill(29) = batbcfi.msk|x +Kill(30) = batbdel.msk|x +Kill(31) = bastcfi.msk|x +Kill(32) = bastleg.msk|x +Kill(33) = batbins.msk|x +Kill(34) = batbreg.msk|x +Kill(35) = batbpor.msk|x +Kill(36) = bastdpn.msk|x +Kill(37) = bastpdb.msk|x +Kill(38) = batbcam.msk|x +Kill(39) = batbivd.msk|x +Kill(40) = bastver.msk|x +Kill(41) = bastntb.rep|x +Kill(42) = batbzon.msk|x +Kill(43) = bastreg.rep|x +Kill(44) = bastpdb.rep|x +Kill(45) = bastscc.msk|x +Kill(46) = bastreg.msk|x +Kill(47) = bastdpn.rep|x +Kill(48) = batbmsp.msk|x +Kill(49) = bastscc.rep|x +Kill(50) = batbcve.msk|x +Kill(51) = batbarb.msk|x +Kill(52) = batbinl.msk|x +Kill(53) = bastpor.rep|x +Kill(54) = batbtra.msk|x +Kill(55) = bastndo.msk|x +Kill(56) = bastnot.rep|x +Kill(57) = batbnot.msk|x +Kill(58) = batblia.msk|x +Kill(59) = batbesc.msk|x +Kill(60) = bastleg.rep|x +Kill(61) = bastntb.msk|x +Kill(62) = batblia.msk|x +Kill(63) = bastesc.msk|x +Kill(64) = bastcam.msk|x +Kill(65) = bastcco.rep|x +Kill(66) = batbvet.msk|x +Kill(67) = bastarb.msk|x +Kill(68) = bastcfi.rep|x +Kill(69) = batbntb.msk|x + +[cg] +Data = 30-05-2019 +Descrizione = Contabilita' Generale +Dischi = 1 +Moduli = ba +OEM = +Patch = 804 +PostProcess = bainst -0 CG +PreProcess = +Prezzo(1) = +Prezzo(2) = +Versione = 21511200 + diff --git a/cd/test/cg0804a1.zip b/cd/test/cg0804a1.zip new file mode 100644 index 000000000..fb00baa14 Binary files /dev/null and b/cd/test/cg0804a1.zip differ diff --git a/cd/test/ef0792.txt b/cd/test/ef0792.txt new file mode 100644 index 000000000..e7728a9ea --- /dev/null +++ b/cd/test/ef0792.txt @@ -0,0 +1,4 @@ +dc800000.frm +dse.frm + +Corretti form distinte codice cliente-fornitore diff --git a/cd/test/ef0792a.ini b/cd/test/ef0792a.ini new file mode 100644 index 000000000..edf99e472 --- /dev/null +++ b/cd/test/ef0792a.ini @@ -0,0 +1,29 @@ +[Main] +Demo=0 + +[ef1] +Edit_163 = ef0 -1 +Edit_5 = ef0 -6 +File(1) = dc800000.frm|X +File(4) = dse.frm|X +Patch = 0792 +Versione = 21511200 + +[ef99] +Kill(0) = eftbbnp.msk|x +Kill(1) = efstbnp.msk|x +Kill(2) = efstbnp.rep|x + +[ef] +Data = 21-05-2019 +Descrizione = Effetti +Dischi = 1 +Moduli = ve +OEM = +Patch = 792 +PostProcess = bainst -0 EF +PreProcess = +Prezzo(1) = +Prezzo(2) = +Versione = 21511200 + diff --git a/cd/test/ef0792a1.zip b/cd/test/ef0792a1.zip new file mode 100644 index 000000000..980a9cc44 Binary files /dev/null and b/cd/test/ef0792a1.zip differ diff --git a/cd/test/fp0792.txt b/cd/test/fp0792.txt new file mode 100644 index 000000000..b07b262da --- /dev/null +++ b/cd/test/fp0792.txt @@ -0,0 +1,3 @@ +fp0.exe + +Corretta numerazione moduli diff --git a/cd/test/fp0792a.ini b/cd/test/fp0792a.ini new file mode 100644 index 000000000..af70304cd --- /dev/null +++ b/cd/test/fp0792a.ini @@ -0,0 +1,19 @@ +[Main] +Demo=0 + +[fp1] +File(0) = fp0.exe|X +Patch = 0792 +Versione = 21511200 + +[fp] +Data = 21-05-2019 +Descrizione = Fattura Elettronica +Dischi = 1 +Moduli = cg,ve +OEM = +Patch = 792 +PostProcess = +PreProcess = +Versione = 21511200 + diff --git a/cd/test/fp0792a1.zip b/cd/test/fp0792a1.zip new file mode 100644 index 000000000..001e4d147 Binary files /dev/null and b/cd/test/fp0792a1.zip differ diff --git a/cd/test/fp0798.txt b/cd/test/fp0798.txt new file mode 100644 index 000000000..e9fdb1a57 --- /dev/null +++ b/cd/test/fp0798.txt @@ -0,0 +1,4 @@ +fp0.exe +fp0100a.msk + +Aggiunta data inizio periodo fatturazione elettronica in configurazione diff --git a/cd/test/fp0798a.ini b/cd/test/fp0798a.ini new file mode 100644 index 000000000..4906d70e2 --- /dev/null +++ b/cd/test/fp0798a.ini @@ -0,0 +1,20 @@ +[Main] +Demo=0 + +[fp1] +File(0) = fp0.exe|X +File(1) = fp0100a.msk|X +Patch = 798 +Versione = 21511200 + +[fp] +Data = 27-05-2019 +Descrizione = Fattura Elettronica +Dischi = 1 +Moduli = cg,ve +OEM = +Patch = 798 +PostProcess = +PreProcess = +Versione = 21511200 + diff --git a/cd/test/fp0798a1.zip b/cd/test/fp0798a1.zip new file mode 100644 index 000000000..33e3a698c Binary files /dev/null and b/cd/test/fp0798a1.zip differ diff --git a/cd/test/fp0802.txt b/cd/test/fp0802.txt new file mode 100644 index 000000000..93346b89a --- /dev/null +++ b/cd/test/fp0802.txt @@ -0,0 +1,4 @@ +fp0.exe + +(monitor passive - f1): Corretto messaggio dopo contabilizzazione +Corretta procedura aggiornamento fornitore diff --git a/cd/test/fp0802a.ini b/cd/test/fp0802a.ini new file mode 100644 index 000000000..e7b8d6ee2 --- /dev/null +++ b/cd/test/fp0802a.ini @@ -0,0 +1,19 @@ +[Main] +Demo=0 + +[fp1] +File(0) = fp0.exe|X +Patch = 0802 +Versione = 21511200 + +[fp] +Data = 28-05-2019 +Descrizione = Fattura Elettronica +Dischi = 1 +Moduli = cg,ve +OEM = +Patch = 802 +PostProcess = +PreProcess = +Versione = 21511200 + diff --git a/cd/test/fp0802a1.zip b/cd/test/fp0802a1.zip new file mode 100644 index 000000000..7b5ca8bc8 Binary files /dev/null and b/cd/test/fp0802a1.zip differ diff --git a/cd/test/fp0804.txt b/cd/test/fp0804.txt new file mode 100644 index 000000000..792d584f8 --- /dev/null +++ b/cd/test/fp0804.txt @@ -0,0 +1,7 @@ +fp0.exe +fp0400a.msk + +Aggiunto flag periodo liquidazione precedente default (f1) +Aggiunta a contabil. autom.: scadenze, importi e imponibili +Risolto problema visualizzazione massimo 4 righe log contabil. +Aggiunti num reg e prot iva in messaggio di log diff --git a/cd/test/fp0804a.ini b/cd/test/fp0804a.ini new file mode 100644 index 000000000..963f32b9c --- /dev/null +++ b/cd/test/fp0804a.ini @@ -0,0 +1,20 @@ +[Main] +Demo=0 + +[fp1] +File(0) = fp0.exe|X +File(4) = fp0400a.msk|X +Patch = 0804 +Versione = 21511200 + +[fp] +Data = 30-05-2019 +Descrizione = Fattura Elettronica +Dischi = 1 +Moduli = cg,ve +OEM = +Patch = 804 +PostProcess = +PreProcess = +Versione = 21511200 + diff --git a/cd/test/fp0804a1.zip b/cd/test/fp0804a1.zip new file mode 100644 index 000000000..e02178050 Binary files /dev/null and b/cd/test/fp0804a1.zip differ diff --git a/cd/test/lv0790.txt b/cd/test/lv0790.txt new file mode 100644 index 000000000..615aaf4c4 --- /dev/null +++ b/cd/test/lv0790.txt @@ -0,0 +1,5 @@ +lv0.exe +lv0600a.msk +lv0600a.rep + +Corretto report e programma per storico consegne lavanderie: andava a leggere un codice numerazione fisso e non quello della configurazione diff --git a/cd/test/lv0790a.ini b/cd/test/lv0790a.ini new file mode 100644 index 000000000..040f2a124 --- /dev/null +++ b/cd/test/lv0790a.ini @@ -0,0 +1,24 @@ +[Main] +Demo=0 + +[lv1] +Edit_168 = lv0 -3 +File(0) = lv0.exe|X +File(28) = lv0600a.msk|X +File(29) = lv0600a.rep|X +Patch = 0790 +Versione = 21511200 + +[lv] +Data = 20-05-2019 +Descrizione = Gestione lavanderie +Dischi = 1 +Moduli = ve,mg +OEM = 2 +Patch = 0790 +PostProcess = bainst -0 LV +PreProcess = +Prezzo(1) = +Prezzo(2) = +Versione = 21511200 + diff --git a/cd/test/lv0790a1.zip b/cd/test/lv0790a1.zip new file mode 100644 index 000000000..717fb62ee Binary files /dev/null and b/cd/test/lv0790a1.zip differ diff --git a/cd/test/sc0792.txt b/cd/test/sc0792.txt new file mode 100644 index 000000000..207d30bba --- /dev/null +++ b/cd/test/sc0792.txt @@ -0,0 +1,4 @@ +pec.frm + +Rifatta una patch. +Il campo 106 dell' (H)eader (O)dd è dati pagamento. \ No newline at end of file diff --git a/cd/test/sc0792a.ini b/cd/test/sc0792a.ini new file mode 100644 index 000000000..03c3fea6d --- /dev/null +++ b/cd/test/sc0792a.ini @@ -0,0 +1,21 @@ +[Main] +Demo=0 + +[sc1] +File(0) = pec.frm|X +Patch = 0792 +Versione = 21511200 + +[sc] +Data = 21-05-2019 +Descrizione = Saldaconto +Dischi = 1 +Moduli = +OEM = +Patch = 792 +PostProcess = +PreProcess = +Prezzo(1) = +Prezzo(2) = +Versione = 21511200 + diff --git a/cd/test/sc0792a1.zip b/cd/test/sc0792a1.zip new file mode 100644 index 000000000..94337e970 Binary files /dev/null and b/cd/test/sc0792a1.zip differ diff --git a/cd/test/sy0792.txt b/cd/test/sy0792.txt new file mode 100644 index 000000000..2fe87f313 --- /dev/null +++ b/cd/test/sy0792.txt @@ -0,0 +1,3 @@ +campo.aut + +Corretta numerazione moduli diff --git a/cd/test/sy0792a.ini b/cd/test/sy0792a.ini new file mode 100644 index 000000000..360ccea54 --- /dev/null +++ b/cd/test/sy0792a.ini @@ -0,0 +1,21 @@ +[Main] +Demo=0 + +[sy1] +File(36) = campo.aut|X +Patch = 0792 +Versione = 21511200 + +[sy] +Data = 21-05-2019 +Descrizione = Sistema +Dischi = 1 +Moduli = +OEM = +Patch = 792 +PostProcess = +PreProcess = +Prezzo(1) = +Prezzo(2) = +Versione = 21511200 + diff --git a/cd/test/sy0792a1.zip b/cd/test/sy0792a1.zip new file mode 100644 index 000000000..5b5272b8e Binary files /dev/null and b/cd/test/sy0792a1.zip differ diff --git a/cd/test/tf0794.txt b/cd/test/tf0794.txt new file mode 100644 index 000000000..82aae5b85 --- /dev/null +++ b/cd/test/tf0794.txt @@ -0,0 +1,4 @@ +tf0.exe +tf0200a.msk + +Aggiunto flag per elaborazione liquidazione IVA periodica seguendo la data competenza o no diff --git a/cd/test/tf0794a.ini b/cd/test/tf0794a.ini new file mode 100644 index 000000000..8a8b9c63e --- /dev/null +++ b/cd/test/tf0794a.ini @@ -0,0 +1,20 @@ +[Main] +Demo=0 + +[tf1] +File(0) = tf0.exe|X +File(2) = tf0200a.msk|X +Patch = 0794 +Versione = 21511200 + +[tf] +Data = 22-05-2019 +Descrizione = Trasferimento fatture +Dischi = 1 +Moduli = cg +OEM = +Patch = 794 +PostProcess = +PreProcess = +Versione = 21511200 + diff --git a/cd/test/tf0794a1.zip b/cd/test/tf0794a1.zip new file mode 100644 index 000000000..94b3a28b5 Binary files /dev/null and b/cd/test/tf0794a1.zip differ diff --git a/cd/test/tf0796.txt b/cd/test/tf0796.txt new file mode 100644 index 000000000..df901398a --- /dev/null +++ b/cd/test/tf0796.txt @@ -0,0 +1,5 @@ +tf0.exe +tf0200a.msk + +Aggiunta possibilità di registrare liquidazione IVA periodica utilizzando o no la data di competenza. +CON SCELTA DIVERSA PER ATTIVE E PASSIVE diff --git a/cd/test/tf0796a.ini b/cd/test/tf0796a.ini new file mode 100644 index 000000000..d266c96b9 --- /dev/null +++ b/cd/test/tf0796a.ini @@ -0,0 +1,20 @@ +[Main] +Demo=0 + +[tf1] +File(0) = tf0.exe|X +File(2) = tf0200a.msk|X +Patch = 0796 +Versione = 21511200 + +[tf] +Data = 23-05-2019 +Descrizione = Trasferimento fatture +Dischi = 1 +Moduli = cg +OEM = +Patch = 796 +PostProcess = +PreProcess = +Versione = 21511200 + diff --git a/cd/test/tf0796a1.zip b/cd/test/tf0796a1.zip new file mode 100644 index 000000000..42853e285 Binary files /dev/null and b/cd/test/tf0796a1.zip differ diff --git a/exe/campo.aut b/exe/campo.aut index 3de4122fa..0694d7dfe 100644 --- a/exe/campo.aut +++ b/exe/campo.aut @@ -35,7 +35,7 @@ or Ordini ef Effetti db Distinta Base pr Provvigioni Agenti -?? Modulo vario ex-cu Codice Unico Progetto +fp Fatturazione tra Privati + PA sv Statistiche di Vendita mr Manufacturing Resource Planning ?? Modulo vario ex-ec Collegamento E-commerce @@ -47,4 +47,6 @@ bs Bee Store ha Hardy Caffè ri Riclassificazioni gv Gestione versamenti -tf Trasferimento Fatture \ No newline at end of file +tf Trasferimento Fatture +f1 Cont. Fatture Passive Elettroniche F1 +f9 Archiviazione Sostitutiva \ No newline at end of file diff --git a/src/cg/cg0200a.uml b/src/cg/cg0200a.uml index 7b5ea37ad..032c2cb66 100755 --- a/src/cg/cg0200a.uml +++ b/src/cg/cg0200a.uml @@ -612,7 +612,7 @@ BEGIN CHECKTYPE REQUIRED END -STRING F_PEC 50 23 +STRING F_PEC 80 45 BEGIN PROMPT 2 9 "Pec " FIELD PEC diff --git a/src/cg/cg2100.cpp b/src/cg/cg2100.cpp index 2b401e498..fba63ae35 100755 --- a/src/cg/cg2100.cpp +++ b/src/cg/cg2100.cpp @@ -54,7 +54,7 @@ public: TPrimanota_application::TPrimanota_application() : _rel(NULL), _mode(0), _iva(nessuna_iva), _causale(NULL), _giornale(NULL), - _lastreg(0), _last_dreg(TODAY), _last_dcom(TODAY), _automatico(NULL), _swap_mask(false) + _lastreg(0), _last_dreg(TODAY), _last_dcom(TODAY), _automatico(NULL), _swap_mask(false), _is_set_fpcheck(false), _f1_ini(false), _f1_liq(false) { memset(_msk, 0, sizeof(_msk)); } @@ -125,7 +125,6 @@ TMask* TPrimanota_application::load_mask(int n) ism.set_handler(CG_RISCONTO, sheet_risconto_handler); if (!has_f1_db(m)) { - m->hide(F_PROTFPPRO); if (m->find_by_id(F_COLFPPRO) != NULL) m->hide(F_COLFPPRO); if(m->find_by_id(DLG_LINK) != NULL) @@ -226,6 +225,22 @@ TMask* TPrimanota_application::load_mask(int n) return m; } +void TPrimanota_application::check_f1_ini() +{ + for (int i = 0; i < argc(); i++) + { + TString arg(argv(i)); + if (arg.find("-f1") != -1) + { + _f1_ini = true; + } + if (arg.find("-liq") != -1) + { + _f1_liq = true; + } + } +} + bool TPrimanota_application::user_create() { open_files(LF_TABCOM, LF_TAB, LF_CAUSALI, LF_RCAUSALI, LF_CLIFO, LF_PCON, 0); @@ -252,7 +267,8 @@ bool TPrimanota_application::user_create() load_mask(0); load_colors(); - + check_f1_ini(); + return true; } @@ -665,6 +681,7 @@ void TPrimanota_application::init_mask(TMask& m) fill_sheet(m); // Riempe righe contabili coi conti della causale m.hide(F_LINKDOC); + set_has_f1_db(&m); } void TPrimanota_application::init_query_mode(TMask& m) @@ -703,6 +720,7 @@ void TPrimanota_application::init_query_mode(TMask& m) m.set(F_CODCAUS, ini.get(MOV_CODCAUS)); m.send_key(K_SPACE, DLG_NEWREC); } + set_has_f1_db(&m); } @@ -947,6 +965,18 @@ void TPrimanota_application::init_insert_mode(TMask& m) } } +void TPrimanota_application::f1_init_modify(TMask& m, const TRectype& mov) +{ + const bool after_data_inizio_fe = TDate(mov.get(MOV_DATADOC)) >= TDate(fp_settings().get_data_start_fatt()); + if (m.find_by_id(F_COLFPPRO) != NULL && after_data_inizio_fe) + m.set(F_COLFPPRO, mov.get(MOV_KEYFPPRO).empty() ? " " : "X"); + else if(m.find_by_id(F_COLFPPRO) != NULL && !after_data_inizio_fe) + { + m.field(F_COLFPPRO).hide(); + m.field(DLG_LINK).disable(); + } +} + void TPrimanota_application::init_modify_mode(TMask& m) { init_mask(m); // Inizializzazione standard @@ -1052,13 +1082,8 @@ void TPrimanota_application::init_modify_mode(TMask& m) m.enable(F_BOLLACODCLI, causale().tipo_doc() == "BD"); m.enable(F_BOLLARAGCLI, causale().tipo_doc() == "BD"); } - if(m.find_by_id(F_PROTFPPRO) != NULL && !m.field(F_PROTFPPRO).hidden()) - { - m.set(F_PROTFPPRO, mov.get(MOV_PROGFPPRO)); - m.set(F_COLFPPRO, mov.get(MOV_KEYFPPRO).empty() ? " " : "X"); - } - + f1_init_modify(m, mov); } // Controlla sulla causale se il segno del totale documento (ritsoc=false) @@ -1594,14 +1619,26 @@ void TPrimanota_application::clean_fppro() fp_db().sq_commit(); } +void TPrimanota_application::set_has_f1_db(TMask* m) +{ + if (m->find_by_id(F_DATAREG) != NULL && !m->get(F_DATAREG).empty()) + { + if (TDate(m->get(F_DATAREG)) >= TDate(fp_settings().get_data_start_fatt())) + _isfp = has_module(F1AUT) && !fp_settings().get_db_indirizzo().empty() && !fp_settings().is_f8(); + else + _isfp = false; + _is_set_fpcheck = true; + } + else if (!_is_set_fpcheck) + { + _isfp = false; + _is_set_fpcheck = true; + } +} + bool TPrimanota_application::has_f1_db(TMask* m) { - static bool is_set_fpcheck = false; - if (!is_set_fpcheck) - { - _isfp = has_module(F1AUT) && !fp_settings().get_db_indirizzo().empty() && !fp_settings().is_f8(); - is_set_fpcheck = true; - } + set_has_f1_db(m); return _isfp; } @@ -2019,203 +2056,212 @@ HIDDEN bool add_not_empty(TToken_string& str, int pos, TConfig& ini, const char* void TPrimanota_application::ini2mask(TConfig& ini, TMask& msk, bool query) { - TRelation_application::ini2mask(ini, msk, query); - if (query) - { - set_not_empty(msk, F_CODCAUS, ini, MOV_CODCAUS); - TString16 val = ini.get(MOV_DATAREG); - if (val.blank()) - { - const long numreg = ini.get_long(MOV_NUMREG); - if (numreg > 0) - { - TLocalisamfile& mov = _rel->file(); - mov.put(MOV_NUMREG, numreg); - if (mov.read() == NOERR) - val = mov.get(MOV_DATAREG); // Serve ad evitare segnalazioni su esercizi non esistenti - } - if (val.blank()) - val = TDate(TODAY).string(); - } - msk.set(F_DATAREG, val); - } - else - { - _as400 = false; - if (ini.set_paragraph("24,1")) - _as400 = !ini.exist(RMV_ROWTYPE) && ini.get_int(RMV_NUMRIG) == 1; + TRelation_application::ini2mask(ini, msk, query); + if (query) + { + set_not_empty(msk, F_CODCAUS, ini, MOV_CODCAUS); + TString16 val = ini.get(MOV_DATAREG); + if (val.blank()) + { + const long numreg = ini.get_long(MOV_NUMREG); + if (numreg > 0) + { + TLocalisamfile& mov = _rel->file(); + mov.put(MOV_NUMREG, numreg); + if (mov.read() == NOERR) + val = mov.get(MOV_DATAREG); // Serve ad evitare segnalazioni su esercizi non esistenti + } + if (val.blank()) + val = TDate(TODAY).string(); + } + msk.set(F_DATAREG, val); + } + else + { + _as400 = false; + if (ini.set_paragraph("24,1")) + _as400 = !ini.exist(RMV_ROWTYPE) && ini.get_int(RMV_NUMRIG) == 1; if (msk.id2pos(F_ANNORIF) > 0) set_not_empty(msk, F_ANNORIF, ini, PART_ANNO); if (msk.id2pos(F_NUMRIF) > 0) set_not_empty(msk, F_NUMRIF, ini, PART_NUMPART); - if (iva() != nessuna_iva) - { + if (iva() != nessuna_iva) + { if (msk.id2pos(F_SOLAIVA) >= 0 && ini.exist("SOLAIVA")) msk.set(F_SOLAIVA, ini.get("SOLAIVA")); if (msk.id2pos(F_CODIVA) >= 0) msk.set(F_CODIVA, ini.get("CODIVA")); - add_cgs_tot(msk); - - TSheet_field& is = ivas(); - for (int i = 0; ini.set_paragraph(LF_RMOVIVA, i+1); i++) - { - TToken_string& riga = is.row(i); - - iva_notify(is, i, K_SPACE); - add_not_empty(riga, 0, ini, RMI_IMPONIBILE); // Imponibile 101 - add_not_empty(riga, 1, ini, RMI_CODIVA); // IVA 102 - add_not_empty(riga, 2, ini, RMI_TIPODET); // Detrazione 103 - add_not_empty(riga, 3, ini, RMI_IMPOSTA); // Imposta 104 - - TBill c; ini2bill(ini, c, false); - if (c.gruppo() > 0) - c.add_to(riga, 4, 0x7); // Conto 105-110 - - iva_notify(is, i, K_ENTER); - } + add_cgs_tot(msk); - // Genera eventuali righe per ritenute fiscali e sociali - const short frit[4] = { F_RITFIS, F_RITSOC, F_REVCHARGE, 0 }; - const char trit[4] = { 'F', 'S', 'V', '\0' }; - for (int i = 0; frit[i]; i++) - { - TEdit_field& ritfld = msk.efield(frit[i]); - if (!ritfld.empty() && ritfld.active()) - add_cgs_ritenute(trit[i]); - } + TSheet_field& is = ivas(); + for (int i = 0; ini.set_paragraph(LF_RMOVIVA, i + 1); i++) + { + TToken_string& riga = is.row(i); - calcola_imp(); // Calcola totale imponibile ed imposte - } - - TSheet_field& cg = cgs(); - for (int i = 0; ini.set_paragraph(format("%d,%d", LF_RMOV, i+1)); i++) - { - char tipo = ini.get_char(RMV_ROWTYPE); - if (tipo < ' ') tipo = ' '; - - TBill conto; ini2bill(ini, conto, false); - if (_as400 && conto.tipo() <= ' ') - conto.find(); + iva_notify(is, i, K_SPACE); + add_not_empty(riga, 0, ini, RMI_IMPONIBILE); // Imponibile 101 + add_not_empty(riga, 1, ini, RMI_CODIVA); // IVA 102 + add_not_empty(riga, 2, ini, RMI_TIPODET); // Detrazione 103 + add_not_empty(riga, 3, ini, RMI_IMPOSTA); // Imposta 104 - int numrig = ini.get_int(RMV_NUMRIG)-1; - if (numrig != i) // Controllo se ho un numero riga valido - { - numrig = -1; // Normalmente aggiungi la riga in fondo - // Cerca una riga che abbia già il tipo ed il conto richiesto - if (strchr(" DINT", tipo) != NULL) - { - int nr = -1; - if (tipo == 'I' || tipo == ' ') - nr = bill2pos(conto, tipo); - else - nr = type2pos(tipo); - - if (nr < 0) - tipo = ' '; - else - if (get_cgs_imp(nr).is_zero() || tipo == 'T') - numrig = nr; - } - } - - TToken_string& riga = cg.row(numrig); - - if (numrig < 0 || _as400 || !(cg.cell_disabled(numrig, 0) && cg.cell_disabled(numrig, 1))) - { - TString4 sez = ini.get(RMV_SEZIONE); sez.strip("\""); - if (sez == "A" || sez == "D") - { - TImporto import(sez[0], real(ini.get(RMV_IMPORTO))); - if (!import.is_zero()) - import.add_to(riga, 0); // Dare/Avere 101-102 - } - } - - if (numrig < 0 || !cg.cell_disabled(numrig, 3)) - { - if (conto.gruppo() > 0) - conto.add_to(riga, 2, 0x3); // Conto 103-107 - } - - riga.add("", 7); // Codice descrizione 108 - add_not_empty(riga, 8, ini, RMV_DESCR); // Descrizione riga 109 - - ini2bill(ini, conto, true); - if (conto.gruppo() > 0) - conto.add_to(riga, 9, 0x3); // Contropartita 110-114 + TBill c; ini2bill(ini, c, false); + if (c.gruppo() > 0) + c.add_to(riga, 4, 0x7); // Conto 105-110 - add_cup_or_cig(CG_CUP, ini, riga); // CUP 115-116 - add_cup_or_cig(CG_CIG, ini, riga); // CIG 117-118 - - riga.add(tipo, cg.cid2index(CG_ROWTYPE)); // Tipo di riga 119 - } - - if (is_fattura()) - { - if (msk.insert_mode()) - { - // Propone condizioni di pagamento e banche - TEdit_field& clifo = msk.efield(F_CODCLIFOR); - if (!clifo.empty() && clifo.active()) - { - clifo.set_focusdirty(); - clifo.on_hit(); // was clifo_handler(clifo, K_TAB); - } - } - - TSheet_field& pag = pags(); - const int start_items = pag.items(); - - msk.reset(FS_RECALC); // Disabilita ricalcolo automatico - for (int i = 0; ini.set_paragraph(format("%d,%d", LF_SCADENZE, i+1)); i++) - { - TToken_string& row = pag.row(i); - if (i >= start_items) - pag_notify(pag, i, K_CTRL+K_INS); - - pag_notify(pag, i, K_SPACE); - add_not_empty(row, 0, ini, SCAD_DATASCAD); - add_not_empty(row, 1, ini, SCAD_IMPORTO); - add_not_empty(row, 2, ini, SCAD_IMPORTOVAL); -// pag_notify(pag, i, K_ENTER); + iva_notify(is, i, K_ENTER); } - int i; - for (i = 0; i < pag.items(); i++) - { - TToken_string& row = pag.row(i); - + // Genera eventuali righe per ritenute fiscali e sociali + const short frit[4] = { F_RITFIS, F_RITSOC, F_REVCHARGE, 0 }; + const char trit[4] = { 'F', 'S', 'V', '\0' }; + for (int i = 0; frit[i]; i++) + { + TEdit_field& ritfld = msk.efield(frit[i]); + if (!ritfld.empty() && ritfld.active()) + add_cgs_ritenute(trit[i]); + } + + calcola_imp(); // Calcola totale imponibile ed imposte + } + + TSheet_field& cg = cgs(); + for (int i = 0; ini.set_paragraph(format("%d,%d", LF_RMOV, i + 1)); i++) + { + char tipo = ini.get_char(RMV_ROWTYPE); + if (tipo < ' ') tipo = ' '; + + TBill conto; ini2bill(ini, conto, false); + if (_as400 && conto.tipo() <= ' ') + conto.find(); + + int numrig = ini.get_int(RMV_NUMRIG) - 1; + if (numrig != i) // Controllo se ho un numero riga valido + { + numrig = -1; // Normalmente aggiungi la riga in fondo + // Cerca una riga che abbia già il tipo ed il conto richiesto + if (strchr(" DINT", tipo) != NULL) + { + int nr = -1; + if (tipo == 'I' || tipo == ' ') + nr = bill2pos(conto, tipo); + else + nr = type2pos(tipo); + + if (nr < 0) + tipo = ' '; + else + if (get_cgs_imp(nr).is_zero() || tipo == 'T') + numrig = nr; + } + } + + TToken_string& riga = cg.row(numrig); + + if (numrig < 0 || _as400 || !(cg.cell_disabled(numrig, 0) && cg.cell_disabled(numrig, 1))) + { + TString4 sez = ini.get(RMV_SEZIONE); sez.strip("\""); + if (sez == "A" || sez == "D") + { + TImporto import(sez[0], real(ini.get(RMV_IMPORTO))); + if (!import.is_zero()) + import.add_to(riga, 0); // Dare/Avere 101-102 + } + } + + if (numrig < 0 || !cg.cell_disabled(numrig, 3)) + { + if (conto.gruppo() > 0) + conto.add_to(riga, 2, 0x3); // Conto 103-107 + } + + riga.add("", 7); // Codice descrizione 108 + add_not_empty(riga, 8, ini, RMV_DESCR); // Descrizione riga 109 + + ini2bill(ini, conto, true); + if (conto.gruppo() > 0) + conto.add_to(riga, 9, 0x3); // Contropartita 110-114 + + add_cup_or_cig(CG_CUP, ini, riga); // CUP 115-116 + add_cup_or_cig(CG_CIG, ini, riga); // CIG 117-118 + + riga.add(tipo, cg.cid2index(CG_ROWTYPE)); // Tipo di riga 119 + } + + if (is_fattura()) + { + if (msk.insert_mode()) + { + // Propone condizioni di pagamento e banche + TEdit_field& clifo = msk.efield(F_CODCLIFOR); + if (!clifo.empty() && clifo.active()) + { + clifo.set_focusdirty(); + clifo.on_hit(); // was clifo_handler(clifo, K_TAB); + } + } + + TSheet_field& pag = pags(); + const int start_items = pag.items(); + + msk.reset(FS_RECALC); // Disabilita ricalcolo automatico + for (int i = 0; ini.set_paragraph(format("%d,%d", LF_SCADENZE, i + 1)); i++) + { + TToken_string& row = pag.row(i); + if (i >= start_items) + pag_notify(pag, i, K_CTRL + K_INS); + + pag_notify(pag, i, K_SPACE); + add_not_empty(row, 0, ini, SCAD_DATASCAD); + add_not_empty(row, 1, ini, SCAD_IMPORTO); + add_not_empty(row, 2, ini, SCAD_IMPORTOVAL); + // pag_notify(pag, i, K_ENTER); + } + + int i; + for (i = 0; i < pag.items(); i++) + { + TToken_string& row = pag.row(i); + row.add(msk.get(FS_NSABI), 7); - row.add(msk.get(FS_NSCAB), 8); - row.add(msk.get(FS_VSABI), 9); - row.add(msk.get(FS_VSCAB), 10); - pag_notify(pag, i, K_ENTER); - } + row.add(msk.get(FS_NSCAB), 8); + row.add(msk.get(FS_VSABI), 9); + row.add(msk.get(FS_VSCAB), 10); + pag_notify(pag, i, K_ENTER); + } - // In inserimento tento di riempire anche le scadenze - if (msk.insert_mode() && (i == 0 || real::is_null(pag.row(0).get(1)))) - { - TString4 codpag = msk.get(F_CODPAG); - if (codpag.empty()) - { - TToken_string key; - key = iva() == iva_acquisti ? "F" : "C"; - key.add(ini.get(MOV_CODCF, "23")); - codpag = cache().get(LF_CLIFO, key, CLI_CODPAG); - } - if (codpag.full()) - { - msk.set(FS_RECALC, "X"); // Forza ricalcolo automatico - msk.set(F_CODPAG, codpag); - set_scadenze(msk); - } - } + // In inserimento tento di riempire anche le scadenze + if (msk.insert_mode() && (i == 0 || real::is_null(pag.row(0).get(1)))) + { + TString4 codpag = msk.get(F_CODPAG); + if (codpag.empty()) + { + TToken_string key; + key = iva() == iva_acquisti ? "F" : "C"; + key.add(ini.get(MOV_CODCF, "23")); + codpag = cache().get(LF_CLIFO, key, CLI_CODPAG); + } + if (codpag.full()) + { + msk.set(FS_RECALC, "X"); // Forza ricalcolo automatico + msk.set(F_CODPAG, codpag); + set_scadenze(msk); + } + } - pagamento().set_sheet(pag); - } - } + pagamento().set_sheet(pag); + } + } + if (_f1_ini && msk.find_by_id(FS_RECALC) != NULL) + msk.set(FS_RECALC, ""); + if (_f1_liq && msk.find_by_id(F_DIFFERITA) != NULL) + { + TDate datadoc(msk.get(F_DATADOC)); datadoc.set_day(1); + TDate datareg(msk.get(F_DATAREG)); datareg.set_day(1); + if(datadoc < datareg) + msk.set(F_DIFFERITA, "X"); + } } bool TPrimanota_application::save(bool check_dirty) @@ -2436,9 +2482,6 @@ int TPrimanota_application::save_fppro() return pro_notsaved; } - /*const TString keyprginvio = fp_db().sq_get("PZ_KEYPRGINVIO"); - const TString keyheaderfatt = fp_db().sq_get("PZ_KEYHEADERFATT"); - const TString keybodyfatt = fp_db().sq_get("PZ_KEYBODYFATT");*/ const int numregcont = msk.get_int(F_NUMREG); const int clifor = msk.get_int(F_CODCLIFOR); @@ -2459,7 +2502,6 @@ bool TPrimanota_application::save_dbmov() const const TMask& msk = curr_mask(); const TString& numreg = msk.get(H_NUMREG); const TString& keyfppro = msk.get(F_PROKEY); - const TString& progfppro = msk.get(F_PROTFPPRO); TLocalisamfile mov(LF_MOV); mov.put(MOV_NUMREG, numreg); @@ -2467,7 +2509,6 @@ bool TPrimanota_application::save_dbmov() const if (ok) { mov.put(MOV_KEYFPPRO, keyfppro); - mov.put(MOV_PROGFPPRO, progfppro); ok = mov.rewrite() == NOERR; } return ok; diff --git a/src/cg/cg2100.h b/src/cg/cg2100.h index 3389e89b5..9a5b80e2d 100755 --- a/src/cg/cg2100.h +++ b/src/cg/cg2100.h @@ -19,7 +19,6 @@ #define F_DATACOMP 116 #define F_ANNOIVA 117 #define F_NUMDOCEXT 130 -#define F_PROTFPPRO 230 #define F_RITFATT 231 #define F_PROKEY 232 #define F_COLFPPRO 233 diff --git a/src/cg/cg2100c.uml b/src/cg/cg2100c.uml index 88f5e2200..e3e9f0b4f 100755 --- a/src/cg/cg2100c.uml +++ b/src/cg/cg2100c.uml @@ -615,13 +615,6 @@ BEGIN FLAGS "D" END -STRING F_PROTFPPRO 18 -BEGIN - PROMPT 1 19 "Codice Protocollo FPPRO " - FIELD PROGFPPRO - FLAGS "D" -END - STRING F_PROKEY 80 BEGIN PROMPT 1 18 "db key" diff --git a/src/cg/cg2102.cpp b/src/cg/cg2102.cpp index ae7d5a85d..6c9924edf 100755 --- a/src/cg/cg2102.cpp +++ b/src/cg/cg2102.cpp @@ -2262,19 +2262,17 @@ bool TPrimanota_application::caus_query_handler(TMask_field& f, KEY key) void TPrimanota_application::check_fppro_fields(TMask& m) { - if (app().has_f1_db(&m)) + if (!check_causale(m.get(F_CODCAUS)) || !app().has_f1_db(&m)) { - if (!check_causale(m.get(F_CODCAUS)) && m.find_by_id(F_PROTFPPRO) != NULL) - { - m.hide(F_PROTFPPRO); + if(m.find_by_id(DLG_LINK) != NULL) m.disable(DLG_LINK); - } - else - if (check_causale(m.get(F_CODCAUS)) && m.find_by_id(F_PROTFPPRO) != NULL && m.field(F_PROTFPPRO).hidden()) - { - m.show(F_PROTFPPRO); - m.enable(DLG_LINK); - } + } + else + { + if (m.find_by_id(DLG_LINK) != NULL) + m.enable(DLG_LINK); + if (m.find_by_id(F_COLFPPRO) != NULL) + m.show(F_COLFPPRO); } } @@ -2461,6 +2459,7 @@ bool TPrimanota_application::datareg_handler(TMask_field& f, KEY key) } } } + check_fppro_fields(f.mask()); return ok; } diff --git a/src/cg/cg2102.h b/src/cg/cg2102.h index d4539eaa5..c6da6d4bd 100755 --- a/src/cg/cg2102.h +++ b/src/cg/cg2102.h @@ -36,7 +36,6 @@ #include #include "../f1/f1lib.h" -#define TIPO_REG_ACQ 2 #define K_ELIMMAS 0 // Key per eliminazione massima class TPro_msk; @@ -99,7 +98,11 @@ class TPrimanota_application : public TRelation_application TAssoc_array _colori; // Colori delle righe bool _isfp; shared_ptr _pro_mask; - friend class TPro_msk; + bool _is_set_fpcheck; + int _last_date; + bool _f1_ini; + bool _f1_liq; + friend class TPro_msk; static bool showpartite_handler(TMask_field& f, KEY k); static bool speserimb_handler(TMask_field& f, KEY k); @@ -188,6 +191,8 @@ class TPrimanota_application : public TRelation_application static void fppromask_set_handl(TMask* msk); static void load_list(TMask* msk, KEY k); + static void f1_init_modify(TMask& m, const TRectype& mov); + void reset_sheet_row(TSheet_field& s, int n); int crea_somma_spese(TImporto& imp); void update_saldo_riga(int r); @@ -209,6 +214,7 @@ protected: // TApplication bool save_dbmov() const; // Pulisce il mov e db dai firerimenti FPPRO (in MODE_MOD per edit/delete) void clean_fppro(); + void set_has_f1_db(TMask* m); bool has_f1_db(TMask* m); virtual bool save(bool check_dirty); @@ -216,6 +222,7 @@ protected: // TApplication bool force_mask_swap(const TCausale& old_caus, const TCausale& new_caus); protected: // TRelation_application + void check_f1_ini(); virtual bool user_create(); virtual bool user_destroy(); virtual bool changing_mask(int mode); @@ -354,6 +361,7 @@ public: static bool iva_notify(TSheet_field& s, int r, KEY key); static bool cg_notify(TSheet_field& s, int r, KEY key); bool get_isfp() const { return _isfp; } + int get_lastdate() { return _last_date; } TMask * mask(CGMaskType type) { return _msk[type]; } diff --git a/src/cg/cg4301.cpp b/src/cg/cg4301.cpp index 2361e682f..110fb7427 100755 --- a/src/cg/cg4301.cpp +++ b/src/cg/cg4301.cpp @@ -1186,7 +1186,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array & } #ifdef DBG if (nr == 97882 || nr == 98707) - int i = 1; + int i = 1; #endif const TRectype& rcs = _cur->curr(LF_CAUSALI); const TDate datareg = _mov->get_date(MOV_DATAREG); @@ -1241,7 +1241,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array & #ifdef DBG if (nr == 97882 || nr == 98707) - int i = 1; + int i = 1; #endif if (fattrit) @@ -1556,7 +1556,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array & long nr = _mov->get_long(MOV_NUMREG); if (nr == 97882 || nr == 98707) - int i = 1; + int i = 1; #endif if ((soloiva && @@ -4164,10 +4164,10 @@ void TLiquidazione_app::write_liq(int month, const char* codatts) if (!look_pla(att)) continue; - const real vf1 = _pla->get("R14"); - const real vf2 = _pla->get("S1"); - const real iaq = _pla->get("R11"); // IVA acquisti - const real ppg = _pla->get("R12"); // pro-rata pagato + const real vf1 = _pla->get_real("R14"); + const real vf2 = _pla->get_real("S1"); + const real iaq = _pla->get_real("R11"); // IVA acquisti + const real ppg = _pla->get_real("R12"); // pro-rata pagato vol_aff_1 += vf1; vol_aff_2 += vf2; @@ -4187,7 +4187,7 @@ void TLiquidazione_app::write_liq(int month, const char* codatts) const real ris = vf1 + vf2; // gia' esclusi: NS, B3, cess. amm // calcola nuovo prorata dal 1998 per ogni attivita' (miste: 1+2) - const real rsa = ris - (es_c1a-es_c1a_am) - (es_c3-es_c3_am); + const real rsa = ris - (es_c1a-es_c1a_am) - (es_c3-es_c3_am) - ven_rev; const real rsn = rsa - es_c1; if (!rsa.is_zero()) { diff --git a/src/cg/cg4304.cpp b/src/cg/cg4304.cpp index bc5778bc7..a82d04f0b 100755 --- a/src/cg/cg4304.cpp +++ b/src/cg/cg4304.cpp @@ -1164,10 +1164,11 @@ void TLiquidazione_app::describe_pims(int month, const char* codatt, const bool real vrc = _pla->get_real("R18"); // Vendite reverse charge real iaq = _pla->get_real("R11"); // IVA acquisti real ppg = _pla->get_real("R12"); // pro-rata pagato - + real ven_rev = _pla->get_real("R18"); + // calcola nuovo prorata per ogni attivita' (miste: 1+2) real pr; - const real rsa = ris - (e3-e5) - (e4-e6); + const real rsa = ris - (e3-e5) - (e4-e6) - ven_rev; const real rsn = rsa - e1; if (!rsa.is_zero()) diff --git a/src/cg/cg5500.cpp b/src/cg/cg5500.cpp index 3f8f2bdb3..fcead0086 100755 --- a/src/cg/cg5500.cpp +++ b/src/cg/cg5500.cpp @@ -559,13 +559,13 @@ bool Visliq_app::calc_int(TMask_field& f, KEY k) round_imposta(intr); vers = vers_netto + intr; - f.mask().set(106, vers); - f.mask().set(107, intr); + f.mask().set(S_VERSAMENTO, vers); + f.mask().set(S_INTERESSI, intr); TToken_string& row = sv.row(sel); - row.add(vers, 5); - row.add(intr, 6); + sv.set_row_cell(row, S_VERSAMENTO, vers); + sv.set_row_cell(row, S_INTERESSI, intr); sv.force_update(sel); } } @@ -638,12 +638,12 @@ bool Visliq_app::vis_all() _mask->set_handler(DLG_PRINT, print_handler); sh.sheet_mask().set_handler(100, sel_mese_sh1); - sh.sheet_mask().set_handler(104, enable_date); - sh.sheet_mask().set_handler(109, enable_date); - sh.sheet_mask().set_handler(110, check_date); + sh.sheet_mask().set_handler(S_RIMBORSO, enable_date); + sh.sheet_mask().set_handler(S_CREDF24, enable_date); + sh.sheet_mask().set_handler(S_DATAAUT, check_date); sv.sheet_mask().set_handler(100, sel_mese_sh2); - sv.sheet_mask().set_handler(106, calc_int); + sv.sheet_mask().set_handler(S_VERSAMENTO, calc_int); const bool new_print_2000 = true; // _year >= 2000; const bool compensabile = _lia->get("S9") == "CM"; @@ -652,16 +652,16 @@ bool Visliq_app::vis_all() if (compensabile) { const bool gestione_manuale = _lia->get_bool("B6"); - sh.enable_column(107, gestione_manuale); + sh.enable_column(S_CREDIVA, gestione_manuale); - for (int id = 108; shm.id2pos(id) > 0; id++) + for (int id = S_CREDF24PRE; shm.id2pos(id) > 0; id++) { - if ((id > 107 && id <= 110) || id == 114) + if ((id > S_CREDIVA && id <= S_DATAAUT) || id == S_DESCR) sh.enable_column(id, true); } } else - sh.enable_column(110); + sh.enable_column(S_DATAAUT); // fill the mask in read_general(*_mask); @@ -1477,24 +1477,25 @@ void Visliq_app::recalc_next_liq(int start_month, TSheet_field* sl, TSheet_field if (sl != NULL) { TToken_string& t = sl->row(row); - t.add(itoname(i),0); + + sl->set_row_cell(t, S_MESE, itoname(i)); const real iva_ven = _lam->get_real("R0"); // IVA acquisti const real iva_acq = _lam->get_real("R1"); // IVA vendite const real ris = iva_ven - iva_acq; - t.add(abs(ris).string(), 1); + sl->set_row_cell(t, S_RISULTATO, abs(ris).string()); const real r1 = _lim->get_real("R1"); bool enable_date = !r1.is_zero(); const real r5 = _lim->get_real("R5"); - t.add(ris == ZERO ? "" : (ris > ZERO ? "D" : "C"), 2); - t.add(r1, 3); - t.add(abs(r5), 4); + sl->set_row_cell(t, S_DEBCRED1, ris == ZERO ? "" : (ris > ZERO ? "D" : "C")); + sl->set_row_cell(t, S_RIMBORSO, r1); + sl->set_row_cell(t, S_RETTIFICHE, abs(r5)); if (!r5.is_zero()) - t.add(r5 >ZERO ? "D" : "C", 5); + sl->set_row_cell(t, S_DEBCRED2, r5 >ZERO ? "D" : "C"); const real criva = _lim->get_real("R15"); const real crf24 = _lim->get_real("R16"); @@ -1502,11 +1503,11 @@ void Visliq_app::recalc_next_liq(int start_month, TSheet_field* sl, TSheet_field TDate dautf24 = _lim->get_date("D1"); enable_date |= !autf24.is_zero(); - t.add(criva, 6); - t.add(crf24, 7); - t.add(autf24, 8); + sl->set_row_cell(t, S_CREDIVA, criva); + sl->set_row_cell(t, S_CREDF24PRE, crf24); + sl->set_row_cell(t, S_CREDF24, autf24); if (enable_date) - t.add(dautf24, 9); + sl->set_row_cell(t, S_DATAAUT, dautf24); if (compensabile) { cr_res += autf24; @@ -1514,33 +1515,32 @@ void Visliq_app::recalc_next_liq(int start_month, TSheet_field* sl, TSheet_field cr_res -= criva; if (cr_res < ZERO) { - sl->set_back_and_fore_color(COLOR_LTYELLOW, COLOR_DKRED, row, 7); - t.add("", 10); + sl->set_back_and_fore_color(COLOR_LTYELLOW, COLOR_DKRED, row, sl->cid2index(S_CREDF24PRE)); + sl->set_row_cell(t, S_CREDRES, ""); } else { - sl->set_back_and_fore_color(NORMAL_BACK_COLOR, NORMAL_COLOR, row, 7); - t.add(cr_res, 10); + sl->set_back_and_fore_color(NORMAL_BACK_COLOR, NORMAL_COLOR, row, sl->cid2index(S_CREDF24PRE)); + sl->set_row_cell(t, S_CREDRES, cr_res); } } else - t.add("", 10); + sl->set_row_cell(t, S_CREDRES, ""); real r0 = _lim->get_real("R0"); if (compensabile) r0 += autf24; - t.add(abs(r0).string(), 11); - t.add(r0 == ZERO ? "" : (r0 > ZERO ? "D" : "C"), 12); + sl->set_row_cell(t, S_IVA, abs(r0).string()); + sl->set_row_cell(t, S_DEBCRED3, r0 == ZERO ? "" : (r0 > ZERO ? "D" : "C")); t.add(_lim->get("S3"), 13); for (int kk = 3; kk < 6 ; kk++) sl->enable_cell(row, kk); - sl->enable_cell(row, 7); - sl->enable_cell(row, 8); - sl->enable_cell(row, 9); - sl->enable_cell(row, 9, enable_date); - sl->enable_cell(row, 14); + sl->enable_cell(row, S_CREDF24PRE); + sl->enable_cell(row, S_CREDF24); + sl->enable_cell(row, S_DATAAUT, enable_date); + sl->enable_cell(row, S_DESCR); } } sl->force_update(); @@ -1644,79 +1644,68 @@ void Visliq_app::read_general(TMask& m) const int row = (i/step) - 1; if (!look_lim(i)) { - if (sh.items() < row) - sh.row(row) = *(new TToken_string("||||||")); - else - sh.row(row) = "||||||"; - + TToken_string & t = sh.row(row); + + t.cut(0); sh.disable_cell(row, -1); - continue; } - - TToken_string* tt = NULL; - if (sh.items() < row) - tt = new TToken_string(80); - else - tt = &(sh.row(row)); - + else + { + const real iva_ven = _lam->get_real("R0"); // IVA acquisti + const real iva_acq = _lam->get_real("R1"); // IVA vendite + const real ris = iva_ven - iva_acq; + const real r1 = _lim->get_real("R1"); + const real r5 = _lim->get_real("R5"); + const int row = sh.set_row_cell(S_MESE, itoname(i)); + + sh.set_row_cell(S_RISULTATO, abs(ris), row); + sh.set_row_cell(S_DEBCRED1, ris == ZERO ? "" : (ris > ZERO ? "D" : "C"), row); + sh.set_row_cell(S_RIMBORSO, r1, row); + sh.set_row_cell(S_RETTIFICHE, abs(r5), row); + sh.set_row_cell(S_DEBCRED2, r5 == ZERO ? "" : (r5 > ZERO ? "D" : "C"), row); - const real iva_ven = _lam->get_real("R0"); // IVA acquisti - const real iva_acq = _lam->get_real("R1"); // IVA vendite - const real ris = iva_ven -iva_acq; - - const real r1 = _lim->get_real("R1"); - const real r5abs = abs(_lim->get_real("R5")); + const real criva = _lim->get_real("R15"); + const real crf24 = _lim->get_real("R16"); + const real autf24 = _lim->get_real("R20"); + bool enable_date = r1 != ZERO; - tt->add(itoname(i),0); - tt->add(abs(ris).string(),1); - - const int sris = ris.sign(); - const int sr5 = (_lim->get_real("R5")).sign(); - - tt->add(sris == 0 ? "" : (sris > 0 ? "D" : "C"),2); - tt->add(r1.string(),3); - tt->add(r5abs.string(),4); - bool enable_date = !r1.is_zero(); - tt->add(sr5 == 0 ? "" : (sr5 > 0 ? "D" : "C"),5); - - const real criva = _lim->get_real("R15"); - tt->add(criva.string(), 6); - const real crf24 = _lim->get_real("R16"); - tt->add(crf24.string(),7); - const real autf24 = _lim->get_real("R20"); - tt->add(autf24.string(),8); - enable_date |= !autf24.is_zero(); - TDate dautf24 = _lim->get_date("D1"); - if (enable_date) - tt->add(dautf24.string(),9); - sh.enable_cell(row, 9, enable_date); - if (compensabile) - { - cr_res += autf24; - cr_res -= crf24; - cr_res -= criva; - if (cr_res < ZERO) + sh.set_row_cell(S_CREDIVA, criva, row); + sh.set_row_cell(S_CREDF24PRE,crf24, row); + sh.set_row_cell(S_CREDF24, autf24 , row); + enable_date |= autf24 != ZERO; + if (enable_date) { - sh.set_back_and_fore_color(COLOR_LTYELLOW, COLOR_DKRED, row, 7); - tt->add("", 10); + const TDate dautf24 = _lim->get_date("D1"); + + sh.set_row_cell(S_DATAAUT, dautf24, row); + } + sh.enable_cell(row, sh.cid2index(S_DATAAUT), enable_date); + if (compensabile) + { + cr_res += autf24; + cr_res -= crf24; + cr_res -= criva; + if (cr_res < ZERO) + { + sh.set_back_and_fore_color(COLOR_LTYELLOW, COLOR_DKRED, row, sh.cid2index(S_CREDF24PRE)); + sh.set_row_cell(S_CREDRES, ZERO, row); + } + else + { + sh.set_back_and_fore_color(NORMAL_BACK_COLOR, NORMAL_COLOR, row, sh.cid2index(S_CREDF24PRE)); + sh.set_row_cell(S_CREDRES, cr_res , row); + } } else - { - sh.set_back_and_fore_color(NORMAL_BACK_COLOR, NORMAL_COLOR, row, 7); - tt->add(cr_res.string(), 10); - } - } - else - tt->add("", 10); - - real r0 = _lim->get_real("R0"); + sh.set_row_cell(S_CREDRES, ZERO, row); - //if (compensabile) - // r0 += autf24; - tt->add(abs(r0).string(), 11); - tt->add(r0 == ZERO ? "" : (r0 > ZERO ? "D" : "C"), 12); - tt->add(_lim->get("S3"), 13); - sh.row(row) = (*tt); + real r0 = _lim->get_real("R0"); + + sh.set_row_cell(S_IVA, abs(r0).string(), row); + sh.set_row_cell(S_DEBCRED3, r0 == ZERO ? "" : (r0 > ZERO ? "D" : "C"), row); + sh.set_row_cell(S_DESCR, _lim->get("S3"), row); + // sh.row(row) = (*tt); + } } sh.force_update(); @@ -1743,10 +1732,11 @@ void Visliq_app::read_general(TMask& m) if (m >= 12) m = tipod == 7 ? 12 : 13; // supercauto - if (m <= 0) continue; + if (m <= 0) + continue; versamenti[m - 1] += _del->get_real("R0"); - interessi[m - 1] += _del->get_real("R1"); + interessi[m - 1] += _del->get_real("R1"); date[m-1] = _del->get_date("D0"); TToken_string& b = banche[m-1]; b.add(_del->get("S7"),0); @@ -1759,33 +1749,26 @@ void Visliq_app::read_general(TMask& m) sv.destroy(); for (int i = 1; i <= 13; i++) { - if (!is_month_ok(i) && i != 13) - continue; + if (!is_month_ok(i) && i != 13) + continue; + nomemese = itoname(i == 13 ? 12 : i); + if (nomemese == "4 Trimestre") + nomemese = TR("4 Tr."); + if (i == 12) nomemese << TR(" acconto"); + if (i == 13) nomemese << TR(" saldo"); - nomemese = itoname(i == 13 ? 12 : i); - if (nomemese == "4 Trimestre") - nomemese = TR("4 Tr."); - if (i == 12) nomemese << TR(" acconto"); - if (i == 13) nomemese << TR(" saldo"); - - TToken_string tt; - tt.add(nomemese,0); // mese - tt.add(date[i-1].string(),1); // data vers. - tt.add(banche[i-1].get(0),2); // azienda - tt.add(banche[i-1].get(1),3); // dipendenza - tt.add(banche[i-1].get(2),4); // concessionaria - tt.add(versamenti[i - 1].string(), 5);// versamenti - tt.add(interessi[i - 1].string(), 6);// interessi + const int row = sv.set_row_cell(S_MESE, nomemese); // mese + + sv.set_row_cell(S_DATA, date[i - 1], row); // data vers. + sv.set_row_cell(S_ABI, banche[i - 1].get(0), row); // azienda + sv.set_row_cell(S_CAB, banche[i - 1].get(1), row); // dipendenza + sv.set_row_cell(S_CONC, banche[i - 1].get(2), row); // concessionaria + sv.set_row_cell(S_VERSAMENTO, versamenti[i - 1], row);// versamenti + sv.set_row_cell(S_INTERESSI, interessi[i - 1], row);// interessi - sv.row(-1) = tt; - if (i == 12) - sv.enable_cell(sv.items() - 1, -1, false); + if (i == 12) + sv.disable_cell(sv.items() - 1, -1); } - - // sh.enable_column(0, false); - // sv.enable_column(0, false); - - sh.force_update(); sv.force_update(); // save initial rows @@ -1840,10 +1823,8 @@ void Visliq_app::write_general(TMask& m) // risolve menata del dettaglio si'/no if (lfrommask) - { for (int i = 1; i <= 13; i++) - tt_ln.add(shm.get(101+i),i); - } + tt_ln.add(shm.get(101+i),i); // saltare una riga se dicembre (riga 11 == acconto) TToken_string& tt_vo = (TToken_string&)_vers_rows[i == 12 ? row + 1 : row]; @@ -1856,47 +1837,49 @@ void Visliq_app::write_general(TMask& m) } // traduci contenuto righe in real pila - real orett(tt_lo.get(4)); - real nrett(tt_ln.get(4)); - real orimb(tt_lo.get(3)); - real nrimb(tt_ln.get(3)); - real overs(tt_vo.get(5)); - real nvers(tt_vn.get(5)); - real crcode(tt_ln.get(6)); - real crf24(tt_ln.get(7)); - real oautf24(tt_lo.get(8)); - real autf24(tt_ln.get(8)); - TDate dautf24(tt_ln.get(9)); - TDate odate(tt_vo.get(1)); - TDate ndate(tt_vn.get(1)); - TString odbcr(tt_lo.get(5)); - TString ndbcr(tt_ln.get(5)); - TString8 oabi (tt_vo.get(2)); - TString8 nabi (tt_vn.get(2)); - TString8 ocab (tt_vo.get(3)); - TString8 ncab (tt_vn.get(3)); - TString ocon (tt_vo.get(4)); - TString ncon (tt_vn.get(4)); - TString descr(tt_ln.get(13)); + real orett(tt_lo.get(cid2index(S_RETTIFICHE))); + real nrett(sh.get_real_row_cell(row, S_RETTIFICHE)); + real orimb(tt_lo.get(cid2index(S_RIMBORSO))); + real nrimb(sh.get_real_row_cell(row, S_RIMBORSO)); + real crcode(sh.get_real_row_cell(row, S_CREDIVA)); + real crf24(sh.get_real_row_cell(row, S_CREDF24PRE)); + real oautf24(tt_lo.get(cid2index(S_CREDF24))); + real autf24(sh.get_real_row_cell(row, S_CREDF24)); + TDate dautf24(sh.get_date_row_cell(row, S_DATAAUT)); + TString odbcr(tt_lo.get(cid2index(S_DEBCRED2))); + TString ndbcr(sh.get_str_row_cell(row, S_DEBCRED2)); + TString descr(sh.get_str_row_cell(row, S_DESCR)); + + real overs(tt_vo.get(cid2index(S_VERSAMENTO))); + real nvers(sv.get_real_row_cell(row, S_VERSAMENTO)); + TDate odate(tt_vo.get(cid2index(S_DATAAUT))); + TDate ndate(sv.get_date_row_cell(row, S_DATAAUT)); + TString8 oabi(tt_vo.get(cid2index(S_ABI))); + TString8 nabi(sv.get_str_row_cell(row, S_ABI)); + TString8 ocab(tt_vo.get(cid2index(S_CAB))); + TString8 ncab(sv.get_str_row_cell(row, S_CAB)); + TString ocon(tt_vo.get(cid2index(S_CONC))); + TString ncon(sv.get_str_row_cell(row, S_CONC)); if (odbcr == "C") orett = -orett; if (ndbcr == "C") nrett = -nrett; // acconto (si considererà solo a dicembre) - TToken_string& vo = (TToken_string&)_vers_rows[_freqviva == "M" ? 11 : 3]; - TToken_string& vn = sv.row(_freqviva == "M" ? 11 : 3); - real oacct (vo.get(5)); - real nacct (vn.get(5)); - TDate aodate(vo.get(1)); - TDate andate(vn.get(1)); - TString8 aoabi (vo.get(2)); - TString8 anabi (vn.get(2)); - TString8 aocab (vo.get(3)); - TString8 ancab (vn.get(3)); - TString aocon (vo.get(4)); - TString ancon (vn.get(4)); - - was_lim = look_lim(i); + TToken_string& vo = (TToken_string&)_vers_rows[_freqviva == "M" ? 11 : 3]; + const int row_acc = _freqviva == "M" ? 11 : 3; + + real oacct(tt_vo.get(cid2index(S_VERSAMENTO))); + real nacct(sv.get_real_row_cell(row_acc, S_VERSAMENTO)); + TDate aodate(tt_vo.get(cid2index(S_DATA))); + TDate andate(sv.get_date_row_cell(row_acc, S_DATA)); + TString8 aoabi(tt_vo.get(cid2index(S_ABI))); + TString8 anabi(sv.get_str_row_cell(row_acc, S_ABI)); + TString8 aocab(tt_vo.get(cid2index(S_CAB))); + TString8 ancab(sv.get_str_row_cell(row_acc, S_CAB)); + TString aocon(tt_vo.get(cid2index(S_CONC))); + TString ancon(sv.get_str_row_cell(row_acc, S_CONC)); + + was_lim = look_lim(i); if (!was_lim) carry = false; // blocca riporto crediti e debiti @@ -2109,7 +2092,7 @@ void Visliq_app::write_general(TMask& m) } // Rimetti a posto righe sheet se serve - if (was_lim) + if (was_lim) // qui { const real iva_ven = _lam->get_real("R0"); // IVA acquisti diff --git a/src/cg/cg5500a.h b/src/cg/cg5500a.h index 9eb5cd22e..d213d4576 100755 --- a/src/cg/cg5500a.h +++ b/src/cg/cg5500a.h @@ -35,3 +35,24 @@ #define F_CODDITTA2 201 #define F_RAGSOC2 202 +#define S_MESE 101 +#define S_IVA 102 +#define S_DEBCRED3 103 +#define S_RISULTATO 104 +#define S_DEBCRED1 105 +#define S_RIMBORSO 106 +#define S_RETTIFICHE 107 +#define S_DEBCRED2 108 +#define S_CREDIVA 109 +#define S_CREDF24PRE 110 +#define S_CREDF24 111 +#define S_DATAAUT 112 +#define S_CREDRES 113 +#define S_DESCR 114 + +#define S_DATA 102 +#define S_ABI 103 +#define S_CAB 104 +#define S_CONC 105 +#define S_VERSAMENTO 106 +#define S_INTERESSI 107 diff --git a/src/cg/cg5500b.uml b/src/cg/cg5500b.uml index aed7092cf..b0f0fe27d 100755 --- a/src/cg/cg5500b.uml +++ b/src/cg/cg5500b.uml @@ -63,6 +63,8 @@ SPREADSHEET F_VISLIQ1 -2 -1 BEGIN PROMPT 0 7 "Liquidazione" ITEM "Mese@10" + ITEM "IVA dovuta o\na credito@15" + ITEM "D/C@3" ITEM "Risultato@15" ITEM "D/C@3" ITEM "IVA rimborso@15" @@ -73,8 +75,6 @@ BEGIN ITEM "Credito anno in corso\nautorizzato F24@20" ITEM "Data autorizzazione@20" ITEM "Credito IVA\nresiduo@15" - ITEM "IVA dovuta o\na credito@15" - ITEM "D/C@3" ITEM "Descrizione@50" END @@ -122,20 +122,20 @@ ENDPAGE PAGE "Prospetto mensile" -1 -1 75 22 -STRING 101 20 +STRING S_MESE 20 BEGIN PROMPT 1 1 "Mese " FLAGS "D" END -CURRENCY 102 15 +CURRENCY S_RISULTATO 15 BEGIN PROMPT 1 2 "Risultato " FLAGS "D" END -LIST 103 1 10 +LIST S_DEBCRED1 1 10 BEGIN PROMPT 57 2 "" ITEM " | " @@ -144,20 +144,20 @@ BEGIN FLAGS "DU" END -CURRENCY 104 15 +CURRENCY S_RIMBORSO 15 BEGIN PROMPT 1 3 "IVA rimborso " PICTURE "." GROUP 11 END -CURRENCY 105 15 +CURRENCY S_RETTIFICHE 15 BEGIN PROMPT 1 4 "IVA rettifiche " GROUP 11 END -LIST 106 1 10 +LIST S_DEBCRED2 1 10 BEGIN PROMPT 57 4 "" ITEM " | " @@ -167,28 +167,28 @@ BEGIN GROUP 11 END -CURRENCY 107 15 +CURRENCY S_CREDIVA 15 BEGIN PROMPT 1 5 "Credito utilizzato IVA " FLAGS "D" GROUP 12 END -CURRENCY 108 15 +CURRENCY S_CREDF24PRE 15 BEGIN PROMPT 1 6 "Credito utilizzato F24 anno precedente " GROUP 12 FLAGS "D" END -CURRENCY 109 15 +CURRENCY S_CREDF24 15 BEGIN PROMPT 1 7 "Credito autorizzato F24 anno in corso " GROUP 12 FLAGS "D" END -DATE 110 +DATE S_DATAAUT BEGIN PROMPT 1 8 "Data di autorizzazione " GROUP 12 @@ -197,21 +197,21 @@ BEGIN FLAGS "D" END -CURRENCY 111 15 +CURRENCY S_CREDRES 15 BEGIN PROMPT 1 9 "Credito IVA residuo " FLAGS "D" GROUP 12 END -CURRENCY 112 15 +CURRENCY S_IVA 15 BEGIN PROMPT 1 10 "IVA dovuta o credito " FLAGS "D" GROUP 12 END -LIST 113 1 10 +LIST S_DEBCRED3 1 10 BEGIN PROMPT 57 10 "" ITEM " | " @@ -221,7 +221,7 @@ BEGIN GROUP 11 END -STRING 114 50 35 +STRING S_DESCR 50 35 BEGIN PROMPT 1 11 "Descr. " GROUP 12 @@ -244,18 +244,18 @@ ENDPAGE PAGE "Prospetto versamenti" -1 -1 50 12 -STRING 101 20 +STRING S_MESE 20 BEGIN PROMPT 1 1 "Mese " FLAGS "D" END -DATE 102 +DATE S_DATA BEGIN PROMPT 1 2 "Data " END -NUMBER 103 5 +NUMBER S_ABI 5 BEGIN PROMPT 1 3 "Codice ABI " HELP "Codice ABI banca di appoggio" @@ -272,7 +272,7 @@ BEGIN END -NUMBER 104 5 +NUMBER S_CAB 5 BEGIN PROMPT 1 4 "Codice CAB " HELP "Codice CAB banca di appoggio" @@ -292,7 +292,7 @@ BEGIN END -NUMBER 105 3 +NUMBER S_CONC 3 BEGIN PROMPT 1 5 "Concessione " FLAGS "RZ" @@ -306,20 +306,17 @@ BEGIN HELP "Codice Concessione del Comune di residenza fiscale" END - -CURRENCY 106 15 +CURRENCY S_VERSAMENTO 15 BEGIN PROMPT 1 6 "Versamenti " END -CURRENCY 107 15 +CURRENCY S_INTERESSI 15 BEGIN PROMPT 1 6 "Interessi " FLAGS "RD" END - - BUTTON 100 10 2 BEGIN PROMPT -11 -1 "Dettaglio" diff --git a/src/cg/f20.dir b/src/cg/f20.dir index a6f8bd30d..4e005c3b5 100755 --- a/src/cg/f20.dir +++ b/src/cg/f20.dir @@ -1,3 +1,3 @@ 20 0 -$clifo|774|774|875|0|Clienti/Fornitori||| +$clifo|||905|0|Clienti/Fornitori||| diff --git a/src/cg/f20.trr b/src/cg/f20.trr index 4b9c2a166..64e8deec5 100755 --- a/src/cg/f20.trr +++ b/src/cg/f20.trr @@ -34,7 +34,7 @@ PTELEX|1|10|0|Prefisso del numero di TELEX TELEX|1|30|0|Prefisso del numero di TELEX MAIL|1|50|0|Indirizzo di posta elettronica generico BYMAIL|8|1|0|Consenso all' invio dei documenti per posta elettronica -PEC|1|50|0|Indirizzo di posta elettronica certificato +PEC|1|80|0|Indirizzo di posta elettronica certificato DOCMAIL|1|50|0|Indirizzo di posta elettronica per i documenti DATANASC|5|8|0|Data di nascita STATONASC|2|3|0|Codice stato di nascita @@ -64,10 +64,10 @@ ENTE|1|4|0|Codice ente pubblico di appartenenza (Dipendente Pubblico) SPLITPAY|8|1|0|Ente pubblico soggetto a split payment UTENTE|1|32|0|Utente dell'ultima modifica DATAAGG|5|8|0|Data ultima modifica -CODRFSO|1|6|0|Codice Rappresentate Fisc/Stabile Org -DATARFSO|5|8|0|Data Rappresentate Fisc/Stabile Org -INIFATTEL|5|8|0|Data inizio fatturazione elettronica -INIREVCHG|5|8|0|Data inizio reverse charge +CODRFSO|1|6|0|Missing description +DATARFSO|5|8|0|Missing description +INIFATTEL|5|8|0|Missing description +INIREVCHG|5|8|0|Missing description 6 TIPOCF+CODCF| TIPOCF+UPPER(RAGSOC)|X diff --git a/src/cg/f23.dir b/src/cg/f23.dir index cb74e5a08..b03142221 100755 --- a/src/cg/f23.dir +++ b/src/cg/f23.dir @@ -1,3 +1,3 @@ 23 0 -$mov|0|0|479|0|Movimenti di prima nota|NMOV|| +$mov|96174|96174|559|0|Movimenti di prima nota|NMOV|| diff --git a/src/cg/f23.trr b/src/cg/f23.trr index 4795f2e28..911e537e3 100755 --- a/src/cg/f23.trr +++ b/src/cg/f23.trr @@ -1,5 +1,5 @@ 23 -59 +60 ANNOES|9|4|0|Codice esercizio NUMREG|3|7|0|Numero di operazione DATAREG|5|8|0|Data operazione @@ -59,6 +59,7 @@ CFBOLLADOG|1|7|0|Codice fornitore a cui TFINVIO|7|1|0|Flag Invio Trasferimento Fatture TFDATA|5|8|0|Data ultimo invio Trasferimento Fatture IVALIQ|8|1|0|Iva per cassa liquidata completamente +KEYFPPRO|1|80|0|Chiavi dell'FPPRO [KEYPRGINVIO;KEYHEADERFATT;KEYBODYFATT] 4 NUMREG| DATAREG+NUMREG|X diff --git a/src/ef/dc800000.frm b/src/ef/dc800000.frm index 3de24d0a3..6f54d50db 100644 --- a/src/ef/dc800000.frm +++ b/src/ef/dc800000.frm @@ -1,6 +1,6 @@ USE 31 JOIN 14 INTO NPROGTR==NPROGTR -JOIN 20 INTO TIPOCF=="F" CODCF==CODCF +JOIN 20 INTO TIPOCF=="C" CODCF==CODCF JOIN 17 TO 20 INTO TIPOCF==TIPOCF CODCF==CODCF JOIN 16 TO 17 INTO TIPOCF==TIPOCF CODCF==CODCF CODIND==CODINDEFF JOIN 13 TO 20 INTO COM==COMCF @@ -70,7 +70,7 @@ END STRING 6 20 BEGIN KEY "scritta titolo righe del body" -PROMPT 2 7 "CREDITORE" +PROMPT 2 7 "DEBITORE" END STRING 7 10 BEGIN @@ -112,12 +112,12 @@ END SECTION BODY ODD 6 STRING 15 2 1 BEGIN -KEY "creditore" +KEY "debitore" PROMPT 1 1 "@B" END STRING 16 25 2 BEGIN -KEY "creditore" +KEY "debitore" PROMPT 2 1 "" FIELD 20->RAGSOC MESSAGE INC,FL->2 diff --git a/src/ef/dse.frm b/src/ef/dse.frm index 39974fef2..936a9f51a 100755 --- a/src/ef/dse.frm +++ b/src/ef/dse.frm @@ -1,6 +1,6 @@ USE 31 JOIN 14 INTO NPROGTR==NPROGTR -JOIN 20 INTO TIPOCF=="C" CODCF==CODCF +JOIN 20 INTO TIPOCF==TIPOCF CODCF==CODCF JOIN 17 TO 20 INTO TIPOCF==TIPOCF CODCF==CODCF JOIN 16 TO 17 INTO TIPOCF==TIPOCF CODCF==CODCF CODIND==CODINDEFF JOIN 13 TO 20 INTO COM==COMCF diff --git a/src/f1/f1lib.cpp b/src/f1/f1lib.cpp index ab26cb2a9..18d4640c9 100644 --- a/src/f1/f1lib.cpp +++ b/src/f1/f1lib.cpp @@ -92,6 +92,11 @@ TString get_dataendreg() return ini_get_string(FILE_CONFIG, FILE_SECTION, "dataendreg"); } +bool get_periodprec() +{ + return ini_get_bool(CONFIG_DITTA, FILE_SECTION, "flag_periodprec"); +} + void set_endatareg(bool enable) { ini_set_bool(FILE_CONFIG, FILE_SECTION, "endatareg", enable); @@ -107,6 +112,11 @@ void set_dataendreg(const TString& date) ini_set_string(FILE_CONFIG, FILE_SECTION, "dataendreg", date); } +void set_periodprec(bool flag) +{ + ini_set_bool(CONFIG_DITTA, FILE_SECTION, "flag_periodprec", flag); +} + bool check_causale(const TString& cod_caus) { return check_causale(cod_caus, "FA") || check_causale(cod_caus, "NC"); @@ -130,13 +140,13 @@ bool check_causale(const TString& cod_caus, const TString& tipo_doc) return false; } -void run_cont_ini() +void run_cont_ini(bool liq) { static TString run_string; #ifdef DBG - run_string.cut(0) << "cg2 -0 -i" << F1_INIREGCONT << "*" << ".ini" << " /u" << user(); + run_string.cut(0) << "cg2 -0 -i" << F1_INIREGCONT << "*" << ".ini" << " -f1" << (liq? " -liq" : " ") << " /u" << user(); #else - run_string.cut(0) << "cg2 -0 -i" << TFilename().tempdir() << "\\" << F1_INIREGCONT << "*" << ".ini" << " /u" << user(); + run_string.cut(0) << "cg2 -0 -i" << TFilename().tempdir() << "\\" << F1_INIREGCONT << "*" << ".ini" << " -f1" << (liq ? " -liq" : " ") << " /u" << user(); #endif TExternal_app(run_string).run(); } @@ -151,14 +161,7 @@ void TF1_log::log(int severity, const char* msg) } static TString txt; - txt.cut(0); - if (severity == LOG_MSG) - txt << "[message] : "; - else if(severity == LOG_WARN) - txt << "[warning] : "; - else if (severity == LOG_ERR) - txt << "[error] : "; - txt << msg; + txt.cut(0) << msg; _log->log(severity, txt); // Scrivo anche su file std::filebuf fb; @@ -166,8 +169,8 @@ void TF1_log::log(int severity, const char* msg) std::ostream os(&fb); os << txt << std::endl; fb.close(); - } + bool TF1_log::show_log() { if (_log) diff --git a/src/f1/f1lib.h b/src/f1/f1lib.h index dd522c63a..323fe2f27 100644 --- a/src/f1/f1lib.h +++ b/src/f1/f1lib.h @@ -55,19 +55,23 @@ public: bool show_log(); }; -void set_ini_codcaus(const TString& codcaus, bool nc = false); const char* get_ini_codcaus(bool nc = false); const char* get_codcaus(const char * tipodoc, const char* codcf); bool get_endatareg(); TString get_datainireg(); TString get_dataendreg(); +bool get_periodprec(); + +void set_ini_codcaus(const TString& codcaus, bool nc = false); void set_endatareg(bool enable); void set_datainireg(const TString& date); void set_dataendreg(const TString& date); +void set_periodprec(bool flag); + // Controlla se il "cod_caus" e' per Fatture d'acquisto o Note Credito d'Acquisto bool check_causale(const TString& cod_caus); // Controlla se il "cod_caus" ha come "tipo_doc" FA o NC (di acquisto) bool check_causale(const TString& cod_caus, const TString& tipo_doc); -void run_cont_ini(); +void run_cont_ini(bool liq); #endif \ No newline at end of file diff --git a/src/fp/fp0100.cpp b/src/fp/fp0100.cpp index 49adc7e18..478d60745 100644 --- a/src/fp/fp0100.cpp +++ b/src/fp/fp0100.cpp @@ -48,6 +48,7 @@ void TParametri_mask::save_all() const fp_settings().set_check_not_block(get_bool(F_CHECK_NOT_BLOCK)); fp_settings().set_no_sconti_fatt(get_bool(F_CHECK_NO_SCONTI)); fp_settings().set_no_export_pronto(get_bool(F_CHECK_NO_EXPORT_PRONTO)); + fp_settings().set_data_start_fatt(get_date(F_STARTFATTEL)); TFP_righe_custom().save_sheet(sfield(F_FORMPERS)); TFP_nota_piede_f().save_sheet(sfield(F_NPFSHEET)); } @@ -226,6 +227,10 @@ bool TParametri_mask::on_field_event(TOperable_field& o, TField_event e, long jo } } break; + case F_STARTFATTEL: + if (e == fe_init) + field(F_STARTFATTEL).set(fp_settings().get_data_start_fatt()); + break; default: break; } diff --git a/src/fp/fp0100a.h b/src/fp/fp0100a.h index 53f1bc5aa..cfec5c6dc 100644 --- a/src/fp/fp0100a.h +++ b/src/fp/fp0100a.h @@ -11,6 +11,7 @@ #define F_CHECK_NOT_BLOCK 211 #define F_CHECK_NO_SCONTI 212 #define F_CHECK_NO_EXPORT_PRONTO 213 +#define F_STARTFATTEL 214 #define F_SETPATCH 301 #define F_ENPTYTABLE 302 diff --git a/src/fp/fp0100a.uml b/src/fp/fp0100a.uml index 6bf0392cf..bd4ab4367 100644 --- a/src/fp/fp0100a.uml +++ b/src/fp/fp0100a.uml @@ -87,6 +87,16 @@ BEGIN FLAGS "" END +GROUPBOX DLG_NULL 78 3 +BEGIN + PROMPT 1 16 "@BInizio Fatturazione Elettronica" +END + +DATE F_STARTFATTEL +BEGIN + PROMPT 2 17 "Data inizio (default 01-01-2019)" +END + ENDPAGE PAGE "Configurazione (2) " 0 2 0 0 diff --git a/src/fp/fp0400.cpp b/src/fp/fp0400.cpp index f77b2a55c..c25932203 100644 --- a/src/fp/fp0400.cpp +++ b/src/fp/fp0400.cpp @@ -14,6 +14,7 @@ #define FILTER_ASS "E" #define FILTER_ALL "A" #define FILTER_CONT "C" +#define PARA_FP "fp" enum { @@ -53,7 +54,7 @@ protected: // Tasto nuovo: apre nuovo fornitore valorizzando già i dati dalla fattura void new_forn(); // Tasto aggiorna: aggiorna cliente che non corrisponde. - void aggiorna_forn(); + bool aggiorna_forn(); void salva_for() const; void clean_ini(const TString& filename) const; void run_cg0(const TString& filename) const; @@ -151,7 +152,7 @@ void TPassive_mask::fill() "LEFT JOIN PAA2600F PAA26 ON P1_KEYPRGINVIO = PP_KEYPRGINVIO and P1_KEYHEADERFATT = PP_KEYHEADERFATT and P1_KEYBODYFATT = PP_KEYBODYFATT\n" << "LEFT JOIN PAA3200F PAA32 ON P1_KEYPRGINVIO = PU_KEYPRGINVIO and P1_KEYHEADERFATT = PU_KEYHEADERFATT and P1_KEYBODYFATT = PU_KEYBODYFATT\n" << "LEFT JOIN FPPRO00F FPPRO ON P1_KEYPRGINVIO = PZ_KEYPRGINVIO and P1_KEYHEADERFATT = PZ_KEYHEADERFATT and P1_KEYBODYFATT = PZ_KEYBODYFATT\n" << - "WHERE P7_DATA >= \'" << dal.date2ansi() << "\' AND P7_DATA <= \'" << al.date2ansi() << "\'" << prots_query << "\n" << + "WHERE PZ_DATAORARIC >= \'" << dal.date2ansi() << "\' AND PZ_DATAORARIC < \'" << al.date2ansi()+1 << "\'" << prots_query << "\n" << "GROUP BY YEAR(P7_DATA), P7_TIPODOC, P7_NUMERO, P7_DATA, PZ_DATAORARIC, PQ_IMPTOTDOC, PZ_NUMREGCONT, PZ_DATAREGCONT, P2_ANADENOMIN, P2_ANANOME, P2_ANACOGNOME, P2_FISCIVACOD, P2_CODFISCALE, P2_FISCIVAPAESE,\n" << "P1_CODDEST, PU_PEC, P1_KEYPRGINVIO, P1_KEYHEADERFATT, P1_KEYBODYFATT, PZ_TIPOPROT, PZ_NUMPROT, PZ_ANNOPROT, PZ_TIPOCF, PZ_CLIFOR\n" << "ORDER BY " << (ordin == "D"? "P7_DATA" : "PZ_DATAORARIC") << " " << (verso_ord == "C"? "ASC" : "DESC"); @@ -512,7 +513,7 @@ void TPassive_mask::clean_ini(const TString& filename) const #ifdef DBG remove_string.cut(0) << filename << "*.ini"; #else - remove_string.cut(0) << _tmp_dir << "\\" << filename << "*.*"; + remove_string.cut(0) << _tmp_dir << "\\" << filename << "*.ini"; #endif remove_files(remove_string, false); } @@ -520,7 +521,11 @@ void TPassive_mask::clean_ini(const TString& filename) const void TPassive_mask::run_cg0(const TString& filename) const { static TString run_string; - run_string.cut(0) << "cg0 -1 -i" << _tmp_dir << "\\" << filename << "*" << ".ini" << " /u" << user(); +#ifdef DBG + run_string.cut(0) << "cg0 -1 -i" << filename << "*.ini" << " /u" << user(); +#else + run_string.cut(0) << "cg0 -1 -i" << _tmp_dir << "\\" << filename << "*.ini" << " /u" << user(); +#endif TExternal_app(run_string).run(); } @@ -550,6 +555,7 @@ int TPassive_mask::prepara_contab() const newf_ini << F1_INIREGCONT << num << ".ini"; #endif TConfig contab_ini(newf_ini, "Transaction"); + TString prokeys = row->get(sf.cid2index(S_PROKEY)); contab_ini.set("Action", "INSERT"); @@ -561,7 +567,41 @@ int TPassive_mask::prepara_contab() const contab_ini.set("NUMDOCEXT", row->get(sf.cid2index(S_NDOC))); contab_ini.set("NUMDOC", TString(row->get(sf.cid2index(S_NDOC))).right(7)); contab_ini.set("TOTDOC", abs(real(row->get(sf.cid2index(S_TOTDOC)))).string()); - contab_ini.set("KEYFPPRO", row->get(sf.cid2index(S_PROKEY))); + contab_ini.set("KEYFPPRO", prokeys); + + // Se ci sono le scadenze esporto anche quelle + TToken_string keys(prokeys, ';'); + TString where_q; + where_q << "WHERE PO_KEYPRGINVIO = '" << keys.get() << "'"; + where_q << " AND PO_KEYHEADERFATT = '" << keys.get() << "'"; + where_q << " AND PO_KEYBODYFATT = '" << keys.get() << "'"; + + TString query; query << "SELECT PO_RIGA AS RIGA, PO_DATASCADENZA AS DATA, PO_IMPORTO AS IMPORTO \nFROM PAA2500F \n" << where_q; + + fp_db().sq_set_exec(query,false); + for (bool ok = fp_db().sq_next(); ok; ok = fp_db().sq_next()) + { + const int riga = real(fp_db().sq_get("RIGA")).integer(); + contab_ini.set_paragraph(LF_SCADENZE, riga); // Setto il paragrafo con riga scad + contab_ini.set("DATASCAD", fp_db().sq_get_date("DATA")); + contab_ini.set("IMPORTO", fp_db().sq_get("IMPORTO")); + contab_ini.set("NRATA", riga); + contab_ini.set("NRIGA", "1"); + } + + where_q.cut(0) << "WHERE PL_KEYPRGINVIO = '" << keys.get(0); + where_q << "' AND PL_KEYHEADERFATT = '" << keys.get(); + where_q << "' AND PL_KEYBODYFATT = '" << keys.get() << "'"; + query.cut(0) << "SELECT PL_IMPONIBILE AS IMPONIBILE, PL_IMPOSTA AS IMPOSTA \nFROM PAA2200F \n" << where_q; + fp_db().sq_set_exec(query, false); + int i = 1; + for (bool ok = fp_db().sq_next(); ok; ok = fp_db().sq_next(), i++) + { + contab_ini.set_paragraph(LF_RMOVIVA, i); + contab_ini.set("IMPONIBILE", fp_db().sq_get("IMPONIBILE")); + contab_ini.set("IMPOSTA", fp_db().sq_get("IMPOSTA")); + contab_ini.set("NRIGA", i); + } row->add("", 0); } @@ -581,7 +621,7 @@ void TPassive_mask::log_contab() TFilename cg_ini; TString msg; TF1_log log; - std::vector doc_saved, doc_canceled; + std::vector doc_saved, doc_canceled, save_numreg, save_protiv; FOR_EACH_SHEET_ROW(sfield(F_DOCS), n, row) { TString num; num.format("%04d", n); @@ -594,10 +634,17 @@ void TPassive_mask::log_contab() { TConfig config(cg_ini, "Transaction"); TString numdoc; + TString numreg; + TString protiv; + if (config.get("Result") == "OK") { numdoc = config.get("NUMDOC", "23"); + numreg = config.get("NUMREG", "23"); + protiv = config.get("PROTIVA", "23"); doc_saved.insert(doc_saved.end(), numdoc); + save_numreg.insert(save_numreg.end(), numreg); + save_protiv.insert(save_protiv.end(), protiv); } else if(config.get("Result") == "CANCEL") { @@ -611,13 +658,15 @@ void TPassive_mask::log_contab() if (elem_save > 0) { if (elem_save == 1) - msg << "Il documento n. '" << doc_saved[0] << "' e' stata registrato."; + msg << "Il documento n. '" << doc_saved[0] << "' e' stato registrato con numero movimento contabile '" << save_numreg[0] << "' e protocollo iva '" << save_protiv[0] << "'."; else msg << "Sono stati registrati " << elem_save << " documenti."; if (elem_save > 1) for (int i = 0; i < elem_save; i++) - msg << "\n - Documento n. '" << doc_saved[i] << "'"; - log.log(LOG_MSG, msg); + msg << "\n - Documento n. '" << doc_saved[i] << "': movimento contabile '" << save_numreg[0] << "', protocollo iva '" << save_protiv[0] << "'"; + TToken_string msg_tok(msg, '\n'); + for(int i=0; i 0) { @@ -629,7 +678,9 @@ void TPassive_mask::log_contab() if (elem_canc > 1) for (int i = 0; i < elem_canc; i++) msg << "\n - Documento n. '" << doc_canceled[i] << "'"; - log.log(LOG_WARN, msg); + TToken_string msg_tok(msg, '\n'); + for (int i = 0; i < msg_tok.items(); i++) + log.log(LOG_WARN, msg_tok.get()); } if (elem_save > 0 || elem_canc > 0) log.show_log(); @@ -642,7 +693,8 @@ void TPassive_mask::contabilizza() switch(stato) { case is_ready: - run_cont_ini(); // Eseguo gli ini + run_cont_ini(get_bool(F_PERIODPREC)); + // Eseguo gli ini log_contab(); // Mostro stato contabilizzate/annullate clean_ini(F1_INIREGCONT); fill(); // Ricarico sheet per togliere quelli contabilizzati @@ -688,6 +740,7 @@ void TPassive_mask::new_forn() TSheet_field& sf = sfield(F_ERR); static const TString newf = "fpnewf"; clean_ini(newf); + FOR_EACH_SHEET_ROW(sf, nr, row) { const TString denom = row->get(sf.cid2index(S_RAGSERR)); @@ -710,7 +763,11 @@ void TPassive_mask::new_forn() TString num; num.format("%04d", nr); TFilename newf_ini; - newf_ini.tempdir() << "\\" << newf << num << ".ini"; +#ifdef DBG + newf_ini << newf << num << ".ini"; +#else + newf_ini.tempdir() << "\\" << newf << num << ".ini"; +#endif TConfig forn_conf(newf_ini, "Transaction"); @@ -736,11 +793,12 @@ void TPassive_mask::new_forn() sf.force_update(); } -void TPassive_mask::aggiorna_forn() +bool TPassive_mask::aggiorna_forn() { TSheet_field& sf = sfield(F_ERR); static const TString newf = "fpaggf"; clean_ini(newf); + int count = 0; FOR_EACH_SHEET_ROW(sf, nr, row) { const TString denom = row->get(sf.cid2index(S_RAGSERR)); @@ -749,9 +807,10 @@ void TPassive_mask::aggiorna_forn() const int& n_row_elenco = forn_err.fatt_err; // Prendo che numero di riga a cui mi riferisco in fatture TSheet_field& f_docs = sfield(F_DOCS); // Prendo SheetField da elenco fatture TToken_string& row_elenco_fatt = f_docs.row(n_row_elenco); // Prendo riga dall'elenco delle fatture - + if (row->starts_with("X") && cod_forn == no_match_cf) { + count++; TLocalisamfile clifo(LF_CLIFO); clifo.setkey(5); clifo.put(CLI_TIPOCF, 'F'); @@ -769,7 +828,11 @@ void TPassive_mask::aggiorna_forn() { TString num; num.format("%04d", nr); TFilename newf_ini; +#ifdef DBG + newf_ini << newf << num << ".ini"; +#else newf_ini.tempdir() << "\\" << newf << num << ".ini"; +#endif TConfig forn_conf(newf_ini, "Transaction"); forn_conf.set("Action", "MODIFY"); @@ -778,13 +841,20 @@ void TPassive_mask::aggiorna_forn() forn_conf.set("TIPOCF", "F"); forn_conf.set("COFI", row->get(sf.cid2index(S_CODFIERR))); forn_conf.set("CODCF", clifo.get(CLI_CODCF)); - - row->add("", 0); + TString codsdi; codsdi << row_elenco_fatt.get(16); + if (!codsdi.empty() && codsdi != "0000000") + { + forn_conf.set_paragraph("17"); + forn_conf.set("PADESTIN", codsdi); + } } } + row->add("", 0); } - run_cg0(newf); + if (count) + run_cg0(newf); sf.force_update(); + return count; } @@ -855,8 +925,11 @@ bool TPassive_mask::on_field_event(TOperable_field& o, TField_event e, long joll break; case DLG_SAVEREC: if (e == fe_button) - if(curr_page() == elenco_fe) + if (curr_page() == elenco_fe) + { salva_for(); + fill(); + } break; case DLG_NEWREC: if(e == fe_button) @@ -866,7 +939,8 @@ bool TPassive_mask::on_field_event(TOperable_field& o, TField_event e, long joll case DLG_RECALC: if (e == fe_button) if (curr_page() == elenco_err) - aggiorna_forn(); + if (aggiorna_forn()) + fill(); break; case DLG_EXPORT: if (e == fe_button && curr_page() == elenco_fe) @@ -880,6 +954,10 @@ bool TPassive_mask::on_field_event(TOperable_field& o, TField_event e, long joll if (e == fe_init) o.set(TDate(TODAY)); break; + case F_PERIODPREC: + if (e == fe_init) + o.set(get_periodprec()? "X" : ""); + break; default: break; } if (o.dlg() >= F_FORNOTASS && o.dlg() <= F_CONTABIL) @@ -970,8 +1048,9 @@ void TPassive_app::save_field(const TPassive_mask& mask) { set_ini_codcaus(mask.get(F_CAUSFA)); set_datainireg(mask.get(F_DATAINIREG)); + set_periodprec(mask.get_bool(F_PERIODPREC)); } - ini_set_string(CONFIG_DITTA, "fp", "dataini_fp04", mask.get(F_DATAINI)); + ini_set_string(CONFIG_DITTA, PARA_FP, "dataini_fp04", mask.get(F_DATAINI)); } void TPassive_app::main_loop() diff --git a/src/fp/fp0400a.h b/src/fp/fp0400a.h index a1f5de1f0..f83ebdc35 100644 --- a/src/fp/fp0400a.h +++ b/src/fp/fp0400a.h @@ -15,6 +15,7 @@ #define F_DESCAUSNC 515 #define F_GROUPCON 516 #define F_GROUPCAU 517 +#define F_PERIODPREC 518 #define END_MASK 599 diff --git a/src/fp/fp0400a.uml b/src/fp/fp0400a.uml index c13b38b1f..2ab175d2c 100644 --- a/src/fp/fp0400a.uml +++ b/src/fp/fp0400a.uml @@ -124,7 +124,7 @@ BEGIN ITEM "Codice\nProtocol.@12" END -GROUPBOX F_GROUPCAU 59 7 +GROUPBOX F_GROUPCAU 59 8 BEGIN PROMPT 31 10 "@BSelezionare Causale per Registrazione Contabile:" END @@ -213,6 +213,11 @@ BEGIN MODULE F1 END +BOOLEAN F_PERIODPREC +BEGIN + PROMPT 33 16 "Selezione automatica liquid. periodo precedente" +END + ENDPAGE PAGE "Elenco Fatture" 0 2 0 0 @@ -290,7 +295,6 @@ BEGIN PICTURE TOOL_LINK END - BUTTON DLG_CANCEL 2 2 BEGIN PROMPT 1 1 "" diff --git a/src/fp/fplib.h b/src/fp/fplib.h index 13f6de61a..cc5d1e26a 100644 --- a/src/fp/fplib.h +++ b/src/fp/fplib.h @@ -302,6 +302,7 @@ public: const TString& get_fld_dest() const; const TString& get_fld_dest_usr() const; const TString& get_cofi_tras() const; + const TString& get_data_start_fatt() const; const bool get_gest_alleg() const; const bool get_allega_fat() const; const bool get_esp_pri_empty() const; @@ -334,6 +335,7 @@ public: void set_body_mail(const char* msg, int idx = -1) const; void set_no_sconti_fatt(const bool no_sconti_fatt) const; void set_no_export_pronto(const bool no_export_pronto) const; + void set_data_start_fatt(const char* date) const; void set_npf(const char * tipodoc, const char* msg, int idx) const; void set_npf_tipodoc(const TString& tipodoc, int indx) const; diff --git a/src/fp/fplib01.cpp b/src/fp/fplib01.cpp index 25cc16ea0..fb2e33cb3 100644 --- a/src/fp/fplib01.cpp +++ b/src/fp/fplib01.cpp @@ -1639,7 +1639,7 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc) paf1200f.set("PB_RIFNUMLINEA", 0L); paf1200f.set("PB_IDDOC", con); paf1200f.set("PB_DATADOCO", datadoc); - paf1200f.set("PB_COMMESSACONV", com); + paf1200f.set("PB_COMMCONVENZ", com); paf1200f.set("PB_CODCUP", cup); paf1200f.set("PB_CODCIG", cig); paf1200f.set("PB_GESTIONE", "D"); diff --git a/src/fp/fplib02.cpp b/src/fp/fplib02.cpp index 6f3f4f30d..3c19a60ba 100644 --- a/src/fp/fplib02.cpp +++ b/src/fp/fplib02.cpp @@ -24,6 +24,7 @@ #define FP_NOTA_PIEDE_F "npf" // Nota piede fattura #define FP_CHECK_NO_SCONTI_FATT "noscontifatt" #define FP_CHECK_NO_EXPORT_PRONTO "noexportpronto" +#define FP_DATASTARTFATT "datastartfatt" // Sheet fp0300 #define FP_SLD_COD "SLD" @@ -87,6 +88,11 @@ const TString& TFP_settings::get_cofi_tras() const return ini_get_string(FILE_CONFIG, FILE_SECTION, FP_COFI_TRAS); } +const TString& TFP_settings::get_data_start_fatt() const +{ + return ini_get_string(FILE_CONFIG, FILE_SECTION, FP_DATASTARTFATT, "01-01-2019"); +} + const bool TFP_settings::get_gest_alleg() const { return ini_get_bool(FILE_CONFIG, FILE_SECTION, FP_GEST_ALLEG); @@ -241,6 +247,11 @@ void TFP_settings::set_no_export_pronto(const bool no_export_pronto) const ini_set_bool(FILE_CONFIG, FILE_SECTION, FP_CHECK_NO_EXPORT_PRONTO, no_export_pronto); } +void TFP_settings::set_data_start_fatt(const char* date) const +{ + ini_set_bool(FILE_CONFIG, FILE_SECTION, FP_DATASTARTFATT, date); +} + void TFP_settings::remove_para_ini(int idx) { ini_remove(FILE_CONFIG, FILE_SECTION, FP_MAIL, idx); diff --git a/src/include/modaut.h b/src/include/modaut.h index 464848e9b..69848838e 100755 --- a/src/include/modaut.h +++ b/src/include/modaut.h @@ -48,11 +48,10 @@ #define BSAUT 45 #define HAAUT 46 #define RIAUT 47 -#define VDAUT 48 -#define GVAUT 49 -#define TFAUT 50 -#define F1AUT 51 -#define F9AUT 52 +#define GVAUT 48 +#define TFAUT 49 +#define F1AUT 50 +#define F9AUT 51 #define ENDAUT 52 diff --git a/src/include/msksheet.cpp b/src/include/msksheet.cpp index c02199282..c8a133b7a 100755 --- a/src/include/msksheet.cpp +++ b/src/include/msksheet.cpp @@ -18,6 +18,11 @@ extern "C" #include #include +int cid2index(short cid) +{ + return xvtil_cid2index(cid); +} + class TCell_property : public TObject { COLOR _back, _fore; @@ -3064,6 +3069,71 @@ const char* TSheet_field::cell(int r, int c) const return v ? v : " "; } +int TSheet_field::set_row_cell(short id, const char * value, int nrow) +{ + if (nrow < 0) + nrow = first_empty(); + set_row_cell(row(nrow), id, value); +#ifdef DBG + const TToken_string & r = row(nrow); +#endif + return nrow; +} + +int TSheet_field::set_row_cell(short id, char value, int nrow) +{ + if (nrow < 0) + nrow = first_empty(); + set_row_cell(row(nrow), id, value); +#ifdef DBG + const TToken_string & r = row(nrow); +#endif + return nrow; +} + +int TSheet_field::set_row_cell(short id, long value, int nrow) +{ + if (nrow < 0) + nrow = first_empty(); + set_row_cell(row(nrow), id, value); +#ifdef DBG + const TToken_string & r = row(nrow); +#endif + return nrow; +} + +int TSheet_field::set_row_cell(short id, int value, int nrow) +{ + if (nrow < 0) + nrow = first_empty(); + set_row_cell(row(nrow), id, value); +#ifdef DBG + const TToken_string & r = row(nrow); +#endif + return nrow; +} + +int TSheet_field::set_row_cell(short id, const real& value, int nrow) +{ + if (nrow < 0) + nrow = first_empty(); + set_row_cell(row(nrow), id, value); +#ifdef DBG + const TToken_string & r = row(nrow); +#endif + return nrow; +} + +int TSheet_field::set_row_cell(short id, const TDate& value, int nrow) +{ + if (nrow < 0) + nrow = first_empty(); + set_row_cell(row(nrow), id, value); +#ifdef DBG + const TToken_string & r = row(nrow); +#endif + return nrow; +} // Certified 100% // Ritorna l'indice della prima riga vuota dello sheet diff --git a/src/include/msksheet.h b/src/include/msksheet.h index 06a65d0fb..283174cc5 100755 --- a/src/include/msksheet.h +++ b/src/include/msksheet.h @@ -18,6 +18,7 @@ class TRecord_array; class TRelation; #endif + #define FIRST_FIELD 101 #define K_ROWEDIT ( K_CTRL + 'I' ) @@ -35,6 +36,7 @@ typedef bool (*SPREADSHEET_NOTIFY)(TSheet_field& s, int r, KEY k); // @type SHEET_USERGETPUT| Prototipo funzione utente che gestisce il caricamento/salvataggio dei dati dello sheet typedef void (*SHEET_USERGETPUT)(TSheet_field &fld_righe, int item); +int cid2index(short cid); // @doc EXTERNAL // @class TSheet_field | Classe per la gestione dei campi di uno spreadsheet @@ -42,113 +44,133 @@ typedef void (*SHEET_USERGETPUT)(TSheet_field &fld_righe, int item); // @base public | TMask_field class TSheet_field : public TLoadable_field { - // @author:(INTERNAL) Guido + // @author:(INTERNAL) Guido - // @cfriend TSpreadsheet - friend class TSpreadsheet; + // @cfriend TSpreadsheet + friend class TSpreadsheet; - // @access:(INTERNAL) Private Member + // @access:(INTERNAL) Private Member - // @cmember:(INTERNAL) Indica se aggiungere a fondo dello spreadsheet o nella riga in cui ti trovi - bool _append; + // @cmember:(INTERNAL) Indica se aggiungere a fondo dello spreadsheet o nella riga in cui ti trovi + bool _append; - // @cmember:(INTERNAL) Separatore delle TToken_string - char _separator; + // @cmember:(INTERNAL) Separatore delle TToken_string + char _separator; - // @cmember:(INTERNAL) Flag di autoload - bool _enable_autoload; - // @cmember:(INTERNAL) Campi di input sulla maschera (key field names) - TToken_string _file_k_names; - // @cmember:(INTERNAL) Campi di input sulla maschera (key field ids) - TToken_string _file_k_ids; - // @cmember:(INTERNAL) file delle righe - TLocalisamfile * _sheetfile; - // @cmember:(INTERNAL) record array delle righe - TRecord_array* _linee_rec; - // @cmember:(INTERNAL) indicatore di record array gestito esternamente - bool _external_record; - // @cmember:(INTERNAL) funzioni utente per get tra record (array) e array righe - SHEET_USERGETPUT _userput; - // @cmember:(INTERNAL) funzioni utente per put tra righe e record (array) - SHEET_USERGETPUT _userget; + // @cmember:(INTERNAL) Flag di autoload + bool _enable_autoload; + // @cmember:(INTERNAL) Campi di input sulla maschera (key field names) + TToken_string _file_k_names; + // @cmember:(INTERNAL) Campi di input sulla maschera (key field ids) + TToken_string _file_k_ids; + // @cmember:(INTERNAL) file delle righe + TLocalisamfile * _sheetfile; + // @cmember:(INTERNAL) record array delle righe + TRecord_array* _linee_rec; + // @cmember:(INTERNAL) indicatore di record array gestito esternamente + bool _external_record; + // @cmember:(INTERNAL) funzioni utente per get tra record (array) e array righe + SHEET_USERGETPUT _userput; + // @cmember:(INTERNAL) funzioni utente per put tra righe e record (array) + SHEET_USERGETPUT _userget; - // @access Protected Member + // @access Protected Member protected: - // @cmember:(INTERNAL) Identificatore dell' ultima colonna dello sheet - short _last_column_id; + // @cmember:(INTERNAL) Identificatore dell' ultima colonna dello sheet + short _last_column_id; - // @cmember Ritorna l'identificatore della classe - virtual word class_id() const; - - virtual bool is_kind_of(word cid) const; + // @cmember Ritorna l'identificatore della classe + virtual word class_id() const; - // @cmember Gestisce la chiamata all'handler del campo - virtual bool on_hit(); - - // @cmember Legge la testata dello spreadsheet da

- virtual void parse_head(TScanner& scanner); - // @cmember Legge gli item dello spreadsheet da

- virtual bool parse_item(TScanner& scanner); - // @cmember Legge gli input (campi chiave) dello spreadsheet da

- void parse_input(TScanner& scanner); - // @cmember Crea lo spreadsheet - virtual void create(WINDOW parent); + virtual bool is_kind_of(word cid) const; - // @cmember Setta il focus sul campo - virtual void highlight() const; - // @cmember Ricopia i campi della maschera nel record

-esimo - virtual void mask2row(int n, TToken_string & rec); - // @cmember Ricopia i campi del record

-esimo nella maschera - virtual void row2mask(int n, TToken_string & rec, int mode = 0x3); - // @cmember Permette di mettere il focus su una cella - bool set_focus_cell(int riga, int colonna); + // @cmember Gestisce la chiamata all'handler del campo + virtual bool on_hit(); - //Copy Costructor per impedire la duplicazione accidentale degli sheet - TSheet_field(const TSheet_field& s): TLoadable_field(&s.mask()){CHECK(false, "Can't duplicate TSheet_field");} + // @cmember Legge la testata dello spreadsheet da

+ virtual void parse_head(TScanner& scanner); + // @cmember Legge gli item dello spreadsheet da

+ virtual bool parse_item(TScanner& scanner); + // @cmember Legge gli input (campi chiave) dello spreadsheet da

+ void parse_input(TScanner& scanner); + // @cmember Crea lo spreadsheet + virtual void create(WINDOW parent); - // @access Public Member + // @cmember Setta il focus sul campo + virtual void highlight() const; + // @cmember Ricopia i campi della maschera nel record

-esimo + virtual void mask2row(int n, TToken_string & rec); + // @cmember Ricopia i campi del record

-esimo nella maschera + virtual void row2mask(int n, TToken_string & rec, int mode = 0x3); + // @cmember Permette di mettere il focus su una cella + bool set_focus_cell(int riga, int colonna); + //Copy Costructor per impedire la duplicazione accidentale degli sheet + TSheet_field(const TSheet_field& s) : TLoadable_field(&s.mask()) { CHECK(false, "Can't duplicate TSheet_field"); } + + // @access Public Member public: // @cmember Permette di mettere il focus su una cella - bool set_focus_cell_id(long rec, short cid); + bool set_focus_cell_id(long rec, short cid); - // @cmember Gestisce la pressione del tasto (true se la gestione ha avuto successo) - virtual bool on_key(KEY k); + // @cmember Gestisce la pressione del tasto (true se la gestione ha avuto successo) + virtual bool on_key(KEY k); - // @cmember Si, sono uno spreadsheet - virtual bool is_sheet() const { return true; } - virtual bool empty() const { return items() == 0; } + // @cmember Si, sono uno spreadsheet + virtual bool is_sheet() const { return true; } + virtual bool empty() const { return items() == 0; } - // @cmember Legge automaticamente la linea dal record array assegnato - virtual bool autoload_line(int i,const TRectype & rec); - // @cmember Salva automaticamente la linea nel record array assegnato - virtual bool autosave_line(int i,TRectype & rec); + // @cmember Legge automaticamente la linea dal record array assegnato + virtual bool autoload_line(int i, const TRectype & rec); + // @cmember Salva automaticamente la linea nel record array assegnato + virtual bool autosave_line(int i, TRectype & rec); - // @cmember Legge automaticamente lo sheet dal record array assegnato - virtual bool autoload(const TRelation& r); - // @cmember Salva automaticamente lo sheet nel record array assegnato - virtual bool autosave(TRelation& r) ; - // @cmember setta la funzione utente che Legge i campi dello sheet - void set_userget(SHEET_USERGETPUT handler); - // @cmember setta la funzione utente che scrive i campi dello sheet - void set_userput(SHEET_USERGETPUT handler); - // @cmember carica le chiavi del record array dello sheet - TRectype * putkey(const TRelation& r); - // @cmember restituisce il record array assegnato allo sheet - TRecord_array * record() const {return _linee_rec;} - // @cmember Imposta un record array esterno che contiene le righe dello sheet - void set_lines_record(TRecord_array &); - // @cmember Ritorna se il record assegnato è gestito esternamente (read/write/remove) - bool external_record() const {return _external_record;} - // @cmember Gestisce i campi della chiave - void restart_key(); - TMask_field *get_key(TString & dbfieldname); + // @cmember Legge automaticamente lo sheet dal record array assegnato + virtual bool autoload(const TRelation& r); + // @cmember Salva automaticamente lo sheet nel record array assegnato + virtual bool autosave(TRelation& r); + // @cmember setta la funzione utente che Legge i campi dello sheet + void set_userget(SHEET_USERGETPUT handler); + // @cmember setta la funzione utente che scrive i campi dello sheet + void set_userput(SHEET_USERGETPUT handler); + // @cmember carica le chiavi del record array dello sheet + TRectype * putkey(const TRelation& r); + // @cmember restituisce il record array assegnato allo sheet + TRecord_array * record() const { return _linee_rec; } + // @cmember Imposta un record array esterno che contiene le righe dello sheet + void set_lines_record(TRecord_array &); + // @cmember Ritorna se il record assegnato è gestito esternamente (read/write/remove) + bool external_record() const { return _external_record; } + // @cmember Gestisce i campi della chiave + void restart_key(); + TMask_field *get_key(TString & dbfieldname); - // @cmember Ritorna una riga dello spreadsheet - TToken_string& row(int n); - // @cmember Ritorna un array con tutte le righe dello spreadsheet - TString_array& rows_array() const; - // @cmember Ritorna l'elemento

-esimo della riga

- const char* cell(int r, int c) const; + // @cmember Ritorna una riga dello spreadsheet + TToken_string& row(int n); + // @cmember Ritorna un array con tutte le righe dello spreadsheet + TString_array& rows_array() const; + // @cmember Ritorna l'elemento

-esimo della riga

+ const char* cell(int r, int c) const; + + virtual void set_row_cell(TToken_string & row, short id, const char * value) { row.add(value, cid2index(id)); } + virtual void set_row_cell(TToken_string & row, short id, char value) { row.add(value, cid2index(id)); } + virtual void set_row_cell(TToken_string & row, short id, long value) { row.add(value, cid2index(id)); } + virtual void set_row_cell(TToken_string & row, short id, int value) { row.add(value, cid2index(id)); } + virtual void set_row_cell(TToken_string & row, short id, const real& value) { row.add(value, cid2index(id)); } + virtual void set_row_cell(TToken_string & row, short id, const TDate& value) { row.add(value, cid2index(id)); } + + virtual int set_row_cell(short id, const char * value, int nrow = -1); + virtual int set_row_cell(short id, char value, int nrow = -1); + virtual int set_row_cell(short id, long value, int nrow = -1); + virtual int set_row_cell(short id, int value, int nrow = -1); + virtual int set_row_cell(short id, const real& value, int nrow = -1); + virtual int set_row_cell(short id, const TDate& value, int nrow = -1); + + virtual const char * get_str_row_cell(int nrow, short id) { return row(nrow).get(); } + virtual char get_char_row_cell(int nrow, short id) { return row(nrow).get_char(); } + virtual long get_long_row_cell(int nrow, short id) { return row(nrow).get_long(); } + virtual int get_int_row_cell(int nrow, short id) { return row(nrow).get_int(); } + virtual real get_real_row_cell(int nrow, short id) { return real(row(nrow).get()); } + virtual TDate get_date_row_cell(int nrow, short id) { return TDate(row(nrow).get()); } char separator() const { return _separator; } diff --git a/src/lv/lv0200.cpp b/src/lv/lv0200.cpp index 810149b65..9474e0ace 100755 --- a/src/lv/lv0200.cpp +++ b/src/lv/lv0200.cpp @@ -4,6 +4,7 @@ #include "lv0201.h" #include "lv0b00.h" +#include "lv0600a.h" class TStampa_tabelle_lv : public TSkeleton_application { @@ -70,8 +71,13 @@ void TStampa_tabelle_lv::main_loop() r.mask2report(m); } } - else - ok = r.load(rep); + else + { + if(mskname == "lv0600a") + m.set(F_NUM_G, ini_get_string(CONFIG_DITTA, "lv","NUM_GEN")); + ok = r.load(rep); + r.mask2report(m); + } } } if (ok) diff --git a/src/lv/lv0600a.h b/src/lv/lv0600a.h index 6f8b7b260..be2618e4a 100755 --- a/src/lv/lv0600a.h +++ b/src/lv/lv0600a.h @@ -14,4 +14,5 @@ #define F_CODCAUS_A 213 #define F_DESCAUS_A 214 #define F_ANNO_DA 215 -#define F_ANNO_A 216 \ No newline at end of file +#define F_ANNO_A 216 +#define F_NUM_G 217 \ No newline at end of file diff --git a/src/lv/lv0600a.rep b/src/lv/lv0600a.rep index b57d79918..f6cae34df 100755 --- a/src/lv/lv0600a.rep +++ b/src/lv/lv0600a.rep @@ -94,9 +94,9 @@ USE 34 SELECT BETWEEN(33.DATADOC,#F_DATA_FROM,#F_DATA_TO)STR(BETWEEN(33.CODCF,#F_CODCF_FROM,#F_CODCF_TO))BETWEEN(CODART,#F_CODARTI_FROM,#F_CODARTI_TO)BETWEEN(CODAGG1,#F_CODCAUSA_FROM,#F_CODCAUSA_TO) BY 33.CODCF 34.CODART 33.DATADOC -JOIN 33 TO 34 ALIAS 1000 INTO CODNUM==CODNUM ANNO==ANNO PROVV==PROVV NDOC==NDOC +JOIN 33 TO 34 ALIAS 1000 INTO CODNUM==CODNUM ANNO==ANNO PROVV==PROVV NDOC==NDOC JOIN 20 TO 33 ALIAS 2000 INTO TIPOCF==TIPOCF CODCF==CODCF JOIN 47 TO 34 ALIAS 3000 INTO CODART==CODART -FROM CODNUM="B05" ANNO=#ANNO_FROM -TO CODNUM="B05" ANNO=#ANNO_TO +FROM CODNUM=#CODNUM_G ANNO=#ANNO_FROM +TO CODNUM=#CODNUM_G ANNO=#ANNO_TO \ No newline at end of file diff --git a/src/lv/lv0600a.uml b/src/lv/lv0600a.uml index 47cf2e1d5..94222de54 100755 --- a/src/lv/lv0600a.uml +++ b/src/lv/lv0600a.uml @@ -244,6 +244,13 @@ BEGIN COPY OUTPUT F_CODCAUS_A END +STRING F_NUM_G 4 +BEGIN + PROMPT 2 16 "Numerazione " + FIELD #CODNUM_G + FLAGS "H" +END + ENDPAGE ENDMASK diff --git a/src/sc/pec.frm b/src/sc/pec.frm index 314a4eda9..d3ab23b38 100755 --- a/src/sc/pec.frm +++ b/src/sc/pec.frm @@ -185,7 +185,8 @@ SECTION HEADER ODD 14 KEY "Dati Pagamento" PROMPT 2 10 "@bPagamento " END -END +End + SECTION HEADER LAST 1 STRINGA 100 diff --git a/src/tf/tf0200.cpp b/src/tf/tf0200.cpp index 12206c11f..076d0b4e5 100644 --- a/src/tf/tf0200.cpp +++ b/src/tf/tf0200.cpp @@ -20,6 +20,12 @@ #include "tf0200a.h" #define CAMPI_CON_BOOLEAN F_TOTOPATT +#define CONF_MODULO "tf" +#define LAST_DATACOMP_ATT "LASTCOMPATT" +#define LAST_DATACOMP_PAS "LASTCOMPPAS" +#define FLAG_ATT_MOD "ATTDATACOMPMOD" +#define FLAG_PAS_MOD "PASDATACOMPMOD" +#define STOP "$$" // ComLiqPerIva: Comunicazione Liquidazioni Periodiche IVA @@ -209,6 +215,8 @@ void calcola_credito_prec(real& creprec, real& creaprec, bool mensile, int anno, class TCom_liq_per_iva_msk : public TAutomask { + bool _last_elab_att; // Flags per controllare se hanno cambiato il tipo di elaborazione (data competenza) + bool _last_elab_pas; protected: bool _mensile; // Aggiunta questa variabile per specificare se è stato impostato un tipo di liquidazione. @@ -216,14 +224,48 @@ protected: bool _init_liq; TRectype _true_data; + void write_datacomp_mod(bool enabled, bool attive); virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly); void extractinator(); void check_old_value(int field, const real& val); public: - TCom_liq_per_iva_msk() : TAutomask("tf0200a"), _true_data(LF_IVALIQ), _init_liq(false) { first_focus(F_ANNO); } + TCom_liq_per_iva_msk() : TAutomask("tf0200a"), _true_data(LF_IVALIQ), _init_liq(false) + { + _last_elab_att = ini_get_bool(CONFIG_DITTA, CONF_MODULO, LAST_DATACOMP_ATT, false); + _last_elab_pas = ini_get_bool(CONFIG_DITTA, CONF_MODULO, LAST_DATACOMP_PAS, false); + first_focus(F_ANNO); + } void save_gen(); }; +void TCom_liq_per_iva_msk::write_datacomp_mod(const bool enabled, bool attive) +{ + int count = 0; + + TString line; + const TDate today(TODAY); + TString mod; mod << user() << (enabled ? "|E|" : "|D|") << today.month() << "." << today.day(); + if (attive) + { + line = ini_get_string(CONFIG_DITTA, CONF_MODULO, FLAG_ATT_MOD, STOP, count); + for (; line != STOP; line = ini_get_string(CONFIG_DITTA, CONF_MODULO, FLAG_ATT_MOD, STOP, ++count)) {} + ini_set_string(CONFIG_DITTA, CONF_MODULO, FLAG_ATT_MOD, mod, count); + + ini_set_bool(CONFIG_DITTA, CONF_MODULO, LAST_DATACOMP_ATT, enabled); + _last_elab_att = enabled; + } + else + { + line = ini_get_string(CONFIG_DITTA, CONF_MODULO, FLAG_PAS_MOD, STOP, count); + for (; line != STOP; line = ini_get_string(CONFIG_DITTA, CONF_MODULO, FLAG_PAS_MOD, STOP, ++count)) {} + ini_set_string(CONFIG_DITTA, CONF_MODULO, FLAG_PAS_MOD, mod, count); + + ini_set_bool(CONFIG_DITTA, CONF_MODULO, LAST_DATACOMP_PAS, enabled); + _last_elab_pas = enabled; + } + +} + bool TCom_liq_per_iva_msk::on_field_event(TOperable_field& o, TField_event e, long jolly) { switch (o.dlg()) @@ -294,7 +336,29 @@ bool TCom_liq_per_iva_msk::on_field_event(TOperable_field& o, TField_event e, lo } } break; + case F_ATT_COMP: + if(e == fe_init) + set(F_ATT_COMP, _last_elab_att ? "X" : " "); + else if(e == fe_modify) + warning_box("Attenzione la modifica di questo valore comporta un diverso calcolo dei rigo VP2. L'utente è pregato di controllarne la correttezza.\nSi consiglia di ricalcolare e rispedire tutti periodi dell'anno"); + break; + case F_PAS_COMP: + if (e == fe_init) + set(F_PAS_COMP, _last_elab_pas ? "X" : " "); + else if (e == fe_modify) + warning_box("Attenzione la modifica di questo valore comporta un diverso calcolo dei rigo VP3. L'utente è pregato di controllarne la correttezza.\nSi consiglia di ricalcolare e rispedire tutti periodi dell'anno"); + break; case DLG_SAVEREC: + if(e == fe_button) + { + bool att_dt_comp = get_bool(F_ATT_COMP); + bool pas_dt_comp = get_bool(F_PAS_COMP); + if (att_dt_comp != _last_elab_att) + write_datacomp_mod(att_dt_comp, true); + if (pas_dt_comp != _last_elab_pas) + write_datacomp_mod(pas_dt_comp, false); + + } if(e != fe_init && !_true_data.empty()) _true_data.write_rewrite(TLocalisamfile(LF_IVALIQ)); } @@ -417,6 +481,8 @@ void TCom_liq_per_iva_msk::extractinator() // Per gli amici GTFO real ivaver = ZERO; real ivaverc = ZERO; + const bool att_dt_comp = get_bool(F_ATT_COMP); + const bool pas_dt_comp = get_bool(F_PAS_COMP); for(; start <= end; start++) { TDate data_da(1, start, anno); @@ -448,58 +514,68 @@ void TCom_liq_per_iva_msk::extractinator() // Per gli amici GTFO cur_iva.set_var("#DADATAREG", data_da); cur_iva.set_var("#ADATAREG", data_a); - for(bool ok = cur_iva.move_first(); ok; ok = cur_iva.move_next()) + for (bool ok = cur_iva.move_first(); ok; ok = cur_iva.move_next()) { TString totat, totpas, i; // Controllo che sia un movimento con codice non "non soggetto" TCodiceIVA codiva(cur_iva.get(FIELD_NAME(LF_RMOVIVA, RMI_CODIVA)).as_string()); - if(codiva.tipo() == "NS") continue; + if (codiva.tipo() == "NS") continue; // Controllo che la registrazione sia di del mese che mi interessa o con flag "liquidazione periodo precedente" const int month_reg = cur_iva.get("23." MOV_DATAREG).as_date().month(); const int month_liq = cur_iva.get("23." MOV_MESELIQ).as_int(); // month_liq viene valorizzato solo se è del mese precedente o sempre? Nei record vecchi ovviamente sarà a zero ma adesso che ci mette? - if ((month_reg == start && (month_liq == 0 || month_liq == month_reg)) || start == month_liq) + // Prendo il tipo di registro + TRegistro reg(cur_iva.get(FIELD_NAME(LF_MOV, MOV_REG)).as_string(), anno); + int tiporeg = reg.tipo(); + bool is_corrispettivo = reg.corrispettivi(); + + // Prendiamo l'imponibile + real imp = cur_iva.get("25.IMPONIBILE").as_real(); + real imposta = cur_iva.get("25.IMPOSTA").as_real(); + + if (tiporeg == iva_acquisti) { - // Prendo il tipo di registro - TRegistro reg(cur_iva.get(FIELD_NAME(LF_MOV, MOV_REG)).as_string(), anno); - int tiporeg = reg.tipo(); - bool is_corrispettivo = reg.corrispettivi(); + if ((!att_dt_comp || !((month_reg == start && (month_liq == 0 || month_liq == month_reg)) || start == month_liq)) + && (att_dt_comp || cur_iva.get(LF_MOV, MOV_DATAREG).as_date().month() == data_a.month())) + continue; + } + else + { + if ((!pas_dt_comp || !((month_reg == start && (month_liq == 0 || month_liq == month_reg)) || start == month_liq)) + && (pas_dt_comp || cur_iva.get(LF_MOV, MOV_DATAREG).as_date().month() == data_a.month())) + continue; + } - // Prendiamo l'imponibile - real imp = cur_iva.get("25.IMPONIBILE").as_real(); - real imposta = cur_iva.get("25.IMPOSTA").as_real(); - - // Se è un movimento IvaXCassa o LiqDiff - if (has_ixc && (cur_iva.get("23.IVAXCASSA").as_bool() || cur_iva.get("23.LIQDIFF").as_bool())) + // Se è un movimento IvaXCassa o LiqDiff + if (has_ixc && (cur_iva.get("23.IVAXCASSA").as_bool() || cur_iva.get("23.LIQDIFF").as_bool())) + { + if (tiporeg == iva_vendite) + totopattxc += imp; + else + totoppasxc += imp; + } + else + { + if (tiporeg == iva_vendite) { - if (tiporeg == iva_vendite) - totopattxc += imp; - else - totoppasxc += imp; + // Controllo il reverse charge, non va calcolato nel totale delle operazioni attive! + // Se non ha una riga di movimento non lo sommo + TString key_rc = cur_iva.get("23.NUMREG").as_string(); key_rc << "|1"; + if (!cache().get(LF_RMOV, key_rc).empty()) + { + // Controllo se è un corrispettivo non scorporato (imponibile e iva assieme) + if (is_corrispettivo && codiva.percentuale() > ZERO && imposta == ZERO) + { + // Nell'imponibile è presente il totale fattura, devo calcolare l'imposta e sottrarla + // Es iva 22% => imp : 122 = x : 100 + codiva.scorpora(imp); + } + totopatt += imp; + } } else - { - if (tiporeg == iva_vendite) - { - // Controllo il reverse charge, non va calcolato nel totale delle operazioni attive! - // Se non ha una riga di movimento non lo sommo - TString key_rc = cur_iva.get("23.NUMREG").as_string(); key_rc << "|1"; - if (!cache().get(LF_RMOV, key_rc).empty()) - { - // Controllo se è un corrispettivo non scorporato (imponibile e iva assieme) - if (is_corrispettivo && codiva.percentuale() > ZERO && imposta == ZERO) - { - // Nell'imponibile è presente il totale fattura, devo calcolare l'imposta e sottrarla - // Es iva 22% => imp : 122 = x : 100 - codiva.scorpora(imp); - } - totopatt += imp; - } - } - else - totoppas += imp; - } + totoppas += imp; } } diff --git a/src/tf/tf0200a.h b/src/tf/tf0200a.h index 6196787ca..75faff186 100644 --- a/src/tf/tf0200a.h +++ b/src/tf/tf0200a.h @@ -33,6 +33,8 @@ #define F_IMPNOVER 133 #define F_VEREFF 134 #define F_GENERATA 135 +#define F_ATT_COMP 136 +#define F_PAS_COMP 137 /* Booleani controllo modifiche (+50 rispetto al campo a cui si riferisce) */ diff --git a/src/tf/tf0200a.uml b/src/tf/tf0200a.uml index ee786b4da..8e9dafbe0 100644 --- a/src/tf/tf0200a.uml +++ b/src/tf/tf0200a.uml @@ -24,6 +24,16 @@ ENDPAGE PAGE "Impostazioni" 0 2 0 0 +BOOLEAN F_ATT_COMP +BEGIN + PROMPT 1 0 "@BAttive: Elaborare per data competenza" +END + +BOOLEAN F_PAS_COMP +BEGIN + PROMPT 50 0 "@BPassive: Elaborare per data competenza" +END + NUMBER F_CODDITTA 5 BEGIN PROMPT 1 1 "Codice "