Patch level :4.0 patch futura
Files correlati : Ricompilazione Demo : [ ] Commento :kontinua il "Mein stampf" programmen git-svn-id: svn://10.65.10.50/trunk@14471 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
ed995a13c8
commit
2bf56b3d8b
@ -159,6 +159,7 @@ class TPrint_bilancio_cms_recordset : public TRecordset
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
int _anno;
|
int _anno;
|
||||||
|
int _depth;
|
||||||
bool _vitaintera, _use_fasi;
|
bool _vitaintera, _use_fasi;
|
||||||
char _tipostima;
|
char _tipostima;
|
||||||
|
|
||||||
@ -173,7 +174,7 @@ protected:
|
|||||||
virtual const TVariant& get(unsigned int column) const;
|
virtual const TVariant& get(unsigned int column) const;
|
||||||
virtual const TVariant& get(const char* column_name) const;
|
virtual const TVariant& get(const char* column_name) const;
|
||||||
|
|
||||||
void parse_bill(const TString& bill, TString& gruppo, TString& conto) const;
|
void parse_bill(const TString& bill, TString& conto) const;
|
||||||
int estrai_saldi(const TRecordset& saldana, const int indbil,
|
int estrai_saldi(const TRecordset& saldana, const int indbil,
|
||||||
TImporto& saldo, TImporto& saldop) const;
|
TImporto& saldo, TImporto& saldop) const;
|
||||||
void aggiorna_importo(TAssoc_array& riga_array, const TString& livello,
|
void aggiorna_importo(TAssoc_array& riga_array, const TString& livello,
|
||||||
@ -194,7 +195,7 @@ bool TPrint_bilancio_cms_recordset::move_to(TRecnotype pos)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TPrint_bilancio_cms_recordset::parse_bill(const TString& bill, TString& gruppo, TString& conto) const
|
void TPrint_bilancio_cms_recordset::parse_bill(const TString& bill, TString& conto) const
|
||||||
{
|
{
|
||||||
TConfig& cfg = ca_config();
|
TConfig& cfg = ca_config();
|
||||||
const TMultilevel_code_info& pconana_info = ca_multilevel_code_info(LF_PCONANA);
|
const TMultilevel_code_info& pconana_info = ca_multilevel_code_info(LF_PCONANA);
|
||||||
@ -203,12 +204,10 @@ void TPrint_bilancio_cms_recordset::parse_bill(const TString& bill, TString& gru
|
|||||||
|
|
||||||
//lunghezza dell'eventuale prefisso di gruppo e conto
|
//lunghezza dell'eventuale prefisso di gruppo e conto
|
||||||
const int prefix_len = (prefix >= 0) ? pconana_info.total_len(prefix) : 0;
|
const int prefix_len = (prefix >= 0) ? pconana_info.total_len(prefix) : 0;
|
||||||
const int gruppo_len = pconana_info.len(prefix + 1);
|
const int conto_end = pconana_info.total_len(_depth) - prefix_len;
|
||||||
const int conto_len = pconana_info.len(prefix + 2);
|
|
||||||
|
|
||||||
//stringhe con gruppo e conto da mettere nel record dell'assoc_array
|
//stringa con cio' che segue il prefisso ed e' richiesto
|
||||||
gruppo = bill.mid(prefix_len, gruppo_len);
|
conto = bill.mid(prefix_len, conto_end);
|
||||||
conto = bill.mid(prefix_len, gruppo_len + conto_len);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -368,8 +367,9 @@ void TPrint_bilancio_cms_recordset::requery()
|
|||||||
TAssoc_array& riga_array = get_row(cms[indice], chiave, indice, codcms, fase,
|
TAssoc_array& riga_array = get_row(cms[indice], chiave, indice, codcms, fase,
|
||||||
rec_commesse.get(COMMESSE_DESCRIZ));
|
rec_commesse.get(COMMESSE_DESCRIZ));
|
||||||
//aggiunge gli importi e normalizza
|
//aggiunge gli importi e normalizza
|
||||||
TString80 gruppo, conto;
|
const char* gruppo = indbil == 3 ? "COSTI" : "RICAVI";
|
||||||
parse_bill(conto_anale, gruppo, conto);
|
TString80 conto;
|
||||||
|
parse_bill(conto_anale, conto);
|
||||||
aggiorna_importo(riga_array, gruppo, indbil, saldana);
|
aggiorna_importo(riga_array, gruppo, indbil, saldana);
|
||||||
aggiorna_importo(riga_array, conto, indbil, saldana);
|
aggiorna_importo(riga_array, conto, indbil, saldana);
|
||||||
|
|
||||||
@ -439,6 +439,11 @@ const TVariant& TPrint_bilancio_cms_recordset::get(const char* column_name) cons
|
|||||||
var.set(_tipostima == 'T' ? "T" : "C");
|
var.set(_tipostima == 'T' ? "T" : "C");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
if (strcmp(column_name, "LEVEL") == 0)
|
||||||
|
{
|
||||||
|
var.set(_depth);
|
||||||
|
}
|
||||||
|
else
|
||||||
if (strcmp(column_name, "AVANZAMENTO") == 0)
|
if (strcmp(column_name, "AVANZAMENTO") == 0)
|
||||||
{
|
{
|
||||||
//Calcola lo stato di avanzamento della commessa
|
//Calcola lo stato di avanzamento della commessa
|
||||||
@ -497,8 +502,8 @@ void TPrint_bilancio_cms_recordset::set_filter(const TPrint_bilancio_cms_mask& m
|
|||||||
TString80 prefix;
|
TString80 prefix;
|
||||||
for (short id = F_PRE1; id <= F_PRE3 && msk.id2pos(id) > 0; id++)
|
for (short id = F_PRE1; id <= F_PRE3 && msk.id2pos(id) > 0; id++)
|
||||||
prefix << msk.get(id);
|
prefix << msk.get(id);
|
||||||
|
|
||||||
_indicatori.set_prefix(prefix);
|
_indicatori.set_prefix(prefix);
|
||||||
|
_depth = msk.get_int(F_DEPTH);
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////
|
||||||
|
@ -125,12 +125,29 @@ MESSAGE RESET,F3.108</prescript>
|
|||||||
<postscript description="B1.69 POSTSCRIPT">MESSAGE ADD,F3.69</postscript>
|
<postscript description="B1.69 POSTSCRIPT">MESSAGE ADD,F3.69</postscript>
|
||||||
</field>
|
</field>
|
||||||
<field x="73" type="Valuta" align="right" width="13" id="169" pattern="1" text="###.###.###,@@">
|
<field x="73" type="Valuta" align="right" width="13" id="169" pattern="1" text="###.###.###,@@">
|
||||||
<source>#MARGINE</source>
|
<source>#RICAVI-#COSTI</source>
|
||||||
<postscript description="B1.169 POSTSCRIPT">MESSAGE ADD,F3.169</postscript>
|
<postscript description="B1.169 POSTSCRIPT">MESSAGE ADD,F3.169</postscript>
|
||||||
</field>
|
</field>
|
||||||
<field x="87" type="Numero" align="right" width="4" id="170" pattern="1">
|
<field x="87" type="Numero" align="right" width="4" id="170" pattern="1">
|
||||||
<font italic="1" face="Arial Narrow" size="8" />
|
<font italic="1" face="Arial Narrow" size="8" />
|
||||||
<source>#PERCMARGINE</source>
|
<source>#PERCMARGINE</source>
|
||||||
|
<prescript description="B1.170 PRESCRIPT">#RICAVI @
|
||||||
|
0
|
||||||
|
=
|
||||||
|
IF
|
||||||
|
0
|
||||||
|
ELSE
|
||||||
|
1
|
||||||
|
#COSTI @
|
||||||
|
#RICAVI @
|
||||||
|
F;
|
||||||
|
-
|
||||||
|
100
|
||||||
|
*
|
||||||
|
0
|
||||||
|
ROUND
|
||||||
|
THEN
|
||||||
|
#THIS !</prescript>
|
||||||
</field>
|
</field>
|
||||||
</section>
|
</section>
|
||||||
<section type="Foot" />
|
<section type="Foot" />
|
||||||
|
@ -142,14 +142,24 @@ 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
|
//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)
|
if (codici_r.items() >= 1)
|
||||||
{
|
{
|
||||||
|
if (codici_r.items() == 1) //se il campo da stampare e' uno solo va
|
||||||
|
{
|
||||||
|
codici_r.destroy();
|
||||||
|
testate_r.destroy();
|
||||||
|
}
|
||||||
codici_r.add("#RICAVI");
|
codici_r.add("#RICAVI");
|
||||||
testate_r.add(TR("RICAVI"));
|
testate_r.add(TR("RICAVI"));
|
||||||
}
|
}
|
||||||
//..analogo per i Costi
|
//..analogo per i Costi
|
||||||
if (codici_c.items() > 1)
|
if (codici_c.items() >= 1)
|
||||||
{
|
{
|
||||||
|
if (codici_c.items() == 1)
|
||||||
|
{
|
||||||
|
codici_c.destroy();
|
||||||
|
testate_c.destroy();;
|
||||||
|
}
|
||||||
codici_c.add("#COSTI");
|
codici_c.add("#COSTI");
|
||||||
testate_c.add(TR("COSTI"));
|
testate_c.add(TR("COSTI"));
|
||||||
}
|
}
|
||||||
@ -194,10 +204,13 @@ void TCRPA_report::offset_and_fill_columns(TReport_section& rep_sect, const TStr
|
|||||||
}
|
}
|
||||||
if (sect_type == 'H')
|
if (sect_type == 'H')
|
||||||
new_field->set_picture(str_arr.row(i));
|
new_field->set_picture(str_arr.row(i));
|
||||||
else
|
if (sect_type == 'B')
|
||||||
new_field->set_field(str_arr.row(i));
|
new_field->set_field(str_arr.row(i));
|
||||||
|
if (sect_type == 'F')
|
||||||
|
new_field->set_field("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//sposta a destra gli ultimi campi non generati
|
||||||
const TReport_field& ultimo_campo = rep_sect.field(rep_sect.last());
|
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);
|
const TPoint offset(ultimo_campo.get_rect().right() - rep_field.get_rect().right(), 0);
|
||||||
|
|
||||||
@ -214,6 +227,7 @@ bool TCRPA_report::generate_columns (TString_array& codici, TString_array& testa
|
|||||||
//sezioni del report da modificare
|
//sezioni del report da modificare
|
||||||
TReport_section& h0 = section('H', 0);
|
TReport_section& h0 = section('H', 0);
|
||||||
TReport_section& b1 = section('B', 1);
|
TReport_section& b1 = section('B', 1);
|
||||||
|
TReport_section& f3 = section('F', 3);
|
||||||
|
|
||||||
//controllo dell'esistenza dei campi modello da replicare e loro duplicazione e riempimento!
|
//controllo dell'esistenza dei campi modello da replicare e loro duplicazione e riempimento!
|
||||||
TReport_field* b1_69 = b1.find_field(69);
|
TReport_field* b1_69 = b1.find_field(69);
|
||||||
@ -226,6 +240,11 @@ bool TCRPA_report::generate_columns (TString_array& codici, TString_array& testa
|
|||||||
return warning_box(TR("Manca l'intestazione della colonna modello (H0.69)"));
|
return warning_box(TR("Manca l'intestazione della colonna modello (H0.69)"));
|
||||||
offset_and_fill_columns(h0, testate);
|
offset_and_fill_columns(h0, testate);
|
||||||
|
|
||||||
|
TReport_field* f3_69 = f3.find_field(69);
|
||||||
|
if (f3_69 == NULL)
|
||||||
|
return warning_box(TR("Manca l'intestazione della colonna modello (F3.69)"));
|
||||||
|
offset_and_fill_columns(f3, codici);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user