Patch level :4.0 patch futura
Files correlati : Ricompilazione Demo : [ ] Commento :continua implementazione stampa del reich! git-svn-id: svn://10.65.10.50/trunk@14470 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
4837bc423c
commit
ed995a13c8
152
ca/ca3800a.rep
152
ca/ca3800a.rep
@ -25,18 +25,11 @@
|
||||
<li Value="COSTI" Code="C" />
|
||||
</list>
|
||||
</field>
|
||||
<field x="63" y="2.75" type="Testo" align="right" width="8" pattern="1" text="RICAVI" />
|
||||
<field x="80" y="2.75" type="Testo" align="center" width="60" pattern="1" text="COSTI" />
|
||||
<field x="155" y="2.75" type="Testo" align="right" width="8" pattern="1" text="Margine" />
|
||||
<field x="153" y="3.5" type="Testo" align="right" width="12" pattern="1" text=" Contribuz. " />
|
||||
<field x="52.5" y="3.75" type="Testo" width="6" pattern="1" text="% Av." />
|
||||
<field x="72" y="3.75" type="Testo" align="right" width="12" pattern="1" text="Lavoro" />
|
||||
<field x="85" y="3.75" type="Testo" align="right" width="12" pattern="1" text="Incarichi" />
|
||||
<field x="98" y="3.75" type="Testo" align="right" width="12" pattern="1" text="Consulenze" />
|
||||
<field x="111" y="3.75" type="Testo" align="right" width="12" pattern="1" text="Materiali" />
|
||||
<field x="124" y="3.75" type="Testo" align="right" width="12" pattern="1" text="Altri" />
|
||||
<field x="137" y="3.75" type="Testo" align="right" width="12" pattern="1" text="Tot. costi" />
|
||||
<field x="74" y="2.75" type="Testo" align="right" width="8" pattern="1" text="Margine" />
|
||||
<field x="72" y="3.5" type="Testo" align="right" width="12" pattern="1" text=" Contribuz. " />
|
||||
<field x="53" y="3.75" type="Testo" align="center" width="6" pattern="1" text="% Av." />
|
||||
<field border="1" x="1" y="4.75" type="Linea" width="169" height="0" pattern="1" />
|
||||
<field x="59" y="2.5" type="Testo" valign="bottom" align="right" width="13" height="2" id="69" pattern="1" text="Testata" />
|
||||
<field x="1" y="3.5" type="Testo" width="15" id="121" pattern="1" text="Commessa" />
|
||||
</section>
|
||||
<section type="Head" level="1" height="4">
|
||||
@ -114,71 +107,30 @@ MESSAGE RESET,F3.108</prescript>
|
||||
</section>
|
||||
<section type="Body" />
|
||||
<section type="Body" level="1">
|
||||
<field x="1" type="Stringa" width="16" pattern="1">
|
||||
<field x="1" type="Stringa" width="20" pattern="1">
|
||||
<source>CODCMS</source>
|
||||
</field>
|
||||
<field x="17" type="Stringa" dynamic_height="1" width="30" height="2" pattern="1">
|
||||
<field x="21" type="Stringa" dynamic_height="1" width="25" height="2" pattern="1">
|
||||
<source>DESCRIZ</source>
|
||||
</field>
|
||||
<field x="47" type="Stringa" width="7" pattern="1">
|
||||
<field x="46" type="Stringa" width="10" pattern="1">
|
||||
<source>FASE</source>
|
||||
</field>
|
||||
<field x="54" type="Numero" align="right" width="3" pattern="1">
|
||||
<field x="56" type="Numero" align="right" width="3" pattern="1">
|
||||
<font italic="1" face="Arial Narrow" size="8" />
|
||||
<source>ROUND(AVANZAMENTO;0)</source>
|
||||
</field>
|
||||
<field x="167" type="Testo" align="center" width="2" pattern="1" text="%" />
|
||||
<field x="58" type="Valuta" align="right" width="13" id="101" pattern="1" text="###.###.###,@@">
|
||||
<source>#RIC</source>
|
||||
<postscript description="B1.101 POSTSCRIPT">MESSAGE ADD,F3.101</postscript>
|
||||
<field x="91" type="Testo" align="center" width="2" pattern="1" text="%" />
|
||||
<field x="59" type="Valuta" align="right" width="13" id="69" pattern="1" text="###.###.###,@@">
|
||||
<postscript description="B1.69 POSTSCRIPT">MESSAGE ADD,F3.69</postscript>
|
||||
</field>
|
||||
<field x="71" type="Valuta" align="right" width="13" id="102" pattern="1" text="###.###.###,@@">
|
||||
<source>#COSC01</source>
|
||||
<postscript description="B1.102 POSTSCRIPT">MESSAGE ADD,F3.102</postscript>
|
||||
<field x="73" type="Valuta" align="right" width="13" id="169" pattern="1" text="###.###.###,@@">
|
||||
<source>#MARGINE</source>
|
||||
<postscript description="B1.169 POSTSCRIPT">MESSAGE ADD,F3.169</postscript>
|
||||
</field>
|
||||
<field x="84" type="Valuta" align="right" width="13" id="103" pattern="1" text="###.###.###,@@">
|
||||
<source>#COSC02</source>
|
||||
<postscript description="B1.103 POSTSCRIPT">MESSAGE ADD,F3.103</postscript>
|
||||
</field>
|
||||
<field x="97" type="Valuta" align="right" width="13" id="104" pattern="1" text="###.###.###,@@">
|
||||
<source>#COSC03</source>
|
||||
<postscript description="B1.104 POSTSCRIPT">MESSAGE ADD,F3.104</postscript>
|
||||
</field>
|
||||
<field x="110" type="Valuta" align="right" width="13" id="105" pattern="1" text="###.###.###,@@">
|
||||
<source>#COSC04</source>
|
||||
<postscript description="B1.105 POSTSCRIPT">MESSAGE ADD,F3.105</postscript>
|
||||
</field>
|
||||
<field x="123" type="Valuta" align="right" width="13" id="106" pattern="1" text="###.###.###,@@">
|
||||
<source>#COSC05</source>
|
||||
<postscript description="B1.106 POSTSCRIPT">MESSAGE ADD,F3.106</postscript>
|
||||
</field>
|
||||
<field x="136" type="Valuta" align="right" width="13" id="107" pattern="1" text="###.###.###,@@">
|
||||
<source>#COS</source>
|
||||
<postscript description="B1.107 POSTSCRIPT">MESSAGE ADD,F3.107</postscript>
|
||||
</field>
|
||||
<field x="149" type="Valuta" align="right" width="13" id="108" pattern="1" text="###.###.###,@@">
|
||||
<source>#RIC-#COS</source>
|
||||
<postscript description="B1.108 POSTSCRIPT">MESSAGE ADD,F3.108</postscript>
|
||||
</field>
|
||||
<field x="163" type="Numero" align="right" width="4" id="109" pattern="1">
|
||||
<field x="87" type="Numero" align="right" width="4" id="170" pattern="1">
|
||||
<font italic="1" face="Arial Narrow" size="8" />
|
||||
<prescript description="B1.109 PRESCRIPT">#RIC @
|
||||
0
|
||||
=
|
||||
IF
|
||||
0
|
||||
ELSE
|
||||
1
|
||||
#COS @
|
||||
#RIC @
|
||||
F;
|
||||
-
|
||||
100
|
||||
*
|
||||
0
|
||||
ROUND
|
||||
THEN
|
||||
#THIS !</prescript>
|
||||
<source>#PERCMARGINE</source>
|
||||
</field>
|
||||
</section>
|
||||
<section type="Foot" />
|
||||
@ -186,14 +138,8 @@ THEN
|
||||
<font italic="1" face="Arial Narrow" bold="1" size="8" />
|
||||
<field border="2" x="1" y="0.75" type="Linea" width="169" height="0" pattern="1" />
|
||||
<field x="1" y="1.5" type="Testo" fg_color="#FFFFFF" bg_color="#000000" width="25" height="1.5" text="TOTALI GENERALI " />
|
||||
<field x="58" y="1.5" type="Valuta" align="right" width="13" id="101" pattern="1" text="###.###.###,@@" />
|
||||
<field x="71" y="1.5" type="Valuta" align="right" width="13" id="102" pattern="1" text="###.###.###,@@" />
|
||||
<field x="84" y="1.5" type="Valuta" align="right" width="13" id="103" pattern="1" text="###.###.###,@@" />
|
||||
<field x="97" y="1.5" type="Valuta" align="right" width="13" id="104" pattern="1" text="###.###.###,@@" />
|
||||
<field x="110" y="1.5" type="Valuta" align="right" width="13" id="105" pattern="1" text="###.###.###,@@" />
|
||||
<field x="123" y="1.5" type="Valuta" align="right" width="13" id="106" pattern="1" text="###.###.###,@@" />
|
||||
<field x="136" y="1.5" type="Valuta" align="right" width="13" id="107" pattern="1" text="###.###.###,@@" />
|
||||
<field x="149" y="1.5" type="Valuta" align="right" width="13" id="108" pattern="1" text="###.###.###,@@" />
|
||||
<field x="58" y="1.5" type="Valuta" align="right" width="13" id="69" pattern="1" text="###.###.###,@@" />
|
||||
<field x="71" y="1.5" type="Valuta" align="right" width="13" id="169" pattern="1" text="###.###.###,@@" />
|
||||
</section>
|
||||
<section type="Foot" level="2" height="2.5">
|
||||
<font italic="1" face="Courier New" bold="1" size="8" />
|
||||
@ -212,41 +158,17 @@ THEN
|
||||
<font italic="1" face="Arial Narrow" bold="1" size="8" />
|
||||
<source>H2.102</source>
|
||||
</field>
|
||||
<field y="1" type="Numero" hidden="1" align="right" width="1" id="101" pattern="1" />
|
||||
<field x="58" y="1" type="Valuta" align="right" width="13" id="101" pattern="1" text="###.###.###,@@">
|
||||
<field x="58" y="1" type="Valuta" align="right" width="13" id="69" pattern="1" text="###.###.###,@@">
|
||||
<font italic="1" face="Arial Narrow" bold="1" size="8" />
|
||||
<postscript description="F2.101 POSTSCRIPT">MESSAGE ADD,F1.101</postscript>
|
||||
<postscript description="F2.69 POSTSCRIPT">MESSAGE ADD,F1.69</postscript>
|
||||
</field>
|
||||
<field y="1" type="Numero" hidden="1" align="right" width="1" id="101" pattern="1" />
|
||||
<field x="35" y="1" type="Numero" hidden="1" align="right" width="4" id="102" pattern="1">
|
||||
<postscript description="F2.102 POSTSCRIPT">MESSAGE COPY,F2.101</postscript>
|
||||
</field>
|
||||
<field x="71" y="1" type="Valuta" align="right" width="13" id="102" pattern="1" text="###.###.###,@@">
|
||||
<field x="71" y="1" type="Valuta" align="right" width="13" id="169" pattern="1" text="###.###.###,@@">
|
||||
<font italic="1" face="Arial Narrow" bold="1" size="8" />
|
||||
<postscript description="F2.102 POSTSCRIPT">MESSAGE ADD,F1.102</postscript>
|
||||
</field>
|
||||
<field x="84" y="1" type="Valuta" align="right" width="13" id="103" pattern="1" text="###.###.###,@@">
|
||||
<font italic="1" face="Arial Narrow" bold="1" size="8" />
|
||||
<postscript description="F2.103 POSTSCRIPT">MESSAGE ADD,F1.103</postscript>
|
||||
</field>
|
||||
<field x="97" y="1" type="Valuta" align="right" width="13" id="104" pattern="1" text="###.###.###,@@">
|
||||
<font italic="1" face="Arial Narrow" bold="1" size="8" />
|
||||
<postscript description="F2.104 POSTSCRIPT">MESSAGE ADD,F1.104</postscript>
|
||||
</field>
|
||||
<field x="110" y="1" type="Valuta" align="right" width="13" id="105" pattern="1" text="###.###.###,@@">
|
||||
<font italic="1" face="Arial Narrow" bold="1" size="8" />
|
||||
<postscript description="F2.105 POSTSCRIPT">MESSAGE ADD,F1.105</postscript>
|
||||
</field>
|
||||
<field x="123" y="1" type="Valuta" align="right" width="13" id="106" pattern="1" text="###.###.###,@@">
|
||||
<font italic="1" face="Arial Narrow" bold="1" size="8" />
|
||||
<postscript description="F2.106 POSTSCRIPT">MESSAGE ADD,F1.106</postscript>
|
||||
</field>
|
||||
<field x="136" y="1" type="Valuta" align="right" width="13" id="107" pattern="1" text="###.###.###,@@">
|
||||
<font italic="1" face="Arial Narrow" bold="1" size="8" />
|
||||
<postscript description="F2.107 POSTSCRIPT">MESSAGE ADD,F1.107</postscript>
|
||||
</field>
|
||||
<field x="149" y="1" type="Valuta" align="right" width="13" id="108" pattern="1" text="###.###.###,@@">
|
||||
<font italic="1" face="Arial Narrow" bold="1" size="8" />
|
||||
<postscript description="F2.108 POSTSCRIPT">MESSAGE ADD,F1.108</postscript>
|
||||
<postscript description="F2.169 POSTSCRIPT">MESSAGE ADD,F1.169</postscript>
|
||||
</field>
|
||||
</section>
|
||||
<section type="Foot" level="3" height="2">
|
||||
@ -261,30 +183,12 @@ THEN
|
||||
<li Value="TOTALI Commesse avviate nell'esercizio selezionato" Code="3" />
|
||||
</list>
|
||||
</field>
|
||||
<field x="58" y="0.5" type="Valuta" align="right" width="13" id="69" pattern="1" text="###.###.###,@@">
|
||||
<postscript description="F3.69 POSTSCRIPT">MESSAGE ADD,F2.69</postscript>
|
||||
</field>
|
||||
<field y="0.5" type="Numero" hidden="1" align="right" width="1" id="101" pattern="1" />
|
||||
<field x="58" y="0.5" type="Valuta" align="right" width="13" id="101" pattern="1" text="###.###.###,@@">
|
||||
<postscript description="F3.101 POSTSCRIPT">MESSAGE ADD,F2.101</postscript>
|
||||
</field>
|
||||
<field x="71" y="0.5" type="Valuta" align="right" width="13" id="102" pattern="1" text="###.###.###,@@">
|
||||
<postscript description="F3.102 POSTSCRIPT">MESSAGE ADD,F2.102</postscript>
|
||||
</field>
|
||||
<field x="84" y="0.5" type="Valuta" align="right" width="13" id="103" pattern="1" text="###.###.###,@@">
|
||||
<postscript description="F3.103 POSTSCRIPT">MESSAGE ADD,F2.103</postscript>
|
||||
</field>
|
||||
<field x="97" y="0.5" type="Valuta" align="right" width="13" id="104" pattern="1" text="###.###.###,@@">
|
||||
<postscript description="F3.104 POSTSCRIPT">MESSAGE ADD,F2.104</postscript>
|
||||
</field>
|
||||
<field x="110" y="0.5" type="Valuta" align="right" width="13" id="105" pattern="1" text="###.###.###,@@">
|
||||
<postscript description="F3.105 POSTSCRIPT">MESSAGE ADD,F2.105</postscript>
|
||||
</field>
|
||||
<field x="123" y="0.5" type="Valuta" align="right" width="13" id="106" pattern="1" text="###.###.###,@@">
|
||||
<postscript description="F3.106 POSTSCRIPT">MESSAGE ADD,F2.106</postscript>
|
||||
</field>
|
||||
<field x="136" y="0.5" type="Valuta" align="right" width="13" id="107" pattern="1" text="###.###.###,@@">
|
||||
<postscript description="F3.107 POSTSCRIPT">MESSAGE ADD,F2.107</postscript>
|
||||
</field>
|
||||
<field x="149" y="0.5" type="Valuta" align="right" width="13" id="108" pattern="1" text="###.###.###,@@">
|
||||
<postscript description="F3.108 POSTSCRIPT">MESSAGE ADD,F2.108</postscript>
|
||||
<field x="71" y="0.5" type="Valuta" align="right" width="13" id="169" pattern="1" text="###.###.###,@@">
|
||||
<postscript description="F3.169 POSTSCRIPT">MESSAGE ADD,F2.169</postscript>
|
||||
</field>
|
||||
</section>
|
||||
<sql>USE SALDANA</sql>
|
||||
|
102
ca/ca3883.cpp
102
ca/ca3883.cpp
@ -103,11 +103,13 @@ void TCRPA_report::merge_array(TString_array& c, TString_array& t,
|
||||
void TCRPA_report::analize_pconana_structure (const TString& prefix, const int depth,
|
||||
TString_array& codici, TString_array& testate) const
|
||||
{
|
||||
//cerca quale e' la lunghezza della stringa conto da considerare in base alla depth scelta
|
||||
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);
|
||||
|
||||
|
||||
|
||||
//scandisce il piano dei conti analitico alla ricerca dei conti di lunghezza pari a..
|
||||
//..quella appena ricavata
|
||||
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));
|
||||
@ -115,12 +117,14 @@ void TCRPA_report::analize_pconana_structure (const TString& prefix, const int d
|
||||
|
||||
TString_array codici_c, testate_c, codici_r, testate_r;
|
||||
|
||||
//riempie gli array con i codici conto di lunghezza opportuna e relative testate
|
||||
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();
|
||||
//solo Costi e Ricavi!
|
||||
if (indbil == 3 || indbil == 4)
|
||||
{
|
||||
const TString& codice = codconto.mid(prefix_length);
|
||||
@ -137,15 +141,105 @@ void TCRPA_report::analize_pconana_structure (const TString& prefix, const int d
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//se c'e' piu' di un campo da stampare per i Ricavi -> ci vuole un campo Totale per i ricavi
|
||||
if (codici_r.items() > 1)
|
||||
{
|
||||
codici_r.add("#RICAVI");
|
||||
testate_r.add(TR("RICAVI"));
|
||||
}
|
||||
//..analogo per i Costi
|
||||
if (codici_c.items() > 1)
|
||||
{
|
||||
codici_c.add("#COSTI");
|
||||
testate_c.add(TR("COSTI"));
|
||||
}
|
||||
//condensa gli array di Costo e Ricavo in un unico array che servira' di base per la stampa
|
||||
merge_array(codici_r, testate_r, codici, testate);
|
||||
merge_array(codici_c, testate_c, codici, testate);
|
||||
}
|
||||
|
||||
|
||||
void TCRPA_report::offset_and_fill_columns(TReport_section& rep_sect, const TString_array& str_arr)
|
||||
{
|
||||
TReport_field& rep_field = *rep_sect.find_field(69);
|
||||
|
||||
//deve spostare i campi a destra della colonna modello
|
||||
//prende il rettangolo del campo..
|
||||
const TRectangle& rep_field_rect = rep_field.get_rect();
|
||||
//si memorizza i campi a destra del campo modello per poterli mettere a destra di tutti..
|
||||
//..i campi che saranno generati
|
||||
TPointer_array campi_a_destra;
|
||||
for (int j = 0; j < rep_sect.items(); j++)
|
||||
{
|
||||
const TReport_field& campo = rep_sect.field(j);
|
||||
const TRectangle& rct = campo.get_rect();
|
||||
//se il campo e' a destra del modello lo aggiunge all'array dei campi_a_destra
|
||||
if (rct.left() >= rep_field_rect.right())
|
||||
campi_a_destra.add(campo);
|
||||
}
|
||||
|
||||
//duplica il campo modello e riempie i duplicati con i valori degli array
|
||||
//serve il tipo di sezione poiche' gli header vanno trattati diversamente dai body
|
||||
const char sect_type = rep_sect.type();
|
||||
|
||||
//ciclo su tutti gli elementi dell'array con i valori da settare nei nuovi campi
|
||||
for (int i = 0; i < str_arr.items(); i++)
|
||||
{
|
||||
TReport_field* new_field = i == 0 ? &rep_field : (TReport_field*)rep_field.dup();
|
||||
if (i > 0)
|
||||
{
|
||||
rep_sect.add(new_field);
|
||||
new_field->set_pos(rep_field_rect.left() + rep_field_rect.width() * i, rep_field_rect.top());
|
||||
new_field->set_id(rep_field.id() + i);
|
||||
}
|
||||
if (sect_type == 'H')
|
||||
new_field->set_picture(str_arr.row(i));
|
||||
else
|
||||
new_field->set_field(str_arr.row(i));
|
||||
}
|
||||
|
||||
const TReport_field& ultimo_campo = rep_sect.field(rep_sect.last());
|
||||
const TPoint offset(ultimo_campo.get_rect().right() - rep_field.get_rect().right(), 0);
|
||||
|
||||
for (int k = 0; k < campi_a_destra.items(); k++)
|
||||
{
|
||||
TReport_field& campo = (TReport_field&)campi_a_destra[k];
|
||||
campo.offset(offset);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool TCRPA_report::generate_columns (TString_array& codici, TString_array& testate)
|
||||
{
|
||||
//sezioni del report da modificare
|
||||
TReport_section& h0 = section('H', 0);
|
||||
TReport_section& b1 = section('B', 1);
|
||||
|
||||
//controllo dell'esistenza dei campi modello da replicare e loro duplicazione e riempimento!
|
||||
TReport_field* b1_69 = b1.find_field(69);
|
||||
if (b1_69 == NULL)
|
||||
return false;
|
||||
offset_and_fill_columns(b1, codici);
|
||||
|
||||
TReport_field* h0_69 = h0.find_field(69);
|
||||
if (h0_69 == NULL)
|
||||
return warning_box(TR("Manca l'intestazione della colonna modello (H0.69)"));
|
||||
offset_and_fill_columns(h0, testate);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
TCRPA_report::TCRPA_report (const char* rep_name, const TString& prefix, const int depth)
|
||||
{
|
||||
load(rep_name);
|
||||
//che report usare?
|
||||
load (rep_name);
|
||||
//array contenenti i conti analitici e le loro descrizioni di testata che diventeranno..
|
||||
//.colonne del report dopo lungo e periglioso travaglio
|
||||
TString_array codici, testate;
|
||||
//per prima cosa si deve analizzare la struttura del piano conti..
|
||||
//..da stampare fino al livello richiesto!
|
||||
analize_pconana_structure (prefix, depth, codici, testate);
|
||||
//poi vanno generate le colonne del report corrispondenti alla struttura analizzata
|
||||
generate_columns (codici, testate);
|
||||
}
|
||||
|
@ -32,6 +32,8 @@ protected:
|
||||
TString_array& codici, TString_array& testate) const;
|
||||
void analize_pconana_structure (const TString& prefix, const int depth,
|
||||
TString_array& codici, TString_array& testate) const;
|
||||
bool generate_columns (TString_array& codici, TString_array& testate);
|
||||
void offset_and_fill_columns(TReport_section& rep_sect, const TString_array& str_arr);
|
||||
public:
|
||||
TCRPA_report (const char* rep_name, const TString& prefix, const int depth);
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user