Patch level : 12.0

Files correlati     : f9
Commento:

piccole modifiche
This commit is contained in:
smen 2023-01-10 15:13:17 +01:00
parent 650c1dfcf6
commit 0c080702a8
2 changed files with 29 additions and 9 deletions

View File

@ -1198,7 +1198,18 @@ bool TEstrazione::estrazione_iva(bool escluso)
iva_query.add(IVA_ANNOES, mov.get_int(MOV_ANNOES));
iva_query.add(IVA_GIVA, tipodoc);
iva_query.add(IVA_TIPOG, name_registro, 10);
//qui c'è qualcosa che non va
long numdoc = mov.get_long(MOV_NUMDOC);
if (numdoc == 210084 || numdoc == 210085) {
int here = 0;
}
bool has_cartaceo = mov_i.cartaceo();
iva_query.add(IVA_DOCXML, mov_i.cartaceo() ? 'N' : 'S');
//---- ripartiamo da qui
iva_query.add(IVA_TIPOCF, mov.get_char(MOV_TIPO));
iva_query.add(IVA_CODCF, mov.get_long(MOV_CODCF));
iva_query.add(IVA_NUMOR, mov.get_long(MOV_NUMREG));

View File

@ -1168,7 +1168,7 @@ bool TDoc_fp::insert(TPaf_record& p, bool force)
if (!ok)
{
_log.log(2, fp_db().sq_get_token_text_error(1));
_log.log(2, p.insert_string());
_log.log(0, p.insert_string());
}
}
return ok;
@ -1186,7 +1186,7 @@ bool TDoc_fp::remove(TPaf_record& p)
if (!ok)
{
_log.log(2, fp_db().sq_get_token_text_error(1));
_log.log(2, p.remove_string());
_log.log(0, p.remove_string());
}
}
return ok;
@ -1205,7 +1205,7 @@ bool TDoc_fp::save_paf()
if (!ok)
{
_log.log(2, fp_db().sq_get_token_text_error(1));
_log.log(2, query);
_log.log(0, query);
}
}
return ok;
@ -1303,7 +1303,7 @@ bool TDoc_fp::initialize(TDocumentoEsteso& doc)
if (!chiave_paf_doc(doc, _hfatt, _bfatt))
return false;
// Preparo il log
_log.log(-1, _bfatt);
_log.log(0, _bfatt);
// Controllo se il documento almeno in stato di stampa
if (doc.stato() < doc.tipo().stato_finale_stampa())
{
@ -1395,24 +1395,27 @@ int TDoc_fp::commit()
int r = 0;
if (_to_commit)
{
if (r >= 0 && fp_db().sq_commit())
bool errors = _log.errors() > 0;
if (r >= 0 && fp_db().sq_commit() && !errors)
{
r += 2;
// Controllo stato diagnosticato
if (get_no_export_pronto())
{
_log.log(2, "Le fatture sono state esportate in stato diagnosticato");
_log.log(0, "Le fatture sono state esportate in stato diagnosticato");
}
else
{
_log.log(2, "Le fatture sono state esportate correttamente in stato pronto");
_log.log(0, "Le fatture sono state esportate correttamente in stato pronto");
}
}
else
{
r = -1;
_log.log(2, fp_db().sq_get_token_text_error(1));
TString err_msg = "La fattura non è stata esportata correttamente\n";
err_msg << fp_db().sq_get_token_text_error(1);
_log.log(2, err_msg);
}
}
_to_commit = false;
@ -1739,7 +1742,11 @@ bool TDoc_fp::export_paf0100f()
tel << get_firm().get(NDT_PTEL) << get_firm().get(NDT_TEL);
paf0100f.set("P1_TELEFONO", tel);
paf0100f.set("P1_MAIL", get_firm().get(NDT_MAIL));
paf0100f.set("P1_GESTIONE", stato_paf());
//paf0100f.set("P1_GESTIONE", stato_paf());
//SCASSO QUI PER FARE TEST
paf0100f.set("P1_GESTIONE", "WW");
paf0100f.set("P1_ERRINT", "");
// </DatiTrassmissione>
return insert(paf0100f);
@ -2998,6 +3005,8 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
pafw300f.set("PW_IMPO", value2string(doc.totale_doc())); // valore, false));
pafw300f.set("PW_UPAG", "");
ok &= insert(pafw300f);
bool a = save_paf();
return _to_commit = (ok && save_paf());
}