Patch level : 12.0 1122
Files correlati : ca3.exe ca3100.msk ca3200.msk ca3300.msk ca3600.msk ca3700.msk ca3700b.rep ca3800.msk ca3900.msk Commento : Ripristinata l'esportazione sintetica del rendiconto corretta la selezione dei report era possibile selezionare un report non compatibile
This commit is contained in:
parent
7bc044d36f
commit
784ec2bba4
@ -333,7 +333,7 @@ protected:
|
|||||||
virtual TReport & get_report(const TAutomask & m);
|
virtual TReport & get_report(const TAutomask & m);
|
||||||
virtual TTrec * get_dbase_recdesc(TReport & rep, const TAutomask & mask);
|
virtual TTrec * get_dbase_recdesc(TReport & rep, const TAutomask & mask);
|
||||||
virtual TAutomask & get_mask();
|
virtual TAutomask & get_mask();
|
||||||
virtual void execute_print(TReport_book & book, TAutomask & mask, TReport & rep, export_type type = _export_printer);
|
virtual void execute_print(TReport_book & book, TAutomask & mask, TReport & rep, export_type & type);
|
||||||
virtual const char * output_name(const TAutomask & mask, const TReport & rep) const { return "lmov"; }
|
virtual const char * output_name(const TAutomask & mask, const TReport & rep) const { return "lmov"; }
|
||||||
// @cmember Distruzione dei dati dell'utente
|
// @cmember Distruzione dei dati dell'utente
|
||||||
virtual bool user_destroy();
|
virtual bool user_destroy();
|
||||||
@ -389,7 +389,7 @@ TAutomask & TPrint_movimenti_ca::get_mask()
|
|||||||
return *_mask;
|
return *_mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TPrint_movimenti_ca::execute_print(TReport_book & book, TAutomask & mask, TReport & rep, export_type type)
|
void TPrint_movimenti_ca::execute_print(TReport_book & book, TAutomask & mask, TReport & rep, export_type & type)
|
||||||
{
|
{
|
||||||
//costruzione della query x il report in base ai parametri della maschera
|
//costruzione della query x il report in base ai parametri della maschera
|
||||||
TSheet_field & sheet = mask.sfield(F_RIGHE);
|
TSheet_field & sheet = mask.sfield(F_RIGHE);
|
||||||
|
@ -565,7 +565,7 @@ protected:
|
|||||||
virtual TReport & get_report(const TAutomask & m);
|
virtual TReport & get_report(const TAutomask & m);
|
||||||
virtual TAutomask & get_mask();
|
virtual TAutomask & get_mask();
|
||||||
virtual TTrec * get_dbase_recdesc(TReport & rep, const TAutomask & mask);
|
virtual TTrec * get_dbase_recdesc(TReport & rep, const TAutomask & mask);
|
||||||
virtual void execute_print(TReport_book & book, TAutomask & mask, TReport & rep, export_type type = _export_printer);
|
virtual void execute_print(TReport_book & book, TAutomask & mask, TReport & rep, export_type & type);
|
||||||
virtual const char * output_name(const TAutomask & mask, const TReport & rep) const { return "mastrini"; }
|
virtual const char * output_name(const TAutomask & mask, const TReport & rep) const { return "mastrini"; }
|
||||||
// @cmember Distruzione dei dati dell'utente
|
// @cmember Distruzione dei dati dell'utente
|
||||||
virtual bool user_destroy() { return true; }
|
virtual bool user_destroy() { return true; }
|
||||||
@ -635,7 +635,7 @@ TTrec * TPrint_mastrini_ca::get_dbase_recdesc(TReport & rep, const TAutomask & m
|
|||||||
return desc;
|
return desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TPrint_mastrini_ca::execute_print(TReport_book & book, TAutomask & mask, TReport & rep, export_type type)
|
void TPrint_mastrini_ca::execute_print(TReport_book & book, TAutomask & mask, TReport & rep, export_type & type)
|
||||||
{
|
{
|
||||||
TSheet_field& sheet = _mask->sfield(F_RIGHE);
|
TSheet_field& sheet = _mask->sfield(F_RIGHE);
|
||||||
TString msg; //stringa che compare nella progind
|
TString msg; //stringa che compare nella progind
|
||||||
|
@ -1114,7 +1114,7 @@ protected:
|
|||||||
virtual TTrec * get_dbase_recdesc(TReport & rep, const TAutomask & mask);
|
virtual TTrec * get_dbase_recdesc(TReport & rep, const TAutomask & mask);
|
||||||
// @cmember Ritorna il report
|
// @cmember Ritorna il report
|
||||||
virtual TReport & get_report(const TAutomask & m);
|
virtual TReport & get_report(const TAutomask & m);
|
||||||
virtual void execute_print(TReport_book & book, TAutomask & mask, TReport & rep, export_type type = _export_printer);
|
virtual void execute_print(TReport_book & book, TAutomask & mask, TReport & rep, export_type & type);
|
||||||
virtual const char * output_name(const TAutomask & mask, const TReport & rep) const { return "bilancio"; }
|
virtual const char * output_name(const TAutomask & mask, const TReport & rep) const { return "bilancio"; }
|
||||||
virtual bool user_destroy();
|
virtual bool user_destroy();
|
||||||
|
|
||||||
@ -1343,7 +1343,7 @@ void TPrint_bilancio_ca::fill_sheet(int livello)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TPrint_bilancio_ca::execute_print(TReport_book & book, TAutomask & mask, TReport & rep, export_type type)
|
void TPrint_bilancio_ca::execute_print(TReport_book & book, TAutomask & mask, TReport & rep, export_type & type)
|
||||||
{
|
{
|
||||||
TSheet_field& sf = _mask->sfield(F_RIGHE);
|
TSheet_field& sf = _mask->sfield(F_RIGHE);
|
||||||
|
|
||||||
|
@ -1080,7 +1080,7 @@ protected:
|
|||||||
virtual TReport & get_report(const TAutomask & m);
|
virtual TReport & get_report(const TAutomask & m);
|
||||||
virtual TTrec * get_dbase_recdesc(TReport & rep, const TAutomask & mask);
|
virtual TTrec * get_dbase_recdesc(TReport & rep, const TAutomask & mask);
|
||||||
virtual TAutomask & get_mask();
|
virtual TAutomask & get_mask();
|
||||||
virtual void execute_print(TReport_book & book, TAutomask & mask, TReport & rep, export_type type = _export_printer);
|
virtual void execute_print(TReport_book & book, TAutomask & mask, TReport & rep, export_type & type);
|
||||||
virtual const char * output_name(const TAutomask & mask, const TReport & rep) const { return "pagcms"; }
|
virtual const char * output_name(const TAutomask & mask, const TReport & rep) const { return "pagcms"; }
|
||||||
// @cmember Distruzione dei dati dell'utente
|
// @cmember Distruzione dei dati dell'utente
|
||||||
virtual bool user_destroy();
|
virtual bool user_destroy();
|
||||||
@ -1198,7 +1198,7 @@ void TPag_per_cms::stampa_per_commessa(const TPag_per_cms_mask& mask, TReport_bo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TPag_per_cms::execute_print(TReport_book & book, TAutomask & mask, TReport & rep, export_type type)
|
void TPag_per_cms::execute_print(TReport_book & book, TAutomask & mask, TReport & rep, export_type & type)
|
||||||
{
|
{
|
||||||
//il programma si puo' usare SOLO se in contabilita' analitica si usa il piano dei conti contabile
|
//il programma si puo' usare SOLO se in contabilita' analitica si usa il piano dei conti contabile
|
||||||
TConfig& cfg = ca_config();
|
TConfig& cfg = ca_config();
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#include <applicat.h>
|
#include <applicat.h>
|
||||||
#include <defmask.h>
|
#include <defmask.h>
|
||||||
#include <execp.h>
|
#include <execp.h>
|
||||||
|
#include <golem.h>
|
||||||
#include <progind.h>
|
#include <progind.h>
|
||||||
#include <repapp.h>
|
#include <repapp.h>
|
||||||
#include <textset.h>
|
#include <textset.h>
|
||||||
@ -71,6 +72,15 @@ bool TPrint_rendiconto_ca_mask::on_field_event(TOperable_field& o, TField_event
|
|||||||
if (e == fe_init)
|
if (e == fe_init)
|
||||||
set_report_class();
|
set_report_class();
|
||||||
break;
|
break;
|
||||||
|
case F_EXPSINT:
|
||||||
|
if (e == fe_button)
|
||||||
|
{
|
||||||
|
TString path = get(DLG_OUTPUTD);
|
||||||
|
|
||||||
|
if (path.empty())
|
||||||
|
return error_box(TR("Specificare una cartella dove creare il file rendiconto.xls!"));
|
||||||
|
}
|
||||||
|
break;
|
||||||
case F_DATAINI:
|
case F_DATAINI:
|
||||||
case F_DATAFIN:
|
case F_DATAFIN:
|
||||||
if (e == fe_close)
|
if (e == fe_close)
|
||||||
@ -325,7 +335,7 @@ public:
|
|||||||
const TString& conto, char tipo) const; // per l'elaborazione batch
|
const TString& conto, char tipo) const; // per l'elaborazione batch
|
||||||
|
|
||||||
TPrint_rendiconto_ca_recordset(const TString& sql);
|
TPrint_rendiconto_ca_recordset(const TString& sql);
|
||||||
~TPrint_rendiconto_ca_recordset();
|
~TPrint_rendiconto_ca_recordset() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
TPrint_rendiconto_ca_recordset::TPrint_rendiconto_ca_recordset(const TString& sql)
|
TPrint_rendiconto_ca_recordset::TPrint_rendiconto_ca_recordset(const TString& sql)
|
||||||
@ -362,11 +372,6 @@ TPrint_rendiconto_ca_recordset::TPrint_rendiconto_ca_recordset(const TString& sq
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TPrint_rendiconto_ca_recordset::~TPrint_rendiconto_ca_recordset()
|
|
||||||
{ }
|
|
||||||
|
|
||||||
|
|
||||||
//filtro ulteriore sul file rendy.dbf già creato
|
//filtro ulteriore sul file rendy.dbf già creato
|
||||||
//questo filtro, all'apparenza inutile, serve per filtrare sulle rmovana create al volo dagli rdoc..
|
//questo filtro, all'apparenza inutile, serve per filtrare sulle rmovana create al volo dagli rdoc..
|
||||||
//..che potrebbero presentare conti non pertinenti dovuti ai conti stessi legati ai codart ecc.
|
//..che potrebbero presentare conti non pertinenti dovuti ai conti stessi legati ai codart ecc.
|
||||||
@ -1984,6 +1989,36 @@ void TPrint_rendiconto_ca_recordset::set_filter(const TPrint_rendiconto_ca_mask&
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////
|
||||||
|
// CSV RECORDSET
|
||||||
|
///////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
class TCSV_rendiconto_ca_recordset : public TCSV_recordset
|
||||||
|
{
|
||||||
|
TString4 _contsep;
|
||||||
|
|
||||||
|
public: //da libreria
|
||||||
|
virtual const TVariant& get(unsigned int column_name) const;
|
||||||
|
|
||||||
|
TCSV_rendiconto_ca_recordset(const TString& contsep) : TCSV_recordset("CSV(\"\t\")"), _contsep(contsep) {}
|
||||||
|
~TCSV_rendiconto_ca_recordset() {}
|
||||||
|
};
|
||||||
|
|
||||||
|
const TVariant& TCSV_rendiconto_ca_recordset::get(unsigned int column_name) const
|
||||||
|
{
|
||||||
|
|
||||||
|
if (column_name == 100)
|
||||||
|
{
|
||||||
|
const TString fld(column_name);
|
||||||
|
|
||||||
|
if (fld == "#CONTSEP")
|
||||||
|
return get_tmp_var() = _contsep;
|
||||||
|
|
||||||
|
}
|
||||||
|
return TCSV_recordset::get(column_name);
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////
|
||||||
// REPORT
|
// REPORT
|
||||||
////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////
|
||||||
@ -2047,7 +2082,7 @@ class TPrint_rendiconto_ca : public TReport_application
|
|||||||
protected:
|
protected:
|
||||||
void esporta_csv_row(ostream& file_to_date, const int first_level, const TString& cod_cms_cdc,
|
void esporta_csv_row(ostream& file_to_date, const int first_level, const TString& cod_cms_cdc,
|
||||||
const real importi[5][4], real importi_totali[5][4]);
|
const real importi[5][4], real importi_totali[5][4]);
|
||||||
void esporta_csv(TPrint_rendiconto_ca_recordset& rendy, const int r, TReport_book book, bool reset);
|
void esporta_csv(TPrint_rendiconto_ca_recordset& rendy, const TFilename & datefname, const TFilename & printfname, const int r, TReport_book book, bool reset);
|
||||||
void incrementa(TToken_string& riga, const int col, const real& valore) const;
|
void incrementa(TToken_string& riga, const int col, const real& valore) const;
|
||||||
void crea_trr(const TFilename& trr) const;
|
void crea_trr(const TFilename& trr) const;
|
||||||
virtual void export_pdf(TFilename & name, TReport_book & book, TAutomask & mask, TReport & rep);
|
virtual void export_pdf(TFilename & name, TReport_book & book, TAutomask & mask, TReport & rep);
|
||||||
@ -2055,7 +2090,7 @@ protected:
|
|||||||
virtual TReport & get_report(const TAutomask & m);
|
virtual TReport & get_report(const TAutomask & m);
|
||||||
virtual TTrec * get_dbase_recdesc(TReport & rep, const TAutomask & mask);
|
virtual TTrec * get_dbase_recdesc(TReport & rep, const TAutomask & mask);
|
||||||
virtual TAutomask & get_mask();
|
virtual TAutomask & get_mask();
|
||||||
virtual void execute_print(TReport_book & book, TAutomask & mask, TReport & rep, export_type type = _export_printer);
|
virtual void execute_print(TReport_book & book, TAutomask & mask, TReport & rep, export_type & type);
|
||||||
virtual const char * output_name(const TAutomask & mask, const TReport & rep) const { return "rend"; }
|
virtual const char * output_name(const TAutomask & mask, const TReport & rep) const { return "rend"; }
|
||||||
// @cmember Distruzione dei dati dell'utente
|
// @cmember Distruzione dei dati dell'utente
|
||||||
virtual bool user_destroy();
|
virtual bool user_destroy();
|
||||||
@ -2204,23 +2239,16 @@ void TPrint_rendiconto_ca::esporta_csv_row(ostream& file_to_date, const int firs
|
|||||||
}
|
}
|
||||||
|
|
||||||
//metodo di alto livello per l'esportazione dei dati di totale in un file per excel
|
//metodo di alto livello per l'esportazione dei dati di totale in un file per excel
|
||||||
void TPrint_rendiconto_ca::esporta_csv(TPrint_rendiconto_ca_recordset& rendy, const int r, TReport_book book, bool reset)
|
void TPrint_rendiconto_ca::esporta_csv(TPrint_rendiconto_ca_recordset& rendy, const TFilename & datefname, const TFilename & printfname, const int r, TReport_book book, bool reset)
|
||||||
{
|
{
|
||||||
//primo livello di configurazione
|
//primo livello di configurazione
|
||||||
const int first_level = get_first_level().logic();
|
const int first_level = get_first_level().logic();
|
||||||
//piano dei conti riclassificato?
|
//piano dei conti riclassificato?
|
||||||
TConfig& cfg = ca_config();
|
TConfig& cfg = ca_config();
|
||||||
const bool riclassificato = cfg.get_bool("UsePdcc");
|
const bool riclassificato = cfg.get_bool("UsePdcc");
|
||||||
|
|
||||||
//aggiorna il file da esportare appendendo la nuova riga
|
//aggiorna il file da esportare appendendo la nuova riga
|
||||||
TFilename path = _msk->get(F_PATH);
|
ofstream file_to_date(datefname, ios::app);
|
||||||
path.lower();
|
ofstream file_to_print(printfname, reset ? ios::trunc : ios::app);
|
||||||
path.add("rendiconto.xls");
|
|
||||||
ofstream file_to_date(path, ios::app);
|
|
||||||
TFilename paths = _msk->get(F_PATH);
|
|
||||||
paths.lower();
|
|
||||||
paths.add("rend.xls");
|
|
||||||
ofstream file_to_print(paths, reset ? ios::trunc : ios::app);
|
|
||||||
|
|
||||||
const bool invert_cosric = _msk->get_bool(F_REV_COSRIC);
|
const bool invert_cosric = _msk->get_bool(F_REV_COSRIC);
|
||||||
|
|
||||||
@ -2580,205 +2608,201 @@ void TPrint_rendiconto_ca::export_pdf(TFilename & name, TReport_book & book, TAu
|
|||||||
TReport_application::export_pdf(name, book, mask, rep);
|
TReport_application::export_pdf(name, book, mask, rep);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TPrint_rendiconto_ca::execute_print(TReport_book & book, TAutomask & mask, TReport & rep, export_type type)
|
void TPrint_rendiconto_ca::execute_print(TReport_book & book, TAutomask & mask, TReport & rep, export_type & type)
|
||||||
{
|
{
|
||||||
TPrint_rendiconto_ca_rep & ca_rep = (TPrint_rendiconto_ca_rep &)rep;
|
TPrint_rendiconto_ca_rep & ca_rep = (TPrint_rendiconto_ca_rep &)rep;
|
||||||
TPrint_rendiconto_ca_mask & ca_mask = (TPrint_rendiconto_ca_mask &)mask;
|
TPrint_rendiconto_ca_mask & ca_mask = (TPrint_rendiconto_ca_mask &)mask;
|
||||||
const int first_level = get_first_level().logic(); //primo livello nella configurazione CA
|
const int first_level = get_first_level().logic(); //primo livello nella configurazione CA
|
||||||
// TString arg(argv(2));
|
// TString arg(argv(2));
|
||||||
TEsercizi_contabili esc;
|
TEsercizi_contabili esc;
|
||||||
|
TFilename datefilename = get_output_filename(mask, rep);
|
||||||
|
TFilename printfilename = datefilename.path();
|
||||||
|
|
||||||
/* arg.lower();
|
datefilename.ext("xls"),
|
||||||
if (arg.starts_with("-b"))
|
printfilename.add("rend.xls");
|
||||||
{
|
/* arg.lower();
|
||||||
export_rendiconto();
|
if (arg.starts_with("-b"))
|
||||||
return;
|
{
|
||||||
} */
|
export_rendiconto();
|
||||||
|
return;
|
||||||
|
} */
|
||||||
//chiave di ordinamento del recordset; di base è 1 (utilizzato per la stampa); va lasciata qui per essere resettata..
|
//chiave di ordinamento del recordset; di base è 1 (utilizzato per la stampa); va lasciata qui per essere resettata..
|
||||||
//..ad ogni giro, in modo da sistemarsi quando si passa da esportazione a stampa e viceversa!
|
//..ad ogni giro, in modo da sistemarsi quando si passa da esportazione a stampa e viceversa!
|
||||||
int recset_key = 1;
|
int recset_key = 1;
|
||||||
|
|
||||||
//resetta e prepara le intestazioni del file rendiconto.xls
|
//resetta e prepara le intestazioni del file rendiconto.xls
|
||||||
/* i< (key == K_F6)
|
if (user_key() == K_F6)
|
||||||
|
{
|
||||||
|
|
||||||
|
ofstream file_to_date(datefilename);
|
||||||
|
|
||||||
|
const int posizione_importi = first_level == LF_COMMESSE ? 5 : 2;
|
||||||
|
|
||||||
|
//intestazione primaria
|
||||||
|
TToken_string intestazione_1(512, '\t');
|
||||||
|
//l'intestazione primaria dipende anche dalla configurazione dei livelli!
|
||||||
|
if (first_level == LF_COMMESSE) //commessa-cdc
|
||||||
{
|
{
|
||||||
TFilename file_xls = mask.get(F_PATH);
|
intestazione_1.add("Commessa");
|
||||||
file_xls.lower();
|
intestazione_1.add("Descr. commessa");
|
||||||
file_xls.add("rendiconto.xls");
|
intestazione_1.add("Data inizio");
|
||||||
ofstream file_to_date(file_xls);
|
intestazione_1.add("Data fine");
|
||||||
|
intestazione_1.add("Data proroga");
|
||||||
|
recset_key = 2; //chiave del recordset per commessa
|
||||||
|
}
|
||||||
|
else //cdc-commessa
|
||||||
|
{
|
||||||
|
intestazione_1.add("C.d.C.");
|
||||||
|
intestazione_1.add("Descr. cdc");
|
||||||
|
recset_key = 3; //chiave del recordset per centro di costo
|
||||||
|
}
|
||||||
|
|
||||||
const int posizione_importi = first_level == LF_COMMESSE ? 5 : 2;
|
for (int i = 0; i < 4; i++)
|
||||||
|
{
|
||||||
//intestazione primaria
|
switch (i)
|
||||||
TToken_string intestazione_1(512, '\t');
|
|
||||||
//l'intestazione primaria dipende anche dalla configurazione dei livelli!
|
|
||||||
if (first_level == LF_COMMESSE) //commessa-cdc
|
|
||||||
{
|
{
|
||||||
intestazione_1.add("Commessa");
|
case 0: intestazione_1.add("Costi"); break;
|
||||||
intestazione_1.add("Descr. commessa");
|
case 1: intestazione_1.add("Ricavi"); break;
|
||||||
intestazione_1.add("Data inizio");
|
case 2: intestazione_1.add("Attività"); break;
|
||||||
intestazione_1.add("Data fine");
|
case 3: intestazione_1.add("Passività"); break;
|
||||||
intestazione_1.add("Data proroga");
|
|
||||||
recset_key = 2; //chiave del recordset per commessa
|
|
||||||
}
|
|
||||||
else //cdc-commessa
|
|
||||||
{
|
|
||||||
intestazione_1.add("C.d.C.");
|
|
||||||
intestazione_1.add("Descr. cdc");
|
|
||||||
recset_key = 3; //chiave del recordset per centro di costo
|
|
||||||
}
|
}
|
||||||
|
for (int j = 0; j < 6; j++)
|
||||||
|
intestazione_1.add("");
|
||||||
|
}
|
||||||
|
file_to_date << intestazione_1 << endl;
|
||||||
|
|
||||||
for (int i = 0; i < 4; i++)
|
//intestazione secondaria
|
||||||
|
TToken_string intestazione_2(512, '\t');
|
||||||
|
//campi descrittivi iniziali vuoti (solo intestazione_1)
|
||||||
|
intestazione_2.add(" ", posizione_importi - 1);
|
||||||
|
|
||||||
|
for (int l = 0; l < 4; l++)
|
||||||
|
{
|
||||||
|
for (int n = 0; n < 7; n++)
|
||||||
{
|
{
|
||||||
switch (i)
|
switch (n)
|
||||||
{
|
{
|
||||||
case 0: intestazione_1.add("Costi"); break;
|
case 0: intestazione_2.add("Budget"); break;
|
||||||
case 1: intestazione_1.add("Ricavi"); break;
|
case 1: intestazione_2.add("Impegnato"); break;
|
||||||
case 2: intestazione_1.add("Attività"); break;
|
case 2: intestazione_2.add("Maturato"); break;
|
||||||
case 3: intestazione_1.add("Passività"); break;
|
case 3: intestazione_2.add("Fatturato"); break;
|
||||||
}
|
case 4: intestazione_2.add("Da impegnare"); break;
|
||||||
for (int j = 0; j < 6; j++)
|
case 5: intestazione_2.add("Da maturare"); break;
|
||||||
intestazione_1.add("");
|
case 6: intestazione_2.add("Da fatturare"); break;
|
||||||
}
|
|
||||||
file_to_date << intestazione_1 << endl;
|
|
||||||
|
|
||||||
//intestazione secondaria
|
|
||||||
TToken_string intestazione_2(512, '\t');
|
|
||||||
//campi descrittivi iniziali vuoti (solo intestazione_1)
|
|
||||||
intestazione_2.add(" ", posizione_importi - 1);
|
|
||||||
|
|
||||||
for (int l = 0; l < 4; l++)
|
|
||||||
{
|
|
||||||
for (int n = 0; n < 7; n++)
|
|
||||||
{
|
|
||||||
switch (n)
|
|
||||||
{
|
|
||||||
case 0: intestazione_2.add("Budget"); break;
|
|
||||||
case 1: intestazione_2.add("Impegnato"); break;
|
|
||||||
case 2: intestazione_2.add("Maturato"); break;
|
|
||||||
case 3: intestazione_2.add("Fatturato"); break;
|
|
||||||
case 4: intestazione_2.add("Da impegnare"); break;
|
|
||||||
case 5: intestazione_2.add("Da maturare"); break;
|
|
||||||
case 6: intestazione_2.add("Da fatturare"); break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_to_date << intestazione_2 << endl;
|
}
|
||||||
} //if(key==K_F6)
|
file_to_date << intestazione_2 << endl;
|
||||||
*/
|
} //if(key==K_F6)
|
||||||
|
//log report con segnalazioni su errori (tipo conti inesistenti o robaccia simile..)
|
||||||
|
TLog_report log(TR("Errori rilevati"));
|
||||||
|
|
||||||
//log report con segnalazioni su errori (tipo conti inesistenti o robaccia simile..)
|
log.kill_duplicates();
|
||||||
TLog_report log(TR("Errori rilevati"));
|
|
||||||
|
|
||||||
log.kill_duplicates();
|
TSheet_field& sheet = mask.sfield(F_RIGHE);
|
||||||
|
TString video_string; //stringa che compare nella progind
|
||||||
|
TDate dataini, datafin;
|
||||||
|
const int anno = mask.get_int(F_ANNO);
|
||||||
|
const bool attive = mask.get_bool(F_ATTIVA);
|
||||||
|
|
||||||
TSheet_field& sheet = mask.sfield(F_RIGHE);
|
if (sheet.empty()) //se non ci sono righe sullo sheet (selezione su tutte le cms/cdc)...
|
||||||
TString video_string; //stringa che compare nella progind
|
{
|
||||||
TDate dataini, datafin;
|
TToken_string& row = sheet.row(-1); //crea la prima riga dello sheet
|
||||||
const int anno = mask.get_int(F_ANNO);
|
|
||||||
const bool attive = mask.get_bool(F_ATTIVA);
|
|
||||||
|
|
||||||
if (sheet.empty()) //se non ci sono righe sullo sheet (selezione su tutte le cms/cdc)...
|
//si amplia il range di ricerca temporale di 1 anno nel passato perchè i movana..
|
||||||
|
//..preventivi possono essere stati decisi prima dell'inizio effettivo commessa
|
||||||
|
if (anno > 0) //se non è stata specificata alcuna dataini, ma è stato specificato un anno di esercizio...
|
||||||
{
|
{
|
||||||
TToken_string& row = sheet.row(-1); //crea la prima riga dello sheet
|
TEsercizi_contabili esc;
|
||||||
|
esc.code2range(anno, dataini, datafin);
|
||||||
|
}
|
||||||
|
if (!mask.field(F_DATAINI).empty())
|
||||||
|
dataini = mask.get_date(F_DATAINI);
|
||||||
|
if (!mask.field(F_DATAFIN).empty())
|
||||||
|
datafin = mask.get_date(F_DATAFIN);
|
||||||
|
|
||||||
//si amplia il range di ricerca temporale di 1 anno nel passato perchè i movana..
|
const TMultilevel_code_info& liv1 = get_first_level(); //stabilisce quale è il primo livello (tra CDC e CMS)..
|
||||||
//..preventivi possono essere stati decisi prima dell'inizio effettivo commessa
|
const bool is_cms = liv1.logic() == LF_COMMESSE;
|
||||||
if (anno > 0) //se non è stata specificata alcuna dataini, ma è stato specificato un anno di esercizio...
|
TISAM_recordset set(is_cms ? "USE COMMESSE" : "USE CDC"); //..e di conseguenza scrive la use giusta
|
||||||
|
|
||||||
|
TProgress_monitor pi(set.items(), video_string, true);
|
||||||
|
for (int i = 0; pi.add_status() && set.move_to(i); i++) //fighissimo metodo per scandire un file in 1 riga!
|
||||||
|
{
|
||||||
|
//Filtro sulle date
|
||||||
|
//DATE VALIDE STRETTAMENTE PER COMMESSE
|
||||||
|
//per prima cosa controlla se veramente la commessa rientri nei parametri temporali impostati sulla maschera
|
||||||
|
//Se infatti è completamente al di fuori di tale intervallo, che cavolo la controlla a fare
|
||||||
|
row = set.get((unsigned int)0).as_string(); //prende il valore del primo campo del file (CDC o CMS code)
|
||||||
|
|
||||||
|
if (is_cms)
|
||||||
{
|
{
|
||||||
TEsercizi_contabili esc;
|
if (attive)
|
||||||
esc.code2range(anno, dataini, datafin);
|
|
||||||
}
|
|
||||||
if (!mask.field(F_DATAINI).empty())
|
|
||||||
dataini = mask.get_date(F_DATAINI);
|
|
||||||
if (!mask.field(F_DATAFIN).empty())
|
|
||||||
datafin = mask.get_date(F_DATAFIN);
|
|
||||||
|
|
||||||
const TMultilevel_code_info& liv1 = get_first_level(); //stabilisce quale è il primo livello (tra CDC e CMS)..
|
|
||||||
const bool is_cms = liv1.logic() == LF_COMMESSE;
|
|
||||||
TISAM_recordset set(is_cms ? "USE COMMESSE" : "USE CDC"); //..e di conseguenza scrive la use giusta
|
|
||||||
|
|
||||||
TProgress_monitor pi(set.items(), video_string, true);
|
|
||||||
for (int i = 0; pi.add_status() && set.move_to(i); i++) //fighissimo metodo per scandire un file in 1 riga!
|
|
||||||
{
|
|
||||||
//Filtro sulle date
|
|
||||||
//DATE VALIDE STRETTAMENTE PER COMMESSE
|
|
||||||
//per prima cosa controlla se veramente la commessa rientri nei parametri temporali impostati sulla maschera
|
|
||||||
//Se infatti è completamente al di fuori di tale intervallo, che cavolo la controlla a fare
|
|
||||||
row = set.get((unsigned int)0).as_string(); //prende il valore del primo campo del file (CDC o CMS code)
|
|
||||||
|
|
||||||
if (is_cms)
|
|
||||||
{
|
{
|
||||||
if (attive)
|
const TRectype& rec_commesse = set.cursor()->curr();
|
||||||
|
|
||||||
|
if (!ca_commessa_attiva(rec_commesse, dataini, datafin))
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (dataini.ok() || datafin.ok())
|
||||||
{
|
{
|
||||||
const TRectype& rec_commesse = set.cursor()->curr();
|
const TRectype& rec_commesse = set.cursor()->curr();
|
||||||
|
TDate datainicms, datafcomp;
|
||||||
if (!ca_commessa_attiva(rec_commesse, dataini, datafin))
|
ca_durata_commessa(rec_commesse, datainicms, datafcomp);
|
||||||
|
if ((dataini.ok() && datafcomp < dataini) || (datafin.ok() && datainicms > datafin))
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
if (dataini.ok() || datafin.ok())
|
|
||||||
{
|
|
||||||
const TRectype& rec_commesse = set.cursor()->curr();
|
|
||||||
TDate datainicms, datafcomp;
|
|
||||||
ca_durata_commessa(rec_commesse, datainicms, datafcomp);
|
|
||||||
if ((dataini.ok() && datafcomp < dataini) || (datafin.ok() && datainicms > datafin))
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
video_string = TR("Scansione");
|
video_string = TR("Scansione");
|
||||||
video_string << " " << row; //completa la stringa da visualizzare sulla progind
|
video_string << " " << row; //completa la stringa da visualizzare sulla progind
|
||||||
pi.set_text(video_string);
|
pi.set_text(video_string);
|
||||||
|
|
||||||
for (int l = liv1.levels() - 2; l >= 0; l--) //se la struttura è a più livelli costruisce la tokenstring
|
for (int l = liv1.levels() - 2; l >= 0; l--) //se la struttura è a più livelli costruisce la tokenstring
|
||||||
row.insert("|", liv1.total_len(l));
|
row.insert("|", liv1.total_len(l));
|
||||||
|
|
||||||
ca_rep.set_filter(ca_mask, 0, recset_key, log); //fa la set filter sulla prima riga (che è quella usata)
|
ca_rep.set_filter(ca_mask, 0, recset_key, log); //fa la set filter sulla prima riga (che è quella usata)
|
||||||
|
|
||||||
//se stampa o anteprima..
|
//se stampa o anteprima..
|
||||||
/* if (key == K_F6)
|
if (user_key() == K_F6)
|
||||||
esporta_csv((TPrint_rendiconto_ca_recordset&)*rep.recordset(), 0, book, i == 0); //esportazione in excel
|
esporta_csv((TPrint_rendiconto_ca_recordset&)*rep.recordset(), datefilename, printfilename, 0, book, i == 0); //esportazione in excel
|
||||||
else */
|
else
|
||||||
|
{
|
||||||
rep.set_export_sections(type);
|
rep.set_export_sections(type);
|
||||||
book.add(rep);
|
book.add(rep);
|
||||||
rep.reset_export_sections();
|
rep.reset_export_sections();
|
||||||
}
|
}
|
||||||
sheet.destroy(); //cancella le commesse aggiunte in automatico sullo sheet
|
|
||||||
}
|
}
|
||||||
else //se ha almeno una riga sullo sheet delle cms/cdc...
|
sheet.destroy(); //cancella le commesse aggiunte in automatico sullo sheet
|
||||||
|
}
|
||||||
|
else //se ha almeno una riga sullo sheet delle cms/cdc...
|
||||||
|
{
|
||||||
|
FOR_EACH_SHEET_ROW(sheet, r, row) //per ogni cdc/cms che appare nello sheet di pag.1 della msk..
|
||||||
{
|
{
|
||||||
FOR_EACH_SHEET_ROW(sheet, r, row) //per ogni cdc/cms che appare nello sheet di pag.1 della msk..
|
ca_rep.set_filter(ca_mask, r, recset_key, log); //..chiama il metodone globale che crea e compila il file..
|
||||||
|
//..temporaneo i cui dati riempiranno il report
|
||||||
|
//se stampa o anteprima
|
||||||
|
if (user_key() == K_F6) //esportazione in excel sintetica
|
||||||
|
esporta_csv((TPrint_rendiconto_ca_recordset&)*rep.recordset(), datefilename, printfilename, r, book, r == 0); //il recordset è del tipo TPrint_rendiconto
|
||||||
|
else
|
||||||
{
|
{
|
||||||
ca_rep.set_filter(ca_mask, r, recset_key, log); //..chiama il metodone globale che crea e compila il file..
|
|
||||||
//..temporaneo i cui dati riempiranno il report
|
|
||||||
//se stampa o anteprima
|
|
||||||
/*if (key == K_F6) //esportazione in excel
|
|
||||||
esporta_csv((TPrint_rendiconto_ca_recordset&)*rep.recordset(), r, book, r == 0); //il recordset è del tipo TPrint_rendiconto
|
|
||||||
else */
|
|
||||||
rep.set_export_sections(type);
|
rep.set_export_sections(type);
|
||||||
book.add(rep); //aggiunge il report relativo alla cdc/cms corrente al book
|
book.add(rep); //aggiunge il report relativo alla cdc/cms corrente al book
|
||||||
rep.reset_export_sections();
|
rep.reset_export_sections();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//anteprima report degli errori rilevati
|
}
|
||||||
if (log.recordset()->items() > 0)
|
//anteprima report degli errori rilevati
|
||||||
log.preview();
|
if (user_key() == K_F6)
|
||||||
|
|
||||||
/* TReport rep_xls;
|
|
||||||
|
|
||||||
path = "ca3700b";
|
|
||||||
rep_xls.load(path);
|
|
||||||
|
|
||||||
if (key == K_F6)
|
|
||||||
{
|
{
|
||||||
|
TReport rep_xls;
|
||||||
|
|
||||||
|
rep_xls.load("ca3700b");
|
||||||
TCSV_recordset xls_source("CSV(\"\t\")");
|
TCSV_recordset xls_source("CSV(\"\t\")");
|
||||||
TCSV_recordset * xls_dest = new TCSV_recordset("CSV(\"\t\")");
|
TCSV_rendiconto_ca_recordset * xls_dest = new TCSV_rendiconto_ca_recordset(mask.get(F_CONTSEP));
|
||||||
TFilename paths = _msk->get(F_PATH);
|
|
||||||
TString val;
|
TString val;
|
||||||
|
|
||||||
paths.lower();
|
xls_source.load_file(printfilename);
|
||||||
paths.add("rend.xls");
|
|
||||||
xls_source.load_file(paths);
|
|
||||||
|
|
||||||
const TEsercizio & e = esc.esercizio(anno == 0 ? (datafin.ok() ? datafin.year() : dataini.year()) : anno);
|
const TEsercizio & e = esc.esercizio(anno == 0 ? (datafin.ok() ? datafin.year() : dataini.year()) : anno);
|
||||||
const int ncols = xls_source.columns();
|
const int ncols = xls_source.columns();
|
||||||
@ -2810,7 +2834,11 @@ void TPrint_rendiconto_ca::execute_print(TReport_book & book, TAutomask & mask,
|
|||||||
}
|
}
|
||||||
rep_xls.TReport::set_recordset(xls_dest);
|
rep_xls.TReport::set_recordset(xls_dest);
|
||||||
book.add(rep_xls);
|
book.add(rep_xls);
|
||||||
} */
|
goto_url(datefilename);
|
||||||
|
book.print_or_preview();
|
||||||
|
}
|
||||||
|
if (log.recordset()->items() > 0)
|
||||||
|
log.preview();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TPrint_rendiconto_ca::user_destroy()
|
bool TPrint_rendiconto_ca::user_destroy()
|
||||||
|
@ -11,10 +11,10 @@
|
|||||||
#define F_REV_COSRIC 258
|
#define F_REV_COSRIC 258
|
||||||
#define F_IMPLODE_ROWS 259
|
#define F_IMPLODE_ROWS 259
|
||||||
#define F_VITAINTERA 261
|
#define F_VITAINTERA 261
|
||||||
#define F_PATH 262
|
|
||||||
#define F_ATTIVA 263
|
#define F_ATTIVA 263
|
||||||
#define F_CONTSEP 264
|
#define F_CONTSEP 264
|
||||||
#define F_DESCONTSEP 265
|
#define F_DESCONTSEP 265
|
||||||
|
#define F_EXPSINT 266
|
||||||
|
|
||||||
//campi generati dai piani dei conti
|
//campi generati dai piani dei conti
|
||||||
#define F_PIANO 319
|
#define F_PIANO 319
|
||||||
|
@ -5,13 +5,16 @@
|
|||||||
#define CLASS_NAME "ca3700"
|
#define CLASS_NAME "ca3700"
|
||||||
|
|
||||||
TOOLBAR "topbar" 0 0 0 2
|
TOOLBAR "topbar" 0 0 0 2
|
||||||
#include <aprintbar.h>
|
|
||||||
/*BUTTON DLG_EXPORT 2 2
|
BUTTON F_EXPSINT 2 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 1 "~Esporta XLS"
|
PROMPT 1 1 "Esportazione ~Sintetica"
|
||||||
MESSAGE EXIT,K_F6
|
MESSAGE EXIT,K_F6
|
||||||
PICTURE TOOL_EXCEL
|
PICTURE TOOL_EXCEL
|
||||||
END*/
|
END
|
||||||
|
|
||||||
|
#include <aprintbar.h>
|
||||||
|
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
|
|
||||||
TOOLBAR "bottombar" 0 -3 0 1
|
TOOLBAR "bottombar" 0 -3 0 1
|
||||||
|
@ -39,14 +39,14 @@
|
|||||||
<field x="82" deactivated="" type="Data" hidden="" link="" dynamic_height="" shade_offset="" width="10" codval="" id="204" pattern="1" hide_zero="" text="">
|
<field x="82" deactivated="" type="Data" hidden="" link="" dynamic_height="" shade_offset="" width="10" codval="" id="204" pattern="1" hide_zero="" text="">
|
||||||
<source>#SYSTEM.DATE</source>
|
<source>#SYSTEM.DATE</source>
|
||||||
</field>
|
</field>
|
||||||
<field x="117" deactivated="" type="Testo" valign="center" hidden="" link="" dynamic_height="" shade_offset="" width="25" codval="" height="2.5" id="205" pattern="1" hide_zero="" text="Contabilit&#E0; separata">
|
<field x="167.5" y="1.25" deactivated="" type="Testo" valign="center" hidden="" link="" dynamic_height="" shade_offset="" width="20" codval="" id="205" pattern="1" hide_zero="" text="Contabilit&#E0; separata">
|
||||||
<font face="Arial Narrow" bold="1" size="16" />
|
<font face="Arial" size="10" />
|
||||||
<modules>NP</modules>
|
<modules>NP</modules>
|
||||||
</field>
|
</field>
|
||||||
<field x="146" deactivated="" type="Stringa" valign="center" hidden="" link="" dynamic_height="" shade_offset="" width="18" codval="" height="2.5" id="206" pattern="1" hide_zero="" text="">
|
<field x="188.5" y="1.25" deactivated="" type="Stringa" valign="center" hidden="" link="" dynamic_height="" shade_offset="" width="4" codval="" id="206" pattern="1" hide_zero="" text="">
|
||||||
<font face="Courier New" bold="1" size="16" />
|
<font face="Courier New" size="10" />
|
||||||
<modules>NP</modules>
|
<modules>NP</modules>
|
||||||
<source>#CONTSEP</source>
|
<source>100</source>
|
||||||
</field>
|
</field>
|
||||||
<field x="186" deactivated="" type="Testo" hidden="" link="" dynamic_height="" shade_offset="" width="4" codval="" id="207" pattern="1" hide_zero="" text="Pag.">
|
<field x="186" deactivated="" type="Testo" hidden="" link="" dynamic_height="" shade_offset="" width="4" codval="" id="207" pattern="1" hide_zero="" text="Pag.">
|
||||||
<font italic="1" face="Arial Narrow" size="7" />
|
<font italic="1" face="Arial Narrow" size="7" />
|
||||||
|
@ -23,7 +23,6 @@ protected:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
const TString& get_report_class() const;
|
const TString& get_report_class() const;
|
||||||
void execute_print(TReport_book & book, TAutomask & mask, TReport & rep, export_type type);
|
|
||||||
|
|
||||||
TPrint_bilancio_cms_mask();
|
TPrint_bilancio_cms_mask();
|
||||||
virtual ~TPrint_bilancio_cms_mask() {}
|
virtual ~TPrint_bilancio_cms_mask() {}
|
||||||
@ -217,7 +216,7 @@ protected:
|
|||||||
virtual TReport & get_report(const TAutomask & m);
|
virtual TReport & get_report(const TAutomask & m);
|
||||||
// @cmember ritorna la maschera
|
// @cmember ritorna la maschera
|
||||||
virtual TAutomask & get_mask();
|
virtual TAutomask & get_mask();
|
||||||
virtual void execute_print(TReport_book & book,TAutomask & mask, TReport & rep, export_type type = _export_printer);
|
virtual void execute_print(TReport_book & book,TAutomask & mask, TReport & rep, export_type & type);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual const char * title() const { return TR("Stampa bilancio di commessa"); }
|
virtual const char * title() const { return TR("Stampa bilancio di commessa"); }
|
||||||
@ -281,7 +280,7 @@ void TPrint_bilancio_cms::build_lista_cdc(TString_array & lista_cdc, const TStri
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TPrint_bilancio_cms::execute_print(TReport_book & book, TAutomask & mask, TReport & rep, export_type type)
|
void TPrint_bilancio_cms::execute_print(TReport_book & book, TAutomask & mask, TReport & rep, export_type & type)
|
||||||
{
|
{
|
||||||
const int tipostampa = _mask->get_int(F_TIPOSTAMPA);
|
const int tipostampa = _mask->get_int(F_TIPOSTAMPA);
|
||||||
//fasi
|
//fasi
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#include "ca3883a.h"
|
#include "ca3883a.h"
|
||||||
|
|
||||||
#define ALL_EXPORT
|
#define ALL_EXPORT
|
||||||
#define CLASS_NAME "ca3800"
|
#define CLASS_NAME "ca3800a"
|
||||||
|
|
||||||
TOOLBAR "topbar" 0 0 0 2
|
TOOLBAR "topbar" 0 0 0 2
|
||||||
#include <aprintbar.h>
|
#include <aprintbar.h>
|
||||||
|
@ -137,7 +137,7 @@ protected:
|
|||||||
virtual TReport & get_report(const TAutomask & m);
|
virtual TReport & get_report(const TAutomask & m);
|
||||||
virtual TTrec * get_dbase_recdesc(TReport & rep, const TAutomask & mask);
|
virtual TTrec * get_dbase_recdesc(TReport & rep, const TAutomask & mask);
|
||||||
virtual TAutomask & get_mask();
|
virtual TAutomask & get_mask();
|
||||||
virtual void execute_print(TReport_book & book, TAutomask & mask, TReport & rep, export_type type = _export_printer);
|
virtual void execute_print(TReport_book & book, TAutomask & mask, TReport & rep, export_type & type);
|
||||||
virtual const char * output_name(const TAutomask & mask, const TReport & rep) const { return "stimaric"; }
|
virtual const char * output_name(const TAutomask & mask, const TReport & rep) const { return "stimaric"; }
|
||||||
virtual bool user_destroy();
|
virtual bool user_destroy();
|
||||||
|
|
||||||
@ -192,7 +192,7 @@ TTrec * TPrint_stima_ricavi::get_dbase_recdesc(TReport & rep, const TAutomask &
|
|||||||
desc->add_keydef(keydef, true);
|
desc->add_keydef(keydef, true);
|
||||||
return desc;
|
return desc;
|
||||||
}
|
}
|
||||||
void TPrint_stima_ricavi::execute_print(TReport_book & book, TAutomask & mask, TReport & rep, export_type type)
|
void TPrint_stima_ricavi::execute_print(TReport_book & book, TAutomask & mask, TReport & rep, export_type & type)
|
||||||
{
|
{
|
||||||
((TPrint_stima_ricavi_rep &)rep).set_filter((TPrint_stima_ricavi_mask &)mask);
|
((TPrint_stima_ricavi_rep &)rep).set_filter((TPrint_stima_ricavi_mask &)mask);
|
||||||
rep.set_export_sections(type);
|
rep.set_export_sections(type);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user