diff --git a/lv/lv2400.cpp b/lv/lv2400.cpp index f54eab75b..331a48809 100755 --- a/lv/lv2400.cpp +++ b/lv/lv2400.cpp @@ -231,12 +231,8 @@ void TGenera_documenti_app::crea_riga(const TString& codart, const char modpas, //calcolo della quantità che va sulla bolla //preparo la chiave per la tabella righe contratti - TToken_string keyrcont; - keyrcont.add(codcli); - keyrcont.add(codcont); - keyrcont.add(codart); - //instanzio una cache sulla tabella delle righe contratti - const TRectype& rcont = cache().get(LF_LVRCONDV,keyrcont); + TLaundry_contract cont(codcli, codcont); + const TRectype& rcont = cont.row(codart); //recupero i dati di interesse dalla riga del contratto bool arrot; @@ -433,7 +429,7 @@ void TGenera_documenti_app::crea_riga(const TString& codart, const char modpas, { if (!tmp) rdoc.put(RDOC_PREZZO, prezzo); - else //per adesso per questo ramo non ci passa mai, perchè non sappiamo come gestire le dotazioni temporanee + else rdoc.put(RDOC_PREZZO,rcont.get_real(LVRCONDV_PRZDTTMP)); rdoc.put(RDOC_SCONTO,rcont.get(LVRCONDV_SCONTPERC)); //sconto } @@ -458,6 +454,12 @@ void TGenera_documenti_app::crea_riga(const TString& codart, const char modpas, rep.log(1, str); } } + + if (dottmp == 0) + { + cont.update_row(codart, LVRCONDV_INDTTMP, NULLDATE); + cont.update_row(codart, LVRCONDV_FIDTTMP, NULLDATE); + } } //////////////////////////////////////////////////////////////