Patch level :10.0
Files correlati : Ricompilazione Demo : [ ] Commento : programma per il cliente commercialista di Sicuri git-svn-id: svn://10.65.10.50/trunk@20234 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
7b77236a7c
commit
c33efa541c
@ -20,7 +20,7 @@ class TDistribuzione_f24_mask : public TAutomask
|
||||
{
|
||||
protected:
|
||||
TRecordset* create_recordset() const;
|
||||
void print_stats() const;
|
||||
void print_stats(const bool stampa) const;
|
||||
void export_stats() const;
|
||||
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
|
||||
|
||||
@ -39,7 +39,13 @@ bool TDistribuzione_f24_mask::on_field_event(TOperable_field& o, TField_event e,
|
||||
case DLG_PRINT: //stampa
|
||||
if (e == fe_button)
|
||||
{
|
||||
print_stats();
|
||||
print_stats(true);
|
||||
}
|
||||
break;
|
||||
case DLG_PREVIEW: //stampa
|
||||
if (e == fe_button)
|
||||
{
|
||||
print_stats(false);
|
||||
}
|
||||
break;
|
||||
case DLG_EXPORT: //esporta in excel
|
||||
@ -59,10 +65,14 @@ bool TDistribuzione_f24_mask::on_field_event(TOperable_field& o, TField_event e,
|
||||
//..cartella radice di destinazione
|
||||
TRecordset* TDistribuzione_f24_mask::create_recordset() const
|
||||
{
|
||||
TAS400_recordset* recset = new TAS400_recordset("AS400(25)");
|
||||
TAS400_recordset* recset = new TAS400_recordset("AS400(58)");
|
||||
recset->create_field("CODICE_FISCALE", 0, 16, _alfafld, true);
|
||||
recset->create_field("ANNO", -1, 4, _intfld, true);
|
||||
recset->create_field("F24", -1, 3, _intfld, false);
|
||||
for (int j = 2006; j < 2016; j++)
|
||||
{
|
||||
TString8 anno;
|
||||
anno << "F24_" << j;
|
||||
recset->create_field(anno, -1, 4, _intfld, true);
|
||||
}
|
||||
recset->create_field("CR", -1, 2, _alfafld, true, TVariant("\n\r"));
|
||||
|
||||
//cartella radice di destinazione
|
||||
@ -72,8 +82,14 @@ TRecordset* TDistribuzione_f24_mask::create_recordset() const
|
||||
for (SLIST_ELT e = xvt_slist_get_first(pivas); e; e = xvt_slist_get_next(pivas, e))
|
||||
{
|
||||
TFilename dest_years = xvt_slist_get(pivas, e, NULL);
|
||||
const TString piva = dest_years.name_only();
|
||||
dest_years.add("????");
|
||||
const TString& piva = dest_years.name_only();
|
||||
if (piva.len() < 11 || piva.len() > 16)
|
||||
continue;
|
||||
|
||||
recset->new_rec("");
|
||||
recset->set("CODICE_FISCALE", piva);
|
||||
|
||||
dest_years.add("20??");
|
||||
SLIST years = xvt_fsys_list_files(DIR_TYPE, dest_years, true);
|
||||
for (SLIST_ELT e = xvt_slist_get_first(years); e; e = xvt_slist_get_next(years, e))
|
||||
{
|
||||
@ -85,28 +101,37 @@ TRecordset* TDistribuzione_f24_mask::create_recordset() const
|
||||
xvt_slist_destroy(files);
|
||||
|
||||
//aggiunge la riga al recordset
|
||||
recset->new_rec("");
|
||||
recset->set("CODICE_FISCALE", piva);
|
||||
recset->set("ANNO", year);
|
||||
recset->set("F24", count);
|
||||
|
||||
TString8 fld; fld << "F24_" << year;
|
||||
recset->set(fld, count);
|
||||
}
|
||||
xvt_slist_destroy(years);
|
||||
}
|
||||
xvt_slist_destroy(pivas);
|
||||
|
||||
//ordina il recordset per cofi/piva
|
||||
recset->sort();
|
||||
return recset;
|
||||
}
|
||||
|
||||
void TDistribuzione_f24_mask::print_stats() const
|
||||
void TDistribuzione_f24_mask::print_stats(const bool stampa) const
|
||||
{
|
||||
TRecordset* recset = create_recordset();
|
||||
TReport rep;
|
||||
rep.load("pg0067100");
|
||||
rep.set_recordset(recset);
|
||||
if (stampa)
|
||||
rep.print();
|
||||
else
|
||||
rep.preview();
|
||||
}
|
||||
|
||||
void TDistribuzione_f24_mask::export_stats() const
|
||||
{
|
||||
TRecordset* recset = create_recordset();
|
||||
if (recset->save_as("statistiche.xls", fmt_html))
|
||||
goto_url("statistiche.xls");
|
||||
TFilename temp;
|
||||
temp.temp("", "xls");
|
||||
if (recset->save_as(temp, fmt_html))
|
||||
goto_url(temp);
|
||||
delete recset;
|
||||
}
|
||||
|
||||
|
110
ps/pg0067100.rep
Executable file
110
ps/pg0067100.rep
Executable file
@ -0,0 +1,110 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<report name="pg0067100" lpi="6">
|
||||
<description>Statistiche archiviazione F24</description>
|
||||
<font face="Arial" size="8" />
|
||||
<section type="Head">
|
||||
<font face="Arial" bold="1" size="8" />
|
||||
<field x="73.5" type="Testo" align="center" width="6" pattern="1" text="Totale" />
|
||||
<field x="2" y="0.5" type="Testo" width="10" pattern="1" text="C.F.F;p.IVA" />
|
||||
<field x="20" y="0.5" type="Testo" align="center" width="4" pattern="1" text="2006" />
|
||||
<field x="25" y="0.5" type="Testo" align="center" width="4" pattern="1" text="2007" />
|
||||
<field x="30" y="0.5" type="Testo" align="center" width="4" pattern="1" text="2008" />
|
||||
<field x="35" y="0.5" type="Testo" align="center" width="4" pattern="1" text="2009" />
|
||||
<field x="40" y="0.5" type="Testo" align="center" width="4" pattern="1" text="2010" />
|
||||
<field x="45" y="0.5" type="Testo" align="center" width="4" pattern="1" text="2011" />
|
||||
<field x="50" y="0.5" type="Testo" align="center" width="4" pattern="1" text="2012" />
|
||||
<field x="55" y="0.5" type="Testo" align="center" width="4" pattern="1" text="2013" />
|
||||
<field x="60" y="0.5" type="Testo" align="center" width="4" pattern="1" text="2014" />
|
||||
<field x="65" y="0.5" type="Testo" align="center" width="4" pattern="1" text="2015" />
|
||||
<field x="70.5" y="0.75" type="Testo" align="center" width="12" pattern="1" text="CFF;pIVA" />
|
||||
<field border="1" x="1" y="1.5" type="Linea" width="80" height="0" pattern="1" />
|
||||
</section>
|
||||
<section type="Head" level="1" height="4.5">
|
||||
<prescript description="H1 PRESCRIPT">MESSAGE RESET,F1</prescript>
|
||||
<field border="1" radius="50" x="10" y="0.5" type="Testo" valign="center" align="center" shade_offset="50" width="60" height="3" text="STATISTICHE ARCHIVIAZIONE F24">
|
||||
<font face="Arial" bold="1" size="14" />
|
||||
</field>
|
||||
</section>
|
||||
<section type="Body" />
|
||||
<section type="Body" level="1">
|
||||
<field x="2" type="Stringa" width="16" pattern="1">
|
||||
<source>CODICE_FISCALE</source>
|
||||
<prescript description="B1.0 PRESCRIPT">MESSAGE RESET,B1.200</prescript>
|
||||
</field>
|
||||
<field x="19.5" type="Numero" align="right" width="4" pattern="1" hide_zero="1">
|
||||
<source>F24_2006</source>
|
||||
<prescript description="B1.0 PRESCRIPT">MESSAGE ADD,B1.200
|
||||
MESSAGE ADD,F1.101</prescript>
|
||||
</field>
|
||||
<field x="24.5" type="Numero" align="right" width="4" pattern="1" hide_zero="1">
|
||||
<source>F24_2007</source>
|
||||
<prescript description="B1.0 PRESCRIPT">MESSAGE ADD,B1.200
|
||||
MESSAGE ADD,F1.102</prescript>
|
||||
</field>
|
||||
<field x="29.5" type="Numero" align="right" width="4" pattern="1" hide_zero="1">
|
||||
<source>F24_2008</source>
|
||||
<prescript description="B1.0 PRESCRIPT">MESSAGE ADD,B1.200
|
||||
MESSAGE ADD,F1.103</prescript>
|
||||
</field>
|
||||
<field x="34.5" type="Numero" align="right" width="4" pattern="1" hide_zero="1">
|
||||
<source>F24_2009</source>
|
||||
<prescript description="B1.0 PRESCRIPT">MESSAGE ADD,B1.200
|
||||
MESSAGE ADD,F1.104</prescript>
|
||||
</field>
|
||||
<field x="39.5" type="Numero" align="right" width="4" pattern="1" hide_zero="1">
|
||||
<source>F24_2010</source>
|
||||
<prescript description="B1.0 PRESCRIPT">MESSAGE ADD,B1.200
|
||||
MESSAGE ADD,F1.105</prescript>
|
||||
</field>
|
||||
<field x="44.5" type="Numero" align="right" width="4" pattern="1" hide_zero="1">
|
||||
<source>F24_2011</source>
|
||||
<prescript description="B1.0 PRESCRIPT">MESSAGE ADD,B1.200
|
||||
MESSAGE ADD,F1.106</prescript>
|
||||
</field>
|
||||
<field x="49.5" type="Numero" align="right" width="4" pattern="1" hide_zero="1">
|
||||
<source>F24_2012</source>
|
||||
<prescript description="B1.0 PRESCRIPT">MESSAGE ADD,B1.200
|
||||
MESSAGE ADD,F1.107</prescript>
|
||||
</field>
|
||||
<field x="54.5" type="Numero" align="right" width="4" pattern="1" hide_zero="1">
|
||||
<source>F24_2013</source>
|
||||
<prescript description="B1.0 PRESCRIPT">MESSAGE ADD,B1.200
|
||||
MESSAGE ADD,F1.108</prescript>
|
||||
</field>
|
||||
<field x="59.5" type="Numero" align="right" width="4" pattern="1" hide_zero="1">
|
||||
<source>F24_2014</source>
|
||||
<prescript description="B1.0 PRESCRIPT">MESSAGE ADD,B1.200
|
||||
MESSAGE ADD,F1.109</prescript>
|
||||
</field>
|
||||
<field x="64.5" type="Numero" align="right" width="4" pattern="1" hide_zero="1">
|
||||
<source>F24_2015</source>
|
||||
<prescript description="B1.0 PRESCRIPT">MESSAGE ADD,B1.200
|
||||
MESSAGE ADD,F1.110</prescript>
|
||||
</field>
|
||||
<field x="74" type="Numero" align="right" width="5" id="200" pattern="1">
|
||||
<prescript description="B1.200 PRESCRIPT">MESSAGE ADD,F1.200</prescript>
|
||||
</field>
|
||||
</section>
|
||||
<section type="Foot">
|
||||
<field x="71" y="0.5" type="Testo" width="5" pattern="1" text="Pag." />
|
||||
<field x="76" y="0.5" type="Numero" align="right" width="3" pattern="1">
|
||||
<source>#REPORT.PAGE</source>
|
||||
</field>
|
||||
</section>
|
||||
<section type="Foot" level="1">
|
||||
<font italic="1" face="Arial" bold="1" size="8" />
|
||||
<field border="1" x="1" y="0.25" type="Linea" width="80" height="0" pattern="1" />
|
||||
<field x="1" y="0.75" type="Testo" width="15" pattern="1" text="Totali per anno" />
|
||||
<field x="18.5" y="0.75" type="Numero" align="right" width="5" id="101" pattern="1" />
|
||||
<field x="23.5" y="0.75" type="Numero" align="right" width="5" id="102" pattern="1" />
|
||||
<field x="28.5" y="0.75" type="Numero" align="right" width="5" id="103" pattern="1" />
|
||||
<field x="33.5" y="0.75" type="Numero" align="right" width="5" id="104" pattern="1" />
|
||||
<field x="38.5" y="0.75" type="Numero" align="right" width="5" id="105" pattern="1" />
|
||||
<field x="43.5" y="0.75" type="Numero" align="right" width="5" id="106" pattern="1" />
|
||||
<field x="48.5" y="0.75" type="Numero" align="right" width="5" id="107" pattern="1" />
|
||||
<field x="53.5" y="0.75" type="Numero" align="right" width="5" id="108" pattern="1" />
|
||||
<field x="58.5" y="0.75" type="Numero" align="right" width="5" id="109" pattern="1" />
|
||||
<field x="63.5" y="0.75" type="Numero" align="right" width="5" id="110" pattern="1" />
|
||||
<field x="73" y="0.75" type="Numero" align="right" width="6" id="200" pattern="1" />
|
||||
</section>
|
||||
</report>
|
@ -35,20 +35,37 @@ ENDPAGE
|
||||
|
||||
TOOLBAR "" 0 0 0 2
|
||||
|
||||
#include <elabar.h>
|
||||
BUTTON DLG_OK 2 2
|
||||
BEGIN
|
||||
PROMPT 1 1 "~Archivia"
|
||||
PICTURE TOOL_ELABORA
|
||||
END
|
||||
|
||||
BUTTON DLG_NULL 2 2
|
||||
BEGIN
|
||||
PROMPT 2 1 ""
|
||||
END
|
||||
|
||||
BUTTON DLG_PRINT 2 2
|
||||
BEGIN
|
||||
PROMPT 5 1 "~Statistiche"
|
||||
PROMPT 3 1 "~Stampa"
|
||||
PICTURE TOOL_PRINTELENCO
|
||||
END
|
||||
|
||||
BUTTON DLG_PREVIEW 2 2
|
||||
BEGIN
|
||||
PROMPT 4 1 "A~nteprima"
|
||||
PICTURE TOOL_PREVIEW
|
||||
END
|
||||
|
||||
BUTTON DLG_EXPORT 2 2
|
||||
BEGIN
|
||||
PROMPT 6 1 "~Excel"
|
||||
PROMPT 5 1 "~Excel"
|
||||
PICTURE TOOL_EXCEL
|
||||
END
|
||||
|
||||
#include <helpbar.h>
|
||||
|
||||
ENDPAGE
|
||||
|
||||
ENDMASK
|
||||
|
Loading…
x
Reference in New Issue
Block a user