diff --git a/sv/sv1200.cpp b/sv/sv1200.cpp index 37653f894..98d2a263a 100755 --- a/sv/sv1200.cpp +++ b/sv/sv1200.cpp @@ -408,6 +408,8 @@ private: void put_column(TRectype & statrec,int col, const TSVriep_record& curr); + const real fc_um(const TRectype& statrec,const TSVriep_record& rieprec); + void invalid_columns(TRectype & statrec); void standardize_um(TSVriep_record& rieprec, bool force=FALSE); // generazione del file di output @@ -1717,12 +1719,12 @@ void TStampa_stat::standardize_um(TSVriep_record& rieprec, bool force) if (tipoart==RIGA_MERCE || tipoart==RIGA_OMAGGI) { // è un articolo (erce); converto alla UM principale dell'art. - _umart->setkey(1); - _umart->put(UMART_CODART,rieprec.get(SVR_CODART)); - _umart->put(UMART_NRIGA,1); - _umart->read(); - um = _umart->get(UMART_UM); - fc = _umart->get_real(UMART_FC); + TString key(rieprec.get(SVR_CODART)); + key << "|1"; + const TRectype& rec_umart = cache().get(LF_UMART, key); + + um = rec_umart.get(UMART_UM); + fc = rec_umart.get_real(UMART_FC); } else { @@ -1757,19 +1759,20 @@ const real TStampa_stat::fc_um(const TRectype& statrec,const TSVriep_record& rie { // è un articolo (erce) TString80 art = rieprec.get(SVR_CODART); art.trim(); - - _umart->setkey(2); - _umart->put(UMART_CODART, art); - _umart->put(UMART_UM, um); - if (_umart->read() == NOERR) + + TLocalisamfile umart(LF_UMART); + umart.setkey(2); + umart.put(UMART_CODART, art); + umart.put(UMART_UM, um); + if (umart.read() == NOERR) { - fc = _umart->get_real(UMART_FC); - _umart->put(UMART_UM, statum); - if (_umart->read() == NOERR) + fc = umart.get_real(UMART_FC); + umart.put(UMART_UM, statum); + if (umart.read() == NOERR) { // è una UM dell'articolo: uso i fc per convertirla - um = _umart->get(UMART_UM); - fc /= _umart->get_real(UMART_FC); + um = umart.get(UMART_UM); + fc /= umart.get_real(UMART_FC); } } else