Patch level : 12.0 902
Files correlati : ps6215.exe ps6215100a.msk Commento : Esportazione tabelle per CO.MA.RI.
This commit is contained in:
parent
cf71dd1e2a
commit
e61201e805
@ -51,6 +51,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vedoc", "vedoc.vcxproj", "{
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ps1004", "ps1004.vcxproj", "{FEE6BF0D-35E7-441C-AACD-B903065DC90E}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ps6215", "ps6215.vcxproj", "{42AC85CF-2D74-4ADB-8CC4-87CE816B1508}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
@ -153,6 +155,10 @@ Global
|
||||
{FEE6BF0D-35E7-441C-AACD-B903065DC90E}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{FEE6BF0D-35E7-441C-AACD-B903065DC90E}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{FEE6BF0D-35E7-441C-AACD-B903065DC90E}.Release|Win32.Build.0 = Release|Win32
|
||||
{42AC85CF-2D74-4ADB-8CC4-87CE816B1508}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{42AC85CF-2D74-4ADB-8CC4-87CE816B1508}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{42AC85CF-2D74-4ADB-8CC4-87CE816B1508}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{42AC85CF-2D74-4ADB-8CC4-87CE816B1508}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
177
build/ps6215.vcxproj
Normal file
177
build/ps6215.vcxproj
Normal file
@ -0,0 +1,177 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{42AC85CF-2D74-4ADB-8CC4-87CE816B1508}</ProjectGuid>
|
||||
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\exe\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\obj\$(SolutionName)\$(ProjectName)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\exe\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\obj\$(SolutionName)\$(ProjectName)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Midl>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MkTypLibCompatible>true</MkTypLibCompatible>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<TargetEnvironment>Win32</TargetEnvironment>
|
||||
<TypeLibraryName>.\..\release/ps1004.tlb</TypeLibraryName>
|
||||
<HeaderFileName>
|
||||
</HeaderFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||
<AdditionalIncludeDirectories>..\src\xvtdb\;..\src\cg;..\src\include;..\src\xvaga;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>NDEBUG;WIN32;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<StringPooling>true</StringPooling>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeaderOutputFile>.\..\release/ps1004.pch</PrecompiledHeaderOutputFile>
|
||||
<AssemblerListingLocation>.\..\release/</AssemblerListingLocation>
|
||||
<ObjectFileName>.\..\release/</ObjectFileName>
|
||||
<ProgramDataBaseFileName>.\..\release/</ProgramDataBaseFileName>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0410</Culture>
|
||||
<AdditionalIncludeDirectories>..\wx28X\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>wsock32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
|
||||
<ProgramDatabaseFile>.\..\release/ps1004.pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
<Bscmake>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<OutputFile>.\..\release/ps1004.bsc</OutputFile>
|
||||
</Bscmake>
|
||||
<PostBuildEvent>
|
||||
<Command>"C:\Program Files (x86)\Windows Kits\10\bin\10.0.16299.0\x64\signtool.exe" sign /a /s MY /n "Sirio Informatica e Sistemi SPA" /t http://timestamp.verisign.com/scripts/timstamp.dll /v "$(TargetPath)"</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Midl>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MkTypLibCompatible>true</MkTypLibCompatible>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<TargetEnvironment>Win32</TargetEnvironment>
|
||||
<TypeLibraryName>.\..\debug/ps1004.tlb</TypeLibraryName>
|
||||
<HeaderFileName>
|
||||
</HeaderFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\src\xvtdb\;..\src\cg;..\src\include;..\src\xvaga;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_DEBUG;WIN32;__LONGDOUBLE__;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PrecompiledHeaderOutputFile>.\..\debug/ps1004.pch</PrecompiledHeaderOutputFile>
|
||||
<AssemblerListingLocation>.\..\debug/</AssemblerListingLocation>
|
||||
<ObjectFileName>.\..\debug/</ObjectFileName>
|
||||
<ProgramDataBaseFileName>.\..\debug/</ProgramDataBaseFileName>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0410</Culture>
|
||||
<AdditionalIncludeDirectories>..\libraries\wx28X\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>wsock32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>.\..\debug/ps1004.pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
|
||||
</Link>
|
||||
<Bscmake>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<OutputFile>.\..\debug/ps1004.bsc</OutputFile>
|
||||
</Bscmake>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="AgaLib.vcxproj">
|
||||
<Project>{2d38a763-3d74-4338-9362-b891784ec90e}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="campo.rc">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\libraries\wx28X\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\src\ps\ps6215.cpp" />
|
||||
<ClCompile Include="..\src\ps\ps6215100.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\src\ps\ps6215.h" />
|
||||
<ClInclude Include="..\src\ps\ps6215100a.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CustomBuild Include="..\src\ps\ps6215100a.uml">
|
||||
<FileType>Document</FileType>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">msk32 %(FullPath) $(TargetDir)%(Filename).msk</Command>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Compiling mask %(FullPath)...</Message>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(TargetDir)%(Filename).msk;%(Outputs)</Outputs>
|
||||
</CustomBuild>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
41
build/ps6215.vcxproj.filters
Normal file
41
build/ps6215.vcxproj.filters
Normal file
@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Sources">
|
||||
<UniqueIdentifier>{2aa15991-562d-4fba-afc5-a0fd3b06ec97}</UniqueIdentifier>
|
||||
<Extensions>cpp</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Masks">
|
||||
<UniqueIdentifier>{c41a2928-af62-4e3d-94cd-59438053b6e2}</UniqueIdentifier>
|
||||
<Extensions>uml</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Headers">
|
||||
<UniqueIdentifier>{ca21a647-c7c2-492c-bbbe-26d801e87179}</UniqueIdentifier>
|
||||
<Extensions>h</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="campo.rc" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\src\ps\ps6215100.cpp">
|
||||
<Filter>Sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\ps\ps6215.cpp">
|
||||
<Filter>Sources</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\src\ps\ps6215.h">
|
||||
<Filter>Headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\ps\ps6215100a.h">
|
||||
<Filter>Headers</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CustomBuild Include="..\src\ps\ps6215100a.uml">
|
||||
<Filter>Masks</Filter>
|
||||
</CustomBuild>
|
||||
</ItemGroup>
|
||||
</Project>
|
15
src/ps/ps6215.cpp
Normal file
15
src/ps/ps6215.cpp
Normal file
@ -0,0 +1,15 @@
|
||||
#include <xvt.h>
|
||||
#include "ps6215.h"
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
int rt = -1;
|
||||
const int r = (argc > 1) ? atoi(&argv[1][1]) : 1;
|
||||
|
||||
switch (r)
|
||||
{
|
||||
default:
|
||||
case 0: rt = ps6215100(argc, argv); break; // Configurazione
|
||||
}
|
||||
return rt;
|
||||
}
|
6
src/ps/ps6215.h
Normal file
6
src/ps/ps6215.h
Normal file
@ -0,0 +1,6 @@
|
||||
#ifndef __PS6215_H
|
||||
#define __PS6215_H
|
||||
|
||||
int ps6215100(int argc, char* argv[]);
|
||||
|
||||
#endif // __PS6215_H
|
341
src/ps/ps6215100.cpp
Normal file
341
src/ps/ps6215100.cpp
Normal file
@ -0,0 +1,341 @@
|
||||
#include <applicat.h>
|
||||
#include <automask.h>
|
||||
#include <tsdb.h>
|
||||
#include <progind.h>
|
||||
#include <relation.h>
|
||||
|
||||
#include "ps6215.h"
|
||||
#include "ps6215100a.h"
|
||||
#include "utility.h"
|
||||
#include "clifo.h"
|
||||
#include "comuni.h"
|
||||
#include "cfven.h"
|
||||
|
||||
#define CLIFO_RECLEN 730
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// Utilities
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
void copy_wzero(char* dest, const int size, const char* source)
|
||||
{
|
||||
for(int i = 0; i < size; ++i)
|
||||
{
|
||||
const char c = source[i];
|
||||
if (c == '\0')
|
||||
break;
|
||||
dest[i] = c;
|
||||
}
|
||||
}
|
||||
|
||||
TString& trim_n(TString& str, const int max)
|
||||
{
|
||||
if(str.len() > max)
|
||||
str.rtrim(str.len() - max);
|
||||
return str;
|
||||
}
|
||||
|
||||
TString to_escape(const TString& val)
|
||||
{
|
||||
TString& app = get_tmp_string();
|
||||
for (int k = 0; k < val.len(); k++)
|
||||
{
|
||||
switch (val[k])
|
||||
{
|
||||
case '\'':
|
||||
app << "''";
|
||||
break;
|
||||
default:
|
||||
app << val[k];
|
||||
break;
|
||||
}
|
||||
}
|
||||
return app;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// Main Mask
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
class TComariExport_mask final : public TAutomask
|
||||
{
|
||||
protected:
|
||||
bool on_field_event(TOperable_field& o, TField_event e, long jolly) override;
|
||||
void load_all();
|
||||
public:
|
||||
void save_all() const;
|
||||
TComariExport_mask();
|
||||
~TComariExport_mask() { save_all(); }
|
||||
};
|
||||
|
||||
bool TComariExport_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
TComariExport_mask::TComariExport_mask() : TAutomask("ps6215100a")
|
||||
{
|
||||
load_all();
|
||||
}
|
||||
|
||||
void TComariExport_mask::save_all() const
|
||||
{
|
||||
ini_set_string(CONFIG_DITTA, "ps6215", "flddest", get(F_FLDDEST));
|
||||
ini_set_string(CONFIG_DITTA, "ps6215", "clifor_bool", get(F_CLIFOR));
|
||||
}
|
||||
|
||||
void TComariExport_mask::load_all()
|
||||
{
|
||||
TFilename temp;
|
||||
temp.tempdir();
|
||||
set(F_FLDDEST, ini_get_string(CONFIG_DITTA, "ps6215", "flddest", temp));
|
||||
set(F_CLIFOR, ini_get_string(CONFIG_DITTA, "ps6215", "clifor_bool", "X"));
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// Main Program
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
class TComariExport_app : public TSkeleton_application
|
||||
{
|
||||
TString _fld_dest;
|
||||
|
||||
bool export_all() const;
|
||||
static void add_to_record(char* record, TString& str, int len, int& index);
|
||||
static void export_clifo(ofstream& fout);
|
||||
bool export_table(short id) const;
|
||||
public:
|
||||
bool create() override;
|
||||
void main_loop() override;
|
||||
TComariExport_app() = default;
|
||||
};
|
||||
|
||||
bool TComariExport_app::export_all() const
|
||||
{
|
||||
return
|
||||
export_table(F_CLIFOR) &&
|
||||
export_table(F_PIANOCONTI) &&
|
||||
export_table(F_MASTRI);
|
||||
}
|
||||
|
||||
void TComariExport_app::add_to_record(char* record, TString& str, int len, int& index)
|
||||
{
|
||||
trim_n(str, len);
|
||||
copy_wzero(record + index, CLIFO_RECLEN - index, str);
|
||||
index += len;
|
||||
}
|
||||
|
||||
void TComariExport_app::export_clifo(ofstream& fout)
|
||||
{
|
||||
int index = 0;
|
||||
TLocalisamfile clifo(LF_CLIFO);
|
||||
bool ok = clifo.read(_isfirst) == NOERR;
|
||||
int items = clifo.items();
|
||||
TProgress_monitor bar(items, "Esportazione Tabella Clienti Fornitori");
|
||||
for(; ok; ok = clifo.next() == NOERR)
|
||||
{
|
||||
if (!bar.add_status())
|
||||
break;
|
||||
|
||||
char record[CLIFO_RECLEN]; memset(record, ' ', CLIFO_RECLEN);
|
||||
index = 0;
|
||||
TLocalisamfile comuni(LF_COMUNI), cfven(LF_CFVEN);
|
||||
comuni.put(COM_STATO, clifo.get(CLI_STATOCF));
|
||||
comuni.put(COM_COM, clifo.get(CLI_COMCF));
|
||||
comuni.read();
|
||||
cfven.put(CFV_CODCF, clifo.get(CLI_CODCF));
|
||||
cfven.put(CFV_TIPOCF, clifo.get(CLI_TIPOCF));
|
||||
cfven.read();
|
||||
|
||||
// Tipo:
|
||||
TString a = clifo.get(CLI_TIPOCF);
|
||||
if(a[0] != 'C' && a != 'F')
|
||||
a[0] = 'C';
|
||||
add_to_record(record, a, 1, index);
|
||||
// Codcf:
|
||||
a = clifo.get(CLI_CODCF);
|
||||
add_to_record(record, a, 15, index);
|
||||
// Descrizione:
|
||||
a = clifo.get(CLI_RAGSOC);
|
||||
a.rpad(50);
|
||||
TString b = a.sleft(30);
|
||||
add_to_record(record, b, 40, index);
|
||||
// Descrizione2:
|
||||
b = a.sright(20);
|
||||
add_to_record(record, b, 40, index);
|
||||
// Indirizzo:
|
||||
a = clifo.get(CLI_INDCF);
|
||||
a << ", " << clifo.get(CLI_CIVCF);
|
||||
add_to_record(record, a, 35, index);
|
||||
// Indirizzo2:
|
||||
a = "";
|
||||
add_to_record(record, a, 35, index);
|
||||
// CAP:
|
||||
a = clifo.get(CLI_CAPCF);
|
||||
add_to_record(record, a, 5, index);
|
||||
// Localita':
|
||||
a = clifo.get(CLI_LOCCF);
|
||||
add_to_record(record, a, 30, index);
|
||||
// Provincia:
|
||||
a = comuni.get(COM_PROVCOM);
|
||||
add_to_record(record, a, 2, index);
|
||||
// Telefono:
|
||||
a = clifo.get(CLI_PTEL);
|
||||
a << clifo.get(CLI_TEL);
|
||||
add_to_record(record, a, 18, index);
|
||||
// Cellulare:
|
||||
a = clifo.get(CLI_PTEL2);
|
||||
a << clifo.get(CLI_TEL2);
|
||||
add_to_record(record, a, 18, index);
|
||||
// Fax:
|
||||
a = clifo.get(CLI_PFAX);
|
||||
a << clifo.get(CLI_FAX);
|
||||
add_to_record(record, a, 18, index);
|
||||
// Persona fisica:
|
||||
a = clifo.get(CLI_TIPOPERS)[0] == 'F' ? "S" : "N";
|
||||
add_to_record(record, a, 1, index);
|
||||
// Sesso:
|
||||
a = clifo.get(CLI_SESSO);
|
||||
add_to_record(record, a, 1, index);
|
||||
// Nascita:
|
||||
a = clifo.get_date(CLI_DATANASC).date2ansi();
|
||||
add_to_record(record, a, 8, index);
|
||||
// Luogo di nascita:
|
||||
comuni.zero();
|
||||
comuni.put(COM_STATO, clifo.get(CLI_STATONASC));
|
||||
comuni.put(COM_COM, clifo.get(CLI_COMNASC));
|
||||
comuni.read();
|
||||
a = comuni.get(COM_DENCOM);
|
||||
add_to_record(record, a, 30, index);
|
||||
// Provincia Nascita:
|
||||
a = comuni.get(COM_PROVCOM);
|
||||
add_to_record(record, a, 2, index);
|
||||
// Codice fiscale:
|
||||
a = clifo.get(CLI_COFI);
|
||||
add_to_record(record, a, 16, index);
|
||||
// Partita IVA:
|
||||
a = clifo.get(CLI_PAIV);
|
||||
add_to_record(record, a, 12, index);
|
||||
// Mastro:
|
||||
a = clifo.get(CLI_GRUPPO);
|
||||
a << clifo.get(CLI_CONTO);
|
||||
add_to_record(record, a, 20, index);
|
||||
// Partite:
|
||||
a = " ";
|
||||
add_to_record(record, a, 1, index);
|
||||
// Codice pagamento:
|
||||
a = clifo.get(CLI_CODPAG);
|
||||
add_to_record(record, a, 5, index);
|
||||
// Codice zona:
|
||||
a = cfven.get(CFV_CODZONA);
|
||||
add_to_record(record, a, 5, index);
|
||||
// Codice agente1:
|
||||
a = cfven.get(CFV_CODAG1);
|
||||
add_to_record(record, a, 5, index);
|
||||
// Codice Iva:
|
||||
a = cfven.get(CFV_ASSFIS);
|
||||
add_to_record(record, a, 5, index);
|
||||
// Codice Valuta:
|
||||
a = clifo.get(CLI_CODVAL);
|
||||
add_to_record(record, a, 5, index);
|
||||
// Codice Banca:
|
||||
a = clifo.get(CLI_CODABI);
|
||||
a << clifo.get(CLI_CODCAB);
|
||||
add_to_record(record, a, 10, index);
|
||||
// Primo mese:
|
||||
a = " ";
|
||||
add_to_record(record, a, 2, index);
|
||||
// Secondo mese:
|
||||
a = " ";
|
||||
add_to_record(record, a, 2, index);
|
||||
// Primo gg scadenze:
|
||||
a = " ";
|
||||
add_to_record(record, a, 2, index);
|
||||
// Secondo gg:
|
||||
a = " ";
|
||||
add_to_record(record, a, 2, index);
|
||||
// Codice Lingua:
|
||||
a = clifo.get(CLI_CODLIN);
|
||||
add_to_record(record, a, 5, index);
|
||||
// Conto corrente:
|
||||
a = clifo.get(CLI_NUMCC);
|
||||
add_to_record(record, a, 15, index);
|
||||
// Indirizzo e-mail:
|
||||
a = clifo.get(CLI_DOCMAIL);
|
||||
add_to_record(record, a, 50, index);
|
||||
// Ritenute:
|
||||
a = "N";
|
||||
add_to_record(record, a, 1, index);
|
||||
// Codice tributo:
|
||||
a = " ";
|
||||
add_to_record(record, a, 4, index);
|
||||
// Codice tributo:
|
||||
a = " ";
|
||||
add_to_record(record, a, 4, index);
|
||||
// Categoria contabile :
|
||||
a = " ";
|
||||
add_to_record(record, a, 5, index);
|
||||
// Annotazioni:
|
||||
a = " ";
|
||||
add_to_record(record, a, 255, index);
|
||||
|
||||
fout << record << '\n';
|
||||
}
|
||||
}
|
||||
|
||||
bool TComariExport_app::export_table(const short id) const
|
||||
{
|
||||
bool ok = false;
|
||||
ofstream fout;
|
||||
TString path = _fld_dest;
|
||||
|
||||
if (id == F_CLIFOR)
|
||||
{
|
||||
path << "\\clifo.txt";
|
||||
fout.open(path, ios_base::out);
|
||||
if ((ok = fout.is_open()))
|
||||
{
|
||||
export_clifo(fout);
|
||||
fout.close();
|
||||
}
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool TComariExport_app::create()
|
||||
{
|
||||
open_files(LF_CLIFO, LF_CFVEN, LF_COMUNI, 0);
|
||||
return TSkeleton_application::create();
|
||||
}
|
||||
|
||||
void TComariExport_app::main_loop()
|
||||
{
|
||||
const TFixed_string arg = argv(2);
|
||||
if(arg.starts_with("-a") || arg.starts_with("-A"))
|
||||
{
|
||||
const WINDOW task = TASK_WIN;
|
||||
xvt_vobj_set_visible(task, FALSE);
|
||||
export_all();
|
||||
}
|
||||
else
|
||||
{
|
||||
TComariExport_mask msk;
|
||||
while (msk.run() == K_ENTER)
|
||||
{
|
||||
_fld_dest = msk.get(F_FLDDEST);
|
||||
|
||||
for (short i = F_CLIFOR; i <= F_MASTRI; ++i)
|
||||
{
|
||||
if (msk.get_bool(i))
|
||||
export_table(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int ps6215100(const int argc, char* argv[])
|
||||
{
|
||||
TComariExport_app pe;
|
||||
pe.run(argc, argv, TR("Configurazione Esportazione CO.MA.RI."));
|
||||
return 0;
|
||||
}
|
4
src/ps/ps6215100a.h
Normal file
4
src/ps/ps6215100a.h
Normal file
@ -0,0 +1,4 @@
|
||||
#define F_FLDDEST 101
|
||||
#define F_CLIFOR 102
|
||||
#define F_PIANOCONTI 103
|
||||
#define F_MASTRI 104
|
35
src/ps/ps6215100a.uml
Normal file
35
src/ps/ps6215100a.uml
Normal file
@ -0,0 +1,35 @@
|
||||
#include "ps6215100a.h"
|
||||
|
||||
TOOLBAR "topbar" 0 0 0 2
|
||||
#include <stdbar.h>
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Configurazione Esportazione CO.MA.RI." 0 2 0 0
|
||||
|
||||
STRING F_FLDDEST 250 50
|
||||
BEGIN
|
||||
PROMPT 2 1 "Cartella di destinazione"
|
||||
DSELECT
|
||||
FLAGS ""
|
||||
CHECKTYPE REQUIRED
|
||||
END
|
||||
|
||||
BOOLEAN F_CLIFOR
|
||||
BEGIN
|
||||
PROMPT 2 2 "Esporta Clienti/Fornitori"
|
||||
FLAGS ""
|
||||
END
|
||||
|
||||
BOOLEAN F_PIANOCONTI
|
||||
BEGIN
|
||||
PROMPT 2 3 "Esporta Piano dei Conti"
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
BOOLEAN F_MASTRI
|
||||
BEGIN
|
||||
PROMPT 2 4 "Esporta Mastri"
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
ENDPAGE
|
Loading…
x
Reference in New Issue
Block a user