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

This commit is contained in:
Simone Palacino 2019-02-22 15:15:00 +01:00
commit 62496a20cd
37 changed files with 796 additions and 173 deletions

View File

@ -193,20 +193,27 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClCompile Include="..\src\fp\fp0300.cpp" /> <ClCompile Include="..\src\fp\fp0300.cpp" />
<ClCompile Include="..\src\fp\fp0500.cpp" /> <ClCompile Include="..\src\fp\fp0400.cpp" />
<ClCompile Include="..\src\fp\fp0500.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="..\src\fp\fp0.h" /> <ClInclude Include="..\src\fp\fp0.h" />
<ClInclude Include="..\src\fp\fp0100a.h" /> <ClInclude Include="..\src\fp\fp0100a.h" />
<ClInclude Include="..\src\fp\fp0200a.h" /> <ClInclude Include="..\src\fp\fp0200a.h" />
<ClInclude Include="..\src\fp\fp0300a.h" /> <ClInclude Include="..\src\fp\fp0300a.h" />
<ClInclude Include="..\src\fp\fp0500a.h" /> <ClInclude Include="..\src\fp\fp0400a.h" />
<ClInclude Include="..\src\fp\fp0500a.h">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<MskCompiler Include="..\src\fp\fp0200a.uml"> <MskCompiler Include="..\src\fp\fp0200a.uml">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild>
</MskCompiler> </MskCompiler>
<MskCompiler Include="..\src\fp\fp0300a.uml" /> <MskCompiler Include="..\src\fp\fp0300a.uml" />
<MskCompiler Include="..\src\fp\fp0400a.uml" />
<MskCompiler Include="..\src\fp\fp0500a.uml" /> <MskCompiler Include="..\src\fp\fp0500a.uml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -10,9 +10,6 @@
<Filter Include="Masks"> <Filter Include="Masks">
<UniqueIdentifier>{aa4d5fac-6242-4e34-8b78-263ec3e4d15f}</UniqueIdentifier> <UniqueIdentifier>{aa4d5fac-6242-4e34-8b78-263ec3e4d15f}</UniqueIdentifier>
</Filter> </Filter>
<Filter Include="Sources">
<UniqueIdentifier>{06bc8aeb-f506-4c2e-85fb-bdeb92f2c77e}</UniqueIdentifier>
</Filter>
<Filter Include="Sqls"> <Filter Include="Sqls">
<UniqueIdentifier>{714df3f7-26ac-4abe-b7fc-6359cc2a263f}</UniqueIdentifier> <UniqueIdentifier>{714df3f7-26ac-4abe-b7fc-6359cc2a263f}</UniqueIdentifier>
</Filter> </Filter>
@ -22,6 +19,9 @@
<Filter Include="Menu"> <Filter Include="Menu">
<UniqueIdentifier>{022385bd-474b-4d1f-a01c-6d799bae0328}</UniqueIdentifier> <UniqueIdentifier>{022385bd-474b-4d1f-a01c-6d799bae0328}</UniqueIdentifier>
</Filter> </Filter>
<Filter Include="Sources">
<UniqueIdentifier>{06bc8aeb-f506-4c2e-85fb-bdeb92f2c77e}</UniqueIdentifier>
</Filter>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="..\src\fp\fp0.cpp"> <ClCompile Include="..\src\fp\fp0.cpp">
@ -48,6 +48,9 @@
<ClCompile Include="..\src\fp\fp0500.cpp"> <ClCompile Include="..\src\fp\fp0500.cpp">
<Filter>Sources</Filter> <Filter>Sources</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\src\fp\fp0400.cpp">
<Filter>Sources</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="..\src\fp\fp0.h"> <ClInclude Include="..\src\fp\fp0.h">
@ -65,6 +68,9 @@
<ClInclude Include="..\src\fp\fp0500a.h"> <ClInclude Include="..\src\fp\fp0500a.h">
<Filter>Headers</Filter> <Filter>Headers</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\src\fp\fp0400a.h">
<Filter>Headers</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<MskCompiler Include="..\src\fp\fp0200a.uml"> <MskCompiler Include="..\src\fp\fp0200a.uml">
@ -79,6 +85,9 @@
<MskCompiler Include="..\src\fp\fp0500a.uml"> <MskCompiler Include="..\src\fp\fp0500a.uml">
<Filter>Masks</Filter> <Filter>Masks</Filter>
</MskCompiler> </MskCompiler>
<MskCompiler Include="..\src\fp\fp0400a.uml">
<Filter>Masks</Filter>
</MskCompiler>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<SqlCompiler Include="..\src\fp\sql\fp0100.sql"> <SqlCompiler Include="..\src\fp\sql\fp0100.sql">

3
cd/test/770700.txt Normal file
View File

@ -0,0 +1,3 @@
777.exe
Sistemato campo ragione sociale del dichiarante ( non veniva scritta la 2 parte nel campo nome.

27
cd/test/770700a.ini Normal file
View File

@ -0,0 +1,27 @@
[Main]
Demo=0
[777]
File(134) = 777.exe|X
Patch = 700
Versione = 21511200
[7799]
Kill(0) = batbcaf.msk|x
Kill(1) = batbca7.msk|x
Kill(2) = batbent.msk|x
[77]
Data = 06-06-2016
Descrizione = Percipienti (Mod.770)
Dischi = 1
Edit_4 = 770 -3
Moduli = ba
OEM =
Patch = 700
PostProcess =
PreProcess =
Prezzo(1) =
Prezzo(2) =
Versione = 21511200

BIN
cd/test/770700a1.zip Normal file

Binary file not shown.

3
cd/test/cg0700.txt Normal file
View File

@ -0,0 +1,3 @@
cg5.exe
Visualizzazione liquidazione nella pagina dei versamenti veniva disabilitato Npvembre invece dell'acconto di dicembre

94
cd/test/cg0700a.ini Normal file
View File

@ -0,0 +1,94 @@
[Main]
Demo=0
[cg1]
Edit_23 = cg2 -0
File(60) = cg5.exe|X
Patch = 700
Versione = 21511200
[cg99]
Kill(0) = bastvet.rep|x
Kill(1) = bastivd.msk|x
Kill(2) = bastcfi.rep|x
Kill(3) = batbarb.msk|x
Kill(4) = batbcve.msk|x
Kill(5) = batbscc.msk|x
Kill(6) = bastscc.msk|x
Kill(7) = bastcco.rep|x
Kill(8) = bastzon.rep|x
Kill(9) = batblia.msk|x
Kill(10) = batbmsp.msk|x
Kill(11) = bastscc.rep|x
Kill(12) = bastesc.msk|x
Kill(13) = batbind.msk|x
Kill(14) = bastmsp.rep|x
Kill(15) = batbcfi.msk|x
Kill(16) = batbleg.msk|x
Kill(17) = batbndo.msk|x
Kill(18) = bastcve.msk|x
Kill(19) = bastcfi.msk|x
Kill(20) = bastcco.msk|x
Kill(21) = batbpor.msk|x
Kill(22) = bastmsp.msk|x
Kill(23) = bastndo.msk|x
Kill(24) = bastntb.rep|x
Kill(25) = batbver.msk|x
Kill(26) = bastvet.msk|x
Kill(27) = bastpor.rep|x
Kill(28) = bastntb.msk|x
Kill(29) = bastleg.rep|x
Kill(30) = batblbu.msk|x
Kill(31) = bastndo.rep|x
Kill(32) = batbntb.msk|x
Kill(33) = bastnot.msk|x
Kill(34) = batbreg.msk|x
Kill(35) = bastver.rep|x
Kill(36) = bastdpn.msk|x
Kill(37) = bastcam.rep|x
Kill(38) = batblia.msk|x
Kill(39) = bastivd.rep|x
Kill(40) = bastesc.rep|x
Kill(41) = bastpdb.msk|x
Kill(42) = batbzon.msk|x
Kill(43) = bastleg.msk|x
Kill(44) = bastpdb.rep|x
Kill(45) = bastarb.rep|x
Kill(46) = bastreg.msk|x
Kill(47) = bastdpn.rep|x
Kill(48) = batbins.msk|x
Kill(49) = cgtbcon.msk|x
Kill(50) = batbtra.msk|x
Kill(51) = batbdel.msk|x
Kill(52) = batbinl.msk|x
Kill(53) = bastcam.msk|x
Kill(54) = batbdpn.msk|x
Kill(55) = bastzon.msk|x
Kill(56) = bastnot.rep|x
Kill(57) = batbnot.msk|x
Kill(58) = batbcam.msk|x
Kill(59) = bastpor.msk|x
Kill(60) = batbcco.msk|x
Kill(61) = batbpdb.msk|x
Kill(62) = batbvet.msk|x
Kill(63) = bastarb.msk|x
Kill(64) = bastcve.rep|x
Kill(65) = bastreg.rep|x
Kill(66) = bastver.msk|x
Kill(67) = batbesc.msk|x
Kill(68) = batbtit.msk|x
Kill(69) = batbivd.msk|x
[cg]
Data = 18-02-2019
Descrizione = Contabilita' Generale
Dischi = 1
Moduli = ba
OEM =
Patch = 700
PostProcess = bainst -0 CG
PreProcess =
Prezzo(1) =
Prezzo(2) =
Versione = 21511200

BIN
cd/test/cg0700a1.zip Normal file

Binary file not shown.

3
cd/test/cg0702.txt Normal file
View File

@ -0,0 +1,3 @@
cgtbvet.msk
Sistemato errore inserimento vettori

97
cd/test/cg0702a.ini Normal file
View File

@ -0,0 +1,97 @@
[Main]
Demo=0
[cg9]
Edit_19 = cg0 -0
Edit_20 = cg0 -1
Edit_26 = cg0 -4
Edit_5 = cg0 -5
File(224) = cgtbvet.msk|X
Patch = 0702
Versione = 21511200
[cg99]
Kill(0) = bastcfi.msk|x
Kill(1) = batbver.msk|x
Kill(2) = bastndo.rep|x
Kill(3) = bastcve.msk|x
Kill(4) = bastntb.rep|x
Kill(5) = batblbu.msk|x
Kill(6) = bastpor.rep|x
Kill(7) = bastnot.msk|x
Kill(8) = bastvet.msk|x
Kill(9) = batbntb.msk|x
Kill(10) = batbcfi.msk|x
Kill(11) = batbpor.msk|x
Kill(12) = bastmsp.rep|x
Kill(13) = bastcco.msk|x
Kill(14) = batbndo.msk|x
Kill(15) = bastndo.msk|x
Kill(16) = batbleg.msk|x
Kill(17) = bastmsp.msk|x
Kill(18) = bastscc.rep|x
Kill(19) = batbmsp.msk|x
Kill(20) = batbind.msk|x
Kill(21) = bastesc.msk|x
Kill(22) = bastpor.msk|x
Kill(23) = bastreg.rep|x
Kill(24) = batbcam.msk|x
Kill(25) = bastcve.rep|x
Kill(26) = batbesc.msk|x
Kill(27) = bastver.msk|x
Kill(28) = cgtbcon.msk|x
Kill(29) = bastzon.msk|x
Kill(30) = batbpdb.msk|x
Kill(31) = batbins.msk|x
Kill(32) = batbdpn.msk|x
Kill(33) = batbcco.msk|x
Kill(34) = batbnot.msk|x
Kill(35) = bastarb.msk|x
Kill(36) = bastnot.rep|x
Kill(37) = batbvet.msk|x
Kill(38) = bastivd.rep|x
Kill(39) = bastarb.rep|x
Kill(40) = batbdel.msk|x
Kill(41) = batblia.msk|x
Kill(42) = bastpdb.rep|x
Kill(43) = batbtra.msk|x
Kill(44) = bastdpn.rep|x
Kill(45) = bastcam.msk|x
Kill(46) = bastreg.msk|x
Kill(47) = batbinl.msk|x
Kill(48) = bastleg.rep|x
Kill(49) = bastver.rep|x
Kill(50) = bastpdb.msk|x
Kill(51) = bastntb.msk|x
Kill(52) = batbreg.msk|x
Kill(53) = bastesc.rep|x
Kill(54) = bastcam.rep|x
Kill(55) = bastleg.msk|x
Kill(56) = bastdpn.msk|x
Kill(57) = batbzon.msk|x
Kill(58) = batbivd.msk|x
Kill(59) = batbtit.msk|x
Kill(60) = batblia.msk|x
Kill(61) = bastzon.rep|x
Kill(62) = bastivd.msk|x
Kill(63) = bastvet.rep|x
Kill(64) = batbscc.msk|x
Kill(65) = batbcve.msk|x
Kill(66) = batbarb.msk|x
Kill(67) = bastcfi.rep|x
Kill(68) = bastcco.rep|x
Kill(69) = bastscc.msk|x
[cg]
Data = 20-02-2019
Descrizione = Contabilita' Generale
Dischi = 1
Moduli = ba
OEM =
Patch = 702
PostProcess = bainst -0 CG
PreProcess =
Prezzo(1) =
Prezzo(2) =
Versione = 21511200

BIN
cd/test/cg0702a1.zip Normal file

Binary file not shown.

8
cd/test/cg0704.txt Normal file
View File

@ -0,0 +1,8 @@
cg4.exe
Modificato salvataggio percentuale pro-rata (diana2000) per sistemare si puo azzerare il campo R12 della tabella PLM del mese in oggetto (è 1999) o ricalcolare la liquidazione
Va provato anche con un pro-rata per verificare che salvi la % giusta.
Modificato prospetto pro-rata annuale.
Modificato il calcolo interessi per i trimestrali. Ora anche a dicembre (Pastore).

94
cd/test/cg0704a.ini Normal file
View File

@ -0,0 +1,94 @@
[Main]
Demo=0
[cg1]
Edit_23 = cg2 -0
File(39) = cg4.exe|X
Patch = 704
Versione = 21511200
[cg99]
Kill(0) = batbmsp.msk|x
Kill(1) = bastcve.rep|x
Kill(2) = batbins.msk|x
Kill(3) = bastscc.rep|x
Kill(4) = batbcam.msk|x
Kill(5) = batbpdb.msk|x
Kill(6) = bastver.msk|x
Kill(7) = batbcco.msk|x
Kill(8) = batbesc.msk|x
Kill(9) = batbdpn.msk|x
Kill(10) = bastndo.msk|x
Kill(11) = bastesc.msk|x
Kill(12) = batbndo.msk|x
Kill(13) = batbind.msk|x
Kill(14) = bastmsp.msk|x
Kill(15) = bastreg.rep|x
Kill(16) = batbleg.msk|x
Kill(17) = bastpor.msk|x
Kill(18) = batbpor.msk|x
Kill(19) = batbcfi.msk|x
Kill(20) = bastcco.msk|x
Kill(21) = bastmsp.rep|x
Kill(22) = batbtit.msk|x
Kill(23) = batbcve.msk|x
Kill(24) = batbivd.msk|x
Kill(25) = batbscc.msk|x
Kill(26) = bastcfi.rep|x
Kill(27) = batbarb.msk|x
Kill(28) = bastver.rep|x
Kill(29) = bastleg.msk|x
Kill(30) = bastzon.rep|x
Kill(31) = bastleg.rep|x
Kill(32) = bastcam.rep|x
Kill(33) = batblia.msk|x
Kill(34) = batbzon.msk|x
Kill(35) = bastvet.rep|x
Kill(36) = bastdpn.msk|x
Kill(37) = bastivd.msk|x
Kill(38) = bastarb.rep|x
Kill(39) = bastcam.msk|x
Kill(40) = bastntb.msk|x
Kill(41) = bastivd.rep|x
Kill(42) = bastdpn.rep|x
Kill(43) = bastpdb.msk|x
Kill(44) = batbinl.msk|x
Kill(45) = bastesc.rep|x
Kill(46) = bastreg.msk|x
Kill(47) = batbreg.msk|x
Kill(48) = bastzon.msk|x
Kill(49) = bastarb.msk|x
Kill(50) = batblia.msk|x
Kill(51) = cgtbcon.msk|x
Kill(52) = batbnot.msk|x
Kill(53) = batbdel.msk|x
Kill(54) = batbvet.msk|x
Kill(55) = batbtra.msk|x
Kill(56) = bastnot.rep|x
Kill(57) = bastpdb.rep|x
Kill(58) = bastscc.msk|x
Kill(59) = bastcco.rep|x
Kill(60) = batbntb.msk|x
Kill(61) = bastvet.msk|x
Kill(62) = batbver.msk|x
Kill(63) = bastcfi.msk|x
Kill(64) = batblbu.msk|x
Kill(65) = bastntb.rep|x
Kill(66) = bastcve.msk|x
Kill(67) = bastndo.rep|x
Kill(68) = bastnot.msk|x
Kill(69) = bastpor.rep|x
[cg]
Data = 20-02-2019
Descrizione = Contabilita' Generale
Dischi = 1
Moduli = ba
OEM =
Patch = 704
PostProcess = bainst -0 CG
PreProcess =
Prezzo(1) =
Prezzo(2) =
Versione = 21511200

BIN
cd/test/cg0704a1.zip Normal file

Binary file not shown.

8
cd/test/fp0700.txt Normal file
View File

@ -0,0 +1,8 @@
fp0.exe
fp0100a.msk
fp0400a.msk
fp0300a.msk
fpmenu.men
- Aggiunto programma interrogazione fatture passive
- Aggiunta customizzazione calcolo righe merci

23
cd/test/fp0700a.ini Normal file
View File

@ -0,0 +1,23 @@
[Main]
Demo=0
[fp1]
File(0) = fp0.exe|X
File(1) = fp0100a.msk|X
File(3) = fp0300a.msk|X
File(4) = fp0400a.msk|X
File(6) = fpmenu.men|X
Patch = 700
Versione = 21511200
[fp]
Data = 15-02-2019
Descrizione = Fattura Elettronica
Dischi = 1
Moduli = cg,ve
OEM =
Patch = 700
PostProcess =
PreProcess =
Versione = 21511200

BIN
cd/test/fp0700a1.zip Normal file

Binary file not shown.

3
cd/test/fp0704.txt Normal file
View File

@ -0,0 +1,3 @@
fp0.exe
Aggiunto controllo tipo documento SDI per dati sporchi

19
cd/test/fp0704a.ini Normal file
View File

@ -0,0 +1,19 @@
[Main]
Demo=0
[fp1]
File(0) = fp0.exe|X
Patch = 0704
Versione = 21511200
[fp]
Data = 21-02-2019
Descrizione = Fattura Elettronica
Dischi = 1
Moduli = cg,ve
OEM =
Patch = 704
PostProcess =
PreProcess =
Versione = 21511200

BIN
cd/test/fp0704a1.zip Normal file

Binary file not shown.

7
cd/test/fp0706.txt Normal file
View File

@ -0,0 +1,7 @@
fp0.exe
fp0100a.msk
- Aggiunto piccolo controllo preventivo durante l'esportazione degli XML
- Aggiunto flag per non rendere il controllo bloccante
- Sistemata banca di appoggio
- Aggiunta gestione casse professionali

20
cd/test/fp0706a.ini Normal file
View File

@ -0,0 +1,20 @@
[Main]
Demo=0
[fp1]
File(0) = fp0.exe|X
File(1) = fp0100a.msk|X
Patch = 0706
Versione = 21511200
[fp]
Data = 21-02-2019
Descrizione = Fattura Elettronica
Dischi = 1
Moduli = cg,ve
OEM =
Patch = 706
PostProcess =
PreProcess =
Versione = 21511200

BIN
cd/test/fp0706a1.zip Normal file

Binary file not shown.

6
src/cg/cg0800a.h Normal file
View File

@ -0,0 +1,6 @@
#define F_CODDITTA 101
#define F_RAGSOC 102
#define F_ANNO 103
#define F_DAMESE 104
#define F_AMESE 105
#define F_REPORT 106

View File

@ -2981,7 +2981,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
acquisti_iva += agr_detIA; acquisti_iva += agr_detIA;
} }
_plm->put("R12", _prorata.percentuale(_year)); _plm->put("R12", _prorata.percentuale(_year) != INVALID_PRORATA ? _prorata.percentuale(_year) : ZERO);
_plm->put("R4", percentuale1); _plm->put("R4", percentuale1);
_plm->put("R16", percentuale2); _plm->put("R16", percentuale2);
_plm->put("R17", cred_fattrit); _plm->put("R17", cred_fattrit);
@ -4379,7 +4379,7 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
lim.put("R1",rimborsi); lim.put("R1",rimborsi);
lim.put("R5",rettifiche); lim.put("R5",rettifiche);
lim.put("R17", variazioni_imposta); lim.put("R17", variazioni_imposta);
lim.put("R18", imposta_non_versata); lim.put("R18", imposta_non_versata);
lim.put("R19", crediti_speciali); lim.put("R19", crediti_speciali);
} }
@ -4391,22 +4391,25 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
* false per ditte mensili e liq. annuale * false per ditte mensili e liq. annuale
* Ulteriormente smentito e rettificato * Ulteriormente smentito e rettificato
*/ */
bool true_trim = (month == 3 || month == 6 || month == 9); // bool true_trim = (month == 3 || month == 6 || month == 9);
if (_isintr && ( true_trim || (month == 12 && _isbenzinaro && _gest4) // if (_isintr && ( true_trim || (month == 12 && _isbenzinaro && _gest4)
|| (month == 13 && !(_isbenzinaro && _gest4)) )) // || (month == 13 && !(_isbenzinaro && _gest4)) )) // cambiato 2019
{
if (_isintr && (month == 3 || month == 6 || month == 9 || month == 12 || month ==13))
{
const real interesse = interesse_trimestrale(_month); const real interesse = interesse_trimestrale(_month);
const real r = risultato - imposta_non_versata; // CM 26-09-2000 const real r = risultato - imposta_non_versata; // CM 26-09-2000
real ivi = r.sign() > 0 ? (r * interesse / CENTO) : ZERO; real ivi = r.sign() > 0 ? (r * interesse / CENTO) : ZERO;
round_al_centesimo(ivi); round_al_centesimo(ivi);
lim.put("R14", ivi); lim.put("R14", ivi);
} lim.put("R10", interesse_trimestrale(_month));
}
//questo serve anche per la visualizzazione e per l'estrazione deleghe //questo serve anche per la visualizzazione e per l'estrazione deleghe
if (_isintr && ( true_trim || (month == 12 && _isbenzinaro && _gest4) // if (_isintr && ( true_trim || (month == 12 && _isbenzinaro && _gest4)
|| (month == 13 && !(_isbenzinaro && _gest4)) )) // || (month == 13 && !(_isbenzinaro && _gest4)) )) cambiato 2019
lim.put("R10", interesse_trimestrale(_month)); // lim.put("R10", interesse_trimestrale(_month));
lim.put("R7", tot_cong); // totale conguaglio su tutte le attivita' lim.put("R7", tot_cong); // totale conguaglio su tutte le attivita'
lim.put("R8", versamenti); lim.put("R8", versamenti);
lim.put("R9", vers_int); lim.put("R9", vers_int);
@ -4429,10 +4432,10 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
_lam->put("R1", iva_acq); _lam->put("R1", iva_acq);
_lam->put("R2", cred_prec); _lam->put("R2", cred_prec);
_lam->put("R3", debt_precd); _lam->put("R3", debt_precd);
_lam->put("R5", _imposta_inc_diff_ven); _lam->put("R5", _imposta_inc_diff_ven);
_lam->put("R6", _imposta_inc_cassa_ven); _lam->put("R6", _imposta_inc_cassa_ven);
_lam->put("R7", _imposta_inc_diff_acq); _lam->put("R7", _imposta_inc_diff_acq);
_lam->put("R8", _imposta_inc_cassa_acq); _lam->put("R8", _imposta_inc_cassa_acq);
lim.put("B0",""); lim.put("B0","");

View File

@ -1197,7 +1197,8 @@ void TLiquidazione_app::describe_pims(int month, const char* codatt, const bool
if ((e1+e2+e3+e4) > ZERO) if ((e1+e2+e3+e4) > ZERO)
{ {
dd->_f0 |= IS_PRORATA; dd->_f0 |= IS_PRORATA;
} dd->_r18 = _pla->get_real("R18");
}
dd->_r0 = ris; dd->_r0 = ris;
dd->_r1 = e1; dd->_r1 = e1;
dd->_r2 = pr > ZERO ? pr : ZERO; dd->_r2 = pr > ZERO ? pr : ZERO;
@ -1208,7 +1209,7 @@ void TLiquidazione_app::describe_pims(int month, const char* codatt, const bool
dd->_r7 = e4; dd->_r7 = e4;
dd->_r8 = e5; dd->_r8 = e5;
dd->_r9 = e6; dd->_r9 = e6;
dd->_r10 = vrc; dd->_r10 = vrc;
t->_arr.add(dd); t->_arr.add(dd);
} }
} }
@ -2809,20 +2810,25 @@ bool TLiquidazione_app::set_annual(_DescrItem& d)
const real perc_det = CENTO - d._r2; const real perc_det = CENTO - d._r2;
_perc_ind_annual = d._r2; _perc_ind_annual = d._r2;
const real vol_aff = d._r0; real vol_aff = d._r0;
const real rev_charge = d._r18;
const TString16 s1 = perc_det.stringa(); const TString16 s1 = perc_det.stringa();
const TString16 s2 = d._r2.stringa(); const TString16 s2 = d._r2.stringa();
set_row(row++, FR("%% PRO-RATA (%s%%) ed IVA non detraibile (%s%%)@69g%r"), set_row(row++, FR("%% PRO-RATA (%s%%) ed IVA non detraibile (%s%%)@69g%r"),
(const char*)s1, (const char*)s2, &(d._r6)); (const char*)s1, (const char*)s2, &(d._r6));
const real denom = vol_aff - rev_charge;
set_row(row++,FR("C1 - Operazioni esenti escluse da nr. 1 a 9 e 11 art. 10 @69g%r"), &(d._r1)); const real num = denom - d._r1 - d._r4 - d._r5 + d._r8 - d._r7 + d._r9;
set_row(row++,FR("C2 - Operazioni esenti di cui nr. 11 art. 10 @69g%r"), &(d._r4)); set_row(row++, FR("Numeratore pro-rata @69g%r"), &num);
set_row(row++,FR("C3 - Operazioni esenti da nr. 1 a 9 art. 10 @69g%r"), &(d._r5)); set_row(row++, FR("Denominatore @69g%r"), &denom);
set_row(row++,FR("@6gdi cui cessione beni ammortizzabili @69g%r"), &(d._r8)); // set_row(row++,FR("C1 - Operazioni esenti escluse da nr. 1 a 9 e 11 art. 10 @69g%r"), &(d._r1));
set_row(row++,FR("C1A - Operazioni esenti di cui all'art.10 n. 27 quinquies @69g%r"), &(d._r7)); // set_row(row++,FR("C2 - Operazioni esenti di cui nr. 11 art. 10 @69g%r"), &(d._r4));
set_row(row++,FR("@6gdi cui cessione beni ammortizzabili @69g%r"), &(d._r9)); // set_row(row++,FR("C3 - Operazioni esenti da nr. 1 a 9 art. 10 @69g%r"), &(d._r5));
set_row(row++,FR("Totale vendite al fine del calcolo del pro-rata @69g%r"), &vol_aff); // set_row(row++,FR("@6gdi cui cessione beni ammortizzabili @69g%r"), &(d._r8));
set_row(row++,FR("Detraibilità @69g%r%%"), &perc_det); // set_row(row++,FR("C1A - Operazioni esenti di cui all'art.10 n. 27 quinquies @69g%r"), &(d._r7));
// set_row(row++,FR("@6gdi cui cessione beni ammortizzabili @69g%r"), &(d._r9));
// set_row(row++, FR("Volume d'affari @69g%r"), &vol_aff);
// set_row(row++, FR("Totale vendite al fine del calcolo del pro-rata @69g%r"), &vol_aff);
set_row(row++,FR("Detraibilità @69g%r%%"), &perc_det);
set_print_zero(false); set_print_zero(false);
} }

View File

@ -1725,7 +1725,7 @@ void Visliq_app::read_general(TMask& m)
tt.add(versamenti[i-1].string(),5);// versamenti tt.add(versamenti[i-1].string(),5);// versamenti
sv.row(-1) = tt; sv.row(-1) = tt;
if (i == 11) if (i == 12)
sv.enable_cell(sv.items() - 1, -1, false); sv.enable_cell(sv.items() - 1, -1, false);
} }

View File

@ -17,7 +17,7 @@ BEGIN
PROMPT 2 2 "Codice vettore " PROMPT 2 2 "Codice vettore "
FIELD CODTAB FIELD CODTAB
HELP "Codice del vettore" HELP "Codice del vettore"
FLAGS "ZU" FLAGS "AZR"
USE %VET USE %VET
CHECKTYPE REQUIRED CHECKTYPE REQUIRED
INPUT CODTAB F_CODVETT INPUT CODTAB F_CODVETT
@ -41,8 +41,9 @@ BEGIN
PROMPT 2 3 "Cognome/Ragione sociale " PROMPT 2 3 "Cognome/Ragione sociale "
HELP "Ragione sociale del vettore" HELP "Ragione sociale del vettore"
FIELD S0[1,30] FIELD S0[1,30]
KEY 2
USE %VET KEY 2 USE %VET KEY 2
INPUT S0 F_RAGSO INPUT S0[1,30] F_RAGSO
DISPLAY "Codice vettore" CODTAB DISPLAY "Codice vettore" CODTAB
DISPLAY "Ragione sociale@50" S0 DISPLAY "Ragione sociale@50" S0
COPY OUTPUT F_CODVETT COPY OUTPUT F_CODVETT
@ -53,10 +54,8 @@ STRING F_RAGSOA 20
BEGIN BEGIN
PROMPT 2 4 "Nome/Seconda parte Rag. Soc." PROMPT 2 4 "Nome/Seconda parte Rag. Soc."
FIELD S0[31,50] FIELD S0[31,50]
USE %VET KEY 2 KEY 2
HELP "Seconda parte della ragione sociale o nome" HELP "Seconda parte della ragione sociale o nome"
COPY OUTPUT F_CODVETT
MESSAGE COPY,6@
END END

View File

@ -44,6 +44,7 @@ void TParametri_mask::save_all() const
fp_settings().set_gest_alleg(get_bool(F_ESPORTAALLEG)); fp_settings().set_gest_alleg(get_bool(F_ESPORTAALLEG));
fp_settings().set_allega_fat(get_bool(F_ESPORTADOC)); fp_settings().set_allega_fat(get_bool(F_ESPORTADOC));
fp_settings().set_f8(get_bool(F_F8)); fp_settings().set_f8(get_bool(F_F8));
fp_settings().set_check_not_block(get_bool(F_CHECK_NOT_BLOCK));
TFP_righe_custom().save_sheet(sfield(F_FORMPERS)); TFP_righe_custom().save_sheet(sfield(F_FORMPERS));
} }
@ -59,6 +60,7 @@ void TParametri_mask::load_all()
set(F_ESPORTAALLEG, fp_settings().get_gest_alleg()); set(F_ESPORTAALLEG, fp_settings().get_gest_alleg());
set(F_ESPORTADOC, fp_settings().get_allega_fat()); set(F_ESPORTADOC, fp_settings().get_allega_fat());
set(F_F8, fp_settings().is_f8()); set(F_F8, fp_settings().is_f8());
set(F_CHECK_NOT_BLOCK, fp_settings().get_check_not_block());
TFP_righe_custom().load_sheet(sfield(F_FORMPERS)); TFP_righe_custom().load_sheet(sfield(F_FORMPERS));
} }

View File

@ -1,24 +1,25 @@
#define F_INDIRIZZO 201 #define F_INDIRIZZO 201
#define F_DATABASE 202 #define F_DATABASE 202
#define F_USER 203 #define F_USER 203
#define F_PASSWORD 204 #define F_PASSWORD 204
#define F_FLDDEST 205 #define F_FLDDEST 205
#define F_FLDUSRDEST 206 #define F_FLDUSRDEST 206
#define F_COFI 207 #define F_COFI 207
#define F_ESPORTAALLEG 208 #define F_ESPORTAALLEG 208
#define F_ESPORTADOC 209 #define F_ESPORTADOC 209
#define F_F8 210 #define F_F8 210
#define F_CHECK_NOT_BLOCK 211
#define F_SETPATCH 301 #define F_SETPATCH 301
#define F_ENPTYTABLE 302 #define F_ENPTYTABLE 302
#define F_DROPTABLE 303 #define F_DROPTABLE 303
#define F_REBORNDB 304 #define F_REBORNDB 304
#define F_FORMPERS 401 #define F_FORMPERS 401
#define S_TIPODOC 101 #define S_TIPODOC 101
#define S_TIPORIGA 102 #define S_TIPORIGA 102
#define S_QTA 103 #define S_QTA 103
#define S_PREZZO 104 #define S_PREZZO 104
#define S_IMPONIBILE 105 #define S_IMPONIBILE 105

View File

@ -89,6 +89,32 @@ END
ENDPAGE ENDPAGE
PAGE "Configurazione (2) " 0 2 0 0
SPREADSHEET F_FORMPERS 60 6
BEGIN
PROMPT 1 1 "Personalizzazioni calcolo tipi righe "
ITEM "Tipo\nDoc@4"
ITEM "Tipo\nRiga@4"
ITEM "Qta"
ITEM "Prezzo"
ITEM "Imponibile"
END
GROUPBOX DLG_NULL 78 2
BEGIN
PROMPT 1 8 "@BControlli preventivi"
END
BOOLEAN F_CHECK_NOT_BLOCK
BEGIN
PROMPT 2 11 "Rendi controlli XML non bloccanti"
END
ENDPAGE
PAGE "Assistenza FP" 0 2 0 0 PAGE "Assistenza FP" 0 2 0 0
@ -118,19 +144,6 @@ END
ENDPAGE ENDPAGE
PAGE "Formule Pers " 0 2 0 0
SPREADSHEET F_FORMPERS 60 6
BEGIN
PROMPT 1 1 "Personalizzazioni calcolo tipi righe "
ITEM "Tipo\nDoc@4"
ITEM "Tipo\nRiga@4"
ITEM "Qta"
ITEM "Prezzo"
ITEM "Imponibile"
END
ENDPAGE
ENDMASK ENDMASK
PAGE "Elementi spredsheet" 0 2 0 0 PAGE "Elementi spredsheet" 0 2 0 0
@ -185,7 +198,6 @@ BEGIN
OUTPUT S_IMPONIBILE CODTAB OUTPUT S_IMPONIBILE CODTAB
END END
ENDPAGE ENDPAGE
TOOLBAR "Riga" 0 0 0 2 TOOLBAR "Riga" 0 0 0 2

View File

@ -124,7 +124,7 @@ void TMancati_mask::fill()
#ifdef DBG #ifdef DBG
enable(DLG_OK); enable(DLG_OK);
#else #else
enable(DLG_OK, filter_selected != "X" && filter_selected != "P"); enable(DLG_OK, false);
#endif #endif
// Record di controllo per eventuali elaborazioni precedenti // Record di controllo per eventuali elaborazioni precedenti

View File

@ -147,15 +147,28 @@ private:
protected: protected:
bool initialize(const TDocumentoEsteso& doc);
/**< Funzioni di controllo */
/**< Controlli di testata, non è const per il calcolo della codizione di pagamento */
bool check_initial(TDocumentoEsteso& doc);
/**< Controllo di riga */
bool check_row(const TRiga_documento& rdoc);
/**< Controllo riepilogo IVA */
bool check_riepilogo(const TDocumentoEsteso& doc, const TRiepilogo_iva& riva);
bool initialize(TDocumentoEsteso& doc);
bool parse_sconto(const TString& formula, TToken_string& sconti) const; bool parse_sconto(const TString& formula, TToken_string& sconti) const;
static bool get_bnp_iban(const TString& abi, const TString& cab, int prg, TString& iban); static bool get_bnp_iban(const TString& abi, const TString& cab, int prg, TString& iban);
bool get_bank(const TDocumento& doc, TString& iban, TString& abi, TString& cab, TString& istituto) const; bool get_bank(TDocumento& doc, TString& iban, TString& abi, TString& cab, TString& istituto) const;
bool get_bank_presentazione(const TDocumento& doc, TString& iban, TString& abi, TString& cab, TString& istituto) const;
bool get_bank_appoggio(const TDocumento& doc, TString& iban, TString& abi, TString& cab, TString& istituto) const;
const TString& descrizione(const TRiga_documento& rdoc); const TString& descrizione(const TRiga_documento& rdoc);
const TRectype& cco(const TRectype& doc) const; // Contratto/Convenzione/Offerta const TRectype& cco(const TRectype& doc) const; // Contratto/Convenzione/Offerta
void log(int severity, const char* msg); void log(int severity, const char* msg);
const char* natura(const TString& codiva) const; const char* natura(const TString& codiva) const;
const char* get_esigibilita_iva(const TDocumentoEsteso& doc);
void set_IVA(TString codiva, TPaf_record& paf) const; void set_IVA(TString codiva, TPaf_record& paf) const;
void set_IVA(const TRiga_documento& rdoc, TPaf_record& paf) const; void set_IVA(const TRiga_documento& rdoc, TPaf_record& paf) const;
bool add_row_art(long& riga_art, const TString& codice_tipo, const TString& codice_valore, TPaf_record& paf); bool add_row_art(long& riga_art, const TString& codice_tipo, const TString& codice_valore, TPaf_record& paf);
@ -211,6 +224,7 @@ public:
const bool get_esp_est() const; const bool get_esp_est() const;
const TString& get_esp_est_cod() const; const TString& get_esp_est_cod() const;
const bool is_f8() const; const bool is_f8() const;
const bool get_check_not_block() const;
// Setters // Setters
void set_db_indirizzo(const TString& ind) const; void set_db_indirizzo(const TString& ind) const;
@ -226,6 +240,7 @@ public:
void set_esp_est(bool esp_est) const; void set_esp_est(bool esp_est) const;
void set_esp_est_cod(const TString& esp_est_cod) const; void set_esp_est_cod(const TString& esp_est_cod) const;
void set_f8(bool f8) const; void set_f8(bool f8) const;
void set_check_not_block(bool not_block) const;
}; };
inline TFP_settings& fp_settings() inline TFP_settings& fp_settings()

View File

@ -190,7 +190,7 @@ bool get_coddest(const char tipocf, const long codcf, TString& coddest, TString&
} }
else else
pec = ""; pec = "";
// Dopo la versione 1.2 torna sempre true
return coddest.full(); return coddest.full();
} }
inline const TString& no_special(char a) inline const TString& no_special(char a)
@ -207,7 +207,16 @@ inline const TString& no_special(char a)
} }
const TString& tipo_doc_sdi(const TDocumento& doc) const TString& tipo_doc_sdi(const TDocumento& doc)
{ {
return doc.get(DOC_TIPODOCSDI).full() ? doc.get(DOC_TIPODOCSDI) : doc.tipo().tipo_doc_sdi(); static TString tipo_doc_sdi;
tipo_doc_sdi.cut(0) << doc.get(DOC_TIPODOCSDI);
// Controlli da fare per clienti a cui si fotte la conversione e mi trovo dati sporchi nella colonna
if (tipo_doc_sdi.len() == 4 && tipo_doc_sdi.starts_with("TD"))
{
return tipo_doc_sdi;
}
return doc.tipo().tipo_doc_sdi();
} }
bool is_fattura(const TRectype& doc) bool is_fattura(const TRectype& doc)
@ -529,47 +538,74 @@ bool TDoc_fp::get_bnp_iban(const TString& abi, const TString& cab, int nprog, TS
iban = bnp.get("S3"); iban = bnp.get("S3");
return err == NOERR; return err == NOERR;
} }
bool TDoc_fp::get_bank(const TDocumento& doc, TString& iban, TString& abi, TString& cab, TString& istituto) const bool TDoc_fp::get_bank(TDocumento& doc, TString& iban, TString& abi, TString& cab, TString& istituto) const
{ {
bool found = false; bool found = false;
abi = doc.get(DOC_CODABIP); if(doc.pagamento().tipo_rata(0) == TTipo_pag::_bonfico)
cab = doc.get(DOC_CODCABP); {
int prg = doc.get_int(DOC_PROGBNP); found = get_bank_presentazione(doc, iban, abi, cab, istituto);
}
else if(doc.pagamento().tipo_rata(0) == TTipo_pag::_ric_ban || doc.pagamento().tipo_rata(0) == TTipo_pag::_rid)
{
found = get_bank_appoggio(doc, iban, abi, cab, istituto);
}
return found;
}
bool TDoc_fp::get_bank_presentazione(const TDocumento& doc, TString& iban, TString& abi, TString& cab, TString& istituto) const
{
bool found = false;
abi = doc.get(DOC_CODABIP);
cab = doc.get(DOC_CODCABP);
int prg = doc.get_int(DOC_PROGBNP);
found = abi.full() && cab.full();
if (found)
get_bnp_iban(abi, cab, prg, iban);
if (!found) // Se non trovo banca su CFBAN la cerco su CFVEN
{
const TRectype& cfven = doc.clifor().vendite();
abi = cfven.get(CFV_CODABIPR);
cab = cfven.get(CFV_CODCABPR);
found = abi.full() && cab.full(); found = abi.full() && cab.full();
if (found) if (found)
get_bnp_iban(abi, cab, prg, iban); get_bnp_iban(abi, cab, 0, iban);
if (!found) // Se non trovo banca sul DOC la cerco su CFBAN }
{ if (found)
TToken_string key; istituto = cache().get("%BAN", abi, "S0");
key.add("C"); return found;
key.add(doc.codcf());
key.add("N");
key.add(1);
const TRectype& cfban = cache().get(LF_CFBAN, key);
if (!cfban.empty())
{
abi = cfban.get(CFBAN_ABI);
cab = cfban.get(CFBAN_CAB);
prg = cfban.get_int(CFBAN_PROGPR);
found = abi.full() && cab.full();
iban = cfban.get(CFBAN_IBAN);
if (found && iban.blank())
get_bnp_iban(abi, cab, prg, iban);
}
}
if (!found) // Se non trovo banca su CFBAN la cerco su CFVEN
{
const TRectype& cfven = doc.clifor().vendite();
abi = cfven.get(CFV_CODABIPR);
cab = cfven.get(CFV_CODCABPR);
found = abi.full() && cab.full();
if (found)
get_bnp_iban(abi, cab, 0, iban);
}
if (found)
istituto = cache().get("%BAN", abi, "S0");
return found;
} }
bool TDoc_fp::get_bank_appoggio(const TDocumento& doc, TString& iban, TString& abi, TString& cab,
TString& istituto) const
{
bool found = false;
abi = doc.get(DOC_CODABIA);
cab = doc.get(DOC_CODCABA);
iban = doc.get(DOC_IBAN);
found = iban.full();
if (!found) // Se non trovo banca sul DOC la cerco su CFBAN
{
TToken_string key;
key.add("C");
key.add(doc.codcf());
key.add("N");
key.add(1);
const TRectype& cfban = cache().get(LF_CFBAN, key);
if (!cfban.empty())
{
abi = cfban.get(CFBAN_ABI);
cab = cfban.get(CFBAN_CAB);
found = abi.full() && cab.full();
iban = cfban.get(CFBAN_IBAN);
if (found && iban.blank())
get_bnp_iban(abi, cab, -1, iban);
}
}
if (found)
istituto = cache().get("%BAN", abi, "S0");
return found;
}
const TString& TDoc_fp::descrizione(const TRiga_documento& rdoc) const TString& TDoc_fp::descrizione(const TRiga_documento& rdoc)
{ {
if (rdoc.get_bool(RDOC_DESCLUNGA)) if (rdoc.get_bool(RDOC_DESCLUNGA))
@ -687,7 +723,91 @@ bool TDoc_fp::save_paf()
return ok; return ok;
} }
bool TDoc_fp::initialize(const TDocumentoEsteso& doc) bool TDoc_fp::check_initial(TDocumentoEsteso& doc)
{
bool ok = true;
static TString msg;
if (_coddest.len() != 6 && _coddest.len() != 7)
{
log(1, "Il codice destinatario ha una lunghezza non conforme.");
ok = false;
}
if (_rec_clifo.get(CLI_PAIV).empty() && _rec_clifo.get(CLI_COFI).empty())
{
log(1, "Sia la partita IVA che il codice fiscale del cessionario committente sono vuoti, almeno uno dei due deve essere valorizzato.");
ok = false;
}
TPagamento& pag = doc.pagamento();
if(pag.cond_pag_sdi().empty())
{
msg.cut(0) << "Non è valorizzata la condizione di pagamento SDI (TP01, TP02, TP03) per la condizione di pagamento " << pag.code();
log(1, msg);
ok = false;
}
for (int nr = 0; nr < doc.scadenze().items(); nr++)
{
const int rp = nr < pag.n_rate() ? nr : 0;
static TString key_class; key_class.cut(0) << pag.tipo_rata(rp) << pag.ulc_rata(rp);
if(cache().get("%CLR", key_class, "S12").empty())
{
msg.cut(0) << "Non è valorizzata la tipologia di pagamento SDI (MPXX) per la condizione di pagamento " << pag.code();
log(1, msg);
ok = false;
}
}
return ok;
}
bool TDoc_fp::check_row(const TRiga_documento& rdoc)
{
bool ok = false;
static TString msg;
if(rdoc.is_spese())
{
const TSpesa_prest& spesa = rdoc.spesa();
if(spesa.perc().is_zero())
{
msg.cut(0) << "É corretto che per la spesa " << spesa.codice() << " la percentuale sia zero?";
log(1, msg);
}
}
const TCodiceIVA& codice_iva = rdoc.iva();
if (codice_iva.codice().full() && codice_iva.percentuale() == ZERO && codice_iva.natura().empty())
{
msg.cut(0) << "Impossibile avere la natura non valorizzata a fronte di una aliquota con percentuale zero. Codice IVA: "; msg << codice_iva.codice();
log(1, msg);
ok = false;
}
return ok;
}
bool TDoc_fp::check_riepilogo(const TDocumentoEsteso& doc, const TRiepilogo_iva& riva)
{
bool ok = true;
static TString msg;
if(*get_esigibilita_iva(doc) == 'S' && riva.cod_iva().natura() == "N6")
{
msg.cut(0) << "Impossibile avere un documento con scissione dei pagamenti e natura iva N6, codice: " << riva.cod_iva().codice();
log(1, msg);
ok = false;
}
return ok;
}
bool TDoc_fp::initialize(TDocumentoEsteso& doc)
{ {
// Azzero // Azzero
_hfatt.cut(0); _hfatt.cut(0);
@ -723,7 +843,10 @@ bool TDoc_fp::initialize(const TDocumentoEsteso& doc)
#ifndef DBG #ifndef DBG
_is_pa = doc.clifor().get_int("ALLEG") == 7; _is_pa = doc.clifor().get_int("ALLEG") == 7;
if (!get_coddest(doc.clifor().tipo(), doc.clifor().codice(), _coddest, _pec)) if (!get_coddest(doc.clifor().tipo(), doc.clifor().codice(), _coddest, _pec))
{
log(1, "Impossibile trovare il codice destinatario per la fattura");
return false; return false;
}
#else #else
_is_pa = true; _is_pa = true;
_coddest = "WSUHKZ"; _coddest = "WSUHKZ";
@ -747,7 +870,7 @@ bool TDoc_fp::initialize(const TDocumentoEsteso& doc)
// Azzero indici // Azzero indici
_index_cassa_previdenziale = 1; _index_cassa_previdenziale = 1;
return true; return check_initial(doc) || fp_settings().get_check_not_block();
} }
const TRectype& TDoc_fp::cco(const TRectype& doc) const const TRectype& TDoc_fp::cco(const TRectype& doc) const
@ -835,6 +958,18 @@ const char* TDoc_fp::natura(const TString& codiva) const
return cache().get("%IVA", codiva, "S12"); return cache().get("%IVA", codiva, "S12");
} }
const char* TDoc_fp::get_esigibilita_iva(const TDocumentoEsteso& doc)
{
// Esigibilità IVA: Immediata, Differita, Split payment
const char* eiva = "I";
if (doc.is_split_payment())
eiva = "S";
else if (doc.get_bool(DOC_LIQDIFF) || doc.get_bool(DOC_IVAXCASSA))
eiva = "D";
return eiva;
}
void TDoc_fp::set_IVA(TString codiva, TPaf_record& paf) const void TDoc_fp::set_IVA(TString codiva, TPaf_record& paf) const
{ {
if (codiva.empty()) if (codiva.empty())
@ -1097,6 +1232,7 @@ bool TDoc_fp::export_paf0100f()
paf0100f.set("P1_TELEFONO", tel); paf0100f.set("P1_TELEFONO", tel);
paf0100f.set("P1_MAIL", get_firm().get(NDT_MAIL)); paf0100f.set("P1_MAIL", get_firm().get(NDT_MAIL));
paf0100f.set("P1_GESTIONE", "D"); paf0100f.set("P1_GESTIONE", "D");
paf0100f.set("P1_ERRINT", "");
// </DatiTrassmissione> // </DatiTrassmissione>
return insert(paf0100f); return insert(paf0100f);
} }
@ -1402,46 +1538,50 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
FOR_EACH_PHYSICAL_RDOC(doc, r, rdoc) FOR_EACH_PHYSICAL_RDOC(doc, r, rdoc)
{ {
// Controllo la riga
if (check_row(*rdoc) && !fp_settings().get_check_not_block())
return false;
bool skip_riga = false; bool skip_riga = false;
paf1800f.reset(); paf1800f.reset();
paf1800f.set("PI_KEYHEADERFATT", _hfatt); paf1800f.set("PI_KEYHEADERFATT", _hfatt);
paf1800f.set("PI_KEYBODYFATT", _bfatt); paf1800f.set("PI_KEYBODYFATT", _bfatt);
paf1800f.set("PI_NUMEROLINEA", riga); paf1800f.set("PI_NUMEROLINEA", riga);
const TString& descrizione_riga = descrizione(*rdoc); const TString& descrizione_riga = descrizione(*rdoc);
if (descrizione_riga.empty()) if (descrizione_riga.empty())
continue; continue;
paf3000f.reset(); paf3000f.reset();
paf3000f.set("PT_KEYHEADERFATT", _hfatt); paf3000f.set("PT_KEYHEADERFATT", _hfatt);
paf3000f.set("PT_KEYBODYFATT", _bfatt); paf3000f.set("PT_KEYBODYFATT", _bfatt);
paf3000f.set("PT_RIFNUMLINEA", riga); paf3000f.set("PT_RIFNUMLINEA", riga);
paf3000f.set("PT_COMMENTO", descrizione_riga); paf3000f.set("PT_COMMENTO", descrizione_riga);
// <CodiceArticolo> // <CodiceArticolo>
if (rdoc->is_articolo()) if (rdoc->is_articolo())
{
TString codartmag = rdoc->get(RDOC_CODARTMAG);
TString codart = rdoc->get(RDOC_CODART);
long riga_art = 0;
if (codart.full())
{ {
if (codartmag.full()) TString codartmag = rdoc->get(RDOC_CODARTMAG);
TString codart = rdoc->get(RDOC_CODART);
long riga_art = 0;
if (codart.full())
{ {
paf1900f.reset(); if (codartmag.full())
paf1900f.set("PY_KEYHEADERFATT", _hfatt); {
paf1900f.set("PY_KEYBODYFATT", _bfatt); paf1900f.reset();
paf1900f.set("PY_KEYNLINEA", riga); paf1900f.set("PY_KEYHEADERFATT", _hfatt);
ok &= add_row_art(riga_art, "Codice articolo interno", codartmag, paf1900f); paf1900f.set("PY_KEYBODYFATT", _bfatt);
} paf1900f.set("PY_KEYNLINEA", riga);
// Se il codice articolo del magazzino è diverso quello è del cliente ok &= add_row_art(riga_art, "Codice articolo interno", codartmag, paf1900f);
if (codart.full() && codart != codartmag) }
{ // Se il codice articolo del magazzino è diverso quello è del cliente
paf1900f.reset(); if (codart.full() && codart != codartmag)
paf1900f.set("PY_KEYHEADERFATT", _hfatt); {
paf1900f.set("PY_KEYBODYFATT", _bfatt); paf1900f.reset();
paf1900f.set("PY_KEYNLINEA", riga); paf1900f.set("PY_KEYHEADERFATT", _hfatt);
ok &= add_row_art(riga_art, "Codice articolo cliente", codart, paf1900f); paf1900f.set("PY_KEYBODYFATT", _bfatt);
paf1900f.set("PY_KEYNLINEA", riga);
ok &= add_row_art(riga_art, "Codice articolo cliente", codart, paf1900f);
}
} }
} }
}
// </CodiceArticolo> // </CodiceArticolo>
if(rdoc->is_descrizione()) if(rdoc->is_descrizione())
{ {
@ -1561,6 +1701,7 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
// Controllo se è una ritenuta fiscale // Controllo se è una ritenuta fiscale
if (sp.tipo_ritenuta() == 'F') if (sp.tipo_ritenuta() == 'F')
{ {
paf1800f.set("PI_RITENUTA", "SI");
add_ritenuta(doc, rdoc->spesa(), paf0700f); add_ritenuta(doc, rdoc->spesa(), paf0700f);
} }
} }
@ -1833,17 +1974,16 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
paf2200f.set("PL_KEYHEADERFATT", _hfatt); paf2200f.set("PL_KEYHEADERFATT", _hfatt);
paf2200f.set("PL_KEYBODYFATT", _bfatt); paf2200f.set("PL_KEYBODYFATT", _bfatt);
remove(paf2200f); // Cancella tutte le righe di riepilogo IVA remove(paf2200f); // Cancella tutte le righe di riepilogo IVA
const char* eiva = "I"; // Esigibilità IVA: Immediata, Differita, Split payment const char* eiva = get_esigibilita_iva(doc);
if (doc.is_split_payment())
eiva = "S";
else if (doc.get_bool(DOC_LIQDIFF) || doc.get_bool(DOC_IVAXCASSA))
eiva = "D";
long num_riep = 0; long num_riep = 0;
TAssoc_array& tiva = doc.tabella_iva(false); TAssoc_array& tiva = doc.tabella_iva(false);
FOR_EACH_ASSOC_OBJECT(tiva, obj, key, itm) FOR_EACH_ASSOC_OBJECT(tiva, obj, key, itm)
{ {
const TRiepilogo_iva& riva = *dynamic_cast<const TRiepilogo_iva*>(itm); const TRiepilogo_iva& riva = *dynamic_cast<const TRiepilogo_iva*>(itm);
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()); add_riepilogo_iva(paf2200f, riva.cod_iva(), eiva, riva.imponibile(), riva.imposta());
} }
@ -1886,10 +2026,10 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
TString8 abi, cab; TString8 abi, cab;
if (get_bank(doc, iban, abi, cab, istituto)) if (get_bank(doc, iban, abi, cab, istituto))
{ {
paf2500f.set("PO_ISTFINANZ", istituto); paf2500f.set("PO_ISTFINANZ", istituto);
paf2500f.set("PO_IBAN", iban); paf2500f.set("PO_IBAN", iban);
paf2500f.set("PO_ABI", abi); paf2500f.set("PO_ABI", abi);
paf2500f.set("PO_CAB", cab); paf2500f.set("PO_CAB", cab);
} }
if (tipo_pag == 3 && cab.blank()) // Ricevuta bancaria if (tipo_pag == 3 && cab.blank()) // Ricevuta bancaria
log(2, TR("Non sono presenti ABI, CAB, IBAN per il pagamento")); log(2, TR("Non sono presenti ABI, CAB, IBAN per il pagamento"));
@ -1899,15 +2039,15 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
} }
for (int nr = 0; nr < nrate; nr++) for (int nr = 0; nr < nrate; nr++)
{ {
paf2500f.set("PO_RIGA", long(nr + 1)); // Numero rata paf2500f.set("PO_RIGA", long(nr + 1)); // Numero rata
int rp = nr < pag.n_rate() ? nr : 0; const int rp = nr < pag.n_rate() ? nr : 0;
static TString key_class; key_class.cut(0) << pag.tipo_rata(rp) << pag.ulc_rata(rp); static TString key_class; key_class.cut(0) << pag.tipo_rata(rp) << pag.ulc_rata(rp);
paf2500f.set("PO_MODALITAPAGAM", cache().get("%CLR", key_class, "S12")); // Si assicura che il numero riga sia accettabile paf2500f.set("PO_MODALITAPAGAM", cache().get("%CLR", key_class, "S12")); // Si assicura che il numero riga sia accettabile
TToken_string& riga_scadenze = scad.row(nr); // Data|Importo TToken_string& riga_scadenze = scad.row(nr); // Data|Importo
paf2500f.set("PO_DATASCADENZA", TDate(riga_scadenze.get(0))); // Data scadenza paf2500f.set("PO_DATASCADENZA", TDate(riga_scadenze.get(0))); // Data scadenza
paf2500f.set("PO_IMPORTO", converti_prezzo(real(riga_scadenze.get()))); // Importo rata paf2500f.set("PO_IMPORTO", converti_prezzo(real(riga_scadenze.get()))); // Importo rata
paf2500f.set("PO_GESTIONE", "D"); paf2500f.set("PO_GESTIONE", "D");
ok &= insert(paf2500f); ok &= insert(paf2500f);
} }
// </DatiPagamento> // </DatiPagamento>
if (_gestioneallegati) if (_gestioneallegati)

View File

@ -19,6 +19,7 @@
#define FP_ESP_EST "espest" #define FP_ESP_EST "espest"
#define FP_ESP_EST_COD "espestcod" #define FP_ESP_EST_COD "espestcod"
#define FP_F8 "f8" #define FP_F8 "f8"
#define FP_CHECK_NOT_BLOCK "checknotblock"
// Sheet fp0300 // Sheet fp0300
#define FP_SLD_COD "SLD" #define FP_SLD_COD "SLD"
@ -112,6 +113,11 @@ const bool TFP_settings::is_f8() const
return ini_get_bool(FILE_CONFIG, FILE_SECTION, FP_F8); return ini_get_bool(FILE_CONFIG, FILE_SECTION, FP_F8);
} }
const bool TFP_settings::get_check_not_block() const
{
return ini_get_bool(FILE_CONFIG, FILE_SECTION, FP_CHECK_NOT_BLOCK);
}
void TFP_settings::set_db_indirizzo(const TString& ind) const void TFP_settings::set_db_indirizzo(const TString& ind) const
{ {
ini_set_string(FILE_CONFIG, FILE_SECTION, FP_IP, ind); ini_set_string(FILE_CONFIG, FILE_SECTION, FP_IP, ind);
@ -177,6 +183,11 @@ void TFP_settings::set_f8(const bool f8) const
ini_set_bool(FILE_CONFIG, FILE_SECTION, FP_F8, f8); ini_set_bool(FILE_CONFIG, FILE_SECTION, FP_F8, f8);
} }
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);
}
TRectype TFP_selected_docs::fill_rectype() const TRectype TFP_selected_docs::fill_rectype() const
{ {
TRectype r(LF_TABMOD); TRectype r(LF_TABMOD);

View File

@ -649,8 +649,11 @@ bool TTrasferimentoCU::append_record_d(const TRectype& qla, TLog_report& log)
rec.np_put("DA001002", sost.cognome()); rec.np_put("DA001002", sost.cognome());
rec.np_put("DA001003", sost.nome()); rec.np_put("DA001003", sost.nome());
} }
else else
rec.np_put("DA001002", sost.ragione_sociale()); {
rec.np_put("DA001002", sost.ragione_sociale().left(30));
rec.np_put("DA001003", sost.ragione_sociale().mid(30));
}
rec.np_put("DA001004", sost.comune_residenza()); rec.np_put("DA001004", sost.comune_residenza());
rec.np_put("DA001005", sost.provincia_residenza()); rec.np_put("DA001005", sost.provincia_residenza());

View File

@ -699,7 +699,7 @@ void TCU_report::create_D()
begin_paragraph(body, 12, 9, "DATI ANAGRAFICI\nDATI RELATIVI\nAL DATORE DI LAVORO,\nENTE PENSIONISTICO O\nALTRO SOSTITUTO\nD'IMPOSTA", 0x3); begin_paragraph(body, 12, 9, "DATI ANAGRAFICI\nDATI RELATIVI\nAL DATORE DI LAVORO,\nENTE PENSIONISTICO O\nALTRO SOSTITUTO\nD'IMPOSTA", 0x3);
add_labeled_field(body, 0, 0, 16, "#DA001001", "Codice Fiscale"); add_labeled_field(body, 0, 0, 16, "#DA001001", "Codice Fiscale");
add_labeled_field(body, 0, CU_AFTER_LAST, 30, "#DA001002", "Cognome o Denominazione"); add_labeled_field(body, 0, CU_AFTER_LAST, 31, "#DA001002", "Cognome o Denominazione");
add_labeled_field(body, 0, CU_AFTER_LAST, CU_ALIGN_RIGHT, "#DA001003", "Nome"); // La colonna segue il cognome add_labeled_field(body, 0, CU_AFTER_LAST, CU_ALIGN_RIGHT, "#DA001003", "Nome"); // La colonna segue il cognome
add_labeled_field(body, 1, 0, 24, "#DA001004", "Comune"); add_labeled_field(body, 1, 0, 24, "#DA001004", "Comune");