Merge branch 'R_10_00' of http://10.65.20.17:7990/scm/campo/campo into R_10_00

This commit is contained in:
Sirio Builder 2018-09-07 10:11:27 +02:00
commit 26fe6d49e7
20 changed files with 72 additions and 38 deletions

View File

@ -87,6 +87,7 @@
<TargetMachine>MachineX86</TargetMachine> <TargetMachine>MachineX86</TargetMachine>
<Version>12.0</Version> <Version>12.0</Version>
<ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile> <ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
</Link> </Link>
<Bscmake> <Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>

View File

@ -147,6 +147,7 @@
<TargetMachine>MachineX86</TargetMachine> <TargetMachine>MachineX86</TargetMachine>
<Version>12.0</Version> <Version>12.0</Version>
<ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile> <ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
</Link> </Link>
<Bscmake> <Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>

View File

@ -91,6 +91,7 @@
<TargetMachine>MachineX86</TargetMachine> <TargetMachine>MachineX86</TargetMachine>
<Version>12.0</Version> <Version>12.0</Version>
<ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile> <ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
</Link> </Link>
<Bscmake> <Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>

View File

@ -142,6 +142,7 @@
<Version>12.0</Version> <Version>12.0</Version>
<ProfileGuidedDatabase>$(IntDir)$(TargetName).pgd</ProfileGuidedDatabase> <ProfileGuidedDatabase>$(IntDir)$(TargetName).pgd</ProfileGuidedDatabase>
<ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile> <ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
</Link> </Link>
<Bscmake> <Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>

View File

@ -93,6 +93,7 @@
<TargetMachine>MachineX86</TargetMachine> <TargetMachine>MachineX86</TargetMachine>
<Version>12.0</Version> <Version>12.0</Version>
<ProfileGuidedDatabase>$(IntDir)$(TargetName).pgd</ProfileGuidedDatabase> <ProfileGuidedDatabase>$(IntDir)$(TargetName).pgd</ProfileGuidedDatabase>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
</Link> </Link>
<Bscmake> <Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>

View File

@ -92,6 +92,7 @@
<TargetMachine>MachineX86</TargetMachine> <TargetMachine>MachineX86</TargetMachine>
<Version>12.0</Version> <Version>12.0</Version>
<ProfileGuidedDatabase>$(IntDir)$(TargetName).pgd</ProfileGuidedDatabase> <ProfileGuidedDatabase>$(IntDir)$(TargetName).pgd</ProfileGuidedDatabase>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
</Link> </Link>
<Bscmake> <Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>

View File

@ -93,6 +93,7 @@
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile> <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<Version>12.0</Version> <Version>12.0</Version>
<ProfileGuidedDatabase>$(IntDir)$(TargetName).pgd</ProfileGuidedDatabase> <ProfileGuidedDatabase>$(IntDir)$(TargetName).pgd</ProfileGuidedDatabase>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
</Link> </Link>
<Bscmake> <Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>

View File

@ -146,6 +146,7 @@
<TargetMachine>MachineX86</TargetMachine> <TargetMachine>MachineX86</TargetMachine>
<Version>12.0</Version> <Version>12.0</Version>
<ProfileGuidedDatabase>$(IntDir)$(TargetName).pgd</ProfileGuidedDatabase> <ProfileGuidedDatabase>$(IntDir)$(TargetName).pgd</ProfileGuidedDatabase>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
</Link> </Link>
<Bscmake> <Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>

View File

@ -94,6 +94,7 @@
<Version>12.0</Version> <Version>12.0</Version>
<ProfileGuidedDatabase>$(IntDir)$(TargetName).pgd</ProfileGuidedDatabase> <ProfileGuidedDatabase>$(IntDir)$(TargetName).pgd</ProfileGuidedDatabase>
<ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile> <ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
</Link> </Link>
<Bscmake> <Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>

View File

@ -231,6 +231,7 @@
<TrrCompiler Include="..\src\cg\f16.trr" /> <TrrCompiler Include="..\src\cg\f16.trr" />
<TrrCompiler Include="..\src\cg\f17.trr" /> <TrrCompiler Include="..\src\cg\f17.trr" />
<TrrCompiler Include="..\src\cg\f171.trr" /> <TrrCompiler Include="..\src\cg\f171.trr" />
<TrrCompiler Include="..\src\cg\f175.trr" />
<TrrCompiler Include="..\src\cg\f18.trr" /> <TrrCompiler Include="..\src\cg\f18.trr" />
<TrrCompiler Include="..\src\cg\f19.trr" /> <TrrCompiler Include="..\src\cg\f19.trr" />
<TrrCompiler Include="..\src\cg\f20.trr" /> <TrrCompiler Include="..\src\cg\f20.trr" />
@ -252,6 +253,7 @@
<DirCompiler Include="..\src\cg\f16.dir" /> <DirCompiler Include="..\src\cg\f16.dir" />
<DirCompiler Include="..\src\cg\f17.dir" /> <DirCompiler Include="..\src\cg\f17.dir" />
<DirCompiler Include="..\src\cg\f171.dir" /> <DirCompiler Include="..\src\cg\f171.dir" />
<DirCompiler Include="..\src\cg\f175.dir" />
<DirCompiler Include="..\src\cg\f18.dir" /> <DirCompiler Include="..\src\cg\f18.dir" />
<DirCompiler Include="..\src\cg\f19.dir" /> <DirCompiler Include="..\src\cg\f19.dir" />
<DirCompiler Include="..\src\cg\f20.dir" /> <DirCompiler Include="..\src\cg\f20.dir" />

View File

@ -302,7 +302,9 @@
</CustomBuild> </CustomBuild>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<RepCompiler Include="..\src\cg\cg5500a.rep" /> <RepCompiler Include="..\src\cg\cg5500a.rep">
<SubType>Designer</SubType>
</RepCompiler>
<RepCompiler Include="..\src\cg\cg5500b.rep" /> <RepCompiler Include="..\src\cg\cg5500b.rep" />
<RepCompiler Include="..\src\cg\cg5800a.rep" /> <RepCompiler Include="..\src\cg\cg5800a.rep" />
<RepCompiler Include="..\src\cg\cg5800b.rep"> <RepCompiler Include="..\src\cg\cg5800b.rep">

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations"> <ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32"> <ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration> <Configuration>Debug</Configuration>
@ -13,15 +13,18 @@
<PropertyGroup Label="Globals"> <PropertyGroup Label="Globals">
<ProjectGuid>{BBB4EEFA-F24B-4B6C-9632-D7F42283869D}</ProjectGuid> <ProjectGuid>{BBB4EEFA-F24B-4B6C-9632-D7F42283869D}</ProjectGuid>
<RootNamespace>or1</RootNamespace> <RootNamespace>or1</RootNamespace>
<WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc> <UseOfMfc>false</UseOfMfc>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc> <UseOfMfc>false</UseOfMfc>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings"> <ImportGroup Label="ExtensionSettings">

View File

@ -94,6 +94,7 @@
<TargetMachine>MachineX86</TargetMachine> <TargetMachine>MachineX86</TargetMachine>
<Version>12.0</Version> <Version>12.0</Version>
<ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile> <ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
</Link> </Link>
<Bscmake> <Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>

View File

@ -147,6 +147,7 @@
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile> <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<Version>12.0</Version> <Version>12.0</Version>
<ProfileGuidedDatabase>$(IntDir)$(TargetName).pgd</ProfileGuidedDatabase> <ProfileGuidedDatabase>$(IntDir)$(TargetName).pgd</ProfileGuidedDatabase>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
</Link> </Link>
<Bscmake> <Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>

View File

@ -147,6 +147,7 @@
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile> <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<Version>12.0</Version> <Version>12.0</Version>
<ProfileGuidedDatabase>$(IntDir)$(TargetName).pgd</ProfileGuidedDatabase> <ProfileGuidedDatabase>$(IntDir)$(TargetName).pgd</ProfileGuidedDatabase>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
</Link> </Link>
<Bscmake> <Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>

View File

@ -96,6 +96,7 @@
<TargetMachine>MachineX86</TargetMachine> <TargetMachine>MachineX86</TargetMachine>
<ProgramDatabaseFile>$(IntDir)</ProgramDatabaseFile> <ProgramDatabaseFile>$(IntDir)</ProgramDatabaseFile>
<ProfileGuidedDatabase>$(IntDir)</ProfileGuidedDatabase> <ProfileGuidedDatabase>$(IntDir)</ProfileGuidedDatabase>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
</Link> </Link>
<Bscmake> <Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>

View File

@ -89,6 +89,7 @@
<TargetMachine>MachineX86</TargetMachine> <TargetMachine>MachineX86</TargetMachine>
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
<ProfileGuidedDatabase>$(IntDir)</ProfileGuidedDatabase> <ProfileGuidedDatabase>$(IntDir)</ProfileGuidedDatabase>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
</Link> </Link>
<Bscmake> <Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>

View File

@ -73,11 +73,9 @@
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat> <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<StringPooling>true</StringPooling> <StringPooling>true</StringPooling>
<PrecompiledHeaderOutputFile>$(IntDir)</PrecompiledHeaderOutputFile> <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation> <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
</AssemblerListingLocation> <ProgramDataBaseFileName>$(IntDir)vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
<ProgramDataBaseFileName>
</ProgramDataBaseFileName>
</ClCompile> </ClCompile>
<ResourceCompile> <ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@ -92,6 +90,7 @@
</DataExecutionPrevention> </DataExecutionPrevention>
<TargetMachine>MachineX86</TargetMachine> <TargetMachine>MachineX86</TargetMachine>
<SubSystem>Windows</SubSystem> <SubSystem>Windows</SubSystem>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
</Link> </Link>
<Bscmake> <Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>

View File

@ -53,6 +53,12 @@
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<PreBuildEventUseInBuild>true</PreBuildEventUseInBuild> <PreBuildEventUseInBuild>true</PreBuildEventUseInBuild>
<SrcSimpleCompilerBeforeTargets>Midl</SrcSimpleCompilerBeforeTargets>
<SrcSimpleCompilerAfterTargets>CustomBuild</SrcSimpleCompilerAfterTargets>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<SrcSimpleCompilerBeforeTargets>Midl</SrcSimpleCompilerBeforeTargets>
<SrcSimpleCompilerAfterTargets>CustomBuild</SrcSimpleCompilerAfterTargets>
</PropertyGroup> </PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Midl> <Midl>
@ -158,9 +164,9 @@
<SrcCompiler Include="..\src\ve\ordbon.src" /> <SrcCompiler Include="..\src\ve\ordbon.src" />
<SrcCompiler Include="..\src\ve\ordinec.src" /> <SrcCompiler Include="..\src\ve\ordinec.src" />
<SrcCompiler Include="..\src\ve\ordinef.src" /> <SrcCompiler Include="..\src\ve\ordinef.src" />
<SrcCompiler Include="..\src\ve\ve0300a.src"> <SrcSimpleCompiler Include="..\src\ve\ve0300a.src">
<FileType>Document</FileType> <FileType>Document</FileType>
</SrcCompiler> </SrcSimpleCompiler>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<DatCompiler Include="..\src\ve\ve0300b.dat" /> <DatCompiler Include="..\src\ve\ve0300b.dat" />

View File

@ -1,4 +1,4 @@
#include <relapp.h> #include <relapp.h>
#include <automask.h> #include <automask.h>
#include <config.h> #include <config.h>
#include <lffiles.h> #include <lffiles.h>
@ -67,7 +67,7 @@ const TRectype getLAM(int anno, int mese)
// Ritorna il record valido richiesto di tabcom.VER // Ritorna il record valido richiesto di tabcom.VER
const TRectype getVER(int anno, int mese) const TRectype getVER(int anno, int mese)
{ {
// Questa tabella ha come chiave l'inizio validità, creo un cursore e scorro finche non trovo l'ultimo periodo valido // Questa tabella ha come chiave l'inizio validità, creo un cursore e scorro finche non trovo l'ultimo periodo valido
static TRelation rver(LF_TABCOM); static TRelation rver(LF_TABCOM);
static TRectype from(rver.curr()); from.put("COD", "VER"); static TRectype from(rver.curr()); from.put("COD", "VER");
static TRectype to(rver.curr()); to.put("COD" , "VER"); static TRectype to(rver.curr()); to.put("COD" , "VER");
@ -97,7 +97,7 @@ const TRectype getVER(int anno, int mese)
} }
/* Scopiazzata e divisa in due da cg4304.cpp /* Scopiazzata e divisa in due da cg4304.cpp
* Calcola solo le imposte, aggiunto controllo indetraibilità, non devono essere presi in considerazione * Calcola solo le imposte, aggiunto controllo indetraibilità, non devono essere presi in considerazione
* i movimenti se indetraibili * i movimenti se indetraibili
*/ */
@ -152,14 +152,23 @@ int calc_inc_diff(int anno, int mese, int tipoiva, real& imposta_diff, real& imp
perc_prorata = p; perc_prorata = p;
} }
if (imposta_diff > ZERO && perc_prorata > ZERO) if (perc_prorata > ZERO)
{ {
real ind = imposta_diff * perc_prorata / CENTO; real ind = ZERO;
ind.round(TCurrency::get_firm_dec());
imposta_diff -= ind; if (imposta_diff > ZERO)
ind = imposta_xcas * perc_prorata / CENTO; {
ind.round(TCurrency::get_firm_dec()); ind = imposta_diff * perc_prorata / CENTO;
imposta_xcas -= ind; ind.round(TCurrency::get_firm_dec());
imposta_diff -= ind;
}
if (imposta_xcas > ZERO)
{
ind = imposta_xcas * perc_prorata / CENTO;
ind.round(TCurrency::get_firm_dec());
imposta_xcas -= ind;
}
} }
} }
@ -186,7 +195,7 @@ void calcolaCreditoPrec(real& creprec, real& creaprec, bool mensile, int anno, i
for(curLiq = 0; curLiq.pos() < curLiq.items(); ++curLiq) for(curLiq = 0; curLiq.pos() < curLiq.items(); ++curLiq)
{ {
TRectype rowLiq = curLiq.curr(); TRectype rowLiq = curLiq.curr();
if(rowLiq.get_int("MESE") >= mese) break; // Perchè li prende lo stesso? if(rowLiq.get_int("MESE") >= mese) break; // Perchè li prende lo stesso?
trovato = trovato || rowLiq.get_real("CREAPREC") > ZERO; trovato = trovato || rowLiq.get_real("CREAPREC") > ZERO;
creprec = rowLiq.get_real("IVAVERC"); creprec = rowLiq.get_real("IVAVERC");
@ -205,7 +214,7 @@ class ComLiqPerIva_mask : public TAutomask
{ {
protected: protected:
bool mensile; bool mensile;
// Aggiunta questa variabile per specificare se è stato impostato un tipo di liquidazione. // Aggiunta questa variabile per specificare se è stato impostato un tipo di liquidazione.
// In Release sembra che durante la ricerca salta l'inizializzazione e imposta prima gli altri campi // In Release sembra che durante la ricerca salta l'inizializzazione e imposta prima gli altri campi
bool initLiq; bool initLiq;
TRectype trueData; TRectype trueData;
@ -269,10 +278,10 @@ bool ComLiqPerIva_mask::on_field_event(TOperable_field& o, TField_event e, long
// Vado a prendere i dati di quel mese dalla liquidazione IVA // Vado a prendere i dati di quel mese dalla liquidazione IVA
if(e == fe_button) if(e == fe_button)
{ {
// Controllo che non ci sia già // Controllo che non ci sia già
if(!cache().get(LF_IVALIQ, TString(get(F_ANNO)) << "|" << get(F_MESE) << "|U").empty()) if(!cache().get(LF_IVALIQ, TString(get(F_ANNO)) << "|" << get(F_MESE) << "|U").empty())
{ {
if(!yesno_box("Sono già stati elaborati questi dati, si desidera ricalcolarli?")) if(!yesno_box("Sono già stati elaborati questi dati, si desidera ricalcolarli?"))
break; break;
} }
extractinator(); extractinator();
@ -342,7 +351,7 @@ bool ComLiqPerIva_mask::on_field_event(TOperable_field& o, TField_event e, long
// Ricalcolo VP13 e VP14 // Ricalcolo VP13 e VP14
real debito = get_real(F_IVADOV) + get_real(F_DEBPREC) + get_real(F_INTLIQTRI); real debito = get_real(F_IVADOV) + get_real(F_DEBPREC) + get_real(F_INTLIQTRI);
/* Se il credito anno precedente è negativo devo mantenerlo tale ma sottrarlo al credito dell'anno precedente delle dichiarazioni precedenti */ /* Se il credito anno precedente è negativo devo mantenerlo tale ma sottrarlo al credito dell'anno precedente delle dichiarazioni precedenti */
real creaprec = get_real(F_CREAPREC); real creaprec = get_real(F_CREAPREC);
if(creaprec < ZERO) if(creaprec < ZERO)
{ {
@ -376,9 +385,9 @@ bool ComLiqPerIva_mask::on_field_event(TOperable_field& o, TField_event e, long
// Funzione che effettivamente estrapola i dati necessari // Funzione che effettivamente estrapola i dati necessari
void ComLiqPerIva_mask::extractinator() // Per gli amici GTFO void ComLiqPerIva_mask::extractinator() // Per gli amici GTFO
{ {
/* Devo estrapolare più mesi, per farlo vado ciclo n volte (1 o 3) in base se stiamo parlando di trimestralità o meno /* Devo estrapolare più mesi, per farlo vado ciclo n volte (1 o 3) in base se stiamo parlando di trimestralità o meno
* I dati da prelevare saranno in PRM, LIM e %LIA * I dati da prelevare saranno in PRM, LIM e %LIA
* In PRM e LIM troverò le informazioni suddivise per mese, mentre in %LIA ho l'anno di liquidazione * In PRM e LIM troverò le informazioni suddivise per mese, mentre in %LIA ho l'anno di liquidazione
*/ */
int start = mensile ? get_int(F_MESE) : (((get_int(F_TRIMESTRE) - 1) * 3) + 1); int start = mensile ? get_int(F_MESE) : (((get_int(F_TRIMESTRE) - 1) * 3) + 1);
int end = mensile ? start : start + 2; int end = mensile ? start : start + 2;
@ -425,10 +434,9 @@ void ComLiqPerIva_mask::extractinator() // Per gli amici GTFO
// Riga LIM // Riga LIM
const TRectype rowLim = getLIM(anno, start); const TRectype rowLim = getLIM(anno, start);
// Controllo che la liquidazione è stata effettuata, controllo da fare solo nella 12 // Controllo che la liquidazione è stata effettuata, controllo da fare solo nella 12
if(dongle().year_assist() > 2121 && (rowLim.empty() || rowLim.get_bool("B0"))) if (dongle().year_assist() > 2121 && (rowLim.empty() || rowLim.get_bool("B0")) && !yesno_box("Attenzione non <20> stata calcolata la liquidazione del periodo corrente, si desidera proseguire ugualmente?"))
{ {
error_box("Attenzione non è stata calcolata la liquidazione del periodo corrente");
return; return;
} }
@ -459,7 +467,7 @@ void ComLiqPerIva_mask::extractinator() // Per gli amici GTFO
real imp = curIva.get("25.IMPONIBILE").as_real(); real imp = curIva.get("25.IMPONIBILE").as_real();
real imposta = curIva.get("25.IMPOSTA").as_real(); real imposta = curIva.get("25.IMPOSTA").as_real();
// Se è un movimento IvaXCassa o LiqDiff // Se è un movimento IvaXCassa o LiqDiff
if(hasIXC && (curIva.get("23.IVAXCASSA").as_bool() || curIva.get("23.LIQDIFF").as_bool())) if(hasIXC && (curIva.get("23.IVAXCASSA").as_bool() || curIva.get("23.LIQDIFF").as_bool()))
{ {
if(tiporeg == REG_ATT) if(tiporeg == REG_ATT)
@ -476,10 +484,10 @@ void ComLiqPerIva_mask::extractinator() // Per gli amici GTFO
TString keyRC = curIva.get("23.NUMREG").as_string(); keyRC << "|1"; TString keyRC = curIva.get("23.NUMREG").as_string(); keyRC << "|1";
if(!cache().get(LF_RMOV, keyRC).empty()) if(!cache().get(LF_RMOV, keyRC).empty())
{ {
// Controllo se è un corrispettivo non scorporato (imponibile e iva assieme) // Controllo se è un corrispettivo non scorporato (imponibile e iva assieme)
if(isCorrispettivo && codiva.percentuale() > ZERO && imposta == ZERO) if(isCorrispettivo && codiva.percentuale() > ZERO && imposta == ZERO)
{ {
// Nell'imponibile è presente il totale fattura, devo calcolare l'imposta e sottrarla // Nell'imponibile è presente il totale fattura, devo calcolare l'imposta e sottrarla
// Es iva 22% => imp : 122 = x : 100 // Es iva 22% => imp : 122 = x : 100
codiva.scorpora(imp); codiva.scorpora(imp);
} }
@ -495,7 +503,7 @@ void ComLiqPerIva_mask::extractinator() // Per gli amici GTFO
// Sommiamo i corrispettivi al registro delle vendite // Sommiamo i corrispettivi al registro delle vendite
// Se ha attiva l'IVA x cassa calcolo le imposte (imponibili per comodità già calcolati sopra) // Se ha attiva l'IVA x cassa calcolo le imposte (imponibili per comodità già calcolati sopra)
if(hasIXC) if(hasIXC)
{ {
// IVA esigibile // IVA esigibile
@ -522,7 +530,7 @@ void ComLiqPerIva_mask::extractinator() // Per gli amici GTFO
TRectype rowLam = getLAM(anno, start); TRectype rowLam = getLAM(anno, start);
/* É saltato fuori che in caso di liquidazione trimestrale l'importo ivaes e ivadet /* É saltato fuori che in caso di liquidazione trimestrale l'importo ivaes e ivadet
* viene scritto su ogni mese, quindi prendo solo quando * viene scritto su ogni mese, quindi prendo solo quando
* start == end -> iva mensile o ultimo mese della trimestrale */ * start == end -> iva mensile o ultimo mese della trimestrale */
@ -560,12 +568,12 @@ void ComLiqPerIva_mask::extractinator() // Per gli amici GTFO
TRectype rowVer = getVER(anno, start); TRectype rowVer = getVER(anno, start);
if(rowVer.empty() || rowVer.get_real("R5") == ZERO) if(rowVer.empty() || rowVer.get_real("R5") == ZERO)
{ {
error_box("Non è stata valorizzato correttamente il campo \"Periodico\" in \"Versamenti ed interessi IVA\""); error_box("Non è stata valorizzato correttamente il campo \"Periodico\" in \"Versamenti ed interessi IVA\"");
return; return;
} }
else else
{ {
if(debprec > rowVer.get_real("R5")) // Se è maggiore di 25.82€ va azzerato if(debprec > rowVer.get_real("R5")) // Se è maggiore di 25.82€ va azzerato
debprec = ZERO; debprec = ZERO;
} }
// Calcolo ivadov/ivadovc // Calcolo ivadov/ivadovc
@ -650,7 +658,7 @@ void ComLiqPerIva_mask::saveGen()
trueData.put("ANNO", get(F_ANNO)); trueData.put("ANNO", get(F_ANNO));
trueData.put("MESE", get(F_MESE)); trueData.put("MESE", get(F_MESE));
trueData.put("TRIMESTRE", get(F_TRIMESTRE)); trueData.put("TRIMESTRE", get(F_TRIMESTRE));
trueData.put("GENERATA", 'G'); // Segno che è generata da campo trueData.put("GENERATA", 'G'); // Segno che è generata da campo
trueData.put("TOTOPATT", get(F_TOTOPATT)); trueData.put("TOTOPATT", get(F_TOTOPATT));
trueData.put("TOTOPATTXC", get(F_TOTOPATTXC)); trueData.put("TOTOPATTXC", get(F_TOTOPATTXC));
trueData.put("TOTOPPAS", get(F_TOTOPPAS)); trueData.put("TOTOPPAS", get(F_TOTOPPAS));
@ -689,7 +697,7 @@ void ComLiqPerIva_mask::checkOldValue(int field, real val)
} }
real trueVal = ZERO; real trueVal = ZERO;
// Modo più intelligente di uno stupido switch case? // Modo più intelligente di uno stupido switch case?
switch(field) switch(field)
{ {
case F_TOTOPATT: case F_TOTOPATT: