Patch level :4.0 nopatch
Files correlati : Ricompilazione Demo : [ ] Commento :iniziata implementazione superstampa di Adolfo! git-svn-id: svn://10.65.10.50/trunk@14463 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
dbe7a2a9f2
commit
e0b2e3b847
@ -1,6 +1,7 @@
|
||||
#define F_SEZSALDI 121
|
||||
#define F_SOSPESO 122
|
||||
#define F_INDBIL 123
|
||||
#define F_TESTATA 124
|
||||
|
||||
#define F_SHEET 300
|
||||
|
||||
|
@ -13,9 +13,15 @@ BEGIN
|
||||
PROMPT 2 0 ""
|
||||
END
|
||||
|
||||
STRING F_TESTATA 30
|
||||
BEGIN
|
||||
PROMPT 3 7 "Testata per stampe "
|
||||
FIELD TESTATA
|
||||
END
|
||||
|
||||
RADIOBUTTON F_SEZSALDI 1 16
|
||||
BEGIN
|
||||
PROMPT 2 7 "Sezione saldi"
|
||||
PROMPT 2 9 "Sezione saldi"
|
||||
ITEM "D|Dare"
|
||||
ITEM "A|Avere"
|
||||
FIELD SEZSALDI
|
||||
@ -23,7 +29,7 @@ END
|
||||
|
||||
RADIOBUTTON F_INDBIL 1 24
|
||||
BEGIN
|
||||
PROMPT 40 7 "Indicatore di bilancio"
|
||||
PROMPT 40 9 "Indicatore di bilancio"
|
||||
ITEM "0|0. Non definito"
|
||||
ITEM "1|1. Attivita'"
|
||||
ITEM "2|2. Passivita'"
|
||||
@ -35,7 +41,7 @@ END
|
||||
|
||||
BOOLEAN F_SOSPESO
|
||||
BEGIN
|
||||
PROMPT 2 12 "Sospeso"
|
||||
PROMPT 2 13 "Sospeso"
|
||||
FIELD SOSPESO
|
||||
END
|
||||
|
||||
|
@ -92,29 +92,37 @@ bool TPrint_bilancio_cms_mask::on_field_event(TOperable_field& o, TField_event e
|
||||
|
||||
|
||||
TPrint_bilancio_cms_mask::TPrint_bilancio_cms_mask()
|
||||
:TAnal_report_mask("ca3800")
|
||||
:TAnal_report_mask("ca3800")
|
||||
{
|
||||
TConfig& cfg = ca_config();
|
||||
const bool use_pdcc = cfg.get_bool("UsePdcc");
|
||||
|
||||
const TMultilevel_code_info& pconana_info = ca_multilevel_code_info(LF_PCONANA);
|
||||
const int pconana_levels = pconana_info.levels();
|
||||
|
||||
int prefix = cfg.get_int("PdcPrefix");
|
||||
|
||||
int prefix = cfg.get_int("PdcPrefix");
|
||||
if (prefix >= pconana_levels)
|
||||
prefix = pconana_levels-1;
|
||||
|
||||
// Controllo se voglio (e posso) usare il conto analitico come prefisso di quello contabile
|
||||
TToken_string codes, descr;
|
||||
for (int k = prefix; k < pconana_levels; k++)
|
||||
{
|
||||
codes.add(k);
|
||||
descr.add(pconana_info.prompt(k));
|
||||
}
|
||||
|
||||
TList_field& depth_list = lfield(F_DEPTH);
|
||||
depth_list.replace_items(codes, descr);
|
||||
|
||||
//Controllo se voglio (e posso) usare il conto analitico come prefisso di quello contabile
|
||||
if (use_pdcc && prefix > 0)
|
||||
{
|
||||
const TMultilevel_code_info& info = ca_multilevel_code_info(LF_PCONANA);
|
||||
const int levels = info.levels();
|
||||
if (levels >= 2 && prefix < levels && esistono_riclassificazioni())
|
||||
if (pconana_levels >= 2 && prefix < pconana_levels && esistono_riclassificazioni())
|
||||
{
|
||||
ca_create_fields(*this, 0, LF_PCONANA, 1, 13, F_PRE1, F_PREDES1, 0x0, PCONANA_CODCONTO);
|
||||
|
||||
// Nascondi i campi che non fanno parte del prefisso
|
||||
for (int i = 0; i < levels; i++)
|
||||
for (int i = 0; i < pconana_levels; i++)
|
||||
{
|
||||
if (i < prefix)
|
||||
{
|
||||
@ -126,10 +134,10 @@ TPrint_bilancio_cms_mask::TPrint_bilancio_cms_mask()
|
||||
{
|
||||
field(F_PRE1 + i).hide();
|
||||
field(F_PREDES1 + i).hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} //if(i<prefix..
|
||||
} //for(int i=0..
|
||||
} //if(levels>=2..
|
||||
} //if(use_pdcc..
|
||||
|
||||
// setta gli handlers a tutti i campi generati della maschera;senza questa chiamata la on_field_event
|
||||
// non puo' funzionare sui campi generati!!!
|
||||
@ -286,7 +294,7 @@ TAssoc_array& TPrint_bilancio_cms_recordset::get_row(TAssoc_array& cms, const ch
|
||||
riga_array->add("FASE", fase);
|
||||
riga_array->add("DESCRIZ", descrizione);
|
||||
|
||||
//aggiunge la riga all'array-ino
|
||||
//aggiunge la riga all'array-one
|
||||
cms.add(chiave, riga_array);
|
||||
}
|
||||
return *riga_array;
|
||||
@ -303,6 +311,7 @@ void TPrint_bilancio_cms_recordset::requery()
|
||||
|
||||
//deve procedere al confronto tra le date inizio-fine esercizio e quelle inizio-fine commessa..
|
||||
//..per spostare il record in esame nell'array corretto
|
||||
//Intanto crea l'arrayone che conterra' i record da sortare e stampare!
|
||||
TAssoc_array cms[4];
|
||||
|
||||
TString query;
|
||||
@ -382,7 +391,6 @@ void TPrint_bilancio_cms_recordset::requery()
|
||||
aggiorna_importo(riga_array, conto, indbil, saldana, true);
|
||||
}
|
||||
} //if(indice...
|
||||
|
||||
} //if (datafine >= datainiesc &&...
|
||||
} //if (saldop != ZERO..
|
||||
} //if (indbil == 3 ||...
|
||||
@ -457,13 +465,13 @@ const TVariant& TPrint_bilancio_cms_recordset::get(const char* column_name) cons
|
||||
avanzamento = ((real)(time_gone * CENTO) / durata_cms);
|
||||
}
|
||||
}
|
||||
else
|
||||
else //if(_tipostima=T...
|
||||
{
|
||||
|
||||
}
|
||||
var.set(avanzamento);
|
||||
}
|
||||
else
|
||||
else //if(strcmp(column_name,AVANZAMENTO...
|
||||
{
|
||||
TAssoc_array& riga = (TAssoc_array&)_righe[_curr];
|
||||
const TString* val = (TString*)riga.objptr(column_name);
|
||||
@ -496,7 +504,7 @@ void TPrint_bilancio_cms_recordset::set_filter(const TPrint_bilancio_cms_mask& m
|
||||
////////////////////////////////////////////////////////
|
||||
// REPORT
|
||||
////////////////////////////////////////////////////////
|
||||
class TPrint_bilancio_cms_rep : public TAnal_report
|
||||
class TPrint_bilancio_cms_rep : public TCRPA_report
|
||||
{
|
||||
|
||||
protected:
|
||||
@ -505,17 +513,18 @@ protected:
|
||||
|
||||
public:
|
||||
void set_filter(const TPrint_bilancio_cms_mask& msk);
|
||||
TPrint_bilancio_cms_rep(const char* rep_name, const TString& prefix, const int depth);
|
||||
};
|
||||
|
||||
bool TPrint_bilancio_cms_rep::get_usr_val(const TString& name, TVariant& var) const
|
||||
{
|
||||
return TAnal_report::get_usr_val(name, var);
|
||||
return TReport::get_usr_val(name, var);
|
||||
}
|
||||
|
||||
bool TPrint_bilancio_cms_rep::set_recordset()
|
||||
{
|
||||
TPrint_bilancio_cms_recordset* rs = new TPrint_bilancio_cms_recordset();
|
||||
return TAnal_report::set_recordset(rs);
|
||||
return TReport::set_recordset(rs);
|
||||
}
|
||||
|
||||
void TPrint_bilancio_cms_rep::set_filter(const TPrint_bilancio_cms_mask& msk)
|
||||
@ -523,7 +532,12 @@ void TPrint_bilancio_cms_rep::set_filter(const TPrint_bilancio_cms_mask& msk)
|
||||
TPrint_bilancio_cms_recordset* recset = new TPrint_bilancio_cms_recordset();
|
||||
|
||||
recset->set_filter(msk);
|
||||
TAnal_report::set_recordset(recset);
|
||||
TReport::set_recordset(recset);
|
||||
}
|
||||
|
||||
TPrint_bilancio_cms_rep::TPrint_bilancio_cms_rep(const char* rep_name, const TString& prefix, const int depth)
|
||||
:TCRPA_report(rep_name, prefix, depth)
|
||||
{
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
@ -542,11 +556,12 @@ void TPrint_bilancio_cms::main_loop()
|
||||
{
|
||||
//report e book dei report
|
||||
TReport_book book;
|
||||
const TString& prefix = mask.get(F_PRE1);
|
||||
const int depth = mask.get_int(F_DEPTH);
|
||||
TString path = mask.get(F_REPORT);
|
||||
if (path.empty())
|
||||
path = "ca3800a";
|
||||
TPrint_bilancio_cms_rep rep;
|
||||
rep.load(path);
|
||||
TPrint_bilancio_cms_rep rep(path, prefix, depth);
|
||||
|
||||
rep.set_filter(mask);
|
||||
book.add(rep);
|
||||
|
@ -11,6 +11,7 @@
|
||||
#define F_TIPOSTIMA 108
|
||||
#define F_VITAINTERA 109
|
||||
#define F_FASI 110
|
||||
#define F_DEPTH 111
|
||||
|
||||
//campi generati dai piani dei conti
|
||||
#define F_PRE0 320
|
||||
|
@ -71,19 +71,19 @@ BEGIN
|
||||
FLAGS "A"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 76 5
|
||||
GROUPBOX DLG_NULL 76 6
|
||||
BEGIN
|
||||
PROMPT 0 6 "@bParametri"
|
||||
END
|
||||
|
||||
BOOLEAN F_FASI
|
||||
BEGIN
|
||||
PROMPT 2 7 "Esplodi Fasi"
|
||||
PROMPT 2 7 "Esplodere Fasi"
|
||||
END
|
||||
|
||||
BOOLEAN F_VITAINTERA
|
||||
BEGIN
|
||||
PROMPT 20 7 "Includi esercizi successivi (vita intera)"
|
||||
PROMPT 20 7 "Includere esercizi successivi (vita intera)"
|
||||
END
|
||||
|
||||
RADIOBUTTON F_TIPOSTIMA 1 22
|
||||
@ -100,6 +100,13 @@ BEGIN
|
||||
GROUP 6
|
||||
END
|
||||
|
||||
LISTBOX F_DEPTH 1 20
|
||||
BEGIN
|
||||
PROMPT 1 18 "Profondita' del piano dei conti da considerare "
|
||||
ITEM "1|Gruppo"
|
||||
ITEM "2|Conto"
|
||||
END
|
||||
|
||||
STRING F_REPORT 256 64
|
||||
BEGIN
|
||||
PROMPT 1 20 "Report "
|
||||
|
@ -2,7 +2,11 @@
|
||||
#include "calib02.h"
|
||||
#include "ca3883.h"
|
||||
#include "panapdc.h"
|
||||
#include "pconana.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Classe per ricavare l'indicatore di bilancio dei conti analitici riclassificati e non
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
TObject* TIndbil_cache::key2obj(const char* key)
|
||||
{
|
||||
TString80 conto = key;
|
||||
@ -79,3 +83,69 @@ TIndbil_cache::TIndbil_cache()
|
||||
TConfig& cfg = ca_config();
|
||||
_usepdcc = cfg.get_bool("UsePdcc");
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//Classe di report speciale con numero colonne adattabile in base ad un parametro
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void TCRPA_report::merge_array(TString_array& c, TString_array& t,
|
||||
TString_array& codici, TString_array& testate) const
|
||||
{
|
||||
while (c.items() > 0)
|
||||
{
|
||||
TObject* cod = c.remove(0,true);
|
||||
TObject* tes = t.remove(0,true);
|
||||
codici.TArray::add(cod);
|
||||
testate.TArray::add(tes);
|
||||
}
|
||||
}
|
||||
|
||||
void TCRPA_report::analize_pconana_structure (const TString& prefix, const int depth,
|
||||
TString_array& codici, TString_array& testate) const
|
||||
{
|
||||
TConfig& cfg = ca_config();
|
||||
const TMultilevel_code_info& pconana_info = ca_multilevel_code_info(LF_PCONANA);
|
||||
const long total_length = pconana_info.total_len(depth);
|
||||
|
||||
|
||||
TISAM_recordset recset("USE PCONANA\nSELECT LEN(CODCONTO)=#LUN\nFROM CODCONTO=#PREFIX\nTO CODCONTO=#PREFIX");
|
||||
recset.set_var("#LUN", TVariant(total_length));
|
||||
recset.set_var("#PREFIX", TVariant(prefix));
|
||||
const int prefix_length = prefix.len();
|
||||
|
||||
TString_array codici_c, testate_c, codici_r, testate_r;
|
||||
|
||||
for (bool ok = recset.move_first(); ok; ok = recset.move_next())
|
||||
{
|
||||
const TString& codconto = recset.get(PCONANA_CODCONTO).as_string();
|
||||
|
||||
const TAnal_bill zio(codconto);
|
||||
const int indbil = zio.indicatore_bilancio();
|
||||
if (indbil == 3 || indbil == 4)
|
||||
{
|
||||
const TString& codice = codconto.mid(prefix_length);
|
||||
const TString& testata = zio.testata();
|
||||
if (indbil == 3)
|
||||
{
|
||||
codici_c.add(codice);
|
||||
testate_c.add(testata);
|
||||
}
|
||||
else
|
||||
{
|
||||
codici_r.add(codice);
|
||||
testate_r.add(testata);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
merge_array(codici_r, testate_r, codici, testate);
|
||||
merge_array(codici_c, testate_c, codici, testate);
|
||||
}
|
||||
|
||||
|
||||
TCRPA_report::TCRPA_report (const char* rep_name, const TString& prefix, const int depth)
|
||||
{
|
||||
load(rep_name);
|
||||
TString_array codici, testate;
|
||||
analize_pconana_structure (prefix, depth, codici, testate);
|
||||
}
|
||||
|
15
ca/ca3883.h
15
ca/ca3883.h
@ -20,3 +20,18 @@ public:
|
||||
TIndbil_cache();
|
||||
|
||||
};
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////
|
||||
// REPORT A COLONNE VARIABILI
|
||||
///////////////////////////////////////////////////////////////
|
||||
class TCRPA_report : public TReport
|
||||
{
|
||||
protected:
|
||||
void merge_array(TString_array& c, TString_array& t,
|
||||
TString_array& codici, TString_array& testate) const;
|
||||
void analize_pconana_structure (const TString& prefix, const int depth,
|
||||
TString_array& codici, TString_array& testate) const;
|
||||
public:
|
||||
TCRPA_report (const char* rep_name, const TString& prefix, const int depth);
|
||||
};
|
||||
|
@ -481,6 +481,29 @@ int TAnal_bill::indicatore_bilancio() const
|
||||
return indbil;
|
||||
}
|
||||
|
||||
const TString& TAnal_bill::testata() const
|
||||
{
|
||||
const TRectype& rec = cache().get(LF_PCONANA, _conto);
|
||||
const TString& testata = rec.get(PCONANA_TESTATA);
|
||||
if (testata.full())
|
||||
return testata;
|
||||
else //metodo fichissimo per evitare parole troncate!
|
||||
{
|
||||
const TString& descr = rec.get(PCONANA_DESCR);
|
||||
//se la descrizione e' abbastanza corta da stare nel campo testata la usa direttamente..
|
||||
if (descr.len() <= 15)
|
||||
return descr;
|
||||
//..in caso contrario fa in modo da adattarla senza troncamenti
|
||||
TParagraph_string str(descr, 15);
|
||||
TString& tmp = get_tmp_string();
|
||||
tmp = str.get(0);
|
||||
if (str.items() > 1)
|
||||
tmp << '\n' << str.get(1);
|
||||
|
||||
return tmp;
|
||||
}
|
||||
}
|
||||
|
||||
bool TAnal_bill::get(const TRectype& rec)
|
||||
{
|
||||
bool ok = true;
|
||||
|
@ -32,7 +32,8 @@ public:
|
||||
const TString& commessa() const;
|
||||
const TString& fase() const;
|
||||
|
||||
int indicatore_bilancio() const;
|
||||
int indicatore_bilancio() const;
|
||||
const TString& testata() const;
|
||||
bool get(const TRectype& rec);
|
||||
void reset();
|
||||
|
||||
|
@ -1,3 +1,3 @@
|
||||
106
|
||||
0
|
||||
$pconana|0|0|74|0|Piano dei Conti Analitico|||
|
||||
$pconana|0|0|104|0|Piano dei Conti Analitico|||
|
||||
|
@ -1,10 +1,11 @@
|
||||
106
|
||||
5
|
||||
6
|
||||
CODCONTO|1|20|0|Codice Conto analitico
|
||||
DESCR|1|50|0|Descrizione
|
||||
SEZSALDI|1|1|0|Sezione preferenziale del saldo
|
||||
SOSPESO|8|1|0|Conto sospeso
|
||||
INDBIL|1|1|0|Indicatore di bilancio
|
||||
TESTATA|1|30|0|Descrizione testata in stampa
|
||||
2
|
||||
CODCONTO|
|
||||
UPPER(DESCR)|X
|
||||
|
@ -6,5 +6,6 @@
|
||||
#define PCONANA_SEZSALDI "SEZSALDI"
|
||||
#define PCONANA_SOSPESO "SOSPESO"
|
||||
#define PCONANA_INDBIL "INDBIL"
|
||||
#define PCONANA_TESTATA "TESTATA"
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user