Patch level : 12.00 1286
Files correlati : ve0.exe ve.exe ca3.exe sc0.exe Commento : Velocizzata la stampa mastrini di analitica Il rendiconto raddoppiava il pagato Lo stesso nel saldaconto extracontabile Aggiunto controllo numeri di documento doppi aalla contabilizzazione
This commit is contained in:
parent
e24f695144
commit
f1cb182561
@ -5113,7 +5113,48 @@ bool TContabilizzazione::elabora(TLista_documenti& doc_in, TLista_documenti& doc
|
||||
write_all(doc, *_movimento); // Se la scrittura è andata ok...
|
||||
}
|
||||
}
|
||||
// Controllo documenti duplicati
|
||||
|
||||
const int annodoc = _movimento->lfile().get_date(MOV_DATADOC).year();
|
||||
const TString4 tipo = _movimento->lfile().get(MOV_TIPO);
|
||||
const TString8 cod_reg = _movimento->lfile().get(MOV_REG);
|
||||
const long fornitore = _movimento->lfile().get_long(MOV_CODCF);
|
||||
const TString numdoc = _movimento->lfile().get(MOV_NUMDOC);
|
||||
|
||||
if (annodoc > 0 && fornitore > 0)
|
||||
{
|
||||
TString filter;
|
||||
TRelation rel(LF_MOV);
|
||||
TRectype& rec = rel.curr();
|
||||
TRectype recfrom(rec);
|
||||
|
||||
filter << '(' << MOV_NUMDOC << "=\"" << numdoc << "\")&&(" << MOV_REG << "!=\"\")";
|
||||
filter << "&&(" << MOV_NUMREG << "!=\"" << _movimento->lfile().get_long(MOV_NUMREG) << "\")";
|
||||
recfrom.put(MOV_TIPO, tipo);
|
||||
recfrom.put(MOV_CODCF, fornitore);
|
||||
recfrom.put(MOV_DATAREG, TDate(1, 1, annodoc));
|
||||
|
||||
TRectype recto(recfrom);
|
||||
|
||||
recto.put(MOV_DATAREG, TDate(31, 12, annodoc + 1));
|
||||
|
||||
TCursor cur(&rel, filter, 3, &recfrom, &recto);
|
||||
const TRecnotype items = cur.items();
|
||||
|
||||
cur.freeze();
|
||||
for (cur = 0; cur.pos() < items; ++cur)
|
||||
{
|
||||
const int ad = rec.get_date(MOV_DATADOC).year();
|
||||
const TString8 cr = rec.get(MOV_REG);
|
||||
|
||||
if (ad == annodoc && cod_reg == cr)
|
||||
{
|
||||
msg.format(FR("Il documento %d / %s è già stato inserito con la registrazione %ld"),
|
||||
annodoc, (const char*)numdoc, rec.get_long(MOV_NUMREG));
|
||||
_viswin->add_line(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!good())
|
||||
{
|
||||
display_error(doc);
|
||||
|
Loading…
x
Reference in New Issue
Block a user