Revert "Patch level : 12.0 no-patch"
This reverts commit 65ceeee069e4dddc1dbffe396092f35bde98c8d9.
This commit is contained in:
parent
65ceeee069
commit
70013337fa
@ -229,7 +229,6 @@
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
|
||||
<ClCompile Include="..\src\cg\cgpagame.cpp">
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
|
@ -196,18 +196,12 @@
|
||||
<ProjectReference Include="AgaLib.vcxproj">
|
||||
<Project>{2d38a763-3d74-4338-9362-b891784ec90e}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="cglib.vcxproj">
|
||||
<Project>{7b80f974-ce2e-4bd9-855a-44ff139ff288}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="lilib.vcxproj">
|
||||
<Project>{b61f0ad4-0cce-4371-8e92-85a26caf1a7c}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="vedoc.vcxproj">
|
||||
<Project>{a1ce9743-a597-4f92-b55a-345a366c9e55}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="vedocext.vcxproj">
|
||||
<Project>{0042619a-6b7c-4d3d-9cd9-9bdd8d200c15}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\src\cg\cglib.h" />
|
||||
|
@ -225,9 +225,6 @@
|
||||
<ProjectReference Include="AgaLib.vcxproj">
|
||||
<Project>{2d38a763-3d74-4338-9362-b891784ec90e}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="cglib.vcxproj">
|
||||
<Project>{7b80f974-ce2e-4bd9-855a-44ff139ff288}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="vedoc.vcxproj">
|
||||
<Project>{a1ce9743-a597-4f92-b55a-345a366c9e55}</Project>
|
||||
</ProjectReference>
|
||||
|
@ -13,15 +13,15 @@
|
||||
<Filter Include="Menu">
|
||||
<UniqueIdentifier>{022385bd-474b-4d1f-a01c-6d799bae0328}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Sources">
|
||||
<UniqueIdentifier>{06bc8aeb-f506-4c2e-85fb-bdeb92f2c77e}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="SQL">
|
||||
<UniqueIdentifier>{28870b23-e896-4312-855b-049305092f1d}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Recdesc">
|
||||
<UniqueIdentifier>{95c95f84-ca93-4c2f-b1cf-e94922dfa7ef}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Src">
|
||||
<UniqueIdentifier>{06bc8aeb-f506-4c2e-85fb-bdeb92f2c77e}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\src\f9\f90.h">
|
||||
@ -57,19 +57,19 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\src\f9\f90.cpp">
|
||||
<Filter>Src</Filter>
|
||||
<Filter>Sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\f9\f90100.cpp">
|
||||
<Filter>Src</Filter>
|
||||
<Filter>Sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\f9\f90200.cpp">
|
||||
<Filter>Src</Filter>
|
||||
<Filter>Sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\f9\f90300.cpp">
|
||||
<Filter>Src</Filter>
|
||||
<Filter>Sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\f9\f90400.cpp">
|
||||
<Filter>Src</Filter>
|
||||
<Filter>Sources</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
Binary file not shown.
@ -1,11 +1,9 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.28307.1169
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fastrip", "fastrip.vcxproj", "{68251613-3B9A-4F87-9F40-827C46267ADE}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "patchdef", "patchdef.vcxproj", "{2DCB2E4A-EFB6-4561-8D87-C5ADBDB76533}"
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "patchdef", "patchdef.vcxproj", "{F0F108C3-BE88-4AB4-995A-3A921586A7A6}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
@ -17,15 +15,12 @@ Global
|
||||
{68251613-3B9A-4F87-9F40-827C46267ADE}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{68251613-3B9A-4F87-9F40-827C46267ADE}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{68251613-3B9A-4F87-9F40-827C46267ADE}.Release|Win32.Build.0 = Release|Win32
|
||||
{2DCB2E4A-EFB6-4561-8D87-C5ADBDB76533}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{2DCB2E4A-EFB6-4561-8D87-C5ADBDB76533}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{2DCB2E4A-EFB6-4561-8D87-C5ADBDB76533}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{2DCB2E4A-EFB6-4561-8D87-C5ADBDB76533}.Release|Win32.Build.0 = Release|Win32
|
||||
{F0F108C3-BE88-4AB4-995A-3A921586A7A6}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{F0F108C3-BE88-4AB4-995A-3A921586A7A6}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{F0F108C3-BE88-4AB4-995A-3A921586A7A6}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{F0F108C3-BE88-4AB4-995A-3A921586A7A6}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {A31D73DA-2F36-4A6A-8CA0-91657BB33948}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
12
build/fp.sln
12
build/fp.sln
@ -23,10 +23,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fp1", "fp1.vcxproj", "{A539
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "f1lib", "f1lib.vcxproj", "{41F4C25F-6BD2-4FC9-A0D3-A68CD1C9E4FC}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vedoc", "vedoc.vcxproj", "{A1CE9743-A597-4F92-B55A-345A366C9E55}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cglib", "cglib.vcxproj", "{7B80F974-CE2E-4BD9-855A-44FF139FF288}"
|
||||
EndProjectGlobal
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
@ -56,14 +55,11 @@ EndProjectGlobal
|
||||
{41F4C25F-6BD2-4FC9-A0D3-A68CD1C9E4FC}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{41F4C25F-6BD2-4FC9-A0D3-A68CD1C9E4FC}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{41F4C25F-6BD2-4FC9-A0D3-A68CD1C9E4FC}.Release|Win32.Build.0 = Release|Win32
|
||||
{A1CE9743-A597-4F92-B55A-345A366C9E55}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{A1CE9743-A597-4F92-B55A-345A366C9E55}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{A1CE9743-A597-4F92-B55A-345A366C9E55}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{A1CE9743-A597-4F92-B55A-345A366C9E55}.Release|Win32.Build.0 = Release|Win32
|
||||
{7B80F974-CE2E-4BD9-855A-44FF139FF288}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{7B80F974-CE2E-4BD9-855A-44FF139FF288}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{7B80F974-CE2E-4BD9-855A-44FF139FF288}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{7B80F974-CE2E-4BD9-855A-44FF139FF288}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection
|
||||
{7B80F974-CE2E-4BD9-855A-44FF139FF288}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
|
@ -92,7 +92,6 @@
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
|
||||
</Link>
|
||||
<Bscmake>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
@ -179,9 +178,6 @@
|
||||
<ProjectReference Include="AgaLib.vcxproj">
|
||||
<Project>{2d38a763-3d74-4338-9362-b891784ec90e}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="cglib.vcxproj">
|
||||
<Project>{7b80f974-ce2e-4bd9-855a-44ff139ff288}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="f1lib.vcxproj">
|
||||
<Project>{41f4c25f-6bd2-4fc9-a0d3-a68cd1c9e4fc}</Project>
|
||||
</ProjectReference>
|
||||
@ -193,6 +189,8 @@
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\src\cg\cglib01.cpp" />
|
||||
<ClCompile Include="..\src\cg\cglib03.cpp" />
|
||||
<ClCompile Include="..\src\fe\felib.cpp" />
|
||||
<ClCompile Include="..\src\fp\fp0.cpp" />
|
||||
<ClCompile Include="..\src\fp\fp0100.cpp" />
|
||||
|
@ -39,6 +39,12 @@
|
||||
<ClCompile Include="..\src\fe\felib.cpp">
|
||||
<Filter>Sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\cg\cglib01.cpp">
|
||||
<Filter>Sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\cg\cglib03.cpp">
|
||||
<Filter>Sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\fp\fp0300.cpp">
|
||||
<Filter>Sources</Filter>
|
||||
</ClCompile>
|
||||
|
@ -177,9 +177,6 @@
|
||||
<ProjectReference Include="AgaLib.vcxproj">
|
||||
<Project>{2d38a763-3d74-4338-9362-b891784ec90e}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="cglib.vcxproj">
|
||||
<Project>{7b80f974-ce2e-4bd9-855a-44ff139ff288}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="fplib.vcxproj">
|
||||
<Project>{c575788b-0be4-4f68-b9c9-3c204ec04e07}</Project>
|
||||
</ProjectReference>
|
||||
@ -191,6 +188,8 @@
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\src\cg\cglib01.cpp" />
|
||||
<ClCompile Include="..\src\cg\cglib03.cpp" />
|
||||
<ClCompile Include="..\src\fp\fp1200.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
</ExcludedFromBuild>
|
||||
|
@ -24,6 +24,12 @@
|
||||
<ClCompile Include="..\src\fp\fp1100.cpp">
|
||||
<Filter>Sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\cg\cglib01.cpp">
|
||||
<Filter>Sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\cg\cglib03.cpp">
|
||||
<Filter>Sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\fp\fp1200.cpp">
|
||||
<Filter>Sources</Filter>
|
||||
</ClCompile>
|
||||
|
@ -177,7 +177,6 @@
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\li\li0300.cpp" />
|
||||
<ClCompile Include="..\src\li\li0700.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<MskCompiler Include="..\src\li\li0100a.uml" />
|
||||
@ -188,7 +187,6 @@
|
||||
<MskCompiler Include="..\src\li\li0600a.uml" />
|
||||
<MskCompiler Include="..\src\li\li0600b.uml" />
|
||||
<MskCompiler Include="..\src\li\li0300a.uml" />
|
||||
<MskCompiler Include="..\src\li\li0700a.uml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\src\li\letint.h" />
|
||||
@ -201,7 +199,6 @@
|
||||
<ClInclude Include="..\src\li\li0600a.h" />
|
||||
<ClInclude Include="..\src\li\li0600b.h" />
|
||||
<ClInclude Include="..\src\li\li0300a.h" />
|
||||
<ClInclude Include="..\src\li\li0700a.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<TrrCompiler Include="..\src\li\f154.trr" />
|
||||
@ -239,9 +236,6 @@
|
||||
<ProjectReference Include="AgaLib.vcxproj">
|
||||
<Project>{2d38a763-3d74-4338-9362-b891784ec90e}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="cglib.vcxproj">
|
||||
<Project>{7b80f974-ce2e-4bd9-855a-44ff139ff288}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="lilib.vcxproj">
|
||||
<Project>{c575788b-0be4-4f68-b9c9-3c204ec04e07}</Project>
|
||||
</ProjectReference>
|
||||
|
@ -55,9 +55,6 @@
|
||||
<ClCompile Include="..\src\li\li0100.cpp">
|
||||
<Filter>Sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\li\li0700.cpp">
|
||||
<Filter>Sources</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<MskCompiler Include="..\src\li\li0400a.uml">
|
||||
@ -84,9 +81,6 @@
|
||||
<MskCompiler Include="..\src\li\li0200a.uml">
|
||||
<Filter>Masks</Filter>
|
||||
</MskCompiler>
|
||||
<MskCompiler Include="..\src\li\li0700a.uml">
|
||||
<Filter>Masks</Filter>
|
||||
</MskCompiler>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\src\li\letint.h">
|
||||
@ -119,9 +113,6 @@
|
||||
<ClInclude Include="..\src\li\li0100a.h">
|
||||
<Filter>Headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\li\li0700a.h">
|
||||
<Filter>Headers</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<TrrCompiler Include="..\src\li\f154.trr">
|
||||
|
15
build/lv.sln
15
build/lv.sln
@ -1,8 +1,6 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.28307.1169
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lv0", "lv0.vcxproj", "{2DB7F8EF-BABB-4A27-BC7D-8821B0D285C6}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lv2", "lv2.vcxproj", "{8F2CFD2E-BDE5-44CC-B27D-BCEC31F5E55D}"
|
||||
@ -23,8 +21,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vedoc", "vedoc.vcxproj", "{
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vedocext", "vedocext.vcxproj", "{0042619A-6B7C-4D3D-9CD9-9BDD8D200C15}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cglib", "cglib.vcxproj", "{7B80F974-CE2E-4BD9-855A-44FF139FF288}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
@ -71,15 +67,8 @@ Global
|
||||
{0042619A-6B7C-4D3D-9CD9-9BDD8D200C15}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{0042619A-6B7C-4D3D-9CD9-9BDD8D200C15}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{0042619A-6B7C-4D3D-9CD9-9BDD8D200C15}.Release|Win32.Build.0 = Release|Win32
|
||||
{7B80F974-CE2E-4BD9-855A-44FF139FF288}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{7B80F974-CE2E-4BD9-855A-44FF139FF288}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{7B80F974-CE2E-4BD9-855A-44FF139FF288}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{7B80F974-CE2E-4BD9-855A-44FF139FF288}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {483BBFE6-95C6-4A0D-8547-A56B2ACBFE7F}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
@ -120,6 +120,7 @@
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PrecompiledHeaderOutputFile>$(IntDir)$(TargetName).pch</PrecompiledHeaderOutputFile>
|
||||
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
@ -451,9 +452,6 @@
|
||||
<ProjectReference Include="AgaLib.vcxproj">
|
||||
<Project>{2d38a763-3d74-4338-9362-b891784ec90e}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="cglib.vcxproj">
|
||||
<Project>{7b80f974-ce2e-4bd9-855a-44ff139ff288}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="vedoc.vcxproj">
|
||||
<Project>{a1ce9743-a597-4f92-b55a-345a366c9e55}</Project>
|
||||
</ProjectReference>
|
||||
|
@ -122,6 +122,7 @@
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PrecompiledHeaderOutputFile>$(IntDir)$(TargetName).pch</PrecompiledHeaderOutputFile>
|
||||
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
@ -219,9 +220,6 @@
|
||||
<ProjectReference Include="AgaLib.vcxproj">
|
||||
<Project>{2d38a763-3d74-4338-9362-b891784ec90e}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="cglib.vcxproj">
|
||||
<Project>{7b80f974-ce2e-4bd9-855a-44ff139ff288}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="vedoc.vcxproj">
|
||||
<Project>{a1ce9743-a597-4f92-b55a-345a366c9e55}</Project>
|
||||
</ProjectReference>
|
||||
|
@ -119,6 +119,7 @@
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PrecompiledHeaderOutputFile>$(IntDir)$(TargetName).pch</PrecompiledHeaderOutputFile>
|
||||
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
@ -247,9 +248,6 @@
|
||||
<ProjectReference Include="AgaLib.vcxproj">
|
||||
<Project>{2d38a763-3d74-4338-9362-b891784ec90e}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="cglib.vcxproj">
|
||||
<Project>{7b80f974-ce2e-4bd9-855a-44ff139ff288}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="vedoc.vcxproj">
|
||||
<Project>{a1ce9743-a597-4f92-b55a-345a366c9e55}</Project>
|
||||
</ProjectReference>
|
||||
|
@ -120,6 +120,7 @@
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PrecompiledHeaderOutputFile>$(IntDir)$(TargetName).pch</PrecompiledHeaderOutputFile>
|
||||
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
@ -228,9 +229,6 @@
|
||||
<ProjectReference Include="AgaLib.vcxproj">
|
||||
<Project>{2d38a763-3d74-4338-9362-b891784ec90e}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="cglib.vcxproj">
|
||||
<Project>{7b80f974-ce2e-4bd9-855a-44ff139ff288}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="vedoc.vcxproj">
|
||||
<Project>{a1ce9743-a597-4f92-b55a-345a366c9e55}</Project>
|
||||
</ProjectReference>
|
||||
|
@ -123,6 +123,7 @@
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PrecompiledHeaderOutputFile>$(IntDir)$(TargetName).pch</PrecompiledHeaderOutputFile>
|
||||
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
@ -229,9 +230,6 @@
|
||||
<ProjectReference Include="AgaLib.vcxproj">
|
||||
<Project>{2d38a763-3d74-4338-9362-b891784ec90e}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="cglib.vcxproj">
|
||||
<Project>{7b80f974-ce2e-4bd9-855a-44ff139ff288}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="vedoc.vcxproj">
|
||||
<Project>{a1ce9743-a597-4f92-b55a-345a366c9e55}</Project>
|
||||
</ProjectReference>
|
||||
|
15
build/np.sln
15
build/np.sln
@ -1,14 +1,10 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.28307.1169
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "np0", "np0.vcxproj", "{3D726EFE-764B-4B24-A4ED-DCD41B9BB386}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AgaLib", "AgaLib.vcxproj", "{2D38A763-3D74-4338-9362-B891784EC90E}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cglib", "cglib.vcxproj", "{7B80F974-CE2E-4BD9-855A-44FF139FF288}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
@ -23,15 +19,8 @@ Global
|
||||
{2D38A763-3D74-4338-9362-B891784EC90E}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{2D38A763-3D74-4338-9362-B891784EC90E}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{2D38A763-3D74-4338-9362-B891784EC90E}.Release|Win32.Build.0 = Release|Win32
|
||||
{7B80F974-CE2E-4BD9-855A-44FF139FF288}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{7B80F974-CE2E-4BD9-855A-44FF139FF288}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{7B80F974-CE2E-4BD9-855A-44FF139FF288}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{7B80F974-CE2E-4BD9-855A-44FF139FF288}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {2059D4F2-C03A-44B1-B57D-CC2F215AA63A}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
@ -123,6 +123,7 @@
|
||||
<AssemblerListingLocation>.\../debug/</AssemblerListingLocation>
|
||||
<ObjectFileName>$(IntDir)</ObjectFileName>
|
||||
<ProgramDataBaseFileName>.\../debug/</ProgramDataBaseFileName>
|
||||
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
@ -213,6 +214,8 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\cg\cg2101.cpp" />
|
||||
<ClCompile Include="..\src\cg\cg2103.cpp" />
|
||||
<ClCompile Include="..\src\cg\cg3100.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
@ -226,7 +229,11 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\cg\cg3601.cpp" />
|
||||
<ClCompile Include="..\src\cg\cglib01.cpp" />
|
||||
<ClCompile Include="..\src\cg\cglib02.cpp" />
|
||||
<ClCompile Include="..\src\cg\cglib03.cpp" />
|
||||
<ClCompile Include="..\src\cg\cgsalda3.cpp" />
|
||||
<ClCompile Include="..\src\cg\cgsaldac.cpp" />
|
||||
<ClCompile Include="..\src\np\np0.cpp" />
|
||||
<ClCompile Include="..\src\np\np0100.cpp" />
|
||||
<ClCompile Include="..\src\np\np0200.cpp" />
|
||||
@ -242,9 +249,6 @@
|
||||
<ProjectReference Include="AgaLib.vcxproj">
|
||||
<Project>{2d38a763-3d74-4338-9362-b891784ec90e}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="cglib.vcxproj">
|
||||
<Project>{7b80f974-ce2e-4bd9-855a-44ff139ff288}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
|
@ -104,6 +104,21 @@
|
||||
<ClCompile Include="..\src\np\np0200.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\cg\cglib01.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\cg\cglib02.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\cg\cg2101.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\cg\cg2103.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\cg\cglib03.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\np\np0300.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
@ -128,6 +143,9 @@
|
||||
<ClCompile Include="..\src\cg\cg3100.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\cg\cgsaldac.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\cg\cg3601.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
|
15
build/pa.sln
15
build/pa.sln
@ -1,8 +1,6 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.28307.1169
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pa0", "pa0.vcxproj", "{9C91BACF-9A70-4973-B8CC-FA3D2AF9867C}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AgaLib", "AgaLib.vcxproj", "{2D38A763-3D74-4338-9362-B891784EC90E}"
|
||||
@ -11,8 +9,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vedoc", "vedoc.vcxproj", "{
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vedocext", "vedocext.vcxproj", "{0042619A-6B7C-4D3D-9CD9-9BDD8D200C15}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cglib", "cglib.vcxproj", "{7B80F974-CE2E-4BD9-855A-44FF139FF288}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
@ -35,15 +31,8 @@ Global
|
||||
{0042619A-6B7C-4D3D-9CD9-9BDD8D200C15}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{0042619A-6B7C-4D3D-9CD9-9BDD8D200C15}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{0042619A-6B7C-4D3D-9CD9-9BDD8D200C15}.Release|Win32.Build.0 = Release|Win32
|
||||
{7B80F974-CE2E-4BD9-855A-44FF139FF288}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{7B80F974-CE2E-4BD9-855A-44FF139FF288}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{7B80F974-CE2E-4BD9-855A-44FF139FF288}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{7B80F974-CE2E-4BD9-855A-44FF139FF288}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {69D00821-F954-46BE-90AE-936C60E6BB70}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
@ -68,6 +68,7 @@
|
||||
<PreprocessorDefinitions>_DEBUG;WIN32;__LONGDOUBLE__;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
@ -190,9 +191,6 @@
|
||||
<ProjectReference Include="AgaLib.vcxproj">
|
||||
<Project>{2d38a763-3d74-4338-9362-b891784ec90e}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="cglib.vcxproj">
|
||||
<Project>{7b80f974-ce2e-4bd9-855a-44ff139ff288}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="vedoc.vcxproj">
|
||||
<Project>{a1ce9743-a597-4f92-b55a-345a366c9e55}</Project>
|
||||
</ProjectReference>
|
||||
|
@ -167,7 +167,6 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\src\ve\ve0.h" />
|
||||
<ClInclude Include="..\src\ve\veuml.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
|
@ -11,9 +11,6 @@
|
||||
<Filter Include="Src">
|
||||
<UniqueIdentifier>{4d816024-06a3-4d7c-963b-7dd4af001f48}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Headers">
|
||||
<UniqueIdentifier>{eac085d5-88d2-4aeb-8abb-48e2d4128862}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<SrcCompiler Include="..\src\ve\bollac.src">
|
||||
@ -50,11 +47,8 @@
|
||||
</SrcCompiler>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\src\ve\veuml.h">
|
||||
<Filter>Headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\ve\ve0.h">
|
||||
<Filter>Headers</Filter>
|
||||
<Filter>Sources</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -157,6 +157,13 @@
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\cg\cg2101.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\cg\cglib02.cpp" />
|
||||
<ClCompile Include="..\src\cg\cglib03.cpp" />
|
||||
<ClCompile Include="..\src\cg\cgsaldac.cpp" />
|
||||
<ClCompile Include="..\src\gv\gvlib.cpp" />
|
||||
<ClCompile Include="..\src\ve\ve8.cpp">
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
|
@ -19,6 +19,15 @@
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\src\cg\cg2101.cpp">
|
||||
<Filter>Sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\cg\cglib02.cpp">
|
||||
<Filter>Sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\cg\cglib03.cpp">
|
||||
<Filter>Sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\ve\ve8.cpp">
|
||||
<Filter>Sources</Filter>
|
||||
</ClCompile>
|
||||
@ -34,6 +43,9 @@
|
||||
<ClCompile Include="..\src\gv\gvlib.cpp">
|
||||
<Filter>Sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\cg\cgsaldac.cpp">
|
||||
<Filter>Sources</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<MskCompiler Include="..\src\ve\ve8100.uml">
|
||||
|
BIN
exe/Ba1.exe
BIN
exe/Ba1.exe
Binary file not shown.
BIN
exe/Cb6.dll
BIN
exe/Cb6.dll
Binary file not shown.
BIN
exe/ba0.exe
BIN
exe/ba0.exe
Binary file not shown.
@ -52,11 +52,6 @@ PR 5 1 "Ultimo"
|
||||
ME EXIT,310
|
||||
PI 125
|
||||
EN
|
||||
BU 49 2 2
|
||||
BE
|
||||
PR 3 1 "~Log"
|
||||
PI 176
|
||||
EN
|
||||
BU -1 2 2
|
||||
BE
|
||||
PR -1 1 ""
|
||||
|
BIN
exe/bainst.exe
BIN
exe/bainst.exe
Binary file not shown.
@ -6,4 +6,3 @@ Study =clienti/major\
|
||||
Type = 1
|
||||
User = ADMIN
|
||||
Temp=c:\temp
|
||||
|
||||
|
BIN
exe/gfm.dll
BIN
exe/gfm.dll
Binary file not shown.
BIN
exe/pdflib.dll
BIN
exe/pdflib.dll
Binary file not shown.
BIN
exe/xi.dll
BIN
exe/xi.dll
Binary file not shown.
BIN
exe/xvaga.dll
BIN
exe/xvaga.dll
Binary file not shown.
@ -15,7 +15,6 @@
|
||||
|
||||
#include <applicat.h>
|
||||
#include <dongle.h>
|
||||
#include <relapp.h>
|
||||
#include <printer.h>
|
||||
#include <progind.h>
|
||||
#include <reputils.h>
|
||||
@ -79,8 +78,6 @@ protected:
|
||||
void repair_file(int i);
|
||||
void save_file(const char * file);
|
||||
|
||||
virtual void show_log();
|
||||
|
||||
void open_log();
|
||||
void write_log(const char* line, const int severity = 0);
|
||||
void close_log();
|
||||
@ -387,24 +384,6 @@ bool TManutenzione_app::destroy()
|
||||
return TApplication::destroy();
|
||||
}
|
||||
|
||||
void TManutenzione_app::show_log()
|
||||
{
|
||||
if (db_log())
|
||||
{
|
||||
if (admin())
|
||||
{
|
||||
TLog_mask m;
|
||||
|
||||
m.run();
|
||||
}
|
||||
else
|
||||
message_box(TR("Il log delle transazioni è visualizzabile dall'amministratore"));
|
||||
}
|
||||
else
|
||||
message_box(TR("Il log delle transazioni è disattivato"));
|
||||
}
|
||||
|
||||
|
||||
void TManutenzione_app::open_log()
|
||||
{
|
||||
_print_log = false;
|
||||
|
@ -136,7 +136,7 @@ protected:
|
||||
bool dir_gen() const;
|
||||
bool trc_gen() const;
|
||||
bool export_manager(const TString generalErrors) const;
|
||||
bool show_export_log();
|
||||
bool show_log();
|
||||
void log(int severity, const char* msg);
|
||||
|
||||
public:
|
||||
@ -980,7 +980,7 @@ bool TMSSQLExport_app::export_manager(TString generalErrors) const
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TMSSQLExport_app::show_export_log()
|
||||
bool TMSSQLExport_app::show_log()
|
||||
{
|
||||
if (_log)
|
||||
{
|
||||
@ -1089,7 +1089,7 @@ void TMSSQLExport_app::main_loop()
|
||||
}
|
||||
message_box("Migrazione effettuata correttamente!");
|
||||
} while (loop);
|
||||
show_export_log();
|
||||
show_log();
|
||||
}
|
||||
else
|
||||
message_box("Fallita connessione");
|
||||
|
@ -1329,7 +1329,7 @@ void TConversione_archivi::sort_sal(int year) const
|
||||
sal.set_anno_es(year);
|
||||
sal.clear_saldi(year);
|
||||
long numreg = 0L;
|
||||
tiposal tsal = saldo_normale;
|
||||
tiposal tsal = normale;
|
||||
bool provvis = FALSE;
|
||||
TDate datareg;
|
||||
|
||||
@ -1360,7 +1360,7 @@ void TConversione_archivi::sort_sal(int year) const
|
||||
causali.zero();
|
||||
const char* codcaus = mov.get(MOV_CODCAUS);
|
||||
|
||||
tsal = saldo_normale;
|
||||
tsal = normale;
|
||||
if (*codcaus) // cerca causale per determinare il tipoo del saldo
|
||||
{
|
||||
causali.put(CAU_CODCAUS, codcaus);
|
||||
@ -1369,10 +1369,10 @@ void TConversione_archivi::sort_sal(int year) const
|
||||
{
|
||||
const char ac = causali.get_char(CAU_MOVAP);
|
||||
if (ac == 'A')
|
||||
tsal = saldo_apertura;
|
||||
tsal = apertura;
|
||||
else
|
||||
if (ac == 'C')
|
||||
tsal = saldo_chiusura;
|
||||
tsal = chiusura;
|
||||
}
|
||||
}
|
||||
|
||||
|
Binary file not shown.
@ -498,6 +498,7 @@ void TSknet_sync::sync_anamag()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
// Controllo se esistono varianti e le aggiungo
|
||||
query.cut(0) << "SELECT * FROM tieArtVarianti where origine=" << their_origin() << " AND " << where_time_import() << ";";
|
||||
@ -642,11 +643,57 @@ void TSknet_sync::sync_anamag()
|
||||
if (!flag)
|
||||
flag = yesno_box("Attenzione trovato articolo con categoria CONAI vuota: %s\nSopprimere eventuali prossimi messaggi?", (const char*)codart);
|
||||
}
|
||||
/*
|
||||
|
||||
art.first(); // Useless??
|
||||
rart.zero();
|
||||
rart.put(ANAMAG_CODART, odbc.get("Cod_PK").as_string());
|
||||
if (odbc.get("Cod_PK").as_string().blank())
|
||||
continue;
|
||||
if (rart.read(art, _isequal) == NOERR)
|
||||
{
|
||||
static TString catCON;
|
||||
// Metodo del cazzo, format crasha e non ho tempo, magari in un futuro sistemarlo (se non ho visto male funziona solo su linux)
|
||||
TString a = odbc.get("CatAC").as_string().left(4); a.lpad(4);
|
||||
TString b = odbc.get("CatAL").as_string().left(4); b.lpad(4);
|
||||
TString c = odbc.get("CatCA").as_string().left(4); c.lpad(4);
|
||||
TString d = odbc.get("CatLE").as_string().left(4); d.lpad(4);
|
||||
TString e = odbc.get("CatPL").as_string().left(4); e.lpad(4);
|
||||
TString f = odbc.get("CatVE").as_string().left(4); f.lpad(4);
|
||||
catCON.cut(0) << a << b << c << d << e << f;
|
||||
|
||||
/ *
|
||||
catCON.format("%4 s%4 s%4 s%4 s%4 s%4 s",
|
||||
odbc.get("CatAC").as_string().left(4), // Categoria Acciaio
|
||||
odbc.get("CatAL").as_string().left(4), // Categoria Alluminio
|
||||
odbc.get("CatCA").as_string().left(4), // Categoria Carta
|
||||
odbc.get("CatLE").as_string().left(4), // Categoria Legno
|
||||
odbc.get("CatPL").as_string().left(4), // Categoria Plastica
|
||||
odbc.get("CatVE").as_string().left(4) // Categoria Vetro
|
||||
);
|
||||
* /
|
||||
|
||||
rart.put(ANAMAG_CONAISC, catCON);
|
||||
rart.put(ANAMAG_CONACC, odbc.get("PesoAC").as_real()); // Peso Acciaio
|
||||
rart.put(ANAMAG_CONALL, odbc.get("PesoAL").as_real()); // Peso Alluminio
|
||||
rart.put(ANAMAG_CONCAR, odbc.get("PesoCA").as_real()); // Peso Carta
|
||||
rart.put(ANAMAG_CONLEG, odbc.get("PesoLE").as_real()); // Peso Legno
|
||||
rart.put(ANAMAG_CONPLA, odbc.get("PesoPL").as_real()); // Peso Plastica
|
||||
rart.put(ANAMAG_CONVET, odbc.get("PesoVE").as_real()); // Peso Vetro
|
||||
art.rewrite(rart);
|
||||
}
|
||||
else
|
||||
// EROR! EROR!
|
||||
{
|
||||
bool tolla = true;
|
||||
}
|
||||
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*static bool ClifoEvaluator(const TISAM_recordset& rec, const char* fldname, const char* expr, TVariant& var)
|
||||
static bool ClifoEvaluator(const TISAM_recordset& rec, const char* fldname, const char* expr, TVariant& var)
|
||||
{
|
||||
const TAnagrafica& a = _anagr.anag(rec);
|
||||
|
||||
@ -763,7 +810,7 @@ void TSknet_sync::sync_anamag()
|
||||
}
|
||||
|
||||
return false;
|
||||
} */
|
||||
}
|
||||
|
||||
const TString& TSknet_sync::comune(const TRecordset& recset, const char* fld_cap, const char* fld_den) const
|
||||
{
|
||||
@ -868,13 +915,13 @@ void TSknet_sync::load_clifo(const char tipocf)
|
||||
clifo.put(CLI_PEC, odbc.get("PEC").as_string());
|
||||
cfv.put(CFV_PADESTIN, odbc.get("CodDest").as_string());
|
||||
|
||||
|
||||
clifo.put const int tipo = odbc.get("Tipo").as_int(); // 1=Fisica; 2=Giuridica; 3=Altro
|
||||
const int tipo = odbc.get("Tipo").as_int(); // 1=Fisica; 2=Giuridica; 3=Altro
|
||||
if (tipo == 1)
|
||||
{
|
||||
clifo.put(CLI_SESSO, odbc.get("Sesso").as_string());
|
||||
clifo.put(CLI_DATANASC, odbc.get("DTNascita").as_date());
|
||||
clifo.put(CLI_COMNASC, comune(odbc, "", "ComuneNascita"));(CLI_TIPOPERS, 'F');
|
||||
clifo.put(CLI_COMNASC, comune(odbc, "", "ComuneNascita"));
|
||||
clifo.put(CLI_TIPOPERS, 'F');
|
||||
}
|
||||
else
|
||||
clifo.put(CLI_TIPOPERS, 'G');
|
||||
@ -1334,7 +1381,54 @@ void TSknet_sync::sync_val()
|
||||
sync_table("%VAL", "tieValute", fields);
|
||||
}
|
||||
|
||||
|
||||
//auto find_codalt_sknet = [](TRectype& rcodcor, TLocalisamfile& codcor, const TString& tipocf, long codcf, const TString& codart, TString& codartmag, bool& checked)
|
||||
//{
|
||||
// // Testo quanti sono. Non ho altro modo?
|
||||
// const bool items = rcodcor.next(codcor) == NOERR && rcodcor.get(CODCORR_CODARTALT) == codart;
|
||||
// if (items)
|
||||
// {
|
||||
// rcodcor.prev(codcor);
|
||||
// // Prima cerco subito se ho un codice per questo cliente.
|
||||
// // Altrimenti prendo quello che non e' un codice di pack, se c'e' altrimenti riprendo sempre il primo.
|
||||
// TSQL_recordset codici(TString() << "SELECT * FROM CODCORR WHERE CODARTALT = '" << codart << "' AND TIPOCF = '" << tipocf << "' AND CODCF = '" << codcf << "'");
|
||||
// if (codici.items() == 1)
|
||||
// {
|
||||
// codartmag = codici.get(codici.find_column(CODCORR_CODART)).as_string();
|
||||
// checked = true;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// TString last_cod = rcodcor.get(CODCORR_CODART);
|
||||
//
|
||||
// // Codice di PACK di cinque cifre.
|
||||
// static auto is_pack_code = [&]()
|
||||
// {
|
||||
// bool flag = last_cod.len() == 5;
|
||||
// for (int i = 0; i < 5 && flag; ++i) flag &= xvt_chr_is_digit(last_cod[i]);
|
||||
// return flag;
|
||||
// };
|
||||
//
|
||||
// checked = true; // Se va tutto bene ho il nuovo codartmag.
|
||||
// while (is_pack_code())
|
||||
// {
|
||||
// if (rcodcor.next(codcor) == NOERR && rcodcor.get(CODCORR_CODARTALT) == codart)
|
||||
// {
|
||||
// last_cod = rcodcor.get(CODCORR_CODART);
|
||||
// continue;
|
||||
// }
|
||||
// checked = false;
|
||||
// break;
|
||||
// }
|
||||
// if (checked)
|
||||
// {
|
||||
// if (rcodcor.next(codcor) != NOERR || rcodcor.get(CODCORR_CODARTALT) != codart) // Controllo che sia effettivamente l'unico altrimenenti ciaone.
|
||||
// codartmag = last_cod;
|
||||
// else
|
||||
// checked = false;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//};
|
||||
|
||||
void TSknet_sync::sync_doc()
|
||||
{
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include "../ca/commesse.h"
|
||||
#include "../ca/fasi.h"
|
||||
|
||||
#include "../cg/cglib.h"
|
||||
#include "../cg/cglib01.h"
|
||||
|
||||
#include "ce0.h"
|
||||
#include "celib.h"
|
||||
|
@ -253,7 +253,7 @@ bool TSelam_qmask::on_field_event(TOperable_field& o, TField_event e, long jolly
|
||||
real valore = salce.get_real(SALCE_CSTO)-salce.get_real(SALCE_VNONAMM)+salce.get_real(SALCE_RIV75)+salce.get_real(SALCE_RIV83)+salce.get_real(SALCE_RIV90)+salce.get_real(SALCE_RIV91)+salce.get_real(SALCE_RIVGF);
|
||||
real valoreuni = valore / salce.get_int(SALCE_NUMELE);
|
||||
if (valoreuni <= _uniprice)
|
||||
_ammo100 = true;
|
||||
_ammo100 = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -262,7 +262,7 @@ bool TSelam_qmask::on_field_event(TOperable_field& o, TField_event e, long jolly
|
||||
real valore = salce.get_real(SALCE_CSTO)-salce.get_real(SALCE_VNONAMM)+salce.get_real(SALCE_RIV75)+salce.get_real(SALCE_RIV83)+salce.get_real(SALCE_RIV90)+salce.get_real(SALCE_RIV91)+salce.get_real(SALCE_RIVGF);
|
||||
real valoreuni = valore / salce.get_int(SALCE_NUMELE);
|
||||
if (valoreuni <= _uniprice)
|
||||
_ammo100 = true;
|
||||
_ammo100 = TRUE;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
#include "../ca/commesse.h"
|
||||
#include "../ca/calib01.h"
|
||||
#include "../cg/cglib.h"
|
||||
#include "../cg/cglib01.h"
|
||||
#include "celib.h"
|
||||
#include "salcecms.h"
|
||||
|
||||
|
@ -12,7 +12,8 @@
|
||||
#include "../ca/movana.h"
|
||||
#include "../ca/rmovana.h"
|
||||
|
||||
#include "../cg/cglib.h"
|
||||
#include "../cg/cg2101.h"
|
||||
#include "../cg/cglib02.h"
|
||||
|
||||
#include "celib.h"
|
||||
#include "ce2101.h"
|
||||
|
@ -788,8 +788,7 @@ void TClifo_application::init_modify_mode(TMask& m)
|
||||
void TClifo_application::set_pnae(TMask& m, TToken_string& nonacc, TToken_string& nonscd)
|
||||
{
|
||||
TSheet_field& pnae = m.sfield(F_NONACCEFF);
|
||||
|
||||
pnae.reset_sheet();
|
||||
pnae.destroy();
|
||||
TToken_string periodo(12, ',');
|
||||
int per = 0;
|
||||
for (bool good = nonacc.get(per, periodo); good; good = nonacc.get(++per, periodo))
|
||||
@ -926,7 +925,6 @@ int TClifo_application::read(TMask& m)
|
||||
if (_gesven)
|
||||
{
|
||||
TToken_string riga(240);
|
||||
|
||||
indsp_sheet().reset();
|
||||
for (i = 0; i < _rel->indirizzi(); i++)
|
||||
{
|
||||
@ -973,8 +971,7 @@ int TClifo_application::read(TMask& m)
|
||||
}
|
||||
|
||||
TSheet_field& s = m.sfield(F_SHEET_CONT);
|
||||
|
||||
s.reset_sheet();
|
||||
s.destroy();
|
||||
for (int c = 0; c < _rel->contatti(); c++)
|
||||
{
|
||||
const TRectype& contact = _rel->contatto(c);
|
||||
@ -994,7 +991,7 @@ int TClifo_application::read(TMask& m)
|
||||
const TRectype& clifo = get_relation()->curr(LF_CLIFO);
|
||||
TSheet_field & ns_sh = m.sfield(F_BANA);
|
||||
|
||||
ns_sh.reset_sheet();
|
||||
ns_sh.destroy(-1, false);
|
||||
for (i = 1; i <= ns_ban.rows(); i++)
|
||||
add_bank(ns_sh, ns_ban.row(i));
|
||||
if (ns_ban.rows() == 0 && clifo.get_int(CLI_CODABI) != 0)
|
||||
@ -1008,7 +1005,7 @@ int TClifo_application::read(TMask& m)
|
||||
TRecord_array vs_ban(key, LF_CFBAN);
|
||||
TSheet_field & vs_sh = m.sfield(F_BANP);
|
||||
|
||||
vs_sh.reset_sheet();
|
||||
vs_sh.destroy(-1, false);
|
||||
for (i = 1; i <= vs_ban.rows(); i++)
|
||||
add_bank(vs_sh, vs_ban.row(i));
|
||||
if (vs_ban.rows() == 0 && cfven.get_int(CFV_CODABIPR) != 0)
|
||||
@ -1043,7 +1040,7 @@ void TClifo_application::ini2mask(TConfig& ini, TMask& m, bool query)
|
||||
if (!ini.set_paragraph(para))
|
||||
break;
|
||||
if (i == 0)
|
||||
indsp_sheet().reset_sheet();
|
||||
indsp_sheet().reset();
|
||||
|
||||
riga.cut(0);
|
||||
riga.add(ini.get(IND_RAGSOC));
|
||||
@ -1284,6 +1281,7 @@ void TClifo_application::reset_sheet()
|
||||
TToken_string nulla = "|**";
|
||||
nulla << TR("Nessuno") << "**";
|
||||
|
||||
|
||||
TClifo_application& a = app();
|
||||
a.field_sheet(F_CODINDDOC).destroy();
|
||||
a.field_sheet(F_CODINDDOC).add(nulla);
|
||||
|
@ -708,7 +708,7 @@ void TCaus_app::load_rcaus(TMask& m)
|
||||
const TString4 cod(_rel->curr().get(RCA_CODCAUS));
|
||||
TString d, da(50);
|
||||
|
||||
ss().reset_sheet();
|
||||
ss().destroy();
|
||||
|
||||
const int last = _rcaus_rec->last_row();
|
||||
for (int i = 1; i <= last; i++)
|
||||
|
@ -25,6 +25,8 @@
|
||||
#define AGR_PCON1 201
|
||||
#define AGR_PCON2 202
|
||||
|
||||
enum tiporeg { vendita = 1, acquisto = 2 };
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// TCheck_ivadiff_mask
|
||||
///////////////////////////////////////////////////////////
|
||||
@ -189,11 +191,12 @@ void TCheck_ivadiff::check_year(long firm)
|
||||
const TString4 freqviva = lia.get("S7");
|
||||
const TString4 codreg = mov.get("REG");
|
||||
TString16 s; s << year; s << format("%-3s", (const char *) codreg);
|
||||
const TRegistro & reg = cached_registro(codreg, year);
|
||||
const int liqmonth = mov.get_int(MOV_MESELIQ);
|
||||
const TRectype & reg = cache().get("REG", s);
|
||||
|
||||
const int liqmonth = mov.get_int(MOV_MESELIQ);
|
||||
const TString4 tipodoc = mov.get(MOV_TIPODOC);
|
||||
const bool corrisp = reg.corrispettivi();
|
||||
const tiporeg tipomov = reg.tipo_registro(); // 1=Vendite; 2=Acquisti
|
||||
const bool corrisp = reg.get_bool("B0");
|
||||
const tiporeg tipomov = (tiporeg) reg.get_int("I0"); // 1=Vendite; 2=Acquisti
|
||||
TPartite_array arrpart; // Partite interessate
|
||||
TPointer_array pagscatt; // Righe di pagsca interessate
|
||||
const bool iva_diff = is_IVA_diff(mov.curr());
|
||||
|
@ -707,7 +707,7 @@ bool TStampa_bilanci::bil_sez_contr()
|
||||
if (_tipo_stampa == 1) //bil. a sez. contrapposte per data limite
|
||||
{
|
||||
#ifdef CONT_SEP
|
||||
movimentato = sld.saldo_cont_sep(_tipo_data,g, c, s, _annoes, _al, indbil_conto, _cont_sep, _stampa_mov_prov) ;
|
||||
movimentato = sld.saldo_cont_sep(_tipo_data,g, c, s, _annoes, _datalim, indbil_conto, _cont_sep, _stampa_mov_prov) ;
|
||||
#else
|
||||
movimentato = sld.data_limite_bilancio(_tipo_data, g, c, s, _dataini, _al, indbil_conto, _stampa_mov_prov);
|
||||
#endif
|
||||
@ -881,7 +881,7 @@ bool TStampa_bilanci::ricerca_sottoc_clifo(int g,int c, bool compensa, int indbi
|
||||
if (_tipo_stampa == 1) //bil. a sez. contrapposte per data limite
|
||||
{
|
||||
#ifdef CONT_SEP
|
||||
movimentato = sld.saldo_cont_sep(_tipo_data, g, c, s, _annoes, _al, indbil_conto, _cont_sep, _stampa_mov_prov);
|
||||
movimentato = sld.saldo_cont_sep(_tipo_data, g, c, s, _annoes, _datalim, indbil_conto, _cont_sep, _stampa_mov_prov);
|
||||
#else
|
||||
movimentato = sld.data_limite_bilancio(_tipo_data ,g,c,s,_dataini,_al,indbil_conto,_stampa_mov_prov);
|
||||
#endif
|
||||
|
@ -59,7 +59,7 @@ public:
|
||||
TPrimanota_application::TPrimanota_application()
|
||||
: _rel(nullptr), _mode(0), _iva(nessuna_iva), _causale(nullptr), _giornale(nullptr),
|
||||
_lastreg(0), _last_dreg(TODAY), _last_dcom(TODAY), _automatico(nullptr), _swap_mask(false), _is_set_fpcheck(false), _f1_ini(false), _f1_liq(false),
|
||||
_skip_giornale_check(false), _skip_bollato_check(false), _pro_mask(nullptr)
|
||||
_skip_giornale_check(false), _skip_bollato_check(false)
|
||||
{
|
||||
memset(_msk, 0, sizeof(_msk));
|
||||
}
|
||||
@ -697,7 +697,7 @@ void TPrimanota_application::init_mask(TMask& m)
|
||||
_sal_dirty = false; // Azzero il flag di modifica del saldaconto
|
||||
fill_sheet(m); // Riempe righe contabili coi conti della causale
|
||||
m.hide(F_LINKDOC);
|
||||
has_f1_db(m);
|
||||
set_has_f1_db(&m);
|
||||
}
|
||||
|
||||
void TPrimanota_application::init_query_mode(TMask& m)
|
||||
@ -736,7 +736,7 @@ void TPrimanota_application::init_query_mode(TMask& m)
|
||||
m.set(F_CODCAUS, ini.get(MOV_CODCAUS));
|
||||
m.send_key(K_SPACE, DLG_NEWREC);
|
||||
}
|
||||
has_f1_db(m);
|
||||
set_has_f1_db(&m);
|
||||
}
|
||||
|
||||
|
||||
@ -999,7 +999,7 @@ 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 = mov.get_date(MOV_DATADOC) >= get_data_start_fatt();
|
||||
const bool after_data_inizio_fe = mov.get_date(MOV_DATADOC) >= fp_settings().get_data_start_fatt();
|
||||
|
||||
if (m.find_by_id(F_COLFPPRO) != nullptr && after_data_inizio_fe)
|
||||
m.set(F_COLFPPRO, mov.get(MOV_KEYFPPRO).empty() ? " " : "X");
|
||||
@ -1491,14 +1491,18 @@ void TPrimanota_application::check_saldi()
|
||||
|
||||
void TPrimanota_application::write_fppro()
|
||||
{
|
||||
if (main_app().has_module(FPAUT) && !ini_get_bool(CONFIG_INSTALL, "Main", "SkipFPPRO"))
|
||||
#ifdef DBG
|
||||
if (!ini_get_bool(CONFIG_INSTALL, "Main", "SkipFPPRO"))
|
||||
{
|
||||
#endif
|
||||
// Controllo se la registrazione ha avuto effetto anche su FPPRO allora salvo riferimento sul mov
|
||||
if (save_fppro() > 0 && !save_dbmov())
|
||||
message_box(
|
||||
"ATTENZIONE: non e' stato possibile salvare i riferimenti del documento in ingresso per questo movimento.\n"
|
||||
"Movimento registrato senza collegamento ai documenti in ingresso.");
|
||||
#ifdef DBG
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
bool TPrimanota_application::has_tot_doc(TToken_string& fppro_keys)
|
||||
@ -1555,7 +1559,7 @@ void TPrimanota_application::set_movcoll(const long movcoll, const long numreg)
|
||||
}
|
||||
int TPrimanota_application::controlli_f1(const TMask& m)
|
||||
{
|
||||
if (iva_mask(m) && m.get(F_PROKEY).full() && has_f1_db(m) && fp_db().sq_is_connect() && check_causale(m.get(F_CODCAUS)))
|
||||
if (m.find_by_id(F_PROKEY) != nullptr && m.get(F_PROKEY).full() && has_f1_db((TMask*)&m) && fp_db().sq_is_connect() && check_causale(m.get(F_CODCAUS)))
|
||||
{
|
||||
TToken_string keys(m.get(F_PROKEY), ';');
|
||||
const TDate dataoraric = fppro_db().set_keys(keys).get_dataorarioric();
|
||||
@ -1783,7 +1787,7 @@ void TPrimanota_application::clean_fppro()
|
||||
|
||||
// Controlli: solo in mod modifica; che abbia fp-f1 (no F8); che non sono in salvataggio
|
||||
if (_mode != MODE_MOD
|
||||
|| !has_f1_db(msk)
|
||||
|| !has_f1_db(&msk)
|
||||
|| last_key != K_DEL && last_key != K_SAVE && last_key != K_ELIMMAS && last_key != K_QUIT && !scollega())
|
||||
return;
|
||||
|
||||
@ -1798,17 +1802,27 @@ void TPrimanota_application::clean_fppro()
|
||||
fp_db().sq_commit();
|
||||
}
|
||||
|
||||
bool TPrimanota_application::has_f1() const
|
||||
void TPrimanota_application::set_has_f1_db(TMask* m)
|
||||
{
|
||||
return has_module(F1AUT) && get_db_indirizzo().full();
|
||||
if (m->find_by_id(F_DATAREG) != nullptr && !m->get(F_DATAREG).empty())
|
||||
{
|
||||
if (TDate(m->get(F_DATAREG)) >= TDate(fp_settings().get_data_start_fatt()))
|
||||
_isf1 = has_module(F1AUT) && !fp_settings().get_db_indirizzo().empty();
|
||||
else
|
||||
_isf1 = false;
|
||||
_is_set_fpcheck = true;
|
||||
}
|
||||
else if (!_is_set_fpcheck)
|
||||
{
|
||||
_isf1 = false;
|
||||
_is_set_fpcheck = true;
|
||||
}
|
||||
}
|
||||
|
||||
bool TPrimanota_application::has_f1_db(const TMask & m)
|
||||
bool TPrimanota_application::has_f1_db(TMask* m)
|
||||
{
|
||||
const TDate datareg = m.get_date(F_DATAREG);
|
||||
|
||||
_is_set_fpcheck = true;
|
||||
return datareg.ok() && (datareg >= get_data_start_fatt()) && has_f1();
|
||||
set_has_f1_db(m);
|
||||
return _isf1;
|
||||
}
|
||||
|
||||
bool TPrimanota_application::remove()
|
||||
@ -2657,7 +2671,7 @@ int TPrimanota_application::save_fppro()
|
||||
TMask& msk = curr_mask();
|
||||
|
||||
// Provo a vedere se hanno l'FP: se c'è l'indirizzo controllo che non sia F8 se non c'è non hanno l'FP
|
||||
if (!has_f1_db(msk))
|
||||
if (!has_f1_db(&msk))
|
||||
return pro_nofp;
|
||||
|
||||
// Anzitutto guardo la modalita' in cui sono
|
||||
@ -2722,7 +2736,7 @@ int TPrimanota_application::save_fppro()
|
||||
items = fp_db().sq_items();
|
||||
}
|
||||
|
||||
if(has_f1_db(msk) && items != 1)
|
||||
if(has_f1_db(&msk) && items != 1)
|
||||
{
|
||||
const bool forza = noyes_box("Attenzione, al movimento non e' stato abbinato nessun documento elettronico.\n"
|
||||
"Per consentire una corretta archiviazione sostitutiva si consiglia di provvedere al controllo della registrazione e di procedere\n"
|
||||
|
@ -13,14 +13,12 @@ BEGIN
|
||||
PROMPT 2 1 "Contabilizzaz."
|
||||
PICTURE TOOL_EXPORT
|
||||
MODULE F1
|
||||
MESSAGE EXIT,K_ENTER
|
||||
END
|
||||
|
||||
BUTTON DLG_LINK 2 2
|
||||
BEGIN
|
||||
PROMPT 3 1 "Collega in Prima nota"
|
||||
PICTURE TOOL_LINK
|
||||
MESSAGE EXIT,K_ENTER
|
||||
END
|
||||
|
||||
BUTTON DLG_QUIT 2 2
|
||||
|
@ -2226,7 +2226,7 @@ bool TPrimanota_application::caus_query_handler(TMask_field& f, KEY key)
|
||||
|
||||
void TPrimanota_application::check_fppro_fields(TMask& m)
|
||||
{
|
||||
const bool after_data = m.get_date(F_DATAREG) >= get_data_start_fatt();
|
||||
const bool after_data = m.get_date(F_DATAREG) >= fp_settings().get_data_start_fatt();
|
||||
|
||||
if (!check_causale(m.get(F_CODCAUS)) || !app().has_module(FPAUT) || !after_data)
|
||||
{
|
||||
@ -3865,10 +3865,10 @@ bool TPrimanota_application::quadratura_handler(TMask_field& f, KEY key)
|
||||
return true;
|
||||
}
|
||||
|
||||
void TPrimanota_application::write_righe_iva_f1(TMask& cg_msk, const TPro_msk & msk)
|
||||
void TPrimanota_application::write_righe_iva_f1(TMask& cg_msk, const shared_ptr<TPro_msk>& msk)
|
||||
{
|
||||
TSheet_field& sf = cg_msk.sfield(F_SHEETIVA);
|
||||
const vector<TPro_msk::riga_iva_s>& righe = msk.get_righeiva();
|
||||
const vector<TPro_msk::riga_iva_s>& righe = msk->get_righeiva();
|
||||
int i = 0;
|
||||
|
||||
for (auto it = righe.begin(); it != righe.end(); ++it)
|
||||
@ -3887,11 +3887,11 @@ void TPrimanota_application::write_righe_iva_f1(TMask& cg_msk, const TPro_msk &
|
||||
}
|
||||
}
|
||||
}
|
||||
bool TPrimanota_application::write_scad_f1(const TMask& cg_msk, const TPro_msk & msk)
|
||||
bool TPrimanota_application::write_scad_f1(const TMask& cg_msk, const shared_ptr<TPro_msk>& msk)
|
||||
{
|
||||
TSheet_field& sf = cg_msk.sfield(FS_RATESHEET);
|
||||
const int items = sf.items();
|
||||
const vector<TPro_msk::scadenza_s>& righe = msk.get_scadenze();
|
||||
const vector<TPro_msk::scadenza_s>& righe = msk->get_scadenze();
|
||||
int i = 0;
|
||||
|
||||
for (auto it = righe.begin(); it != righe.end(); ++it, ++i)
|
||||
@ -3908,28 +3908,28 @@ bool TPrimanota_application::write_scad_f1(const TMask& cg_msk, const TPro_msk &
|
||||
return !righe.empty();
|
||||
}
|
||||
|
||||
void TPrimanota_application::write_clifo(TMask& cg_msk, const TPro_msk & msk)
|
||||
void TPrimanota_application::write_clifo(TMask& cg_msk, const shared_ptr<TPro_msk>& msk)
|
||||
{
|
||||
bool ok = false;
|
||||
TLocalisamfile clifo(LF_CLIFO);
|
||||
TToken_string keys(msk.get_fpprokeys(), ';');
|
||||
TToken_string keys(msk->get_fpprokeys(), ';');
|
||||
TString codforn = TFppro(keys).get_codforn();
|
||||
|
||||
if (codforn.empty())
|
||||
codforn = msk.get_codforn();
|
||||
codforn = msk->get_codforn();
|
||||
if (codforn.empty())
|
||||
{
|
||||
clifo.setkey(5);
|
||||
clifo.put(CLI_TIPOCF, "F");
|
||||
clifo.put(CLI_PAIV, msk.get_piva());
|
||||
clifo.put(CLI_PAIV, msk->get_piva());
|
||||
clifo.read();
|
||||
ok = clifo.get(CLI_PAIV) == msk.get_piva();
|
||||
ok = clifo.get(CLI_PAIV) == msk->get_piva();
|
||||
if(!ok)
|
||||
{
|
||||
clifo.zero();
|
||||
clifo.setkey(5);
|
||||
clifo.put(CLI_TIPOCF, "F");
|
||||
clifo.put(CLI_PAIV, msk.get_piva());
|
||||
clifo.put(CLI_PAIV, msk->get_piva());
|
||||
clifo.put(CLI_STATOPAIV, "IT");
|
||||
clifo.read();
|
||||
}
|
||||
@ -3941,7 +3941,7 @@ void TPrimanota_application::write_clifo(TMask& cg_msk, const TPro_msk & msk)
|
||||
clifo.put(CLI_CODCF, codforn);
|
||||
clifo.read();
|
||||
}
|
||||
ok = clifo.get(CLI_PAIV) == msk.get_piva();
|
||||
ok = clifo.get(CLI_PAIV) == msk->get_piva();
|
||||
if (ok && (cg_msk.get(F_CODCLIFOR).empty() || cg_msk.get(F_CODCLIFOR) != codforn))
|
||||
{
|
||||
cg_msk.set(F_CODCLIFOR, clifo.get(CLI_CODCF));
|
||||
@ -3956,14 +3956,14 @@ void TPrimanota_application::write_clifo(TMask& cg_msk, const TPro_msk & msk)
|
||||
}
|
||||
}
|
||||
|
||||
void TPrimanota_application::set_totale(TMask& cg_msk, TPro_msk & msk)
|
||||
void TPrimanota_application::set_totale(TMask& cg_msk, const shared_ptr<TPro_msk>& msk)
|
||||
{
|
||||
real totale = msk.get_totdoc();
|
||||
real totale = msk->get_totdoc();
|
||||
|
||||
if(totale == ZERO)
|
||||
totale = app().calcola_imp();
|
||||
|
||||
const real rit = msk.get_ritenute();
|
||||
const real rit = msk->get_ritenute();
|
||||
|
||||
if (rit != ZERO)
|
||||
{
|
||||
@ -3971,18 +3971,18 @@ void TPrimanota_application::set_totale(TMask& cg_msk, TPro_msk & msk)
|
||||
cg_msk.set(F_RITFIS, rit);
|
||||
app().add_cgs_ritenute(cgrowtype_ritfis);
|
||||
}
|
||||
else if (msk.is_doc_split())
|
||||
totale = msk.get_tot_imp_riva();
|
||||
else if (msk->is_doc_split())
|
||||
totale = msk->get_tot_imp_riva();
|
||||
cg_msk.set(F_TOTALE, totale);
|
||||
}
|
||||
|
||||
void TPrimanota_application::riporta_dati_f1(TMask& cg_msk, TPro_msk & msk)
|
||||
void TPrimanota_application::riporta_dati_f1(TMask& cg_msk, const shared_ptr<TPro_msk>& msk)
|
||||
{
|
||||
const bool bring = msk.should_bring_back();
|
||||
const bool bring = msk->should_bring_back();
|
||||
|
||||
if (bring)
|
||||
{
|
||||
if (msk.get_numdoc().full() && cg_msk.get(F_CODCLIFOR).empty())
|
||||
if (msk->get_numdoc().full() && cg_msk.get(F_CODCLIFOR).empty())
|
||||
write_clifo(cg_msk, msk);
|
||||
write_righe_iva_f1(cg_msk, msk);
|
||||
set_totale(cg_msk, msk);
|
||||
@ -3993,12 +3993,12 @@ void TPrimanota_application::riporta_dati_f1(TMask& cg_msk, TPro_msk & msk)
|
||||
// Li riporto anche con il collega in prima nota, e in quel caso solo se i campi non sono gia valorizzati
|
||||
if (bring || cg_msk.get(F_NUMDOC).empty())
|
||||
{
|
||||
cg_msk.set(F_NUMDOCEXT, msk.get_numdoc());
|
||||
cg_msk.set(F_NUMDOC, msk.get_numdoc().right(7));
|
||||
cg_msk.set(F_NUMDOCEXT, msk->get_numdoc());
|
||||
cg_msk.set(F_NUMDOC, msk->get_numdoc().right(7));
|
||||
}
|
||||
|
||||
if (bring || cg_msk.get(F_DATADOC).empty())
|
||||
cg_msk.set(F_DATADOC, msk.get_datadoc());
|
||||
cg_msk.set(F_DATADOC, msk->get_datadoc());
|
||||
}
|
||||
|
||||
void TPrimanota_application::insert_part_scad(TConfig& ini)
|
||||
@ -4054,10 +4054,9 @@ bool TPrimanota_application::fppro_mask(TMask_field& f, KEY key)
|
||||
if (!app().has_module(FPAUT) || key != K_SPACE && key != K_TAB || !check_causale(cg_msk.get(F_CODCAUS)))
|
||||
return true;
|
||||
|
||||
TPro_msk * msk = app()._pro_mask;
|
||||
auto msk = std::make_shared<TPro_msk>(cg_msk);
|
||||
|
||||
if (msk == nullptr)
|
||||
app()._pro_mask = msk = new TPro_msk(cg_msk);
|
||||
app()._pro_mask = msk;
|
||||
|
||||
const TString datadoc = cg_msk.get(F_DATADOC);
|
||||
|
||||
@ -4067,13 +4066,16 @@ bool TPrimanota_application::fppro_mask(TMask_field& f, KEY key)
|
||||
msk->field(F_DATESEARCH).show();
|
||||
msk->set(F_DATESEARCH, datadoc);
|
||||
}
|
||||
if (msk->load_fppro_mask(msk.get()))
|
||||
{
|
||||
msk->run();
|
||||
// Riporto dati FPPRO su maschera Prima Nota (solo se hai F1)
|
||||
// Se non hai F1 collego senza riportarti i dati (solo le chiavi db)
|
||||
riporta_dati_f1(cg_msk, *msk);
|
||||
riporta_dati_f1(cg_msk, msk);
|
||||
cg_msk.set(F_PROKEY, msk->get_fpprokeys());
|
||||
is_collegato(cg_msk.field(F_COLFPPRO));
|
||||
cg_msk.set(F_ANNORIF, cg_msk.get(F_ANNOIVA));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -4122,40 +4124,42 @@ bool TPrimanota_application::is_collegato(TMask_field& f)
|
||||
return has_prokey;
|
||||
}
|
||||
|
||||
bool TPro_msk::load_fppro_mask(TMask & msk)
|
||||
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
|
||||
if (k != 32)
|
||||
return false;
|
||||
if (!fp_db().sq_is_connect())
|
||||
{
|
||||
message_box("Attenzione connessione al database non riuscita.\nImpossibile collegarsi ai documenti in entrata.");
|
||||
return false;
|
||||
}
|
||||
|
||||
const int forn = msk.get_int(F_CODCLIFORS);
|
||||
const int forn = msk->get_int(F_CODCLIFORS);
|
||||
|
||||
if (forn == 0)
|
||||
{
|
||||
msk.set(F_ENABSEARCH, "X");
|
||||
abilita_piva();
|
||||
msk->set(F_ENABSEARCH, "X");
|
||||
abilita_piva(msk);
|
||||
//message_box("Inserire prima il fornitore");
|
||||
//return false;
|
||||
}
|
||||
|
||||
const TString& codfisc = msk.get(F_COFIS);
|
||||
const TString& stato_piva = msk.get(F_STATOPAIVS);
|
||||
const TString& piva = msk.get(F_PIVAS);
|
||||
const TString& codfisc = msk->get(F_COFIS);
|
||||
const TString& stato_piva = msk->get(F_STATOPAIVS);
|
||||
const TString& piva = msk->get(F_PIVAS);
|
||||
TString query;
|
||||
TString date = "";
|
||||
|
||||
if (msk.get_bool(F_ENABDATE))
|
||||
date = msk.get_date(F_DATESEARCH);
|
||||
if(!msk.get_bool(F_ENABSEARCH))
|
||||
query = query_fppro(msk.get(F_CODCLIFORS), date);
|
||||
if (msk->get_bool(F_ENABDATE))
|
||||
date = msk->get_date(F_DATESEARCH);
|
||||
if(!msk->get_bool(F_ENABSEARCH))
|
||||
query = query_fppro(msk->get(F_CODCLIFORS), date);
|
||||
else
|
||||
query = query_fppro(stato_piva, piva, date);
|
||||
fp_db().sq_set_exec(query, false);
|
||||
|
||||
TSheet_field& sf = msk.sfield(F_SHEETFPPROS);
|
||||
TSheet_field& sf = msk->sfield(F_SHEETFPPROS);
|
||||
|
||||
sf.hide();
|
||||
if (sf.items() > 0)
|
||||
@ -4163,7 +4167,7 @@ bool TPro_msk::load_fppro_mask(TMask & msk)
|
||||
while (fp_db().sq_next())
|
||||
{
|
||||
TString numreg = fp_db().sq_get("PZ_NUMREGCONT");
|
||||
const bool show_all = msk.get_bool(F_SHOWALL);
|
||||
const bool show_all = msk->get_bool(F_SHOWALL);
|
||||
|
||||
if (numreg != "0" && !show_all)
|
||||
continue;
|
||||
@ -4174,8 +4178,8 @@ bool TPro_msk::load_fppro_mask(TMask & msk)
|
||||
keys.add(fp_db().sq_get("PZ_KEYHEADERFATT")); keys.add(fp_db().sq_get("PZ_KEYBODYFATT"));
|
||||
row.add("", 0);
|
||||
row.add(fp_db().sq_get("P7_TIPODOC"));
|
||||
row.add(fp_db().sq_get_date("P1_DATAORARIC"));
|
||||
row.add(fp_db().sq_get_date("PZ_DATA"));
|
||||
row.add(TDate(fp_db().sq_get_date("P1_DATAORARIC")));
|
||||
row.add(TDate(fp_db().sq_get_date("PZ_DATA")));
|
||||
row.add(fp_db().sq_get("PQ_IMPTOTDOC"));
|
||||
row.add(fppro_db().set_keys(keys).get_ritenute());
|
||||
row.add(fp_db().sq_get("PZ_NUMERO"));
|
||||
@ -4192,9 +4196,19 @@ bool TPro_msk::load_fppro_mask(TMask & msk)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TPro_msk::riporta(TMask_field& f)
|
||||
bool TPro_msk::fppro_handler(TMask_field& f, KEY k)
|
||||
{
|
||||
TMask& msk = f.mask();
|
||||
|
||||
const bool load = load_fppro_mask(&msk, k);
|
||||
return load;
|
||||
}
|
||||
|
||||
bool TPro_msk::riporta_handler(TMask_field& f, KEY k)
|
||||
{
|
||||
if (k != 32)
|
||||
return true;
|
||||
TMask& msk = f.mask();
|
||||
//if (msk.curr_page() != 3)
|
||||
//return true;
|
||||
bool ok = false;
|
||||
@ -4205,10 +4219,13 @@ bool TPro_msk::riporta(TMask_field& f)
|
||||
if(*row->get(0) == 'X')
|
||||
{
|
||||
//TProtocollo protocollo(TDate(row->get(2)).year(), row->get(9), row->get(10));
|
||||
app().pro_mask()->set_doc(row->get(cid2index(F_NUMEROS)), row->get(cid2index(F_DATAS)),
|
||||
app()._pro_mask->set_doc(row->get(cid2index(F_NUMEROS)), row->get(cid2index(F_DATAS)),
|
||||
row->get(cid2index(F_IMPTOTDOCS)), row->get(cid2index(F_RITENUTE)), "", row->get(cid2index(F_KEYFPPROS)),
|
||||
msk.get(F_CODCLIFORS), row->get(cid2index(F_FISCIVACODS)));
|
||||
_riporta = f.dlg() == DLG_OK;
|
||||
if (f.dlg() == DLG_OK)
|
||||
app()._pro_mask->_riporta = true;
|
||||
else
|
||||
app()._pro_mask->_riporta = false;
|
||||
ok = true;
|
||||
break;
|
||||
}
|
||||
@ -4222,6 +4239,35 @@ bool TPro_msk::riporta(TMask_field& f)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TPro_msk::collega_handler(TMask_field& f, KEY k)
|
||||
{
|
||||
return riporta_handler(f, k);
|
||||
}
|
||||
|
||||
bool TPro_msk::piva_handler(TMask_field& f, KEY k)
|
||||
{
|
||||
TMask& msk = f.mask();
|
||||
bool ok = true;
|
||||
|
||||
if(k == K_TAB && f.active() && f.focusdirty())
|
||||
{
|
||||
ok = load_fppro_mask(&msk, K_SPACE);
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool TPro_msk::date_handler(TMask_field& f, KEY k)
|
||||
{
|
||||
TMask& msk = f.mask();
|
||||
bool ok = true;
|
||||
|
||||
if (k == K_TAB && f.active() && f.focusdirty())
|
||||
{
|
||||
ok = load_fppro_mask(&msk, K_SPACE);
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
void TPro_msk::fppro_selfatt() const
|
||||
{
|
||||
const TMask& mask = *this;
|
||||
@ -4239,43 +4285,21 @@ void TPro_msk::fppro_selfatt() const
|
||||
|
||||
bool TPro_msk::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
||||
{
|
||||
TMask & m = o.mask();
|
||||
|
||||
switch (o.dlg())
|
||||
{
|
||||
case DLG_CONFIG:
|
||||
if (e == fe_button)
|
||||
load_fppro_mask(m);
|
||||
break;
|
||||
case DLG_OK:
|
||||
if (e == fe_button)
|
||||
riporta(o);
|
||||
break;
|
||||
case DLG_LINK:
|
||||
if (e == fe_button)
|
||||
riporta(o);
|
||||
break;
|
||||
case F_PIVAS:
|
||||
if (e == fe_modify)
|
||||
load_fppro_mask(m);
|
||||
break;
|
||||
case F_DATESEARCH:
|
||||
if (e == fe_modify)
|
||||
load_fppro_mask(m);
|
||||
break;
|
||||
case F_SELFPPROS:
|
||||
case F_SELFPPROS:
|
||||
if (e == fe_modify)
|
||||
fppro_selfatt();
|
||||
break;
|
||||
case F_SHOWALL:
|
||||
if (e == fe_modify)
|
||||
load_fppro_mask(m);
|
||||
load_fppro_mask(this, K_SPACE);
|
||||
break;
|
||||
case F_ENABSEARCH:
|
||||
if (e == fe_modify)
|
||||
{
|
||||
abilita_piva();
|
||||
load_fppro_mask(m);
|
||||
abilita_piva(this);
|
||||
load_fppro_mask(this);
|
||||
}
|
||||
break;
|
||||
case F_ENABDATE:
|
||||
@ -4283,7 +4307,7 @@ bool TPro_msk::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
||||
{
|
||||
field(F_DATESEARCH).show(o.mask().get_bool(F_ENABDATE));
|
||||
if (!o.mask().get_bool(F_ENABDATE))
|
||||
load_fppro_mask(m);
|
||||
load_fppro_mask(this);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@ -4450,25 +4474,29 @@ TString& TPro_msk::query_string()
|
||||
return query;
|
||||
}
|
||||
|
||||
void TPro_msk::abilita_piva()
|
||||
void TPro_msk::abilita_piva(TMask* msk)
|
||||
{
|
||||
if (get_bool(F_ENABSEARCH))
|
||||
if (msk->get_bool(F_ENABSEARCH))
|
||||
{
|
||||
enable(F_PIVAS);
|
||||
enable(F_STATOPAIVS);
|
||||
msk->enable(F_PIVAS);
|
||||
msk->enable(F_STATOPAIVS);
|
||||
}
|
||||
else
|
||||
{
|
||||
enable(F_PIVAS, false);
|
||||
enable(F_STATOPAIVS, false);
|
||||
msk->enable(F_PIVAS, false);
|
||||
msk->enable(F_STATOPAIVS, false);
|
||||
}
|
||||
}
|
||||
|
||||
TPro_msk::TPro_msk(TMask& cg_msk) : TAutomask("cg2100t"), _riporta(false), _codforn("")
|
||||
{
|
||||
TMask::set_handler(DLG_CONFIG, fppro_handler);
|
||||
TMask::set_handler(DLG_OK, riporta_handler);
|
||||
if (!app().has_module(F1AUT))
|
||||
field(DLG_OK).disable();
|
||||
|
||||
TMask::set_handler(DLG_LINK, collega_handler);
|
||||
TMask::set_handler(F_PIVAS, piva_handler);
|
||||
TMask::set_handler(F_DATESEARCH, date_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));
|
||||
|
184
src/cg/cg2102.h
184
src/cg/cg2102.h
@ -31,88 +31,11 @@
|
||||
|
||||
#define K_ELIMMAS 0 // Key per eliminazione massima
|
||||
|
||||
class TPro_msk;
|
||||
class TDati_mov_auto;
|
||||
|
||||
enum CGMaskType { _query = 0, _no_iva = 1, _iva = 2, _occas = 3};
|
||||
|
||||
class TPro_msk : public TAutomask
|
||||
{
|
||||
public:
|
||||
struct riga_iva_s;
|
||||
struct scadenza_s;
|
||||
private:
|
||||
TString _numero;
|
||||
TDate _datadoc;
|
||||
real _totdoc;
|
||||
real _ritenute;
|
||||
TProtocollo _protfppro;
|
||||
TString _fpprokeys;
|
||||
TString _piva;
|
||||
TString _codforn;
|
||||
vector<riga_iva_s> _righe_iva;
|
||||
vector<scadenza_s> _scadenze;
|
||||
bool _riporta;
|
||||
|
||||
// Handlers per aggancio FPPRO
|
||||
// Bottone riporta doc FPPRO in testata Prima Nota
|
||||
// static bool riporta_handler(TMask_field& f, KEY k);
|
||||
// static bool collega_handler(TMask_field& f, KEY k);
|
||||
// static bool piva_handler(TMask_field& f, KEY k);
|
||||
// static bool date_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:
|
||||
struct riga_iva_s
|
||||
{
|
||||
real imponibile;
|
||||
real imposta;
|
||||
real aliquota;
|
||||
TString4 natura;
|
||||
char esigibilita;
|
||||
};
|
||||
struct scadenza_s
|
||||
{
|
||||
TDate data;
|
||||
real importo;
|
||||
};
|
||||
|
||||
bool should_bring_back() const { return _riporta; }
|
||||
bool is_doc_split() ;
|
||||
|
||||
void set_righeiva(const char* fpprokeys);
|
||||
void set_scadenze(const char* fpprokeys);
|
||||
void set_doc(const char* numero, const char* datadoc, const char* totdoc, const char* ritenute, const char* protfppro, const char* fpprokeys, const char* codforn, const char* piva);
|
||||
|
||||
TString get_numdoc() const { return _numero; }
|
||||
TDate get_datadoc() const { return _datadoc; }
|
||||
real get_totdoc() const { return _totdoc; }
|
||||
real get_ritenute() const { return _ritenute; }
|
||||
TString get_fpprokeys() const { return _fpprokeys; }
|
||||
TString get_codforn() const { return _codforn; }
|
||||
TString get_piva() const { return _piva; }
|
||||
const vector<riga_iva_s>& get_righeiva() const { return _righe_iva; }
|
||||
const TProtocollo& get_protocollo() const { return _protfppro; }
|
||||
const vector<scadenza_s>& get_scadenze() const { return _scadenze; }
|
||||
real get_tot_imp_riva() ;
|
||||
|
||||
void add_rigaiva(const real& imponibile, const real& imposta, const real& aliquota, const TString4& natura, char esigib);
|
||||
void add_scad(const TDate& date, const real& importo);
|
||||
|
||||
static TString& query_fppro(const TString& codforn, const TString& date);
|
||||
static TString& query_fppro(const TString& stato_piva, const TString& piva, const TString& date);
|
||||
static TString& query_fppro(const TString& codforn, const TString& stato_piva, const TString& piva, const TString& where_str, const TString& date, const TString& keyprginvio, const TString& keyheaderfatt, const TString& keybodyfatt, bool order = true, bool piva_research = false);
|
||||
static TString& query_string();
|
||||
|
||||
void abilita_piva();
|
||||
|
||||
// Carica documenti FPPRO sulla maschera
|
||||
bool riporta(TMask_field& f);
|
||||
bool load_fppro_mask(TMask & msk);
|
||||
|
||||
TPro_msk(TMask& cg_msk);
|
||||
};
|
||||
|
||||
class TPrimanota_application : public TRelation_application
|
||||
{
|
||||
TMovimentoPN* _rel; // Relazione principale
|
||||
@ -167,7 +90,7 @@ class TPrimanota_application : public TRelation_application
|
||||
|
||||
TAssoc_array _colori; // Colori delle righe
|
||||
bool _isf1;
|
||||
TPro_msk * _pro_mask;
|
||||
shared_ptr<TPro_msk> _pro_mask;
|
||||
bool _is_set_fpcheck;
|
||||
int _last_date;
|
||||
bool _f1_ini;
|
||||
@ -257,11 +180,11 @@ class TPrimanota_application : public TRelation_application
|
||||
|
||||
// Gestione F1
|
||||
|
||||
static void write_righe_iva_f1(TMask& cg_msk, const TPro_msk & msk);
|
||||
static bool write_scad_f1(const TMask& cg_msk, const TPro_msk & msk);
|
||||
static void write_clifo(TMask& cg_msk, const TPro_msk & msk);
|
||||
static void set_totale(TMask& cg_msk, TPro_msk & msk);
|
||||
static void riporta_dati_f1(TMask& cg_msk, TPro_msk & msk);
|
||||
static void write_righe_iva_f1(TMask& cg_msk, const shared_ptr<TPro_msk>& msk);
|
||||
static bool write_scad_f1(const TMask& cg_msk, const shared_ptr<TPro_msk>& msk);
|
||||
static void write_clifo(TMask& cg_msk, const shared_ptr<TPro_msk>& msk);
|
||||
static void set_totale(TMask& cg_msk, const shared_ptr<TPro_msk>& msk);
|
||||
static void riporta_dati_f1(TMask& cg_msk, const shared_ptr<TPro_msk>& msk);
|
||||
void insert_part_scad(TConfig& ini);
|
||||
// Handlers per aggancio FPPRO
|
||||
// Bottone per maschera FPPRO
|
||||
@ -299,10 +222,9 @@ protected: // TApplication
|
||||
static bool scollega(bool set = false);
|
||||
// Pulisce il mov e db dai firerimenti FPPRO (in MODE_MOD per edit/delete)
|
||||
void clean_fppro();
|
||||
// Ha f1 ?
|
||||
bool has_f1() const;
|
||||
// controlla il db
|
||||
bool has_f1_db(const TMask & m);
|
||||
// setta variabili prima del controllo has_f1_db
|
||||
void set_has_f1_db(TMask* m);
|
||||
bool has_f1_db(TMask* m);
|
||||
// Controlli prima di write e rewrite
|
||||
int controlli_f1(const TMask& m);
|
||||
|
||||
@ -315,7 +237,6 @@ protected: // TRelation_application
|
||||
void check_f1_ini(); // setto variabili se ho f1 o liq nei parametri (ini da fp)
|
||||
virtual bool user_create();
|
||||
virtual bool user_destroy();
|
||||
bool iva_mask(const TMask & m) const { return m.source_file() == "cg2100c"; }
|
||||
virtual bool changing_mask(int mode);
|
||||
virtual TMask* get_mask(int mode);
|
||||
virtual TRelation* get_relation() const { return _rel; }
|
||||
@ -477,10 +398,91 @@ public:
|
||||
TString_array& pag_rows() { return _pag_rows; }
|
||||
TImporto get_cgs_imp(int n) const;
|
||||
|
||||
TPro_msk * pro_mask() const { return _pro_mask; }
|
||||
|
||||
TPrimanota_application();
|
||||
virtual ~TPrimanota_application() { safe_delete(_pro_mask); }
|
||||
virtual ~TPrimanota_application() { }
|
||||
};
|
||||
|
||||
class TPro_msk : public TAutomask
|
||||
{
|
||||
public:
|
||||
struct riga_iva_s;
|
||||
struct scadenza_s;
|
||||
private:
|
||||
TString _numero;
|
||||
TDate _datadoc;
|
||||
real _totdoc;
|
||||
real _ritenute;
|
||||
TProtocollo _protfppro;
|
||||
TString _fpprokeys;
|
||||
TString _piva;
|
||||
TString _codforn;
|
||||
vector<riga_iva_s> _righe_iva;
|
||||
vector<scadenza_s> _scadenze;
|
||||
bool _riporta;
|
||||
|
||||
// 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 riporta_handler(TMask_field& f, KEY k);
|
||||
static bool collega_handler(TMask_field& f, KEY k);
|
||||
static bool piva_handler(TMask_field& f, KEY k);
|
||||
static bool date_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:
|
||||
struct riga_iva_s
|
||||
{
|
||||
real imponibile;
|
||||
real imposta;
|
||||
real aliquota;
|
||||
TString4 natura;
|
||||
char esigibilita;
|
||||
};
|
||||
struct scadenza_s
|
||||
{
|
||||
TDate data;
|
||||
real importo;
|
||||
};
|
||||
|
||||
bool should_bring_back() const { return _riporta; }
|
||||
bool is_doc_split();
|
||||
|
||||
void set_righeiva(const char* fpprokeys);
|
||||
void set_scadenze(const char* fpprokeys);
|
||||
void set_doc(const char* numero, const char* datadoc, const char* totdoc, const char* ritenute, const char* protfppro, const char* fpprokeys, const char* codforn, const char* piva);
|
||||
|
||||
TString get_numdoc() const { return _numero; }
|
||||
TDate get_datadoc() const { return _datadoc; }
|
||||
real get_totdoc() const { return _totdoc; }
|
||||
real get_ritenute() const { return _ritenute; }
|
||||
TString get_fpprokeys() const { return _fpprokeys; }
|
||||
TString get_codforn() const { return _codforn; }
|
||||
TString get_piva() const { return _piva; }
|
||||
const vector<riga_iva_s>& get_righeiva() const { return _righe_iva; }
|
||||
TProtocollo& get_protocollo() { return _protfppro; }
|
||||
vector<scadenza_s>& get_scadenze() { return _scadenze; }
|
||||
real get_tot_imp_riva();
|
||||
|
||||
|
||||
void add_rigaiva(const real& imponibile, const real& imposta, const real& aliquota, const TString4& natura, char esigib);
|
||||
void add_scad(const TDate& date, const real& importo);
|
||||
|
||||
|
||||
static TString& query_fppro(const TString& codforn, const TString& date);
|
||||
static TString& query_fppro(const TString& stato_piva, const TString& piva, const TString& date);
|
||||
static TString& query_fppro(const TString& codforn, const TString& stato_piva, const TString& piva, const TString& where_str, const TString& date, const TString& keyprginvio, const TString& keyheaderfatt, const TString& keybodyfatt, bool order = true, bool piva_research = false);
|
||||
static TString& query_string();
|
||||
|
||||
static void abilita_piva(TMask* msk);
|
||||
|
||||
// Carica documenti FPPRO sulla maschera
|
||||
static bool load_fppro_mask(TMask* msk, KEY k = 32);
|
||||
|
||||
TPro_msk() = delete;
|
||||
TPro_msk(TMask& cg_msk);
|
||||
};
|
||||
|
||||
bool& is_f1();
|
||||
|
@ -68,8 +68,7 @@ class TListaMov_application : public TPrintapp
|
||||
int _ricser;
|
||||
bool _settata_prima_riga, _causale_gia_stampata,_mov_di_sola_iva;
|
||||
int _cur1,_cur2,_cur2b,_cur3,_cur4,_decidi,/*_tipod,*/_controllo_mov_errati;
|
||||
int _numero_riga, _alleg, _scelta_stampa, _nr, _n;
|
||||
tiporeg _tiporegistro;
|
||||
int _numero_riga, _alleg, _tiporegistro, _scelta_stampa, _nr, _n;
|
||||
int _provvis;
|
||||
liste _tipo_lista;
|
||||
word _flags;
|
||||
@ -117,6 +116,7 @@ public:
|
||||
bool RicercaDoc(const char* cod) const;
|
||||
const TString& SimboloValuta (const char* cod) const;
|
||||
const TString& DescrDoc(const char* cod) const;
|
||||
const TString& AttivitaRegistro(const char * cod, int anno) const;
|
||||
|
||||
TListaMov_application(char tipost);
|
||||
virtual ~TListaMov_application() {}
|
||||
@ -427,6 +427,19 @@ const TString& TListaMov_application::SimboloValuta(const char* cod) const
|
||||
const TString& TListaMov_application::DescrDoc(const char* tipo) const
|
||||
{ return cache().get(TAB_TPD, tipo, "S0"); }
|
||||
|
||||
const TString& TListaMov_application::AttivitaRegistro(const char* cod, int anno) const
|
||||
{
|
||||
TString8 key; key.format("%04d%-3s", anno, cod);
|
||||
return cache().get("REG", key, "S8");
|
||||
}
|
||||
|
||||
HIDDEN int tipo_registro(const char* cod, int anno)
|
||||
{
|
||||
TString8 codtab; codtab.format("%4d%-3s", anno, cod);
|
||||
const TString& tipo_reg = cache().get("REG", codtab, "I0");
|
||||
return atoi(tipo_reg);
|
||||
}
|
||||
|
||||
static bool between(const TString& code, const TString& mini, const TString& maxi)
|
||||
{
|
||||
if (mini.full() && code < mini)
|
||||
@ -495,11 +508,11 @@ bool TListaMov_application::filter_func_fatture (const TRelation* rel)
|
||||
|
||||
const int ann_reg = mov.get_int(MOV_ANNOIVA);
|
||||
const TString4 cod_reg = mov.get(MOV_REG);
|
||||
const tiporeg tipo_reg = cached_registro(cod_reg, ann_reg).tipo_registro();
|
||||
const int tipo_reg = tipo_registro(cod_reg, ann_reg);
|
||||
|
||||
// Considera solo iva acquisti o vendite
|
||||
if (tipo_reg != vendita && tipo_reg != acquisto)
|
||||
return false;
|
||||
if (tipo_reg != 1 && tipo_reg != 2)
|
||||
return FALSE;
|
||||
|
||||
if (app()._annoes > 0) //anno esercizio specificato nella maschera
|
||||
{
|
||||
@ -550,10 +563,8 @@ bool TListaMov_application::filter_func (const TRelation * rel)
|
||||
{
|
||||
const TString& cod_reg = mov.get(MOV_REG);
|
||||
const int ann_reg = mov.get_int(MOV_ANNOIVA);
|
||||
const tiporeg tipo_reg = cached_registro(cod_reg, ann_reg).tipo_registro();
|
||||
|
||||
// Considera solo iva acquisti o vendite
|
||||
if (tipo_reg != vendita && tipo_reg != acquisto)
|
||||
const int tipo_reg = tipo_registro(cod_reg, ann_reg);
|
||||
if (tipo_reg == 1 || tipo_reg == 2)
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -642,10 +653,9 @@ void TListaMov_application::stampa_errori_rmov()
|
||||
else set_row(_nr++, FR("@11gCodice C/F non presente in Anagrafica"));
|
||||
if (_registro.not_empty()) //se su mov e' indicato il codice registro
|
||||
{
|
||||
const TRegistro & reg = cached_registro(_registro, _ae);
|
||||
const tiporeg tipo = reg.tipo_registro();
|
||||
|
||||
if ((tipo == vendita && t != 'C') || (tipo == acquisto && t != 'F'))
|
||||
TRegistro rg (_registro, _ae);
|
||||
const int tiporeg = rg.tipo();
|
||||
if ((tiporeg == 1 && t != 'C') || (tiporeg == 2 && t != 'F'))
|
||||
set_row(_nr++, FR("@11gTipo C/F non compatibile con tipo registro"));
|
||||
}
|
||||
}
|
||||
@ -732,14 +742,14 @@ void TListaMov_application::stampa_errori_iva(int* nr, const TRigaiva& riva)
|
||||
const int tipocr = riva._tipocr;
|
||||
|
||||
if (tipodet == 1 || tipodet == 3 || tipodet == 5 || tipodet == 9)
|
||||
if (_tiporegistro != acquisto)
|
||||
if (_tiporegistro != 2)
|
||||
set_row(++(*nr), FR("@11gCodice di indetraibilita' errato"));
|
||||
|
||||
if (_tiporegistro == vendita)
|
||||
if (_tiporegistro == 1)
|
||||
if (tipocr != 0 && tipocr != 1 && tipocr != 4 && tipocr != 9)
|
||||
set_row(++(*nr), FR("@11gTipo costo/ricavo non valido"));
|
||||
|
||||
if (_tiporegistro == acquisto)
|
||||
if (_tiporegistro == 2)
|
||||
if (tipocr != 0 && tipocr != 1 && tipocr != 2 && tipocr != 3 && tipocr != 5 && tipocr != 8 && tipocr != 9)
|
||||
set_row(++(*nr), FR("@11gTipo costo/ricavo non valido"));
|
||||
}
|
||||
@ -799,11 +809,11 @@ void TListaMov_application::set_page(int file, int count)
|
||||
TString16 reg = current_cursor()->curr(LF_MOV).get(MOV_REG);
|
||||
int anno = current_cursor()->curr(LF_MOV).get_int(MOV_ANNOIVA);
|
||||
char prov = current_cursor()->curr(LF_MOV).get_char(MOV_PROVVIS);
|
||||
const tiporeg tipo = cached_registro(reg, anno).tipo_registro();
|
||||
TEsercizi_contabili esc;
|
||||
int tipo = tipo_registro(reg, anno);
|
||||
|
||||
TEsercizi_contabili esc;
|
||||
esc.date2esc(data); // qui verificare
|
||||
if ( (tipo == vendita) || (tipo == acquisto) )
|
||||
if ( (tipo == 1) || (tipo == 2) )
|
||||
{
|
||||
set_row (_n, FR("@103greg @3s"),FLD(LF_MOV,MOV_REG));
|
||||
set_row (_n, FR("@111gpr @5n"),FLD(LF_MOV,MOV_PROTIVA));
|
||||
@ -877,8 +887,7 @@ bool TListaMov_application::preprocess_page(int file,int counter)
|
||||
_codcf = curmov.get_long(MOV_CODCF);
|
||||
_numero = curmov.get_long(MOV_NUMREG);
|
||||
_codval = curmov.get(MOV_CODVALI);
|
||||
_tiporegistro = cached_registro(_registro, _anno).tipo_registro();
|
||||
|
||||
_tiporegistro = tipo_registro(_registro, _anno);
|
||||
|
||||
_causale_gia_stampata = FALSE;
|
||||
TEsercizi_contabili esc;
|
||||
@ -1005,9 +1014,11 @@ bool TListaMov_application::preprocess_page(int file,int counter)
|
||||
_descr_causale = caus.get(CAU_DESCR);
|
||||
_alleg_causale = caus.get_bool(CAU_ALLEG);
|
||||
_tipodocumento = caus.get(CAU_TIPODOC);
|
||||
_tiporegistro = cached_registro(_registro, _anno).tipo_registro();
|
||||
if ((_tiporegistro != vendita) && (_tiporegistro != acquisto))//se si tratta di un movimento di sola prima nota
|
||||
return true;
|
||||
|
||||
_tiporegistro = tipo_registro (_registro, _anno);
|
||||
|
||||
if ((_tiporegistro != 1)&&(_tiporegistro != 2))//se si tratta di un movimento di sola prima nota
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
else if (file == LF_RMOV)
|
||||
@ -1054,10 +1065,10 @@ bool TListaMov_application::preprocess_page(int file,int counter)
|
||||
_numr = curmov.get_long(MOV_NUMREG);
|
||||
_tipo_elenco = curmov.get(MOV_TIPO);
|
||||
_codcf = curmov.get_long(MOV_CODCF);
|
||||
const tiporeg tiporeg = cached_registro(codreg, anno).tipo_registro();
|
||||
const TString8 attreg = cached_registro(codreg, anno).attivita();
|
||||
const int tiporeg = tipo_registro (codreg, anno);
|
||||
const TString8 attreg = AttivitaRegistro (codreg, anno);
|
||||
|
||||
if (tiporeg == vendita || tiporeg == acquisto)//se si tratta di un movimento iva
|
||||
if (tiporeg == 1 || tiporeg == 2)//se si tratta di un movimento iva
|
||||
{
|
||||
_tipoatt = TipoAttivita(attreg, get_firm());
|
||||
_tipo_elenco = curmov.get(MOV_TIPO);
|
||||
@ -1886,18 +1897,18 @@ bool TListaMov_application::segnala_errori_iva()
|
||||
return true;
|
||||
}
|
||||
if (tipodet == 1 || tipodet == 3 || tipodet == 5 || tipodet == 9)
|
||||
if (_tiporegistro != acquisto)
|
||||
if (_tiporegistro != 2)
|
||||
{
|
||||
rmoviva.readat(nrec);
|
||||
return true;
|
||||
}
|
||||
if (_tiporegistro == vendita)
|
||||
if (_tiporegistro == 1)
|
||||
if (tipocr != 0 && tipocr != 1 && tipocr != 4 && tipocr != 9)
|
||||
{
|
||||
rmoviva.readat(nrec);
|
||||
return true;
|
||||
}
|
||||
if (_tiporegistro == acquisto)
|
||||
if (_tiporegistro == 2)
|
||||
if (tipocr != 0 && tipocr != 1 && tipocr != 2 && tipocr != 3 && tipocr != 5 && tipocr != 8 && tipocr != 9)
|
||||
{
|
||||
rmoviva.readat(nrec);
|
||||
|
@ -25,7 +25,6 @@
|
||||
|
||||
#include "cg3.h"
|
||||
#include "cg3300.h"
|
||||
#include "cglib.h"
|
||||
|
||||
#include "cg3300a.h"
|
||||
#include "cg3300b.h"
|
||||
@ -470,19 +469,18 @@ void TStampa_allegati::ricalcola(int anno_dic)
|
||||
{
|
||||
pi.addstatus(1);
|
||||
|
||||
const tiporeg tipo = cached_registro(reg).tipo_registro();
|
||||
|
||||
if ((tipo != acquisto) && (tipo != vendita))
|
||||
const int tiporeg = reg.get_int("I0");
|
||||
if ((tiporeg != 2) && (tiporeg != 1))
|
||||
continue;
|
||||
|
||||
if (tiporeg == vendita)
|
||||
if (tiporeg == 1)
|
||||
{
|
||||
if (cached_registro(reg).sospeso())
|
||||
continue;
|
||||
vendite = true;
|
||||
bool sosp = reg.get_bool ("B0");
|
||||
if (sosp) continue;
|
||||
vendite = TRUE;
|
||||
}
|
||||
else
|
||||
vendite = false;
|
||||
vendite = FALSE;
|
||||
|
||||
tipodoc = cau.get (CAU_TIPODOC);
|
||||
if (corrispettivo (tipodoc))
|
||||
|
@ -45,6 +45,7 @@ HIDDEN const int SEZA132 = 108;
|
||||
HIDDEN const int TOTAVERE132 = 110;
|
||||
|
||||
enum descr { causale, conto, operazione };
|
||||
enum tipo_sospensione { nessuna, sospensione_normale, vol_affari, liquidazione };
|
||||
|
||||
class TContoOccas : public TBill
|
||||
{
|
||||
@ -242,9 +243,8 @@ bool TStampa_giornale::filter_func(const TRelation * r)
|
||||
return false;
|
||||
|
||||
// Scarto i movimenti che hanno il registro ai soli fini della liquidazione
|
||||
const TRegistro & reg = cached_registro(r->lfile("REG").curr().get("CODTAB"));
|
||||
const tipo_sospensione ts = reg.sospensione();
|
||||
|
||||
const TRectype& reg = r->lfile("REG").curr();
|
||||
const tipo_sospensione ts = reg.get_bool("B1") ? (tipo_sospensione) reg.get_int("I9") : nessuna;
|
||||
if (ts == liquidazione)
|
||||
return false;
|
||||
|
||||
|
@ -84,6 +84,7 @@ class TLista_fatture : public TPrintapp
|
||||
|
||||
protected:
|
||||
long select_firm_range(long from, long to);
|
||||
int tiporeg(const TString& );
|
||||
static bool mix_handler(TMask_field&, KEY);
|
||||
static bool date_handler(TMask_field&, KEY);
|
||||
static bool to_ditt_handler(TMask_field&, KEY);
|
||||
@ -116,6 +117,12 @@ public:
|
||||
|
||||
inline TLista_fatture& app() { return (TLista_fatture&) main_app(); }
|
||||
|
||||
int TLista_fatture::tiporeg(const TString& reg)
|
||||
{
|
||||
TString8 s; s.format("%4d%-3s",_date_from.year(),(const char*)reg);
|
||||
return atoi(cache().get("REG", s, "I0"));
|
||||
}
|
||||
|
||||
bool TLista_fatture::filter_func1(const TRelation *r)
|
||||
{
|
||||
TLista_fatture& a = app();
|
||||
@ -137,8 +144,8 @@ bool TLista_fatture::filter_func1(const TRelation *r)
|
||||
if (riv.get(RMI_TIPODET).blank() || percind.is_zero())
|
||||
return false;
|
||||
|
||||
const tiporeg tipo = cached_registro(rg).tipo_registro();
|
||||
if (tipo != acquisto)
|
||||
const int tiporeg = a.tiporeg(rg);
|
||||
if (tiporeg != 2)
|
||||
return false;
|
||||
}
|
||||
else // Tipo costo/ricavo
|
||||
@ -436,9 +443,8 @@ bool TLista_fatture::preprocess_page(int file, int counter)
|
||||
if (_tipo == intra)
|
||||
{
|
||||
TString4 codiva = rec.get(RMI_CODIVA);
|
||||
const tiporeg tipomov = cached_registro(mov.get(MOV_REG)).tipo_registro();
|
||||
|
||||
if (tipomov == acquisto && tipodet == 9)
|
||||
const int tipomov = tiporeg(mov.get(MOV_REG));
|
||||
if (tipomov == 2 && tipodet == 9)
|
||||
codiva = "~A19"; // Speciale per acquisti indeducibili art. 19
|
||||
const bool is_key = _intra_items.is_key(codiva); // Esiste l'elemento ?
|
||||
// Se si' allora prendi quello, altrimenti prendine uno nuovo
|
||||
@ -463,10 +469,8 @@ bool TLista_fatture::preprocess_page(int file, int counter)
|
||||
_tot_iva += iva;
|
||||
_tp_imp += imp;
|
||||
_tp_iva += iva;
|
||||
|
||||
const tiporeg tipomov = cached_registro(mov.get(MOV_REG)).tipo_registro();
|
||||
|
||||
if (_tipo == indetraibile && tipomov == acquisto && tipodet > 0)
|
||||
const int tipomov = tiporeg(mov.get(MOV_REG));
|
||||
if (_tipo == indetraibile && tipomov == 2 && tipodet > 0)
|
||||
{
|
||||
TString4 codiva = rec.get(RMI_CODIVA);
|
||||
_Iva_item * iva_row = (_Iva_item *) _indetr.objptr(codiva);
|
||||
|
@ -24,7 +24,7 @@
|
||||
#include <saldi.h>
|
||||
#include <causali.h>
|
||||
|
||||
#include "cglib.h"
|
||||
#include "cglib02.h"
|
||||
|
||||
struct therec
|
||||
{
|
||||
@ -89,7 +89,7 @@ bool CG4100_App::sort_sal()
|
||||
sal.set_anno_es(year);
|
||||
sal.clear_saldi(year);
|
||||
long numreg = 0L;
|
||||
tiposal tsal = saldo_normale;
|
||||
tiposal tsal = normale;
|
||||
char provvis;
|
||||
TDate datareg;
|
||||
|
||||
@ -127,11 +127,20 @@ bool CG4100_App::sort_sal()
|
||||
mov.put(MOV_NUMREG, numreg);
|
||||
mov.read();
|
||||
CHECK(mov.good(),"Archivi movimenti e righe inconsistenti");
|
||||
const TString& codcaus = mov.get(MOV_CODCAUS);
|
||||
|
||||
tsal = saldo_normale; // Tipo saldo normale per default
|
||||
if(codcaus.full())
|
||||
tsal = cached_causale(codcaus, year).tipo_saldo();
|
||||
// Tipo saldo normale per default
|
||||
tsal = normale;
|
||||
const TString& codcaus = mov.get(MOV_CODCAUS);
|
||||
const TRectype& causale = cache().get(LF_CAUSALI, codcaus);
|
||||
if (!causale.empty())
|
||||
{
|
||||
const char ac = causale.get_char(CAU_MOVAP);
|
||||
if (ac == 'A')
|
||||
tsal = apertura; else
|
||||
if (ac == 'C')
|
||||
tsal = chiusura;
|
||||
}
|
||||
|
||||
scaricato = mov.get_bool(MOV_SCARCON);
|
||||
provvis = mov.get_char(MOV_PROVVIS);
|
||||
datareg = mov.get_date(MOV_DATAREG);
|
||||
|
@ -209,12 +209,16 @@ bool TGestAutoTrasp_mask::on_field_event(TOperable_field& o, TField_event e, lon
|
||||
if (e == fe_close) // Controllo sulla presenza dei codici causale nello spreadsheet
|
||||
{
|
||||
TSheet_field& sf = sfield(F_SHEET_CAUSALI);
|
||||
bool error = true;
|
||||
for (int i = 0; error && i < sf.items(); i++)
|
||||
bool error = TRUE;
|
||||
for (int i=0; i < sf.items(); i++)
|
||||
{
|
||||
const TString16 c = sf.get_str_row_cell(i, F_CAUDEF);
|
||||
|
||||
error = c.blank();
|
||||
TToken_string& tt = sf.row(i);
|
||||
const TString16 c = tt.get(F_CAUDEF - F_CAUMOV);
|
||||
if (!c.blank())
|
||||
{
|
||||
error = FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (error)
|
||||
{
|
||||
|
@ -450,7 +450,7 @@ int TParaliq_app::read(TMask& m)
|
||||
TCursor cur(&relpla, "", 1, &pla, &pla);
|
||||
const TRecnotype items = cur.items();
|
||||
|
||||
sf.reset();
|
||||
sf.destroy();
|
||||
if (items == 0)
|
||||
init_array(sf); // Carica tutti i codici attività
|
||||
else
|
||||
|
@ -1755,8 +1755,7 @@ void Visliq_app::read_general(TMask& m)
|
||||
|
||||
// Sheet versamenti
|
||||
TString nomemese;
|
||||
|
||||
sv.reset();
|
||||
sv.destroy();
|
||||
// for (int i = 1; i <= 13; i++)
|
||||
for (int i = step; i < last_month; i += step)
|
||||
{
|
||||
|
@ -1102,11 +1102,11 @@ void TRic_tab::ricevi_movPN(const TString& key, char uselab)
|
||||
_sld.set_data_ulmov(datareg);
|
||||
|
||||
const char movap = ricerca_causale(codcaus);
|
||||
tiposal tsal = saldo_normale;
|
||||
if (movap == 'A')
|
||||
_sld.set_tipo_saldo(apertura);
|
||||
else if (movap == 'C')
|
||||
_sld.set_tipo_saldo(chiusura);
|
||||
|
||||
if (codcaus.full())
|
||||
tsal = cached_causale(codcaus, annoes).tipo_saldo();
|
||||
_sld.set_tipo_saldo(tsal);
|
||||
scrivi_righePN(nreg);
|
||||
|
||||
_sld.registra();
|
||||
|
@ -22,6 +22,8 @@
|
||||
#define REP_TERREM 10
|
||||
#define REP_PAART17 11
|
||||
|
||||
enum tipo_sospensione { nessuna, sospenzione_normale, vol_affari, liquidazione };
|
||||
|
||||
class TQuadro_VE_recordset : public TQuadro_IVA_recordset
|
||||
{
|
||||
protected:
|
||||
|
@ -5,7 +5,6 @@
|
||||
|
||||
#include "cg7401.h"
|
||||
#include "cgpim.h"
|
||||
#include "cglib.h"
|
||||
|
||||
#include "cg7400a.h"
|
||||
#include <attiv.h>
|
||||
@ -17,6 +16,8 @@
|
||||
#define REP_SANMARINO 4
|
||||
#define REP_RIPACQ 5
|
||||
|
||||
enum tipo_sospensione { nessuna, sospensione_normale, vol_affari, liquidazione };
|
||||
|
||||
class TQuadro_VF_recordset : public TQuadro_IVA_recordset
|
||||
{
|
||||
TQuadro_IVA_mask * _mask;
|
||||
|
@ -5,13 +5,14 @@
|
||||
|
||||
#include "cg7401.h"
|
||||
#include "cgpim.h"
|
||||
#include "cglib.h"
|
||||
|
||||
#include "cg7400a.h"
|
||||
#include "rmoviva.h"
|
||||
|
||||
#define REP_QUADRO 1
|
||||
|
||||
enum tipo_sospensione { nessuna, sospensione_normale, vol_affari, liquidazione };
|
||||
|
||||
class TQuadro_VJ_recordset : public TQuadro_IVA_recordset
|
||||
{
|
||||
TQuadro_IVA_mask * _mask;
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include <rmoviva.h>
|
||||
|
||||
#include "..\cg\cgsaldac.h"
|
||||
#include "..\cg\cglib.h"
|
||||
#include "..\cg\cg2103.h"
|
||||
#include "..\ve\velib.h"
|
||||
|
||||
#include "cm1100a.h"
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
#include "../ce/collces.h"
|
||||
#include "../ve/velib.h"
|
||||
#include "../cg/cglib.h"
|
||||
#include "../cg/cg2103.h"
|
||||
|
||||
#include "../ca/movana.h"
|
||||
#include "../ca/rmovana.h"
|
||||
|
@ -202,7 +202,7 @@ bool TFppro::associa_mov(const int numreg) const
|
||||
const char* TFppro::get_tipoprot() const
|
||||
{
|
||||
TString query;
|
||||
TString tipo;
|
||||
static TString tipo;
|
||||
query << "SELECT PZ_TIPOPROT AS TIPOPROT FROM FPPRO00F\r\n" << where_str();
|
||||
_db->sq_set_exec(query);
|
||||
return tipo.cut(0) = _db->sq_get("TIPOPROT");
|
||||
|
File diff suppressed because it is too large
Load Diff
224
src/f9/f90100.h
224
src/f9/f90100.h
@ -9,16 +9,12 @@
|
||||
|
||||
#include "f9lib.h"
|
||||
|
||||
|
||||
inline bool open_mov(const long numreg);
|
||||
|
||||
/** class TEstrai_mask
|
||||
* \brief Piccola maschera "creata a runtime" per avviare l'estrazione. runtime ? cazzata
|
||||
* \brief Piccola maschera "creata a runtime" per avviare l'estrazione.
|
||||
*/
|
||||
|
||||
class TEstrai_mask : public TMask
|
||||
{
|
||||
TEstrazione * _estrazione; // Oggetto estrazione in corso di elaborazione
|
||||
unique_ptr<TEstrazione> _estrazione; // Oggetto estrazione in corso di elaborazione
|
||||
|
||||
void enable_fields(bool en = true);
|
||||
|
||||
@ -47,128 +43,38 @@ public:
|
||||
TEstrai_mask();
|
||||
};
|
||||
|
||||
class TControllo_mask : public TAutomask
|
||||
{
|
||||
TArray _controllo_mov; // Usare import_error_list().
|
||||
char _ordin;
|
||||
char _verso;
|
||||
bool _sel_esclusi;
|
||||
bool _is_escluso;
|
||||
TString _cod_soc;
|
||||
TString _id_estr;
|
||||
char _tipo_doc_err{};
|
||||
TDate _datada;
|
||||
TDate _dataa;
|
||||
|
||||
void associa();
|
||||
void conferma_esclusi() const;
|
||||
|
||||
TArray & import_error_list();
|
||||
void fill();
|
||||
void fill_fppro_sheet() const;
|
||||
TMask& get_win_order();
|
||||
void open_win_order();
|
||||
|
||||
int selected_mov();
|
||||
int selected_fat() const;
|
||||
|
||||
/** Gestisce la selezione multipla negli sheet di controllo movimenti */
|
||||
void selfatt(TOperable_field& o, long jolly) const;
|
||||
|
||||
bool on_field_event(TOperable_field& o, TField_event e, long jolly) override;
|
||||
public:
|
||||
TControllo_mask(const char* codsoc, const char* id_estr, bool esclusi = false);
|
||||
};
|
||||
|
||||
class TApri_estr_msk : public TAutomask
|
||||
{
|
||||
TString _idestr;
|
||||
TDate _dataestr;
|
||||
bool _provv;
|
||||
char _tipodoc;
|
||||
TString _statoestr;
|
||||
TDate _datadal;
|
||||
TDate _dataal;
|
||||
|
||||
bool on_field_event(TOperable_field& o, TField_event e, long jolly) override;
|
||||
|
||||
bool inall_handler() const;
|
||||
bool inescludi_handler() const;
|
||||
bool inselect_handler() const;
|
||||
void conferma_esclusi() const;
|
||||
public:
|
||||
void fill_estr() const;
|
||||
void fill_res() const;
|
||||
void set_from_row_estrazione(TToken_string& row_estrazione);
|
||||
|
||||
TApri_estr_msk();
|
||||
};
|
||||
|
||||
class TMonitor_mask : public TAutomask
|
||||
{
|
||||
friend class TF9_app;
|
||||
vector<TToken_string> _fppro;
|
||||
std::unique_ptr<TApri_estr_msk> _inclusi_mask;
|
||||
|
||||
// Configurazione mask
|
||||
static bool save_conf_handler(TMask_field& f, KEY key);
|
||||
|
||||
// Metodi per la maschera 'Apri Estr.'
|
||||
|
||||
void open_apri_estr_win();
|
||||
|
||||
// Controllo estr. mask
|
||||
void controllo_errori() const;
|
||||
static void delete_estr_fld(const TString& idestr);
|
||||
void delete_pack(bool all = false) const;
|
||||
|
||||
// Riempie sheet per visualizzare le estrazioni
|
||||
void fill() const;
|
||||
|
||||
bool on_field_event(TOperable_field& o, TField_event e, long jolly) override;
|
||||
static void open_win_estr();
|
||||
static void open_win_conf();
|
||||
void sel() const;
|
||||
|
||||
public:
|
||||
TMonitor_mask();
|
||||
};
|
||||
|
||||
class TF9_app : public TSkeleton_application
|
||||
{
|
||||
//friend class TEstrai_mask;
|
||||
friend class TMonitor_mask;
|
||||
friend class TEstrai_mask;
|
||||
friend class TControllo_mask;
|
||||
friend class TApri_estr_msk;
|
||||
friend class TEstrazione;
|
||||
|
||||
TEstrai_mask * _estr_msk;
|
||||
TMonitor_mask * _msk;
|
||||
|
||||
unique_ptr<TEstrai_mask> _estr_msk;
|
||||
unique_ptr<TMonitor_mask> _msk;
|
||||
vector<movimento_t> _movs;
|
||||
TArray _esclusi; // Vettore con i movimenti esclusi
|
||||
TArray _esclusi_vect;
|
||||
vector<TToken_string> _esclusi; // Vettore con i movimenti esclusi
|
||||
vector<TToken_string> _esclusi_vect;
|
||||
TToken_string _mov_escl;
|
||||
char _tipodoc_escl;
|
||||
char _flagprov_escl;
|
||||
TString _log;
|
||||
|
||||
TEstrazione* _estr_escluso;
|
||||
|
||||
|
||||
char get_tipodoc_escl() const { return _tipodoc_escl; }
|
||||
TipoIVA get_tipoiva_escl() const { return get_tipodoc_escl() == 'A' ? iva_acquisti : iva_vendite; }
|
||||
|
||||
// Dato il codice stato estrazione (es. "01") viene restituito il suo significato a parole (es. "in diagnostica").
|
||||
static const char* traduci_stato(const TString& cod);
|
||||
static bool is_stato_errore(const TString& stato_etr);
|
||||
// Controllo e aggiornamento tabelle F9
|
||||
bool create_tables() const; // Creazione tabelle F9.
|
||||
bool check_tabelle_f9() const; // Controllo esistenza delle tabelle e in caso le crea.
|
||||
bool aggiorna_tab_f9(int version) const; // Aggiorna modifiche alle tabelle F9 come descritto in cima al file f90100.cpp.
|
||||
bool check_tab_version() const; // Controllo della versione e in caso aggiorna le tabelle.
|
||||
bool check_table() const; // Controllo e aggiornamento versione sql. Chiamata in main_loop.
|
||||
|
||||
protected:
|
||||
virtual bool create();
|
||||
virtual bool destroy();
|
||||
|
||||
public:
|
||||
/** Mostra la finestrella per l'inserimento delle opzioni per l'estrazione e avviarla. */
|
||||
@ -203,13 +109,121 @@ public:
|
||||
/** Segna su mov che il movimento e' stato estratto. */
|
||||
bool segna_estratti(bool escluso = false, int numreg = 0);
|
||||
|
||||
// Controllo e aggiornamento tabelle F9
|
||||
private:
|
||||
bool create_tables() const; // Creazione tabelle F9.
|
||||
bool check_tabelle_f9() const; // Controllo esistenza delle tabelle e in caso le crea.
|
||||
bool aggiorna_tab_f9(int version) const; // Aggiorna modifiche alle tabelle F9 come descritto in cima al file f90100.cpp.
|
||||
bool check_tab_version() const; // Controllo della versione e in caso aggiorna le tabelle.
|
||||
bool check_table() const; // Controllo e aggiornamento versione sql. Chiamata in main_loop.
|
||||
|
||||
public:
|
||||
void main_loop() override;
|
||||
|
||||
TF9_app();
|
||||
};
|
||||
|
||||
inline TF9_app& f9_app() { return (TF9_app &)main_app();}
|
||||
inline TF9_app& f9_app()
|
||||
{
|
||||
static TF9_app* app = nullptr;
|
||||
if (app == nullptr)
|
||||
app = (TF9_app*)&main_app();
|
||||
return *app;
|
||||
}
|
||||
|
||||
|
||||
|
||||
class TApri_estr_msk;
|
||||
class TMonitor_mask : public TAutomask
|
||||
{
|
||||
friend class TF9_app;
|
||||
vector<TToken_string> _fppro;
|
||||
std::unique_ptr<TApri_estr_msk> _inclusi_mask;
|
||||
|
||||
// Configurazione mask
|
||||
static bool save_conf_handler(TMask_field& f, KEY key);
|
||||
|
||||
// Metodi per la maschera 'Apri Estr.'
|
||||
|
||||
void open_apri_estr_win();
|
||||
|
||||
// Controllo estr. mask
|
||||
void controllo_errori() const;
|
||||
static void delete_estr_fld(const TString& idestr);
|
||||
void delete_pack(bool all = false) const;
|
||||
|
||||
// Riempie sheet per visualizzare le estrazioni
|
||||
void fill() const;
|
||||
|
||||
bool on_field_event(TOperable_field& o, TField_event e, long jolly) override;
|
||||
static void open_win_estr();
|
||||
static void open_win_conf();
|
||||
void sel() const;
|
||||
|
||||
public:
|
||||
TMonitor_mask();
|
||||
};
|
||||
|
||||
class TControllo_mask : public TAutomask
|
||||
{
|
||||
vector<TToken_string> _controllo_mov; // Usare import_error_list().
|
||||
char _ordin;
|
||||
char _verso;
|
||||
int _selected_mov;
|
||||
bool _sel_esclusi;
|
||||
bool _is_escluso;
|
||||
TString _cod_soc;
|
||||
TString _id_estr;
|
||||
char _tipo_doc_err{};
|
||||
TDate _datada;
|
||||
TDate _dataa;
|
||||
|
||||
void associa();
|
||||
void conferma_esclusi() const;
|
||||
|
||||
vector<TToken_string>& import_error_list();
|
||||
void fill();
|
||||
void fill_fppro_sheet() const;
|
||||
TMask& get_win_order();
|
||||
void open_win_order();
|
||||
|
||||
TToken_string* selected_mov();
|
||||
TToken_string* selected_fat() const;
|
||||
|
||||
/** Gestisce la selezione multipla negli sheet di controllo movimenti */
|
||||
void selfatt(TOperable_field& o, long jolly) const;
|
||||
|
||||
bool on_field_event(TOperable_field& o, TField_event e, long jolly) override;
|
||||
public:
|
||||
TControllo_mask(const char* codsoc, const char* id_estr, bool esclusi = false);
|
||||
};
|
||||
|
||||
class TApri_estr_msk : public TAutomask
|
||||
{
|
||||
TString _idestr;
|
||||
TDate _dataestr;
|
||||
bool _provv;
|
||||
char _tipodoc;
|
||||
TString _statoestr;
|
||||
TDate _datadal;
|
||||
TDate _dataal;
|
||||
|
||||
bool on_field_event(TOperable_field& o, TField_event e, long jolly) override;
|
||||
|
||||
bool inall_handler() const;
|
||||
bool inescludi_handler() const;
|
||||
bool inselect_handler() const;
|
||||
void conferma_esclusi() const;
|
||||
public:
|
||||
void fill_estr() const;
|
||||
void fill_res() const;
|
||||
void set_from_row_estrazione(TToken_string& row_estrazione);
|
||||
|
||||
TApri_estr_msk();
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
inline bool open_mov(const TRectype& mov)
|
||||
{
|
||||
|
@ -6,12 +6,14 @@ BUTTON B_ORDER 2 2
|
||||
BEGIN
|
||||
PROMPT 1 5 "Ordinamento"
|
||||
PICTURE TOOL_EDIT
|
||||
FLAGS ""
|
||||
END
|
||||
|
||||
BUTTON B_ASSOC 2 2
|
||||
BEGIN
|
||||
PROMPT 1 6 "Associa mov."
|
||||
PICTURE TOOL_SAVEREC
|
||||
FLAGS ""
|
||||
END
|
||||
|
||||
BUTTON DLG_NULL 2 2
|
||||
@ -24,18 +26,21 @@ BUTTON B_SELESCL 2 2
|
||||
BEGIN
|
||||
PROMPT 1 8 "Sel. esclusi"
|
||||
PICTURE TOOL_MULTISEL
|
||||
FLAGS ""
|
||||
END
|
||||
|
||||
BUTTON B_ESCL 2 2
|
||||
BEGIN
|
||||
PROMPT 1 7 "Conf. esclusi"
|
||||
PICTURE TOOL_WARNING
|
||||
FLAGS ""
|
||||
END
|
||||
|
||||
BUTTON B_ALLESCL 2 2
|
||||
BEGIN
|
||||
PROMPT 1 7 "Sel. tutti"
|
||||
PICTURE TOOL_MULTISEL
|
||||
FLAGS ""
|
||||
END
|
||||
|
||||
#include <helpbar.h>
|
||||
@ -53,19 +58,19 @@ BEGIN
|
||||
PROMPT 0 1 "Movimenti da controllare"
|
||||
ITEM " "
|
||||
ITEM "Numero\nReg.@8"
|
||||
ITEM "Data\nReg.@10"
|
||||
ITEM "Data\nDoc.@10"
|
||||
ITEM "Codice\nCaus."
|
||||
ITEM "Mese\nliquidazione"
|
||||
ITEM "Numero\nDocumento@12"
|
||||
ITEM "Totale\nDocumento@18"
|
||||
ITEM "Cliente/\nFornitore"
|
||||
ITEM "Ragione\nSociale@50"
|
||||
ITEM "Cod. regis./\nprot.IVA@10"
|
||||
ITEM "Descrizione@50"
|
||||
ITEM "Escludi"
|
||||
ITEM "Escluso"
|
||||
ITEM "Descrizione\nErrore@50"
|
||||
ITEM "Data\nReg.@8"
|
||||
ITEM "Data\nDoc.@8"
|
||||
ITEM "Codice\nCaus.@8"
|
||||
ITEM "Mese\nliquidazione@8"
|
||||
ITEM "Numero\nDocumento@8"
|
||||
ITEM "Totale\nDocumento@8"
|
||||
ITEM "Cliente/\nFornitore@8"
|
||||
ITEM "Ragione\nSociale@8"
|
||||
ITEM "Cod. regis./\nprot.IVA@8"
|
||||
ITEM "Descrizione@8"
|
||||
ITEM "ESCLUDI@5"
|
||||
ITEM "ESCLUSO@6"
|
||||
ITEM "Descrizione\nErrore"
|
||||
END
|
||||
|
||||
TEXT DLG_NULL
|
||||
@ -82,9 +87,9 @@ BEGIN
|
||||
ITEM "Num. Doc.@12"
|
||||
ITEM "Tot. Doc.@9"
|
||||
ITEM "Fornitore@6"
|
||||
ITEM "Rag. Soc.@50"
|
||||
ITEM "Rag. Soc.@20"
|
||||
ITEM "Stato P.IVA"
|
||||
ITEM "P.IVA@15"
|
||||
ITEM "P.IVA@8"
|
||||
ITEM "@1"
|
||||
END
|
||||
|
||||
@ -173,7 +178,7 @@ BEGIN
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
BOOLEAN F_CESCLUSO
|
||||
STRING F_CESCLUSO 2
|
||||
BEGIN
|
||||
PROMPT 1 1 "ESCLUSO"
|
||||
FLAG "D"
|
||||
|
@ -64,7 +64,7 @@ BEGIN
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
DATA F_EDATAREG
|
||||
DATA FE_DATAREG
|
||||
BEGIN
|
||||
PROMPT 1 1 ""
|
||||
FLAGS "D"
|
||||
|
@ -111,23 +111,24 @@ BEGIN
|
||||
PROMPT 0 4 "Movimenti estratti"
|
||||
ITEM " "
|
||||
ITEM "Numero\nReg.@8"
|
||||
ITEM "Data\nReg.@0"
|
||||
ITEM "Data\nDoc.@10"
|
||||
ITEM "Codice\nCaus."
|
||||
ITEM "Tipo\nDoc."
|
||||
ITEM "Mese\nliquidazione"
|
||||
ITEM "Numero\nDocumento@12"
|
||||
ITEM "Totale\nDocumento@18"
|
||||
ITEM "Cliente/\nFornitore"
|
||||
ITEM "Ragione\nSociale@50"
|
||||
ITEM "Cod. regis./\nprot.IVA@10"
|
||||
ITEM "Descrizione@50"
|
||||
ITEM "Escludi"
|
||||
ITEM "Escluso"
|
||||
ITEM "Data\nReg.@8"
|
||||
ITEM "Data\nDoc.@8"
|
||||
ITEM "Codice\nCaus.@8"
|
||||
ITEM "Tipo Doc.@5"
|
||||
ITEM "Mese\nliquidazione@8"
|
||||
ITEM "Numero\nDocumento@8"
|
||||
ITEM "Totale\nDocumento@8"
|
||||
ITEM "Cliente/\nFornitore@8"
|
||||
ITEM "Ragione\nSociale@8"
|
||||
ITEM "Cod. regis./\nprot.IVA@8"
|
||||
ITEM "Descrizione@8"
|
||||
ITEM "ESCLUDI@5"
|
||||
ITEM "ESCLUSO@6"
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
|
||||
PAGE "Risultato estrazione" 0 0 0 0
|
||||
|
||||
SPREADSHEET S_RES -1 -1
|
||||
@ -135,23 +136,26 @@ BEGIN
|
||||
PROMPT 0 0 "Movimenti"
|
||||
ITEM "Estratto"
|
||||
ITEM "Numero\nReg.@8"
|
||||
ITEM "Data\nReg.@10"
|
||||
ITEM "Data\nDoc.@10"
|
||||
ITEM "Codice\nCaus."
|
||||
ITEM "Tipo\nDoc."
|
||||
ITEM "Data\nReg.@8"
|
||||
ITEM "Data\nDoc.@8"
|
||||
ITEM "Codice\nCaus.@8"
|
||||
ITEM "Tipo Doc.@5"
|
||||
ITEM "Mese\nliquidazione@8"
|
||||
ITEM "Numero\nDocumento@12"
|
||||
ITEM "Totale\nDocumento@18"
|
||||
ITEM "Cliente/\nFornitore"
|
||||
ITEM "Ragione\nSociale@50"
|
||||
ITEM "Cod. regis./\nprot.IVA@10"
|
||||
ITEM "Descrizione@50"
|
||||
ITEM "Numero\nDocumento@8"
|
||||
ITEM "Totale\nDocumento@8"
|
||||
ITEM "Cliente/\nFornitore@8"
|
||||
ITEM "Ragione\nSociale@8"
|
||||
ITEM "Cod. regis./\nprot.IVA@8"
|
||||
ITEM "Descrizione@8"
|
||||
ITEM "Descrizione Estrazione@30"
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
ENDMASK
|
||||
|
||||
|
||||
|
||||
|
||||
PAGE "Mov Inclusi" -1 -1 78 13
|
||||
|
||||
BOOLEAN FI_SEL
|
||||
@ -238,17 +242,14 @@ BEGIN
|
||||
ITEM "S|SI"
|
||||
ITEM "N|NO"
|
||||
FLAGS "D"
|
||||
PROMPT 1 1 "Escludi"
|
||||
FLAG "D"
|
||||
END
|
||||
|
||||
BOOLEAN FI_IESCLUSO
|
||||
BEGIN
|
||||
PROMPT 1 1 "Escluso"
|
||||
FLAGS "D"
|
||||
PROMPT 1 1 "ESCLUSO"
|
||||
FLAG "D"
|
||||
END
|
||||
|
||||
|
||||
ENDPAGE
|
||||
|
||||
TOOLBAR "topbar" 0 0 0 2
|
||||
@ -275,6 +276,9 @@ END
|
||||
ENPAGE
|
||||
ENDMASK
|
||||
|
||||
|
||||
|
||||
|
||||
PAGE "Risultato estratti" -1 -1 78 13
|
||||
|
||||
BOOLEAN F_RSEL
|
||||
|
@ -36,6 +36,7 @@ public:
|
||||
|
||||
class TF9_categorie_doc_msk : public TAutomask
|
||||
{
|
||||
std::shared_ptr<TArray_sheet> _annessi_sheet;
|
||||
TCategorie_doc _categorie_doc;
|
||||
bool _mod_precaricate;
|
||||
|
||||
@ -46,7 +47,7 @@ class TF9_categorie_doc_msk : public TAutomask
|
||||
void check_duplicate_tipodoc() const;
|
||||
void delete_annesso(const TString& catdoc_padre);
|
||||
void edit_annesso(const TString& catdoc_padre);
|
||||
TArray_sheet * get_sheet_annesso(const TString& catdoc);
|
||||
void fill_annessi(const TString& catdoc);
|
||||
void load_table() const;
|
||||
void new_annesso(const TString& catdoc_padre);
|
||||
void salva_tabella() const;
|
||||
@ -88,10 +89,9 @@ bool TF9_categorie_doc_msk::on_field_event(TOperable_field& o, TField_event e, l
|
||||
{
|
||||
TSheet_field& sf = sfield(S_CLASSDOC);
|
||||
const TString catdoc_padre(sf.row(sf.selected()).get(1));
|
||||
TArray_sheet * sa = get_sheet_annesso(catdoc_padre);
|
||||
fill_annessi(catdoc_padre);
|
||||
int key;
|
||||
|
||||
while ((key = sa->run()) != K_ESC)
|
||||
while ((key = _annessi_sheet->run()) != K_ESC)
|
||||
{
|
||||
switch (key)
|
||||
{
|
||||
@ -168,33 +168,25 @@ void TF9_categorie_doc_msk::check_duplicate_tipodoc() const
|
||||
|
||||
void TF9_categorie_doc_msk::delete_annesso(const TString& catdoc_padre)
|
||||
{
|
||||
TArray_sheet *sa = get_sheet_annesso(catdoc_padre);
|
||||
|
||||
if (sa->items() > 0)
|
||||
if (_annessi_sheet->items() > 0)
|
||||
{
|
||||
const int r = sa->selected();
|
||||
|
||||
const int r = _annessi_sheet->selected();
|
||||
if (yesno_box("Eliminare l'annesso N. %d?", r + 1))
|
||||
{
|
||||
_categorie_doc.del_annesso(catdoc_padre, sa->row(r).get(0));
|
||||
// fill_annessi(catdoc_padre);
|
||||
_categorie_doc.del_annesso(catdoc_padre, _annessi_sheet->row(r).get(0));
|
||||
fill_annessi(catdoc_padre);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void TF9_categorie_doc_msk::edit_annesso(const TString& catdoc_padre)
|
||||
{
|
||||
TArray_sheet * sa = get_sheet_annesso(catdoc_padre);
|
||||
|
||||
if (sa->items() > 0)
|
||||
if (_annessi_sheet->items() > 0)
|
||||
{
|
||||
TString title; title << TR("Modifica annesso per ") << catdoc_padre;
|
||||
TString title; title << "Modifica annesso per " << catdoc_padre;
|
||||
TNew_annesso_msk new_ann(title);
|
||||
|
||||
new_ann.edit_mode();
|
||||
|
||||
TToken_string& r = sa->row(sa->selected());
|
||||
|
||||
TToken_string& r = _annessi_sheet->row(_annessi_sheet->selected());
|
||||
new_ann.fill_field(r.get(0), r.get(1), r.get(2), r.get_bool(3));
|
||||
if (new_ann.run() == K_ENTER)
|
||||
{
|
||||
@ -202,22 +194,19 @@ void TF9_categorie_doc_msk::edit_annesso(const TString& catdoc_padre)
|
||||
const TString& descr = new_ann.get(102);
|
||||
const TString& tipo = new_ann.get(103);
|
||||
const bool obblig = new_ann.get_bool(104);
|
||||
|
||||
_categorie_doc.del_annesso(catdoc_padre, catann);
|
||||
_categorie_doc.add_annesso(catdoc_padre, catann, descr, tipo, obblig);
|
||||
// fill_annessi(catdoc_padre);
|
||||
fill_annessi(catdoc_padre);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TArray_sheet * TF9_categorie_doc_msk::get_sheet_annesso(const TString& catdoc)
|
||||
void TF9_categorie_doc_msk::fill_annessi(const TString& catdoc)
|
||||
{
|
||||
TArray_sheet * sa = nullptr;
|
||||
|
||||
_categorie_doc.set_mode_sheet(0x1E);
|
||||
sa = _categorie_doc.get_sheet_ann(catdoc);
|
||||
sa->add_button(DLG_EDIT, TR("~Modifica"), K_ENTER, TOOL_EDIT);
|
||||
return sa;
|
||||
TCategorie_doc d;
|
||||
d.set_mode_sheet(0x1E);
|
||||
_annessi_sheet = d.get_sheet_ann(catdoc);
|
||||
_annessi_sheet->add_button(DLG_EDIT, TR("~Modifica"), K_ENTER, TOOL_EDIT);
|
||||
}
|
||||
|
||||
void TF9_categorie_doc_msk::load_table() const
|
||||
@ -254,18 +243,15 @@ void TF9_categorie_doc_msk::new_annesso(const TString& catdoc_padre)
|
||||
warning_box("Inserire il nome tipo annesso");
|
||||
continue;
|
||||
}
|
||||
|
||||
TAnnesso ann;
|
||||
|
||||
if (!_categorie_doc.get_annesso(catann, ann))
|
||||
TCategorie_doc::annesso ann;
|
||||
if (!_categorie_doc.get_ann(catann, ann))
|
||||
{
|
||||
const TString& descr = new_ann.get(102);
|
||||
const TString& tipo = new_ann.get(103);
|
||||
const bool obblig = new_ann.get_bool(104);
|
||||
|
||||
correct_spell_catdoc(catann);
|
||||
_categorie_doc.add_annesso(catdoc_padre, catann, descr, tipo, obblig);
|
||||
// fill_annessi(catdoc_padre);
|
||||
fill_annessi(catdoc_padre);
|
||||
}
|
||||
else
|
||||
warning_box("E' gia' presente un annesso con lo stesso nome per la categoria %s", (const char*)catdoc_padre);
|
||||
@ -336,10 +322,7 @@ void TF9_categorie_doc::add_error_log(TString& query)
|
||||
bool TF9_categorie_doc::precarica_tabella_default()
|
||||
{
|
||||
TCategorie_doc preload;
|
||||
TString_array sa;
|
||||
|
||||
preload.get_array_rows(sa);
|
||||
if (sa.items() == 0 ||
|
||||
if (preload.get_array_rows().items() == 0 ||
|
||||
noyes_box("Attenzione questa procedura cancellera' le categorie documentali gia' presenti\ne carichera' quelle di default. Si desidera continuare?"))
|
||||
{
|
||||
preload.remove_all();
|
||||
@ -384,7 +367,8 @@ void TF9_categorie_doc::main_loop()
|
||||
DRT_CAUSSO ", "
|
||||
DRT_CAUSCON ", "
|
||||
DRT_TIPOCAU ", "
|
||||
DRT_OPCEE ")\nVALUES('" << get_ambiente() << "', '" <<
|
||||
DRT_OPCEE ")\nVALUES('" <<
|
||||
F9CONF.get_ambiente() << "', '" <<
|
||||
row->get(1) << "', '" << // Catdoc
|
||||
escape(row->get(2)) << "', '" << // Descr
|
||||
row->get(3) << "', '" << // Classe doc sost.
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "f90.h"
|
||||
|
||||
// #include <Windows.h>
|
||||
#include <Windows.h>
|
||||
#include <set>
|
||||
#include <map>
|
||||
|
||||
@ -27,14 +27,15 @@ class TImport_msk : public TAutomask
|
||||
{
|
||||
friend class TGestione_doc_cartacei_f9_msk;
|
||||
|
||||
TCategorie_doc _cats;
|
||||
|
||||
map<TString, unique_ptr<TArray_sheet>> _annessi;
|
||||
|
||||
bool on_field_event(TOperable_field& o, TField_event e, long jolly) override;
|
||||
|
||||
static bool catdocann_handler(TMask_field& field, KEY key);
|
||||
static bool catannpadre_handler(TMask_field& field, KEY key);
|
||||
static bool ok_handler(TMask_field& field, KEY key);
|
||||
|
||||
static const char* select_catdoc();
|
||||
|
||||
public:
|
||||
void set_fields(const TString& impaddress, const TString& impnumreg, bool isannesso = false, const TString& catannpadre = "",
|
||||
@ -45,134 +46,142 @@ public:
|
||||
|
||||
bool TImport_msk::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
||||
{
|
||||
TImport_msk & msk = (TImport_msk&)o.mask();
|
||||
|
||||
switch (o.dlg())
|
||||
{
|
||||
case F_IMPADDRESS:
|
||||
if (e == fe_modify)
|
||||
return fexist(o.get());
|
||||
break;
|
||||
case F_IMPNUMREG:
|
||||
if (e == fe_modify)
|
||||
case F_ISANNESSO:
|
||||
if (e == fe_modify)
|
||||
{
|
||||
const bool on = o.mask().get_bool(F_ISANNESSO);
|
||||
o.mask().enable(F_CATDOCANN, on);
|
||||
}
|
||||
break;
|
||||
case F_IMPNUMREG:
|
||||
if(e == fe_modify)
|
||||
{
|
||||
const std::shared_ptr<TCategorie_doc::classe_doc> c = TCategorie_doc().mov2cat(o.get_int());
|
||||
if (c != nullptr)
|
||||
{
|
||||
TClasse_doc * c = _cats.mov2cat(o.get_long());
|
||||
|
||||
if (c != nullptr)
|
||||
{
|
||||
msk.set(F_CATANNPADRE, c->catdoc());
|
||||
msk.reset(F_CATDOCANN);
|
||||
}
|
||||
else
|
||||
{
|
||||
message_box(TR("Questo tipo di registrazione non corrisponde a nessuna delle categorie documentali inserite."));
|
||||
msk.reset(F_CATANNPADRE);
|
||||
msk.reset(F_CATDOCANN);
|
||||
}
|
||||
}
|
||||
case F_CATDOCANN:
|
||||
if (e == fe_modify)
|
||||
{
|
||||
if (msk.get(F_CATANNPADRE).full())
|
||||
{
|
||||
TString_array names_ann;
|
||||
|
||||
_cats.get_array_ann(msk.get(F_CATANNPADRE), names_ann);
|
||||
if (names_ann.items() > 0)
|
||||
{
|
||||
if (names_ann.find(o.get()) < 0)
|
||||
{
|
||||
msk.error_box(TR("La categoria inserita e' inesistente"));
|
||||
o.reset();
|
||||
}
|
||||
}
|
||||
else
|
||||
warning_box(TR("Non esistono tipologie di annessi per questa categoria documentale."));
|
||||
}
|
||||
else
|
||||
{
|
||||
warning_box(TR("Questa registrazione non e' riconosciuta in nessuna categoria documentale.\nImpossible inserire un annesso.\n"
|
||||
"Si prega di inserire prima una cat. documentale che comprenda questo tipo di registrazione\naggiungendo anche eventuali tipologie di annessi."));
|
||||
o.reset();
|
||||
}
|
||||
set(F_CATANNPADRE, c->catdoc);
|
||||
set(F_CATDOCANN, "");
|
||||
}
|
||||
else
|
||||
if (e == fe_button)
|
||||
{
|
||||
if (msk.get(F_CATANNPADRE).full())
|
||||
{
|
||||
TArray_sheet* annessi = _cats.get_sheet_ann(msk.get(F_CATANNPADRE));
|
||||
|
||||
if (annessi && annessi->items() > 0)
|
||||
{
|
||||
if (annessi->run() == K_ENTER)
|
||||
{
|
||||
const char* s = annessi->row(annessi->selected()).get(0);
|
||||
TAnnesso annesso;
|
||||
|
||||
if (_cats.get_annesso(s, annesso))
|
||||
{
|
||||
if (annesso.op_cee() != "RC")
|
||||
msk.set(F_CATDOCANN, annesso.catdoc());
|
||||
else
|
||||
warning_box("Impossibile importare un annesso cartaceo per un prospetto integrativo per Reverse Charge.");
|
||||
}
|
||||
else
|
||||
warning_box("Errore nell'acquisire la categoria annesso");
|
||||
}
|
||||
}
|
||||
else
|
||||
warning_box(TR("Non esistono tipologie di annessi per questa categoria documentale."));
|
||||
}
|
||||
else
|
||||
warning_box(TR("Questa registrazione non e' riconosciuta in nessuna categoria documentale.\nImpossible inserire un annesso.\n"
|
||||
"Si prega di inserire prima una cat. documentale che comprenda questo tipo di registrazione\naggiungendo anche eventuali tipologie di annessi."));
|
||||
}
|
||||
break;
|
||||
case F_CATANNPADRE:
|
||||
if (e == fe_modify)
|
||||
{
|
||||
const TString_array &name_cats = _cats.get_name_catdocs();
|
||||
|
||||
if (name_cats.find(o.get()) < 0)
|
||||
{
|
||||
msk.error_box("La categoria inserita e' inesistente");
|
||||
o.reset();
|
||||
}
|
||||
message_box("Questo tipo di registrazione non corrisponde a nessuna delle categorie documentali inserite.");
|
||||
set(F_CATANNPADRE, "");
|
||||
set(F_CATDOCANN, "");
|
||||
}
|
||||
else
|
||||
if (e == fe_button)
|
||||
{
|
||||
TArray_sheet & catdocs = _cats.get_sheet_catdocs();
|
||||
|
||||
if (catdocs.run() == K_ENTER)
|
||||
{
|
||||
o.set(catdocs.row().get(0));
|
||||
msk.reset(F_CATDOCANN);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TImport_msk::catdocann_handler(TMask_field& field, KEY key)
|
||||
{
|
||||
|
||||
static const char* msg_notexist = "Non esistono tipologie di annessi per questa categoria documentale.";
|
||||
static const char* msg_inspadre = "Questa registrazione non e' riconosciuta in nessuna categoria documentale.\nImpossible inserire un annesso.\n"
|
||||
"Si prega di inserire prima una cat. documentale che comprenda questo tipo di registrazione\naggiungendo anche eventuali tipologie di annessi.";
|
||||
TCategorie_doc cd;
|
||||
TImport_msk& msk = (TImport_msk&)field.mask();
|
||||
if (key == K_TAB && field.dirty() && field.full())
|
||||
{
|
||||
|
||||
if (msk.get(F_CATANNPADRE).full())
|
||||
{
|
||||
const TString_array names_ann = cd.get_array_ann(msk.get(F_CATANNPADRE));
|
||||
if (names_ann.items() > 0)
|
||||
{
|
||||
bool ok = false;
|
||||
FOR_EACH_ARRAY_ITEM(names_ann, nr, ann)
|
||||
{
|
||||
if (field.get() == (*(TToken_string*)ann).get(0))
|
||||
ok = true;
|
||||
}
|
||||
if (!ok)
|
||||
{
|
||||
msk.error_box("La categoria inserita e' inesistente");
|
||||
field.set("");
|
||||
}
|
||||
}
|
||||
else
|
||||
warning_box(msg_notexist);
|
||||
}
|
||||
else
|
||||
{
|
||||
warning_box(msg_inspadre);
|
||||
field.set("");
|
||||
}
|
||||
}
|
||||
if (key == K_F9)
|
||||
{
|
||||
if (msk.get(F_CATANNPADRE).full())
|
||||
{
|
||||
TArray_sheet* annessi = cd.get_sheet_ann(msk.get(F_CATANNPADRE)).get();
|
||||
|
||||
if (annessi && annessi->items() > 0)
|
||||
{
|
||||
if (annessi->run() == K_ENTER)
|
||||
{
|
||||
const char* s = annessi->row(annessi->selected()).get(0);
|
||||
TCategorie_doc::annesso annesso;
|
||||
if (cd.get_ann(s, annesso))
|
||||
{
|
||||
if (annesso.opcee != "RC")
|
||||
msk.set(F_CATDOCANN, annesso.catdoc);
|
||||
else
|
||||
warning_box("Impossibile importare un annesso cartaceo per un prospetto integrativo per Reverse Charge.");
|
||||
}
|
||||
else
|
||||
warning_box("Errore nell'acquisire la categoria annesso");
|
||||
}
|
||||
}
|
||||
else
|
||||
warning_box(msg_notexist);
|
||||
}
|
||||
else
|
||||
warning_box(msg_inspadre);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void TImport_msk::set_fields(const TString & impaddress, const TString & impnumreg, const bool isannesso,
|
||||
const TString & catannpadre, const TString & catdocann)
|
||||
bool TImport_msk::catannpadre_handler(TMask_field& field, KEY key)
|
||||
{
|
||||
TCategorie_doc cd;
|
||||
TImport_msk& msk = (TImport_msk&)field.mask();
|
||||
if (key == K_TAB && field.dirty() && field.full())
|
||||
{
|
||||
std::set<TString>& name_cats = cd.get_name_catdocs();
|
||||
|
||||
const bool ok = name_cats.find(field.get()) != name_cats.end();
|
||||
if (!ok)
|
||||
{
|
||||
msk.error_box("La categoria inserita e' inesistente");
|
||||
field.set("");
|
||||
}
|
||||
}
|
||||
if (key == K_F9)
|
||||
{
|
||||
field.set(select_catdoc());
|
||||
msk.set(F_CATDOCANN, "");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TImport_msk::ok_handler(TMask_field& field, KEY key)
|
||||
{
|
||||
field.mask().send_key(K_ENTER, DLG_OK);
|
||||
return true;
|
||||
}
|
||||
|
||||
const char* TImport_msk::select_catdoc()
|
||||
{
|
||||
auto catdocs = TCategorie_doc().get_sheet_catdocs();
|
||||
if (catdocs->run() == K_ENTER)
|
||||
return catdocs->row().get(0);
|
||||
return "";
|
||||
}
|
||||
|
||||
void TImport_msk::set_fields(const TString& impaddress, const TString& impnumreg, const bool isannesso,
|
||||
const TString& catannpadre, const TString& catdocann)
|
||||
{
|
||||
set(F_IMPADDRESS, impaddress);
|
||||
set(F_IMPNUMREG, impnumreg);
|
||||
@ -183,6 +192,7 @@ void TImport_msk::set_fields(const TString & impaddress, const TString & impnumr
|
||||
|
||||
TImport_msk::TImport_msk(): TAutomask("f90300b")
|
||||
{
|
||||
TMask::set_handler(F_CATANNPADRE, catannpadre_handler);
|
||||
TMask::set_handler(F_CATDOCANN, catdocann_handler);
|
||||
}
|
||||
|
||||
@ -211,22 +221,25 @@ class TGestione_doc_cartacei_f9_msk : public TAutomask
|
||||
TString loaddate;
|
||||
TString user;
|
||||
};
|
||||
TString_array _extensions; // todo: controllare che con TString funzioni l'ordinamento, quindi la find
|
||||
const TString& _addr_cart; // Indirizzo cartella doc. cartacei F9
|
||||
std::unique_ptr<TMask> _config_msk;
|
||||
std::unique_ptr<std::set<TString>> _extensions; // todo: controllare che con TString funzioni l'ordinamento, quindi la find
|
||||
std::unique_ptr<TImport_msk> _import_msk;
|
||||
std::map<TString, doc_cart_t> _list_file;
|
||||
std::map<TString, ann_cart_t> _list_ann;
|
||||
|
||||
bool on_field_event(TOperable_field& o, TField_event e, long jolly) override;
|
||||
|
||||
void check_deleted();
|
||||
bool check_file_exist(const TString& file) const;
|
||||
void delete_file();
|
||||
void edit_ann();
|
||||
void edit_file();
|
||||
void fill();
|
||||
void fill_annessi();
|
||||
void fill_docs();
|
||||
TToken_string& get_valid_extensions();
|
||||
void check_addr_cart();
|
||||
static void check_deleted();
|
||||
bool check_file_exist(const TString& file) const;
|
||||
void delete_file();
|
||||
void edit_ann();
|
||||
void edit_file();
|
||||
void fill();
|
||||
void fill_annessi();
|
||||
void fill_docs();
|
||||
static TToken_string& get_valid_extensions();
|
||||
void load_extensions();
|
||||
static bool load_file(const TFilename& file, const TString& numreg, bool is_annesso, const TString& catannpadre, const TString& catdocann);
|
||||
void open_config_win();
|
||||
@ -271,43 +284,56 @@ bool TGestione_doc_cartacei_f9_msk::on_field_event(TOperable_field& o, TField_ev
|
||||
return true;
|
||||
}
|
||||
|
||||
void TGestione_doc_cartacei_f9_msk::check_addr_cart()
|
||||
{
|
||||
const TFilename f(_addr_cart);
|
||||
if (f.full() && !f.exist())
|
||||
{
|
||||
warning_box("Cartella documenti cartacei non trovata.\nSalvare nuovamente le impostazioni.");
|
||||
open_config_win();
|
||||
}
|
||||
}
|
||||
|
||||
void TGestione_doc_cartacei_f9_msk::check_deleted()
|
||||
{
|
||||
// Controllo che non ci siano file nella cartella eliminati da piu' di un mese, altrimenti li elimino
|
||||
TString_array result;
|
||||
TFilename addr_cart(get_addr_cart());
|
||||
|
||||
addr_cart << "eliminati";
|
||||
if (dexist(addr_cart))
|
||||
TFilename s; s << TFilename(F9CONF.get_addr_cart()).slash_terminate() << "eliminati\\";
|
||||
if (s.exist())
|
||||
{
|
||||
list_files(addr_cart, result);
|
||||
FOR_EACH_ARRAY_ITEM(result, nr, obj)
|
||||
list_files(s, result);
|
||||
FOR_EACH_ARRAY_ITEM(result, nr, file)
|
||||
{
|
||||
TString & file = (TString &)*obj;
|
||||
|
||||
time_t at = atime(file);
|
||||
time_t ct = ctime(file);
|
||||
time_t mt = mtime(file);
|
||||
struct tm * atm = altime(file);
|
||||
struct tm * ctm = cltime(file);
|
||||
struct tm * mtm = mltime(file);
|
||||
TDate ad = aldate(file);
|
||||
TDate cd = cldate(file);
|
||||
TDate md = mldate(file);
|
||||
|
||||
if (md.month() < today.month() - 1 ||
|
||||
md.month() == today.month() - 1 && md.day() <= today.day())
|
||||
|
||||
remove_file(file);
|
||||
const char* deletedfile = *(TString*)(file);
|
||||
HANDLE h_file = CreateFile(deletedfile, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
FILETIME last_access_time;
|
||||
SYSTEMTIME time;
|
||||
bool flag = false;
|
||||
if (h_file != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
if (GetFileTime(h_file, NULL, &last_access_time, NULL))
|
||||
{
|
||||
FileTimeToSystemTime(&last_access_time, &time);
|
||||
TDate today = TDate(TODAY);
|
||||
if (time.wMonth < (unsigned short)today.month() - 1 ||
|
||||
time.wMonth == (unsigned short)today.month() - 1 && time.wDay <= (unsigned short)today.day())
|
||||
{
|
||||
flag = true;
|
||||
CloseHandle(h_file);
|
||||
DeleteFile(deletedfile);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!flag)
|
||||
CloseHandle(h_file);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool TGestione_doc_cartacei_f9_msk::check_file_exist(const TString& file) const
|
||||
{
|
||||
TFilename path(get_addr_cart());
|
||||
|
||||
path.add(file);
|
||||
TFilename path(_addr_cart);
|
||||
path.slash_terminate() << file;
|
||||
return path.exist();
|
||||
}
|
||||
|
||||
@ -336,18 +362,18 @@ void TGestione_doc_cartacei_f9_msk::delete_file()
|
||||
f9annessi.put(F9A_FILENAME, filename);
|
||||
f9annessi.read();
|
||||
}
|
||||
TFilename filecart(get_addr_cart());
|
||||
TFilename filecart(F9CONF.get_addr_cart());
|
||||
filecart.slash_terminate();
|
||||
TFilename deleted(filecart);
|
||||
|
||||
filecart << filename;
|
||||
deleted << "eliminati" << SLASH;
|
||||
if (!deleted.exist())
|
||||
make_dir(deleted);
|
||||
deleted << filename;
|
||||
if (deleted.exist())
|
||||
remove_file(deleted);
|
||||
DeleteFile(deleted);
|
||||
// Se il file non esiste vuol dire che sto cercando di rimuovere un record che non ha il file nella cartella dei cartacei quindi non mi lamento.
|
||||
if (filecart.exist() && !fmove(filecart, deleted))
|
||||
if (filecart.exist() && !MoveFile(filecart, deleted))
|
||||
warning_box(TString("Attenzione:") << " non e' stato possibile rimuovere questo file: " << filecart);
|
||||
|
||||
if (p == 0)
|
||||
@ -571,23 +597,33 @@ void TGestione_doc_cartacei_f9_msk::fill_docs()
|
||||
|
||||
TToken_string& TGestione_doc_cartacei_f9_msk::get_valid_extensions()
|
||||
{
|
||||
TToken_string & ext = get_tmp_string(128);
|
||||
|
||||
ext.separator(',');
|
||||
ext = get_estensioni();
|
||||
static TToken_string ext(F9CONF.get_estensioni(), ',');
|
||||
if (ext.items() == 0)
|
||||
{
|
||||
ext = ".pdf, .doc, .docx, .xls, .xlsx, .jpg, .jpeg, .png";
|
||||
set_estensioni(ext);
|
||||
F9CONF.set_estensioni(ext);
|
||||
}
|
||||
ext.strip_spaces();
|
||||
ext.replace(" ", "");
|
||||
return ext;
|
||||
}
|
||||
|
||||
void TGestione_doc_cartacei_f9_msk::load_extensions()
|
||||
{
|
||||
if (_extensions.items() == 0)
|
||||
_extensions.tok2arr(get_valid_extensions());
|
||||
if (_extensions == nullptr)
|
||||
{
|
||||
_extensions = std::make_unique<std::set<TString>>();
|
||||
TToken_string& ext = get_valid_extensions();
|
||||
for (int i = 0; i < ext.items(); ++i)
|
||||
{
|
||||
TString e = ext.get(i);
|
||||
if (!e.empty())
|
||||
{
|
||||
if (e.starts_with("."))
|
||||
e.ltrim(1);
|
||||
_extensions->insert(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool TGestione_doc_cartacei_f9_msk::load_file(const TFilename& file, const TString& numreg, const bool is_annesso,
|
||||
@ -598,31 +634,64 @@ bool TGestione_doc_cartacei_f9_msk::load_file(const TFilename& file, const TStri
|
||||
|
||||
void TGestione_doc_cartacei_f9_msk::open_config_win()
|
||||
{
|
||||
TMask config_msk("Configurazione", 1, 78, 14);
|
||||
|
||||
// Creazione maschera
|
||||
config_msk.add_button_tool(DLG_OK, "Conferma", TOOL_OK);
|
||||
config_msk.add_button_tool(DLG_NULL, "", 0);
|
||||
config_msk.add_button_tool(DLG_QUIT, "Esci", TOOL_QUIT);
|
||||
config_msk.add_groupbox(DLG_NULL, 0, "@BCartella documenti cartacei", 1, 0, 76, 4);
|
||||
config_msk.add_static(DLG_NULL, 0, "@BInserire nome cartella, all'interno della area dati della ditta", 2, 1);
|
||||
config_msk.add_string(101, 0, "", 2, 2, 64, "", 30);
|
||||
config_msk.add_groupbox(DLG_NULL, 0, "", 1, 4, 76, 4, "");
|
||||
config_msk.add_static(DLG_NULL, 0, "@BInserire estensioni file riconosciute, separate da virgola.", 2, 5);
|
||||
config_msk.add_string(102, 0, "Estensioni:", 2, 6, 255, "", 60);
|
||||
config_msk.set(101, get_addr_cart());
|
||||
config_msk.set(102, get_estensioni());
|
||||
if(_config_msk == nullptr)
|
||||
{
|
||||
_config_msk = std::make_unique<TMask>("Configurazione", 1, 78, 14);
|
||||
_config_msk->add_button_tool(DLG_OK, "Conferma", TOOL_OK);
|
||||
_config_msk->add_button_tool(DLG_NULL, "", 0);
|
||||
_config_msk->add_button_tool(DLG_QUIT, "Esci", TOOL_QUIT);
|
||||
|
||||
_config_msk->add_groupbox(DLG_NULL, 0, "@BCartella documenti cartacei", 1, 0, 76, 4);
|
||||
_config_msk->add_static (DLG_NULL, 0, "@BInserire nome cartella, all'interno della area dati della ditta", 2, 1);
|
||||
_config_msk->add_string (102, 0, "", 2, 2, 64, "", 30);
|
||||
_config_msk->add_groupbox(DLG_NULL, 0, "", 1, 4, 76, 4, "");
|
||||
_config_msk->add_static (DLG_NULL, 0, "@BInserire estensioni file riconosciute, separate da virgola.", 2, 5);
|
||||
_config_msk->add_string (101, 0, "Estensioni:", 2, 6, 255, "", 60);
|
||||
|
||||
_config_msk->set(101, F9CONF.get_estensioni());
|
||||
TString s = F9CONF.get_addr_cart();
|
||||
s.rtrim(1);
|
||||
s.ltrim(s.rfind('\\') + 1);
|
||||
_config_msk->set(102, s);
|
||||
}
|
||||
|
||||
// Esecuzione maschera
|
||||
while (config_msk.run() == K_ENTER)
|
||||
while (true)
|
||||
{
|
||||
set_addr_cart(config_msk.get(101));
|
||||
set_estensioni(config_msk.get(102));
|
||||
if (config_msk.get(101).empty())
|
||||
if (_config_msk->run() != K_ENTER)
|
||||
{
|
||||
warning_box("Si prega di inserire il nome della cartella per i documenti cartacei.");
|
||||
continue;
|
||||
if (_config_msk->get(102).empty())
|
||||
{
|
||||
warning_box("Si prega di inserire il nome della cartella per i documenti cartacei.");
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
F9CONF.set_estensioni(_config_msk->get(101));
|
||||
TString dir = _config_msk->get(102);
|
||||
if (dir.empty())
|
||||
{
|
||||
if(yesno_box("Nome cartella vuoto.\nCreare cartella con nome 'Cartacei_F9'?"))
|
||||
_config_msk->set(102, dir = "Cartacei_F9");
|
||||
else continue;
|
||||
}
|
||||
|
||||
TFilename path(prefix().get_studio());
|
||||
path.add(dir).slash_terminate();
|
||||
if (!path.exist())
|
||||
{
|
||||
if (dir == "Cartacei_F9" || yesno_box("Il percorso indicato e' inesistente.\nCreare la cartella con questo nome?"))
|
||||
{
|
||||
if (!make_dir(path))
|
||||
{
|
||||
warning_box("Impossibile creare il percorso specificato.");
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else continue;
|
||||
}
|
||||
F9CONF.set_addr_cart(path);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -634,18 +703,16 @@ void TGestione_doc_cartacei_f9_msk::open_import_win()
|
||||
while(_import_msk->run() == K_ENTER)
|
||||
{
|
||||
const TString& file = _import_msk->get(F_IMPADDRESS);
|
||||
|
||||
const TString& numreg = _import_msk->get(F_IMPNUMREG);
|
||||
const bool is_annesso = _import_msk->get_bool(F_ISANNESSO);
|
||||
const TString& catannpadre = _import_msk->get(F_CATANNPADRE);
|
||||
const TString& catdocann = _import_msk->get(F_CATDOCANN);
|
||||
if (!file.empty())
|
||||
{
|
||||
const long numreg = _import_msk->get_long(F_IMPNUMREG);
|
||||
const bool is_annesso = _import_msk->get_bool(F_ISANNESSO);
|
||||
const TString& catannpadre = _import_msk->get(F_CATANNPADRE);
|
||||
const TString& catdocann = _import_msk->get(F_CATDOCANN);
|
||||
TFilename f(file);
|
||||
|
||||
if (verify_extension(f))
|
||||
{
|
||||
if(numreg != 0L)
|
||||
if(!numreg.empty())
|
||||
{
|
||||
if (!is_annesso || catannpadre.full() && catdocann.full())
|
||||
{
|
||||
@ -665,7 +732,7 @@ void TGestione_doc_cartacei_f9_msk::open_import_win()
|
||||
warning_box("Questo file e' in un formato non accettato.");
|
||||
}
|
||||
else
|
||||
warning_box("");
|
||||
warning_box("Si prega di inserire il nome del file.");
|
||||
}
|
||||
fill();
|
||||
}
|
||||
@ -684,20 +751,26 @@ void TGestione_doc_cartacei_f9_msk::remove_file_from_f9cart(const std::set<TStri
|
||||
|
||||
bool TGestione_doc_cartacei_f9_msk::verify_extension(const TFilename& file)
|
||||
{
|
||||
return _extensions.find(file.ext()) >= 0;
|
||||
load_extensions();
|
||||
return _extensions->find(file.ext()) != _extensions->end();
|
||||
}
|
||||
|
||||
TGestione_doc_cartacei_f9_msk::TGestione_doc_cartacei_f9_msk(): TAutomask("f90300a")
|
||||
TGestione_doc_cartacei_f9_msk::TGestione_doc_cartacei_f9_msk(): TAutomask("f90300a"), _addr_cart(F9CONF.get_addr_cart())
|
||||
{
|
||||
if (get_addr_cart(false))
|
||||
if (_addr_cart.empty())
|
||||
{
|
||||
message_box("Inserire nome cartella documenti cartacei.");
|
||||
open_config_win();
|
||||
}
|
||||
else
|
||||
check_addr_cart();
|
||||
check_deleted();
|
||||
fill();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// TGestione_doc_cartacei_f9_app
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -15,9 +15,8 @@ END
|
||||
STRING F_IMPADDRESS 255 64
|
||||
BEGIN
|
||||
PROMPT 2 2 "Apri: "
|
||||
WARNING "Inserire il nome di un file esistente"
|
||||
FSELECT ""
|
||||
FLAG "BR"
|
||||
FLAG "B"
|
||||
END
|
||||
|
||||
NUMBER F_IMPNUMREG 7
|
||||
@ -40,14 +39,12 @@ END
|
||||
BOOLEAN F_ISANNESSO
|
||||
BEGIN
|
||||
PROMPT 2 4 "Annesso"
|
||||
MESSAGE FALSE CLEAR,F_CATANNPADRE
|
||||
MESSAGE TRUE ENABLE,F_CATANNPADRE
|
||||
END
|
||||
|
||||
STRING F_CATANNPADRE 10
|
||||
BEGIN
|
||||
PROMPT 2 5 "Cat.doc. padre"
|
||||
FLAGS "DR"
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CATDOCANN 10
|
||||
|
@ -15,9 +15,11 @@ class TF9_test_app : public TSkeleton_application
|
||||
{
|
||||
public:
|
||||
void main_loop() override;
|
||||
TF9_test_app() {};
|
||||
TF9_test_app() = default;
|
||||
};
|
||||
|
||||
|
||||
|
||||
void TF9_test_app::main_loop()
|
||||
{
|
||||
TLocalisamfile f(LF_F9ANNESSI);
|
||||
@ -40,17 +42,14 @@ void TF9_test_app::main_loop()
|
||||
TF9_doccart d;
|
||||
TString_array sa;
|
||||
//CHECK(d.mov2listann(search_numreg, sa) && sa.items() == 2, "COSA STAI LEGGENDO??");
|
||||
|
||||
FOR_EACH_ARRAY_ITEM(sa, nr, file)
|
||||
{
|
||||
TString namefile = (*(TToken_string*)file).get(1);
|
||||
TLocalisamfile ann(LF_F9ANNESSI);
|
||||
|
||||
ann.put(F9A_NUMREG, search_numreg);
|
||||
ann.put(F9A_FILENAME, namefile);
|
||||
CHECK(ann.read() == NOERR, "Non esiste questo numreg??");
|
||||
filename = ann.get(F9A_FILENAME);
|
||||
|
||||
TString rec; rec <<
|
||||
filename << "\n" <<
|
||||
ann.get(F9A_NUMREG) << "\n" <<
|
||||
@ -58,7 +57,6 @@ void TF9_test_app::main_loop()
|
||||
ann.get(F9A_CATDOCANN) << "\n" <<
|
||||
ann.get(F9A_LOADDATE) << "\n" <<
|
||||
ann.get(F9A_USER);
|
||||
|
||||
CHECK(filename == "annmid.pdf" || filename == "annmid2.pdf", "YOU'RE WRONG");
|
||||
//message_box(rec);
|
||||
}
|
||||
@ -68,169 +66,155 @@ void TF9_test_app::main_loop()
|
||||
if (noyes_box("Attenzione: procedere all'eliminazione e caricamento di categorie documentali e annessi di prova?"))
|
||||
{
|
||||
TCategorie_doc preload;
|
||||
|
||||
preload.remove_all();
|
||||
preload.reload();
|
||||
preload.add_categoria("FATTACQ", "FATTURE DI ACQUISTI", "FTA", "TD01", "", "FA");
|
||||
preload.add_categoria("FATTVEN", "FATTURE DI VENDITA", "FTV", "TD01", "", "FV");
|
||||
preload.add_categoria("NOTCREDACQ", "Nota credito di acquisto", "FTA", "TD04", "", "NC");
|
||||
preload.add_categoria("NOTDEBVEN", "Nota debito di vendita", "FTV", "TD05", "", "ND");
|
||||
preload.add_categoria("FATTCORR", "Fattura corrispettivi", "FTA", "TD01", "", "CR");
|
||||
preload.add_categoria("ACQREV", "Fattura acq. con rev. charge", "FTA", "TD01", "052", "FA");
|
||||
preload.add_categoria("FATTACQ", "FATTURE DI ACQUISTI", "FTA", "TD01", "", "FA");
|
||||
preload.add_categoria("FATTVEN", "FATTURE DI VENDITA", "FTV", "TD01", "", "FV");
|
||||
preload.add_categoria("NOTCREDACQ", "Nota credito di acquisto", "FTA", "TD04", "", "NC");
|
||||
preload.add_categoria("NOTDEBVEN", "Nota debito di vendita", "FTV", "TD05", "", "ND");
|
||||
preload.add_categoria("FATTCORR", "Fattura corrispettivi", "FTA", "TD01", "", "CR");
|
||||
preload.add_categoria("ACQREV", "Fattura acq. con rev. charge", "FTA", "TD01", "052", "FA");
|
||||
|
||||
preload.add_annesso("FATTACQ", "GENACQ", "Annesso generico acq", "DC");
|
||||
preload.add_annesso("FATTVEN", "GENVEN", "Annesso gen. ven.", "DC");
|
||||
preload.add_annesso("ACQREV", "INTREVC", "Prosp. integr. rev.ch.", "RC", true);
|
||||
preload.add_annesso("FATTACQ", "LEASING", "Annesso leasing", "DC");
|
||||
preload.add_annesso("FATTACQ", "GENACQ", "Annesso generico acq", "DC");
|
||||
preload.add_annesso("FATTVEN", "GENVEN", "Annesso gen. ven.", "DC");
|
||||
preload.add_annesso("ACQREV", "INTREVC", "Prosp. integr. rev.ch.", "RC", true);
|
||||
preload.add_annesso("FATTACQ", "LEASING", "Annesso leasing", "DC");
|
||||
|
||||
TString_array sa;
|
||||
CHECK(preload.get_array_rows().items() > 0, "Errore aggiunta o caricamento categorie documentali.");
|
||||
TCategorie_doc::annesso annesso;
|
||||
if (preload.get_ann("GENACQ", annesso))
|
||||
{ }
|
||||
TCategorie_doc::classe_doc get_classe_doc_right{ "ACQREV", "Fattura acq. con rev. charge", "FTA", "TD01", "052", "FA" };
|
||||
std::shared_ptr<TCategorie_doc::classe_doc> get_classe_doc = preload.get_classe_doc("ACQREV");
|
||||
CHECK(get_classe_doc->catdoc == get_classe_doc_right.catdoc &&
|
||||
get_classe_doc->descr == get_classe_doc_right.descr &&
|
||||
get_classe_doc->class_sost == get_classe_doc_right.class_sost &&
|
||||
get_classe_doc->caus_sost == get_classe_doc_right.caus_sost &&
|
||||
get_classe_doc->causcont == get_classe_doc_right.causcont &&
|
||||
get_classe_doc->tipocaus == get_classe_doc_right.tipocaus, "get_classe_doc failed"
|
||||
);
|
||||
std::set<TString> get_name_catdocs = preload.get_name_catdocs();
|
||||
CHECK(get_name_catdocs.find("FATTACQ") != get_name_catdocs.end() &&
|
||||
get_name_catdocs.find("FATTVEN") != get_name_catdocs.end() &&
|
||||
get_name_catdocs.find("NOTCREDACQ") != get_name_catdocs.end() &&
|
||||
get_name_catdocs.find("NOTDEBVEN") != get_name_catdocs.end() &&
|
||||
get_name_catdocs.find("FATTCORR") != get_name_catdocs.end() &&
|
||||
get_name_catdocs.find("ACQREV") != get_name_catdocs.end(), "Get catdocs failed"
|
||||
);
|
||||
std::shared_ptr<TCategorie_doc::classe_doc> mov2cat = preload.mov2cat(95752);
|
||||
CHECK(mov2cat, "mov2cat failed: classe doc is null");
|
||||
mov2cat = preload.mov2cat(96955); // Rev. charge causale 052
|
||||
CHECK(mov2cat->causcont == "052", "Error retriving cat.doc. from numreg for causale.");
|
||||
|
||||
preload.get_array_rows(sa);
|
||||
CHECK(sa.items() > 0, "Errore aggiunta o caricamento categorie documentali.");
|
||||
const TString cat_selected = "FATTACQ";
|
||||
TCategorie_doc catdoc;
|
||||
std::shared_ptr<TArray_sheet> annessi = catdoc.get_sheet_ann(cat_selected);
|
||||
CHECK(annessi->items() == 2, "TCategorie_doc::get_sheet_ann() failed: retrived %d elements instead of 2", (int)annessi->items());
|
||||
|
||||
TAnnesso annesso;
|
||||
std::shared_ptr<TArray_sheet> sheet_catdocs = catdoc.get_sheet_catdocs();
|
||||
CHECK(sheet_catdocs->items() == 6, "TCategorie_doc::get_sheet_catdocs() failed: retrived %d elements instead of 6", (int)sheet_catdocs->items());
|
||||
|
||||
if (preload.get_annesso("ACQREV", annesso))
|
||||
|
||||
TRecord_categorie rec(TRecord_categorie::catdocs);
|
||||
TRecord_categorie rec2(TRecord_categorie::annessi);
|
||||
rec.put("NAME", "FATTACQ");
|
||||
rec.read();
|
||||
TString name = rec.get("NAME");
|
||||
TString descr = rec.get("DESCR");
|
||||
TString classdo = rec.get("CLASSDOCSOS");
|
||||
TString caussos = rec.get("CAUSSOS");
|
||||
TString causcon = rec.get("CAUSCONT");
|
||||
TString tipodoc = rec.get("TIPODOC");
|
||||
CHECK(name == "FATTACQ" && descr.starts_with("FATTURE") && classdo == "FTA" && caussos == "TD01"&& causcon.blank() && tipodoc == "FA", "TRecord_categorie failed to retrieve FATTACQ");
|
||||
rec2.put("CATDOC", "FATTACQ");
|
||||
bool ok = rec2.read();
|
||||
CHECK(ok, "TRecord_categorie (annessi) failed to retrieve annessi FATTACQ");
|
||||
for (; ok; ok = rec2.next())
|
||||
{
|
||||
TClasse_doc get_classe_doc_right("ACQREV", "Fattura acq. con rev. charge", "FTA", "TD01", "052", "FA");
|
||||
TClasse_doc * get_classe_doc = preload.get_classe_doc("ACQREV");
|
||||
|
||||
CHECK(get_classe_doc->catdoc() == get_classe_doc_right.catdoc() &&
|
||||
get_classe_doc->descr() == get_classe_doc_right.descr() &&
|
||||
get_classe_doc->class_sost() == get_classe_doc_right.class_sost() &&
|
||||
get_classe_doc->caus_sost() == get_classe_doc_right.caus_sost() &&
|
||||
get_classe_doc->caus_cont() == get_classe_doc_right.caus_cont() &&
|
||||
get_classe_doc->tipo_caus() == get_classe_doc_right.tipo_caus(), "get_classe_doc failed"
|
||||
);
|
||||
|
||||
const TString_array & get_name_catdocs = preload.get_name_catdocs();
|
||||
|
||||
CHECK(get_name_catdocs.find("FATTACQ") >= 0 &&
|
||||
get_name_catdocs.find("FATTVEN") >= 0 &&
|
||||
get_name_catdocs.find("NOTCREDACQ") >= 0 &&
|
||||
get_name_catdocs.find("NOTDEBVEN") >= 0 &&
|
||||
get_name_catdocs.find("FATTCORR") >= 0 &&
|
||||
get_name_catdocs.find("ACQREV") >= 0, "Get catdocs failed");
|
||||
|
||||
TClasse_doc * mov2cat = preload.mov2cat(95752L);
|
||||
|
||||
CHECK(mov2cat, "mov2cat failed: classe doc is null");
|
||||
mov2cat = preload.mov2cat(96955L); // Rev. charge causale 052
|
||||
CHECK(mov2cat->caus_cont() == "052", "Error retriving cat.doc. from numreg for causale.");
|
||||
|
||||
const TString cat_selected = "FATTACQ";
|
||||
TCategorie_doc catdoc;
|
||||
const TArray_sheet * annessi = catdoc.get_sheet_ann(cat_selected);
|
||||
|
||||
CHECK(annessi->items() == 2, format(FR("TCategorie_doc::get_sheet_ann() failed: retrived %d elements instead of 2"), annessi->items()));
|
||||
|
||||
const TArray_sheet & sc = catdoc.get_sheet_catdocs();
|
||||
|
||||
CHECK(sc.items() == 6, format(FR("TCategorie_doc::get_sheet_catdocs() failed: retrived %d elements instead of 6"), sc.items()));
|
||||
|
||||
|
||||
TRecord_categorie rec(TRecord_categorie::catdocs);
|
||||
TRecord_categorie rec2(TRecord_categorie::annessi);
|
||||
rec.put("NAME", "FATTACQ");
|
||||
rec.read();
|
||||
TString name = rec.get("NAME");
|
||||
TString descr = rec.get("DESCR");
|
||||
TString classdo = rec.get("CLASSDOCSOS");
|
||||
TString caussos = rec.get("CAUSSOS");
|
||||
TString causcon = rec.get("CAUSCONT");
|
||||
TString tipodoc = rec.get("TIPODOC");
|
||||
CHECK(name == "FATTACQ" && descr.starts_with("FATTURE") && classdo == "FTA" && caussos == "TD01"&& causcon.blank() && tipodoc == "FA", "TRecord_categorie failed to retrieve FATTACQ");
|
||||
rec2.put("CATDOC", "FATTACQ");
|
||||
bool ok = rec2.read();
|
||||
CHECK(ok, "TRecord_categorie (annessi) failed to retrieve annessi FATTACQ");
|
||||
for (; ok; ok = rec2.next())
|
||||
{
|
||||
TString s_catdoc = rec2.get("CATDOC");
|
||||
TString s_name = rec2.get("NAME");
|
||||
TString s_descr = rec2.get("DESCR");
|
||||
TString s_tipoann = rec2.get("TIPOANN");
|
||||
bool s_obblig = rec2.get("OBBLIG") == "X";
|
||||
CHECK(s_catdoc == "FATTACQ" && s_tipoann == "DC" && !s_obblig && (s_name == "GENACQ" && s_descr.starts_with("Annesso generico") ||
|
||||
s_name == "LEASING" && s_descr.starts_with("Annesso lea")),
|
||||
"TRecord_categorie (annessi) failed to retrive annessi FATTACQ");
|
||||
}
|
||||
TString s_catdoc = rec2.get("CATDOC");
|
||||
TString s_name = rec2.get("NAME");
|
||||
TString s_descr = rec2.get("DESCR");
|
||||
TString s_tipoann = rec2.get("TIPOANN");
|
||||
bool s_obblig = rec2.get("OBBLIG") == "X";
|
||||
CHECK(s_catdoc == "FATTACQ" && s_tipoann == "DC" && !s_obblig && (s_name == "GENACQ" && s_descr.starts_with("Annesso generico") ||
|
||||
s_name == "LEASING" && s_descr.starts_with("Annesso lea")),
|
||||
"TRecord_categorie (annessi) failed to retrive annessi FATTACQ");
|
||||
}
|
||||
|
||||
if (false)
|
||||
{
|
||||
TF9_doccart doccart;
|
||||
TString old_numreg; old_numreg << 95752;
|
||||
TFilename doc;
|
||||
TString_array list_annessi;
|
||||
vector<annesso_t> vect_annessi;
|
||||
//TFilename f_doc; f_doc << "asd";
|
||||
//bool annesso;
|
||||
//bool doc_ae = doccart.doc_already_exists(f_doc, old_numreg, annesso);
|
||||
bool movdoc = doccart.mov2doc(old_numreg, doc);
|
||||
TString msg("Error retriving filename from reg n. "); msg << old_numreg;
|
||||
CHECK(movdoc && TString(doc.name()) == "ve1300_F01_0000000011_0002237.pdf", (const char*)msg);
|
||||
|
||||
old_numreg.cut(0) << 95222; // Doppio annesso
|
||||
bool movann = doccart.mov2listann(old_numreg, list_annessi);
|
||||
//CHECK(movann && list_annessi.items() == 2, "Error retriving list annessi from numreg %s", (const char*)old_numreg);
|
||||
bool movannvect = doccart.mov2listann_vect(old_numreg, vect_annessi);
|
||||
//CHECK(movannvect && vect_annessi.size() == 2, "Error retriving vector annessi from numreg %s", (const char*)old_numreg);
|
||||
|
||||
|
||||
/*TCategorie_doc::annesso annesso;
|
||||
annesso.catdoc = "INTEGREV";
|
||||
annesso.catdocpadre = "FATTREV";
|
||||
annesso.descr = "Integrazione Rev. Charge";
|
||||
annesso.opcee = "RC";
|
||||
annesso.obblig = true;
|
||||
TEstrazione::make_prosp_int_revc(96951, annesso);*/
|
||||
}
|
||||
|
||||
if (false)
|
||||
{
|
||||
TF9Prospetto_integr prosp;
|
||||
if (prosp("96951", "96952"))
|
||||
{
|
||||
TFilename tmp; tmp.tempdir();
|
||||
tmp.add(prosp.filename().name());
|
||||
tmp.ext("pdf");
|
||||
#ifndef DBG
|
||||
bool exp = prosp.export_pdf(tmp);
|
||||
#else
|
||||
bool exp = prosp.preview();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
TLocalisamfile clifo(LF_CLIFO);
|
||||
clifo.put(CLI_TIPOCF, "C");
|
||||
clifo.put(CLI_CODCF, 230);
|
||||
int iss = clifo.read();
|
||||
TString statopaiv;
|
||||
TString idfisc;
|
||||
TString paiv;
|
||||
TString codfisc;
|
||||
TAnnesso a;
|
||||
TCategorie_doc categorie_doc;
|
||||
|
||||
if (categorie_doc.get_annesso("INTREVC", a))
|
||||
{
|
||||
TFilename path("c:/u/dati/");
|
||||
TEstrazione e(get_ambiente(), true, 'A', EMPTY_STRING, get_addr_cart(), false, path);
|
||||
|
||||
e.make_prosp_int_revc(153480, a);
|
||||
}
|
||||
|
||||
TString s = TEstrai_mask::get_numdoc_exp_fp(105396);
|
||||
|
||||
message_box("TESTS COMPLETELY SUCCESSFUL");
|
||||
}
|
||||
|
||||
if (false)
|
||||
{
|
||||
TF9_doccart doccart;
|
||||
TString old_numreg; old_numreg << 95752;
|
||||
TFilename doc;
|
||||
TString_array list_annessi;
|
||||
vector<annesso_t> vect_annessi;
|
||||
//TFilename f_doc; f_doc << "asd";
|
||||
//bool annesso;
|
||||
//bool doc_ae = doccart.doc_already_exists(f_doc, old_numreg, annesso);
|
||||
bool movdoc = doccart.mov2doc(old_numreg, doc);
|
||||
TString msg("Error retriving filename from reg n. "); msg << old_numreg;
|
||||
CHECK(movdoc && TString(doc.name()) == "ve1300_F01_0000000011_0002237.pdf", (const char*)msg);
|
||||
|
||||
old_numreg.cut(0) << 95222; // Doppio annesso
|
||||
bool movann = doccart.mov2listann(old_numreg, list_annessi);
|
||||
//CHECK(movann && list_annessi.items() == 2, "Error retriving list annessi from numreg %s", (const char*)old_numreg);
|
||||
bool movannvect = doccart.mov2listann_vect(old_numreg, vect_annessi);
|
||||
//CHECK(movannvect && vect_annessi.size() == 2, "Error retriving vector annessi from numreg %s", (const char*)old_numreg);
|
||||
|
||||
|
||||
/*TCategorie_doc::annesso annesso;
|
||||
annesso.catdoc = "INTEGREV";
|
||||
annesso.catdocpadre = "FATTREV";
|
||||
annesso.descr = "Integrazione Rev. Charge";
|
||||
annesso.opcee = "RC";
|
||||
annesso.obblig = true;
|
||||
TEstrazione::make_prosp_int_revc(96951, annesso);*/
|
||||
}
|
||||
|
||||
if(false)
|
||||
{
|
||||
TF9Prospetto_integr prosp;
|
||||
if (prosp("96951", "96952"))
|
||||
{
|
||||
TFilename tmp; tmp.tempdir();
|
||||
tmp.add(prosp.filename().name());
|
||||
tmp.ext("pdf");
|
||||
#ifndef DBG
|
||||
bool exp = prosp.export_pdf(tmp);
|
||||
#else
|
||||
bool exp = prosp.preview();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
TLocalisamfile clifo(LF_CLIFO);
|
||||
clifo.put(CLI_TIPOCF, "C");
|
||||
clifo.put(CLI_CODCF, 230);
|
||||
int iss = clifo.read();
|
||||
TString statopaiv;
|
||||
TString idfisc;
|
||||
TString paiv;
|
||||
TString codfisc;
|
||||
//TEstrazione::fill_id(clifo, statopaiv, idfisc, paiv, codfisc);
|
||||
|
||||
TCategorie_doc::annesso annesso;
|
||||
TCategorie_doc categorie_doc;
|
||||
if(categorie_doc.get_ann("INTREVC", annesso))
|
||||
TEstrazione::make_prosp_int_revc(153480, annesso);
|
||||
|
||||
TString s = TEstrai_mask::get_numdoc_exp_fp(105396);
|
||||
|
||||
message_box("TESTS COMPLETELY SUCCESSFUL");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int f90400(const int argc, char* argv[])
|
||||
{
|
||||
TF9_test_app test_app;
|
||||
|
||||
test_app.run(argc, argv, "F9 Test Application");
|
||||
return 0;
|
||||
test_app.run(argc, argv, "F9 Test Application");
|
||||
return 0;
|
||||
}
|
||||
|
457
src/f9/f9lib.h
457
src/f9/f9lib.h
@ -17,7 +17,7 @@
|
||||
#define INI_CATDOC "CATDOC"
|
||||
#define INI_ANNESSI "ANNCAT"
|
||||
|
||||
inline bool is_italiano(const TString & statopaiv) { return statopaiv.blank() || statopaiv == "IT"; }
|
||||
#define IS_ITALIANO(statopaiv) ((statopaiv) == "IT" || !(statopaiv).full())
|
||||
|
||||
// Controlla eventuali apostrofi e li raddoppia
|
||||
const char* check_str(const TString& str);
|
||||
@ -92,253 +92,232 @@ enum state_fppro
|
||||
err_read_db = 999 // Errore lettura da fppro
|
||||
};
|
||||
|
||||
const TString & get_ambiente();
|
||||
const TString & get_addr_doc();
|
||||
const TString & get_addr_doc_loc();
|
||||
bool get_has_cartexp();
|
||||
|
||||
const TString & get_addr_cart(bool check = false);
|
||||
const TString & get_estensioni();
|
||||
|
||||
void set_ambiente(const TString& cod_amb);
|
||||
void set_addr_doc(const TString& path);
|
||||
void set_addr_doc_loc(const TString& path);
|
||||
void set_has_cartexp(bool flag);
|
||||
|
||||
void set_addr_cart(const TString& path);
|
||||
void set_estensioni(const TString& ext);
|
||||
|
||||
class TClasse_doc : public TObject
|
||||
class TF9_config
|
||||
{
|
||||
TString _catdoc; // Codice cat. documentale.
|
||||
TString _descr; // Descrizione documento.
|
||||
TString _class_sost; // { FTA | FTV } - classe documentale sostitutiva.
|
||||
TString _caus_sost; // causale per sostitutiva (TD01...).
|
||||
TString _caus_cont; // Codice causale.
|
||||
TString _tipo_caus; // Usato come tipo documento (FA, FV, CR, ...).
|
||||
// todo: controllare che siano sqlsafe
|
||||
// Config in f90100:
|
||||
|
||||
protected :
|
||||
void copy(const TClasse_doc & c);
|
||||
TString _ambiente; // Codice ambiente (codsoc)
|
||||
TString _addr_doc; // Indirizzo documenti cartacei WebApp (Server)
|
||||
TString _addr_doc_loc; // Indirizzo documenti cartacei WebApp (Locale)
|
||||
bool _cartexp;
|
||||
|
||||
// Config in f90300:
|
||||
|
||||
TString _addr_cart; // Indirizzo cartella documenti cartacei
|
||||
TString _estensioni; // Estensioni valide per il caricamenti dei doc. cart.
|
||||
|
||||
public:
|
||||
const TString & catdoc() { return _catdoc; }
|
||||
const TString & descr() { return _descr; }
|
||||
const TString & class_sost() { return _class_sost; }
|
||||
const TString & caus_sost() { return _caus_sost; }
|
||||
const TString & caus_cont() { return _caus_cont; }
|
||||
const TString & tipo_caus() { return _tipo_caus; }
|
||||
const TClasse_doc & operator = (const TClasse_doc & c) { copy(c); return c; }
|
||||
const TString& get_ambiente() const { return _ambiente; }
|
||||
const TString& get_addr_doc() const { return _addr_doc; }
|
||||
const TString& get_addr_doc_loc() const { return _addr_doc_loc; }
|
||||
bool get_has_cartexp() const { return _cartexp; }
|
||||
|
||||
// @cmember Costruttori
|
||||
TClasse_doc() {};
|
||||
TClasse_doc(const char * catdoc, const char * descr,
|
||||
const char * class_sost, const char * caus_sost,
|
||||
const char * caus_cont, const char * tipo_caus)
|
||||
: _catdoc(catdoc), _descr(descr), _class_sost(class_sost),
|
||||
_caus_sost(caus_sost), _caus_cont(caus_cont),
|
||||
_tipo_caus(tipo_caus)
|
||||
{};
|
||||
TClasse_doc(const TClasse_doc & c) { copy(c); }
|
||||
const TString& get_addr_cart() const { return _addr_cart; }
|
||||
const TString& get_estensioni() const { return _estensioni; }
|
||||
|
||||
void set_ambiente(const TString& cod_amb);
|
||||
void set_addr_doc(const TString& path);
|
||||
void set_addr_doc_loc(const TString& path);
|
||||
void set_has_cartexp(bool flag);
|
||||
|
||||
void set_addr_cart(const TString& path);
|
||||
void set_estensioni(const TString& ext);
|
||||
|
||||
TF9_config();
|
||||
};
|
||||
|
||||
class TAnnesso : public TObject
|
||||
extern TF9_config F9CONF;
|
||||
|
||||
class TCategorie_doc
|
||||
{
|
||||
TString _catdoc_padre;
|
||||
TString _catdoc; // Codice cat. documentale.
|
||||
TString _descr; // Descrizione documento.
|
||||
TString _op_cee; // { RV | DC } - Usato come classificazione annesso (Reverse, ann. cartaceo).
|
||||
bool _obblig{ false }; // Definisce se deve essere per forza presente l'annesso.
|
||||
public:
|
||||
struct classe_doc
|
||||
{
|
||||
TString catdoc; // Codice cat. documentale.
|
||||
TString descr; // Descrizione documento.
|
||||
TString class_sost; // { FTA | FTV } - classe documentale sostitutiva.
|
||||
TString caus_sost; // causale per sostitutiva (TD01...).
|
||||
TString causcont; // Codice causale.
|
||||
TString tipocaus; // Usato come tipo documento (FA, FV, CR, ...).
|
||||
};
|
||||
struct annesso
|
||||
{
|
||||
TString catdocpadre;
|
||||
TString catdoc; // Codice cat. documentale.
|
||||
TString descr; // Descrizione documento.
|
||||
TString opcee; // { RV | DC } - Usato come classificazione annesso (Reverse, ann. cartaceo).
|
||||
bool obblig{ false }; // Definisce se deve essere per forza presente l'annesso.
|
||||
};
|
||||
private:
|
||||
std::vector<std::shared_ptr<classe_doc>> _rows;
|
||||
std::vector<std::pair<TString, std::shared_ptr<TArray_sheet>>> _sheets_annessi;
|
||||
std::shared_ptr<TArray_sheet> _sheet_catdocs;
|
||||
std::shared_ptr<std::set<TString>> _name_catdocs;
|
||||
int _mode_sheet;
|
||||
|
||||
std::shared_ptr<classe_doc> find_causcont(const TString& caus); // OK
|
||||
std::shared_ptr<classe_doc> find_tipodoc(const TString& tipodoc); // OK
|
||||
|
||||
std::vector<pair<TString, std::shared_ptr<TArray_sheet>>>::iterator find_sheet_annessi(const TString& catdoc); // OK
|
||||
|
||||
void load_all();
|
||||
void save_ann();
|
||||
void save_cat();
|
||||
|
||||
static const char* traduci_caus_sost(const TString& caus);
|
||||
static const char* traduci_class_ann(const TString& class_ann);
|
||||
static const char* traduci_class_sost(const TString& class_sost);
|
||||
|
||||
protected:
|
||||
void copy(const TAnnesso & a);
|
||||
std::map<TString, annesso> _rows_annessi;
|
||||
|
||||
std::map<TString, annesso>::iterator find_annesso(const TString& catdoc_padre, const char* catdoc_ann);
|
||||
|
||||
public:
|
||||
const TString & catdoc_padre() { return _catdoc_padre; }
|
||||
const TString & catdoc() { return _catdoc; }
|
||||
const TString & descr() { return _descr; }
|
||||
const TString & op_cee() { return _op_cee; }
|
||||
bool & obblig() { return _obblig; }
|
||||
const TAnnesso & operator = (const TAnnesso & a) { copy(a); return a; }
|
||||
void add_annesso(const TString& catdoc_padre, const TString& catdoc_ann, const TString& descr,
|
||||
const TString& class_ann, bool obblig = false);
|
||||
void add_categoria(const TString& catdoc, const TString& descr, const TString& class_sost,
|
||||
const TString& caus_sost, const TString& causcont, const TString& tipocaus);
|
||||
void del_annesso(const TString& catdoc, const char* catdoc_ann);
|
||||
bool get_ann(const TString& catann, _Out_ annesso& _Annesso_out);
|
||||
TString_array get_array_ann(const TString& catdoc);
|
||||
TString_array get_array_rows(bool traduci = false);
|
||||
std::shared_ptr<classe_doc> get_classe_doc(const TString& catdoc);
|
||||
std::set<TString>& get_name_catdocs() { get_sheet_catdocs(); return *_name_catdocs; }
|
||||
std::shared_ptr<TArray_sheet> get_sheet_catdocs();
|
||||
std::shared_ptr<TArray_sheet> get_sheet_ann(const TString& catdoc);
|
||||
std::shared_ptr<classe_doc> mov2cat(int numreg);
|
||||
void reload();
|
||||
static void remove_all();
|
||||
static void remove_all_ann();
|
||||
static void remove_all_cat();
|
||||
void set_mode_sheet(const int mode) { _mode_sheet = mode; }
|
||||
|
||||
// @cmember Costruttori
|
||||
TAnnesso() : _obblig(false) {};
|
||||
TAnnesso(const char * catdoc_padre, const char * catdoc,
|
||||
const char * descr, const char * op_cee, bool obblig = false)
|
||||
: _catdoc_padre(catdoc_padre), _catdoc(catdoc), _descr(descr),
|
||||
_op_cee(op_cee), _obblig(obblig)
|
||||
{};
|
||||
TAnnesso(const TAnnesso & a) { copy(a); }
|
||||
TCategorie_doc();
|
||||
};
|
||||
|
||||
class TCategorie_doc :public TObject
|
||||
class TRecord_categorie : public TCategorie_doc
|
||||
{
|
||||
TAssoc_array _rows;
|
||||
TAssoc_array _sheets_annessi; // Assoc array di Array sheet
|
||||
TArray_sheet _sheet_catdocs;
|
||||
TString_array _name_catdocs;
|
||||
int _mode_sheet;
|
||||
TAssoc_array _rows_annessi; // Assoc array di Assoc_array di Annessi
|
||||
public:
|
||||
enum type { catdocs = 0, annessi = 1 };
|
||||
private:
|
||||
type _table;
|
||||
struct recordtype
|
||||
{
|
||||
TString_array head;
|
||||
TToken_string record;
|
||||
} _categorie, _annessi;
|
||||
TString_array _result_set;
|
||||
int _next_pos{ 0 };
|
||||
|
||||
TClasse_doc * find_causcont(const char * caus) const {return (TClasse_doc *)_rows.objptr(caus); } // OK
|
||||
TClasse_doc * find_tipodoc(const char * tipodoc); // OK
|
||||
TArray_sheet * find_sheet_annessi(const char * catdoc) { return (TArray_sheet *)_sheets_annessi.objptr(catdoc); } // OK
|
||||
public:
|
||||
TString get(const char* field);
|
||||
bool next();
|
||||
void put(const char* field, const char* value);
|
||||
bool read(bool traduci = false);
|
||||
|
||||
void load();
|
||||
void save_ann();
|
||||
void save_cat();
|
||||
TRecord_categorie(type table = catdocs);
|
||||
};
|
||||
|
||||
const char * traduci_caus_sost(const TString& caus);
|
||||
const char * traduci_class_ann(const TString& class_ann);
|
||||
const char * traduci_class_sost(const TString& class_sost);
|
||||
|
||||
protected:
|
||||
TAnnesso * find_annesso(const char * catdoc_padre, const char* catdoc_ann);
|
||||
|
||||
public:
|
||||
void add_annesso(const char * catdoc_padre, const char * catdoc_ann, const char * descr,
|
||||
const char * class_ann, bool obblig = false);
|
||||
void add_categoria(const char * catdoc, const char * descr, const char * class_sost,
|
||||
const char * caus_sost, const char * caus_cont, const char * tipocaus);
|
||||
void del_annesso(const char * catdoc, const char* catdoc_ann);
|
||||
bool get_annesso(const char * catann, TAnnesso & annesso);
|
||||
void get_array_ann(const char * catdoc, TString_array & names);
|
||||
void get_array_rows(TString_array & names,bool traduci = false);
|
||||
TClasse_doc * get_classe_doc(const char * catdoc) { return (TClasse_doc *)_rows.objptr(catdoc); }
|
||||
const TString_array & get_name_catdocs() { get_sheet_catdocs(); return _name_catdocs; }
|
||||
TArray_sheet & get_sheet_catdocs();
|
||||
TArray_sheet * get_sheet_ann(const char * catdoc);
|
||||
TClasse_doc * mov2cat(const long numreg);
|
||||
void reload() { load(); }
|
||||
static void remove_all();
|
||||
static void remove_all_ann();
|
||||
static void remove_all_cat();
|
||||
void set_mode_sheet(const int mode) { _mode_sheet = mode; }
|
||||
|
||||
TCategorie_doc();
|
||||
struct movimento_t
|
||||
{
|
||||
enum err_mov
|
||||
{
|
||||
no_err, // Estratto normalmente.
|
||||
escluso, // Movimento con flag escluso.
|
||||
no_catdoc, // Nessuna cat. doc. riconosciuta per questo movimento, o non e' una fattura.
|
||||
no_doc, // Il mov. di vendita non ha un documento generatore.
|
||||
notfound_elet, // Non trovata fatt. elettronica mov vendita.
|
||||
no_fa, // Movimento di acquisto non e' una fattura.
|
||||
no_fv, // Movimento di vendita non e' una fattura.
|
||||
no_cartaceo, // Movimento cartaceo che non ha bisogno di essere estratto.
|
||||
pura_iva, // Movimento di sola IVA (integrazione Rev. Charge)
|
||||
no_filecart, // Il documento cartaceo non ha associato un file, o questo non e' stato trovato.
|
||||
annesso_nexist // Un annesso obbligatorio e' mancante.
|
||||
};
|
||||
|
||||
class TRecord_categorie : public TCategorie_doc
|
||||
bool err{ false };
|
||||
int numreg;
|
||||
TDate datareg;
|
||||
TDate datadoc;
|
||||
TString codcaus;
|
||||
int meseliq;
|
||||
TString numdoc;
|
||||
real tot;
|
||||
int codcf;
|
||||
TString ragsoc;
|
||||
TString reg_protiva;
|
||||
TString descr;
|
||||
state_fppro state{ null_state };
|
||||
TString descr_err{}; // Messaggio di errore visibile dal controllo estrazione.
|
||||
bool estratto{ true };
|
||||
err_mov descr_estr{ no_err }; // Messaggio di informazioni visibile dal 'Apri Estr.'
|
||||
std::shared_ptr<TCategorie_doc::classe_doc> catdoc{ nullptr };
|
||||
bool cartaceo{ false };
|
||||
TFilename nomefilecart{};
|
||||
vector<annesso_t> annessi{};
|
||||
|
||||
static const char* err_mov2name(const err_mov descr_estr)
|
||||
{
|
||||
public:
|
||||
enum type { catdocs = 0, annessi = 1 };
|
||||
private:
|
||||
type _table;
|
||||
struct recordtype
|
||||
switch (descr_estr)
|
||||
{
|
||||
TString_array head;
|
||||
TToken_string record;
|
||||
} _categorie, _annessi;
|
||||
TString_array _result_set;
|
||||
int _next_pos{ 0 };
|
||||
case no_err:
|
||||
return "OK";
|
||||
case escluso:
|
||||
return "Il movimento e' segnato come escluso. Saltato.";
|
||||
case no_catdoc:
|
||||
return "Nessuna categoria documentale riconosciuta per questo movimento, o non e' una fattura.";
|
||||
case no_doc:
|
||||
return "Il mov. di vendita non ha un documento generatore";
|
||||
case notfound_elet:
|
||||
return "Non trovata fatt. elettronica mov vendita";
|
||||
case no_fa:
|
||||
return "Questo movimento di acquisto non e' una fattura";
|
||||
case no_fv:
|
||||
return "Movimento di vendita non e' una fattura.";
|
||||
case no_cartaceo:
|
||||
return "Movimento cartaceo che non ha bisogno di essere estratto";
|
||||
case pura_iva:
|
||||
return "Movimento di sola IVA. (Le integrazioni Rev. Charge sono gestite come annessi alle vendite)";
|
||||
case annesso_nexist:
|
||||
return "Un annesso obbligatorio e' mancante.";
|
||||
default: return "";
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
TString get(const char* field);
|
||||
bool next();
|
||||
void put(const char* field, const char* value);
|
||||
bool read(bool traduci = false);
|
||||
|
||||
TRecord_categorie(type table = catdocs);
|
||||
};
|
||||
|
||||
struct movimento_t
|
||||
const char* get_descr_estr() const
|
||||
{
|
||||
enum err_mov
|
||||
{
|
||||
no_err, // Estratto normalmente.
|
||||
escluso, // Movimento con flag escluso.
|
||||
no_catdoc, // Nessuna cat. doc. riconosciuta per questo movimento, o non e' una fattura.
|
||||
no_doc, // Il mov. di vendita non ha un documento generatore.
|
||||
notfound_elet, // Non trovata fatt. elettronica mov vendita.
|
||||
no_fa, // Movimento di acquisto non e' una fattura.
|
||||
no_fv, // Movimento di vendita non e' una fattura.
|
||||
no_cartaceo, // Movimento cartaceo che non ha bisogno di essere estratto.
|
||||
pura_iva, // Movimento di sola IVA (integrazione Rev. Charge)
|
||||
no_filecart, // Il documento cartaceo non ha associato un file, o questo non e' stato trovato.
|
||||
annesso_nexist // Un annesso obbligatorio e' mancante.
|
||||
};
|
||||
return err_mov2name(descr_estr);
|
||||
}
|
||||
|
||||
bool err{ false };
|
||||
int numreg;
|
||||
TDate datareg;
|
||||
TDate datadoc;
|
||||
TString codcaus;
|
||||
int meseliq;
|
||||
TString numdoc;
|
||||
real tot;
|
||||
int codcf;
|
||||
TString ragsoc;
|
||||
TString reg_protiva;
|
||||
TString descr;
|
||||
state_fppro state{ null_state };
|
||||
TString descr_err{}; // Messaggio di errore visibile dal controllo estrazione.
|
||||
bool estratto{ true };
|
||||
err_mov descr_estr{ no_err }; // Messaggio di informazioni visibile dal 'Apri Estr.'
|
||||
TClasse_doc * catdoc{ nullptr };
|
||||
bool cartaceo{ false };
|
||||
TFilename nomefilecart{};
|
||||
vector<annesso_t> annessi{};
|
||||
|
||||
static const char* err_mov2name(const err_mov descr_estr)
|
||||
TString get(const int i) const
|
||||
{
|
||||
TString a;
|
||||
switch (i)
|
||||
{
|
||||
switch (descr_estr)
|
||||
{
|
||||
case no_err:
|
||||
return "OK";
|
||||
case escluso:
|
||||
return "Il movimento e' segnato come escluso. Saltato.";
|
||||
case no_catdoc:
|
||||
return "Nessuna categoria documentale riconosciuta per questo movimento, o non e' una fattura.";
|
||||
case no_doc:
|
||||
return "Il mov. di vendita non ha un documento generatore";
|
||||
case notfound_elet:
|
||||
return "Non trovata fatt. elettronica mov vendita";
|
||||
case no_fa:
|
||||
return "Questo movimento di acquisto non e' una fattura";
|
||||
case no_fv:
|
||||
return "Movimento di vendita non e' una fattura.";
|
||||
case no_cartaceo:
|
||||
return "Movimento cartaceo che non ha bisogno di essere estratto";
|
||||
case pura_iva:
|
||||
return "Movimento di sola IVA. (Le integrazioni Rev. Charge sono gestite come annessi alle vendite)";
|
||||
case annesso_nexist:
|
||||
return "Un annesso obbligatorio e' mancante.";
|
||||
default: return "";
|
||||
}
|
||||
case 0: return err;
|
||||
case 1: return a << numreg;
|
||||
case 2: return (const char*)datareg;
|
||||
case 3: return (const char*)datadoc;
|
||||
case 4: return codcaus;
|
||||
case 5: return a << meseliq;
|
||||
case 6: return numdoc;
|
||||
case 7:
|
||||
a << tot;
|
||||
if (a == "0")
|
||||
a << ".0";
|
||||
return a;
|
||||
case 8: return a << codcf;
|
||||
case 9: return ragsoc;
|
||||
case 10: return reg_protiva;
|
||||
case 11: return descr;
|
||||
case 14: return descr_err;
|
||||
default: return "";
|
||||
}
|
||||
}
|
||||
|
||||
const char* get_descr_estr() const
|
||||
{
|
||||
return err_mov2name(descr_estr);
|
||||
}
|
||||
|
||||
TString get(const int i) const
|
||||
{
|
||||
TString a;
|
||||
|
||||
switch (i)
|
||||
{
|
||||
case 0: return err;
|
||||
case 1: return a << numreg;
|
||||
case 2: return (const char*)datareg;
|
||||
case 3: return (const char*)datadoc;
|
||||
case 4: return codcaus;
|
||||
case 5: return a << meseliq;
|
||||
case 6: return numdoc;
|
||||
case 7:
|
||||
a << tot;
|
||||
if (a == "0")
|
||||
a << ".0";
|
||||
return a;
|
||||
case 8: return a << codcf;
|
||||
case 9: return ragsoc;
|
||||
case 10: return reg_protiva;
|
||||
case 11: return descr;
|
||||
case 14: return descr_err;
|
||||
default: return "";
|
||||
}
|
||||
}
|
||||
|
||||
bool is_cartaceo() const { return false; } // todo
|
||||
bool is_cartaceo() const { return false; } // todo
|
||||
};
|
||||
|
||||
class TEstrazione : public TObject
|
||||
@ -350,18 +329,17 @@ class TEstrazione : public TObject
|
||||
const TString _descr;
|
||||
bool _has_cartacei;
|
||||
TFilename _spotlite_path;
|
||||
TCategorie_doc _doc_cats;
|
||||
|
||||
/** Aggiorna stato estrazione. Utilizzato ad esempio dopo la diagnostica per riportare
|
||||
* il nuovo stato sul db.
|
||||
*/
|
||||
bool update_drd_stato_estr() const;
|
||||
const char* caus_sos(const TLocalisamfile& mov, TipoIVA iva);
|
||||
void check_annessi(movimento_t& mov_i, int numreg); // Controllo se ci sono tutti gli annessi obbligatori.
|
||||
static const char* caus_sos(const TLocalisamfile& mov, TipoIVA iva);
|
||||
static void check_annessi(movimento_t& mov_i, int numreg); // Controllo se ci sono tutti gli annessi obbligatori.
|
||||
// Controllo se esistono tutti gli annessi cartacei obbligatori e se ci sono annessi reverse charge li genero.
|
||||
bool check_annessi_oblig(const TString& catdoc, int numreg, _Out_ TToken_string& ann_nexist);
|
||||
bool check_cartaceo_acq(const movimento_t& movimento);
|
||||
bool check_documento_vendita(const TLocalisamfile& mov, _Out_ bool& exist_doc);
|
||||
static bool check_annessi_oblig(const TString& catdoc, int numreg, _Out_ TToken_string& ann_nexist);
|
||||
static bool check_cartaceo_acq(const movimento_t& movimento);
|
||||
static bool check_documento_vendita(const TLocalisamfile& mov, _Out_ bool& exist_doc);
|
||||
/** CHECK RIFERIMENTO FPPRO
|
||||
* Per le fatture di acquisto controllo se ho il riferimento nell'FPPRO.
|
||||
* Altrimenti cerco di capire se riesco a trovare il corrispondente del movimento
|
||||
@ -385,7 +363,7 @@ class TEstrazione : public TObject
|
||||
bool grab_pdf_from_spotlite(const movimento_t& movimento, TFilename& file) const;
|
||||
|
||||
public:
|
||||
bool make_prosp_int_revc(long numreg, TAnnesso & annesso);
|
||||
static bool make_prosp_int_revc(int numreg, TCategorie_doc::annesso& annesso);
|
||||
|
||||
private:
|
||||
|
||||
@ -402,7 +380,7 @@ private:
|
||||
static bool pura_iva(const TLocalisamfile& mov);
|
||||
void write_errorsql_log(const TString& query) const;
|
||||
|
||||
TCategorie_doc& categorie_doc(bool reload = false);
|
||||
static TCategorie_doc& categorie_doc(bool reload = false);
|
||||
|
||||
public:
|
||||
|
||||
@ -472,7 +450,7 @@ public:
|
||||
void add() { add_str("NULL"); }
|
||||
bool send();
|
||||
static bool del_err(const TString& codsoc, const TString& id_estr, int numreg);
|
||||
static char get_errori(const TString& codsoc, const TString& id_estr, TArray & controllo_mov);
|
||||
static char get_errori(const TString& codsoc, const TString& id_estr, vector<TToken_string>& controllo_mov);
|
||||
TF9_dberr();
|
||||
};
|
||||
|
||||
@ -503,24 +481,23 @@ class TF9_doccart
|
||||
|
||||
public:
|
||||
static bool add_cart(const TFilename& file, const TString& numreg, bool is_annesso = false,
|
||||
const TString& catannpadre = "", const TString& catdocann = "", bool suppress_errors = true);
|
||||
bool doc_already_exists(const TFilename& file, TString& numreg, bool& annesso);
|
||||
bool mov2doc(const TString& numreg, TFilename& doc);
|
||||
bool mov2listann(const TString& numreg, TString_array& list_annessi);
|
||||
bool mov2listann_vect(const TString& numreg, vector<annesso_t>& list_annessi);
|
||||
const TString& catannpadre = "", const TString& catdocann = "", bool suppress_errors = true);
|
||||
bool doc_already_exists(const TFilename& file, _Out_ TString& numreg, _Out_ bool& annesso);
|
||||
bool mov2doc(const TString& numreg, _Out_ TFilename& doc);
|
||||
bool mov2listann(const TString& numreg, _Out_ TString_array& list_annessi);
|
||||
bool mov2listann_vect(const TString& numreg, _Out_ vector<annesso_t>& list_annessi);
|
||||
|
||||
static TString get_full_path_file_cartaceo(const TString& filename)
|
||||
{
|
||||
TString & s = get_tmp_string(256);
|
||||
|
||||
s = get_addr_cart();
|
||||
s << filename;
|
||||
return s;
|
||||
return TString() << TFilename(F9CONF.get_addr_cart()).slash_terminate() << filename;
|
||||
}
|
||||
|
||||
TF9_doccart() : _tdocs(LF_F9DOCS), _tannessi(LF_F9ANNESSI) { }
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// TProspetto_recset
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
@ -555,8 +532,8 @@ class TProspetto_recset final : public TSQL_recordset
|
||||
real _totimponibile;
|
||||
real _totimposta;
|
||||
|
||||
static void format_string(TString& str_out, const TString& str) { str_out.cut(0) << "'" << check_str(str) << "'"; }
|
||||
static void format_string(TString& str_out, const char* str) { format_string(str_out, TString(str)); }
|
||||
static void format_string(TString& str_out, const TString& str) { str_out.cut(0) << "'" << check_str(str) << "'"; }
|
||||
static void format_string(TString& str_out, const char* str) { format_string(str_out, TString(str)); }
|
||||
static void format_string(TString& str_out, const TDate& date) { TString dt; dt << date.date2ansi(); format_string(str_out, dt); }
|
||||
|
||||
void precarica_tabelle();
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,11 +1,9 @@
|
||||
#include <Windows.h>
|
||||
#include <iostream>
|
||||
|
||||
#include "f9lib.h"
|
||||
|
||||
#include <applicat.h>
|
||||
#include <dongle.h>
|
||||
#include <modaut.h>
|
||||
|
||||
#include "applicat.h"
|
||||
#include "docf9.h"
|
||||
#include "annessif9.h"
|
||||
#include "f901tab.h"
|
||||
@ -14,96 +12,62 @@
|
||||
#include "comuni.h"
|
||||
#include "clifo.h"
|
||||
#include "report.h"
|
||||
#include "utility.h"
|
||||
|
||||
#define AMBIENTE "CODSOC" // Codice ambiente (codsoc)
|
||||
#define ADDRCART "ADDRCART"
|
||||
#define ADDRDOC "ADDDOC" // Indirizzo documenti cartacei Server
|
||||
#define ADDRDOCLOC "ADDDOCLOC" // Indirizzo documenti cartacei Locale
|
||||
#define ESTENSIONI "DOCUMENTI_EXT" //
|
||||
#define CARTEXP "CARTEXP" // Flag esporta documenti cartacei
|
||||
#define CHECKVEND "CHECKVEND" // Flag controlli per vendite (quando hai fatt. con Campo)
|
||||
#define VIEWMOV "VIEWMOVPRE" // Flag visualizza movimenti prima di estrarre
|
||||
#define AMBIENTE_F9 "CODSOC" // Codice ambiente (codsoc)
|
||||
#define ADDRCART_F9 "ADDRCART"
|
||||
#define ADDRDOC_F9 "ADDDOC" // Indirizzo documenti cartacei Server
|
||||
#define ADDRDOCLOC_F9 "ADDDOCLOC" // Indirizzo documenti cartacei Locale
|
||||
#define ESTENSIONI_F9 "DOCUMENTI_EXT" //
|
||||
#define CARTEXP_F9 "CARTEXP" // Flag esporta documenti cartacei
|
||||
#define CHECKVEND_F9 "CHECKVEND" // Flag controlli per vendite (quando hai fatt. con Campo)
|
||||
#define VIEWMOV_F9 "VIEWMOVPRE" // Flag visualizza movimenti prima di estrarre
|
||||
|
||||
const TString & get_ambiente()
|
||||
TF9_config F9CONF;
|
||||
|
||||
void TF9_config::set_ambiente(const TString& cod_amb)
|
||||
{
|
||||
return ini_get_string(CONFIG_DITTA, mod2name(F9AUT), AMBIENTE);
|
||||
ini_set_string(CONFIG_DITTA, "F9", AMBIENTE_F9, cod_amb);
|
||||
_ambiente = cod_amb;
|
||||
}
|
||||
|
||||
const TString& get_addr_doc()
|
||||
void TF9_config::set_addr_doc(const TString& path)
|
||||
{
|
||||
return ini_get_string(CONFIG_DITTA, mod2name(F9AUT), ADDRDOC);
|
||||
ini_set_string(CONFIG_DITTA, "F9", ADDRDOC_F9, path);
|
||||
_addr_doc = path;
|
||||
}
|
||||
|
||||
const TString& get_addr_doc_loc()
|
||||
void TF9_config::set_addr_doc_loc(const TString& path)
|
||||
{
|
||||
return ini_get_string(CONFIG_DITTA, mod2name(F9AUT), ADDRDOCLOC);
|
||||
ini_set_string(CONFIG_DITTA, "F9", ADDRDOCLOC_F9, path);
|
||||
_addr_doc_loc = path;
|
||||
}
|
||||
|
||||
bool get_has_cartexp()
|
||||
void TF9_config::set_has_cartexp(const bool flag)
|
||||
{
|
||||
return ini_get_bool(CONFIG_DITTA, mod2name(F9AUT), CARTEXP);
|
||||
ini_set_bool(CONFIG_DITTA, "F9", CARTEXP_F9, flag);
|
||||
_cartexp = flag;
|
||||
}
|
||||
|
||||
const TString & get_addr_cart(bool check)
|
||||
void TF9_config::set_addr_cart(const TString& path)
|
||||
{
|
||||
if (check)
|
||||
{
|
||||
TFilename path(prefix().get_studio());
|
||||
TString & dir = get_tmp_string(256);
|
||||
|
||||
dir = ini_get_string(CONFIG_DITTA, mod2name(F9AUT), ADDRCART, "Cartacei_F9");
|
||||
path.add(dir);
|
||||
if (!dexist(path) && !make_dir(path))
|
||||
warning_box(TR("Impossibile creare la cartella %s."), path);
|
||||
return dir;
|
||||
}
|
||||
else
|
||||
return ini_get_string(CONFIG_DITTA, mod2name(F9AUT), ADDRCART);
|
||||
ini_set_string(CONFIG_DITTA, "F9", ADDRCART_F9, path);
|
||||
_addr_cart = path;
|
||||
}
|
||||
|
||||
const TString & get_estensioni()
|
||||
void TF9_config::set_estensioni(const TString& ext)
|
||||
{
|
||||
return ini_get_string(CONFIG_DITTA, mod2name(F9AUT), ESTENSIONI);
|
||||
ini_set_string(CONFIG_DITTA, "F9", ESTENSIONI_F9, ext);
|
||||
_estensioni = ext;
|
||||
}
|
||||
|
||||
void set_ambiente(const TString& cod_amb)
|
||||
TF9_config::TF9_config()
|
||||
{
|
||||
ini_set_string(CONFIG_DITTA, mod2name(F9AUT), AMBIENTE, cod_amb);
|
||||
}
|
||||
|
||||
void set_addr_doc(const TString& path)
|
||||
{
|
||||
TFilename s(path);
|
||||
|
||||
s.slash_terminate();
|
||||
ini_set_string(CONFIG_DITTA, mod2name(F9AUT), ADDRDOC, s);
|
||||
}
|
||||
|
||||
void set_addr_doc_loc(const TString& path)
|
||||
{
|
||||
TFilename s(path);
|
||||
|
||||
s.slash_terminate();
|
||||
ini_set_string(CONFIG_DITTA, mod2name(F9AUT), ADDRDOCLOC, s);
|
||||
}
|
||||
|
||||
void set_has_cartexp(const bool flag)
|
||||
{
|
||||
ini_set_bool(CONFIG_DITTA, mod2name(F9AUT), CARTEXP, flag);
|
||||
}
|
||||
|
||||
void set_addr_cart(const TString& path)
|
||||
{
|
||||
TFilename s(path);
|
||||
|
||||
s.slash_terminate();
|
||||
ini_set_string(CONFIG_DITTA, mod2name(F9AUT), ADDRCART, s);
|
||||
}
|
||||
|
||||
void set_estensioni(const TString& ext)
|
||||
{
|
||||
ini_set_string(CONFIG_DITTA, mod2name(F9AUT), ESTENSIONI, ext);
|
||||
_ambiente = ini_get_string(CONFIG_DITTA, "F9", AMBIENTE_F9);
|
||||
_addr_cart = ini_get_string(CONFIG_DITTA, "F9", ADDRCART_F9);
|
||||
_addr_doc = ini_get_string(CONFIG_DITTA, "F9", ADDRDOC_F9);
|
||||
_addr_doc_loc = ini_get_string(CONFIG_DITTA, "F9", ADDRDOCLOC_F9);
|
||||
_cartexp = ini_get_bool (CONFIG_DITTA, "F9", CARTEXP_F9);
|
||||
_estensioni = ini_get_string(CONFIG_DITTA, "F9", ESTENSIONI_F9);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
@ -169,13 +133,11 @@ bool TF9_doccart::add_cart(const TFilename& file, const TString& numreg, const b
|
||||
f9annessi.put(F9C_LOADDATE, TDate(TODAY));
|
||||
f9annessi.put(F9C_USER, user());
|
||||
}
|
||||
TFilename fdestin = get_addr_cart();
|
||||
const TString filename = file.name(); fdestin << filename;
|
||||
bool ok = !fdestin.exist();
|
||||
|
||||
if (ok)
|
||||
ok = fcopy(file, fdestin, true);
|
||||
else
|
||||
TFilename fdestin = F9CONF.get_addr_cart();
|
||||
const TString filename = file.name();
|
||||
fdestin << filename;
|
||||
const bool ok = CopyFile(file, fdestin, true);
|
||||
if (!ok)
|
||||
{
|
||||
if (!suppress_errors)
|
||||
{
|
||||
@ -225,20 +187,15 @@ bool TF9_doccart::doc_already_exists(const TFilename& file, _Out_ TString& numre
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool TF9_doccart::mov2doc(const TString& numreg, TFilename & doc)
|
||||
bool TF9_doccart::mov2doc(const TString& numreg, _Out_ TFilename& doc)
|
||||
{
|
||||
_tdocs.zero();
|
||||
_tdocs.setkey(1); // Ricerca per NUMREG
|
||||
_tdocs.put(F9C_NUMREG, numreg);
|
||||
const bool ok = _tdocs.read() == NOERR;
|
||||
|
||||
doc.cut(0);
|
||||
if (ok)
|
||||
{
|
||||
doc = get_addr_cart();
|
||||
doc << _tdocs.get(F9C_FILENAME);
|
||||
}
|
||||
else
|
||||
doc.cut(0);
|
||||
doc << TFilename(F9CONF.get_addr_cart()).slash_terminate() << _tdocs.get(F9C_FILENAME);
|
||||
return ok;
|
||||
}
|
||||
|
||||
@ -315,7 +272,6 @@ void TIva_insert_prepared_stat::add_value(const char* field, const TString& valu
|
||||
void TIva_insert_prepared_stat::write()
|
||||
{
|
||||
TString vals_appo;
|
||||
|
||||
_query.cut(0) << "INSERT INTO " F9_IVA " (\n";
|
||||
int count = 0;
|
||||
bool first = true;
|
||||
@ -632,23 +588,31 @@ bool TF9Prospetto_integr::operator()(const char* numreg_acq, const char* numreg_
|
||||
if (_rep.load(_f_report))
|
||||
{
|
||||
TFilename fprosp; fprosp.tempdir().slash_terminate() << make_name_rep();
|
||||
TProspetto_recset * _prosp_rs = new TProspetto_recset(numreg_acq, numreg_ven);
|
||||
TProspetto_recset* _prosp_rs = new TProspetto_recset(numreg_acq, numreg_ven);
|
||||
|
||||
_items = _prosp_rs->items();
|
||||
if (_items == 0)
|
||||
{
|
||||
ofstream log("TF9Prospetto_integr_error.txt", ios::app);
|
||||
|
||||
FILE* log = fopen("TF9Prospetto_integr_error.txt", "a");
|
||||
if (!_prosp_rs->last_exec())
|
||||
{
|
||||
log << "\n" << _prosp_rs->get_err_msg() << "\n";
|
||||
if (log != nullptr)
|
||||
{
|
||||
TString msg("\n"); msg << _prosp_rs->get_err_msg() << "\n";
|
||||
fwrite((const char*)msg, sizeof(char), msg.len(), log);
|
||||
}
|
||||
fclose(log);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
log << "\n" << _prosp_rs->get_query() << "\n - Nessun record trovato!\n\n";
|
||||
|
||||
else if (log != nullptr)
|
||||
{
|
||||
TString msg("\n"); msg << _prosp_rs->get_query() << "\n - Nessun record trovato!\n\n";
|
||||
fwrite(msg, sizeof(char), msg.len(), log);
|
||||
}
|
||||
fclose(log);
|
||||
return false;
|
||||
}
|
||||
|
||||
_rep.set_recordset(_prosp_rs);
|
||||
_book.add(_rep);
|
||||
}
|
||||
|
@ -244,6 +244,10 @@ TExclusion_mode TSpesometro_msk::validate_mov(const TRectype& mov)
|
||||
if (anno < 2012)
|
||||
return segnala_movimento(mov, em_data_limite);
|
||||
|
||||
#ifdef DBG
|
||||
if (mov.get_long(MOV_NUMREG) ==14224)
|
||||
int sn = 1;
|
||||
#endif
|
||||
const char tipocf = mov.get_char(MOV_TIPO);
|
||||
const real impmin = get_real(F_IMPMIN);
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
#include <reputils.h>
|
||||
|
||||
#include "felib.h"
|
||||
#include "../cg/cglib.h"
|
||||
#include "../cg/cg2103.h"
|
||||
|
||||
#include <alleg.h>
|
||||
#include <causali.h>
|
||||
|
@ -93,6 +93,30 @@ bool fe_is_nota_variazione(const TRectype& mov)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool fe_decode_cofi(const TString& cofi, char& sex_nasc, TDate& dt_nasc, TString& com_nasc)
|
||||
{
|
||||
if (cofi.len() != 16 || !cf_check("", cofi))
|
||||
return false;
|
||||
|
||||
const TFixed_string wm = "ABCDEHLMPRST"; // Controllo data di nascita
|
||||
|
||||
int anno = atoi(cofi.mid(6,2));
|
||||
anno += anno < 25? 2000 : 1900;
|
||||
const int mese = wm.find(cofi[8])+1;
|
||||
int giorno = atoi(cofi.mid(9,2));
|
||||
if (giorno > 40)
|
||||
{
|
||||
giorno -= 40;
|
||||
sex_nasc = 'F';
|
||||
}
|
||||
else
|
||||
sex_nasc = 'M';
|
||||
|
||||
com_nasc = cofi.mid(11,4);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// TSpesometro_set
|
||||
///////////////////////////////////////////////////////////
|
||||
|
@ -58,5 +58,6 @@ public:
|
||||
|
||||
// Utility
|
||||
bool fe_is_nota_variazione(const TRectype& rec);
|
||||
bool fe_decode_cofi(const TString& cofi, char& sex_nasc, TDate& dt_nasc, TString& com_nasc);
|
||||
|
||||
#endif
|
@ -35,40 +35,40 @@ TParametri_mask::TParametri_mask(const char * n) : TAutomask(n)
|
||||
|
||||
void TParametri_mask::save_all() const
|
||||
{
|
||||
set_db_indirizzo(get(F_INDIRIZZO));
|
||||
set_db_database(get(F_DATABASE));
|
||||
set_db_user(get(F_USER));
|
||||
set_db_password(get(F_PASSWORD));
|
||||
set_fld_dest(get(F_FLDDEST));
|
||||
set_fld_dest_usr(get(F_FLDUSRDEST));
|
||||
set_cofi_tras(get(F_COFI));
|
||||
set_gest_alleg(get_bool(F_ESPORTAALLEG));
|
||||
set_allega_fat(get_bool(F_ESPORTADOC));
|
||||
set_f8(get_bool(F_F8));
|
||||
set_check_not_block(get_bool(F_CHECK_NOT_BLOCK));
|
||||
set_no_sconti_fatt(get_bool(F_CHECK_NO_SCONTI));
|
||||
set_no_export_pronto(get_bool(F_CHECK_NO_EXPORT_PRONTO));
|
||||
set_data_start_fatt(get_date(F_STARTFATTEL));
|
||||
set_data_start_new_fatt(get_date(F_STARTNEWFATT));
|
||||
fp_settings().set_db_indirizzo(get(F_INDIRIZZO));
|
||||
fp_settings().set_db_database(get(F_DATABASE));
|
||||
fp_settings().set_db_user(get(F_USER));
|
||||
fp_settings().set_db_password(get(F_PASSWORD));
|
||||
fp_settings().set_fld_dest(get(F_FLDDEST));
|
||||
fp_settings().set_fld_dest_usr(get(F_FLDUSRDEST));
|
||||
fp_settings().set_cofi_tras(get(F_COFI));
|
||||
fp_settings().set_gest_alleg(get_bool(F_ESPORTAALLEG));
|
||||
fp_settings().set_allega_fat(get_bool(F_ESPORTADOC));
|
||||
fp_settings().set_f8(get_bool(F_F8));
|
||||
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));
|
||||
fp_settings().set_data_start_new_fatt(get_date(F_STARTNEWFATT));
|
||||
TFP_righe_custom().save_sheet(sfield(F_FORMPERS));
|
||||
TFP_nota_piede_f().save_sheet(sfield(F_NPFSHEET));
|
||||
}
|
||||
|
||||
void TParametri_mask::load_all()
|
||||
{
|
||||
set(F_INDIRIZZO, get_db_indirizzo());
|
||||
set(F_DATABASE, get_db_database());
|
||||
set(F_USER, get_db_user());
|
||||
set(F_PASSWORD, get_db_password());
|
||||
set(F_FLDDEST, get_fld_dest());
|
||||
set(F_FLDUSRDEST, get_fld_dest_usr());
|
||||
set(F_COFI, get_cofi_tras());
|
||||
set(F_ESPORTAALLEG, get_gest_alleg());
|
||||
set(F_ESPORTADOC, get_allega_fat());
|
||||
set(F_F8, is_f8());
|
||||
set(F_CHECK_NOT_BLOCK, get_check_not_block());
|
||||
set(F_CHECK_NO_SCONTI, get_no_sconti_fatt());
|
||||
set(F_CHECK_NO_EXPORT_PRONTO, get_no_export_pronto());
|
||||
set(F_INDIRIZZO, fp_settings().get_db_indirizzo());
|
||||
set(F_DATABASE, fp_settings().get_db_database());
|
||||
set(F_USER, fp_settings().get_db_user());
|
||||
set(F_PASSWORD, fp_settings().get_db_password());
|
||||
set(F_FLDDEST, fp_settings().get_fld_dest());
|
||||
set(F_FLDUSRDEST, fp_settings().get_fld_dest_usr());
|
||||
set(F_COFI, fp_settings().get_cofi_tras());
|
||||
set(F_ESPORTAALLEG, fp_settings().get_gest_alleg());
|
||||
set(F_ESPORTADOC, fp_settings().get_allega_fat());
|
||||
set(F_F8, fp_settings().is_f8());
|
||||
set(F_CHECK_NOT_BLOCK, fp_settings().get_check_not_block());
|
||||
set(F_CHECK_NO_SCONTI, fp_settings().get_no_sconti_fatt());
|
||||
set(F_CHECK_NO_EXPORT_PRONTO, fp_settings().get_no_export_pronto());
|
||||
TFP_righe_custom().load_sheet(sfield(F_FORMPERS));
|
||||
TFP_nota_piede_f().load_sheet(sfield(F_NPFSHEET));
|
||||
}
|
||||
@ -131,7 +131,7 @@ void TParametri_mask::delete_row_npf(TOperable_field& o) const
|
||||
TSheet_field& sf = sfield(F_NPFSHEET);
|
||||
|
||||
TMask& msk = o.mask();
|
||||
const TString& tipodoc_msk = msk.get(S_DOCPF);
|
||||
const TString& tipodoc_msk = msk.get(S_DOC);
|
||||
|
||||
for(int i=0; i < sf.items(); i++)
|
||||
if (tipodoc_msk == sf.row(i).get(0))
|
||||
@ -230,11 +230,11 @@ bool TParametri_mask::on_field_event(TOperable_field& o, TField_event e, long jo
|
||||
break;
|
||||
case F_STARTFATTEL:
|
||||
if (e == fe_init)
|
||||
o.set(get_data_start_fatt());
|
||||
o.set(fp_settings().get_data_start_fatt());
|
||||
break;
|
||||
case F_STARTNEWFATT:
|
||||
if (e == fe_init)
|
||||
o.set(get_date_start_new_fatt());
|
||||
o.set(TFP_settings::get_date_start_new_fatt());
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -270,7 +270,6 @@ void TParametri_ditta::main_loop()
|
||||
ad << ip << "@" << db;
|
||||
|
||||
SSimple_query s(ad, usr, psw, TSDB_MSSQL);
|
||||
|
||||
if (s.sq_is_connect())
|
||||
{
|
||||
pm.save_all();
|
||||
|
@ -22,14 +22,14 @@
|
||||
|
||||
#define F_FORMPERS 401
|
||||
|
||||
#define SC_TIPODOC 101
|
||||
#define SC_TIPORIGA 102
|
||||
#define SC_QTA 103
|
||||
#define SC_PREZZO 104
|
||||
#define SC_IMPONIBILE 105
|
||||
#define S_TIPODOC 101
|
||||
#define S_TIPORIGA 102
|
||||
#define S_QTA 103
|
||||
#define S_PREZZO 104
|
||||
#define S_IMPONIBILE 105
|
||||
|
||||
|
||||
#define F_NPFSHEET 501
|
||||
|
||||
#define S_DOCPF 101
|
||||
#define S_DOC 101
|
||||
#define S_NOTAPF 102
|
@ -5,7 +5,7 @@ TOOLBAR "topbar" 0 0 0 2
|
||||
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Parametri generali" 0 2 0 0
|
||||
PAGE "Configurazione FP (1)" 0 2 0 0
|
||||
|
||||
GROUPBOX DLG_NULL 78 6
|
||||
BEGIN
|
||||
@ -109,7 +109,7 @@ END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Personalizzazioni" 0 2 0 0
|
||||
PAGE "Configurazione (2) " 0 2 0 0
|
||||
|
||||
SPREADSHEET F_FORMPERS 60 6
|
||||
BEGIN
|
||||
@ -155,7 +155,7 @@ END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Funzioni di assistenza" 0 2 0 0
|
||||
PAGE "Assistenza FP" 0 2 0 0
|
||||
|
||||
BUTTON F_SETPATCH 15 2
|
||||
BEGIN
|
||||
@ -185,56 +185,56 @@ ENDPAGE
|
||||
|
||||
ENDMASK
|
||||
|
||||
PAGE "Parametri tipi Documento" -1 -1 60 12
|
||||
PAGE "Elementi spredsheet" -1 -1 60 12
|
||||
|
||||
STRING SC_TIPODOC 4
|
||||
STRING S_TIPODOC 4
|
||||
BEGIN
|
||||
PROMPT 1 1 "Tipo doc "
|
||||
HELP "Lasciare libero per tutti i tipo documento"
|
||||
USE %TIP
|
||||
SELECT S3[37,40]!=""
|
||||
INPUT CODTAB SC_TIPODOC
|
||||
INPUT CODTAB S_TIPODOC
|
||||
DISPLAY "Codice@10" CODTAB
|
||||
DISPLAY "Descrizione@50" S0
|
||||
DISPLAY "Tipo SDI@10" S3[37,40]
|
||||
OUTPUT SC_TIPODOC CODTAB
|
||||
OUTPUT S_TIPODOC CODTAB
|
||||
FLAG "UPA"
|
||||
END
|
||||
|
||||
STRING SC_TIPORIGA 4
|
||||
STRING S_TIPORIGA 4
|
||||
BEGIN
|
||||
PROMPT 1 2 "Tipo riga "
|
||||
USE %TRI
|
||||
INPUT CODTAB SC_TIPORIGA
|
||||
INPUT CODTAB S_TIPORIGA
|
||||
DISPLAY "Codice@10" CODTAB
|
||||
DISPLAY "Descrizione@50" S0
|
||||
OUTPUT SC_TIPORIGA CODTAB
|
||||
OUTPUT S_TIPORIGA CODTAB
|
||||
CHECKTYPE REQUIRED
|
||||
END
|
||||
|
||||
STRING SC_QTA 10
|
||||
STRING S_QTA 10
|
||||
BEGIN
|
||||
PROMPT 1 3 "Qta"
|
||||
END
|
||||
|
||||
STRING SC_PREZZO 10
|
||||
STRING S_PREZZO 10
|
||||
BEGIN
|
||||
PROMPT 1 4 "Prezzo"
|
||||
USE %FRR
|
||||
INPUT CODTAB SC_PREZZO
|
||||
INPUT CODTAB S_PREZZO
|
||||
DISPLAY "Codice@10" CODTAB
|
||||
DISPLAY "Descrizione@50" S0
|
||||
OUTPUT SC_PREZZO CODTAB
|
||||
OUTPUT S_PREZZO CODTAB
|
||||
END
|
||||
|
||||
STRING SC_IMPONIBILE 10
|
||||
STRING S_IMPONIBILE 10
|
||||
BEGIN
|
||||
PROMPT 1 5 "Imponibile"
|
||||
USE %FRR
|
||||
INPUT CODTAB SC_IMPONIBILE
|
||||
INPUT CODTAB S_IMPONIBILE
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@50" S0
|
||||
OUTPUT SC_IMPONIBILE CODTAB
|
||||
OUTPUT S_IMPONIBILE CODTAB
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
@ -259,17 +259,17 @@ ENDMASK
|
||||
|
||||
PAGE "Elementi NPF" -1 -1 60 12
|
||||
|
||||
STRING S_DOCPF 4
|
||||
STRING S_DOC 4
|
||||
BEGIN
|
||||
PROMPT 1 1 "Tipo doc "
|
||||
HELP "Lasciare libero per tutti i tipo documento"
|
||||
USE %TIP
|
||||
SELECT S3[37,40]!=""
|
||||
INPUT CODTAB S_DOCPF
|
||||
INPUT CODTAB S_TIPODOC
|
||||
DISPLAY "Codice@10" CODTAB
|
||||
DISPLAY "Descrizione@50" S0
|
||||
DISPLAY "Tipo SDI@10" S3[37,40]
|
||||
OUTPUT S_DOCPF CODTAB
|
||||
OUTPUT S_TIPODOC CODTAB
|
||||
FLAG "UPA"
|
||||
END
|
||||
|
||||
|
@ -176,11 +176,11 @@ void TCC_mask::save_all()
|
||||
|
||||
cfven.zero();
|
||||
cfven.put(CFV_TIPOCF, get(F_TIPOCF));
|
||||
cfven.put(CFV_CODCF, riga->get(cid2index(S_CODCF)));
|
||||
cfven.put(CFV_CODCF, riga->get(xvtil_cid2index(S_CODCF)));
|
||||
const int err = cfven.read();
|
||||
if (err == NOERR || err == _iskeynotfound)
|
||||
{
|
||||
cfven.put(CFV_PADESTIN, riga->get(cid2index(S_CODSDI)));
|
||||
cfven.put(CFV_PADESTIN, riga->get(xvtil_cid2index(S_CODSDI)));
|
||||
if (cfven.rewrite_write() != NOERR)
|
||||
{
|
||||
TString msg = "Fallito salvataggio record in CFVEN ";
|
||||
|
@ -56,7 +56,7 @@ public:
|
||||
disable(DLG_SAVEREC);
|
||||
disable(DLG_FINDREC);
|
||||
load_all_fields();
|
||||
const TDate data_inizio = get_date_start_new_fatt();
|
||||
const TDate data_inizio = fp_settings().get_date_start_new_fatt();
|
||||
|
||||
if (today < data_inizio)
|
||||
{
|
||||
@ -82,9 +82,9 @@ void TPA_mask::save_all_fields() const
|
||||
selected_docs.save_sheet(sfield(F_DOCUMENTI_TIPO));
|
||||
|
||||
// Salvo le impostazioni
|
||||
set_esp_pri_empty(get_bool(F_SETDEFCOD));
|
||||
set_esp_est(get_bool(F_SETCODEST));
|
||||
set_esp_est_cod(get(F_VALCODEST));
|
||||
fp_settings().set_esp_pri_empty(get_bool(F_SETDEFCOD));
|
||||
fp_settings().set_esp_est(get_bool(F_SETCODEST));
|
||||
fp_settings().set_esp_est_cod(get(F_VALCODEST));
|
||||
}
|
||||
|
||||
void TPA_mask::force_reload_sheet()
|
||||
@ -143,9 +143,9 @@ void TPA_mask::load_all_fields()
|
||||
sheet.force_update();
|
||||
sheet.show();
|
||||
|
||||
set(F_SETDEFCOD, get_esp_pri_empty());
|
||||
set(F_SETCODEST, get_esp_est());
|
||||
set(F_VALCODEST, get_esp_est_cod());
|
||||
set(F_SETDEFCOD, fp_settings().get_esp_pri_empty());
|
||||
set(F_SETCODEST, fp_settings().get_esp_est());
|
||||
set(F_VALCODEST, fp_settings().get_esp_est_cod());
|
||||
}
|
||||
|
||||
void TPA_mask::fill()
|
||||
@ -164,7 +164,7 @@ void TPA_mask::fill()
|
||||
TString filter_selected = get(F_FATTSEL);
|
||||
|
||||
enable(DLG_OK, filter_selected.empty() || filter_selected == "E");
|
||||
enable(DLG_SAVEREC, (is_f8() && filter_selected == "X") || filter_selected == "D");
|
||||
enable(DLG_SAVEREC, (fp_settings().is_f8() && filter_selected == "X") || filter_selected == "D");
|
||||
enable(DLG_FINDREC, filter_selected == "D");
|
||||
enable(DLG_PRINT, _enable_chiave_fixer && filter_selected.empty());
|
||||
|
||||
@ -176,9 +176,9 @@ void TPA_mask::fill()
|
||||
|
||||
query << "USE 33 KEY 3 \n" <<
|
||||
"SELECT 33.TIPOCF==\"C\" \n" <<
|
||||
// "JOIN 20 INTO TIPOCF==TIPOCF CODCF==CODCF \n" <<
|
||||
// "JOIN 17 TO 33 INTO TIPOCF==TIPOCF CODCF==CODCF \n" <<
|
||||
// "JOIN %TIP TO 33 ALIAS 400 INTO CODTAB==TIPODOC \n" <<
|
||||
"JOIN 20 INTO TIPOCF==TIPOCF CODCF==CODCF \n" <<
|
||||
"JOIN 17 TO 33 INTO TIPOCF==TIPOCF CODCF==CODCF \n" <<
|
||||
"JOIN %TIP TO 33 ALIAS 400 INTO CODTAB==TIPODOC \n" <<
|
||||
"FROM DATADOC=#DADATADOC \n" <<
|
||||
"TO DATADOC=#ADATADOC";
|
||||
|
||||
@ -193,16 +193,15 @@ void TPA_mask::fill()
|
||||
int fat_no_cod = 0;
|
||||
|
||||
// Disabilito la colonna del codice ufficio
|
||||
docs.enable_column(cid2index(S_UFFICIO), false);
|
||||
const TDate data_inizio = get_date_start_new_fatt();
|
||||
docs.enable_column(docs.cid2index(S_UFFICIO), false);
|
||||
const TDate data_inizio = fp_settings().get_date_start_new_fatt();
|
||||
|
||||
for (bool okc = rec.move_first(); okc; okc = rec.move_next())
|
||||
{
|
||||
if (!pi.add_status())
|
||||
break;
|
||||
|
||||
const TDocumentoEsteso& doc(rec.cursor()->curr());
|
||||
const TTipo_documento& td = doc.tipo();
|
||||
const TRectype& doc = rec.cursor()->curr();
|
||||
const TTipo_documento& td = cached_tipodoc(doc.get(DOC_TIPODOC));
|
||||
|
||||
// Controllo che la numerazione sia tra quelle giuste
|
||||
|
||||
@ -223,29 +222,26 @@ void TPA_mask::fill()
|
||||
continue;
|
||||
}
|
||||
|
||||
// TToken_string & row = docs.row();
|
||||
const int nrow = docs.set_row_cell(S_SELECTED, !sent);
|
||||
TToken_string& row = docs.row(-1);
|
||||
row = sent ? " " : "X";
|
||||
row.add(rec.get(DOC_ANNO).as_int(), 1);
|
||||
row.add(rec.get(DOC_CODNUM).as_string());
|
||||
row.add(rec.get(DOC_TIPODOC).as_string());
|
||||
|
||||
docs.set_row_cell(S_ANNO, doc.get_long(DOC_ANNO), nrow);
|
||||
docs.set_row_cell(S_CODNUM, doc.get(DOC_CODNUM), nrow);
|
||||
docs.set_row_cell(S_TIPODOC, doc.tipo().codice(), nrow);
|
||||
|
||||
TString tipodoc = doc.get(DOC_TIPODOCSDI);
|
||||
TString tipodoc = rec.get(DOC_TIPODOCSDI).as_string();
|
||||
|
||||
if (tipodoc.blank())
|
||||
tipodoc = td.tipo_doc_sdi();
|
||||
if (today <data_inizio && (tipodoc == "TD24" || tipodoc == "TD25" || tipodoc == "TD27"))
|
||||
tipodoc = "TD01";
|
||||
docs.set_row_cell(S_CODSDI, tipodoc, nrow);
|
||||
docs.set_row_cell(S_NDOC, doc.numero(), nrow);
|
||||
docs.set_row_cell(S_DATADOC, doc.get_date(DOC_DATADOC), nrow);
|
||||
docs.set_row_cell(S_CLIENTE, doc.clifor().codice(), nrow);
|
||||
docs.set_row_cell(S_RAGSOC, doc.clifor().get(CLI_RAGSOC), nrow);
|
||||
|
||||
|
||||
const TString cod_ind_sped = doc.get(DOC_CODINDSP);
|
||||
const TString & rif = doc.get_dest_sdi();
|
||||
row.add(tipodoc);
|
||||
row.add(rec.get(DOC_NDOC).as_int());
|
||||
row.add(rec.get(DOC_DATADOC).as_date());
|
||||
row.add(rec.get(CFV_CODCF).as_int());
|
||||
row.add(rec.get("20." CLI_RAGSOC).as_string());
|
||||
|
||||
TString cod_ind_sped = rec.get(DOC_CODINDSP).as_string();
|
||||
TString rif = get_dest_sdi(rec.get(CFV_TIPOCF).as_string()[0], rec.get(CFV_CODCF).as_int(), cod_ind_sped);
|
||||
// Se è ancora vuoto potrebbe essere estero
|
||||
if(rif.empty())
|
||||
{
|
||||
@ -259,26 +255,29 @@ void TPA_mask::fill()
|
||||
docs.set_back_and_fore_color(COLOR_RED, COLOR_WHITE, rec.current_row(), docs.cid2index(S_UFFICIO));
|
||||
fat_no_cod++;
|
||||
}
|
||||
docs.set_row_cell(S_UFFICIO, rif, nrow);
|
||||
docs.set_row_cell(S_RIFAMM, doc.clifor().get(CFV_PARIFAMM), nrow);
|
||||
docs.set_row_cell(S_COFI, doc.clifor().get(CLI_COFI), nrow);
|
||||
;
|
||||
row.add(rif);
|
||||
row.add(rec.get("17." CFV_PARIFAMM).as_string());
|
||||
row.add(rec.get("20." CLI_COFI).as_string());
|
||||
|
||||
bool split = doc.clifor().get_bool(CLI_SPLITPAY);
|
||||
|
||||
if (split)
|
||||
bool split = rec.get("20." CLI_SPLITPAY).as_bool();
|
||||
if (split)
|
||||
{
|
||||
const long numreg = doc.get_long(DOC_NUMREG);
|
||||
const TRectype& mov = cache().get(LF_MOV, numreg);
|
||||
|
||||
split = is_split_payment(mov);
|
||||
const long numreg = rec.get(DOC_NUMREG).as_int();
|
||||
if (numreg > 0)
|
||||
{
|
||||
const TRectype& mov = cache().get(LF_MOV, numreg);
|
||||
split = is_split_payment(mov);
|
||||
}
|
||||
}
|
||||
docs.set_row_cell(S_SPLITPAY, split, nrow);
|
||||
row.add(split ? "X" : " ");
|
||||
|
||||
const bool attach = doc.get(DOC_COLL_GOLEM).full();
|
||||
const bool attach = !rec.get("COLL_GOLEM").is_empty();
|
||||
row.add(attach ? "X" : " ");
|
||||
|
||||
row.add(!td.invio_xml() ? "X" : "");
|
||||
}
|
||||
|
||||
docs.set_row_cell(S_ATTACH, attach, nrow);
|
||||
docs.set_row_cell(S_ONLYGEN, !td.invio_xml(), nrow);
|
||||
}
|
||||
docs.force_update();
|
||||
docs.show();
|
||||
|
||||
@ -304,7 +303,7 @@ void TPA_mask::set_pronto()
|
||||
continue;
|
||||
|
||||
static TString campo_hfatt, campo_bfatt, query;
|
||||
TDocumentoEsteso doc('D', riga->get_int(xvtil_cid2index(S_ANNO)), riga->get(xvtil_cid2index(S_CODNUM)), riga->get_long(xvtil_cid2index(S_NDOC)));
|
||||
TDocumento doc('D', riga->get_int(xvtil_cid2index(S_ANNO)), riga->get(xvtil_cid2index(S_CODNUM)), riga->get_long(xvtil_cid2index(S_NDOC)));
|
||||
|
||||
if (chiave_paf(doc, campo_hfatt, campo_bfatt))
|
||||
{
|
||||
@ -332,10 +331,7 @@ void TPA_mask::connect_keys()
|
||||
warning_box("Impossibile allineare le chiavi di uno sheet vuoto!");
|
||||
return;
|
||||
}
|
||||
|
||||
TProgress_monitor pi(sht.items(), "Esportazione Fatture");
|
||||
TString campo_hfatt, campo_bfatt, query;
|
||||
|
||||
FOR_EACH_ARRAY_ROW(sht, r, riga)
|
||||
{
|
||||
if (!pi.add_status())
|
||||
@ -344,9 +340,8 @@ void TPA_mask::connect_keys()
|
||||
if (!riga->starts_with("X"))
|
||||
continue;
|
||||
|
||||
TDocumentoEsteso doc('D', riga->get_int(xvtil_cid2index(S_ANNO)), riga->get(xvtil_cid2index(S_CODNUM)), riga->get_long(xvtil_cid2index(S_NDOC)));
|
||||
|
||||
|
||||
TDocumento doc('D', riga->get_int(xvtil_cid2index(S_ANNO)), riga->get(xvtil_cid2index(S_CODNUM)), riga->get_long(xvtil_cid2index(S_NDOC)));
|
||||
static TString campo_hfatt, campo_bfatt, query;
|
||||
if (chiave_paf(doc, campo_hfatt, campo_bfatt))
|
||||
{
|
||||
// Come prima cosa controllo che effettivamente la chiave di questo doc sia in giro per il mondo
|
||||
@ -360,7 +355,7 @@ void TPA_mask::connect_keys()
|
||||
|
||||
// Provo a cercare il documento nel paf07 come un vero uomo
|
||||
query.cut(0) << "SELECT P7_KEYPRGINVIO, P7_KEYHEADERFATT, P7_KEYBODYFATT FROM PAF0700F WHERE P7_KEYHEADERFATT = '" << campo_hfatt
|
||||
<< "' AND P7_TIPODOC = '" << doc.tipo_doc_sdi() << "' AND P7_DATA = '" << doc.data().date2ansi() << "' AND P7_NUMERO LIKE '%" << doc.numero() << "%'";
|
||||
<< "' AND P7_TIPODOC = '" << tipo_doc_sdi(doc) << "' AND P7_DATA = '" << doc.data().date2ansi() << "' AND P7_NUMERO LIKE '%" << doc.numero() << "%'";
|
||||
|
||||
if (fp_db().sq_set_exec(query, false))
|
||||
{
|
||||
@ -446,10 +441,10 @@ void TPA_mask::connect_keys()
|
||||
void TPA_mask::export_paf()
|
||||
{
|
||||
int ndocs = 0;
|
||||
TLocalisamfile doc(LF_DOC);
|
||||
static const int col_cod_sdi = sfield(F_DOCS).cid2index(S_CODSDI);
|
||||
TString_array& sht = sfield(F_DOCS).rows_array();
|
||||
TDoc_fp elab;
|
||||
|
||||
//elab.set_cache_insert(true);
|
||||
if (!sht.empty())
|
||||
{
|
||||
@ -465,15 +460,15 @@ void TPA_mask::export_paf()
|
||||
const long ndoc = riga->get_long(sfield(F_DOCS).cid2index(S_NDOC));
|
||||
const TFixed_string codnum(riga->get(sfield(F_DOCS).cid2index(S_CODNUM))); // lascio sapientemente per ultima la get di una stringa
|
||||
const TDoc_key key(anno, codnum, ndoc);
|
||||
// Verifico che il codice sdi nello sheet sia lo stesso sulla testata del documento in caso contrario lo aggiorno
|
||||
TDocumento doc(key);
|
||||
|
||||
if (doc.read(doc) == NOERR)
|
||||
// Verifico che il codice sdi nello sheet sia lo stesso sulla testata del documento in caso contrario lo aggiorno
|
||||
TRectype rec_doc = elab.key_to_doc(key);
|
||||
if (rec_doc.read(doc) == NOERR)
|
||||
{
|
||||
if (doc.get(DOC_TIPODOCSDI) != riga->get(col_cod_sdi))
|
||||
if (rec_doc.get(DOC_TIPODOCSDI).compare(riga->get(col_cod_sdi)) != 0)
|
||||
{
|
||||
doc.put(DOC_TIPODOCSDI, riga->get(col_cod_sdi));
|
||||
doc.rewrite();
|
||||
rec_doc.put(DOC_TIPODOCSDI, riga->get(col_cod_sdi));
|
||||
rec_doc.rewrite(doc);
|
||||
}
|
||||
|
||||
if (elab.doc_to_paf(key))
|
||||
@ -662,25 +657,32 @@ void TPA_mask::set_err_paf()
|
||||
// Vado a riportare sui paf l'errore
|
||||
TSheet_field& sfld = sfield(F_DOCS);
|
||||
TString_array& sht = sfld.rows_array();
|
||||
|
||||
TLocalisamfile fdoc(LF_DOC);
|
||||
if (!sht.empty())
|
||||
{
|
||||
TProgress_monitor pi(sht.items(), "Cambio stato fatture");
|
||||
|
||||
FOR_EACH_ARRAY_ROW(sht, r, riga)
|
||||
{
|
||||
if (pi.add_status() && riga->get_bool(0))
|
||||
if (!pi.add_status())
|
||||
break;
|
||||
|
||||
if (riga->starts_with("X"))
|
||||
{
|
||||
// Ricontrollo che la fattura sia presente in Campo prima di cambiare stato
|
||||
const int anno = riga->get_int(sfield(F_DOCS).cid2index(S_ANNO));
|
||||
const long ndoc = riga->get_long(sfield(F_DOCS).cid2index(S_NDOC));
|
||||
const TString & codnum = riga->get(sfield(F_DOCS).cid2index(S_CODNUM)); // lascio sapientemente per ultima la get di una stringa
|
||||
const TFixed_string codnum(riga->get(sfield(F_DOCS).cid2index(S_CODNUM))); // lascio sapientemente per ultima la get di una stringa
|
||||
const TDoc_key key(anno, codnum, ndoc);
|
||||
const TDocumentoEsteso doc(key);
|
||||
|
||||
// Ricontrollo che la fattura sia presente in Campo prima di cambiare stato
|
||||
fdoc.zero();
|
||||
fdoc.put(DOC_PROVV, key.provv());
|
||||
fdoc.put(DOC_ANNO, key.anno());
|
||||
fdoc.put(DOC_CODNUM, key.codnum());
|
||||
fdoc.put(DOC_NDOC, key.ndoc());
|
||||
|
||||
TString hfatt, bfatt;
|
||||
TPaf_record paf0100f("PAF0100F");
|
||||
|
||||
if (doc.ok() && chiave_paf(doc, hfatt, bfatt) && paf0100f.search(nullptr, hfatt, bfatt))
|
||||
if (fdoc.read() == NOERR && chiave_paf(fdoc.curr(), hfatt, bfatt) && paf0100f.search(nullptr, hfatt, bfatt))
|
||||
{
|
||||
static TString query;
|
||||
query.cut(0) <<
|
||||
|
@ -111,17 +111,19 @@ void TBolliinfatt_mask::fill()
|
||||
|
||||
TProgress_monitor pi(rec.items(), nullptr);
|
||||
|
||||
for (bool okc = rec.move_first(); pi.add_status() && okc; okc = rec.move_next())
|
||||
for (bool okc = rec.move_first(); okc; okc = rec.move_next())
|
||||
{
|
||||
const TDocumentoEsteso & doc = TDocumentoEsteso(rec.cursor()->curr());
|
||||
if (!pi.add_status())
|
||||
break;
|
||||
const TRectype& doc = rec.cursor()->curr();
|
||||
const TTipo_documento& td = cached_tipodoc(doc.get(DOC_TIPODOC));
|
||||
bool sent = false;
|
||||
|
||||
bool sent = false;
|
||||
if (chiave_paf(doc, hfatt, bfatt))
|
||||
{
|
||||
TString qry_paf7 = "SELECT PAF0700F.P7_IMPORTOBOLLO, PAF0100F.P1_GESTIONE FROM PAF0700F JOIN PAF0100F ON P7_KEYPRGINVIO = P1_KEYPRGINVIO AND P7_KEYHEADERFATT = P1_KEYHEADERFATT AND P7_KEYBODYFATT = P1_KEYBODYFATT WHERE P7_KEYHEADERFATT = '";
|
||||
qry_paf7 << hfatt << "' AND P7_KEYBODYFATT = '" << bfatt << "' AND P7_IMPORTOBOLLO > 0";
|
||||
if (!fp_db().sq_set_exec(qry_paf7) || (fp_db().sq_get("P1_GESTIONE") != "N" && (is_f8() ? fp_db().sq_get("P1_GESTIONE") != "X" : true)))
|
||||
if (!fp_db().sq_set_exec(qry_paf7) || (fp_db().sq_get("P1_GESTIONE") != "N" && (fp_settings().is_f8() ? fp_db().sq_get("P1_GESTIONE") != "X" : true)))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -65,12 +65,14 @@ void TMancati_mask::save_all_fields() const
|
||||
int idx = 0;
|
||||
|
||||
for(const char* row = msg.get(); row; row = msg.get())
|
||||
set_body_mail(row, idx++);
|
||||
fp_settings().set_body_mail(row, idx++);
|
||||
|
||||
if(idx < _idx)
|
||||
{
|
||||
for(int i=idx; i<_idx; i++)
|
||||
remove_para_ini(idx);
|
||||
{
|
||||
fp_settings().remove_para_ini(idx);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -122,9 +124,9 @@ void TMancati_mask::load_all_fields()
|
||||
|
||||
// Carico messaggio corpo mail già salvato o vuoto se mai inserito
|
||||
TString msg;
|
||||
int idx = 0;
|
||||
|
||||
for(TString row = get_body_mail(idx); row != "STOpsTOP"; row = get_body_mail(idx))
|
||||
int idx = 0;
|
||||
for(TString row = fp_settings().get_body_mail(idx); row != "STOpsTOP"; row = fp_settings().get_body_mail(idx))
|
||||
{
|
||||
if (idx++ > 0)
|
||||
msg << '\n';
|
||||
@ -174,12 +176,12 @@ void TMancati_mask::fill()
|
||||
bool first, show, ask = !((show = (first = true)));
|
||||
int fat_no_cod = 0;
|
||||
|
||||
for (bool okc = rec.move_first(); pi.add_status() && okc; okc = rec.move_next())
|
||||
for (bool okc = rec.move_first(); okc; okc = rec.move_next())
|
||||
{
|
||||
if (!pi.add_status())
|
||||
break;
|
||||
const TDocumentoEsteso & doc = TDocumentoEsteso(rec.cursor()->curr());
|
||||
const TTipo_documento& td = doc.tipo();
|
||||
const TRectype& doc = rec.cursor()->curr();
|
||||
const TTipo_documento& td = cached_tipodoc(doc.get(DOC_TIPODOC));
|
||||
|
||||
// Controllo che la numerazione sia tra quelle giuste
|
||||
|
||||
@ -365,7 +367,7 @@ void TMancati_app::main_loop()
|
||||
TFp_mail_sender mail_sender;
|
||||
const TString& msg = mask.get(F_BODYMAIL);
|
||||
|
||||
if ( !mail_sender.set_alleg(get_allega_fat()) )
|
||||
if ( !mail_sender.set_alleg(fp_settings().get_allega_fat()) )
|
||||
{
|
||||
TString msg; msg << "Non è possibile allegare alla fattura:\nAllega in fattura disabilitato nelle impostazioni.\n"
|
||||
<< "Inviare lo stesso la mail\nNotifica Mancata Consegna senza allegato?";
|
||||
|
123
src/fp/fplib.h
123
src/fp/fplib.h
@ -10,7 +10,7 @@
|
||||
#include <reputils.h>
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
#include "../cg/cglib.h"
|
||||
#include "cglib.h"
|
||||
#include <map>
|
||||
|
||||
#define SQL_FLD "sql/"
|
||||
@ -24,7 +24,6 @@ class TDoc_fp;
|
||||
enum { no_pdf = -1, pdf_ok = 0, no_alleg = -2};
|
||||
|
||||
bool set_connection(SSimple_query& s);
|
||||
inline bool test_connection() { SSimple_query q; return set_connection(q); }
|
||||
// Ritorna la connessione al DB paf secondo i parametri impostati nel programma di configurazione
|
||||
SSimple_query& fp_db();
|
||||
// Lancia una maschera di password FP
|
||||
@ -33,17 +32,14 @@ bool run_fp_psw_mask();
|
||||
bool check_tables();
|
||||
// Compila il numero di documento per la scrittura sui paf
|
||||
TString& complete_num_fp(const TCodice_numerazione& codnum, const int numdoc);
|
||||
|
||||
|
||||
// Genera la chiave per i paf
|
||||
bool chiave_paf(const TDocumentoEsteso& doc, TString& hfatt, TString& bfatt);
|
||||
bool chiave_paf(const TDocumento& doc, TString& hfatt, TString& bfatt);
|
||||
bool chiave_paf(const TRectype& doc, TString& hfatt, TString& bfatt);
|
||||
/* perchè così ????
|
||||
// Ritorna cod sdi, pec o vuoto. Chiama get_coddest()
|
||||
TString get_dest_sdi(char tipocf, long codcf, const TString& cod_ind_sped);
|
||||
// Valorizza codice sdi e pec in base alle configurazioni del monitor
|
||||
bool get_coddest(char tipocf, long codcf, TString& coddest, TString& pec, const TString& cod_ind_sped);
|
||||
const TString& tipo_doc_sdi(const TDocumento& doc);
|
||||
*/
|
||||
|
||||
// Controlli comuni
|
||||
bool is_fattura(const TRectype& doc);
|
||||
@ -134,59 +130,72 @@ public:
|
||||
TFP_nota_piede_f();
|
||||
};
|
||||
|
||||
// TFP_settings functions
|
||||
const TString& get_db_indirizzo();
|
||||
const TString& get_db_database();
|
||||
const TString& get_db_str_con();
|
||||
const TString& get_db_user();
|
||||
const TString& get_db_password();
|
||||
const TString& get_fld_dest();
|
||||
const TString& get_fld_dest_usr();
|
||||
const TString& get_cofi_tras();
|
||||
const TDate get_data_start_fatt();
|
||||
const bool get_gest_alleg();
|
||||
const bool get_allega_fat();
|
||||
const bool get_esp_pri_empty();
|
||||
const bool get_esp_est();
|
||||
const TString& get_esp_est_cod();
|
||||
const bool is_f8();
|
||||
const bool get_check_not_block();
|
||||
const TString& get_body_mail(int idx = -1);
|
||||
const TString& get_npf(const char* tipodoc, int idx);
|
||||
const bool get_no_sconti_fatt();
|
||||
bool get_no_export_pronto();
|
||||
// Get tipidoc per NotaPiedeFattura
|
||||
const TString & get_npf_tipodoc(int indx);
|
||||
TDate get_date_start_new_fatt();
|
||||
class TFP_settings : public TObject
|
||||
{
|
||||
public:
|
||||
// Getters
|
||||
const TString& get_db_indirizzo() const;
|
||||
const TString& get_db_database() const;
|
||||
const TString& get_db_str_con() const;
|
||||
const TString& get_db_user() const;
|
||||
const TString& get_db_password() const;
|
||||
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;
|
||||
const bool get_esp_est() const;
|
||||
const TString& get_esp_est_cod() const;
|
||||
const bool is_f8() const;
|
||||
const bool get_check_not_block() const;
|
||||
const TString& get_body_mail(int idx = -1) const;
|
||||
const TString& get_npf(const char* tipodoc, int idx) const;
|
||||
const bool get_no_sconti_fatt() const;
|
||||
bool get_no_export_pronto() const;
|
||||
// Get tipidoc per NotaPiedeFattura
|
||||
const TString get_npf_tipodoc(int indx) const;
|
||||
static TDate get_date_start_new_fatt();
|
||||
|
||||
// Setters
|
||||
void set_db_indirizzo(const TString& ind);
|
||||
void set_db_database(const TString& db);
|
||||
void set_db_user(const TString& usr);
|
||||
void set_db_password(const TString& psw);
|
||||
void set_fld_dest(const TString& fld_dest);
|
||||
void set_fld_dest_usr(const TString& fld_dest_usr);
|
||||
void set_cofi_tras(const TString& cofi);
|
||||
void set_gest_alleg(bool gest_alleg);
|
||||
void set_allega_fat(bool allega_fatt);
|
||||
void set_esp_pri_empty(bool esp_pri);
|
||||
void set_esp_est(bool esp_est);
|
||||
void set_esp_est_cod(const TString& esp_est_cod);
|
||||
void set_f8(bool f8);
|
||||
void set_check_not_block(bool not_block);
|
||||
void set_body_mail(const char* msg, int idx = -1);
|
||||
void set_no_sconti_fatt(const bool no_sconti_fatt);
|
||||
void set_no_export_pronto(const bool no_export_pronto);
|
||||
void set_data_start_fatt(const char* date);
|
||||
void set_data_start_new_fatt(const char* date);
|
||||
// Setters
|
||||
void set_db_indirizzo(const TString& ind) const;
|
||||
void set_db_database(const TString& db) const;
|
||||
void set_db_user(const TString& usr) const;
|
||||
void set_db_password(const TString& psw) const;
|
||||
void set_fld_dest(const TString& fld_dest) const;
|
||||
void set_fld_dest_usr(const TString& fld_dest_usr) const;
|
||||
void set_cofi_tras(const TString& cofi) const;
|
||||
void set_gest_alleg(bool gest_alleg) const;
|
||||
void set_allega_fat(bool allega_fatt) const;
|
||||
void set_esp_pri_empty(bool esp_pri) const;
|
||||
void set_esp_est(bool esp_est) const;
|
||||
void set_esp_est_cod(const TString& esp_est_cod) const;
|
||||
void set_f8(bool f8) const;
|
||||
void set_check_not_block(bool not_block) const;
|
||||
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_data_start_new_fatt(const char* date) const;
|
||||
|
||||
void set_npf(const char * tipodoc, const char* msg, int idx);
|
||||
void set_npf_tipodoc(const TString& tipodoc, int indx);
|
||||
void set_npf(const char * tipodoc, const char* msg, int idx) const;
|
||||
void set_npf_tipodoc(const TString& tipodoc, int indx) const;
|
||||
|
||||
void remove_para_ini(int idx);
|
||||
void remove_npf_ini(const char* tipodoc, int idx);
|
||||
void remove_tipodoc_npf(int idx);
|
||||
void remove_para_ini(int idx);
|
||||
void remove_npf_ini(const char* tipodoc, int idx);
|
||||
void remove_tipodoc_npf(int idx) const;
|
||||
};
|
||||
|
||||
inline TFP_settings& fp_settings()
|
||||
{
|
||||
static TFP_settings* erbuggo = nullptr;
|
||||
if(erbuggo == nullptr)
|
||||
{
|
||||
erbuggo = new TFP_settings();
|
||||
}
|
||||
return *erbuggo;
|
||||
}
|
||||
|
||||
// Mannaggia il fruttivendolo
|
||||
class TFP_righe_custom : public TObject
|
||||
@ -558,8 +567,8 @@ public:
|
||||
int force_commit();
|
||||
void set_cache_insert(const bool v) { _cache_insert = v; }
|
||||
bool tracciati_2021() const { return _tracciati_2021; }
|
||||
|
||||
TDoc_fp();
|
||||
~TDoc_fp();
|
||||
};
|
||||
|
||||
#endif // __FPLIB_H
|
||||
|
@ -15,29 +15,48 @@
|
||||
#include <cfven.h>
|
||||
#include <nditte.h>
|
||||
#include <unloc.h>
|
||||
#include <indsp.h>
|
||||
#include "../cg/cfban.h"
|
||||
#include <modaut.h>
|
||||
#include <netutils.h>
|
||||
#include <urldefid.h>
|
||||
#include "../li/letint.h"
|
||||
|
||||
bool set_connection(SSimple_query& s)
|
||||
{
|
||||
TString ip = get_db_indirizzo();
|
||||
TString url("http://"); url << ip;
|
||||
TURL u(url);
|
||||
const bool ok = u.ok();
|
||||
|
||||
if (!ok || s.sq_connect(get_db_str_con(), get_db_user(), get_db_password(), TSDB_MSSQL) != NOERR)
|
||||
return warning_box("Impossibile connettersi al DB esterno");
|
||||
bool ok = true;
|
||||
#ifdef DBG
|
||||
TString ip = fp_settings().get_db_indirizzo();
|
||||
if (ip.upper() != "TESTCAMPO2012")
|
||||
{
|
||||
if (s.sq_connect("TESTCAMPO2012@campo_fp",
|
||||
"fp",
|
||||
"fp",
|
||||
TSDB_MSSQL) != NOERR)
|
||||
{
|
||||
warning_box("Impossibile connettersi al DB esterno");
|
||||
ok = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
#endif
|
||||
if (s.sq_connect(
|
||||
fp_settings().get_db_str_con(),
|
||||
fp_settings().get_db_user(),
|
||||
fp_settings().get_db_password(),
|
||||
TSDB_MSSQL) != NOERR)
|
||||
{
|
||||
warning_box("Impossibile connettersi al DB esterno");
|
||||
ok = false;
|
||||
}
|
||||
#ifdef DBG
|
||||
}
|
||||
#endif
|
||||
return ok;
|
||||
}
|
||||
|
||||
SSimple_query& fp_db()
|
||||
{
|
||||
static SSimple_query* db = nullptr;
|
||||
|
||||
if (db == nullptr)
|
||||
{
|
||||
db = new SSimple_query();
|
||||
@ -50,18 +69,24 @@ SSimple_query& fp_db()
|
||||
|
||||
bool run_fp_psw_mask()
|
||||
{
|
||||
TMask m("Password", 1, 30, 5);
|
||||
|
||||
m.add_button_tool(DLG_OK, "~Conferma", TOOL_OK);
|
||||
m.add_button_tool(DLG_CANCEL, "Annulla", TOOL_CANCEL);
|
||||
m.add_string(101, 0, "Password ", 1, 1, 15, "*");
|
||||
m.field(101).check_type(CHECK_REQUIRED);
|
||||
while (m.run() == K_ENTER)
|
||||
static TMask* m;
|
||||
// Cancello la maschera se esiste
|
||||
delete m;
|
||||
m = new TMask("Password", 1, 30, 5);
|
||||
m->add_button_tool(DLG_OK, "~Conferma", TOOL_OK);
|
||||
m->add_button_tool(DLG_CANCEL, "Annulla", TOOL_CANCEL);
|
||||
m->add_string(101, 0, "Password ", 1, 1, 15, "*");
|
||||
m->field(101).check_type(CHECK_REQUIRED);
|
||||
while (m->run() == K_ENTER)
|
||||
{
|
||||
if (m.get(101) == "sirioFATT99") // Hardcoded password are the best!
|
||||
if (m->get(101) == "sirioFATT99") // Hardcoded password are the best!
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return error_box("Password errata");
|
||||
{
|
||||
error_box("Password errata");
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -78,49 +103,58 @@ bool check_tables()
|
||||
* Verranno utilizzati dei file.sql aggiornati con il numero di patch, leggermente scomodo durante la creazione ma facile per i controlli successivamente
|
||||
*/
|
||||
SLIST files = xvt_fsys_list_files(".sql", "sql/fp0/", false);
|
||||
TRectype & tabmod = (TRectype &) cache().get("&FPSQL", "VERSION");
|
||||
const TString & version = tabmod.get("S0");
|
||||
|
||||
TLocalisamfile tabmod(LF_TABMOD);
|
||||
tabmod.put("MOD", "FP");
|
||||
tabmod.put("COD", "SQL");
|
||||
tabmod.put("CODTAB", "VERSION");
|
||||
TString version;
|
||||
if (tabmod.read() == NOERR)
|
||||
version = tabmod.get("S0");
|
||||
for(SLIST_ELT file = xvt_slist_get_first(files); file; file = xvt_slist_get_next(files, file))
|
||||
{
|
||||
TString file_version = TFilename(file->str).name_only();
|
||||
file_version = file_version.mid(2, 4);
|
||||
|
||||
if (file_version <= version)
|
||||
continue;
|
||||
|
||||
TScanner s(file->str);
|
||||
TString query;
|
||||
|
||||
while(s.ok() && !s.eof())
|
||||
ifstream f(file->str);
|
||||
if(f.is_open())
|
||||
{
|
||||
TString line = s.line();
|
||||
|
||||
if (!line.starts_with("--"))
|
||||
{
|
||||
query << line << '\n';
|
||||
// Cerco un ;
|
||||
const int limiter = query.find(';');
|
||||
|
||||
if (limiter >= 0)
|
||||
string s;
|
||||
while(!f.eof())
|
||||
{
|
||||
static string r;
|
||||
r = getline(f);
|
||||
if (r[0] == '-' && r[1] == '-')
|
||||
continue;
|
||||
s += r + '\n';
|
||||
// Cerco un ;
|
||||
const int limiter = s.find(';') + 1;
|
||||
if(limiter > 0)
|
||||
{
|
||||
query = query.left(limiter + 1);
|
||||
|
||||
if(!fp_db().sq_set_exec(query, false) || !fp_db().sq_commit())
|
||||
fatal_box("Impossibile eseguire/salvare la query:\n%s\n%s", (const char *)query, fp_db().sq_get_text_error(false));
|
||||
query.cut(0);
|
||||
}
|
||||
}
|
||||
string query = s.substr(0, limiter);
|
||||
s.erase(0, limiter);
|
||||
if(!fp_db().sq_set_exec(query, false) || !fp_db().sq_commit())
|
||||
{
|
||||
fatal_box("Impossibile eseguire/salvare la query:\n%s\n%s", query.c_str(), fp_db().sq_get_text_error(false));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Salvo su tabmod
|
||||
else
|
||||
{
|
||||
cantread_box(file->str);
|
||||
return false;
|
||||
}
|
||||
// Salvo su tabmod
|
||||
tabmod.zero();
|
||||
tabmod.put("MOD", "FP");
|
||||
tabmod.put("COD", "SQL");
|
||||
tabmod.put("CODTAB", "VERSION");
|
||||
tabmod.put("S0", file_version);
|
||||
if (tabmod.rewrite_write() != NOERR)
|
||||
return !yesno_box("Attenzione! Errore di aggiornamento versione di Database in Campo, continuare? %s", file_version);
|
||||
if(tabmod.rewrite_write() != NOERR && !yesno_box("Attenzione! Errore di aggiornamento versione di Database in Campo, continuare? %s", file_version))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -139,14 +173,12 @@ TString& complete_num_fp(const TCodice_numerazione& codnum, const int numdoc)
|
||||
ret << prefisso << ndoc << postfisso;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* HFATT: tipocf(1) + codcf(6)
|
||||
* BFATT: datadoc(8) + tipodoc_SDI(4) + numdoc(7)
|
||||
*/
|
||||
|
||||
// Crea la coppia di chiavi per il db PAF a partire da un documento vero e proprio
|
||||
bool chiave_paf(const TDocumentoEsteso& doc, TString& hfatt, TString& bfatt)
|
||||
bool chiave_paf(const TDocumento& doc, TString& hfatt, TString& bfatt)
|
||||
{
|
||||
hfatt.cut(0);
|
||||
if (doc.clifor().is_occasionale())
|
||||
@ -156,26 +188,22 @@ bool chiave_paf(const TDocumentoEsteso& doc, TString& hfatt, TString& bfatt)
|
||||
CHECK(hfatt.full(), "Destinatario fattura P.A. non valido");
|
||||
const TCodice_numerazione& codnum = doc.codice_numerazione();
|
||||
//20180101_TD01_123456712345671234567
|
||||
bfatt.cut(0) << doc.get_date(DOC_DATADOC).date2ansi() << '_' << doc.tipo_doc_sdi() << '_' << complete_num_fp(codnum, doc.numero());
|
||||
bfatt.cut(0) << doc.get_date(DOC_DATADOC).date2ansi() << '_' << tipo_doc_sdi(doc) << '_' << complete_num_fp(codnum, doc.numero());
|
||||
return hfatt.full() && bfatt.full();
|
||||
}
|
||||
|
||||
// Crea la coppia di chiavi per il db PAF a partire da un semplice record di testata documento
|
||||
bool chiave_paf(const TRectype& doc, TString& hfatt, TString& bfatt)
|
||||
{
|
||||
const TDocumentoEsteso d(doc);
|
||||
|
||||
const TDocumento d(doc);
|
||||
chiave_paf(d, hfatt, bfatt);
|
||||
return hfatt.full();
|
||||
}
|
||||
|
||||
/*TString get_dest_sdi(const char tipocf, const long codcf, const TString& cod_ind_sped)
|
||||
TString get_dest_sdi(const char tipocf, const long codcf, const TString& cod_ind_sped)
|
||||
{
|
||||
TString codsdi, pec;
|
||||
get_coddest(tipocf, codcf, codsdi, pec, cod_ind_sped);
|
||||
return pec.full() ? pec : codsdi;
|
||||
}
|
||||
|
||||
bool get_coddest(const char tipocf, const long codcf, TString& coddest, TString& pec, const TString& cod_ind_sped)
|
||||
{
|
||||
coddest.cut(0);
|
||||
@ -198,12 +226,12 @@ bool get_coddest(const char tipocf, const long codcf, TString& coddest, TString&
|
||||
const TAnagrafica anag(LF_CLIFO, tipocf, codcf);
|
||||
if (coddest.empty())
|
||||
{
|
||||
if (pec.full() || get_esp_pri_empty())
|
||||
if (pec.full() || fp_settings().get_esp_pri_empty())
|
||||
coddest = "0000000";
|
||||
// Controllo se è straniero
|
||||
else if (anag.estero() && anag.stato_partita_IVA() != "IT")
|
||||
{
|
||||
coddest = get_esp_est() ? get_esp_est_cod() : "";
|
||||
coddest = fp_settings().get_esp_est() ? fp_settings().get_esp_est_cod() : "";
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -214,7 +242,7 @@ bool get_coddest(const char tipocf, const long codcf, TString& coddest, TString&
|
||||
|
||||
inline const TString& no_special(char a)
|
||||
{
|
||||
TString& r = get_tmp_string();
|
||||
TString& r = get_tmp_string().cut(0);
|
||||
|
||||
if(a != '\'')
|
||||
{
|
||||
@ -222,7 +250,6 @@ inline const TString& no_special(char a)
|
||||
}
|
||||
return r;
|
||||
}
|
||||
*/
|
||||
|
||||
const TString& tipo_doc_sdi(const TDocumento& doc)
|
||||
{
|
||||
@ -372,15 +399,14 @@ const TString& TPaf_record::var2str(const TString& fldname, const TVariant& var)
|
||||
if (apici && str[0] != '0' && real::is_natural(str))
|
||||
apici = false;
|
||||
// Parso i caratteri speciali
|
||||
for (int i = 0; i < str.len(); i++)
|
||||
for(int i = 0; i < str.len(); i++)
|
||||
{
|
||||
if (str[i] != '\'')
|
||||
tmp << str[i];
|
||||
tmp << no_special(str[i]);
|
||||
}
|
||||
if (apici)
|
||||
{
|
||||
// Aggiungo apici a inizio e fine riga
|
||||
tmp.insert("'");
|
||||
tmp.insert("'", 0);
|
||||
tmp << '\'';
|
||||
}
|
||||
return tmp;
|
||||
@ -1004,18 +1030,25 @@ bool TDoc_fp::initialize(TDocumentoEsteso& doc)
|
||||
return false;
|
||||
// Preparo il log
|
||||
log(-1, _bfatt);
|
||||
#ifndef DBG
|
||||
// Controllo se il documento è almeno in stato di stampa
|
||||
if (doc.stato() < doc.tipo().stato_finale_stampa())
|
||||
{
|
||||
log(3, "Il documento non e' stato ancora stampato, verra' saltato");
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
#ifndef DBG
|
||||
_is_pa = doc.clifor().get_int("ALLEG") == 7;
|
||||
if (!doc.get_coddest(_coddest, _pec))
|
||||
if (!get_coddest(doc.clifor().tipo(), doc.clifor().codice(), _coddest, _pec, doc.get(DOC_CODINDSP)))
|
||||
{
|
||||
log(1, "Impossibile trovare il codice destinatario per la fattura");
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
_is_pa = false;
|
||||
_coddest = "M5ITOJA";
|
||||
#endif
|
||||
_enapec = _coddest == "0000000" && _pec.full();
|
||||
_privato = _coddest.len() != 6;
|
||||
_caus = TCausale(doc.tipo().causale(), doc.anno());
|
||||
@ -1032,7 +1065,7 @@ bool TDoc_fp::initialize(TDocumentoEsteso& doc)
|
||||
_idx_cassa_previdenziale = 1;
|
||||
// Controllo custom
|
||||
_has_cust = cached_custom_fp().has_custom(doc);
|
||||
if(check_initial(doc) || get_check_not_block())
|
||||
if(check_initial(doc) || fp_settings().get_check_not_block())
|
||||
{
|
||||
return _paf_container.clean_and_erase_paf(_hfatt, _bfatt);
|
||||
}
|
||||
@ -1110,7 +1143,7 @@ int TDoc_fp::commit()
|
||||
if (_to_commit)
|
||||
{
|
||||
// Controllo stato diagnosticato
|
||||
if (!get_no_export_pronto())
|
||||
if (!fp_settings().get_no_export_pronto())
|
||||
{
|
||||
if (fp_db().sq_set_exec("UPDATE PAF0100F SET P1_GESTIONE = 'P' WHERE P1_GESTIONE = 'D'"))
|
||||
{
|
||||
@ -1497,15 +1530,14 @@ void TDoc_fp::fill_buoni(map<TString20, TFPBuono_di_consegna>& buoni, const TStr
|
||||
|
||||
bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
||||
{
|
||||
bool ok = true;
|
||||
if (!initialize(doc))
|
||||
return false;
|
||||
|
||||
bool ok = true;
|
||||
|
||||
ok &= export_paf0100f();
|
||||
|
||||
#ifndef DBG
|
||||
ok &= export_paf3200f();
|
||||
|
||||
#endif
|
||||
|
||||
// <CedentePrestatore>
|
||||
TPaf_record& paf0200f = _paf_container.get_paf("PAF0200F");
|
||||
@ -1565,8 +1597,7 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
||||
if (_ditta.giuridica())
|
||||
{
|
||||
TISAM_recordset anagiu("USE ANAGIU\nFROM CODANAGR=#CODICE\nTO CODANAGR=#CODICE");
|
||||
|
||||
anagiu.set_var("#CODICE", get_firm().get(NDT_CODANAGR));
|
||||
anagiu.set_var("#CODICE", get_firm().get(NDT_CODANAGR));
|
||||
if (anagiu.move_first())
|
||||
{
|
||||
paf0200f.set("P2_ISCRREACAP", anagiu.get(ANG_CAPSOC));
|
||||
@ -1812,7 +1843,7 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
||||
FOR_EACH_PHYSICAL_FPRDOC(doc, r, rdoc)
|
||||
{
|
||||
// Controllo la riga
|
||||
if (check_row(*rdoc) && !get_check_not_block())
|
||||
if (check_row(*rdoc) && !fp_settings().get_check_not_block())
|
||||
return false;
|
||||
_idx_adg_doc_row = 1L;
|
||||
bool skip_riga = false;
|
||||
@ -1873,7 +1904,6 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
||||
* Ogni riga si può rifare a un DDT/Ordine diverso, per questo devo inserire i dati da qua e non in testata
|
||||
*/
|
||||
TArray ancestors;
|
||||
|
||||
find_ancestors(*rdoc, ancestors);
|
||||
for (int i = ancestors.last(); i > 0; i = ancestors.pred(i))
|
||||
{
|
||||
@ -2023,9 +2053,10 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
||||
ok &= insert(paf2100f);
|
||||
}
|
||||
else
|
||||
|
||||
{
|
||||
// Salto tutte le altre righe
|
||||
continue;
|
||||
}
|
||||
// <ScontoMaggiorazione>
|
||||
TString80 sconto_expr = rdoc->get(RDOC_SCONTO);
|
||||
TToken_string sconti;
|
||||
@ -2289,7 +2320,7 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
||||
for(TObject* itm = tiva.first_item(); itm != nullptr; itm = tiva.succ_item())
|
||||
{
|
||||
const TRiepilogo_iva& riva = *dynamic_cast<const TRiepilogo_iva*>(itm);
|
||||
if (!check_riepilogo(doc, riva) && !get_check_not_block())
|
||||
if (!check_riepilogo(doc, riva) && !fp_settings().get_check_not_block())
|
||||
return false;
|
||||
add_riepilogo_iva(paf2200f, riva.cod_iva(), eiva, riva.imponibile(), riva.imposta());
|
||||
}
|
||||
@ -2450,15 +2481,14 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
||||
}
|
||||
bool TDoc_fp::doc_to_paf(const TRectype& rec)
|
||||
{
|
||||
TDocumentoEsteso doc(rec);
|
||||
|
||||
// if (doc.read(rec) == NOERR)
|
||||
// {
|
||||
TDocumentoEsteso doc;
|
||||
if (doc.read(rec) == NOERR)
|
||||
{
|
||||
if (doc_to_paf(doc))
|
||||
return fp_db().sq_commit();
|
||||
|
||||
fp_db().sq_rollback();
|
||||
// }
|
||||
}
|
||||
return false;
|
||||
}
|
||||
bool TDoc_fp::doc_to_paf(const TDoc_key& key)
|
||||
@ -2492,19 +2522,23 @@ TRectype& TDoc_fp::key_to_doc(const TDoc_key& key)
|
||||
TDoc_fp::TDoc_fp() : _doc_rec(nullptr), _log(nullptr), _cache_insert(false)
|
||||
{
|
||||
_ditta.init(LF_NDITTE, prefix().get_codditta());
|
||||
_cofi = get_cofi_tras();
|
||||
const TDate data_inizio = get_date_start_new_fatt();
|
||||
_cofi = fp_settings().get_cofi_tras();
|
||||
const TDate data_inizio = fp_settings().get_date_start_new_fatt();
|
||||
_tracciati_2021 = (data_inizio <= today);
|
||||
if (_cofi.blank())
|
||||
_cofi = _ditta.codice_fiscale();
|
||||
_gestioneallegati = get_gest_alleg();
|
||||
_allegafattura = get_allega_fat();
|
||||
_def_fld = get_fld_dest();
|
||||
#ifdef DBG
|
||||
_gestioneallegati = _allegafattura = false;
|
||||
#else
|
||||
_gestioneallegati = fp_settings().get_gest_alleg();
|
||||
_allegafattura = fp_settings().get_allega_fat();
|
||||
#endif
|
||||
_def_fld = fp_settings().get_fld_dest();
|
||||
if (!_def_fld.ends_with("\\"))
|
||||
{
|
||||
_def_fld << "\\";
|
||||
}
|
||||
_def_usr_fld = get_fld_dest_usr();
|
||||
_def_usr_fld = fp_settings().get_fld_dest_usr();
|
||||
if (_def_usr_fld.empty())
|
||||
{
|
||||
_def_usr_fld = _def_fld;
|
||||
@ -2517,9 +2551,8 @@ TDoc_fp::TDoc_fp() : _doc_rec(nullptr), _log(nullptr), _cache_insert(false)
|
||||
_conai_str = ini_get_string(CONFIG_DITTA, "ve", "DESCCONAIASS");
|
||||
if (_conai_str.empty())
|
||||
_conai_str = "Contributo CONAI assolto ove dovuto";
|
||||
_nascondi_sconti_righe_fatt = get_no_sconti_fatt();
|
||||
_nascondi_sconti_righe_fatt = fp_settings().get_no_sconti_fatt();
|
||||
}
|
||||
|
||||
TDoc_fp::~TDoc_fp()
|
||||
{
|
||||
commit();
|
||||
|
@ -1,11 +1,10 @@
|
||||
#include "fplib.h"
|
||||
|
||||
#include <dongle.h>
|
||||
#include <modaut.h>
|
||||
|
||||
#define FILE_CONFIG CONFIG_DITTA
|
||||
#define FILE_SECTION mod2name(FPAUT)
|
||||
#define FP_TAB_MOD mod2tabname(FPAUT)
|
||||
#define FILE_SECTION "fp"
|
||||
#define FP_TAB_MOD "FP"
|
||||
|
||||
|
||||
|
||||
#define FP_IP "ip"
|
||||
#define FP_DB "db"
|
||||
@ -50,254 +49,241 @@
|
||||
#define FP_SHT_DEF_PREZZO "PREZZONN"
|
||||
#define FP_SHT_DEF_IMPONIBILE "IMPNS"
|
||||
|
||||
const TString& get_db_indirizzo()
|
||||
const TString& TFP_settings::get_db_indirizzo() const
|
||||
{
|
||||
return ini_get_string(FILE_CONFIG, FILE_SECTION, FP_IP);
|
||||
}
|
||||
|
||||
const TString& get_db_database()
|
||||
const TString& TFP_settings::get_db_database() const
|
||||
{
|
||||
return ini_get_string(FILE_CONFIG, FILE_SECTION, FP_DB);
|
||||
}
|
||||
|
||||
const TString& get_db_str_con()
|
||||
const TString& TFP_settings::get_db_str_con() const
|
||||
{
|
||||
TString & strconn = get_tmp_string(128);
|
||||
|
||||
strconn = get_db_indirizzo();
|
||||
strconn << "@" << get_db_database();
|
||||
return strconn;
|
||||
return get_tmp_string().cut(0) << get_db_indirizzo() << "@" << get_db_database();
|
||||
}
|
||||
|
||||
const TString& get_db_user()
|
||||
const TString& TFP_settings::get_db_user() const
|
||||
{
|
||||
return ini_get_string(FILE_CONFIG, FILE_SECTION, FP_USR);
|
||||
}
|
||||
|
||||
const TString& get_db_password()
|
||||
const TString& TFP_settings::get_db_password() const
|
||||
{
|
||||
TString & pwd = get_tmp_string();
|
||||
|
||||
pwd = decode(ini_get_string(FILE_CONFIG, FILE_SECTION, FP_PSW));
|
||||
return pwd;
|
||||
return get_tmp_string().cut(0) << decode(ini_get_string(FILE_CONFIG, FILE_SECTION, FP_PSW));
|
||||
}
|
||||
|
||||
const TString& get_fld_dest()
|
||||
const TString& TFP_settings::get_fld_dest() const
|
||||
{
|
||||
return ini_get_string(FILE_CONFIG, FILE_SECTION, FP_FLD_DEST);
|
||||
}
|
||||
|
||||
const TString& get_fld_dest_usr()
|
||||
const TString& TFP_settings::get_fld_dest_usr() const
|
||||
{
|
||||
return ini_get_string(FILE_CONFIG, FILE_SECTION, FP_FLD_USR_DEST, "");
|
||||
}
|
||||
|
||||
const TString& get_cofi_tras()
|
||||
const TString& TFP_settings::get_cofi_tras() const
|
||||
{
|
||||
return ini_get_string(FILE_CONFIG, FILE_SECTION, FP_COFI_TRAS);
|
||||
}
|
||||
|
||||
const TDate get_data_start_fatt()
|
||||
const TString& TFP_settings::get_data_start_fatt() const
|
||||
{
|
||||
return ini_get_date(FILE_CONFIG, FILE_SECTION, FP_DATASTARTFATT, "01-01-2019");
|
||||
return ini_get_string(FILE_CONFIG, FILE_SECTION, FP_DATASTARTFATT, "01-01-2019");
|
||||
}
|
||||
|
||||
const bool get_gest_alleg()
|
||||
const bool TFP_settings::get_gest_alleg() const
|
||||
{
|
||||
return ini_get_bool(FILE_CONFIG, FILE_SECTION, FP_GEST_ALLEG);
|
||||
}
|
||||
|
||||
const bool get_allega_fat()
|
||||
const bool TFP_settings::get_allega_fat() const
|
||||
{
|
||||
return ini_get_bool(FILE_CONFIG, FILE_SECTION, FP_ALLEG_FAT);
|
||||
}
|
||||
|
||||
const bool get_esp_pri_empty()
|
||||
const bool TFP_settings::get_esp_pri_empty() const
|
||||
{
|
||||
return ini_get_bool(FILE_CONFIG, FILE_SECTION, FP_ESP_PRI);
|
||||
}
|
||||
|
||||
const bool get_esp_est()
|
||||
const bool TFP_settings::get_esp_est() const
|
||||
{
|
||||
return ini_get_bool(FILE_CONFIG, FILE_SECTION, FP_ESP_EST);
|
||||
}
|
||||
|
||||
const TString& get_esp_est_cod()
|
||||
const TString& TFP_settings::get_esp_est_cod() const
|
||||
{
|
||||
return ini_get_string(FILE_CONFIG, FILE_SECTION, FP_ESP_EST_COD, "XXXXXXX");
|
||||
}
|
||||
|
||||
const bool is_f8()
|
||||
const bool TFP_settings::is_f8() const
|
||||
{
|
||||
return ini_get_bool(FILE_CONFIG, FILE_SECTION, FP_F8);
|
||||
}
|
||||
|
||||
const bool get_check_not_block()
|
||||
const bool TFP_settings::get_check_not_block() const
|
||||
{
|
||||
return ini_get_bool(FILE_CONFIG, FILE_SECTION, FP_CHECK_NOT_BLOCK);
|
||||
}
|
||||
|
||||
const TString& get_body_mail(int idx)
|
||||
const TString& TFP_settings::get_body_mail(int idx) const
|
||||
{
|
||||
return ini_get_string(FILE_CONFIG, FILE_SECTION, FP_MAIL, "STOpsTOP", idx);
|
||||
}
|
||||
|
||||
const TString& get_npf(const char * tipodoc, int idx)
|
||||
const TString& TFP_settings::get_npf(const char * tipodoc, int idx) const
|
||||
{
|
||||
TString name; name << FP_NOTA_PIEDE_F << "-" << tipodoc;
|
||||
|
||||
return ini_get_string(FILE_CONFIG, FILE_SECTION, name, "FERMATIostrega", idx);
|
||||
}
|
||||
|
||||
const TString & get_npf_tipodoc(int indx)
|
||||
const TString TFP_settings::get_npf_tipodoc(int indx) const
|
||||
{
|
||||
TString name; name << FP_NOTA_PIEDE_F << "_tipodoc";
|
||||
|
||||
return ini_get_string(FILE_CONFIG, FILE_SECTION, name, "FERMATIostrega", indx);
|
||||
}
|
||||
|
||||
TDate get_date_start_new_fatt()
|
||||
TDate TFP_settings::get_date_start_new_fatt()
|
||||
{
|
||||
return ini_get_date(CONFIG_DITTA, FILE_SECTION, FP_DATASTARTNEWFATT, "01-01-2021");
|
||||
}
|
||||
|
||||
const bool get_no_sconti_fatt()
|
||||
const bool TFP_settings::get_no_sconti_fatt() const
|
||||
{
|
||||
return ini_get_bool(FILE_CONFIG, FILE_SECTION, FP_CHECK_NO_SCONTI_FATT, false);
|
||||
}
|
||||
|
||||
bool get_no_export_pronto()
|
||||
bool TFP_settings::get_no_export_pronto() const
|
||||
{
|
||||
return ini_get_bool(FILE_CONFIG, FILE_SECTION, FP_CHECK_NO_EXPORT_PRONTO, false);
|
||||
}
|
||||
|
||||
void set_db_indirizzo(const TString& ind)
|
||||
void TFP_settings::set_db_indirizzo(const TString& ind) const
|
||||
{
|
||||
ini_set_string(FILE_CONFIG, FILE_SECTION, FP_IP, ind);
|
||||
}
|
||||
|
||||
void set_db_database(const TString& db)
|
||||
void TFP_settings::set_db_database(const TString& db) const
|
||||
{
|
||||
ini_set_string(FILE_CONFIG, FILE_SECTION, FP_DB, db);
|
||||
}
|
||||
|
||||
void set_db_user(const TString& usr)
|
||||
void TFP_settings::set_db_user(const TString& usr) const
|
||||
{
|
||||
ini_set_string(FILE_CONFIG, FILE_SECTION, FP_USR, usr);
|
||||
}
|
||||
|
||||
void set_db_password(const TString& psw)
|
||||
void TFP_settings::set_db_password(const TString& psw) const
|
||||
{
|
||||
ini_set_string(FILE_CONFIG, FILE_SECTION, FP_PSW, encode(psw));
|
||||
}
|
||||
|
||||
void set_fld_dest(const TString& fld_dest)
|
||||
void TFP_settings::set_fld_dest(const TString& fld_dest) const
|
||||
{
|
||||
ini_set_string(FILE_CONFIG, FILE_SECTION, FP_FLD_DEST, fld_dest);
|
||||
}
|
||||
|
||||
void set_fld_dest_usr(const TString& fld_dest_usr)
|
||||
void TFP_settings::set_fld_dest_usr(const TString& fld_dest_usr) const
|
||||
{
|
||||
ini_set_string(FILE_CONFIG, FILE_SECTION, FP_FLD_USR_DEST, fld_dest_usr);
|
||||
}
|
||||
|
||||
void set_cofi_tras(const TString& cofi)
|
||||
void TFP_settings::set_cofi_tras(const TString& cofi) const
|
||||
{
|
||||
ini_set_string(FILE_CONFIG, FILE_SECTION, FP_COFI_TRAS, cofi);
|
||||
}
|
||||
|
||||
void set_gest_alleg(const bool gest_alleg)
|
||||
void TFP_settings::set_gest_alleg(const bool gest_alleg) const
|
||||
{
|
||||
ini_set_bool(FILE_CONFIG, FILE_SECTION, FP_GEST_ALLEG, gest_alleg);
|
||||
}
|
||||
|
||||
void set_allega_fat(const bool allega_fatt)
|
||||
void TFP_settings::set_allega_fat(const bool allega_fatt) const
|
||||
{
|
||||
ini_set_bool(FILE_CONFIG, FILE_SECTION, FP_ALLEG_FAT, allega_fatt);
|
||||
}
|
||||
|
||||
void set_esp_pri_empty(const bool esp_pri)
|
||||
void TFP_settings::set_esp_pri_empty(const bool esp_pri) const
|
||||
{
|
||||
ini_set_bool(FILE_CONFIG, FILE_SECTION, FP_ESP_PRI, esp_pri);
|
||||
}
|
||||
|
||||
void set_esp_est(const bool esp_est)
|
||||
void TFP_settings::set_esp_est(const bool esp_est) const
|
||||
{
|
||||
ini_set_bool(FILE_CONFIG, FILE_SECTION, FP_ESP_EST, esp_est);
|
||||
}
|
||||
|
||||
void set_esp_est_cod(const TString& esp_est_cod)
|
||||
void TFP_settings::set_esp_est_cod(const TString& esp_est_cod) const
|
||||
{
|
||||
ini_set_string(FILE_CONFIG, FILE_SECTION, FP_ESP_EST_COD, esp_est_cod);
|
||||
}
|
||||
|
||||
void set_f8(const bool f8)
|
||||
void TFP_settings::set_f8(const bool f8) const
|
||||
{
|
||||
ini_set_bool(FILE_CONFIG, FILE_SECTION, FP_F8, f8);
|
||||
}
|
||||
|
||||
void set_check_not_block(const bool not_block)
|
||||
void TFP_settings::set_check_not_block(const bool not_block) const
|
||||
{
|
||||
ini_set_bool(FILE_CONFIG, FILE_SECTION, FP_CHECK_NOT_BLOCK, not_block);
|
||||
}
|
||||
|
||||
void set_body_mail(const char* msg, int idx)
|
||||
void TFP_settings::set_body_mail(const char* msg, int idx) const
|
||||
{
|
||||
ini_set_string(FILE_CONFIG, FILE_SECTION, FP_MAIL, msg, idx);
|
||||
}
|
||||
|
||||
// Set nota piede fattura
|
||||
void set_npf(const char * tipodoc, const char* msg, int idx)
|
||||
void TFP_settings::set_npf(const char * tipodoc, const char* msg, int idx) const
|
||||
{
|
||||
TString name; name << FP_NOTA_PIEDE_F << "-" << tipodoc;
|
||||
|
||||
ini_set_string(FILE_CONFIG, FILE_SECTION, name, msg, idx);
|
||||
}
|
||||
|
||||
void set_no_sconti_fatt(const bool no_sconti_fatt)
|
||||
void TFP_settings::set_no_sconti_fatt(const bool no_sconti_fatt) const
|
||||
{
|
||||
ini_set_bool(FILE_CONFIG, FILE_SECTION, FP_CHECK_NO_SCONTI_FATT, no_sconti_fatt);
|
||||
}
|
||||
|
||||
void set_no_export_pronto(const bool no_export_pronto)
|
||||
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 set_data_start_fatt(const char* date)
|
||||
void TFP_settings::set_data_start_fatt(const char* date) const
|
||||
{
|
||||
ini_set_string(FILE_CONFIG, FILE_SECTION, FP_DATASTARTFATT, date);
|
||||
}
|
||||
|
||||
void set_data_start_new_fatt(const char* date)
|
||||
void TFP_settings::set_data_start_new_fatt(const char* date) const
|
||||
{
|
||||
ini_set_string(CONFIG_DITTA, FILE_SECTION, FP_DATASTARTNEWFATT, date);
|
||||
}
|
||||
|
||||
void remove_para_ini(int idx)
|
||||
void TFP_settings::remove_para_ini(int idx)
|
||||
{
|
||||
ini_remove(FILE_CONFIG, FILE_SECTION, FP_MAIL, idx);
|
||||
}
|
||||
|
||||
void remove_npf_ini(const char * tipodoc, int idx)
|
||||
void TFP_settings::remove_npf_ini(const char * tipodoc, int idx)
|
||||
{
|
||||
TString name; name << FP_NOTA_PIEDE_F << "-" << tipodoc;
|
||||
|
||||
ini_remove(FILE_CONFIG, FILE_SECTION, name, idx);
|
||||
}
|
||||
|
||||
void set_npf_tipodoc(const TString& tipodoc, int indx)
|
||||
void TFP_settings::set_npf_tipodoc(const TString& tipodoc, int indx) const
|
||||
{
|
||||
TString name; name << FP_NOTA_PIEDE_F << "_tipodoc";
|
||||
|
||||
ini_set_string(FILE_CONFIG, FILE_SECTION, name, tipodoc, indx);
|
||||
}
|
||||
|
||||
// Rimuove linea ini in eccesso per tipodoc per nota piede fattura
|
||||
void remove_tipodoc_npf(const int idx)
|
||||
void TFP_settings::remove_tipodoc_npf(const int idx) const
|
||||
{
|
||||
TString name; name << FP_NOTA_PIEDE_F << "_tipodoc";
|
||||
|
||||
ini_remove(FILE_CONFIG, FILE_SECTION, name, idx);
|
||||
}
|
||||
|
||||
@ -401,16 +387,16 @@ void TFP_nota_piede_f::write_ini_npf(const TString& tipodoc, TToken_string& msg)
|
||||
// Conto quanti ne avevo salvati prima nel file ini per poi controllare
|
||||
// che non sto salvando meno di quelli che ci sono già
|
||||
int previous_indx = 0;
|
||||
for (TString row = get_npf(tipodoc, previous_indx); row != "FERMATIostrega"; row = get_npf(tipodoc, previous_indx))
|
||||
for (TString row = fp_settings().get_npf(tipodoc, previous_indx); row != "FERMATIostrega"; row = fp_settings().get_npf(tipodoc, previous_indx))
|
||||
previous_indx++;
|
||||
// Vado a salvare ogni riga nel file ini
|
||||
for (const char* row = msg.get(); row; row = msg.get())
|
||||
set_npf(tipodoc, row, indx++);
|
||||
fp_settings().set_npf(tipodoc, row, indx++);
|
||||
|
||||
if (indx < previous_indx)
|
||||
{
|
||||
for (int i = indx; i < previous_indx; i++)
|
||||
remove_npf_ini(tipodoc, i);
|
||||
fp_settings().remove_npf_ini(tipodoc, i);
|
||||
}
|
||||
}
|
||||
|
||||
@ -419,10 +405,10 @@ void TFP_nota_piede_f::delete_ini_npf(const TString& tipodoc)
|
||||
// Conto quanti ne avevo salvati prima nel file ini per poi controllare
|
||||
// che non sto salvando meno di quelli che ci sono già
|
||||
int previous_indx = 0;
|
||||
for (TString row = get_npf(tipodoc, previous_indx); row != "FERMATIostrega"; row = get_npf(tipodoc, previous_indx))
|
||||
for (TString row = fp_settings().get_npf(tipodoc, previous_indx); row != "FERMATIostrega"; row = fp_settings().get_npf(tipodoc, previous_indx))
|
||||
previous_indx++;
|
||||
for (int i = 0; i < previous_indx; i++)
|
||||
remove_npf_ini(tipodoc, i);
|
||||
fp_settings().remove_npf_ini(tipodoc, i);
|
||||
|
||||
}
|
||||
|
||||
@ -432,7 +418,7 @@ TString TFP_nota_piede_f::get_ini_npf(const TString& tipodoc)
|
||||
TString msg; msg.cut(0);
|
||||
|
||||
int indx = 0;
|
||||
for (TString row = get_npf(tipodoc, indx); row != "FERMATIostrega"; row = get_npf(tipodoc, indx))
|
||||
for (TString row = fp_settings().get_npf(tipodoc, indx); row != "FERMATIostrega"; row = fp_settings().get_npf(tipodoc, indx))
|
||||
{
|
||||
if(indx++ > 0)
|
||||
msg << '\n';
|
||||
@ -446,7 +432,7 @@ void TFP_nota_piede_f::get_load()
|
||||
// Prima leggo i tipi doc che ho salvato dall'ini
|
||||
TString tipo_get = "";
|
||||
int indx = 0;
|
||||
while ((tipo_get = get_npf_tipodoc(indx++)) != "FERMATIostrega")
|
||||
while ((tipo_get = fp_settings().get_npf_tipodoc(indx++)) != "FERMATIostrega")
|
||||
_tipi_doc.add(tipo_get);
|
||||
|
||||
const int itms = _tipi_doc.items();
|
||||
@ -465,7 +451,7 @@ void TFP_nota_piede_f::load_sheet(TSheet_field& sheet_field)
|
||||
// Prima leggo i tipi doc che ho salvato dall'ini
|
||||
TString tipo_get = "";
|
||||
int indx = 0;
|
||||
while((tipo_get = get_npf_tipodoc(indx++)) != "FERMATIostrega")
|
||||
while((tipo_get = fp_settings().get_npf_tipodoc(indx++)) != "FERMATIostrega")
|
||||
_tipi_doc.add(tipo_get);
|
||||
|
||||
int i = 0;
|
||||
@ -509,7 +495,7 @@ void TFP_nota_piede_f::save_new_tipidoc(TSheet_field& sheet_field)
|
||||
int n_tipidoc = 0;
|
||||
TString npf_get;
|
||||
// Conto quanti tipi doc ho nel file ini
|
||||
for (int i = 0; (npf_get = get_npf_tipodoc(i)) != "FERMATIostrega"; i++)
|
||||
for (int i = 0; (npf_get = fp_settings().get_npf_tipodoc(i)) != "FERMATIostrega"; i++)
|
||||
{
|
||||
n_tipidoc++;
|
||||
_tipi_doc.add(npf_get);
|
||||
@ -521,13 +507,12 @@ void TFP_nota_piede_f::save_new_tipidoc(TSheet_field& sheet_field)
|
||||
{
|
||||
TToken_string row = sheet_field.row(i);
|
||||
TString tipodoc_sf(row.get(0));
|
||||
|
||||
set_npf_tipodoc(tipodoc_sf, i);
|
||||
fp_settings().set_npf_tipodoc(tipodoc_sf, i);
|
||||
}
|
||||
|
||||
if (items_sf < n_tipidoc)
|
||||
for (int i = items_sf; i < n_tipidoc; i++)
|
||||
remove_tipodoc_npf(i);
|
||||
fp_settings().remove_tipodoc_npf(i);
|
||||
}
|
||||
|
||||
void TFP_nota_piede_f::save_sheet(TSheet_field& sheet_field)
|
||||
|
@ -63,7 +63,7 @@ bool TFp_mail_sender::send(const TString& msg)
|
||||
bool ok = false;
|
||||
if (_alleg && !_mail.blank() && _accord)
|
||||
{
|
||||
_pdf_path = get_fld_dest_usr(); // Cartella dove ci sono i pdf generati
|
||||
_pdf_path = fp_settings().get_fld_dest_usr(); // Cartella dove ci sono i pdf generati
|
||||
|
||||
TFilename pdf; pdf << _pdf_path << _pdf_name;
|
||||
|
||||
@ -86,7 +86,7 @@ bool TFp_mail_sender::send(const TString& msg)
|
||||
|
||||
if(ok)
|
||||
{
|
||||
TDocumentoEsteso fdoc('D', _anno, _codnum, _ndoc);
|
||||
TDocumento fdoc('D', _anno, _codnum, _ndoc);
|
||||
TString hfatt, bfatt;
|
||||
TPaf_record paf0100f("PAF0100F");
|
||||
TString query;
|
||||
|
@ -73,7 +73,7 @@ int n;
|
||||
tmpa[i] = pSrc[i];
|
||||
|
||||
/* sort pointers */
|
||||
qsort((void *)tmpa,n,sizeof(DEC *), (int (__cdecl *)(void)) _SortInc);
|
||||
qsort((void *)tmpa,n,sizeof(DEC *), _SortInc);
|
||||
|
||||
if (n%2)
|
||||
_MacDCopy(pDst, tmpa[(n-1)/2]);
|
||||
|
@ -5,6 +5,7 @@
|
||||
|
||||
#include "../cg/cglib.h"
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// TRigheF24_set
|
||||
///////////////////////////////////////////////////////////
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include <utility.h>
|
||||
|
||||
#include "../cg/cg2101.h"
|
||||
#include "../cg/cglib.h"
|
||||
#include "../cg/cg2103.h"
|
||||
#include "../cg/cgsaldac.h"
|
||||
#include "../mg/movmag.h"
|
||||
#include "../mg/rmovmag.h"
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user