Patch level : 10.0 patch 71?
Files correlati : lv2 Ricompilazione Demo : [ ] Commento : Modificata la gestione dei pacchi annullati git-svn-id: svn://10.65.10.50/trunk@20380 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
19eab22e18
commit
e5e8e29901
@ -438,42 +438,51 @@ bool TConta_pulito_msk::elabora_file(const TFilename& file, TLog_report& logrep)
|
||||
long codcf = atol(riga.mid(86, 6));
|
||||
const bool ann = riga.mid(100, 1)[0] == 'S' ? true : false;
|
||||
|
||||
TRiga_pacco* rp = new TRiga_pacco();
|
||||
rp->set_key(codpacco);
|
||||
rp->set_articolo(codart);
|
||||
rp->set_quantita(qta);
|
||||
rp->set_data(data);
|
||||
|
||||
if (codcf > 0L)
|
||||
if(ann)
|
||||
{
|
||||
rp->set_cliente(codcf); //eventualmente vuoto
|
||||
TDate databo(atoi(riga.mid(92, 2)), atoi(riga.mid(94, 2)), atoi(riga.mid(96, 4)));
|
||||
rp->set_databo(databo); //eventualmente vuoto
|
||||
}
|
||||
|
||||
rp->set_annullato(ann);
|
||||
|
||||
//recupero l'unità di misura principale di quest'articolo
|
||||
TToken_string key;
|
||||
key.add(codart);
|
||||
key.add(1);
|
||||
const TRectype& umart = cache().get(LF_UMART, key);
|
||||
if (umart.empty())
|
||||
{
|
||||
TString str;
|
||||
str << "ATTENZIONE: non è stata trovata nessuna unità di misura valida per l'articolo " << codart;
|
||||
if (_auto == "A")
|
||||
logrep.log(2, str);
|
||||
else
|
||||
warning_box(str);
|
||||
TRiga_pacco rp(codpacco);
|
||||
rp.set_data(data);
|
||||
rp.set_annullato(ann);
|
||||
rp.rewrite(f);
|
||||
}
|
||||
else
|
||||
{
|
||||
TString4 um = umart.get(UMART_UM);
|
||||
rp->set_um(um);
|
||||
}
|
||||
TRiga_pacco rp;
|
||||
rp.set_key(codpacco);
|
||||
rp.set_articolo(codart);
|
||||
rp.set_quantita(qta);
|
||||
rp.set_data(data);
|
||||
|
||||
if (codcf > 0L)
|
||||
{
|
||||
rp.set_cliente(codcf); //eventualmente vuoto
|
||||
TDate databo(atoi(riga.mid(92, 2)), atoi(riga.mid(94, 2)), atoi(riga.mid(96, 4)));
|
||||
rp.set_databo(databo); //eventualmente vuoto
|
||||
}
|
||||
|
||||
rp.set_annullato(ann);
|
||||
|
||||
rp->write(f);
|
||||
//recupero l'unità di misura principale di quest'articolo
|
||||
TToken_string key;
|
||||
key.add(codart);
|
||||
key.add(1);
|
||||
const TRectype& umart = cache().get(LF_UMART, key);
|
||||
if (umart.empty())
|
||||
{
|
||||
TString str;
|
||||
str << "ATTENZIONE: non è stata trovata nessuna unità di misura valida per l'articolo " << codart;
|
||||
if (_auto == "A")
|
||||
logrep.log(2, str);
|
||||
else
|
||||
warning_box(str);
|
||||
}
|
||||
else
|
||||
{
|
||||
TString4 um = umart.get(UMART_UM);
|
||||
rp.set_um(um);
|
||||
}
|
||||
rp.write(f);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -551,6 +560,7 @@ bool TConta_pulito_msk::genera_documenti(const TFilename& file, TAssoc_array& do
|
||||
if(rp.is_annullato())
|
||||
{
|
||||
rp.remove(pacchi);
|
||||
rp.rewrite(pacchi);
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -760,7 +770,7 @@ void TConta_pulito_msk::prepara_movimenti(const TFilename& file, TAssoc_array& m
|
||||
//seleziona tutti i record del file pacchi da data a data che non hanno una bolla associata
|
||||
TString query;
|
||||
query << "USE PACCHI KEY 2\n";
|
||||
query << "SELECT (NDOC=0)&&(CODCF=0)&&(MGNUMREG=0)\n";
|
||||
query << "SELECT (NDOC=0)&&(CODCF=0)\n";
|
||||
query << "FROM DATA=#DADATA\n";
|
||||
query << "TO DATA=#ADATA";
|
||||
|
||||
@ -805,19 +815,22 @@ void TConta_pulito_msk::prepara_movimenti(const TFilename& file, TAssoc_array& m
|
||||
articoli = new TAssoc_array();
|
||||
movimenti.add(ansidate, articoli);
|
||||
}
|
||||
if(articoli->is_key(codart))
|
||||
if(articoli->is_key(keyarticoli))
|
||||
{
|
||||
real& qta = *(real*)articoli->objptr(codart);
|
||||
real& qta = *(real*)articoli->objptr(keyarticoli);
|
||||
qta += quantita;
|
||||
}
|
||||
else
|
||||
articoli->add(codart, quantita);
|
||||
articoli->add(keyarticoli, quantita);
|
||||
|
||||
//se il pacco risulta annullato, lo elimino
|
||||
if(annullato)
|
||||
{
|
||||
rp.remove(pacchi);
|
||||
rp.rewrite(pacchi);
|
||||
}
|
||||
}
|
||||
pacchi.rewrite();
|
||||
|
||||
}
|
||||
|
||||
//GENERA_MOVMAG: metodo che genera i movimenti di magazzino dai pacchi
|
||||
|
13
lv/lvlib.cpp
13
lv/lvlib.cpp
@ -1358,7 +1358,9 @@ const TDate TRiga_pacco::databo() const
|
||||
//ANNULLATO: metodo che ritorna true se il pacco è stato annullato
|
||||
const bool TRiga_pacco::annullato() const
|
||||
{
|
||||
return get_bool(PACCHI_ANNULLATO);
|
||||
if(get(PACCHI_ANNULLATO)[0] == 'S')
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
//RIGABOLLA: metodo che restituisce una TToken_string contenete alla riga del documento che ha consegnato il pacco
|
||||
@ -1426,7 +1428,8 @@ void TRiga_pacco::set_databo(const TDate& data)
|
||||
//SET_ANNULLATO: metodo che setta il flag di annullato
|
||||
void TRiga_pacco::set_annullato(const bool ann)
|
||||
{
|
||||
put(PACCHI_ANNULLATO, ann);
|
||||
const char annullato = ann ? 'S' : 'N';
|
||||
put(PACCHI_ANNULLATO, annullato);
|
||||
}
|
||||
|
||||
//SET_RIGABOLLA: metodo che setta i riferimenti alla riga di bolla che evade il pacco sul record corrente
|
||||
@ -1447,8 +1450,10 @@ void TRiga_pacco::set_movmag(const long movmag)
|
||||
|
||||
//IS_ANNULATO: metodo che restituisce "true" se il campo annullato sul record attuale è 'S'
|
||||
bool TRiga_pacco::is_annullato()
|
||||
{
|
||||
return get_bool(PACCHI_ANNULLATO);
|
||||
{
|
||||
if(get(PACCHI_ANNULLATO)[0] == 'S')
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
//IS_ASSOCIATO: metodo che restitusce "true" se il campo cliente è valorizzato
|
||||
|
Loading…
x
Reference in New Issue
Block a user