Patch level : 12.00 1384
Files correlati : 777.exe Bug : Commento: Aggiunto regime fiscale ai clienti/fornitori pre riconoscere i minimi e i forferrari nell'invio CU
This commit is contained in:
parent
0c4ef3f3e3
commit
de76951548
@ -266,7 +266,7 @@ const TVariant& TTrasferimentoCU::get_var(const char* name) const
|
|||||||
{
|
{
|
||||||
str = val;
|
str = val;
|
||||||
while (cur_rec.np_get(++p, key, val) && key == varname)
|
while (cur_rec.np_get(++p, key, val) && key == varname)
|
||||||
str << val.mid(1);
|
str << val.smid(1);
|
||||||
str.rtrim();
|
str.rtrim();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -520,7 +520,7 @@ bool TTrasferimentoCU::append_record_b()
|
|||||||
TRecordCU rec('B'); // Compila record di testata B
|
TRecordCU rec('B'); // Compila record di testata B
|
||||||
rec.set(2, cod_fis_dic());
|
rec.set(2, cod_fis_dic());
|
||||||
rec.set(3, 1); // Modulo (deve essere sempre 1)
|
rec.set(3, 1); // Modulo (deve essere sempre 1)
|
||||||
rec.set(8, get_iva_sirio()); // CF del produttore Sirio
|
rec.set(8, get_iva_prod()); // CF del produttore
|
||||||
rec.set(10, _tipo_operazione == 'A');
|
rec.set(10, _tipo_operazione == 'A');
|
||||||
rec.set(11, _tipo_operazione == 'S');
|
rec.set(11, _tipo_operazione == 'S');
|
||||||
|
|
||||||
@ -528,8 +528,8 @@ bool TTrasferimentoCU::append_record_b()
|
|||||||
|
|
||||||
if (_tipoa_dic == 'F')
|
if (_tipoa_dic == 'F')
|
||||||
{
|
{
|
||||||
rec.set(12, _ragsoc_dic.left(24));
|
rec.set(12, _ragsoc_dic.sleft(24));
|
||||||
rec.set(13, _ragsoc_dic.mid(30,20));
|
rec.set(13, _ragsoc_dic.smid(30,20));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -559,7 +559,7 @@ bool TTrasferimentoCU::append_record_b()
|
|||||||
_codfis_rap = rapp.codice_fiscale();
|
_codfis_rap = rapp.codice_fiscale();
|
||||||
rec.set(18, _codfis_rap);
|
rec.set(18, _codfis_rap);
|
||||||
rec.set(19, rec_nditte.get(NDT_CARRAPP));
|
rec.set(19, rec_nditte.get(NDT_CARRAPP));
|
||||||
rec.set(20, rapp.cognome().left(24));
|
rec.set(20, rapp.cognome().sleft(24));
|
||||||
rec.set(21, rapp.nome());
|
rec.set(21, rapp.nome());
|
||||||
rec.set(22, _codfis_dic);
|
rec.set(22, _codfis_dic);
|
||||||
}
|
}
|
||||||
@ -633,8 +633,8 @@ bool TTrasferimentoCU::append_record_d(const TRectype& qla, TLog_report& log)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
rec.np_put("DA001002", sost.ragione_sociale().left(30));
|
rec.np_put("DA001002", sost.ragione_sociale().sleft(30));
|
||||||
rec.np_put("DA001003", sost.ragione_sociale().mid(30));
|
rec.np_put("DA001003", sost.ragione_sociale().smid(30));
|
||||||
}
|
}
|
||||||
|
|
||||||
rec.np_put("DA001004", sost.comune_residenza());
|
rec.np_put("DA001004", sost.comune_residenza());
|
||||||
@ -1303,16 +1303,12 @@ class TCU_app : public TSkeleton_application
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void main_loop() override;
|
void main_loop() override;
|
||||||
void isUpdated();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void TCU_app::main_loop()
|
void TCU_app::main_loop()
|
||||||
{
|
{
|
||||||
TCU_mask m;
|
TCU_mask m;
|
||||||
|
|
||||||
// Eseguo controllo adeguamento database 2017
|
|
||||||
isUpdated();
|
|
||||||
|
|
||||||
m.field(F_INVIATE).set_default("");
|
m.field(F_INVIATE).set_default("");
|
||||||
m.field(F_RESET).set_default("");
|
m.field(F_RESET).set_default("");
|
||||||
while (m.run() == K_ENTER)
|
while (m.run() == K_ENTER)
|
||||||
@ -1320,11 +1316,10 @@ void TCU_app::main_loop()
|
|||||||
const int anno = m.get_int(F_ANNO);
|
const int anno = m.get_int(F_ANNO);
|
||||||
TFilename tmp; tmp.tempdir();
|
TFilename tmp; tmp.tempdir();
|
||||||
TTrasferimentoCU t(tmp, 'w');
|
TTrasferimentoCU t(tmp, 'w');
|
||||||
t.set_inter(m.get(F_INTER_CODFIS), m.get_date(F_INTER_DATA), anno);
|
|
||||||
t.set_operazione(m.get(F_INVIO)[0], m.get(F_IDENTIFICATIVO));
|
|
||||||
|
|
||||||
TString query;
|
TString query;
|
||||||
|
|
||||||
|
t.set_inter(m.get(F_INTER_CODFIS), m.get_date(F_INTER_DATA), anno);
|
||||||
|
t.set_operazione(m.get(F_INVIO)[0], m.get(F_IDENTIFICATIVO));
|
||||||
query.format("USE %d\nFROM CODDITTA=%ld\nTO CODDITTA=%ld",
|
query.format("USE %d\nFROM CODDITTA=%ld\nTO CODDITTA=%ld",
|
||||||
LF_BASE, m.get_long(F_DADITTA), m.get_long(F_ADITTA));
|
LF_BASE, m.get_long(F_DADITTA), m.get_long(F_ADITTA));
|
||||||
|
|
||||||
@ -1340,36 +1335,64 @@ void TCU_app::main_loop()
|
|||||||
{
|
{
|
||||||
const long codditta = base.get_long(BSE_CODDITTA);
|
const long codditta = base.get_long(BSE_CODDITTA);
|
||||||
TString msg; msg.format(FR("Generazione C.U. ditta %ld"), codditta);
|
TString msg; msg.format(FR("Generazione C.U. ditta %ld"), codditta);
|
||||||
|
TAssoc_array percip_cache;
|
||||||
|
const bool invforfmin = m.get_bool(F_FORFMIN);
|
||||||
|
|
||||||
|
if (!invforfmin)
|
||||||
|
{
|
||||||
|
query.format("USE %d SELECT (%s!=0)\nFROM %s=\"F\"",
|
||||||
|
LF_CLIFO, CLI_CODANAGPER, CLI_TIPOCF);
|
||||||
|
|
||||||
|
TISAM_recordset forn(query);
|
||||||
|
const TRectype& rec = forn.curr();
|
||||||
|
const TRecnotype nforn = forn.items();
|
||||||
|
|
||||||
|
if (nforn > 0)
|
||||||
|
{
|
||||||
|
TProgress_monitor pp(nforn, TR("Generazione cache percipienti"));
|
||||||
|
|
||||||
|
for (bool ok = forn.move_first(); pp.add_status() && ok; ok = forn.move_next())
|
||||||
|
{
|
||||||
|
TToken_string key = rec.get(CLI_TIPOAPER);
|
||||||
|
TString regfisc = rec.get(CLI_REGFISC);
|
||||||
|
|
||||||
|
key.add(rec.get(CLI_CODANAGPER));
|
||||||
|
percip_cache.add(key, regfisc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
log.log(0, "");
|
log.log(0, "");
|
||||||
log.log(0, msg);
|
log.log(0, msg);
|
||||||
|
|
||||||
t.read_codfis_dic(base);
|
t.read_codfis_dic(base);
|
||||||
t.append_record_b();
|
t.append_record_b();
|
||||||
|
|
||||||
query.format("USE %d SELECT (ANNO=%d)\nBY TIPOA CODANAGR CAUSALE\nFROM CODDITTA=%ld\nTO CODDITTA=%ld",
|
query.format("USE %d SELECT (ANNO=%d)\nBY TIPOA CODANAGR CAUSALE\nFROM CODDITTA=%ld\nTO CODDITTA=%ld",
|
||||||
LF_QUALA, anno, codditta, codditta);
|
LF_QUALA, anno, codditta, codditta);
|
||||||
|
|
||||||
TISAM_recordset perc(query);
|
TISAM_recordset perc(query);
|
||||||
const TRecnotype nperc = perc.items();
|
const TRecnotype nperc = perc.items();
|
||||||
const bool invforfmin = m.get_bool(F_FORFMIN);
|
|
||||||
|
|
||||||
if (nperc > 0)
|
if (nperc > 0)
|
||||||
{
|
{
|
||||||
TProgress_monitor pp(nperc, TR("Generazione record percipienti"));
|
TProgress_monitor pp(nperc, TR("Generazione record percipienti"));
|
||||||
const TRectype& rec = perc.cursor()->curr();
|
const TRectype& rec = perc.curr();
|
||||||
const int modulo = 1; // In realtà non accetta modulo != 1 per cui separa causali diverse in due comunicazioni
|
const int modulo = 1; // In realtà non accetta modulo != 1 per cui separa causali diverse in due comunicazioni
|
||||||
|
|
||||||
for (bool ok = perc.move_first(); ok; ok = perc.move_next())
|
for (bool ok = perc.move_first(); pp.add_status() && ok; ok = perc.move_next())
|
||||||
{
|
{
|
||||||
const real percrit = perc.get_real(QUD_PERC);
|
const real percrit = perc.get_real(QUD_PERC);
|
||||||
|
TToken_string key = rec.get(QUD_TIPOA);
|
||||||
|
TString regfisc;
|
||||||
|
|
||||||
if (percrit != ZERO || invforfmin)
|
key.add(rec.get(QUD_CODANAGR));
|
||||||
|
|
||||||
|
if (percip_cache.objptr(key) != nullptr)
|
||||||
|
regfisc = (TString &)*percip_cache.objptr(key);
|
||||||
|
if (invforfmin || percrit != ZERO || (regfisc.full() && regfisc != "RF02" && regfisc != "RF19"))
|
||||||
{
|
{
|
||||||
t.append_record_d(rec, log);
|
t.append_record_d(rec, log);
|
||||||
if (t.get_operazione() != 'A')
|
if (t.get_operazione() != 'A')
|
||||||
t.append_record_h(rec, modulo, log);
|
t.append_record_h(rec, modulo, log);
|
||||||
}
|
}
|
||||||
pp.add_status();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1393,36 +1416,6 @@ void TCU_app::main_loop()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TCU_app::isUpdated()
|
|
||||||
{
|
|
||||||
TRelation anagr(LF_ANAG);
|
|
||||||
/* TCursor c(&anagr);
|
|
||||||
long int items = c.items();
|
|
||||||
TProgress_monitor p(items, "Aggiornamento valori per CU");
|
|
||||||
bool trovato = false;
|
|
||||||
Eseguo questo controllo per verificare la presenza EVECC == 8
|
|
||||||
/*for(c=0; c.pos() < items && !trovato; ++c)
|
|
||||||
{
|
|
||||||
TRectype r = c.curr();
|
|
||||||
if(r.get_int("EVECC") == 8)
|
|
||||||
trovato = true;
|
|
||||||
}
|
|
||||||
if(!trovato)
|
|
||||||
{
|
|
||||||
for(c=0; c.pos() < items; ++c)
|
|
||||||
{
|
|
||||||
if (!p.add_status())
|
|
||||||
break;
|
|
||||||
TRectype r = c.curr();
|
|
||||||
if(r.get_int("EVECC") == 6)
|
|
||||||
{
|
|
||||||
r.put("EVECC", 8);
|
|
||||||
r.write_rewrite(anagr.lfile());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} */
|
|
||||||
}
|
|
||||||
|
|
||||||
int m777200(int argc, char* argv[])
|
int m777200(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user