Merge branch 'R_10_00' of http://10.65.20.33/sirio/CAMPO/campo into R_10_00
This commit is contained in:
commit
4d438cf21e
@ -118,7 +118,7 @@
|
|||||||
</Midl>
|
</Midl>
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
<Optimization>Disabled</Optimization>
|
<Optimization>Disabled</Optimization>
|
||||||
<AdditionalIncludeDirectories>..\src\include;..\src\xvaga;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>..\src\include;..\src\xvaga;..\src\xvtdb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
<PreprocessorDefinitions>_DEBUG;WIN32;__LONGDOUBLE__;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>_DEBUG;WIN32;__LONGDOUBLE__;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||||
<BrowseInformation>false</BrowseInformation>
|
<BrowseInformation>false</BrowseInformation>
|
||||||
|
@ -98,6 +98,9 @@
|
|||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
<OutputFile>$(IntDir)$(TargetName).bsc</OutputFile>
|
<OutputFile>$(IntDir)$(TargetName).bsc</OutputFile>
|
||||||
</Bscmake>
|
</Bscmake>
|
||||||
|
<PostBuildEvent>
|
||||||
|
<Command>"C:\Program Files (x86)\Windows Kits\10\bin\10.0.16299.0\x64\signtool.exe" sign /a /s MY /n "Sirio Informatica e Sistemi SPA" /fd sha256 /tr http://sha256timestamp.ws.symantec.com/sha256/timestamp /v "$(TargetPath)"</Command>
|
||||||
|
</PostBuildEvent>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
<Midl>
|
<Midl>
|
||||||
|
@ -100,6 +100,9 @@
|
|||||||
<Xdcmake>
|
<Xdcmake>
|
||||||
<OutputFile>$(IntDir)$(TargetName).xml</OutputFile>
|
<OutputFile>$(IntDir)$(TargetName).xml</OutputFile>
|
||||||
</Xdcmake>
|
</Xdcmake>
|
||||||
|
<PostBuildEvent>
|
||||||
|
<Command>"C:\Program Files (x86)\Windows Kits\10\bin\10.0.16299.0\x64\signtool.exe" sign /a /s MY /n "Sirio Informatica e Sistemi SPA" /fd sha256 /tr http://sha256timestamp.ws.symantec.com/sha256/timestamp /v "$(TargetPath)"</Command>
|
||||||
|
</PostBuildEvent>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
<Midl>
|
<Midl>
|
||||||
|
@ -97,6 +97,9 @@
|
|||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
<OutputFile>$(IntDir)$(TargetName).bsc</OutputFile>
|
<OutputFile>$(IntDir)$(TargetName).bsc</OutputFile>
|
||||||
</Bscmake>
|
</Bscmake>
|
||||||
|
<PostBuildEvent>
|
||||||
|
<Command>"C:\Program Files (x86)\Windows Kits\10\bin\10.0.16299.0\x64\signtool.exe" sign /a /s MY /n "Sirio Informatica e Sistemi SPA" /fd sha256 /tr http://sha256timestamp.ws.symantec.com/sha256/timestamp /v "$(TargetPath)"</Command>
|
||||||
|
</PostBuildEvent>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
<Midl>
|
<Midl>
|
||||||
|
@ -98,6 +98,9 @@
|
|||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
<OutputFile>$(IntDir)$(TargetName).bsc</OutputFile>
|
<OutputFile>$(IntDir)$(TargetName).bsc</OutputFile>
|
||||||
</Bscmake>
|
</Bscmake>
|
||||||
|
<PostBuildEvent>
|
||||||
|
<Command>"C:\Program Files (x86)\Windows Kits\10\bin\10.0.16299.0\x64\signtool.exe" sign /a /s MY /n "Sirio Informatica e Sistemi SPA" /fd sha256 /tr http://sha256timestamp.ws.symantec.com/sha256/timestamp /v "$(TargetPath)"</Command>
|
||||||
|
</PostBuildEvent>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
<Midl>
|
<Midl>
|
||||||
|
@ -101,6 +101,9 @@
|
|||||||
<Xdcmake>
|
<Xdcmake>
|
||||||
<OutputFile>$(IntDir)$(TargetName).xml</OutputFile>
|
<OutputFile>$(IntDir)$(TargetName).xml</OutputFile>
|
||||||
</Xdcmake>
|
</Xdcmake>
|
||||||
|
<PostBuildEvent>
|
||||||
|
<Command>"C:\Program Files (x86)\Windows Kits\10\bin\10.0.16299.0\x64\signtool.exe" sign /a /s MY /n "Sirio Informatica e Sistemi SPA" /fd sha256 /tr http://sha256timestamp.ws.symantec.com/sha256/timestamp /v "$(TargetPath)"</Command>
|
||||||
|
</PostBuildEvent>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
<Midl>
|
<Midl>
|
||||||
|
5
cd/test/cg0768.txt
Normal file
5
cd/test/cg0768.txt
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
cg2.exe
|
||||||
|
|
||||||
|
Aggiunta chiusura automatica maschera fppro
|
||||||
|
Disattivata multiselezione fattura dallo sheet dell fppro
|
||||||
|
Corretto messaggio di errore se si sta inserendo manualmente i dati
|
94
cd/test/cg0768a.ini
Normal file
94
cd/test/cg0768a.ini
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
[Main]
|
||||||
|
Demo=0
|
||||||
|
|
||||||
|
[cg1]
|
||||||
|
Edit_23 = cg2 -0
|
||||||
|
File(8) = cg2.exe|X
|
||||||
|
Patch = 768
|
||||||
|
Versione = 21511200
|
||||||
|
|
||||||
|
[cg99]
|
||||||
|
Kill(0) = bastndo.msk|x
|
||||||
|
Kill(1) = batblbu.msk|x
|
||||||
|
Kill(2) = bastzon.msk|x
|
||||||
|
Kill(3) = bastesc.msk|x
|
||||||
|
Kill(4) = bastscc.msk|x
|
||||||
|
Kill(5) = bastvet.msk|x
|
||||||
|
Kill(6) = bastcve.msk|x
|
||||||
|
Kill(7) = batbntb.msk|x
|
||||||
|
Kill(8) = bastndo.rep|x
|
||||||
|
Kill(9) = batbvet.msk|x
|
||||||
|
Kill(10) = batbcve.msk|x
|
||||||
|
Kill(11) = batbndo.msk|x
|
||||||
|
Kill(12) = bastpor.msk|x
|
||||||
|
Kill(13) = batbind.msk|x
|
||||||
|
Kill(14) = batbtit.msk|x
|
||||||
|
Kill(15) = bastntb.rep|x
|
||||||
|
Kill(16) = batbleg.msk|x
|
||||||
|
Kill(17) = bastcco.rep|x
|
||||||
|
Kill(18) = bastmsp.rep|x
|
||||||
|
Kill(19) = bastreg.rep|x
|
||||||
|
Kill(20) = bastcco.msk|x
|
||||||
|
Kill(21) = bastmsp.msk|x
|
||||||
|
Kill(22) = bastnot.msk|x
|
||||||
|
Kill(23) = batbcam.msk|x
|
||||||
|
Kill(24) = bastpor.rep|x
|
||||||
|
Kill(25) = batbpdb.msk|x
|
||||||
|
Kill(26) = batbins.msk|x
|
||||||
|
Kill(27) = bastscc.rep|x
|
||||||
|
Kill(28) = bastvet.rep|x
|
||||||
|
Kill(29) = bastpdb.msk|x
|
||||||
|
Kill(30) = batbesc.msk|x
|
||||||
|
Kill(31) = bastleg.msk|x
|
||||||
|
Kill(32) = bastivd.msk|x
|
||||||
|
Kill(33) = batbdpn.msk|x
|
||||||
|
Kill(34) = bastdpn.rep|x
|
||||||
|
Kill(35) = batbmsp.msk|x
|
||||||
|
Kill(36) = bastdpn.msk|x
|
||||||
|
Kill(37) = bastcve.rep|x
|
||||||
|
Kill(38) = bastesc.rep|x
|
||||||
|
Kill(39) = batbdel.msk|x
|
||||||
|
Kill(40) = bastver.rep|x
|
||||||
|
Kill(41) = bastcam.msk|x
|
||||||
|
Kill(42) = batbreg.msk|x
|
||||||
|
Kill(43) = bastivd.rep|x
|
||||||
|
Kill(44) = batbnot.msk|x
|
||||||
|
Kill(45) = bastntb.msk|x
|
||||||
|
Kill(46) = bastreg.msk|x
|
||||||
|
Kill(47) = batbzon.msk|x
|
||||||
|
Kill(48) = batbtra.msk|x
|
||||||
|
Kill(49) = bastcfi.msk|x
|
||||||
|
Kill(50) = bastarb.rep|x
|
||||||
|
Kill(51) = bastarb.msk|x
|
||||||
|
Kill(52) = bastpdb.rep|x
|
||||||
|
Kill(53) = cgtbcon.msk|x
|
||||||
|
Kill(54) = batbver.msk|x
|
||||||
|
Kill(55) = batblia.msk|x
|
||||||
|
Kill(56) = bastnot.rep|x
|
||||||
|
Kill(57) = batbinl.msk|x
|
||||||
|
Kill(58) = bastver.msk|x
|
||||||
|
Kill(59) = batbcco.msk|x
|
||||||
|
Kill(60) = bastcam.rep|x
|
||||||
|
Kill(61) = bastcfi.rep|x
|
||||||
|
Kill(62) = batbscc.msk|x
|
||||||
|
Kill(63) = batbcfi.msk|x
|
||||||
|
Kill(64) = bastzon.rep|x
|
||||||
|
Kill(65) = batbivd.msk|x
|
||||||
|
Kill(66) = batbpor.msk|x
|
||||||
|
Kill(67) = bastleg.rep|x
|
||||||
|
Kill(68) = batblia.msk|x
|
||||||
|
Kill(69) = batbarb.msk|x
|
||||||
|
|
||||||
|
[cg]
|
||||||
|
Data = 11-04-2019
|
||||||
|
Descrizione = Contabilita' Generale
|
||||||
|
Dischi = 1
|
||||||
|
Moduli = ba
|
||||||
|
OEM =
|
||||||
|
Patch = 768
|
||||||
|
PostProcess = bainst -0 CG
|
||||||
|
PreProcess =
|
||||||
|
Prezzo(1) =
|
||||||
|
Prezzo(2) =
|
||||||
|
Versione = 21511200
|
||||||
|
|
BIN
cd/test/cg0768a1.zip
Normal file
BIN
cd/test/cg0768a1.zip
Normal file
Binary file not shown.
4
cd/test/cg0770.txt
Normal file
4
cd/test/cg0770.txt
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
cg2.exe
|
||||||
|
|
||||||
|
- Corretti controllo modulo FP
|
||||||
|
- Corretto caricamento campo PROTFPPRO sulle maschere
|
94
cd/test/cg0770a.ini
Normal file
94
cd/test/cg0770a.ini
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
[Main]
|
||||||
|
Demo=0
|
||||||
|
|
||||||
|
[cg1]
|
||||||
|
Edit_23 = cg2 -0
|
||||||
|
File(8) = cg2.exe|X
|
||||||
|
Patch = 0770
|
||||||
|
Versione = 21511200
|
||||||
|
|
||||||
|
[cg99]
|
||||||
|
Kill(0) = bastreg.rep|x
|
||||||
|
Kill(1) = batbpdb.msk|x
|
||||||
|
Kill(2) = bastleg.msk|x
|
||||||
|
Kill(3) = bastmsp.rep|x
|
||||||
|
Kill(4) = bastpor.rep|x
|
||||||
|
Kill(5) = batbesc.msk|x
|
||||||
|
Kill(6) = bastscc.rep|x
|
||||||
|
Kill(7) = batbdpn.msk|x
|
||||||
|
Kill(8) = batbins.msk|x
|
||||||
|
Kill(9) = bastivd.msk|x
|
||||||
|
Kill(10) = bastntb.rep|x
|
||||||
|
Kill(11) = bastmsp.msk|x
|
||||||
|
Kill(12) = batbtit.msk|x
|
||||||
|
Kill(13) = bastcco.msk|x
|
||||||
|
Kill(14) = bastcco.rep|x
|
||||||
|
Kill(15) = batbcam.msk|x
|
||||||
|
Kill(16) = batbleg.msk|x
|
||||||
|
Kill(17) = bastnot.msk|x
|
||||||
|
Kill(18) = batbndo.msk|x
|
||||||
|
Kill(19) = batbcve.msk|x
|
||||||
|
Kill(20) = batbind.msk|x
|
||||||
|
Kill(21) = bastpor.msk|x
|
||||||
|
Kill(22) = batbcco.msk|x
|
||||||
|
Kill(23) = batbivd.msk|x
|
||||||
|
Kill(24) = bastver.msk|x
|
||||||
|
Kill(25) = bastzon.rep|x
|
||||||
|
Kill(26) = bastleg.rep|x
|
||||||
|
Kill(27) = batbpor.msk|x
|
||||||
|
Kill(28) = bastcfi.msk|x
|
||||||
|
Kill(29) = batblia.msk|x
|
||||||
|
Kill(30) = bastcfi.rep|x
|
||||||
|
Kill(31) = batbtra.msk|x
|
||||||
|
Kill(32) = batbver.msk|x
|
||||||
|
Kill(33) = bastcam.rep|x
|
||||||
|
Kill(34) = batbinl.msk|x
|
||||||
|
Kill(35) = batbcfi.msk|x
|
||||||
|
Kill(36) = bastnot.rep|x
|
||||||
|
Kill(37) = batbscc.msk|x
|
||||||
|
Kill(38) = batbdel.msk|x
|
||||||
|
Kill(39) = bastntb.msk|x
|
||||||
|
Kill(40) = bastarb.msk|x
|
||||||
|
Kill(41) = bastesc.rep|x
|
||||||
|
Kill(42) = batbnot.msk|x
|
||||||
|
Kill(43) = bastarb.rep|x
|
||||||
|
Kill(44) = batbzon.msk|x
|
||||||
|
Kill(45) = cgtbcon.msk|x
|
||||||
|
Kill(46) = bastreg.msk|x
|
||||||
|
Kill(47) = bastpdb.rep|x
|
||||||
|
Kill(48) = bastpdb.msk|x
|
||||||
|
Kill(49) = batbmsp.msk|x
|
||||||
|
Kill(50) = bastcam.msk|x
|
||||||
|
Kill(51) = bastvet.rep|x
|
||||||
|
Kill(52) = bastdpn.rep|x
|
||||||
|
Kill(53) = bastver.rep|x
|
||||||
|
Kill(54) = bastcve.rep|x
|
||||||
|
Kill(55) = bastivd.rep|x
|
||||||
|
Kill(56) = bastdpn.msk|x
|
||||||
|
Kill(57) = batbreg.msk|x
|
||||||
|
Kill(58) = batbarb.msk|x
|
||||||
|
Kill(59) = batblia.msk|x
|
||||||
|
Kill(60) = batbvet.msk|x
|
||||||
|
Kill(61) = bastndo.rep|x
|
||||||
|
Kill(62) = batblbu.msk|x
|
||||||
|
Kill(63) = bastndo.msk|x
|
||||||
|
Kill(64) = bastvet.msk|x
|
||||||
|
Kill(65) = bastscc.msk|x
|
||||||
|
Kill(66) = bastesc.msk|x
|
||||||
|
Kill(67) = bastzon.msk|x
|
||||||
|
Kill(68) = batbntb.msk|x
|
||||||
|
Kill(69) = bastcve.msk|x
|
||||||
|
|
||||||
|
[cg]
|
||||||
|
Data = 15-04-2019
|
||||||
|
Descrizione = Contabilita' Generale
|
||||||
|
Dischi = 1
|
||||||
|
Moduli = ba
|
||||||
|
OEM =
|
||||||
|
Patch = 770
|
||||||
|
PostProcess = bainst -0 CG
|
||||||
|
PreProcess =
|
||||||
|
Prezzo(1) =
|
||||||
|
Prezzo(2) =
|
||||||
|
Versione = 21511200
|
||||||
|
|
BIN
cd/test/cg0770a1.zip
Normal file
BIN
cd/test/cg0770a1.zip
Normal file
Binary file not shown.
3
cd/test/fp0766.txt
Normal file
3
cd/test/fp0766.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
fp0.exe
|
||||||
|
|
||||||
|
- Corretto calcolo ritenuta
|
19
cd/test/fp0766a.ini
Normal file
19
cd/test/fp0766a.ini
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
[Main]
|
||||||
|
Demo=0
|
||||||
|
|
||||||
|
[fp1]
|
||||||
|
File(0) = fp0.exe|X
|
||||||
|
Patch = 766
|
||||||
|
Versione = 21511200
|
||||||
|
|
||||||
|
[fp]
|
||||||
|
Data = 09-04-2019
|
||||||
|
Descrizione = Fattura Elettronica
|
||||||
|
Dischi = 1
|
||||||
|
Moduli = cg,ve
|
||||||
|
OEM =
|
||||||
|
Patch = 766
|
||||||
|
PostProcess =
|
||||||
|
PreProcess =
|
||||||
|
Versione = 21511200
|
||||||
|
|
BIN
cd/test/fp0766a1.zip
Normal file
BIN
cd/test/fp0766a1.zip
Normal file
Binary file not shown.
3
cd/test/fp0776.txt
Normal file
3
cd/test/fp0776.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
/sql/fp0/fp0106.sql
|
||||||
|
|
||||||
|
Aggiornamento database
|
19
cd/test/fp0776a.ini
Normal file
19
cd/test/fp0776a.ini
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
[Main]
|
||||||
|
Demo=0
|
||||||
|
|
||||||
|
[fp1]
|
||||||
|
File(0) = sql/fp0/fp0106.sql|X
|
||||||
|
Patch = 0776
|
||||||
|
Versione = 21511200
|
||||||
|
|
||||||
|
[fp]
|
||||||
|
Data = 29-04-2019
|
||||||
|
Descrizione = Fattura Elettronica
|
||||||
|
Dischi = 1
|
||||||
|
Moduli = cg,ve
|
||||||
|
OEM =
|
||||||
|
Patch = 776
|
||||||
|
PostProcess =
|
||||||
|
PreProcess =
|
||||||
|
Versione = 21511200
|
||||||
|
|
BIN
cd/test/fp0776a1.zip
Normal file
BIN
cd/test/fp0776a1.zip
Normal file
Binary file not shown.
3
cd/test/fp0778.txt
Normal file
3
cd/test/fp0778.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
fp0.exe
|
||||||
|
|
||||||
|
Aggiunto ulteriore controllo sconto in testata per chi mette 0
|
19
cd/test/fp0778a.ini
Normal file
19
cd/test/fp0778a.ini
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
[Main]
|
||||||
|
Demo=0
|
||||||
|
|
||||||
|
[fp1]
|
||||||
|
File(1) = fp0.exe|X
|
||||||
|
Patch = 0778
|
||||||
|
Versione = 21511200
|
||||||
|
|
||||||
|
[fp]
|
||||||
|
Data = 29-04-2019
|
||||||
|
Descrizione = Fattura Elettronica
|
||||||
|
Dischi = 1
|
||||||
|
Moduli = cg,ve
|
||||||
|
OEM =
|
||||||
|
Patch = 778
|
||||||
|
PostProcess =
|
||||||
|
PreProcess =
|
||||||
|
Versione = 21511200
|
||||||
|
|
BIN
cd/test/fp0778a1.zip
Normal file
BIN
cd/test/fp0778a1.zip
Normal file
Binary file not shown.
Binary file not shown.
6
cd/test/ve0772.txt
Normal file
6
cd/test/ve0772.txt
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
vetbatr.msk
|
||||||
|
vetbspp.msk
|
||||||
|
vetbprs.msk
|
||||||
|
vetbrss.msk
|
||||||
|
|
||||||
|
- Sistemate maschere tabelle spese prestazioni risorse e attrezzature
|
132
cd/test/ve0772a.ini
Normal file
132
cd/test/ve0772a.ini
Normal file
@ -0,0 +1,132 @@
|
|||||||
|
[Main]
|
||||||
|
Demo=0
|
||||||
|
|
||||||
|
[ve1]
|
||||||
|
File(197) = vetbatr.msk|X
|
||||||
|
File(214) = vetbprs.msk|X
|
||||||
|
File(219) = vetbrss.msk|X
|
||||||
|
File(221) = vetbspp.msk|X
|
||||||
|
Patch = 772
|
||||||
|
Versione = 21511200
|
||||||
|
|
||||||
|
[ve99]
|
||||||
|
Kill(0) = batbcld.msk|x
|
||||||
|
Kill(1) = bastspp.rep|x
|
||||||
|
Kill(2) = basttri.msk|x
|
||||||
|
Kill(3) = batbeld.msk|x
|
||||||
|
Kill(4) = ve7700a.msk|x
|
||||||
|
Kill(5) = batbspt.msk|x
|
||||||
|
Kill(6) = ve7300a.msk|x
|
||||||
|
Kill(7) = bastcra.rep|x
|
||||||
|
Kill(8) = batbfca.msk|x
|
||||||
|
Kill(9) = bastgcg.rep|x
|
||||||
|
Kill(10) = bastabe.rep|x
|
||||||
|
Kill(11) = batbpro.msk|x
|
||||||
|
Kill(12) = bastgca.msk|x
|
||||||
|
Kill(13) = ve7400a.msk|x
|
||||||
|
Kill(14) = batbtag.msk|x
|
||||||
|
Kill(15) = batbtri.msk|x
|
||||||
|
Kill(16) = baststd.msk|x
|
||||||
|
Kill(17) = baststd.rep|x
|
||||||
|
Kill(18) = batbrfc.msk|x
|
||||||
|
Kill(19) = ve7200a.msk|x
|
||||||
|
Kill(20) = batbmre.msk|x
|
||||||
|
Kill(21) = bastctr.msk|x
|
||||||
|
Kill(22) = batbcau.msk|x
|
||||||
|
Kill(23) = ve7400a.ini|x
|
||||||
|
Kill(24) = basteld.rep|x
|
||||||
|
Kill(25) = batbrfa.msk|x
|
||||||
|
Kill(26) = bastcaa.rep|x
|
||||||
|
Kill(27) = ve7701a.ini|x
|
||||||
|
Kill(28) = bastfrd.rep|x
|
||||||
|
Kill(29) = batbgcg.msk|x
|
||||||
|
Kill(30) = bastums.rep|x
|
||||||
|
Kill(31) = bastgca.rep|x
|
||||||
|
Kill(32) = basttri.rep|x
|
||||||
|
Kill(33) = batbfrr.msk|x
|
||||||
|
Kill(34) = batbums.msk|x
|
||||||
|
Kill(35) = bastimb.rep|x
|
||||||
|
Kill(36) = bastfca.msk|x
|
||||||
|
Kill(37) = bastfrr.msk|x
|
||||||
|
Kill(38) = batbbnp.msk|x
|
||||||
|
Kill(39) = bastasf.msk|x
|
||||||
|
Kill(40) = bastnum.msk|x
|
||||||
|
Kill(41) = bastfca.rep|x
|
||||||
|
Kill(42) = ve7400conf.ini|x
|
||||||
|
Kill(43) = ve7500a.msk|x
|
||||||
|
Kill(44) = bastgmc.msk|x
|
||||||
|
Kill(45) = bastfrm.rep|x
|
||||||
|
Kill(46) = batbfsa.msk|x
|
||||||
|
Kill(47) = basttip.rep|x
|
||||||
|
Kill(48) = batbstd.msk|x
|
||||||
|
Kill(49) = bastcau.msk|x
|
||||||
|
Kill(50) = bastrfa.msk|x
|
||||||
|
Kill(51) = bastnum.rep|x
|
||||||
|
Kill(52) = bastubi.msk|x
|
||||||
|
Kill(53) = ve7600a.msk|x
|
||||||
|
Kill(54) = ve7100a.msk|x
|
||||||
|
Kill(55) = batbprs.msk|x
|
||||||
|
Kill(56) = batbspp.msk|x
|
||||||
|
Kill(57) = batbcaa.msk|x
|
||||||
|
Kill(58) = bastrfc.msk|x
|
||||||
|
Kill(59) = bastimb.msk|x
|
||||||
|
Kill(60) = bastums.msk|x
|
||||||
|
Kill(61) = batbctr.msk|x
|
||||||
|
Kill(62) = batbfid.msk|x
|
||||||
|
Kill(63) = bastspp.msk|x
|
||||||
|
Kill(64) = batbubi.msk|x
|
||||||
|
Kill(65) = bastctr.rep|x
|
||||||
|
Kill(66) = bastubi.rep|x
|
||||||
|
Kill(67) = basttag.msk|x
|
||||||
|
Kill(68) = bastcaa.msk|x
|
||||||
|
Kill(69) = bastfrr.rep|x
|
||||||
|
Kill(70) = bastcau.rep|x
|
||||||
|
Kill(71) = batbtip.msk|x
|
||||||
|
Kill(72) = basteld.msk|x
|
||||||
|
Kill(73) = bastgcg.msk|x
|
||||||
|
Kill(74) = ve7200a.frm|x
|
||||||
|
Kill(75) = bastprs.rep|x
|
||||||
|
Kill(76) = bastbnp.msk|x
|
||||||
|
Kill(77) = batbgsa.msk|x
|
||||||
|
Kill(78) = batbasf.msk|x
|
||||||
|
Kill(79) = efstbnp.rep|x
|
||||||
|
Kill(80) = eftbbnp.msk|x
|
||||||
|
Kill(81) = basttag.rep|x
|
||||||
|
Kill(82) = batbgca.msk|x
|
||||||
|
Kill(83) = ve7.exe|x
|
||||||
|
Kill(84) = ve7300a.frm|x
|
||||||
|
Kill(85) = batbfrm.msk|x
|
||||||
|
Kill(86) = bastrfc.rep|x
|
||||||
|
Kill(87) = batbnum.msk|x
|
||||||
|
Kill(88) = bastcra.msk|x
|
||||||
|
Kill(89) = bastfrd.msk|x
|
||||||
|
Kill(90) = bastprs.msk|x
|
||||||
|
Kill(91) = batbcra.msk|x
|
||||||
|
Kill(92) = bastasf.rep|x
|
||||||
|
Kill(93) = bastabe.msk|x
|
||||||
|
Kill(94) = batbgmc.msk|x
|
||||||
|
Kill(95) = bastbnp.rep|x
|
||||||
|
Kill(96) = efstbnp.msk|x
|
||||||
|
Kill(97) = batbabe.msk|x
|
||||||
|
Kill(98) = batbacr.msk|x
|
||||||
|
Kill(99) = batbimb.msk|x
|
||||||
|
Kill(100) = batbfrd.msk|x
|
||||||
|
Kill(101) = batbprv.msk|x
|
||||||
|
Kill(102) = bastgmc.rep|x
|
||||||
|
Kill(103) = bastfrm.msk|x
|
||||||
|
Kill(104) = basttip.msk|x
|
||||||
|
Kill(105) = bastrfa.rep|x
|
||||||
|
|
||||||
|
[ve]
|
||||||
|
Data = 16-04-2019
|
||||||
|
Descrizione = Vendite
|
||||||
|
Dischi = 1
|
||||||
|
Moduli = ba,cg9,pr9,mg9,sv9,in9,ef9
|
||||||
|
OEM =
|
||||||
|
Patch = 772
|
||||||
|
PostProcess = bainst -0 VE
|
||||||
|
PreProcess =
|
||||||
|
Prezzo(1) =
|
||||||
|
Prezzo(2) =
|
||||||
|
Versione = 21511200
|
||||||
|
|
BIN
cd/test/ve0772a1.zip
Normal file
BIN
cd/test/ve0772a1.zip
Normal file
Binary file not shown.
5
cd/test/ve0774.txt
Normal file
5
cd/test/ve0774.txt
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
ve0.exe
|
||||||
|
ve1.exe
|
||||||
|
vetbtip.msk
|
||||||
|
|
||||||
|
Aggiunto flag sui tipi documento per non esporre la dicitura stampa non valida ai fini fiscali per Fatturazione Elettronica
|
131
cd/test/ve0774a.ini
Normal file
131
cd/test/ve0774a.ini
Normal file
@ -0,0 +1,131 @@
|
|||||||
|
[Main]
|
||||||
|
Demo=0
|
||||||
|
|
||||||
|
[ve1]
|
||||||
|
File(0) = ve0.exe|X
|
||||||
|
File(19) = ve1.exe|X
|
||||||
|
File(225) = vetbtip.msk|X
|
||||||
|
Patch = 0774
|
||||||
|
Versione = 21511200
|
||||||
|
|
||||||
|
[ve99]
|
||||||
|
Kill(0) = batbimb.msk|x
|
||||||
|
Kill(1) = batbacr.msk|x
|
||||||
|
Kill(2) = bastfrd.msk|x
|
||||||
|
Kill(3) = bastbnp.rep|x
|
||||||
|
Kill(4) = bastcra.msk|x
|
||||||
|
Kill(5) = batbgmc.msk|x
|
||||||
|
Kill(6) = batbabe.msk|x
|
||||||
|
Kill(7) = efstbnp.msk|x
|
||||||
|
Kill(8) = batbfrm.msk|x
|
||||||
|
Kill(9) = batbcra.msk|x
|
||||||
|
Kill(10) = ve7300a.frm|x
|
||||||
|
Kill(11) = bastprs.msk|x
|
||||||
|
Kill(12) = batbnum.msk|x
|
||||||
|
Kill(13) = bastabe.msk|x
|
||||||
|
Kill(14) = bastrfc.rep|x
|
||||||
|
Kill(15) = bastasf.rep|x
|
||||||
|
Kill(16) = basttag.rep|x
|
||||||
|
Kill(17) = eftbbnp.msk|x
|
||||||
|
Kill(18) = ve7.exe|x
|
||||||
|
Kill(19) = batbgca.msk|x
|
||||||
|
Kill(20) = ve7200a.msk|x
|
||||||
|
Kill(21) = batbrfa.msk|x
|
||||||
|
Kill(22) = bastgca.rep|x
|
||||||
|
Kill(23) = batbrfc.msk|x
|
||||||
|
Kill(24) = basteld.rep|x
|
||||||
|
Kill(25) = bastums.rep|x
|
||||||
|
Kill(26) = ve7701a.ini|x
|
||||||
|
Kill(27) = batbfrr.msk|x
|
||||||
|
Kill(28) = bastcaa.rep|x
|
||||||
|
Kill(29) = basttri.rep|x
|
||||||
|
Kill(30) = batbtri.msk|x
|
||||||
|
Kill(31) = bastctr.msk|x
|
||||||
|
Kill(32) = batbtag.msk|x
|
||||||
|
Kill(33) = batbmre.msk|x
|
||||||
|
Kill(34) = baststd.rep|x
|
||||||
|
Kill(35) = ve7400a.ini|x
|
||||||
|
Kill(36) = baststd.msk|x
|
||||||
|
Kill(37) = batbcau.msk|x
|
||||||
|
Kill(38) = batbpro.msk|x
|
||||||
|
Kill(39) = bastabe.rep|x
|
||||||
|
Kill(40) = ve7400a.msk|x
|
||||||
|
Kill(41) = bastgca.msk|x
|
||||||
|
Kill(42) = bastimb.msk|x
|
||||||
|
Kill(43) = bastctr.rep|x
|
||||||
|
Kill(44) = batbtip.msk|x
|
||||||
|
Kill(45) = bastrfc.msk|x
|
||||||
|
Kill(46) = batbubi.msk|x
|
||||||
|
Kill(47) = bastcau.rep|x
|
||||||
|
Kill(48) = basttag.msk|x
|
||||||
|
Kill(49) = bastgcg.msk|x
|
||||||
|
Kill(50) = bastubi.rep|x
|
||||||
|
Kill(51) = basteld.msk|x
|
||||||
|
Kill(52) = bastcau.msk|x
|
||||||
|
Kill(53) = batbprs.msk|x
|
||||||
|
Kill(54) = batbctr.msk|x
|
||||||
|
Kill(55) = batbstd.msk|x
|
||||||
|
Kill(56) = ve7100a.msk|x
|
||||||
|
Kill(57) = bastums.msk|x
|
||||||
|
Kill(58) = batbcaa.msk|x
|
||||||
|
Kill(59) = bastspp.msk|x
|
||||||
|
Kill(60) = batbspp.msk|x
|
||||||
|
Kill(61) = batbfid.msk|x
|
||||||
|
Kill(62) = bastasf.msk|x
|
||||||
|
Kill(63) = bastfrm.rep|x
|
||||||
|
Kill(64) = bastnum.rep|x
|
||||||
|
Kill(65) = batbbnp.msk|x
|
||||||
|
Kill(66) = bastgmc.msk|x
|
||||||
|
Kill(67) = bastrfa.msk|x
|
||||||
|
Kill(68) = basttip.rep|x
|
||||||
|
Kill(69) = ve7600a.msk|x
|
||||||
|
Kill(70) = batbfsa.msk|x
|
||||||
|
Kill(71) = bastubi.msk|x
|
||||||
|
Kill(72) = batbgcg.msk|x
|
||||||
|
Kill(73) = bastimb.rep|x
|
||||||
|
Kill(74) = bastfca.rep|x
|
||||||
|
Kill(75) = bastfrd.rep|x
|
||||||
|
Kill(76) = batbums.msk|x
|
||||||
|
Kill(77) = bastnum.msk|x
|
||||||
|
Kill(78) = bastfrr.msk|x
|
||||||
|
Kill(79) = ve7500a.msk|x
|
||||||
|
Kill(80) = bastfca.msk|x
|
||||||
|
Kill(81) = ve7400conf.ini|x
|
||||||
|
Kill(82) = efstbnp.rep|x
|
||||||
|
Kill(83) = batbasf.msk|x
|
||||||
|
Kill(84) = bastfrr.rep|x
|
||||||
|
Kill(85) = bastprs.rep|x
|
||||||
|
Kill(86) = bastcaa.msk|x
|
||||||
|
Kill(87) = ve7200a.frm|x
|
||||||
|
Kill(88) = batbgsa.msk|x
|
||||||
|
Kill(89) = bastbnp.msk|x
|
||||||
|
Kill(90) = bastrfa.rep|x
|
||||||
|
Kill(91) = basttip.msk|x
|
||||||
|
Kill(92) = batbprv.msk|x
|
||||||
|
Kill(93) = batbfrd.msk|x
|
||||||
|
Kill(94) = bastfrm.msk|x
|
||||||
|
Kill(95) = bastgmc.rep|x
|
||||||
|
Kill(96) = bastgcg.rep|x
|
||||||
|
Kill(97) = batbfca.msk|x
|
||||||
|
Kill(98) = bastspp.rep|x
|
||||||
|
Kill(99) = batbcld.msk|x
|
||||||
|
Kill(100) = batbspt.msk|x
|
||||||
|
Kill(101) = ve7700a.msk|x
|
||||||
|
Kill(102) = batbeld.msk|x
|
||||||
|
Kill(103) = basttri.msk|x
|
||||||
|
Kill(104) = bastcra.rep|x
|
||||||
|
Kill(105) = ve7300a.msk|x
|
||||||
|
|
||||||
|
[ve]
|
||||||
|
Data = 16-04-2019
|
||||||
|
Descrizione = Vendite
|
||||||
|
Dischi = 1
|
||||||
|
Moduli = ba,cg9,pr9,mg9,sv9,in9,ef9
|
||||||
|
OEM =
|
||||||
|
Patch = 774
|
||||||
|
PostProcess = bainst -0 VE
|
||||||
|
PreProcess =
|
||||||
|
Prezzo(1) =
|
||||||
|
Prezzo(2) =
|
||||||
|
Versione = 21511200
|
||||||
|
|
BIN
cd/test/ve0774a1.zip
Normal file
BIN
cd/test/ve0774a1.zip
Normal file
Binary file not shown.
@ -8,9 +8,33 @@
|
|||||||
#include <real.h>
|
#include <real.h>
|
||||||
|
|
||||||
#include "ba2900.h"
|
#include "ba2900.h"
|
||||||
|
#include <xvtdb.h>
|
||||||
|
//#include "tsdb.h"
|
||||||
|
#include "codeb.h"
|
||||||
|
#include "reputils.h"
|
||||||
|
|
||||||
#define TABELLE_CAMPO 171
|
#define TABELLE_CAMPO 171
|
||||||
|
|
||||||
|
void check_range_tab(TMask& msk)
|
||||||
|
{
|
||||||
|
if (msk.get_int(F_FROMTAB) == 7466)
|
||||||
|
{
|
||||||
|
msk.show(F_MYRANGE);
|
||||||
|
msk.set(F_FROMTAB, 2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (msk.get_int(F_FROMTAB) < 2)
|
||||||
|
msk.set(F_FROMTAB, 2);
|
||||||
|
if (msk.get_int(F_FROMTAB) > prefix().items())
|
||||||
|
msk.set(F_FROMTAB, prefix().items());
|
||||||
|
if (msk.get_int(F_TOTAB) < msk.get_int(F_FROMTAB))
|
||||||
|
msk.set(F_TOTAB, msk.get_int(F_FROMTAB));
|
||||||
|
if (msk.get_int(F_TOTAB) > prefix().items())
|
||||||
|
msk.set(F_TOTAB, prefix().items());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class TMSSQLExport_msk : public TAutomask
|
class TMSSQLExport_msk : public TAutomask
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
@ -18,6 +42,7 @@ protected:
|
|||||||
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
|
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
|
||||||
public:
|
public:
|
||||||
TMSSQLExport_msk();
|
TMSSQLExport_msk();
|
||||||
|
~TMSSQLExport_msk();
|
||||||
};
|
};
|
||||||
|
|
||||||
long TMSSQLExport_msk::handler(WINDOW task, EVENT* ep)
|
long TMSSQLExport_msk::handler(WINDOW task, EVENT* ep)
|
||||||
@ -40,7 +65,21 @@ bool TMSSQLExport_msk::on_field_event(TOperable_field& o, TField_event e, long j
|
|||||||
if (e == se_query_add || e == se_query_del)
|
if (e == se_query_add || e == se_query_del)
|
||||||
return false;
|
return false;
|
||||||
*/
|
*/
|
||||||
|
case CHK_ONLYTAB:
|
||||||
|
if (e == fe_modify)
|
||||||
|
{
|
||||||
|
get_bool(CHK_ONLYTAB) ? enable(F_FROMTAB) : disable(F_FROMTAB);
|
||||||
|
get_bool(CHK_ONLYTAB) ? enable(F_TOTAB) : disable(F_TOTAB);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case CHK_EXPORTTABLES:
|
||||||
|
if (e == fe_modify)
|
||||||
|
{
|
||||||
|
get_bool(CHK_EXPORTTABLES) ? enable(CHK_ONLYTAB) : disable(CHK_ONLYTAB);
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
|
check_range_tab(*this);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -51,38 +90,66 @@ TMSSQLExport_msk::TMSSQLExport_msk() : TAutomask("ba2900a")
|
|||||||
set(F_DSN, ini_get_string(CONFIG_DITTA, "Campo_MSSQL_Export", "DSN"));
|
set(F_DSN, ini_get_string(CONFIG_DITTA, "Campo_MSSQL_Export", "DSN"));
|
||||||
set(F_USR, ini_get_string(CONFIG_DITTA, "Campo_MSSQL_Export", "User"));
|
set(F_USR, ini_get_string(CONFIG_DITTA, "Campo_MSSQL_Export", "User"));
|
||||||
set(F_PWD, ini_get_string(CONFIG_DITTA, "Campo_MSSQL_Export", "Password"));
|
set(F_PWD, ini_get_string(CONFIG_DITTA, "Campo_MSSQL_Export", "Password"));
|
||||||
set(CHK_CREATEGEN, "X");
|
//set(CHK_CREATEGEN, "X");
|
||||||
set(CHK_CREATETABLES, "X");
|
set(CHK_CREATETABLES, "X");
|
||||||
set(CHK_EXPORTGEN, "X");
|
//set(CHK_EXPORTGEN, "X");
|
||||||
set(CHK_EXPORTTABLES, "X");
|
set(CHK_EXPORTTABLES, "X");
|
||||||
|
set(F_FROMTAB, 2);
|
||||||
|
set(F_TOTAB, prefix().items());
|
||||||
|
}
|
||||||
|
|
||||||
|
TMSSQLExport_msk::~TMSSQLExport_msk()
|
||||||
|
{
|
||||||
|
ini_set_string(CONFIG_DITTA, "Campo_MSSQL_Export", "DSN", TMask::get(F_DSN));
|
||||||
|
ini_set_string(CONFIG_DITTA, "Campo_MSSQL_Export", "User", TMask::get(F_USR));
|
||||||
|
ini_set_string(CONFIG_DITTA, "Campo_MSSQL_Export", "Password", TMask::get(F_PWD));
|
||||||
}
|
}
|
||||||
|
|
||||||
class TMSSQLExport_app : public TSkeleton_application
|
class TMSSQLExport_app : public TSkeleton_application
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
TToken_string tables;
|
TToken_string _tables;
|
||||||
TString DSN, usr, psw;
|
TString _DSN, _usr, _psw;
|
||||||
|
SSimple_query* _db;
|
||||||
|
TMSSQLExport_msk* _msk;
|
||||||
|
TLog_report* _log;
|
||||||
|
TString _logstr;
|
||||||
|
|
||||||
|
bool _visual;
|
||||||
const TString toEscape (TString val) const; // Prende una stringa e sistema i caratteri di escape
|
const TString toEscape (TString val) const; // Prende una stringa e sistema i caratteri di escape
|
||||||
const TString toDate (TString val) const; // Prende una stringa e la trasforma in una data di mssql
|
const TString toDate (TString val) const; // Prende una stringa e la trasforma in una data di mssql
|
||||||
const TString queryToNull (TString val) const; // Da una query sostituisce tutti i valori vuoti ('') con null
|
const TString queryToNull (TString val) const; // Da una query sostituisce tutti i valori vuoti ('') con null
|
||||||
//*****************************************************************
|
//*****************************************************************
|
||||||
bool emptyTables() const;
|
bool empty_tables() const;
|
||||||
bool exportGen() const;
|
bool rko_gen() const;
|
||||||
bool exportTables() const;
|
bool expor_gen() const;
|
||||||
bool createGen() const;
|
bool file_valid(int logicnum) const;
|
||||||
bool createTables() const;
|
int export_tables();
|
||||||
bool createIndexes() const;
|
bool create_gen() const;
|
||||||
|
static TString tab_name(int logicnum, TString& ditta_name);
|
||||||
|
void set_range_tab(int& logicnum, int& endtab) const;
|
||||||
|
bool create_tables() const;
|
||||||
|
bool create_indexes() const;
|
||||||
|
bool rko_outta_nowhere(const char* table_name) const;
|
||||||
|
bool empty_tables(const char* table_name) const;
|
||||||
// Funzioni di esportazione
|
// Funzioni di esportazione
|
||||||
bool dir_gen() const;
|
bool dir_gen() const;
|
||||||
bool trc_gen() const;
|
bool trc_gen() const;
|
||||||
bool exportManager(const TString generalErrors) const;
|
bool export_manager(const TString generalErrors) const;
|
||||||
|
bool show_log();
|
||||||
|
void log(int severity, const char* msg);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
bool my_range();
|
||||||
virtual void main_loop();
|
virtual void main_loop();
|
||||||
void setTable(TToken_string s) { tables = s; }
|
void set_table(TToken_string s) { _tables = s; }
|
||||||
bool setParameters(TString dsn, TString utente, TString password);
|
bool set_parameters(TString dsn, TString utente, TString password);
|
||||||
bool checkParameters(const TString& DSN, const TString& usr, const TString& psw) { TODBC_recordset connTest(""); return connTest.connect(DSN, usr, psw) ? setParameters(DSN, usr, psw) : false; }
|
bool connect(const TString& _DSN, const TString& _usr, const TString& _psw);
|
||||||
bool testFieldSeq(int val, int arr[]) const;
|
//bool checkParameters() { TODBC_recordset connTest(""); return connTest.connect(_DSN, _usr, _psw) ? set_parameters(_DSN, _usr, _psw) : false; }
|
||||||
|
bool test_field_seq(int val, int arr[]) const;
|
||||||
|
bool create_gen_ms() const;
|
||||||
|
TMSSQLExport_app() : _visual(false) { }
|
||||||
|
~TMSSQLExport_app() { delete _db; }
|
||||||
};
|
};
|
||||||
|
|
||||||
// Funzioni Utility ****************************************************************************************************************************
|
// Funzioni Utility ****************************************************************************************************************************
|
||||||
@ -137,31 +204,31 @@ const TString TMSSQLExport_app::toDate(TString val) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool TMSSQLExport_app::setParameters(TString dsn, TString utente, TString password)
|
bool TMSSQLExport_app::set_parameters(TString dsn, TString utente, TString password)
|
||||||
{
|
{
|
||||||
// Salvo i parametri
|
// Salvo i parametri
|
||||||
ini_set_string(CONFIG_DITTA, "Campo_MSSQL_Export", "DSN", dsn);
|
ini_set_string(CONFIG_DITTA, "Campo_MSSQL_Export", "_DSN", dsn);
|
||||||
ini_set_string(CONFIG_DITTA, "Campo_MSSQL_Export", "User", utente);
|
ini_set_string(CONFIG_DITTA, "Campo_MSSQL_Export", "User", utente);
|
||||||
ini_set_string(CONFIG_DITTA, "Campo_MSSQL_Export", "Password", password);
|
ini_set_string(CONFIG_DITTA, "Campo_MSSQL_Export", "Password", password);
|
||||||
DSN = dsn;
|
_DSN = dsn;
|
||||||
usr = utente;
|
_usr = utente;
|
||||||
psw = password;
|
_psw = password;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TMSSQLExport_app::emptyTables() const
|
bool TMSSQLExport_app::empty_tables() const
|
||||||
{
|
{
|
||||||
TODBC_recordset sqlset("");
|
TODBC_recordset sqlset("");
|
||||||
TString table;
|
TString table;
|
||||||
|
|
||||||
if (!sqlset.connect(DSN, usr, psw))
|
if (!sqlset.connect(_DSN, _usr, _psw))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
for (int i = 0; i < tables.size(); i++)
|
for (int i = 0; i < _tables.size(); i++)
|
||||||
{
|
{
|
||||||
TString theQuery; // The query: una tabella (donna) per cui uccidere
|
TString theQuery; // The query: una tabella (donna) per cui uccidere
|
||||||
|
|
||||||
tables.get(i, table);
|
_tables.get(i, table);
|
||||||
theQuery << "DELETE FROM "<< table << ";";
|
theQuery << "DELETE FROM "<< table << ";";
|
||||||
sqlset.exec(theQuery);
|
sqlset.exec(theQuery);
|
||||||
}
|
}
|
||||||
@ -170,8 +237,34 @@ bool TMSSQLExport_app::emptyTables() const
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool TMSSQLExport_app::rko_gen() const
|
||||||
|
{
|
||||||
|
TString query;
|
||||||
|
query <<
|
||||||
|
"DROP TABLE [dir_gen];";
|
||||||
|
if (!_db->sq_set_exec(query))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
query.cut(0) <<
|
||||||
|
"DROP TABLE [trc_gen];";
|
||||||
|
if (!_db->sq_set_exec(query))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
query.cut(0) <<
|
||||||
|
"DROP TABLE [trc_keydes];";
|
||||||
|
if (!_db->sq_set_exec(query))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
query.cut(0) <<
|
||||||
|
"DROP TABLE [trc_recfdes];";
|
||||||
|
if (!_db->sq_set_exec(query))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return _db->sq_commit();
|
||||||
|
}
|
||||||
|
|
||||||
// Controllo che il valore passato sia > e diverso da quelli presenti nell'array
|
// Controllo che il valore passato sia > e diverso da quelli presenti nell'array
|
||||||
bool TMSSQLExport_app::testFieldSeq(int val, int arr[]) const
|
bool TMSSQLExport_app::test_field_seq(int val, int arr[]) const
|
||||||
{
|
{
|
||||||
for (int i = 0; i < MKFields; i++)
|
for (int i = 0; i < MKFields; i++)
|
||||||
if(val == arr[i] || val < arr[i]) return false;
|
if(val == arr[i] || val < arr[i]) return false;
|
||||||
@ -179,12 +272,80 @@ bool TMSSQLExport_app::testFieldSeq(int val, int arr[]) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Main Program *****************************************************************************************************************************************************************
|
// Main Program *****************************************************************************************************************************************************************
|
||||||
bool TMSSQLExport_app::createGen() const
|
bool TMSSQLExport_app::create_gen_ms() const
|
||||||
{
|
{
|
||||||
TODBC_recordset sqlset("");
|
|
||||||
// Controllo la connessione di nuovo per essere scrupolosi
|
rko_gen();
|
||||||
if (!sqlset.connect(DSN, usr, psw))
|
TString query;
|
||||||
|
query <<
|
||||||
|
"IF OBJECT_ID('dbo.dir_gen', 'U') IS NOT NULL DROP TABLE dbo.dir_gen;\n" <<
|
||||||
|
"CREATE TABLE[dbo].[dir_gen](\n" <<
|
||||||
|
"[_ID_][int] IDENTITY(1, 1) NOT NULL,\n" <<
|
||||||
|
"[NUMERO][int] NOT NULL,\n" <<
|
||||||
|
"[SYSNAME] VARCHAR(MAX) NOT NULL,\n" <<
|
||||||
|
"[EOD][int] NULL,\n" <<
|
||||||
|
"[EOX][int] NULL,\n" <<
|
||||||
|
"[FLAGS][int] NULL,\n" <<
|
||||||
|
"[LENR][int] NULL,\n" <<
|
||||||
|
"[DES] VARCHAR(MAX) NULL,\n" <<
|
||||||
|
"[CALC] VARCHAR(MAX) NULL,\n" <<
|
||||||
|
"[GENPROMPT] VARCHAR(MAX) NULL,\n" <<
|
||||||
|
"PRIMARY KEY CLUSTERED\n" <<
|
||||||
|
"([_ID_] ASC) WITH\n" <<
|
||||||
|
"(PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON[PRIMARY]\n" <<
|
||||||
|
") ON[PRIMARY] TEXTIMAGE_ON[PRIMARY];";
|
||||||
|
|
||||||
|
if (!_db->sq_set_exec(query))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
query.cut(0) <<
|
||||||
|
"IF OBJECT_ID('dbo.trc_gen', 'U') IS NOT NULL DROP TABLE dbo.trc_gen;\n" <<
|
||||||
|
"CREATE TABLE[dbo].[trc_gen](\n" <<
|
||||||
|
"[_ID_][int] IDENTITY(1, 1) NOT NULL,\n" <<
|
||||||
|
"[NFields][int] NOT NULL,\n" <<
|
||||||
|
"[SortFd] VARCHAR(MAX) NULL,\n" <<
|
||||||
|
"[NKeys][int] NOT NULL,\n" <<
|
||||||
|
"[logicname][int] NOT NULL\n" <<
|
||||||
|
") ON[PRIMARY] TEXTIMAGE_ON[PRIMARY];";
|
||||||
|
|
||||||
|
if (!_db->sq_set_exec(query))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
query.cut(0) <<
|
||||||
|
"IF OBJECT_ID('dbo.trc_keydes', 'U') IS NOT NULL DROP TABLE dbo.trc_keydes;\n" <<
|
||||||
|
"CREATE TABLE[dbo].[trc_keydes](\n" <<
|
||||||
|
"[_ID_][int] IDENTITY(1, 1) NOT NULL,\n" <<
|
||||||
|
"[DupKeys][int] NOT NULL,\n" <<
|
||||||
|
"[NkFields][int] NOT NULL,\n" <<
|
||||||
|
"[FieldSeq] VARCHAR(MAX) NULL,\n" <<
|
||||||
|
"[FromCh] VARCHAR(MAX) NULL,\n" <<
|
||||||
|
"[ToCh] VARCHAR(MAX) NULL,\n" <<
|
||||||
|
"[logicname][int] NOT NULL\n" <<
|
||||||
|
") ON[PRIMARY] TEXTIMAGE_ON[PRIMARY];";
|
||||||
|
|
||||||
|
if (!_db->sq_set_exec(query))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
query.cut(0) <<
|
||||||
|
"IF OBJECT_ID('dbo.trc_recfdes', 'U') IS NOT NULL DROP TABLE dbo.trc_recfdes;\n" <<
|
||||||
|
"CREATE TABLE[dbo].[trc_recfdes](\n" <<
|
||||||
|
"[_ID_][int] IDENTITY(1, 1) NOT NULL,\n" <<
|
||||||
|
"[Name] VARCHAR(MAX) NOT NULL,\n" <<
|
||||||
|
"[TypeF][int] NOT NULL,\n" <<
|
||||||
|
"[Len][int] NULL,\n" <<
|
||||||
|
"[Dec][int] NULL,\n" <<
|
||||||
|
"[RecOff][int] NULL,\n" <<
|
||||||
|
"[logicname][int] NOT NULL\n" <<
|
||||||
|
") ON[PRIMARY] TEXTIMAGE_ON[PRIMARY];";
|
||||||
|
|
||||||
|
if (!_db->sq_set_exec(query))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return _db->sq_commit();
|
||||||
|
|
||||||
|
}
|
||||||
|
bool TMSSQLExport_app::create_gen() const
|
||||||
|
{
|
||||||
ifstream queryFile; // stream dei files con le query
|
ifstream queryFile; // stream dei files con le query
|
||||||
|
|
||||||
// Prima le tabelle gen
|
// Prima le tabelle gen
|
||||||
@ -200,7 +361,7 @@ bool TMSSQLExport_app::createGen() const
|
|||||||
gensql << aganaye;
|
gensql << aganaye;
|
||||||
}
|
}
|
||||||
queryFile.close();
|
queryFile.close();
|
||||||
if(sqlset.exec(gensql) != 1) // EXEC
|
if(!_db->sq_exec(gensql)) // EXEC
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -211,94 +372,107 @@ bool TMSSQLExport_app::createGen() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Committo la creazione iniziale delle tabelle custom fondamentali per il passaggio a DB di Campo
|
// Committo la creazione iniziale delle tabelle custom fondamentali per il passaggio a DB di Campo
|
||||||
return sqlset.commit() != -1;
|
return _db->sq_commit();
|
||||||
}
|
}
|
||||||
bool TMSSQLExport_app::createTables() const
|
|
||||||
|
TString TMSSQLExport_app::tab_name(int logicnum, TString& ditta_name)
|
||||||
{
|
{
|
||||||
TODBC_recordset sqlset("");
|
const TString& table = logic2table(logicnum);
|
||||||
// Controllo la connessione di nuovo per essere scrupolosi
|
const bool studio_tab = TDir(logicnum).is_com();
|
||||||
if (!sqlset.connect(DSN, usr, psw))
|
return TString("[") << (!studio_tab ? ditta_name : "") << table << "]";
|
||||||
return false;
|
}
|
||||||
ifstream queryFile; // stream dei files con le query
|
|
||||||
|
void TMSSQLExport_app::set_range_tab(int& logicnum, int& endtab) const
|
||||||
// Le tabelle comuni
|
{
|
||||||
TFilename studio("sql\\studiosql.sql");
|
logicnum = 2;
|
||||||
queryFile.open(studio);
|
endtab = prefix().items();
|
||||||
if(queryFile.is_open())
|
if (_msk->get_bool(CHK_ONLYTAB))
|
||||||
{
|
{
|
||||||
TString studiosql; // Qua metterò le query
|
check_range_tab(*_msk);
|
||||||
while(!queryFile.eof())
|
logicnum = _msk->get_int(F_FROMTAB);
|
||||||
{
|
endtab = _msk->get_int(F_TOTAB);
|
||||||
char aganaye[10000];
|
endtab++;
|
||||||
queryFile.getline(aganaye, 10000); // Sei stronzo se fai una riga con più di 10.000 caratteri
|
|
||||||
studiosql << aganaye;
|
|
||||||
}
|
|
||||||
queryFile.close();
|
|
||||||
if(sqlset.exec(studiosql) != 1) // EXEC
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
|
|
||||||
|
bool TMSSQLExport_app::connect(const TString& _DSN, const TString& _usr, const TString& _psw)
|
||||||
|
{
|
||||||
|
if (_db == nullptr)
|
||||||
|
_db = new SSimple_query();
|
||||||
|
bool connected = _db->sq_is_connect();
|
||||||
|
if (!connected)
|
||||||
{
|
{
|
||||||
TString msg("Errore apertura file "); msg << studio;
|
_db->sq_set_con_option("UseAPI", "OLEDB");
|
||||||
message_box(msg);
|
connected = _db->sq_connect(_DSN, _usr, _psw, TSDB_MSSQL) == NOERR;
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
return connected;
|
||||||
|
}
|
||||||
|
|
||||||
/************************************************************************************************
|
bool TMSSQLExport_app::create_tables() const
|
||||||
* Le tabelle di ditta, caso particolare: *
|
{
|
||||||
* In questi file è presente una sequenza di escape (%%%%%) che andrà sostituita con la ditta, *
|
bool ok = true;
|
||||||
* quindi prima leggo tutto e poi sostituisco *
|
TString ditta_name; ditta_name << prefix().name() << "_";
|
||||||
************************************************************************************************/
|
TString last_col_name = " ";
|
||||||
TFilename ditta("sql\\dittesql.sql");
|
|
||||||
TString appsql;
|
|
||||||
queryFile.open(ditta);
|
|
||||||
|
|
||||||
// Creo il cursore delle ditte
|
int logicnum;
|
||||||
TRelation relTDitte(LF_NDITTE);
|
int endtab;
|
||||||
TCursor curDitte(&relTDitte);
|
set_range_tab(logicnum, endtab);
|
||||||
int itemsDitte = curDitte.items();
|
|
||||||
|
|
||||||
if(queryFile.is_open())
|
for(; logicnum < endtab && ok; logicnum++)
|
||||||
{
|
{
|
||||||
while(!queryFile.eof())
|
last_col_name = " ";
|
||||||
|
const RecDes& rd = prefix().get_recdes(logicnum);
|
||||||
|
TString table_name = tab_name(logicnum, ditta_name);
|
||||||
|
TString column_name;
|
||||||
|
bool last_err = false;
|
||||||
|
// Droppo la tabella prima di crearla
|
||||||
|
rko_outta_nowhere(table_name);
|
||||||
|
// Create new table
|
||||||
|
if (rd.NFields == 0)
|
||||||
|
continue;
|
||||||
|
TString sql; sql.cut(0) << "CREATE TABLE " << table_name << "(\n";
|
||||||
|
sql << "[_ID_][int] IDENTITY(1, 1) NOT NULL,\n";
|
||||||
|
for (int i = 0; i < rd.NFields; i++)
|
||||||
{
|
{
|
||||||
char aganaye[10000];
|
|
||||||
queryFile.getline(aganaye, 10000); // Sei stronzo se fai una riga con più di 10.000 caratteri
|
if (i > 0 && !last_err) sql << ",\n";
|
||||||
appsql << aganaye;
|
column_name.cut(0) << "[" << rd.Fd[i].Name << "] ";
|
||||||
}
|
if (column_name == last_col_name)
|
||||||
for(curDitte = 0; curDitte.pos() < curDitte.items(); ++curDitte)
|
|
||||||
{
|
|
||||||
TRectype dittaCurr = curDitte.curr();
|
|
||||||
TString nomeDitta(dittaCurr.get("CODDITTA"));
|
|
||||||
for (int i = 0, applen = nomeDitta.len(); i < 5 - applen; i++)
|
|
||||||
nomeDitta.insert("0");
|
|
||||||
// Non esiste nulla che rimpiazzi tutte occorrenze (stringhe) in una TString, quindi mi faccio io l'algoritmo
|
|
||||||
TString queryFirm(appsql);
|
|
||||||
int lastpos = queryFirm.find("%%%%%", 0);
|
|
||||||
while(lastpos != -1)
|
|
||||||
{
|
{
|
||||||
// Siccome so che ci sono 5 caratteri faccio che farlo a mano da vero gangster
|
last_err = true;
|
||||||
queryFirm[lastpos] = nomeDitta[0];
|
continue;
|
||||||
queryFirm[lastpos + 1] = nomeDitta[1];
|
}
|
||||||
queryFirm[lastpos + 2] = nomeDitta[2];
|
last_err = false;
|
||||||
queryFirm[lastpos + 3] = nomeDitta[3];
|
last_col_name = column_name;
|
||||||
queryFirm[lastpos + 4] = nomeDitta[4];
|
sql << column_name;
|
||||||
lastpos = queryFirm.find("%%%%%", lastpos); // find(x, lastpos) si velocizza partendo già dalla ultima posizione trovata
|
switch (rd.Fd[i].TypeF)
|
||||||
}
|
{
|
||||||
if(sqlset.exec(queryFirm) != 1) // EXEC
|
case _charfld:
|
||||||
return false;
|
case _alfafld:
|
||||||
|
sql << "VARCHAR(" << rd.Fd[i].Len << ")";
|
||||||
|
break;
|
||||||
|
case _memofld:
|
||||||
|
sql << "VARCHAR(MAX)"; break;
|
||||||
|
case _datefld:
|
||||||
|
sql << "DATE"; break;
|
||||||
|
case _boolfld:
|
||||||
|
sql << "BIT DEFAULT 0"; break;
|
||||||
|
case _realfld:
|
||||||
|
case _wordfld:
|
||||||
|
case _intfld:
|
||||||
|
case _longfld:
|
||||||
|
case _intzerofld:
|
||||||
|
case _longzerofld:
|
||||||
|
default: sql << "NUMERIC(" << rd.Fd[i].Len << "," << rd.Fd[i].Dec << ")"; break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
queryFile.close();
|
sql << "\n);";
|
||||||
|
|
||||||
|
ok = _db->sq_set_exec(sql) && _db->sq_commit();
|
||||||
|
TString err = _db->sq_get_string_error();
|
||||||
|
TString err2 = _db->sq_get_text_error();
|
||||||
}
|
}
|
||||||
else
|
return ok;
|
||||||
{
|
|
||||||
TString msg("Errore apertura file "); msg << ditta;
|
|
||||||
message_box(msg);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Committo la creazione iniziale delle tabelle custom fondamentali per il passaggio a DB di Campo
|
|
||||||
return sqlset.commit() != -1 && createIndexes();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -306,10 +480,10 @@ bool TMSSQLExport_app::createTables() const
|
|||||||
* Sintassi: CREATE NONCLUSTERED INDEX nome_indice ON nome_tabella (colonna1 [ASC | DESC], colonna2 [ASC | DESC][,...n])
|
* Sintassi: CREATE NONCLUSTERED INDEX nome_indice ON nome_tabella (colonna1 [ASC | DESC], colonna2 [ASC | DESC][,...n])
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
bool TMSSQLExport_app::createIndexes() const
|
bool TMSSQLExport_app::create_indexes() const
|
||||||
{
|
{
|
||||||
TODBC_recordset sqlset("");
|
TODBC_recordset sqlset("");
|
||||||
if (!sqlset.connect(DSN, usr, psw))
|
if (!sqlset.connect(_DSN, _usr, _psw))
|
||||||
return "Connessione fallita!";
|
return "Connessione fallita!";
|
||||||
int items = TABELLE_CAMPO; // Numero totale di tabelle
|
int items = TABELLE_CAMPO; // Numero totale di tabelle
|
||||||
COpenDir((int)_manulock, NORDIR); // Apro dir.gen
|
COpenDir((int)_manulock, NORDIR); // Apro dir.gen
|
||||||
@ -392,42 +566,191 @@ bool TMSSQLExport_app::createIndexes() const
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TMSSQLExport_app::exportGen() const
|
bool TMSSQLExport_app::rko_outta_nowhere(const char* table_name) const
|
||||||
{
|
{
|
||||||
return dir_gen() && trc_gen();
|
_db->sq_set_exec(TString().cut(0) << "DROP TABLE " << table_name << ';');
|
||||||
|
return _db->sq_commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TMSSQLExport_app::exportTables() const
|
bool TMSSQLExport_app::empty_tables(const char* table_name) const
|
||||||
|
{
|
||||||
|
const bool ok = _db->sq_set_exec(TString().cut(0) << "DELETE FROM " << table_name << ';');
|
||||||
|
return ok && _db->sq_commit();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TMSSQLExport_app::expor_gen() const
|
||||||
|
{
|
||||||
|
return rko_gen() && create_gen_ms() && dir_gen() && trc_gen();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TMSSQLExport_app::file_valid(int logicnum) const
|
||||||
|
{
|
||||||
|
TFilename filename;
|
||||||
|
const TIsam_handle isam_handle = prefix().open_isamfile(logicnum, filename, false, true);
|
||||||
|
const TCodeb_handle fhnd = isam_handle > 0 ? prefix().get_handle(isam_handle, 1) : isam_handle;
|
||||||
|
const int trcreclen = prefix().get_reclen(logicnum);
|
||||||
|
const int dbfreclen = DB_reclen(fhnd);
|
||||||
|
return dbfreclen == trcreclen;
|
||||||
|
}
|
||||||
|
|
||||||
|
const TString to_escape(const TString& val)
|
||||||
|
{
|
||||||
|
TString& app = get_tmp_string();
|
||||||
|
for (int k = 0; k < val.len(); k++)
|
||||||
|
{
|
||||||
|
switch (val[k])
|
||||||
|
{
|
||||||
|
case '\'':
|
||||||
|
app << "''";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
app << val[k];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return app;
|
||||||
|
}
|
||||||
|
|
||||||
|
const TString query_to_null(TString& val)
|
||||||
|
{
|
||||||
|
int lastpos = val.find("(\'\'", 0); // Devo trovarne uno tra virgole
|
||||||
|
while (lastpos != -1)
|
||||||
|
{
|
||||||
|
lastpos++;
|
||||||
|
val[lastpos] = ' ';
|
||||||
|
val[lastpos + 1] = ' ';
|
||||||
|
val.insert("NULL", lastpos);
|
||||||
|
lastpos = val.find(",\'\'", lastpos);
|
||||||
|
}
|
||||||
|
lastpos = val.find(",\'\'", 0); // Devo trovarne uno tra virgole
|
||||||
|
while (lastpos != -1)
|
||||||
|
{
|
||||||
|
lastpos++;
|
||||||
|
val[lastpos] = ' ';
|
||||||
|
val[lastpos + 1] = ' ';
|
||||||
|
val.insert("NULL", lastpos);
|
||||||
|
lastpos = val.find(",\'\'", lastpos);
|
||||||
|
}
|
||||||
|
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
int TMSSQLExport_app::export_tables()
|
||||||
{
|
{
|
||||||
// Innanzitutto svuoto le tabelle
|
// Innanzitutto svuoto le tabelle
|
||||||
if(!emptyTables()) return false;
|
|
||||||
|
|
||||||
TODBC_recordset sqlset("");
|
bool check = true;
|
||||||
if (!sqlset.connect(DSN, usr, psw))
|
TString ditta_name; ditta_name << prefix().name() << "_";
|
||||||
return "Connessione fallita!";
|
|
||||||
try
|
int logicnum;
|
||||||
|
int endtab;
|
||||||
|
set_range_tab(logicnum, endtab);
|
||||||
|
int last_tab_err = -1;
|
||||||
|
|
||||||
|
for (; logicnum < endtab && check; logicnum++)
|
||||||
{
|
{
|
||||||
bool wat = false;
|
empty_tables(logic2table(logicnum));
|
||||||
// Inizio con dir.gen
|
TString nome_tab = tab_name(logicnum, ditta_name);
|
||||||
TString generalErrors;
|
const RecDes& rd = prefix().get_recdes(logicnum);
|
||||||
exportManager(generalErrors);
|
if (prefix().get_recdes(logicnum).NKeys <= 0)
|
||||||
|
{
|
||||||
|
log(2, TString("Il file ") << logicnum << " non esiste");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
TLocalisamfile table(logicnum);
|
||||||
|
if(!file_valid(logicnum))
|
||||||
|
{
|
||||||
|
log(2, TString("Impossibile esportare il file ") << logicnum << ". Lunghezza record incoerente.");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
TString queryF, queryV;
|
||||||
|
TProgress_monitor p(table.items(), TString("Esportazione tabella ") << logic2table(logicnum));
|
||||||
|
bool export_status = true;
|
||||||
|
bool ok = table.first() == NOERR;
|
||||||
|
for (; ok && export_status; ok = table.next() == NOERR)
|
||||||
|
{
|
||||||
|
if (_visual && !p.add_status())
|
||||||
|
return logicnum;
|
||||||
|
queryF.cut(0) << "INSERT INTO " << nome_tab << " (";
|
||||||
|
queryV.cut(0) << "(";
|
||||||
|
for (int k = 0; k < rd.NFields; k++)
|
||||||
|
{
|
||||||
|
queryF << "[" << rd.Fd[k].Name << "]";
|
||||||
|
if (table.get(rd.Fd[k].Name).empty()) // Vuoto, causa errori se non controllato
|
||||||
|
queryV << "''";
|
||||||
|
else
|
||||||
|
{
|
||||||
|
switch (rd.Fd[k].TypeF)
|
||||||
|
{
|
||||||
|
case _intfld:
|
||||||
|
case _wordfld:
|
||||||
|
case _intzerofld:
|
||||||
|
queryV << "'" << table.get_int(rd.Fd[k].Name) << "'";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case _longfld:
|
||||||
|
case _longzerofld:
|
||||||
|
queryV << "'" << table.get_long(rd.Fd[k].Name) << "'";
|
||||||
|
break;
|
||||||
|
|
||||||
|
// Real
|
||||||
|
case _realfld:
|
||||||
|
queryV << "'" << table.get_real(rd.Fd[k].Name).string() << "'";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case _datefld:
|
||||||
|
queryV << "'" << table.get_date(rd.Fd[k].Name).date2ansi() << "'";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case _boolfld:
|
||||||
|
if (table.get_bool(rd.Fd[k].Name))
|
||||||
|
queryV << "'1'";
|
||||||
|
else
|
||||||
|
queryV << "'0'";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case _charfld:
|
||||||
|
case _alfafld:
|
||||||
|
default:
|
||||||
|
queryV << "'" << to_escape(table.get(rd.Fd[k].Name)) << "'";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (k + 1 < rd.NFields) // Modo più comodo
|
||||||
|
{
|
||||||
|
queryF << ",";
|
||||||
|
queryV << ",";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
queryV << ")";
|
||||||
|
queryF << ") VALUES " << queryV;
|
||||||
|
//export_status &= _db->sq_set_exec(query_to_null(queryF));
|
||||||
|
if(!_db->sq_set_exec(query_to_null(queryF), false))
|
||||||
|
{
|
||||||
|
if (last_tab_err != logicnum)
|
||||||
|
{
|
||||||
|
log(2, TString("Errore esportazione tabella ") << logicnum << "\n\tQuery:" << queryF);
|
||||||
|
last_tab_err = logicnum;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
log(2, TString("\tQuery: ") << queryF);
|
||||||
|
log(2, _db->sq_get_string_error());
|
||||||
|
log(2, _db->sq_get_text_error());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
check = export_status && _db->sq_commit();
|
||||||
}
|
}
|
||||||
catch (TString orrore)
|
return check ? 0 : -1;
|
||||||
{
|
|
||||||
message_box(orrore);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TMSSQLExport_app::dir_gen() const
|
bool TMSSQLExport_app::dir_gen() const
|
||||||
{
|
{
|
||||||
TODBC_recordset sqlset("", true);
|
const int items = prefix().items()-1; // Numero totale di tabelle
|
||||||
// Controllo la connessione
|
const TString msg("Esportazione elenco directory");
|
||||||
if (!sqlset.connect(DSN, usr, psw))
|
|
||||||
return false;
|
|
||||||
int items = TABELLE_CAMPO; // Numero totale di tabelle
|
|
||||||
TString msg("Esportazione elenco directory");
|
|
||||||
COpenDir((int)_manulock, NORDIR); // Apro dir.gen
|
COpenDir((int)_manulock, NORDIR); // Apro dir.gen
|
||||||
TProgress_monitor p(items, msg);
|
TProgress_monitor p(items, msg);
|
||||||
for (int i = 1; i <= items && !p.is_cancelled(); i++)
|
for (int i = 1; i <= items && !p.is_cancelled(); i++)
|
||||||
@ -438,30 +761,26 @@ bool TMSSQLExport_app::dir_gen() const
|
|||||||
CGetFile(i, &d, _nolock, NORDIR);
|
CGetFile(i, &d, _nolock, NORDIR);
|
||||||
TString sqlQuery;
|
TString sqlQuery;
|
||||||
sqlQuery
|
sqlQuery
|
||||||
<< "INSERT INTO DIR_GEN (NUMERO,SYSNAME,EOD,EOX,FLAGS,LENR,DES,CALC,GENPROMPT) VALUES ('"
|
<< "INSERT INTO DIR_GEN (NUMERO,SYSNAME,EOD,EOX,LENR,FLAGS,DES,CALC,GENPROMPT) VALUES ('"
|
||||||
<< i << "','"
|
<< i << "','"
|
||||||
<< d.SysName << "','"
|
<< d.SysName << "','"
|
||||||
<< d.EOD << "','"
|
<< d.EOD << "','"
|
||||||
<< d.EOX << "','"
|
<< d.EOX << "','"
|
||||||
<< d.Flags << "','"
|
|
||||||
<< d.LenR << "','"
|
<< d.LenR << "','"
|
||||||
|
<< d.Flags << "','"
|
||||||
<< toEscape(d.Des) << "','"
|
<< toEscape(d.Des) << "','"
|
||||||
<< toEscape(d.FCalc) << "','"
|
<< toEscape(d.FCalc) << "','"
|
||||||
<< toEscape(d.GenPrompt) << "')";
|
<< toEscape(d.GenPrompt) << "')";
|
||||||
if(sqlset.exec(queryToNull(sqlQuery)) != 1)
|
if(!_db->sq_set_exec(queryToNull(sqlQuery), false))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return sqlset.commit() == -1 ? false : true;
|
return _db->sq_commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TMSSQLExport_app::trc_gen() const
|
bool TMSSQLExport_app::trc_gen() const
|
||||||
{
|
{
|
||||||
TODBC_recordset sqlset("", true);
|
const int items = prefix().items()-1; // Numero totale di tabelle
|
||||||
// Controllo la connessione
|
const TString msg("Esportazione tracciati record");
|
||||||
if (!sqlset.connect(DSN, usr, psw))
|
|
||||||
return false;
|
|
||||||
int items = TABELLE_CAMPO; // Numero totale di tabelle
|
|
||||||
TString msg("Esportazione tracciati record");
|
|
||||||
COpenDir((int)_manulock, NORDIR); // Apro dir.gen
|
COpenDir((int)_manulock, NORDIR); // Apro dir.gen
|
||||||
TProgress_monitor p(items-1, msg);
|
TProgress_monitor p(items-1, msg);
|
||||||
for (int i = 2; i <= items && !p.is_cancelled(); i++)
|
for (int i = 2; i <= items && !p.is_cancelled(); i++)
|
||||||
@ -487,7 +806,7 @@ bool TMSSQLExport_app::trc_gen() const
|
|||||||
<< SortFd << "','"
|
<< SortFd << "','"
|
||||||
<< d.NKeys << "','"
|
<< d.NKeys << "','"
|
||||||
<< i << "')";
|
<< i << "')";
|
||||||
if(sqlset.exec(queryToNull(sqlQueryTrc)) != 1)
|
if(!_db->sq_set_exec(queryToNull(sqlQueryTrc), false))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Poi trc_recfdes
|
// Poi trc_recfdes
|
||||||
@ -496,15 +815,14 @@ bool TMSSQLExport_app::trc_gen() const
|
|||||||
RecFieldDes r = d.Fd[j];
|
RecFieldDes r = d.Fd[j];
|
||||||
TString sqlQueryRFD;
|
TString sqlQueryRFD;
|
||||||
sqlQueryRFD
|
sqlQueryRFD
|
||||||
<< "INSERT INTO TRC_RECFDES (NumField, Name,TypeF,Len,Dec,RecOff,logicname) VALUES ('"
|
<< "INSERT INTO TRC_RECFDES (Name,TypeF,Len,Dec,RecOff,logicname) VALUES ('"
|
||||||
<< j << "','"
|
|
||||||
<< r.Name << "','"
|
<< r.Name << "','"
|
||||||
<< (int)r.TypeF << "','"
|
<< (int)r.TypeF << "','"
|
||||||
<< r.Len << "','"
|
<< r.Len << "','"
|
||||||
<< r.Dec << "','"
|
<< r.Dec << "','"
|
||||||
<< r.RecOff << "','"
|
<< r.RecOff << "','"
|
||||||
<< i << "')";
|
<< i << "')";
|
||||||
if(sqlset.exec(queryToNull(sqlQueryRFD)) != 1)
|
if(!_db->sq_set_exec(queryToNull(sqlQueryRFD), false))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -540,18 +858,18 @@ bool TMSSQLExport_app::trc_gen() const
|
|||||||
<< FromCh << "','"
|
<< FromCh << "','"
|
||||||
<< ToCh << "','"
|
<< ToCh << "','"
|
||||||
<< i << "')";
|
<< i << "')";
|
||||||
if(sqlset.exec(queryToNull(sqlQueryKD)) != 1)
|
if(!_db->sq_set_exec(queryToNull(sqlQueryKD), false))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return sqlset.commit() == -1 ? false : true;
|
return _db->sq_commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TMSSQLExport_app::exportManager(TString generalErrors) const
|
bool TMSSQLExport_app::export_manager(TString generalErrors) const
|
||||||
{
|
{
|
||||||
TODBC_recordset sqlset("", true);
|
TODBC_recordset sqlset("", true);
|
||||||
// Controllo la connessione
|
// Controllo la connessione
|
||||||
if (!sqlset.connect(DSN, usr, psw))
|
if (!sqlset.connect(_DSN, _usr, _psw))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
COpenDir((int)_manulock, NORDIR); // Apro dir.gen
|
COpenDir((int)_manulock, NORDIR); // Apro dir.gen
|
||||||
@ -662,31 +980,116 @@ bool TMSSQLExport_app::exportManager(TString generalErrors) const
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool TMSSQLExport_app::show_log()
|
||||||
|
{
|
||||||
|
if (_log)
|
||||||
|
{
|
||||||
|
_log->preview();
|
||||||
|
delete _log;
|
||||||
|
_log = NULL;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void TMSSQLExport_app::log(int severity, const char* msg)
|
||||||
|
{
|
||||||
|
if (_log == nullptr)
|
||||||
|
{
|
||||||
|
_log = new TLog_report;
|
||||||
|
// Tento l'eliminazione del file
|
||||||
|
std::remove("ba_export.log");
|
||||||
|
}
|
||||||
|
if (severity < 0)
|
||||||
|
{
|
||||||
|
_logstr = msg;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
static TString txt;
|
||||||
|
txt.cut(0);
|
||||||
|
if (_logstr.full())
|
||||||
|
{
|
||||||
|
txt << _logstr << ": " << msg;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
txt << msg;
|
||||||
|
_log->log(severity, txt);
|
||||||
|
// Scrivo anche su file
|
||||||
|
std::filebuf fb;
|
||||||
|
fb.open("ba_export.log", std::ios::out | std::ios::app);
|
||||||
|
std::ostream os(&fb);
|
||||||
|
os << txt << std::endl;
|
||||||
|
fb.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TMSSQLExport_app::my_range()
|
||||||
|
{
|
||||||
|
TString myrange(_msk->get(F_MYRANGE));
|
||||||
|
if (myrange.empty())
|
||||||
|
return false;
|
||||||
|
TToken_string range_tok(myrange, ',');
|
||||||
|
if(range_tok.items() > 0)
|
||||||
|
{
|
||||||
|
TToken_string one_range(range_tok.get(0), '-');
|
||||||
|
_msk->set(F_FROMTAB, one_range.get(0));
|
||||||
|
one_range.items() == 0 ? _msk->set(F_TOTAB, one_range.get(0)) : _msk->set(F_TOTAB, one_range.get(1));
|
||||||
|
range_tok.destroy(0);
|
||||||
|
TString rewrite;
|
||||||
|
for(int i=0; i < range_tok.items(); i++)
|
||||||
|
{
|
||||||
|
if (i > 0)
|
||||||
|
rewrite << ",";
|
||||||
|
rewrite << range_tok.get();
|
||||||
|
}
|
||||||
|
_msk->set(F_MYRANGE, rewrite);
|
||||||
|
}
|
||||||
|
return !TString(_msk->get(F_MYRANGE)).empty(); // se vuoto anche solo la prima volta interrompo il loop
|
||||||
|
}
|
||||||
|
|
||||||
void TMSSQLExport_app::main_loop()
|
void TMSSQLExport_app::main_loop()
|
||||||
{
|
{
|
||||||
TMSSQLExport_msk m;
|
TMSSQLExport_msk msk;
|
||||||
while (m.run() == K_ENTER)
|
_msk = &msk;
|
||||||
|
|
||||||
|
while (msk.run() == K_ENTER)
|
||||||
{
|
{
|
||||||
const TString& DSN = m.get(F_DSN);
|
#ifdef DBG
|
||||||
const TString& usr = m.get(F_USR);
|
const TString& _DSN = "TESTCAMPO2012\\MSSQLSERVER2019@campo13";
|
||||||
const TString& psw = m.get(F_PWD);
|
const TString& _usr = "campo";
|
||||||
|
const TString& _psw = "campo";
|
||||||
|
#else
|
||||||
|
const TString& _DSN = msk.get(F_DSN);
|
||||||
|
const TString& _usr = msk.get(F_USR);
|
||||||
|
const TString& _psw = msk.get(F_PWD);
|
||||||
|
#endif
|
||||||
|
_visual = true;
|
||||||
// Chiamo la funzione globale esporta
|
// Chiamo la funzione globale esporta
|
||||||
if(checkParameters(DSN, usr, psw))
|
if(connect(_DSN, _usr, _psw))
|
||||||
{
|
{
|
||||||
// Per comodità utilizzo gli AND short circuits, solo se i bool danno true eseguo la funzione dopo!
|
bool loop;
|
||||||
if(m.get_bool(CHK_CREATEGEN))
|
do
|
||||||
if(!createGen())
|
{
|
||||||
message_box("ERROR: Creazione tabelle gen fallita");
|
loop = my_range();
|
||||||
if(m.get_bool(CHK_CREATETABLES))
|
// Per comodità utilizzo gli AND short circuits, solo se i bool danno true eseguo la funzione dopo!
|
||||||
if(!createTables())
|
if (msk.get_bool(CHK_CREATEGEN))
|
||||||
message_box("ERROR: Creazione tabelle campo fallita");
|
if (!create_gen_ms())
|
||||||
if(m.get_bool(CHK_EXPORTGEN))
|
message_box("ERROR: Creazione tabelle gen fallita");
|
||||||
if (!exportGen())
|
if (msk.get_bool(CHK_CREATETABLES))
|
||||||
message_box("CERROR: Esportazione tabelle gen fallita");
|
if (!create_tables())
|
||||||
if(m.get_bool(CHK_EXPORTTABLES))
|
message_box("ERROR: Creazione tabelle campo fallita");
|
||||||
if(!exportTables())
|
if (msk.get_bool(CHK_EXPORTGEN))
|
||||||
message_box("ERROR: Esportazione tabelle campo fallita");
|
if (!expor_gen())
|
||||||
message_box("Migrazione effettuata correttamente!");
|
message_box("CERROR: Esportazione tabelle gen fallita");
|
||||||
|
if (msk.get_bool(CHK_EXPORTTABLES))
|
||||||
|
{
|
||||||
|
int err;
|
||||||
|
if ((err = export_tables()))
|
||||||
|
message_box(TString("ERROR: Esportazione tabelle campo fallita") << (err >= 2? TString(":\n Errorre tabella ") << err : ""));
|
||||||
|
}
|
||||||
|
message_box("Migrazione effettuata correttamente!");
|
||||||
|
} while (loop);
|
||||||
|
show_log();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
message_box("Fallita connessione");
|
message_box("Fallita connessione");
|
||||||
@ -698,7 +1101,7 @@ int ba2900(int argc, char* argv[])
|
|||||||
{
|
{
|
||||||
TMSSQLExport_app app;
|
TMSSQLExport_app app;
|
||||||
// Imposto le tabelle da utilizzare
|
// Imposto le tabelle da utilizzare
|
||||||
app.setTable("TRC_GEN|TRC_KEYDES|TRC_RECFDES");
|
app.set_table("TRC_GEN|TRC_KEYDES|TRC_RECFDES");
|
||||||
app.run(argc, argv, TR("Migrazione DB a MSSQL"));
|
app.run(argc, argv, TR("Migrazione DB a MSSQL"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -5,3 +5,8 @@
|
|||||||
#define CHK_CREATETABLES 254
|
#define CHK_CREATETABLES 254
|
||||||
#define CHK_EXPORTGEN 255
|
#define CHK_EXPORTGEN 255
|
||||||
#define CHK_EXPORTTABLES 256
|
#define CHK_EXPORTTABLES 256
|
||||||
|
|
||||||
|
#define CHK_ONLYTAB 257
|
||||||
|
#define F_FROMTAB 258
|
||||||
|
#define F_TOTAB 259
|
||||||
|
#define F_MYRANGE 260
|
@ -10,7 +10,7 @@ PAGE "Trasferimento DB su MSSQL" 0 2 0 0
|
|||||||
|
|
||||||
STRING F_DSN 260 50
|
STRING F_DSN 260 50
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 0 "ODBC DSN "
|
PROMPT 1 1 "ODBC DSN "
|
||||||
CHECKTYPE REQUIRED
|
CHECKTYPE REQUIRED
|
||||||
END
|
END
|
||||||
|
|
||||||
@ -30,6 +30,7 @@ END
|
|||||||
BOOLEAN CHK_CREATEGEN
|
BOOLEAN CHK_CREATEGEN
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 5 "Elimina e ricrea tutte le tabelle gen, Attenzione! I dati presenti verranno eliminati!"
|
PROMPT 1 5 "Elimina e ricrea tutte le tabelle gen, Attenzione! I dati presenti verranno eliminati!"
|
||||||
|
FLAGS ""
|
||||||
END
|
END
|
||||||
|
|
||||||
BOOLEAN CHK_CREATETABLES
|
BOOLEAN CHK_CREATETABLES
|
||||||
@ -40,6 +41,7 @@ END
|
|||||||
BOOLEAN CHK_EXPORTGEN
|
BOOLEAN CHK_EXPORTGEN
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 7 "Esporta tabelle gen"
|
PROMPT 1 7 "Esporta tabelle gen"
|
||||||
|
FLAGS ""
|
||||||
END
|
END
|
||||||
|
|
||||||
BOOLEAN CHK_EXPORTTABLES
|
BOOLEAN CHK_EXPORTTABLES
|
||||||
@ -47,6 +49,29 @@ BEGIN
|
|||||||
PROMPT 1 8 "Esporta tabelle dati"
|
PROMPT 1 8 "Esporta tabelle dati"
|
||||||
END
|
END
|
||||||
|
|
||||||
|
BOOLEAN CHK_ONLYTAB
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 9 "Esporta/crea tabelle in un intervallo"
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_FROMTAB 4 0
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 10 "Da "
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_TOTAB 3 0
|
||||||
|
BEGIN
|
||||||
|
PROMPT 10 10 "A "
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_MYRANGE 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 11 "MY RANGE "
|
||||||
|
FLAGS "H"
|
||||||
|
END
|
||||||
|
|
||||||
END
|
END
|
||||||
|
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
|
@ -123,7 +123,7 @@ TMask* TPrimanota_application::load_mask(int n)
|
|||||||
ism.set_handler(309, sheet_clifo_handler);
|
ism.set_handler(309, sheet_clifo_handler);
|
||||||
ism.set_handler(CG_RATEO, sheet_rateo_handler);
|
ism.set_handler(CG_RATEO, sheet_rateo_handler);
|
||||||
ism.set_handler(CG_RISCONTO, sheet_risconto_handler);
|
ism.set_handler(CG_RISCONTO, sheet_risconto_handler);
|
||||||
if (!(fexist("fp0.exe") && !fp_settings().get_db_indirizzo().empty() && !fp_settings().is_f8()))
|
if (!is_fp(m))
|
||||||
m->hide(F_PROTFPPRO);
|
m->hide(F_PROTFPPRO);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1049,7 +1049,7 @@ void TPrimanota_application::init_modify_mode(TMask& m)
|
|||||||
m.enable(F_BOLLACODCLI, causale().tipo_doc() == "BD");
|
m.enable(F_BOLLACODCLI, causale().tipo_doc() == "BD");
|
||||||
m.enable(F_BOLLARAGCLI, causale().tipo_doc() == "BD");
|
m.enable(F_BOLLARAGCLI, causale().tipo_doc() == "BD");
|
||||||
}
|
}
|
||||||
if(!m.field(F_PROTFPPRO).hidden())
|
if(m.find_by_id(F_PROTFPPRO) != NULL && !m.field(F_PROTFPPRO).hidden())
|
||||||
m.set(F_PROTFPPRO, mov.get(MOV_PROGFPPRO));
|
m.set(F_PROTFPPRO, mov.get(MOV_PROGFPPRO));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1564,14 +1564,14 @@ int TPrimanota_application::rewrite(const TMask& m)
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TPrimanota_application::clean_fppro() const
|
void TPrimanota_application::clean_fppro()
|
||||||
{
|
{
|
||||||
TMask& msk = curr_mask();
|
TMask& msk = curr_mask();
|
||||||
const KEY last_key = msk.last_key();
|
const KEY last_key = msk.last_key();
|
||||||
|
|
||||||
// Controlli: solo in mod modifica; che abbia fp (no F8); che non sono in salvataggio
|
// Controlli: solo in mod modifica; che abbia fp (no F8); che non sono in salvataggio
|
||||||
if (_mode != MODE_MOD
|
if (_mode != MODE_MOD
|
||||||
|| !is_fp()
|
|| !is_fp(&msk)
|
||||||
|| last_key != 127 && last_key != K_SAVE)
|
|| last_key != 127 && last_key != K_SAVE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -1586,12 +1586,17 @@ void TPrimanota_application::clean_fppro() const
|
|||||||
fp_db().sq_commit();
|
fp_db().sq_commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TPrimanota_application::is_fp()
|
bool TPrimanota_application::is_fp(TMask* m)
|
||||||
{
|
{
|
||||||
return fexist("fp0.exe") && !fp_settings().get_db_indirizzo().empty() && !fp_settings().is_f8();
|
static bool is_set_fpcheck = false;
|
||||||
|
if (!is_set_fpcheck)
|
||||||
|
{
|
||||||
|
_isfp = has_module(FPAUT) && !fp_settings().get_db_indirizzo().empty() && !fp_settings().is_f8();
|
||||||
|
is_set_fpcheck = true;
|
||||||
|
}
|
||||||
|
return _isfp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool TPrimanota_application::remove()
|
bool TPrimanota_application::remove()
|
||||||
{
|
{
|
||||||
const bool ok = TRelation_application::remove();
|
const bool ok = TRelation_application::remove();
|
||||||
@ -2336,13 +2341,13 @@ void TPrimanota_application::mask2ini(const TMask& msk, TConfig& ini)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int TPrimanota_application::save_fppro() const
|
int TPrimanota_application::save_fppro()
|
||||||
{
|
{
|
||||||
TMask& msk = curr_mask();
|
TMask& msk = curr_mask();
|
||||||
const KEY last = msk.last_key();
|
const KEY last = msk.last_key();
|
||||||
|
|
||||||
// Provo a vedere se hanno l'FP: se c'è l'indirizzo controllo che non sia F8 se non c'è non hanno l'FP
|
// Provo a vedere se hanno l'FP: se c'è l'indirizzo controllo che non sia F8 se non c'è non hanno l'FP
|
||||||
if (!is_fp())
|
if (!is_fp(&msk))
|
||||||
return pro_nofp;
|
return pro_nofp;
|
||||||
if (!fp_db().sq_is_connect())
|
if (!fp_db().sq_is_connect())
|
||||||
{
|
{
|
||||||
@ -2379,7 +2384,7 @@ int TPrimanota_application::save_fppro() const
|
|||||||
TLocalisamfile clifo(LF_CAUSALI);
|
TLocalisamfile clifo(LF_CAUSALI);
|
||||||
clifo.setkey(1);
|
clifo.setkey(1);
|
||||||
clifo.put("CODCAUS", msk.get(F_CODCAUS));
|
clifo.put("CODCAUS", msk.get(F_CODCAUS));
|
||||||
if (clifo.read() != NOERR && clifo.get("TIPODOC") != "FA")
|
if (clifo.read() != NOERR || clifo.get("TIPODOC") != "FA")
|
||||||
return pro_notsaved;
|
return pro_notsaved;
|
||||||
if (last != K_SAVE) { // Se sto uscendo avvertimento di non salvataggio e salto
|
if (last != K_SAVE) { // Se sto uscendo avvertimento di non salvataggio e salto
|
||||||
message_box("La registrazione del movimento non verrà salvata sul database.");
|
message_box("La registrazione del movimento non verrà salvata sul database.");
|
||||||
@ -2430,7 +2435,10 @@ int TPrimanota_application::save_fppro() const
|
|||||||
const int n = fp_db().sq_items();
|
const int n = fp_db().sq_items();
|
||||||
if (n != 1)
|
if (n != 1)
|
||||||
{
|
{
|
||||||
message_box("Attenzione non è stato possibile indentificare\nil documento con una specifica fattura in ingresso.\nSi prega di riportare i dati dei documenti selezionandolo con l'apposito sistema di aggancio alle fatture di ingresso");
|
message_box(TString("Attenzione,") << "al movimento non è stato abbinato nessun documento elettronico.\n" <<
|
||||||
|
"Per conserntire una corretta archiviazione sostitutiva si consiglia di non confermare la registrazione e di procedere\n" <<
|
||||||
|
"all'identificazione del fornitore tramite il monitor fatture passive.\n" <<
|
||||||
|
"In caso di documento escluso dalla fatturazione elettronica ignorate questo messaggio.");
|
||||||
return pro_notsaved;
|
return pro_notsaved;
|
||||||
}
|
}
|
||||||
const int numreg = fp_db().sq_get_int("PZ_NUMREGCONT");
|
const int numreg = fp_db().sq_get_int("PZ_NUMREGCONT");
|
||||||
|
@ -3451,38 +3451,6 @@ bool TPrimanota_application::protiva_handler(TMask_field& f, KEY key)
|
|||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TPrimanota_application::fppro_mask(TMask_field& f, KEY key)
|
|
||||||
{
|
|
||||||
if (!is_fp() || key != K_SPACE && key != K_TAB)
|
|
||||||
return true;
|
|
||||||
|
|
||||||
TMask& cg_msk = f.mask();
|
|
||||||
TMask* msk = new TMask("cg2fppro");
|
|
||||||
msk->set_handler(DLG_CONFIG, fppro_handler);
|
|
||||||
msk->set_handler(DLG_LINK, fppro_ok_handler);
|
|
||||||
msk->set(F_CODCLIFORS, cg_msk.get(F_CODCLIFOR));
|
|
||||||
msk->set(F_COFIS, cg_msk.get(F_COFI));
|
|
||||||
msk->set(F_STATOPAIVS, cg_msk.get(F_STATOPAIV));
|
|
||||||
msk->set(F_PIVAS, cg_msk.get(F_PIVA));
|
|
||||||
|
|
||||||
if(load_fppro_mask(msk))
|
|
||||||
{
|
|
||||||
msk->run();
|
|
||||||
// Riporto dati FPPRO su maschera Prima Nota
|
|
||||||
cg_msk.set(F_NUMDOCEXT, msk->get(F_NUMEROI));
|
|
||||||
cg_msk.set(F_NUMDOC, TString(msk->get(F_NUMEROI)).right(7));
|
|
||||||
cg_msk.set(F_DATADOC, msk->get(F_DATAI));
|
|
||||||
cg_msk.set(F_TOTALE, msk->get(F_TOTDOCI));
|
|
||||||
cg_msk.set(F_PROTFPPRO, msk->get(F_PROTFPPROI));
|
|
||||||
cg_msk.set(F_PROKEY, msk->get(F_FPPROKEYSI));
|
|
||||||
cg_msk.set(F_ANNORIF, cg_msk.get(F_ANNOIVA));
|
|
||||||
}
|
|
||||||
|
|
||||||
delete msk;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Handler of the F_RITFIS
|
// Handler of the F_RITFIS
|
||||||
// Certified 100%
|
// Certified 100%
|
||||||
bool TPrimanota_application::ritfis_handler(TMask_field& f, KEY key)
|
bool TPrimanota_application::ritfis_handler(TMask_field& f, KEY key)
|
||||||
@ -3857,17 +3825,41 @@ bool TPrimanota_application::quadratura_handler(TMask_field& f, KEY key)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TPrimanota_application::load_fppro_mask(TMask* msk, KEY k)
|
bool TPrimanota_application::fppro_mask(TMask_field& f, KEY key)
|
||||||
|
{
|
||||||
|
TMask& cg_msk = f.mask();
|
||||||
|
if (!app().get_isfp() || key != K_SPACE && key != K_TAB)
|
||||||
|
return true;
|
||||||
|
auto msk = std::make_shared<TPro_msk>(cg_msk);
|
||||||
|
|
||||||
|
//load_list(msk, key);
|
||||||
|
//if(load_fppro_mask(msk))
|
||||||
|
if (msk->load_fppro_mask(msk.get()))
|
||||||
|
{
|
||||||
|
msk->run();
|
||||||
|
// Riporto dati FPPRO su maschera Prima Nota
|
||||||
|
cg_msk.set(F_NUMDOCEXT, msk->get(F_NUMEROI));
|
||||||
|
cg_msk.set(F_NUMDOC, TString(msk->get(F_NUMEROI)).right(7));
|
||||||
|
cg_msk.set(F_DATADOC, msk->get(F_DATAI));
|
||||||
|
cg_msk.set(F_TOTALE, msk->get(F_TOTDOCI));
|
||||||
|
cg_msk.set(F_PROTFPPRO, msk->get(F_PROTFPPROI));
|
||||||
|
cg_msk.set(F_PROKEY, msk->get(F_FPPROKEYSI));
|
||||||
|
cg_msk.set(F_ANNORIF, cg_msk.get(F_ANNOIVA));
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TPro_msk::load_fppro_mask(TMask* msk, KEY k)
|
||||||
{
|
{
|
||||||
// Provo a vedere se hanno l'FP: se c'è l'indirizzo controllo che non sia F8 se non c'è non hanno l'FP
|
// Provo a vedere se hanno l'FP: se c'è l'indirizzo controllo che non sia F8 se non c'è non hanno l'FP
|
||||||
if (k != 32 || !is_fp())
|
if (k != 32)
|
||||||
return false;
|
return false;
|
||||||
if (!fp_db().sq_is_connect())
|
if (!fp_db().sq_is_connect())
|
||||||
{
|
{
|
||||||
message_box("Attenzione connessione al database non riuscita.\nImpossibile collegarsi ai documenti in entrata.");
|
message_box("Attenzione connessione al database non riuscita.\nImpossibile collegarsi ai documenti in entrata.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const int forn = msk->get_int(F_CODCLIFORS);
|
const int forn = msk->get_int(F_CODCLIFORS);
|
||||||
if (forn == 0)
|
if (forn == 0)
|
||||||
{
|
{
|
||||||
@ -3932,14 +3924,14 @@ bool TPrimanota_application::load_fppro_mask(TMask* msk, KEY k)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TPrimanota_application::fppro_handler(TMask_field& f, KEY k)
|
bool TPro_msk::fppro_handler(TMask_field& f, KEY k)
|
||||||
{
|
{
|
||||||
TMask& msk = f.mask();
|
TMask& msk = f.mask();
|
||||||
const bool load = load_fppro_mask(&msk, k);
|
const bool load = load_fppro_mask(&msk, k);
|
||||||
return load;
|
return load;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TPrimanota_application::fppro_ok_handler(TMask_field& f, KEY k)
|
bool TPro_msk::fppro_ok_handler(TMask_field& f, KEY k)
|
||||||
{
|
{
|
||||||
if (k != 32)
|
if (k != 32)
|
||||||
return true;
|
return true;
|
||||||
@ -3969,10 +3961,43 @@ bool TPrimanota_application::fppro_ok_handler(TMask_field& f, KEY k)
|
|||||||
row->add("", 0);
|
row->add("", 0);
|
||||||
}
|
}
|
||||||
sf.force_update();
|
sf.force_update();
|
||||||
if(ok)
|
if(!ok)
|
||||||
message_box("Dati caricati.\nChiudere la maschera per tornare alla prima nota.");
|
|
||||||
else
|
|
||||||
message_box("Nessun documento selezionato.");
|
message_box("Nessun documento selezionato.");
|
||||||
//msk.stop_run(20334);
|
msk.stop_run(20334);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TPro_msk::fppro_selfatt() const
|
||||||
|
{
|
||||||
|
const TMask& mask = *this;
|
||||||
|
TSheet_field& sf = mask.sfield(F_SHEETFPPROS);
|
||||||
|
sf.hide();
|
||||||
|
FOR_EACH_SHEET_ROW(sf, nr, row)
|
||||||
|
{
|
||||||
|
if (*row->get(0) == 'X')
|
||||||
|
row->add("", 0);
|
||||||
|
}
|
||||||
|
sf.force_update();
|
||||||
|
sf.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TPro_msk::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
||||||
|
{
|
||||||
|
if (o.dlg() == F_SELFPPROS)
|
||||||
|
{
|
||||||
|
if(e == fe_modify)
|
||||||
|
fppro_selfatt();
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
TPro_msk::TPro_msk(TMask& cg_msk) : TAutomask("cg2fppro"), _parent_mask(cg_msk)
|
||||||
|
{
|
||||||
|
TMask::set_handler(DLG_CONFIG, fppro_handler);
|
||||||
|
TMask::set_handler(DLG_LINK, fppro_ok_handler);
|
||||||
|
TMask::set(F_CODCLIFORS, cg_msk.get(F_CODCLIFOR));
|
||||||
|
TMask::set(F_COFIS, cg_msk.get(F_COFI));
|
||||||
|
TMask::set(F_STATOPAIVS, cg_msk.get(F_STATOPAIV));
|
||||||
|
TMask::set(F_PIVAS, cg_msk.get(F_PIVA));
|
||||||
|
}
|
||||||
|
@ -32,6 +32,10 @@
|
|||||||
#ifndef __CG2100_H
|
#ifndef __CG2100_H
|
||||||
#include "cg2100.h"
|
#include "cg2100.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <automask.h>
|
||||||
|
|
||||||
|
class TPro_msk;
|
||||||
class TDati_mov_auto;
|
class TDati_mov_auto;
|
||||||
|
|
||||||
enum CGMaskType { _query = 0, _no_iva = 1, _iva = 2, _occas = 3};
|
enum CGMaskType { _query = 0, _no_iva = 1, _iva = 2, _occas = 3};
|
||||||
@ -89,7 +93,8 @@ class TPrimanota_application : public TRelation_application
|
|||||||
TEsercizi_contabili _esercizi; // Tabella degli esercizi contabili
|
TEsercizi_contabili _esercizi; // Tabella degli esercizi contabili
|
||||||
|
|
||||||
TAssoc_array _colori; // Colori delle righe
|
TAssoc_array _colori; // Colori delle righe
|
||||||
|
bool _isfp;
|
||||||
|
|
||||||
static bool showpartite_handler(TMask_field& f, KEY k);
|
static bool showpartite_handler(TMask_field& f, KEY k);
|
||||||
static bool speserimb_handler(TMask_field& f, KEY k);
|
static bool speserimb_handler(TMask_field& f, KEY k);
|
||||||
static bool altrespese_handler(TMask_field& f, KEY k);
|
static bool altrespese_handler(TMask_field& f, KEY k);
|
||||||
@ -172,11 +177,9 @@ class TPrimanota_application : public TRelation_application
|
|||||||
// Handlers per aggancio FPPRO
|
// Handlers per aggancio FPPRO
|
||||||
// Bottone per maschera FPPRO
|
// Bottone per maschera FPPRO
|
||||||
static bool fppro_mask(TMask_field& f, KEY key);
|
static bool fppro_mask(TMask_field& f, KEY key);
|
||||||
// Bottone carica documenti in maschera FPPRO
|
static void fppromask_set_handl(TMask* msk);
|
||||||
static bool fppro_handler(TMask_field& f, KEY k);
|
static void load_list(TMask* msk, KEY k);
|
||||||
// Bottone riporta doc FPPRO in testata Prima Nota
|
|
||||||
static bool fppro_ok_handler(TMask_field& f, KEY k);
|
|
||||||
|
|
||||||
void reset_sheet_row(TSheet_field& s, int n);
|
void reset_sheet_row(TSheet_field& s, int n);
|
||||||
int crea_somma_spese(TImporto& imp);
|
int crea_somma_spese(TImporto& imp);
|
||||||
void update_saldo_riga(int r);
|
void update_saldo_riga(int r);
|
||||||
@ -192,15 +195,13 @@ protected: // TApplication
|
|||||||
virtual void mask2ini(const TMask& msk, TConfig& ini);
|
virtual void mask2ini(const TMask& msk, TConfig& ini);
|
||||||
|
|
||||||
// Metodi per aggancio FPPRO (solo su operazioni di Fattura di Acquisto)
|
// Metodi per aggancio FPPRO (solo su operazioni di Fattura di Acquisto)
|
||||||
// Carica documenti FPPRO sulla maschera
|
|
||||||
static bool load_fppro_mask(TMask* msk, KEY k = 32);
|
|
||||||
// Salvo dati fornitore e registrazione contabile sul db FPPRO
|
// Salvo dati fornitore e registrazione contabile sul db FPPRO
|
||||||
int save_fppro() const;
|
int save_fppro();
|
||||||
// Salva sul movimento il riferimento al documento in FPPRO
|
// Salva sul movimento il riferimento al documento in FPPRO
|
||||||
bool save_dbmov() const;
|
bool save_dbmov() const;
|
||||||
// Pulisce il mov e db dai firerimenti FPPRO (in MODE_MOD per edit/delete)
|
// Pulisce il mov e db dai firerimenti FPPRO (in MODE_MOD per edit/delete)
|
||||||
void clean_fppro() const;
|
void clean_fppro();
|
||||||
static bool is_fp();
|
bool is_fp(TMask* m);
|
||||||
virtual bool save(bool check_dirty);
|
virtual bool save(bool check_dirty);
|
||||||
|
|
||||||
bool get_mask_swap_file(TFilename& name) const;
|
bool get_mask_swap_file(TFilename& name) const;
|
||||||
@ -344,6 +345,7 @@ public:
|
|||||||
static char row_type(const TToken_string& s);
|
static char row_type(const TToken_string& s);
|
||||||
static bool iva_notify(TSheet_field& s, int r, KEY key);
|
static bool iva_notify(TSheet_field& s, int r, KEY key);
|
||||||
static bool cg_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; }
|
||||||
|
|
||||||
TMask * mask(CGMaskType type) { return _msk[type]; }
|
TMask * mask(CGMaskType type) { return _msk[type]; }
|
||||||
|
|
||||||
@ -363,11 +365,31 @@ public:
|
|||||||
TSheet_field& pags() const;
|
TSheet_field& pags() const;
|
||||||
TString_array& pag_rows() { return _pag_rows; }
|
TString_array& pag_rows() { return _pag_rows; }
|
||||||
TImporto get_cgs_imp(int n) const;
|
TImporto get_cgs_imp(int n) const;
|
||||||
|
|
||||||
|
|
||||||
TPrimanota_application();
|
TPrimanota_application();
|
||||||
virtual ~TPrimanota_application() { }
|
virtual ~TPrimanota_application() { }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class TPro_msk : public TAutomask
|
||||||
|
{
|
||||||
|
TMask& _parent_mask;
|
||||||
|
// Handlers per aggancio FPPRO
|
||||||
|
// Bottone carica documenti in maschera FPPRO
|
||||||
|
static bool fppro_handler(TMask_field& f, KEY k);
|
||||||
|
// Bottone riporta doc FPPRO in testata Prima Nota
|
||||||
|
static bool fppro_ok_handler(TMask_field& f, KEY k);
|
||||||
|
// Non permette la selezione multipla
|
||||||
|
void fppro_selfatt() const;
|
||||||
|
bool on_field_event(TOperable_field& o, TField_event e, long jolly) override;
|
||||||
|
public:
|
||||||
|
//bool is_fp();
|
||||||
|
// Carica documenti FPPRO sulla maschera
|
||||||
|
static bool load_fppro_mask(TMask* msk, KEY k = 32);
|
||||||
|
TPro_msk() = delete;
|
||||||
|
TPro_msk(TMask& cg_msk);
|
||||||
|
};
|
||||||
|
|
||||||
#ifndef __EXTRA__
|
#ifndef __EXTRA__
|
||||||
inline TPrimanota_application& app()
|
inline TPrimanota_application& app()
|
||||||
{ return (TPrimanota_application&)main_app(); }
|
{ return (TPrimanota_application&)main_app(); }
|
||||||
|
@ -395,7 +395,11 @@ void TMancati_app::main_loop()
|
|||||||
const TFixed_string codnum(riga->get(mask.sfield(F_DOCS).cid2index(S_CODNUM)));
|
const TFixed_string codnum(riga->get(mask.sfield(F_DOCS).cid2index(S_CODNUM)));
|
||||||
const TFixed_string tipodoc(riga->get(mask.sfield(F_DOCS).cid2index(S_TIPODOC)));
|
const TFixed_string tipodoc(riga->get(mask.sfield(F_DOCS).cid2index(S_TIPODOC)));
|
||||||
const long codcf = riga->get_long(mask.sfield(F_DOCS).cid2index(S_CLIENTE));
|
const long codcf = riga->get_long(mask.sfield(F_DOCS).cid2index(S_CLIENTE));
|
||||||
|
#ifdef DBG
|
||||||
|
const TString mail = "spalacino@sirio-is.it";
|
||||||
|
#else
|
||||||
const TString mail = riga->get(mask.sfield(F_DOCS).cid2index(S_DOCMAIL));
|
const TString mail = riga->get(mask.sfield(F_DOCS).cid2index(S_DOCMAIL));
|
||||||
|
#endif
|
||||||
bool accord = TString(riga->get(mask.sfield(F_DOCS).cid2index(S_BYMAIL))) == "X";
|
bool accord = TString(riga->get(mask.sfield(F_DOCS).cid2index(S_BYMAIL))) == "X";
|
||||||
TString ragsoc = riga->get(mask.sfield(F_DOCS).cid2index(S_RAGSOC));
|
TString ragsoc = riga->get(mask.sfield(F_DOCS).cid2index(S_RAGSOC));
|
||||||
bool sent = TString(riga->get(mask.sfield(F_DOCS).cid2index(S_SENT))) == "X";
|
bool sent = TString(riga->get(mask.sfield(F_DOCS).cid2index(S_SENT))) == "X";
|
||||||
|
@ -1267,9 +1267,7 @@ void TDoc_fp::add_ritenuta(const TDocumentoEsteso& doc, const TSpesa_prest& sp,
|
|||||||
paf0700f.set("P7_TIPORITENUTA", _rec_clifo.get_char(CLI_TIPOPERS) == 'F' ? "RT01" : "RT02");
|
paf0700f.set("P7_TIPORITENUTA", _rec_clifo.get_char(CLI_TIPOPERS) == 'F' ? "RT01" : "RT02");
|
||||||
TString doc_imponibile = doc.imponibile().string();
|
TString doc_imponibile = doc.imponibile().string();
|
||||||
|
|
||||||
const real imponibile = doc.ritenute();
|
paf0700f.set("P7_IMPORTORIT", converti_prezzo(doc.ritenute()));
|
||||||
|
|
||||||
paf0700f.set("P7_IMPORTORIT", converti_prezzo(imponibile * sp.perc() / CENTO));
|
|
||||||
paf0700f.set("P7_ALIQUOTARIT", sp.perc());
|
paf0700f.set("P7_ALIQUOTARIT", sp.perc());
|
||||||
static TString caus_la; caus_la.cut(0);
|
static TString caus_la; caus_la.cut(0);
|
||||||
caus_la << sp.get("S14");
|
caus_la << sp.get("S14");
|
||||||
@ -2009,7 +2007,7 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
|||||||
|
|
||||||
// Riga sconto di testata
|
// Riga sconto di testata
|
||||||
// Se è presente uno sconto in testata devo sottrarlo come riga sconto o lo SDI urla
|
// Se è presente uno sconto in testata devo sottrarlo come riga sconto o lo SDI urla
|
||||||
if(doc.get(DOC_SCONTOPERC).full())
|
if(doc.get(DOC_SCONTOPERC).full() && doc.get(DOC_SCONTOPERC) != "0")
|
||||||
{
|
{
|
||||||
TAssoc_array& tiva = doc.tabella_iva(false);
|
TAssoc_array& tiva = doc.tabella_iva(false);
|
||||||
FOR_EACH_ASSOC_OBJECT(tiva, obj, key, itm)
|
FOR_EACH_ASSOC_OBJECT(tiva, obj, key, itm)
|
||||||
|
@ -69,7 +69,7 @@ bool TFp_mail_sender::send(const TString& msg)
|
|||||||
|
|
||||||
const int pdf_exist = pdf.exist();
|
const int pdf_exist = pdf.exist();
|
||||||
if (pdf_exist)
|
if (pdf_exist)
|
||||||
ok = spotlite_send_mail(pdf); // -> Invio mail con PDF già esistente
|
ok = spotlite_send_mail(pdf, msg); // -> Invio mail con PDF già esistente
|
||||||
else if (genera_pdf()) // Genero pdf se non esiste già (in tempdir)
|
else if (genera_pdf()) // Genero pdf se non esiste già (in tempdir)
|
||||||
{ // Manda già un messaggio di errore generazione se fallisce la generazione
|
{ // Manda già un messaggio di errore generazione se fallisce la generazione
|
||||||
TFilename newf_pdf; newf_pdf << _pdf_path << _pdf_name;
|
TFilename newf_pdf; newf_pdf << _pdf_path << _pdf_name;
|
||||||
|
BIN
src/fp/sql/fp0106.sql
Normal file
BIN
src/fp/sql/fp0106.sql
Normal file
Binary file not shown.
@ -361,6 +361,7 @@ public:
|
|||||||
bool allega_documenti() const { return get_bool("B10"); }
|
bool allega_documenti() const { return get_bool("B10"); }
|
||||||
bool auto_add() const { return get_bool("B11"); }
|
bool auto_add() const { return get_bool("B11"); }
|
||||||
bool invio_xml() const { return get_bool("B13"); }
|
bool invio_xml() const { return get_bool("B13"); }
|
||||||
|
bool esponi_dicitura_fe() const { return !get_bool("B14"); }
|
||||||
|
|
||||||
const TString& stringa_descrizione_documento() const { return _str_desc_doc; }
|
const TString& stringa_descrizione_documento() const { return _str_desc_doc; }
|
||||||
const TString& stringa_descrizione_riga() const { return _str_desc_rdoc; }
|
const TString& stringa_descrizione_riga() const { return _str_desc_rdoc; }
|
||||||
@ -891,6 +892,7 @@ public:
|
|||||||
void set_fields(TAuto_variable_rectype & rec);
|
void set_fields(TAuto_variable_rectype & rec);
|
||||||
void update_esenzione();
|
void update_esenzione();
|
||||||
void set_riga_esenzione();
|
void set_riga_esenzione();
|
||||||
|
bool esponi_dicitura();
|
||||||
void set_riga_valfisc();
|
void set_riga_valfisc();
|
||||||
const TRiga_documento& get_riga_esenzione() const { return *_esenzione; }
|
const TRiga_documento& get_riga_esenzione() const { return *_esenzione; }
|
||||||
bool ha_riga_sconto() const { return _sconto != NULL; }
|
bool ha_riga_sconto() const { return _sconto != NULL; }
|
||||||
|
@ -1079,7 +1079,7 @@ void TDocumento::set_riga_esenzione()
|
|||||||
void TDocumento::set_riga_valfisc()
|
void TDocumento::set_riga_valfisc()
|
||||||
{
|
{
|
||||||
static TDate anno_fatt_elett = TDate(01, 01, 2019);
|
static TDate anno_fatt_elett = TDate(01, 01, 2019);
|
||||||
if(is_fattura() && tipo().tipo_doc_sdi().full() && data() >= anno_fatt_elett)
|
if(tipo().esponi_dicitura_fe() && is_fattura() && tipo().tipo_doc_sdi().full() && data() >= anno_fatt_elett)
|
||||||
{
|
{
|
||||||
if (_valfisc == nullptr)
|
if (_valfisc == nullptr)
|
||||||
_valfisc = new TRiga_documento(this, "05");
|
_valfisc = new TRiga_documento(this, "05");
|
||||||
|
@ -116,6 +116,7 @@
|
|||||||
#define F_IVA_NI 504
|
#define F_IVA_NI 504
|
||||||
#define F_IVA_NS 505
|
#define F_IVA_NS 505
|
||||||
|
|
||||||
|
#define F_ESPONIDIC 510
|
||||||
#define FT_GOLEM 511
|
#define FT_GOLEM 511
|
||||||
#define F_ADDROW 512
|
#define F_ADDROW 512
|
||||||
#define F_QUADRO 513
|
#define F_QUADRO 513
|
||||||
|
@ -1284,7 +1284,7 @@ BEGIN
|
|||||||
FIELD S3[4,4]
|
FIELD S3[4,4]
|
||||||
END
|
END
|
||||||
|
|
||||||
GROUPBOX DLG_NULL 62 3
|
GROUPBOX DLG_NULL 62 4
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 8 "@bStampa documenti avanzata"
|
PROMPT 1 8 "@bStampa documenti avanzata"
|
||||||
END
|
END
|
||||||
@ -1295,9 +1295,15 @@ BEGIN
|
|||||||
FIELD B10
|
FIELD B10
|
||||||
END
|
END
|
||||||
|
|
||||||
|
BOOLEAN F_ESPONIDIC
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 10 "Non esporre dicitura fattura di cortesia per FP"
|
||||||
|
FIELD B14
|
||||||
|
END
|
||||||
|
|
||||||
BOOLEAN F_ADDROW
|
BOOLEAN F_ADDROW
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 11 "Crea 10 righe vuote in inserimento"
|
PROMPT 38 4 "Crea 10 righe vuote in inserimento"
|
||||||
FIELD B11
|
FIELD B11
|
||||||
END
|
END
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user