diff --git a/ca/ca1400.cpp b/ca/ca1400.cpp index 6789204ba..6f57a1e22 100755 --- a/ca/ca1400.cpp +++ b/ca/ca1400.cpp @@ -2,11 +2,15 @@ #include #include +#include "pconana.h" #include "ca1.h" #include "ca1400a.h" #include "calib01.h" #include "calib02.h" +//////////////////////////////////////// +// Maschera +//////////////////////////////////////// class TMask_print_pdc : public TAutomask { @@ -33,6 +37,50 @@ TMask_print_pdc::TMask_print_pdc() } } +////////////////////////////////////////// +// Report +////////////////////////////////////////// +class TRep_print_pdc : public TAnal_report +{ + bool _riclass; + int _minlen; + +protected: + virtual bool get_usr_val(const TString& name, TVariant& var) const; +public: + TRep_print_pdc(); +}; + +TRep_print_pdc::TRep_print_pdc() +{ + //il file di riclassificazione ha almeno un record? + TLocalisamfile ric(LF_PANAPDC); + _riclass = ric.first() == NOERR; + + //quale e' la lunghezza del piano dei conti tenendo conto di tutti i livelli tranne l'ultimo? + //questa qui! + _minlen = ca_multilevel_code_info(LF_PCONANA).total_len(-1); +} + +bool TRep_print_pdc::get_usr_val(const TString& name, TVariant& var) const +{ + if (name == "#SHOW_SUBSECTION") + { + bool show = false; + if (_riclass) + { + const TString& conto = recordset()->get(PCONANA_CODCONTO).as_string(); + show = conto.len() > _minlen; + } + var.set(show); + return true; + } + return TAnal_report::get_usr_val(name, var); +} + +/////////////////////////////////////////////// +// Applicazione +/////////////////////////////////////////////// class TPrint_pdc : public TSkeleton_application { bool create(); @@ -70,7 +118,7 @@ void TPrint_pdc::main_loop() while (m.run() == K_ENTER) { TReport_book book; - TAnal_report rep; + TRep_print_pdc rep; path = m.get(F_REPORT); if (path.empty()) diff --git a/ca/ca1400a.rep b/ca/ca1400a.rep index 315ad9cc1..3311e6255 100755 --- a/ca/ca1400a.rep +++ b/ca/ca1400a.rep @@ -33,6 +33,13 @@
+ "B11" +#SHOW_SUBSECTION @ +IF + SHOW +ELSE + HIDE +THEN CODCONTO MESSAGE_FORMAT_CONTO @@ -47,6 +54,22 @@ SOSPESO
+
+
+ USE PANAPDC +FROM CODCONTO=#PARENT.CODCONTO +TO CODCONTO=#PARENT.CODCONTO + + GRUPPO + + + CONTO + + + SOTTOCONTO + +
+
USE PCONANA