Patch level : 12.0
Files correlati : f9lib.h, f9lib01.cpp f90100.cpp Commento: - Corretti degli errori di logica nel giro dell'archiviazione sostitutiva. Venivano fatti devi check sbagliati nelle condizioni di un paio di IF e non tutti i movimenti da escludere venivano esclusi - Migliorata la finestra con i risultati dell'estrazione per i doc di vendita
This commit is contained in:
parent
cda516f827
commit
2974e963d4
@ -75,28 +75,22 @@ int TEstrai_mask::estrai()
|
|||||||
for (bool ok = mov.move_first(); progr->add_status() && ok; ok = mov.move_next())
|
for (bool ok = mov.move_first(); progr->add_status() && ok; ok = mov.move_next())
|
||||||
{
|
{
|
||||||
TToken_string elab_f9(mov.get_string(MOV_ELABF9), ';'); // Stringa del campo elaborazione f9 nel file mov
|
TToken_string elab_f9(mov.get_string(MOV_ELABF9), ';'); // Stringa del campo elaborazione f9 nel file mov
|
||||||
const bool escluso = (elab_f9.items() == 3 && elab_f9.get_bool(2));
|
bool escluso = (elab_f9.items() == 3 && elab_f9.get_bool(2));
|
||||||
const TCausale & caus = cached_causale(mov.get_string(MOV_CODCAUS), mov.get_date(MOV_DATAREG).year());
|
const TCausale & caus = cached_causale(mov.get_string(MOV_CODCAUS), mov.get_date(MOV_DATAREG).year());
|
||||||
const bool stampato = mov.get_bool(MOV_REGST);
|
const bool stampato = mov.get_bool(MOV_REGST);
|
||||||
const TRegistro& reg = caus.reg();
|
const TRegistro& reg = caus.reg();
|
||||||
const TipoIVA& iva = reg.iva();
|
const TipoIVA& iva = reg.iva();
|
||||||
TString numdoc = mov.get_string(MOV_NUMDOCEXT);
|
TString numdoc = mov.get_string(MOV_NUMDOCEXT);
|
||||||
|
|
||||||
long nreg = mov.get_long(MOV_NUMREG);
|
long nreg = mov.get_long(MOV_NUMREG);
|
||||||
|
|
||||||
if (nreg == 207)
|
if (caus.escludi2archiviazione())
|
||||||
int here = 0;
|
escluso = true;
|
||||||
|
|
||||||
if (escluso)
|
|
||||||
int here = 0;
|
|
||||||
|
|
||||||
if (numdoc.blank())
|
if (numdoc.blank())
|
||||||
numdoc = mov.get_string(MOV_NUMDOC);
|
numdoc = mov.get_string(MOV_NUMDOC);
|
||||||
// Se definitivo controllo il flag di stampato REGST
|
// Se definitivo controllo il flag di stampato REGST
|
||||||
if ((flagpro || stampato) && numdoc.full() && iva == tipo)
|
if ((flagpro || stampato) && numdoc.full() && iva == tipo)
|
||||||
{
|
{
|
||||||
if (numdoc.blank())
|
|
||||||
int here = 0;
|
|
||||||
// Creo il movimento da inserire e lo inserisco
|
// Creo il movimento da inserire e lo inserisco
|
||||||
_estrazione->add_mov(new TMovimento_estr(mov, tipo, escluso));
|
_estrazione->add_mov(new TMovimento_estr(mov, tipo, escluso));
|
||||||
++count;
|
++count;
|
||||||
@ -125,9 +119,9 @@ int TEstrai_mask::estrai()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
msg << "Movimenti saltati poiche' cartacei: " << (int)_stats.fv_cart_skip << "\n";
|
msg << "Movimenti estratt : " << (int)_stats.fv_estr << "\n";
|
||||||
msg << "Movimenti in errore: " << (int)_stats.fv_err << "\n";
|
msg << "Cartacei saltati : " << (int)_stats.fv_cart_skip << "\n";
|
||||||
msg << "Movimenti estratti: " << (int)_stats.fv_estr << "\n";
|
msg << "Movimenti in errore : " << (int)_stats.fv_err;
|
||||||
//msg << "Movimenti senza cat. doc.: " << (int)_stats.fv_nocatdoc;
|
//msg << "Movimenti senza cat. doc.: " << (int)_stats.fv_nocatdoc;
|
||||||
}
|
}
|
||||||
message_box(msg);
|
message_box(msg);
|
||||||
|
@ -307,7 +307,8 @@ enum err_mov
|
|||||||
mov_pura_iva, // Movimento di sola IVA (integrazione Rev. Charge)
|
mov_pura_iva, // Movimento di sola IVA (integrazione Rev. Charge)
|
||||||
mov_no_filecart, // Il documento cartaceo non ha associato un file, o questo non e' stato trovato.
|
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_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_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
|
||||||
};
|
};
|
||||||
|
|
||||||
class TMovimento_estr : public TObject // aggiungere metodi per TArray
|
class TMovimento_estr : public TObject // aggiungere metodi per TArray
|
||||||
|
@ -63,6 +63,8 @@ const char* TMovimento_estr::err_mov2name(const err_mov descr_estr)
|
|||||||
return "Un annesso obbligatorio e' mancante.";
|
return "Un annesso obbligatorio e' mancante.";
|
||||||
case mov_nocat_butok:
|
case mov_nocat_butok:
|
||||||
return "OK (Nessuna categoria documentale trovata ma l'abbinamento è riuscito)";
|
return "OK (Nessuna categoria documentale trovata ma l'abbinamento è riuscito)";
|
||||||
|
case mov_no_sdi:
|
||||||
|
return "Tipo documento SDI non identificato";
|
||||||
default: return "";
|
default: return "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -884,11 +886,6 @@ const char* TEstrazione::diagnostica_mov()
|
|||||||
{
|
{
|
||||||
|
|
||||||
const long numreg = mov_i.numreg();
|
const long numreg = mov_i.numreg();
|
||||||
|
|
||||||
if (numreg == 210) {
|
|
||||||
int here = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
const TRectype & mov =cache().get(LF_MOV, numreg);
|
const TRectype & mov =cache().get(LF_MOV, numreg);
|
||||||
|
|
||||||
mov_i.set_cartaceo(!is_doc_xml(mov));
|
mov_i.set_cartaceo(!is_doc_xml(mov));
|
||||||
@ -983,12 +980,12 @@ const char* TEstrazione::diagnostica_mov()
|
|||||||
}
|
}
|
||||||
else if (tipo == iva_vendite)
|
else if (tipo == iva_vendite)
|
||||||
{
|
{
|
||||||
// Controlli per le fatture di vendita
|
// Controlli per le fatture di vendita (AGGIORNARE STATS QUI)
|
||||||
TProgress_monitor bar(_movs.items(), "Controllo stato movimenti di vendita");
|
TProgress_monitor bar(_movs.items(), "Controllo stato movimenti di vendita");
|
||||||
|
|
||||||
FOR_EACH_ARRAY_ITEM(_movs, r, obj)
|
FOR_EACH_ARRAY_ITEM(_movs, r, obj)
|
||||||
{
|
{
|
||||||
if (!bar.add_status())
|
if (bar.add_status())
|
||||||
{
|
{
|
||||||
TMovimento_estr & mov_i = (TMovimento_estr &) *obj;
|
TMovimento_estr & mov_i = (TMovimento_estr &) *obj;
|
||||||
|
|
||||||
@ -1003,14 +1000,16 @@ const char* TEstrazione::diagnostica_mov()
|
|||||||
*/
|
*/
|
||||||
if (!mov_i.err() && mov_i.estratto())
|
if (!mov_i.err() && mov_i.estratto())
|
||||||
{
|
{
|
||||||
// mov_i.set_cartaceo(!is_doc_xml(mov)); ci deve essere ?
|
mov_i.set_cartaceo(!is_doc_xml(mov)); // ci deve essere ?
|
||||||
|
|
||||||
unsigned short skip = 0;
|
unsigned short skip = 0;
|
||||||
|
|
||||||
if (!_has_cartacei && mov_i.cartaceo()) skip |= 0x1;
|
if (_has_cartacei && mov_i.cartaceo())
|
||||||
else
|
skip |= 0x1;
|
||||||
if (pura_iva(mov)) skip |= 0x2;
|
else if (pura_iva(mov))
|
||||||
else if (mov_i.datadoc().empty() || mov_i.numdoc().empty()) skip |= 0x4;
|
skip |= 0x2;
|
||||||
|
else if (mov_i.datadoc().empty() || mov_i.numdoc().empty())
|
||||||
|
skip |= 0x4;
|
||||||
|
|
||||||
if(skip)
|
if(skip)
|
||||||
{
|
{
|
||||||
@ -1025,15 +1024,6 @@ const char* TEstrazione::diagnostica_mov()
|
|||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*else if(!mov_i.cartaceo && _has_checkvend && !check_documento_vendita(mov, exist_doc))
|
|
||||||
{
|
|
||||||
mov_i.err = true;
|
|
||||||
mov_i.estratto = false;
|
|
||||||
mov_i.descr_err = !exist_doc ?
|
|
||||||
"Il movimento non ha un documento generatore. (Escludere? o Rimuovere flag controllo vendite)"
|
|
||||||
: "Non e' stato trovato il documento elettronico nel database delle F.E. (Escludere? o Rimuovere flag controllo vendite)";
|
|
||||||
mov_i.descr_estr = !exist_doc ? TMovimento_estr::no_doc : TMovimento_estr::notfound_elet;
|
|
||||||
}*/
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
TClasse_doc* cd = categorie_doc().mov2cat(mov_i.numreg());
|
TClasse_doc* cd = categorie_doc().mov2cat(mov_i.numreg());
|
||||||
@ -1191,7 +1181,8 @@ bool TEstrazione::estrazione_iva(bool escluso)
|
|||||||
|
|
||||||
const TRectype& cli = cache().get(LF_CLIFO, key);
|
const TRectype& cli = cache().get(LF_CLIFO, key);
|
||||||
const char tipodoc = _head.tipo_doc;
|
const char tipodoc = _head.tipo_doc;
|
||||||
const TString& name_registro = TRegistro(TCausale(mov.get(MOV_CODCAUS), mov.get_date(MOV_DATAREG).year()).reg()).name();
|
const TCausale & caus = cached_causale(mov.get(MOV_CODCAUS), mov.get_date(MOV_DATAREG).year());
|
||||||
|
const TString& name_registro = caus.reg().name();;
|
||||||
fill_id(cli, statopaiv, idfisc, paiv, codfis);
|
fill_id(cli, statopaiv, idfisc, paiv, codfis);
|
||||||
TDate datadoc = mov.get_date(MOV_DATADOC);
|
TDate datadoc = mov.get_date(MOV_DATADOC);
|
||||||
TDate datareg = mov.get_date(MOV_DATAREG);
|
TDate datareg = mov.get_date(MOV_DATAREG);
|
||||||
@ -1219,7 +1210,9 @@ bool TEstrazione::estrazione_iva(bool escluso)
|
|||||||
|
|
||||||
if (reg.iva() == iva_vendite)
|
if (reg.iva() == iva_vendite)
|
||||||
{
|
{
|
||||||
|
|
||||||
int anno = mov.get_int(MOV_DANNO);
|
int anno = mov.get_int(MOV_DANNO);
|
||||||
|
TString tipodocsdi;
|
||||||
|
|
||||||
if (anno > 0)
|
if (anno > 0)
|
||||||
{
|
{
|
||||||
@ -1231,9 +1224,13 @@ bool TEstrazione::estrazione_iva(bool escluso)
|
|||||||
iva_query.add(IVA_CAUSSOS, tipo_doc_sdi(doc), 6);
|
iva_query.add(IVA_CAUSSOS, tipo_doc_sdi(doc), 6);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
iva_query.add(IVA_CAUSSOS, mov_i.catdoc(categorie_doc())->caus_sost(), 6);
|
tipodocsdi = caus.tipodocsdi();
|
||||||
|
if (tipodocsdi.blank())
|
||||||
|
tipodocsdi = mov_i.catdoc(categorie_doc())->caus_sost();
|
||||||
|
|
||||||
|
if (tipodocsdi.full())
|
||||||
|
iva_query.add(IVA_CAUSSOS, tipodocsdi, 6);
|
||||||
}
|
}
|
||||||
//
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
TToken_string key(mov.get((MOV_KEYFPPRO)), ';');
|
TToken_string key(mov.get((MOV_KEYFPPRO)), ';');
|
||||||
@ -1335,6 +1332,9 @@ bool TEstrazione::estrazione_iva(bool escluso)
|
|||||||
}
|
}
|
||||||
TString sql;
|
TString sql;
|
||||||
|
|
||||||
|
//DA MIGLIORARE IL LOG DI ERRORE
|
||||||
|
long a = mov_i.numreg();
|
||||||
|
|
||||||
bool ok = iva_query.get(sql);
|
bool ok = iva_query.get(sql);
|
||||||
|
|
||||||
if (ok)
|
if (ok)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user