Patch level : 10.0
Files correlati : fe0100a.msk fe0.exe Ricompilazione Demo : [ ] Commento : Aggiunta gestione codice stato per modello UNICO (non più ISTAT) git-svn-id: svn://10.65.10.50/branches/R_10_00@22532 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
f6ae549c3b
commit
7cbc9ed5e2
@ -352,7 +352,7 @@ TExclusion_mode TDati_rilevanti_array::add(const TRectype& alleg, bool send_all,
|
||||
return segnala_riga(alleg, em_importo_limite, log);
|
||||
|
||||
const TAnagrafica a(alleg);
|
||||
if (a.codice_fiscale().blank() && a.partita_IVA().blank() && a.stato_estero() == 0)
|
||||
if (a.codice_fiscale().blank() && a.partita_IVA().blank() && a.italiano())
|
||||
return segnala_riga(alleg, em_no_allegato, log);
|
||||
|
||||
if (is_nota_variazione(alleg))
|
||||
@ -566,6 +566,10 @@ TExclusion_mode TDati_rilevanti_msk::validate_clifo(const TRectype& mov)
|
||||
if (tipocf <= ' ' || (codcf <= 0 && ocfpi.blank()))
|
||||
return segnala_movimento(mov, em_no_allegato);
|
||||
|
||||
TString8 key; key.format("%c|%ld", tipocf, codcf);
|
||||
const TRectype& rec_clifo = cache().get(LF_CLIFO, key);
|
||||
const int alleg = rec_clifo.get_int(CLI_ALLEG);
|
||||
|
||||
TString4 stato;
|
||||
if (ocfpi.full())
|
||||
{
|
||||
@ -574,10 +578,6 @@ TExclusion_mode TDati_rilevanti_msk::validate_clifo(const TRectype& mov)
|
||||
}
|
||||
else
|
||||
{
|
||||
TString8 key; key.format("%c|%ld", tipocf, codcf);
|
||||
const TRectype& rec_clifo = cache().get(LF_CLIFO, key);
|
||||
|
||||
const int alleg = rec_clifo.get_int(CLI_ALLEG);
|
||||
if (alleg == 1)
|
||||
return segnala_movimento(mov, em_no_allegato);
|
||||
|
||||
@ -589,11 +589,17 @@ TExclusion_mode TDati_rilevanti_msk::validate_clifo(const TRectype& mov)
|
||||
|
||||
if (stato.full())
|
||||
{
|
||||
const TRectype& rec_sta = cache().get("%STA", stato);
|
||||
if (rec_sta.get_bool("B0"))
|
||||
return segnala_movimento(mov, em_fiscalita_agevolata);
|
||||
|
||||
if (tipocf == 'F')
|
||||
if (tipocf == 'C')
|
||||
{
|
||||
// I clienti privati vanno inclusi anche se residenti in stati esteri in black list
|
||||
if (ocfpi.blank() && alleg != 6)
|
||||
{
|
||||
const TRectype& rec_sta = cache().get("%STA", stato);
|
||||
if (rec_sta.get_bool("B0"))
|
||||
return segnala_movimento(mov, em_fiscalita_agevolata);
|
||||
}
|
||||
}
|
||||
else
|
||||
return segnala_movimento(mov, em_estero);
|
||||
}
|
||||
|
||||
@ -1058,7 +1064,7 @@ bool TDati_rilevanti_msk::send_nota_variazione(const TRectype& alleg, TDati_rile
|
||||
else
|
||||
imposta = -imposta;
|
||||
|
||||
if (anag.stato_estero() > 0)
|
||||
if (anag.estero())
|
||||
{
|
||||
operaz.new_rec("5"); // Note di variazione a soggetti non residenti
|
||||
if (anag.fisica())
|
||||
@ -1068,13 +1074,13 @@ bool TDati_rilevanti_msk::send_nota_variazione(const TRectype& alleg, TDati_rile
|
||||
operaz.set(4, anag.data_nascita());
|
||||
operaz.set(5, anag.comune_nascita());
|
||||
operaz.set(6, anag.provincia_nascita());
|
||||
operaz.set(7, anag.stato_estero());
|
||||
operaz.set(7, anag.stato_estero_UNICO());
|
||||
}
|
||||
else
|
||||
{
|
||||
operaz.set(8, anag.ragione_sociale());
|
||||
operaz.set(9, anag.comune_residenza());
|
||||
operaz.set(10, anag.stato_estero());
|
||||
operaz.set(10, anag.stato_estero_UNICO());
|
||||
operaz.set(11, anag.indirizzo_residenza());
|
||||
}
|
||||
operaz.set(12, alleg.get(ALL_DATAREG));
|
||||
@ -1118,7 +1124,7 @@ bool TDati_rilevanti_msk::send_fatt(const TRectype& alleg, TDati_rilevanti_set&
|
||||
if (!anag.ok())
|
||||
return false;
|
||||
|
||||
if (anag.stato_estero() > 0)
|
||||
if (anag.estero())
|
||||
{
|
||||
operaz.new_rec("3"); // Operazioni con soggetti non residenti
|
||||
if (anag.fisica())
|
||||
@ -1128,7 +1134,7 @@ bool TDati_rilevanti_msk::send_fatt(const TRectype& alleg, TDati_rilevanti_set&
|
||||
operaz.set(4, anag.data_nascita());
|
||||
operaz.set(5, anag.comune_nascita());
|
||||
operaz.set(6, anag.provincia_nascita());
|
||||
operaz.set(7, anag.stato_estero());
|
||||
operaz.set(7, anag.stato_estero_UNICO());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1137,7 +1143,7 @@ bool TDati_rilevanti_msk::send_fatt(const TRectype& alleg, TDati_rilevanti_set&
|
||||
operaz.set(9, anag.localita_residenza());
|
||||
else
|
||||
operaz.set(9, anag.comune_residenza());
|
||||
operaz.set(10, anag.stato_estero());
|
||||
operaz.set(10, anag.stato_estero_UNICO());
|
||||
operaz.set(11, anag.indirizzo_residenza());
|
||||
}
|
||||
operaz.set(12, alleg.get(ALL_DATAREG));
|
||||
@ -1804,7 +1810,7 @@ bool TDati_rilevanti_msk::on_field_event(TOperable_field& o, TField_event e, lon
|
||||
} else
|
||||
if (e == se_notify_modify)
|
||||
{
|
||||
set_dirty( true);
|
||||
set_dirty(true);
|
||||
enable_buttons();
|
||||
} else
|
||||
if (e == se_query_add)
|
||||
|
@ -84,13 +84,13 @@ END
|
||||
|
||||
DATE F_DATA
|
||||
BEGIN
|
||||
PROMPT 15 1 "Data limite "
|
||||
PROMPT 15 1 "Limite note variazione "
|
||||
CHECKTYPE REQUIRED
|
||||
END
|
||||
|
||||
LIST F_SHOWALL 1 13
|
||||
BEGIN
|
||||
PROMPT 45 1 "Mostra movimenti "
|
||||
PROMPT 52 1 "Movimenti "
|
||||
ITEM "1|Rilevanti"
|
||||
ITEM "2|NON rilevanti"
|
||||
ITEM "4|Scartati"
|
||||
@ -442,7 +442,7 @@ BEGIN
|
||||
INPUT CODCF A_CODCF SELECT
|
||||
INPUT DATAREG A_DATARETT
|
||||
COPY DISPLAY A_DATAREG
|
||||
OUTPUT A_DATARETT DATADOC
|
||||
OUTPUT A_DATARETT DATAREG
|
||||
OUTPUT A_NUMRETT NUMDOC
|
||||
ADD RUN cg2 -0
|
||||
NUM_EXPR IF((#A_IMPORTO<0)&&(#A_IGNORA<=0);#A_DATARETT!="";1)
|
||||
|
15
fe/felib.cpp
15
fe/felib.cpp
@ -71,6 +71,21 @@ void TAnagrafica::build_ind_res(const TRectype& rec, const char* ind, const char
|
||||
}
|
||||
}
|
||||
|
||||
bool TAnagrafica::italiano() const
|
||||
{ return _stato_estero <= 0; }
|
||||
|
||||
const TString& TAnagrafica::stato_estero_UNICO() const
|
||||
{
|
||||
if (italiano())
|
||||
return EMPTY_STRING;
|
||||
TString4 u;
|
||||
u.format("%03d", _stato_estero);
|
||||
const TString& cod = cache().get("%STA", u, "S8"); // S8=UNICO S9=ISTAT
|
||||
if (cod.len() == 3)
|
||||
u = cod;
|
||||
return get_tmp_string() = u;
|
||||
}
|
||||
|
||||
bool TAnagrafica::init(const TRectype& rec)
|
||||
{
|
||||
_tipo = '\0';
|
||||
|
@ -41,7 +41,9 @@ public:
|
||||
const TString& nome() const { CHECK(fisica(), "Non chiedere nome giuridico!"); return _ragsoc.mid(30,20); }
|
||||
char sesso() const { CHECK(fisica(), "Solo sesso fisico!"); return (_cofi[9] >= '4') ? 'F' : 'M'; }
|
||||
const TDate& data_nascita() const { return _data_nasc; }
|
||||
int stato_estero() const { return _stato_estero; }
|
||||
bool italiano() const;
|
||||
bool estero() const { return !italiano(); }
|
||||
const TString& stato_estero_UNICO() const;
|
||||
int inserimento_in_allegato() const { return _allegato; }
|
||||
|
||||
const TString& comune_nascita() const;
|
||||
|
Loading…
x
Reference in New Issue
Block a user