Patch level :2.2 358

Files correlati     :
Ricompilazione Demo : [ ]
Commento            :aggiunta sottosezione con i gr.co.sott. riclassificati


git-svn-id: svn://10.65.10.50/trunk@13788 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
luca 2006-02-15 19:03:54 +00:00
parent 0e2e1ea0f8
commit ef1c92ccc3
2 changed files with 72 additions and 1 deletions

View File

@ -2,11 +2,15 @@
#include <execp.h>
#include <reprint.h>
#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())

View File

@ -33,6 +33,13 @@
<section type="Head" level="1" />
<section type="Body" />
<section type="Body" level="1">
<postscript description="B1 POSTSCRIPT">"B11"
#SHOW_SUBSECTION @
IF
SHOW
ELSE
HIDE
THEN</postscript>
<field type="Stringa" width="25" pattern="1">
<source>CODCONTO</source>
<prescript description="B1.0 PRESCRIPT">MESSAGE_FORMAT_CONTO</prescript>
@ -47,6 +54,22 @@
<source>SOSPESO</source>
</field>
</section>
<section type="Head" level="11" />
<section type="Body" level="11">
<sql>USE PANAPDC
FROM CODCONTO=#PARENT.CODCONTO
TO CODCONTO=#PARENT.CODCONTO</sql>
<field x="3" type="Numero" align="right" width="3" pattern="1">
<source>GRUPPO</source>
</field>
<field x="7" type="Numero" align="right" width="3" pattern="1">
<source>CONTO</source>
</field>
<field x="11" type="Numero" align="right" width="6" pattern="1">
<source>SOTTOCONTO</source>
</field>
</section>
<section type="Foot" level="11" />
<section type="Foot" />
<section type="Foot" level="1" />
<sql>USE PCONANA