From 42f0551460fabcbb287880257fab1ad290bc7ab2 Mon Sep 17 00:00:00 2001 From: luca Date: Wed, 31 Mar 2010 11:09:30 +0000 Subject: [PATCH] =?UTF-8?q?Patch=20level=20=20=20=20=20=20=20=20=20:10.698?= =?UTF-8?q?=20Files=20correlati=20=20=20=20=20:=20Ricompilazione=20Demo=20?= =?UTF-8?q?:=20[=20]=20Commento=20=20=20=20=20=20=20=20=20=20=20=20:=20mod?= =?UTF-8?q?ifiche=20a=20stampa=20mastrini=20(filtro=20per=20date=20funzion?= =?UTF-8?q?ante=20meglio=20e=20ad=20alta=20velocit=C3=A0)=20e=20bilancio?= =?UTF-8?q?=20di=20commessa=20(reimmesso=20il=20calcolo=20detrazioni=20com?= =?UTF-8?q?e=20consuntivi=20opzionale)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://10.65.10.50/trunk@20300 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- ca/ca3200.cpp | 41 +++++++++++++++++++++++++++++++++++++++-- ca/ca3800.uml | 11 ++++++++--- ca/ca3800a.rep | 11 +++++++++++ ca/ca3800b.rep | 22 ++++++++++++++++------ ca/ca3800c.rep | 20 +++++++++++++++----- ca/ca3883.cpp | 20 +++++++++++++------- ca/ca3883.h | 1 + ca/ca3883a.h | 1 + 8 files changed, 104 insertions(+), 23 deletions(-) diff --git a/ca/ca3200.cpp b/ca/ca3200.cpp index f78ccdc43..0eff89751 100755 --- a/ca/ca3200.cpp +++ b/ca/ca3200.cpp @@ -225,6 +225,18 @@ bool TPrint_mastrini_ca_recordset::valid_record(const TRelation& rel) const if (_adata.ok() && datareg > _adata) return false; } + else + { + const TDate datacomp = mov.get_date(MOVANA_DATACOMP); + if (_dadata.ok() && datacomp < _dadata) + return false; + if (_adata.ok() && datacomp > _adata) + return false; + + const TDate datafcomp = mov.get_date(MOVANA_DATAFCOMP); + if (datafcomp.ok() && _dadata.ok() && datafcomp < _dadata) + return false; + } //..poi le righe (devono comparire solo le righe con cdc/cms/fsc che appaiono nello sheet) const TRectype& rmov = rel.curr(LF_RMOVANA); @@ -344,6 +356,7 @@ void TPrint_mastrini_ca_recordset::set_filter(const TPrint_mastrini_ca_mask& msk _aconto << msk.get(F_CDC1_FIN+i); } + _anno = msk.get_int(F_ANNO); _dadata = msk.get_date(F_DATAINI); _adata = msk.get_date(F_DATAFIN); @@ -622,17 +635,39 @@ void TPrint_mastrini_ca::print_or_preview(const bool stampa) if (sheet.empty()) //se non ci sono righe sullo sheet (selezione su tutte le cms/cdc)... { TToken_string& row = sheet.row(-1); //crea la prima riga dello sheet - + //stabilisce quale è il primo livello (tra CDC e CMS).. const TMultilevel_code_info& liv1 = *ca_multilevel_code_info_by_index(0); const int logic1 = liv1.logic(); + + TAssoc_array codici_buoni; + TString query; + query << "USE RMOVANA KEY 2\n"; + query << "FROM CODCONTO=#DACONTO\n"; + query << "TO CODCONTO=#ACONTO"; + TISAM_recordset rmovana(query); + TString80 daconto, aconto; + for (int i = 0; _mask->id2pos(F_CDC1_INI+i) > 0; i++) + { + daconto << _mask->get(F_CDC1_INI+i); + aconto << _mask->get(F_CDC1_FIN+i); + } + rmovana.set_var("#DACONTO", daconto); + rmovana.set_var("#ACONTO", aconto); + + for (bool ok = rmovana.move_first(); ok; ok = rmovana.move_next()) + { + const TString& codice = rmovana.get(logic1 == LF_COMMESSE ? RMOVANA_CODCMS : RMOVANA_CODCCOSTO).as_string(); + codici_buoni.add(codice); + } + TISAM_recordset set(logic1 == LF_CDC ? "USE CDC" : "USE COMMESSE"); //..e di conseguenza scrive la use giusta bool skip_closed = false; if (logic1 == LF_COMMESSE) skip_closed = !yesno_box(TR("E' stata richiesta la stampa di tutte le commesse:\n" "Si desidera includere anche le commesse chiuse?")); - + TProgind pi(set.items(), video_string, true, true); for (bool sok = set.move_first(); sok; sok = set.move_next()) //fighissimo metodo per scandire un file in 1 riga! { @@ -643,6 +678,8 @@ void TPrint_mastrini_ca::print_or_preview(const bool stampa) continue; row = set.get(0u).as_string(); //prende il valore del primo campo del file (CDC o CMS code) + if (!codici_buoni.is_key(row)) + continue; //completa la stringa da visualizzare sulla progind video_string.cut(0) << row << '\n' << set.get(1u); diff --git a/ca/ca3800.uml b/ca/ca3800.uml index ef4552b27..c6d364fc1 100755 --- a/ca/ca3800.uml +++ b/ca/ca3800.uml @@ -104,11 +104,16 @@ RADIOBUTTON F_TIPOSTIMA 1 30 BEGIN PROMPT 45 9 "Tipo di stima Costi\Ricavi" ITEM "T|C prev.\R prev. (Tempo)" - MESSAGE CLEAR,F_INCLUDE_DOCUMENTI + MESSAGE SHOW,F_DETR_CONS|ENABLE,F_DETR_CONS|CLEAR,F_INCLUDE_DOCUMENTI ITEM "C|C cons.\R prev." - MESSAGE ENABLE,F_INCLUDE_DOCUMENTI + MESSAGE SHOW,F_DETR_CONS|ENABLE,F_DETR_CONS|ENABLE,F_INCLUDE_DOCUMENTI ITEM "R|C cons.\R cons." - MESSAGE ENABLE,F_INCLUDE_DOCUMENTI + MESSAGE CLEAR,F_DETR_CONS|HIDE,F_DETR_CONS|ENABLE,F_INCLUDE_DOCUMENTI +END + +BOOLEAN F_DETR_CONS +BEGIN + PROMPT 1 11 "Utilizzare consuntivi per le detrazioni " END GROUPBOX F_PRE0 76 5 diff --git a/ca/ca3800a.rep b/ca/ca3800a.rep index 33ad00337..2b93ebc4b 100755 --- a/ca/ca3800a.rep +++ b/ca/ca3800a.rep @@ -61,6 +61,17 @@
  • + + + + + + DETRCONS + +
  • +
  • + + diff --git a/ca/ca3800b.rep b/ca/ca3800b.rep index 713d9e19b..50b5567d4 100755 --- a/ca/ca3800b.rep +++ b/ca/ca3800b.rep @@ -49,6 +49,17 @@
  • + + + + + + DETRCONS + +
  • +
  • + + @@ -140,10 +151,9 @@ #RICAVI-#COSTI MESSAGE ADD,F3.169 - - - - #RICAVI @ + + + #RICAVI @ EMPTY= IF 0 ELSE @@ -163,8 +173,8 @@ THEN #THIS ! - - + +
    diff --git a/ca/ca3800c.rep b/ca/ca3800c.rep index 8c1418a7e..cbe7ad83b 100755 --- a/ca/ca3800c.rep +++ b/ca/ca3800c.rep @@ -49,6 +49,17 @@
  • + + + + + + DETRCONS + +
  • +
  • + + @@ -140,10 +151,9 @@ #RICAVI-#COSTI MESSAGE ADD,F3.169 - - - - #RICAVI @ + + + #RICAVI @ EMPTY= IF 0 ELSE @@ -163,7 +173,7 @@ THEN #THIS ! - +
  • diff --git a/ca/ca3883.cpp b/ca/ca3883.cpp index 8799e182a..2fff98a4e 100755 --- a/ca/ca3883.cpp +++ b/ca/ca3883.cpp @@ -187,7 +187,7 @@ int TPrint_saldana_recordset::estrai_saldi(const TRectype& saldana, const int in switch (_tipostima) { - case 'R': //CostiConsuntivi RicaviConsuntivi (Cc/Rc) + case 'R': //CostiConsuntivi RicaviConsuntivi (Cc/Rc) (le detrazioni saranno ovviamente sempre e solo consuntive) { const TImporto imp_saldo(saldana.get_char(SALDANA_SEZIONE), saldana.get_real(SALDANA_SALDO)); if (!imp_saldo.is_zero()) @@ -208,15 +208,15 @@ int TPrint_saldana_recordset::estrai_saldi(const TRectype& saldana, const int in case 'C': //CostiConsuntivi RicaviPreventivi (Cc/Rp) { - if (indbil == 3) //costi (sempre e solo consuntivi, sia righe commessa che detrazione) + if (indbil == 3) //costi: sempre e solo consuntivi, sia righe commessa che detrazione { const TImporto imp_saldo(saldana.get_char(SALDANA_SEZIONE), saldana.get_real(SALDANA_SALDO)); - saldo = imp_saldo; - flag |= saldo.is_zero() ? 0 : 1; + saldo = imp_saldo; + flag |= saldo.is_zero() ? 0 : 1; } - else //indbil=4 ricavi (preventivi per righe commessa, consuntivi per detrazioni) + else //indbil=4 ricavi: preventivi per righe commessa, consuntivi o preventivi per detrazioni (dipende da scelta utente) { - if (cms_detraz) + if (cms_detraz && _detrazioni_consuntive) { const TImporto imp_saldo(saldana.get_char(SALDANA_SEZIONE), saldana.get_real(SALDANA_SALDO)); saldo = imp_saldo; @@ -236,7 +236,7 @@ int TPrint_saldana_recordset::estrai_saldi(const TRectype& saldana, const int in case 'T': //CostiPreventivi RicaviPreventivi (Cc/Rp) = Tempo //nel caso stia calcolando le detrazioni di anni precedenti (cms_detraz) va sempre preso il consuntivo!! - if (cms_detraz) + if (cms_detraz && _detrazioni_consuntive) { const TImporto imp_saldo(saldana.get_char(SALDANA_SEZIONE), saldana.get_real(SALDANA_SALDO)); saldo = imp_saldo; @@ -1530,6 +1530,11 @@ const TVariant& TPrint_saldana_recordset::get(const char* column_name) const var.set(_depth); } else + if (strcmp(column_name, "DETRCONS") == 0) + { + var.set(_detrazioni_consuntive == true ? "X" : ""); + } + else if (strcmp(column_name, "VITAINTERA") == 0) { var.set(_vitaintera == true ? "SI" : "NO"); @@ -1679,6 +1684,7 @@ void TPrint_saldana_recordset::set_filter(const TMask& msk, const TString& curr_ _include_documenti = msk.get_bool(F_INCLUDE_DOCUMENTI); _depth = msk.get_int(F_DEPTH); _tipostampa = msk.get_int(F_TIPOSTAMPA); + _detrazioni_consuntive = msk.get_bool(F_DETR_CONS); //in base al tipo di stampa selezionata setta un po' di parametri switch (_tipostampa) diff --git a/ca/ca3883.h b/ca/ca3883.h index eff4f6021..373a85680 100755 --- a/ca/ca3883.h +++ b/ca/ca3883.h @@ -78,6 +78,7 @@ class TPrint_saldana_recordset : public TRecordset int _tipostampa; bool _vitaintera; + bool _detrazioni_consuntive; bool _include_documenti; bool _forza_maturato; diff --git a/ca/ca3883a.h b/ca/ca3883a.h index 7a11a3a57..42d8fe5f1 100755 --- a/ca/ca3883a.h +++ b/ca/ca3883a.h @@ -14,6 +14,7 @@ #define F_CDC 111 #define F_DEPTH 112 #define F_TIPOSTAMPA 113 +#define F_DETR_CONS 114 #define F_FORZA_MATURATO 115 #define F_INCLUDE_DOCUMENTI 116