diff --git a/ce/ce0100.cpp b/ce/ce0100.cpp index d70931cce..2c6be8fec 100755 --- a/ce/ce0100.cpp +++ b/ce/ce0100.cpp @@ -12,6 +12,8 @@ #include "../ca/commesse.h" #include "../ca/fasi.h" +#include "../cg/cglib01.h" + #include "ce0.h" #include "celib.h" @@ -133,7 +135,9 @@ bool TCAC_mask::on_field_event(TOperable_field& o, TField_event e, long jolly) /////////////////////////////////////////////////////////// class TCCC_mask : public TAutomask -{ +{ + bool _has_ca, _use_pdcc; + public: virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly); @@ -146,66 +150,32 @@ public: TCCC_mask::TCCC_mask() : TAutomask("cetbccc") { + //parte nascondendo i campi analitici + hide(-2); + //controllo analitica su chiave - const bool has_ca = dongle().active(CAAUT); + _has_ca = dongle().active(CAAUT); + + //inizializza i flag che servono un pò dappertutto + //di base usa il pdcc + TConfig& cfg = ca_config(); + _use_pdcc = cfg.get_bool("UsePdcc"); + //se la chiave ha CA -> campi cms/cdc/fase! - if (!has_ca) - hide(-2); - else + if (_has_ca) { show(-2); - //Riempie i campi di cdc/cms/fase standard in base a quanto configurato nell'esercizio cespiti - const TString& codes = get(F_CODES); - const TRectype& rec_cce = cache().get("CCE", codes); - const TString& codcdc = rec_cce.get("S2"); - const TString& descdc = cache().get(LF_CDC, codcdc, CDC_DESCRIZ); - set(F_CODCDC, codcdc); - set(F_DESCDC, descdc); - const TString& codcms = rec_cce.get("S3"); - const TString& descms = cache().get(LF_COMMESSE, codcms, COMMESSE_DESCRIZ); - set(F_CODCMS, codcms); - set(F_DESCMS, descms); - const TString& codfase = rec_cce.get("S4"); - //per le fasi è necessario sapere se hanno un padre e quale è! - TToken_string key_fasi; - TConfig& cfg = ca_config(); - const TString& fath_fasi = cfg.get("FathFasi"); - if (fath_fasi.full()) - { - if (fath_fasi == "CMS") - key_fasi.add(codcms); - else - key_fasi.add(codcdc); - } - else - key_fasi.add(""); - - key_fasi.add(codfase); - const TString& desfase = cache().get(LF_FASI, key_fasi, FASI_DESCRIZ); - set(F_CODFASE, codfase); - set(F_DESFASE, desfase); - //se è in uso il piano dei conti analitico puro, dagli di vagonata di campi per i conti, in base alla.. //..configurazione del PCONANA! - const bool use_pdcc = cfg.get_bool("UsePdcc"); - if (!use_pdcc) + if (!_use_pdcc) { - enable_page(1, false); const int logicnum = LF_PCONANA; - const int nfields = ca_create_fields(*this, 1, LF_PCONANA, 2, 1, F_PDA1_IMM, F_DES1_IMM, 0x0, "S1[1,20]"); - ca_create_fields(*this, 1, LF_PCONANA, 2, 7, F_PDA1_FON, F_DES1_FON, 0x0, "S1[21,40]"); - ca_create_fields(*this, 1, LF_PCONANA, 2, 13, F_PDA1_NOR, F_DES1_NOR, 0x0, "S1[41,60]"); - ca_create_fields(*this, 2, LF_PCONANA, 2, 1, F_PDA1_ACC, F_DES1_ACC, 0x0, "S2[1,20]"); - ca_create_fields(*this, 2, LF_PCONANA, 2, 7, F_PDA1_ANT, F_DES1_ANT, 0x0, "S2[21,40]"); + const int nfields = ca_create_fields(*this, 1, LF_PCONANA, 2, 1, F_PDA1_NOR, F_DES1_NOR, 0x0, "S3"); + ca_create_fields(*this, 1, LF_PCONANA, 2, 7, F_PDA1_ACC, F_DES1_ACC, 0x0, "S4"); + ca_create_fields(*this, 1, LF_PCONANA, 2, 13, F_PDA1_ANT, F_DES1_ANT, 0x0, "S5"); for (int i = 0; i < nfields; i++) { - TMask_field& immobilizzo = field(F_PDA1_IMM + i); - immobilizzo.set_group(2); - immobilizzo.check_type(CHECK_REQUIRED); - TMask_field& fondo = field(F_PDA1_FON + i); - fondo.set_group(2); - fondo.check_type(CHECK_REQUIRED); TMask_field& normale = field(F_PDA1_NOR + i); normale.set_group(2); normale.check_type(CHECK_REQUIRED); @@ -216,8 +186,10 @@ TCCC_mask::TCCC_mask() anticipato.set_group(2); anticipato.check_type(CHECK_NORMAL); } - } - } + } //if(!_use_pdcc) + } //if (_has_ca) + else + hide(-2); } bool TCCC_mask::on_field_event(TOperable_field& o, TField_event e, long jolly) @@ -236,14 +208,77 @@ bool TCCC_mask::on_field_event(TOperable_field& o, TField_event e, long jolly) const TRectype& cac = dc.categoria(0, NULL, get_int(F_CODCAT_IN)); if (o.dlg() == F_CODCAT_IN) set(F_DESCCAT, cac.get("S0")); - /*else - set(F_CODCAT_IN, cac.get("CODTAB");*/ } if (e == fe_close && o.empty()) return error_box(TR("È necessario specificare la categoria!")); } } break; + case F_CODES: + if (e == fe_init) + { + if (_has_ca) + { + show(-2); + //Riempie i campi di cdc/cms/fase standard in base a quanto configurato nell'esercizio cespiti + const TString& codes = get(F_CODES); + const TRectype& rec_cce = cache().get("CCE", codes); + const TString& codcdc = rec_cce.get("S2"); + const TString& descdc = cache().get(LF_CDC, codcdc, CDC_DESCRIZ); + set(F_CODCDC, codcdc); + set(F_DESCDC, descdc); + const TString& codcms = rec_cce.get("S3"); + const TString& descms = cache().get(LF_COMMESSE, codcms, COMMESSE_DESCRIZ); + set(F_CODCMS, codcms); + set(F_DESCMS, descms); + const TString& codfase = rec_cce.get("S4"); + //per le fasi è necessario sapere se hanno un padre e quale è! + TToken_string key_fasi; + TConfig& cfg = ca_config(); + const TString& fath_fasi = cfg.get("FathFasi"); + if (fath_fasi.full()) + { + if (fath_fasi == "CMS") + key_fasi.add(codcms); + else + key_fasi.add(codcdc); + } + else + key_fasi.add(""); + + key_fasi.add(codfase); + const TString& desfase = cache().get(LF_FASI, key_fasi, FASI_DESCRIZ); + set(F_CODFASE, codfase); + set(F_DESFASE, desfase); + + //sistemati i campi di cdc/cms/fase, scatta il controllo sui campi dei conti analitici degli ammortamenti + if (_use_pdcc) + disable_page(1); + else + enable_page(1); + } + else //if(_has_ca) + hide(-2); + } + break; + case F_QNOR_SOT: + case F_QACC_SOT: + case F_QANT_SOT: + if (e == fe_close && !o.empty()) + { + //in caso sia presente la CA, e sia UsePdcc = true, -> i conti degli ammortamenti devono valere anche.. + //..per l'analitica + if (_has_ca && _use_pdcc) + { + const long sot = o.get_long(); + const int gr = get_int(o.dlg() - 2); + const int co = get_int(o.dlg() -1); + TBill zio(gr, co, sot); + if (!zio.is_analitico()) + return error_box(TR("Il conto selezionato non è valido per la contabilità analitica!")); + } + } + break; default: break; } diff --git a/ce/ce3900.cpp b/ce/ce3900.cpp index 619514a05..1e8e2f211 100755 --- a/ce/ce3900.cpp +++ b/ce/ce3900.cpp @@ -94,12 +94,12 @@ bool TStampa_sintetica_mask::on_field_event(TOperable_field& o, TField_event e, TStampa_sintetica_mask::TStampa_sintetica_mask() : TAutomask("ce3900"), _preview(false) { - const bool has_ca = dongle().active(CAAUT); + /*const bool has_ca = dongle().active(CAAUT); //se la chiave ha CA mostra i campi gruppo 2 (analitica).. if (has_ca) show(-2); else - hide(-2); + hide(-2);*/ } /////////////////////////////////////////////////////////////// @@ -187,7 +187,7 @@ void TStampa_sintetica_recordset::set_filter(const TStampa_sintetica_mask& msk) set_var("#DATAINIZIO", msk.get_date(F_DATAINIZIO).date2ansi()); //parte analitica - const int codes = msk.get_int(F_ESERCIZIO); + /*const int codes = msk.get_int(F_ESERCIZIO); const TString& codcdc = msk.get(F_CODCDC); const TString& codcms = msk.get(F_CODCMS); const TString& codfase = msk.get(F_CODFASE); @@ -199,7 +199,7 @@ void TStampa_sintetica_recordset::set_filter(const TStampa_sintetica_mask& msk) if (codcms.full()) set_var("#CODCMS", codcms, true); if (codfase.full()) - set_var("#CODFASE", codfase, true); + set_var("#CODFASE", codfase, true);*/ } @@ -211,15 +211,15 @@ class TStampa_sintetica_rep : public TReport int _anno; int _tpamm; int _group_codimp, _group_codloc; - TString _codcdc, _codcms, _codfase; + //TString _codcdc, _codcms, _codfase; TCespite _cespite; - real _percutil; - TString16 _cespi_percutil; + //real _percutil; + //TString16 _cespi_percutil; protected: real val_amm(const TRectype& rec_saldi) const; virtual bool get_usr_val(const TString& name, TVariant& var) const; - real perc_util() const; + //real perc_util() const; public: void set_filter(const TStampa_sintetica_mask& msk); @@ -227,7 +227,7 @@ public: //metodo per avere, solo al cambio cespite, la % di utilizzo per la chiave cespite/anno/cdc/cms/fase //serve nel caso si utilizzi il cespite in analitica (selezioni su cdc/cms/fase) -real TStampa_sintetica_rep::perc_util() const +/*real TStampa_sintetica_rep::perc_util() const { const TString& curr_cespite = _cespite.get(CESPI_IDCESPITE); if (curr_cespite != _cespi_percutil) @@ -236,7 +236,7 @@ real TStampa_sintetica_rep::perc_util() const (real&)_percutil = ceca_percutil(_cespi_percutil, _anno, _codcdc, _codcms, _codfase); } return _percutil; -} +}*/ void TStampa_sintetica_rep::set_filter(const TStampa_sintetica_mask& msk) { @@ -246,9 +246,9 @@ void TStampa_sintetica_rep::set_filter(const TStampa_sintetica_mask& msk) _group_codimp = msk.get_bool(F_GROUP_CODIMP); _group_codloc = msk.get_bool(F_GROUP_CODLOC); - _codcdc = msk.get(F_CODCDC); + /*_codcdc = msk.get(F_CODCDC); _codcms = msk.get(F_CODCMS); - _codfase = msk.get(F_CODFASE); + _codfase = msk.get(F_CODFASE);*/ TStampa_sintetica_recordset* rs = new TStampa_sintetica_recordset(EMPTY_STRING); set_recordset(rs); @@ -344,7 +344,7 @@ bool TStampa_sintetica_rep::get_usr_val(const TString& name, TVariant& var) cons rec_ammmv.get_real(AMMMV_QANT) + rec_ammmv.get_real(AMMMV_QPERSE) + rec_ammmv.get_real(AMMMV_QPPRIVATE) + rec_ammmv.get_real(AMMMV_FPRIVATO); } - quote_ammmv *= perc_util(); + //quote_ammmv *= perc_util(); var = quote_ammmv; return true; } @@ -354,7 +354,7 @@ bool TStampa_sintetica_rep::get_usr_val(const TString& name, TVariant& var) cons real quote_amm = real(rec_ammce.get_real(AMMCE_QNOR) + rec_ammce.get_real(AMMCE_QACC) + rec_ammce.get_real(AMMCE_QANT) + rec_ammce.get_real(AMMCE_QPERSE) + rec_ammce.get_real(AMMCE_QPPRIVATE) + rec_ammce.get_real(AMMCE_FPRIVATO)); - quote_amm *= perc_util(); + //quote_amm *= perc_util(); var = quote_amm; return true; } @@ -362,7 +362,7 @@ bool TStampa_sintetica_rep::get_usr_val(const TString& name, TVariant& var) cons { const TRectype& rec_ammce = _cespite.amm_pro(); real famm = rec_ammce.get_real(AMMCE_FPRIVATO); - famm *= perc_util(); + //famm *= perc_util(); var = famm; return true; } @@ -420,7 +420,7 @@ bool TStampa_sintetica_rep::get_usr_val(const TString& name, TVariant& var) cons rec_movam.get_real(MOVAM_QANT) + rec_movam.get_real(MOVAM_QPERSE) + rec_movam.get_real(MOVAM_QPPRIVATE) + rec_movam.get_real(MOVAM_FPRIVATO); } - cesselim *= perc_util(); + //cesselim *= perc_util(); var = cesselim; return true; } @@ -441,7 +441,7 @@ bool TStampa_sintetica_rep::get_usr_val(const TString& name, TVariant& var) cons var.set(_anno); return true; } - if (name == "#CODCDC") + /*if (name == "#CODCDC") { var.set(_codcdc); return true; @@ -455,7 +455,7 @@ bool TStampa_sintetica_rep::get_usr_val(const TString& name, TVariant& var) cons { var.set(_codfase); return true; - } + }*/ return TReport::get_usr_val(name, var); } diff --git a/ce/ce3900.h b/ce/ce3900.h index d50b283c4..d4178eba7 100755 --- a/ce/ce3900.h +++ b/ce/ce3900.h @@ -18,11 +18,11 @@ #define F_GROUP_CODLOC 118 #define F_EXCLUDE_ALIENS 119 -#define F_CODCMS 120 +/*#define F_CODCMS 120 #define F_DESCMS 121 #define F_CODFASE 122 #define F_DESFASE 123 #define F_CODCDC 124 -#define F_DESCDC 125 +#define F_DESCDC 125*/ #define F_REPORT 126 diff --git a/ce/ce3900.uml b/ce/ce3900.uml index 287a316fe..d5832fdeb 100755 --- a/ce/ce3900.uml +++ b/ce/ce3900.uml @@ -156,7 +156,7 @@ BEGIN PROMPT 42 14 "Escludere i cespiti alienati" END -GROUPBOX DLG_NULL 78 5 +/*GROUPBOX DLG_NULL 78 5 BEGIN PROMPT 1 16 "@bAnalitica" GROUP 2 @@ -230,6 +230,8 @@ BEGIN DISPLAY "Codice@20" CODCOSTO COPY OUTPUT F_CODCDC GROUP 2 -END +END*/ ENDPAGE + +ENDMASK \ No newline at end of file diff --git a/ce/ce3900a.rep b/ce/ce3900a.rep index c61677800..7285995f4 100755 --- a/ce/ce3900a.rep +++ b/ce/ce3900a.rep @@ -64,27 +64,6 @@ MESSAGE RESET,F1.107
  • - - - - - - #CODCDC - - - - - - - #CODCMS - - - - - - - #CODFASE -
    CODCAT diff --git a/ce/cetbana.h b/ce/cetbana.h index 107640210..1ad03a7f5 100755 --- a/ce/cetbana.h +++ b/ce/cetbana.h @@ -9,23 +9,16 @@ #define F_DESFASE 556 //campi generati per pconana (se necessari) -#define F_PDA1_IMM 601 -#define F_PDA4_IMM 605 -#define F_PDA1_FON 608 -#define F_PDA4_FON 612 -#define F_PDA1_NOR 613 -#define F_PDA4_NOR 616 -#define F_PDA1_ACC 617 -#define F_PDA4_ACC 620 -#define F_PDA1_ANT 621 -#define F_PDA4_ANT 624 -#define F_DES1_IMM 701 -#define F_DES4_IMM 705 -#define F_DES1_FON 708 -#define F_DES4_FON 712 -#define F_DES1_NOR 713 -#define F_DES4_NOR 716 -#define F_DES1_ACC 717 -#define F_DES4_ACC 720 -#define F_DES1_ANT 721 -#define F_DES4_ANT 724 +#define F_PDA1_NOR 601 +#define F_PDA4_NOR 605 +#define F_PDA1_ACC 609 +#define F_PDA4_ACC 613 +#define F_PDA1_ANT 617 +#define F_PDA4_ANT 621 + +#define F_DES1_NOR 701 +#define F_DES4_NOR 705 +#define F_DES1_ACC 709 +#define F_DES4_ACC 713 +#define F_DES1_ANT 717 +#define F_DES4_ANT 721 diff --git a/ce/cetbccc.uml b/ce/cetbccc.uml index 2ed16960b..46f96e204 100755 --- a/ce/cetbccc.uml +++ b/ce/cetbccc.uml @@ -463,7 +463,7 @@ END NUMBER F_CODES 4 BEGIN PROMPT 2 14 "Esercizio cespiti corrente" - FLAGS "AD" + FLAGS "ADG" GROUP 2 END @@ -511,40 +511,21 @@ END ENDPAGE -PAGE "Conti CA - 1" 0 2 0 0 +PAGE "Conti CA" 0 2 0 0 GROUPBOX DLG_NULL 76 6 BEGIN - PROMPT 1 0 "@bImmobilizzo" - GROUP 2 + PROMPT 1 0 "@bAmm. Normali" END GROUPBOX DLG_NULL 76 6 BEGIN - PROMPT 1 6 "@bFondo" - GROUP 2 + PROMPT 1 6 "@bAmm. Accelerati" END GROUPBOX DLG_NULL 76 6 BEGIN - PROMPT 1 12 "@bAmm. Normali" - GROUP 2 -END - -ENDPAGE - -PAGE "Conti CA - 2" 0 2 0 0 - -GROUPBOX DLG_NULL 76 6 -BEGIN - PROMPT 1 0 "@bAmm. Accelerati" - GROUP 2 -END - -GROUPBOX DLG_NULL 76 6 -BEGIN - PROMPT 1 6 "@bAmm. Anticipati" - GROUP 2 + PROMPT 1 12 "@bAmm. Anticipati" END ENDPAGE