Patch level : 12.0 976

Files correlati     : tp0.exe
Commento            :

- Migliorata la funzione di correzzione delle righe documento anche per chi ha il CONAI. E' sufficiente che ci siano anche le sottocategorie vecchie nella tabella.
This commit is contained in:
Alessandro Bonazzi 2020-07-10 11:35:25 +02:00
parent 76dfb8b482
commit 13ee345b49

View File

@ -2453,6 +2453,7 @@ void TConversione_archivi::update_righe_doc()
TCursor frr(new TRelation("%FRR"));
const int fritems = frr.items();
TString_array formule;
TAssoc_array tipidoc;
for (frr = 0L; frr.pos() < fritems; ++frr)
formule.add(frr.curr().get("CODTAB"));
@ -2461,7 +2462,15 @@ void TConversione_archivi::update_righe_doc()
const TString4 tipo = r.get(RDOC_TIPORIGA);
const TTipo_riga_documento & tiporiga = TRiga_documento::tipo(tipo);
bool changed = false;
TToken_string key(r.get(RDOC_PROVV));
key.add(r.get_int(RDOC_ANNO));
key.add(r.get(RDOC_CODNUM));
key.add(r.get_int(RDOC_NDOC));
const TString tipodoc = cache().get(LF_DOC, key, DOC_TIPODOC);
const bool has_conai = cache().get("%TIP", tipodoc, "B6") == "X";
if (tiporiga.is_merce() || tiporiga.is_omaggio())
{
for (int j = 0; j < CONAI_CLASSES; j++)
@ -2472,9 +2481,11 @@ void TConversione_archivi::update_righe_doc()
r.zero(old_conai_peso[j]);
changed = true;
}
const TString & sottocat = r.get(conai_sottocat_name(j + 1));
if (sottocat.full() && cache().get("&VESCC", sottocat).empty())
const TString & sottocat = r.get(conai_sottocat_name(j + 1));
const TRectype & rec_sottocat = cache().get("&VESCC", sottocat);
if (!has_conai && sottocat.full() && rec_sottocat.empty())
r.zero(conai_sottocat_name(j + 1));
if (r.get(conai_sottocat_name(j + 1)).blank() &&
r.get(conai_peso_name(j + 1)).full())