COMMIT PER PRIMA PATCH

This commit is contained in:
smen 2023-03-28 17:50:34 +02:00
parent 85ac655949
commit 3597192f7a
4 changed files with 52 additions and 9 deletions

View File

@ -1,3 +1,3 @@
23
0
$mov|0|0|634|0|Movimenti di prima nota|||
$mov|0|0|714|0|Movimenti di prima nota|||

View File

@ -1,5 +1,5 @@
23
67
68
ANNOES|9|4|0|Codice esercizio
NUMREG|3|7|0|Numero di operazione
DATAREG|5|8|0|Data operazione
@ -67,6 +67,7 @@ IDDOCSDI|1|20|0|Identificativo documento SDI
DATADOCSDI|5|8|0|Data documento SDI
COLL_GOLEM|11|10|0|Documenti generici
CARTACEI|11|10|0|Documenti cartacei
KEYPAF|1|80|0|Chiavi del PAFW300 [KEYPRGINVIO;KEYHEADERFATT;KEYBODYFATT]
4
NUMREG|
DATAREG+NUMREG|X

View File

@ -123,7 +123,8 @@ enum state_estr_int
int_with_err = -1, // Movimento associato male con FPPRO
guessed_int = 100,
no_guessed_int = 0,
err_read_db_int = 999 // Errore lettura da fppro
err_read_db_int = 999, // Errore lettura da fppro
wrong_keys = -2
};
class TF9_config
@ -319,7 +320,8 @@ enum err_mov
mov_no_filecart, // Il documento cartaceo non ha associato un file, o questo non e' stato trovato.
mov_annesso_nexist, // Un annesso obbligatorio e' mancante.
mov_nocat_butok, // Non è stata trovata nessuna categoria documentale per il seguente documento. Verra usato il TIPODOCSDI presente nel FPPRO
mov_no_sdi // Nessuno tipo doc SDI abbinato
mov_no_sdi, // Nessuno tipo doc SDI abbinato
mov_nomatch_keys // La chiave del documento salavta in MOV non si matcha con nessun documento elettronico
};
class TMovimento_estr : public TObject // aggiungere metodi per TArray
@ -440,6 +442,7 @@ class TEstrazione : public TObject
state_estr_int guess_int(int numreg);
bool checkPAF(TLocalisamfile& mov);
bool checkPAA(TLocalisamfile& mov);
const bool check_keys(TToken_string keys);
bool check_periodo_def() const;
void copy_file_to_webapp_fld(TMovimento_estr& movimento) const;
void fill_id(const TRectype& clifo, TString& statopaiv, TString& idfisc, TString& paiv, TString& codfis);

View File

@ -1239,11 +1239,23 @@ const char* TEstrazione::diagnostica_mov_integrazione()
if (keys.full() && (keys.items() == 3))
{
ok &= true;
mov_i.set_estratto(true);
mov_i.set_state_int(guessed_int);
++_stats.int_match;
continue;
if (check_keys(keys))
{
ok &= true;
mov_i.set_estratto(true);
mov_i.set_state_int(guessed_int);
++_stats.int_match;
continue;
}
else
{
ok &= false;
mov_i.set_state_int(int_with_err);
mov_i.reset_err();
mov_i.set_err("Chiavi del documento ERRATE", mov_nomatch_keys);
++_stats.int_nomatch;
continue;
}
}
if (mov_i.no_err() && mov_i.estratto())
@ -1288,6 +1300,33 @@ const char* TEstrazione::diagnostica_mov_integrazione()
return _head.stato_estr;
}
const bool TEstrazione::check_keys(TToken_string keys)
{
bool res;
TString query;
if (get_tipoiva() == iva_vendite)
{
query << "SELECT COUNT(PW_KEYBODYFATT) AS CONTA FROM PAFW300F WHERE PW_KEYPRGINVIO = '" << keys.get(0)
<< "' AND PW_KEYHEADERFATT = '" << keys.get(1) << "' AND PW_KEYBODYFATT = '" << keys.get(2) << "'";
}
else if (get_tipoiva() == iva_acquisti)
{
query << "SELECT COUNT(PZ_KEYBODYFATT) AS CONTA FROM FPPRO00F WHERE PZ_KEYPRGINVIO = '" << keys.get(0)
<< "' AND PZ_KEYHEADERFATT = '" << keys.get(1) << "' AND PZ_KEYBODYFATT = '" << keys.get(2) << "'";
}
fp_db().sq_set_exec(query);
TString query_res = fp_db().sq_get("CONTA");
if (query_res == "1")
res = true;
else
res = false;
return res;
}
result_estr TEstrazione::estrai()
{
// Se non c'e' nessun movimento non sto nemmeno a scrivere il record di estrazione.