From 0b70cb015086998d5bdf83689c9f4243480db702 Mon Sep 17 00:00:00 2001 From: luca83 Date: Thu, 18 Feb 2010 07:51:39 +0000 Subject: [PATCH] Patch level : 10.0 patch 64? Files correlati : lv2 lv3 Ricompilazione Demo : [ ] Commento : 1) Quella di ritiro dotazione temporanea pero con la causale lavanderia 107 (la corrispettiva del 007 da generazione automatica). Avrebbe dovuto prendere la 88 dai dati societari MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2) La quantità del reso è un di cui quindi mi aspetto: ritirato 35 causale 88 ritirato 44 consegnato 10 causale 107 3) Ho fatto poi un buono di prelievo sempre per quel cliente e n0235 come articolo. 100 di dotazione temporanea causale 66 data consegna 23-2 il planning di marzo non c’è -> non mi propone la data di fine dotazione temporanea ma solo quella di inizio (certo non c’è il planning) scrivo il il 10/3/2010 -> sul buono di prelievo si salva / sul contratto no creo il buono di consegna -> non c’è la data di fine dot.temp. ne sul buono di consegna ne sul contratto git-svn-id: svn://10.65.10.50/trunk@20139 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- lv/lv2400.cpp | 11 +++-------- lv/lv2600.cpp | 6 +----- lv/lv3100.cpp | 39 +++++++++++++++++++++++++++++++++++++++ lv/lv3300.cpp | 39 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 82 insertions(+), 13 deletions(-) diff --git a/lv/lv2400.cpp b/lv/lv2400.cpp index 9dbbae239..afd091358 100755 --- a/lv/lv2400.cpp +++ b/lv/lv2400.cpp @@ -423,7 +423,7 @@ void TGenera_documenti_app::crea_riga(TToken_string& chiave, const char modpas, rdoc.put(RDOC_CODIVA, anamag.get(ANAMAG_CODIVA)); //codiva - const TCausale_lavanderie caudt(causale); + const TCausale_lavanderie caudt(ini_get_string(CONFIG_DITTA, "lv", "CAULVRITDT")); //se ho ritirato un quantitativo di roba maggiore o uguale alla dotazione temporanea //allora creo la nuova riga documento e azzero la dottmp; altrimenti preparo la riga @@ -541,14 +541,9 @@ void TGenera_documenti_app::crea_riga(TToken_string& chiave, const char modpas, } } + //essendo la dot tmp un di cui la quantità ritirata è sempre quella if(cau.is_ritiro()) - { - //se no scrivo le quantità sbalgiate - if (tmp && rcont.get_bool(LVRCONDV_RITAUDTTMP)) - rdoc.put(RDOC_QTAGG1, qta); //quantità ritirata - else - rdoc.put(RDOC_QTAGG1, qta1); //quantità ritirata - } + rdoc.put(RDOC_QTAGG1, qta1); //quantità ritirata //elaborazione sul prezzo da utilizzare real prezzo; diff --git a/lv/lv2600.cpp b/lv/lv2600.cpp index 63f313e0f..1c3a5c1b0 100755 --- a/lv/lv2600.cpp +++ b/lv/lv2600.cpp @@ -868,11 +868,7 @@ void TAcquisizione_lavanderie_app::genera_documenti(TLog_report& rep, TAssoc_arr const TDate dtcons = doc.get_date("DATAPRCO"); - TString4 causale; - if(rcont.get_date(LVRCONDV_INDTTMP).ok() && dtcons >= rcont.get_date(LVRCONDV_FIDTTMP)) - causale = ini_get_string(CONFIG_DITTA, "lv", "CAULVRITDT"); - else - causale = rcont.get(LVRCONDV_CAUSLAV).full() ? rcont.get(LVRCONDV_CAUSLAV) : ini_get_string(CONFIG_DITTA, "lv", "CAUSLAV"); + const TString4 causale = rcont.get(LVRCONDV_CAUSLAV).full() ? rcont.get(LVRCONDV_CAUSLAV) : ini_get_string(CONFIG_DITTA, "lv", "CAUSLAV"); if (doc.rows() > 0 && (idriga > 0 && idriga <= doc.rows())) { diff --git a/lv/lv3100.cpp b/lv/lv3100.cpp index 1faa7465f..fbd361a19 100755 --- a/lv/lv3100.cpp +++ b/lv/lv3100.cpp @@ -79,6 +79,7 @@ protected: void elimina_vuote( const TMask& m); void salva_conguaglio( const TMask& m); + void date_dotmp( const TMask& m); virtual const char * query_mask_name() { return "lv3100a"; } @@ -1223,6 +1224,42 @@ void TGestione_bolle_app::salva_conguaglio( const TMask& m) } } +void TGestione_bolle_app::date_dotmp( const TMask& m) +{ + TDocumento_mask& mask = (TDocumento_mask&) m; + TDocumento& d = mask.doc(); + + TSheet_field& sheet = mask.sfield(F_SHEET); + const long codcf = mask.get_long(F_CODCF); + const int indsped = mask.get_int(F_CODINDSP); + TDate datadoc = mask.get_date(F_DATADOC); + + const TLaundry_contract cont(codcf, indsped, datadoc); + const int codcont = cont.get_int(LVCONDV_CODCONT); + + TLocalisamfile rcondv(LF_LVRCONDV); + + FOR_EACH_DOC_ROW_BACK(d, r, row) + { + TRiga_documento& rdoc = (TRiga_documento&)*row; + if(rdoc.get_date("DADATATMP").ok()) + { + rcondv.put(LVRCONDV_CODCF,codcf); + rcondv.put(LVRCONDV_CODCONT, codcont); + rcondv.put(LVRCONDV_CODART, rdoc.get(RDOC_CODART)); + if (rcondv.read() == NOERR) + { + if(rcondv.get_date(LVRCONDV_INDTTMP).empty()) + rcondv.put(LVRCONDV_INDTTMP, rdoc.get_date("DADATATMP")); + + if(rcondv.get_date(LVRCONDV_FIDTTMP).empty()) + rcondv.put(LVRCONDV_FIDTTMP, rdoc.get_date("ADATATMP")); + } + } + } + rcondv.rewrite(); +} + //ridefinisco il metodo write delle TMotore_application int TGestione_bolle_app::write( const TMask& m ) { @@ -1240,6 +1277,8 @@ int TGestione_bolle_app::rewrite( const TMask& m ) salva_conguaglio(m); + date_dotmp(m); + return TMotore_application::rewrite(m); } diff --git a/lv/lv3300.cpp b/lv/lv3300.cpp index 5d2d82690..2d4eb83b2 100755 --- a/lv/lv3300.cpp +++ b/lv/lv3300.cpp @@ -78,6 +78,7 @@ protected: void elimina_vuote( const TMask& m); void salva_conguaglio( const TMask& m); + void date_dotmp( const TMask& m); virtual const char * query_mask_name() { return "lv3300a"; } @@ -1209,6 +1210,42 @@ void TGestione_buoni_app::salva_conguaglio( const TMask& m) } } +void TGestione_buoni_app::date_dotmp( const TMask& m) +{ + TDocumento_mask& mask = (TDocumento_mask&) m; + TDocumento& d = mask.doc(); + + TSheet_field& sheet = mask.sfield(F_SHEET); + const long codcf = mask.get_long(F_CODCF); + const int indsped = mask.get_int(F_CODINDSP); + TDate datadoc = mask.get_date(F_DATADOC); + + const TLaundry_contract cont(codcf, indsped, datadoc); + const int codcont = cont.get_int(LVCONDV_CODCONT); + + TLocalisamfile rcondv(LF_LVRCONDV); + + FOR_EACH_DOC_ROW_BACK(d, r, row) + { + TRiga_documento& rdoc = (TRiga_documento&)*row; + if(rdoc.get_date("DADATATMP").ok()) + { + rcondv.put(LVRCONDV_CODCF,codcf); + rcondv.put(LVRCONDV_CODCONT, codcont); + rcondv.put(LVRCONDV_CODART, rdoc.get(RDOC_CODART)); + if (rcondv.read() == NOERR) + { + if(rcondv.get_date(LVRCONDV_INDTTMP).empty()) + rcondv.put(LVRCONDV_INDTTMP, rdoc.get_date("DADATATMP")); + + if(rcondv.get_date(LVRCONDV_FIDTTMP).empty()) + rcondv.put(LVRCONDV_FIDTTMP, rdoc.get_date("ADATATMP")); + } + } + } + rcondv.rewrite(); +} + //ridefinisco il metodo write delle TMotore_application int TGestione_buoni_app::write( const TMask& m ) { @@ -1216,6 +1253,8 @@ int TGestione_buoni_app::write( const TMask& m ) salva_conguaglio(m); + date_dotmp(m); + return TMotore_application::write(m); }